diff --git a/clients/client-accessanalyzer/protocols/Aws_restJson1.ts b/clients/client-accessanalyzer/protocols/Aws_restJson1.ts index f7dad99dcd7b..b14ce132ae72 100644 --- a/clients/client-accessanalyzer/protocols/Aws_restJson1.ts +++ b/clients/client-accessanalyzer/protocols/Aws_restJson1.ts @@ -65,18 +65,20 @@ export const serializeAws_restJson1CreateAnalyzerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/analyzer"; let body: any; body = JSON.stringify({ - ...(input.analyzerName !== undefined && { analyzerName: input.analyzerName }), - ...(input.archiveRules !== undefined && { - archiveRules: serializeAws_restJson1InlineArchiveRulesList(input.archiveRules, context), - }), + ...(input.analyzerName !== undefined && input.analyzerName !== null && { analyzerName: input.analyzerName }), + ...(input.archiveRules !== undefined && + input.archiveRules !== null && { + archiveRules: serializeAws_restJson1InlineArchiveRulesList(input.archiveRules, context), + }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -95,7 +97,7 @@ export const serializeAws_restJson1CreateArchiveRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/analyzer/{analyzerName}/archive-rule"; if (input.analyzerName !== undefined) { @@ -110,8 +112,9 @@ export const serializeAws_restJson1CreateArchiveRuleCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.filter !== undefined && { filter: serializeAws_restJson1FilterCriteriaMap(input.filter, context) }), - ...(input.ruleName !== undefined && { ruleName: input.ruleName }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_restJson1FilterCriteriaMap(input.filter, context) }), + ...(input.ruleName !== undefined && input.ruleName !== null && { ruleName: input.ruleName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -129,9 +132,7 @@ export const serializeAws_restJson1DeleteAnalyzerCommand = async ( input: DeleteAnalyzerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/analyzer/{analyzerName}"; if (input.analyzerName !== undefined) { const labelValue: string = input.analyzerName; @@ -163,9 +164,7 @@ export const serializeAws_restJson1DeleteArchiveRuleCommand = async ( input: DeleteArchiveRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/analyzer/{analyzerName}/archive-rule/{ruleName}"; if (input.analyzerName !== undefined) { const labelValue: string = input.analyzerName; @@ -206,9 +205,7 @@ export const serializeAws_restJson1GetAnalyzedResourceCommand = async ( input: GetAnalyzedResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/analyzed-resource"; const query: any = { ...(input.analyzerArn !== undefined && { analyzerArn: input.analyzerArn }), @@ -232,9 +229,7 @@ export const serializeAws_restJson1GetAnalyzerCommand = async ( input: GetAnalyzerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/analyzer/{analyzerName}"; if (input.analyzerName !== undefined) { const labelValue: string = input.analyzerName; @@ -262,9 +257,7 @@ export const serializeAws_restJson1GetArchiveRuleCommand = async ( input: GetArchiveRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/analyzer/{analyzerName}/archive-rule/{ruleName}"; if (input.analyzerName !== undefined) { const labelValue: string = input.analyzerName; @@ -301,9 +294,7 @@ export const serializeAws_restJson1GetFindingCommand = async ( input: GetFindingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/finding/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -336,15 +327,15 @@ export const serializeAws_restJson1ListAnalyzedResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/analyzed-resource"; let body: any; body = JSON.stringify({ - ...(input.analyzerArn !== undefined && { analyzerArn: input.analyzerArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceType !== undefined && { resourceType: input.resourceType }), + ...(input.analyzerArn !== undefined && input.analyzerArn !== null && { analyzerArn: input.analyzerArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceType !== undefined && input.resourceType !== null && { resourceType: input.resourceType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -362,9 +353,7 @@ export const serializeAws_restJson1ListAnalyzersCommand = async ( input: ListAnalyzersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/analyzer"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -389,9 +378,7 @@ export const serializeAws_restJson1ListArchiveRulesCommand = async ( input: ListArchiveRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/analyzer/{analyzerName}/archive-rule"; if (input.analyzerName !== undefined) { const labelValue: string = input.analyzerName; @@ -425,16 +412,18 @@ export const serializeAws_restJson1ListFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/finding"; let body: any; body = JSON.stringify({ - ...(input.analyzerArn !== undefined && { analyzerArn: input.analyzerArn }), - ...(input.filter !== undefined && { filter: serializeAws_restJson1FilterCriteriaMap(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sort !== undefined && { sort: serializeAws_restJson1SortCriteria(input.sort, context) }), + ...(input.analyzerArn !== undefined && input.analyzerArn !== null && { analyzerArn: input.analyzerArn }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_restJson1FilterCriteriaMap(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sort !== undefined && + input.sort !== null && { sort: serializeAws_restJson1SortCriteria(input.sort, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -452,9 +441,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -483,13 +470,13 @@ export const serializeAws_restJson1StartResourceScanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/resource/scan"; let body: any; body = JSON.stringify({ - ...(input.analyzerArn !== undefined && { analyzerArn: input.analyzerArn }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.analyzerArn !== undefined && input.analyzerArn !== null && { analyzerArn: input.analyzerArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -508,7 +495,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -522,7 +509,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -540,9 +528,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -575,7 +561,7 @@ export const serializeAws_restJson1UpdateArchiveRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/analyzer/{analyzerName}/archive-rule/{ruleName}"; if (input.analyzerName !== undefined) { @@ -599,7 +585,8 @@ export const serializeAws_restJson1UpdateArchiveRuleCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.filter !== undefined && { filter: serializeAws_restJson1FilterCriteriaMap(input.filter, context) }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_restJson1FilterCriteriaMap(input.filter, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -618,16 +605,17 @@ export const serializeAws_restJson1UpdateFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/finding"; let body: any; body = JSON.stringify({ - ...(input.analyzerArn !== undefined && { analyzerArn: input.analyzerArn }), + ...(input.analyzerArn !== undefined && input.analyzerArn !== null && { analyzerArn: input.analyzerArn }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.ids !== undefined && { ids: serializeAws_restJson1FindingIdList(input.ids, context) }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.status !== undefined && { status: input.status }), + ...(input.ids !== undefined && + input.ids !== null && { ids: serializeAws_restJson1FindingIdList(input.ids, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2362,61 +2350,95 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1Criterion = (input: Criterion, context: __SerdeContext): any => { return { - ...(input.contains !== undefined && { contains: serializeAws_restJson1ValueList(input.contains, context) }), - ...(input.eq !== undefined && { eq: serializeAws_restJson1ValueList(input.eq, context) }), - ...(input.exists !== undefined && { exists: input.exists }), - ...(input.neq !== undefined && { neq: serializeAws_restJson1ValueList(input.neq, context) }), + ...(input.contains !== undefined && + input.contains !== null && { contains: serializeAws_restJson1ValueList(input.contains, context) }), + ...(input.eq !== undefined && input.eq !== null && { eq: serializeAws_restJson1ValueList(input.eq, context) }), + ...(input.exists !== undefined && input.exists !== null && { exists: input.exists }), + ...(input.neq !== undefined && input.neq !== null && { neq: serializeAws_restJson1ValueList(input.neq, context) }), }; }; const serializeAws_restJson1FilterCriteriaMap = (input: { [key: string]: Criterion }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Criterion }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Criterion }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1Criterion(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1FindingIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1InlineArchiveRule = (input: InlineArchiveRule, context: __SerdeContext): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_restJson1FilterCriteriaMap(input.filter, context) }), - ...(input.ruleName !== undefined && { ruleName: input.ruleName }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_restJson1FilterCriteriaMap(input.filter, context) }), + ...(input.ruleName !== undefined && input.ruleName !== null && { ruleName: input.ruleName }), }; }; const serializeAws_restJson1InlineArchiveRulesList = (input: InlineArchiveRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1InlineArchiveRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InlineArchiveRule(entry, context); + }); }; const serializeAws_restJson1SortCriteria = (input: SortCriteria, context: __SerdeContext): any => { return { - ...(input.attributeName !== undefined && { attributeName: input.attributeName }), - ...(input.orderBy !== undefined && { orderBy: input.orderBy }), + ...(input.attributeName !== undefined && input.attributeName !== null && { attributeName: input.attributeName }), + ...(input.orderBy !== undefined && input.orderBy !== null && { orderBy: input.orderBy }), }; }; const serializeAws_restJson1TagsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ActionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AnalyzedResource = (output: any, context: __SerdeContext): AnalyzedResource => { @@ -2448,7 +2470,14 @@ const deserializeAws_restJson1AnalyzedResourcesList = ( output: any, context: __SerdeContext ): AnalyzedResourceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AnalyzedResourceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AnalyzedResourceSummary(entry, context); + }); }; const deserializeAws_restJson1AnalyzedResourceSummary = ( @@ -2466,7 +2495,14 @@ const deserializeAws_restJson1AnalyzedResourceSummary = ( }; const deserializeAws_restJson1AnalyzersList = (output: any, context: __SerdeContext): AnalyzerSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AnalyzerSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AnalyzerSummary(entry, context); + }); }; const deserializeAws_restJson1AnalyzerSummary = (output: any, context: __SerdeContext): AnalyzerSummary => { @@ -2496,7 +2532,14 @@ const deserializeAws_restJson1AnalyzerSummary = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ArchiveRulesList = (output: any, context: __SerdeContext): ArchiveRuleSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ArchiveRuleSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ArchiveRuleSummary(entry, context); + }); }; const deserializeAws_restJson1ArchiveRuleSummary = (output: any, context: __SerdeContext): ArchiveRuleSummary => { @@ -2512,13 +2555,15 @@ const deserializeAws_restJson1ArchiveRuleSummary = (output: any, context: __Serd }; const deserializeAws_restJson1ConditionKeyMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Criterion = (output: any, context: __SerdeContext): Criterion => { @@ -2541,13 +2586,15 @@ const deserializeAws_restJson1FilterCriteriaMap = ( output: any, context: __SerdeContext ): { [key: string]: Criterion } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Criterion }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Criterion }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1Criterion(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Finding = (output: any, context: __SerdeContext): Finding => { @@ -2585,7 +2632,14 @@ const deserializeAws_restJson1Finding = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1FindingsList = (output: any, context: __SerdeContext): FindingSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FindingSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FindingSummary(entry, context); + }); }; const deserializeAws_restJson1FindingSource = (output: any, context: __SerdeContext): FindingSource => { @@ -2606,7 +2660,14 @@ const deserializeAws_restJson1FindingSourceDetail = (output: any, context: __Ser }; const deserializeAws_restJson1FindingSourceList = (output: any, context: __SerdeContext): FindingSource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FindingSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FindingSource(entry, context); + }); }; const deserializeAws_restJson1FindingSummary = (output: any, context: __SerdeContext): FindingSummary => { @@ -2644,17 +2705,26 @@ const deserializeAws_restJson1FindingSummary = (output: any, context: __SerdeCon }; const deserializeAws_restJson1PrincipalMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1SharedViaList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1StatusReason = (output: any, context: __SerdeContext): StatusReason => { @@ -2664,13 +2734,15 @@ const deserializeAws_restJson1StatusReason = (output: any, context: __SerdeConte }; const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ValidationExceptionField = ( @@ -2687,11 +2759,25 @@ const deserializeAws_restJson1ValidationExceptionFieldList = ( output: any, context: __SerdeContext ): ValidationExceptionField[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ValidationExceptionField(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ValidationExceptionField(entry, context); + }); }; const deserializeAws_restJson1ValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2714,6 +2800,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-acm-pca/protocols/Aws_json1_1.ts b/clients/client-acm-pca/protocols/Aws_json1_1.ts index 9e3e61880d9f..64f93e3a527a 100644 --- a/clients/client-acm-pca/protocols/Aws_json1_1.ts +++ b/clients/client-acm-pca/protocols/Aws_json1_1.ts @@ -140,7 +140,7 @@ export const serializeAws_json1_1CreateCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.CreateCertificateAuthority", }; let body: any; @@ -153,7 +153,7 @@ export const serializeAws_json1_1CreateCertificateAuthorityAuditReportCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.CreateCertificateAuthorityAuditReport", }; let body: any; @@ -166,7 +166,7 @@ export const serializeAws_json1_1CreatePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.CreatePermission", }; let body: any; @@ -179,7 +179,7 @@ export const serializeAws_json1_1DeleteCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.DeleteCertificateAuthority", }; let body: any; @@ -192,7 +192,7 @@ export const serializeAws_json1_1DeletePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.DeletePermission", }; let body: any; @@ -205,7 +205,7 @@ export const serializeAws_json1_1DeletePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.DeletePolicy", }; let body: any; @@ -218,7 +218,7 @@ export const serializeAws_json1_1DescribeCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.DescribeCertificateAuthority", }; let body: any; @@ -231,7 +231,7 @@ export const serializeAws_json1_1DescribeCertificateAuthorityAuditReportCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.DescribeCertificateAuthorityAuditReport", }; let body: any; @@ -244,7 +244,7 @@ export const serializeAws_json1_1GetCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.GetCertificate", }; let body: any; @@ -257,7 +257,7 @@ export const serializeAws_json1_1GetCertificateAuthorityCertificateCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.GetCertificateAuthorityCertificate", }; let body: any; @@ -270,7 +270,7 @@ export const serializeAws_json1_1GetCertificateAuthorityCsrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.GetCertificateAuthorityCsr", }; let body: any; @@ -283,7 +283,7 @@ export const serializeAws_json1_1GetPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.GetPolicy", }; let body: any; @@ -296,7 +296,7 @@ export const serializeAws_json1_1ImportCertificateAuthorityCertificateCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.ImportCertificateAuthorityCertificate", }; let body: any; @@ -309,7 +309,7 @@ export const serializeAws_json1_1IssueCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.IssueCertificate", }; let body: any; @@ -322,7 +322,7 @@ export const serializeAws_json1_1ListCertificateAuthoritiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.ListCertificateAuthorities", }; let body: any; @@ -335,7 +335,7 @@ export const serializeAws_json1_1ListPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.ListPermissions", }; let body: any; @@ -348,7 +348,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.ListTags", }; let body: any; @@ -361,7 +361,7 @@ export const serializeAws_json1_1PutPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.PutPolicy", }; let body: any; @@ -374,7 +374,7 @@ export const serializeAws_json1_1RestoreCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.RestoreCertificateAuthority", }; let body: any; @@ -387,7 +387,7 @@ export const serializeAws_json1_1RevokeCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.RevokeCertificate", }; let body: any; @@ -400,7 +400,7 @@ export const serializeAws_json1_1TagCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.TagCertificateAuthority", }; let body: any; @@ -413,7 +413,7 @@ export const serializeAws_json1_1UntagCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.UntagCertificateAuthority", }; let body: any; @@ -426,7 +426,7 @@ export const serializeAws_json1_1UpdateCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ACMPrivateCA.UpdateCertificateAuthority", }; let body: any; @@ -461,8 +461,7 @@ const deserializeAws_json1_1CreateCertificateAuthorityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgsException": case "com.amazonaws.acmpca#InvalidArgsException": @@ -540,8 +539,7 @@ const deserializeAws_json1_1CreateCertificateAuthorityAuditReportCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgsException": case "com.amazonaws.acmpca#InvalidArgsException": @@ -632,8 +630,7 @@ const deserializeAws_json1_1CreatePermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -724,8 +721,7 @@ const deserializeAws_json1_1DeleteCertificateAuthorityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.acmpca#ConcurrentModificationException": @@ -800,8 +796,7 @@ const deserializeAws_json1_1DeletePermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -876,8 +871,7 @@ const deserializeAws_json1_1DeletePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.acmpca#ConcurrentModificationException": @@ -971,8 +965,7 @@ const deserializeAws_json1_1DescribeCertificateAuthorityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -1034,8 +1027,7 @@ const deserializeAws_json1_1DescribeCertificateAuthorityAuditReportCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgsException": case "com.amazonaws.acmpca#InvalidArgsException": @@ -1105,8 +1097,7 @@ const deserializeAws_json1_1GetCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -1192,8 +1183,7 @@ const deserializeAws_json1_1GetCertificateAuthorityCertificateCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -1263,8 +1253,7 @@ const deserializeAws_json1_1GetCertificateAuthorityCsrCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -1350,8 +1339,7 @@ const deserializeAws_json1_1GetPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -1426,8 +1414,7 @@ const deserializeAws_json1_1ImportCertificateAuthorityCertificateCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CertificateMismatchException": case "com.amazonaws.acmpca#CertificateMismatchException": @@ -1545,8 +1532,7 @@ const deserializeAws_json1_1IssueCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgsException": case "com.amazonaws.acmpca#InvalidArgsException": @@ -1640,8 +1626,7 @@ const deserializeAws_json1_1ListCertificateAuthoritiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.acmpca#InvalidNextTokenException": @@ -1695,8 +1680,7 @@ const deserializeAws_json1_1ListPermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -1782,8 +1766,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -1850,8 +1833,7 @@ const deserializeAws_json1_1PutPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.acmpca#ConcurrentModificationException": @@ -1950,8 +1932,7 @@ const deserializeAws_json1_1RestoreCertificateAuthorityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -2018,8 +1999,7 @@ const deserializeAws_json1_1RevokeCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.acmpca#ConcurrentModificationException": @@ -2134,8 +2114,7 @@ const deserializeAws_json1_1TagCertificateAuthorityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -2218,8 +2197,7 @@ const deserializeAws_json1_1UntagCertificateAuthorityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acmpca#InvalidArnException": @@ -2294,8 +2272,7 @@ const deserializeAws_json1_1UpdateCertificateAuthorityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.acmpca#ConcurrentModificationException": @@ -2648,27 +2625,35 @@ const deserializeAws_json1_1TooManyTagsExceptionResponse = async ( }; const serializeAws_json1_1ActionList = (input: (ActionType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ASN1Subject = (input: ASN1Subject, context: __SerdeContext): any => { return { - ...(input.CommonName !== undefined && { CommonName: input.CommonName }), - ...(input.Country !== undefined && { Country: input.Country }), - ...(input.DistinguishedNameQualifier !== undefined && { - DistinguishedNameQualifier: input.DistinguishedNameQualifier, - }), - ...(input.GenerationQualifier !== undefined && { GenerationQualifier: input.GenerationQualifier }), - ...(input.GivenName !== undefined && { GivenName: input.GivenName }), - ...(input.Initials !== undefined && { Initials: input.Initials }), - ...(input.Locality !== undefined && { Locality: input.Locality }), - ...(input.Organization !== undefined && { Organization: input.Organization }), - ...(input.OrganizationalUnit !== undefined && { OrganizationalUnit: input.OrganizationalUnit }), - ...(input.Pseudonym !== undefined && { Pseudonym: input.Pseudonym }), - ...(input.SerialNumber !== undefined && { SerialNumber: input.SerialNumber }), - ...(input.State !== undefined && { State: input.State }), - ...(input.Surname !== undefined && { Surname: input.Surname }), - ...(input.Title !== undefined && { Title: input.Title }), + ...(input.CommonName !== undefined && input.CommonName !== null && { CommonName: input.CommonName }), + ...(input.Country !== undefined && input.Country !== null && { Country: input.Country }), + ...(input.DistinguishedNameQualifier !== undefined && + input.DistinguishedNameQualifier !== null && { DistinguishedNameQualifier: input.DistinguishedNameQualifier }), + ...(input.GenerationQualifier !== undefined && + input.GenerationQualifier !== null && { GenerationQualifier: input.GenerationQualifier }), + ...(input.GivenName !== undefined && input.GivenName !== null && { GivenName: input.GivenName }), + ...(input.Initials !== undefined && input.Initials !== null && { Initials: input.Initials }), + ...(input.Locality !== undefined && input.Locality !== null && { Locality: input.Locality }), + ...(input.Organization !== undefined && input.Organization !== null && { Organization: input.Organization }), + ...(input.OrganizationalUnit !== undefined && + input.OrganizationalUnit !== null && { OrganizationalUnit: input.OrganizationalUnit }), + ...(input.Pseudonym !== undefined && input.Pseudonym !== null && { Pseudonym: input.Pseudonym }), + ...(input.SerialNumber !== undefined && input.SerialNumber !== null && { SerialNumber: input.SerialNumber }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), + ...(input.Surname !== undefined && input.Surname !== null && { Surname: input.Surname }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), }; }; @@ -2677,9 +2662,11 @@ const serializeAws_json1_1CertificateAuthorityConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.KeyAlgorithm !== undefined && { KeyAlgorithm: input.KeyAlgorithm }), - ...(input.SigningAlgorithm !== undefined && { SigningAlgorithm: input.SigningAlgorithm }), - ...(input.Subject !== undefined && { Subject: serializeAws_json1_1ASN1Subject(input.Subject, context) }), + ...(input.KeyAlgorithm !== undefined && input.KeyAlgorithm !== null && { KeyAlgorithm: input.KeyAlgorithm }), + ...(input.SigningAlgorithm !== undefined && + input.SigningAlgorithm !== null && { SigningAlgorithm: input.SigningAlgorithm }), + ...(input.Subject !== undefined && + input.Subject !== null && { Subject: serializeAws_json1_1ASN1Subject(input.Subject, context) }), }; }; @@ -2688,11 +2675,11 @@ const serializeAws_json1_1CreateCertificateAuthorityAuditReportRequest = ( context: __SerdeContext ): any => { return { - ...(input.AuditReportResponseFormat !== undefined && { - AuditReportResponseFormat: input.AuditReportResponseFormat, - }), - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), + ...(input.AuditReportResponseFormat !== undefined && + input.AuditReportResponseFormat !== null && { AuditReportResponseFormat: input.AuditReportResponseFormat }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), }; }; @@ -2701,36 +2688,43 @@ const serializeAws_json1_1CreateCertificateAuthorityRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityConfiguration !== undefined && { - CertificateAuthorityConfiguration: serializeAws_json1_1CertificateAuthorityConfiguration( - input.CertificateAuthorityConfiguration, - context - ), - }), - ...(input.CertificateAuthorityType !== undefined && { CertificateAuthorityType: input.CertificateAuthorityType }), - ...(input.IdempotencyToken !== undefined && { IdempotencyToken: input.IdempotencyToken }), - ...(input.RevocationConfiguration !== undefined && { - RevocationConfiguration: serializeAws_json1_1RevocationConfiguration(input.RevocationConfiguration, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CertificateAuthorityConfiguration !== undefined && + input.CertificateAuthorityConfiguration !== null && { + CertificateAuthorityConfiguration: serializeAws_json1_1CertificateAuthorityConfiguration( + input.CertificateAuthorityConfiguration, + context + ), + }), + ...(input.CertificateAuthorityType !== undefined && + input.CertificateAuthorityType !== null && { CertificateAuthorityType: input.CertificateAuthorityType }), + ...(input.IdempotencyToken !== undefined && + input.IdempotencyToken !== null && { IdempotencyToken: input.IdempotencyToken }), + ...(input.RevocationConfiguration !== undefined && + input.RevocationConfiguration !== null && { + RevocationConfiguration: serializeAws_json1_1RevocationConfiguration(input.RevocationConfiguration, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreatePermissionRequest = (input: CreatePermissionRequest, context: __SerdeContext): any => { return { - ...(input.Actions !== undefined && { Actions: serializeAws_json1_1ActionList(input.Actions, context) }), - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.Principal !== undefined && { Principal: input.Principal }), - ...(input.SourceAccount !== undefined && { SourceAccount: input.SourceAccount }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_json1_1ActionList(input.Actions, context) }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.Principal !== undefined && input.Principal !== null && { Principal: input.Principal }), + ...(input.SourceAccount !== undefined && input.SourceAccount !== null && { SourceAccount: input.SourceAccount }), }; }; const serializeAws_json1_1CrlConfiguration = (input: CrlConfiguration, context: __SerdeContext): any => { return { - ...(input.CustomCname !== undefined && { CustomCname: input.CustomCname }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.ExpirationInDays !== undefined && { ExpirationInDays: input.ExpirationInDays }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), + ...(input.CustomCname !== undefined && input.CustomCname !== null && { CustomCname: input.CustomCname }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.ExpirationInDays !== undefined && + input.ExpirationInDays !== null && { ExpirationInDays: input.ExpirationInDays }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), }; }; @@ -2739,24 +2733,25 @@ const serializeAws_json1_1DeleteCertificateAuthorityRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.PermanentDeletionTimeInDays !== undefined && { - PermanentDeletionTimeInDays: input.PermanentDeletionTimeInDays, - }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.PermanentDeletionTimeInDays !== undefined && + input.PermanentDeletionTimeInDays !== null && { PermanentDeletionTimeInDays: input.PermanentDeletionTimeInDays }), }; }; const serializeAws_json1_1DeletePermissionRequest = (input: DeletePermissionRequest, context: __SerdeContext): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.Principal !== undefined && { Principal: input.Principal }), - ...(input.SourceAccount !== undefined && { SourceAccount: input.SourceAccount }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.Principal !== undefined && input.Principal !== null && { Principal: input.Principal }), + ...(input.SourceAccount !== undefined && input.SourceAccount !== null && { SourceAccount: input.SourceAccount }), }; }; const serializeAws_json1_1DeletePolicyRequest = (input: DeletePolicyRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -2765,8 +2760,9 @@ const serializeAws_json1_1DescribeCertificateAuthorityAuditReportRequest = ( context: __SerdeContext ): any => { return { - ...(input.AuditReportId !== undefined && { AuditReportId: input.AuditReportId }), - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.AuditReportId !== undefined && input.AuditReportId !== null && { AuditReportId: input.AuditReportId }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), }; }; @@ -2775,7 +2771,8 @@ const serializeAws_json1_1DescribeCertificateAuthorityRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), }; }; @@ -2784,7 +2781,8 @@ const serializeAws_json1_1GetCertificateAuthorityCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), }; }; @@ -2793,20 +2791,23 @@ const serializeAws_json1_1GetCertificateAuthorityCsrRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), }; }; const serializeAws_json1_1GetCertificateRequest = (input: GetCertificateRequest, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), }; }; const serializeAws_json1_1GetPolicyRequest = (input: GetPolicyRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -2815,20 +2816,27 @@ const serializeAws_json1_1ImportCertificateAuthorityCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.Certificate !== undefined && { Certificate: context.base64Encoder(input.Certificate) }), - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.CertificateChain !== undefined && { CertificateChain: context.base64Encoder(input.CertificateChain) }), + ...(input.Certificate !== undefined && + input.Certificate !== null && { Certificate: context.base64Encoder(input.Certificate) }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CertificateChain !== undefined && + input.CertificateChain !== null && { CertificateChain: context.base64Encoder(input.CertificateChain) }), }; }; const serializeAws_json1_1IssueCertificateRequest = (input: IssueCertificateRequest, context: __SerdeContext): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.Csr !== undefined && { Csr: context.base64Encoder(input.Csr) }), - ...(input.IdempotencyToken !== undefined && { IdempotencyToken: input.IdempotencyToken }), - ...(input.SigningAlgorithm !== undefined && { SigningAlgorithm: input.SigningAlgorithm }), - ...(input.TemplateArn !== undefined && { TemplateArn: input.TemplateArn }), - ...(input.Validity !== undefined && { Validity: serializeAws_json1_1Validity(input.Validity, context) }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.Csr !== undefined && input.Csr !== null && { Csr: context.base64Encoder(input.Csr) }), + ...(input.IdempotencyToken !== undefined && + input.IdempotencyToken !== null && { IdempotencyToken: input.IdempotencyToken }), + ...(input.SigningAlgorithm !== undefined && + input.SigningAlgorithm !== null && { SigningAlgorithm: input.SigningAlgorithm }), + ...(input.TemplateArn !== undefined && input.TemplateArn !== null && { TemplateArn: input.TemplateArn }), + ...(input.Validity !== undefined && + input.Validity !== null && { Validity: serializeAws_json1_1Validity(input.Validity, context) }), }; }; @@ -2837,32 +2845,34 @@ const serializeAws_json1_1ListCertificateAuthoritiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceOwner !== undefined && { ResourceOwner: input.ResourceOwner }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceOwner !== undefined && input.ResourceOwner !== null && { ResourceOwner: input.ResourceOwner }), }; }; const serializeAws_json1_1ListPermissionsRequest = (input: ListPermissionsRequest, context: __SerdeContext): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListTagsRequest = (input: ListTagsRequest, context: __SerdeContext): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1PutPolicyRequest = (input: PutPolicyRequest, context: __SerdeContext): any => { return { - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -2871,15 +2881,17 @@ const serializeAws_json1_1RestoreCertificateAuthorityRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), }; }; const serializeAws_json1_1RevocationConfiguration = (input: RevocationConfiguration, context: __SerdeContext): any => { return { - ...(input.CrlConfiguration !== undefined && { - CrlConfiguration: serializeAws_json1_1CrlConfiguration(input.CrlConfiguration, context), - }), + ...(input.CrlConfiguration !== undefined && + input.CrlConfiguration !== null && { + CrlConfiguration: serializeAws_json1_1CrlConfiguration(input.CrlConfiguration, context), + }), }; }; @@ -2888,16 +2900,19 @@ const serializeAws_json1_1RevokeCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.CertificateSerial !== undefined && { CertificateSerial: input.CertificateSerial }), - ...(input.RevocationReason !== undefined && { RevocationReason: input.RevocationReason }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CertificateSerial !== undefined && + input.CertificateSerial !== null && { CertificateSerial: input.CertificateSerial }), + ...(input.RevocationReason !== undefined && + input.RevocationReason !== null && { RevocationReason: input.RevocationReason }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -2906,13 +2921,21 @@ const serializeAws_json1_1TagCertificateAuthorityRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1UntagCertificateAuthorityRequest = ( @@ -2920,8 +2943,9 @@ const serializeAws_json1_1UntagCertificateAuthorityRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -2930,23 +2954,32 @@ const serializeAws_json1_1UpdateCertificateAuthorityRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.RevocationConfiguration !== undefined && { - RevocationConfiguration: serializeAws_json1_1RevocationConfiguration(input.RevocationConfiguration, context), - }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.RevocationConfiguration !== undefined && + input.RevocationConfiguration !== null && { + RevocationConfiguration: serializeAws_json1_1RevocationConfiguration(input.RevocationConfiguration, context), + }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; const serializeAws_json1_1Validity = (input: Validity, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const deserializeAws_json1_1ActionList = (output: any, context: __SerdeContext): (ActionType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ASN1Subject = (output: any, context: __SerdeContext): ASN1Subject => { @@ -2978,7 +3011,14 @@ const deserializeAws_json1_1ASN1Subject = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1CertificateAuthorities = (output: any, context: __SerdeContext): CertificateAuthority[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CertificateAuthority(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CertificateAuthority(entry, context); + }); }; const deserializeAws_json1_1CertificateAuthority = (output: any, context: __SerdeContext): CertificateAuthority => { @@ -3306,7 +3346,14 @@ const deserializeAws_json1_1PermissionAlreadyExistsException = ( }; const deserializeAws_json1_1PermissionList = (output: any, context: __SerdeContext): Permission[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Permission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Permission(entry, context); + }); }; const deserializeAws_json1_1RequestAlreadyProcessedException = ( @@ -3362,7 +3409,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TooManyTagsException = (output: any, context: __SerdeContext): TooManyTagsException => { @@ -3421,3 +3475,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-acm/protocols/Aws_json1_1.ts b/clients/client-acm/protocols/Aws_json1_1.ts index 86511b9738e4..850dd1a6af92 100644 --- a/clients/client-acm/protocols/Aws_json1_1.ts +++ b/clients/client-acm/protocols/Aws_json1_1.ts @@ -93,7 +93,7 @@ export const serializeAws_json1_1AddTagsToCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.AddTagsToCertificate", }; let body: any; @@ -106,7 +106,7 @@ export const serializeAws_json1_1DeleteCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.DeleteCertificate", }; let body: any; @@ -119,7 +119,7 @@ export const serializeAws_json1_1DescribeCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.DescribeCertificate", }; let body: any; @@ -132,7 +132,7 @@ export const serializeAws_json1_1ExportCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.ExportCertificate", }; let body: any; @@ -145,7 +145,7 @@ export const serializeAws_json1_1GetCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.GetCertificate", }; let body: any; @@ -158,7 +158,7 @@ export const serializeAws_json1_1ImportCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.ImportCertificate", }; let body: any; @@ -171,7 +171,7 @@ export const serializeAws_json1_1ListCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.ListCertificates", }; let body: any; @@ -184,7 +184,7 @@ export const serializeAws_json1_1ListTagsForCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.ListTagsForCertificate", }; let body: any; @@ -197,7 +197,7 @@ export const serializeAws_json1_1RemoveTagsFromCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.RemoveTagsFromCertificate", }; let body: any; @@ -210,7 +210,7 @@ export const serializeAws_json1_1RenewCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.RenewCertificate", }; let body: any; @@ -223,7 +223,7 @@ export const serializeAws_json1_1RequestCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.RequestCertificate", }; let body: any; @@ -236,7 +236,7 @@ export const serializeAws_json1_1ResendValidationEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.ResendValidationEmail", }; let body: any; @@ -249,7 +249,7 @@ export const serializeAws_json1_1UpdateCertificateOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CertificateManager.UpdateCertificateOptions", }; let body: any; @@ -281,8 +281,7 @@ const deserializeAws_json1_1AddTagsToCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -373,8 +372,7 @@ const deserializeAws_json1_1DeleteCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -444,8 +442,7 @@ const deserializeAws_json1_1DescribeCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -507,8 +504,7 @@ const deserializeAws_json1_1ExportCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -578,8 +574,7 @@ const deserializeAws_json1_1GetCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -649,8 +644,7 @@ const deserializeAws_json1_1ImportCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.acm#InvalidParameterException": @@ -744,8 +738,7 @@ const deserializeAws_json1_1ListCertificatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgsException": case "com.amazonaws.acm#InvalidArgsException": @@ -799,8 +792,7 @@ const deserializeAws_json1_1ListTagsForCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -859,8 +851,7 @@ const deserializeAws_json1_1RemoveTagsFromCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -943,8 +934,7 @@ const deserializeAws_json1_1RenewCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -1006,8 +996,7 @@ const deserializeAws_json1_1RequestCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -1106,8 +1095,7 @@ const deserializeAws_json1_1ResendValidationEmailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -1182,8 +1170,7 @@ const deserializeAws_json1_1UpdateCertificateOptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": @@ -1419,16 +1406,18 @@ const serializeAws_json1_1AddTagsToCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CertificateOptions = (input: CertificateOptions, context: __SerdeContext): any => { return { - ...(input.CertificateTransparencyLoggingPreference !== undefined && { - CertificateTransparencyLoggingPreference: input.CertificateTransparencyLoggingPreference, - }), + ...(input.CertificateTransparencyLoggingPreference !== undefined && + input.CertificateTransparencyLoggingPreference !== null && { + CertificateTransparencyLoggingPreference: input.CertificateTransparencyLoggingPreference, + }), }; }; @@ -1436,7 +1425,14 @@ const serializeAws_json1_1CertificateStatuses = ( input: (CertificateStatus | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteCertificateRequest = ( @@ -1444,7 +1440,8 @@ const serializeAws_json1_1DeleteCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), }; }; @@ -1453,18 +1450,27 @@ const serializeAws_json1_1DescribeCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), }; }; const serializeAws_json1_1DomainList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DomainValidationOption = (input: DomainValidationOption, context: __SerdeContext): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.ValidationDomain !== undefined && { ValidationDomain: input.ValidationDomain }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.ValidationDomain !== undefined && + input.ValidationDomain !== null && { ValidationDomain: input.ValidationDomain }), }; }; @@ -1472,7 +1478,14 @@ const serializeAws_json1_1DomainValidationOptionList = ( input: DomainValidationOption[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1DomainValidationOption(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DomainValidationOption(entry, context); + }); }; const serializeAws_json1_1ExportCertificateRequest = ( @@ -1480,8 +1493,10 @@ const serializeAws_json1_1ExportCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.Passphrase !== undefined && { Passphrase: context.base64Encoder(input.Passphrase) }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.Passphrase !== undefined && + input.Passphrase !== null && { Passphrase: context.base64Encoder(input.Passphrase) }), }; }; @@ -1489,22 +1504,33 @@ const serializeAws_json1_1ExtendedKeyUsageFilterList = ( input: (ExtendedKeyUsageName | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Filters = (input: Filters, context: __SerdeContext): any => { return { - ...(input.extendedKeyUsage !== undefined && { - extendedKeyUsage: serializeAws_json1_1ExtendedKeyUsageFilterList(input.extendedKeyUsage, context), - }), - ...(input.keyTypes !== undefined && { keyTypes: serializeAws_json1_1KeyAlgorithmList(input.keyTypes, context) }), - ...(input.keyUsage !== undefined && { keyUsage: serializeAws_json1_1KeyUsageFilterList(input.keyUsage, context) }), + ...(input.extendedKeyUsage !== undefined && + input.extendedKeyUsage !== null && { + extendedKeyUsage: serializeAws_json1_1ExtendedKeyUsageFilterList(input.extendedKeyUsage, context), + }), + ...(input.keyTypes !== undefined && + input.keyTypes !== null && { keyTypes: serializeAws_json1_1KeyAlgorithmList(input.keyTypes, context) }), + ...(input.keyUsage !== undefined && + input.keyUsage !== null && { keyUsage: serializeAws_json1_1KeyUsageFilterList(input.keyUsage, context) }), }; }; const serializeAws_json1_1GetCertificateRequest = (input: GetCertificateRequest, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), }; }; @@ -1513,30 +1539,50 @@ const serializeAws_json1_1ImportCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.Certificate !== undefined && { Certificate: context.base64Encoder(input.Certificate) }), - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.CertificateChain !== undefined && { CertificateChain: context.base64Encoder(input.CertificateChain) }), - ...(input.PrivateKey !== undefined && { PrivateKey: context.base64Encoder(input.PrivateKey) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Certificate !== undefined && + input.Certificate !== null && { Certificate: context.base64Encoder(input.Certificate) }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.CertificateChain !== undefined && + input.CertificateChain !== null && { CertificateChain: context.base64Encoder(input.CertificateChain) }), + ...(input.PrivateKey !== undefined && + input.PrivateKey !== null && { PrivateKey: context.base64Encoder(input.PrivateKey) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1KeyAlgorithmList = (input: (KeyAlgorithm | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1KeyUsageFilterList = (input: (KeyUsageName | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListCertificatesRequest = (input: ListCertificatesRequest, context: __SerdeContext): any => { return { - ...(input.CertificateStatuses !== undefined && { - CertificateStatuses: serializeAws_json1_1CertificateStatuses(input.CertificateStatuses, context), - }), - ...(input.Includes !== undefined && { Includes: serializeAws_json1_1Filters(input.Includes, context) }), - ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CertificateStatuses !== undefined && + input.CertificateStatuses !== null && { + CertificateStatuses: serializeAws_json1_1CertificateStatuses(input.CertificateStatuses, context), + }), + ...(input.Includes !== undefined && + input.Includes !== null && { Includes: serializeAws_json1_1Filters(input.Includes, context) }), + ...(input.MaxItems !== undefined && input.MaxItems !== null && { MaxItems: input.MaxItems }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -1545,7 +1591,8 @@ const serializeAws_json1_1ListTagsForCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), }; }; @@ -1554,14 +1601,16 @@ const serializeAws_json1_1RemoveTagsFromCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1RenewCertificateRequest = (input: RenewCertificateRequest, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), }; }; @@ -1570,18 +1619,24 @@ const serializeAws_json1_1RequestCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.DomainValidationOptions !== undefined && { - DomainValidationOptions: serializeAws_json1_1DomainValidationOptionList(input.DomainValidationOptions, context), - }), - ...(input.IdempotencyToken !== undefined && { IdempotencyToken: input.IdempotencyToken }), - ...(input.Options !== undefined && { Options: serializeAws_json1_1CertificateOptions(input.Options, context) }), - ...(input.SubjectAlternativeNames !== undefined && { - SubjectAlternativeNames: serializeAws_json1_1DomainList(input.SubjectAlternativeNames, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.ValidationMethod !== undefined && { ValidationMethod: input.ValidationMethod }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.DomainValidationOptions !== undefined && + input.DomainValidationOptions !== null && { + DomainValidationOptions: serializeAws_json1_1DomainValidationOptionList(input.DomainValidationOptions, context), + }), + ...(input.IdempotencyToken !== undefined && + input.IdempotencyToken !== null && { IdempotencyToken: input.IdempotencyToken }), + ...(input.Options !== undefined && + input.Options !== null && { Options: serializeAws_json1_1CertificateOptions(input.Options, context) }), + ...(input.SubjectAlternativeNames !== undefined && + input.SubjectAlternativeNames !== null && { + SubjectAlternativeNames: serializeAws_json1_1DomainList(input.SubjectAlternativeNames, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ValidationMethod !== undefined && + input.ValidationMethod !== null && { ValidationMethod: input.ValidationMethod }), }; }; @@ -1590,21 +1645,30 @@ const serializeAws_json1_1ResendValidationEmailRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.ValidationDomain !== undefined && { ValidationDomain: input.ValidationDomain }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.ValidationDomain !== undefined && + input.ValidationDomain !== null && { ValidationDomain: input.ValidationDomain }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1UpdateCertificateOptionsRequest = ( @@ -1612,8 +1676,10 @@ const serializeAws_json1_1UpdateCertificateOptionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.Options !== undefined && { Options: serializeAws_json1_1CertificateOptions(input.Options, context) }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.Options !== undefined && + input.Options !== null && { Options: serializeAws_json1_1CertificateOptions(input.Options, context) }), }; }; @@ -1718,7 +1784,14 @@ const deserializeAws_json1_1CertificateSummary = (output: any, context: __SerdeC }; const deserializeAws_json1_1CertificateSummaryList = (output: any, context: __SerdeContext): CertificateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CertificateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CertificateSummary(entry, context); + }); }; const deserializeAws_json1_1DescribeCertificateResponse = ( @@ -1734,7 +1807,14 @@ const deserializeAws_json1_1DescribeCertificateResponse = ( }; const deserializeAws_json1_1DomainList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DomainValidation = (output: any, context: __SerdeContext): DomainValidation => { @@ -1758,7 +1838,14 @@ const deserializeAws_json1_1DomainValidation = (output: any, context: __SerdeCon }; const deserializeAws_json1_1DomainValidationList = (output: any, context: __SerdeContext): DomainValidation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DomainValidation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DomainValidation(entry, context); + }); }; const deserializeAws_json1_1ExportCertificateResponse = ( @@ -1781,7 +1868,14 @@ const deserializeAws_json1_1ExtendedKeyUsage = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ExtendedKeyUsageList = (output: any, context: __SerdeContext): ExtendedKeyUsage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExtendedKeyUsage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExtendedKeyUsage(entry, context); + }); }; const deserializeAws_json1_1GetCertificateResponse = (output: any, context: __SerdeContext): GetCertificateResponse => { @@ -1803,7 +1897,14 @@ const deserializeAws_json1_1ImportCertificateResponse = ( }; const deserializeAws_json1_1InUseList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InvalidArgsException = (output: any, context: __SerdeContext): InvalidArgsException => { @@ -1855,7 +1956,14 @@ const deserializeAws_json1_1KeyUsage = (output: any, context: __SerdeContext): K }; const deserializeAws_json1_1KeyUsageList = (output: any, context: __SerdeContext): KeyUsage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyUsage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyUsage(entry, context); + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -1958,7 +2066,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagPolicyException = (output: any, context: __SerdeContext): TagPolicyException => { @@ -1974,7 +2089,14 @@ const deserializeAws_json1_1TooManyTagsException = (output: any, context: __Serd }; const deserializeAws_json1_1ValidationEmailList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2027,3 +2149,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-alexa-for-business/protocols/Aws_json1_1.ts b/clients/client-alexa-for-business/protocols/Aws_json1_1.ts index b3fa8b8d5cca..98810fae1412 100644 --- a/clients/client-alexa-for-business/protocols/Aws_json1_1.ts +++ b/clients/client-alexa-for-business/protocols/Aws_json1_1.ts @@ -489,7 +489,7 @@ export const serializeAws_json1_1ApproveSkillCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ApproveSkill", }; let body: any; @@ -502,7 +502,7 @@ export const serializeAws_json1_1AssociateContactWithAddressBookCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.AssociateContactWithAddressBook", }; let body: any; @@ -515,7 +515,7 @@ export const serializeAws_json1_1AssociateDeviceWithNetworkProfileCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.AssociateDeviceWithNetworkProfile", }; let body: any; @@ -528,7 +528,7 @@ export const serializeAws_json1_1AssociateDeviceWithRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.AssociateDeviceWithRoom", }; let body: any; @@ -541,7 +541,7 @@ export const serializeAws_json1_1AssociateSkillGroupWithRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.AssociateSkillGroupWithRoom", }; let body: any; @@ -554,7 +554,7 @@ export const serializeAws_json1_1AssociateSkillWithSkillGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.AssociateSkillWithSkillGroup", }; let body: any; @@ -567,7 +567,7 @@ export const serializeAws_json1_1AssociateSkillWithUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.AssociateSkillWithUsers", }; let body: any; @@ -580,7 +580,7 @@ export const serializeAws_json1_1CreateAddressBookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateAddressBook", }; let body: any; @@ -593,7 +593,7 @@ export const serializeAws_json1_1CreateBusinessReportScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateBusinessReportSchedule", }; let body: any; @@ -606,7 +606,7 @@ export const serializeAws_json1_1CreateConferenceProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateConferenceProvider", }; let body: any; @@ -619,7 +619,7 @@ export const serializeAws_json1_1CreateContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateContact", }; let body: any; @@ -632,7 +632,7 @@ export const serializeAws_json1_1CreateGatewayGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateGatewayGroup", }; let body: any; @@ -645,7 +645,7 @@ export const serializeAws_json1_1CreateNetworkProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateNetworkProfile", }; let body: any; @@ -658,7 +658,7 @@ export const serializeAws_json1_1CreateProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateProfile", }; let body: any; @@ -671,7 +671,7 @@ export const serializeAws_json1_1CreateRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateRoom", }; let body: any; @@ -684,7 +684,7 @@ export const serializeAws_json1_1CreateSkillGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateSkillGroup", }; let body: any; @@ -697,7 +697,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.CreateUser", }; let body: any; @@ -710,7 +710,7 @@ export const serializeAws_json1_1DeleteAddressBookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteAddressBook", }; let body: any; @@ -723,7 +723,7 @@ export const serializeAws_json1_1DeleteBusinessReportScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteBusinessReportSchedule", }; let body: any; @@ -736,7 +736,7 @@ export const serializeAws_json1_1DeleteConferenceProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteConferenceProvider", }; let body: any; @@ -749,7 +749,7 @@ export const serializeAws_json1_1DeleteContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteContact", }; let body: any; @@ -762,7 +762,7 @@ export const serializeAws_json1_1DeleteDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteDevice", }; let body: any; @@ -775,7 +775,7 @@ export const serializeAws_json1_1DeleteDeviceUsageDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteDeviceUsageData", }; let body: any; @@ -788,7 +788,7 @@ export const serializeAws_json1_1DeleteGatewayGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteGatewayGroup", }; let body: any; @@ -801,7 +801,7 @@ export const serializeAws_json1_1DeleteNetworkProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteNetworkProfile", }; let body: any; @@ -814,7 +814,7 @@ export const serializeAws_json1_1DeleteProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteProfile", }; let body: any; @@ -827,7 +827,7 @@ export const serializeAws_json1_1DeleteRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteRoom", }; let body: any; @@ -840,7 +840,7 @@ export const serializeAws_json1_1DeleteRoomSkillParameterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteRoomSkillParameter", }; let body: any; @@ -853,7 +853,7 @@ export const serializeAws_json1_1DeleteSkillAuthorizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteSkillAuthorization", }; let body: any; @@ -866,7 +866,7 @@ export const serializeAws_json1_1DeleteSkillGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteSkillGroup", }; let body: any; @@ -879,7 +879,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DeleteUser", }; let body: any; @@ -892,7 +892,7 @@ export const serializeAws_json1_1DisassociateContactFromAddressBookCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DisassociateContactFromAddressBook", }; let body: any; @@ -905,7 +905,7 @@ export const serializeAws_json1_1DisassociateDeviceFromRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DisassociateDeviceFromRoom", }; let body: any; @@ -918,7 +918,7 @@ export const serializeAws_json1_1DisassociateSkillFromSkillGroupCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DisassociateSkillFromSkillGroup", }; let body: any; @@ -931,7 +931,7 @@ export const serializeAws_json1_1DisassociateSkillFromUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DisassociateSkillFromUsers", }; let body: any; @@ -944,7 +944,7 @@ export const serializeAws_json1_1DisassociateSkillGroupFromRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.DisassociateSkillGroupFromRoom", }; let body: any; @@ -957,7 +957,7 @@ export const serializeAws_json1_1ForgetSmartHomeAppliancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ForgetSmartHomeAppliances", }; let body: any; @@ -970,7 +970,7 @@ export const serializeAws_json1_1GetAddressBookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetAddressBook", }; let body: any; @@ -983,7 +983,7 @@ export const serializeAws_json1_1GetConferencePreferenceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetConferencePreference", }; let body: any; @@ -996,7 +996,7 @@ export const serializeAws_json1_1GetConferenceProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetConferenceProvider", }; let body: any; @@ -1009,7 +1009,7 @@ export const serializeAws_json1_1GetContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetContact", }; let body: any; @@ -1022,7 +1022,7 @@ export const serializeAws_json1_1GetDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetDevice", }; let body: any; @@ -1035,7 +1035,7 @@ export const serializeAws_json1_1GetGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetGateway", }; let body: any; @@ -1048,7 +1048,7 @@ export const serializeAws_json1_1GetGatewayGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetGatewayGroup", }; let body: any; @@ -1061,7 +1061,7 @@ export const serializeAws_json1_1GetInvitationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetInvitationConfiguration", }; let body: any; @@ -1074,7 +1074,7 @@ export const serializeAws_json1_1GetNetworkProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetNetworkProfile", }; let body: any; @@ -1087,7 +1087,7 @@ export const serializeAws_json1_1GetProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetProfile", }; let body: any; @@ -1100,7 +1100,7 @@ export const serializeAws_json1_1GetRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetRoom", }; let body: any; @@ -1113,7 +1113,7 @@ export const serializeAws_json1_1GetRoomSkillParameterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetRoomSkillParameter", }; let body: any; @@ -1126,7 +1126,7 @@ export const serializeAws_json1_1GetSkillGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.GetSkillGroup", }; let body: any; @@ -1139,7 +1139,7 @@ export const serializeAws_json1_1ListBusinessReportSchedulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListBusinessReportSchedules", }; let body: any; @@ -1152,7 +1152,7 @@ export const serializeAws_json1_1ListConferenceProvidersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListConferenceProviders", }; let body: any; @@ -1165,7 +1165,7 @@ export const serializeAws_json1_1ListDeviceEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListDeviceEvents", }; let body: any; @@ -1178,7 +1178,7 @@ export const serializeAws_json1_1ListGatewayGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListGatewayGroups", }; let body: any; @@ -1191,7 +1191,7 @@ export const serializeAws_json1_1ListGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListGateways", }; let body: any; @@ -1204,7 +1204,7 @@ export const serializeAws_json1_1ListSkillsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListSkills", }; let body: any; @@ -1217,7 +1217,7 @@ export const serializeAws_json1_1ListSkillsStoreCategoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListSkillsStoreCategories", }; let body: any; @@ -1230,7 +1230,7 @@ export const serializeAws_json1_1ListSkillsStoreSkillsByCategoryCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListSkillsStoreSkillsByCategory", }; let body: any; @@ -1243,7 +1243,7 @@ export const serializeAws_json1_1ListSmartHomeAppliancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListSmartHomeAppliances", }; let body: any; @@ -1256,7 +1256,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ListTags", }; let body: any; @@ -1269,7 +1269,7 @@ export const serializeAws_json1_1PutConferencePreferenceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.PutConferencePreference", }; let body: any; @@ -1282,7 +1282,7 @@ export const serializeAws_json1_1PutInvitationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.PutInvitationConfiguration", }; let body: any; @@ -1295,7 +1295,7 @@ export const serializeAws_json1_1PutRoomSkillParameterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.PutRoomSkillParameter", }; let body: any; @@ -1308,7 +1308,7 @@ export const serializeAws_json1_1PutSkillAuthorizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.PutSkillAuthorization", }; let body: any; @@ -1321,7 +1321,7 @@ export const serializeAws_json1_1RegisterAVSDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.RegisterAVSDevice", }; let body: any; @@ -1334,7 +1334,7 @@ export const serializeAws_json1_1RejectSkillCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.RejectSkill", }; let body: any; @@ -1347,7 +1347,7 @@ export const serializeAws_json1_1ResolveRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.ResolveRoom", }; let body: any; @@ -1360,7 +1360,7 @@ export const serializeAws_json1_1RevokeInvitationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.RevokeInvitation", }; let body: any; @@ -1373,7 +1373,7 @@ export const serializeAws_json1_1SearchAddressBooksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SearchAddressBooks", }; let body: any; @@ -1386,7 +1386,7 @@ export const serializeAws_json1_1SearchContactsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SearchContacts", }; let body: any; @@ -1399,7 +1399,7 @@ export const serializeAws_json1_1SearchDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SearchDevices", }; let body: any; @@ -1412,7 +1412,7 @@ export const serializeAws_json1_1SearchNetworkProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SearchNetworkProfiles", }; let body: any; @@ -1425,7 +1425,7 @@ export const serializeAws_json1_1SearchProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SearchProfiles", }; let body: any; @@ -1438,7 +1438,7 @@ export const serializeAws_json1_1SearchRoomsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SearchRooms", }; let body: any; @@ -1451,7 +1451,7 @@ export const serializeAws_json1_1SearchSkillGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SearchSkillGroups", }; let body: any; @@ -1464,7 +1464,7 @@ export const serializeAws_json1_1SearchUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SearchUsers", }; let body: any; @@ -1477,7 +1477,7 @@ export const serializeAws_json1_1SendAnnouncementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SendAnnouncement", }; let body: any; @@ -1490,7 +1490,7 @@ export const serializeAws_json1_1SendInvitationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.SendInvitation", }; let body: any; @@ -1503,7 +1503,7 @@ export const serializeAws_json1_1StartDeviceSyncCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.StartDeviceSync", }; let body: any; @@ -1516,7 +1516,7 @@ export const serializeAws_json1_1StartSmartHomeApplianceDiscoveryCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.StartSmartHomeApplianceDiscovery", }; let body: any; @@ -1529,7 +1529,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.TagResource", }; let body: any; @@ -1542,7 +1542,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UntagResource", }; let body: any; @@ -1555,7 +1555,7 @@ export const serializeAws_json1_1UpdateAddressBookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateAddressBook", }; let body: any; @@ -1568,7 +1568,7 @@ export const serializeAws_json1_1UpdateBusinessReportScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateBusinessReportSchedule", }; let body: any; @@ -1581,7 +1581,7 @@ export const serializeAws_json1_1UpdateConferenceProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateConferenceProvider", }; let body: any; @@ -1594,7 +1594,7 @@ export const serializeAws_json1_1UpdateContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateContact", }; let body: any; @@ -1607,7 +1607,7 @@ export const serializeAws_json1_1UpdateDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateDevice", }; let body: any; @@ -1620,7 +1620,7 @@ export const serializeAws_json1_1UpdateGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateGateway", }; let body: any; @@ -1633,7 +1633,7 @@ export const serializeAws_json1_1UpdateGatewayGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateGatewayGroup", }; let body: any; @@ -1646,7 +1646,7 @@ export const serializeAws_json1_1UpdateNetworkProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateNetworkProfile", }; let body: any; @@ -1659,7 +1659,7 @@ export const serializeAws_json1_1UpdateProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateProfile", }; let body: any; @@ -1672,7 +1672,7 @@ export const serializeAws_json1_1UpdateRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateRoom", }; let body: any; @@ -1685,7 +1685,7 @@ export const serializeAws_json1_1UpdateSkillGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AlexaForBusiness.UpdateSkillGroup", }; let body: any; @@ -1720,8 +1720,7 @@ const deserializeAws_json1_1ApproveSkillCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -1791,8 +1790,7 @@ const deserializeAws_json1_1AssociateContactWithAddressBookCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.alexaforbusiness#LimitExceededException": @@ -1846,8 +1844,7 @@ const deserializeAws_json1_1AssociateDeviceWithNetworkProfileCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -1917,8 +1914,7 @@ const deserializeAws_json1_1AssociateDeviceWithRoomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -1988,8 +1984,7 @@ const deserializeAws_json1_1AssociateSkillGroupWithRoomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -2043,8 +2038,7 @@ const deserializeAws_json1_1AssociateSkillWithSkillGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -2114,8 +2108,7 @@ const deserializeAws_json1_1AssociateSkillWithUsersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -2177,8 +2170,7 @@ const deserializeAws_json1_1CreateAddressBookCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -2240,8 +2232,7 @@ const deserializeAws_json1_1CreateBusinessReportScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -2295,8 +2286,7 @@ const deserializeAws_json1_1CreateConferenceProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -2350,8 +2340,7 @@ const deserializeAws_json1_1CreateContactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -2413,8 +2402,7 @@ const deserializeAws_json1_1CreateGatewayGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -2476,8 +2464,7 @@ const deserializeAws_json1_1CreateNetworkProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -2563,8 +2550,7 @@ const deserializeAws_json1_1CreateProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -2634,8 +2620,7 @@ const deserializeAws_json1_1CreateRoomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -2697,8 +2682,7 @@ const deserializeAws_json1_1CreateSkillGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -2768,8 +2752,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -2839,8 +2822,7 @@ const deserializeAws_json1_1DeleteAddressBookCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -2902,8 +2884,7 @@ const deserializeAws_json1_1DeleteBusinessReportScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -2965,8 +2946,7 @@ const deserializeAws_json1_1DeleteConferenceProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -3020,8 +3000,7 @@ const deserializeAws_json1_1DeleteContactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3083,8 +3062,7 @@ const deserializeAws_json1_1DeleteDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3154,8 +3132,7 @@ const deserializeAws_json1_1DeleteDeviceUsageDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeviceNotRegisteredException": case "com.amazonaws.alexaforbusiness#DeviceNotRegisteredException": @@ -3225,8 +3202,7 @@ const deserializeAws_json1_1DeleteGatewayGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceAssociatedException": case "com.amazonaws.alexaforbusiness#ResourceAssociatedException": @@ -3280,8 +3256,7 @@ const deserializeAws_json1_1DeleteNetworkProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3351,8 +3326,7 @@ const deserializeAws_json1_1DeleteProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3414,8 +3388,7 @@ const deserializeAws_json1_1DeleteRoomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3477,8 +3450,7 @@ const deserializeAws_json1_1DeleteRoomSkillParameterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3532,8 +3504,7 @@ const deserializeAws_json1_1DeleteSkillAuthorizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3595,8 +3566,7 @@ const deserializeAws_json1_1DeleteSkillGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3658,8 +3628,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3721,8 +3690,7 @@ const deserializeAws_json1_1DisassociateContactFromAddressBookCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3768,8 +3736,7 @@ const deserializeAws_json1_1DisassociateDeviceFromRoomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3831,8 +3798,7 @@ const deserializeAws_json1_1DisassociateSkillFromSkillGroupCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3894,8 +3860,7 @@ const deserializeAws_json1_1DisassociateSkillFromUsersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -3957,8 +3922,7 @@ const deserializeAws_json1_1DisassociateSkillGroupFromRoomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -4012,8 +3976,7 @@ const deserializeAws_json1_1ForgetSmartHomeAppliancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4067,8 +4030,7 @@ const deserializeAws_json1_1GetAddressBookCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4122,8 +4084,7 @@ const deserializeAws_json1_1GetConferencePreferenceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4177,8 +4138,7 @@ const deserializeAws_json1_1GetConferenceProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4232,8 +4192,7 @@ const deserializeAws_json1_1GetContactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4287,8 +4246,7 @@ const deserializeAws_json1_1GetDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4342,8 +4300,7 @@ const deserializeAws_json1_1GetGatewayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4397,8 +4354,7 @@ const deserializeAws_json1_1GetGatewayGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4452,8 +4408,7 @@ const deserializeAws_json1_1GetInvitationConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4507,8 +4462,7 @@ const deserializeAws_json1_1GetNetworkProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidSecretsManagerResourceException": case "com.amazonaws.alexaforbusiness#InvalidSecretsManagerResourceException": @@ -4570,8 +4524,7 @@ const deserializeAws_json1_1GetProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4625,8 +4578,7 @@ const deserializeAws_json1_1GetRoomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4680,8 +4632,7 @@ const deserializeAws_json1_1GetRoomSkillParameterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4735,8 +4686,7 @@ const deserializeAws_json1_1GetSkillGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4790,8 +4740,7 @@ const deserializeAws_json1_1ListBusinessReportSchedulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4837,8 +4786,7 @@ const deserializeAws_json1_1ListConferenceProvidersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4884,8 +4832,7 @@ const deserializeAws_json1_1ListDeviceEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -4939,8 +4886,7 @@ const deserializeAws_json1_1ListGatewayGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4986,8 +4932,7 @@ const deserializeAws_json1_1ListGatewaysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -5033,8 +4978,7 @@ const deserializeAws_json1_1ListSkillsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -5080,8 +5024,7 @@ const deserializeAws_json1_1ListSkillsStoreCategoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -5127,8 +5070,7 @@ const deserializeAws_json1_1ListSkillsStoreSkillsByCategoryCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -5174,8 +5116,7 @@ const deserializeAws_json1_1ListSmartHomeAppliancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -5229,8 +5170,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -5284,8 +5224,7 @@ const deserializeAws_json1_1PutConferencePreferenceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -5339,8 +5278,7 @@ const deserializeAws_json1_1PutInvitationConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -5402,8 +5340,7 @@ const deserializeAws_json1_1PutRoomSkillParameterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -5457,8 +5394,7 @@ const deserializeAws_json1_1PutSkillAuthorizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -5520,8 +5456,7 @@ const deserializeAws_json1_1RegisterAVSDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -5599,8 +5534,7 @@ const deserializeAws_json1_1RejectSkillCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -5662,8 +5596,7 @@ const deserializeAws_json1_1ResolveRoomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -5717,8 +5650,7 @@ const deserializeAws_json1_1RevokeInvitationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -5780,8 +5712,7 @@ const deserializeAws_json1_1SearchAddressBooksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -5827,8 +5758,7 @@ const deserializeAws_json1_1SearchContactsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -5874,8 +5804,7 @@ const deserializeAws_json1_1SearchDevicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -5921,8 +5850,7 @@ const deserializeAws_json1_1SearchNetworkProfilesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -5968,8 +5896,7 @@ const deserializeAws_json1_1SearchProfilesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -6015,8 +5942,7 @@ const deserializeAws_json1_1SearchRoomsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -6062,8 +5988,7 @@ const deserializeAws_json1_1SearchSkillGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -6109,8 +6034,7 @@ const deserializeAws_json1_1SearchUsersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -6156,8 +6080,7 @@ const deserializeAws_json1_1SendAnnouncementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.alexaforbusiness#AlreadyExistsException": @@ -6219,8 +6142,7 @@ const deserializeAws_json1_1SendInvitationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -6290,8 +6212,7 @@ const deserializeAws_json1_1StartDeviceSyncCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeviceNotRegisteredException": case "com.amazonaws.alexaforbusiness#DeviceNotRegisteredException": @@ -6345,8 +6266,7 @@ const deserializeAws_json1_1StartSmartHomeApplianceDiscoveryCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -6400,8 +6320,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -6455,8 +6374,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -6510,8 +6428,7 @@ const deserializeAws_json1_1UpdateAddressBookCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -6581,8 +6498,7 @@ const deserializeAws_json1_1UpdateBusinessReportScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -6644,8 +6560,7 @@ const deserializeAws_json1_1UpdateConferenceProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": @@ -6699,8 +6614,7 @@ const deserializeAws_json1_1UpdateContactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -6762,8 +6676,7 @@ const deserializeAws_json1_1UpdateDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -6833,8 +6746,7 @@ const deserializeAws_json1_1UpdateGatewayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NameInUseException": case "com.amazonaws.alexaforbusiness#NameInUseException": @@ -6896,8 +6808,7 @@ const deserializeAws_json1_1UpdateGatewayGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NameInUseException": case "com.amazonaws.alexaforbusiness#NameInUseException": @@ -6959,8 +6870,7 @@ const deserializeAws_json1_1UpdateNetworkProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -7046,8 +6956,7 @@ const deserializeAws_json1_1UpdateProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -7117,8 +7026,7 @@ const deserializeAws_json1_1UpdateRoomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NameInUseException": case "com.amazonaws.alexaforbusiness#NameInUseException": @@ -7180,8 +7088,7 @@ const deserializeAws_json1_1UpdateSkillGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": @@ -7451,7 +7358,7 @@ const deserializeAws_json1_1UnauthorizedExceptionResponse = async ( const serializeAws_json1_1ApproveSkillRequest = (input: ApproveSkillRequest, context: __SerdeContext): any => { return { - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; @@ -7460,8 +7367,9 @@ const serializeAws_json1_1AssociateContactWithAddressBookRequest = ( context: __SerdeContext ): any => { return { - ...(input.AddressBookArn !== undefined && { AddressBookArn: input.AddressBookArn }), - ...(input.ContactArn !== undefined && { ContactArn: input.ContactArn }), + ...(input.AddressBookArn !== undefined && + input.AddressBookArn !== null && { AddressBookArn: input.AddressBookArn }), + ...(input.ContactArn !== undefined && input.ContactArn !== null && { ContactArn: input.ContactArn }), }; }; @@ -7470,8 +7378,9 @@ const serializeAws_json1_1AssociateDeviceWithNetworkProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), - ...(input.NetworkProfileArn !== undefined && { NetworkProfileArn: input.NetworkProfileArn }), + ...(input.DeviceArn !== undefined && input.DeviceArn !== null && { DeviceArn: input.DeviceArn }), + ...(input.NetworkProfileArn !== undefined && + input.NetworkProfileArn !== null && { NetworkProfileArn: input.NetworkProfileArn }), }; }; @@ -7480,8 +7389,8 @@ const serializeAws_json1_1AssociateDeviceWithRoomRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.DeviceArn !== undefined && input.DeviceArn !== null && { DeviceArn: input.DeviceArn }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), }; }; @@ -7490,8 +7399,8 @@ const serializeAws_json1_1AssociateSkillGroupWithRoomRequest = ( context: __SerdeContext ): any => { return { - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), - ...(input.SkillGroupArn !== undefined && { SkillGroupArn: input.SkillGroupArn }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), + ...(input.SkillGroupArn !== undefined && input.SkillGroupArn !== null && { SkillGroupArn: input.SkillGroupArn }), }; }; @@ -7500,8 +7409,8 @@ const serializeAws_json1_1AssociateSkillWithSkillGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.SkillGroupArn !== undefined && { SkillGroupArn: input.SkillGroupArn }), - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.SkillGroupArn !== undefined && input.SkillGroupArn !== null && { SkillGroupArn: input.SkillGroupArn }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; @@ -7510,29 +7419,38 @@ const serializeAws_json1_1AssociateSkillWithUsersRequest = ( context: __SerdeContext ): any => { return { - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; const serializeAws_json1_1Audio = (input: Audio, context: __SerdeContext): any => { return { - ...(input.Locale !== undefined && { Locale: input.Locale }), - ...(input.Location !== undefined && { Location: input.Location }), + ...(input.Locale !== undefined && input.Locale !== null && { Locale: input.Locale }), + ...(input.Location !== undefined && input.Location !== null && { Location: input.Location }), }; }; const serializeAws_json1_1AudioList = (input: Audio[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Audio(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Audio(entry, context); + }); }; const serializeAws_json1_1AuthorizationResult = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1BusinessReportContentRange = ( @@ -7540,7 +7458,7 @@ const serializeAws_json1_1BusinessReportContentRange = ( context: __SerdeContext ): any => { return { - ...(input.Interval !== undefined && { Interval: input.Interval }), + ...(input.Interval !== undefined && input.Interval !== null && { Interval: input.Interval }), }; }; @@ -7549,23 +7467,27 @@ const serializeAws_json1_1BusinessReportRecurrence = ( context: __SerdeContext ): any => { return { - ...(input.StartDate !== undefined && { StartDate: input.StartDate }), + ...(input.StartDate !== undefined && input.StartDate !== null && { StartDate: input.StartDate }), }; }; const serializeAws_json1_1ConferencePreference = (input: ConferencePreference, context: __SerdeContext): any => { return { - ...(input.DefaultConferenceProviderArn !== undefined && { - DefaultConferenceProviderArn: input.DefaultConferenceProviderArn, - }), + ...(input.DefaultConferenceProviderArn !== undefined && + input.DefaultConferenceProviderArn !== null && { + DefaultConferenceProviderArn: input.DefaultConferenceProviderArn, + }), }; }; const serializeAws_json1_1Content = (input: Content, context: __SerdeContext): any => { return { - ...(input.AudioList !== undefined && { AudioList: serializeAws_json1_1AudioList(input.AudioList, context) }), - ...(input.SsmlList !== undefined && { SsmlList: serializeAws_json1_1SsmlList(input.SsmlList, context) }), - ...(input.TextList !== undefined && { TextList: serializeAws_json1_1TextList(input.TextList, context) }), + ...(input.AudioList !== undefined && + input.AudioList !== null && { AudioList: serializeAws_json1_1AudioList(input.AudioList, context) }), + ...(input.SsmlList !== undefined && + input.SsmlList !== null && { SsmlList: serializeAws_json1_1SsmlList(input.SsmlList, context) }), + ...(input.TextList !== undefined && + input.TextList !== null && { TextList: serializeAws_json1_1TextList(input.TextList, context) }), }; }; @@ -7575,8 +7497,8 @@ const serializeAws_json1_1CreateAddressBookRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -7586,17 +7508,19 @@ const serializeAws_json1_1CreateBusinessReportScheduleRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.ContentRange !== undefined && { - ContentRange: serializeAws_json1_1BusinessReportContentRange(input.ContentRange, context), - }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.Recurrence !== undefined && { - Recurrence: serializeAws_json1_1BusinessReportRecurrence(input.Recurrence, context), - }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.S3KeyPrefix !== undefined && { S3KeyPrefix: input.S3KeyPrefix }), - ...(input.ScheduleName !== undefined && { ScheduleName: input.ScheduleName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ContentRange !== undefined && + input.ContentRange !== null && { + ContentRange: serializeAws_json1_1BusinessReportContentRange(input.ContentRange, context), + }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.Recurrence !== undefined && + input.Recurrence !== null && { + Recurrence: serializeAws_json1_1BusinessReportRecurrence(input.Recurrence, context), + }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.S3KeyPrefix !== undefined && input.S3KeyPrefix !== null && { S3KeyPrefix: input.S3KeyPrefix }), + ...(input.ScheduleName !== undefined && input.ScheduleName !== null && { ScheduleName: input.ScheduleName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -7606,29 +7530,34 @@ const serializeAws_json1_1CreateConferenceProviderRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.ConferenceProviderName !== undefined && { ConferenceProviderName: input.ConferenceProviderName }), - ...(input.ConferenceProviderType !== undefined && { ConferenceProviderType: input.ConferenceProviderType }), - ...(input.IPDialIn !== undefined && { IPDialIn: serializeAws_json1_1IPDialIn(input.IPDialIn, context) }), - ...(input.MeetingSetting !== undefined && { - MeetingSetting: serializeAws_json1_1MeetingSetting(input.MeetingSetting, context), - }), - ...(input.PSTNDialIn !== undefined && { PSTNDialIn: serializeAws_json1_1PSTNDialIn(input.PSTNDialIn, context) }), + ...(input.ConferenceProviderName !== undefined && + input.ConferenceProviderName !== null && { ConferenceProviderName: input.ConferenceProviderName }), + ...(input.ConferenceProviderType !== undefined && + input.ConferenceProviderType !== null && { ConferenceProviderType: input.ConferenceProviderType }), + ...(input.IPDialIn !== undefined && + input.IPDialIn !== null && { IPDialIn: serializeAws_json1_1IPDialIn(input.IPDialIn, context) }), + ...(input.MeetingSetting !== undefined && + input.MeetingSetting !== null && { + MeetingSetting: serializeAws_json1_1MeetingSetting(input.MeetingSetting, context), + }), + ...(input.PSTNDialIn !== undefined && + input.PSTNDialIn !== null && { PSTNDialIn: serializeAws_json1_1PSTNDialIn(input.PSTNDialIn, context) }), }; }; const serializeAws_json1_1CreateContactRequest = (input: CreateContactRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.FirstName !== undefined && { FirstName: input.FirstName }), - ...(input.LastName !== undefined && { LastName: input.LastName }), - ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }), - ...(input.PhoneNumbers !== undefined && { - PhoneNumbers: serializeAws_json1_1PhoneNumberList(input.PhoneNumbers, context), - }), - ...(input.SipAddresses !== undefined && { - SipAddresses: serializeAws_json1_1SipAddressList(input.SipAddresses, context), - }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.FirstName !== undefined && input.FirstName !== null && { FirstName: input.FirstName }), + ...(input.LastName !== undefined && input.LastName !== null && { LastName: input.LastName }), + ...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }), + ...(input.PhoneNumbers !== undefined && + input.PhoneNumbers !== null && { + PhoneNumbers: serializeAws_json1_1PhoneNumberList(input.PhoneNumbers, context), + }), + ...(input.SipAddresses !== undefined && + input.SipAddresses !== null && { SipAddresses: serializeAws_json1_1SipAddressList(input.SipAddresses, context) }), }; }; @@ -7637,11 +7566,12 @@ const serializeAws_json1_1CreateEndOfMeetingReminder = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.ReminderAtMinutes !== undefined && { - ReminderAtMinutes: serializeAws_json1_1EndOfMeetingReminderMinutesList(input.ReminderAtMinutes, context), - }), - ...(input.ReminderType !== undefined && { ReminderType: input.ReminderType }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.ReminderAtMinutes !== undefined && + input.ReminderAtMinutes !== null && { + ReminderAtMinutes: serializeAws_json1_1EndOfMeetingReminderMinutesList(input.ReminderAtMinutes, context), + }), + ...(input.ReminderType !== undefined && input.ReminderType !== null && { ReminderType: input.ReminderType }), }; }; @@ -7651,15 +7581,16 @@ const serializeAws_json1_1CreateGatewayGroupRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1CreateInstantBooking = (input: CreateInstantBooking, context: __SerdeContext): any => { return { - ...(input.DurationInMinutes !== undefined && { DurationInMinutes: input.DurationInMinutes }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.DurationInMinutes !== undefined && + input.DurationInMinutes !== null && { DurationInMinutes: input.DurationInMinutes }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; @@ -7668,18 +7599,22 @@ const serializeAws_json1_1CreateMeetingRoomConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.EndOfMeetingReminder !== undefined && { - EndOfMeetingReminder: serializeAws_json1_1CreateEndOfMeetingReminder(input.EndOfMeetingReminder, context), - }), - ...(input.InstantBooking !== undefined && { - InstantBooking: serializeAws_json1_1CreateInstantBooking(input.InstantBooking, context), - }), - ...(input.RequireCheckIn !== undefined && { - RequireCheckIn: serializeAws_json1_1CreateRequireCheckIn(input.RequireCheckIn, context), - }), - ...(input.RoomUtilizationMetricsEnabled !== undefined && { - RoomUtilizationMetricsEnabled: input.RoomUtilizationMetricsEnabled, - }), + ...(input.EndOfMeetingReminder !== undefined && + input.EndOfMeetingReminder !== null && { + EndOfMeetingReminder: serializeAws_json1_1CreateEndOfMeetingReminder(input.EndOfMeetingReminder, context), + }), + ...(input.InstantBooking !== undefined && + input.InstantBooking !== null && { + InstantBooking: serializeAws_json1_1CreateInstantBooking(input.InstantBooking, context), + }), + ...(input.RequireCheckIn !== undefined && + input.RequireCheckIn !== null && { + RequireCheckIn: serializeAws_json1_1CreateRequireCheckIn(input.RequireCheckIn, context), + }), + ...(input.RoomUtilizationMetricsEnabled !== undefined && + input.RoomUtilizationMetricsEnabled !== null && { + RoomUtilizationMetricsEnabled: input.RoomUtilizationMetricsEnabled, + }), }; }; @@ -7688,79 +7623,90 @@ const serializeAws_json1_1CreateNetworkProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.CurrentPassword !== undefined && { CurrentPassword: input.CurrentPassword }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EapMethod !== undefined && { EapMethod: input.EapMethod }), - ...(input.NetworkProfileName !== undefined && { NetworkProfileName: input.NetworkProfileName }), - ...(input.NextPassword !== undefined && { NextPassword: input.NextPassword }), - ...(input.SecurityType !== undefined && { SecurityType: input.SecurityType }), - ...(input.Ssid !== undefined && { Ssid: input.Ssid }), - ...(input.TrustAnchors !== undefined && { - TrustAnchors: serializeAws_json1_1TrustAnchorList(input.TrustAnchors, context), - }), + ...(input.CurrentPassword !== undefined && + input.CurrentPassword !== null && { CurrentPassword: input.CurrentPassword }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EapMethod !== undefined && input.EapMethod !== null && { EapMethod: input.EapMethod }), + ...(input.NetworkProfileName !== undefined && + input.NetworkProfileName !== null && { NetworkProfileName: input.NetworkProfileName }), + ...(input.NextPassword !== undefined && input.NextPassword !== null && { NextPassword: input.NextPassword }), + ...(input.SecurityType !== undefined && input.SecurityType !== null && { SecurityType: input.SecurityType }), + ...(input.Ssid !== undefined && input.Ssid !== null && { Ssid: input.Ssid }), + ...(input.TrustAnchors !== undefined && + input.TrustAnchors !== null && { + TrustAnchors: serializeAws_json1_1TrustAnchorList(input.TrustAnchors, context), + }), }; }; const serializeAws_json1_1CreateProfileRequest = (input: CreateProfileRequest, context: __SerdeContext): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DistanceUnit !== undefined && { DistanceUnit: input.DistanceUnit }), - ...(input.Locale !== undefined && { Locale: input.Locale }), - ...(input.MaxVolumeLimit !== undefined && { MaxVolumeLimit: input.MaxVolumeLimit }), - ...(input.MeetingRoomConfiguration !== undefined && { - MeetingRoomConfiguration: serializeAws_json1_1CreateMeetingRoomConfiguration( - input.MeetingRoomConfiguration, - context - ), - }), - ...(input.PSTNEnabled !== undefined && { PSTNEnabled: input.PSTNEnabled }), - ...(input.ProfileName !== undefined && { ProfileName: input.ProfileName }), - ...(input.SetupModeDisabled !== undefined && { SetupModeDisabled: input.SetupModeDisabled }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TemperatureUnit !== undefined && { TemperatureUnit: input.TemperatureUnit }), - ...(input.Timezone !== undefined && { Timezone: input.Timezone }), - ...(input.WakeWord !== undefined && { WakeWord: input.WakeWord }), + ...(input.DistanceUnit !== undefined && input.DistanceUnit !== null && { DistanceUnit: input.DistanceUnit }), + ...(input.Locale !== undefined && input.Locale !== null && { Locale: input.Locale }), + ...(input.MaxVolumeLimit !== undefined && + input.MaxVolumeLimit !== null && { MaxVolumeLimit: input.MaxVolumeLimit }), + ...(input.MeetingRoomConfiguration !== undefined && + input.MeetingRoomConfiguration !== null && { + MeetingRoomConfiguration: serializeAws_json1_1CreateMeetingRoomConfiguration( + input.MeetingRoomConfiguration, + context + ), + }), + ...(input.PSTNEnabled !== undefined && input.PSTNEnabled !== null && { PSTNEnabled: input.PSTNEnabled }), + ...(input.ProfileName !== undefined && input.ProfileName !== null && { ProfileName: input.ProfileName }), + ...(input.SetupModeDisabled !== undefined && + input.SetupModeDisabled !== null && { SetupModeDisabled: input.SetupModeDisabled }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TemperatureUnit !== undefined && + input.TemperatureUnit !== null && { TemperatureUnit: input.TemperatureUnit }), + ...(input.Timezone !== undefined && input.Timezone !== null && { Timezone: input.Timezone }), + ...(input.WakeWord !== undefined && input.WakeWord !== null && { WakeWord: input.WakeWord }), }; }; const serializeAws_json1_1CreateRequireCheckIn = (input: CreateRequireCheckIn, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.ReleaseAfterMinutes !== undefined && { ReleaseAfterMinutes: input.ReleaseAfterMinutes }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.ReleaseAfterMinutes !== undefined && + input.ReleaseAfterMinutes !== null && { ReleaseAfterMinutes: input.ReleaseAfterMinutes }), }; }; const serializeAws_json1_1CreateRoomRequest = (input: CreateRoomRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ProfileArn !== undefined && { ProfileArn: input.ProfileArn }), - ...(input.ProviderCalendarId !== undefined && { ProviderCalendarId: input.ProviderCalendarId }), - ...(input.RoomName !== undefined && { RoomName: input.RoomName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ProfileArn !== undefined && input.ProfileArn !== null && { ProfileArn: input.ProfileArn }), + ...(input.ProviderCalendarId !== undefined && + input.ProviderCalendarId !== null && { ProviderCalendarId: input.ProviderCalendarId }), + ...(input.RoomName !== undefined && input.RoomName !== null && { RoomName: input.RoomName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateSkillGroupRequest = (input: CreateSkillGroupRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.SkillGroupName !== undefined && { SkillGroupName: input.SkillGroupName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.SkillGroupName !== undefined && + input.SkillGroupName !== null && { SkillGroupName: input.SkillGroupName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateUserRequest = (input: CreateUserRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.FirstName !== undefined && { FirstName: input.FirstName }), - ...(input.LastName !== undefined && { LastName: input.LastName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.FirstName !== undefined && input.FirstName !== null && { FirstName: input.FirstName }), + ...(input.LastName !== undefined && input.LastName !== null && { LastName: input.LastName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; @@ -7769,7 +7715,8 @@ const serializeAws_json1_1DeleteAddressBookRequest = ( context: __SerdeContext ): any => { return { - ...(input.AddressBookArn !== undefined && { AddressBookArn: input.AddressBookArn }), + ...(input.AddressBookArn !== undefined && + input.AddressBookArn !== null && { AddressBookArn: input.AddressBookArn }), }; }; @@ -7778,7 +7725,7 @@ const serializeAws_json1_1DeleteBusinessReportScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ScheduleArn !== undefined && { ScheduleArn: input.ScheduleArn }), + ...(input.ScheduleArn !== undefined && input.ScheduleArn !== null && { ScheduleArn: input.ScheduleArn }), }; }; @@ -7787,19 +7734,20 @@ const serializeAws_json1_1DeleteConferenceProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConferenceProviderArn !== undefined && { ConferenceProviderArn: input.ConferenceProviderArn }), + ...(input.ConferenceProviderArn !== undefined && + input.ConferenceProviderArn !== null && { ConferenceProviderArn: input.ConferenceProviderArn }), }; }; const serializeAws_json1_1DeleteContactRequest = (input: DeleteContactRequest, context: __SerdeContext): any => { return { - ...(input.ContactArn !== undefined && { ContactArn: input.ContactArn }), + ...(input.ContactArn !== undefined && input.ContactArn !== null && { ContactArn: input.ContactArn }), }; }; const serializeAws_json1_1DeleteDeviceRequest = (input: DeleteDeviceRequest, context: __SerdeContext): any => { return { - ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), + ...(input.DeviceArn !== undefined && input.DeviceArn !== null && { DeviceArn: input.DeviceArn }), }; }; @@ -7808,8 +7756,9 @@ const serializeAws_json1_1DeleteDeviceUsageDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), - ...(input.DeviceUsageType !== undefined && { DeviceUsageType: input.DeviceUsageType }), + ...(input.DeviceArn !== undefined && input.DeviceArn !== null && { DeviceArn: input.DeviceArn }), + ...(input.DeviceUsageType !== undefined && + input.DeviceUsageType !== null && { DeviceUsageType: input.DeviceUsageType }), }; }; @@ -7818,7 +7767,8 @@ const serializeAws_json1_1DeleteGatewayGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.GatewayGroupArn !== undefined && { GatewayGroupArn: input.GatewayGroupArn }), + ...(input.GatewayGroupArn !== undefined && + input.GatewayGroupArn !== null && { GatewayGroupArn: input.GatewayGroupArn }), }; }; @@ -7827,19 +7777,20 @@ const serializeAws_json1_1DeleteNetworkProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.NetworkProfileArn !== undefined && { NetworkProfileArn: input.NetworkProfileArn }), + ...(input.NetworkProfileArn !== undefined && + input.NetworkProfileArn !== null && { NetworkProfileArn: input.NetworkProfileArn }), }; }; const serializeAws_json1_1DeleteProfileRequest = (input: DeleteProfileRequest, context: __SerdeContext): any => { return { - ...(input.ProfileArn !== undefined && { ProfileArn: input.ProfileArn }), + ...(input.ProfileArn !== undefined && input.ProfileArn !== null && { ProfileArn: input.ProfileArn }), }; }; const serializeAws_json1_1DeleteRoomRequest = (input: DeleteRoomRequest, context: __SerdeContext): any => { return { - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), }; }; @@ -7848,9 +7799,9 @@ const serializeAws_json1_1DeleteRoomSkillParameterRequest = ( context: __SerdeContext ): any => { return { - ...(input.ParameterKey !== undefined && { ParameterKey: input.ParameterKey }), - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.ParameterKey !== undefined && input.ParameterKey !== null && { ParameterKey: input.ParameterKey }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; @@ -7859,21 +7810,21 @@ const serializeAws_json1_1DeleteSkillAuthorizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; const serializeAws_json1_1DeleteSkillGroupRequest = (input: DeleteSkillGroupRequest, context: __SerdeContext): any => { return { - ...(input.SkillGroupArn !== undefined && { SkillGroupArn: input.SkillGroupArn }), + ...(input.SkillGroupArn !== undefined && input.SkillGroupArn !== null && { SkillGroupArn: input.SkillGroupArn }), }; }; const serializeAws_json1_1DeleteUserRequest = (input: DeleteUserRequest, context: __SerdeContext): any => { return { - ...(input.EnrollmentId !== undefined && { EnrollmentId: input.EnrollmentId }), - ...(input.UserArn !== undefined && { UserArn: input.UserArn }), + ...(input.EnrollmentId !== undefined && input.EnrollmentId !== null && { EnrollmentId: input.EnrollmentId }), + ...(input.UserArn !== undefined && input.UserArn !== null && { UserArn: input.UserArn }), }; }; @@ -7882,8 +7833,9 @@ const serializeAws_json1_1DisassociateContactFromAddressBookRequest = ( context: __SerdeContext ): any => { return { - ...(input.AddressBookArn !== undefined && { AddressBookArn: input.AddressBookArn }), - ...(input.ContactArn !== undefined && { ContactArn: input.ContactArn }), + ...(input.AddressBookArn !== undefined && + input.AddressBookArn !== null && { AddressBookArn: input.AddressBookArn }), + ...(input.ContactArn !== undefined && input.ContactArn !== null && { ContactArn: input.ContactArn }), }; }; @@ -7892,7 +7844,7 @@ const serializeAws_json1_1DisassociateDeviceFromRoomRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), + ...(input.DeviceArn !== undefined && input.DeviceArn !== null && { DeviceArn: input.DeviceArn }), }; }; @@ -7901,8 +7853,8 @@ const serializeAws_json1_1DisassociateSkillFromSkillGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.SkillGroupArn !== undefined && { SkillGroupArn: input.SkillGroupArn }), - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.SkillGroupArn !== undefined && input.SkillGroupArn !== null && { SkillGroupArn: input.SkillGroupArn }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; @@ -7911,7 +7863,7 @@ const serializeAws_json1_1DisassociateSkillFromUsersRequest = ( context: __SerdeContext ): any => { return { - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; @@ -7920,32 +7872,61 @@ const serializeAws_json1_1DisassociateSkillGroupFromRoomRequest = ( context: __SerdeContext ): any => { return { - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), - ...(input.SkillGroupArn !== undefined && { SkillGroupArn: input.SkillGroupArn }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), + ...(input.SkillGroupArn !== undefined && input.SkillGroupArn !== null && { SkillGroupArn: input.SkillGroupArn }), }; }; const serializeAws_json1_1EndOfMeetingReminderMinutesList = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Features = (input: (Feature | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValueList(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValueList(input.Values, context) }), }; }; const serializeAws_json1_1FilterList = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1FilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ForgetSmartHomeAppliancesRequest = ( @@ -7953,13 +7934,14 @@ const serializeAws_json1_1ForgetSmartHomeAppliancesRequest = ( context: __SerdeContext ): any => { return { - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), }; }; const serializeAws_json1_1GetAddressBookRequest = (input: GetAddressBookRequest, context: __SerdeContext): any => { return { - ...(input.AddressBookArn !== undefined && { AddressBookArn: input.AddressBookArn }), + ...(input.AddressBookArn !== undefined && + input.AddressBookArn !== null && { AddressBookArn: input.AddressBookArn }), }; }; @@ -7975,31 +7957,33 @@ const serializeAws_json1_1GetConferenceProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConferenceProviderArn !== undefined && { ConferenceProviderArn: input.ConferenceProviderArn }), + ...(input.ConferenceProviderArn !== undefined && + input.ConferenceProviderArn !== null && { ConferenceProviderArn: input.ConferenceProviderArn }), }; }; const serializeAws_json1_1GetContactRequest = (input: GetContactRequest, context: __SerdeContext): any => { return { - ...(input.ContactArn !== undefined && { ContactArn: input.ContactArn }), + ...(input.ContactArn !== undefined && input.ContactArn !== null && { ContactArn: input.ContactArn }), }; }; const serializeAws_json1_1GetDeviceRequest = (input: GetDeviceRequest, context: __SerdeContext): any => { return { - ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), + ...(input.DeviceArn !== undefined && input.DeviceArn !== null && { DeviceArn: input.DeviceArn }), }; }; const serializeAws_json1_1GetGatewayGroupRequest = (input: GetGatewayGroupRequest, context: __SerdeContext): any => { return { - ...(input.GatewayGroupArn !== undefined && { GatewayGroupArn: input.GatewayGroupArn }), + ...(input.GatewayGroupArn !== undefined && + input.GatewayGroupArn !== null && { GatewayGroupArn: input.GatewayGroupArn }), }; }; const serializeAws_json1_1GetGatewayRequest = (input: GetGatewayRequest, context: __SerdeContext): any => { return { - ...(input.GatewayArn !== undefined && { GatewayArn: input.GatewayArn }), + ...(input.GatewayArn !== undefined && input.GatewayArn !== null && { GatewayArn: input.GatewayArn }), }; }; @@ -8015,19 +7999,20 @@ const serializeAws_json1_1GetNetworkProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.NetworkProfileArn !== undefined && { NetworkProfileArn: input.NetworkProfileArn }), + ...(input.NetworkProfileArn !== undefined && + input.NetworkProfileArn !== null && { NetworkProfileArn: input.NetworkProfileArn }), }; }; const serializeAws_json1_1GetProfileRequest = (input: GetProfileRequest, context: __SerdeContext): any => { return { - ...(input.ProfileArn !== undefined && { ProfileArn: input.ProfileArn }), + ...(input.ProfileArn !== undefined && input.ProfileArn !== null && { ProfileArn: input.ProfileArn }), }; }; const serializeAws_json1_1GetRoomRequest = (input: GetRoomRequest, context: __SerdeContext): any => { return { - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), }; }; @@ -8036,22 +8021,22 @@ const serializeAws_json1_1GetRoomSkillParameterRequest = ( context: __SerdeContext ): any => { return { - ...(input.ParameterKey !== undefined && { ParameterKey: input.ParameterKey }), - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.ParameterKey !== undefined && input.ParameterKey !== null && { ParameterKey: input.ParameterKey }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; const serializeAws_json1_1GetSkillGroupRequest = (input: GetSkillGroupRequest, context: __SerdeContext): any => { return { - ...(input.SkillGroupArn !== undefined && { SkillGroupArn: input.SkillGroupArn }), + ...(input.SkillGroupArn !== undefined && input.SkillGroupArn !== null && { SkillGroupArn: input.SkillGroupArn }), }; }; const serializeAws_json1_1IPDialIn = (input: IPDialIn, context: __SerdeContext): any => { return { - ...(input.CommsProtocol !== undefined && { CommsProtocol: input.CommsProtocol }), - ...(input.Endpoint !== undefined && { Endpoint: input.Endpoint }), + ...(input.CommsProtocol !== undefined && input.CommsProtocol !== null && { CommsProtocol: input.CommsProtocol }), + ...(input.Endpoint !== undefined && input.Endpoint !== null && { Endpoint: input.Endpoint }), }; }; @@ -8060,8 +8045,8 @@ const serializeAws_json1_1ListBusinessReportSchedulesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8070,17 +8055,17 @@ const serializeAws_json1_1ListConferenceProvidersRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListDeviceEventsRequest = (input: ListDeviceEventsRequest, context: __SerdeContext): any => { return { - ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), - ...(input.EventType !== undefined && { EventType: input.EventType }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DeviceArn !== undefined && input.DeviceArn !== null && { DeviceArn: input.DeviceArn }), + ...(input.EventType !== undefined && input.EventType !== null && { EventType: input.EventType }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8089,26 +8074,28 @@ const serializeAws_json1_1ListGatewayGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListGatewaysRequest = (input: ListGatewaysRequest, context: __SerdeContext): any => { return { - ...(input.GatewayGroupArn !== undefined && { GatewayGroupArn: input.GatewayGroupArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.GatewayGroupArn !== undefined && + input.GatewayGroupArn !== null && { GatewayGroupArn: input.GatewayGroupArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListSkillsRequest = (input: ListSkillsRequest, context: __SerdeContext): any => { return { - ...(input.EnablementType !== undefined && { EnablementType: input.EnablementType }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SkillGroupArn !== undefined && { SkillGroupArn: input.SkillGroupArn }), - ...(input.SkillType !== undefined && { SkillType: input.SkillType }), + ...(input.EnablementType !== undefined && + input.EnablementType !== null && { EnablementType: input.EnablementType }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SkillGroupArn !== undefined && input.SkillGroupArn !== null && { SkillGroupArn: input.SkillGroupArn }), + ...(input.SkillType !== undefined && input.SkillType !== null && { SkillType: input.SkillType }), }; }; @@ -8117,8 +8104,8 @@ const serializeAws_json1_1ListSkillsStoreCategoriesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8127,9 +8114,9 @@ const serializeAws_json1_1ListSkillsStoreSkillsByCategoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.CategoryId !== undefined && { CategoryId: input.CategoryId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CategoryId !== undefined && input.CategoryId !== null && { CategoryId: input.CategoryId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8138,43 +8125,52 @@ const serializeAws_json1_1ListSmartHomeAppliancesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), }; }; const serializeAws_json1_1ListTagsRequest = (input: ListTagsRequest, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1MeetingSetting = (input: MeetingSetting, context: __SerdeContext): any => { return { - ...(input.RequirePin !== undefined && { RequirePin: input.RequirePin }), + ...(input.RequirePin !== undefined && input.RequirePin !== null && { RequirePin: input.RequirePin }), }; }; const serializeAws_json1_1PhoneNumber = (input: PhoneNumber, context: __SerdeContext): any => { return { - ...(input.Number !== undefined && { Number: input.Number }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Number !== undefined && input.Number !== null && { Number: input.Number }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1PhoneNumberList = (input: PhoneNumber[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PhoneNumber(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PhoneNumber(entry, context); + }); }; const serializeAws_json1_1PSTNDialIn = (input: PSTNDialIn, context: __SerdeContext): any => { return { - ...(input.CountryCode !== undefined && { CountryCode: input.CountryCode }), - ...(input.OneClickIdDelay !== undefined && { OneClickIdDelay: input.OneClickIdDelay }), - ...(input.OneClickPinDelay !== undefined && { OneClickPinDelay: input.OneClickPinDelay }), - ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }), + ...(input.CountryCode !== undefined && input.CountryCode !== null && { CountryCode: input.CountryCode }), + ...(input.OneClickIdDelay !== undefined && + input.OneClickIdDelay !== null && { OneClickIdDelay: input.OneClickIdDelay }), + ...(input.OneClickPinDelay !== undefined && + input.OneClickPinDelay !== null && { OneClickPinDelay: input.OneClickPinDelay }), + ...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }), }; }; @@ -8183,9 +8179,10 @@ const serializeAws_json1_1PutConferencePreferenceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConferencePreference !== undefined && { - ConferencePreference: serializeAws_json1_1ConferencePreference(input.ConferencePreference, context), - }), + ...(input.ConferencePreference !== undefined && + input.ConferencePreference !== null && { + ConferencePreference: serializeAws_json1_1ConferencePreference(input.ConferencePreference, context), + }), }; }; @@ -8194,11 +8191,13 @@ const serializeAws_json1_1PutInvitationConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ContactEmail !== undefined && { ContactEmail: input.ContactEmail }), - ...(input.OrganizationName !== undefined && { OrganizationName: input.OrganizationName }), - ...(input.PrivateSkillIds !== undefined && { - PrivateSkillIds: serializeAws_json1_1ShortSkillIdList(input.PrivateSkillIds, context), - }), + ...(input.ContactEmail !== undefined && input.ContactEmail !== null && { ContactEmail: input.ContactEmail }), + ...(input.OrganizationName !== undefined && + input.OrganizationName !== null && { OrganizationName: input.OrganizationName }), + ...(input.PrivateSkillIds !== undefined && + input.PrivateSkillIds !== null && { + PrivateSkillIds: serializeAws_json1_1ShortSkillIdList(input.PrivateSkillIds, context), + }), }; }; @@ -8207,11 +8206,12 @@ const serializeAws_json1_1PutRoomSkillParameterRequest = ( context: __SerdeContext ): any => { return { - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), - ...(input.RoomSkillParameter !== undefined && { - RoomSkillParameter: serializeAws_json1_1RoomSkillParameter(input.RoomSkillParameter, context), - }), - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), + ...(input.RoomSkillParameter !== undefined && + input.RoomSkillParameter !== null && { + RoomSkillParameter: serializeAws_json1_1RoomSkillParameter(input.RoomSkillParameter, context), + }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; @@ -8220,11 +8220,12 @@ const serializeAws_json1_1PutSkillAuthorizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AuthorizationResult !== undefined && { - AuthorizationResult: serializeAws_json1_1AuthorizationResult(input.AuthorizationResult, context), - }), - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.AuthorizationResult !== undefined && + input.AuthorizationResult !== null && { + AuthorizationResult: serializeAws_json1_1AuthorizationResult(input.AuthorizationResult, context), + }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; @@ -8233,39 +8234,41 @@ const serializeAws_json1_1RegisterAVSDeviceRequest = ( context: __SerdeContext ): any => { return { - ...(input.AmazonId !== undefined && { AmazonId: input.AmazonId }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.DeviceSerialNumber !== undefined && { DeviceSerialNumber: input.DeviceSerialNumber }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), - ...(input.UserCode !== undefined && { UserCode: input.UserCode }), + ...(input.AmazonId !== undefined && input.AmazonId !== null && { AmazonId: input.AmazonId }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.DeviceSerialNumber !== undefined && + input.DeviceSerialNumber !== null && { DeviceSerialNumber: input.DeviceSerialNumber }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), + ...(input.UserCode !== undefined && input.UserCode !== null && { UserCode: input.UserCode }), }; }; const serializeAws_json1_1RejectSkillRequest = (input: RejectSkillRequest, context: __SerdeContext): any => { return { - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), }; }; const serializeAws_json1_1ResolveRoomRequest = (input: ResolveRoomRequest, context: __SerdeContext): any => { return { - ...(input.SkillId !== undefined && { SkillId: input.SkillId }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.SkillId !== undefined && input.SkillId !== null && { SkillId: input.SkillId }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; const serializeAws_json1_1RevokeInvitationRequest = (input: RevokeInvitationRequest, context: __SerdeContext): any => { return { - ...(input.EnrollmentId !== undefined && { EnrollmentId: input.EnrollmentId }), - ...(input.UserArn !== undefined && { UserArn: input.UserArn }), + ...(input.EnrollmentId !== undefined && input.EnrollmentId !== null && { EnrollmentId: input.EnrollmentId }), + ...(input.UserArn !== undefined && input.UserArn !== null && { UserArn: input.UserArn }), }; }; const serializeAws_json1_1RoomSkillParameter = (input: RoomSkillParameter, context: __SerdeContext): any => { return { - ...(input.ParameterKey !== undefined && { ParameterKey: input.ParameterKey }), - ...(input.ParameterValue !== undefined && { ParameterValue: input.ParameterValue }), + ...(input.ParameterKey !== undefined && input.ParameterKey !== null && { ParameterKey: input.ParameterKey }), + ...(input.ParameterValue !== undefined && + input.ParameterValue !== null && { ParameterValue: input.ParameterValue }), }; }; @@ -8274,34 +8277,34 @@ const serializeAws_json1_1SearchAddressBooksRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context) }), }; }; const serializeAws_json1_1SearchContactsRequest = (input: SearchContactsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context) }), }; }; const serializeAws_json1_1SearchDevicesRequest = (input: SearchDevicesRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context) }), }; }; @@ -8310,34 +8313,34 @@ const serializeAws_json1_1SearchNetworkProfilesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context) }), }; }; const serializeAws_json1_1SearchProfilesRequest = (input: SearchProfilesRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context) }), }; }; const serializeAws_json1_1SearchRoomsRequest = (input: SearchRoomsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context) }), }; }; @@ -8346,83 +8349,115 @@ const serializeAws_json1_1SearchSkillGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context) }), }; }; const serializeAws_json1_1SearchUsersRequest = (input: SearchUsersRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_json1_1SortList(input.SortCriteria, context) }), }; }; const serializeAws_json1_1SendAnnouncementRequest = (input: SendAnnouncementRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Content !== undefined && { Content: serializeAws_json1_1Content(input.Content, context) }), - ...(input.RoomFilters !== undefined && { RoomFilters: serializeAws_json1_1FilterList(input.RoomFilters, context) }), - ...(input.TimeToLiveInSeconds !== undefined && { TimeToLiveInSeconds: input.TimeToLiveInSeconds }), + ...(input.Content !== undefined && + input.Content !== null && { Content: serializeAws_json1_1Content(input.Content, context) }), + ...(input.RoomFilters !== undefined && + input.RoomFilters !== null && { RoomFilters: serializeAws_json1_1FilterList(input.RoomFilters, context) }), + ...(input.TimeToLiveInSeconds !== undefined && + input.TimeToLiveInSeconds !== null && { TimeToLiveInSeconds: input.TimeToLiveInSeconds }), }; }; const serializeAws_json1_1SendInvitationRequest = (input: SendInvitationRequest, context: __SerdeContext): any => { return { - ...(input.UserArn !== undefined && { UserArn: input.UserArn }), + ...(input.UserArn !== undefined && input.UserArn !== null && { UserArn: input.UserArn }), }; }; const serializeAws_json1_1ShortSkillIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SipAddress = (input: SipAddress, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Uri !== undefined && { Uri: input.Uri }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Uri !== undefined && input.Uri !== null && { Uri: input.Uri }), }; }; const serializeAws_json1_1SipAddressList = (input: SipAddress[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SipAddress(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SipAddress(entry, context); + }); }; const serializeAws_json1_1Sort = (input: Sort, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1SortList = (input: Sort[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Sort(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Sort(entry, context); + }); }; const serializeAws_json1_1Ssml = (input: Ssml, context: __SerdeContext): any => { return { - ...(input.Locale !== undefined && { Locale: input.Locale }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Locale !== undefined && input.Locale !== null && { Locale: input.Locale }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1SsmlList = (input: Ssml[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Ssml(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Ssml(entry, context); + }); }; const serializeAws_json1_1StartDeviceSyncRequest = (input: StartDeviceSyncRequest, context: __SerdeContext): any => { return { - ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), - ...(input.Features !== undefined && { Features: serializeAws_json1_1Features(input.Features, context) }), - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.DeviceArn !== undefined && input.DeviceArn !== null && { DeviceArn: input.DeviceArn }), + ...(input.Features !== undefined && + input.Features !== null && { Features: serializeAws_json1_1Features(input.Features, context) }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), }; }; @@ -8431,51 +8466,80 @@ const serializeAws_json1_1StartSmartHomeApplianceDiscoveryRequest = ( context: __SerdeContext ): any => { return { - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1Text = (input: Text, context: __SerdeContext): any => { return { - ...(input.Locale !== undefined && { Locale: input.Locale }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Locale !== undefined && input.Locale !== null && { Locale: input.Locale }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TextList = (input: Text[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Text(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Text(entry, context); + }); }; const serializeAws_json1_1TrustAnchorList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -8484,9 +8548,10 @@ const serializeAws_json1_1UpdateAddressBookRequest = ( context: __SerdeContext ): any => { return { - ...(input.AddressBookArn !== undefined && { AddressBookArn: input.AddressBookArn }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AddressBookArn !== undefined && + input.AddressBookArn !== null && { AddressBookArn: input.AddressBookArn }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8495,14 +8560,15 @@ const serializeAws_json1_1UpdateBusinessReportScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.Recurrence !== undefined && { - Recurrence: serializeAws_json1_1BusinessReportRecurrence(input.Recurrence, context), - }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.S3KeyPrefix !== undefined && { S3KeyPrefix: input.S3KeyPrefix }), - ...(input.ScheduleArn !== undefined && { ScheduleArn: input.ScheduleArn }), - ...(input.ScheduleName !== undefined && { ScheduleName: input.ScheduleName }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.Recurrence !== undefined && + input.Recurrence !== null && { + Recurrence: serializeAws_json1_1BusinessReportRecurrence(input.Recurrence, context), + }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.S3KeyPrefix !== undefined && input.S3KeyPrefix !== null && { S3KeyPrefix: input.S3KeyPrefix }), + ...(input.ScheduleArn !== undefined && input.ScheduleArn !== null && { ScheduleArn: input.ScheduleArn }), + ...(input.ScheduleName !== undefined && input.ScheduleName !== null && { ScheduleName: input.ScheduleName }), }; }; @@ -8511,36 +8577,41 @@ const serializeAws_json1_1UpdateConferenceProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConferenceProviderArn !== undefined && { ConferenceProviderArn: input.ConferenceProviderArn }), - ...(input.ConferenceProviderType !== undefined && { ConferenceProviderType: input.ConferenceProviderType }), - ...(input.IPDialIn !== undefined && { IPDialIn: serializeAws_json1_1IPDialIn(input.IPDialIn, context) }), - ...(input.MeetingSetting !== undefined && { - MeetingSetting: serializeAws_json1_1MeetingSetting(input.MeetingSetting, context), - }), - ...(input.PSTNDialIn !== undefined && { PSTNDialIn: serializeAws_json1_1PSTNDialIn(input.PSTNDialIn, context) }), + ...(input.ConferenceProviderArn !== undefined && + input.ConferenceProviderArn !== null && { ConferenceProviderArn: input.ConferenceProviderArn }), + ...(input.ConferenceProviderType !== undefined && + input.ConferenceProviderType !== null && { ConferenceProviderType: input.ConferenceProviderType }), + ...(input.IPDialIn !== undefined && + input.IPDialIn !== null && { IPDialIn: serializeAws_json1_1IPDialIn(input.IPDialIn, context) }), + ...(input.MeetingSetting !== undefined && + input.MeetingSetting !== null && { + MeetingSetting: serializeAws_json1_1MeetingSetting(input.MeetingSetting, context), + }), + ...(input.PSTNDialIn !== undefined && + input.PSTNDialIn !== null && { PSTNDialIn: serializeAws_json1_1PSTNDialIn(input.PSTNDialIn, context) }), }; }; const serializeAws_json1_1UpdateContactRequest = (input: UpdateContactRequest, context: __SerdeContext): any => { return { - ...(input.ContactArn !== undefined && { ContactArn: input.ContactArn }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.FirstName !== undefined && { FirstName: input.FirstName }), - ...(input.LastName !== undefined && { LastName: input.LastName }), - ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }), - ...(input.PhoneNumbers !== undefined && { - PhoneNumbers: serializeAws_json1_1PhoneNumberList(input.PhoneNumbers, context), - }), - ...(input.SipAddresses !== undefined && { - SipAddresses: serializeAws_json1_1SipAddressList(input.SipAddresses, context), - }), + ...(input.ContactArn !== undefined && input.ContactArn !== null && { ContactArn: input.ContactArn }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.FirstName !== undefined && input.FirstName !== null && { FirstName: input.FirstName }), + ...(input.LastName !== undefined && input.LastName !== null && { LastName: input.LastName }), + ...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }), + ...(input.PhoneNumbers !== undefined && + input.PhoneNumbers !== null && { + PhoneNumbers: serializeAws_json1_1PhoneNumberList(input.PhoneNumbers, context), + }), + ...(input.SipAddresses !== undefined && + input.SipAddresses !== null && { SipAddresses: serializeAws_json1_1SipAddressList(input.SipAddresses, context) }), }; }; const serializeAws_json1_1UpdateDeviceRequest = (input: UpdateDeviceRequest, context: __SerdeContext): any => { return { - ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), - ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }), + ...(input.DeviceArn !== undefined && input.DeviceArn !== null && { DeviceArn: input.DeviceArn }), + ...(input.DeviceName !== undefined && input.DeviceName !== null && { DeviceName: input.DeviceName }), }; }; @@ -8549,11 +8620,12 @@ const serializeAws_json1_1UpdateEndOfMeetingReminder = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.ReminderAtMinutes !== undefined && { - ReminderAtMinutes: serializeAws_json1_1EndOfMeetingReminderMinutesList(input.ReminderAtMinutes, context), - }), - ...(input.ReminderType !== undefined && { ReminderType: input.ReminderType }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.ReminderAtMinutes !== undefined && + input.ReminderAtMinutes !== null && { + ReminderAtMinutes: serializeAws_json1_1EndOfMeetingReminderMinutesList(input.ReminderAtMinutes, context), + }), + ...(input.ReminderType !== undefined && input.ReminderType !== null && { ReminderType: input.ReminderType }), }; }; @@ -8562,25 +8634,28 @@ const serializeAws_json1_1UpdateGatewayGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.GatewayGroupArn !== undefined && { GatewayGroupArn: input.GatewayGroupArn }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.GatewayGroupArn !== undefined && + input.GatewayGroupArn !== null && { GatewayGroupArn: input.GatewayGroupArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1UpdateGatewayRequest = (input: UpdateGatewayRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.GatewayArn !== undefined && { GatewayArn: input.GatewayArn }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SoftwareVersion !== undefined && { SoftwareVersion: input.SoftwareVersion }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.GatewayArn !== undefined && input.GatewayArn !== null && { GatewayArn: input.GatewayArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SoftwareVersion !== undefined && + input.SoftwareVersion !== null && { SoftwareVersion: input.SoftwareVersion }), }; }; const serializeAws_json1_1UpdateInstantBooking = (input: UpdateInstantBooking, context: __SerdeContext): any => { return { - ...(input.DurationInMinutes !== undefined && { DurationInMinutes: input.DurationInMinutes }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.DurationInMinutes !== undefined && + input.DurationInMinutes !== null && { DurationInMinutes: input.DurationInMinutes }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; @@ -8589,18 +8664,22 @@ const serializeAws_json1_1UpdateMeetingRoomConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.EndOfMeetingReminder !== undefined && { - EndOfMeetingReminder: serializeAws_json1_1UpdateEndOfMeetingReminder(input.EndOfMeetingReminder, context), - }), - ...(input.InstantBooking !== undefined && { - InstantBooking: serializeAws_json1_1UpdateInstantBooking(input.InstantBooking, context), - }), - ...(input.RequireCheckIn !== undefined && { - RequireCheckIn: serializeAws_json1_1UpdateRequireCheckIn(input.RequireCheckIn, context), - }), - ...(input.RoomUtilizationMetricsEnabled !== undefined && { - RoomUtilizationMetricsEnabled: input.RoomUtilizationMetricsEnabled, - }), + ...(input.EndOfMeetingReminder !== undefined && + input.EndOfMeetingReminder !== null && { + EndOfMeetingReminder: serializeAws_json1_1UpdateEndOfMeetingReminder(input.EndOfMeetingReminder, context), + }), + ...(input.InstantBooking !== undefined && + input.InstantBooking !== null && { + InstantBooking: serializeAws_json1_1UpdateInstantBooking(input.InstantBooking, context), + }), + ...(input.RequireCheckIn !== undefined && + input.RequireCheckIn !== null && { + RequireCheckIn: serializeAws_json1_1UpdateRequireCheckIn(input.RequireCheckIn, context), + }), + ...(input.RoomUtilizationMetricsEnabled !== undefined && + input.RoomUtilizationMetricsEnabled !== null && { + RoomUtilizationMetricsEnabled: input.RoomUtilizationMetricsEnabled, + }), }; }; @@ -8609,63 +8688,75 @@ const serializeAws_json1_1UpdateNetworkProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.CurrentPassword !== undefined && { CurrentPassword: input.CurrentPassword }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.NetworkProfileArn !== undefined && { NetworkProfileArn: input.NetworkProfileArn }), - ...(input.NetworkProfileName !== undefined && { NetworkProfileName: input.NetworkProfileName }), - ...(input.NextPassword !== undefined && { NextPassword: input.NextPassword }), - ...(input.TrustAnchors !== undefined && { - TrustAnchors: serializeAws_json1_1TrustAnchorList(input.TrustAnchors, context), - }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CurrentPassword !== undefined && + input.CurrentPassword !== null && { CurrentPassword: input.CurrentPassword }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.NetworkProfileArn !== undefined && + input.NetworkProfileArn !== null && { NetworkProfileArn: input.NetworkProfileArn }), + ...(input.NetworkProfileName !== undefined && + input.NetworkProfileName !== null && { NetworkProfileName: input.NetworkProfileName }), + ...(input.NextPassword !== undefined && input.NextPassword !== null && { NextPassword: input.NextPassword }), + ...(input.TrustAnchors !== undefined && + input.TrustAnchors !== null && { + TrustAnchors: serializeAws_json1_1TrustAnchorList(input.TrustAnchors, context), + }), }; }; const serializeAws_json1_1UpdateProfileRequest = (input: UpdateProfileRequest, context: __SerdeContext): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), - ...(input.DistanceUnit !== undefined && { DistanceUnit: input.DistanceUnit }), - ...(input.IsDefault !== undefined && { IsDefault: input.IsDefault }), - ...(input.Locale !== undefined && { Locale: input.Locale }), - ...(input.MaxVolumeLimit !== undefined && { MaxVolumeLimit: input.MaxVolumeLimit }), - ...(input.MeetingRoomConfiguration !== undefined && { - MeetingRoomConfiguration: serializeAws_json1_1UpdateMeetingRoomConfiguration( - input.MeetingRoomConfiguration, - context - ), - }), - ...(input.PSTNEnabled !== undefined && { PSTNEnabled: input.PSTNEnabled }), - ...(input.ProfileArn !== undefined && { ProfileArn: input.ProfileArn }), - ...(input.ProfileName !== undefined && { ProfileName: input.ProfileName }), - ...(input.SetupModeDisabled !== undefined && { SetupModeDisabled: input.SetupModeDisabled }), - ...(input.TemperatureUnit !== undefined && { TemperatureUnit: input.TemperatureUnit }), - ...(input.Timezone !== undefined && { Timezone: input.Timezone }), - ...(input.WakeWord !== undefined && { WakeWord: input.WakeWord }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), + ...(input.DistanceUnit !== undefined && input.DistanceUnit !== null && { DistanceUnit: input.DistanceUnit }), + ...(input.IsDefault !== undefined && input.IsDefault !== null && { IsDefault: input.IsDefault }), + ...(input.Locale !== undefined && input.Locale !== null && { Locale: input.Locale }), + ...(input.MaxVolumeLimit !== undefined && + input.MaxVolumeLimit !== null && { MaxVolumeLimit: input.MaxVolumeLimit }), + ...(input.MeetingRoomConfiguration !== undefined && + input.MeetingRoomConfiguration !== null && { + MeetingRoomConfiguration: serializeAws_json1_1UpdateMeetingRoomConfiguration( + input.MeetingRoomConfiguration, + context + ), + }), + ...(input.PSTNEnabled !== undefined && input.PSTNEnabled !== null && { PSTNEnabled: input.PSTNEnabled }), + ...(input.ProfileArn !== undefined && input.ProfileArn !== null && { ProfileArn: input.ProfileArn }), + ...(input.ProfileName !== undefined && input.ProfileName !== null && { ProfileName: input.ProfileName }), + ...(input.SetupModeDisabled !== undefined && + input.SetupModeDisabled !== null && { SetupModeDisabled: input.SetupModeDisabled }), + ...(input.TemperatureUnit !== undefined && + input.TemperatureUnit !== null && { TemperatureUnit: input.TemperatureUnit }), + ...(input.Timezone !== undefined && input.Timezone !== null && { Timezone: input.Timezone }), + ...(input.WakeWord !== undefined && input.WakeWord !== null && { WakeWord: input.WakeWord }), }; }; const serializeAws_json1_1UpdateRequireCheckIn = (input: UpdateRequireCheckIn, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.ReleaseAfterMinutes !== undefined && { ReleaseAfterMinutes: input.ReleaseAfterMinutes }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.ReleaseAfterMinutes !== undefined && + input.ReleaseAfterMinutes !== null && { ReleaseAfterMinutes: input.ReleaseAfterMinutes }), }; }; const serializeAws_json1_1UpdateRoomRequest = (input: UpdateRoomRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ProfileArn !== undefined && { ProfileArn: input.ProfileArn }), - ...(input.ProviderCalendarId !== undefined && { ProviderCalendarId: input.ProviderCalendarId }), - ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), - ...(input.RoomName !== undefined && { RoomName: input.RoomName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ProfileArn !== undefined && input.ProfileArn !== null && { ProfileArn: input.ProfileArn }), + ...(input.ProviderCalendarId !== undefined && + input.ProviderCalendarId !== null && { ProviderCalendarId: input.ProviderCalendarId }), + ...(input.RoomArn !== undefined && input.RoomArn !== null && { RoomArn: input.RoomArn }), + ...(input.RoomName !== undefined && input.RoomName !== null && { RoomName: input.RoomName }), }; }; const serializeAws_json1_1UpdateSkillGroupRequest = (input: UpdateSkillGroupRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.SkillGroupArn !== undefined && { SkillGroupArn: input.SkillGroupArn }), - ...(input.SkillGroupName !== undefined && { SkillGroupName: input.SkillGroupName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.SkillGroupArn !== undefined && input.SkillGroupArn !== null && { SkillGroupArn: input.SkillGroupArn }), + ...(input.SkillGroupName !== undefined && + input.SkillGroupName !== null && { SkillGroupName: input.SkillGroupName }), }; }; @@ -8688,7 +8779,14 @@ const deserializeAws_json1_1AddressBookData = (output: any, context: __SerdeCont }; const deserializeAws_json1_1AddressBookDataList = (output: any, context: __SerdeContext): AddressBookData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AddressBookData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AddressBookData(entry, context); + }); }; const deserializeAws_json1_1AlreadyExistsException = (output: any, context: __SerdeContext): AlreadyExistsException => { @@ -8744,7 +8842,14 @@ const deserializeAws_json1_1AssociateSkillWithUsersResponse = ( }; const deserializeAws_json1_1BulletPoints = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1BusinessReport = (output: any, context: __SerdeContext): BusinessReport => { @@ -8817,7 +8922,14 @@ const deserializeAws_json1_1BusinessReportScheduleList = ( output: any, context: __SerdeContext ): BusinessReportSchedule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BusinessReportSchedule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BusinessReportSchedule(entry, context); + }); }; const deserializeAws_json1_1Category = (output: any, context: __SerdeContext): Category => { @@ -8828,7 +8940,14 @@ const deserializeAws_json1_1Category = (output: any, context: __SerdeContext): C }; const deserializeAws_json1_1CategoryList = (output: any, context: __SerdeContext): Category[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Category(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Category(entry, context); + }); }; const deserializeAws_json1_1ConcurrentModificationException = ( @@ -8870,7 +8989,14 @@ const deserializeAws_json1_1ConferenceProvider = (output: any, context: __SerdeC }; const deserializeAws_json1_1ConferenceProvidersList = (output: any, context: __SerdeContext): ConferenceProvider[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConferenceProvider(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConferenceProvider(entry, context); + }); }; const deserializeAws_json1_1Contact = (output: any, context: __SerdeContext): Contact => { @@ -8910,7 +9036,14 @@ const deserializeAws_json1_1ContactData = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ContactDataList = (output: any, context: __SerdeContext): ContactData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContactData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContactData(entry, context); + }); }; const deserializeAws_json1_1CreateAddressBookResponse = ( @@ -9154,7 +9287,14 @@ const deserializeAws_json1_1DeviceData = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1DeviceDataList = (output: any, context: __SerdeContext): DeviceData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeviceData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeviceData(entry, context); + }); }; const deserializeAws_json1_1DeviceEvent = (output: any, context: __SerdeContext): DeviceEvent => { @@ -9169,7 +9309,14 @@ const deserializeAws_json1_1DeviceEvent = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1DeviceEventList = (output: any, context: __SerdeContext): DeviceEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeviceEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeviceEvent(entry, context); + }); }; const deserializeAws_json1_1DeviceNetworkProfileInfo = ( @@ -9207,7 +9354,14 @@ const deserializeAws_json1_1DeviceStatusDetail = (output: any, context: __SerdeC }; const deserializeAws_json1_1DeviceStatusDetails = (output: any, context: __SerdeContext): DeviceStatusDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeviceStatusDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeviceStatusDetail(entry, context); + }); }; const deserializeAws_json1_1DeviceStatusInfo = (output: any, context: __SerdeContext): DeviceStatusInfo => { @@ -9272,7 +9426,14 @@ const deserializeAws_json1_1EndOfMeetingReminder = (output: any, context: __Serd }; const deserializeAws_json1_1EndOfMeetingReminderMinutesList = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ForgetSmartHomeAppliancesResponse = ( @@ -9303,7 +9464,14 @@ const deserializeAws_json1_1GatewayGroup = (output: any, context: __SerdeContext }; const deserializeAws_json1_1GatewayGroupSummaries = (output: any, context: __SerdeContext): GatewayGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GatewayGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GatewayGroupSummary(entry, context); + }); }; const deserializeAws_json1_1GatewayGroupSummary = (output: any, context: __SerdeContext): GatewayGroupSummary => { @@ -9315,7 +9483,14 @@ const deserializeAws_json1_1GatewayGroupSummary = (output: any, context: __Serde }; const deserializeAws_json1_1GatewaySummaries = (output: any, context: __SerdeContext): GatewaySummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GatewaySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GatewaySummary(entry, context); + }); }; const deserializeAws_json1_1GatewaySummary = (output: any, context: __SerdeContext): GatewaySummary => { @@ -9331,7 +9506,14 @@ const deserializeAws_json1_1GatewaySummary = (output: any, context: __SerdeConte }; const deserializeAws_json1_1GenericKeywords = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1GetAddressBookResponse = (output: any, context: __SerdeContext): GetAddressBookResponse => { @@ -9743,11 +9925,25 @@ const deserializeAws_json1_1NetworkProfileData = (output: any, context: __SerdeC }; const deserializeAws_json1_1NetworkProfileDataList = (output: any, context: __SerdeContext): NetworkProfileData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NetworkProfileData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NetworkProfileData(entry, context); + }); }; const deserializeAws_json1_1NewInThisVersionBulletPoints = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NotFoundException = (output: any, context: __SerdeContext): NotFoundException => { @@ -9764,7 +9960,14 @@ const deserializeAws_json1_1PhoneNumber = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1PhoneNumberList = (output: any, context: __SerdeContext): PhoneNumber[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PhoneNumber(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PhoneNumber(entry, context); + }); }; const deserializeAws_json1_1Profile = (output: any, context: __SerdeContext): Profile => { @@ -9811,7 +10014,14 @@ const deserializeAws_json1_1ProfileData = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ProfileDataList = (output: any, context: __SerdeContext): ProfileData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProfileData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProfileData(entry, context); + }); }; const deserializeAws_json1_1PSTNDialIn = (output: any, context: __SerdeContext): PSTNDialIn => { @@ -9907,13 +10117,15 @@ const deserializeAws_json1_1ResourceInUseException = (output: any, context: __Se }; const deserializeAws_json1_1Reviews = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1RevokeInvitationResponse = ( @@ -9951,7 +10163,14 @@ const deserializeAws_json1_1RoomData = (output: any, context: __SerdeContext): R }; const deserializeAws_json1_1RoomDataList = (output: any, context: __SerdeContext): RoomData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RoomData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RoomData(entry, context); + }); }; const deserializeAws_json1_1RoomSkillParameter = (output: any, context: __SerdeContext): RoomSkillParameter => { @@ -9963,11 +10182,25 @@ const deserializeAws_json1_1RoomSkillParameter = (output: any, context: __SerdeC }; const deserializeAws_json1_1RoomSkillParameters = (output: any, context: __SerdeContext): RoomSkillParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RoomSkillParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RoomSkillParameter(entry, context); + }); }; const deserializeAws_json1_1SampleUtterances = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SearchAddressBooksResponse = ( @@ -10082,7 +10315,14 @@ const deserializeAws_json1_1SendInvitationResponse = (output: any, context: __Se }; const deserializeAws_json1_1ShortSkillIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SipAddress = (output: any, context: __SerdeContext): SipAddress => { @@ -10093,7 +10333,14 @@ const deserializeAws_json1_1SipAddress = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1SipAddressList = (output: any, context: __SerdeContext): SipAddress[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SipAddress(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SipAddress(entry, context); + }); }; const deserializeAws_json1_1SkillDetails = (output: any, context: __SerdeContext): SkillDetails => { @@ -10157,7 +10404,14 @@ const deserializeAws_json1_1SkillGroupData = (output: any, context: __SerdeConte }; const deserializeAws_json1_1SkillGroupDataList = (output: any, context: __SerdeContext): SkillGroupData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SkillGroupData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SkillGroupData(entry, context); + }); }; const deserializeAws_json1_1SkillNotLinkedException = ( @@ -10190,7 +10444,14 @@ const deserializeAws_json1_1SkillsStoreSkill = (output: any, context: __SerdeCon }; const deserializeAws_json1_1SkillsStoreSkillList = (output: any, context: __SerdeContext): SkillsStoreSkill[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SkillsStoreSkill(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SkillsStoreSkill(entry, context); + }); }; const deserializeAws_json1_1SkillSummary = (output: any, context: __SerdeContext): SkillSummary => { @@ -10206,11 +10467,25 @@ const deserializeAws_json1_1SkillSummary = (output: any, context: __SerdeContext }; const deserializeAws_json1_1SkillSummaryList = (output: any, context: __SerdeContext): SkillSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SkillSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SkillSummary(entry, context); + }); }; const deserializeAws_json1_1SkillTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SmartHomeAppliance = (output: any, context: __SerdeContext): SmartHomeAppliance => { @@ -10223,7 +10498,14 @@ const deserializeAws_json1_1SmartHomeAppliance = (output: any, context: __SerdeC }; const deserializeAws_json1_1SmartHomeApplianceList = (output: any, context: __SerdeContext): SmartHomeAppliance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SmartHomeAppliance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SmartHomeAppliance(entry, context); + }); }; const deserializeAws_json1_1StartDeviceSyncResponse = ( @@ -10248,7 +10530,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -10256,7 +10545,14 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1TrustAnchorList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1UnauthorizedException = (output: any, context: __SerdeContext): UnauthorizedException => { @@ -10344,7 +10640,14 @@ const deserializeAws_json1_1UserData = (output: any, context: __SerdeContext): U }; const deserializeAws_json1_1UserDataList = (output: any, context: __SerdeContext): UserData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserData(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -10397,3 +10700,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-amplify/protocols/Aws_restJson1.ts b/clients/client-amplify/protocols/Aws_restJson1.ts index 36579f845ec3..ab695ce1b766 100644 --- a/clients/client-amplify/protocols/Aws_restJson1.ts +++ b/clients/client-amplify/protocols/Aws_restJson1.ts @@ -105,41 +105,52 @@ export const serializeAws_restJson1CreateAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps"; let body: any; body = JSON.stringify({ - ...(input.accessToken !== undefined && { accessToken: input.accessToken }), - ...(input.autoBranchCreationConfig !== undefined && { - autoBranchCreationConfig: serializeAws_restJson1AutoBranchCreationConfig(input.autoBranchCreationConfig, context), - }), - ...(input.autoBranchCreationPatterns !== undefined && { - autoBranchCreationPatterns: serializeAws_restJson1AutoBranchCreationPatterns( - input.autoBranchCreationPatterns, - context - ), - }), - ...(input.basicAuthCredentials !== undefined && { basicAuthCredentials: input.basicAuthCredentials }), - ...(input.buildSpec !== undefined && { buildSpec: input.buildSpec }), - ...(input.customHeaders !== undefined && { customHeaders: input.customHeaders }), - ...(input.customRules !== undefined && { - customRules: serializeAws_restJson1CustomRules(input.customRules, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.enableAutoBranchCreation !== undefined && { enableAutoBranchCreation: input.enableAutoBranchCreation }), - ...(input.enableBasicAuth !== undefined && { enableBasicAuth: input.enableBasicAuth }), - ...(input.enableBranchAutoBuild !== undefined && { enableBranchAutoBuild: input.enableBranchAutoBuild }), - ...(input.enableBranchAutoDeletion !== undefined && { enableBranchAutoDeletion: input.enableBranchAutoDeletion }), - ...(input.environmentVariables !== undefined && { - environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), - }), - ...(input.iamServiceRoleArn !== undefined && { iamServiceRoleArn: input.iamServiceRoleArn }), - ...(input.name !== undefined && { name: input.name }), - ...(input.oauthToken !== undefined && { oauthToken: input.oauthToken }), - ...(input.platform !== undefined && { platform: input.platform }), - ...(input.repository !== undefined && { repository: input.repository }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.accessToken !== undefined && input.accessToken !== null && { accessToken: input.accessToken }), + ...(input.autoBranchCreationConfig !== undefined && + input.autoBranchCreationConfig !== null && { + autoBranchCreationConfig: serializeAws_restJson1AutoBranchCreationConfig( + input.autoBranchCreationConfig, + context + ), + }), + ...(input.autoBranchCreationPatterns !== undefined && + input.autoBranchCreationPatterns !== null && { + autoBranchCreationPatterns: serializeAws_restJson1AutoBranchCreationPatterns( + input.autoBranchCreationPatterns, + context + ), + }), + ...(input.basicAuthCredentials !== undefined && + input.basicAuthCredentials !== null && { basicAuthCredentials: input.basicAuthCredentials }), + ...(input.buildSpec !== undefined && input.buildSpec !== null && { buildSpec: input.buildSpec }), + ...(input.customHeaders !== undefined && input.customHeaders !== null && { customHeaders: input.customHeaders }), + ...(input.customRules !== undefined && + input.customRules !== null && { customRules: serializeAws_restJson1CustomRules(input.customRules, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.enableAutoBranchCreation !== undefined && + input.enableAutoBranchCreation !== null && { enableAutoBranchCreation: input.enableAutoBranchCreation }), + ...(input.enableBasicAuth !== undefined && + input.enableBasicAuth !== null && { enableBasicAuth: input.enableBasicAuth }), + ...(input.enableBranchAutoBuild !== undefined && + input.enableBranchAutoBuild !== null && { enableBranchAutoBuild: input.enableBranchAutoBuild }), + ...(input.enableBranchAutoDeletion !== undefined && + input.enableBranchAutoDeletion !== null && { enableBranchAutoDeletion: input.enableBranchAutoDeletion }), + ...(input.environmentVariables !== undefined && + input.environmentVariables !== null && { + environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), + }), + ...(input.iamServiceRoleArn !== undefined && + input.iamServiceRoleArn !== null && { iamServiceRoleArn: input.iamServiceRoleArn }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.oauthToken !== undefined && input.oauthToken !== null && { oauthToken: input.oauthToken }), + ...(input.platform !== undefined && input.platform !== null && { platform: input.platform }), + ...(input.repository !== undefined && input.repository !== null && { repository: input.repository }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -158,7 +169,7 @@ export const serializeAws_restJson1CreateBackendEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/backendenvironments"; if (input.appId !== undefined) { @@ -172,9 +183,11 @@ export const serializeAws_restJson1CreateBackendEnvironmentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.deploymentArtifacts !== undefined && { deploymentArtifacts: input.deploymentArtifacts }), - ...(input.environmentName !== undefined && { environmentName: input.environmentName }), - ...(input.stackName !== undefined && { stackName: input.stackName }), + ...(input.deploymentArtifacts !== undefined && + input.deploymentArtifacts !== null && { deploymentArtifacts: input.deploymentArtifacts }), + ...(input.environmentName !== undefined && + input.environmentName !== null && { environmentName: input.environmentName }), + ...(input.stackName !== undefined && input.stackName !== null && { stackName: input.stackName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -193,7 +206,7 @@ export const serializeAws_restJson1CreateBranchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/branches"; if (input.appId !== undefined) { @@ -207,27 +220,34 @@ export const serializeAws_restJson1CreateBranchCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.backendEnvironmentArn !== undefined && { backendEnvironmentArn: input.backendEnvironmentArn }), - ...(input.basicAuthCredentials !== undefined && { basicAuthCredentials: input.basicAuthCredentials }), - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.buildSpec !== undefined && { buildSpec: input.buildSpec }), - ...(input.description !== undefined && { description: input.description }), - ...(input.displayName !== undefined && { displayName: input.displayName }), - ...(input.enableAutoBuild !== undefined && { enableAutoBuild: input.enableAutoBuild }), - ...(input.enableBasicAuth !== undefined && { enableBasicAuth: input.enableBasicAuth }), - ...(input.enableNotification !== undefined && { enableNotification: input.enableNotification }), - ...(input.enablePerformanceMode !== undefined && { enablePerformanceMode: input.enablePerformanceMode }), - ...(input.enablePullRequestPreview !== undefined && { enablePullRequestPreview: input.enablePullRequestPreview }), - ...(input.environmentVariables !== undefined && { - environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), - }), - ...(input.framework !== undefined && { framework: input.framework }), - ...(input.pullRequestEnvironmentName !== undefined && { - pullRequestEnvironmentName: input.pullRequestEnvironmentName, - }), - ...(input.stage !== undefined && { stage: input.stage }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.ttl !== undefined && { ttl: input.ttl }), + ...(input.backendEnvironmentArn !== undefined && + input.backendEnvironmentArn !== null && { backendEnvironmentArn: input.backendEnvironmentArn }), + ...(input.basicAuthCredentials !== undefined && + input.basicAuthCredentials !== null && { basicAuthCredentials: input.basicAuthCredentials }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.buildSpec !== undefined && input.buildSpec !== null && { buildSpec: input.buildSpec }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.displayName !== undefined && input.displayName !== null && { displayName: input.displayName }), + ...(input.enableAutoBuild !== undefined && + input.enableAutoBuild !== null && { enableAutoBuild: input.enableAutoBuild }), + ...(input.enableBasicAuth !== undefined && + input.enableBasicAuth !== null && { enableBasicAuth: input.enableBasicAuth }), + ...(input.enableNotification !== undefined && + input.enableNotification !== null && { enableNotification: input.enableNotification }), + ...(input.enablePerformanceMode !== undefined && + input.enablePerformanceMode !== null && { enablePerformanceMode: input.enablePerformanceMode }), + ...(input.enablePullRequestPreview !== undefined && + input.enablePullRequestPreview !== null && { enablePullRequestPreview: input.enablePullRequestPreview }), + ...(input.environmentVariables !== undefined && + input.environmentVariables !== null && { + environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), + }), + ...(input.framework !== undefined && input.framework !== null && { framework: input.framework }), + ...(input.pullRequestEnvironmentName !== undefined && + input.pullRequestEnvironmentName !== null && { pullRequestEnvironmentName: input.pullRequestEnvironmentName }), + ...(input.stage !== undefined && input.stage !== null && { stage: input.stage }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.ttl !== undefined && input.ttl !== null && { ttl: input.ttl }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -246,7 +266,7 @@ export const serializeAws_restJson1CreateDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/branches/{branchName}/deployments"; if (input.appId !== undefined) { @@ -269,7 +289,8 @@ export const serializeAws_restJson1CreateDeploymentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.fileMap !== undefined && { fileMap: serializeAws_restJson1FileMap(input.fileMap, context) }), + ...(input.fileMap !== undefined && + input.fileMap !== null && { fileMap: serializeAws_restJson1FileMap(input.fileMap, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -288,7 +309,7 @@ export const serializeAws_restJson1CreateDomainAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/domains"; if (input.appId !== undefined) { @@ -302,18 +323,22 @@ export const serializeAws_restJson1CreateDomainAssociationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.autoSubDomainCreationPatterns !== undefined && { - autoSubDomainCreationPatterns: serializeAws_restJson1AutoSubDomainCreationPatterns( - input.autoSubDomainCreationPatterns, - context - ), - }), - ...(input.autoSubDomainIAMRole !== undefined && { autoSubDomainIAMRole: input.autoSubDomainIAMRole }), - ...(input.domainName !== undefined && { domainName: input.domainName }), - ...(input.enableAutoSubDomain !== undefined && { enableAutoSubDomain: input.enableAutoSubDomain }), - ...(input.subDomainSettings !== undefined && { - subDomainSettings: serializeAws_restJson1SubDomainSettings(input.subDomainSettings, context), - }), + ...(input.autoSubDomainCreationPatterns !== undefined && + input.autoSubDomainCreationPatterns !== null && { + autoSubDomainCreationPatterns: serializeAws_restJson1AutoSubDomainCreationPatterns( + input.autoSubDomainCreationPatterns, + context + ), + }), + ...(input.autoSubDomainIAMRole !== undefined && + input.autoSubDomainIAMRole !== null && { autoSubDomainIAMRole: input.autoSubDomainIAMRole }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), + ...(input.enableAutoSubDomain !== undefined && + input.enableAutoSubDomain !== null && { enableAutoSubDomain: input.enableAutoSubDomain }), + ...(input.subDomainSettings !== undefined && + input.subDomainSettings !== null && { + subDomainSettings: serializeAws_restJson1SubDomainSettings(input.subDomainSettings, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -332,7 +357,7 @@ export const serializeAws_restJson1CreateWebhookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/webhooks"; if (input.appId !== undefined) { @@ -346,8 +371,8 @@ export const serializeAws_restJson1CreateWebhookCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.description !== undefined && { description: input.description }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -365,9 +390,7 @@ export const serializeAws_restJson1DeleteAppCommand = async ( input: DeleteAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -395,9 +418,7 @@ export const serializeAws_restJson1DeleteBackendEnvironmentCommand = async ( input: DeleteBackendEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/backendenvironments/{environmentName}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -434,9 +455,7 @@ export const serializeAws_restJson1DeleteBranchCommand = async ( input: DeleteBranchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/branches/{branchName}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -473,9 +492,7 @@ export const serializeAws_restJson1DeleteDomainAssociationCommand = async ( input: DeleteDomainAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/domains/{domainName}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -512,9 +529,7 @@ export const serializeAws_restJson1DeleteJobCommand = async ( input: DeleteJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/branches/{branchName}/jobs/{jobId}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -560,9 +575,7 @@ export const serializeAws_restJson1DeleteWebhookCommand = async ( input: DeleteWebhookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/webhooks/{webhookId}"; if (input.webhookId !== undefined) { const labelValue: string = input.webhookId; @@ -591,7 +604,7 @@ export const serializeAws_restJson1GenerateAccessLogsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/accesslogs"; if (input.appId !== undefined) { @@ -605,9 +618,11 @@ export const serializeAws_restJson1GenerateAccessLogsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.domainName !== undefined && { domainName: input.domainName }), - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -625,9 +640,7 @@ export const serializeAws_restJson1GetAppCommand = async ( input: GetAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -655,9 +668,7 @@ export const serializeAws_restJson1GetArtifactUrlCommand = async ( input: GetArtifactUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/artifacts/{artifactId}"; if (input.artifactId !== undefined) { const labelValue: string = input.artifactId; @@ -685,9 +696,7 @@ export const serializeAws_restJson1GetBackendEnvironmentCommand = async ( input: GetBackendEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/backendenvironments/{environmentName}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -724,9 +733,7 @@ export const serializeAws_restJson1GetBranchCommand = async ( input: GetBranchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/branches/{branchName}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -763,9 +770,7 @@ export const serializeAws_restJson1GetDomainAssociationCommand = async ( input: GetDomainAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/domains/{domainName}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -802,9 +807,7 @@ export const serializeAws_restJson1GetJobCommand = async ( input: GetJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/branches/{branchName}/jobs/{jobId}"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -850,9 +853,7 @@ export const serializeAws_restJson1GetWebhookCommand = async ( input: GetWebhookCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/webhooks/{webhookId}"; if (input.webhookId !== undefined) { const labelValue: string = input.webhookId; @@ -880,9 +881,7 @@ export const serializeAws_restJson1ListAppsCommand = async ( input: ListAppsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -906,9 +905,7 @@ export const serializeAws_restJson1ListArtifactsCommand = async ( input: ListArtifactsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/branches/{branchName}/jobs/{jobId}/artifacts"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -959,9 +956,7 @@ export const serializeAws_restJson1ListBackendEnvironmentsCommand = async ( input: ListBackendEnvironmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/backendenvironments"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -995,9 +990,7 @@ export const serializeAws_restJson1ListBranchesCommand = async ( input: ListBranchesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/branches"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -1030,9 +1023,7 @@ export const serializeAws_restJson1ListDomainAssociationsCommand = async ( input: ListDomainAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/domains"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -1065,9 +1056,7 @@ export const serializeAws_restJson1ListJobsCommand = async ( input: ListJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/branches/{branchName}/jobs"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -1109,9 +1098,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1139,9 +1126,7 @@ export const serializeAws_restJson1ListWebhooksCommand = async ( input: ListWebhooksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/webhooks"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -1175,7 +1160,7 @@ export const serializeAws_restJson1StartDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/branches/{branchName}/deployments/start"; if (input.appId !== undefined) { @@ -1198,8 +1183,8 @@ export const serializeAws_restJson1StartDeploymentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.jobId !== undefined && { jobId: input.jobId }), - ...(input.sourceUrl !== undefined && { sourceUrl: input.sourceUrl }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), + ...(input.sourceUrl !== undefined && input.sourceUrl !== null && { sourceUrl: input.sourceUrl }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1218,7 +1203,7 @@ export const serializeAws_restJson1StartJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/branches/{branchName}/jobs"; if (input.appId !== undefined) { @@ -1241,12 +1226,13 @@ export const serializeAws_restJson1StartJobCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.commitId !== undefined && { commitId: input.commitId }), - ...(input.commitMessage !== undefined && { commitMessage: input.commitMessage }), - ...(input.commitTime !== undefined && { commitTime: Math.round(input.commitTime.getTime() / 1000) }), - ...(input.jobId !== undefined && { jobId: input.jobId }), - ...(input.jobReason !== undefined && { jobReason: input.jobReason }), - ...(input.jobType !== undefined && { jobType: input.jobType }), + ...(input.commitId !== undefined && input.commitId !== null && { commitId: input.commitId }), + ...(input.commitMessage !== undefined && input.commitMessage !== null && { commitMessage: input.commitMessage }), + ...(input.commitTime !== undefined && + input.commitTime !== null && { commitTime: Math.round(input.commitTime.getTime() / 1000) }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), + ...(input.jobReason !== undefined && input.jobReason !== null && { jobReason: input.jobReason }), + ...(input.jobType !== undefined && input.jobType !== null && { jobType: input.jobType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1264,9 +1250,7 @@ export const serializeAws_restJson1StopJobCommand = async ( input: StopJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apps/{appId}/branches/{branchName}/jobs/{jobId}/stop"; if (input.appId !== undefined) { const labelValue: string = input.appId; @@ -1313,7 +1297,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -1327,7 +1311,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1345,9 +1329,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1380,7 +1362,7 @@ export const serializeAws_restJson1UpdateAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}"; if (input.appId !== undefined) { @@ -1394,35 +1376,46 @@ export const serializeAws_restJson1UpdateAppCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.accessToken !== undefined && { accessToken: input.accessToken }), - ...(input.autoBranchCreationConfig !== undefined && { - autoBranchCreationConfig: serializeAws_restJson1AutoBranchCreationConfig(input.autoBranchCreationConfig, context), - }), - ...(input.autoBranchCreationPatterns !== undefined && { - autoBranchCreationPatterns: serializeAws_restJson1AutoBranchCreationPatterns( - input.autoBranchCreationPatterns, - context - ), - }), - ...(input.basicAuthCredentials !== undefined && { basicAuthCredentials: input.basicAuthCredentials }), - ...(input.buildSpec !== undefined && { buildSpec: input.buildSpec }), - ...(input.customHeaders !== undefined && { customHeaders: input.customHeaders }), - ...(input.customRules !== undefined && { - customRules: serializeAws_restJson1CustomRules(input.customRules, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.enableAutoBranchCreation !== undefined && { enableAutoBranchCreation: input.enableAutoBranchCreation }), - ...(input.enableBasicAuth !== undefined && { enableBasicAuth: input.enableBasicAuth }), - ...(input.enableBranchAutoBuild !== undefined && { enableBranchAutoBuild: input.enableBranchAutoBuild }), - ...(input.enableBranchAutoDeletion !== undefined && { enableBranchAutoDeletion: input.enableBranchAutoDeletion }), - ...(input.environmentVariables !== undefined && { - environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), - }), - ...(input.iamServiceRoleArn !== undefined && { iamServiceRoleArn: input.iamServiceRoleArn }), - ...(input.name !== undefined && { name: input.name }), - ...(input.oauthToken !== undefined && { oauthToken: input.oauthToken }), - ...(input.platform !== undefined && { platform: input.platform }), - ...(input.repository !== undefined && { repository: input.repository }), + ...(input.accessToken !== undefined && input.accessToken !== null && { accessToken: input.accessToken }), + ...(input.autoBranchCreationConfig !== undefined && + input.autoBranchCreationConfig !== null && { + autoBranchCreationConfig: serializeAws_restJson1AutoBranchCreationConfig( + input.autoBranchCreationConfig, + context + ), + }), + ...(input.autoBranchCreationPatterns !== undefined && + input.autoBranchCreationPatterns !== null && { + autoBranchCreationPatterns: serializeAws_restJson1AutoBranchCreationPatterns( + input.autoBranchCreationPatterns, + context + ), + }), + ...(input.basicAuthCredentials !== undefined && + input.basicAuthCredentials !== null && { basicAuthCredentials: input.basicAuthCredentials }), + ...(input.buildSpec !== undefined && input.buildSpec !== null && { buildSpec: input.buildSpec }), + ...(input.customHeaders !== undefined && input.customHeaders !== null && { customHeaders: input.customHeaders }), + ...(input.customRules !== undefined && + input.customRules !== null && { customRules: serializeAws_restJson1CustomRules(input.customRules, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.enableAutoBranchCreation !== undefined && + input.enableAutoBranchCreation !== null && { enableAutoBranchCreation: input.enableAutoBranchCreation }), + ...(input.enableBasicAuth !== undefined && + input.enableBasicAuth !== null && { enableBasicAuth: input.enableBasicAuth }), + ...(input.enableBranchAutoBuild !== undefined && + input.enableBranchAutoBuild !== null && { enableBranchAutoBuild: input.enableBranchAutoBuild }), + ...(input.enableBranchAutoDeletion !== undefined && + input.enableBranchAutoDeletion !== null && { enableBranchAutoDeletion: input.enableBranchAutoDeletion }), + ...(input.environmentVariables !== undefined && + input.environmentVariables !== null && { + environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), + }), + ...(input.iamServiceRoleArn !== undefined && + input.iamServiceRoleArn !== null && { iamServiceRoleArn: input.iamServiceRoleArn }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.oauthToken !== undefined && input.oauthToken !== null && { oauthToken: input.oauthToken }), + ...(input.platform !== undefined && input.platform !== null && { platform: input.platform }), + ...(input.repository !== undefined && input.repository !== null && { repository: input.repository }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1441,7 +1434,7 @@ export const serializeAws_restJson1UpdateBranchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/branches/{branchName}"; if (input.appId !== undefined) { @@ -1464,25 +1457,32 @@ export const serializeAws_restJson1UpdateBranchCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.backendEnvironmentArn !== undefined && { backendEnvironmentArn: input.backendEnvironmentArn }), - ...(input.basicAuthCredentials !== undefined && { basicAuthCredentials: input.basicAuthCredentials }), - ...(input.buildSpec !== undefined && { buildSpec: input.buildSpec }), - ...(input.description !== undefined && { description: input.description }), - ...(input.displayName !== undefined && { displayName: input.displayName }), - ...(input.enableAutoBuild !== undefined && { enableAutoBuild: input.enableAutoBuild }), - ...(input.enableBasicAuth !== undefined && { enableBasicAuth: input.enableBasicAuth }), - ...(input.enableNotification !== undefined && { enableNotification: input.enableNotification }), - ...(input.enablePerformanceMode !== undefined && { enablePerformanceMode: input.enablePerformanceMode }), - ...(input.enablePullRequestPreview !== undefined && { enablePullRequestPreview: input.enablePullRequestPreview }), - ...(input.environmentVariables !== undefined && { - environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), - }), - ...(input.framework !== undefined && { framework: input.framework }), - ...(input.pullRequestEnvironmentName !== undefined && { - pullRequestEnvironmentName: input.pullRequestEnvironmentName, - }), - ...(input.stage !== undefined && { stage: input.stage }), - ...(input.ttl !== undefined && { ttl: input.ttl }), + ...(input.backendEnvironmentArn !== undefined && + input.backendEnvironmentArn !== null && { backendEnvironmentArn: input.backendEnvironmentArn }), + ...(input.basicAuthCredentials !== undefined && + input.basicAuthCredentials !== null && { basicAuthCredentials: input.basicAuthCredentials }), + ...(input.buildSpec !== undefined && input.buildSpec !== null && { buildSpec: input.buildSpec }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.displayName !== undefined && input.displayName !== null && { displayName: input.displayName }), + ...(input.enableAutoBuild !== undefined && + input.enableAutoBuild !== null && { enableAutoBuild: input.enableAutoBuild }), + ...(input.enableBasicAuth !== undefined && + input.enableBasicAuth !== null && { enableBasicAuth: input.enableBasicAuth }), + ...(input.enableNotification !== undefined && + input.enableNotification !== null && { enableNotification: input.enableNotification }), + ...(input.enablePerformanceMode !== undefined && + input.enablePerformanceMode !== null && { enablePerformanceMode: input.enablePerformanceMode }), + ...(input.enablePullRequestPreview !== undefined && + input.enablePullRequestPreview !== null && { enablePullRequestPreview: input.enablePullRequestPreview }), + ...(input.environmentVariables !== undefined && + input.environmentVariables !== null && { + environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), + }), + ...(input.framework !== undefined && input.framework !== null && { framework: input.framework }), + ...(input.pullRequestEnvironmentName !== undefined && + input.pullRequestEnvironmentName !== null && { pullRequestEnvironmentName: input.pullRequestEnvironmentName }), + ...(input.stage !== undefined && input.stage !== null && { stage: input.stage }), + ...(input.ttl !== undefined && input.ttl !== null && { ttl: input.ttl }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1501,7 +1501,7 @@ export const serializeAws_restJson1UpdateDomainAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apps/{appId}/domains/{domainName}"; if (input.appId !== undefined) { @@ -1524,17 +1524,21 @@ export const serializeAws_restJson1UpdateDomainAssociationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.autoSubDomainCreationPatterns !== undefined && { - autoSubDomainCreationPatterns: serializeAws_restJson1AutoSubDomainCreationPatterns( - input.autoSubDomainCreationPatterns, - context - ), - }), - ...(input.autoSubDomainIAMRole !== undefined && { autoSubDomainIAMRole: input.autoSubDomainIAMRole }), - ...(input.enableAutoSubDomain !== undefined && { enableAutoSubDomain: input.enableAutoSubDomain }), - ...(input.subDomainSettings !== undefined && { - subDomainSettings: serializeAws_restJson1SubDomainSettings(input.subDomainSettings, context), - }), + ...(input.autoSubDomainCreationPatterns !== undefined && + input.autoSubDomainCreationPatterns !== null && { + autoSubDomainCreationPatterns: serializeAws_restJson1AutoSubDomainCreationPatterns( + input.autoSubDomainCreationPatterns, + context + ), + }), + ...(input.autoSubDomainIAMRole !== undefined && + input.autoSubDomainIAMRole !== null && { autoSubDomainIAMRole: input.autoSubDomainIAMRole }), + ...(input.enableAutoSubDomain !== undefined && + input.enableAutoSubDomain !== null && { enableAutoSubDomain: input.enableAutoSubDomain }), + ...(input.subDomainSettings !== undefined && + input.subDomainSettings !== null && { + subDomainSettings: serializeAws_restJson1SubDomainSettings(input.subDomainSettings, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1553,7 +1557,7 @@ export const serializeAws_restJson1UpdateWebhookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/webhooks/{webhookId}"; if (input.webhookId !== undefined) { @@ -1567,8 +1571,8 @@ export const serializeAws_restJson1UpdateWebhookCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.description !== undefined && { description: input.description }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4793,83 +4797,122 @@ const serializeAws_restJson1AutoBranchCreationConfig = ( context: __SerdeContext ): any => { return { - ...(input.basicAuthCredentials !== undefined && { basicAuthCredentials: input.basicAuthCredentials }), - ...(input.buildSpec !== undefined && { buildSpec: input.buildSpec }), - ...(input.enableAutoBuild !== undefined && { enableAutoBuild: input.enableAutoBuild }), - ...(input.enableBasicAuth !== undefined && { enableBasicAuth: input.enableBasicAuth }), - ...(input.enablePerformanceMode !== undefined && { enablePerformanceMode: input.enablePerformanceMode }), - ...(input.enablePullRequestPreview !== undefined && { enablePullRequestPreview: input.enablePullRequestPreview }), - ...(input.environmentVariables !== undefined && { - environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), - }), - ...(input.framework !== undefined && { framework: input.framework }), - ...(input.pullRequestEnvironmentName !== undefined && { - pullRequestEnvironmentName: input.pullRequestEnvironmentName, - }), - ...(input.stage !== undefined && { stage: input.stage }), + ...(input.basicAuthCredentials !== undefined && + input.basicAuthCredentials !== null && { basicAuthCredentials: input.basicAuthCredentials }), + ...(input.buildSpec !== undefined && input.buildSpec !== null && { buildSpec: input.buildSpec }), + ...(input.enableAutoBuild !== undefined && + input.enableAutoBuild !== null && { enableAutoBuild: input.enableAutoBuild }), + ...(input.enableBasicAuth !== undefined && + input.enableBasicAuth !== null && { enableBasicAuth: input.enableBasicAuth }), + ...(input.enablePerformanceMode !== undefined && + input.enablePerformanceMode !== null && { enablePerformanceMode: input.enablePerformanceMode }), + ...(input.enablePullRequestPreview !== undefined && + input.enablePullRequestPreview !== null && { enablePullRequestPreview: input.enablePullRequestPreview }), + ...(input.environmentVariables !== undefined && + input.environmentVariables !== null && { + environmentVariables: serializeAws_restJson1EnvironmentVariables(input.environmentVariables, context), + }), + ...(input.framework !== undefined && input.framework !== null && { framework: input.framework }), + ...(input.pullRequestEnvironmentName !== undefined && + input.pullRequestEnvironmentName !== null && { pullRequestEnvironmentName: input.pullRequestEnvironmentName }), + ...(input.stage !== undefined && input.stage !== null && { stage: input.stage }), }; }; const serializeAws_restJson1AutoBranchCreationPatterns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AutoSubDomainCreationPatterns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1CustomRule = (input: CustomRule, context: __SerdeContext): any => { return { - ...(input.condition !== undefined && { condition: input.condition }), - ...(input.source !== undefined && { source: input.source }), - ...(input.status !== undefined && { status: input.status }), - ...(input.target !== undefined && { target: input.target }), + ...(input.condition !== undefined && input.condition !== null && { condition: input.condition }), + ...(input.source !== undefined && input.source !== null && { source: input.source }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.target !== undefined && input.target !== null && { target: input.target }), }; }; const serializeAws_restJson1CustomRules = (input: CustomRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CustomRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CustomRule(entry, context); + }); }; const serializeAws_restJson1EnvironmentVariables = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1FileMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1SubDomainSetting = (input: SubDomainSetting, context: __SerdeContext): any => { return { - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.prefix !== undefined && { prefix: input.prefix }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }), }; }; const serializeAws_restJson1SubDomainSettings = (input: SubDomainSetting[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SubDomainSetting(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SubDomainSetting(entry, context); + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1App = (output: any, context: __SerdeContext): App => { @@ -4943,7 +4986,14 @@ const deserializeAws_restJson1App = (output: any, context: __SerdeContext): App }; const deserializeAws_restJson1Apps = (output: any, context: __SerdeContext): App[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1App(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1App(entry, context); + }); }; const deserializeAws_restJson1Artifact = (output: any, context: __SerdeContext): Artifact => { @@ -4955,11 +5005,25 @@ const deserializeAws_restJson1Artifact = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Artifacts = (output: any, context: __SerdeContext): Artifact[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Artifact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Artifact(entry, context); + }); }; const deserializeAws_restJson1AssociatedResources = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AutoBranchCreationConfig = ( @@ -4998,11 +5062,25 @@ const deserializeAws_restJson1AutoBranchCreationConfig = ( }; const deserializeAws_restJson1AutoBranchCreationPatterns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AutoSubDomainCreationPatterns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1BackendEnvironment = (output: any, context: __SerdeContext): BackendEnvironment => { @@ -5030,7 +5108,14 @@ const deserializeAws_restJson1BackendEnvironment = (output: any, context: __Serd }; const deserializeAws_restJson1BackendEnvironments = (output: any, context: __SerdeContext): BackendEnvironment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackendEnvironment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackendEnvironment(entry, context); + }); }; const deserializeAws_restJson1Branch = (output: any, context: __SerdeContext): Branch => { @@ -5110,11 +5195,25 @@ const deserializeAws_restJson1Branch = (output: any, context: __SerdeContext): B }; const deserializeAws_restJson1Branches = (output: any, context: __SerdeContext): Branch[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Branch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Branch(entry, context); + }); }; const deserializeAws_restJson1CustomDomains = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1CustomRule = (output: any, context: __SerdeContext): CustomRule => { @@ -5127,7 +5226,14 @@ const deserializeAws_restJson1CustomRule = (output: any, context: __SerdeContext }; const deserializeAws_restJson1CustomRules = (output: any, context: __SerdeContext): CustomRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CustomRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CustomRule(entry, context); + }); }; const deserializeAws_restJson1DomainAssociation = (output: any, context: __SerdeContext): DomainAssociation => { @@ -5163,30 +5269,41 @@ const deserializeAws_restJson1DomainAssociation = (output: any, context: __Serde }; const deserializeAws_restJson1DomainAssociations = (output: any, context: __SerdeContext): DomainAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainAssociation(entry, context); + }); }; const deserializeAws_restJson1EnvironmentVariables = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1FileUploadUrls = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Job = (output: any, context: __SerdeContext): Job => { @@ -5203,7 +5320,14 @@ const deserializeAws_restJson1Job = (output: any, context: __SerdeContext): Job }; const deserializeAws_restJson1JobSummaries = (output: any, context: __SerdeContext): JobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobSummary(entry, context); + }); }; const deserializeAws_restJson1JobSummary = (output: any, context: __SerdeContext): JobSummary => { @@ -5241,13 +5365,15 @@ const deserializeAws_restJson1ProductionBranch = (output: any, context: __SerdeC }; const deserializeAws_restJson1Screenshots = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Step = (output: any, context: __SerdeContext): Step => { @@ -5276,7 +5402,14 @@ const deserializeAws_restJson1Step = (output: any, context: __SerdeContext): Ste }; const deserializeAws_restJson1Steps = (output: any, context: __SerdeContext): Step[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Step(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Step(entry, context); + }); }; const deserializeAws_restJson1SubDomain = (output: any, context: __SerdeContext): SubDomain => { @@ -5291,7 +5424,14 @@ const deserializeAws_restJson1SubDomain = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1SubDomains = (output: any, context: __SerdeContext): SubDomain[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SubDomain(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SubDomain(entry, context); + }); }; const deserializeAws_restJson1SubDomainSetting = (output: any, context: __SerdeContext): SubDomainSetting => { @@ -5302,13 +5442,15 @@ const deserializeAws_restJson1SubDomainSetting = (output: any, context: __SerdeC }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Webhook = (output: any, context: __SerdeContext): Webhook => { @@ -5330,7 +5472,14 @@ const deserializeAws_restJson1Webhook = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Webhooks = (output: any, context: __SerdeContext): Webhook[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Webhook(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Webhook(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -5353,6 +5502,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-amplifybackend/protocols/Aws_restJson1.ts b/clients/client-amplifybackend/protocols/Aws_restJson1.ts index 0a9fd55db711..5068745cfcc5 100644 --- a/clients/client-amplifybackend/protocols/Aws_restJson1.ts +++ b/clients/client-amplifybackend/protocols/Aws_restJson1.ts @@ -90,7 +90,7 @@ export const serializeAws_restJson1CloneBackendCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/environments/{BackendEnvironmentName}/clone"; if (input.AppId !== undefined) { @@ -113,7 +113,8 @@ export const serializeAws_restJson1CloneBackendCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TargetEnvironmentName !== undefined && { targetEnvironmentName: input.TargetEnvironmentName }), + ...(input.TargetEnvironmentName !== undefined && + input.TargetEnvironmentName !== null && { targetEnvironmentName: input.TargetEnvironmentName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -132,18 +133,20 @@ export const serializeAws_restJson1CreateBackendCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend"; let body: any; body = JSON.stringify({ - ...(input.AppId !== undefined && { appId: input.AppId }), - ...(input.AppName !== undefined && { appName: input.AppName }), - ...(input.BackendEnvironmentName !== undefined && { backendEnvironmentName: input.BackendEnvironmentName }), - ...(input.ResourceConfig !== undefined && { - resourceConfig: serializeAws_restJson1ResourceConfig(input.ResourceConfig, context), - }), - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.AppId !== undefined && input.AppId !== null && { appId: input.AppId }), + ...(input.AppName !== undefined && input.AppName !== null && { appName: input.AppName }), + ...(input.BackendEnvironmentName !== undefined && + input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + resourceConfig: serializeAws_restJson1ResourceConfig(input.ResourceConfig, context), + }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -162,7 +165,7 @@ export const serializeAws_restJson1CreateBackendAPICommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/api"; if (input.AppId !== undefined) { @@ -176,11 +179,13 @@ export const serializeAws_restJson1CreateBackendAPICommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BackendEnvironmentName !== undefined && { backendEnvironmentName: input.BackendEnvironmentName }), - ...(input.ResourceConfig !== undefined && { - resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context), - }), - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.BackendEnvironmentName !== undefined && + input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context), + }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -199,7 +204,7 @@ export const serializeAws_restJson1CreateBackendAuthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/auth"; if (input.AppId !== undefined) { @@ -213,11 +218,13 @@ export const serializeAws_restJson1CreateBackendAuthCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BackendEnvironmentName !== undefined && { backendEnvironmentName: input.BackendEnvironmentName }), - ...(input.ResourceConfig !== undefined && { - resourceConfig: serializeAws_restJson1CreateBackendAuthResourceConfig(input.ResourceConfig, context), - }), - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.BackendEnvironmentName !== undefined && + input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + resourceConfig: serializeAws_restJson1CreateBackendAuthResourceConfig(input.ResourceConfig, context), + }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -236,7 +243,7 @@ export const serializeAws_restJson1CreateBackendConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/config"; if (input.AppId !== undefined) { @@ -250,7 +257,8 @@ export const serializeAws_restJson1CreateBackendConfigCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BackendManagerAppId !== undefined && { backendManagerAppId: input.BackendManagerAppId }), + ...(input.BackendManagerAppId !== undefined && + input.BackendManagerAppId !== null && { backendManagerAppId: input.BackendManagerAppId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -268,9 +276,7 @@ export const serializeAws_restJson1CreateTokenCommand = async ( input: CreateTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backend/{AppId}/challenge"; if (input.AppId !== undefined) { const labelValue: string = input.AppId; @@ -298,9 +304,7 @@ export const serializeAws_restJson1DeleteBackendCommand = async ( input: DeleteBackendCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backend/{AppId}/environments/{BackendEnvironmentName}/remove"; if (input.AppId !== undefined) { const labelValue: string = input.AppId; @@ -338,7 +342,7 @@ export const serializeAws_restJson1DeleteBackendAPICommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/api/{BackendEnvironmentName}/remove"; if (input.AppId !== undefined) { @@ -361,10 +365,11 @@ export const serializeAws_restJson1DeleteBackendAPICommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ResourceConfig !== undefined && { - resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context), - }), - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context), + }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -383,7 +388,7 @@ export const serializeAws_restJson1DeleteBackendAuthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/auth/{BackendEnvironmentName}/remove"; if (input.AppId !== undefined) { @@ -406,7 +411,7 @@ export const serializeAws_restJson1DeleteBackendAuthCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -424,9 +429,7 @@ export const serializeAws_restJson1DeleteTokenCommand = async ( input: DeleteTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backend/{AppId}/challenge/{SessionId}/remove"; if (input.AppId !== undefined) { const labelValue: string = input.AppId; @@ -464,7 +467,7 @@ export const serializeAws_restJson1GenerateBackendAPIModelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/api/{BackendEnvironmentName}/generateModels"; if (input.AppId !== undefined) { @@ -487,7 +490,7 @@ export const serializeAws_restJson1GenerateBackendAPIModelsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -506,7 +509,7 @@ export const serializeAws_restJson1GetBackendCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/details"; if (input.AppId !== undefined) { @@ -520,7 +523,8 @@ export const serializeAws_restJson1GetBackendCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BackendEnvironmentName !== undefined && { backendEnvironmentName: input.BackendEnvironmentName }), + ...(input.BackendEnvironmentName !== undefined && + input.BackendEnvironmentName !== null && { backendEnvironmentName: input.BackendEnvironmentName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -539,7 +543,7 @@ export const serializeAws_restJson1GetBackendAPICommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/api/{BackendEnvironmentName}/details"; if (input.AppId !== undefined) { @@ -562,10 +566,11 @@ export const serializeAws_restJson1GetBackendAPICommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ResourceConfig !== undefined && { - resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context), - }), - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context), + }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -584,7 +589,7 @@ export const serializeAws_restJson1GetBackendAPIModelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/api/{BackendEnvironmentName}/getModels"; if (input.AppId !== undefined) { @@ -607,7 +612,7 @@ export const serializeAws_restJson1GetBackendAPIModelsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -626,7 +631,7 @@ export const serializeAws_restJson1GetBackendAuthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/auth/{BackendEnvironmentName}/details"; if (input.AppId !== undefined) { @@ -649,7 +654,7 @@ export const serializeAws_restJson1GetBackendAuthCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -667,9 +672,7 @@ export const serializeAws_restJson1GetBackendJobCommand = async ( input: GetBackendJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}"; if (input.AppId !== undefined) { const labelValue: string = input.AppId; @@ -715,9 +718,7 @@ export const serializeAws_restJson1GetTokenCommand = async ( input: GetTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backend/{AppId}/challenge/{SessionId}"; if (input.AppId !== undefined) { const labelValue: string = input.AppId; @@ -755,7 +756,7 @@ export const serializeAws_restJson1ListBackendJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/job/{BackendEnvironmentName}"; if (input.AppId !== undefined) { @@ -778,11 +779,11 @@ export const serializeAws_restJson1ListBackendJobsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.JobId !== undefined && { jobId: input.JobId }), - ...(input.MaxResults !== undefined && { maxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { nextToken: input.NextToken }), - ...(input.Operation !== undefined && { operation: input.Operation }), - ...(input.Status !== undefined && { status: input.Status }), + ...(input.JobId !== undefined && input.JobId !== null && { jobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { maxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { nextToken: input.NextToken }), + ...(input.Operation !== undefined && input.Operation !== null && { operation: input.Operation }), + ...(input.Status !== undefined && input.Status !== null && { status: input.Status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -801,7 +802,7 @@ export const serializeAws_restJson1RemoveAllBackendsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/remove"; if (input.AppId !== undefined) { @@ -815,7 +816,8 @@ export const serializeAws_restJson1RemoveAllBackendsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CleanAmplifyApp !== undefined && { cleanAmplifyApp: input.CleanAmplifyApp }), + ...(input.CleanAmplifyApp !== undefined && + input.CleanAmplifyApp !== null && { cleanAmplifyApp: input.CleanAmplifyApp }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -833,9 +835,7 @@ export const serializeAws_restJson1RemoveBackendConfigCommand = async ( input: RemoveBackendConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backend/{AppId}/config/remove"; if (input.AppId !== undefined) { const labelValue: string = input.AppId; @@ -864,7 +864,7 @@ export const serializeAws_restJson1UpdateBackendAPICommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/api/{BackendEnvironmentName}"; if (input.AppId !== undefined) { @@ -887,10 +887,11 @@ export const serializeAws_restJson1UpdateBackendAPICommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ResourceConfig !== undefined && { - resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context), - }), - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + resourceConfig: serializeAws_restJson1BackendAPIResourceConfig(input.ResourceConfig, context), + }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -909,7 +910,7 @@ export const serializeAws_restJson1UpdateBackendAuthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/auth/{BackendEnvironmentName}"; if (input.AppId !== undefined) { @@ -932,10 +933,11 @@ export const serializeAws_restJson1UpdateBackendAuthCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ResourceConfig !== undefined && { - resourceConfig: serializeAws_restJson1UpdateBackendAuthResourceConfig(input.ResourceConfig, context), - }), - ...(input.ResourceName !== undefined && { resourceName: input.ResourceName }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + resourceConfig: serializeAws_restJson1UpdateBackendAuthResourceConfig(input.ResourceConfig, context), + }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { resourceName: input.ResourceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -954,7 +956,7 @@ export const serializeAws_restJson1UpdateBackendConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/config/update"; if (input.AppId !== undefined) { @@ -968,9 +970,10 @@ export const serializeAws_restJson1UpdateBackendConfigCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.LoginAuthConfig !== undefined && { - loginAuthConfig: serializeAws_restJson1LoginAuthConfigReqObj(input.LoginAuthConfig, context), - }), + ...(input.LoginAuthConfig !== undefined && + input.LoginAuthConfig !== null && { + loginAuthConfig: serializeAws_restJson1LoginAuthConfigReqObj(input.LoginAuthConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -989,7 +992,7 @@ export const serializeAws_restJson1UpdateBackendJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}"; if (input.AppId !== undefined) { @@ -1021,8 +1024,8 @@ export const serializeAws_restJson1UpdateBackendJobCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Operation !== undefined && { operation: input.Operation }), - ...(input.Status !== undefined && { status: input.Status }), + ...(input.Operation !== undefined && input.Operation !== null && { operation: input.Operation }), + ...(input.Status !== undefined && input.Status !== null && { status: input.Status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3393,23 +3396,29 @@ const serializeAws_restJson1BackendAPIAppSyncAuthSettings = ( context: __SerdeContext ): any => { return { - ...(input.CognitoUserPoolId !== undefined && { cognitoUserPoolId: input.CognitoUserPoolId }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.ExpirationTime !== undefined && { expirationTime: input.ExpirationTime }), - ...(input.OpenIDAuthTTL !== undefined && { openIDAuthTTL: input.OpenIDAuthTTL }), - ...(input.OpenIDClientId !== undefined && { openIDClientId: input.OpenIDClientId }), - ...(input.OpenIDIatTTL !== undefined && { openIDIatTTL: input.OpenIDIatTTL }), - ...(input.OpenIDIssueURL !== undefined && { openIDIssueURL: input.OpenIDIssueURL }), - ...(input.OpenIDProviderName !== undefined && { openIDProviderName: input.OpenIDProviderName }), + ...(input.CognitoUserPoolId !== undefined && + input.CognitoUserPoolId !== null && { cognitoUserPoolId: input.CognitoUserPoolId }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.ExpirationTime !== undefined && + input.ExpirationTime !== null && { expirationTime: input.ExpirationTime }), + ...(input.OpenIDAuthTTL !== undefined && input.OpenIDAuthTTL !== null && { openIDAuthTTL: input.OpenIDAuthTTL }), + ...(input.OpenIDClientId !== undefined && + input.OpenIDClientId !== null && { openIDClientId: input.OpenIDClientId }), + ...(input.OpenIDIatTTL !== undefined && input.OpenIDIatTTL !== null && { openIDIatTTL: input.OpenIDIatTTL }), + ...(input.OpenIDIssueURL !== undefined && + input.OpenIDIssueURL !== null && { openIDIssueURL: input.OpenIDIssueURL }), + ...(input.OpenIDProviderName !== undefined && + input.OpenIDProviderName !== null && { openIDProviderName: input.OpenIDProviderName }), }; }; const serializeAws_restJson1BackendAPIAuthType = (input: BackendAPIAuthType, context: __SerdeContext): any => { return { - ...(input.Mode !== undefined && { mode: input.Mode }), - ...(input.Settings !== undefined && { - settings: serializeAws_restJson1BackendAPIAppSyncAuthSettings(input.Settings, context), - }), + ...(input.Mode !== undefined && input.Mode !== null && { mode: input.Mode }), + ...(input.Settings !== undefined && + input.Settings !== null && { + settings: serializeAws_restJson1BackendAPIAppSyncAuthSettings(input.Settings, context), + }), }; }; @@ -3418,7 +3427,8 @@ const serializeAws_restJson1BackendAPIConflictResolution = ( context: __SerdeContext ): any => { return { - ...(input.ResolutionStrategy !== undefined && { resolutionStrategy: input.ResolutionStrategy }), + ...(input.ResolutionStrategy !== undefined && + input.ResolutionStrategy !== null && { resolutionStrategy: input.ResolutionStrategy }), }; }; @@ -3427,18 +3437,22 @@ const serializeAws_restJson1BackendAPIResourceConfig = ( context: __SerdeContext ): any => { return { - ...(input.AdditionalAuthTypes !== undefined && { - additionalAuthTypes: serializeAws_restJson1ListOfBackendAPIAuthType(input.AdditionalAuthTypes, context), - }), - ...(input.ApiName !== undefined && { apiName: input.ApiName }), - ...(input.ConflictResolution !== undefined && { - conflictResolution: serializeAws_restJson1BackendAPIConflictResolution(input.ConflictResolution, context), - }), - ...(input.DefaultAuthType !== undefined && { - defaultAuthType: serializeAws_restJson1BackendAPIAuthType(input.DefaultAuthType, context), - }), - ...(input.Service !== undefined && { service: input.Service }), - ...(input.TransformSchema !== undefined && { transformSchema: input.TransformSchema }), + ...(input.AdditionalAuthTypes !== undefined && + input.AdditionalAuthTypes !== null && { + additionalAuthTypes: serializeAws_restJson1ListOfBackendAPIAuthType(input.AdditionalAuthTypes, context), + }), + ...(input.ApiName !== undefined && input.ApiName !== null && { apiName: input.ApiName }), + ...(input.ConflictResolution !== undefined && + input.ConflictResolution !== null && { + conflictResolution: serializeAws_restJson1BackendAPIConflictResolution(input.ConflictResolution, context), + }), + ...(input.DefaultAuthType !== undefined && + input.DefaultAuthType !== null && { + defaultAuthType: serializeAws_restJson1BackendAPIAuthType(input.DefaultAuthType, context), + }), + ...(input.Service !== undefined && input.Service !== null && { service: input.Service }), + ...(input.TransformSchema !== undefined && + input.TransformSchema !== null && { transformSchema: input.TransformSchema }), }; }; @@ -3447,8 +3461,8 @@ const serializeAws_restJson1BackendAuthSocialProviderConfig = ( context: __SerdeContext ): any => { return { - ...(input.ClientId !== undefined && { client_id: input.ClientId }), - ...(input.ClientSecret !== undefined && { client_secret: input.ClientSecret }), + ...(input.ClientId !== undefined && input.ClientId !== null && { client_id: input.ClientId }), + ...(input.ClientSecret !== undefined && input.ClientSecret !== null && { client_secret: input.ClientSecret }), }; }; @@ -3457,13 +3471,14 @@ const serializeAws_restJson1CreateBackendAuthForgotPasswordConfig = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryMethod !== undefined && { deliveryMethod: input.DeliveryMethod }), - ...(input.EmailSettings !== undefined && { - emailSettings: serializeAws_restJson1EmailSettings(input.EmailSettings, context), - }), - ...(input.SmsSettings !== undefined && { - smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context), - }), + ...(input.DeliveryMethod !== undefined && + input.DeliveryMethod !== null && { deliveryMethod: input.DeliveryMethod }), + ...(input.EmailSettings !== undefined && + input.EmailSettings !== null && { + emailSettings: serializeAws_restJson1EmailSettings(input.EmailSettings, context), + }), + ...(input.SmsSettings !== undefined && + input.SmsSettings !== null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }), }; }; @@ -3472,8 +3487,10 @@ const serializeAws_restJson1CreateBackendAuthIdentityPoolConfig = ( context: __SerdeContext ): any => { return { - ...(input.IdentityPoolName !== undefined && { identityPoolName: input.IdentityPoolName }), - ...(input.UnauthenticatedLogin !== undefined && { unauthenticatedLogin: input.UnauthenticatedLogin }), + ...(input.IdentityPoolName !== undefined && + input.IdentityPoolName !== null && { identityPoolName: input.IdentityPoolName }), + ...(input.UnauthenticatedLogin !== undefined && + input.UnauthenticatedLogin !== null && { unauthenticatedLogin: input.UnauthenticatedLogin }), }; }; @@ -3482,8 +3499,9 @@ const serializeAws_restJson1CreateBackendAuthMFAConfig = ( context: __SerdeContext ): any => { return { - ...(input.MFAMode !== undefined && { MFAMode: input.MFAMode }), - ...(input.Settings !== undefined && { settings: serializeAws_restJson1Settings(input.Settings, context) }), + ...(input.MFAMode !== undefined && input.MFAMode !== null && { MFAMode: input.MFAMode }), + ...(input.Settings !== undefined && + input.Settings !== null && { settings: serializeAws_restJson1Settings(input.Settings, context) }), }; }; @@ -3492,20 +3510,25 @@ const serializeAws_restJson1CreateBackendAuthOAuthConfig = ( context: __SerdeContext ): any => { return { - ...(input.DomainPrefix !== undefined && { domainPrefix: input.DomainPrefix }), - ...(input.OAuthGrantType !== undefined && { oAuthGrantType: input.OAuthGrantType }), - ...(input.OAuthScopes !== undefined && { - oAuthScopes: serializeAws_restJson1ListOfOAuthScopesElement(input.OAuthScopes, context), - }), - ...(input.RedirectSignInURIs !== undefined && { - redirectSignInURIs: serializeAws_restJson1ListOf__string(input.RedirectSignInURIs, context), - }), - ...(input.RedirectSignOutURIs !== undefined && { - redirectSignOutURIs: serializeAws_restJson1ListOf__string(input.RedirectSignOutURIs, context), - }), - ...(input.SocialProviderSettings !== undefined && { - socialProviderSettings: serializeAws_restJson1SocialProviderSettings(input.SocialProviderSettings, context), - }), + ...(input.DomainPrefix !== undefined && input.DomainPrefix !== null && { domainPrefix: input.DomainPrefix }), + ...(input.OAuthGrantType !== undefined && + input.OAuthGrantType !== null && { oAuthGrantType: input.OAuthGrantType }), + ...(input.OAuthScopes !== undefined && + input.OAuthScopes !== null && { + oAuthScopes: serializeAws_restJson1ListOfOAuthScopesElement(input.OAuthScopes, context), + }), + ...(input.RedirectSignInURIs !== undefined && + input.RedirectSignInURIs !== null && { + redirectSignInURIs: serializeAws_restJson1ListOf__string(input.RedirectSignInURIs, context), + }), + ...(input.RedirectSignOutURIs !== undefined && + input.RedirectSignOutURIs !== null && { + redirectSignOutURIs: serializeAws_restJson1ListOf__string(input.RedirectSignOutURIs, context), + }), + ...(input.SocialProviderSettings !== undefined && + input.SocialProviderSettings !== null && { + socialProviderSettings: serializeAws_restJson1SocialProviderSettings(input.SocialProviderSettings, context), + }), }; }; @@ -3514,13 +3537,14 @@ const serializeAws_restJson1CreateBackendAuthPasswordPolicyConfig = ( context: __SerdeContext ): any => { return { - ...(input.AdditionalConstraints !== undefined && { - additionalConstraints: serializeAws_restJson1ListOfAdditionalConstraintsElement( - input.AdditionalConstraints, - context - ), - }), - ...(input.MinimumLength !== undefined && { minimumLength: input.MinimumLength }), + ...(input.AdditionalConstraints !== undefined && + input.AdditionalConstraints !== null && { + additionalConstraints: serializeAws_restJson1ListOfAdditionalConstraintsElement( + input.AdditionalConstraints, + context + ), + }), + ...(input.MinimumLength !== undefined && input.MinimumLength !== null && { minimumLength: input.MinimumLength }), }; }; @@ -3529,17 +3553,19 @@ const serializeAws_restJson1CreateBackendAuthResourceConfig = ( context: __SerdeContext ): any => { return { - ...(input.AuthResources !== undefined && { authResources: input.AuthResources }), - ...(input.IdentityPoolConfigs !== undefined && { - identityPoolConfigs: serializeAws_restJson1CreateBackendAuthIdentityPoolConfig( - input.IdentityPoolConfigs, - context - ), - }), - ...(input.Service !== undefined && { service: input.Service }), - ...(input.UserPoolConfigs !== undefined && { - userPoolConfigs: serializeAws_restJson1CreateBackendAuthUserPoolConfig(input.UserPoolConfigs, context), - }), + ...(input.AuthResources !== undefined && input.AuthResources !== null && { authResources: input.AuthResources }), + ...(input.IdentityPoolConfigs !== undefined && + input.IdentityPoolConfigs !== null && { + identityPoolConfigs: serializeAws_restJson1CreateBackendAuthIdentityPoolConfig( + input.IdentityPoolConfigs, + context + ), + }), + ...(input.Service !== undefined && input.Service !== null && { service: input.Service }), + ...(input.UserPoolConfigs !== undefined && + input.UserPoolConfigs !== null && { + userPoolConfigs: serializeAws_restJson1CreateBackendAuthUserPoolConfig(input.UserPoolConfigs, context), + }), }; }; @@ -3548,78 +3574,125 @@ const serializeAws_restJson1CreateBackendAuthUserPoolConfig = ( context: __SerdeContext ): any => { return { - ...(input.ForgotPassword !== undefined && { - forgotPassword: serializeAws_restJson1CreateBackendAuthForgotPasswordConfig(input.ForgotPassword, context), - }), - ...(input.Mfa !== undefined && { mfa: serializeAws_restJson1CreateBackendAuthMFAConfig(input.Mfa, context) }), - ...(input.OAuth !== undefined && { - oAuth: serializeAws_restJson1CreateBackendAuthOAuthConfig(input.OAuth, context), - }), - ...(input.PasswordPolicy !== undefined && { - passwordPolicy: serializeAws_restJson1CreateBackendAuthPasswordPolicyConfig(input.PasswordPolicy, context), - }), - ...(input.RequiredSignUpAttributes !== undefined && { - requiredSignUpAttributes: serializeAws_restJson1ListOfRequiredSignUpAttributesElement( - input.RequiredSignUpAttributes, - context - ), - }), - ...(input.SignInMethod !== undefined && { signInMethod: input.SignInMethod }), - ...(input.UserPoolName !== undefined && { userPoolName: input.UserPoolName }), + ...(input.ForgotPassword !== undefined && + input.ForgotPassword !== null && { + forgotPassword: serializeAws_restJson1CreateBackendAuthForgotPasswordConfig(input.ForgotPassword, context), + }), + ...(input.Mfa !== undefined && + input.Mfa !== null && { mfa: serializeAws_restJson1CreateBackendAuthMFAConfig(input.Mfa, context) }), + ...(input.OAuth !== undefined && + input.OAuth !== null && { oAuth: serializeAws_restJson1CreateBackendAuthOAuthConfig(input.OAuth, context) }), + ...(input.PasswordPolicy !== undefined && + input.PasswordPolicy !== null && { + passwordPolicy: serializeAws_restJson1CreateBackendAuthPasswordPolicyConfig(input.PasswordPolicy, context), + }), + ...(input.RequiredSignUpAttributes !== undefined && + input.RequiredSignUpAttributes !== null && { + requiredSignUpAttributes: serializeAws_restJson1ListOfRequiredSignUpAttributesElement( + input.RequiredSignUpAttributes, + context + ), + }), + ...(input.SignInMethod !== undefined && input.SignInMethod !== null && { signInMethod: input.SignInMethod }), + ...(input.UserPoolName !== undefined && input.UserPoolName !== null && { userPoolName: input.UserPoolName }), }; }; const serializeAws_restJson1EmailSettings = (input: EmailSettings, context: __SerdeContext): any => { return { - ...(input.EmailMessage !== undefined && { emailMessage: input.EmailMessage }), - ...(input.EmailSubject !== undefined && { emailSubject: input.EmailSubject }), + ...(input.EmailMessage !== undefined && input.EmailMessage !== null && { emailMessage: input.EmailMessage }), + ...(input.EmailSubject !== undefined && input.EmailSubject !== null && { emailSubject: input.EmailSubject }), }; }; const serializeAws_restJson1ListOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListOfAdditionalConstraintsElement = ( input: (AdditionalConstraintsElement | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListOfBackendAPIAuthType = (input: BackendAPIAuthType[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1BackendAPIAuthType(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1BackendAPIAuthType(entry, context); + }); }; const serializeAws_restJson1ListOfMfaTypesElement = ( input: (MfaTypesElement | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListOfOAuthScopesElement = ( input: (OAuthScopesElement | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListOfRequiredSignUpAttributesElement = ( input: (RequiredSignUpAttributesElement | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1LoginAuthConfigReqObj = (input: LoginAuthConfigReqObj, context: __SerdeContext): any => { return { - ...(input.AwsCognitoIdentityPoolId !== undefined && { - aws_cognito_identity_pool_id: input.AwsCognitoIdentityPoolId, - }), - ...(input.AwsCognitoRegion !== undefined && { aws_cognito_region: input.AwsCognitoRegion }), - ...(input.AwsUserPoolsId !== undefined && { aws_user_pools_id: input.AwsUserPoolsId }), - ...(input.AwsUserPoolsWebClientId !== undefined && { aws_user_pools_web_client_id: input.AwsUserPoolsWebClientId }), + ...(input.AwsCognitoIdentityPoolId !== undefined && + input.AwsCognitoIdentityPoolId !== null && { aws_cognito_identity_pool_id: input.AwsCognitoIdentityPoolId }), + ...(input.AwsCognitoRegion !== undefined && + input.AwsCognitoRegion !== null && { aws_cognito_region: input.AwsCognitoRegion }), + ...(input.AwsUserPoolsId !== undefined && + input.AwsUserPoolsId !== null && { aws_user_pools_id: input.AwsUserPoolsId }), + ...(input.AwsUserPoolsWebClientId !== undefined && + input.AwsUserPoolsWebClientId !== null && { aws_user_pools_web_client_id: input.AwsUserPoolsWebClientId }), }; }; @@ -3629,30 +3702,32 @@ const serializeAws_restJson1ResourceConfig = (input: ResourceConfig, context: __ const serializeAws_restJson1Settings = (input: Settings, context: __SerdeContext): any => { return { - ...(input.MfaTypes !== undefined && { - mfaTypes: serializeAws_restJson1ListOfMfaTypesElement(input.MfaTypes, context), - }), - ...(input.SmsMessage !== undefined && { smsMessage: input.SmsMessage }), + ...(input.MfaTypes !== undefined && + input.MfaTypes !== null && { mfaTypes: serializeAws_restJson1ListOfMfaTypesElement(input.MfaTypes, context) }), + ...(input.SmsMessage !== undefined && input.SmsMessage !== null && { smsMessage: input.SmsMessage }), }; }; const serializeAws_restJson1SmsSettings = (input: SmsSettings, context: __SerdeContext): any => { return { - ...(input.SmsMessage !== undefined && { smsMessage: input.SmsMessage }), + ...(input.SmsMessage !== undefined && input.SmsMessage !== null && { smsMessage: input.SmsMessage }), }; }; const serializeAws_restJson1SocialProviderSettings = (input: SocialProviderSettings, context: __SerdeContext): any => { return { - ...(input.Facebook !== undefined && { - Facebook: serializeAws_restJson1BackendAuthSocialProviderConfig(input.Facebook, context), - }), - ...(input.Google !== undefined && { - Google: serializeAws_restJson1BackendAuthSocialProviderConfig(input.Google, context), - }), - ...(input.LoginWithAmazon !== undefined && { - LoginWithAmazon: serializeAws_restJson1BackendAuthSocialProviderConfig(input.LoginWithAmazon, context), - }), + ...(input.Facebook !== undefined && + input.Facebook !== null && { + Facebook: serializeAws_restJson1BackendAuthSocialProviderConfig(input.Facebook, context), + }), + ...(input.Google !== undefined && + input.Google !== null && { + Google: serializeAws_restJson1BackendAuthSocialProviderConfig(input.Google, context), + }), + ...(input.LoginWithAmazon !== undefined && + input.LoginWithAmazon !== null && { + LoginWithAmazon: serializeAws_restJson1BackendAuthSocialProviderConfig(input.LoginWithAmazon, context), + }), }; }; @@ -3661,13 +3736,14 @@ const serializeAws_restJson1UpdateBackendAuthForgotPasswordConfig = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryMethod !== undefined && { deliveryMethod: input.DeliveryMethod }), - ...(input.EmailSettings !== undefined && { - emailSettings: serializeAws_restJson1EmailSettings(input.EmailSettings, context), - }), - ...(input.SmsSettings !== undefined && { - smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context), - }), + ...(input.DeliveryMethod !== undefined && + input.DeliveryMethod !== null && { deliveryMethod: input.DeliveryMethod }), + ...(input.EmailSettings !== undefined && + input.EmailSettings !== null && { + emailSettings: serializeAws_restJson1EmailSettings(input.EmailSettings, context), + }), + ...(input.SmsSettings !== undefined && + input.SmsSettings !== null && { smsSettings: serializeAws_restJson1SmsSettings(input.SmsSettings, context) }), }; }; @@ -3676,7 +3752,8 @@ const serializeAws_restJson1UpdateBackendAuthIdentityPoolConfig = ( context: __SerdeContext ): any => { return { - ...(input.UnauthenticatedLogin !== undefined && { unauthenticatedLogin: input.UnauthenticatedLogin }), + ...(input.UnauthenticatedLogin !== undefined && + input.UnauthenticatedLogin !== null && { unauthenticatedLogin: input.UnauthenticatedLogin }), }; }; @@ -3685,8 +3762,9 @@ const serializeAws_restJson1UpdateBackendAuthMFAConfig = ( context: __SerdeContext ): any => { return { - ...(input.MFAMode !== undefined && { MFAMode: input.MFAMode }), - ...(input.Settings !== undefined && { settings: serializeAws_restJson1Settings(input.Settings, context) }), + ...(input.MFAMode !== undefined && input.MFAMode !== null && { MFAMode: input.MFAMode }), + ...(input.Settings !== undefined && + input.Settings !== null && { settings: serializeAws_restJson1Settings(input.Settings, context) }), }; }; @@ -3695,20 +3773,25 @@ const serializeAws_restJson1UpdateBackendAuthOAuthConfig = ( context: __SerdeContext ): any => { return { - ...(input.DomainPrefix !== undefined && { domainPrefix: input.DomainPrefix }), - ...(input.OAuthGrantType !== undefined && { oAuthGrantType: input.OAuthGrantType }), - ...(input.OAuthScopes !== undefined && { - oAuthScopes: serializeAws_restJson1ListOfOAuthScopesElement(input.OAuthScopes, context), - }), - ...(input.RedirectSignInURIs !== undefined && { - redirectSignInURIs: serializeAws_restJson1ListOf__string(input.RedirectSignInURIs, context), - }), - ...(input.RedirectSignOutURIs !== undefined && { - redirectSignOutURIs: serializeAws_restJson1ListOf__string(input.RedirectSignOutURIs, context), - }), - ...(input.SocialProviderSettings !== undefined && { - socialProviderSettings: serializeAws_restJson1SocialProviderSettings(input.SocialProviderSettings, context), - }), + ...(input.DomainPrefix !== undefined && input.DomainPrefix !== null && { domainPrefix: input.DomainPrefix }), + ...(input.OAuthGrantType !== undefined && + input.OAuthGrantType !== null && { oAuthGrantType: input.OAuthGrantType }), + ...(input.OAuthScopes !== undefined && + input.OAuthScopes !== null && { + oAuthScopes: serializeAws_restJson1ListOfOAuthScopesElement(input.OAuthScopes, context), + }), + ...(input.RedirectSignInURIs !== undefined && + input.RedirectSignInURIs !== null && { + redirectSignInURIs: serializeAws_restJson1ListOf__string(input.RedirectSignInURIs, context), + }), + ...(input.RedirectSignOutURIs !== undefined && + input.RedirectSignOutURIs !== null && { + redirectSignOutURIs: serializeAws_restJson1ListOf__string(input.RedirectSignOutURIs, context), + }), + ...(input.SocialProviderSettings !== undefined && + input.SocialProviderSettings !== null && { + socialProviderSettings: serializeAws_restJson1SocialProviderSettings(input.SocialProviderSettings, context), + }), }; }; @@ -3717,13 +3800,14 @@ const serializeAws_restJson1UpdateBackendAuthPasswordPolicyConfig = ( context: __SerdeContext ): any => { return { - ...(input.AdditionalConstraints !== undefined && { - additionalConstraints: serializeAws_restJson1ListOfAdditionalConstraintsElement( - input.AdditionalConstraints, - context - ), - }), - ...(input.MinimumLength !== undefined && { minimumLength: input.MinimumLength }), + ...(input.AdditionalConstraints !== undefined && + input.AdditionalConstraints !== null && { + additionalConstraints: serializeAws_restJson1ListOfAdditionalConstraintsElement( + input.AdditionalConstraints, + context + ), + }), + ...(input.MinimumLength !== undefined && input.MinimumLength !== null && { minimumLength: input.MinimumLength }), }; }; @@ -3732,17 +3816,19 @@ const serializeAws_restJson1UpdateBackendAuthResourceConfig = ( context: __SerdeContext ): any => { return { - ...(input.AuthResources !== undefined && { authResources: input.AuthResources }), - ...(input.IdentityPoolConfigs !== undefined && { - identityPoolConfigs: serializeAws_restJson1UpdateBackendAuthIdentityPoolConfig( - input.IdentityPoolConfigs, - context - ), - }), - ...(input.Service !== undefined && { service: input.Service }), - ...(input.UserPoolConfigs !== undefined && { - userPoolConfigs: serializeAws_restJson1UpdateBackendAuthUserPoolConfig(input.UserPoolConfigs, context), - }), + ...(input.AuthResources !== undefined && input.AuthResources !== null && { authResources: input.AuthResources }), + ...(input.IdentityPoolConfigs !== undefined && + input.IdentityPoolConfigs !== null && { + identityPoolConfigs: serializeAws_restJson1UpdateBackendAuthIdentityPoolConfig( + input.IdentityPoolConfigs, + context + ), + }), + ...(input.Service !== undefined && input.Service !== null && { service: input.Service }), + ...(input.UserPoolConfigs !== undefined && + input.UserPoolConfigs !== null && { + userPoolConfigs: serializeAws_restJson1UpdateBackendAuthUserPoolConfig(input.UserPoolConfigs, context), + }), }; }; @@ -3751,16 +3837,18 @@ const serializeAws_restJson1UpdateBackendAuthUserPoolConfig = ( context: __SerdeContext ): any => { return { - ...(input.ForgotPassword !== undefined && { - forgotPassword: serializeAws_restJson1UpdateBackendAuthForgotPasswordConfig(input.ForgotPassword, context), - }), - ...(input.Mfa !== undefined && { mfa: serializeAws_restJson1UpdateBackendAuthMFAConfig(input.Mfa, context) }), - ...(input.OAuth !== undefined && { - oAuth: serializeAws_restJson1UpdateBackendAuthOAuthConfig(input.OAuth, context), - }), - ...(input.PasswordPolicy !== undefined && { - passwordPolicy: serializeAws_restJson1UpdateBackendAuthPasswordPolicyConfig(input.PasswordPolicy, context), - }), + ...(input.ForgotPassword !== undefined && + input.ForgotPassword !== null && { + forgotPassword: serializeAws_restJson1UpdateBackendAuthForgotPasswordConfig(input.ForgotPassword, context), + }), + ...(input.Mfa !== undefined && + input.Mfa !== null && { mfa: serializeAws_restJson1UpdateBackendAuthMFAConfig(input.Mfa, context) }), + ...(input.OAuth !== undefined && + input.OAuth !== null && { oAuth: serializeAws_restJson1UpdateBackendAuthOAuthConfig(input.OAuth, context) }), + ...(input.PasswordPolicy !== undefined && + input.PasswordPolicy !== null && { + passwordPolicy: serializeAws_restJson1UpdateBackendAuthPasswordPolicyConfig(input.PasswordPolicy, context), + }), }; }; @@ -4006,46 +4094,95 @@ const deserializeAws_restJson1EmailSettings = (output: any, context: __SerdeCont }; const deserializeAws_restJson1ListOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOfAdditionalConstraintsElement = ( output: any, context: __SerdeContext ): (AdditionalConstraintsElement | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOfBackendAPIAuthType = ( output: any, context: __SerdeContext ): BackendAPIAuthType[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackendAPIAuthType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackendAPIAuthType(entry, context); + }); }; const deserializeAws_restJson1ListOfBackendJobRespObj = (output: any, context: __SerdeContext): BackendJobRespObj[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackendJobRespObj(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackendJobRespObj(entry, context); + }); }; const deserializeAws_restJson1ListOfMfaTypesElement = ( output: any, context: __SerdeContext ): (MfaTypesElement | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOfOAuthScopesElement = ( output: any, context: __SerdeContext ): (OAuthScopesElement | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOfRequiredSignUpAttributesElement = ( output: any, context: __SerdeContext ): (RequiredSignUpAttributesElement | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1LoginAuthConfigReqObj = (output: any, context: __SerdeContext): LoginAuthConfigReqObj => { @@ -4125,6 +4262,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-api-gateway/protocols/Aws_restJson1.ts b/clients/client-api-gateway/protocols/Aws_restJson1.ts index ba387ec7f220..ab3e913e1996 100644 --- a/clients/client-api-gateway/protocols/Aws_restJson1.ts +++ b/clients/client-api-gateway/protocols/Aws_restJson1.ts @@ -291,20 +291,21 @@ export const serializeAws_restJson1CreateApiKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apikeys"; let body: any; body = JSON.stringify({ - ...(input.customerId !== undefined && { customerId: input.customerId }), - ...(input.description !== undefined && { description: input.description }), - ...(input.enabled !== undefined && { enabled: input.enabled }), - ...(input.generateDistinctId !== undefined && { generateDistinctId: input.generateDistinctId }), - ...(input.stageKeys !== undefined && { - stageKeys: serializeAws_restJson1ListOfStageKeys(input.stageKeys, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), - ...(input.value !== undefined && { value: input.value }), + ...(input.customerId !== undefined && input.customerId !== null && { customerId: input.customerId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), + ...(input.generateDistinctId !== undefined && + input.generateDistinctId !== null && { generateDistinctId: input.generateDistinctId }), + ...(input.stageKeys !== undefined && + input.stageKeys !== null && { stageKeys: serializeAws_restJson1ListOfStageKeys(input.stageKeys, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -323,7 +324,7 @@ export const serializeAws_restJson1CreateAuthorizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/authorizers"; if (input.restApiId !== undefined) { @@ -337,20 +338,23 @@ export const serializeAws_restJson1CreateAuthorizerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.authType !== undefined && { authType: input.authType }), - ...(input.authorizerCredentials !== undefined && { authorizerCredentials: input.authorizerCredentials }), - ...(input.authorizerResultTtlInSeconds !== undefined && { - authorizerResultTtlInSeconds: input.authorizerResultTtlInSeconds, - }), - ...(input.authorizerUri !== undefined && { authorizerUri: input.authorizerUri }), - ...(input.identitySource !== undefined && { identitySource: input.identitySource }), - ...(input.identityValidationExpression !== undefined && { - identityValidationExpression: input.identityValidationExpression, - }), - ...(input.providerARNs !== undefined && { - providerARNs: serializeAws_restJson1ListOfARNs(input.providerARNs, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.authType !== undefined && input.authType !== null && { authType: input.authType }), + ...(input.authorizerCredentials !== undefined && + input.authorizerCredentials !== null && { authorizerCredentials: input.authorizerCredentials }), + ...(input.authorizerResultTtlInSeconds !== undefined && + input.authorizerResultTtlInSeconds !== null && { + authorizerResultTtlInSeconds: input.authorizerResultTtlInSeconds, + }), + ...(input.authorizerUri !== undefined && input.authorizerUri !== null && { authorizerUri: input.authorizerUri }), + ...(input.identitySource !== undefined && + input.identitySource !== null && { identitySource: input.identitySource }), + ...(input.identityValidationExpression !== undefined && + input.identityValidationExpression !== null && { + identityValidationExpression: input.identityValidationExpression, + }), + ...(input.providerARNs !== undefined && + input.providerARNs !== null && { providerARNs: serializeAws_restJson1ListOfARNs(input.providerARNs, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -369,7 +373,7 @@ export const serializeAws_restJson1CreateBasePathMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domainnames/{domainName}/basepathmappings"; if (input.domainName !== undefined) { @@ -383,9 +387,9 @@ export const serializeAws_restJson1CreateBasePathMappingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.basePath !== undefined && { basePath: input.basePath }), - ...(input.restApiId !== undefined && { restApiId: input.restApiId }), - ...(input.stage !== undefined && { stage: input.stage }), + ...(input.basePath !== undefined && input.basePath !== null && { basePath: input.basePath }), + ...(input.restApiId !== undefined && input.restApiId !== null && { restApiId: input.restApiId }), + ...(input.stage !== undefined && input.stage !== null && { stage: input.stage }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -404,7 +408,7 @@ export const serializeAws_restJson1CreateDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/deployments"; if (input.restApiId !== undefined) { @@ -418,18 +422,22 @@ export const serializeAws_restJson1CreateDeploymentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.cacheClusterEnabled !== undefined && { cacheClusterEnabled: input.cacheClusterEnabled }), - ...(input.cacheClusterSize !== undefined && { cacheClusterSize: input.cacheClusterSize }), - ...(input.canarySettings !== undefined && { - canarySettings: serializeAws_restJson1DeploymentCanarySettings(input.canarySettings, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.stageDescription !== undefined && { stageDescription: input.stageDescription }), - ...(input.stageName !== undefined && { stageName: input.stageName }), - ...(input.tracingEnabled !== undefined && { tracingEnabled: input.tracingEnabled }), - ...(input.variables !== undefined && { - variables: serializeAws_restJson1MapOfStringToString(input.variables, context), - }), + ...(input.cacheClusterEnabled !== undefined && + input.cacheClusterEnabled !== null && { cacheClusterEnabled: input.cacheClusterEnabled }), + ...(input.cacheClusterSize !== undefined && + input.cacheClusterSize !== null && { cacheClusterSize: input.cacheClusterSize }), + ...(input.canarySettings !== undefined && + input.canarySettings !== null && { + canarySettings: serializeAws_restJson1DeploymentCanarySettings(input.canarySettings, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.stageDescription !== undefined && + input.stageDescription !== null && { stageDescription: input.stageDescription }), + ...(input.stageName !== undefined && input.stageName !== null && { stageName: input.stageName }), + ...(input.tracingEnabled !== undefined && + input.tracingEnabled !== null && { tracingEnabled: input.tracingEnabled }), + ...(input.variables !== undefined && + input.variables !== null && { variables: serializeAws_restJson1MapOfStringToString(input.variables, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -448,7 +456,7 @@ export const serializeAws_restJson1CreateDocumentationPartCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/documentation/parts"; if (input.restApiId !== undefined) { @@ -462,10 +470,11 @@ export const serializeAws_restJson1CreateDocumentationPartCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.location !== undefined && { - location: serializeAws_restJson1DocumentationPartLocation(input.location, context), - }), - ...(input.properties !== undefined && { properties: input.properties }), + ...(input.location !== undefined && + input.location !== null && { + location: serializeAws_restJson1DocumentationPartLocation(input.location, context), + }), + ...(input.properties !== undefined && input.properties !== null && { properties: input.properties }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -484,7 +493,7 @@ export const serializeAws_restJson1CreateDocumentationVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/documentation/versions"; if (input.restApiId !== undefined) { @@ -498,9 +507,10 @@ export const serializeAws_restJson1CreateDocumentationVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.documentationVersion !== undefined && { documentationVersion: input.documentationVersion }), - ...(input.stageName !== undefined && { stageName: input.stageName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.documentationVersion !== undefined && + input.documentationVersion !== null && { documentationVersion: input.documentationVersion }), + ...(input.stageName !== undefined && input.stageName !== null && { stageName: input.stageName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -519,30 +529,41 @@ export const serializeAws_restJson1CreateDomainNameCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domainnames"; let body: any; body = JSON.stringify({ - ...(input.certificateArn !== undefined && { certificateArn: input.certificateArn }), - ...(input.certificateBody !== undefined && { certificateBody: input.certificateBody }), - ...(input.certificateChain !== undefined && { certificateChain: input.certificateChain }), - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), - ...(input.certificatePrivateKey !== undefined && { certificatePrivateKey: input.certificatePrivateKey }), - ...(input.domainName !== undefined && { domainName: input.domainName }), - ...(input.endpointConfiguration !== undefined && { - endpointConfiguration: serializeAws_restJson1EndpointConfiguration(input.endpointConfiguration, context), - }), - ...(input.mutualTlsAuthentication !== undefined && { - mutualTlsAuthentication: serializeAws_restJson1MutualTlsAuthenticationInput( - input.mutualTlsAuthentication, - context - ), - }), - ...(input.regionalCertificateArn !== undefined && { regionalCertificateArn: input.regionalCertificateArn }), - ...(input.regionalCertificateName !== undefined && { regionalCertificateName: input.regionalCertificateName }), - ...(input.securityPolicy !== undefined && { securityPolicy: input.securityPolicy }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), + ...(input.certificateArn !== undefined && + input.certificateArn !== null && { certificateArn: input.certificateArn }), + ...(input.certificateBody !== undefined && + input.certificateBody !== null && { certificateBody: input.certificateBody }), + ...(input.certificateChain !== undefined && + input.certificateChain !== null && { certificateChain: input.certificateChain }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), + ...(input.certificatePrivateKey !== undefined && + input.certificatePrivateKey !== null && { certificatePrivateKey: input.certificatePrivateKey }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), + ...(input.endpointConfiguration !== undefined && + input.endpointConfiguration !== null && { + endpointConfiguration: serializeAws_restJson1EndpointConfiguration(input.endpointConfiguration, context), + }), + ...(input.mutualTlsAuthentication !== undefined && + input.mutualTlsAuthentication !== null && { + mutualTlsAuthentication: serializeAws_restJson1MutualTlsAuthenticationInput( + input.mutualTlsAuthentication, + context + ), + }), + ...(input.regionalCertificateArn !== undefined && + input.regionalCertificateArn !== null && { regionalCertificateArn: input.regionalCertificateArn }), + ...(input.regionalCertificateName !== undefined && + input.regionalCertificateName !== null && { regionalCertificateName: input.regionalCertificateName }), + ...(input.securityPolicy !== undefined && + input.securityPolicy !== null && { securityPolicy: input.securityPolicy }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -561,7 +582,7 @@ export const serializeAws_restJson1CreateModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/models"; if (input.restApiId !== undefined) { @@ -575,9 +596,9 @@ export const serializeAws_restJson1CreateModelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.contentType !== undefined && { contentType: input.contentType }), - ...(input.description !== undefined && { description: input.description }), - ...(input.schema !== undefined && { schema: input.schema }), + ...(input.contentType !== undefined && input.contentType !== null && { contentType: input.contentType }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.schema !== undefined && input.schema !== null && { schema: input.schema }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -596,7 +617,7 @@ export const serializeAws_restJson1CreateRequestValidatorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/requestvalidators"; if (input.restApiId !== undefined) { @@ -610,10 +631,10 @@ export const serializeAws_restJson1CreateRequestValidatorCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.validateRequestBody !== undefined && { validateRequestBody: input.validateRequestBody }), - ...(input.validateRequestParameters !== undefined && { - validateRequestParameters: input.validateRequestParameters, - }), + ...(input.validateRequestBody !== undefined && + input.validateRequestBody !== null && { validateRequestBody: input.validateRequestBody }), + ...(input.validateRequestParameters !== undefined && + input.validateRequestParameters !== null && { validateRequestParameters: input.validateRequestParameters }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -632,7 +653,7 @@ export const serializeAws_restJson1CreateResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{parentId}"; if (input.parentId !== undefined) { @@ -655,7 +676,7 @@ export const serializeAws_restJson1CreateResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.pathPart !== undefined && { pathPart: input.pathPart }), + ...(input.pathPart !== undefined && input.pathPart !== null && { pathPart: input.pathPart }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -674,27 +695,30 @@ export const serializeAws_restJson1CreateRestApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis"; let body: any; body = JSON.stringify({ - ...(input.apiKeySource !== undefined && { apiKeySource: input.apiKeySource }), - ...(input.binaryMediaTypes !== undefined && { - binaryMediaTypes: serializeAws_restJson1ListOfString(input.binaryMediaTypes, context), - }), - ...(input.cloneFrom !== undefined && { cloneFrom: input.cloneFrom }), - ...(input.description !== undefined && { description: input.description }), - ...(input.disableExecuteApiEndpoint !== undefined && { - disableExecuteApiEndpoint: input.disableExecuteApiEndpoint, - }), - ...(input.endpointConfiguration !== undefined && { - endpointConfiguration: serializeAws_restJson1EndpointConfiguration(input.endpointConfiguration, context), - }), - ...(input.minimumCompressionSize !== undefined && { minimumCompressionSize: input.minimumCompressionSize }), - ...(input.policy !== undefined && { policy: input.policy }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), - ...(input.version !== undefined && { version: input.version }), + ...(input.apiKeySource !== undefined && input.apiKeySource !== null && { apiKeySource: input.apiKeySource }), + ...(input.binaryMediaTypes !== undefined && + input.binaryMediaTypes !== null && { + binaryMediaTypes: serializeAws_restJson1ListOfString(input.binaryMediaTypes, context), + }), + ...(input.cloneFrom !== undefined && input.cloneFrom !== null && { cloneFrom: input.cloneFrom }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.disableExecuteApiEndpoint !== undefined && + input.disableExecuteApiEndpoint !== null && { disableExecuteApiEndpoint: input.disableExecuteApiEndpoint }), + ...(input.endpointConfiguration !== undefined && + input.endpointConfiguration !== null && { + endpointConfiguration: serializeAws_restJson1EndpointConfiguration(input.endpointConfiguration, context), + }), + ...(input.minimumCompressionSize !== undefined && + input.minimumCompressionSize !== null && { minimumCompressionSize: input.minimumCompressionSize }), + ...(input.policy !== undefined && input.policy !== null && { policy: input.policy }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -713,7 +737,7 @@ export const serializeAws_restJson1CreateStageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/stages"; if (input.restApiId !== undefined) { @@ -727,20 +751,25 @@ export const serializeAws_restJson1CreateStageCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.cacheClusterEnabled !== undefined && { cacheClusterEnabled: input.cacheClusterEnabled }), - ...(input.cacheClusterSize !== undefined && { cacheClusterSize: input.cacheClusterSize }), - ...(input.canarySettings !== undefined && { - canarySettings: serializeAws_restJson1CanarySettings(input.canarySettings, context), - }), - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.description !== undefined && { description: input.description }), - ...(input.documentationVersion !== undefined && { documentationVersion: input.documentationVersion }), - ...(input.stageName !== undefined && { stageName: input.stageName }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), - ...(input.tracingEnabled !== undefined && { tracingEnabled: input.tracingEnabled }), - ...(input.variables !== undefined && { - variables: serializeAws_restJson1MapOfStringToString(input.variables, context), - }), + ...(input.cacheClusterEnabled !== undefined && + input.cacheClusterEnabled !== null && { cacheClusterEnabled: input.cacheClusterEnabled }), + ...(input.cacheClusterSize !== undefined && + input.cacheClusterSize !== null && { cacheClusterSize: input.cacheClusterSize }), + ...(input.canarySettings !== undefined && + input.canarySettings !== null && { + canarySettings: serializeAws_restJson1CanarySettings(input.canarySettings, context), + }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.documentationVersion !== undefined && + input.documentationVersion !== null && { documentationVersion: input.documentationVersion }), + ...(input.stageName !== undefined && input.stageName !== null && { stageName: input.stageName }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), + ...(input.tracingEnabled !== undefined && + input.tracingEnabled !== null && { tracingEnabled: input.tracingEnabled }), + ...(input.variables !== undefined && + input.variables !== null && { variables: serializeAws_restJson1MapOfStringToString(input.variables, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -759,16 +788,20 @@ export const serializeAws_restJson1CreateUsagePlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/usageplans"; let body: any; body = JSON.stringify({ - ...(input.apiStages !== undefined && { apiStages: serializeAws_restJson1ListOfApiStage(input.apiStages, context) }), - ...(input.description !== undefined && { description: input.description }), - ...(input.quota !== undefined && { quota: serializeAws_restJson1QuotaSettings(input.quota, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), - ...(input.throttle !== undefined && { throttle: serializeAws_restJson1ThrottleSettings(input.throttle, context) }), + ...(input.apiStages !== undefined && + input.apiStages !== null && { apiStages: serializeAws_restJson1ListOfApiStage(input.apiStages, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.quota !== undefined && + input.quota !== null && { quota: serializeAws_restJson1QuotaSettings(input.quota, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), + ...(input.throttle !== undefined && + input.throttle !== null && { throttle: serializeAws_restJson1ThrottleSettings(input.throttle, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -787,7 +820,7 @@ export const serializeAws_restJson1CreateUsagePlanKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/usageplans/{usagePlanId}/keys"; if (input.usagePlanId !== undefined) { @@ -801,8 +834,8 @@ export const serializeAws_restJson1CreateUsagePlanKeyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.keyId !== undefined && { keyId: input.keyId }), - ...(input.keyType !== undefined && { keyType: input.keyType }), + ...(input.keyId !== undefined && input.keyId !== null && { keyId: input.keyId }), + ...(input.keyType !== undefined && input.keyType !== null && { keyType: input.keyType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -821,16 +854,16 @@ export const serializeAws_restJson1CreateVpcLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/vpclinks"; let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), - ...(input.targetArns !== undefined && { - targetArns: serializeAws_restJson1ListOfString(input.targetArns, context), - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), + ...(input.targetArns !== undefined && + input.targetArns !== null && { targetArns: serializeAws_restJson1ListOfString(input.targetArns, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -848,9 +881,7 @@ export const serializeAws_restJson1DeleteApiKeyCommand = async ( input: DeleteApiKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apikeys/{apiKey}"; if (input.apiKey !== undefined) { const labelValue: string = input.apiKey; @@ -878,9 +909,7 @@ export const serializeAws_restJson1DeleteAuthorizerCommand = async ( input: DeleteAuthorizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/authorizers/{authorizerId}"; if (input.authorizerId !== undefined) { const labelValue: string = input.authorizerId; @@ -917,9 +946,7 @@ export const serializeAws_restJson1DeleteBasePathMappingCommand = async ( input: DeleteBasePathMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domainnames/{domainName}/basepathmappings/{basePath}"; if (input.domainName !== undefined) { const labelValue: string = input.domainName; @@ -956,9 +983,7 @@ export const serializeAws_restJson1DeleteClientCertificateCommand = async ( input: DeleteClientCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clientcertificates/{clientCertificateId}"; if (input.clientCertificateId !== undefined) { const labelValue: string = input.clientCertificateId; @@ -986,9 +1011,7 @@ export const serializeAws_restJson1DeleteDeploymentCommand = async ( input: DeleteDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/deployments/{deploymentId}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -1025,9 +1048,7 @@ export const serializeAws_restJson1DeleteDocumentationPartCommand = async ( input: DeleteDocumentationPartCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/documentation/parts/{documentationPartId}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -1064,9 +1085,7 @@ export const serializeAws_restJson1DeleteDocumentationVersionCommand = async ( input: DeleteDocumentationVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/documentation/versions/{documentationVersion}"; if (input.documentationVersion !== undefined) { const labelValue: string = input.documentationVersion; @@ -1103,9 +1122,7 @@ export const serializeAws_restJson1DeleteDomainNameCommand = async ( input: DeleteDomainNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domainnames/{domainName}"; if (input.domainName !== undefined) { const labelValue: string = input.domainName; @@ -1133,9 +1150,7 @@ export const serializeAws_restJson1DeleteGatewayResponseCommand = async ( input: DeleteGatewayResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/gatewayresponses/{responseType}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -1172,9 +1187,7 @@ export const serializeAws_restJson1DeleteIntegrationCommand = async ( input: DeleteIntegrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration"; if (input.httpMethod !== undefined) { const labelValue: string = input.httpMethod; @@ -1220,9 +1233,7 @@ export const serializeAws_restJson1DeleteIntegrationResponseCommand = async ( input: DeleteIntegrationResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}"; if (input.resourceId !== undefined) { @@ -1278,9 +1289,7 @@ export const serializeAws_restJson1DeleteMethodCommand = async ( input: DeleteMethodCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -1326,9 +1335,7 @@ export const serializeAws_restJson1DeleteMethodResponseCommand = async ( input: DeleteMethodResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}"; if (input.httpMethod !== undefined) { const labelValue: string = input.httpMethod; @@ -1383,9 +1390,7 @@ export const serializeAws_restJson1DeleteModelCommand = async ( input: DeleteModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/models/{modelName}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -1422,9 +1427,7 @@ export const serializeAws_restJson1DeleteRequestValidatorCommand = async ( input: DeleteRequestValidatorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/requestvalidators/{requestValidatorId}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -1461,9 +1464,7 @@ export const serializeAws_restJson1DeleteResourceCommand = async ( input: DeleteResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -1500,9 +1501,7 @@ export const serializeAws_restJson1DeleteRestApiCommand = async ( input: DeleteRestApiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -1530,9 +1529,7 @@ export const serializeAws_restJson1DeleteStageCommand = async ( input: DeleteStageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/stages/{stageName}"; if (input.stageName !== undefined) { const labelValue: string = input.stageName; @@ -1569,9 +1566,7 @@ export const serializeAws_restJson1DeleteUsagePlanCommand = async ( input: DeleteUsagePlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/usageplans/{usagePlanId}"; if (input.usagePlanId !== undefined) { const labelValue: string = input.usagePlanId; @@ -1599,9 +1594,7 @@ export const serializeAws_restJson1DeleteUsagePlanKeyCommand = async ( input: DeleteUsagePlanKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/usageplans/{usagePlanId}/keys/{keyId}"; if (input.keyId !== undefined) { const labelValue: string = input.keyId; @@ -1638,9 +1631,7 @@ export const serializeAws_restJson1DeleteVpcLinkCommand = async ( input: DeleteVpcLinkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/vpclinks/{vpcLinkId}"; if (input.vpcLinkId !== undefined) { const labelValue: string = input.vpcLinkId; @@ -1668,9 +1659,7 @@ export const serializeAws_restJson1FlushStageAuthorizersCacheCommand = async ( input: FlushStageAuthorizersCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/stages/{stageName}/cache/authorizers"; if (input.stageName !== undefined) { const labelValue: string = input.stageName; @@ -1707,9 +1696,7 @@ export const serializeAws_restJson1FlushStageCacheCommand = async ( input: FlushStageCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/stages/{stageName}/cache/data"; if (input.stageName !== undefined) { const labelValue: string = input.stageName; @@ -1747,13 +1734,14 @@ export const serializeAws_restJson1GenerateClientCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clientcertificates"; let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1771,12 +1759,10 @@ export const serializeAws_restJson1GetAccountCommand = async ( input: GetAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/account"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1793,9 +1779,7 @@ export const serializeAws_restJson1GetApiKeyCommand = async ( input: GetApiKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apikeys/{apiKey}"; if (input.apiKey !== undefined) { const labelValue: string = input.apiKey; @@ -1827,9 +1811,7 @@ export const serializeAws_restJson1GetApiKeysCommand = async ( input: GetApiKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apikeys"; const query: any = { ...(input.position !== undefined && { position: input.position }), @@ -1856,9 +1838,7 @@ export const serializeAws_restJson1GetAuthorizerCommand = async ( input: GetAuthorizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/authorizers/{authorizerId}"; if (input.authorizerId !== undefined) { const labelValue: string = input.authorizerId; @@ -1895,9 +1875,7 @@ export const serializeAws_restJson1GetAuthorizersCommand = async ( input: GetAuthorizersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/authorizers"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -1930,9 +1908,7 @@ export const serializeAws_restJson1GetBasePathMappingCommand = async ( input: GetBasePathMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domainnames/{domainName}/basepathmappings/{basePath}"; if (input.basePath !== undefined) { const labelValue: string = input.basePath; @@ -1969,9 +1945,7 @@ export const serializeAws_restJson1GetBasePathMappingsCommand = async ( input: GetBasePathMappingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domainnames/{domainName}/basepathmappings"; if (input.domainName !== undefined) { const labelValue: string = input.domainName; @@ -2004,9 +1978,7 @@ export const serializeAws_restJson1GetClientCertificateCommand = async ( input: GetClientCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clientcertificates/{clientCertificateId}"; if (input.clientCertificateId !== undefined) { const labelValue: string = input.clientCertificateId; @@ -2034,9 +2006,7 @@ export const serializeAws_restJson1GetClientCertificatesCommand = async ( input: GetClientCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clientcertificates"; const query: any = { ...(input.limit !== undefined && { limit: input.limit.toString() }), @@ -2060,9 +2030,7 @@ export const serializeAws_restJson1GetDeploymentCommand = async ( input: GetDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/deployments/{deploymentId}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2103,9 +2071,7 @@ export const serializeAws_restJson1GetDeploymentsCommand = async ( input: GetDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/deployments"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2138,9 +2104,7 @@ export const serializeAws_restJson1GetDocumentationPartCommand = async ( input: GetDocumentationPartCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/documentation/parts/{documentationPartId}"; if (input.documentationPartId !== undefined) { const labelValue: string = input.documentationPartId; @@ -2177,9 +2141,7 @@ export const serializeAws_restJson1GetDocumentationPartsCommand = async ( input: GetDocumentationPartsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/documentation/parts"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2216,9 +2178,7 @@ export const serializeAws_restJson1GetDocumentationVersionCommand = async ( input: GetDocumentationVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/documentation/versions/{documentationVersion}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2255,9 +2215,7 @@ export const serializeAws_restJson1GetDocumentationVersionsCommand = async ( input: GetDocumentationVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/documentation/versions"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2290,9 +2248,7 @@ export const serializeAws_restJson1GetDomainNameCommand = async ( input: GetDomainNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domainnames/{domainName}"; if (input.domainName !== undefined) { const labelValue: string = input.domainName; @@ -2320,9 +2276,7 @@ export const serializeAws_restJson1GetDomainNamesCommand = async ( input: GetDomainNamesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domainnames"; const query: any = { ...(input.position !== undefined && { position: input.position }), @@ -2347,7 +2301,7 @@ export const serializeAws_restJson1GetExportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.accepts) && { Accept: input.accepts! }), }; let resolvedPath = "/restapis/{restApiId}/stages/{stageName}/exports/{exportType}"; @@ -2380,9 +2334,10 @@ export const serializeAws_restJson1GetExportCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.parameters !== undefined && { - parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context), - }), + ...(input.parameters !== undefined && + input.parameters !== null && { + parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2400,9 +2355,7 @@ export const serializeAws_restJson1GetGatewayResponseCommand = async ( input: GetGatewayResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/gatewayresponses/{responseType}"; if (input.responseType !== undefined) { const labelValue: string = input.responseType; @@ -2439,9 +2392,7 @@ export const serializeAws_restJson1GetGatewayResponsesCommand = async ( input: GetGatewayResponsesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/gatewayresponses"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2474,9 +2425,7 @@ export const serializeAws_restJson1GetIntegrationCommand = async ( input: GetIntegrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2522,9 +2471,7 @@ export const serializeAws_restJson1GetIntegrationResponseCommand = async ( input: GetIntegrationResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}"; if (input.resourceId !== undefined) { @@ -2580,9 +2527,7 @@ export const serializeAws_restJson1GetMethodCommand = async ( input: GetMethodCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}"; if (input.resourceId !== undefined) { const labelValue: string = input.resourceId; @@ -2628,9 +2573,7 @@ export const serializeAws_restJson1GetMethodResponseCommand = async ( input: GetMethodResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}"; if (input.resourceId !== undefined) { const labelValue: string = input.resourceId; @@ -2685,9 +2628,7 @@ export const serializeAws_restJson1GetModelCommand = async ( input: GetModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/models/{modelName}"; if (input.modelName !== undefined) { const labelValue: string = input.modelName; @@ -2728,9 +2669,7 @@ export const serializeAws_restJson1GetModelsCommand = async ( input: GetModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/models"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2763,9 +2702,7 @@ export const serializeAws_restJson1GetModelTemplateCommand = async ( input: GetModelTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/models/{modelName}/default_template"; if (input.modelName !== undefined) { const labelValue: string = input.modelName; @@ -2802,9 +2739,7 @@ export const serializeAws_restJson1GetRequestValidatorCommand = async ( input: GetRequestValidatorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/requestvalidators/{requestValidatorId}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2841,9 +2776,7 @@ export const serializeAws_restJson1GetRequestValidatorsCommand = async ( input: GetRequestValidatorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/requestvalidators"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2876,9 +2809,7 @@ export const serializeAws_restJson1GetResourceCommand = async ( input: GetResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2919,9 +2850,7 @@ export const serializeAws_restJson1GetResourcesCommand = async ( input: GetResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/resources"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2955,9 +2884,7 @@ export const serializeAws_restJson1GetRestApiCommand = async ( input: GetRestApiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -2985,9 +2912,7 @@ export const serializeAws_restJson1GetRestApisCommand = async ( input: GetRestApisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis"; const query: any = { ...(input.limit !== undefined && { limit: input.limit.toString() }), @@ -3012,7 +2937,7 @@ export const serializeAws_restJson1GetSdkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/stages/{stageName}/sdks/{sdkType}"; if (input.restApiId !== undefined) { @@ -3044,9 +2969,10 @@ export const serializeAws_restJson1GetSdkCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.parameters !== undefined && { - parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context), - }), + ...(input.parameters !== undefined && + input.parameters !== null && { + parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3064,9 +2990,7 @@ export const serializeAws_restJson1GetSdkTypeCommand = async ( input: GetSdkTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sdktypes/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -3094,9 +3018,7 @@ export const serializeAws_restJson1GetSdkTypesCommand = async ( input: GetSdkTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sdktypes"; const query: any = { ...(input.position !== undefined && { position: input.position }), @@ -3120,9 +3042,7 @@ export const serializeAws_restJson1GetStageCommand = async ( input: GetStageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/stages/{stageName}"; if (input.stageName !== undefined) { const labelValue: string = input.stageName; @@ -3159,9 +3079,7 @@ export const serializeAws_restJson1GetStagesCommand = async ( input: GetStagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/stages"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -3193,9 +3111,7 @@ export const serializeAws_restJson1GetTagsCommand = async ( input: GetTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -3228,9 +3144,7 @@ export const serializeAws_restJson1GetUsageCommand = async ( input: GetUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/usageplans/{usagePlanId}/usage"; if (input.usagePlanId !== undefined) { const labelValue: string = input.usagePlanId; @@ -3266,9 +3180,7 @@ export const serializeAws_restJson1GetUsagePlanCommand = async ( input: GetUsagePlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/usageplans/{usagePlanId}"; if (input.usagePlanId !== undefined) { const labelValue: string = input.usagePlanId; @@ -3296,9 +3208,7 @@ export const serializeAws_restJson1GetUsagePlanKeyCommand = async ( input: GetUsagePlanKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/usageplans/{usagePlanId}/keys/{keyId}"; if (input.keyId !== undefined) { const labelValue: string = input.keyId; @@ -3335,9 +3245,7 @@ export const serializeAws_restJson1GetUsagePlanKeysCommand = async ( input: GetUsagePlanKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/usageplans/{usagePlanId}/keys"; if (input.usagePlanId !== undefined) { const labelValue: string = input.usagePlanId; @@ -3371,9 +3279,7 @@ export const serializeAws_restJson1GetUsagePlansCommand = async ( input: GetUsagePlansCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/usageplans"; const query: any = { ...(input.limit !== undefined && { limit: input.limit.toString() }), @@ -3398,9 +3304,7 @@ export const serializeAws_restJson1GetVpcLinkCommand = async ( input: GetVpcLinkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/vpclinks/{vpcLinkId}"; if (input.vpcLinkId !== undefined) { const labelValue: string = input.vpcLinkId; @@ -3428,9 +3332,7 @@ export const serializeAws_restJson1GetVpcLinksCommand = async ( input: GetVpcLinksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/vpclinks"; const query: any = { ...(input.position !== undefined && { position: input.position }), @@ -3454,9 +3356,7 @@ export const serializeAws_restJson1ImportApiKeysCommand = async ( input: ImportApiKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apikeys"; const query: any = { mode: "import", @@ -3481,9 +3381,7 @@ export const serializeAws_restJson1ImportDocumentationPartsCommand = async ( input: ImportDocumentationPartsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restapis/{restApiId}/documentation/parts"; if (input.restApiId !== undefined) { const labelValue: string = input.restApiId; @@ -3517,7 +3415,7 @@ export const serializeAws_restJson1ImportRestApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis"; const query: any = { @@ -3526,9 +3424,10 @@ export const serializeAws_restJson1ImportRestApiCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.parameters !== undefined && { - parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context), - }), + ...(input.parameters !== undefined && + input.parameters !== null && { + parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3548,7 +3447,7 @@ export const serializeAws_restJson1PutGatewayResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/gatewayresponses/{responseType}"; if (input.responseType !== undefined) { @@ -3571,13 +3470,15 @@ export const serializeAws_restJson1PutGatewayResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.responseParameters !== undefined && { - responseParameters: serializeAws_restJson1MapOfStringToString(input.responseParameters, context), - }), - ...(input.responseTemplates !== undefined && { - responseTemplates: serializeAws_restJson1MapOfStringToString(input.responseTemplates, context), - }), - ...(input.statusCode !== undefined && { statusCode: input.statusCode }), + ...(input.responseParameters !== undefined && + input.responseParameters !== null && { + responseParameters: serializeAws_restJson1MapOfStringToString(input.responseParameters, context), + }), + ...(input.responseTemplates !== undefined && + input.responseTemplates !== null && { + responseTemplates: serializeAws_restJson1MapOfStringToString(input.responseTemplates, context), + }), + ...(input.statusCode !== undefined && input.statusCode !== null && { statusCode: input.statusCode }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3596,7 +3497,7 @@ export const serializeAws_restJson1PutIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration"; if (input.resourceId !== undefined) { @@ -3628,26 +3529,36 @@ export const serializeAws_restJson1PutIntegrationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.cacheKeyParameters !== undefined && { - cacheKeyParameters: serializeAws_restJson1ListOfString(input.cacheKeyParameters, context), - }), - ...(input.cacheNamespace !== undefined && { cacheNamespace: input.cacheNamespace }), - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.connectionType !== undefined && { connectionType: input.connectionType }), - ...(input.contentHandling !== undefined && { contentHandling: input.contentHandling }), - ...(input.credentials !== undefined && { credentials: input.credentials }), - ...(input.integrationHttpMethod !== undefined && { httpMethod: input.integrationHttpMethod }), - ...(input.passthroughBehavior !== undefined && { passthroughBehavior: input.passthroughBehavior }), - ...(input.requestParameters !== undefined && { - requestParameters: serializeAws_restJson1MapOfStringToString(input.requestParameters, context), - }), - ...(input.requestTemplates !== undefined && { - requestTemplates: serializeAws_restJson1MapOfStringToString(input.requestTemplates, context), - }), - ...(input.timeoutInMillis !== undefined && { timeoutInMillis: input.timeoutInMillis }), - ...(input.tlsConfig !== undefined && { tlsConfig: serializeAws_restJson1TlsConfig(input.tlsConfig, context) }), - ...(input.type !== undefined && { type: input.type }), - ...(input.uri !== undefined && { uri: input.uri }), + ...(input.cacheKeyParameters !== undefined && + input.cacheKeyParameters !== null && { + cacheKeyParameters: serializeAws_restJson1ListOfString(input.cacheKeyParameters, context), + }), + ...(input.cacheNamespace !== undefined && + input.cacheNamespace !== null && { cacheNamespace: input.cacheNamespace }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.connectionType !== undefined && + input.connectionType !== null && { connectionType: input.connectionType }), + ...(input.contentHandling !== undefined && + input.contentHandling !== null && { contentHandling: input.contentHandling }), + ...(input.credentials !== undefined && input.credentials !== null && { credentials: input.credentials }), + ...(input.integrationHttpMethod !== undefined && + input.integrationHttpMethod !== null && { httpMethod: input.integrationHttpMethod }), + ...(input.passthroughBehavior !== undefined && + input.passthroughBehavior !== null && { passthroughBehavior: input.passthroughBehavior }), + ...(input.requestParameters !== undefined && + input.requestParameters !== null && { + requestParameters: serializeAws_restJson1MapOfStringToString(input.requestParameters, context), + }), + ...(input.requestTemplates !== undefined && + input.requestTemplates !== null && { + requestTemplates: serializeAws_restJson1MapOfStringToString(input.requestTemplates, context), + }), + ...(input.timeoutInMillis !== undefined && + input.timeoutInMillis !== null && { timeoutInMillis: input.timeoutInMillis }), + ...(input.tlsConfig !== undefined && + input.tlsConfig !== null && { tlsConfig: serializeAws_restJson1TlsConfig(input.tlsConfig, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.uri !== undefined && input.uri !== null && { uri: input.uri }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3666,7 +3577,7 @@ export const serializeAws_restJson1PutIntegrationResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}"; @@ -3708,14 +3619,18 @@ export const serializeAws_restJson1PutIntegrationResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.contentHandling !== undefined && { contentHandling: input.contentHandling }), - ...(input.responseParameters !== undefined && { - responseParameters: serializeAws_restJson1MapOfStringToString(input.responseParameters, context), - }), - ...(input.responseTemplates !== undefined && { - responseTemplates: serializeAws_restJson1MapOfStringToString(input.responseTemplates, context), - }), - ...(input.selectionPattern !== undefined && { selectionPattern: input.selectionPattern }), + ...(input.contentHandling !== undefined && + input.contentHandling !== null && { contentHandling: input.contentHandling }), + ...(input.responseParameters !== undefined && + input.responseParameters !== null && { + responseParameters: serializeAws_restJson1MapOfStringToString(input.responseParameters, context), + }), + ...(input.responseTemplates !== undefined && + input.responseTemplates !== null && { + responseTemplates: serializeAws_restJson1MapOfStringToString(input.responseTemplates, context), + }), + ...(input.selectionPattern !== undefined && + input.selectionPattern !== null && { selectionPattern: input.selectionPattern }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3734,7 +3649,7 @@ export const serializeAws_restJson1PutMethodCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}"; if (input.restApiId !== undefined) { @@ -3766,20 +3681,26 @@ export const serializeAws_restJson1PutMethodCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.apiKeyRequired !== undefined && { apiKeyRequired: input.apiKeyRequired }), - ...(input.authorizationScopes !== undefined && { - authorizationScopes: serializeAws_restJson1ListOfString(input.authorizationScopes, context), - }), - ...(input.authorizationType !== undefined && { authorizationType: input.authorizationType }), - ...(input.authorizerId !== undefined && { authorizerId: input.authorizerId }), - ...(input.operationName !== undefined && { operationName: input.operationName }), - ...(input.requestModels !== undefined && { - requestModels: serializeAws_restJson1MapOfStringToString(input.requestModels, context), - }), - ...(input.requestParameters !== undefined && { - requestParameters: serializeAws_restJson1MapOfStringToBoolean(input.requestParameters, context), - }), - ...(input.requestValidatorId !== undefined && { requestValidatorId: input.requestValidatorId }), + ...(input.apiKeyRequired !== undefined && + input.apiKeyRequired !== null && { apiKeyRequired: input.apiKeyRequired }), + ...(input.authorizationScopes !== undefined && + input.authorizationScopes !== null && { + authorizationScopes: serializeAws_restJson1ListOfString(input.authorizationScopes, context), + }), + ...(input.authorizationType !== undefined && + input.authorizationType !== null && { authorizationType: input.authorizationType }), + ...(input.authorizerId !== undefined && input.authorizerId !== null && { authorizerId: input.authorizerId }), + ...(input.operationName !== undefined && input.operationName !== null && { operationName: input.operationName }), + ...(input.requestModels !== undefined && + input.requestModels !== null && { + requestModels: serializeAws_restJson1MapOfStringToString(input.requestModels, context), + }), + ...(input.requestParameters !== undefined && + input.requestParameters !== null && { + requestParameters: serializeAws_restJson1MapOfStringToBoolean(input.requestParameters, context), + }), + ...(input.requestValidatorId !== undefined && + input.requestValidatorId !== null && { requestValidatorId: input.requestValidatorId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3798,7 +3719,7 @@ export const serializeAws_restJson1PutMethodResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}"; if (input.restApiId !== undefined) { @@ -3839,12 +3760,14 @@ export const serializeAws_restJson1PutMethodResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.responseModels !== undefined && { - responseModels: serializeAws_restJson1MapOfStringToString(input.responseModels, context), - }), - ...(input.responseParameters !== undefined && { - responseParameters: serializeAws_restJson1MapOfStringToBoolean(input.responseParameters, context), - }), + ...(input.responseModels !== undefined && + input.responseModels !== null && { + responseModels: serializeAws_restJson1MapOfStringToString(input.responseModels, context), + }), + ...(input.responseParameters !== undefined && + input.responseParameters !== null && { + responseParameters: serializeAws_restJson1MapOfStringToBoolean(input.responseParameters, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3863,7 +3786,7 @@ export const serializeAws_restJson1PutRestApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}"; if (input.restApiId !== undefined) { @@ -3881,9 +3804,10 @@ export const serializeAws_restJson1PutRestApiCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.parameters !== undefined && { - parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context), - }), + ...(input.parameters !== undefined && + input.parameters !== null && { + parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3903,7 +3827,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -3917,7 +3841,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOfStringToString(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3936,7 +3861,7 @@ export const serializeAws_restJson1TestInvokeAuthorizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/authorizers/{authorizerId}"; if (input.restApiId !== undefined) { @@ -3959,18 +3884,23 @@ export const serializeAws_restJson1TestInvokeAuthorizerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.additionalContext !== undefined && { - additionalContext: serializeAws_restJson1MapOfStringToString(input.additionalContext, context), - }), - ...(input.body !== undefined && { body: input.body }), - ...(input.headers !== undefined && { headers: serializeAws_restJson1MapOfStringToString(input.headers, context) }), - ...(input.multiValueHeaders !== undefined && { - multiValueHeaders: serializeAws_restJson1MapOfStringToList(input.multiValueHeaders, context), - }), - ...(input.pathWithQueryString !== undefined && { pathWithQueryString: input.pathWithQueryString }), - ...(input.stageVariables !== undefined && { - stageVariables: serializeAws_restJson1MapOfStringToString(input.stageVariables, context), - }), + ...(input.additionalContext !== undefined && + input.additionalContext !== null && { + additionalContext: serializeAws_restJson1MapOfStringToString(input.additionalContext, context), + }), + ...(input.body !== undefined && input.body !== null && { body: input.body }), + ...(input.headers !== undefined && + input.headers !== null && { headers: serializeAws_restJson1MapOfStringToString(input.headers, context) }), + ...(input.multiValueHeaders !== undefined && + input.multiValueHeaders !== null && { + multiValueHeaders: serializeAws_restJson1MapOfStringToList(input.multiValueHeaders, context), + }), + ...(input.pathWithQueryString !== undefined && + input.pathWithQueryString !== null && { pathWithQueryString: input.pathWithQueryString }), + ...(input.stageVariables !== undefined && + input.stageVariables !== null && { + stageVariables: serializeAws_restJson1MapOfStringToString(input.stageVariables, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3989,7 +3919,7 @@ export const serializeAws_restJson1TestInvokeMethodCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}"; if (input.restApiId !== undefined) { @@ -4021,16 +3951,21 @@ export const serializeAws_restJson1TestInvokeMethodCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.body !== undefined && { body: input.body }), - ...(input.clientCertificateId !== undefined && { clientCertificateId: input.clientCertificateId }), - ...(input.headers !== undefined && { headers: serializeAws_restJson1MapOfStringToString(input.headers, context) }), - ...(input.multiValueHeaders !== undefined && { - multiValueHeaders: serializeAws_restJson1MapOfStringToList(input.multiValueHeaders, context), - }), - ...(input.pathWithQueryString !== undefined && { pathWithQueryString: input.pathWithQueryString }), - ...(input.stageVariables !== undefined && { - stageVariables: serializeAws_restJson1MapOfStringToString(input.stageVariables, context), - }), + ...(input.body !== undefined && input.body !== null && { body: input.body }), + ...(input.clientCertificateId !== undefined && + input.clientCertificateId !== null && { clientCertificateId: input.clientCertificateId }), + ...(input.headers !== undefined && + input.headers !== null && { headers: serializeAws_restJson1MapOfStringToString(input.headers, context) }), + ...(input.multiValueHeaders !== undefined && + input.multiValueHeaders !== null && { + multiValueHeaders: serializeAws_restJson1MapOfStringToList(input.multiValueHeaders, context), + }), + ...(input.pathWithQueryString !== undefined && + input.pathWithQueryString !== null && { pathWithQueryString: input.pathWithQueryString }), + ...(input.stageVariables !== undefined && + input.stageVariables !== null && { + stageVariables: serializeAws_restJson1MapOfStringToString(input.stageVariables, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4048,9 +3983,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -4083,14 +4016,15 @@ export const serializeAws_restJson1UpdateAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/account"; let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4109,7 +4043,7 @@ export const serializeAws_restJson1UpdateApiKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apikeys/{apiKey}"; if (input.apiKey !== undefined) { @@ -4123,9 +4057,10 @@ export const serializeAws_restJson1UpdateApiKeyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4144,7 +4079,7 @@ export const serializeAws_restJson1UpdateAuthorizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/authorizers/{authorizerId}"; if (input.restApiId !== undefined) { @@ -4167,9 +4102,10 @@ export const serializeAws_restJson1UpdateAuthorizerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4188,7 +4124,7 @@ export const serializeAws_restJson1UpdateBasePathMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domainnames/{domainName}/basepathmappings/{basePath}"; if (input.basePath !== undefined) { @@ -4211,9 +4147,10 @@ export const serializeAws_restJson1UpdateBasePathMappingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4232,7 +4169,7 @@ export const serializeAws_restJson1UpdateClientCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clientcertificates/{clientCertificateId}"; if (input.clientCertificateId !== undefined) { @@ -4246,9 +4183,10 @@ export const serializeAws_restJson1UpdateClientCertificateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4267,7 +4205,7 @@ export const serializeAws_restJson1UpdateDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/deployments/{deploymentId}"; if (input.restApiId !== undefined) { @@ -4290,9 +4228,10 @@ export const serializeAws_restJson1UpdateDeploymentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4311,7 +4250,7 @@ export const serializeAws_restJson1UpdateDocumentationPartCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/documentation/parts/{documentationPartId}"; if (input.documentationPartId !== undefined) { @@ -4334,9 +4273,10 @@ export const serializeAws_restJson1UpdateDocumentationPartCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4355,7 +4295,7 @@ export const serializeAws_restJson1UpdateDocumentationVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/documentation/versions/{documentationVersion}"; if (input.documentationVersion !== undefined) { @@ -4378,9 +4318,10 @@ export const serializeAws_restJson1UpdateDocumentationVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4399,7 +4340,7 @@ export const serializeAws_restJson1UpdateDomainNameCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domainnames/{domainName}"; if (input.domainName !== undefined) { @@ -4413,9 +4354,10 @@ export const serializeAws_restJson1UpdateDomainNameCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4434,7 +4376,7 @@ export const serializeAws_restJson1UpdateGatewayResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/gatewayresponses/{responseType}"; if (input.responseType !== undefined) { @@ -4457,9 +4399,10 @@ export const serializeAws_restJson1UpdateGatewayResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4478,7 +4421,7 @@ export const serializeAws_restJson1UpdateIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration"; if (input.httpMethod !== undefined) { @@ -4510,9 +4453,10 @@ export const serializeAws_restJson1UpdateIntegrationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4531,7 +4475,7 @@ export const serializeAws_restJson1UpdateIntegrationResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}"; @@ -4573,9 +4517,10 @@ export const serializeAws_restJson1UpdateIntegrationResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4594,7 +4539,7 @@ export const serializeAws_restJson1UpdateMethodCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}"; if (input.httpMethod !== undefined) { @@ -4626,9 +4571,10 @@ export const serializeAws_restJson1UpdateMethodCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4647,7 +4593,7 @@ export const serializeAws_restJson1UpdateMethodResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}"; if (input.resourceId !== undefined) { @@ -4688,9 +4634,10 @@ export const serializeAws_restJson1UpdateMethodResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4709,7 +4656,7 @@ export const serializeAws_restJson1UpdateModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/models/{modelName}"; if (input.modelName !== undefined) { @@ -4732,9 +4679,10 @@ export const serializeAws_restJson1UpdateModelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4753,7 +4701,7 @@ export const serializeAws_restJson1UpdateRequestValidatorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/requestvalidators/{requestValidatorId}"; if (input.requestValidatorId !== undefined) { @@ -4776,9 +4724,10 @@ export const serializeAws_restJson1UpdateRequestValidatorCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4797,7 +4746,7 @@ export const serializeAws_restJson1UpdateResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/resources/{resourceId}"; if (input.resourceId !== undefined) { @@ -4820,9 +4769,10 @@ export const serializeAws_restJson1UpdateResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4841,7 +4791,7 @@ export const serializeAws_restJson1UpdateRestApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}"; if (input.restApiId !== undefined) { @@ -4855,9 +4805,10 @@ export const serializeAws_restJson1UpdateRestApiCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4876,7 +4827,7 @@ export const serializeAws_restJson1UpdateStageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restapis/{restApiId}/stages/{stageName}"; if (input.stageName !== undefined) { @@ -4899,9 +4850,10 @@ export const serializeAws_restJson1UpdateStageCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4920,7 +4872,7 @@ export const serializeAws_restJson1UpdateUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/usageplans/{usagePlanId}/keys/{keyId}/usage"; if (input.keyId !== undefined) { @@ -4943,9 +4895,10 @@ export const serializeAws_restJson1UpdateUsageCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4964,7 +4917,7 @@ export const serializeAws_restJson1UpdateUsagePlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/usageplans/{usagePlanId}"; if (input.usagePlanId !== undefined) { @@ -4978,9 +4931,10 @@ export const serializeAws_restJson1UpdateUsagePlanCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4999,7 +4953,7 @@ export const serializeAws_restJson1UpdateVpcLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/vpclinks/{vpcLinkId}"; if (input.vpcLinkId !== undefined) { @@ -5013,9 +4967,10 @@ export const serializeAws_restJson1UpdateVpcLinkCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.patchOperations !== undefined && { - patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), - }), + ...(input.patchOperations !== undefined && + input.patchOperations !== null && { + patchOperations: serializeAws_restJson1ListOfPatchOperation(input.patchOperations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -16807,22 +16762,25 @@ const deserializeAws_restJson1UnauthorizedExceptionResponse = async ( const serializeAws_restJson1ApiStage = (input: ApiStage, context: __SerdeContext): any => { return { - ...(input.apiId !== undefined && { apiId: input.apiId }), - ...(input.stage !== undefined && { stage: input.stage }), - ...(input.throttle !== undefined && { - throttle: serializeAws_restJson1MapOfApiStageThrottleSettings(input.throttle, context), - }), + ...(input.apiId !== undefined && input.apiId !== null && { apiId: input.apiId }), + ...(input.stage !== undefined && input.stage !== null && { stage: input.stage }), + ...(input.throttle !== undefined && + input.throttle !== null && { + throttle: serializeAws_restJson1MapOfApiStageThrottleSettings(input.throttle, context), + }), }; }; const serializeAws_restJson1CanarySettings = (input: CanarySettings, context: __SerdeContext): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.percentTraffic !== undefined && { percentTraffic: input.percentTraffic }), - ...(input.stageVariableOverrides !== undefined && { - stageVariableOverrides: serializeAws_restJson1MapOfStringToString(input.stageVariableOverrides, context), - }), - ...(input.useStageCache !== undefined && { useStageCache: input.useStageCache }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.percentTraffic !== undefined && + input.percentTraffic !== null && { percentTraffic: input.percentTraffic }), + ...(input.stageVariableOverrides !== undefined && + input.stageVariableOverrides !== null && { + stageVariableOverrides: serializeAws_restJson1MapOfStringToString(input.stageVariableOverrides, context), + }), + ...(input.useStageCache !== undefined && input.useStageCache !== null && { useStageCache: input.useStageCache }), }; }; @@ -16831,11 +16789,13 @@ const serializeAws_restJson1DeploymentCanarySettings = ( context: __SerdeContext ): any => { return { - ...(input.percentTraffic !== undefined && { percentTraffic: input.percentTraffic }), - ...(input.stageVariableOverrides !== undefined && { - stageVariableOverrides: serializeAws_restJson1MapOfStringToString(input.stageVariableOverrides, context), - }), - ...(input.useStageCache !== undefined && { useStageCache: input.useStageCache }), + ...(input.percentTraffic !== undefined && + input.percentTraffic !== null && { percentTraffic: input.percentTraffic }), + ...(input.stageVariableOverrides !== undefined && + input.stageVariableOverrides !== null && { + stageVariableOverrides: serializeAws_restJson1MapOfStringToString(input.stageVariableOverrides, context), + }), + ...(input.useStageCache !== undefined && input.useStageCache !== null && { useStageCache: input.useStageCache }), }; }; @@ -16844,91 +16804,143 @@ const serializeAws_restJson1DocumentationPartLocation = ( context: __SerdeContext ): any => { return { - ...(input.method !== undefined && { method: input.method }), - ...(input.name !== undefined && { name: input.name }), - ...(input.path !== undefined && { path: input.path }), - ...(input.statusCode !== undefined && { statusCode: input.statusCode }), - ...(input.type !== undefined && { type: input.type }), + ...(input.method !== undefined && input.method !== null && { method: input.method }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), + ...(input.statusCode !== undefined && input.statusCode !== null && { statusCode: input.statusCode }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1EndpointConfiguration = (input: EndpointConfiguration, context: __SerdeContext): any => { return { - ...(input.types !== undefined && { types: serializeAws_restJson1ListOfEndpointType(input.types, context) }), - ...(input.vpcEndpointIds !== undefined && { - vpcEndpointIds: serializeAws_restJson1ListOfString(input.vpcEndpointIds, context), - }), + ...(input.types !== undefined && + input.types !== null && { types: serializeAws_restJson1ListOfEndpointType(input.types, context) }), + ...(input.vpcEndpointIds !== undefined && + input.vpcEndpointIds !== null && { + vpcEndpointIds: serializeAws_restJson1ListOfString(input.vpcEndpointIds, context), + }), }; }; const serializeAws_restJson1ListOfApiStage = (input: ApiStage[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ApiStage(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ApiStage(entry, context); + }); }; const serializeAws_restJson1ListOfARNs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListOfEndpointType = (input: (EndpointType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListOfPatchOperation = (input: PatchOperation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1PatchOperation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1PatchOperation(entry, context); + }); }; const serializeAws_restJson1ListOfStageKeys = (input: StageKey[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1StageKey(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1StageKey(entry, context); + }); }; const serializeAws_restJson1ListOfString = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1MapOfApiStageThrottleSettings = ( input: { [key: string]: ThrottleSettings }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: ThrottleSettings }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: ThrottleSettings }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1ThrottleSettings(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfStringToBoolean = ( input: { [key: string]: boolean }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: boolean }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: boolean }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfStringToList = (input: { [key: string]: string[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1ListOfString(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfStringToString = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MutualTlsAuthenticationInput = ( @@ -16936,45 +16948,47 @@ const serializeAws_restJson1MutualTlsAuthenticationInput = ( context: __SerdeContext ): any => { return { - ...(input.truststoreUri !== undefined && { truststoreUri: input.truststoreUri }), - ...(input.truststoreVersion !== undefined && { truststoreVersion: input.truststoreVersion }), + ...(input.truststoreUri !== undefined && input.truststoreUri !== null && { truststoreUri: input.truststoreUri }), + ...(input.truststoreVersion !== undefined && + input.truststoreVersion !== null && { truststoreVersion: input.truststoreVersion }), }; }; const serializeAws_restJson1PatchOperation = (input: PatchOperation, context: __SerdeContext): any => { return { - ...(input.from !== undefined && { from: input.from }), - ...(input.op !== undefined && { op: input.op }), - ...(input.path !== undefined && { path: input.path }), - ...(input.value !== undefined && { value: input.value }), + ...(input.from !== undefined && input.from !== null && { from: input.from }), + ...(input.op !== undefined && input.op !== null && { op: input.op }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1QuotaSettings = (input: QuotaSettings, context: __SerdeContext): any => { return { - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.offset !== undefined && { offset: input.offset }), - ...(input.period !== undefined && { period: input.period }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.offset !== undefined && input.offset !== null && { offset: input.offset }), + ...(input.period !== undefined && input.period !== null && { period: input.period }), }; }; const serializeAws_restJson1StageKey = (input: StageKey, context: __SerdeContext): any => { return { - ...(input.restApiId !== undefined && { restApiId: input.restApiId }), - ...(input.stageName !== undefined && { stageName: input.stageName }), + ...(input.restApiId !== undefined && input.restApiId !== null && { restApiId: input.restApiId }), + ...(input.stageName !== undefined && input.stageName !== null && { stageName: input.stageName }), }; }; const serializeAws_restJson1ThrottleSettings = (input: ThrottleSettings, context: __SerdeContext): any => { return { - ...(input.burstLimit !== undefined && { burstLimit: input.burstLimit }), - ...(input.rateLimit !== undefined && { rateLimit: input.rateLimit }), + ...(input.burstLimit !== undefined && input.burstLimit !== null && { burstLimit: input.burstLimit }), + ...(input.rateLimit !== undefined && input.rateLimit !== null && { rateLimit: input.rateLimit }), }; }; const serializeAws_restJson1TlsConfig = (input: TlsConfig, context: __SerdeContext): any => { return { - ...(input.insecureSkipVerification !== undefined && { insecureSkipVerification: input.insecureSkipVerification }), + ...(input.insecureSkipVerification !== undefined && + input.insecureSkipVerification !== null && { insecureSkipVerification: input.insecureSkipVerification }), }; }; @@ -17300,239 +17314,434 @@ const deserializeAws_restJson1IntegrationResponse = (output: any, context: __Ser }; const deserializeAws_restJson1ListOfApiKey = (output: any, context: __SerdeContext): ApiKey[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ApiKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ApiKey(entry, context); + }); }; const deserializeAws_restJson1ListOfApiStage = (output: any, context: __SerdeContext): ApiStage[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ApiStage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ApiStage(entry, context); + }); }; const deserializeAws_restJson1ListOfARNs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOfAuthorizer = (output: any, context: __SerdeContext): Authorizer[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Authorizer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Authorizer(entry, context); + }); }; const deserializeAws_restJson1ListOfBasePathMapping = (output: any, context: __SerdeContext): BasePathMapping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BasePathMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BasePathMapping(entry, context); + }); }; const deserializeAws_restJson1ListOfClientCertificate = (output: any, context: __SerdeContext): ClientCertificate[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ClientCertificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ClientCertificate(entry, context); + }); }; const deserializeAws_restJson1ListOfDeployment = (output: any, context: __SerdeContext): Deployment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Deployment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Deployment(entry, context); + }); }; const deserializeAws_restJson1ListOfDocumentationPart = (output: any, context: __SerdeContext): DocumentationPart[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DocumentationPart(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DocumentationPart(entry, context); + }); }; const deserializeAws_restJson1ListOfDocumentationVersion = ( output: any, context: __SerdeContext ): DocumentationVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DocumentationVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DocumentationVersion(entry, context); + }); }; const deserializeAws_restJson1ListOfDomainName = (output: any, context: __SerdeContext): DomainName[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainName(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainName(entry, context); + }); }; const deserializeAws_restJson1ListOfEndpointType = ( output: any, context: __SerdeContext ): (EndpointType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOfGatewayResponse = (output: any, context: __SerdeContext): GatewayResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GatewayResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GatewayResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfLong = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOfModel = (output: any, context: __SerdeContext): Model[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Model(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Model(entry, context); + }); }; const deserializeAws_restJson1ListOfRequestValidator = (output: any, context: __SerdeContext): RequestValidator[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RequestValidator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RequestValidator(entry, context); + }); }; const deserializeAws_restJson1ListOfResource = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Resource(entry, context); + }); }; const deserializeAws_restJson1ListOfRestApi = (output: any, context: __SerdeContext): RestApi[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RestApi(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RestApi(entry, context); + }); }; const deserializeAws_restJson1ListOfSdkConfigurationProperty = ( output: any, context: __SerdeContext ): SdkConfigurationProperty[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SdkConfigurationProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SdkConfigurationProperty(entry, context); + }); }; const deserializeAws_restJson1ListOfSdkType = (output: any, context: __SerdeContext): SdkType[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SdkType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SdkType(entry, context); + }); }; const deserializeAws_restJson1ListOfStage = (output: any, context: __SerdeContext): Stage[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Stage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Stage(entry, context); + }); }; const deserializeAws_restJson1ListOfString = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOfUsage = (output: any, context: __SerdeContext): number[][] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ListOfLong(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ListOfLong(entry, context); + }); }; const deserializeAws_restJson1ListOfUsagePlan = (output: any, context: __SerdeContext): UsagePlan[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UsagePlan(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UsagePlan(entry, context); + }); }; const deserializeAws_restJson1ListOfUsagePlanKey = (output: any, context: __SerdeContext): UsagePlanKey[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UsagePlanKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UsagePlanKey(entry, context); + }); }; const deserializeAws_restJson1ListOfVpcLink = (output: any, context: __SerdeContext): VpcLink[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VpcLink(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VpcLink(entry, context); + }); }; const deserializeAws_restJson1MapOfApiStageThrottleSettings = ( output: any, context: __SerdeContext ): { [key: string]: ThrottleSettings } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ThrottleSettings }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ThrottleSettings }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ThrottleSettings(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfIntegrationResponse = ( output: any, context: __SerdeContext ): { [key: string]: IntegrationResponse } => { - return Object.entries(output).reduce( - (acc: { [key: string]: IntegrationResponse }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: IntegrationResponse }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1IntegrationResponse(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfKeyUsages = ( output: any, context: __SerdeContext ): { [key: string]: number[][] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number[][] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number[][] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ListOfUsage(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfMethod = (output: any, context: __SerdeContext): { [key: string]: Method } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Method }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Method }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1Method(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfMethodResponse = ( output: any, context: __SerdeContext ): { [key: string]: MethodResponse } => { - return Object.entries(output).reduce( - (acc: { [key: string]: MethodResponse }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: MethodResponse }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1MethodResponse(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfMethodSettings = ( output: any, context: __SerdeContext ): { [key: string]: MethodSetting } => { - return Object.entries(output).reduce( - (acc: { [key: string]: MethodSetting }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: MethodSetting }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1MethodSetting(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfMethodSnapshot = ( output: any, context: __SerdeContext ): { [key: string]: MethodSnapshot } => { - return Object.entries(output).reduce( - (acc: { [key: string]: MethodSnapshot }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: MethodSnapshot }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1MethodSnapshot(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfStringToBoolean = ( output: any, context: __SerdeContext ): { [key: string]: boolean } => { - return Object.entries(output).reduce( - (acc: { [key: string]: boolean }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: boolean }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfStringToList = ( output: any, context: __SerdeContext ): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ListOfString(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfStringToString = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Method = (output: any, context: __SerdeContext): Method => { @@ -17669,10 +17878,15 @@ const deserializeAws_restJson1PathToMapOfMethodSnapshot = ( context: __SerdeContext ): { [key: string]: { [key: string]: MethodSnapshot } } => { return Object.entries(output).reduce( - (acc: { [key: string]: { [key: string]: MethodSnapshot } }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1MapOfMethodSnapshot(value, context), - }), + (acc: { [key: string]: { [key: string]: MethodSnapshot } }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1MapOfMethodSnapshot(value, context), + }; + }, {} ); }; @@ -17923,6 +18137,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-apigatewaymanagementapi/protocols/Aws_restJson1.ts b/clients/client-apigatewaymanagementapi/protocols/Aws_restJson1.ts index 6f02eb0d3e6c..09e41bc4c3eb 100644 --- a/clients/client-apigatewaymanagementapi/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewaymanagementapi/protocols/Aws_restJson1.ts @@ -24,9 +24,7 @@ export const serializeAws_restJson1DeleteConnectionCommand = async ( input: DeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/@connections/{ConnectionId}"; if (input.ConnectionId !== undefined) { const labelValue: string = input.ConnectionId; @@ -54,9 +52,7 @@ export const serializeAws_restJson1GetConnectionCommand = async ( input: GetConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/@connections/{ConnectionId}"; if (input.ConnectionId !== undefined) { const labelValue: string = input.ConnectionId; @@ -85,7 +81,7 @@ export const serializeAws_restJson1PostToConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", }; let resolvedPath = "/@connections/{ConnectionId}"; if (input.ConnectionId !== undefined) { @@ -417,6 +413,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-apigatewayv2/protocols/Aws_restJson1.ts b/clients/client-apigatewayv2/protocols/Aws_restJson1.ts index b7433a079187..ea0c062e040b 100644 --- a/clients/client-apigatewayv2/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewayv2/protocols/Aws_restJson1.ts @@ -155,30 +155,32 @@ export const serializeAws_restJson1CreateApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis"; let body: any; body = JSON.stringify({ - ...(input.ApiKeySelectionExpression !== undefined && { - apiKeySelectionExpression: input.ApiKeySelectionExpression, - }), - ...(input.CorsConfiguration !== undefined && { - corsConfiguration: serializeAws_restJson1Cors(input.CorsConfiguration, context), - }), - ...(input.CredentialsArn !== undefined && { credentialsArn: input.CredentialsArn }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.DisableExecuteApiEndpoint !== undefined && { - disableExecuteApiEndpoint: input.DisableExecuteApiEndpoint, - }), - ...(input.DisableSchemaValidation !== undefined && { disableSchemaValidation: input.DisableSchemaValidation }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.ProtocolType !== undefined && { protocolType: input.ProtocolType }), - ...(input.RouteKey !== undefined && { routeKey: input.RouteKey }), - ...(input.RouteSelectionExpression !== undefined && { routeSelectionExpression: input.RouteSelectionExpression }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.Target !== undefined && { target: input.Target }), - ...(input.Version !== undefined && { version: input.Version }), + ...(input.ApiKeySelectionExpression !== undefined && + input.ApiKeySelectionExpression !== null && { apiKeySelectionExpression: input.ApiKeySelectionExpression }), + ...(input.CorsConfiguration !== undefined && + input.CorsConfiguration !== null && { + corsConfiguration: serializeAws_restJson1Cors(input.CorsConfiguration, context), + }), + ...(input.CredentialsArn !== undefined && + input.CredentialsArn !== null && { credentialsArn: input.CredentialsArn }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.DisableExecuteApiEndpoint !== undefined && + input.DisableExecuteApiEndpoint !== null && { disableExecuteApiEndpoint: input.DisableExecuteApiEndpoint }), + ...(input.DisableSchemaValidation !== undefined && + input.DisableSchemaValidation !== null && { disableSchemaValidation: input.DisableSchemaValidation }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.ProtocolType !== undefined && input.ProtocolType !== null && { protocolType: input.ProtocolType }), + ...(input.RouteKey !== undefined && input.RouteKey !== null && { routeKey: input.RouteKey }), + ...(input.RouteSelectionExpression !== undefined && + input.RouteSelectionExpression !== null && { routeSelectionExpression: input.RouteSelectionExpression }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Target !== undefined && input.Target !== null && { target: input.Target }), + ...(input.Version !== undefined && input.Version !== null && { version: input.Version }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -197,7 +199,7 @@ export const serializeAws_restJson1CreateApiMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/domainnames/{DomainName}/apimappings"; if (input.DomainName !== undefined) { @@ -211,9 +213,9 @@ export const serializeAws_restJson1CreateApiMappingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ApiId !== undefined && { apiId: input.ApiId }), - ...(input.ApiMappingKey !== undefined && { apiMappingKey: input.ApiMappingKey }), - ...(input.Stage !== undefined && { stage: input.Stage }), + ...(input.ApiId !== undefined && input.ApiId !== null && { apiId: input.ApiId }), + ...(input.ApiMappingKey !== undefined && input.ApiMappingKey !== null && { apiMappingKey: input.ApiMappingKey }), + ...(input.Stage !== undefined && input.Stage !== null && { stage: input.Stage }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -232,7 +234,7 @@ export const serializeAws_restJson1CreateAuthorizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/authorizers"; if (input.ApiId !== undefined) { @@ -246,26 +248,34 @@ export const serializeAws_restJson1CreateAuthorizerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AuthorizerCredentialsArn !== undefined && { authorizerCredentialsArn: input.AuthorizerCredentialsArn }), - ...(input.AuthorizerPayloadFormatVersion !== undefined && { - authorizerPayloadFormatVersion: input.AuthorizerPayloadFormatVersion, - }), - ...(input.AuthorizerResultTtlInSeconds !== undefined && { - authorizerResultTtlInSeconds: input.AuthorizerResultTtlInSeconds, - }), - ...(input.AuthorizerType !== undefined && { authorizerType: input.AuthorizerType }), - ...(input.AuthorizerUri !== undefined && { authorizerUri: input.AuthorizerUri }), - ...(input.EnableSimpleResponses !== undefined && { enableSimpleResponses: input.EnableSimpleResponses }), - ...(input.IdentitySource !== undefined && { - identitySource: serializeAws_restJson1IdentitySourceList(input.IdentitySource, context), - }), - ...(input.IdentityValidationExpression !== undefined && { - identityValidationExpression: input.IdentityValidationExpression, - }), - ...(input.JwtConfiguration !== undefined && { - jwtConfiguration: serializeAws_restJson1JWTConfiguration(input.JwtConfiguration, context), - }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.AuthorizerCredentialsArn !== undefined && + input.AuthorizerCredentialsArn !== null && { authorizerCredentialsArn: input.AuthorizerCredentialsArn }), + ...(input.AuthorizerPayloadFormatVersion !== undefined && + input.AuthorizerPayloadFormatVersion !== null && { + authorizerPayloadFormatVersion: input.AuthorizerPayloadFormatVersion, + }), + ...(input.AuthorizerResultTtlInSeconds !== undefined && + input.AuthorizerResultTtlInSeconds !== null && { + authorizerResultTtlInSeconds: input.AuthorizerResultTtlInSeconds, + }), + ...(input.AuthorizerType !== undefined && + input.AuthorizerType !== null && { authorizerType: input.AuthorizerType }), + ...(input.AuthorizerUri !== undefined && input.AuthorizerUri !== null && { authorizerUri: input.AuthorizerUri }), + ...(input.EnableSimpleResponses !== undefined && + input.EnableSimpleResponses !== null && { enableSimpleResponses: input.EnableSimpleResponses }), + ...(input.IdentitySource !== undefined && + input.IdentitySource !== null && { + identitySource: serializeAws_restJson1IdentitySourceList(input.IdentitySource, context), + }), + ...(input.IdentityValidationExpression !== undefined && + input.IdentityValidationExpression !== null && { + identityValidationExpression: input.IdentityValidationExpression, + }), + ...(input.JwtConfiguration !== undefined && + input.JwtConfiguration !== null && { + jwtConfiguration: serializeAws_restJson1JWTConfiguration(input.JwtConfiguration, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -284,7 +294,7 @@ export const serializeAws_restJson1CreateDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/deployments"; if (input.ApiId !== undefined) { @@ -298,8 +308,8 @@ export const serializeAws_restJson1CreateDeploymentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { description: input.Description }), - ...(input.StageName !== undefined && { stageName: input.StageName }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.StageName !== undefined && input.StageName !== null && { stageName: input.StageName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -318,22 +328,27 @@ export const serializeAws_restJson1CreateDomainNameCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/domainnames"; let body: any; body = JSON.stringify({ - ...(input.DomainName !== undefined && { domainName: input.DomainName }), - ...(input.DomainNameConfigurations !== undefined && { - domainNameConfigurations: serializeAws_restJson1DomainNameConfigurations(input.DomainNameConfigurations, context), - }), - ...(input.MutualTlsAuthentication !== undefined && { - mutualTlsAuthentication: serializeAws_restJson1MutualTlsAuthenticationInput( - input.MutualTlsAuthentication, - context - ), - }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.DomainName !== undefined && input.DomainName !== null && { domainName: input.DomainName }), + ...(input.DomainNameConfigurations !== undefined && + input.DomainNameConfigurations !== null && { + domainNameConfigurations: serializeAws_restJson1DomainNameConfigurations( + input.DomainNameConfigurations, + context + ), + }), + ...(input.MutualTlsAuthentication !== undefined && + input.MutualTlsAuthentication !== null && { + mutualTlsAuthentication: serializeAws_restJson1MutualTlsAuthenticationInput( + input.MutualTlsAuthentication, + context + ), + }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -352,7 +367,7 @@ export const serializeAws_restJson1CreateIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/integrations"; if (input.ApiId !== undefined) { @@ -366,28 +381,40 @@ export const serializeAws_restJson1CreateIntegrationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConnectionId !== undefined && { connectionId: input.ConnectionId }), - ...(input.ConnectionType !== undefined && { connectionType: input.ConnectionType }), - ...(input.ContentHandlingStrategy !== undefined && { contentHandlingStrategy: input.ContentHandlingStrategy }), - ...(input.CredentialsArn !== undefined && { credentialsArn: input.CredentialsArn }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.IntegrationMethod !== undefined && { integrationMethod: input.IntegrationMethod }), - ...(input.IntegrationSubtype !== undefined && { integrationSubtype: input.IntegrationSubtype }), - ...(input.IntegrationType !== undefined && { integrationType: input.IntegrationType }), - ...(input.IntegrationUri !== undefined && { integrationUri: input.IntegrationUri }), - ...(input.PassthroughBehavior !== undefined && { passthroughBehavior: input.PassthroughBehavior }), - ...(input.PayloadFormatVersion !== undefined && { payloadFormatVersion: input.PayloadFormatVersion }), - ...(input.RequestParameters !== undefined && { - requestParameters: serializeAws_restJson1IntegrationParameters(input.RequestParameters, context), - }), - ...(input.RequestTemplates !== undefined && { - requestTemplates: serializeAws_restJson1TemplateMap(input.RequestTemplates, context), - }), - ...(input.TemplateSelectionExpression !== undefined && { - templateSelectionExpression: input.TemplateSelectionExpression, - }), - ...(input.TimeoutInMillis !== undefined && { timeoutInMillis: input.TimeoutInMillis }), - ...(input.TlsConfig !== undefined && { tlsConfig: serializeAws_restJson1TlsConfigInput(input.TlsConfig, context) }), + ...(input.ConnectionId !== undefined && input.ConnectionId !== null && { connectionId: input.ConnectionId }), + ...(input.ConnectionType !== undefined && + input.ConnectionType !== null && { connectionType: input.ConnectionType }), + ...(input.ContentHandlingStrategy !== undefined && + input.ContentHandlingStrategy !== null && { contentHandlingStrategy: input.ContentHandlingStrategy }), + ...(input.CredentialsArn !== undefined && + input.CredentialsArn !== null && { credentialsArn: input.CredentialsArn }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.IntegrationMethod !== undefined && + input.IntegrationMethod !== null && { integrationMethod: input.IntegrationMethod }), + ...(input.IntegrationSubtype !== undefined && + input.IntegrationSubtype !== null && { integrationSubtype: input.IntegrationSubtype }), + ...(input.IntegrationType !== undefined && + input.IntegrationType !== null && { integrationType: input.IntegrationType }), + ...(input.IntegrationUri !== undefined && + input.IntegrationUri !== null && { integrationUri: input.IntegrationUri }), + ...(input.PassthroughBehavior !== undefined && + input.PassthroughBehavior !== null && { passthroughBehavior: input.PassthroughBehavior }), + ...(input.PayloadFormatVersion !== undefined && + input.PayloadFormatVersion !== null && { payloadFormatVersion: input.PayloadFormatVersion }), + ...(input.RequestParameters !== undefined && + input.RequestParameters !== null && { + requestParameters: serializeAws_restJson1IntegrationParameters(input.RequestParameters, context), + }), + ...(input.RequestTemplates !== undefined && + input.RequestTemplates !== null && { + requestTemplates: serializeAws_restJson1TemplateMap(input.RequestTemplates, context), + }), + ...(input.TemplateSelectionExpression !== undefined && + input.TemplateSelectionExpression !== null && { templateSelectionExpression: input.TemplateSelectionExpression }), + ...(input.TimeoutInMillis !== undefined && + input.TimeoutInMillis !== null && { timeoutInMillis: input.TimeoutInMillis }), + ...(input.TlsConfig !== undefined && + input.TlsConfig !== null && { tlsConfig: serializeAws_restJson1TlsConfigInput(input.TlsConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -406,7 +433,7 @@ export const serializeAws_restJson1CreateIntegrationResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/integrations/{IntegrationId}/integrationresponses"; if (input.ApiId !== undefined) { @@ -429,17 +456,20 @@ export const serializeAws_restJson1CreateIntegrationResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ContentHandlingStrategy !== undefined && { contentHandlingStrategy: input.ContentHandlingStrategy }), - ...(input.IntegrationResponseKey !== undefined && { integrationResponseKey: input.IntegrationResponseKey }), - ...(input.ResponseParameters !== undefined && { - responseParameters: serializeAws_restJson1IntegrationParameters(input.ResponseParameters, context), - }), - ...(input.ResponseTemplates !== undefined && { - responseTemplates: serializeAws_restJson1TemplateMap(input.ResponseTemplates, context), - }), - ...(input.TemplateSelectionExpression !== undefined && { - templateSelectionExpression: input.TemplateSelectionExpression, - }), + ...(input.ContentHandlingStrategy !== undefined && + input.ContentHandlingStrategy !== null && { contentHandlingStrategy: input.ContentHandlingStrategy }), + ...(input.IntegrationResponseKey !== undefined && + input.IntegrationResponseKey !== null && { integrationResponseKey: input.IntegrationResponseKey }), + ...(input.ResponseParameters !== undefined && + input.ResponseParameters !== null && { + responseParameters: serializeAws_restJson1IntegrationParameters(input.ResponseParameters, context), + }), + ...(input.ResponseTemplates !== undefined && + input.ResponseTemplates !== null && { + responseTemplates: serializeAws_restJson1TemplateMap(input.ResponseTemplates, context), + }), + ...(input.TemplateSelectionExpression !== undefined && + input.TemplateSelectionExpression !== null && { templateSelectionExpression: input.TemplateSelectionExpression }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -458,7 +488,7 @@ export const serializeAws_restJson1CreateModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/models"; if (input.ApiId !== undefined) { @@ -472,10 +502,10 @@ export const serializeAws_restJson1CreateModelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ContentType !== undefined && { contentType: input.ContentType }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Schema !== undefined && { schema: input.Schema }), + ...(input.ContentType !== undefined && input.ContentType !== null && { contentType: input.ContentType }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Schema !== undefined && input.Schema !== null && { schema: input.Schema }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -494,7 +524,7 @@ export const serializeAws_restJson1CreateRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/routes"; if (input.ApiId !== undefined) { @@ -508,25 +538,32 @@ export const serializeAws_restJson1CreateRouteCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ApiKeyRequired !== undefined && { apiKeyRequired: input.ApiKeyRequired }), - ...(input.AuthorizationScopes !== undefined && { - authorizationScopes: serializeAws_restJson1AuthorizationScopes(input.AuthorizationScopes, context), - }), - ...(input.AuthorizationType !== undefined && { authorizationType: input.AuthorizationType }), - ...(input.AuthorizerId !== undefined && { authorizerId: input.AuthorizerId }), - ...(input.ModelSelectionExpression !== undefined && { modelSelectionExpression: input.ModelSelectionExpression }), - ...(input.OperationName !== undefined && { operationName: input.OperationName }), - ...(input.RequestModels !== undefined && { - requestModels: serializeAws_restJson1RouteModels(input.RequestModels, context), - }), - ...(input.RequestParameters !== undefined && { - requestParameters: serializeAws_restJson1RouteParameters(input.RequestParameters, context), - }), - ...(input.RouteKey !== undefined && { routeKey: input.RouteKey }), - ...(input.RouteResponseSelectionExpression !== undefined && { - routeResponseSelectionExpression: input.RouteResponseSelectionExpression, - }), - ...(input.Target !== undefined && { target: input.Target }), + ...(input.ApiKeyRequired !== undefined && + input.ApiKeyRequired !== null && { apiKeyRequired: input.ApiKeyRequired }), + ...(input.AuthorizationScopes !== undefined && + input.AuthorizationScopes !== null && { + authorizationScopes: serializeAws_restJson1AuthorizationScopes(input.AuthorizationScopes, context), + }), + ...(input.AuthorizationType !== undefined && + input.AuthorizationType !== null && { authorizationType: input.AuthorizationType }), + ...(input.AuthorizerId !== undefined && input.AuthorizerId !== null && { authorizerId: input.AuthorizerId }), + ...(input.ModelSelectionExpression !== undefined && + input.ModelSelectionExpression !== null && { modelSelectionExpression: input.ModelSelectionExpression }), + ...(input.OperationName !== undefined && input.OperationName !== null && { operationName: input.OperationName }), + ...(input.RequestModels !== undefined && + input.RequestModels !== null && { + requestModels: serializeAws_restJson1RouteModels(input.RequestModels, context), + }), + ...(input.RequestParameters !== undefined && + input.RequestParameters !== null && { + requestParameters: serializeAws_restJson1RouteParameters(input.RequestParameters, context), + }), + ...(input.RouteKey !== undefined && input.RouteKey !== null && { routeKey: input.RouteKey }), + ...(input.RouteResponseSelectionExpression !== undefined && + input.RouteResponseSelectionExpression !== null && { + routeResponseSelectionExpression: input.RouteResponseSelectionExpression, + }), + ...(input.Target !== undefined && input.Target !== null && { target: input.Target }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -545,7 +582,7 @@ export const serializeAws_restJson1CreateRouteResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/routes/{RouteId}/routeresponses"; if (input.ApiId !== undefined) { @@ -568,14 +605,18 @@ export const serializeAws_restJson1CreateRouteResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ModelSelectionExpression !== undefined && { modelSelectionExpression: input.ModelSelectionExpression }), - ...(input.ResponseModels !== undefined && { - responseModels: serializeAws_restJson1RouteModels(input.ResponseModels, context), - }), - ...(input.ResponseParameters !== undefined && { - responseParameters: serializeAws_restJson1RouteParameters(input.ResponseParameters, context), - }), - ...(input.RouteResponseKey !== undefined && { routeResponseKey: input.RouteResponseKey }), + ...(input.ModelSelectionExpression !== undefined && + input.ModelSelectionExpression !== null && { modelSelectionExpression: input.ModelSelectionExpression }), + ...(input.ResponseModels !== undefined && + input.ResponseModels !== null && { + responseModels: serializeAws_restJson1RouteModels(input.ResponseModels, context), + }), + ...(input.ResponseParameters !== undefined && + input.ResponseParameters !== null && { + responseParameters: serializeAws_restJson1RouteParameters(input.ResponseParameters, context), + }), + ...(input.RouteResponseKey !== undefined && + input.RouteResponseKey !== null && { routeResponseKey: input.RouteResponseKey }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -594,7 +635,7 @@ export const serializeAws_restJson1CreateStageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/stages"; if (input.ApiId !== undefined) { @@ -608,24 +649,29 @@ export const serializeAws_restJson1CreateStageCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccessLogSettings !== undefined && { - accessLogSettings: serializeAws_restJson1AccessLogSettings(input.AccessLogSettings, context), - }), - ...(input.AutoDeploy !== undefined && { autoDeploy: input.AutoDeploy }), - ...(input.ClientCertificateId !== undefined && { clientCertificateId: input.ClientCertificateId }), - ...(input.DefaultRouteSettings !== undefined && { - defaultRouteSettings: serializeAws_restJson1RouteSettings(input.DefaultRouteSettings, context), - }), - ...(input.DeploymentId !== undefined && { deploymentId: input.DeploymentId }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.RouteSettings !== undefined && { - routeSettings: serializeAws_restJson1RouteSettingsMap(input.RouteSettings, context), - }), - ...(input.StageName !== undefined && { stageName: input.StageName }), - ...(input.StageVariables !== undefined && { - stageVariables: serializeAws_restJson1StageVariablesMap(input.StageVariables, context), - }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.AccessLogSettings !== undefined && + input.AccessLogSettings !== null && { + accessLogSettings: serializeAws_restJson1AccessLogSettings(input.AccessLogSettings, context), + }), + ...(input.AutoDeploy !== undefined && input.AutoDeploy !== null && { autoDeploy: input.AutoDeploy }), + ...(input.ClientCertificateId !== undefined && + input.ClientCertificateId !== null && { clientCertificateId: input.ClientCertificateId }), + ...(input.DefaultRouteSettings !== undefined && + input.DefaultRouteSettings !== null && { + defaultRouteSettings: serializeAws_restJson1RouteSettings(input.DefaultRouteSettings, context), + }), + ...(input.DeploymentId !== undefined && input.DeploymentId !== null && { deploymentId: input.DeploymentId }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.RouteSettings !== undefined && + input.RouteSettings !== null && { + routeSettings: serializeAws_restJson1RouteSettingsMap(input.RouteSettings, context), + }), + ...(input.StageName !== undefined && input.StageName !== null && { stageName: input.StageName }), + ...(input.StageVariables !== undefined && + input.StageVariables !== null && { + stageVariables: serializeAws_restJson1StageVariablesMap(input.StageVariables, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -644,17 +690,19 @@ export const serializeAws_restJson1CreateVpcLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/vpclinks"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { name: input.Name }), - ...(input.SecurityGroupIds !== undefined && { - securityGroupIds: serializeAws_restJson1SecurityGroupIdList(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { subnetIds: serializeAws_restJson1SubnetIdList(input.SubnetIds, context) }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + securityGroupIds: serializeAws_restJson1SecurityGroupIdList(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { subnetIds: serializeAws_restJson1SubnetIdList(input.SubnetIds, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -672,9 +720,7 @@ export const serializeAws_restJson1DeleteAccessLogSettingsCommand = async ( input: DeleteAccessLogSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/stages/{StageName}/accesslogsettings"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -711,9 +757,7 @@ export const serializeAws_restJson1DeleteApiCommand = async ( input: DeleteApiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -741,9 +785,7 @@ export const serializeAws_restJson1DeleteApiMappingCommand = async ( input: DeleteApiMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/domainnames/{DomainName}/apimappings/{ApiMappingId}"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -780,9 +822,7 @@ export const serializeAws_restJson1DeleteAuthorizerCommand = async ( input: DeleteAuthorizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/authorizers/{AuthorizerId}"; if (input.AuthorizerId !== undefined) { const labelValue: string = input.AuthorizerId; @@ -819,9 +859,7 @@ export const serializeAws_restJson1DeleteCorsConfigurationCommand = async ( input: DeleteCorsConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/cors"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -849,9 +887,7 @@ export const serializeAws_restJson1DeleteDeploymentCommand = async ( input: DeleteDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/deployments/{DeploymentId}"; if (input.DeploymentId !== undefined) { const labelValue: string = input.DeploymentId; @@ -888,9 +924,7 @@ export const serializeAws_restJson1DeleteDomainNameCommand = async ( input: DeleteDomainNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/domainnames/{DomainName}"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -918,9 +952,7 @@ export const serializeAws_restJson1DeleteIntegrationCommand = async ( input: DeleteIntegrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/integrations/{IntegrationId}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -957,9 +989,7 @@ export const serializeAws_restJson1DeleteIntegrationResponseCommand = async ( input: DeleteIntegrationResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/integrations/{IntegrationId}/integrationresponses/{IntegrationResponseId}"; if (input.IntegrationId !== undefined) { const labelValue: string = input.IntegrationId; @@ -1005,9 +1035,7 @@ export const serializeAws_restJson1DeleteModelCommand = async ( input: DeleteModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/models/{ModelId}"; if (input.ModelId !== undefined) { const labelValue: string = input.ModelId; @@ -1044,9 +1072,7 @@ export const serializeAws_restJson1DeleteRouteCommand = async ( input: DeleteRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/routes/{RouteId}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1083,9 +1109,7 @@ export const serializeAws_restJson1DeleteRouteRequestParameterCommand = async ( input: DeleteRouteRequestParameterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/routes/{RouteId}/requestparameters/{RequestParameterKey}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1131,9 +1155,7 @@ export const serializeAws_restJson1DeleteRouteResponseCommand = async ( input: DeleteRouteResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/routes/{RouteId}/routeresponses/{RouteResponseId}"; if (input.RouteId !== undefined) { const labelValue: string = input.RouteId; @@ -1179,9 +1201,7 @@ export const serializeAws_restJson1DeleteRouteSettingsCommand = async ( input: DeleteRouteSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/stages/{StageName}/routesettings/{RouteKey}"; if (input.RouteKey !== undefined) { const labelValue: string = input.RouteKey; @@ -1227,9 +1247,7 @@ export const serializeAws_restJson1DeleteStageCommand = async ( input: DeleteStageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/stages/{StageName}"; if (input.StageName !== undefined) { const labelValue: string = input.StageName; @@ -1266,9 +1284,7 @@ export const serializeAws_restJson1DeleteVpcLinkCommand = async ( input: DeleteVpcLinkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/vpclinks/{VpcLinkId}"; if (input.VpcLinkId !== undefined) { const labelValue: string = input.VpcLinkId; @@ -1296,9 +1312,7 @@ export const serializeAws_restJson1ExportApiCommand = async ( input: ExportApiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/exports/{Specification}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1342,9 +1356,7 @@ export const serializeAws_restJson1GetApiCommand = async ( input: GetApiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1372,9 +1384,7 @@ export const serializeAws_restJson1GetApiMappingCommand = async ( input: GetApiMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/domainnames/{DomainName}/apimappings/{ApiMappingId}"; if (input.ApiMappingId !== undefined) { const labelValue: string = input.ApiMappingId; @@ -1411,9 +1421,7 @@ export const serializeAws_restJson1GetApiMappingsCommand = async ( input: GetApiMappingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/domainnames/{DomainName}/apimappings"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -1446,9 +1454,7 @@ export const serializeAws_restJson1GetApisCommand = async ( input: GetApisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1472,9 +1478,7 @@ export const serializeAws_restJson1GetAuthorizerCommand = async ( input: GetAuthorizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/authorizers/{AuthorizerId}"; if (input.AuthorizerId !== undefined) { const labelValue: string = input.AuthorizerId; @@ -1511,9 +1515,7 @@ export const serializeAws_restJson1GetAuthorizersCommand = async ( input: GetAuthorizersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/authorizers"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1546,9 +1548,7 @@ export const serializeAws_restJson1GetDeploymentCommand = async ( input: GetDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/deployments/{DeploymentId}"; if (input.DeploymentId !== undefined) { const labelValue: string = input.DeploymentId; @@ -1585,9 +1585,7 @@ export const serializeAws_restJson1GetDeploymentsCommand = async ( input: GetDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/deployments"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1620,9 +1618,7 @@ export const serializeAws_restJson1GetDomainNameCommand = async ( input: GetDomainNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/domainnames/{DomainName}"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -1650,9 +1646,7 @@ export const serializeAws_restJson1GetDomainNamesCommand = async ( input: GetDomainNamesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/domainnames"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1676,9 +1670,7 @@ export const serializeAws_restJson1GetIntegrationCommand = async ( input: GetIntegrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/integrations/{IntegrationId}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1715,9 +1707,7 @@ export const serializeAws_restJson1GetIntegrationResponseCommand = async ( input: GetIntegrationResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/integrations/{IntegrationId}/integrationresponses/{IntegrationResponseId}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1763,9 +1753,7 @@ export const serializeAws_restJson1GetIntegrationResponsesCommand = async ( input: GetIntegrationResponsesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/integrations/{IntegrationId}/integrationresponses"; if (input.IntegrationId !== undefined) { const labelValue: string = input.IntegrationId; @@ -1807,9 +1795,7 @@ export const serializeAws_restJson1GetIntegrationsCommand = async ( input: GetIntegrationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/integrations"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1842,9 +1828,7 @@ export const serializeAws_restJson1GetModelCommand = async ( input: GetModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/models/{ModelId}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1881,9 +1865,7 @@ export const serializeAws_restJson1GetModelsCommand = async ( input: GetModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/models"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1916,9 +1898,7 @@ export const serializeAws_restJson1GetModelTemplateCommand = async ( input: GetModelTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/models/{ModelId}/template"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1955,9 +1935,7 @@ export const serializeAws_restJson1GetRouteCommand = async ( input: GetRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/routes/{RouteId}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -1994,9 +1972,7 @@ export const serializeAws_restJson1GetRouteResponseCommand = async ( input: GetRouteResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/routes/{RouteId}/routeresponses/{RouteResponseId}"; if (input.RouteId !== undefined) { const labelValue: string = input.RouteId; @@ -2042,9 +2018,7 @@ export const serializeAws_restJson1GetRouteResponsesCommand = async ( input: GetRouteResponsesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/routes/{RouteId}/routeresponses"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -2086,9 +2060,7 @@ export const serializeAws_restJson1GetRoutesCommand = async ( input: GetRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/routes"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -2121,9 +2093,7 @@ export const serializeAws_restJson1GetStageCommand = async ( input: GetStageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/stages/{StageName}"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -2160,9 +2130,7 @@ export const serializeAws_restJson1GetStagesCommand = async ( input: GetStagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/stages"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -2195,9 +2163,7 @@ export const serializeAws_restJson1GetTagsCommand = async ( input: GetTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -2225,9 +2191,7 @@ export const serializeAws_restJson1GetVpcLinkCommand = async ( input: GetVpcLinkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/vpclinks/{VpcLinkId}"; if (input.VpcLinkId !== undefined) { const labelValue: string = input.VpcLinkId; @@ -2255,9 +2219,7 @@ export const serializeAws_restJson1GetVpcLinksCommand = async ( input: GetVpcLinksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/vpclinks"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults }), @@ -2282,7 +2244,7 @@ export const serializeAws_restJson1ImportApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis"; const query: any = { @@ -2291,7 +2253,7 @@ export const serializeAws_restJson1ImportApiCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Body !== undefined && { body: input.Body }), + ...(input.Body !== undefined && input.Body !== null && { body: input.Body }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2311,7 +2273,7 @@ export const serializeAws_restJson1ReimportApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}"; if (input.ApiId !== undefined) { @@ -2329,7 +2291,7 @@ export const serializeAws_restJson1ReimportApiCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Body !== undefined && { body: input.Body }), + ...(input.Body !== undefined && input.Body !== null && { body: input.Body }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2348,9 +2310,7 @@ export const serializeAws_restJson1ResetAuthorizersCacheCommand = async ( input: ResetAuthorizersCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/apis/{ApiId}/stages/{StageName}/cache/authorizers"; if (input.ApiId !== undefined) { const labelValue: string = input.ApiId; @@ -2388,7 +2348,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -2402,7 +2362,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2420,9 +2380,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -2455,7 +2413,7 @@ export const serializeAws_restJson1UpdateApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}"; if (input.ApiId !== undefined) { @@ -2469,23 +2427,25 @@ export const serializeAws_restJson1UpdateApiCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ApiKeySelectionExpression !== undefined && { - apiKeySelectionExpression: input.ApiKeySelectionExpression, - }), - ...(input.CorsConfiguration !== undefined && { - corsConfiguration: serializeAws_restJson1Cors(input.CorsConfiguration, context), - }), - ...(input.CredentialsArn !== undefined && { credentialsArn: input.CredentialsArn }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.DisableExecuteApiEndpoint !== undefined && { - disableExecuteApiEndpoint: input.DisableExecuteApiEndpoint, - }), - ...(input.DisableSchemaValidation !== undefined && { disableSchemaValidation: input.DisableSchemaValidation }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.RouteKey !== undefined && { routeKey: input.RouteKey }), - ...(input.RouteSelectionExpression !== undefined && { routeSelectionExpression: input.RouteSelectionExpression }), - ...(input.Target !== undefined && { target: input.Target }), - ...(input.Version !== undefined && { version: input.Version }), + ...(input.ApiKeySelectionExpression !== undefined && + input.ApiKeySelectionExpression !== null && { apiKeySelectionExpression: input.ApiKeySelectionExpression }), + ...(input.CorsConfiguration !== undefined && + input.CorsConfiguration !== null && { + corsConfiguration: serializeAws_restJson1Cors(input.CorsConfiguration, context), + }), + ...(input.CredentialsArn !== undefined && + input.CredentialsArn !== null && { credentialsArn: input.CredentialsArn }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.DisableExecuteApiEndpoint !== undefined && + input.DisableExecuteApiEndpoint !== null && { disableExecuteApiEndpoint: input.DisableExecuteApiEndpoint }), + ...(input.DisableSchemaValidation !== undefined && + input.DisableSchemaValidation !== null && { disableSchemaValidation: input.DisableSchemaValidation }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.RouteKey !== undefined && input.RouteKey !== null && { routeKey: input.RouteKey }), + ...(input.RouteSelectionExpression !== undefined && + input.RouteSelectionExpression !== null && { routeSelectionExpression: input.RouteSelectionExpression }), + ...(input.Target !== undefined && input.Target !== null && { target: input.Target }), + ...(input.Version !== undefined && input.Version !== null && { version: input.Version }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2504,7 +2464,7 @@ export const serializeAws_restJson1UpdateApiMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/domainnames/{DomainName}/apimappings/{ApiMappingId}"; if (input.DomainName !== undefined) { @@ -2527,9 +2487,9 @@ export const serializeAws_restJson1UpdateApiMappingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ApiId !== undefined && { apiId: input.ApiId }), - ...(input.ApiMappingKey !== undefined && { apiMappingKey: input.ApiMappingKey }), - ...(input.Stage !== undefined && { stage: input.Stage }), + ...(input.ApiId !== undefined && input.ApiId !== null && { apiId: input.ApiId }), + ...(input.ApiMappingKey !== undefined && input.ApiMappingKey !== null && { apiMappingKey: input.ApiMappingKey }), + ...(input.Stage !== undefined && input.Stage !== null && { stage: input.Stage }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2548,7 +2508,7 @@ export const serializeAws_restJson1UpdateAuthorizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/authorizers/{AuthorizerId}"; if (input.ApiId !== undefined) { @@ -2571,26 +2531,34 @@ export const serializeAws_restJson1UpdateAuthorizerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AuthorizerCredentialsArn !== undefined && { authorizerCredentialsArn: input.AuthorizerCredentialsArn }), - ...(input.AuthorizerPayloadFormatVersion !== undefined && { - authorizerPayloadFormatVersion: input.AuthorizerPayloadFormatVersion, - }), - ...(input.AuthorizerResultTtlInSeconds !== undefined && { - authorizerResultTtlInSeconds: input.AuthorizerResultTtlInSeconds, - }), - ...(input.AuthorizerType !== undefined && { authorizerType: input.AuthorizerType }), - ...(input.AuthorizerUri !== undefined && { authorizerUri: input.AuthorizerUri }), - ...(input.EnableSimpleResponses !== undefined && { enableSimpleResponses: input.EnableSimpleResponses }), - ...(input.IdentitySource !== undefined && { - identitySource: serializeAws_restJson1IdentitySourceList(input.IdentitySource, context), - }), - ...(input.IdentityValidationExpression !== undefined && { - identityValidationExpression: input.IdentityValidationExpression, - }), - ...(input.JwtConfiguration !== undefined && { - jwtConfiguration: serializeAws_restJson1JWTConfiguration(input.JwtConfiguration, context), - }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.AuthorizerCredentialsArn !== undefined && + input.AuthorizerCredentialsArn !== null && { authorizerCredentialsArn: input.AuthorizerCredentialsArn }), + ...(input.AuthorizerPayloadFormatVersion !== undefined && + input.AuthorizerPayloadFormatVersion !== null && { + authorizerPayloadFormatVersion: input.AuthorizerPayloadFormatVersion, + }), + ...(input.AuthorizerResultTtlInSeconds !== undefined && + input.AuthorizerResultTtlInSeconds !== null && { + authorizerResultTtlInSeconds: input.AuthorizerResultTtlInSeconds, + }), + ...(input.AuthorizerType !== undefined && + input.AuthorizerType !== null && { authorizerType: input.AuthorizerType }), + ...(input.AuthorizerUri !== undefined && input.AuthorizerUri !== null && { authorizerUri: input.AuthorizerUri }), + ...(input.EnableSimpleResponses !== undefined && + input.EnableSimpleResponses !== null && { enableSimpleResponses: input.EnableSimpleResponses }), + ...(input.IdentitySource !== undefined && + input.IdentitySource !== null && { + identitySource: serializeAws_restJson1IdentitySourceList(input.IdentitySource, context), + }), + ...(input.IdentityValidationExpression !== undefined && + input.IdentityValidationExpression !== null && { + identityValidationExpression: input.IdentityValidationExpression, + }), + ...(input.JwtConfiguration !== undefined && + input.JwtConfiguration !== null && { + jwtConfiguration: serializeAws_restJson1JWTConfiguration(input.JwtConfiguration, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2609,7 +2577,7 @@ export const serializeAws_restJson1UpdateDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/deployments/{DeploymentId}"; if (input.ApiId !== undefined) { @@ -2632,7 +2600,7 @@ export const serializeAws_restJson1UpdateDeploymentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { description: input.Description }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2651,7 +2619,7 @@ export const serializeAws_restJson1UpdateDomainNameCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/domainnames/{DomainName}"; if (input.DomainName !== undefined) { @@ -2665,15 +2633,20 @@ export const serializeAws_restJson1UpdateDomainNameCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DomainNameConfigurations !== undefined && { - domainNameConfigurations: serializeAws_restJson1DomainNameConfigurations(input.DomainNameConfigurations, context), - }), - ...(input.MutualTlsAuthentication !== undefined && { - mutualTlsAuthentication: serializeAws_restJson1MutualTlsAuthenticationInput( - input.MutualTlsAuthentication, - context - ), - }), + ...(input.DomainNameConfigurations !== undefined && + input.DomainNameConfigurations !== null && { + domainNameConfigurations: serializeAws_restJson1DomainNameConfigurations( + input.DomainNameConfigurations, + context + ), + }), + ...(input.MutualTlsAuthentication !== undefined && + input.MutualTlsAuthentication !== null && { + mutualTlsAuthentication: serializeAws_restJson1MutualTlsAuthenticationInput( + input.MutualTlsAuthentication, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2692,7 +2665,7 @@ export const serializeAws_restJson1UpdateIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/integrations/{IntegrationId}"; if (input.ApiId !== undefined) { @@ -2715,28 +2688,40 @@ export const serializeAws_restJson1UpdateIntegrationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConnectionId !== undefined && { connectionId: input.ConnectionId }), - ...(input.ConnectionType !== undefined && { connectionType: input.ConnectionType }), - ...(input.ContentHandlingStrategy !== undefined && { contentHandlingStrategy: input.ContentHandlingStrategy }), - ...(input.CredentialsArn !== undefined && { credentialsArn: input.CredentialsArn }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.IntegrationMethod !== undefined && { integrationMethod: input.IntegrationMethod }), - ...(input.IntegrationSubtype !== undefined && { integrationSubtype: input.IntegrationSubtype }), - ...(input.IntegrationType !== undefined && { integrationType: input.IntegrationType }), - ...(input.IntegrationUri !== undefined && { integrationUri: input.IntegrationUri }), - ...(input.PassthroughBehavior !== undefined && { passthroughBehavior: input.PassthroughBehavior }), - ...(input.PayloadFormatVersion !== undefined && { payloadFormatVersion: input.PayloadFormatVersion }), - ...(input.RequestParameters !== undefined && { - requestParameters: serializeAws_restJson1IntegrationParameters(input.RequestParameters, context), - }), - ...(input.RequestTemplates !== undefined && { - requestTemplates: serializeAws_restJson1TemplateMap(input.RequestTemplates, context), - }), - ...(input.TemplateSelectionExpression !== undefined && { - templateSelectionExpression: input.TemplateSelectionExpression, - }), - ...(input.TimeoutInMillis !== undefined && { timeoutInMillis: input.TimeoutInMillis }), - ...(input.TlsConfig !== undefined && { tlsConfig: serializeAws_restJson1TlsConfigInput(input.TlsConfig, context) }), + ...(input.ConnectionId !== undefined && input.ConnectionId !== null && { connectionId: input.ConnectionId }), + ...(input.ConnectionType !== undefined && + input.ConnectionType !== null && { connectionType: input.ConnectionType }), + ...(input.ContentHandlingStrategy !== undefined && + input.ContentHandlingStrategy !== null && { contentHandlingStrategy: input.ContentHandlingStrategy }), + ...(input.CredentialsArn !== undefined && + input.CredentialsArn !== null && { credentialsArn: input.CredentialsArn }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.IntegrationMethod !== undefined && + input.IntegrationMethod !== null && { integrationMethod: input.IntegrationMethod }), + ...(input.IntegrationSubtype !== undefined && + input.IntegrationSubtype !== null && { integrationSubtype: input.IntegrationSubtype }), + ...(input.IntegrationType !== undefined && + input.IntegrationType !== null && { integrationType: input.IntegrationType }), + ...(input.IntegrationUri !== undefined && + input.IntegrationUri !== null && { integrationUri: input.IntegrationUri }), + ...(input.PassthroughBehavior !== undefined && + input.PassthroughBehavior !== null && { passthroughBehavior: input.PassthroughBehavior }), + ...(input.PayloadFormatVersion !== undefined && + input.PayloadFormatVersion !== null && { payloadFormatVersion: input.PayloadFormatVersion }), + ...(input.RequestParameters !== undefined && + input.RequestParameters !== null && { + requestParameters: serializeAws_restJson1IntegrationParameters(input.RequestParameters, context), + }), + ...(input.RequestTemplates !== undefined && + input.RequestTemplates !== null && { + requestTemplates: serializeAws_restJson1TemplateMap(input.RequestTemplates, context), + }), + ...(input.TemplateSelectionExpression !== undefined && + input.TemplateSelectionExpression !== null && { templateSelectionExpression: input.TemplateSelectionExpression }), + ...(input.TimeoutInMillis !== undefined && + input.TimeoutInMillis !== null && { timeoutInMillis: input.TimeoutInMillis }), + ...(input.TlsConfig !== undefined && + input.TlsConfig !== null && { tlsConfig: serializeAws_restJson1TlsConfigInput(input.TlsConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2755,7 +2740,7 @@ export const serializeAws_restJson1UpdateIntegrationResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/integrations/{IntegrationId}/integrationresponses/{IntegrationResponseId}"; if (input.IntegrationId !== undefined) { @@ -2787,17 +2772,20 @@ export const serializeAws_restJson1UpdateIntegrationResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ContentHandlingStrategy !== undefined && { contentHandlingStrategy: input.ContentHandlingStrategy }), - ...(input.IntegrationResponseKey !== undefined && { integrationResponseKey: input.IntegrationResponseKey }), - ...(input.ResponseParameters !== undefined && { - responseParameters: serializeAws_restJson1IntegrationParameters(input.ResponseParameters, context), - }), - ...(input.ResponseTemplates !== undefined && { - responseTemplates: serializeAws_restJson1TemplateMap(input.ResponseTemplates, context), - }), - ...(input.TemplateSelectionExpression !== undefined && { - templateSelectionExpression: input.TemplateSelectionExpression, - }), + ...(input.ContentHandlingStrategy !== undefined && + input.ContentHandlingStrategy !== null && { contentHandlingStrategy: input.ContentHandlingStrategy }), + ...(input.IntegrationResponseKey !== undefined && + input.IntegrationResponseKey !== null && { integrationResponseKey: input.IntegrationResponseKey }), + ...(input.ResponseParameters !== undefined && + input.ResponseParameters !== null && { + responseParameters: serializeAws_restJson1IntegrationParameters(input.ResponseParameters, context), + }), + ...(input.ResponseTemplates !== undefined && + input.ResponseTemplates !== null && { + responseTemplates: serializeAws_restJson1TemplateMap(input.ResponseTemplates, context), + }), + ...(input.TemplateSelectionExpression !== undefined && + input.TemplateSelectionExpression !== null && { templateSelectionExpression: input.TemplateSelectionExpression }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2816,7 +2804,7 @@ export const serializeAws_restJson1UpdateModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/models/{ModelId}"; if (input.ApiId !== undefined) { @@ -2839,10 +2827,10 @@ export const serializeAws_restJson1UpdateModelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ContentType !== undefined && { contentType: input.ContentType }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Schema !== undefined && { schema: input.Schema }), + ...(input.ContentType !== undefined && input.ContentType !== null && { contentType: input.ContentType }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Schema !== undefined && input.Schema !== null && { schema: input.Schema }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2861,7 +2849,7 @@ export const serializeAws_restJson1UpdateRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/routes/{RouteId}"; if (input.ApiId !== undefined) { @@ -2884,25 +2872,32 @@ export const serializeAws_restJson1UpdateRouteCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ApiKeyRequired !== undefined && { apiKeyRequired: input.ApiKeyRequired }), - ...(input.AuthorizationScopes !== undefined && { - authorizationScopes: serializeAws_restJson1AuthorizationScopes(input.AuthorizationScopes, context), - }), - ...(input.AuthorizationType !== undefined && { authorizationType: input.AuthorizationType }), - ...(input.AuthorizerId !== undefined && { authorizerId: input.AuthorizerId }), - ...(input.ModelSelectionExpression !== undefined && { modelSelectionExpression: input.ModelSelectionExpression }), - ...(input.OperationName !== undefined && { operationName: input.OperationName }), - ...(input.RequestModels !== undefined && { - requestModels: serializeAws_restJson1RouteModels(input.RequestModels, context), - }), - ...(input.RequestParameters !== undefined && { - requestParameters: serializeAws_restJson1RouteParameters(input.RequestParameters, context), - }), - ...(input.RouteKey !== undefined && { routeKey: input.RouteKey }), - ...(input.RouteResponseSelectionExpression !== undefined && { - routeResponseSelectionExpression: input.RouteResponseSelectionExpression, - }), - ...(input.Target !== undefined && { target: input.Target }), + ...(input.ApiKeyRequired !== undefined && + input.ApiKeyRequired !== null && { apiKeyRequired: input.ApiKeyRequired }), + ...(input.AuthorizationScopes !== undefined && + input.AuthorizationScopes !== null && { + authorizationScopes: serializeAws_restJson1AuthorizationScopes(input.AuthorizationScopes, context), + }), + ...(input.AuthorizationType !== undefined && + input.AuthorizationType !== null && { authorizationType: input.AuthorizationType }), + ...(input.AuthorizerId !== undefined && input.AuthorizerId !== null && { authorizerId: input.AuthorizerId }), + ...(input.ModelSelectionExpression !== undefined && + input.ModelSelectionExpression !== null && { modelSelectionExpression: input.ModelSelectionExpression }), + ...(input.OperationName !== undefined && input.OperationName !== null && { operationName: input.OperationName }), + ...(input.RequestModels !== undefined && + input.RequestModels !== null && { + requestModels: serializeAws_restJson1RouteModels(input.RequestModels, context), + }), + ...(input.RequestParameters !== undefined && + input.RequestParameters !== null && { + requestParameters: serializeAws_restJson1RouteParameters(input.RequestParameters, context), + }), + ...(input.RouteKey !== undefined && input.RouteKey !== null && { routeKey: input.RouteKey }), + ...(input.RouteResponseSelectionExpression !== undefined && + input.RouteResponseSelectionExpression !== null && { + routeResponseSelectionExpression: input.RouteResponseSelectionExpression, + }), + ...(input.Target !== undefined && input.Target !== null && { target: input.Target }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2921,7 +2916,7 @@ export const serializeAws_restJson1UpdateRouteResponseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/routes/{RouteId}/routeresponses/{RouteResponseId}"; if (input.RouteId !== undefined) { @@ -2953,14 +2948,18 @@ export const serializeAws_restJson1UpdateRouteResponseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ModelSelectionExpression !== undefined && { modelSelectionExpression: input.ModelSelectionExpression }), - ...(input.ResponseModels !== undefined && { - responseModels: serializeAws_restJson1RouteModels(input.ResponseModels, context), - }), - ...(input.ResponseParameters !== undefined && { - responseParameters: serializeAws_restJson1RouteParameters(input.ResponseParameters, context), - }), - ...(input.RouteResponseKey !== undefined && { routeResponseKey: input.RouteResponseKey }), + ...(input.ModelSelectionExpression !== undefined && + input.ModelSelectionExpression !== null && { modelSelectionExpression: input.ModelSelectionExpression }), + ...(input.ResponseModels !== undefined && + input.ResponseModels !== null && { + responseModels: serializeAws_restJson1RouteModels(input.ResponseModels, context), + }), + ...(input.ResponseParameters !== undefined && + input.ResponseParameters !== null && { + responseParameters: serializeAws_restJson1RouteParameters(input.ResponseParameters, context), + }), + ...(input.RouteResponseKey !== undefined && + input.RouteResponseKey !== null && { routeResponseKey: input.RouteResponseKey }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2979,7 +2978,7 @@ export const serializeAws_restJson1UpdateStageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/apis/{ApiId}/stages/{StageName}"; if (input.ApiId !== undefined) { @@ -3002,22 +3001,27 @@ export const serializeAws_restJson1UpdateStageCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccessLogSettings !== undefined && { - accessLogSettings: serializeAws_restJson1AccessLogSettings(input.AccessLogSettings, context), - }), - ...(input.AutoDeploy !== undefined && { autoDeploy: input.AutoDeploy }), - ...(input.ClientCertificateId !== undefined && { clientCertificateId: input.ClientCertificateId }), - ...(input.DefaultRouteSettings !== undefined && { - defaultRouteSettings: serializeAws_restJson1RouteSettings(input.DefaultRouteSettings, context), - }), - ...(input.DeploymentId !== undefined && { deploymentId: input.DeploymentId }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.RouteSettings !== undefined && { - routeSettings: serializeAws_restJson1RouteSettingsMap(input.RouteSettings, context), - }), - ...(input.StageVariables !== undefined && { - stageVariables: serializeAws_restJson1StageVariablesMap(input.StageVariables, context), - }), + ...(input.AccessLogSettings !== undefined && + input.AccessLogSettings !== null && { + accessLogSettings: serializeAws_restJson1AccessLogSettings(input.AccessLogSettings, context), + }), + ...(input.AutoDeploy !== undefined && input.AutoDeploy !== null && { autoDeploy: input.AutoDeploy }), + ...(input.ClientCertificateId !== undefined && + input.ClientCertificateId !== null && { clientCertificateId: input.ClientCertificateId }), + ...(input.DefaultRouteSettings !== undefined && + input.DefaultRouteSettings !== null && { + defaultRouteSettings: serializeAws_restJson1RouteSettings(input.DefaultRouteSettings, context), + }), + ...(input.DeploymentId !== undefined && input.DeploymentId !== null && { deploymentId: input.DeploymentId }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.RouteSettings !== undefined && + input.RouteSettings !== null && { + routeSettings: serializeAws_restJson1RouteSettingsMap(input.RouteSettings, context), + }), + ...(input.StageVariables !== undefined && + input.StageVariables !== null && { + stageVariables: serializeAws_restJson1StageVariablesMap(input.StageVariables, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3036,7 +3040,7 @@ export const serializeAws_restJson1UpdateVpcLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/vpclinks/{VpcLinkId}"; if (input.VpcLinkId !== undefined) { @@ -3050,7 +3054,7 @@ export const serializeAws_restJson1UpdateVpcLinkCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -9583,49 +9587,90 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async ( }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AccessLogSettings = (input: AccessLogSettings, context: __SerdeContext): any => { return { - ...(input.DestinationArn !== undefined && { destinationArn: input.DestinationArn }), - ...(input.Format !== undefined && { format: input.Format }), + ...(input.DestinationArn !== undefined && + input.DestinationArn !== null && { destinationArn: input.DestinationArn }), + ...(input.Format !== undefined && input.Format !== null && { format: input.Format }), }; }; const serializeAws_restJson1AuthorizationScopes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Cors = (input: Cors, context: __SerdeContext): any => { return { - ...(input.AllowCredentials !== undefined && { allowCredentials: input.AllowCredentials }), - ...(input.AllowHeaders !== undefined && { - allowHeaders: serializeAws_restJson1CorsHeaderList(input.AllowHeaders, context), - }), - ...(input.AllowMethods !== undefined && { - allowMethods: serializeAws_restJson1CorsMethodList(input.AllowMethods, context), - }), - ...(input.AllowOrigins !== undefined && { - allowOrigins: serializeAws_restJson1CorsOriginList(input.AllowOrigins, context), - }), - ...(input.ExposeHeaders !== undefined && { - exposeHeaders: serializeAws_restJson1CorsHeaderList(input.ExposeHeaders, context), - }), - ...(input.MaxAge !== undefined && { maxAge: input.MaxAge }), + ...(input.AllowCredentials !== undefined && + input.AllowCredentials !== null && { allowCredentials: input.AllowCredentials }), + ...(input.AllowHeaders !== undefined && + input.AllowHeaders !== null && { + allowHeaders: serializeAws_restJson1CorsHeaderList(input.AllowHeaders, context), + }), + ...(input.AllowMethods !== undefined && + input.AllowMethods !== null && { + allowMethods: serializeAws_restJson1CorsMethodList(input.AllowMethods, context), + }), + ...(input.AllowOrigins !== undefined && + input.AllowOrigins !== null && { + allowOrigins: serializeAws_restJson1CorsOriginList(input.AllowOrigins, context), + }), + ...(input.ExposeHeaders !== undefined && + input.ExposeHeaders !== null && { + exposeHeaders: serializeAws_restJson1CorsHeaderList(input.ExposeHeaders, context), + }), + ...(input.MaxAge !== undefined && input.MaxAge !== null && { maxAge: input.MaxAge }), }; }; const serializeAws_restJson1CorsHeaderList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1CorsMethodList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1CorsOriginList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DomainNameConfiguration = ( @@ -9633,17 +9678,24 @@ const serializeAws_restJson1DomainNameConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.ApiGatewayDomainName !== undefined && { apiGatewayDomainName: input.ApiGatewayDomainName }), - ...(input.CertificateArn !== undefined && { certificateArn: input.CertificateArn }), - ...(input.CertificateName !== undefined && { certificateName: input.CertificateName }), - ...(input.CertificateUploadDate !== undefined && { - certificateUploadDate: input.CertificateUploadDate.toISOString().split(".")[0] + "Z", - }), - ...(input.DomainNameStatus !== undefined && { domainNameStatus: input.DomainNameStatus }), - ...(input.DomainNameStatusMessage !== undefined && { domainNameStatusMessage: input.DomainNameStatusMessage }), - ...(input.EndpointType !== undefined && { endpointType: input.EndpointType }), - ...(input.HostedZoneId !== undefined && { hostedZoneId: input.HostedZoneId }), - ...(input.SecurityPolicy !== undefined && { securityPolicy: input.SecurityPolicy }), + ...(input.ApiGatewayDomainName !== undefined && + input.ApiGatewayDomainName !== null && { apiGatewayDomainName: input.ApiGatewayDomainName }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { certificateArn: input.CertificateArn }), + ...(input.CertificateName !== undefined && + input.CertificateName !== null && { certificateName: input.CertificateName }), + ...(input.CertificateUploadDate !== undefined && + input.CertificateUploadDate !== null && { + certificateUploadDate: input.CertificateUploadDate.toISOString().split(".")[0] + "Z", + }), + ...(input.DomainNameStatus !== undefined && + input.DomainNameStatus !== null && { domainNameStatus: input.DomainNameStatus }), + ...(input.DomainNameStatusMessage !== undefined && + input.DomainNameStatusMessage !== null && { domainNameStatusMessage: input.DomainNameStatusMessage }), + ...(input.EndpointType !== undefined && input.EndpointType !== null && { endpointType: input.EndpointType }), + ...(input.HostedZoneId !== undefined && input.HostedZoneId !== null && { hostedZoneId: input.HostedZoneId }), + ...(input.SecurityPolicy !== undefined && + input.SecurityPolicy !== null && { securityPolicy: input.SecurityPolicy }), }; }; @@ -9651,30 +9703,47 @@ const serializeAws_restJson1DomainNameConfigurations = ( input: DomainNameConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DomainNameConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DomainNameConfiguration(entry, context); + }); }; const serializeAws_restJson1IdentitySourceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1IntegrationParameters = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1JWTConfiguration = (input: JWTConfiguration, context: __SerdeContext): any => { return { - ...(input.Audience !== undefined && { audience: serializeAws_restJson1__listOf__string(input.Audience, context) }), - ...(input.Issuer !== undefined && { issuer: input.Issuer }), + ...(input.Audience !== undefined && + input.Audience !== null && { audience: serializeAws_restJson1__listOf__string(input.Audience, context) }), + ...(input.Issuer !== undefined && input.Issuer !== null && { issuer: input.Issuer }), }; }; @@ -9683,47 +9752,56 @@ const serializeAws_restJson1MutualTlsAuthenticationInput = ( context: __SerdeContext ): any => { return { - ...(input.TruststoreUri !== undefined && { truststoreUri: input.TruststoreUri }), - ...(input.TruststoreVersion !== undefined && { truststoreVersion: input.TruststoreVersion }), + ...(input.TruststoreUri !== undefined && input.TruststoreUri !== null && { truststoreUri: input.TruststoreUri }), + ...(input.TruststoreVersion !== undefined && + input.TruststoreVersion !== null && { truststoreVersion: input.TruststoreVersion }), }; }; const serializeAws_restJson1ParameterConstraints = (input: ParameterConstraints, context: __SerdeContext): any => { return { - ...(input.Required !== undefined && { required: input.Required }), + ...(input.Required !== undefined && input.Required !== null && { required: input.Required }), }; }; const serializeAws_restJson1RouteModels = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1RouteParameters = ( input: { [key: string]: ParameterConstraints }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: ParameterConstraints }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: ParameterConstraints }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1ParameterConstraints(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1RouteSettings = (input: RouteSettings, context: __SerdeContext): any => { return { - ...(input.DataTraceEnabled !== undefined && { dataTraceEnabled: input.DataTraceEnabled }), - ...(input.DetailedMetricsEnabled !== undefined && { detailedMetricsEnabled: input.DetailedMetricsEnabled }), - ...(input.LoggingLevel !== undefined && { loggingLevel: input.LoggingLevel }), - ...(input.ThrottlingBurstLimit !== undefined && { throttlingBurstLimit: input.ThrottlingBurstLimit }), - ...(input.ThrottlingRateLimit !== undefined && { throttlingRateLimit: input.ThrottlingRateLimit }), + ...(input.DataTraceEnabled !== undefined && + input.DataTraceEnabled !== null && { dataTraceEnabled: input.DataTraceEnabled }), + ...(input.DetailedMetricsEnabled !== undefined && + input.DetailedMetricsEnabled !== null && { detailedMetricsEnabled: input.DetailedMetricsEnabled }), + ...(input.LoggingLevel !== undefined && input.LoggingLevel !== null && { loggingLevel: input.LoggingLevel }), + ...(input.ThrottlingBurstLimit !== undefined && + input.ThrottlingBurstLimit !== null && { throttlingBurstLimit: input.ThrottlingBurstLimit }), + ...(input.ThrottlingRateLimit !== undefined && + input.ThrottlingRateLimit !== null && { throttlingRateLimit: input.ThrottlingRateLimit }), }; }; @@ -9731,112 +9809,226 @@ const serializeAws_restJson1RouteSettingsMap = ( input: { [key: string]: RouteSettings }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: RouteSettings }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: RouteSettings }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1RouteSettings(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1SecurityGroupIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1StageVariablesMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1SubnetIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TemplateMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TlsConfigInput = (input: TlsConfigInput, context: __SerdeContext): any => { return { - ...(input.ServerNameToVerify !== undefined && { serverNameToVerify: input.ServerNameToVerify }), + ...(input.ServerNameToVerify !== undefined && + input.ServerNameToVerify !== null && { serverNameToVerify: input.ServerNameToVerify }), }; }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfApi = (output: any, context: __SerdeContext): Api[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Api(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Api(entry, context); + }); }; const deserializeAws_restJson1__listOfApiMapping = (output: any, context: __SerdeContext): ApiMapping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ApiMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ApiMapping(entry, context); + }); }; const deserializeAws_restJson1__listOfAuthorizer = (output: any, context: __SerdeContext): Authorizer[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Authorizer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Authorizer(entry, context); + }); }; const deserializeAws_restJson1__listOfDeployment = (output: any, context: __SerdeContext): Deployment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Deployment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Deployment(entry, context); + }); }; const deserializeAws_restJson1__listOfDomainName = (output: any, context: __SerdeContext): DomainName[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainName(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainName(entry, context); + }); }; const deserializeAws_restJson1__listOfIntegration = (output: any, context: __SerdeContext): Integration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Integration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Integration(entry, context); + }); }; const deserializeAws_restJson1__listOfIntegrationResponse = ( output: any, context: __SerdeContext ): IntegrationResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IntegrationResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IntegrationResponse(entry, context); + }); }; const deserializeAws_restJson1__listOfModel = (output: any, context: __SerdeContext): Model[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Model(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Model(entry, context); + }); }; const deserializeAws_restJson1__listOfRoute = (output: any, context: __SerdeContext): Route[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Route(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Route(entry, context); + }); }; const deserializeAws_restJson1__listOfRouteResponse = (output: any, context: __SerdeContext): RouteResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RouteResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RouteResponse(entry, context); + }); }; const deserializeAws_restJson1__listOfStage = (output: any, context: __SerdeContext): Stage[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Stage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Stage(entry, context); + }); }; const deserializeAws_restJson1__listOfVpcLink = (output: any, context: __SerdeContext): VpcLink[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VpcLink(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VpcLink(entry, context); + }); }; const deserializeAws_restJson1AccessLogSettings = (output: any, context: __SerdeContext): AccessLogSettings => { @@ -9907,7 +10099,14 @@ const deserializeAws_restJson1ApiMapping = (output: any, context: __SerdeContext }; const deserializeAws_restJson1AuthorizationScopes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Authorizer = (output: any, context: __SerdeContext): Authorizer => { @@ -9974,15 +10173,36 @@ const deserializeAws_restJson1Cors = (output: any, context: __SerdeContext): Cor }; const deserializeAws_restJson1CorsHeaderList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1CorsMethodList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1CorsOriginList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Deployment = (output: any, context: __SerdeContext): Deployment => { @@ -10057,11 +10277,25 @@ const deserializeAws_restJson1DomainNameConfigurations = ( output: any, context: __SerdeContext ): DomainNameConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainNameConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainNameConfiguration(entry, context); + }); }; const deserializeAws_restJson1IdentitySourceList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Integration = (output: any, context: __SerdeContext): Integration => { @@ -10132,13 +10366,15 @@ const deserializeAws_restJson1IntegrationParameters = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1IntegrationResponse = (output: any, context: __SerdeContext): IntegrationResponse => { @@ -10256,26 +10492,30 @@ const deserializeAws_restJson1Route = (output: any, context: __SerdeContext): Ro }; const deserializeAws_restJson1RouteModels = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1RouteParameters = ( output: any, context: __SerdeContext ): { [key: string]: ParameterConstraints } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ParameterConstraints }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ParameterConstraints }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ParameterConstraints(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1RouteResponse = (output: any, context: __SerdeContext): RouteResponse => { @@ -10323,17 +10563,26 @@ const deserializeAws_restJson1RouteSettingsMap = ( output: any, context: __SerdeContext ): { [key: string]: RouteSettings } => { - return Object.entries(output).reduce( - (acc: { [key: string]: RouteSettings }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: RouteSettings }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1RouteSettings(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1SecurityGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Stage = (output: any, context: __SerdeContext): Stage => { @@ -10384,37 +10633,50 @@ const deserializeAws_restJson1Stage = (output: any, context: __SerdeContext): St }; const deserializeAws_restJson1StageVariablesMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1SubnetIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TemplateMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TlsConfig = (output: any, context: __SerdeContext): TlsConfig => { @@ -10475,6 +10737,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-app-mesh/protocols/Aws_restJson1.ts b/clients/client-app-mesh/protocols/Aws_restJson1.ts index a842db52871f..45b89af3f1c3 100644 --- a/clients/client-app-mesh/protocols/Aws_restJson1.ts +++ b/clients/client-app-mesh/protocols/Aws_restJson1.ts @@ -223,7 +223,7 @@ export const serializeAws_restJson1CreateGatewayRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes"; if (input.meshName !== undefined) { @@ -250,9 +250,12 @@ export const serializeAws_restJson1CreateGatewayRouteCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.gatewayRouteName !== undefined && { gatewayRouteName: input.gatewayRouteName }), - ...(input.spec !== undefined && { spec: serializeAws_restJson1GatewayRouteSpec(input.spec, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.gatewayRouteName !== undefined && + input.gatewayRouteName !== null && { gatewayRouteName: input.gatewayRouteName }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1GatewayRouteSpec(input.spec, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -272,15 +275,17 @@ export const serializeAws_restJson1CreateMeshCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.meshName !== undefined && { meshName: input.meshName }), - ...(input.spec !== undefined && { spec: serializeAws_restJson1MeshSpec(input.spec, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.meshName !== undefined && input.meshName !== null && { meshName: input.meshName }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1MeshSpec(input.spec, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -299,7 +304,7 @@ export const serializeAws_restJson1CreateRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes"; if (input.meshName !== undefined) { @@ -326,9 +331,11 @@ export const serializeAws_restJson1CreateRouteCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.routeName !== undefined && { routeName: input.routeName }), - ...(input.spec !== undefined && { spec: serializeAws_restJson1RouteSpec(input.spec, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.routeName !== undefined && input.routeName !== null && { routeName: input.routeName }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1RouteSpec(input.spec, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -348,7 +355,7 @@ export const serializeAws_restJson1CreateVirtualGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateways"; if (input.meshName !== undefined) { @@ -366,9 +373,12 @@ export const serializeAws_restJson1CreateVirtualGatewayCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1VirtualGatewaySpec(input.spec, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.virtualGatewayName !== undefined && { virtualGatewayName: input.virtualGatewayName }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1VirtualGatewaySpec(input.spec, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.virtualGatewayName !== undefined && + input.virtualGatewayName !== null && { virtualGatewayName: input.virtualGatewayName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -388,7 +398,7 @@ export const serializeAws_restJson1CreateVirtualNodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualNodes"; if (input.meshName !== undefined) { @@ -406,9 +416,12 @@ export const serializeAws_restJson1CreateVirtualNodeCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1VirtualNodeSpec(input.spec, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.virtualNodeName !== undefined && { virtualNodeName: input.virtualNodeName }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1VirtualNodeSpec(input.spec, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.virtualNodeName !== undefined && + input.virtualNodeName !== null && { virtualNodeName: input.virtualNodeName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -428,7 +441,7 @@ export const serializeAws_restJson1CreateVirtualRouterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouters"; if (input.meshName !== undefined) { @@ -446,9 +459,12 @@ export const serializeAws_restJson1CreateVirtualRouterCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1VirtualRouterSpec(input.spec, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.virtualRouterName !== undefined && { virtualRouterName: input.virtualRouterName }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1VirtualRouterSpec(input.spec, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.virtualRouterName !== undefined && + input.virtualRouterName !== null && { virtualRouterName: input.virtualRouterName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -468,7 +484,7 @@ export const serializeAws_restJson1CreateVirtualServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualServices"; if (input.meshName !== undefined) { @@ -486,9 +502,12 @@ export const serializeAws_restJson1CreateVirtualServiceCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1VirtualServiceSpec(input.spec, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.virtualServiceName !== undefined && { virtualServiceName: input.virtualServiceName }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1VirtualServiceSpec(input.spec, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.virtualServiceName !== undefined && + input.virtualServiceName !== null && { virtualServiceName: input.virtualServiceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -507,9 +526,7 @@ export const serializeAws_restJson1DeleteGatewayRouteCommand = async ( input: DeleteGatewayRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}"; if (input.gatewayRouteName !== undefined) { @@ -560,9 +577,7 @@ export const serializeAws_restJson1DeleteMeshCommand = async ( input: DeleteMeshCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}"; if (input.meshName !== undefined) { const labelValue: string = input.meshName; @@ -590,9 +605,7 @@ export const serializeAws_restJson1DeleteRouteCommand = async ( input: DeleteRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}"; if (input.routeName !== undefined) { const labelValue: string = input.routeName; @@ -642,9 +655,7 @@ export const serializeAws_restJson1DeleteVirtualGatewayCommand = async ( input: DeleteVirtualGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}"; if (input.virtualGatewayName !== undefined) { const labelValue: string = input.virtualGatewayName; @@ -685,9 +696,7 @@ export const serializeAws_restJson1DeleteVirtualNodeCommand = async ( input: DeleteVirtualNodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}"; if (input.virtualNodeName !== undefined) { const labelValue: string = input.virtualNodeName; @@ -728,9 +737,7 @@ export const serializeAws_restJson1DeleteVirtualRouterCommand = async ( input: DeleteVirtualRouterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}"; if (input.virtualRouterName !== undefined) { const labelValue: string = input.virtualRouterName; @@ -771,9 +778,7 @@ export const serializeAws_restJson1DeleteVirtualServiceCommand = async ( input: DeleteVirtualServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}"; if (input.virtualServiceName !== undefined) { const labelValue: string = input.virtualServiceName; @@ -814,9 +819,7 @@ export const serializeAws_restJson1DescribeGatewayRouteCommand = async ( input: DescribeGatewayRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}"; if (input.gatewayRouteName !== undefined) { @@ -867,9 +870,7 @@ export const serializeAws_restJson1DescribeMeshCommand = async ( input: DescribeMeshCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}"; if (input.meshName !== undefined) { const labelValue: string = input.meshName; @@ -901,9 +902,7 @@ export const serializeAws_restJson1DescribeRouteCommand = async ( input: DescribeRouteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}"; if (input.routeName !== undefined) { const labelValue: string = input.routeName; @@ -953,9 +952,7 @@ export const serializeAws_restJson1DescribeVirtualGatewayCommand = async ( input: DescribeVirtualGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}"; if (input.virtualGatewayName !== undefined) { const labelValue: string = input.virtualGatewayName; @@ -996,9 +993,7 @@ export const serializeAws_restJson1DescribeVirtualNodeCommand = async ( input: DescribeVirtualNodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}"; if (input.virtualNodeName !== undefined) { const labelValue: string = input.virtualNodeName; @@ -1039,9 +1034,7 @@ export const serializeAws_restJson1DescribeVirtualRouterCommand = async ( input: DescribeVirtualRouterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}"; if (input.virtualRouterName !== undefined) { const labelValue: string = input.virtualRouterName; @@ -1082,9 +1075,7 @@ export const serializeAws_restJson1DescribeVirtualServiceCommand = async ( input: DescribeVirtualServiceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}"; if (input.virtualServiceName !== undefined) { const labelValue: string = input.virtualServiceName; @@ -1125,9 +1116,7 @@ export const serializeAws_restJson1ListGatewayRoutesCommand = async ( input: ListGatewayRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes"; if (input.meshName !== undefined) { const labelValue: string = input.meshName; @@ -1170,9 +1159,7 @@ export const serializeAws_restJson1ListMeshesCommand = async ( input: ListMeshesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1196,9 +1183,7 @@ export const serializeAws_restJson1ListRoutesCommand = async ( input: ListRoutesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes"; if (input.meshName !== undefined) { const labelValue: string = input.meshName; @@ -1241,9 +1226,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/tags"; const query: any = { ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), @@ -1268,9 +1251,7 @@ export const serializeAws_restJson1ListVirtualGatewaysCommand = async ( input: ListVirtualGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateways"; if (input.meshName !== undefined) { const labelValue: string = input.meshName; @@ -1304,9 +1285,7 @@ export const serializeAws_restJson1ListVirtualNodesCommand = async ( input: ListVirtualNodesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualNodes"; if (input.meshName !== undefined) { const labelValue: string = input.meshName; @@ -1340,9 +1319,7 @@ export const serializeAws_restJson1ListVirtualRoutersCommand = async ( input: ListVirtualRoutersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouters"; if (input.meshName !== undefined) { const labelValue: string = input.meshName; @@ -1376,9 +1353,7 @@ export const serializeAws_restJson1ListVirtualServicesCommand = async ( input: ListVirtualServicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v20190125/meshes/{meshName}/virtualServices"; if (input.meshName !== undefined) { const labelValue: string = input.meshName; @@ -1413,7 +1388,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/tag"; const query: any = { @@ -1421,7 +1396,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1441,7 +1417,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/untag"; const query: any = { @@ -1449,7 +1425,8 @@ export const serializeAws_restJson1UntagResourceCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1469,7 +1446,7 @@ export const serializeAws_restJson1UpdateGatewayRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}"; @@ -1506,7 +1483,8 @@ export const serializeAws_restJson1UpdateGatewayRouteCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1GatewayRouteSpec(input.spec, context) }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1GatewayRouteSpec(input.spec, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1526,7 +1504,7 @@ export const serializeAws_restJson1UpdateMeshCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}"; if (input.meshName !== undefined) { @@ -1541,7 +1519,8 @@ export const serializeAws_restJson1UpdateMeshCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1MeshSpec(input.spec, context) }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1MeshSpec(input.spec, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1560,7 +1539,7 @@ export const serializeAws_restJson1UpdateRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}"; if (input.routeName !== undefined) { @@ -1596,7 +1575,8 @@ export const serializeAws_restJson1UpdateRouteCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1RouteSpec(input.spec, context) }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1RouteSpec(input.spec, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1616,7 +1596,7 @@ export const serializeAws_restJson1UpdateVirtualGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}"; if (input.virtualGatewayName !== undefined) { @@ -1643,7 +1623,8 @@ export const serializeAws_restJson1UpdateVirtualGatewayCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1VirtualGatewaySpec(input.spec, context) }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1VirtualGatewaySpec(input.spec, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1663,7 +1644,7 @@ export const serializeAws_restJson1UpdateVirtualNodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}"; if (input.virtualNodeName !== undefined) { @@ -1690,7 +1671,8 @@ export const serializeAws_restJson1UpdateVirtualNodeCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1VirtualNodeSpec(input.spec, context) }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1VirtualNodeSpec(input.spec, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1710,7 +1692,7 @@ export const serializeAws_restJson1UpdateVirtualRouterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}"; if (input.virtualRouterName !== undefined) { @@ -1737,7 +1719,8 @@ export const serializeAws_restJson1UpdateVirtualRouterCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1VirtualRouterSpec(input.spec, context) }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1VirtualRouterSpec(input.spec, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1757,7 +1740,7 @@ export const serializeAws_restJson1UpdateVirtualServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}"; if (input.virtualServiceName !== undefined) { @@ -1784,7 +1767,8 @@ export const serializeAws_restJson1UpdateVirtualServiceCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.spec !== undefined && { spec: serializeAws_restJson1VirtualServiceSpec(input.spec, context) }), + ...(input.spec !== undefined && + input.spec !== null && { spec: serializeAws_restJson1VirtualServiceSpec(input.spec, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5841,8 +5825,8 @@ const serializeAws_restJson1AwsCloudMapInstanceAttribute = ( context: __SerdeContext ): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; @@ -5850,7 +5834,14 @@ const serializeAws_restJson1AwsCloudMapInstanceAttributes = ( input: AwsCloudMapInstanceAttribute[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsCloudMapInstanceAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsCloudMapInstanceAttribute(entry, context); + }); }; const serializeAws_restJson1AwsCloudMapServiceDiscovery = ( @@ -5858,11 +5849,12 @@ const serializeAws_restJson1AwsCloudMapServiceDiscovery = ( context: __SerdeContext ): any => { return { - ...(input.attributes !== undefined && { - attributes: serializeAws_restJson1AwsCloudMapInstanceAttributes(input.attributes, context), - }), - ...(input.namespaceName !== undefined && { namespaceName: input.namespaceName }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.attributes !== undefined && + input.attributes !== null && { + attributes: serializeAws_restJson1AwsCloudMapInstanceAttributes(input.attributes, context), + }), + ...(input.namespaceName !== undefined && input.namespaceName !== null && { namespaceName: input.namespaceName }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; @@ -5875,80 +5867,94 @@ const serializeAws_restJson1Backend = (input: Backend, context: __SerdeContext): const serializeAws_restJson1BackendDefaults = (input: BackendDefaults, context: __SerdeContext): any => { return { - ...(input.clientPolicy !== undefined && { - clientPolicy: serializeAws_restJson1ClientPolicy(input.clientPolicy, context), - }), + ...(input.clientPolicy !== undefined && + input.clientPolicy !== null && { clientPolicy: serializeAws_restJson1ClientPolicy(input.clientPolicy, context) }), }; }; const serializeAws_restJson1Backends = (input: Backend[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Backend(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Backend(entry, context); + }); }; const serializeAws_restJson1CertificateAuthorityArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ClientPolicy = (input: ClientPolicy, context: __SerdeContext): any => { return { - ...(input.tls !== undefined && { tls: serializeAws_restJson1ClientPolicyTls(input.tls, context) }), + ...(input.tls !== undefined && + input.tls !== null && { tls: serializeAws_restJson1ClientPolicyTls(input.tls, context) }), }; }; const serializeAws_restJson1ClientPolicyTls = (input: ClientPolicyTls, context: __SerdeContext): any => { return { - ...(input.enforce !== undefined && { enforce: input.enforce }), - ...(input.ports !== undefined && { ports: serializeAws_restJson1PortSet(input.ports, context) }), - ...(input.validation !== undefined && { - validation: serializeAws_restJson1TlsValidationContext(input.validation, context), - }), + ...(input.enforce !== undefined && input.enforce !== null && { enforce: input.enforce }), + ...(input.ports !== undefined && + input.ports !== null && { ports: serializeAws_restJson1PortSet(input.ports, context) }), + ...(input.validation !== undefined && + input.validation !== null && { + validation: serializeAws_restJson1TlsValidationContext(input.validation, context), + }), }; }; const serializeAws_restJson1DnsServiceDiscovery = (input: DnsServiceDiscovery, context: __SerdeContext): any => { return { - ...(input.hostname !== undefined && { hostname: input.hostname }), + ...(input.hostname !== undefined && input.hostname !== null && { hostname: input.hostname }), }; }; const serializeAws_restJson1Duration = (input: Duration, context: __SerdeContext): any => { return { - ...(input.unit !== undefined && { unit: input.unit }), - ...(input.value !== undefined && { value: input.value }), + ...(input.unit !== undefined && input.unit !== null && { unit: input.unit }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1EgressFilter = (input: EgressFilter, context: __SerdeContext): any => { return { - ...(input.type !== undefined && { type: input.type }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1FileAccessLog = (input: FileAccessLog, context: __SerdeContext): any => { return { - ...(input.path !== undefined && { path: input.path }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), }; }; const serializeAws_restJson1GatewayRouteSpec = (input: GatewayRouteSpec, context: __SerdeContext): any => { return { - ...(input.grpcRoute !== undefined && { - grpcRoute: serializeAws_restJson1GrpcGatewayRoute(input.grpcRoute, context), - }), - ...(input.http2Route !== undefined && { - http2Route: serializeAws_restJson1HttpGatewayRoute(input.http2Route, context), - }), - ...(input.httpRoute !== undefined && { - httpRoute: serializeAws_restJson1HttpGatewayRoute(input.httpRoute, context), - }), + ...(input.grpcRoute !== undefined && + input.grpcRoute !== null && { grpcRoute: serializeAws_restJson1GrpcGatewayRoute(input.grpcRoute, context) }), + ...(input.http2Route !== undefined && + input.http2Route !== null && { http2Route: serializeAws_restJson1HttpGatewayRoute(input.http2Route, context) }), + ...(input.httpRoute !== undefined && + input.httpRoute !== null && { httpRoute: serializeAws_restJson1HttpGatewayRoute(input.httpRoute, context) }), }; }; const serializeAws_restJson1GatewayRouteTarget = (input: GatewayRouteTarget, context: __SerdeContext): any => { return { - ...(input.virtualService !== undefined && { - virtualService: serializeAws_restJson1GatewayRouteVirtualService(input.virtualService, context), - }), + ...(input.virtualService !== undefined && + input.virtualService !== null && { + virtualService: serializeAws_restJson1GatewayRouteVirtualService(input.virtualService, context), + }), }; }; @@ -5957,44 +5963,52 @@ const serializeAws_restJson1GatewayRouteVirtualService = ( context: __SerdeContext ): any => { return { - ...(input.virtualServiceName !== undefined && { virtualServiceName: input.virtualServiceName }), + ...(input.virtualServiceName !== undefined && + input.virtualServiceName !== null && { virtualServiceName: input.virtualServiceName }), }; }; const serializeAws_restJson1GrpcGatewayRoute = (input: GrpcGatewayRoute, context: __SerdeContext): any => { return { - ...(input.action !== undefined && { action: serializeAws_restJson1GrpcGatewayRouteAction(input.action, context) }), - ...(input.match !== undefined && { match: serializeAws_restJson1GrpcGatewayRouteMatch(input.match, context) }), + ...(input.action !== undefined && + input.action !== null && { action: serializeAws_restJson1GrpcGatewayRouteAction(input.action, context) }), + ...(input.match !== undefined && + input.match !== null && { match: serializeAws_restJson1GrpcGatewayRouteMatch(input.match, context) }), }; }; const serializeAws_restJson1GrpcGatewayRouteAction = (input: GrpcGatewayRouteAction, context: __SerdeContext): any => { return { - ...(input.target !== undefined && { target: serializeAws_restJson1GatewayRouteTarget(input.target, context) }), + ...(input.target !== undefined && + input.target !== null && { target: serializeAws_restJson1GatewayRouteTarget(input.target, context) }), }; }; const serializeAws_restJson1GrpcGatewayRouteMatch = (input: GrpcGatewayRouteMatch, context: __SerdeContext): any => { return { - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; const serializeAws_restJson1GrpcRetryPolicy = (input: GrpcRetryPolicy, context: __SerdeContext): any => { return { - ...(input.grpcRetryEvents !== undefined && { - grpcRetryEvents: serializeAws_restJson1GrpcRetryPolicyEvents(input.grpcRetryEvents, context), - }), - ...(input.httpRetryEvents !== undefined && { - httpRetryEvents: serializeAws_restJson1HttpRetryPolicyEvents(input.httpRetryEvents, context), - }), - ...(input.maxRetries !== undefined && { maxRetries: input.maxRetries }), - ...(input.perRetryTimeout !== undefined && { - perRetryTimeout: serializeAws_restJson1Duration(input.perRetryTimeout, context), - }), - ...(input.tcpRetryEvents !== undefined && { - tcpRetryEvents: serializeAws_restJson1TcpRetryPolicyEvents(input.tcpRetryEvents, context), - }), + ...(input.grpcRetryEvents !== undefined && + input.grpcRetryEvents !== null && { + grpcRetryEvents: serializeAws_restJson1GrpcRetryPolicyEvents(input.grpcRetryEvents, context), + }), + ...(input.httpRetryEvents !== undefined && + input.httpRetryEvents !== null && { + httpRetryEvents: serializeAws_restJson1HttpRetryPolicyEvents(input.httpRetryEvents, context), + }), + ...(input.maxRetries !== undefined && input.maxRetries !== null && { maxRetries: input.maxRetries }), + ...(input.perRetryTimeout !== undefined && + input.perRetryTimeout !== null && { + perRetryTimeout: serializeAws_restJson1Duration(input.perRetryTimeout, context), + }), + ...(input.tcpRetryEvents !== undefined && + input.tcpRetryEvents !== null && { + tcpRetryEvents: serializeAws_restJson1TcpRetryPolicyEvents(input.tcpRetryEvents, context), + }), }; }; @@ -6002,50 +6016,65 @@ const serializeAws_restJson1GrpcRetryPolicyEvents = ( input: (GrpcRetryPolicyEvent | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1GrpcRoute = (input: GrpcRoute, context: __SerdeContext): any => { return { - ...(input.action !== undefined && { action: serializeAws_restJson1GrpcRouteAction(input.action, context) }), - ...(input.match !== undefined && { match: serializeAws_restJson1GrpcRouteMatch(input.match, context) }), - ...(input.retryPolicy !== undefined && { - retryPolicy: serializeAws_restJson1GrpcRetryPolicy(input.retryPolicy, context), - }), - ...(input.timeout !== undefined && { timeout: serializeAws_restJson1GrpcTimeout(input.timeout, context) }), + ...(input.action !== undefined && + input.action !== null && { action: serializeAws_restJson1GrpcRouteAction(input.action, context) }), + ...(input.match !== undefined && + input.match !== null && { match: serializeAws_restJson1GrpcRouteMatch(input.match, context) }), + ...(input.retryPolicy !== undefined && + input.retryPolicy !== null && { retryPolicy: serializeAws_restJson1GrpcRetryPolicy(input.retryPolicy, context) }), + ...(input.timeout !== undefined && + input.timeout !== null && { timeout: serializeAws_restJson1GrpcTimeout(input.timeout, context) }), }; }; const serializeAws_restJson1GrpcRouteAction = (input: GrpcRouteAction, context: __SerdeContext): any => { return { - ...(input.weightedTargets !== undefined && { - weightedTargets: serializeAws_restJson1WeightedTargets(input.weightedTargets, context), - }), + ...(input.weightedTargets !== undefined && + input.weightedTargets !== null && { + weightedTargets: serializeAws_restJson1WeightedTargets(input.weightedTargets, context), + }), }; }; const serializeAws_restJson1GrpcRouteMatch = (input: GrpcRouteMatch, context: __SerdeContext): any => { return { - ...(input.metadata !== undefined && { - metadata: serializeAws_restJson1GrpcRouteMetadataList(input.metadata, context), - }), - ...(input.methodName !== undefined && { methodName: input.methodName }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.metadata !== undefined && + input.metadata !== null && { metadata: serializeAws_restJson1GrpcRouteMetadataList(input.metadata, context) }), + ...(input.methodName !== undefined && input.methodName !== null && { methodName: input.methodName }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; const serializeAws_restJson1GrpcRouteMetadata = (input: GrpcRouteMetadata, context: __SerdeContext): any => { return { - ...(input.invert !== undefined && { invert: input.invert }), - ...(input.match !== undefined && { - match: serializeAws_restJson1GrpcRouteMetadataMatchMethod(input.match, context), - }), - ...(input.name !== undefined && { name: input.name }), + ...(input.invert !== undefined && input.invert !== null && { invert: input.invert }), + ...(input.match !== undefined && + input.match !== null && { match: serializeAws_restJson1GrpcRouteMetadataMatchMethod(input.match, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_restJson1GrpcRouteMetadataList = (input: GrpcRouteMetadata[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1GrpcRouteMetadata(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1GrpcRouteMetadata(entry, context); + }); }; const serializeAws_restJson1GrpcRouteMetadataMatchMethod = ( @@ -6064,8 +6093,10 @@ const serializeAws_restJson1GrpcRouteMetadataMatchMethod = ( const serializeAws_restJson1GrpcTimeout = (input: GrpcTimeout, context: __SerdeContext): any => { return { - ...(input.idle !== undefined && { idle: serializeAws_restJson1Duration(input.idle, context) }), - ...(input.perRequest !== undefined && { perRequest: serializeAws_restJson1Duration(input.perRequest, context) }), + ...(input.idle !== undefined && + input.idle !== null && { idle: serializeAws_restJson1Duration(input.idle, context) }), + ...(input.perRequest !== undefined && + input.perRequest !== null && { perRequest: serializeAws_restJson1Duration(input.perRequest, context) }), }; }; @@ -6082,116 +6113,155 @@ const serializeAws_restJson1HeaderMatchMethod = (input: HeaderMatchMethod, conte const serializeAws_restJson1HealthCheckPolicy = (input: HealthCheckPolicy, context: __SerdeContext): any => { return { - ...(input.healthyThreshold !== undefined && { healthyThreshold: input.healthyThreshold }), - ...(input.intervalMillis !== undefined && { intervalMillis: input.intervalMillis }), - ...(input.path !== undefined && { path: input.path }), - ...(input.port !== undefined && { port: input.port }), - ...(input.protocol !== undefined && { protocol: input.protocol }), - ...(input.timeoutMillis !== undefined && { timeoutMillis: input.timeoutMillis }), - ...(input.unhealthyThreshold !== undefined && { unhealthyThreshold: input.unhealthyThreshold }), + ...(input.healthyThreshold !== undefined && + input.healthyThreshold !== null && { healthyThreshold: input.healthyThreshold }), + ...(input.intervalMillis !== undefined && + input.intervalMillis !== null && { intervalMillis: input.intervalMillis }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), + ...(input.port !== undefined && input.port !== null && { port: input.port }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), + ...(input.timeoutMillis !== undefined && input.timeoutMillis !== null && { timeoutMillis: input.timeoutMillis }), + ...(input.unhealthyThreshold !== undefined && + input.unhealthyThreshold !== null && { unhealthyThreshold: input.unhealthyThreshold }), }; }; const serializeAws_restJson1HttpGatewayRoute = (input: HttpGatewayRoute, context: __SerdeContext): any => { return { - ...(input.action !== undefined && { action: serializeAws_restJson1HttpGatewayRouteAction(input.action, context) }), - ...(input.match !== undefined && { match: serializeAws_restJson1HttpGatewayRouteMatch(input.match, context) }), + ...(input.action !== undefined && + input.action !== null && { action: serializeAws_restJson1HttpGatewayRouteAction(input.action, context) }), + ...(input.match !== undefined && + input.match !== null && { match: serializeAws_restJson1HttpGatewayRouteMatch(input.match, context) }), }; }; const serializeAws_restJson1HttpGatewayRouteAction = (input: HttpGatewayRouteAction, context: __SerdeContext): any => { return { - ...(input.target !== undefined && { target: serializeAws_restJson1GatewayRouteTarget(input.target, context) }), + ...(input.target !== undefined && + input.target !== null && { target: serializeAws_restJson1GatewayRouteTarget(input.target, context) }), }; }; const serializeAws_restJson1HttpGatewayRouteMatch = (input: HttpGatewayRouteMatch, context: __SerdeContext): any => { return { - ...(input.prefix !== undefined && { prefix: input.prefix }), + ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }), }; }; const serializeAws_restJson1HttpRetryPolicy = (input: HttpRetryPolicy, context: __SerdeContext): any => { return { - ...(input.httpRetryEvents !== undefined && { - httpRetryEvents: serializeAws_restJson1HttpRetryPolicyEvents(input.httpRetryEvents, context), - }), - ...(input.maxRetries !== undefined && { maxRetries: input.maxRetries }), - ...(input.perRetryTimeout !== undefined && { - perRetryTimeout: serializeAws_restJson1Duration(input.perRetryTimeout, context), - }), - ...(input.tcpRetryEvents !== undefined && { - tcpRetryEvents: serializeAws_restJson1TcpRetryPolicyEvents(input.tcpRetryEvents, context), - }), + ...(input.httpRetryEvents !== undefined && + input.httpRetryEvents !== null && { + httpRetryEvents: serializeAws_restJson1HttpRetryPolicyEvents(input.httpRetryEvents, context), + }), + ...(input.maxRetries !== undefined && input.maxRetries !== null && { maxRetries: input.maxRetries }), + ...(input.perRetryTimeout !== undefined && + input.perRetryTimeout !== null && { + perRetryTimeout: serializeAws_restJson1Duration(input.perRetryTimeout, context), + }), + ...(input.tcpRetryEvents !== undefined && + input.tcpRetryEvents !== null && { + tcpRetryEvents: serializeAws_restJson1TcpRetryPolicyEvents(input.tcpRetryEvents, context), + }), }; }; const serializeAws_restJson1HttpRetryPolicyEvents = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1HttpRoute = (input: HttpRoute, context: __SerdeContext): any => { return { - ...(input.action !== undefined && { action: serializeAws_restJson1HttpRouteAction(input.action, context) }), - ...(input.match !== undefined && { match: serializeAws_restJson1HttpRouteMatch(input.match, context) }), - ...(input.retryPolicy !== undefined && { - retryPolicy: serializeAws_restJson1HttpRetryPolicy(input.retryPolicy, context), - }), - ...(input.timeout !== undefined && { timeout: serializeAws_restJson1HttpTimeout(input.timeout, context) }), + ...(input.action !== undefined && + input.action !== null && { action: serializeAws_restJson1HttpRouteAction(input.action, context) }), + ...(input.match !== undefined && + input.match !== null && { match: serializeAws_restJson1HttpRouteMatch(input.match, context) }), + ...(input.retryPolicy !== undefined && + input.retryPolicy !== null && { retryPolicy: serializeAws_restJson1HttpRetryPolicy(input.retryPolicy, context) }), + ...(input.timeout !== undefined && + input.timeout !== null && { timeout: serializeAws_restJson1HttpTimeout(input.timeout, context) }), }; }; const serializeAws_restJson1HttpRouteAction = (input: HttpRouteAction, context: __SerdeContext): any => { return { - ...(input.weightedTargets !== undefined && { - weightedTargets: serializeAws_restJson1WeightedTargets(input.weightedTargets, context), - }), + ...(input.weightedTargets !== undefined && + input.weightedTargets !== null && { + weightedTargets: serializeAws_restJson1WeightedTargets(input.weightedTargets, context), + }), }; }; const serializeAws_restJson1HttpRouteHeader = (input: HttpRouteHeader, context: __SerdeContext): any => { return { - ...(input.invert !== undefined && { invert: input.invert }), - ...(input.match !== undefined && { match: serializeAws_restJson1HeaderMatchMethod(input.match, context) }), - ...(input.name !== undefined && { name: input.name }), + ...(input.invert !== undefined && input.invert !== null && { invert: input.invert }), + ...(input.match !== undefined && + input.match !== null && { match: serializeAws_restJson1HeaderMatchMethod(input.match, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_restJson1HttpRouteHeaders = (input: HttpRouteHeader[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1HttpRouteHeader(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1HttpRouteHeader(entry, context); + }); }; const serializeAws_restJson1HttpRouteMatch = (input: HttpRouteMatch, context: __SerdeContext): any => { return { - ...(input.headers !== undefined && { headers: serializeAws_restJson1HttpRouteHeaders(input.headers, context) }), - ...(input.method !== undefined && { method: input.method }), - ...(input.prefix !== undefined && { prefix: input.prefix }), - ...(input.scheme !== undefined && { scheme: input.scheme }), + ...(input.headers !== undefined && + input.headers !== null && { headers: serializeAws_restJson1HttpRouteHeaders(input.headers, context) }), + ...(input.method !== undefined && input.method !== null && { method: input.method }), + ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }), + ...(input.scheme !== undefined && input.scheme !== null && { scheme: input.scheme }), }; }; const serializeAws_restJson1HttpTimeout = (input: HttpTimeout, context: __SerdeContext): any => { return { - ...(input.idle !== undefined && { idle: serializeAws_restJson1Duration(input.idle, context) }), - ...(input.perRequest !== undefined && { perRequest: serializeAws_restJson1Duration(input.perRequest, context) }), + ...(input.idle !== undefined && + input.idle !== null && { idle: serializeAws_restJson1Duration(input.idle, context) }), + ...(input.perRequest !== undefined && + input.perRequest !== null && { perRequest: serializeAws_restJson1Duration(input.perRequest, context) }), }; }; const serializeAws_restJson1Listener = (input: Listener, context: __SerdeContext): any => { return { - ...(input.healthCheck !== undefined && { - healthCheck: serializeAws_restJson1HealthCheckPolicy(input.healthCheck, context), - }), - ...(input.portMapping !== undefined && { - portMapping: serializeAws_restJson1PortMapping(input.portMapping, context), - }), - ...(input.timeout !== undefined && { timeout: serializeAws_restJson1ListenerTimeout(input.timeout, context) }), - ...(input.tls !== undefined && { tls: serializeAws_restJson1ListenerTls(input.tls, context) }), + ...(input.healthCheck !== undefined && + input.healthCheck !== null && { + healthCheck: serializeAws_restJson1HealthCheckPolicy(input.healthCheck, context), + }), + ...(input.portMapping !== undefined && + input.portMapping !== null && { portMapping: serializeAws_restJson1PortMapping(input.portMapping, context) }), + ...(input.timeout !== undefined && + input.timeout !== null && { timeout: serializeAws_restJson1ListenerTimeout(input.timeout, context) }), + ...(input.tls !== undefined && + input.tls !== null && { tls: serializeAws_restJson1ListenerTls(input.tls, context) }), }; }; const serializeAws_restJson1Listeners = (input: Listener[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Listener(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Listener(entry, context); + }); }; const serializeAws_restJson1ListenerTimeout = (input: ListenerTimeout, context: __SerdeContext): any => { @@ -6206,10 +6276,11 @@ const serializeAws_restJson1ListenerTimeout = (input: ListenerTimeout, context: const serializeAws_restJson1ListenerTls = (input: ListenerTls, context: __SerdeContext): any => { return { - ...(input.certificate !== undefined && { - certificate: serializeAws_restJson1ListenerTlsCertificate(input.certificate, context), - }), - ...(input.mode !== undefined && { mode: input.mode }), + ...(input.certificate !== undefined && + input.certificate !== null && { + certificate: serializeAws_restJson1ListenerTlsCertificate(input.certificate, context), + }), + ...(input.mode !== undefined && input.mode !== null && { mode: input.mode }), }; }; @@ -6218,7 +6289,8 @@ const serializeAws_restJson1ListenerTlsAcmCertificate = ( context: __SerdeContext ): any => { return { - ...(input.certificateArn !== undefined && { certificateArn: input.certificateArn }), + ...(input.certificateArn !== undefined && + input.certificateArn !== null && { certificateArn: input.certificateArn }), }; }; @@ -6235,50 +6307,62 @@ const serializeAws_restJson1ListenerTlsFileCertificate = ( context: __SerdeContext ): any => { return { - ...(input.certificateChain !== undefined && { certificateChain: input.certificateChain }), - ...(input.privateKey !== undefined && { privateKey: input.privateKey }), + ...(input.certificateChain !== undefined && + input.certificateChain !== null && { certificateChain: input.certificateChain }), + ...(input.privateKey !== undefined && input.privateKey !== null && { privateKey: input.privateKey }), }; }; const serializeAws_restJson1Logging = (input: Logging, context: __SerdeContext): any => { return { - ...(input.accessLog !== undefined && { accessLog: serializeAws_restJson1AccessLog(input.accessLog, context) }), + ...(input.accessLog !== undefined && + input.accessLog !== null && { accessLog: serializeAws_restJson1AccessLog(input.accessLog, context) }), }; }; const serializeAws_restJson1MatchRange = (input: MatchRange, context: __SerdeContext): any => { return { - ...(input.end !== undefined && { end: input.end }), - ...(input.start !== undefined && { start: input.start }), + ...(input.end !== undefined && input.end !== null && { end: input.end }), + ...(input.start !== undefined && input.start !== null && { start: input.start }), }; }; const serializeAws_restJson1MeshSpec = (input: MeshSpec, context: __SerdeContext): any => { return { - ...(input.egressFilter !== undefined && { - egressFilter: serializeAws_restJson1EgressFilter(input.egressFilter, context), - }), + ...(input.egressFilter !== undefined && + input.egressFilter !== null && { egressFilter: serializeAws_restJson1EgressFilter(input.egressFilter, context) }), }; }; const serializeAws_restJson1PortMapping = (input: PortMapping, context: __SerdeContext): any => { return { - ...(input.port !== undefined && { port: input.port }), - ...(input.protocol !== undefined && { protocol: input.protocol }), + ...(input.port !== undefined && input.port !== null && { port: input.port }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), }; }; const serializeAws_restJson1PortSet = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1RouteSpec = (input: RouteSpec, context: __SerdeContext): any => { return { - ...(input.grpcRoute !== undefined && { grpcRoute: serializeAws_restJson1GrpcRoute(input.grpcRoute, context) }), - ...(input.http2Route !== undefined && { http2Route: serializeAws_restJson1HttpRoute(input.http2Route, context) }), - ...(input.httpRoute !== undefined && { httpRoute: serializeAws_restJson1HttpRoute(input.httpRoute, context) }), - ...(input.priority !== undefined && { priority: input.priority }), - ...(input.tcpRoute !== undefined && { tcpRoute: serializeAws_restJson1TcpRoute(input.tcpRoute, context) }), + ...(input.grpcRoute !== undefined && + input.grpcRoute !== null && { grpcRoute: serializeAws_restJson1GrpcRoute(input.grpcRoute, context) }), + ...(input.http2Route !== undefined && + input.http2Route !== null && { http2Route: serializeAws_restJson1HttpRoute(input.http2Route, context) }), + ...(input.httpRoute !== undefined && + input.httpRoute !== null && { httpRoute: serializeAws_restJson1HttpRoute(input.httpRoute, context) }), + ...(input.priority !== undefined && input.priority !== null && { priority: input.priority }), + ...(input.tcpRoute !== undefined && + input.tcpRoute !== null && { tcpRoute: serializeAws_restJson1TcpRoute(input.tcpRoute, context) }), }; }; @@ -6291,17 +6375,31 @@ const serializeAws_restJson1ServiceDiscovery = (input: ServiceDiscovery, context }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagList = (input: TagRef[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1TagRef(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TagRef(entry, context); + }); }; const serializeAws_restJson1TagRef = (input: TagRef, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; @@ -6309,33 +6407,45 @@ const serializeAws_restJson1TcpRetryPolicyEvents = ( input: (TcpRetryPolicyEvent | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TcpRoute = (input: TcpRoute, context: __SerdeContext): any => { return { - ...(input.action !== undefined && { action: serializeAws_restJson1TcpRouteAction(input.action, context) }), - ...(input.timeout !== undefined && { timeout: serializeAws_restJson1TcpTimeout(input.timeout, context) }), + ...(input.action !== undefined && + input.action !== null && { action: serializeAws_restJson1TcpRouteAction(input.action, context) }), + ...(input.timeout !== undefined && + input.timeout !== null && { timeout: serializeAws_restJson1TcpTimeout(input.timeout, context) }), }; }; const serializeAws_restJson1TcpRouteAction = (input: TcpRouteAction, context: __SerdeContext): any => { return { - ...(input.weightedTargets !== undefined && { - weightedTargets: serializeAws_restJson1WeightedTargets(input.weightedTargets, context), - }), + ...(input.weightedTargets !== undefined && + input.weightedTargets !== null && { + weightedTargets: serializeAws_restJson1WeightedTargets(input.weightedTargets, context), + }), }; }; const serializeAws_restJson1TcpTimeout = (input: TcpTimeout, context: __SerdeContext): any => { return { - ...(input.idle !== undefined && { idle: serializeAws_restJson1Duration(input.idle, context) }), + ...(input.idle !== undefined && + input.idle !== null && { idle: serializeAws_restJson1Duration(input.idle, context) }), }; }; const serializeAws_restJson1TlsValidationContext = (input: TlsValidationContext, context: __SerdeContext): any => { return { - ...(input.trust !== undefined && { trust: serializeAws_restJson1TlsValidationContextTrust(input.trust, context) }), + ...(input.trust !== undefined && + input.trust !== null && { trust: serializeAws_restJson1TlsValidationContextTrust(input.trust, context) }), }; }; @@ -6344,9 +6454,13 @@ const serializeAws_restJson1TlsValidationContextAcmTrust = ( context: __SerdeContext ): any => { return { - ...(input.certificateAuthorityArns !== undefined && { - certificateAuthorityArns: serializeAws_restJson1CertificateAuthorityArns(input.certificateAuthorityArns, context), - }), + ...(input.certificateAuthorityArns !== undefined && + input.certificateAuthorityArns !== null && { + certificateAuthorityArns: serializeAws_restJson1CertificateAuthorityArns( + input.certificateAuthorityArns, + context + ), + }), }; }; @@ -6355,7 +6469,8 @@ const serializeAws_restJson1TlsValidationContextFileTrust = ( context: __SerdeContext ): any => { return { - ...(input.certificateChain !== undefined && { certificateChain: input.certificateChain }), + ...(input.certificateChain !== undefined && + input.certificateChain !== null && { certificateChain: input.certificateChain }), }; }; @@ -6385,9 +6500,10 @@ const serializeAws_restJson1VirtualGatewayBackendDefaults = ( context: __SerdeContext ): any => { return { - ...(input.clientPolicy !== undefined && { - clientPolicy: serializeAws_restJson1VirtualGatewayClientPolicy(input.clientPolicy, context), - }), + ...(input.clientPolicy !== undefined && + input.clientPolicy !== null && { + clientPolicy: serializeAws_restJson1VirtualGatewayClientPolicy(input.clientPolicy, context), + }), }; }; @@ -6395,7 +6511,14 @@ const serializeAws_restJson1VirtualGatewayCertificateAuthorityArns = ( input: string[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1VirtualGatewayClientPolicy = ( @@ -6403,7 +6526,8 @@ const serializeAws_restJson1VirtualGatewayClientPolicy = ( context: __SerdeContext ): any => { return { - ...(input.tls !== undefined && { tls: serializeAws_restJson1VirtualGatewayClientPolicyTls(input.tls, context) }), + ...(input.tls !== undefined && + input.tls !== null && { tls: serializeAws_restJson1VirtualGatewayClientPolicyTls(input.tls, context) }), }; }; @@ -6412,11 +6536,13 @@ const serializeAws_restJson1VirtualGatewayClientPolicyTls = ( context: __SerdeContext ): any => { return { - ...(input.enforce !== undefined && { enforce: input.enforce }), - ...(input.ports !== undefined && { ports: serializeAws_restJson1PortSet(input.ports, context) }), - ...(input.validation !== undefined && { - validation: serializeAws_restJson1VirtualGatewayTlsValidationContext(input.validation, context), - }), + ...(input.enforce !== undefined && input.enforce !== null && { enforce: input.enforce }), + ...(input.ports !== undefined && + input.ports !== null && { ports: serializeAws_restJson1PortSet(input.ports, context) }), + ...(input.validation !== undefined && + input.validation !== null && { + validation: serializeAws_restJson1VirtualGatewayTlsValidationContext(input.validation, context), + }), }; }; @@ -6425,7 +6551,7 @@ const serializeAws_restJson1VirtualGatewayFileAccessLog = ( context: __SerdeContext ): any => { return { - ...(input.path !== undefined && { path: input.path }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), }; }; @@ -6434,25 +6560,31 @@ const serializeAws_restJson1VirtualGatewayHealthCheckPolicy = ( context: __SerdeContext ): any => { return { - ...(input.healthyThreshold !== undefined && { healthyThreshold: input.healthyThreshold }), - ...(input.intervalMillis !== undefined && { intervalMillis: input.intervalMillis }), - ...(input.path !== undefined && { path: input.path }), - ...(input.port !== undefined && { port: input.port }), - ...(input.protocol !== undefined && { protocol: input.protocol }), - ...(input.timeoutMillis !== undefined && { timeoutMillis: input.timeoutMillis }), - ...(input.unhealthyThreshold !== undefined && { unhealthyThreshold: input.unhealthyThreshold }), + ...(input.healthyThreshold !== undefined && + input.healthyThreshold !== null && { healthyThreshold: input.healthyThreshold }), + ...(input.intervalMillis !== undefined && + input.intervalMillis !== null && { intervalMillis: input.intervalMillis }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), + ...(input.port !== undefined && input.port !== null && { port: input.port }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), + ...(input.timeoutMillis !== undefined && input.timeoutMillis !== null && { timeoutMillis: input.timeoutMillis }), + ...(input.unhealthyThreshold !== undefined && + input.unhealthyThreshold !== null && { unhealthyThreshold: input.unhealthyThreshold }), }; }; const serializeAws_restJson1VirtualGatewayListener = (input: VirtualGatewayListener, context: __SerdeContext): any => { return { - ...(input.healthCheck !== undefined && { - healthCheck: serializeAws_restJson1VirtualGatewayHealthCheckPolicy(input.healthCheck, context), - }), - ...(input.portMapping !== undefined && { - portMapping: serializeAws_restJson1VirtualGatewayPortMapping(input.portMapping, context), - }), - ...(input.tls !== undefined && { tls: serializeAws_restJson1VirtualGatewayListenerTls(input.tls, context) }), + ...(input.healthCheck !== undefined && + input.healthCheck !== null && { + healthCheck: serializeAws_restJson1VirtualGatewayHealthCheckPolicy(input.healthCheck, context), + }), + ...(input.portMapping !== undefined && + input.portMapping !== null && { + portMapping: serializeAws_restJson1VirtualGatewayPortMapping(input.portMapping, context), + }), + ...(input.tls !== undefined && + input.tls !== null && { tls: serializeAws_restJson1VirtualGatewayListenerTls(input.tls, context) }), }; }; @@ -6460,7 +6592,14 @@ const serializeAws_restJson1VirtualGatewayListeners = ( input: VirtualGatewayListener[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1VirtualGatewayListener(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1VirtualGatewayListener(entry, context); + }); }; const serializeAws_restJson1VirtualGatewayListenerTls = ( @@ -6468,10 +6607,11 @@ const serializeAws_restJson1VirtualGatewayListenerTls = ( context: __SerdeContext ): any => { return { - ...(input.certificate !== undefined && { - certificate: serializeAws_restJson1VirtualGatewayListenerTlsCertificate(input.certificate, context), - }), - ...(input.mode !== undefined && { mode: input.mode }), + ...(input.certificate !== undefined && + input.certificate !== null && { + certificate: serializeAws_restJson1VirtualGatewayListenerTlsCertificate(input.certificate, context), + }), + ...(input.mode !== undefined && input.mode !== null && { mode: input.mode }), }; }; @@ -6480,7 +6620,8 @@ const serializeAws_restJson1VirtualGatewayListenerTlsAcmCertificate = ( context: __SerdeContext ): any => { return { - ...(input.certificateArn !== undefined && { certificateArn: input.certificateArn }), + ...(input.certificateArn !== undefined && + input.certificateArn !== null && { certificateArn: input.certificateArn }), }; }; @@ -6500,16 +6641,18 @@ const serializeAws_restJson1VirtualGatewayListenerTlsFileCertificate = ( context: __SerdeContext ): any => { return { - ...(input.certificateChain !== undefined && { certificateChain: input.certificateChain }), - ...(input.privateKey !== undefined && { privateKey: input.privateKey }), + ...(input.certificateChain !== undefined && + input.certificateChain !== null && { certificateChain: input.certificateChain }), + ...(input.privateKey !== undefined && input.privateKey !== null && { privateKey: input.privateKey }), }; }; const serializeAws_restJson1VirtualGatewayLogging = (input: VirtualGatewayLogging, context: __SerdeContext): any => { return { - ...(input.accessLog !== undefined && { - accessLog: serializeAws_restJson1VirtualGatewayAccessLog(input.accessLog, context), - }), + ...(input.accessLog !== undefined && + input.accessLog !== null && { + accessLog: serializeAws_restJson1VirtualGatewayAccessLog(input.accessLog, context), + }), }; }; @@ -6518,22 +6661,23 @@ const serializeAws_restJson1VirtualGatewayPortMapping = ( context: __SerdeContext ): any => { return { - ...(input.port !== undefined && { port: input.port }), - ...(input.protocol !== undefined && { protocol: input.protocol }), + ...(input.port !== undefined && input.port !== null && { port: input.port }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), }; }; const serializeAws_restJson1VirtualGatewaySpec = (input: VirtualGatewaySpec, context: __SerdeContext): any => { return { - ...(input.backendDefaults !== undefined && { - backendDefaults: serializeAws_restJson1VirtualGatewayBackendDefaults(input.backendDefaults, context), - }), - ...(input.listeners !== undefined && { - listeners: serializeAws_restJson1VirtualGatewayListeners(input.listeners, context), - }), - ...(input.logging !== undefined && { - logging: serializeAws_restJson1VirtualGatewayLogging(input.logging, context), - }), + ...(input.backendDefaults !== undefined && + input.backendDefaults !== null && { + backendDefaults: serializeAws_restJson1VirtualGatewayBackendDefaults(input.backendDefaults, context), + }), + ...(input.listeners !== undefined && + input.listeners !== null && { + listeners: serializeAws_restJson1VirtualGatewayListeners(input.listeners, context), + }), + ...(input.logging !== undefined && + input.logging !== null && { logging: serializeAws_restJson1VirtualGatewayLogging(input.logging, context) }), }; }; @@ -6542,9 +6686,10 @@ const serializeAws_restJson1VirtualGatewayTlsValidationContext = ( context: __SerdeContext ): any => { return { - ...(input.trust !== undefined && { - trust: serializeAws_restJson1VirtualGatewayTlsValidationContextTrust(input.trust, context), - }), + ...(input.trust !== undefined && + input.trust !== null && { + trust: serializeAws_restJson1VirtualGatewayTlsValidationContextTrust(input.trust, context), + }), }; }; @@ -6553,12 +6698,13 @@ const serializeAws_restJson1VirtualGatewayTlsValidationContextAcmTrust = ( context: __SerdeContext ): any => { return { - ...(input.certificateAuthorityArns !== undefined && { - certificateAuthorityArns: serializeAws_restJson1VirtualGatewayCertificateAuthorityArns( - input.certificateAuthorityArns, - context - ), - }), + ...(input.certificateAuthorityArns !== undefined && + input.certificateAuthorityArns !== null && { + certificateAuthorityArns: serializeAws_restJson1VirtualGatewayCertificateAuthorityArns( + input.certificateAuthorityArns, + context + ), + }), }; }; @@ -6567,7 +6713,8 @@ const serializeAws_restJson1VirtualGatewayTlsValidationContextFileTrust = ( context: __SerdeContext ): any => { return { - ...(input.certificateChain !== undefined && { certificateChain: input.certificateChain }), + ...(input.certificateChain !== undefined && + input.certificateChain !== null && { certificateChain: input.certificateChain }), }; }; @@ -6587,34 +6734,46 @@ const serializeAws_restJson1VirtualNodeServiceProvider = ( context: __SerdeContext ): any => { return { - ...(input.virtualNodeName !== undefined && { virtualNodeName: input.virtualNodeName }), + ...(input.virtualNodeName !== undefined && + input.virtualNodeName !== null && { virtualNodeName: input.virtualNodeName }), }; }; const serializeAws_restJson1VirtualNodeSpec = (input: VirtualNodeSpec, context: __SerdeContext): any => { return { - ...(input.backendDefaults !== undefined && { - backendDefaults: serializeAws_restJson1BackendDefaults(input.backendDefaults, context), - }), - ...(input.backends !== undefined && { backends: serializeAws_restJson1Backends(input.backends, context) }), - ...(input.listeners !== undefined && { listeners: serializeAws_restJson1Listeners(input.listeners, context) }), - ...(input.logging !== undefined && { logging: serializeAws_restJson1Logging(input.logging, context) }), - ...(input.serviceDiscovery !== undefined && { - serviceDiscovery: serializeAws_restJson1ServiceDiscovery(input.serviceDiscovery, context), - }), + ...(input.backendDefaults !== undefined && + input.backendDefaults !== null && { + backendDefaults: serializeAws_restJson1BackendDefaults(input.backendDefaults, context), + }), + ...(input.backends !== undefined && + input.backends !== null && { backends: serializeAws_restJson1Backends(input.backends, context) }), + ...(input.listeners !== undefined && + input.listeners !== null && { listeners: serializeAws_restJson1Listeners(input.listeners, context) }), + ...(input.logging !== undefined && + input.logging !== null && { logging: serializeAws_restJson1Logging(input.logging, context) }), + ...(input.serviceDiscovery !== undefined && + input.serviceDiscovery !== null && { + serviceDiscovery: serializeAws_restJson1ServiceDiscovery(input.serviceDiscovery, context), + }), }; }; const serializeAws_restJson1VirtualRouterListener = (input: VirtualRouterListener, context: __SerdeContext): any => { return { - ...(input.portMapping !== undefined && { - portMapping: serializeAws_restJson1PortMapping(input.portMapping, context), - }), + ...(input.portMapping !== undefined && + input.portMapping !== null && { portMapping: serializeAws_restJson1PortMapping(input.portMapping, context) }), }; }; const serializeAws_restJson1VirtualRouterListeners = (input: VirtualRouterListener[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1VirtualRouterListener(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1VirtualRouterListener(entry, context); + }); }; const serializeAws_restJson1VirtualRouterServiceProvider = ( @@ -6622,24 +6781,26 @@ const serializeAws_restJson1VirtualRouterServiceProvider = ( context: __SerdeContext ): any => { return { - ...(input.virtualRouterName !== undefined && { virtualRouterName: input.virtualRouterName }), + ...(input.virtualRouterName !== undefined && + input.virtualRouterName !== null && { virtualRouterName: input.virtualRouterName }), }; }; const serializeAws_restJson1VirtualRouterSpec = (input: VirtualRouterSpec, context: __SerdeContext): any => { return { - ...(input.listeners !== undefined && { - listeners: serializeAws_restJson1VirtualRouterListeners(input.listeners, context), - }), + ...(input.listeners !== undefined && + input.listeners !== null && { + listeners: serializeAws_restJson1VirtualRouterListeners(input.listeners, context), + }), }; }; const serializeAws_restJson1VirtualServiceBackend = (input: VirtualServiceBackend, context: __SerdeContext): any => { return { - ...(input.clientPolicy !== undefined && { - clientPolicy: serializeAws_restJson1ClientPolicy(input.clientPolicy, context), - }), - ...(input.virtualServiceName !== undefined && { virtualServiceName: input.virtualServiceName }), + ...(input.clientPolicy !== undefined && + input.clientPolicy !== null && { clientPolicy: serializeAws_restJson1ClientPolicy(input.clientPolicy, context) }), + ...(input.virtualServiceName !== undefined && + input.virtualServiceName !== null && { virtualServiceName: input.virtualServiceName }), }; }; @@ -6653,21 +6814,27 @@ const serializeAws_restJson1VirtualServiceProvider = (input: VirtualServiceProvi const serializeAws_restJson1VirtualServiceSpec = (input: VirtualServiceSpec, context: __SerdeContext): any => { return { - ...(input.provider !== undefined && { - provider: serializeAws_restJson1VirtualServiceProvider(input.provider, context), - }), + ...(input.provider !== undefined && + input.provider !== null && { provider: serializeAws_restJson1VirtualServiceProvider(input.provider, context) }), }; }; const serializeAws_restJson1WeightedTarget = (input: WeightedTarget, context: __SerdeContext): any => { return { - ...(input.virtualNode !== undefined && { virtualNode: input.virtualNode }), - ...(input.weight !== undefined && { weight: input.weight }), + ...(input.virtualNode !== undefined && input.virtualNode !== null && { virtualNode: input.virtualNode }), + ...(input.weight !== undefined && input.weight !== null && { weight: input.weight }), }; }; const serializeAws_restJson1WeightedTargets = (input: WeightedTarget[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1WeightedTarget(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1WeightedTarget(entry, context); + }); }; const deserializeAws_restJson1AccessLog = (output: any, context: __SerdeContext): AccessLog => { @@ -6693,7 +6860,14 @@ const deserializeAws_restJson1AwsCloudMapInstanceAttributes = ( output: any, context: __SerdeContext ): AwsCloudMapInstanceAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsCloudMapInstanceAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsCloudMapInstanceAttribute(entry, context); + }); }; const deserializeAws_restJson1AwsCloudMapServiceDiscovery = ( @@ -6730,11 +6904,25 @@ const deserializeAws_restJson1BackendDefaults = (output: any, context: __SerdeCo }; const deserializeAws_restJson1Backends = (output: any, context: __SerdeContext): Backend[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Backend(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Backend(entry, context); + }); }; const deserializeAws_restJson1CertificateAuthorityArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ClientPolicy = (output: any, context: __SerdeContext): ClientPolicy => { @@ -6810,7 +6998,14 @@ const deserializeAws_restJson1GatewayRouteData = (output: any, context: __SerdeC }; const deserializeAws_restJson1GatewayRouteList = (output: any, context: __SerdeContext): GatewayRouteRef[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GatewayRouteRef(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GatewayRouteRef(entry, context); + }); }; const deserializeAws_restJson1GatewayRouteRef = (output: any, context: __SerdeContext): GatewayRouteRef => { @@ -6939,7 +7134,14 @@ const deserializeAws_restJson1GrpcRetryPolicyEvents = ( output: any, context: __SerdeContext ): (GrpcRetryPolicyEvent | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1GrpcRoute = (output: any, context: __SerdeContext): GrpcRoute => { @@ -6995,7 +7197,14 @@ const deserializeAws_restJson1GrpcRouteMetadata = (output: any, context: __Serde }; const deserializeAws_restJson1GrpcRouteMetadataList = (output: any, context: __SerdeContext): GrpcRouteMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GrpcRouteMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GrpcRouteMetadata(entry, context); + }); }; const deserializeAws_restJson1GrpcRouteMetadataMatchMethod = ( @@ -7140,7 +7349,14 @@ const deserializeAws_restJson1HttpRetryPolicy = (output: any, context: __SerdeCo }; const deserializeAws_restJson1HttpRetryPolicyEvents = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1HttpRoute = (output: any, context: __SerdeContext): HttpRoute => { @@ -7185,7 +7401,14 @@ const deserializeAws_restJson1HttpRouteHeader = (output: any, context: __SerdeCo }; const deserializeAws_restJson1HttpRouteHeaders = (output: any, context: __SerdeContext): HttpRouteHeader[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HttpRouteHeader(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HttpRouteHeader(entry, context); + }); }; const deserializeAws_restJson1HttpRouteMatch = (output: any, context: __SerdeContext): HttpRouteMatch => { @@ -7235,7 +7458,14 @@ const deserializeAws_restJson1Listener = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Listeners = (output: any, context: __SerdeContext): Listener[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Listener(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Listener(entry, context); + }); }; const deserializeAws_restJson1ListenerTimeout = (output: any, context: __SerdeContext): ListenerTimeout => { @@ -7345,7 +7575,14 @@ const deserializeAws_restJson1MeshData = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1MeshList = (output: any, context: __SerdeContext): MeshRef[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MeshRef(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MeshRef(entry, context); + }); }; const deserializeAws_restJson1MeshRef = (output: any, context: __SerdeContext): MeshRef => { @@ -7390,7 +7627,14 @@ const deserializeAws_restJson1PortMapping = (output: any, context: __SerdeContex }; const deserializeAws_restJson1PortSet = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ResourceMetadata = (output: any, context: __SerdeContext): ResourceMetadata => { @@ -7436,7 +7680,14 @@ const deserializeAws_restJson1RouteData = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1RouteList = (output: any, context: __SerdeContext): RouteRef[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RouteRef(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RouteRef(entry, context); + }); }; const deserializeAws_restJson1RouteRef = (output: any, context: __SerdeContext): RouteRef => { @@ -7506,7 +7757,14 @@ const deserializeAws_restJson1ServiceDiscovery = (output: any, context: __SerdeC }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): TagRef[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TagRef(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TagRef(entry, context); + }); }; const deserializeAws_restJson1TagRef = (output: any, context: __SerdeContext): TagRef => { @@ -7520,7 +7778,14 @@ const deserializeAws_restJson1TcpRetryPolicyEvents = ( output: any, context: __SerdeContext ): (TcpRetryPolicyEvent | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TcpRoute = (output: any, context: __SerdeContext): TcpRoute => { @@ -7630,7 +7895,14 @@ const deserializeAws_restJson1VirtualGatewayCertificateAuthorityArns = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1VirtualGatewayClientPolicy = ( @@ -7715,7 +7987,14 @@ const deserializeAws_restJson1VirtualGatewayHealthCheckPolicy = ( }; const deserializeAws_restJson1VirtualGatewayList = (output: any, context: __SerdeContext): VirtualGatewayRef[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VirtualGatewayRef(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VirtualGatewayRef(entry, context); + }); }; const deserializeAws_restJson1VirtualGatewayListener = ( @@ -7742,7 +8021,14 @@ const deserializeAws_restJson1VirtualGatewayListeners = ( output: any, context: __SerdeContext ): VirtualGatewayListener[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VirtualGatewayListener(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VirtualGatewayListener(entry, context); + }); }; const deserializeAws_restJson1VirtualGatewayListenerTls = ( @@ -7933,7 +8219,14 @@ const deserializeAws_restJson1VirtualNodeData = (output: any, context: __SerdeCo }; const deserializeAws_restJson1VirtualNodeList = (output: any, context: __SerdeContext): VirtualNodeRef[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VirtualNodeRef(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VirtualNodeRef(entry, context); + }); }; const deserializeAws_restJson1VirtualNodeRef = (output: any, context: __SerdeContext): VirtualNodeRef => { @@ -8021,7 +8314,14 @@ const deserializeAws_restJson1VirtualRouterData = (output: any, context: __Serde }; const deserializeAws_restJson1VirtualRouterList = (output: any, context: __SerdeContext): VirtualRouterRef[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VirtualRouterRef(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VirtualRouterRef(entry, context); + }); }; const deserializeAws_restJson1VirtualRouterListener = (output: any, context: __SerdeContext): VirtualRouterListener => { @@ -8037,7 +8337,14 @@ const deserializeAws_restJson1VirtualRouterListeners = ( output: any, context: __SerdeContext ): VirtualRouterListener[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VirtualRouterListener(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VirtualRouterListener(entry, context); + }); }; const deserializeAws_restJson1VirtualRouterRef = (output: any, context: __SerdeContext): VirtualRouterRef => { @@ -8126,7 +8433,14 @@ const deserializeAws_restJson1VirtualServiceData = (output: any, context: __Serd }; const deserializeAws_restJson1VirtualServiceList = (output: any, context: __SerdeContext): VirtualServiceRef[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VirtualServiceRef(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VirtualServiceRef(entry, context); + }); }; const deserializeAws_restJson1VirtualServiceProvider = ( @@ -8192,7 +8506,14 @@ const deserializeAws_restJson1WeightedTarget = (output: any, context: __SerdeCon }; const deserializeAws_restJson1WeightedTargets = (output: any, context: __SerdeContext): WeightedTarget[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1WeightedTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1WeightedTarget(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -8215,6 +8536,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-appconfig/protocols/Aws_restJson1.ts b/clients/client-appconfig/protocols/Aws_restJson1.ts index 26ea1c3ffcbc..b2fd22f2bd41 100644 --- a/clients/client-appconfig/protocols/Aws_restJson1.ts +++ b/clients/client-appconfig/protocols/Aws_restJson1.ts @@ -114,14 +114,14 @@ export const serializeAws_restJson1CreateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -140,7 +140,7 @@ export const serializeAws_restJson1CreateConfigurationProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/configurationprofiles"; if (input.ApplicationId !== undefined) { @@ -154,14 +154,14 @@ export const serializeAws_restJson1CreateConfigurationProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LocationUri !== undefined && { LocationUri: input.LocationUri }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RetrievalRoleArn !== undefined && { RetrievalRoleArn: input.RetrievalRoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), - ...(input.Validators !== undefined && { - Validators: serializeAws_restJson1ValidatorList(input.Validators, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LocationUri !== undefined && input.LocationUri !== null && { LocationUri: input.LocationUri }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RetrievalRoleArn !== undefined && + input.RetrievalRoleArn !== null && { RetrievalRoleArn: input.RetrievalRoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Validators !== undefined && + input.Validators !== null && { Validators: serializeAws_restJson1ValidatorList(input.Validators, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -180,21 +180,21 @@ export const serializeAws_restJson1CreateDeploymentStrategyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deploymentstrategies"; let body: any; body = JSON.stringify({ - ...(input.DeploymentDurationInMinutes !== undefined && { - DeploymentDurationInMinutes: input.DeploymentDurationInMinutes, - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FinalBakeTimeInMinutes !== undefined && { FinalBakeTimeInMinutes: input.FinalBakeTimeInMinutes }), - ...(input.GrowthFactor !== undefined && { GrowthFactor: input.GrowthFactor }), - ...(input.GrowthType !== undefined && { GrowthType: input.GrowthType }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ReplicateTo !== undefined && { ReplicateTo: input.ReplicateTo }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.DeploymentDurationInMinutes !== undefined && + input.DeploymentDurationInMinutes !== null && { DeploymentDurationInMinutes: input.DeploymentDurationInMinutes }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FinalBakeTimeInMinutes !== undefined && + input.FinalBakeTimeInMinutes !== null && { FinalBakeTimeInMinutes: input.FinalBakeTimeInMinutes }), + ...(input.GrowthFactor !== undefined && input.GrowthFactor !== null && { GrowthFactor: input.GrowthFactor }), + ...(input.GrowthType !== undefined && input.GrowthType !== null && { GrowthType: input.GrowthType }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ReplicateTo !== undefined && input.ReplicateTo !== null && { ReplicateTo: input.ReplicateTo }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -213,7 +213,7 @@ export const serializeAws_restJson1CreateEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/environments"; if (input.ApplicationId !== undefined) { @@ -227,10 +227,11 @@ export const serializeAws_restJson1CreateEnvironmentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Monitors !== undefined && { Monitors: serializeAws_restJson1MonitorList(input.Monitors, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Monitors !== undefined && + input.Monitors !== null && { Monitors: serializeAws_restJson1MonitorList(input.Monitors, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -249,7 +250,7 @@ export const serializeAws_restJson1CreateHostedConfigurationVersionCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.LatestVersionNumber) && { "Latest-Version-Number": input.LatestVersionNumber!.toString(), }), @@ -296,9 +297,7 @@ export const serializeAws_restJson1DeleteApplicationCommand = async ( input: DeleteApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -326,9 +325,7 @@ export const serializeAws_restJson1DeleteConfigurationProfileCommand = async ( input: DeleteConfigurationProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -365,9 +362,7 @@ export const serializeAws_restJson1DeleteDeploymentStrategyCommand = async ( input: DeleteDeploymentStrategyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/deployementstrategies/{DeploymentStrategyId}"; if (input.DeploymentStrategyId !== undefined) { const labelValue: string = input.DeploymentStrategyId; @@ -395,9 +390,7 @@ export const serializeAws_restJson1DeleteEnvironmentCommand = async ( input: DeleteEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/environments/{EnvironmentId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -434,9 +427,7 @@ export const serializeAws_restJson1DeleteHostedConfigurationVersionCommand = asy input: DeleteHostedConfigurationVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions/{VersionNumber}"; if (input.ConfigurationProfileId !== undefined) { @@ -483,9 +474,7 @@ export const serializeAws_restJson1GetApplicationCommand = async ( input: GetApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -513,9 +502,7 @@ export const serializeAws_restJson1GetConfigurationCommand = async ( input: GetConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{Application}/environments/{Environment}/configurations/{Configuration}"; if (input.Environment !== undefined) { const labelValue: string = input.Environment; @@ -568,9 +555,7 @@ export const serializeAws_restJson1GetConfigurationProfileCommand = async ( input: GetConfigurationProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -607,9 +592,7 @@ export const serializeAws_restJson1GetDeploymentCommand = async ( input: GetDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}"; if (input.EnvironmentId !== undefined) { const labelValue: string = input.EnvironmentId; @@ -655,9 +638,7 @@ export const serializeAws_restJson1GetDeploymentStrategyCommand = async ( input: GetDeploymentStrategyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/deploymentstrategies/{DeploymentStrategyId}"; if (input.DeploymentStrategyId !== undefined) { const labelValue: string = input.DeploymentStrategyId; @@ -685,9 +666,7 @@ export const serializeAws_restJson1GetEnvironmentCommand = async ( input: GetEnvironmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/environments/{EnvironmentId}"; if (input.EnvironmentId !== undefined) { const labelValue: string = input.EnvironmentId; @@ -724,9 +703,7 @@ export const serializeAws_restJson1GetHostedConfigurationVersionCommand = async input: GetHostedConfigurationVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions/{VersionNumber}"; if (input.ConfigurationProfileId !== undefined) { @@ -773,9 +750,7 @@ export const serializeAws_restJson1ListApplicationsCommand = async ( input: ListApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications"; const query: any = { ...(input.NextToken !== undefined && { next_token: input.NextToken }), @@ -799,9 +774,7 @@ export const serializeAws_restJson1ListConfigurationProfilesCommand = async ( input: ListConfigurationProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/configurationprofiles"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -834,9 +807,7 @@ export const serializeAws_restJson1ListDeploymentsCommand = async ( input: ListDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -878,9 +849,7 @@ export const serializeAws_restJson1ListDeploymentStrategiesCommand = async ( input: ListDeploymentStrategiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/deploymentstrategies"; const query: any = { ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }), @@ -904,9 +873,7 @@ export const serializeAws_restJson1ListEnvironmentsCommand = async ( input: ListEnvironmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/environments"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -939,9 +906,7 @@ export const serializeAws_restJson1ListHostedConfigurationVersionsCommand = asyn input: ListHostedConfigurationVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/hostedconfigurationversions"; if (input.ApplicationId !== undefined) { @@ -984,9 +949,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1015,7 +978,7 @@ export const serializeAws_restJson1StartDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments"; if (input.ApplicationId !== undefined) { @@ -1038,11 +1001,14 @@ export const serializeAws_restJson1StartDeploymentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConfigurationProfileId !== undefined && { ConfigurationProfileId: input.ConfigurationProfileId }), - ...(input.ConfigurationVersion !== undefined && { ConfigurationVersion: input.ConfigurationVersion }), - ...(input.DeploymentStrategyId !== undefined && { DeploymentStrategyId: input.DeploymentStrategyId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.ConfigurationProfileId !== undefined && + input.ConfigurationProfileId !== null && { ConfigurationProfileId: input.ConfigurationProfileId }), + ...(input.ConfigurationVersion !== undefined && + input.ConfigurationVersion !== null && { ConfigurationVersion: input.ConfigurationVersion }), + ...(input.DeploymentStrategyId !== undefined && + input.DeploymentStrategyId !== null && { DeploymentStrategyId: input.DeploymentStrategyId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1060,9 +1026,7 @@ export const serializeAws_restJson1StopDeploymentCommand = async ( input: StopDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/environments/{EnvironmentId}/deployments/{DeploymentNumber}"; if (input.EnvironmentId !== undefined) { const labelValue: string = input.EnvironmentId; @@ -1109,7 +1073,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -1123,7 +1087,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1141,9 +1105,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1176,7 +1138,7 @@ export const serializeAws_restJson1UpdateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}"; if (input.ApplicationId !== undefined) { @@ -1190,8 +1152,8 @@ export const serializeAws_restJson1UpdateApplicationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1210,7 +1172,7 @@ export const serializeAws_restJson1UpdateConfigurationProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}"; if (input.ConfigurationProfileId !== undefined) { @@ -1233,12 +1195,12 @@ export const serializeAws_restJson1UpdateConfigurationProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RetrievalRoleArn !== undefined && { RetrievalRoleArn: input.RetrievalRoleArn }), - ...(input.Validators !== undefined && { - Validators: serializeAws_restJson1ValidatorList(input.Validators, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RetrievalRoleArn !== undefined && + input.RetrievalRoleArn !== null && { RetrievalRoleArn: input.RetrievalRoleArn }), + ...(input.Validators !== undefined && + input.Validators !== null && { Validators: serializeAws_restJson1ValidatorList(input.Validators, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1257,7 +1219,7 @@ export const serializeAws_restJson1UpdateDeploymentStrategyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deploymentstrategies/{DeploymentStrategyId}"; if (input.DeploymentStrategyId !== undefined) { @@ -1271,13 +1233,13 @@ export const serializeAws_restJson1UpdateDeploymentStrategyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DeploymentDurationInMinutes !== undefined && { - DeploymentDurationInMinutes: input.DeploymentDurationInMinutes, - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FinalBakeTimeInMinutes !== undefined && { FinalBakeTimeInMinutes: input.FinalBakeTimeInMinutes }), - ...(input.GrowthFactor !== undefined && { GrowthFactor: input.GrowthFactor }), - ...(input.GrowthType !== undefined && { GrowthType: input.GrowthType }), + ...(input.DeploymentDurationInMinutes !== undefined && + input.DeploymentDurationInMinutes !== null && { DeploymentDurationInMinutes: input.DeploymentDurationInMinutes }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FinalBakeTimeInMinutes !== undefined && + input.FinalBakeTimeInMinutes !== null && { FinalBakeTimeInMinutes: input.FinalBakeTimeInMinutes }), + ...(input.GrowthFactor !== undefined && input.GrowthFactor !== null && { GrowthFactor: input.GrowthFactor }), + ...(input.GrowthType !== undefined && input.GrowthType !== null && { GrowthType: input.GrowthType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1296,7 +1258,7 @@ export const serializeAws_restJson1UpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/environments/{EnvironmentId}"; if (input.ApplicationId !== undefined) { @@ -1319,9 +1281,10 @@ export const serializeAws_restJson1UpdateEnvironmentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Monitors !== undefined && { Monitors: serializeAws_restJson1MonitorList(input.Monitors, context) }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Monitors !== undefined && + input.Monitors !== null && { Monitors: serializeAws_restJson1MonitorList(input.Monitors, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1339,9 +1302,7 @@ export const serializeAws_restJson1ValidateConfigurationCommand = async ( input: ValidateConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/configurationprofiles/{ConfigurationProfileId}/validators"; if (input.ConfigurationProfileId !== undefined) { const labelValue: string = input.ConfigurationProfileId; @@ -4335,34 +4296,50 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async ( const serializeAws_restJson1Monitor = (input: Monitor, context: __SerdeContext): any => { return { - ...(input.AlarmArn !== undefined && { AlarmArn: input.AlarmArn }), - ...(input.AlarmRoleArn !== undefined && { AlarmRoleArn: input.AlarmRoleArn }), + ...(input.AlarmArn !== undefined && input.AlarmArn !== null && { AlarmArn: input.AlarmArn }), + ...(input.AlarmRoleArn !== undefined && input.AlarmRoleArn !== null && { AlarmRoleArn: input.AlarmRoleArn }), }; }; const serializeAws_restJson1MonitorList = (input: Monitor[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Monitor(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Monitor(entry, context); + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Validator = (input: Validator, context: __SerdeContext): any => { return { - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1ValidatorList = (input: Validator[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Validator(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Validator(entry, context); + }); }; const deserializeAws_restJson1Application = (output: any, context: __SerdeContext): Application => { @@ -4374,7 +4351,14 @@ const deserializeAws_restJson1Application = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ApplicationList = (output: any, context: __SerdeContext): Application[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Application(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Application(entry, context); + }); }; const deserializeAws_restJson1ConfigurationProfileSummary = ( @@ -4398,7 +4382,14 @@ const deserializeAws_restJson1ConfigurationProfileSummaryList = ( output: any, context: __SerdeContext ): ConfigurationProfileSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConfigurationProfileSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConfigurationProfileSummary(entry, context); + }); }; const deserializeAws_restJson1DeploymentEvent = (output: any, context: __SerdeContext): DeploymentEvent => { @@ -4411,11 +4402,25 @@ const deserializeAws_restJson1DeploymentEvent = (output: any, context: __SerdeCo }; const deserializeAws_restJson1DeploymentEvents = (output: any, context: __SerdeContext): DeploymentEvent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeploymentEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeploymentEvent(entry, context); + }); }; const deserializeAws_restJson1DeploymentList = (output: any, context: __SerdeContext): DeploymentSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeploymentSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeploymentSummary(entry, context); + }); }; const deserializeAws_restJson1DeploymentStrategy = (output: any, context: __SerdeContext): DeploymentStrategy => { @@ -4438,7 +4443,14 @@ const deserializeAws_restJson1DeploymentStrategy = (output: any, context: __Serd }; const deserializeAws_restJson1DeploymentStrategyList = (output: any, context: __SerdeContext): DeploymentStrategy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeploymentStrategy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeploymentStrategy(entry, context); + }); }; const deserializeAws_restJson1DeploymentSummary = (output: any, context: __SerdeContext): DeploymentSummary => { @@ -4490,7 +4502,14 @@ const deserializeAws_restJson1Environment = (output: any, context: __SerdeContex }; const deserializeAws_restJson1EnvironmentList = (output: any, context: __SerdeContext): Environment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Environment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Environment(entry, context); + }); }; const deserializeAws_restJson1HostedConfigurationVersionSummary = ( @@ -4515,7 +4534,14 @@ const deserializeAws_restJson1HostedConfigurationVersionSummaryList = ( output: any, context: __SerdeContext ): HostedConfigurationVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HostedConfigurationVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HostedConfigurationVersionSummary(entry, context); + }); }; const deserializeAws_restJson1Monitor = (output: any, context: __SerdeContext): Monitor => { @@ -4526,17 +4552,26 @@ const deserializeAws_restJson1Monitor = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1MonitorList = (output: any, context: __SerdeContext): Monitor[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Monitor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Monitor(entry, context); + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Validator = (output: any, context: __SerdeContext): Validator => { @@ -4547,14 +4582,28 @@ const deserializeAws_restJson1Validator = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1ValidatorList = (output: any, context: __SerdeContext): Validator[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Validator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Validator(entry, context); + }); }; const deserializeAws_restJson1ValidatorTypeList = ( output: any, context: __SerdeContext ): (ValidatorType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4577,6 +4626,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-appflow/protocols/Aws_restJson1.ts b/clients/client-appflow/protocols/Aws_restJson1.ts index 126bcac37c05..b4e359313ab1 100644 --- a/clients/client-appflow/protocols/Aws_restJson1.ts +++ b/clients/client-appflow/protocols/Aws_restJson1.ts @@ -174,18 +174,21 @@ export const serializeAws_restJson1CreateConnectorProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/create-connector-profile"; let body: any; body = JSON.stringify({ - ...(input.connectionMode !== undefined && { connectionMode: input.connectionMode }), - ...(input.connectorProfileConfig !== undefined && { - connectorProfileConfig: serializeAws_restJson1ConnectorProfileConfig(input.connectorProfileConfig, context), - }), - ...(input.connectorProfileName !== undefined && { connectorProfileName: input.connectorProfileName }), - ...(input.connectorType !== undefined && { connectorType: input.connectorType }), - ...(input.kmsArn !== undefined && { kmsArn: input.kmsArn }), + ...(input.connectionMode !== undefined && + input.connectionMode !== null && { connectionMode: input.connectionMode }), + ...(input.connectorProfileConfig !== undefined && + input.connectorProfileConfig !== null && { + connectorProfileConfig: serializeAws_restJson1ConnectorProfileConfig(input.connectorProfileConfig, context), + }), + ...(input.connectorProfileName !== undefined && + input.connectorProfileName !== null && { connectorProfileName: input.connectorProfileName }), + ...(input.connectorType !== undefined && input.connectorType !== null && { connectorType: input.connectorType }), + ...(input.kmsArn !== undefined && input.kmsArn !== null && { kmsArn: input.kmsArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -204,28 +207,32 @@ export const serializeAws_restJson1CreateFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/create-flow"; let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.destinationFlowConfigList !== undefined && { - destinationFlowConfigList: serializeAws_restJson1DestinationFlowConfigList( - input.destinationFlowConfigList, - context - ), - }), - ...(input.flowName !== undefined && { flowName: input.flowName }), - ...(input.kmsArn !== undefined && { kmsArn: input.kmsArn }), - ...(input.sourceFlowConfig !== undefined && { - sourceFlowConfig: serializeAws_restJson1SourceFlowConfig(input.sourceFlowConfig, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.tasks !== undefined && { tasks: serializeAws_restJson1Tasks(input.tasks, context) }), - ...(input.triggerConfig !== undefined && { - triggerConfig: serializeAws_restJson1TriggerConfig(input.triggerConfig, context), - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.destinationFlowConfigList !== undefined && + input.destinationFlowConfigList !== null && { + destinationFlowConfigList: serializeAws_restJson1DestinationFlowConfigList( + input.destinationFlowConfigList, + context + ), + }), + ...(input.flowName !== undefined && input.flowName !== null && { flowName: input.flowName }), + ...(input.kmsArn !== undefined && input.kmsArn !== null && { kmsArn: input.kmsArn }), + ...(input.sourceFlowConfig !== undefined && + input.sourceFlowConfig !== null && { + sourceFlowConfig: serializeAws_restJson1SourceFlowConfig(input.sourceFlowConfig, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tasks !== undefined && + input.tasks !== null && { tasks: serializeAws_restJson1Tasks(input.tasks, context) }), + ...(input.triggerConfig !== undefined && + input.triggerConfig !== null && { + triggerConfig: serializeAws_restJson1TriggerConfig(input.triggerConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -244,13 +251,14 @@ export const serializeAws_restJson1DeleteConnectorProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/delete-connector-profile"; let body: any; body = JSON.stringify({ - ...(input.connectorProfileName !== undefined && { connectorProfileName: input.connectorProfileName }), - ...(input.forceDelete !== undefined && { forceDelete: input.forceDelete }), + ...(input.connectorProfileName !== undefined && + input.connectorProfileName !== null && { connectorProfileName: input.connectorProfileName }), + ...(input.forceDelete !== undefined && input.forceDelete !== null && { forceDelete: input.forceDelete }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -269,13 +277,13 @@ export const serializeAws_restJson1DeleteFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/delete-flow"; let body: any; body = JSON.stringify({ - ...(input.flowName !== undefined && { flowName: input.flowName }), - ...(input.forceDelete !== undefined && { forceDelete: input.forceDelete }), + ...(input.flowName !== undefined && input.flowName !== null && { flowName: input.flowName }), + ...(input.forceDelete !== undefined && input.forceDelete !== null && { forceDelete: input.forceDelete }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -294,14 +302,16 @@ export const serializeAws_restJson1DescribeConnectorEntityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describe-connector-entity"; let body: any; body = JSON.stringify({ - ...(input.connectorEntityName !== undefined && { connectorEntityName: input.connectorEntityName }), - ...(input.connectorProfileName !== undefined && { connectorProfileName: input.connectorProfileName }), - ...(input.connectorType !== undefined && { connectorType: input.connectorType }), + ...(input.connectorEntityName !== undefined && + input.connectorEntityName !== null && { connectorEntityName: input.connectorEntityName }), + ...(input.connectorProfileName !== undefined && + input.connectorProfileName !== null && { connectorProfileName: input.connectorProfileName }), + ...(input.connectorType !== undefined && input.connectorType !== null && { connectorType: input.connectorType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -320,17 +330,18 @@ export const serializeAws_restJson1DescribeConnectorProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describe-connector-profiles"; let body: any; body = JSON.stringify({ - ...(input.connectorProfileNames !== undefined && { - connectorProfileNames: serializeAws_restJson1ConnectorProfileNameList(input.connectorProfileNames, context), - }), - ...(input.connectorType !== undefined && { connectorType: input.connectorType }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.connectorProfileNames !== undefined && + input.connectorProfileNames !== null && { + connectorProfileNames: serializeAws_restJson1ConnectorProfileNameList(input.connectorProfileNames, context), + }), + ...(input.connectorType !== undefined && input.connectorType !== null && { connectorType: input.connectorType }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -349,15 +360,16 @@ export const serializeAws_restJson1DescribeConnectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describe-connectors"; let body: any; body = JSON.stringify({ - ...(input.connectorTypes !== undefined && { - connectorTypes: serializeAws_restJson1ConnectorTypeList(input.connectorTypes, context), - }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.connectorTypes !== undefined && + input.connectorTypes !== null && { + connectorTypes: serializeAws_restJson1ConnectorTypeList(input.connectorTypes, context), + }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -376,12 +388,12 @@ export const serializeAws_restJson1DescribeFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describe-flow"; let body: any; body = JSON.stringify({ - ...(input.flowName !== undefined && { flowName: input.flowName }), + ...(input.flowName !== undefined && input.flowName !== null && { flowName: input.flowName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -400,14 +412,14 @@ export const serializeAws_restJson1DescribeFlowExecutionRecordsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describe-flow-execution-records"; let body: any; body = JSON.stringify({ - ...(input.flowName !== undefined && { flowName: input.flowName }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.flowName !== undefined && input.flowName !== null && { flowName: input.flowName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -426,14 +438,15 @@ export const serializeAws_restJson1ListConnectorEntitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/list-connector-entities"; let body: any; body = JSON.stringify({ - ...(input.connectorProfileName !== undefined && { connectorProfileName: input.connectorProfileName }), - ...(input.connectorType !== undefined && { connectorType: input.connectorType }), - ...(input.entitiesPath !== undefined && { entitiesPath: input.entitiesPath }), + ...(input.connectorProfileName !== undefined && + input.connectorProfileName !== null && { connectorProfileName: input.connectorProfileName }), + ...(input.connectorType !== undefined && input.connectorType !== null && { connectorType: input.connectorType }), + ...(input.entitiesPath !== undefined && input.entitiesPath !== null && { entitiesPath: input.entitiesPath }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -452,13 +465,13 @@ export const serializeAws_restJson1ListFlowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/list-flows"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -476,9 +489,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -507,12 +518,12 @@ export const serializeAws_restJson1StartFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/start-flow"; let body: any; body = JSON.stringify({ - ...(input.flowName !== undefined && { flowName: input.flowName }), + ...(input.flowName !== undefined && input.flowName !== null && { flowName: input.flowName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -531,12 +542,12 @@ export const serializeAws_restJson1StopFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/stop-flow"; let body: any; body = JSON.stringify({ - ...(input.flowName !== undefined && { flowName: input.flowName }), + ...(input.flowName !== undefined && input.flowName !== null && { flowName: input.flowName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -555,7 +566,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -569,7 +580,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -587,9 +598,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -622,16 +631,19 @@ export const serializeAws_restJson1UpdateConnectorProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/update-connector-profile"; let body: any; body = JSON.stringify({ - ...(input.connectionMode !== undefined && { connectionMode: input.connectionMode }), - ...(input.connectorProfileConfig !== undefined && { - connectorProfileConfig: serializeAws_restJson1ConnectorProfileConfig(input.connectorProfileConfig, context), - }), - ...(input.connectorProfileName !== undefined && { connectorProfileName: input.connectorProfileName }), + ...(input.connectionMode !== undefined && + input.connectionMode !== null && { connectionMode: input.connectionMode }), + ...(input.connectorProfileConfig !== undefined && + input.connectorProfileConfig !== null && { + connectorProfileConfig: serializeAws_restJson1ConnectorProfileConfig(input.connectorProfileConfig, context), + }), + ...(input.connectorProfileName !== undefined && + input.connectorProfileName !== null && { connectorProfileName: input.connectorProfileName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -650,26 +662,30 @@ export const serializeAws_restJson1UpdateFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/update-flow"; let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.destinationFlowConfigList !== undefined && { - destinationFlowConfigList: serializeAws_restJson1DestinationFlowConfigList( - input.destinationFlowConfigList, - context - ), - }), - ...(input.flowName !== undefined && { flowName: input.flowName }), - ...(input.sourceFlowConfig !== undefined && { - sourceFlowConfig: serializeAws_restJson1SourceFlowConfig(input.sourceFlowConfig, context), - }), - ...(input.tasks !== undefined && { tasks: serializeAws_restJson1Tasks(input.tasks, context) }), - ...(input.triggerConfig !== undefined && { - triggerConfig: serializeAws_restJson1TriggerConfig(input.triggerConfig, context), - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.destinationFlowConfigList !== undefined && + input.destinationFlowConfigList !== null && { + destinationFlowConfigList: serializeAws_restJson1DestinationFlowConfigList( + input.destinationFlowConfigList, + context + ), + }), + ...(input.flowName !== undefined && input.flowName !== null && { flowName: input.flowName }), + ...(input.sourceFlowConfig !== undefined && + input.sourceFlowConfig !== null && { + sourceFlowConfig: serializeAws_restJson1SourceFlowConfig(input.sourceFlowConfig, context), + }), + ...(input.tasks !== undefined && + input.tasks !== null && { tasks: serializeAws_restJson1Tasks(input.tasks, context) }), + ...(input.triggerConfig !== undefined && + input.triggerConfig !== null && { + triggerConfig: serializeAws_restJson1TriggerConfig(input.triggerConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2299,7 +2315,8 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1AggregationConfig = (input: AggregationConfig, context: __SerdeContext): any => { return { - ...(input.aggregationType !== undefined && { aggregationType: input.aggregationType }), + ...(input.aggregationType !== undefined && + input.aggregationType !== null && { aggregationType: input.aggregationType }), }; }; @@ -2308,8 +2325,8 @@ const serializeAws_restJson1AmplitudeConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.apiKey !== undefined && { apiKey: input.apiKey }), - ...(input.secretKey !== undefined && { secretKey: input.secretKey }), + ...(input.apiKey !== undefined && input.apiKey !== null && { apiKey: input.apiKey }), + ...(input.secretKey !== undefined && input.secretKey !== null && { secretKey: input.secretKey }), }; }; @@ -2325,50 +2342,53 @@ const serializeAws_restJson1AmplitudeSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; const serializeAws_restJson1ConnectorOAuthRequest = (input: ConnectorOAuthRequest, context: __SerdeContext): any => { return { - ...(input.authCode !== undefined && { authCode: input.authCode }), - ...(input.redirectUri !== undefined && { redirectUri: input.redirectUri }), + ...(input.authCode !== undefined && input.authCode !== null && { authCode: input.authCode }), + ...(input.redirectUri !== undefined && input.redirectUri !== null && { redirectUri: input.redirectUri }), }; }; const serializeAws_restJson1ConnectorOperator = (input: ConnectorOperator, context: __SerdeContext): any => { return { - ...(input.Amplitude !== undefined && { Amplitude: input.Amplitude }), - ...(input.Datadog !== undefined && { Datadog: input.Datadog }), - ...(input.Dynatrace !== undefined && { Dynatrace: input.Dynatrace }), - ...(input.GoogleAnalytics !== undefined && { GoogleAnalytics: input.GoogleAnalytics }), - ...(input.InforNexus !== undefined && { InforNexus: input.InforNexus }), - ...(input.Marketo !== undefined && { Marketo: input.Marketo }), - ...(input.S3 !== undefined && { S3: input.S3 }), - ...(input.Salesforce !== undefined && { Salesforce: input.Salesforce }), - ...(input.ServiceNow !== undefined && { ServiceNow: input.ServiceNow }), - ...(input.Singular !== undefined && { Singular: input.Singular }), - ...(input.Slack !== undefined && { Slack: input.Slack }), - ...(input.Trendmicro !== undefined && { Trendmicro: input.Trendmicro }), - ...(input.Veeva !== undefined && { Veeva: input.Veeva }), - ...(input.Zendesk !== undefined && { Zendesk: input.Zendesk }), + ...(input.Amplitude !== undefined && input.Amplitude !== null && { Amplitude: input.Amplitude }), + ...(input.Datadog !== undefined && input.Datadog !== null && { Datadog: input.Datadog }), + ...(input.Dynatrace !== undefined && input.Dynatrace !== null && { Dynatrace: input.Dynatrace }), + ...(input.GoogleAnalytics !== undefined && + input.GoogleAnalytics !== null && { GoogleAnalytics: input.GoogleAnalytics }), + ...(input.InforNexus !== undefined && input.InforNexus !== null && { InforNexus: input.InforNexus }), + ...(input.Marketo !== undefined && input.Marketo !== null && { Marketo: input.Marketo }), + ...(input.S3 !== undefined && input.S3 !== null && { S3: input.S3 }), + ...(input.Salesforce !== undefined && input.Salesforce !== null && { Salesforce: input.Salesforce }), + ...(input.ServiceNow !== undefined && input.ServiceNow !== null && { ServiceNow: input.ServiceNow }), + ...(input.Singular !== undefined && input.Singular !== null && { Singular: input.Singular }), + ...(input.Slack !== undefined && input.Slack !== null && { Slack: input.Slack }), + ...(input.Trendmicro !== undefined && input.Trendmicro !== null && { Trendmicro: input.Trendmicro }), + ...(input.Veeva !== undefined && input.Veeva !== null && { Veeva: input.Veeva }), + ...(input.Zendesk !== undefined && input.Zendesk !== null && { Zendesk: input.Zendesk }), }; }; const serializeAws_restJson1ConnectorProfileConfig = (input: ConnectorProfileConfig, context: __SerdeContext): any => { return { - ...(input.connectorProfileCredentials !== undefined && { - connectorProfileCredentials: serializeAws_restJson1ConnectorProfileCredentials( - input.connectorProfileCredentials, - context - ), - }), - ...(input.connectorProfileProperties !== undefined && { - connectorProfileProperties: serializeAws_restJson1ConnectorProfileProperties( - input.connectorProfileProperties, - context - ), - }), + ...(input.connectorProfileCredentials !== undefined && + input.connectorProfileCredentials !== null && { + connectorProfileCredentials: serializeAws_restJson1ConnectorProfileCredentials( + input.connectorProfileCredentials, + context + ), + }), + ...(input.connectorProfileProperties !== undefined && + input.connectorProfileProperties !== null && { + connectorProfileProperties: serializeAws_restJson1ConnectorProfileProperties( + input.connectorProfileProperties, + context + ), + }), }; }; @@ -2377,56 +2397,77 @@ const serializeAws_restJson1ConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.Amplitude !== undefined && { - Amplitude: serializeAws_restJson1AmplitudeConnectorProfileCredentials(input.Amplitude, context), - }), - ...(input.Datadog !== undefined && { - Datadog: serializeAws_restJson1DatadogConnectorProfileCredentials(input.Datadog, context), - }), - ...(input.Dynatrace !== undefined && { - Dynatrace: serializeAws_restJson1DynatraceConnectorProfileCredentials(input.Dynatrace, context), - }), - ...(input.GoogleAnalytics !== undefined && { - GoogleAnalytics: serializeAws_restJson1GoogleAnalyticsConnectorProfileCredentials(input.GoogleAnalytics, context), - }), - ...(input.InforNexus !== undefined && { - InforNexus: serializeAws_restJson1InforNexusConnectorProfileCredentials(input.InforNexus, context), - }), - ...(input.Marketo !== undefined && { - Marketo: serializeAws_restJson1MarketoConnectorProfileCredentials(input.Marketo, context), - }), - ...(input.Redshift !== undefined && { - Redshift: serializeAws_restJson1RedshiftConnectorProfileCredentials(input.Redshift, context), - }), - ...(input.Salesforce !== undefined && { - Salesforce: serializeAws_restJson1SalesforceConnectorProfileCredentials(input.Salesforce, context), - }), - ...(input.ServiceNow !== undefined && { - ServiceNow: serializeAws_restJson1ServiceNowConnectorProfileCredentials(input.ServiceNow, context), - }), - ...(input.Singular !== undefined && { - Singular: serializeAws_restJson1SingularConnectorProfileCredentials(input.Singular, context), - }), - ...(input.Slack !== undefined && { - Slack: serializeAws_restJson1SlackConnectorProfileCredentials(input.Slack, context), - }), - ...(input.Snowflake !== undefined && { - Snowflake: serializeAws_restJson1SnowflakeConnectorProfileCredentials(input.Snowflake, context), - }), - ...(input.Trendmicro !== undefined && { - Trendmicro: serializeAws_restJson1TrendmicroConnectorProfileCredentials(input.Trendmicro, context), - }), - ...(input.Veeva !== undefined && { - Veeva: serializeAws_restJson1VeevaConnectorProfileCredentials(input.Veeva, context), - }), - ...(input.Zendesk !== undefined && { - Zendesk: serializeAws_restJson1ZendeskConnectorProfileCredentials(input.Zendesk, context), - }), + ...(input.Amplitude !== undefined && + input.Amplitude !== null && { + Amplitude: serializeAws_restJson1AmplitudeConnectorProfileCredentials(input.Amplitude, context), + }), + ...(input.Datadog !== undefined && + input.Datadog !== null && { + Datadog: serializeAws_restJson1DatadogConnectorProfileCredentials(input.Datadog, context), + }), + ...(input.Dynatrace !== undefined && + input.Dynatrace !== null && { + Dynatrace: serializeAws_restJson1DynatraceConnectorProfileCredentials(input.Dynatrace, context), + }), + ...(input.GoogleAnalytics !== undefined && + input.GoogleAnalytics !== null && { + GoogleAnalytics: serializeAws_restJson1GoogleAnalyticsConnectorProfileCredentials( + input.GoogleAnalytics, + context + ), + }), + ...(input.InforNexus !== undefined && + input.InforNexus !== null && { + InforNexus: serializeAws_restJson1InforNexusConnectorProfileCredentials(input.InforNexus, context), + }), + ...(input.Marketo !== undefined && + input.Marketo !== null && { + Marketo: serializeAws_restJson1MarketoConnectorProfileCredentials(input.Marketo, context), + }), + ...(input.Redshift !== undefined && + input.Redshift !== null && { + Redshift: serializeAws_restJson1RedshiftConnectorProfileCredentials(input.Redshift, context), + }), + ...(input.Salesforce !== undefined && + input.Salesforce !== null && { + Salesforce: serializeAws_restJson1SalesforceConnectorProfileCredentials(input.Salesforce, context), + }), + ...(input.ServiceNow !== undefined && + input.ServiceNow !== null && { + ServiceNow: serializeAws_restJson1ServiceNowConnectorProfileCredentials(input.ServiceNow, context), + }), + ...(input.Singular !== undefined && + input.Singular !== null && { + Singular: serializeAws_restJson1SingularConnectorProfileCredentials(input.Singular, context), + }), + ...(input.Slack !== undefined && + input.Slack !== null && { Slack: serializeAws_restJson1SlackConnectorProfileCredentials(input.Slack, context) }), + ...(input.Snowflake !== undefined && + input.Snowflake !== null && { + Snowflake: serializeAws_restJson1SnowflakeConnectorProfileCredentials(input.Snowflake, context), + }), + ...(input.Trendmicro !== undefined && + input.Trendmicro !== null && { + Trendmicro: serializeAws_restJson1TrendmicroConnectorProfileCredentials(input.Trendmicro, context), + }), + ...(input.Veeva !== undefined && + input.Veeva !== null && { Veeva: serializeAws_restJson1VeevaConnectorProfileCredentials(input.Veeva, context) }), + ...(input.Zendesk !== undefined && + input.Zendesk !== null && { + Zendesk: serializeAws_restJson1ZendeskConnectorProfileCredentials(input.Zendesk, context), + }), }; }; const serializeAws_restJson1ConnectorProfileNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ConnectorProfileProperties = ( @@ -2434,56 +2475,77 @@ const serializeAws_restJson1ConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.Amplitude !== undefined && { - Amplitude: serializeAws_restJson1AmplitudeConnectorProfileProperties(input.Amplitude, context), - }), - ...(input.Datadog !== undefined && { - Datadog: serializeAws_restJson1DatadogConnectorProfileProperties(input.Datadog, context), - }), - ...(input.Dynatrace !== undefined && { - Dynatrace: serializeAws_restJson1DynatraceConnectorProfileProperties(input.Dynatrace, context), - }), - ...(input.GoogleAnalytics !== undefined && { - GoogleAnalytics: serializeAws_restJson1GoogleAnalyticsConnectorProfileProperties(input.GoogleAnalytics, context), - }), - ...(input.InforNexus !== undefined && { - InforNexus: serializeAws_restJson1InforNexusConnectorProfileProperties(input.InforNexus, context), - }), - ...(input.Marketo !== undefined && { - Marketo: serializeAws_restJson1MarketoConnectorProfileProperties(input.Marketo, context), - }), - ...(input.Redshift !== undefined && { - Redshift: serializeAws_restJson1RedshiftConnectorProfileProperties(input.Redshift, context), - }), - ...(input.Salesforce !== undefined && { - Salesforce: serializeAws_restJson1SalesforceConnectorProfileProperties(input.Salesforce, context), - }), - ...(input.ServiceNow !== undefined && { - ServiceNow: serializeAws_restJson1ServiceNowConnectorProfileProperties(input.ServiceNow, context), - }), - ...(input.Singular !== undefined && { - Singular: serializeAws_restJson1SingularConnectorProfileProperties(input.Singular, context), - }), - ...(input.Slack !== undefined && { - Slack: serializeAws_restJson1SlackConnectorProfileProperties(input.Slack, context), - }), - ...(input.Snowflake !== undefined && { - Snowflake: serializeAws_restJson1SnowflakeConnectorProfileProperties(input.Snowflake, context), - }), - ...(input.Trendmicro !== undefined && { - Trendmicro: serializeAws_restJson1TrendmicroConnectorProfileProperties(input.Trendmicro, context), - }), - ...(input.Veeva !== undefined && { - Veeva: serializeAws_restJson1VeevaConnectorProfileProperties(input.Veeva, context), - }), - ...(input.Zendesk !== undefined && { - Zendesk: serializeAws_restJson1ZendeskConnectorProfileProperties(input.Zendesk, context), - }), + ...(input.Amplitude !== undefined && + input.Amplitude !== null && { + Amplitude: serializeAws_restJson1AmplitudeConnectorProfileProperties(input.Amplitude, context), + }), + ...(input.Datadog !== undefined && + input.Datadog !== null && { + Datadog: serializeAws_restJson1DatadogConnectorProfileProperties(input.Datadog, context), + }), + ...(input.Dynatrace !== undefined && + input.Dynatrace !== null && { + Dynatrace: serializeAws_restJson1DynatraceConnectorProfileProperties(input.Dynatrace, context), + }), + ...(input.GoogleAnalytics !== undefined && + input.GoogleAnalytics !== null && { + GoogleAnalytics: serializeAws_restJson1GoogleAnalyticsConnectorProfileProperties( + input.GoogleAnalytics, + context + ), + }), + ...(input.InforNexus !== undefined && + input.InforNexus !== null && { + InforNexus: serializeAws_restJson1InforNexusConnectorProfileProperties(input.InforNexus, context), + }), + ...(input.Marketo !== undefined && + input.Marketo !== null && { + Marketo: serializeAws_restJson1MarketoConnectorProfileProperties(input.Marketo, context), + }), + ...(input.Redshift !== undefined && + input.Redshift !== null && { + Redshift: serializeAws_restJson1RedshiftConnectorProfileProperties(input.Redshift, context), + }), + ...(input.Salesforce !== undefined && + input.Salesforce !== null && { + Salesforce: serializeAws_restJson1SalesforceConnectorProfileProperties(input.Salesforce, context), + }), + ...(input.ServiceNow !== undefined && + input.ServiceNow !== null && { + ServiceNow: serializeAws_restJson1ServiceNowConnectorProfileProperties(input.ServiceNow, context), + }), + ...(input.Singular !== undefined && + input.Singular !== null && { + Singular: serializeAws_restJson1SingularConnectorProfileProperties(input.Singular, context), + }), + ...(input.Slack !== undefined && + input.Slack !== null && { Slack: serializeAws_restJson1SlackConnectorProfileProperties(input.Slack, context) }), + ...(input.Snowflake !== undefined && + input.Snowflake !== null && { + Snowflake: serializeAws_restJson1SnowflakeConnectorProfileProperties(input.Snowflake, context), + }), + ...(input.Trendmicro !== undefined && + input.Trendmicro !== null && { + Trendmicro: serializeAws_restJson1TrendmicroConnectorProfileProperties(input.Trendmicro, context), + }), + ...(input.Veeva !== undefined && + input.Veeva !== null && { Veeva: serializeAws_restJson1VeevaConnectorProfileProperties(input.Veeva, context) }), + ...(input.Zendesk !== undefined && + input.Zendesk !== null && { + Zendesk: serializeAws_restJson1ZendeskConnectorProfileProperties(input.Zendesk, context), + }), }; }; const serializeAws_restJson1ConnectorTypeList = (input: (ConnectorType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DatadogConnectorProfileCredentials = ( @@ -2491,8 +2553,9 @@ const serializeAws_restJson1DatadogConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.apiKey !== undefined && { apiKey: input.apiKey }), - ...(input.applicationKey !== undefined && { applicationKey: input.applicationKey }), + ...(input.apiKey !== undefined && input.apiKey !== null && { apiKey: input.apiKey }), + ...(input.applicationKey !== undefined && + input.applicationKey !== null && { applicationKey: input.applicationKey }), }; }; @@ -2501,7 +2564,7 @@ const serializeAws_restJson1DatadogConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.instanceUrl !== undefined && { instanceUrl: input.instanceUrl }), + ...(input.instanceUrl !== undefined && input.instanceUrl !== null && { instanceUrl: input.instanceUrl }), }; }; @@ -2510,7 +2573,7 @@ const serializeAws_restJson1DatadogSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -2519,35 +2582,43 @@ const serializeAws_restJson1DestinationConnectorProperties = ( context: __SerdeContext ): any => { return { - ...(input.EventBridge !== undefined && { - EventBridge: serializeAws_restJson1EventBridgeDestinationProperties(input.EventBridge, context), - }), - ...(input.Redshift !== undefined && { - Redshift: serializeAws_restJson1RedshiftDestinationProperties(input.Redshift, context), - }), - ...(input.S3 !== undefined && { S3: serializeAws_restJson1S3DestinationProperties(input.S3, context) }), - ...(input.Salesforce !== undefined && { - Salesforce: serializeAws_restJson1SalesforceDestinationProperties(input.Salesforce, context), - }), - ...(input.Snowflake !== undefined && { - Snowflake: serializeAws_restJson1SnowflakeDestinationProperties(input.Snowflake, context), - }), - ...(input.Upsolver !== undefined && { - Upsolver: serializeAws_restJson1UpsolverDestinationProperties(input.Upsolver, context), - }), + ...(input.EventBridge !== undefined && + input.EventBridge !== null && { + EventBridge: serializeAws_restJson1EventBridgeDestinationProperties(input.EventBridge, context), + }), + ...(input.Redshift !== undefined && + input.Redshift !== null && { + Redshift: serializeAws_restJson1RedshiftDestinationProperties(input.Redshift, context), + }), + ...(input.S3 !== undefined && + input.S3 !== null && { S3: serializeAws_restJson1S3DestinationProperties(input.S3, context) }), + ...(input.Salesforce !== undefined && + input.Salesforce !== null && { + Salesforce: serializeAws_restJson1SalesforceDestinationProperties(input.Salesforce, context), + }), + ...(input.Snowflake !== undefined && + input.Snowflake !== null && { + Snowflake: serializeAws_restJson1SnowflakeDestinationProperties(input.Snowflake, context), + }), + ...(input.Upsolver !== undefined && + input.Upsolver !== null && { + Upsolver: serializeAws_restJson1UpsolverDestinationProperties(input.Upsolver, context), + }), }; }; const serializeAws_restJson1DestinationFlowConfig = (input: DestinationFlowConfig, context: __SerdeContext): any => { return { - ...(input.connectorProfileName !== undefined && { connectorProfileName: input.connectorProfileName }), - ...(input.connectorType !== undefined && { connectorType: input.connectorType }), - ...(input.destinationConnectorProperties !== undefined && { - destinationConnectorProperties: serializeAws_restJson1DestinationConnectorProperties( - input.destinationConnectorProperties, - context - ), - }), + ...(input.connectorProfileName !== undefined && + input.connectorProfileName !== null && { connectorProfileName: input.connectorProfileName }), + ...(input.connectorType !== undefined && input.connectorType !== null && { connectorType: input.connectorType }), + ...(input.destinationConnectorProperties !== undefined && + input.destinationConnectorProperties !== null && { + destinationConnectorProperties: serializeAws_restJson1DestinationConnectorProperties( + input.destinationConnectorProperties, + context + ), + }), }; }; @@ -2555,7 +2626,14 @@ const serializeAws_restJson1DestinationFlowConfigList = ( input: DestinationFlowConfig[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DestinationFlowConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DestinationFlowConfig(entry, context); + }); }; const serializeAws_restJson1DynatraceConnectorProfileCredentials = ( @@ -2563,7 +2641,7 @@ const serializeAws_restJson1DynatraceConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.apiToken !== undefined && { apiToken: input.apiToken }), + ...(input.apiToken !== undefined && input.apiToken !== null && { apiToken: input.apiToken }), }; }; @@ -2572,7 +2650,7 @@ const serializeAws_restJson1DynatraceConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.instanceUrl !== undefined && { instanceUrl: input.instanceUrl }), + ...(input.instanceUrl !== undefined && input.instanceUrl !== null && { instanceUrl: input.instanceUrl }), }; }; @@ -2581,17 +2659,16 @@ const serializeAws_restJson1DynatraceSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; const serializeAws_restJson1ErrorHandlingConfig = (input: ErrorHandlingConfig, context: __SerdeContext): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.bucketPrefix !== undefined && { bucketPrefix: input.bucketPrefix }), - ...(input.failOnFirstDestinationError !== undefined && { - failOnFirstDestinationError: input.failOnFirstDestinationError, - }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.bucketPrefix !== undefined && input.bucketPrefix !== null && { bucketPrefix: input.bucketPrefix }), + ...(input.failOnFirstDestinationError !== undefined && + input.failOnFirstDestinationError !== null && { failOnFirstDestinationError: input.failOnFirstDestinationError }), }; }; @@ -2600,10 +2677,11 @@ const serializeAws_restJson1EventBridgeDestinationProperties = ( context: __SerdeContext ): any => { return { - ...(input.errorHandlingConfig !== undefined && { - errorHandlingConfig: serializeAws_restJson1ErrorHandlingConfig(input.errorHandlingConfig, context), - }), - ...(input.object !== undefined && { object: input.object }), + ...(input.errorHandlingConfig !== undefined && + input.errorHandlingConfig !== null && { + errorHandlingConfig: serializeAws_restJson1ErrorHandlingConfig(input.errorHandlingConfig, context), + }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -2612,13 +2690,14 @@ const serializeAws_restJson1GoogleAnalyticsConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.accessToken !== undefined && { accessToken: input.accessToken }), - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.clientSecret !== undefined && { clientSecret: input.clientSecret }), - ...(input.oAuthRequest !== undefined && { - oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), - }), - ...(input.refreshToken !== undefined && { refreshToken: input.refreshToken }), + ...(input.accessToken !== undefined && input.accessToken !== null && { accessToken: input.accessToken }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.clientSecret !== undefined && input.clientSecret !== null && { clientSecret: input.clientSecret }), + ...(input.oAuthRequest !== undefined && + input.oAuthRequest !== null && { + oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), + }), + ...(input.refreshToken !== undefined && input.refreshToken !== null && { refreshToken: input.refreshToken }), }; }; @@ -2634,17 +2713,25 @@ const serializeAws_restJson1GoogleAnalyticsSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; const serializeAws_restJson1IdFieldNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1IncrementalPullConfig = (input: IncrementalPullConfig, context: __SerdeContext): any => { return { - ...(input.datetimeTypeFieldName !== undefined && { datetimeTypeFieldName: input.datetimeTypeFieldName }), + ...(input.datetimeTypeFieldName !== undefined && + input.datetimeTypeFieldName !== null && { datetimeTypeFieldName: input.datetimeTypeFieldName }), }; }; @@ -2653,10 +2740,11 @@ const serializeAws_restJson1InforNexusConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.accessKeyId !== undefined && { accessKeyId: input.accessKeyId }), - ...(input.datakey !== undefined && { datakey: input.datakey }), - ...(input.secretAccessKey !== undefined && { secretAccessKey: input.secretAccessKey }), - ...(input.userId !== undefined && { userId: input.userId }), + ...(input.accessKeyId !== undefined && input.accessKeyId !== null && { accessKeyId: input.accessKeyId }), + ...(input.datakey !== undefined && input.datakey !== null && { datakey: input.datakey }), + ...(input.secretAccessKey !== undefined && + input.secretAccessKey !== null && { secretAccessKey: input.secretAccessKey }), + ...(input.userId !== undefined && input.userId !== null && { userId: input.userId }), }; }; @@ -2665,7 +2753,7 @@ const serializeAws_restJson1InforNexusConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.instanceUrl !== undefined && { instanceUrl: input.instanceUrl }), + ...(input.instanceUrl !== undefined && input.instanceUrl !== null && { instanceUrl: input.instanceUrl }), }; }; @@ -2674,7 +2762,7 @@ const serializeAws_restJson1InforNexusSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -2683,12 +2771,13 @@ const serializeAws_restJson1MarketoConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.accessToken !== undefined && { accessToken: input.accessToken }), - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.clientSecret !== undefined && { clientSecret: input.clientSecret }), - ...(input.oAuthRequest !== undefined && { - oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), - }), + ...(input.accessToken !== undefined && input.accessToken !== null && { accessToken: input.accessToken }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.clientSecret !== undefined && input.clientSecret !== null && { clientSecret: input.clientSecret }), + ...(input.oAuthRequest !== undefined && + input.oAuthRequest !== null && { + oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), + }), }; }; @@ -2697,7 +2786,7 @@ const serializeAws_restJson1MarketoConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.instanceUrl !== undefined && { instanceUrl: input.instanceUrl }), + ...(input.instanceUrl !== undefined && input.instanceUrl !== null && { instanceUrl: input.instanceUrl }), }; }; @@ -2706,14 +2795,14 @@ const serializeAws_restJson1MarketoSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; const serializeAws_restJson1PrefixConfig = (input: PrefixConfig, context: __SerdeContext): any => { return { - ...(input.prefixFormat !== undefined && { prefixFormat: input.prefixFormat }), - ...(input.prefixType !== undefined && { prefixType: input.prefixType }), + ...(input.prefixFormat !== undefined && input.prefixFormat !== null && { prefixFormat: input.prefixFormat }), + ...(input.prefixType !== undefined && input.prefixType !== null && { prefixType: input.prefixType }), }; }; @@ -2722,8 +2811,8 @@ const serializeAws_restJson1RedshiftConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.password !== undefined && { password: input.password }), - ...(input.username !== undefined && { username: input.username }), + ...(input.password !== undefined && input.password !== null && { password: input.password }), + ...(input.username !== undefined && input.username !== null && { username: input.username }), }; }; @@ -2732,10 +2821,10 @@ const serializeAws_restJson1RedshiftConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.bucketPrefix !== undefined && { bucketPrefix: input.bucketPrefix }), - ...(input.databaseUrl !== undefined && { databaseUrl: input.databaseUrl }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.bucketPrefix !== undefined && input.bucketPrefix !== null && { bucketPrefix: input.bucketPrefix }), + ...(input.databaseUrl !== undefined && input.databaseUrl !== null && { databaseUrl: input.databaseUrl }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; @@ -2744,12 +2833,14 @@ const serializeAws_restJson1RedshiftDestinationProperties = ( context: __SerdeContext ): any => { return { - ...(input.bucketPrefix !== undefined && { bucketPrefix: input.bucketPrefix }), - ...(input.errorHandlingConfig !== undefined && { - errorHandlingConfig: serializeAws_restJson1ErrorHandlingConfig(input.errorHandlingConfig, context), - }), - ...(input.intermediateBucketName !== undefined && { intermediateBucketName: input.intermediateBucketName }), - ...(input.object !== undefined && { object: input.object }), + ...(input.bucketPrefix !== undefined && input.bucketPrefix !== null && { bucketPrefix: input.bucketPrefix }), + ...(input.errorHandlingConfig !== undefined && + input.errorHandlingConfig !== null && { + errorHandlingConfig: serializeAws_restJson1ErrorHandlingConfig(input.errorHandlingConfig, context), + }), + ...(input.intermediateBucketName !== undefined && + input.intermediateBucketName !== null && { intermediateBucketName: input.intermediateBucketName }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -2758,30 +2849,31 @@ const serializeAws_restJson1S3DestinationProperties = ( context: __SerdeContext ): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.bucketPrefix !== undefined && { bucketPrefix: input.bucketPrefix }), - ...(input.s3OutputFormatConfig !== undefined && { - s3OutputFormatConfig: serializeAws_restJson1S3OutputFormatConfig(input.s3OutputFormatConfig, context), - }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.bucketPrefix !== undefined && input.bucketPrefix !== null && { bucketPrefix: input.bucketPrefix }), + ...(input.s3OutputFormatConfig !== undefined && + input.s3OutputFormatConfig !== null && { + s3OutputFormatConfig: serializeAws_restJson1S3OutputFormatConfig(input.s3OutputFormatConfig, context), + }), }; }; const serializeAws_restJson1S3OutputFormatConfig = (input: S3OutputFormatConfig, context: __SerdeContext): any => { return { - ...(input.aggregationConfig !== undefined && { - aggregationConfig: serializeAws_restJson1AggregationConfig(input.aggregationConfig, context), - }), - ...(input.fileType !== undefined && { fileType: input.fileType }), - ...(input.prefixConfig !== undefined && { - prefixConfig: serializeAws_restJson1PrefixConfig(input.prefixConfig, context), - }), + ...(input.aggregationConfig !== undefined && + input.aggregationConfig !== null && { + aggregationConfig: serializeAws_restJson1AggregationConfig(input.aggregationConfig, context), + }), + ...(input.fileType !== undefined && input.fileType !== null && { fileType: input.fileType }), + ...(input.prefixConfig !== undefined && + input.prefixConfig !== null && { prefixConfig: serializeAws_restJson1PrefixConfig(input.prefixConfig, context) }), }; }; const serializeAws_restJson1S3SourceProperties = (input: S3SourceProperties, context: __SerdeContext): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.bucketPrefix !== undefined && { bucketPrefix: input.bucketPrefix }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.bucketPrefix !== undefined && input.bucketPrefix !== null && { bucketPrefix: input.bucketPrefix }), }; }; @@ -2790,12 +2882,14 @@ const serializeAws_restJson1SalesforceConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.accessToken !== undefined && { accessToken: input.accessToken }), - ...(input.clientCredentialsArn !== undefined && { clientCredentialsArn: input.clientCredentialsArn }), - ...(input.oAuthRequest !== undefined && { - oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), - }), - ...(input.refreshToken !== undefined && { refreshToken: input.refreshToken }), + ...(input.accessToken !== undefined && input.accessToken !== null && { accessToken: input.accessToken }), + ...(input.clientCredentialsArn !== undefined && + input.clientCredentialsArn !== null && { clientCredentialsArn: input.clientCredentialsArn }), + ...(input.oAuthRequest !== undefined && + input.oAuthRequest !== null && { + oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), + }), + ...(input.refreshToken !== undefined && input.refreshToken !== null && { refreshToken: input.refreshToken }), }; }; @@ -2804,8 +2898,9 @@ const serializeAws_restJson1SalesforceConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.instanceUrl !== undefined && { instanceUrl: input.instanceUrl }), - ...(input.isSandboxEnvironment !== undefined && { isSandboxEnvironment: input.isSandboxEnvironment }), + ...(input.instanceUrl !== undefined && input.instanceUrl !== null && { instanceUrl: input.instanceUrl }), + ...(input.isSandboxEnvironment !== undefined && + input.isSandboxEnvironment !== null && { isSandboxEnvironment: input.isSandboxEnvironment }), }; }; @@ -2814,14 +2909,17 @@ const serializeAws_restJson1SalesforceDestinationProperties = ( context: __SerdeContext ): any => { return { - ...(input.errorHandlingConfig !== undefined && { - errorHandlingConfig: serializeAws_restJson1ErrorHandlingConfig(input.errorHandlingConfig, context), - }), - ...(input.idFieldNames !== undefined && { - idFieldNames: serializeAws_restJson1IdFieldNameList(input.idFieldNames, context), - }), - ...(input.object !== undefined && { object: input.object }), - ...(input.writeOperationType !== undefined && { writeOperationType: input.writeOperationType }), + ...(input.errorHandlingConfig !== undefined && + input.errorHandlingConfig !== null && { + errorHandlingConfig: serializeAws_restJson1ErrorHandlingConfig(input.errorHandlingConfig, context), + }), + ...(input.idFieldNames !== undefined && + input.idFieldNames !== null && { + idFieldNames: serializeAws_restJson1IdFieldNameList(input.idFieldNames, context), + }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), + ...(input.writeOperationType !== undefined && + input.writeOperationType !== null && { writeOperationType: input.writeOperationType }), }; }; @@ -2830,9 +2928,11 @@ const serializeAws_restJson1SalesforceSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.enableDynamicFieldUpdate !== undefined && { enableDynamicFieldUpdate: input.enableDynamicFieldUpdate }), - ...(input.includeDeletedRecords !== undefined && { includeDeletedRecords: input.includeDeletedRecords }), - ...(input.object !== undefined && { object: input.object }), + ...(input.enableDynamicFieldUpdate !== undefined && + input.enableDynamicFieldUpdate !== null && { enableDynamicFieldUpdate: input.enableDynamicFieldUpdate }), + ...(input.includeDeletedRecords !== undefined && + input.includeDeletedRecords !== null && { includeDeletedRecords: input.includeDeletedRecords }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -2841,13 +2941,14 @@ const serializeAws_restJson1ScheduledTriggerProperties = ( context: __SerdeContext ): any => { return { - ...(input.dataPullMode !== undefined && { dataPullMode: input.dataPullMode }), - ...(input.scheduleEndTime !== undefined && { scheduleEndTime: Math.round(input.scheduleEndTime.getTime() / 1000) }), - ...(input.scheduleExpression !== undefined && { scheduleExpression: input.scheduleExpression }), - ...(input.scheduleStartTime !== undefined && { - scheduleStartTime: Math.round(input.scheduleStartTime.getTime() / 1000), - }), - ...(input.timezone !== undefined && { timezone: input.timezone }), + ...(input.dataPullMode !== undefined && input.dataPullMode !== null && { dataPullMode: input.dataPullMode }), + ...(input.scheduleEndTime !== undefined && + input.scheduleEndTime !== null && { scheduleEndTime: Math.round(input.scheduleEndTime.getTime() / 1000) }), + ...(input.scheduleExpression !== undefined && + input.scheduleExpression !== null && { scheduleExpression: input.scheduleExpression }), + ...(input.scheduleStartTime !== undefined && + input.scheduleStartTime !== null && { scheduleStartTime: Math.round(input.scheduleStartTime.getTime() / 1000) }), + ...(input.timezone !== undefined && input.timezone !== null && { timezone: input.timezone }), }; }; @@ -2856,8 +2957,8 @@ const serializeAws_restJson1ServiceNowConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.password !== undefined && { password: input.password }), - ...(input.username !== undefined && { username: input.username }), + ...(input.password !== undefined && input.password !== null && { password: input.password }), + ...(input.username !== undefined && input.username !== null && { username: input.username }), }; }; @@ -2866,7 +2967,7 @@ const serializeAws_restJson1ServiceNowConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.instanceUrl !== undefined && { instanceUrl: input.instanceUrl }), + ...(input.instanceUrl !== undefined && input.instanceUrl !== null && { instanceUrl: input.instanceUrl }), }; }; @@ -2875,7 +2976,7 @@ const serializeAws_restJson1ServiceNowSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -2884,7 +2985,7 @@ const serializeAws_restJson1SingularConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.apiKey !== undefined && { apiKey: input.apiKey }), + ...(input.apiKey !== undefined && input.apiKey !== null && { apiKey: input.apiKey }), }; }; @@ -2900,7 +3001,7 @@ const serializeAws_restJson1SingularSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -2909,12 +3010,13 @@ const serializeAws_restJson1SlackConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.accessToken !== undefined && { accessToken: input.accessToken }), - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.clientSecret !== undefined && { clientSecret: input.clientSecret }), - ...(input.oAuthRequest !== undefined && { - oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), - }), + ...(input.accessToken !== undefined && input.accessToken !== null && { accessToken: input.accessToken }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.clientSecret !== undefined && input.clientSecret !== null && { clientSecret: input.clientSecret }), + ...(input.oAuthRequest !== undefined && + input.oAuthRequest !== null && { + oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), + }), }; }; @@ -2923,13 +3025,13 @@ const serializeAws_restJson1SlackConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.instanceUrl !== undefined && { instanceUrl: input.instanceUrl }), + ...(input.instanceUrl !== undefined && input.instanceUrl !== null && { instanceUrl: input.instanceUrl }), }; }; const serializeAws_restJson1SlackSourceProperties = (input: SlackSourceProperties, context: __SerdeContext): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -2938,8 +3040,8 @@ const serializeAws_restJson1SnowflakeConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.password !== undefined && { password: input.password }), - ...(input.username !== undefined && { username: input.username }), + ...(input.password !== undefined && input.password !== null && { password: input.password }), + ...(input.username !== undefined && input.username !== null && { username: input.username }), }; }; @@ -2948,13 +3050,14 @@ const serializeAws_restJson1SnowflakeConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.accountName !== undefined && { accountName: input.accountName }), - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.bucketPrefix !== undefined && { bucketPrefix: input.bucketPrefix }), - ...(input.privateLinkServiceName !== undefined && { privateLinkServiceName: input.privateLinkServiceName }), - ...(input.region !== undefined && { region: input.region }), - ...(input.stage !== undefined && { stage: input.stage }), - ...(input.warehouse !== undefined && { warehouse: input.warehouse }), + ...(input.accountName !== undefined && input.accountName !== null && { accountName: input.accountName }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.bucketPrefix !== undefined && input.bucketPrefix !== null && { bucketPrefix: input.bucketPrefix }), + ...(input.privateLinkServiceName !== undefined && + input.privateLinkServiceName !== null && { privateLinkServiceName: input.privateLinkServiceName }), + ...(input.region !== undefined && input.region !== null && { region: input.region }), + ...(input.stage !== undefined && input.stage !== null && { stage: input.stage }), + ...(input.warehouse !== undefined && input.warehouse !== null && { warehouse: input.warehouse }), }; }; @@ -2963,12 +3066,14 @@ const serializeAws_restJson1SnowflakeDestinationProperties = ( context: __SerdeContext ): any => { return { - ...(input.bucketPrefix !== undefined && { bucketPrefix: input.bucketPrefix }), - ...(input.errorHandlingConfig !== undefined && { - errorHandlingConfig: serializeAws_restJson1ErrorHandlingConfig(input.errorHandlingConfig, context), - }), - ...(input.intermediateBucketName !== undefined && { intermediateBucketName: input.intermediateBucketName }), - ...(input.object !== undefined && { object: input.object }), + ...(input.bucketPrefix !== undefined && input.bucketPrefix !== null && { bucketPrefix: input.bucketPrefix }), + ...(input.errorHandlingConfig !== undefined && + input.errorHandlingConfig !== null && { + errorHandlingConfig: serializeAws_restJson1ErrorHandlingConfig(input.errorHandlingConfig, context), + }), + ...(input.intermediateBucketName !== undefined && + input.intermediateBucketName !== null && { intermediateBucketName: input.intermediateBucketName }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -2977,103 +3082,135 @@ const serializeAws_restJson1SourceConnectorProperties = ( context: __SerdeContext ): any => { return { - ...(input.Amplitude !== undefined && { - Amplitude: serializeAws_restJson1AmplitudeSourceProperties(input.Amplitude, context), - }), - ...(input.Datadog !== undefined && { - Datadog: serializeAws_restJson1DatadogSourceProperties(input.Datadog, context), - }), - ...(input.Dynatrace !== undefined && { - Dynatrace: serializeAws_restJson1DynatraceSourceProperties(input.Dynatrace, context), - }), - ...(input.GoogleAnalytics !== undefined && { - GoogleAnalytics: serializeAws_restJson1GoogleAnalyticsSourceProperties(input.GoogleAnalytics, context), - }), - ...(input.InforNexus !== undefined && { - InforNexus: serializeAws_restJson1InforNexusSourceProperties(input.InforNexus, context), - }), - ...(input.Marketo !== undefined && { - Marketo: serializeAws_restJson1MarketoSourceProperties(input.Marketo, context), - }), - ...(input.S3 !== undefined && { S3: serializeAws_restJson1S3SourceProperties(input.S3, context) }), - ...(input.Salesforce !== undefined && { - Salesforce: serializeAws_restJson1SalesforceSourceProperties(input.Salesforce, context), - }), - ...(input.ServiceNow !== undefined && { - ServiceNow: serializeAws_restJson1ServiceNowSourceProperties(input.ServiceNow, context), - }), - ...(input.Singular !== undefined && { - Singular: serializeAws_restJson1SingularSourceProperties(input.Singular, context), - }), - ...(input.Slack !== undefined && { Slack: serializeAws_restJson1SlackSourceProperties(input.Slack, context) }), - ...(input.Trendmicro !== undefined && { - Trendmicro: serializeAws_restJson1TrendmicroSourceProperties(input.Trendmicro, context), - }), - ...(input.Veeva !== undefined && { Veeva: serializeAws_restJson1VeevaSourceProperties(input.Veeva, context) }), - ...(input.Zendesk !== undefined && { - Zendesk: serializeAws_restJson1ZendeskSourceProperties(input.Zendesk, context), - }), + ...(input.Amplitude !== undefined && + input.Amplitude !== null && { + Amplitude: serializeAws_restJson1AmplitudeSourceProperties(input.Amplitude, context), + }), + ...(input.Datadog !== undefined && + input.Datadog !== null && { Datadog: serializeAws_restJson1DatadogSourceProperties(input.Datadog, context) }), + ...(input.Dynatrace !== undefined && + input.Dynatrace !== null && { + Dynatrace: serializeAws_restJson1DynatraceSourceProperties(input.Dynatrace, context), + }), + ...(input.GoogleAnalytics !== undefined && + input.GoogleAnalytics !== null && { + GoogleAnalytics: serializeAws_restJson1GoogleAnalyticsSourceProperties(input.GoogleAnalytics, context), + }), + ...(input.InforNexus !== undefined && + input.InforNexus !== null && { + InforNexus: serializeAws_restJson1InforNexusSourceProperties(input.InforNexus, context), + }), + ...(input.Marketo !== undefined && + input.Marketo !== null && { Marketo: serializeAws_restJson1MarketoSourceProperties(input.Marketo, context) }), + ...(input.S3 !== undefined && + input.S3 !== null && { S3: serializeAws_restJson1S3SourceProperties(input.S3, context) }), + ...(input.Salesforce !== undefined && + input.Salesforce !== null && { + Salesforce: serializeAws_restJson1SalesforceSourceProperties(input.Salesforce, context), + }), + ...(input.ServiceNow !== undefined && + input.ServiceNow !== null && { + ServiceNow: serializeAws_restJson1ServiceNowSourceProperties(input.ServiceNow, context), + }), + ...(input.Singular !== undefined && + input.Singular !== null && { Singular: serializeAws_restJson1SingularSourceProperties(input.Singular, context) }), + ...(input.Slack !== undefined && + input.Slack !== null && { Slack: serializeAws_restJson1SlackSourceProperties(input.Slack, context) }), + ...(input.Trendmicro !== undefined && + input.Trendmicro !== null && { + Trendmicro: serializeAws_restJson1TrendmicroSourceProperties(input.Trendmicro, context), + }), + ...(input.Veeva !== undefined && + input.Veeva !== null && { Veeva: serializeAws_restJson1VeevaSourceProperties(input.Veeva, context) }), + ...(input.Zendesk !== undefined && + input.Zendesk !== null && { Zendesk: serializeAws_restJson1ZendeskSourceProperties(input.Zendesk, context) }), }; }; const serializeAws_restJson1SourceFields = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SourceFlowConfig = (input: SourceFlowConfig, context: __SerdeContext): any => { return { - ...(input.connectorProfileName !== undefined && { connectorProfileName: input.connectorProfileName }), - ...(input.connectorType !== undefined && { connectorType: input.connectorType }), - ...(input.incrementalPullConfig !== undefined && { - incrementalPullConfig: serializeAws_restJson1IncrementalPullConfig(input.incrementalPullConfig, context), - }), - ...(input.sourceConnectorProperties !== undefined && { - sourceConnectorProperties: serializeAws_restJson1SourceConnectorProperties( - input.sourceConnectorProperties, - context - ), - }), + ...(input.connectorProfileName !== undefined && + input.connectorProfileName !== null && { connectorProfileName: input.connectorProfileName }), + ...(input.connectorType !== undefined && input.connectorType !== null && { connectorType: input.connectorType }), + ...(input.incrementalPullConfig !== undefined && + input.incrementalPullConfig !== null && { + incrementalPullConfig: serializeAws_restJson1IncrementalPullConfig(input.incrementalPullConfig, context), + }), + ...(input.sourceConnectorProperties !== undefined && + input.sourceConnectorProperties !== null && { + sourceConnectorProperties: serializeAws_restJson1SourceConnectorProperties( + input.sourceConnectorProperties, + context + ), + }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Task = (input: Task, context: __SerdeContext): any => { return { - ...(input.connectorOperator !== undefined && { - connectorOperator: serializeAws_restJson1ConnectorOperator(input.connectorOperator, context), - }), - ...(input.destinationField !== undefined && { destinationField: input.destinationField }), - ...(input.sourceFields !== undefined && { - sourceFields: serializeAws_restJson1SourceFields(input.sourceFields, context), - }), - ...(input.taskProperties !== undefined && { - taskProperties: serializeAws_restJson1TaskPropertiesMap(input.taskProperties, context), - }), - ...(input.taskType !== undefined && { taskType: input.taskType }), + ...(input.connectorOperator !== undefined && + input.connectorOperator !== null && { + connectorOperator: serializeAws_restJson1ConnectorOperator(input.connectorOperator, context), + }), + ...(input.destinationField !== undefined && + input.destinationField !== null && { destinationField: input.destinationField }), + ...(input.sourceFields !== undefined && + input.sourceFields !== null && { sourceFields: serializeAws_restJson1SourceFields(input.sourceFields, context) }), + ...(input.taskProperties !== undefined && + input.taskProperties !== null && { + taskProperties: serializeAws_restJson1TaskPropertiesMap(input.taskProperties, context), + }), + ...(input.taskType !== undefined && input.taskType !== null && { taskType: input.taskType }), }; }; const serializeAws_restJson1TaskPropertiesMap = (input: { [key: string]: string }, context: __SerdeContext): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [OperatorPropertiesKeys | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [OperatorPropertiesKeys | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; const serializeAws_restJson1Tasks = (input: Task[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Task(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Task(entry, context); + }); }; const serializeAws_restJson1TrendmicroConnectorProfileCredentials = ( @@ -3081,7 +3218,7 @@ const serializeAws_restJson1TrendmicroConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.apiSecretKey !== undefined && { apiSecretKey: input.apiSecretKey }), + ...(input.apiSecretKey !== undefined && input.apiSecretKey !== null && { apiSecretKey: input.apiSecretKey }), }; }; @@ -3097,24 +3234,26 @@ const serializeAws_restJson1TrendmicroSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; const serializeAws_restJson1TriggerConfig = (input: TriggerConfig, context: __SerdeContext): any => { return { - ...(input.triggerProperties !== undefined && { - triggerProperties: serializeAws_restJson1TriggerProperties(input.triggerProperties, context), - }), - ...(input.triggerType !== undefined && { triggerType: input.triggerType }), + ...(input.triggerProperties !== undefined && + input.triggerProperties !== null && { + triggerProperties: serializeAws_restJson1TriggerProperties(input.triggerProperties, context), + }), + ...(input.triggerType !== undefined && input.triggerType !== null && { triggerType: input.triggerType }), }; }; const serializeAws_restJson1TriggerProperties = (input: TriggerProperties, context: __SerdeContext): any => { return { - ...(input.Scheduled !== undefined && { - Scheduled: serializeAws_restJson1ScheduledTriggerProperties(input.Scheduled, context), - }), + ...(input.Scheduled !== undefined && + input.Scheduled !== null && { + Scheduled: serializeAws_restJson1ScheduledTriggerProperties(input.Scheduled, context), + }), }; }; @@ -3123,11 +3262,12 @@ const serializeAws_restJson1UpsolverDestinationProperties = ( context: __SerdeContext ): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.bucketPrefix !== undefined && { bucketPrefix: input.bucketPrefix }), - ...(input.s3OutputFormatConfig !== undefined && { - s3OutputFormatConfig: serializeAws_restJson1UpsolverS3OutputFormatConfig(input.s3OutputFormatConfig, context), - }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.bucketPrefix !== undefined && input.bucketPrefix !== null && { bucketPrefix: input.bucketPrefix }), + ...(input.s3OutputFormatConfig !== undefined && + input.s3OutputFormatConfig !== null && { + s3OutputFormatConfig: serializeAws_restJson1UpsolverS3OutputFormatConfig(input.s3OutputFormatConfig, context), + }), }; }; @@ -3136,13 +3276,13 @@ const serializeAws_restJson1UpsolverS3OutputFormatConfig = ( context: __SerdeContext ): any => { return { - ...(input.aggregationConfig !== undefined && { - aggregationConfig: serializeAws_restJson1AggregationConfig(input.aggregationConfig, context), - }), - ...(input.fileType !== undefined && { fileType: input.fileType }), - ...(input.prefixConfig !== undefined && { - prefixConfig: serializeAws_restJson1PrefixConfig(input.prefixConfig, context), - }), + ...(input.aggregationConfig !== undefined && + input.aggregationConfig !== null && { + aggregationConfig: serializeAws_restJson1AggregationConfig(input.aggregationConfig, context), + }), + ...(input.fileType !== undefined && input.fileType !== null && { fileType: input.fileType }), + ...(input.prefixConfig !== undefined && + input.prefixConfig !== null && { prefixConfig: serializeAws_restJson1PrefixConfig(input.prefixConfig, context) }), }; }; @@ -3151,8 +3291,8 @@ const serializeAws_restJson1VeevaConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.password !== undefined && { password: input.password }), - ...(input.username !== undefined && { username: input.username }), + ...(input.password !== undefined && input.password !== null && { password: input.password }), + ...(input.username !== undefined && input.username !== null && { username: input.username }), }; }; @@ -3161,13 +3301,13 @@ const serializeAws_restJson1VeevaConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.instanceUrl !== undefined && { instanceUrl: input.instanceUrl }), + ...(input.instanceUrl !== undefined && input.instanceUrl !== null && { instanceUrl: input.instanceUrl }), }; }; const serializeAws_restJson1VeevaSourceProperties = (input: VeevaSourceProperties, context: __SerdeContext): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -3176,12 +3316,13 @@ const serializeAws_restJson1ZendeskConnectorProfileCredentials = ( context: __SerdeContext ): any => { return { - ...(input.accessToken !== undefined && { accessToken: input.accessToken }), - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.clientSecret !== undefined && { clientSecret: input.clientSecret }), - ...(input.oAuthRequest !== undefined && { - oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), - }), + ...(input.accessToken !== undefined && input.accessToken !== null && { accessToken: input.accessToken }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.clientSecret !== undefined && input.clientSecret !== null && { clientSecret: input.clientSecret }), + ...(input.oAuthRequest !== undefined && + input.oAuthRequest !== null && { + oAuthRequest: serializeAws_restJson1ConnectorOAuthRequest(input.oAuthRequest, context), + }), }; }; @@ -3190,7 +3331,7 @@ const serializeAws_restJson1ZendeskConnectorProfileProperties = ( context: __SerdeContext ): any => { return { - ...(input.instanceUrl !== undefined && { instanceUrl: input.instanceUrl }), + ...(input.instanceUrl !== undefined && input.instanceUrl !== null && { instanceUrl: input.instanceUrl }), }; }; @@ -3199,7 +3340,7 @@ const serializeAws_restJson1ZendeskSourceProperties = ( context: __SerdeContext ): any => { return { - ...(input.object !== undefined && { object: input.object }), + ...(input.object !== undefined && input.object !== null && { object: input.object }), }; }; @@ -3273,10 +3414,15 @@ const deserializeAws_restJson1ConnectorConfigurationsMap = ( context: __SerdeContext ): { [key: string]: ConnectorConfiguration } => { return Object.entries(output).reduce( - (acc: { [key: string]: ConnectorConfiguration }, [key, value]: [ConnectorType | string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1ConnectorConfiguration(value, context), - }), + (acc: { [key: string]: ConnectorConfiguration }, [key, value]: [ConnectorType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1ConnectorConfiguration(value, context), + }; + }, {} ); }; @@ -3316,24 +3462,40 @@ const deserializeAws_restJson1ConnectorEntityFieldList = ( output: any, context: __SerdeContext ): ConnectorEntityField[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConnectorEntityField(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConnectorEntityField(entry, context); + }); }; const deserializeAws_restJson1ConnectorEntityList = (output: any, context: __SerdeContext): ConnectorEntity[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConnectorEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConnectorEntity(entry, context); + }); }; const deserializeAws_restJson1ConnectorEntityMap = ( output: any, context: __SerdeContext ): { [key: string]: ConnectorEntity[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ConnectorEntity[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ConnectorEntity[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ConnectorEntityList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ConnectorMetadata = (output: any, context: __SerdeContext): ConnectorMetadata => { @@ -3468,7 +3630,14 @@ const deserializeAws_restJson1ConnectorProfileDetailList = ( output: any, context: __SerdeContext ): ConnectorProfile[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConnectorProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConnectorProfile(entry, context); + }); }; const deserializeAws_restJson1ConnectorProfileProperties = ( @@ -3543,7 +3712,14 @@ const deserializeAws_restJson1ConnectorTypeList = ( output: any, context: __SerdeContext ): (ConnectorType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DatadogConnectorProfileProperties = ( @@ -3635,7 +3811,14 @@ const deserializeAws_restJson1DestinationFlowConfigList = ( output: any, context: __SerdeContext ): DestinationFlowConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DestinationFlowConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DestinationFlowConfig(entry, context); + }); }; const deserializeAws_restJson1DynatraceConnectorProfileProperties = ( @@ -3763,7 +3946,14 @@ const deserializeAws_restJson1FieldTypeDetails = (output: any, context: __SerdeC }; const deserializeAws_restJson1FilterOperatorList = (output: any, context: __SerdeContext): (Operator | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1FlowDefinition = (output: any, context: __SerdeContext): FlowDefinition => { @@ -3804,11 +3994,25 @@ const deserializeAws_restJson1FlowDefinition = (output: any, context: __SerdeCon }; const deserializeAws_restJson1FlowExecutionList = (output: any, context: __SerdeContext): ExecutionRecord[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ExecutionRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ExecutionRecord(entry, context); + }); }; const deserializeAws_restJson1FlowList = (output: any, context: __SerdeContext): FlowDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FlowDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FlowDefinition(entry, context); + }); }; const deserializeAws_restJson1GoogleAnalyticsConnectorProfileProperties = ( @@ -3840,7 +4044,14 @@ const deserializeAws_restJson1GoogleAnalyticsSourceProperties = ( }; const deserializeAws_restJson1IdFieldNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1IncrementalPullConfig = (output: any, context: __SerdeContext): IncrementalPullConfig => { @@ -3897,7 +4108,14 @@ const deserializeAws_restJson1MarketoSourceProperties = ( }; const deserializeAws_restJson1OAuthScopeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1PrefixConfig = (output: any, context: __SerdeContext): PrefixConfig => { @@ -3942,7 +4160,14 @@ const deserializeAws_restJson1RedshiftMetadata = (output: any, context: __SerdeC }; const deserializeAws_restJson1RegionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1S3DestinationProperties = ( @@ -4070,7 +4295,14 @@ const deserializeAws_restJson1SchedulingFrequencyTypeList = ( output: any, context: __SerdeContext ): (ScheduleFrequencyType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ServiceNowConnectorProfileProperties = ( @@ -4257,7 +4489,14 @@ const deserializeAws_restJson1SourceFieldProperties = (output: any, context: __S }; const deserializeAws_restJson1SourceFields = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SourceFlowConfig = (output: any, context: __SerdeContext): SourceFlowConfig => { @@ -4292,24 +4531,40 @@ const deserializeAws_restJson1SupportedFieldTypeDetails = ( }; const deserializeAws_restJson1SupportedValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SupportedWriteOperationList = ( output: any, context: __SerdeContext ): (WriteOperationType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Task = (output: any, context: __SerdeContext): Task => { @@ -4334,16 +4589,28 @@ const deserializeAws_restJson1Task = (output: any, context: __SerdeContext): Tas const deserializeAws_restJson1TaskPropertiesMap = (output: any, context: __SerdeContext): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [OperatorPropertiesKeys | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [OperatorPropertiesKeys | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; const deserializeAws_restJson1Tasks = (output: any, context: __SerdeContext): Task[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Task(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Task(entry, context); + }); }; const deserializeAws_restJson1TrendmicroConnectorProfileProperties = ( @@ -4386,7 +4653,14 @@ const deserializeAws_restJson1TriggerProperties = (output: any, context: __Serde }; const deserializeAws_restJson1TriggerTypeList = (output: any, context: __SerdeContext): (TriggerType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1UpsolverDestinationProperties = ( @@ -4490,6 +4764,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-appintegrations/protocols/Aws_restJson1.ts b/clients/client-appintegrations/protocols/Aws_restJson1.ts index 407a556437e3..82af9688a0e0 100644 --- a/clients/client-appintegrations/protocols/Aws_restJson1.ts +++ b/clients/client-appintegrations/protocols/Aws_restJson1.ts @@ -58,19 +58,19 @@ export const serializeAws_restJson1CreateEventIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/eventIntegrations"; let body: any; body = JSON.stringify({ ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EventBridgeBus !== undefined && { EventBridgeBus: input.EventBridgeBus }), - ...(input.EventFilter !== undefined && { - EventFilter: serializeAws_restJson1EventFilter(input.EventFilter, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EventBridgeBus !== undefined && + input.EventBridgeBus !== null && { EventBridgeBus: input.EventBridgeBus }), + ...(input.EventFilter !== undefined && + input.EventFilter !== null && { EventFilter: serializeAws_restJson1EventFilter(input.EventFilter, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -88,9 +88,7 @@ export const serializeAws_restJson1DeleteEventIntegrationCommand = async ( input: DeleteEventIntegrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/eventIntegrations/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -118,9 +116,7 @@ export const serializeAws_restJson1GetEventIntegrationCommand = async ( input: GetEventIntegrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/eventIntegrations/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -148,9 +144,7 @@ export const serializeAws_restJson1ListEventIntegrationAssociationsCommand = asy input: ListEventIntegrationAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/eventIntegrations/{EventIntegrationName}/associations"; if (input.EventIntegrationName !== undefined) { const labelValue: string = input.EventIntegrationName; @@ -183,9 +177,7 @@ export const serializeAws_restJson1ListEventIntegrationsCommand = async ( input: ListEventIntegrationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/eventIntegrations"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -209,9 +201,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -240,7 +230,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -254,7 +244,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -272,9 +262,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -307,7 +295,7 @@ export const serializeAws_restJson1UpdateEventIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/eventIntegrations/{Name}"; if (input.Name !== undefined) { @@ -321,7 +309,7 @@ export const serializeAws_restJson1UpdateEventIntegrationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1230,31 +1218,35 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async ( const serializeAws_restJson1EventFilter = (input: EventFilter, context: __SerdeContext): any => { return { - ...(input.Source !== undefined && { Source: input.Source }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ClientAssociationMetadata = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1EventFilter = (output: any, context: __SerdeContext): EventFilter => { @@ -1317,21 +1309,37 @@ const deserializeAws_restJson1EventIntegrationAssociationsList = ( output: any, context: __SerdeContext ): EventIntegrationAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EventIntegrationAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EventIntegrationAssociation(entry, context); + }); }; const deserializeAws_restJson1EventIntegrationsList = (output: any, context: __SerdeContext): EventIntegration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EventIntegration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EventIntegration(entry, context); + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1354,6 +1362,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-application-auto-scaling/protocols/Aws_json1_1.ts b/clients/client-application-auto-scaling/protocols/Aws_json1_1.ts index 70f369055128..365e2e84ea6d 100644 --- a/clients/client-application-auto-scaling/protocols/Aws_json1_1.ts +++ b/clients/client-application-auto-scaling/protocols/Aws_json1_1.ts @@ -89,7 +89,7 @@ export const serializeAws_json1_1DeleteScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.DeleteScalingPolicy", }; let body: any; @@ -102,7 +102,7 @@ export const serializeAws_json1_1DeleteScheduledActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.DeleteScheduledAction", }; let body: any; @@ -115,7 +115,7 @@ export const serializeAws_json1_1DeregisterScalableTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.DeregisterScalableTarget", }; let body: any; @@ -128,7 +128,7 @@ export const serializeAws_json1_1DescribeScalableTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.DescribeScalableTargets", }; let body: any; @@ -141,7 +141,7 @@ export const serializeAws_json1_1DescribeScalingActivitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.DescribeScalingActivities", }; let body: any; @@ -154,7 +154,7 @@ export const serializeAws_json1_1DescribeScalingPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.DescribeScalingPolicies", }; let body: any; @@ -167,7 +167,7 @@ export const serializeAws_json1_1DescribeScheduledActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.DescribeScheduledActions", }; let body: any; @@ -180,7 +180,7 @@ export const serializeAws_json1_1PutScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.PutScalingPolicy", }; let body: any; @@ -193,7 +193,7 @@ export const serializeAws_json1_1PutScheduledActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.PutScheduledAction", }; let body: any; @@ -206,7 +206,7 @@ export const serializeAws_json1_1RegisterScalableTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleFrontendService.RegisterScalableTarget", }; let body: any; @@ -241,8 +241,7 @@ const deserializeAws_json1_1DeleteScalingPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -320,8 +319,7 @@ const deserializeAws_json1_1DeleteScheduledActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -399,8 +397,7 @@ const deserializeAws_json1_1DeregisterScalableTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -478,8 +475,7 @@ const deserializeAws_json1_1DescribeScalableTargetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -557,8 +553,7 @@ const deserializeAws_json1_1DescribeScalingActivitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -636,8 +631,7 @@ const deserializeAws_json1_1DescribeScalingPoliciesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -723,8 +717,7 @@ const deserializeAws_json1_1DescribeScheduledActionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -802,8 +795,7 @@ const deserializeAws_json1_1PutScalingPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -897,8 +889,7 @@ const deserializeAws_json1_1PutScheduledActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -984,8 +975,7 @@ const deserializeAws_json1_1RegisterScalableTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": @@ -1146,13 +1136,12 @@ const serializeAws_json1_1CustomizedMetricSpecification = ( context: __SerdeContext ): any => { return { - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context), - }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Namespace !== undefined && { Namespace: input.Namespace }), - ...(input.Statistic !== undefined && { Statistic: input.Statistic }), - ...(input.Unit !== undefined && { Unit: input.Unit }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context) }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Namespace !== undefined && input.Namespace !== null && { Namespace: input.Namespace }), + ...(input.Statistic !== undefined && input.Statistic !== null && { Statistic: input.Statistic }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), }; }; @@ -1161,10 +1150,12 @@ const serializeAws_json1_1DeleteScalingPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), }; }; @@ -1173,10 +1164,13 @@ const serializeAws_json1_1DeleteScheduledActionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ScheduledActionName !== undefined && { ScheduledActionName: input.ScheduledActionName }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ScheduledActionName !== undefined && + input.ScheduledActionName !== null && { ScheduledActionName: input.ScheduledActionName }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), }; }; @@ -1185,9 +1179,11 @@ const serializeAws_json1_1DeregisterScalableTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), }; }; @@ -1196,13 +1192,16 @@ const serializeAws_json1_1DescribeScalableTargetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceIds !== undefined && { - ResourceIds: serializeAws_json1_1ResourceIdsMaxLen1600(input.ResourceIds, context), - }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceIds !== undefined && + input.ResourceIds !== null && { + ResourceIds: serializeAws_json1_1ResourceIdsMaxLen1600(input.ResourceIds, context), + }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), }; }; @@ -1211,11 +1210,13 @@ const serializeAws_json1_1DescribeScalingActivitiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), }; }; @@ -1224,14 +1225,17 @@ const serializeAws_json1_1DescribeScalingPoliciesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PolicyNames !== undefined && { - PolicyNames: serializeAws_json1_1ResourceIdsMaxLen1600(input.PolicyNames, context), - }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PolicyNames !== undefined && + input.PolicyNames !== null && { + PolicyNames: serializeAws_json1_1ResourceIdsMaxLen1600(input.PolicyNames, context), + }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), }; }; @@ -1240,26 +1244,36 @@ const serializeAws_json1_1DescribeScheduledActionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ScheduledActionNames !== undefined && { - ScheduledActionNames: serializeAws_json1_1ResourceIdsMaxLen1600(input.ScheduledActionNames, context), - }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ScheduledActionNames !== undefined && + input.ScheduledActionNames !== null && { + ScheduledActionNames: serializeAws_json1_1ResourceIdsMaxLen1600(input.ScheduledActionNames, context), + }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), }; }; const serializeAws_json1_1MetricDimension = (input: MetricDimension, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1MetricDimensions = (input: MetricDimension[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MetricDimension(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MetricDimension(entry, context); + }); }; const serializeAws_json1_1PredefinedMetricSpecification = ( @@ -1267,30 +1281,35 @@ const serializeAws_json1_1PredefinedMetricSpecification = ( context: __SerdeContext ): any => { return { - ...(input.PredefinedMetricType !== undefined && { PredefinedMetricType: input.PredefinedMetricType }), - ...(input.ResourceLabel !== undefined && { ResourceLabel: input.ResourceLabel }), + ...(input.PredefinedMetricType !== undefined && + input.PredefinedMetricType !== null && { PredefinedMetricType: input.PredefinedMetricType }), + ...(input.ResourceLabel !== undefined && input.ResourceLabel !== null && { ResourceLabel: input.ResourceLabel }), }; }; const serializeAws_json1_1PutScalingPolicyRequest = (input: PutScalingPolicyRequest, context: __SerdeContext): any => { return { - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), - ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), - ...(input.StepScalingPolicyConfiguration !== undefined && { - StepScalingPolicyConfiguration: serializeAws_json1_1StepScalingPolicyConfiguration( - input.StepScalingPolicyConfiguration, - context - ), - }), - ...(input.TargetTrackingScalingPolicyConfiguration !== undefined && { - TargetTrackingScalingPolicyConfiguration: serializeAws_json1_1TargetTrackingScalingPolicyConfiguration( - input.TargetTrackingScalingPolicyConfiguration, - context - ), - }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), + ...(input.PolicyType !== undefined && input.PolicyType !== null && { PolicyType: input.PolicyType }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), + ...(input.StepScalingPolicyConfiguration !== undefined && + input.StepScalingPolicyConfiguration !== null && { + StepScalingPolicyConfiguration: serializeAws_json1_1StepScalingPolicyConfiguration( + input.StepScalingPolicyConfiguration, + context + ), + }), + ...(input.TargetTrackingScalingPolicyConfiguration !== undefined && + input.TargetTrackingScalingPolicyConfiguration !== null && { + TargetTrackingScalingPolicyConfiguration: serializeAws_json1_1TargetTrackingScalingPolicyConfiguration( + input.TargetTrackingScalingPolicyConfiguration, + context + ), + }), }; }; @@ -1299,16 +1318,22 @@ const serializeAws_json1_1PutScheduledActionRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ScalableTargetAction !== undefined && { - ScalableTargetAction: serializeAws_json1_1ScalableTargetAction(input.ScalableTargetAction, context), - }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), - ...(input.ScheduledActionName !== undefined && { ScheduledActionName: input.ScheduledActionName }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ScalableTargetAction !== undefined && + input.ScalableTargetAction !== null && { + ScalableTargetAction: serializeAws_json1_1ScalableTargetAction(input.ScalableTargetAction, context), + }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), + ...(input.ScheduledActionName !== undefined && + input.ScheduledActionName !== null && { ScheduledActionName: input.ScheduledActionName }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; @@ -1317,39 +1342,59 @@ const serializeAws_json1_1RegisterScalableTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MinCapacity !== undefined && { MinCapacity: input.MinCapacity }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), - ...(input.SuspendedState !== undefined && { - SuspendedState: serializeAws_json1_1SuspendedState(input.SuspendedState, context), - }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MinCapacity !== undefined && input.MinCapacity !== null && { MinCapacity: input.MinCapacity }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), + ...(input.SuspendedState !== undefined && + input.SuspendedState !== null && { + SuspendedState: serializeAws_json1_1SuspendedState(input.SuspendedState, context), + }), }; }; const serializeAws_json1_1ResourceIdsMaxLen1600 = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ScalableTargetAction = (input: ScalableTargetAction, context: __SerdeContext): any => { return { - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MinCapacity !== undefined && { MinCapacity: input.MinCapacity }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MinCapacity !== undefined && input.MinCapacity !== null && { MinCapacity: input.MinCapacity }), }; }; const serializeAws_json1_1StepAdjustment = (input: StepAdjustment, context: __SerdeContext): any => { return { - ...(input.MetricIntervalLowerBound !== undefined && { MetricIntervalLowerBound: input.MetricIntervalLowerBound }), - ...(input.MetricIntervalUpperBound !== undefined && { MetricIntervalUpperBound: input.MetricIntervalUpperBound }), - ...(input.ScalingAdjustment !== undefined && { ScalingAdjustment: input.ScalingAdjustment }), + ...(input.MetricIntervalLowerBound !== undefined && + input.MetricIntervalLowerBound !== null && { MetricIntervalLowerBound: input.MetricIntervalLowerBound }), + ...(input.MetricIntervalUpperBound !== undefined && + input.MetricIntervalUpperBound !== null && { MetricIntervalUpperBound: input.MetricIntervalUpperBound }), + ...(input.ScalingAdjustment !== undefined && + input.ScalingAdjustment !== null && { ScalingAdjustment: input.ScalingAdjustment }), }; }; const serializeAws_json1_1StepAdjustments = (input: StepAdjustment[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1StepAdjustment(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1StepAdjustment(entry, context); + }); }; const serializeAws_json1_1StepScalingPolicyConfiguration = ( @@ -1357,27 +1402,28 @@ const serializeAws_json1_1StepScalingPolicyConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AdjustmentType !== undefined && { AdjustmentType: input.AdjustmentType }), - ...(input.Cooldown !== undefined && { Cooldown: input.Cooldown }), - ...(input.MetricAggregationType !== undefined && { MetricAggregationType: input.MetricAggregationType }), - ...(input.MinAdjustmentMagnitude !== undefined && { MinAdjustmentMagnitude: input.MinAdjustmentMagnitude }), - ...(input.StepAdjustments !== undefined && { - StepAdjustments: serializeAws_json1_1StepAdjustments(input.StepAdjustments, context), - }), + ...(input.AdjustmentType !== undefined && + input.AdjustmentType !== null && { AdjustmentType: input.AdjustmentType }), + ...(input.Cooldown !== undefined && input.Cooldown !== null && { Cooldown: input.Cooldown }), + ...(input.MetricAggregationType !== undefined && + input.MetricAggregationType !== null && { MetricAggregationType: input.MetricAggregationType }), + ...(input.MinAdjustmentMagnitude !== undefined && + input.MinAdjustmentMagnitude !== null && { MinAdjustmentMagnitude: input.MinAdjustmentMagnitude }), + ...(input.StepAdjustments !== undefined && + input.StepAdjustments !== null && { + StepAdjustments: serializeAws_json1_1StepAdjustments(input.StepAdjustments, context), + }), }; }; const serializeAws_json1_1SuspendedState = (input: SuspendedState, context: __SerdeContext): any => { return { - ...(input.DynamicScalingInSuspended !== undefined && { - DynamicScalingInSuspended: input.DynamicScalingInSuspended, - }), - ...(input.DynamicScalingOutSuspended !== undefined && { - DynamicScalingOutSuspended: input.DynamicScalingOutSuspended, - }), - ...(input.ScheduledScalingSuspended !== undefined && { - ScheduledScalingSuspended: input.ScheduledScalingSuspended, - }), + ...(input.DynamicScalingInSuspended !== undefined && + input.DynamicScalingInSuspended !== null && { DynamicScalingInSuspended: input.DynamicScalingInSuspended }), + ...(input.DynamicScalingOutSuspended !== undefined && + input.DynamicScalingOutSuspended !== null && { DynamicScalingOutSuspended: input.DynamicScalingOutSuspended }), + ...(input.ScheduledScalingSuspended !== undefined && + input.ScheduledScalingSuspended !== null && { ScheduledScalingSuspended: input.ScheduledScalingSuspended }), }; }; @@ -1386,22 +1432,27 @@ const serializeAws_json1_1TargetTrackingScalingPolicyConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CustomizedMetricSpecification !== undefined && { - CustomizedMetricSpecification: serializeAws_json1_1CustomizedMetricSpecification( - input.CustomizedMetricSpecification, - context - ), - }), - ...(input.DisableScaleIn !== undefined && { DisableScaleIn: input.DisableScaleIn }), - ...(input.PredefinedMetricSpecification !== undefined && { - PredefinedMetricSpecification: serializeAws_json1_1PredefinedMetricSpecification( - input.PredefinedMetricSpecification, - context - ), - }), - ...(input.ScaleInCooldown !== undefined && { ScaleInCooldown: input.ScaleInCooldown }), - ...(input.ScaleOutCooldown !== undefined && { ScaleOutCooldown: input.ScaleOutCooldown }), - ...(input.TargetValue !== undefined && { TargetValue: input.TargetValue }), + ...(input.CustomizedMetricSpecification !== undefined && + input.CustomizedMetricSpecification !== null && { + CustomizedMetricSpecification: serializeAws_json1_1CustomizedMetricSpecification( + input.CustomizedMetricSpecification, + context + ), + }), + ...(input.DisableScaleIn !== undefined && + input.DisableScaleIn !== null && { DisableScaleIn: input.DisableScaleIn }), + ...(input.PredefinedMetricSpecification !== undefined && + input.PredefinedMetricSpecification !== null && { + PredefinedMetricSpecification: serializeAws_json1_1PredefinedMetricSpecification( + input.PredefinedMetricSpecification, + context + ), + }), + ...(input.ScaleInCooldown !== undefined && + input.ScaleInCooldown !== null && { ScaleInCooldown: input.ScaleInCooldown }), + ...(input.ScaleOutCooldown !== undefined && + input.ScaleOutCooldown !== null && { ScaleOutCooldown: input.ScaleOutCooldown }), + ...(input.TargetValue !== undefined && input.TargetValue !== null && { TargetValue: input.TargetValue }), }; }; @@ -1413,7 +1464,14 @@ const deserializeAws_json1_1Alarm = (output: any, context: __SerdeContext): Alar }; const deserializeAws_json1_1Alarms = (output: any, context: __SerdeContext): Alarm[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Alarm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Alarm(entry, context); + }); }; const deserializeAws_json1_1ConcurrentUpdateException = ( @@ -1555,7 +1613,14 @@ const deserializeAws_json1_1MetricDimension = (output: any, context: __SerdeCont }; const deserializeAws_json1_1MetricDimensions = (output: any, context: __SerdeContext): MetricDimension[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricDimension(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricDimension(entry, context); + }); }; const deserializeAws_json1_1ObjectNotFoundException = ( @@ -1639,11 +1704,25 @@ const deserializeAws_json1_1ScalableTargetAction = (output: any, context: __Serd }; const deserializeAws_json1_1ScalableTargets = (output: any, context: __SerdeContext): ScalableTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScalableTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScalableTarget(entry, context); + }); }; const deserializeAws_json1_1ScalingActivities = (output: any, context: __SerdeContext): ScalingActivity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScalingActivity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScalingActivity(entry, context); + }); }; const deserializeAws_json1_1ScalingActivity = (output: any, context: __SerdeContext): ScalingActivity => { @@ -1672,7 +1751,14 @@ const deserializeAws_json1_1ScalingActivity = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ScalingPolicies = (output: any, context: __SerdeContext): ScalingPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScalingPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScalingPolicy(entry, context); + }); }; const deserializeAws_json1_1ScalingPolicy = (output: any, context: __SerdeContext): ScalingPolicy => { @@ -1746,7 +1832,14 @@ const deserializeAws_json1_1ScheduledAction = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ScheduledActions = (output: any, context: __SerdeContext): ScheduledAction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScheduledAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScheduledAction(entry, context); + }); }; const deserializeAws_json1_1StepAdjustment = (output: any, context: __SerdeContext): StepAdjustment => { @@ -1767,7 +1860,14 @@ const deserializeAws_json1_1StepAdjustment = (output: any, context: __SerdeConte }; const deserializeAws_json1_1StepAdjustments = (output: any, context: __SerdeContext): StepAdjustment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StepAdjustment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StepAdjustment(entry, context); + }); }; const deserializeAws_json1_1StepScalingPolicyConfiguration = ( @@ -1889,3 +1989,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-application-discovery-service/protocols/Aws_json1_1.ts b/clients/client-application-discovery-service/protocols/Aws_json1_1.ts index cf2878ce3683..94516eea549f 100644 --- a/clients/client-application-discovery-service/protocols/Aws_json1_1.ts +++ b/clients/client-application-discovery-service/protocols/Aws_json1_1.ts @@ -162,7 +162,7 @@ export const serializeAws_json1_1AssociateConfigurationItemsToApplicationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.AssociateConfigurationItemsToApplication", }; let body: any; @@ -175,7 +175,7 @@ export const serializeAws_json1_1BatchDeleteImportDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.BatchDeleteImportData", }; let body: any; @@ -188,7 +188,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.CreateApplication", }; let body: any; @@ -201,7 +201,7 @@ export const serializeAws_json1_1CreateTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.CreateTags", }; let body: any; @@ -214,7 +214,7 @@ export const serializeAws_json1_1DeleteApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DeleteApplications", }; let body: any; @@ -227,7 +227,7 @@ export const serializeAws_json1_1DeleteTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DeleteTags", }; let body: any; @@ -240,7 +240,7 @@ export const serializeAws_json1_1DescribeAgentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DescribeAgents", }; let body: any; @@ -253,7 +253,7 @@ export const serializeAws_json1_1DescribeConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DescribeConfigurations", }; let body: any; @@ -266,7 +266,7 @@ export const serializeAws_json1_1DescribeContinuousExportsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DescribeContinuousExports", }; let body: any; @@ -279,7 +279,7 @@ export const serializeAws_json1_1DescribeExportConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DescribeExportConfigurations", }; let body: any; @@ -292,7 +292,7 @@ export const serializeAws_json1_1DescribeExportTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DescribeExportTasks", }; let body: any; @@ -305,7 +305,7 @@ export const serializeAws_json1_1DescribeImportTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DescribeImportTasks", }; let body: any; @@ -318,7 +318,7 @@ export const serializeAws_json1_1DescribeTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DescribeTags", }; let body: any; @@ -331,7 +331,7 @@ export const serializeAws_json1_1DisassociateConfigurationItemsFromApplicationCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.DisassociateConfigurationItemsFromApplication", }; let body: any; @@ -344,7 +344,7 @@ export const serializeAws_json1_1ExportConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.ExportConfigurations", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -355,7 +355,7 @@ export const serializeAws_json1_1GetDiscoverySummaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.GetDiscoverySummary", }; let body: any; @@ -368,7 +368,7 @@ export const serializeAws_json1_1ListConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.ListConfigurations", }; let body: any; @@ -381,7 +381,7 @@ export const serializeAws_json1_1ListServerNeighborsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.ListServerNeighbors", }; let body: any; @@ -394,7 +394,7 @@ export const serializeAws_json1_1StartContinuousExportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.StartContinuousExport", }; let body: any; @@ -407,7 +407,7 @@ export const serializeAws_json1_1StartDataCollectionByAgentIdsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.StartDataCollectionByAgentIds", }; let body: any; @@ -420,7 +420,7 @@ export const serializeAws_json1_1StartExportTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.StartExportTask", }; let body: any; @@ -433,7 +433,7 @@ export const serializeAws_json1_1StartImportTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.StartImportTask", }; let body: any; @@ -446,7 +446,7 @@ export const serializeAws_json1_1StopContinuousExportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.StopContinuousExport", }; let body: any; @@ -459,7 +459,7 @@ export const serializeAws_json1_1StopDataCollectionByAgentIdsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.StopDataCollectionByAgentIds", }; let body: any; @@ -472,7 +472,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPoseidonService_V2015_11_01.UpdateApplication", }; let body: any; @@ -507,8 +507,7 @@ const deserializeAws_json1_1AssociateConfigurationItemsToApplicationCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -594,8 +593,7 @@ const deserializeAws_json1_1BatchDeleteImportDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -681,8 +679,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -768,8 +765,7 @@ const deserializeAws_json1_1CreateTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -863,8 +859,7 @@ const deserializeAws_json1_1DeleteApplicationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -950,8 +945,7 @@ const deserializeAws_json1_1DeleteTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1045,8 +1039,7 @@ const deserializeAws_json1_1DescribeAgentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1132,8 +1125,7 @@ const deserializeAws_json1_1DescribeConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1219,8 +1211,7 @@ const deserializeAws_json1_1DescribeContinuousExportsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1322,8 +1313,7 @@ const deserializeAws_json1_1DescribeExportConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1417,8 +1407,7 @@ const deserializeAws_json1_1DescribeExportTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1504,8 +1493,7 @@ const deserializeAws_json1_1DescribeImportTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1591,8 +1579,7 @@ const deserializeAws_json1_1DescribeTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1686,8 +1673,7 @@ const deserializeAws_json1_1DisassociateConfigurationItemsFromApplicationCommand }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1773,8 +1759,7 @@ const deserializeAws_json1_1ExportConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1868,8 +1853,7 @@ const deserializeAws_json1_1GetDiscoverySummaryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -1955,8 +1939,7 @@ const deserializeAws_json1_1ListConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -2050,8 +2033,7 @@ const deserializeAws_json1_1ListServerNeighborsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -2137,8 +2119,7 @@ const deserializeAws_json1_1StartContinuousExportCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -2248,8 +2229,7 @@ const deserializeAws_json1_1StartDataCollectionByAgentIdsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -2335,8 +2315,7 @@ const deserializeAws_json1_1StartExportTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -2430,8 +2409,7 @@ const deserializeAws_json1_1StartImportTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -2525,8 +2503,7 @@ const deserializeAws_json1_1StopContinuousExportCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -2636,8 +2613,7 @@ const deserializeAws_json1_1StopDataCollectionByAgentIdsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -2723,8 +2699,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorizationErrorException": case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": @@ -2919,11 +2894,25 @@ const deserializeAws_json1_1ServerInternalErrorExceptionResponse = async ( }; const serializeAws_json1_1AgentIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ApplicationIdsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssociateConfigurationItemsToApplicationRequest = ( @@ -2931,12 +2920,12 @@ const serializeAws_json1_1AssociateConfigurationItemsToApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.applicationConfigurationId !== undefined && { - applicationConfigurationId: input.applicationConfigurationId, - }), - ...(input.configurationIds !== undefined && { - configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), - }), + ...(input.applicationConfigurationId !== undefined && + input.applicationConfigurationId !== null && { applicationConfigurationId: input.applicationConfigurationId }), + ...(input.configurationIds !== undefined && + input.configurationIds !== null && { + configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), + }), }; }; @@ -2945,18 +2934,33 @@ const serializeAws_json1_1BatchDeleteImportDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.importTaskIds !== undefined && { - importTaskIds: serializeAws_json1_1ToDeleteIdentifierList(input.importTaskIds, context), - }), + ...(input.importTaskIds !== undefined && + input.importTaskIds !== null && { + importTaskIds: serializeAws_json1_1ToDeleteIdentifierList(input.importTaskIds, context), + }), }; }; const serializeAws_json1_1ConfigurationIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ContinuousExportIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateApplicationRequest = ( @@ -2964,17 +2968,18 @@ const serializeAws_json1_1CreateApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1CreateTagsRequest = (input: CreateTagsRequest, context: __SerdeContext): any => { return { - ...(input.configurationIds !== undefined && { - configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagSet(input.tags, context) }), + ...(input.configurationIds !== undefined && + input.configurationIds !== null && { + configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagSet(input.tags, context) }), }; }; @@ -2983,27 +2988,31 @@ const serializeAws_json1_1DeleteApplicationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.configurationIds !== undefined && { - configurationIds: serializeAws_json1_1ApplicationIdsList(input.configurationIds, context), - }), + ...(input.configurationIds !== undefined && + input.configurationIds !== null && { + configurationIds: serializeAws_json1_1ApplicationIdsList(input.configurationIds, context), + }), }; }; const serializeAws_json1_1DeleteTagsRequest = (input: DeleteTagsRequest, context: __SerdeContext): any => { return { - ...(input.configurationIds !== undefined && { - configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagSet(input.tags, context) }), + ...(input.configurationIds !== undefined && + input.configurationIds !== null && { + configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagSet(input.tags, context) }), }; }; const serializeAws_json1_1DescribeAgentsRequest = (input: DescribeAgentsRequest, context: __SerdeContext): any => { return { - ...(input.agentIds !== undefined && { agentIds: serializeAws_json1_1AgentIds(input.agentIds, context) }), - ...(input.filters !== undefined && { filters: serializeAws_json1_1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.agentIds !== undefined && + input.agentIds !== null && { agentIds: serializeAws_json1_1AgentIds(input.agentIds, context) }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -3012,9 +3021,10 @@ const serializeAws_json1_1DescribeConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.configurationIds !== undefined && { - configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), - }), + ...(input.configurationIds !== undefined && + input.configurationIds !== null && { + configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), + }), }; }; @@ -3023,11 +3033,10 @@ const serializeAws_json1_1DescribeContinuousExportsRequest = ( context: __SerdeContext ): any => { return { - ...(input.exportIds !== undefined && { - exportIds: serializeAws_json1_1ContinuousExportIds(input.exportIds, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.exportIds !== undefined && + input.exportIds !== null && { exportIds: serializeAws_json1_1ContinuousExportIds(input.exportIds, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -3036,9 +3045,10 @@ const serializeAws_json1_1DescribeExportConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.exportIds !== undefined && { exportIds: serializeAws_json1_1ExportIds(input.exportIds, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.exportIds !== undefined && + input.exportIds !== null && { exportIds: serializeAws_json1_1ExportIds(input.exportIds, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -3047,15 +3057,24 @@ const serializeAws_json1_1DescribeExportTasksRequest = ( context: __SerdeContext ): any => { return { - ...(input.exportIds !== undefined && { exportIds: serializeAws_json1_1ExportIds(input.exportIds, context) }), - ...(input.filters !== undefined && { filters: serializeAws_json1_1ExportFilters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.exportIds !== undefined && + input.exportIds !== null && { exportIds: serializeAws_json1_1ExportIds(input.exportIds, context) }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1ExportFilters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1DescribeImportTasksFilterList = (input: ImportTaskFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ImportTaskFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ImportTaskFilter(entry, context); + }); }; const serializeAws_json1_1DescribeImportTasksRequest = ( @@ -3063,19 +3082,19 @@ const serializeAws_json1_1DescribeImportTasksRequest = ( context: __SerdeContext ): any => { return { - ...(input.filters !== undefined && { - filters: serializeAws_json1_1DescribeImportTasksFilterList(input.filters, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1DescribeImportTasksFilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1DescribeTagsRequest = (input: DescribeTagsRequest, context: __SerdeContext): any => { return { - ...(input.filters !== undefined && { filters: serializeAws_json1_1TagFilters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1TagFilters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -3084,49 +3103,86 @@ const serializeAws_json1_1DisassociateConfigurationItemsFromApplicationRequest = context: __SerdeContext ): any => { return { - ...(input.applicationConfigurationId !== undefined && { - applicationConfigurationId: input.applicationConfigurationId, - }), - ...(input.configurationIds !== undefined && { - configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), - }), + ...(input.applicationConfigurationId !== undefined && + input.applicationConfigurationId !== null && { applicationConfigurationId: input.applicationConfigurationId }), + ...(input.configurationIds !== undefined && + input.configurationIds !== null && { + configurationIds: serializeAws_json1_1ConfigurationIdList(input.configurationIds, context), + }), }; }; const serializeAws_json1_1ExportDataFormats = (input: (ExportDataFormat | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ExportFilter = (input: ExportFilter, context: __SerdeContext): any => { return { - ...(input.condition !== undefined && { condition: input.condition }), - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_json1_1FilterValues(input.values, context) }), + ...(input.condition !== undefined && input.condition !== null && { condition: input.condition }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_1FilterValues(input.values, context) }), }; }; const serializeAws_json1_1ExportFilters = (input: ExportFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ExportFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ExportFilter(entry, context); + }); }; const serializeAws_json1_1ExportIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.condition !== undefined && { condition: input.condition }), - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_json1_1FilterValues(input.values, context) }), + ...(input.condition !== undefined && input.condition !== null && { condition: input.condition }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_1FilterValues(input.values, context) }), }; }; const serializeAws_json1_1Filters = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1FilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetDiscoverySummaryRequest = ( @@ -3138,13 +3194,21 @@ const serializeAws_json1_1GetDiscoverySummaryRequest = ( const serializeAws_json1_1ImportTaskFilter = (input: ImportTaskFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_json1_1ImportTaskFilterValueList(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_1ImportTaskFilterValueList(input.values, context) }), }; }; const serializeAws_json1_1ImportTaskFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListConfigurationsRequest = ( @@ -3152,11 +3216,14 @@ const serializeAws_json1_1ListConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.configurationType !== undefined && { configurationType: input.configurationType }), - ...(input.filters !== undefined && { filters: serializeAws_json1_1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.orderBy !== undefined && { orderBy: serializeAws_json1_1OrderByList(input.orderBy, context) }), + ...(input.configurationType !== undefined && + input.configurationType !== null && { configurationType: input.configurationType }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.orderBy !== undefined && + input.orderBy !== null && { orderBy: serializeAws_json1_1OrderByList(input.orderBy, context) }), }; }; @@ -3165,25 +3232,35 @@ const serializeAws_json1_1ListServerNeighborsRequest = ( context: __SerdeContext ): any => { return { - ...(input.configurationId !== undefined && { configurationId: input.configurationId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.neighborConfigurationIds !== undefined && { - neighborConfigurationIds: serializeAws_json1_1ConfigurationIdList(input.neighborConfigurationIds, context), - }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.portInformationNeeded !== undefined && { portInformationNeeded: input.portInformationNeeded }), + ...(input.configurationId !== undefined && + input.configurationId !== null && { configurationId: input.configurationId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.neighborConfigurationIds !== undefined && + input.neighborConfigurationIds !== null && { + neighborConfigurationIds: serializeAws_json1_1ConfigurationIdList(input.neighborConfigurationIds, context), + }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.portInformationNeeded !== undefined && + input.portInformationNeeded !== null && { portInformationNeeded: input.portInformationNeeded }), }; }; const serializeAws_json1_1OrderByElement = (input: OrderByElement, context: __SerdeContext): any => { return { - ...(input.fieldName !== undefined && { fieldName: input.fieldName }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.fieldName !== undefined && input.fieldName !== null && { fieldName: input.fieldName }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; const serializeAws_json1_1OrderByList = (input: OrderByElement[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OrderByElement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OrderByElement(entry, context); + }); }; const serializeAws_json1_1StartContinuousExportRequest = ( @@ -3198,26 +3275,31 @@ const serializeAws_json1_1StartDataCollectionByAgentIdsRequest = ( context: __SerdeContext ): any => { return { - ...(input.agentIds !== undefined && { agentIds: serializeAws_json1_1AgentIds(input.agentIds, context) }), + ...(input.agentIds !== undefined && + input.agentIds !== null && { agentIds: serializeAws_json1_1AgentIds(input.agentIds, context) }), }; }; const serializeAws_json1_1StartExportTaskRequest = (input: StartExportTaskRequest, context: __SerdeContext): any => { return { - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.exportDataFormat !== undefined && { - exportDataFormat: serializeAws_json1_1ExportDataFormats(input.exportDataFormat, context), - }), - ...(input.filters !== undefined && { filters: serializeAws_json1_1ExportFilters(input.filters, context) }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.exportDataFormat !== undefined && + input.exportDataFormat !== null && { + exportDataFormat: serializeAws_json1_1ExportDataFormats(input.exportDataFormat, context), + }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1ExportFilters(input.filters, context) }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), }; }; const serializeAws_json1_1StartImportTaskRequest = (input: StartImportTaskRequest, context: __SerdeContext): any => { return { clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.importUrl !== undefined && { importUrl: input.importUrl }), - ...(input.name !== undefined && { name: input.name }), + ...(input.importUrl !== undefined && input.importUrl !== null && { importUrl: input.importUrl }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -3226,7 +3308,7 @@ const serializeAws_json1_1StopContinuousExportRequest = ( context: __SerdeContext ): any => { return { - ...(input.exportId !== undefined && { exportId: input.exportId }), + ...(input.exportId !== undefined && input.exportId !== null && { exportId: input.exportId }), }; }; @@ -3235,34 +3317,57 @@ const serializeAws_json1_1StopDataCollectionByAgentIdsRequest = ( context: __SerdeContext ): any => { return { - ...(input.agentIds !== undefined && { agentIds: serializeAws_json1_1AgentIds(input.agentIds, context) }), + ...(input.agentIds !== undefined && + input.agentIds !== null && { agentIds: serializeAws_json1_1AgentIds(input.agentIds, context) }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1TagFilter = (input: TagFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_json1_1FilterValues(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_1FilterValues(input.values, context) }), }; }; const serializeAws_json1_1TagFilters = (input: TagFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TagFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TagFilter(entry, context); + }); }; const serializeAws_json1_1TagSet = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1ToDeleteIdentifierList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UpdateApplicationRequest = ( @@ -3270,9 +3375,10 @@ const serializeAws_json1_1UpdateApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.configurationId !== undefined && { configurationId: input.configurationId }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), + ...(input.configurationId !== undefined && + input.configurationId !== null && { configurationId: input.configurationId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -3294,7 +3400,14 @@ const deserializeAws_json1_1AgentConfigurationStatusList = ( output: any, context: __SerdeContext ): AgentConfigurationStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AgentConfigurationStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AgentConfigurationStatus(entry, context); + }); }; const deserializeAws_json1_1AgentInfo = (output: any, context: __SerdeContext): AgentInfo => { @@ -3328,11 +3441,25 @@ const deserializeAws_json1_1AgentNetworkInfo = (output: any, context: __SerdeCon }; const deserializeAws_json1_1AgentNetworkInfoList = (output: any, context: __SerdeContext): AgentNetworkInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AgentNetworkInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AgentNetworkInfo(entry, context); + }); }; const deserializeAws_json1_1AgentsInfo = (output: any, context: __SerdeContext): AgentInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AgentInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AgentInfo(entry, context); + }); }; const deserializeAws_json1_1AssociateConfigurationItemsToApplicationResponse = ( @@ -3367,7 +3494,14 @@ const deserializeAws_json1_1BatchDeleteImportDataErrorList = ( output: any, context: __SerdeContext ): BatchDeleteImportDataError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchDeleteImportDataError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchDeleteImportDataError(entry, context); + }); }; const deserializeAws_json1_1BatchDeleteImportDataResponse = ( @@ -3383,17 +3517,26 @@ const deserializeAws_json1_1BatchDeleteImportDataResponse = ( }; const deserializeAws_json1_1Configuration = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Configurations = (output: any, context: __SerdeContext): { [key: string]: string }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Configuration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Configuration(entry, context); + }); }; const deserializeAws_json1_1ConfigurationTag = (output: any, context: __SerdeContext): ConfigurationTag => { @@ -3414,7 +3557,14 @@ const deserializeAws_json1_1ConfigurationTag = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ConfigurationTagSet = (output: any, context: __SerdeContext): ConfigurationTag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfigurationTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfigurationTag(entry, context); + }); }; const deserializeAws_json1_1ConflictErrorException = (output: any, context: __SerdeContext): ConflictErrorException => { @@ -3452,7 +3602,14 @@ const deserializeAws_json1_1ContinuousExportDescriptions = ( output: any, context: __SerdeContext ): ContinuousExportDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContinuousExportDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContinuousExportDescription(entry, context); + }); }; const deserializeAws_json1_1CreateApplicationResponse = ( @@ -3542,20 +3699,29 @@ const deserializeAws_json1_1DescribeConfigurationsAttribute = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1DescribeConfigurationsAttributes = ( output: any, context: __SerdeContext ): { [key: string]: string }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DescribeConfigurationsAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DescribeConfigurationsAttribute(entry, context); + }); }; const deserializeAws_json1_1DescribeConfigurationsResponse = ( @@ -3675,7 +3841,14 @@ const deserializeAws_json1_1ExportInfo = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ExportsInfo = (output: any, context: __SerdeContext): ExportInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExportInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExportInfo(entry, context); + }); }; const deserializeAws_json1_1GetDiscoverySummaryResponse = ( @@ -3759,7 +3932,14 @@ const deserializeAws_json1_1ImportTask = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ImportTaskList = (output: any, context: __SerdeContext): ImportTask[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImportTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImportTask(entry, context); + }); }; const deserializeAws_json1_1InvalidParameterException = ( @@ -3836,7 +4016,14 @@ const deserializeAws_json1_1NeighborDetailsList = ( output: any, context: __SerdeContext ): NeighborConnectionDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NeighborConnectionDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NeighborConnectionDetail(entry, context); + }); }; const deserializeAws_json1_1OperationNotPermittedException = ( @@ -3864,13 +4051,15 @@ const deserializeAws_json1_1ResourceNotFoundException = ( }; const deserializeAws_json1_1SchemaStorageConfig = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ServerInternalErrorException = ( @@ -4019,3 +4208,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-application-insights/protocols/Aws_json1_1.ts b/clients/client-application-insights/protocols/Aws_json1_1.ts index b398ac21b400..23030bf46be8 100644 --- a/clients/client-application-insights/protocols/Aws_json1_1.ts +++ b/clients/client-application-insights/protocols/Aws_json1_1.ts @@ -139,7 +139,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.CreateApplication", }; let body: any; @@ -152,7 +152,7 @@ export const serializeAws_json1_1CreateComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.CreateComponent", }; let body: any; @@ -165,7 +165,7 @@ export const serializeAws_json1_1CreateLogPatternCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.CreateLogPattern", }; let body: any; @@ -178,7 +178,7 @@ export const serializeAws_json1_1DeleteApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DeleteApplication", }; let body: any; @@ -191,7 +191,7 @@ export const serializeAws_json1_1DeleteComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DeleteComponent", }; let body: any; @@ -204,7 +204,7 @@ export const serializeAws_json1_1DeleteLogPatternCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DeleteLogPattern", }; let body: any; @@ -217,7 +217,7 @@ export const serializeAws_json1_1DescribeApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DescribeApplication", }; let body: any; @@ -230,7 +230,7 @@ export const serializeAws_json1_1DescribeComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DescribeComponent", }; let body: any; @@ -243,7 +243,7 @@ export const serializeAws_json1_1DescribeComponentConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DescribeComponentConfiguration", }; let body: any; @@ -256,7 +256,7 @@ export const serializeAws_json1_1DescribeComponentConfigurationRecommendationCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DescribeComponentConfigurationRecommendation", }; let body: any; @@ -269,7 +269,7 @@ export const serializeAws_json1_1DescribeLogPatternCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DescribeLogPattern", }; let body: any; @@ -282,7 +282,7 @@ export const serializeAws_json1_1DescribeObservationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DescribeObservation", }; let body: any; @@ -295,7 +295,7 @@ export const serializeAws_json1_1DescribeProblemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DescribeProblem", }; let body: any; @@ -308,7 +308,7 @@ export const serializeAws_json1_1DescribeProblemObservationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.DescribeProblemObservations", }; let body: any; @@ -321,7 +321,7 @@ export const serializeAws_json1_1ListApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.ListApplications", }; let body: any; @@ -334,7 +334,7 @@ export const serializeAws_json1_1ListComponentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.ListComponents", }; let body: any; @@ -347,7 +347,7 @@ export const serializeAws_json1_1ListConfigurationHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.ListConfigurationHistory", }; let body: any; @@ -360,7 +360,7 @@ export const serializeAws_json1_1ListLogPatternsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.ListLogPatterns", }; let body: any; @@ -373,7 +373,7 @@ export const serializeAws_json1_1ListLogPatternSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.ListLogPatternSets", }; let body: any; @@ -386,7 +386,7 @@ export const serializeAws_json1_1ListProblemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.ListProblems", }; let body: any; @@ -399,7 +399,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.ListTagsForResource", }; let body: any; @@ -412,7 +412,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.TagResource", }; let body: any; @@ -425,7 +425,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.UntagResource", }; let body: any; @@ -438,7 +438,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.UpdateApplication", }; let body: any; @@ -451,7 +451,7 @@ export const serializeAws_json1_1UpdateComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.UpdateComponent", }; let body: any; @@ -464,7 +464,7 @@ export const serializeAws_json1_1UpdateComponentConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.UpdateComponentConfiguration", }; let body: any; @@ -477,7 +477,7 @@ export const serializeAws_json1_1UpdateLogPatternCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "EC2WindowsBarleyService.UpdateLogPattern", }; let body: any; @@ -512,8 +512,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.applicationinsights#AccessDeniedException": @@ -607,8 +606,7 @@ const deserializeAws_json1_1CreateComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -686,8 +684,7 @@ const deserializeAws_json1_1CreateLogPatternCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -765,8 +762,7 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.applicationinsights#BadRequestException": @@ -844,8 +840,7 @@ const deserializeAws_json1_1DeleteComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -915,8 +910,7 @@ const deserializeAws_json1_1DeleteLogPatternCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.applicationinsights#BadRequestException": @@ -994,8 +988,7 @@ const deserializeAws_json1_1DescribeApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1065,8 +1058,7 @@ const deserializeAws_json1_1DescribeComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1136,8 +1128,7 @@ const deserializeAws_json1_1DescribeComponentConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1207,8 +1198,7 @@ const deserializeAws_json1_1DescribeComponentConfigurationRecommendationCommandE }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1278,8 +1268,7 @@ const deserializeAws_json1_1DescribeLogPatternCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1349,8 +1338,7 @@ const deserializeAws_json1_1DescribeObservationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1420,8 +1408,7 @@ const deserializeAws_json1_1DescribeProblemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1491,8 +1478,7 @@ const deserializeAws_json1_1DescribeProblemObservationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1562,8 +1548,7 @@ const deserializeAws_json1_1ListApplicationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1625,8 +1610,7 @@ const deserializeAws_json1_1ListComponentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1696,8 +1680,7 @@ const deserializeAws_json1_1ListConfigurationHistoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1767,8 +1750,7 @@ const deserializeAws_json1_1ListLogPatternsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1838,8 +1820,7 @@ const deserializeAws_json1_1ListLogPatternSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1909,8 +1890,7 @@ const deserializeAws_json1_1ListProblemsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -1980,8 +1960,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.applicationinsights#ResourceNotFoundException": @@ -2043,8 +2022,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.applicationinsights#ResourceNotFoundException": @@ -2114,8 +2092,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.applicationinsights#ResourceNotFoundException": @@ -2177,8 +2154,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -2248,8 +2224,7 @@ const deserializeAws_json1_1UpdateComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -2327,8 +2302,7 @@ const deserializeAws_json1_1UpdateComponentConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -2398,8 +2372,7 @@ const deserializeAws_json1_1UpdateLogPatternCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": @@ -2575,31 +2548,37 @@ const serializeAws_json1_1CreateApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.CWEMonitorEnabled !== undefined && { CWEMonitorEnabled: input.CWEMonitorEnabled }), - ...(input.OpsCenterEnabled !== undefined && { OpsCenterEnabled: input.OpsCenterEnabled }), - ...(input.OpsItemSNSTopicArn !== undefined && { OpsItemSNSTopicArn: input.OpsItemSNSTopicArn }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CWEMonitorEnabled !== undefined && + input.CWEMonitorEnabled !== null && { CWEMonitorEnabled: input.CWEMonitorEnabled }), + ...(input.OpsCenterEnabled !== undefined && + input.OpsCenterEnabled !== null && { OpsCenterEnabled: input.OpsCenterEnabled }), + ...(input.OpsItemSNSTopicArn !== undefined && + input.OpsItemSNSTopicArn !== null && { OpsItemSNSTopicArn: input.OpsItemSNSTopicArn }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateComponentRequest = (input: CreateComponentRequest, context: __SerdeContext): any => { return { - ...(input.ComponentName !== undefined && { ComponentName: input.ComponentName }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), - ...(input.ResourceList !== undefined && { - ResourceList: serializeAws_json1_1ResourceList(input.ResourceList, context), - }), + ...(input.ComponentName !== undefined && input.ComponentName !== null && { ComponentName: input.ComponentName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), + ...(input.ResourceList !== undefined && + input.ResourceList !== null && { ResourceList: serializeAws_json1_1ResourceList(input.ResourceList, context) }), }; }; const serializeAws_json1_1CreateLogPatternRequest = (input: CreateLogPatternRequest, context: __SerdeContext): any => { return { - ...(input.Pattern !== undefined && { Pattern: input.Pattern }), - ...(input.PatternName !== undefined && { PatternName: input.PatternName }), - ...(input.PatternSetName !== undefined && { PatternSetName: input.PatternSetName }), - ...(input.Rank !== undefined && { Rank: input.Rank }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.Pattern !== undefined && input.Pattern !== null && { Pattern: input.Pattern }), + ...(input.PatternName !== undefined && input.PatternName !== null && { PatternName: input.PatternName }), + ...(input.PatternSetName !== undefined && + input.PatternSetName !== null && { PatternSetName: input.PatternSetName }), + ...(input.Rank !== undefined && input.Rank !== null && { Rank: input.Rank }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; @@ -2608,22 +2587,26 @@ const serializeAws_json1_1DeleteApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; const serializeAws_json1_1DeleteComponentRequest = (input: DeleteComponentRequest, context: __SerdeContext): any => { return { - ...(input.ComponentName !== undefined && { ComponentName: input.ComponentName }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.ComponentName !== undefined && input.ComponentName !== null && { ComponentName: input.ComponentName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; const serializeAws_json1_1DeleteLogPatternRequest = (input: DeleteLogPatternRequest, context: __SerdeContext): any => { return { - ...(input.PatternName !== undefined && { PatternName: input.PatternName }), - ...(input.PatternSetName !== undefined && { PatternSetName: input.PatternSetName }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.PatternName !== undefined && input.PatternName !== null && { PatternName: input.PatternName }), + ...(input.PatternSetName !== undefined && + input.PatternSetName !== null && { PatternSetName: input.PatternSetName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; @@ -2632,7 +2615,8 @@ const serializeAws_json1_1DescribeApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; @@ -2641,9 +2625,10 @@ const serializeAws_json1_1DescribeComponentConfigurationRecommendationRequest = context: __SerdeContext ): any => { return { - ...(input.ComponentName !== undefined && { ComponentName: input.ComponentName }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), - ...(input.Tier !== undefined && { Tier: input.Tier }), + ...(input.ComponentName !== undefined && input.ComponentName !== null && { ComponentName: input.ComponentName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), + ...(input.Tier !== undefined && input.Tier !== null && { Tier: input.Tier }), }; }; @@ -2652,8 +2637,9 @@ const serializeAws_json1_1DescribeComponentConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ComponentName !== undefined && { ComponentName: input.ComponentName }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.ComponentName !== undefined && input.ComponentName !== null && { ComponentName: input.ComponentName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; @@ -2662,8 +2648,9 @@ const serializeAws_json1_1DescribeComponentRequest = ( context: __SerdeContext ): any => { return { - ...(input.ComponentName !== undefined && { ComponentName: input.ComponentName }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.ComponentName !== undefined && input.ComponentName !== null && { ComponentName: input.ComponentName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; @@ -2672,9 +2659,11 @@ const serializeAws_json1_1DescribeLogPatternRequest = ( context: __SerdeContext ): any => { return { - ...(input.PatternName !== undefined && { PatternName: input.PatternName }), - ...(input.PatternSetName !== undefined && { PatternSetName: input.PatternSetName }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.PatternName !== undefined && input.PatternName !== null && { PatternName: input.PatternName }), + ...(input.PatternSetName !== undefined && + input.PatternSetName !== null && { PatternSetName: input.PatternSetName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; @@ -2683,7 +2672,7 @@ const serializeAws_json1_1DescribeObservationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ObservationId !== undefined && { ObservationId: input.ObservationId }), + ...(input.ObservationId !== undefined && input.ObservationId !== null && { ObservationId: input.ObservationId }), }; }; @@ -2692,28 +2681,29 @@ const serializeAws_json1_1DescribeProblemObservationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProblemId !== undefined && { ProblemId: input.ProblemId }), + ...(input.ProblemId !== undefined && input.ProblemId !== null && { ProblemId: input.ProblemId }), }; }; const serializeAws_json1_1DescribeProblemRequest = (input: DescribeProblemRequest, context: __SerdeContext): any => { return { - ...(input.ProblemId !== undefined && { ProblemId: input.ProblemId }), + ...(input.ProblemId !== undefined && input.ProblemId !== null && { ProblemId: input.ProblemId }), }; }; const serializeAws_json1_1ListApplicationsRequest = (input: ListApplicationsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListComponentsRequest = (input: ListComponentsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; @@ -2722,12 +2712,15 @@ const serializeAws_json1_1ListConfigurationHistoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.EventStatus !== undefined && { EventStatus: input.EventStatus }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.EventStatus !== undefined && input.EventStatus !== null && { EventStatus: input.EventStatus }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; @@ -2736,28 +2729,34 @@ const serializeAws_json1_1ListLogPatternSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; const serializeAws_json1_1ListLogPatternsRequest = (input: ListLogPatternsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PatternSetName !== undefined && { PatternSetName: input.PatternSetName }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PatternSetName !== undefined && + input.PatternSetName !== null && { PatternSetName: input.PatternSetName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; const serializeAws_json1_1ListProblemsRequest = (input: ListProblemsRequest, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; @@ -2766,40 +2765,62 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1ResourceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -2808,11 +2829,16 @@ const serializeAws_json1_1UpdateApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.CWEMonitorEnabled !== undefined && { CWEMonitorEnabled: input.CWEMonitorEnabled }), - ...(input.OpsCenterEnabled !== undefined && { OpsCenterEnabled: input.OpsCenterEnabled }), - ...(input.OpsItemSNSTopicArn !== undefined && { OpsItemSNSTopicArn: input.OpsItemSNSTopicArn }), - ...(input.RemoveSNSTopic !== undefined && { RemoveSNSTopic: input.RemoveSNSTopic }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.CWEMonitorEnabled !== undefined && + input.CWEMonitorEnabled !== null && { CWEMonitorEnabled: input.CWEMonitorEnabled }), + ...(input.OpsCenterEnabled !== undefined && + input.OpsCenterEnabled !== null && { OpsCenterEnabled: input.OpsCenterEnabled }), + ...(input.OpsItemSNSTopicArn !== undefined && + input.OpsItemSNSTopicArn !== null && { OpsItemSNSTopicArn: input.OpsItemSNSTopicArn }), + ...(input.RemoveSNSTopic !== undefined && + input.RemoveSNSTopic !== null && { RemoveSNSTopic: input.RemoveSNSTopic }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; @@ -2821,32 +2847,37 @@ const serializeAws_json1_1UpdateComponentConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ComponentConfiguration !== undefined && { ComponentConfiguration: input.ComponentConfiguration }), - ...(input.ComponentName !== undefined && { ComponentName: input.ComponentName }), - ...(input.Monitor !== undefined && { Monitor: input.Monitor }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), - ...(input.Tier !== undefined && { Tier: input.Tier }), + ...(input.ComponentConfiguration !== undefined && + input.ComponentConfiguration !== null && { ComponentConfiguration: input.ComponentConfiguration }), + ...(input.ComponentName !== undefined && input.ComponentName !== null && { ComponentName: input.ComponentName }), + ...(input.Monitor !== undefined && input.Monitor !== null && { Monitor: input.Monitor }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), + ...(input.Tier !== undefined && input.Tier !== null && { Tier: input.Tier }), }; }; const serializeAws_json1_1UpdateComponentRequest = (input: UpdateComponentRequest, context: __SerdeContext): any => { return { - ...(input.ComponentName !== undefined && { ComponentName: input.ComponentName }), - ...(input.NewComponentName !== undefined && { NewComponentName: input.NewComponentName }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), - ...(input.ResourceList !== undefined && { - ResourceList: serializeAws_json1_1ResourceList(input.ResourceList, context), - }), + ...(input.ComponentName !== undefined && input.ComponentName !== null && { ComponentName: input.ComponentName }), + ...(input.NewComponentName !== undefined && + input.NewComponentName !== null && { NewComponentName: input.NewComponentName }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), + ...(input.ResourceList !== undefined && + input.ResourceList !== null && { ResourceList: serializeAws_json1_1ResourceList(input.ResourceList, context) }), }; }; const serializeAws_json1_1UpdateLogPatternRequest = (input: UpdateLogPatternRequest, context: __SerdeContext): any => { return { - ...(input.Pattern !== undefined && { Pattern: input.Pattern }), - ...(input.PatternName !== undefined && { PatternName: input.PatternName }), - ...(input.PatternSetName !== undefined && { PatternSetName: input.PatternSetName }), - ...(input.Rank !== undefined && { Rank: input.Rank }), - ...(input.ResourceGroupName !== undefined && { ResourceGroupName: input.ResourceGroupName }), + ...(input.Pattern !== undefined && input.Pattern !== null && { Pattern: input.Pattern }), + ...(input.PatternName !== undefined && input.PatternName !== null && { PatternName: input.PatternName }), + ...(input.PatternSetName !== undefined && + input.PatternSetName !== null && { PatternSetName: input.PatternSetName }), + ...(input.Rank !== undefined && input.Rank !== null && { Rank: input.Rank }), + ...(input.ResourceGroupName !== undefined && + input.ResourceGroupName !== null && { ResourceGroupName: input.ResourceGroupName }), }; }; @@ -2877,7 +2908,14 @@ const deserializeAws_json1_1ApplicationComponentList = ( output: any, context: __SerdeContext ): ApplicationComponent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ApplicationComponent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ApplicationComponent(entry, context); + }); }; const deserializeAws_json1_1ApplicationInfo = (output: any, context: __SerdeContext): ApplicationInfo => { @@ -2902,7 +2940,14 @@ const deserializeAws_json1_1ApplicationInfo = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ApplicationInfoList = (output: any, context: __SerdeContext): ApplicationInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ApplicationInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ApplicationInfo(entry, context); + }); }; const deserializeAws_json1_1BadRequestException = (output: any, context: __SerdeContext): BadRequestException => { @@ -2935,7 +2980,14 @@ const deserializeAws_json1_1ConfigurationEvent = (output: any, context: __SerdeC }; const deserializeAws_json1_1ConfigurationEventList = (output: any, context: __SerdeContext): ConfigurationEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfigurationEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfigurationEvent(entry, context); + }); }; const deserializeAws_json1_1CreateApplicationResponse = ( @@ -3105,10 +3157,15 @@ const deserializeAws_json1_1DetectedWorkload = ( context: __SerdeContext ): { [key: string]: { [key: string]: string } } => { return Object.entries(output).reduce( - (acc: { [key: string]: { [key: string]: string } }, [key, value]: [Tier | string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_1WorkloadMetaData(value, context), - }), + (acc: { [key: string]: { [key: string]: string } }, [key, value]: [Tier | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_1WorkloadMetaData(value, context), + }; + }, {} ); }; @@ -3118,10 +3175,15 @@ const deserializeAws_json1_1Feedback = ( context: __SerdeContext ): { [key: string]: FeedbackValue | string } => { return Object.entries(output).reduce( - (acc: { [key: string]: FeedbackValue | string }, [key, value]: [FeedbackKey | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: FeedbackValue | string }, [key, value]: [FeedbackKey | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -3238,11 +3300,25 @@ const deserializeAws_json1_1LogPattern = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1LogPatternList = (output: any, context: __SerdeContext): LogPattern[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LogPattern(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LogPattern(entry, context); + }); }; const deserializeAws_json1_1LogPatternSetList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Observation = (output: any, context: __SerdeContext): Observation => { @@ -3353,7 +3429,14 @@ const deserializeAws_json1_1Observation = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ObservationList = (output: any, context: __SerdeContext): Observation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Observation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Observation(entry, context); + }); }; const deserializeAws_json1_1Problem = (output: any, context: __SerdeContext): Problem => { @@ -3384,7 +3467,14 @@ const deserializeAws_json1_1Problem = (output: any, context: __SerdeContext): Pr }; const deserializeAws_json1_1ProblemList = (output: any, context: __SerdeContext): Problem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Problem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Problem(entry, context); + }); }; const deserializeAws_json1_1RelatedObservations = (output: any, context: __SerdeContext): RelatedObservations => { @@ -3403,7 +3493,14 @@ const deserializeAws_json1_1ResourceInUseException = (output: any, context: __Se }; const deserializeAws_json1_1ResourceList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceNotFoundException = ( @@ -3423,7 +3520,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -3499,13 +3603,15 @@ const deserializeAws_json1_1ValidationException = (output: any, context: __Serde }; const deserializeAws_json1_1WorkloadMetaData = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -3558,3 +3664,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-appstream/protocols/Aws_json1_1.ts b/clients/client-appstream/protocols/Aws_json1_1.ts index 3ab12c156a07..34d7d7655865 100644 --- a/clients/client-appstream/protocols/Aws_json1_1.ts +++ b/clients/client-appstream/protocols/Aws_json1_1.ts @@ -254,7 +254,7 @@ export const serializeAws_json1_1AssociateFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.AssociateFleet", }; let body: any; @@ -267,7 +267,7 @@ export const serializeAws_json1_1BatchAssociateUserStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.BatchAssociateUserStack", }; let body: any; @@ -280,7 +280,7 @@ export const serializeAws_json1_1BatchDisassociateUserStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.BatchDisassociateUserStack", }; let body: any; @@ -293,7 +293,7 @@ export const serializeAws_json1_1CopyImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.CopyImage", }; let body: any; @@ -306,7 +306,7 @@ export const serializeAws_json1_1CreateDirectoryConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.CreateDirectoryConfig", }; let body: any; @@ -319,7 +319,7 @@ export const serializeAws_json1_1CreateFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.CreateFleet", }; let body: any; @@ -332,7 +332,7 @@ export const serializeAws_json1_1CreateImageBuilderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.CreateImageBuilder", }; let body: any; @@ -345,7 +345,7 @@ export const serializeAws_json1_1CreateImageBuilderStreamingURLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.CreateImageBuilderStreamingURL", }; let body: any; @@ -358,7 +358,7 @@ export const serializeAws_json1_1CreateStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.CreateStack", }; let body: any; @@ -371,7 +371,7 @@ export const serializeAws_json1_1CreateStreamingURLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.CreateStreamingURL", }; let body: any; @@ -384,7 +384,7 @@ export const serializeAws_json1_1CreateUsageReportSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.CreateUsageReportSubscription", }; let body: any; @@ -397,7 +397,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.CreateUser", }; let body: any; @@ -410,7 +410,7 @@ export const serializeAws_json1_1DeleteDirectoryConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DeleteDirectoryConfig", }; let body: any; @@ -423,7 +423,7 @@ export const serializeAws_json1_1DeleteFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DeleteFleet", }; let body: any; @@ -436,7 +436,7 @@ export const serializeAws_json1_1DeleteImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DeleteImage", }; let body: any; @@ -449,7 +449,7 @@ export const serializeAws_json1_1DeleteImageBuilderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DeleteImageBuilder", }; let body: any; @@ -462,7 +462,7 @@ export const serializeAws_json1_1DeleteImagePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DeleteImagePermissions", }; let body: any; @@ -475,7 +475,7 @@ export const serializeAws_json1_1DeleteStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DeleteStack", }; let body: any; @@ -488,7 +488,7 @@ export const serializeAws_json1_1DeleteUsageReportSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DeleteUsageReportSubscription", }; let body: any; @@ -501,7 +501,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DeleteUser", }; let body: any; @@ -514,7 +514,7 @@ export const serializeAws_json1_1DescribeDirectoryConfigsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeDirectoryConfigs", }; let body: any; @@ -527,7 +527,7 @@ export const serializeAws_json1_1DescribeFleetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeFleets", }; let body: any; @@ -540,7 +540,7 @@ export const serializeAws_json1_1DescribeImageBuildersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeImageBuilders", }; let body: any; @@ -553,7 +553,7 @@ export const serializeAws_json1_1DescribeImagePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeImagePermissions", }; let body: any; @@ -566,7 +566,7 @@ export const serializeAws_json1_1DescribeImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeImages", }; let body: any; @@ -579,7 +579,7 @@ export const serializeAws_json1_1DescribeSessionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeSessions", }; let body: any; @@ -592,7 +592,7 @@ export const serializeAws_json1_1DescribeStacksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeStacks", }; let body: any; @@ -605,7 +605,7 @@ export const serializeAws_json1_1DescribeUsageReportSubscriptionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeUsageReportSubscriptions", }; let body: any; @@ -618,7 +618,7 @@ export const serializeAws_json1_1DescribeUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeUsers", }; let body: any; @@ -631,7 +631,7 @@ export const serializeAws_json1_1DescribeUserStackAssociationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DescribeUserStackAssociations", }; let body: any; @@ -644,7 +644,7 @@ export const serializeAws_json1_1DisableUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DisableUser", }; let body: any; @@ -657,7 +657,7 @@ export const serializeAws_json1_1DisassociateFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.DisassociateFleet", }; let body: any; @@ -670,7 +670,7 @@ export const serializeAws_json1_1EnableUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.EnableUser", }; let body: any; @@ -683,7 +683,7 @@ export const serializeAws_json1_1ExpireSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.ExpireSession", }; let body: any; @@ -696,7 +696,7 @@ export const serializeAws_json1_1ListAssociatedFleetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.ListAssociatedFleets", }; let body: any; @@ -709,7 +709,7 @@ export const serializeAws_json1_1ListAssociatedStacksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.ListAssociatedStacks", }; let body: any; @@ -722,7 +722,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.ListTagsForResource", }; let body: any; @@ -735,7 +735,7 @@ export const serializeAws_json1_1StartFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.StartFleet", }; let body: any; @@ -748,7 +748,7 @@ export const serializeAws_json1_1StartImageBuilderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.StartImageBuilder", }; let body: any; @@ -761,7 +761,7 @@ export const serializeAws_json1_1StopFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.StopFleet", }; let body: any; @@ -774,7 +774,7 @@ export const serializeAws_json1_1StopImageBuilderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.StopImageBuilder", }; let body: any; @@ -787,7 +787,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.TagResource", }; let body: any; @@ -800,7 +800,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.UntagResource", }; let body: any; @@ -813,7 +813,7 @@ export const serializeAws_json1_1UpdateDirectoryConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.UpdateDirectoryConfig", }; let body: any; @@ -826,7 +826,7 @@ export const serializeAws_json1_1UpdateFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.UpdateFleet", }; let body: any; @@ -839,7 +839,7 @@ export const serializeAws_json1_1UpdateImagePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.UpdateImagePermissions", }; let body: any; @@ -852,7 +852,7 @@ export const serializeAws_json1_1UpdateStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PhotonAdminProxyService.UpdateStack", }; let body: any; @@ -887,8 +887,7 @@ const deserializeAws_json1_1AssociateFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -982,8 +981,7 @@ const deserializeAws_json1_1BatchAssociateUserStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.appstream#InvalidParameterCombinationException": @@ -1045,8 +1043,7 @@ const deserializeAws_json1_1BatchDisassociateUserStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.appstream#InvalidParameterCombinationException": @@ -1108,8 +1105,7 @@ const deserializeAws_json1_1CopyImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IncompatibleImageException": case "com.amazonaws.appstream#IncompatibleImageException": @@ -1203,8 +1199,7 @@ const deserializeAws_json1_1CreateDirectoryConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidAccountStatusException": case "com.amazonaws.appstream#InvalidAccountStatusException": @@ -1298,8 +1293,7 @@ const deserializeAws_json1_1CreateFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -1433,8 +1427,7 @@ const deserializeAws_json1_1CreateImageBuilderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -1568,8 +1561,7 @@ const deserializeAws_json1_1CreateImageBuilderStreamingURLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedException": case "com.amazonaws.appstream#OperationNotPermittedException": @@ -1631,8 +1623,7 @@ const deserializeAws_json1_1CreateStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -1734,8 +1725,7 @@ const deserializeAws_json1_1CreateStreamingURLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.appstream#InvalidParameterCombinationException": @@ -1813,8 +1803,7 @@ const deserializeAws_json1_1CreateUsageReportSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidAccountStatusException": case "com.amazonaws.appstream#InvalidAccountStatusException": @@ -1884,8 +1873,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidAccountStatusException": case "com.amazonaws.appstream#InvalidAccountStatusException": @@ -1971,8 +1959,7 @@ const deserializeAws_json1_1DeleteDirectoryConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUseException": case "com.amazonaws.appstream#ResourceInUseException": @@ -2034,8 +2021,7 @@ const deserializeAws_json1_1DeleteFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -2105,8 +2091,7 @@ const deserializeAws_json1_1DeleteImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -2184,8 +2169,7 @@ const deserializeAws_json1_1DeleteImageBuilderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -2255,8 +2239,7 @@ const deserializeAws_json1_1DeleteImagePermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotAvailableException": case "com.amazonaws.appstream#ResourceNotAvailableException": @@ -2318,8 +2301,7 @@ const deserializeAws_json1_1DeleteStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -2389,8 +2371,7 @@ const deserializeAws_json1_1DeleteUsageReportSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidAccountStatusException": case "com.amazonaws.appstream#InvalidAccountStatusException": @@ -2452,8 +2433,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": @@ -2507,8 +2487,7 @@ const deserializeAws_json1_1DescribeDirectoryConfigsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": @@ -2562,8 +2541,7 @@ const deserializeAws_json1_1DescribeFleetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": @@ -2617,8 +2595,7 @@ const deserializeAws_json1_1DescribeImageBuildersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": @@ -2672,8 +2649,7 @@ const deserializeAws_json1_1DescribeImagePermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": @@ -2727,8 +2703,7 @@ const deserializeAws_json1_1DescribeImagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.appstream#InvalidParameterCombinationException": @@ -2790,8 +2765,7 @@ const deserializeAws_json1_1DescribeSessionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.appstream#InvalidParameterCombinationException": @@ -2845,8 +2819,7 @@ const deserializeAws_json1_1DescribeStacksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": @@ -2900,8 +2873,7 @@ const deserializeAws_json1_1DescribeUsageReportSubscriptionsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidAccountStatusException": case "com.amazonaws.appstream#InvalidAccountStatusException": @@ -2963,8 +2935,7 @@ const deserializeAws_json1_1DescribeUsersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.appstream#InvalidParameterCombinationException": @@ -3026,8 +2997,7 @@ const deserializeAws_json1_1DescribeUserStackAssociationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.appstream#InvalidParameterCombinationException": @@ -3089,8 +3059,7 @@ const deserializeAws_json1_1DisableUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": @@ -3144,8 +3113,7 @@ const deserializeAws_json1_1DisassociateFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -3223,8 +3191,7 @@ const deserializeAws_json1_1EnableUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidAccountStatusException": case "com.amazonaws.appstream#InvalidAccountStatusException": @@ -3286,8 +3253,7 @@ const deserializeAws_json1_1ExpireSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3333,8 +3299,7 @@ const deserializeAws_json1_1ListAssociatedFleetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3380,8 +3345,7 @@ const deserializeAws_json1_1ListAssociatedStacksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3427,8 +3391,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": @@ -3482,8 +3445,7 @@ const deserializeAws_json1_1StartFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -3593,8 +3555,7 @@ const deserializeAws_json1_1StartImageBuilderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -3680,8 +3641,7 @@ const deserializeAws_json1_1StopFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -3743,8 +3703,7 @@ const deserializeAws_json1_1StopImageBuilderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -3814,8 +3773,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidAccountStatusException": case "com.amazonaws.appstream#InvalidAccountStatusException": @@ -3885,8 +3843,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": @@ -3940,8 +3897,7 @@ const deserializeAws_json1_1UpdateDirectoryConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -4027,8 +3983,7 @@ const deserializeAws_json1_1UpdateFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -4162,8 +4117,7 @@ const deserializeAws_json1_1UpdateImagePermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.appstream#LimitExceededException": @@ -4233,8 +4187,7 @@ const deserializeAws_json1_1UpdateStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": @@ -4507,35 +4460,56 @@ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( const serializeAws_json1_1AccessEndpoint = (input: AccessEndpoint, context: __SerdeContext): any => { return { - ...(input.EndpointType !== undefined && { EndpointType: input.EndpointType }), - ...(input.VpceId !== undefined && { VpceId: input.VpceId }), + ...(input.EndpointType !== undefined && input.EndpointType !== null && { EndpointType: input.EndpointType }), + ...(input.VpceId !== undefined && input.VpceId !== null && { VpceId: input.VpceId }), }; }; const serializeAws_json1_1AccessEndpointList = (input: AccessEndpoint[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AccessEndpoint(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AccessEndpoint(entry, context); + }); }; const serializeAws_json1_1ApplicationSettings = (input: ApplicationSettings, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.SettingsGroup !== undefined && { SettingsGroup: input.SettingsGroup }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.SettingsGroup !== undefined && input.SettingsGroup !== null && { SettingsGroup: input.SettingsGroup }), }; }; const serializeAws_json1_1ArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssociateFleetRequest = (input: AssociateFleetRequest, context: __SerdeContext): any => { return { - ...(input.FleetName !== undefined && { FleetName: input.FleetName }), - ...(input.StackName !== undefined && { StackName: input.StackName }), + ...(input.FleetName !== undefined && input.FleetName !== null && { FleetName: input.FleetName }), + ...(input.StackName !== undefined && input.StackName !== null && { StackName: input.StackName }), }; }; const serializeAws_json1_1AwsAccountIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchAssociateUserStackRequest = ( @@ -4543,9 +4517,10 @@ const serializeAws_json1_1BatchAssociateUserStackRequest = ( context: __SerdeContext ): any => { return { - ...(input.UserStackAssociations !== undefined && { - UserStackAssociations: serializeAws_json1_1UserStackAssociationList(input.UserStackAssociations, context), - }), + ...(input.UserStackAssociations !== undefined && + input.UserStackAssociations !== null && { + UserStackAssociations: serializeAws_json1_1UserStackAssociationList(input.UserStackAssociations, context), + }), }; }; @@ -4554,26 +4529,30 @@ const serializeAws_json1_1BatchDisassociateUserStackRequest = ( context: __SerdeContext ): any => { return { - ...(input.UserStackAssociations !== undefined && { - UserStackAssociations: serializeAws_json1_1UserStackAssociationList(input.UserStackAssociations, context), - }), + ...(input.UserStackAssociations !== undefined && + input.UserStackAssociations !== null && { + UserStackAssociations: serializeAws_json1_1UserStackAssociationList(input.UserStackAssociations, context), + }), }; }; const serializeAws_json1_1ComputeCapacity = (input: ComputeCapacity, context: __SerdeContext): any => { return { - ...(input.DesiredInstances !== undefined && { DesiredInstances: input.DesiredInstances }), + ...(input.DesiredInstances !== undefined && + input.DesiredInstances !== null && { DesiredInstances: input.DesiredInstances }), }; }; const serializeAws_json1_1CopyImageRequest = (input: CopyImageRequest, context: __SerdeContext): any => { return { - ...(input.DestinationImageDescription !== undefined && { - DestinationImageDescription: input.DestinationImageDescription, - }), - ...(input.DestinationImageName !== undefined && { DestinationImageName: input.DestinationImageName }), - ...(input.DestinationRegion !== undefined && { DestinationRegion: input.DestinationRegion }), - ...(input.SourceImageName !== undefined && { SourceImageName: input.SourceImageName }), + ...(input.DestinationImageDescription !== undefined && + input.DestinationImageDescription !== null && { DestinationImageDescription: input.DestinationImageDescription }), + ...(input.DestinationImageName !== undefined && + input.DestinationImageName !== null && { DestinationImageName: input.DestinationImageName }), + ...(input.DestinationRegion !== undefined && + input.DestinationRegion !== null && { DestinationRegion: input.DestinationRegion }), + ...(input.SourceImageName !== undefined && + input.SourceImageName !== null && { SourceImageName: input.SourceImageName }), }; }; @@ -4582,51 +4561,56 @@ const serializeAws_json1_1CreateDirectoryConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryName !== undefined && { DirectoryName: input.DirectoryName }), - ...(input.OrganizationalUnitDistinguishedNames !== undefined && { - OrganizationalUnitDistinguishedNames: serializeAws_json1_1OrganizationalUnitDistinguishedNamesList( - input.OrganizationalUnitDistinguishedNames, - context - ), - }), - ...(input.ServiceAccountCredentials !== undefined && { - ServiceAccountCredentials: serializeAws_json1_1ServiceAccountCredentials( - input.ServiceAccountCredentials, - context - ), - }), + ...(input.DirectoryName !== undefined && input.DirectoryName !== null && { DirectoryName: input.DirectoryName }), + ...(input.OrganizationalUnitDistinguishedNames !== undefined && + input.OrganizationalUnitDistinguishedNames !== null && { + OrganizationalUnitDistinguishedNames: serializeAws_json1_1OrganizationalUnitDistinguishedNamesList( + input.OrganizationalUnitDistinguishedNames, + context + ), + }), + ...(input.ServiceAccountCredentials !== undefined && + input.ServiceAccountCredentials !== null && { + ServiceAccountCredentials: serializeAws_json1_1ServiceAccountCredentials( + input.ServiceAccountCredentials, + context + ), + }), }; }; const serializeAws_json1_1CreateFleetRequest = (input: CreateFleetRequest, context: __SerdeContext): any => { return { - ...(input.ComputeCapacity !== undefined && { - ComputeCapacity: serializeAws_json1_1ComputeCapacity(input.ComputeCapacity, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisconnectTimeoutInSeconds !== undefined && { - DisconnectTimeoutInSeconds: input.DisconnectTimeoutInSeconds, - }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.DomainJoinInfo !== undefined && { - DomainJoinInfo: serializeAws_json1_1DomainJoinInfo(input.DomainJoinInfo, context), - }), - ...(input.EnableDefaultInternetAccess !== undefined && { - EnableDefaultInternetAccess: input.EnableDefaultInternetAccess, - }), - ...(input.FleetType !== undefined && { FleetType: input.FleetType }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.IdleDisconnectTimeoutInSeconds !== undefined && { - IdleDisconnectTimeoutInSeconds: input.IdleDisconnectTimeoutInSeconds, - }), - ...(input.ImageArn !== undefined && { ImageArn: input.ImageArn }), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.MaxUserDurationInSeconds !== undefined && { MaxUserDurationInSeconds: input.MaxUserDurationInSeconds }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.StreamView !== undefined && { StreamView: input.StreamView }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.ComputeCapacity !== undefined && + input.ComputeCapacity !== null && { + ComputeCapacity: serializeAws_json1_1ComputeCapacity(input.ComputeCapacity, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisconnectTimeoutInSeconds !== undefined && + input.DisconnectTimeoutInSeconds !== null && { DisconnectTimeoutInSeconds: input.DisconnectTimeoutInSeconds }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.DomainJoinInfo !== undefined && + input.DomainJoinInfo !== null && { + DomainJoinInfo: serializeAws_json1_1DomainJoinInfo(input.DomainJoinInfo, context), + }), + ...(input.EnableDefaultInternetAccess !== undefined && + input.EnableDefaultInternetAccess !== null && { EnableDefaultInternetAccess: input.EnableDefaultInternetAccess }), + ...(input.FleetType !== undefined && input.FleetType !== null && { FleetType: input.FleetType }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.IdleDisconnectTimeoutInSeconds !== undefined && + input.IdleDisconnectTimeoutInSeconds !== null && { + IdleDisconnectTimeoutInSeconds: input.IdleDisconnectTimeoutInSeconds, + }), + ...(input.ImageArn !== undefined && input.ImageArn !== null && { ImageArn: input.ImageArn }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.MaxUserDurationInSeconds !== undefined && + input.MaxUserDurationInSeconds !== null && { MaxUserDurationInSeconds: input.MaxUserDurationInSeconds }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.StreamView !== undefined && input.StreamView !== null && { StreamView: input.StreamView }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -4635,25 +4619,28 @@ const serializeAws_json1_1CreateImageBuilderRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessEndpoints !== undefined && { - AccessEndpoints: serializeAws_json1_1AccessEndpointList(input.AccessEndpoints, context), - }), - ...(input.AppstreamAgentVersion !== undefined && { AppstreamAgentVersion: input.AppstreamAgentVersion }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.DomainJoinInfo !== undefined && { - DomainJoinInfo: serializeAws_json1_1DomainJoinInfo(input.DomainJoinInfo, context), - }), - ...(input.EnableDefaultInternetAccess !== undefined && { - EnableDefaultInternetAccess: input.EnableDefaultInternetAccess, - }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.ImageArn !== undefined && { ImageArn: input.ImageArn }), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.AccessEndpoints !== undefined && + input.AccessEndpoints !== null && { + AccessEndpoints: serializeAws_json1_1AccessEndpointList(input.AccessEndpoints, context), + }), + ...(input.AppstreamAgentVersion !== undefined && + input.AppstreamAgentVersion !== null && { AppstreamAgentVersion: input.AppstreamAgentVersion }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.DomainJoinInfo !== undefined && + input.DomainJoinInfo !== null && { + DomainJoinInfo: serializeAws_json1_1DomainJoinInfo(input.DomainJoinInfo, context), + }), + ...(input.EnableDefaultInternetAccess !== undefined && + input.EnableDefaultInternetAccess !== null && { EnableDefaultInternetAccess: input.EnableDefaultInternetAccess }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.ImageArn !== undefined && input.ImageArn !== null && { ImageArn: input.ImageArn }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -4662,34 +4649,39 @@ const serializeAws_json1_1CreateImageBuilderStreamingURLRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Validity !== undefined && { Validity: input.Validity }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Validity !== undefined && input.Validity !== null && { Validity: input.Validity }), }; }; const serializeAws_json1_1CreateStackRequest = (input: CreateStackRequest, context: __SerdeContext): any => { return { - ...(input.AccessEndpoints !== undefined && { - AccessEndpoints: serializeAws_json1_1AccessEndpointList(input.AccessEndpoints, context), - }), - ...(input.ApplicationSettings !== undefined && { - ApplicationSettings: serializeAws_json1_1ApplicationSettings(input.ApplicationSettings, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.EmbedHostDomains !== undefined && { - EmbedHostDomains: serializeAws_json1_1EmbedHostDomains(input.EmbedHostDomains, context), - }), - ...(input.FeedbackURL !== undefined && { FeedbackURL: input.FeedbackURL }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RedirectURL !== undefined && { RedirectURL: input.RedirectURL }), - ...(input.StorageConnectors !== undefined && { - StorageConnectors: serializeAws_json1_1StorageConnectorList(input.StorageConnectors, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.UserSettings !== undefined && { - UserSettings: serializeAws_json1_1UserSettingList(input.UserSettings, context), - }), + ...(input.AccessEndpoints !== undefined && + input.AccessEndpoints !== null && { + AccessEndpoints: serializeAws_json1_1AccessEndpointList(input.AccessEndpoints, context), + }), + ...(input.ApplicationSettings !== undefined && + input.ApplicationSettings !== null && { + ApplicationSettings: serializeAws_json1_1ApplicationSettings(input.ApplicationSettings, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.EmbedHostDomains !== undefined && + input.EmbedHostDomains !== null && { + EmbedHostDomains: serializeAws_json1_1EmbedHostDomains(input.EmbedHostDomains, context), + }), + ...(input.FeedbackURL !== undefined && input.FeedbackURL !== null && { FeedbackURL: input.FeedbackURL }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RedirectURL !== undefined && input.RedirectURL !== null && { RedirectURL: input.RedirectURL }), + ...(input.StorageConnectors !== undefined && + input.StorageConnectors !== null && { + StorageConnectors: serializeAws_json1_1StorageConnectorList(input.StorageConnectors, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.UserSettings !== undefined && + input.UserSettings !== null && { + UserSettings: serializeAws_json1_1UserSettingList(input.UserSettings, context), + }), }; }; @@ -4698,12 +4690,13 @@ const serializeAws_json1_1CreateStreamingURLRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationId !== undefined && { ApplicationId: input.ApplicationId }), - ...(input.FleetName !== undefined && { FleetName: input.FleetName }), - ...(input.SessionContext !== undefined && { SessionContext: input.SessionContext }), - ...(input.StackName !== undefined && { StackName: input.StackName }), - ...(input.UserId !== undefined && { UserId: input.UserId }), - ...(input.Validity !== undefined && { Validity: input.Validity }), + ...(input.ApplicationId !== undefined && input.ApplicationId !== null && { ApplicationId: input.ApplicationId }), + ...(input.FleetName !== undefined && input.FleetName !== null && { FleetName: input.FleetName }), + ...(input.SessionContext !== undefined && + input.SessionContext !== null && { SessionContext: input.SessionContext }), + ...(input.StackName !== undefined && input.StackName !== null && { StackName: input.StackName }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), + ...(input.Validity !== undefined && input.Validity !== null && { Validity: input.Validity }), }; }; @@ -4716,11 +4709,12 @@ const serializeAws_json1_1CreateUsageReportSubscriptionRequest = ( const serializeAws_json1_1CreateUserRequest = (input: CreateUserRequest, context: __SerdeContext): any => { return { - ...(input.AuthenticationType !== undefined && { AuthenticationType: input.AuthenticationType }), - ...(input.FirstName !== undefined && { FirstName: input.FirstName }), - ...(input.LastName !== undefined && { LastName: input.LastName }), - ...(input.MessageAction !== undefined && { MessageAction: input.MessageAction }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.AuthenticationType !== undefined && + input.AuthenticationType !== null && { AuthenticationType: input.AuthenticationType }), + ...(input.FirstName !== undefined && input.FirstName !== null && { FirstName: input.FirstName }), + ...(input.LastName !== undefined && input.LastName !== null && { LastName: input.LastName }), + ...(input.MessageAction !== undefined && input.MessageAction !== null && { MessageAction: input.MessageAction }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -4729,13 +4723,13 @@ const serializeAws_json1_1DeleteDirectoryConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryName !== undefined && { DirectoryName: input.DirectoryName }), + ...(input.DirectoryName !== undefined && input.DirectoryName !== null && { DirectoryName: input.DirectoryName }), }; }; const serializeAws_json1_1DeleteFleetRequest = (input: DeleteFleetRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -4744,7 +4738,7 @@ const serializeAws_json1_1DeleteImageBuilderRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -4753,20 +4747,21 @@ const serializeAws_json1_1DeleteImagePermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SharedAccountId !== undefined && { SharedAccountId: input.SharedAccountId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SharedAccountId !== undefined && + input.SharedAccountId !== null && { SharedAccountId: input.SharedAccountId }), }; }; const serializeAws_json1_1DeleteImageRequest = (input: DeleteImageRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeleteStackRequest = (input: DeleteStackRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -4779,8 +4774,9 @@ const serializeAws_json1_1DeleteUsageReportSubscriptionRequest = ( const serializeAws_json1_1DeleteUserRequest = (input: DeleteUserRequest, context: __SerdeContext): any => { return { - ...(input.AuthenticationType !== undefined && { AuthenticationType: input.AuthenticationType }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.AuthenticationType !== undefined && + input.AuthenticationType !== null && { AuthenticationType: input.AuthenticationType }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -4789,18 +4785,20 @@ const serializeAws_json1_1DescribeDirectoryConfigsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryNames !== undefined && { - DirectoryNames: serializeAws_json1_1DirectoryNameList(input.DirectoryNames, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DirectoryNames !== undefined && + input.DirectoryNames !== null && { + DirectoryNames: serializeAws_json1_1DirectoryNameList(input.DirectoryNames, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1DescribeFleetsRequest = (input: DescribeFleetsRequest, context: __SerdeContext): any => { return { - ...(input.Names !== undefined && { Names: serializeAws_json1_1StringList(input.Names, context) }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1StringList(input.Names, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4809,9 +4807,10 @@ const serializeAws_json1_1DescribeImageBuildersRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Names !== undefined && { Names: serializeAws_json1_1StringList(input.Names, context) }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1StringList(input.Names, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4820,40 +4819,44 @@ const serializeAws_json1_1DescribeImagePermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SharedAwsAccountIds !== undefined && { - SharedAwsAccountIds: serializeAws_json1_1AwsAccountIdList(input.SharedAwsAccountIds, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SharedAwsAccountIds !== undefined && + input.SharedAwsAccountIds !== null && { + SharedAwsAccountIds: serializeAws_json1_1AwsAccountIdList(input.SharedAwsAccountIds, context), + }), }; }; const serializeAws_json1_1DescribeImagesRequest = (input: DescribeImagesRequest, context: __SerdeContext): any => { return { - ...(input.Arns !== undefined && { Arns: serializeAws_json1_1ArnList(input.Arns, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Names !== undefined && { Names: serializeAws_json1_1StringList(input.Names, context) }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Arns !== undefined && input.Arns !== null && { Arns: serializeAws_json1_1ArnList(input.Arns, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1StringList(input.Names, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1DescribeSessionsRequest = (input: DescribeSessionsRequest, context: __SerdeContext): any => { return { - ...(input.AuthenticationType !== undefined && { AuthenticationType: input.AuthenticationType }), - ...(input.FleetName !== undefined && { FleetName: input.FleetName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StackName !== undefined && { StackName: input.StackName }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.AuthenticationType !== undefined && + input.AuthenticationType !== null && { AuthenticationType: input.AuthenticationType }), + ...(input.FleetName !== undefined && input.FleetName !== null && { FleetName: input.FleetName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StackName !== undefined && input.StackName !== null && { StackName: input.StackName }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; const serializeAws_json1_1DescribeStacksRequest = (input: DescribeStacksRequest, context: __SerdeContext): any => { return { - ...(input.Names !== undefined && { Names: serializeAws_json1_1StringList(input.Names, context) }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1StringList(input.Names, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4862,16 +4865,17 @@ const serializeAws_json1_1DescribeUsageReportSubscriptionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1DescribeUsersRequest = (input: DescribeUsersRequest, context: __SerdeContext): any => { return { - ...(input.AuthenticationType !== undefined && { AuthenticationType: input.AuthenticationType }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AuthenticationType !== undefined && + input.AuthenticationType !== null && { AuthenticationType: input.AuthenticationType }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4880,22 +4884,31 @@ const serializeAws_json1_1DescribeUserStackAssociationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AuthenticationType !== undefined && { AuthenticationType: input.AuthenticationType }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StackName !== undefined && { StackName: input.StackName }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.AuthenticationType !== undefined && + input.AuthenticationType !== null && { AuthenticationType: input.AuthenticationType }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StackName !== undefined && input.StackName !== null && { StackName: input.StackName }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; const serializeAws_json1_1DirectoryNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DisableUserRequest = (input: DisableUserRequest, context: __SerdeContext): any => { return { - ...(input.AuthenticationType !== undefined && { AuthenticationType: input.AuthenticationType }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.AuthenticationType !== undefined && + input.AuthenticationType !== null && { AuthenticationType: input.AuthenticationType }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -4904,49 +4917,73 @@ const serializeAws_json1_1DisassociateFleetRequest = ( context: __SerdeContext ): any => { return { - ...(input.FleetName !== undefined && { FleetName: input.FleetName }), - ...(input.StackName !== undefined && { StackName: input.StackName }), + ...(input.FleetName !== undefined && input.FleetName !== null && { FleetName: input.FleetName }), + ...(input.StackName !== undefined && input.StackName !== null && { StackName: input.StackName }), }; }; const serializeAws_json1_1DomainJoinInfo = (input: DomainJoinInfo, context: __SerdeContext): any => { return { - ...(input.DirectoryName !== undefined && { DirectoryName: input.DirectoryName }), - ...(input.OrganizationalUnitDistinguishedName !== undefined && { - OrganizationalUnitDistinguishedName: input.OrganizationalUnitDistinguishedName, - }), + ...(input.DirectoryName !== undefined && input.DirectoryName !== null && { DirectoryName: input.DirectoryName }), + ...(input.OrganizationalUnitDistinguishedName !== undefined && + input.OrganizationalUnitDistinguishedName !== null && { + OrganizationalUnitDistinguishedName: input.OrganizationalUnitDistinguishedName, + }), }; }; const serializeAws_json1_1DomainList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EmbedHostDomains = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EnableUserRequest = (input: EnableUserRequest, context: __SerdeContext): any => { return { - ...(input.AuthenticationType !== undefined && { AuthenticationType: input.AuthenticationType }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.AuthenticationType !== undefined && + input.AuthenticationType !== null && { AuthenticationType: input.AuthenticationType }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; const serializeAws_json1_1ExpireSessionRequest = (input: ExpireSessionRequest, context: __SerdeContext): any => { return { - ...(input.SessionId !== undefined && { SessionId: input.SessionId }), + ...(input.SessionId !== undefined && input.SessionId !== null && { SessionId: input.SessionId }), }; }; const serializeAws_json1_1FleetAttributes = (input: (FleetAttribute | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ImagePermissions = (input: ImagePermissions, context: __SerdeContext): any => { return { - ...(input.allowFleet !== undefined && { allowFleet: input.allowFleet }), - ...(input.allowImageBuilder !== undefined && { allowImageBuilder: input.allowImageBuilder }), + ...(input.allowFleet !== undefined && input.allowFleet !== null && { allowFleet: input.allowFleet }), + ...(input.allowImageBuilder !== undefined && + input.allowImageBuilder !== null && { allowImageBuilder: input.allowImageBuilder }), }; }; @@ -4955,8 +4992,8 @@ const serializeAws_json1_1ListAssociatedFleetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StackName !== undefined && { StackName: input.StackName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StackName !== undefined && input.StackName !== null && { StackName: input.StackName }), }; }; @@ -4965,8 +5002,8 @@ const serializeAws_json1_1ListAssociatedStacksRequest = ( context: __SerdeContext ): any => { return { - ...(input.FleetName !== undefined && { FleetName: input.FleetName }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FleetName !== undefined && input.FleetName !== null && { FleetName: input.FleetName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4975,7 +5012,7 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -4983,11 +5020,25 @@ const serializeAws_json1_1OrganizationalUnitDistinguishedNamesList = ( input: string[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SecurityGroupIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ServiceAccountCredentials = ( @@ -4995,18 +5046,26 @@ const serializeAws_json1_1ServiceAccountCredentials = ( context: __SerdeContext ): any => { return { - ...(input.AccountName !== undefined && { AccountName: input.AccountName }), - ...(input.AccountPassword !== undefined && { AccountPassword: input.AccountPassword }), + ...(input.AccountName !== undefined && input.AccountName !== null && { AccountName: input.AccountName }), + ...(input.AccountPassword !== undefined && + input.AccountPassword !== null && { AccountPassword: input.AccountPassword }), }; }; const serializeAws_json1_1StackAttributes = (input: (StackAttribute | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartFleetRequest = (input: StartFleetRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -5015,68 +5074,102 @@ const serializeAws_json1_1StartImageBuilderRequest = ( context: __SerdeContext ): any => { return { - ...(input.AppstreamAgentVersion !== undefined && { AppstreamAgentVersion: input.AppstreamAgentVersion }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AppstreamAgentVersion !== undefined && + input.AppstreamAgentVersion !== null && { AppstreamAgentVersion: input.AppstreamAgentVersion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1StopFleetRequest = (input: StopFleetRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1StopImageBuilderRequest = (input: StopImageBuilderRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1StorageConnector = (input: StorageConnector, context: __SerdeContext): any => { return { - ...(input.ConnectorType !== undefined && { ConnectorType: input.ConnectorType }), - ...(input.Domains !== undefined && { Domains: serializeAws_json1_1DomainList(input.Domains, context) }), - ...(input.ResourceIdentifier !== undefined && { ResourceIdentifier: input.ResourceIdentifier }), + ...(input.ConnectorType !== undefined && input.ConnectorType !== null && { ConnectorType: input.ConnectorType }), + ...(input.Domains !== undefined && + input.Domains !== null && { Domains: serializeAws_json1_1DomainList(input.Domains, context) }), + ...(input.ResourceIdentifier !== undefined && + input.ResourceIdentifier !== null && { ResourceIdentifier: input.ResourceIdentifier }), }; }; const serializeAws_json1_1StorageConnectorList = (input: StorageConnector[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1StorageConnector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1StorageConnector(entry, context); + }); }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SubnetIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -5085,53 +5178,60 @@ const serializeAws_json1_1UpdateDirectoryConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryName !== undefined && { DirectoryName: input.DirectoryName }), - ...(input.OrganizationalUnitDistinguishedNames !== undefined && { - OrganizationalUnitDistinguishedNames: serializeAws_json1_1OrganizationalUnitDistinguishedNamesList( - input.OrganizationalUnitDistinguishedNames, - context - ), - }), - ...(input.ServiceAccountCredentials !== undefined && { - ServiceAccountCredentials: serializeAws_json1_1ServiceAccountCredentials( - input.ServiceAccountCredentials, - context - ), - }), + ...(input.DirectoryName !== undefined && input.DirectoryName !== null && { DirectoryName: input.DirectoryName }), + ...(input.OrganizationalUnitDistinguishedNames !== undefined && + input.OrganizationalUnitDistinguishedNames !== null && { + OrganizationalUnitDistinguishedNames: serializeAws_json1_1OrganizationalUnitDistinguishedNamesList( + input.OrganizationalUnitDistinguishedNames, + context + ), + }), + ...(input.ServiceAccountCredentials !== undefined && + input.ServiceAccountCredentials !== null && { + ServiceAccountCredentials: serializeAws_json1_1ServiceAccountCredentials( + input.ServiceAccountCredentials, + context + ), + }), }; }; const serializeAws_json1_1UpdateFleetRequest = (input: UpdateFleetRequest, context: __SerdeContext): any => { return { - ...(input.AttributesToDelete !== undefined && { - AttributesToDelete: serializeAws_json1_1FleetAttributes(input.AttributesToDelete, context), - }), - ...(input.ComputeCapacity !== undefined && { - ComputeCapacity: serializeAws_json1_1ComputeCapacity(input.ComputeCapacity, context), - }), - ...(input.DeleteVpcConfig !== undefined && { DeleteVpcConfig: input.DeleteVpcConfig }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisconnectTimeoutInSeconds !== undefined && { - DisconnectTimeoutInSeconds: input.DisconnectTimeoutInSeconds, - }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.DomainJoinInfo !== undefined && { - DomainJoinInfo: serializeAws_json1_1DomainJoinInfo(input.DomainJoinInfo, context), - }), - ...(input.EnableDefaultInternetAccess !== undefined && { - EnableDefaultInternetAccess: input.EnableDefaultInternetAccess, - }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.IdleDisconnectTimeoutInSeconds !== undefined && { - IdleDisconnectTimeoutInSeconds: input.IdleDisconnectTimeoutInSeconds, - }), - ...(input.ImageArn !== undefined && { ImageArn: input.ImageArn }), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.MaxUserDurationInSeconds !== undefined && { MaxUserDurationInSeconds: input.MaxUserDurationInSeconds }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.StreamView !== undefined && { StreamView: input.StreamView }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.AttributesToDelete !== undefined && + input.AttributesToDelete !== null && { + AttributesToDelete: serializeAws_json1_1FleetAttributes(input.AttributesToDelete, context), + }), + ...(input.ComputeCapacity !== undefined && + input.ComputeCapacity !== null && { + ComputeCapacity: serializeAws_json1_1ComputeCapacity(input.ComputeCapacity, context), + }), + ...(input.DeleteVpcConfig !== undefined && + input.DeleteVpcConfig !== null && { DeleteVpcConfig: input.DeleteVpcConfig }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisconnectTimeoutInSeconds !== undefined && + input.DisconnectTimeoutInSeconds !== null && { DisconnectTimeoutInSeconds: input.DisconnectTimeoutInSeconds }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.DomainJoinInfo !== undefined && + input.DomainJoinInfo !== null && { + DomainJoinInfo: serializeAws_json1_1DomainJoinInfo(input.DomainJoinInfo, context), + }), + ...(input.EnableDefaultInternetAccess !== undefined && + input.EnableDefaultInternetAccess !== null && { EnableDefaultInternetAccess: input.EnableDefaultInternetAccess }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.IdleDisconnectTimeoutInSeconds !== undefined && + input.IdleDisconnectTimeoutInSeconds !== null && { + IdleDisconnectTimeoutInSeconds: input.IdleDisconnectTimeoutInSeconds, + }), + ...(input.ImageArn !== undefined && input.ImageArn !== null && { ImageArn: input.ImageArn }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.MaxUserDurationInSeconds !== undefined && + input.MaxUserDurationInSeconds !== null && { MaxUserDurationInSeconds: input.MaxUserDurationInSeconds }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.StreamView !== undefined && input.StreamView !== null && { StreamView: input.StreamView }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -5140,73 +5240,100 @@ const serializeAws_json1_1UpdateImagePermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ImagePermissions !== undefined && { - ImagePermissions: serializeAws_json1_1ImagePermissions(input.ImagePermissions, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SharedAccountId !== undefined && { SharedAccountId: input.SharedAccountId }), + ...(input.ImagePermissions !== undefined && + input.ImagePermissions !== null && { + ImagePermissions: serializeAws_json1_1ImagePermissions(input.ImagePermissions, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SharedAccountId !== undefined && + input.SharedAccountId !== null && { SharedAccountId: input.SharedAccountId }), }; }; const serializeAws_json1_1UpdateStackRequest = (input: UpdateStackRequest, context: __SerdeContext): any => { return { - ...(input.AccessEndpoints !== undefined && { - AccessEndpoints: serializeAws_json1_1AccessEndpointList(input.AccessEndpoints, context), - }), - ...(input.ApplicationSettings !== undefined && { - ApplicationSettings: serializeAws_json1_1ApplicationSettings(input.ApplicationSettings, context), - }), - ...(input.AttributesToDelete !== undefined && { - AttributesToDelete: serializeAws_json1_1StackAttributes(input.AttributesToDelete, context), - }), - ...(input.DeleteStorageConnectors !== undefined && { DeleteStorageConnectors: input.DeleteStorageConnectors }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.EmbedHostDomains !== undefined && { - EmbedHostDomains: serializeAws_json1_1EmbedHostDomains(input.EmbedHostDomains, context), - }), - ...(input.FeedbackURL !== undefined && { FeedbackURL: input.FeedbackURL }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RedirectURL !== undefined && { RedirectURL: input.RedirectURL }), - ...(input.StorageConnectors !== undefined && { - StorageConnectors: serializeAws_json1_1StorageConnectorList(input.StorageConnectors, context), - }), - ...(input.UserSettings !== undefined && { - UserSettings: serializeAws_json1_1UserSettingList(input.UserSettings, context), - }), + ...(input.AccessEndpoints !== undefined && + input.AccessEndpoints !== null && { + AccessEndpoints: serializeAws_json1_1AccessEndpointList(input.AccessEndpoints, context), + }), + ...(input.ApplicationSettings !== undefined && + input.ApplicationSettings !== null && { + ApplicationSettings: serializeAws_json1_1ApplicationSettings(input.ApplicationSettings, context), + }), + ...(input.AttributesToDelete !== undefined && + input.AttributesToDelete !== null && { + AttributesToDelete: serializeAws_json1_1StackAttributes(input.AttributesToDelete, context), + }), + ...(input.DeleteStorageConnectors !== undefined && + input.DeleteStorageConnectors !== null && { DeleteStorageConnectors: input.DeleteStorageConnectors }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.EmbedHostDomains !== undefined && + input.EmbedHostDomains !== null && { + EmbedHostDomains: serializeAws_json1_1EmbedHostDomains(input.EmbedHostDomains, context), + }), + ...(input.FeedbackURL !== undefined && input.FeedbackURL !== null && { FeedbackURL: input.FeedbackURL }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RedirectURL !== undefined && input.RedirectURL !== null && { RedirectURL: input.RedirectURL }), + ...(input.StorageConnectors !== undefined && + input.StorageConnectors !== null && { + StorageConnectors: serializeAws_json1_1StorageConnectorList(input.StorageConnectors, context), + }), + ...(input.UserSettings !== undefined && + input.UserSettings !== null && { + UserSettings: serializeAws_json1_1UserSettingList(input.UserSettings, context), + }), }; }; const serializeAws_json1_1UserSetting = (input: UserSetting, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Permission !== undefined && { Permission: input.Permission }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Permission !== undefined && input.Permission !== null && { Permission: input.Permission }), }; }; const serializeAws_json1_1UserSettingList = (input: UserSetting[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1UserSetting(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1UserSetting(entry, context); + }); }; const serializeAws_json1_1UserStackAssociation = (input: UserStackAssociation, context: __SerdeContext): any => { return { - ...(input.AuthenticationType !== undefined && { AuthenticationType: input.AuthenticationType }), - ...(input.SendEmailNotification !== undefined && { SendEmailNotification: input.SendEmailNotification }), - ...(input.StackName !== undefined && { StackName: input.StackName }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.AuthenticationType !== undefined && + input.AuthenticationType !== null && { AuthenticationType: input.AuthenticationType }), + ...(input.SendEmailNotification !== undefined && + input.SendEmailNotification !== null && { SendEmailNotification: input.SendEmailNotification }), + ...(input.StackName !== undefined && input.StackName !== null && { StackName: input.StackName }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; const serializeAws_json1_1UserStackAssociationList = (input: UserStackAssociation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1UserStackAssociation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1UserStackAssociation(entry, context); + }); }; const serializeAws_json1_1VpcConfig = (input: VpcConfig, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIdList(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIdList(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) }), }; }; @@ -5218,7 +5345,14 @@ const deserializeAws_json1_1AccessEndpoint = (output: any, context: __SerdeConte }; const deserializeAws_json1_1AccessEndpointList = (output: any, context: __SerdeContext): AccessEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AccessEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccessEndpoint(entry, context); + }); }; const deserializeAws_json1_1Application = (output: any, context: __SerdeContext): Application => { @@ -5238,7 +5372,14 @@ const deserializeAws_json1_1Application = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1Applications = (output: any, context: __SerdeContext): Application[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Application(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Application(entry, context); + }); }; const deserializeAws_json1_1ApplicationSettingsResponse = ( @@ -5579,7 +5720,14 @@ const deserializeAws_json1_1DirectoryConfig = (output: any, context: __SerdeCont }; const deserializeAws_json1_1DirectoryConfigList = (output: any, context: __SerdeContext): DirectoryConfig[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DirectoryConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DirectoryConfig(entry, context); + }); }; const deserializeAws_json1_1DisableUserResult = (output: any, context: __SerdeContext): DisableUserResult => { @@ -5605,11 +5753,25 @@ const deserializeAws_json1_1DomainJoinInfo = (output: any, context: __SerdeConte }; const deserializeAws_json1_1DomainList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1EmbedHostDomains = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1EnableUserResult = (output: any, context: __SerdeContext): EnableUserResult => { @@ -5680,11 +5842,25 @@ const deserializeAws_json1_1FleetError = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1FleetErrors = (output: any, context: __SerdeContext): FleetError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FleetError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FleetError(entry, context); + }); }; const deserializeAws_json1_1FleetList = (output: any, context: __SerdeContext): Fleet[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Fleet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Fleet(entry, context); + }); }; const deserializeAws_json1_1Image = (output: any, context: __SerdeContext): Image => { @@ -5781,7 +5957,14 @@ const deserializeAws_json1_1ImageBuilder = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ImageBuilderList = (output: any, context: __SerdeContext): ImageBuilder[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageBuilder(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageBuilder(entry, context); + }); }; const deserializeAws_json1_1ImageBuilderStateChangeReason = ( @@ -5795,7 +5978,14 @@ const deserializeAws_json1_1ImageBuilderStateChangeReason = ( }; const deserializeAws_json1_1ImageList = (output: any, context: __SerdeContext): Image[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Image(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Image(entry, context); + }); }; const deserializeAws_json1_1ImagePermissions = (output: any, context: __SerdeContext): ImagePermissions => { @@ -5862,7 +6052,14 @@ const deserializeAws_json1_1LastReportGenerationExecutionErrors = ( output: any, context: __SerdeContext ): LastReportGenerationExecutionError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LastReportGenerationExecutionError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LastReportGenerationExecutionError(entry, context); + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -5908,13 +6105,15 @@ const deserializeAws_json1_1ListTagsForResourceResponse = ( }; const deserializeAws_json1_1Metadata = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1NetworkAccessConfiguration = ( @@ -5943,7 +6142,14 @@ const deserializeAws_json1_1OrganizationalUnitDistinguishedNamesList = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RequestLimitExceededException = ( @@ -5976,7 +6182,14 @@ const deserializeAws_json1_1ResourceError = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ResourceErrors = (output: any, context: __SerdeContext): ResourceError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceError(entry, context); + }); }; const deserializeAws_json1_1ResourceInUseException = (output: any, context: __SerdeContext): ResourceInUseException => { @@ -6004,7 +6217,14 @@ const deserializeAws_json1_1ResourceNotFoundException = ( }; const deserializeAws_json1_1SecurityGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ServiceAccountCredentials = ( @@ -6047,7 +6267,14 @@ const deserializeAws_json1_1Session = (output: any, context: __SerdeContext): Se }; const deserializeAws_json1_1SessionList = (output: any, context: __SerdeContext): Session[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Session(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Session(entry, context); + }); }; const deserializeAws_json1_1SharedImagePermissions = (output: any, context: __SerdeContext): SharedImagePermissions => { @@ -6065,7 +6292,14 @@ const deserializeAws_json1_1SharedImagePermissionsList = ( output: any, context: __SerdeContext ): SharedImagePermissions[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SharedImagePermissions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SharedImagePermissions(entry, context); + }); }; const deserializeAws_json1_1Stack = (output: any, context: __SerdeContext): Stack => { @@ -6115,11 +6349,25 @@ const deserializeAws_json1_1StackError = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1StackErrors = (output: any, context: __SerdeContext): StackError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StackError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StackError(entry, context); + }); }; const deserializeAws_json1_1StackList = (output: any, context: __SerdeContext): Stack[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Stack(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Stack(entry, context); + }); }; const deserializeAws_json1_1StartFleetResult = (output: any, context: __SerdeContext): StartFleetResult => { @@ -6167,15 +6415,36 @@ const deserializeAws_json1_1StorageConnector = (output: any, context: __SerdeCon }; const deserializeAws_json1_1StorageConnectorList = (output: any, context: __SerdeContext): StorageConnector[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StorageConnector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StorageConnector(entry, context); + }); }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SubnetIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -6183,13 +6452,15 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => { @@ -6255,7 +6526,14 @@ const deserializeAws_json1_1UsageReportSubscriptionList = ( output: any, context: __SerdeContext ): UsageReportSubscription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UsageReportSubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UsageReportSubscription(entry, context); + }); }; const deserializeAws_json1_1User = (output: any, context: __SerdeContext): User => { @@ -6278,7 +6556,14 @@ const deserializeAws_json1_1User = (output: any, context: __SerdeContext): User }; const deserializeAws_json1_1UserList = (output: any, context: __SerdeContext): User[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1User(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1User(entry, context); + }); }; const deserializeAws_json1_1UserSetting = (output: any, context: __SerdeContext): UserSetting => { @@ -6289,7 +6574,14 @@ const deserializeAws_json1_1UserSetting = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1UserSettingList = (output: any, context: __SerdeContext): UserSetting[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserSetting(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserSetting(entry, context); + }); }; const deserializeAws_json1_1UserStackAssociation = (output: any, context: __SerdeContext): UserStackAssociation => { @@ -6325,14 +6617,28 @@ const deserializeAws_json1_1UserStackAssociationErrorList = ( output: any, context: __SerdeContext ): UserStackAssociationError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserStackAssociationError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserStackAssociationError(entry, context); + }); }; const deserializeAws_json1_1UserStackAssociationList = ( output: any, context: __SerdeContext ): UserStackAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserStackAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserStackAssociation(entry, context); + }); }; const deserializeAws_json1_1VpcConfig = (output: any, context: __SerdeContext): VpcConfig => { @@ -6398,3 +6704,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-appsync/protocols/Aws_restJson1.ts b/clients/client-appsync/protocols/Aws_restJson1.ts index 99f50f2dd805..e7283e719758 100644 --- a/clients/client-appsync/protocols/Aws_restJson1.ts +++ b/clients/client-appsync/protocols/Aws_restJson1.ts @@ -109,7 +109,7 @@ export const serializeAws_restJson1CreateApiCacheCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/ApiCaches"; if (input.apiId !== undefined) { @@ -123,11 +123,14 @@ export const serializeAws_restJson1CreateApiCacheCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.apiCachingBehavior !== undefined && { apiCachingBehavior: input.apiCachingBehavior }), - ...(input.atRestEncryptionEnabled !== undefined && { atRestEncryptionEnabled: input.atRestEncryptionEnabled }), - ...(input.transitEncryptionEnabled !== undefined && { transitEncryptionEnabled: input.transitEncryptionEnabled }), - ...(input.ttl !== undefined && { ttl: input.ttl }), - ...(input.type !== undefined && { type: input.type }), + ...(input.apiCachingBehavior !== undefined && + input.apiCachingBehavior !== null && { apiCachingBehavior: input.apiCachingBehavior }), + ...(input.atRestEncryptionEnabled !== undefined && + input.atRestEncryptionEnabled !== null && { atRestEncryptionEnabled: input.atRestEncryptionEnabled }), + ...(input.transitEncryptionEnabled !== undefined && + input.transitEncryptionEnabled !== null && { transitEncryptionEnabled: input.transitEncryptionEnabled }), + ...(input.ttl !== undefined && input.ttl !== null && { ttl: input.ttl }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -146,7 +149,7 @@ export const serializeAws_restJson1CreateApiKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/apikeys"; if (input.apiId !== undefined) { @@ -160,8 +163,8 @@ export const serializeAws_restJson1CreateApiKeyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.expires !== undefined && { expires: input.expires }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.expires !== undefined && input.expires !== null && { expires: input.expires }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -180,7 +183,7 @@ export const serializeAws_restJson1CreateDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/datasources"; if (input.apiId !== undefined) { @@ -194,28 +197,34 @@ export const serializeAws_restJson1CreateDataSourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.dynamodbConfig !== undefined && { - dynamodbConfig: serializeAws_restJson1DynamodbDataSourceConfig(input.dynamodbConfig, context), - }), - ...(input.elasticsearchConfig !== undefined && { - elasticsearchConfig: serializeAws_restJson1ElasticsearchDataSourceConfig(input.elasticsearchConfig, context), - }), - ...(input.httpConfig !== undefined && { - httpConfig: serializeAws_restJson1HttpDataSourceConfig(input.httpConfig, context), - }), - ...(input.lambdaConfig !== undefined && { - lambdaConfig: serializeAws_restJson1LambdaDataSourceConfig(input.lambdaConfig, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.relationalDatabaseConfig !== undefined && { - relationalDatabaseConfig: serializeAws_restJson1RelationalDatabaseDataSourceConfig( - input.relationalDatabaseConfig, - context - ), - }), - ...(input.serviceRoleArn !== undefined && { serviceRoleArn: input.serviceRoleArn }), - ...(input.type !== undefined && { type: input.type }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.dynamodbConfig !== undefined && + input.dynamodbConfig !== null && { + dynamodbConfig: serializeAws_restJson1DynamodbDataSourceConfig(input.dynamodbConfig, context), + }), + ...(input.elasticsearchConfig !== undefined && + input.elasticsearchConfig !== null && { + elasticsearchConfig: serializeAws_restJson1ElasticsearchDataSourceConfig(input.elasticsearchConfig, context), + }), + ...(input.httpConfig !== undefined && + input.httpConfig !== null && { + httpConfig: serializeAws_restJson1HttpDataSourceConfig(input.httpConfig, context), + }), + ...(input.lambdaConfig !== undefined && + input.lambdaConfig !== null && { + lambdaConfig: serializeAws_restJson1LambdaDataSourceConfig(input.lambdaConfig, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.relationalDatabaseConfig !== undefined && + input.relationalDatabaseConfig !== null && { + relationalDatabaseConfig: serializeAws_restJson1RelationalDatabaseDataSourceConfig( + input.relationalDatabaseConfig, + context + ), + }), + ...(input.serviceRoleArn !== undefined && + input.serviceRoleArn !== null && { serviceRoleArn: input.serviceRoleArn }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -234,7 +243,7 @@ export const serializeAws_restJson1CreateFunctionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/functions"; if (input.apiId !== undefined) { @@ -248,12 +257,16 @@ export const serializeAws_restJson1CreateFunctionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.dataSourceName !== undefined && { dataSourceName: input.dataSourceName }), - ...(input.description !== undefined && { description: input.description }), - ...(input.functionVersion !== undefined && { functionVersion: input.functionVersion }), - ...(input.name !== undefined && { name: input.name }), - ...(input.requestMappingTemplate !== undefined && { requestMappingTemplate: input.requestMappingTemplate }), - ...(input.responseMappingTemplate !== undefined && { responseMappingTemplate: input.responseMappingTemplate }), + ...(input.dataSourceName !== undefined && + input.dataSourceName !== null && { dataSourceName: input.dataSourceName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.functionVersion !== undefined && + input.functionVersion !== null && { functionVersion: input.functionVersion }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.requestMappingTemplate !== undefined && + input.requestMappingTemplate !== null && { requestMappingTemplate: input.requestMappingTemplate }), + ...(input.responseMappingTemplate !== undefined && + input.responseMappingTemplate !== null && { responseMappingTemplate: input.responseMappingTemplate }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -272,28 +285,33 @@ export const serializeAws_restJson1CreateGraphqlApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis"; let body: any; body = JSON.stringify({ - ...(input.additionalAuthenticationProviders !== undefined && { - additionalAuthenticationProviders: serializeAws_restJson1AdditionalAuthenticationProviders( - input.additionalAuthenticationProviders, - context - ), - }), - ...(input.authenticationType !== undefined && { authenticationType: input.authenticationType }), - ...(input.logConfig !== undefined && { logConfig: serializeAws_restJson1LogConfig(input.logConfig, context) }), - ...(input.name !== undefined && { name: input.name }), - ...(input.openIDConnectConfig !== undefined && { - openIDConnectConfig: serializeAws_restJson1OpenIDConnectConfig(input.openIDConnectConfig, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.userPoolConfig !== undefined && { - userPoolConfig: serializeAws_restJson1UserPoolConfig(input.userPoolConfig, context), - }), - ...(input.xrayEnabled !== undefined && { xrayEnabled: input.xrayEnabled }), + ...(input.additionalAuthenticationProviders !== undefined && + input.additionalAuthenticationProviders !== null && { + additionalAuthenticationProviders: serializeAws_restJson1AdditionalAuthenticationProviders( + input.additionalAuthenticationProviders, + context + ), + }), + ...(input.authenticationType !== undefined && + input.authenticationType !== null && { authenticationType: input.authenticationType }), + ...(input.logConfig !== undefined && + input.logConfig !== null && { logConfig: serializeAws_restJson1LogConfig(input.logConfig, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.openIDConnectConfig !== undefined && + input.openIDConnectConfig !== null && { + openIDConnectConfig: serializeAws_restJson1OpenIDConnectConfig(input.openIDConnectConfig, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.userPoolConfig !== undefined && + input.userPoolConfig !== null && { + userPoolConfig: serializeAws_restJson1UserPoolConfig(input.userPoolConfig, context), + }), + ...(input.xrayEnabled !== undefined && input.xrayEnabled !== null && { xrayEnabled: input.xrayEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -312,7 +330,7 @@ export const serializeAws_restJson1CreateResolverCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/types/{typeName}/resolvers"; if (input.typeName !== undefined) { @@ -335,18 +353,24 @@ export const serializeAws_restJson1CreateResolverCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.cachingConfig !== undefined && { - cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context), - }), - ...(input.dataSourceName !== undefined && { dataSourceName: input.dataSourceName }), - ...(input.fieldName !== undefined && { fieldName: input.fieldName }), - ...(input.kind !== undefined && { kind: input.kind }), - ...(input.pipelineConfig !== undefined && { - pipelineConfig: serializeAws_restJson1PipelineConfig(input.pipelineConfig, context), - }), - ...(input.requestMappingTemplate !== undefined && { requestMappingTemplate: input.requestMappingTemplate }), - ...(input.responseMappingTemplate !== undefined && { responseMappingTemplate: input.responseMappingTemplate }), - ...(input.syncConfig !== undefined && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }), + ...(input.cachingConfig !== undefined && + input.cachingConfig !== null && { + cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context), + }), + ...(input.dataSourceName !== undefined && + input.dataSourceName !== null && { dataSourceName: input.dataSourceName }), + ...(input.fieldName !== undefined && input.fieldName !== null && { fieldName: input.fieldName }), + ...(input.kind !== undefined && input.kind !== null && { kind: input.kind }), + ...(input.pipelineConfig !== undefined && + input.pipelineConfig !== null && { + pipelineConfig: serializeAws_restJson1PipelineConfig(input.pipelineConfig, context), + }), + ...(input.requestMappingTemplate !== undefined && + input.requestMappingTemplate !== null && { requestMappingTemplate: input.requestMappingTemplate }), + ...(input.responseMappingTemplate !== undefined && + input.responseMappingTemplate !== null && { responseMappingTemplate: input.responseMappingTemplate }), + ...(input.syncConfig !== undefined && + input.syncConfig !== null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -365,7 +389,7 @@ export const serializeAws_restJson1CreateTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/types"; if (input.apiId !== undefined) { @@ -379,8 +403,8 @@ export const serializeAws_restJson1CreateTypeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.definition !== undefined && { definition: input.definition }), - ...(input.format !== undefined && { format: input.format }), + ...(input.definition !== undefined && input.definition !== null && { definition: input.definition }), + ...(input.format !== undefined && input.format !== null && { format: input.format }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -398,9 +422,7 @@ export const serializeAws_restJson1DeleteApiCacheCommand = async ( input: DeleteApiCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/ApiCaches"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -428,9 +450,7 @@ export const serializeAws_restJson1DeleteApiKeyCommand = async ( input: DeleteApiKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/apikeys/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -467,9 +487,7 @@ export const serializeAws_restJson1DeleteDataSourceCommand = async ( input: DeleteDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/datasources/{name}"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -506,9 +524,7 @@ export const serializeAws_restJson1DeleteFunctionCommand = async ( input: DeleteFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/functions/{functionId}"; if (input.functionId !== undefined) { const labelValue: string = input.functionId; @@ -545,9 +561,7 @@ export const serializeAws_restJson1DeleteGraphqlApiCommand = async ( input: DeleteGraphqlApiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -575,9 +589,7 @@ export const serializeAws_restJson1DeleteResolverCommand = async ( input: DeleteResolverCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/types/{typeName}/resolvers/{fieldName}"; if (input.fieldName !== undefined) { const labelValue: string = input.fieldName; @@ -623,9 +635,7 @@ export const serializeAws_restJson1DeleteTypeCommand = async ( input: DeleteTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/types/{typeName}"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -662,9 +672,7 @@ export const serializeAws_restJson1FlushApiCacheCommand = async ( input: FlushApiCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/FlushCache"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -692,9 +700,7 @@ export const serializeAws_restJson1GetApiCacheCommand = async ( input: GetApiCacheCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/ApiCaches"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -722,9 +728,7 @@ export const serializeAws_restJson1GetDataSourceCommand = async ( input: GetDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/datasources/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -761,9 +765,7 @@ export const serializeAws_restJson1GetFunctionCommand = async ( input: GetFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/functions/{functionId}"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -800,9 +802,7 @@ export const serializeAws_restJson1GetGraphqlApiCommand = async ( input: GetGraphqlApiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -830,9 +830,7 @@ export const serializeAws_restJson1GetIntrospectionSchemaCommand = async ( input: GetIntrospectionSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/schema"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -865,9 +863,7 @@ export const serializeAws_restJson1GetResolverCommand = async ( input: GetResolverCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/types/{typeName}/resolvers/{fieldName}"; if (input.fieldName !== undefined) { const labelValue: string = input.fieldName; @@ -913,9 +909,7 @@ export const serializeAws_restJson1GetSchemaCreationStatusCommand = async ( input: GetSchemaCreationStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/schemacreation"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -943,9 +937,7 @@ export const serializeAws_restJson1GetTypeCommand = async ( input: GetTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/types/{typeName}"; if (input.typeName !== undefined) { const labelValue: string = input.typeName; @@ -986,9 +978,7 @@ export const serializeAws_restJson1ListApiKeysCommand = async ( input: ListApiKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/apikeys"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -1021,9 +1011,7 @@ export const serializeAws_restJson1ListDataSourcesCommand = async ( input: ListDataSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/datasources"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -1056,9 +1044,7 @@ export const serializeAws_restJson1ListFunctionsCommand = async ( input: ListFunctionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/functions"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -1091,9 +1077,7 @@ export const serializeAws_restJson1ListGraphqlApisCommand = async ( input: ListGraphqlApisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -1117,9 +1101,7 @@ export const serializeAws_restJson1ListResolversCommand = async ( input: ListResolversCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/types/{typeName}/resolvers"; if (input.typeName !== undefined) { const labelValue: string = input.typeName; @@ -1161,9 +1143,7 @@ export const serializeAws_restJson1ListResolversByFunctionCommand = async ( input: ListResolversByFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/functions/{functionId}/resolvers"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -1205,9 +1185,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1235,9 +1213,7 @@ export const serializeAws_restJson1ListTypesCommand = async ( input: ListTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/apis/{apiId}/types"; if (input.apiId !== undefined) { const labelValue: string = input.apiId; @@ -1272,7 +1248,7 @@ export const serializeAws_restJson1StartSchemaCreationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/schemacreation"; if (input.apiId !== undefined) { @@ -1286,7 +1262,8 @@ export const serializeAws_restJson1StartSchemaCreationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.definition !== undefined && { definition: context.base64Encoder(input.definition) }), + ...(input.definition !== undefined && + input.definition !== null && { definition: context.base64Encoder(input.definition) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1305,7 +1282,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -1319,7 +1296,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1337,9 +1314,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1372,7 +1347,7 @@ export const serializeAws_restJson1UpdateApiCacheCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/ApiCaches/update"; if (input.apiId !== undefined) { @@ -1386,9 +1361,10 @@ export const serializeAws_restJson1UpdateApiCacheCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.apiCachingBehavior !== undefined && { apiCachingBehavior: input.apiCachingBehavior }), - ...(input.ttl !== undefined && { ttl: input.ttl }), - ...(input.type !== undefined && { type: input.type }), + ...(input.apiCachingBehavior !== undefined && + input.apiCachingBehavior !== null && { apiCachingBehavior: input.apiCachingBehavior }), + ...(input.ttl !== undefined && input.ttl !== null && { ttl: input.ttl }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1407,7 +1383,7 @@ export const serializeAws_restJson1UpdateApiKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/apikeys/{id}"; if (input.id !== undefined) { @@ -1430,8 +1406,8 @@ export const serializeAws_restJson1UpdateApiKeyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.expires !== undefined && { expires: input.expires }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.expires !== undefined && input.expires !== null && { expires: input.expires }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1450,7 +1426,7 @@ export const serializeAws_restJson1UpdateDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/datasources/{name}"; if (input.apiId !== undefined) { @@ -1473,27 +1449,33 @@ export const serializeAws_restJson1UpdateDataSourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.dynamodbConfig !== undefined && { - dynamodbConfig: serializeAws_restJson1DynamodbDataSourceConfig(input.dynamodbConfig, context), - }), - ...(input.elasticsearchConfig !== undefined && { - elasticsearchConfig: serializeAws_restJson1ElasticsearchDataSourceConfig(input.elasticsearchConfig, context), - }), - ...(input.httpConfig !== undefined && { - httpConfig: serializeAws_restJson1HttpDataSourceConfig(input.httpConfig, context), - }), - ...(input.lambdaConfig !== undefined && { - lambdaConfig: serializeAws_restJson1LambdaDataSourceConfig(input.lambdaConfig, context), - }), - ...(input.relationalDatabaseConfig !== undefined && { - relationalDatabaseConfig: serializeAws_restJson1RelationalDatabaseDataSourceConfig( - input.relationalDatabaseConfig, - context - ), - }), - ...(input.serviceRoleArn !== undefined && { serviceRoleArn: input.serviceRoleArn }), - ...(input.type !== undefined && { type: input.type }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.dynamodbConfig !== undefined && + input.dynamodbConfig !== null && { + dynamodbConfig: serializeAws_restJson1DynamodbDataSourceConfig(input.dynamodbConfig, context), + }), + ...(input.elasticsearchConfig !== undefined && + input.elasticsearchConfig !== null && { + elasticsearchConfig: serializeAws_restJson1ElasticsearchDataSourceConfig(input.elasticsearchConfig, context), + }), + ...(input.httpConfig !== undefined && + input.httpConfig !== null && { + httpConfig: serializeAws_restJson1HttpDataSourceConfig(input.httpConfig, context), + }), + ...(input.lambdaConfig !== undefined && + input.lambdaConfig !== null && { + lambdaConfig: serializeAws_restJson1LambdaDataSourceConfig(input.lambdaConfig, context), + }), + ...(input.relationalDatabaseConfig !== undefined && + input.relationalDatabaseConfig !== null && { + relationalDatabaseConfig: serializeAws_restJson1RelationalDatabaseDataSourceConfig( + input.relationalDatabaseConfig, + context + ), + }), + ...(input.serviceRoleArn !== undefined && + input.serviceRoleArn !== null && { serviceRoleArn: input.serviceRoleArn }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1512,7 +1494,7 @@ export const serializeAws_restJson1UpdateFunctionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/functions/{functionId}"; if (input.functionId !== undefined) { @@ -1535,12 +1517,16 @@ export const serializeAws_restJson1UpdateFunctionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.dataSourceName !== undefined && { dataSourceName: input.dataSourceName }), - ...(input.description !== undefined && { description: input.description }), - ...(input.functionVersion !== undefined && { functionVersion: input.functionVersion }), - ...(input.name !== undefined && { name: input.name }), - ...(input.requestMappingTemplate !== undefined && { requestMappingTemplate: input.requestMappingTemplate }), - ...(input.responseMappingTemplate !== undefined && { responseMappingTemplate: input.responseMappingTemplate }), + ...(input.dataSourceName !== undefined && + input.dataSourceName !== null && { dataSourceName: input.dataSourceName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.functionVersion !== undefined && + input.functionVersion !== null && { functionVersion: input.functionVersion }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.requestMappingTemplate !== undefined && + input.requestMappingTemplate !== null && { requestMappingTemplate: input.requestMappingTemplate }), + ...(input.responseMappingTemplate !== undefined && + input.responseMappingTemplate !== null && { responseMappingTemplate: input.responseMappingTemplate }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1559,7 +1545,7 @@ export const serializeAws_restJson1UpdateGraphqlApiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}"; if (input.apiId !== undefined) { @@ -1573,22 +1559,27 @@ export const serializeAws_restJson1UpdateGraphqlApiCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.additionalAuthenticationProviders !== undefined && { - additionalAuthenticationProviders: serializeAws_restJson1AdditionalAuthenticationProviders( - input.additionalAuthenticationProviders, - context - ), - }), - ...(input.authenticationType !== undefined && { authenticationType: input.authenticationType }), - ...(input.logConfig !== undefined && { logConfig: serializeAws_restJson1LogConfig(input.logConfig, context) }), - ...(input.name !== undefined && { name: input.name }), - ...(input.openIDConnectConfig !== undefined && { - openIDConnectConfig: serializeAws_restJson1OpenIDConnectConfig(input.openIDConnectConfig, context), - }), - ...(input.userPoolConfig !== undefined && { - userPoolConfig: serializeAws_restJson1UserPoolConfig(input.userPoolConfig, context), - }), - ...(input.xrayEnabled !== undefined && { xrayEnabled: input.xrayEnabled }), + ...(input.additionalAuthenticationProviders !== undefined && + input.additionalAuthenticationProviders !== null && { + additionalAuthenticationProviders: serializeAws_restJson1AdditionalAuthenticationProviders( + input.additionalAuthenticationProviders, + context + ), + }), + ...(input.authenticationType !== undefined && + input.authenticationType !== null && { authenticationType: input.authenticationType }), + ...(input.logConfig !== undefined && + input.logConfig !== null && { logConfig: serializeAws_restJson1LogConfig(input.logConfig, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.openIDConnectConfig !== undefined && + input.openIDConnectConfig !== null && { + openIDConnectConfig: serializeAws_restJson1OpenIDConnectConfig(input.openIDConnectConfig, context), + }), + ...(input.userPoolConfig !== undefined && + input.userPoolConfig !== null && { + userPoolConfig: serializeAws_restJson1UserPoolConfig(input.userPoolConfig, context), + }), + ...(input.xrayEnabled !== undefined && input.xrayEnabled !== null && { xrayEnabled: input.xrayEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1607,7 +1598,7 @@ export const serializeAws_restJson1UpdateResolverCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/types/{typeName}/resolvers/{fieldName}"; if (input.fieldName !== undefined) { @@ -1639,17 +1630,23 @@ export const serializeAws_restJson1UpdateResolverCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.cachingConfig !== undefined && { - cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context), - }), - ...(input.dataSourceName !== undefined && { dataSourceName: input.dataSourceName }), - ...(input.kind !== undefined && { kind: input.kind }), - ...(input.pipelineConfig !== undefined && { - pipelineConfig: serializeAws_restJson1PipelineConfig(input.pipelineConfig, context), - }), - ...(input.requestMappingTemplate !== undefined && { requestMappingTemplate: input.requestMappingTemplate }), - ...(input.responseMappingTemplate !== undefined && { responseMappingTemplate: input.responseMappingTemplate }), - ...(input.syncConfig !== undefined && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }), + ...(input.cachingConfig !== undefined && + input.cachingConfig !== null && { + cachingConfig: serializeAws_restJson1CachingConfig(input.cachingConfig, context), + }), + ...(input.dataSourceName !== undefined && + input.dataSourceName !== null && { dataSourceName: input.dataSourceName }), + ...(input.kind !== undefined && input.kind !== null && { kind: input.kind }), + ...(input.pipelineConfig !== undefined && + input.pipelineConfig !== null && { + pipelineConfig: serializeAws_restJson1PipelineConfig(input.pipelineConfig, context), + }), + ...(input.requestMappingTemplate !== undefined && + input.requestMappingTemplate !== null && { requestMappingTemplate: input.requestMappingTemplate }), + ...(input.responseMappingTemplate !== undefined && + input.responseMappingTemplate !== null && { responseMappingTemplate: input.responseMappingTemplate }), + ...(input.syncConfig !== undefined && + input.syncConfig !== null && { syncConfig: serializeAws_restJson1SyncConfig(input.syncConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1668,7 +1665,7 @@ export const serializeAws_restJson1UpdateTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/apis/{apiId}/types/{typeName}"; if (input.typeName !== undefined) { @@ -1691,8 +1688,8 @@ export const serializeAws_restJson1UpdateTypeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.definition !== undefined && { definition: input.definition }), - ...(input.format !== undefined && { format: input.format }), + ...(input.definition !== undefined && input.definition !== null && { definition: input.definition }), + ...(input.format !== undefined && input.format !== null && { format: input.format }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5367,13 +5364,16 @@ const serializeAws_restJson1AdditionalAuthenticationProvider = ( context: __SerdeContext ): any => { return { - ...(input.authenticationType !== undefined && { authenticationType: input.authenticationType }), - ...(input.openIDConnectConfig !== undefined && { - openIDConnectConfig: serializeAws_restJson1OpenIDConnectConfig(input.openIDConnectConfig, context), - }), - ...(input.userPoolConfig !== undefined && { - userPoolConfig: serializeAws_restJson1CognitoUserPoolConfig(input.userPoolConfig, context), - }), + ...(input.authenticationType !== undefined && + input.authenticationType !== null && { authenticationType: input.authenticationType }), + ...(input.openIDConnectConfig !== undefined && + input.openIDConnectConfig !== null && { + openIDConnectConfig: serializeAws_restJson1OpenIDConnectConfig(input.openIDConnectConfig, context), + }), + ...(input.userPoolConfig !== undefined && + input.userPoolConfig !== null && { + userPoolConfig: serializeAws_restJson1CognitoUserPoolConfig(input.userPoolConfig, context), + }), }; }; @@ -5381,51 +5381,68 @@ const serializeAws_restJson1AdditionalAuthenticationProviders = ( input: AdditionalAuthenticationProvider[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AdditionalAuthenticationProvider(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AdditionalAuthenticationProvider(entry, context); + }); }; const serializeAws_restJson1AuthorizationConfig = (input: AuthorizationConfig, context: __SerdeContext): any => { return { - ...(input.authorizationType !== undefined && { authorizationType: input.authorizationType }), - ...(input.awsIamConfig !== undefined && { - awsIamConfig: serializeAws_restJson1AwsIamConfig(input.awsIamConfig, context), - }), + ...(input.authorizationType !== undefined && + input.authorizationType !== null && { authorizationType: input.authorizationType }), + ...(input.awsIamConfig !== undefined && + input.awsIamConfig !== null && { awsIamConfig: serializeAws_restJson1AwsIamConfig(input.awsIamConfig, context) }), }; }; const serializeAws_restJson1AwsIamConfig = (input: AwsIamConfig, context: __SerdeContext): any => { return { - ...(input.signingRegion !== undefined && { signingRegion: input.signingRegion }), - ...(input.signingServiceName !== undefined && { signingServiceName: input.signingServiceName }), + ...(input.signingRegion !== undefined && input.signingRegion !== null && { signingRegion: input.signingRegion }), + ...(input.signingServiceName !== undefined && + input.signingServiceName !== null && { signingServiceName: input.signingServiceName }), }; }; const serializeAws_restJson1CachingConfig = (input: CachingConfig, context: __SerdeContext): any => { return { - ...(input.cachingKeys !== undefined && { - cachingKeys: serializeAws_restJson1CachingKeys(input.cachingKeys, context), - }), - ...(input.ttl !== undefined && { ttl: input.ttl }), + ...(input.cachingKeys !== undefined && + input.cachingKeys !== null && { cachingKeys: serializeAws_restJson1CachingKeys(input.cachingKeys, context) }), + ...(input.ttl !== undefined && input.ttl !== null && { ttl: input.ttl }), }; }; const serializeAws_restJson1CachingKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1CognitoUserPoolConfig = (input: CognitoUserPoolConfig, context: __SerdeContext): any => { return { - ...(input.appIdClientRegex !== undefined && { appIdClientRegex: input.appIdClientRegex }), - ...(input.awsRegion !== undefined && { awsRegion: input.awsRegion }), - ...(input.userPoolId !== undefined && { userPoolId: input.userPoolId }), + ...(input.appIdClientRegex !== undefined && + input.appIdClientRegex !== null && { appIdClientRegex: input.appIdClientRegex }), + ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }), + ...(input.userPoolId !== undefined && input.userPoolId !== null && { userPoolId: input.userPoolId }), }; }; const serializeAws_restJson1DeltaSyncConfig = (input: DeltaSyncConfig, context: __SerdeContext): any => { return { - ...(input.baseTableTTL !== undefined && { baseTableTTL: input.baseTableTTL }), - ...(input.deltaSyncTableName !== undefined && { deltaSyncTableName: input.deltaSyncTableName }), - ...(input.deltaSyncTableTTL !== undefined && { deltaSyncTableTTL: input.deltaSyncTableTTL }), + ...(input.baseTableTTL !== undefined && input.baseTableTTL !== null && { baseTableTTL: input.baseTableTTL }), + ...(input.deltaSyncTableName !== undefined && + input.deltaSyncTableName !== null && { deltaSyncTableName: input.deltaSyncTableName }), + ...(input.deltaSyncTableTTL !== undefined && + input.deltaSyncTableTTL !== null && { deltaSyncTableTTL: input.deltaSyncTableTTL }), }; }; @@ -5434,13 +5451,15 @@ const serializeAws_restJson1DynamodbDataSourceConfig = ( context: __SerdeContext ): any => { return { - ...(input.awsRegion !== undefined && { awsRegion: input.awsRegion }), - ...(input.deltaSyncConfig !== undefined && { - deltaSyncConfig: serializeAws_restJson1DeltaSyncConfig(input.deltaSyncConfig, context), - }), - ...(input.tableName !== undefined && { tableName: input.tableName }), - ...(input.useCallerCredentials !== undefined && { useCallerCredentials: input.useCallerCredentials }), - ...(input.versioned !== undefined && { versioned: input.versioned }), + ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }), + ...(input.deltaSyncConfig !== undefined && + input.deltaSyncConfig !== null && { + deltaSyncConfig: serializeAws_restJson1DeltaSyncConfig(input.deltaSyncConfig, context), + }), + ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }), + ...(input.useCallerCredentials !== undefined && + input.useCallerCredentials !== null && { useCallerCredentials: input.useCallerCredentials }), + ...(input.versioned !== undefined && input.versioned !== null && { versioned: input.versioned }), }; }; @@ -5449,21 +5468,29 @@ const serializeAws_restJson1ElasticsearchDataSourceConfig = ( context: __SerdeContext ): any => { return { - ...(input.awsRegion !== undefined && { awsRegion: input.awsRegion }), - ...(input.endpoint !== undefined && { endpoint: input.endpoint }), + ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }), + ...(input.endpoint !== undefined && input.endpoint !== null && { endpoint: input.endpoint }), }; }; const serializeAws_restJson1FunctionsIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1HttpDataSourceConfig = (input: HttpDataSourceConfig, context: __SerdeContext): any => { return { - ...(input.authorizationConfig !== undefined && { - authorizationConfig: serializeAws_restJson1AuthorizationConfig(input.authorizationConfig, context), - }), - ...(input.endpoint !== undefined && { endpoint: input.endpoint }), + ...(input.authorizationConfig !== undefined && + input.authorizationConfig !== null && { + authorizationConfig: serializeAws_restJson1AuthorizationConfig(input.authorizationConfig, context), + }), + ...(input.endpoint !== undefined && input.endpoint !== null && { endpoint: input.endpoint }), }; }; @@ -5472,46 +5499,53 @@ const serializeAws_restJson1LambdaConflictHandlerConfig = ( context: __SerdeContext ): any => { return { - ...(input.lambdaConflictHandlerArn !== undefined && { lambdaConflictHandlerArn: input.lambdaConflictHandlerArn }), + ...(input.lambdaConflictHandlerArn !== undefined && + input.lambdaConflictHandlerArn !== null && { lambdaConflictHandlerArn: input.lambdaConflictHandlerArn }), }; }; const serializeAws_restJson1LambdaDataSourceConfig = (input: LambdaDataSourceConfig, context: __SerdeContext): any => { return { - ...(input.lambdaFunctionArn !== undefined && { lambdaFunctionArn: input.lambdaFunctionArn }), + ...(input.lambdaFunctionArn !== undefined && + input.lambdaFunctionArn !== null && { lambdaFunctionArn: input.lambdaFunctionArn }), }; }; const serializeAws_restJson1LogConfig = (input: LogConfig, context: __SerdeContext): any => { return { - ...(input.cloudWatchLogsRoleArn !== undefined && { cloudWatchLogsRoleArn: input.cloudWatchLogsRoleArn }), - ...(input.excludeVerboseContent !== undefined && { excludeVerboseContent: input.excludeVerboseContent }), - ...(input.fieldLogLevel !== undefined && { fieldLogLevel: input.fieldLogLevel }), + ...(input.cloudWatchLogsRoleArn !== undefined && + input.cloudWatchLogsRoleArn !== null && { cloudWatchLogsRoleArn: input.cloudWatchLogsRoleArn }), + ...(input.excludeVerboseContent !== undefined && + input.excludeVerboseContent !== null && { excludeVerboseContent: input.excludeVerboseContent }), + ...(input.fieldLogLevel !== undefined && input.fieldLogLevel !== null && { fieldLogLevel: input.fieldLogLevel }), }; }; const serializeAws_restJson1OpenIDConnectConfig = (input: OpenIDConnectConfig, context: __SerdeContext): any => { return { - ...(input.authTTL !== undefined && { authTTL: input.authTTL }), - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.iatTTL !== undefined && { iatTTL: input.iatTTL }), - ...(input.issuer !== undefined && { issuer: input.issuer }), + ...(input.authTTL !== undefined && input.authTTL !== null && { authTTL: input.authTTL }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.iatTTL !== undefined && input.iatTTL !== null && { iatTTL: input.iatTTL }), + ...(input.issuer !== undefined && input.issuer !== null && { issuer: input.issuer }), }; }; const serializeAws_restJson1PipelineConfig = (input: PipelineConfig, context: __SerdeContext): any => { return { - ...(input.functions !== undefined && { functions: serializeAws_restJson1FunctionsIds(input.functions, context) }), + ...(input.functions !== undefined && + input.functions !== null && { functions: serializeAws_restJson1FunctionsIds(input.functions, context) }), }; }; const serializeAws_restJson1RdsHttpEndpointConfig = (input: RdsHttpEndpointConfig, context: __SerdeContext): any => { return { - ...(input.awsRegion !== undefined && { awsRegion: input.awsRegion }), - ...(input.awsSecretStoreArn !== undefined && { awsSecretStoreArn: input.awsSecretStoreArn }), - ...(input.databaseName !== undefined && { databaseName: input.databaseName }), - ...(input.dbClusterIdentifier !== undefined && { dbClusterIdentifier: input.dbClusterIdentifier }), - ...(input.schema !== undefined && { schema: input.schema }), + ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }), + ...(input.awsSecretStoreArn !== undefined && + input.awsSecretStoreArn !== null && { awsSecretStoreArn: input.awsSecretStoreArn }), + ...(input.databaseName !== undefined && input.databaseName !== null && { databaseName: input.databaseName }), + ...(input.dbClusterIdentifier !== undefined && + input.dbClusterIdentifier !== null && { dbClusterIdentifier: input.dbClusterIdentifier }), + ...(input.schema !== undefined && input.schema !== null && { schema: input.schema }), }; }; @@ -5520,44 +5554,52 @@ const serializeAws_restJson1RelationalDatabaseDataSourceConfig = ( context: __SerdeContext ): any => { return { - ...(input.rdsHttpEndpointConfig !== undefined && { - rdsHttpEndpointConfig: serializeAws_restJson1RdsHttpEndpointConfig(input.rdsHttpEndpointConfig, context), - }), - ...(input.relationalDatabaseSourceType !== undefined && { - relationalDatabaseSourceType: input.relationalDatabaseSourceType, - }), + ...(input.rdsHttpEndpointConfig !== undefined && + input.rdsHttpEndpointConfig !== null && { + rdsHttpEndpointConfig: serializeAws_restJson1RdsHttpEndpointConfig(input.rdsHttpEndpointConfig, context), + }), + ...(input.relationalDatabaseSourceType !== undefined && + input.relationalDatabaseSourceType !== null && { + relationalDatabaseSourceType: input.relationalDatabaseSourceType, + }), }; }; const serializeAws_restJson1SyncConfig = (input: SyncConfig, context: __SerdeContext): any => { return { - ...(input.conflictDetection !== undefined && { conflictDetection: input.conflictDetection }), - ...(input.conflictHandler !== undefined && { conflictHandler: input.conflictHandler }), - ...(input.lambdaConflictHandlerConfig !== undefined && { - lambdaConflictHandlerConfig: serializeAws_restJson1LambdaConflictHandlerConfig( - input.lambdaConflictHandlerConfig, - context - ), - }), + ...(input.conflictDetection !== undefined && + input.conflictDetection !== null && { conflictDetection: input.conflictDetection }), + ...(input.conflictHandler !== undefined && + input.conflictHandler !== null && { conflictHandler: input.conflictHandler }), + ...(input.lambdaConflictHandlerConfig !== undefined && + input.lambdaConflictHandlerConfig !== null && { + lambdaConflictHandlerConfig: serializeAws_restJson1LambdaConflictHandlerConfig( + input.lambdaConflictHandlerConfig, + context + ), + }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1UserPoolConfig = (input: UserPoolConfig, context: __SerdeContext): any => { return { - ...(input.appIdClientRegex !== undefined && { appIdClientRegex: input.appIdClientRegex }), - ...(input.awsRegion !== undefined && { awsRegion: input.awsRegion }), - ...(input.defaultAction !== undefined && { defaultAction: input.defaultAction }), - ...(input.userPoolId !== undefined && { userPoolId: input.userPoolId }), + ...(input.appIdClientRegex !== undefined && + input.appIdClientRegex !== null && { appIdClientRegex: input.appIdClientRegex }), + ...(input.awsRegion !== undefined && input.awsRegion !== null && { awsRegion: input.awsRegion }), + ...(input.defaultAction !== undefined && input.defaultAction !== null && { defaultAction: input.defaultAction }), + ...(input.userPoolId !== undefined && input.userPoolId !== null && { userPoolId: input.userPoolId }), }; }; @@ -5585,7 +5627,14 @@ const deserializeAws_restJson1AdditionalAuthenticationProviders = ( output: any, context: __SerdeContext ): AdditionalAuthenticationProvider[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AdditionalAuthenticationProvider(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AdditionalAuthenticationProvider(entry, context); + }); }; const deserializeAws_restJson1ApiCache = (output: any, context: __SerdeContext): ApiCache => { @@ -5618,7 +5667,14 @@ const deserializeAws_restJson1ApiKey = (output: any, context: __SerdeContext): A }; const deserializeAws_restJson1ApiKeys = (output: any, context: __SerdeContext): ApiKey[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ApiKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ApiKey(entry, context); + }); }; const deserializeAws_restJson1AuthorizationConfig = (output: any, context: __SerdeContext): AuthorizationConfig => { @@ -5656,7 +5712,14 @@ const deserializeAws_restJson1CachingConfig = (output: any, context: __SerdeCont }; const deserializeAws_restJson1CachingKeys = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1CognitoUserPoolConfig = (output: any, context: __SerdeContext): CognitoUserPoolConfig => { @@ -5701,7 +5764,14 @@ const deserializeAws_restJson1DataSource = (output: any, context: __SerdeContext }; const deserializeAws_restJson1DataSources = (output: any, context: __SerdeContext): DataSource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataSource(entry, context); + }); }; const deserializeAws_restJson1DeltaSyncConfig = (output: any, context: __SerdeContext): DeltaSyncConfig => { @@ -5769,11 +5839,25 @@ const deserializeAws_restJson1FunctionConfiguration = (output: any, context: __S }; const deserializeAws_restJson1Functions = (output: any, context: __SerdeContext): FunctionConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FunctionConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FunctionConfiguration(entry, context); + }); }; const deserializeAws_restJson1FunctionsIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1GraphqlApi = (output: any, context: __SerdeContext): GraphqlApi => { @@ -5815,7 +5899,14 @@ const deserializeAws_restJson1GraphqlApi = (output: any, context: __SerdeContext }; const deserializeAws_restJson1GraphqlApis = (output: any, context: __SerdeContext): GraphqlApi[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GraphqlApi(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GraphqlApi(entry, context); + }); }; const deserializeAws_restJson1HttpDataSourceConfig = (output: any, context: __SerdeContext): HttpDataSourceConfig => { @@ -5871,13 +5962,15 @@ const deserializeAws_restJson1MapOfStringToString = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1OpenIDConnectConfig = (output: any, context: __SerdeContext): OpenIDConnectConfig => { @@ -5962,7 +6055,14 @@ const deserializeAws_restJson1Resolver = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Resolvers = (output: any, context: __SerdeContext): Resolver[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Resolver(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Resolver(entry, context); + }); }; const deserializeAws_restJson1SyncConfig = (output: any, context: __SerdeContext): SyncConfig => { @@ -5981,13 +6081,15 @@ const deserializeAws_restJson1SyncConfig = (output: any, context: __SerdeContext }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Type = (output: any, context: __SerdeContext): Type => { @@ -6001,7 +6103,14 @@ const deserializeAws_restJson1Type = (output: any, context: __SerdeContext): Typ }; const deserializeAws_restJson1TypeList = (output: any, context: __SerdeContext): Type[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Type(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Type(entry, context); + }); }; const deserializeAws_restJson1UserPoolConfig = (output: any, context: __SerdeContext): UserPoolConfig => { @@ -6035,6 +6144,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-athena/protocols/Aws_json1_1.ts b/clients/client-athena/protocols/Aws_json1_1.ts index e2effac07d9e..4b7d904938f0 100644 --- a/clients/client-athena/protocols/Aws_json1_1.ts +++ b/clients/client-athena/protocols/Aws_json1_1.ts @@ -142,7 +142,7 @@ export const serializeAws_json1_1BatchGetNamedQueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.BatchGetNamedQuery", }; let body: any; @@ -155,7 +155,7 @@ export const serializeAws_json1_1BatchGetQueryExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.BatchGetQueryExecution", }; let body: any; @@ -168,7 +168,7 @@ export const serializeAws_json1_1CreateDataCatalogCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.CreateDataCatalog", }; let body: any; @@ -181,7 +181,7 @@ export const serializeAws_json1_1CreateNamedQueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.CreateNamedQuery", }; let body: any; @@ -194,7 +194,7 @@ export const serializeAws_json1_1CreateWorkGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.CreateWorkGroup", }; let body: any; @@ -207,7 +207,7 @@ export const serializeAws_json1_1DeleteDataCatalogCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.DeleteDataCatalog", }; let body: any; @@ -220,7 +220,7 @@ export const serializeAws_json1_1DeleteNamedQueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.DeleteNamedQuery", }; let body: any; @@ -233,7 +233,7 @@ export const serializeAws_json1_1DeleteWorkGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.DeleteWorkGroup", }; let body: any; @@ -246,7 +246,7 @@ export const serializeAws_json1_1GetDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.GetDatabase", }; let body: any; @@ -259,7 +259,7 @@ export const serializeAws_json1_1GetDataCatalogCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.GetDataCatalog", }; let body: any; @@ -272,7 +272,7 @@ export const serializeAws_json1_1GetNamedQueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.GetNamedQuery", }; let body: any; @@ -285,7 +285,7 @@ export const serializeAws_json1_1GetQueryExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.GetQueryExecution", }; let body: any; @@ -298,7 +298,7 @@ export const serializeAws_json1_1GetQueryResultsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.GetQueryResults", }; let body: any; @@ -311,7 +311,7 @@ export const serializeAws_json1_1GetTableMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.GetTableMetadata", }; let body: any; @@ -324,7 +324,7 @@ export const serializeAws_json1_1GetWorkGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.GetWorkGroup", }; let body: any; @@ -337,7 +337,7 @@ export const serializeAws_json1_1ListDatabasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.ListDatabases", }; let body: any; @@ -350,7 +350,7 @@ export const serializeAws_json1_1ListDataCatalogsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.ListDataCatalogs", }; let body: any; @@ -363,7 +363,7 @@ export const serializeAws_json1_1ListNamedQueriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.ListNamedQueries", }; let body: any; @@ -376,7 +376,7 @@ export const serializeAws_json1_1ListQueryExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.ListQueryExecutions", }; let body: any; @@ -389,7 +389,7 @@ export const serializeAws_json1_1ListTableMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.ListTableMetadata", }; let body: any; @@ -402,7 +402,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.ListTagsForResource", }; let body: any; @@ -415,7 +415,7 @@ export const serializeAws_json1_1ListWorkGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.ListWorkGroups", }; let body: any; @@ -428,7 +428,7 @@ export const serializeAws_json1_1StartQueryExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.StartQueryExecution", }; let body: any; @@ -441,7 +441,7 @@ export const serializeAws_json1_1StopQueryExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.StopQueryExecution", }; let body: any; @@ -454,7 +454,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.TagResource", }; let body: any; @@ -467,7 +467,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.UntagResource", }; let body: any; @@ -480,7 +480,7 @@ export const serializeAws_json1_1UpdateDataCatalogCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.UpdateDataCatalog", }; let body: any; @@ -493,7 +493,7 @@ export const serializeAws_json1_1UpdateWorkGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonAthena.UpdateWorkGroup", }; let body: any; @@ -528,8 +528,7 @@ const deserializeAws_json1_1BatchGetNamedQueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -591,8 +590,7 @@ const deserializeAws_json1_1BatchGetQueryExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -654,8 +652,7 @@ const deserializeAws_json1_1CreateDataCatalogCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -717,8 +714,7 @@ const deserializeAws_json1_1CreateNamedQueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -780,8 +776,7 @@ const deserializeAws_json1_1CreateWorkGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -843,8 +838,7 @@ const deserializeAws_json1_1DeleteDataCatalogCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -906,8 +900,7 @@ const deserializeAws_json1_1DeleteNamedQueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -969,8 +962,7 @@ const deserializeAws_json1_1DeleteWorkGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1032,8 +1024,7 @@ const deserializeAws_json1_1GetDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1103,8 +1094,7 @@ const deserializeAws_json1_1GetDataCatalogCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1166,8 +1156,7 @@ const deserializeAws_json1_1GetNamedQueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1229,8 +1218,7 @@ const deserializeAws_json1_1GetQueryExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1292,8 +1280,7 @@ const deserializeAws_json1_1GetQueryResultsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1355,8 +1342,7 @@ const deserializeAws_json1_1GetTableMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1426,8 +1412,7 @@ const deserializeAws_json1_1GetWorkGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1489,8 +1474,7 @@ const deserializeAws_json1_1ListDatabasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1560,8 +1544,7 @@ const deserializeAws_json1_1ListDataCatalogsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1623,8 +1606,7 @@ const deserializeAws_json1_1ListNamedQueriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1686,8 +1668,7 @@ const deserializeAws_json1_1ListQueryExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1749,8 +1730,7 @@ const deserializeAws_json1_1ListTableMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1820,8 +1800,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1891,8 +1870,7 @@ const deserializeAws_json1_1ListWorkGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -1954,8 +1932,7 @@ const deserializeAws_json1_1StartQueryExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -2025,8 +2002,7 @@ const deserializeAws_json1_1StopQueryExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -2088,8 +2064,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -2159,8 +2134,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -2230,8 +2204,7 @@ const deserializeAws_json1_1UpdateDataCatalogCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -2293,8 +2266,7 @@ const deserializeAws_json1_1UpdateWorkGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.athena#InternalServerException": @@ -2406,9 +2378,10 @@ const deserializeAws_json1_1TooManyRequestsExceptionResponse = async ( const serializeAws_json1_1BatchGetNamedQueryInput = (input: BatchGetNamedQueryInput, context: __SerdeContext): any => { return { - ...(input.NamedQueryIds !== undefined && { - NamedQueryIds: serializeAws_json1_1NamedQueryIdList(input.NamedQueryIds, context), - }), + ...(input.NamedQueryIds !== undefined && + input.NamedQueryIds !== null && { + NamedQueryIds: serializeAws_json1_1NamedQueryIdList(input.NamedQueryIds, context), + }), }; }; @@ -2417,47 +2390,50 @@ const serializeAws_json1_1BatchGetQueryExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.QueryExecutionIds !== undefined && { - QueryExecutionIds: serializeAws_json1_1QueryExecutionIdList(input.QueryExecutionIds, context), - }), + ...(input.QueryExecutionIds !== undefined && + input.QueryExecutionIds !== null && { + QueryExecutionIds: serializeAws_json1_1QueryExecutionIdList(input.QueryExecutionIds, context), + }), }; }; const serializeAws_json1_1CreateDataCatalogInput = (input: CreateDataCatalogInput, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1CreateNamedQueryInput = (input: CreateNamedQueryInput, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.QueryString !== undefined && { QueryString: input.QueryString }), - ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.QueryString !== undefined && input.QueryString !== null && { QueryString: input.QueryString }), + ...(input.WorkGroup !== undefined && input.WorkGroup !== null && { WorkGroup: input.WorkGroup }), }; }; const serializeAws_json1_1CreateWorkGroupInput = (input: CreateWorkGroupInput, context: __SerdeContext): any => { return { - ...(input.Configuration !== undefined && { - Configuration: serializeAws_json1_1WorkGroupConfiguration(input.Configuration, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Configuration !== undefined && + input.Configuration !== null && { + Configuration: serializeAws_json1_1WorkGroupConfiguration(input.Configuration, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1DeleteDataCatalogInput = (input: DeleteDataCatalogInput, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -2469,85 +2445,89 @@ const serializeAws_json1_1DeleteNamedQueryInput = (input: DeleteNamedQueryInput, const serializeAws_json1_1DeleteWorkGroupInput = (input: DeleteWorkGroupInput, context: __SerdeContext): any => { return { - ...(input.RecursiveDeleteOption !== undefined && { RecursiveDeleteOption: input.RecursiveDeleteOption }), - ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }), + ...(input.RecursiveDeleteOption !== undefined && + input.RecursiveDeleteOption !== null && { RecursiveDeleteOption: input.RecursiveDeleteOption }), + ...(input.WorkGroup !== undefined && input.WorkGroup !== null && { WorkGroup: input.WorkGroup }), }; }; const serializeAws_json1_1EncryptionConfiguration = (input: EncryptionConfiguration, context: __SerdeContext): any => { return { - ...(input.EncryptionOption !== undefined && { EncryptionOption: input.EncryptionOption }), - ...(input.KmsKey !== undefined && { KmsKey: input.KmsKey }), + ...(input.EncryptionOption !== undefined && + input.EncryptionOption !== null && { EncryptionOption: input.EncryptionOption }), + ...(input.KmsKey !== undefined && input.KmsKey !== null && { KmsKey: input.KmsKey }), }; }; const serializeAws_json1_1GetDatabaseInput = (input: GetDatabaseInput, context: __SerdeContext): any => { return { - ...(input.CatalogName !== undefined && { CatalogName: input.CatalogName }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), + ...(input.CatalogName !== undefined && input.CatalogName !== null && { CatalogName: input.CatalogName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), }; }; const serializeAws_json1_1GetDataCatalogInput = (input: GetDataCatalogInput, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1GetNamedQueryInput = (input: GetNamedQueryInput, context: __SerdeContext): any => { return { - ...(input.NamedQueryId !== undefined && { NamedQueryId: input.NamedQueryId }), + ...(input.NamedQueryId !== undefined && input.NamedQueryId !== null && { NamedQueryId: input.NamedQueryId }), }; }; const serializeAws_json1_1GetQueryExecutionInput = (input: GetQueryExecutionInput, context: __SerdeContext): any => { return { - ...(input.QueryExecutionId !== undefined && { QueryExecutionId: input.QueryExecutionId }), + ...(input.QueryExecutionId !== undefined && + input.QueryExecutionId !== null && { QueryExecutionId: input.QueryExecutionId }), }; }; const serializeAws_json1_1GetQueryResultsInput = (input: GetQueryResultsInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.QueryExecutionId !== undefined && { QueryExecutionId: input.QueryExecutionId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.QueryExecutionId !== undefined && + input.QueryExecutionId !== null && { QueryExecutionId: input.QueryExecutionId }), }; }; const serializeAws_json1_1GetTableMetadataInput = (input: GetTableMetadataInput, context: __SerdeContext): any => { return { - ...(input.CatalogName !== undefined && { CatalogName: input.CatalogName }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogName !== undefined && input.CatalogName !== null && { CatalogName: input.CatalogName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1GetWorkGroupInput = (input: GetWorkGroupInput, context: __SerdeContext): any => { return { - ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }), + ...(input.WorkGroup !== undefined && input.WorkGroup !== null && { WorkGroup: input.WorkGroup }), }; }; const serializeAws_json1_1ListDatabasesInput = (input: ListDatabasesInput, context: __SerdeContext): any => { return { - ...(input.CatalogName !== undefined && { CatalogName: input.CatalogName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CatalogName !== undefined && input.CatalogName !== null && { CatalogName: input.CatalogName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListDataCatalogsInput = (input: ListDataCatalogsInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListNamedQueriesInput = (input: ListNamedQueriesInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.WorkGroup !== undefined && input.WorkGroup !== null && { WorkGroup: input.WorkGroup }), }; }; @@ -2556,19 +2536,19 @@ const serializeAws_json1_1ListQueryExecutionsInput = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.WorkGroup !== undefined && input.WorkGroup !== null && { WorkGroup: input.WorkGroup }), }; }; const serializeAws_json1_1ListTableMetadataInput = (input: ListTableMetadataInput, context: __SerdeContext): any => { return { - ...(input.CatalogName !== undefined && { CatalogName: input.CatalogName }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Expression !== undefined && { Expression: input.Expression }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CatalogName !== undefined && input.CatalogName !== null && { CatalogName: input.CatalogName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Expression !== undefined && input.Expression !== null && { Expression: input.Expression }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2577,50 +2557,68 @@ const serializeAws_json1_1ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1ListWorkGroupsInput = (input: ListWorkGroupsInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1NamedQueryIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ParametersMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1QueryExecutionContext = (input: QueryExecutionContext, context: __SerdeContext): any => { return { - ...(input.Catalog !== undefined && { Catalog: input.Catalog }), - ...(input.Database !== undefined && { Database: input.Database }), + ...(input.Catalog !== undefined && input.Catalog !== null && { Catalog: input.Catalog }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), }; }; const serializeAws_json1_1QueryExecutionIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ResultConfiguration = (input: ResultConfiguration, context: __SerdeContext): any => { return { - ...(input.EncryptionConfiguration !== undefined && { - EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), - }), - ...(input.OutputLocation !== undefined && { OutputLocation: input.OutputLocation }), + ...(input.EncryptionConfiguration !== undefined && + input.EncryptionConfiguration !== null && { + EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), + }), + ...(input.OutputLocation !== undefined && + input.OutputLocation !== null && { OutputLocation: input.OutputLocation }), }; }; @@ -2629,14 +2627,18 @@ const serializeAws_json1_1ResultConfigurationUpdates = ( context: __SerdeContext ): any => { return { - ...(input.EncryptionConfiguration !== undefined && { - EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), - }), - ...(input.OutputLocation !== undefined && { OutputLocation: input.OutputLocation }), - ...(input.RemoveEncryptionConfiguration !== undefined && { - RemoveEncryptionConfiguration: input.RemoveEncryptionConfiguration, - }), - ...(input.RemoveOutputLocation !== undefined && { RemoveOutputLocation: input.RemoveOutputLocation }), + ...(input.EncryptionConfiguration !== undefined && + input.EncryptionConfiguration !== null && { + EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), + }), + ...(input.OutputLocation !== undefined && + input.OutputLocation !== null && { OutputLocation: input.OutputLocation }), + ...(input.RemoveEncryptionConfiguration !== undefined && + input.RemoveEncryptionConfiguration !== null && { + RemoveEncryptionConfiguration: input.RemoveEncryptionConfiguration, + }), + ...(input.RemoveOutputLocation !== undefined && + input.RemoveOutputLocation !== null && { RemoveOutputLocation: input.RemoveOutputLocation }), }; }; @@ -2646,14 +2648,16 @@ const serializeAws_json1_1StartQueryExecutionInput = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.QueryExecutionContext !== undefined && { - QueryExecutionContext: serializeAws_json1_1QueryExecutionContext(input.QueryExecutionContext, context), - }), - ...(input.QueryString !== undefined && { QueryString: input.QueryString }), - ...(input.ResultConfiguration !== undefined && { - ResultConfiguration: serializeAws_json1_1ResultConfiguration(input.ResultConfiguration, context), - }), - ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }), + ...(input.QueryExecutionContext !== undefined && + input.QueryExecutionContext !== null && { + QueryExecutionContext: serializeAws_json1_1QueryExecutionContext(input.QueryExecutionContext, context), + }), + ...(input.QueryString !== undefined && input.QueryString !== null && { QueryString: input.QueryString }), + ...(input.ResultConfiguration !== undefined && + input.ResultConfiguration !== null && { + ResultConfiguration: serializeAws_json1_1ResultConfiguration(input.ResultConfiguration, context), + }), + ...(input.WorkGroup !== undefined && input.WorkGroup !== null && { WorkGroup: input.WorkGroup }), }; }; @@ -2665,68 +2669,88 @@ const serializeAws_json1_1StopQueryExecutionInput = (input: StopQueryExecutionIn const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateDataCatalogInput = (input: UpdateDataCatalogInput, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1UpdateWorkGroupInput = (input: UpdateWorkGroupInput, context: __SerdeContext): any => { return { - ...(input.ConfigurationUpdates !== undefined && { - ConfigurationUpdates: serializeAws_json1_1WorkGroupConfigurationUpdates(input.ConfigurationUpdates, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.State !== undefined && { State: input.State }), - ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }), + ...(input.ConfigurationUpdates !== undefined && + input.ConfigurationUpdates !== null && { + ConfigurationUpdates: serializeAws_json1_1WorkGroupConfigurationUpdates(input.ConfigurationUpdates, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), + ...(input.WorkGroup !== undefined && input.WorkGroup !== null && { WorkGroup: input.WorkGroup }), }; }; const serializeAws_json1_1WorkGroupConfiguration = (input: WorkGroupConfiguration, context: __SerdeContext): any => { return { - ...(input.BytesScannedCutoffPerQuery !== undefined && { - BytesScannedCutoffPerQuery: input.BytesScannedCutoffPerQuery, - }), - ...(input.EnforceWorkGroupConfiguration !== undefined && { - EnforceWorkGroupConfiguration: input.EnforceWorkGroupConfiguration, - }), - ...(input.PublishCloudWatchMetricsEnabled !== undefined && { - PublishCloudWatchMetricsEnabled: input.PublishCloudWatchMetricsEnabled, - }), - ...(input.RequesterPaysEnabled !== undefined && { RequesterPaysEnabled: input.RequesterPaysEnabled }), - ...(input.ResultConfiguration !== undefined && { - ResultConfiguration: serializeAws_json1_1ResultConfiguration(input.ResultConfiguration, context), - }), + ...(input.BytesScannedCutoffPerQuery !== undefined && + input.BytesScannedCutoffPerQuery !== null && { BytesScannedCutoffPerQuery: input.BytesScannedCutoffPerQuery }), + ...(input.EnforceWorkGroupConfiguration !== undefined && + input.EnforceWorkGroupConfiguration !== null && { + EnforceWorkGroupConfiguration: input.EnforceWorkGroupConfiguration, + }), + ...(input.PublishCloudWatchMetricsEnabled !== undefined && + input.PublishCloudWatchMetricsEnabled !== null && { + PublishCloudWatchMetricsEnabled: input.PublishCloudWatchMetricsEnabled, + }), + ...(input.RequesterPaysEnabled !== undefined && + input.RequesterPaysEnabled !== null && { RequesterPaysEnabled: input.RequesterPaysEnabled }), + ...(input.ResultConfiguration !== undefined && + input.ResultConfiguration !== null && { + ResultConfiguration: serializeAws_json1_1ResultConfiguration(input.ResultConfiguration, context), + }), }; }; @@ -2735,25 +2759,29 @@ const serializeAws_json1_1WorkGroupConfigurationUpdates = ( context: __SerdeContext ): any => { return { - ...(input.BytesScannedCutoffPerQuery !== undefined && { - BytesScannedCutoffPerQuery: input.BytesScannedCutoffPerQuery, - }), - ...(input.EnforceWorkGroupConfiguration !== undefined && { - EnforceWorkGroupConfiguration: input.EnforceWorkGroupConfiguration, - }), - ...(input.PublishCloudWatchMetricsEnabled !== undefined && { - PublishCloudWatchMetricsEnabled: input.PublishCloudWatchMetricsEnabled, - }), - ...(input.RemoveBytesScannedCutoffPerQuery !== undefined && { - RemoveBytesScannedCutoffPerQuery: input.RemoveBytesScannedCutoffPerQuery, - }), - ...(input.RequesterPaysEnabled !== undefined && { RequesterPaysEnabled: input.RequesterPaysEnabled }), - ...(input.ResultConfigurationUpdates !== undefined && { - ResultConfigurationUpdates: serializeAws_json1_1ResultConfigurationUpdates( - input.ResultConfigurationUpdates, - context - ), - }), + ...(input.BytesScannedCutoffPerQuery !== undefined && + input.BytesScannedCutoffPerQuery !== null && { BytesScannedCutoffPerQuery: input.BytesScannedCutoffPerQuery }), + ...(input.EnforceWorkGroupConfiguration !== undefined && + input.EnforceWorkGroupConfiguration !== null && { + EnforceWorkGroupConfiguration: input.EnforceWorkGroupConfiguration, + }), + ...(input.PublishCloudWatchMetricsEnabled !== undefined && + input.PublishCloudWatchMetricsEnabled !== null && { + PublishCloudWatchMetricsEnabled: input.PublishCloudWatchMetricsEnabled, + }), + ...(input.RemoveBytesScannedCutoffPerQuery !== undefined && + input.RemoveBytesScannedCutoffPerQuery !== null && { + RemoveBytesScannedCutoffPerQuery: input.RemoveBytesScannedCutoffPerQuery, + }), + ...(input.RequesterPaysEnabled !== undefined && + input.RequesterPaysEnabled !== null && { RequesterPaysEnabled: input.RequesterPaysEnabled }), + ...(input.ResultConfigurationUpdates !== undefined && + input.ResultConfigurationUpdates !== null && { + ResultConfigurationUpdates: serializeAws_json1_1ResultConfigurationUpdates( + input.ResultConfigurationUpdates, + context + ), + }), }; }; @@ -2814,11 +2842,25 @@ const deserializeAws_json1_1ColumnInfo = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ColumnInfoList = (output: any, context: __SerdeContext): ColumnInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ColumnInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ColumnInfo(entry, context); + }); }; const deserializeAws_json1_1ColumnList = (output: any, context: __SerdeContext): Column[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Column(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Column(entry, context); + }); }; const deserializeAws_json1_1CreateDataCatalogOutput = ( @@ -2850,7 +2892,14 @@ const deserializeAws_json1_1Database = (output: any, context: __SerdeContext): D }; const deserializeAws_json1_1DatabaseList = (output: any, context: __SerdeContext): Database[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Database(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Database(entry, context); + }); }; const deserializeAws_json1_1DataCatalog = (output: any, context: __SerdeContext): DataCatalog => { @@ -2873,7 +2922,14 @@ const deserializeAws_json1_1DataCatalogSummary = (output: any, context: __SerdeC }; const deserializeAws_json1_1DataCatalogSummaryList = (output: any, context: __SerdeContext): DataCatalogSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataCatalogSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataCatalogSummary(entry, context); + }); }; const deserializeAws_json1_1Datum = (output: any, context: __SerdeContext): Datum => { @@ -2883,7 +2939,14 @@ const deserializeAws_json1_1Datum = (output: any, context: __SerdeContext): Datu }; const deserializeAws_json1_1datumList = (output: any, context: __SerdeContext): Datum[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Datum(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Datum(entry, context); + }); }; const deserializeAws_json1_1DeleteDataCatalogOutput = ( @@ -3097,21 +3160,37 @@ const deserializeAws_json1_1NamedQuery = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1NamedQueryIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NamedQueryList = (output: any, context: __SerdeContext): NamedQuery[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NamedQuery(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NamedQuery(entry, context); + }); }; const deserializeAws_json1_1ParametersMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1QueryExecution = (output: any, context: __SerdeContext): QueryExecution => { @@ -3149,11 +3228,25 @@ const deserializeAws_json1_1QueryExecutionContext = (output: any, context: __Ser }; const deserializeAws_json1_1QueryExecutionIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1QueryExecutionList = (output: any, context: __SerdeContext): QueryExecution[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1QueryExecution(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1QueryExecution(entry, context); + }); }; const deserializeAws_json1_1QueryExecutionStatistics = ( @@ -3263,7 +3356,14 @@ const deserializeAws_json1_1Row = (output: any, context: __SerdeContext): Row => }; const deserializeAws_json1_1RowList = (output: any, context: __SerdeContext): Row[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Row(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Row(entry, context); + }); }; const deserializeAws_json1_1StartQueryExecutionOutput = ( @@ -3311,7 +3411,14 @@ const deserializeAws_json1_1TableMetadata = (output: any, context: __SerdeContex }; const deserializeAws_json1_1TableMetadataList = (output: any, context: __SerdeContext): TableMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TableMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TableMetadata(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -3322,7 +3429,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceOutput = (output: any, context: __SerdeContext): TagResourceOutput => { @@ -3354,7 +3468,14 @@ const deserializeAws_json1_1UnprocessedNamedQueryIdList = ( output: any, context: __SerdeContext ): UnprocessedNamedQueryId[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UnprocessedNamedQueryId(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UnprocessedNamedQueryId(entry, context); + }); }; const deserializeAws_json1_1UnprocessedQueryExecutionId = ( @@ -3373,7 +3494,14 @@ const deserializeAws_json1_1UnprocessedQueryExecutionIdList = ( output: any, context: __SerdeContext ): UnprocessedQueryExecutionId[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UnprocessedQueryExecutionId(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UnprocessedQueryExecutionId(entry, context); + }); }; const deserializeAws_json1_1UntagResourceOutput = (output: any, context: __SerdeContext): UntagResourceOutput => { @@ -3433,7 +3561,14 @@ const deserializeAws_json1_1WorkGroupConfiguration = (output: any, context: __Se }; const deserializeAws_json1_1WorkGroupsList = (output: any, context: __SerdeContext): WorkGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WorkGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WorkGroupSummary(entry, context); + }); }; const deserializeAws_json1_1WorkGroupSummary = (output: any, context: __SerdeContext): WorkGroupSummary => { @@ -3498,3 +3633,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-auditmanager/protocols/Aws_restJson1.ts b/clients/client-auditmanager/protocols/Aws_restJson1.ts index 0f2d72be472c..b8a3d53351d2 100644 --- a/clients/client-auditmanager/protocols/Aws_restJson1.ts +++ b/clients/client-auditmanager/protocols/Aws_restJson1.ts @@ -199,7 +199,7 @@ export const serializeAws_restJson1AssociateAssessmentReportEvidenceFolderComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/associateToAssessmentReport"; if (input.assessmentId !== undefined) { @@ -213,7 +213,8 @@ export const serializeAws_restJson1AssociateAssessmentReportEvidenceFolderComman } let body: any; body = JSON.stringify({ - ...(input.evidenceFolderId !== undefined && { evidenceFolderId: input.evidenceFolderId }), + ...(input.evidenceFolderId !== undefined && + input.evidenceFolderId !== null && { evidenceFolderId: input.evidenceFolderId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -232,7 +233,7 @@ export const serializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/batchAssociateToAssessmentReport"; if (input.assessmentId !== undefined) { @@ -246,10 +247,10 @@ export const serializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommand } let body: any; body = JSON.stringify({ - ...(input.evidenceFolderId !== undefined && { evidenceFolderId: input.evidenceFolderId }), - ...(input.evidenceIds !== undefined && { - evidenceIds: serializeAws_restJson1EvidenceIds(input.evidenceIds, context), - }), + ...(input.evidenceFolderId !== undefined && + input.evidenceFolderId !== null && { evidenceFolderId: input.evidenceFolderId }), + ...(input.evidenceIds !== undefined && + input.evidenceIds !== null && { evidenceIds: serializeAws_restJson1EvidenceIds(input.evidenceIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -268,7 +269,7 @@ export const serializeAws_restJson1BatchCreateDelegationByAssessmentCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/delegations"; if (input.assessmentId !== undefined) { @@ -282,9 +283,13 @@ export const serializeAws_restJson1BatchCreateDelegationByAssessmentCommand = as } let body: any; body = JSON.stringify({ - ...(input.createDelegationRequests !== undefined && { - createDelegationRequests: serializeAws_restJson1CreateDelegationRequests(input.createDelegationRequests, context), - }), + ...(input.createDelegationRequests !== undefined && + input.createDelegationRequests !== null && { + createDelegationRequests: serializeAws_restJson1CreateDelegationRequests( + input.createDelegationRequests, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -303,7 +308,7 @@ export const serializeAws_restJson1BatchDeleteDelegationByAssessmentCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/delegations"; if (input.assessmentId !== undefined) { @@ -317,9 +322,10 @@ export const serializeAws_restJson1BatchDeleteDelegationByAssessmentCommand = as } let body: any; body = JSON.stringify({ - ...(input.delegationIds !== undefined && { - delegationIds: serializeAws_restJson1DelegationIds(input.delegationIds, context), - }), + ...(input.delegationIds !== undefined && + input.delegationIds !== null && { + delegationIds: serializeAws_restJson1DelegationIds(input.delegationIds, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -338,7 +344,7 @@ export const serializeAws_restJson1BatchDisassociateAssessmentReportEvidenceComm context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/batchDisassociateFromAssessmentReport"; if (input.assessmentId !== undefined) { @@ -352,10 +358,10 @@ export const serializeAws_restJson1BatchDisassociateAssessmentReportEvidenceComm } let body: any; body = JSON.stringify({ - ...(input.evidenceFolderId !== undefined && { evidenceFolderId: input.evidenceFolderId }), - ...(input.evidenceIds !== undefined && { - evidenceIds: serializeAws_restJson1EvidenceIds(input.evidenceIds, context), - }), + ...(input.evidenceFolderId !== undefined && + input.evidenceFolderId !== null && { evidenceFolderId: input.evidenceFolderId }), + ...(input.evidenceIds !== undefined && + input.evidenceIds !== null && { evidenceIds: serializeAws_restJson1EvidenceIds(input.evidenceIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -374,7 +380,7 @@ export const serializeAws_restJson1BatchImportEvidenceToAssessmentControlCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/controlSets/{controlSetId}/controls/{controlId}/evidence"; if (input.assessmentId !== undefined) { @@ -406,9 +412,10 @@ export const serializeAws_restJson1BatchImportEvidenceToAssessmentControlCommand } let body: any; body = JSON.stringify({ - ...(input.manualEvidence !== undefined && { - manualEvidence: serializeAws_restJson1ManualEvidenceList(input.manualEvidence, context), - }), + ...(input.manualEvidence !== undefined && + input.manualEvidence !== null && { + manualEvidence: serializeAws_restJson1ManualEvidenceList(input.manualEvidence, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -427,23 +434,26 @@ export const serializeAws_restJson1CreateAssessmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments"; let body: any; body = JSON.stringify({ - ...(input.assessmentReportsDestination !== undefined && { - assessmentReportsDestination: serializeAws_restJson1AssessmentReportsDestination( - input.assessmentReportsDestination, - context - ), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.frameworkId !== undefined && { frameworkId: input.frameworkId }), - ...(input.name !== undefined && { name: input.name }), - ...(input.roles !== undefined && { roles: serializeAws_restJson1Roles(input.roles, context) }), - ...(input.scope !== undefined && { scope: serializeAws_restJson1Scope(input.scope, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.assessmentReportsDestination !== undefined && + input.assessmentReportsDestination !== null && { + assessmentReportsDestination: serializeAws_restJson1AssessmentReportsDestination( + input.assessmentReportsDestination, + context + ), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.frameworkId !== undefined && input.frameworkId !== null && { frameworkId: input.frameworkId }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.roles !== undefined && + input.roles !== null && { roles: serializeAws_restJson1Roles(input.roles, context) }), + ...(input.scope !== undefined && + input.scope !== null && { scope: serializeAws_restJson1Scope(input.scope, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -462,17 +472,19 @@ export const serializeAws_restJson1CreateAssessmentFrameworkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessmentFrameworks"; let body: any; body = JSON.stringify({ - ...(input.complianceType !== undefined && { complianceType: input.complianceType }), - ...(input.controlSets !== undefined && { - controlSets: serializeAws_restJson1CreateAssessmentFrameworkControlSets(input.controlSets, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), + ...(input.complianceType !== undefined && + input.complianceType !== null && { complianceType: input.complianceType }), + ...(input.controlSets !== undefined && + input.controlSets !== null && { + controlSets: serializeAws_restJson1CreateAssessmentFrameworkControlSets(input.controlSets, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -491,7 +503,7 @@ export const serializeAws_restJson1CreateAssessmentReportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/reports"; if (input.assessmentId !== undefined) { @@ -505,8 +517,8 @@ export const serializeAws_restJson1CreateAssessmentReportCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -525,20 +537,24 @@ export const serializeAws_restJson1CreateControlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/controls"; let body: any; body = JSON.stringify({ - ...(input.actionPlanInstructions !== undefined && { actionPlanInstructions: input.actionPlanInstructions }), - ...(input.actionPlanTitle !== undefined && { actionPlanTitle: input.actionPlanTitle }), - ...(input.controlMappingSources !== undefined && { - controlMappingSources: serializeAws_restJson1CreateControlMappingSources(input.controlMappingSources, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.testingInformation !== undefined && { testingInformation: input.testingInformation }), + ...(input.actionPlanInstructions !== undefined && + input.actionPlanInstructions !== null && { actionPlanInstructions: input.actionPlanInstructions }), + ...(input.actionPlanTitle !== undefined && + input.actionPlanTitle !== null && { actionPlanTitle: input.actionPlanTitle }), + ...(input.controlMappingSources !== undefined && + input.controlMappingSources !== null && { + controlMappingSources: serializeAws_restJson1CreateControlMappingSources(input.controlMappingSources, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.testingInformation !== undefined && + input.testingInformation !== null && { testingInformation: input.testingInformation }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -556,9 +572,7 @@ export const serializeAws_restJson1DeleteAssessmentCommand = async ( input: DeleteAssessmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}"; if (input.assessmentId !== undefined) { const labelValue: string = input.assessmentId; @@ -586,9 +600,7 @@ export const serializeAws_restJson1DeleteAssessmentFrameworkCommand = async ( input: DeleteAssessmentFrameworkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessmentFrameworks/{frameworkId}"; if (input.frameworkId !== undefined) { const labelValue: string = input.frameworkId; @@ -616,9 +628,7 @@ export const serializeAws_restJson1DeleteAssessmentReportCommand = async ( input: DeleteAssessmentReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}/reports/{assessmentReportId}"; if (input.assessmentId !== undefined) { const labelValue: string = input.assessmentId; @@ -655,9 +665,7 @@ export const serializeAws_restJson1DeleteControlCommand = async ( input: DeleteControlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/controls/{controlId}"; if (input.controlId !== undefined) { const labelValue: string = input.controlId; @@ -685,12 +693,10 @@ export const serializeAws_restJson1DeregisterAccountCommand = async ( input: DeregisterAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/account/deregisterAccount"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -708,12 +714,13 @@ export const serializeAws_restJson1DeregisterOrganizationAdminAccountCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/account/deregisterOrganizationAdminAccount"; let body: any; body = JSON.stringify({ - ...(input.adminAccountId !== undefined && { adminAccountId: input.adminAccountId }), + ...(input.adminAccountId !== undefined && + input.adminAccountId !== null && { adminAccountId: input.adminAccountId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -732,7 +739,7 @@ export const serializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/disassociateFromAssessmentReport"; if (input.assessmentId !== undefined) { @@ -746,7 +753,8 @@ export const serializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCom } let body: any; body = JSON.stringify({ - ...(input.evidenceFolderId !== undefined && { evidenceFolderId: input.evidenceFolderId }), + ...(input.evidenceFolderId !== undefined && + input.evidenceFolderId !== null && { evidenceFolderId: input.evidenceFolderId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -764,12 +772,10 @@ export const serializeAws_restJson1GetAccountStatusCommand = async ( input: GetAccountStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/account/status"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -786,9 +792,7 @@ export const serializeAws_restJson1GetAssessmentCommand = async ( input: GetAssessmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}"; if (input.assessmentId !== undefined) { const labelValue: string = input.assessmentId; @@ -816,9 +820,7 @@ export const serializeAws_restJson1GetAssessmentFrameworkCommand = async ( input: GetAssessmentFrameworkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessmentFrameworks/{frameworkId}"; if (input.frameworkId !== undefined) { const labelValue: string = input.frameworkId; @@ -846,9 +848,7 @@ export const serializeAws_restJson1GetAssessmentReportUrlCommand = async ( input: GetAssessmentReportUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}/reports/{assessmentReportId}/url"; if (input.assessmentReportId !== undefined) { const labelValue: string = input.assessmentReportId; @@ -885,9 +885,7 @@ export const serializeAws_restJson1GetChangeLogsCommand = async ( input: GetChangeLogsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}/changelogs"; if (input.assessmentId !== undefined) { const labelValue: string = input.assessmentId; @@ -922,9 +920,7 @@ export const serializeAws_restJson1GetControlCommand = async ( input: GetControlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/controls/{controlId}"; if (input.controlId !== undefined) { const labelValue: string = input.controlId; @@ -952,9 +948,7 @@ export const serializeAws_restJson1GetDelegationsCommand = async ( input: GetDelegationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/delegations"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -978,9 +972,7 @@ export const serializeAws_restJson1GetEvidenceCommand = async ( input: GetEvidenceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}/evidence/{evidenceId}"; if (input.assessmentId !== undefined) { @@ -1036,9 +1028,7 @@ export const serializeAws_restJson1GetEvidenceByEvidenceFolderCommand = async ( input: GetEvidenceByEvidenceFolderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}/evidence"; if (input.assessmentId !== undefined) { @@ -1090,9 +1080,7 @@ export const serializeAws_restJson1GetEvidenceFolderCommand = async ( input: GetEvidenceFolderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}"; if (input.assessmentId !== undefined) { const labelValue: string = input.assessmentId; @@ -1138,9 +1126,7 @@ export const serializeAws_restJson1GetEvidenceFoldersByAssessmentCommand = async input: GetEvidenceFoldersByAssessmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}/evidenceFolders"; if (input.assessmentId !== undefined) { const labelValue: string = input.assessmentId; @@ -1173,9 +1159,7 @@ export const serializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommand input: GetEvidenceFoldersByAssessmentControlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments/{assessmentId}/evidenceFolders-by-assessment-control/{controlSetId}/{controlId}"; if (input.assessmentId !== undefined) { const labelValue: string = input.assessmentId; @@ -1226,12 +1210,10 @@ export const serializeAws_restJson1GetOrganizationAdminAccountCommand = async ( input: GetOrganizationAdminAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/account/organizationAdminAccount"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1248,12 +1230,10 @@ export const serializeAws_restJson1GetServicesInScopeCommand = async ( input: GetServicesInScopeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/services"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1270,9 +1250,7 @@ export const serializeAws_restJson1GetSettingsCommand = async ( input: GetSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/settings/{attribute}"; if (input.attribute !== undefined) { const labelValue: string = input.attribute; @@ -1300,9 +1278,7 @@ export const serializeAws_restJson1ListAssessmentFrameworksCommand = async ( input: ListAssessmentFrameworksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessmentFrameworks"; const query: any = { ...(input.frameworkType !== undefined && { frameworkType: input.frameworkType }), @@ -1327,9 +1303,7 @@ export const serializeAws_restJson1ListAssessmentReportsCommand = async ( input: ListAssessmentReportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessmentReports"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1353,9 +1327,7 @@ export const serializeAws_restJson1ListAssessmentsCommand = async ( input: ListAssessmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assessments"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1379,9 +1351,7 @@ export const serializeAws_restJson1ListControlsCommand = async ( input: ListControlsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/controls"; const query: any = { ...(input.controlType !== undefined && { controlType: input.controlType }), @@ -1406,9 +1376,7 @@ export const serializeAws_restJson1ListKeywordsForDataSourceCommand = async ( input: ListKeywordsForDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dataSourceKeywords"; const query: any = { ...(input.source !== undefined && { source: input.source }), @@ -1433,9 +1401,7 @@ export const serializeAws_restJson1ListNotificationsCommand = async ( input: ListNotificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/notifications"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1459,9 +1425,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1490,13 +1454,14 @@ export const serializeAws_restJson1RegisterAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/account/registerAccount"; let body: any; body = JSON.stringify({ - ...(input.delegatedAdminAccount !== undefined && { delegatedAdminAccount: input.delegatedAdminAccount }), - ...(input.kmsKey !== undefined && { kmsKey: input.kmsKey }), + ...(input.delegatedAdminAccount !== undefined && + input.delegatedAdminAccount !== null && { delegatedAdminAccount: input.delegatedAdminAccount }), + ...(input.kmsKey !== undefined && input.kmsKey !== null && { kmsKey: input.kmsKey }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1515,12 +1480,13 @@ export const serializeAws_restJson1RegisterOrganizationAdminAccountCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/account/registerOrganizationAdminAccount"; let body: any; body = JSON.stringify({ - ...(input.adminAccountId !== undefined && { adminAccountId: input.adminAccountId }), + ...(input.adminAccountId !== undefined && + input.adminAccountId !== null && { adminAccountId: input.adminAccountId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1539,7 +1505,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -1553,7 +1519,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1571,9 +1537,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1606,7 +1570,7 @@ export const serializeAws_restJson1UpdateAssessmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}"; if (input.assessmentId !== undefined) { @@ -1620,16 +1584,21 @@ export const serializeAws_restJson1UpdateAssessmentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.assessmentDescription !== undefined && { assessmentDescription: input.assessmentDescription }), - ...(input.assessmentName !== undefined && { assessmentName: input.assessmentName }), - ...(input.assessmentReportsDestination !== undefined && { - assessmentReportsDestination: serializeAws_restJson1AssessmentReportsDestination( - input.assessmentReportsDestination, - context - ), - }), - ...(input.roles !== undefined && { roles: serializeAws_restJson1Roles(input.roles, context) }), - ...(input.scope !== undefined && { scope: serializeAws_restJson1Scope(input.scope, context) }), + ...(input.assessmentDescription !== undefined && + input.assessmentDescription !== null && { assessmentDescription: input.assessmentDescription }), + ...(input.assessmentName !== undefined && + input.assessmentName !== null && { assessmentName: input.assessmentName }), + ...(input.assessmentReportsDestination !== undefined && + input.assessmentReportsDestination !== null && { + assessmentReportsDestination: serializeAws_restJson1AssessmentReportsDestination( + input.assessmentReportsDestination, + context + ), + }), + ...(input.roles !== undefined && + input.roles !== null && { roles: serializeAws_restJson1Roles(input.roles, context) }), + ...(input.scope !== undefined && + input.scope !== null && { scope: serializeAws_restJson1Scope(input.scope, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1648,7 +1617,7 @@ export const serializeAws_restJson1UpdateAssessmentControlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/controlSets/{controlSetId}/controls/{controlId}"; if (input.assessmentId !== undefined) { @@ -1680,8 +1649,8 @@ export const serializeAws_restJson1UpdateAssessmentControlCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.commentBody !== undefined && { commentBody: input.commentBody }), - ...(input.controlStatus !== undefined && { controlStatus: input.controlStatus }), + ...(input.commentBody !== undefined && input.commentBody !== null && { commentBody: input.commentBody }), + ...(input.controlStatus !== undefined && input.controlStatus !== null && { controlStatus: input.controlStatus }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1700,7 +1669,7 @@ export const serializeAws_restJson1UpdateAssessmentControlSetStatusCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/controlSets/{controlSetId}/status"; if (input.assessmentId !== undefined) { @@ -1723,8 +1692,8 @@ export const serializeAws_restJson1UpdateAssessmentControlSetStatusCommand = asy } let body: any; body = JSON.stringify({ - ...(input.comment !== undefined && { comment: input.comment }), - ...(input.status !== undefined && { status: input.status }), + ...(input.comment !== undefined && input.comment !== null && { comment: input.comment }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1743,7 +1712,7 @@ export const serializeAws_restJson1UpdateAssessmentFrameworkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessmentFrameworks/{frameworkId}"; if (input.frameworkId !== undefined) { @@ -1757,12 +1726,14 @@ export const serializeAws_restJson1UpdateAssessmentFrameworkCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.complianceType !== undefined && { complianceType: input.complianceType }), - ...(input.controlSets !== undefined && { - controlSets: serializeAws_restJson1UpdateAssessmentFrameworkControlSets(input.controlSets, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), + ...(input.complianceType !== undefined && + input.complianceType !== null && { complianceType: input.complianceType }), + ...(input.controlSets !== undefined && + input.controlSets !== null && { + controlSets: serializeAws_restJson1UpdateAssessmentFrameworkControlSets(input.controlSets, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1781,7 +1752,7 @@ export const serializeAws_restJson1UpdateAssessmentStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessments/{assessmentId}/status"; if (input.assessmentId !== undefined) { @@ -1795,7 +1766,7 @@ export const serializeAws_restJson1UpdateAssessmentStatusCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.status !== undefined && { status: input.status }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1814,7 +1785,7 @@ export const serializeAws_restJson1UpdateControlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/controls/{controlId}"; if (input.controlId !== undefined) { @@ -1828,14 +1799,18 @@ export const serializeAws_restJson1UpdateControlCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.actionPlanInstructions !== undefined && { actionPlanInstructions: input.actionPlanInstructions }), - ...(input.actionPlanTitle !== undefined && { actionPlanTitle: input.actionPlanTitle }), - ...(input.controlMappingSources !== undefined && { - controlMappingSources: serializeAws_restJson1ControlMappingSources(input.controlMappingSources, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.testingInformation !== undefined && { testingInformation: input.testingInformation }), + ...(input.actionPlanInstructions !== undefined && + input.actionPlanInstructions !== null && { actionPlanInstructions: input.actionPlanInstructions }), + ...(input.actionPlanTitle !== undefined && + input.actionPlanTitle !== null && { actionPlanTitle: input.actionPlanTitle }), + ...(input.controlMappingSources !== undefined && + input.controlMappingSources !== null && { + controlMappingSources: serializeAws_restJson1ControlMappingSources(input.controlMappingSources, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.testingInformation !== undefined && + input.testingInformation !== null && { testingInformation: input.testingInformation }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1854,22 +1829,24 @@ export const serializeAws_restJson1UpdateSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/settings"; let body: any; body = JSON.stringify({ - ...(input.defaultAssessmentReportsDestination !== undefined && { - defaultAssessmentReportsDestination: serializeAws_restJson1AssessmentReportsDestination( - input.defaultAssessmentReportsDestination, - context - ), - }), - ...(input.defaultProcessOwners !== undefined && { - defaultProcessOwners: serializeAws_restJson1Roles(input.defaultProcessOwners, context), - }), - ...(input.kmsKey !== undefined && { kmsKey: input.kmsKey }), - ...(input.snsTopic !== undefined && { snsTopic: input.snsTopic }), + ...(input.defaultAssessmentReportsDestination !== undefined && + input.defaultAssessmentReportsDestination !== null && { + defaultAssessmentReportsDestination: serializeAws_restJson1AssessmentReportsDestination( + input.defaultAssessmentReportsDestination, + context + ), + }), + ...(input.defaultProcessOwners !== undefined && + input.defaultProcessOwners !== null && { + defaultProcessOwners: serializeAws_restJson1Roles(input.defaultProcessOwners, context), + }), + ...(input.kmsKey !== undefined && input.kmsKey !== null && { kmsKey: input.kmsKey }), + ...(input.snsTopic !== undefined && input.snsTopic !== null && { snsTopic: input.snsTopic }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1888,12 +1865,13 @@ export const serializeAws_restJson1ValidateAssessmentReportIntegrityCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assessmentReports/integrity"; let body: any; body = JSON.stringify({ - ...(input.s3RelativePath !== undefined && { s3RelativePath: input.s3RelativePath }), + ...(input.s3RelativePath !== undefined && + input.s3RelativePath !== null && { s3RelativePath: input.s3RelativePath }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5925,50 +5903,77 @@ const serializeAws_restJson1AssessmentReportsDestination = ( context: __SerdeContext ): any => { return { - ...(input.destination !== undefined && { destination: input.destination }), - ...(input.destinationType !== undefined && { destinationType: input.destinationType }), + ...(input.destination !== undefined && input.destination !== null && { destination: input.destination }), + ...(input.destinationType !== undefined && + input.destinationType !== null && { destinationType: input.destinationType }), }; }; const serializeAws_restJson1AWSAccount = (input: AWSAccount, context: __SerdeContext): any => { return { - ...(input.emailAddress !== undefined && { emailAddress: input.emailAddress }), - ...(input.id !== undefined && { id: input.id }), - ...(input.name !== undefined && { name: input.name }), + ...(input.emailAddress !== undefined && input.emailAddress !== null && { emailAddress: input.emailAddress }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_restJson1AWSAccounts = (input: AWSAccount[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AWSAccount(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AWSAccount(entry, context); + }); }; const serializeAws_restJson1AWSService = (input: AWSService, context: __SerdeContext): any => { return { - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; const serializeAws_restJson1AWSServices = (input: AWSService[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AWSService(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AWSService(entry, context); + }); }; const serializeAws_restJson1ControlMappingSource = (input: ControlMappingSource, context: __SerdeContext): any => { return { - ...(input.sourceDescription !== undefined && { sourceDescription: input.sourceDescription }), - ...(input.sourceFrequency !== undefined && { sourceFrequency: input.sourceFrequency }), - ...(input.sourceId !== undefined && { sourceId: input.sourceId }), - ...(input.sourceKeyword !== undefined && { - sourceKeyword: serializeAws_restJson1SourceKeyword(input.sourceKeyword, context), - }), - ...(input.sourceName !== undefined && { sourceName: input.sourceName }), - ...(input.sourceSetUpOption !== undefined && { sourceSetUpOption: input.sourceSetUpOption }), - ...(input.sourceType !== undefined && { sourceType: input.sourceType }), - ...(input.troubleshootingText !== undefined && { troubleshootingText: input.troubleshootingText }), + ...(input.sourceDescription !== undefined && + input.sourceDescription !== null && { sourceDescription: input.sourceDescription }), + ...(input.sourceFrequency !== undefined && + input.sourceFrequency !== null && { sourceFrequency: input.sourceFrequency }), + ...(input.sourceId !== undefined && input.sourceId !== null && { sourceId: input.sourceId }), + ...(input.sourceKeyword !== undefined && + input.sourceKeyword !== null && { + sourceKeyword: serializeAws_restJson1SourceKeyword(input.sourceKeyword, context), + }), + ...(input.sourceName !== undefined && input.sourceName !== null && { sourceName: input.sourceName }), + ...(input.sourceSetUpOption !== undefined && + input.sourceSetUpOption !== null && { sourceSetUpOption: input.sourceSetUpOption }), + ...(input.sourceType !== undefined && input.sourceType !== null && { sourceType: input.sourceType }), + ...(input.troubleshootingText !== undefined && + input.troubleshootingText !== null && { troubleshootingText: input.troubleshootingText }), }; }; const serializeAws_restJson1ControlMappingSources = (input: ControlMappingSource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ControlMappingSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ControlMappingSource(entry, context); + }); }; const serializeAws_restJson1CreateAssessmentFrameworkControl = ( @@ -5976,7 +5981,7 @@ const serializeAws_restJson1CreateAssessmentFrameworkControl = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -5984,7 +5989,14 @@ const serializeAws_restJson1CreateAssessmentFrameworkControls = ( input: CreateAssessmentFrameworkControl[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CreateAssessmentFrameworkControl(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CreateAssessmentFrameworkControl(entry, context); + }); }; const serializeAws_restJson1CreateAssessmentFrameworkControlSet = ( @@ -5992,10 +6004,11 @@ const serializeAws_restJson1CreateAssessmentFrameworkControlSet = ( context: __SerdeContext ): any => { return { - ...(input.controls !== undefined && { - controls: serializeAws_restJson1CreateAssessmentFrameworkControls(input.controls, context), - }), - ...(input.name !== undefined && { name: input.name }), + ...(input.controls !== undefined && + input.controls !== null && { + controls: serializeAws_restJson1CreateAssessmentFrameworkControls(input.controls, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -6003,7 +6016,14 @@ const serializeAws_restJson1CreateAssessmentFrameworkControlSets = ( input: CreateAssessmentFrameworkControlSet[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CreateAssessmentFrameworkControlSet(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CreateAssessmentFrameworkControlSet(entry, context); + }); }; const serializeAws_restJson1CreateControlMappingSource = ( @@ -6011,15 +6031,20 @@ const serializeAws_restJson1CreateControlMappingSource = ( context: __SerdeContext ): any => { return { - ...(input.sourceDescription !== undefined && { sourceDescription: input.sourceDescription }), - ...(input.sourceFrequency !== undefined && { sourceFrequency: input.sourceFrequency }), - ...(input.sourceKeyword !== undefined && { - sourceKeyword: serializeAws_restJson1SourceKeyword(input.sourceKeyword, context), - }), - ...(input.sourceName !== undefined && { sourceName: input.sourceName }), - ...(input.sourceSetUpOption !== undefined && { sourceSetUpOption: input.sourceSetUpOption }), - ...(input.sourceType !== undefined && { sourceType: input.sourceType }), - ...(input.troubleshootingText !== undefined && { troubleshootingText: input.troubleshootingText }), + ...(input.sourceDescription !== undefined && + input.sourceDescription !== null && { sourceDescription: input.sourceDescription }), + ...(input.sourceFrequency !== undefined && + input.sourceFrequency !== null && { sourceFrequency: input.sourceFrequency }), + ...(input.sourceKeyword !== undefined && + input.sourceKeyword !== null && { + sourceKeyword: serializeAws_restJson1SourceKeyword(input.sourceKeyword, context), + }), + ...(input.sourceName !== undefined && input.sourceName !== null && { sourceName: input.sourceName }), + ...(input.sourceSetUpOption !== undefined && + input.sourceSetUpOption !== null && { sourceSetUpOption: input.sourceSetUpOption }), + ...(input.sourceType !== undefined && input.sourceType !== null && { sourceType: input.sourceType }), + ...(input.troubleshootingText !== undefined && + input.troubleshootingText !== null && { troubleshootingText: input.troubleshootingText }), }; }; @@ -6027,7 +6052,14 @@ const serializeAws_restJson1CreateControlMappingSources = ( input: CreateControlMappingSource[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CreateControlMappingSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CreateControlMappingSource(entry, context); + }); }; const serializeAws_restJson1CreateDelegationRequest = ( @@ -6035,10 +6067,10 @@ const serializeAws_restJson1CreateDelegationRequest = ( context: __SerdeContext ): any => { return { - ...(input.comment !== undefined && { comment: input.comment }), - ...(input.controlSetId !== undefined && { controlSetId: input.controlSetId }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.roleType !== undefined && { roleType: input.roleType }), + ...(input.comment !== undefined && input.comment !== null && { comment: input.comment }), + ...(input.controlSetId !== undefined && input.controlSetId !== null && { controlSetId: input.controlSetId }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.roleType !== undefined && input.roleType !== null && { roleType: input.roleType }), }; }; @@ -6046,64 +6078,101 @@ const serializeAws_restJson1CreateDelegationRequests = ( input: CreateDelegationRequest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CreateDelegationRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CreateDelegationRequest(entry, context); + }); }; const serializeAws_restJson1DelegationIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1EvidenceIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ManualEvidence = (input: ManualEvidence, context: __SerdeContext): any => { return { - ...(input.s3ResourcePath !== undefined && { s3ResourcePath: input.s3ResourcePath }), + ...(input.s3ResourcePath !== undefined && + input.s3ResourcePath !== null && { s3ResourcePath: input.s3ResourcePath }), }; }; const serializeAws_restJson1ManualEvidenceList = (input: ManualEvidence[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ManualEvidence(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ManualEvidence(entry, context); + }); }; const serializeAws_restJson1Role = (input: Role, context: __SerdeContext): any => { return { - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.roleType !== undefined && { roleType: input.roleType }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.roleType !== undefined && input.roleType !== null && { roleType: input.roleType }), }; }; const serializeAws_restJson1Roles = (input: Role[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Role(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Role(entry, context); + }); }; const serializeAws_restJson1Scope = (input: Scope, context: __SerdeContext): any => { return { - ...(input.awsAccounts !== undefined && { - awsAccounts: serializeAws_restJson1AWSAccounts(input.awsAccounts, context), - }), - ...(input.awsServices !== undefined && { - awsServices: serializeAws_restJson1AWSServices(input.awsServices, context), - }), + ...(input.awsAccounts !== undefined && + input.awsAccounts !== null && { awsAccounts: serializeAws_restJson1AWSAccounts(input.awsAccounts, context) }), + ...(input.awsServices !== undefined && + input.awsServices !== null && { awsServices: serializeAws_restJson1AWSServices(input.awsServices, context) }), }; }; const serializeAws_restJson1SourceKeyword = (input: SourceKeyword, context: __SerdeContext): any => { return { - ...(input.keywordInputType !== undefined && { keywordInputType: input.keywordInputType }), - ...(input.keywordValue !== undefined && { keywordValue: input.keywordValue }), + ...(input.keywordInputType !== undefined && + input.keywordInputType !== null && { keywordInputType: input.keywordInputType }), + ...(input.keywordValue !== undefined && input.keywordValue !== null && { keywordValue: input.keywordValue }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1UpdateAssessmentFrameworkControlSet = ( @@ -6111,11 +6180,12 @@ const serializeAws_restJson1UpdateAssessmentFrameworkControlSet = ( context: __SerdeContext ): any => { return { - ...(input.controls !== undefined && { - controls: serializeAws_restJson1CreateAssessmentFrameworkControls(input.controls, context), - }), - ...(input.id !== undefined && { id: input.id }), - ...(input.name !== undefined && { name: input.name }), + ...(input.controls !== undefined && + input.controls !== null && { + controls: serializeAws_restJson1CreateAssessmentFrameworkControls(input.controls, context), + }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -6123,7 +6193,14 @@ const serializeAws_restJson1UpdateAssessmentFrameworkControlSets = ( input: UpdateAssessmentFrameworkControlSet[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1UpdateAssessmentFrameworkControlSet(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1UpdateAssessmentFrameworkControlSet(entry, context); + }); }; const deserializeAws_restJson1Assessment = (output: any, context: __SerdeContext): Assessment => { @@ -6173,7 +6250,14 @@ const deserializeAws_restJson1AssessmentControl = (output: any, context: __Serde }; const deserializeAws_restJson1AssessmentControls = (output: any, context: __SerdeContext): AssessmentControl[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssessmentControl(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssessmentControl(entry, context); + }); }; const deserializeAws_restJson1AssessmentControlSet = (output: any, context: __SerdeContext): AssessmentControlSet => { @@ -6208,7 +6292,14 @@ const deserializeAws_restJson1AssessmentControlSets = ( output: any, context: __SerdeContext ): AssessmentControlSet[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssessmentControlSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssessmentControlSet(entry, context); + }); }; const deserializeAws_restJson1AssessmentEvidenceFolder = ( @@ -6267,7 +6358,14 @@ const deserializeAws_restJson1AssessmentEvidenceFolders = ( output: any, context: __SerdeContext ): AssessmentEvidenceFolder[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssessmentEvidenceFolder(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssessmentEvidenceFolder(entry, context); + }); }; const deserializeAws_restJson1AssessmentFramework = (output: any, context: __SerdeContext): AssessmentFramework => { @@ -6409,7 +6507,14 @@ const deserializeAws_restJson1AssessmentReportEvidenceErrors = ( output: any, context: __SerdeContext ): AssessmentReportEvidenceError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssessmentReportEvidenceError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssessmentReportEvidenceError(entry, context); + }); }; const deserializeAws_restJson1AssessmentReportMetadata = ( @@ -6447,7 +6552,14 @@ const deserializeAws_restJson1AssessmentReportsMetadata = ( output: any, context: __SerdeContext ): AssessmentReportMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssessmentReportMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssessmentReportMetadata(entry, context); + }); }; const deserializeAws_restJson1AWSAccount = (output: any, context: __SerdeContext): AWSAccount => { @@ -6459,7 +6571,14 @@ const deserializeAws_restJson1AWSAccount = (output: any, context: __SerdeContext }; const deserializeAws_restJson1AWSAccounts = (output: any, context: __SerdeContext): AWSAccount[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AWSAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AWSAccount(entry, context); + }); }; const deserializeAws_restJson1AWSService = (output: any, context: __SerdeContext): AWSService => { @@ -6469,7 +6588,14 @@ const deserializeAws_restJson1AWSService = (output: any, context: __SerdeContext }; const deserializeAws_restJson1AWSServices = (output: any, context: __SerdeContext): AWSService[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AWSService(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AWSService(entry, context); + }); }; const deserializeAws_restJson1BatchCreateDelegationByAssessmentError = ( @@ -6490,9 +6616,14 @@ const deserializeAws_restJson1BatchCreateDelegationByAssessmentErrors = ( output: any, context: __SerdeContext ): BatchCreateDelegationByAssessmentError[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1BatchCreateDelegationByAssessmentError(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchCreateDelegationByAssessmentError(entry, context); + }); }; const deserializeAws_restJson1BatchDeleteDelegationByAssessmentError = ( @@ -6510,9 +6641,14 @@ const deserializeAws_restJson1BatchDeleteDelegationByAssessmentErrors = ( output: any, context: __SerdeContext ): BatchDeleteDelegationByAssessmentError[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1BatchDeleteDelegationByAssessmentError(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchDeleteDelegationByAssessmentError(entry, context); + }); }; const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlError = ( @@ -6533,9 +6669,14 @@ const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlErrors = ( output: any, context: __SerdeContext ): BatchImportEvidenceToAssessmentControlError[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1BatchImportEvidenceToAssessmentControlError(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchImportEvidenceToAssessmentControlError(entry, context); + }); }; const deserializeAws_restJson1ChangeLog = (output: any, context: __SerdeContext): ChangeLog => { @@ -6552,7 +6693,14 @@ const deserializeAws_restJson1ChangeLog = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1ChangeLogs = (output: any, context: __SerdeContext): ChangeLog[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChangeLog(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChangeLog(entry, context); + }); }; const deserializeAws_restJson1Control = (output: any, context: __SerdeContext): Control => { @@ -6608,7 +6756,14 @@ const deserializeAws_restJson1ControlComment = (output: any, context: __SerdeCon }; const deserializeAws_restJson1ControlComments = (output: any, context: __SerdeContext): ControlComment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ControlComment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ControlComment(entry, context); + }); }; const deserializeAws_restJson1ControlMappingSource = (output: any, context: __SerdeContext): ControlMappingSource => { @@ -6641,7 +6796,14 @@ const deserializeAws_restJson1ControlMappingSources = ( output: any, context: __SerdeContext ): ControlMappingSource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ControlMappingSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ControlMappingSource(entry, context); + }); }; const deserializeAws_restJson1ControlMetadata = (output: any, context: __SerdeContext): ControlMetadata => { @@ -6663,11 +6825,25 @@ const deserializeAws_restJson1ControlMetadata = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ControlMetadataList = (output: any, context: __SerdeContext): ControlMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ControlMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ControlMetadata(entry, context); + }); }; const deserializeAws_restJson1Controls = (output: any, context: __SerdeContext): Control[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Control(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Control(entry, context); + }); }; const deserializeAws_restJson1ControlSet = (output: any, context: __SerdeContext): ControlSet => { @@ -6682,7 +6858,14 @@ const deserializeAws_restJson1ControlSet = (output: any, context: __SerdeContext }; const deserializeAws_restJson1ControlSets = (output: any, context: __SerdeContext): ControlSet[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ControlSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ControlSet(entry, context); + }); }; const deserializeAws_restJson1CreateDelegationRequest = ( @@ -6738,11 +6921,25 @@ const deserializeAws_restJson1DelegationMetadata = (output: any, context: __Serd }; const deserializeAws_restJson1DelegationMetadataList = (output: any, context: __SerdeContext): DelegationMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DelegationMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DelegationMetadata(entry, context); + }); }; const deserializeAws_restJson1Delegations = (output: any, context: __SerdeContext): Delegation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Delegation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Delegation(entry, context); + }); }; const deserializeAws_restJson1Evidence = (output: any, context: __SerdeContext): Evidence => { @@ -6785,25 +6982,48 @@ const deserializeAws_restJson1EvidenceAttributes = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1EvidenceIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1EvidenceList = (output: any, context: __SerdeContext): Evidence[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Evidence(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Evidence(entry, context); + }); }; const deserializeAws_restJson1EvidenceSources = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Framework = (output: any, context: __SerdeContext): Framework => { @@ -6850,18 +7070,39 @@ const deserializeAws_restJson1FrameworkMetadataList = ( output: any, context: __SerdeContext ): AssessmentFrameworkMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssessmentFrameworkMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssessmentFrameworkMetadata(entry, context); + }); }; const deserializeAws_restJson1Keywords = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListAssessmentMetadata = ( output: any, context: __SerdeContext ): AssessmentMetadataItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssessmentMetadataItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssessmentMetadataItem(entry, context); + }); }; const deserializeAws_restJson1ManualEvidence = (output: any, context: __SerdeContext): ManualEvidence => { @@ -6890,7 +7131,14 @@ const deserializeAws_restJson1Notification = (output: any, context: __SerdeConte }; const deserializeAws_restJson1Notifications = (output: any, context: __SerdeContext): Notification[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Notification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Notification(entry, context); + }); }; const deserializeAws_restJson1Resource = (output: any, context: __SerdeContext): Resource => { @@ -6901,7 +7149,14 @@ const deserializeAws_restJson1Resource = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Resources = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Resource(entry, context); + }); }; const deserializeAws_restJson1Role = (output: any, context: __SerdeContext): Role => { @@ -6912,7 +7167,14 @@ const deserializeAws_restJson1Role = (output: any, context: __SerdeContext): Rol }; const deserializeAws_restJson1Roles = (output: any, context: __SerdeContext): Role[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Role(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Role(entry, context); + }); }; const deserializeAws_restJson1Scope = (output: any, context: __SerdeContext): Scope => { @@ -6938,7 +7200,14 @@ const deserializeAws_restJson1ServiceMetadata = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ServiceMetadataList = (output: any, context: __SerdeContext): ServiceMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ServiceMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ServiceMetadata(entry, context); + }); }; const deserializeAws_restJson1Settings = (output: any, context: __SerdeContext): Settings => { @@ -6967,13 +7236,15 @@ const deserializeAws_restJson1SourceKeyword = (output: any, context: __SerdeCont }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1URL = (output: any, context: __SerdeContext): URL => { @@ -6985,7 +7256,14 @@ const deserializeAws_restJson1URL = (output: any, context: __SerdeContext): URL }; const deserializeAws_restJson1ValidationErrors = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ValidationExceptionField = ( @@ -7002,7 +7280,14 @@ const deserializeAws_restJson1ValidationExceptionFieldList = ( output: any, context: __SerdeContext ): ValidationExceptionField[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ValidationExceptionField(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ValidationExceptionField(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -7025,6 +7310,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts b/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts index 55c7e40ef4bd..13ef39a5026b 100644 --- a/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts +++ b/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts @@ -61,7 +61,7 @@ export const serializeAws_json1_1CreateScalingPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleScalingPlannerFrontendService.CreateScalingPlan", }; let body: any; @@ -74,7 +74,7 @@ export const serializeAws_json1_1DeleteScalingPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleScalingPlannerFrontendService.DeleteScalingPlan", }; let body: any; @@ -87,7 +87,7 @@ export const serializeAws_json1_1DescribeScalingPlanResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources", }; let body: any; @@ -100,7 +100,7 @@ export const serializeAws_json1_1DescribeScalingPlansCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleScalingPlannerFrontendService.DescribeScalingPlans", }; let body: any; @@ -113,7 +113,7 @@ export const serializeAws_json1_1GetScalingPlanResourceForecastDataCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleScalingPlannerFrontendService.GetScalingPlanResourceForecastData", }; let body: any; @@ -126,7 +126,7 @@ export const serializeAws_json1_1UpdateScalingPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AnyScaleScalingPlannerFrontendService.UpdateScalingPlan", }; let body: any; @@ -161,8 +161,7 @@ const deserializeAws_json1_1CreateScalingPlanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": @@ -240,8 +239,7 @@ const deserializeAws_json1_1DeleteScalingPlanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": @@ -319,8 +317,7 @@ const deserializeAws_json1_1DescribeScalingPlanResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": @@ -398,8 +395,7 @@ const deserializeAws_json1_1DescribeScalingPlansCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": @@ -477,8 +473,7 @@ const deserializeAws_json1_1GetScalingPlanResourceForecastDataCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.autoscalingplans#InternalServiceException": @@ -540,8 +535,7 @@ const deserializeAws_json1_1UpdateScalingPlanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentUpdateException": case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": @@ -684,13 +678,22 @@ const deserializeAws_json1_1ValidationExceptionResponse = async ( const serializeAws_json1_1ApplicationSource = (input: ApplicationSource, context: __SerdeContext): any => { return { - ...(input.CloudFormationStackARN !== undefined && { CloudFormationStackARN: input.CloudFormationStackARN }), - ...(input.TagFilters !== undefined && { TagFilters: serializeAws_json1_1TagFilters(input.TagFilters, context) }), + ...(input.CloudFormationStackARN !== undefined && + input.CloudFormationStackARN !== null && { CloudFormationStackARN: input.CloudFormationStackARN }), + ...(input.TagFilters !== undefined && + input.TagFilters !== null && { TagFilters: serializeAws_json1_1TagFilters(input.TagFilters, context) }), }; }; const serializeAws_json1_1ApplicationSources = (input: ApplicationSource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ApplicationSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ApplicationSource(entry, context); + }); }; const serializeAws_json1_1CreateScalingPlanRequest = ( @@ -698,13 +701,16 @@ const serializeAws_json1_1CreateScalingPlanRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationSource !== undefined && { - ApplicationSource: serializeAws_json1_1ApplicationSource(input.ApplicationSource, context), - }), - ...(input.ScalingInstructions !== undefined && { - ScalingInstructions: serializeAws_json1_1ScalingInstructions(input.ScalingInstructions, context), - }), - ...(input.ScalingPlanName !== undefined && { ScalingPlanName: input.ScalingPlanName }), + ...(input.ApplicationSource !== undefined && + input.ApplicationSource !== null && { + ApplicationSource: serializeAws_json1_1ApplicationSource(input.ApplicationSource, context), + }), + ...(input.ScalingInstructions !== undefined && + input.ScalingInstructions !== null && { + ScalingInstructions: serializeAws_json1_1ScalingInstructions(input.ScalingInstructions, context), + }), + ...(input.ScalingPlanName !== undefined && + input.ScalingPlanName !== null && { ScalingPlanName: input.ScalingPlanName }), }; }; @@ -713,13 +719,12 @@ const serializeAws_json1_1CustomizedLoadMetricSpecification = ( context: __SerdeContext ): any => { return { - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context), - }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Namespace !== undefined && { Namespace: input.Namespace }), - ...(input.Statistic !== undefined && { Statistic: input.Statistic }), - ...(input.Unit !== undefined && { Unit: input.Unit }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context) }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Namespace !== undefined && input.Namespace !== null && { Namespace: input.Namespace }), + ...(input.Statistic !== undefined && input.Statistic !== null && { Statistic: input.Statistic }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), }; }; @@ -728,13 +733,12 @@ const serializeAws_json1_1CustomizedScalingMetricSpecification = ( context: __SerdeContext ): any => { return { - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context), - }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Namespace !== undefined && { Namespace: input.Namespace }), - ...(input.Statistic !== undefined && { Statistic: input.Statistic }), - ...(input.Unit !== undefined && { Unit: input.Unit }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_json1_1MetricDimensions(input.Dimensions, context) }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Namespace !== undefined && input.Namespace !== null && { Namespace: input.Namespace }), + ...(input.Statistic !== undefined && input.Statistic !== null && { Statistic: input.Statistic }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), }; }; @@ -743,8 +747,10 @@ const serializeAws_json1_1DeleteScalingPlanRequest = ( context: __SerdeContext ): any => { return { - ...(input.ScalingPlanName !== undefined && { ScalingPlanName: input.ScalingPlanName }), - ...(input.ScalingPlanVersion !== undefined && { ScalingPlanVersion: input.ScalingPlanVersion }), + ...(input.ScalingPlanName !== undefined && + input.ScalingPlanName !== null && { ScalingPlanName: input.ScalingPlanName }), + ...(input.ScalingPlanVersion !== undefined && + input.ScalingPlanVersion !== null && { ScalingPlanVersion: input.ScalingPlanVersion }), }; }; @@ -753,10 +759,12 @@ const serializeAws_json1_1DescribeScalingPlanResourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ScalingPlanName !== undefined && { ScalingPlanName: input.ScalingPlanName }), - ...(input.ScalingPlanVersion !== undefined && { ScalingPlanVersion: input.ScalingPlanVersion }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ScalingPlanName !== undefined && + input.ScalingPlanName !== null && { ScalingPlanName: input.ScalingPlanName }), + ...(input.ScalingPlanVersion !== undefined && + input.ScalingPlanVersion !== null && { ScalingPlanVersion: input.ScalingPlanVersion }), }; }; @@ -765,15 +773,18 @@ const serializeAws_json1_1DescribeScalingPlansRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationSources !== undefined && { - ApplicationSources: serializeAws_json1_1ApplicationSources(input.ApplicationSources, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ScalingPlanNames !== undefined && { - ScalingPlanNames: serializeAws_json1_1ScalingPlanNames(input.ScalingPlanNames, context), - }), - ...(input.ScalingPlanVersion !== undefined && { ScalingPlanVersion: input.ScalingPlanVersion }), + ...(input.ApplicationSources !== undefined && + input.ApplicationSources !== null && { + ApplicationSources: serializeAws_json1_1ApplicationSources(input.ApplicationSources, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ScalingPlanNames !== undefined && + input.ScalingPlanNames !== null && { + ScalingPlanNames: serializeAws_json1_1ScalingPlanNames(input.ScalingPlanNames, context), + }), + ...(input.ScalingPlanVersion !== undefined && + input.ScalingPlanVersion !== null && { ScalingPlanVersion: input.ScalingPlanVersion }), }; }; @@ -782,26 +793,40 @@ const serializeAws_json1_1GetScalingPlanResourceForecastDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.ForecastDataType !== undefined && { ForecastDataType: input.ForecastDataType }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ScalingPlanName !== undefined && { ScalingPlanName: input.ScalingPlanName }), - ...(input.ScalingPlanVersion !== undefined && { ScalingPlanVersion: input.ScalingPlanVersion }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.ForecastDataType !== undefined && + input.ForecastDataType !== null && { ForecastDataType: input.ForecastDataType }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ScalingPlanName !== undefined && + input.ScalingPlanName !== null && { ScalingPlanName: input.ScalingPlanName }), + ...(input.ScalingPlanVersion !== undefined && + input.ScalingPlanVersion !== null && { ScalingPlanVersion: input.ScalingPlanVersion }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1MetricDimension = (input: MetricDimension, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1MetricDimensions = (input: MetricDimension[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MetricDimension(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MetricDimension(entry, context); + }); }; const serializeAws_json1_1PredefinedLoadMetricSpecification = ( @@ -809,8 +834,9 @@ const serializeAws_json1_1PredefinedLoadMetricSpecification = ( context: __SerdeContext ): any => { return { - ...(input.PredefinedLoadMetricType !== undefined && { PredefinedLoadMetricType: input.PredefinedLoadMetricType }), - ...(input.ResourceLabel !== undefined && { ResourceLabel: input.ResourceLabel }), + ...(input.PredefinedLoadMetricType !== undefined && + input.PredefinedLoadMetricType !== null && { PredefinedLoadMetricType: input.PredefinedLoadMetricType }), + ...(input.ResourceLabel !== undefined && input.ResourceLabel !== null && { ResourceLabel: input.ResourceLabel }), }; }; @@ -819,76 +845,111 @@ const serializeAws_json1_1PredefinedScalingMetricSpecification = ( context: __SerdeContext ): any => { return { - ...(input.PredefinedScalingMetricType !== undefined && { - PredefinedScalingMetricType: input.PredefinedScalingMetricType, - }), - ...(input.ResourceLabel !== undefined && { ResourceLabel: input.ResourceLabel }), + ...(input.PredefinedScalingMetricType !== undefined && + input.PredefinedScalingMetricType !== null && { PredefinedScalingMetricType: input.PredefinedScalingMetricType }), + ...(input.ResourceLabel !== undefined && input.ResourceLabel !== null && { ResourceLabel: input.ResourceLabel }), }; }; const serializeAws_json1_1ScalingInstruction = (input: ScalingInstruction, context: __SerdeContext): any => { return { - ...(input.CustomizedLoadMetricSpecification !== undefined && { - CustomizedLoadMetricSpecification: serializeAws_json1_1CustomizedLoadMetricSpecification( - input.CustomizedLoadMetricSpecification, - context - ), - }), - ...(input.DisableDynamicScaling !== undefined && { DisableDynamicScaling: input.DisableDynamicScaling }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MinCapacity !== undefined && { MinCapacity: input.MinCapacity }), - ...(input.PredefinedLoadMetricSpecification !== undefined && { - PredefinedLoadMetricSpecification: serializeAws_json1_1PredefinedLoadMetricSpecification( - input.PredefinedLoadMetricSpecification, - context - ), - }), - ...(input.PredictiveScalingMaxCapacityBehavior !== undefined && { - PredictiveScalingMaxCapacityBehavior: input.PredictiveScalingMaxCapacityBehavior, - }), - ...(input.PredictiveScalingMaxCapacityBuffer !== undefined && { - PredictiveScalingMaxCapacityBuffer: input.PredictiveScalingMaxCapacityBuffer, - }), - ...(input.PredictiveScalingMode !== undefined && { PredictiveScalingMode: input.PredictiveScalingMode }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ScalableDimension !== undefined && { ScalableDimension: input.ScalableDimension }), - ...(input.ScalingPolicyUpdateBehavior !== undefined && { - ScalingPolicyUpdateBehavior: input.ScalingPolicyUpdateBehavior, - }), - ...(input.ScheduledActionBufferTime !== undefined && { - ScheduledActionBufferTime: input.ScheduledActionBufferTime, - }), - ...(input.ServiceNamespace !== undefined && { ServiceNamespace: input.ServiceNamespace }), - ...(input.TargetTrackingConfigurations !== undefined && { - TargetTrackingConfigurations: serializeAws_json1_1TargetTrackingConfigurations( - input.TargetTrackingConfigurations, - context - ), - }), + ...(input.CustomizedLoadMetricSpecification !== undefined && + input.CustomizedLoadMetricSpecification !== null && { + CustomizedLoadMetricSpecification: serializeAws_json1_1CustomizedLoadMetricSpecification( + input.CustomizedLoadMetricSpecification, + context + ), + }), + ...(input.DisableDynamicScaling !== undefined && + input.DisableDynamicScaling !== null && { DisableDynamicScaling: input.DisableDynamicScaling }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MinCapacity !== undefined && input.MinCapacity !== null && { MinCapacity: input.MinCapacity }), + ...(input.PredefinedLoadMetricSpecification !== undefined && + input.PredefinedLoadMetricSpecification !== null && { + PredefinedLoadMetricSpecification: serializeAws_json1_1PredefinedLoadMetricSpecification( + input.PredefinedLoadMetricSpecification, + context + ), + }), + ...(input.PredictiveScalingMaxCapacityBehavior !== undefined && + input.PredictiveScalingMaxCapacityBehavior !== null && { + PredictiveScalingMaxCapacityBehavior: input.PredictiveScalingMaxCapacityBehavior, + }), + ...(input.PredictiveScalingMaxCapacityBuffer !== undefined && + input.PredictiveScalingMaxCapacityBuffer !== null && { + PredictiveScalingMaxCapacityBuffer: input.PredictiveScalingMaxCapacityBuffer, + }), + ...(input.PredictiveScalingMode !== undefined && + input.PredictiveScalingMode !== null && { PredictiveScalingMode: input.PredictiveScalingMode }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && + input.ScalableDimension !== null && { ScalableDimension: input.ScalableDimension }), + ...(input.ScalingPolicyUpdateBehavior !== undefined && + input.ScalingPolicyUpdateBehavior !== null && { ScalingPolicyUpdateBehavior: input.ScalingPolicyUpdateBehavior }), + ...(input.ScheduledActionBufferTime !== undefined && + input.ScheduledActionBufferTime !== null && { ScheduledActionBufferTime: input.ScheduledActionBufferTime }), + ...(input.ServiceNamespace !== undefined && + input.ServiceNamespace !== null && { ServiceNamespace: input.ServiceNamespace }), + ...(input.TargetTrackingConfigurations !== undefined && + input.TargetTrackingConfigurations !== null && { + TargetTrackingConfigurations: serializeAws_json1_1TargetTrackingConfigurations( + input.TargetTrackingConfigurations, + context + ), + }), }; }; const serializeAws_json1_1ScalingInstructions = (input: ScalingInstruction[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ScalingInstruction(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ScalingInstruction(entry, context); + }); }; const serializeAws_json1_1ScalingPlanNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagFilter = (input: TagFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1TagValues(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1TagValues(input.Values, context) }), }; }; const serializeAws_json1_1TagFilters = (input: TagFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TagFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TagFilter(entry, context); + }); }; const serializeAws_json1_1TagValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TargetTrackingConfiguration = ( @@ -896,23 +957,29 @@ const serializeAws_json1_1TargetTrackingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CustomizedScalingMetricSpecification !== undefined && { - CustomizedScalingMetricSpecification: serializeAws_json1_1CustomizedScalingMetricSpecification( - input.CustomizedScalingMetricSpecification, - context - ), - }), - ...(input.DisableScaleIn !== undefined && { DisableScaleIn: input.DisableScaleIn }), - ...(input.EstimatedInstanceWarmup !== undefined && { EstimatedInstanceWarmup: input.EstimatedInstanceWarmup }), - ...(input.PredefinedScalingMetricSpecification !== undefined && { - PredefinedScalingMetricSpecification: serializeAws_json1_1PredefinedScalingMetricSpecification( - input.PredefinedScalingMetricSpecification, - context - ), - }), - ...(input.ScaleInCooldown !== undefined && { ScaleInCooldown: input.ScaleInCooldown }), - ...(input.ScaleOutCooldown !== undefined && { ScaleOutCooldown: input.ScaleOutCooldown }), - ...(input.TargetValue !== undefined && { TargetValue: input.TargetValue }), + ...(input.CustomizedScalingMetricSpecification !== undefined && + input.CustomizedScalingMetricSpecification !== null && { + CustomizedScalingMetricSpecification: serializeAws_json1_1CustomizedScalingMetricSpecification( + input.CustomizedScalingMetricSpecification, + context + ), + }), + ...(input.DisableScaleIn !== undefined && + input.DisableScaleIn !== null && { DisableScaleIn: input.DisableScaleIn }), + ...(input.EstimatedInstanceWarmup !== undefined && + input.EstimatedInstanceWarmup !== null && { EstimatedInstanceWarmup: input.EstimatedInstanceWarmup }), + ...(input.PredefinedScalingMetricSpecification !== undefined && + input.PredefinedScalingMetricSpecification !== null && { + PredefinedScalingMetricSpecification: serializeAws_json1_1PredefinedScalingMetricSpecification( + input.PredefinedScalingMetricSpecification, + context + ), + }), + ...(input.ScaleInCooldown !== undefined && + input.ScaleInCooldown !== null && { ScaleInCooldown: input.ScaleInCooldown }), + ...(input.ScaleOutCooldown !== undefined && + input.ScaleOutCooldown !== null && { ScaleOutCooldown: input.ScaleOutCooldown }), + ...(input.TargetValue !== undefined && input.TargetValue !== null && { TargetValue: input.TargetValue }), }; }; @@ -920,7 +987,14 @@ const serializeAws_json1_1TargetTrackingConfigurations = ( input: TargetTrackingConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1TargetTrackingConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TargetTrackingConfiguration(entry, context); + }); }; const serializeAws_json1_1UpdateScalingPlanRequest = ( @@ -928,14 +1002,18 @@ const serializeAws_json1_1UpdateScalingPlanRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationSource !== undefined && { - ApplicationSource: serializeAws_json1_1ApplicationSource(input.ApplicationSource, context), - }), - ...(input.ScalingInstructions !== undefined && { - ScalingInstructions: serializeAws_json1_1ScalingInstructions(input.ScalingInstructions, context), - }), - ...(input.ScalingPlanName !== undefined && { ScalingPlanName: input.ScalingPlanName }), - ...(input.ScalingPlanVersion !== undefined && { ScalingPlanVersion: input.ScalingPlanVersion }), + ...(input.ApplicationSource !== undefined && + input.ApplicationSource !== null && { + ApplicationSource: serializeAws_json1_1ApplicationSource(input.ApplicationSource, context), + }), + ...(input.ScalingInstructions !== undefined && + input.ScalingInstructions !== null && { + ScalingInstructions: serializeAws_json1_1ScalingInstructions(input.ScalingInstructions, context), + }), + ...(input.ScalingPlanName !== undefined && + input.ScalingPlanName !== null && { ScalingPlanName: input.ScalingPlanName }), + ...(input.ScalingPlanVersion !== undefined && + input.ScalingPlanVersion !== null && { ScalingPlanVersion: input.ScalingPlanVersion }), }; }; @@ -1016,7 +1094,14 @@ const deserializeAws_json1_1Datapoint = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Datapoints = (output: any, context: __SerdeContext): Datapoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Datapoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Datapoint(entry, context); + }); }; const deserializeAws_json1_1DeleteScalingPlanResponse = ( @@ -1096,7 +1181,14 @@ const deserializeAws_json1_1MetricDimension = (output: any, context: __SerdeCont }; const deserializeAws_json1_1MetricDimensions = (output: any, context: __SerdeContext): MetricDimension[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricDimension(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricDimension(entry, context); + }); }; const deserializeAws_json1_1ObjectNotFoundException = ( @@ -1187,7 +1279,14 @@ const deserializeAws_json1_1ScalingInstruction = (output: any, context: __SerdeC }; const deserializeAws_json1_1ScalingInstructions = (output: any, context: __SerdeContext): ScalingInstruction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScalingInstruction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScalingInstruction(entry, context); + }); }; const deserializeAws_json1_1ScalingPlan = (output: any, context: __SerdeContext): ScalingPlan => { @@ -1251,15 +1350,36 @@ const deserializeAws_json1_1ScalingPlanResource = (output: any, context: __Serde }; const deserializeAws_json1_1ScalingPlanResources = (output: any, context: __SerdeContext): ScalingPlanResource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScalingPlanResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScalingPlanResource(entry, context); + }); }; const deserializeAws_json1_1ScalingPlans = (output: any, context: __SerdeContext): ScalingPlan[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScalingPlan(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScalingPlan(entry, context); + }); }; const deserializeAws_json1_1ScalingPolicies = (output: any, context: __SerdeContext): ScalingPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScalingPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScalingPolicy(entry, context); + }); }; const deserializeAws_json1_1ScalingPolicy = (output: any, context: __SerdeContext): ScalingPolicy => { @@ -1284,11 +1404,25 @@ const deserializeAws_json1_1TagFilter = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1TagFilters = (output: any, context: __SerdeContext): TagFilter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TagFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TagFilter(entry, context); + }); }; const deserializeAws_json1_1TagValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TargetTrackingConfiguration = ( @@ -1328,7 +1462,14 @@ const deserializeAws_json1_1TargetTrackingConfigurations = ( output: any, context: __SerdeContext ): TargetTrackingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TargetTrackingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TargetTrackingConfiguration(entry, context); + }); }; const deserializeAws_json1_1UpdateScalingPlanResponse = ( @@ -1394,3 +1535,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-auto-scaling/protocols/Aws_query.ts b/clients/client-auto-scaling/protocols/Aws_query.ts index c4e7a22b7d9a..1dda4454858b 100644 --- a/clients/client-auto-scaling/protocols/Aws_query.ts +++ b/clients/client-auto-scaling/protocols/Aws_query.ts @@ -336,7 +336,7 @@ export const serializeAws_queryAttachInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -352,7 +352,7 @@ export const serializeAws_queryAttachLoadBalancersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -368,7 +368,7 @@ export const serializeAws_queryAttachLoadBalancerTargetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -384,7 +384,7 @@ export const serializeAws_queryBatchDeleteScheduledActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -400,7 +400,7 @@ export const serializeAws_queryBatchPutScheduledUpdateGroupActionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -416,7 +416,7 @@ export const serializeAws_queryCancelInstanceRefreshCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -432,7 +432,7 @@ export const serializeAws_queryCompleteLifecycleActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -448,7 +448,7 @@ export const serializeAws_queryCreateAutoScalingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -464,7 +464,7 @@ export const serializeAws_queryCreateLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -480,7 +480,7 @@ export const serializeAws_queryCreateOrUpdateTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -496,7 +496,7 @@ export const serializeAws_queryDeleteAutoScalingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -512,7 +512,7 @@ export const serializeAws_queryDeleteLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -528,7 +528,7 @@ export const serializeAws_queryDeleteLifecycleHookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -544,7 +544,7 @@ export const serializeAws_queryDeleteNotificationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -560,7 +560,7 @@ export const serializeAws_queryDeletePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -576,7 +576,7 @@ export const serializeAws_queryDeleteScheduledActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -592,7 +592,7 @@ export const serializeAws_queryDeleteTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -608,7 +608,7 @@ export const serializeAws_queryDescribeAccountLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DescribeAccountLimits", @@ -622,7 +622,7 @@ export const serializeAws_queryDescribeAdjustmentTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DescribeAdjustmentTypes", @@ -636,7 +636,7 @@ export const serializeAws_queryDescribeAutoScalingGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -652,7 +652,7 @@ export const serializeAws_queryDescribeAutoScalingInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -668,7 +668,7 @@ export const serializeAws_queryDescribeAutoScalingNotificationTypesCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DescribeAutoScalingNotificationTypes", @@ -682,7 +682,7 @@ export const serializeAws_queryDescribeInstanceRefreshesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -698,7 +698,7 @@ export const serializeAws_queryDescribeLaunchConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -714,7 +714,7 @@ export const serializeAws_queryDescribeLifecycleHooksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -730,7 +730,7 @@ export const serializeAws_queryDescribeLifecycleHookTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DescribeLifecycleHookTypes", @@ -744,7 +744,7 @@ export const serializeAws_queryDescribeLoadBalancersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -760,7 +760,7 @@ export const serializeAws_queryDescribeLoadBalancerTargetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -776,7 +776,7 @@ export const serializeAws_queryDescribeMetricCollectionTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DescribeMetricCollectionTypes", @@ -790,7 +790,7 @@ export const serializeAws_queryDescribeNotificationConfigurationsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -806,7 +806,7 @@ export const serializeAws_queryDescribePoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -822,7 +822,7 @@ export const serializeAws_queryDescribeScalingActivitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -838,7 +838,7 @@ export const serializeAws_queryDescribeScalingProcessTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DescribeScalingProcessTypes", @@ -852,7 +852,7 @@ export const serializeAws_queryDescribeScheduledActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -868,7 +868,7 @@ export const serializeAws_queryDescribeTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -884,7 +884,7 @@ export const serializeAws_queryDescribeTerminationPolicyTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DescribeTerminationPolicyTypes", @@ -898,7 +898,7 @@ export const serializeAws_queryDetachInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -914,7 +914,7 @@ export const serializeAws_queryDetachLoadBalancersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -930,7 +930,7 @@ export const serializeAws_queryDetachLoadBalancerTargetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -946,7 +946,7 @@ export const serializeAws_queryDisableMetricsCollectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -962,7 +962,7 @@ export const serializeAws_queryEnableMetricsCollectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -978,7 +978,7 @@ export const serializeAws_queryEnterStandbyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -994,7 +994,7 @@ export const serializeAws_queryExecutePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1010,7 +1010,7 @@ export const serializeAws_queryExitStandbyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1026,7 +1026,7 @@ export const serializeAws_queryPutLifecycleHookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1042,7 +1042,7 @@ export const serializeAws_queryPutNotificationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1058,7 +1058,7 @@ export const serializeAws_queryPutScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1074,7 +1074,7 @@ export const serializeAws_queryPutScheduledUpdateGroupActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1090,7 +1090,7 @@ export const serializeAws_queryRecordLifecycleActionHeartbeatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1106,7 +1106,7 @@ export const serializeAws_queryResumeProcessesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1122,7 +1122,7 @@ export const serializeAws_querySetDesiredCapacityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1138,7 +1138,7 @@ export const serializeAws_querySetInstanceHealthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1154,7 +1154,7 @@ export const serializeAws_querySetInstanceProtectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1170,7 +1170,7 @@ export const serializeAws_queryStartInstanceRefreshCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1186,7 +1186,7 @@ export const serializeAws_querySuspendProcessesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1202,7 +1202,7 @@ export const serializeAws_queryTerminateInstanceInAutoScalingGroupCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1218,7 +1218,7 @@ export const serializeAws_queryUpdateAutoScalingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4786,6 +4786,9 @@ const serializeAws_queryActivityIds = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4794,14 +4797,14 @@ const serializeAws_queryActivityIds = (input: string[], context: __SerdeContext) const serializeAws_queryAttachInstancesQuery = (input: AttachInstancesQuery, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_queryInstanceIds(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceIds.${key}`; entries[loc] = value; }); } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } return entries; @@ -4809,10 +4812,10 @@ const serializeAws_queryAttachInstancesQuery = (input: AttachInstancesQuery, con const serializeAws_queryAttachLoadBalancersType = (input: AttachLoadBalancersType, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.LoadBalancerNames !== undefined) { + if (input.LoadBalancerNames !== undefined && input.LoadBalancerNames !== null) { const memberEntries = serializeAws_queryLoadBalancerNames(input.LoadBalancerNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerNames.${key}`; @@ -4827,10 +4830,10 @@ const serializeAws_queryAttachLoadBalancerTargetGroupsType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.TargetGroupARNs !== undefined) { + if (input.TargetGroupARNs !== undefined && input.TargetGroupARNs !== null) { const memberEntries = serializeAws_queryTargetGroupARNs(input.TargetGroupARNs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetGroupARNs.${key}`; @@ -4844,6 +4847,9 @@ const serializeAws_queryAutoScalingGroupNames = (input: string[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4855,17 +4861,17 @@ const serializeAws_queryAutoScalingGroupNamesType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupNames !== undefined) { + if (input.AutoScalingGroupNames !== undefined && input.AutoScalingGroupNames !== null) { const memberEntries = serializeAws_queryAutoScalingGroupNames(input.AutoScalingGroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AutoScalingGroupNames.${key}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -4875,6 +4881,9 @@ const serializeAws_queryAutoScalingNotificationTypes = (input: string[], context const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4885,6 +4894,9 @@ const serializeAws_queryAvailabilityZones = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4896,10 +4908,10 @@ const serializeAws_queryBatchDeleteScheduledActionType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ScheduledActionNames !== undefined) { + if (input.ScheduledActionNames !== undefined && input.ScheduledActionNames !== null) { const memberEntries = serializeAws_queryScheduledActionNames(input.ScheduledActionNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScheduledActionNames.${key}`; @@ -4914,10 +4926,10 @@ const serializeAws_queryBatchPutScheduledUpdateGroupActionType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ScheduledUpdateGroupActions !== undefined) { + if (input.ScheduledUpdateGroupActions !== undefined && input.ScheduledUpdateGroupActions !== null) { const memberEntries = serializeAws_queryScheduledUpdateGroupActionRequests( input.ScheduledUpdateGroupActions, context @@ -4932,20 +4944,20 @@ const serializeAws_queryBatchPutScheduledUpdateGroupActionType = ( const serializeAws_queryBlockDeviceMapping = (input: BlockDeviceMapping, context: __SerdeContext): any => { const entries: any = {}; - if (input.VirtualName !== undefined) { + if (input.VirtualName !== undefined && input.VirtualName !== null) { entries["VirtualName"] = input.VirtualName; } - if (input.DeviceName !== undefined) { + if (input.DeviceName !== undefined && input.DeviceName !== null) { entries["DeviceName"] = input.DeviceName; } - if (input.Ebs !== undefined) { + if (input.Ebs !== undefined && input.Ebs !== null) { const memberEntries = serializeAws_queryEbs(input.Ebs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ebs.${key}`; entries[loc] = value; }); } - if (input.NoDevice !== undefined) { + if (input.NoDevice !== undefined && input.NoDevice !== null) { entries["NoDevice"] = input.NoDevice; } return entries; @@ -4955,6 +4967,9 @@ const serializeAws_queryBlockDeviceMappings = (input: BlockDeviceMapping[], cont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryBlockDeviceMapping(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -4969,7 +4984,7 @@ const serializeAws_queryCancelInstanceRefreshType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } return entries; @@ -4979,6 +4994,9 @@ const serializeAws_queryClassicLinkVPCSecurityGroups = (input: string[], context const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4990,19 +5008,19 @@ const serializeAws_queryCompleteLifecycleActionType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LifecycleHookName !== undefined) { + if (input.LifecycleHookName !== undefined && input.LifecycleHookName !== null) { entries["LifecycleHookName"] = input.LifecycleHookName; } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.LifecycleActionToken !== undefined) { + if (input.LifecycleActionToken !== undefined && input.LifecycleActionToken !== null) { entries["LifecycleActionToken"] = input.LifecycleActionToken; } - if (input.LifecycleActionResult !== undefined) { + if (input.LifecycleActionResult !== undefined && input.LifecycleActionResult !== null) { entries["LifecycleActionResult"] = input.LifecycleActionResult; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } return entries; @@ -5013,105 +5031,105 @@ const serializeAws_queryCreateAutoScalingGroupType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.LaunchConfigurationName !== undefined) { + if (input.LaunchConfigurationName !== undefined && input.LaunchConfigurationName !== null) { entries["LaunchConfigurationName"] = input.LaunchConfigurationName; } - if (input.LaunchTemplate !== undefined) { + if (input.LaunchTemplate !== undefined && input.LaunchTemplate !== null) { const memberEntries = serializeAws_queryLaunchTemplateSpecification(input.LaunchTemplate, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplate.${key}`; entries[loc] = value; }); } - if (input.MixedInstancesPolicy !== undefined) { + if (input.MixedInstancesPolicy !== undefined && input.MixedInstancesPolicy !== null) { const memberEntries = serializeAws_queryMixedInstancesPolicy(input.MixedInstancesPolicy, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MixedInstancesPolicy.${key}`; entries[loc] = value; }); } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.MinSize !== undefined) { + if (input.MinSize !== undefined && input.MinSize !== null) { entries["MinSize"] = input.MinSize; } - if (input.MaxSize !== undefined) { + if (input.MaxSize !== undefined && input.MaxSize !== null) { entries["MaxSize"] = input.MaxSize; } - if (input.DesiredCapacity !== undefined) { + if (input.DesiredCapacity !== undefined && input.DesiredCapacity !== null) { entries["DesiredCapacity"] = input.DesiredCapacity; } - if (input.DefaultCooldown !== undefined) { + if (input.DefaultCooldown !== undefined && input.DefaultCooldown !== null) { entries["DefaultCooldown"] = input.DefaultCooldown; } - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerNames !== undefined) { + if (input.LoadBalancerNames !== undefined && input.LoadBalancerNames !== null) { const memberEntries = serializeAws_queryLoadBalancerNames(input.LoadBalancerNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerNames.${key}`; entries[loc] = value; }); } - if (input.TargetGroupARNs !== undefined) { + if (input.TargetGroupARNs !== undefined && input.TargetGroupARNs !== null) { const memberEntries = serializeAws_queryTargetGroupARNs(input.TargetGroupARNs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetGroupARNs.${key}`; entries[loc] = value; }); } - if (input.HealthCheckType !== undefined) { + if (input.HealthCheckType !== undefined && input.HealthCheckType !== null) { entries["HealthCheckType"] = input.HealthCheckType; } - if (input.HealthCheckGracePeriod !== undefined) { + if (input.HealthCheckGracePeriod !== undefined && input.HealthCheckGracePeriod !== null) { entries["HealthCheckGracePeriod"] = input.HealthCheckGracePeriod; } - if (input.PlacementGroup !== undefined) { + if (input.PlacementGroup !== undefined && input.PlacementGroup !== null) { entries["PlacementGroup"] = input.PlacementGroup; } - if (input.VPCZoneIdentifier !== undefined) { + if (input.VPCZoneIdentifier !== undefined && input.VPCZoneIdentifier !== null) { entries["VPCZoneIdentifier"] = input.VPCZoneIdentifier; } - if (input.TerminationPolicies !== undefined) { + if (input.TerminationPolicies !== undefined && input.TerminationPolicies !== null) { const memberEntries = serializeAws_queryTerminationPolicies(input.TerminationPolicies, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TerminationPolicies.${key}`; entries[loc] = value; }); } - if (input.NewInstancesProtectedFromScaleIn !== undefined) { + if (input.NewInstancesProtectedFromScaleIn !== undefined && input.NewInstancesProtectedFromScaleIn !== null) { entries["NewInstancesProtectedFromScaleIn"] = input.NewInstancesProtectedFromScaleIn; } - if (input.CapacityRebalance !== undefined) { + if (input.CapacityRebalance !== undefined && input.CapacityRebalance !== null) { entries["CapacityRebalance"] = input.CapacityRebalance; } - if (input.LifecycleHookSpecificationList !== undefined) { + if (input.LifecycleHookSpecificationList !== undefined && input.LifecycleHookSpecificationList !== null) { const memberEntries = serializeAws_queryLifecycleHookSpecifications(input.LifecycleHookSpecificationList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LifecycleHookSpecificationList.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ServiceLinkedRoleARN !== undefined) { + if (input.ServiceLinkedRoleARN !== undefined && input.ServiceLinkedRoleARN !== null) { entries["ServiceLinkedRoleARN"] = input.ServiceLinkedRoleARN; } - if (input.MaxInstanceLifetime !== undefined) { + if (input.MaxInstanceLifetime !== undefined && input.MaxInstanceLifetime !== null) { entries["MaxInstanceLifetime"] = input.MaxInstanceLifetime; } return entries; @@ -5122,77 +5140,77 @@ const serializeAws_queryCreateLaunchConfigurationType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LaunchConfigurationName !== undefined) { + if (input.LaunchConfigurationName !== undefined && input.LaunchConfigurationName !== null) { entries["LaunchConfigurationName"] = input.LaunchConfigurationName; } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.KeyName !== undefined) { + if (input.KeyName !== undefined && input.KeyName !== null) { entries["KeyName"] = input.KeyName; } - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_querySecurityGroups(input.SecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroups.${key}`; entries[loc] = value; }); } - if (input.ClassicLinkVPCId !== undefined) { + if (input.ClassicLinkVPCId !== undefined && input.ClassicLinkVPCId !== null) { entries["ClassicLinkVPCId"] = input.ClassicLinkVPCId; } - if (input.ClassicLinkVPCSecurityGroups !== undefined) { + if (input.ClassicLinkVPCSecurityGroups !== undefined && input.ClassicLinkVPCSecurityGroups !== null) { const memberEntries = serializeAws_queryClassicLinkVPCSecurityGroups(input.ClassicLinkVPCSecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClassicLinkVPCSecurityGroups.${key}`; entries[loc] = value; }); } - if (input.UserData !== undefined) { + if (input.UserData !== undefined && input.UserData !== null) { entries["UserData"] = input.UserData; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.KernelId !== undefined) { + if (input.KernelId !== undefined && input.KernelId !== null) { entries["KernelId"] = input.KernelId; } - if (input.RamdiskId !== undefined) { + if (input.RamdiskId !== undefined && input.RamdiskId !== null) { entries["RamdiskId"] = input.RamdiskId; } - if (input.BlockDeviceMappings !== undefined) { + if (input.BlockDeviceMappings !== undefined && input.BlockDeviceMappings !== null) { const memberEntries = serializeAws_queryBlockDeviceMappings(input.BlockDeviceMappings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BlockDeviceMappings.${key}`; entries[loc] = value; }); } - if (input.InstanceMonitoring !== undefined) { + if (input.InstanceMonitoring !== undefined && input.InstanceMonitoring !== null) { const memberEntries = serializeAws_queryInstanceMonitoring(input.InstanceMonitoring, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceMonitoring.${key}`; entries[loc] = value; }); } - if (input.SpotPrice !== undefined) { + if (input.SpotPrice !== undefined && input.SpotPrice !== null) { entries["SpotPrice"] = input.SpotPrice; } - if (input.IamInstanceProfile !== undefined) { + if (input.IamInstanceProfile !== undefined && input.IamInstanceProfile !== null) { entries["IamInstanceProfile"] = input.IamInstanceProfile; } - if (input.EbsOptimized !== undefined) { + if (input.EbsOptimized !== undefined && input.EbsOptimized !== null) { entries["EbsOptimized"] = input.EbsOptimized; } - if (input.AssociatePublicIpAddress !== undefined) { + if (input.AssociatePublicIpAddress !== undefined && input.AssociatePublicIpAddress !== null) { entries["AssociatePublicIpAddress"] = input.AssociatePublicIpAddress; } - if (input.PlacementTenancy !== undefined) { + if (input.PlacementTenancy !== undefined && input.PlacementTenancy !== null) { entries["PlacementTenancy"] = input.PlacementTenancy; } - if (input.MetadataOptions !== undefined) { + if (input.MetadataOptions !== undefined && input.MetadataOptions !== null) { const memberEntries = serializeAws_queryInstanceMetadataOptions(input.MetadataOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MetadataOptions.${key}`; @@ -5204,7 +5222,7 @@ const serializeAws_queryCreateLaunchConfigurationType = ( const serializeAws_queryCreateOrUpdateTagsType = (input: CreateOrUpdateTagsType, context: __SerdeContext): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -5219,23 +5237,23 @@ const serializeAws_queryCustomizedMetricSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryMetricDimensions(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; entries[loc] = value; }); } - if (input.Statistic !== undefined) { + if (input.Statistic !== undefined && input.Statistic !== null) { entries["Statistic"] = input.Statistic; } - if (input.Unit !== undefined) { + if (input.Unit !== undefined && input.Unit !== null) { entries["Unit"] = input.Unit; } return entries; @@ -5246,10 +5264,10 @@ const serializeAws_queryDeleteAutoScalingGroupType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ForceDelete !== undefined) { + if (input.ForceDelete !== undefined && input.ForceDelete !== null) { entries["ForceDelete"] = input.ForceDelete; } return entries; @@ -5257,10 +5275,10 @@ const serializeAws_queryDeleteAutoScalingGroupType = ( const serializeAws_queryDeleteLifecycleHookType = (input: DeleteLifecycleHookType, context: __SerdeContext): any => { const entries: any = {}; - if (input.LifecycleHookName !== undefined) { + if (input.LifecycleHookName !== undefined && input.LifecycleHookName !== null) { entries["LifecycleHookName"] = input.LifecycleHookName; } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } return entries; @@ -5271,10 +5289,10 @@ const serializeAws_queryDeleteNotificationConfigurationType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.TopicARN !== undefined) { + if (input.TopicARN !== undefined && input.TopicARN !== null) { entries["TopicARN"] = input.TopicARN; } return entries; @@ -5282,10 +5300,10 @@ const serializeAws_queryDeleteNotificationConfigurationType = ( const serializeAws_queryDeletePolicyType = (input: DeletePolicyType, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } return entries; @@ -5296,10 +5314,10 @@ const serializeAws_queryDeleteScheduledActionType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ScheduledActionName !== undefined) { + if (input.ScheduledActionName !== undefined && input.ScheduledActionName !== null) { entries["ScheduledActionName"] = input.ScheduledActionName; } return entries; @@ -5307,7 +5325,7 @@ const serializeAws_queryDeleteScheduledActionType = ( const serializeAws_queryDeleteTagsType = (input: DeleteTagsType, context: __SerdeContext): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -5322,17 +5340,17 @@ const serializeAws_queryDescribeAutoScalingInstancesType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_queryInstanceIds(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceIds.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5343,20 +5361,20 @@ const serializeAws_queryDescribeInstanceRefreshesType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.InstanceRefreshIds !== undefined) { + if (input.InstanceRefreshIds !== undefined && input.InstanceRefreshIds !== null) { const memberEntries = serializeAws_queryInstanceRefreshIds(input.InstanceRefreshIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceRefreshIds.${key}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5367,10 +5385,10 @@ const serializeAws_queryDescribeLifecycleHooksType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.LifecycleHookNames !== undefined) { + if (input.LifecycleHookNames !== undefined && input.LifecycleHookNames !== null) { const memberEntries = serializeAws_queryLifecycleHookNames(input.LifecycleHookNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LifecycleHookNames.${key}`; @@ -5385,13 +5403,13 @@ const serializeAws_queryDescribeLoadBalancersRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5402,13 +5420,13 @@ const serializeAws_queryDescribeLoadBalancerTargetGroupsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5419,17 +5437,17 @@ const serializeAws_queryDescribeNotificationConfigurationsType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupNames !== undefined) { + if (input.AutoScalingGroupNames !== undefined && input.AutoScalingGroupNames !== null) { const memberEntries = serializeAws_queryAutoScalingGroupNames(input.AutoScalingGroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AutoScalingGroupNames.${key}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5437,27 +5455,27 @@ const serializeAws_queryDescribeNotificationConfigurationsType = ( const serializeAws_queryDescribePoliciesType = (input: DescribePoliciesType, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.PolicyNames !== undefined) { + if (input.PolicyNames !== undefined && input.PolicyNames !== null) { const memberEntries = serializeAws_queryPolicyNames(input.PolicyNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyNames.${key}`; entries[loc] = value; }); } - if (input.PolicyTypes !== undefined) { + if (input.PolicyTypes !== undefined && input.PolicyTypes !== null) { const memberEntries = serializeAws_queryPolicyTypes(input.PolicyTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyTypes.${key}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5468,20 +5486,20 @@ const serializeAws_queryDescribeScalingActivitiesType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ActivityIds !== undefined) { + if (input.ActivityIds !== undefined && input.ActivityIds !== null) { const memberEntries = serializeAws_queryActivityIds(input.ActivityIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ActivityIds.${key}`; entries[loc] = value; }); } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5492,26 +5510,26 @@ const serializeAws_queryDescribeScheduledActionsType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ScheduledActionNames !== undefined) { + if (input.ScheduledActionNames !== undefined && input.ScheduledActionNames !== null) { const memberEntries = serializeAws_queryScheduledActionNames(input.ScheduledActionNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScheduledActionNames.${key}`; entries[loc] = value; }); } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5519,17 +5537,17 @@ const serializeAws_queryDescribeScheduledActionsType = ( const serializeAws_queryDescribeTagsType = (input: DescribeTagsType, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilters(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5537,17 +5555,17 @@ const serializeAws_queryDescribeTagsType = (input: DescribeTagsType, context: __ const serializeAws_queryDetachInstancesQuery = (input: DetachInstancesQuery, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_queryInstanceIds(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceIds.${key}`; entries[loc] = value; }); } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ShouldDecrementDesiredCapacity !== undefined) { + if (input.ShouldDecrementDesiredCapacity !== undefined && input.ShouldDecrementDesiredCapacity !== null) { entries["ShouldDecrementDesiredCapacity"] = input.ShouldDecrementDesiredCapacity; } return entries; @@ -5555,10 +5573,10 @@ const serializeAws_queryDetachInstancesQuery = (input: DetachInstancesQuery, con const serializeAws_queryDetachLoadBalancersType = (input: DetachLoadBalancersType, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.LoadBalancerNames !== undefined) { + if (input.LoadBalancerNames !== undefined && input.LoadBalancerNames !== null) { const memberEntries = serializeAws_queryLoadBalancerNames(input.LoadBalancerNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerNames.${key}`; @@ -5573,10 +5591,10 @@ const serializeAws_queryDetachLoadBalancerTargetGroupsType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.TargetGroupARNs !== undefined) { + if (input.TargetGroupARNs !== undefined && input.TargetGroupARNs !== null) { const memberEntries = serializeAws_queryTargetGroupARNs(input.TargetGroupARNs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetGroupARNs.${key}`; @@ -5591,10 +5609,10 @@ const serializeAws_queryDisableMetricsCollectionQuery = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.Metrics !== undefined) { + if (input.Metrics !== undefined && input.Metrics !== null) { const memberEntries = serializeAws_queryMetrics(input.Metrics, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Metrics.${key}`; @@ -5606,22 +5624,22 @@ const serializeAws_queryDisableMetricsCollectionQuery = ( const serializeAws_queryEbs = (input: Ebs, context: __SerdeContext): any => { const entries: any = {}; - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.VolumeSize !== undefined) { + if (input.VolumeSize !== undefined && input.VolumeSize !== null) { entries["VolumeSize"] = input.VolumeSize; } - if (input.VolumeType !== undefined) { + if (input.VolumeType !== undefined && input.VolumeType !== null) { entries["VolumeType"] = input.VolumeType; } - if (input.DeleteOnTermination !== undefined) { + if (input.DeleteOnTermination !== undefined && input.DeleteOnTermination !== null) { entries["DeleteOnTermination"] = input.DeleteOnTermination; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } return entries; @@ -5632,17 +5650,17 @@ const serializeAws_queryEnableMetricsCollectionQuery = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.Metrics !== undefined) { + if (input.Metrics !== undefined && input.Metrics !== null) { const memberEntries = serializeAws_queryMetrics(input.Metrics, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Metrics.${key}`; entries[loc] = value; }); } - if (input.Granularity !== undefined) { + if (input.Granularity !== undefined && input.Granularity !== null) { entries["Granularity"] = input.Granularity; } return entries; @@ -5650,17 +5668,17 @@ const serializeAws_queryEnableMetricsCollectionQuery = ( const serializeAws_queryEnterStandbyQuery = (input: EnterStandbyQuery, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_queryInstanceIds(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceIds.${key}`; entries[loc] = value; }); } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ShouldDecrementDesiredCapacity !== undefined) { + if (input.ShouldDecrementDesiredCapacity !== undefined && input.ShouldDecrementDesiredCapacity !== null) { entries["ShouldDecrementDesiredCapacity"] = input.ShouldDecrementDesiredCapacity; } return entries; @@ -5668,19 +5686,19 @@ const serializeAws_queryEnterStandbyQuery = (input: EnterStandbyQuery, context: const serializeAws_queryExecutePolicyType = (input: ExecutePolicyType, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.HonorCooldown !== undefined) { + if (input.HonorCooldown !== undefined && input.HonorCooldown !== null) { entries["HonorCooldown"] = input.HonorCooldown; } - if (input.MetricValue !== undefined) { + if (input.MetricValue !== undefined && input.MetricValue !== null) { entries["MetricValue"] = input.MetricValue; } - if (input.BreachThreshold !== undefined) { + if (input.BreachThreshold !== undefined && input.BreachThreshold !== null) { entries["BreachThreshold"] = input.BreachThreshold; } return entries; @@ -5688,14 +5706,14 @@ const serializeAws_queryExecutePolicyType = (input: ExecutePolicyType, context: const serializeAws_queryExitStandbyQuery = (input: ExitStandbyQuery, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_queryInstanceIds(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceIds.${key}`; entries[loc] = value; }); } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } return entries; @@ -5703,10 +5721,10 @@ const serializeAws_queryExitStandbyQuery = (input: ExitStandbyQuery, context: __ const serializeAws_queryFilter = (input: Filter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryValues(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -5720,6 +5738,9 @@ const serializeAws_queryFilters = (input: Filter[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5733,6 +5754,9 @@ const serializeAws_queryInstanceIds = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5741,13 +5765,13 @@ const serializeAws_queryInstanceIds = (input: string[], context: __SerdeContext) const serializeAws_queryInstanceMetadataOptions = (input: InstanceMetadataOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.HttpTokens !== undefined) { + if (input.HttpTokens !== undefined && input.HttpTokens !== null) { entries["HttpTokens"] = input.HttpTokens; } - if (input.HttpPutResponseHopLimit !== undefined) { + if (input.HttpPutResponseHopLimit !== undefined && input.HttpPutResponseHopLimit !== null) { entries["HttpPutResponseHopLimit"] = input.HttpPutResponseHopLimit; } - if (input.HttpEndpoint !== undefined) { + if (input.HttpEndpoint !== undefined && input.HttpEndpoint !== null) { entries["HttpEndpoint"] = input.HttpEndpoint; } return entries; @@ -5755,7 +5779,7 @@ const serializeAws_queryInstanceMetadataOptions = (input: InstanceMetadataOption const serializeAws_queryInstanceMonitoring = (input: InstanceMonitoring, context: __SerdeContext): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -5765,6 +5789,9 @@ const serializeAws_queryInstanceRefreshIds = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5773,22 +5800,22 @@ const serializeAws_queryInstanceRefreshIds = (input: string[], context: __SerdeC const serializeAws_queryInstancesDistribution = (input: InstancesDistribution, context: __SerdeContext): any => { const entries: any = {}; - if (input.OnDemandAllocationStrategy !== undefined) { + if (input.OnDemandAllocationStrategy !== undefined && input.OnDemandAllocationStrategy !== null) { entries["OnDemandAllocationStrategy"] = input.OnDemandAllocationStrategy; } - if (input.OnDemandBaseCapacity !== undefined) { + if (input.OnDemandBaseCapacity !== undefined && input.OnDemandBaseCapacity !== null) { entries["OnDemandBaseCapacity"] = input.OnDemandBaseCapacity; } - if (input.OnDemandPercentageAboveBaseCapacity !== undefined) { + if (input.OnDemandPercentageAboveBaseCapacity !== undefined && input.OnDemandPercentageAboveBaseCapacity !== null) { entries["OnDemandPercentageAboveBaseCapacity"] = input.OnDemandPercentageAboveBaseCapacity; } - if (input.SpotAllocationStrategy !== undefined) { + if (input.SpotAllocationStrategy !== undefined && input.SpotAllocationStrategy !== null) { entries["SpotAllocationStrategy"] = input.SpotAllocationStrategy; } - if (input.SpotInstancePools !== undefined) { + if (input.SpotInstancePools !== undefined && input.SpotInstancePools !== null) { entries["SpotInstancePools"] = input.SpotInstancePools; } - if (input.SpotMaxPrice !== undefined) { + if (input.SpotMaxPrice !== undefined && input.SpotMaxPrice !== null) { entries["SpotMaxPrice"] = input.SpotMaxPrice; } return entries; @@ -5798,6 +5825,9 @@ const serializeAws_queryLaunchConfigurationNames = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5809,17 +5839,17 @@ const serializeAws_queryLaunchConfigurationNamesType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LaunchConfigurationNames !== undefined) { + if (input.LaunchConfigurationNames !== undefined && input.LaunchConfigurationNames !== null) { const memberEntries = serializeAws_queryLaunchConfigurationNames(input.LaunchConfigurationNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchConfigurationNames.${key}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5830,7 +5860,7 @@ const serializeAws_queryLaunchConfigurationNameType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LaunchConfigurationName !== undefined) { + if (input.LaunchConfigurationName !== undefined && input.LaunchConfigurationName !== null) { entries["LaunchConfigurationName"] = input.LaunchConfigurationName; } return entries; @@ -5838,14 +5868,14 @@ const serializeAws_queryLaunchConfigurationNameType = ( const serializeAws_queryLaunchTemplate = (input: LaunchTemplate, context: __SerdeContext): any => { const entries: any = {}; - if (input.LaunchTemplateSpecification !== undefined) { + if (input.LaunchTemplateSpecification !== undefined && input.LaunchTemplateSpecification !== null) { const memberEntries = serializeAws_queryLaunchTemplateSpecification(input.LaunchTemplateSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateSpecification.${key}`; entries[loc] = value; }); } - if (input.Overrides !== undefined) { + if (input.Overrides !== undefined && input.Overrides !== null) { const memberEntries = serializeAws_queryOverrides(input.Overrides, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Overrides.${key}`; @@ -5857,13 +5887,13 @@ const serializeAws_queryLaunchTemplate = (input: LaunchTemplate, context: __Serd const serializeAws_queryLaunchTemplateOverrides = (input: LaunchTemplateOverrides, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.WeightedCapacity !== undefined) { + if (input.WeightedCapacity !== undefined && input.WeightedCapacity !== null) { entries["WeightedCapacity"] = input.WeightedCapacity; } - if (input.LaunchTemplateSpecification !== undefined) { + if (input.LaunchTemplateSpecification !== undefined && input.LaunchTemplateSpecification !== null) { const memberEntries = serializeAws_queryLaunchTemplateSpecification(input.LaunchTemplateSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateSpecification.${key}`; @@ -5878,13 +5908,13 @@ const serializeAws_queryLaunchTemplateSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LaunchTemplateId !== undefined) { + if (input.LaunchTemplateId !== undefined && input.LaunchTemplateId !== null) { entries["LaunchTemplateId"] = input.LaunchTemplateId; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } - if (input.Version !== undefined) { + if (input.Version !== undefined && input.Version !== null) { entries["Version"] = input.Version; } return entries; @@ -5894,6 +5924,9 @@ const serializeAws_queryLifecycleHookNames = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5905,25 +5938,25 @@ const serializeAws_queryLifecycleHookSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LifecycleHookName !== undefined) { + if (input.LifecycleHookName !== undefined && input.LifecycleHookName !== null) { entries["LifecycleHookName"] = input.LifecycleHookName; } - if (input.LifecycleTransition !== undefined) { + if (input.LifecycleTransition !== undefined && input.LifecycleTransition !== null) { entries["LifecycleTransition"] = input.LifecycleTransition; } - if (input.NotificationMetadata !== undefined) { + if (input.NotificationMetadata !== undefined && input.NotificationMetadata !== null) { entries["NotificationMetadata"] = input.NotificationMetadata; } - if (input.HeartbeatTimeout !== undefined) { + if (input.HeartbeatTimeout !== undefined && input.HeartbeatTimeout !== null) { entries["HeartbeatTimeout"] = input.HeartbeatTimeout; } - if (input.DefaultResult !== undefined) { + if (input.DefaultResult !== undefined && input.DefaultResult !== null) { entries["DefaultResult"] = input.DefaultResult; } - if (input.NotificationTargetARN !== undefined) { + if (input.NotificationTargetARN !== undefined && input.NotificationTargetARN !== null) { entries["NotificationTargetARN"] = input.NotificationTargetARN; } - if (input.RoleARN !== undefined) { + if (input.RoleARN !== undefined && input.RoleARN !== null) { entries["RoleARN"] = input.RoleARN; } return entries; @@ -5936,6 +5969,9 @@ const serializeAws_queryLifecycleHookSpecifications = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryLifecycleHookSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5949,6 +5985,9 @@ const serializeAws_queryLoadBalancerNames = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5957,10 +5996,10 @@ const serializeAws_queryLoadBalancerNames = (input: string[], context: __SerdeCo const serializeAws_queryMetricDimension = (input: MetricDimension, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -5970,6 +6009,9 @@ const serializeAws_queryMetricDimensions = (input: MetricDimension[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryMetricDimension(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5983,6 +6025,9 @@ const serializeAws_queryMetrics = (input: string[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5991,14 +6036,14 @@ const serializeAws_queryMetrics = (input: string[], context: __SerdeContext): an const serializeAws_queryMixedInstancesPolicy = (input: MixedInstancesPolicy, context: __SerdeContext): any => { const entries: any = {}; - if (input.LaunchTemplate !== undefined) { + if (input.LaunchTemplate !== undefined && input.LaunchTemplate !== null) { const memberEntries = serializeAws_queryLaunchTemplate(input.LaunchTemplate, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplate.${key}`; entries[loc] = value; }); } - if (input.InstancesDistribution !== undefined) { + if (input.InstancesDistribution !== undefined && input.InstancesDistribution !== null) { const memberEntries = serializeAws_queryInstancesDistribution(input.InstancesDistribution, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstancesDistribution.${key}`; @@ -6012,6 +6057,9 @@ const serializeAws_queryOverrides = (input: LaunchTemplateOverrides[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryLaunchTemplateOverrides(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -6025,6 +6073,9 @@ const serializeAws_queryPolicyNames = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6035,6 +6086,9 @@ const serializeAws_queryPolicyTypes = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6046,10 +6100,10 @@ const serializeAws_queryPredefinedMetricSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PredefinedMetricType !== undefined) { + if (input.PredefinedMetricType !== undefined && input.PredefinedMetricType !== null) { entries["PredefinedMetricType"] = input.PredefinedMetricType; } - if (input.ResourceLabel !== undefined) { + if (input.ResourceLabel !== undefined && input.ResourceLabel !== null) { entries["ResourceLabel"] = input.ResourceLabel; } return entries; @@ -6059,6 +6113,9 @@ const serializeAws_queryProcessNames = (input: string[], context: __SerdeContext const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6067,28 +6124,28 @@ const serializeAws_queryProcessNames = (input: string[], context: __SerdeContext const serializeAws_queryPutLifecycleHookType = (input: PutLifecycleHookType, context: __SerdeContext): any => { const entries: any = {}; - if (input.LifecycleHookName !== undefined) { + if (input.LifecycleHookName !== undefined && input.LifecycleHookName !== null) { entries["LifecycleHookName"] = input.LifecycleHookName; } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.LifecycleTransition !== undefined) { + if (input.LifecycleTransition !== undefined && input.LifecycleTransition !== null) { entries["LifecycleTransition"] = input.LifecycleTransition; } - if (input.RoleARN !== undefined) { + if (input.RoleARN !== undefined && input.RoleARN !== null) { entries["RoleARN"] = input.RoleARN; } - if (input.NotificationTargetARN !== undefined) { + if (input.NotificationTargetARN !== undefined && input.NotificationTargetARN !== null) { entries["NotificationTargetARN"] = input.NotificationTargetARN; } - if (input.NotificationMetadata !== undefined) { + if (input.NotificationMetadata !== undefined && input.NotificationMetadata !== null) { entries["NotificationMetadata"] = input.NotificationMetadata; } - if (input.HeartbeatTimeout !== undefined) { + if (input.HeartbeatTimeout !== undefined && input.HeartbeatTimeout !== null) { entries["HeartbeatTimeout"] = input.HeartbeatTimeout; } - if (input.DefaultResult !== undefined) { + if (input.DefaultResult !== undefined && input.DefaultResult !== null) { entries["DefaultResult"] = input.DefaultResult; } return entries; @@ -6099,13 +6156,13 @@ const serializeAws_queryPutNotificationConfigurationType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.TopicARN !== undefined) { + if (input.TopicARN !== undefined && input.TopicARN !== null) { entries["TopicARN"] = input.TopicARN; } - if (input.NotificationTypes !== undefined) { + if (input.NotificationTypes !== undefined && input.NotificationTypes !== null) { const memberEntries = serializeAws_queryAutoScalingNotificationTypes(input.NotificationTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NotificationTypes.${key}`; @@ -6117,51 +6174,51 @@ const serializeAws_queryPutNotificationConfigurationType = ( const serializeAws_queryPutScalingPolicyType = (input: PutScalingPolicyType, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.PolicyType !== undefined) { + if (input.PolicyType !== undefined && input.PolicyType !== null) { entries["PolicyType"] = input.PolicyType; } - if (input.AdjustmentType !== undefined) { + if (input.AdjustmentType !== undefined && input.AdjustmentType !== null) { entries["AdjustmentType"] = input.AdjustmentType; } - if (input.MinAdjustmentStep !== undefined) { + if (input.MinAdjustmentStep !== undefined && input.MinAdjustmentStep !== null) { entries["MinAdjustmentStep"] = input.MinAdjustmentStep; } - if (input.MinAdjustmentMagnitude !== undefined) { + if (input.MinAdjustmentMagnitude !== undefined && input.MinAdjustmentMagnitude !== null) { entries["MinAdjustmentMagnitude"] = input.MinAdjustmentMagnitude; } - if (input.ScalingAdjustment !== undefined) { + if (input.ScalingAdjustment !== undefined && input.ScalingAdjustment !== null) { entries["ScalingAdjustment"] = input.ScalingAdjustment; } - if (input.Cooldown !== undefined) { + if (input.Cooldown !== undefined && input.Cooldown !== null) { entries["Cooldown"] = input.Cooldown; } - if (input.MetricAggregationType !== undefined) { + if (input.MetricAggregationType !== undefined && input.MetricAggregationType !== null) { entries["MetricAggregationType"] = input.MetricAggregationType; } - if (input.StepAdjustments !== undefined) { + if (input.StepAdjustments !== undefined && input.StepAdjustments !== null) { const memberEntries = serializeAws_queryStepAdjustments(input.StepAdjustments, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StepAdjustments.${key}`; entries[loc] = value; }); } - if (input.EstimatedInstanceWarmup !== undefined) { + if (input.EstimatedInstanceWarmup !== undefined && input.EstimatedInstanceWarmup !== null) { entries["EstimatedInstanceWarmup"] = input.EstimatedInstanceWarmup; } - if (input.TargetTrackingConfiguration !== undefined) { + if (input.TargetTrackingConfiguration !== undefined && input.TargetTrackingConfiguration !== null) { const memberEntries = serializeAws_queryTargetTrackingConfiguration(input.TargetTrackingConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetTrackingConfiguration.${key}`; entries[loc] = value; }); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -6172,31 +6229,31 @@ const serializeAws_queryPutScheduledUpdateGroupActionType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ScheduledActionName !== undefined) { + if (input.ScheduledActionName !== undefined && input.ScheduledActionName !== null) { entries["ScheduledActionName"] = input.ScheduledActionName; } - if (input.Time !== undefined) { + if (input.Time !== undefined && input.Time !== null) { entries["Time"] = input.Time.toISOString().split(".")[0] + "Z"; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Recurrence !== undefined) { + if (input.Recurrence !== undefined && input.Recurrence !== null) { entries["Recurrence"] = input.Recurrence; } - if (input.MinSize !== undefined) { + if (input.MinSize !== undefined && input.MinSize !== null) { entries["MinSize"] = input.MinSize; } - if (input.MaxSize !== undefined) { + if (input.MaxSize !== undefined && input.MaxSize !== null) { entries["MaxSize"] = input.MaxSize; } - if (input.DesiredCapacity !== undefined) { + if (input.DesiredCapacity !== undefined && input.DesiredCapacity !== null) { entries["DesiredCapacity"] = input.DesiredCapacity; } return entries; @@ -6207,16 +6264,16 @@ const serializeAws_queryRecordLifecycleActionHeartbeatType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LifecycleHookName !== undefined) { + if (input.LifecycleHookName !== undefined && input.LifecycleHookName !== null) { entries["LifecycleHookName"] = input.LifecycleHookName; } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.LifecycleActionToken !== undefined) { + if (input.LifecycleActionToken !== undefined && input.LifecycleActionToken !== null) { entries["LifecycleActionToken"] = input.LifecycleActionToken; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } return entries; @@ -6224,10 +6281,10 @@ const serializeAws_queryRecordLifecycleActionHeartbeatType = ( const serializeAws_queryRefreshPreferences = (input: RefreshPreferences, context: __SerdeContext): any => { const entries: any = {}; - if (input.MinHealthyPercentage !== undefined) { + if (input.MinHealthyPercentage !== undefined && input.MinHealthyPercentage !== null) { entries["MinHealthyPercentage"] = input.MinHealthyPercentage; } - if (input.InstanceWarmup !== undefined) { + if (input.InstanceWarmup !== undefined && input.InstanceWarmup !== null) { entries["InstanceWarmup"] = input.InstanceWarmup; } return entries; @@ -6235,10 +6292,10 @@ const serializeAws_queryRefreshPreferences = (input: RefreshPreferences, context const serializeAws_queryScalingProcessQuery = (input: ScalingProcessQuery, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ScalingProcesses !== undefined) { + if (input.ScalingProcesses !== undefined && input.ScalingProcesses !== null) { const memberEntries = serializeAws_queryProcessNames(input.ScalingProcesses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScalingProcesses.${key}`; @@ -6252,6 +6309,9 @@ const serializeAws_queryScheduledActionNames = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6263,25 +6323,25 @@ const serializeAws_queryScheduledUpdateGroupActionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ScheduledActionName !== undefined) { + if (input.ScheduledActionName !== undefined && input.ScheduledActionName !== null) { entries["ScheduledActionName"] = input.ScheduledActionName; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Recurrence !== undefined) { + if (input.Recurrence !== undefined && input.Recurrence !== null) { entries["Recurrence"] = input.Recurrence; } - if (input.MinSize !== undefined) { + if (input.MinSize !== undefined && input.MinSize !== null) { entries["MinSize"] = input.MinSize; } - if (input.MaxSize !== undefined) { + if (input.MaxSize !== undefined && input.MaxSize !== null) { entries["MaxSize"] = input.MaxSize; } - if (input.DesiredCapacity !== undefined) { + if (input.DesiredCapacity !== undefined && input.DesiredCapacity !== null) { entries["DesiredCapacity"] = input.DesiredCapacity; } return entries; @@ -6294,6 +6354,9 @@ const serializeAws_queryScheduledUpdateGroupActionRequests = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryScheduledUpdateGroupActionRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -6307,6 +6370,9 @@ const serializeAws_querySecurityGroups = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6315,13 +6381,13 @@ const serializeAws_querySecurityGroups = (input: string[], context: __SerdeConte const serializeAws_querySetDesiredCapacityType = (input: SetDesiredCapacityType, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.DesiredCapacity !== undefined) { + if (input.DesiredCapacity !== undefined && input.DesiredCapacity !== null) { entries["DesiredCapacity"] = input.DesiredCapacity; } - if (input.HonorCooldown !== undefined) { + if (input.HonorCooldown !== undefined && input.HonorCooldown !== null) { entries["HonorCooldown"] = input.HonorCooldown; } return entries; @@ -6329,13 +6395,13 @@ const serializeAws_querySetDesiredCapacityType = (input: SetDesiredCapacityType, const serializeAws_querySetInstanceHealthQuery = (input: SetInstanceHealthQuery, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.HealthStatus !== undefined) { + if (input.HealthStatus !== undefined && input.HealthStatus !== null) { entries["HealthStatus"] = input.HealthStatus; } - if (input.ShouldRespectGracePeriod !== undefined) { + if (input.ShouldRespectGracePeriod !== undefined && input.ShouldRespectGracePeriod !== null) { entries["ShouldRespectGracePeriod"] = input.ShouldRespectGracePeriod; } return entries; @@ -6346,17 +6412,17 @@ const serializeAws_querySetInstanceProtectionQuery = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_queryInstanceIds(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceIds.${key}`; entries[loc] = value; }); } - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.ProtectedFromScaleIn !== undefined) { + if (input.ProtectedFromScaleIn !== undefined && input.ProtectedFromScaleIn !== null) { entries["ProtectedFromScaleIn"] = input.ProtectedFromScaleIn; } return entries; @@ -6364,13 +6430,13 @@ const serializeAws_querySetInstanceProtectionQuery = ( const serializeAws_queryStartInstanceRefreshType = (input: StartInstanceRefreshType, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.Strategy !== undefined) { + if (input.Strategy !== undefined && input.Strategy !== null) { entries["Strategy"] = input.Strategy; } - if (input.Preferences !== undefined) { + if (input.Preferences !== undefined && input.Preferences !== null) { const memberEntries = serializeAws_queryRefreshPreferences(input.Preferences, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Preferences.${key}`; @@ -6382,13 +6448,13 @@ const serializeAws_queryStartInstanceRefreshType = (input: StartInstanceRefreshT const serializeAws_queryStepAdjustment = (input: StepAdjustment, context: __SerdeContext): any => { const entries: any = {}; - if (input.MetricIntervalLowerBound !== undefined) { + if (input.MetricIntervalLowerBound !== undefined && input.MetricIntervalLowerBound !== null) { entries["MetricIntervalLowerBound"] = input.MetricIntervalLowerBound; } - if (input.MetricIntervalUpperBound !== undefined) { + if (input.MetricIntervalUpperBound !== undefined && input.MetricIntervalUpperBound !== null) { entries["MetricIntervalUpperBound"] = input.MetricIntervalUpperBound; } - if (input.ScalingAdjustment !== undefined) { + if (input.ScalingAdjustment !== undefined && input.ScalingAdjustment !== null) { entries["ScalingAdjustment"] = input.ScalingAdjustment; } return entries; @@ -6398,6 +6464,9 @@ const serializeAws_queryStepAdjustments = (input: StepAdjustment[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryStepAdjustment(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -6409,19 +6478,19 @@ const serializeAws_queryStepAdjustments = (input: StepAdjustment[], context: __S const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceId !== undefined) { + if (input.ResourceId !== undefined && input.ResourceId !== null) { entries["ResourceId"] = input.ResourceId; } - if (input.ResourceType !== undefined) { + if (input.ResourceType !== undefined && input.ResourceType !== null) { entries["ResourceType"] = input.ResourceType; } - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } - if (input.PropagateAtLaunch !== undefined) { + if (input.PropagateAtLaunch !== undefined && input.PropagateAtLaunch !== null) { entries["PropagateAtLaunch"] = input.PropagateAtLaunch; } return entries; @@ -6431,6 +6500,9 @@ const serializeAws_queryTags = (input: Tag[], context: __SerdeContext): any => { const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -6444,6 +6516,9 @@ const serializeAws_queryTargetGroupARNs = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6455,24 +6530,24 @@ const serializeAws_queryTargetTrackingConfiguration = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PredefinedMetricSpecification !== undefined) { + if (input.PredefinedMetricSpecification !== undefined && input.PredefinedMetricSpecification !== null) { const memberEntries = serializeAws_queryPredefinedMetricSpecification(input.PredefinedMetricSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PredefinedMetricSpecification.${key}`; entries[loc] = value; }); } - if (input.CustomizedMetricSpecification !== undefined) { + if (input.CustomizedMetricSpecification !== undefined && input.CustomizedMetricSpecification !== null) { const memberEntries = serializeAws_queryCustomizedMetricSpecification(input.CustomizedMetricSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CustomizedMetricSpecification.${key}`; entries[loc] = value; }); } - if (input.TargetValue !== undefined) { + if (input.TargetValue !== undefined && input.TargetValue !== null) { entries["TargetValue"] = input.TargetValue; } - if (input.DisableScaleIn !== undefined) { + if (input.DisableScaleIn !== undefined && input.DisableScaleIn !== null) { entries["DisableScaleIn"] = input.DisableScaleIn; } return entries; @@ -6483,10 +6558,10 @@ const serializeAws_queryTerminateInstanceInAutoScalingGroupType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.ShouldDecrementDesiredCapacity !== undefined) { + if (input.ShouldDecrementDesiredCapacity !== undefined && input.ShouldDecrementDesiredCapacity !== null) { entries["ShouldDecrementDesiredCapacity"] = input.ShouldDecrementDesiredCapacity; } return entries; @@ -6496,6 +6571,9 @@ const serializeAws_queryTerminationPolicies = (input: string[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6507,74 +6585,74 @@ const serializeAws_queryUpdateAutoScalingGroupType = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoScalingGroupName !== undefined) { + if (input.AutoScalingGroupName !== undefined && input.AutoScalingGroupName !== null) { entries["AutoScalingGroupName"] = input.AutoScalingGroupName; } - if (input.LaunchConfigurationName !== undefined) { + if (input.LaunchConfigurationName !== undefined && input.LaunchConfigurationName !== null) { entries["LaunchConfigurationName"] = input.LaunchConfigurationName; } - if (input.LaunchTemplate !== undefined) { + if (input.LaunchTemplate !== undefined && input.LaunchTemplate !== null) { const memberEntries = serializeAws_queryLaunchTemplateSpecification(input.LaunchTemplate, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplate.${key}`; entries[loc] = value; }); } - if (input.MixedInstancesPolicy !== undefined) { + if (input.MixedInstancesPolicy !== undefined && input.MixedInstancesPolicy !== null) { const memberEntries = serializeAws_queryMixedInstancesPolicy(input.MixedInstancesPolicy, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MixedInstancesPolicy.${key}`; entries[loc] = value; }); } - if (input.MinSize !== undefined) { + if (input.MinSize !== undefined && input.MinSize !== null) { entries["MinSize"] = input.MinSize; } - if (input.MaxSize !== undefined) { + if (input.MaxSize !== undefined && input.MaxSize !== null) { entries["MaxSize"] = input.MaxSize; } - if (input.DesiredCapacity !== undefined) { + if (input.DesiredCapacity !== undefined && input.DesiredCapacity !== null) { entries["DesiredCapacity"] = input.DesiredCapacity; } - if (input.DefaultCooldown !== undefined) { + if (input.DefaultCooldown !== undefined && input.DefaultCooldown !== null) { entries["DefaultCooldown"] = input.DefaultCooldown; } - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.HealthCheckType !== undefined) { + if (input.HealthCheckType !== undefined && input.HealthCheckType !== null) { entries["HealthCheckType"] = input.HealthCheckType; } - if (input.HealthCheckGracePeriod !== undefined) { + if (input.HealthCheckGracePeriod !== undefined && input.HealthCheckGracePeriod !== null) { entries["HealthCheckGracePeriod"] = input.HealthCheckGracePeriod; } - if (input.PlacementGroup !== undefined) { + if (input.PlacementGroup !== undefined && input.PlacementGroup !== null) { entries["PlacementGroup"] = input.PlacementGroup; } - if (input.VPCZoneIdentifier !== undefined) { + if (input.VPCZoneIdentifier !== undefined && input.VPCZoneIdentifier !== null) { entries["VPCZoneIdentifier"] = input.VPCZoneIdentifier; } - if (input.TerminationPolicies !== undefined) { + if (input.TerminationPolicies !== undefined && input.TerminationPolicies !== null) { const memberEntries = serializeAws_queryTerminationPolicies(input.TerminationPolicies, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TerminationPolicies.${key}`; entries[loc] = value; }); } - if (input.NewInstancesProtectedFromScaleIn !== undefined) { + if (input.NewInstancesProtectedFromScaleIn !== undefined && input.NewInstancesProtectedFromScaleIn !== null) { entries["NewInstancesProtectedFromScaleIn"] = input.NewInstancesProtectedFromScaleIn; } - if (input.ServiceLinkedRoleARN !== undefined) { + if (input.ServiceLinkedRoleARN !== undefined && input.ServiceLinkedRoleARN !== null) { entries["ServiceLinkedRoleARN"] = input.ServiceLinkedRoleARN; } - if (input.MaxInstanceLifetime !== undefined) { + if (input.MaxInstanceLifetime !== undefined && input.MaxInstanceLifetime !== null) { entries["MaxInstanceLifetime"] = input.MaxInstanceLifetime; } - if (input.CapacityRebalance !== undefined) { + if (input.CapacityRebalance !== undefined && input.CapacityRebalance !== null) { entries["CapacityRebalance"] = input.CapacityRebalance; } return entries; @@ -6584,6 +6662,9 @@ const serializeAws_queryValues = (input: string[], context: __SerdeContext): any const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6604,7 +6685,14 @@ const deserializeAws_queryActiveInstanceRefreshNotFoundFault = ( }; const deserializeAws_queryActivities = (output: any, context: __SerdeContext): Activity[] => { - return (output || []).map((entry: any) => deserializeAws_queryActivity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryActivity(entry, context); + }); }; const deserializeAws_queryActivitiesType = (output: any, context: __SerdeContext): ActivitiesType => { @@ -6694,7 +6782,14 @@ const deserializeAws_queryAdjustmentType = (output: any, context: __SerdeContext }; const deserializeAws_queryAdjustmentTypes = (output: any, context: __SerdeContext): AdjustmentType[] => { - return (output || []).map((entry: any) => deserializeAws_queryAdjustmentType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAdjustmentType(entry, context); + }); }; const deserializeAws_queryAlarm = (output: any, context: __SerdeContext): Alarm => { @@ -6712,7 +6807,14 @@ const deserializeAws_queryAlarm = (output: any, context: __SerdeContext): Alarm }; const deserializeAws_queryAlarms = (output: any, context: __SerdeContext): Alarm[] => { - return (output || []).map((entry: any) => deserializeAws_queryAlarm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAlarm(entry, context); + }); }; const deserializeAws_queryAlreadyExistsFault = (output: any, context: __SerdeContext): AlreadyExistsFault => { @@ -6898,7 +7000,14 @@ const deserializeAws_queryAutoScalingGroup = (output: any, context: __SerdeConte }; const deserializeAws_queryAutoScalingGroups = (output: any, context: __SerdeContext): AutoScalingGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryAutoScalingGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAutoScalingGroup(entry, context); + }); }; const deserializeAws_queryAutoScalingGroupsType = (output: any, context: __SerdeContext): AutoScalingGroupsType => { @@ -6974,7 +7083,14 @@ const deserializeAws_queryAutoScalingInstances = ( output: any, context: __SerdeContext ): AutoScalingInstanceDetails[] => { - return (output || []).map((entry: any) => deserializeAws_queryAutoScalingInstanceDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAutoScalingInstanceDetails(entry, context); + }); }; const deserializeAws_queryAutoScalingInstancesType = ( @@ -7001,11 +7117,25 @@ const deserializeAws_queryAutoScalingInstancesType = ( }; const deserializeAws_queryAutoScalingNotificationTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryAvailabilityZones = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryBatchDeleteScheduledActionAnswer = ( @@ -7072,7 +7202,14 @@ const deserializeAws_queryBlockDeviceMapping = (output: any, context: __SerdeCon }; const deserializeAws_queryBlockDeviceMappings = (output: any, context: __SerdeContext): BlockDeviceMapping[] => { - return (output || []).map((entry: any) => deserializeAws_queryBlockDeviceMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryBlockDeviceMapping(entry, context); + }); }; const deserializeAws_queryCancelInstanceRefreshAnswer = ( @@ -7089,7 +7226,14 @@ const deserializeAws_queryCancelInstanceRefreshAnswer = ( }; const deserializeAws_queryClassicLinkVPCSecurityGroups = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryCompleteLifecycleActionAnswer = ( @@ -7467,7 +7611,14 @@ const deserializeAws_queryEnabledMetric = (output: any, context: __SerdeContext) }; const deserializeAws_queryEnabledMetrics = (output: any, context: __SerdeContext): EnabledMetric[] => { - return (output || []).map((entry: any) => deserializeAws_queryEnabledMetric(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEnabledMetric(entry, context); + }); }; const deserializeAws_queryEnterStandbyAnswer = (output: any, context: __SerdeContext): EnterStandbyAnswer => { @@ -7527,9 +7678,14 @@ const deserializeAws_queryFailedScheduledUpdateGroupActionRequests = ( output: any, context: __SerdeContext ): FailedScheduledUpdateGroupActionRequest[] => { - return (output || []).map((entry: any) => - deserializeAws_queryFailedScheduledUpdateGroupActionRequest(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryFailedScheduledUpdateGroupActionRequest(entry, context); + }); }; const deserializeAws_queryInstance = (output: any, context: __SerdeContext): Instance => { @@ -7641,7 +7797,14 @@ const deserializeAws_queryInstanceRefresh = (output: any, context: __SerdeContex }; const deserializeAws_queryInstanceRefreshes = (output: any, context: __SerdeContext): InstanceRefresh[] => { - return (output || []).map((entry: any) => deserializeAws_queryInstanceRefresh(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInstanceRefresh(entry, context); + }); }; const deserializeAws_queryInstanceRefreshInProgressFault = ( @@ -7658,7 +7821,14 @@ const deserializeAws_queryInstanceRefreshInProgressFault = ( }; const deserializeAws_queryInstances = (output: any, context: __SerdeContext): Instance[] => { - return (output || []).map((entry: any) => deserializeAws_queryInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInstance(entry, context); + }); }; const deserializeAws_queryInstancesDistribution = (output: any, context: __SerdeContext): InstancesDistribution => { @@ -7809,7 +7979,14 @@ const deserializeAws_queryLaunchConfiguration = (output: any, context: __SerdeCo }; const deserializeAws_queryLaunchConfigurations = (output: any, context: __SerdeContext): LaunchConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_queryLaunchConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLaunchConfiguration(entry, context); + }); }; const deserializeAws_queryLaunchConfigurationsType = ( @@ -7940,7 +8117,14 @@ const deserializeAws_queryLifecycleHook = (output: any, context: __SerdeContext) }; const deserializeAws_queryLifecycleHooks = (output: any, context: __SerdeContext): LifecycleHook[] => { - return (output || []).map((entry: any) => deserializeAws_queryLifecycleHook(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLifecycleHook(entry, context); + }); }; const deserializeAws_queryLimitExceededFault = (output: any, context: __SerdeContext): LimitExceededFault => { @@ -7954,7 +8138,14 @@ const deserializeAws_queryLimitExceededFault = (output: any, context: __SerdeCon }; const deserializeAws_queryLoadBalancerNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryLoadBalancerState = (output: any, context: __SerdeContext): LoadBalancerState => { @@ -7972,7 +8163,14 @@ const deserializeAws_queryLoadBalancerState = (output: any, context: __SerdeCont }; const deserializeAws_queryLoadBalancerStates = (output: any, context: __SerdeContext): LoadBalancerState[] => { - return (output || []).map((entry: any) => deserializeAws_queryLoadBalancerState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLoadBalancerState(entry, context); + }); }; const deserializeAws_queryLoadBalancerTargetGroupState = ( @@ -7996,7 +8194,14 @@ const deserializeAws_queryLoadBalancerTargetGroupStates = ( output: any, context: __SerdeContext ): LoadBalancerTargetGroupState[] => { - return (output || []).map((entry: any) => deserializeAws_queryLoadBalancerTargetGroupState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLoadBalancerTargetGroupState(entry, context); + }); }; const deserializeAws_queryMetricCollectionType = (output: any, context: __SerdeContext): MetricCollectionType => { @@ -8010,7 +8215,14 @@ const deserializeAws_queryMetricCollectionType = (output: any, context: __SerdeC }; const deserializeAws_queryMetricCollectionTypes = (output: any, context: __SerdeContext): MetricCollectionType[] => { - return (output || []).map((entry: any) => deserializeAws_queryMetricCollectionType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMetricCollectionType(entry, context); + }); }; const deserializeAws_queryMetricDimension = (output: any, context: __SerdeContext): MetricDimension => { @@ -8028,7 +8240,14 @@ const deserializeAws_queryMetricDimension = (output: any, context: __SerdeContex }; const deserializeAws_queryMetricDimensions = (output: any, context: __SerdeContext): MetricDimension[] => { - return (output || []).map((entry: any) => deserializeAws_queryMetricDimension(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMetricDimension(entry, context); + }); }; const deserializeAws_queryMetricGranularityType = (output: any, context: __SerdeContext): MetricGranularityType => { @@ -8042,7 +8261,14 @@ const deserializeAws_queryMetricGranularityType = (output: any, context: __Serde }; const deserializeAws_queryMetricGranularityTypes = (output: any, context: __SerdeContext): MetricGranularityType[] => { - return (output || []).map((entry: any) => deserializeAws_queryMetricGranularityType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMetricGranularityType(entry, context); + }); }; const deserializeAws_queryMixedInstancesPolicy = (output: any, context: __SerdeContext): MixedInstancesPolicy => { @@ -8087,11 +8313,25 @@ const deserializeAws_queryNotificationConfigurations = ( output: any, context: __SerdeContext ): NotificationConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_queryNotificationConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryNotificationConfiguration(entry, context); + }); }; const deserializeAws_queryOverrides = (output: any, context: __SerdeContext): LaunchTemplateOverrides[] => { - return (output || []).map((entry: any) => deserializeAws_queryLaunchTemplateOverrides(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLaunchTemplateOverrides(entry, context); + }); }; const deserializeAws_queryPoliciesType = (output: any, context: __SerdeContext): PoliciesType => { @@ -8149,7 +8389,14 @@ const deserializeAws_queryPredefinedMetricSpecification = ( }; const deserializeAws_queryProcesses = (output: any, context: __SerdeContext): ProcessType[] => { - return (output || []).map((entry: any) => deserializeAws_queryProcessType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryProcessType(entry, context); + }); }; const deserializeAws_queryProcessesType = (output: any, context: __SerdeContext): ProcessesType => { @@ -8222,7 +8469,14 @@ const deserializeAws_queryScalingActivityInProgressFault = ( }; const deserializeAws_queryScalingPolicies = (output: any, context: __SerdeContext): ScalingPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_queryScalingPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryScalingPolicy(entry, context); + }); }; const deserializeAws_queryScalingPolicy = (output: any, context: __SerdeContext): ScalingPolicy => { @@ -8379,11 +8633,25 @@ const deserializeAws_queryScheduledUpdateGroupActions = ( output: any, context: __SerdeContext ): ScheduledUpdateGroupAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryScheduledUpdateGroupAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryScheduledUpdateGroupAction(entry, context); + }); }; const deserializeAws_querySecurityGroups = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryServiceLinkedRoleFailure = ( @@ -8439,7 +8707,14 @@ const deserializeAws_queryStepAdjustment = (output: any, context: __SerdeContext }; const deserializeAws_queryStepAdjustments = (output: any, context: __SerdeContext): StepAdjustment[] => { - return (output || []).map((entry: any) => deserializeAws_queryStepAdjustment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStepAdjustment(entry, context); + }); }; const deserializeAws_querySuspendedProcess = (output: any, context: __SerdeContext): SuspendedProcess => { @@ -8457,7 +8732,14 @@ const deserializeAws_querySuspendedProcess = (output: any, context: __SerdeConte }; const deserializeAws_querySuspendedProcesses = (output: any, context: __SerdeContext): SuspendedProcess[] => { - return (output || []).map((entry: any) => deserializeAws_querySuspendedProcess(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySuspendedProcess(entry, context); + }); }; const deserializeAws_queryTagDescription = (output: any, context: __SerdeContext): TagDescription => { @@ -8487,7 +8769,14 @@ const deserializeAws_queryTagDescription = (output: any, context: __SerdeContext }; const deserializeAws_queryTagDescriptionList = (output: any, context: __SerdeContext): TagDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryTagDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTagDescription(entry, context); + }); }; const deserializeAws_queryTagsType = (output: any, context: __SerdeContext): TagsType => { @@ -8508,7 +8797,14 @@ const deserializeAws_queryTagsType = (output: any, context: __SerdeContext): Tag }; const deserializeAws_queryTargetGroupARNs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryTargetTrackingConfiguration = ( @@ -8543,7 +8839,14 @@ const deserializeAws_queryTargetTrackingConfiguration = ( }; const deserializeAws_queryTerminationPolicies = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ diff --git a/clients/client-backup/protocols/Aws_restJson1.ts b/clients/client-backup/protocols/Aws_restJson1.ts index a26ca854f309..8ba0c6955468 100644 --- a/clients/client-backup/protocols/Aws_restJson1.ts +++ b/clients/client-backup/protocols/Aws_restJson1.ts @@ -181,18 +181,17 @@ export const serializeAws_restJson1CreateBackupPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backup/plans"; let body: any; body = JSON.stringify({ - ...(input.BackupPlan !== undefined && { - BackupPlan: serializeAws_restJson1BackupPlanInput(input.BackupPlan, context), - }), - ...(input.BackupPlanTags !== undefined && { - BackupPlanTags: serializeAws_restJson1Tags(input.BackupPlanTags, context), - }), - ...(input.CreatorRequestId !== undefined && { CreatorRequestId: input.CreatorRequestId }), + ...(input.BackupPlan !== undefined && + input.BackupPlan !== null && { BackupPlan: serializeAws_restJson1BackupPlanInput(input.BackupPlan, context) }), + ...(input.BackupPlanTags !== undefined && + input.BackupPlanTags !== null && { BackupPlanTags: serializeAws_restJson1Tags(input.BackupPlanTags, context) }), + ...(input.CreatorRequestId !== undefined && + input.CreatorRequestId !== null && { CreatorRequestId: input.CreatorRequestId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -211,7 +210,7 @@ export const serializeAws_restJson1CreateBackupSelectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backup/plans/{BackupPlanId}/selections"; if (input.BackupPlanId !== undefined) { @@ -225,10 +224,12 @@ export const serializeAws_restJson1CreateBackupSelectionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BackupSelection !== undefined && { - BackupSelection: serializeAws_restJson1BackupSelection(input.BackupSelection, context), - }), - ...(input.CreatorRequestId !== undefined && { CreatorRequestId: input.CreatorRequestId }), + ...(input.BackupSelection !== undefined && + input.BackupSelection !== null && { + BackupSelection: serializeAws_restJson1BackupSelection(input.BackupSelection, context), + }), + ...(input.CreatorRequestId !== undefined && + input.CreatorRequestId !== null && { CreatorRequestId: input.CreatorRequestId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -247,7 +248,7 @@ export const serializeAws_restJson1CreateBackupVaultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backup-vaults/{BackupVaultName}"; if (input.BackupVaultName !== undefined) { @@ -261,11 +262,14 @@ export const serializeAws_restJson1CreateBackupVaultCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BackupVaultTags !== undefined && { - BackupVaultTags: serializeAws_restJson1Tags(input.BackupVaultTags, context), - }), - ...(input.CreatorRequestId !== undefined && { CreatorRequestId: input.CreatorRequestId }), - ...(input.EncryptionKeyArn !== undefined && { EncryptionKeyArn: input.EncryptionKeyArn }), + ...(input.BackupVaultTags !== undefined && + input.BackupVaultTags !== null && { + BackupVaultTags: serializeAws_restJson1Tags(input.BackupVaultTags, context), + }), + ...(input.CreatorRequestId !== undefined && + input.CreatorRequestId !== null && { CreatorRequestId: input.CreatorRequestId }), + ...(input.EncryptionKeyArn !== undefined && + input.EncryptionKeyArn !== null && { EncryptionKeyArn: input.EncryptionKeyArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -283,9 +287,7 @@ export const serializeAws_restJson1DeleteBackupPlanCommand = async ( input: DeleteBackupPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/plans/{BackupPlanId}"; if (input.BackupPlanId !== undefined) { const labelValue: string = input.BackupPlanId; @@ -313,9 +315,7 @@ export const serializeAws_restJson1DeleteBackupSelectionCommand = async ( input: DeleteBackupSelectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/plans/{BackupPlanId}/selections/{SelectionId}"; if (input.BackupPlanId !== undefined) { const labelValue: string = input.BackupPlanId; @@ -352,9 +352,7 @@ export const serializeAws_restJson1DeleteBackupVaultCommand = async ( input: DeleteBackupVaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -382,9 +380,7 @@ export const serializeAws_restJson1DeleteBackupVaultAccessPolicyCommand = async input: DeleteBackupVaultAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}/access-policy"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -412,9 +408,7 @@ export const serializeAws_restJson1DeleteBackupVaultNotificationsCommand = async input: DeleteBackupVaultNotificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}/notification-configuration"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -442,9 +436,7 @@ export const serializeAws_restJson1DeleteRecoveryPointCommand = async ( input: DeleteRecoveryPointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}/recovery-points/{RecoveryPointArn}"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -481,9 +473,7 @@ export const serializeAws_restJson1DescribeBackupJobCommand = async ( input: DescribeBackupJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-jobs/{BackupJobId}"; if (input.BackupJobId !== undefined) { const labelValue: string = input.BackupJobId; @@ -511,9 +501,7 @@ export const serializeAws_restJson1DescribeBackupVaultCommand = async ( input: DescribeBackupVaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -541,9 +529,7 @@ export const serializeAws_restJson1DescribeCopyJobCommand = async ( input: DescribeCopyJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/copy-jobs/{CopyJobId}"; if (input.CopyJobId !== undefined) { const labelValue: string = input.CopyJobId; @@ -571,12 +557,10 @@ export const serializeAws_restJson1DescribeGlobalSettingsCommand = async ( input: DescribeGlobalSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-settings"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -593,9 +577,7 @@ export const serializeAws_restJson1DescribeProtectedResourceCommand = async ( input: DescribeProtectedResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/resources/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -623,9 +605,7 @@ export const serializeAws_restJson1DescribeRecoveryPointCommand = async ( input: DescribeRecoveryPointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}/recovery-points/{RecoveryPointArn}"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -662,12 +642,10 @@ export const serializeAws_restJson1DescribeRegionSettingsCommand = async ( input: DescribeRegionSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/account-settings"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -684,9 +662,7 @@ export const serializeAws_restJson1DescribeRestoreJobCommand = async ( input: DescribeRestoreJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restore-jobs/{RestoreJobId}"; if (input.RestoreJobId !== undefined) { const labelValue: string = input.RestoreJobId; @@ -714,9 +690,7 @@ export const serializeAws_restJson1ExportBackupPlanTemplateCommand = async ( input: ExportBackupPlanTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/plans/{BackupPlanId}/toTemplate"; if (input.BackupPlanId !== undefined) { const labelValue: string = input.BackupPlanId; @@ -744,9 +718,7 @@ export const serializeAws_restJson1GetBackupPlanCommand = async ( input: GetBackupPlanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/plans/{BackupPlanId}"; if (input.BackupPlanId !== undefined) { const labelValue: string = input.BackupPlanId; @@ -779,12 +751,13 @@ export const serializeAws_restJson1GetBackupPlanFromJSONCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backup/template/json/toPlan"; let body: any; body = JSON.stringify({ - ...(input.BackupPlanTemplateJson !== undefined && { BackupPlanTemplateJson: input.BackupPlanTemplateJson }), + ...(input.BackupPlanTemplateJson !== undefined && + input.BackupPlanTemplateJson !== null && { BackupPlanTemplateJson: input.BackupPlanTemplateJson }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -802,9 +775,7 @@ export const serializeAws_restJson1GetBackupPlanFromTemplateCommand = async ( input: GetBackupPlanFromTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/template/plans/{BackupPlanTemplateId}/toPlan"; if (input.BackupPlanTemplateId !== undefined) { const labelValue: string = input.BackupPlanTemplateId; @@ -832,9 +803,7 @@ export const serializeAws_restJson1GetBackupSelectionCommand = async ( input: GetBackupSelectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/plans/{BackupPlanId}/selections/{SelectionId}"; if (input.BackupPlanId !== undefined) { const labelValue: string = input.BackupPlanId; @@ -871,9 +840,7 @@ export const serializeAws_restJson1GetBackupVaultAccessPolicyCommand = async ( input: GetBackupVaultAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}/access-policy"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -901,9 +868,7 @@ export const serializeAws_restJson1GetBackupVaultNotificationsCommand = async ( input: GetBackupVaultNotificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}/notification-configuration"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -931,9 +896,7 @@ export const serializeAws_restJson1GetRecoveryPointRestoreMetadataCommand = asyn input: GetRecoveryPointRestoreMetadataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}/recovery-points/{RecoveryPointArn}/restore-metadata"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -970,12 +933,10 @@ export const serializeAws_restJson1GetSupportedResourceTypesCommand = async ( input: GetSupportedResourceTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/supported-resource-types"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -992,9 +953,7 @@ export const serializeAws_restJson1ListBackupJobsCommand = async ( input: ListBackupJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-jobs"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1029,9 +988,7 @@ export const serializeAws_restJson1ListBackupPlansCommand = async ( input: ListBackupPlansCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/plans"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1056,9 +1013,7 @@ export const serializeAws_restJson1ListBackupPlanTemplatesCommand = async ( input: ListBackupPlanTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/template/plans"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1082,9 +1037,7 @@ export const serializeAws_restJson1ListBackupPlanVersionsCommand = async ( input: ListBackupPlanVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/plans/{BackupPlanId}/versions"; if (input.BackupPlanId !== undefined) { const labelValue: string = input.BackupPlanId; @@ -1117,9 +1070,7 @@ export const serializeAws_restJson1ListBackupSelectionsCommand = async ( input: ListBackupSelectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup/plans/{BackupPlanId}/selections"; if (input.BackupPlanId !== undefined) { const labelValue: string = input.BackupPlanId; @@ -1152,9 +1103,7 @@ export const serializeAws_restJson1ListBackupVaultsCommand = async ( input: ListBackupVaultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1178,9 +1127,7 @@ export const serializeAws_restJson1ListCopyJobsCommand = async ( input: ListCopyJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/copy-jobs"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1215,9 +1162,7 @@ export const serializeAws_restJson1ListProtectedResourcesCommand = async ( input: ListProtectedResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/resources"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1241,9 +1186,7 @@ export const serializeAws_restJson1ListRecoveryPointsByBackupVaultCommand = asyn input: ListRecoveryPointsByBackupVaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-vaults/{BackupVaultName}/recovery-points"; if (input.BackupVaultName !== undefined) { const labelValue: string = input.BackupVaultName; @@ -1285,9 +1228,7 @@ export const serializeAws_restJson1ListRecoveryPointsByResourceCommand = async ( input: ListRecoveryPointsByResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/resources/{ResourceArn}/recovery-points"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1320,9 +1261,7 @@ export const serializeAws_restJson1ListRestoreJobsCommand = async ( input: ListRestoreJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/restore-jobs"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1354,9 +1293,7 @@ export const serializeAws_restJson1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1390,7 +1327,7 @@ export const serializeAws_restJson1PutBackupVaultAccessPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backup-vaults/{BackupVaultName}/access-policy"; if (input.BackupVaultName !== undefined) { @@ -1404,7 +1341,7 @@ export const serializeAws_restJson1PutBackupVaultAccessPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Policy !== undefined && { Policy: input.Policy }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1423,7 +1360,7 @@ export const serializeAws_restJson1PutBackupVaultNotificationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backup-vaults/{BackupVaultName}/notification-configuration"; if (input.BackupVaultName !== undefined) { @@ -1437,10 +1374,11 @@ export const serializeAws_restJson1PutBackupVaultNotificationsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BackupVaultEvents !== undefined && { - BackupVaultEvents: serializeAws_restJson1BackupVaultEvents(input.BackupVaultEvents, context), - }), - ...(input.SNSTopicArn !== undefined && { SNSTopicArn: input.SNSTopicArn }), + ...(input.BackupVaultEvents !== undefined && + input.BackupVaultEvents !== null && { + BackupVaultEvents: serializeAws_restJson1BackupVaultEvents(input.BackupVaultEvents, context), + }), + ...(input.SNSTopicArn !== undefined && input.SNSTopicArn !== null && { SNSTopicArn: input.SNSTopicArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1459,24 +1397,31 @@ export const serializeAws_restJson1StartBackupJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backup-jobs"; let body: any; body = JSON.stringify({ - ...(input.BackupOptions !== undefined && { - BackupOptions: serializeAws_restJson1BackupOptions(input.BackupOptions, context), - }), - ...(input.BackupVaultName !== undefined && { BackupVaultName: input.BackupVaultName }), - ...(input.CompleteWindowMinutes !== undefined && { CompleteWindowMinutes: input.CompleteWindowMinutes }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.IdempotencyToken !== undefined && { IdempotencyToken: input.IdempotencyToken }), - ...(input.Lifecycle !== undefined && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), - ...(input.RecoveryPointTags !== undefined && { - RecoveryPointTags: serializeAws_restJson1Tags(input.RecoveryPointTags, context), - }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.StartWindowMinutes !== undefined && { StartWindowMinutes: input.StartWindowMinutes }), + ...(input.BackupOptions !== undefined && + input.BackupOptions !== null && { + BackupOptions: serializeAws_restJson1BackupOptions(input.BackupOptions, context), + }), + ...(input.BackupVaultName !== undefined && + input.BackupVaultName !== null && { BackupVaultName: input.BackupVaultName }), + ...(input.CompleteWindowMinutes !== undefined && + input.CompleteWindowMinutes !== null && { CompleteWindowMinutes: input.CompleteWindowMinutes }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.IdempotencyToken !== undefined && + input.IdempotencyToken !== null && { IdempotencyToken: input.IdempotencyToken }), + ...(input.Lifecycle !== undefined && + input.Lifecycle !== null && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), + ...(input.RecoveryPointTags !== undefined && + input.RecoveryPointTags !== null && { + RecoveryPointTags: serializeAws_restJson1Tags(input.RecoveryPointTags, context), + }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.StartWindowMinutes !== undefined && + input.StartWindowMinutes !== null && { StartWindowMinutes: input.StartWindowMinutes }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1495,19 +1440,22 @@ export const serializeAws_restJson1StartCopyJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/copy-jobs"; let body: any; body = JSON.stringify({ - ...(input.DestinationBackupVaultArn !== undefined && { - DestinationBackupVaultArn: input.DestinationBackupVaultArn, - }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.IdempotencyToken !== undefined && { IdempotencyToken: input.IdempotencyToken }), - ...(input.Lifecycle !== undefined && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), - ...(input.RecoveryPointArn !== undefined && { RecoveryPointArn: input.RecoveryPointArn }), - ...(input.SourceBackupVaultName !== undefined && { SourceBackupVaultName: input.SourceBackupVaultName }), + ...(input.DestinationBackupVaultArn !== undefined && + input.DestinationBackupVaultArn !== null && { DestinationBackupVaultArn: input.DestinationBackupVaultArn }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.IdempotencyToken !== undefined && + input.IdempotencyToken !== null && { IdempotencyToken: input.IdempotencyToken }), + ...(input.Lifecycle !== undefined && + input.Lifecycle !== null && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), + ...(input.RecoveryPointArn !== undefined && + input.RecoveryPointArn !== null && { RecoveryPointArn: input.RecoveryPointArn }), + ...(input.SourceBackupVaultName !== undefined && + input.SourceBackupVaultName !== null && { SourceBackupVaultName: input.SourceBackupVaultName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1526,16 +1474,19 @@ export const serializeAws_restJson1StartRestoreJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restore-jobs"; let body: any; body = JSON.stringify({ - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.IdempotencyToken !== undefined && { IdempotencyToken: input.IdempotencyToken }), - ...(input.Metadata !== undefined && { Metadata: serializeAws_restJson1Metadata(input.Metadata, context) }), - ...(input.RecoveryPointArn !== undefined && { RecoveryPointArn: input.RecoveryPointArn }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.IdempotencyToken !== undefined && + input.IdempotencyToken !== null && { IdempotencyToken: input.IdempotencyToken }), + ...(input.Metadata !== undefined && + input.Metadata !== null && { Metadata: serializeAws_restJson1Metadata(input.Metadata, context) }), + ...(input.RecoveryPointArn !== undefined && + input.RecoveryPointArn !== null && { RecoveryPointArn: input.RecoveryPointArn }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1553,9 +1504,7 @@ export const serializeAws_restJson1StopBackupJobCommand = async ( input: StopBackupJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/backup-jobs/{BackupJobId}"; if (input.BackupJobId !== undefined) { const labelValue: string = input.BackupJobId; @@ -1584,7 +1533,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -1598,7 +1547,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1617,7 +1566,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/untag/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -1631,7 +1580,8 @@ export const serializeAws_restJson1UntagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TagKeyList !== undefined && { TagKeyList: serializeAws_restJson1TagKeyList(input.TagKeyList, context) }), + ...(input.TagKeyList !== undefined && + input.TagKeyList !== null && { TagKeyList: serializeAws_restJson1TagKeyList(input.TagKeyList, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1650,7 +1600,7 @@ export const serializeAws_restJson1UpdateBackupPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backup/plans/{BackupPlanId}"; if (input.BackupPlanId !== undefined) { @@ -1664,9 +1614,8 @@ export const serializeAws_restJson1UpdateBackupPlanCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BackupPlan !== undefined && { - BackupPlan: serializeAws_restJson1BackupPlanInput(input.BackupPlan, context), - }), + ...(input.BackupPlan !== undefined && + input.BackupPlan !== null && { BackupPlan: serializeAws_restJson1BackupPlanInput(input.BackupPlan, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1685,14 +1634,15 @@ export const serializeAws_restJson1UpdateGlobalSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-settings"; let body: any; body = JSON.stringify({ - ...(input.GlobalSettings !== undefined && { - GlobalSettings: serializeAws_restJson1GlobalSettings(input.GlobalSettings, context), - }), + ...(input.GlobalSettings !== undefined && + input.GlobalSettings !== null && { + GlobalSettings: serializeAws_restJson1GlobalSettings(input.GlobalSettings, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1711,7 +1661,7 @@ export const serializeAws_restJson1UpdateRecoveryPointLifecycleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/backup-vaults/{BackupVaultName}/recovery-points/{RecoveryPointArn}"; if (input.BackupVaultName !== undefined) { @@ -1734,7 +1684,8 @@ export const serializeAws_restJson1UpdateRecoveryPointLifecycleCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Lifecycle !== undefined && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), + ...(input.Lifecycle !== undefined && + input.Lifecycle !== null && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1753,17 +1704,18 @@ export const serializeAws_restJson1UpdateRegionSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/account-settings"; let body: any; body = JSON.stringify({ - ...(input.ResourceTypeOptInPreference !== undefined && { - ResourceTypeOptInPreference: serializeAws_restJson1ResourceTypeOptInPreference( - input.ResourceTypeOptInPreference, - context - ), - }), + ...(input.ResourceTypeOptInPreference !== undefined && + input.ResourceTypeOptInPreference !== null && { + ResourceTypeOptInPreference: serializeAws_restJson1ResourceTypeOptInPreference( + input.ResourceTypeOptInPreference, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6355,64 +6307,91 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async ( const serializeAws_restJson1AdvancedBackupSetting = (input: AdvancedBackupSetting, context: __SerdeContext): any => { return { - ...(input.BackupOptions !== undefined && { - BackupOptions: serializeAws_restJson1BackupOptions(input.BackupOptions, context), - }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.BackupOptions !== undefined && + input.BackupOptions !== null && { + BackupOptions: serializeAws_restJson1BackupOptions(input.BackupOptions, context), + }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; const serializeAws_restJson1AdvancedBackupSettings = (input: AdvancedBackupSetting[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AdvancedBackupSetting(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AdvancedBackupSetting(entry, context); + }); }; const serializeAws_restJson1BackupOptions = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1BackupPlanInput = (input: BackupPlanInput, context: __SerdeContext): any => { return { - ...(input.AdvancedBackupSettings !== undefined && { - AdvancedBackupSettings: serializeAws_restJson1AdvancedBackupSettings(input.AdvancedBackupSettings, context), - }), - ...(input.BackupPlanName !== undefined && { BackupPlanName: input.BackupPlanName }), - ...(input.Rules !== undefined && { Rules: serializeAws_restJson1BackupRulesInput(input.Rules, context) }), + ...(input.AdvancedBackupSettings !== undefined && + input.AdvancedBackupSettings !== null && { + AdvancedBackupSettings: serializeAws_restJson1AdvancedBackupSettings(input.AdvancedBackupSettings, context), + }), + ...(input.BackupPlanName !== undefined && + input.BackupPlanName !== null && { BackupPlanName: input.BackupPlanName }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_restJson1BackupRulesInput(input.Rules, context) }), }; }; const serializeAws_restJson1BackupRuleInput = (input: BackupRuleInput, context: __SerdeContext): any => { return { - ...(input.CompletionWindowMinutes !== undefined && { CompletionWindowMinutes: input.CompletionWindowMinutes }), - ...(input.CopyActions !== undefined && { - CopyActions: serializeAws_restJson1CopyActions(input.CopyActions, context), - }), - ...(input.Lifecycle !== undefined && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), - ...(input.RecoveryPointTags !== undefined && { - RecoveryPointTags: serializeAws_restJson1Tags(input.RecoveryPointTags, context), - }), - ...(input.RuleName !== undefined && { RuleName: input.RuleName }), - ...(input.ScheduleExpression !== undefined && { ScheduleExpression: input.ScheduleExpression }), - ...(input.StartWindowMinutes !== undefined && { StartWindowMinutes: input.StartWindowMinutes }), - ...(input.TargetBackupVaultName !== undefined && { TargetBackupVaultName: input.TargetBackupVaultName }), + ...(input.CompletionWindowMinutes !== undefined && + input.CompletionWindowMinutes !== null && { CompletionWindowMinutes: input.CompletionWindowMinutes }), + ...(input.CopyActions !== undefined && + input.CopyActions !== null && { CopyActions: serializeAws_restJson1CopyActions(input.CopyActions, context) }), + ...(input.Lifecycle !== undefined && + input.Lifecycle !== null && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), + ...(input.RecoveryPointTags !== undefined && + input.RecoveryPointTags !== null && { + RecoveryPointTags: serializeAws_restJson1Tags(input.RecoveryPointTags, context), + }), + ...(input.RuleName !== undefined && input.RuleName !== null && { RuleName: input.RuleName }), + ...(input.ScheduleExpression !== undefined && + input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }), + ...(input.StartWindowMinutes !== undefined && + input.StartWindowMinutes !== null && { StartWindowMinutes: input.StartWindowMinutes }), + ...(input.TargetBackupVaultName !== undefined && + input.TargetBackupVaultName !== null && { TargetBackupVaultName: input.TargetBackupVaultName }), }; }; const serializeAws_restJson1BackupRulesInput = (input: BackupRuleInput[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1BackupRuleInput(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1BackupRuleInput(entry, context); + }); }; const serializeAws_restJson1BackupSelection = (input: BackupSelection, context: __SerdeContext): any => { return { - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.ListOfTags !== undefined && { ListOfTags: serializeAws_restJson1ListOfTags(input.ListOfTags, context) }), - ...(input.Resources !== undefined && { Resources: serializeAws_restJson1ResourceArns(input.Resources, context) }), - ...(input.SelectionName !== undefined && { SelectionName: input.SelectionName }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.ListOfTags !== undefined && + input.ListOfTags !== null && { ListOfTags: serializeAws_restJson1ListOfTags(input.ListOfTags, context) }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_restJson1ResourceArns(input.Resources, context) }), + ...(input.SelectionName !== undefined && input.SelectionName !== null && { SelectionName: input.SelectionName }), }; }; @@ -6420,92 +6399,136 @@ const serializeAws_restJson1BackupVaultEvents = ( input: (BackupVaultEvent | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Condition = (input: Condition, context: __SerdeContext): any => { return { - ...(input.ConditionKey !== undefined && { ConditionKey: input.ConditionKey }), - ...(input.ConditionType !== undefined && { ConditionType: input.ConditionType }), - ...(input.ConditionValue !== undefined && { ConditionValue: input.ConditionValue }), + ...(input.ConditionKey !== undefined && input.ConditionKey !== null && { ConditionKey: input.ConditionKey }), + ...(input.ConditionType !== undefined && input.ConditionType !== null && { ConditionType: input.ConditionType }), + ...(input.ConditionValue !== undefined && + input.ConditionValue !== null && { ConditionValue: input.ConditionValue }), }; }; const serializeAws_restJson1CopyAction = (input: CopyAction, context: __SerdeContext): any => { return { - ...(input.DestinationBackupVaultArn !== undefined && { - DestinationBackupVaultArn: input.DestinationBackupVaultArn, - }), - ...(input.Lifecycle !== undefined && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), + ...(input.DestinationBackupVaultArn !== undefined && + input.DestinationBackupVaultArn !== null && { DestinationBackupVaultArn: input.DestinationBackupVaultArn }), + ...(input.Lifecycle !== undefined && + input.Lifecycle !== null && { Lifecycle: serializeAws_restJson1Lifecycle(input.Lifecycle, context) }), }; }; const serializeAws_restJson1CopyActions = (input: CopyAction[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CopyAction(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CopyAction(entry, context); + }); }; const serializeAws_restJson1GlobalSettings = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Lifecycle = (input: Lifecycle, context: __SerdeContext): any => { return { - ...(input.DeleteAfterDays !== undefined && { DeleteAfterDays: input.DeleteAfterDays }), - ...(input.MoveToColdStorageAfterDays !== undefined && { - MoveToColdStorageAfterDays: input.MoveToColdStorageAfterDays, - }), + ...(input.DeleteAfterDays !== undefined && + input.DeleteAfterDays !== null && { DeleteAfterDays: input.DeleteAfterDays }), + ...(input.MoveToColdStorageAfterDays !== undefined && + input.MoveToColdStorageAfterDays !== null && { MoveToColdStorageAfterDays: input.MoveToColdStorageAfterDays }), }; }; const serializeAws_restJson1ListOfTags = (input: Condition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Condition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Condition(entry, context); + }); }; const serializeAws_restJson1Metadata = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ResourceArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResourceTypeOptInPreference = ( input: { [key: string]: boolean }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: boolean }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: boolean }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AdvancedBackupSetting = (output: any, context: __SerdeContext): AdvancedBackupSetting => { @@ -6522,7 +6545,14 @@ const deserializeAws_restJson1AdvancedBackupSettings = ( output: any, context: __SerdeContext ): AdvancedBackupSetting[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AdvancedBackupSetting(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AdvancedBackupSetting(entry, context); + }); }; const deserializeAws_restJson1BackupJob = (output: any, context: __SerdeContext): BackupJob => { @@ -6575,17 +6605,26 @@ const deserializeAws_restJson1BackupJob = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1BackupJobsList = (output: any, context: __SerdeContext): BackupJob[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackupJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackupJob(entry, context); + }); }; const deserializeAws_restJson1BackupOptions = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1BackupPlan = (output: any, context: __SerdeContext): BackupPlan => { @@ -6604,7 +6643,14 @@ const deserializeAws_restJson1BackupPlan = (output: any, context: __SerdeContext }; const deserializeAws_restJson1BackupPlansList = (output: any, context: __SerdeContext): BackupPlansListMember[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackupPlansListMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackupPlansListMember(entry, context); + }); }; const deserializeAws_restJson1BackupPlansListMember = (output: any, context: __SerdeContext): BackupPlansListMember => { @@ -6640,7 +6686,14 @@ const deserializeAws_restJson1BackupPlanTemplatesList = ( output: any, context: __SerdeContext ): BackupPlanTemplatesListMember[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackupPlanTemplatesListMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackupPlanTemplatesListMember(entry, context); + }); }; const deserializeAws_restJson1BackupPlanTemplatesListMember = ( @@ -6663,7 +6716,14 @@ const deserializeAws_restJson1BackupPlanVersionsList = ( output: any, context: __SerdeContext ): BackupPlansListMember[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackupPlansListMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackupPlansListMember(entry, context); + }); }; const deserializeAws_restJson1BackupRule = (output: any, context: __SerdeContext): BackupRule => { @@ -6702,7 +6762,14 @@ const deserializeAws_restJson1BackupRule = (output: any, context: __SerdeContext }; const deserializeAws_restJson1BackupRules = (output: any, context: __SerdeContext): BackupRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackupRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackupRule(entry, context); + }); }; const deserializeAws_restJson1BackupSelection = (output: any, context: __SerdeContext): BackupSelection => { @@ -6725,7 +6792,14 @@ const deserializeAws_restJson1BackupSelectionsList = ( output: any, context: __SerdeContext ): BackupSelectionsListMember[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackupSelectionsListMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackupSelectionsListMember(entry, context); + }); }; const deserializeAws_restJson1BackupSelectionsListMember = ( @@ -6751,11 +6825,25 @@ const deserializeAws_restJson1BackupVaultEvents = ( output: any, context: __SerdeContext ): (BackupVaultEvent | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1BackupVaultList = (output: any, context: __SerdeContext): BackupVaultListMember[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BackupVaultListMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BackupVaultListMember(entry, context); + }); }; const deserializeAws_restJson1BackupVaultListMember = (output: any, context: __SerdeContext): BackupVaultListMember => { @@ -6816,7 +6904,14 @@ const deserializeAws_restJson1CopyAction = (output: any, context: __SerdeContext }; const deserializeAws_restJson1CopyActions = (output: any, context: __SerdeContext): CopyAction[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CopyAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CopyAction(entry, context); + }); }; const deserializeAws_restJson1CopyJob = (output: any, context: __SerdeContext): CopyJob => { @@ -6865,17 +6960,26 @@ const deserializeAws_restJson1CopyJob = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1CopyJobsList = (output: any, context: __SerdeContext): CopyJob[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CopyJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CopyJob(entry, context); + }); }; const deserializeAws_restJson1GlobalSettings = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Lifecycle = (output: any, context: __SerdeContext): Lifecycle => { @@ -6890,17 +6994,26 @@ const deserializeAws_restJson1Lifecycle = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1ListOfTags = (output: any, context: __SerdeContext): Condition[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Condition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Condition(entry, context); + }); }; const deserializeAws_restJson1Metadata = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ProtectedResource = (output: any, context: __SerdeContext): ProtectedResource => { @@ -6915,7 +7028,14 @@ const deserializeAws_restJson1ProtectedResource = (output: any, context: __Serde }; const deserializeAws_restJson1ProtectedResourcesList = (output: any, context: __SerdeContext): ProtectedResource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProtectedResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProtectedResource(entry, context); + }); }; const deserializeAws_restJson1RecoveryPointByBackupVault = ( @@ -6975,7 +7095,14 @@ const deserializeAws_restJson1RecoveryPointByBackupVaultList = ( output: any, context: __SerdeContext ): RecoveryPointByBackupVault[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecoveryPointByBackupVault(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecoveryPointByBackupVault(entry, context); + }); }; const deserializeAws_restJson1RecoveryPointByResource = ( @@ -7003,7 +7130,14 @@ const deserializeAws_restJson1RecoveryPointByResourceList = ( output: any, context: __SerdeContext ): RecoveryPointByResource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecoveryPointByResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecoveryPointByResource(entry, context); + }); }; const deserializeAws_restJson1RecoveryPointCreator = (output: any, context: __SerdeContext): RecoveryPointCreator => { @@ -7020,28 +7154,51 @@ const deserializeAws_restJson1RecoveryPointCreator = (output: any, context: __Se }; const deserializeAws_restJson1ResourceArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ResourceTypeOptInPreference = ( output: any, context: __SerdeContext ): { [key: string]: boolean } => { - return Object.entries(output).reduce( - (acc: { [key: string]: boolean }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: boolean }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ResourceTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1RestoreJobsList = (output: any, context: __SerdeContext): RestoreJobsListMember[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RestoreJobsListMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RestoreJobsListMember(entry, context); + }); }; const deserializeAws_restJson1RestoreJobsListMember = (output: any, context: __SerdeContext): RestoreJobsListMember => { @@ -7080,13 +7237,15 @@ const deserializeAws_restJson1RestoreJobsListMember = (output: any, context: __S }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -7109,6 +7268,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-batch/protocols/Aws_restJson1.ts b/clients/client-batch/protocols/Aws_restJson1.ts index 190d30330858..a4f6e5ff3a31 100644 --- a/clients/client-batch/protocols/Aws_restJson1.ts +++ b/clients/client-batch/protocols/Aws_restJson1.ts @@ -107,13 +107,13 @@ export const serializeAws_restJson1CancelJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/canceljob"; let body: any; body = JSON.stringify({ - ...(input.jobId !== undefined && { jobId: input.jobId }), - ...(input.reason !== undefined && { reason: input.reason }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -132,19 +132,22 @@ export const serializeAws_restJson1CreateComputeEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/createcomputeenvironment"; let body: any; body = JSON.stringify({ - ...(input.computeEnvironmentName !== undefined && { computeEnvironmentName: input.computeEnvironmentName }), - ...(input.computeResources !== undefined && { - computeResources: serializeAws_restJson1ComputeResource(input.computeResources, context), - }), - ...(input.serviceRole !== undefined && { serviceRole: input.serviceRole }), - ...(input.state !== undefined && { state: input.state }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.computeEnvironmentName !== undefined && + input.computeEnvironmentName !== null && { computeEnvironmentName: input.computeEnvironmentName }), + ...(input.computeResources !== undefined && + input.computeResources !== null && { + computeResources: serializeAws_restJson1ComputeResource(input.computeResources, context), + }), + ...(input.serviceRole !== undefined && input.serviceRole !== null && { serviceRole: input.serviceRole }), + ...(input.state !== undefined && input.state !== null && { state: input.state }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -163,18 +166,20 @@ export const serializeAws_restJson1CreateJobQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/createjobqueue"; let body: any; body = JSON.stringify({ - ...(input.computeEnvironmentOrder !== undefined && { - computeEnvironmentOrder: serializeAws_restJson1ComputeEnvironmentOrders(input.computeEnvironmentOrder, context), - }), - ...(input.jobQueueName !== undefined && { jobQueueName: input.jobQueueName }), - ...(input.priority !== undefined && { priority: input.priority }), - ...(input.state !== undefined && { state: input.state }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), + ...(input.computeEnvironmentOrder !== undefined && + input.computeEnvironmentOrder !== null && { + computeEnvironmentOrder: serializeAws_restJson1ComputeEnvironmentOrders(input.computeEnvironmentOrder, context), + }), + ...(input.jobQueueName !== undefined && input.jobQueueName !== null && { jobQueueName: input.jobQueueName }), + ...(input.priority !== undefined && input.priority !== null && { priority: input.priority }), + ...(input.state !== undefined && input.state !== null && { state: input.state }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -193,12 +198,13 @@ export const serializeAws_restJson1DeleteComputeEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/deletecomputeenvironment"; let body: any; body = JSON.stringify({ - ...(input.computeEnvironment !== undefined && { computeEnvironment: input.computeEnvironment }), + ...(input.computeEnvironment !== undefined && + input.computeEnvironment !== null && { computeEnvironment: input.computeEnvironment }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -217,12 +223,12 @@ export const serializeAws_restJson1DeleteJobQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/deletejobqueue"; let body: any; body = JSON.stringify({ - ...(input.jobQueue !== undefined && { jobQueue: input.jobQueue }), + ...(input.jobQueue !== undefined && input.jobQueue !== null && { jobQueue: input.jobQueue }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -241,12 +247,12 @@ export const serializeAws_restJson1DeregisterJobDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/deregisterjobdefinition"; let body: any; body = JSON.stringify({ - ...(input.jobDefinition !== undefined && { jobDefinition: input.jobDefinition }), + ...(input.jobDefinition !== undefined && input.jobDefinition !== null && { jobDefinition: input.jobDefinition }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -265,16 +271,17 @@ export const serializeAws_restJson1DescribeComputeEnvironmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/describecomputeenvironments"; let body: any; body = JSON.stringify({ - ...(input.computeEnvironments !== undefined && { - computeEnvironments: serializeAws_restJson1StringList(input.computeEnvironments, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.computeEnvironments !== undefined && + input.computeEnvironments !== null && { + computeEnvironments: serializeAws_restJson1StringList(input.computeEnvironments, context), + }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -293,18 +300,20 @@ export const serializeAws_restJson1DescribeJobDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/describejobdefinitions"; let body: any; body = JSON.stringify({ - ...(input.jobDefinitionName !== undefined && { jobDefinitionName: input.jobDefinitionName }), - ...(input.jobDefinitions !== undefined && { - jobDefinitions: serializeAws_restJson1StringList(input.jobDefinitions, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.status !== undefined && { status: input.status }), + ...(input.jobDefinitionName !== undefined && + input.jobDefinitionName !== null && { jobDefinitionName: input.jobDefinitionName }), + ...(input.jobDefinitions !== undefined && + input.jobDefinitions !== null && { + jobDefinitions: serializeAws_restJson1StringList(input.jobDefinitions, context), + }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -323,14 +332,15 @@ export const serializeAws_restJson1DescribeJobQueuesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/describejobqueues"; let body: any; body = JSON.stringify({ - ...(input.jobQueues !== undefined && { jobQueues: serializeAws_restJson1StringList(input.jobQueues, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.jobQueues !== undefined && + input.jobQueues !== null && { jobQueues: serializeAws_restJson1StringList(input.jobQueues, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -349,12 +359,13 @@ export const serializeAws_restJson1DescribeJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/describejobs"; let body: any; body = JSON.stringify({ - ...(input.jobs !== undefined && { jobs: serializeAws_restJson1StringList(input.jobs, context) }), + ...(input.jobs !== undefined && + input.jobs !== null && { jobs: serializeAws_restJson1StringList(input.jobs, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -373,17 +384,18 @@ export const serializeAws_restJson1ListJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/listjobs"; let body: any; body = JSON.stringify({ - ...(input.arrayJobId !== undefined && { arrayJobId: input.arrayJobId }), - ...(input.jobQueue !== undefined && { jobQueue: input.jobQueue }), - ...(input.jobStatus !== undefined && { jobStatus: input.jobStatus }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.multiNodeJobId !== undefined && { multiNodeJobId: input.multiNodeJobId }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arrayJobId !== undefined && input.arrayJobId !== null && { arrayJobId: input.arrayJobId }), + ...(input.jobQueue !== undefined && input.jobQueue !== null && { jobQueue: input.jobQueue }), + ...(input.jobStatus !== undefined && input.jobStatus !== null && { jobStatus: input.jobStatus }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.multiNodeJobId !== undefined && + input.multiNodeJobId !== null && { multiNodeJobId: input.multiNodeJobId }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -401,9 +413,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -432,31 +442,37 @@ export const serializeAws_restJson1RegisterJobDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/registerjobdefinition"; let body: any; body = JSON.stringify({ - ...(input.containerProperties !== undefined && { - containerProperties: serializeAws_restJson1ContainerProperties(input.containerProperties, context), - }), - ...(input.jobDefinitionName !== undefined && { jobDefinitionName: input.jobDefinitionName }), - ...(input.nodeProperties !== undefined && { - nodeProperties: serializeAws_restJson1NodeProperties(input.nodeProperties, context), - }), - ...(input.parameters !== undefined && { - parameters: serializeAws_restJson1ParametersMap(input.parameters, context), - }), - ...(input.platformCapabilities !== undefined && { - platformCapabilities: serializeAws_restJson1PlatformCapabilityList(input.platformCapabilities, context), - }), - ...(input.propagateTags !== undefined && { propagateTags: input.propagateTags }), - ...(input.retryStrategy !== undefined && { - retryStrategy: serializeAws_restJson1RetryStrategy(input.retryStrategy, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), - ...(input.timeout !== undefined && { timeout: serializeAws_restJson1JobTimeout(input.timeout, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.containerProperties !== undefined && + input.containerProperties !== null && { + containerProperties: serializeAws_restJson1ContainerProperties(input.containerProperties, context), + }), + ...(input.jobDefinitionName !== undefined && + input.jobDefinitionName !== null && { jobDefinitionName: input.jobDefinitionName }), + ...(input.nodeProperties !== undefined && + input.nodeProperties !== null && { + nodeProperties: serializeAws_restJson1NodeProperties(input.nodeProperties, context), + }), + ...(input.parameters !== undefined && + input.parameters !== null && { parameters: serializeAws_restJson1ParametersMap(input.parameters, context) }), + ...(input.platformCapabilities !== undefined && + input.platformCapabilities !== null && { + platformCapabilities: serializeAws_restJson1PlatformCapabilityList(input.platformCapabilities, context), + }), + ...(input.propagateTags !== undefined && input.propagateTags !== null && { propagateTags: input.propagateTags }), + ...(input.retryStrategy !== undefined && + input.retryStrategy !== null && { + retryStrategy: serializeAws_restJson1RetryStrategy(input.retryStrategy, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), + ...(input.timeout !== undefined && + input.timeout !== null && { timeout: serializeAws_restJson1JobTimeout(input.timeout, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -475,35 +491,39 @@ export const serializeAws_restJson1SubmitJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/submitjob"; let body: any; body = JSON.stringify({ - ...(input.arrayProperties !== undefined && { - arrayProperties: serializeAws_restJson1ArrayProperties(input.arrayProperties, context), - }), - ...(input.containerOverrides !== undefined && { - containerOverrides: serializeAws_restJson1ContainerOverrides(input.containerOverrides, context), - }), - ...(input.dependsOn !== undefined && { - dependsOn: serializeAws_restJson1JobDependencyList(input.dependsOn, context), - }), - ...(input.jobDefinition !== undefined && { jobDefinition: input.jobDefinition }), - ...(input.jobName !== undefined && { jobName: input.jobName }), - ...(input.jobQueue !== undefined && { jobQueue: input.jobQueue }), - ...(input.nodeOverrides !== undefined && { - nodeOverrides: serializeAws_restJson1NodeOverrides(input.nodeOverrides, context), - }), - ...(input.parameters !== undefined && { - parameters: serializeAws_restJson1ParametersMap(input.parameters, context), - }), - ...(input.propagateTags !== undefined && { propagateTags: input.propagateTags }), - ...(input.retryStrategy !== undefined && { - retryStrategy: serializeAws_restJson1RetryStrategy(input.retryStrategy, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), - ...(input.timeout !== undefined && { timeout: serializeAws_restJson1JobTimeout(input.timeout, context) }), + ...(input.arrayProperties !== undefined && + input.arrayProperties !== null && { + arrayProperties: serializeAws_restJson1ArrayProperties(input.arrayProperties, context), + }), + ...(input.containerOverrides !== undefined && + input.containerOverrides !== null && { + containerOverrides: serializeAws_restJson1ContainerOverrides(input.containerOverrides, context), + }), + ...(input.dependsOn !== undefined && + input.dependsOn !== null && { dependsOn: serializeAws_restJson1JobDependencyList(input.dependsOn, context) }), + ...(input.jobDefinition !== undefined && input.jobDefinition !== null && { jobDefinition: input.jobDefinition }), + ...(input.jobName !== undefined && input.jobName !== null && { jobName: input.jobName }), + ...(input.jobQueue !== undefined && input.jobQueue !== null && { jobQueue: input.jobQueue }), + ...(input.nodeOverrides !== undefined && + input.nodeOverrides !== null && { + nodeOverrides: serializeAws_restJson1NodeOverrides(input.nodeOverrides, context), + }), + ...(input.parameters !== undefined && + input.parameters !== null && { parameters: serializeAws_restJson1ParametersMap(input.parameters, context) }), + ...(input.propagateTags !== undefined && input.propagateTags !== null && { propagateTags: input.propagateTags }), + ...(input.retryStrategy !== undefined && + input.retryStrategy !== null && { + retryStrategy: serializeAws_restJson1RetryStrategy(input.retryStrategy, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), + ...(input.timeout !== undefined && + input.timeout !== null && { timeout: serializeAws_restJson1JobTimeout(input.timeout, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -522,7 +542,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -536,7 +556,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -555,13 +576,13 @@ export const serializeAws_restJson1TerminateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/terminatejob"; let body: any; body = JSON.stringify({ - ...(input.jobId !== undefined && { jobId: input.jobId }), - ...(input.reason !== undefined && { reason: input.reason }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -579,9 +600,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -614,17 +633,19 @@ export const serializeAws_restJson1UpdateComputeEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/updatecomputeenvironment"; let body: any; body = JSON.stringify({ - ...(input.computeEnvironment !== undefined && { computeEnvironment: input.computeEnvironment }), - ...(input.computeResources !== undefined && { - computeResources: serializeAws_restJson1ComputeResourceUpdate(input.computeResources, context), - }), - ...(input.serviceRole !== undefined && { serviceRole: input.serviceRole }), - ...(input.state !== undefined && { state: input.state }), + ...(input.computeEnvironment !== undefined && + input.computeEnvironment !== null && { computeEnvironment: input.computeEnvironment }), + ...(input.computeResources !== undefined && + input.computeResources !== null && { + computeResources: serializeAws_restJson1ComputeResourceUpdate(input.computeResources, context), + }), + ...(input.serviceRole !== undefined && input.serviceRole !== null && { serviceRole: input.serviceRole }), + ...(input.state !== undefined && input.state !== null && { state: input.state }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -643,17 +664,18 @@ export const serializeAws_restJson1UpdateJobQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/updatejobqueue"; let body: any; body = JSON.stringify({ - ...(input.computeEnvironmentOrder !== undefined && { - computeEnvironmentOrder: serializeAws_restJson1ComputeEnvironmentOrders(input.computeEnvironmentOrder, context), - }), - ...(input.jobQueue !== undefined && { jobQueue: input.jobQueue }), - ...(input.priority !== undefined && { priority: input.priority }), - ...(input.state !== undefined && { state: input.state }), + ...(input.computeEnvironmentOrder !== undefined && + input.computeEnvironmentOrder !== null && { + computeEnvironmentOrder: serializeAws_restJson1ComputeEnvironmentOrders(input.computeEnvironmentOrder, context), + }), + ...(input.jobQueue !== undefined && input.jobQueue !== null && { jobQueue: input.jobQueue }), + ...(input.priority !== undefined && input.priority !== null && { priority: input.priority }), + ...(input.state !== undefined && input.state !== null && { state: input.state }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1923,7 +1945,7 @@ const deserializeAws_restJson1ServerExceptionResponse = async ( const serializeAws_restJson1ArrayProperties = (input: ArrayProperties, context: __SerdeContext): any => { return { - ...(input.size !== undefined && { size: input.size }), + ...(input.size !== undefined && input.size !== null && { size: input.size }), }; }; @@ -1932,8 +1954,9 @@ const serializeAws_restJson1ComputeEnvironmentOrder = ( context: __SerdeContext ): any => { return { - ...(input.computeEnvironment !== undefined && { computeEnvironment: input.computeEnvironment }), - ...(input.order !== undefined && { order: input.order }), + ...(input.computeEnvironment !== undefined && + input.computeEnvironment !== null && { computeEnvironment: input.computeEnvironment }), + ...(input.order !== undefined && input.order !== null && { order: input.order }), }; }; @@ -1941,115 +1964,148 @@ const serializeAws_restJson1ComputeEnvironmentOrders = ( input: ComputeEnvironmentOrder[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ComputeEnvironmentOrder(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ComputeEnvironmentOrder(entry, context); + }); }; const serializeAws_restJson1ComputeResource = (input: ComputeResource, context: __SerdeContext): any => { return { - ...(input.allocationStrategy !== undefined && { allocationStrategy: input.allocationStrategy }), - ...(input.bidPercentage !== undefined && { bidPercentage: input.bidPercentage }), - ...(input.desiredvCpus !== undefined && { desiredvCpus: input.desiredvCpus }), - ...(input.ec2Configuration !== undefined && { - ec2Configuration: serializeAws_restJson1Ec2ConfigurationList(input.ec2Configuration, context), - }), - ...(input.ec2KeyPair !== undefined && { ec2KeyPair: input.ec2KeyPair }), - ...(input.imageId !== undefined && { imageId: input.imageId }), - ...(input.instanceRole !== undefined && { instanceRole: input.instanceRole }), - ...(input.instanceTypes !== undefined && { - instanceTypes: serializeAws_restJson1StringList(input.instanceTypes, context), - }), - ...(input.launchTemplate !== undefined && { - launchTemplate: serializeAws_restJson1LaunchTemplateSpecification(input.launchTemplate, context), - }), - ...(input.maxvCpus !== undefined && { maxvCpus: input.maxvCpus }), - ...(input.minvCpus !== undefined && { minvCpus: input.minvCpus }), - ...(input.placementGroup !== undefined && { placementGroup: input.placementGroup }), - ...(input.securityGroupIds !== undefined && { - securityGroupIds: serializeAws_restJson1StringList(input.securityGroupIds, context), - }), - ...(input.spotIamFleetRole !== undefined && { spotIamFleetRole: input.spotIamFleetRole }), - ...(input.subnets !== undefined && { subnets: serializeAws_restJson1StringList(input.subnets, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.allocationStrategy !== undefined && + input.allocationStrategy !== null && { allocationStrategy: input.allocationStrategy }), + ...(input.bidPercentage !== undefined && input.bidPercentage !== null && { bidPercentage: input.bidPercentage }), + ...(input.desiredvCpus !== undefined && input.desiredvCpus !== null && { desiredvCpus: input.desiredvCpus }), + ...(input.ec2Configuration !== undefined && + input.ec2Configuration !== null && { + ec2Configuration: serializeAws_restJson1Ec2ConfigurationList(input.ec2Configuration, context), + }), + ...(input.ec2KeyPair !== undefined && input.ec2KeyPair !== null && { ec2KeyPair: input.ec2KeyPair }), + ...(input.imageId !== undefined && input.imageId !== null && { imageId: input.imageId }), + ...(input.instanceRole !== undefined && input.instanceRole !== null && { instanceRole: input.instanceRole }), + ...(input.instanceTypes !== undefined && + input.instanceTypes !== null && { + instanceTypes: serializeAws_restJson1StringList(input.instanceTypes, context), + }), + ...(input.launchTemplate !== undefined && + input.launchTemplate !== null && { + launchTemplate: serializeAws_restJson1LaunchTemplateSpecification(input.launchTemplate, context), + }), + ...(input.maxvCpus !== undefined && input.maxvCpus !== null && { maxvCpus: input.maxvCpus }), + ...(input.minvCpus !== undefined && input.minvCpus !== null && { minvCpus: input.minvCpus }), + ...(input.placementGroup !== undefined && + input.placementGroup !== null && { placementGroup: input.placementGroup }), + ...(input.securityGroupIds !== undefined && + input.securityGroupIds !== null && { + securityGroupIds: serializeAws_restJson1StringList(input.securityGroupIds, context), + }), + ...(input.spotIamFleetRole !== undefined && + input.spotIamFleetRole !== null && { spotIamFleetRole: input.spotIamFleetRole }), + ...(input.subnets !== undefined && + input.subnets !== null && { subnets: serializeAws_restJson1StringList(input.subnets, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1ComputeResourceUpdate = (input: ComputeResourceUpdate, context: __SerdeContext): any => { return { - ...(input.desiredvCpus !== undefined && { desiredvCpus: input.desiredvCpus }), - ...(input.maxvCpus !== undefined && { maxvCpus: input.maxvCpus }), - ...(input.minvCpus !== undefined && { minvCpus: input.minvCpus }), - ...(input.securityGroupIds !== undefined && { - securityGroupIds: serializeAws_restJson1StringList(input.securityGroupIds, context), - }), - ...(input.subnets !== undefined && { subnets: serializeAws_restJson1StringList(input.subnets, context) }), + ...(input.desiredvCpus !== undefined && input.desiredvCpus !== null && { desiredvCpus: input.desiredvCpus }), + ...(input.maxvCpus !== undefined && input.maxvCpus !== null && { maxvCpus: input.maxvCpus }), + ...(input.minvCpus !== undefined && input.minvCpus !== null && { minvCpus: input.minvCpus }), + ...(input.securityGroupIds !== undefined && + input.securityGroupIds !== null && { + securityGroupIds: serializeAws_restJson1StringList(input.securityGroupIds, context), + }), + ...(input.subnets !== undefined && + input.subnets !== null && { subnets: serializeAws_restJson1StringList(input.subnets, context) }), }; }; const serializeAws_restJson1ContainerOverrides = (input: ContainerOverrides, context: __SerdeContext): any => { return { - ...(input.command !== undefined && { command: serializeAws_restJson1StringList(input.command, context) }), - ...(input.environment !== undefined && { - environment: serializeAws_restJson1EnvironmentVariables(input.environment, context), - }), - ...(input.instanceType !== undefined && { instanceType: input.instanceType }), - ...(input.memory !== undefined && { memory: input.memory }), - ...(input.resourceRequirements !== undefined && { - resourceRequirements: serializeAws_restJson1ResourceRequirements(input.resourceRequirements, context), - }), - ...(input.vcpus !== undefined && { vcpus: input.vcpus }), + ...(input.command !== undefined && + input.command !== null && { command: serializeAws_restJson1StringList(input.command, context) }), + ...(input.environment !== undefined && + input.environment !== null && { + environment: serializeAws_restJson1EnvironmentVariables(input.environment, context), + }), + ...(input.instanceType !== undefined && input.instanceType !== null && { instanceType: input.instanceType }), + ...(input.memory !== undefined && input.memory !== null && { memory: input.memory }), + ...(input.resourceRequirements !== undefined && + input.resourceRequirements !== null && { + resourceRequirements: serializeAws_restJson1ResourceRequirements(input.resourceRequirements, context), + }), + ...(input.vcpus !== undefined && input.vcpus !== null && { vcpus: input.vcpus }), }; }; const serializeAws_restJson1ContainerProperties = (input: ContainerProperties, context: __SerdeContext): any => { return { - ...(input.command !== undefined && { command: serializeAws_restJson1StringList(input.command, context) }), - ...(input.environment !== undefined && { - environment: serializeAws_restJson1EnvironmentVariables(input.environment, context), - }), - ...(input.executionRoleArn !== undefined && { executionRoleArn: input.executionRoleArn }), - ...(input.fargatePlatformConfiguration !== undefined && { - fargatePlatformConfiguration: serializeAws_restJson1FargatePlatformConfiguration( - input.fargatePlatformConfiguration, - context - ), - }), - ...(input.image !== undefined && { image: input.image }), - ...(input.instanceType !== undefined && { instanceType: input.instanceType }), - ...(input.jobRoleArn !== undefined && { jobRoleArn: input.jobRoleArn }), - ...(input.linuxParameters !== undefined && { - linuxParameters: serializeAws_restJson1LinuxParameters(input.linuxParameters, context), - }), - ...(input.logConfiguration !== undefined && { - logConfiguration: serializeAws_restJson1LogConfiguration(input.logConfiguration, context), - }), - ...(input.memory !== undefined && { memory: input.memory }), - ...(input.mountPoints !== undefined && { - mountPoints: serializeAws_restJson1MountPoints(input.mountPoints, context), - }), - ...(input.networkConfiguration !== undefined && { - networkConfiguration: serializeAws_restJson1NetworkConfiguration(input.networkConfiguration, context), - }), - ...(input.privileged !== undefined && { privileged: input.privileged }), - ...(input.readonlyRootFilesystem !== undefined && { readonlyRootFilesystem: input.readonlyRootFilesystem }), - ...(input.resourceRequirements !== undefined && { - resourceRequirements: serializeAws_restJson1ResourceRequirements(input.resourceRequirements, context), - }), - ...(input.secrets !== undefined && { secrets: serializeAws_restJson1SecretList(input.secrets, context) }), - ...(input.ulimits !== undefined && { ulimits: serializeAws_restJson1Ulimits(input.ulimits, context) }), - ...(input.user !== undefined && { user: input.user }), - ...(input.vcpus !== undefined && { vcpus: input.vcpus }), - ...(input.volumes !== undefined && { volumes: serializeAws_restJson1Volumes(input.volumes, context) }), + ...(input.command !== undefined && + input.command !== null && { command: serializeAws_restJson1StringList(input.command, context) }), + ...(input.environment !== undefined && + input.environment !== null && { + environment: serializeAws_restJson1EnvironmentVariables(input.environment, context), + }), + ...(input.executionRoleArn !== undefined && + input.executionRoleArn !== null && { executionRoleArn: input.executionRoleArn }), + ...(input.fargatePlatformConfiguration !== undefined && + input.fargatePlatformConfiguration !== null && { + fargatePlatformConfiguration: serializeAws_restJson1FargatePlatformConfiguration( + input.fargatePlatformConfiguration, + context + ), + }), + ...(input.image !== undefined && input.image !== null && { image: input.image }), + ...(input.instanceType !== undefined && input.instanceType !== null && { instanceType: input.instanceType }), + ...(input.jobRoleArn !== undefined && input.jobRoleArn !== null && { jobRoleArn: input.jobRoleArn }), + ...(input.linuxParameters !== undefined && + input.linuxParameters !== null && { + linuxParameters: serializeAws_restJson1LinuxParameters(input.linuxParameters, context), + }), + ...(input.logConfiguration !== undefined && + input.logConfiguration !== null && { + logConfiguration: serializeAws_restJson1LogConfiguration(input.logConfiguration, context), + }), + ...(input.memory !== undefined && input.memory !== null && { memory: input.memory }), + ...(input.mountPoints !== undefined && + input.mountPoints !== null && { mountPoints: serializeAws_restJson1MountPoints(input.mountPoints, context) }), + ...(input.networkConfiguration !== undefined && + input.networkConfiguration !== null && { + networkConfiguration: serializeAws_restJson1NetworkConfiguration(input.networkConfiguration, context), + }), + ...(input.privileged !== undefined && input.privileged !== null && { privileged: input.privileged }), + ...(input.readonlyRootFilesystem !== undefined && + input.readonlyRootFilesystem !== null && { readonlyRootFilesystem: input.readonlyRootFilesystem }), + ...(input.resourceRequirements !== undefined && + input.resourceRequirements !== null && { + resourceRequirements: serializeAws_restJson1ResourceRequirements(input.resourceRequirements, context), + }), + ...(input.secrets !== undefined && + input.secrets !== null && { secrets: serializeAws_restJson1SecretList(input.secrets, context) }), + ...(input.ulimits !== undefined && + input.ulimits !== null && { ulimits: serializeAws_restJson1Ulimits(input.ulimits, context) }), + ...(input.user !== undefined && input.user !== null && { user: input.user }), + ...(input.vcpus !== undefined && input.vcpus !== null && { vcpus: input.vcpus }), + ...(input.volumes !== undefined && + input.volumes !== null && { volumes: serializeAws_restJson1Volumes(input.volumes, context) }), }; }; const serializeAws_restJson1Device = (input: Device, context: __SerdeContext): any => { return { - ...(input.containerPath !== undefined && { containerPath: input.containerPath }), - ...(input.hostPath !== undefined && { hostPath: input.hostPath }), - ...(input.permissions !== undefined && { - permissions: serializeAws_restJson1DeviceCgroupPermissions(input.permissions, context), - }), + ...(input.containerPath !== undefined && input.containerPath !== null && { containerPath: input.containerPath }), + ...(input.hostPath !== undefined && input.hostPath !== null && { hostPath: input.hostPath }), + ...(input.permissions !== undefined && + input.permissions !== null && { + permissions: serializeAws_restJson1DeviceCgroupPermissions(input.permissions, context), + }), }; }; @@ -2057,39 +2113,76 @@ const serializeAws_restJson1DeviceCgroupPermissions = ( input: (DeviceCgroupPermission | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DevicesList = (input: Device[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Device(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Device(entry, context); + }); }; const serializeAws_restJson1Ec2Configuration = (input: Ec2Configuration, context: __SerdeContext): any => { return { - ...(input.imageIdOverride !== undefined && { imageIdOverride: input.imageIdOverride }), - ...(input.imageType !== undefined && { imageType: input.imageType }), + ...(input.imageIdOverride !== undefined && + input.imageIdOverride !== null && { imageIdOverride: input.imageIdOverride }), + ...(input.imageType !== undefined && input.imageType !== null && { imageType: input.imageType }), }; }; const serializeAws_restJson1Ec2ConfigurationList = (input: Ec2Configuration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Ec2Configuration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Ec2Configuration(entry, context); + }); }; const serializeAws_restJson1EnvironmentVariables = (input: KeyValuePair[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1KeyValuePair(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1KeyValuePair(entry, context); + }); }; const serializeAws_restJson1EvaluateOnExit = (input: EvaluateOnExit, context: __SerdeContext): any => { return { - ...(input.action !== undefined && { action: input.action }), - ...(input.onExitCode !== undefined && { onExitCode: input.onExitCode }), - ...(input.onReason !== undefined && { onReason: input.onReason }), - ...(input.onStatusReason !== undefined && { onStatusReason: input.onStatusReason }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), + ...(input.onExitCode !== undefined && input.onExitCode !== null && { onExitCode: input.onExitCode }), + ...(input.onReason !== undefined && input.onReason !== null && { onReason: input.onReason }), + ...(input.onStatusReason !== undefined && + input.onStatusReason !== null && { onStatusReason: input.onStatusReason }), }; }; const serializeAws_restJson1EvaluateOnExitList = (input: EvaluateOnExit[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1EvaluateOnExit(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1EvaluateOnExit(entry, context); + }); }; const serializeAws_restJson1FargatePlatformConfiguration = ( @@ -2097,37 +2190,46 @@ const serializeAws_restJson1FargatePlatformConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.platformVersion !== undefined && { platformVersion: input.platformVersion }), + ...(input.platformVersion !== undefined && + input.platformVersion !== null && { platformVersion: input.platformVersion }), }; }; const serializeAws_restJson1Host = (input: Host, context: __SerdeContext): any => { return { - ...(input.sourcePath !== undefined && { sourcePath: input.sourcePath }), + ...(input.sourcePath !== undefined && input.sourcePath !== null && { sourcePath: input.sourcePath }), }; }; const serializeAws_restJson1JobDependency = (input: JobDependency, context: __SerdeContext): any => { return { - ...(input.jobId !== undefined && { jobId: input.jobId }), - ...(input.type !== undefined && { type: input.type }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1JobDependencyList = (input: JobDependency[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1JobDependency(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1JobDependency(entry, context); + }); }; const serializeAws_restJson1JobTimeout = (input: JobTimeout, context: __SerdeContext): any => { return { - ...(input.attemptDurationSeconds !== undefined && { attemptDurationSeconds: input.attemptDurationSeconds }), + ...(input.attemptDurationSeconds !== undefined && + input.attemptDurationSeconds !== null && { attemptDurationSeconds: input.attemptDurationSeconds }), }; }; const serializeAws_restJson1KeyValuePair = (input: KeyValuePair, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: input.value }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; @@ -2136,32 +2238,38 @@ const serializeAws_restJson1LaunchTemplateSpecification = ( context: __SerdeContext ): any => { return { - ...(input.launchTemplateId !== undefined && { launchTemplateId: input.launchTemplateId }), - ...(input.launchTemplateName !== undefined && { launchTemplateName: input.launchTemplateName }), - ...(input.version !== undefined && { version: input.version }), + ...(input.launchTemplateId !== undefined && + input.launchTemplateId !== null && { launchTemplateId: input.launchTemplateId }), + ...(input.launchTemplateName !== undefined && + input.launchTemplateName !== null && { launchTemplateName: input.launchTemplateName }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_restJson1LinuxParameters = (input: LinuxParameters, context: __SerdeContext): any => { return { - ...(input.devices !== undefined && { devices: serializeAws_restJson1DevicesList(input.devices, context) }), - ...(input.initProcessEnabled !== undefined && { initProcessEnabled: input.initProcessEnabled }), - ...(input.maxSwap !== undefined && { maxSwap: input.maxSwap }), - ...(input.sharedMemorySize !== undefined && { sharedMemorySize: input.sharedMemorySize }), - ...(input.swappiness !== undefined && { swappiness: input.swappiness }), - ...(input.tmpfs !== undefined && { tmpfs: serializeAws_restJson1TmpfsList(input.tmpfs, context) }), + ...(input.devices !== undefined && + input.devices !== null && { devices: serializeAws_restJson1DevicesList(input.devices, context) }), + ...(input.initProcessEnabled !== undefined && + input.initProcessEnabled !== null && { initProcessEnabled: input.initProcessEnabled }), + ...(input.maxSwap !== undefined && input.maxSwap !== null && { maxSwap: input.maxSwap }), + ...(input.sharedMemorySize !== undefined && + input.sharedMemorySize !== null && { sharedMemorySize: input.sharedMemorySize }), + ...(input.swappiness !== undefined && input.swappiness !== null && { swappiness: input.swappiness }), + ...(input.tmpfs !== undefined && + input.tmpfs !== null && { tmpfs: serializeAws_restJson1TmpfsList(input.tmpfs, context) }), }; }; const serializeAws_restJson1LogConfiguration = (input: LogConfiguration, context: __SerdeContext): any => { return { - ...(input.logDriver !== undefined && { logDriver: input.logDriver }), - ...(input.options !== undefined && { - options: serializeAws_restJson1LogConfigurationOptionsMap(input.options, context), - }), - ...(input.secretOptions !== undefined && { - secretOptions: serializeAws_restJson1SecretList(input.secretOptions, context), - }), + ...(input.logDriver !== undefined && input.logDriver !== null && { logDriver: input.logDriver }), + ...(input.options !== undefined && + input.options !== null && { options: serializeAws_restJson1LogConfigurationOptionsMap(input.options, context) }), + ...(input.secretOptions !== undefined && + input.secretOptions !== null && { + secretOptions: serializeAws_restJson1SecretList(input.secretOptions, context), + }), }; }; @@ -2169,198 +2277,281 @@ const serializeAws_restJson1LogConfigurationOptionsMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MountPoint = (input: MountPoint, context: __SerdeContext): any => { return { - ...(input.containerPath !== undefined && { containerPath: input.containerPath }), - ...(input.readOnly !== undefined && { readOnly: input.readOnly }), - ...(input.sourceVolume !== undefined && { sourceVolume: input.sourceVolume }), + ...(input.containerPath !== undefined && input.containerPath !== null && { containerPath: input.containerPath }), + ...(input.readOnly !== undefined && input.readOnly !== null && { readOnly: input.readOnly }), + ...(input.sourceVolume !== undefined && input.sourceVolume !== null && { sourceVolume: input.sourceVolume }), }; }; const serializeAws_restJson1MountPoints = (input: MountPoint[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1MountPoint(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MountPoint(entry, context); + }); }; const serializeAws_restJson1NetworkConfiguration = (input: NetworkConfiguration, context: __SerdeContext): any => { return { - ...(input.assignPublicIp !== undefined && { assignPublicIp: input.assignPublicIp }), + ...(input.assignPublicIp !== undefined && + input.assignPublicIp !== null && { assignPublicIp: input.assignPublicIp }), }; }; const serializeAws_restJson1NodeOverrides = (input: NodeOverrides, context: __SerdeContext): any => { return { - ...(input.nodePropertyOverrides !== undefined && { - nodePropertyOverrides: serializeAws_restJson1NodePropertyOverrides(input.nodePropertyOverrides, context), - }), - ...(input.numNodes !== undefined && { numNodes: input.numNodes }), + ...(input.nodePropertyOverrides !== undefined && + input.nodePropertyOverrides !== null && { + nodePropertyOverrides: serializeAws_restJson1NodePropertyOverrides(input.nodePropertyOverrides, context), + }), + ...(input.numNodes !== undefined && input.numNodes !== null && { numNodes: input.numNodes }), }; }; const serializeAws_restJson1NodeProperties = (input: NodeProperties, context: __SerdeContext): any => { return { - ...(input.mainNode !== undefined && { mainNode: input.mainNode }), - ...(input.nodeRangeProperties !== undefined && { - nodeRangeProperties: serializeAws_restJson1NodeRangeProperties(input.nodeRangeProperties, context), - }), - ...(input.numNodes !== undefined && { numNodes: input.numNodes }), + ...(input.mainNode !== undefined && input.mainNode !== null && { mainNode: input.mainNode }), + ...(input.nodeRangeProperties !== undefined && + input.nodeRangeProperties !== null && { + nodeRangeProperties: serializeAws_restJson1NodeRangeProperties(input.nodeRangeProperties, context), + }), + ...(input.numNodes !== undefined && input.numNodes !== null && { numNodes: input.numNodes }), }; }; const serializeAws_restJson1NodePropertyOverride = (input: NodePropertyOverride, context: __SerdeContext): any => { return { - ...(input.containerOverrides !== undefined && { - containerOverrides: serializeAws_restJson1ContainerOverrides(input.containerOverrides, context), - }), - ...(input.targetNodes !== undefined && { targetNodes: input.targetNodes }), + ...(input.containerOverrides !== undefined && + input.containerOverrides !== null && { + containerOverrides: serializeAws_restJson1ContainerOverrides(input.containerOverrides, context), + }), + ...(input.targetNodes !== undefined && input.targetNodes !== null && { targetNodes: input.targetNodes }), }; }; const serializeAws_restJson1NodePropertyOverrides = (input: NodePropertyOverride[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1NodePropertyOverride(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1NodePropertyOverride(entry, context); + }); }; const serializeAws_restJson1NodeRangeProperties = (input: NodeRangeProperty[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1NodeRangeProperty(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1NodeRangeProperty(entry, context); + }); }; const serializeAws_restJson1NodeRangeProperty = (input: NodeRangeProperty, context: __SerdeContext): any => { return { - ...(input.container !== undefined && { - container: serializeAws_restJson1ContainerProperties(input.container, context), - }), - ...(input.targetNodes !== undefined && { targetNodes: input.targetNodes }), + ...(input.container !== undefined && + input.container !== null && { container: serializeAws_restJson1ContainerProperties(input.container, context) }), + ...(input.targetNodes !== undefined && input.targetNodes !== null && { targetNodes: input.targetNodes }), }; }; const serializeAws_restJson1ParametersMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1PlatformCapabilityList = ( input: (PlatformCapability | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResourceRequirement = (input: ResourceRequirement, context: __SerdeContext): any => { return { - ...(input.type !== undefined && { type: input.type }), - ...(input.value !== undefined && { value: input.value }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1ResourceRequirements = (input: ResourceRequirement[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ResourceRequirement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ResourceRequirement(entry, context); + }); }; const serializeAws_restJson1RetryStrategy = (input: RetryStrategy, context: __SerdeContext): any => { return { - ...(input.attempts !== undefined && { attempts: input.attempts }), - ...(input.evaluateOnExit !== undefined && { - evaluateOnExit: serializeAws_restJson1EvaluateOnExitList(input.evaluateOnExit, context), - }), + ...(input.attempts !== undefined && input.attempts !== null && { attempts: input.attempts }), + ...(input.evaluateOnExit !== undefined && + input.evaluateOnExit !== null && { + evaluateOnExit: serializeAws_restJson1EvaluateOnExitList(input.evaluateOnExit, context), + }), }; }; const serializeAws_restJson1Secret = (input: Secret, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.valueFrom !== undefined && { valueFrom: input.valueFrom }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.valueFrom !== undefined && input.valueFrom !== null && { valueFrom: input.valueFrom }), }; }; const serializeAws_restJson1SecretList = (input: Secret[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Secret(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Secret(entry, context); + }); }; const serializeAws_restJson1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagrisTagsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TagsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Tmpfs = (input: Tmpfs, context: __SerdeContext): any => { return { - ...(input.containerPath !== undefined && { containerPath: input.containerPath }), - ...(input.mountOptions !== undefined && { - mountOptions: serializeAws_restJson1StringList(input.mountOptions, context), - }), - ...(input.size !== undefined && { size: input.size }), + ...(input.containerPath !== undefined && input.containerPath !== null && { containerPath: input.containerPath }), + ...(input.mountOptions !== undefined && + input.mountOptions !== null && { mountOptions: serializeAws_restJson1StringList(input.mountOptions, context) }), + ...(input.size !== undefined && input.size !== null && { size: input.size }), }; }; const serializeAws_restJson1TmpfsList = (input: Tmpfs[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tmpfs(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tmpfs(entry, context); + }); }; const serializeAws_restJson1Ulimit = (input: Ulimit, context: __SerdeContext): any => { return { - ...(input.hardLimit !== undefined && { hardLimit: input.hardLimit }), - ...(input.name !== undefined && { name: input.name }), - ...(input.softLimit !== undefined && { softLimit: input.softLimit }), + ...(input.hardLimit !== undefined && input.hardLimit !== null && { hardLimit: input.hardLimit }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.softLimit !== undefined && input.softLimit !== null && { softLimit: input.softLimit }), }; }; const serializeAws_restJson1Ulimits = (input: Ulimit[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Ulimit(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Ulimit(entry, context); + }); }; const serializeAws_restJson1Volume = (input: Volume, context: __SerdeContext): any => { return { - ...(input.host !== undefined && { host: serializeAws_restJson1Host(input.host, context) }), - ...(input.name !== undefined && { name: input.name }), + ...(input.host !== undefined && input.host !== null && { host: serializeAws_restJson1Host(input.host, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_restJson1Volumes = (input: Volume[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Volume(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Volume(entry, context); + }); }; const deserializeAws_restJson1ArrayJobStatusSummary = ( output: any, context: __SerdeContext ): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ArrayPropertiesDetail = (output: any, context: __SerdeContext): ArrayPropertiesDetail => { @@ -2418,7 +2609,14 @@ const deserializeAws_restJson1AttemptDetail = (output: any, context: __SerdeCont }; const deserializeAws_restJson1AttemptDetails = (output: any, context: __SerdeContext): AttemptDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AttemptDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AttemptDetail(entry, context); + }); }; const deserializeAws_restJson1ComputeEnvironmentDetail = ( @@ -2456,7 +2654,14 @@ const deserializeAws_restJson1ComputeEnvironmentDetailList = ( output: any, context: __SerdeContext ): ComputeEnvironmentDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ComputeEnvironmentDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ComputeEnvironmentDetail(entry, context); + }); }; const deserializeAws_restJson1ComputeEnvironmentOrder = ( @@ -2476,7 +2681,14 @@ const deserializeAws_restJson1ComputeEnvironmentOrders = ( output: any, context: __SerdeContext ): ComputeEnvironmentOrder[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ComputeEnvironmentOrder(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ComputeEnvironmentOrder(entry, context); + }); }; const deserializeAws_restJson1ComputeResource = (output: any, context: __SerdeContext): ComputeResource => { @@ -2685,11 +2897,25 @@ const deserializeAws_restJson1DeviceCgroupPermissions = ( output: any, context: __SerdeContext ): (DeviceCgroupPermission | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DevicesList = (output: any, context: __SerdeContext): Device[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Device(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Device(entry, context); + }); }; const deserializeAws_restJson1Ec2Configuration = (output: any, context: __SerdeContext): Ec2Configuration => { @@ -2701,11 +2927,25 @@ const deserializeAws_restJson1Ec2Configuration = (output: any, context: __SerdeC }; const deserializeAws_restJson1Ec2ConfigurationList = (output: any, context: __SerdeContext): Ec2Configuration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Ec2Configuration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Ec2Configuration(entry, context); + }); }; const deserializeAws_restJson1EnvironmentVariables = (output: any, context: __SerdeContext): KeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1KeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1KeyValuePair(entry, context); + }); }; const deserializeAws_restJson1EvaluateOnExit = (output: any, context: __SerdeContext): EvaluateOnExit => { @@ -2719,7 +2959,14 @@ const deserializeAws_restJson1EvaluateOnExit = (output: any, context: __SerdeCon }; const deserializeAws_restJson1EvaluateOnExitList = (output: any, context: __SerdeContext): EvaluateOnExit[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EvaluateOnExit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EvaluateOnExit(entry, context); + }); }; const deserializeAws_restJson1FargatePlatformConfiguration = ( @@ -2783,7 +3030,14 @@ const deserializeAws_restJson1JobDefinition = (output: any, context: __SerdeCont }; const deserializeAws_restJson1JobDefinitionList = (output: any, context: __SerdeContext): JobDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobDefinition(entry, context); + }); }; const deserializeAws_restJson1JobDependency = (output: any, context: __SerdeContext): JobDependency => { @@ -2794,7 +3048,14 @@ const deserializeAws_restJson1JobDependency = (output: any, context: __SerdeCont }; const deserializeAws_restJson1JobDependencyList = (output: any, context: __SerdeContext): JobDependency[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobDependency(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobDependency(entry, context); + }); }; const deserializeAws_restJson1JobDetail = (output: any, context: __SerdeContext): JobDetail => { @@ -2860,7 +3121,14 @@ const deserializeAws_restJson1JobDetail = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1JobDetailList = (output: any, context: __SerdeContext): JobDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobDetail(entry, context); + }); }; const deserializeAws_restJson1JobQueueDetail = (output: any, context: __SerdeContext): JobQueueDetail => { @@ -2883,7 +3151,14 @@ const deserializeAws_restJson1JobQueueDetail = (output: any, context: __SerdeCon }; const deserializeAws_restJson1JobQueueDetailList = (output: any, context: __SerdeContext): JobQueueDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobQueueDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobQueueDetail(entry, context); + }); }; const deserializeAws_restJson1JobSummary = (output: any, context: __SerdeContext): JobSummary => { @@ -2912,7 +3187,14 @@ const deserializeAws_restJson1JobSummary = (output: any, context: __SerdeContext }; const deserializeAws_restJson1JobSummaryList = (output: any, context: __SerdeContext): JobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobSummary(entry, context); + }); }; const deserializeAws_restJson1JobTimeout = (output: any, context: __SerdeContext): JobTimeout => { @@ -2985,13 +3267,15 @@ const deserializeAws_restJson1LogConfigurationOptionsMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MountPoint = (output: any, context: __SerdeContext): MountPoint => { @@ -3004,7 +3288,14 @@ const deserializeAws_restJson1MountPoint = (output: any, context: __SerdeContext }; const deserializeAws_restJson1MountPoints = (output: any, context: __SerdeContext): MountPoint[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MountPoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MountPoint(entry, context); + }); }; const deserializeAws_restJson1NetworkConfiguration = (output: any, context: __SerdeContext): NetworkConfiguration => { @@ -3026,7 +3317,14 @@ const deserializeAws_restJson1NetworkInterface = (output: any, context: __SerdeC }; const deserializeAws_restJson1NetworkInterfaceList = (output: any, context: __SerdeContext): NetworkInterface[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NetworkInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NetworkInterface(entry, context); + }); }; const deserializeAws_restJson1NodeDetails = (output: any, context: __SerdeContext): NodeDetails => { @@ -3056,7 +3354,14 @@ const deserializeAws_restJson1NodePropertiesSummary = (output: any, context: __S }; const deserializeAws_restJson1NodeRangeProperties = (output: any, context: __SerdeContext): NodeRangeProperty[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NodeRangeProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NodeRangeProperty(entry, context); + }); }; const deserializeAws_restJson1NodeRangeProperty = (output: any, context: __SerdeContext): NodeRangeProperty => { @@ -3070,20 +3375,29 @@ const deserializeAws_restJson1NodeRangeProperty = (output: any, context: __Serde }; const deserializeAws_restJson1ParametersMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1PlatformCapabilityList = ( output: any, context: __SerdeContext ): (PlatformCapability | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ResourceRequirement = (output: any, context: __SerdeContext): ResourceRequirement => { @@ -3094,7 +3408,14 @@ const deserializeAws_restJson1ResourceRequirement = (output: any, context: __Ser }; const deserializeAws_restJson1ResourceRequirements = (output: any, context: __SerdeContext): ResourceRequirement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceRequirement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceRequirement(entry, context); + }); }; const deserializeAws_restJson1RetryStrategy = (output: any, context: __SerdeContext): RetryStrategy => { @@ -3115,31 +3436,49 @@ const deserializeAws_restJson1Secret = (output: any, context: __SerdeContext): S }; const deserializeAws_restJson1SecretList = (output: any, context: __SerdeContext): Secret[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Secret(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Secret(entry, context); + }); }; const deserializeAws_restJson1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagrisTagsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Tmpfs = (output: any, context: __SerdeContext): Tmpfs => { @@ -3155,7 +3494,14 @@ const deserializeAws_restJson1Tmpfs = (output: any, context: __SerdeContext): Tm }; const deserializeAws_restJson1TmpfsList = (output: any, context: __SerdeContext): Tmpfs[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tmpfs(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tmpfs(entry, context); + }); }; const deserializeAws_restJson1Ulimit = (output: any, context: __SerdeContext): Ulimit => { @@ -3167,7 +3513,14 @@ const deserializeAws_restJson1Ulimit = (output: any, context: __SerdeContext): U }; const deserializeAws_restJson1Ulimits = (output: any, context: __SerdeContext): Ulimit[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Ulimit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Ulimit(entry, context); + }); }; const deserializeAws_restJson1Volume = (output: any, context: __SerdeContext): Volume => { @@ -3181,7 +3534,14 @@ const deserializeAws_restJson1Volume = (output: any, context: __SerdeContext): V }; const deserializeAws_restJson1Volumes = (output: any, context: __SerdeContext): Volume[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Volume(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Volume(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -3204,6 +3564,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-braket/protocols/Aws_restJson1.ts b/clients/client-braket/protocols/Aws_restJson1.ts index e265270e782d..f0044c82b6f0 100644 --- a/clients/client-braket/protocols/Aws_restJson1.ts +++ b/clients/client-braket/protocols/Aws_restJson1.ts @@ -37,7 +37,7 @@ export const serializeAws_restJson1CancelQuantumTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/quantum-task/{quantumTaskArn}/cancel"; if (input.quantumTaskArn !== undefined) { @@ -70,20 +70,21 @@ export const serializeAws_restJson1CreateQuantumTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/quantum-task"; let body: any; body = JSON.stringify({ - ...(input.action !== undefined && { action: __LazyJsonString.fromObject(input.action) }), + ...(input.action !== undefined && input.action !== null && { action: __LazyJsonString.fromObject(input.action) }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.deviceArn !== undefined && { deviceArn: input.deviceArn }), - ...(input.deviceParameters !== undefined && { - deviceParameters: __LazyJsonString.fromObject(input.deviceParameters), - }), - ...(input.outputS3Bucket !== undefined && { outputS3Bucket: input.outputS3Bucket }), - ...(input.outputS3KeyPrefix !== undefined && { outputS3KeyPrefix: input.outputS3KeyPrefix }), - ...(input.shots !== undefined && { shots: input.shots }), + ...(input.deviceArn !== undefined && input.deviceArn !== null && { deviceArn: input.deviceArn }), + ...(input.deviceParameters !== undefined && + input.deviceParameters !== null && { deviceParameters: __LazyJsonString.fromObject(input.deviceParameters) }), + ...(input.outputS3Bucket !== undefined && + input.outputS3Bucket !== null && { outputS3Bucket: input.outputS3Bucket }), + ...(input.outputS3KeyPrefix !== undefined && + input.outputS3KeyPrefix !== null && { outputS3KeyPrefix: input.outputS3KeyPrefix }), + ...(input.shots !== undefined && input.shots !== null && { shots: input.shots }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -101,9 +102,7 @@ export const serializeAws_restJson1GetDeviceCommand = async ( input: GetDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/device/{deviceArn}"; if (input.deviceArn !== undefined) { const labelValue: string = input.deviceArn; @@ -131,9 +130,7 @@ export const serializeAws_restJson1GetQuantumTaskCommand = async ( input: GetQuantumTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/quantum-task/{quantumTaskArn}"; if (input.quantumTaskArn !== undefined) { const labelValue: string = input.quantumTaskArn; @@ -162,16 +159,15 @@ export const serializeAws_restJson1SearchDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/devices"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { - filters: serializeAws_restJson1SearchDevicesFilterList(input.filters, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1SearchDevicesFilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -190,16 +186,17 @@ export const serializeAws_restJson1SearchQuantumTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/quantum-tasks"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { - filters: serializeAws_restJson1SearchQuantumTasksFilterList(input.filters, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { + filters: serializeAws_restJson1SearchQuantumTasksFilterList(input.filters, context), + }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -941,13 +938,21 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1SearchDevicesFilter = (input: SearchDevicesFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_restJson1String256List(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1String256List(input.values, context) }), }; }; const serializeAws_restJson1SearchDevicesFilterList = (input: SearchDevicesFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SearchDevicesFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SearchDevicesFilter(entry, context); + }); }; const serializeAws_restJson1SearchQuantumTasksFilter = ( @@ -955,9 +960,10 @@ const serializeAws_restJson1SearchQuantumTasksFilter = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.operator !== undefined && { operator: input.operator }), - ...(input.values !== undefined && { values: serializeAws_restJson1String256List(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.operator !== undefined && input.operator !== null && { operator: input.operator }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1String256List(input.values, context) }), }; }; @@ -965,11 +971,25 @@ const serializeAws_restJson1SearchQuantumTasksFilterList = ( input: SearchQuantumTasksFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SearchQuantumTasksFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SearchQuantumTasksFilter(entry, context); + }); }; const serializeAws_restJson1String256List = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DeviceSummary = (output: any, context: __SerdeContext): DeviceSummary => { @@ -983,7 +1003,14 @@ const deserializeAws_restJson1DeviceSummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1DeviceSummaryList = (output: any, context: __SerdeContext): DeviceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeviceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeviceSummary(entry, context); + }); }; const deserializeAws_restJson1QuantumTaskSummary = (output: any, context: __SerdeContext): QuantumTaskSummary => { @@ -1009,7 +1036,14 @@ const deserializeAws_restJson1QuantumTaskSummary = (output: any, context: __Serd }; const deserializeAws_restJson1QuantumTaskSummaryList = (output: any, context: __SerdeContext): QuantumTaskSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1QuantumTaskSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1QuantumTaskSummary(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1032,6 +1066,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-budgets/protocols/Aws_json1_1.ts b/clients/client-budgets/protocols/Aws_json1_1.ts index 06f403a67acb..4f83bbe2d73f 100644 --- a/clients/client-budgets/protocols/Aws_json1_1.ts +++ b/clients/client-budgets/protocols/Aws_json1_1.ts @@ -132,7 +132,7 @@ export const serializeAws_json1_1CreateBudgetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.CreateBudget", }; let body: any; @@ -145,7 +145,7 @@ export const serializeAws_json1_1CreateBudgetActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.CreateBudgetAction", }; let body: any; @@ -158,7 +158,7 @@ export const serializeAws_json1_1CreateNotificationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.CreateNotification", }; let body: any; @@ -171,7 +171,7 @@ export const serializeAws_json1_1CreateSubscriberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.CreateSubscriber", }; let body: any; @@ -184,7 +184,7 @@ export const serializeAws_json1_1DeleteBudgetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DeleteBudget", }; let body: any; @@ -197,7 +197,7 @@ export const serializeAws_json1_1DeleteBudgetActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DeleteBudgetAction", }; let body: any; @@ -210,7 +210,7 @@ export const serializeAws_json1_1DeleteNotificationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DeleteNotification", }; let body: any; @@ -223,7 +223,7 @@ export const serializeAws_json1_1DeleteSubscriberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DeleteSubscriber", }; let body: any; @@ -236,7 +236,7 @@ export const serializeAws_json1_1DescribeBudgetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DescribeBudget", }; let body: any; @@ -249,7 +249,7 @@ export const serializeAws_json1_1DescribeBudgetActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DescribeBudgetAction", }; let body: any; @@ -262,7 +262,7 @@ export const serializeAws_json1_1DescribeBudgetActionHistoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DescribeBudgetActionHistories", }; let body: any; @@ -275,7 +275,7 @@ export const serializeAws_json1_1DescribeBudgetActionsForAccountCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DescribeBudgetActionsForAccount", }; let body: any; @@ -288,7 +288,7 @@ export const serializeAws_json1_1DescribeBudgetActionsForBudgetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DescribeBudgetActionsForBudget", }; let body: any; @@ -301,7 +301,7 @@ export const serializeAws_json1_1DescribeBudgetPerformanceHistoryCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DescribeBudgetPerformanceHistory", }; let body: any; @@ -314,7 +314,7 @@ export const serializeAws_json1_1DescribeBudgetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DescribeBudgets", }; let body: any; @@ -327,7 +327,7 @@ export const serializeAws_json1_1DescribeNotificationsForBudgetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DescribeNotificationsForBudget", }; let body: any; @@ -340,7 +340,7 @@ export const serializeAws_json1_1DescribeSubscribersForNotificationCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.DescribeSubscribersForNotification", }; let body: any; @@ -353,7 +353,7 @@ export const serializeAws_json1_1ExecuteBudgetActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.ExecuteBudgetAction", }; let body: any; @@ -366,7 +366,7 @@ export const serializeAws_json1_1UpdateBudgetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.UpdateBudget", }; let body: any; @@ -379,7 +379,7 @@ export const serializeAws_json1_1UpdateBudgetActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.UpdateBudgetAction", }; let body: any; @@ -392,7 +392,7 @@ export const serializeAws_json1_1UpdateNotificationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.UpdateNotification", }; let body: any; @@ -405,7 +405,7 @@ export const serializeAws_json1_1UpdateSubscriberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSBudgetServiceGateway.UpdateSubscriber", }; let body: any; @@ -440,8 +440,7 @@ const deserializeAws_json1_1CreateBudgetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -527,8 +526,7 @@ const deserializeAws_json1_1CreateBudgetActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -622,8 +620,7 @@ const deserializeAws_json1_1CreateNotificationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -717,8 +714,7 @@ const deserializeAws_json1_1CreateSubscriberCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -812,8 +808,7 @@ const deserializeAws_json1_1DeleteBudgetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -891,8 +886,7 @@ const deserializeAws_json1_1DeleteBudgetActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -978,8 +972,7 @@ const deserializeAws_json1_1DeleteNotificationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1057,8 +1050,7 @@ const deserializeAws_json1_1DeleteSubscriberCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1136,8 +1128,7 @@ const deserializeAws_json1_1DescribeBudgetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1215,8 +1206,7 @@ const deserializeAws_json1_1DescribeBudgetActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1294,8 +1284,7 @@ const deserializeAws_json1_1DescribeBudgetActionHistoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1381,8 +1370,7 @@ const deserializeAws_json1_1DescribeBudgetActionsForAccountCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1460,8 +1448,7 @@ const deserializeAws_json1_1DescribeBudgetActionsForBudgetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1547,8 +1534,7 @@ const deserializeAws_json1_1DescribeBudgetPerformanceHistoryCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1642,8 +1628,7 @@ const deserializeAws_json1_1DescribeBudgetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1737,8 +1722,7 @@ const deserializeAws_json1_1DescribeNotificationsForBudgetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1832,8 +1816,7 @@ const deserializeAws_json1_1DescribeSubscribersForNotificationCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -1927,8 +1910,7 @@ const deserializeAws_json1_1ExecuteBudgetActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -2014,8 +1996,7 @@ const deserializeAws_json1_1UpdateBudgetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -2093,8 +2074,7 @@ const deserializeAws_json1_1UpdateBudgetActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -2180,8 +2160,7 @@ const deserializeAws_json1_1UpdateNotificationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -2267,8 +2246,7 @@ const deserializeAws_json1_1UpdateSubscriberCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": @@ -2464,64 +2442,79 @@ const deserializeAws_json1_1ResourceLockedExceptionResponse = async ( const serializeAws_json1_1ActionThreshold = (input: ActionThreshold, context: __SerdeContext): any => { return { - ...(input.ActionThresholdType !== undefined && { ActionThresholdType: input.ActionThresholdType }), - ...(input.ActionThresholdValue !== undefined && { ActionThresholdValue: input.ActionThresholdValue }), + ...(input.ActionThresholdType !== undefined && + input.ActionThresholdType !== null && { ActionThresholdType: input.ActionThresholdType }), + ...(input.ActionThresholdValue !== undefined && + input.ActionThresholdValue !== null && { ActionThresholdValue: input.ActionThresholdValue }), }; }; const serializeAws_json1_1Budget = (input: Budget, context: __SerdeContext): any => { return { - ...(input.BudgetLimit !== undefined && { BudgetLimit: serializeAws_json1_1Spend(input.BudgetLimit, context) }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.BudgetType !== undefined && { BudgetType: input.BudgetType }), - ...(input.CalculatedSpend !== undefined && { - CalculatedSpend: serializeAws_json1_1CalculatedSpend(input.CalculatedSpend, context), - }), - ...(input.CostFilters !== undefined && { - CostFilters: serializeAws_json1_1CostFilters(input.CostFilters, context), - }), - ...(input.CostTypes !== undefined && { CostTypes: serializeAws_json1_1CostTypes(input.CostTypes, context) }), - ...(input.LastUpdatedTime !== undefined && { LastUpdatedTime: Math.round(input.LastUpdatedTime.getTime() / 1000) }), - ...(input.PlannedBudgetLimits !== undefined && { - PlannedBudgetLimits: serializeAws_json1_1PlannedBudgetLimits(input.PlannedBudgetLimits, context), - }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1TimePeriod(input.TimePeriod, context) }), - ...(input.TimeUnit !== undefined && { TimeUnit: input.TimeUnit }), + ...(input.BudgetLimit !== undefined && + input.BudgetLimit !== null && { BudgetLimit: serializeAws_json1_1Spend(input.BudgetLimit, context) }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.BudgetType !== undefined && input.BudgetType !== null && { BudgetType: input.BudgetType }), + ...(input.CalculatedSpend !== undefined && + input.CalculatedSpend !== null && { + CalculatedSpend: serializeAws_json1_1CalculatedSpend(input.CalculatedSpend, context), + }), + ...(input.CostFilters !== undefined && + input.CostFilters !== null && { CostFilters: serializeAws_json1_1CostFilters(input.CostFilters, context) }), + ...(input.CostTypes !== undefined && + input.CostTypes !== null && { CostTypes: serializeAws_json1_1CostTypes(input.CostTypes, context) }), + ...(input.LastUpdatedTime !== undefined && + input.LastUpdatedTime !== null && { LastUpdatedTime: Math.round(input.LastUpdatedTime.getTime() / 1000) }), + ...(input.PlannedBudgetLimits !== undefined && + input.PlannedBudgetLimits !== null && { + PlannedBudgetLimits: serializeAws_json1_1PlannedBudgetLimits(input.PlannedBudgetLimits, context), + }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1TimePeriod(input.TimePeriod, context) }), + ...(input.TimeUnit !== undefined && input.TimeUnit !== null && { TimeUnit: input.TimeUnit }), }; }; const serializeAws_json1_1CalculatedSpend = (input: CalculatedSpend, context: __SerdeContext): any => { return { - ...(input.ActualSpend !== undefined && { ActualSpend: serializeAws_json1_1Spend(input.ActualSpend, context) }), - ...(input.ForecastedSpend !== undefined && { - ForecastedSpend: serializeAws_json1_1Spend(input.ForecastedSpend, context), - }), + ...(input.ActualSpend !== undefined && + input.ActualSpend !== null && { ActualSpend: serializeAws_json1_1Spend(input.ActualSpend, context) }), + ...(input.ForecastedSpend !== undefined && + input.ForecastedSpend !== null && { ForecastedSpend: serializeAws_json1_1Spend(input.ForecastedSpend, context) }), }; }; const serializeAws_json1_1CostFilters = (input: { [key: string]: string[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1DimensionValues(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1CostTypes = (input: CostTypes, context: __SerdeContext): any => { return { - ...(input.IncludeCredit !== undefined && { IncludeCredit: input.IncludeCredit }), - ...(input.IncludeDiscount !== undefined && { IncludeDiscount: input.IncludeDiscount }), - ...(input.IncludeOtherSubscription !== undefined && { IncludeOtherSubscription: input.IncludeOtherSubscription }), - ...(input.IncludeRecurring !== undefined && { IncludeRecurring: input.IncludeRecurring }), - ...(input.IncludeRefund !== undefined && { IncludeRefund: input.IncludeRefund }), - ...(input.IncludeSubscription !== undefined && { IncludeSubscription: input.IncludeSubscription }), - ...(input.IncludeSupport !== undefined && { IncludeSupport: input.IncludeSupport }), - ...(input.IncludeTax !== undefined && { IncludeTax: input.IncludeTax }), - ...(input.IncludeUpfront !== undefined && { IncludeUpfront: input.IncludeUpfront }), - ...(input.UseAmortized !== undefined && { UseAmortized: input.UseAmortized }), - ...(input.UseBlended !== undefined && { UseBlended: input.UseBlended }), + ...(input.IncludeCredit !== undefined && input.IncludeCredit !== null && { IncludeCredit: input.IncludeCredit }), + ...(input.IncludeDiscount !== undefined && + input.IncludeDiscount !== null && { IncludeDiscount: input.IncludeDiscount }), + ...(input.IncludeOtherSubscription !== undefined && + input.IncludeOtherSubscription !== null && { IncludeOtherSubscription: input.IncludeOtherSubscription }), + ...(input.IncludeRecurring !== undefined && + input.IncludeRecurring !== null && { IncludeRecurring: input.IncludeRecurring }), + ...(input.IncludeRefund !== undefined && input.IncludeRefund !== null && { IncludeRefund: input.IncludeRefund }), + ...(input.IncludeSubscription !== undefined && + input.IncludeSubscription !== null && { IncludeSubscription: input.IncludeSubscription }), + ...(input.IncludeSupport !== undefined && + input.IncludeSupport !== null && { IncludeSupport: input.IncludeSupport }), + ...(input.IncludeTax !== undefined && input.IncludeTax !== null && { IncludeTax: input.IncludeTax }), + ...(input.IncludeUpfront !== undefined && + input.IncludeUpfront !== null && { IncludeUpfront: input.IncludeUpfront }), + ...(input.UseAmortized !== undefined && input.UseAmortized !== null && { UseAmortized: input.UseAmortized }), + ...(input.UseBlended !== undefined && input.UseBlended !== null && { UseBlended: input.UseBlended }), }; }; @@ -2530,32 +2523,37 @@ const serializeAws_json1_1CreateBudgetActionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.ActionThreshold !== undefined && { - ActionThreshold: serializeAws_json1_1ActionThreshold(input.ActionThreshold, context), - }), - ...(input.ActionType !== undefined && { ActionType: input.ActionType }), - ...(input.ApprovalModel !== undefined && { ApprovalModel: input.ApprovalModel }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.Definition !== undefined && { Definition: serializeAws_json1_1Definition(input.Definition, context) }), - ...(input.ExecutionRoleArn !== undefined && { ExecutionRoleArn: input.ExecutionRoleArn }), - ...(input.NotificationType !== undefined && { NotificationType: input.NotificationType }), - ...(input.Subscribers !== undefined && { - Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context), - }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.ActionThreshold !== undefined && + input.ActionThreshold !== null && { + ActionThreshold: serializeAws_json1_1ActionThreshold(input.ActionThreshold, context), + }), + ...(input.ActionType !== undefined && input.ActionType !== null && { ActionType: input.ActionType }), + ...(input.ApprovalModel !== undefined && input.ApprovalModel !== null && { ApprovalModel: input.ApprovalModel }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.Definition !== undefined && + input.Definition !== null && { Definition: serializeAws_json1_1Definition(input.Definition, context) }), + ...(input.ExecutionRoleArn !== undefined && + input.ExecutionRoleArn !== null && { ExecutionRoleArn: input.ExecutionRoleArn }), + ...(input.NotificationType !== undefined && + input.NotificationType !== null && { NotificationType: input.NotificationType }), + ...(input.Subscribers !== undefined && + input.Subscribers !== null && { Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context) }), }; }; const serializeAws_json1_1CreateBudgetRequest = (input: CreateBudgetRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.Budget !== undefined && { Budget: serializeAws_json1_1Budget(input.Budget, context) }), - ...(input.NotificationsWithSubscribers !== undefined && { - NotificationsWithSubscribers: serializeAws_json1_1NotificationWithSubscribersList( - input.NotificationsWithSubscribers, - context - ), - }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.Budget !== undefined && + input.Budget !== null && { Budget: serializeAws_json1_1Budget(input.Budget, context) }), + ...(input.NotificationsWithSubscribers !== undefined && + input.NotificationsWithSubscribers !== null && { + NotificationsWithSubscribers: serializeAws_json1_1NotificationWithSubscribersList( + input.NotificationsWithSubscribers, + context + ), + }), }; }; @@ -2564,39 +2562,40 @@ const serializeAws_json1_1CreateNotificationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), - ...(input.Subscribers !== undefined && { - Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context), - }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), + ...(input.Subscribers !== undefined && + input.Subscribers !== null && { Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context) }), }; }; const serializeAws_json1_1CreateSubscriberRequest = (input: CreateSubscriberRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), - ...(input.Subscriber !== undefined && { Subscriber: serializeAws_json1_1Subscriber(input.Subscriber, context) }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), + ...(input.Subscriber !== undefined && + input.Subscriber !== null && { Subscriber: serializeAws_json1_1Subscriber(input.Subscriber, context) }), }; }; const serializeAws_json1_1Definition = (input: Definition, context: __SerdeContext): any => { return { - ...(input.IamActionDefinition !== undefined && { - IamActionDefinition: serializeAws_json1_1IamActionDefinition(input.IamActionDefinition, context), - }), - ...(input.ScpActionDefinition !== undefined && { - ScpActionDefinition: serializeAws_json1_1ScpActionDefinition(input.ScpActionDefinition, context), - }), - ...(input.SsmActionDefinition !== undefined && { - SsmActionDefinition: serializeAws_json1_1SsmActionDefinition(input.SsmActionDefinition, context), - }), + ...(input.IamActionDefinition !== undefined && + input.IamActionDefinition !== null && { + IamActionDefinition: serializeAws_json1_1IamActionDefinition(input.IamActionDefinition, context), + }), + ...(input.ScpActionDefinition !== undefined && + input.ScpActionDefinition !== null && { + ScpActionDefinition: serializeAws_json1_1ScpActionDefinition(input.ScpActionDefinition, context), + }), + ...(input.SsmActionDefinition !== undefined && + input.SsmActionDefinition !== null && { + SsmActionDefinition: serializeAws_json1_1SsmActionDefinition(input.SsmActionDefinition, context), + }), }; }; @@ -2605,16 +2604,16 @@ const serializeAws_json1_1DeleteBudgetActionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.ActionId !== undefined && { ActionId: input.ActionId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.ActionId !== undefined && input.ActionId !== null && { ActionId: input.ActionId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), }; }; const serializeAws_json1_1DeleteBudgetRequest = (input: DeleteBudgetRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), }; }; @@ -2623,22 +2622,21 @@ const serializeAws_json1_1DeleteNotificationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), }; }; const serializeAws_json1_1DeleteSubscriberRequest = (input: DeleteSubscriberRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), - ...(input.Subscriber !== undefined && { Subscriber: serializeAws_json1_1Subscriber(input.Subscriber, context) }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), + ...(input.Subscriber !== undefined && + input.Subscriber !== null && { Subscriber: serializeAws_json1_1Subscriber(input.Subscriber, context) }), }; }; @@ -2647,12 +2645,13 @@ const serializeAws_json1_1DescribeBudgetActionHistoriesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.ActionId !== undefined && { ActionId: input.ActionId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1TimePeriod(input.TimePeriod, context) }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.ActionId !== undefined && input.ActionId !== null && { ActionId: input.ActionId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1TimePeriod(input.TimePeriod, context) }), }; }; @@ -2661,9 +2660,9 @@ const serializeAws_json1_1DescribeBudgetActionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.ActionId !== undefined && { ActionId: input.ActionId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.ActionId !== undefined && input.ActionId !== null && { ActionId: input.ActionId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), }; }; @@ -2672,9 +2671,9 @@ const serializeAws_json1_1DescribeBudgetActionsForAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2683,10 +2682,10 @@ const serializeAws_json1_1DescribeBudgetActionsForBudgetRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2695,26 +2694,27 @@ const serializeAws_json1_1DescribeBudgetPerformanceHistoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1TimePeriod(input.TimePeriod, context) }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1TimePeriod(input.TimePeriod, context) }), }; }; const serializeAws_json1_1DescribeBudgetRequest = (input: DescribeBudgetRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), }; }; const serializeAws_json1_1DescribeBudgetsRequest = (input: DescribeBudgetsRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2723,10 +2723,10 @@ const serializeAws_json1_1DescribeNotificationsForBudgetRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2735,18 +2735,24 @@ const serializeAws_json1_1DescribeSubscribersForNotificationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), }; }; const serializeAws_json1_1DimensionValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ExecuteBudgetActionRequest = ( @@ -2754,37 +2760,57 @@ const serializeAws_json1_1ExecuteBudgetActionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.ActionId !== undefined && { ActionId: input.ActionId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.ExecutionType !== undefined && { ExecutionType: input.ExecutionType }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.ActionId !== undefined && input.ActionId !== null && { ActionId: input.ActionId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.ExecutionType !== undefined && input.ExecutionType !== null && { ExecutionType: input.ExecutionType }), }; }; const serializeAws_json1_1Groups = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IamActionDefinition = (input: IamActionDefinition, context: __SerdeContext): any => { return { - ...(input.Groups !== undefined && { Groups: serializeAws_json1_1Groups(input.Groups, context) }), - ...(input.PolicyArn !== undefined && { PolicyArn: input.PolicyArn }), - ...(input.Roles !== undefined && { Roles: serializeAws_json1_1Roles(input.Roles, context) }), - ...(input.Users !== undefined && { Users: serializeAws_json1_1Users(input.Users, context) }), + ...(input.Groups !== undefined && + input.Groups !== null && { Groups: serializeAws_json1_1Groups(input.Groups, context) }), + ...(input.PolicyArn !== undefined && input.PolicyArn !== null && { PolicyArn: input.PolicyArn }), + ...(input.Roles !== undefined && + input.Roles !== null && { Roles: serializeAws_json1_1Roles(input.Roles, context) }), + ...(input.Users !== undefined && + input.Users !== null && { Users: serializeAws_json1_1Users(input.Users, context) }), }; }; const serializeAws_json1_1InstanceIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Notification = (input: Notification, context: __SerdeContext): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.NotificationState !== undefined && { NotificationState: input.NotificationState }), - ...(input.NotificationType !== undefined && { NotificationType: input.NotificationType }), - ...(input.Threshold !== undefined && { Threshold: input.Threshold }), - ...(input.ThresholdType !== undefined && { ThresholdType: input.ThresholdType }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.NotificationState !== undefined && + input.NotificationState !== null && { NotificationState: input.NotificationState }), + ...(input.NotificationType !== undefined && + input.NotificationType !== null && { NotificationType: input.NotificationType }), + ...(input.Threshold !== undefined && input.Threshold !== null && { Threshold: input.Threshold }), + ...(input.ThresholdType !== undefined && input.ThresholdType !== null && { ThresholdType: input.ThresholdType }), }; }; @@ -2793,12 +2819,10 @@ const serializeAws_json1_1NotificationWithSubscribers = ( context: __SerdeContext ): any => { return { - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), - ...(input.Subscribers !== undefined && { - Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context), - }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), + ...(input.Subscribers !== undefined && + input.Subscribers !== null && { Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context) }), }; }; @@ -2806,66 +2830,97 @@ const serializeAws_json1_1NotificationWithSubscribersList = ( input: NotificationWithSubscribers[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1NotificationWithSubscribers(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1NotificationWithSubscribers(entry, context); + }); }; const serializeAws_json1_1PlannedBudgetLimits = (input: { [key: string]: Spend }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Spend }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Spend }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1Spend(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1Roles = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ScpActionDefinition = (input: ScpActionDefinition, context: __SerdeContext): any => { return { - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), - ...(input.TargetIds !== undefined && { TargetIds: serializeAws_json1_1TargetIds(input.TargetIds, context) }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), + ...(input.TargetIds !== undefined && + input.TargetIds !== null && { TargetIds: serializeAws_json1_1TargetIds(input.TargetIds, context) }), }; }; const serializeAws_json1_1Spend = (input: Spend, context: __SerdeContext): any => { return { - ...(input.Amount !== undefined && { Amount: input.Amount }), - ...(input.Unit !== undefined && { Unit: input.Unit }), + ...(input.Amount !== undefined && input.Amount !== null && { Amount: input.Amount }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), }; }; const serializeAws_json1_1SsmActionDefinition = (input: SsmActionDefinition, context: __SerdeContext): any => { return { - ...(input.ActionSubType !== undefined && { ActionSubType: input.ActionSubType }), - ...(input.InstanceIds !== undefined && { - InstanceIds: serializeAws_json1_1InstanceIds(input.InstanceIds, context), - }), - ...(input.Region !== undefined && { Region: input.Region }), + ...(input.ActionSubType !== undefined && input.ActionSubType !== null && { ActionSubType: input.ActionSubType }), + ...(input.InstanceIds !== undefined && + input.InstanceIds !== null && { InstanceIds: serializeAws_json1_1InstanceIds(input.InstanceIds, context) }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), }; }; const serializeAws_json1_1Subscriber = (input: Subscriber, context: __SerdeContext): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), - ...(input.SubscriptionType !== undefined && { SubscriptionType: input.SubscriptionType }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), + ...(input.SubscriptionType !== undefined && + input.SubscriptionType !== null && { SubscriptionType: input.SubscriptionType }), }; }; const serializeAws_json1_1Subscribers = (input: Subscriber[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Subscriber(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Subscriber(entry, context); + }); }; const serializeAws_json1_1TargetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TimePeriod = (input: TimePeriod, context: __SerdeContext): any => { return { - ...(input.End !== undefined && { End: Math.round(input.End.getTime() / 1000) }), - ...(input.Start !== undefined && { Start: Math.round(input.Start.getTime() / 1000) }), + ...(input.End !== undefined && input.End !== null && { End: Math.round(input.End.getTime() / 1000) }), + ...(input.Start !== undefined && input.Start !== null && { Start: Math.round(input.Start.getTime() / 1000) }), }; }; @@ -2874,26 +2929,30 @@ const serializeAws_json1_1UpdateBudgetActionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.ActionId !== undefined && { ActionId: input.ActionId }), - ...(input.ActionThreshold !== undefined && { - ActionThreshold: serializeAws_json1_1ActionThreshold(input.ActionThreshold, context), - }), - ...(input.ApprovalModel !== undefined && { ApprovalModel: input.ApprovalModel }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.Definition !== undefined && { Definition: serializeAws_json1_1Definition(input.Definition, context) }), - ...(input.ExecutionRoleArn !== undefined && { ExecutionRoleArn: input.ExecutionRoleArn }), - ...(input.NotificationType !== undefined && { NotificationType: input.NotificationType }), - ...(input.Subscribers !== undefined && { - Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context), - }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.ActionId !== undefined && input.ActionId !== null && { ActionId: input.ActionId }), + ...(input.ActionThreshold !== undefined && + input.ActionThreshold !== null && { + ActionThreshold: serializeAws_json1_1ActionThreshold(input.ActionThreshold, context), + }), + ...(input.ApprovalModel !== undefined && input.ApprovalModel !== null && { ApprovalModel: input.ApprovalModel }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.Definition !== undefined && + input.Definition !== null && { Definition: serializeAws_json1_1Definition(input.Definition, context) }), + ...(input.ExecutionRoleArn !== undefined && + input.ExecutionRoleArn !== null && { ExecutionRoleArn: input.ExecutionRoleArn }), + ...(input.NotificationType !== undefined && + input.NotificationType !== null && { NotificationType: input.NotificationType }), + ...(input.Subscribers !== undefined && + input.Subscribers !== null && { Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context) }), }; }; const serializeAws_json1_1UpdateBudgetRequest = (input: UpdateBudgetRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.NewBudget !== undefined && { NewBudget: serializeAws_json1_1Budget(input.NewBudget, context) }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.NewBudget !== undefined && + input.NewBudget !== null && { NewBudget: serializeAws_json1_1Budget(input.NewBudget, context) }), }; }; @@ -2902,35 +2961,41 @@ const serializeAws_json1_1UpdateNotificationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.NewNotification !== undefined && { - NewNotification: serializeAws_json1_1Notification(input.NewNotification, context), - }), - ...(input.OldNotification !== undefined && { - OldNotification: serializeAws_json1_1Notification(input.OldNotification, context), - }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.NewNotification !== undefined && + input.NewNotification !== null && { + NewNotification: serializeAws_json1_1Notification(input.NewNotification, context), + }), + ...(input.OldNotification !== undefined && + input.OldNotification !== null && { + OldNotification: serializeAws_json1_1Notification(input.OldNotification, context), + }), }; }; const serializeAws_json1_1UpdateSubscriberRequest = (input: UpdateSubscriberRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.NewSubscriber !== undefined && { - NewSubscriber: serializeAws_json1_1Subscriber(input.NewSubscriber, context), - }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), - ...(input.OldSubscriber !== undefined && { - OldSubscriber: serializeAws_json1_1Subscriber(input.OldSubscriber, context), - }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.NewSubscriber !== undefined && + input.NewSubscriber !== null && { NewSubscriber: serializeAws_json1_1Subscriber(input.NewSubscriber, context) }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), + ...(input.OldSubscriber !== undefined && + input.OldSubscriber !== null && { OldSubscriber: serializeAws_json1_1Subscriber(input.OldSubscriber, context) }), }; }; const serializeAws_json1_1Users = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => { @@ -2967,7 +3032,14 @@ const deserializeAws_json1_1Action = (output: any, context: __SerdeContext): Act }; const deserializeAws_json1_1ActionHistories = (output: any, context: __SerdeContext): ActionHistory[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ActionHistory(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ActionHistory(entry, context); + }); }; const deserializeAws_json1_1ActionHistory = (output: any, context: __SerdeContext): ActionHistory => { @@ -2996,7 +3068,14 @@ const deserializeAws_json1_1ActionHistoryDetails = (output: any, context: __Serd }; const deserializeAws_json1_1Actions = (output: any, context: __SerdeContext): Action[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Action(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Action(entry, context); + }); }; const deserializeAws_json1_1ActionThreshold = (output: any, context: __SerdeContext): ActionThreshold => { @@ -3072,7 +3151,14 @@ const deserializeAws_json1_1BudgetedAndActualAmountsList = ( output: any, context: __SerdeContext ): BudgetedAndActualAmounts[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BudgetedAndActualAmounts(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BudgetedAndActualAmounts(entry, context); + }); }; const deserializeAws_json1_1BudgetPerformanceHistory = ( @@ -3099,7 +3185,14 @@ const deserializeAws_json1_1BudgetPerformanceHistory = ( }; const deserializeAws_json1_1Budgets = (output: any, context: __SerdeContext): Budget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Budget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Budget(entry, context); + }); }; const deserializeAws_json1_1CalculatedSpend = (output: any, context: __SerdeContext): CalculatedSpend => { @@ -3116,13 +3209,15 @@ const deserializeAws_json1_1CalculatedSpend = (output: any, context: __SerdeCont }; const deserializeAws_json1_1CostFilters = (output: any, context: __SerdeContext): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1DimensionValues(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1CostTypes = (output: any, context: __SerdeContext): CostTypes => { @@ -3355,7 +3450,14 @@ const deserializeAws_json1_1DescribeSubscribersForNotificationResponse = ( }; const deserializeAws_json1_1DimensionValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DuplicateRecordException = ( @@ -3390,7 +3492,14 @@ const deserializeAws_json1_1ExpiredNextTokenException = ( }; const deserializeAws_json1_1Groups = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1IamActionDefinition = (output: any, context: __SerdeContext): IamActionDefinition => { @@ -3412,7 +3521,14 @@ const deserializeAws_json1_1IamActionDefinition = (output: any, context: __Serde }; const deserializeAws_json1_1InstanceIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InternalErrorException = (output: any, context: __SerdeContext): InternalErrorException => { @@ -3464,17 +3580,26 @@ const deserializeAws_json1_1Notification = (output: any, context: __SerdeContext }; const deserializeAws_json1_1Notifications = (output: any, context: __SerdeContext): Notification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Notification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Notification(entry, context); + }); }; const deserializeAws_json1_1PlannedBudgetLimits = (output: any, context: __SerdeContext): { [key: string]: Spend } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Spend }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Spend }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1Spend(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ResourceLockedException = ( @@ -3487,7 +3612,14 @@ const deserializeAws_json1_1ResourceLockedException = ( }; const deserializeAws_json1_1Roles = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ScpActionDefinition = (output: any, context: __SerdeContext): ScpActionDefinition => { @@ -3528,11 +3660,25 @@ const deserializeAws_json1_1Subscriber = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Subscribers = (output: any, context: __SerdeContext): Subscriber[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Subscriber(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Subscriber(entry, context); + }); }; const deserializeAws_json1_1TargetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TimePeriod = (output: any, context: __SerdeContext): TimePeriod => { @@ -3579,7 +3725,14 @@ const deserializeAws_json1_1UpdateSubscriberResponse = ( }; const deserializeAws_json1_1Users = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -3632,3 +3785,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-chime/protocols/Aws_restJson1.ts b/clients/client-chime/protocols/Aws_restJson1.ts index b2365e207ae3..a3684f5b6b12 100644 --- a/clients/client-chime/protocols/Aws_restJson1.ts +++ b/clients/client-chime/protocols/Aws_restJson1.ts @@ -612,7 +612,7 @@ export const serializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}"; if (input.VoiceConnectorId !== undefined) { @@ -629,10 +629,12 @@ export const serializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorComman }; let body: any; body = JSON.stringify({ - ...(input.E164PhoneNumbers !== undefined && { - E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), - }), - ...(input.ForceAssociate !== undefined && { ForceAssociate: input.ForceAssociate }), + ...(input.E164PhoneNumbers !== undefined && + input.E164PhoneNumbers !== null && { + E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), + }), + ...(input.ForceAssociate !== undefined && + input.ForceAssociate !== null && { ForceAssociate: input.ForceAssociate }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -652,7 +654,7 @@ export const serializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorGroupC context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connector-groups/{VoiceConnectorGroupId}"; if (input.VoiceConnectorGroupId !== undefined) { @@ -669,10 +671,12 @@ export const serializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorGroupC }; let body: any; body = JSON.stringify({ - ...(input.E164PhoneNumbers !== undefined && { - E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), - }), - ...(input.ForceAssociate !== undefined && { ForceAssociate: input.ForceAssociate }), + ...(input.E164PhoneNumbers !== undefined && + input.E164PhoneNumbers !== null && { + E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), + }), + ...(input.ForceAssociate !== undefined && + input.ForceAssociate !== null && { ForceAssociate: input.ForceAssociate }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -692,7 +696,7 @@ export const serializeAws_restJson1AssociatePhoneNumberWithUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/users/{UserId}"; if (input.AccountId !== undefined) { @@ -718,7 +722,8 @@ export const serializeAws_restJson1AssociatePhoneNumberWithUserCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.E164PhoneNumber !== undefined && { E164PhoneNumber: input.E164PhoneNumber }), + ...(input.E164PhoneNumber !== undefined && + input.E164PhoneNumber !== null && { E164PhoneNumber: input.E164PhoneNumber }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -738,7 +743,7 @@ export const serializeAws_restJson1AssociateSigninDelegateGroupsWithAccountComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}"; if (input.AccountId !== undefined) { @@ -755,9 +760,10 @@ export const serializeAws_restJson1AssociateSigninDelegateGroupsWithAccountComma }; let body: any; body = JSON.stringify({ - ...(input.SigninDelegateGroups !== undefined && { - SigninDelegateGroups: serializeAws_restJson1SigninDelegateGroupList(input.SigninDelegateGroups, context), - }), + ...(input.SigninDelegateGroups !== undefined && + input.SigninDelegateGroups !== null && { + SigninDelegateGroups: serializeAws_restJson1SigninDelegateGroupList(input.SigninDelegateGroups, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -777,7 +783,7 @@ export const serializeAws_restJson1BatchCreateAttendeeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/meetings/{MeetingId}/attendees"; if (input.MeetingId !== undefined) { @@ -794,9 +800,10 @@ export const serializeAws_restJson1BatchCreateAttendeeCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Attendees !== undefined && { - Attendees: serializeAws_restJson1CreateAttendeeRequestItemList(input.Attendees, context), - }), + ...(input.Attendees !== undefined && + input.Attendees !== null && { + Attendees: serializeAws_restJson1CreateAttendeeRequestItemList(input.Attendees, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -816,7 +823,7 @@ export const serializeAws_restJson1BatchCreateRoomMembershipCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/rooms/{RoomId}/memberships"; if (input.AccountId !== undefined) { @@ -842,9 +849,10 @@ export const serializeAws_restJson1BatchCreateRoomMembershipCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.MembershipItemList !== undefined && { - MembershipItemList: serializeAws_restJson1MembershipItemList(input.MembershipItemList, context), - }), + ...(input.MembershipItemList !== undefined && + input.MembershipItemList !== null && { + MembershipItemList: serializeAws_restJson1MembershipItemList(input.MembershipItemList, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -864,7 +872,7 @@ export const serializeAws_restJson1BatchDeletePhoneNumberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/phone-numbers"; const query: any = { @@ -872,9 +880,10 @@ export const serializeAws_restJson1BatchDeletePhoneNumberCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.PhoneNumberIds !== undefined && { - PhoneNumberIds: serializeAws_restJson1NonEmptyStringList(input.PhoneNumberIds, context), - }), + ...(input.PhoneNumberIds !== undefined && + input.PhoneNumberIds !== null && { + PhoneNumberIds: serializeAws_restJson1NonEmptyStringList(input.PhoneNumberIds, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -894,7 +903,7 @@ export const serializeAws_restJson1BatchSuspendUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/users"; if (input.AccountId !== undefined) { @@ -911,7 +920,8 @@ export const serializeAws_restJson1BatchSuspendUserCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.UserIdList !== undefined && { UserIdList: serializeAws_restJson1UserIdList(input.UserIdList, context) }), + ...(input.UserIdList !== undefined && + input.UserIdList !== null && { UserIdList: serializeAws_restJson1UserIdList(input.UserIdList, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -931,7 +941,7 @@ export const serializeAws_restJson1BatchUnsuspendUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/users"; if (input.AccountId !== undefined) { @@ -948,7 +958,8 @@ export const serializeAws_restJson1BatchUnsuspendUserCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.UserIdList !== undefined && { UserIdList: serializeAws_restJson1UserIdList(input.UserIdList, context) }), + ...(input.UserIdList !== undefined && + input.UserIdList !== null && { UserIdList: serializeAws_restJson1UserIdList(input.UserIdList, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -968,7 +979,7 @@ export const serializeAws_restJson1BatchUpdatePhoneNumberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/phone-numbers"; const query: any = { @@ -976,12 +987,13 @@ export const serializeAws_restJson1BatchUpdatePhoneNumberCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.UpdatePhoneNumberRequestItems !== undefined && { - UpdatePhoneNumberRequestItems: serializeAws_restJson1UpdatePhoneNumberRequestItemList( - input.UpdatePhoneNumberRequestItems, - context - ), - }), + ...(input.UpdatePhoneNumberRequestItems !== undefined && + input.UpdatePhoneNumberRequestItems !== null && { + UpdatePhoneNumberRequestItems: serializeAws_restJson1UpdatePhoneNumberRequestItemList( + input.UpdatePhoneNumberRequestItems, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1001,7 +1013,7 @@ export const serializeAws_restJson1BatchUpdateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/users"; if (input.AccountId !== undefined) { @@ -1015,9 +1027,10 @@ export const serializeAws_restJson1BatchUpdateUserCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.UpdateUserRequestItems !== undefined && { - UpdateUserRequestItems: serializeAws_restJson1UpdateUserRequestItemList(input.UpdateUserRequestItems, context), - }), + ...(input.UpdateUserRequestItems !== undefined && + input.UpdateUserRequestItems !== null && { + UpdateUserRequestItems: serializeAws_restJson1UpdateUserRequestItemList(input.UpdateUserRequestItems, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1036,12 +1049,12 @@ export const serializeAws_restJson1CreateAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1060,14 +1073,14 @@ export const serializeAws_restJson1CreateAppInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/app-instances"; let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Metadata !== undefined && { Metadata: input.Metadata }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Metadata !== undefined && input.Metadata !== null && { Metadata: input.Metadata }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -1093,7 +1106,7 @@ export const serializeAws_restJson1CreateAppInstanceAdminCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/app-instances/{AppInstanceArn}/admins"; if (input.AppInstanceArn !== undefined) { @@ -1107,7 +1120,8 @@ export const serializeAws_restJson1CreateAppInstanceAdminCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AppInstanceAdminArn !== undefined && { AppInstanceAdminArn: input.AppInstanceAdminArn }), + ...(input.AppInstanceAdminArn !== undefined && + input.AppInstanceAdminArn !== null && { AppInstanceAdminArn: input.AppInstanceAdminArn }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -1133,16 +1147,18 @@ export const serializeAws_restJson1CreateAppInstanceUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/app-instance-users"; let body: any; body = JSON.stringify({ - ...(input.AppInstanceArn !== undefined && { AppInstanceArn: input.AppInstanceArn }), - ...(input.AppInstanceUserId !== undefined && { AppInstanceUserId: input.AppInstanceUserId }), + ...(input.AppInstanceArn !== undefined && + input.AppInstanceArn !== null && { AppInstanceArn: input.AppInstanceArn }), + ...(input.AppInstanceUserId !== undefined && + input.AppInstanceUserId !== null && { AppInstanceUserId: input.AppInstanceUserId }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Metadata !== undefined && { Metadata: input.Metadata }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Metadata !== undefined && input.Metadata !== null && { Metadata: input.Metadata }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -1168,7 +1184,7 @@ export const serializeAws_restJson1CreateAttendeeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/meetings/{MeetingId}/attendees"; if (input.MeetingId !== undefined) { @@ -1182,8 +1198,10 @@ export const serializeAws_restJson1CreateAttendeeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ExternalUserId !== undefined && { ExternalUserId: input.ExternalUserId }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1AttendeeTagList(input.Tags, context) }), + ...(input.ExternalUserId !== undefined && + input.ExternalUserId !== null && { ExternalUserId: input.ExternalUserId }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1AttendeeTagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1202,7 +1220,7 @@ export const serializeAws_restJson1CreateBotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/bots"; if (input.AccountId !== undefined) { @@ -1216,8 +1234,8 @@ export const serializeAws_restJson1CreateBotCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.Domain !== undefined && { Domain: input.Domain }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1236,18 +1254,20 @@ export const serializeAws_restJson1CreateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels"; let body: any; body = JSON.stringify({ - ...(input.AppInstanceArn !== undefined && { AppInstanceArn: input.AppInstanceArn }), + ...(input.AppInstanceArn !== undefined && + input.AppInstanceArn !== null && { AppInstanceArn: input.AppInstanceArn }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Metadata !== undefined && { Metadata: input.Metadata }), - ...(input.Mode !== undefined && { Mode: input.Mode }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Privacy !== undefined && { Privacy: input.Privacy }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Metadata !== undefined && input.Metadata !== null && { Metadata: input.Metadata }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Privacy !== undefined && input.Privacy !== null && { Privacy: input.Privacy }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -1273,7 +1293,7 @@ export const serializeAws_restJson1CreateChannelBanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels/{ChannelArn}/bans"; if (input.ChannelArn !== undefined) { @@ -1287,7 +1307,7 @@ export const serializeAws_restJson1CreateChannelBanCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MemberArn !== undefined && { MemberArn: input.MemberArn }), + ...(input.MemberArn !== undefined && input.MemberArn !== null && { MemberArn: input.MemberArn }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -1313,7 +1333,7 @@ export const serializeAws_restJson1CreateChannelMembershipCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels/{ChannelArn}/memberships"; if (input.ChannelArn !== undefined) { @@ -1327,8 +1347,8 @@ export const serializeAws_restJson1CreateChannelMembershipCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MemberArn !== undefined && { MemberArn: input.MemberArn }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.MemberArn !== undefined && input.MemberArn !== null && { MemberArn: input.MemberArn }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -1354,7 +1374,7 @@ export const serializeAws_restJson1CreateChannelModeratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels/{ChannelArn}/moderators"; if (input.ChannelArn !== undefined) { @@ -1368,7 +1388,8 @@ export const serializeAws_restJson1CreateChannelModeratorCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ChannelModeratorArn !== undefined && { ChannelModeratorArn: input.ChannelModeratorArn }), + ...(input.ChannelModeratorArn !== undefined && + input.ChannelModeratorArn !== null && { ChannelModeratorArn: input.ChannelModeratorArn }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -1394,22 +1415,25 @@ export const serializeAws_restJson1CreateMeetingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/meetings"; let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.ExternalMeetingId !== undefined && { ExternalMeetingId: input.ExternalMeetingId }), - ...(input.MediaRegion !== undefined && { MediaRegion: input.MediaRegion }), - ...(input.MeetingHostId !== undefined && { MeetingHostId: input.MeetingHostId }), - ...(input.NotificationsConfiguration !== undefined && { - NotificationsConfiguration: serializeAws_restJson1MeetingNotificationConfiguration( - input.NotificationsConfiguration, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1MeetingTagList(input.Tags, context) }), + ...(input.ExternalMeetingId !== undefined && + input.ExternalMeetingId !== null && { ExternalMeetingId: input.ExternalMeetingId }), + ...(input.MediaRegion !== undefined && input.MediaRegion !== null && { MediaRegion: input.MediaRegion }), + ...(input.MeetingHostId !== undefined && input.MeetingHostId !== null && { MeetingHostId: input.MeetingHostId }), + ...(input.NotificationsConfiguration !== undefined && + input.NotificationsConfiguration !== null && { + NotificationsConfiguration: serializeAws_restJson1MeetingNotificationConfiguration( + input.NotificationsConfiguration, + context + ), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1MeetingTagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1428,7 +1452,7 @@ export const serializeAws_restJson1CreateMeetingDialOutCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/meetings/{MeetingId}/dial-outs"; if (input.MeetingId !== undefined) { @@ -1442,9 +1466,10 @@ export const serializeAws_restJson1CreateMeetingDialOutCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.FromPhoneNumber !== undefined && { FromPhoneNumber: input.FromPhoneNumber }), - ...(input.JoinToken !== undefined && { JoinToken: input.JoinToken }), - ...(input.ToPhoneNumber !== undefined && { ToPhoneNumber: input.ToPhoneNumber }), + ...(input.FromPhoneNumber !== undefined && + input.FromPhoneNumber !== null && { FromPhoneNumber: input.FromPhoneNumber }), + ...(input.JoinToken !== undefined && input.JoinToken !== null && { JoinToken: input.JoinToken }), + ...(input.ToPhoneNumber !== undefined && input.ToPhoneNumber !== null && { ToPhoneNumber: input.ToPhoneNumber }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1463,7 +1488,7 @@ export const serializeAws_restJson1CreateMeetingWithAttendeesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/meetings"; const query: any = { @@ -1471,20 +1496,24 @@ export const serializeAws_restJson1CreateMeetingWithAttendeesCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Attendees !== undefined && { - Attendees: serializeAws_restJson1CreateMeetingWithAttendeesRequestItemList(input.Attendees, context), - }), + ...(input.Attendees !== undefined && + input.Attendees !== null && { + Attendees: serializeAws_restJson1CreateMeetingWithAttendeesRequestItemList(input.Attendees, context), + }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.ExternalMeetingId !== undefined && { ExternalMeetingId: input.ExternalMeetingId }), - ...(input.MediaRegion !== undefined && { MediaRegion: input.MediaRegion }), - ...(input.MeetingHostId !== undefined && { MeetingHostId: input.MeetingHostId }), - ...(input.NotificationsConfiguration !== undefined && { - NotificationsConfiguration: serializeAws_restJson1MeetingNotificationConfiguration( - input.NotificationsConfiguration, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1MeetingTagList(input.Tags, context) }), + ...(input.ExternalMeetingId !== undefined && + input.ExternalMeetingId !== null && { ExternalMeetingId: input.ExternalMeetingId }), + ...(input.MediaRegion !== undefined && input.MediaRegion !== null && { MediaRegion: input.MediaRegion }), + ...(input.MeetingHostId !== undefined && input.MeetingHostId !== null && { MeetingHostId: input.MeetingHostId }), + ...(input.NotificationsConfiguration !== undefined && + input.NotificationsConfiguration !== null && { + NotificationsConfiguration: serializeAws_restJson1MeetingNotificationConfiguration( + input.NotificationsConfiguration, + context + ), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1MeetingTagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1504,15 +1533,16 @@ export const serializeAws_restJson1CreatePhoneNumberOrderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/phone-number-orders"; let body: any; body = JSON.stringify({ - ...(input.E164PhoneNumbers !== undefined && { - E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), - }), - ...(input.ProductType !== undefined && { ProductType: input.ProductType }), + ...(input.E164PhoneNumbers !== undefined && + input.E164PhoneNumbers !== null && { + E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), + }), + ...(input.ProductType !== undefined && input.ProductType !== null && { ProductType: input.ProductType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1531,7 +1561,7 @@ export const serializeAws_restJson1CreateProxySessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/proxy-sessions"; if (input.VoiceConnectorId !== undefined) { @@ -1545,19 +1575,26 @@ export const serializeAws_restJson1CreateProxySessionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Capabilities !== undefined && { - Capabilities: serializeAws_restJson1CapabilityList(input.Capabilities, context), - }), - ...(input.ExpiryMinutes !== undefined && { ExpiryMinutes: input.ExpiryMinutes }), - ...(input.GeoMatchLevel !== undefined && { GeoMatchLevel: input.GeoMatchLevel }), - ...(input.GeoMatchParams !== undefined && { - GeoMatchParams: serializeAws_restJson1GeoMatchParams(input.GeoMatchParams, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NumberSelectionBehavior !== undefined && { NumberSelectionBehavior: input.NumberSelectionBehavior }), - ...(input.ParticipantPhoneNumbers !== undefined && { - ParticipantPhoneNumbers: serializeAws_restJson1ParticipantPhoneNumberList(input.ParticipantPhoneNumbers, context), - }), + ...(input.Capabilities !== undefined && + input.Capabilities !== null && { + Capabilities: serializeAws_restJson1CapabilityList(input.Capabilities, context), + }), + ...(input.ExpiryMinutes !== undefined && input.ExpiryMinutes !== null && { ExpiryMinutes: input.ExpiryMinutes }), + ...(input.GeoMatchLevel !== undefined && input.GeoMatchLevel !== null && { GeoMatchLevel: input.GeoMatchLevel }), + ...(input.GeoMatchParams !== undefined && + input.GeoMatchParams !== null && { + GeoMatchParams: serializeAws_restJson1GeoMatchParams(input.GeoMatchParams, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NumberSelectionBehavior !== undefined && + input.NumberSelectionBehavior !== null && { NumberSelectionBehavior: input.NumberSelectionBehavior }), + ...(input.ParticipantPhoneNumbers !== undefined && + input.ParticipantPhoneNumbers !== null && { + ParticipantPhoneNumbers: serializeAws_restJson1ParticipantPhoneNumberList( + input.ParticipantPhoneNumbers, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1576,7 +1613,7 @@ export const serializeAws_restJson1CreateRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/rooms"; if (input.AccountId !== undefined) { @@ -1591,7 +1628,7 @@ export const serializeAws_restJson1CreateRoomCommand = async ( let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1610,7 +1647,7 @@ export const serializeAws_restJson1CreateRoomMembershipCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/rooms/{RoomId}/memberships"; if (input.AccountId !== undefined) { @@ -1633,8 +1670,8 @@ export const serializeAws_restJson1CreateRoomMembershipCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MemberId !== undefined && { MemberId: input.MemberId }), - ...(input.Role !== undefined && { Role: input.Role }), + ...(input.MemberId !== undefined && input.MemberId !== null && { MemberId: input.MemberId }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1653,16 +1690,17 @@ export const serializeAws_restJson1CreateSipMediaApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/sip-media-applications"; let body: any; body = JSON.stringify({ - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), - ...(input.Endpoints !== undefined && { - Endpoints: serializeAws_restJson1SipMediaApplicationEndpointList(input.Endpoints, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), + ...(input.Endpoints !== undefined && + input.Endpoints !== null && { + Endpoints: serializeAws_restJson1SipMediaApplicationEndpointList(input.Endpoints, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1681,7 +1719,7 @@ export const serializeAws_restJson1CreateSipMediaApplicationCallCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/sip-media-applications/{SipMediaApplicationId}/calls"; if (input.SipMediaApplicationId !== undefined) { @@ -1695,8 +1733,9 @@ export const serializeAws_restJson1CreateSipMediaApplicationCallCommand = async } let body: any; body = JSON.stringify({ - ...(input.FromPhoneNumber !== undefined && { FromPhoneNumber: input.FromPhoneNumber }), - ...(input.ToPhoneNumber !== undefined && { ToPhoneNumber: input.ToPhoneNumber }), + ...(input.FromPhoneNumber !== undefined && + input.FromPhoneNumber !== null && { FromPhoneNumber: input.FromPhoneNumber }), + ...(input.ToPhoneNumber !== undefined && input.ToPhoneNumber !== null && { ToPhoneNumber: input.ToPhoneNumber }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1715,18 +1754,19 @@ export const serializeAws_restJson1CreateSipRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/sip-rules"; let body: any; body = JSON.stringify({ - ...(input.Disabled !== undefined && { Disabled: input.Disabled }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.TargetApplications !== undefined && { - TargetApplications: serializeAws_restJson1SipRuleTargetApplicationList(input.TargetApplications, context), - }), - ...(input.TriggerType !== undefined && { TriggerType: input.TriggerType }), - ...(input.TriggerValue !== undefined && { TriggerValue: input.TriggerValue }), + ...(input.Disabled !== undefined && input.Disabled !== null && { Disabled: input.Disabled }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.TargetApplications !== undefined && + input.TargetApplications !== null && { + TargetApplications: serializeAws_restJson1SipRuleTargetApplicationList(input.TargetApplications, context), + }), + ...(input.TriggerType !== undefined && input.TriggerType !== null && { TriggerType: input.TriggerType }), + ...(input.TriggerValue !== undefined && input.TriggerValue !== null && { TriggerValue: input.TriggerValue }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1745,7 +1785,7 @@ export const serializeAws_restJson1CreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/users"; if (input.AccountId !== undefined) { @@ -1762,9 +1802,9 @@ export const serializeAws_restJson1CreateUserCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.UserType !== undefined && { UserType: input.UserType }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.UserType !== undefined && input.UserType !== null && { UserType: input.UserType }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1784,14 +1824,15 @@ export const serializeAws_restJson1CreateVoiceConnectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors"; let body: any; body = JSON.stringify({ - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RequireEncryption !== undefined && { RequireEncryption: input.RequireEncryption }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RequireEncryption !== undefined && + input.RequireEncryption !== null && { RequireEncryption: input.RequireEncryption }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1810,15 +1851,16 @@ export const serializeAws_restJson1CreateVoiceConnectorGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connector-groups"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.VoiceConnectorItems !== undefined && { - VoiceConnectorItems: serializeAws_restJson1VoiceConnectorItemList(input.VoiceConnectorItems, context), - }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.VoiceConnectorItems !== undefined && + input.VoiceConnectorItems !== null && { + VoiceConnectorItems: serializeAws_restJson1VoiceConnectorItemList(input.VoiceConnectorItems, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1836,9 +1878,7 @@ export const serializeAws_restJson1DeleteAccountCommand = async ( input: DeleteAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -1866,9 +1906,7 @@ export const serializeAws_restJson1DeleteAppInstanceCommand = async ( input: DeleteAppInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instances/{AppInstanceArn}"; if (input.AppInstanceArn !== undefined) { const labelValue: string = input.AppInstanceArn; @@ -1903,9 +1941,7 @@ export const serializeAws_restJson1DeleteAppInstanceAdminCommand = async ( input: DeleteAppInstanceAdminCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instances/{AppInstanceArn}/admins/{AppInstanceAdminArn}"; if (input.AppInstanceAdminArn !== undefined) { const labelValue: string = input.AppInstanceAdminArn; @@ -1949,9 +1985,7 @@ export const serializeAws_restJson1DeleteAppInstanceStreamingConfigurationsComma input: DeleteAppInstanceStreamingConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instances/{AppInstanceArn}/streaming-configurations"; if (input.AppInstanceArn !== undefined) { const labelValue: string = input.AppInstanceArn; @@ -1979,9 +2013,7 @@ export const serializeAws_restJson1DeleteAppInstanceUserCommand = async ( input: DeleteAppInstanceUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instance-users/{AppInstanceUserArn}"; if (input.AppInstanceUserArn !== undefined) { const labelValue: string = input.AppInstanceUserArn; @@ -2016,9 +2048,7 @@ export const serializeAws_restJson1DeleteAttendeeCommand = async ( input: DeleteAttendeeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/meetings/{MeetingId}/attendees/{AttendeeId}"; if (input.MeetingId !== undefined) { const labelValue: string = input.MeetingId; @@ -2055,9 +2085,7 @@ export const serializeAws_restJson1DeleteChannelCommand = async ( input: DeleteChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -2092,9 +2120,7 @@ export const serializeAws_restJson1DeleteChannelBanCommand = async ( input: DeleteChannelBanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/bans/{MemberArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -2138,9 +2164,7 @@ export const serializeAws_restJson1DeleteChannelMembershipCommand = async ( input: DeleteChannelMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/memberships/{MemberArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -2184,9 +2208,7 @@ export const serializeAws_restJson1DeleteChannelMessageCommand = async ( input: DeleteChannelMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/messages/{MessageId}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -2230,9 +2252,7 @@ export const serializeAws_restJson1DeleteChannelModeratorCommand = async ( input: DeleteChannelModeratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/moderators/{ChannelModeratorArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -2276,9 +2296,7 @@ export const serializeAws_restJson1DeleteEventsConfigurationCommand = async ( input: DeleteEventsConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/bots/{BotId}/events-configuration"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -2315,9 +2333,7 @@ export const serializeAws_restJson1DeleteMeetingCommand = async ( input: DeleteMeetingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/meetings/{MeetingId}"; if (input.MeetingId !== undefined) { const labelValue: string = input.MeetingId; @@ -2345,9 +2361,7 @@ export const serializeAws_restJson1DeletePhoneNumberCommand = async ( input: DeletePhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/phone-numbers/{PhoneNumberId}"; if (input.PhoneNumberId !== undefined) { const labelValue: string = input.PhoneNumberId; @@ -2375,9 +2389,7 @@ export const serializeAws_restJson1DeleteProxySessionCommand = async ( input: DeleteProxySessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/proxy-sessions/{ProxySessionId}"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -2414,9 +2426,7 @@ export const serializeAws_restJson1DeleteRoomCommand = async ( input: DeleteRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/rooms/{RoomId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -2453,9 +2463,7 @@ export const serializeAws_restJson1DeleteRoomMembershipCommand = async ( input: DeleteRoomMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/rooms/{RoomId}/memberships/{MemberId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -2501,9 +2509,7 @@ export const serializeAws_restJson1DeleteSipMediaApplicationCommand = async ( input: DeleteSipMediaApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sip-media-applications/{SipMediaApplicationId}"; if (input.SipMediaApplicationId !== undefined) { const labelValue: string = input.SipMediaApplicationId; @@ -2531,9 +2537,7 @@ export const serializeAws_restJson1DeleteSipRuleCommand = async ( input: DeleteSipRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sip-rules/{SipRuleId}"; if (input.SipRuleId !== undefined) { const labelValue: string = input.SipRuleId; @@ -2561,9 +2565,7 @@ export const serializeAws_restJson1DeleteVoiceConnectorCommand = async ( input: DeleteVoiceConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -2591,9 +2593,7 @@ export const serializeAws_restJson1DeleteVoiceConnectorEmergencyCallingConfigura input: DeleteVoiceConnectorEmergencyCallingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/emergency-calling-configuration"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -2621,9 +2621,7 @@ export const serializeAws_restJson1DeleteVoiceConnectorGroupCommand = async ( input: DeleteVoiceConnectorGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connector-groups/{VoiceConnectorGroupId}"; if (input.VoiceConnectorGroupId !== undefined) { const labelValue: string = input.VoiceConnectorGroupId; @@ -2651,9 +2649,7 @@ export const serializeAws_restJson1DeleteVoiceConnectorOriginationCommand = asyn input: DeleteVoiceConnectorOriginationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/origination"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -2681,9 +2677,7 @@ export const serializeAws_restJson1DeleteVoiceConnectorProxyCommand = async ( input: DeleteVoiceConnectorProxyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/programmable-numbers/proxy"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -2711,9 +2705,7 @@ export const serializeAws_restJson1DeleteVoiceConnectorStreamingConfigurationCom input: DeleteVoiceConnectorStreamingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/streaming-configuration"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -2741,9 +2733,7 @@ export const serializeAws_restJson1DeleteVoiceConnectorTerminationCommand = asyn input: DeleteVoiceConnectorTerminationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/termination"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -2772,7 +2762,7 @@ export const serializeAws_restJson1DeleteVoiceConnectorTerminationCredentialsCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/termination/credentials"; if (input.VoiceConnectorId !== undefined) { @@ -2789,9 +2779,8 @@ export const serializeAws_restJson1DeleteVoiceConnectorTerminationCredentialsCom }; let body: any; body = JSON.stringify({ - ...(input.Usernames !== undefined && { - Usernames: serializeAws_restJson1SensitiveStringList(input.Usernames, context), - }), + ...(input.Usernames !== undefined && + input.Usernames !== null && { Usernames: serializeAws_restJson1SensitiveStringList(input.Usernames, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2810,9 +2799,7 @@ export const serializeAws_restJson1DescribeAppInstanceCommand = async ( input: DescribeAppInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instances/{AppInstanceArn}"; if (input.AppInstanceArn !== undefined) { const labelValue: string = input.AppInstanceArn; @@ -2847,9 +2834,7 @@ export const serializeAws_restJson1DescribeAppInstanceAdminCommand = async ( input: DescribeAppInstanceAdminCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instances/{AppInstanceArn}/admins/{AppInstanceAdminArn}"; if (input.AppInstanceAdminArn !== undefined) { const labelValue: string = input.AppInstanceAdminArn; @@ -2893,9 +2878,7 @@ export const serializeAws_restJson1DescribeAppInstanceUserCommand = async ( input: DescribeAppInstanceUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instance-users/{AppInstanceUserArn}"; if (input.AppInstanceUserArn !== undefined) { const labelValue: string = input.AppInstanceUserArn; @@ -2930,9 +2913,7 @@ export const serializeAws_restJson1DescribeChannelCommand = async ( input: DescribeChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -2967,9 +2948,7 @@ export const serializeAws_restJson1DescribeChannelBanCommand = async ( input: DescribeChannelBanCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/bans/{MemberArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -3013,9 +2992,7 @@ export const serializeAws_restJson1DescribeChannelMembershipCommand = async ( input: DescribeChannelMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/memberships/{MemberArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -3059,9 +3036,7 @@ export const serializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCo input: DescribeChannelMembershipForAppInstanceUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -3101,9 +3076,7 @@ export const serializeAws_restJson1DescribeChannelModeratedByAppInstanceUserComm input: DescribeChannelModeratedByAppInstanceUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -3143,9 +3116,7 @@ export const serializeAws_restJson1DescribeChannelModeratorCommand = async ( input: DescribeChannelModeratorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/moderators/{ChannelModeratorArn}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -3189,9 +3160,7 @@ export const serializeAws_restJson1DisassociatePhoneNumberFromUserCommand = asyn input: DisassociatePhoneNumberFromUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/users/{UserId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -3233,7 +3202,7 @@ export const serializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}"; if (input.VoiceConnectorId !== undefined) { @@ -3250,9 +3219,10 @@ export const serializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorCom }; let body: any; body = JSON.stringify({ - ...(input.E164PhoneNumbers !== undefined && { - E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), - }), + ...(input.E164PhoneNumbers !== undefined && + input.E164PhoneNumbers !== null && { + E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3272,7 +3242,7 @@ export const serializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorGro context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connector-groups/{VoiceConnectorGroupId}"; if (input.VoiceConnectorGroupId !== undefined) { @@ -3289,9 +3259,10 @@ export const serializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorGro }; let body: any; body = JSON.stringify({ - ...(input.E164PhoneNumbers !== undefined && { - E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), - }), + ...(input.E164PhoneNumbers !== undefined && + input.E164PhoneNumbers !== null && { + E164PhoneNumbers: serializeAws_restJson1E164PhoneNumberList(input.E164PhoneNumbers, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3311,7 +3282,7 @@ export const serializeAws_restJson1DisassociateSigninDelegateGroupsFromAccountCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}"; if (input.AccountId !== undefined) { @@ -3328,9 +3299,8 @@ export const serializeAws_restJson1DisassociateSigninDelegateGroupsFromAccountCo }; let body: any; body = JSON.stringify({ - ...(input.GroupNames !== undefined && { - GroupNames: serializeAws_restJson1NonEmptyStringList(input.GroupNames, context), - }), + ...(input.GroupNames !== undefined && + input.GroupNames !== null && { GroupNames: serializeAws_restJson1NonEmptyStringList(input.GroupNames, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3349,9 +3319,7 @@ export const serializeAws_restJson1GetAccountCommand = async ( input: GetAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -3379,9 +3347,7 @@ export const serializeAws_restJson1GetAccountSettingsCommand = async ( input: GetAccountSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/settings"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -3409,9 +3375,7 @@ export const serializeAws_restJson1GetAppInstanceRetentionSettingsCommand = asyn input: GetAppInstanceRetentionSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instances/{AppInstanceArn}/retention-settings"; if (input.AppInstanceArn !== undefined) { const labelValue: string = input.AppInstanceArn; @@ -3446,9 +3410,7 @@ export const serializeAws_restJson1GetAppInstanceStreamingConfigurationsCommand input: GetAppInstanceStreamingConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instances/{AppInstanceArn}/streaming-configurations"; if (input.AppInstanceArn !== undefined) { const labelValue: string = input.AppInstanceArn; @@ -3476,9 +3438,7 @@ export const serializeAws_restJson1GetAttendeeCommand = async ( input: GetAttendeeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/meetings/{MeetingId}/attendees/{AttendeeId}"; if (input.MeetingId !== undefined) { const labelValue: string = input.MeetingId; @@ -3515,9 +3475,7 @@ export const serializeAws_restJson1GetBotCommand = async ( input: GetBotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/bots/{BotId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -3554,9 +3512,7 @@ export const serializeAws_restJson1GetChannelMessageCommand = async ( input: GetChannelMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/messages/{MessageId}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -3600,9 +3556,7 @@ export const serializeAws_restJson1GetEventsConfigurationCommand = async ( input: GetEventsConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/bots/{BotId}/events-configuration"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -3639,12 +3593,10 @@ export const serializeAws_restJson1GetGlobalSettingsCommand = async ( input: GetGlobalSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/settings"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -3661,9 +3613,7 @@ export const serializeAws_restJson1GetMeetingCommand = async ( input: GetMeetingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/meetings/{MeetingId}"; if (input.MeetingId !== undefined) { const labelValue: string = input.MeetingId; @@ -3691,12 +3641,10 @@ export const serializeAws_restJson1GetMessagingSessionEndpointCommand = async ( input: GetMessagingSessionEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/endpoints/messaging-session"; let body: any; - body = "{}"; + body = ""; let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { resolvedHostname = "messaging-" + resolvedHostname; @@ -3720,9 +3668,7 @@ export const serializeAws_restJson1GetPhoneNumberCommand = async ( input: GetPhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/phone-numbers/{PhoneNumberId}"; if (input.PhoneNumberId !== undefined) { const labelValue: string = input.PhoneNumberId; @@ -3750,9 +3696,7 @@ export const serializeAws_restJson1GetPhoneNumberOrderCommand = async ( input: GetPhoneNumberOrderCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/phone-number-orders/{PhoneNumberOrderId}"; if (input.PhoneNumberOrderId !== undefined) { const labelValue: string = input.PhoneNumberOrderId; @@ -3780,12 +3724,10 @@ export const serializeAws_restJson1GetPhoneNumberSettingsCommand = async ( input: GetPhoneNumberSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/settings/phone-number"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -3802,9 +3744,7 @@ export const serializeAws_restJson1GetProxySessionCommand = async ( input: GetProxySessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/proxy-sessions/{ProxySessionId}"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -3841,9 +3781,7 @@ export const serializeAws_restJson1GetRetentionSettingsCommand = async ( input: GetRetentionSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/retention-settings"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -3871,9 +3809,7 @@ export const serializeAws_restJson1GetRoomCommand = async ( input: GetRoomCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/rooms/{RoomId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -3910,9 +3846,7 @@ export const serializeAws_restJson1GetSipMediaApplicationCommand = async ( input: GetSipMediaApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sip-media-applications/{SipMediaApplicationId}"; if (input.SipMediaApplicationId !== undefined) { const labelValue: string = input.SipMediaApplicationId; @@ -3940,9 +3874,7 @@ export const serializeAws_restJson1GetSipMediaApplicationLoggingConfigurationCom input: GetSipMediaApplicationLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sip-media-applications/{SipMediaApplicationId}/logging-configuration"; if (input.SipMediaApplicationId !== undefined) { const labelValue: string = input.SipMediaApplicationId; @@ -3970,9 +3902,7 @@ export const serializeAws_restJson1GetSipRuleCommand = async ( input: GetSipRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sip-rules/{SipRuleId}"; if (input.SipRuleId !== undefined) { const labelValue: string = input.SipRuleId; @@ -4000,9 +3930,7 @@ export const serializeAws_restJson1GetUserCommand = async ( input: GetUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/users/{UserId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -4039,9 +3967,7 @@ export const serializeAws_restJson1GetUserSettingsCommand = async ( input: GetUserSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/users/{UserId}/settings"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -4078,9 +4004,7 @@ export const serializeAws_restJson1GetVoiceConnectorCommand = async ( input: GetVoiceConnectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -4108,9 +4032,7 @@ export const serializeAws_restJson1GetVoiceConnectorEmergencyCallingConfiguratio input: GetVoiceConnectorEmergencyCallingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/emergency-calling-configuration"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -4138,9 +4060,7 @@ export const serializeAws_restJson1GetVoiceConnectorGroupCommand = async ( input: GetVoiceConnectorGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connector-groups/{VoiceConnectorGroupId}"; if (input.VoiceConnectorGroupId !== undefined) { const labelValue: string = input.VoiceConnectorGroupId; @@ -4168,9 +4088,7 @@ export const serializeAws_restJson1GetVoiceConnectorLoggingConfigurationCommand input: GetVoiceConnectorLoggingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/logging-configuration"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -4198,9 +4116,7 @@ export const serializeAws_restJson1GetVoiceConnectorOriginationCommand = async ( input: GetVoiceConnectorOriginationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/origination"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -4228,9 +4144,7 @@ export const serializeAws_restJson1GetVoiceConnectorProxyCommand = async ( input: GetVoiceConnectorProxyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/programmable-numbers/proxy"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -4258,9 +4172,7 @@ export const serializeAws_restJson1GetVoiceConnectorStreamingConfigurationComman input: GetVoiceConnectorStreamingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/streaming-configuration"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -4288,9 +4200,7 @@ export const serializeAws_restJson1GetVoiceConnectorTerminationCommand = async ( input: GetVoiceConnectorTerminationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/termination"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -4318,9 +4228,7 @@ export const serializeAws_restJson1GetVoiceConnectorTerminationHealthCommand = a input: GetVoiceConnectorTerminationHealthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/termination/health"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -4349,7 +4257,7 @@ export const serializeAws_restJson1InviteUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/users"; if (input.AccountId !== undefined) { @@ -4366,10 +4274,11 @@ export const serializeAws_restJson1InviteUsersCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.UserEmailList !== undefined && { - UserEmailList: serializeAws_restJson1UserEmailList(input.UserEmailList, context), - }), - ...(input.UserType !== undefined && { UserType: input.UserType }), + ...(input.UserEmailList !== undefined && + input.UserEmailList !== null && { + UserEmailList: serializeAws_restJson1UserEmailList(input.UserEmailList, context), + }), + ...(input.UserType !== undefined && input.UserType !== null && { UserType: input.UserType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4388,9 +4297,7 @@ export const serializeAws_restJson1ListAccountsCommand = async ( input: ListAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts"; const query: any = { ...(input.Name !== undefined && { name: input.Name }), @@ -4416,9 +4323,7 @@ export const serializeAws_restJson1ListAppInstanceAdminsCommand = async ( input: ListAppInstanceAdminsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instances/{AppInstanceArn}/admins"; if (input.AppInstanceArn !== undefined) { const labelValue: string = input.AppInstanceArn; @@ -4458,9 +4363,7 @@ export const serializeAws_restJson1ListAppInstancesCommand = async ( input: ListAppInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instances"; const query: any = { ...(input.MaxResults !== undefined && { "max-results": input.MaxResults.toString() }), @@ -4491,9 +4394,7 @@ export const serializeAws_restJson1ListAppInstanceUsersCommand = async ( input: ListAppInstanceUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/app-instance-users"; const query: any = { ...(input.AppInstanceArn !== undefined && { "app-instance-arn": input.AppInstanceArn }), @@ -4525,9 +4426,7 @@ export const serializeAws_restJson1ListAttendeesCommand = async ( input: ListAttendeesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/meetings/{MeetingId}/attendees"; if (input.MeetingId !== undefined) { const labelValue: string = input.MeetingId; @@ -4560,9 +4459,7 @@ export const serializeAws_restJson1ListAttendeeTagsCommand = async ( input: ListAttendeeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/meetings/{MeetingId}/attendees/{AttendeeId}/tags"; if (input.MeetingId !== undefined) { const labelValue: string = input.MeetingId; @@ -4599,9 +4496,7 @@ export const serializeAws_restJson1ListBotsCommand = async ( input: ListBotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/bots"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -4634,9 +4529,7 @@ export const serializeAws_restJson1ListChannelBansCommand = async ( input: ListChannelBansCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/bans"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -4676,9 +4569,7 @@ export const serializeAws_restJson1ListChannelMembershipsCommand = async ( input: ListChannelMembershipsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/memberships"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -4719,9 +4610,7 @@ export const serializeAws_restJson1ListChannelMembershipsForAppInstanceUserComma input: ListChannelMembershipsForAppInstanceUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels"; const query: any = { scope: "app-instance-user-memberships", @@ -4754,9 +4643,7 @@ export const serializeAws_restJson1ListChannelMessagesCommand = async ( input: ListChannelMessagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/messages"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -4801,9 +4688,7 @@ export const serializeAws_restJson1ListChannelModeratorsCommand = async ( input: ListChannelModeratorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/moderators"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -4843,9 +4728,7 @@ export const serializeAws_restJson1ListChannelsCommand = async ( input: ListChannelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels"; const query: any = { ...(input.AppInstanceArn !== undefined && { "app-instance-arn": input.AppInstanceArn }), @@ -4878,9 +4761,7 @@ export const serializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommand input: ListChannelsModeratedByAppInstanceUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels"; const query: any = { scope: "app-instance-user-moderated-channels", @@ -4913,9 +4794,7 @@ export const serializeAws_restJson1ListMeetingsCommand = async ( input: ListMeetingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/meetings"; const query: any = { ...(input.NextToken !== undefined && { "next-token": input.NextToken }), @@ -4939,9 +4818,7 @@ export const serializeAws_restJson1ListMeetingTagsCommand = async ( input: ListMeetingTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/meetings/{MeetingId}/tags"; if (input.MeetingId !== undefined) { const labelValue: string = input.MeetingId; @@ -4969,9 +4846,7 @@ export const serializeAws_restJson1ListPhoneNumberOrdersCommand = async ( input: ListPhoneNumberOrdersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/phone-number-orders"; const query: any = { ...(input.NextToken !== undefined && { "next-token": input.NextToken }), @@ -4995,9 +4870,7 @@ export const serializeAws_restJson1ListPhoneNumbersCommand = async ( input: ListPhoneNumbersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/phone-numbers"; const query: any = { ...(input.Status !== undefined && { status: input.Status }), @@ -5025,9 +4898,7 @@ export const serializeAws_restJson1ListProxySessionsCommand = async ( input: ListProxySessionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/proxy-sessions"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -5061,9 +4932,7 @@ export const serializeAws_restJson1ListRoomMembershipsCommand = async ( input: ListRoomMembershipsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/rooms/{RoomId}/memberships"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -5105,9 +4974,7 @@ export const serializeAws_restJson1ListRoomsCommand = async ( input: ListRoomsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/rooms"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -5141,9 +5008,7 @@ export const serializeAws_restJson1ListSipMediaApplicationsCommand = async ( input: ListSipMediaApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sip-media-applications"; const query: any = { ...(input.MaxResults !== undefined && { "max-results": input.MaxResults.toString() }), @@ -5167,9 +5032,7 @@ export const serializeAws_restJson1ListSipRulesCommand = async ( input: ListSipRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sip-rules"; const query: any = { ...(input.SipMediaApplicationId !== undefined && { "sip-media-application": input.SipMediaApplicationId }), @@ -5194,9 +5057,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags"; const query: any = { ...(input.ResourceARN !== undefined && { arn: input.ResourceARN }), @@ -5219,9 +5080,7 @@ export const serializeAws_restJson1ListUsersCommand = async ( input: ListUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/users"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -5256,9 +5115,7 @@ export const serializeAws_restJson1ListVoiceConnectorGroupsCommand = async ( input: ListVoiceConnectorGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connector-groups"; const query: any = { ...(input.NextToken !== undefined && { "next-token": input.NextToken }), @@ -5282,9 +5139,7 @@ export const serializeAws_restJson1ListVoiceConnectorsCommand = async ( input: ListVoiceConnectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors"; const query: any = { ...(input.NextToken !== undefined && { "next-token": input.NextToken }), @@ -5308,9 +5163,7 @@ export const serializeAws_restJson1ListVoiceConnectorTerminationCredentialsComma input: ListVoiceConnectorTerminationCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/termination/credentials"; if (input.VoiceConnectorId !== undefined) { const labelValue: string = input.VoiceConnectorId; @@ -5338,9 +5191,7 @@ export const serializeAws_restJson1LogoutUserCommand = async ( input: LogoutUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/users/{UserId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -5382,7 +5233,7 @@ export const serializeAws_restJson1PutAppInstanceRetentionSettingsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/app-instances/{AppInstanceArn}/retention-settings"; if (input.AppInstanceArn !== undefined) { @@ -5396,12 +5247,13 @@ export const serializeAws_restJson1PutAppInstanceRetentionSettingsCommand = asyn } let body: any; body = JSON.stringify({ - ...(input.AppInstanceRetentionSettings !== undefined && { - AppInstanceRetentionSettings: serializeAws_restJson1AppInstanceRetentionSettings( - input.AppInstanceRetentionSettings, - context - ), - }), + ...(input.AppInstanceRetentionSettings !== undefined && + input.AppInstanceRetentionSettings !== null && { + AppInstanceRetentionSettings: serializeAws_restJson1AppInstanceRetentionSettings( + input.AppInstanceRetentionSettings, + context + ), + }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -5427,7 +5279,7 @@ export const serializeAws_restJson1PutAppInstanceStreamingConfigurationsCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/app-instances/{AppInstanceArn}/streaming-configurations"; if (input.AppInstanceArn !== undefined) { @@ -5441,12 +5293,13 @@ export const serializeAws_restJson1PutAppInstanceStreamingConfigurationsCommand } let body: any; body = JSON.stringify({ - ...(input.AppInstanceStreamingConfigurations !== undefined && { - AppInstanceStreamingConfigurations: serializeAws_restJson1AppInstanceStreamingConfigurationList( - input.AppInstanceStreamingConfigurations, - context - ), - }), + ...(input.AppInstanceStreamingConfigurations !== undefined && + input.AppInstanceStreamingConfigurations !== null && { + AppInstanceStreamingConfigurations: serializeAws_restJson1AppInstanceStreamingConfigurationList( + input.AppInstanceStreamingConfigurations, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5465,7 +5318,7 @@ export const serializeAws_restJson1PutEventsConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/bots/{BotId}/events-configuration"; if (input.AccountId !== undefined) { @@ -5488,10 +5341,10 @@ export const serializeAws_restJson1PutEventsConfigurationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.LambdaFunctionArn !== undefined && { LambdaFunctionArn: input.LambdaFunctionArn }), - ...(input.OutboundEventsHTTPSEndpoint !== undefined && { - OutboundEventsHTTPSEndpoint: input.OutboundEventsHTTPSEndpoint, - }), + ...(input.LambdaFunctionArn !== undefined && + input.LambdaFunctionArn !== null && { LambdaFunctionArn: input.LambdaFunctionArn }), + ...(input.OutboundEventsHTTPSEndpoint !== undefined && + input.OutboundEventsHTTPSEndpoint !== null && { OutboundEventsHTTPSEndpoint: input.OutboundEventsHTTPSEndpoint }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5510,7 +5363,7 @@ export const serializeAws_restJson1PutRetentionSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/retention-settings"; if (input.AccountId !== undefined) { @@ -5524,9 +5377,10 @@ export const serializeAws_restJson1PutRetentionSettingsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.RetentionSettings !== undefined && { - RetentionSettings: serializeAws_restJson1RetentionSettings(input.RetentionSettings, context), - }), + ...(input.RetentionSettings !== undefined && + input.RetentionSettings !== null && { + RetentionSettings: serializeAws_restJson1RetentionSettings(input.RetentionSettings, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5545,7 +5399,7 @@ export const serializeAws_restJson1PutSipMediaApplicationLoggingConfigurationCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/sip-media-applications/{SipMediaApplicationId}/logging-configuration"; if (input.SipMediaApplicationId !== undefined) { @@ -5559,12 +5413,13 @@ export const serializeAws_restJson1PutSipMediaApplicationLoggingConfigurationCom } let body: any; body = JSON.stringify({ - ...(input.SipMediaApplicationLoggingConfiguration !== undefined && { - SipMediaApplicationLoggingConfiguration: serializeAws_restJson1SipMediaApplicationLoggingConfiguration( - input.SipMediaApplicationLoggingConfiguration, - context - ), - }), + ...(input.SipMediaApplicationLoggingConfiguration !== undefined && + input.SipMediaApplicationLoggingConfiguration !== null && { + SipMediaApplicationLoggingConfiguration: serializeAws_restJson1SipMediaApplicationLoggingConfiguration( + input.SipMediaApplicationLoggingConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5583,7 +5438,7 @@ export const serializeAws_restJson1PutVoiceConnectorEmergencyCallingConfiguratio context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/emergency-calling-configuration"; if (input.VoiceConnectorId !== undefined) { @@ -5597,12 +5452,13 @@ export const serializeAws_restJson1PutVoiceConnectorEmergencyCallingConfiguratio } let body: any; body = JSON.stringify({ - ...(input.EmergencyCallingConfiguration !== undefined && { - EmergencyCallingConfiguration: serializeAws_restJson1EmergencyCallingConfiguration( - input.EmergencyCallingConfiguration, - context - ), - }), + ...(input.EmergencyCallingConfiguration !== undefined && + input.EmergencyCallingConfiguration !== null && { + EmergencyCallingConfiguration: serializeAws_restJson1EmergencyCallingConfiguration( + input.EmergencyCallingConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5621,7 +5477,7 @@ export const serializeAws_restJson1PutVoiceConnectorLoggingConfigurationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/logging-configuration"; if (input.VoiceConnectorId !== undefined) { @@ -5635,9 +5491,10 @@ export const serializeAws_restJson1PutVoiceConnectorLoggingConfigurationCommand } let body: any; body = JSON.stringify({ - ...(input.LoggingConfiguration !== undefined && { - LoggingConfiguration: serializeAws_restJson1LoggingConfiguration(input.LoggingConfiguration, context), - }), + ...(input.LoggingConfiguration !== undefined && + input.LoggingConfiguration !== null && { + LoggingConfiguration: serializeAws_restJson1LoggingConfiguration(input.LoggingConfiguration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5656,7 +5513,7 @@ export const serializeAws_restJson1PutVoiceConnectorOriginationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/origination"; if (input.VoiceConnectorId !== undefined) { @@ -5670,9 +5527,8 @@ export const serializeAws_restJson1PutVoiceConnectorOriginationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Origination !== undefined && { - Origination: serializeAws_restJson1Origination(input.Origination, context), - }), + ...(input.Origination !== undefined && + input.Origination !== null && { Origination: serializeAws_restJson1Origination(input.Origination, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5691,7 +5547,7 @@ export const serializeAws_restJson1PutVoiceConnectorProxyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/programmable-numbers/proxy"; if (input.VoiceConnectorId !== undefined) { @@ -5705,14 +5561,15 @@ export const serializeAws_restJson1PutVoiceConnectorProxyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DefaultSessionExpiryMinutes !== undefined && { - DefaultSessionExpiryMinutes: input.DefaultSessionExpiryMinutes, - }), - ...(input.Disabled !== undefined && { Disabled: input.Disabled }), - ...(input.FallBackPhoneNumber !== undefined && { FallBackPhoneNumber: input.FallBackPhoneNumber }), - ...(input.PhoneNumberPoolCountries !== undefined && { - PhoneNumberPoolCountries: serializeAws_restJson1CountryList(input.PhoneNumberPoolCountries, context), - }), + ...(input.DefaultSessionExpiryMinutes !== undefined && + input.DefaultSessionExpiryMinutes !== null && { DefaultSessionExpiryMinutes: input.DefaultSessionExpiryMinutes }), + ...(input.Disabled !== undefined && input.Disabled !== null && { Disabled: input.Disabled }), + ...(input.FallBackPhoneNumber !== undefined && + input.FallBackPhoneNumber !== null && { FallBackPhoneNumber: input.FallBackPhoneNumber }), + ...(input.PhoneNumberPoolCountries !== undefined && + input.PhoneNumberPoolCountries !== null && { + PhoneNumberPoolCountries: serializeAws_restJson1CountryList(input.PhoneNumberPoolCountries, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5731,7 +5588,7 @@ export const serializeAws_restJson1PutVoiceConnectorStreamingConfigurationComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/streaming-configuration"; if (input.VoiceConnectorId !== undefined) { @@ -5745,9 +5602,10 @@ export const serializeAws_restJson1PutVoiceConnectorStreamingConfigurationComman } let body: any; body = JSON.stringify({ - ...(input.StreamingConfiguration !== undefined && { - StreamingConfiguration: serializeAws_restJson1StreamingConfiguration(input.StreamingConfiguration, context), - }), + ...(input.StreamingConfiguration !== undefined && + input.StreamingConfiguration !== null && { + StreamingConfiguration: serializeAws_restJson1StreamingConfiguration(input.StreamingConfiguration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5766,7 +5624,7 @@ export const serializeAws_restJson1PutVoiceConnectorTerminationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/termination"; if (input.VoiceConnectorId !== undefined) { @@ -5780,9 +5638,8 @@ export const serializeAws_restJson1PutVoiceConnectorTerminationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Termination !== undefined && { - Termination: serializeAws_restJson1Termination(input.Termination, context), - }), + ...(input.Termination !== undefined && + input.Termination !== null && { Termination: serializeAws_restJson1Termination(input.Termination, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5801,7 +5658,7 @@ export const serializeAws_restJson1PutVoiceConnectorTerminationCredentialsComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/termination/credentials"; if (input.VoiceConnectorId !== undefined) { @@ -5818,9 +5675,8 @@ export const serializeAws_restJson1PutVoiceConnectorTerminationCredentialsComman }; let body: any; body = JSON.stringify({ - ...(input.Credentials !== undefined && { - Credentials: serializeAws_restJson1CredentialList(input.Credentials, context), - }), + ...(input.Credentials !== undefined && + input.Credentials !== null && { Credentials: serializeAws_restJson1CredentialList(input.Credentials, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5839,9 +5695,7 @@ export const serializeAws_restJson1RedactChannelMessageCommand = async ( input: RedactChannelMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/messages/{MessageId}"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -5889,9 +5743,7 @@ export const serializeAws_restJson1RedactConversationMessageCommand = async ( input: RedactConversationMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/conversations/{ConversationId}/messages/{MessageId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -5941,9 +5793,7 @@ export const serializeAws_restJson1RedactRoomMessageCommand = async ( input: RedactRoomMessageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/rooms/{RoomId}/messages/{MessageId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -5993,9 +5843,7 @@ export const serializeAws_restJson1RegenerateSecurityTokenCommand = async ( input: RegenerateSecurityTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/bots/{BotId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -6036,9 +5884,7 @@ export const serializeAws_restJson1ResetPersonalPINCommand = async ( input: ResetPersonalPINCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AccountId}/users/{UserId}"; if (input.AccountId !== undefined) { const labelValue: string = input.AccountId; @@ -6079,9 +5925,7 @@ export const serializeAws_restJson1RestorePhoneNumberCommand = async ( input: RestorePhoneNumberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/phone-numbers/{PhoneNumberId}"; if (input.PhoneNumberId !== undefined) { const labelValue: string = input.PhoneNumberId; @@ -6113,9 +5957,7 @@ export const serializeAws_restJson1SearchAvailablePhoneNumbersCommand = async ( input: SearchAvailablePhoneNumbersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/search"; const query: any = { type: "phone-numbers", @@ -6146,7 +5988,7 @@ export const serializeAws_restJson1SendChannelMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels/{ChannelArn}/messages"; if (input.ChannelArn !== undefined) { @@ -6161,10 +6003,10 @@ export const serializeAws_restJson1SendChannelMessageCommand = async ( let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.Metadata !== undefined && { Metadata: input.Metadata }), - ...(input.Persistence !== undefined && { Persistence: input.Persistence }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.Metadata !== undefined && input.Metadata !== null && { Metadata: input.Metadata }), + ...(input.Persistence !== undefined && input.Persistence !== null && { Persistence: input.Persistence }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -6190,7 +6032,7 @@ export const serializeAws_restJson1TagAttendeeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/meetings/{MeetingId}/attendees/{AttendeeId}/tags"; if (input.MeetingId !== undefined) { @@ -6216,7 +6058,8 @@ export const serializeAws_restJson1TagAttendeeCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1AttendeeTagList(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1AttendeeTagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6236,7 +6079,7 @@ export const serializeAws_restJson1TagMeetingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/meetings/{MeetingId}/tags"; if (input.MeetingId !== undefined) { @@ -6253,7 +6096,8 @@ export const serializeAws_restJson1TagMeetingCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1MeetingTagList(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1MeetingTagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6273,7 +6117,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags"; const query: any = { @@ -6281,8 +6125,9 @@ export const serializeAws_restJson1TagResourceCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6302,7 +6147,7 @@ export const serializeAws_restJson1UntagAttendeeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/meetings/{MeetingId}/attendees/{AttendeeId}/tags"; if (input.MeetingId !== undefined) { @@ -6328,7 +6173,8 @@ export const serializeAws_restJson1UntagAttendeeCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_restJson1AttendeeTagKeyList(input.TagKeys, context) }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_restJson1AttendeeTagKeyList(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6348,7 +6194,7 @@ export const serializeAws_restJson1UntagMeetingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/meetings/{MeetingId}/tags"; if (input.MeetingId !== undefined) { @@ -6365,7 +6211,8 @@ export const serializeAws_restJson1UntagMeetingCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_restJson1MeetingTagKeyList(input.TagKeys, context) }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_restJson1MeetingTagKeyList(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6385,7 +6232,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags"; const query: any = { @@ -6393,8 +6240,9 @@ export const serializeAws_restJson1UntagResourceCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6414,7 +6262,7 @@ export const serializeAws_restJson1UpdateAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}"; if (input.AccountId !== undefined) { @@ -6428,7 +6276,7 @@ export const serializeAws_restJson1UpdateAccountCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6447,7 +6295,7 @@ export const serializeAws_restJson1UpdateAccountSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/settings"; if (input.AccountId !== undefined) { @@ -6461,9 +6309,10 @@ export const serializeAws_restJson1UpdateAccountSettingsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountSettings !== undefined && { - AccountSettings: serializeAws_restJson1AccountSettings(input.AccountSettings, context), - }), + ...(input.AccountSettings !== undefined && + input.AccountSettings !== null && { + AccountSettings: serializeAws_restJson1AccountSettings(input.AccountSettings, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6482,7 +6331,7 @@ export const serializeAws_restJson1UpdateAppInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/app-instances/{AppInstanceArn}"; if (input.AppInstanceArn !== undefined) { @@ -6496,8 +6345,8 @@ export const serializeAws_restJson1UpdateAppInstanceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Metadata !== undefined && { Metadata: input.Metadata }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Metadata !== undefined && input.Metadata !== null && { Metadata: input.Metadata }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -6523,7 +6372,7 @@ export const serializeAws_restJson1UpdateAppInstanceUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/app-instance-users/{AppInstanceUserArn}"; if (input.AppInstanceUserArn !== undefined) { @@ -6537,8 +6386,8 @@ export const serializeAws_restJson1UpdateAppInstanceUserCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Metadata !== undefined && { Metadata: input.Metadata }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Metadata !== undefined && input.Metadata !== null && { Metadata: input.Metadata }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -6564,7 +6413,7 @@ export const serializeAws_restJson1UpdateBotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/bots/{BotId}"; if (input.AccountId !== undefined) { @@ -6587,7 +6436,7 @@ export const serializeAws_restJson1UpdateBotCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Disabled !== undefined && { Disabled: input.Disabled }), + ...(input.Disabled !== undefined && input.Disabled !== null && { Disabled: input.Disabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6606,7 +6455,7 @@ export const serializeAws_restJson1UpdateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels/{ChannelArn}"; if (input.ChannelArn !== undefined) { @@ -6620,9 +6469,9 @@ export const serializeAws_restJson1UpdateChannelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Metadata !== undefined && { Metadata: input.Metadata }), - ...(input.Mode !== undefined && { Mode: input.Mode }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Metadata !== undefined && input.Metadata !== null && { Metadata: input.Metadata }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -6648,7 +6497,7 @@ export const serializeAws_restJson1UpdateChannelMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels/{ChannelArn}/messages/{MessageId}"; if (input.ChannelArn !== undefined) { @@ -6671,8 +6520,8 @@ export const serializeAws_restJson1UpdateChannelMessageCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.Metadata !== undefined && { Metadata: input.Metadata }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.Metadata !== undefined && input.Metadata !== null && { Metadata: input.Metadata }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -6697,9 +6546,7 @@ export const serializeAws_restJson1UpdateChannelReadMarkerCommand = async ( input: UpdateChannelReadMarkerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{ChannelArn}/readMarker"; if (input.ChannelArn !== undefined) { const labelValue: string = input.ChannelArn; @@ -6735,17 +6582,19 @@ export const serializeAws_restJson1UpdateGlobalSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/settings"; let body: any; body = JSON.stringify({ - ...(input.BusinessCalling !== undefined && { - BusinessCalling: serializeAws_restJson1BusinessCallingSettings(input.BusinessCalling, context), - }), - ...(input.VoiceConnector !== undefined && { - VoiceConnector: serializeAws_restJson1VoiceConnectorSettings(input.VoiceConnector, context), - }), + ...(input.BusinessCalling !== undefined && + input.BusinessCalling !== null && { + BusinessCalling: serializeAws_restJson1BusinessCallingSettings(input.BusinessCalling, context), + }), + ...(input.VoiceConnector !== undefined && + input.VoiceConnector !== null && { + VoiceConnector: serializeAws_restJson1VoiceConnectorSettings(input.VoiceConnector, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6764,7 +6613,7 @@ export const serializeAws_restJson1UpdatePhoneNumberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/phone-numbers/{PhoneNumberId}"; if (input.PhoneNumberId !== undefined) { @@ -6778,8 +6627,8 @@ export const serializeAws_restJson1UpdatePhoneNumberCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CallingName !== undefined && { CallingName: input.CallingName }), - ...(input.ProductType !== undefined && { ProductType: input.ProductType }), + ...(input.CallingName !== undefined && input.CallingName !== null && { CallingName: input.CallingName }), + ...(input.ProductType !== undefined && input.ProductType !== null && { ProductType: input.ProductType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6798,12 +6647,12 @@ export const serializeAws_restJson1UpdatePhoneNumberSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/settings/phone-number"; let body: any; body = JSON.stringify({ - ...(input.CallingName !== undefined && { CallingName: input.CallingName }), + ...(input.CallingName !== undefined && input.CallingName !== null && { CallingName: input.CallingName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6822,7 +6671,7 @@ export const serializeAws_restJson1UpdateProxySessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}/proxy-sessions/{ProxySessionId}"; if (input.VoiceConnectorId !== undefined) { @@ -6845,10 +6694,11 @@ export const serializeAws_restJson1UpdateProxySessionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Capabilities !== undefined && { - Capabilities: serializeAws_restJson1CapabilityList(input.Capabilities, context), - }), - ...(input.ExpiryMinutes !== undefined && { ExpiryMinutes: input.ExpiryMinutes }), + ...(input.Capabilities !== undefined && + input.Capabilities !== null && { + Capabilities: serializeAws_restJson1CapabilityList(input.Capabilities, context), + }), + ...(input.ExpiryMinutes !== undefined && input.ExpiryMinutes !== null && { ExpiryMinutes: input.ExpiryMinutes }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6867,7 +6717,7 @@ export const serializeAws_restJson1UpdateRoomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/rooms/{RoomId}"; if (input.AccountId !== undefined) { @@ -6890,7 +6740,7 @@ export const serializeAws_restJson1UpdateRoomCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6909,7 +6759,7 @@ export const serializeAws_restJson1UpdateRoomMembershipCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/rooms/{RoomId}/memberships/{MemberId}"; if (input.AccountId !== undefined) { @@ -6941,7 +6791,7 @@ export const serializeAws_restJson1UpdateRoomMembershipCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Role !== undefined && { Role: input.Role }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6960,7 +6810,7 @@ export const serializeAws_restJson1UpdateSipMediaApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/sip-media-applications/{SipMediaApplicationId}"; if (input.SipMediaApplicationId !== undefined) { @@ -6974,10 +6824,11 @@ export const serializeAws_restJson1UpdateSipMediaApplicationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Endpoints !== undefined && { - Endpoints: serializeAws_restJson1SipMediaApplicationEndpointList(input.Endpoints, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Endpoints !== undefined && + input.Endpoints !== null && { + Endpoints: serializeAws_restJson1SipMediaApplicationEndpointList(input.Endpoints, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6996,7 +6847,7 @@ export const serializeAws_restJson1UpdateSipRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/sip-rules/{SipRuleId}"; if (input.SipRuleId !== undefined) { @@ -7010,11 +6861,12 @@ export const serializeAws_restJson1UpdateSipRuleCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Disabled !== undefined && { Disabled: input.Disabled }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.TargetApplications !== undefined && { - TargetApplications: serializeAws_restJson1SipRuleTargetApplicationList(input.TargetApplications, context), - }), + ...(input.Disabled !== undefined && input.Disabled !== null && { Disabled: input.Disabled }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.TargetApplications !== undefined && + input.TargetApplications !== null && { + TargetApplications: serializeAws_restJson1SipRuleTargetApplicationList(input.TargetApplications, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7033,7 +6885,7 @@ export const serializeAws_restJson1UpdateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/users/{UserId}"; if (input.AccountId !== undefined) { @@ -7056,11 +6908,15 @@ export const serializeAws_restJson1UpdateUserCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AlexaForBusinessMetadata !== undefined && { - AlexaForBusinessMetadata: serializeAws_restJson1AlexaForBusinessMetadata(input.AlexaForBusinessMetadata, context), - }), - ...(input.LicenseType !== undefined && { LicenseType: input.LicenseType }), - ...(input.UserType !== undefined && { UserType: input.UserType }), + ...(input.AlexaForBusinessMetadata !== undefined && + input.AlexaForBusinessMetadata !== null && { + AlexaForBusinessMetadata: serializeAws_restJson1AlexaForBusinessMetadata( + input.AlexaForBusinessMetadata, + context + ), + }), + ...(input.LicenseType !== undefined && input.LicenseType !== null && { LicenseType: input.LicenseType }), + ...(input.UserType !== undefined && input.UserType !== null && { UserType: input.UserType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7079,7 +6935,7 @@ export const serializeAws_restJson1UpdateUserSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AccountId}/users/{UserId}/settings"; if (input.AccountId !== undefined) { @@ -7102,9 +6958,8 @@ export const serializeAws_restJson1UpdateUserSettingsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.UserSettings !== undefined && { - UserSettings: serializeAws_restJson1UserSettings(input.UserSettings, context), - }), + ...(input.UserSettings !== undefined && + input.UserSettings !== null && { UserSettings: serializeAws_restJson1UserSettings(input.UserSettings, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7123,7 +6978,7 @@ export const serializeAws_restJson1UpdateVoiceConnectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connectors/{VoiceConnectorId}"; if (input.VoiceConnectorId !== undefined) { @@ -7137,8 +6992,9 @@ export const serializeAws_restJson1UpdateVoiceConnectorCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RequireEncryption !== undefined && { RequireEncryption: input.RequireEncryption }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RequireEncryption !== undefined && + input.RequireEncryption !== null && { RequireEncryption: input.RequireEncryption }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7157,7 +7013,7 @@ export const serializeAws_restJson1UpdateVoiceConnectorGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/voice-connector-groups/{VoiceConnectorGroupId}"; if (input.VoiceConnectorGroupId !== undefined) { @@ -7171,10 +7027,11 @@ export const serializeAws_restJson1UpdateVoiceConnectorGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.VoiceConnectorItems !== undefined && { - VoiceConnectorItems: serializeAws_restJson1VoiceConnectorItemList(input.VoiceConnectorItems, context), - }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.VoiceConnectorItems !== undefined && + input.VoiceConnectorItems !== null && { + VoiceConnectorItems: serializeAws_restJson1VoiceConnectorItemList(input.VoiceConnectorItems, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -26132,8 +25989,9 @@ const deserializeAws_restJson1UnprocessableEntityExceptionResponse = async ( const serializeAws_restJson1AccountSettings = (input: AccountSettings, context: __SerdeContext): any => { return { - ...(input.DisableRemoteControl !== undefined && { DisableRemoteControl: input.DisableRemoteControl }), - ...(input.EnableDialOut !== undefined && { EnableDialOut: input.EnableDialOut }), + ...(input.DisableRemoteControl !== undefined && + input.DisableRemoteControl !== null && { DisableRemoteControl: input.DisableRemoteControl }), + ...(input.EnableDialOut !== undefined && input.EnableDialOut !== null && { EnableDialOut: input.EnableDialOut }), }; }; @@ -26142,10 +26000,10 @@ const serializeAws_restJson1AlexaForBusinessMetadata = ( context: __SerdeContext ): any => { return { - ...(input.AlexaForBusinessRoomArn !== undefined && { AlexaForBusinessRoomArn: input.AlexaForBusinessRoomArn }), - ...(input.IsAlexaForBusinessEnabled !== undefined && { - IsAlexaForBusinessEnabled: input.IsAlexaForBusinessEnabled, - }), + ...(input.AlexaForBusinessRoomArn !== undefined && + input.AlexaForBusinessRoomArn !== null && { AlexaForBusinessRoomArn: input.AlexaForBusinessRoomArn }), + ...(input.IsAlexaForBusinessEnabled !== undefined && + input.IsAlexaForBusinessEnabled !== null && { IsAlexaForBusinessEnabled: input.IsAlexaForBusinessEnabled }), }; }; @@ -26154,9 +26012,13 @@ const serializeAws_restJson1AppInstanceRetentionSettings = ( context: __SerdeContext ): any => { return { - ...(input.ChannelRetentionSettings !== undefined && { - ChannelRetentionSettings: serializeAws_restJson1ChannelRetentionSettings(input.ChannelRetentionSettings, context), - }), + ...(input.ChannelRetentionSettings !== undefined && + input.ChannelRetentionSettings !== null && { + ChannelRetentionSettings: serializeAws_restJson1ChannelRetentionSettings( + input.ChannelRetentionSettings, + context + ), + }), }; }; @@ -26165,8 +26027,9 @@ const serializeAws_restJson1AppInstanceStreamingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AppInstanceDataType !== undefined && { AppInstanceDataType: input.AppInstanceDataType }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.AppInstanceDataType !== undefined && + input.AppInstanceDataType !== null && { AppInstanceDataType: input.AppInstanceDataType }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -26174,15 +26037,36 @@ const serializeAws_restJson1AppInstanceStreamingConfigurationList = ( input: AppInstanceStreamingConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AppInstanceStreamingConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AppInstanceStreamingConfiguration(entry, context); + }); }; const serializeAws_restJson1AttendeeTagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AttendeeTagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1BusinessCallingSettings = ( @@ -26190,16 +26074,30 @@ const serializeAws_restJson1BusinessCallingSettings = ( context: __SerdeContext ): any => { return { - ...(input.CdrBucket !== undefined && { CdrBucket: input.CdrBucket }), + ...(input.CdrBucket !== undefined && input.CdrBucket !== null && { CdrBucket: input.CdrBucket }), }; }; const serializeAws_restJson1CallingRegionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1CapabilityList = (input: (Capability | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ChannelRetentionSettings = ( @@ -26207,7 +26105,7 @@ const serializeAws_restJson1ChannelRetentionSettings = ( context: __SerdeContext ): any => { return { - ...(input.RetentionDays !== undefined && { RetentionDays: input.RetentionDays }), + ...(input.RetentionDays !== undefined && input.RetentionDays !== null && { RetentionDays: input.RetentionDays }), }; }; @@ -26216,12 +26114,19 @@ const serializeAws_restJson1ConversationRetentionSettings = ( context: __SerdeContext ): any => { return { - ...(input.RetentionDays !== undefined && { RetentionDays: input.RetentionDays }), + ...(input.RetentionDays !== undefined && input.RetentionDays !== null && { RetentionDays: input.RetentionDays }), }; }; const serializeAws_restJson1CountryList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1CreateAttendeeRequestItem = ( @@ -26229,8 +26134,10 @@ const serializeAws_restJson1CreateAttendeeRequestItem = ( context: __SerdeContext ): any => { return { - ...(input.ExternalUserId !== undefined && { ExternalUserId: input.ExternalUserId }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1AttendeeTagList(input.Tags, context) }), + ...(input.ExternalUserId !== undefined && + input.ExternalUserId !== null && { ExternalUserId: input.ExternalUserId }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1AttendeeTagList(input.Tags, context) }), }; }; @@ -26238,25 +26145,46 @@ const serializeAws_restJson1CreateAttendeeRequestItemList = ( input: CreateAttendeeRequestItem[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CreateAttendeeRequestItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CreateAttendeeRequestItem(entry, context); + }); }; const serializeAws_restJson1CreateMeetingWithAttendeesRequestItemList = ( input: CreateAttendeeRequestItem[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CreateAttendeeRequestItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CreateAttendeeRequestItem(entry, context); + }); }; const serializeAws_restJson1Credential = (input: Credential, context: __SerdeContext): any => { return { - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_restJson1CredentialList = (input: Credential[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Credential(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Credential(entry, context); + }); }; const serializeAws_restJson1DNISEmergencyCallingConfiguration = ( @@ -26264,9 +26192,12 @@ const serializeAws_restJson1DNISEmergencyCallingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CallingCountry !== undefined && { CallingCountry: input.CallingCountry }), - ...(input.EmergencyPhoneNumber !== undefined && { EmergencyPhoneNumber: input.EmergencyPhoneNumber }), - ...(input.TestPhoneNumber !== undefined && { TestPhoneNumber: input.TestPhoneNumber }), + ...(input.CallingCountry !== undefined && + input.CallingCountry !== null && { CallingCountry: input.CallingCountry }), + ...(input.EmergencyPhoneNumber !== undefined && + input.EmergencyPhoneNumber !== null && { EmergencyPhoneNumber: input.EmergencyPhoneNumber }), + ...(input.TestPhoneNumber !== undefined && + input.TestPhoneNumber !== null && { TestPhoneNumber: input.TestPhoneNumber }), }; }; @@ -26274,11 +26205,25 @@ const serializeAws_restJson1DNISEmergencyCallingConfigurationList = ( input: DNISEmergencyCallingConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DNISEmergencyCallingConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DNISEmergencyCallingConfiguration(entry, context); + }); }; const serializeAws_restJson1E164PhoneNumberList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1EmergencyCallingConfiguration = ( @@ -26286,22 +26231,23 @@ const serializeAws_restJson1EmergencyCallingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DNIS !== undefined && { - DNIS: serializeAws_restJson1DNISEmergencyCallingConfigurationList(input.DNIS, context), - }), + ...(input.DNIS !== undefined && + input.DNIS !== null && { + DNIS: serializeAws_restJson1DNISEmergencyCallingConfigurationList(input.DNIS, context), + }), }; }; const serializeAws_restJson1GeoMatchParams = (input: GeoMatchParams, context: __SerdeContext): any => { return { - ...(input.AreaCode !== undefined && { AreaCode: input.AreaCode }), - ...(input.Country !== undefined && { Country: input.Country }), + ...(input.AreaCode !== undefined && input.AreaCode !== null && { AreaCode: input.AreaCode }), + ...(input.Country !== undefined && input.Country !== null && { Country: input.Country }), }; }; const serializeAws_restJson1LoggingConfiguration = (input: LoggingConfiguration, context: __SerdeContext): any => { return { - ...(input.EnableSIPLogs !== undefined && { EnableSIPLogs: input.EnableSIPLogs }), + ...(input.EnableSIPLogs !== undefined && input.EnableSIPLogs !== null && { EnableSIPLogs: input.EnableSIPLogs }), }; }; @@ -26310,91 +26256,150 @@ const serializeAws_restJson1MeetingNotificationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), - ...(input.SqsQueueArn !== undefined && { SqsQueueArn: input.SqsQueueArn }), + ...(input.SnsTopicArn !== undefined && input.SnsTopicArn !== null && { SnsTopicArn: input.SnsTopicArn }), + ...(input.SqsQueueArn !== undefined && input.SqsQueueArn !== null && { SqsQueueArn: input.SqsQueueArn }), }; }; const serializeAws_restJson1MeetingTagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1MeetingTagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1MembershipItem = (input: MembershipItem, context: __SerdeContext): any => { return { - ...(input.MemberId !== undefined && { MemberId: input.MemberId }), - ...(input.Role !== undefined && { Role: input.Role }), + ...(input.MemberId !== undefined && input.MemberId !== null && { MemberId: input.MemberId }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), }; }; const serializeAws_restJson1MembershipItemList = (input: MembershipItem[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1MembershipItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MembershipItem(entry, context); + }); }; const serializeAws_restJson1NonEmptyStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Origination = (input: Origination, context: __SerdeContext): any => { return { - ...(input.Disabled !== undefined && { Disabled: input.Disabled }), - ...(input.Routes !== undefined && { Routes: serializeAws_restJson1OriginationRouteList(input.Routes, context) }), + ...(input.Disabled !== undefined && input.Disabled !== null && { Disabled: input.Disabled }), + ...(input.Routes !== undefined && + input.Routes !== null && { Routes: serializeAws_restJson1OriginationRouteList(input.Routes, context) }), }; }; const serializeAws_restJson1OriginationRoute = (input: OriginationRoute, context: __SerdeContext): any => { return { - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), - ...(input.Weight !== undefined && { Weight: input.Weight }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), + ...(input.Weight !== undefined && input.Weight !== null && { Weight: input.Weight }), }; }; const serializeAws_restJson1OriginationRouteList = (input: OriginationRoute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1OriginationRoute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1OriginationRoute(entry, context); + }); }; const serializeAws_restJson1ParticipantPhoneNumberList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1RetentionSettings = (input: RetentionSettings, context: __SerdeContext): any => { return { - ...(input.ConversationRetentionSettings !== undefined && { - ConversationRetentionSettings: serializeAws_restJson1ConversationRetentionSettings( - input.ConversationRetentionSettings, - context - ), - }), - ...(input.RoomRetentionSettings !== undefined && { - RoomRetentionSettings: serializeAws_restJson1RoomRetentionSettings(input.RoomRetentionSettings, context), - }), + ...(input.ConversationRetentionSettings !== undefined && + input.ConversationRetentionSettings !== null && { + ConversationRetentionSettings: serializeAws_restJson1ConversationRetentionSettings( + input.ConversationRetentionSettings, + context + ), + }), + ...(input.RoomRetentionSettings !== undefined && + input.RoomRetentionSettings !== null && { + RoomRetentionSettings: serializeAws_restJson1RoomRetentionSettings(input.RoomRetentionSettings, context), + }), }; }; const serializeAws_restJson1RoomRetentionSettings = (input: RoomRetentionSettings, context: __SerdeContext): any => { return { - ...(input.RetentionDays !== undefined && { RetentionDays: input.RetentionDays }), + ...(input.RetentionDays !== undefined && input.RetentionDays !== null && { RetentionDays: input.RetentionDays }), }; }; const serializeAws_restJson1SensitiveStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SigninDelegateGroup = (input: SigninDelegateGroup, context: __SerdeContext): any => { return { - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), }; }; const serializeAws_restJson1SigninDelegateGroupList = (input: SigninDelegateGroup[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SigninDelegateGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SigninDelegateGroup(entry, context); + }); }; const serializeAws_restJson1SipMediaApplicationEndpoint = ( @@ -26402,7 +26407,7 @@ const serializeAws_restJson1SipMediaApplicationEndpoint = ( context: __SerdeContext ): any => { return { - ...(input.LambdaArn !== undefined && { LambdaArn: input.LambdaArn }), + ...(input.LambdaArn !== undefined && input.LambdaArn !== null && { LambdaArn: input.LambdaArn }), }; }; @@ -26410,7 +26415,14 @@ const serializeAws_restJson1SipMediaApplicationEndpointList = ( input: SipMediaApplicationEndpoint[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SipMediaApplicationEndpoint(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SipMediaApplicationEndpoint(entry, context); + }); }; const serializeAws_restJson1SipMediaApplicationLoggingConfiguration = ( @@ -26418,9 +26430,10 @@ const serializeAws_restJson1SipMediaApplicationLoggingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.EnableSipMediaApplicationMessageLogs !== undefined && { - EnableSipMediaApplicationMessageLogs: input.EnableSipMediaApplicationMessageLogs, - }), + ...(input.EnableSipMediaApplicationMessageLogs !== undefined && + input.EnableSipMediaApplicationMessageLogs !== null && { + EnableSipMediaApplicationMessageLogs: input.EnableSipMediaApplicationMessageLogs, + }), }; }; @@ -26429,9 +26442,10 @@ const serializeAws_restJson1SipRuleTargetApplication = ( context: __SerdeContext ): any => { return { - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.SipMediaApplicationId !== undefined && { SipMediaApplicationId: input.SipMediaApplicationId }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.SipMediaApplicationId !== undefined && + input.SipMediaApplicationId !== null && { SipMediaApplicationId: input.SipMediaApplicationId }), }; }; @@ -26439,19 +26453,28 @@ const serializeAws_restJson1SipRuleTargetApplicationList = ( input: SipRuleTargetApplication[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SipRuleTargetApplication(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SipRuleTargetApplication(entry, context); + }); }; const serializeAws_restJson1StreamingConfiguration = (input: StreamingConfiguration, context: __SerdeContext): any => { return { - ...(input.DataRetentionInHours !== undefined && { DataRetentionInHours: input.DataRetentionInHours }), - ...(input.Disabled !== undefined && { Disabled: input.Disabled }), - ...(input.StreamingNotificationTargets !== undefined && { - StreamingNotificationTargets: serializeAws_restJson1StreamingNotificationTargetList( - input.StreamingNotificationTargets, - context - ), - }), + ...(input.DataRetentionInHours !== undefined && + input.DataRetentionInHours !== null && { DataRetentionInHours: input.DataRetentionInHours }), + ...(input.Disabled !== undefined && input.Disabled !== null && { Disabled: input.Disabled }), + ...(input.StreamingNotificationTargets !== undefined && + input.StreamingNotificationTargets !== null && { + StreamingNotificationTargets: serializeAws_restJson1StreamingNotificationTargetList( + input.StreamingNotificationTargets, + context + ), + }), }; }; @@ -26460,7 +26483,8 @@ const serializeAws_restJson1StreamingNotificationTarget = ( context: __SerdeContext ): any => { return { - ...(input.NotificationTarget !== undefined && { NotificationTarget: input.NotificationTarget }), + ...(input.NotificationTarget !== undefined && + input.NotificationTarget !== null && { NotificationTarget: input.NotificationTarget }), }; }; @@ -26468,47 +26492,80 @@ const serializeAws_restJson1StreamingNotificationTargetList = ( input: StreamingNotificationTarget[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1StreamingNotificationTarget(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1StreamingNotificationTarget(entry, context); + }); }; const serializeAws_restJson1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TelephonySettings = (input: TelephonySettings, context: __SerdeContext): any => { return { - ...(input.InboundCalling !== undefined && { InboundCalling: input.InboundCalling }), - ...(input.OutboundCalling !== undefined && { OutboundCalling: input.OutboundCalling }), - ...(input.SMS !== undefined && { SMS: input.SMS }), + ...(input.InboundCalling !== undefined && + input.InboundCalling !== null && { InboundCalling: input.InboundCalling }), + ...(input.OutboundCalling !== undefined && + input.OutboundCalling !== null && { OutboundCalling: input.OutboundCalling }), + ...(input.SMS !== undefined && input.SMS !== null && { SMS: input.SMS }), }; }; const serializeAws_restJson1Termination = (input: Termination, context: __SerdeContext): any => { return { - ...(input.CallingRegions !== undefined && { - CallingRegions: serializeAws_restJson1CallingRegionList(input.CallingRegions, context), - }), - ...(input.CidrAllowedList !== undefined && { - CidrAllowedList: serializeAws_restJson1StringList(input.CidrAllowedList, context), - }), - ...(input.CpsLimit !== undefined && { CpsLimit: input.CpsLimit }), - ...(input.DefaultPhoneNumber !== undefined && { DefaultPhoneNumber: input.DefaultPhoneNumber }), - ...(input.Disabled !== undefined && { Disabled: input.Disabled }), + ...(input.CallingRegions !== undefined && + input.CallingRegions !== null && { + CallingRegions: serializeAws_restJson1CallingRegionList(input.CallingRegions, context), + }), + ...(input.CidrAllowedList !== undefined && + input.CidrAllowedList !== null && { + CidrAllowedList: serializeAws_restJson1StringList(input.CidrAllowedList, context), + }), + ...(input.CpsLimit !== undefined && input.CpsLimit !== null && { CpsLimit: input.CpsLimit }), + ...(input.DefaultPhoneNumber !== undefined && + input.DefaultPhoneNumber !== null && { DefaultPhoneNumber: input.DefaultPhoneNumber }), + ...(input.Disabled !== undefined && input.Disabled !== null && { Disabled: input.Disabled }), }; }; @@ -26517,9 +26574,9 @@ const serializeAws_restJson1UpdatePhoneNumberRequestItem = ( context: __SerdeContext ): any => { return { - ...(input.CallingName !== undefined && { CallingName: input.CallingName }), - ...(input.PhoneNumberId !== undefined && { PhoneNumberId: input.PhoneNumberId }), - ...(input.ProductType !== undefined && { ProductType: input.ProductType }), + ...(input.CallingName !== undefined && input.CallingName !== null && { CallingName: input.CallingName }), + ...(input.PhoneNumberId !== undefined && input.PhoneNumberId !== null && { PhoneNumberId: input.PhoneNumberId }), + ...(input.ProductType !== undefined && input.ProductType !== null && { ProductType: input.ProductType }), }; }; @@ -26527,17 +26584,28 @@ const serializeAws_restJson1UpdatePhoneNumberRequestItemList = ( input: UpdatePhoneNumberRequestItem[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1UpdatePhoneNumberRequestItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1UpdatePhoneNumberRequestItem(entry, context); + }); }; const serializeAws_restJson1UpdateUserRequestItem = (input: UpdateUserRequestItem, context: __SerdeContext): any => { return { - ...(input.AlexaForBusinessMetadata !== undefined && { - AlexaForBusinessMetadata: serializeAws_restJson1AlexaForBusinessMetadata(input.AlexaForBusinessMetadata, context), - }), - ...(input.LicenseType !== undefined && { LicenseType: input.LicenseType }), - ...(input.UserId !== undefined && { UserId: input.UserId }), - ...(input.UserType !== undefined && { UserType: input.UserType }), + ...(input.AlexaForBusinessMetadata !== undefined && + input.AlexaForBusinessMetadata !== null && { + AlexaForBusinessMetadata: serializeAws_restJson1AlexaForBusinessMetadata( + input.AlexaForBusinessMetadata, + context + ), + }), + ...(input.LicenseType !== undefined && input.LicenseType !== null && { LicenseType: input.LicenseType }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), + ...(input.UserType !== undefined && input.UserType !== null && { UserType: input.UserType }), }; }; @@ -26545,39 +26613,67 @@ const serializeAws_restJson1UpdateUserRequestItemList = ( input: UpdateUserRequestItem[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1UpdateUserRequestItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1UpdateUserRequestItem(entry, context); + }); }; const serializeAws_restJson1UserEmailList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1UserIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1UserSettings = (input: UserSettings, context: __SerdeContext): any => { return { - ...(input.Telephony !== undefined && { - Telephony: serializeAws_restJson1TelephonySettings(input.Telephony, context), - }), + ...(input.Telephony !== undefined && + input.Telephony !== null && { Telephony: serializeAws_restJson1TelephonySettings(input.Telephony, context) }), }; }; const serializeAws_restJson1VoiceConnectorItem = (input: VoiceConnectorItem, context: __SerdeContext): any => { return { - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.VoiceConnectorId !== undefined && { VoiceConnectorId: input.VoiceConnectorId }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.VoiceConnectorId !== undefined && + input.VoiceConnectorId !== null && { VoiceConnectorId: input.VoiceConnectorId }), }; }; const serializeAws_restJson1VoiceConnectorItemList = (input: VoiceConnectorItem[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1VoiceConnectorItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1VoiceConnectorItem(entry, context); + }); }; const serializeAws_restJson1VoiceConnectorSettings = (input: VoiceConnectorSettings, context: __SerdeContext): any => { return { - ...(input.CdrBucket !== undefined && { CdrBucket: input.CdrBucket }), + ...(input.CdrBucket !== undefined && input.CdrBucket !== null && { CdrBucket: input.CdrBucket }), }; }; @@ -26605,7 +26701,14 @@ const deserializeAws_restJson1Account = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1AccountList = (output: any, context: __SerdeContext): Account[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Account(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Account(entry, context); + }); }; const deserializeAws_restJson1AccountSettings = (output: any, context: __SerdeContext): AccountSettings => { @@ -26671,7 +26774,14 @@ const deserializeAws_restJson1AppInstanceAdminList = ( output: any, context: __SerdeContext ): AppInstanceAdminSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AppInstanceAdminSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AppInstanceAdminSummary(entry, context); + }); }; const deserializeAws_restJson1AppInstanceAdminSummary = ( @@ -26687,7 +26797,14 @@ const deserializeAws_restJson1AppInstanceAdminSummary = ( }; const deserializeAws_restJson1AppInstanceList = (output: any, context: __SerdeContext): AppInstanceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AppInstanceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AppInstanceSummary(entry, context); + }); }; const deserializeAws_restJson1AppInstanceRetentionSettings = ( @@ -26719,7 +26836,14 @@ const deserializeAws_restJson1AppInstanceStreamingConfigurationList = ( output: any, context: __SerdeContext ): AppInstanceStreamingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AppInstanceStreamingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AppInstanceStreamingConfiguration(entry, context); + }); }; const deserializeAws_restJson1AppInstanceSummary = (output: any, context: __SerdeContext): AppInstanceSummary => { @@ -26754,7 +26878,14 @@ const deserializeAws_restJson1AppInstanceUserList = ( output: any, context: __SerdeContext ): AppInstanceUserSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AppInstanceUserSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AppInstanceUserSummary(entry, context); + }); }; const deserializeAws_restJson1AppInstanceUserMembershipSummary = ( @@ -26794,14 +26925,28 @@ const deserializeAws_restJson1Attendee = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1AttendeeList = (output: any, context: __SerdeContext): Attendee[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Attendee(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Attendee(entry, context); + }); }; const deserializeAws_restJson1BatchCreateAttendeeErrorList = ( output: any, context: __SerdeContext ): CreateAttendeeError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CreateAttendeeError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CreateAttendeeError(entry, context); + }); }; const deserializeAws_restJson1Bot = (output: any, context: __SerdeContext): Bot => { @@ -26826,7 +26971,14 @@ const deserializeAws_restJson1Bot = (output: any, context: __SerdeContext): Bot }; const deserializeAws_restJson1BotList = (output: any, context: __SerdeContext): Bot[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Bot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Bot(entry, context); + }); }; const deserializeAws_restJson1BusinessCallingSettings = ( @@ -26839,11 +26991,25 @@ const deserializeAws_restJson1BusinessCallingSettings = ( }; const deserializeAws_restJson1CallingRegionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1CapabilityList = (output: any, context: __SerdeContext): (Capability | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Channel = (output: any, context: __SerdeContext): Channel => { @@ -26900,7 +27066,14 @@ const deserializeAws_restJson1ChannelBanSummary = (output: any, context: __Serde }; const deserializeAws_restJson1ChannelBanSummaryList = (output: any, context: __SerdeContext): ChannelBanSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelBanSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelBanSummary(entry, context); + }); }; const deserializeAws_restJson1ChannelMembership = (output: any, context: __SerdeContext): ChannelMembership => { @@ -26946,9 +27119,14 @@ const deserializeAws_restJson1ChannelMembershipForAppInstanceUserSummaryList = ( output: any, context: __SerdeContext ): ChannelMembershipForAppInstanceUserSummary[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1ChannelMembershipForAppInstanceUserSummary(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelMembershipForAppInstanceUserSummary(entry, context); + }); }; const deserializeAws_restJson1ChannelMembershipSummary = ( @@ -26967,7 +27145,14 @@ const deserializeAws_restJson1ChannelMembershipSummaryList = ( output: any, context: __SerdeContext ): ChannelMembershipSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelMembershipSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelMembershipSummary(entry, context); + }); }; const deserializeAws_restJson1ChannelMessage = (output: any, context: __SerdeContext): ChannelMessage => { @@ -27028,7 +27213,14 @@ const deserializeAws_restJson1ChannelMessageSummaryList = ( output: any, context: __SerdeContext ): ChannelMessageSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelMessageSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelMessageSummary(entry, context); + }); }; const deserializeAws_restJson1ChannelModeratedByAppInstanceUserSummary = ( @@ -27047,9 +27239,14 @@ const deserializeAws_restJson1ChannelModeratedByAppInstanceUserSummaryList = ( output: any, context: __SerdeContext ): ChannelModeratedByAppInstanceUserSummary[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1ChannelModeratedByAppInstanceUserSummary(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelModeratedByAppInstanceUserSummary(entry, context); + }); }; const deserializeAws_restJson1ChannelModerator = (output: any, context: __SerdeContext): ChannelModerator => { @@ -27086,7 +27283,14 @@ const deserializeAws_restJson1ChannelModeratorSummaryList = ( output: any, context: __SerdeContext ): ChannelModeratorSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelModeratorSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelModeratorSummary(entry, context); + }); }; const deserializeAws_restJson1ChannelRetentionSettings = ( @@ -27114,7 +27318,14 @@ const deserializeAws_restJson1ChannelSummary = (output: any, context: __SerdeCon }; const deserializeAws_restJson1ChannelSummaryList = (output: any, context: __SerdeContext): ChannelSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelSummary(entry, context); + }); }; const deserializeAws_restJson1ConversationRetentionSettings = ( @@ -27156,11 +27367,25 @@ const deserializeAws_restJson1DNISEmergencyCallingConfigurationList = ( output: any, context: __SerdeContext ): DNISEmergencyCallingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DNISEmergencyCallingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DNISEmergencyCallingConfiguration(entry, context); + }); }; const deserializeAws_restJson1E164PhoneNumberList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1EmergencyCallingConfiguration = ( @@ -27213,11 +27438,25 @@ const deserializeAws_restJson1Invite = (output: any, context: __SerdeContext): I }; const deserializeAws_restJson1InviteList = (output: any, context: __SerdeContext): Invite[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Invite(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Invite(entry, context); + }); }; const deserializeAws_restJson1LicenseList = (output: any, context: __SerdeContext): (License | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1LoggingConfiguration = (output: any, context: __SerdeContext): LoggingConfiguration => { @@ -27260,7 +27499,14 @@ const deserializeAws_restJson1Meeting = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1MeetingList = (output: any, context: __SerdeContext): Meeting[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Meeting(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Meeting(entry, context); + }); }; const deserializeAws_restJson1Member = (output: any, context: __SerdeContext): Member => { @@ -27282,7 +27528,14 @@ const deserializeAws_restJson1MemberError = (output: any, context: __SerdeContex }; const deserializeAws_restJson1MemberErrorList = (output: any, context: __SerdeContext): MemberError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MemberError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MemberError(entry, context); + }); }; const deserializeAws_restJson1MessagingSessionEndpoint = ( @@ -27303,7 +27556,14 @@ const deserializeAws_restJson1OrderedPhoneNumber = (output: any, context: __Serd }; const deserializeAws_restJson1OrderedPhoneNumberList = (output: any, context: __SerdeContext): OrderedPhoneNumber[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OrderedPhoneNumber(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OrderedPhoneNumber(entry, context); + }); }; const deserializeAws_restJson1Origination = (output: any, context: __SerdeContext): Origination => { @@ -27327,7 +27587,14 @@ const deserializeAws_restJson1OriginationRoute = (output: any, context: __SerdeC }; const deserializeAws_restJson1OriginationRouteList = (output: any, context: __SerdeContext): OriginationRoute[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OriginationRoute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OriginationRoute(entry, context); + }); }; const deserializeAws_restJson1Participant = (output: any, context: __SerdeContext): Participant => { @@ -27339,7 +27606,14 @@ const deserializeAws_restJson1Participant = (output: any, context: __SerdeContex }; const deserializeAws_restJson1Participants = (output: any, context: __SerdeContext): Participant[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Participant(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Participant(entry, context); + }); }; const deserializeAws_restJson1PhoneNumber = (output: any, context: __SerdeContext): PhoneNumber => { @@ -27397,7 +27671,14 @@ const deserializeAws_restJson1PhoneNumberAssociationList = ( output: any, context: __SerdeContext ): PhoneNumberAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PhoneNumberAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PhoneNumberAssociation(entry, context); + }); }; const deserializeAws_restJson1PhoneNumberCapabilities = ( @@ -27424,11 +27705,25 @@ const deserializeAws_restJson1PhoneNumberError = (output: any, context: __SerdeC }; const deserializeAws_restJson1PhoneNumberErrorList = (output: any, context: __SerdeContext): PhoneNumberError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PhoneNumberError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PhoneNumberError(entry, context); + }); }; const deserializeAws_restJson1PhoneNumberList = (output: any, context: __SerdeContext): PhoneNumber[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PhoneNumber(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PhoneNumber(entry, context); + }); }; const deserializeAws_restJson1PhoneNumberOrder = (output: any, context: __SerdeContext): PhoneNumberOrder => { @@ -27455,7 +27750,14 @@ const deserializeAws_restJson1PhoneNumberOrder = (output: any, context: __SerdeC }; const deserializeAws_restJson1PhoneNumberOrderList = (output: any, context: __SerdeContext): PhoneNumberOrder[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PhoneNumberOrder(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PhoneNumberOrder(entry, context); + }); }; const deserializeAws_restJson1Proxy = (output: any, context: __SerdeContext): Proxy => { @@ -27520,7 +27822,14 @@ const deserializeAws_restJson1ProxySession = (output: any, context: __SerdeConte }; const deserializeAws_restJson1ProxySessions = (output: any, context: __SerdeContext): ProxySession[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProxySession(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProxySession(entry, context); + }); }; const deserializeAws_restJson1RetentionSettings = (output: any, context: __SerdeContext): RetentionSettings => { @@ -27554,7 +27863,14 @@ const deserializeAws_restJson1Room = (output: any, context: __SerdeContext): Roo }; const deserializeAws_restJson1RoomList = (output: any, context: __SerdeContext): Room[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Room(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Room(entry, context); + }); }; const deserializeAws_restJson1RoomMembership = (output: any, context: __SerdeContext): RoomMembership => { @@ -27574,7 +27890,14 @@ const deserializeAws_restJson1RoomMembership = (output: any, context: __SerdeCon }; const deserializeAws_restJson1RoomMembershipList = (output: any, context: __SerdeContext): RoomMembership[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RoomMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RoomMembership(entry, context); + }); }; const deserializeAws_restJson1RoomRetentionSettings = (output: any, context: __SerdeContext): RoomRetentionSettings => { @@ -27585,7 +27908,14 @@ const deserializeAws_restJson1RoomRetentionSettings = (output: any, context: __S }; const deserializeAws_restJson1SensitiveStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SigninDelegateGroup = (output: any, context: __SerdeContext): SigninDelegateGroup => { @@ -27598,7 +27928,14 @@ const deserializeAws_restJson1SigninDelegateGroupList = ( output: any, context: __SerdeContext ): SigninDelegateGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SigninDelegateGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SigninDelegateGroup(entry, context); + }); }; const deserializeAws_restJson1SipMediaApplication = (output: any, context: __SerdeContext): SipMediaApplication => { @@ -27647,14 +27984,28 @@ const deserializeAws_restJson1SipMediaApplicationEndpointList = ( output: any, context: __SerdeContext ): SipMediaApplicationEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SipMediaApplicationEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SipMediaApplicationEndpoint(entry, context); + }); }; const deserializeAws_restJson1SipMediaApplicationList = ( output: any, context: __SerdeContext ): SipMediaApplication[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SipMediaApplication(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SipMediaApplication(entry, context); + }); }; const deserializeAws_restJson1SipMediaApplicationLoggingConfiguration = ( @@ -27692,7 +28043,14 @@ const deserializeAws_restJson1SipRule = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1SipRuleList = (output: any, context: __SerdeContext): SipRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SipRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SipRule(entry, context); + }); }; const deserializeAws_restJson1SipRuleTargetApplication = ( @@ -27713,7 +28071,14 @@ const deserializeAws_restJson1SipRuleTargetApplicationList = ( output: any, context: __SerdeContext ): SipRuleTargetApplication[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SipRuleTargetApplication(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SipRuleTargetApplication(entry, context); + }); }; const deserializeAws_restJson1StreamingConfiguration = ( @@ -27749,11 +28114,25 @@ const deserializeAws_restJson1StreamingNotificationTargetList = ( output: any, context: __SerdeContext ): StreamingNotificationTarget[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StreamingNotificationTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StreamingNotificationTarget(entry, context); + }); }; const deserializeAws_restJson1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -27764,7 +28143,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TelephonySettings = (output: any, context: __SerdeContext): TelephonySettings => { @@ -27843,11 +28229,25 @@ const deserializeAws_restJson1UserError = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1UserErrorList = (output: any, context: __SerdeContext): UserError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UserError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UserError(entry, context); + }); }; const deserializeAws_restJson1UserList = (output: any, context: __SerdeContext): User[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1User(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1User(entry, context); + }); }; const deserializeAws_restJson1UserSettings = (output: any, context: __SerdeContext): UserSettings => { @@ -27908,7 +28308,14 @@ const deserializeAws_restJson1VoiceConnectorGroupList = ( output: any, context: __SerdeContext ): VoiceConnectorGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VoiceConnectorGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VoiceConnectorGroup(entry, context); + }); }; const deserializeAws_restJson1VoiceConnectorItem = (output: any, context: __SerdeContext): VoiceConnectorItem => { @@ -27920,11 +28327,25 @@ const deserializeAws_restJson1VoiceConnectorItem = (output: any, context: __Serd }; const deserializeAws_restJson1VoiceConnectorItemList = (output: any, context: __SerdeContext): VoiceConnectorItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VoiceConnectorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VoiceConnectorItem(entry, context); + }); }; const deserializeAws_restJson1VoiceConnectorList = (output: any, context: __SerdeContext): VoiceConnector[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VoiceConnector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VoiceConnector(entry, context); + }); }; const deserializeAws_restJson1VoiceConnectorSettings = ( @@ -27956,6 +28377,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-cloud9/protocols/Aws_json1_1.ts b/clients/client-cloud9/protocols/Aws_json1_1.ts index acdf7f1b508a..ddf573cb9ecb 100644 --- a/clients/client-cloud9/protocols/Aws_json1_1.ts +++ b/clients/client-cloud9/protocols/Aws_json1_1.ts @@ -91,7 +91,7 @@ export const serializeAws_json1_1CreateEnvironmentEC2Command = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.CreateEnvironmentEC2", }; let body: any; @@ -104,7 +104,7 @@ export const serializeAws_json1_1CreateEnvironmentMembershipCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.CreateEnvironmentMembership", }; let body: any; @@ -117,7 +117,7 @@ export const serializeAws_json1_1DeleteEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.DeleteEnvironment", }; let body: any; @@ -130,7 +130,7 @@ export const serializeAws_json1_1DeleteEnvironmentMembershipCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.DeleteEnvironmentMembership", }; let body: any; @@ -143,7 +143,7 @@ export const serializeAws_json1_1DescribeEnvironmentMembershipsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.DescribeEnvironmentMemberships", }; let body: any; @@ -156,7 +156,7 @@ export const serializeAws_json1_1DescribeEnvironmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.DescribeEnvironments", }; let body: any; @@ -169,7 +169,7 @@ export const serializeAws_json1_1DescribeEnvironmentStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.DescribeEnvironmentStatus", }; let body: any; @@ -182,7 +182,7 @@ export const serializeAws_json1_1ListEnvironmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.ListEnvironments", }; let body: any; @@ -195,7 +195,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.ListTagsForResource", }; let body: any; @@ -208,7 +208,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.TagResource", }; let body: any; @@ -221,7 +221,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.UntagResource", }; let body: any; @@ -234,7 +234,7 @@ export const serializeAws_json1_1UpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.UpdateEnvironment", }; let body: any; @@ -247,7 +247,7 @@ export const serializeAws_json1_1UpdateEnvironmentMembershipCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCloud9WorkspaceManagementService.UpdateEnvironmentMembership", }; let body: any; @@ -282,8 +282,7 @@ const deserializeAws_json1_1CreateEnvironmentEC2CommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -385,8 +384,7 @@ const deserializeAws_json1_1CreateEnvironmentMembershipCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -488,8 +486,7 @@ const deserializeAws_json1_1DeleteEnvironmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -591,8 +588,7 @@ const deserializeAws_json1_1DeleteEnvironmentMembershipCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -694,8 +690,7 @@ const deserializeAws_json1_1DescribeEnvironmentMembershipsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -797,8 +792,7 @@ const deserializeAws_json1_1DescribeEnvironmentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -900,8 +894,7 @@ const deserializeAws_json1_1DescribeEnvironmentStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -1003,8 +996,7 @@ const deserializeAws_json1_1ListEnvironmentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -1106,8 +1098,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -1177,8 +1168,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -1256,8 +1246,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -1335,8 +1324,7 @@ const deserializeAws_json1_1UpdateEnvironmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -1438,8 +1426,7 @@ const deserializeAws_json1_1UpdateEnvironmentMembershipCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.cloud9#BadRequestException": @@ -1635,7 +1622,14 @@ const deserializeAws_json1_1TooManyRequestsExceptionResponse = async ( }; const serializeAws_json1_1BoundedEnvironmentIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateEnvironmentEC2Request = ( @@ -1643,15 +1637,18 @@ const serializeAws_json1_1CreateEnvironmentEC2Request = ( context: __SerdeContext ): any => { return { - ...(input.automaticStopTimeMinutes !== undefined && { automaticStopTimeMinutes: input.automaticStopTimeMinutes }), - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.connectionType !== undefined && { connectionType: input.connectionType }), - ...(input.description !== undefined && { description: input.description }), - ...(input.instanceType !== undefined && { instanceType: input.instanceType }), - ...(input.name !== undefined && { name: input.name }), - ...(input.ownerArn !== undefined && { ownerArn: input.ownerArn }), - ...(input.subnetId !== undefined && { subnetId: input.subnetId }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.automaticStopTimeMinutes !== undefined && + input.automaticStopTimeMinutes !== null && { automaticStopTimeMinutes: input.automaticStopTimeMinutes }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.connectionType !== undefined && + input.connectionType !== null && { connectionType: input.connectionType }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.instanceType !== undefined && input.instanceType !== null && { instanceType: input.instanceType }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.ownerArn !== undefined && input.ownerArn !== null && { ownerArn: input.ownerArn }), + ...(input.subnetId !== undefined && input.subnetId !== null && { subnetId: input.subnetId }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -1660,9 +1657,9 @@ const serializeAws_json1_1CreateEnvironmentMembershipRequest = ( context: __SerdeContext ): any => { return { - ...(input.environmentId !== undefined && { environmentId: input.environmentId }), - ...(input.permissions !== undefined && { permissions: input.permissions }), - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.environmentId !== undefined && input.environmentId !== null && { environmentId: input.environmentId }), + ...(input.permissions !== undefined && input.permissions !== null && { permissions: input.permissions }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; @@ -1671,8 +1668,8 @@ const serializeAws_json1_1DeleteEnvironmentMembershipRequest = ( context: __SerdeContext ): any => { return { - ...(input.environmentId !== undefined && { environmentId: input.environmentId }), - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.environmentId !== undefined && input.environmentId !== null && { environmentId: input.environmentId }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; @@ -1681,7 +1678,7 @@ const serializeAws_json1_1DeleteEnvironmentRequest = ( context: __SerdeContext ): any => { return { - ...(input.environmentId !== undefined && { environmentId: input.environmentId }), + ...(input.environmentId !== undefined && input.environmentId !== null && { environmentId: input.environmentId }), }; }; @@ -1690,13 +1687,12 @@ const serializeAws_json1_1DescribeEnvironmentMembershipsRequest = ( context: __SerdeContext ): any => { return { - ...(input.environmentId !== undefined && { environmentId: input.environmentId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.permissions !== undefined && { - permissions: serializeAws_json1_1PermissionsList(input.permissions, context), - }), - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.environmentId !== undefined && input.environmentId !== null && { environmentId: input.environmentId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.permissions !== undefined && + input.permissions !== null && { permissions: serializeAws_json1_1PermissionsList(input.permissions, context) }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; @@ -1705,9 +1701,10 @@ const serializeAws_json1_1DescribeEnvironmentsRequest = ( context: __SerdeContext ): any => { return { - ...(input.environmentIds !== undefined && { - environmentIds: serializeAws_json1_1BoundedEnvironmentIdList(input.environmentIds, context), - }), + ...(input.environmentIds !== undefined && + input.environmentIds !== null && { + environmentIds: serializeAws_json1_1BoundedEnvironmentIdList(input.environmentIds, context), + }), }; }; @@ -1716,14 +1713,14 @@ const serializeAws_json1_1DescribeEnvironmentStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.environmentId !== undefined && { environmentId: input.environmentId }), + ...(input.environmentId !== undefined && input.environmentId !== null && { environmentId: input.environmentId }), }; }; const serializeAws_json1_1ListEnvironmentsRequest = (input: ListEnvironmentsRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -1732,40 +1729,62 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1PermissionsList = (input: (Permissions | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -1774,9 +1793,9 @@ const serializeAws_json1_1UpdateEnvironmentMembershipRequest = ( context: __SerdeContext ): any => { return { - ...(input.environmentId !== undefined && { environmentId: input.environmentId }), - ...(input.permissions !== undefined && { permissions: input.permissions }), - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.environmentId !== undefined && input.environmentId !== null && { environmentId: input.environmentId }), + ...(input.permissions !== undefined && input.permissions !== null && { permissions: input.permissions }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; @@ -1785,9 +1804,9 @@ const serializeAws_json1_1UpdateEnvironmentRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.environmentId !== undefined && { environmentId: input.environmentId }), - ...(input.name !== undefined && { name: input.name }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.environmentId !== undefined && input.environmentId !== null && { environmentId: input.environmentId }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -1907,7 +1926,14 @@ const deserializeAws_json1_1Environment = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1EnvironmentIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1EnvironmentLifecycle = (output: any, context: __SerdeContext): EnvironmentLifecycle => { @@ -1920,7 +1946,14 @@ const deserializeAws_json1_1EnvironmentLifecycle = (output: any, context: __Serd }; const deserializeAws_json1_1EnvironmentList = (output: any, context: __SerdeContext): Environment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Environment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Environment(entry, context); + }); }; const deserializeAws_json1_1EnvironmentMember = (output: any, context: __SerdeContext): EnvironmentMember => { @@ -1938,7 +1971,14 @@ const deserializeAws_json1_1EnvironmentMember = (output: any, context: __SerdeCo }; const deserializeAws_json1_1EnvironmentMembersList = (output: any, context: __SerdeContext): EnvironmentMember[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EnvironmentMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EnvironmentMember(entry, context); + }); }; const deserializeAws_json1_1ForbiddenException = (output: any, context: __SerdeContext): ForbiddenException => { @@ -2006,7 +2046,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -2097,3 +2144,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-clouddirectory/protocols/Aws_restJson1.ts b/clients/client-clouddirectory/protocols/Aws_restJson1.ts index c563534be2b0..7438eb49342f 100644 --- a/clients/client-clouddirectory/protocols/Aws_restJson1.ts +++ b/clients/client-clouddirectory/protocols/Aws_restJson1.ts @@ -288,21 +288,22 @@ export const serializeAws_restJson1AddFacetToObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/facets"; let body: any; body = JSON.stringify({ - ...(input.ObjectAttributeList !== undefined && { - ObjectAttributeList: serializeAws_restJson1AttributeKeyAndValueList(input.ObjectAttributeList, context), - }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.SchemaFacet !== undefined && { - SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context), - }), + ...(input.ObjectAttributeList !== undefined && + input.ObjectAttributeList !== null && { + ObjectAttributeList: serializeAws_restJson1AttributeKeyAndValueList(input.ObjectAttributeList, context), + }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.SchemaFacet !== undefined && + input.SchemaFacet !== null && { SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -321,13 +322,14 @@ export const serializeAws_restJson1ApplySchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/apply"; let body: any; body = JSON.stringify({ - ...(input.PublishedSchemaArn !== undefined && { PublishedSchemaArn: input.PublishedSchemaArn }), + ...(input.PublishedSchemaArn !== undefined && + input.PublishedSchemaArn !== null && { PublishedSchemaArn: input.PublishedSchemaArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -346,19 +348,21 @@ export const serializeAws_restJson1AttachObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/attach"; let body: any; body = JSON.stringify({ - ...(input.ChildReference !== undefined && { - ChildReference: serializeAws_restJson1ObjectReference(input.ChildReference, context), - }), - ...(input.LinkName !== undefined && { LinkName: input.LinkName }), - ...(input.ParentReference !== undefined && { - ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), - }), + ...(input.ChildReference !== undefined && + input.ChildReference !== null && { + ChildReference: serializeAws_restJson1ObjectReference(input.ChildReference, context), + }), + ...(input.LinkName !== undefined && input.LinkName !== null && { LinkName: input.LinkName }), + ...(input.ParentReference !== undefined && + input.ParentReference !== null && { + ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -377,18 +381,20 @@ export const serializeAws_restJson1AttachPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/policy/attach"; let body: any; body = JSON.stringify({ - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.PolicyReference !== undefined && { - PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.PolicyReference !== undefined && + input.PolicyReference !== null && { + PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -407,18 +413,20 @@ export const serializeAws_restJson1AttachToIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/index/attach"; let body: any; body = JSON.stringify({ - ...(input.IndexReference !== undefined && { - IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), - }), - ...(input.TargetReference !== undefined && { - TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), - }), + ...(input.IndexReference !== undefined && + input.IndexReference !== null && { + IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), + }), + ...(input.TargetReference !== undefined && + input.TargetReference !== null && { + TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -437,24 +445,28 @@ export const serializeAws_restJson1AttachTypedLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/attach"; let body: any; body = JSON.stringify({ - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1AttributeNameAndValueList(input.Attributes, context), - }), - ...(input.SourceObjectReference !== undefined && { - SourceObjectReference: serializeAws_restJson1ObjectReference(input.SourceObjectReference, context), - }), - ...(input.TargetObjectReference !== undefined && { - TargetObjectReference: serializeAws_restJson1ObjectReference(input.TargetObjectReference, context), - }), - ...(input.TypedLinkFacet !== undefined && { - TypedLinkFacet: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.TypedLinkFacet, context), - }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_restJson1AttributeNameAndValueList(input.Attributes, context), + }), + ...(input.SourceObjectReference !== undefined && + input.SourceObjectReference !== null && { + SourceObjectReference: serializeAws_restJson1ObjectReference(input.SourceObjectReference, context), + }), + ...(input.TargetObjectReference !== undefined && + input.TargetObjectReference !== null && { + TargetObjectReference: serializeAws_restJson1ObjectReference(input.TargetObjectReference, context), + }), + ...(input.TypedLinkFacet !== undefined && + input.TypedLinkFacet !== null && { + TypedLinkFacet: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.TypedLinkFacet, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -473,16 +485,17 @@ export const serializeAws_restJson1BatchReadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/batchread"; let body: any; body = JSON.stringify({ - ...(input.Operations !== undefined && { - Operations: serializeAws_restJson1BatchReadOperationList(input.Operations, context), - }), + ...(input.Operations !== undefined && + input.Operations !== null && { + Operations: serializeAws_restJson1BatchReadOperationList(input.Operations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -501,15 +514,16 @@ export const serializeAws_restJson1BatchWriteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/batchwrite"; let body: any; body = JSON.stringify({ - ...(input.Operations !== undefined && { - Operations: serializeAws_restJson1BatchWriteOperationList(input.Operations, context), - }), + ...(input.Operations !== undefined && + input.Operations !== null && { + Operations: serializeAws_restJson1BatchWriteOperationList(input.Operations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -528,13 +542,13 @@ export const serializeAws_restJson1CreateDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/directory/create"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -553,18 +567,17 @@ export const serializeAws_restJson1CreateFacetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/facet/create"; let body: any; body = JSON.stringify({ - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1FacetAttributeList(input.Attributes, context), - }), - ...(input.FacetStyle !== undefined && { FacetStyle: input.FacetStyle }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ObjectType !== undefined && { ObjectType: input.ObjectType }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1FacetAttributeList(input.Attributes, context) }), + ...(input.FacetStyle !== undefined && input.FacetStyle !== null && { FacetStyle: input.FacetStyle }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ObjectType !== undefined && input.ObjectType !== null && { ObjectType: input.ObjectType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -583,20 +596,22 @@ export const serializeAws_restJson1CreateIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/index"; let body: any; body = JSON.stringify({ - ...(input.IsUnique !== undefined && { IsUnique: input.IsUnique }), - ...(input.LinkName !== undefined && { LinkName: input.LinkName }), - ...(input.OrderedIndexedAttributeList !== undefined && { - OrderedIndexedAttributeList: serializeAws_restJson1AttributeKeyList(input.OrderedIndexedAttributeList, context), - }), - ...(input.ParentReference !== undefined && { - ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), - }), + ...(input.IsUnique !== undefined && input.IsUnique !== null && { IsUnique: input.IsUnique }), + ...(input.LinkName !== undefined && input.LinkName !== null && { LinkName: input.LinkName }), + ...(input.OrderedIndexedAttributeList !== undefined && + input.OrderedIndexedAttributeList !== null && { + OrderedIndexedAttributeList: serializeAws_restJson1AttributeKeyList(input.OrderedIndexedAttributeList, context), + }), + ...(input.ParentReference !== undefined && + input.ParentReference !== null && { + ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -615,22 +630,25 @@ export const serializeAws_restJson1CreateObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object"; let body: any; body = JSON.stringify({ - ...(input.LinkName !== undefined && { LinkName: input.LinkName }), - ...(input.ObjectAttributeList !== undefined && { - ObjectAttributeList: serializeAws_restJson1AttributeKeyAndValueList(input.ObjectAttributeList, context), - }), - ...(input.ParentReference !== undefined && { - ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), - }), - ...(input.SchemaFacets !== undefined && { - SchemaFacets: serializeAws_restJson1SchemaFacetList(input.SchemaFacets, context), - }), + ...(input.LinkName !== undefined && input.LinkName !== null && { LinkName: input.LinkName }), + ...(input.ObjectAttributeList !== undefined && + input.ObjectAttributeList !== null && { + ObjectAttributeList: serializeAws_restJson1AttributeKeyAndValueList(input.ObjectAttributeList, context), + }), + ...(input.ParentReference !== undefined && + input.ParentReference !== null && { + ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), + }), + ...(input.SchemaFacets !== undefined && + input.SchemaFacets !== null && { + SchemaFacets: serializeAws_restJson1SchemaFacetList(input.SchemaFacets, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -649,12 +667,12 @@ export const serializeAws_restJson1CreateSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/create"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -673,13 +691,14 @@ export const serializeAws_restJson1CreateTypedLinkFacetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/facet/create"; let body: any; body = JSON.stringify({ - ...(input.Facet !== undefined && { Facet: serializeAws_restJson1TypedLinkFacet(input.Facet, context) }), + ...(input.Facet !== undefined && + input.Facet !== null && { Facet: serializeAws_restJson1TypedLinkFacet(input.Facet, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -698,7 +717,6 @@ export const serializeAws_restJson1DeleteDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/directory"; @@ -720,13 +738,13 @@ export const serializeAws_restJson1DeleteFacetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/facet/delete"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -745,15 +763,16 @@ export const serializeAws_restJson1DeleteObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/delete"; let body: any; body = JSON.stringify({ - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -772,7 +791,6 @@ export const serializeAws_restJson1DeleteSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema"; @@ -794,13 +812,13 @@ export const serializeAws_restJson1DeleteTypedLinkFacetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/facet/delete"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -819,18 +837,20 @@ export const serializeAws_restJson1DetachFromIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/index/detach"; let body: any; body = JSON.stringify({ - ...(input.IndexReference !== undefined && { - IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), - }), - ...(input.TargetReference !== undefined && { - TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), - }), + ...(input.IndexReference !== undefined && + input.IndexReference !== null && { + IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), + }), + ...(input.TargetReference !== undefined && + input.TargetReference !== null && { + TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -849,16 +869,17 @@ export const serializeAws_restJson1DetachObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/detach"; let body: any; body = JSON.stringify({ - ...(input.LinkName !== undefined && { LinkName: input.LinkName }), - ...(input.ParentReference !== undefined && { - ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), - }), + ...(input.LinkName !== undefined && input.LinkName !== null && { LinkName: input.LinkName }), + ...(input.ParentReference !== undefined && + input.ParentReference !== null && { + ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -877,18 +898,20 @@ export const serializeAws_restJson1DetachPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/policy/detach"; let body: any; body = JSON.stringify({ - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.PolicyReference !== undefined && { - PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.PolicyReference !== undefined && + input.PolicyReference !== null && { + PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -907,15 +930,16 @@ export const serializeAws_restJson1DetachTypedLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/detach"; let body: any; body = JSON.stringify({ - ...(input.TypedLinkSpecifier !== undefined && { - TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), - }), + ...(input.TypedLinkSpecifier !== undefined && + input.TypedLinkSpecifier !== null && { + TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -934,7 +958,6 @@ export const serializeAws_restJson1DisableDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/directory/disable"; @@ -956,7 +979,6 @@ export const serializeAws_restJson1EnableDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/directory/enable"; @@ -978,12 +1000,12 @@ export const serializeAws_restJson1GetAppliedSchemaVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/getappliedschema"; let body: any; body = JSON.stringify({ - ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }), + ...(input.SchemaArn !== undefined && input.SchemaArn !== null && { SchemaArn: input.SchemaArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1002,7 +1024,6 @@ export const serializeAws_restJson1GetDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/directory/get"; @@ -1024,13 +1045,13 @@ export const serializeAws_restJson1GetFacetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/facet"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1049,19 +1070,22 @@ export const serializeAws_restJson1GetLinkAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/attributes/get"; let body: any; body = JSON.stringify({ - ...(input.AttributeNames !== undefined && { - AttributeNames: serializeAws_restJson1AttributeNameList(input.AttributeNames, context), - }), - ...(input.ConsistencyLevel !== undefined && { ConsistencyLevel: input.ConsistencyLevel }), - ...(input.TypedLinkSpecifier !== undefined && { - TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), - }), + ...(input.AttributeNames !== undefined && + input.AttributeNames !== null && { + AttributeNames: serializeAws_restJson1AttributeNameList(input.AttributeNames, context), + }), + ...(input.ConsistencyLevel !== undefined && + input.ConsistencyLevel !== null && { ConsistencyLevel: input.ConsistencyLevel }), + ...(input.TypedLinkSpecifier !== undefined && + input.TypedLinkSpecifier !== null && { + TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1080,22 +1104,23 @@ export const serializeAws_restJson1GetObjectAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/attributes/get"; let body: any; body = JSON.stringify({ - ...(input.AttributeNames !== undefined && { - AttributeNames: serializeAws_restJson1AttributeNameList(input.AttributeNames, context), - }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.SchemaFacet !== undefined && { - SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context), - }), + ...(input.AttributeNames !== undefined && + input.AttributeNames !== null && { + AttributeNames: serializeAws_restJson1AttributeNameList(input.AttributeNames, context), + }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.SchemaFacet !== undefined && + input.SchemaFacet !== null && { SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1114,16 +1139,17 @@ export const serializeAws_restJson1GetObjectInformationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/information"; let body: any; body = JSON.stringify({ - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1142,7 +1168,6 @@ export const serializeAws_restJson1GetSchemaAsJsonCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/json"; @@ -1164,13 +1189,13 @@ export const serializeAws_restJson1GetTypedLinkFacetInformationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/facet/get"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1189,15 +1214,15 @@ export const serializeAws_restJson1ListAppliedSchemaArnsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/applied"; let body: any; body = JSON.stringify({ - ...(input.DirectoryArn !== undefined && { DirectoryArn: input.DirectoryArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }), + ...(input.DirectoryArn !== undefined && input.DirectoryArn !== null && { DirectoryArn: input.DirectoryArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SchemaArn !== undefined && input.SchemaArn !== null && { SchemaArn: input.SchemaArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1216,18 +1241,19 @@ export const serializeAws_restJson1ListAttachedIndicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/indices"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TargetReference !== undefined && { - TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TargetReference !== undefined && + input.TargetReference !== null && { + TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1246,13 +1272,13 @@ export const serializeAws_restJson1ListDevelopmentSchemaArnsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/development"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1271,14 +1297,14 @@ export const serializeAws_restJson1ListDirectoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/directory/list"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.state !== undefined && { state: input.state }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.state !== undefined && input.state !== null && { state: input.state }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1297,15 +1323,15 @@ export const serializeAws_restJson1ListFacetAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/facet/attributes"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1324,14 +1350,14 @@ export const serializeAws_restJson1ListFacetNamesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/facet/list"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1350,24 +1376,28 @@ export const serializeAws_restJson1ListIncomingTypedLinksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/incoming"; let body: any; body = JSON.stringify({ - ...(input.ConsistencyLevel !== undefined && { ConsistencyLevel: input.ConsistencyLevel }), - ...(input.FilterAttributeRanges !== undefined && { - FilterAttributeRanges: serializeAws_restJson1TypedLinkAttributeRangeList(input.FilterAttributeRanges, context), - }), - ...(input.FilterTypedLink !== undefined && { - FilterTypedLink: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.FilterTypedLink, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.ConsistencyLevel !== undefined && + input.ConsistencyLevel !== null && { ConsistencyLevel: input.ConsistencyLevel }), + ...(input.FilterAttributeRanges !== undefined && + input.FilterAttributeRanges !== null && { + FilterAttributeRanges: serializeAws_restJson1TypedLinkAttributeRangeList(input.FilterAttributeRanges, context), + }), + ...(input.FilterTypedLink !== undefined && + input.FilterTypedLink !== null && { + FilterTypedLink: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.FilterTypedLink, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1386,21 +1416,23 @@ export const serializeAws_restJson1ListIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/index/targets"; let body: any; body = JSON.stringify({ - ...(input.IndexReference !== undefined && { - IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.RangesOnIndexedValues !== undefined && { - RangesOnIndexedValues: serializeAws_restJson1ObjectAttributeRangeList(input.RangesOnIndexedValues, context), - }), + ...(input.IndexReference !== undefined && + input.IndexReference !== null && { + IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.RangesOnIndexedValues !== undefined && + input.RangesOnIndexedValues !== null && { + RangesOnIndexedValues: serializeAws_restJson1ObjectAttributeRangeList(input.RangesOnIndexedValues, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1419,14 +1451,14 @@ export const serializeAws_restJson1ListManagedSchemaArnsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/managed"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SchemaArn !== undefined && input.SchemaArn !== null && { SchemaArn: input.SchemaArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1445,21 +1477,21 @@ export const serializeAws_restJson1ListObjectAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/attributes"; let body: any; body = JSON.stringify({ - ...(input.FacetFilter !== undefined && { - FacetFilter: serializeAws_restJson1SchemaFacet(input.FacetFilter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.FacetFilter !== undefined && + input.FacetFilter !== null && { FacetFilter: serializeAws_restJson1SchemaFacet(input.FacetFilter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1478,18 +1510,19 @@ export const serializeAws_restJson1ListObjectChildrenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/children"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1508,17 +1541,18 @@ export const serializeAws_restJson1ListObjectParentPathsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/parentpaths"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1537,21 +1571,21 @@ export const serializeAws_restJson1ListObjectParentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/parent"; let body: any; body = JSON.stringify({ - ...(input.IncludeAllLinksToEachParent !== undefined && { - IncludeAllLinksToEachParent: input.IncludeAllLinksToEachParent, - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.IncludeAllLinksToEachParent !== undefined && + input.IncludeAllLinksToEachParent !== null && { IncludeAllLinksToEachParent: input.IncludeAllLinksToEachParent }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1570,18 +1604,19 @@ export const serializeAws_restJson1ListObjectPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/policy"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1600,24 +1635,28 @@ export const serializeAws_restJson1ListOutgoingTypedLinksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/outgoing"; let body: any; body = JSON.stringify({ - ...(input.ConsistencyLevel !== undefined && { ConsistencyLevel: input.ConsistencyLevel }), - ...(input.FilterAttributeRanges !== undefined && { - FilterAttributeRanges: serializeAws_restJson1TypedLinkAttributeRangeList(input.FilterAttributeRanges, context), - }), - ...(input.FilterTypedLink !== undefined && { - FilterTypedLink: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.FilterTypedLink, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.ConsistencyLevel !== undefined && + input.ConsistencyLevel !== null && { ConsistencyLevel: input.ConsistencyLevel }), + ...(input.FilterAttributeRanges !== undefined && + input.FilterAttributeRanges !== null && { + FilterAttributeRanges: serializeAws_restJson1TypedLinkAttributeRangeList(input.FilterAttributeRanges, context), + }), + ...(input.FilterTypedLink !== undefined && + input.FilterTypedLink !== null && { + FilterTypedLink: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.FilterTypedLink, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1636,18 +1675,19 @@ export const serializeAws_restJson1ListPolicyAttachmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), ...(isSerializableHeaderValue(input.ConsistencyLevel) && { "x-amz-consistency-level": input.ConsistencyLevel! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/policy/attachment"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PolicyReference !== undefined && { - PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PolicyReference !== undefined && + input.PolicyReference !== null && { + PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1666,14 +1706,14 @@ export const serializeAws_restJson1ListPublishedSchemaArnsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/published"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SchemaArn !== undefined && input.SchemaArn !== null && { SchemaArn: input.SchemaArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1692,14 +1732,14 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/tags"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1718,15 +1758,15 @@ export const serializeAws_restJson1ListTypedLinkFacetAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/facet/attributes"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1745,14 +1785,14 @@ export const serializeAws_restJson1ListTypedLinkFacetNamesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/facet/list"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1771,17 +1811,18 @@ export const serializeAws_restJson1LookupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/policy/lookup"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1800,7 +1841,7 @@ export const serializeAws_restJson1PublishSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DevelopmentSchemaArn) && { "x-amz-data-partition": input.DevelopmentSchemaArn!, }), @@ -1808,9 +1849,9 @@ export const serializeAws_restJson1PublishSchemaCommand = async ( let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/publish"; let body: any; body = JSON.stringify({ - ...(input.MinorVersion !== undefined && { MinorVersion: input.MinorVersion }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.MinorVersion !== undefined && input.MinorVersion !== null && { MinorVersion: input.MinorVersion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1829,13 +1870,13 @@ export const serializeAws_restJson1PutSchemaFromJsonCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/json"; let body: any; body = JSON.stringify({ - ...(input.Document !== undefined && { Document: input.Document }), + ...(input.Document !== undefined && input.Document !== null && { Document: input.Document }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1854,18 +1895,18 @@ export const serializeAws_restJson1RemoveFacetFromObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/facets/delete"; let body: any; body = JSON.stringify({ - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.SchemaFacet !== undefined && { - SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.SchemaFacet !== undefined && + input.SchemaFacet !== null && { SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1884,13 +1925,14 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/tags/add"; let body: any; body = JSON.stringify({ - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1909,13 +1951,14 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/tags/remove"; let body: any; body = JSON.stringify({ - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1934,17 +1977,18 @@ export const serializeAws_restJson1UpdateFacetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/facet"; let body: any; body = JSON.stringify({ - ...(input.AttributeUpdates !== undefined && { - AttributeUpdates: serializeAws_restJson1FacetAttributeUpdateList(input.AttributeUpdates, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ObjectType !== undefined && { ObjectType: input.ObjectType }), + ...(input.AttributeUpdates !== undefined && + input.AttributeUpdates !== null && { + AttributeUpdates: serializeAws_restJson1FacetAttributeUpdateList(input.AttributeUpdates, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ObjectType !== undefined && input.ObjectType !== null && { ObjectType: input.ObjectType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1963,18 +2007,20 @@ export const serializeAws_restJson1UpdateLinkAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/attributes/update"; let body: any; body = JSON.stringify({ - ...(input.AttributeUpdates !== undefined && { - AttributeUpdates: serializeAws_restJson1LinkAttributeUpdateList(input.AttributeUpdates, context), - }), - ...(input.TypedLinkSpecifier !== undefined && { - TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), - }), + ...(input.AttributeUpdates !== undefined && + input.AttributeUpdates !== null && { + AttributeUpdates: serializeAws_restJson1LinkAttributeUpdateList(input.AttributeUpdates, context), + }), + ...(input.TypedLinkSpecifier !== undefined && + input.TypedLinkSpecifier !== null && { + TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1993,18 +2039,20 @@ export const serializeAws_restJson1UpdateObjectAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.DirectoryArn) && { "x-amz-data-partition": input.DirectoryArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/object/update"; let body: any; body = JSON.stringify({ - ...(input.AttributeUpdates !== undefined && { - AttributeUpdates: serializeAws_restJson1ObjectAttributeUpdateList(input.AttributeUpdates, context), - }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.AttributeUpdates !== undefined && + input.AttributeUpdates !== null && { + AttributeUpdates: serializeAws_restJson1ObjectAttributeUpdateList(input.AttributeUpdates, context), + }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2023,13 +2071,13 @@ export const serializeAws_restJson1UpdateSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/update"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2048,19 +2096,21 @@ export const serializeAws_restJson1UpdateTypedLinkFacetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.SchemaArn) && { "x-amz-data-partition": input.SchemaArn! }), }; let resolvedPath = "/amazonclouddirectory/2017-01-11/typedlink/facet"; let body: any; body = JSON.stringify({ - ...(input.AttributeUpdates !== undefined && { - AttributeUpdates: serializeAws_restJson1TypedLinkFacetAttributeUpdateList(input.AttributeUpdates, context), - }), - ...(input.IdentityAttributeOrder !== undefined && { - IdentityAttributeOrder: serializeAws_restJson1AttributeNameList(input.IdentityAttributeOrder, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AttributeUpdates !== undefined && + input.AttributeUpdates !== null && { + AttributeUpdates: serializeAws_restJson1TypedLinkFacetAttributeUpdateList(input.AttributeUpdates, context), + }), + ...(input.IdentityAttributeOrder !== undefined && + input.IdentityAttributeOrder !== null && { + IdentityAttributeOrder: serializeAws_restJson1AttributeNameList(input.IdentityAttributeOrder, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2079,14 +2129,15 @@ export const serializeAws_restJson1UpgradeAppliedSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/upgradeapplied"; let body: any; body = JSON.stringify({ - ...(input.DirectoryArn !== undefined && { DirectoryArn: input.DirectoryArn }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.PublishedSchemaArn !== undefined && { PublishedSchemaArn: input.PublishedSchemaArn }), + ...(input.DirectoryArn !== undefined && input.DirectoryArn !== null && { DirectoryArn: input.DirectoryArn }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.PublishedSchemaArn !== undefined && + input.PublishedSchemaArn !== null && { PublishedSchemaArn: input.PublishedSchemaArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2105,15 +2156,17 @@ export const serializeAws_restJson1UpgradePublishedSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/amazonclouddirectory/2017-01-11/schema/upgradepublished"; let body: any; body = JSON.stringify({ - ...(input.DevelopmentSchemaArn !== undefined && { DevelopmentSchemaArn: input.DevelopmentSchemaArn }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.MinorVersion !== undefined && { MinorVersion: input.MinorVersion }), - ...(input.PublishedSchemaArn !== undefined && { PublishedSchemaArn: input.PublishedSchemaArn }), + ...(input.DevelopmentSchemaArn !== undefined && + input.DevelopmentSchemaArn !== null && { DevelopmentSchemaArn: input.DevelopmentSchemaArn }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.MinorVersion !== undefined && input.MinorVersion !== null && { MinorVersion: input.MinorVersion }), + ...(input.PublishedSchemaArn !== undefined && + input.PublishedSchemaArn !== null && { PublishedSchemaArn: input.PublishedSchemaArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -10557,16 +10610,18 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1AttributeKey = (input: AttributeKey, context: __SerdeContext): any => { return { - ...(input.FacetName !== undefined && { FacetName: input.FacetName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }), + ...(input.FacetName !== undefined && input.FacetName !== null && { FacetName: input.FacetName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SchemaArn !== undefined && input.SchemaArn !== null && { SchemaArn: input.SchemaArn }), }; }; const serializeAws_restJson1AttributeKeyAndValue = (input: AttributeKeyAndValue, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: serializeAws_restJson1AttributeKey(input.Key, context) }), - ...(input.Value !== undefined && { Value: serializeAws_restJson1TypedAttributeValue(input.Value, context) }), + ...(input.Key !== undefined && + input.Key !== null && { Key: serializeAws_restJson1AttributeKey(input.Key, context) }), + ...(input.Value !== undefined && + input.Value !== null && { Value: serializeAws_restJson1TypedAttributeValue(input.Value, context) }), }; }; @@ -10574,17 +10629,32 @@ const serializeAws_restJson1AttributeKeyAndValueList = ( input: AttributeKeyAndValue[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AttributeKeyAndValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AttributeKeyAndValue(entry, context); + }); }; const serializeAws_restJson1AttributeKeyList = (input: AttributeKey[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AttributeKey(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AttributeKey(entry, context); + }); }; const serializeAws_restJson1AttributeNameAndValue = (input: AttributeNameAndValue, context: __SerdeContext): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.Value !== undefined && { Value: serializeAws_restJson1TypedAttributeValue(input.Value, context) }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.Value !== undefined && + input.Value !== null && { Value: serializeAws_restJson1TypedAttributeValue(input.Value, context) }), }; }; @@ -10592,164 +10662,204 @@ const serializeAws_restJson1AttributeNameAndValueList = ( input: AttributeNameAndValue[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AttributeNameAndValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AttributeNameAndValue(entry, context); + }); }; const serializeAws_restJson1AttributeNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1BatchAddFacetToObject = (input: BatchAddFacetToObject, context: __SerdeContext): any => { return { - ...(input.ObjectAttributeList !== undefined && { - ObjectAttributeList: serializeAws_restJson1AttributeKeyAndValueList(input.ObjectAttributeList, context), - }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.SchemaFacet !== undefined && { - SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context), - }), + ...(input.ObjectAttributeList !== undefined && + input.ObjectAttributeList !== null && { + ObjectAttributeList: serializeAws_restJson1AttributeKeyAndValueList(input.ObjectAttributeList, context), + }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.SchemaFacet !== undefined && + input.SchemaFacet !== null && { SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context) }), }; }; const serializeAws_restJson1BatchAttachObject = (input: BatchAttachObject, context: __SerdeContext): any => { return { - ...(input.ChildReference !== undefined && { - ChildReference: serializeAws_restJson1ObjectReference(input.ChildReference, context), - }), - ...(input.LinkName !== undefined && { LinkName: input.LinkName }), - ...(input.ParentReference !== undefined && { - ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), - }), + ...(input.ChildReference !== undefined && + input.ChildReference !== null && { + ChildReference: serializeAws_restJson1ObjectReference(input.ChildReference, context), + }), + ...(input.LinkName !== undefined && input.LinkName !== null && { LinkName: input.LinkName }), + ...(input.ParentReference !== undefined && + input.ParentReference !== null && { + ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), + }), }; }; const serializeAws_restJson1BatchAttachPolicy = (input: BatchAttachPolicy, context: __SerdeContext): any => { return { - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.PolicyReference !== undefined && { - PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.PolicyReference !== undefined && + input.PolicyReference !== null && { + PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), + }), }; }; const serializeAws_restJson1BatchAttachToIndex = (input: BatchAttachToIndex, context: __SerdeContext): any => { return { - ...(input.IndexReference !== undefined && { - IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), - }), - ...(input.TargetReference !== undefined && { - TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), - }), + ...(input.IndexReference !== undefined && + input.IndexReference !== null && { + IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), + }), + ...(input.TargetReference !== undefined && + input.TargetReference !== null && { + TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), + }), }; }; const serializeAws_restJson1BatchAttachTypedLink = (input: BatchAttachTypedLink, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1AttributeNameAndValueList(input.Attributes, context), - }), - ...(input.SourceObjectReference !== undefined && { - SourceObjectReference: serializeAws_restJson1ObjectReference(input.SourceObjectReference, context), - }), - ...(input.TargetObjectReference !== undefined && { - TargetObjectReference: serializeAws_restJson1ObjectReference(input.TargetObjectReference, context), - }), - ...(input.TypedLinkFacet !== undefined && { - TypedLinkFacet: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.TypedLinkFacet, context), - }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_restJson1AttributeNameAndValueList(input.Attributes, context), + }), + ...(input.SourceObjectReference !== undefined && + input.SourceObjectReference !== null && { + SourceObjectReference: serializeAws_restJson1ObjectReference(input.SourceObjectReference, context), + }), + ...(input.TargetObjectReference !== undefined && + input.TargetObjectReference !== null && { + TargetObjectReference: serializeAws_restJson1ObjectReference(input.TargetObjectReference, context), + }), + ...(input.TypedLinkFacet !== undefined && + input.TypedLinkFacet !== null && { + TypedLinkFacet: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.TypedLinkFacet, context), + }), }; }; const serializeAws_restJson1BatchCreateIndex = (input: BatchCreateIndex, context: __SerdeContext): any => { return { - ...(input.BatchReferenceName !== undefined && { BatchReferenceName: input.BatchReferenceName }), - ...(input.IsUnique !== undefined && { IsUnique: input.IsUnique }), - ...(input.LinkName !== undefined && { LinkName: input.LinkName }), - ...(input.OrderedIndexedAttributeList !== undefined && { - OrderedIndexedAttributeList: serializeAws_restJson1AttributeKeyList(input.OrderedIndexedAttributeList, context), - }), - ...(input.ParentReference !== undefined && { - ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), - }), + ...(input.BatchReferenceName !== undefined && + input.BatchReferenceName !== null && { BatchReferenceName: input.BatchReferenceName }), + ...(input.IsUnique !== undefined && input.IsUnique !== null && { IsUnique: input.IsUnique }), + ...(input.LinkName !== undefined && input.LinkName !== null && { LinkName: input.LinkName }), + ...(input.OrderedIndexedAttributeList !== undefined && + input.OrderedIndexedAttributeList !== null && { + OrderedIndexedAttributeList: serializeAws_restJson1AttributeKeyList(input.OrderedIndexedAttributeList, context), + }), + ...(input.ParentReference !== undefined && + input.ParentReference !== null && { + ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), + }), }; }; const serializeAws_restJson1BatchCreateObject = (input: BatchCreateObject, context: __SerdeContext): any => { return { - ...(input.BatchReferenceName !== undefined && { BatchReferenceName: input.BatchReferenceName }), - ...(input.LinkName !== undefined && { LinkName: input.LinkName }), - ...(input.ObjectAttributeList !== undefined && { - ObjectAttributeList: serializeAws_restJson1AttributeKeyAndValueList(input.ObjectAttributeList, context), - }), - ...(input.ParentReference !== undefined && { - ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), - }), - ...(input.SchemaFacet !== undefined && { - SchemaFacet: serializeAws_restJson1SchemaFacetList(input.SchemaFacet, context), - }), + ...(input.BatchReferenceName !== undefined && + input.BatchReferenceName !== null && { BatchReferenceName: input.BatchReferenceName }), + ...(input.LinkName !== undefined && input.LinkName !== null && { LinkName: input.LinkName }), + ...(input.ObjectAttributeList !== undefined && + input.ObjectAttributeList !== null && { + ObjectAttributeList: serializeAws_restJson1AttributeKeyAndValueList(input.ObjectAttributeList, context), + }), + ...(input.ParentReference !== undefined && + input.ParentReference !== null && { + ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), + }), + ...(input.SchemaFacet !== undefined && + input.SchemaFacet !== null && { SchemaFacet: serializeAws_restJson1SchemaFacetList(input.SchemaFacet, context) }), }; }; const serializeAws_restJson1BatchDeleteObject = (input: BatchDeleteObject, context: __SerdeContext): any => { return { - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; const serializeAws_restJson1BatchDetachFromIndex = (input: BatchDetachFromIndex, context: __SerdeContext): any => { return { - ...(input.IndexReference !== undefined && { - IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), - }), - ...(input.TargetReference !== undefined && { - TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), - }), + ...(input.IndexReference !== undefined && + input.IndexReference !== null && { + IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), + }), + ...(input.TargetReference !== undefined && + input.TargetReference !== null && { + TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), + }), }; }; const serializeAws_restJson1BatchDetachObject = (input: BatchDetachObject, context: __SerdeContext): any => { return { - ...(input.BatchReferenceName !== undefined && { BatchReferenceName: input.BatchReferenceName }), - ...(input.LinkName !== undefined && { LinkName: input.LinkName }), - ...(input.ParentReference !== undefined && { - ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), - }), + ...(input.BatchReferenceName !== undefined && + input.BatchReferenceName !== null && { BatchReferenceName: input.BatchReferenceName }), + ...(input.LinkName !== undefined && input.LinkName !== null && { LinkName: input.LinkName }), + ...(input.ParentReference !== undefined && + input.ParentReference !== null && { + ParentReference: serializeAws_restJson1ObjectReference(input.ParentReference, context), + }), }; }; const serializeAws_restJson1BatchDetachPolicy = (input: BatchDetachPolicy, context: __SerdeContext): any => { return { - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.PolicyReference !== undefined && { - PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.PolicyReference !== undefined && + input.PolicyReference !== null && { + PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), + }), }; }; const serializeAws_restJson1BatchDetachTypedLink = (input: BatchDetachTypedLink, context: __SerdeContext): any => { return { - ...(input.TypedLinkSpecifier !== undefined && { - TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), - }), + ...(input.TypedLinkSpecifier !== undefined && + input.TypedLinkSpecifier !== null && { + TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), + }), }; }; const serializeAws_restJson1BatchGetLinkAttributes = (input: BatchGetLinkAttributes, context: __SerdeContext): any => { return { - ...(input.AttributeNames !== undefined && { - AttributeNames: serializeAws_restJson1AttributeNameList(input.AttributeNames, context), - }), - ...(input.TypedLinkSpecifier !== undefined && { - TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), - }), + ...(input.AttributeNames !== undefined && + input.AttributeNames !== null && { + AttributeNames: serializeAws_restJson1AttributeNameList(input.AttributeNames, context), + }), + ...(input.TypedLinkSpecifier !== undefined && + input.TypedLinkSpecifier !== null && { + TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), + }), }; }; @@ -10758,15 +10868,16 @@ const serializeAws_restJson1BatchGetObjectAttributes = ( context: __SerdeContext ): any => { return { - ...(input.AttributeNames !== undefined && { - AttributeNames: serializeAws_restJson1AttributeNameList(input.AttributeNames, context), - }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.SchemaFacet !== undefined && { - SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context), - }), + ...(input.AttributeNames !== undefined && + input.AttributeNames !== null && { + AttributeNames: serializeAws_restJson1AttributeNameList(input.AttributeNames, context), + }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.SchemaFacet !== undefined && + input.SchemaFacet !== null && { SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context) }), }; }; @@ -10775,9 +10886,10 @@ const serializeAws_restJson1BatchGetObjectInformation = ( context: __SerdeContext ): any => { return { - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; @@ -10786,11 +10898,12 @@ const serializeAws_restJson1BatchListAttachedIndices = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TargetReference !== undefined && { - TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TargetReference !== undefined && + input.TargetReference !== null && { + TargetReference: serializeAws_restJson1ObjectReference(input.TargetReference, context), + }), }; }; @@ -10799,30 +10912,35 @@ const serializeAws_restJson1BatchListIncomingTypedLinks = ( context: __SerdeContext ): any => { return { - ...(input.FilterAttributeRanges !== undefined && { - FilterAttributeRanges: serializeAws_restJson1TypedLinkAttributeRangeList(input.FilterAttributeRanges, context), - }), - ...(input.FilterTypedLink !== undefined && { - FilterTypedLink: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.FilterTypedLink, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.FilterAttributeRanges !== undefined && + input.FilterAttributeRanges !== null && { + FilterAttributeRanges: serializeAws_restJson1TypedLinkAttributeRangeList(input.FilterAttributeRanges, context), + }), + ...(input.FilterTypedLink !== undefined && + input.FilterTypedLink !== null && { + FilterTypedLink: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.FilterTypedLink, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; const serializeAws_restJson1BatchListIndex = (input: BatchListIndex, context: __SerdeContext): any => { return { - ...(input.IndexReference !== undefined && { - IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.RangesOnIndexedValues !== undefined && { - RangesOnIndexedValues: serializeAws_restJson1ObjectAttributeRangeList(input.RangesOnIndexedValues, context), - }), + ...(input.IndexReference !== undefined && + input.IndexReference !== null && { + IndexReference: serializeAws_restJson1ObjectReference(input.IndexReference, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.RangesOnIndexedValues !== undefined && + input.RangesOnIndexedValues !== null && { + RangesOnIndexedValues: serializeAws_restJson1ObjectAttributeRangeList(input.RangesOnIndexedValues, context), + }), }; }; @@ -10831,14 +10949,14 @@ const serializeAws_restJson1BatchListObjectAttributes = ( context: __SerdeContext ): any => { return { - ...(input.FacetFilter !== undefined && { - FacetFilter: serializeAws_restJson1SchemaFacet(input.FacetFilter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.FacetFilter !== undefined && + input.FacetFilter !== null && { FacetFilter: serializeAws_restJson1SchemaFacet(input.FacetFilter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; @@ -10847,11 +10965,12 @@ const serializeAws_restJson1BatchListObjectChildren = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; @@ -10860,21 +10979,23 @@ const serializeAws_restJson1BatchListObjectParentPaths = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; const serializeAws_restJson1BatchListObjectParents = (input: BatchListObjectParents, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; @@ -10883,11 +11004,12 @@ const serializeAws_restJson1BatchListObjectPolicies = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; @@ -10896,17 +11018,20 @@ const serializeAws_restJson1BatchListOutgoingTypedLinks = ( context: __SerdeContext ): any => { return { - ...(input.FilterAttributeRanges !== undefined && { - FilterAttributeRanges: serializeAws_restJson1TypedLinkAttributeRangeList(input.FilterAttributeRanges, context), - }), - ...(input.FilterTypedLink !== undefined && { - FilterTypedLink: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.FilterTypedLink, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.FilterAttributeRanges !== undefined && + input.FilterAttributeRanges !== null && { + FilterAttributeRanges: serializeAws_restJson1TypedLinkAttributeRangeList(input.FilterAttributeRanges, context), + }), + ...(input.FilterTypedLink !== undefined && + input.FilterTypedLink !== null && { + FilterTypedLink: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.FilterTypedLink, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; @@ -10915,71 +11040,100 @@ const serializeAws_restJson1BatchListPolicyAttachments = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PolicyReference !== undefined && { - PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PolicyReference !== undefined && + input.PolicyReference !== null && { + PolicyReference: serializeAws_restJson1ObjectReference(input.PolicyReference, context), + }), }; }; const serializeAws_restJson1BatchLookupPolicy = (input: BatchLookupPolicy, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; const serializeAws_restJson1BatchReadOperation = (input: BatchReadOperation, context: __SerdeContext): any => { return { - ...(input.GetLinkAttributes !== undefined && { - GetLinkAttributes: serializeAws_restJson1BatchGetLinkAttributes(input.GetLinkAttributes, context), - }), - ...(input.GetObjectAttributes !== undefined && { - GetObjectAttributes: serializeAws_restJson1BatchGetObjectAttributes(input.GetObjectAttributes, context), - }), - ...(input.GetObjectInformation !== undefined && { - GetObjectInformation: serializeAws_restJson1BatchGetObjectInformation(input.GetObjectInformation, context), - }), - ...(input.ListAttachedIndices !== undefined && { - ListAttachedIndices: serializeAws_restJson1BatchListAttachedIndices(input.ListAttachedIndices, context), - }), - ...(input.ListIncomingTypedLinks !== undefined && { - ListIncomingTypedLinks: serializeAws_restJson1BatchListIncomingTypedLinks(input.ListIncomingTypedLinks, context), - }), - ...(input.ListIndex !== undefined && { ListIndex: serializeAws_restJson1BatchListIndex(input.ListIndex, context) }), - ...(input.ListObjectAttributes !== undefined && { - ListObjectAttributes: serializeAws_restJson1BatchListObjectAttributes(input.ListObjectAttributes, context), - }), - ...(input.ListObjectChildren !== undefined && { - ListObjectChildren: serializeAws_restJson1BatchListObjectChildren(input.ListObjectChildren, context), - }), - ...(input.ListObjectParentPaths !== undefined && { - ListObjectParentPaths: serializeAws_restJson1BatchListObjectParentPaths(input.ListObjectParentPaths, context), - }), - ...(input.ListObjectParents !== undefined && { - ListObjectParents: serializeAws_restJson1BatchListObjectParents(input.ListObjectParents, context), - }), - ...(input.ListObjectPolicies !== undefined && { - ListObjectPolicies: serializeAws_restJson1BatchListObjectPolicies(input.ListObjectPolicies, context), - }), - ...(input.ListOutgoingTypedLinks !== undefined && { - ListOutgoingTypedLinks: serializeAws_restJson1BatchListOutgoingTypedLinks(input.ListOutgoingTypedLinks, context), - }), - ...(input.ListPolicyAttachments !== undefined && { - ListPolicyAttachments: serializeAws_restJson1BatchListPolicyAttachments(input.ListPolicyAttachments, context), - }), - ...(input.LookupPolicy !== undefined && { - LookupPolicy: serializeAws_restJson1BatchLookupPolicy(input.LookupPolicy, context), - }), + ...(input.GetLinkAttributes !== undefined && + input.GetLinkAttributes !== null && { + GetLinkAttributes: serializeAws_restJson1BatchGetLinkAttributes(input.GetLinkAttributes, context), + }), + ...(input.GetObjectAttributes !== undefined && + input.GetObjectAttributes !== null && { + GetObjectAttributes: serializeAws_restJson1BatchGetObjectAttributes(input.GetObjectAttributes, context), + }), + ...(input.GetObjectInformation !== undefined && + input.GetObjectInformation !== null && { + GetObjectInformation: serializeAws_restJson1BatchGetObjectInformation(input.GetObjectInformation, context), + }), + ...(input.ListAttachedIndices !== undefined && + input.ListAttachedIndices !== null && { + ListAttachedIndices: serializeAws_restJson1BatchListAttachedIndices(input.ListAttachedIndices, context), + }), + ...(input.ListIncomingTypedLinks !== undefined && + input.ListIncomingTypedLinks !== null && { + ListIncomingTypedLinks: serializeAws_restJson1BatchListIncomingTypedLinks( + input.ListIncomingTypedLinks, + context + ), + }), + ...(input.ListIndex !== undefined && + input.ListIndex !== null && { ListIndex: serializeAws_restJson1BatchListIndex(input.ListIndex, context) }), + ...(input.ListObjectAttributes !== undefined && + input.ListObjectAttributes !== null && { + ListObjectAttributes: serializeAws_restJson1BatchListObjectAttributes(input.ListObjectAttributes, context), + }), + ...(input.ListObjectChildren !== undefined && + input.ListObjectChildren !== null && { + ListObjectChildren: serializeAws_restJson1BatchListObjectChildren(input.ListObjectChildren, context), + }), + ...(input.ListObjectParentPaths !== undefined && + input.ListObjectParentPaths !== null && { + ListObjectParentPaths: serializeAws_restJson1BatchListObjectParentPaths(input.ListObjectParentPaths, context), + }), + ...(input.ListObjectParents !== undefined && + input.ListObjectParents !== null && { + ListObjectParents: serializeAws_restJson1BatchListObjectParents(input.ListObjectParents, context), + }), + ...(input.ListObjectPolicies !== undefined && + input.ListObjectPolicies !== null && { + ListObjectPolicies: serializeAws_restJson1BatchListObjectPolicies(input.ListObjectPolicies, context), + }), + ...(input.ListOutgoingTypedLinks !== undefined && + input.ListOutgoingTypedLinks !== null && { + ListOutgoingTypedLinks: serializeAws_restJson1BatchListOutgoingTypedLinks( + input.ListOutgoingTypedLinks, + context + ), + }), + ...(input.ListPolicyAttachments !== undefined && + input.ListPolicyAttachments !== null && { + ListPolicyAttachments: serializeAws_restJson1BatchListPolicyAttachments(input.ListPolicyAttachments, context), + }), + ...(input.LookupPolicy !== undefined && + input.LookupPolicy !== null && { + LookupPolicy: serializeAws_restJson1BatchLookupPolicy(input.LookupPolicy, context), + }), }; }; const serializeAws_restJson1BatchReadOperationList = (input: BatchReadOperation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1BatchReadOperation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1BatchReadOperation(entry, context); + }); }; const serializeAws_restJson1BatchRemoveFacetFromObject = ( @@ -10987,12 +11141,12 @@ const serializeAws_restJson1BatchRemoveFacetFromObject = ( context: __SerdeContext ): any => { return { - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), - ...(input.SchemaFacet !== undefined && { - SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context), - }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), + ...(input.SchemaFacet !== undefined && + input.SchemaFacet !== null && { SchemaFacet: serializeAws_restJson1SchemaFacet(input.SchemaFacet, context) }), }; }; @@ -11001,12 +11155,14 @@ const serializeAws_restJson1BatchUpdateLinkAttributes = ( context: __SerdeContext ): any => { return { - ...(input.AttributeUpdates !== undefined && { - AttributeUpdates: serializeAws_restJson1LinkAttributeUpdateList(input.AttributeUpdates, context), - }), - ...(input.TypedLinkSpecifier !== undefined && { - TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), - }), + ...(input.AttributeUpdates !== undefined && + input.AttributeUpdates !== null && { + AttributeUpdates: serializeAws_restJson1LinkAttributeUpdateList(input.AttributeUpdates, context), + }), + ...(input.TypedLinkSpecifier !== undefined && + input.TypedLinkSpecifier !== null && { + TypedLinkSpecifier: serializeAws_restJson1TypedLinkSpecifier(input.TypedLinkSpecifier, context), + }), }; }; @@ -11015,79 +11171,109 @@ const serializeAws_restJson1BatchUpdateObjectAttributes = ( context: __SerdeContext ): any => { return { - ...(input.AttributeUpdates !== undefined && { - AttributeUpdates: serializeAws_restJson1ObjectAttributeUpdateList(input.AttributeUpdates, context), - }), - ...(input.ObjectReference !== undefined && { - ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), - }), + ...(input.AttributeUpdates !== undefined && + input.AttributeUpdates !== null && { + AttributeUpdates: serializeAws_restJson1ObjectAttributeUpdateList(input.AttributeUpdates, context), + }), + ...(input.ObjectReference !== undefined && + input.ObjectReference !== null && { + ObjectReference: serializeAws_restJson1ObjectReference(input.ObjectReference, context), + }), }; }; const serializeAws_restJson1BatchWriteOperation = (input: BatchWriteOperation, context: __SerdeContext): any => { return { - ...(input.AddFacetToObject !== undefined && { - AddFacetToObject: serializeAws_restJson1BatchAddFacetToObject(input.AddFacetToObject, context), - }), - ...(input.AttachObject !== undefined && { - AttachObject: serializeAws_restJson1BatchAttachObject(input.AttachObject, context), - }), - ...(input.AttachPolicy !== undefined && { - AttachPolicy: serializeAws_restJson1BatchAttachPolicy(input.AttachPolicy, context), - }), - ...(input.AttachToIndex !== undefined && { - AttachToIndex: serializeAws_restJson1BatchAttachToIndex(input.AttachToIndex, context), - }), - ...(input.AttachTypedLink !== undefined && { - AttachTypedLink: serializeAws_restJson1BatchAttachTypedLink(input.AttachTypedLink, context), - }), - ...(input.CreateIndex !== undefined && { - CreateIndex: serializeAws_restJson1BatchCreateIndex(input.CreateIndex, context), - }), - ...(input.CreateObject !== undefined && { - CreateObject: serializeAws_restJson1BatchCreateObject(input.CreateObject, context), - }), - ...(input.DeleteObject !== undefined && { - DeleteObject: serializeAws_restJson1BatchDeleteObject(input.DeleteObject, context), - }), - ...(input.DetachFromIndex !== undefined && { - DetachFromIndex: serializeAws_restJson1BatchDetachFromIndex(input.DetachFromIndex, context), - }), - ...(input.DetachObject !== undefined && { - DetachObject: serializeAws_restJson1BatchDetachObject(input.DetachObject, context), - }), - ...(input.DetachPolicy !== undefined && { - DetachPolicy: serializeAws_restJson1BatchDetachPolicy(input.DetachPolicy, context), - }), - ...(input.DetachTypedLink !== undefined && { - DetachTypedLink: serializeAws_restJson1BatchDetachTypedLink(input.DetachTypedLink, context), - }), - ...(input.RemoveFacetFromObject !== undefined && { - RemoveFacetFromObject: serializeAws_restJson1BatchRemoveFacetFromObject(input.RemoveFacetFromObject, context), - }), - ...(input.UpdateLinkAttributes !== undefined && { - UpdateLinkAttributes: serializeAws_restJson1BatchUpdateLinkAttributes(input.UpdateLinkAttributes, context), - }), - ...(input.UpdateObjectAttributes !== undefined && { - UpdateObjectAttributes: serializeAws_restJson1BatchUpdateObjectAttributes(input.UpdateObjectAttributes, context), - }), + ...(input.AddFacetToObject !== undefined && + input.AddFacetToObject !== null && { + AddFacetToObject: serializeAws_restJson1BatchAddFacetToObject(input.AddFacetToObject, context), + }), + ...(input.AttachObject !== undefined && + input.AttachObject !== null && { + AttachObject: serializeAws_restJson1BatchAttachObject(input.AttachObject, context), + }), + ...(input.AttachPolicy !== undefined && + input.AttachPolicy !== null && { + AttachPolicy: serializeAws_restJson1BatchAttachPolicy(input.AttachPolicy, context), + }), + ...(input.AttachToIndex !== undefined && + input.AttachToIndex !== null && { + AttachToIndex: serializeAws_restJson1BatchAttachToIndex(input.AttachToIndex, context), + }), + ...(input.AttachTypedLink !== undefined && + input.AttachTypedLink !== null && { + AttachTypedLink: serializeAws_restJson1BatchAttachTypedLink(input.AttachTypedLink, context), + }), + ...(input.CreateIndex !== undefined && + input.CreateIndex !== null && { + CreateIndex: serializeAws_restJson1BatchCreateIndex(input.CreateIndex, context), + }), + ...(input.CreateObject !== undefined && + input.CreateObject !== null && { + CreateObject: serializeAws_restJson1BatchCreateObject(input.CreateObject, context), + }), + ...(input.DeleteObject !== undefined && + input.DeleteObject !== null && { + DeleteObject: serializeAws_restJson1BatchDeleteObject(input.DeleteObject, context), + }), + ...(input.DetachFromIndex !== undefined && + input.DetachFromIndex !== null && { + DetachFromIndex: serializeAws_restJson1BatchDetachFromIndex(input.DetachFromIndex, context), + }), + ...(input.DetachObject !== undefined && + input.DetachObject !== null && { + DetachObject: serializeAws_restJson1BatchDetachObject(input.DetachObject, context), + }), + ...(input.DetachPolicy !== undefined && + input.DetachPolicy !== null && { + DetachPolicy: serializeAws_restJson1BatchDetachPolicy(input.DetachPolicy, context), + }), + ...(input.DetachTypedLink !== undefined && + input.DetachTypedLink !== null && { + DetachTypedLink: serializeAws_restJson1BatchDetachTypedLink(input.DetachTypedLink, context), + }), + ...(input.RemoveFacetFromObject !== undefined && + input.RemoveFacetFromObject !== null && { + RemoveFacetFromObject: serializeAws_restJson1BatchRemoveFacetFromObject(input.RemoveFacetFromObject, context), + }), + ...(input.UpdateLinkAttributes !== undefined && + input.UpdateLinkAttributes !== null && { + UpdateLinkAttributes: serializeAws_restJson1BatchUpdateLinkAttributes(input.UpdateLinkAttributes, context), + }), + ...(input.UpdateObjectAttributes !== undefined && + input.UpdateObjectAttributes !== null && { + UpdateObjectAttributes: serializeAws_restJson1BatchUpdateObjectAttributes( + input.UpdateObjectAttributes, + context + ), + }), }; }; const serializeAws_restJson1BatchWriteOperationList = (input: BatchWriteOperation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1BatchWriteOperation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1BatchWriteOperation(entry, context); + }); }; const serializeAws_restJson1FacetAttribute = (input: FacetAttribute, context: __SerdeContext): any => { return { - ...(input.AttributeDefinition !== undefined && { - AttributeDefinition: serializeAws_restJson1FacetAttributeDefinition(input.AttributeDefinition, context), - }), - ...(input.AttributeReference !== undefined && { - AttributeReference: serializeAws_restJson1FacetAttributeReference(input.AttributeReference, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RequiredBehavior !== undefined && { RequiredBehavior: input.RequiredBehavior }), + ...(input.AttributeDefinition !== undefined && + input.AttributeDefinition !== null && { + AttributeDefinition: serializeAws_restJson1FacetAttributeDefinition(input.AttributeDefinition, context), + }), + ...(input.AttributeReference !== undefined && + input.AttributeReference !== null && { + AttributeReference: serializeAws_restJson1FacetAttributeReference(input.AttributeReference, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RequiredBehavior !== undefined && + input.RequiredBehavior !== null && { RequiredBehavior: input.RequiredBehavior }), }; }; @@ -11096,17 +11282,26 @@ const serializeAws_restJson1FacetAttributeDefinition = ( context: __SerdeContext ): any => { return { - ...(input.DefaultValue !== undefined && { - DefaultValue: serializeAws_restJson1TypedAttributeValue(input.DefaultValue, context), - }), - ...(input.IsImmutable !== undefined && { IsImmutable: input.IsImmutable }), - ...(input.Rules !== undefined && { Rules: serializeAws_restJson1RuleMap(input.Rules, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DefaultValue !== undefined && + input.DefaultValue !== null && { + DefaultValue: serializeAws_restJson1TypedAttributeValue(input.DefaultValue, context), + }), + ...(input.IsImmutable !== undefined && input.IsImmutable !== null && { IsImmutable: input.IsImmutable }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_restJson1RuleMap(input.Rules, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1FacetAttributeList = (input: FacetAttribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1FacetAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1FacetAttribute(entry, context); + }); }; const serializeAws_restJson1FacetAttributeReference = ( @@ -11114,15 +11309,18 @@ const serializeAws_restJson1FacetAttributeReference = ( context: __SerdeContext ): any => { return { - ...(input.TargetAttributeName !== undefined && { TargetAttributeName: input.TargetAttributeName }), - ...(input.TargetFacetName !== undefined && { TargetFacetName: input.TargetFacetName }), + ...(input.TargetAttributeName !== undefined && + input.TargetAttributeName !== null && { TargetAttributeName: input.TargetAttributeName }), + ...(input.TargetFacetName !== undefined && + input.TargetFacetName !== null && { TargetFacetName: input.TargetFacetName }), }; }; const serializeAws_restJson1FacetAttributeUpdate = (input: FacetAttributeUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Attribute !== undefined && { Attribute: serializeAws_restJson1FacetAttribute(input.Attribute, context) }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Attribute !== undefined && + input.Attribute !== null && { Attribute: serializeAws_restJson1FacetAttribute(input.Attribute, context) }), }; }; @@ -11130,50 +11328,69 @@ const serializeAws_restJson1FacetAttributeUpdateList = ( input: FacetAttributeUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1FacetAttributeUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1FacetAttributeUpdate(entry, context); + }); }; const serializeAws_restJson1LinkAttributeAction = (input: LinkAttributeAction, context: __SerdeContext): any => { return { - ...(input.AttributeActionType !== undefined && { AttributeActionType: input.AttributeActionType }), - ...(input.AttributeUpdateValue !== undefined && { - AttributeUpdateValue: serializeAws_restJson1TypedAttributeValue(input.AttributeUpdateValue, context), - }), + ...(input.AttributeActionType !== undefined && + input.AttributeActionType !== null && { AttributeActionType: input.AttributeActionType }), + ...(input.AttributeUpdateValue !== undefined && + input.AttributeUpdateValue !== null && { + AttributeUpdateValue: serializeAws_restJson1TypedAttributeValue(input.AttributeUpdateValue, context), + }), }; }; const serializeAws_restJson1LinkAttributeUpdate = (input: LinkAttributeUpdate, context: __SerdeContext): any => { return { - ...(input.AttributeAction !== undefined && { - AttributeAction: serializeAws_restJson1LinkAttributeAction(input.AttributeAction, context), - }), - ...(input.AttributeKey !== undefined && { - AttributeKey: serializeAws_restJson1AttributeKey(input.AttributeKey, context), - }), + ...(input.AttributeAction !== undefined && + input.AttributeAction !== null && { + AttributeAction: serializeAws_restJson1LinkAttributeAction(input.AttributeAction, context), + }), + ...(input.AttributeKey !== undefined && + input.AttributeKey !== null && { AttributeKey: serializeAws_restJson1AttributeKey(input.AttributeKey, context) }), }; }; const serializeAws_restJson1LinkAttributeUpdateList = (input: LinkAttributeUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1LinkAttributeUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1LinkAttributeUpdate(entry, context); + }); }; const serializeAws_restJson1ObjectAttributeAction = (input: ObjectAttributeAction, context: __SerdeContext): any => { return { - ...(input.ObjectAttributeActionType !== undefined && { - ObjectAttributeActionType: input.ObjectAttributeActionType, - }), - ...(input.ObjectAttributeUpdateValue !== undefined && { - ObjectAttributeUpdateValue: serializeAws_restJson1TypedAttributeValue(input.ObjectAttributeUpdateValue, context), - }), + ...(input.ObjectAttributeActionType !== undefined && + input.ObjectAttributeActionType !== null && { ObjectAttributeActionType: input.ObjectAttributeActionType }), + ...(input.ObjectAttributeUpdateValue !== undefined && + input.ObjectAttributeUpdateValue !== null && { + ObjectAttributeUpdateValue: serializeAws_restJson1TypedAttributeValue( + input.ObjectAttributeUpdateValue, + context + ), + }), }; }; const serializeAws_restJson1ObjectAttributeRange = (input: ObjectAttributeRange, context: __SerdeContext): any => { return { - ...(input.AttributeKey !== undefined && { - AttributeKey: serializeAws_restJson1AttributeKey(input.AttributeKey, context), - }), - ...(input.Range !== undefined && { Range: serializeAws_restJson1TypedAttributeValueRange(input.Range, context) }), + ...(input.AttributeKey !== undefined && + input.AttributeKey !== null && { AttributeKey: serializeAws_restJson1AttributeKey(input.AttributeKey, context) }), + ...(input.Range !== undefined && + input.Range !== null && { Range: serializeAws_restJson1TypedAttributeValueRange(input.Range, context) }), }; }; @@ -11181,17 +11398,26 @@ const serializeAws_restJson1ObjectAttributeRangeList = ( input: ObjectAttributeRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ObjectAttributeRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ObjectAttributeRange(entry, context); + }); }; const serializeAws_restJson1ObjectAttributeUpdate = (input: ObjectAttributeUpdate, context: __SerdeContext): any => { return { - ...(input.ObjectAttributeAction !== undefined && { - ObjectAttributeAction: serializeAws_restJson1ObjectAttributeAction(input.ObjectAttributeAction, context), - }), - ...(input.ObjectAttributeKey !== undefined && { - ObjectAttributeKey: serializeAws_restJson1AttributeKey(input.ObjectAttributeKey, context), - }), + ...(input.ObjectAttributeAction !== undefined && + input.ObjectAttributeAction !== null && { + ObjectAttributeAction: serializeAws_restJson1ObjectAttributeAction(input.ObjectAttributeAction, context), + }), + ...(input.ObjectAttributeKey !== undefined && + input.ObjectAttributeKey !== null && { + ObjectAttributeKey: serializeAws_restJson1AttributeKey(input.ObjectAttributeKey, context), + }), }; }; @@ -11199,77 +11425,110 @@ const serializeAws_restJson1ObjectAttributeUpdateList = ( input: ObjectAttributeUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ObjectAttributeUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ObjectAttributeUpdate(entry, context); + }); }; const serializeAws_restJson1ObjectReference = (input: ObjectReference, context: __SerdeContext): any => { return { - ...(input.Selector !== undefined && { Selector: input.Selector }), + ...(input.Selector !== undefined && input.Selector !== null && { Selector: input.Selector }), }; }; const serializeAws_restJson1Rule = (input: Rule, context: __SerdeContext): any => { return { - ...(input.Parameters !== undefined && { - Parameters: serializeAws_restJson1RuleParameterMap(input.Parameters, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_restJson1RuleParameterMap(input.Parameters, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1RuleMap = (input: { [key: string]: Rule }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Rule }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Rule }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1Rule(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1RuleParameterMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1SchemaFacet = (input: SchemaFacet, context: __SerdeContext): any => { return { - ...(input.FacetName !== undefined && { FacetName: input.FacetName }), - ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }), + ...(input.FacetName !== undefined && input.FacetName !== null && { FacetName: input.FacetName }), + ...(input.SchemaArn !== undefined && input.SchemaArn !== null && { SchemaArn: input.SchemaArn }), }; }; const serializeAws_restJson1SchemaFacetList = (input: SchemaFacet[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SchemaFacet(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SchemaFacet(entry, context); + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TypedAttributeValue = (input: TypedAttributeValue, context: __SerdeContext): any => { return { - ...(input.BinaryValue !== undefined && { BinaryValue: context.base64Encoder(input.BinaryValue) }), - ...(input.BooleanValue !== undefined && { BooleanValue: input.BooleanValue }), - ...(input.DatetimeValue !== undefined && { DatetimeValue: Math.round(input.DatetimeValue.getTime() / 1000) }), - ...(input.NumberValue !== undefined && { NumberValue: input.NumberValue }), - ...(input.StringValue !== undefined && { StringValue: input.StringValue }), + ...(input.BinaryValue !== undefined && + input.BinaryValue !== null && { BinaryValue: context.base64Encoder(input.BinaryValue) }), + ...(input.BooleanValue !== undefined && input.BooleanValue !== null && { BooleanValue: input.BooleanValue }), + ...(input.DatetimeValue !== undefined && + input.DatetimeValue !== null && { DatetimeValue: Math.round(input.DatetimeValue.getTime() / 1000) }), + ...(input.NumberValue !== undefined && input.NumberValue !== null && { NumberValue: input.NumberValue }), + ...(input.StringValue !== undefined && input.StringValue !== null && { StringValue: input.StringValue }), }; }; @@ -11278,14 +11537,14 @@ const serializeAws_restJson1TypedAttributeValueRange = ( context: __SerdeContext ): any => { return { - ...(input.EndMode !== undefined && { EndMode: input.EndMode }), - ...(input.EndValue !== undefined && { - EndValue: serializeAws_restJson1TypedAttributeValue(input.EndValue, context), - }), - ...(input.StartMode !== undefined && { StartMode: input.StartMode }), - ...(input.StartValue !== undefined && { - StartValue: serializeAws_restJson1TypedAttributeValue(input.StartValue, context), - }), + ...(input.EndMode !== undefined && input.EndMode !== null && { EndMode: input.EndMode }), + ...(input.EndValue !== undefined && + input.EndValue !== null && { EndValue: serializeAws_restJson1TypedAttributeValue(input.EndValue, context) }), + ...(input.StartMode !== undefined && input.StartMode !== null && { StartMode: input.StartMode }), + ...(input.StartValue !== undefined && + input.StartValue !== null && { + StartValue: serializeAws_restJson1TypedAttributeValue(input.StartValue, context), + }), }; }; @@ -11294,14 +11553,17 @@ const serializeAws_restJson1TypedLinkAttributeDefinition = ( context: __SerdeContext ): any => { return { - ...(input.DefaultValue !== undefined && { - DefaultValue: serializeAws_restJson1TypedAttributeValue(input.DefaultValue, context), - }), - ...(input.IsImmutable !== undefined && { IsImmutable: input.IsImmutable }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RequiredBehavior !== undefined && { RequiredBehavior: input.RequiredBehavior }), - ...(input.Rules !== undefined && { Rules: serializeAws_restJson1RuleMap(input.Rules, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DefaultValue !== undefined && + input.DefaultValue !== null && { + DefaultValue: serializeAws_restJson1TypedAttributeValue(input.DefaultValue, context), + }), + ...(input.IsImmutable !== undefined && input.IsImmutable !== null && { IsImmutable: input.IsImmutable }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RequiredBehavior !== undefined && + input.RequiredBehavior !== null && { RequiredBehavior: input.RequiredBehavior }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_restJson1RuleMap(input.Rules, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -11309,7 +11571,14 @@ const serializeAws_restJson1TypedLinkAttributeDefinitionList = ( input: TypedLinkAttributeDefinition[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1TypedLinkAttributeDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TypedLinkAttributeDefinition(entry, context); + }); }; const serializeAws_restJson1TypedLinkAttributeRange = ( @@ -11317,8 +11586,9 @@ const serializeAws_restJson1TypedLinkAttributeRange = ( context: __SerdeContext ): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.Range !== undefined && { Range: serializeAws_restJson1TypedAttributeValueRange(input.Range, context) }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.Range !== undefined && + input.Range !== null && { Range: serializeAws_restJson1TypedAttributeValueRange(input.Range, context) }), }; }; @@ -11326,18 +11596,27 @@ const serializeAws_restJson1TypedLinkAttributeRangeList = ( input: TypedLinkAttributeRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1TypedLinkAttributeRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TypedLinkAttributeRange(entry, context); + }); }; const serializeAws_restJson1TypedLinkFacet = (input: TypedLinkFacet, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1TypedLinkAttributeDefinitionList(input.Attributes, context), - }), - ...(input.IdentityAttributeOrder !== undefined && { - IdentityAttributeOrder: serializeAws_restJson1AttributeNameList(input.IdentityAttributeOrder, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_restJson1TypedLinkAttributeDefinitionList(input.Attributes, context), + }), + ...(input.IdentityAttributeOrder !== undefined && + input.IdentityAttributeOrder !== null && { + IdentityAttributeOrder: serializeAws_restJson1AttributeNameList(input.IdentityAttributeOrder, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -11346,10 +11625,11 @@ const serializeAws_restJson1TypedLinkFacetAttributeUpdate = ( context: __SerdeContext ): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Attribute !== undefined && { - Attribute: serializeAws_restJson1TypedLinkAttributeDefinition(input.Attribute, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Attribute !== undefined && + input.Attribute !== null && { + Attribute: serializeAws_restJson1TypedLinkAttributeDefinition(input.Attribute, context), + }), }; }; @@ -11357,7 +11637,14 @@ const serializeAws_restJson1TypedLinkFacetAttributeUpdateList = ( input: TypedLinkFacetAttributeUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1TypedLinkFacetAttributeUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TypedLinkFacetAttributeUpdate(entry, context); + }); }; const serializeAws_restJson1TypedLinkSchemaAndFacetName = ( @@ -11365,30 +11652,44 @@ const serializeAws_restJson1TypedLinkSchemaAndFacetName = ( context: __SerdeContext ): any => { return { - ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }), - ...(input.TypedLinkName !== undefined && { TypedLinkName: input.TypedLinkName }), + ...(input.SchemaArn !== undefined && input.SchemaArn !== null && { SchemaArn: input.SchemaArn }), + ...(input.TypedLinkName !== undefined && input.TypedLinkName !== null && { TypedLinkName: input.TypedLinkName }), }; }; const serializeAws_restJson1TypedLinkSpecifier = (input: TypedLinkSpecifier, context: __SerdeContext): any => { return { - ...(input.IdentityAttributeValues !== undefined && { - IdentityAttributeValues: serializeAws_restJson1AttributeNameAndValueList(input.IdentityAttributeValues, context), - }), - ...(input.SourceObjectReference !== undefined && { - SourceObjectReference: serializeAws_restJson1ObjectReference(input.SourceObjectReference, context), - }), - ...(input.TargetObjectReference !== undefined && { - TargetObjectReference: serializeAws_restJson1ObjectReference(input.TargetObjectReference, context), - }), - ...(input.TypedLinkFacet !== undefined && { - TypedLinkFacet: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.TypedLinkFacet, context), - }), + ...(input.IdentityAttributeValues !== undefined && + input.IdentityAttributeValues !== null && { + IdentityAttributeValues: serializeAws_restJson1AttributeNameAndValueList( + input.IdentityAttributeValues, + context + ), + }), + ...(input.SourceObjectReference !== undefined && + input.SourceObjectReference !== null && { + SourceObjectReference: serializeAws_restJson1ObjectReference(input.SourceObjectReference, context), + }), + ...(input.TargetObjectReference !== undefined && + input.TargetObjectReference !== null && { + TargetObjectReference: serializeAws_restJson1ObjectReference(input.TargetObjectReference, context), + }), + ...(input.TypedLinkFacet !== undefined && + input.TypedLinkFacet !== null && { + TypedLinkFacet: serializeAws_restJson1TypedLinkSchemaAndFacetName(input.TypedLinkFacet, context), + }), }; }; const deserializeAws_restJson1Arns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AttributeKey = (output: any, context: __SerdeContext): AttributeKey => { @@ -11416,7 +11717,14 @@ const deserializeAws_restJson1AttributeKeyAndValueList = ( output: any, context: __SerdeContext ): AttributeKeyAndValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AttributeKeyAndValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AttributeKeyAndValue(entry, context); + }); }; const deserializeAws_restJson1AttributeNameAndValue = (output: any, context: __SerdeContext): AttributeNameAndValue => { @@ -11434,11 +11742,25 @@ const deserializeAws_restJson1AttributeNameAndValueList = ( output: any, context: __SerdeContext ): AttributeNameAndValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AttributeNameAndValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AttributeNameAndValue(entry, context); + }); }; const deserializeAws_restJson1AttributeNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1BatchAddFacetToObjectResponse = ( @@ -11764,7 +12086,14 @@ const deserializeAws_restJson1BatchReadOperationResponseList = ( output: any, context: __SerdeContext ): BatchReadOperationResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchReadOperationResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchReadOperationResponse(entry, context); + }); }; const deserializeAws_restJson1BatchReadSuccessfulResponse = ( @@ -11927,7 +12256,14 @@ const deserializeAws_restJson1BatchWriteOperationResponseList = ( output: any, context: __SerdeContext ): BatchWriteOperationResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchWriteOperationResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchWriteOperationResponse(entry, context); + }); }; const deserializeAws_restJson1Directory = (output: any, context: __SerdeContext): Directory => { @@ -11943,7 +12279,14 @@ const deserializeAws_restJson1Directory = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1DirectoryList = (output: any, context: __SerdeContext): Directory[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Directory(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Directory(entry, context); + }); }; const deserializeAws_restJson1Facet = (output: any, context: __SerdeContext): Facet => { @@ -11989,7 +12332,14 @@ const deserializeAws_restJson1FacetAttributeDefinition = ( }; const deserializeAws_restJson1FacetAttributeList = (output: any, context: __SerdeContext): FacetAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FacetAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FacetAttribute(entry, context); + }); }; const deserializeAws_restJson1FacetAttributeReference = ( @@ -12007,7 +12357,14 @@ const deserializeAws_restJson1FacetAttributeReference = ( }; const deserializeAws_restJson1FacetNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1IndexAttachment = (output: any, context: __SerdeContext): IndexAttachment => { @@ -12022,27 +12379,43 @@ const deserializeAws_restJson1IndexAttachment = (output: any, context: __SerdeCo }; const deserializeAws_restJson1IndexAttachmentList = (output: any, context: __SerdeContext): IndexAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IndexAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IndexAttachment(entry, context); + }); }; const deserializeAws_restJson1LinkNameToObjectIdentifierMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ObjectIdentifierAndLinkNameList = ( output: any, context: __SerdeContext ): ObjectIdentifierAndLinkNameTuple[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ObjectIdentifierAndLinkNameTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ObjectIdentifierAndLinkNameTuple(entry, context); + }); }; const deserializeAws_restJson1ObjectIdentifierAndLinkNameTuple = ( @@ -12057,20 +12430,29 @@ const deserializeAws_restJson1ObjectIdentifierAndLinkNameTuple = ( }; const deserializeAws_restJson1ObjectIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ObjectIdentifierToLinkNameMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ObjectReference = (output: any, context: __SerdeContext): ObjectReference => { @@ -12096,7 +12478,14 @@ const deserializeAws_restJson1PathToObjectIdentifiersList = ( output: any, context: __SerdeContext ): PathToObjectIdentifiers[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PathToObjectIdentifiers(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PathToObjectIdentifiers(entry, context); + }); }; const deserializeAws_restJson1PolicyAttachment = (output: any, context: __SerdeContext): PolicyAttachment => { @@ -12109,7 +12498,14 @@ const deserializeAws_restJson1PolicyAttachment = (output: any, context: __SerdeC }; const deserializeAws_restJson1PolicyAttachmentList = (output: any, context: __SerdeContext): PolicyAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PolicyAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PolicyAttachment(entry, context); + }); }; const deserializeAws_restJson1PolicyToPath = (output: any, context: __SerdeContext): PolicyToPath => { @@ -12123,7 +12519,14 @@ const deserializeAws_restJson1PolicyToPath = (output: any, context: __SerdeConte }; const deserializeAws_restJson1PolicyToPathList = (output: any, context: __SerdeContext): PolicyToPath[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PolicyToPath(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PolicyToPath(entry, context); + }); }; const deserializeAws_restJson1Rule = (output: any, context: __SerdeContext): Rule => { @@ -12137,23 +12540,27 @@ const deserializeAws_restJson1Rule = (output: any, context: __SerdeContext): Rul }; const deserializeAws_restJson1RuleMap = (output: any, context: __SerdeContext): { [key: string]: Rule } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Rule }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Rule }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1Rule(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1RuleParameterMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1SchemaFacet = (output: any, context: __SerdeContext): SchemaFacet => { @@ -12164,7 +12571,14 @@ const deserializeAws_restJson1SchemaFacet = (output: any, context: __SerdeContex }; const deserializeAws_restJson1SchemaFacetList = (output: any, context: __SerdeContext): SchemaFacet[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SchemaFacet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SchemaFacet(entry, context); + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -12175,7 +12589,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TypedAttributeValue = (output: any, context: __SerdeContext): TypedAttributeValue => { @@ -12219,11 +12640,25 @@ const deserializeAws_restJson1TypedLinkAttributeDefinitionList = ( output: any, context: __SerdeContext ): TypedLinkAttributeDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TypedLinkAttributeDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TypedLinkAttributeDefinition(entry, context); + }); }; const deserializeAws_restJson1TypedLinkNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TypedLinkSchemaAndFacetName = ( @@ -12259,7 +12694,14 @@ const deserializeAws_restJson1TypedLinkSpecifier = (output: any, context: __Serd }; const deserializeAws_restJson1TypedLinkSpecifierList = (output: any, context: __SerdeContext): TypedLinkSpecifier[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TypedLinkSpecifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TypedLinkSpecifier(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -12282,6 +12724,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-cloudformation/protocols/Aws_query.ts b/clients/client-cloudformation/protocols/Aws_query.ts index b8207f0ae770..41e56417013d 100644 --- a/clients/client-cloudformation/protocols/Aws_query.ts +++ b/clients/client-cloudformation/protocols/Aws_query.ts @@ -325,7 +325,7 @@ export const serializeAws_queryCancelUpdateStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -341,7 +341,7 @@ export const serializeAws_queryContinueUpdateRollbackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -357,7 +357,7 @@ export const serializeAws_queryCreateChangeSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -373,7 +373,7 @@ export const serializeAws_queryCreateStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -389,7 +389,7 @@ export const serializeAws_queryCreateStackInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -405,7 +405,7 @@ export const serializeAws_queryCreateStackSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -421,7 +421,7 @@ export const serializeAws_queryDeleteChangeSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -437,7 +437,7 @@ export const serializeAws_queryDeleteStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -453,7 +453,7 @@ export const serializeAws_queryDeleteStackInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -469,7 +469,7 @@ export const serializeAws_queryDeleteStackSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -485,7 +485,7 @@ export const serializeAws_queryDeregisterTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -501,7 +501,7 @@ export const serializeAws_queryDescribeAccountLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -517,7 +517,7 @@ export const serializeAws_queryDescribeChangeSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -533,7 +533,7 @@ export const serializeAws_queryDescribeStackDriftDetectionStatusCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -549,7 +549,7 @@ export const serializeAws_queryDescribeStackEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -565,7 +565,7 @@ export const serializeAws_queryDescribeStackInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -581,7 +581,7 @@ export const serializeAws_queryDescribeStackResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -597,7 +597,7 @@ export const serializeAws_queryDescribeStackResourceDriftsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -613,7 +613,7 @@ export const serializeAws_queryDescribeStackResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -629,7 +629,7 @@ export const serializeAws_queryDescribeStacksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -645,7 +645,7 @@ export const serializeAws_queryDescribeStackSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -661,7 +661,7 @@ export const serializeAws_queryDescribeStackSetOperationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -677,7 +677,7 @@ export const serializeAws_queryDescribeTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -693,7 +693,7 @@ export const serializeAws_queryDescribeTypeRegistrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -709,7 +709,7 @@ export const serializeAws_queryDetectStackDriftCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -725,7 +725,7 @@ export const serializeAws_queryDetectStackResourceDriftCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -741,7 +741,7 @@ export const serializeAws_queryDetectStackSetDriftCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -757,7 +757,7 @@ export const serializeAws_queryEstimateTemplateCostCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -773,7 +773,7 @@ export const serializeAws_queryExecuteChangeSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -789,7 +789,7 @@ export const serializeAws_queryGetStackPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -805,7 +805,7 @@ export const serializeAws_queryGetTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -821,7 +821,7 @@ export const serializeAws_queryGetTemplateSummaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -837,7 +837,7 @@ export const serializeAws_queryListChangeSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -853,7 +853,7 @@ export const serializeAws_queryListExportsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -869,7 +869,7 @@ export const serializeAws_queryListImportsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -885,7 +885,7 @@ export const serializeAws_queryListStackInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -901,7 +901,7 @@ export const serializeAws_queryListStackResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -917,7 +917,7 @@ export const serializeAws_queryListStacksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -933,7 +933,7 @@ export const serializeAws_queryListStackSetOperationResultsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -949,7 +949,7 @@ export const serializeAws_queryListStackSetOperationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -965,7 +965,7 @@ export const serializeAws_queryListStackSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -981,7 +981,7 @@ export const serializeAws_queryListTypeRegistrationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -997,7 +997,7 @@ export const serializeAws_queryListTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1013,7 +1013,7 @@ export const serializeAws_queryListTypeVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1029,7 +1029,7 @@ export const serializeAws_queryRecordHandlerProgressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1045,7 +1045,7 @@ export const serializeAws_queryRegisterTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1061,7 +1061,7 @@ export const serializeAws_querySetStackPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1077,7 +1077,7 @@ export const serializeAws_querySetTypeDefaultVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1093,7 +1093,7 @@ export const serializeAws_querySignalResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1109,7 +1109,7 @@ export const serializeAws_queryStopStackSetOperationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1125,7 +1125,7 @@ export const serializeAws_queryUpdateStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1141,7 +1141,7 @@ export const serializeAws_queryUpdateStackInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1157,7 +1157,7 @@ export const serializeAws_queryUpdateStackSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1173,7 +1173,7 @@ export const serializeAws_queryUpdateTerminationProtectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1189,7 +1189,7 @@ export const serializeAws_queryValidateTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4633,6 +4633,9 @@ const serializeAws_queryAccountList = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4641,10 +4644,10 @@ const serializeAws_queryAccountList = (input: string[], context: __SerdeContext) const serializeAws_queryAutoDeployment = (input: AutoDeployment, context: __SerdeContext): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.RetainStacksOnAccountRemoval !== undefined) { + if (input.RetainStacksOnAccountRemoval !== undefined && input.RetainStacksOnAccountRemoval !== null) { entries["RetainStacksOnAccountRemoval"] = input.RetainStacksOnAccountRemoval; } return entries; @@ -4652,10 +4655,10 @@ const serializeAws_queryAutoDeployment = (input: AutoDeployment, context: __Serd const serializeAws_queryCancelUpdateStackInput = (input: CancelUpdateStackInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.ClientRequestToken !== undefined) { + if (input.ClientRequestToken !== undefined && input.ClientRequestToken !== null) { entries["ClientRequestToken"] = input.ClientRequestToken; } return entries; @@ -4665,6 +4668,9 @@ const serializeAws_queryCapabilities = (input: (Capability | string)[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4676,20 +4682,20 @@ const serializeAws_queryContinueUpdateRollbackInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.RoleARN !== undefined) { + if (input.RoleARN !== undefined && input.RoleARN !== null) { entries["RoleARN"] = input.RoleARN; } - if (input.ResourcesToSkip !== undefined) { + if (input.ResourcesToSkip !== undefined && input.ResourcesToSkip !== null) { const memberEntries = serializeAws_queryResourcesToSkip(input.ResourcesToSkip, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourcesToSkip.${key}`; entries[loc] = value; }); } - if (input.ClientRequestToken !== undefined) { + if (input.ClientRequestToken !== undefined && input.ClientRequestToken !== null) { entries["ClientRequestToken"] = input.ClientRequestToken; } return entries; @@ -4697,83 +4703,83 @@ const serializeAws_queryContinueUpdateRollbackInput = ( const serializeAws_queryCreateChangeSetInput = (input: CreateChangeSetInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.TemplateBody !== undefined) { + if (input.TemplateBody !== undefined && input.TemplateBody !== null) { entries["TemplateBody"] = input.TemplateBody; } - if (input.TemplateURL !== undefined) { + if (input.TemplateURL !== undefined && input.TemplateURL !== null) { entries["TemplateURL"] = input.TemplateURL; } - if (input.UsePreviousTemplate !== undefined) { + if (input.UsePreviousTemplate !== undefined && input.UsePreviousTemplate !== null) { entries["UsePreviousTemplate"] = input.UsePreviousTemplate; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParameters(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; entries[loc] = value; }); } - if (input.Capabilities !== undefined) { + if (input.Capabilities !== undefined && input.Capabilities !== null) { const memberEntries = serializeAws_queryCapabilities(input.Capabilities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Capabilities.${key}`; entries[loc] = value; }); } - if (input.ResourceTypes !== undefined) { + if (input.ResourceTypes !== undefined && input.ResourceTypes !== null) { const memberEntries = serializeAws_queryResourceTypes(input.ResourceTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceTypes.${key}`; entries[loc] = value; }); } - if (input.RoleARN !== undefined) { + if (input.RoleARN !== undefined && input.RoleARN !== null) { entries["RoleARN"] = input.RoleARN; } - if (input.RollbackConfiguration !== undefined) { + if (input.RollbackConfiguration !== undefined && input.RollbackConfiguration !== null) { const memberEntries = serializeAws_queryRollbackConfiguration(input.RollbackConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RollbackConfiguration.${key}`; entries[loc] = value; }); } - if (input.NotificationARNs !== undefined) { + if (input.NotificationARNs !== undefined && input.NotificationARNs !== null) { const memberEntries = serializeAws_queryNotificationARNs(input.NotificationARNs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NotificationARNs.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ChangeSetName !== undefined) { + if (input.ChangeSetName !== undefined && input.ChangeSetName !== null) { entries["ChangeSetName"] = input.ChangeSetName; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.ChangeSetType !== undefined) { + if (input.ChangeSetType !== undefined && input.ChangeSetType !== null) { entries["ChangeSetType"] = input.ChangeSetType; } - if (input.ResourcesToImport !== undefined) { + if (input.ResourcesToImport !== undefined && input.ResourcesToImport !== null) { const memberEntries = serializeAws_queryResourcesToImport(input.ResourcesToImport, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourcesToImport.${key}`; entries[loc] = value; }); } - if (input.IncludeNestedStacks !== undefined) { + if (input.IncludeNestedStacks !== undefined && input.IncludeNestedStacks !== null) { entries["IncludeNestedStacks"] = input.IncludeNestedStacks; } return entries; @@ -4781,79 +4787,79 @@ const serializeAws_queryCreateChangeSetInput = (input: CreateChangeSetInput, con const serializeAws_queryCreateStackInput = (input: CreateStackInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.TemplateBody !== undefined) { + if (input.TemplateBody !== undefined && input.TemplateBody !== null) { entries["TemplateBody"] = input.TemplateBody; } - if (input.TemplateURL !== undefined) { + if (input.TemplateURL !== undefined && input.TemplateURL !== null) { entries["TemplateURL"] = input.TemplateURL; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParameters(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; entries[loc] = value; }); } - if (input.DisableRollback !== undefined) { + if (input.DisableRollback !== undefined && input.DisableRollback !== null) { entries["DisableRollback"] = input.DisableRollback; } - if (input.RollbackConfiguration !== undefined) { + if (input.RollbackConfiguration !== undefined && input.RollbackConfiguration !== null) { const memberEntries = serializeAws_queryRollbackConfiguration(input.RollbackConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RollbackConfiguration.${key}`; entries[loc] = value; }); } - if (input.TimeoutInMinutes !== undefined) { + if (input.TimeoutInMinutes !== undefined && input.TimeoutInMinutes !== null) { entries["TimeoutInMinutes"] = input.TimeoutInMinutes; } - if (input.NotificationARNs !== undefined) { + if (input.NotificationARNs !== undefined && input.NotificationARNs !== null) { const memberEntries = serializeAws_queryNotificationARNs(input.NotificationARNs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NotificationARNs.${key}`; entries[loc] = value; }); } - if (input.Capabilities !== undefined) { + if (input.Capabilities !== undefined && input.Capabilities !== null) { const memberEntries = serializeAws_queryCapabilities(input.Capabilities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Capabilities.${key}`; entries[loc] = value; }); } - if (input.ResourceTypes !== undefined) { + if (input.ResourceTypes !== undefined && input.ResourceTypes !== null) { const memberEntries = serializeAws_queryResourceTypes(input.ResourceTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceTypes.${key}`; entries[loc] = value; }); } - if (input.RoleARN !== undefined) { + if (input.RoleARN !== undefined && input.RoleARN !== null) { entries["RoleARN"] = input.RoleARN; } - if (input.OnFailure !== undefined) { + if (input.OnFailure !== undefined && input.OnFailure !== null) { entries["OnFailure"] = input.OnFailure; } - if (input.StackPolicyBody !== undefined) { + if (input.StackPolicyBody !== undefined && input.StackPolicyBody !== null) { entries["StackPolicyBody"] = input.StackPolicyBody; } - if (input.StackPolicyURL !== undefined) { + if (input.StackPolicyURL !== undefined && input.StackPolicyURL !== null) { entries["StackPolicyURL"] = input.StackPolicyURL; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ClientRequestToken !== undefined) { + if (input.ClientRequestToken !== undefined && input.ClientRequestToken !== null) { entries["ClientRequestToken"] = input.ClientRequestToken; } - if (input.EnableTerminationProtection !== undefined) { + if (input.EnableTerminationProtection !== undefined && input.EnableTerminationProtection !== null) { entries["EnableTerminationProtection"] = input.EnableTerminationProtection; } return entries; @@ -4864,38 +4870,38 @@ const serializeAws_queryCreateStackInstancesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.Accounts !== undefined) { + if (input.Accounts !== undefined && input.Accounts !== null) { const memberEntries = serializeAws_queryAccountList(input.Accounts, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Accounts.${key}`; entries[loc] = value; }); } - if (input.DeploymentTargets !== undefined) { + if (input.DeploymentTargets !== undefined && input.DeploymentTargets !== null) { const memberEntries = serializeAws_queryDeploymentTargets(input.DeploymentTargets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DeploymentTargets.${key}`; entries[loc] = value; }); } - if (input.Regions !== undefined) { + if (input.Regions !== undefined && input.Regions !== null) { const memberEntries = serializeAws_queryRegionList(input.Regions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Regions.${key}`; entries[loc] = value; }); } - if (input.ParameterOverrides !== undefined) { + if (input.ParameterOverrides !== undefined && input.ParameterOverrides !== null) { const memberEntries = serializeAws_queryParameters(input.ParameterOverrides, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ParameterOverrides.${key}`; entries[loc] = value; }); } - if (input.OperationPreferences !== undefined) { + if (input.OperationPreferences !== undefined && input.OperationPreferences !== null) { const memberEntries = serializeAws_queryStackSetOperationPreferences(input.OperationPreferences, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OperationPreferences.${key}`; @@ -4905,7 +4911,7 @@ const serializeAws_queryCreateStackInstancesInput = ( if (input.OperationId === undefined) { input.OperationId = generateIdempotencyToken(); } - if (input.OperationId !== undefined) { + if (input.OperationId !== undefined && input.OperationId !== null) { entries["OperationId"] = input.OperationId; } return entries; @@ -4913,49 +4919,49 @@ const serializeAws_queryCreateStackInstancesInput = ( const serializeAws_queryCreateStackSetInput = (input: CreateStackSetInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.TemplateBody !== undefined) { + if (input.TemplateBody !== undefined && input.TemplateBody !== null) { entries["TemplateBody"] = input.TemplateBody; } - if (input.TemplateURL !== undefined) { + if (input.TemplateURL !== undefined && input.TemplateURL !== null) { entries["TemplateURL"] = input.TemplateURL; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParameters(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; entries[loc] = value; }); } - if (input.Capabilities !== undefined) { + if (input.Capabilities !== undefined && input.Capabilities !== null) { const memberEntries = serializeAws_queryCapabilities(input.Capabilities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Capabilities.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.AdministrationRoleARN !== undefined) { + if (input.AdministrationRoleARN !== undefined && input.AdministrationRoleARN !== null) { entries["AdministrationRoleARN"] = input.AdministrationRoleARN; } - if (input.ExecutionRoleName !== undefined) { + if (input.ExecutionRoleName !== undefined && input.ExecutionRoleName !== null) { entries["ExecutionRoleName"] = input.ExecutionRoleName; } - if (input.PermissionModel !== undefined) { + if (input.PermissionModel !== undefined && input.PermissionModel !== null) { entries["PermissionModel"] = input.PermissionModel; } - if (input.AutoDeployment !== undefined) { + if (input.AutoDeployment !== undefined && input.AutoDeployment !== null) { const memberEntries = serializeAws_queryAutoDeployment(input.AutoDeployment, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AutoDeployment.${key}`; @@ -4965,7 +4971,7 @@ const serializeAws_queryCreateStackSetInput = (input: CreateStackSetInput, conte if (input.ClientRequestToken === undefined) { input.ClientRequestToken = generateIdempotencyToken(); } - if (input.ClientRequestToken !== undefined) { + if (input.ClientRequestToken !== undefined && input.ClientRequestToken !== null) { entries["ClientRequestToken"] = input.ClientRequestToken; } return entries; @@ -4973,10 +4979,10 @@ const serializeAws_queryCreateStackSetInput = (input: CreateStackSetInput, conte const serializeAws_queryDeleteChangeSetInput = (input: DeleteChangeSetInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ChangeSetName !== undefined) { + if (input.ChangeSetName !== undefined && input.ChangeSetName !== null) { entries["ChangeSetName"] = input.ChangeSetName; } - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } return entries; @@ -4984,20 +4990,20 @@ const serializeAws_queryDeleteChangeSetInput = (input: DeleteChangeSetInput, con const serializeAws_queryDeleteStackInput = (input: DeleteStackInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.RetainResources !== undefined) { + if (input.RetainResources !== undefined && input.RetainResources !== null) { const memberEntries = serializeAws_queryRetainResources(input.RetainResources, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RetainResources.${key}`; entries[loc] = value; }); } - if (input.RoleARN !== undefined) { + if (input.RoleARN !== undefined && input.RoleARN !== null) { entries["RoleARN"] = input.RoleARN; } - if (input.ClientRequestToken !== undefined) { + if (input.ClientRequestToken !== undefined && input.ClientRequestToken !== null) { entries["ClientRequestToken"] = input.ClientRequestToken; } return entries; @@ -5008,44 +5014,44 @@ const serializeAws_queryDeleteStackInstancesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.Accounts !== undefined) { + if (input.Accounts !== undefined && input.Accounts !== null) { const memberEntries = serializeAws_queryAccountList(input.Accounts, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Accounts.${key}`; entries[loc] = value; }); } - if (input.DeploymentTargets !== undefined) { + if (input.DeploymentTargets !== undefined && input.DeploymentTargets !== null) { const memberEntries = serializeAws_queryDeploymentTargets(input.DeploymentTargets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DeploymentTargets.${key}`; entries[loc] = value; }); } - if (input.Regions !== undefined) { + if (input.Regions !== undefined && input.Regions !== null) { const memberEntries = serializeAws_queryRegionList(input.Regions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Regions.${key}`; entries[loc] = value; }); } - if (input.OperationPreferences !== undefined) { + if (input.OperationPreferences !== undefined && input.OperationPreferences !== null) { const memberEntries = serializeAws_queryStackSetOperationPreferences(input.OperationPreferences, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OperationPreferences.${key}`; entries[loc] = value; }); } - if (input.RetainStacks !== undefined) { + if (input.RetainStacks !== undefined && input.RetainStacks !== null) { entries["RetainStacks"] = input.RetainStacks; } if (input.OperationId === undefined) { input.OperationId = generateIdempotencyToken(); } - if (input.OperationId !== undefined) { + if (input.OperationId !== undefined && input.OperationId !== null) { entries["OperationId"] = input.OperationId; } return entries; @@ -5053,7 +5059,7 @@ const serializeAws_queryDeleteStackInstancesInput = ( const serializeAws_queryDeleteStackSetInput = (input: DeleteStackSetInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } return entries; @@ -5061,14 +5067,14 @@ const serializeAws_queryDeleteStackSetInput = (input: DeleteStackSetInput, conte const serializeAws_queryDeploymentTargets = (input: DeploymentTargets, context: __SerdeContext): any => { const entries: any = {}; - if (input.Accounts !== undefined) { + if (input.Accounts !== undefined && input.Accounts !== null) { const memberEntries = serializeAws_queryAccountList(input.Accounts, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Accounts.${key}`; entries[loc] = value; }); } - if (input.OrganizationalUnitIds !== undefined) { + if (input.OrganizationalUnitIds !== undefined && input.OrganizationalUnitIds !== null) { const memberEntries = serializeAws_queryOrganizationalUnitIdList(input.OrganizationalUnitIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OrganizationalUnitIds.${key}`; @@ -5080,16 +5086,16 @@ const serializeAws_queryDeploymentTargets = (input: DeploymentTargets, context: const serializeAws_queryDeregisterTypeInput = (input: DeregisterTypeInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.TypeName !== undefined) { + if (input.TypeName !== undefined && input.TypeName !== null) { entries["TypeName"] = input.TypeName; } - if (input.VersionId !== undefined) { + if (input.VersionId !== undefined && input.VersionId !== null) { entries["VersionId"] = input.VersionId; } return entries; @@ -5100,7 +5106,7 @@ const serializeAws_queryDescribeAccountLimitsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5108,13 +5114,13 @@ const serializeAws_queryDescribeAccountLimitsInput = ( const serializeAws_queryDescribeChangeSetInput = (input: DescribeChangeSetInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ChangeSetName !== undefined) { + if (input.ChangeSetName !== undefined && input.ChangeSetName !== null) { entries["ChangeSetName"] = input.ChangeSetName; } - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5125,7 +5131,7 @@ const serializeAws_queryDescribeStackDriftDetectionStatusInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackDriftDetectionId !== undefined) { + if (input.StackDriftDetectionId !== undefined && input.StackDriftDetectionId !== null) { entries["StackDriftDetectionId"] = input.StackDriftDetectionId; } return entries; @@ -5133,10 +5139,10 @@ const serializeAws_queryDescribeStackDriftDetectionStatusInput = ( const serializeAws_queryDescribeStackEventsInput = (input: DescribeStackEventsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5147,13 +5153,13 @@ const serializeAws_queryDescribeStackInstanceInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.StackInstanceAccount !== undefined) { + if (input.StackInstanceAccount !== undefined && input.StackInstanceAccount !== null) { entries["StackInstanceAccount"] = input.StackInstanceAccount; } - if (input.StackInstanceRegion !== undefined) { + if (input.StackInstanceRegion !== undefined && input.StackInstanceRegion !== null) { entries["StackInstanceRegion"] = input.StackInstanceRegion; } return entries; @@ -5164,10 +5170,10 @@ const serializeAws_queryDescribeStackResourceDriftsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.StackResourceDriftStatusFilters !== undefined) { + if (input.StackResourceDriftStatusFilters !== undefined && input.StackResourceDriftStatusFilters !== null) { const memberEntries = serializeAws_queryStackResourceDriftStatusFilters( input.StackResourceDriftStatusFilters, context @@ -5177,10 +5183,10 @@ const serializeAws_queryDescribeStackResourceDriftsInput = ( entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -5191,10 +5197,10 @@ const serializeAws_queryDescribeStackResourceInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.LogicalResourceId !== undefined) { + if (input.LogicalResourceId !== undefined && input.LogicalResourceId !== null) { entries["LogicalResourceId"] = input.LogicalResourceId; } return entries; @@ -5205,13 +5211,13 @@ const serializeAws_queryDescribeStackResourcesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.LogicalResourceId !== undefined) { + if (input.LogicalResourceId !== undefined && input.LogicalResourceId !== null) { entries["LogicalResourceId"] = input.LogicalResourceId; } - if (input.PhysicalResourceId !== undefined) { + if (input.PhysicalResourceId !== undefined && input.PhysicalResourceId !== null) { entries["PhysicalResourceId"] = input.PhysicalResourceId; } return entries; @@ -5219,7 +5225,7 @@ const serializeAws_queryDescribeStackResourcesInput = ( const serializeAws_queryDescribeStackSetInput = (input: DescribeStackSetInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } return entries; @@ -5230,10 +5236,10 @@ const serializeAws_queryDescribeStackSetOperationInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.OperationId !== undefined) { + if (input.OperationId !== undefined && input.OperationId !== null) { entries["OperationId"] = input.OperationId; } return entries; @@ -5241,10 +5247,10 @@ const serializeAws_queryDescribeStackSetOperationInput = ( const serializeAws_queryDescribeStacksInput = (input: DescribeStacksInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5252,16 +5258,16 @@ const serializeAws_queryDescribeStacksInput = (input: DescribeStacksInput, conte const serializeAws_queryDescribeTypeInput = (input: DescribeTypeInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.TypeName !== undefined) { + if (input.TypeName !== undefined && input.TypeName !== null) { entries["TypeName"] = input.TypeName; } - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } - if (input.VersionId !== undefined) { + if (input.VersionId !== undefined && input.VersionId !== null) { entries["VersionId"] = input.VersionId; } return entries; @@ -5272,7 +5278,7 @@ const serializeAws_queryDescribeTypeRegistrationInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RegistrationToken !== undefined) { + if (input.RegistrationToken !== undefined && input.RegistrationToken !== null) { entries["RegistrationToken"] = input.RegistrationToken; } return entries; @@ -5280,10 +5286,10 @@ const serializeAws_queryDescribeTypeRegistrationInput = ( const serializeAws_queryDetectStackDriftInput = (input: DetectStackDriftInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.LogicalResourceIds !== undefined) { + if (input.LogicalResourceIds !== undefined && input.LogicalResourceIds !== null) { const memberEntries = serializeAws_queryLogicalResourceIds(input.LogicalResourceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LogicalResourceIds.${key}`; @@ -5298,10 +5304,10 @@ const serializeAws_queryDetectStackResourceDriftInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.LogicalResourceId !== undefined) { + if (input.LogicalResourceId !== undefined && input.LogicalResourceId !== null) { entries["LogicalResourceId"] = input.LogicalResourceId; } return entries; @@ -5309,10 +5315,10 @@ const serializeAws_queryDetectStackResourceDriftInput = ( const serializeAws_queryDetectStackSetDriftInput = (input: DetectStackSetDriftInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.OperationPreferences !== undefined) { + if (input.OperationPreferences !== undefined && input.OperationPreferences !== null) { const memberEntries = serializeAws_queryStackSetOperationPreferences(input.OperationPreferences, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OperationPreferences.${key}`; @@ -5322,7 +5328,7 @@ const serializeAws_queryDetectStackSetDriftInput = (input: DetectStackSetDriftIn if (input.OperationId === undefined) { input.OperationId = generateIdempotencyToken(); } - if (input.OperationId !== undefined) { + if (input.OperationId !== undefined && input.OperationId !== null) { entries["OperationId"] = input.OperationId; } return entries; @@ -5333,13 +5339,13 @@ const serializeAws_queryEstimateTemplateCostInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateBody !== undefined) { + if (input.TemplateBody !== undefined && input.TemplateBody !== null) { entries["TemplateBody"] = input.TemplateBody; } - if (input.TemplateURL !== undefined) { + if (input.TemplateURL !== undefined && input.TemplateURL !== null) { entries["TemplateURL"] = input.TemplateURL; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParameters(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -5351,13 +5357,13 @@ const serializeAws_queryEstimateTemplateCostInput = ( const serializeAws_queryExecuteChangeSetInput = (input: ExecuteChangeSetInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ChangeSetName !== undefined) { + if (input.ChangeSetName !== undefined && input.ChangeSetName !== null) { entries["ChangeSetName"] = input.ChangeSetName; } - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.ClientRequestToken !== undefined) { + if (input.ClientRequestToken !== undefined && input.ClientRequestToken !== null) { entries["ClientRequestToken"] = input.ClientRequestToken; } return entries; @@ -5365,7 +5371,7 @@ const serializeAws_queryExecuteChangeSetInput = (input: ExecuteChangeSetInput, c const serializeAws_queryGetStackPolicyInput = (input: GetStackPolicyInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } return entries; @@ -5373,13 +5379,13 @@ const serializeAws_queryGetStackPolicyInput = (input: GetStackPolicyInput, conte const serializeAws_queryGetTemplateInput = (input: GetTemplateInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.ChangeSetName !== undefined) { + if (input.ChangeSetName !== undefined && input.ChangeSetName !== null) { entries["ChangeSetName"] = input.ChangeSetName; } - if (input.TemplateStage !== undefined) { + if (input.TemplateStage !== undefined && input.TemplateStage !== null) { entries["TemplateStage"] = input.TemplateStage; } return entries; @@ -5387,16 +5393,16 @@ const serializeAws_queryGetTemplateInput = (input: GetTemplateInput, context: __ const serializeAws_queryGetTemplateSummaryInput = (input: GetTemplateSummaryInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TemplateBody !== undefined) { + if (input.TemplateBody !== undefined && input.TemplateBody !== null) { entries["TemplateBody"] = input.TemplateBody; } - if (input.TemplateURL !== undefined) { + if (input.TemplateURL !== undefined && input.TemplateURL !== null) { entries["TemplateURL"] = input.TemplateURL; } - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } return entries; @@ -5404,10 +5410,10 @@ const serializeAws_queryGetTemplateSummaryInput = (input: GetTemplateSummaryInpu const serializeAws_queryListChangeSetsInput = (input: ListChangeSetsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5415,7 +5421,7 @@ const serializeAws_queryListChangeSetsInput = (input: ListChangeSetsInput, conte const serializeAws_queryListExportsInput = (input: ListExportsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5423,10 +5429,10 @@ const serializeAws_queryListExportsInput = (input: ListExportsInput, context: __ const serializeAws_queryListImportsInput = (input: ListImportsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ExportName !== undefined) { + if (input.ExportName !== undefined && input.ExportName !== null) { entries["ExportName"] = input.ExportName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5434,26 +5440,26 @@ const serializeAws_queryListImportsInput = (input: ListImportsInput, context: __ const serializeAws_queryListStackInstancesInput = (input: ListStackInstancesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryStackInstanceFilters(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.StackInstanceAccount !== undefined) { + if (input.StackInstanceAccount !== undefined && input.StackInstanceAccount !== null) { entries["StackInstanceAccount"] = input.StackInstanceAccount; } - if (input.StackInstanceRegion !== undefined) { + if (input.StackInstanceRegion !== undefined && input.StackInstanceRegion !== null) { entries["StackInstanceRegion"] = input.StackInstanceRegion; } return entries; @@ -5461,10 +5467,10 @@ const serializeAws_queryListStackInstancesInput = (input: ListStackInstancesInpu const serializeAws_queryListStackResourcesInput = (input: ListStackResourcesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5475,16 +5481,16 @@ const serializeAws_queryListStackSetOperationResultsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.OperationId !== undefined) { + if (input.OperationId !== undefined && input.OperationId !== null) { entries["OperationId"] = input.OperationId; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -5495,13 +5501,13 @@ const serializeAws_queryListStackSetOperationsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -5509,13 +5515,13 @@ const serializeAws_queryListStackSetOperationsInput = ( const serializeAws_queryListStackSetsInput = (input: ListStackSetsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { entries["Status"] = input.Status; } return entries; @@ -5523,10 +5529,10 @@ const serializeAws_queryListStackSetsInput = (input: ListStackSetsInput, context const serializeAws_queryListStacksInput = (input: ListStacksInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.StackStatusFilter !== undefined) { + if (input.StackStatusFilter !== undefined && input.StackStatusFilter !== null) { const memberEntries = serializeAws_queryStackStatusFilter(input.StackStatusFilter, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StackStatusFilter.${key}`; @@ -5541,22 +5547,22 @@ const serializeAws_queryListTypeRegistrationsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.TypeName !== undefined) { + if (input.TypeName !== undefined && input.TypeName !== null) { entries["TypeName"] = input.TypeName; } - if (input.TypeArn !== undefined) { + if (input.TypeArn !== undefined && input.TypeArn !== null) { entries["TypeArn"] = input.TypeArn; } - if (input.RegistrationStatusFilter !== undefined) { + if (input.RegistrationStatusFilter !== undefined && input.RegistrationStatusFilter !== null) { entries["RegistrationStatusFilter"] = input.RegistrationStatusFilter; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5564,22 +5570,22 @@ const serializeAws_queryListTypeRegistrationsInput = ( const serializeAws_queryListTypesInput = (input: ListTypesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Visibility !== undefined) { + if (input.Visibility !== undefined && input.Visibility !== null) { entries["Visibility"] = input.Visibility; } - if (input.ProvisioningType !== undefined) { + if (input.ProvisioningType !== undefined && input.ProvisioningType !== null) { entries["ProvisioningType"] = input.ProvisioningType; } - if (input.DeprecatedStatus !== undefined) { + if (input.DeprecatedStatus !== undefined && input.DeprecatedStatus !== null) { entries["DeprecatedStatus"] = input.DeprecatedStatus; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -5587,22 +5593,22 @@ const serializeAws_queryListTypesInput = (input: ListTypesInput, context: __Serd const serializeAws_queryListTypeVersionsInput = (input: ListTypeVersionsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.TypeName !== undefined) { + if (input.TypeName !== undefined && input.TypeName !== null) { entries["TypeName"] = input.TypeName; } - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DeprecatedStatus !== undefined) { + if (input.DeprecatedStatus !== undefined && input.DeprecatedStatus !== null) { entries["DeprecatedStatus"] = input.DeprecatedStatus; } return entries; @@ -5610,10 +5616,10 @@ const serializeAws_queryListTypeVersionsInput = (input: ListTypeVersionsInput, c const serializeAws_queryLoggingConfig = (input: LoggingConfig, context: __SerdeContext): any => { const entries: any = {}; - if (input.LogRoleArn !== undefined) { + if (input.LogRoleArn !== undefined && input.LogRoleArn !== null) { entries["LogRoleArn"] = input.LogRoleArn; } - if (input.LogGroupName !== undefined) { + if (input.LogGroupName !== undefined && input.LogGroupName !== null) { entries["LogGroupName"] = input.LogGroupName; } return entries; @@ -5623,6 +5629,9 @@ const serializeAws_queryLogicalResourceIds = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5633,6 +5642,9 @@ const serializeAws_queryNotificationARNs = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5643,6 +5655,9 @@ const serializeAws_queryOrganizationalUnitIdList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5651,16 +5666,16 @@ const serializeAws_queryOrganizationalUnitIdList = (input: string[], context: __ const serializeAws_queryParameter = (input: Parameter, context: __SerdeContext): any => { const entries: any = {}; - if (input.ParameterKey !== undefined) { + if (input.ParameterKey !== undefined && input.ParameterKey !== null) { entries["ParameterKey"] = input.ParameterKey; } - if (input.ParameterValue !== undefined) { + if (input.ParameterValue !== undefined && input.ParameterValue !== null) { entries["ParameterValue"] = input.ParameterValue; } - if (input.UsePreviousValue !== undefined) { + if (input.UsePreviousValue !== undefined && input.UsePreviousValue !== null) { entries["UsePreviousValue"] = input.UsePreviousValue; } - if (input.ResolvedValue !== undefined) { + if (input.ResolvedValue !== undefined && input.ResolvedValue !== null) { entries["ResolvedValue"] = input.ResolvedValue; } return entries; @@ -5670,6 +5685,9 @@ const serializeAws_queryParameters = (input: Parameter[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryParameter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5684,25 +5702,25 @@ const serializeAws_queryRecordHandlerProgressInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.BearerToken !== undefined) { + if (input.BearerToken !== undefined && input.BearerToken !== null) { entries["BearerToken"] = input.BearerToken; } - if (input.OperationStatus !== undefined) { + if (input.OperationStatus !== undefined && input.OperationStatus !== null) { entries["OperationStatus"] = input.OperationStatus; } - if (input.CurrentOperationStatus !== undefined) { + if (input.CurrentOperationStatus !== undefined && input.CurrentOperationStatus !== null) { entries["CurrentOperationStatus"] = input.CurrentOperationStatus; } - if (input.StatusMessage !== undefined) { + if (input.StatusMessage !== undefined && input.StatusMessage !== null) { entries["StatusMessage"] = input.StatusMessage; } - if (input.ErrorCode !== undefined) { + if (input.ErrorCode !== undefined && input.ErrorCode !== null) { entries["ErrorCode"] = input.ErrorCode; } - if (input.ResourceModel !== undefined) { + if (input.ResourceModel !== undefined && input.ResourceModel !== null) { entries["ResourceModel"] = input.ResourceModel; } - if (input.ClientRequestToken !== undefined) { + if (input.ClientRequestToken !== undefined && input.ClientRequestToken !== null) { entries["ClientRequestToken"] = input.ClientRequestToken; } return entries; @@ -5712,6 +5730,9 @@ const serializeAws_queryRegionList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5720,26 +5741,26 @@ const serializeAws_queryRegionList = (input: string[], context: __SerdeContext): const serializeAws_queryRegisterTypeInput = (input: RegisterTypeInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.TypeName !== undefined) { + if (input.TypeName !== undefined && input.TypeName !== null) { entries["TypeName"] = input.TypeName; } - if (input.SchemaHandlerPackage !== undefined) { + if (input.SchemaHandlerPackage !== undefined && input.SchemaHandlerPackage !== null) { entries["SchemaHandlerPackage"] = input.SchemaHandlerPackage; } - if (input.LoggingConfig !== undefined) { + if (input.LoggingConfig !== undefined && input.LoggingConfig !== null) { const memberEntries = serializeAws_queryLoggingConfig(input.LoggingConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoggingConfig.${key}`; entries[loc] = value; }); } - if (input.ExecutionRoleArn !== undefined) { + if (input.ExecutionRoleArn !== undefined && input.ExecutionRoleArn !== null) { entries["ExecutionRoleArn"] = input.ExecutionRoleArn; } - if (input.ClientRequestToken !== undefined) { + if (input.ClientRequestToken !== undefined && input.ClientRequestToken !== null) { entries["ClientRequestToken"] = input.ClientRequestToken; } return entries; @@ -5751,11 +5772,13 @@ const serializeAws_queryResourceIdentifierProperties = ( ): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.key`] = key; - entries[`entry.${counter}.value`] = input[key]; - counter++; - }); + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.key`] = key; + entries[`entry.${counter}.value`] = input[key]; + counter++; + }); return entries; }; @@ -5763,6 +5786,9 @@ const serializeAws_queryResourcesToImport = (input: ResourceToImport[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryResourceToImport(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5776,6 +5802,9 @@ const serializeAws_queryResourcesToSkip = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5784,13 +5813,13 @@ const serializeAws_queryResourcesToSkip = (input: string[], context: __SerdeCont const serializeAws_queryResourceToImport = (input: ResourceToImport, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceType !== undefined) { + if (input.ResourceType !== undefined && input.ResourceType !== null) { entries["ResourceType"] = input.ResourceType; } - if (input.LogicalResourceId !== undefined) { + if (input.LogicalResourceId !== undefined && input.LogicalResourceId !== null) { entries["LogicalResourceId"] = input.LogicalResourceId; } - if (input.ResourceIdentifier !== undefined) { + if (input.ResourceIdentifier !== undefined && input.ResourceIdentifier !== null) { const memberEntries = serializeAws_queryResourceIdentifierProperties(input.ResourceIdentifier, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceIdentifier.${key}`; @@ -5804,6 +5833,9 @@ const serializeAws_queryResourceTypes = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5814,6 +5846,9 @@ const serializeAws_queryRetainResources = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5822,14 +5857,14 @@ const serializeAws_queryRetainResources = (input: string[], context: __SerdeCont const serializeAws_queryRollbackConfiguration = (input: RollbackConfiguration, context: __SerdeContext): any => { const entries: any = {}; - if (input.RollbackTriggers !== undefined) { + if (input.RollbackTriggers !== undefined && input.RollbackTriggers !== null) { const memberEntries = serializeAws_queryRollbackTriggers(input.RollbackTriggers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RollbackTriggers.${key}`; entries[loc] = value; }); } - if (input.MonitoringTimeInMinutes !== undefined) { + if (input.MonitoringTimeInMinutes !== undefined && input.MonitoringTimeInMinutes !== null) { entries["MonitoringTimeInMinutes"] = input.MonitoringTimeInMinutes; } return entries; @@ -5837,10 +5872,10 @@ const serializeAws_queryRollbackConfiguration = (input: RollbackConfiguration, c const serializeAws_queryRollbackTrigger = (input: RollbackTrigger, context: __SerdeContext): any => { const entries: any = {}; - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } return entries; @@ -5850,6 +5885,9 @@ const serializeAws_queryRollbackTriggers = (input: RollbackTrigger[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryRollbackTrigger(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5861,13 +5899,13 @@ const serializeAws_queryRollbackTriggers = (input: RollbackTrigger[], context: _ const serializeAws_querySetStackPolicyInput = (input: SetStackPolicyInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.StackPolicyBody !== undefined) { + if (input.StackPolicyBody !== undefined && input.StackPolicyBody !== null) { entries["StackPolicyBody"] = input.StackPolicyBody; } - if (input.StackPolicyURL !== undefined) { + if (input.StackPolicyURL !== undefined && input.StackPolicyURL !== null) { entries["StackPolicyURL"] = input.StackPolicyURL; } return entries; @@ -5878,16 +5916,16 @@ const serializeAws_querySetTypeDefaultVersionInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.TypeName !== undefined) { + if (input.TypeName !== undefined && input.TypeName !== null) { entries["TypeName"] = input.TypeName; } - if (input.VersionId !== undefined) { + if (input.VersionId !== undefined && input.VersionId !== null) { entries["VersionId"] = input.VersionId; } return entries; @@ -5895,16 +5933,16 @@ const serializeAws_querySetTypeDefaultVersionInput = ( const serializeAws_querySignalResourceInput = (input: SignalResourceInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.LogicalResourceId !== undefined) { + if (input.LogicalResourceId !== undefined && input.LogicalResourceId !== null) { entries["LogicalResourceId"] = input.LogicalResourceId; } - if (input.UniqueId !== undefined) { + if (input.UniqueId !== undefined && input.UniqueId !== null) { entries["UniqueId"] = input.UniqueId; } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { entries["Status"] = input.Status; } return entries; @@ -5912,10 +5950,10 @@ const serializeAws_querySignalResourceInput = (input: SignalResourceInput, conte const serializeAws_queryStackInstanceFilter = (input: StackInstanceFilter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { entries["Values"] = input.Values; } return entries; @@ -5925,6 +5963,9 @@ const serializeAws_queryStackInstanceFilters = (input: StackInstanceFilter[], co const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryStackInstanceFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5941,6 +5982,9 @@ const serializeAws_queryStackResourceDriftStatusFilters = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5952,23 +5996,23 @@ const serializeAws_queryStackSetOperationPreferences = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RegionOrder !== undefined) { + if (input.RegionOrder !== undefined && input.RegionOrder !== null) { const memberEntries = serializeAws_queryRegionList(input.RegionOrder, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RegionOrder.${key}`; entries[loc] = value; }); } - if (input.FailureToleranceCount !== undefined) { + if (input.FailureToleranceCount !== undefined && input.FailureToleranceCount !== null) { entries["FailureToleranceCount"] = input.FailureToleranceCount; } - if (input.FailureTolerancePercentage !== undefined) { + if (input.FailureTolerancePercentage !== undefined && input.FailureTolerancePercentage !== null) { entries["FailureTolerancePercentage"] = input.FailureTolerancePercentage; } - if (input.MaxConcurrentCount !== undefined) { + if (input.MaxConcurrentCount !== undefined && input.MaxConcurrentCount !== null) { entries["MaxConcurrentCount"] = input.MaxConcurrentCount; } - if (input.MaxConcurrentPercentage !== undefined) { + if (input.MaxConcurrentPercentage !== undefined && input.MaxConcurrentPercentage !== null) { entries["MaxConcurrentPercentage"] = input.MaxConcurrentPercentage; } return entries; @@ -5978,6 +6022,9 @@ const serializeAws_queryStackStatusFilter = (input: (StackStatus | string)[], co const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5989,10 +6036,10 @@ const serializeAws_queryStopStackSetOperationInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.OperationId !== undefined) { + if (input.OperationId !== undefined && input.OperationId !== null) { entries["OperationId"] = input.OperationId; } return entries; @@ -6000,10 +6047,10 @@ const serializeAws_queryStopStackSetOperationInput = ( const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -6013,6 +6060,9 @@ const serializeAws_queryTags = (input: Tag[], context: __SerdeContext): any => { const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -6024,76 +6074,76 @@ const serializeAws_queryTags = (input: Tag[], context: __SerdeContext): any => { const serializeAws_queryUpdateStackInput = (input: UpdateStackInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } - if (input.TemplateBody !== undefined) { + if (input.TemplateBody !== undefined && input.TemplateBody !== null) { entries["TemplateBody"] = input.TemplateBody; } - if (input.TemplateURL !== undefined) { + if (input.TemplateURL !== undefined && input.TemplateURL !== null) { entries["TemplateURL"] = input.TemplateURL; } - if (input.UsePreviousTemplate !== undefined) { + if (input.UsePreviousTemplate !== undefined && input.UsePreviousTemplate !== null) { entries["UsePreviousTemplate"] = input.UsePreviousTemplate; } - if (input.StackPolicyDuringUpdateBody !== undefined) { + if (input.StackPolicyDuringUpdateBody !== undefined && input.StackPolicyDuringUpdateBody !== null) { entries["StackPolicyDuringUpdateBody"] = input.StackPolicyDuringUpdateBody; } - if (input.StackPolicyDuringUpdateURL !== undefined) { + if (input.StackPolicyDuringUpdateURL !== undefined && input.StackPolicyDuringUpdateURL !== null) { entries["StackPolicyDuringUpdateURL"] = input.StackPolicyDuringUpdateURL; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParameters(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; entries[loc] = value; }); } - if (input.Capabilities !== undefined) { + if (input.Capabilities !== undefined && input.Capabilities !== null) { const memberEntries = serializeAws_queryCapabilities(input.Capabilities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Capabilities.${key}`; entries[loc] = value; }); } - if (input.ResourceTypes !== undefined) { + if (input.ResourceTypes !== undefined && input.ResourceTypes !== null) { const memberEntries = serializeAws_queryResourceTypes(input.ResourceTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceTypes.${key}`; entries[loc] = value; }); } - if (input.RoleARN !== undefined) { + if (input.RoleARN !== undefined && input.RoleARN !== null) { entries["RoleARN"] = input.RoleARN; } - if (input.RollbackConfiguration !== undefined) { + if (input.RollbackConfiguration !== undefined && input.RollbackConfiguration !== null) { const memberEntries = serializeAws_queryRollbackConfiguration(input.RollbackConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RollbackConfiguration.${key}`; entries[loc] = value; }); } - if (input.StackPolicyBody !== undefined) { + if (input.StackPolicyBody !== undefined && input.StackPolicyBody !== null) { entries["StackPolicyBody"] = input.StackPolicyBody; } - if (input.StackPolicyURL !== undefined) { + if (input.StackPolicyURL !== undefined && input.StackPolicyURL !== null) { entries["StackPolicyURL"] = input.StackPolicyURL; } - if (input.NotificationARNs !== undefined) { + if (input.NotificationARNs !== undefined && input.NotificationARNs !== null) { const memberEntries = serializeAws_queryNotificationARNs(input.NotificationARNs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NotificationARNs.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ClientRequestToken !== undefined) { + if (input.ClientRequestToken !== undefined && input.ClientRequestToken !== null) { entries["ClientRequestToken"] = input.ClientRequestToken; } return entries; @@ -6104,38 +6154,38 @@ const serializeAws_queryUpdateStackInstancesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.Accounts !== undefined) { + if (input.Accounts !== undefined && input.Accounts !== null) { const memberEntries = serializeAws_queryAccountList(input.Accounts, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Accounts.${key}`; entries[loc] = value; }); } - if (input.DeploymentTargets !== undefined) { + if (input.DeploymentTargets !== undefined && input.DeploymentTargets !== null) { const memberEntries = serializeAws_queryDeploymentTargets(input.DeploymentTargets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DeploymentTargets.${key}`; entries[loc] = value; }); } - if (input.Regions !== undefined) { + if (input.Regions !== undefined && input.Regions !== null) { const memberEntries = serializeAws_queryRegionList(input.Regions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Regions.${key}`; entries[loc] = value; }); } - if (input.ParameterOverrides !== undefined) { + if (input.ParameterOverrides !== undefined && input.ParameterOverrides !== null) { const memberEntries = serializeAws_queryParameters(input.ParameterOverrides, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ParameterOverrides.${key}`; entries[loc] = value; }); } - if (input.OperationPreferences !== undefined) { + if (input.OperationPreferences !== undefined && input.OperationPreferences !== null) { const memberEntries = serializeAws_queryStackSetOperationPreferences(input.OperationPreferences, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OperationPreferences.${key}`; @@ -6145,7 +6195,7 @@ const serializeAws_queryUpdateStackInstancesInput = ( if (input.OperationId === undefined) { input.OperationId = generateIdempotencyToken(); } - if (input.OperationId !== undefined) { + if (input.OperationId !== undefined && input.OperationId !== null) { entries["OperationId"] = input.OperationId; } return entries; @@ -6153,66 +6203,66 @@ const serializeAws_queryUpdateStackInstancesInput = ( const serializeAws_queryUpdateStackSetInput = (input: UpdateStackSetInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.StackSetName !== undefined) { + if (input.StackSetName !== undefined && input.StackSetName !== null) { entries["StackSetName"] = input.StackSetName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.TemplateBody !== undefined) { + if (input.TemplateBody !== undefined && input.TemplateBody !== null) { entries["TemplateBody"] = input.TemplateBody; } - if (input.TemplateURL !== undefined) { + if (input.TemplateURL !== undefined && input.TemplateURL !== null) { entries["TemplateURL"] = input.TemplateURL; } - if (input.UsePreviousTemplate !== undefined) { + if (input.UsePreviousTemplate !== undefined && input.UsePreviousTemplate !== null) { entries["UsePreviousTemplate"] = input.UsePreviousTemplate; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParameters(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; entries[loc] = value; }); } - if (input.Capabilities !== undefined) { + if (input.Capabilities !== undefined && input.Capabilities !== null) { const memberEntries = serializeAws_queryCapabilities(input.Capabilities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Capabilities.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.OperationPreferences !== undefined) { + if (input.OperationPreferences !== undefined && input.OperationPreferences !== null) { const memberEntries = serializeAws_queryStackSetOperationPreferences(input.OperationPreferences, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OperationPreferences.${key}`; entries[loc] = value; }); } - if (input.AdministrationRoleARN !== undefined) { + if (input.AdministrationRoleARN !== undefined && input.AdministrationRoleARN !== null) { entries["AdministrationRoleARN"] = input.AdministrationRoleARN; } - if (input.ExecutionRoleName !== undefined) { + if (input.ExecutionRoleName !== undefined && input.ExecutionRoleName !== null) { entries["ExecutionRoleName"] = input.ExecutionRoleName; } - if (input.DeploymentTargets !== undefined) { + if (input.DeploymentTargets !== undefined && input.DeploymentTargets !== null) { const memberEntries = serializeAws_queryDeploymentTargets(input.DeploymentTargets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DeploymentTargets.${key}`; entries[loc] = value; }); } - if (input.PermissionModel !== undefined) { + if (input.PermissionModel !== undefined && input.PermissionModel !== null) { entries["PermissionModel"] = input.PermissionModel; } - if (input.AutoDeployment !== undefined) { + if (input.AutoDeployment !== undefined && input.AutoDeployment !== null) { const memberEntries = serializeAws_queryAutoDeployment(input.AutoDeployment, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AutoDeployment.${key}`; @@ -6222,17 +6272,17 @@ const serializeAws_queryUpdateStackSetInput = (input: UpdateStackSetInput, conte if (input.OperationId === undefined) { input.OperationId = generateIdempotencyToken(); } - if (input.OperationId !== undefined) { + if (input.OperationId !== undefined && input.OperationId !== null) { entries["OperationId"] = input.OperationId; } - if (input.Accounts !== undefined) { + if (input.Accounts !== undefined && input.Accounts !== null) { const memberEntries = serializeAws_queryAccountList(input.Accounts, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Accounts.${key}`; entries[loc] = value; }); } - if (input.Regions !== undefined) { + if (input.Regions !== undefined && input.Regions !== null) { const memberEntries = serializeAws_queryRegionList(input.Regions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Regions.${key}`; @@ -6247,10 +6297,10 @@ const serializeAws_queryUpdateTerminationProtectionInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnableTerminationProtection !== undefined) { + if (input.EnableTerminationProtection !== undefined && input.EnableTerminationProtection !== null) { entries["EnableTerminationProtection"] = input.EnableTerminationProtection; } - if (input.StackName !== undefined) { + if (input.StackName !== undefined && input.StackName !== null) { entries["StackName"] = input.StackName; } return entries; @@ -6258,10 +6308,10 @@ const serializeAws_queryUpdateTerminationProtectionInput = ( const serializeAws_queryValidateTemplateInput = (input: ValidateTemplateInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TemplateBody !== undefined) { + if (input.TemplateBody !== undefined && input.TemplateBody !== null) { entries["TemplateBody"] = input.TemplateBody; } - if (input.TemplateURL !== undefined) { + if (input.TemplateURL !== undefined && input.TemplateURL !== null) { entries["TemplateURL"] = input.TemplateURL; } return entries; @@ -6296,15 +6346,36 @@ const deserializeAws_queryAccountLimit = (output: any, context: __SerdeContext): }; const deserializeAws_queryAccountLimitList = (output: any, context: __SerdeContext): AccountLimit[] => { - return (output || []).map((entry: any) => deserializeAws_queryAccountLimit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAccountLimit(entry, context); + }); }; const deserializeAws_queryAccountList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryAllowedValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryAlreadyExistsException = (output: any, context: __SerdeContext): AlreadyExistsException => { @@ -6332,7 +6403,14 @@ const deserializeAws_queryAutoDeployment = (output: any, context: __SerdeContext }; const deserializeAws_queryCapabilities = (output: any, context: __SerdeContext): (Capability | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryCFNRegistryException = (output: any, context: __SerdeContext): CFNRegistryException => { @@ -6360,7 +6438,14 @@ const deserializeAws_queryChange = (output: any, context: __SerdeContext): Chang }; const deserializeAws_queryChanges = (output: any, context: __SerdeContext): Change[] => { - return (output || []).map((entry: any) => deserializeAws_queryChange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryChange(entry, context); + }); }; const deserializeAws_queryChangeSetNotFoundException = ( @@ -6377,7 +6462,14 @@ const deserializeAws_queryChangeSetNotFoundException = ( }; const deserializeAws_queryChangeSetSummaries = (output: any, context: __SerdeContext): ChangeSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryChangeSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryChangeSetSummary(entry, context); + }); }; const deserializeAws_queryChangeSetSummary = (output: any, context: __SerdeContext): ChangeSetSummary => { @@ -7021,7 +7113,14 @@ const deserializeAws_queryExport = (output: any, context: __SerdeContext): Expor }; const deserializeAws_queryExports = (output: any, context: __SerdeContext): Export[] => { - return (output || []).map((entry: any) => deserializeAws_queryExport(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryExport(entry, context); + }); }; const deserializeAws_queryGetStackPolicyOutput = (output: any, context: __SerdeContext): GetStackPolicyOutput => { @@ -7133,7 +7232,14 @@ const deserializeAws_queryGetTemplateSummaryOutput = ( }; const deserializeAws_queryImports = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryInsufficientCapabilitiesException = ( @@ -7462,7 +7568,14 @@ const deserializeAws_queryLoggingConfig = (output: any, context: __SerdeContext) }; const deserializeAws_queryLogicalResourceIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryModuleInfo = (output: any, context: __SerdeContext): ModuleInfo => { @@ -7493,7 +7606,14 @@ const deserializeAws_queryNameAlreadyExistsException = ( }; const deserializeAws_queryNotificationARNs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryOperationIdAlreadyExistsException = ( @@ -7549,7 +7669,14 @@ const deserializeAws_queryOperationStatusCheckFailedException = ( }; const deserializeAws_queryOrganizationalUnitIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryOutput = (output: any, context: __SerdeContext): Output => { @@ -7575,7 +7702,14 @@ const deserializeAws_queryOutput = (output: any, context: __SerdeContext): Outpu }; const deserializeAws_queryOutputs = (output: any, context: __SerdeContext): Output[] => { - return (output || []).map((entry: any) => deserializeAws_queryOutput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOutput(entry, context); + }); }; const deserializeAws_queryParameter = (output: any, context: __SerdeContext): Parameter => { @@ -7647,18 +7781,39 @@ const deserializeAws_queryParameterDeclaration = (output: any, context: __SerdeC }; const deserializeAws_queryParameterDeclarations = (output: any, context: __SerdeContext): ParameterDeclaration[] => { - return (output || []).map((entry: any) => deserializeAws_queryParameterDeclaration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryParameterDeclaration(entry, context); + }); }; const deserializeAws_queryParameters = (output: any, context: __SerdeContext): Parameter[] => { - return (output || []).map((entry: any) => deserializeAws_queryParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryParameter(entry, context); + }); }; const deserializeAws_queryPhysicalResourceIdContext = ( output: any, context: __SerdeContext ): PhysicalResourceIdContextKeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_queryPhysicalResourceIdContextKeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPhysicalResourceIdContextKeyValuePair(entry, context); + }); }; const deserializeAws_queryPhysicalResourceIdContextKeyValuePair = ( @@ -7701,7 +7856,14 @@ const deserializeAws_queryPropertyDifference = (output: any, context: __SerdeCon }; const deserializeAws_queryPropertyDifferences = (output: any, context: __SerdeContext): PropertyDifference[] => { - return (output || []).map((entry: any) => deserializeAws_queryPropertyDifference(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPropertyDifference(entry, context); + }); }; const deserializeAws_queryRecordHandlerProgressOutput = ( @@ -7713,7 +7875,14 @@ const deserializeAws_queryRecordHandlerProgressOutput = ( }; const deserializeAws_queryRegionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryRegisterTypeOutput = (output: any, context: __SerdeContext): RegisterTypeOutput => { @@ -7727,7 +7896,14 @@ const deserializeAws_queryRegisterTypeOutput = (output: any, context: __SerdeCon }; const deserializeAws_queryRegistrationTokenList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryResourceChange = (output: any, context: __SerdeContext): ResourceChange => { @@ -7804,18 +7980,39 @@ const deserializeAws_queryResourceChangeDetail = (output: any, context: __SerdeC }; const deserializeAws_queryResourceChangeDetails = (output: any, context: __SerdeContext): ResourceChangeDetail[] => { - return (output || []).map((entry: any) => deserializeAws_queryResourceChangeDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryResourceChangeDetail(entry, context); + }); }; const deserializeAws_queryResourceIdentifiers = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryResourceIdentifierSummaries = ( output: any, context: __SerdeContext ): ResourceIdentifierSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryResourceIdentifierSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryResourceIdentifierSummary(entry, context); + }); }; const deserializeAws_queryResourceIdentifierSummary = ( @@ -7873,7 +8070,14 @@ const deserializeAws_queryResourceTargetDefinition = ( }; const deserializeAws_queryResourceTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryRollbackConfiguration = (output: any, context: __SerdeContext): RollbackConfiguration => { @@ -7911,11 +8115,25 @@ const deserializeAws_queryRollbackTrigger = (output: any, context: __SerdeContex }; const deserializeAws_queryRollbackTriggers = (output: any, context: __SerdeContext): RollbackTrigger[] => { - return (output || []).map((entry: any) => deserializeAws_queryRollbackTrigger(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRollbackTrigger(entry, context); + }); }; const deserializeAws_queryScope = (output: any, context: __SerdeContext): (ResourceAttribute | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySetTypeDefaultVersionOutput = ( @@ -8129,7 +8347,14 @@ const deserializeAws_queryStackEvent = (output: any, context: __SerdeContext): S }; const deserializeAws_queryStackEvents = (output: any, context: __SerdeContext): StackEvent[] => { - return (output || []).map((entry: any) => deserializeAws_queryStackEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStackEvent(entry, context); + }); }; const deserializeAws_queryStackInstance = (output: any, context: __SerdeContext): StackInstance => { @@ -8218,7 +8443,14 @@ const deserializeAws_queryStackInstanceNotFoundException = ( }; const deserializeAws_queryStackInstanceSummaries = (output: any, context: __SerdeContext): StackInstanceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryStackInstanceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStackInstanceSummary(entry, context); + }); }; const deserializeAws_queryStackInstanceSummary = (output: any, context: __SerdeContext): StackInstanceSummary => { @@ -8474,15 +8706,36 @@ const deserializeAws_queryStackResourceDriftInformationSummary = ( }; const deserializeAws_queryStackResourceDrifts = (output: any, context: __SerdeContext): StackResourceDrift[] => { - return (output || []).map((entry: any) => deserializeAws_queryStackResourceDrift(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStackResourceDrift(entry, context); + }); }; const deserializeAws_queryStackResources = (output: any, context: __SerdeContext): StackResource[] => { - return (output || []).map((entry: any) => deserializeAws_queryStackResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStackResource(entry, context); + }); }; const deserializeAws_queryStackResourceSummaries = (output: any, context: __SerdeContext): StackResourceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryStackResourceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStackResourceSummary(entry, context); + }); }; const deserializeAws_queryStackResourceSummary = (output: any, context: __SerdeContext): StackResourceSummary => { @@ -8527,7 +8780,14 @@ const deserializeAws_queryStackResourceSummary = (output: any, context: __SerdeC }; const deserializeAws_queryStacks = (output: any, context: __SerdeContext): Stack[] => { - return (output || []).map((entry: any) => deserializeAws_queryStack(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStack(entry, context); + }); }; const deserializeAws_queryStackSet = (output: any, context: __SerdeContext): StackSet => { @@ -8786,7 +9046,14 @@ const deserializeAws_queryStackSetOperationResultSummaries = ( output: any, context: __SerdeContext ): StackSetOperationResultSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryStackSetOperationResultSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStackSetOperationResultSummary(entry, context); + }); }; const deserializeAws_queryStackSetOperationResultSummary = ( @@ -8826,7 +9093,14 @@ const deserializeAws_queryStackSetOperationSummaries = ( output: any, context: __SerdeContext ): StackSetOperationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryStackSetOperationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStackSetOperationSummary(entry, context); + }); }; const deserializeAws_queryStackSetOperationSummary = ( @@ -8859,7 +9133,14 @@ const deserializeAws_queryStackSetOperationSummary = ( }; const deserializeAws_queryStackSetSummaries = (output: any, context: __SerdeContext): StackSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryStackSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStackSetSummary(entry, context); + }); }; const deserializeAws_queryStackSetSummary = (output: any, context: __SerdeContext): StackSetSummary => { @@ -8901,7 +9182,14 @@ const deserializeAws_queryStackSetSummary = (output: any, context: __SerdeContex }; const deserializeAws_queryStackSummaries = (output: any, context: __SerdeContext): StackSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryStackSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStackSummary(entry, context); + }); }; const deserializeAws_queryStackSummary = (output: any, context: __SerdeContext): StackSummary => { @@ -8955,7 +9243,14 @@ const deserializeAws_queryStackSummary = (output: any, context: __SerdeContext): }; const deserializeAws_queryStageList = (output: any, context: __SerdeContext): (TemplateStage | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryStaleRequestException = (output: any, context: __SerdeContext): StaleRequestException => { @@ -8991,7 +9286,14 @@ const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { }; const deserializeAws_queryTags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTemplateParameter = (output: any, context: __SerdeContext): TemplateParameter => { @@ -9017,7 +9319,14 @@ const deserializeAws_queryTemplateParameter = (output: any, context: __SerdeCont }; const deserializeAws_queryTemplateParameters = (output: any, context: __SerdeContext): TemplateParameter[] => { - return (output || []).map((entry: any) => deserializeAws_queryTemplateParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTemplateParameter(entry, context); + }); }; const deserializeAws_queryTokenAlreadyExistsException = ( @@ -9034,7 +9343,14 @@ const deserializeAws_queryTokenAlreadyExistsException = ( }; const deserializeAws_queryTransformsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryTypeNotFoundException = (output: any, context: __SerdeContext): TypeNotFoundException => { @@ -9048,7 +9364,14 @@ const deserializeAws_queryTypeNotFoundException = (output: any, context: __Serde }; const deserializeAws_queryTypeSummaries = (output: any, context: __SerdeContext): TypeSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryTypeSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTypeSummary(entry, context); + }); }; const deserializeAws_queryTypeSummary = (output: any, context: __SerdeContext): TypeSummary => { @@ -9082,7 +9405,14 @@ const deserializeAws_queryTypeSummary = (output: any, context: __SerdeContext): }; const deserializeAws_queryTypeVersionSummaries = (output: any, context: __SerdeContext): TypeVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryTypeVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTypeVersionSummary(entry, context); + }); }; const deserializeAws_queryTypeVersionSummary = (output: any, context: __SerdeContext): TypeVersionSummary => { diff --git a/clients/client-cloudfront/protocols/Aws_restXml.ts b/clients/client-cloudfront/protocols/Aws_restXml.ts index 0b39ffc26296..88335d5106b0 100644 --- a/clients/client-cloudfront/protocols/Aws_restXml.ts +++ b/clients/client-cloudfront/protocols/Aws_restXml.ts @@ -467,7 +467,7 @@ export const serializeAws_restXmlCreateCachePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/cache-policy"; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_restXmlCreateCloudFrontOriginAccessIdentityCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/origin-access-identity/cloudfront"; let body: any; @@ -526,7 +526,7 @@ export const serializeAws_restXmlCreateDistributionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/distribution"; let body: any; @@ -554,7 +554,7 @@ export const serializeAws_restXmlCreateDistributionWithTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/distribution"; const query: any = { @@ -586,7 +586,7 @@ export const serializeAws_restXmlCreateFieldLevelEncryptionConfigCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/field-level-encryption"; let body: any; @@ -614,7 +614,7 @@ export const serializeAws_restXmlCreateFieldLevelEncryptionProfileCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/field-level-encryption-profile"; let body: any; @@ -642,7 +642,7 @@ export const serializeAws_restXmlCreateInvalidationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/distribution/{DistributionId}/invalidation"; if (input.DistributionId !== undefined) { @@ -679,7 +679,7 @@ export const serializeAws_restXmlCreateKeyGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/key-group"; let body: any; @@ -707,7 +707,7 @@ export const serializeAws_restXmlCreateMonitoringSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/distributions/{DistributionId}/monitoring-subscription"; if (input.DistributionId !== undefined) { @@ -744,7 +744,7 @@ export const serializeAws_restXmlCreateOriginRequestPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/origin-request-policy"; let body: any; @@ -772,7 +772,7 @@ export const serializeAws_restXmlCreatePublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/public-key"; let body: any; @@ -800,7 +800,7 @@ export const serializeAws_restXmlCreateRealtimeLogConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/realtime-log-config"; let body: any; @@ -849,7 +849,7 @@ export const serializeAws_restXmlCreateStreamingDistributionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/streaming-distribution"; let body: any; @@ -877,7 +877,7 @@ export const serializeAws_restXmlCreateStreamingDistributionWithTagsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/streaming-distribution"; const query: any = { @@ -912,7 +912,6 @@ export const serializeAws_restXmlDeleteCachePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/cache-policy/{Id}"; @@ -943,7 +942,6 @@ export const serializeAws_restXmlDeleteCloudFrontOriginAccessIdentityCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/origin-access-identity/cloudfront/{Id}"; @@ -974,7 +972,6 @@ export const serializeAws_restXmlDeleteDistributionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/distribution/{Id}"; @@ -1005,7 +1002,6 @@ export const serializeAws_restXmlDeleteFieldLevelEncryptionConfigCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/field-level-encryption/{Id}"; @@ -1036,7 +1032,6 @@ export const serializeAws_restXmlDeleteFieldLevelEncryptionProfileCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/field-level-encryption-profile/{Id}"; @@ -1067,7 +1062,6 @@ export const serializeAws_restXmlDeleteKeyGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/key-group/{Id}"; @@ -1097,9 +1091,7 @@ export const serializeAws_restXmlDeleteMonitoringSubscriptionCommand = async ( input: DeleteMonitoringSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distributions/{DistributionId}/monitoring-subscription"; if (input.DistributionId !== undefined) { const labelValue: string = input.DistributionId; @@ -1128,7 +1120,6 @@ export const serializeAws_restXmlDeleteOriginRequestPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/origin-request-policy/{Id}"; @@ -1159,7 +1150,6 @@ export const serializeAws_restXmlDeletePublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/public-key/{Id}"; @@ -1190,7 +1180,7 @@ export const serializeAws_restXmlDeleteRealtimeLogConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/delete-realtime-log-config"; let body: any; @@ -1223,7 +1213,6 @@ export const serializeAws_restXmlDeleteStreamingDistributionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/streaming-distribution/{Id}"; @@ -1253,9 +1242,7 @@ export const serializeAws_restXmlGetCachePolicyCommand = async ( input: GetCachePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/cache-policy/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1283,9 +1270,7 @@ export const serializeAws_restXmlGetCachePolicyConfigCommand = async ( input: GetCachePolicyConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/cache-policy/{Id}/config"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1313,9 +1298,7 @@ export const serializeAws_restXmlGetCloudFrontOriginAccessIdentityCommand = asyn input: GetCloudFrontOriginAccessIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/origin-access-identity/cloudfront/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1343,9 +1326,7 @@ export const serializeAws_restXmlGetCloudFrontOriginAccessIdentityConfigCommand input: GetCloudFrontOriginAccessIdentityConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/origin-access-identity/cloudfront/{Id}/config"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1373,9 +1354,7 @@ export const serializeAws_restXmlGetDistributionCommand = async ( input: GetDistributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distribution/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1403,9 +1382,7 @@ export const serializeAws_restXmlGetDistributionConfigCommand = async ( input: GetDistributionConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distribution/{Id}/config"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1433,9 +1410,7 @@ export const serializeAws_restXmlGetFieldLevelEncryptionCommand = async ( input: GetFieldLevelEncryptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/field-level-encryption/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1463,9 +1438,7 @@ export const serializeAws_restXmlGetFieldLevelEncryptionConfigCommand = async ( input: GetFieldLevelEncryptionConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/field-level-encryption/{Id}/config"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1493,9 +1466,7 @@ export const serializeAws_restXmlGetFieldLevelEncryptionProfileCommand = async ( input: GetFieldLevelEncryptionProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/field-level-encryption-profile/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1523,9 +1494,7 @@ export const serializeAws_restXmlGetFieldLevelEncryptionProfileConfigCommand = a input: GetFieldLevelEncryptionProfileConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/field-level-encryption-profile/{Id}/config"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1553,9 +1522,7 @@ export const serializeAws_restXmlGetInvalidationCommand = async ( input: GetInvalidationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distribution/{DistributionId}/invalidation/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1592,9 +1559,7 @@ export const serializeAws_restXmlGetKeyGroupCommand = async ( input: GetKeyGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/key-group/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1622,9 +1587,7 @@ export const serializeAws_restXmlGetKeyGroupConfigCommand = async ( input: GetKeyGroupConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/key-group/{Id}/config"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1652,9 +1615,7 @@ export const serializeAws_restXmlGetMonitoringSubscriptionCommand = async ( input: GetMonitoringSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distributions/{DistributionId}/monitoring-subscription"; if (input.DistributionId !== undefined) { const labelValue: string = input.DistributionId; @@ -1682,9 +1643,7 @@ export const serializeAws_restXmlGetOriginRequestPolicyCommand = async ( input: GetOriginRequestPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/origin-request-policy/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1712,9 +1671,7 @@ export const serializeAws_restXmlGetOriginRequestPolicyConfigCommand = async ( input: GetOriginRequestPolicyConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/origin-request-policy/{Id}/config"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1742,9 +1699,7 @@ export const serializeAws_restXmlGetPublicKeyCommand = async ( input: GetPublicKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/public-key/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1772,9 +1727,7 @@ export const serializeAws_restXmlGetPublicKeyConfigCommand = async ( input: GetPublicKeyConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/public-key/{Id}/config"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1803,7 +1756,7 @@ export const serializeAws_restXmlGetRealtimeLogConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/get-realtime-log-config"; let body: any; @@ -1835,9 +1788,7 @@ export const serializeAws_restXmlGetStreamingDistributionCommand = async ( input: GetStreamingDistributionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/streaming-distribution/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1865,9 +1816,7 @@ export const serializeAws_restXmlGetStreamingDistributionConfigCommand = async ( input: GetStreamingDistributionConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/streaming-distribution/{Id}/config"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1895,9 +1844,7 @@ export const serializeAws_restXmlListCachePoliciesCommand = async ( input: ListCachePoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/cache-policy"; const query: any = { ...(input.Marker !== undefined && { Marker: input.Marker }), @@ -1922,9 +1869,7 @@ export const serializeAws_restXmlListCloudFrontOriginAccessIdentitiesCommand = a input: ListCloudFrontOriginAccessIdentitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/origin-access-identity/cloudfront"; const query: any = { ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), @@ -1948,9 +1893,7 @@ export const serializeAws_restXmlListDistributionsCommand = async ( input: ListDistributionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distribution"; const query: any = { ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), @@ -1974,9 +1917,7 @@ export const serializeAws_restXmlListDistributionsByCachePolicyIdCommand = async input: ListDistributionsByCachePolicyIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distributionsByCachePolicyId/{CachePolicyId}"; if (input.CachePolicyId !== undefined) { const labelValue: string = input.CachePolicyId; @@ -2009,9 +1950,7 @@ export const serializeAws_restXmlListDistributionsByKeyGroupCommand = async ( input: ListDistributionsByKeyGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distributionsByKeyGroupId/{KeyGroupId}"; if (input.KeyGroupId !== undefined) { const labelValue: string = input.KeyGroupId; @@ -2044,9 +1983,7 @@ export const serializeAws_restXmlListDistributionsByOriginRequestPolicyIdCommand input: ListDistributionsByOriginRequestPolicyIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distributionsByOriginRequestPolicyId/{OriginRequestPolicyId}"; if (input.OriginRequestPolicyId !== undefined) { const labelValue: string = input.OriginRequestPolicyId; @@ -2080,7 +2017,7 @@ export const serializeAws_restXmlListDistributionsByRealtimeLogConfigCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/distributionsByRealtimeLogConfig"; let body: any; @@ -2124,9 +2061,7 @@ export const serializeAws_restXmlListDistributionsByWebACLIdCommand = async ( input: ListDistributionsByWebACLIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distributionsByWebACLId/{WebACLId}"; if (input.WebACLId !== undefined) { const labelValue: string = input.WebACLId; @@ -2159,9 +2094,7 @@ export const serializeAws_restXmlListFieldLevelEncryptionConfigsCommand = async input: ListFieldLevelEncryptionConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/field-level-encryption"; const query: any = { ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), @@ -2185,9 +2118,7 @@ export const serializeAws_restXmlListFieldLevelEncryptionProfilesCommand = async input: ListFieldLevelEncryptionProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/field-level-encryption-profile"; const query: any = { ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), @@ -2211,9 +2142,7 @@ export const serializeAws_restXmlListInvalidationsCommand = async ( input: ListInvalidationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/distribution/{DistributionId}/invalidation"; if (input.DistributionId !== undefined) { const labelValue: string = input.DistributionId; @@ -2246,9 +2175,7 @@ export const serializeAws_restXmlListKeyGroupsCommand = async ( input: ListKeyGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/key-group"; const query: any = { ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), @@ -2272,9 +2199,7 @@ export const serializeAws_restXmlListOriginRequestPoliciesCommand = async ( input: ListOriginRequestPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/origin-request-policy"; const query: any = { ...(input.Marker !== undefined && { Marker: input.Marker }), @@ -2299,9 +2224,7 @@ export const serializeAws_restXmlListPublicKeysCommand = async ( input: ListPublicKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/public-key"; const query: any = { ...(input.Marker !== undefined && { Marker: input.Marker }), @@ -2325,9 +2248,7 @@ export const serializeAws_restXmlListRealtimeLogConfigsCommand = async ( input: ListRealtimeLogConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/realtime-log-config"; const query: any = { ...(input.Marker !== undefined && { Marker: input.Marker }), @@ -2351,9 +2272,7 @@ export const serializeAws_restXmlListStreamingDistributionsCommand = async ( input: ListStreamingDistributionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/streaming-distribution"; const query: any = { ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), @@ -2377,9 +2296,7 @@ export const serializeAws_restXmlListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-05-31/tagging"; const query: any = { ...(input.Resource !== undefined && { Resource: input.Resource }), @@ -2403,7 +2320,7 @@ export const serializeAws_restXmlTagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/tagging"; const query: any = { @@ -2436,7 +2353,7 @@ export const serializeAws_restXmlUntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/tagging"; const query: any = { @@ -2469,7 +2386,7 @@ export const serializeAws_restXmlUpdateCachePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/cache-policy/{Id}"; @@ -2507,7 +2424,7 @@ export const serializeAws_restXmlUpdateCloudFrontOriginAccessIdentityCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/origin-access-identity/cloudfront/{Id}/config"; @@ -2548,7 +2465,7 @@ export const serializeAws_restXmlUpdateDistributionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/distribution/{Id}/config"; @@ -2586,7 +2503,7 @@ export const serializeAws_restXmlUpdateFieldLevelEncryptionConfigCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/field-level-encryption/{Id}/config"; @@ -2624,7 +2541,7 @@ export const serializeAws_restXmlUpdateFieldLevelEncryptionProfileCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/field-level-encryption-profile/{Id}/config"; @@ -2662,7 +2579,7 @@ export const serializeAws_restXmlUpdateKeyGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/key-group/{Id}"; @@ -2700,7 +2617,7 @@ export const serializeAws_restXmlUpdateOriginRequestPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/origin-request-policy/{Id}"; @@ -2738,7 +2655,7 @@ export const serializeAws_restXmlUpdatePublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/public-key/{Id}/config"; @@ -2776,7 +2693,7 @@ export const serializeAws_restXmlUpdateRealtimeLogConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2020-05-31/realtime-log-config"; let body: any; @@ -2829,7 +2746,7 @@ export const serializeAws_restXmlUpdateStreamingDistributionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), }; let resolvedPath = "/2020-05-31/streaming-distribution/{Id}/config"; @@ -11975,11 +11892,11 @@ const deserializeAws_restXmlTrustedSignerDoesNotExistResponse = async ( const serializeAws_restXmlAliases = (input: Aliases, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Aliases"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlAliasList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -11991,19 +11908,24 @@ const serializeAws_restXmlAliases = (input: Aliases, context: __SerdeContext): a }; const serializeAws_restXmlAliasList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("CNAME"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("CNAME"); + }); }; const serializeAws_restXmlAllowedMethods = (input: AllowedMethods, context: __SerdeContext): any => { const bodyNode = new __XmlNode("AllowedMethods"); - if (input.CachedMethods !== undefined) { + if (input.CachedMethods !== undefined && input.CachedMethods !== null) { const node = serializeAws_restXmlCachedMethods(input.CachedMethods, context).withName("CachedMethods"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlMethodsList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12011,7 +11933,7 @@ const serializeAws_restXmlAllowedMethods = (input: AllowedMethods, context: __Se }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } @@ -12019,91 +11941,96 @@ const serializeAws_restXmlAllowedMethods = (input: AllowedMethods, context: __Se }; const serializeAws_restXmlAwsAccountNumberList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("AwsAccountNumber"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("AwsAccountNumber"); + }); }; const serializeAws_restXmlCacheBehavior = (input: CacheBehavior, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CacheBehavior"); - if (input.ForwardedValues !== undefined) { + if (input.ForwardedValues !== undefined && input.ForwardedValues !== null) { const node = serializeAws_restXmlForwardedValues(input.ForwardedValues, context).withName("ForwardedValues"); bodyNode.addChildNode(node); } - if (input.PathPattern !== undefined) { + if (input.PathPattern !== undefined && input.PathPattern !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.PathPattern)).withName("PathPattern"); bodyNode.addChildNode(node); } - if (input.AllowedMethods !== undefined) { + if (input.AllowedMethods !== undefined && input.AllowedMethods !== null) { const node = serializeAws_restXmlAllowedMethods(input.AllowedMethods, context).withName("AllowedMethods"); bodyNode.addChildNode(node); } - if (input.DefaultTTL !== undefined) { + if (input.DefaultTTL !== undefined && input.DefaultTTL !== null) { const node = new __XmlNode("long").addChildNode(new __XmlText(String(input.DefaultTTL))).withName("DefaultTTL"); bodyNode.addChildNode(node); } - if (input.FieldLevelEncryptionId !== undefined) { + if (input.FieldLevelEncryptionId !== undefined && input.FieldLevelEncryptionId !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.FieldLevelEncryptionId)) .withName("FieldLevelEncryptionId"); bodyNode.addChildNode(node); } - if (input.OriginRequestPolicyId !== undefined) { + if (input.OriginRequestPolicyId !== undefined && input.OriginRequestPolicyId !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.OriginRequestPolicyId)) .withName("OriginRequestPolicyId"); bodyNode.addChildNode(node); } - if (input.TrustedSigners !== undefined) { + if (input.TrustedSigners !== undefined && input.TrustedSigners !== null) { const node = serializeAws_restXmlTrustedSigners(input.TrustedSigners, context).withName("TrustedSigners"); bodyNode.addChildNode(node); } - if (input.TrustedKeyGroups !== undefined) { + if (input.TrustedKeyGroups !== undefined && input.TrustedKeyGroups !== null) { const node = serializeAws_restXmlTrustedKeyGroups(input.TrustedKeyGroups, context).withName("TrustedKeyGroups"); bodyNode.addChildNode(node); } - if (input.RealtimeLogConfigArn !== undefined) { + if (input.RealtimeLogConfigArn !== undefined && input.RealtimeLogConfigArn !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.RealtimeLogConfigArn)) .withName("RealtimeLogConfigArn"); bodyNode.addChildNode(node); } - if (input.TargetOriginId !== undefined) { + if (input.TargetOriginId !== undefined && input.TargetOriginId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.TargetOriginId)).withName("TargetOriginId"); bodyNode.addChildNode(node); } - if (input.LambdaFunctionAssociations !== undefined) { + if (input.LambdaFunctionAssociations !== undefined && input.LambdaFunctionAssociations !== null) { const node = serializeAws_restXmlLambdaFunctionAssociations(input.LambdaFunctionAssociations, context).withName( "LambdaFunctionAssociations" ); bodyNode.addChildNode(node); } - if (input.Compress !== undefined) { + if (input.Compress !== undefined && input.Compress !== null) { const node = new __XmlNode("boolean").addChildNode(new __XmlText(String(input.Compress))).withName("Compress"); bodyNode.addChildNode(node); } - if (input.CachePolicyId !== undefined) { + if (input.CachePolicyId !== undefined && input.CachePolicyId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.CachePolicyId)).withName("CachePolicyId"); bodyNode.addChildNode(node); } - if (input.MaxTTL !== undefined) { + if (input.MaxTTL !== undefined && input.MaxTTL !== null) { const node = new __XmlNode("long").addChildNode(new __XmlText(String(input.MaxTTL))).withName("MaxTTL"); bodyNode.addChildNode(node); } - if (input.SmoothStreaming !== undefined) { + if (input.SmoothStreaming !== undefined && input.SmoothStreaming !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.SmoothStreaming))) .withName("SmoothStreaming"); bodyNode.addChildNode(node); } - if (input.ViewerProtocolPolicy !== undefined) { + if (input.ViewerProtocolPolicy !== undefined && input.ViewerProtocolPolicy !== null) { const node = new __XmlNode("ViewerProtocolPolicy") .addChildNode(new __XmlText(input.ViewerProtocolPolicy)) .withName("ViewerProtocolPolicy"); bodyNode.addChildNode(node); } - if (input.MinTTL !== undefined) { + if (input.MinTTL !== undefined && input.MinTTL !== null) { const node = new __XmlNode("long").addChildNode(new __XmlText(String(input.MinTTL))).withName("MinTTL"); bodyNode.addChildNode(node); } @@ -12111,15 +12038,20 @@ const serializeAws_restXmlCacheBehavior = (input: CacheBehavior, context: __Serd }; const serializeAws_restXmlCacheBehaviorList = (input: CacheBehavior[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlCacheBehavior(entry, context); - return node.withName("CacheBehavior"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlCacheBehavior(entry, context); + return node.withName("CacheBehavior"); + }); }; const serializeAws_restXmlCacheBehaviors = (input: CacheBehaviors, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CacheBehaviors"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlCacheBehaviorList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12127,7 +12059,7 @@ const serializeAws_restXmlCacheBehaviors = (input: CacheBehaviors, context: __Se }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } @@ -12136,7 +12068,7 @@ const serializeAws_restXmlCacheBehaviors = (input: CacheBehaviors, context: __Se const serializeAws_restXmlCachedMethods = (input: CachedMethods, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CachedMethods"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlMethodsList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12144,7 +12076,7 @@ const serializeAws_restXmlCachedMethods = (input: CachedMethods, context: __Serd }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } @@ -12153,27 +12085,30 @@ const serializeAws_restXmlCachedMethods = (input: CachedMethods, context: __Serd const serializeAws_restXmlCachePolicyConfig = (input: CachePolicyConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CachePolicyConfig"); - if (input.MinTTL !== undefined) { + if (input.MinTTL !== undefined && input.MinTTL !== null) { const node = new __XmlNode("long").addChildNode(new __XmlText(String(input.MinTTL))).withName("MinTTL"); bodyNode.addChildNode(node); } - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } - if (input.MaxTTL !== undefined) { + if (input.MaxTTL !== undefined && input.MaxTTL !== null) { const node = new __XmlNode("long").addChildNode(new __XmlText(String(input.MaxTTL))).withName("MaxTTL"); bodyNode.addChildNode(node); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Name)).withName("Name"); bodyNode.addChildNode(node); } - if (input.DefaultTTL !== undefined) { + if (input.DefaultTTL !== undefined && input.DefaultTTL !== null) { const node = new __XmlNode("long").addChildNode(new __XmlText(String(input.DefaultTTL))).withName("DefaultTTL"); bodyNode.addChildNode(node); } - if (input.ParametersInCacheKeyAndForwardedToOrigin !== undefined) { + if ( + input.ParametersInCacheKeyAndForwardedToOrigin !== undefined && + input.ParametersInCacheKeyAndForwardedToOrigin !== null + ) { const node = serializeAws_restXmlParametersInCacheKeyAndForwardedToOrigin( input.ParametersInCacheKeyAndForwardedToOrigin, context @@ -12188,11 +12123,11 @@ const serializeAws_restXmlCachePolicyCookiesConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("CachePolicyCookiesConfig"); - if (input.Cookies !== undefined) { + if (input.Cookies !== undefined && input.Cookies !== null) { const node = serializeAws_restXmlCookieNames(input.Cookies, context).withName("Cookies"); bodyNode.addChildNode(node); } - if (input.CookieBehavior !== undefined) { + if (input.CookieBehavior !== undefined && input.CookieBehavior !== null) { const node = new __XmlNode("CachePolicyCookieBehavior") .addChildNode(new __XmlText(input.CookieBehavior)) .withName("CookieBehavior"); @@ -12206,11 +12141,11 @@ const serializeAws_restXmlCachePolicyHeadersConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("CachePolicyHeadersConfig"); - if (input.Headers !== undefined) { + if (input.Headers !== undefined && input.Headers !== null) { const node = serializeAws_restXmlHeaders(input.Headers, context).withName("Headers"); bodyNode.addChildNode(node); } - if (input.HeaderBehavior !== undefined) { + if (input.HeaderBehavior !== undefined && input.HeaderBehavior !== null) { const node = new __XmlNode("CachePolicyHeaderBehavior") .addChildNode(new __XmlText(input.HeaderBehavior)) .withName("HeaderBehavior"); @@ -12224,13 +12159,13 @@ const serializeAws_restXmlCachePolicyQueryStringsConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("CachePolicyQueryStringsConfig"); - if (input.QueryStringBehavior !== undefined) { + if (input.QueryStringBehavior !== undefined && input.QueryStringBehavior !== null) { const node = new __XmlNode("CachePolicyQueryStringBehavior") .addChildNode(new __XmlText(input.QueryStringBehavior)) .withName("QueryStringBehavior"); bodyNode.addChildNode(node); } - if (input.QueryStrings !== undefined) { + if (input.QueryStrings !== undefined && input.QueryStrings !== null) { const node = serializeAws_restXmlQueryStringNames(input.QueryStrings, context).withName("QueryStrings"); bodyNode.addChildNode(node); } @@ -12242,11 +12177,11 @@ const serializeAws_restXmlCloudFrontOriginAccessIdentityConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("CloudFrontOriginAccessIdentityConfig"); - if (input.CallerReference !== undefined) { + if (input.CallerReference !== undefined && input.CallerReference !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.CallerReference)).withName("CallerReference"); bodyNode.addChildNode(node); } - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } @@ -12255,15 +12190,15 @@ const serializeAws_restXmlCloudFrontOriginAccessIdentityConfig = ( const serializeAws_restXmlContentTypeProfile = (input: ContentTypeProfile, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ContentTypeProfile"); - if (input.ProfileId !== undefined) { + if (input.ProfileId !== undefined && input.ProfileId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.ProfileId)).withName("ProfileId"); bodyNode.addChildNode(node); } - if (input.ContentType !== undefined) { + if (input.ContentType !== undefined && input.ContentType !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.ContentType)).withName("ContentType"); bodyNode.addChildNode(node); } - if (input.Format !== undefined) { + if (input.Format !== undefined && input.Format !== null) { const node = new __XmlNode("Format").addChildNode(new __XmlText(input.Format)).withName("Format"); bodyNode.addChildNode(node); } @@ -12275,13 +12210,13 @@ const serializeAws_restXmlContentTypeProfileConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("ContentTypeProfileConfig"); - if (input.ContentTypeProfiles !== undefined) { + if (input.ContentTypeProfiles !== undefined && input.ContentTypeProfiles !== null) { const node = serializeAws_restXmlContentTypeProfiles(input.ContentTypeProfiles, context).withName( "ContentTypeProfiles" ); bodyNode.addChildNode(node); } - if (input.ForwardWhenContentTypeIsUnknown !== undefined) { + if (input.ForwardWhenContentTypeIsUnknown !== undefined && input.ForwardWhenContentTypeIsUnknown !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.ForwardWhenContentTypeIsUnknown))) .withName("ForwardWhenContentTypeIsUnknown"); @@ -12291,15 +12226,20 @@ const serializeAws_restXmlContentTypeProfileConfig = ( }; const serializeAws_restXmlContentTypeProfileList = (input: ContentTypeProfile[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlContentTypeProfile(entry, context); - return node.withName("ContentTypeProfile"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlContentTypeProfile(entry, context); + return node.withName("ContentTypeProfile"); + }); }; const serializeAws_restXmlContentTypeProfiles = (input: ContentTypeProfiles, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ContentTypeProfiles"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlContentTypeProfileList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12307,7 +12247,7 @@ const serializeAws_restXmlContentTypeProfiles = (input: ContentTypeProfiles, con }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } @@ -12315,19 +12255,24 @@ const serializeAws_restXmlContentTypeProfiles = (input: ContentTypeProfiles, con }; const serializeAws_restXmlCookieNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("Name"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("Name"); + }); }; const serializeAws_restXmlCookieNames = (input: CookieNames, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CookieNames"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlCookieNameList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12340,11 +12285,11 @@ const serializeAws_restXmlCookieNames = (input: CookieNames, context: __SerdeCon const serializeAws_restXmlCookiePreference = (input: CookiePreference, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CookiePreference"); - if (input.Forward !== undefined) { + if (input.Forward !== undefined && input.Forward !== null) { const node = new __XmlNode("ItemSelection").addChildNode(new __XmlText(input.Forward)).withName("Forward"); bodyNode.addChildNode(node); } - if (input.WhitelistedNames !== undefined) { + if (input.WhitelistedNames !== undefined && input.WhitelistedNames !== null) { const node = serializeAws_restXmlCookieNames(input.WhitelistedNames, context).withName("WhitelistedNames"); bodyNode.addChildNode(node); } @@ -12353,21 +12298,21 @@ const serializeAws_restXmlCookiePreference = (input: CookiePreference, context: const serializeAws_restXmlCustomErrorResponse = (input: CustomErrorResponse, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CustomErrorResponse"); - if (input.ResponseCode !== undefined) { + if (input.ResponseCode !== undefined && input.ResponseCode !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.ResponseCode)).withName("ResponseCode"); bodyNode.addChildNode(node); } - if (input.ErrorCachingMinTTL !== undefined) { + if (input.ErrorCachingMinTTL !== undefined && input.ErrorCachingMinTTL !== null) { const node = new __XmlNode("long") .addChildNode(new __XmlText(String(input.ErrorCachingMinTTL))) .withName("ErrorCachingMinTTL"); bodyNode.addChildNode(node); } - if (input.ErrorCode !== undefined) { + if (input.ErrorCode !== undefined && input.ErrorCode !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.ErrorCode))).withName("ErrorCode"); bodyNode.addChildNode(node); } - if (input.ResponsePagePath !== undefined) { + if (input.ResponsePagePath !== undefined && input.ResponsePagePath !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.ResponsePagePath)) .withName("ResponsePagePath"); @@ -12377,19 +12322,24 @@ const serializeAws_restXmlCustomErrorResponse = (input: CustomErrorResponse, con }; const serializeAws_restXmlCustomErrorResponseList = (input: CustomErrorResponse[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlCustomErrorResponse(entry, context); - return node.withName("CustomErrorResponse"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlCustomErrorResponse(entry, context); + return node.withName("CustomErrorResponse"); + }); }; const serializeAws_restXmlCustomErrorResponses = (input: CustomErrorResponses, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CustomErrorResponses"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlCustomErrorResponseList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12402,11 +12352,11 @@ const serializeAws_restXmlCustomErrorResponses = (input: CustomErrorResponses, c const serializeAws_restXmlCustomHeaders = (input: CustomHeaders, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CustomHeaders"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlOriginCustomHeadersList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12419,35 +12369,35 @@ const serializeAws_restXmlCustomHeaders = (input: CustomHeaders, context: __Serd const serializeAws_restXmlCustomOriginConfig = (input: CustomOriginConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CustomOriginConfig"); - if (input.OriginKeepaliveTimeout !== undefined) { + if (input.OriginKeepaliveTimeout !== undefined && input.OriginKeepaliveTimeout !== null) { const node = new __XmlNode("integer") .addChildNode(new __XmlText(String(input.OriginKeepaliveTimeout))) .withName("OriginKeepaliveTimeout"); bodyNode.addChildNode(node); } - if (input.HTTPPort !== undefined) { + if (input.HTTPPort !== undefined && input.HTTPPort !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.HTTPPort))).withName("HTTPPort"); bodyNode.addChildNode(node); } - if (input.OriginProtocolPolicy !== undefined) { + if (input.OriginProtocolPolicy !== undefined && input.OriginProtocolPolicy !== null) { const node = new __XmlNode("OriginProtocolPolicy") .addChildNode(new __XmlText(input.OriginProtocolPolicy)) .withName("OriginProtocolPolicy"); bodyNode.addChildNode(node); } - if (input.OriginReadTimeout !== undefined) { + if (input.OriginReadTimeout !== undefined && input.OriginReadTimeout !== null) { const node = new __XmlNode("integer") .addChildNode(new __XmlText(String(input.OriginReadTimeout))) .withName("OriginReadTimeout"); bodyNode.addChildNode(node); } - if (input.OriginSslProtocols !== undefined) { + if (input.OriginSslProtocols !== undefined && input.OriginSslProtocols !== null) { const node = serializeAws_restXmlOriginSslProtocols(input.OriginSslProtocols, context).withName( "OriginSslProtocols" ); bodyNode.addChildNode(node); } - if (input.HTTPSPort !== undefined) { + if (input.HTTPSPort !== undefined && input.HTTPSPort !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.HTTPSPort))).withName("HTTPSPort"); bodyNode.addChildNode(node); } @@ -12456,77 +12406,77 @@ const serializeAws_restXmlCustomOriginConfig = (input: CustomOriginConfig, conte const serializeAws_restXmlDefaultCacheBehavior = (input: DefaultCacheBehavior, context: __SerdeContext): any => { const bodyNode = new __XmlNode("DefaultCacheBehavior"); - if (input.Compress !== undefined) { + if (input.Compress !== undefined && input.Compress !== null) { const node = new __XmlNode("boolean").addChildNode(new __XmlText(String(input.Compress))).withName("Compress"); bodyNode.addChildNode(node); } - if (input.ViewerProtocolPolicy !== undefined) { + if (input.ViewerProtocolPolicy !== undefined && input.ViewerProtocolPolicy !== null) { const node = new __XmlNode("ViewerProtocolPolicy") .addChildNode(new __XmlText(input.ViewerProtocolPolicy)) .withName("ViewerProtocolPolicy"); bodyNode.addChildNode(node); } - if (input.TargetOriginId !== undefined) { + if (input.TargetOriginId !== undefined && input.TargetOriginId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.TargetOriginId)).withName("TargetOriginId"); bodyNode.addChildNode(node); } - if (input.FieldLevelEncryptionId !== undefined) { + if (input.FieldLevelEncryptionId !== undefined && input.FieldLevelEncryptionId !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.FieldLevelEncryptionId)) .withName("FieldLevelEncryptionId"); bodyNode.addChildNode(node); } - if (input.CachePolicyId !== undefined) { + if (input.CachePolicyId !== undefined && input.CachePolicyId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.CachePolicyId)).withName("CachePolicyId"); bodyNode.addChildNode(node); } - if (input.MaxTTL !== undefined) { + if (input.MaxTTL !== undefined && input.MaxTTL !== null) { const node = new __XmlNode("long").addChildNode(new __XmlText(String(input.MaxTTL))).withName("MaxTTL"); bodyNode.addChildNode(node); } - if (input.MinTTL !== undefined) { + if (input.MinTTL !== undefined && input.MinTTL !== null) { const node = new __XmlNode("long").addChildNode(new __XmlText(String(input.MinTTL))).withName("MinTTL"); bodyNode.addChildNode(node); } - if (input.TrustedKeyGroups !== undefined) { + if (input.TrustedKeyGroups !== undefined && input.TrustedKeyGroups !== null) { const node = serializeAws_restXmlTrustedKeyGroups(input.TrustedKeyGroups, context).withName("TrustedKeyGroups"); bodyNode.addChildNode(node); } - if (input.SmoothStreaming !== undefined) { + if (input.SmoothStreaming !== undefined && input.SmoothStreaming !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.SmoothStreaming))) .withName("SmoothStreaming"); bodyNode.addChildNode(node); } - if (input.AllowedMethods !== undefined) { + if (input.AllowedMethods !== undefined && input.AllowedMethods !== null) { const node = serializeAws_restXmlAllowedMethods(input.AllowedMethods, context).withName("AllowedMethods"); bodyNode.addChildNode(node); } - if (input.ForwardedValues !== undefined) { + if (input.ForwardedValues !== undefined && input.ForwardedValues !== null) { const node = serializeAws_restXmlForwardedValues(input.ForwardedValues, context).withName("ForwardedValues"); bodyNode.addChildNode(node); } - if (input.DefaultTTL !== undefined) { + if (input.DefaultTTL !== undefined && input.DefaultTTL !== null) { const node = new __XmlNode("long").addChildNode(new __XmlText(String(input.DefaultTTL))).withName("DefaultTTL"); bodyNode.addChildNode(node); } - if (input.TrustedSigners !== undefined) { + if (input.TrustedSigners !== undefined && input.TrustedSigners !== null) { const node = serializeAws_restXmlTrustedSigners(input.TrustedSigners, context).withName("TrustedSigners"); bodyNode.addChildNode(node); } - if (input.OriginRequestPolicyId !== undefined) { + if (input.OriginRequestPolicyId !== undefined && input.OriginRequestPolicyId !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.OriginRequestPolicyId)) .withName("OriginRequestPolicyId"); bodyNode.addChildNode(node); } - if (input.LambdaFunctionAssociations !== undefined) { + if (input.LambdaFunctionAssociations !== undefined && input.LambdaFunctionAssociations !== null) { const node = serializeAws_restXmlLambdaFunctionAssociations(input.LambdaFunctionAssociations, context).withName( "LambdaFunctionAssociations" ); bodyNode.addChildNode(node); } - if (input.RealtimeLogConfigArn !== undefined) { + if (input.RealtimeLogConfigArn !== undefined && input.RealtimeLogConfigArn !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.RealtimeLogConfigArn)) .withName("RealtimeLogConfigArn"); @@ -12537,79 +12487,79 @@ const serializeAws_restXmlDefaultCacheBehavior = (input: DefaultCacheBehavior, c const serializeAws_restXmlDistributionConfig = (input: DistributionConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("DistributionConfig"); - if (input.WebACLId !== undefined) { + if (input.WebACLId !== undefined && input.WebACLId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.WebACLId)).withName("WebACLId"); bodyNode.addChildNode(node); } - if (input.Aliases !== undefined) { + if (input.Aliases !== undefined && input.Aliases !== null) { const node = serializeAws_restXmlAliases(input.Aliases, context).withName("Aliases"); bodyNode.addChildNode(node); } - if (input.DefaultRootObject !== undefined) { + if (input.DefaultRootObject !== undefined && input.DefaultRootObject !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.DefaultRootObject)) .withName("DefaultRootObject"); bodyNode.addChildNode(node); } - if (input.ViewerCertificate !== undefined) { + if (input.ViewerCertificate !== undefined && input.ViewerCertificate !== null) { const node = serializeAws_restXmlViewerCertificate(input.ViewerCertificate, context).withName("ViewerCertificate"); bodyNode.addChildNode(node); } - if (input.DefaultCacheBehavior !== undefined) { + if (input.DefaultCacheBehavior !== undefined && input.DefaultCacheBehavior !== null) { const node = serializeAws_restXmlDefaultCacheBehavior(input.DefaultCacheBehavior, context).withName( "DefaultCacheBehavior" ); bodyNode.addChildNode(node); } - if (input.CallerReference !== undefined) { + if (input.CallerReference !== undefined && input.CallerReference !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.CallerReference)).withName("CallerReference"); bodyNode.addChildNode(node); } - if (input.IsIPV6Enabled !== undefined) { + if (input.IsIPV6Enabled !== undefined && input.IsIPV6Enabled !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.IsIPV6Enabled))) .withName("IsIPV6Enabled"); bodyNode.addChildNode(node); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { const node = new __XmlNode("boolean").addChildNode(new __XmlText(String(input.Enabled))).withName("Enabled"); bodyNode.addChildNode(node); } - if (input.Logging !== undefined) { + if (input.Logging !== undefined && input.Logging !== null) { const node = serializeAws_restXmlLoggingConfig(input.Logging, context).withName("Logging"); bodyNode.addChildNode(node); } - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("CommentType").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } - if (input.Origins !== undefined) { + if (input.Origins !== undefined && input.Origins !== null) { const node = serializeAws_restXmlOrigins(input.Origins, context).withName("Origins"); bodyNode.addChildNode(node); } - if (input.CustomErrorResponses !== undefined) { + if (input.CustomErrorResponses !== undefined && input.CustomErrorResponses !== null) { const node = serializeAws_restXmlCustomErrorResponses(input.CustomErrorResponses, context).withName( "CustomErrorResponses" ); bodyNode.addChildNode(node); } - if (input.Restrictions !== undefined) { + if (input.Restrictions !== undefined && input.Restrictions !== null) { const node = serializeAws_restXmlRestrictions(input.Restrictions, context).withName("Restrictions"); bodyNode.addChildNode(node); } - if (input.CacheBehaviors !== undefined) { + if (input.CacheBehaviors !== undefined && input.CacheBehaviors !== null) { const node = serializeAws_restXmlCacheBehaviors(input.CacheBehaviors, context).withName("CacheBehaviors"); bodyNode.addChildNode(node); } - if (input.OriginGroups !== undefined) { + if (input.OriginGroups !== undefined && input.OriginGroups !== null) { const node = serializeAws_restXmlOriginGroups(input.OriginGroups, context).withName("OriginGroups"); bodyNode.addChildNode(node); } - if (input.HttpVersion !== undefined) { + if (input.HttpVersion !== undefined && input.HttpVersion !== null) { const node = new __XmlNode("HttpVersion").addChildNode(new __XmlText(input.HttpVersion)).withName("HttpVersion"); bodyNode.addChildNode(node); } - if (input.PriceClass !== undefined) { + if (input.PriceClass !== undefined && input.PriceClass !== null) { const node = new __XmlNode("PriceClass").addChildNode(new __XmlText(input.PriceClass)).withName("PriceClass"); bodyNode.addChildNode(node); } @@ -12621,11 +12571,11 @@ const serializeAws_restXmlDistributionConfigWithTags = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("DistributionConfigWithTags"); - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const node = serializeAws_restXmlTags(input.Tags, context).withName("Tags"); bodyNode.addChildNode(node); } - if (input.DistributionConfig !== undefined) { + if (input.DistributionConfig !== undefined && input.DistributionConfig !== null) { const node = serializeAws_restXmlDistributionConfig(input.DistributionConfig, context).withName( "DistributionConfig" ); @@ -12636,11 +12586,11 @@ const serializeAws_restXmlDistributionConfigWithTags = ( const serializeAws_restXmlEncryptionEntities = (input: EncryptionEntities, context: __SerdeContext): any => { const bodyNode = new __XmlNode("EncryptionEntities"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlEncryptionEntityList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12653,15 +12603,15 @@ const serializeAws_restXmlEncryptionEntities = (input: EncryptionEntities, conte const serializeAws_restXmlEncryptionEntity = (input: EncryptionEntity, context: __SerdeContext): any => { const bodyNode = new __XmlNode("EncryptionEntity"); - if (input.PublicKeyId !== undefined) { + if (input.PublicKeyId !== undefined && input.PublicKeyId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.PublicKeyId)).withName("PublicKeyId"); bodyNode.addChildNode(node); } - if (input.ProviderId !== undefined) { + if (input.ProviderId !== undefined && input.ProviderId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.ProviderId)).withName("ProviderId"); bodyNode.addChildNode(node); } - if (input.FieldPatterns !== undefined) { + if (input.FieldPatterns !== undefined && input.FieldPatterns !== null) { const node = serializeAws_restXmlFieldPatterns(input.FieldPatterns, context).withName("FieldPatterns"); bodyNode.addChildNode(node); } @@ -12669,19 +12619,24 @@ const serializeAws_restXmlEncryptionEntity = (input: EncryptionEntity, context: }; const serializeAws_restXmlEncryptionEntityList = (input: EncryptionEntity[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlEncryptionEntity(entry, context); - return node.withName("EncryptionEntity"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlEncryptionEntity(entry, context); + return node.withName("EncryptionEntity"); + }); }; const serializeAws_restXmlEndPoint = (input: EndPoint, context: __SerdeContext): any => { const bodyNode = new __XmlNode("EndPoint"); - if (input.StreamType !== undefined) { + if (input.StreamType !== undefined && input.StreamType !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.StreamType)).withName("StreamType"); bodyNode.addChildNode(node); } - if (input.KinesisStreamConfig !== undefined) { + if (input.KinesisStreamConfig !== undefined && input.KinesisStreamConfig !== null) { const node = serializeAws_restXmlKinesisStreamConfig(input.KinesisStreamConfig, context).withName( "KinesisStreamConfig" ); @@ -12691,10 +12646,15 @@ const serializeAws_restXmlEndPoint = (input: EndPoint, context: __SerdeContext): }; const serializeAws_restXmlEndPointList = (input: EndPoint[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlEndPoint(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlEndPoint(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlFieldLevelEncryptionConfig = ( @@ -12702,23 +12662,23 @@ const serializeAws_restXmlFieldLevelEncryptionConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("FieldLevelEncryptionConfig"); - if (input.QueryArgProfileConfig !== undefined) { + if (input.QueryArgProfileConfig !== undefined && input.QueryArgProfileConfig !== null) { const node = serializeAws_restXmlQueryArgProfileConfig(input.QueryArgProfileConfig, context).withName( "QueryArgProfileConfig" ); bodyNode.addChildNode(node); } - if (input.ContentTypeProfileConfig !== undefined) { + if (input.ContentTypeProfileConfig !== undefined && input.ContentTypeProfileConfig !== null) { const node = serializeAws_restXmlContentTypeProfileConfig(input.ContentTypeProfileConfig, context).withName( "ContentTypeProfileConfig" ); bodyNode.addChildNode(node); } - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } - if (input.CallerReference !== undefined) { + if (input.CallerReference !== undefined && input.CallerReference !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.CallerReference)).withName("CallerReference"); bodyNode.addChildNode(node); } @@ -12730,21 +12690,21 @@ const serializeAws_restXmlFieldLevelEncryptionProfileConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("FieldLevelEncryptionProfileConfig"); - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } - if (input.EncryptionEntities !== undefined) { + if (input.EncryptionEntities !== undefined && input.EncryptionEntities !== null) { const node = serializeAws_restXmlEncryptionEntities(input.EncryptionEntities, context).withName( "EncryptionEntities" ); bodyNode.addChildNode(node); } - if (input.CallerReference !== undefined) { + if (input.CallerReference !== undefined && input.CallerReference !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.CallerReference)).withName("CallerReference"); bodyNode.addChildNode(node); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Name)).withName("Name"); bodyNode.addChildNode(node); } @@ -12752,22 +12712,32 @@ const serializeAws_restXmlFieldLevelEncryptionProfileConfig = ( }; const serializeAws_restXmlFieldList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("Field"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("Field"); + }); }; const serializeAws_restXmlFieldPatternList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("FieldPattern"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("FieldPattern"); + }); }; const serializeAws_restXmlFieldPatterns = (input: FieldPatterns, context: __SerdeContext): any => { const bodyNode = new __XmlNode("FieldPatterns"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlFieldPatternList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12775,7 +12745,7 @@ const serializeAws_restXmlFieldPatterns = (input: FieldPatterns, context: __Serd }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } @@ -12784,23 +12754,23 @@ const serializeAws_restXmlFieldPatterns = (input: FieldPatterns, context: __Serd const serializeAws_restXmlForwardedValues = (input: ForwardedValues, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ForwardedValues"); - if (input.QueryString !== undefined) { + if (input.QueryString !== undefined && input.QueryString !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.QueryString))) .withName("QueryString"); bodyNode.addChildNode(node); } - if (input.QueryStringCacheKeys !== undefined) { + if (input.QueryStringCacheKeys !== undefined && input.QueryStringCacheKeys !== null) { const node = serializeAws_restXmlQueryStringCacheKeys(input.QueryStringCacheKeys, context).withName( "QueryStringCacheKeys" ); bodyNode.addChildNode(node); } - if (input.Headers !== undefined) { + if (input.Headers !== undefined && input.Headers !== null) { const node = serializeAws_restXmlHeaders(input.Headers, context).withName("Headers"); bodyNode.addChildNode(node); } - if (input.Cookies !== undefined) { + if (input.Cookies !== undefined && input.Cookies !== null) { const node = serializeAws_restXmlCookiePreference(input.Cookies, context).withName("Cookies"); bodyNode.addChildNode(node); } @@ -12809,13 +12779,13 @@ const serializeAws_restXmlForwardedValues = (input: ForwardedValues, context: __ const serializeAws_restXmlGeoRestriction = (input: GeoRestriction, context: __SerdeContext): any => { const bodyNode = new __XmlNode("GeoRestriction"); - if (input.RestrictionType !== undefined) { + if (input.RestrictionType !== undefined && input.RestrictionType !== null) { const node = new __XmlNode("GeoRestrictionType") .addChildNode(new __XmlText(input.RestrictionType)) .withName("RestrictionType"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlLocationList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12823,7 +12793,7 @@ const serializeAws_restXmlGeoRestriction = (input: GeoRestriction, context: __Se }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } @@ -12831,19 +12801,24 @@ const serializeAws_restXmlGeoRestriction = (input: GeoRestriction, context: __Se }; const serializeAws_restXmlHeaderList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("Name"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("Name"); + }); }; const serializeAws_restXmlHeaders = (input: Headers, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Headers"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlHeaderList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12856,11 +12831,11 @@ const serializeAws_restXmlHeaders = (input: Headers, context: __SerdeContext): a const serializeAws_restXmlInvalidationBatch = (input: InvalidationBatch, context: __SerdeContext): any => { const bodyNode = new __XmlNode("InvalidationBatch"); - if (input.Paths !== undefined) { + if (input.Paths !== undefined && input.Paths !== null) { const node = serializeAws_restXmlPaths(input.Paths, context).withName("Paths"); bodyNode.addChildNode(node); } - if (input.CallerReference !== undefined) { + if (input.CallerReference !== undefined && input.CallerReference !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.CallerReference)).withName("CallerReference"); bodyNode.addChildNode(node); } @@ -12869,7 +12844,7 @@ const serializeAws_restXmlInvalidationBatch = (input: InvalidationBatch, context const serializeAws_restXmlKeyGroupConfig = (input: KeyGroupConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("KeyGroupConfig"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlPublicKeyIdList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12877,11 +12852,11 @@ const serializeAws_restXmlKeyGroupConfig = (input: KeyGroupConfig, context: __Se }); bodyNode.addChildNode(containerNode); } - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Name)).withName("Name"); bodyNode.addChildNode(node); } @@ -12890,11 +12865,11 @@ const serializeAws_restXmlKeyGroupConfig = (input: KeyGroupConfig, context: __Se const serializeAws_restXmlKinesisStreamConfig = (input: KinesisStreamConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("KinesisStreamConfig"); - if (input.RoleARN !== undefined) { + if (input.RoleARN !== undefined && input.RoleARN !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.RoleARN)).withName("RoleARN"); bodyNode.addChildNode(node); } - if (input.StreamARN !== undefined) { + if (input.StreamARN !== undefined && input.StreamARN !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.StreamARN)).withName("StreamARN"); bodyNode.addChildNode(node); } @@ -12906,17 +12881,17 @@ const serializeAws_restXmlLambdaFunctionAssociation = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("LambdaFunctionAssociation"); - if (input.LambdaFunctionARN !== undefined) { + if (input.LambdaFunctionARN !== undefined && input.LambdaFunctionARN !== null) { const node = new __XmlNode("LambdaFunctionARN") .addChildNode(new __XmlText(input.LambdaFunctionARN)) .withName("LambdaFunctionARN"); bodyNode.addChildNode(node); } - if (input.EventType !== undefined) { + if (input.EventType !== undefined && input.EventType !== null) { const node = new __XmlNode("EventType").addChildNode(new __XmlText(input.EventType)).withName("EventType"); bodyNode.addChildNode(node); } - if (input.IncludeBody !== undefined) { + if (input.IncludeBody !== undefined && input.IncludeBody !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.IncludeBody))) .withName("IncludeBody"); @@ -12929,10 +12904,15 @@ const serializeAws_restXmlLambdaFunctionAssociationList = ( input: LambdaFunctionAssociation[], context: __SerdeContext ): any => { - return input.map((entry) => { - const node = serializeAws_restXmlLambdaFunctionAssociation(entry, context); - return node.withName("LambdaFunctionAssociation"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlLambdaFunctionAssociation(entry, context); + return node.withName("LambdaFunctionAssociation"); + }); }; const serializeAws_restXmlLambdaFunctionAssociations = ( @@ -12940,7 +12920,7 @@ const serializeAws_restXmlLambdaFunctionAssociations = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("LambdaFunctionAssociations"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlLambdaFunctionAssociationList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -12948,7 +12928,7 @@ const serializeAws_restXmlLambdaFunctionAssociations = ( }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } @@ -12956,27 +12936,32 @@ const serializeAws_restXmlLambdaFunctionAssociations = ( }; const serializeAws_restXmlLocationList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("Location"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("Location"); + }); }; const serializeAws_restXmlLoggingConfig = (input: LoggingConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("LoggingConfig"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Bucket !== undefined) { + if (input.Bucket !== undefined && input.Bucket !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Bucket)).withName("Bucket"); bodyNode.addChildNode(node); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { const node = new __XmlNode("boolean").addChildNode(new __XmlText(String(input.Enabled))).withName("Enabled"); bodyNode.addChildNode(node); } - if (input.IncludeCookies !== undefined) { + if (input.IncludeCookies !== undefined && input.IncludeCookies !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.IncludeCookies))) .withName("IncludeCookies"); @@ -12986,15 +12971,20 @@ const serializeAws_restXmlLoggingConfig = (input: LoggingConfig, context: __Serd }; const serializeAws_restXmlMethodsList = (input: (Method | string)[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("Method").addChildNode(new __XmlText(entry)); - return node.withName("Method"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("Method").addChildNode(new __XmlText(entry)); + return node.withName("Method"); + }); }; const serializeAws_restXmlMonitoringSubscription = (input: MonitoringSubscription, context: __SerdeContext): any => { const bodyNode = new __XmlNode("MonitoringSubscription"); - if (input.RealtimeMetricsSubscriptionConfig !== undefined) { + if (input.RealtimeMetricsSubscriptionConfig !== undefined && input.RealtimeMetricsSubscriptionConfig !== null) { const node = serializeAws_restXmlRealtimeMetricsSubscriptionConfig( input.RealtimeMetricsSubscriptionConfig, context @@ -13006,45 +12996,45 @@ const serializeAws_restXmlMonitoringSubscription = (input: MonitoringSubscriptio const serializeAws_restXmlOrigin = (input: Origin, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Origin"); - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } - if (input.OriginPath !== undefined) { + if (input.OriginPath !== undefined && input.OriginPath !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.OriginPath)).withName("OriginPath"); bodyNode.addChildNode(node); } - if (input.CustomHeaders !== undefined) { + if (input.CustomHeaders !== undefined && input.CustomHeaders !== null) { const node = serializeAws_restXmlCustomHeaders(input.CustomHeaders, context).withName("CustomHeaders"); bodyNode.addChildNode(node); } - if (input.CustomOriginConfig !== undefined) { + if (input.CustomOriginConfig !== undefined && input.CustomOriginConfig !== null) { const node = serializeAws_restXmlCustomOriginConfig(input.CustomOriginConfig, context).withName( "CustomOriginConfig" ); bodyNode.addChildNode(node); } - if (input.S3OriginConfig !== undefined) { + if (input.S3OriginConfig !== undefined && input.S3OriginConfig !== null) { const node = serializeAws_restXmlS3OriginConfig(input.S3OriginConfig, context).withName("S3OriginConfig"); bodyNode.addChildNode(node); } - if (input.ConnectionAttempts !== undefined) { + if (input.ConnectionAttempts !== undefined && input.ConnectionAttempts !== null) { const node = new __XmlNode("integer") .addChildNode(new __XmlText(String(input.ConnectionAttempts))) .withName("ConnectionAttempts"); bodyNode.addChildNode(node); } - if (input.ConnectionTimeout !== undefined) { + if (input.ConnectionTimeout !== undefined && input.ConnectionTimeout !== null) { const node = new __XmlNode("integer") .addChildNode(new __XmlText(String(input.ConnectionTimeout))) .withName("ConnectionTimeout"); bodyNode.addChildNode(node); } - if (input.OriginShield !== undefined) { + if (input.OriginShield !== undefined && input.OriginShield !== null) { const node = serializeAws_restXmlOriginShield(input.OriginShield, context).withName("OriginShield"); bodyNode.addChildNode(node); } - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.DomainName)).withName("DomainName"); bodyNode.addChildNode(node); } @@ -13053,11 +13043,11 @@ const serializeAws_restXmlOrigin = (input: Origin, context: __SerdeContext): any const serializeAws_restXmlOriginCustomHeader = (input: OriginCustomHeader, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OriginCustomHeader"); - if (input.HeaderValue !== undefined) { + if (input.HeaderValue !== undefined && input.HeaderValue !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.HeaderValue)).withName("HeaderValue"); bodyNode.addChildNode(node); } - if (input.HeaderName !== undefined) { + if (input.HeaderName !== undefined && input.HeaderName !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.HeaderName)).withName("HeaderName"); bodyNode.addChildNode(node); } @@ -13065,25 +13055,30 @@ const serializeAws_restXmlOriginCustomHeader = (input: OriginCustomHeader, conte }; const serializeAws_restXmlOriginCustomHeadersList = (input: OriginCustomHeader[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlOriginCustomHeader(entry, context); - return node.withName("OriginCustomHeader"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlOriginCustomHeader(entry, context); + return node.withName("OriginCustomHeader"); + }); }; const serializeAws_restXmlOriginGroup = (input: OriginGroup, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OriginGroup"); - if (input.FailoverCriteria !== undefined) { + if (input.FailoverCriteria !== undefined && input.FailoverCriteria !== null) { const node = serializeAws_restXmlOriginGroupFailoverCriteria(input.FailoverCriteria, context).withName( "FailoverCriteria" ); bodyNode.addChildNode(node); } - if (input.Members !== undefined) { + if (input.Members !== undefined && input.Members !== null) { const node = serializeAws_restXmlOriginGroupMembers(input.Members, context).withName("Members"); bodyNode.addChildNode(node); } - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } @@ -13095,7 +13090,7 @@ const serializeAws_restXmlOriginGroupFailoverCriteria = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("OriginGroupFailoverCriteria"); - if (input.StatusCodes !== undefined) { + if (input.StatusCodes !== undefined && input.StatusCodes !== null) { const node = serializeAws_restXmlStatusCodes(input.StatusCodes, context).withName("StatusCodes"); bodyNode.addChildNode(node); } @@ -13103,15 +13098,20 @@ const serializeAws_restXmlOriginGroupFailoverCriteria = ( }; const serializeAws_restXmlOriginGroupList = (input: OriginGroup[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlOriginGroup(entry, context); - return node.withName("OriginGroup"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlOriginGroup(entry, context); + return node.withName("OriginGroup"); + }); }; const serializeAws_restXmlOriginGroupMember = (input: OriginGroupMember, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OriginGroupMember"); - if (input.OriginId !== undefined) { + if (input.OriginId !== undefined && input.OriginId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.OriginId)).withName("OriginId"); bodyNode.addChildNode(node); } @@ -13119,19 +13119,24 @@ const serializeAws_restXmlOriginGroupMember = (input: OriginGroupMember, context }; const serializeAws_restXmlOriginGroupMemberList = (input: OriginGroupMember[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlOriginGroupMember(entry, context); - return node.withName("OriginGroupMember"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlOriginGroupMember(entry, context); + return node.withName("OriginGroupMember"); + }); }; const serializeAws_restXmlOriginGroupMembers = (input: OriginGroupMembers, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OriginGroupMembers"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlOriginGroupMemberList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13144,11 +13149,11 @@ const serializeAws_restXmlOriginGroupMembers = (input: OriginGroupMembers, conte const serializeAws_restXmlOriginGroups = (input: OriginGroups, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OriginGroups"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlOriginGroupList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13160,10 +13165,15 @@ const serializeAws_restXmlOriginGroups = (input: OriginGroups, context: __SerdeC }; const serializeAws_restXmlOriginList = (input: Origin[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlOrigin(entry, context); - return node.withName("Origin"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlOrigin(entry, context); + return node.withName("Origin"); + }); }; const serializeAws_restXmlOriginRequestPolicyConfig = ( @@ -13171,29 +13181,29 @@ const serializeAws_restXmlOriginRequestPolicyConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("OriginRequestPolicyConfig"); - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } - if (input.CookiesConfig !== undefined) { + if (input.CookiesConfig !== undefined && input.CookiesConfig !== null) { const node = serializeAws_restXmlOriginRequestPolicyCookiesConfig(input.CookiesConfig, context).withName( "CookiesConfig" ); bodyNode.addChildNode(node); } - if (input.HeadersConfig !== undefined) { + if (input.HeadersConfig !== undefined && input.HeadersConfig !== null) { const node = serializeAws_restXmlOriginRequestPolicyHeadersConfig(input.HeadersConfig, context).withName( "HeadersConfig" ); bodyNode.addChildNode(node); } - if (input.QueryStringsConfig !== undefined) { + if (input.QueryStringsConfig !== undefined && input.QueryStringsConfig !== null) { const node = serializeAws_restXmlOriginRequestPolicyQueryStringsConfig(input.QueryStringsConfig, context).withName( "QueryStringsConfig" ); bodyNode.addChildNode(node); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Name)).withName("Name"); bodyNode.addChildNode(node); } @@ -13205,11 +13215,11 @@ const serializeAws_restXmlOriginRequestPolicyCookiesConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("OriginRequestPolicyCookiesConfig"); - if (input.Cookies !== undefined) { + if (input.Cookies !== undefined && input.Cookies !== null) { const node = serializeAws_restXmlCookieNames(input.Cookies, context).withName("Cookies"); bodyNode.addChildNode(node); } - if (input.CookieBehavior !== undefined) { + if (input.CookieBehavior !== undefined && input.CookieBehavior !== null) { const node = new __XmlNode("OriginRequestPolicyCookieBehavior") .addChildNode(new __XmlText(input.CookieBehavior)) .withName("CookieBehavior"); @@ -13223,13 +13233,13 @@ const serializeAws_restXmlOriginRequestPolicyHeadersConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("OriginRequestPolicyHeadersConfig"); - if (input.HeaderBehavior !== undefined) { + if (input.HeaderBehavior !== undefined && input.HeaderBehavior !== null) { const node = new __XmlNode("OriginRequestPolicyHeaderBehavior") .addChildNode(new __XmlText(input.HeaderBehavior)) .withName("HeaderBehavior"); bodyNode.addChildNode(node); } - if (input.Headers !== undefined) { + if (input.Headers !== undefined && input.Headers !== null) { const node = serializeAws_restXmlHeaders(input.Headers, context).withName("Headers"); bodyNode.addChildNode(node); } @@ -13241,13 +13251,13 @@ const serializeAws_restXmlOriginRequestPolicyQueryStringsConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("OriginRequestPolicyQueryStringsConfig"); - if (input.QueryStringBehavior !== undefined) { + if (input.QueryStringBehavior !== undefined && input.QueryStringBehavior !== null) { const node = new __XmlNode("OriginRequestPolicyQueryStringBehavior") .addChildNode(new __XmlText(input.QueryStringBehavior)) .withName("QueryStringBehavior"); bodyNode.addChildNode(node); } - if (input.QueryStrings !== undefined) { + if (input.QueryStrings !== undefined && input.QueryStrings !== null) { const node = serializeAws_restXmlQueryStringNames(input.QueryStrings, context).withName("QueryStrings"); bodyNode.addChildNode(node); } @@ -13256,11 +13266,11 @@ const serializeAws_restXmlOriginRequestPolicyQueryStringsConfig = ( const serializeAws_restXmlOrigins = (input: Origins, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Origins"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlOriginList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13273,13 +13283,13 @@ const serializeAws_restXmlOrigins = (input: Origins, context: __SerdeContext): a const serializeAws_restXmlOriginShield = (input: OriginShield, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OriginShield"); - if (input.OriginShieldRegion !== undefined) { + if (input.OriginShieldRegion !== undefined && input.OriginShieldRegion !== null) { const node = new __XmlNode("OriginShieldRegion") .addChildNode(new __XmlText(input.OriginShieldRegion)) .withName("OriginShieldRegion"); bodyNode.addChildNode(node); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { const node = new __XmlNode("boolean").addChildNode(new __XmlText(String(input.Enabled))).withName("Enabled"); bodyNode.addChildNode(node); } @@ -13288,11 +13298,11 @@ const serializeAws_restXmlOriginShield = (input: OriginShield, context: __SerdeC const serializeAws_restXmlOriginSslProtocols = (input: OriginSslProtocols, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OriginSslProtocols"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlSslProtocolsList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13308,29 +13318,29 @@ const serializeAws_restXmlParametersInCacheKeyAndForwardedToOrigin = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("ParametersInCacheKeyAndForwardedToOrigin"); - if (input.QueryStringsConfig !== undefined) { + if (input.QueryStringsConfig !== undefined && input.QueryStringsConfig !== null) { const node = serializeAws_restXmlCachePolicyQueryStringsConfig(input.QueryStringsConfig, context).withName( "QueryStringsConfig" ); bodyNode.addChildNode(node); } - if (input.EnableAcceptEncodingBrotli !== undefined) { + if (input.EnableAcceptEncodingBrotli !== undefined && input.EnableAcceptEncodingBrotli !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.EnableAcceptEncodingBrotli))) .withName("EnableAcceptEncodingBrotli"); bodyNode.addChildNode(node); } - if (input.HeadersConfig !== undefined) { + if (input.HeadersConfig !== undefined && input.HeadersConfig !== null) { const node = serializeAws_restXmlCachePolicyHeadersConfig(input.HeadersConfig, context).withName("HeadersConfig"); bodyNode.addChildNode(node); } - if (input.EnableAcceptEncodingGzip !== undefined) { + if (input.EnableAcceptEncodingGzip !== undefined && input.EnableAcceptEncodingGzip !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.EnableAcceptEncodingGzip))) .withName("EnableAcceptEncodingGzip"); bodyNode.addChildNode(node); } - if (input.CookiesConfig !== undefined) { + if (input.CookiesConfig !== undefined && input.CookiesConfig !== null) { const node = serializeAws_restXmlCachePolicyCookiesConfig(input.CookiesConfig, context).withName("CookiesConfig"); bodyNode.addChildNode(node); } @@ -13338,19 +13348,24 @@ const serializeAws_restXmlParametersInCacheKeyAndForwardedToOrigin = ( }; const serializeAws_restXmlPathList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("Path"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("Path"); + }); }; const serializeAws_restXmlPaths = (input: Paths, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Paths"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlPathList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13363,19 +13378,19 @@ const serializeAws_restXmlPaths = (input: Paths, context: __SerdeContext): any = const serializeAws_restXmlPublicKeyConfig = (input: PublicKeyConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("PublicKeyConfig"); - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Name)).withName("Name"); bodyNode.addChildNode(node); } - if (input.EncodedKey !== undefined) { + if (input.EncodedKey !== undefined && input.EncodedKey !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.EncodedKey)).withName("EncodedKey"); bodyNode.addChildNode(node); } - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } - if (input.CallerReference !== undefined) { + if (input.CallerReference !== undefined && input.CallerReference !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.CallerReference)).withName("CallerReference"); bodyNode.addChildNode(node); } @@ -13383,19 +13398,24 @@ const serializeAws_restXmlPublicKeyConfig = (input: PublicKeyConfig, context: __ }; const serializeAws_restXmlPublicKeyIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("PublicKey"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("PublicKey"); + }); }; const serializeAws_restXmlQueryArgProfile = (input: QueryArgProfile, context: __SerdeContext): any => { const bodyNode = new __XmlNode("QueryArgProfile"); - if (input.QueryArg !== undefined) { + if (input.QueryArg !== undefined && input.QueryArg !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.QueryArg)).withName("QueryArg"); bodyNode.addChildNode(node); } - if (input.ProfileId !== undefined) { + if (input.ProfileId !== undefined && input.ProfileId !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.ProfileId)).withName("ProfileId"); bodyNode.addChildNode(node); } @@ -13404,13 +13424,13 @@ const serializeAws_restXmlQueryArgProfile = (input: QueryArgProfile, context: __ const serializeAws_restXmlQueryArgProfileConfig = (input: QueryArgProfileConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("QueryArgProfileConfig"); - if (input.ForwardWhenQueryArgProfileIsUnknown !== undefined) { + if (input.ForwardWhenQueryArgProfileIsUnknown !== undefined && input.ForwardWhenQueryArgProfileIsUnknown !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.ForwardWhenQueryArgProfileIsUnknown))) .withName("ForwardWhenQueryArgProfileIsUnknown"); bodyNode.addChildNode(node); } - if (input.QueryArgProfiles !== undefined) { + if (input.QueryArgProfiles !== undefined && input.QueryArgProfiles !== null) { const node = serializeAws_restXmlQueryArgProfiles(input.QueryArgProfiles, context).withName("QueryArgProfiles"); bodyNode.addChildNode(node); } @@ -13418,15 +13438,20 @@ const serializeAws_restXmlQueryArgProfileConfig = (input: QueryArgProfileConfig, }; const serializeAws_restXmlQueryArgProfileList = (input: QueryArgProfile[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlQueryArgProfile(entry, context); - return node.withName("QueryArgProfile"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlQueryArgProfile(entry, context); + return node.withName("QueryArgProfile"); + }); }; const serializeAws_restXmlQueryArgProfiles = (input: QueryArgProfiles, context: __SerdeContext): any => { const bodyNode = new __XmlNode("QueryArgProfiles"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlQueryArgProfileList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13434,7 +13459,7 @@ const serializeAws_restXmlQueryArgProfiles = (input: QueryArgProfiles, context: }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } @@ -13443,7 +13468,7 @@ const serializeAws_restXmlQueryArgProfiles = (input: QueryArgProfiles, context: const serializeAws_restXmlQueryStringCacheKeys = (input: QueryStringCacheKeys, context: __SerdeContext): any => { const bodyNode = new __XmlNode("QueryStringCacheKeys"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlQueryStringCacheKeysList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13451,7 +13476,7 @@ const serializeAws_restXmlQueryStringCacheKeys = (input: QueryStringCacheKeys, c }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } @@ -13459,19 +13484,24 @@ const serializeAws_restXmlQueryStringCacheKeys = (input: QueryStringCacheKeys, c }; const serializeAws_restXmlQueryStringCacheKeysList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("Name"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("Name"); + }); }; const serializeAws_restXmlQueryStringNames = (input: QueryStringNames, context: __SerdeContext): any => { const bodyNode = new __XmlNode("QueryStringNames"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlQueryStringNamesList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13483,10 +13513,15 @@ const serializeAws_restXmlQueryStringNames = (input: QueryStringNames, context: }; const serializeAws_restXmlQueryStringNamesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("Name"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("Name"); + }); }; const serializeAws_restXmlRealtimeMetricsSubscriptionConfig = ( @@ -13494,7 +13529,7 @@ const serializeAws_restXmlRealtimeMetricsSubscriptionConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("RealtimeMetricsSubscriptionConfig"); - if (input.RealtimeMetricsSubscriptionStatus !== undefined) { + if (input.RealtimeMetricsSubscriptionStatus !== undefined && input.RealtimeMetricsSubscriptionStatus !== null) { const node = new __XmlNode("RealtimeMetricsSubscriptionStatus") .addChildNode(new __XmlText(input.RealtimeMetricsSubscriptionStatus)) .withName("RealtimeMetricsSubscriptionStatus"); @@ -13505,7 +13540,7 @@ const serializeAws_restXmlRealtimeMetricsSubscriptionConfig = ( const serializeAws_restXmlRestrictions = (input: Restrictions, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Restrictions"); - if (input.GeoRestriction !== undefined) { + if (input.GeoRestriction !== undefined && input.GeoRestriction !== null) { const node = serializeAws_restXmlGeoRestriction(input.GeoRestriction, context).withName("GeoRestriction"); bodyNode.addChildNode(node); } @@ -13514,11 +13549,11 @@ const serializeAws_restXmlRestrictions = (input: Restrictions, context: __SerdeC const serializeAws_restXmlS3Origin = (input: S3Origin, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3Origin"); - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.DomainName)).withName("DomainName"); bodyNode.addChildNode(node); } - if (input.OriginAccessIdentity !== undefined) { + if (input.OriginAccessIdentity !== undefined && input.OriginAccessIdentity !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.OriginAccessIdentity)) .withName("OriginAccessIdentity"); @@ -13529,7 +13564,7 @@ const serializeAws_restXmlS3Origin = (input: S3Origin, context: __SerdeContext): const serializeAws_restXmlS3OriginConfig = (input: S3OriginConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3OriginConfig"); - if (input.OriginAccessIdentity !== undefined) { + if (input.OriginAccessIdentity !== undefined && input.OriginAccessIdentity !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.OriginAccessIdentity)) .withName("OriginAccessIdentity"); @@ -13539,26 +13574,36 @@ const serializeAws_restXmlS3OriginConfig = (input: S3OriginConfig, context: __Se }; const serializeAws_restXmlSslProtocolsList = (input: (SslProtocol | string)[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("SslProtocol").addChildNode(new __XmlText(entry)); - return node.withName("SslProtocol"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("SslProtocol").addChildNode(new __XmlText(entry)); + return node.withName("SslProtocol"); + }); }; const serializeAws_restXmlStatusCodeList = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("integer").addChildNode(new __XmlText(String(entry))); - return node.withName("StatusCode"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("integer").addChildNode(new __XmlText(String(entry))); + return node.withName("StatusCode"); + }); }; const serializeAws_restXmlStatusCodes = (input: StatusCodes, context: __SerdeContext): any => { const bodyNode = new __XmlNode("StatusCodes"); - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlStatusCodeList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13574,35 +13619,35 @@ const serializeAws_restXmlStreamingDistributionConfig = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("StreamingDistributionConfig"); - if (input.Logging !== undefined) { + if (input.Logging !== undefined && input.Logging !== null) { const node = serializeAws_restXmlStreamingLoggingConfig(input.Logging, context).withName("Logging"); bodyNode.addChildNode(node); } - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } - if (input.PriceClass !== undefined) { + if (input.PriceClass !== undefined && input.PriceClass !== null) { const node = new __XmlNode("PriceClass").addChildNode(new __XmlText(input.PriceClass)).withName("PriceClass"); bodyNode.addChildNode(node); } - if (input.S3Origin !== undefined) { + if (input.S3Origin !== undefined && input.S3Origin !== null) { const node = serializeAws_restXmlS3Origin(input.S3Origin, context).withName("S3Origin"); bodyNode.addChildNode(node); } - if (input.TrustedSigners !== undefined) { + if (input.TrustedSigners !== undefined && input.TrustedSigners !== null) { const node = serializeAws_restXmlTrustedSigners(input.TrustedSigners, context).withName("TrustedSigners"); bodyNode.addChildNode(node); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { const node = new __XmlNode("boolean").addChildNode(new __XmlText(String(input.Enabled))).withName("Enabled"); bodyNode.addChildNode(node); } - if (input.CallerReference !== undefined) { + if (input.CallerReference !== undefined && input.CallerReference !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.CallerReference)).withName("CallerReference"); bodyNode.addChildNode(node); } - if (input.Aliases !== undefined) { + if (input.Aliases !== undefined && input.Aliases !== null) { const node = serializeAws_restXmlAliases(input.Aliases, context).withName("Aliases"); bodyNode.addChildNode(node); } @@ -13614,11 +13659,11 @@ const serializeAws_restXmlStreamingDistributionConfigWithTags = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("StreamingDistributionConfigWithTags"); - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const node = serializeAws_restXmlTags(input.Tags, context).withName("Tags"); bodyNode.addChildNode(node); } - if (input.StreamingDistributionConfig !== undefined) { + if (input.StreamingDistributionConfig !== undefined && input.StreamingDistributionConfig !== null) { const node = serializeAws_restXmlStreamingDistributionConfig(input.StreamingDistributionConfig, context).withName( "StreamingDistributionConfig" ); @@ -13629,15 +13674,15 @@ const serializeAws_restXmlStreamingDistributionConfigWithTags = ( const serializeAws_restXmlStreamingLoggingConfig = (input: StreamingLoggingConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("StreamingLoggingConfig"); - if (input.Bucket !== undefined) { + if (input.Bucket !== undefined && input.Bucket !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Bucket)).withName("Bucket"); bodyNode.addChildNode(node); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { const node = new __XmlNode("boolean").addChildNode(new __XmlText(String(input.Enabled))).withName("Enabled"); bodyNode.addChildNode(node); } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } @@ -13646,11 +13691,11 @@ const serializeAws_restXmlStreamingLoggingConfig = (input: StreamingLoggingConfi const serializeAws_restXmlTag = (input: Tag, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Tag"); - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { const node = new __XmlNode("TagValue").addChildNode(new __XmlText(input.Value)).withName("Value"); bodyNode.addChildNode(node); } - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { const node = new __XmlNode("TagKey").addChildNode(new __XmlText(input.Key)).withName("Key"); bodyNode.addChildNode(node); } @@ -13658,15 +13703,20 @@ const serializeAws_restXmlTag = (input: Tag, context: __SerdeContext): any => { }; const serializeAws_restXmlTagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("TagKey").addChildNode(new __XmlText(entry)); - return node.withName("Key"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("TagKey").addChildNode(new __XmlText(entry)); + return node.withName("Key"); + }); }; const serializeAws_restXmlTagKeys = (input: TagKeys, context: __SerdeContext): any => { const bodyNode = new __XmlNode("TagKeys"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlTagKeyList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13678,15 +13728,20 @@ const serializeAws_restXmlTagKeys = (input: TagKeys, context: __SerdeContext): a }; const serializeAws_restXmlTagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlTag(entry, context); - return node.withName("Tag"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlTag(entry, context); + return node.withName("Tag"); + }); }; const serializeAws_restXmlTags = (input: Tags, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Tags"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlTagList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13698,15 +13753,20 @@ const serializeAws_restXmlTags = (input: Tags, context: __SerdeContext): any => }; const serializeAws_restXmlTrustedKeyGroupIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); - return node.withName("KeyGroup"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("string").addChildNode(new __XmlText(entry)); + return node.withName("KeyGroup"); + }); }; const serializeAws_restXmlTrustedKeyGroups = (input: TrustedKeyGroups, context: __SerdeContext): any => { const bodyNode = new __XmlNode("TrustedKeyGroups"); - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlTrustedKeyGroupIdList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13714,11 +13774,11 @@ const serializeAws_restXmlTrustedKeyGroups = (input: TrustedKeyGroups, context: }); bodyNode.addChildNode(containerNode); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { const node = new __XmlNode("boolean").addChildNode(new __XmlText(String(input.Enabled))).withName("Enabled"); bodyNode.addChildNode(node); } @@ -13727,15 +13787,15 @@ const serializeAws_restXmlTrustedKeyGroups = (input: TrustedKeyGroups, context: const serializeAws_restXmlTrustedSigners = (input: TrustedSigners, context: __SerdeContext): any => { const bodyNode = new __XmlNode("TrustedSigners"); - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { const node = new __XmlNode("boolean").addChildNode(new __XmlText(String(input.Enabled))).withName("Enabled"); bodyNode.addChildNode(node); } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { const node = new __XmlNode("integer").addChildNode(new __XmlText(String(input.Quantity))).withName("Quantity"); bodyNode.addChildNode(node); } - if (input.Items !== undefined) { + if (input.Items !== undefined && input.Items !== null) { const nodes = serializeAws_restXmlAwsAccountNumberList(input.Items, context); const containerNode = new __XmlNode("Items"); nodes.map((node: any) => { @@ -13748,43 +13808,43 @@ const serializeAws_restXmlTrustedSigners = (input: TrustedSigners, context: __Se const serializeAws_restXmlViewerCertificate = (input: ViewerCertificate, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ViewerCertificate"); - if (input.IAMCertificateId !== undefined) { + if (input.IAMCertificateId !== undefined && input.IAMCertificateId !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.IAMCertificateId)) .withName("IAMCertificateId"); bodyNode.addChildNode(node); } - if (input.MinimumProtocolVersion !== undefined) { + if (input.MinimumProtocolVersion !== undefined && input.MinimumProtocolVersion !== null) { const node = new __XmlNode("MinimumProtocolVersion") .addChildNode(new __XmlText(input.MinimumProtocolVersion)) .withName("MinimumProtocolVersion"); bodyNode.addChildNode(node); } - if (input.CloudFrontDefaultCertificate !== undefined) { + if (input.CloudFrontDefaultCertificate !== undefined && input.CloudFrontDefaultCertificate !== null) { const node = new __XmlNode("boolean") .addChildNode(new __XmlText(String(input.CloudFrontDefaultCertificate))) .withName("CloudFrontDefaultCertificate"); bodyNode.addChildNode(node); } - if (input.SSLSupportMethod !== undefined) { + if (input.SSLSupportMethod !== undefined && input.SSLSupportMethod !== null) { const node = new __XmlNode("SSLSupportMethod") .addChildNode(new __XmlText(input.SSLSupportMethod)) .withName("SSLSupportMethod"); bodyNode.addChildNode(node); } - if (input.ACMCertificateArn !== undefined) { + if (input.ACMCertificateArn !== undefined && input.ACMCertificateArn !== null) { const node = new __XmlNode("string") .addChildNode(new __XmlText(input.ACMCertificateArn)) .withName("ACMCertificateArn"); bodyNode.addChildNode(node); } - if (input.CertificateSource !== undefined) { + if (input.CertificateSource !== undefined && input.CertificateSource !== null) { const node = new __XmlNode("CertificateSource") .addChildNode(new __XmlText(input.CertificateSource)) .withName("CertificateSource"); bodyNode.addChildNode(node); } - if (input.Certificate !== undefined) { + if (input.Certificate !== undefined && input.Certificate !== null) { const node = new __XmlNode("string").addChildNode(new __XmlText(input.Certificate)).withName("Certificate"); bodyNode.addChildNode(node); } @@ -13868,11 +13928,25 @@ const deserializeAws_restXmlAliasICPRecordal = (output: any, context: __SerdeCon }; const deserializeAws_restXmlAliasICPRecordals = (output: any, context: __SerdeContext): AliasICPRecordal[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlAliasICPRecordal(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlAliasICPRecordal(entry, context); + }); }; const deserializeAws_restXmlAliasList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlAllowedMethods = (output: any, context: __SerdeContext): AllowedMethods => { @@ -13897,7 +13971,14 @@ const deserializeAws_restXmlAllowedMethods = (output: any, context: __SerdeConte }; const deserializeAws_restXmlAwsAccountNumberList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlCacheBehavior = (output: any, context: __SerdeContext): CacheBehavior => { @@ -13978,7 +14059,14 @@ const deserializeAws_restXmlCacheBehavior = (output: any, context: __SerdeContex }; const deserializeAws_restXmlCacheBehaviorList = (output: any, context: __SerdeContext): CacheBehavior[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlCacheBehavior(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlCacheBehavior(entry, context); + }); }; const deserializeAws_restXmlCacheBehaviors = (output: any, context: __SerdeContext): CacheBehaviors => { @@ -14163,7 +14251,14 @@ const deserializeAws_restXmlCachePolicySummary = (output: any, context: __SerdeC }; const deserializeAws_restXmlCachePolicySummaryList = (output: any, context: __SerdeContext): CachePolicySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlCachePolicySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlCachePolicySummary(entry, context); + }); }; const deserializeAws_restXmlCloudFrontOriginAccessIdentity = ( @@ -14271,9 +14366,14 @@ const deserializeAws_restXmlCloudFrontOriginAccessIdentitySummaryList = ( output: any, context: __SerdeContext ): CloudFrontOriginAccessIdentitySummary[] => { - return (output || []).map((entry: any) => - deserializeAws_restXmlCloudFrontOriginAccessIdentitySummary(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlCloudFrontOriginAccessIdentitySummary(entry, context); + }); }; const deserializeAws_restXmlContentTypeProfile = (output: any, context: __SerdeContext): ContentTypeProfile => { @@ -14312,7 +14412,14 @@ const deserializeAws_restXmlContentTypeProfileConfig = ( }; const deserializeAws_restXmlContentTypeProfileList = (output: any, context: __SerdeContext): ContentTypeProfile[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlContentTypeProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlContentTypeProfile(entry, context); + }); }; const deserializeAws_restXmlContentTypeProfiles = (output: any, context: __SerdeContext): ContentTypeProfiles => { @@ -14336,7 +14443,14 @@ const deserializeAws_restXmlContentTypeProfiles = (output: any, context: __Serde }; const deserializeAws_restXmlCookieNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlCookieNames = (output: any, context: __SerdeContext): CookieNames => { @@ -14393,7 +14507,14 @@ const deserializeAws_restXmlCustomErrorResponse = (output: any, context: __Serde }; const deserializeAws_restXmlCustomErrorResponseList = (output: any, context: __SerdeContext): CustomErrorResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlCustomErrorResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlCustomErrorResponse(entry, context); + }); }; const deserializeAws_restXmlCustomErrorResponses = (output: any, context: __SerdeContext): CustomErrorResponses => { @@ -14705,7 +14826,14 @@ const deserializeAws_restXmlDistributionIdList = (output: any, context: __SerdeC }; const deserializeAws_restXmlDistributionIdListSummary = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlDistributionList = (output: any, context: __SerdeContext): DistributionList => { @@ -14837,7 +14965,14 @@ const deserializeAws_restXmlDistributionSummary = (output: any, context: __Serde }; const deserializeAws_restXmlDistributionSummaryList = (output: any, context: __SerdeContext): DistributionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlDistributionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlDistributionSummary(entry, context); + }); }; const deserializeAws_restXmlEncryptionEntities = (output: any, context: __SerdeContext): EncryptionEntities => { @@ -14879,7 +15014,14 @@ const deserializeAws_restXmlEncryptionEntity = (output: any, context: __SerdeCon }; const deserializeAws_restXmlEncryptionEntityList = (output: any, context: __SerdeContext): EncryptionEntity[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlEncryptionEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlEncryptionEntity(entry, context); + }); }; const deserializeAws_restXmlEndPoint = (output: any, context: __SerdeContext): EndPoint => { @@ -14897,7 +15039,14 @@ const deserializeAws_restXmlEndPoint = (output: any, context: __SerdeContext): E }; const deserializeAws_restXmlEndPointList = (output: any, context: __SerdeContext): EndPoint[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlEndPoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlEndPoint(entry, context); + }); }; const deserializeAws_restXmlFieldLevelEncryption = (output: any, context: __SerdeContext): FieldLevelEncryption => { @@ -15096,7 +15245,14 @@ const deserializeAws_restXmlFieldLevelEncryptionProfileSummaryList = ( output: any, context: __SerdeContext ): FieldLevelEncryptionProfileSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlFieldLevelEncryptionProfileSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlFieldLevelEncryptionProfileSummary(entry, context); + }); }; const deserializeAws_restXmlFieldLevelEncryptionSummary = ( @@ -15138,15 +15294,36 @@ const deserializeAws_restXmlFieldLevelEncryptionSummaryList = ( output: any, context: __SerdeContext ): FieldLevelEncryptionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlFieldLevelEncryptionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlFieldLevelEncryptionSummary(entry, context); + }); }; const deserializeAws_restXmlFieldList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlFieldPatternList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlFieldPatterns = (output: any, context: __SerdeContext): FieldPatterns => { @@ -15213,7 +15390,14 @@ const deserializeAws_restXmlGeoRestriction = (output: any, context: __SerdeConte }; const deserializeAws_restXmlHeaderList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlHeaders = (output: any, context: __SerdeContext): Headers => { @@ -15324,7 +15508,14 @@ const deserializeAws_restXmlInvalidationSummary = (output: any, context: __Serde }; const deserializeAws_restXmlInvalidationSummaryList = (output: any, context: __SerdeContext): InvalidationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlInvalidationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlInvalidationSummary(entry, context); + }); }; const deserializeAws_restXmlKeyGroup = (output: any, context: __SerdeContext): KeyGroup => { @@ -15408,11 +15599,25 @@ const deserializeAws_restXmlKeyGroupSummary = (output: any, context: __SerdeCont }; const deserializeAws_restXmlKeyGroupSummaryList = (output: any, context: __SerdeContext): KeyGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlKeyGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlKeyGroupSummary(entry, context); + }); }; const deserializeAws_restXmlKeyPairIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlKeyPairIds = (output: any, context: __SerdeContext): KeyPairIds => { @@ -15447,7 +15652,14 @@ const deserializeAws_restXmlKGKeyPairIds = (output: any, context: __SerdeContext }; const deserializeAws_restXmlKGKeyPairIdsList = (output: any, context: __SerdeContext): KGKeyPairIds[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlKGKeyPairIds(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlKGKeyPairIds(entry, context); + }); }; const deserializeAws_restXmlKinesisStreamConfig = (output: any, context: __SerdeContext): KinesisStreamConfig => { @@ -15489,7 +15701,14 @@ const deserializeAws_restXmlLambdaFunctionAssociationList = ( output: any, context: __SerdeContext ): LambdaFunctionAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlLambdaFunctionAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlLambdaFunctionAssociation(entry, context); + }); }; const deserializeAws_restXmlLambdaFunctionAssociations = ( @@ -15516,7 +15735,14 @@ const deserializeAws_restXmlLambdaFunctionAssociations = ( }; const deserializeAws_restXmlLocationList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlLoggingConfig = (output: any, context: __SerdeContext): LoggingConfig => { @@ -15542,7 +15768,14 @@ const deserializeAws_restXmlLoggingConfig = (output: any, context: __SerdeContex }; const deserializeAws_restXmlMethodsList = (output: any, context: __SerdeContext): (Method | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlMonitoringSubscription = (output: any, context: __SerdeContext): MonitoringSubscription => { @@ -15615,7 +15848,14 @@ const deserializeAws_restXmlOriginCustomHeader = (output: any, context: __SerdeC }; const deserializeAws_restXmlOriginCustomHeadersList = (output: any, context: __SerdeContext): OriginCustomHeader[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlOriginCustomHeader(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlOriginCustomHeader(entry, context); + }); }; const deserializeAws_restXmlOriginGroup = (output: any, context: __SerdeContext): OriginGroup => { @@ -15650,7 +15890,14 @@ const deserializeAws_restXmlOriginGroupFailoverCriteria = ( }; const deserializeAws_restXmlOriginGroupList = (output: any, context: __SerdeContext): OriginGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlOriginGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlOriginGroup(entry, context); + }); }; const deserializeAws_restXmlOriginGroupMember = (output: any, context: __SerdeContext): OriginGroupMember => { @@ -15664,7 +15911,14 @@ const deserializeAws_restXmlOriginGroupMember = (output: any, context: __SerdeCo }; const deserializeAws_restXmlOriginGroupMemberList = (output: any, context: __SerdeContext): OriginGroupMember[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlOriginGroupMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlOriginGroupMember(entry, context); + }); }; const deserializeAws_restXmlOriginGroupMembers = (output: any, context: __SerdeContext): OriginGroupMembers => { @@ -15708,7 +15962,14 @@ const deserializeAws_restXmlOriginGroups = (output: any, context: __SerdeContext }; const deserializeAws_restXmlOriginList = (output: any, context: __SerdeContext): Origin[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlOrigin(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlOrigin(entry, context); + }); }; const deserializeAws_restXmlOriginRequestPolicy = (output: any, context: __SerdeContext): OriginRequestPolicy => { @@ -15867,7 +16128,14 @@ const deserializeAws_restXmlOriginRequestPolicySummaryList = ( output: any, context: __SerdeContext ): OriginRequestPolicySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlOriginRequestPolicySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlOriginRequestPolicySummary(entry, context); + }); }; const deserializeAws_restXmlOrigins = (output: any, context: __SerdeContext): Origins => { @@ -15954,7 +16222,14 @@ const deserializeAws_restXmlParametersInCacheKeyAndForwardedToOrigin = ( }; const deserializeAws_restXmlPathList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlPaths = (output: any, context: __SerdeContext): Paths => { @@ -16015,7 +16290,14 @@ const deserializeAws_restXmlPublicKeyConfig = (output: any, context: __SerdeCont }; const deserializeAws_restXmlPublicKeyIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlPublicKeyList = (output: any, context: __SerdeContext): PublicKeyList => { @@ -16073,7 +16355,14 @@ const deserializeAws_restXmlPublicKeySummary = (output: any, context: __SerdeCon }; const deserializeAws_restXmlPublicKeySummaryList = (output: any, context: __SerdeContext): PublicKeySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlPublicKeySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlPublicKeySummary(entry, context); + }); }; const deserializeAws_restXmlQueryArgProfile = (output: any, context: __SerdeContext): QueryArgProfile => { @@ -16105,7 +16394,14 @@ const deserializeAws_restXmlQueryArgProfileConfig = (output: any, context: __Ser }; const deserializeAws_restXmlQueryArgProfileList = (output: any, context: __SerdeContext): QueryArgProfile[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlQueryArgProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlQueryArgProfile(entry, context); + }); }; const deserializeAws_restXmlQueryArgProfiles = (output: any, context: __SerdeContext): QueryArgProfiles => { @@ -16149,7 +16445,14 @@ const deserializeAws_restXmlQueryStringCacheKeys = (output: any, context: __Serd }; const deserializeAws_restXmlQueryStringCacheKeysList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlQueryStringNames = (output: any, context: __SerdeContext): QueryStringNames => { @@ -16173,7 +16476,14 @@ const deserializeAws_restXmlQueryStringNames = (output: any, context: __SerdeCon }; const deserializeAws_restXmlQueryStringNamesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlRealtimeLogConfig = (output: any, context: __SerdeContext): RealtimeLogConfig => { @@ -16212,7 +16522,14 @@ const deserializeAws_restXmlRealtimeLogConfig = (output: any, context: __SerdeCo }; const deserializeAws_restXmlRealtimeLogConfigList = (output: any, context: __SerdeContext): RealtimeLogConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlRealtimeLogConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlRealtimeLogConfig(entry, context); + }); }; const deserializeAws_restXmlRealtimeLogConfigs = (output: any, context: __SerdeContext): RealtimeLogConfigs => { @@ -16309,15 +16626,36 @@ const deserializeAws_restXmlSigner = (output: any, context: __SerdeContext): Sig }; const deserializeAws_restXmlSignerList = (output: any, context: __SerdeContext): Signer[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlSigner(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlSigner(entry, context); + }); }; const deserializeAws_restXmlSslProtocolsList = (output: any, context: __SerdeContext): (SslProtocol | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlStatusCodeList = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => parseInt(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return parseInt(entry); + }); }; const deserializeAws_restXmlStatusCodes = (output: any, context: __SerdeContext): StatusCodes => { @@ -16514,7 +16852,14 @@ const deserializeAws_restXmlStreamingDistributionSummaryList = ( output: any, context: __SerdeContext ): StreamingDistributionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlStreamingDistributionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlStreamingDistributionSummary(entry, context); + }); }; const deserializeAws_restXmlStreamingLoggingConfig = (output: any, context: __SerdeContext): StreamingLoggingConfig => { @@ -16550,7 +16895,14 @@ const deserializeAws_restXmlTag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_restXmlTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTag(entry, context); + }); }; const deserializeAws_restXmlTags = (output: any, context: __SerdeContext): Tags => { @@ -16567,7 +16919,14 @@ const deserializeAws_restXmlTags = (output: any, context: __SerdeContext): Tags }; const deserializeAws_restXmlTrustedKeyGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlTrustedKeyGroups = (output: any, context: __SerdeContext): TrustedKeyGroups => { @@ -16672,6 +17031,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts b/clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts index 4b132eb54604..fd36afea1657 100644 --- a/clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts @@ -76,7 +76,7 @@ export const serializeAws_json1_1CopyBackupToRegionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.CopyBackupToRegion", }; let body: any; @@ -89,7 +89,7 @@ export const serializeAws_json1_1CreateClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.CreateCluster", }; let body: any; @@ -102,7 +102,7 @@ export const serializeAws_json1_1CreateHsmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.CreateHsm", }; let body: any; @@ -115,7 +115,7 @@ export const serializeAws_json1_1DeleteBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.DeleteBackup", }; let body: any; @@ -128,7 +128,7 @@ export const serializeAws_json1_1DeleteClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.DeleteCluster", }; let body: any; @@ -141,7 +141,7 @@ export const serializeAws_json1_1DeleteHsmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.DeleteHsm", }; let body: any; @@ -154,7 +154,7 @@ export const serializeAws_json1_1DescribeBackupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.DescribeBackups", }; let body: any; @@ -167,7 +167,7 @@ export const serializeAws_json1_1DescribeClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.DescribeClusters", }; let body: any; @@ -180,7 +180,7 @@ export const serializeAws_json1_1InitializeClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.InitializeCluster", }; let body: any; @@ -193,7 +193,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.ListTags", }; let body: any; @@ -206,7 +206,7 @@ export const serializeAws_json1_1ModifyBackupAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.ModifyBackupAttributes", }; let body: any; @@ -219,7 +219,7 @@ export const serializeAws_json1_1ModifyClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.ModifyCluster", }; let body: any; @@ -232,7 +232,7 @@ export const serializeAws_json1_1RestoreBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.RestoreBackup", }; let body: any; @@ -245,7 +245,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.TagResource", }; let body: any; @@ -258,7 +258,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "BaldrApiService.UntagResource", }; let body: any; @@ -293,8 +293,7 @@ const deserializeAws_json1_1CopyBackupToRegionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -388,8 +387,7 @@ const deserializeAws_json1_1CreateClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -483,8 +481,7 @@ const deserializeAws_json1_1CreateHsmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -570,8 +567,7 @@ const deserializeAws_json1_1DeleteBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -657,8 +653,7 @@ const deserializeAws_json1_1DeleteClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -752,8 +747,7 @@ const deserializeAws_json1_1DeleteHsmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -839,8 +833,7 @@ const deserializeAws_json1_1DescribeBackupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -934,8 +927,7 @@ const deserializeAws_json1_1DescribeClustersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -1021,8 +1013,7 @@ const deserializeAws_json1_1InitializeClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -1108,8 +1099,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -1203,8 +1193,7 @@ const deserializeAws_json1_1ModifyBackupAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -1290,8 +1279,7 @@ const deserializeAws_json1_1ModifyClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -1377,8 +1365,7 @@ const deserializeAws_json1_1RestoreBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -1464,8 +1451,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -1559,8 +1545,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmAccessDeniedException": case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": @@ -1719,8 +1704,8 @@ const deserializeAws_json1_1CloudHsmTagExceptionResponse = async ( const serializeAws_json1_1BackupRetentionPolicy = (input: BackupRetentionPolicy, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -1729,78 +1714,89 @@ const serializeAws_json1_1CopyBackupToRegionRequest = ( context: __SerdeContext ): any => { return { - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), - ...(input.DestinationRegion !== undefined && { DestinationRegion: input.DestinationRegion }), - ...(input.TagList !== undefined && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), + ...(input.DestinationRegion !== undefined && + input.DestinationRegion !== null && { DestinationRegion: input.DestinationRegion }), + ...(input.TagList !== undefined && + input.TagList !== null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), }; }; const serializeAws_json1_1CreateClusterRequest = (input: CreateClusterRequest, context: __SerdeContext): any => { return { - ...(input.BackupRetentionPolicy !== undefined && { - BackupRetentionPolicy: serializeAws_json1_1BackupRetentionPolicy(input.BackupRetentionPolicy, context), - }), - ...(input.HsmType !== undefined && { HsmType: input.HsmType }), - ...(input.SourceBackupId !== undefined && { SourceBackupId: input.SourceBackupId }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), - ...(input.TagList !== undefined && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), + ...(input.BackupRetentionPolicy !== undefined && + input.BackupRetentionPolicy !== null && { + BackupRetentionPolicy: serializeAws_json1_1BackupRetentionPolicy(input.BackupRetentionPolicy, context), + }), + ...(input.HsmType !== undefined && input.HsmType !== null && { HsmType: input.HsmType }), + ...(input.SourceBackupId !== undefined && + input.SourceBackupId !== null && { SourceBackupId: input.SourceBackupId }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), + ...(input.TagList !== undefined && + input.TagList !== null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), }; }; const serializeAws_json1_1CreateHsmRequest = (input: CreateHsmRequest, context: __SerdeContext): any => { return { - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.IpAddress !== undefined && { IpAddress: input.IpAddress }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.IpAddress !== undefined && input.IpAddress !== null && { IpAddress: input.IpAddress }), }; }; const serializeAws_json1_1DeleteBackupRequest = (input: DeleteBackupRequest, context: __SerdeContext): any => { return { - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), }; }; const serializeAws_json1_1DeleteClusterRequest = (input: DeleteClusterRequest, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), }; }; const serializeAws_json1_1DeleteHsmRequest = (input: DeleteHsmRequest, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.EniId !== undefined && { EniId: input.EniId }), - ...(input.EniIp !== undefined && { EniIp: input.EniIp }), - ...(input.HsmId !== undefined && { HsmId: input.HsmId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.EniId !== undefined && input.EniId !== null && { EniId: input.EniId }), + ...(input.EniIp !== undefined && input.EniIp !== null && { EniIp: input.EniIp }), + ...(input.HsmId !== undefined && input.HsmId !== null && { HsmId: input.HsmId }), }; }; const serializeAws_json1_1DescribeBackupsRequest = (input: DescribeBackupsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortAscending !== undefined && { SortAscending: input.SortAscending }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortAscending !== undefined && input.SortAscending !== null && { SortAscending: input.SortAscending }), }; }; const serializeAws_json1_1DescribeClustersRequest = (input: DescribeClustersRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1Filters = (input: { [key: string]: string[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1Strings(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1InitializeClusterRequest = ( @@ -1808,17 +1804,17 @@ const serializeAws_json1_1InitializeClusterRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.SignedCert !== undefined && { SignedCert: input.SignedCert }), - ...(input.TrustAnchor !== undefined && { TrustAnchor: input.TrustAnchor }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.SignedCert !== undefined && input.SignedCert !== null && { SignedCert: input.SignedCert }), + ...(input.TrustAnchor !== undefined && input.TrustAnchor !== null && { TrustAnchor: input.TrustAnchor }), }; }; const serializeAws_json1_1ListTagsRequest = (input: ListTagsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -1827,60 +1823,91 @@ const serializeAws_json1_1ModifyBackupAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), - ...(input.NeverExpires !== undefined && { NeverExpires: input.NeverExpires }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), + ...(input.NeverExpires !== undefined && input.NeverExpires !== null && { NeverExpires: input.NeverExpires }), }; }; const serializeAws_json1_1ModifyClusterRequest = (input: ModifyClusterRequest, context: __SerdeContext): any => { return { - ...(input.BackupRetentionPolicy !== undefined && { - BackupRetentionPolicy: serializeAws_json1_1BackupRetentionPolicy(input.BackupRetentionPolicy, context), - }), - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.BackupRetentionPolicy !== undefined && + input.BackupRetentionPolicy !== null && { + BackupRetentionPolicy: serializeAws_json1_1BackupRetentionPolicy(input.BackupRetentionPolicy, context), + }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), }; }; const serializeAws_json1_1RestoreBackupRequest = (input: RestoreBackupRequest, context: __SerdeContext): any => { return { - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), }; }; const serializeAws_json1_1Strings = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagList !== undefined && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagList !== undefined && + input.TagList !== null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagKeyList !== undefined && { TagKeyList: serializeAws_json1_1TagKeyList(input.TagKeyList, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagKeyList !== undefined && + input.TagKeyList !== null && { TagKeyList: serializeAws_json1_1TagKeyList(input.TagKeyList, context) }), }; }; @@ -1921,7 +1948,14 @@ const deserializeAws_json1_1BackupRetentionPolicy = (output: any, context: __Ser }; const deserializeAws_json1_1Backups = (output: any, context: __SerdeContext): Backup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Backup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Backup(entry, context); + }); }; const deserializeAws_json1_1Certificates = (output: any, context: __SerdeContext): Certificates => { @@ -2035,7 +2069,14 @@ const deserializeAws_json1_1Cluster = (output: any, context: __SerdeContext): Cl }; const deserializeAws_json1_1Clusters = (output: any, context: __SerdeContext): Cluster[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Cluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Cluster(entry, context); + }); }; const deserializeAws_json1_1CopyBackupToRegionResponse = ( @@ -2132,13 +2173,15 @@ const deserializeAws_json1_1ExternalSubnetMapping = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Hsm = (output: any, context: __SerdeContext): Hsm => { @@ -2156,7 +2199,14 @@ const deserializeAws_json1_1Hsm = (output: any, context: __SerdeContext): Hsm => }; const deserializeAws_json1_1Hsms = (output: any, context: __SerdeContext): Hsm[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Hsm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Hsm(entry, context); + }); }; const deserializeAws_json1_1InitializeClusterResponse = ( @@ -2217,7 +2267,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -2278,3 +2335,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-cloudhsm/protocols/Aws_json1_1.ts b/clients/client-cloudhsm/protocols/Aws_json1_1.ts index 3e072bc76135..a4ea6630d5d9 100644 --- a/clients/client-cloudhsm/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm/protocols/Aws_json1_1.ts @@ -85,7 +85,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.AddTagsToResource", }; let body: any; @@ -98,7 +98,7 @@ export const serializeAws_json1_1CreateHapgCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.CreateHapg", }; let body: any; @@ -111,7 +111,7 @@ export const serializeAws_json1_1CreateHsmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.CreateHsm", }; let body: any; @@ -124,7 +124,7 @@ export const serializeAws_json1_1CreateLunaClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.CreateLunaClient", }; let body: any; @@ -137,7 +137,7 @@ export const serializeAws_json1_1DeleteHapgCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.DeleteHapg", }; let body: any; @@ -150,7 +150,7 @@ export const serializeAws_json1_1DeleteHsmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.DeleteHsm", }; let body: any; @@ -163,7 +163,7 @@ export const serializeAws_json1_1DeleteLunaClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.DeleteLunaClient", }; let body: any; @@ -176,7 +176,7 @@ export const serializeAws_json1_1DescribeHapgCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.DescribeHapg", }; let body: any; @@ -189,7 +189,7 @@ export const serializeAws_json1_1DescribeHsmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.DescribeHsm", }; let body: any; @@ -202,7 +202,7 @@ export const serializeAws_json1_1DescribeLunaClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.DescribeLunaClient", }; let body: any; @@ -215,7 +215,7 @@ export const serializeAws_json1_1GetConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.GetConfig", }; let body: any; @@ -228,7 +228,7 @@ export const serializeAws_json1_1ListAvailableZonesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.ListAvailableZones", }; let body: any; @@ -241,7 +241,7 @@ export const serializeAws_json1_1ListHapgsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.ListHapgs", }; let body: any; @@ -254,7 +254,7 @@ export const serializeAws_json1_1ListHsmsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.ListHsms", }; let body: any; @@ -267,7 +267,7 @@ export const serializeAws_json1_1ListLunaClientsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.ListLunaClients", }; let body: any; @@ -280,7 +280,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.ListTagsForResource", }; let body: any; @@ -293,7 +293,7 @@ export const serializeAws_json1_1ModifyHapgCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.ModifyHapg", }; let body: any; @@ -306,7 +306,7 @@ export const serializeAws_json1_1ModifyHsmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.ModifyHsm", }; let body: any; @@ -319,7 +319,7 @@ export const serializeAws_json1_1ModifyLunaClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.ModifyLunaClient", }; let body: any; @@ -332,7 +332,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudHsmFrontendService.RemoveTagsFromResource", }; let body: any; @@ -367,8 +367,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -438,8 +437,7 @@ const deserializeAws_json1_1CreateHapgCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -509,8 +507,7 @@ const deserializeAws_json1_1CreateHsmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -580,8 +577,7 @@ const deserializeAws_json1_1CreateLunaClientCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -651,8 +647,7 @@ const deserializeAws_json1_1DeleteHapgCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -722,8 +717,7 @@ const deserializeAws_json1_1DeleteHsmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -793,8 +787,7 @@ const deserializeAws_json1_1DeleteLunaClientCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -864,8 +857,7 @@ const deserializeAws_json1_1DescribeHapgCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -935,8 +927,7 @@ const deserializeAws_json1_1DescribeHsmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1006,8 +997,7 @@ const deserializeAws_json1_1DescribeLunaClientCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1077,8 +1067,7 @@ const deserializeAws_json1_1GetConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1148,8 +1137,7 @@ const deserializeAws_json1_1ListAvailableZonesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1219,8 +1207,7 @@ const deserializeAws_json1_1ListHapgsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1290,8 +1277,7 @@ const deserializeAws_json1_1ListHsmsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1361,8 +1347,7 @@ const deserializeAws_json1_1ListLunaClientsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1432,8 +1417,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1503,8 +1487,7 @@ const deserializeAws_json1_1ModifyHapgCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1574,8 +1557,7 @@ const deserializeAws_json1_1ModifyHsmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1645,8 +1627,7 @@ const deserializeAws_json1_1ModifyLunaClientCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmServiceException": case "com.amazonaws.cloudhsm#CloudHsmServiceException": @@ -1700,8 +1681,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmInternalException": case "com.amazonaws.cloudhsm#CloudHsmInternalException": @@ -1794,65 +1774,68 @@ const serializeAws_json1_1AddTagsToResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagList !== undefined && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagList !== undefined && + input.TagList !== null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), }; }; const serializeAws_json1_1CreateHapgRequest = (input: CreateHapgRequest, context: __SerdeContext): any => { return { - ...(input.Label !== undefined && { Label: input.Label }), + ...(input.Label !== undefined && input.Label !== null && { Label: input.Label }), }; }; const serializeAws_json1_1CreateHsmRequest = (input: CreateHsmRequest, context: __SerdeContext): any => { return { - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.EniIp !== undefined && { EniIp: input.EniIp }), - ...(input.ExternalId !== undefined && { ExternalId: input.ExternalId }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.SshKey !== undefined && { SshKey: input.SshKey }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), - ...(input.SubscriptionType !== undefined && { SubscriptionType: input.SubscriptionType }), - ...(input.SyslogIp !== undefined && { SyslogIp: input.SyslogIp }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.EniIp !== undefined && input.EniIp !== null && { EniIp: input.EniIp }), + ...(input.ExternalId !== undefined && input.ExternalId !== null && { ExternalId: input.ExternalId }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.SshKey !== undefined && input.SshKey !== null && { SshKey: input.SshKey }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), + ...(input.SubscriptionType !== undefined && + input.SubscriptionType !== null && { SubscriptionType: input.SubscriptionType }), + ...(input.SyslogIp !== undefined && input.SyslogIp !== null && { SyslogIp: input.SyslogIp }), }; }; const serializeAws_json1_1CreateLunaClientRequest = (input: CreateLunaClientRequest, context: __SerdeContext): any => { return { - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.Label !== undefined && { Label: input.Label }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.Label !== undefined && input.Label !== null && { Label: input.Label }), }; }; const serializeAws_json1_1DeleteHapgRequest = (input: DeleteHapgRequest, context: __SerdeContext): any => { return { - ...(input.HapgArn !== undefined && { HapgArn: input.HapgArn }), + ...(input.HapgArn !== undefined && input.HapgArn !== null && { HapgArn: input.HapgArn }), }; }; const serializeAws_json1_1DeleteHsmRequest = (input: DeleteHsmRequest, context: __SerdeContext): any => { return { - ...(input.HsmArn !== undefined && { HsmArn: input.HsmArn }), + ...(input.HsmArn !== undefined && input.HsmArn !== null && { HsmArn: input.HsmArn }), }; }; const serializeAws_json1_1DeleteLunaClientRequest = (input: DeleteLunaClientRequest, context: __SerdeContext): any => { return { - ...(input.ClientArn !== undefined && { ClientArn: input.ClientArn }), + ...(input.ClientArn !== undefined && input.ClientArn !== null && { ClientArn: input.ClientArn }), }; }; const serializeAws_json1_1DescribeHapgRequest = (input: DescribeHapgRequest, context: __SerdeContext): any => { return { - ...(input.HapgArn !== undefined && { HapgArn: input.HapgArn }), + ...(input.HapgArn !== undefined && input.HapgArn !== null && { HapgArn: input.HapgArn }), }; }; const serializeAws_json1_1DescribeHsmRequest = (input: DescribeHsmRequest, context: __SerdeContext): any => { return { - ...(input.HsmArn !== undefined && { HsmArn: input.HsmArn }), - ...(input.HsmSerialNumber !== undefined && { HsmSerialNumber: input.HsmSerialNumber }), + ...(input.HsmArn !== undefined && input.HsmArn !== null && { HsmArn: input.HsmArn }), + ...(input.HsmSerialNumber !== undefined && + input.HsmSerialNumber !== null && { HsmSerialNumber: input.HsmSerialNumber }), }; }; @@ -1861,21 +1844,30 @@ const serializeAws_json1_1DescribeLunaClientRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateFingerprint !== undefined && { CertificateFingerprint: input.CertificateFingerprint }), - ...(input.ClientArn !== undefined && { ClientArn: input.ClientArn }), + ...(input.CertificateFingerprint !== undefined && + input.CertificateFingerprint !== null && { CertificateFingerprint: input.CertificateFingerprint }), + ...(input.ClientArn !== undefined && input.ClientArn !== null && { ClientArn: input.ClientArn }), }; }; const serializeAws_json1_1GetConfigRequest = (input: GetConfigRequest, context: __SerdeContext): any => { return { - ...(input.ClientArn !== undefined && { ClientArn: input.ClientArn }), - ...(input.ClientVersion !== undefined && { ClientVersion: input.ClientVersion }), - ...(input.HapgList !== undefined && { HapgList: serializeAws_json1_1HapgList(input.HapgList, context) }), + ...(input.ClientArn !== undefined && input.ClientArn !== null && { ClientArn: input.ClientArn }), + ...(input.ClientVersion !== undefined && input.ClientVersion !== null && { ClientVersion: input.ClientVersion }), + ...(input.HapgList !== undefined && + input.HapgList !== null && { HapgList: serializeAws_json1_1HapgList(input.HapgList, context) }), }; }; const serializeAws_json1_1HapgList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListAvailableZonesRequest = ( @@ -1887,19 +1879,19 @@ const serializeAws_json1_1ListAvailableZonesRequest = ( const serializeAws_json1_1ListHapgsRequest = (input: ListHapgsRequest, context: __SerdeContext): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListHsmsRequest = (input: ListHsmsRequest, context: __SerdeContext): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListLunaClientsRequest = (input: ListLunaClientsRequest, context: __SerdeContext): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -1908,40 +1900,48 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1ModifyHapgRequest = (input: ModifyHapgRequest, context: __SerdeContext): any => { return { - ...(input.HapgArn !== undefined && { HapgArn: input.HapgArn }), - ...(input.Label !== undefined && { Label: input.Label }), - ...(input.PartitionSerialList !== undefined && { - PartitionSerialList: serializeAws_json1_1PartitionSerialList(input.PartitionSerialList, context), - }), + ...(input.HapgArn !== undefined && input.HapgArn !== null && { HapgArn: input.HapgArn }), + ...(input.Label !== undefined && input.Label !== null && { Label: input.Label }), + ...(input.PartitionSerialList !== undefined && + input.PartitionSerialList !== null && { + PartitionSerialList: serializeAws_json1_1PartitionSerialList(input.PartitionSerialList, context), + }), }; }; const serializeAws_json1_1ModifyHsmRequest = (input: ModifyHsmRequest, context: __SerdeContext): any => { return { - ...(input.EniIp !== undefined && { EniIp: input.EniIp }), - ...(input.ExternalId !== undefined && { ExternalId: input.ExternalId }), - ...(input.HsmArn !== undefined && { HsmArn: input.HsmArn }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), - ...(input.SyslogIp !== undefined && { SyslogIp: input.SyslogIp }), + ...(input.EniIp !== undefined && input.EniIp !== null && { EniIp: input.EniIp }), + ...(input.ExternalId !== undefined && input.ExternalId !== null && { ExternalId: input.ExternalId }), + ...(input.HsmArn !== undefined && input.HsmArn !== null && { HsmArn: input.HsmArn }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), + ...(input.SyslogIp !== undefined && input.SyslogIp !== null && { SyslogIp: input.SyslogIp }), }; }; const serializeAws_json1_1ModifyLunaClientRequest = (input: ModifyLunaClientRequest, context: __SerdeContext): any => { return { - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.ClientArn !== undefined && { ClientArn: input.ClientArn }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.ClientArn !== undefined && input.ClientArn !== null && { ClientArn: input.ClientArn }), }; }; const serializeAws_json1_1PartitionSerialList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RemoveTagsFromResourceRequest = ( @@ -1949,24 +1949,39 @@ const serializeAws_json1_1RemoveTagsFromResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeyList !== undefined && { TagKeyList: serializeAws_json1_1TagKeyList(input.TagKeyList, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeyList !== undefined && + input.TagKeyList !== null && { TagKeyList: serializeAws_json1_1TagKeyList(input.TagKeyList, context) }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1AddTagsToResourceResponse = ( @@ -1979,11 +1994,25 @@ const deserializeAws_json1_1AddTagsToResourceResponse = ( }; const deserializeAws_json1_1AZList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ClientList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CloudHsmInternalException = ( @@ -2151,11 +2180,25 @@ const deserializeAws_json1_1GetConfigResponse = (output: any, context: __SerdeCo }; const deserializeAws_json1_1HapgList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1HsmList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InvalidRequestException = ( @@ -2247,11 +2290,25 @@ const deserializeAws_json1_1ModifyLunaClientResponse = ( }; const deserializeAws_json1_1PartitionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PartitionSerialList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RemoveTagsFromResourceResponse = ( @@ -2271,7 +2328,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2324,3 +2388,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-cloudsearch-domain/protocols/Aws_restJson1.ts b/clients/client-cloudsearch-domain/protocols/Aws_restJson1.ts index 5b08bdab65e3..963d40e017b3 100644 --- a/clients/client-cloudsearch-domain/protocols/Aws_restJson1.ts +++ b/clients/client-cloudsearch-domain/protocols/Aws_restJson1.ts @@ -31,9 +31,7 @@ export const serializeAws_restJson1SearchCommand = async ( input: SearchCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-01-01/search"; const query: any = { format: "sdk", @@ -71,9 +69,7 @@ export const serializeAws_restJson1SuggestCommand = async ( input: SuggestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-01-01/suggest"; const query: any = { format: "sdk", @@ -101,7 +97,7 @@ export const serializeAws_restJson1UploadDocumentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.contentType) && { "Content-Type": input.contentType! }), }; let resolvedPath = "/2013-01-01/documents/batch"; @@ -373,7 +369,14 @@ const deserializeAws_restJson1BucketInfo = (output: any, context: __SerdeContext }; const deserializeAws_restJson1BucketList = (output: any, context: __SerdeContext): Bucket[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Bucket(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Bucket(entry, context); + }); }; const deserializeAws_restJson1DocumentServiceWarning = ( @@ -389,37 +392,50 @@ const deserializeAws_restJson1DocumentServiceWarnings = ( output: any, context: __SerdeContext ): DocumentServiceWarning[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DocumentServiceWarning(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DocumentServiceWarning(entry, context); + }); }; const deserializeAws_restJson1Exprs = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Facets = (output: any, context: __SerdeContext): { [key: string]: BucketInfo } => { - return Object.entries(output).reduce( - (acc: { [key: string]: BucketInfo }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: BucketInfo }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1BucketInfo(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Fields = (output: any, context: __SerdeContext): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1FieldValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1FieldStats = (output: any, context: __SerdeContext): FieldStats => { @@ -436,17 +452,26 @@ const deserializeAws_restJson1FieldStats = (output: any, context: __SerdeContext }; const deserializeAws_restJson1FieldValue = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Highlights = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Hit = (output: any, context: __SerdeContext): Hit => { @@ -468,7 +493,14 @@ const deserializeAws_restJson1Hit = (output: any, context: __SerdeContext): Hit }; const deserializeAws_restJson1HitList = (output: any, context: __SerdeContext): Hit[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Hit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Hit(entry, context); + }); }; const deserializeAws_restJson1Hits = (output: any, context: __SerdeContext): Hits => { @@ -491,13 +523,15 @@ const deserializeAws_restJson1SearchStatus = (output: any, context: __SerdeConte }; const deserializeAws_restJson1Stats = (output: any, context: __SerdeContext): { [key: string]: FieldStats } => { - return Object.entries(output).reduce( - (acc: { [key: string]: FieldStats }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: FieldStats }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1FieldStats(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1SuggestionMatch = (output: any, context: __SerdeContext): SuggestionMatch => { @@ -509,7 +543,14 @@ const deserializeAws_restJson1SuggestionMatch = (output: any, context: __SerdeCo }; const deserializeAws_restJson1Suggestions = (output: any, context: __SerdeContext): SuggestionMatch[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SuggestionMatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SuggestionMatch(entry, context); + }); }; const deserializeAws_restJson1SuggestModel = (output: any, context: __SerdeContext): SuggestModel => { @@ -550,6 +591,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-cloudsearch/protocols/Aws_query.ts b/clients/client-cloudsearch/protocols/Aws_query.ts index 2ad5093c3043..97882381d579 100644 --- a/clients/client-cloudsearch/protocols/Aws_query.ts +++ b/clients/client-cloudsearch/protocols/Aws_query.ts @@ -175,7 +175,7 @@ export const serializeAws_queryBuildSuggestersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -191,7 +191,7 @@ export const serializeAws_queryCreateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -207,7 +207,7 @@ export const serializeAws_queryDefineAnalysisSchemeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -223,7 +223,7 @@ export const serializeAws_queryDefineExpressionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -239,7 +239,7 @@ export const serializeAws_queryDefineIndexFieldCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -255,7 +255,7 @@ export const serializeAws_queryDefineSuggesterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -271,7 +271,7 @@ export const serializeAws_queryDeleteAnalysisSchemeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -287,7 +287,7 @@ export const serializeAws_queryDeleteDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -303,7 +303,7 @@ export const serializeAws_queryDeleteExpressionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -319,7 +319,7 @@ export const serializeAws_queryDeleteIndexFieldCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -335,7 +335,7 @@ export const serializeAws_queryDeleteSuggesterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -351,7 +351,7 @@ export const serializeAws_queryDescribeAnalysisSchemesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -367,7 +367,7 @@ export const serializeAws_queryDescribeAvailabilityOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -383,7 +383,7 @@ export const serializeAws_queryDescribeDomainEndpointOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -399,7 +399,7 @@ export const serializeAws_queryDescribeDomainsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -415,7 +415,7 @@ export const serializeAws_queryDescribeExpressionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -431,7 +431,7 @@ export const serializeAws_queryDescribeIndexFieldsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -447,7 +447,7 @@ export const serializeAws_queryDescribeScalingParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -463,7 +463,7 @@ export const serializeAws_queryDescribeServiceAccessPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -479,7 +479,7 @@ export const serializeAws_queryDescribeSuggestersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -495,7 +495,7 @@ export const serializeAws_queryIndexDocumentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -511,7 +511,7 @@ export const serializeAws_queryListDomainNamesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "ListDomainNames", @@ -525,7 +525,7 @@ export const serializeAws_queryUpdateAvailabilityOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -541,7 +541,7 @@ export const serializeAws_queryUpdateDomainEndpointOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -557,7 +557,7 @@ export const serializeAws_queryUpdateScalingParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -573,7 +573,7 @@ export const serializeAws_queryUpdateServiceAccessPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2717,19 +2717,19 @@ const deserializeAws_queryValidationExceptionResponse = async ( const serializeAws_queryAnalysisOptions = (input: AnalysisOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.Stopwords !== undefined) { + if (input.Stopwords !== undefined && input.Stopwords !== null) { entries["Stopwords"] = input.Stopwords; } - if (input.JapaneseTokenizationDictionary !== undefined) { + if (input.JapaneseTokenizationDictionary !== undefined && input.JapaneseTokenizationDictionary !== null) { entries["JapaneseTokenizationDictionary"] = input.JapaneseTokenizationDictionary; } - if (input.Synonyms !== undefined) { + if (input.Synonyms !== undefined && input.Synonyms !== null) { entries["Synonyms"] = input.Synonyms; } - if (input.AlgorithmicStemming !== undefined) { + if (input.AlgorithmicStemming !== undefined && input.AlgorithmicStemming !== null) { entries["AlgorithmicStemming"] = input.AlgorithmicStemming; } - if (input.StemmingDictionary !== undefined) { + if (input.StemmingDictionary !== undefined && input.StemmingDictionary !== null) { entries["StemmingDictionary"] = input.StemmingDictionary; } return entries; @@ -2737,13 +2737,13 @@ const serializeAws_queryAnalysisOptions = (input: AnalysisOptions, context: __Se const serializeAws_queryAnalysisScheme = (input: AnalysisScheme, context: __SerdeContext): any => { const entries: any = {}; - if (input.AnalysisSchemeLanguage !== undefined) { + if (input.AnalysisSchemeLanguage !== undefined && input.AnalysisSchemeLanguage !== null) { entries["AnalysisSchemeLanguage"] = input.AnalysisSchemeLanguage; } - if (input.AnalysisSchemeName !== undefined) { + if (input.AnalysisSchemeName !== undefined && input.AnalysisSchemeName !== null) { entries["AnalysisSchemeName"] = input.AnalysisSchemeName; } - if (input.AnalysisOptions !== undefined) { + if (input.AnalysisOptions !== undefined && input.AnalysisOptions !== null) { const memberEntries = serializeAws_queryAnalysisOptions(input.AnalysisOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AnalysisOptions.${key}`; @@ -2755,7 +2755,7 @@ const serializeAws_queryAnalysisScheme = (input: AnalysisScheme, context: __Serd const serializeAws_queryBuildSuggestersRequest = (input: BuildSuggestersRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -2763,7 +2763,7 @@ const serializeAws_queryBuildSuggestersRequest = (input: BuildSuggestersRequest, const serializeAws_queryCreateDomainRequest = (input: CreateDomainRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -2771,19 +2771,19 @@ const serializeAws_queryCreateDomainRequest = (input: CreateDomainRequest, conte const serializeAws_queryDateArrayOptions = (input: DateArrayOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } - if (input.SearchEnabled !== undefined) { + if (input.SearchEnabled !== undefined && input.SearchEnabled !== null) { entries["SearchEnabled"] = input.SearchEnabled; } - if (input.SourceFields !== undefined) { + if (input.SourceFields !== undefined && input.SourceFields !== null) { entries["SourceFields"] = input.SourceFields; } - if (input.FacetEnabled !== undefined) { + if (input.FacetEnabled !== undefined && input.FacetEnabled !== null) { entries["FacetEnabled"] = input.FacetEnabled; } return entries; @@ -2791,22 +2791,22 @@ const serializeAws_queryDateArrayOptions = (input: DateArrayOptions, context: __ const serializeAws_queryDateOptions = (input: DateOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.SourceField !== undefined) { + if (input.SourceField !== undefined && input.SourceField !== null) { entries["SourceField"] = input.SourceField; } - if (input.SearchEnabled !== undefined) { + if (input.SearchEnabled !== undefined && input.SearchEnabled !== null) { entries["SearchEnabled"] = input.SearchEnabled; } - if (input.SortEnabled !== undefined) { + if (input.SortEnabled !== undefined && input.SortEnabled !== null) { entries["SortEnabled"] = input.SortEnabled; } - if (input.FacetEnabled !== undefined) { + if (input.FacetEnabled !== undefined && input.FacetEnabled !== null) { entries["FacetEnabled"] = input.FacetEnabled; } - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } return entries; @@ -2817,10 +2817,10 @@ const serializeAws_queryDefineAnalysisSchemeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.AnalysisScheme !== undefined) { + if (input.AnalysisScheme !== undefined && input.AnalysisScheme !== null) { const memberEntries = serializeAws_queryAnalysisScheme(input.AnalysisScheme, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AnalysisScheme.${key}`; @@ -2832,10 +2832,10 @@ const serializeAws_queryDefineAnalysisSchemeRequest = ( const serializeAws_queryDefineExpressionRequest = (input: DefineExpressionRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.Expression !== undefined) { + if (input.Expression !== undefined && input.Expression !== null) { const memberEntries = serializeAws_queryExpression(input.Expression, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Expression.${key}`; @@ -2847,10 +2847,10 @@ const serializeAws_queryDefineExpressionRequest = (input: DefineExpressionReques const serializeAws_queryDefineIndexFieldRequest = (input: DefineIndexFieldRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.IndexField !== undefined) { + if (input.IndexField !== undefined && input.IndexField !== null) { const memberEntries = serializeAws_queryIndexField(input.IndexField, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IndexField.${key}`; @@ -2862,10 +2862,10 @@ const serializeAws_queryDefineIndexFieldRequest = (input: DefineIndexFieldReques const serializeAws_queryDefineSuggesterRequest = (input: DefineSuggesterRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.Suggester !== undefined) { + if (input.Suggester !== undefined && input.Suggester !== null) { const memberEntries = serializeAws_querySuggester(input.Suggester, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Suggester.${key}`; @@ -2880,10 +2880,10 @@ const serializeAws_queryDeleteAnalysisSchemeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.AnalysisSchemeName !== undefined) { + if (input.AnalysisSchemeName !== undefined && input.AnalysisSchemeName !== null) { entries["AnalysisSchemeName"] = input.AnalysisSchemeName; } return entries; @@ -2891,7 +2891,7 @@ const serializeAws_queryDeleteAnalysisSchemeRequest = ( const serializeAws_queryDeleteDomainRequest = (input: DeleteDomainRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -2899,10 +2899,10 @@ const serializeAws_queryDeleteDomainRequest = (input: DeleteDomainRequest, conte const serializeAws_queryDeleteExpressionRequest = (input: DeleteExpressionRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ExpressionName !== undefined) { + if (input.ExpressionName !== undefined && input.ExpressionName !== null) { entries["ExpressionName"] = input.ExpressionName; } - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -2910,10 +2910,10 @@ const serializeAws_queryDeleteExpressionRequest = (input: DeleteExpressionReques const serializeAws_queryDeleteIndexFieldRequest = (input: DeleteIndexFieldRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.IndexFieldName !== undefined) { + if (input.IndexFieldName !== undefined && input.IndexFieldName !== null) { entries["IndexFieldName"] = input.IndexFieldName; } return entries; @@ -2921,10 +2921,10 @@ const serializeAws_queryDeleteIndexFieldRequest = (input: DeleteIndexFieldReques const serializeAws_queryDeleteSuggesterRequest = (input: DeleteSuggesterRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.SuggesterName !== undefined) { + if (input.SuggesterName !== undefined && input.SuggesterName !== null) { entries["SuggesterName"] = input.SuggesterName; } - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -2935,17 +2935,17 @@ const serializeAws_queryDescribeAnalysisSchemesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.AnalysisSchemeNames !== undefined) { + if (input.AnalysisSchemeNames !== undefined && input.AnalysisSchemeNames !== null) { const memberEntries = serializeAws_queryStandardNameList(input.AnalysisSchemeNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AnalysisSchemeNames.${key}`; entries[loc] = value; }); } - if (input.Deployed !== undefined) { + if (input.Deployed !== undefined && input.Deployed !== null) { entries["Deployed"] = input.Deployed; } return entries; @@ -2956,10 +2956,10 @@ const serializeAws_queryDescribeAvailabilityOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.Deployed !== undefined) { + if (input.Deployed !== undefined && input.Deployed !== null) { entries["Deployed"] = input.Deployed; } return entries; @@ -2970,10 +2970,10 @@ const serializeAws_queryDescribeDomainEndpointOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.Deployed !== undefined) { + if (input.Deployed !== undefined && input.Deployed !== null) { entries["Deployed"] = input.Deployed; } return entries; @@ -2981,7 +2981,7 @@ const serializeAws_queryDescribeDomainEndpointOptionsRequest = ( const serializeAws_queryDescribeDomainsRequest = (input: DescribeDomainsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DomainNames !== undefined) { + if (input.DomainNames !== undefined && input.DomainNames !== null) { const memberEntries = serializeAws_queryDomainNameList(input.DomainNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DomainNames.${key}`; @@ -2996,17 +2996,17 @@ const serializeAws_queryDescribeExpressionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.ExpressionNames !== undefined) { + if (input.ExpressionNames !== undefined && input.ExpressionNames !== null) { const memberEntries = serializeAws_queryStandardNameList(input.ExpressionNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExpressionNames.${key}`; entries[loc] = value; }); } - if (input.Deployed !== undefined) { + if (input.Deployed !== undefined && input.Deployed !== null) { entries["Deployed"] = input.Deployed; } return entries; @@ -3017,17 +3017,17 @@ const serializeAws_queryDescribeIndexFieldsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.FieldNames !== undefined) { + if (input.FieldNames !== undefined && input.FieldNames !== null) { const memberEntries = serializeAws_queryDynamicFieldNameList(input.FieldNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FieldNames.${key}`; entries[loc] = value; }); } - if (input.Deployed !== undefined) { + if (input.Deployed !== undefined && input.Deployed !== null) { entries["Deployed"] = input.Deployed; } - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -3038,7 +3038,7 @@ const serializeAws_queryDescribeScalingParametersRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -3049,10 +3049,10 @@ const serializeAws_queryDescribeServiceAccessPoliciesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.Deployed !== undefined) { + if (input.Deployed !== undefined && input.Deployed !== null) { entries["Deployed"] = input.Deployed; } return entries; @@ -3063,13 +3063,13 @@ const serializeAws_queryDescribeSuggestersRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.Deployed !== undefined) { + if (input.Deployed !== undefined && input.Deployed !== null) { entries["Deployed"] = input.Deployed; } - if (input.SuggesterNames !== undefined) { + if (input.SuggesterNames !== undefined && input.SuggesterNames !== null) { const memberEntries = serializeAws_queryStandardNameList(input.SuggesterNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SuggesterNames.${key}`; @@ -3081,13 +3081,13 @@ const serializeAws_queryDescribeSuggestersRequest = ( const serializeAws_queryDocumentSuggesterOptions = (input: DocumentSuggesterOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.SourceField !== undefined) { + if (input.SourceField !== undefined && input.SourceField !== null) { entries["SourceField"] = input.SourceField; } - if (input.SortExpression !== undefined) { + if (input.SortExpression !== undefined && input.SortExpression !== null) { entries["SortExpression"] = input.SortExpression; } - if (input.FuzzyMatching !== undefined) { + if (input.FuzzyMatching !== undefined && input.FuzzyMatching !== null) { entries["FuzzyMatching"] = input.FuzzyMatching; } return entries; @@ -3095,10 +3095,10 @@ const serializeAws_queryDocumentSuggesterOptions = (input: DocumentSuggesterOpti const serializeAws_queryDomainEndpointOptions = (input: DomainEndpointOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.TLSSecurityPolicy !== undefined) { + if (input.TLSSecurityPolicy !== undefined && input.TLSSecurityPolicy !== null) { entries["TLSSecurityPolicy"] = input.TLSSecurityPolicy; } - if (input.EnforceHTTPS !== undefined) { + if (input.EnforceHTTPS !== undefined && input.EnforceHTTPS !== null) { entries["EnforceHTTPS"] = input.EnforceHTTPS; } return entries; @@ -3108,6 +3108,9 @@ const serializeAws_queryDomainNameList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3116,19 +3119,19 @@ const serializeAws_queryDomainNameList = (input: string[], context: __SerdeConte const serializeAws_queryDoubleArrayOptions = (input: DoubleArrayOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.FacetEnabled !== undefined) { + if (input.FacetEnabled !== undefined && input.FacetEnabled !== null) { entries["FacetEnabled"] = input.FacetEnabled; } - if (input.SearchEnabled !== undefined) { + if (input.SearchEnabled !== undefined && input.SearchEnabled !== null) { entries["SearchEnabled"] = input.SearchEnabled; } - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } - if (input.SourceFields !== undefined) { + if (input.SourceFields !== undefined && input.SourceFields !== null) { entries["SourceFields"] = input.SourceFields; } return entries; @@ -3136,22 +3139,22 @@ const serializeAws_queryDoubleArrayOptions = (input: DoubleArrayOptions, context const serializeAws_queryDoubleOptions = (input: DoubleOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.SearchEnabled !== undefined) { + if (input.SearchEnabled !== undefined && input.SearchEnabled !== null) { entries["SearchEnabled"] = input.SearchEnabled; } - if (input.SourceField !== undefined) { + if (input.SourceField !== undefined && input.SourceField !== null) { entries["SourceField"] = input.SourceField; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } - if (input.SortEnabled !== undefined) { + if (input.SortEnabled !== undefined && input.SortEnabled !== null) { entries["SortEnabled"] = input.SortEnabled; } - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.FacetEnabled !== undefined) { + if (input.FacetEnabled !== undefined && input.FacetEnabled !== null) { entries["FacetEnabled"] = input.FacetEnabled; } return entries; @@ -3161,6 +3164,9 @@ const serializeAws_queryDynamicFieldNameList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3169,10 +3175,10 @@ const serializeAws_queryDynamicFieldNameList = (input: string[], context: __Serd const serializeAws_queryExpression = (input: Expression, context: __SerdeContext): any => { const entries: any = {}; - if (input.ExpressionValue !== undefined) { + if (input.ExpressionValue !== undefined && input.ExpressionValue !== null) { entries["ExpressionValue"] = input.ExpressionValue; } - if (input.ExpressionName !== undefined) { + if (input.ExpressionName !== undefined && input.ExpressionName !== null) { entries["ExpressionName"] = input.ExpressionName; } return entries; @@ -3180,7 +3186,7 @@ const serializeAws_queryExpression = (input: Expression, context: __SerdeContext const serializeAws_queryIndexDocumentsRequest = (input: IndexDocumentsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -3188,83 +3194,83 @@ const serializeAws_queryIndexDocumentsRequest = (input: IndexDocumentsRequest, c const serializeAws_queryIndexField = (input: IndexField, context: __SerdeContext): any => { const entries: any = {}; - if (input.IndexFieldType !== undefined) { + if (input.IndexFieldType !== undefined && input.IndexFieldType !== null) { entries["IndexFieldType"] = input.IndexFieldType; } - if (input.IntOptions !== undefined) { + if (input.IntOptions !== undefined && input.IntOptions !== null) { const memberEntries = serializeAws_queryIntOptions(input.IntOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IntOptions.${key}`; entries[loc] = value; }); } - if (input.IntArrayOptions !== undefined) { + if (input.IntArrayOptions !== undefined && input.IntArrayOptions !== null) { const memberEntries = serializeAws_queryIntArrayOptions(input.IntArrayOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IntArrayOptions.${key}`; entries[loc] = value; }); } - if (input.TextOptions !== undefined) { + if (input.TextOptions !== undefined && input.TextOptions !== null) { const memberEntries = serializeAws_queryTextOptions(input.TextOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TextOptions.${key}`; entries[loc] = value; }); } - if (input.TextArrayOptions !== undefined) { + if (input.TextArrayOptions !== undefined && input.TextArrayOptions !== null) { const memberEntries = serializeAws_queryTextArrayOptions(input.TextArrayOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TextArrayOptions.${key}`; entries[loc] = value; }); } - if (input.DateOptions !== undefined) { + if (input.DateOptions !== undefined && input.DateOptions !== null) { const memberEntries = serializeAws_queryDateOptions(input.DateOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DateOptions.${key}`; entries[loc] = value; }); } - if (input.DoubleOptions !== undefined) { + if (input.DoubleOptions !== undefined && input.DoubleOptions !== null) { const memberEntries = serializeAws_queryDoubleOptions(input.DoubleOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DoubleOptions.${key}`; entries[loc] = value; }); } - if (input.LatLonOptions !== undefined) { + if (input.LatLonOptions !== undefined && input.LatLonOptions !== null) { const memberEntries = serializeAws_queryLatLonOptions(input.LatLonOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LatLonOptions.${key}`; entries[loc] = value; }); } - if (input.IndexFieldName !== undefined) { + if (input.IndexFieldName !== undefined && input.IndexFieldName !== null) { entries["IndexFieldName"] = input.IndexFieldName; } - if (input.DoubleArrayOptions !== undefined) { + if (input.DoubleArrayOptions !== undefined && input.DoubleArrayOptions !== null) { const memberEntries = serializeAws_queryDoubleArrayOptions(input.DoubleArrayOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DoubleArrayOptions.${key}`; entries[loc] = value; }); } - if (input.LiteralOptions !== undefined) { + if (input.LiteralOptions !== undefined && input.LiteralOptions !== null) { const memberEntries = serializeAws_queryLiteralOptions(input.LiteralOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LiteralOptions.${key}`; entries[loc] = value; }); } - if (input.DateArrayOptions !== undefined) { + if (input.DateArrayOptions !== undefined && input.DateArrayOptions !== null) { const memberEntries = serializeAws_queryDateArrayOptions(input.DateArrayOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DateArrayOptions.${key}`; entries[loc] = value; }); } - if (input.LiteralArrayOptions !== undefined) { + if (input.LiteralArrayOptions !== undefined && input.LiteralArrayOptions !== null) { const memberEntries = serializeAws_queryLiteralArrayOptions(input.LiteralArrayOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LiteralArrayOptions.${key}`; @@ -3276,19 +3282,19 @@ const serializeAws_queryIndexField = (input: IndexField, context: __SerdeContext const serializeAws_queryIntArrayOptions = (input: IntArrayOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.SearchEnabled !== undefined) { + if (input.SearchEnabled !== undefined && input.SearchEnabled !== null) { entries["SearchEnabled"] = input.SearchEnabled; } - if (input.SourceFields !== undefined) { + if (input.SourceFields !== undefined && input.SourceFields !== null) { entries["SourceFields"] = input.SourceFields; } - if (input.FacetEnabled !== undefined) { + if (input.FacetEnabled !== undefined && input.FacetEnabled !== null) { entries["FacetEnabled"] = input.FacetEnabled; } - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } return entries; @@ -3296,22 +3302,22 @@ const serializeAws_queryIntArrayOptions = (input: IntArrayOptions, context: __Se const serializeAws_queryIntOptions = (input: IntOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.SortEnabled !== undefined) { + if (input.SortEnabled !== undefined && input.SortEnabled !== null) { entries["SortEnabled"] = input.SortEnabled; } - if (input.SourceField !== undefined) { + if (input.SourceField !== undefined && input.SourceField !== null) { entries["SourceField"] = input.SourceField; } - if (input.FacetEnabled !== undefined) { + if (input.FacetEnabled !== undefined && input.FacetEnabled !== null) { entries["FacetEnabled"] = input.FacetEnabled; } - if (input.SearchEnabled !== undefined) { + if (input.SearchEnabled !== undefined && input.SearchEnabled !== null) { entries["SearchEnabled"] = input.SearchEnabled; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } return entries; @@ -3319,22 +3325,22 @@ const serializeAws_queryIntOptions = (input: IntOptions, context: __SerdeContext const serializeAws_queryLatLonOptions = (input: LatLonOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } - if (input.SearchEnabled !== undefined) { + if (input.SearchEnabled !== undefined && input.SearchEnabled !== null) { entries["SearchEnabled"] = input.SearchEnabled; } - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.SourceField !== undefined) { + if (input.SourceField !== undefined && input.SourceField !== null) { entries["SourceField"] = input.SourceField; } - if (input.FacetEnabled !== undefined) { + if (input.FacetEnabled !== undefined && input.FacetEnabled !== null) { entries["FacetEnabled"] = input.FacetEnabled; } - if (input.SortEnabled !== undefined) { + if (input.SortEnabled !== undefined && input.SortEnabled !== null) { entries["SortEnabled"] = input.SortEnabled; } return entries; @@ -3342,19 +3348,19 @@ const serializeAws_queryLatLonOptions = (input: LatLonOptions, context: __SerdeC const serializeAws_queryLiteralArrayOptions = (input: LiteralArrayOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.SearchEnabled !== undefined) { + if (input.SearchEnabled !== undefined && input.SearchEnabled !== null) { entries["SearchEnabled"] = input.SearchEnabled; } - if (input.SourceFields !== undefined) { + if (input.SourceFields !== undefined && input.SourceFields !== null) { entries["SourceFields"] = input.SourceFields; } - if (input.FacetEnabled !== undefined) { + if (input.FacetEnabled !== undefined && input.FacetEnabled !== null) { entries["FacetEnabled"] = input.FacetEnabled; } - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } return entries; @@ -3362,22 +3368,22 @@ const serializeAws_queryLiteralArrayOptions = (input: LiteralArrayOptions, conte const serializeAws_queryLiteralOptions = (input: LiteralOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.SortEnabled !== undefined) { + if (input.SortEnabled !== undefined && input.SortEnabled !== null) { entries["SortEnabled"] = input.SortEnabled; } - if (input.FacetEnabled !== undefined) { + if (input.FacetEnabled !== undefined && input.FacetEnabled !== null) { entries["FacetEnabled"] = input.FacetEnabled; } - if (input.SourceField !== undefined) { + if (input.SourceField !== undefined && input.SourceField !== null) { entries["SourceField"] = input.SourceField; } - if (input.SearchEnabled !== undefined) { + if (input.SearchEnabled !== undefined && input.SearchEnabled !== null) { entries["SearchEnabled"] = input.SearchEnabled; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } return entries; @@ -3385,13 +3391,13 @@ const serializeAws_queryLiteralOptions = (input: LiteralOptions, context: __Serd const serializeAws_queryScalingParameters = (input: ScalingParameters, context: __SerdeContext): any => { const entries: any = {}; - if (input.DesiredReplicationCount !== undefined) { + if (input.DesiredReplicationCount !== undefined && input.DesiredReplicationCount !== null) { entries["DesiredReplicationCount"] = input.DesiredReplicationCount; } - if (input.DesiredInstanceType !== undefined) { + if (input.DesiredInstanceType !== undefined && input.DesiredInstanceType !== null) { entries["DesiredInstanceType"] = input.DesiredInstanceType; } - if (input.DesiredPartitionCount !== undefined) { + if (input.DesiredPartitionCount !== undefined && input.DesiredPartitionCount !== null) { entries["DesiredPartitionCount"] = input.DesiredPartitionCount; } return entries; @@ -3401,6 +3407,9 @@ const serializeAws_queryStandardNameList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3409,14 +3418,14 @@ const serializeAws_queryStandardNameList = (input: string[], context: __SerdeCon const serializeAws_querySuggester = (input: Suggester, context: __SerdeContext): any => { const entries: any = {}; - if (input.DocumentSuggesterOptions !== undefined) { + if (input.DocumentSuggesterOptions !== undefined && input.DocumentSuggesterOptions !== null) { const memberEntries = serializeAws_queryDocumentSuggesterOptions(input.DocumentSuggesterOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DocumentSuggesterOptions.${key}`; entries[loc] = value; }); } - if (input.SuggesterName !== undefined) { + if (input.SuggesterName !== undefined && input.SuggesterName !== null) { entries["SuggesterName"] = input.SuggesterName; } return entries; @@ -3424,19 +3433,19 @@ const serializeAws_querySuggester = (input: Suggester, context: __SerdeContext): const serializeAws_queryTextArrayOptions = (input: TextArrayOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } - if (input.HighlightEnabled !== undefined) { + if (input.HighlightEnabled !== undefined && input.HighlightEnabled !== null) { entries["HighlightEnabled"] = input.HighlightEnabled; } - if (input.AnalysisScheme !== undefined) { + if (input.AnalysisScheme !== undefined && input.AnalysisScheme !== null) { entries["AnalysisScheme"] = input.AnalysisScheme; } - if (input.SourceFields !== undefined) { + if (input.SourceFields !== undefined && input.SourceFields !== null) { entries["SourceFields"] = input.SourceFields; } return entries; @@ -3444,22 +3453,22 @@ const serializeAws_queryTextArrayOptions = (input: TextArrayOptions, context: __ const serializeAws_queryTextOptions = (input: TextOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.ReturnEnabled !== undefined) { + if (input.ReturnEnabled !== undefined && input.ReturnEnabled !== null) { entries["ReturnEnabled"] = input.ReturnEnabled; } - if (input.HighlightEnabled !== undefined) { + if (input.HighlightEnabled !== undefined && input.HighlightEnabled !== null) { entries["HighlightEnabled"] = input.HighlightEnabled; } - if (input.SourceField !== undefined) { + if (input.SourceField !== undefined && input.SourceField !== null) { entries["SourceField"] = input.SourceField; } - if (input.AnalysisScheme !== undefined) { + if (input.AnalysisScheme !== undefined && input.AnalysisScheme !== null) { entries["AnalysisScheme"] = input.AnalysisScheme; } - if (input.SortEnabled !== undefined) { + if (input.SortEnabled !== undefined && input.SortEnabled !== null) { entries["SortEnabled"] = input.SortEnabled; } return entries; @@ -3470,10 +3479,10 @@ const serializeAws_queryUpdateAvailabilityOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } return entries; @@ -3484,10 +3493,10 @@ const serializeAws_queryUpdateDomainEndpointOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } - if (input.DomainEndpointOptions !== undefined) { + if (input.DomainEndpointOptions !== undefined && input.DomainEndpointOptions !== null) { const memberEntries = serializeAws_queryDomainEndpointOptions(input.DomainEndpointOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DomainEndpointOptions.${key}`; @@ -3502,14 +3511,14 @@ const serializeAws_queryUpdateScalingParametersRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ScalingParameters !== undefined) { + if (input.ScalingParameters !== undefined && input.ScalingParameters !== null) { const memberEntries = serializeAws_queryScalingParameters(input.ScalingParameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScalingParameters.${key}`; entries[loc] = value; }); } - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -3520,10 +3529,10 @@ const serializeAws_queryUpdateServiceAccessPoliciesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AccessPolicies !== undefined) { + if (input.AccessPolicies !== undefined && input.AccessPolicies !== null) { entries["AccessPolicies"] = input.AccessPolicies; } - if (input.DomainName !== undefined) { + if (input.DomainName !== undefined && input.DomainName !== null) { entries["DomainName"] = input.DomainName; } return entries; @@ -3602,7 +3611,14 @@ const deserializeAws_queryAnalysisSchemeStatus = (output: any, context: __SerdeC }; const deserializeAws_queryAnalysisSchemeStatusList = (output: any, context: __SerdeContext): AnalysisSchemeStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryAnalysisSchemeStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAnalysisSchemeStatus(entry, context); + }); }; const deserializeAws_queryAvailabilityOptionsStatus = ( @@ -4046,13 +4062,15 @@ const deserializeAws_queryDomainEndpointOptionsStatus = ( }; const deserializeAws_queryDomainNameMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: pair["value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryDomainStatus = (output: any, context: __SerdeContext): DomainStatus => { @@ -4114,7 +4132,14 @@ const deserializeAws_queryDomainStatus = (output: any, context: __SerdeContext): }; const deserializeAws_queryDomainStatusList = (output: any, context: __SerdeContext): DomainStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryDomainStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDomainStatus(entry, context); + }); }; const deserializeAws_queryDoubleArrayOptions = (output: any, context: __SerdeContext): DoubleArrayOptions => { @@ -4202,11 +4227,25 @@ const deserializeAws_queryExpressionStatus = (output: any, context: __SerdeConte }; const deserializeAws_queryExpressionStatusList = (output: any, context: __SerdeContext): ExpressionStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryExpressionStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryExpressionStatus(entry, context); + }); }; const deserializeAws_queryFieldNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryIndexDocumentsResponse = (output: any, context: __SerdeContext): IndexDocumentsResponse => { @@ -4298,7 +4337,14 @@ const deserializeAws_queryIndexFieldStatus = (output: any, context: __SerdeConte }; const deserializeAws_queryIndexFieldStatusList = (output: any, context: __SerdeContext): IndexFieldStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryIndexFieldStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryIndexFieldStatus(entry, context); + }); }; const deserializeAws_queryIntArrayOptions = (output: any, context: __SerdeContext): IntArrayOptions => { @@ -4632,7 +4678,14 @@ const deserializeAws_querySuggesterStatus = (output: any, context: __SerdeContex }; const deserializeAws_querySuggesterStatusList = (output: any, context: __SerdeContext): SuggesterStatus[] => { - return (output || []).map((entry: any) => deserializeAws_querySuggesterStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySuggesterStatus(entry, context); + }); }; const deserializeAws_queryTextArrayOptions = (output: any, context: __SerdeContext): TextArrayOptions => { diff --git a/clients/client-cloudtrail/protocols/Aws_json1_1.ts b/clients/client-cloudtrail/protocols/Aws_json1_1.ts index 51c7dff695c7..448ec9279c4b 100644 --- a/clients/client-cloudtrail/protocols/Aws_json1_1.ts +++ b/clients/client-cloudtrail/protocols/Aws_json1_1.ts @@ -131,7 +131,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.AddTags", }; let body: any; @@ -144,7 +144,7 @@ export const serializeAws_json1_1CreateTrailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.CreateTrail", }; let body: any; @@ -157,7 +157,7 @@ export const serializeAws_json1_1DeleteTrailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.DeleteTrail", }; let body: any; @@ -170,7 +170,7 @@ export const serializeAws_json1_1DescribeTrailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.DescribeTrails", }; let body: any; @@ -183,7 +183,7 @@ export const serializeAws_json1_1GetEventSelectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.GetEventSelectors", }; let body: any; @@ -196,7 +196,7 @@ export const serializeAws_json1_1GetInsightSelectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.GetInsightSelectors", }; let body: any; @@ -209,7 +209,7 @@ export const serializeAws_json1_1GetTrailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.GetTrail", }; let body: any; @@ -222,7 +222,7 @@ export const serializeAws_json1_1GetTrailStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.GetTrailStatus", }; let body: any; @@ -235,7 +235,7 @@ export const serializeAws_json1_1ListPublicKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.ListPublicKeys", }; let body: any; @@ -248,7 +248,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.ListTags", }; let body: any; @@ -261,7 +261,7 @@ export const serializeAws_json1_1ListTrailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.ListTrails", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1LookupEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.LookupEvents", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1PutEventSelectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.PutEventSelectors", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1PutInsightSelectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.PutInsightSelectors", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1RemoveTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.RemoveTags", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1StartLoggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.StartLogging", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1StopLoggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.StopLogging", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1UpdateTrailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CloudTrail_20131101.UpdateTrail", }; let body: any; @@ -387,8 +387,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudTrailARNInvalidException": case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": @@ -506,8 +505,7 @@ const deserializeAws_json1_1CreateTrailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudTrailAccessNotEnabledException": case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": @@ -780,8 +778,7 @@ const deserializeAws_json1_1DeleteTrailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientDependencyServiceAccessPermissionException": case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": @@ -886,8 +883,7 @@ const deserializeAws_json1_1DescribeTrailsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidTrailNameException": case "com.amazonaws.cloudtrail#InvalidTrailNameException": @@ -957,8 +953,7 @@ const deserializeAws_json1_1GetEventSelectorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidTrailNameException": case "com.amazonaws.cloudtrail#InvalidTrailNameException": @@ -1036,8 +1031,7 @@ const deserializeAws_json1_1GetInsightSelectorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsightNotEnabledException": case "com.amazonaws.cloudtrail#InsightNotEnabledException": @@ -1123,8 +1117,7 @@ const deserializeAws_json1_1GetTrailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidTrailNameException": case "com.amazonaws.cloudtrail#InvalidTrailNameException": @@ -1202,8 +1195,7 @@ const deserializeAws_json1_1GetTrailStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidTrailNameException": case "com.amazonaws.cloudtrail#InvalidTrailNameException": @@ -1281,8 +1273,7 @@ const deserializeAws_json1_1ListPublicKeysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidTimeRangeException": case "com.amazonaws.cloudtrail#InvalidTimeRangeException": @@ -1360,8 +1351,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudTrailARNInvalidException": case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": @@ -1463,8 +1453,7 @@ const deserializeAws_json1_1ListTrailsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedException": case "com.amazonaws.cloudtrail#OperationNotPermittedException": @@ -1526,8 +1515,7 @@ const deserializeAws_json1_1LookupEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidEventCategoryException": case "com.amazonaws.cloudtrail#InvalidEventCategoryException": @@ -1629,8 +1617,7 @@ const deserializeAws_json1_1PutEventSelectorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientDependencyServiceAccessPermissionException": case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": @@ -1743,8 +1730,7 @@ const deserializeAws_json1_1PutInsightSelectorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientEncryptionPolicyException": case "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException": @@ -1862,8 +1848,7 @@ const deserializeAws_json1_1RemoveTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudTrailARNInvalidException": case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": @@ -1973,8 +1958,7 @@ const deserializeAws_json1_1StartLoggingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientDependencyServiceAccessPermissionException": case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": @@ -2079,8 +2063,7 @@ const deserializeAws_json1_1StopLoggingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientDependencyServiceAccessPermissionException": case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": @@ -2185,8 +2168,7 @@ const deserializeAws_json1_1UpdateTrailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudTrailAccessNotEnabledException": case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": @@ -3079,115 +3061,172 @@ const deserializeAws_json1_1UnsupportedOperationExceptionResponse = async ( const serializeAws_json1_1AddTagsRequest = (input: AddTagsRequest, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagsList !== undefined && { TagsList: serializeAws_json1_1TagsList(input.TagsList, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagsList !== undefined && + input.TagsList !== null && { TagsList: serializeAws_json1_1TagsList(input.TagsList, context) }), }; }; const serializeAws_json1_1AdvancedEventSelector = (input: AdvancedEventSelector, context: __SerdeContext): any => { return { - ...(input.FieldSelectors !== undefined && { - FieldSelectors: serializeAws_json1_1AdvancedFieldSelectors(input.FieldSelectors, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.FieldSelectors !== undefined && + input.FieldSelectors !== null && { + FieldSelectors: serializeAws_json1_1AdvancedFieldSelectors(input.FieldSelectors, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1AdvancedEventSelectors = (input: AdvancedEventSelector[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AdvancedEventSelector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AdvancedEventSelector(entry, context); + }); }; const serializeAws_json1_1AdvancedFieldSelector = (input: AdvancedFieldSelector, context: __SerdeContext): any => { return { - ...(input.EndsWith !== undefined && { EndsWith: serializeAws_json1_1Operator(input.EndsWith, context) }), - ...(input.Equals !== undefined && { Equals: serializeAws_json1_1Operator(input.Equals, context) }), - ...(input.Field !== undefined && { Field: input.Field }), - ...(input.NotEndsWith !== undefined && { NotEndsWith: serializeAws_json1_1Operator(input.NotEndsWith, context) }), - ...(input.NotEquals !== undefined && { NotEquals: serializeAws_json1_1Operator(input.NotEquals, context) }), - ...(input.NotStartsWith !== undefined && { - NotStartsWith: serializeAws_json1_1Operator(input.NotStartsWith, context), - }), - ...(input.StartsWith !== undefined && { StartsWith: serializeAws_json1_1Operator(input.StartsWith, context) }), + ...(input.EndsWith !== undefined && + input.EndsWith !== null && { EndsWith: serializeAws_json1_1Operator(input.EndsWith, context) }), + ...(input.Equals !== undefined && + input.Equals !== null && { Equals: serializeAws_json1_1Operator(input.Equals, context) }), + ...(input.Field !== undefined && input.Field !== null && { Field: input.Field }), + ...(input.NotEndsWith !== undefined && + input.NotEndsWith !== null && { NotEndsWith: serializeAws_json1_1Operator(input.NotEndsWith, context) }), + ...(input.NotEquals !== undefined && + input.NotEquals !== null && { NotEquals: serializeAws_json1_1Operator(input.NotEquals, context) }), + ...(input.NotStartsWith !== undefined && + input.NotStartsWith !== null && { NotStartsWith: serializeAws_json1_1Operator(input.NotStartsWith, context) }), + ...(input.StartsWith !== undefined && + input.StartsWith !== null && { StartsWith: serializeAws_json1_1Operator(input.StartsWith, context) }), }; }; const serializeAws_json1_1AdvancedFieldSelectors = (input: AdvancedFieldSelector[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AdvancedFieldSelector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AdvancedFieldSelector(entry, context); + }); }; const serializeAws_json1_1CreateTrailRequest = (input: CreateTrailRequest, context: __SerdeContext): any => { return { - ...(input.CloudWatchLogsLogGroupArn !== undefined && { - CloudWatchLogsLogGroupArn: input.CloudWatchLogsLogGroupArn, - }), - ...(input.CloudWatchLogsRoleArn !== undefined && { CloudWatchLogsRoleArn: input.CloudWatchLogsRoleArn }), - ...(input.EnableLogFileValidation !== undefined && { EnableLogFileValidation: input.EnableLogFileValidation }), - ...(input.IncludeGlobalServiceEvents !== undefined && { - IncludeGlobalServiceEvents: input.IncludeGlobalServiceEvents, - }), - ...(input.IsMultiRegionTrail !== undefined && { IsMultiRegionTrail: input.IsMultiRegionTrail }), - ...(input.IsOrganizationTrail !== undefined && { IsOrganizationTrail: input.IsOrganizationTrail }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.S3KeyPrefix !== undefined && { S3KeyPrefix: input.S3KeyPrefix }), - ...(input.SnsTopicName !== undefined && { SnsTopicName: input.SnsTopicName }), - ...(input.TagsList !== undefined && { TagsList: serializeAws_json1_1TagsList(input.TagsList, context) }), + ...(input.CloudWatchLogsLogGroupArn !== undefined && + input.CloudWatchLogsLogGroupArn !== null && { CloudWatchLogsLogGroupArn: input.CloudWatchLogsLogGroupArn }), + ...(input.CloudWatchLogsRoleArn !== undefined && + input.CloudWatchLogsRoleArn !== null && { CloudWatchLogsRoleArn: input.CloudWatchLogsRoleArn }), + ...(input.EnableLogFileValidation !== undefined && + input.EnableLogFileValidation !== null && { EnableLogFileValidation: input.EnableLogFileValidation }), + ...(input.IncludeGlobalServiceEvents !== undefined && + input.IncludeGlobalServiceEvents !== null && { IncludeGlobalServiceEvents: input.IncludeGlobalServiceEvents }), + ...(input.IsMultiRegionTrail !== undefined && + input.IsMultiRegionTrail !== null && { IsMultiRegionTrail: input.IsMultiRegionTrail }), + ...(input.IsOrganizationTrail !== undefined && + input.IsOrganizationTrail !== null && { IsOrganizationTrail: input.IsOrganizationTrail }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.S3KeyPrefix !== undefined && input.S3KeyPrefix !== null && { S3KeyPrefix: input.S3KeyPrefix }), + ...(input.SnsTopicName !== undefined && input.SnsTopicName !== null && { SnsTopicName: input.SnsTopicName }), + ...(input.TagsList !== undefined && + input.TagsList !== null && { TagsList: serializeAws_json1_1TagsList(input.TagsList, context) }), }; }; const serializeAws_json1_1DataResource = (input: DataResource, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1DataResourceValues(input.Values, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1DataResourceValues(input.Values, context) }), }; }; const serializeAws_json1_1DataResources = (input: DataResource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DataResource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DataResource(entry, context); + }); }; const serializeAws_json1_1DataResourceValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteTrailRequest = (input: DeleteTrailRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DescribeTrailsRequest = (input: DescribeTrailsRequest, context: __SerdeContext): any => { return { - ...(input.includeShadowTrails !== undefined && { includeShadowTrails: input.includeShadowTrails }), - ...(input.trailNameList !== undefined && { - trailNameList: serializeAws_json1_1TrailNameList(input.trailNameList, context), - }), + ...(input.includeShadowTrails !== undefined && + input.includeShadowTrails !== null && { includeShadowTrails: input.includeShadowTrails }), + ...(input.trailNameList !== undefined && + input.trailNameList !== null && { + trailNameList: serializeAws_json1_1TrailNameList(input.trailNameList, context), + }), }; }; const serializeAws_json1_1EventSelector = (input: EventSelector, context: __SerdeContext): any => { return { - ...(input.DataResources !== undefined && { - DataResources: serializeAws_json1_1DataResources(input.DataResources, context), - }), - ...(input.ExcludeManagementEventSources !== undefined && { - ExcludeManagementEventSources: serializeAws_json1_1ExcludeManagementEventSources( - input.ExcludeManagementEventSources, - context - ), - }), - ...(input.IncludeManagementEvents !== undefined && { IncludeManagementEvents: input.IncludeManagementEvents }), - ...(input.ReadWriteType !== undefined && { ReadWriteType: input.ReadWriteType }), + ...(input.DataResources !== undefined && + input.DataResources !== null && { + DataResources: serializeAws_json1_1DataResources(input.DataResources, context), + }), + ...(input.ExcludeManagementEventSources !== undefined && + input.ExcludeManagementEventSources !== null && { + ExcludeManagementEventSources: serializeAws_json1_1ExcludeManagementEventSources( + input.ExcludeManagementEventSources, + context + ), + }), + ...(input.IncludeManagementEvents !== undefined && + input.IncludeManagementEvents !== null && { IncludeManagementEvents: input.IncludeManagementEvents }), + ...(input.ReadWriteType !== undefined && input.ReadWriteType !== null && { ReadWriteType: input.ReadWriteType }), }; }; const serializeAws_json1_1EventSelectors = (input: EventSelector[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EventSelector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EventSelector(entry, context); + }); }; const serializeAws_json1_1ExcludeManagementEventSources = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetEventSelectorsRequest = ( @@ -3195,7 +3234,7 @@ const serializeAws_json1_1GetEventSelectorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.TrailName !== undefined && { TrailName: input.TrailName }), + ...(input.TrailName !== undefined && input.TrailName !== null && { TrailName: input.TrailName }), }; }; @@ -3204,81 +3243,109 @@ const serializeAws_json1_1GetInsightSelectorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.TrailName !== undefined && { TrailName: input.TrailName }), + ...(input.TrailName !== undefined && input.TrailName !== null && { TrailName: input.TrailName }), }; }; const serializeAws_json1_1GetTrailRequest = (input: GetTrailRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1GetTrailStatusRequest = (input: GetTrailStatusRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1InsightSelector = (input: InsightSelector, context: __SerdeContext): any => { return { - ...(input.InsightType !== undefined && { InsightType: input.InsightType }), + ...(input.InsightType !== undefined && input.InsightType !== null && { InsightType: input.InsightType }), }; }; const serializeAws_json1_1InsightSelectors = (input: InsightSelector[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InsightSelector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InsightSelector(entry, context); + }); }; const serializeAws_json1_1ListPublicKeysRequest = (input: ListPublicKeysRequest, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1ListTagsRequest = (input: ListTagsRequest, context: __SerdeContext): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceIdList !== undefined && { - ResourceIdList: serializeAws_json1_1ResourceIdList(input.ResourceIdList, context), - }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceIdList !== undefined && + input.ResourceIdList !== null && { + ResourceIdList: serializeAws_json1_1ResourceIdList(input.ResourceIdList, context), + }), }; }; const serializeAws_json1_1ListTrailsRequest = (input: ListTrailsRequest, context: __SerdeContext): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1LookupAttribute = (input: LookupAttribute, context: __SerdeContext): any => { return { - ...(input.AttributeKey !== undefined && { AttributeKey: input.AttributeKey }), - ...(input.AttributeValue !== undefined && { AttributeValue: input.AttributeValue }), + ...(input.AttributeKey !== undefined && input.AttributeKey !== null && { AttributeKey: input.AttributeKey }), + ...(input.AttributeValue !== undefined && + input.AttributeValue !== null && { AttributeValue: input.AttributeValue }), }; }; const serializeAws_json1_1LookupAttributesList = (input: LookupAttribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1LookupAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1LookupAttribute(entry, context); + }); }; const serializeAws_json1_1LookupEventsRequest = (input: LookupEventsRequest, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.EventCategory !== undefined && { EventCategory: input.EventCategory }), - ...(input.LookupAttributes !== undefined && { - LookupAttributes: serializeAws_json1_1LookupAttributesList(input.LookupAttributes, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.EventCategory !== undefined && input.EventCategory !== null && { EventCategory: input.EventCategory }), + ...(input.LookupAttributes !== undefined && + input.LookupAttributes !== null && { + LookupAttributes: serializeAws_json1_1LookupAttributesList(input.LookupAttributes, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1Operator = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutEventSelectorsRequest = ( @@ -3286,13 +3353,15 @@ const serializeAws_json1_1PutEventSelectorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AdvancedEventSelectors !== undefined && { - AdvancedEventSelectors: serializeAws_json1_1AdvancedEventSelectors(input.AdvancedEventSelectors, context), - }), - ...(input.EventSelectors !== undefined && { - EventSelectors: serializeAws_json1_1EventSelectors(input.EventSelectors, context), - }), - ...(input.TrailName !== undefined && { TrailName: input.TrailName }), + ...(input.AdvancedEventSelectors !== undefined && + input.AdvancedEventSelectors !== null && { + AdvancedEventSelectors: serializeAws_json1_1AdvancedEventSelectors(input.AdvancedEventSelectors, context), + }), + ...(input.EventSelectors !== undefined && + input.EventSelectors !== null && { + EventSelectors: serializeAws_json1_1EventSelectors(input.EventSelectors, context), + }), + ...(input.TrailName !== undefined && input.TrailName !== null && { TrailName: input.TrailName }), }; }; @@ -3301,68 +3370,93 @@ const serializeAws_json1_1PutInsightSelectorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.InsightSelectors !== undefined && { - InsightSelectors: serializeAws_json1_1InsightSelectors(input.InsightSelectors, context), - }), - ...(input.TrailName !== undefined && { TrailName: input.TrailName }), + ...(input.InsightSelectors !== undefined && + input.InsightSelectors !== null && { + InsightSelectors: serializeAws_json1_1InsightSelectors(input.InsightSelectors, context), + }), + ...(input.TrailName !== undefined && input.TrailName !== null && { TrailName: input.TrailName }), }; }; const serializeAws_json1_1RemoveTagsRequest = (input: RemoveTagsRequest, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagsList !== undefined && { TagsList: serializeAws_json1_1TagsList(input.TagsList, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagsList !== undefined && + input.TagsList !== null && { TagsList: serializeAws_json1_1TagsList(input.TagsList, context) }), }; }; const serializeAws_json1_1ResourceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartLoggingRequest = (input: StartLoggingRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1StopLoggingRequest = (input: StopLoggingRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagsList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TrailNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UpdateTrailRequest = (input: UpdateTrailRequest, context: __SerdeContext): any => { return { - ...(input.CloudWatchLogsLogGroupArn !== undefined && { - CloudWatchLogsLogGroupArn: input.CloudWatchLogsLogGroupArn, - }), - ...(input.CloudWatchLogsRoleArn !== undefined && { CloudWatchLogsRoleArn: input.CloudWatchLogsRoleArn }), - ...(input.EnableLogFileValidation !== undefined && { EnableLogFileValidation: input.EnableLogFileValidation }), - ...(input.IncludeGlobalServiceEvents !== undefined && { - IncludeGlobalServiceEvents: input.IncludeGlobalServiceEvents, - }), - ...(input.IsMultiRegionTrail !== undefined && { IsMultiRegionTrail: input.IsMultiRegionTrail }), - ...(input.IsOrganizationTrail !== undefined && { IsOrganizationTrail: input.IsOrganizationTrail }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.S3KeyPrefix !== undefined && { S3KeyPrefix: input.S3KeyPrefix }), - ...(input.SnsTopicName !== undefined && { SnsTopicName: input.SnsTopicName }), + ...(input.CloudWatchLogsLogGroupArn !== undefined && + input.CloudWatchLogsLogGroupArn !== null && { CloudWatchLogsLogGroupArn: input.CloudWatchLogsLogGroupArn }), + ...(input.CloudWatchLogsRoleArn !== undefined && + input.CloudWatchLogsRoleArn !== null && { CloudWatchLogsRoleArn: input.CloudWatchLogsRoleArn }), + ...(input.EnableLogFileValidation !== undefined && + input.EnableLogFileValidation !== null && { EnableLogFileValidation: input.EnableLogFileValidation }), + ...(input.IncludeGlobalServiceEvents !== undefined && + input.IncludeGlobalServiceEvents !== null && { IncludeGlobalServiceEvents: input.IncludeGlobalServiceEvents }), + ...(input.IsMultiRegionTrail !== undefined && + input.IsMultiRegionTrail !== null && { IsMultiRegionTrail: input.IsMultiRegionTrail }), + ...(input.IsOrganizationTrail !== undefined && + input.IsOrganizationTrail !== null && { IsOrganizationTrail: input.IsOrganizationTrail }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.S3KeyPrefix !== undefined && input.S3KeyPrefix !== null && { S3KeyPrefix: input.S3KeyPrefix }), + ...(input.SnsTopicName !== undefined && input.SnsTopicName !== null && { SnsTopicName: input.SnsTopicName }), }; }; @@ -3384,7 +3478,14 @@ const deserializeAws_json1_1AdvancedEventSelectors = ( output: any, context: __SerdeContext ): AdvancedEventSelector[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AdvancedEventSelector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AdvancedEventSelector(entry, context); + }); }; const deserializeAws_json1_1AdvancedFieldSelector = (output: any, context: __SerdeContext): AdvancedFieldSelector => { @@ -3421,7 +3522,14 @@ const deserializeAws_json1_1AdvancedFieldSelectors = ( output: any, context: __SerdeContext ): AdvancedFieldSelector[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AdvancedFieldSelector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AdvancedFieldSelector(entry, context); + }); }; const deserializeAws_json1_1CloudTrailAccessNotEnabledException = ( @@ -3507,11 +3615,25 @@ const deserializeAws_json1_1DataResource = (output: any, context: __SerdeContext }; const deserializeAws_json1_1DataResources = (output: any, context: __SerdeContext): DataResource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataResource(entry, context); + }); }; const deserializeAws_json1_1DataResourceValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeleteTrailResponse = (output: any, context: __SerdeContext): DeleteTrailResponse => { @@ -3568,15 +3690,36 @@ const deserializeAws_json1_1EventSelector = (output: any, context: __SerdeContex }; const deserializeAws_json1_1EventSelectors = (output: any, context: __SerdeContext): EventSelector[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventSelector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventSelector(entry, context); + }); }; const deserializeAws_json1_1EventsList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Event(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Event(entry, context); + }); }; const deserializeAws_json1_1ExcludeManagementEventSources = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1GetEventSelectorsResponse = ( @@ -3704,7 +3847,14 @@ const deserializeAws_json1_1InsightSelector = (output: any, context: __SerdeCont }; const deserializeAws_json1_1InsightSelectors = (output: any, context: __SerdeContext): InsightSelector[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InsightSelector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InsightSelector(entry, context); + }); }; const deserializeAws_json1_1InsufficientDependencyServiceAccessPermissionException = ( @@ -3994,7 +4144,14 @@ const deserializeAws_json1_1OperationNotPermittedException = ( }; const deserializeAws_json1_1Operator = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1OrganizationNotInAllFeaturesModeException = ( @@ -4031,7 +4188,14 @@ const deserializeAws_json1_1PublicKey = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1PublicKeyList = (output: any, context: __SerdeContext): PublicKey[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PublicKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PublicKey(entry, context); + }); }; const deserializeAws_json1_1PutEventSelectorsResponse = ( @@ -4076,7 +4240,14 @@ const deserializeAws_json1_1Resource = (output: any, context: __SerdeContext): R }; const deserializeAws_json1_1ResourceList = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Resource(entry, context); + }); }; const deserializeAws_json1_1ResourceNotFoundException = ( @@ -4099,7 +4270,14 @@ const deserializeAws_json1_1ResourceTag = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ResourceTagList = (output: any, context: __SerdeContext): ResourceTag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceTag(entry, context); + }); }; const deserializeAws_json1_1ResourceTypeNotSupportedException = ( @@ -4145,7 +4323,14 @@ const deserializeAws_json1_1TagsLimitExceededException = ( }; const deserializeAws_json1_1TagsList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1Trail = (output: any, context: __SerdeContext): Trail => { @@ -4211,7 +4396,14 @@ const deserializeAws_json1_1TrailInfo = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1TrailList = (output: any, context: __SerdeContext): Trail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Trail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Trail(entry, context); + }); }; const deserializeAws_json1_1TrailNotFoundException = (output: any, context: __SerdeContext): TrailNotFoundException => { @@ -4230,7 +4422,14 @@ const deserializeAws_json1_1TrailNotProvidedException = ( }; const deserializeAws_json1_1Trails = (output: any, context: __SerdeContext): TrailInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrailInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrailInfo(entry, context); + }); }; const deserializeAws_json1_1UnsupportedOperationException = ( @@ -4328,3 +4527,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-cloudwatch-events/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-events/protocols/Aws_json1_1.ts index bd3d055cd07a..4955b4f1197a 100644 --- a/clients/client-cloudwatch-events/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-events/protocols/Aws_json1_1.ts @@ -199,7 +199,7 @@ export const serializeAws_json1_1ActivateEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ActivateEventSource", }; let body: any; @@ -212,7 +212,7 @@ export const serializeAws_json1_1CancelReplayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.CancelReplay", }; let body: any; @@ -225,7 +225,7 @@ export const serializeAws_json1_1CreateArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.CreateArchive", }; let body: any; @@ -238,7 +238,7 @@ export const serializeAws_json1_1CreateEventBusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.CreateEventBus", }; let body: any; @@ -251,7 +251,7 @@ export const serializeAws_json1_1CreatePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.CreatePartnerEventSource", }; let body: any; @@ -264,7 +264,7 @@ export const serializeAws_json1_1DeactivateEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeactivateEventSource", }; let body: any; @@ -277,7 +277,7 @@ export const serializeAws_json1_1DeleteArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeleteArchive", }; let body: any; @@ -290,7 +290,7 @@ export const serializeAws_json1_1DeleteEventBusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeleteEventBus", }; let body: any; @@ -303,7 +303,7 @@ export const serializeAws_json1_1DeletePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeletePartnerEventSource", }; let body: any; @@ -316,7 +316,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeleteRule", }; let body: any; @@ -329,7 +329,7 @@ export const serializeAws_json1_1DescribeArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeArchive", }; let body: any; @@ -342,7 +342,7 @@ export const serializeAws_json1_1DescribeEventBusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeEventBus", }; let body: any; @@ -355,7 +355,7 @@ export const serializeAws_json1_1DescribeEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeEventSource", }; let body: any; @@ -368,7 +368,7 @@ export const serializeAws_json1_1DescribePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribePartnerEventSource", }; let body: any; @@ -381,7 +381,7 @@ export const serializeAws_json1_1DescribeReplayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeReplay", }; let body: any; @@ -394,7 +394,7 @@ export const serializeAws_json1_1DescribeRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeRule", }; let body: any; @@ -407,7 +407,7 @@ export const serializeAws_json1_1DisableRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DisableRule", }; let body: any; @@ -420,7 +420,7 @@ export const serializeAws_json1_1EnableRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.EnableRule", }; let body: any; @@ -433,7 +433,7 @@ export const serializeAws_json1_1ListArchivesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListArchives", }; let body: any; @@ -446,7 +446,7 @@ export const serializeAws_json1_1ListEventBusesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListEventBuses", }; let body: any; @@ -459,7 +459,7 @@ export const serializeAws_json1_1ListEventSourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListEventSources", }; let body: any; @@ -472,7 +472,7 @@ export const serializeAws_json1_1ListPartnerEventSourceAccountsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListPartnerEventSourceAccounts", }; let body: any; @@ -485,7 +485,7 @@ export const serializeAws_json1_1ListPartnerEventSourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListPartnerEventSources", }; let body: any; @@ -498,7 +498,7 @@ export const serializeAws_json1_1ListReplaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListReplays", }; let body: any; @@ -511,7 +511,7 @@ export const serializeAws_json1_1ListRuleNamesByTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListRuleNamesByTarget", }; let body: any; @@ -524,7 +524,7 @@ export const serializeAws_json1_1ListRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListRules", }; let body: any; @@ -537,7 +537,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListTagsForResource", }; let body: any; @@ -550,7 +550,7 @@ export const serializeAws_json1_1ListTargetsByRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListTargetsByRule", }; let body: any; @@ -563,7 +563,7 @@ export const serializeAws_json1_1PutEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutEvents", }; let body: any; @@ -576,7 +576,7 @@ export const serializeAws_json1_1PutPartnerEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutPartnerEvents", }; let body: any; @@ -589,7 +589,7 @@ export const serializeAws_json1_1PutPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutPermission", }; let body: any; @@ -602,7 +602,7 @@ export const serializeAws_json1_1PutRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutRule", }; let body: any; @@ -615,7 +615,7 @@ export const serializeAws_json1_1PutTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutTargets", }; let body: any; @@ -628,7 +628,7 @@ export const serializeAws_json1_1RemovePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.RemovePermission", }; let body: any; @@ -641,7 +641,7 @@ export const serializeAws_json1_1RemoveTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.RemoveTargets", }; let body: any; @@ -654,7 +654,7 @@ export const serializeAws_json1_1StartReplayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.StartReplay", }; let body: any; @@ -667,7 +667,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.TagResource", }; let body: any; @@ -680,7 +680,7 @@ export const serializeAws_json1_1TestEventPatternCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.TestEventPattern", }; let body: any; @@ -693,7 +693,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.UntagResource", }; let body: any; @@ -706,7 +706,7 @@ export const serializeAws_json1_1UpdateArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.UpdateArchive", }; let body: any; @@ -738,8 +738,7 @@ const deserializeAws_json1_1ActivateEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -825,8 +824,7 @@ const deserializeAws_json1_1CancelReplayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -904,8 +902,7 @@ const deserializeAws_json1_1CreateArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -999,8 +996,7 @@ const deserializeAws_json1_1CreateEventBusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -1102,8 +1098,7 @@ const deserializeAws_json1_1CreatePartnerEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -1186,8 +1181,7 @@ const deserializeAws_json1_1DeactivateEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -1273,8 +1267,7 @@ const deserializeAws_json1_1DeleteArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -1341,8 +1334,7 @@ const deserializeAws_json1_1DeleteEventBusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -1401,8 +1393,7 @@ const deserializeAws_json1_1DeletePartnerEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -1469,8 +1460,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -1548,8 +1538,7 @@ const deserializeAws_json1_1DescribeArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -1619,8 +1608,7 @@ const deserializeAws_json1_1DescribeEventBusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -1682,8 +1670,7 @@ const deserializeAws_json1_1DescribeEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -1753,8 +1740,7 @@ const deserializeAws_json1_1DescribePartnerEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -1824,8 +1810,7 @@ const deserializeAws_json1_1DescribeReplayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -1887,8 +1872,7 @@ const deserializeAws_json1_1DescribeRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -1947,8 +1931,7 @@ const deserializeAws_json1_1DisableRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -2023,8 +2006,7 @@ const deserializeAws_json1_1EnableRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -2102,8 +2084,7 @@ const deserializeAws_json1_1ListArchivesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2165,8 +2146,7 @@ const deserializeAws_json1_1ListEventBusesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2220,8 +2200,7 @@ const deserializeAws_json1_1ListEventSourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2283,8 +2262,7 @@ const deserializeAws_json1_1ListPartnerEventSourceAccountsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2354,8 +2332,7 @@ const deserializeAws_json1_1ListPartnerEventSourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2417,8 +2394,7 @@ const deserializeAws_json1_1ListReplaysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2472,8 +2448,7 @@ const deserializeAws_json1_1ListRuleNamesByTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2535,8 +2510,7 @@ const deserializeAws_json1_1ListRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2598,8 +2572,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2661,8 +2634,7 @@ const deserializeAws_json1_1ListTargetsByRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2724,8 +2696,7 @@ const deserializeAws_json1_1PutEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2779,8 +2750,7 @@ const deserializeAws_json1_1PutPartnerEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -2839,8 +2809,7 @@ const deserializeAws_json1_1PutPermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -2926,8 +2895,7 @@ const deserializeAws_json1_1PutRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -3021,8 +2989,7 @@ const deserializeAws_json1_1PutTargetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -3105,8 +3072,7 @@ const deserializeAws_json1_1RemovePermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -3184,8 +3150,7 @@ const deserializeAws_json1_1RemoveTargetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -3263,8 +3228,7 @@ const deserializeAws_json1_1StartReplayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -3350,8 +3314,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -3429,8 +3392,7 @@ const deserializeAws_json1_1TestEventPatternCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": @@ -3492,8 +3454,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -3571,8 +3532,7 @@ const deserializeAws_json1_1UpdateArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": @@ -3801,74 +3761,81 @@ const serializeAws_json1_1ActivateEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1AwsVpcConfiguration = (input: AwsVpcConfiguration, context: __SerdeContext): any => { return { - ...(input.AssignPublicIp !== undefined && { AssignPublicIp: input.AssignPublicIp }), - ...(input.SecurityGroups !== undefined && { - SecurityGroups: serializeAws_json1_1StringList(input.SecurityGroups, context), - }), - ...(input.Subnets !== undefined && { Subnets: serializeAws_json1_1StringList(input.Subnets, context) }), + ...(input.AssignPublicIp !== undefined && + input.AssignPublicIp !== null && { AssignPublicIp: input.AssignPublicIp }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + SecurityGroups: serializeAws_json1_1StringList(input.SecurityGroups, context), + }), + ...(input.Subnets !== undefined && + input.Subnets !== null && { Subnets: serializeAws_json1_1StringList(input.Subnets, context) }), }; }; const serializeAws_json1_1BatchArrayProperties = (input: BatchArrayProperties, context: __SerdeContext): any => { return { - ...(input.Size !== undefined && { Size: input.Size }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), }; }; const serializeAws_json1_1BatchParameters = (input: BatchParameters, context: __SerdeContext): any => { return { - ...(input.ArrayProperties !== undefined && { - ArrayProperties: serializeAws_json1_1BatchArrayProperties(input.ArrayProperties, context), - }), - ...(input.JobDefinition !== undefined && { JobDefinition: input.JobDefinition }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.RetryStrategy !== undefined && { - RetryStrategy: serializeAws_json1_1BatchRetryStrategy(input.RetryStrategy, context), - }), + ...(input.ArrayProperties !== undefined && + input.ArrayProperties !== null && { + ArrayProperties: serializeAws_json1_1BatchArrayProperties(input.ArrayProperties, context), + }), + ...(input.JobDefinition !== undefined && input.JobDefinition !== null && { JobDefinition: input.JobDefinition }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.RetryStrategy !== undefined && + input.RetryStrategy !== null && { + RetryStrategy: serializeAws_json1_1BatchRetryStrategy(input.RetryStrategy, context), + }), }; }; const serializeAws_json1_1BatchRetryStrategy = (input: BatchRetryStrategy, context: __SerdeContext): any => { return { - ...(input.Attempts !== undefined && { Attempts: input.Attempts }), + ...(input.Attempts !== undefined && input.Attempts !== null && { Attempts: input.Attempts }), }; }; const serializeAws_json1_1CancelReplayRequest = (input: CancelReplayRequest, context: __SerdeContext): any => { return { - ...(input.ReplayName !== undefined && { ReplayName: input.ReplayName }), + ...(input.ReplayName !== undefined && input.ReplayName !== null && { ReplayName: input.ReplayName }), }; }; const serializeAws_json1_1Condition = (input: Condition, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1CreateArchiveRequest = (input: CreateArchiveRequest, context: __SerdeContext): any => { return { - ...(input.ArchiveName !== undefined && { ArchiveName: input.ArchiveName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EventPattern !== undefined && { EventPattern: input.EventPattern }), - ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), - ...(input.RetentionDays !== undefined && { RetentionDays: input.RetentionDays }), + ...(input.ArchiveName !== undefined && input.ArchiveName !== null && { ArchiveName: input.ArchiveName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EventPattern !== undefined && input.EventPattern !== null && { EventPattern: input.EventPattern }), + ...(input.EventSourceArn !== undefined && + input.EventSourceArn !== null && { EventSourceArn: input.EventSourceArn }), + ...(input.RetentionDays !== undefined && input.RetentionDays !== null && { RetentionDays: input.RetentionDays }), }; }; const serializeAws_json1_1CreateEventBusRequest = (input: CreateEventBusRequest, context: __SerdeContext): any => { return { - ...(input.EventSourceName !== undefined && { EventSourceName: input.EventSourceName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.EventSourceName !== undefined && + input.EventSourceName !== null && { EventSourceName: input.EventSourceName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -3877,8 +3844,8 @@ const serializeAws_json1_1CreatePartnerEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Account !== undefined && { Account: input.Account }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Account !== undefined && input.Account !== null && { Account: input.Account }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -3887,25 +3854,25 @@ const serializeAws_json1_1DeactivateEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeadLetterConfig = (input: DeadLetterConfig, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }; }; const serializeAws_json1_1DeleteArchiveRequest = (input: DeleteArchiveRequest, context: __SerdeContext): any => { return { - ...(input.ArchiveName !== undefined && { ArchiveName: input.ArchiveName }), + ...(input.ArchiveName !== undefined && input.ArchiveName !== null && { ArchiveName: input.ArchiveName }), }; }; const serializeAws_json1_1DeleteEventBusRequest = (input: DeleteEventBusRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -3914,28 +3881,28 @@ const serializeAws_json1_1DeletePartnerEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Account !== undefined && { Account: input.Account }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Account !== undefined && input.Account !== null && { Account: input.Account }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeleteRuleRequest = (input: DeleteRuleRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Force !== undefined && { Force: input.Force }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Force !== undefined && input.Force !== null && { Force: input.Force }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DescribeArchiveRequest = (input: DescribeArchiveRequest, context: __SerdeContext): any => { return { - ...(input.ArchiveName !== undefined && { ArchiveName: input.ArchiveName }), + ...(input.ArchiveName !== undefined && input.ArchiveName !== null && { ArchiveName: input.ArchiveName }), }; }; const serializeAws_json1_1DescribeEventBusRequest = (input: DescribeEventBusRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -3944,7 +3911,7 @@ const serializeAws_json1_1DescribeEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -3953,116 +3920,134 @@ const serializeAws_json1_1DescribePartnerEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DescribeReplayRequest = (input: DescribeReplayRequest, context: __SerdeContext): any => { return { - ...(input.ReplayName !== undefined && { ReplayName: input.ReplayName }), + ...(input.ReplayName !== undefined && input.ReplayName !== null && { ReplayName: input.ReplayName }), }; }; const serializeAws_json1_1DescribeRuleRequest = (input: DescribeRuleRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DisableRuleRequest = (input: DisableRuleRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1EcsParameters = (input: EcsParameters, context: __SerdeContext): any => { return { - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.LaunchType !== undefined && { LaunchType: input.LaunchType }), - ...(input.NetworkConfiguration !== undefined && { - NetworkConfiguration: serializeAws_json1_1NetworkConfiguration(input.NetworkConfiguration, context), - }), - ...(input.PlatformVersion !== undefined && { PlatformVersion: input.PlatformVersion }), - ...(input.TaskCount !== undefined && { TaskCount: input.TaskCount }), - ...(input.TaskDefinitionArn !== undefined && { TaskDefinitionArn: input.TaskDefinitionArn }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.LaunchType !== undefined && input.LaunchType !== null && { LaunchType: input.LaunchType }), + ...(input.NetworkConfiguration !== undefined && + input.NetworkConfiguration !== null && { + NetworkConfiguration: serializeAws_json1_1NetworkConfiguration(input.NetworkConfiguration, context), + }), + ...(input.PlatformVersion !== undefined && + input.PlatformVersion !== null && { PlatformVersion: input.PlatformVersion }), + ...(input.TaskCount !== undefined && input.TaskCount !== null && { TaskCount: input.TaskCount }), + ...(input.TaskDefinitionArn !== undefined && + input.TaskDefinitionArn !== null && { TaskDefinitionArn: input.TaskDefinitionArn }), }; }; const serializeAws_json1_1EnableRuleRequest = (input: EnableRuleRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1EventResourceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1HeaderParametersMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1HttpParameters = (input: HttpParameters, context: __SerdeContext): any => { return { - ...(input.HeaderParameters !== undefined && { - HeaderParameters: serializeAws_json1_1HeaderParametersMap(input.HeaderParameters, context), - }), - ...(input.PathParameterValues !== undefined && { - PathParameterValues: serializeAws_json1_1PathParameterList(input.PathParameterValues, context), - }), - ...(input.QueryStringParameters !== undefined && { - QueryStringParameters: serializeAws_json1_1QueryStringParametersMap(input.QueryStringParameters, context), - }), + ...(input.HeaderParameters !== undefined && + input.HeaderParameters !== null && { + HeaderParameters: serializeAws_json1_1HeaderParametersMap(input.HeaderParameters, context), + }), + ...(input.PathParameterValues !== undefined && + input.PathParameterValues !== null && { + PathParameterValues: serializeAws_json1_1PathParameterList(input.PathParameterValues, context), + }), + ...(input.QueryStringParameters !== undefined && + input.QueryStringParameters !== null && { + QueryStringParameters: serializeAws_json1_1QueryStringParametersMap(input.QueryStringParameters, context), + }), }; }; const serializeAws_json1_1InputTransformer = (input: InputTransformer, context: __SerdeContext): any => { return { - ...(input.InputPathsMap !== undefined && { - InputPathsMap: serializeAws_json1_1TransformerPaths(input.InputPathsMap, context), - }), - ...(input.InputTemplate !== undefined && { InputTemplate: input.InputTemplate }), + ...(input.InputPathsMap !== undefined && + input.InputPathsMap !== null && { + InputPathsMap: serializeAws_json1_1TransformerPaths(input.InputPathsMap, context), + }), + ...(input.InputTemplate !== undefined && input.InputTemplate !== null && { InputTemplate: input.InputTemplate }), }; }; const serializeAws_json1_1KinesisParameters = (input: KinesisParameters, context: __SerdeContext): any => { return { - ...(input.PartitionKeyPath !== undefined && { PartitionKeyPath: input.PartitionKeyPath }), + ...(input.PartitionKeyPath !== undefined && + input.PartitionKeyPath !== null && { PartitionKeyPath: input.PartitionKeyPath }), }; }; const serializeAws_json1_1ListArchivesRequest = (input: ListArchivesRequest, context: __SerdeContext): any => { return { - ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.State !== undefined && { State: input.State }), + ...(input.EventSourceArn !== undefined && + input.EventSourceArn !== null && { EventSourceArn: input.EventSourceArn }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; const serializeAws_json1_1ListEventBusesRequest = (input: ListEventBusesRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListEventSourcesRequest = (input: ListEventSourcesRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4071,9 +4056,10 @@ const serializeAws_json1_1ListPartnerEventSourceAccountsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EventSourceName !== undefined && { EventSourceName: input.EventSourceName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.EventSourceName !== undefined && + input.EventSourceName !== null && { EventSourceName: input.EventSourceName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4082,19 +4068,20 @@ const serializeAws_json1_1ListPartnerEventSourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListReplaysRequest = (input: ListReplaysRequest, context: __SerdeContext): any => { return { - ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.State !== undefined && { State: input.State }), + ...(input.EventSourceArn !== undefined && + input.EventSourceArn !== null && { EventSourceArn: input.EventSourceArn }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; @@ -4103,19 +4090,19 @@ const serializeAws_json1_1ListRuleNamesByTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TargetArn !== undefined && { TargetArn: input.TargetArn }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TargetArn !== undefined && input.TargetArn !== null && { TargetArn: input.TargetArn }), }; }; const serializeAws_json1_1ListRulesRequest = (input: ListRulesRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4124,7 +4111,7 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; @@ -4133,43 +4120,49 @@ const serializeAws_json1_1ListTargetsByRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Rule !== undefined && { Rule: input.Rule }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Rule !== undefined && input.Rule !== null && { Rule: input.Rule }), }; }; const serializeAws_json1_1NetworkConfiguration = (input: NetworkConfiguration, context: __SerdeContext): any => { return { - ...(input.awsvpcConfiguration !== undefined && { - awsvpcConfiguration: serializeAws_json1_1AwsVpcConfiguration(input.awsvpcConfiguration, context), - }), + ...(input.awsvpcConfiguration !== undefined && + input.awsvpcConfiguration !== null && { + awsvpcConfiguration: serializeAws_json1_1AwsVpcConfiguration(input.awsvpcConfiguration, context), + }), }; }; const serializeAws_json1_1PathParameterList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutEventsRequest = (input: PutEventsRequest, context: __SerdeContext): any => { return { - ...(input.Entries !== undefined && { - Entries: serializeAws_json1_1PutEventsRequestEntryList(input.Entries, context), - }), + ...(input.Entries !== undefined && + input.Entries !== null && { Entries: serializeAws_json1_1PutEventsRequestEntryList(input.Entries, context) }), }; }; const serializeAws_json1_1PutEventsRequestEntry = (input: PutEventsRequestEntry, context: __SerdeContext): any => { return { - ...(input.Detail !== undefined && { Detail: input.Detail }), - ...(input.DetailType !== undefined && { DetailType: input.DetailType }), - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Resources !== undefined && { - Resources: serializeAws_json1_1EventResourceList(input.Resources, context), - }), - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.Time !== undefined && { Time: Math.round(input.Time.getTime() / 1000) }), + ...(input.Detail !== undefined && input.Detail !== null && { Detail: input.Detail }), + ...(input.DetailType !== undefined && input.DetailType !== null && { DetailType: input.DetailType }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_json1_1EventResourceList(input.Resources, context) }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.Time !== undefined && input.Time !== null && { Time: Math.round(input.Time.getTime() / 1000) }), }; }; @@ -4177,14 +4170,22 @@ const serializeAws_json1_1PutEventsRequestEntryList = ( input: PutEventsRequestEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1PutEventsRequestEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PutEventsRequestEntry(entry, context); + }); }; const serializeAws_json1_1PutPartnerEventsRequest = (input: PutPartnerEventsRequest, context: __SerdeContext): any => { return { - ...(input.Entries !== undefined && { - Entries: serializeAws_json1_1PutPartnerEventsRequestEntryList(input.Entries, context), - }), + ...(input.Entries !== undefined && + input.Entries !== null && { + Entries: serializeAws_json1_1PutPartnerEventsRequestEntryList(input.Entries, context), + }), }; }; @@ -4193,13 +4194,12 @@ const serializeAws_json1_1PutPartnerEventsRequestEntry = ( context: __SerdeContext ): any => { return { - ...(input.Detail !== undefined && { Detail: input.Detail }), - ...(input.DetailType !== undefined && { DetailType: input.DetailType }), - ...(input.Resources !== undefined && { - Resources: serializeAws_json1_1EventResourceList(input.Resources, context), - }), - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.Time !== undefined && { Time: Math.round(input.Time.getTime() / 1000) }), + ...(input.Detail !== undefined && input.Detail !== null && { Detail: input.Detail }), + ...(input.DetailType !== undefined && input.DetailType !== null && { DetailType: input.DetailType }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_json1_1EventResourceList(input.Resources, context) }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.Time !== undefined && input.Time !== null && { Time: Math.round(input.Time.getTime() / 1000) }), }; }; @@ -4207,38 +4207,48 @@ const serializeAws_json1_1PutPartnerEventsRequestEntryList = ( input: PutPartnerEventsRequestEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1PutPartnerEventsRequestEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PutPartnerEventsRequestEntry(entry, context); + }); }; const serializeAws_json1_1PutPermissionRequest = (input: PutPermissionRequest, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Condition !== undefined && { Condition: serializeAws_json1_1Condition(input.Condition, context) }), - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.Principal !== undefined && { Principal: input.Principal }), - ...(input.StatementId !== undefined && { StatementId: input.StatementId }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Condition !== undefined && + input.Condition !== null && { Condition: serializeAws_json1_1Condition(input.Condition, context) }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.Principal !== undefined && input.Principal !== null && { Principal: input.Principal }), + ...(input.StatementId !== undefined && input.StatementId !== null && { StatementId: input.StatementId }), }; }; const serializeAws_json1_1PutRuleRequest = (input: PutRuleRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.EventPattern !== undefined && { EventPattern: input.EventPattern }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.ScheduleExpression !== undefined && { ScheduleExpression: input.ScheduleExpression }), - ...(input.State !== undefined && { State: input.State }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.EventPattern !== undefined && input.EventPattern !== null && { EventPattern: input.EventPattern }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.ScheduleExpression !== undefined && + input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1PutTargetsRequest = (input: PutTargetsRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Rule !== undefined && { Rule: input.Rule }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1TargetList(input.Targets, context) }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Rule !== undefined && input.Rule !== null && { Rule: input.Rule }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1TargetList(input.Targets, context) }), }; }; @@ -4246,209 +4256,288 @@ const serializeAws_json1_1QueryStringParametersMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1RedshiftDataParameters = (input: RedshiftDataParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.SecretManagerArn !== undefined && { SecretManagerArn: input.SecretManagerArn }), - ...(input.Sql !== undefined && { Sql: input.Sql }), - ...(input.StatementName !== undefined && { StatementName: input.StatementName }), - ...(input.WithEvent !== undefined && { WithEvent: input.WithEvent }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.SecretManagerArn !== undefined && + input.SecretManagerArn !== null && { SecretManagerArn: input.SecretManagerArn }), + ...(input.Sql !== undefined && input.Sql !== null && { Sql: input.Sql }), + ...(input.StatementName !== undefined && input.StatementName !== null && { StatementName: input.StatementName }), + ...(input.WithEvent !== undefined && input.WithEvent !== null && { WithEvent: input.WithEvent }), }; }; const serializeAws_json1_1RemovePermissionRequest = (input: RemovePermissionRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.RemoveAllPermissions !== undefined && { RemoveAllPermissions: input.RemoveAllPermissions }), - ...(input.StatementId !== undefined && { StatementId: input.StatementId }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.RemoveAllPermissions !== undefined && + input.RemoveAllPermissions !== null && { RemoveAllPermissions: input.RemoveAllPermissions }), + ...(input.StatementId !== undefined && input.StatementId !== null && { StatementId: input.StatementId }), }; }; const serializeAws_json1_1RemoveTargetsRequest = (input: RemoveTargetsRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Force !== undefined && { Force: input.Force }), - ...(input.Ids !== undefined && { Ids: serializeAws_json1_1TargetIdList(input.Ids, context) }), - ...(input.Rule !== undefined && { Rule: input.Rule }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Force !== undefined && input.Force !== null && { Force: input.Force }), + ...(input.Ids !== undefined && input.Ids !== null && { Ids: serializeAws_json1_1TargetIdList(input.Ids, context) }), + ...(input.Rule !== undefined && input.Rule !== null && { Rule: input.Rule }), }; }; const serializeAws_json1_1ReplayDestination = (input: ReplayDestination, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.FilterArns !== undefined && { - FilterArns: serializeAws_json1_1ReplayDestinationFilters(input.FilterArns, context), - }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.FilterArns !== undefined && + input.FilterArns !== null && { + FilterArns: serializeAws_json1_1ReplayDestinationFilters(input.FilterArns, context), + }), }; }; const serializeAws_json1_1ReplayDestinationFilters = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RetryPolicy = (input: RetryPolicy, context: __SerdeContext): any => { return { - ...(input.MaximumEventAgeInSeconds !== undefined && { MaximumEventAgeInSeconds: input.MaximumEventAgeInSeconds }), - ...(input.MaximumRetryAttempts !== undefined && { MaximumRetryAttempts: input.MaximumRetryAttempts }), + ...(input.MaximumEventAgeInSeconds !== undefined && + input.MaximumEventAgeInSeconds !== null && { MaximumEventAgeInSeconds: input.MaximumEventAgeInSeconds }), + ...(input.MaximumRetryAttempts !== undefined && + input.MaximumRetryAttempts !== null && { MaximumRetryAttempts: input.MaximumRetryAttempts }), }; }; const serializeAws_json1_1RunCommandParameters = (input: RunCommandParameters, context: __SerdeContext): any => { return { - ...(input.RunCommandTargets !== undefined && { - RunCommandTargets: serializeAws_json1_1RunCommandTargets(input.RunCommandTargets, context), - }), + ...(input.RunCommandTargets !== undefined && + input.RunCommandTargets !== null && { + RunCommandTargets: serializeAws_json1_1RunCommandTargets(input.RunCommandTargets, context), + }), }; }; const serializeAws_json1_1RunCommandTarget = (input: RunCommandTarget, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1RunCommandTargetValues(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1RunCommandTargetValues(input.Values, context) }), }; }; const serializeAws_json1_1RunCommandTargets = (input: RunCommandTarget[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RunCommandTarget(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RunCommandTarget(entry, context); + }); }; const serializeAws_json1_1RunCommandTargetValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SqsParameters = (input: SqsParameters, context: __SerdeContext): any => { return { - ...(input.MessageGroupId !== undefined && { MessageGroupId: input.MessageGroupId }), + ...(input.MessageGroupId !== undefined && + input.MessageGroupId !== null && { MessageGroupId: input.MessageGroupId }), }; }; const serializeAws_json1_1StartReplayRequest = (input: StartReplayRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Destination !== undefined && { - Destination: serializeAws_json1_1ReplayDestination(input.Destination, context), - }), - ...(input.EventEndTime !== undefined && { EventEndTime: Math.round(input.EventEndTime.getTime() / 1000) }), - ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), - ...(input.EventStartTime !== undefined && { EventStartTime: Math.round(input.EventStartTime.getTime() / 1000) }), - ...(input.ReplayName !== undefined && { ReplayName: input.ReplayName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Destination !== undefined && + input.Destination !== null && { Destination: serializeAws_json1_1ReplayDestination(input.Destination, context) }), + ...(input.EventEndTime !== undefined && + input.EventEndTime !== null && { EventEndTime: Math.round(input.EventEndTime.getTime() / 1000) }), + ...(input.EventSourceArn !== undefined && + input.EventSourceArn !== null && { EventSourceArn: input.EventSourceArn }), + ...(input.EventStartTime !== undefined && + input.EventStartTime !== null && { EventStartTime: Math.round(input.EventStartTime.getTime() / 1000) }), + ...(input.ReplayName !== undefined && input.ReplayName !== null && { ReplayName: input.ReplayName }), }; }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1Target = (input: Target, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.BatchParameters !== undefined && { - BatchParameters: serializeAws_json1_1BatchParameters(input.BatchParameters, context), - }), - ...(input.DeadLetterConfig !== undefined && { - DeadLetterConfig: serializeAws_json1_1DeadLetterConfig(input.DeadLetterConfig, context), - }), - ...(input.EcsParameters !== undefined && { - EcsParameters: serializeAws_json1_1EcsParameters(input.EcsParameters, context), - }), - ...(input.HttpParameters !== undefined && { - HttpParameters: serializeAws_json1_1HttpParameters(input.HttpParameters, context), - }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Input !== undefined && { Input: input.Input }), - ...(input.InputPath !== undefined && { InputPath: input.InputPath }), - ...(input.InputTransformer !== undefined && { - InputTransformer: serializeAws_json1_1InputTransformer(input.InputTransformer, context), - }), - ...(input.KinesisParameters !== undefined && { - KinesisParameters: serializeAws_json1_1KinesisParameters(input.KinesisParameters, context), - }), - ...(input.RedshiftDataParameters !== undefined && { - RedshiftDataParameters: serializeAws_json1_1RedshiftDataParameters(input.RedshiftDataParameters, context), - }), - ...(input.RetryPolicy !== undefined && { - RetryPolicy: serializeAws_json1_1RetryPolicy(input.RetryPolicy, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.RunCommandParameters !== undefined && { - RunCommandParameters: serializeAws_json1_1RunCommandParameters(input.RunCommandParameters, context), - }), - ...(input.SqsParameters !== undefined && { - SqsParameters: serializeAws_json1_1SqsParameters(input.SqsParameters, context), - }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.BatchParameters !== undefined && + input.BatchParameters !== null && { + BatchParameters: serializeAws_json1_1BatchParameters(input.BatchParameters, context), + }), + ...(input.DeadLetterConfig !== undefined && + input.DeadLetterConfig !== null && { + DeadLetterConfig: serializeAws_json1_1DeadLetterConfig(input.DeadLetterConfig, context), + }), + ...(input.EcsParameters !== undefined && + input.EcsParameters !== null && { + EcsParameters: serializeAws_json1_1EcsParameters(input.EcsParameters, context), + }), + ...(input.HttpParameters !== undefined && + input.HttpParameters !== null && { + HttpParameters: serializeAws_json1_1HttpParameters(input.HttpParameters, context), + }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Input !== undefined && input.Input !== null && { Input: input.Input }), + ...(input.InputPath !== undefined && input.InputPath !== null && { InputPath: input.InputPath }), + ...(input.InputTransformer !== undefined && + input.InputTransformer !== null && { + InputTransformer: serializeAws_json1_1InputTransformer(input.InputTransformer, context), + }), + ...(input.KinesisParameters !== undefined && + input.KinesisParameters !== null && { + KinesisParameters: serializeAws_json1_1KinesisParameters(input.KinesisParameters, context), + }), + ...(input.RedshiftDataParameters !== undefined && + input.RedshiftDataParameters !== null && { + RedshiftDataParameters: serializeAws_json1_1RedshiftDataParameters(input.RedshiftDataParameters, context), + }), + ...(input.RetryPolicy !== undefined && + input.RetryPolicy !== null && { RetryPolicy: serializeAws_json1_1RetryPolicy(input.RetryPolicy, context) }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.RunCommandParameters !== undefined && + input.RunCommandParameters !== null && { + RunCommandParameters: serializeAws_json1_1RunCommandParameters(input.RunCommandParameters, context), + }), + ...(input.SqsParameters !== undefined && + input.SqsParameters !== null && { + SqsParameters: serializeAws_json1_1SqsParameters(input.SqsParameters, context), + }), }; }; const serializeAws_json1_1TargetIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TargetList = (input: Target[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Target(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Target(entry, context); + }); }; const serializeAws_json1_1TestEventPatternRequest = (input: TestEventPatternRequest, context: __SerdeContext): any => { return { - ...(input.Event !== undefined && { Event: input.Event }), - ...(input.EventPattern !== undefined && { EventPattern: input.EventPattern }), + ...(input.Event !== undefined && input.Event !== null && { Event: input.Event }), + ...(input.EventPattern !== undefined && input.EventPattern !== null && { EventPattern: input.EventPattern }), }; }; const serializeAws_json1_1TransformerPaths = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateArchiveRequest = (input: UpdateArchiveRequest, context: __SerdeContext): any => { return { - ...(input.ArchiveName !== undefined && { ArchiveName: input.ArchiveName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EventPattern !== undefined && { EventPattern: input.EventPattern }), - ...(input.RetentionDays !== undefined && { RetentionDays: input.RetentionDays }), + ...(input.ArchiveName !== undefined && input.ArchiveName !== null && { ArchiveName: input.ArchiveName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EventPattern !== undefined && input.EventPattern !== null && { EventPattern: input.EventPattern }), + ...(input.RetentionDays !== undefined && input.RetentionDays !== null && { RetentionDays: input.RetentionDays }), }; }; @@ -4471,7 +4560,14 @@ const deserializeAws_json1_1Archive = (output: any, context: __SerdeContext): Ar }; const deserializeAws_json1_1ArchiveResponseList = (output: any, context: __SerdeContext): Archive[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Archive(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Archive(entry, context); + }); }; const deserializeAws_json1_1AwsVpcConfiguration = (output: any, context: __SerdeContext): AwsVpcConfiguration => { @@ -4718,7 +4814,14 @@ const deserializeAws_json1_1EventBus = (output: any, context: __SerdeContext): E }; const deserializeAws_json1_1EventBusList = (output: any, context: __SerdeContext): EventBus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventBus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventBus(entry, context); + }); }; const deserializeAws_json1_1EventSource = (output: any, context: __SerdeContext): EventSource => { @@ -4739,17 +4842,26 @@ const deserializeAws_json1_1EventSource = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1EventSourceList = (output: any, context: __SerdeContext): EventSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventSource(entry, context); + }); }; const deserializeAws_json1_1HeaderParametersMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1HttpParameters = (output: any, context: __SerdeContext): HttpParameters => { @@ -4990,15 +5102,36 @@ const deserializeAws_json1_1PartnerEventSourceAccountList = ( output: any, context: __SerdeContext ): PartnerEventSourceAccount[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PartnerEventSourceAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PartnerEventSourceAccount(entry, context); + }); }; const deserializeAws_json1_1PartnerEventSourceList = (output: any, context: __SerdeContext): PartnerEventSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PartnerEventSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PartnerEventSource(entry, context); + }); }; const deserializeAws_json1_1PathParameterList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PolicyLengthExceededException = ( @@ -5033,7 +5166,14 @@ const deserializeAws_json1_1PutEventsResultEntryList = ( output: any, context: __SerdeContext ): PutEventsResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PutEventsResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PutEventsResultEntry(entry, context); + }); }; const deserializeAws_json1_1PutPartnerEventsResponse = ( @@ -5065,7 +5205,14 @@ const deserializeAws_json1_1PutPartnerEventsResultEntryList = ( output: any, context: __SerdeContext ): PutPartnerEventsResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PutPartnerEventsResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PutPartnerEventsResultEntry(entry, context); + }); }; const deserializeAws_json1_1PutRuleResponse = (output: any, context: __SerdeContext): PutRuleResponse => { @@ -5097,20 +5244,29 @@ const deserializeAws_json1_1PutTargetsResultEntryList = ( output: any, context: __SerdeContext ): PutTargetsResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PutTargetsResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PutTargetsResultEntry(entry, context); + }); }; const deserializeAws_json1_1QueryStringParametersMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1RedshiftDataParameters = (output: any, context: __SerdeContext): RedshiftDataParameters => { @@ -5152,7 +5308,14 @@ const deserializeAws_json1_1RemoveTargetsResultEntryList = ( output: any, context: __SerdeContext ): RemoveTargetsResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RemoveTargetsResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RemoveTargetsResultEntry(entry, context); + }); }; const deserializeAws_json1_1Replay = (output: any, context: __SerdeContext): Replay => { @@ -5196,11 +5359,25 @@ const deserializeAws_json1_1ReplayDestination = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ReplayDestinationFilters = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ReplayList = (output: any, context: __SerdeContext): Replay[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Replay(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Replay(entry, context); + }); }; const deserializeAws_json1_1ResourceAlreadyExistsException = ( @@ -5252,11 +5429,25 @@ const deserializeAws_json1_1Rule = (output: any, context: __SerdeContext): Rule }; const deserializeAws_json1_1RuleNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RuleResponseList = (output: any, context: __SerdeContext): Rule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Rule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Rule(entry, context); + }); }; const deserializeAws_json1_1RunCommandParameters = (output: any, context: __SerdeContext): RunCommandParameters => { @@ -5279,11 +5470,25 @@ const deserializeAws_json1_1RunCommandTarget = (output: any, context: __SerdeCon }; const deserializeAws_json1_1RunCommandTargets = (output: any, context: __SerdeContext): RunCommandTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RunCommandTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RunCommandTarget(entry, context); + }); }; const deserializeAws_json1_1RunCommandTargetValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SqsParameters = (output: any, context: __SerdeContext): SqsParameters => { @@ -5306,7 +5511,14 @@ const deserializeAws_json1_1StartReplayResponse = (output: any, context: __Serde }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -5317,7 +5529,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -5375,7 +5594,14 @@ const deserializeAws_json1_1Target = (output: any, context: __SerdeContext): Tar }; const deserializeAws_json1_1TargetList = (output: any, context: __SerdeContext): Target[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Target(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Target(entry, context); + }); }; const deserializeAws_json1_1TestEventPatternResponse = ( @@ -5388,13 +5614,15 @@ const deserializeAws_json1_1TestEventPatternResponse = ( }; const deserializeAws_json1_1TransformerPaths = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => { @@ -5463,3 +5691,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts index 933cfc3bf51a..a3b8fa0ae248 100644 --- a/clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts @@ -193,7 +193,7 @@ export const serializeAws_json1_1AssociateKmsKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.AssociateKmsKey", }; let body: any; @@ -206,7 +206,7 @@ export const serializeAws_json1_1CancelExportTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.CancelExportTask", }; let body: any; @@ -219,7 +219,7 @@ export const serializeAws_json1_1CreateExportTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.CreateExportTask", }; let body: any; @@ -232,7 +232,7 @@ export const serializeAws_json1_1CreateLogGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.CreateLogGroup", }; let body: any; @@ -245,7 +245,7 @@ export const serializeAws_json1_1CreateLogStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.CreateLogStream", }; let body: any; @@ -258,7 +258,7 @@ export const serializeAws_json1_1DeleteDestinationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DeleteDestination", }; let body: any; @@ -271,7 +271,7 @@ export const serializeAws_json1_1DeleteLogGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DeleteLogGroup", }; let body: any; @@ -284,7 +284,7 @@ export const serializeAws_json1_1DeleteLogStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DeleteLogStream", }; let body: any; @@ -297,7 +297,7 @@ export const serializeAws_json1_1DeleteMetricFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DeleteMetricFilter", }; let body: any; @@ -310,7 +310,7 @@ export const serializeAws_json1_1DeleteQueryDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DeleteQueryDefinition", }; let body: any; @@ -323,7 +323,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DeleteResourcePolicy", }; let body: any; @@ -336,7 +336,7 @@ export const serializeAws_json1_1DeleteRetentionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DeleteRetentionPolicy", }; let body: any; @@ -349,7 +349,7 @@ export const serializeAws_json1_1DeleteSubscriptionFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DeleteSubscriptionFilter", }; let body: any; @@ -362,7 +362,7 @@ export const serializeAws_json1_1DescribeDestinationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DescribeDestinations", }; let body: any; @@ -375,7 +375,7 @@ export const serializeAws_json1_1DescribeExportTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DescribeExportTasks", }; let body: any; @@ -388,7 +388,7 @@ export const serializeAws_json1_1DescribeLogGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DescribeLogGroups", }; let body: any; @@ -401,7 +401,7 @@ export const serializeAws_json1_1DescribeLogStreamsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DescribeLogStreams", }; let body: any; @@ -414,7 +414,7 @@ export const serializeAws_json1_1DescribeMetricFiltersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DescribeMetricFilters", }; let body: any; @@ -427,7 +427,7 @@ export const serializeAws_json1_1DescribeQueriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DescribeQueries", }; let body: any; @@ -440,7 +440,7 @@ export const serializeAws_json1_1DescribeQueryDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DescribeQueryDefinitions", }; let body: any; @@ -453,7 +453,7 @@ export const serializeAws_json1_1DescribeResourcePoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DescribeResourcePolicies", }; let body: any; @@ -466,7 +466,7 @@ export const serializeAws_json1_1DescribeSubscriptionFiltersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DescribeSubscriptionFilters", }; let body: any; @@ -479,7 +479,7 @@ export const serializeAws_json1_1DisassociateKmsKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.DisassociateKmsKey", }; let body: any; @@ -492,7 +492,7 @@ export const serializeAws_json1_1FilterLogEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.FilterLogEvents", }; let body: any; @@ -505,7 +505,7 @@ export const serializeAws_json1_1GetLogEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.GetLogEvents", }; let body: any; @@ -518,7 +518,7 @@ export const serializeAws_json1_1GetLogGroupFieldsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.GetLogGroupFields", }; let body: any; @@ -531,7 +531,7 @@ export const serializeAws_json1_1GetLogRecordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.GetLogRecord", }; let body: any; @@ -544,7 +544,7 @@ export const serializeAws_json1_1GetQueryResultsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.GetQueryResults", }; let body: any; @@ -557,7 +557,7 @@ export const serializeAws_json1_1ListTagsLogGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.ListTagsLogGroup", }; let body: any; @@ -570,7 +570,7 @@ export const serializeAws_json1_1PutDestinationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.PutDestination", }; let body: any; @@ -583,7 +583,7 @@ export const serializeAws_json1_1PutDestinationPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.PutDestinationPolicy", }; let body: any; @@ -596,7 +596,7 @@ export const serializeAws_json1_1PutLogEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.PutLogEvents", }; let body: any; @@ -609,7 +609,7 @@ export const serializeAws_json1_1PutMetricFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.PutMetricFilter", }; let body: any; @@ -622,7 +622,7 @@ export const serializeAws_json1_1PutQueryDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.PutQueryDefinition", }; let body: any; @@ -635,7 +635,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.PutResourcePolicy", }; let body: any; @@ -648,7 +648,7 @@ export const serializeAws_json1_1PutRetentionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.PutRetentionPolicy", }; let body: any; @@ -661,7 +661,7 @@ export const serializeAws_json1_1PutSubscriptionFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.PutSubscriptionFilter", }; let body: any; @@ -674,7 +674,7 @@ export const serializeAws_json1_1StartQueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.StartQuery", }; let body: any; @@ -687,7 +687,7 @@ export const serializeAws_json1_1StopQueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.StopQuery", }; let body: any; @@ -700,7 +700,7 @@ export const serializeAws_json1_1TagLogGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.TagLogGroup", }; let body: any; @@ -713,7 +713,7 @@ export const serializeAws_json1_1TestMetricFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.TestMetricFilter", }; let body: any; @@ -726,7 +726,7 @@ export const serializeAws_json1_1UntagLogGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Logs_20140328.UntagLogGroup", }; let body: any; @@ -758,8 +758,7 @@ const deserializeAws_json1_1AssociateKmsKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -834,8 +833,7 @@ const deserializeAws_json1_1CancelExportTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidOperationException": case "com.amazonaws.cloudwatchlogs#InvalidOperationException": @@ -913,8 +911,7 @@ const deserializeAws_json1_1CreateExportTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1005,8 +1002,7 @@ const deserializeAws_json1_1CreateLogGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1089,8 +1085,7 @@ const deserializeAws_json1_1CreateLogStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1165,8 +1160,7 @@ const deserializeAws_json1_1DeleteDestinationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1241,8 +1235,7 @@ const deserializeAws_json1_1DeleteLogGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1317,8 +1310,7 @@ const deserializeAws_json1_1DeleteLogStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1393,8 +1385,7 @@ const deserializeAws_json1_1DeleteMetricFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1472,8 +1463,7 @@ const deserializeAws_json1_1DeleteQueryDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1540,8 +1530,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1608,8 +1597,7 @@ const deserializeAws_json1_1DeleteRetentionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1684,8 +1672,7 @@ const deserializeAws_json1_1DeleteSubscriptionFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1763,8 +1750,7 @@ const deserializeAws_json1_1DescribeDestinationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1826,8 +1812,7 @@ const deserializeAws_json1_1DescribeExportTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1889,8 +1874,7 @@ const deserializeAws_json1_1DescribeLogGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -1952,8 +1936,7 @@ const deserializeAws_json1_1DescribeLogStreamsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2023,8 +2006,7 @@ const deserializeAws_json1_1DescribeMetricFiltersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2094,8 +2076,7 @@ const deserializeAws_json1_1DescribeQueriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2165,8 +2146,7 @@ const deserializeAws_json1_1DescribeQueryDefinitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2228,8 +2208,7 @@ const deserializeAws_json1_1DescribeResourcePoliciesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2291,8 +2270,7 @@ const deserializeAws_json1_1DescribeSubscriptionFiltersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2359,8 +2337,7 @@ const deserializeAws_json1_1DisassociateKmsKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2438,8 +2415,7 @@ const deserializeAws_json1_1FilterLogEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2509,8 +2485,7 @@ const deserializeAws_json1_1GetLogEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2580,8 +2555,7 @@ const deserializeAws_json1_1GetLogGroupFieldsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2659,8 +2633,7 @@ const deserializeAws_json1_1GetLogRecordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2738,8 +2711,7 @@ const deserializeAws_json1_1GetQueryResultsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2809,8 +2781,7 @@ const deserializeAws_json1_1ListTagsLogGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": @@ -2872,8 +2843,7 @@ const deserializeAws_json1_1PutDestinationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -2940,8 +2910,7 @@ const deserializeAws_json1_1PutDestinationPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3011,8 +2980,7 @@ const deserializeAws_json1_1PutLogEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DataAlreadyAcceptedException": case "com.amazonaws.cloudwatchlogs#DataAlreadyAcceptedException": @@ -3103,8 +3071,7 @@ const deserializeAws_json1_1PutMetricFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3190,8 +3157,7 @@ const deserializeAws_json1_1PutQueryDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3261,8 +3227,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3329,8 +3294,7 @@ const deserializeAws_json1_1PutRetentionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3405,8 +3369,7 @@ const deserializeAws_json1_1PutSubscriptionFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3492,8 +3455,7 @@ const deserializeAws_json1_1StartQueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3579,8 +3541,7 @@ const deserializeAws_json1_1StopQueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3647,8 +3608,7 @@ const deserializeAws_json1_1TagLogGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3710,8 +3670,7 @@ const deserializeAws_json1_1TestMetricFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.cloudwatchlogs#InvalidParameterException": @@ -3770,8 +3729,7 @@ const deserializeAws_json1_1UntagLogGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": @@ -3965,41 +3923,43 @@ const deserializeAws_json1_1UnrecognizedClientExceptionResponse = async ( const serializeAws_json1_1AssociateKmsKeyRequest = (input: AssociateKmsKeyRequest, context: __SerdeContext): any => { return { - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), }; }; const serializeAws_json1_1CancelExportTaskRequest = (input: CancelExportTaskRequest, context: __SerdeContext): any => { return { - ...(input.taskId !== undefined && { taskId: input.taskId }), + ...(input.taskId !== undefined && input.taskId !== null && { taskId: input.taskId }), }; }; const serializeAws_json1_1CreateExportTaskRequest = (input: CreateExportTaskRequest, context: __SerdeContext): any => { return { - ...(input.destination !== undefined && { destination: input.destination }), - ...(input.destinationPrefix !== undefined && { destinationPrefix: input.destinationPrefix }), - ...(input.from !== undefined && { from: input.from }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.logStreamNamePrefix !== undefined && { logStreamNamePrefix: input.logStreamNamePrefix }), - ...(input.taskName !== undefined && { taskName: input.taskName }), - ...(input.to !== undefined && { to: input.to }), + ...(input.destination !== undefined && input.destination !== null && { destination: input.destination }), + ...(input.destinationPrefix !== undefined && + input.destinationPrefix !== null && { destinationPrefix: input.destinationPrefix }), + ...(input.from !== undefined && input.from !== null && { from: input.from }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.logStreamNamePrefix !== undefined && + input.logStreamNamePrefix !== null && { logStreamNamePrefix: input.logStreamNamePrefix }), + ...(input.taskName !== undefined && input.taskName !== null && { taskName: input.taskName }), + ...(input.to !== undefined && input.to !== null && { to: input.to }), }; }; const serializeAws_json1_1CreateLogGroupRequest = (input: CreateLogGroupRequest, context: __SerdeContext): any => { return { - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), }; }; const serializeAws_json1_1CreateLogStreamRequest = (input: CreateLogStreamRequest, context: __SerdeContext): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.logStreamName !== undefined && { logStreamName: input.logStreamName }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.logStreamName !== undefined && input.logStreamName !== null && { logStreamName: input.logStreamName }), }; }; @@ -4008,20 +3968,21 @@ const serializeAws_json1_1DeleteDestinationRequest = ( context: __SerdeContext ): any => { return { - ...(input.destinationName !== undefined && { destinationName: input.destinationName }), + ...(input.destinationName !== undefined && + input.destinationName !== null && { destinationName: input.destinationName }), }; }; const serializeAws_json1_1DeleteLogGroupRequest = (input: DeleteLogGroupRequest, context: __SerdeContext): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), }; }; const serializeAws_json1_1DeleteLogStreamRequest = (input: DeleteLogStreamRequest, context: __SerdeContext): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.logStreamName !== undefined && { logStreamName: input.logStreamName }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.logStreamName !== undefined && input.logStreamName !== null && { logStreamName: input.logStreamName }), }; }; @@ -4030,8 +3991,8 @@ const serializeAws_json1_1DeleteMetricFilterRequest = ( context: __SerdeContext ): any => { return { - ...(input.filterName !== undefined && { filterName: input.filterName }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), + ...(input.filterName !== undefined && input.filterName !== null && { filterName: input.filterName }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), }; }; @@ -4040,7 +4001,8 @@ const serializeAws_json1_1DeleteQueryDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.queryDefinitionId !== undefined && { queryDefinitionId: input.queryDefinitionId }), + ...(input.queryDefinitionId !== undefined && + input.queryDefinitionId !== null && { queryDefinitionId: input.queryDefinitionId }), }; }; @@ -4049,7 +4011,7 @@ const serializeAws_json1_1DeleteResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.policyName !== undefined && { policyName: input.policyName }), + ...(input.policyName !== undefined && input.policyName !== null && { policyName: input.policyName }), }; }; @@ -4058,7 +4020,7 @@ const serializeAws_json1_1DeleteRetentionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), }; }; @@ -4067,8 +4029,8 @@ const serializeAws_json1_1DeleteSubscriptionFilterRequest = ( context: __SerdeContext ): any => { return { - ...(input.filterName !== undefined && { filterName: input.filterName }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), + ...(input.filterName !== undefined && input.filterName !== null && { filterName: input.filterName }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), }; }; @@ -4077,9 +4039,10 @@ const serializeAws_json1_1DescribeDestinationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DestinationNamePrefix !== undefined && { DestinationNamePrefix: input.DestinationNamePrefix }), - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.DestinationNamePrefix !== undefined && + input.DestinationNamePrefix !== null && { DestinationNamePrefix: input.DestinationNamePrefix }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4088,10 +4051,10 @@ const serializeAws_json1_1DescribeExportTasksRequest = ( context: __SerdeContext ): any => { return { - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.statusCode !== undefined && { statusCode: input.statusCode }), - ...(input.taskId !== undefined && { taskId: input.taskId }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.statusCode !== undefined && input.statusCode !== null && { statusCode: input.statusCode }), + ...(input.taskId !== undefined && input.taskId !== null && { taskId: input.taskId }), }; }; @@ -4100,9 +4063,10 @@ const serializeAws_json1_1DescribeLogGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.logGroupNamePrefix !== undefined && { logGroupNamePrefix: input.logGroupNamePrefix }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.logGroupNamePrefix !== undefined && + input.logGroupNamePrefix !== null && { logGroupNamePrefix: input.logGroupNamePrefix }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4111,12 +4075,13 @@ const serializeAws_json1_1DescribeLogStreamsRequest = ( context: __SerdeContext ): any => { return { - ...(input.descending !== undefined && { descending: input.descending }), - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.logStreamNamePrefix !== undefined && { logStreamNamePrefix: input.logStreamNamePrefix }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.orderBy !== undefined && { orderBy: input.orderBy }), + ...(input.descending !== undefined && input.descending !== null && { descending: input.descending }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.logStreamNamePrefix !== undefined && + input.logStreamNamePrefix !== null && { logStreamNamePrefix: input.logStreamNamePrefix }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.orderBy !== undefined && input.orderBy !== null && { orderBy: input.orderBy }), }; }; @@ -4125,21 +4090,23 @@ const serializeAws_json1_1DescribeMetricFiltersRequest = ( context: __SerdeContext ): any => { return { - ...(input.filterNamePrefix !== undefined && { filterNamePrefix: input.filterNamePrefix }), - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.metricNamespace !== undefined && { metricNamespace: input.metricNamespace }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filterNamePrefix !== undefined && + input.filterNamePrefix !== null && { filterNamePrefix: input.filterNamePrefix }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.metricNamespace !== undefined && + input.metricNamespace !== null && { metricNamespace: input.metricNamespace }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1DescribeQueriesRequest = (input: DescribeQueriesRequest, context: __SerdeContext): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.status !== undefined && { status: input.status }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; @@ -4148,11 +4115,10 @@ const serializeAws_json1_1DescribeQueryDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.queryDefinitionNamePrefix !== undefined && { - queryDefinitionNamePrefix: input.queryDefinitionNamePrefix, - }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.queryDefinitionNamePrefix !== undefined && + input.queryDefinitionNamePrefix !== null && { queryDefinitionNamePrefix: input.queryDefinitionNamePrefix }), }; }; @@ -4161,8 +4127,8 @@ const serializeAws_json1_1DescribeResourcePoliciesRequest = ( context: __SerdeContext ): any => { return { - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4171,10 +4137,11 @@ const serializeAws_json1_1DescribeSubscriptionFiltersRequest = ( context: __SerdeContext ): any => { return { - ...(input.filterNamePrefix !== undefined && { filterNamePrefix: input.filterNamePrefix }), - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filterNamePrefix !== undefined && + input.filterNamePrefix !== null && { filterNamePrefix: input.filterNamePrefix }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4183,35 +4150,37 @@ const serializeAws_json1_1DisassociateKmsKeyRequest = ( context: __SerdeContext ): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), }; }; const serializeAws_json1_1FilterLogEventsRequest = (input: FilterLogEventsRequest, context: __SerdeContext): any => { return { - ...(input.endTime !== undefined && { endTime: input.endTime }), - ...(input.filterPattern !== undefined && { filterPattern: input.filterPattern }), - ...(input.interleaved !== undefined && { interleaved: input.interleaved }), - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.logStreamNamePrefix !== undefined && { logStreamNamePrefix: input.logStreamNamePrefix }), - ...(input.logStreamNames !== undefined && { - logStreamNames: serializeAws_json1_1InputLogStreamNames(input.logStreamNames, context), - }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.startTime !== undefined && { startTime: input.startTime }), + ...(input.endTime !== undefined && input.endTime !== null && { endTime: input.endTime }), + ...(input.filterPattern !== undefined && input.filterPattern !== null && { filterPattern: input.filterPattern }), + ...(input.interleaved !== undefined && input.interleaved !== null && { interleaved: input.interleaved }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.logStreamNamePrefix !== undefined && + input.logStreamNamePrefix !== null && { logStreamNamePrefix: input.logStreamNamePrefix }), + ...(input.logStreamNames !== undefined && + input.logStreamNames !== null && { + logStreamNames: serializeAws_json1_1InputLogStreamNames(input.logStreamNames, context), + }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.startTime !== undefined && input.startTime !== null && { startTime: input.startTime }), }; }; const serializeAws_json1_1GetLogEventsRequest = (input: GetLogEventsRequest, context: __SerdeContext): any => { return { - ...(input.endTime !== undefined && { endTime: input.endTime }), - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.logStreamName !== undefined && { logStreamName: input.logStreamName }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.startFromHead !== undefined && { startFromHead: input.startFromHead }), - ...(input.startTime !== undefined && { startTime: input.startTime }), + ...(input.endTime !== undefined && input.endTime !== null && { endTime: input.endTime }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.logStreamName !== undefined && input.logStreamName !== null && { logStreamName: input.logStreamName }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.startFromHead !== undefined && input.startFromHead !== null && { startFromHead: input.startFromHead }), + ...(input.startTime !== undefined && input.startTime !== null && { startTime: input.startTime }), }; }; @@ -4220,59 +4189,89 @@ const serializeAws_json1_1GetLogGroupFieldsRequest = ( context: __SerdeContext ): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.time !== undefined && { time: input.time }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.time !== undefined && input.time !== null && { time: input.time }), }; }; const serializeAws_json1_1GetLogRecordRequest = (input: GetLogRecordRequest, context: __SerdeContext): any => { return { - ...(input.logRecordPointer !== undefined && { logRecordPointer: input.logRecordPointer }), + ...(input.logRecordPointer !== undefined && + input.logRecordPointer !== null && { logRecordPointer: input.logRecordPointer }), }; }; const serializeAws_json1_1GetQueryResultsRequest = (input: GetQueryResultsRequest, context: __SerdeContext): any => { return { - ...(input.queryId !== undefined && { queryId: input.queryId }), + ...(input.queryId !== undefined && input.queryId !== null && { queryId: input.queryId }), }; }; const serializeAws_json1_1InputLogEvent = (input: InputLogEvent, context: __SerdeContext): any => { return { - ...(input.message !== undefined && { message: input.message }), - ...(input.timestamp !== undefined && { timestamp: input.timestamp }), + ...(input.message !== undefined && input.message !== null && { message: input.message }), + ...(input.timestamp !== undefined && input.timestamp !== null && { timestamp: input.timestamp }), }; }; const serializeAws_json1_1InputLogEvents = (input: InputLogEvent[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InputLogEvent(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InputLogEvent(entry, context); + }); }; const serializeAws_json1_1InputLogStreamNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListTagsLogGroupRequest = (input: ListTagsLogGroupRequest, context: __SerdeContext): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), }; }; const serializeAws_json1_1LogGroupNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MetricTransformation = (input: MetricTransformation, context: __SerdeContext): any => { return { - ...(input.defaultValue !== undefined && { defaultValue: input.defaultValue }), - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.metricNamespace !== undefined && { metricNamespace: input.metricNamespace }), - ...(input.metricValue !== undefined && { metricValue: input.metricValue }), + ...(input.defaultValue !== undefined && input.defaultValue !== null && { defaultValue: input.defaultValue }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.metricNamespace !== undefined && + input.metricNamespace !== null && { metricNamespace: input.metricNamespace }), + ...(input.metricValue !== undefined && input.metricValue !== null && { metricValue: input.metricValue }), }; }; const serializeAws_json1_1MetricTransformations = (input: MetricTransformation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MetricTransformation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MetricTransformation(entry, context); + }); }; const serializeAws_json1_1PutDestinationPolicyRequest = ( @@ -4280,36 +4279,40 @@ const serializeAws_json1_1PutDestinationPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.accessPolicy !== undefined && { accessPolicy: input.accessPolicy }), - ...(input.destinationName !== undefined && { destinationName: input.destinationName }), + ...(input.accessPolicy !== undefined && input.accessPolicy !== null && { accessPolicy: input.accessPolicy }), + ...(input.destinationName !== undefined && + input.destinationName !== null && { destinationName: input.destinationName }), }; }; const serializeAws_json1_1PutDestinationRequest = (input: PutDestinationRequest, context: __SerdeContext): any => { return { - ...(input.destinationName !== undefined && { destinationName: input.destinationName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.targetArn !== undefined && { targetArn: input.targetArn }), + ...(input.destinationName !== undefined && + input.destinationName !== null && { destinationName: input.destinationName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.targetArn !== undefined && input.targetArn !== null && { targetArn: input.targetArn }), }; }; const serializeAws_json1_1PutLogEventsRequest = (input: PutLogEventsRequest, context: __SerdeContext): any => { return { - ...(input.logEvents !== undefined && { logEvents: serializeAws_json1_1InputLogEvents(input.logEvents, context) }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.logStreamName !== undefined && { logStreamName: input.logStreamName }), - ...(input.sequenceToken !== undefined && { sequenceToken: input.sequenceToken }), + ...(input.logEvents !== undefined && + input.logEvents !== null && { logEvents: serializeAws_json1_1InputLogEvents(input.logEvents, context) }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.logStreamName !== undefined && input.logStreamName !== null && { logStreamName: input.logStreamName }), + ...(input.sequenceToken !== undefined && input.sequenceToken !== null && { sequenceToken: input.sequenceToken }), }; }; const serializeAws_json1_1PutMetricFilterRequest = (input: PutMetricFilterRequest, context: __SerdeContext): any => { return { - ...(input.filterName !== undefined && { filterName: input.filterName }), - ...(input.filterPattern !== undefined && { filterPattern: input.filterPattern }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.metricTransformations !== undefined && { - metricTransformations: serializeAws_json1_1MetricTransformations(input.metricTransformations, context), - }), + ...(input.filterName !== undefined && input.filterName !== null && { filterName: input.filterName }), + ...(input.filterPattern !== undefined && input.filterPattern !== null && { filterPattern: input.filterPattern }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.metricTransformations !== undefined && + input.metricTransformations !== null && { + metricTransformations: serializeAws_json1_1MetricTransformations(input.metricTransformations, context), + }), }; }; @@ -4318,12 +4321,14 @@ const serializeAws_json1_1PutQueryDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.logGroupNames !== undefined && { - logGroupNames: serializeAws_json1_1LogGroupNames(input.logGroupNames, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.queryDefinitionId !== undefined && { queryDefinitionId: input.queryDefinitionId }), - ...(input.queryString !== undefined && { queryString: input.queryString }), + ...(input.logGroupNames !== undefined && + input.logGroupNames !== null && { + logGroupNames: serializeAws_json1_1LogGroupNames(input.logGroupNames, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.queryDefinitionId !== undefined && + input.queryDefinitionId !== null && { queryDefinitionId: input.queryDefinitionId }), + ...(input.queryString !== undefined && input.queryString !== null && { queryString: input.queryString }), }; }; @@ -4332,8 +4337,9 @@ const serializeAws_json1_1PutResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.policyDocument !== undefined && { policyDocument: input.policyDocument }), - ...(input.policyName !== undefined && { policyName: input.policyName }), + ...(input.policyDocument !== undefined && + input.policyDocument !== null && { policyDocument: input.policyDocument }), + ...(input.policyName !== undefined && input.policyName !== null && { policyName: input.policyName }), }; }; @@ -4342,8 +4348,9 @@ const serializeAws_json1_1PutRetentionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.retentionInDays !== undefined && { retentionInDays: input.retentionInDays }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.retentionInDays !== undefined && + input.retentionInDays !== null && { retentionInDays: input.retentionInDays }), }; }; @@ -4352,72 +4359,91 @@ const serializeAws_json1_1PutSubscriptionFilterRequest = ( context: __SerdeContext ): any => { return { - ...(input.destinationArn !== undefined && { destinationArn: input.destinationArn }), - ...(input.distribution !== undefined && { distribution: input.distribution }), - ...(input.filterName !== undefined && { filterName: input.filterName }), - ...(input.filterPattern !== undefined && { filterPattern: input.filterPattern }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.destinationArn !== undefined && + input.destinationArn !== null && { destinationArn: input.destinationArn }), + ...(input.distribution !== undefined && input.distribution !== null && { distribution: input.distribution }), + ...(input.filterName !== undefined && input.filterName !== null && { filterName: input.filterName }), + ...(input.filterPattern !== undefined && input.filterPattern !== null && { filterPattern: input.filterPattern }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_json1_1StartQueryRequest = (input: StartQueryRequest, context: __SerdeContext): any => { return { - ...(input.endTime !== undefined && { endTime: input.endTime }), - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.logGroupNames !== undefined && { - logGroupNames: serializeAws_json1_1LogGroupNames(input.logGroupNames, context), - }), - ...(input.queryString !== undefined && { queryString: input.queryString }), - ...(input.startTime !== undefined && { startTime: input.startTime }), + ...(input.endTime !== undefined && input.endTime !== null && { endTime: input.endTime }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.logGroupNames !== undefined && + input.logGroupNames !== null && { + logGroupNames: serializeAws_json1_1LogGroupNames(input.logGroupNames, context), + }), + ...(input.queryString !== undefined && input.queryString !== null && { queryString: input.queryString }), + ...(input.startTime !== undefined && input.startTime !== null && { startTime: input.startTime }), }; }; const serializeAws_json1_1StopQueryRequest = (input: StopQueryRequest, context: __SerdeContext): any => { return { - ...(input.queryId !== undefined && { queryId: input.queryId }), + ...(input.queryId !== undefined && input.queryId !== null && { queryId: input.queryId }), }; }; const serializeAws_json1_1TagList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagLogGroupRequest = (input: TagLogGroupRequest, context: __SerdeContext): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), }; }; const serializeAws_json1_1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1TestEventMessages = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TestMetricFilterRequest = (input: TestMetricFilterRequest, context: __SerdeContext): any => { return { - ...(input.filterPattern !== undefined && { filterPattern: input.filterPattern }), - ...(input.logEventMessages !== undefined && { - logEventMessages: serializeAws_json1_1TestEventMessages(input.logEventMessages, context), - }), + ...(input.filterPattern !== undefined && input.filterPattern !== null && { filterPattern: input.filterPattern }), + ...(input.logEventMessages !== undefined && + input.logEventMessages !== null && { + logEventMessages: serializeAws_json1_1TestEventMessages(input.logEventMessages, context), + }), }; }; const serializeAws_json1_1UntagLogGroupRequest = (input: UntagLogGroupRequest, context: __SerdeContext): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -4582,7 +4608,14 @@ const deserializeAws_json1_1Destination = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1Destinations = (output: any, context: __SerdeContext): Destination[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Destination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Destination(entry, context); + }); }; const deserializeAws_json1_1ExportTask = (output: any, context: __SerdeContext): ExportTask => { @@ -4620,7 +4653,14 @@ const deserializeAws_json1_1ExportTaskExecutionInfo = ( }; const deserializeAws_json1_1ExportTasks = (output: any, context: __SerdeContext): ExportTask[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExportTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExportTask(entry, context); + }); }; const deserializeAws_json1_1ExportTaskStatus = (output: any, context: __SerdeContext): ExportTaskStatus => { @@ -4631,13 +4671,15 @@ const deserializeAws_json1_1ExportTaskStatus = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ExtractedValues = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1FilteredLogEvent = (output: any, context: __SerdeContext): FilteredLogEvent => { @@ -4653,7 +4695,14 @@ const deserializeAws_json1_1FilteredLogEvent = (output: any, context: __SerdeCon }; const deserializeAws_json1_1FilteredLogEvents = (output: any, context: __SerdeContext): FilteredLogEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FilteredLogEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FilteredLogEvent(entry, context); + }); }; const deserializeAws_json1_1FilterLogEventsResponse = ( @@ -4797,25 +4846,48 @@ const deserializeAws_json1_1LogGroupField = (output: any, context: __SerdeContex }; const deserializeAws_json1_1LogGroupFieldList = (output: any, context: __SerdeContext): LogGroupField[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LogGroupField(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LogGroupField(entry, context); + }); }; const deserializeAws_json1_1LogGroupNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1LogGroups = (output: any, context: __SerdeContext): LogGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LogGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LogGroup(entry, context); + }); }; const deserializeAws_json1_1LogRecord = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1LogStream = (output: any, context: __SerdeContext): LogStream => { @@ -4845,7 +4917,14 @@ const deserializeAws_json1_1LogStream = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1LogStreams = (output: any, context: __SerdeContext): LogStream[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LogStream(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LogStream(entry, context); + }); }; const deserializeAws_json1_1MalformedQueryException = ( @@ -4876,7 +4955,14 @@ const deserializeAws_json1_1MetricFilter = (output: any, context: __SerdeContext }; const deserializeAws_json1_1MetricFilterMatches = (output: any, context: __SerdeContext): MetricFilterMatchRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricFilterMatchRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricFilterMatchRecord(entry, context); + }); }; const deserializeAws_json1_1MetricFilterMatchRecord = ( @@ -4894,7 +4980,14 @@ const deserializeAws_json1_1MetricFilterMatchRecord = ( }; const deserializeAws_json1_1MetricFilters = (output: any, context: __SerdeContext): MetricFilter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricFilter(entry, context); + }); }; const deserializeAws_json1_1MetricTransformation = (output: any, context: __SerdeContext): MetricTransformation => { @@ -4908,7 +5001,14 @@ const deserializeAws_json1_1MetricTransformation = (output: any, context: __Serd }; const deserializeAws_json1_1MetricTransformations = (output: any, context: __SerdeContext): MetricTransformation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricTransformation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricTransformation(entry, context); + }); }; const deserializeAws_json1_1OperationAbortedException = ( @@ -4930,7 +5030,14 @@ const deserializeAws_json1_1OutputLogEvent = (output: any, context: __SerdeConte }; const deserializeAws_json1_1OutputLogEvents = (output: any, context: __SerdeContext): OutputLogEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OutputLogEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OutputLogEvent(entry, context); + }); }; const deserializeAws_json1_1PutDestinationResponse = (output: any, context: __SerdeContext): PutDestinationResponse => { @@ -5018,7 +5125,14 @@ const deserializeAws_json1_1QueryDefinition = (output: any, context: __SerdeCont }; const deserializeAws_json1_1QueryDefinitionList = (output: any, context: __SerdeContext): QueryDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1QueryDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1QueryDefinition(entry, context); + }); }; const deserializeAws_json1_1QueryInfo = (output: any, context: __SerdeContext): QueryInfo => { @@ -5032,11 +5146,25 @@ const deserializeAws_json1_1QueryInfo = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1QueryInfoList = (output: any, context: __SerdeContext): QueryInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1QueryInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1QueryInfo(entry, context); + }); }; const deserializeAws_json1_1QueryResults = (output: any, context: __SerdeContext): ResultField[][] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResultRows(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResultRows(entry, context); + }); }; const deserializeAws_json1_1QueryStatistics = (output: any, context: __SerdeContext): QueryStatistics => { @@ -5085,7 +5213,14 @@ const deserializeAws_json1_1ResourceNotFoundException = ( }; const deserializeAws_json1_1ResourcePolicies = (output: any, context: __SerdeContext): ResourcePolicy[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourcePolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourcePolicy(entry, context); + }); }; const deserializeAws_json1_1ResourcePolicy = (output: any, context: __SerdeContext): ResourcePolicy => { @@ -5106,7 +5241,14 @@ const deserializeAws_json1_1ResultField = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ResultRows = (output: any, context: __SerdeContext): ResultField[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResultField(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResultField(entry, context); + }); }; const deserializeAws_json1_1SearchedLogStream = (output: any, context: __SerdeContext): SearchedLogStream => { @@ -5121,7 +5263,14 @@ const deserializeAws_json1_1SearchedLogStream = (output: any, context: __SerdeCo }; const deserializeAws_json1_1SearchedLogStreams = (output: any, context: __SerdeContext): SearchedLogStream[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SearchedLogStream(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SearchedLogStream(entry, context); + }); }; const deserializeAws_json1_1ServiceUnavailableException = ( @@ -5160,17 +5309,26 @@ const deserializeAws_json1_1SubscriptionFilter = (output: any, context: __SerdeC }; const deserializeAws_json1_1SubscriptionFilters = (output: any, context: __SerdeContext): SubscriptionFilter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SubscriptionFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SubscriptionFilter(entry, context); + }); }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1TestMetricFilterResponse = ( @@ -5244,3 +5402,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-cloudwatch/protocols/Aws_query.ts b/clients/client-cloudwatch/protocols/Aws_query.ts index bc8f66a34af1..b6a7badd4cf1 100644 --- a/clients/client-cloudwatch/protocols/Aws_query.ts +++ b/clients/client-cloudwatch/protocols/Aws_query.ts @@ -176,7 +176,7 @@ export const serializeAws_queryDeleteAlarmsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -192,7 +192,7 @@ export const serializeAws_queryDeleteAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -208,7 +208,7 @@ export const serializeAws_queryDeleteDashboardsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -224,7 +224,7 @@ export const serializeAws_queryDeleteInsightRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -240,7 +240,7 @@ export const serializeAws_queryDescribeAlarmHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -256,7 +256,7 @@ export const serializeAws_queryDescribeAlarmsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -272,7 +272,7 @@ export const serializeAws_queryDescribeAlarmsForMetricCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -288,7 +288,7 @@ export const serializeAws_queryDescribeAnomalyDetectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -304,7 +304,7 @@ export const serializeAws_queryDescribeInsightRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -320,7 +320,7 @@ export const serializeAws_queryDisableAlarmActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -336,7 +336,7 @@ export const serializeAws_queryDisableInsightRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -352,7 +352,7 @@ export const serializeAws_queryEnableAlarmActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -368,7 +368,7 @@ export const serializeAws_queryEnableInsightRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -384,7 +384,7 @@ export const serializeAws_queryGetDashboardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -400,7 +400,7 @@ export const serializeAws_queryGetInsightRuleReportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -416,7 +416,7 @@ export const serializeAws_queryGetMetricDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -432,7 +432,7 @@ export const serializeAws_queryGetMetricStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -448,7 +448,7 @@ export const serializeAws_queryGetMetricWidgetImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -464,7 +464,7 @@ export const serializeAws_queryListDashboardsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -480,7 +480,7 @@ export const serializeAws_queryListMetricsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -496,7 +496,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -512,7 +512,7 @@ export const serializeAws_queryPutAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -528,7 +528,7 @@ export const serializeAws_queryPutCompositeAlarmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -544,7 +544,7 @@ export const serializeAws_queryPutDashboardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -560,7 +560,7 @@ export const serializeAws_queryPutInsightRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -576,7 +576,7 @@ export const serializeAws_queryPutMetricAlarmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -592,7 +592,7 @@ export const serializeAws_queryPutMetricDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -608,7 +608,7 @@ export const serializeAws_querySetAlarmStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -624,7 +624,7 @@ export const serializeAws_queryTagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -640,7 +640,7 @@ export const serializeAws_queryUntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2721,6 +2721,9 @@ const serializeAws_queryAlarmNames = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -2731,6 +2734,9 @@ const serializeAws_queryAlarmTypes = (input: (AlarmType | string)[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -2742,14 +2748,14 @@ const serializeAws_queryAnomalyDetectorConfiguration = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ExcludedTimeRanges !== undefined) { + if (input.ExcludedTimeRanges !== undefined && input.ExcludedTimeRanges !== null) { const memberEntries = serializeAws_queryAnomalyDetectorExcludedTimeRanges(input.ExcludedTimeRanges, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExcludedTimeRanges.${key}`; entries[loc] = value; }); } - if (input.MetricTimezone !== undefined) { + if (input.MetricTimezone !== undefined && input.MetricTimezone !== null) { entries["MetricTimezone"] = input.MetricTimezone; } return entries; @@ -2759,6 +2765,9 @@ const serializeAws_queryAnomalyDetectorExcludedTimeRanges = (input: Range[], con const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryRange(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -2772,6 +2781,9 @@ const serializeAws_queryCounts = (input: number[], context: __SerdeContext): any const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -2782,6 +2794,9 @@ const serializeAws_queryDashboardNames = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -2790,7 +2805,7 @@ const serializeAws_queryDashboardNames = (input: string[], context: __SerdeConte const serializeAws_queryDeleteAlarmsInput = (input: DeleteAlarmsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.AlarmNames !== undefined) { + if (input.AlarmNames !== undefined && input.AlarmNames !== null) { const memberEntries = serializeAws_queryAlarmNames(input.AlarmNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlarmNames.${key}`; @@ -2805,20 +2820,20 @@ const serializeAws_queryDeleteAnomalyDetectorInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryDimensions(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; entries[loc] = value; }); } - if (input.Stat !== undefined) { + if (input.Stat !== undefined && input.Stat !== null) { entries["Stat"] = input.Stat; } return entries; @@ -2826,7 +2841,7 @@ const serializeAws_queryDeleteAnomalyDetectorInput = ( const serializeAws_queryDeleteDashboardsInput = (input: DeleteDashboardsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.DashboardNames !== undefined) { + if (input.DashboardNames !== undefined && input.DashboardNames !== null) { const memberEntries = serializeAws_queryDashboardNames(input.DashboardNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DashboardNames.${key}`; @@ -2838,7 +2853,7 @@ const serializeAws_queryDeleteDashboardsInput = (input: DeleteDashboardsInput, c const serializeAws_queryDeleteInsightRulesInput = (input: DeleteInsightRulesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.RuleNames !== undefined) { + if (input.RuleNames !== undefined && input.RuleNames !== null) { const memberEntries = serializeAws_queryInsightRuleNames(input.RuleNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RuleNames.${key}`; @@ -2853,32 +2868,32 @@ const serializeAws_queryDescribeAlarmHistoryInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AlarmName !== undefined) { + if (input.AlarmName !== undefined && input.AlarmName !== null) { entries["AlarmName"] = input.AlarmName; } - if (input.AlarmTypes !== undefined) { + if (input.AlarmTypes !== undefined && input.AlarmTypes !== null) { const memberEntries = serializeAws_queryAlarmTypes(input.AlarmTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlarmTypes.${key}`; entries[loc] = value; }); } - if (input.HistoryItemType !== undefined) { + if (input.HistoryItemType !== undefined && input.HistoryItemType !== null) { entries["HistoryItemType"] = input.HistoryItemType; } - if (input.StartDate !== undefined) { + if (input.StartDate !== undefined && input.StartDate !== null) { entries["StartDate"] = input.StartDate.toISOString().split(".")[0] + "Z"; } - if (input.EndDate !== undefined) { + if (input.EndDate !== undefined && input.EndDate !== null) { entries["EndDate"] = input.EndDate.toISOString().split(".")[0] + "Z"; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.ScanBy !== undefined) { + if (input.ScanBy !== undefined && input.ScanBy !== null) { entries["ScanBy"] = input.ScanBy; } return entries; @@ -2889,29 +2904,29 @@ const serializeAws_queryDescribeAlarmsForMetricInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.Statistic !== undefined) { + if (input.Statistic !== undefined && input.Statistic !== null) { entries["Statistic"] = input.Statistic; } - if (input.ExtendedStatistic !== undefined) { + if (input.ExtendedStatistic !== undefined && input.ExtendedStatistic !== null) { entries["ExtendedStatistic"] = input.ExtendedStatistic; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryDimensions(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; entries[loc] = value; }); } - if (input.Period !== undefined) { + if (input.Period !== undefined && input.Period !== null) { entries["Period"] = input.Period; } - if (input.Unit !== undefined) { + if (input.Unit !== undefined && input.Unit !== null) { entries["Unit"] = input.Unit; } return entries; @@ -2919,39 +2934,39 @@ const serializeAws_queryDescribeAlarmsForMetricInput = ( const serializeAws_queryDescribeAlarmsInput = (input: DescribeAlarmsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.AlarmNames !== undefined) { + if (input.AlarmNames !== undefined && input.AlarmNames !== null) { const memberEntries = serializeAws_queryAlarmNames(input.AlarmNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlarmNames.${key}`; entries[loc] = value; }); } - if (input.AlarmNamePrefix !== undefined) { + if (input.AlarmNamePrefix !== undefined && input.AlarmNamePrefix !== null) { entries["AlarmNamePrefix"] = input.AlarmNamePrefix; } - if (input.AlarmTypes !== undefined) { + if (input.AlarmTypes !== undefined && input.AlarmTypes !== null) { const memberEntries = serializeAws_queryAlarmTypes(input.AlarmTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlarmTypes.${key}`; entries[loc] = value; }); } - if (input.ChildrenOfAlarmName !== undefined) { + if (input.ChildrenOfAlarmName !== undefined && input.ChildrenOfAlarmName !== null) { entries["ChildrenOfAlarmName"] = input.ChildrenOfAlarmName; } - if (input.ParentsOfAlarmName !== undefined) { + if (input.ParentsOfAlarmName !== undefined && input.ParentsOfAlarmName !== null) { entries["ParentsOfAlarmName"] = input.ParentsOfAlarmName; } - if (input.StateValue !== undefined) { + if (input.StateValue !== undefined && input.StateValue !== null) { entries["StateValue"] = input.StateValue; } - if (input.ActionPrefix !== undefined) { + if (input.ActionPrefix !== undefined && input.ActionPrefix !== null) { entries["ActionPrefix"] = input.ActionPrefix; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -2962,19 +2977,19 @@ const serializeAws_queryDescribeAnomalyDetectorsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryDimensions(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; @@ -2989,10 +3004,10 @@ const serializeAws_queryDescribeInsightRulesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -3000,10 +3015,10 @@ const serializeAws_queryDescribeInsightRulesInput = ( const serializeAws_queryDimension = (input: Dimension, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -3011,10 +3026,10 @@ const serializeAws_queryDimension = (input: Dimension, context: __SerdeContext): const serializeAws_queryDimensionFilter = (input: DimensionFilter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -3024,6 +3039,9 @@ const serializeAws_queryDimensionFilters = (input: DimensionFilter[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryDimensionFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3037,6 +3055,9 @@ const serializeAws_queryDimensions = (input: Dimension[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryDimension(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3048,7 +3069,7 @@ const serializeAws_queryDimensions = (input: Dimension[], context: __SerdeContex const serializeAws_queryDisableAlarmActionsInput = (input: DisableAlarmActionsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.AlarmNames !== undefined) { + if (input.AlarmNames !== undefined && input.AlarmNames !== null) { const memberEntries = serializeAws_queryAlarmNames(input.AlarmNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlarmNames.${key}`; @@ -3060,7 +3081,7 @@ const serializeAws_queryDisableAlarmActionsInput = (input: DisableAlarmActionsIn const serializeAws_queryDisableInsightRulesInput = (input: DisableInsightRulesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.RuleNames !== undefined) { + if (input.RuleNames !== undefined && input.RuleNames !== null) { const memberEntries = serializeAws_queryInsightRuleNames(input.RuleNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RuleNames.${key}`; @@ -3072,7 +3093,7 @@ const serializeAws_queryDisableInsightRulesInput = (input: DisableInsightRulesIn const serializeAws_queryEnableAlarmActionsInput = (input: EnableAlarmActionsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.AlarmNames !== undefined) { + if (input.AlarmNames !== undefined && input.AlarmNames !== null) { const memberEntries = serializeAws_queryAlarmNames(input.AlarmNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlarmNames.${key}`; @@ -3084,7 +3105,7 @@ const serializeAws_queryEnableAlarmActionsInput = (input: EnableAlarmActionsInpu const serializeAws_queryEnableInsightRulesInput = (input: EnableInsightRulesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.RuleNames !== undefined) { + if (input.RuleNames !== undefined && input.RuleNames !== null) { const memberEntries = serializeAws_queryInsightRuleNames(input.RuleNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RuleNames.${key}`; @@ -3098,6 +3119,9 @@ const serializeAws_queryExtendedStatistics = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3106,7 +3130,7 @@ const serializeAws_queryExtendedStatistics = (input: string[], context: __SerdeC const serializeAws_queryGetDashboardInput = (input: GetDashboardInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.DashboardName !== undefined) { + if (input.DashboardName !== undefined && input.DashboardName !== null) { entries["DashboardName"] = input.DashboardName; } return entries; @@ -3117,29 +3141,29 @@ const serializeAws_queryGetInsightRuleReportInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RuleName !== undefined) { + if (input.RuleName !== undefined && input.RuleName !== null) { entries["RuleName"] = input.RuleName; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Period !== undefined) { + if (input.Period !== undefined && input.Period !== null) { entries["Period"] = input.Period; } - if (input.MaxContributorCount !== undefined) { + if (input.MaxContributorCount !== undefined && input.MaxContributorCount !== null) { entries["MaxContributorCount"] = input.MaxContributorCount; } - if (input.Metrics !== undefined) { + if (input.Metrics !== undefined && input.Metrics !== null) { const memberEntries = serializeAws_queryInsightRuleMetricList(input.Metrics, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Metrics.${key}`; entries[loc] = value; }); } - if (input.OrderBy !== undefined) { + if (input.OrderBy !== undefined && input.OrderBy !== null) { entries["OrderBy"] = input.OrderBy; } return entries; @@ -3147,26 +3171,26 @@ const serializeAws_queryGetInsightRuleReportInput = ( const serializeAws_queryGetMetricDataInput = (input: GetMetricDataInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.MetricDataQueries !== undefined) { + if (input.MetricDataQueries !== undefined && input.MetricDataQueries !== null) { const memberEntries = serializeAws_queryMetricDataQueries(input.MetricDataQueries, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MetricDataQueries.${key}`; entries[loc] = value; }); } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.ScanBy !== undefined) { + if (input.ScanBy !== undefined && input.ScanBy !== null) { entries["ScanBy"] = input.ScanBy; } - if (input.MaxDatapoints !== undefined) { + if (input.MaxDatapoints !== undefined && input.MaxDatapoints !== null) { entries["MaxDatapoints"] = input.MaxDatapoints; } return entries; @@ -3174,43 +3198,43 @@ const serializeAws_queryGetMetricDataInput = (input: GetMetricDataInput, context const serializeAws_queryGetMetricStatisticsInput = (input: GetMetricStatisticsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryDimensions(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; entries[loc] = value; }); } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Period !== undefined) { + if (input.Period !== undefined && input.Period !== null) { entries["Period"] = input.Period; } - if (input.Statistics !== undefined) { + if (input.Statistics !== undefined && input.Statistics !== null) { const memberEntries = serializeAws_queryStatistics(input.Statistics, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Statistics.${key}`; entries[loc] = value; }); } - if (input.ExtendedStatistics !== undefined) { + if (input.ExtendedStatistics !== undefined && input.ExtendedStatistics !== null) { const memberEntries = serializeAws_queryExtendedStatistics(input.ExtendedStatistics, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExtendedStatistics.${key}`; entries[loc] = value; }); } - if (input.Unit !== undefined) { + if (input.Unit !== undefined && input.Unit !== null) { entries["Unit"] = input.Unit; } return entries; @@ -3221,10 +3245,10 @@ const serializeAws_queryGetMetricWidgetImageInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MetricWidget !== undefined) { + if (input.MetricWidget !== undefined && input.MetricWidget !== null) { entries["MetricWidget"] = input.MetricWidget; } - if (input.OutputFormat !== undefined) { + if (input.OutputFormat !== undefined && input.OutputFormat !== null) { entries["OutputFormat"] = input.OutputFormat; } return entries; @@ -3234,6 +3258,9 @@ const serializeAws_queryInsightRuleMetricList = (input: string[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3244,6 +3271,9 @@ const serializeAws_queryInsightRuleNames = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3252,10 +3282,10 @@ const serializeAws_queryInsightRuleNames = (input: string[], context: __SerdeCon const serializeAws_queryListDashboardsInput = (input: ListDashboardsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.DashboardNamePrefix !== undefined) { + if (input.DashboardNamePrefix !== undefined && input.DashboardNamePrefix !== null) { entries["DashboardNamePrefix"] = input.DashboardNamePrefix; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -3263,23 +3293,23 @@ const serializeAws_queryListDashboardsInput = (input: ListDashboardsInput, conte const serializeAws_queryListMetricsInput = (input: ListMetricsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryDimensionFilters(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.RecentlyActive !== undefined) { + if (input.RecentlyActive !== undefined && input.RecentlyActive !== null) { entries["RecentlyActive"] = input.RecentlyActive; } return entries; @@ -3287,7 +3317,7 @@ const serializeAws_queryListMetricsInput = (input: ListMetricsInput, context: __ const serializeAws_queryListTagsForResourceInput = (input: ListTagsForResourceInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceARN !== undefined) { + if (input.ResourceARN !== undefined && input.ResourceARN !== null) { entries["ResourceARN"] = input.ResourceARN; } return entries; @@ -3295,13 +3325,13 @@ const serializeAws_queryListTagsForResourceInput = (input: ListTagsForResourceIn const serializeAws_queryMetric = (input: Metric, context: __SerdeContext): any => { const entries: any = {}; - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryDimensions(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; @@ -3315,6 +3345,9 @@ const serializeAws_queryMetricData = (input: MetricDatum[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryMetricDatum(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3328,6 +3361,9 @@ const serializeAws_queryMetricDataQueries = (input: MetricDataQuery[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryMetricDataQuery(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3339,26 +3375,26 @@ const serializeAws_queryMetricDataQueries = (input: MetricDataQuery[], context: const serializeAws_queryMetricDataQuery = (input: MetricDataQuery, context: __SerdeContext): any => { const entries: any = {}; - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { entries["Id"] = input.Id; } - if (input.MetricStat !== undefined) { + if (input.MetricStat !== undefined && input.MetricStat !== null) { const memberEntries = serializeAws_queryMetricStat(input.MetricStat, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MetricStat.${key}`; entries[loc] = value; }); } - if (input.Expression !== undefined) { + if (input.Expression !== undefined && input.Expression !== null) { entries["Expression"] = input.Expression; } - if (input.Label !== undefined) { + if (input.Label !== undefined && input.Label !== null) { entries["Label"] = input.Label; } - if (input.ReturnData !== undefined) { + if (input.ReturnData !== undefined && input.ReturnData !== null) { entries["ReturnData"] = input.ReturnData; } - if (input.Period !== undefined) { + if (input.Period !== undefined && input.Period !== null) { entries["Period"] = input.Period; } return entries; @@ -3366,47 +3402,47 @@ const serializeAws_queryMetricDataQuery = (input: MetricDataQuery, context: __Se const serializeAws_queryMetricDatum = (input: MetricDatum, context: __SerdeContext): any => { const entries: any = {}; - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryDimensions(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; entries[loc] = value; }); } - if (input.Timestamp !== undefined) { + if (input.Timestamp !== undefined && input.Timestamp !== null) { entries["Timestamp"] = input.Timestamp.toISOString().split(".")[0] + "Z"; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } - if (input.StatisticValues !== undefined) { + if (input.StatisticValues !== undefined && input.StatisticValues !== null) { const memberEntries = serializeAws_queryStatisticSet(input.StatisticValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StatisticValues.${key}`; entries[loc] = value; }); } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryValues(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; entries[loc] = value; }); } - if (input.Counts !== undefined) { + if (input.Counts !== undefined && input.Counts !== null) { const memberEntries = serializeAws_queryCounts(input.Counts, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Counts.${key}`; entries[loc] = value; }); } - if (input.Unit !== undefined) { + if (input.Unit !== undefined && input.Unit !== null) { entries["Unit"] = input.Unit; } - if (input.StorageResolution !== undefined) { + if (input.StorageResolution !== undefined && input.StorageResolution !== null) { entries["StorageResolution"] = input.StorageResolution; } return entries; @@ -3414,20 +3450,20 @@ const serializeAws_queryMetricDatum = (input: MetricDatum, context: __SerdeConte const serializeAws_queryMetricStat = (input: MetricStat, context: __SerdeContext): any => { const entries: any = {}; - if (input.Metric !== undefined) { + if (input.Metric !== undefined && input.Metric !== null) { const memberEntries = serializeAws_queryMetric(input.Metric, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Metric.${key}`; entries[loc] = value; }); } - if (input.Period !== undefined) { + if (input.Period !== undefined && input.Period !== null) { entries["Period"] = input.Period; } - if (input.Stat !== undefined) { + if (input.Stat !== undefined && input.Stat !== null) { entries["Stat"] = input.Stat; } - if (input.Unit !== undefined) { + if (input.Unit !== undefined && input.Unit !== null) { entries["Unit"] = input.Unit; } return entries; @@ -3435,23 +3471,23 @@ const serializeAws_queryMetricStat = (input: MetricStat, context: __SerdeContext const serializeAws_queryPutAnomalyDetectorInput = (input: PutAnomalyDetectorInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryDimensions(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; entries[loc] = value; }); } - if (input.Stat !== undefined) { + if (input.Stat !== undefined && input.Stat !== null) { entries["Stat"] = input.Stat; } - if (input.Configuration !== undefined) { + if (input.Configuration !== undefined && input.Configuration !== null) { const memberEntries = serializeAws_queryAnomalyDetectorConfiguration(input.Configuration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Configuration.${key}`; @@ -3463,40 +3499,40 @@ const serializeAws_queryPutAnomalyDetectorInput = (input: PutAnomalyDetectorInpu const serializeAws_queryPutCompositeAlarmInput = (input: PutCompositeAlarmInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ActionsEnabled !== undefined) { + if (input.ActionsEnabled !== undefined && input.ActionsEnabled !== null) { entries["ActionsEnabled"] = input.ActionsEnabled; } - if (input.AlarmActions !== undefined) { + if (input.AlarmActions !== undefined && input.AlarmActions !== null) { const memberEntries = serializeAws_queryResourceList(input.AlarmActions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlarmActions.${key}`; entries[loc] = value; }); } - if (input.AlarmDescription !== undefined) { + if (input.AlarmDescription !== undefined && input.AlarmDescription !== null) { entries["AlarmDescription"] = input.AlarmDescription; } - if (input.AlarmName !== undefined) { + if (input.AlarmName !== undefined && input.AlarmName !== null) { entries["AlarmName"] = input.AlarmName; } - if (input.AlarmRule !== undefined) { + if (input.AlarmRule !== undefined && input.AlarmRule !== null) { entries["AlarmRule"] = input.AlarmRule; } - if (input.InsufficientDataActions !== undefined) { + if (input.InsufficientDataActions !== undefined && input.InsufficientDataActions !== null) { const memberEntries = serializeAws_queryResourceList(input.InsufficientDataActions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InsufficientDataActions.${key}`; entries[loc] = value; }); } - if (input.OKActions !== undefined) { + if (input.OKActions !== undefined && input.OKActions !== null) { const memberEntries = serializeAws_queryResourceList(input.OKActions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OKActions.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -3508,10 +3544,10 @@ const serializeAws_queryPutCompositeAlarmInput = (input: PutCompositeAlarmInput, const serializeAws_queryPutDashboardInput = (input: PutDashboardInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.DashboardName !== undefined) { + if (input.DashboardName !== undefined && input.DashboardName !== null) { entries["DashboardName"] = input.DashboardName; } - if (input.DashboardBody !== undefined) { + if (input.DashboardBody !== undefined && input.DashboardBody !== null) { entries["DashboardBody"] = input.DashboardBody; } return entries; @@ -3519,16 +3555,16 @@ const serializeAws_queryPutDashboardInput = (input: PutDashboardInput, context: const serializeAws_queryPutInsightRuleInput = (input: PutInsightRuleInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.RuleName !== undefined) { + if (input.RuleName !== undefined && input.RuleName !== null) { entries["RuleName"] = input.RuleName; } - if (input.RuleState !== undefined) { + if (input.RuleState !== undefined && input.RuleState !== null) { entries["RuleState"] = input.RuleState; } - if (input.RuleDefinition !== undefined) { + if (input.RuleDefinition !== undefined && input.RuleDefinition !== null) { entries["RuleDefinition"] = input.RuleDefinition; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -3540,94 +3576,94 @@ const serializeAws_queryPutInsightRuleInput = (input: PutInsightRuleInput, conte const serializeAws_queryPutMetricAlarmInput = (input: PutMetricAlarmInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.AlarmName !== undefined) { + if (input.AlarmName !== undefined && input.AlarmName !== null) { entries["AlarmName"] = input.AlarmName; } - if (input.AlarmDescription !== undefined) { + if (input.AlarmDescription !== undefined && input.AlarmDescription !== null) { entries["AlarmDescription"] = input.AlarmDescription; } - if (input.ActionsEnabled !== undefined) { + if (input.ActionsEnabled !== undefined && input.ActionsEnabled !== null) { entries["ActionsEnabled"] = input.ActionsEnabled; } - if (input.OKActions !== undefined) { + if (input.OKActions !== undefined && input.OKActions !== null) { const memberEntries = serializeAws_queryResourceList(input.OKActions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OKActions.${key}`; entries[loc] = value; }); } - if (input.AlarmActions !== undefined) { + if (input.AlarmActions !== undefined && input.AlarmActions !== null) { const memberEntries = serializeAws_queryResourceList(input.AlarmActions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlarmActions.${key}`; entries[loc] = value; }); } - if (input.InsufficientDataActions !== undefined) { + if (input.InsufficientDataActions !== undefined && input.InsufficientDataActions !== null) { const memberEntries = serializeAws_queryResourceList(input.InsufficientDataActions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InsufficientDataActions.${key}`; entries[loc] = value; }); } - if (input.MetricName !== undefined) { + if (input.MetricName !== undefined && input.MetricName !== null) { entries["MetricName"] = input.MetricName; } - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.Statistic !== undefined) { + if (input.Statistic !== undefined && input.Statistic !== null) { entries["Statistic"] = input.Statistic; } - if (input.ExtendedStatistic !== undefined) { + if (input.ExtendedStatistic !== undefined && input.ExtendedStatistic !== null) { entries["ExtendedStatistic"] = input.ExtendedStatistic; } - if (input.Dimensions !== undefined) { + if (input.Dimensions !== undefined && input.Dimensions !== null) { const memberEntries = serializeAws_queryDimensions(input.Dimensions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Dimensions.${key}`; entries[loc] = value; }); } - if (input.Period !== undefined) { + if (input.Period !== undefined && input.Period !== null) { entries["Period"] = input.Period; } - if (input.Unit !== undefined) { + if (input.Unit !== undefined && input.Unit !== null) { entries["Unit"] = input.Unit; } - if (input.EvaluationPeriods !== undefined) { + if (input.EvaluationPeriods !== undefined && input.EvaluationPeriods !== null) { entries["EvaluationPeriods"] = input.EvaluationPeriods; } - if (input.DatapointsToAlarm !== undefined) { + if (input.DatapointsToAlarm !== undefined && input.DatapointsToAlarm !== null) { entries["DatapointsToAlarm"] = input.DatapointsToAlarm; } - if (input.Threshold !== undefined) { + if (input.Threshold !== undefined && input.Threshold !== null) { entries["Threshold"] = input.Threshold; } - if (input.ComparisonOperator !== undefined) { + if (input.ComparisonOperator !== undefined && input.ComparisonOperator !== null) { entries["ComparisonOperator"] = input.ComparisonOperator; } - if (input.TreatMissingData !== undefined) { + if (input.TreatMissingData !== undefined && input.TreatMissingData !== null) { entries["TreatMissingData"] = input.TreatMissingData; } - if (input.EvaluateLowSampleCountPercentile !== undefined) { + if (input.EvaluateLowSampleCountPercentile !== undefined && input.EvaluateLowSampleCountPercentile !== null) { entries["EvaluateLowSampleCountPercentile"] = input.EvaluateLowSampleCountPercentile; } - if (input.Metrics !== undefined) { + if (input.Metrics !== undefined && input.Metrics !== null) { const memberEntries = serializeAws_queryMetricDataQueries(input.Metrics, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Metrics.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ThresholdMetricId !== undefined) { + if (input.ThresholdMetricId !== undefined && input.ThresholdMetricId !== null) { entries["ThresholdMetricId"] = input.ThresholdMetricId; } return entries; @@ -3635,10 +3671,10 @@ const serializeAws_queryPutMetricAlarmInput = (input: PutMetricAlarmInput, conte const serializeAws_queryPutMetricDataInput = (input: PutMetricDataInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.MetricData !== undefined) { + if (input.MetricData !== undefined && input.MetricData !== null) { const memberEntries = serializeAws_queryMetricData(input.MetricData, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MetricData.${key}`; @@ -3650,10 +3686,10 @@ const serializeAws_queryPutMetricDataInput = (input: PutMetricDataInput, context const serializeAws_queryRange = (input: Range, context: __SerdeContext): any => { const entries: any = {}; - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } return entries; @@ -3663,6 +3699,9 @@ const serializeAws_queryResourceList = (input: string[], context: __SerdeContext const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3671,16 +3710,16 @@ const serializeAws_queryResourceList = (input: string[], context: __SerdeContext const serializeAws_querySetAlarmStateInput = (input: SetAlarmStateInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.AlarmName !== undefined) { + if (input.AlarmName !== undefined && input.AlarmName !== null) { entries["AlarmName"] = input.AlarmName; } - if (input.StateValue !== undefined) { + if (input.StateValue !== undefined && input.StateValue !== null) { entries["StateValue"] = input.StateValue; } - if (input.StateReason !== undefined) { + if (input.StateReason !== undefined && input.StateReason !== null) { entries["StateReason"] = input.StateReason; } - if (input.StateReasonData !== undefined) { + if (input.StateReasonData !== undefined && input.StateReasonData !== null) { entries["StateReasonData"] = input.StateReasonData; } return entries; @@ -3690,6 +3729,9 @@ const serializeAws_queryStatistics = (input: (Statistic | string)[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3698,16 +3740,16 @@ const serializeAws_queryStatistics = (input: (Statistic | string)[], context: __ const serializeAws_queryStatisticSet = (input: StatisticSet, context: __SerdeContext): any => { const entries: any = {}; - if (input.SampleCount !== undefined) { + if (input.SampleCount !== undefined && input.SampleCount !== null) { entries["SampleCount"] = input.SampleCount; } - if (input.Sum !== undefined) { + if (input.Sum !== undefined && input.Sum !== null) { entries["Sum"] = input.Sum; } - if (input.Minimum !== undefined) { + if (input.Minimum !== undefined && input.Minimum !== null) { entries["Minimum"] = input.Minimum; } - if (input.Maximum !== undefined) { + if (input.Maximum !== undefined && input.Maximum !== null) { entries["Maximum"] = input.Maximum; } return entries; @@ -3715,10 +3757,10 @@ const serializeAws_queryStatisticSet = (input: StatisticSet, context: __SerdeCon const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -3728,6 +3770,9 @@ const serializeAws_queryTagKeyList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3738,6 +3783,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3749,10 +3797,10 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const serializeAws_queryTagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceARN !== undefined) { + if (input.ResourceARN !== undefined && input.ResourceARN !== null) { entries["ResourceARN"] = input.ResourceARN; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -3764,10 +3812,10 @@ const serializeAws_queryTagResourceInput = (input: TagResourceInput, context: __ const serializeAws_queryUntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceARN !== undefined) { + if (input.ResourceARN !== undefined && input.ResourceARN !== null) { entries["ResourceARN"] = input.ResourceARN; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; @@ -3781,6 +3829,9 @@ const serializeAws_queryValues = (input: number[], context: __SerdeContext): any const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3818,7 +3869,14 @@ const deserializeAws_queryAlarmHistoryItem = (output: any, context: __SerdeConte }; const deserializeAws_queryAlarmHistoryItems = (output: any, context: __SerdeContext): AlarmHistoryItem[] => { - return (output || []).map((entry: any) => deserializeAws_queryAlarmHistoryItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAlarmHistoryItem(entry, context); + }); }; const deserializeAws_queryAnomalyDetector = (output: any, context: __SerdeContext): AnomalyDetector => { @@ -3881,15 +3939,36 @@ const deserializeAws_queryAnomalyDetectorConfiguration = ( }; const deserializeAws_queryAnomalyDetectorExcludedTimeRanges = (output: any, context: __SerdeContext): Range[] => { - return (output || []).map((entry: any) => deserializeAws_queryRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRange(entry, context); + }); }; const deserializeAws_queryAnomalyDetectors = (output: any, context: __SerdeContext): AnomalyDetector[] => { - return (output || []).map((entry: any) => deserializeAws_queryAnomalyDetector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAnomalyDetector(entry, context); + }); }; const deserializeAws_queryBatchFailures = (output: any, context: __SerdeContext): PartialFailure[] => { - return (output || []).map((entry: any) => deserializeAws_queryPartialFailure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPartialFailure(entry, context); + }); }; const deserializeAws_queryCompositeAlarm = (output: any, context: __SerdeContext): CompositeAlarm => { @@ -3969,7 +4048,14 @@ const deserializeAws_queryCompositeAlarm = (output: any, context: __SerdeContext }; const deserializeAws_queryCompositeAlarms = (output: any, context: __SerdeContext): CompositeAlarm[] => { - return (output || []).map((entry: any) => deserializeAws_queryCompositeAlarm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCompositeAlarm(entry, context); + }); }; const deserializeAws_queryConcurrentModificationException = ( @@ -3986,7 +4072,14 @@ const deserializeAws_queryConcurrentModificationException = ( }; const deserializeAws_queryDashboardEntries = (output: any, context: __SerdeContext): DashboardEntry[] => { - return (output || []).map((entry: any) => deserializeAws_queryDashboardEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDashboardEntry(entry, context); + }); }; const deserializeAws_queryDashboardEntry = (output: any, context: __SerdeContext): DashboardEntry => { @@ -4068,7 +4161,14 @@ const deserializeAws_queryDashboardValidationMessages = ( output: any, context: __SerdeContext ): DashboardValidationMessage[] => { - return (output || []).map((entry: any) => deserializeAws_queryDashboardValidationMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDashboardValidationMessage(entry, context); + }); }; const deserializeAws_queryDatapoint = (output: any, context: __SerdeContext): Datapoint => { @@ -4116,21 +4216,37 @@ const deserializeAws_queryDatapoint = (output: any, context: __SerdeContext): Da }; const deserializeAws_queryDatapoints = (output: any, context: __SerdeContext): Datapoint[] => { - return (output || []).map((entry: any) => deserializeAws_queryDatapoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDatapoint(entry, context); + }); }; const deserializeAws_queryDatapointValueMap = (output: any, context: __SerdeContext): { [key: string]: number } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: parseFloat(pair["value"]), - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryDatapointValues = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => parseFloat(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return parseFloat(entry); + }); }; const deserializeAws_queryDeleteAnomalyDetectorOutput = ( @@ -4298,7 +4414,14 @@ const deserializeAws_queryDimension = (output: any, context: __SerdeContext): Di }; const deserializeAws_queryDimensions = (output: any, context: __SerdeContext): Dimension[] => { - return (output || []).map((entry: any) => deserializeAws_queryDimension(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDimension(entry, context); + }); }; const deserializeAws_queryDisableInsightRulesOutput = ( @@ -4547,22 +4670,50 @@ const deserializeAws_queryInsightRuleContributorDatapoints = ( output: any, context: __SerdeContext ): InsightRuleContributorDatapoint[] => { - return (output || []).map((entry: any) => deserializeAws_queryInsightRuleContributorDatapoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInsightRuleContributorDatapoint(entry, context); + }); }; const deserializeAws_queryInsightRuleContributorKeyLabels = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryInsightRuleContributorKeys = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryInsightRuleContributors = ( output: any, context: __SerdeContext ): InsightRuleContributor[] => { - return (output || []).map((entry: any) => deserializeAws_queryInsightRuleContributor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInsightRuleContributor(entry, context); + }); }; const deserializeAws_queryInsightRuleMetricDatapoint = ( @@ -4610,11 +4761,25 @@ const deserializeAws_queryInsightRuleMetricDatapoints = ( output: any, context: __SerdeContext ): InsightRuleMetricDatapoint[] => { - return (output || []).map((entry: any) => deserializeAws_queryInsightRuleMetricDatapoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInsightRuleMetricDatapoint(entry, context); + }); }; const deserializeAws_queryInsightRules = (output: any, context: __SerdeContext): InsightRule[] => { - return (output || []).map((entry: any) => deserializeAws_queryInsightRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInsightRule(entry, context); + }); }; const deserializeAws_queryInternalServiceFault = (output: any, context: __SerdeContext): InternalServiceFault => { @@ -4929,11 +5094,25 @@ const deserializeAws_queryMetricAlarm = (output: any, context: __SerdeContext): }; const deserializeAws_queryMetricAlarms = (output: any, context: __SerdeContext): MetricAlarm[] => { - return (output || []).map((entry: any) => deserializeAws_queryMetricAlarm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMetricAlarm(entry, context); + }); }; const deserializeAws_queryMetricDataQueries = (output: any, context: __SerdeContext): MetricDataQuery[] => { - return (output || []).map((entry: any) => deserializeAws_queryMetricDataQuery(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMetricDataQuery(entry, context); + }); }; const deserializeAws_queryMetricDataQuery = (output: any, context: __SerdeContext): MetricDataQuery => { @@ -5012,15 +5191,36 @@ const deserializeAws_queryMetricDataResult = (output: any, context: __SerdeConte }; const deserializeAws_queryMetricDataResultMessages = (output: any, context: __SerdeContext): MessageData[] => { - return (output || []).map((entry: any) => deserializeAws_queryMessageData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMessageData(entry, context); + }); }; const deserializeAws_queryMetricDataResults = (output: any, context: __SerdeContext): MetricDataResult[] => { - return (output || []).map((entry: any) => deserializeAws_queryMetricDataResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMetricDataResult(entry, context); + }); }; const deserializeAws_queryMetrics = (output: any, context: __SerdeContext): Metric[] => { - return (output || []).map((entry: any) => deserializeAws_queryMetric(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMetric(entry, context); + }); }; const deserializeAws_queryMetricStat = (output: any, context: __SerdeContext): MetricStat => { @@ -5127,7 +5327,14 @@ const deserializeAws_queryRange = (output: any, context: __SerdeContext): Range }; const deserializeAws_queryResourceList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryResourceNotFound = (output: any, context: __SerdeContext): ResourceNotFound => { @@ -5176,7 +5383,14 @@ const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTagResourceOutput = (output: any, context: __SerdeContext): TagResourceOutput => { @@ -5185,7 +5399,14 @@ const deserializeAws_queryTagResourceOutput = (output: any, context: __SerdeCont }; const deserializeAws_queryTimestamps = (output: any, context: __SerdeContext): Date[] => { - return (output || []).map((entry: any) => new Date(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return new Date(entry); + }); }; const deserializeAws_queryUntagResourceOutput = (output: any, context: __SerdeContext): UntagResourceOutput => { diff --git a/clients/client-codeartifact/protocols/Aws_restJson1.ts b/clients/client-codeartifact/protocols/Aws_restJson1.ts index 24ead115efb4..18eb9d4814dc 100644 --- a/clients/client-codeartifact/protocols/Aws_restJson1.ts +++ b/clients/client-codeartifact/protocols/Aws_restJson1.ts @@ -141,9 +141,7 @@ export const serializeAws_restJson1AssociateExternalConnectionCommand = async ( input: AssociateExternalConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/repository/external-connection"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -170,7 +168,7 @@ export const serializeAws_restJson1CopyPackageVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/package/versions/copy"; const query: any = { @@ -184,14 +182,16 @@ export const serializeAws_restJson1CopyPackageVersionsCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.allowOverwrite !== undefined && { allowOverwrite: input.allowOverwrite }), - ...(input.includeFromUpstream !== undefined && { includeFromUpstream: input.includeFromUpstream }), - ...(input.versionRevisions !== undefined && { - versionRevisions: serializeAws_restJson1PackageVersionRevisionMap(input.versionRevisions, context), - }), - ...(input.versions !== undefined && { - versions: serializeAws_restJson1PackageVersionList(input.versions, context), - }), + ...(input.allowOverwrite !== undefined && + input.allowOverwrite !== null && { allowOverwrite: input.allowOverwrite }), + ...(input.includeFromUpstream !== undefined && + input.includeFromUpstream !== null && { includeFromUpstream: input.includeFromUpstream }), + ...(input.versionRevisions !== undefined && + input.versionRevisions !== null && { + versionRevisions: serializeAws_restJson1PackageVersionRevisionMap(input.versionRevisions, context), + }), + ...(input.versions !== undefined && + input.versions !== null && { versions: serializeAws_restJson1PackageVersionList(input.versions, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -211,7 +211,7 @@ export const serializeAws_restJson1CreateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/domain"; const query: any = { @@ -219,8 +219,9 @@ export const serializeAws_restJson1CreateDomainCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.encryptionKey !== undefined && { encryptionKey: input.encryptionKey }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.encryptionKey !== undefined && input.encryptionKey !== null && { encryptionKey: input.encryptionKey }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -240,7 +241,7 @@ export const serializeAws_restJson1CreateRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/repository"; const query: any = { @@ -250,11 +251,13 @@ export const serializeAws_restJson1CreateRepositoryCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.upstreams !== undefined && { - upstreams: serializeAws_restJson1UpstreamRepositoryList(input.upstreams, context), - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.upstreams !== undefined && + input.upstreams !== null && { + upstreams: serializeAws_restJson1UpstreamRepositoryList(input.upstreams, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -273,9 +276,7 @@ export const serializeAws_restJson1DeleteDomainCommand = async ( input: DeleteDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/domain"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -299,9 +300,7 @@ export const serializeAws_restJson1DeleteDomainPermissionsPolicyCommand = async input: DeleteDomainPermissionsPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/domain/permissions/policy"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -327,7 +326,7 @@ export const serializeAws_restJson1DeletePackageVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/package/versions/delete"; const query: any = { @@ -340,10 +339,10 @@ export const serializeAws_restJson1DeletePackageVersionsCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.expectedStatus !== undefined && { expectedStatus: input.expectedStatus }), - ...(input.versions !== undefined && { - versions: serializeAws_restJson1PackageVersionList(input.versions, context), - }), + ...(input.expectedStatus !== undefined && + input.expectedStatus !== null && { expectedStatus: input.expectedStatus }), + ...(input.versions !== undefined && + input.versions !== null && { versions: serializeAws_restJson1PackageVersionList(input.versions, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -362,9 +361,7 @@ export const serializeAws_restJson1DeleteRepositoryCommand = async ( input: DeleteRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/repository"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -389,9 +386,7 @@ export const serializeAws_restJson1DeleteRepositoryPermissionsPolicyCommand = as input: DeleteRepositoryPermissionsPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/repository/permissions/policies"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -417,9 +412,7 @@ export const serializeAws_restJson1DescribeDomainCommand = async ( input: DescribeDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/domain"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -443,9 +436,7 @@ export const serializeAws_restJson1DescribePackageVersionCommand = async ( input: DescribePackageVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/package/version"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -474,9 +465,7 @@ export const serializeAws_restJson1DescribeRepositoryCommand = async ( input: DescribeRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/repository"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -501,9 +490,7 @@ export const serializeAws_restJson1DisassociateExternalConnectionCommand = async input: DisassociateExternalConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/repository/external-connection"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -530,7 +517,7 @@ export const serializeAws_restJson1DisposePackageVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/package/versions/dispose"; const query: any = { @@ -543,13 +530,14 @@ export const serializeAws_restJson1DisposePackageVersionsCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.expectedStatus !== undefined && { expectedStatus: input.expectedStatus }), - ...(input.versionRevisions !== undefined && { - versionRevisions: serializeAws_restJson1PackageVersionRevisionMap(input.versionRevisions, context), - }), - ...(input.versions !== undefined && { - versions: serializeAws_restJson1PackageVersionList(input.versions, context), - }), + ...(input.expectedStatus !== undefined && + input.expectedStatus !== null && { expectedStatus: input.expectedStatus }), + ...(input.versionRevisions !== undefined && + input.versionRevisions !== null && { + versionRevisions: serializeAws_restJson1PackageVersionRevisionMap(input.versionRevisions, context), + }), + ...(input.versions !== undefined && + input.versions !== null && { versions: serializeAws_restJson1PackageVersionList(input.versions, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -568,9 +556,7 @@ export const serializeAws_restJson1GetAuthorizationTokenCommand = async ( input: GetAuthorizationTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/authorization-token"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -595,9 +581,7 @@ export const serializeAws_restJson1GetDomainPermissionsPolicyCommand = async ( input: GetDomainPermissionsPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/domain/permissions/policy"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -621,9 +605,7 @@ export const serializeAws_restJson1GetPackageVersionAssetCommand = async ( input: GetPackageVersionAssetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/package/version/asset"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -654,9 +636,7 @@ export const serializeAws_restJson1GetPackageVersionReadmeCommand = async ( input: GetPackageVersionReadmeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/package/version/readme"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -685,9 +665,7 @@ export const serializeAws_restJson1GetRepositoryEndpointCommand = async ( input: GetRepositoryEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/repository/endpoint"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -713,9 +691,7 @@ export const serializeAws_restJson1GetRepositoryPermissionsPolicyCommand = async input: GetRepositoryPermissionsPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/repository/permissions/policy"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -741,13 +717,13 @@ export const serializeAws_restJson1ListDomainsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/domains"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -765,9 +741,7 @@ export const serializeAws_restJson1ListPackagesCommand = async ( input: ListPackagesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/packages"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -797,9 +771,7 @@ export const serializeAws_restJson1ListPackageVersionAssetsCommand = async ( input: ListPackageVersionAssetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/package/version/assets"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -830,9 +802,7 @@ export const serializeAws_restJson1ListPackageVersionDependenciesCommand = async input: ListPackageVersionDependenciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/package/version/dependencies"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -862,9 +832,7 @@ export const serializeAws_restJson1ListPackageVersionsCommand = async ( input: ListPackageVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/package/versions"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -896,9 +864,7 @@ export const serializeAws_restJson1ListRepositoriesCommand = async ( input: ListRepositoriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/repositories"; const query: any = { ...(input.repositoryPrefix !== undefined && { "repository-prefix": input.repositoryPrefix }), @@ -923,9 +889,7 @@ export const serializeAws_restJson1ListRepositoriesInDomainCommand = async ( input: ListRepositoriesInDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/domain/repositories"; const query: any = { ...(input.domain !== undefined && { domain: input.domain }), @@ -953,9 +917,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/tags"; const query: any = { ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), @@ -979,15 +941,17 @@ export const serializeAws_restJson1PutDomainPermissionsPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/domain/permissions/policy"; let body: any; body = JSON.stringify({ - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.domainOwner !== undefined && { domainOwner: input.domainOwner }), - ...(input.policyDocument !== undefined && { policyDocument: input.policyDocument }), - ...(input.policyRevision !== undefined && { policyRevision: input.policyRevision }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.domainOwner !== undefined && input.domainOwner !== null && { domainOwner: input.domainOwner }), + ...(input.policyDocument !== undefined && + input.policyDocument !== null && { policyDocument: input.policyDocument }), + ...(input.policyRevision !== undefined && + input.policyRevision !== null && { policyRevision: input.policyRevision }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1006,7 +970,7 @@ export const serializeAws_restJson1PutRepositoryPermissionsPolicyCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/repository/permissions/policy"; const query: any = { @@ -1016,8 +980,10 @@ export const serializeAws_restJson1PutRepositoryPermissionsPolicyCommand = async }; let body: any; body = JSON.stringify({ - ...(input.policyDocument !== undefined && { policyDocument: input.policyDocument }), - ...(input.policyRevision !== undefined && { policyRevision: input.policyRevision }), + ...(input.policyDocument !== undefined && + input.policyDocument !== null && { policyDocument: input.policyDocument }), + ...(input.policyRevision !== undefined && + input.policyRevision !== null && { policyRevision: input.policyRevision }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1037,7 +1003,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/tag"; const query: any = { @@ -1045,7 +1011,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1065,7 +1032,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/untag"; const query: any = { @@ -1073,7 +1040,8 @@ export const serializeAws_restJson1UntagResourceCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1093,7 +1061,7 @@ export const serializeAws_restJson1UpdatePackageVersionsStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/package/versions/update_status"; const query: any = { @@ -1106,14 +1074,15 @@ export const serializeAws_restJson1UpdatePackageVersionsStatusCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.expectedStatus !== undefined && { expectedStatus: input.expectedStatus }), - ...(input.targetStatus !== undefined && { targetStatus: input.targetStatus }), - ...(input.versionRevisions !== undefined && { - versionRevisions: serializeAws_restJson1PackageVersionRevisionMap(input.versionRevisions, context), - }), - ...(input.versions !== undefined && { - versions: serializeAws_restJson1PackageVersionList(input.versions, context), - }), + ...(input.expectedStatus !== undefined && + input.expectedStatus !== null && { expectedStatus: input.expectedStatus }), + ...(input.targetStatus !== undefined && input.targetStatus !== null && { targetStatus: input.targetStatus }), + ...(input.versionRevisions !== undefined && + input.versionRevisions !== null && { + versionRevisions: serializeAws_restJson1PackageVersionRevisionMap(input.versionRevisions, context), + }), + ...(input.versions !== undefined && + input.versions !== null && { versions: serializeAws_restJson1PackageVersionList(input.versions, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1133,7 +1102,7 @@ export const serializeAws_restJson1UpdateRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/repository"; const query: any = { @@ -1143,10 +1112,11 @@ export const serializeAws_restJson1UpdateRepositoryCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.upstreams !== undefined && { - upstreams: serializeAws_restJson1UpstreamRepositoryList(input.upstreams, context), - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.upstreams !== undefined && + input.upstreams !== null && { + upstreams: serializeAws_restJson1UpstreamRepositoryList(input.upstreams, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4569,53 +4539,89 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1PackageVersionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1PackageVersionRevisionMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1UpstreamRepository = (input: UpstreamRepository, context: __SerdeContext): any => { return { - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_restJson1UpstreamRepositoryList = (input: UpstreamRepository[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1UpstreamRepository(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1UpstreamRepository(entry, context); + }); }; const deserializeAws_restJson1AssetHashes = (output: any, context: __SerdeContext): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [HashAlgorithm | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [HashAlgorithm | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -4632,7 +4638,14 @@ const deserializeAws_restJson1AssetSummary = (output: any, context: __SerdeConte }; const deserializeAws_restJson1AssetSummaryList = (output: any, context: __SerdeContext): AssetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetSummary(entry, context); + }); }; const deserializeAws_restJson1DomainDescription = (output: any, context: __SerdeContext): DomainDescription => { @@ -4671,7 +4684,14 @@ const deserializeAws_restJson1DomainSummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1DomainSummaryList = (output: any, context: __SerdeContext): DomainSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainSummary(entry, context); + }); }; const deserializeAws_restJson1LicenseInfo = (output: any, context: __SerdeContext): LicenseInfo => { @@ -4682,7 +4702,14 @@ const deserializeAws_restJson1LicenseInfo = (output: any, context: __SerdeContex }; const deserializeAws_restJson1LicenseInfoList = (output: any, context: __SerdeContext): LicenseInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LicenseInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LicenseInfo(entry, context); + }); }; const deserializeAws_restJson1PackageDependency = (output: any, context: __SerdeContext): PackageDependency => { @@ -4699,7 +4726,14 @@ const deserializeAws_restJson1PackageDependency = (output: any, context: __Serde }; const deserializeAws_restJson1PackageDependencyList = (output: any, context: __SerdeContext): PackageDependency[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PackageDependency(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PackageDependency(entry, context); + }); }; const deserializeAws_restJson1PackageSummary = (output: any, context: __SerdeContext): PackageSummary => { @@ -4711,7 +4745,14 @@ const deserializeAws_restJson1PackageSummary = (output: any, context: __SerdeCon }; const deserializeAws_restJson1PackageSummaryList = (output: any, context: __SerdeContext): PackageSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PackageSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PackageSummary(entry, context); + }); }; const deserializeAws_restJson1PackageVersionDescription = ( @@ -4754,13 +4795,15 @@ const deserializeAws_restJson1PackageVersionErrorMap = ( output: any, context: __SerdeContext ): { [key: string]: PackageVersionError } => { - return Object.entries(output).reduce( - (acc: { [key: string]: PackageVersionError }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: PackageVersionError }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1PackageVersionError(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1PackageVersionSummary = (output: any, context: __SerdeContext): PackageVersionSummary => { @@ -4775,7 +4818,14 @@ const deserializeAws_restJson1PackageVersionSummaryList = ( output: any, context: __SerdeContext ): PackageVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PackageVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PackageVersionSummary(entry, context); + }); }; const deserializeAws_restJson1RepositoryDescription = (output: any, context: __SerdeContext): RepositoryDescription => { @@ -4819,7 +4869,14 @@ const deserializeAws_restJson1RepositoryExternalConnectionInfoList = ( output: any, context: __SerdeContext ): RepositoryExternalConnectionInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RepositoryExternalConnectionInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RepositoryExternalConnectionInfo(entry, context); + }); }; const deserializeAws_restJson1RepositorySummary = (output: any, context: __SerdeContext): RepositorySummary => { @@ -4837,7 +4894,14 @@ const deserializeAws_restJson1RepositorySummary = (output: any, context: __Serde }; const deserializeAws_restJson1RepositorySummaryList = (output: any, context: __SerdeContext): RepositorySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RepositorySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RepositorySummary(entry, context); + }); }; const deserializeAws_restJson1ResourcePolicy = (output: any, context: __SerdeContext): ResourcePolicy => { @@ -4863,10 +4927,15 @@ const deserializeAws_restJson1SuccessfulPackageVersionInfoMap = ( context: __SerdeContext ): { [key: string]: SuccessfulPackageVersionInfo } => { return Object.entries(output).reduce( - (acc: { [key: string]: SuccessfulPackageVersionInfo }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1SuccessfulPackageVersionInfo(value, context), - }), + (acc: { [key: string]: SuccessfulPackageVersionInfo }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1SuccessfulPackageVersionInfo(value, context), + }; + }, {} ); }; @@ -4879,7 +4948,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1UpstreamRepositoryInfo = ( @@ -4896,7 +4972,14 @@ const deserializeAws_restJson1UpstreamRepositoryInfoList = ( output: any, context: __SerdeContext ): UpstreamRepositoryInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UpstreamRepositoryInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UpstreamRepositoryInfo(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4919,6 +5002,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-codebuild/protocols/Aws_json1_1.ts b/clients/client-codebuild/protocols/Aws_json1_1.ts index 0c094497a211..c496f743f68f 100644 --- a/clients/client-codebuild/protocols/Aws_json1_1.ts +++ b/clients/client-codebuild/protocols/Aws_json1_1.ts @@ -248,7 +248,7 @@ export const serializeAws_json1_1BatchDeleteBuildsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.BatchDeleteBuilds", }; let body: any; @@ -261,7 +261,7 @@ export const serializeAws_json1_1BatchGetBuildBatchesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.BatchGetBuildBatches", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1BatchGetBuildsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.BatchGetBuilds", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1BatchGetProjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.BatchGetProjects", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1BatchGetReportGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.BatchGetReportGroups", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1BatchGetReportsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.BatchGetReports", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.CreateProject", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1CreateReportGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.CreateReportGroup", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1CreateWebhookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.CreateWebhook", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1DeleteBuildBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.DeleteBuildBatch", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.DeleteProject", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1DeleteReportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.DeleteReport", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1DeleteReportGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.DeleteReportGroup", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.DeleteResourcePolicy", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1DeleteSourceCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.DeleteSourceCredentials", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1DeleteWebhookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.DeleteWebhook", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1DescribeCodeCoveragesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.DescribeCodeCoverages", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1DescribeTestCasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.DescribeTestCases", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1GetReportGroupTrendCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.GetReportGroupTrend", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.GetResourcePolicy", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1ImportSourceCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ImportSourceCredentials", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1InvalidateProjectCacheCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.InvalidateProjectCache", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1ListBuildBatchesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListBuildBatches", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1ListBuildBatchesForProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListBuildBatchesForProject", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1ListBuildsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListBuilds", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1ListBuildsForProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListBuildsForProject", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1ListCuratedEnvironmentImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListCuratedEnvironmentImages", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1ListProjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListProjects", }; let body: any; @@ -612,7 +612,7 @@ export const serializeAws_json1_1ListReportGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListReportGroups", }; let body: any; @@ -625,7 +625,7 @@ export const serializeAws_json1_1ListReportsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListReports", }; let body: any; @@ -638,7 +638,7 @@ export const serializeAws_json1_1ListReportsForReportGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListReportsForReportGroup", }; let body: any; @@ -651,7 +651,7 @@ export const serializeAws_json1_1ListSharedProjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListSharedProjects", }; let body: any; @@ -664,7 +664,7 @@ export const serializeAws_json1_1ListSharedReportGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListSharedReportGroups", }; let body: any; @@ -677,7 +677,7 @@ export const serializeAws_json1_1ListSourceCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.ListSourceCredentials", }; let body: any; @@ -690,7 +690,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.PutResourcePolicy", }; let body: any; @@ -703,7 +703,7 @@ export const serializeAws_json1_1RetryBuildCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.RetryBuild", }; let body: any; @@ -716,7 +716,7 @@ export const serializeAws_json1_1RetryBuildBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.RetryBuildBatch", }; let body: any; @@ -729,7 +729,7 @@ export const serializeAws_json1_1StartBuildCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.StartBuild", }; let body: any; @@ -742,7 +742,7 @@ export const serializeAws_json1_1StartBuildBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.StartBuildBatch", }; let body: any; @@ -755,7 +755,7 @@ export const serializeAws_json1_1StopBuildCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.StopBuild", }; let body: any; @@ -768,7 +768,7 @@ export const serializeAws_json1_1StopBuildBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.StopBuildBatch", }; let body: any; @@ -781,7 +781,7 @@ export const serializeAws_json1_1UpdateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.UpdateProject", }; let body: any; @@ -794,7 +794,7 @@ export const serializeAws_json1_1UpdateReportGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.UpdateReportGroup", }; let body: any; @@ -807,7 +807,7 @@ export const serializeAws_json1_1UpdateWebhookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeBuild_20161006.UpdateWebhook", }; let body: any; @@ -842,8 +842,7 @@ const deserializeAws_json1_1BatchDeleteBuildsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -897,8 +896,7 @@ const deserializeAws_json1_1BatchGetBuildBatchesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -952,8 +950,7 @@ const deserializeAws_json1_1BatchGetBuildsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1007,8 +1004,7 @@ const deserializeAws_json1_1BatchGetProjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1062,8 +1058,7 @@ const deserializeAws_json1_1BatchGetReportGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1117,8 +1112,7 @@ const deserializeAws_json1_1BatchGetReportsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1172,8 +1166,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccountLimitExceededException": case "com.amazonaws.codebuild#AccountLimitExceededException": @@ -1243,8 +1236,7 @@ const deserializeAws_json1_1CreateReportGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccountLimitExceededException": case "com.amazonaws.codebuild#AccountLimitExceededException": @@ -1314,8 +1306,7 @@ const deserializeAws_json1_1CreateWebhookCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1393,8 +1384,7 @@ const deserializeAws_json1_1DeleteBuildBatchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1448,8 +1438,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1503,8 +1492,7 @@ const deserializeAws_json1_1DeleteReportCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1558,8 +1546,7 @@ const deserializeAws_json1_1DeleteReportGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1613,8 +1600,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1668,8 +1654,7 @@ const deserializeAws_json1_1DeleteSourceCredentialsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1731,8 +1716,7 @@ const deserializeAws_json1_1DeleteWebhookCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1802,8 +1786,7 @@ const deserializeAws_json1_1DescribeCodeCoveragesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1857,8 +1840,7 @@ const deserializeAws_json1_1DescribeTestCasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1920,8 +1902,7 @@ const deserializeAws_json1_1GetReportGroupTrendCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -1983,8 +1964,7 @@ const deserializeAws_json1_1GetResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2046,8 +2026,7 @@ const deserializeAws_json1_1ImportSourceCredentialsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccountLimitExceededException": case "com.amazonaws.codebuild#AccountLimitExceededException": @@ -2117,8 +2096,7 @@ const deserializeAws_json1_1InvalidateProjectCacheCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2180,8 +2158,7 @@ const deserializeAws_json1_1ListBuildBatchesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2235,8 +2212,7 @@ const deserializeAws_json1_1ListBuildBatchesForProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2298,8 +2274,7 @@ const deserializeAws_json1_1ListBuildsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2353,8 +2328,7 @@ const deserializeAws_json1_1ListBuildsForProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2416,8 +2390,7 @@ const deserializeAws_json1_1ListCuratedEnvironmentImagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -2463,8 +2436,7 @@ const deserializeAws_json1_1ListProjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2518,8 +2490,7 @@ const deserializeAws_json1_1ListReportGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2573,8 +2544,7 @@ const deserializeAws_json1_1ListReportsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2628,8 +2598,7 @@ const deserializeAws_json1_1ListReportsForReportGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2691,8 +2660,7 @@ const deserializeAws_json1_1ListSharedProjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2746,8 +2714,7 @@ const deserializeAws_json1_1ListSharedReportGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2801,8 +2768,7 @@ const deserializeAws_json1_1ListSourceCredentialsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2856,8 +2822,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -2919,8 +2884,7 @@ const deserializeAws_json1_1RetryBuildCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccountLimitExceededException": case "com.amazonaws.codebuild#AccountLimitExceededException": @@ -2990,8 +2954,7 @@ const deserializeAws_json1_1RetryBuildBatchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -3053,8 +3016,7 @@ const deserializeAws_json1_1StartBuildCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccountLimitExceededException": case "com.amazonaws.codebuild#AccountLimitExceededException": @@ -3124,8 +3086,7 @@ const deserializeAws_json1_1StartBuildBatchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -3187,8 +3148,7 @@ const deserializeAws_json1_1StopBuildCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -3250,8 +3210,7 @@ const deserializeAws_json1_1StopBuildBatchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -3313,8 +3272,7 @@ const deserializeAws_json1_1UpdateProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -3376,8 +3334,7 @@ const deserializeAws_json1_1UpdateReportGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -3439,8 +3396,7 @@ const deserializeAws_json1_1UpdateWebhookCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": @@ -3560,7 +3516,7 @@ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( const serializeAws_json1_1BatchDeleteBuildsInput = (input: BatchDeleteBuildsInput, context: __SerdeContext): any => { return { - ...(input.ids !== undefined && { ids: serializeAws_json1_1BuildIds(input.ids, context) }), + ...(input.ids !== undefined && input.ids !== null && { ids: serializeAws_json1_1BuildIds(input.ids, context) }), }; }; @@ -3569,19 +3525,21 @@ const serializeAws_json1_1BatchGetBuildBatchesInput = ( context: __SerdeContext ): any => { return { - ...(input.ids !== undefined && { ids: serializeAws_json1_1BuildBatchIds(input.ids, context) }), + ...(input.ids !== undefined && + input.ids !== null && { ids: serializeAws_json1_1BuildBatchIds(input.ids, context) }), }; }; const serializeAws_json1_1BatchGetBuildsInput = (input: BatchGetBuildsInput, context: __SerdeContext): any => { return { - ...(input.ids !== undefined && { ids: serializeAws_json1_1BuildIds(input.ids, context) }), + ...(input.ids !== undefined && input.ids !== null && { ids: serializeAws_json1_1BuildIds(input.ids, context) }), }; }; const serializeAws_json1_1BatchGetProjectsInput = (input: BatchGetProjectsInput, context: __SerdeContext): any => { return { - ...(input.names !== undefined && { names: serializeAws_json1_1ProjectNames(input.names, context) }), + ...(input.names !== undefined && + input.names !== null && { names: serializeAws_json1_1ProjectNames(input.names, context) }), }; }; @@ -3590,144 +3548,182 @@ const serializeAws_json1_1BatchGetReportGroupsInput = ( context: __SerdeContext ): any => { return { - ...(input.reportGroupArns !== undefined && { - reportGroupArns: serializeAws_json1_1ReportGroupArns(input.reportGroupArns, context), - }), + ...(input.reportGroupArns !== undefined && + input.reportGroupArns !== null && { + reportGroupArns: serializeAws_json1_1ReportGroupArns(input.reportGroupArns, context), + }), }; }; const serializeAws_json1_1BatchGetReportsInput = (input: BatchGetReportsInput, context: __SerdeContext): any => { return { - ...(input.reportArns !== undefined && { reportArns: serializeAws_json1_1ReportArns(input.reportArns, context) }), + ...(input.reportArns !== undefined && + input.reportArns !== null && { reportArns: serializeAws_json1_1ReportArns(input.reportArns, context) }), }; }; const serializeAws_json1_1BatchRestrictions = (input: BatchRestrictions, context: __SerdeContext): any => { return { - ...(input.computeTypesAllowed !== undefined && { - computeTypesAllowed: serializeAws_json1_1ComputeTypesAllowed(input.computeTypesAllowed, context), - }), - ...(input.maximumBuildsAllowed !== undefined && { maximumBuildsAllowed: input.maximumBuildsAllowed }), + ...(input.computeTypesAllowed !== undefined && + input.computeTypesAllowed !== null && { + computeTypesAllowed: serializeAws_json1_1ComputeTypesAllowed(input.computeTypesAllowed, context), + }), + ...(input.maximumBuildsAllowed !== undefined && + input.maximumBuildsAllowed !== null && { maximumBuildsAllowed: input.maximumBuildsAllowed }), }; }; const serializeAws_json1_1BuildBatchFilter = (input: BuildBatchFilter, context: __SerdeContext): any => { return { - ...(input.status !== undefined && { status: input.status }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1BuildBatchIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BuildIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BuildStatusConfig = (input: BuildStatusConfig, context: __SerdeContext): any => { return { - ...(input.context !== undefined && { context: input.context }), - ...(input.targetUrl !== undefined && { targetUrl: input.targetUrl }), + ...(input.context !== undefined && input.context !== null && { context: input.context }), + ...(input.targetUrl !== undefined && input.targetUrl !== null && { targetUrl: input.targetUrl }), }; }; const serializeAws_json1_1CloudWatchLogsConfig = (input: CloudWatchLogsConfig, context: __SerdeContext): any => { return { - ...(input.groupName !== undefined && { groupName: input.groupName }), - ...(input.status !== undefined && { status: input.status }), - ...(input.streamName !== undefined && { streamName: input.streamName }), + ...(input.groupName !== undefined && input.groupName !== null && { groupName: input.groupName }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.streamName !== undefined && input.streamName !== null && { streamName: input.streamName }), }; }; const serializeAws_json1_1ComputeTypesAllowed = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateProjectInput = (input: CreateProjectInput, context: __SerdeContext): any => { return { - ...(input.artifacts !== undefined && { artifacts: serializeAws_json1_1ProjectArtifacts(input.artifacts, context) }), - ...(input.badgeEnabled !== undefined && { badgeEnabled: input.badgeEnabled }), - ...(input.buildBatchConfig !== undefined && { - buildBatchConfig: serializeAws_json1_1ProjectBuildBatchConfig(input.buildBatchConfig, context), - }), - ...(input.cache !== undefined && { cache: serializeAws_json1_1ProjectCache(input.cache, context) }), - ...(input.description !== undefined && { description: input.description }), - ...(input.encryptionKey !== undefined && { encryptionKey: input.encryptionKey }), - ...(input.environment !== undefined && { - environment: serializeAws_json1_1ProjectEnvironment(input.environment, context), - }), - ...(input.fileSystemLocations !== undefined && { - fileSystemLocations: serializeAws_json1_1ProjectFileSystemLocations(input.fileSystemLocations, context), - }), - ...(input.logsConfig !== undefined && { logsConfig: serializeAws_json1_1LogsConfig(input.logsConfig, context) }), - ...(input.name !== undefined && { name: input.name }), - ...(input.queuedTimeoutInMinutes !== undefined && { queuedTimeoutInMinutes: input.queuedTimeoutInMinutes }), - ...(input.secondaryArtifacts !== undefined && { - secondaryArtifacts: serializeAws_json1_1ProjectArtifactsList(input.secondaryArtifacts, context), - }), - ...(input.secondarySourceVersions !== undefined && { - secondarySourceVersions: serializeAws_json1_1ProjectSecondarySourceVersions( - input.secondarySourceVersions, - context - ), - }), - ...(input.secondarySources !== undefined && { - secondarySources: serializeAws_json1_1ProjectSources(input.secondarySources, context), - }), - ...(input.serviceRole !== undefined && { serviceRole: input.serviceRole }), - ...(input.source !== undefined && { source: serializeAws_json1_1ProjectSource(input.source, context) }), - ...(input.sourceVersion !== undefined && { sourceVersion: input.sourceVersion }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.timeoutInMinutes !== undefined && { timeoutInMinutes: input.timeoutInMinutes }), - ...(input.vpcConfig !== undefined && { vpcConfig: serializeAws_json1_1VpcConfig(input.vpcConfig, context) }), + ...(input.artifacts !== undefined && + input.artifacts !== null && { artifacts: serializeAws_json1_1ProjectArtifacts(input.artifacts, context) }), + ...(input.badgeEnabled !== undefined && input.badgeEnabled !== null && { badgeEnabled: input.badgeEnabled }), + ...(input.buildBatchConfig !== undefined && + input.buildBatchConfig !== null && { + buildBatchConfig: serializeAws_json1_1ProjectBuildBatchConfig(input.buildBatchConfig, context), + }), + ...(input.cache !== undefined && + input.cache !== null && { cache: serializeAws_json1_1ProjectCache(input.cache, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.encryptionKey !== undefined && input.encryptionKey !== null && { encryptionKey: input.encryptionKey }), + ...(input.environment !== undefined && + input.environment !== null && { + environment: serializeAws_json1_1ProjectEnvironment(input.environment, context), + }), + ...(input.fileSystemLocations !== undefined && + input.fileSystemLocations !== null && { + fileSystemLocations: serializeAws_json1_1ProjectFileSystemLocations(input.fileSystemLocations, context), + }), + ...(input.logsConfig !== undefined && + input.logsConfig !== null && { logsConfig: serializeAws_json1_1LogsConfig(input.logsConfig, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.queuedTimeoutInMinutes !== undefined && + input.queuedTimeoutInMinutes !== null && { queuedTimeoutInMinutes: input.queuedTimeoutInMinutes }), + ...(input.secondaryArtifacts !== undefined && + input.secondaryArtifacts !== null && { + secondaryArtifacts: serializeAws_json1_1ProjectArtifactsList(input.secondaryArtifacts, context), + }), + ...(input.secondarySourceVersions !== undefined && + input.secondarySourceVersions !== null && { + secondarySourceVersions: serializeAws_json1_1ProjectSecondarySourceVersions( + input.secondarySourceVersions, + context + ), + }), + ...(input.secondarySources !== undefined && + input.secondarySources !== null && { + secondarySources: serializeAws_json1_1ProjectSources(input.secondarySources, context), + }), + ...(input.serviceRole !== undefined && input.serviceRole !== null && { serviceRole: input.serviceRole }), + ...(input.source !== undefined && + input.source !== null && { source: serializeAws_json1_1ProjectSource(input.source, context) }), + ...(input.sourceVersion !== undefined && input.sourceVersion !== null && { sourceVersion: input.sourceVersion }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.timeoutInMinutes !== undefined && + input.timeoutInMinutes !== null && { timeoutInMinutes: input.timeoutInMinutes }), + ...(input.vpcConfig !== undefined && + input.vpcConfig !== null && { vpcConfig: serializeAws_json1_1VpcConfig(input.vpcConfig, context) }), }; }; const serializeAws_json1_1CreateReportGroupInput = (input: CreateReportGroupInput, context: __SerdeContext): any => { return { - ...(input.exportConfig !== undefined && { - exportConfig: serializeAws_json1_1ReportExportConfig(input.exportConfig, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.exportConfig !== undefined && + input.exportConfig !== null && { + exportConfig: serializeAws_json1_1ReportExportConfig(input.exportConfig, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1CreateWebhookInput = (input: CreateWebhookInput, context: __SerdeContext): any => { return { - ...(input.branchFilter !== undefined && { branchFilter: input.branchFilter }), - ...(input.buildType !== undefined && { buildType: input.buildType }), - ...(input.filterGroups !== undefined && { - filterGroups: serializeAws_json1_1FilterGroups(input.filterGroups, context), - }), - ...(input.projectName !== undefined && { projectName: input.projectName }), + ...(input.branchFilter !== undefined && input.branchFilter !== null && { branchFilter: input.branchFilter }), + ...(input.buildType !== undefined && input.buildType !== null && { buildType: input.buildType }), + ...(input.filterGroups !== undefined && + input.filterGroups !== null && { filterGroups: serializeAws_json1_1FilterGroups(input.filterGroups, context) }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), }; }; const serializeAws_json1_1DeleteBuildBatchInput = (input: DeleteBuildBatchInput, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_json1_1DeleteProjectInput = (input: DeleteProjectInput, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1DeleteReportGroupInput = (input: DeleteReportGroupInput, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.deleteReports !== undefined && { deleteReports: input.deleteReports }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.deleteReports !== undefined && input.deleteReports !== null && { deleteReports: input.deleteReports }), }; }; const serializeAws_json1_1DeleteReportInput = (input: DeleteReportInput, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -3736,7 +3732,7 @@ const serializeAws_json1_1DeleteResourcePolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; @@ -3745,13 +3741,13 @@ const serializeAws_json1_1DeleteSourceCredentialsInput = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1DeleteWebhookInput = (input: DeleteWebhookInput, context: __SerdeContext): any => { return { - ...(input.projectName !== undefined && { projectName: input.projectName }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), }; }; @@ -3760,47 +3756,67 @@ const serializeAws_json1_1DescribeCodeCoveragesInput = ( context: __SerdeContext ): any => { return { - ...(input.maxLineCoveragePercentage !== undefined && { - maxLineCoveragePercentage: input.maxLineCoveragePercentage, - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.minLineCoveragePercentage !== undefined && { - minLineCoveragePercentage: input.minLineCoveragePercentage, - }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.reportArn !== undefined && { reportArn: input.reportArn }), - ...(input.sortBy !== undefined && { sortBy: input.sortBy }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.maxLineCoveragePercentage !== undefined && + input.maxLineCoveragePercentage !== null && { maxLineCoveragePercentage: input.maxLineCoveragePercentage }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.minLineCoveragePercentage !== undefined && + input.minLineCoveragePercentage !== null && { minLineCoveragePercentage: input.minLineCoveragePercentage }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.reportArn !== undefined && input.reportArn !== null && { reportArn: input.reportArn }), + ...(input.sortBy !== undefined && input.sortBy !== null && { sortBy: input.sortBy }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; const serializeAws_json1_1DescribeTestCasesInput = (input: DescribeTestCasesInput, context: __SerdeContext): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1TestCaseFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.reportArn !== undefined && { reportArn: input.reportArn }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1TestCaseFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.reportArn !== undefined && input.reportArn !== null && { reportArn: input.reportArn }), }; }; const serializeAws_json1_1EnvironmentVariable = (input: EnvironmentVariable, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.type !== undefined && { type: input.type }), - ...(input.value !== undefined && { value: input.value }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1EnvironmentVariables = (input: EnvironmentVariable[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EnvironmentVariable(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EnvironmentVariable(entry, context); + }); }; const serializeAws_json1_1FilterGroup = (input: WebhookFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1WebhookFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1WebhookFilter(entry, context); + }); }; const serializeAws_json1_1FilterGroups = (input: WebhookFilter[][], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FilterGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FilterGroup(entry, context); + }); }; const serializeAws_json1_1GetReportGroupTrendInput = ( @@ -3808,21 +3824,23 @@ const serializeAws_json1_1GetReportGroupTrendInput = ( context: __SerdeContext ): any => { return { - ...(input.numOfReports !== undefined && { numOfReports: input.numOfReports }), - ...(input.reportGroupArn !== undefined && { reportGroupArn: input.reportGroupArn }), - ...(input.trendField !== undefined && { trendField: input.trendField }), + ...(input.numOfReports !== undefined && input.numOfReports !== null && { numOfReports: input.numOfReports }), + ...(input.reportGroupArn !== undefined && + input.reportGroupArn !== null && { reportGroupArn: input.reportGroupArn }), + ...(input.trendField !== undefined && input.trendField !== null && { trendField: input.trendField }), }; }; const serializeAws_json1_1GetResourcePolicyInput = (input: GetResourcePolicyInput, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_1GitSubmodulesConfig = (input: GitSubmodulesConfig, context: __SerdeContext): any => { return { - ...(input.fetchSubmodules !== undefined && { fetchSubmodules: input.fetchSubmodules }), + ...(input.fetchSubmodules !== undefined && + input.fetchSubmodules !== null && { fetchSubmodules: input.fetchSubmodules }), }; }; @@ -3831,11 +3849,12 @@ const serializeAws_json1_1ImportSourceCredentialsInput = ( context: __SerdeContext ): any => { return { - ...(input.authType !== undefined && { authType: input.authType }), - ...(input.serverType !== undefined && { serverType: input.serverType }), - ...(input.shouldOverwrite !== undefined && { shouldOverwrite: input.shouldOverwrite }), - ...(input.token !== undefined && { token: input.token }), - ...(input.username !== undefined && { username: input.username }), + ...(input.authType !== undefined && input.authType !== null && { authType: input.authType }), + ...(input.serverType !== undefined && input.serverType !== null && { serverType: input.serverType }), + ...(input.shouldOverwrite !== undefined && + input.shouldOverwrite !== null && { shouldOverwrite: input.shouldOverwrite }), + ...(input.token !== undefined && input.token !== null && { token: input.token }), + ...(input.username !== undefined && input.username !== null && { username: input.username }), }; }; @@ -3844,7 +3863,7 @@ const serializeAws_json1_1InvalidateProjectCacheInput = ( context: __SerdeContext ): any => { return { - ...(input.projectName !== undefined && { projectName: input.projectName }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), }; }; @@ -3853,20 +3872,22 @@ const serializeAws_json1_1ListBuildBatchesForProjectInput = ( context: __SerdeContext ): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1BuildBatchFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.projectName !== undefined && { projectName: input.projectName }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1BuildBatchFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; const serializeAws_json1_1ListBuildBatchesInput = (input: ListBuildBatchesInput, context: __SerdeContext): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1BuildBatchFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1BuildBatchFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; @@ -3875,16 +3896,16 @@ const serializeAws_json1_1ListBuildsForProjectInput = ( context: __SerdeContext ): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.projectName !== undefined && { projectName: input.projectName }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; const serializeAws_json1_1ListBuildsInput = (input: ListBuildsInput, context: __SerdeContext): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; @@ -3897,18 +3918,18 @@ const serializeAws_json1_1ListCuratedEnvironmentImagesInput = ( const serializeAws_json1_1ListProjectsInput = (input: ListProjectsInput, context: __SerdeContext): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortBy !== undefined && { sortBy: input.sortBy }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortBy !== undefined && input.sortBy !== null && { sortBy: input.sortBy }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; const serializeAws_json1_1ListReportGroupsInput = (input: ListReportGroupsInput, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortBy !== undefined && { sortBy: input.sortBy }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortBy !== undefined && input.sortBy !== null && { sortBy: input.sortBy }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; @@ -3917,29 +3938,32 @@ const serializeAws_json1_1ListReportsForReportGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1ReportFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.reportGroupArn !== undefined && { reportGroupArn: input.reportGroupArn }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1ReportFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.reportGroupArn !== undefined && + input.reportGroupArn !== null && { reportGroupArn: input.reportGroupArn }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; const serializeAws_json1_1ListReportsInput = (input: ListReportsInput, context: __SerdeContext): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1ReportFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1ReportFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; const serializeAws_json1_1ListSharedProjectsInput = (input: ListSharedProjectsInput, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortBy !== undefined && { sortBy: input.sortBy }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortBy !== undefined && input.sortBy !== null && { sortBy: input.sortBy }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; @@ -3948,10 +3972,10 @@ const serializeAws_json1_1ListSharedReportGroupsInput = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortBy !== undefined && { sortBy: input.sortBy }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortBy !== undefined && input.sortBy !== null && { sortBy: input.sortBy }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; @@ -3964,68 +3988,94 @@ const serializeAws_json1_1ListSourceCredentialsInput = ( const serializeAws_json1_1LogsConfig = (input: LogsConfig, context: __SerdeContext): any => { return { - ...(input.cloudWatchLogs !== undefined && { - cloudWatchLogs: serializeAws_json1_1CloudWatchLogsConfig(input.cloudWatchLogs, context), - }), - ...(input.s3Logs !== undefined && { s3Logs: serializeAws_json1_1S3LogsConfig(input.s3Logs, context) }), + ...(input.cloudWatchLogs !== undefined && + input.cloudWatchLogs !== null && { + cloudWatchLogs: serializeAws_json1_1CloudWatchLogsConfig(input.cloudWatchLogs, context), + }), + ...(input.s3Logs !== undefined && + input.s3Logs !== null && { s3Logs: serializeAws_json1_1S3LogsConfig(input.s3Logs, context) }), }; }; const serializeAws_json1_1ProjectArtifacts = (input: ProjectArtifacts, context: __SerdeContext): any => { return { - ...(input.artifactIdentifier !== undefined && { artifactIdentifier: input.artifactIdentifier }), - ...(input.encryptionDisabled !== undefined && { encryptionDisabled: input.encryptionDisabled }), - ...(input.location !== undefined && { location: input.location }), - ...(input.name !== undefined && { name: input.name }), - ...(input.namespaceType !== undefined && { namespaceType: input.namespaceType }), - ...(input.overrideArtifactName !== undefined && { overrideArtifactName: input.overrideArtifactName }), - ...(input.packaging !== undefined && { packaging: input.packaging }), - ...(input.path !== undefined && { path: input.path }), - ...(input.type !== undefined && { type: input.type }), + ...(input.artifactIdentifier !== undefined && + input.artifactIdentifier !== null && { artifactIdentifier: input.artifactIdentifier }), + ...(input.encryptionDisabled !== undefined && + input.encryptionDisabled !== null && { encryptionDisabled: input.encryptionDisabled }), + ...(input.location !== undefined && input.location !== null && { location: input.location }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.namespaceType !== undefined && input.namespaceType !== null && { namespaceType: input.namespaceType }), + ...(input.overrideArtifactName !== undefined && + input.overrideArtifactName !== null && { overrideArtifactName: input.overrideArtifactName }), + ...(input.packaging !== undefined && input.packaging !== null && { packaging: input.packaging }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1ProjectArtifactsList = (input: ProjectArtifacts[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ProjectArtifacts(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProjectArtifacts(entry, context); + }); }; const serializeAws_json1_1ProjectBuildBatchConfig = (input: ProjectBuildBatchConfig, context: __SerdeContext): any => { return { - ...(input.combineArtifacts !== undefined && { combineArtifacts: input.combineArtifacts }), - ...(input.restrictions !== undefined && { - restrictions: serializeAws_json1_1BatchRestrictions(input.restrictions, context), - }), - ...(input.serviceRole !== undefined && { serviceRole: input.serviceRole }), - ...(input.timeoutInMins !== undefined && { timeoutInMins: input.timeoutInMins }), + ...(input.combineArtifacts !== undefined && + input.combineArtifacts !== null && { combineArtifacts: input.combineArtifacts }), + ...(input.restrictions !== undefined && + input.restrictions !== null && { + restrictions: serializeAws_json1_1BatchRestrictions(input.restrictions, context), + }), + ...(input.serviceRole !== undefined && input.serviceRole !== null && { serviceRole: input.serviceRole }), + ...(input.timeoutInMins !== undefined && input.timeoutInMins !== null && { timeoutInMins: input.timeoutInMins }), }; }; const serializeAws_json1_1ProjectCache = (input: ProjectCache, context: __SerdeContext): any => { return { - ...(input.location !== undefined && { location: input.location }), - ...(input.modes !== undefined && { modes: serializeAws_json1_1ProjectCacheModes(input.modes, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.location !== undefined && input.location !== null && { location: input.location }), + ...(input.modes !== undefined && + input.modes !== null && { modes: serializeAws_json1_1ProjectCacheModes(input.modes, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1ProjectCacheModes = (input: (CacheMode | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ProjectEnvironment = (input: ProjectEnvironment, context: __SerdeContext): any => { return { - ...(input.certificate !== undefined && { certificate: input.certificate }), - ...(input.computeType !== undefined && { computeType: input.computeType }), - ...(input.environmentVariables !== undefined && { - environmentVariables: serializeAws_json1_1EnvironmentVariables(input.environmentVariables, context), - }), - ...(input.image !== undefined && { image: input.image }), - ...(input.imagePullCredentialsType !== undefined && { imagePullCredentialsType: input.imagePullCredentialsType }), - ...(input.privilegedMode !== undefined && { privilegedMode: input.privilegedMode }), - ...(input.registryCredential !== undefined && { - registryCredential: serializeAws_json1_1RegistryCredential(input.registryCredential, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.certificate !== undefined && input.certificate !== null && { certificate: input.certificate }), + ...(input.computeType !== undefined && input.computeType !== null && { computeType: input.computeType }), + ...(input.environmentVariables !== undefined && + input.environmentVariables !== null && { + environmentVariables: serializeAws_json1_1EnvironmentVariables(input.environmentVariables, context), + }), + ...(input.image !== undefined && input.image !== null && { image: input.image }), + ...(input.imagePullCredentialsType !== undefined && + input.imagePullCredentialsType !== null && { imagePullCredentialsType: input.imagePullCredentialsType }), + ...(input.privilegedMode !== undefined && + input.privilegedMode !== null && { privilegedMode: input.privilegedMode }), + ...(input.registryCredential !== undefined && + input.registryCredential !== null && { + registryCredential: serializeAws_json1_1RegistryCredential(input.registryCredential, context), + }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -4034,11 +4084,11 @@ const serializeAws_json1_1ProjectFileSystemLocation = ( context: __SerdeContext ): any => { return { - ...(input.identifier !== undefined && { identifier: input.identifier }), - ...(input.location !== undefined && { location: input.location }), - ...(input.mountOptions !== undefined && { mountOptions: input.mountOptions }), - ...(input.mountPoint !== undefined && { mountPoint: input.mountPoint }), - ...(input.type !== undefined && { type: input.type }), + ...(input.identifier !== undefined && input.identifier !== null && { identifier: input.identifier }), + ...(input.location !== undefined && input.location !== null && { location: input.location }), + ...(input.mountOptions !== undefined && input.mountOptions !== null && { mountOptions: input.mountOptions }), + ...(input.mountPoint !== undefined && input.mountPoint !== null && { mountPoint: input.mountPoint }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -4046,383 +4096,534 @@ const serializeAws_json1_1ProjectFileSystemLocations = ( input: ProjectFileSystemLocation[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ProjectFileSystemLocation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProjectFileSystemLocation(entry, context); + }); }; const serializeAws_json1_1ProjectNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ProjectSecondarySourceVersions = ( input: ProjectSourceVersion[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ProjectSourceVersion(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProjectSourceVersion(entry, context); + }); }; const serializeAws_json1_1ProjectSource = (input: ProjectSource, context: __SerdeContext): any => { return { - ...(input.auth !== undefined && { auth: serializeAws_json1_1SourceAuth(input.auth, context) }), - ...(input.buildStatusConfig !== undefined && { - buildStatusConfig: serializeAws_json1_1BuildStatusConfig(input.buildStatusConfig, context), - }), - ...(input.buildspec !== undefined && { buildspec: input.buildspec }), - ...(input.gitCloneDepth !== undefined && { gitCloneDepth: input.gitCloneDepth }), - ...(input.gitSubmodulesConfig !== undefined && { - gitSubmodulesConfig: serializeAws_json1_1GitSubmodulesConfig(input.gitSubmodulesConfig, context), - }), - ...(input.insecureSsl !== undefined && { insecureSsl: input.insecureSsl }), - ...(input.location !== undefined && { location: input.location }), - ...(input.reportBuildStatus !== undefined && { reportBuildStatus: input.reportBuildStatus }), - ...(input.sourceIdentifier !== undefined && { sourceIdentifier: input.sourceIdentifier }), - ...(input.type !== undefined && { type: input.type }), + ...(input.auth !== undefined && + input.auth !== null && { auth: serializeAws_json1_1SourceAuth(input.auth, context) }), + ...(input.buildStatusConfig !== undefined && + input.buildStatusConfig !== null && { + buildStatusConfig: serializeAws_json1_1BuildStatusConfig(input.buildStatusConfig, context), + }), + ...(input.buildspec !== undefined && input.buildspec !== null && { buildspec: input.buildspec }), + ...(input.gitCloneDepth !== undefined && input.gitCloneDepth !== null && { gitCloneDepth: input.gitCloneDepth }), + ...(input.gitSubmodulesConfig !== undefined && + input.gitSubmodulesConfig !== null && { + gitSubmodulesConfig: serializeAws_json1_1GitSubmodulesConfig(input.gitSubmodulesConfig, context), + }), + ...(input.insecureSsl !== undefined && input.insecureSsl !== null && { insecureSsl: input.insecureSsl }), + ...(input.location !== undefined && input.location !== null && { location: input.location }), + ...(input.reportBuildStatus !== undefined && + input.reportBuildStatus !== null && { reportBuildStatus: input.reportBuildStatus }), + ...(input.sourceIdentifier !== undefined && + input.sourceIdentifier !== null && { sourceIdentifier: input.sourceIdentifier }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1ProjectSources = (input: ProjectSource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ProjectSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProjectSource(entry, context); + }); }; const serializeAws_json1_1ProjectSourceVersion = (input: ProjectSourceVersion, context: __SerdeContext): any => { return { - ...(input.sourceIdentifier !== undefined && { sourceIdentifier: input.sourceIdentifier }), - ...(input.sourceVersion !== undefined && { sourceVersion: input.sourceVersion }), + ...(input.sourceIdentifier !== undefined && + input.sourceIdentifier !== null && { sourceIdentifier: input.sourceIdentifier }), + ...(input.sourceVersion !== undefined && input.sourceVersion !== null && { sourceVersion: input.sourceVersion }), }; }; const serializeAws_json1_1PutResourcePolicyInput = (input: PutResourcePolicyInput, context: __SerdeContext): any => { return { - ...(input.policy !== undefined && { policy: input.policy }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.policy !== undefined && input.policy !== null && { policy: input.policy }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_1RegistryCredential = (input: RegistryCredential, context: __SerdeContext): any => { return { - ...(input.credential !== undefined && { credential: input.credential }), - ...(input.credentialProvider !== undefined && { credentialProvider: input.credentialProvider }), + ...(input.credential !== undefined && input.credential !== null && { credential: input.credential }), + ...(input.credentialProvider !== undefined && + input.credentialProvider !== null && { credentialProvider: input.credentialProvider }), }; }; const serializeAws_json1_1ReportArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ReportExportConfig = (input: ReportExportConfig, context: __SerdeContext): any => { return { - ...(input.exportConfigType !== undefined && { exportConfigType: input.exportConfigType }), - ...(input.s3Destination !== undefined && { - s3Destination: serializeAws_json1_1S3ReportExportConfig(input.s3Destination, context), - }), + ...(input.exportConfigType !== undefined && + input.exportConfigType !== null && { exportConfigType: input.exportConfigType }), + ...(input.s3Destination !== undefined && + input.s3Destination !== null && { + s3Destination: serializeAws_json1_1S3ReportExportConfig(input.s3Destination, context), + }), }; }; const serializeAws_json1_1ReportFilter = (input: ReportFilter, context: __SerdeContext): any => { return { - ...(input.status !== undefined && { status: input.status }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1ReportGroupArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RetryBuildBatchInput = (input: RetryBuildBatchInput, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.idempotencyToken !== undefined && { idempotencyToken: input.idempotencyToken }), - ...(input.retryType !== undefined && { retryType: input.retryType }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.idempotencyToken !== undefined && + input.idempotencyToken !== null && { idempotencyToken: input.idempotencyToken }), + ...(input.retryType !== undefined && input.retryType !== null && { retryType: input.retryType }), }; }; const serializeAws_json1_1RetryBuildInput = (input: RetryBuildInput, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.idempotencyToken !== undefined && { idempotencyToken: input.idempotencyToken }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.idempotencyToken !== undefined && + input.idempotencyToken !== null && { idempotencyToken: input.idempotencyToken }), }; }; const serializeAws_json1_1S3LogsConfig = (input: S3LogsConfig, context: __SerdeContext): any => { return { - ...(input.encryptionDisabled !== undefined && { encryptionDisabled: input.encryptionDisabled }), - ...(input.location !== undefined && { location: input.location }), - ...(input.status !== undefined && { status: input.status }), + ...(input.encryptionDisabled !== undefined && + input.encryptionDisabled !== null && { encryptionDisabled: input.encryptionDisabled }), + ...(input.location !== undefined && input.location !== null && { location: input.location }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1S3ReportExportConfig = (input: S3ReportExportConfig, context: __SerdeContext): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.encryptionDisabled !== undefined && { encryptionDisabled: input.encryptionDisabled }), - ...(input.encryptionKey !== undefined && { encryptionKey: input.encryptionKey }), - ...(input.packaging !== undefined && { packaging: input.packaging }), - ...(input.path !== undefined && { path: input.path }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.encryptionDisabled !== undefined && + input.encryptionDisabled !== null && { encryptionDisabled: input.encryptionDisabled }), + ...(input.encryptionKey !== undefined && input.encryptionKey !== null && { encryptionKey: input.encryptionKey }), + ...(input.packaging !== undefined && input.packaging !== null && { packaging: input.packaging }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), }; }; const serializeAws_json1_1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SourceAuth = (input: SourceAuth, context: __SerdeContext): any => { return { - ...(input.resource !== undefined && { resource: input.resource }), - ...(input.type !== undefined && { type: input.type }), + ...(input.resource !== undefined && input.resource !== null && { resource: input.resource }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1StartBuildBatchInput = (input: StartBuildBatchInput, context: __SerdeContext): any => { return { - ...(input.artifactsOverride !== undefined && { - artifactsOverride: serializeAws_json1_1ProjectArtifacts(input.artifactsOverride, context), - }), - ...(input.buildBatchConfigOverride !== undefined && { - buildBatchConfigOverride: serializeAws_json1_1ProjectBuildBatchConfig(input.buildBatchConfigOverride, context), - }), - ...(input.buildTimeoutInMinutesOverride !== undefined && { - buildTimeoutInMinutesOverride: input.buildTimeoutInMinutesOverride, - }), - ...(input.buildspecOverride !== undefined && { buildspecOverride: input.buildspecOverride }), - ...(input.cacheOverride !== undefined && { - cacheOverride: serializeAws_json1_1ProjectCache(input.cacheOverride, context), - }), - ...(input.certificateOverride !== undefined && { certificateOverride: input.certificateOverride }), - ...(input.computeTypeOverride !== undefined && { computeTypeOverride: input.computeTypeOverride }), - ...(input.encryptionKeyOverride !== undefined && { encryptionKeyOverride: input.encryptionKeyOverride }), - ...(input.environmentTypeOverride !== undefined && { environmentTypeOverride: input.environmentTypeOverride }), - ...(input.environmentVariablesOverride !== undefined && { - environmentVariablesOverride: serializeAws_json1_1EnvironmentVariables( - input.environmentVariablesOverride, - context - ), - }), - ...(input.gitCloneDepthOverride !== undefined && { gitCloneDepthOverride: input.gitCloneDepthOverride }), - ...(input.gitSubmodulesConfigOverride !== undefined && { - gitSubmodulesConfigOverride: serializeAws_json1_1GitSubmodulesConfig(input.gitSubmodulesConfigOverride, context), - }), - ...(input.idempotencyToken !== undefined && { idempotencyToken: input.idempotencyToken }), - ...(input.imageOverride !== undefined && { imageOverride: input.imageOverride }), - ...(input.imagePullCredentialsTypeOverride !== undefined && { - imagePullCredentialsTypeOverride: input.imagePullCredentialsTypeOverride, - }), - ...(input.insecureSslOverride !== undefined && { insecureSslOverride: input.insecureSslOverride }), - ...(input.logsConfigOverride !== undefined && { - logsConfigOverride: serializeAws_json1_1LogsConfig(input.logsConfigOverride, context), - }), - ...(input.privilegedModeOverride !== undefined && { privilegedModeOverride: input.privilegedModeOverride }), - ...(input.projectName !== undefined && { projectName: input.projectName }), - ...(input.queuedTimeoutInMinutesOverride !== undefined && { - queuedTimeoutInMinutesOverride: input.queuedTimeoutInMinutesOverride, - }), - ...(input.registryCredentialOverride !== undefined && { - registryCredentialOverride: serializeAws_json1_1RegistryCredential(input.registryCredentialOverride, context), - }), - ...(input.reportBuildBatchStatusOverride !== undefined && { - reportBuildBatchStatusOverride: input.reportBuildBatchStatusOverride, - }), - ...(input.secondaryArtifactsOverride !== undefined && { - secondaryArtifactsOverride: serializeAws_json1_1ProjectArtifactsList(input.secondaryArtifactsOverride, context), - }), - ...(input.secondarySourcesOverride !== undefined && { - secondarySourcesOverride: serializeAws_json1_1ProjectSources(input.secondarySourcesOverride, context), - }), - ...(input.secondarySourcesVersionOverride !== undefined && { - secondarySourcesVersionOverride: serializeAws_json1_1ProjectSecondarySourceVersions( - input.secondarySourcesVersionOverride, - context - ), - }), - ...(input.serviceRoleOverride !== undefined && { serviceRoleOverride: input.serviceRoleOverride }), - ...(input.sourceAuthOverride !== undefined && { - sourceAuthOverride: serializeAws_json1_1SourceAuth(input.sourceAuthOverride, context), - }), - ...(input.sourceLocationOverride !== undefined && { sourceLocationOverride: input.sourceLocationOverride }), - ...(input.sourceTypeOverride !== undefined && { sourceTypeOverride: input.sourceTypeOverride }), - ...(input.sourceVersion !== undefined && { sourceVersion: input.sourceVersion }), + ...(input.artifactsOverride !== undefined && + input.artifactsOverride !== null && { + artifactsOverride: serializeAws_json1_1ProjectArtifacts(input.artifactsOverride, context), + }), + ...(input.buildBatchConfigOverride !== undefined && + input.buildBatchConfigOverride !== null && { + buildBatchConfigOverride: serializeAws_json1_1ProjectBuildBatchConfig(input.buildBatchConfigOverride, context), + }), + ...(input.buildTimeoutInMinutesOverride !== undefined && + input.buildTimeoutInMinutesOverride !== null && { + buildTimeoutInMinutesOverride: input.buildTimeoutInMinutesOverride, + }), + ...(input.buildspecOverride !== undefined && + input.buildspecOverride !== null && { buildspecOverride: input.buildspecOverride }), + ...(input.cacheOverride !== undefined && + input.cacheOverride !== null && { + cacheOverride: serializeAws_json1_1ProjectCache(input.cacheOverride, context), + }), + ...(input.certificateOverride !== undefined && + input.certificateOverride !== null && { certificateOverride: input.certificateOverride }), + ...(input.computeTypeOverride !== undefined && + input.computeTypeOverride !== null && { computeTypeOverride: input.computeTypeOverride }), + ...(input.encryptionKeyOverride !== undefined && + input.encryptionKeyOverride !== null && { encryptionKeyOverride: input.encryptionKeyOverride }), + ...(input.environmentTypeOverride !== undefined && + input.environmentTypeOverride !== null && { environmentTypeOverride: input.environmentTypeOverride }), + ...(input.environmentVariablesOverride !== undefined && + input.environmentVariablesOverride !== null && { + environmentVariablesOverride: serializeAws_json1_1EnvironmentVariables( + input.environmentVariablesOverride, + context + ), + }), + ...(input.gitCloneDepthOverride !== undefined && + input.gitCloneDepthOverride !== null && { gitCloneDepthOverride: input.gitCloneDepthOverride }), + ...(input.gitSubmodulesConfigOverride !== undefined && + input.gitSubmodulesConfigOverride !== null && { + gitSubmodulesConfigOverride: serializeAws_json1_1GitSubmodulesConfig( + input.gitSubmodulesConfigOverride, + context + ), + }), + ...(input.idempotencyToken !== undefined && + input.idempotencyToken !== null && { idempotencyToken: input.idempotencyToken }), + ...(input.imageOverride !== undefined && input.imageOverride !== null && { imageOverride: input.imageOverride }), + ...(input.imagePullCredentialsTypeOverride !== undefined && + input.imagePullCredentialsTypeOverride !== null && { + imagePullCredentialsTypeOverride: input.imagePullCredentialsTypeOverride, + }), + ...(input.insecureSslOverride !== undefined && + input.insecureSslOverride !== null && { insecureSslOverride: input.insecureSslOverride }), + ...(input.logsConfigOverride !== undefined && + input.logsConfigOverride !== null && { + logsConfigOverride: serializeAws_json1_1LogsConfig(input.logsConfigOverride, context), + }), + ...(input.privilegedModeOverride !== undefined && + input.privilegedModeOverride !== null && { privilegedModeOverride: input.privilegedModeOverride }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), + ...(input.queuedTimeoutInMinutesOverride !== undefined && + input.queuedTimeoutInMinutesOverride !== null && { + queuedTimeoutInMinutesOverride: input.queuedTimeoutInMinutesOverride, + }), + ...(input.registryCredentialOverride !== undefined && + input.registryCredentialOverride !== null && { + registryCredentialOverride: serializeAws_json1_1RegistryCredential(input.registryCredentialOverride, context), + }), + ...(input.reportBuildBatchStatusOverride !== undefined && + input.reportBuildBatchStatusOverride !== null && { + reportBuildBatchStatusOverride: input.reportBuildBatchStatusOverride, + }), + ...(input.secondaryArtifactsOverride !== undefined && + input.secondaryArtifactsOverride !== null && { + secondaryArtifactsOverride: serializeAws_json1_1ProjectArtifactsList(input.secondaryArtifactsOverride, context), + }), + ...(input.secondarySourcesOverride !== undefined && + input.secondarySourcesOverride !== null && { + secondarySourcesOverride: serializeAws_json1_1ProjectSources(input.secondarySourcesOverride, context), + }), + ...(input.secondarySourcesVersionOverride !== undefined && + input.secondarySourcesVersionOverride !== null && { + secondarySourcesVersionOverride: serializeAws_json1_1ProjectSecondarySourceVersions( + input.secondarySourcesVersionOverride, + context + ), + }), + ...(input.serviceRoleOverride !== undefined && + input.serviceRoleOverride !== null && { serviceRoleOverride: input.serviceRoleOverride }), + ...(input.sourceAuthOverride !== undefined && + input.sourceAuthOverride !== null && { + sourceAuthOverride: serializeAws_json1_1SourceAuth(input.sourceAuthOverride, context), + }), + ...(input.sourceLocationOverride !== undefined && + input.sourceLocationOverride !== null && { sourceLocationOverride: input.sourceLocationOverride }), + ...(input.sourceTypeOverride !== undefined && + input.sourceTypeOverride !== null && { sourceTypeOverride: input.sourceTypeOverride }), + ...(input.sourceVersion !== undefined && input.sourceVersion !== null && { sourceVersion: input.sourceVersion }), }; }; const serializeAws_json1_1StartBuildInput = (input: StartBuildInput, context: __SerdeContext): any => { return { - ...(input.artifactsOverride !== undefined && { - artifactsOverride: serializeAws_json1_1ProjectArtifacts(input.artifactsOverride, context), - }), - ...(input.buildStatusConfigOverride !== undefined && { - buildStatusConfigOverride: serializeAws_json1_1BuildStatusConfig(input.buildStatusConfigOverride, context), - }), - ...(input.buildspecOverride !== undefined && { buildspecOverride: input.buildspecOverride }), - ...(input.cacheOverride !== undefined && { - cacheOverride: serializeAws_json1_1ProjectCache(input.cacheOverride, context), - }), - ...(input.certificateOverride !== undefined && { certificateOverride: input.certificateOverride }), - ...(input.computeTypeOverride !== undefined && { computeTypeOverride: input.computeTypeOverride }), - ...(input.debugSessionEnabled !== undefined && { debugSessionEnabled: input.debugSessionEnabled }), - ...(input.encryptionKeyOverride !== undefined && { encryptionKeyOverride: input.encryptionKeyOverride }), - ...(input.environmentTypeOverride !== undefined && { environmentTypeOverride: input.environmentTypeOverride }), - ...(input.environmentVariablesOverride !== undefined && { - environmentVariablesOverride: serializeAws_json1_1EnvironmentVariables( - input.environmentVariablesOverride, - context - ), - }), - ...(input.gitCloneDepthOverride !== undefined && { gitCloneDepthOverride: input.gitCloneDepthOverride }), - ...(input.gitSubmodulesConfigOverride !== undefined && { - gitSubmodulesConfigOverride: serializeAws_json1_1GitSubmodulesConfig(input.gitSubmodulesConfigOverride, context), - }), - ...(input.idempotencyToken !== undefined && { idempotencyToken: input.idempotencyToken }), - ...(input.imageOverride !== undefined && { imageOverride: input.imageOverride }), - ...(input.imagePullCredentialsTypeOverride !== undefined && { - imagePullCredentialsTypeOverride: input.imagePullCredentialsTypeOverride, - }), - ...(input.insecureSslOverride !== undefined && { insecureSslOverride: input.insecureSslOverride }), - ...(input.logsConfigOverride !== undefined && { - logsConfigOverride: serializeAws_json1_1LogsConfig(input.logsConfigOverride, context), - }), - ...(input.privilegedModeOverride !== undefined && { privilegedModeOverride: input.privilegedModeOverride }), - ...(input.projectName !== undefined && { projectName: input.projectName }), - ...(input.queuedTimeoutInMinutesOverride !== undefined && { - queuedTimeoutInMinutesOverride: input.queuedTimeoutInMinutesOverride, - }), - ...(input.registryCredentialOverride !== undefined && { - registryCredentialOverride: serializeAws_json1_1RegistryCredential(input.registryCredentialOverride, context), - }), - ...(input.reportBuildStatusOverride !== undefined && { - reportBuildStatusOverride: input.reportBuildStatusOverride, - }), - ...(input.secondaryArtifactsOverride !== undefined && { - secondaryArtifactsOverride: serializeAws_json1_1ProjectArtifactsList(input.secondaryArtifactsOverride, context), - }), - ...(input.secondarySourcesOverride !== undefined && { - secondarySourcesOverride: serializeAws_json1_1ProjectSources(input.secondarySourcesOverride, context), - }), - ...(input.secondarySourcesVersionOverride !== undefined && { - secondarySourcesVersionOverride: serializeAws_json1_1ProjectSecondarySourceVersions( - input.secondarySourcesVersionOverride, - context - ), - }), - ...(input.serviceRoleOverride !== undefined && { serviceRoleOverride: input.serviceRoleOverride }), - ...(input.sourceAuthOverride !== undefined && { - sourceAuthOverride: serializeAws_json1_1SourceAuth(input.sourceAuthOverride, context), - }), - ...(input.sourceLocationOverride !== undefined && { sourceLocationOverride: input.sourceLocationOverride }), - ...(input.sourceTypeOverride !== undefined && { sourceTypeOverride: input.sourceTypeOverride }), - ...(input.sourceVersion !== undefined && { sourceVersion: input.sourceVersion }), - ...(input.timeoutInMinutesOverride !== undefined && { timeoutInMinutesOverride: input.timeoutInMinutesOverride }), + ...(input.artifactsOverride !== undefined && + input.artifactsOverride !== null && { + artifactsOverride: serializeAws_json1_1ProjectArtifacts(input.artifactsOverride, context), + }), + ...(input.buildStatusConfigOverride !== undefined && + input.buildStatusConfigOverride !== null && { + buildStatusConfigOverride: serializeAws_json1_1BuildStatusConfig(input.buildStatusConfigOverride, context), + }), + ...(input.buildspecOverride !== undefined && + input.buildspecOverride !== null && { buildspecOverride: input.buildspecOverride }), + ...(input.cacheOverride !== undefined && + input.cacheOverride !== null && { + cacheOverride: serializeAws_json1_1ProjectCache(input.cacheOverride, context), + }), + ...(input.certificateOverride !== undefined && + input.certificateOverride !== null && { certificateOverride: input.certificateOverride }), + ...(input.computeTypeOverride !== undefined && + input.computeTypeOverride !== null && { computeTypeOverride: input.computeTypeOverride }), + ...(input.debugSessionEnabled !== undefined && + input.debugSessionEnabled !== null && { debugSessionEnabled: input.debugSessionEnabled }), + ...(input.encryptionKeyOverride !== undefined && + input.encryptionKeyOverride !== null && { encryptionKeyOverride: input.encryptionKeyOverride }), + ...(input.environmentTypeOverride !== undefined && + input.environmentTypeOverride !== null && { environmentTypeOverride: input.environmentTypeOverride }), + ...(input.environmentVariablesOverride !== undefined && + input.environmentVariablesOverride !== null && { + environmentVariablesOverride: serializeAws_json1_1EnvironmentVariables( + input.environmentVariablesOverride, + context + ), + }), + ...(input.gitCloneDepthOverride !== undefined && + input.gitCloneDepthOverride !== null && { gitCloneDepthOverride: input.gitCloneDepthOverride }), + ...(input.gitSubmodulesConfigOverride !== undefined && + input.gitSubmodulesConfigOverride !== null && { + gitSubmodulesConfigOverride: serializeAws_json1_1GitSubmodulesConfig( + input.gitSubmodulesConfigOverride, + context + ), + }), + ...(input.idempotencyToken !== undefined && + input.idempotencyToken !== null && { idempotencyToken: input.idempotencyToken }), + ...(input.imageOverride !== undefined && input.imageOverride !== null && { imageOverride: input.imageOverride }), + ...(input.imagePullCredentialsTypeOverride !== undefined && + input.imagePullCredentialsTypeOverride !== null && { + imagePullCredentialsTypeOverride: input.imagePullCredentialsTypeOverride, + }), + ...(input.insecureSslOverride !== undefined && + input.insecureSslOverride !== null && { insecureSslOverride: input.insecureSslOverride }), + ...(input.logsConfigOverride !== undefined && + input.logsConfigOverride !== null && { + logsConfigOverride: serializeAws_json1_1LogsConfig(input.logsConfigOverride, context), + }), + ...(input.privilegedModeOverride !== undefined && + input.privilegedModeOverride !== null && { privilegedModeOverride: input.privilegedModeOverride }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), + ...(input.queuedTimeoutInMinutesOverride !== undefined && + input.queuedTimeoutInMinutesOverride !== null && { + queuedTimeoutInMinutesOverride: input.queuedTimeoutInMinutesOverride, + }), + ...(input.registryCredentialOverride !== undefined && + input.registryCredentialOverride !== null && { + registryCredentialOverride: serializeAws_json1_1RegistryCredential(input.registryCredentialOverride, context), + }), + ...(input.reportBuildStatusOverride !== undefined && + input.reportBuildStatusOverride !== null && { reportBuildStatusOverride: input.reportBuildStatusOverride }), + ...(input.secondaryArtifactsOverride !== undefined && + input.secondaryArtifactsOverride !== null && { + secondaryArtifactsOverride: serializeAws_json1_1ProjectArtifactsList(input.secondaryArtifactsOverride, context), + }), + ...(input.secondarySourcesOverride !== undefined && + input.secondarySourcesOverride !== null && { + secondarySourcesOverride: serializeAws_json1_1ProjectSources(input.secondarySourcesOverride, context), + }), + ...(input.secondarySourcesVersionOverride !== undefined && + input.secondarySourcesVersionOverride !== null && { + secondarySourcesVersionOverride: serializeAws_json1_1ProjectSecondarySourceVersions( + input.secondarySourcesVersionOverride, + context + ), + }), + ...(input.serviceRoleOverride !== undefined && + input.serviceRoleOverride !== null && { serviceRoleOverride: input.serviceRoleOverride }), + ...(input.sourceAuthOverride !== undefined && + input.sourceAuthOverride !== null && { + sourceAuthOverride: serializeAws_json1_1SourceAuth(input.sourceAuthOverride, context), + }), + ...(input.sourceLocationOverride !== undefined && + input.sourceLocationOverride !== null && { sourceLocationOverride: input.sourceLocationOverride }), + ...(input.sourceTypeOverride !== undefined && + input.sourceTypeOverride !== null && { sourceTypeOverride: input.sourceTypeOverride }), + ...(input.sourceVersion !== undefined && input.sourceVersion !== null && { sourceVersion: input.sourceVersion }), + ...(input.timeoutInMinutesOverride !== undefined && + input.timeoutInMinutesOverride !== null && { timeoutInMinutesOverride: input.timeoutInMinutesOverride }), }; }; const serializeAws_json1_1StopBuildBatchInput = (input: StopBuildBatchInput, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_json1_1StopBuildInput = (input: StopBuildInput, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_json1_1Subnets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TestCaseFilter = (input: TestCaseFilter, context: __SerdeContext): any => { return { - ...(input.keyword !== undefined && { keyword: input.keyword }), - ...(input.status !== undefined && { status: input.status }), + ...(input.keyword !== undefined && input.keyword !== null && { keyword: input.keyword }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1UpdateProjectInput = (input: UpdateProjectInput, context: __SerdeContext): any => { return { - ...(input.artifacts !== undefined && { artifacts: serializeAws_json1_1ProjectArtifacts(input.artifacts, context) }), - ...(input.badgeEnabled !== undefined && { badgeEnabled: input.badgeEnabled }), - ...(input.buildBatchConfig !== undefined && { - buildBatchConfig: serializeAws_json1_1ProjectBuildBatchConfig(input.buildBatchConfig, context), - }), - ...(input.cache !== undefined && { cache: serializeAws_json1_1ProjectCache(input.cache, context) }), - ...(input.description !== undefined && { description: input.description }), - ...(input.encryptionKey !== undefined && { encryptionKey: input.encryptionKey }), - ...(input.environment !== undefined && { - environment: serializeAws_json1_1ProjectEnvironment(input.environment, context), - }), - ...(input.fileSystemLocations !== undefined && { - fileSystemLocations: serializeAws_json1_1ProjectFileSystemLocations(input.fileSystemLocations, context), - }), - ...(input.logsConfig !== undefined && { logsConfig: serializeAws_json1_1LogsConfig(input.logsConfig, context) }), - ...(input.name !== undefined && { name: input.name }), - ...(input.queuedTimeoutInMinutes !== undefined && { queuedTimeoutInMinutes: input.queuedTimeoutInMinutes }), - ...(input.secondaryArtifacts !== undefined && { - secondaryArtifacts: serializeAws_json1_1ProjectArtifactsList(input.secondaryArtifacts, context), - }), - ...(input.secondarySourceVersions !== undefined && { - secondarySourceVersions: serializeAws_json1_1ProjectSecondarySourceVersions( - input.secondarySourceVersions, - context - ), - }), - ...(input.secondarySources !== undefined && { - secondarySources: serializeAws_json1_1ProjectSources(input.secondarySources, context), - }), - ...(input.serviceRole !== undefined && { serviceRole: input.serviceRole }), - ...(input.source !== undefined && { source: serializeAws_json1_1ProjectSource(input.source, context) }), - ...(input.sourceVersion !== undefined && { sourceVersion: input.sourceVersion }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.timeoutInMinutes !== undefined && { timeoutInMinutes: input.timeoutInMinutes }), - ...(input.vpcConfig !== undefined && { vpcConfig: serializeAws_json1_1VpcConfig(input.vpcConfig, context) }), + ...(input.artifacts !== undefined && + input.artifacts !== null && { artifacts: serializeAws_json1_1ProjectArtifacts(input.artifacts, context) }), + ...(input.badgeEnabled !== undefined && input.badgeEnabled !== null && { badgeEnabled: input.badgeEnabled }), + ...(input.buildBatchConfig !== undefined && + input.buildBatchConfig !== null && { + buildBatchConfig: serializeAws_json1_1ProjectBuildBatchConfig(input.buildBatchConfig, context), + }), + ...(input.cache !== undefined && + input.cache !== null && { cache: serializeAws_json1_1ProjectCache(input.cache, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.encryptionKey !== undefined && input.encryptionKey !== null && { encryptionKey: input.encryptionKey }), + ...(input.environment !== undefined && + input.environment !== null && { + environment: serializeAws_json1_1ProjectEnvironment(input.environment, context), + }), + ...(input.fileSystemLocations !== undefined && + input.fileSystemLocations !== null && { + fileSystemLocations: serializeAws_json1_1ProjectFileSystemLocations(input.fileSystemLocations, context), + }), + ...(input.logsConfig !== undefined && + input.logsConfig !== null && { logsConfig: serializeAws_json1_1LogsConfig(input.logsConfig, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.queuedTimeoutInMinutes !== undefined && + input.queuedTimeoutInMinutes !== null && { queuedTimeoutInMinutes: input.queuedTimeoutInMinutes }), + ...(input.secondaryArtifacts !== undefined && + input.secondaryArtifacts !== null && { + secondaryArtifacts: serializeAws_json1_1ProjectArtifactsList(input.secondaryArtifacts, context), + }), + ...(input.secondarySourceVersions !== undefined && + input.secondarySourceVersions !== null && { + secondarySourceVersions: serializeAws_json1_1ProjectSecondarySourceVersions( + input.secondarySourceVersions, + context + ), + }), + ...(input.secondarySources !== undefined && + input.secondarySources !== null && { + secondarySources: serializeAws_json1_1ProjectSources(input.secondarySources, context), + }), + ...(input.serviceRole !== undefined && input.serviceRole !== null && { serviceRole: input.serviceRole }), + ...(input.source !== undefined && + input.source !== null && { source: serializeAws_json1_1ProjectSource(input.source, context) }), + ...(input.sourceVersion !== undefined && input.sourceVersion !== null && { sourceVersion: input.sourceVersion }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.timeoutInMinutes !== undefined && + input.timeoutInMinutes !== null && { timeoutInMinutes: input.timeoutInMinutes }), + ...(input.vpcConfig !== undefined && + input.vpcConfig !== null && { vpcConfig: serializeAws_json1_1VpcConfig(input.vpcConfig, context) }), }; }; const serializeAws_json1_1UpdateReportGroupInput = (input: UpdateReportGroupInput, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.exportConfig !== undefined && { - exportConfig: serializeAws_json1_1ReportExportConfig(input.exportConfig, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.exportConfig !== undefined && + input.exportConfig !== null && { + exportConfig: serializeAws_json1_1ReportExportConfig(input.exportConfig, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1UpdateWebhookInput = (input: UpdateWebhookInput, context: __SerdeContext): any => { return { - ...(input.branchFilter !== undefined && { branchFilter: input.branchFilter }), - ...(input.buildType !== undefined && { buildType: input.buildType }), - ...(input.filterGroups !== undefined && { - filterGroups: serializeAws_json1_1FilterGroups(input.filterGroups, context), - }), - ...(input.projectName !== undefined && { projectName: input.projectName }), - ...(input.rotateSecret !== undefined && { rotateSecret: input.rotateSecret }), + ...(input.branchFilter !== undefined && input.branchFilter !== null && { branchFilter: input.branchFilter }), + ...(input.buildType !== undefined && input.buildType !== null && { buildType: input.buildType }), + ...(input.filterGroups !== undefined && + input.filterGroups !== null && { filterGroups: serializeAws_json1_1FilterGroups(input.filterGroups, context) }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), + ...(input.rotateSecret !== undefined && input.rotateSecret !== null && { rotateSecret: input.rotateSecret }), }; }; const serializeAws_json1_1VpcConfig = (input: VpcConfig, context: __SerdeContext): any => { return { - ...(input.securityGroupIds !== undefined && { - securityGroupIds: serializeAws_json1_1SecurityGroupIds(input.securityGroupIds, context), - }), - ...(input.subnets !== undefined && { subnets: serializeAws_json1_1Subnets(input.subnets, context) }), - ...(input.vpcId !== undefined && { vpcId: input.vpcId }), + ...(input.securityGroupIds !== undefined && + input.securityGroupIds !== null && { + securityGroupIds: serializeAws_json1_1SecurityGroupIds(input.securityGroupIds, context), + }), + ...(input.subnets !== undefined && + input.subnets !== null && { subnets: serializeAws_json1_1Subnets(input.subnets, context) }), + ...(input.vpcId !== undefined && input.vpcId !== null && { vpcId: input.vpcId }), }; }; const serializeAws_json1_1WebhookFilter = (input: WebhookFilter, context: __SerdeContext): any => { return { - ...(input.excludeMatchedPattern !== undefined && { excludeMatchedPattern: input.excludeMatchedPattern }), - ...(input.pattern !== undefined && { pattern: input.pattern }), - ...(input.type !== undefined && { type: input.type }), + ...(input.excludeMatchedPattern !== undefined && + input.excludeMatchedPattern !== null && { excludeMatchedPattern: input.excludeMatchedPattern }), + ...(input.pattern !== undefined && input.pattern !== null && { pattern: input.pattern }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -4653,7 +4854,14 @@ const deserializeAws_json1_1BuildArtifacts = (output: any, context: __SerdeConte }; const deserializeAws_json1_1BuildArtifactsList = (output: any, context: __SerdeContext): BuildArtifacts[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BuildArtifacts(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BuildArtifacts(entry, context); + }); }; const deserializeAws_json1_1BuildBatch = (output: any, context: __SerdeContext): BuildBatch => { @@ -4747,11 +4955,25 @@ const deserializeAws_json1_1BuildBatch = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1BuildBatches = (output: any, context: __SerdeContext): BuildBatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BuildBatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BuildBatch(entry, context); + }); }; const deserializeAws_json1_1BuildBatchIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1BuildBatchPhase = (output: any, context: __SerdeContext): BuildBatchPhase => { @@ -4776,7 +4998,14 @@ const deserializeAws_json1_1BuildBatchPhase = (output: any, context: __SerdeCont }; const deserializeAws_json1_1BuildBatchPhases = (output: any, context: __SerdeContext): BuildBatchPhase[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BuildBatchPhase(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BuildBatchPhase(entry, context); + }); }; const deserializeAws_json1_1BuildGroup = (output: any, context: __SerdeContext): BuildGroup => { @@ -4800,11 +5029,25 @@ const deserializeAws_json1_1BuildGroup = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1BuildGroups = (output: any, context: __SerdeContext): BuildGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BuildGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BuildGroup(entry, context); + }); }; const deserializeAws_json1_1BuildIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1BuildNotDeleted = (output: any, context: __SerdeContext): BuildNotDeleted => { @@ -4836,19 +5079,47 @@ const deserializeAws_json1_1BuildPhase = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1BuildPhases = (output: any, context: __SerdeContext): BuildPhase[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BuildPhase(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BuildPhase(entry, context); + }); }; const deserializeAws_json1_1BuildReportArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Builds = (output: any, context: __SerdeContext): Build[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Build(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Build(entry, context); + }); }; const deserializeAws_json1_1BuildsNotDeleted = (output: any, context: __SerdeContext): BuildNotDeleted[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BuildNotDeleted(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BuildNotDeleted(entry, context); + }); }; const deserializeAws_json1_1BuildStatusConfig = (output: any, context: __SerdeContext): BuildStatusConfig => { @@ -4859,7 +5130,14 @@ const deserializeAws_json1_1BuildStatusConfig = (output: any, context: __SerdeCo }; const deserializeAws_json1_1BuildSummaries = (output: any, context: __SerdeContext): BuildSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BuildSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BuildSummary(entry, context); + }); }; const deserializeAws_json1_1BuildSummary = (output: any, context: __SerdeContext): BuildSummary => { @@ -4936,11 +5214,25 @@ const deserializeAws_json1_1CodeCoverageReportSummary = ( }; const deserializeAws_json1_1CodeCoverages = (output: any, context: __SerdeContext): CodeCoverage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CodeCoverage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CodeCoverage(entry, context); + }); }; const deserializeAws_json1_1ComputeTypesAllowed = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CreateProjectOutput = (output: any, context: __SerdeContext): CreateProjectOutput => { @@ -5069,7 +5361,14 @@ const deserializeAws_json1_1EnvironmentImage = (output: any, context: __SerdeCon }; const deserializeAws_json1_1EnvironmentImages = (output: any, context: __SerdeContext): EnvironmentImage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EnvironmentImage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EnvironmentImage(entry, context); + }); }; const deserializeAws_json1_1EnvironmentLanguage = (output: any, context: __SerdeContext): EnvironmentLanguage => { @@ -5083,7 +5382,14 @@ const deserializeAws_json1_1EnvironmentLanguage = (output: any, context: __Serde }; const deserializeAws_json1_1EnvironmentLanguages = (output: any, context: __SerdeContext): EnvironmentLanguage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EnvironmentLanguage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EnvironmentLanguage(entry, context); + }); }; const deserializeAws_json1_1EnvironmentPlatform = (output: any, context: __SerdeContext): EnvironmentPlatform => { @@ -5097,7 +5403,14 @@ const deserializeAws_json1_1EnvironmentPlatform = (output: any, context: __Serde }; const deserializeAws_json1_1EnvironmentPlatforms = (output: any, context: __SerdeContext): EnvironmentPlatform[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EnvironmentPlatform(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EnvironmentPlatform(entry, context); + }); }; const deserializeAws_json1_1EnvironmentVariable = (output: any, context: __SerdeContext): EnvironmentVariable => { @@ -5109,7 +5422,14 @@ const deserializeAws_json1_1EnvironmentVariable = (output: any, context: __Serde }; const deserializeAws_json1_1EnvironmentVariables = (output: any, context: __SerdeContext): EnvironmentVariable[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EnvironmentVariable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EnvironmentVariable(entry, context); + }); }; const deserializeAws_json1_1ExportedEnvironmentVariable = ( @@ -5126,15 +5446,36 @@ const deserializeAws_json1_1ExportedEnvironmentVariables = ( output: any, context: __SerdeContext ): ExportedEnvironmentVariable[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExportedEnvironmentVariable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExportedEnvironmentVariable(entry, context); + }); }; const deserializeAws_json1_1FilterGroup = (output: any, context: __SerdeContext): WebhookFilter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WebhookFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WebhookFilter(entry, context); + }); }; const deserializeAws_json1_1FilterGroups = (output: any, context: __SerdeContext): WebhookFilter[][] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FilterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FilterGroup(entry, context); + }); }; const deserializeAws_json1_1GetReportGroupTrendOutput = ( @@ -5170,11 +5511,25 @@ const deserializeAws_json1_1GitSubmodulesConfig = (output: any, context: __Serde }; const deserializeAws_json1_1Identifiers = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ImageVersions = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ImportSourceCredentialsOutput = ( @@ -5393,7 +5748,14 @@ const deserializeAws_json1_1PhaseContext = (output: any, context: __SerdeContext }; const deserializeAws_json1_1PhaseContexts = (output: any, context: __SerdeContext): PhaseContext[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PhaseContext(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PhaseContext(entry, context); + }); }; const deserializeAws_json1_1Project = (output: any, context: __SerdeContext): Project => { @@ -5478,7 +5840,14 @@ const deserializeAws_json1_1Project = (output: any, context: __SerdeContext): Pr }; const deserializeAws_json1_1ProjectArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ProjectArtifacts = (output: any, context: __SerdeContext): ProjectArtifacts => { @@ -5506,7 +5875,14 @@ const deserializeAws_json1_1ProjectArtifacts = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ProjectArtifactsList = (output: any, context: __SerdeContext): ProjectArtifacts[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProjectArtifacts(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProjectArtifacts(entry, context); + }); }; const deserializeAws_json1_1ProjectBadge = (output: any, context: __SerdeContext): ProjectBadge => { @@ -5546,7 +5922,14 @@ const deserializeAws_json1_1ProjectCache = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ProjectCacheModes = (output: any, context: __SerdeContext): (CacheMode | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ProjectEnvironment = (output: any, context: __SerdeContext): ProjectEnvironment => { @@ -5589,22 +5972,50 @@ const deserializeAws_json1_1ProjectFileSystemLocations = ( output: any, context: __SerdeContext ): ProjectFileSystemLocation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProjectFileSystemLocation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProjectFileSystemLocation(entry, context); + }); }; const deserializeAws_json1_1ProjectNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Projects = (output: any, context: __SerdeContext): Project[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Project(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Project(entry, context); + }); }; const deserializeAws_json1_1ProjectSecondarySourceVersions = ( output: any, context: __SerdeContext ): ProjectSourceVersion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProjectSourceVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProjectSourceVersion(entry, context); + }); }; const deserializeAws_json1_1ProjectSource = (output: any, context: __SerdeContext): ProjectSource => { @@ -5637,7 +6048,14 @@ const deserializeAws_json1_1ProjectSource = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ProjectSources = (output: any, context: __SerdeContext): ProjectSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProjectSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProjectSource(entry, context); + }); }; const deserializeAws_json1_1ProjectSourceVersion = (output: any, context: __SerdeContext): ProjectSourceVersion => { @@ -5698,7 +6116,14 @@ const deserializeAws_json1_1Report = (output: any, context: __SerdeContext): Rep }; const deserializeAws_json1_1ReportArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ReportExportConfig = (output: any, context: __SerdeContext): ReportExportConfig => { @@ -5736,18 +6161,39 @@ const deserializeAws_json1_1ReportGroup = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ReportGroupArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ReportGroups = (output: any, context: __SerdeContext): ReportGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReportGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReportGroup(entry, context); + }); }; const deserializeAws_json1_1ReportGroupTrendRawDataList = ( output: any, context: __SerdeContext ): ReportWithRawData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReportWithRawData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReportWithRawData(entry, context); + }); }; const deserializeAws_json1_1ReportGroupTrendStats = (output: any, context: __SerdeContext): ReportGroupTrendStats => { @@ -5759,17 +6205,26 @@ const deserializeAws_json1_1ReportGroupTrendStats = (output: any, context: __Ser }; const deserializeAws_json1_1Reports = (output: any, context: __SerdeContext): Report[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Report(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Report(entry, context); + }); }; const deserializeAws_json1_1ReportStatusCounts = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ReportWithRawData = (output: any, context: __SerdeContext): ReportWithRawData => { @@ -5788,7 +6243,14 @@ const deserializeAws_json1_1ResolvedArtifact = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ResolvedSecondaryArtifacts = (output: any, context: __SerdeContext): ResolvedArtifact[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResolvedArtifact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResolvedArtifact(entry, context); + }); }; const deserializeAws_json1_1ResourceAlreadyExistsException = ( @@ -5853,7 +6315,14 @@ const deserializeAws_json1_1S3ReportExportConfig = (output: any, context: __Serd }; const deserializeAws_json1_1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SourceAuth = (output: any, context: __SerdeContext): SourceAuth => { @@ -5875,7 +6344,14 @@ const deserializeAws_json1_1SourceCredentialsInfos = ( output: any, context: __SerdeContext ): SourceCredentialsInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SourceCredentialsInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SourceCredentialsInfo(entry, context); + }); }; const deserializeAws_json1_1StartBuildBatchOutput = (output: any, context: __SerdeContext): StartBuildBatchOutput => { @@ -5915,7 +6391,14 @@ const deserializeAws_json1_1StopBuildOutput = (output: any, context: __SerdeCont }; const deserializeAws_json1_1Subnets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -5926,7 +6409,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TestCase = (output: any, context: __SerdeContext): TestCase => { @@ -5948,7 +6438,14 @@ const deserializeAws_json1_1TestCase = (output: any, context: __SerdeContext): T }; const deserializeAws_json1_1TestCases = (output: any, context: __SerdeContext): TestCase[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TestCase(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TestCase(entry, context); + }); }; const deserializeAws_json1_1TestReportSummary = (output: any, context: __SerdeContext): TestReportSummary => { @@ -6088,3 +6585,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-codecommit/protocols/Aws_json1_1.ts b/clients/client-codecommit/protocols/Aws_json1_1.ts index b0b61241d8f6..fecba19a5af3 100644 --- a/clients/client-codecommit/protocols/Aws_json1_1.ts +++ b/clients/client-codecommit/protocols/Aws_json1_1.ts @@ -625,7 +625,7 @@ export const serializeAws_json1_1AssociateApprovalRuleTemplateWithRepositoryComm context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.AssociateApprovalRuleTemplateWithRepository", }; let body: any; @@ -638,7 +638,7 @@ export const serializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositor context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.BatchAssociateApprovalRuleTemplateWithRepositories", }; let body: any; @@ -651,7 +651,7 @@ export const serializeAws_json1_1BatchDescribeMergeConflictsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.BatchDescribeMergeConflicts", }; let body: any; @@ -664,7 +664,7 @@ export const serializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromReposi context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.BatchDisassociateApprovalRuleTemplateFromRepositories", }; let body: any; @@ -677,7 +677,7 @@ export const serializeAws_json1_1BatchGetCommitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.BatchGetCommits", }; let body: any; @@ -690,7 +690,7 @@ export const serializeAws_json1_1BatchGetRepositoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.BatchGetRepositories", }; let body: any; @@ -703,7 +703,7 @@ export const serializeAws_json1_1CreateApprovalRuleTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.CreateApprovalRuleTemplate", }; let body: any; @@ -716,7 +716,7 @@ export const serializeAws_json1_1CreateBranchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.CreateBranch", }; let body: any; @@ -729,7 +729,7 @@ export const serializeAws_json1_1CreateCommitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.CreateCommit", }; let body: any; @@ -742,7 +742,7 @@ export const serializeAws_json1_1CreatePullRequestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.CreatePullRequest", }; let body: any; @@ -755,7 +755,7 @@ export const serializeAws_json1_1CreatePullRequestApprovalRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.CreatePullRequestApprovalRule", }; let body: any; @@ -768,7 +768,7 @@ export const serializeAws_json1_1CreateRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.CreateRepository", }; let body: any; @@ -781,7 +781,7 @@ export const serializeAws_json1_1CreateUnreferencedMergeCommitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.CreateUnreferencedMergeCommit", }; let body: any; @@ -794,7 +794,7 @@ export const serializeAws_json1_1DeleteApprovalRuleTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.DeleteApprovalRuleTemplate", }; let body: any; @@ -807,7 +807,7 @@ export const serializeAws_json1_1DeleteBranchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.DeleteBranch", }; let body: any; @@ -820,7 +820,7 @@ export const serializeAws_json1_1DeleteCommentContentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.DeleteCommentContent", }; let body: any; @@ -833,7 +833,7 @@ export const serializeAws_json1_1DeleteFileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.DeleteFile", }; let body: any; @@ -846,7 +846,7 @@ export const serializeAws_json1_1DeletePullRequestApprovalRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.DeletePullRequestApprovalRule", }; let body: any; @@ -859,7 +859,7 @@ export const serializeAws_json1_1DeleteRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.DeleteRepository", }; let body: any; @@ -872,7 +872,7 @@ export const serializeAws_json1_1DescribeMergeConflictsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.DescribeMergeConflicts", }; let body: any; @@ -885,7 +885,7 @@ export const serializeAws_json1_1DescribePullRequestEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.DescribePullRequestEvents", }; let body: any; @@ -898,7 +898,7 @@ export const serializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryC context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.DisassociateApprovalRuleTemplateFromRepository", }; let body: any; @@ -911,7 +911,7 @@ export const serializeAws_json1_1EvaluatePullRequestApprovalRulesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.EvaluatePullRequestApprovalRules", }; let body: any; @@ -924,7 +924,7 @@ export const serializeAws_json1_1GetApprovalRuleTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetApprovalRuleTemplate", }; let body: any; @@ -937,7 +937,7 @@ export const serializeAws_json1_1GetBlobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetBlob", }; let body: any; @@ -950,7 +950,7 @@ export const serializeAws_json1_1GetBranchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetBranch", }; let body: any; @@ -963,7 +963,7 @@ export const serializeAws_json1_1GetCommentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetComment", }; let body: any; @@ -976,7 +976,7 @@ export const serializeAws_json1_1GetCommentReactionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetCommentReactions", }; let body: any; @@ -989,7 +989,7 @@ export const serializeAws_json1_1GetCommentsForComparedCommitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetCommentsForComparedCommit", }; let body: any; @@ -1002,7 +1002,7 @@ export const serializeAws_json1_1GetCommentsForPullRequestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetCommentsForPullRequest", }; let body: any; @@ -1015,7 +1015,7 @@ export const serializeAws_json1_1GetCommitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetCommit", }; let body: any; @@ -1028,7 +1028,7 @@ export const serializeAws_json1_1GetDifferencesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetDifferences", }; let body: any; @@ -1041,7 +1041,7 @@ export const serializeAws_json1_1GetFileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetFile", }; let body: any; @@ -1054,7 +1054,7 @@ export const serializeAws_json1_1GetFolderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetFolder", }; let body: any; @@ -1067,7 +1067,7 @@ export const serializeAws_json1_1GetMergeCommitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetMergeCommit", }; let body: any; @@ -1080,7 +1080,7 @@ export const serializeAws_json1_1GetMergeConflictsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetMergeConflicts", }; let body: any; @@ -1093,7 +1093,7 @@ export const serializeAws_json1_1GetMergeOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetMergeOptions", }; let body: any; @@ -1106,7 +1106,7 @@ export const serializeAws_json1_1GetPullRequestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetPullRequest", }; let body: any; @@ -1119,7 +1119,7 @@ export const serializeAws_json1_1GetPullRequestApprovalStatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetPullRequestApprovalStates", }; let body: any; @@ -1132,7 +1132,7 @@ export const serializeAws_json1_1GetPullRequestOverrideStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetPullRequestOverrideState", }; let body: any; @@ -1145,7 +1145,7 @@ export const serializeAws_json1_1GetRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetRepository", }; let body: any; @@ -1158,7 +1158,7 @@ export const serializeAws_json1_1GetRepositoryTriggersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.GetRepositoryTriggers", }; let body: any; @@ -1171,7 +1171,7 @@ export const serializeAws_json1_1ListApprovalRuleTemplatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.ListApprovalRuleTemplates", }; let body: any; @@ -1184,7 +1184,7 @@ export const serializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositor context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.ListAssociatedApprovalRuleTemplatesForRepository", }; let body: any; @@ -1197,7 +1197,7 @@ export const serializeAws_json1_1ListBranchesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.ListBranches", }; let body: any; @@ -1210,7 +1210,7 @@ export const serializeAws_json1_1ListPullRequestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.ListPullRequests", }; let body: any; @@ -1223,7 +1223,7 @@ export const serializeAws_json1_1ListRepositoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.ListRepositories", }; let body: any; @@ -1236,7 +1236,7 @@ export const serializeAws_json1_1ListRepositoriesForApprovalRuleTemplateCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.ListRepositoriesForApprovalRuleTemplate", }; let body: any; @@ -1249,7 +1249,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.ListTagsForResource", }; let body: any; @@ -1262,7 +1262,7 @@ export const serializeAws_json1_1MergeBranchesByFastForwardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.MergeBranchesByFastForward", }; let body: any; @@ -1275,7 +1275,7 @@ export const serializeAws_json1_1MergeBranchesBySquashCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.MergeBranchesBySquash", }; let body: any; @@ -1288,7 +1288,7 @@ export const serializeAws_json1_1MergeBranchesByThreeWayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.MergeBranchesByThreeWay", }; let body: any; @@ -1301,7 +1301,7 @@ export const serializeAws_json1_1MergePullRequestByFastForwardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.MergePullRequestByFastForward", }; let body: any; @@ -1314,7 +1314,7 @@ export const serializeAws_json1_1MergePullRequestBySquashCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.MergePullRequestBySquash", }; let body: any; @@ -1327,7 +1327,7 @@ export const serializeAws_json1_1MergePullRequestByThreeWayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.MergePullRequestByThreeWay", }; let body: any; @@ -1340,7 +1340,7 @@ export const serializeAws_json1_1OverridePullRequestApprovalRulesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.OverridePullRequestApprovalRules", }; let body: any; @@ -1353,7 +1353,7 @@ export const serializeAws_json1_1PostCommentForComparedCommitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.PostCommentForComparedCommit", }; let body: any; @@ -1366,7 +1366,7 @@ export const serializeAws_json1_1PostCommentForPullRequestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.PostCommentForPullRequest", }; let body: any; @@ -1379,7 +1379,7 @@ export const serializeAws_json1_1PostCommentReplyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.PostCommentReply", }; let body: any; @@ -1392,7 +1392,7 @@ export const serializeAws_json1_1PutCommentReactionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.PutCommentReaction", }; let body: any; @@ -1405,7 +1405,7 @@ export const serializeAws_json1_1PutFileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.PutFile", }; let body: any; @@ -1418,7 +1418,7 @@ export const serializeAws_json1_1PutRepositoryTriggersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.PutRepositoryTriggers", }; let body: any; @@ -1431,7 +1431,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.TagResource", }; let body: any; @@ -1444,7 +1444,7 @@ export const serializeAws_json1_1TestRepositoryTriggersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.TestRepositoryTriggers", }; let body: any; @@ -1457,7 +1457,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UntagResource", }; let body: any; @@ -1470,7 +1470,7 @@ export const serializeAws_json1_1UpdateApprovalRuleTemplateContentCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdateApprovalRuleTemplateContent", }; let body: any; @@ -1483,7 +1483,7 @@ export const serializeAws_json1_1UpdateApprovalRuleTemplateDescriptionCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdateApprovalRuleTemplateDescription", }; let body: any; @@ -1496,7 +1496,7 @@ export const serializeAws_json1_1UpdateApprovalRuleTemplateNameCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdateApprovalRuleTemplateName", }; let body: any; @@ -1509,7 +1509,7 @@ export const serializeAws_json1_1UpdateCommentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdateComment", }; let body: any; @@ -1522,7 +1522,7 @@ export const serializeAws_json1_1UpdateDefaultBranchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdateDefaultBranch", }; let body: any; @@ -1535,7 +1535,7 @@ export const serializeAws_json1_1UpdatePullRequestApprovalRuleContentCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdatePullRequestApprovalRuleContent", }; let body: any; @@ -1548,7 +1548,7 @@ export const serializeAws_json1_1UpdatePullRequestApprovalStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdatePullRequestApprovalState", }; let body: any; @@ -1561,7 +1561,7 @@ export const serializeAws_json1_1UpdatePullRequestDescriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdatePullRequestDescription", }; let body: any; @@ -1574,7 +1574,7 @@ export const serializeAws_json1_1UpdatePullRequestStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdatePullRequestStatus", }; let body: any; @@ -1587,7 +1587,7 @@ export const serializeAws_json1_1UpdatePullRequestTitleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdatePullRequestTitle", }; let body: any; @@ -1600,7 +1600,7 @@ export const serializeAws_json1_1UpdateRepositoryDescriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdateRepositoryDescription", }; let body: any; @@ -1613,7 +1613,7 @@ export const serializeAws_json1_1UpdateRepositoryNameCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeCommit_20150413.UpdateRepositoryName", }; let body: any; @@ -1645,8 +1645,7 @@ const deserializeAws_json1_1AssociateApprovalRuleTemplateWithRepositoryCommandEr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateDoesNotExistException": case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": @@ -1791,8 +1790,7 @@ const deserializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesCo }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateDoesNotExistException": case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": @@ -1918,8 +1916,7 @@ const deserializeAws_json1_1BatchDescribeMergeConflictsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -2133,8 +2130,7 @@ const deserializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositorie }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateDoesNotExistException": case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": @@ -2260,8 +2256,7 @@ const deserializeAws_json1_1BatchGetCommitsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitIdsLimitExceededException": case "com.amazonaws.codecommit#CommitIdsLimitExceededException": @@ -2387,8 +2382,7 @@ const deserializeAws_json1_1BatchGetRepositoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -2498,8 +2492,7 @@ const deserializeAws_json1_1CreateApprovalRuleTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateContentRequiredException": case "com.amazonaws.codecommit#ApprovalRuleTemplateContentRequiredException": @@ -2598,8 +2591,7 @@ const deserializeAws_json1_1CreateBranchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchNameExistsException": case "com.amazonaws.codecommit#BranchNameExistsException": @@ -2757,8 +2749,7 @@ const deserializeAws_json1_1CreateCommitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchDoesNotExistException": case "com.amazonaws.codecommit#BranchDoesNotExistException": @@ -3108,8 +3099,7 @@ const deserializeAws_json1_1CreatePullRequestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientRequestTokenRequiredException": case "com.amazonaws.codecommit#ClientRequestTokenRequiredException": @@ -3355,8 +3345,7 @@ const deserializeAws_json1_1CreatePullRequestApprovalRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleContentRequiredException": case "com.amazonaws.codecommit#ApprovalRuleContentRequiredException": @@ -3522,8 +3511,7 @@ const deserializeAws_json1_1CreateRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -3681,8 +3669,7 @@ const deserializeAws_json1_1CreateUnreferencedMergeCommitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -4019,8 +4006,7 @@ const deserializeAws_json1_1DeleteApprovalRuleTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateInUseException": case "com.amazonaws.codecommit#ApprovalRuleTemplateInUseException": @@ -4090,8 +4076,7 @@ const deserializeAws_json1_1DeleteBranchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchNameRequiredException": case "com.amazonaws.codecommit#BranchNameRequiredException": @@ -4225,8 +4210,7 @@ const deserializeAws_json1_1DeleteCommentContentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommentDeletedException": case "com.amazonaws.codecommit#CommentDeletedException": @@ -4304,8 +4288,7 @@ const deserializeAws_json1_1DeleteFileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchDoesNotExistException": case "com.amazonaws.codecommit#BranchDoesNotExistException": @@ -4527,8 +4510,7 @@ const deserializeAws_json1_1DeletePullRequestApprovalRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleNameRequiredException": case "com.amazonaws.codecommit#ApprovalRuleNameRequiredException": @@ -4670,8 +4652,7 @@ const deserializeAws_json1_1DeleteRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -4773,8 +4754,7 @@ const deserializeAws_json1_1DescribeMergeConflictsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -5004,8 +4984,7 @@ const deserializeAws_json1_1DescribePullRequestEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActorDoesNotExistException": case "com.amazonaws.codecommit#ActorDoesNotExistException": @@ -5152,8 +5131,7 @@ const deserializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryComman }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateDoesNotExistException": case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": @@ -5287,8 +5265,7 @@ const deserializeAws_json1_1EvaluatePullRequestApprovalRulesCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -5422,8 +5399,7 @@ const deserializeAws_json1_1GetApprovalRuleTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateDoesNotExistException": case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": @@ -5493,8 +5469,7 @@ const deserializeAws_json1_1GetBlobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BlobIdDoesNotExistException": case "com.amazonaws.codecommit#BlobIdDoesNotExistException": @@ -5636,8 +5611,7 @@ const deserializeAws_json1_1GetBranchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchDoesNotExistException": case "com.amazonaws.codecommit#BranchDoesNotExistException": @@ -5771,8 +5745,7 @@ const deserializeAws_json1_1GetCommentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommentDeletedException": case "com.amazonaws.codecommit#CommentDeletedException": @@ -5890,8 +5863,7 @@ const deserializeAws_json1_1GetCommentReactionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommentDeletedException": case "com.amazonaws.codecommit#CommentDeletedException": @@ -5993,8 +5965,7 @@ const deserializeAws_json1_1GetCommentsForComparedCommitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -6144,8 +6115,7 @@ const deserializeAws_json1_1GetCommentsForPullRequestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -6327,8 +6297,7 @@ const deserializeAws_json1_1GetCommitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitIdDoesNotExistException": case "com.amazonaws.codecommit#CommitIdDoesNotExistException": @@ -6462,8 +6431,7 @@ const deserializeAws_json1_1GetDifferencesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -6637,8 +6605,7 @@ const deserializeAws_json1_1GetFileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -6796,8 +6763,7 @@ const deserializeAws_json1_1GetFolderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -6947,8 +6913,7 @@ const deserializeAws_json1_1GetMergeCommitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -7098,8 +7063,7 @@ const deserializeAws_json1_1GetMergeConflictsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -7321,8 +7285,7 @@ const deserializeAws_json1_1GetMergeOptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitDoesNotExistException": case "com.amazonaws.codecommit#CommitDoesNotExistException": @@ -7496,8 +7459,7 @@ const deserializeAws_json1_1GetPullRequestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -7607,8 +7569,7 @@ const deserializeAws_json1_1GetPullRequestApprovalStatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -7734,8 +7695,7 @@ const deserializeAws_json1_1GetPullRequestOverrideStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -7861,8 +7821,7 @@ const deserializeAws_json1_1GetRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -7972,8 +7931,7 @@ const deserializeAws_json1_1GetRepositoryTriggersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -8083,8 +8041,7 @@ const deserializeAws_json1_1ListApprovalRuleTemplatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidContinuationTokenException": case "com.amazonaws.codecommit#InvalidContinuationTokenException": @@ -8146,8 +8103,7 @@ const deserializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositoryComm }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -8273,8 +8229,7 @@ const deserializeAws_json1_1ListBranchesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -8392,8 +8347,7 @@ const deserializeAws_json1_1ListPullRequestsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthorDoesNotExistException": case "com.amazonaws.codecommit#AuthorDoesNotExistException": @@ -8543,8 +8497,7 @@ const deserializeAws_json1_1ListRepositoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidContinuationTokenException": case "com.amazonaws.codecommit#InvalidContinuationTokenException": @@ -8614,8 +8567,7 @@ const deserializeAws_json1_1ListRepositoriesForApprovalRuleTemplateCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateDoesNotExistException": case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": @@ -8741,8 +8693,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidRepositoryNameException": case "com.amazonaws.codecommit#InvalidRepositoryNameException": @@ -8820,8 +8771,7 @@ const deserializeAws_json1_1MergeBranchesByFastForwardCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchDoesNotExistException": case "com.amazonaws.codecommit#BranchDoesNotExistException": @@ -9019,8 +8969,7 @@ const deserializeAws_json1_1MergeBranchesBySquashCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchDoesNotExistException": case "com.amazonaws.codecommit#BranchDoesNotExistException": @@ -9381,8 +9330,7 @@ const deserializeAws_json1_1MergeBranchesByThreeWayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchDoesNotExistException": case "com.amazonaws.codecommit#BranchDoesNotExistException": @@ -9743,8 +9691,7 @@ const deserializeAws_json1_1MergePullRequestByFastForwardCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentReferenceUpdateException": case "com.amazonaws.codecommit#ConcurrentReferenceUpdateException": @@ -9942,8 +9889,7 @@ const deserializeAws_json1_1MergePullRequestBySquashCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitMessageLengthExceededException": case "com.amazonaws.codecommit#CommitMessageLengthExceededException": @@ -10296,8 +10242,7 @@ const deserializeAws_json1_1MergePullRequestByThreeWayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommitMessageLengthExceededException": case "com.amazonaws.codecommit#CommitMessageLengthExceededException": @@ -10647,8 +10592,7 @@ const deserializeAws_json1_1OverridePullRequestApprovalRulesCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -10814,8 +10758,7 @@ const deserializeAws_json1_1PostCommentForComparedCommitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BeforeCommitIdAndAfterCommitIdAreSameException": case "com.amazonaws.codecommit#BeforeCommitIdAndAfterCommitIdAreSameException": @@ -11045,8 +10988,7 @@ const deserializeAws_json1_1PostCommentForPullRequestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BeforeCommitIdAndAfterCommitIdAreSameException": case "com.amazonaws.codecommit#BeforeCommitIdAndAfterCommitIdAreSameException": @@ -11308,8 +11250,7 @@ const deserializeAws_json1_1PostCommentReplyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientRequestTokenRequiredException": case "com.amazonaws.codecommit#ClientRequestTokenRequiredException": @@ -11416,8 +11357,7 @@ const deserializeAws_json1_1PutCommentReactionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommentDeletedException": case "com.amazonaws.codecommit#CommentDeletedException": @@ -11519,8 +11459,7 @@ const deserializeAws_json1_1PutFileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchDoesNotExistException": case "com.amazonaws.codecommit#BranchDoesNotExistException": @@ -11806,8 +11745,7 @@ const deserializeAws_json1_1PutRepositoryTriggersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -12024,8 +11962,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidRepositoryNameException": case "com.amazonaws.codecommit#InvalidRepositoryNameException": @@ -12143,8 +12080,7 @@ const deserializeAws_json1_1TestRepositoryTriggersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -12361,8 +12297,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidRepositoryNameException": case "com.amazonaws.codecommit#InvalidRepositoryNameException": @@ -12480,8 +12415,7 @@ const deserializeAws_json1_1UpdateApprovalRuleTemplateContentCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateContentRequiredException": case "com.amazonaws.codecommit#ApprovalRuleTemplateContentRequiredException": @@ -12575,8 +12509,7 @@ const deserializeAws_json1_1UpdateApprovalRuleTemplateDescriptionCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateDoesNotExistException": case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": @@ -12654,8 +12587,7 @@ const deserializeAws_json1_1UpdateApprovalRuleTemplateNameCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleTemplateDoesNotExistException": case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": @@ -12733,8 +12665,7 @@ const deserializeAws_json1_1UpdateCommentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CommentContentRequiredException": case "com.amazonaws.codecommit#CommentContentRequiredException": @@ -12833,8 +12764,7 @@ const deserializeAws_json1_1UpdateDefaultBranchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BranchDoesNotExistException": case "com.amazonaws.codecommit#BranchDoesNotExistException": @@ -12968,8 +12898,7 @@ const deserializeAws_json1_1UpdatePullRequestApprovalRuleContentCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalRuleContentRequiredException": case "com.amazonaws.codecommit#ApprovalRuleContentRequiredException": @@ -13140,8 +13069,7 @@ const deserializeAws_json1_1UpdatePullRequestApprovalStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApprovalStateRequiredException": case "com.amazonaws.codecommit#ApprovalStateRequiredException": @@ -13315,8 +13243,7 @@ const deserializeAws_json1_1UpdatePullRequestDescriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidDescriptionException": case "com.amazonaws.codecommit#InvalidDescriptionException": @@ -13402,8 +13329,7 @@ const deserializeAws_json1_1UpdatePullRequestStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -13537,8 +13463,7 @@ const deserializeAws_json1_1UpdatePullRequestTitleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidPullRequestIdException": case "com.amazonaws.codecommit#InvalidPullRequestIdException": @@ -13629,8 +13554,7 @@ const deserializeAws_json1_1UpdateRepositoryDescriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": @@ -13745,8 +13669,7 @@ const deserializeAws_json1_1UpdateRepositoryNameCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidRepositoryNameException": case "com.amazonaws.codecommit#InvalidRepositoryNameException": @@ -16577,8 +16500,10 @@ const serializeAws_json1_1AssociateApprovalRuleTemplateWithRepositoryInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -16587,10 +16512,12 @@ const serializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesInpu context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), - ...(input.repositoryNames !== undefined && { - repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), - }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.repositoryNames !== undefined && + input.repositoryNames !== null && { + repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), + }), }; }; @@ -16599,20 +16526,23 @@ const serializeAws_json1_1BatchDescribeMergeConflictsInput = ( context: __SerdeContext ): any => { return { - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.destinationCommitSpecifier !== undefined && { - destinationCommitSpecifier: input.destinationCommitSpecifier, - }), - ...(input.filePaths !== undefined && { filePaths: serializeAws_json1_1FilePaths(input.filePaths, context) }), - ...(input.maxConflictFiles !== undefined && { maxConflictFiles: input.maxConflictFiles }), - ...(input.maxMergeHunks !== undefined && { maxMergeHunks: input.maxMergeHunks }), - ...(input.mergeOption !== undefined && { mergeOption: input.mergeOption }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitSpecifier !== undefined && { sourceCommitSpecifier: input.sourceCommitSpecifier }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.destinationCommitSpecifier !== undefined && + input.destinationCommitSpecifier !== null && { destinationCommitSpecifier: input.destinationCommitSpecifier }), + ...(input.filePaths !== undefined && + input.filePaths !== null && { filePaths: serializeAws_json1_1FilePaths(input.filePaths, context) }), + ...(input.maxConflictFiles !== undefined && + input.maxConflictFiles !== null && { maxConflictFiles: input.maxConflictFiles }), + ...(input.maxMergeHunks !== undefined && input.maxMergeHunks !== null && { maxMergeHunks: input.maxMergeHunks }), + ...(input.mergeOption !== undefined && input.mergeOption !== null && { mergeOption: input.mergeOption }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitSpecifier !== undefined && + input.sourceCommitSpecifier !== null && { sourceCommitSpecifier: input.sourceCommitSpecifier }), }; }; @@ -16621,19 +16551,21 @@ const serializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositoriesI context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), - ...(input.repositoryNames !== undefined && { - repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), - }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.repositoryNames !== undefined && + input.repositoryNames !== null && { + repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), + }), }; }; const serializeAws_json1_1BatchGetCommitsInput = (input: BatchGetCommitsInput, context: __SerdeContext): any => { return { - ...(input.commitIds !== undefined && { - commitIds: serializeAws_json1_1CommitIdsInputList(input.commitIds, context), - }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.commitIds !== undefined && + input.commitIds !== null && { commitIds: serializeAws_json1_1CommitIdsInputList(input.commitIds, context) }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -16642,31 +16574,47 @@ const serializeAws_json1_1BatchGetRepositoriesInput = ( context: __SerdeContext ): any => { return { - ...(input.repositoryNames !== undefined && { - repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), - }), + ...(input.repositoryNames !== undefined && + input.repositoryNames !== null && { + repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), + }), }; }; const serializeAws_json1_1BranchNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CommitIdsInputList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConflictResolution = (input: ConflictResolution, context: __SerdeContext): any => { return { - ...(input.deleteFiles !== undefined && { - deleteFiles: serializeAws_json1_1DeleteFileEntries(input.deleteFiles, context), - }), - ...(input.replaceContents !== undefined && { - replaceContents: serializeAws_json1_1ReplaceContentEntries(input.replaceContents, context), - }), - ...(input.setFileModes !== undefined && { - setFileModes: serializeAws_json1_1SetFileModeEntries(input.setFileModes, context), - }), + ...(input.deleteFiles !== undefined && + input.deleteFiles !== null && { deleteFiles: serializeAws_json1_1DeleteFileEntries(input.deleteFiles, context) }), + ...(input.replaceContents !== undefined && + input.replaceContents !== null && { + replaceContents: serializeAws_json1_1ReplaceContentEntries(input.replaceContents, context), + }), + ...(input.setFileModes !== undefined && + input.setFileModes !== null && { + setFileModes: serializeAws_json1_1SetFileModeEntries(input.setFileModes, context), + }), }; }; @@ -16675,40 +16623,46 @@ const serializeAws_json1_1CreateApprovalRuleTemplateInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateContent !== undefined && { - approvalRuleTemplateContent: input.approvalRuleTemplateContent, - }), - ...(input.approvalRuleTemplateDescription !== undefined && { - approvalRuleTemplateDescription: input.approvalRuleTemplateDescription, - }), - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.approvalRuleTemplateContent !== undefined && + input.approvalRuleTemplateContent !== null && { approvalRuleTemplateContent: input.approvalRuleTemplateContent }), + ...(input.approvalRuleTemplateDescription !== undefined && + input.approvalRuleTemplateDescription !== null && { + approvalRuleTemplateDescription: input.approvalRuleTemplateDescription, + }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), }; }; const serializeAws_json1_1CreateBranchInput = (input: CreateBranchInput, context: __SerdeContext): any => { return { - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.commitId !== undefined && { commitId: input.commitId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.commitId !== undefined && input.commitId !== null && { commitId: input.commitId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1CreateCommitInput = (input: CreateCommitInput, context: __SerdeContext): any => { return { - ...(input.authorName !== undefined && { authorName: input.authorName }), - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.commitMessage !== undefined && { commitMessage: input.commitMessage }), - ...(input.deleteFiles !== undefined && { - deleteFiles: serializeAws_json1_1DeleteFileEntries(input.deleteFiles, context), - }), - ...(input.email !== undefined && { email: input.email }), - ...(input.keepEmptyFolders !== undefined && { keepEmptyFolders: input.keepEmptyFolders }), - ...(input.parentCommitId !== undefined && { parentCommitId: input.parentCommitId }), - ...(input.putFiles !== undefined && { putFiles: serializeAws_json1_1PutFileEntries(input.putFiles, context) }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.setFileModes !== undefined && { - setFileModes: serializeAws_json1_1SetFileModeEntries(input.setFileModes, context), - }), + ...(input.authorName !== undefined && input.authorName !== null && { authorName: input.authorName }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.commitMessage !== undefined && input.commitMessage !== null && { commitMessage: input.commitMessage }), + ...(input.deleteFiles !== undefined && + input.deleteFiles !== null && { deleteFiles: serializeAws_json1_1DeleteFileEntries(input.deleteFiles, context) }), + ...(input.email !== undefined && input.email !== null && { email: input.email }), + ...(input.keepEmptyFolders !== undefined && + input.keepEmptyFolders !== null && { keepEmptyFolders: input.keepEmptyFolders }), + ...(input.parentCommitId !== undefined && + input.parentCommitId !== null && { parentCommitId: input.parentCommitId }), + ...(input.putFiles !== undefined && + input.putFiles !== null && { putFiles: serializeAws_json1_1PutFileEntries(input.putFiles, context) }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.setFileModes !== undefined && + input.setFileModes !== null && { + setFileModes: serializeAws_json1_1SetFileModeEntries(input.setFileModes, context), + }), }; }; @@ -16717,26 +16671,31 @@ const serializeAws_json1_1CreatePullRequestApprovalRuleInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleContent !== undefined && { approvalRuleContent: input.approvalRuleContent }), - ...(input.approvalRuleName !== undefined && { approvalRuleName: input.approvalRuleName }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), + ...(input.approvalRuleContent !== undefined && + input.approvalRuleContent !== null && { approvalRuleContent: input.approvalRuleContent }), + ...(input.approvalRuleName !== undefined && + input.approvalRuleName !== null && { approvalRuleName: input.approvalRuleName }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), }; }; const serializeAws_json1_1CreatePullRequestInput = (input: CreatePullRequestInput, context: __SerdeContext): any => { return { clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.targets !== undefined && { targets: serializeAws_json1_1TargetList(input.targets, context) }), - ...(input.title !== undefined && { title: input.title }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.targets !== undefined && + input.targets !== null && { targets: serializeAws_json1_1TargetList(input.targets, context) }), + ...(input.title !== undefined && input.title !== null && { title: input.title }), }; }; const serializeAws_json1_1CreateRepositoryInput = (input: CreateRepositoryInput, context: __SerdeContext): any => { return { - ...(input.repositoryDescription !== undefined && { repositoryDescription: input.repositoryDescription }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagsMap(input.tags, context) }), + ...(input.repositoryDescription !== undefined && + input.repositoryDescription !== null && { repositoryDescription: input.repositoryDescription }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagsMap(input.tags, context) }), }; }; @@ -16745,23 +16704,26 @@ const serializeAws_json1_1CreateUnreferencedMergeCommitInput = ( context: __SerdeContext ): any => { return { - ...(input.authorName !== undefined && { authorName: input.authorName }), - ...(input.commitMessage !== undefined && { commitMessage: input.commitMessage }), - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolution !== undefined && { - conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), - }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.destinationCommitSpecifier !== undefined && { - destinationCommitSpecifier: input.destinationCommitSpecifier, - }), - ...(input.email !== undefined && { email: input.email }), - ...(input.keepEmptyFolders !== undefined && { keepEmptyFolders: input.keepEmptyFolders }), - ...(input.mergeOption !== undefined && { mergeOption: input.mergeOption }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitSpecifier !== undefined && { sourceCommitSpecifier: input.sourceCommitSpecifier }), + ...(input.authorName !== undefined && input.authorName !== null && { authorName: input.authorName }), + ...(input.commitMessage !== undefined && input.commitMessage !== null && { commitMessage: input.commitMessage }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolution !== undefined && + input.conflictResolution !== null && { + conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), + }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.destinationCommitSpecifier !== undefined && + input.destinationCommitSpecifier !== null && { destinationCommitSpecifier: input.destinationCommitSpecifier }), + ...(input.email !== undefined && input.email !== null && { email: input.email }), + ...(input.keepEmptyFolders !== undefined && + input.keepEmptyFolders !== null && { keepEmptyFolders: input.keepEmptyFolders }), + ...(input.mergeOption !== undefined && input.mergeOption !== null && { mergeOption: input.mergeOption }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitSpecifier !== undefined && + input.sourceCommitSpecifier !== null && { sourceCommitSpecifier: input.sourceCommitSpecifier }), }; }; @@ -16770,14 +16732,16 @@ const serializeAws_json1_1DeleteApprovalRuleTemplateInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), }; }; const serializeAws_json1_1DeleteBranchInput = (input: DeleteBranchInput, context: __SerdeContext): any => { return { - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -16786,30 +16750,40 @@ const serializeAws_json1_1DeleteCommentContentInput = ( context: __SerdeContext ): any => { return { - ...(input.commentId !== undefined && { commentId: input.commentId }), + ...(input.commentId !== undefined && input.commentId !== null && { commentId: input.commentId }), }; }; const serializeAws_json1_1DeleteFileEntries = (input: DeleteFileEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DeleteFileEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DeleteFileEntry(entry, context); + }); }; const serializeAws_json1_1DeleteFileEntry = (input: DeleteFileEntry, context: __SerdeContext): any => { return { - ...(input.filePath !== undefined && { filePath: input.filePath }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), }; }; const serializeAws_json1_1DeleteFileInput = (input: DeleteFileInput, context: __SerdeContext): any => { return { - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.commitMessage !== undefined && { commitMessage: input.commitMessage }), - ...(input.email !== undefined && { email: input.email }), - ...(input.filePath !== undefined && { filePath: input.filePath }), - ...(input.keepEmptyFolders !== undefined && { keepEmptyFolders: input.keepEmptyFolders }), - ...(input.name !== undefined && { name: input.name }), - ...(input.parentCommitId !== undefined && { parentCommitId: input.parentCommitId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.commitMessage !== undefined && input.commitMessage !== null && { commitMessage: input.commitMessage }), + ...(input.email !== undefined && input.email !== null && { email: input.email }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), + ...(input.keepEmptyFolders !== undefined && + input.keepEmptyFolders !== null && { keepEmptyFolders: input.keepEmptyFolders }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.parentCommitId !== undefined && + input.parentCommitId !== null && { parentCommitId: input.parentCommitId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -16818,14 +16792,16 @@ const serializeAws_json1_1DeletePullRequestApprovalRuleInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleName !== undefined && { approvalRuleName: input.approvalRuleName }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), + ...(input.approvalRuleName !== undefined && + input.approvalRuleName !== null && { approvalRuleName: input.approvalRuleName }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), }; }; const serializeAws_json1_1DeleteRepositoryInput = (input: DeleteRepositoryInput, context: __SerdeContext): any => { return { - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -16834,19 +16810,20 @@ const serializeAws_json1_1DescribeMergeConflictsInput = ( context: __SerdeContext ): any => { return { - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.destinationCommitSpecifier !== undefined && { - destinationCommitSpecifier: input.destinationCommitSpecifier, - }), - ...(input.filePath !== undefined && { filePath: input.filePath }), - ...(input.maxMergeHunks !== undefined && { maxMergeHunks: input.maxMergeHunks }), - ...(input.mergeOption !== undefined && { mergeOption: input.mergeOption }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitSpecifier !== undefined && { sourceCommitSpecifier: input.sourceCommitSpecifier }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.destinationCommitSpecifier !== undefined && + input.destinationCommitSpecifier !== null && { destinationCommitSpecifier: input.destinationCommitSpecifier }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), + ...(input.maxMergeHunks !== undefined && input.maxMergeHunks !== null && { maxMergeHunks: input.maxMergeHunks }), + ...(input.mergeOption !== undefined && input.mergeOption !== null && { mergeOption: input.mergeOption }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitSpecifier !== undefined && + input.sourceCommitSpecifier !== null && { sourceCommitSpecifier: input.sourceCommitSpecifier }), }; }; @@ -16855,11 +16832,12 @@ const serializeAws_json1_1DescribePullRequestEventsInput = ( context: __SerdeContext ): any => { return { - ...(input.actorArn !== undefined && { actorArn: input.actorArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.pullRequestEventType !== undefined && { pullRequestEventType: input.pullRequestEventType }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), + ...(input.actorArn !== undefined && input.actorArn !== null && { actorArn: input.actorArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.pullRequestEventType !== undefined && + input.pullRequestEventType !== null && { pullRequestEventType: input.pullRequestEventType }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), }; }; @@ -16868,8 +16846,10 @@ const serializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryInput = context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -16878,13 +16858,20 @@ const serializeAws_json1_1EvaluatePullRequestApprovalRulesInput = ( context: __SerdeContext ): any => { return { - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.revisionId !== undefined && { revisionId: input.revisionId }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }), }; }; const serializeAws_json1_1FilePaths = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetApprovalRuleTemplateInput = ( @@ -16892,27 +16879,30 @@ const serializeAws_json1_1GetApprovalRuleTemplateInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), }; }; const serializeAws_json1_1GetBlobInput = (input: GetBlobInput, context: __SerdeContext): any => { return { - ...(input.blobId !== undefined && { blobId: input.blobId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.blobId !== undefined && input.blobId !== null && { blobId: input.blobId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1GetBranchInput = (input: GetBranchInput, context: __SerdeContext): any => { return { - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1GetCommentInput = (input: GetCommentInput, context: __SerdeContext): any => { return { - ...(input.commentId !== undefined && { commentId: input.commentId }), + ...(input.commentId !== undefined && input.commentId !== null && { commentId: input.commentId }), }; }; @@ -16921,10 +16911,11 @@ const serializeAws_json1_1GetCommentReactionsInput = ( context: __SerdeContext ): any => { return { - ...(input.commentId !== undefined && { commentId: input.commentId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.reactionUserArn !== undefined && { reactionUserArn: input.reactionUserArn }), + ...(input.commentId !== undefined && input.commentId !== null && { commentId: input.commentId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.reactionUserArn !== undefined && + input.reactionUserArn !== null && { reactionUserArn: input.reactionUserArn }), }; }; @@ -16933,11 +16924,13 @@ const serializeAws_json1_1GetCommentsForComparedCommitInput = ( context: __SerdeContext ): any => { return { - ...(input.afterCommitId !== undefined && { afterCommitId: input.afterCommitId }), - ...(input.beforeCommitId !== undefined && { beforeCommitId: input.beforeCommitId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.afterCommitId !== undefined && input.afterCommitId !== null && { afterCommitId: input.afterCommitId }), + ...(input.beforeCommitId !== undefined && + input.beforeCommitId !== null && { beforeCommitId: input.beforeCommitId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -16946,92 +16939,106 @@ const serializeAws_json1_1GetCommentsForPullRequestInput = ( context: __SerdeContext ): any => { return { - ...(input.afterCommitId !== undefined && { afterCommitId: input.afterCommitId }), - ...(input.beforeCommitId !== undefined && { beforeCommitId: input.beforeCommitId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.afterCommitId !== undefined && input.afterCommitId !== null && { afterCommitId: input.afterCommitId }), + ...(input.beforeCommitId !== undefined && + input.beforeCommitId !== null && { beforeCommitId: input.beforeCommitId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1GetCommitInput = (input: GetCommitInput, context: __SerdeContext): any => { return { - ...(input.commitId !== undefined && { commitId: input.commitId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.commitId !== undefined && input.commitId !== null && { commitId: input.commitId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1GetDifferencesInput = (input: GetDifferencesInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.afterCommitSpecifier !== undefined && { afterCommitSpecifier: input.afterCommitSpecifier }), - ...(input.afterPath !== undefined && { afterPath: input.afterPath }), - ...(input.beforeCommitSpecifier !== undefined && { beforeCommitSpecifier: input.beforeCommitSpecifier }), - ...(input.beforePath !== undefined && { beforePath: input.beforePath }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.afterCommitSpecifier !== undefined && + input.afterCommitSpecifier !== null && { afterCommitSpecifier: input.afterCommitSpecifier }), + ...(input.afterPath !== undefined && input.afterPath !== null && { afterPath: input.afterPath }), + ...(input.beforeCommitSpecifier !== undefined && + input.beforeCommitSpecifier !== null && { beforeCommitSpecifier: input.beforeCommitSpecifier }), + ...(input.beforePath !== undefined && input.beforePath !== null && { beforePath: input.beforePath }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1GetFileInput = (input: GetFileInput, context: __SerdeContext): any => { return { - ...(input.commitSpecifier !== undefined && { commitSpecifier: input.commitSpecifier }), - ...(input.filePath !== undefined && { filePath: input.filePath }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.commitSpecifier !== undefined && + input.commitSpecifier !== null && { commitSpecifier: input.commitSpecifier }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1GetFolderInput = (input: GetFolderInput, context: __SerdeContext): any => { return { - ...(input.commitSpecifier !== undefined && { commitSpecifier: input.commitSpecifier }), - ...(input.folderPath !== undefined && { folderPath: input.folderPath }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.commitSpecifier !== undefined && + input.commitSpecifier !== null && { commitSpecifier: input.commitSpecifier }), + ...(input.folderPath !== undefined && input.folderPath !== null && { folderPath: input.folderPath }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1GetMergeCommitInput = (input: GetMergeCommitInput, context: __SerdeContext): any => { return { - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.destinationCommitSpecifier !== undefined && { - destinationCommitSpecifier: input.destinationCommitSpecifier, - }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitSpecifier !== undefined && { sourceCommitSpecifier: input.sourceCommitSpecifier }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.destinationCommitSpecifier !== undefined && + input.destinationCommitSpecifier !== null && { destinationCommitSpecifier: input.destinationCommitSpecifier }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitSpecifier !== undefined && + input.sourceCommitSpecifier !== null && { sourceCommitSpecifier: input.sourceCommitSpecifier }), }; }; const serializeAws_json1_1GetMergeConflictsInput = (input: GetMergeConflictsInput, context: __SerdeContext): any => { return { - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.destinationCommitSpecifier !== undefined && { - destinationCommitSpecifier: input.destinationCommitSpecifier, - }), - ...(input.maxConflictFiles !== undefined && { maxConflictFiles: input.maxConflictFiles }), - ...(input.mergeOption !== undefined && { mergeOption: input.mergeOption }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitSpecifier !== undefined && { sourceCommitSpecifier: input.sourceCommitSpecifier }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.destinationCommitSpecifier !== undefined && + input.destinationCommitSpecifier !== null && { destinationCommitSpecifier: input.destinationCommitSpecifier }), + ...(input.maxConflictFiles !== undefined && + input.maxConflictFiles !== null && { maxConflictFiles: input.maxConflictFiles }), + ...(input.mergeOption !== undefined && input.mergeOption !== null && { mergeOption: input.mergeOption }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitSpecifier !== undefined && + input.sourceCommitSpecifier !== null && { sourceCommitSpecifier: input.sourceCommitSpecifier }), }; }; const serializeAws_json1_1GetMergeOptionsInput = (input: GetMergeOptionsInput, context: __SerdeContext): any => { return { - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.destinationCommitSpecifier !== undefined && { - destinationCommitSpecifier: input.destinationCommitSpecifier, - }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitSpecifier !== undefined && { sourceCommitSpecifier: input.sourceCommitSpecifier }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.destinationCommitSpecifier !== undefined && + input.destinationCommitSpecifier !== null && { destinationCommitSpecifier: input.destinationCommitSpecifier }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitSpecifier !== undefined && + input.sourceCommitSpecifier !== null && { sourceCommitSpecifier: input.sourceCommitSpecifier }), }; }; @@ -17040,14 +17047,14 @@ const serializeAws_json1_1GetPullRequestApprovalStatesInput = ( context: __SerdeContext ): any => { return { - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.revisionId !== undefined && { revisionId: input.revisionId }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }), }; }; const serializeAws_json1_1GetPullRequestInput = (input: GetPullRequestInput, context: __SerdeContext): any => { return { - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), }; }; @@ -17056,14 +17063,15 @@ const serializeAws_json1_1GetPullRequestOverrideStateInput = ( context: __SerdeContext ): any => { return { - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.revisionId !== undefined && { revisionId: input.revisionId }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }), }; }; const serializeAws_json1_1GetRepositoryInput = (input: GetRepositoryInput, context: __SerdeContext): any => { return { - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -17072,7 +17080,8 @@ const serializeAws_json1_1GetRepositoryTriggersInput = ( context: __SerdeContext ): any => { return { - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -17081,8 +17090,8 @@ const serializeAws_json1_1ListApprovalRuleTemplatesInput = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -17091,26 +17100,30 @@ const serializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositoryInput context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1ListBranchesInput = (input: ListBranchesInput, context: __SerdeContext): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1ListPullRequestsInput = (input: ListPullRequestsInput, context: __SerdeContext): any => { return { - ...(input.authorArn !== undefined && { authorArn: input.authorArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.pullRequestStatus !== undefined && { pullRequestStatus: input.pullRequestStatus }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.authorArn !== undefined && input.authorArn !== null && { authorArn: input.authorArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.pullRequestStatus !== undefined && + input.pullRequestStatus !== null && { pullRequestStatus: input.pullRequestStatus }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -17119,17 +17132,18 @@ const serializeAws_json1_1ListRepositoriesForApprovalRuleTemplateInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListRepositoriesInput = (input: ListRepositoriesInput, context: __SerdeContext): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.order !== undefined && { order: input.order }), - ...(input.sortBy !== undefined && { sortBy: input.sortBy }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.order !== undefined && input.order !== null && { order: input.order }), + ...(input.sortBy !== undefined && input.sortBy !== null && { sortBy: input.sortBy }), }; }; @@ -17138,16 +17152,17 @@ const serializeAws_json1_1ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_1Location = (input: Location, context: __SerdeContext): any => { return { - ...(input.filePath !== undefined && { filePath: input.filePath }), - ...(input.filePosition !== undefined && { filePosition: input.filePosition }), - ...(input.relativeFileVersion !== undefined && { relativeFileVersion: input.relativeFileVersion }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), + ...(input.filePosition !== undefined && input.filePosition !== null && { filePosition: input.filePosition }), + ...(input.relativeFileVersion !== undefined && + input.relativeFileVersion !== null && { relativeFileVersion: input.relativeFileVersion }), }; }; @@ -17156,12 +17171,13 @@ const serializeAws_json1_1MergeBranchesByFastForwardInput = ( context: __SerdeContext ): any => { return { - ...(input.destinationCommitSpecifier !== undefined && { - destinationCommitSpecifier: input.destinationCommitSpecifier, - }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitSpecifier !== undefined && { sourceCommitSpecifier: input.sourceCommitSpecifier }), - ...(input.targetBranch !== undefined && { targetBranch: input.targetBranch }), + ...(input.destinationCommitSpecifier !== undefined && + input.destinationCommitSpecifier !== null && { destinationCommitSpecifier: input.destinationCommitSpecifier }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitSpecifier !== undefined && + input.sourceCommitSpecifier !== null && { sourceCommitSpecifier: input.sourceCommitSpecifier }), + ...(input.targetBranch !== undefined && input.targetBranch !== null && { targetBranch: input.targetBranch }), }; }; @@ -17170,23 +17186,26 @@ const serializeAws_json1_1MergeBranchesBySquashInput = ( context: __SerdeContext ): any => { return { - ...(input.authorName !== undefined && { authorName: input.authorName }), - ...(input.commitMessage !== undefined && { commitMessage: input.commitMessage }), - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolution !== undefined && { - conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), - }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.destinationCommitSpecifier !== undefined && { - destinationCommitSpecifier: input.destinationCommitSpecifier, - }), - ...(input.email !== undefined && { email: input.email }), - ...(input.keepEmptyFolders !== undefined && { keepEmptyFolders: input.keepEmptyFolders }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitSpecifier !== undefined && { sourceCommitSpecifier: input.sourceCommitSpecifier }), - ...(input.targetBranch !== undefined && { targetBranch: input.targetBranch }), + ...(input.authorName !== undefined && input.authorName !== null && { authorName: input.authorName }), + ...(input.commitMessage !== undefined && input.commitMessage !== null && { commitMessage: input.commitMessage }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolution !== undefined && + input.conflictResolution !== null && { + conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), + }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.destinationCommitSpecifier !== undefined && + input.destinationCommitSpecifier !== null && { destinationCommitSpecifier: input.destinationCommitSpecifier }), + ...(input.email !== undefined && input.email !== null && { email: input.email }), + ...(input.keepEmptyFolders !== undefined && + input.keepEmptyFolders !== null && { keepEmptyFolders: input.keepEmptyFolders }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitSpecifier !== undefined && + input.sourceCommitSpecifier !== null && { sourceCommitSpecifier: input.sourceCommitSpecifier }), + ...(input.targetBranch !== undefined && input.targetBranch !== null && { targetBranch: input.targetBranch }), }; }; @@ -17195,23 +17214,26 @@ const serializeAws_json1_1MergeBranchesByThreeWayInput = ( context: __SerdeContext ): any => { return { - ...(input.authorName !== undefined && { authorName: input.authorName }), - ...(input.commitMessage !== undefined && { commitMessage: input.commitMessage }), - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolution !== undefined && { - conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), - }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.destinationCommitSpecifier !== undefined && { - destinationCommitSpecifier: input.destinationCommitSpecifier, - }), - ...(input.email !== undefined && { email: input.email }), - ...(input.keepEmptyFolders !== undefined && { keepEmptyFolders: input.keepEmptyFolders }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitSpecifier !== undefined && { sourceCommitSpecifier: input.sourceCommitSpecifier }), - ...(input.targetBranch !== undefined && { targetBranch: input.targetBranch }), + ...(input.authorName !== undefined && input.authorName !== null && { authorName: input.authorName }), + ...(input.commitMessage !== undefined && input.commitMessage !== null && { commitMessage: input.commitMessage }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolution !== undefined && + input.conflictResolution !== null && { + conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), + }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.destinationCommitSpecifier !== undefined && + input.destinationCommitSpecifier !== null && { destinationCommitSpecifier: input.destinationCommitSpecifier }), + ...(input.email !== undefined && input.email !== null && { email: input.email }), + ...(input.keepEmptyFolders !== undefined && + input.keepEmptyFolders !== null && { keepEmptyFolders: input.keepEmptyFolders }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitSpecifier !== undefined && + input.sourceCommitSpecifier !== null && { sourceCommitSpecifier: input.sourceCommitSpecifier }), + ...(input.targetBranch !== undefined && input.targetBranch !== null && { targetBranch: input.targetBranch }), }; }; @@ -17220,9 +17242,11 @@ const serializeAws_json1_1MergePullRequestByFastForwardInput = ( context: __SerdeContext ): any => { return { - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitId !== undefined && { sourceCommitId: input.sourceCommitId }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitId !== undefined && + input.sourceCommitId !== null && { sourceCommitId: input.sourceCommitId }), }; }; @@ -17231,20 +17255,24 @@ const serializeAws_json1_1MergePullRequestBySquashInput = ( context: __SerdeContext ): any => { return { - ...(input.authorName !== undefined && { authorName: input.authorName }), - ...(input.commitMessage !== undefined && { commitMessage: input.commitMessage }), - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolution !== undefined && { - conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), - }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.email !== undefined && { email: input.email }), - ...(input.keepEmptyFolders !== undefined && { keepEmptyFolders: input.keepEmptyFolders }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitId !== undefined && { sourceCommitId: input.sourceCommitId }), + ...(input.authorName !== undefined && input.authorName !== null && { authorName: input.authorName }), + ...(input.commitMessage !== undefined && input.commitMessage !== null && { commitMessage: input.commitMessage }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolution !== undefined && + input.conflictResolution !== null && { + conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), + }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.email !== undefined && input.email !== null && { email: input.email }), + ...(input.keepEmptyFolders !== undefined && + input.keepEmptyFolders !== null && { keepEmptyFolders: input.keepEmptyFolders }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitId !== undefined && + input.sourceCommitId !== null && { sourceCommitId: input.sourceCommitId }), }; }; @@ -17253,20 +17281,24 @@ const serializeAws_json1_1MergePullRequestByThreeWayInput = ( context: __SerdeContext ): any => { return { - ...(input.authorName !== undefined && { authorName: input.authorName }), - ...(input.commitMessage !== undefined && { commitMessage: input.commitMessage }), - ...(input.conflictDetailLevel !== undefined && { conflictDetailLevel: input.conflictDetailLevel }), - ...(input.conflictResolution !== undefined && { - conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), - }), - ...(input.conflictResolutionStrategy !== undefined && { - conflictResolutionStrategy: input.conflictResolutionStrategy, - }), - ...(input.email !== undefined && { email: input.email }), - ...(input.keepEmptyFolders !== undefined && { keepEmptyFolders: input.keepEmptyFolders }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceCommitId !== undefined && { sourceCommitId: input.sourceCommitId }), + ...(input.authorName !== undefined && input.authorName !== null && { authorName: input.authorName }), + ...(input.commitMessage !== undefined && input.commitMessage !== null && { commitMessage: input.commitMessage }), + ...(input.conflictDetailLevel !== undefined && + input.conflictDetailLevel !== null && { conflictDetailLevel: input.conflictDetailLevel }), + ...(input.conflictResolution !== undefined && + input.conflictResolution !== null && { + conflictResolution: serializeAws_json1_1ConflictResolution(input.conflictResolution, context), + }), + ...(input.conflictResolutionStrategy !== undefined && + input.conflictResolutionStrategy !== null && { conflictResolutionStrategy: input.conflictResolutionStrategy }), + ...(input.email !== undefined && input.email !== null && { email: input.email }), + ...(input.keepEmptyFolders !== undefined && + input.keepEmptyFolders !== null && { keepEmptyFolders: input.keepEmptyFolders }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceCommitId !== undefined && + input.sourceCommitId !== null && { sourceCommitId: input.sourceCommitId }), }; }; @@ -17275,9 +17307,10 @@ const serializeAws_json1_1OverridePullRequestApprovalRulesInput = ( context: __SerdeContext ): any => { return { - ...(input.overrideStatus !== undefined && { overrideStatus: input.overrideStatus }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.revisionId !== undefined && { revisionId: input.revisionId }), + ...(input.overrideStatus !== undefined && + input.overrideStatus !== null && { overrideStatus: input.overrideStatus }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }), }; }; @@ -17286,12 +17319,15 @@ const serializeAws_json1_1PostCommentForComparedCommitInput = ( context: __SerdeContext ): any => { return { - ...(input.afterCommitId !== undefined && { afterCommitId: input.afterCommitId }), - ...(input.beforeCommitId !== undefined && { beforeCommitId: input.beforeCommitId }), + ...(input.afterCommitId !== undefined && input.afterCommitId !== null && { afterCommitId: input.afterCommitId }), + ...(input.beforeCommitId !== undefined && + input.beforeCommitId !== null && { beforeCommitId: input.beforeCommitId }), clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.content !== undefined && { content: input.content }), - ...(input.location !== undefined && { location: serializeAws_json1_1Location(input.location, context) }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.content !== undefined && input.content !== null && { content: input.content }), + ...(input.location !== undefined && + input.location !== null && { location: serializeAws_json1_1Location(input.location, context) }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -17300,57 +17336,70 @@ const serializeAws_json1_1PostCommentForPullRequestInput = ( context: __SerdeContext ): any => { return { - ...(input.afterCommitId !== undefined && { afterCommitId: input.afterCommitId }), - ...(input.beforeCommitId !== undefined && { beforeCommitId: input.beforeCommitId }), + ...(input.afterCommitId !== undefined && input.afterCommitId !== null && { afterCommitId: input.afterCommitId }), + ...(input.beforeCommitId !== undefined && + input.beforeCommitId !== null && { beforeCommitId: input.beforeCommitId }), clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.content !== undefined && { content: input.content }), - ...(input.location !== undefined && { location: serializeAws_json1_1Location(input.location, context) }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.content !== undefined && input.content !== null && { content: input.content }), + ...(input.location !== undefined && + input.location !== null && { location: serializeAws_json1_1Location(input.location, context) }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1PostCommentReplyInput = (input: PostCommentReplyInput, context: __SerdeContext): any => { return { clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.content !== undefined && { content: input.content }), - ...(input.inReplyTo !== undefined && { inReplyTo: input.inReplyTo }), + ...(input.content !== undefined && input.content !== null && { content: input.content }), + ...(input.inReplyTo !== undefined && input.inReplyTo !== null && { inReplyTo: input.inReplyTo }), }; }; const serializeAws_json1_1PutCommentReactionInput = (input: PutCommentReactionInput, context: __SerdeContext): any => { return { - ...(input.commentId !== undefined && { commentId: input.commentId }), - ...(input.reactionValue !== undefined && { reactionValue: input.reactionValue }), + ...(input.commentId !== undefined && input.commentId !== null && { commentId: input.commentId }), + ...(input.reactionValue !== undefined && input.reactionValue !== null && { reactionValue: input.reactionValue }), }; }; const serializeAws_json1_1PutFileEntries = (input: PutFileEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PutFileEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PutFileEntry(entry, context); + }); }; const serializeAws_json1_1PutFileEntry = (input: PutFileEntry, context: __SerdeContext): any => { return { - ...(input.fileContent !== undefined && { fileContent: context.base64Encoder(input.fileContent) }), - ...(input.fileMode !== undefined && { fileMode: input.fileMode }), - ...(input.filePath !== undefined && { filePath: input.filePath }), - ...(input.sourceFile !== undefined && { - sourceFile: serializeAws_json1_1SourceFileSpecifier(input.sourceFile, context), - }), + ...(input.fileContent !== undefined && + input.fileContent !== null && { fileContent: context.base64Encoder(input.fileContent) }), + ...(input.fileMode !== undefined && input.fileMode !== null && { fileMode: input.fileMode }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), + ...(input.sourceFile !== undefined && + input.sourceFile !== null && { sourceFile: serializeAws_json1_1SourceFileSpecifier(input.sourceFile, context) }), }; }; const serializeAws_json1_1PutFileInput = (input: PutFileInput, context: __SerdeContext): any => { return { - ...(input.branchName !== undefined && { branchName: input.branchName }), - ...(input.commitMessage !== undefined && { commitMessage: input.commitMessage }), - ...(input.email !== undefined && { email: input.email }), - ...(input.fileContent !== undefined && { fileContent: context.base64Encoder(input.fileContent) }), - ...(input.fileMode !== undefined && { fileMode: input.fileMode }), - ...(input.filePath !== undefined && { filePath: input.filePath }), - ...(input.name !== undefined && { name: input.name }), - ...(input.parentCommitId !== undefined && { parentCommitId: input.parentCommitId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.branchName !== undefined && input.branchName !== null && { branchName: input.branchName }), + ...(input.commitMessage !== undefined && input.commitMessage !== null && { commitMessage: input.commitMessage }), + ...(input.email !== undefined && input.email !== null && { email: input.email }), + ...(input.fileContent !== undefined && + input.fileContent !== null && { fileContent: context.base64Encoder(input.fileContent) }), + ...(input.fileMode !== undefined && input.fileMode !== null && { fileMode: input.fileMode }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.parentCommitId !== undefined && + input.parentCommitId !== null && { parentCommitId: input.parentCommitId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -17359,39 +17408,55 @@ const serializeAws_json1_1PutRepositoryTriggersInput = ( context: __SerdeContext ): any => { return { - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.triggers !== undefined && { - triggers: serializeAws_json1_1RepositoryTriggersList(input.triggers, context), - }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.triggers !== undefined && + input.triggers !== null && { triggers: serializeAws_json1_1RepositoryTriggersList(input.triggers, context) }), }; }; const serializeAws_json1_1ReplaceContentEntries = (input: ReplaceContentEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ReplaceContentEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ReplaceContentEntry(entry, context); + }); }; const serializeAws_json1_1ReplaceContentEntry = (input: ReplaceContentEntry, context: __SerdeContext): any => { return { - ...(input.content !== undefined && { content: context.base64Encoder(input.content) }), - ...(input.fileMode !== undefined && { fileMode: input.fileMode }), - ...(input.filePath !== undefined && { filePath: input.filePath }), - ...(input.replacementType !== undefined && { replacementType: input.replacementType }), + ...(input.content !== undefined && input.content !== null && { content: context.base64Encoder(input.content) }), + ...(input.fileMode !== undefined && input.fileMode !== null && { fileMode: input.fileMode }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), + ...(input.replacementType !== undefined && + input.replacementType !== null && { replacementType: input.replacementType }), }; }; const serializeAws_json1_1RepositoryNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RepositoryTrigger = (input: RepositoryTrigger, context: __SerdeContext): any => { return { - ...(input.branches !== undefined && { branches: serializeAws_json1_1BranchNameList(input.branches, context) }), - ...(input.customData !== undefined && { customData: input.customData }), - ...(input.destinationArn !== undefined && { destinationArn: input.destinationArn }), - ...(input.events !== undefined && { - events: serializeAws_json1_1RepositoryTriggerEventList(input.events, context), - }), - ...(input.name !== undefined && { name: input.name }), + ...(input.branches !== undefined && + input.branches !== null && { branches: serializeAws_json1_1BranchNameList(input.branches, context) }), + ...(input.customData !== undefined && input.customData !== null && { customData: input.customData }), + ...(input.destinationArn !== undefined && + input.destinationArn !== null && { destinationArn: input.destinationArn }), + ...(input.events !== undefined && + input.events !== null && { events: serializeAws_json1_1RepositoryTriggerEventList(input.events, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -17399,62 +17464,102 @@ const serializeAws_json1_1RepositoryTriggerEventList = ( input: (RepositoryTriggerEventEnum | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RepositoryTriggersList = (input: RepositoryTrigger[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RepositoryTrigger(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RepositoryTrigger(entry, context); + }); }; const serializeAws_json1_1SetFileModeEntries = (input: SetFileModeEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SetFileModeEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SetFileModeEntry(entry, context); + }); }; const serializeAws_json1_1SetFileModeEntry = (input: SetFileModeEntry, context: __SerdeContext): any => { return { - ...(input.fileMode !== undefined && { fileMode: input.fileMode }), - ...(input.filePath !== undefined && { filePath: input.filePath }), + ...(input.fileMode !== undefined && input.fileMode !== null && { fileMode: input.fileMode }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), }; }; const serializeAws_json1_1SourceFileSpecifier = (input: SourceFileSpecifier, context: __SerdeContext): any => { return { - ...(input.filePath !== undefined && { filePath: input.filePath }), - ...(input.isMove !== undefined && { isMove: input.isMove }), + ...(input.filePath !== undefined && input.filePath !== null && { filePath: input.filePath }), + ...(input.isMove !== undefined && input.isMove !== null && { isMove: input.isMove }), }; }; const serializeAws_json1_1TagKeysList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagsMap(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagsMap(input.tags, context) }), }; }; const serializeAws_json1_1TagsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1Target = (input: Target, context: __SerdeContext): any => { return { - ...(input.destinationReference !== undefined && { destinationReference: input.destinationReference }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.sourceReference !== undefined && { sourceReference: input.sourceReference }), + ...(input.destinationReference !== undefined && + input.destinationReference !== null && { destinationReference: input.destinationReference }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.sourceReference !== undefined && + input.sourceReference !== null && { sourceReference: input.sourceReference }), }; }; const serializeAws_json1_1TargetList = (input: Target[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Target(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Target(entry, context); + }); }; const serializeAws_json1_1TestRepositoryTriggersInput = ( @@ -17462,17 +17567,18 @@ const serializeAws_json1_1TestRepositoryTriggersInput = ( context: __SerdeContext ): any => { return { - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.triggers !== undefined && { - triggers: serializeAws_json1_1RepositoryTriggersList(input.triggers, context), - }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.triggers !== undefined && + input.triggers !== null && { triggers: serializeAws_json1_1RepositoryTriggersList(input.triggers, context) }), }; }; const serializeAws_json1_1UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1TagKeysList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1TagKeysList(input.tagKeys, context) }), }; }; @@ -17481,11 +17587,12 @@ const serializeAws_json1_1UpdateApprovalRuleTemplateContentInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), - ...(input.existingRuleContentSha256 !== undefined && { - existingRuleContentSha256: input.existingRuleContentSha256, - }), - ...(input.newRuleContent !== undefined && { newRuleContent: input.newRuleContent }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.existingRuleContentSha256 !== undefined && + input.existingRuleContentSha256 !== null && { existingRuleContentSha256: input.existingRuleContentSha256 }), + ...(input.newRuleContent !== undefined && + input.newRuleContent !== null && { newRuleContent: input.newRuleContent }), }; }; @@ -17494,10 +17601,12 @@ const serializeAws_json1_1UpdateApprovalRuleTemplateDescriptionInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleTemplateDescription !== undefined && { - approvalRuleTemplateDescription: input.approvalRuleTemplateDescription, - }), - ...(input.approvalRuleTemplateName !== undefined && { approvalRuleTemplateName: input.approvalRuleTemplateName }), + ...(input.approvalRuleTemplateDescription !== undefined && + input.approvalRuleTemplateDescription !== null && { + approvalRuleTemplateDescription: input.approvalRuleTemplateDescription, + }), + ...(input.approvalRuleTemplateName !== undefined && + input.approvalRuleTemplateName !== null && { approvalRuleTemplateName: input.approvalRuleTemplateName }), }; }; @@ -17506,19 +17615,17 @@ const serializeAws_json1_1UpdateApprovalRuleTemplateNameInput = ( context: __SerdeContext ): any => { return { - ...(input.newApprovalRuleTemplateName !== undefined && { - newApprovalRuleTemplateName: input.newApprovalRuleTemplateName, - }), - ...(input.oldApprovalRuleTemplateName !== undefined && { - oldApprovalRuleTemplateName: input.oldApprovalRuleTemplateName, - }), + ...(input.newApprovalRuleTemplateName !== undefined && + input.newApprovalRuleTemplateName !== null && { newApprovalRuleTemplateName: input.newApprovalRuleTemplateName }), + ...(input.oldApprovalRuleTemplateName !== undefined && + input.oldApprovalRuleTemplateName !== null && { oldApprovalRuleTemplateName: input.oldApprovalRuleTemplateName }), }; }; const serializeAws_json1_1UpdateCommentInput = (input: UpdateCommentInput, context: __SerdeContext): any => { return { - ...(input.commentId !== undefined && { commentId: input.commentId }), - ...(input.content !== undefined && { content: input.content }), + ...(input.commentId !== undefined && input.commentId !== null && { commentId: input.commentId }), + ...(input.content !== undefined && input.content !== null && { content: input.content }), }; }; @@ -17527,8 +17634,10 @@ const serializeAws_json1_1UpdateDefaultBranchInput = ( context: __SerdeContext ): any => { return { - ...(input.defaultBranchName !== undefined && { defaultBranchName: input.defaultBranchName }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.defaultBranchName !== undefined && + input.defaultBranchName !== null && { defaultBranchName: input.defaultBranchName }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -17537,12 +17646,13 @@ const serializeAws_json1_1UpdatePullRequestApprovalRuleContentInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalRuleName !== undefined && { approvalRuleName: input.approvalRuleName }), - ...(input.existingRuleContentSha256 !== undefined && { - existingRuleContentSha256: input.existingRuleContentSha256, - }), - ...(input.newRuleContent !== undefined && { newRuleContent: input.newRuleContent }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), + ...(input.approvalRuleName !== undefined && + input.approvalRuleName !== null && { approvalRuleName: input.approvalRuleName }), + ...(input.existingRuleContentSha256 !== undefined && + input.existingRuleContentSha256 !== null && { existingRuleContentSha256: input.existingRuleContentSha256 }), + ...(input.newRuleContent !== undefined && + input.newRuleContent !== null && { newRuleContent: input.newRuleContent }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), }; }; @@ -17551,9 +17661,9 @@ const serializeAws_json1_1UpdatePullRequestApprovalStateInput = ( context: __SerdeContext ): any => { return { - ...(input.approvalState !== undefined && { approvalState: input.approvalState }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.revisionId !== undefined && { revisionId: input.revisionId }), + ...(input.approvalState !== undefined && input.approvalState !== null && { approvalState: input.approvalState }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }), }; }; @@ -17562,8 +17672,8 @@ const serializeAws_json1_1UpdatePullRequestDescriptionInput = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), }; }; @@ -17572,8 +17682,9 @@ const serializeAws_json1_1UpdatePullRequestStatusInput = ( context: __SerdeContext ): any => { return { - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.pullRequestStatus !== undefined && { pullRequestStatus: input.pullRequestStatus }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.pullRequestStatus !== undefined && + input.pullRequestStatus !== null && { pullRequestStatus: input.pullRequestStatus }), }; }; @@ -17582,8 +17693,8 @@ const serializeAws_json1_1UpdatePullRequestTitleInput = ( context: __SerdeContext ): any => { return { - ...(input.pullRequestId !== undefined && { pullRequestId: input.pullRequestId }), - ...(input.title !== undefined && { title: input.title }), + ...(input.pullRequestId !== undefined && input.pullRequestId !== null && { pullRequestId: input.pullRequestId }), + ...(input.title !== undefined && input.title !== null && { title: input.title }), }; }; @@ -17592,8 +17703,10 @@ const serializeAws_json1_1UpdateRepositoryDescriptionInput = ( context: __SerdeContext ): any => { return { - ...(input.repositoryDescription !== undefined && { repositoryDescription: input.repositoryDescription }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.repositoryDescription !== undefined && + input.repositoryDescription !== null && { repositoryDescription: input.repositoryDescription }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -17602,8 +17715,8 @@ const serializeAws_json1_1UpdateRepositoryNameInput = ( context: __SerdeContext ): any => { return { - ...(input.newName !== undefined && { newName: input.newName }), - ...(input.oldName !== undefined && { oldName: input.oldName }), + ...(input.newName !== undefined && input.newName !== null && { newName: input.newName }), + ...(input.oldName !== undefined && input.oldName !== null && { oldName: input.oldName }), }; }; @@ -17625,7 +17738,14 @@ const deserializeAws_json1_1Approval = (output: any, context: __SerdeContext): A }; const deserializeAws_json1_1ApprovalList = (output: any, context: __SerdeContext): Approval[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Approval(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Approval(entry, context); + }); }; const deserializeAws_json1_1ApprovalRule = (output: any, context: __SerdeContext): ApprovalRule => { @@ -17723,15 +17843,36 @@ const deserializeAws_json1_1ApprovalRuleOverriddenEventMetadata = ( }; const deserializeAws_json1_1ApprovalRulesList = (output: any, context: __SerdeContext): ApprovalRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ApprovalRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ApprovalRule(entry, context); + }); }; const deserializeAws_json1_1ApprovalRulesNotSatisfiedList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ApprovalRulesSatisfiedList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ApprovalRuleTemplate = (output: any, context: __SerdeContext): ApprovalRuleTemplate => { @@ -17806,7 +17947,14 @@ const deserializeAws_json1_1ApprovalRuleTemplateNameAlreadyExistsException = ( }; const deserializeAws_json1_1ApprovalRuleTemplateNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ApprovalRuleTemplateNameRequiredException = ( @@ -17863,9 +18011,14 @@ const deserializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesEr output: any, context: __SerdeContext ): BatchAssociateApprovalRuleTemplateWithRepositoriesError[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesError(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesError(entry, context); + }); }; const deserializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesOutput = ( @@ -17900,7 +18053,14 @@ const deserializeAws_json1_1BatchDescribeMergeConflictsErrors = ( output: any, context: __SerdeContext ): BatchDescribeMergeConflictsError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchDescribeMergeConflictsError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchDescribeMergeConflictsError(entry, context); + }); }; const deserializeAws_json1_1BatchDescribeMergeConflictsOutput = ( @@ -17943,9 +18103,14 @@ const deserializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositorie output: any, context: __SerdeContext ): BatchDisassociateApprovalRuleTemplateFromRepositoriesError[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositoriesError(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositoriesError(entry, context); + }); }; const deserializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput = ( @@ -17976,7 +18141,14 @@ const deserializeAws_json1_1BatchGetCommitsErrorsList = ( output: any, context: __SerdeContext ): BatchGetCommitsError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchGetCommitsError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchGetCommitsError(entry, context); + }); }; const deserializeAws_json1_1BatchGetCommitsOutput = (output: any, context: __SerdeContext): BatchGetCommitsOutput => { @@ -18078,7 +18250,14 @@ const deserializeAws_json1_1BranchNameIsTagNameException = ( }; const deserializeAws_json1_1BranchNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1BranchNameRequiredException = ( @@ -18091,7 +18270,14 @@ const deserializeAws_json1_1BranchNameRequiredException = ( }; const deserializeAws_json1_1CallerReactions = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CannotDeleteApprovalRuleFromTemplateException = ( @@ -18206,7 +18392,14 @@ const deserializeAws_json1_1CommentNotCreatedByCallerException = ( }; const deserializeAws_json1_1Comments = (output: any, context: __SerdeContext): Comment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Comment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Comment(entry, context); + }); }; const deserializeAws_json1_1CommentsForComparedCommit = ( @@ -18237,7 +18430,14 @@ const deserializeAws_json1_1CommentsForComparedCommitData = ( output: any, context: __SerdeContext ): CommentsForComparedCommit[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CommentsForComparedCommit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CommentsForComparedCommit(entry, context); + }); }; const deserializeAws_json1_1CommentsForPullRequest = (output: any, context: __SerdeContext): CommentsForPullRequest => { @@ -18267,7 +18467,14 @@ const deserializeAws_json1_1CommentsForPullRequestData = ( output: any, context: __SerdeContext ): CommentsForPullRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CommentsForPullRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CommentsForPullRequest(entry, context); + }); }; const deserializeAws_json1_1Commit = (output: any, context: __SerdeContext): Commit => { @@ -18347,7 +18554,14 @@ const deserializeAws_json1_1CommitMessageLengthExceededException = ( }; const deserializeAws_json1_1CommitObjectsList = (output: any, context: __SerdeContext): Commit[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Commit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Commit(entry, context); + }); }; const deserializeAws_json1_1CommitRequiredException = ( @@ -18420,11 +18634,25 @@ const deserializeAws_json1_1ConflictMetadata = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ConflictMetadataList = (output: any, context: __SerdeContext): ConflictMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConflictMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConflictMetadata(entry, context); + }); }; const deserializeAws_json1_1Conflicts = (output: any, context: __SerdeContext): Conflict[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Conflict(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Conflict(entry, context); + }); }; const deserializeAws_json1_1CreateApprovalRuleTemplateOutput = ( @@ -18620,7 +18848,14 @@ const deserializeAws_json1_1Difference = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1DifferenceList = (output: any, context: __SerdeContext): Difference[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Difference(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Difference(entry, context); + }); }; const deserializeAws_json1_1DirectoryNameConflictsWithFileNameException = ( @@ -18759,7 +18994,14 @@ const deserializeAws_json1_1FileEntryRequiredException = ( }; const deserializeAws_json1_1FileList = (output: any, context: __SerdeContext): File[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1File(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1File(entry, context); + }); }; const deserializeAws_json1_1FileMetadata = (output: any, context: __SerdeContext): FileMetadata => { @@ -18814,7 +19056,14 @@ const deserializeAws_json1_1FileSizes = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1FilesMetadata = (output: any, context: __SerdeContext): FileMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FileMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FileMetadata(entry, context); + }); }; const deserializeAws_json1_1FileTooLargeException = (output: any, context: __SerdeContext): FileTooLargeException => { @@ -18850,7 +19099,14 @@ const deserializeAws_json1_1FolderDoesNotExistException = ( }; const deserializeAws_json1_1FolderList = (output: any, context: __SerdeContext): Folder[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Folder(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Folder(entry, context); + }); }; const deserializeAws_json1_1GetApprovalRuleTemplateOutput = ( @@ -19900,7 +20156,14 @@ const deserializeAws_json1_1MergeHunkDetail = (output: any, context: __SerdeCont }; const deserializeAws_json1_1MergeHunks = (output: any, context: __SerdeContext): MergeHunk[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MergeHunk(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MergeHunk(entry, context); + }); }; const deserializeAws_json1_1MergeMetadata = (output: any, context: __SerdeContext): MergeMetadata => { @@ -19930,7 +20193,14 @@ const deserializeAws_json1_1MergeOptionRequiredException = ( }; const deserializeAws_json1_1MergeOptions = (output: any, context: __SerdeContext): (MergeOptionTypeEnum | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1MergePullRequestByFastForwardOutput = ( @@ -20090,7 +20360,14 @@ const deserializeAws_json1_1ParentCommitIdRequiredException = ( }; const deserializeAws_json1_1ParentList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PathDoesNotExistException = ( @@ -20312,11 +20589,25 @@ const deserializeAws_json1_1PullRequestEvent = (output: any, context: __SerdeCon }; const deserializeAws_json1_1PullRequestEventList = (output: any, context: __SerdeContext): PullRequestEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PullRequestEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PullRequestEvent(entry, context); + }); }; const deserializeAws_json1_1PullRequestIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PullRequestIdRequiredException = ( @@ -20406,7 +20697,14 @@ const deserializeAws_json1_1PullRequestTarget = (output: any, context: __SerdeCo }; const deserializeAws_json1_1PullRequestTargetList = (output: any, context: __SerdeContext): PullRequestTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PullRequestTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PullRequestTarget(entry, context); + }); }; const deserializeAws_json1_1PutFileEntryConflictException = ( @@ -20437,13 +20735,15 @@ const deserializeAws_json1_1PutRepositoryTriggersOutput = ( }; const deserializeAws_json1_1ReactionCountsMap = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ReactionForComment = (output: any, context: __SerdeContext): ReactionForComment => { @@ -20473,11 +20773,25 @@ const deserializeAws_json1_1ReactionLimitExceededException = ( }; const deserializeAws_json1_1ReactionsForCommentList = (output: any, context: __SerdeContext): ReactionForComment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReactionForComment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReactionForComment(entry, context); + }); }; const deserializeAws_json1_1ReactionUsersList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ReactionValueFormats = (output: any, context: __SerdeContext): ReactionValueFormats => { @@ -20587,7 +20901,14 @@ const deserializeAws_json1_1RepositoryMetadata = (output: any, context: __SerdeC }; const deserializeAws_json1_1RepositoryMetadataList = (output: any, context: __SerdeContext): RepositoryMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RepositoryMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RepositoryMetadata(entry, context); + }); }; const deserializeAws_json1_1RepositoryNameExistsException = ( @@ -20611,11 +20932,25 @@ const deserializeAws_json1_1RepositoryNameIdPairList = ( output: any, context: __SerdeContext ): RepositoryNameIdPair[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RepositoryNameIdPair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RepositoryNameIdPair(entry, context); + }); }; const deserializeAws_json1_1RepositoryNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RepositoryNameRequiredException = ( @@ -20646,7 +20981,14 @@ const deserializeAws_json1_1RepositoryNotAssociatedWithPullRequestException = ( }; const deserializeAws_json1_1RepositoryNotFoundList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RepositoryTrigger = (output: any, context: __SerdeContext): RepositoryTrigger => { @@ -20688,7 +21030,14 @@ const deserializeAws_json1_1RepositoryTriggerEventList = ( output: any, context: __SerdeContext ): (RepositoryTriggerEventEnum | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RepositoryTriggerEventsListRequiredException = ( @@ -20715,11 +21064,25 @@ const deserializeAws_json1_1RepositoryTriggerExecutionFailureList = ( output: any, context: __SerdeContext ): RepositoryTriggerExecutionFailure[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RepositoryTriggerExecutionFailure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RepositoryTriggerExecutionFailure(entry, context); + }); }; const deserializeAws_json1_1RepositoryTriggerNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RepositoryTriggerNameRequiredException = ( @@ -20732,7 +21095,14 @@ const deserializeAws_json1_1RepositoryTriggerNameRequiredException = ( }; const deserializeAws_json1_1RepositoryTriggersList = (output: any, context: __SerdeContext): RepositoryTrigger[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RepositoryTrigger(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RepositoryTrigger(entry, context); + }); }; const deserializeAws_json1_1RepositoryTriggersListRequiredException = ( @@ -20825,7 +21195,14 @@ const deserializeAws_json1_1SubModule = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1SubModuleList = (output: any, context: __SerdeContext): SubModule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SubModule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SubModule(entry, context); + }); }; const deserializeAws_json1_1SymbolicLink = (output: any, context: __SerdeContext): SymbolicLink => { @@ -20838,7 +21215,14 @@ const deserializeAws_json1_1SymbolicLink = (output: any, context: __SerdeContext }; const deserializeAws_json1_1SymbolicLinkList = (output: any, context: __SerdeContext): SymbolicLink[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SymbolicLink(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SymbolicLink(entry, context); + }); }; const deserializeAws_json1_1TagKeysListRequiredException = ( @@ -20857,13 +21241,15 @@ const deserializeAws_json1_1TagPolicyException = (output: any, context: __SerdeC }; const deserializeAws_json1_1TagsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1TagsMapRequiredException = ( @@ -21090,3 +21476,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-codedeploy/protocols/Aws_json1_1.ts b/clients/client-codedeploy/protocols/Aws_json1_1.ts index 94c3d02995dc..7c47e1f5a68d 100644 --- a/clients/client-codedeploy/protocols/Aws_json1_1.ts +++ b/clients/client-codedeploy/protocols/Aws_json1_1.ts @@ -416,7 +416,7 @@ export const serializeAws_json1_1AddTagsToOnPremisesInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.AddTagsToOnPremisesInstances", }; let body: any; @@ -429,7 +429,7 @@ export const serializeAws_json1_1BatchGetApplicationRevisionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.BatchGetApplicationRevisions", }; let body: any; @@ -442,7 +442,7 @@ export const serializeAws_json1_1BatchGetApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.BatchGetApplications", }; let body: any; @@ -455,7 +455,7 @@ export const serializeAws_json1_1BatchGetDeploymentGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.BatchGetDeploymentGroups", }; let body: any; @@ -468,7 +468,7 @@ export const serializeAws_json1_1BatchGetDeploymentInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.BatchGetDeploymentInstances", }; let body: any; @@ -481,7 +481,7 @@ export const serializeAws_json1_1BatchGetDeploymentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.BatchGetDeployments", }; let body: any; @@ -494,7 +494,7 @@ export const serializeAws_json1_1BatchGetDeploymentTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.BatchGetDeploymentTargets", }; let body: any; @@ -507,7 +507,7 @@ export const serializeAws_json1_1BatchGetOnPremisesInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.BatchGetOnPremisesInstances", }; let body: any; @@ -520,7 +520,7 @@ export const serializeAws_json1_1ContinueDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ContinueDeployment", }; let body: any; @@ -533,7 +533,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.CreateApplication", }; let body: any; @@ -546,7 +546,7 @@ export const serializeAws_json1_1CreateDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.CreateDeployment", }; let body: any; @@ -559,7 +559,7 @@ export const serializeAws_json1_1CreateDeploymentConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.CreateDeploymentConfig", }; let body: any; @@ -572,7 +572,7 @@ export const serializeAws_json1_1CreateDeploymentGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.CreateDeploymentGroup", }; let body: any; @@ -585,7 +585,7 @@ export const serializeAws_json1_1DeleteApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.DeleteApplication", }; let body: any; @@ -598,7 +598,7 @@ export const serializeAws_json1_1DeleteDeploymentConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.DeleteDeploymentConfig", }; let body: any; @@ -611,7 +611,7 @@ export const serializeAws_json1_1DeleteDeploymentGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.DeleteDeploymentGroup", }; let body: any; @@ -624,7 +624,7 @@ export const serializeAws_json1_1DeleteGitHubAccountTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.DeleteGitHubAccountToken", }; let body: any; @@ -637,7 +637,7 @@ export const serializeAws_json1_1DeleteResourcesByExternalIdCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.DeleteResourcesByExternalId", }; let body: any; @@ -650,7 +650,7 @@ export const serializeAws_json1_1DeregisterOnPremisesInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.DeregisterOnPremisesInstance", }; let body: any; @@ -663,7 +663,7 @@ export const serializeAws_json1_1GetApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.GetApplication", }; let body: any; @@ -676,7 +676,7 @@ export const serializeAws_json1_1GetApplicationRevisionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.GetApplicationRevision", }; let body: any; @@ -689,7 +689,7 @@ export const serializeAws_json1_1GetDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.GetDeployment", }; let body: any; @@ -702,7 +702,7 @@ export const serializeAws_json1_1GetDeploymentConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.GetDeploymentConfig", }; let body: any; @@ -715,7 +715,7 @@ export const serializeAws_json1_1GetDeploymentGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.GetDeploymentGroup", }; let body: any; @@ -728,7 +728,7 @@ export const serializeAws_json1_1GetDeploymentInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.GetDeploymentInstance", }; let body: any; @@ -741,7 +741,7 @@ export const serializeAws_json1_1GetDeploymentTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.GetDeploymentTarget", }; let body: any; @@ -754,7 +754,7 @@ export const serializeAws_json1_1GetOnPremisesInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.GetOnPremisesInstance", }; let body: any; @@ -767,7 +767,7 @@ export const serializeAws_json1_1ListApplicationRevisionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListApplicationRevisions", }; let body: any; @@ -780,7 +780,7 @@ export const serializeAws_json1_1ListApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListApplications", }; let body: any; @@ -793,7 +793,7 @@ export const serializeAws_json1_1ListDeploymentConfigsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListDeploymentConfigs", }; let body: any; @@ -806,7 +806,7 @@ export const serializeAws_json1_1ListDeploymentGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListDeploymentGroups", }; let body: any; @@ -819,7 +819,7 @@ export const serializeAws_json1_1ListDeploymentInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListDeploymentInstances", }; let body: any; @@ -832,7 +832,7 @@ export const serializeAws_json1_1ListDeploymentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListDeployments", }; let body: any; @@ -845,7 +845,7 @@ export const serializeAws_json1_1ListDeploymentTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListDeploymentTargets", }; let body: any; @@ -858,7 +858,7 @@ export const serializeAws_json1_1ListGitHubAccountTokenNamesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListGitHubAccountTokenNames", }; let body: any; @@ -871,7 +871,7 @@ export const serializeAws_json1_1ListOnPremisesInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListOnPremisesInstances", }; let body: any; @@ -884,7 +884,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.ListTagsForResource", }; let body: any; @@ -897,7 +897,7 @@ export const serializeAws_json1_1PutLifecycleEventHookExecutionStatusCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.PutLifecycleEventHookExecutionStatus", }; let body: any; @@ -910,7 +910,7 @@ export const serializeAws_json1_1RegisterApplicationRevisionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.RegisterApplicationRevision", }; let body: any; @@ -923,7 +923,7 @@ export const serializeAws_json1_1RegisterOnPremisesInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.RegisterOnPremisesInstance", }; let body: any; @@ -936,7 +936,7 @@ export const serializeAws_json1_1RemoveTagsFromOnPremisesInstancesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.RemoveTagsFromOnPremisesInstances", }; let body: any; @@ -949,7 +949,7 @@ export const serializeAws_json1_1SkipWaitTimeForInstanceTerminationCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.SkipWaitTimeForInstanceTermination", }; let body: any; @@ -962,7 +962,7 @@ export const serializeAws_json1_1StopDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.StopDeployment", }; let body: any; @@ -975,7 +975,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.TagResource", }; let body: any; @@ -988,7 +988,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.UntagResource", }; let body: any; @@ -1001,7 +1001,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.UpdateApplication", }; let body: any; @@ -1014,7 +1014,7 @@ export const serializeAws_json1_1UpdateDeploymentGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeDeploy_20141006.UpdateDeploymentGroup", }; let body: any; @@ -1046,8 +1046,7 @@ const deserializeAws_json1_1AddTagsToOnPremisesInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InstanceLimitExceededException": case "com.amazonaws.codedeploy#InstanceLimitExceededException": @@ -1149,8 +1148,7 @@ const deserializeAws_json1_1BatchGetApplicationRevisionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -1244,8 +1242,7 @@ const deserializeAws_json1_1BatchGetApplicationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -1323,8 +1320,7 @@ const deserializeAws_json1_1BatchGetDeploymentGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -1426,8 +1422,7 @@ const deserializeAws_json1_1BatchGetDeploymentInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BatchLimitExceededException": case "com.amazonaws.codedeploy#BatchLimitExceededException": @@ -1529,8 +1524,7 @@ const deserializeAws_json1_1BatchGetDeploymentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BatchLimitExceededException": case "com.amazonaws.codedeploy#BatchLimitExceededException": @@ -1600,8 +1594,7 @@ const deserializeAws_json1_1BatchGetDeploymentTargetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentDoesNotExistException": case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": @@ -1719,8 +1712,7 @@ const deserializeAws_json1_1BatchGetOnPremisesInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BatchLimitExceededException": case "com.amazonaws.codedeploy#BatchLimitExceededException": @@ -1787,8 +1779,7 @@ const deserializeAws_json1_1ContinueDeploymentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentAlreadyCompletedException": case "com.amazonaws.codedeploy#DeploymentAlreadyCompletedException": @@ -1898,8 +1889,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationAlreadyExistsException": case "com.amazonaws.codedeploy#ApplicationAlreadyExistsException": @@ -1993,8 +1983,7 @@ const deserializeAws_json1_1CreateDeploymentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -2238,8 +2227,7 @@ const deserializeAws_json1_1CreateDeploymentConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentConfigAlreadyExistsException": case "com.amazonaws.codedeploy#DeploymentConfigAlreadyExistsException": @@ -2341,8 +2329,7 @@ const deserializeAws_json1_1CreateDeploymentGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlarmsLimitExceededException": case "com.amazonaws.codedeploy#AlarmsLimitExceededException": @@ -2652,8 +2639,7 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationNameRequiredException": case "com.amazonaws.codedeploy#ApplicationNameRequiredException": @@ -2720,8 +2706,7 @@ const deserializeAws_json1_1DeleteDeploymentConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentConfigInUseException": case "com.amazonaws.codedeploy#DeploymentConfigInUseException": @@ -2799,8 +2784,7 @@ const deserializeAws_json1_1DeleteDeploymentGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationNameRequiredException": case "com.amazonaws.codedeploy#ApplicationNameRequiredException": @@ -2886,8 +2870,7 @@ const deserializeAws_json1_1DeleteGitHubAccountTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GitHubAccountTokenDoesNotExistException": case "com.amazonaws.codedeploy#GitHubAccountTokenDoesNotExistException": @@ -2973,8 +2956,7 @@ const deserializeAws_json1_1DeleteResourcesByExternalIdCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3017,8 +2999,7 @@ const deserializeAws_json1_1DeregisterOnPremisesInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InstanceNameRequiredException": case "com.amazonaws.codedeploy#InstanceNameRequiredException": @@ -3080,8 +3061,7 @@ const deserializeAws_json1_1GetApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -3151,8 +3131,7 @@ const deserializeAws_json1_1GetApplicationRevisionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -3246,8 +3225,7 @@ const deserializeAws_json1_1GetDeploymentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentDoesNotExistException": case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": @@ -3317,8 +3295,7 @@ const deserializeAws_json1_1GetDeploymentConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentConfigDoesNotExistException": case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": @@ -3396,8 +3373,7 @@ const deserializeAws_json1_1GetDeploymentGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -3499,8 +3475,7 @@ const deserializeAws_json1_1GetDeploymentInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentDoesNotExistException": case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": @@ -3602,8 +3577,7 @@ const deserializeAws_json1_1GetDeploymentTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentDoesNotExistException": case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": @@ -3713,8 +3687,7 @@ const deserializeAws_json1_1GetOnPremisesInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InstanceNameRequiredException": case "com.amazonaws.codedeploy#InstanceNameRequiredException": @@ -3784,8 +3757,7 @@ const deserializeAws_json1_1ListApplicationRevisionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -3911,8 +3883,7 @@ const deserializeAws_json1_1ListApplicationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codedeploy#InvalidNextTokenException": @@ -3966,8 +3937,7 @@ const deserializeAws_json1_1ListDeploymentConfigsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codedeploy#InvalidNextTokenException": @@ -4021,8 +3991,7 @@ const deserializeAws_json1_1ListDeploymentGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -4100,8 +4069,7 @@ const deserializeAws_json1_1ListDeploymentInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentDoesNotExistException": case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": @@ -4227,8 +4195,7 @@ const deserializeAws_json1_1ListDeploymentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -4362,8 +4329,7 @@ const deserializeAws_json1_1ListDeploymentTargetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentDoesNotExistException": case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": @@ -4473,8 +4439,7 @@ const deserializeAws_json1_1ListGitHubAccountTokenNamesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codedeploy#InvalidNextTokenException": @@ -4544,8 +4509,7 @@ const deserializeAws_json1_1ListOnPremisesInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codedeploy#InvalidNextTokenException": @@ -4615,8 +4579,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArnNotSupportedException": case "com.amazonaws.codedeploy#ArnNotSupportedException": @@ -4686,8 +4649,7 @@ const deserializeAws_json1_1PutLifecycleEventHookExecutionStatusCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentDoesNotExistException": case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": @@ -4789,8 +4751,7 @@ const deserializeAws_json1_1RegisterApplicationRevisionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -4881,8 +4842,7 @@ const deserializeAws_json1_1RegisterOnPremisesInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IamArnRequiredException": case "com.amazonaws.codedeploy#IamArnRequiredException": @@ -5005,8 +4965,7 @@ const deserializeAws_json1_1RemoveTagsFromOnPremisesInstancesCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InstanceLimitExceededException": case "com.amazonaws.codedeploy#InstanceLimitExceededException": @@ -5105,8 +5064,7 @@ const deserializeAws_json1_1SkipWaitTimeForInstanceTerminationCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentAlreadyCompletedException": case "com.amazonaws.codedeploy#DeploymentAlreadyCompletedException": @@ -5200,8 +5158,7 @@ const deserializeAws_json1_1StopDeploymentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeploymentAlreadyCompletedException": case "com.amazonaws.codedeploy#DeploymentAlreadyCompletedException": @@ -5295,8 +5252,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -5406,8 +5362,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationDoesNotExistException": case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": @@ -5514,8 +5469,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ApplicationAlreadyExistsException": case "com.amazonaws.codedeploy#ApplicationAlreadyExistsException": @@ -5593,8 +5547,7 @@ const deserializeAws_json1_1UpdateDeploymentGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlarmsLimitExceededException": case "com.amazonaws.codedeploy#AlarmsLimitExceededException": @@ -7504,39 +7457,56 @@ const serializeAws_json1_1AddTagsToOnPremisesInstancesInput = ( context: __SerdeContext ): any => { return { - ...(input.instanceNames !== undefined && { - instanceNames: serializeAws_json1_1InstanceNameList(input.instanceNames, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.instanceNames !== undefined && + input.instanceNames !== null && { + instanceNames: serializeAws_json1_1InstanceNameList(input.instanceNames, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1Alarm = (input: Alarm, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1AlarmConfiguration = (input: AlarmConfiguration, context: __SerdeContext): any => { return { - ...(input.alarms !== undefined && { alarms: serializeAws_json1_1AlarmList(input.alarms, context) }), - ...(input.enabled !== undefined && { enabled: input.enabled }), - ...(input.ignorePollAlarmFailure !== undefined && { ignorePollAlarmFailure: input.ignorePollAlarmFailure }), + ...(input.alarms !== undefined && + input.alarms !== null && { alarms: serializeAws_json1_1AlarmList(input.alarms, context) }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), + ...(input.ignorePollAlarmFailure !== undefined && + input.ignorePollAlarmFailure !== null && { ignorePollAlarmFailure: input.ignorePollAlarmFailure }), }; }; const serializeAws_json1_1AlarmList = (input: Alarm[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Alarm(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Alarm(entry, context); + }); }; const serializeAws_json1_1ApplicationsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AppSpecContent = (input: AppSpecContent, context: __SerdeContext): any => { return { - ...(input.content !== undefined && { content: input.content }), - ...(input.sha256 !== undefined && { sha256: input.sha256 }), + ...(input.content !== undefined && input.content !== null && { content: input.content }), + ...(input.sha256 !== undefined && input.sha256 !== null && { sha256: input.sha256 }), }; }; @@ -7545,8 +7515,9 @@ const serializeAws_json1_1AutoRollbackConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.enabled !== undefined && { enabled: input.enabled }), - ...(input.events !== undefined && { events: serializeAws_json1_1AutoRollbackEventsList(input.events, context) }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), + ...(input.events !== undefined && + input.events !== null && { events: serializeAws_json1_1AutoRollbackEventsList(input.events, context) }), }; }; @@ -7554,11 +7525,25 @@ const serializeAws_json1_1AutoRollbackEventsList = ( input: (AutoRollbackEvent | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AutoScalingGroupNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchGetApplicationRevisionsInput = ( @@ -7566,10 +7551,10 @@ const serializeAws_json1_1BatchGetApplicationRevisionsInput = ( context: __SerdeContext ): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.revisions !== undefined && { - revisions: serializeAws_json1_1RevisionLocationList(input.revisions, context), - }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.revisions !== undefined && + input.revisions !== null && { revisions: serializeAws_json1_1RevisionLocationList(input.revisions, context) }), }; }; @@ -7578,9 +7563,10 @@ const serializeAws_json1_1BatchGetApplicationsInput = ( context: __SerdeContext ): any => { return { - ...(input.applicationNames !== undefined && { - applicationNames: serializeAws_json1_1ApplicationsList(input.applicationNames, context), - }), + ...(input.applicationNames !== undefined && + input.applicationNames !== null && { + applicationNames: serializeAws_json1_1ApplicationsList(input.applicationNames, context), + }), }; }; @@ -7589,10 +7575,12 @@ const serializeAws_json1_1BatchGetDeploymentGroupsInput = ( context: __SerdeContext ): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.deploymentGroupNames !== undefined && { - deploymentGroupNames: serializeAws_json1_1DeploymentGroupsList(input.deploymentGroupNames, context), - }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.deploymentGroupNames !== undefined && + input.deploymentGroupNames !== null && { + deploymentGroupNames: serializeAws_json1_1DeploymentGroupsList(input.deploymentGroupNames, context), + }), }; }; @@ -7601,10 +7589,9 @@ const serializeAws_json1_1BatchGetDeploymentInstancesInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.instanceIds !== undefined && { - instanceIds: serializeAws_json1_1InstancesList(input.instanceIds, context), - }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.instanceIds !== undefined && + input.instanceIds !== null && { instanceIds: serializeAws_json1_1InstancesList(input.instanceIds, context) }), }; }; @@ -7613,9 +7600,10 @@ const serializeAws_json1_1BatchGetDeploymentsInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentIds !== undefined && { - deploymentIds: serializeAws_json1_1DeploymentsList(input.deploymentIds, context), - }), + ...(input.deploymentIds !== undefined && + input.deploymentIds !== null && { + deploymentIds: serializeAws_json1_1DeploymentsList(input.deploymentIds, context), + }), }; }; @@ -7624,8 +7612,9 @@ const serializeAws_json1_1BatchGetDeploymentTargetsInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.targetIds !== undefined && { targetIds: serializeAws_json1_1TargetIdList(input.targetIds, context) }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.targetIds !== undefined && + input.targetIds !== null && { targetIds: serializeAws_json1_1TargetIdList(input.targetIds, context) }), }; }; @@ -7634,9 +7623,10 @@ const serializeAws_json1_1BatchGetOnPremisesInstancesInput = ( context: __SerdeContext ): any => { return { - ...(input.instanceNames !== undefined && { - instanceNames: serializeAws_json1_1InstanceNameList(input.instanceNames, context), - }), + ...(input.instanceNames !== undefined && + input.instanceNames !== null && { + instanceNames: serializeAws_json1_1InstanceNameList(input.instanceNames, context), + }), }; }; @@ -7645,21 +7635,24 @@ const serializeAws_json1_1BlueGreenDeploymentConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.deploymentReadyOption !== undefined && { - deploymentReadyOption: serializeAws_json1_1DeploymentReadyOption(input.deploymentReadyOption, context), - }), - ...(input.greenFleetProvisioningOption !== undefined && { - greenFleetProvisioningOption: serializeAws_json1_1GreenFleetProvisioningOption( - input.greenFleetProvisioningOption, - context - ), - }), - ...(input.terminateBlueInstancesOnDeploymentSuccess !== undefined && { - terminateBlueInstancesOnDeploymentSuccess: serializeAws_json1_1BlueInstanceTerminationOption( - input.terminateBlueInstancesOnDeploymentSuccess, - context - ), - }), + ...(input.deploymentReadyOption !== undefined && + input.deploymentReadyOption !== null && { + deploymentReadyOption: serializeAws_json1_1DeploymentReadyOption(input.deploymentReadyOption, context), + }), + ...(input.greenFleetProvisioningOption !== undefined && + input.greenFleetProvisioningOption !== null && { + greenFleetProvisioningOption: serializeAws_json1_1GreenFleetProvisioningOption( + input.greenFleetProvisioningOption, + context + ), + }), + ...(input.terminateBlueInstancesOnDeploymentSuccess !== undefined && + input.terminateBlueInstancesOnDeploymentSuccess !== null && { + terminateBlueInstancesOnDeploymentSuccess: serializeAws_json1_1BlueInstanceTerminationOption( + input.terminateBlueInstancesOnDeploymentSuccess, + context + ), + }), }; }; @@ -7668,25 +7661,29 @@ const serializeAws_json1_1BlueInstanceTerminationOption = ( context: __SerdeContext ): any => { return { - ...(input.action !== undefined && { action: input.action }), - ...(input.terminationWaitTimeInMinutes !== undefined && { - terminationWaitTimeInMinutes: input.terminationWaitTimeInMinutes, - }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), + ...(input.terminationWaitTimeInMinutes !== undefined && + input.terminationWaitTimeInMinutes !== null && { + terminationWaitTimeInMinutes: input.terminationWaitTimeInMinutes, + }), }; }; const serializeAws_json1_1ContinueDeploymentInput = (input: ContinueDeploymentInput, context: __SerdeContext): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.deploymentWaitType !== undefined && { deploymentWaitType: input.deploymentWaitType }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.deploymentWaitType !== undefined && + input.deploymentWaitType !== null && { deploymentWaitType: input.deploymentWaitType }), }; }; const serializeAws_json1_1CreateApplicationInput = (input: CreateApplicationInput, context: __SerdeContext): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.computePlatform !== undefined && { computePlatform: input.computePlatform }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.computePlatform !== undefined && + input.computePlatform !== null && { computePlatform: input.computePlatform }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -7695,14 +7692,18 @@ const serializeAws_json1_1CreateDeploymentConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.computePlatform !== undefined && { computePlatform: input.computePlatform }), - ...(input.deploymentConfigName !== undefined && { deploymentConfigName: input.deploymentConfigName }), - ...(input.minimumHealthyHosts !== undefined && { - minimumHealthyHosts: serializeAws_json1_1MinimumHealthyHosts(input.minimumHealthyHosts, context), - }), - ...(input.trafficRoutingConfig !== undefined && { - trafficRoutingConfig: serializeAws_json1_1TrafficRoutingConfig(input.trafficRoutingConfig, context), - }), + ...(input.computePlatform !== undefined && + input.computePlatform !== null && { computePlatform: input.computePlatform }), + ...(input.deploymentConfigName !== undefined && + input.deploymentConfigName !== null && { deploymentConfigName: input.deploymentConfigName }), + ...(input.minimumHealthyHosts !== undefined && + input.minimumHealthyHosts !== null && { + minimumHealthyHosts: serializeAws_json1_1MinimumHealthyHosts(input.minimumHealthyHosts, context), + }), + ...(input.trafficRoutingConfig !== undefined && + input.trafficRoutingConfig !== null && { + trafficRoutingConfig: serializeAws_json1_1TrafficRoutingConfig(input.trafficRoutingConfig, context), + }), }; }; @@ -7711,83 +7712,105 @@ const serializeAws_json1_1CreateDeploymentGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.alarmConfiguration !== undefined && { - alarmConfiguration: serializeAws_json1_1AlarmConfiguration(input.alarmConfiguration, context), - }), - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.autoRollbackConfiguration !== undefined && { - autoRollbackConfiguration: serializeAws_json1_1AutoRollbackConfiguration( - input.autoRollbackConfiguration, - context - ), - }), - ...(input.autoScalingGroups !== undefined && { - autoScalingGroups: serializeAws_json1_1AutoScalingGroupNameList(input.autoScalingGroups, context), - }), - ...(input.blueGreenDeploymentConfiguration !== undefined && { - blueGreenDeploymentConfiguration: serializeAws_json1_1BlueGreenDeploymentConfiguration( - input.blueGreenDeploymentConfiguration, - context - ), - }), - ...(input.deploymentConfigName !== undefined && { deploymentConfigName: input.deploymentConfigName }), - ...(input.deploymentGroupName !== undefined && { deploymentGroupName: input.deploymentGroupName }), - ...(input.deploymentStyle !== undefined && { - deploymentStyle: serializeAws_json1_1DeploymentStyle(input.deploymentStyle, context), - }), - ...(input.ec2TagFilters !== undefined && { - ec2TagFilters: serializeAws_json1_1EC2TagFilterList(input.ec2TagFilters, context), - }), - ...(input.ec2TagSet !== undefined && { ec2TagSet: serializeAws_json1_1EC2TagSet(input.ec2TagSet, context) }), - ...(input.ecsServices !== undefined && { - ecsServices: serializeAws_json1_1ECSServiceList(input.ecsServices, context), - }), - ...(input.loadBalancerInfo !== undefined && { - loadBalancerInfo: serializeAws_json1_1LoadBalancerInfo(input.loadBalancerInfo, context), - }), - ...(input.onPremisesInstanceTagFilters !== undefined && { - onPremisesInstanceTagFilters: serializeAws_json1_1TagFilterList(input.onPremisesInstanceTagFilters, context), - }), - ...(input.onPremisesTagSet !== undefined && { - onPremisesTagSet: serializeAws_json1_1OnPremisesTagSet(input.onPremisesTagSet, context), - }), - ...(input.serviceRoleArn !== undefined && { serviceRoleArn: input.serviceRoleArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.triggerConfigurations !== undefined && { - triggerConfigurations: serializeAws_json1_1TriggerConfigList(input.triggerConfigurations, context), - }), + ...(input.alarmConfiguration !== undefined && + input.alarmConfiguration !== null && { + alarmConfiguration: serializeAws_json1_1AlarmConfiguration(input.alarmConfiguration, context), + }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.autoRollbackConfiguration !== undefined && + input.autoRollbackConfiguration !== null && { + autoRollbackConfiguration: serializeAws_json1_1AutoRollbackConfiguration( + input.autoRollbackConfiguration, + context + ), + }), + ...(input.autoScalingGroups !== undefined && + input.autoScalingGroups !== null && { + autoScalingGroups: serializeAws_json1_1AutoScalingGroupNameList(input.autoScalingGroups, context), + }), + ...(input.blueGreenDeploymentConfiguration !== undefined && + input.blueGreenDeploymentConfiguration !== null && { + blueGreenDeploymentConfiguration: serializeAws_json1_1BlueGreenDeploymentConfiguration( + input.blueGreenDeploymentConfiguration, + context + ), + }), + ...(input.deploymentConfigName !== undefined && + input.deploymentConfigName !== null && { deploymentConfigName: input.deploymentConfigName }), + ...(input.deploymentGroupName !== undefined && + input.deploymentGroupName !== null && { deploymentGroupName: input.deploymentGroupName }), + ...(input.deploymentStyle !== undefined && + input.deploymentStyle !== null && { + deploymentStyle: serializeAws_json1_1DeploymentStyle(input.deploymentStyle, context), + }), + ...(input.ec2TagFilters !== undefined && + input.ec2TagFilters !== null && { + ec2TagFilters: serializeAws_json1_1EC2TagFilterList(input.ec2TagFilters, context), + }), + ...(input.ec2TagSet !== undefined && + input.ec2TagSet !== null && { ec2TagSet: serializeAws_json1_1EC2TagSet(input.ec2TagSet, context) }), + ...(input.ecsServices !== undefined && + input.ecsServices !== null && { ecsServices: serializeAws_json1_1ECSServiceList(input.ecsServices, context) }), + ...(input.loadBalancerInfo !== undefined && + input.loadBalancerInfo !== null && { + loadBalancerInfo: serializeAws_json1_1LoadBalancerInfo(input.loadBalancerInfo, context), + }), + ...(input.onPremisesInstanceTagFilters !== undefined && + input.onPremisesInstanceTagFilters !== null && { + onPremisesInstanceTagFilters: serializeAws_json1_1TagFilterList(input.onPremisesInstanceTagFilters, context), + }), + ...(input.onPremisesTagSet !== undefined && + input.onPremisesTagSet !== null && { + onPremisesTagSet: serializeAws_json1_1OnPremisesTagSet(input.onPremisesTagSet, context), + }), + ...(input.serviceRoleArn !== undefined && + input.serviceRoleArn !== null && { serviceRoleArn: input.serviceRoleArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.triggerConfigurations !== undefined && + input.triggerConfigurations !== null && { + triggerConfigurations: serializeAws_json1_1TriggerConfigList(input.triggerConfigurations, context), + }), }; }; const serializeAws_json1_1CreateDeploymentInput = (input: CreateDeploymentInput, context: __SerdeContext): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.autoRollbackConfiguration !== undefined && { - autoRollbackConfiguration: serializeAws_json1_1AutoRollbackConfiguration( - input.autoRollbackConfiguration, - context - ), - }), - ...(input.deploymentConfigName !== undefined && { deploymentConfigName: input.deploymentConfigName }), - ...(input.deploymentGroupName !== undefined && { deploymentGroupName: input.deploymentGroupName }), - ...(input.description !== undefined && { description: input.description }), - ...(input.fileExistsBehavior !== undefined && { fileExistsBehavior: input.fileExistsBehavior }), - ...(input.ignoreApplicationStopFailures !== undefined && { - ignoreApplicationStopFailures: input.ignoreApplicationStopFailures, - }), - ...(input.revision !== undefined && { revision: serializeAws_json1_1RevisionLocation(input.revision, context) }), - ...(input.targetInstances !== undefined && { - targetInstances: serializeAws_json1_1TargetInstances(input.targetInstances, context), - }), - ...(input.updateOutdatedInstancesOnly !== undefined && { - updateOutdatedInstancesOnly: input.updateOutdatedInstancesOnly, - }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.autoRollbackConfiguration !== undefined && + input.autoRollbackConfiguration !== null && { + autoRollbackConfiguration: serializeAws_json1_1AutoRollbackConfiguration( + input.autoRollbackConfiguration, + context + ), + }), + ...(input.deploymentConfigName !== undefined && + input.deploymentConfigName !== null && { deploymentConfigName: input.deploymentConfigName }), + ...(input.deploymentGroupName !== undefined && + input.deploymentGroupName !== null && { deploymentGroupName: input.deploymentGroupName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.fileExistsBehavior !== undefined && + input.fileExistsBehavior !== null && { fileExistsBehavior: input.fileExistsBehavior }), + ...(input.ignoreApplicationStopFailures !== undefined && + input.ignoreApplicationStopFailures !== null && { + ignoreApplicationStopFailures: input.ignoreApplicationStopFailures, + }), + ...(input.revision !== undefined && + input.revision !== null && { revision: serializeAws_json1_1RevisionLocation(input.revision, context) }), + ...(input.targetInstances !== undefined && + input.targetInstances !== null && { + targetInstances: serializeAws_json1_1TargetInstances(input.targetInstances, context), + }), + ...(input.updateOutdatedInstancesOnly !== undefined && + input.updateOutdatedInstancesOnly !== null && { updateOutdatedInstancesOnly: input.updateOutdatedInstancesOnly }), }; }; const serializeAws_json1_1DeleteApplicationInput = (input: DeleteApplicationInput, context: __SerdeContext): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), }; }; @@ -7796,7 +7819,8 @@ const serializeAws_json1_1DeleteDeploymentConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentConfigName !== undefined && { deploymentConfigName: input.deploymentConfigName }), + ...(input.deploymentConfigName !== undefined && + input.deploymentConfigName !== null && { deploymentConfigName: input.deploymentConfigName }), }; }; @@ -7805,8 +7829,10 @@ const serializeAws_json1_1DeleteDeploymentGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.deploymentGroupName !== undefined && { deploymentGroupName: input.deploymentGroupName }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.deploymentGroupName !== undefined && + input.deploymentGroupName !== null && { deploymentGroupName: input.deploymentGroupName }), }; }; @@ -7815,7 +7841,7 @@ const serializeAws_json1_1DeleteGitHubAccountTokenInput = ( context: __SerdeContext ): any => { return { - ...(input.tokenName !== undefined && { tokenName: input.tokenName }), + ...(input.tokenName !== undefined && input.tokenName !== null && { tokenName: input.tokenName }), }; }; @@ -7824,36 +7850,61 @@ const serializeAws_json1_1DeleteResourcesByExternalIdInput = ( context: __SerdeContext ): any => { return { - ...(input.externalId !== undefined && { externalId: input.externalId }), + ...(input.externalId !== undefined && input.externalId !== null && { externalId: input.externalId }), }; }; const serializeAws_json1_1DeploymentGroupsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeploymentReadyOption = (input: DeploymentReadyOption, context: __SerdeContext): any => { return { - ...(input.actionOnTimeout !== undefined && { actionOnTimeout: input.actionOnTimeout }), - ...(input.waitTimeInMinutes !== undefined && { waitTimeInMinutes: input.waitTimeInMinutes }), + ...(input.actionOnTimeout !== undefined && + input.actionOnTimeout !== null && { actionOnTimeout: input.actionOnTimeout }), + ...(input.waitTimeInMinutes !== undefined && + input.waitTimeInMinutes !== null && { waitTimeInMinutes: input.waitTimeInMinutes }), }; }; const serializeAws_json1_1DeploymentsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeploymentStatusList = ( input: (DeploymentStatus | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeploymentStyle = (input: DeploymentStyle, context: __SerdeContext): any => { return { - ...(input.deploymentOption !== undefined && { deploymentOption: input.deploymentOption }), - ...(input.deploymentType !== undefined && { deploymentType: input.deploymentType }), + ...(input.deploymentOption !== undefined && + input.deploymentOption !== null && { deploymentOption: input.deploymentOption }), + ...(input.deploymentType !== undefined && + input.deploymentType !== null && { deploymentType: input.deploymentType }), }; }; @@ -7862,62 +7913,99 @@ const serializeAws_json1_1DeregisterOnPremisesInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; const serializeAws_json1_1EC2TagFilter = (input: EC2TagFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1EC2TagFilterList = (input: EC2TagFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EC2TagFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EC2TagFilter(entry, context); + }); }; const serializeAws_json1_1EC2TagSet = (input: EC2TagSet, context: __SerdeContext): any => { return { - ...(input.ec2TagSetList !== undefined && { - ec2TagSetList: serializeAws_json1_1EC2TagSetList(input.ec2TagSetList, context), - }), + ...(input.ec2TagSetList !== undefined && + input.ec2TagSetList !== null && { + ec2TagSetList: serializeAws_json1_1EC2TagSetList(input.ec2TagSetList, context), + }), }; }; const serializeAws_json1_1EC2TagSetList = (input: EC2TagFilter[][], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EC2TagFilterList(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EC2TagFilterList(entry, context); + }); }; const serializeAws_json1_1ECSService = (input: ECSService, context: __SerdeContext): any => { return { - ...(input.clusterName !== undefined && { clusterName: input.clusterName }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.clusterName !== undefined && input.clusterName !== null && { clusterName: input.clusterName }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; const serializeAws_json1_1ECSServiceList = (input: ECSService[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ECSService(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ECSService(entry, context); + }); }; const serializeAws_json1_1ELBInfo = (input: ELBInfo, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1ELBInfoList = (input: ELBInfo[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ELBInfo(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ELBInfo(entry, context); + }); }; const serializeAws_json1_1FilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetApplicationInput = (input: GetApplicationInput, context: __SerdeContext): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), }; }; @@ -7926,8 +8014,10 @@ const serializeAws_json1_1GetApplicationRevisionInput = ( context: __SerdeContext ): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.revision !== undefined && { revision: serializeAws_json1_1RevisionLocation(input.revision, context) }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.revision !== undefined && + input.revision !== null && { revision: serializeAws_json1_1RevisionLocation(input.revision, context) }), }; }; @@ -7936,20 +8026,23 @@ const serializeAws_json1_1GetDeploymentConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentConfigName !== undefined && { deploymentConfigName: input.deploymentConfigName }), + ...(input.deploymentConfigName !== undefined && + input.deploymentConfigName !== null && { deploymentConfigName: input.deploymentConfigName }), }; }; const serializeAws_json1_1GetDeploymentGroupInput = (input: GetDeploymentGroupInput, context: __SerdeContext): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.deploymentGroupName !== undefined && { deploymentGroupName: input.deploymentGroupName }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.deploymentGroupName !== undefined && + input.deploymentGroupName !== null && { deploymentGroupName: input.deploymentGroupName }), }; }; const serializeAws_json1_1GetDeploymentInput = (input: GetDeploymentInput, context: __SerdeContext): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), }; }; @@ -7958,8 +8051,8 @@ const serializeAws_json1_1GetDeploymentInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.instanceId !== undefined && { instanceId: input.instanceId }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.instanceId !== undefined && input.instanceId !== null && { instanceId: input.instanceId }), }; }; @@ -7968,8 +8061,8 @@ const serializeAws_json1_1GetDeploymentTargetInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.targetId !== undefined && { targetId: input.targetId }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.targetId !== undefined && input.targetId !== null && { targetId: input.targetId }), }; }; @@ -7978,14 +8071,14 @@ const serializeAws_json1_1GetOnPremisesInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; const serializeAws_json1_1GitHubLocation = (input: GitHubLocation, context: __SerdeContext): any => { return { - ...(input.commitId !== undefined && { commitId: input.commitId }), - ...(input.repository !== undefined && { repository: input.repository }), + ...(input.commitId !== undefined && input.commitId !== null && { commitId: input.commitId }), + ...(input.repository !== undefined && input.repository !== null && { repository: input.repository }), }; }; @@ -7994,24 +8087,52 @@ const serializeAws_json1_1GreenFleetProvisioningOption = ( context: __SerdeContext ): any => { return { - ...(input.action !== undefined && { action: input.action }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), }; }; const serializeAws_json1_1InstanceNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InstancesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InstanceStatusList = (input: (InstanceStatus | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InstanceTypeList = (input: (_InstanceType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListApplicationRevisionsInput = ( @@ -8019,19 +8140,20 @@ const serializeAws_json1_1ListApplicationRevisionsInput = ( context: __SerdeContext ): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.deployed !== undefined && { deployed: input.deployed }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.s3Bucket !== undefined && { s3Bucket: input.s3Bucket }), - ...(input.s3KeyPrefix !== undefined && { s3KeyPrefix: input.s3KeyPrefix }), - ...(input.sortBy !== undefined && { sortBy: input.sortBy }), - ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.deployed !== undefined && input.deployed !== null && { deployed: input.deployed }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.s3Bucket !== undefined && input.s3Bucket !== null && { s3Bucket: input.s3Bucket }), + ...(input.s3KeyPrefix !== undefined && input.s3KeyPrefix !== null && { s3KeyPrefix: input.s3KeyPrefix }), + ...(input.sortBy !== undefined && input.sortBy !== null && { sortBy: input.sortBy }), + ...(input.sortOrder !== undefined && input.sortOrder !== null && { sortOrder: input.sortOrder }), }; }; const serializeAws_json1_1ListApplicationsInput = (input: ListApplicationsInput, context: __SerdeContext): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8040,7 +8162,7 @@ const serializeAws_json1_1ListDeploymentConfigsInput = ( context: __SerdeContext ): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8049,8 +8171,9 @@ const serializeAws_json1_1ListDeploymentGroupsInput = ( context: __SerdeContext ): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8059,29 +8182,35 @@ const serializeAws_json1_1ListDeploymentInstancesInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.instanceStatusFilter !== undefined && { - instanceStatusFilter: serializeAws_json1_1InstanceStatusList(input.instanceStatusFilter, context), - }), - ...(input.instanceTypeFilter !== undefined && { - instanceTypeFilter: serializeAws_json1_1InstanceTypeList(input.instanceTypeFilter, context), - }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.instanceStatusFilter !== undefined && + input.instanceStatusFilter !== null && { + instanceStatusFilter: serializeAws_json1_1InstanceStatusList(input.instanceStatusFilter, context), + }), + ...(input.instanceTypeFilter !== undefined && + input.instanceTypeFilter !== null && { + instanceTypeFilter: serializeAws_json1_1InstanceTypeList(input.instanceTypeFilter, context), + }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListDeploymentsInput = (input: ListDeploymentsInput, context: __SerdeContext): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.createTimeRange !== undefined && { - createTimeRange: serializeAws_json1_1TimeRange(input.createTimeRange, context), - }), - ...(input.deploymentGroupName !== undefined && { deploymentGroupName: input.deploymentGroupName }), - ...(input.externalId !== undefined && { externalId: input.externalId }), - ...(input.includeOnlyStatuses !== undefined && { - includeOnlyStatuses: serializeAws_json1_1DeploymentStatusList(input.includeOnlyStatuses, context), - }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.createTimeRange !== undefined && + input.createTimeRange !== null && { + createTimeRange: serializeAws_json1_1TimeRange(input.createTimeRange, context), + }), + ...(input.deploymentGroupName !== undefined && + input.deploymentGroupName !== null && { deploymentGroupName: input.deploymentGroupName }), + ...(input.externalId !== undefined && input.externalId !== null && { externalId: input.externalId }), + ...(input.includeOnlyStatuses !== undefined && + input.includeOnlyStatuses !== null && { + includeOnlyStatuses: serializeAws_json1_1DeploymentStatusList(input.includeOnlyStatuses, context), + }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8090,16 +8219,24 @@ const serializeAws_json1_1ListDeploymentTargetsInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.targetFilters !== undefined && { - targetFilters: serializeAws_json1_1TargetFilters(input.targetFilters, context), - }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.targetFilters !== undefined && + input.targetFilters !== null && { + targetFilters: serializeAws_json1_1TargetFilters(input.targetFilters, context), + }), }; }; const serializeAws_json1_1ListenerArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListGitHubAccountTokenNamesInput = ( @@ -8107,7 +8244,7 @@ const serializeAws_json1_1ListGitHubAccountTokenNamesInput = ( context: __SerdeContext ): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8116,9 +8253,11 @@ const serializeAws_json1_1ListOnPremisesInstancesInput = ( context: __SerdeContext ): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.registrationStatus !== undefined && { registrationStatus: input.registrationStatus }), - ...(input.tagFilters !== undefined && { tagFilters: serializeAws_json1_1TagFilterList(input.tagFilters, context) }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.registrationStatus !== undefined && + input.registrationStatus !== null && { registrationStatus: input.registrationStatus }), + ...(input.tagFilters !== undefined && + input.tagFilters !== null && { tagFilters: serializeAws_json1_1TagFilterList(input.tagFilters, context) }), }; }; @@ -8127,42 +8266,51 @@ const serializeAws_json1_1ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1LoadBalancerInfo = (input: LoadBalancerInfo, context: __SerdeContext): any => { return { - ...(input.elbInfoList !== undefined && { - elbInfoList: serializeAws_json1_1ELBInfoList(input.elbInfoList, context), - }), - ...(input.targetGroupInfoList !== undefined && { - targetGroupInfoList: serializeAws_json1_1TargetGroupInfoList(input.targetGroupInfoList, context), - }), - ...(input.targetGroupPairInfoList !== undefined && { - targetGroupPairInfoList: serializeAws_json1_1TargetGroupPairInfoList(input.targetGroupPairInfoList, context), - }), + ...(input.elbInfoList !== undefined && + input.elbInfoList !== null && { elbInfoList: serializeAws_json1_1ELBInfoList(input.elbInfoList, context) }), + ...(input.targetGroupInfoList !== undefined && + input.targetGroupInfoList !== null && { + targetGroupInfoList: serializeAws_json1_1TargetGroupInfoList(input.targetGroupInfoList, context), + }), + ...(input.targetGroupPairInfoList !== undefined && + input.targetGroupPairInfoList !== null && { + targetGroupPairInfoList: serializeAws_json1_1TargetGroupPairInfoList(input.targetGroupPairInfoList, context), + }), }; }; const serializeAws_json1_1MinimumHealthyHosts = (input: MinimumHealthyHosts, context: __SerdeContext): any => { return { - ...(input.type !== undefined && { type: input.type }), - ...(input.value !== undefined && { value: input.value }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1OnPremisesTagSet = (input: OnPremisesTagSet, context: __SerdeContext): any => { return { - ...(input.onPremisesTagSetList !== undefined && { - onPremisesTagSetList: serializeAws_json1_1OnPremisesTagSetList(input.onPremisesTagSetList, context), - }), + ...(input.onPremisesTagSetList !== undefined && + input.onPremisesTagSetList !== null && { + onPremisesTagSetList: serializeAws_json1_1OnPremisesTagSetList(input.onPremisesTagSetList, context), + }), }; }; const serializeAws_json1_1OnPremisesTagSetList = (input: TagFilter[][], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TagFilterList(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TagFilterList(entry, context); + }); }; const serializeAws_json1_1PutLifecycleEventHookExecutionStatusInput = ( @@ -8170,18 +8318,19 @@ const serializeAws_json1_1PutLifecycleEventHookExecutionStatusInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), - ...(input.lifecycleEventHookExecutionId !== undefined && { - lifecycleEventHookExecutionId: input.lifecycleEventHookExecutionId, - }), - ...(input.status !== undefined && { status: input.status }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), + ...(input.lifecycleEventHookExecutionId !== undefined && + input.lifecycleEventHookExecutionId !== null && { + lifecycleEventHookExecutionId: input.lifecycleEventHookExecutionId, + }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1RawString = (input: RawString, context: __SerdeContext): any => { return { - ...(input.content !== undefined && { content: input.content }), - ...(input.sha256 !== undefined && { sha256: input.sha256 }), + ...(input.content !== undefined && input.content !== null && { content: input.content }), + ...(input.sha256 !== undefined && input.sha256 !== null && { sha256: input.sha256 }), }; }; @@ -8190,9 +8339,11 @@ const serializeAws_json1_1RegisterApplicationRevisionInput = ( context: __SerdeContext ): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.description !== undefined && { description: input.description }), - ...(input.revision !== undefined && { revision: serializeAws_json1_1RevisionLocation(input.revision, context) }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.revision !== undefined && + input.revision !== null && { revision: serializeAws_json1_1RevisionLocation(input.revision, context) }), }; }; @@ -8201,9 +8352,9 @@ const serializeAws_json1_1RegisterOnPremisesInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.iamSessionArn !== undefined && { iamSessionArn: input.iamSessionArn }), - ...(input.iamUserArn !== undefined && { iamUserArn: input.iamUserArn }), - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.iamSessionArn !== undefined && input.iamSessionArn !== null && { iamSessionArn: input.iamSessionArn }), + ...(input.iamUserArn !== undefined && input.iamUserArn !== null && { iamUserArn: input.iamUserArn }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; @@ -8212,38 +8363,50 @@ const serializeAws_json1_1RemoveTagsFromOnPremisesInstancesInput = ( context: __SerdeContext ): any => { return { - ...(input.instanceNames !== undefined && { - instanceNames: serializeAws_json1_1InstanceNameList(input.instanceNames, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.instanceNames !== undefined && + input.instanceNames !== null && { + instanceNames: serializeAws_json1_1InstanceNameList(input.instanceNames, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1RevisionLocation = (input: RevisionLocation, context: __SerdeContext): any => { return { - ...(input.appSpecContent !== undefined && { - appSpecContent: serializeAws_json1_1AppSpecContent(input.appSpecContent, context), - }), - ...(input.gitHubLocation !== undefined && { - gitHubLocation: serializeAws_json1_1GitHubLocation(input.gitHubLocation, context), - }), - ...(input.revisionType !== undefined && { revisionType: input.revisionType }), - ...(input.s3Location !== undefined && { s3Location: serializeAws_json1_1S3Location(input.s3Location, context) }), - ...(input.string !== undefined && { string: serializeAws_json1_1RawString(input.string, context) }), + ...(input.appSpecContent !== undefined && + input.appSpecContent !== null && { + appSpecContent: serializeAws_json1_1AppSpecContent(input.appSpecContent, context), + }), + ...(input.gitHubLocation !== undefined && + input.gitHubLocation !== null && { + gitHubLocation: serializeAws_json1_1GitHubLocation(input.gitHubLocation, context), + }), + ...(input.revisionType !== undefined && input.revisionType !== null && { revisionType: input.revisionType }), + ...(input.s3Location !== undefined && + input.s3Location !== null && { s3Location: serializeAws_json1_1S3Location(input.s3Location, context) }), + ...(input.string !== undefined && + input.string !== null && { string: serializeAws_json1_1RawString(input.string, context) }), }; }; const serializeAws_json1_1RevisionLocationList = (input: RevisionLocation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RevisionLocation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RevisionLocation(entry, context); + }); }; const serializeAws_json1_1S3Location = (input: S3Location, context: __SerdeContext): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.bundleType !== undefined && { bundleType: input.bundleType }), - ...(input.eTag !== undefined && { eTag: input.eTag }), - ...(input.key !== undefined && { key: input.key }), - ...(input.version !== undefined && { version: input.version }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.bundleType !== undefined && input.bundleType !== null && { bundleType: input.bundleType }), + ...(input.eTag !== undefined && input.eTag !== null && { eTag: input.eTag }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; @@ -8252,178 +8415,256 @@ const serializeAws_json1_1SkipWaitTimeForInstanceTerminationInput = ( context: __SerdeContext ): any => { return { - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), }; }; const serializeAws_json1_1StopDeploymentInput = (input: StopDeploymentInput, context: __SerdeContext): any => { return { - ...(input.autoRollbackEnabled !== undefined && { autoRollbackEnabled: input.autoRollbackEnabled }), - ...(input.deploymentId !== undefined && { deploymentId: input.deploymentId }), + ...(input.autoRollbackEnabled !== undefined && + input.autoRollbackEnabled !== null && { autoRollbackEnabled: input.autoRollbackEnabled }), + ...(input.deploymentId !== undefined && input.deploymentId !== null && { deploymentId: input.deploymentId }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagFilter = (input: TagFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagFilterList = (input: TagFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TagFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TagFilter(entry, context); + }); }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TargetFilters = (input: { [key: string]: string[] }, context: __SerdeContext): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [TargetFilterName | string, any]) => ({ - ...acc, - [key]: serializeAws_json1_1FilterValueList(value, context), - }), + (acc: { [key: string]: string[] }, [key, value]: [TargetFilterName | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_json1_1FilterValueList(value, context), + }; + }, {} ); }; const serializeAws_json1_1TargetGroupInfo = (input: TargetGroupInfo, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1TargetGroupInfoList = (input: TargetGroupInfo[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TargetGroupInfo(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TargetGroupInfo(entry, context); + }); }; const serializeAws_json1_1TargetGroupPairInfo = (input: TargetGroupPairInfo, context: __SerdeContext): any => { return { - ...(input.prodTrafficRoute !== undefined && { - prodTrafficRoute: serializeAws_json1_1TrafficRoute(input.prodTrafficRoute, context), - }), - ...(input.targetGroups !== undefined && { - targetGroups: serializeAws_json1_1TargetGroupInfoList(input.targetGroups, context), - }), - ...(input.testTrafficRoute !== undefined && { - testTrafficRoute: serializeAws_json1_1TrafficRoute(input.testTrafficRoute, context), - }), + ...(input.prodTrafficRoute !== undefined && + input.prodTrafficRoute !== null && { + prodTrafficRoute: serializeAws_json1_1TrafficRoute(input.prodTrafficRoute, context), + }), + ...(input.targetGroups !== undefined && + input.targetGroups !== null && { + targetGroups: serializeAws_json1_1TargetGroupInfoList(input.targetGroups, context), + }), + ...(input.testTrafficRoute !== undefined && + input.testTrafficRoute !== null && { + testTrafficRoute: serializeAws_json1_1TrafficRoute(input.testTrafficRoute, context), + }), }; }; const serializeAws_json1_1TargetGroupPairInfoList = (input: TargetGroupPairInfo[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TargetGroupPairInfo(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TargetGroupPairInfo(entry, context); + }); }; const serializeAws_json1_1TargetIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TargetInstances = (input: TargetInstances, context: __SerdeContext): any => { return { - ...(input.autoScalingGroups !== undefined && { - autoScalingGroups: serializeAws_json1_1AutoScalingGroupNameList(input.autoScalingGroups, context), - }), - ...(input.ec2TagSet !== undefined && { ec2TagSet: serializeAws_json1_1EC2TagSet(input.ec2TagSet, context) }), - ...(input.tagFilters !== undefined && { - tagFilters: serializeAws_json1_1EC2TagFilterList(input.tagFilters, context), - }), + ...(input.autoScalingGroups !== undefined && + input.autoScalingGroups !== null && { + autoScalingGroups: serializeAws_json1_1AutoScalingGroupNameList(input.autoScalingGroups, context), + }), + ...(input.ec2TagSet !== undefined && + input.ec2TagSet !== null && { ec2TagSet: serializeAws_json1_1EC2TagSet(input.ec2TagSet, context) }), + ...(input.tagFilters !== undefined && + input.tagFilters !== null && { tagFilters: serializeAws_json1_1EC2TagFilterList(input.tagFilters, context) }), }; }; const serializeAws_json1_1TimeBasedCanary = (input: TimeBasedCanary, context: __SerdeContext): any => { return { - ...(input.canaryInterval !== undefined && { canaryInterval: input.canaryInterval }), - ...(input.canaryPercentage !== undefined && { canaryPercentage: input.canaryPercentage }), + ...(input.canaryInterval !== undefined && + input.canaryInterval !== null && { canaryInterval: input.canaryInterval }), + ...(input.canaryPercentage !== undefined && + input.canaryPercentage !== null && { canaryPercentage: input.canaryPercentage }), }; }; const serializeAws_json1_1TimeBasedLinear = (input: TimeBasedLinear, context: __SerdeContext): any => { return { - ...(input.linearInterval !== undefined && { linearInterval: input.linearInterval }), - ...(input.linearPercentage !== undefined && { linearPercentage: input.linearPercentage }), + ...(input.linearInterval !== undefined && + input.linearInterval !== null && { linearInterval: input.linearInterval }), + ...(input.linearPercentage !== undefined && + input.linearPercentage !== null && { linearPercentage: input.linearPercentage }), }; }; const serializeAws_json1_1TimeRange = (input: TimeRange, context: __SerdeContext): any => { return { - ...(input.end !== undefined && { end: Math.round(input.end.getTime() / 1000) }), - ...(input.start !== undefined && { start: Math.round(input.start.getTime() / 1000) }), + ...(input.end !== undefined && input.end !== null && { end: Math.round(input.end.getTime() / 1000) }), + ...(input.start !== undefined && input.start !== null && { start: Math.round(input.start.getTime() / 1000) }), }; }; const serializeAws_json1_1TrafficRoute = (input: TrafficRoute, context: __SerdeContext): any => { return { - ...(input.listenerArns !== undefined && { - listenerArns: serializeAws_json1_1ListenerArnList(input.listenerArns, context), - }), + ...(input.listenerArns !== undefined && + input.listenerArns !== null && { + listenerArns: serializeAws_json1_1ListenerArnList(input.listenerArns, context), + }), }; }; const serializeAws_json1_1TrafficRoutingConfig = (input: TrafficRoutingConfig, context: __SerdeContext): any => { return { - ...(input.timeBasedCanary !== undefined && { - timeBasedCanary: serializeAws_json1_1TimeBasedCanary(input.timeBasedCanary, context), - }), - ...(input.timeBasedLinear !== undefined && { - timeBasedLinear: serializeAws_json1_1TimeBasedLinear(input.timeBasedLinear, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.timeBasedCanary !== undefined && + input.timeBasedCanary !== null && { + timeBasedCanary: serializeAws_json1_1TimeBasedCanary(input.timeBasedCanary, context), + }), + ...(input.timeBasedLinear !== undefined && + input.timeBasedLinear !== null && { + timeBasedLinear: serializeAws_json1_1TimeBasedLinear(input.timeBasedLinear, context), + }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1TriggerConfig = (input: TriggerConfig, context: __SerdeContext): any => { return { - ...(input.triggerEvents !== undefined && { - triggerEvents: serializeAws_json1_1TriggerEventTypeList(input.triggerEvents, context), - }), - ...(input.triggerName !== undefined && { triggerName: input.triggerName }), - ...(input.triggerTargetArn !== undefined && { triggerTargetArn: input.triggerTargetArn }), + ...(input.triggerEvents !== undefined && + input.triggerEvents !== null && { + triggerEvents: serializeAws_json1_1TriggerEventTypeList(input.triggerEvents, context), + }), + ...(input.triggerName !== undefined && input.triggerName !== null && { triggerName: input.triggerName }), + ...(input.triggerTargetArn !== undefined && + input.triggerTargetArn !== null && { triggerTargetArn: input.triggerTargetArn }), }; }; const serializeAws_json1_1TriggerConfigList = (input: TriggerConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TriggerConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TriggerConfig(entry, context); + }); }; const serializeAws_json1_1TriggerEventTypeList = ( input: (TriggerEventType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateApplicationInput = (input: UpdateApplicationInput, context: __SerdeContext): any => { return { - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.newApplicationName !== undefined && { newApplicationName: input.newApplicationName }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.newApplicationName !== undefined && + input.newApplicationName !== null && { newApplicationName: input.newApplicationName }), }; }; @@ -8432,53 +8673,66 @@ const serializeAws_json1_1UpdateDeploymentGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.alarmConfiguration !== undefined && { - alarmConfiguration: serializeAws_json1_1AlarmConfiguration(input.alarmConfiguration, context), - }), - ...(input.applicationName !== undefined && { applicationName: input.applicationName }), - ...(input.autoRollbackConfiguration !== undefined && { - autoRollbackConfiguration: serializeAws_json1_1AutoRollbackConfiguration( - input.autoRollbackConfiguration, - context - ), - }), - ...(input.autoScalingGroups !== undefined && { - autoScalingGroups: serializeAws_json1_1AutoScalingGroupNameList(input.autoScalingGroups, context), - }), - ...(input.blueGreenDeploymentConfiguration !== undefined && { - blueGreenDeploymentConfiguration: serializeAws_json1_1BlueGreenDeploymentConfiguration( - input.blueGreenDeploymentConfiguration, - context - ), - }), - ...(input.currentDeploymentGroupName !== undefined && { - currentDeploymentGroupName: input.currentDeploymentGroupName, - }), - ...(input.deploymentConfigName !== undefined && { deploymentConfigName: input.deploymentConfigName }), - ...(input.deploymentStyle !== undefined && { - deploymentStyle: serializeAws_json1_1DeploymentStyle(input.deploymentStyle, context), - }), - ...(input.ec2TagFilters !== undefined && { - ec2TagFilters: serializeAws_json1_1EC2TagFilterList(input.ec2TagFilters, context), - }), - ...(input.ec2TagSet !== undefined && { ec2TagSet: serializeAws_json1_1EC2TagSet(input.ec2TagSet, context) }), - ...(input.ecsServices !== undefined && { - ecsServices: serializeAws_json1_1ECSServiceList(input.ecsServices, context), - }), - ...(input.loadBalancerInfo !== undefined && { - loadBalancerInfo: serializeAws_json1_1LoadBalancerInfo(input.loadBalancerInfo, context), - }), - ...(input.newDeploymentGroupName !== undefined && { newDeploymentGroupName: input.newDeploymentGroupName }), - ...(input.onPremisesInstanceTagFilters !== undefined && { - onPremisesInstanceTagFilters: serializeAws_json1_1TagFilterList(input.onPremisesInstanceTagFilters, context), - }), - ...(input.onPremisesTagSet !== undefined && { - onPremisesTagSet: serializeAws_json1_1OnPremisesTagSet(input.onPremisesTagSet, context), - }), - ...(input.serviceRoleArn !== undefined && { serviceRoleArn: input.serviceRoleArn }), - ...(input.triggerConfigurations !== undefined && { - triggerConfigurations: serializeAws_json1_1TriggerConfigList(input.triggerConfigurations, context), - }), + ...(input.alarmConfiguration !== undefined && + input.alarmConfiguration !== null && { + alarmConfiguration: serializeAws_json1_1AlarmConfiguration(input.alarmConfiguration, context), + }), + ...(input.applicationName !== undefined && + input.applicationName !== null && { applicationName: input.applicationName }), + ...(input.autoRollbackConfiguration !== undefined && + input.autoRollbackConfiguration !== null && { + autoRollbackConfiguration: serializeAws_json1_1AutoRollbackConfiguration( + input.autoRollbackConfiguration, + context + ), + }), + ...(input.autoScalingGroups !== undefined && + input.autoScalingGroups !== null && { + autoScalingGroups: serializeAws_json1_1AutoScalingGroupNameList(input.autoScalingGroups, context), + }), + ...(input.blueGreenDeploymentConfiguration !== undefined && + input.blueGreenDeploymentConfiguration !== null && { + blueGreenDeploymentConfiguration: serializeAws_json1_1BlueGreenDeploymentConfiguration( + input.blueGreenDeploymentConfiguration, + context + ), + }), + ...(input.currentDeploymentGroupName !== undefined && + input.currentDeploymentGroupName !== null && { currentDeploymentGroupName: input.currentDeploymentGroupName }), + ...(input.deploymentConfigName !== undefined && + input.deploymentConfigName !== null && { deploymentConfigName: input.deploymentConfigName }), + ...(input.deploymentStyle !== undefined && + input.deploymentStyle !== null && { + deploymentStyle: serializeAws_json1_1DeploymentStyle(input.deploymentStyle, context), + }), + ...(input.ec2TagFilters !== undefined && + input.ec2TagFilters !== null && { + ec2TagFilters: serializeAws_json1_1EC2TagFilterList(input.ec2TagFilters, context), + }), + ...(input.ec2TagSet !== undefined && + input.ec2TagSet !== null && { ec2TagSet: serializeAws_json1_1EC2TagSet(input.ec2TagSet, context) }), + ...(input.ecsServices !== undefined && + input.ecsServices !== null && { ecsServices: serializeAws_json1_1ECSServiceList(input.ecsServices, context) }), + ...(input.loadBalancerInfo !== undefined && + input.loadBalancerInfo !== null && { + loadBalancerInfo: serializeAws_json1_1LoadBalancerInfo(input.loadBalancerInfo, context), + }), + ...(input.newDeploymentGroupName !== undefined && + input.newDeploymentGroupName !== null && { newDeploymentGroupName: input.newDeploymentGroupName }), + ...(input.onPremisesInstanceTagFilters !== undefined && + input.onPremisesInstanceTagFilters !== null && { + onPremisesInstanceTagFilters: serializeAws_json1_1TagFilterList(input.onPremisesInstanceTagFilters, context), + }), + ...(input.onPremisesTagSet !== undefined && + input.onPremisesTagSet !== null && { + onPremisesTagSet: serializeAws_json1_1OnPremisesTagSet(input.onPremisesTagSet, context), + }), + ...(input.serviceRoleArn !== undefined && + input.serviceRoleArn !== null && { serviceRoleArn: input.serviceRoleArn }), + ...(input.triggerConfigurations !== undefined && + input.triggerConfigurations !== null && { + triggerConfigurations: serializeAws_json1_1TriggerConfigList(input.triggerConfigurations, context), + }), }; }; @@ -8503,7 +8757,14 @@ const deserializeAws_json1_1AlarmConfiguration = (output: any, context: __SerdeC }; const deserializeAws_json1_1AlarmList = (output: any, context: __SerdeContext): Alarm[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Alarm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Alarm(entry, context); + }); }; const deserializeAws_json1_1AlarmsLimitExceededException = ( @@ -8573,11 +8834,25 @@ const deserializeAws_json1_1ApplicationNameRequiredException = ( }; const deserializeAws_json1_1ApplicationsInfoList = (output: any, context: __SerdeContext): ApplicationInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ApplicationInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ApplicationInfo(entry, context); + }); }; const deserializeAws_json1_1ApplicationsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AppSpecContent = (output: any, context: __SerdeContext): AppSpecContent => { @@ -8613,7 +8888,14 @@ const deserializeAws_json1_1AutoRollbackEventsList = ( output: any, context: __SerdeContext ): (AutoRollbackEvent | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AutoScalingGroup = (output: any, context: __SerdeContext): AutoScalingGroup => { @@ -8624,11 +8906,25 @@ const deserializeAws_json1_1AutoScalingGroup = (output: any, context: __SerdeCon }; const deserializeAws_json1_1AutoScalingGroupList = (output: any, context: __SerdeContext): AutoScalingGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutoScalingGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutoScalingGroup(entry, context); + }); }; const deserializeAws_json1_1AutoScalingGroupNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1BatchGetApplicationRevisionsOutput = ( @@ -8943,7 +9239,14 @@ const deserializeAws_json1_1DeploymentConfigNameRequiredException = ( }; const deserializeAws_json1_1DeploymentConfigsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeploymentDoesNotExistException = ( @@ -9057,7 +9360,14 @@ const deserializeAws_json1_1DeploymentGroupInfo = (output: any, context: __Serde }; const deserializeAws_json1_1DeploymentGroupInfoList = (output: any, context: __SerdeContext): DeploymentGroupInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeploymentGroupInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeploymentGroupInfo(entry, context); + }); }; const deserializeAws_json1_1DeploymentGroupLimitExceededException = ( @@ -9079,7 +9389,14 @@ const deserializeAws_json1_1DeploymentGroupNameRequiredException = ( }; const deserializeAws_json1_1DeploymentGroupsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeploymentIdRequiredException = ( @@ -9239,15 +9556,36 @@ const deserializeAws_json1_1DeploymentReadyOption = (output: any, context: __Ser }; const deserializeAws_json1_1DeploymentsInfoList = (output: any, context: __SerdeContext): DeploymentInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeploymentInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeploymentInfo(entry, context); + }); }; const deserializeAws_json1_1DeploymentsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeploymentStatusMessageList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeploymentStyle = (output: any, context: __SerdeContext): DeploymentStyle => { @@ -9303,7 +9641,14 @@ const deserializeAws_json1_1DeploymentTargetIdRequiredException = ( }; const deserializeAws_json1_1DeploymentTargetList = (output: any, context: __SerdeContext): DeploymentTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeploymentTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeploymentTarget(entry, context); + }); }; const deserializeAws_json1_1DeploymentTargetListSizeExceededException = ( @@ -9342,7 +9687,14 @@ const deserializeAws_json1_1EC2TagFilter = (output: any, context: __SerdeContext }; const deserializeAws_json1_1EC2TagFilterList = (output: any, context: __SerdeContext): EC2TagFilter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EC2TagFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EC2TagFilter(entry, context); + }); }; const deserializeAws_json1_1EC2TagSet = (output: any, context: __SerdeContext): EC2TagSet => { @@ -9355,7 +9707,14 @@ const deserializeAws_json1_1EC2TagSet = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1EC2TagSetList = (output: any, context: __SerdeContext): EC2TagFilter[][] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EC2TagFilterList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EC2TagFilterList(entry, context); + }); }; const deserializeAws_json1_1ECSService = (output: any, context: __SerdeContext): ECSService => { @@ -9366,7 +9725,14 @@ const deserializeAws_json1_1ECSService = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ECSServiceList = (output: any, context: __SerdeContext): ECSService[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ECSService(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ECSService(entry, context); + }); }; const deserializeAws_json1_1ECSServiceMappingLimitExceededException = ( @@ -9417,7 +9783,14 @@ const deserializeAws_json1_1ECSTaskSet = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ECSTaskSetList = (output: any, context: __SerdeContext): ECSTaskSet[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ECSTaskSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ECSTaskSet(entry, context); + }); }; const deserializeAws_json1_1ELBInfo = (output: any, context: __SerdeContext): ELBInfo => { @@ -9427,7 +9800,14 @@ const deserializeAws_json1_1ELBInfo = (output: any, context: __SerdeContext): EL }; const deserializeAws_json1_1ELBInfoList = (output: any, context: __SerdeContext): ELBInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ELBInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ELBInfo(entry, context); + }); }; const deserializeAws_json1_1ErrorInformation = (output: any, context: __SerdeContext): ErrorInformation => { @@ -9565,7 +9945,14 @@ const deserializeAws_json1_1GitHubAccountTokenDoesNotExistException = ( }; const deserializeAws_json1_1GitHubAccountTokenNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1GitHubAccountTokenNameRequiredException = ( @@ -9670,7 +10057,14 @@ const deserializeAws_json1_1InstanceInfo = (output: any, context: __SerdeContext }; const deserializeAws_json1_1InstanceInfoList = (output: any, context: __SerdeContext): InstanceInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceInfo(entry, context); + }); }; const deserializeAws_json1_1InstanceLimitExceededException = ( @@ -9692,7 +10086,14 @@ const deserializeAws_json1_1InstanceNameAlreadyRegisteredException = ( }; const deserializeAws_json1_1InstanceNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InstanceNameRequiredException = ( @@ -9714,7 +10115,14 @@ const deserializeAws_json1_1InstanceNotRegisteredException = ( }; const deserializeAws_json1_1InstancesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InstanceSummary = (output: any, context: __SerdeContext): InstanceSummary => { @@ -9735,7 +10143,14 @@ const deserializeAws_json1_1InstanceSummary = (output: any, context: __SerdeCont }; const deserializeAws_json1_1InstanceSummaryList = (output: any, context: __SerdeContext): InstanceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceSummary(entry, context); + }); }; const deserializeAws_json1_1InstanceTarget = (output: any, context: __SerdeContext): InstanceTarget => { @@ -10305,7 +10720,14 @@ const deserializeAws_json1_1LifecycleEventAlreadyCompletedException = ( }; const deserializeAws_json1_1LifecycleEventList = (output: any, context: __SerdeContext): LifecycleEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LifecycleEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LifecycleEvent(entry, context); + }); }; const deserializeAws_json1_1LifecycleHookLimitExceededException = ( @@ -10405,7 +10827,14 @@ const deserializeAws_json1_1ListDeploymentTargetsOutput = ( }; const deserializeAws_json1_1ListenerArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ListGitHubAccountTokenNamesOutput = ( @@ -10490,7 +10919,14 @@ const deserializeAws_json1_1OnPremisesTagSet = (output: any, context: __SerdeCon }; const deserializeAws_json1_1OnPremisesTagSetList = (output: any, context: __SerdeContext): TagFilter[][] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TagFilterList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TagFilterList(entry, context); + }); }; const deserializeAws_json1_1OperationNotSupportedException = ( @@ -10562,7 +10998,14 @@ const deserializeAws_json1_1RevisionInfo = (output: any, context: __SerdeContext }; const deserializeAws_json1_1RevisionInfoList = (output: any, context: __SerdeContext): RevisionInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RevisionInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RevisionInfo(entry, context); + }); }; const deserializeAws_json1_1RevisionLocation = (output: any, context: __SerdeContext): RevisionLocation => { @@ -10588,7 +11031,14 @@ const deserializeAws_json1_1RevisionLocation = (output: any, context: __SerdeCon }; const deserializeAws_json1_1RevisionLocationList = (output: any, context: __SerdeContext): RevisionLocation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RevisionLocation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RevisionLocation(entry, context); + }); }; const deserializeAws_json1_1RevisionRequiredException = ( @@ -10655,7 +11105,14 @@ const deserializeAws_json1_1TagFilter = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1TagFilterList = (output: any, context: __SerdeContext): TagFilter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TagFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TagFilter(entry, context); + }); }; const deserializeAws_json1_1TagLimitExceededException = ( @@ -10668,7 +11125,14 @@ const deserializeAws_json1_1TagLimitExceededException = ( }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagRequiredException = (output: any, context: __SerdeContext): TagRequiredException => { @@ -10697,7 +11161,14 @@ const deserializeAws_json1_1TargetGroupInfo = (output: any, context: __SerdeCont }; const deserializeAws_json1_1TargetGroupInfoList = (output: any, context: __SerdeContext): TargetGroupInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TargetGroupInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TargetGroupInfo(entry, context); + }); }; const deserializeAws_json1_1TargetGroupPairInfo = (output: any, context: __SerdeContext): TargetGroupPairInfo => { @@ -10718,11 +11189,25 @@ const deserializeAws_json1_1TargetGroupPairInfo = (output: any, context: __Serde }; const deserializeAws_json1_1TargetGroupPairInfoList = (output: any, context: __SerdeContext): TargetGroupPairInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TargetGroupPairInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TargetGroupPairInfo(entry, context); + }); }; const deserializeAws_json1_1TargetIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TargetInstances = (output: any, context: __SerdeContext): TargetInstances => { @@ -10802,14 +11287,28 @@ const deserializeAws_json1_1TriggerConfig = (output: any, context: __SerdeContex }; const deserializeAws_json1_1TriggerConfigList = (output: any, context: __SerdeContext): TriggerConfig[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TriggerConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TriggerConfig(entry, context); + }); }; const deserializeAws_json1_1TriggerEventTypeList = ( output: any, context: __SerdeContext ): (TriggerEventType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TriggerTargetsLimitExceededException = ( @@ -10896,3 +11395,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-codeguru-reviewer/protocols/Aws_restJson1.ts b/clients/client-codeguru-reviewer/protocols/Aws_restJson1.ts index 4e121491cb1d..d471819677ef 100644 --- a/clients/client-codeguru-reviewer/protocols/Aws_restJson1.ts +++ b/clients/client-codeguru-reviewer/protocols/Aws_restJson1.ts @@ -84,14 +84,15 @@ export const serializeAws_restJson1AssociateRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/associations"; let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Repository !== undefined && { Repository: serializeAws_restJson1Repository(input.Repository, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Repository !== undefined && + input.Repository !== null && { Repository: serializeAws_restJson1Repository(input.Repository, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -110,15 +111,17 @@ export const serializeAws_restJson1CreateCodeReviewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/codereviews"; let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RepositoryAssociationArn !== undefined && { RepositoryAssociationArn: input.RepositoryAssociationArn }), - ...(input.Type !== undefined && { Type: serializeAws_restJson1CodeReviewType(input.Type, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RepositoryAssociationArn !== undefined && + input.RepositoryAssociationArn !== null && { RepositoryAssociationArn: input.RepositoryAssociationArn }), + ...(input.Type !== undefined && + input.Type !== null && { Type: serializeAws_restJson1CodeReviewType(input.Type, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -136,9 +139,7 @@ export const serializeAws_restJson1DescribeCodeReviewCommand = async ( input: DescribeCodeReviewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/codereviews/{CodeReviewArn}"; if (input.CodeReviewArn !== undefined) { const labelValue: string = input.CodeReviewArn; @@ -166,9 +167,7 @@ export const serializeAws_restJson1DescribeRecommendationFeedbackCommand = async input: DescribeRecommendationFeedbackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/feedback/{CodeReviewArn}"; if (input.CodeReviewArn !== undefined) { const labelValue: string = input.CodeReviewArn; @@ -201,9 +200,7 @@ export const serializeAws_restJson1DescribeRepositoryAssociationCommand = async input: DescribeRepositoryAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/associations/{AssociationArn}"; if (input.AssociationArn !== undefined) { const labelValue: string = input.AssociationArn; @@ -231,9 +228,7 @@ export const serializeAws_restJson1DisassociateRepositoryCommand = async ( input: DisassociateRepositoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/associations/{AssociationArn}"; if (input.AssociationArn !== undefined) { const labelValue: string = input.AssociationArn; @@ -261,9 +256,7 @@ export const serializeAws_restJson1ListCodeReviewsCommand = async ( input: ListCodeReviewsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/codereviews"; const query: any = { ...(input.ProviderTypes !== undefined && { ProviderTypes: (input.ProviderTypes || []).map((_entry) => _entry) }), @@ -293,9 +286,7 @@ export const serializeAws_restJson1ListRecommendationFeedbackCommand = async ( input: ListRecommendationFeedbackCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/feedback/{CodeReviewArn}/RecommendationFeedback"; if (input.CodeReviewArn !== undefined) { const labelValue: string = input.CodeReviewArn; @@ -332,9 +323,7 @@ export const serializeAws_restJson1ListRecommendationsCommand = async ( input: ListRecommendationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/codereviews/{CodeReviewArn}/Recommendations"; if (input.CodeReviewArn !== undefined) { const labelValue: string = input.CodeReviewArn; @@ -367,9 +356,7 @@ export const serializeAws_restJson1ListRepositoryAssociationsCommand = async ( input: ListRepositoryAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/associations"; const query: any = { ...(input.ProviderTypes !== undefined && { ProviderType: (input.ProviderTypes || []).map((_entry) => _entry) }), @@ -397,9 +384,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -428,14 +413,16 @@ export const serializeAws_restJson1PutRecommendationFeedbackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/feedback"; let body: any; body = JSON.stringify({ - ...(input.CodeReviewArn !== undefined && { CodeReviewArn: input.CodeReviewArn }), - ...(input.Reactions !== undefined && { Reactions: serializeAws_restJson1Reactions(input.Reactions, context) }), - ...(input.RecommendationId !== undefined && { RecommendationId: input.RecommendationId }), + ...(input.CodeReviewArn !== undefined && input.CodeReviewArn !== null && { CodeReviewArn: input.CodeReviewArn }), + ...(input.Reactions !== undefined && + input.Reactions !== null && { Reactions: serializeAws_restJson1Reactions(input.Reactions, context) }), + ...(input.RecommendationId !== undefined && + input.RecommendationId !== null && { RecommendationId: input.RecommendationId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -454,7 +441,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -468,7 +455,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -486,9 +473,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1827,41 +1812,53 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1CodeCommitRepository = (input: CodeCommitRepository, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_restJson1CodeReviewType = (input: CodeReviewType, context: __SerdeContext): any => { return { - ...(input.RepositoryAnalysis !== undefined && { - RepositoryAnalysis: serializeAws_restJson1RepositoryAnalysis(input.RepositoryAnalysis, context), - }), + ...(input.RepositoryAnalysis !== undefined && + input.RepositoryAnalysis !== null && { + RepositoryAnalysis: serializeAws_restJson1RepositoryAnalysis(input.RepositoryAnalysis, context), + }), }; }; const serializeAws_restJson1Reactions = (input: (Reaction | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Repository = (input: Repository, context: __SerdeContext): any => { return { - ...(input.Bitbucket !== undefined && { - Bitbucket: serializeAws_restJson1ThirdPartySourceRepository(input.Bitbucket, context), - }), - ...(input.CodeCommit !== undefined && { - CodeCommit: serializeAws_restJson1CodeCommitRepository(input.CodeCommit, context), - }), - ...(input.GitHubEnterpriseServer !== undefined && { - GitHubEnterpriseServer: serializeAws_restJson1ThirdPartySourceRepository(input.GitHubEnterpriseServer, context), - }), + ...(input.Bitbucket !== undefined && + input.Bitbucket !== null && { + Bitbucket: serializeAws_restJson1ThirdPartySourceRepository(input.Bitbucket, context), + }), + ...(input.CodeCommit !== undefined && + input.CodeCommit !== null && { + CodeCommit: serializeAws_restJson1CodeCommitRepository(input.CodeCommit, context), + }), + ...(input.GitHubEnterpriseServer !== undefined && + input.GitHubEnterpriseServer !== null && { + GitHubEnterpriseServer: serializeAws_restJson1ThirdPartySourceRepository(input.GitHubEnterpriseServer, context), + }), }; }; const serializeAws_restJson1RepositoryAnalysis = (input: RepositoryAnalysis, context: __SerdeContext): any => { return { - ...(input.RepositoryHead !== undefined && { - RepositoryHead: serializeAws_restJson1RepositoryHeadSourceCodeType(input.RepositoryHead, context), - }), + ...(input.RepositoryHead !== undefined && + input.RepositoryHead !== null && { + RepositoryHead: serializeAws_restJson1RepositoryHeadSourceCodeType(input.RepositoryHead, context), + }), }; }; @@ -1870,18 +1867,20 @@ const serializeAws_restJson1RepositoryHeadSourceCodeType = ( context: __SerdeContext ): any => { return { - ...(input.BranchName !== undefined && { BranchName: input.BranchName }), + ...(input.BranchName !== undefined && input.BranchName !== null && { BranchName: input.BranchName }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ThirdPartySourceRepository = ( @@ -1889,9 +1888,9 @@ const serializeAws_restJson1ThirdPartySourceRepository = ( context: __SerdeContext ): any => { return { - ...(input.ConnectionArn !== undefined && { ConnectionArn: input.ConnectionArn }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Owner !== undefined && { Owner: input.Owner }), + ...(input.ConnectionArn !== undefined && input.ConnectionArn !== null && { ConnectionArn: input.ConnectionArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Owner !== undefined && input.Owner !== null && { Owner: input.Owner }), }; }; @@ -1931,7 +1930,14 @@ const deserializeAws_restJson1CodeReview = (output: any, context: __SerdeContext }; const deserializeAws_restJson1CodeReviewSummaries = (output: any, context: __SerdeContext): CodeReviewSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CodeReviewSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CodeReviewSummary(entry, context); + }); }; const deserializeAws_restJson1CodeReviewSummary = (output: any, context: __SerdeContext): CodeReviewSummary => { @@ -1998,7 +2004,14 @@ const deserializeAws_restJson1MetricsSummary = (output: any, context: __SerdeCon }; const deserializeAws_restJson1Reactions = (output: any, context: __SerdeContext): (Reaction | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1RecommendationFeedback = ( @@ -2030,7 +2043,14 @@ const deserializeAws_restJson1RecommendationFeedbackSummaries = ( output: any, context: __SerdeContext ): RecommendationFeedbackSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecommendationFeedbackSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecommendationFeedbackSummary(entry, context); + }); }; const deserializeAws_restJson1RecommendationFeedbackSummary = ( @@ -2052,7 +2072,14 @@ const deserializeAws_restJson1RecommendationSummaries = ( output: any, context: __SerdeContext ): RecommendationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecommendationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecommendationSummary(entry, context); + }); }; const deserializeAws_restJson1RecommendationSummary = (output: any, context: __SerdeContext): RecommendationSummary => { @@ -2094,7 +2121,14 @@ const deserializeAws_restJson1RepositoryAssociationSummaries = ( output: any, context: __SerdeContext ): RepositoryAssociationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RepositoryAssociationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RepositoryAssociationSummary(entry, context); + }); }; const deserializeAws_restJson1RepositoryAssociationSummary = ( @@ -2142,13 +2176,15 @@ const deserializeAws_restJson1SourceCodeType = (output: any, context: __SerdeCon }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2171,6 +2207,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-codeguruprofiler/protocols/Aws_restJson1.ts b/clients/client-codeguruprofiler/protocols/Aws_restJson1.ts index e58e3cf767d3..e6ec6c7136bc 100644 --- a/clients/client-codeguruprofiler/protocols/Aws_restJson1.ts +++ b/clients/client-codeguruprofiler/protocols/Aws_restJson1.ts @@ -61,7 +61,7 @@ export const serializeAws_restJson1ConfigureAgentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/profilingGroups/{profilingGroupName}/configureAgent"; if (input.profilingGroupName !== undefined) { @@ -75,8 +75,10 @@ export const serializeAws_restJson1ConfigureAgentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.fleetInstanceId !== undefined && { fleetInstanceId: input.fleetInstanceId }), - ...(input.metadata !== undefined && { metadata: serializeAws_restJson1Metadata(input.metadata, context) }), + ...(input.fleetInstanceId !== undefined && + input.fleetInstanceId !== null && { fleetInstanceId: input.fleetInstanceId }), + ...(input.metadata !== undefined && + input.metadata !== null && { metadata: serializeAws_restJson1Metadata(input.metadata, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -95,7 +97,7 @@ export const serializeAws_restJson1CreateProfilingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/profilingGroups"; const query: any = { @@ -103,11 +105,17 @@ export const serializeAws_restJson1CreateProfilingGroupCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.agentOrchestrationConfig !== undefined && { - agentOrchestrationConfig: serializeAws_restJson1AgentOrchestrationConfig(input.agentOrchestrationConfig, context), - }), - ...(input.computePlatform !== undefined && { computePlatform: input.computePlatform }), - ...(input.profilingGroupName !== undefined && { profilingGroupName: input.profilingGroupName }), + ...(input.agentOrchestrationConfig !== undefined && + input.agentOrchestrationConfig !== null && { + agentOrchestrationConfig: serializeAws_restJson1AgentOrchestrationConfig( + input.agentOrchestrationConfig, + context + ), + }), + ...(input.computePlatform !== undefined && + input.computePlatform !== null && { computePlatform: input.computePlatform }), + ...(input.profilingGroupName !== undefined && + input.profilingGroupName !== null && { profilingGroupName: input.profilingGroupName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -126,9 +134,7 @@ export const serializeAws_restJson1DeleteProfilingGroupCommand = async ( input: DeleteProfilingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/profilingGroups/{profilingGroupName}"; if (input.profilingGroupName !== undefined) { const labelValue: string = input.profilingGroupName; @@ -156,9 +162,7 @@ export const serializeAws_restJson1DescribeProfilingGroupCommand = async ( input: DescribeProfilingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/profilingGroups/{profilingGroupName}"; if (input.profilingGroupName !== undefined) { const labelValue: string = input.profilingGroupName; @@ -186,9 +190,7 @@ export const serializeAws_restJson1ListProfilingGroupsCommand = async ( input: ListProfilingGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/profilingGroups"; const query: any = { ...(input.includeDescription !== undefined && { includeDescription: input.includeDescription.toString() }), @@ -214,7 +216,7 @@ export const serializeAws_restJson1UpdateProfilingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/profilingGroups/{profilingGroupName}"; if (input.profilingGroupName !== undefined) { @@ -228,9 +230,13 @@ export const serializeAws_restJson1UpdateProfilingGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.agentOrchestrationConfig !== undefined && { - agentOrchestrationConfig: serializeAws_restJson1AgentOrchestrationConfig(input.agentOrchestrationConfig, context), - }), + ...(input.agentOrchestrationConfig !== undefined && + input.agentOrchestrationConfig !== null && { + agentOrchestrationConfig: serializeAws_restJson1AgentOrchestrationConfig( + input.agentOrchestrationConfig, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -248,9 +254,7 @@ export const serializeAws_restJson1GetPolicyCommand = async ( input: GetPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/profilingGroups/{profilingGroupName}/policy"; if (input.profilingGroupName !== undefined) { const labelValue: string = input.profilingGroupName; @@ -279,7 +283,7 @@ export const serializeAws_restJson1PutPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/profilingGroups/{profilingGroupName}/policy/{actionGroup}"; if (input.actionGroup !== undefined) { @@ -302,8 +306,9 @@ export const serializeAws_restJson1PutPermissionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.principals !== undefined && { principals: serializeAws_restJson1Principals(input.principals, context) }), - ...(input.revisionId !== undefined && { revisionId: input.revisionId }), + ...(input.principals !== undefined && + input.principals !== null && { principals: serializeAws_restJson1Principals(input.principals, context) }), + ...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -321,9 +326,7 @@ export const serializeAws_restJson1RemovePermissionCommand = async ( input: RemovePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/profilingGroups/{profilingGroupName}/policy/{actionGroup}"; if (input.actionGroup !== undefined) { const labelValue: string = input.actionGroup; @@ -365,7 +368,6 @@ export const serializeAws_restJson1GetProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.accept) && { Accept: input.accept! }), }; let resolvedPath = "/profilingGroups/{profilingGroupName}/profile"; @@ -402,9 +404,7 @@ export const serializeAws_restJson1ListProfileTimesCommand = async ( input: ListProfileTimesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/profilingGroups/{profilingGroupName}/profileTimes"; if (input.profilingGroupName !== undefined) { const labelValue: string = input.profilingGroupName; @@ -442,7 +442,7 @@ export const serializeAws_restJson1PostAgentProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.contentType) && { "Content-Type": input.contentType! }), }; let resolvedPath = "/profilingGroups/{profilingGroupName}/agentProfile"; @@ -480,7 +480,7 @@ export const serializeAws_restJson1RetrieveTimeSeriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/profilingGroups/{profilingGroupName}/timeseries"; if (input.profilingGroupName !== undefined) { @@ -500,9 +500,8 @@ export const serializeAws_restJson1RetrieveTimeSeriesCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.frameMetrics !== undefined && { - frameMetrics: serializeAws_restJson1FrameMetrics(input.frameMetrics, context), - }), + ...(input.frameMetrics !== undefined && + input.frameMetrics !== null && { frameMetrics: serializeAws_restJson1FrameMetrics(input.frameMetrics, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1696,13 +1695,15 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1Metadata = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [MetadataField | string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [MetadataField | string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AgentOrchestrationConfig = ( @@ -1710,38 +1711,64 @@ const serializeAws_restJson1AgentOrchestrationConfig = ( context: __SerdeContext ): any => { return { - ...(input.profilingEnabled !== undefined && { profilingEnabled: input.profilingEnabled }), + ...(input.profilingEnabled !== undefined && + input.profilingEnabled !== null && { profilingEnabled: input.profilingEnabled }), }; }; const serializeAws_restJson1Principals = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1FrameMetric = (input: FrameMetric, context: __SerdeContext): any => { return { - ...(input.frameName !== undefined && { frameName: input.frameName }), - ...(input.threadStates !== undefined && { - threadStates: serializeAws_restJson1ThreadStates(input.threadStates, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.frameName !== undefined && input.frameName !== null && { frameName: input.frameName }), + ...(input.threadStates !== undefined && + input.threadStates !== null && { threadStates: serializeAws_restJson1ThreadStates(input.threadStates, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1FrameMetrics = (input: FrameMetric[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1FrameMetric(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1FrameMetric(entry, context); + }); }; const serializeAws_restJson1ThreadStates = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AgentParameters = (output: any, context: __SerdeContext): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [AgentParameterField | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [AgentParameterField | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -1802,11 +1829,25 @@ const deserializeAws_restJson1ProfilingGroupDescriptions = ( output: any, context: __SerdeContext ): ProfilingGroupDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProfilingGroupDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProfilingGroupDescription(entry, context); + }); }; const deserializeAws_restJson1ProfilingGroupNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ProfilingStatus = (output: any, context: __SerdeContext): ProfilingStatus => { @@ -1833,15 +1874,36 @@ const deserializeAws_restJson1ProfileTime = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ProfileTimes = (output: any, context: __SerdeContext): ProfileTime[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProfileTime(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProfileTime(entry, context); + }); }; const deserializeAws_restJson1DataMatrix = (output: any, context: __SerdeContext): number[][] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataMatrixRow(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataMatrixRow(entry, context); + }); }; const deserializeAws_restJson1DataMatrixRow = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1FrameMetric = (output: any, context: __SerdeContext): FrameMetric => { @@ -1856,28 +1918,51 @@ const deserializeAws_restJson1FrameMetric = (output: any, context: __SerdeContex }; const deserializeAws_restJson1FrameMetrics = (output: any, context: __SerdeContext): FrameMetric[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FrameMetric(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FrameMetric(entry, context); + }); }; const deserializeAws_restJson1ListOfTimestamps = (output: any, context: __SerdeContext): Date[] => { - return (output || []).map((entry: any) => new Date(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return new Date(entry); + }); }; const deserializeAws_restJson1ThreadStates = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1UnprocessedEndTimeMap = ( output: any, context: __SerdeContext ): { [key: string]: Date[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Date[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Date[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ListOfTimestamps(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1900,6 +1985,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-codepipeline/protocols/Aws_json1_1.ts b/clients/client-codepipeline/protocols/Aws_json1_1.ts index 81982cfad4d5..9915963ed93d 100644 --- a/clients/client-codepipeline/protocols/Aws_json1_1.ts +++ b/clients/client-codepipeline/protocols/Aws_json1_1.ts @@ -272,7 +272,7 @@ export const serializeAws_json1_1AcknowledgeJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.AcknowledgeJob", }; let body: any; @@ -285,7 +285,7 @@ export const serializeAws_json1_1AcknowledgeThirdPartyJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.AcknowledgeThirdPartyJob", }; let body: any; @@ -298,7 +298,7 @@ export const serializeAws_json1_1CreateCustomActionTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.CreateCustomActionType", }; let body: any; @@ -311,7 +311,7 @@ export const serializeAws_json1_1CreatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.CreatePipeline", }; let body: any; @@ -324,7 +324,7 @@ export const serializeAws_json1_1DeleteCustomActionTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.DeleteCustomActionType", }; let body: any; @@ -337,7 +337,7 @@ export const serializeAws_json1_1DeletePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.DeletePipeline", }; let body: any; @@ -350,7 +350,7 @@ export const serializeAws_json1_1DeleteWebhookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.DeleteWebhook", }; let body: any; @@ -363,7 +363,7 @@ export const serializeAws_json1_1DeregisterWebhookWithThirdPartyCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.DeregisterWebhookWithThirdParty", }; let body: any; @@ -376,7 +376,7 @@ export const serializeAws_json1_1DisableStageTransitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.DisableStageTransition", }; let body: any; @@ -389,7 +389,7 @@ export const serializeAws_json1_1EnableStageTransitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.EnableStageTransition", }; let body: any; @@ -402,7 +402,7 @@ export const serializeAws_json1_1GetJobDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.GetJobDetails", }; let body: any; @@ -415,7 +415,7 @@ export const serializeAws_json1_1GetPipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.GetPipeline", }; let body: any; @@ -428,7 +428,7 @@ export const serializeAws_json1_1GetPipelineExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.GetPipelineExecution", }; let body: any; @@ -441,7 +441,7 @@ export const serializeAws_json1_1GetPipelineStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.GetPipelineState", }; let body: any; @@ -454,7 +454,7 @@ export const serializeAws_json1_1GetThirdPartyJobDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.GetThirdPartyJobDetails", }; let body: any; @@ -467,7 +467,7 @@ export const serializeAws_json1_1ListActionExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.ListActionExecutions", }; let body: any; @@ -480,7 +480,7 @@ export const serializeAws_json1_1ListActionTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.ListActionTypes", }; let body: any; @@ -493,7 +493,7 @@ export const serializeAws_json1_1ListPipelineExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.ListPipelineExecutions", }; let body: any; @@ -506,7 +506,7 @@ export const serializeAws_json1_1ListPipelinesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.ListPipelines", }; let body: any; @@ -519,7 +519,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.ListTagsForResource", }; let body: any; @@ -532,7 +532,7 @@ export const serializeAws_json1_1ListWebhooksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.ListWebhooks", }; let body: any; @@ -545,7 +545,7 @@ export const serializeAws_json1_1PollForJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.PollForJobs", }; let body: any; @@ -558,7 +558,7 @@ export const serializeAws_json1_1PollForThirdPartyJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.PollForThirdPartyJobs", }; let body: any; @@ -571,7 +571,7 @@ export const serializeAws_json1_1PutActionRevisionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.PutActionRevision", }; let body: any; @@ -584,7 +584,7 @@ export const serializeAws_json1_1PutApprovalResultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.PutApprovalResult", }; let body: any; @@ -597,7 +597,7 @@ export const serializeAws_json1_1PutJobFailureResultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.PutJobFailureResult", }; let body: any; @@ -610,7 +610,7 @@ export const serializeAws_json1_1PutJobSuccessResultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.PutJobSuccessResult", }; let body: any; @@ -623,7 +623,7 @@ export const serializeAws_json1_1PutThirdPartyJobFailureResultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.PutThirdPartyJobFailureResult", }; let body: any; @@ -636,7 +636,7 @@ export const serializeAws_json1_1PutThirdPartyJobSuccessResultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.PutThirdPartyJobSuccessResult", }; let body: any; @@ -649,7 +649,7 @@ export const serializeAws_json1_1PutWebhookCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.PutWebhook", }; let body: any; @@ -662,7 +662,7 @@ export const serializeAws_json1_1RegisterWebhookWithThirdPartyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.RegisterWebhookWithThirdParty", }; let body: any; @@ -675,7 +675,7 @@ export const serializeAws_json1_1RetryStageExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.RetryStageExecution", }; let body: any; @@ -688,7 +688,7 @@ export const serializeAws_json1_1StartPipelineExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.StartPipelineExecution", }; let body: any; @@ -701,7 +701,7 @@ export const serializeAws_json1_1StopPipelineExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.StopPipelineExecution", }; let body: any; @@ -714,7 +714,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.TagResource", }; let body: any; @@ -727,7 +727,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.UntagResource", }; let body: any; @@ -740,7 +740,7 @@ export const serializeAws_json1_1UpdatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodePipeline_20150709.UpdatePipeline", }; let body: any; @@ -775,8 +775,7 @@ const deserializeAws_json1_1AcknowledgeJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNonceException": case "com.amazonaws.codepipeline#InvalidNonceException": @@ -846,8 +845,7 @@ const deserializeAws_json1_1AcknowledgeThirdPartyJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidClientTokenException": case "com.amazonaws.codepipeline#InvalidClientTokenException": @@ -925,8 +923,7 @@ const deserializeAws_json1_1CreateCustomActionTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codepipeline#ConcurrentModificationException": @@ -1012,8 +1009,7 @@ const deserializeAws_json1_1CreatePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codepipeline#ConcurrentModificationException": @@ -1136,8 +1132,7 @@ const deserializeAws_json1_1DeleteCustomActionTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codepipeline#ConcurrentModificationException": @@ -1196,8 +1191,7 @@ const deserializeAws_json1_1DeletePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codepipeline#ConcurrentModificationException": @@ -1259,8 +1253,7 @@ const deserializeAws_json1_1DeleteWebhookCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codepipeline#ConcurrentModificationException": @@ -1322,8 +1315,7 @@ const deserializeAws_json1_1DeregisterWebhookWithThirdPartyCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ValidationException": case "com.amazonaws.codepipeline#ValidationException": @@ -1382,8 +1374,7 @@ const deserializeAws_json1_1DisableStageTransitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "PipelineNotFoundException": case "com.amazonaws.codepipeline#PipelineNotFoundException": @@ -1450,8 +1441,7 @@ const deserializeAws_json1_1EnableStageTransitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "PipelineNotFoundException": case "com.amazonaws.codepipeline#PipelineNotFoundException": @@ -1521,8 +1511,7 @@ const deserializeAws_json1_1GetJobDetailsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "JobNotFoundException": case "com.amazonaws.codepipeline#JobNotFoundException": @@ -1584,8 +1573,7 @@ const deserializeAws_json1_1GetPipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "PipelineNotFoundException": case "com.amazonaws.codepipeline#PipelineNotFoundException": @@ -1655,8 +1643,7 @@ const deserializeAws_json1_1GetPipelineExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "PipelineExecutionNotFoundException": case "com.amazonaws.codepipeline#PipelineExecutionNotFoundException": @@ -1726,8 +1713,7 @@ const deserializeAws_json1_1GetPipelineStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "PipelineNotFoundException": case "com.amazonaws.codepipeline#PipelineNotFoundException": @@ -1789,8 +1775,7 @@ const deserializeAws_json1_1GetThirdPartyJobDetailsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidClientTokenException": case "com.amazonaws.codepipeline#InvalidClientTokenException": @@ -1868,8 +1853,7 @@ const deserializeAws_json1_1ListActionExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codepipeline#InvalidNextTokenException": @@ -1947,8 +1931,7 @@ const deserializeAws_json1_1ListActionTypesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codepipeline#InvalidNextTokenException": @@ -2010,8 +1993,7 @@ const deserializeAws_json1_1ListPipelineExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codepipeline#InvalidNextTokenException": @@ -2081,8 +2063,7 @@ const deserializeAws_json1_1ListPipelinesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codepipeline#InvalidNextTokenException": @@ -2144,8 +2125,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.codepipeline#InvalidArnException": @@ -2223,8 +2203,7 @@ const deserializeAws_json1_1ListWebhooksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codepipeline#InvalidNextTokenException": @@ -2286,8 +2265,7 @@ const deserializeAws_json1_1PollForJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActionTypeNotFoundException": case "com.amazonaws.codepipeline#ActionTypeNotFoundException": @@ -2349,8 +2327,7 @@ const deserializeAws_json1_1PollForThirdPartyJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActionTypeNotFoundException": case "com.amazonaws.codepipeline#ActionTypeNotFoundException": @@ -2412,8 +2389,7 @@ const deserializeAws_json1_1PutActionRevisionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActionNotFoundException": case "com.amazonaws.codepipeline#ActionNotFoundException": @@ -2491,8 +2467,7 @@ const deserializeAws_json1_1PutApprovalResultCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActionNotFoundException": case "com.amazonaws.codepipeline#ActionNotFoundException": @@ -2583,8 +2558,7 @@ const deserializeAws_json1_1PutJobFailureResultCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidJobStateException": case "com.amazonaws.codepipeline#InvalidJobStateException": @@ -2651,8 +2625,7 @@ const deserializeAws_json1_1PutJobSuccessResultCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidJobStateException": case "com.amazonaws.codepipeline#InvalidJobStateException": @@ -2727,8 +2700,7 @@ const deserializeAws_json1_1PutThirdPartyJobFailureResultCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidClientTokenException": case "com.amazonaws.codepipeline#InvalidClientTokenException": @@ -2803,8 +2775,7 @@ const deserializeAws_json1_1PutThirdPartyJobSuccessResultCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidClientTokenException": case "com.amazonaws.codepipeline#InvalidClientTokenException": @@ -2882,8 +2853,7 @@ const deserializeAws_json1_1PutWebhookCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codepipeline#ConcurrentModificationException": @@ -2993,8 +2963,7 @@ const deserializeAws_json1_1RegisterWebhookWithThirdPartyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ValidationException": case "com.amazonaws.codepipeline#ValidationException": @@ -3056,8 +3025,7 @@ const deserializeAws_json1_1RetryStageExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.codepipeline#ConflictException": @@ -3151,8 +3119,7 @@ const deserializeAws_json1_1StartPipelineExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.codepipeline#ConflictException": @@ -3222,8 +3189,7 @@ const deserializeAws_json1_1StopPipelineExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.codepipeline#ConflictException": @@ -3309,8 +3275,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codepipeline#ConcurrentModificationException": @@ -3404,8 +3369,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codepipeline#ConcurrentModificationException": @@ -3491,8 +3455,7 @@ const deserializeAws_json1_1UpdatePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidActionDeclarationException": case "com.amazonaws.codepipeline#InvalidActionDeclarationException": @@ -4086,8 +4049,8 @@ const deserializeAws_json1_1WebhookNotFoundExceptionResponse = async ( const serializeAws_json1_1AcknowledgeJobInput = (input: AcknowledgeJobInput, context: __SerdeContext): any => { return { - ...(input.jobId !== undefined && { jobId: input.jobId }), - ...(input.nonce !== undefined && { nonce: input.nonce }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), + ...(input.nonce !== undefined && input.nonce !== null && { nonce: input.nonce }), }; }; @@ -4096,20 +4059,22 @@ const serializeAws_json1_1AcknowledgeThirdPartyJobInput = ( context: __SerdeContext ): any => { return { - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.jobId !== undefined && { jobId: input.jobId }), - ...(input.nonce !== undefined && { nonce: input.nonce }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), + ...(input.nonce !== undefined && input.nonce !== null && { nonce: input.nonce }), }; }; const serializeAws_json1_1ActionConfigurationMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ActionConfigurationProperty = ( @@ -4117,13 +4082,13 @@ const serializeAws_json1_1ActionConfigurationProperty = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.key !== undefined && { key: input.key }), - ...(input.name !== undefined && { name: input.name }), - ...(input.queryable !== undefined && { queryable: input.queryable }), - ...(input.required !== undefined && { required: input.required }), - ...(input.secret !== undefined && { secret: input.secret }), - ...(input.type !== undefined && { type: input.type }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.queryable !== undefined && input.queryable !== null && { queryable: input.queryable }), + ...(input.required !== undefined && input.required !== null && { required: input.required }), + ...(input.secret !== undefined && input.secret !== null && { secret: input.secret }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -4131,86 +4096,101 @@ const serializeAws_json1_1ActionConfigurationPropertyList = ( input: ActionConfigurationProperty[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ActionConfigurationProperty(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ActionConfigurationProperty(entry, context); + }); }; const serializeAws_json1_1ActionDeclaration = (input: ActionDeclaration, context: __SerdeContext): any => { return { - ...(input.actionTypeId !== undefined && { - actionTypeId: serializeAws_json1_1ActionTypeId(input.actionTypeId, context), - }), - ...(input.configuration !== undefined && { - configuration: serializeAws_json1_1ActionConfigurationMap(input.configuration, context), - }), - ...(input.inputArtifacts !== undefined && { - inputArtifacts: serializeAws_json1_1InputArtifactList(input.inputArtifacts, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.namespace !== undefined && { namespace: input.namespace }), - ...(input.outputArtifacts !== undefined && { - outputArtifacts: serializeAws_json1_1OutputArtifactList(input.outputArtifacts, context), - }), - ...(input.region !== undefined && { region: input.region }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.runOrder !== undefined && { runOrder: input.runOrder }), + ...(input.actionTypeId !== undefined && + input.actionTypeId !== null && { actionTypeId: serializeAws_json1_1ActionTypeId(input.actionTypeId, context) }), + ...(input.configuration !== undefined && + input.configuration !== null && { + configuration: serializeAws_json1_1ActionConfigurationMap(input.configuration, context), + }), + ...(input.inputArtifacts !== undefined && + input.inputArtifacts !== null && { + inputArtifacts: serializeAws_json1_1InputArtifactList(input.inputArtifacts, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.namespace !== undefined && input.namespace !== null && { namespace: input.namespace }), + ...(input.outputArtifacts !== undefined && + input.outputArtifacts !== null && { + outputArtifacts: serializeAws_json1_1OutputArtifactList(input.outputArtifacts, context), + }), + ...(input.region !== undefined && input.region !== null && { region: input.region }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.runOrder !== undefined && input.runOrder !== null && { runOrder: input.runOrder }), }; }; const serializeAws_json1_1ActionExecutionFilter = (input: ActionExecutionFilter, context: __SerdeContext): any => { return { - ...(input.pipelineExecutionId !== undefined && { pipelineExecutionId: input.pipelineExecutionId }), + ...(input.pipelineExecutionId !== undefined && + input.pipelineExecutionId !== null && { pipelineExecutionId: input.pipelineExecutionId }), }; }; const serializeAws_json1_1ActionRevision = (input: ActionRevision, context: __SerdeContext): any => { return { - ...(input.created !== undefined && { created: Math.round(input.created.getTime() / 1000) }), - ...(input.revisionChangeId !== undefined && { revisionChangeId: input.revisionChangeId }), - ...(input.revisionId !== undefined && { revisionId: input.revisionId }), + ...(input.created !== undefined && + input.created !== null && { created: Math.round(input.created.getTime() / 1000) }), + ...(input.revisionChangeId !== undefined && + input.revisionChangeId !== null && { revisionChangeId: input.revisionChangeId }), + ...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }), }; }; const serializeAws_json1_1ActionTypeId = (input: ActionTypeId, context: __SerdeContext): any => { return { - ...(input.category !== undefined && { category: input.category }), - ...(input.owner !== undefined && { owner: input.owner }), - ...(input.provider !== undefined && { provider: input.provider }), - ...(input.version !== undefined && { version: input.version }), + ...(input.category !== undefined && input.category !== null && { category: input.category }), + ...(input.owner !== undefined && input.owner !== null && { owner: input.owner }), + ...(input.provider !== undefined && input.provider !== null && { provider: input.provider }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_json1_1ActionTypeSettings = (input: ActionTypeSettings, context: __SerdeContext): any => { return { - ...(input.entityUrlTemplate !== undefined && { entityUrlTemplate: input.entityUrlTemplate }), - ...(input.executionUrlTemplate !== undefined && { executionUrlTemplate: input.executionUrlTemplate }), - ...(input.revisionUrlTemplate !== undefined && { revisionUrlTemplate: input.revisionUrlTemplate }), - ...(input.thirdPartyConfigurationUrl !== undefined && { - thirdPartyConfigurationUrl: input.thirdPartyConfigurationUrl, - }), + ...(input.entityUrlTemplate !== undefined && + input.entityUrlTemplate !== null && { entityUrlTemplate: input.entityUrlTemplate }), + ...(input.executionUrlTemplate !== undefined && + input.executionUrlTemplate !== null && { executionUrlTemplate: input.executionUrlTemplate }), + ...(input.revisionUrlTemplate !== undefined && + input.revisionUrlTemplate !== null && { revisionUrlTemplate: input.revisionUrlTemplate }), + ...(input.thirdPartyConfigurationUrl !== undefined && + input.thirdPartyConfigurationUrl !== null && { thirdPartyConfigurationUrl: input.thirdPartyConfigurationUrl }), }; }; const serializeAws_json1_1ApprovalResult = (input: ApprovalResult, context: __SerdeContext): any => { return { - ...(input.status !== undefined && { status: input.status }), - ...(input.summary !== undefined && { summary: input.summary }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.summary !== undefined && input.summary !== null && { summary: input.summary }), }; }; const serializeAws_json1_1ArtifactDetails = (input: ArtifactDetails, context: __SerdeContext): any => { return { - ...(input.maximumCount !== undefined && { maximumCount: input.maximumCount }), - ...(input.minimumCount !== undefined && { minimumCount: input.minimumCount }), + ...(input.maximumCount !== undefined && input.maximumCount !== null && { maximumCount: input.maximumCount }), + ...(input.minimumCount !== undefined && input.minimumCount !== null && { minimumCount: input.minimumCount }), }; }; const serializeAws_json1_1ArtifactStore = (input: ArtifactStore, context: __SerdeContext): any => { return { - ...(input.encryptionKey !== undefined && { - encryptionKey: serializeAws_json1_1EncryptionKey(input.encryptionKey, context), - }), - ...(input.location !== undefined && { location: input.location }), - ...(input.type !== undefined && { type: input.type }), + ...(input.encryptionKey !== undefined && + input.encryptionKey !== null && { + encryptionKey: serializeAws_json1_1EncryptionKey(input.encryptionKey, context), + }), + ...(input.location !== undefined && input.location !== null && { location: input.location }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -4218,19 +4198,21 @@ const serializeAws_json1_1ArtifactStoreMap = ( input: { [key: string]: ArtifactStore }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: ArtifactStore }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: ArtifactStore }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1ArtifactStore(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1BlockerDeclaration = (input: BlockerDeclaration, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.type !== undefined && { type: input.type }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -4239,39 +4221,47 @@ const serializeAws_json1_1CreateCustomActionTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.category !== undefined && { category: input.category }), - ...(input.configurationProperties !== undefined && { - configurationProperties: serializeAws_json1_1ActionConfigurationPropertyList( - input.configurationProperties, - context - ), - }), - ...(input.inputArtifactDetails !== undefined && { - inputArtifactDetails: serializeAws_json1_1ArtifactDetails(input.inputArtifactDetails, context), - }), - ...(input.outputArtifactDetails !== undefined && { - outputArtifactDetails: serializeAws_json1_1ArtifactDetails(input.outputArtifactDetails, context), - }), - ...(input.provider !== undefined && { provider: input.provider }), - ...(input.settings !== undefined && { settings: serializeAws_json1_1ActionTypeSettings(input.settings, context) }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.version !== undefined && { version: input.version }), + ...(input.category !== undefined && input.category !== null && { category: input.category }), + ...(input.configurationProperties !== undefined && + input.configurationProperties !== null && { + configurationProperties: serializeAws_json1_1ActionConfigurationPropertyList( + input.configurationProperties, + context + ), + }), + ...(input.inputArtifactDetails !== undefined && + input.inputArtifactDetails !== null && { + inputArtifactDetails: serializeAws_json1_1ArtifactDetails(input.inputArtifactDetails, context), + }), + ...(input.outputArtifactDetails !== undefined && + input.outputArtifactDetails !== null && { + outputArtifactDetails: serializeAws_json1_1ArtifactDetails(input.outputArtifactDetails, context), + }), + ...(input.provider !== undefined && input.provider !== null && { provider: input.provider }), + ...(input.settings !== undefined && + input.settings !== null && { settings: serializeAws_json1_1ActionTypeSettings(input.settings, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_json1_1CreatePipelineInput = (input: CreatePipelineInput, context: __SerdeContext): any => { return { - ...(input.pipeline !== undefined && { pipeline: serializeAws_json1_1PipelineDeclaration(input.pipeline, context) }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.pipeline !== undefined && + input.pipeline !== null && { pipeline: serializeAws_json1_1PipelineDeclaration(input.pipeline, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1CurrentRevision = (input: CurrentRevision, context: __SerdeContext): any => { return { - ...(input.changeIdentifier !== undefined && { changeIdentifier: input.changeIdentifier }), - ...(input.created !== undefined && { created: Math.round(input.created.getTime() / 1000) }), - ...(input.revision !== undefined && { revision: input.revision }), - ...(input.revisionSummary !== undefined && { revisionSummary: input.revisionSummary }), + ...(input.changeIdentifier !== undefined && + input.changeIdentifier !== null && { changeIdentifier: input.changeIdentifier }), + ...(input.created !== undefined && + input.created !== null && { created: Math.round(input.created.getTime() / 1000) }), + ...(input.revision !== undefined && input.revision !== null && { revision: input.revision }), + ...(input.revisionSummary !== undefined && + input.revisionSummary !== null && { revisionSummary: input.revisionSummary }), }; }; @@ -4280,21 +4270,21 @@ const serializeAws_json1_1DeleteCustomActionTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.category !== undefined && { category: input.category }), - ...(input.provider !== undefined && { provider: input.provider }), - ...(input.version !== undefined && { version: input.version }), + ...(input.category !== undefined && input.category !== null && { category: input.category }), + ...(input.provider !== undefined && input.provider !== null && { provider: input.provider }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_json1_1DeletePipelineInput = (input: DeletePipelineInput, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1DeleteWebhookInput = (input: DeleteWebhookInput, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -4303,7 +4293,7 @@ const serializeAws_json1_1DeregisterWebhookWithThirdPartyInput = ( context: __SerdeContext ): any => { return { - ...(input.webhookName !== undefined && { webhookName: input.webhookName }), + ...(input.webhookName !== undefined && input.webhookName !== null && { webhookName: input.webhookName }), }; }; @@ -4312,10 +4302,11 @@ const serializeAws_json1_1DisableStageTransitionInput = ( context: __SerdeContext ): any => { return { - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), - ...(input.reason !== undefined && { reason: input.reason }), - ...(input.stageName !== undefined && { stageName: input.stageName }), - ...(input.transitionType !== undefined && { transitionType: input.transitionType }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), + ...(input.stageName !== undefined && input.stageName !== null && { stageName: input.stageName }), + ...(input.transitionType !== undefined && + input.transitionType !== null && { transitionType: input.transitionType }), }; }; @@ -4324,38 +4315,42 @@ const serializeAws_json1_1EnableStageTransitionInput = ( context: __SerdeContext ): any => { return { - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), - ...(input.stageName !== undefined && { stageName: input.stageName }), - ...(input.transitionType !== undefined && { transitionType: input.transitionType }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), + ...(input.stageName !== undefined && input.stageName !== null && { stageName: input.stageName }), + ...(input.transitionType !== undefined && + input.transitionType !== null && { transitionType: input.transitionType }), }; }; const serializeAws_json1_1EncryptionKey = (input: EncryptionKey, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.type !== undefined && { type: input.type }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1ExecutionDetails = (input: ExecutionDetails, context: __SerdeContext): any => { return { - ...(input.externalExecutionId !== undefined && { externalExecutionId: input.externalExecutionId }), - ...(input.percentComplete !== undefined && { percentComplete: input.percentComplete }), - ...(input.summary !== undefined && { summary: input.summary }), + ...(input.externalExecutionId !== undefined && + input.externalExecutionId !== null && { externalExecutionId: input.externalExecutionId }), + ...(input.percentComplete !== undefined && + input.percentComplete !== null && { percentComplete: input.percentComplete }), + ...(input.summary !== undefined && input.summary !== null && { summary: input.summary }), }; }; const serializeAws_json1_1FailureDetails = (input: FailureDetails, context: __SerdeContext): any => { return { - ...(input.externalExecutionId !== undefined && { externalExecutionId: input.externalExecutionId }), - ...(input.message !== undefined && { message: input.message }), - ...(input.type !== undefined && { type: input.type }), + ...(input.externalExecutionId !== undefined && + input.externalExecutionId !== null && { externalExecutionId: input.externalExecutionId }), + ...(input.message !== undefined && input.message !== null && { message: input.message }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1GetJobDetailsInput = (input: GetJobDetailsInput, context: __SerdeContext): any => { return { - ...(input.jobId !== undefined && { jobId: input.jobId }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), }; }; @@ -4364,21 +4359,22 @@ const serializeAws_json1_1GetPipelineExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.pipelineExecutionId !== undefined && { pipelineExecutionId: input.pipelineExecutionId }), - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), + ...(input.pipelineExecutionId !== undefined && + input.pipelineExecutionId !== null && { pipelineExecutionId: input.pipelineExecutionId }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), }; }; const serializeAws_json1_1GetPipelineInput = (input: GetPipelineInput, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_json1_1GetPipelineStateInput = (input: GetPipelineStateInput, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -4387,19 +4383,26 @@ const serializeAws_json1_1GetThirdPartyJobDetailsInput = ( context: __SerdeContext ): any => { return { - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.jobId !== undefined && { jobId: input.jobId }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), }; }; const serializeAws_json1_1InputArtifact = (input: InputArtifact, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1InputArtifactList = (input: InputArtifact[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InputArtifact(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InputArtifact(entry, context); + }); }; const serializeAws_json1_1ListActionExecutionsInput = ( @@ -4407,17 +4410,19 @@ const serializeAws_json1_1ListActionExecutionsInput = ( context: __SerdeContext ): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1ActionExecutionFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1ActionExecutionFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), }; }; const serializeAws_json1_1ListActionTypesInput = (input: ListActionTypesInput, context: __SerdeContext): any => { return { - ...(input.actionOwnerFilter !== undefined && { actionOwnerFilter: input.actionOwnerFilter }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.actionOwnerFilter !== undefined && + input.actionOwnerFilter !== null && { actionOwnerFilter: input.actionOwnerFilter }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4426,15 +4431,15 @@ const serializeAws_json1_1ListPipelineExecutionsInput = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), }; }; const serializeAws_json1_1ListPipelinesInput = (input: ListPipelinesInput, context: __SerdeContext): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4443,67 +4448,84 @@ const serializeAws_json1_1ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_1ListWebhooksInput = (input: ListWebhooksInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1OutputArtifact = (input: OutputArtifact, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1OutputArtifactList = (input: OutputArtifact[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OutputArtifact(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OutputArtifact(entry, context); + }); }; const serializeAws_json1_1OutputVariablesMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1PipelineDeclaration = (input: PipelineDeclaration, context: __SerdeContext): any => { return { - ...(input.artifactStore !== undefined && { - artifactStore: serializeAws_json1_1ArtifactStore(input.artifactStore, context), - }), - ...(input.artifactStores !== undefined && { - artifactStores: serializeAws_json1_1ArtifactStoreMap(input.artifactStores, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.stages !== undefined && { - stages: serializeAws_json1_1PipelineStageDeclarationList(input.stages, context), - }), - ...(input.version !== undefined && { version: input.version }), + ...(input.artifactStore !== undefined && + input.artifactStore !== null && { + artifactStore: serializeAws_json1_1ArtifactStore(input.artifactStore, context), + }), + ...(input.artifactStores !== undefined && + input.artifactStores !== null && { + artifactStores: serializeAws_json1_1ArtifactStoreMap(input.artifactStores, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.stages !== undefined && + input.stages !== null && { stages: serializeAws_json1_1PipelineStageDeclarationList(input.stages, context) }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_json1_1PipelineStageDeclarationList = (input: StageDeclaration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1StageDeclaration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1StageDeclaration(entry, context); + }); }; const serializeAws_json1_1PollForJobsInput = (input: PollForJobsInput, context: __SerdeContext): any => { return { - ...(input.actionTypeId !== undefined && { - actionTypeId: serializeAws_json1_1ActionTypeId(input.actionTypeId, context), - }), - ...(input.maxBatchSize !== undefined && { maxBatchSize: input.maxBatchSize }), - ...(input.queryParam !== undefined && { queryParam: serializeAws_json1_1QueryParamMap(input.queryParam, context) }), + ...(input.actionTypeId !== undefined && + input.actionTypeId !== null && { actionTypeId: serializeAws_json1_1ActionTypeId(input.actionTypeId, context) }), + ...(input.maxBatchSize !== undefined && input.maxBatchSize !== null && { maxBatchSize: input.maxBatchSize }), + ...(input.queryParam !== undefined && + input.queryParam !== null && { queryParam: serializeAws_json1_1QueryParamMap(input.queryParam, context) }), }; }; @@ -4512,31 +4534,32 @@ const serializeAws_json1_1PollForThirdPartyJobsInput = ( context: __SerdeContext ): any => { return { - ...(input.actionTypeId !== undefined && { - actionTypeId: serializeAws_json1_1ActionTypeId(input.actionTypeId, context), - }), - ...(input.maxBatchSize !== undefined && { maxBatchSize: input.maxBatchSize }), + ...(input.actionTypeId !== undefined && + input.actionTypeId !== null && { actionTypeId: serializeAws_json1_1ActionTypeId(input.actionTypeId, context) }), + ...(input.maxBatchSize !== undefined && input.maxBatchSize !== null && { maxBatchSize: input.maxBatchSize }), }; }; const serializeAws_json1_1PutActionRevisionInput = (input: PutActionRevisionInput, context: __SerdeContext): any => { return { - ...(input.actionName !== undefined && { actionName: input.actionName }), - ...(input.actionRevision !== undefined && { - actionRevision: serializeAws_json1_1ActionRevision(input.actionRevision, context), - }), - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), - ...(input.stageName !== undefined && { stageName: input.stageName }), + ...(input.actionName !== undefined && input.actionName !== null && { actionName: input.actionName }), + ...(input.actionRevision !== undefined && + input.actionRevision !== null && { + actionRevision: serializeAws_json1_1ActionRevision(input.actionRevision, context), + }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), + ...(input.stageName !== undefined && input.stageName !== null && { stageName: input.stageName }), }; }; const serializeAws_json1_1PutApprovalResultInput = (input: PutApprovalResultInput, context: __SerdeContext): any => { return { - ...(input.actionName !== undefined && { actionName: input.actionName }), - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), - ...(input.result !== undefined && { result: serializeAws_json1_1ApprovalResult(input.result, context) }), - ...(input.stageName !== undefined && { stageName: input.stageName }), - ...(input.token !== undefined && { token: input.token }), + ...(input.actionName !== undefined && input.actionName !== null && { actionName: input.actionName }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), + ...(input.result !== undefined && + input.result !== null && { result: serializeAws_json1_1ApprovalResult(input.result, context) }), + ...(input.stageName !== undefined && input.stageName !== null && { stageName: input.stageName }), + ...(input.token !== undefined && input.token !== null && { token: input.token }), }; }; @@ -4545,10 +4568,11 @@ const serializeAws_json1_1PutJobFailureResultInput = ( context: __SerdeContext ): any => { return { - ...(input.failureDetails !== undefined && { - failureDetails: serializeAws_json1_1FailureDetails(input.failureDetails, context), - }), - ...(input.jobId !== undefined && { jobId: input.jobId }), + ...(input.failureDetails !== undefined && + input.failureDetails !== null && { + failureDetails: serializeAws_json1_1FailureDetails(input.failureDetails, context), + }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), }; }; @@ -4557,17 +4581,21 @@ const serializeAws_json1_1PutJobSuccessResultInput = ( context: __SerdeContext ): any => { return { - ...(input.continuationToken !== undefined && { continuationToken: input.continuationToken }), - ...(input.currentRevision !== undefined && { - currentRevision: serializeAws_json1_1CurrentRevision(input.currentRevision, context), - }), - ...(input.executionDetails !== undefined && { - executionDetails: serializeAws_json1_1ExecutionDetails(input.executionDetails, context), - }), - ...(input.jobId !== undefined && { jobId: input.jobId }), - ...(input.outputVariables !== undefined && { - outputVariables: serializeAws_json1_1OutputVariablesMap(input.outputVariables, context), - }), + ...(input.continuationToken !== undefined && + input.continuationToken !== null && { continuationToken: input.continuationToken }), + ...(input.currentRevision !== undefined && + input.currentRevision !== null && { + currentRevision: serializeAws_json1_1CurrentRevision(input.currentRevision, context), + }), + ...(input.executionDetails !== undefined && + input.executionDetails !== null && { + executionDetails: serializeAws_json1_1ExecutionDetails(input.executionDetails, context), + }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), + ...(input.outputVariables !== undefined && + input.outputVariables !== null && { + outputVariables: serializeAws_json1_1OutputVariablesMap(input.outputVariables, context), + }), }; }; @@ -4576,11 +4604,12 @@ const serializeAws_json1_1PutThirdPartyJobFailureResultInput = ( context: __SerdeContext ): any => { return { - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.failureDetails !== undefined && { - failureDetails: serializeAws_json1_1FailureDetails(input.failureDetails, context), - }), - ...(input.jobId !== undefined && { jobId: input.jobId }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.failureDetails !== undefined && + input.failureDetails !== null && { + failureDetails: serializeAws_json1_1FailureDetails(input.failureDetails, context), + }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), }; }; @@ -4589,33 +4618,39 @@ const serializeAws_json1_1PutThirdPartyJobSuccessResultInput = ( context: __SerdeContext ): any => { return { - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.continuationToken !== undefined && { continuationToken: input.continuationToken }), - ...(input.currentRevision !== undefined && { - currentRevision: serializeAws_json1_1CurrentRevision(input.currentRevision, context), - }), - ...(input.executionDetails !== undefined && { - executionDetails: serializeAws_json1_1ExecutionDetails(input.executionDetails, context), - }), - ...(input.jobId !== undefined && { jobId: input.jobId }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.continuationToken !== undefined && + input.continuationToken !== null && { continuationToken: input.continuationToken }), + ...(input.currentRevision !== undefined && + input.currentRevision !== null && { + currentRevision: serializeAws_json1_1CurrentRevision(input.currentRevision, context), + }), + ...(input.executionDetails !== undefined && + input.executionDetails !== null && { + executionDetails: serializeAws_json1_1ExecutionDetails(input.executionDetails, context), + }), + ...(input.jobId !== undefined && input.jobId !== null && { jobId: input.jobId }), }; }; const serializeAws_json1_1PutWebhookInput = (input: PutWebhookInput, context: __SerdeContext): any => { return { - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.webhook !== undefined && { webhook: serializeAws_json1_1WebhookDefinition(input.webhook, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.webhook !== undefined && + input.webhook !== null && { webhook: serializeAws_json1_1WebhookDefinition(input.webhook, context) }), }; }; const serializeAws_json1_1QueryParamMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1RegisterWebhookWithThirdPartyInput = ( @@ -4623,7 +4658,7 @@ const serializeAws_json1_1RegisterWebhookWithThirdPartyInput = ( context: __SerdeContext ): any => { return { - ...(input.webhookName !== undefined && { webhookName: input.webhookName }), + ...(input.webhookName !== undefined && input.webhookName !== null && { webhookName: input.webhookName }), }; }; @@ -4632,30 +4667,45 @@ const serializeAws_json1_1RetryStageExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.pipelineExecutionId !== undefined && { pipelineExecutionId: input.pipelineExecutionId }), - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), - ...(input.retryMode !== undefined && { retryMode: input.retryMode }), - ...(input.stageName !== undefined && { stageName: input.stageName }), + ...(input.pipelineExecutionId !== undefined && + input.pipelineExecutionId !== null && { pipelineExecutionId: input.pipelineExecutionId }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), + ...(input.retryMode !== undefined && input.retryMode !== null && { retryMode: input.retryMode }), + ...(input.stageName !== undefined && input.stageName !== null && { stageName: input.stageName }), }; }; const serializeAws_json1_1StageActionDeclarationList = (input: ActionDeclaration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ActionDeclaration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ActionDeclaration(entry, context); + }); }; const serializeAws_json1_1StageBlockerDeclarationList = (input: BlockerDeclaration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1BlockerDeclaration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1BlockerDeclaration(entry, context); + }); }; const serializeAws_json1_1StageDeclaration = (input: StageDeclaration, context: __SerdeContext): any => { return { - ...(input.actions !== undefined && { - actions: serializeAws_json1_1StageActionDeclarationList(input.actions, context), - }), - ...(input.blockers !== undefined && { - blockers: serializeAws_json1_1StageBlockerDeclarationList(input.blockers, context), - }), - ...(input.name !== undefined && { name: input.name }), + ...(input.actions !== undefined && + input.actions !== null && { actions: serializeAws_json1_1StageActionDeclarationList(input.actions, context) }), + ...(input.blockers !== undefined && + input.blockers !== null && { + blockers: serializeAws_json1_1StageBlockerDeclarationList(input.blockers, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -4665,7 +4715,7 @@ const serializeAws_json1_1StartPipelineExecutionInput = ( ): any => { return { clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -4674,45 +4724,62 @@ const serializeAws_json1_1StopPipelineExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.abandon !== undefined && { abandon: input.abandon }), - ...(input.pipelineExecutionId !== undefined && { pipelineExecutionId: input.pipelineExecutionId }), - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), - ...(input.reason !== undefined && { reason: input.reason }), + ...(input.abandon !== undefined && input.abandon !== null && { abandon: input.abandon }), + ...(input.pipelineExecutionId !== undefined && + input.pipelineExecutionId !== null && { pipelineExecutionId: input.pipelineExecutionId }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), }; }; const serializeAws_json1_1UpdatePipelineInput = (input: UpdatePipelineInput, context: __SerdeContext): any => { return { - ...(input.pipeline !== undefined && { pipeline: serializeAws_json1_1PipelineDeclaration(input.pipeline, context) }), + ...(input.pipeline !== undefined && + input.pipeline !== null && { pipeline: serializeAws_json1_1PipelineDeclaration(input.pipeline, context) }), }; }; @@ -4721,36 +4788,48 @@ const serializeAws_json1_1WebhookAuthConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AllowedIPRange !== undefined && { AllowedIPRange: input.AllowedIPRange }), - ...(input.SecretToken !== undefined && { SecretToken: input.SecretToken }), + ...(input.AllowedIPRange !== undefined && + input.AllowedIPRange !== null && { AllowedIPRange: input.AllowedIPRange }), + ...(input.SecretToken !== undefined && input.SecretToken !== null && { SecretToken: input.SecretToken }), }; }; const serializeAws_json1_1WebhookDefinition = (input: WebhookDefinition, context: __SerdeContext): any => { return { - ...(input.authentication !== undefined && { authentication: input.authentication }), - ...(input.authenticationConfiguration !== undefined && { - authenticationConfiguration: serializeAws_json1_1WebhookAuthConfiguration( - input.authenticationConfiguration, - context - ), - }), - ...(input.filters !== undefined && { filters: serializeAws_json1_1WebhookFilters(input.filters, context) }), - ...(input.name !== undefined && { name: input.name }), - ...(input.targetAction !== undefined && { targetAction: input.targetAction }), - ...(input.targetPipeline !== undefined && { targetPipeline: input.targetPipeline }), + ...(input.authentication !== undefined && + input.authentication !== null && { authentication: input.authentication }), + ...(input.authenticationConfiguration !== undefined && + input.authenticationConfiguration !== null && { + authenticationConfiguration: serializeAws_json1_1WebhookAuthConfiguration( + input.authenticationConfiguration, + context + ), + }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1WebhookFilters(input.filters, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.targetAction !== undefined && input.targetAction !== null && { targetAction: input.targetAction }), + ...(input.targetPipeline !== undefined && + input.targetPipeline !== null && { targetPipeline: input.targetPipeline }), }; }; const serializeAws_json1_1WebhookFilterRule = (input: WebhookFilterRule, context: __SerdeContext): any => { return { - ...(input.jsonPath !== undefined && { jsonPath: input.jsonPath }), - ...(input.matchEquals !== undefined && { matchEquals: input.matchEquals }), + ...(input.jsonPath !== undefined && input.jsonPath !== null && { jsonPath: input.jsonPath }), + ...(input.matchEquals !== undefined && input.matchEquals !== null && { matchEquals: input.matchEquals }), }; }; const serializeAws_json1_1WebhookFilters = (input: WebhookFilterRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1WebhookFilterRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1WebhookFilterRule(entry, context); + }); }; const deserializeAws_json1_1AcknowledgeJobOutput = (output: any, context: __SerdeContext): AcknowledgeJobOutput => { @@ -4781,13 +4860,15 @@ const deserializeAws_json1_1ActionConfigurationMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ActionConfigurationProperty = ( @@ -4809,7 +4890,14 @@ const deserializeAws_json1_1ActionConfigurationPropertyList = ( output: any, context: __SerdeContext ): ActionConfigurationProperty[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ActionConfigurationProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ActionConfigurationProperty(entry, context); + }); }; const deserializeAws_json1_1ActionContext = (output: any, context: __SerdeContext): ActionContext => { @@ -4918,7 +5006,14 @@ const deserializeAws_json1_1ActionExecutionDetailList = ( output: any, context: __SerdeContext ): ActionExecutionDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ActionExecutionDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ActionExecutionDetail(entry, context); + }); }; const deserializeAws_json1_1ActionExecutionInput = (output: any, context: __SerdeContext): ActionExecutionInput => { @@ -5015,7 +5110,14 @@ const deserializeAws_json1_1ActionState = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ActionStateList = (output: any, context: __SerdeContext): ActionState[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ActionState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ActionState(entry, context); + }); }; const deserializeAws_json1_1ActionType = (output: any, context: __SerdeContext): ActionType => { @@ -5053,7 +5155,14 @@ const deserializeAws_json1_1ActionTypeId = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ActionTypeList = (output: any, context: __SerdeContext): ActionType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ActionType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ActionType(entry, context); + }); }; const deserializeAws_json1_1ActionTypeNotFoundException = ( @@ -5117,7 +5226,14 @@ const deserializeAws_json1_1ArtifactDetail = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ArtifactDetailList = (output: any, context: __SerdeContext): ArtifactDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ArtifactDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ArtifactDetail(entry, context); + }); }; const deserializeAws_json1_1ArtifactDetails = (output: any, context: __SerdeContext): ArtifactDetails => { @@ -5128,7 +5244,14 @@ const deserializeAws_json1_1ArtifactDetails = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ArtifactList = (output: any, context: __SerdeContext): Artifact[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Artifact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Artifact(entry, context); + }); }; const deserializeAws_json1_1ArtifactLocation = (output: any, context: __SerdeContext): ArtifactLocation => { @@ -5158,7 +5281,14 @@ const deserializeAws_json1_1ArtifactRevision = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ArtifactRevisionList = (output: any, context: __SerdeContext): ArtifactRevision[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ArtifactRevision(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ArtifactRevision(entry, context); + }); }; const deserializeAws_json1_1ArtifactStore = (output: any, context: __SerdeContext): ArtifactStore => { @@ -5176,13 +5306,15 @@ const deserializeAws_json1_1ArtifactStoreMap = ( output: any, context: __SerdeContext ): { [key: string]: ArtifactStore } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ArtifactStore }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ArtifactStore }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1ArtifactStore(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1AWSSessionCredentials = (output: any, context: __SerdeContext): AWSSessionCredentials => { @@ -5356,7 +5488,14 @@ const deserializeAws_json1_1InputArtifact = (output: any, context: __SerdeContex }; const deserializeAws_json1_1InputArtifactList = (output: any, context: __SerdeContext): InputArtifact[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InputArtifact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InputArtifact(entry, context); + }); }; const deserializeAws_json1_1InvalidActionDeclarationException = ( @@ -5534,7 +5673,14 @@ const deserializeAws_json1_1JobDetails = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1JobList = (output: any, context: __SerdeContext): Job[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Job(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Job(entry, context); + }); }; const deserializeAws_json1_1JobNotFoundException = (output: any, context: __SerdeContext): JobNotFoundException => { @@ -5655,17 +5801,26 @@ const deserializeAws_json1_1OutputArtifact = (output: any, context: __SerdeConte }; const deserializeAws_json1_1OutputArtifactList = (output: any, context: __SerdeContext): OutputArtifact[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OutputArtifact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OutputArtifact(entry, context); + }); }; const deserializeAws_json1_1OutputVariablesMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1OutputVariablesSizeExceededException = ( @@ -5788,11 +5943,25 @@ const deserializeAws_json1_1PipelineExecutionSummaryList = ( output: any, context: __SerdeContext ): PipelineExecutionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PipelineExecutionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PipelineExecutionSummary(entry, context); + }); }; const deserializeAws_json1_1PipelineList = (output: any, context: __SerdeContext): PipelineSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PipelineSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PipelineSummary(entry, context); + }); }; const deserializeAws_json1_1PipelineMetadata = (output: any, context: __SerdeContext): PipelineMetadata => { @@ -5827,7 +5996,14 @@ const deserializeAws_json1_1PipelineStageDeclarationList = ( output: any, context: __SerdeContext ): StageDeclaration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StageDeclaration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StageDeclaration(entry, context); + }); }; const deserializeAws_json1_1PipelineSummary = (output: any, context: __SerdeContext): PipelineSummary => { @@ -5916,13 +6092,15 @@ const deserializeAws_json1_1ResolvedActionConfigurationMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ResourceNotFoundException = ( @@ -5971,21 +6149,42 @@ const deserializeAws_json1_1SourceRevision = (output: any, context: __SerdeConte }; const deserializeAws_json1_1SourceRevisionList = (output: any, context: __SerdeContext): SourceRevision[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SourceRevision(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SourceRevision(entry, context); + }); }; const deserializeAws_json1_1StageActionDeclarationList = ( output: any, context: __SerdeContext ): ActionDeclaration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ActionDeclaration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ActionDeclaration(entry, context); + }); }; const deserializeAws_json1_1StageBlockerDeclarationList = ( output: any, context: __SerdeContext ): BlockerDeclaration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BlockerDeclaration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BlockerDeclaration(entry, context); + }); }; const deserializeAws_json1_1StageContext = (output: any, context: __SerdeContext): StageContext => { @@ -6056,7 +6255,14 @@ const deserializeAws_json1_1StageState = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1StageStateList = (output: any, context: __SerdeContext): StageState[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StageState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StageState(entry, context); + }); }; const deserializeAws_json1_1StartPipelineExecutionOutput = ( @@ -6097,7 +6303,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceOutput = (output: any, context: __SerdeContext): TagResourceOutput => { @@ -6160,7 +6373,14 @@ const deserializeAws_json1_1ThirdPartyJobDetails = (output: any, context: __Serd }; const deserializeAws_json1_1ThirdPartyJobList = (output: any, context: __SerdeContext): ThirdPartyJob[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ThirdPartyJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ThirdPartyJob(entry, context); + }); }; const deserializeAws_json1_1TooManyTagsException = (output: any, context: __SerdeContext): TooManyTagsException => { @@ -6240,11 +6460,25 @@ const deserializeAws_json1_1WebhookFilterRule = (output: any, context: __SerdeCo }; const deserializeAws_json1_1WebhookFilters = (output: any, context: __SerdeContext): WebhookFilterRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WebhookFilterRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WebhookFilterRule(entry, context); + }); }; const deserializeAws_json1_1WebhookList = (output: any, context: __SerdeContext): ListWebhookItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ListWebhookItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ListWebhookItem(entry, context); + }); }; const deserializeAws_json1_1WebhookNotFoundException = ( @@ -6304,3 +6538,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-codestar-connections/protocols/Aws_json1_0.ts b/clients/client-codestar-connections/protocols/Aws_json1_0.ts index 997cdc3b3ccd..12b414e7b1a5 100644 --- a/clients/client-codestar-connections/protocols/Aws_json1_0.ts +++ b/clients/client-codestar-connections/protocols/Aws_json1_0.ts @@ -63,7 +63,7 @@ export const serializeAws_json1_0CreateConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.CreateConnection", }; let body: any; @@ -76,7 +76,7 @@ export const serializeAws_json1_0CreateHostCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.CreateHost", }; let body: any; @@ -89,7 +89,7 @@ export const serializeAws_json1_0DeleteConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.DeleteConnection", }; let body: any; @@ -102,7 +102,7 @@ export const serializeAws_json1_0DeleteHostCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.DeleteHost", }; let body: any; @@ -115,7 +115,7 @@ export const serializeAws_json1_0GetConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.GetConnection", }; let body: any; @@ -128,7 +128,7 @@ export const serializeAws_json1_0GetHostCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.GetHost", }; let body: any; @@ -141,7 +141,7 @@ export const serializeAws_json1_0ListConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.ListConnections", }; let body: any; @@ -154,7 +154,7 @@ export const serializeAws_json1_0ListHostsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.ListHosts", }; let body: any; @@ -167,7 +167,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.ListTagsForResource", }; let body: any; @@ -180,7 +180,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.TagResource", }; let body: any; @@ -193,7 +193,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.UntagResource", }; let body: any; @@ -206,7 +206,7 @@ export const serializeAws_json1_0UpdateHostCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "CodeStar_connections_20191201.UpdateHost", }; let body: any; @@ -241,8 +241,7 @@ const deserializeAws_json1_0CreateConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.codestarconnections#LimitExceededException": @@ -312,8 +311,7 @@ const deserializeAws_json1_0CreateHostCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.codestarconnections#LimitExceededException": @@ -367,8 +365,7 @@ const deserializeAws_json1_0DeleteConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.codestarconnections#ResourceNotFoundException": @@ -422,8 +419,7 @@ const deserializeAws_json1_0DeleteHostCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.codestarconnections#ResourceNotFoundException": @@ -485,8 +481,7 @@ const deserializeAws_json1_0GetConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.codestarconnections#ResourceNotFoundException": @@ -548,8 +543,7 @@ const deserializeAws_json1_0GetHostCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.codestarconnections#ResourceNotFoundException": @@ -611,8 +605,7 @@ const deserializeAws_json1_0ListConnectionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -658,8 +651,7 @@ const deserializeAws_json1_0ListHostsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -705,8 +697,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.codestarconnections#ResourceNotFoundException": @@ -760,8 +751,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.codestarconnections#LimitExceededException": @@ -823,8 +813,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.codestarconnections#ResourceNotFoundException": @@ -878,8 +867,7 @@ const deserializeAws_json1_0UpdateHostCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.codestarconnections#ConflictException": @@ -1007,61 +995,65 @@ const deserializeAws_json1_0UnsupportedOperationExceptionResponse = async ( const serializeAws_json1_0CreateConnectionInput = (input: CreateConnectionInput, context: __SerdeContext): any => { return { - ...(input.ConnectionName !== undefined && { ConnectionName: input.ConnectionName }), - ...(input.HostArn !== undefined && { HostArn: input.HostArn }), - ...(input.ProviderType !== undefined && { ProviderType: input.ProviderType }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.ConnectionName !== undefined && + input.ConnectionName !== null && { ConnectionName: input.ConnectionName }), + ...(input.HostArn !== undefined && input.HostArn !== null && { HostArn: input.HostArn }), + ...(input.ProviderType !== undefined && input.ProviderType !== null && { ProviderType: input.ProviderType }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), }; }; const serializeAws_json1_0CreateHostInput = (input: CreateHostInput, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ProviderEndpoint !== undefined && { ProviderEndpoint: input.ProviderEndpoint }), - ...(input.ProviderType !== undefined && { ProviderType: input.ProviderType }), - ...(input.VpcConfiguration !== undefined && { - VpcConfiguration: serializeAws_json1_0VpcConfiguration(input.VpcConfiguration, context), - }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ProviderEndpoint !== undefined && + input.ProviderEndpoint !== null && { ProviderEndpoint: input.ProviderEndpoint }), + ...(input.ProviderType !== undefined && input.ProviderType !== null && { ProviderType: input.ProviderType }), + ...(input.VpcConfiguration !== undefined && + input.VpcConfiguration !== null && { + VpcConfiguration: serializeAws_json1_0VpcConfiguration(input.VpcConfiguration, context), + }), }; }; const serializeAws_json1_0DeleteConnectionInput = (input: DeleteConnectionInput, context: __SerdeContext): any => { return { - ...(input.ConnectionArn !== undefined && { ConnectionArn: input.ConnectionArn }), + ...(input.ConnectionArn !== undefined && input.ConnectionArn !== null && { ConnectionArn: input.ConnectionArn }), }; }; const serializeAws_json1_0DeleteHostInput = (input: DeleteHostInput, context: __SerdeContext): any => { return { - ...(input.HostArn !== undefined && { HostArn: input.HostArn }), + ...(input.HostArn !== undefined && input.HostArn !== null && { HostArn: input.HostArn }), }; }; const serializeAws_json1_0GetConnectionInput = (input: GetConnectionInput, context: __SerdeContext): any => { return { - ...(input.ConnectionArn !== undefined && { ConnectionArn: input.ConnectionArn }), + ...(input.ConnectionArn !== undefined && input.ConnectionArn !== null && { ConnectionArn: input.ConnectionArn }), }; }; const serializeAws_json1_0GetHostInput = (input: GetHostInput, context: __SerdeContext): any => { return { - ...(input.HostArn !== undefined && { HostArn: input.HostArn }), + ...(input.HostArn !== undefined && input.HostArn !== null && { HostArn: input.HostArn }), }; }; const serializeAws_json1_0ListConnectionsInput = (input: ListConnectionsInput, context: __SerdeContext): any => { return { - ...(input.HostArnFilter !== undefined && { HostArnFilter: input.HostArnFilter }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ProviderTypeFilter !== undefined && { ProviderTypeFilter: input.ProviderTypeFilter }), + ...(input.HostArnFilter !== undefined && input.HostArnFilter !== null && { HostArnFilter: input.HostArnFilter }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ProviderTypeFilter !== undefined && + input.ProviderTypeFilter !== null && { ProviderTypeFilter: input.ProviderTypeFilter }), }; }; const serializeAws_json1_0ListHostsInput = (input: ListHostsInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -1070,65 +1062,99 @@ const serializeAws_json1_0ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_0SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_0TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Tag(entry, context); + }); }; const serializeAws_json1_0TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), }; }; const serializeAws_json1_0UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_0UpdateHostInput = (input: UpdateHostInput, context: __SerdeContext): any => { return { - ...(input.HostArn !== undefined && { HostArn: input.HostArn }), - ...(input.ProviderEndpoint !== undefined && { ProviderEndpoint: input.ProviderEndpoint }), - ...(input.VpcConfiguration !== undefined && { - VpcConfiguration: serializeAws_json1_0VpcConfiguration(input.VpcConfiguration, context), - }), + ...(input.HostArn !== undefined && input.HostArn !== null && { HostArn: input.HostArn }), + ...(input.ProviderEndpoint !== undefined && + input.ProviderEndpoint !== null && { ProviderEndpoint: input.ProviderEndpoint }), + ...(input.VpcConfiguration !== undefined && + input.VpcConfiguration !== null && { + VpcConfiguration: serializeAws_json1_0VpcConfiguration(input.VpcConfiguration, context), + }), }; }; const serializeAws_json1_0VpcConfiguration = (input: VpcConfiguration, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_0SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_0SubnetIds(input.SubnetIds, context) }), - ...(input.TlsCertificate !== undefined && { TlsCertificate: input.TlsCertificate }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_0SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_0SubnetIds(input.SubnetIds, context) }), + ...(input.TlsCertificate !== undefined && + input.TlsCertificate !== null && { TlsCertificate: input.TlsCertificate }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -1154,7 +1180,14 @@ const deserializeAws_json1_0Connection = (output: any, context: __SerdeContext): }; const deserializeAws_json1_0ConnectionList = (output: any, context: __SerdeContext): Connection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Connection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Connection(entry, context); + }); }; const deserializeAws_json1_0CreateConnectionOutput = (output: any, context: __SerdeContext): CreateConnectionOutput => { @@ -1223,7 +1256,14 @@ const deserializeAws_json1_0Host = (output: any, context: __SerdeContext): Host }; const deserializeAws_json1_0HostList = (output: any, context: __SerdeContext): Host[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Host(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Host(entry, context); + }); }; const deserializeAws_json1_0LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -1283,11 +1323,25 @@ const deserializeAws_json1_0ResourceUnavailableException = ( }; const deserializeAws_json1_0SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0Tag = (output: any, context: __SerdeContext): Tag => { @@ -1298,7 +1352,14 @@ const deserializeAws_json1_0Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_0TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Tag(entry, context); + }); }; const deserializeAws_json1_0TagResourceOutput = (output: any, context: __SerdeContext): TagResourceOutput => { @@ -1388,3 +1449,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-codestar-notifications/protocols/Aws_restJson1.ts b/clients/client-codestar-notifications/protocols/Aws_restJson1.ts index 1a847a3d83f1..822438841341 100644 --- a/clients/client-codestar-notifications/protocols/Aws_restJson1.ts +++ b/clients/client-codestar-notifications/protocols/Aws_restJson1.ts @@ -61,21 +61,21 @@ export const serializeAws_restJson1CreateNotificationRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createNotificationRule"; let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DetailType !== undefined && { DetailType: input.DetailType }), - ...(input.EventTypeIds !== undefined && { - EventTypeIds: serializeAws_restJson1EventTypeIds(input.EventTypeIds, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Resource !== undefined && { Resource: input.Resource }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.Targets !== undefined && { Targets: serializeAws_restJson1Targets(input.Targets, context) }), + ...(input.DetailType !== undefined && input.DetailType !== null && { DetailType: input.DetailType }), + ...(input.EventTypeIds !== undefined && + input.EventTypeIds !== null && { EventTypeIds: serializeAws_restJson1EventTypeIds(input.EventTypeIds, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Resource !== undefined && input.Resource !== null && { Resource: input.Resource }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_restJson1Targets(input.Targets, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -94,12 +94,12 @@ export const serializeAws_restJson1DeleteNotificationRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteNotificationRule"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -118,13 +118,14 @@ export const serializeAws_restJson1DeleteTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteTarget"; let body: any; body = JSON.stringify({ - ...(input.ForceUnsubscribeAll !== undefined && { ForceUnsubscribeAll: input.ForceUnsubscribeAll }), - ...(input.TargetAddress !== undefined && { TargetAddress: input.TargetAddress }), + ...(input.ForceUnsubscribeAll !== undefined && + input.ForceUnsubscribeAll !== null && { ForceUnsubscribeAll: input.ForceUnsubscribeAll }), + ...(input.TargetAddress !== undefined && input.TargetAddress !== null && { TargetAddress: input.TargetAddress }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -143,12 +144,12 @@ export const serializeAws_restJson1DescribeNotificationRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeNotificationRule"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -167,16 +168,15 @@ export const serializeAws_restJson1ListEventTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listEventTypes"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1ListEventTypesFilters(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1ListEventTypesFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -195,16 +195,17 @@ export const serializeAws_restJson1ListNotificationRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listNotificationRules"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1ListNotificationRulesFilters(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { + Filters: serializeAws_restJson1ListNotificationRulesFilters(input.Filters, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -223,12 +224,12 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listTagsForResource"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -247,14 +248,15 @@ export const serializeAws_restJson1ListTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listTargets"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { Filters: serializeAws_restJson1ListTargetsFilters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1ListTargetsFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -273,14 +275,16 @@ export const serializeAws_restJson1SubscribeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/subscribe"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.Target !== undefined && { Target: serializeAws_restJson1Target(input.Target, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.Target !== undefined && + input.Target !== null && { Target: serializeAws_restJson1Target(input.Target, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -299,13 +303,13 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tagResource"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -324,13 +328,13 @@ export const serializeAws_restJson1UnsubscribeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/unsubscribe"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.TargetAddress !== undefined && { TargetAddress: input.TargetAddress }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.TargetAddress !== undefined && input.TargetAddress !== null && { TargetAddress: input.TargetAddress }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -349,13 +353,14 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/untagResource"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_restJson1TagKeys(input.TagKeys, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_restJson1TagKeys(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -374,19 +379,19 @@ export const serializeAws_restJson1UpdateNotificationRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateNotificationRule"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.DetailType !== undefined && { DetailType: input.DetailType }), - ...(input.EventTypeIds !== undefined && { - EventTypeIds: serializeAws_restJson1EventTypeIds(input.EventTypeIds, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.Targets !== undefined && { Targets: serializeAws_restJson1Targets(input.Targets, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.DetailType !== undefined && input.DetailType !== null && { DetailType: input.DetailType }), + ...(input.EventTypeIds !== undefined && + input.EventTypeIds !== null && { EventTypeIds: serializeAws_restJson1EventTypeIds(input.EventTypeIds, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_restJson1Targets(input.Targets, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1436,18 +1441,32 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1EventTypeIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListEventTypesFilter = (input: ListEventTypesFilter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1ListEventTypesFilters = (input: ListEventTypesFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ListEventTypesFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ListEventTypesFilter(entry, context); + }); }; const serializeAws_restJson1ListNotificationRulesFilter = ( @@ -1455,8 +1474,8 @@ const serializeAws_restJson1ListNotificationRulesFilter = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -1464,47 +1483,84 @@ const serializeAws_restJson1ListNotificationRulesFilters = ( input: ListNotificationRulesFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ListNotificationRulesFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ListNotificationRulesFilter(entry, context); + }); }; const serializeAws_restJson1ListTargetsFilter = (input: ListTargetsFilter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1ListTargetsFilters = (input: ListTargetsFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ListTargetsFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ListTargetsFilter(entry, context); + }); }; const serializeAws_restJson1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Target = (input: Target, context: __SerdeContext): any => { return { - ...(input.TargetAddress !== undefined && { TargetAddress: input.TargetAddress }), - ...(input.TargetType !== undefined && { TargetType: input.TargetType }), + ...(input.TargetAddress !== undefined && input.TargetAddress !== null && { TargetAddress: input.TargetAddress }), + ...(input.TargetType !== undefined && input.TargetType !== null && { TargetType: input.TargetType }), }; }; const serializeAws_restJson1Targets = (input: Target[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Target(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Target(entry, context); + }); }; const deserializeAws_restJson1EventTypeBatch = (output: any, context: __SerdeContext): EventTypeSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EventTypeSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EventTypeSummary(entry, context); + }); }; const deserializeAws_restJson1EventTypeSummary = (output: any, context: __SerdeContext): EventTypeSummary => { @@ -1521,7 +1577,14 @@ const deserializeAws_restJson1NotificationRuleBatch = ( output: any, context: __SerdeContext ): NotificationRuleSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NotificationRuleSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NotificationRuleSummary(entry, context); + }); }; const deserializeAws_restJson1NotificationRuleSummary = ( @@ -1535,17 +1598,26 @@ const deserializeAws_restJson1NotificationRuleSummary = ( }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TargetsBatch = (output: any, context: __SerdeContext): TargetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TargetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TargetSummary(entry, context); + }); }; const deserializeAws_restJson1TargetSummary = (output: any, context: __SerdeContext): TargetSummary => { @@ -1577,6 +1649,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-codestar/protocols/Aws_json1_1.ts b/clients/client-codestar/protocols/Aws_json1_1.ts index f20feba9dd6b..bf8b14648362 100644 --- a/clients/client-codestar/protocols/Aws_json1_1.ts +++ b/clients/client-codestar/protocols/Aws_json1_1.ts @@ -104,7 +104,7 @@ export const serializeAws_json1_1AssociateTeamMemberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.AssociateTeamMember", }; let body: any; @@ -117,7 +117,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.CreateProject", }; let body: any; @@ -130,7 +130,7 @@ export const serializeAws_json1_1CreateUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.CreateUserProfile", }; let body: any; @@ -143,7 +143,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.DeleteProject", }; let body: any; @@ -156,7 +156,7 @@ export const serializeAws_json1_1DeleteUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.DeleteUserProfile", }; let body: any; @@ -169,7 +169,7 @@ export const serializeAws_json1_1DescribeProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.DescribeProject", }; let body: any; @@ -182,7 +182,7 @@ export const serializeAws_json1_1DescribeUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.DescribeUserProfile", }; let body: any; @@ -195,7 +195,7 @@ export const serializeAws_json1_1DisassociateTeamMemberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.DisassociateTeamMember", }; let body: any; @@ -208,7 +208,7 @@ export const serializeAws_json1_1ListProjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.ListProjects", }; let body: any; @@ -221,7 +221,7 @@ export const serializeAws_json1_1ListResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.ListResources", }; let body: any; @@ -234,7 +234,7 @@ export const serializeAws_json1_1ListTagsForProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.ListTagsForProject", }; let body: any; @@ -247,7 +247,7 @@ export const serializeAws_json1_1ListTeamMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.ListTeamMembers", }; let body: any; @@ -260,7 +260,7 @@ export const serializeAws_json1_1ListUserProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.ListUserProfiles", }; let body: any; @@ -273,7 +273,7 @@ export const serializeAws_json1_1TagProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.TagProject", }; let body: any; @@ -286,7 +286,7 @@ export const serializeAws_json1_1UntagProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.UntagProject", }; let body: any; @@ -299,7 +299,7 @@ export const serializeAws_json1_1UpdateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.UpdateProject", }; let body: any; @@ -312,7 +312,7 @@ export const serializeAws_json1_1UpdateTeamMemberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.UpdateTeamMember", }; let body: any; @@ -325,7 +325,7 @@ export const serializeAws_json1_1UpdateUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "CodeStar_20170419.UpdateUserProfile", }; let body: any; @@ -360,8 +360,7 @@ const deserializeAws_json1_1AssociateTeamMemberCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codestar#ConcurrentModificationException": @@ -463,8 +462,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codestar#ConcurrentModificationException": @@ -566,8 +564,7 @@ const deserializeAws_json1_1CreateUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "UserProfileAlreadyExistsException": case "com.amazonaws.codestar#UserProfileAlreadyExistsException": @@ -629,8 +626,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codestar#ConcurrentModificationException": @@ -700,8 +696,7 @@ const deserializeAws_json1_1DeleteUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ValidationException": case "com.amazonaws.codestar#ValidationException": @@ -755,8 +750,7 @@ const deserializeAws_json1_1DescribeProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codestar#ConcurrentModificationException": @@ -842,8 +836,7 @@ const deserializeAws_json1_1DescribeUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "UserProfileNotFoundException": case "com.amazonaws.codestar#UserProfileNotFoundException": @@ -905,8 +898,7 @@ const deserializeAws_json1_1DisassociateTeamMemberCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codestar#ConcurrentModificationException": @@ -984,8 +976,7 @@ const deserializeAws_json1_1ListProjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codestar#InvalidNextTokenException": @@ -1047,8 +1038,7 @@ const deserializeAws_json1_1ListResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codestar#InvalidNextTokenException": @@ -1118,8 +1108,7 @@ const deserializeAws_json1_1ListTagsForProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codestar#InvalidNextTokenException": @@ -1189,8 +1178,7 @@ const deserializeAws_json1_1ListTeamMembersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codestar#InvalidNextTokenException": @@ -1260,8 +1248,7 @@ const deserializeAws_json1_1ListUserProfilesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.codestar#InvalidNextTokenException": @@ -1323,8 +1310,7 @@ const deserializeAws_json1_1TagProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codestar#ConcurrentModificationException": @@ -1402,8 +1388,7 @@ const deserializeAws_json1_1UntagProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codestar#ConcurrentModificationException": @@ -1481,8 +1466,7 @@ const deserializeAws_json1_1UpdateProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ProjectNotFoundException": case "com.amazonaws.codestar#ProjectNotFoundException": @@ -1544,8 +1528,7 @@ const deserializeAws_json1_1UpdateTeamMemberCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.codestar#ConcurrentModificationException": @@ -1647,8 +1630,7 @@ const deserializeAws_json1_1UpdateUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "UserProfileNotFoundException": case "com.amazonaws.codestar#UserProfileNotFoundException": @@ -1883,20 +1865,22 @@ const serializeAws_json1_1AssociateTeamMemberRequest = ( context: __SerdeContext ): any => { return { - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.projectId !== undefined && { projectId: input.projectId }), - ...(input.projectRole !== undefined && { projectRole: input.projectRole }), - ...(input.remoteAccessAllowed !== undefined && { remoteAccessAllowed: input.remoteAccessAllowed }), - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.projectId !== undefined && input.projectId !== null && { projectId: input.projectId }), + ...(input.projectRole !== undefined && input.projectRole !== null && { projectRole: input.projectRole }), + ...(input.remoteAccessAllowed !== undefined && + input.remoteAccessAllowed !== null && { remoteAccessAllowed: input.remoteAccessAllowed }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; const serializeAws_json1_1Code = (input: Code, context: __SerdeContext): any => { return { - ...(input.destination !== undefined && { - destination: serializeAws_json1_1CodeDestination(input.destination, context), - }), - ...(input.source !== undefined && { source: serializeAws_json1_1CodeSource(input.source, context) }), + ...(input.destination !== undefined && + input.destination !== null && { destination: serializeAws_json1_1CodeDestination(input.destination, context) }), + ...(input.source !== undefined && + input.source !== null && { source: serializeAws_json1_1CodeSource(input.source, context) }), }; }; @@ -1905,34 +1889,39 @@ const serializeAws_json1_1CodeCommitCodeDestination = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1CodeDestination = (input: CodeDestination, context: __SerdeContext): any => { return { - ...(input.codeCommit !== undefined && { - codeCommit: serializeAws_json1_1CodeCommitCodeDestination(input.codeCommit, context), - }), - ...(input.gitHub !== undefined && { gitHub: serializeAws_json1_1GitHubCodeDestination(input.gitHub, context) }), + ...(input.codeCommit !== undefined && + input.codeCommit !== null && { + codeCommit: serializeAws_json1_1CodeCommitCodeDestination(input.codeCommit, context), + }), + ...(input.gitHub !== undefined && + input.gitHub !== null && { gitHub: serializeAws_json1_1GitHubCodeDestination(input.gitHub, context) }), }; }; const serializeAws_json1_1CodeSource = (input: CodeSource, context: __SerdeContext): any => { return { - ...(input.s3 !== undefined && { s3: serializeAws_json1_1S3Location(input.s3, context) }), + ...(input.s3 !== undefined && input.s3 !== null && { s3: serializeAws_json1_1S3Location(input.s3, context) }), }; }; const serializeAws_json1_1CreateProjectRequest = (input: CreateProjectRequest, context: __SerdeContext): any => { return { - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.description !== undefined && { description: input.description }), - ...(input.id !== undefined && { id: input.id }), - ...(input.name !== undefined && { name: input.name }), - ...(input.sourceCode !== undefined && { sourceCode: serializeAws_json1_1SourceCode(input.sourceCode, context) }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), - ...(input.toolchain !== undefined && { toolchain: serializeAws_json1_1Toolchain(input.toolchain, context) }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.sourceCode !== undefined && + input.sourceCode !== null && { sourceCode: serializeAws_json1_1SourceCode(input.sourceCode, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.toolchain !== undefined && + input.toolchain !== null && { toolchain: serializeAws_json1_1Toolchain(input.toolchain, context) }), }; }; @@ -1941,18 +1930,19 @@ const serializeAws_json1_1CreateUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.displayName !== undefined && { displayName: input.displayName }), - ...(input.emailAddress !== undefined && { emailAddress: input.emailAddress }), - ...(input.sshPublicKey !== undefined && { sshPublicKey: input.sshPublicKey }), - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.displayName !== undefined && input.displayName !== null && { displayName: input.displayName }), + ...(input.emailAddress !== undefined && input.emailAddress !== null && { emailAddress: input.emailAddress }), + ...(input.sshPublicKey !== undefined && input.sshPublicKey !== null && { sshPublicKey: input.sshPublicKey }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; const serializeAws_json1_1DeleteProjectRequest = (input: DeleteProjectRequest, context: __SerdeContext): any => { return { - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.deleteStack !== undefined && { deleteStack: input.deleteStack }), - ...(input.id !== undefined && { id: input.id }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.deleteStack !== undefined && input.deleteStack !== null && { deleteStack: input.deleteStack }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -1961,13 +1951,13 @@ const serializeAws_json1_1DeleteUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; const serializeAws_json1_1DescribeProjectRequest = (input: DescribeProjectRequest, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -1976,7 +1966,7 @@ const serializeAws_json1_1DescribeUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; @@ -1985,35 +1975,36 @@ const serializeAws_json1_1DisassociateTeamMemberRequest = ( context: __SerdeContext ): any => { return { - ...(input.projectId !== undefined && { projectId: input.projectId }), - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.projectId !== undefined && input.projectId !== null && { projectId: input.projectId }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; const serializeAws_json1_1GitHubCodeDestination = (input: GitHubCodeDestination, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.issuesEnabled !== undefined && { issuesEnabled: input.issuesEnabled }), - ...(input.name !== undefined && { name: input.name }), - ...(input.owner !== undefined && { owner: input.owner }), - ...(input.privateRepository !== undefined && { privateRepository: input.privateRepository }), - ...(input.token !== undefined && { token: input.token }), - ...(input.type !== undefined && { type: input.type }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.issuesEnabled !== undefined && input.issuesEnabled !== null && { issuesEnabled: input.issuesEnabled }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.owner !== undefined && input.owner !== null && { owner: input.owner }), + ...(input.privateRepository !== undefined && + input.privateRepository !== null && { privateRepository: input.privateRepository }), + ...(input.token !== undefined && input.token !== null && { token: input.token }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1ListProjectsRequest = (input: ListProjectsRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListResourcesRequest = (input: ListResourcesRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.projectId !== undefined && { projectId: input.projectId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.projectId !== undefined && input.projectId !== null && { projectId: input.projectId }), }; }; @@ -2022,106 +2013,127 @@ const serializeAws_json1_1ListTagsForProjectRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListTeamMembersRequest = (input: ListTeamMembersRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.projectId !== undefined && { projectId: input.projectId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.projectId !== undefined && input.projectId !== null && { projectId: input.projectId }), }; }; const serializeAws_json1_1ListUserProfilesRequest = (input: ListUserProfilesRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1S3Location = (input: S3Location, context: __SerdeContext): any => { return { - ...(input.bucketKey !== undefined && { bucketKey: input.bucketKey }), - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), + ...(input.bucketKey !== undefined && input.bucketKey !== null && { bucketKey: input.bucketKey }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), }; }; const serializeAws_json1_1SourceCode = (input: Code[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Code(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Code(entry, context); + }); }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagProjectRequest = (input: TagProjectRequest, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), }; }; const serializeAws_json1_1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1TemplateParameterMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1Toolchain = (input: Toolchain, context: __SerdeContext): any => { return { - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.source !== undefined && { source: serializeAws_json1_1ToolchainSource(input.source, context) }), - ...(input.stackParameters !== undefined && { - stackParameters: serializeAws_json1_1TemplateParameterMap(input.stackParameters, context), - }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.source !== undefined && + input.source !== null && { source: serializeAws_json1_1ToolchainSource(input.source, context) }), + ...(input.stackParameters !== undefined && + input.stackParameters !== null && { + stackParameters: serializeAws_json1_1TemplateParameterMap(input.stackParameters, context), + }), }; }; const serializeAws_json1_1ToolchainSource = (input: ToolchainSource, context: __SerdeContext): any => { return { - ...(input.s3 !== undefined && { s3: serializeAws_json1_1S3Location(input.s3, context) }), + ...(input.s3 !== undefined && input.s3 !== null && { s3: serializeAws_json1_1S3Location(input.s3, context) }), }; }; const serializeAws_json1_1UntagProjectRequest = (input: UntagProjectRequest, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagKeys(input.tags, context) }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagKeys(input.tags, context) }), }; }; const serializeAws_json1_1UpdateProjectRequest = (input: UpdateProjectRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.id !== undefined && { id: input.id }), - ...(input.name !== undefined && { name: input.name }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1UpdateTeamMemberRequest = (input: UpdateTeamMemberRequest, context: __SerdeContext): any => { return { - ...(input.projectId !== undefined && { projectId: input.projectId }), - ...(input.projectRole !== undefined && { projectRole: input.projectRole }), - ...(input.remoteAccessAllowed !== undefined && { remoteAccessAllowed: input.remoteAccessAllowed }), - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.projectId !== undefined && input.projectId !== null && { projectId: input.projectId }), + ...(input.projectRole !== undefined && input.projectRole !== null && { projectRole: input.projectRole }), + ...(input.remoteAccessAllowed !== undefined && + input.remoteAccessAllowed !== null && { remoteAccessAllowed: input.remoteAccessAllowed }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; @@ -2130,10 +2142,10 @@ const serializeAws_json1_1UpdateUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.displayName !== undefined && { displayName: input.displayName }), - ...(input.emailAddress !== undefined && { emailAddress: input.emailAddress }), - ...(input.sshPublicKey !== undefined && { sshPublicKey: input.sshPublicKey }), - ...(input.userArn !== undefined && { userArn: input.userArn }), + ...(input.displayName !== undefined && input.displayName !== null && { displayName: input.displayName }), + ...(input.emailAddress !== undefined && input.emailAddress !== null && { emailAddress: input.emailAddress }), + ...(input.sshPublicKey !== undefined && input.sshPublicKey !== null && { sshPublicKey: input.sshPublicKey }), + ...(input.userArn !== undefined && input.userArn !== null && { userArn: input.userArn }), }; }; @@ -2374,7 +2386,14 @@ const deserializeAws_json1_1ProjectNotFoundException = ( }; const deserializeAws_json1_1ProjectsList = (output: any, context: __SerdeContext): ProjectSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProjectSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProjectSummary(entry, context); + }); }; const deserializeAws_json1_1ProjectStatus = (output: any, context: __SerdeContext): ProjectStatus => { @@ -2398,7 +2417,14 @@ const deserializeAws_json1_1Resource = (output: any, context: __SerdeContext): R }; const deserializeAws_json1_1ResourcesResult = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Resource(entry, context); + }); }; const deserializeAws_json1_1TagProjectResult = (output: any, context: __SerdeContext): TagProjectResult => { @@ -2409,13 +2435,15 @@ const deserializeAws_json1_1TagProjectResult = (output: any, context: __SerdeCon }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1TeamMember = (output: any, context: __SerdeContext): TeamMember => { @@ -2448,7 +2476,14 @@ const deserializeAws_json1_1TeamMemberNotFoundException = ( }; const deserializeAws_json1_1TeamMemberResult = (output: any, context: __SerdeContext): TeamMember[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TeamMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TeamMember(entry, context); + }); }; const deserializeAws_json1_1UntagProjectResult = (output: any, context: __SerdeContext): UntagProjectResult => { @@ -2509,7 +2544,14 @@ const deserializeAws_json1_1UserProfileNotFoundException = ( }; const deserializeAws_json1_1UserProfilesList = (output: any, context: __SerdeContext): UserProfileSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserProfileSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserProfileSummary(entry, context); + }); }; const deserializeAws_json1_1UserProfileSummary = (output: any, context: __SerdeContext): UserProfileSummary => { @@ -2577,3 +2619,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-cognito-identity-provider/protocols/Aws_json1_1.ts b/clients/client-cognito-identity-provider/protocols/Aws_json1_1.ts index e024cf6ee8e3..b0125049ca5a 100644 --- a/clients/client-cognito-identity-provider/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity-provider/protocols/Aws_json1_1.ts @@ -582,7 +582,7 @@ export const serializeAws_json1_1AddCustomAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AddCustomAttributes", }; let body: any; @@ -595,7 +595,7 @@ export const serializeAws_json1_1AdminAddUserToGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminAddUserToGroup", }; let body: any; @@ -608,7 +608,7 @@ export const serializeAws_json1_1AdminConfirmSignUpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminConfirmSignUp", }; let body: any; @@ -621,7 +621,7 @@ export const serializeAws_json1_1AdminCreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminCreateUser", }; let body: any; @@ -634,7 +634,7 @@ export const serializeAws_json1_1AdminDeleteUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminDeleteUser", }; let body: any; @@ -647,7 +647,7 @@ export const serializeAws_json1_1AdminDeleteUserAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminDeleteUserAttributes", }; let body: any; @@ -660,7 +660,7 @@ export const serializeAws_json1_1AdminDisableProviderForUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminDisableProviderForUser", }; let body: any; @@ -673,7 +673,7 @@ export const serializeAws_json1_1AdminDisableUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminDisableUser", }; let body: any; @@ -686,7 +686,7 @@ export const serializeAws_json1_1AdminEnableUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminEnableUser", }; let body: any; @@ -699,7 +699,7 @@ export const serializeAws_json1_1AdminForgetDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminForgetDevice", }; let body: any; @@ -712,7 +712,7 @@ export const serializeAws_json1_1AdminGetDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminGetDevice", }; let body: any; @@ -725,7 +725,7 @@ export const serializeAws_json1_1AdminGetUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminGetUser", }; let body: any; @@ -738,7 +738,7 @@ export const serializeAws_json1_1AdminInitiateAuthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminInitiateAuth", }; let body: any; @@ -751,7 +751,7 @@ export const serializeAws_json1_1AdminLinkProviderForUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminLinkProviderForUser", }; let body: any; @@ -764,7 +764,7 @@ export const serializeAws_json1_1AdminListDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminListDevices", }; let body: any; @@ -777,7 +777,7 @@ export const serializeAws_json1_1AdminListGroupsForUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminListGroupsForUser", }; let body: any; @@ -790,7 +790,7 @@ export const serializeAws_json1_1AdminListUserAuthEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminListUserAuthEvents", }; let body: any; @@ -803,7 +803,7 @@ export const serializeAws_json1_1AdminRemoveUserFromGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminRemoveUserFromGroup", }; let body: any; @@ -816,7 +816,7 @@ export const serializeAws_json1_1AdminResetUserPasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminResetUserPassword", }; let body: any; @@ -829,7 +829,7 @@ export const serializeAws_json1_1AdminRespondToAuthChallengeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminRespondToAuthChallenge", }; let body: any; @@ -842,7 +842,7 @@ export const serializeAws_json1_1AdminSetUserMFAPreferenceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminSetUserMFAPreference", }; let body: any; @@ -855,7 +855,7 @@ export const serializeAws_json1_1AdminSetUserPasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminSetUserPassword", }; let body: any; @@ -868,7 +868,7 @@ export const serializeAws_json1_1AdminSetUserSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminSetUserSettings", }; let body: any; @@ -881,7 +881,7 @@ export const serializeAws_json1_1AdminUpdateAuthEventFeedbackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminUpdateAuthEventFeedback", }; let body: any; @@ -894,7 +894,7 @@ export const serializeAws_json1_1AdminUpdateDeviceStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminUpdateDeviceStatus", }; let body: any; @@ -907,7 +907,7 @@ export const serializeAws_json1_1AdminUpdateUserAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminUpdateUserAttributes", }; let body: any; @@ -920,7 +920,7 @@ export const serializeAws_json1_1AdminUserGlobalSignOutCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AdminUserGlobalSignOut", }; let body: any; @@ -933,7 +933,7 @@ export const serializeAws_json1_1AssociateSoftwareTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.AssociateSoftwareToken", }; let body: any; @@ -946,7 +946,7 @@ export const serializeAws_json1_1ChangePasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ChangePassword", }; let body: any; @@ -959,7 +959,7 @@ export const serializeAws_json1_1ConfirmDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ConfirmDevice", }; let body: any; @@ -972,7 +972,7 @@ export const serializeAws_json1_1ConfirmForgotPasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ConfirmForgotPassword", }; let body: any; @@ -985,7 +985,7 @@ export const serializeAws_json1_1ConfirmSignUpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ConfirmSignUp", }; let body: any; @@ -998,7 +998,7 @@ export const serializeAws_json1_1CreateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.CreateGroup", }; let body: any; @@ -1011,7 +1011,7 @@ export const serializeAws_json1_1CreateIdentityProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.CreateIdentityProvider", }; let body: any; @@ -1024,7 +1024,7 @@ export const serializeAws_json1_1CreateResourceServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.CreateResourceServer", }; let body: any; @@ -1037,7 +1037,7 @@ export const serializeAws_json1_1CreateUserImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.CreateUserImportJob", }; let body: any; @@ -1050,7 +1050,7 @@ export const serializeAws_json1_1CreateUserPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.CreateUserPool", }; let body: any; @@ -1063,7 +1063,7 @@ export const serializeAws_json1_1CreateUserPoolClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.CreateUserPoolClient", }; let body: any; @@ -1076,7 +1076,7 @@ export const serializeAws_json1_1CreateUserPoolDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.CreateUserPoolDomain", }; let body: any; @@ -1089,7 +1089,7 @@ export const serializeAws_json1_1DeleteGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DeleteGroup", }; let body: any; @@ -1102,7 +1102,7 @@ export const serializeAws_json1_1DeleteIdentityProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DeleteIdentityProvider", }; let body: any; @@ -1115,7 +1115,7 @@ export const serializeAws_json1_1DeleteResourceServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DeleteResourceServer", }; let body: any; @@ -1128,7 +1128,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DeleteUser", }; let body: any; @@ -1141,7 +1141,7 @@ export const serializeAws_json1_1DeleteUserAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DeleteUserAttributes", }; let body: any; @@ -1154,7 +1154,7 @@ export const serializeAws_json1_1DeleteUserPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DeleteUserPool", }; let body: any; @@ -1167,7 +1167,7 @@ export const serializeAws_json1_1DeleteUserPoolClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DeleteUserPoolClient", }; let body: any; @@ -1180,7 +1180,7 @@ export const serializeAws_json1_1DeleteUserPoolDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DeleteUserPoolDomain", }; let body: any; @@ -1193,7 +1193,7 @@ export const serializeAws_json1_1DescribeIdentityProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DescribeIdentityProvider", }; let body: any; @@ -1206,7 +1206,7 @@ export const serializeAws_json1_1DescribeResourceServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DescribeResourceServer", }; let body: any; @@ -1219,7 +1219,7 @@ export const serializeAws_json1_1DescribeRiskConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DescribeRiskConfiguration", }; let body: any; @@ -1232,7 +1232,7 @@ export const serializeAws_json1_1DescribeUserImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DescribeUserImportJob", }; let body: any; @@ -1245,7 +1245,7 @@ export const serializeAws_json1_1DescribeUserPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DescribeUserPool", }; let body: any; @@ -1258,7 +1258,7 @@ export const serializeAws_json1_1DescribeUserPoolClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DescribeUserPoolClient", }; let body: any; @@ -1271,7 +1271,7 @@ export const serializeAws_json1_1DescribeUserPoolDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.DescribeUserPoolDomain", }; let body: any; @@ -1284,7 +1284,7 @@ export const serializeAws_json1_1ForgetDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ForgetDevice", }; let body: any; @@ -1297,7 +1297,7 @@ export const serializeAws_json1_1ForgotPasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ForgotPassword", }; let body: any; @@ -1310,7 +1310,7 @@ export const serializeAws_json1_1GetCSVHeaderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GetCSVHeader", }; let body: any; @@ -1323,7 +1323,7 @@ export const serializeAws_json1_1GetDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GetDevice", }; let body: any; @@ -1336,7 +1336,7 @@ export const serializeAws_json1_1GetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GetGroup", }; let body: any; @@ -1349,7 +1349,7 @@ export const serializeAws_json1_1GetIdentityProviderByIdentifierCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GetIdentityProviderByIdentifier", }; let body: any; @@ -1362,7 +1362,7 @@ export const serializeAws_json1_1GetSigningCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GetSigningCertificate", }; let body: any; @@ -1375,7 +1375,7 @@ export const serializeAws_json1_1GetUICustomizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GetUICustomization", }; let body: any; @@ -1388,7 +1388,7 @@ export const serializeAws_json1_1GetUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GetUser", }; let body: any; @@ -1401,7 +1401,7 @@ export const serializeAws_json1_1GetUserAttributeVerificationCodeCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GetUserAttributeVerificationCode", }; let body: any; @@ -1414,7 +1414,7 @@ export const serializeAws_json1_1GetUserPoolMfaConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GetUserPoolMfaConfig", }; let body: any; @@ -1427,7 +1427,7 @@ export const serializeAws_json1_1GlobalSignOutCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.GlobalSignOut", }; let body: any; @@ -1440,7 +1440,7 @@ export const serializeAws_json1_1InitiateAuthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.InitiateAuth", }; let body: any; @@ -1453,7 +1453,7 @@ export const serializeAws_json1_1ListDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListDevices", }; let body: any; @@ -1466,7 +1466,7 @@ export const serializeAws_json1_1ListGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListGroups", }; let body: any; @@ -1479,7 +1479,7 @@ export const serializeAws_json1_1ListIdentityProvidersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListIdentityProviders", }; let body: any; @@ -1492,7 +1492,7 @@ export const serializeAws_json1_1ListResourceServersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListResourceServers", }; let body: any; @@ -1505,7 +1505,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListTagsForResource", }; let body: any; @@ -1518,7 +1518,7 @@ export const serializeAws_json1_1ListUserImportJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListUserImportJobs", }; let body: any; @@ -1531,7 +1531,7 @@ export const serializeAws_json1_1ListUserPoolClientsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListUserPoolClients", }; let body: any; @@ -1544,7 +1544,7 @@ export const serializeAws_json1_1ListUserPoolsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListUserPools", }; let body: any; @@ -1557,7 +1557,7 @@ export const serializeAws_json1_1ListUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListUsers", }; let body: any; @@ -1570,7 +1570,7 @@ export const serializeAws_json1_1ListUsersInGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ListUsersInGroup", }; let body: any; @@ -1583,7 +1583,7 @@ export const serializeAws_json1_1ResendConfirmationCodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.ResendConfirmationCode", }; let body: any; @@ -1596,7 +1596,7 @@ export const serializeAws_json1_1RespondToAuthChallengeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.RespondToAuthChallenge", }; let body: any; @@ -1609,7 +1609,7 @@ export const serializeAws_json1_1SetRiskConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.SetRiskConfiguration", }; let body: any; @@ -1622,7 +1622,7 @@ export const serializeAws_json1_1SetUICustomizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.SetUICustomization", }; let body: any; @@ -1635,7 +1635,7 @@ export const serializeAws_json1_1SetUserMFAPreferenceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.SetUserMFAPreference", }; let body: any; @@ -1648,7 +1648,7 @@ export const serializeAws_json1_1SetUserPoolMfaConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.SetUserPoolMfaConfig", }; let body: any; @@ -1661,7 +1661,7 @@ export const serializeAws_json1_1SetUserSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.SetUserSettings", }; let body: any; @@ -1674,7 +1674,7 @@ export const serializeAws_json1_1SignUpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.SignUp", }; let body: any; @@ -1687,7 +1687,7 @@ export const serializeAws_json1_1StartUserImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.StartUserImportJob", }; let body: any; @@ -1700,7 +1700,7 @@ export const serializeAws_json1_1StopUserImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.StopUserImportJob", }; let body: any; @@ -1713,7 +1713,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.TagResource", }; let body: any; @@ -1726,7 +1726,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UntagResource", }; let body: any; @@ -1739,7 +1739,7 @@ export const serializeAws_json1_1UpdateAuthEventFeedbackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UpdateAuthEventFeedback", }; let body: any; @@ -1752,7 +1752,7 @@ export const serializeAws_json1_1UpdateDeviceStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UpdateDeviceStatus", }; let body: any; @@ -1765,7 +1765,7 @@ export const serializeAws_json1_1UpdateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UpdateGroup", }; let body: any; @@ -1778,7 +1778,7 @@ export const serializeAws_json1_1UpdateIdentityProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UpdateIdentityProvider", }; let body: any; @@ -1791,7 +1791,7 @@ export const serializeAws_json1_1UpdateResourceServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UpdateResourceServer", }; let body: any; @@ -1804,7 +1804,7 @@ export const serializeAws_json1_1UpdateUserAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UpdateUserAttributes", }; let body: any; @@ -1817,7 +1817,7 @@ export const serializeAws_json1_1UpdateUserPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UpdateUserPool", }; let body: any; @@ -1830,7 +1830,7 @@ export const serializeAws_json1_1UpdateUserPoolClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UpdateUserPoolClient", }; let body: any; @@ -1843,7 +1843,7 @@ export const serializeAws_json1_1UpdateUserPoolDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.UpdateUserPoolDomain", }; let body: any; @@ -1856,7 +1856,7 @@ export const serializeAws_json1_1VerifySoftwareTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.VerifySoftwareToken", }; let body: any; @@ -1869,7 +1869,7 @@ export const serializeAws_json1_1VerifyUserAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityProviderService.VerifyUserAttribute", }; let body: any; @@ -1904,8 +1904,7 @@ const deserializeAws_json1_1AddCustomAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -1996,8 +1995,7 @@ const deserializeAws_json1_1AdminAddUserToGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -2091,8 +2089,7 @@ const deserializeAws_json1_1AdminConfirmSignUpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -2226,8 +2223,7 @@ const deserializeAws_json1_1AdminCreateUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeDeliveryFailureException": case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": @@ -2398,8 +2394,7 @@ const deserializeAws_json1_1AdminDeleteUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -2493,8 +2488,7 @@ const deserializeAws_json1_1AdminDeleteUserAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -2588,8 +2582,7 @@ const deserializeAws_json1_1AdminDisableProviderForUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AliasExistsException": case "com.amazonaws.cognitoidentityprovider#AliasExistsException": @@ -2691,8 +2684,7 @@ const deserializeAws_json1_1AdminDisableUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -2786,8 +2778,7 @@ const deserializeAws_json1_1AdminEnableUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -2878,8 +2869,7 @@ const deserializeAws_json1_1AdminForgetDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -2981,8 +2971,7 @@ const deserializeAws_json1_1AdminGetDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -3076,8 +3065,7 @@ const deserializeAws_json1_1AdminGetUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -3171,8 +3159,7 @@ const deserializeAws_json1_1AdminInitiateAuthCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -3338,8 +3325,7 @@ const deserializeAws_json1_1AdminLinkProviderForUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AliasExistsException": case "com.amazonaws.cognitoidentityprovider#AliasExistsException": @@ -3449,8 +3435,7 @@ const deserializeAws_json1_1AdminListDevicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -3544,8 +3529,7 @@ const deserializeAws_json1_1AdminListGroupsForUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -3639,8 +3623,7 @@ const deserializeAws_json1_1AdminListUserAuthEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -3739,8 +3722,7 @@ const deserializeAws_json1_1AdminRemoveUserFromGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -3834,8 +3816,7 @@ const deserializeAws_json1_1AdminResetUserPasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -3985,8 +3966,7 @@ const deserializeAws_json1_1AdminRespondToAuthChallengeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AliasExistsException": case "com.amazonaws.cognitoidentityprovider#AliasExistsException": @@ -4192,8 +4172,7 @@ const deserializeAws_json1_1AdminSetUserMFAPreferenceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -4295,8 +4274,7 @@ const deserializeAws_json1_1AdminSetUserPasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -4398,8 +4376,7 @@ const deserializeAws_json1_1AdminSetUserSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -4485,8 +4462,7 @@ const deserializeAws_json1_1AdminUpdateAuthEventFeedbackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -4588,8 +4564,7 @@ const deserializeAws_json1_1AdminUpdateDeviceStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -4691,8 +4666,7 @@ const deserializeAws_json1_1AdminUpdateUserAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AliasExistsException": case "com.amazonaws.cognitoidentityprovider#AliasExistsException": @@ -4842,8 +4816,7 @@ const deserializeAws_json1_1AdminUserGlobalSignOutCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -4937,8 +4910,7 @@ const deserializeAws_json1_1AssociateSoftwareTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": @@ -5032,8 +5004,7 @@ const deserializeAws_json1_1ChangePasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -5159,8 +5130,7 @@ const deserializeAws_json1_1ConfirmDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -5302,8 +5272,7 @@ const deserializeAws_json1_1ConfirmForgotPasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeMismatchException": case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": @@ -5469,8 +5438,7 @@ const deserializeAws_json1_1ConfirmSignUpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AliasExistsException": case "com.amazonaws.cognitoidentityprovider#AliasExistsException": @@ -5628,8 +5596,7 @@ const deserializeAws_json1_1CreateGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GroupExistsException": case "com.amazonaws.cognitoidentityprovider#GroupExistsException": @@ -5731,8 +5698,7 @@ const deserializeAws_json1_1CreateIdentityProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateProviderException": case "com.amazonaws.cognitoidentityprovider#DuplicateProviderException": @@ -5834,8 +5800,7 @@ const deserializeAws_json1_1CreateResourceServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -5929,8 +5894,7 @@ const deserializeAws_json1_1CreateUserImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6032,8 +5996,7 @@ const deserializeAws_json1_1CreateUserPoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6151,8 +6114,7 @@ const deserializeAws_json1_1CreateUserPoolClientCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6262,8 +6224,7 @@ const deserializeAws_json1_1CreateUserPoolDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6346,8 +6307,7 @@ const deserializeAws_json1_1DeleteGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6430,8 +6390,7 @@ const deserializeAws_json1_1DeleteIdentityProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6522,8 +6481,7 @@ const deserializeAws_json1_1DeleteResourceServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6606,8 +6564,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6717,8 +6674,7 @@ const deserializeAws_json1_1DeleteUserAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6825,8 +6781,7 @@ const deserializeAws_json1_1DeleteUserPoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -6917,8 +6872,7 @@ const deserializeAws_json1_1DeleteUserPoolClientCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7004,8 +6958,7 @@ const deserializeAws_json1_1DeleteUserPoolDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7083,8 +7036,7 @@ const deserializeAws_json1_1DescribeIdentityProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7170,8 +7122,7 @@ const deserializeAws_json1_1DescribeResourceServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7257,8 +7208,7 @@ const deserializeAws_json1_1DescribeRiskConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7352,8 +7302,7 @@ const deserializeAws_json1_1DescribeUserImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7439,8 +7388,7 @@ const deserializeAws_json1_1DescribeUserPoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7534,8 +7482,7 @@ const deserializeAws_json1_1DescribeUserPoolClientCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7621,8 +7568,7 @@ const deserializeAws_json1_1DescribeUserPoolDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7697,8 +7643,7 @@ const deserializeAws_json1_1ForgetDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -7816,8 +7761,7 @@ const deserializeAws_json1_1ForgotPasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeDeliveryFailureException": case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": @@ -7983,8 +7927,7 @@ const deserializeAws_json1_1GetCSVHeaderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -8070,8 +8013,7 @@ const deserializeAws_json1_1GetDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -8189,8 +8131,7 @@ const deserializeAws_json1_1GetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -8276,8 +8217,7 @@ const deserializeAws_json1_1GetIdentityProviderByIdentifierCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -8363,8 +8303,7 @@ const deserializeAws_json1_1GetSigningCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -8434,8 +8373,7 @@ const deserializeAws_json1_1GetUICustomizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -8521,8 +8459,7 @@ const deserializeAws_json1_1GetUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -8632,8 +8569,7 @@ const deserializeAws_json1_1GetUserAttributeVerificationCodeCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeDeliveryFailureException": case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": @@ -8807,8 +8743,7 @@ const deserializeAws_json1_1GetUserPoolMfaConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -8894,8 +8829,7 @@ const deserializeAws_json1_1GlobalSignOutCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -8997,8 +8931,7 @@ const deserializeAws_json1_1InitiateAuthCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9156,8 +9089,7 @@ const deserializeAws_json1_1ListDevicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9275,8 +9207,7 @@ const deserializeAws_json1_1ListGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9362,8 +9293,7 @@ const deserializeAws_json1_1ListIdentityProvidersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9449,8 +9379,7 @@ const deserializeAws_json1_1ListResourceServersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9536,8 +9465,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9623,8 +9551,7 @@ const deserializeAws_json1_1ListUserImportJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9710,8 +9637,7 @@ const deserializeAws_json1_1ListUserPoolClientsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9797,8 +9723,7 @@ const deserializeAws_json1_1ListUserPoolsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9876,8 +9801,7 @@ const deserializeAws_json1_1ListUsersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -9963,8 +9887,7 @@ const deserializeAws_json1_1ListUsersInGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -10050,8 +9973,7 @@ const deserializeAws_json1_1ResendConfirmationCodeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeDeliveryFailureException": case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": @@ -10209,8 +10131,7 @@ const deserializeAws_json1_1RespondToAuthChallengeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AliasExistsException": case "com.amazonaws.cognitoidentityprovider#AliasExistsException": @@ -10416,8 +10337,7 @@ const deserializeAws_json1_1SetRiskConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeDeliveryFailureException": case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": @@ -10527,8 +10447,7 @@ const deserializeAws_json1_1SetUICustomizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -10614,8 +10533,7 @@ const deserializeAws_json1_1SetUserMFAPreferenceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -10717,8 +10635,7 @@ const deserializeAws_json1_1SetUserPoolMfaConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -10820,8 +10737,7 @@ const deserializeAws_json1_1SetUserSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -10923,8 +10839,7 @@ const deserializeAws_json1_1SignUpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeDeliveryFailureException": case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": @@ -11082,8 +10997,7 @@ const deserializeAws_json1_1StartUserImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -11177,8 +11091,7 @@ const deserializeAws_json1_1StopUserImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -11272,8 +11185,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -11359,8 +11271,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -11446,8 +11357,7 @@ const deserializeAws_json1_1UpdateAuthEventFeedbackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -11549,8 +11459,7 @@ const deserializeAws_json1_1UpdateDeviceStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -11668,8 +11577,7 @@ const deserializeAws_json1_1UpdateGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -11755,8 +11663,7 @@ const deserializeAws_json1_1UpdateIdentityProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -11850,8 +11757,7 @@ const deserializeAws_json1_1UpdateResourceServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -11937,8 +11843,7 @@ const deserializeAws_json1_1UpdateUserAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AliasExistsException": case "com.amazonaws.cognitoidentityprovider#AliasExistsException": @@ -12128,8 +12033,7 @@ const deserializeAws_json1_1UpdateUserPoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": @@ -12263,8 +12167,7 @@ const deserializeAws_json1_1UpdateUserPoolClientCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": @@ -12374,8 +12277,7 @@ const deserializeAws_json1_1UpdateUserPoolDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": @@ -12461,8 +12363,7 @@ const deserializeAws_json1_1VerifySoftwareTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeMismatchException": case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": @@ -12604,8 +12505,7 @@ const deserializeAws_json1_1VerifyUserAttributeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeMismatchException": case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": @@ -13272,9 +13172,10 @@ const serializeAws_json1_1AccountRecoverySettingType = ( context: __SerdeContext ): any => { return { - ...(input.RecoveryMechanisms !== undefined && { - RecoveryMechanisms: serializeAws_json1_1RecoveryMechanismsType(input.RecoveryMechanisms, context), - }), + ...(input.RecoveryMechanisms !== undefined && + input.RecoveryMechanisms !== null && { + RecoveryMechanisms: serializeAws_json1_1RecoveryMechanismsType(input.RecoveryMechanisms, context), + }), }; }; @@ -13283,15 +13184,18 @@ const serializeAws_json1_1AccountTakeoverActionsType = ( context: __SerdeContext ): any => { return { - ...(input.HighAction !== undefined && { - HighAction: serializeAws_json1_1AccountTakeoverActionType(input.HighAction, context), - }), - ...(input.LowAction !== undefined && { - LowAction: serializeAws_json1_1AccountTakeoverActionType(input.LowAction, context), - }), - ...(input.MediumAction !== undefined && { - MediumAction: serializeAws_json1_1AccountTakeoverActionType(input.MediumAction, context), - }), + ...(input.HighAction !== undefined && + input.HighAction !== null && { + HighAction: serializeAws_json1_1AccountTakeoverActionType(input.HighAction, context), + }), + ...(input.LowAction !== undefined && + input.LowAction !== null && { + LowAction: serializeAws_json1_1AccountTakeoverActionType(input.LowAction, context), + }), + ...(input.MediumAction !== undefined && + input.MediumAction !== null && { + MediumAction: serializeAws_json1_1AccountTakeoverActionType(input.MediumAction, context), + }), }; }; @@ -13300,8 +13204,8 @@ const serializeAws_json1_1AccountTakeoverActionType = ( context: __SerdeContext ): any => { return { - ...(input.EventAction !== undefined && { EventAction: input.EventAction }), - ...(input.Notify !== undefined && { Notify: input.Notify }), + ...(input.EventAction !== undefined && input.EventAction !== null && { EventAction: input.EventAction }), + ...(input.Notify !== undefined && input.Notify !== null && { Notify: input.Notify }), }; }; @@ -13310,12 +13214,12 @@ const serializeAws_json1_1AccountTakeoverRiskConfigurationType = ( context: __SerdeContext ): any => { return { - ...(input.Actions !== undefined && { - Actions: serializeAws_json1_1AccountTakeoverActionsType(input.Actions, context), - }), - ...(input.NotifyConfiguration !== undefined && { - NotifyConfiguration: serializeAws_json1_1NotifyConfigurationType(input.NotifyConfiguration, context), - }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_json1_1AccountTakeoverActionsType(input.Actions, context) }), + ...(input.NotifyConfiguration !== undefined && + input.NotifyConfiguration !== null && { + NotifyConfiguration: serializeAws_json1_1NotifyConfigurationType(input.NotifyConfiguration, context), + }), }; }; @@ -13324,10 +13228,11 @@ const serializeAws_json1_1AddCustomAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.CustomAttributes !== undefined && { - CustomAttributes: serializeAws_json1_1CustomAttributesListType(input.CustomAttributes, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.CustomAttributes !== undefined && + input.CustomAttributes !== null && { + CustomAttributes: serializeAws_json1_1CustomAttributesListType(input.CustomAttributes, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -13336,9 +13241,9 @@ const serializeAws_json1_1AdminAddUserToGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13347,11 +13252,12 @@ const serializeAws_json1_1AdminConfirmSignUpRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13360,35 +13266,42 @@ const serializeAws_json1_1AdminCreateUserConfigType = ( context: __SerdeContext ): any => { return { - ...(input.AllowAdminCreateUserOnly !== undefined && { AllowAdminCreateUserOnly: input.AllowAdminCreateUserOnly }), - ...(input.InviteMessageTemplate !== undefined && { - InviteMessageTemplate: serializeAws_json1_1MessageTemplateType(input.InviteMessageTemplate, context), - }), - ...(input.UnusedAccountValidityDays !== undefined && { - UnusedAccountValidityDays: input.UnusedAccountValidityDays, - }), + ...(input.AllowAdminCreateUserOnly !== undefined && + input.AllowAdminCreateUserOnly !== null && { AllowAdminCreateUserOnly: input.AllowAdminCreateUserOnly }), + ...(input.InviteMessageTemplate !== undefined && + input.InviteMessageTemplate !== null && { + InviteMessageTemplate: serializeAws_json1_1MessageTemplateType(input.InviteMessageTemplate, context), + }), + ...(input.UnusedAccountValidityDays !== undefined && + input.UnusedAccountValidityDays !== null && { UnusedAccountValidityDays: input.UnusedAccountValidityDays }), }; }; const serializeAws_json1_1AdminCreateUserRequest = (input: AdminCreateUserRequest, context: __SerdeContext): any => { return { - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.DesiredDeliveryMediums !== undefined && { - DesiredDeliveryMediums: serializeAws_json1_1DeliveryMediumListType(input.DesiredDeliveryMediums, context), - }), - ...(input.ForceAliasCreation !== undefined && { ForceAliasCreation: input.ForceAliasCreation }), - ...(input.MessageAction !== undefined && { MessageAction: input.MessageAction }), - ...(input.TemporaryPassword !== undefined && { TemporaryPassword: input.TemporaryPassword }), - ...(input.UserAttributes !== undefined && { - UserAttributes: serializeAws_json1_1AttributeListType(input.UserAttributes, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), - ...(input.ValidationData !== undefined && { - ValidationData: serializeAws_json1_1AttributeListType(input.ValidationData, context), - }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.DesiredDeliveryMediums !== undefined && + input.DesiredDeliveryMediums !== null && { + DesiredDeliveryMediums: serializeAws_json1_1DeliveryMediumListType(input.DesiredDeliveryMediums, context), + }), + ...(input.ForceAliasCreation !== undefined && + input.ForceAliasCreation !== null && { ForceAliasCreation: input.ForceAliasCreation }), + ...(input.MessageAction !== undefined && input.MessageAction !== null && { MessageAction: input.MessageAction }), + ...(input.TemporaryPassword !== undefined && + input.TemporaryPassword !== null && { TemporaryPassword: input.TemporaryPassword }), + ...(input.UserAttributes !== undefined && + input.UserAttributes !== null && { + UserAttributes: serializeAws_json1_1AttributeListType(input.UserAttributes, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), + ...(input.ValidationData !== undefined && + input.ValidationData !== null && { + ValidationData: serializeAws_json1_1AttributeListType(input.ValidationData, context), + }), }; }; @@ -13397,18 +13310,19 @@ const serializeAws_json1_1AdminDeleteUserAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.UserAttributeNames !== undefined && { - UserAttributeNames: serializeAws_json1_1AttributeNameListType(input.UserAttributeNames, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.UserAttributeNames !== undefined && + input.UserAttributeNames !== null && { + UserAttributeNames: serializeAws_json1_1AttributeNameListType(input.UserAttributeNames, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1AdminDeleteUserRequest = (input: AdminDeleteUserRequest, context: __SerdeContext): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13417,22 +13331,23 @@ const serializeAws_json1_1AdminDisableProviderForUserRequest = ( context: __SerdeContext ): any => { return { - ...(input.User !== undefined && { User: serializeAws_json1_1ProviderUserIdentifierType(input.User, context) }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.User !== undefined && + input.User !== null && { User: serializeAws_json1_1ProviderUserIdentifierType(input.User, context) }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1AdminDisableUserRequest = (input: AdminDisableUserRequest, context: __SerdeContext): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1AdminEnableUserRequest = (input: AdminEnableUserRequest, context: __SerdeContext): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13441,24 +13356,24 @@ const serializeAws_json1_1AdminForgetDeviceRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.DeviceKey !== undefined && input.DeviceKey !== null && { DeviceKey: input.DeviceKey }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1AdminGetDeviceRequest = (input: AdminGetDeviceRequest, context: __SerdeContext): any => { return { - ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.DeviceKey !== undefined && input.DeviceKey !== null && { DeviceKey: input.DeviceKey }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1AdminGetUserRequest = (input: AdminGetUserRequest, context: __SerdeContext): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13467,21 +13382,23 @@ const serializeAws_json1_1AdminInitiateAuthRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnalyticsMetadata !== undefined && { - AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), - }), - ...(input.AuthFlow !== undefined && { AuthFlow: input.AuthFlow }), - ...(input.AuthParameters !== undefined && { - AuthParameters: serializeAws_json1_1AuthParametersType(input.AuthParameters, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.ContextData !== undefined && { - ContextData: serializeAws_json1_1ContextDataType(input.ContextData, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.AnalyticsMetadata !== undefined && + input.AnalyticsMetadata !== null && { + AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), + }), + ...(input.AuthFlow !== undefined && input.AuthFlow !== null && { AuthFlow: input.AuthFlow }), + ...(input.AuthParameters !== undefined && + input.AuthParameters !== null && { + AuthParameters: serializeAws_json1_1AuthParametersType(input.AuthParameters, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.ContextData !== undefined && + input.ContextData !== null && { ContextData: serializeAws_json1_1ContextDataType(input.ContextData, context) }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -13490,22 +13407,25 @@ const serializeAws_json1_1AdminLinkProviderForUserRequest = ( context: __SerdeContext ): any => { return { - ...(input.DestinationUser !== undefined && { - DestinationUser: serializeAws_json1_1ProviderUserIdentifierType(input.DestinationUser, context), - }), - ...(input.SourceUser !== undefined && { - SourceUser: serializeAws_json1_1ProviderUserIdentifierType(input.SourceUser, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.DestinationUser !== undefined && + input.DestinationUser !== null && { + DestinationUser: serializeAws_json1_1ProviderUserIdentifierType(input.DestinationUser, context), + }), + ...(input.SourceUser !== undefined && + input.SourceUser !== null && { + SourceUser: serializeAws_json1_1ProviderUserIdentifierType(input.SourceUser, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1AdminListDevicesRequest = (input: AdminListDevicesRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.PaginationToken !== undefined && { PaginationToken: input.PaginationToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.PaginationToken !== undefined && + input.PaginationToken !== null && { PaginationToken: input.PaginationToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13514,10 +13434,10 @@ const serializeAws_json1_1AdminListGroupsForUserRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13526,10 +13446,10 @@ const serializeAws_json1_1AdminListUserAuthEventsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13538,9 +13458,9 @@ const serializeAws_json1_1AdminRemoveUserFromGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13549,11 +13469,12 @@ const serializeAws_json1_1AdminResetUserPasswordRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13562,22 +13483,24 @@ const serializeAws_json1_1AdminRespondToAuthChallengeRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnalyticsMetadata !== undefined && { - AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), - }), - ...(input.ChallengeName !== undefined && { ChallengeName: input.ChallengeName }), - ...(input.ChallengeResponses !== undefined && { - ChallengeResponses: serializeAws_json1_1ChallengeResponsesType(input.ChallengeResponses, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.ContextData !== undefined && { - ContextData: serializeAws_json1_1ContextDataType(input.ContextData, context), - }), - ...(input.Session !== undefined && { Session: input.Session }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.AnalyticsMetadata !== undefined && + input.AnalyticsMetadata !== null && { + AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), + }), + ...(input.ChallengeName !== undefined && input.ChallengeName !== null && { ChallengeName: input.ChallengeName }), + ...(input.ChallengeResponses !== undefined && + input.ChallengeResponses !== null && { + ChallengeResponses: serializeAws_json1_1ChallengeResponsesType(input.ChallengeResponses, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.ContextData !== undefined && + input.ContextData !== null && { ContextData: serializeAws_json1_1ContextDataType(input.ContextData, context) }), + ...(input.Session !== undefined && input.Session !== null && { Session: input.Session }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -13586,17 +13509,19 @@ const serializeAws_json1_1AdminSetUserMFAPreferenceRequest = ( context: __SerdeContext ): any => { return { - ...(input.SMSMfaSettings !== undefined && { - SMSMfaSettings: serializeAws_json1_1SMSMfaSettingsType(input.SMSMfaSettings, context), - }), - ...(input.SoftwareTokenMfaSettings !== undefined && { - SoftwareTokenMfaSettings: serializeAws_json1_1SoftwareTokenMfaSettingsType( - input.SoftwareTokenMfaSettings, - context - ), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.SMSMfaSettings !== undefined && + input.SMSMfaSettings !== null && { + SMSMfaSettings: serializeAws_json1_1SMSMfaSettingsType(input.SMSMfaSettings, context), + }), + ...(input.SoftwareTokenMfaSettings !== undefined && + input.SoftwareTokenMfaSettings !== null && { + SoftwareTokenMfaSettings: serializeAws_json1_1SoftwareTokenMfaSettingsType( + input.SoftwareTokenMfaSettings, + context + ), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13605,10 +13530,10 @@ const serializeAws_json1_1AdminSetUserPasswordRequest = ( context: __SerdeContext ): any => { return { - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Permanent !== undefined && { Permanent: input.Permanent }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Permanent !== undefined && input.Permanent !== null && { Permanent: input.Permanent }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13617,11 +13542,10 @@ const serializeAws_json1_1AdminSetUserSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MFAOptions !== undefined && { - MFAOptions: serializeAws_json1_1MFAOptionListType(input.MFAOptions, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.MFAOptions !== undefined && + input.MFAOptions !== null && { MFAOptions: serializeAws_json1_1MFAOptionListType(input.MFAOptions, context) }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13630,10 +13554,10 @@ const serializeAws_json1_1AdminUpdateAuthEventFeedbackRequest = ( context: __SerdeContext ): any => { return { - ...(input.EventId !== undefined && { EventId: input.EventId }), - ...(input.FeedbackValue !== undefined && { FeedbackValue: input.FeedbackValue }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.EventId !== undefined && input.EventId !== null && { EventId: input.EventId }), + ...(input.FeedbackValue !== undefined && input.FeedbackValue !== null && { FeedbackValue: input.FeedbackValue }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13642,10 +13566,11 @@ const serializeAws_json1_1AdminUpdateDeviceStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), - ...(input.DeviceRememberedStatus !== undefined && { DeviceRememberedStatus: input.DeviceRememberedStatus }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.DeviceKey !== undefined && input.DeviceKey !== null && { DeviceKey: input.DeviceKey }), + ...(input.DeviceRememberedStatus !== undefined && + input.DeviceRememberedStatus !== null && { DeviceRememberedStatus: input.DeviceRememberedStatus }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13654,14 +13579,16 @@ const serializeAws_json1_1AdminUpdateUserAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.UserAttributes !== undefined && { - UserAttributes: serializeAws_json1_1AttributeListType(input.UserAttributes, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.UserAttributes !== undefined && + input.UserAttributes !== null && { + UserAttributes: serializeAws_json1_1AttributeListType(input.UserAttributes, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13670,8 +13597,8 @@ const serializeAws_json1_1AdminUserGlobalSignOutRequest = ( context: __SerdeContext ): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -13679,7 +13606,14 @@ const serializeAws_json1_1AliasAttributesListType = ( input: (AliasAttributeType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AnalyticsConfigurationType = ( @@ -13687,17 +13621,20 @@ const serializeAws_json1_1AnalyticsConfigurationType = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationArn !== undefined && { ApplicationArn: input.ApplicationArn }), - ...(input.ApplicationId !== undefined && { ApplicationId: input.ApplicationId }), - ...(input.ExternalId !== undefined && { ExternalId: input.ExternalId }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.UserDataShared !== undefined && { UserDataShared: input.UserDataShared }), + ...(input.ApplicationArn !== undefined && + input.ApplicationArn !== null && { ApplicationArn: input.ApplicationArn }), + ...(input.ApplicationId !== undefined && input.ApplicationId !== null && { ApplicationId: input.ApplicationId }), + ...(input.ExternalId !== undefined && input.ExternalId !== null && { ExternalId: input.ExternalId }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.UserDataShared !== undefined && + input.UserDataShared !== null && { UserDataShared: input.UserDataShared }), }; }; const serializeAws_json1_1AnalyticsMetadataType = (input: AnalyticsMetadataType, context: __SerdeContext): any => { return { - ...(input.AnalyticsEndpointId !== undefined && { AnalyticsEndpointId: input.AnalyticsEndpointId }), + ...(input.AnalyticsEndpointId !== undefined && + input.AnalyticsEndpointId !== null && { AnalyticsEndpointId: input.AnalyticsEndpointId }), }; }; @@ -13706,84 +13643,129 @@ const serializeAws_json1_1AssociateSoftwareTokenRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.Session !== undefined && { Session: input.Session }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.Session !== undefined && input.Session !== null && { Session: input.Session }), }; }; const serializeAws_json1_1AttributeListType = (input: AttributeType[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AttributeType(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AttributeType(entry, context); + }); }; const serializeAws_json1_1AttributeMappingType = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1AttributeNameListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AttributeType = (input: AttributeType, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1AuthParametersType = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1BlockedIPRangeListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CallbackURLsListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ChallengeResponsesType = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ChangePasswordRequest = (input: ChangePasswordRequest, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.PreviousPassword !== undefined && { PreviousPassword: input.PreviousPassword }), - ...(input.ProposedPassword !== undefined && { ProposedPassword: input.ProposedPassword }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.PreviousPassword !== undefined && + input.PreviousPassword !== null && { PreviousPassword: input.PreviousPassword }), + ...(input.ProposedPassword !== undefined && + input.ProposedPassword !== null && { ProposedPassword: input.ProposedPassword }), }; }; const serializeAws_json1_1ClientMetadataType = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ClientPermissionListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CompromisedCredentialsActionsType = ( @@ -13791,7 +13773,7 @@ const serializeAws_json1_1CompromisedCredentialsActionsType = ( context: __SerdeContext ): any => { return { - ...(input.EventAction !== undefined && { EventAction: input.EventAction }), + ...(input.EventAction !== undefined && input.EventAction !== null && { EventAction: input.EventAction }), }; }; @@ -13800,26 +13782,27 @@ const serializeAws_json1_1CompromisedCredentialsRiskConfigurationType = ( context: __SerdeContext ): any => { return { - ...(input.Actions !== undefined && { - Actions: serializeAws_json1_1CompromisedCredentialsActionsType(input.Actions, context), - }), - ...(input.EventFilter !== undefined && { - EventFilter: serializeAws_json1_1EventFiltersType(input.EventFilter, context), - }), + ...(input.Actions !== undefined && + input.Actions !== null && { + Actions: serializeAws_json1_1CompromisedCredentialsActionsType(input.Actions, context), + }), + ...(input.EventFilter !== undefined && + input.EventFilter !== null && { EventFilter: serializeAws_json1_1EventFiltersType(input.EventFilter, context) }), }; }; const serializeAws_json1_1ConfirmDeviceRequest = (input: ConfirmDeviceRequest, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), - ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }), - ...(input.DeviceSecretVerifierConfig !== undefined && { - DeviceSecretVerifierConfig: serializeAws_json1_1DeviceSecretVerifierConfigType( - input.DeviceSecretVerifierConfig, - context - ), - }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.DeviceKey !== undefined && input.DeviceKey !== null && { DeviceKey: input.DeviceKey }), + ...(input.DeviceName !== undefined && input.DeviceName !== null && { DeviceName: input.DeviceName }), + ...(input.DeviceSecretVerifierConfig !== undefined && + input.DeviceSecretVerifierConfig !== null && { + DeviceSecretVerifierConfig: serializeAws_json1_1DeviceSecretVerifierConfigType( + input.DeviceSecretVerifierConfig, + context + ), + }), }; }; @@ -13828,61 +13811,69 @@ const serializeAws_json1_1ConfirmForgotPasswordRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnalyticsMetadata !== undefined && { - AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.ConfirmationCode !== undefined && { ConfirmationCode: input.ConfirmationCode }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.SecretHash !== undefined && { SecretHash: input.SecretHash }), - ...(input.UserContextData !== undefined && { - UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), - }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.AnalyticsMetadata !== undefined && + input.AnalyticsMetadata !== null && { + AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.ConfirmationCode !== undefined && + input.ConfirmationCode !== null && { ConfirmationCode: input.ConfirmationCode }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.SecretHash !== undefined && input.SecretHash !== null && { SecretHash: input.SecretHash }), + ...(input.UserContextData !== undefined && + input.UserContextData !== null && { + UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), + }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1ConfirmSignUpRequest = (input: ConfirmSignUpRequest, context: __SerdeContext): any => { return { - ...(input.AnalyticsMetadata !== undefined && { - AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.ConfirmationCode !== undefined && { ConfirmationCode: input.ConfirmationCode }), - ...(input.ForceAliasCreation !== undefined && { ForceAliasCreation: input.ForceAliasCreation }), - ...(input.SecretHash !== undefined && { SecretHash: input.SecretHash }), - ...(input.UserContextData !== undefined && { - UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), - }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.AnalyticsMetadata !== undefined && + input.AnalyticsMetadata !== null && { + AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.ConfirmationCode !== undefined && + input.ConfirmationCode !== null && { ConfirmationCode: input.ConfirmationCode }), + ...(input.ForceAliasCreation !== undefined && + input.ForceAliasCreation !== null && { ForceAliasCreation: input.ForceAliasCreation }), + ...(input.SecretHash !== undefined && input.SecretHash !== null && { SecretHash: input.SecretHash }), + ...(input.UserContextData !== undefined && + input.UserContextData !== null && { + UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), + }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1ContextDataType = (input: ContextDataType, context: __SerdeContext): any => { return { - ...(input.EncodedData !== undefined && { EncodedData: input.EncodedData }), - ...(input.HttpHeaders !== undefined && { - HttpHeaders: serializeAws_json1_1HttpHeaderList(input.HttpHeaders, context), - }), - ...(input.IpAddress !== undefined && { IpAddress: input.IpAddress }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.ServerPath !== undefined && { ServerPath: input.ServerPath }), + ...(input.EncodedData !== undefined && input.EncodedData !== null && { EncodedData: input.EncodedData }), + ...(input.HttpHeaders !== undefined && + input.HttpHeaders !== null && { HttpHeaders: serializeAws_json1_1HttpHeaderList(input.HttpHeaders, context) }), + ...(input.IpAddress !== undefined && input.IpAddress !== null && { IpAddress: input.IpAddress }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.ServerPath !== undefined && input.ServerPath !== null && { ServerPath: input.ServerPath }), }; }; const serializeAws_json1_1CreateGroupRequest = (input: CreateGroupRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.Precedence !== undefined && { Precedence: input.Precedence }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.Precedence !== undefined && input.Precedence !== null && { Precedence: input.Precedence }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -13891,18 +13882,21 @@ const serializeAws_json1_1CreateIdentityProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.AttributeMapping !== undefined && { - AttributeMapping: serializeAws_json1_1AttributeMappingType(input.AttributeMapping, context), - }), - ...(input.IdpIdentifiers !== undefined && { - IdpIdentifiers: serializeAws_json1_1IdpIdentifiersListType(input.IdpIdentifiers, context), - }), - ...(input.ProviderDetails !== undefined && { - ProviderDetails: serializeAws_json1_1ProviderDetailsType(input.ProviderDetails, context), - }), - ...(input.ProviderName !== undefined && { ProviderName: input.ProviderName }), - ...(input.ProviderType !== undefined && { ProviderType: input.ProviderType }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.AttributeMapping !== undefined && + input.AttributeMapping !== null && { + AttributeMapping: serializeAws_json1_1AttributeMappingType(input.AttributeMapping, context), + }), + ...(input.IdpIdentifiers !== undefined && + input.IdpIdentifiers !== null && { + IdpIdentifiers: serializeAws_json1_1IdpIdentifiersListType(input.IdpIdentifiers, context), + }), + ...(input.ProviderDetails !== undefined && + input.ProviderDetails !== null && { + ProviderDetails: serializeAws_json1_1ProviderDetailsType(input.ProviderDetails, context), + }), + ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }), + ...(input.ProviderType !== undefined && input.ProviderType !== null && { ProviderType: input.ProviderType }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -13911,12 +13905,11 @@ const serializeAws_json1_1CreateResourceServerRequest = ( context: __SerdeContext ): any => { return { - ...(input.Identifier !== undefined && { Identifier: input.Identifier }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scopes !== undefined && { - Scopes: serializeAws_json1_1ResourceServerScopeListType(input.Scopes, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Identifier !== undefined && input.Identifier !== null && { Identifier: input.Identifier }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scopes !== undefined && + input.Scopes !== null && { Scopes: serializeAws_json1_1ResourceServerScopeListType(input.Scopes, context) }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -13925,9 +13918,10 @@ const serializeAws_json1_1CreateUserImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchLogsRoleArn !== undefined && { CloudWatchLogsRoleArn: input.CloudWatchLogsRoleArn }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.CloudWatchLogsRoleArn !== undefined && + input.CloudWatchLogsRoleArn !== null && { CloudWatchLogsRoleArn: input.CloudWatchLogsRoleArn }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -13936,52 +13930,65 @@ const serializeAws_json1_1CreateUserPoolClientRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessTokenValidity !== undefined && { AccessTokenValidity: input.AccessTokenValidity }), - ...(input.AllowedOAuthFlows !== undefined && { - AllowedOAuthFlows: serializeAws_json1_1OAuthFlowsType(input.AllowedOAuthFlows, context), - }), - ...(input.AllowedOAuthFlowsUserPoolClient !== undefined && { - AllowedOAuthFlowsUserPoolClient: input.AllowedOAuthFlowsUserPoolClient, - }), - ...(input.AllowedOAuthScopes !== undefined && { - AllowedOAuthScopes: serializeAws_json1_1ScopeListType(input.AllowedOAuthScopes, context), - }), - ...(input.AnalyticsConfiguration !== undefined && { - AnalyticsConfiguration: serializeAws_json1_1AnalyticsConfigurationType(input.AnalyticsConfiguration, context), - }), - ...(input.CallbackURLs !== undefined && { - CallbackURLs: serializeAws_json1_1CallbackURLsListType(input.CallbackURLs, context), - }), - ...(input.ClientName !== undefined && { ClientName: input.ClientName }), - ...(input.DefaultRedirectURI !== undefined && { DefaultRedirectURI: input.DefaultRedirectURI }), - ...(input.ExplicitAuthFlows !== undefined && { - ExplicitAuthFlows: serializeAws_json1_1ExplicitAuthFlowsListType(input.ExplicitAuthFlows, context), - }), - ...(input.GenerateSecret !== undefined && { GenerateSecret: input.GenerateSecret }), - ...(input.IdTokenValidity !== undefined && { IdTokenValidity: input.IdTokenValidity }), - ...(input.LogoutURLs !== undefined && { - LogoutURLs: serializeAws_json1_1LogoutURLsListType(input.LogoutURLs, context), - }), - ...(input.PreventUserExistenceErrors !== undefined && { - PreventUserExistenceErrors: input.PreventUserExistenceErrors, - }), - ...(input.ReadAttributes !== undefined && { - ReadAttributes: serializeAws_json1_1ClientPermissionListType(input.ReadAttributes, context), - }), - ...(input.RefreshTokenValidity !== undefined && { RefreshTokenValidity: input.RefreshTokenValidity }), - ...(input.SupportedIdentityProviders !== undefined && { - SupportedIdentityProviders: serializeAws_json1_1SupportedIdentityProvidersListType( - input.SupportedIdentityProviders, - context - ), - }), - ...(input.TokenValidityUnits !== undefined && { - TokenValidityUnits: serializeAws_json1_1TokenValidityUnitsType(input.TokenValidityUnits, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.WriteAttributes !== undefined && { - WriteAttributes: serializeAws_json1_1ClientPermissionListType(input.WriteAttributes, context), - }), + ...(input.AccessTokenValidity !== undefined && + input.AccessTokenValidity !== null && { AccessTokenValidity: input.AccessTokenValidity }), + ...(input.AllowedOAuthFlows !== undefined && + input.AllowedOAuthFlows !== null && { + AllowedOAuthFlows: serializeAws_json1_1OAuthFlowsType(input.AllowedOAuthFlows, context), + }), + ...(input.AllowedOAuthFlowsUserPoolClient !== undefined && + input.AllowedOAuthFlowsUserPoolClient !== null && { + AllowedOAuthFlowsUserPoolClient: input.AllowedOAuthFlowsUserPoolClient, + }), + ...(input.AllowedOAuthScopes !== undefined && + input.AllowedOAuthScopes !== null && { + AllowedOAuthScopes: serializeAws_json1_1ScopeListType(input.AllowedOAuthScopes, context), + }), + ...(input.AnalyticsConfiguration !== undefined && + input.AnalyticsConfiguration !== null && { + AnalyticsConfiguration: serializeAws_json1_1AnalyticsConfigurationType(input.AnalyticsConfiguration, context), + }), + ...(input.CallbackURLs !== undefined && + input.CallbackURLs !== null && { + CallbackURLs: serializeAws_json1_1CallbackURLsListType(input.CallbackURLs, context), + }), + ...(input.ClientName !== undefined && input.ClientName !== null && { ClientName: input.ClientName }), + ...(input.DefaultRedirectURI !== undefined && + input.DefaultRedirectURI !== null && { DefaultRedirectURI: input.DefaultRedirectURI }), + ...(input.ExplicitAuthFlows !== undefined && + input.ExplicitAuthFlows !== null && { + ExplicitAuthFlows: serializeAws_json1_1ExplicitAuthFlowsListType(input.ExplicitAuthFlows, context), + }), + ...(input.GenerateSecret !== undefined && + input.GenerateSecret !== null && { GenerateSecret: input.GenerateSecret }), + ...(input.IdTokenValidity !== undefined && + input.IdTokenValidity !== null && { IdTokenValidity: input.IdTokenValidity }), + ...(input.LogoutURLs !== undefined && + input.LogoutURLs !== null && { LogoutURLs: serializeAws_json1_1LogoutURLsListType(input.LogoutURLs, context) }), + ...(input.PreventUserExistenceErrors !== undefined && + input.PreventUserExistenceErrors !== null && { PreventUserExistenceErrors: input.PreventUserExistenceErrors }), + ...(input.ReadAttributes !== undefined && + input.ReadAttributes !== null && { + ReadAttributes: serializeAws_json1_1ClientPermissionListType(input.ReadAttributes, context), + }), + ...(input.RefreshTokenValidity !== undefined && + input.RefreshTokenValidity !== null && { RefreshTokenValidity: input.RefreshTokenValidity }), + ...(input.SupportedIdentityProviders !== undefined && + input.SupportedIdentityProviders !== null && { + SupportedIdentityProviders: serializeAws_json1_1SupportedIdentityProvidersListType( + input.SupportedIdentityProviders, + context + ), + }), + ...(input.TokenValidityUnits !== undefined && + input.TokenValidityUnits !== null && { + TokenValidityUnits: serializeAws_json1_1TokenValidityUnitsType(input.TokenValidityUnits, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.WriteAttributes !== undefined && + input.WriteAttributes !== null && { + WriteAttributes: serializeAws_json1_1ClientPermissionListType(input.WriteAttributes, context), + }), }; }; @@ -13990,76 +13997,105 @@ const serializeAws_json1_1CreateUserPoolDomainRequest = ( context: __SerdeContext ): any => { return { - ...(input.CustomDomainConfig !== undefined && { - CustomDomainConfig: serializeAws_json1_1CustomDomainConfigType(input.CustomDomainConfig, context), - }), - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.CustomDomainConfig !== undefined && + input.CustomDomainConfig !== null && { + CustomDomainConfig: serializeAws_json1_1CustomDomainConfigType(input.CustomDomainConfig, context), + }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1CreateUserPoolRequest = (input: CreateUserPoolRequest, context: __SerdeContext): any => { return { - ...(input.AccountRecoverySetting !== undefined && { - AccountRecoverySetting: serializeAws_json1_1AccountRecoverySettingType(input.AccountRecoverySetting, context), - }), - ...(input.AdminCreateUserConfig !== undefined && { - AdminCreateUserConfig: serializeAws_json1_1AdminCreateUserConfigType(input.AdminCreateUserConfig, context), - }), - ...(input.AliasAttributes !== undefined && { - AliasAttributes: serializeAws_json1_1AliasAttributesListType(input.AliasAttributes, context), - }), - ...(input.AutoVerifiedAttributes !== undefined && { - AutoVerifiedAttributes: serializeAws_json1_1VerifiedAttributesListType(input.AutoVerifiedAttributes, context), - }), - ...(input.DeviceConfiguration !== undefined && { - DeviceConfiguration: serializeAws_json1_1DeviceConfigurationType(input.DeviceConfiguration, context), - }), - ...(input.EmailConfiguration !== undefined && { - EmailConfiguration: serializeAws_json1_1EmailConfigurationType(input.EmailConfiguration, context), - }), - ...(input.EmailVerificationMessage !== undefined && { EmailVerificationMessage: input.EmailVerificationMessage }), - ...(input.EmailVerificationSubject !== undefined && { EmailVerificationSubject: input.EmailVerificationSubject }), - ...(input.LambdaConfig !== undefined && { - LambdaConfig: serializeAws_json1_1LambdaConfigType(input.LambdaConfig, context), - }), - ...(input.MfaConfiguration !== undefined && { MfaConfiguration: input.MfaConfiguration }), - ...(input.Policies !== undefined && { Policies: serializeAws_json1_1UserPoolPolicyType(input.Policies, context) }), - ...(input.PoolName !== undefined && { PoolName: input.PoolName }), - ...(input.Schema !== undefined && { Schema: serializeAws_json1_1SchemaAttributesListType(input.Schema, context) }), - ...(input.SmsAuthenticationMessage !== undefined && { SmsAuthenticationMessage: input.SmsAuthenticationMessage }), - ...(input.SmsConfiguration !== undefined && { - SmsConfiguration: serializeAws_json1_1SmsConfigurationType(input.SmsConfiguration, context), - }), - ...(input.SmsVerificationMessage !== undefined && { SmsVerificationMessage: input.SmsVerificationMessage }), - ...(input.UserPoolAddOns !== undefined && { - UserPoolAddOns: serializeAws_json1_1UserPoolAddOnsType(input.UserPoolAddOns, context), - }), - ...(input.UserPoolTags !== undefined && { - UserPoolTags: serializeAws_json1_1UserPoolTagsType(input.UserPoolTags, context), - }), - ...(input.UsernameAttributes !== undefined && { - UsernameAttributes: serializeAws_json1_1UsernameAttributesListType(input.UsernameAttributes, context), - }), - ...(input.UsernameConfiguration !== undefined && { - UsernameConfiguration: serializeAws_json1_1UsernameConfigurationType(input.UsernameConfiguration, context), - }), - ...(input.VerificationMessageTemplate !== undefined && { - VerificationMessageTemplate: serializeAws_json1_1VerificationMessageTemplateType( - input.VerificationMessageTemplate, - context - ), - }), + ...(input.AccountRecoverySetting !== undefined && + input.AccountRecoverySetting !== null && { + AccountRecoverySetting: serializeAws_json1_1AccountRecoverySettingType(input.AccountRecoverySetting, context), + }), + ...(input.AdminCreateUserConfig !== undefined && + input.AdminCreateUserConfig !== null && { + AdminCreateUserConfig: serializeAws_json1_1AdminCreateUserConfigType(input.AdminCreateUserConfig, context), + }), + ...(input.AliasAttributes !== undefined && + input.AliasAttributes !== null && { + AliasAttributes: serializeAws_json1_1AliasAttributesListType(input.AliasAttributes, context), + }), + ...(input.AutoVerifiedAttributes !== undefined && + input.AutoVerifiedAttributes !== null && { + AutoVerifiedAttributes: serializeAws_json1_1VerifiedAttributesListType(input.AutoVerifiedAttributes, context), + }), + ...(input.DeviceConfiguration !== undefined && + input.DeviceConfiguration !== null && { + DeviceConfiguration: serializeAws_json1_1DeviceConfigurationType(input.DeviceConfiguration, context), + }), + ...(input.EmailConfiguration !== undefined && + input.EmailConfiguration !== null && { + EmailConfiguration: serializeAws_json1_1EmailConfigurationType(input.EmailConfiguration, context), + }), + ...(input.EmailVerificationMessage !== undefined && + input.EmailVerificationMessage !== null && { EmailVerificationMessage: input.EmailVerificationMessage }), + ...(input.EmailVerificationSubject !== undefined && + input.EmailVerificationSubject !== null && { EmailVerificationSubject: input.EmailVerificationSubject }), + ...(input.LambdaConfig !== undefined && + input.LambdaConfig !== null && { + LambdaConfig: serializeAws_json1_1LambdaConfigType(input.LambdaConfig, context), + }), + ...(input.MfaConfiguration !== undefined && + input.MfaConfiguration !== null && { MfaConfiguration: input.MfaConfiguration }), + ...(input.Policies !== undefined && + input.Policies !== null && { Policies: serializeAws_json1_1UserPoolPolicyType(input.Policies, context) }), + ...(input.PoolName !== undefined && input.PoolName !== null && { PoolName: input.PoolName }), + ...(input.Schema !== undefined && + input.Schema !== null && { Schema: serializeAws_json1_1SchemaAttributesListType(input.Schema, context) }), + ...(input.SmsAuthenticationMessage !== undefined && + input.SmsAuthenticationMessage !== null && { SmsAuthenticationMessage: input.SmsAuthenticationMessage }), + ...(input.SmsConfiguration !== undefined && + input.SmsConfiguration !== null && { + SmsConfiguration: serializeAws_json1_1SmsConfigurationType(input.SmsConfiguration, context), + }), + ...(input.SmsVerificationMessage !== undefined && + input.SmsVerificationMessage !== null && { SmsVerificationMessage: input.SmsVerificationMessage }), + ...(input.UserPoolAddOns !== undefined && + input.UserPoolAddOns !== null && { + UserPoolAddOns: serializeAws_json1_1UserPoolAddOnsType(input.UserPoolAddOns, context), + }), + ...(input.UserPoolTags !== undefined && + input.UserPoolTags !== null && { + UserPoolTags: serializeAws_json1_1UserPoolTagsType(input.UserPoolTags, context), + }), + ...(input.UsernameAttributes !== undefined && + input.UsernameAttributes !== null && { + UsernameAttributes: serializeAws_json1_1UsernameAttributesListType(input.UsernameAttributes, context), + }), + ...(input.UsernameConfiguration !== undefined && + input.UsernameConfiguration !== null && { + UsernameConfiguration: serializeAws_json1_1UsernameConfigurationType(input.UsernameConfiguration, context), + }), + ...(input.VerificationMessageTemplate !== undefined && + input.VerificationMessageTemplate !== null && { + VerificationMessageTemplate: serializeAws_json1_1VerificationMessageTemplateType( + input.VerificationMessageTemplate, + context + ), + }), }; }; const serializeAws_json1_1CustomAttributesListType = (input: SchemaAttributeType[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SchemaAttributeType(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SchemaAttributeType(entry, context); + }); }; const serializeAws_json1_1CustomDomainConfigType = (input: CustomDomainConfigType, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), }; }; @@ -14068,8 +14104,8 @@ const serializeAws_json1_1CustomEmailLambdaVersionConfigType = ( context: __SerdeContext ): any => { return { - ...(input.LambdaArn !== undefined && { LambdaArn: input.LambdaArn }), - ...(input.LambdaVersion !== undefined && { LambdaVersion: input.LambdaVersion }), + ...(input.LambdaArn !== undefined && input.LambdaArn !== null && { LambdaArn: input.LambdaArn }), + ...(input.LambdaVersion !== undefined && input.LambdaVersion !== null && { LambdaVersion: input.LambdaVersion }), }; }; @@ -14078,15 +14114,15 @@ const serializeAws_json1_1CustomSMSLambdaVersionConfigType = ( context: __SerdeContext ): any => { return { - ...(input.LambdaArn !== undefined && { LambdaArn: input.LambdaArn }), - ...(input.LambdaVersion !== undefined && { LambdaVersion: input.LambdaVersion }), + ...(input.LambdaArn !== undefined && input.LambdaArn !== null && { LambdaArn: input.LambdaArn }), + ...(input.LambdaVersion !== undefined && input.LambdaVersion !== null && { LambdaVersion: input.LambdaVersion }), }; }; const serializeAws_json1_1DeleteGroupRequest = (input: DeleteGroupRequest, context: __SerdeContext): any => { return { - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14095,8 +14131,8 @@ const serializeAws_json1_1DeleteIdentityProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProviderName !== undefined && { ProviderName: input.ProviderName }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14105,8 +14141,8 @@ const serializeAws_json1_1DeleteResourceServerRequest = ( context: __SerdeContext ): any => { return { - ...(input.Identifier !== undefined && { Identifier: input.Identifier }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Identifier !== undefined && input.Identifier !== null && { Identifier: input.Identifier }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14115,10 +14151,11 @@ const serializeAws_json1_1DeleteUserAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.UserAttributeNames !== undefined && { - UserAttributeNames: serializeAws_json1_1AttributeNameListType(input.UserAttributeNames, context), - }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.UserAttributeNames !== undefined && + input.UserAttributeNames !== null && { + UserAttributeNames: serializeAws_json1_1AttributeNameListType(input.UserAttributeNames, context), + }), }; }; @@ -14127,8 +14164,8 @@ const serializeAws_json1_1DeleteUserPoolClientRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14137,20 +14174,20 @@ const serializeAws_json1_1DeleteUserPoolDomainRequest = ( context: __SerdeContext ): any => { return { - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1DeleteUserPoolRequest = (input: DeleteUserPoolRequest, context: __SerdeContext): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1DeleteUserRequest = (input: DeleteUserRequest, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), }; }; @@ -14158,7 +14195,14 @@ const serializeAws_json1_1DeliveryMediumListType = ( input: (DeliveryMediumType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DescribeIdentityProviderRequest = ( @@ -14166,8 +14210,8 @@ const serializeAws_json1_1DescribeIdentityProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProviderName !== undefined && { ProviderName: input.ProviderName }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14176,8 +14220,8 @@ const serializeAws_json1_1DescribeResourceServerRequest = ( context: __SerdeContext ): any => { return { - ...(input.Identifier !== undefined && { Identifier: input.Identifier }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Identifier !== undefined && input.Identifier !== null && { Identifier: input.Identifier }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14186,8 +14230,8 @@ const serializeAws_json1_1DescribeRiskConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14196,8 +14240,8 @@ const serializeAws_json1_1DescribeUserImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14206,8 +14250,8 @@ const serializeAws_json1_1DescribeUserPoolClientRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14216,24 +14260,26 @@ const serializeAws_json1_1DescribeUserPoolDomainRequest = ( context: __SerdeContext ): any => { return { - ...(input.Domain !== undefined && { Domain: input.Domain }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), }; }; const serializeAws_json1_1DescribeUserPoolRequest = (input: DescribeUserPoolRequest, context: __SerdeContext): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1DeviceConfigurationType = (input: DeviceConfigurationType, context: __SerdeContext): any => { return { - ...(input.ChallengeRequiredOnNewDevice !== undefined && { - ChallengeRequiredOnNewDevice: input.ChallengeRequiredOnNewDevice, - }), - ...(input.DeviceOnlyRememberedOnUserPrompt !== undefined && { - DeviceOnlyRememberedOnUserPrompt: input.DeviceOnlyRememberedOnUserPrompt, - }), + ...(input.ChallengeRequiredOnNewDevice !== undefined && + input.ChallengeRequiredOnNewDevice !== null && { + ChallengeRequiredOnNewDevice: input.ChallengeRequiredOnNewDevice, + }), + ...(input.DeviceOnlyRememberedOnUserPrompt !== undefined && + input.DeviceOnlyRememberedOnUserPrompt !== null && { + DeviceOnlyRememberedOnUserPrompt: input.DeviceOnlyRememberedOnUserPrompt, + }), }; }; @@ -14242,73 +14288,94 @@ const serializeAws_json1_1DeviceSecretVerifierConfigType = ( context: __SerdeContext ): any => { return { - ...(input.PasswordVerifier !== undefined && { PasswordVerifier: input.PasswordVerifier }), - ...(input.Salt !== undefined && { Salt: input.Salt }), + ...(input.PasswordVerifier !== undefined && + input.PasswordVerifier !== null && { PasswordVerifier: input.PasswordVerifier }), + ...(input.Salt !== undefined && input.Salt !== null && { Salt: input.Salt }), }; }; const serializeAws_json1_1EmailConfigurationType = (input: EmailConfigurationType, context: __SerdeContext): any => { return { - ...(input.ConfigurationSet !== undefined && { ConfigurationSet: input.ConfigurationSet }), - ...(input.EmailSendingAccount !== undefined && { EmailSendingAccount: input.EmailSendingAccount }), - ...(input.From !== undefined && { From: input.From }), - ...(input.ReplyToEmailAddress !== undefined && { ReplyToEmailAddress: input.ReplyToEmailAddress }), - ...(input.SourceArn !== undefined && { SourceArn: input.SourceArn }), + ...(input.ConfigurationSet !== undefined && + input.ConfigurationSet !== null && { ConfigurationSet: input.ConfigurationSet }), + ...(input.EmailSendingAccount !== undefined && + input.EmailSendingAccount !== null && { EmailSendingAccount: input.EmailSendingAccount }), + ...(input.From !== undefined && input.From !== null && { From: input.From }), + ...(input.ReplyToEmailAddress !== undefined && + input.ReplyToEmailAddress !== null && { ReplyToEmailAddress: input.ReplyToEmailAddress }), + ...(input.SourceArn !== undefined && input.SourceArn !== null && { SourceArn: input.SourceArn }), }; }; const serializeAws_json1_1EventFiltersType = (input: (EventFilterType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ExplicitAuthFlowsListType = ( input: (ExplicitAuthFlowsType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ForgetDeviceRequest = (input: ForgetDeviceRequest, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.DeviceKey !== undefined && input.DeviceKey !== null && { DeviceKey: input.DeviceKey }), }; }; const serializeAws_json1_1ForgotPasswordRequest = (input: ForgotPasswordRequest, context: __SerdeContext): any => { return { - ...(input.AnalyticsMetadata !== undefined && { - AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.SecretHash !== undefined && { SecretHash: input.SecretHash }), - ...(input.UserContextData !== undefined && { - UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), - }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.AnalyticsMetadata !== undefined && + input.AnalyticsMetadata !== null && { + AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.SecretHash !== undefined && input.SecretHash !== null && { SecretHash: input.SecretHash }), + ...(input.UserContextData !== undefined && + input.UserContextData !== null && { + UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), + }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1GetCSVHeaderRequest = (input: GetCSVHeaderRequest, context: __SerdeContext): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1GetDeviceRequest = (input: GetDeviceRequest, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.DeviceKey !== undefined && input.DeviceKey !== null && { DeviceKey: input.DeviceKey }), }; }; const serializeAws_json1_1GetGroupRequest = (input: GetGroupRequest, context: __SerdeContext): any => { return { - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14317,8 +14384,8 @@ const serializeAws_json1_1GetIdentityProviderByIdentifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.IdpIdentifier !== undefined && { IdpIdentifier: input.IdpIdentifier }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.IdpIdentifier !== undefined && input.IdpIdentifier !== null && { IdpIdentifier: input.IdpIdentifier }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14327,7 +14394,7 @@ const serializeAws_json1_1GetSigningCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14336,8 +14403,8 @@ const serializeAws_json1_1GetUICustomizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14346,11 +14413,12 @@ const serializeAws_json1_1GetUserAttributeVerificationCodeRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), }; }; @@ -14359,93 +14427,119 @@ const serializeAws_json1_1GetUserPoolMfaConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1GetUserRequest = (input: GetUserRequest, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), }; }; const serializeAws_json1_1GlobalSignOutRequest = (input: GlobalSignOutRequest, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), }; }; const serializeAws_json1_1HttpHeader = (input: HttpHeader, context: __SerdeContext): any => { return { - ...(input.headerName !== undefined && { headerName: input.headerName }), - ...(input.headerValue !== undefined && { headerValue: input.headerValue }), + ...(input.headerName !== undefined && input.headerName !== null && { headerName: input.headerName }), + ...(input.headerValue !== undefined && input.headerValue !== null && { headerValue: input.headerValue }), }; }; const serializeAws_json1_1HttpHeaderList = (input: HttpHeader[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1HttpHeader(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1HttpHeader(entry, context); + }); }; const serializeAws_json1_1IdpIdentifiersListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InitiateAuthRequest = (input: InitiateAuthRequest, context: __SerdeContext): any => { return { - ...(input.AnalyticsMetadata !== undefined && { - AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), - }), - ...(input.AuthFlow !== undefined && { AuthFlow: input.AuthFlow }), - ...(input.AuthParameters !== undefined && { - AuthParameters: serializeAws_json1_1AuthParametersType(input.AuthParameters, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.UserContextData !== undefined && { - UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), - }), + ...(input.AnalyticsMetadata !== undefined && + input.AnalyticsMetadata !== null && { + AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), + }), + ...(input.AuthFlow !== undefined && input.AuthFlow !== null && { AuthFlow: input.AuthFlow }), + ...(input.AuthParameters !== undefined && + input.AuthParameters !== null && { + AuthParameters: serializeAws_json1_1AuthParametersType(input.AuthParameters, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.UserContextData !== undefined && + input.UserContextData !== null && { + UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), + }), }; }; const serializeAws_json1_1LambdaConfigType = (input: LambdaConfigType, context: __SerdeContext): any => { return { - ...(input.CreateAuthChallenge !== undefined && { CreateAuthChallenge: input.CreateAuthChallenge }), - ...(input.CustomEmailSender !== undefined && { - CustomEmailSender: serializeAws_json1_1CustomEmailLambdaVersionConfigType(input.CustomEmailSender, context), - }), - ...(input.CustomMessage !== undefined && { CustomMessage: input.CustomMessage }), - ...(input.CustomSMSSender !== undefined && { - CustomSMSSender: serializeAws_json1_1CustomSMSLambdaVersionConfigType(input.CustomSMSSender, context), - }), - ...(input.DefineAuthChallenge !== undefined && { DefineAuthChallenge: input.DefineAuthChallenge }), - ...(input.KMSKeyID !== undefined && { KMSKeyID: input.KMSKeyID }), - ...(input.PostAuthentication !== undefined && { PostAuthentication: input.PostAuthentication }), - ...(input.PostConfirmation !== undefined && { PostConfirmation: input.PostConfirmation }), - ...(input.PreAuthentication !== undefined && { PreAuthentication: input.PreAuthentication }), - ...(input.PreSignUp !== undefined && { PreSignUp: input.PreSignUp }), - ...(input.PreTokenGeneration !== undefined && { PreTokenGeneration: input.PreTokenGeneration }), - ...(input.UserMigration !== undefined && { UserMigration: input.UserMigration }), - ...(input.VerifyAuthChallengeResponse !== undefined && { - VerifyAuthChallengeResponse: input.VerifyAuthChallengeResponse, - }), + ...(input.CreateAuthChallenge !== undefined && + input.CreateAuthChallenge !== null && { CreateAuthChallenge: input.CreateAuthChallenge }), + ...(input.CustomEmailSender !== undefined && + input.CustomEmailSender !== null && { + CustomEmailSender: serializeAws_json1_1CustomEmailLambdaVersionConfigType(input.CustomEmailSender, context), + }), + ...(input.CustomMessage !== undefined && input.CustomMessage !== null && { CustomMessage: input.CustomMessage }), + ...(input.CustomSMSSender !== undefined && + input.CustomSMSSender !== null && { + CustomSMSSender: serializeAws_json1_1CustomSMSLambdaVersionConfigType(input.CustomSMSSender, context), + }), + ...(input.DefineAuthChallenge !== undefined && + input.DefineAuthChallenge !== null && { DefineAuthChallenge: input.DefineAuthChallenge }), + ...(input.KMSKeyID !== undefined && input.KMSKeyID !== null && { KMSKeyID: input.KMSKeyID }), + ...(input.PostAuthentication !== undefined && + input.PostAuthentication !== null && { PostAuthentication: input.PostAuthentication }), + ...(input.PostConfirmation !== undefined && + input.PostConfirmation !== null && { PostConfirmation: input.PostConfirmation }), + ...(input.PreAuthentication !== undefined && + input.PreAuthentication !== null && { PreAuthentication: input.PreAuthentication }), + ...(input.PreSignUp !== undefined && input.PreSignUp !== null && { PreSignUp: input.PreSignUp }), + ...(input.PreTokenGeneration !== undefined && + input.PreTokenGeneration !== null && { PreTokenGeneration: input.PreTokenGeneration }), + ...(input.UserMigration !== undefined && input.UserMigration !== null && { UserMigration: input.UserMigration }), + ...(input.VerifyAuthChallengeResponse !== undefined && + input.VerifyAuthChallengeResponse !== null && { VerifyAuthChallengeResponse: input.VerifyAuthChallengeResponse }), }; }; const serializeAws_json1_1ListDevicesRequest = (input: ListDevicesRequest, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.PaginationToken !== undefined && { PaginationToken: input.PaginationToken }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.PaginationToken !== undefined && + input.PaginationToken !== null && { PaginationToken: input.PaginationToken }), }; }; const serializeAws_json1_1ListGroupsRequest = (input: ListGroupsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14454,9 +14548,9 @@ const serializeAws_json1_1ListIdentityProvidersRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14465,9 +14559,9 @@ const serializeAws_json1_1ListResourceServersRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14476,7 +14570,7 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -14485,9 +14579,10 @@ const serializeAws_json1_1ListUserImportJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.PaginationToken !== undefined && { PaginationToken: input.PaginationToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.PaginationToken !== undefined && + input.PaginationToken !== null && { PaginationToken: input.PaginationToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14496,83 +14591,101 @@ const serializeAws_json1_1ListUserPoolClientsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1ListUserPoolsRequest = (input: ListUserPoolsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListUsersInGroupRequest = (input: ListUsersInGroupRequest, context: __SerdeContext): any => { return { - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1ListUsersRequest = (input: ListUsersRequest, context: __SerdeContext): any => { return { - ...(input.AttributesToGet !== undefined && { - AttributesToGet: serializeAws_json1_1SearchedAttributeNamesListType(input.AttributesToGet, context), - }), - ...(input.Filter !== undefined && { Filter: input.Filter }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.PaginationToken !== undefined && { PaginationToken: input.PaginationToken }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.AttributesToGet !== undefined && + input.AttributesToGet !== null && { + AttributesToGet: serializeAws_json1_1SearchedAttributeNamesListType(input.AttributesToGet, context), + }), + ...(input.Filter !== undefined && input.Filter !== null && { Filter: input.Filter }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.PaginationToken !== undefined && + input.PaginationToken !== null && { PaginationToken: input.PaginationToken }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1LogoutURLsListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MessageTemplateType = (input: MessageTemplateType, context: __SerdeContext): any => { return { - ...(input.EmailMessage !== undefined && { EmailMessage: input.EmailMessage }), - ...(input.EmailSubject !== undefined && { EmailSubject: input.EmailSubject }), - ...(input.SMSMessage !== undefined && { SMSMessage: input.SMSMessage }), + ...(input.EmailMessage !== undefined && input.EmailMessage !== null && { EmailMessage: input.EmailMessage }), + ...(input.EmailSubject !== undefined && input.EmailSubject !== null && { EmailSubject: input.EmailSubject }), + ...(input.SMSMessage !== undefined && input.SMSMessage !== null && { SMSMessage: input.SMSMessage }), }; }; const serializeAws_json1_1MFAOptionListType = (input: MFAOptionType[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MFAOptionType(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MFAOptionType(entry, context); + }); }; const serializeAws_json1_1MFAOptionType = (input: MFAOptionType, context: __SerdeContext): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.DeliveryMedium !== undefined && { DeliveryMedium: input.DeliveryMedium }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.DeliveryMedium !== undefined && + input.DeliveryMedium !== null && { DeliveryMedium: input.DeliveryMedium }), }; }; const serializeAws_json1_1NotifyConfigurationType = (input: NotifyConfigurationType, context: __SerdeContext): any => { return { - ...(input.BlockEmail !== undefined && { - BlockEmail: serializeAws_json1_1NotifyEmailType(input.BlockEmail, context), - }), - ...(input.From !== undefined && { From: input.From }), - ...(input.MfaEmail !== undefined && { MfaEmail: serializeAws_json1_1NotifyEmailType(input.MfaEmail, context) }), - ...(input.NoActionEmail !== undefined && { - NoActionEmail: serializeAws_json1_1NotifyEmailType(input.NoActionEmail, context), - }), - ...(input.ReplyTo !== undefined && { ReplyTo: input.ReplyTo }), - ...(input.SourceArn !== undefined && { SourceArn: input.SourceArn }), + ...(input.BlockEmail !== undefined && + input.BlockEmail !== null && { BlockEmail: serializeAws_json1_1NotifyEmailType(input.BlockEmail, context) }), + ...(input.From !== undefined && input.From !== null && { From: input.From }), + ...(input.MfaEmail !== undefined && + input.MfaEmail !== null && { MfaEmail: serializeAws_json1_1NotifyEmailType(input.MfaEmail, context) }), + ...(input.NoActionEmail !== undefined && + input.NoActionEmail !== null && { + NoActionEmail: serializeAws_json1_1NotifyEmailType(input.NoActionEmail, context), + }), + ...(input.ReplyTo !== undefined && input.ReplyTo !== null && { ReplyTo: input.ReplyTo }), + ...(input.SourceArn !== undefined && input.SourceArn !== null && { SourceArn: input.SourceArn }), }; }; const serializeAws_json1_1NotifyEmailType = (input: NotifyEmailType, context: __SerdeContext): any => { return { - ...(input.HtmlBody !== undefined && { HtmlBody: input.HtmlBody }), - ...(input.Subject !== undefined && { Subject: input.Subject }), - ...(input.TextBody !== undefined && { TextBody: input.TextBody }), + ...(input.HtmlBody !== undefined && input.HtmlBody !== null && { HtmlBody: input.HtmlBody }), + ...(input.Subject !== undefined && input.Subject !== null && { Subject: input.Subject }), + ...(input.TextBody !== undefined && input.TextBody !== null && { TextBody: input.TextBody }), }; }; @@ -14581,36 +14694,50 @@ const serializeAws_json1_1NumberAttributeConstraintsType = ( context: __SerdeContext ): any => { return { - ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), - ...(input.MinValue !== undefined && { MinValue: input.MinValue }), + ...(input.MaxValue !== undefined && input.MaxValue !== null && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && input.MinValue !== null && { MinValue: input.MinValue }), }; }; const serializeAws_json1_1OAuthFlowsType = (input: (OAuthFlowType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PasswordPolicyType = (input: PasswordPolicyType, context: __SerdeContext): any => { return { - ...(input.MinimumLength !== undefined && { MinimumLength: input.MinimumLength }), - ...(input.RequireLowercase !== undefined && { RequireLowercase: input.RequireLowercase }), - ...(input.RequireNumbers !== undefined && { RequireNumbers: input.RequireNumbers }), - ...(input.RequireSymbols !== undefined && { RequireSymbols: input.RequireSymbols }), - ...(input.RequireUppercase !== undefined && { RequireUppercase: input.RequireUppercase }), - ...(input.TemporaryPasswordValidityDays !== undefined && { - TemporaryPasswordValidityDays: input.TemporaryPasswordValidityDays, - }), + ...(input.MinimumLength !== undefined && input.MinimumLength !== null && { MinimumLength: input.MinimumLength }), + ...(input.RequireLowercase !== undefined && + input.RequireLowercase !== null && { RequireLowercase: input.RequireLowercase }), + ...(input.RequireNumbers !== undefined && + input.RequireNumbers !== null && { RequireNumbers: input.RequireNumbers }), + ...(input.RequireSymbols !== undefined && + input.RequireSymbols !== null && { RequireSymbols: input.RequireSymbols }), + ...(input.RequireUppercase !== undefined && + input.RequireUppercase !== null && { RequireUppercase: input.RequireUppercase }), + ...(input.TemporaryPasswordValidityDays !== undefined && + input.TemporaryPasswordValidityDays !== null && { + TemporaryPasswordValidityDays: input.TemporaryPasswordValidityDays, + }), }; }; const serializeAws_json1_1ProviderDetailsType = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ProviderUserIdentifierType = ( @@ -14618,20 +14745,29 @@ const serializeAws_json1_1ProviderUserIdentifierType = ( context: __SerdeContext ): any => { return { - ...(input.ProviderAttributeName !== undefined && { ProviderAttributeName: input.ProviderAttributeName }), - ...(input.ProviderAttributeValue !== undefined && { ProviderAttributeValue: input.ProviderAttributeValue }), - ...(input.ProviderName !== undefined && { ProviderName: input.ProviderName }), + ...(input.ProviderAttributeName !== undefined && + input.ProviderAttributeName !== null && { ProviderAttributeName: input.ProviderAttributeName }), + ...(input.ProviderAttributeValue !== undefined && + input.ProviderAttributeValue !== null && { ProviderAttributeValue: input.ProviderAttributeValue }), + ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }), }; }; const serializeAws_json1_1RecoveryMechanismsType = (input: RecoveryOptionType[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RecoveryOptionType(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RecoveryOptionType(entry, context); + }); }; const serializeAws_json1_1RecoveryOptionType = (input: RecoveryOptionType, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Priority !== undefined && { Priority: input.Priority }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), }; }; @@ -14640,18 +14776,21 @@ const serializeAws_json1_1ResendConfirmationCodeRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnalyticsMetadata !== undefined && { - AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.SecretHash !== undefined && { SecretHash: input.SecretHash }), - ...(input.UserContextData !== undefined && { - UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), - }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.AnalyticsMetadata !== undefined && + input.AnalyticsMetadata !== null && { + AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.SecretHash !== undefined && input.SecretHash !== null && { SecretHash: input.SecretHash }), + ...(input.UserContextData !== undefined && + input.UserContextData !== null && { + UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), + }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -14659,13 +14798,21 @@ const serializeAws_json1_1ResourceServerScopeListType = ( input: ResourceServerScopeType[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ResourceServerScopeType(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ResourceServerScopeType(entry, context); + }); }; const serializeAws_json1_1ResourceServerScopeType = (input: ResourceServerScopeType, context: __SerdeContext): any => { return { - ...(input.ScopeDescription !== undefined && { ScopeDescription: input.ScopeDescription }), - ...(input.ScopeName !== undefined && { ScopeName: input.ScopeName }), + ...(input.ScopeDescription !== undefined && + input.ScopeDescription !== null && { ScopeDescription: input.ScopeDescription }), + ...(input.ScopeName !== undefined && input.ScopeName !== null && { ScopeName: input.ScopeName }), }; }; @@ -14674,21 +14821,25 @@ const serializeAws_json1_1RespondToAuthChallengeRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnalyticsMetadata !== undefined && { - AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), - }), - ...(input.ChallengeName !== undefined && { ChallengeName: input.ChallengeName }), - ...(input.ChallengeResponses !== undefined && { - ChallengeResponses: serializeAws_json1_1ChallengeResponsesType(input.ChallengeResponses, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.Session !== undefined && { Session: input.Session }), - ...(input.UserContextData !== undefined && { - UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), - }), + ...(input.AnalyticsMetadata !== undefined && + input.AnalyticsMetadata !== null && { + AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), + }), + ...(input.ChallengeName !== undefined && input.ChallengeName !== null && { ChallengeName: input.ChallengeName }), + ...(input.ChallengeResponses !== undefined && + input.ChallengeResponses !== null && { + ChallengeResponses: serializeAws_json1_1ChallengeResponsesType(input.ChallengeResponses, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.Session !== undefined && input.Session !== null && { Session: input.Session }), + ...(input.UserContextData !== undefined && + input.UserContextData !== null && { + UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), + }), }; }; @@ -14697,47 +14848,74 @@ const serializeAws_json1_1RiskExceptionConfigurationType = ( context: __SerdeContext ): any => { return { - ...(input.BlockedIPRangeList !== undefined && { - BlockedIPRangeList: serializeAws_json1_1BlockedIPRangeListType(input.BlockedIPRangeList, context), - }), - ...(input.SkippedIPRangeList !== undefined && { - SkippedIPRangeList: serializeAws_json1_1SkippedIPRangeListType(input.SkippedIPRangeList, context), - }), + ...(input.BlockedIPRangeList !== undefined && + input.BlockedIPRangeList !== null && { + BlockedIPRangeList: serializeAws_json1_1BlockedIPRangeListType(input.BlockedIPRangeList, context), + }), + ...(input.SkippedIPRangeList !== undefined && + input.SkippedIPRangeList !== null && { + SkippedIPRangeList: serializeAws_json1_1SkippedIPRangeListType(input.SkippedIPRangeList, context), + }), }; }; const serializeAws_json1_1SchemaAttributesListType = (input: SchemaAttributeType[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SchemaAttributeType(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SchemaAttributeType(entry, context); + }); }; const serializeAws_json1_1SchemaAttributeType = (input: SchemaAttributeType, context: __SerdeContext): any => { return { - ...(input.AttributeDataType !== undefined && { AttributeDataType: input.AttributeDataType }), - ...(input.DeveloperOnlyAttribute !== undefined && { DeveloperOnlyAttribute: input.DeveloperOnlyAttribute }), - ...(input.Mutable !== undefined && { Mutable: input.Mutable }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NumberAttributeConstraints !== undefined && { - NumberAttributeConstraints: serializeAws_json1_1NumberAttributeConstraintsType( - input.NumberAttributeConstraints, - context - ), - }), - ...(input.Required !== undefined && { Required: input.Required }), - ...(input.StringAttributeConstraints !== undefined && { - StringAttributeConstraints: serializeAws_json1_1StringAttributeConstraintsType( - input.StringAttributeConstraints, - context - ), - }), + ...(input.AttributeDataType !== undefined && + input.AttributeDataType !== null && { AttributeDataType: input.AttributeDataType }), + ...(input.DeveloperOnlyAttribute !== undefined && + input.DeveloperOnlyAttribute !== null && { DeveloperOnlyAttribute: input.DeveloperOnlyAttribute }), + ...(input.Mutable !== undefined && input.Mutable !== null && { Mutable: input.Mutable }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NumberAttributeConstraints !== undefined && + input.NumberAttributeConstraints !== null && { + NumberAttributeConstraints: serializeAws_json1_1NumberAttributeConstraintsType( + input.NumberAttributeConstraints, + context + ), + }), + ...(input.Required !== undefined && input.Required !== null && { Required: input.Required }), + ...(input.StringAttributeConstraints !== undefined && + input.StringAttributeConstraints !== null && { + StringAttributeConstraints: serializeAws_json1_1StringAttributeConstraintsType( + input.StringAttributeConstraints, + context + ), + }), }; }; const serializeAws_json1_1ScopeListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SearchedAttributeNamesListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SetRiskConfigurationRequest = ( @@ -14745,26 +14923,29 @@ const serializeAws_json1_1SetRiskConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountTakeoverRiskConfiguration !== undefined && { - AccountTakeoverRiskConfiguration: serializeAws_json1_1AccountTakeoverRiskConfigurationType( - input.AccountTakeoverRiskConfiguration, - context - ), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.CompromisedCredentialsRiskConfiguration !== undefined && { - CompromisedCredentialsRiskConfiguration: serializeAws_json1_1CompromisedCredentialsRiskConfigurationType( - input.CompromisedCredentialsRiskConfiguration, - context - ), - }), - ...(input.RiskExceptionConfiguration !== undefined && { - RiskExceptionConfiguration: serializeAws_json1_1RiskExceptionConfigurationType( - input.RiskExceptionConfiguration, - context - ), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.AccountTakeoverRiskConfiguration !== undefined && + input.AccountTakeoverRiskConfiguration !== null && { + AccountTakeoverRiskConfiguration: serializeAws_json1_1AccountTakeoverRiskConfigurationType( + input.AccountTakeoverRiskConfiguration, + context + ), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.CompromisedCredentialsRiskConfiguration !== undefined && + input.CompromisedCredentialsRiskConfiguration !== null && { + CompromisedCredentialsRiskConfiguration: serializeAws_json1_1CompromisedCredentialsRiskConfigurationType( + input.CompromisedCredentialsRiskConfiguration, + context + ), + }), + ...(input.RiskExceptionConfiguration !== undefined && + input.RiskExceptionConfiguration !== null && { + RiskExceptionConfiguration: serializeAws_json1_1RiskExceptionConfigurationType( + input.RiskExceptionConfiguration, + context + ), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14773,10 +14954,11 @@ const serializeAws_json1_1SetUICustomizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.CSS !== undefined && { CSS: input.CSS }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ImageFile !== undefined && { ImageFile: context.base64Encoder(input.ImageFile) }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.CSS !== undefined && input.CSS !== null && { CSS: input.CSS }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ImageFile !== undefined && + input.ImageFile !== null && { ImageFile: context.base64Encoder(input.ImageFile) }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14785,16 +14967,18 @@ const serializeAws_json1_1SetUserMFAPreferenceRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.SMSMfaSettings !== undefined && { - SMSMfaSettings: serializeAws_json1_1SMSMfaSettingsType(input.SMSMfaSettings, context), - }), - ...(input.SoftwareTokenMfaSettings !== undefined && { - SoftwareTokenMfaSettings: serializeAws_json1_1SoftwareTokenMfaSettingsType( - input.SoftwareTokenMfaSettings, - context - ), - }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.SMSMfaSettings !== undefined && + input.SMSMfaSettings !== null && { + SMSMfaSettings: serializeAws_json1_1SMSMfaSettingsType(input.SMSMfaSettings, context), + }), + ...(input.SoftwareTokenMfaSettings !== undefined && + input.SoftwareTokenMfaSettings !== null && { + SoftwareTokenMfaSettings: serializeAws_json1_1SoftwareTokenMfaSettingsType( + input.SoftwareTokenMfaSettings, + context + ), + }), }; }; @@ -14803,77 +14987,93 @@ const serializeAws_json1_1SetUserPoolMfaConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.MfaConfiguration !== undefined && { MfaConfiguration: input.MfaConfiguration }), - ...(input.SmsMfaConfiguration !== undefined && { - SmsMfaConfiguration: serializeAws_json1_1SmsMfaConfigType(input.SmsMfaConfiguration, context), - }), - ...(input.SoftwareTokenMfaConfiguration !== undefined && { - SoftwareTokenMfaConfiguration: serializeAws_json1_1SoftwareTokenMfaConfigType( - input.SoftwareTokenMfaConfiguration, - context - ), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.MfaConfiguration !== undefined && + input.MfaConfiguration !== null && { MfaConfiguration: input.MfaConfiguration }), + ...(input.SmsMfaConfiguration !== undefined && + input.SmsMfaConfiguration !== null && { + SmsMfaConfiguration: serializeAws_json1_1SmsMfaConfigType(input.SmsMfaConfiguration, context), + }), + ...(input.SoftwareTokenMfaConfiguration !== undefined && + input.SoftwareTokenMfaConfiguration !== null && { + SoftwareTokenMfaConfiguration: serializeAws_json1_1SoftwareTokenMfaConfigType( + input.SoftwareTokenMfaConfiguration, + context + ), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1SetUserSettingsRequest = (input: SetUserSettingsRequest, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.MFAOptions !== undefined && { - MFAOptions: serializeAws_json1_1MFAOptionListType(input.MFAOptions, context), - }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.MFAOptions !== undefined && + input.MFAOptions !== null && { MFAOptions: serializeAws_json1_1MFAOptionListType(input.MFAOptions, context) }), }; }; const serializeAws_json1_1SignUpRequest = (input: SignUpRequest, context: __SerdeContext): any => { return { - ...(input.AnalyticsMetadata !== undefined && { - AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.SecretHash !== undefined && { SecretHash: input.SecretHash }), - ...(input.UserAttributes !== undefined && { - UserAttributes: serializeAws_json1_1AttributeListType(input.UserAttributes, context), - }), - ...(input.UserContextData !== undefined && { - UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), - }), - ...(input.Username !== undefined && { Username: input.Username }), - ...(input.ValidationData !== undefined && { - ValidationData: serializeAws_json1_1AttributeListType(input.ValidationData, context), - }), + ...(input.AnalyticsMetadata !== undefined && + input.AnalyticsMetadata !== null && { + AnalyticsMetadata: serializeAws_json1_1AnalyticsMetadataType(input.AnalyticsMetadata, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.SecretHash !== undefined && input.SecretHash !== null && { SecretHash: input.SecretHash }), + ...(input.UserAttributes !== undefined && + input.UserAttributes !== null && { + UserAttributes: serializeAws_json1_1AttributeListType(input.UserAttributes, context), + }), + ...(input.UserContextData !== undefined && + input.UserContextData !== null && { + UserContextData: serializeAws_json1_1UserContextDataType(input.UserContextData, context), + }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), + ...(input.ValidationData !== undefined && + input.ValidationData !== null && { + ValidationData: serializeAws_json1_1AttributeListType(input.ValidationData, context), + }), }; }; const serializeAws_json1_1SkippedIPRangeListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SmsConfigurationType = (input: SmsConfigurationType, context: __SerdeContext): any => { return { - ...(input.ExternalId !== undefined && { ExternalId: input.ExternalId }), - ...(input.SnsCallerArn !== undefined && { SnsCallerArn: input.SnsCallerArn }), + ...(input.ExternalId !== undefined && input.ExternalId !== null && { ExternalId: input.ExternalId }), + ...(input.SnsCallerArn !== undefined && input.SnsCallerArn !== null && { SnsCallerArn: input.SnsCallerArn }), }; }; const serializeAws_json1_1SmsMfaConfigType = (input: SmsMfaConfigType, context: __SerdeContext): any => { return { - ...(input.SmsAuthenticationMessage !== undefined && { SmsAuthenticationMessage: input.SmsAuthenticationMessage }), - ...(input.SmsConfiguration !== undefined && { - SmsConfiguration: serializeAws_json1_1SmsConfigurationType(input.SmsConfiguration, context), - }), + ...(input.SmsAuthenticationMessage !== undefined && + input.SmsAuthenticationMessage !== null && { SmsAuthenticationMessage: input.SmsAuthenticationMessage }), + ...(input.SmsConfiguration !== undefined && + input.SmsConfiguration !== null && { + SmsConfiguration: serializeAws_json1_1SmsConfigurationType(input.SmsConfiguration, context), + }), }; }; const serializeAws_json1_1SMSMfaSettingsType = (input: SMSMfaSettingsType, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.PreferredMfa !== undefined && { PreferredMfa: input.PreferredMfa }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.PreferredMfa !== undefined && input.PreferredMfa !== null && { PreferredMfa: input.PreferredMfa }), }; }; @@ -14882,7 +15082,7 @@ const serializeAws_json1_1SoftwareTokenMfaConfigType = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; @@ -14891,8 +15091,8 @@ const serializeAws_json1_1SoftwareTokenMfaSettingsType = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.PreferredMfa !== undefined && { PreferredMfa: input.PreferredMfa }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.PreferredMfa !== undefined && input.PreferredMfa !== null && { PreferredMfa: input.PreferredMfa }), }; }; @@ -14901,8 +15101,8 @@ const serializeAws_json1_1StartUserImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14911,8 +15111,8 @@ const serializeAws_json1_1StopUserImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14921,34 +15121,43 @@ const serializeAws_json1_1StringAttributeConstraintsType = ( context: __SerdeContext ): any => { return { - ...(input.MaxLength !== undefined && { MaxLength: input.MaxLength }), - ...(input.MinLength !== undefined && { MinLength: input.MinLength }), + ...(input.MaxLength !== undefined && input.MaxLength !== null && { MaxLength: input.MaxLength }), + ...(input.MinLength !== undefined && input.MinLength !== null && { MinLength: input.MinLength }), }; }; const serializeAws_json1_1SupportedIdentityProvidersListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1UserPoolTagsType(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1UserPoolTagsType(input.Tags, context) }), }; }; const serializeAws_json1_1TokenValidityUnitsType = (input: TokenValidityUnitsType, context: __SerdeContext): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.IdToken !== undefined && { IdToken: input.IdToken }), - ...(input.RefreshToken !== undefined && { RefreshToken: input.RefreshToken }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.IdToken !== undefined && input.IdToken !== null && { IdToken: input.IdToken }), + ...(input.RefreshToken !== undefined && input.RefreshToken !== null && { RefreshToken: input.RefreshToken }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1UserPoolTagsListType(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1UserPoolTagsListType(input.TagKeys, context) }), }; }; @@ -14957,11 +15166,11 @@ const serializeAws_json1_1UpdateAuthEventFeedbackRequest = ( context: __SerdeContext ): any => { return { - ...(input.EventId !== undefined && { EventId: input.EventId }), - ...(input.FeedbackToken !== undefined && { FeedbackToken: input.FeedbackToken }), - ...(input.FeedbackValue !== undefined && { FeedbackValue: input.FeedbackValue }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.EventId !== undefined && input.EventId !== null && { EventId: input.EventId }), + ...(input.FeedbackToken !== undefined && input.FeedbackToken !== null && { FeedbackToken: input.FeedbackToken }), + ...(input.FeedbackValue !== undefined && input.FeedbackValue !== null && { FeedbackValue: input.FeedbackValue }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -14970,19 +15179,20 @@ const serializeAws_json1_1UpdateDeviceStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), - ...(input.DeviceRememberedStatus !== undefined && { DeviceRememberedStatus: input.DeviceRememberedStatus }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.DeviceKey !== undefined && input.DeviceKey !== null && { DeviceKey: input.DeviceKey }), + ...(input.DeviceRememberedStatus !== undefined && + input.DeviceRememberedStatus !== null && { DeviceRememberedStatus: input.DeviceRememberedStatus }), }; }; const serializeAws_json1_1UpdateGroupRequest = (input: UpdateGroupRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.Precedence !== undefined && { Precedence: input.Precedence }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.Precedence !== undefined && input.Precedence !== null && { Precedence: input.Precedence }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -14991,17 +15201,20 @@ const serializeAws_json1_1UpdateIdentityProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.AttributeMapping !== undefined && { - AttributeMapping: serializeAws_json1_1AttributeMappingType(input.AttributeMapping, context), - }), - ...(input.IdpIdentifiers !== undefined && { - IdpIdentifiers: serializeAws_json1_1IdpIdentifiersListType(input.IdpIdentifiers, context), - }), - ...(input.ProviderDetails !== undefined && { - ProviderDetails: serializeAws_json1_1ProviderDetailsType(input.ProviderDetails, context), - }), - ...(input.ProviderName !== undefined && { ProviderName: input.ProviderName }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.AttributeMapping !== undefined && + input.AttributeMapping !== null && { + AttributeMapping: serializeAws_json1_1AttributeMappingType(input.AttributeMapping, context), + }), + ...(input.IdpIdentifiers !== undefined && + input.IdpIdentifiers !== null && { + IdpIdentifiers: serializeAws_json1_1IdpIdentifiersListType(input.IdpIdentifiers, context), + }), + ...(input.ProviderDetails !== undefined && + input.ProviderDetails !== null && { + ProviderDetails: serializeAws_json1_1ProviderDetailsType(input.ProviderDetails, context), + }), + ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -15010,12 +15223,11 @@ const serializeAws_json1_1UpdateResourceServerRequest = ( context: __SerdeContext ): any => { return { - ...(input.Identifier !== undefined && { Identifier: input.Identifier }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scopes !== undefined && { - Scopes: serializeAws_json1_1ResourceServerScopeListType(input.Scopes, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Identifier !== undefined && input.Identifier !== null && { Identifier: input.Identifier }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scopes !== undefined && + input.Scopes !== null && { Scopes: serializeAws_json1_1ResourceServerScopeListType(input.Scopes, context) }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; @@ -15024,13 +15236,15 @@ const serializeAws_json1_1UpdateUserAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.ClientMetadata !== undefined && { - ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), - }), - ...(input.UserAttributes !== undefined && { - UserAttributes: serializeAws_json1_1AttributeListType(input.UserAttributes, context), - }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.ClientMetadata !== undefined && + input.ClientMetadata !== null && { + ClientMetadata: serializeAws_json1_1ClientMetadataType(input.ClientMetadata, context), + }), + ...(input.UserAttributes !== undefined && + input.UserAttributes !== null && { + UserAttributes: serializeAws_json1_1AttributeListType(input.UserAttributes, context), + }), }; }; @@ -15039,52 +15253,64 @@ const serializeAws_json1_1UpdateUserPoolClientRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessTokenValidity !== undefined && { AccessTokenValidity: input.AccessTokenValidity }), - ...(input.AllowedOAuthFlows !== undefined && { - AllowedOAuthFlows: serializeAws_json1_1OAuthFlowsType(input.AllowedOAuthFlows, context), - }), - ...(input.AllowedOAuthFlowsUserPoolClient !== undefined && { - AllowedOAuthFlowsUserPoolClient: input.AllowedOAuthFlowsUserPoolClient, - }), - ...(input.AllowedOAuthScopes !== undefined && { - AllowedOAuthScopes: serializeAws_json1_1ScopeListType(input.AllowedOAuthScopes, context), - }), - ...(input.AnalyticsConfiguration !== undefined && { - AnalyticsConfiguration: serializeAws_json1_1AnalyticsConfigurationType(input.AnalyticsConfiguration, context), - }), - ...(input.CallbackURLs !== undefined && { - CallbackURLs: serializeAws_json1_1CallbackURLsListType(input.CallbackURLs, context), - }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientName !== undefined && { ClientName: input.ClientName }), - ...(input.DefaultRedirectURI !== undefined && { DefaultRedirectURI: input.DefaultRedirectURI }), - ...(input.ExplicitAuthFlows !== undefined && { - ExplicitAuthFlows: serializeAws_json1_1ExplicitAuthFlowsListType(input.ExplicitAuthFlows, context), - }), - ...(input.IdTokenValidity !== undefined && { IdTokenValidity: input.IdTokenValidity }), - ...(input.LogoutURLs !== undefined && { - LogoutURLs: serializeAws_json1_1LogoutURLsListType(input.LogoutURLs, context), - }), - ...(input.PreventUserExistenceErrors !== undefined && { - PreventUserExistenceErrors: input.PreventUserExistenceErrors, - }), - ...(input.ReadAttributes !== undefined && { - ReadAttributes: serializeAws_json1_1ClientPermissionListType(input.ReadAttributes, context), - }), - ...(input.RefreshTokenValidity !== undefined && { RefreshTokenValidity: input.RefreshTokenValidity }), - ...(input.SupportedIdentityProviders !== undefined && { - SupportedIdentityProviders: serializeAws_json1_1SupportedIdentityProvidersListType( - input.SupportedIdentityProviders, - context - ), - }), - ...(input.TokenValidityUnits !== undefined && { - TokenValidityUnits: serializeAws_json1_1TokenValidityUnitsType(input.TokenValidityUnits, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.WriteAttributes !== undefined && { - WriteAttributes: serializeAws_json1_1ClientPermissionListType(input.WriteAttributes, context), - }), + ...(input.AccessTokenValidity !== undefined && + input.AccessTokenValidity !== null && { AccessTokenValidity: input.AccessTokenValidity }), + ...(input.AllowedOAuthFlows !== undefined && + input.AllowedOAuthFlows !== null && { + AllowedOAuthFlows: serializeAws_json1_1OAuthFlowsType(input.AllowedOAuthFlows, context), + }), + ...(input.AllowedOAuthFlowsUserPoolClient !== undefined && + input.AllowedOAuthFlowsUserPoolClient !== null && { + AllowedOAuthFlowsUserPoolClient: input.AllowedOAuthFlowsUserPoolClient, + }), + ...(input.AllowedOAuthScopes !== undefined && + input.AllowedOAuthScopes !== null && { + AllowedOAuthScopes: serializeAws_json1_1ScopeListType(input.AllowedOAuthScopes, context), + }), + ...(input.AnalyticsConfiguration !== undefined && + input.AnalyticsConfiguration !== null && { + AnalyticsConfiguration: serializeAws_json1_1AnalyticsConfigurationType(input.AnalyticsConfiguration, context), + }), + ...(input.CallbackURLs !== undefined && + input.CallbackURLs !== null && { + CallbackURLs: serializeAws_json1_1CallbackURLsListType(input.CallbackURLs, context), + }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientName !== undefined && input.ClientName !== null && { ClientName: input.ClientName }), + ...(input.DefaultRedirectURI !== undefined && + input.DefaultRedirectURI !== null && { DefaultRedirectURI: input.DefaultRedirectURI }), + ...(input.ExplicitAuthFlows !== undefined && + input.ExplicitAuthFlows !== null && { + ExplicitAuthFlows: serializeAws_json1_1ExplicitAuthFlowsListType(input.ExplicitAuthFlows, context), + }), + ...(input.IdTokenValidity !== undefined && + input.IdTokenValidity !== null && { IdTokenValidity: input.IdTokenValidity }), + ...(input.LogoutURLs !== undefined && + input.LogoutURLs !== null && { LogoutURLs: serializeAws_json1_1LogoutURLsListType(input.LogoutURLs, context) }), + ...(input.PreventUserExistenceErrors !== undefined && + input.PreventUserExistenceErrors !== null && { PreventUserExistenceErrors: input.PreventUserExistenceErrors }), + ...(input.ReadAttributes !== undefined && + input.ReadAttributes !== null && { + ReadAttributes: serializeAws_json1_1ClientPermissionListType(input.ReadAttributes, context), + }), + ...(input.RefreshTokenValidity !== undefined && + input.RefreshTokenValidity !== null && { RefreshTokenValidity: input.RefreshTokenValidity }), + ...(input.SupportedIdentityProviders !== undefined && + input.SupportedIdentityProviders !== null && { + SupportedIdentityProviders: serializeAws_json1_1SupportedIdentityProvidersListType( + input.SupportedIdentityProviders, + context + ), + }), + ...(input.TokenValidityUnits !== undefined && + input.TokenValidityUnits !== null && { + TokenValidityUnits: serializeAws_json1_1TokenValidityUnitsType(input.TokenValidityUnits, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.WriteAttributes !== undefined && + input.WriteAttributes !== null && { + WriteAttributes: serializeAws_json1_1ClientPermissionListType(input.WriteAttributes, context), + }), }; }; @@ -15093,62 +15319,79 @@ const serializeAws_json1_1UpdateUserPoolDomainRequest = ( context: __SerdeContext ): any => { return { - ...(input.CustomDomainConfig !== undefined && { - CustomDomainConfig: serializeAws_json1_1CustomDomainConfigType(input.CustomDomainConfig, context), - }), - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.CustomDomainConfig !== undefined && + input.CustomDomainConfig !== null && { + CustomDomainConfig: serializeAws_json1_1CustomDomainConfigType(input.CustomDomainConfig, context), + }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_json1_1UpdateUserPoolRequest = (input: UpdateUserPoolRequest, context: __SerdeContext): any => { return { - ...(input.AccountRecoverySetting !== undefined && { - AccountRecoverySetting: serializeAws_json1_1AccountRecoverySettingType(input.AccountRecoverySetting, context), - }), - ...(input.AdminCreateUserConfig !== undefined && { - AdminCreateUserConfig: serializeAws_json1_1AdminCreateUserConfigType(input.AdminCreateUserConfig, context), - }), - ...(input.AutoVerifiedAttributes !== undefined && { - AutoVerifiedAttributes: serializeAws_json1_1VerifiedAttributesListType(input.AutoVerifiedAttributes, context), - }), - ...(input.DeviceConfiguration !== undefined && { - DeviceConfiguration: serializeAws_json1_1DeviceConfigurationType(input.DeviceConfiguration, context), - }), - ...(input.EmailConfiguration !== undefined && { - EmailConfiguration: serializeAws_json1_1EmailConfigurationType(input.EmailConfiguration, context), - }), - ...(input.EmailVerificationMessage !== undefined && { EmailVerificationMessage: input.EmailVerificationMessage }), - ...(input.EmailVerificationSubject !== undefined && { EmailVerificationSubject: input.EmailVerificationSubject }), - ...(input.LambdaConfig !== undefined && { - LambdaConfig: serializeAws_json1_1LambdaConfigType(input.LambdaConfig, context), - }), - ...(input.MfaConfiguration !== undefined && { MfaConfiguration: input.MfaConfiguration }), - ...(input.Policies !== undefined && { Policies: serializeAws_json1_1UserPoolPolicyType(input.Policies, context) }), - ...(input.SmsAuthenticationMessage !== undefined && { SmsAuthenticationMessage: input.SmsAuthenticationMessage }), - ...(input.SmsConfiguration !== undefined && { - SmsConfiguration: serializeAws_json1_1SmsConfigurationType(input.SmsConfiguration, context), - }), - ...(input.SmsVerificationMessage !== undefined && { SmsVerificationMessage: input.SmsVerificationMessage }), - ...(input.UserPoolAddOns !== undefined && { - UserPoolAddOns: serializeAws_json1_1UserPoolAddOnsType(input.UserPoolAddOns, context), - }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), - ...(input.UserPoolTags !== undefined && { - UserPoolTags: serializeAws_json1_1UserPoolTagsType(input.UserPoolTags, context), - }), - ...(input.VerificationMessageTemplate !== undefined && { - VerificationMessageTemplate: serializeAws_json1_1VerificationMessageTemplateType( - input.VerificationMessageTemplate, - context - ), - }), + ...(input.AccountRecoverySetting !== undefined && + input.AccountRecoverySetting !== null && { + AccountRecoverySetting: serializeAws_json1_1AccountRecoverySettingType(input.AccountRecoverySetting, context), + }), + ...(input.AdminCreateUserConfig !== undefined && + input.AdminCreateUserConfig !== null && { + AdminCreateUserConfig: serializeAws_json1_1AdminCreateUserConfigType(input.AdminCreateUserConfig, context), + }), + ...(input.AutoVerifiedAttributes !== undefined && + input.AutoVerifiedAttributes !== null && { + AutoVerifiedAttributes: serializeAws_json1_1VerifiedAttributesListType(input.AutoVerifiedAttributes, context), + }), + ...(input.DeviceConfiguration !== undefined && + input.DeviceConfiguration !== null && { + DeviceConfiguration: serializeAws_json1_1DeviceConfigurationType(input.DeviceConfiguration, context), + }), + ...(input.EmailConfiguration !== undefined && + input.EmailConfiguration !== null && { + EmailConfiguration: serializeAws_json1_1EmailConfigurationType(input.EmailConfiguration, context), + }), + ...(input.EmailVerificationMessage !== undefined && + input.EmailVerificationMessage !== null && { EmailVerificationMessage: input.EmailVerificationMessage }), + ...(input.EmailVerificationSubject !== undefined && + input.EmailVerificationSubject !== null && { EmailVerificationSubject: input.EmailVerificationSubject }), + ...(input.LambdaConfig !== undefined && + input.LambdaConfig !== null && { + LambdaConfig: serializeAws_json1_1LambdaConfigType(input.LambdaConfig, context), + }), + ...(input.MfaConfiguration !== undefined && + input.MfaConfiguration !== null && { MfaConfiguration: input.MfaConfiguration }), + ...(input.Policies !== undefined && + input.Policies !== null && { Policies: serializeAws_json1_1UserPoolPolicyType(input.Policies, context) }), + ...(input.SmsAuthenticationMessage !== undefined && + input.SmsAuthenticationMessage !== null && { SmsAuthenticationMessage: input.SmsAuthenticationMessage }), + ...(input.SmsConfiguration !== undefined && + input.SmsConfiguration !== null && { + SmsConfiguration: serializeAws_json1_1SmsConfigurationType(input.SmsConfiguration, context), + }), + ...(input.SmsVerificationMessage !== undefined && + input.SmsVerificationMessage !== null && { SmsVerificationMessage: input.SmsVerificationMessage }), + ...(input.UserPoolAddOns !== undefined && + input.UserPoolAddOns !== null && { + UserPoolAddOns: serializeAws_json1_1UserPoolAddOnsType(input.UserPoolAddOns, context), + }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), + ...(input.UserPoolTags !== undefined && + input.UserPoolTags !== null && { + UserPoolTags: serializeAws_json1_1UserPoolTagsType(input.UserPoolTags, context), + }), + ...(input.VerificationMessageTemplate !== undefined && + input.VerificationMessageTemplate !== null && { + VerificationMessageTemplate: serializeAws_json1_1VerificationMessageTemplateType( + input.VerificationMessageTemplate, + context + ), + }), }; }; const serializeAws_json1_1UserContextDataType = (input: UserContextDataType, context: __SerdeContext): any => { return { - ...(input.EncodedData !== undefined && { EncodedData: input.EncodedData }), + ...(input.EncodedData !== undefined && input.EncodedData !== null && { EncodedData: input.EncodedData }), }; }; @@ -15156,7 +15399,14 @@ const serializeAws_json1_1UsernameAttributesListType = ( input: (UsernameAttributeType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UsernameConfigurationType = ( @@ -15164,36 +15414,47 @@ const serializeAws_json1_1UsernameConfigurationType = ( context: __SerdeContext ): any => { return { - ...(input.CaseSensitive !== undefined && { CaseSensitive: input.CaseSensitive }), + ...(input.CaseSensitive !== undefined && input.CaseSensitive !== null && { CaseSensitive: input.CaseSensitive }), }; }; const serializeAws_json1_1UserPoolAddOnsType = (input: UserPoolAddOnsType, context: __SerdeContext): any => { return { - ...(input.AdvancedSecurityMode !== undefined && { AdvancedSecurityMode: input.AdvancedSecurityMode }), + ...(input.AdvancedSecurityMode !== undefined && + input.AdvancedSecurityMode !== null && { AdvancedSecurityMode: input.AdvancedSecurityMode }), }; }; const serializeAws_json1_1UserPoolPolicyType = (input: UserPoolPolicyType, context: __SerdeContext): any => { return { - ...(input.PasswordPolicy !== undefined && { - PasswordPolicy: serializeAws_json1_1PasswordPolicyType(input.PasswordPolicy, context), - }), + ...(input.PasswordPolicy !== undefined && + input.PasswordPolicy !== null && { + PasswordPolicy: serializeAws_json1_1PasswordPolicyType(input.PasswordPolicy, context), + }), }; }; const serializeAws_json1_1UserPoolTagsListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UserPoolTagsType = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1VerificationMessageTemplateType = ( @@ -15201,12 +15462,15 @@ const serializeAws_json1_1VerificationMessageTemplateType = ( context: __SerdeContext ): any => { return { - ...(input.DefaultEmailOption !== undefined && { DefaultEmailOption: input.DefaultEmailOption }), - ...(input.EmailMessage !== undefined && { EmailMessage: input.EmailMessage }), - ...(input.EmailMessageByLink !== undefined && { EmailMessageByLink: input.EmailMessageByLink }), - ...(input.EmailSubject !== undefined && { EmailSubject: input.EmailSubject }), - ...(input.EmailSubjectByLink !== undefined && { EmailSubjectByLink: input.EmailSubjectByLink }), - ...(input.SmsMessage !== undefined && { SmsMessage: input.SmsMessage }), + ...(input.DefaultEmailOption !== undefined && + input.DefaultEmailOption !== null && { DefaultEmailOption: input.DefaultEmailOption }), + ...(input.EmailMessage !== undefined && input.EmailMessage !== null && { EmailMessage: input.EmailMessage }), + ...(input.EmailMessageByLink !== undefined && + input.EmailMessageByLink !== null && { EmailMessageByLink: input.EmailMessageByLink }), + ...(input.EmailSubject !== undefined && input.EmailSubject !== null && { EmailSubject: input.EmailSubject }), + ...(input.EmailSubjectByLink !== undefined && + input.EmailSubjectByLink !== null && { EmailSubjectByLink: input.EmailSubjectByLink }), + ...(input.SmsMessage !== undefined && input.SmsMessage !== null && { SmsMessage: input.SmsMessage }), }; }; @@ -15214,7 +15478,14 @@ const serializeAws_json1_1VerifiedAttributesListType = ( input: (VerifiedAttributeType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1VerifySoftwareTokenRequest = ( @@ -15222,10 +15493,11 @@ const serializeAws_json1_1VerifySoftwareTokenRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.FriendlyDeviceName !== undefined && { FriendlyDeviceName: input.FriendlyDeviceName }), - ...(input.Session !== undefined && { Session: input.Session }), - ...(input.UserCode !== undefined && { UserCode: input.UserCode }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.FriendlyDeviceName !== undefined && + input.FriendlyDeviceName !== null && { FriendlyDeviceName: input.FriendlyDeviceName }), + ...(input.Session !== undefined && input.Session !== null && { Session: input.Session }), + ...(input.UserCode !== undefined && input.UserCode !== null && { UserCode: input.UserCode }), }; }; @@ -15234,9 +15506,9 @@ const serializeAws_json1_1VerifyUserAttributeRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.Code !== undefined && { Code: input.Code }), + ...(input.AccessToken !== undefined && input.AccessToken !== null && { AccessToken: input.AccessToken }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.Code !== undefined && input.Code !== null && { Code: input.Code }), }; }; @@ -15558,7 +15830,14 @@ const deserializeAws_json1_1AliasAttributesListType = ( output: any, context: __SerdeContext ): (AliasAttributeType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AliasExistsException = (output: any, context: __SerdeContext): AliasExistsException => { @@ -15594,20 +15873,29 @@ const deserializeAws_json1_1AssociateSoftwareTokenResponse = ( }; const deserializeAws_json1_1AttributeListType = (output: any, context: __SerdeContext): AttributeType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttributeType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttributeType(entry, context); + }); }; const deserializeAws_json1_1AttributeMappingType = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1AttributeType = (output: any, context: __SerdeContext): AttributeType => { @@ -15635,7 +15923,14 @@ const deserializeAws_json1_1AuthenticationResultType = ( }; const deserializeAws_json1_1AuthEventsType = (output: any, context: __SerdeContext): AuthEventType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AuthEventType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AuthEventType(entry, context); + }); }; const deserializeAws_json1_1AuthEventType = (output: any, context: __SerdeContext): AuthEventType => { @@ -15668,31 +15963,54 @@ const deserializeAws_json1_1AuthEventType = (output: any, context: __SerdeContex }; const deserializeAws_json1_1BlockedIPRangeListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CallbackURLsListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ChallengeParametersType = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ChallengeResponseListType = ( output: any, context: __SerdeContext ): ChallengeResponseType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ChallengeResponseType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ChallengeResponseType(entry, context); + }); }; const deserializeAws_json1_1ChallengeResponseType = (output: any, context: __SerdeContext): ChallengeResponseType => { @@ -15711,14 +16029,28 @@ const deserializeAws_json1_1ChangePasswordResponse = (output: any, context: __Se }; const deserializeAws_json1_1ClientPermissionListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CodeDeliveryDetailsListType = ( output: any, context: __SerdeContext ): CodeDeliveryDetailsType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CodeDeliveryDetailsType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CodeDeliveryDetailsType(entry, context); + }); }; const deserializeAws_json1_1CodeDeliveryDetailsType = ( @@ -16023,7 +16355,14 @@ const deserializeAws_json1_1DeviceConfigurationType = ( }; const deserializeAws_json1_1DeviceListType = (output: any, context: __SerdeContext): DeviceType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeviceType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeviceType(entry, context); + }); }; const deserializeAws_json1_1DeviceType = (output: any, context: __SerdeContext): DeviceType => { @@ -16125,7 +16464,14 @@ const deserializeAws_json1_1EventFeedbackType = (output: any, context: __SerdeCo }; const deserializeAws_json1_1EventFiltersType = (output: any, context: __SerdeContext): (EventFilterType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1EventRiskType = (output: any, context: __SerdeContext): EventRiskType => { @@ -16149,7 +16495,14 @@ const deserializeAws_json1_1ExplicitAuthFlowsListType = ( output: any, context: __SerdeContext ): (ExplicitAuthFlowsType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ForgotPasswordResponse = (output: any, context: __SerdeContext): ForgotPasswordResponse => { @@ -16285,7 +16638,14 @@ const deserializeAws_json1_1GroupExistsException = (output: any, context: __Serd }; const deserializeAws_json1_1GroupListType = (output: any, context: __SerdeContext): GroupType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GroupType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GroupType(entry, context); + }); }; const deserializeAws_json1_1GroupType = (output: any, context: __SerdeContext): GroupType => { @@ -16335,7 +16695,14 @@ const deserializeAws_json1_1IdentityProviderType = (output: any, context: __Serd }; const deserializeAws_json1_1IdpIdentifiersListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InitiateAuthResponse = (output: any, context: __SerdeContext): InitiateAuthResponse => { @@ -16518,7 +16885,14 @@ const deserializeAws_json1_1ListIdentityProvidersResponse = ( }; const deserializeAws_json1_1ListOfStringTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ListResourceServersResponse = ( @@ -16608,7 +16982,14 @@ const deserializeAws_json1_1ListUsersResponse = (output: any, context: __SerdeCo }; const deserializeAws_json1_1LogoutURLsListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1MessageTemplateType = (output: any, context: __SerdeContext): MessageTemplateType => { @@ -16629,7 +17010,14 @@ const deserializeAws_json1_1MFAMethodNotFoundException = ( }; const deserializeAws_json1_1MFAOptionListType = (output: any, context: __SerdeContext): MFAOptionType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MFAOptionType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MFAOptionType(entry, context); + }); }; const deserializeAws_json1_1MFAOptionType = (output: any, context: __SerdeContext): MFAOptionType => { @@ -16697,7 +17085,14 @@ const deserializeAws_json1_1NumberAttributeConstraintsType = ( }; const deserializeAws_json1_1OAuthFlowsType = (output: any, context: __SerdeContext): (OAuthFlowType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PasswordPolicyType = (output: any, context: __SerdeContext): PasswordPolicyType => { @@ -16753,21 +17148,37 @@ const deserializeAws_json1_1ProviderDescription = (output: any, context: __Serde }; const deserializeAws_json1_1ProviderDetailsType = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ProvidersListType = (output: any, context: __SerdeContext): ProviderDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProviderDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProviderDescription(entry, context); + }); }; const deserializeAws_json1_1RecoveryMechanismsType = (output: any, context: __SerdeContext): RecoveryOptionType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RecoveryOptionType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RecoveryOptionType(entry, context); + }); }; const deserializeAws_json1_1RecoveryOptionType = (output: any, context: __SerdeContext): RecoveryOptionType => { @@ -16802,7 +17213,14 @@ const deserializeAws_json1_1ResourceServerScopeListType = ( output: any, context: __SerdeContext ): ResourceServerScopeType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceServerScopeType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceServerScopeType(entry, context); + }); }; const deserializeAws_json1_1ResourceServerScopeType = ( @@ -16817,7 +17235,14 @@ const deserializeAws_json1_1ResourceServerScopeType = ( }; const deserializeAws_json1_1ResourceServersListType = (output: any, context: __SerdeContext): ResourceServerType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceServerType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceServerType(entry, context); + }); }; const deserializeAws_json1_1ResourceServerType = (output: any, context: __SerdeContext): ResourceServerType => { @@ -16898,7 +17323,14 @@ const deserializeAws_json1_1SchemaAttributesListType = ( output: any, context: __SerdeContext ): SchemaAttributeType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SchemaAttributeType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SchemaAttributeType(entry, context); + }); }; const deserializeAws_json1_1SchemaAttributeType = (output: any, context: __SerdeContext): SchemaAttributeType => { @@ -16935,7 +17367,14 @@ const deserializeAws_json1_1ScopeDoesNotExistException = ( }; const deserializeAws_json1_1ScopeListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SetRiskConfigurationResponse = ( @@ -17007,7 +17446,14 @@ const deserializeAws_json1_1SignUpResponse = (output: any, context: __SerdeConte }; const deserializeAws_json1_1SkippedIPRangeListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SmsConfigurationType = (output: any, context: __SerdeContext): SmsConfigurationType => { @@ -17083,7 +17529,14 @@ const deserializeAws_json1_1StringAttributeConstraintsType = ( }; const deserializeAws_json1_1SupportedIdentityProvidersListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -17260,7 +17713,14 @@ const deserializeAws_json1_1UserImportInProgressException = ( }; const deserializeAws_json1_1UserImportJobsListType = (output: any, context: __SerdeContext): UserImportJobType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserImportJobType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserImportJobType(entry, context); + }); }; const deserializeAws_json1_1UserImportJobType = (output: any, context: __SerdeContext): UserImportJobType => { @@ -17307,14 +17767,28 @@ const deserializeAws_json1_1UserLambdaValidationException = ( }; const deserializeAws_json1_1UserMFASettingListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1UsernameAttributesListType = ( output: any, context: __SerdeContext ): (UsernameAttributeType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1UsernameConfigurationType = ( @@ -17384,7 +17858,14 @@ const deserializeAws_json1_1UserPoolClientListType = ( output: any, context: __SerdeContext ): UserPoolClientDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserPoolClientDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserPoolClientDescription(entry, context); + }); }; const deserializeAws_json1_1UserPoolClientType = (output: any, context: __SerdeContext): UserPoolClientType => { @@ -17490,7 +17971,14 @@ const deserializeAws_json1_1UserPoolDescriptionType = ( }; const deserializeAws_json1_1UserPoolListType = (output: any, context: __SerdeContext): UserPoolDescriptionType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserPoolDescriptionType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserPoolDescriptionType(entry, context); + }); }; const deserializeAws_json1_1UserPoolPolicyType = (output: any, context: __SerdeContext): UserPoolPolicyType => { @@ -17512,13 +18000,15 @@ const deserializeAws_json1_1UserPoolTaggingException = ( }; const deserializeAws_json1_1UserPoolTagsType = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1UserPoolType = (output: any, context: __SerdeContext): UserPoolType => { @@ -17631,7 +18121,14 @@ const deserializeAws_json1_1UserPoolType = (output: any, context: __SerdeContext }; const deserializeAws_json1_1UsersListType = (output: any, context: __SerdeContext): UserType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserType(entry, context); + }); }; const deserializeAws_json1_1UserType = (output: any, context: __SerdeContext): UserType => { @@ -17685,7 +18182,14 @@ const deserializeAws_json1_1VerifiedAttributesListType = ( output: any, context: __SerdeContext ): (VerifiedAttributeType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1VerifySoftwareTokenResponse = ( @@ -17755,3 +18259,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-cognito-identity/protocols/Aws_json1_1.ts b/clients/client-cognito-identity/protocols/Aws_json1_1.ts index af33b73d3e7e..6f94d3853a7a 100644 --- a/clients/client-cognito-identity/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity/protocols/Aws_json1_1.ts @@ -116,7 +116,7 @@ export const serializeAws_json1_1CreateIdentityPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.CreateIdentityPool", }; let body: any; @@ -129,7 +129,7 @@ export const serializeAws_json1_1DeleteIdentitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.DeleteIdentities", }; let body: any; @@ -142,7 +142,7 @@ export const serializeAws_json1_1DeleteIdentityPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.DeleteIdentityPool", }; let body: any; @@ -155,7 +155,7 @@ export const serializeAws_json1_1DescribeIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.DescribeIdentity", }; let body: any; @@ -168,7 +168,7 @@ export const serializeAws_json1_1DescribeIdentityPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.DescribeIdentityPool", }; let body: any; @@ -181,7 +181,7 @@ export const serializeAws_json1_1GetCredentialsForIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.GetCredentialsForIdentity", }; let body: any; @@ -194,7 +194,7 @@ export const serializeAws_json1_1GetIdCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.GetId", }; let body: any; @@ -207,7 +207,7 @@ export const serializeAws_json1_1GetIdentityPoolRolesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.GetIdentityPoolRoles", }; let body: any; @@ -220,7 +220,7 @@ export const serializeAws_json1_1GetOpenIdTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.GetOpenIdToken", }; let body: any; @@ -233,7 +233,7 @@ export const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity", }; let body: any; @@ -246,7 +246,7 @@ export const serializeAws_json1_1ListIdentitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.ListIdentities", }; let body: any; @@ -259,7 +259,7 @@ export const serializeAws_json1_1ListIdentityPoolsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.ListIdentityPools", }; let body: any; @@ -272,7 +272,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.ListTagsForResource", }; let body: any; @@ -285,7 +285,7 @@ export const serializeAws_json1_1LookupDeveloperIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.LookupDeveloperIdentity", }; let body: any; @@ -298,7 +298,7 @@ export const serializeAws_json1_1MergeDeveloperIdentitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.MergeDeveloperIdentities", }; let body: any; @@ -311,7 +311,7 @@ export const serializeAws_json1_1SetIdentityPoolRolesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.SetIdentityPoolRoles", }; let body: any; @@ -324,7 +324,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.TagResource", }; let body: any; @@ -337,7 +337,7 @@ export const serializeAws_json1_1UnlinkDeveloperIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.UnlinkDeveloperIdentity", }; let body: any; @@ -350,7 +350,7 @@ export const serializeAws_json1_1UnlinkIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.UnlinkIdentity", }; let body: any; @@ -363,7 +363,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.UntagResource", }; let body: any; @@ -376,7 +376,7 @@ export const serializeAws_json1_1UpdateIdentityPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSCognitoIdentityService.UpdateIdentityPool", }; let body: any; @@ -411,8 +411,7 @@ const deserializeAws_json1_1CreateIdentityPoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -506,8 +505,7 @@ const deserializeAws_json1_1DeleteIdentitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -574,8 +572,7 @@ const deserializeAws_json1_1DeleteIdentityPoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -661,8 +658,7 @@ const deserializeAws_json1_1DescribeIdentityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -748,8 +744,7 @@ const deserializeAws_json1_1DescribeIdentityPoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -835,8 +830,7 @@ const deserializeAws_json1_1GetCredentialsForIdentityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExternalServiceException": case "com.amazonaws.cognitoidentity#ExternalServiceException": @@ -946,8 +940,7 @@ const deserializeAws_json1_1GetIdCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExternalServiceException": case "com.amazonaws.cognitoidentity#ExternalServiceException": @@ -1057,8 +1050,7 @@ const deserializeAws_json1_1GetIdentityPoolRolesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -1152,8 +1144,7 @@ const deserializeAws_json1_1GetOpenIdTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExternalServiceException": case "com.amazonaws.cognitoidentity#ExternalServiceException": @@ -1255,8 +1246,7 @@ const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DeveloperUserAlreadyRegisteredException": case "com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException": @@ -1358,8 +1348,7 @@ const deserializeAws_json1_1ListIdentitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -1445,8 +1434,7 @@ const deserializeAws_json1_1ListIdentityPoolsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -1532,8 +1520,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -1619,8 +1606,7 @@ const deserializeAws_json1_1LookupDeveloperIdentityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -1714,8 +1700,7 @@ const deserializeAws_json1_1MergeDeveloperIdentitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -1806,8 +1791,7 @@ const deserializeAws_json1_1SetIdentityPoolRolesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cognitoidentity#ConcurrentModificationException": @@ -1909,8 +1893,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -1993,8 +1976,7 @@ const deserializeAws_json1_1UnlinkDeveloperIdentityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -2085,8 +2067,7 @@ const deserializeAws_json1_1UnlinkIdentityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExternalServiceException": case "com.amazonaws.cognitoidentity#ExternalServiceException": @@ -2188,8 +2169,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": @@ -2275,8 +2255,7 @@ const deserializeAws_json1_1UpdateIdentityPoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.cognitoidentity#ConcurrentModificationException": @@ -2526,9 +2505,10 @@ const deserializeAws_json1_1TooManyRequestsExceptionResponse = async ( const serializeAws_json1_1CognitoIdentityProvider = (input: CognitoIdentityProvider, context: __SerdeContext): any => { return { - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ProviderName !== undefined && { ProviderName: input.ProviderName }), - ...(input.ServerSideTokenCheck !== undefined && { ServerSideTokenCheck: input.ServerSideTokenCheck }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }), + ...(input.ServerSideTokenCheck !== undefined && + input.ServerSideTokenCheck !== null && { ServerSideTokenCheck: input.ServerSideTokenCheck }), }; }; @@ -2536,55 +2516,73 @@ const serializeAws_json1_1CognitoIdentityProviderList = ( input: CognitoIdentityProvider[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CognitoIdentityProvider(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CognitoIdentityProvider(entry, context); + }); }; const serializeAws_json1_1CreateIdentityPoolInput = (input: CreateIdentityPoolInput, context: __SerdeContext): any => { return { - ...(input.AllowClassicFlow !== undefined && { AllowClassicFlow: input.AllowClassicFlow }), - ...(input.AllowUnauthenticatedIdentities !== undefined && { - AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities, - }), - ...(input.CognitoIdentityProviders !== undefined && { - CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList( - input.CognitoIdentityProviders, - context - ), - }), - ...(input.DeveloperProviderName !== undefined && { DeveloperProviderName: input.DeveloperProviderName }), - ...(input.IdentityPoolName !== undefined && { IdentityPoolName: input.IdentityPoolName }), - ...(input.IdentityPoolTags !== undefined && { - IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context), - }), - ...(input.OpenIdConnectProviderARNs !== undefined && { - OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context), - }), - ...(input.SamlProviderARNs !== undefined && { - SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context), - }), - ...(input.SupportedLoginProviders !== undefined && { - SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context), - }), + ...(input.AllowClassicFlow !== undefined && + input.AllowClassicFlow !== null && { AllowClassicFlow: input.AllowClassicFlow }), + ...(input.AllowUnauthenticatedIdentities !== undefined && + input.AllowUnauthenticatedIdentities !== null && { + AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities, + }), + ...(input.CognitoIdentityProviders !== undefined && + input.CognitoIdentityProviders !== null && { + CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList( + input.CognitoIdentityProviders, + context + ), + }), + ...(input.DeveloperProviderName !== undefined && + input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.IdentityPoolName !== undefined && + input.IdentityPoolName !== null && { IdentityPoolName: input.IdentityPoolName }), + ...(input.IdentityPoolTags !== undefined && + input.IdentityPoolTags !== null && { + IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context), + }), + ...(input.OpenIdConnectProviderARNs !== undefined && + input.OpenIdConnectProviderARNs !== null && { + OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context), + }), + ...(input.SamlProviderARNs !== undefined && + input.SamlProviderARNs !== null && { + SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context), + }), + ...(input.SupportedLoginProviders !== undefined && + input.SupportedLoginProviders !== null && { + SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context), + }), }; }; const serializeAws_json1_1DeleteIdentitiesInput = (input: DeleteIdentitiesInput, context: __SerdeContext): any => { return { - ...(input.IdentityIdsToDelete !== undefined && { - IdentityIdsToDelete: serializeAws_json1_1IdentityIdList(input.IdentityIdsToDelete, context), - }), + ...(input.IdentityIdsToDelete !== undefined && + input.IdentityIdsToDelete !== null && { + IdentityIdsToDelete: serializeAws_json1_1IdentityIdList(input.IdentityIdsToDelete, context), + }), }; }; const serializeAws_json1_1DeleteIdentityPoolInput = (input: DeleteIdentityPoolInput, context: __SerdeContext): any => { return { - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), }; }; const serializeAws_json1_1DescribeIdentityInput = (input: DescribeIdentityInput, context: __SerdeContext): any => { return { - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), }; }; @@ -2593,7 +2591,8 @@ const serializeAws_json1_1DescribeIdentityPoolInput = ( context: __SerdeContext ): any => { return { - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), }; }; @@ -2602,9 +2601,10 @@ const serializeAws_json1_1GetCredentialsForIdentityInput = ( context: __SerdeContext ): any => { return { - ...(input.CustomRoleArn !== undefined && { CustomRoleArn: input.CustomRoleArn }), - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.Logins !== undefined && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + ...(input.CustomRoleArn !== undefined && input.CustomRoleArn !== null && { CustomRoleArn: input.CustomRoleArn }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.Logins !== undefined && + input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), }; }; @@ -2613,15 +2613,18 @@ const serializeAws_json1_1GetIdentityPoolRolesInput = ( context: __SerdeContext ): any => { return { - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), }; }; const serializeAws_json1_1GetIdInput = (input: GetIdInput, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), - ...(input.Logins !== undefined && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.Logins !== undefined && + input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), }; }; @@ -2630,91 +2633,123 @@ const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput = ( context: __SerdeContext ): any => { return { - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), - ...(input.Logins !== undefined && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), - ...(input.TokenDuration !== undefined && { TokenDuration: input.TokenDuration }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.Logins !== undefined && + input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + ...(input.TokenDuration !== undefined && input.TokenDuration !== null && { TokenDuration: input.TokenDuration }), }; }; const serializeAws_json1_1GetOpenIdTokenInput = (input: GetOpenIdTokenInput, context: __SerdeContext): any => { return { - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.Logins !== undefined && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.Logins !== undefined && + input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), }; }; const serializeAws_json1_1IdentityIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IdentityPool = (input: IdentityPool, context: __SerdeContext): any => { return { - ...(input.AllowClassicFlow !== undefined && { AllowClassicFlow: input.AllowClassicFlow }), - ...(input.AllowUnauthenticatedIdentities !== undefined && { - AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities, - }), - ...(input.CognitoIdentityProviders !== undefined && { - CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList( - input.CognitoIdentityProviders, - context - ), - }), - ...(input.DeveloperProviderName !== undefined && { DeveloperProviderName: input.DeveloperProviderName }), - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), - ...(input.IdentityPoolName !== undefined && { IdentityPoolName: input.IdentityPoolName }), - ...(input.IdentityPoolTags !== undefined && { - IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context), - }), - ...(input.OpenIdConnectProviderARNs !== undefined && { - OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context), - }), - ...(input.SamlProviderARNs !== undefined && { - SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context), - }), - ...(input.SupportedLoginProviders !== undefined && { - SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context), - }), + ...(input.AllowClassicFlow !== undefined && + input.AllowClassicFlow !== null && { AllowClassicFlow: input.AllowClassicFlow }), + ...(input.AllowUnauthenticatedIdentities !== undefined && + input.AllowUnauthenticatedIdentities !== null && { + AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities, + }), + ...(input.CognitoIdentityProviders !== undefined && + input.CognitoIdentityProviders !== null && { + CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList( + input.CognitoIdentityProviders, + context + ), + }), + ...(input.DeveloperProviderName !== undefined && + input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.IdentityPoolName !== undefined && + input.IdentityPoolName !== null && { IdentityPoolName: input.IdentityPoolName }), + ...(input.IdentityPoolTags !== undefined && + input.IdentityPoolTags !== null && { + IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context), + }), + ...(input.OpenIdConnectProviderARNs !== undefined && + input.OpenIdConnectProviderARNs !== null && { + OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context), + }), + ...(input.SamlProviderARNs !== undefined && + input.SamlProviderARNs !== null && { + SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context), + }), + ...(input.SupportedLoginProviders !== undefined && + input.SupportedLoginProviders !== null && { + SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context), + }), }; }; const serializeAws_json1_1IdentityPoolTagsListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IdentityPoolTagsType = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1IdentityProviders = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ListIdentitiesInput = (input: ListIdentitiesInput, context: __SerdeContext): any => { return { - ...(input.HideDisabled !== undefined && { HideDisabled: input.HideDisabled }), - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.HideDisabled !== undefined && input.HideDisabled !== null && { HideDisabled: input.HideDisabled }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListIdentityPoolsInput = (input: ListIdentityPoolsInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2723,22 +2758,31 @@ const serializeAws_json1_1ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1LoginsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1LoginsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1LookupDeveloperIdentityInput = ( @@ -2746,25 +2790,34 @@ const serializeAws_json1_1LookupDeveloperIdentityInput = ( context: __SerdeContext ): any => { return { - ...(input.DeveloperUserIdentifier !== undefined && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }), - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DeveloperUserIdentifier !== undefined && + input.DeveloperUserIdentifier !== null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1MappingRule = (input: MappingRule, context: __SerdeContext): any => { return { - ...(input.Claim !== undefined && { Claim: input.Claim }), - ...(input.MatchType !== undefined && { MatchType: input.MatchType }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Claim !== undefined && input.Claim !== null && { Claim: input.Claim }), + ...(input.MatchType !== undefined && input.MatchType !== null && { MatchType: input.MatchType }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1MappingRulesList = (input: MappingRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MappingRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MappingRule(entry, context); + }); }; const serializeAws_json1_1MergeDeveloperIdentitiesInput = ( @@ -2772,57 +2825,80 @@ const serializeAws_json1_1MergeDeveloperIdentitiesInput = ( context: __SerdeContext ): any => { return { - ...(input.DestinationUserIdentifier !== undefined && { - DestinationUserIdentifier: input.DestinationUserIdentifier, - }), - ...(input.DeveloperProviderName !== undefined && { DeveloperProviderName: input.DeveloperProviderName }), - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), - ...(input.SourceUserIdentifier !== undefined && { SourceUserIdentifier: input.SourceUserIdentifier }), + ...(input.DestinationUserIdentifier !== undefined && + input.DestinationUserIdentifier !== null && { DestinationUserIdentifier: input.DestinationUserIdentifier }), + ...(input.DeveloperProviderName !== undefined && + input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.SourceUserIdentifier !== undefined && + input.SourceUserIdentifier !== null && { SourceUserIdentifier: input.SourceUserIdentifier }), }; }; const serializeAws_json1_1OIDCProviderList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RoleMapping = (input: RoleMapping, context: __SerdeContext): any => { return { - ...(input.AmbiguousRoleResolution !== undefined && { AmbiguousRoleResolution: input.AmbiguousRoleResolution }), - ...(input.RulesConfiguration !== undefined && { - RulesConfiguration: serializeAws_json1_1RulesConfigurationType(input.RulesConfiguration, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.AmbiguousRoleResolution !== undefined && + input.AmbiguousRoleResolution !== null && { AmbiguousRoleResolution: input.AmbiguousRoleResolution }), + ...(input.RulesConfiguration !== undefined && + input.RulesConfiguration !== null && { + RulesConfiguration: serializeAws_json1_1RulesConfigurationType(input.RulesConfiguration, context), + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1RoleMappingMap = (input: { [key: string]: RoleMapping }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: RoleMapping }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: RoleMapping }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1RoleMapping(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1RolesMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1RulesConfigurationType = (input: RulesConfigurationType, context: __SerdeContext): any => { return { - ...(input.Rules !== undefined && { Rules: serializeAws_json1_1MappingRulesList(input.Rules, context) }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_json1_1MappingRulesList(input.Rules, context) }), }; }; const serializeAws_json1_1SAMLProviderList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SetIdentityPoolRolesInput = ( @@ -2830,18 +2906,20 @@ const serializeAws_json1_1SetIdentityPoolRolesInput = ( context: __SerdeContext ): any => { return { - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), - ...(input.RoleMappings !== undefined && { - RoleMappings: serializeAws_json1_1RoleMappingMap(input.RoleMappings, context), - }), - ...(input.Roles !== undefined && { Roles: serializeAws_json1_1RolesMap(input.Roles, context) }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.RoleMappings !== undefined && + input.RoleMappings !== null && { RoleMappings: serializeAws_json1_1RoleMappingMap(input.RoleMappings, context) }), + ...(input.Roles !== undefined && + input.Roles !== null && { Roles: serializeAws_json1_1RolesMap(input.Roles, context) }), }; }; const serializeAws_json1_1TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1IdentityPoolTagsType(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1IdentityPoolTagsType(input.Tags, context) }), }; }; @@ -2850,29 +2928,33 @@ const serializeAws_json1_1UnlinkDeveloperIdentityInput = ( context: __SerdeContext ): any => { return { - ...(input.DeveloperProviderName !== undefined && { DeveloperProviderName: input.DeveloperProviderName }), - ...(input.DeveloperUserIdentifier !== undefined && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }), - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), + ...(input.DeveloperProviderName !== undefined && + input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }), + ...(input.DeveloperUserIdentifier !== undefined && + input.DeveloperUserIdentifier !== null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), }; }; const serializeAws_json1_1UnlinkIdentityInput = (input: UnlinkIdentityInput, context: __SerdeContext): any => { return { - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.Logins !== undefined && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), - ...(input.LoginsToRemove !== undefined && { - LoginsToRemove: serializeAws_json1_1LoginsList(input.LoginsToRemove, context), - }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.Logins !== undefined && + input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }), + ...(input.LoginsToRemove !== undefined && + input.LoginsToRemove !== null && { + LoginsToRemove: serializeAws_json1_1LoginsList(input.LoginsToRemove, context), + }), }; }; const serializeAws_json1_1UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { - TagKeys: serializeAws_json1_1IdentityPoolTagsListType(input.TagKeys, context), - }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1IdentityPoolTagsListType(input.TagKeys, context) }), }; }; @@ -2894,7 +2976,14 @@ const deserializeAws_json1_1CognitoIdentityProviderList = ( output: any, context: __SerdeContext ): CognitoIdentityProvider[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CognitoIdentityProvider(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CognitoIdentityProvider(entry, context); + }); }; const deserializeAws_json1_1ConcurrentModificationException = ( @@ -2940,7 +3029,14 @@ const deserializeAws_json1_1DeveloperUserAlreadyRegisteredException = ( }; const deserializeAws_json1_1DeveloperUserIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ExternalServiceException = ( @@ -3007,7 +3103,14 @@ const deserializeAws_json1_1GetOpenIdTokenResponse = (output: any, context: __Se }; const deserializeAws_json1_1IdentitiesList = (output: any, context: __SerdeContext): IdentityDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IdentityDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IdentityDescription(entry, context); + }); }; const deserializeAws_json1_1IdentityDescription = (output: any, context: __SerdeContext): IdentityDescription => { @@ -3083,30 +3186,41 @@ const deserializeAws_json1_1IdentityPoolsList = ( output: any, context: __SerdeContext ): IdentityPoolShortDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IdentityPoolShortDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IdentityPoolShortDescription(entry, context); + }); }; const deserializeAws_json1_1IdentityPoolTagsType = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1IdentityProviders = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1InternalErrorException = (output: any, context: __SerdeContext): InternalErrorException => { @@ -3177,7 +3291,14 @@ const deserializeAws_json1_1ListTagsForResourceResponse = ( }; const deserializeAws_json1_1LoginsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1LookupDeveloperIdentityResponse = ( @@ -3204,7 +3325,14 @@ const deserializeAws_json1_1MappingRule = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1MappingRulesList = (output: any, context: __SerdeContext): MappingRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MappingRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MappingRule(entry, context); + }); }; const deserializeAws_json1_1MergeDeveloperIdentitiesResponse = ( @@ -3223,7 +3351,14 @@ const deserializeAws_json1_1NotAuthorizedException = (output: any, context: __Se }; const deserializeAws_json1_1OIDCProviderList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceConflictException = ( @@ -3259,23 +3394,27 @@ const deserializeAws_json1_1RoleMapping = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1RoleMappingMap = (output: any, context: __SerdeContext): { [key: string]: RoleMapping } => { - return Object.entries(output).reduce( - (acc: { [key: string]: RoleMapping }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: RoleMapping }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1RoleMapping(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1RolesMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1RulesConfigurationType = (output: any, context: __SerdeContext): RulesConfigurationType => { @@ -3288,7 +3427,14 @@ const deserializeAws_json1_1RulesConfigurationType = (output: any, context: __Se }; const deserializeAws_json1_1SAMLProviderList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -3315,7 +3461,14 @@ const deserializeAws_json1_1UnprocessedIdentityIdList = ( output: any, context: __SerdeContext ): UnprocessedIdentityId[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UnprocessedIdentityId(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UnprocessedIdentityId(entry, context); + }); }; const deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => { @@ -3372,3 +3525,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-cognito-sync/protocols/Aws_restJson1.ts b/clients/client-cognito-sync/protocols/Aws_restJson1.ts index 1f31d733154e..3515202ac9fe 100644 --- a/clients/client-cognito-sync/protocols/Aws_restJson1.ts +++ b/clients/client-cognito-sync/protocols/Aws_restJson1.ts @@ -75,9 +75,7 @@ export const serializeAws_restJson1BulkPublishCommand = async ( input: BulkPublishCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/bulkpublish"; if (input.IdentityPoolId !== undefined) { const labelValue: string = input.IdentityPoolId; @@ -105,9 +103,7 @@ export const serializeAws_restJson1DeleteDatasetCommand = async ( input: DeleteDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}"; if (input.DatasetName !== undefined) { const labelValue: string = input.DatasetName; @@ -153,9 +149,7 @@ export const serializeAws_restJson1DescribeDatasetCommand = async ( input: DescribeDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}"; if (input.IdentityId !== undefined) { const labelValue: string = input.IdentityId; @@ -201,9 +195,7 @@ export const serializeAws_restJson1DescribeIdentityPoolUsageCommand = async ( input: DescribeIdentityPoolUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}"; if (input.IdentityPoolId !== undefined) { const labelValue: string = input.IdentityPoolId; @@ -231,9 +223,7 @@ export const serializeAws_restJson1DescribeIdentityUsageCommand = async ( input: DescribeIdentityUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/identities/{IdentityId}"; if (input.IdentityId !== undefined) { const labelValue: string = input.IdentityId; @@ -270,9 +260,7 @@ export const serializeAws_restJson1GetBulkPublishDetailsCommand = async ( input: GetBulkPublishDetailsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/getBulkPublishDetails"; if (input.IdentityPoolId !== undefined) { const labelValue: string = input.IdentityPoolId; @@ -300,9 +288,7 @@ export const serializeAws_restJson1GetCognitoEventsCommand = async ( input: GetCognitoEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/events"; if (input.IdentityPoolId !== undefined) { const labelValue: string = input.IdentityPoolId; @@ -330,9 +316,7 @@ export const serializeAws_restJson1GetIdentityPoolConfigurationCommand = async ( input: GetIdentityPoolConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/configuration"; if (input.IdentityPoolId !== undefined) { const labelValue: string = input.IdentityPoolId; @@ -360,9 +344,7 @@ export const serializeAws_restJson1ListDatasetsCommand = async ( input: ListDatasetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets"; if (input.IdentityPoolId !== undefined) { const labelValue: string = input.IdentityPoolId; @@ -404,9 +386,7 @@ export const serializeAws_restJson1ListIdentityPoolUsageCommand = async ( input: ListIdentityPoolUsageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -430,9 +410,7 @@ export const serializeAws_restJson1ListRecordsCommand = async ( input: ListRecordsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/records"; if (input.IdentityId !== undefined) { const labelValue: string = input.IdentityId; @@ -486,7 +464,7 @@ export const serializeAws_restJson1RegisterDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/identitypools/{IdentityPoolId}/identity/{IdentityId}/device"; if (input.IdentityPoolId !== undefined) { @@ -509,8 +487,8 @@ export const serializeAws_restJson1RegisterDeviceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Platform !== undefined && { Platform: input.Platform }), - ...(input.Token !== undefined && { Token: input.Token }), + ...(input.Platform !== undefined && input.Platform !== null && { Platform: input.Platform }), + ...(input.Token !== undefined && input.Token !== null && { Token: input.Token }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -529,7 +507,7 @@ export const serializeAws_restJson1SetCognitoEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/identitypools/{IdentityPoolId}/events"; if (input.IdentityPoolId !== undefined) { @@ -543,7 +521,8 @@ export const serializeAws_restJson1SetCognitoEventsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Events !== undefined && { Events: serializeAws_restJson1Events(input.Events, context) }), + ...(input.Events !== undefined && + input.Events !== null && { Events: serializeAws_restJson1Events(input.Events, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -562,7 +541,7 @@ export const serializeAws_restJson1SetIdentityPoolConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/identitypools/{IdentityPoolId}/configuration"; if (input.IdentityPoolId !== undefined) { @@ -576,10 +555,12 @@ export const serializeAws_restJson1SetIdentityPoolConfigurationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CognitoStreams !== undefined && { - CognitoStreams: serializeAws_restJson1CognitoStreams(input.CognitoStreams, context), - }), - ...(input.PushSync !== undefined && { PushSync: serializeAws_restJson1PushSync(input.PushSync, context) }), + ...(input.CognitoStreams !== undefined && + input.CognitoStreams !== null && { + CognitoStreams: serializeAws_restJson1CognitoStreams(input.CognitoStreams, context), + }), + ...(input.PushSync !== undefined && + input.PushSync !== null && { PushSync: serializeAws_restJson1PushSync(input.PushSync, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -597,9 +578,7 @@ export const serializeAws_restJson1SubscribeToDatasetCommand = async ( input: SubscribeToDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}"; if (input.DatasetName !== undefined) { @@ -655,9 +634,7 @@ export const serializeAws_restJson1UnsubscribeFromDatasetCommand = async ( input: UnsubscribeFromDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}"; if (input.IdentityId !== undefined) { @@ -714,7 +691,7 @@ export const serializeAws_restJson1UpdateRecordsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ClientContext) && { "x-amz-Client-Context": input.ClientContext! }), }; let resolvedPath = "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}"; @@ -747,11 +724,13 @@ export const serializeAws_restJson1UpdateRecordsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DeviceId !== undefined && { DeviceId: input.DeviceId }), - ...(input.RecordPatches !== undefined && { - RecordPatches: serializeAws_restJson1RecordPatchList(input.RecordPatches, context), - }), - ...(input.SyncSessionToken !== undefined && { SyncSessionToken: input.SyncSessionToken }), + ...(input.DeviceId !== undefined && input.DeviceId !== null && { DeviceId: input.DeviceId }), + ...(input.RecordPatches !== undefined && + input.RecordPatches !== null && { + RecordPatches: serializeAws_restJson1RecordPatchList(input.RecordPatches, context), + }), + ...(input.SyncSessionToken !== undefined && + input.SyncSessionToken !== null && { SyncSessionToken: input.SyncSessionToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2611,55 +2590,82 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async ( }; const serializeAws_restJson1ApplicationArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1CognitoStreams = (input: CognitoStreams, context: __SerdeContext): any => { return { - ...(input.DisabledReason !== undefined && { DisabledReason: input.DisabledReason }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), - ...(input.StreamingStatus !== undefined && { StreamingStatus: input.StreamingStatus }), + ...(input.DisabledReason !== undefined && + input.DisabledReason !== null && { DisabledReason: input.DisabledReason }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), + ...(input.StreamingStatus !== undefined && + input.StreamingStatus !== null && { StreamingStatus: input.StreamingStatus }), }; }; const serializeAws_restJson1Events = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1PushSync = (input: PushSync, context: __SerdeContext): any => { return { - ...(input.ApplicationArns !== undefined && { - ApplicationArns: serializeAws_restJson1ApplicationArnList(input.ApplicationArns, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.ApplicationArns !== undefined && + input.ApplicationArns !== null && { + ApplicationArns: serializeAws_restJson1ApplicationArnList(input.ApplicationArns, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_restJson1RecordPatch = (input: RecordPatch, context: __SerdeContext): any => { return { - ...(input.DeviceLastModifiedDate !== undefined && { - DeviceLastModifiedDate: Math.round(input.DeviceLastModifiedDate.getTime() / 1000), - }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Op !== undefined && { Op: input.Op }), - ...(input.SyncCount !== undefined && { SyncCount: input.SyncCount }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.DeviceLastModifiedDate !== undefined && + input.DeviceLastModifiedDate !== null && { + DeviceLastModifiedDate: Math.round(input.DeviceLastModifiedDate.getTime() / 1000), + }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Op !== undefined && input.Op !== null && { Op: input.Op }), + ...(input.SyncCount !== undefined && input.SyncCount !== null && { SyncCount: input.SyncCount }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1RecordPatchList = (input: RecordPatch[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1RecordPatch(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1RecordPatch(entry, context); + }); }; const deserializeAws_restJson1ApplicationArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1CognitoStreams = (output: any, context: __SerdeContext): CognitoStreams => { @@ -2693,17 +2699,26 @@ const deserializeAws_restJson1Dataset = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1DatasetList = (output: any, context: __SerdeContext): Dataset[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Dataset(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Dataset(entry, context); + }); }; const deserializeAws_restJson1Events = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1IdentityPoolUsage = (output: any, context: __SerdeContext): IdentityPoolUsage => { @@ -2723,7 +2738,14 @@ const deserializeAws_restJson1IdentityPoolUsage = (output: any, context: __Serde }; const deserializeAws_restJson1IdentityPoolUsageList = (output: any, context: __SerdeContext): IdentityPoolUsage[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IdentityPoolUsage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IdentityPoolUsage(entry, context); + }); }; const deserializeAws_restJson1IdentityUsage = (output: any, context: __SerdeContext): IdentityUsage => { @@ -2741,7 +2763,14 @@ const deserializeAws_restJson1IdentityUsage = (output: any, context: __SerdeCont }; const deserializeAws_restJson1MergedDatasetNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1PushSync = (output: any, context: __SerdeContext): PushSync => { @@ -2773,7 +2802,14 @@ const deserializeAws_restJson1_Record = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1RecordList = (output: any, context: __SerdeContext): _Record[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1_Record(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1_Record(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2796,6 +2832,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-comprehend/protocols/Aws_json1_1.ts b/clients/client-comprehend/protocols/Aws_json1_1.ts index 1701a85e07d7..cf0eca3ed64e 100644 --- a/clients/client-comprehend/protocols/Aws_json1_1.ts +++ b/clients/client-comprehend/protocols/Aws_json1_1.ts @@ -408,7 +408,7 @@ export const serializeAws_json1_1BatchDetectDominantLanguageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.BatchDetectDominantLanguage", }; let body: any; @@ -421,7 +421,7 @@ export const serializeAws_json1_1BatchDetectEntitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.BatchDetectEntities", }; let body: any; @@ -434,7 +434,7 @@ export const serializeAws_json1_1BatchDetectKeyPhrasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.BatchDetectKeyPhrases", }; let body: any; @@ -447,7 +447,7 @@ export const serializeAws_json1_1BatchDetectSentimentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.BatchDetectSentiment", }; let body: any; @@ -460,7 +460,7 @@ export const serializeAws_json1_1BatchDetectSyntaxCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.BatchDetectSyntax", }; let body: any; @@ -473,7 +473,7 @@ export const serializeAws_json1_1ClassifyDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ClassifyDocument", }; let body: any; @@ -486,7 +486,7 @@ export const serializeAws_json1_1CreateDocumentClassifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.CreateDocumentClassifier", }; let body: any; @@ -499,7 +499,7 @@ export const serializeAws_json1_1CreateEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.CreateEndpoint", }; let body: any; @@ -512,7 +512,7 @@ export const serializeAws_json1_1CreateEntityRecognizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.CreateEntityRecognizer", }; let body: any; @@ -525,7 +525,7 @@ export const serializeAws_json1_1DeleteDocumentClassifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DeleteDocumentClassifier", }; let body: any; @@ -538,7 +538,7 @@ export const serializeAws_json1_1DeleteEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DeleteEndpoint", }; let body: any; @@ -551,7 +551,7 @@ export const serializeAws_json1_1DeleteEntityRecognizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DeleteEntityRecognizer", }; let body: any; @@ -564,7 +564,7 @@ export const serializeAws_json1_1DescribeDocumentClassificationJobCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeDocumentClassificationJob", }; let body: any; @@ -577,7 +577,7 @@ export const serializeAws_json1_1DescribeDocumentClassifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeDocumentClassifier", }; let body: any; @@ -590,7 +590,7 @@ export const serializeAws_json1_1DescribeDominantLanguageDetectionJobCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeDominantLanguageDetectionJob", }; let body: any; @@ -603,7 +603,7 @@ export const serializeAws_json1_1DescribeEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeEndpoint", }; let body: any; @@ -616,7 +616,7 @@ export const serializeAws_json1_1DescribeEntitiesDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeEntitiesDetectionJob", }; let body: any; @@ -629,7 +629,7 @@ export const serializeAws_json1_1DescribeEntityRecognizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeEntityRecognizer", }; let body: any; @@ -642,7 +642,7 @@ export const serializeAws_json1_1DescribeEventsDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeEventsDetectionJob", }; let body: any; @@ -655,7 +655,7 @@ export const serializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeKeyPhrasesDetectionJob", }; let body: any; @@ -668,7 +668,7 @@ export const serializeAws_json1_1DescribePiiEntitiesDetectionJobCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribePiiEntitiesDetectionJob", }; let body: any; @@ -681,7 +681,7 @@ export const serializeAws_json1_1DescribeSentimentDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeSentimentDetectionJob", }; let body: any; @@ -694,7 +694,7 @@ export const serializeAws_json1_1DescribeTopicsDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DescribeTopicsDetectionJob", }; let body: any; @@ -707,7 +707,7 @@ export const serializeAws_json1_1DetectDominantLanguageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DetectDominantLanguage", }; let body: any; @@ -720,7 +720,7 @@ export const serializeAws_json1_1DetectEntitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DetectEntities", }; let body: any; @@ -733,7 +733,7 @@ export const serializeAws_json1_1DetectKeyPhrasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DetectKeyPhrases", }; let body: any; @@ -746,7 +746,7 @@ export const serializeAws_json1_1DetectPiiEntitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DetectPiiEntities", }; let body: any; @@ -759,7 +759,7 @@ export const serializeAws_json1_1DetectSentimentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DetectSentiment", }; let body: any; @@ -772,7 +772,7 @@ export const serializeAws_json1_1DetectSyntaxCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.DetectSyntax", }; let body: any; @@ -785,7 +785,7 @@ export const serializeAws_json1_1ListDocumentClassificationJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListDocumentClassificationJobs", }; let body: any; @@ -798,7 +798,7 @@ export const serializeAws_json1_1ListDocumentClassifiersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListDocumentClassifiers", }; let body: any; @@ -811,7 +811,7 @@ export const serializeAws_json1_1ListDominantLanguageDetectionJobsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListDominantLanguageDetectionJobs", }; let body: any; @@ -824,7 +824,7 @@ export const serializeAws_json1_1ListEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListEndpoints", }; let body: any; @@ -837,7 +837,7 @@ export const serializeAws_json1_1ListEntitiesDetectionJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListEntitiesDetectionJobs", }; let body: any; @@ -850,7 +850,7 @@ export const serializeAws_json1_1ListEntityRecognizersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListEntityRecognizers", }; let body: any; @@ -863,7 +863,7 @@ export const serializeAws_json1_1ListEventsDetectionJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListEventsDetectionJobs", }; let body: any; @@ -876,7 +876,7 @@ export const serializeAws_json1_1ListKeyPhrasesDetectionJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListKeyPhrasesDetectionJobs", }; let body: any; @@ -889,7 +889,7 @@ export const serializeAws_json1_1ListPiiEntitiesDetectionJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListPiiEntitiesDetectionJobs", }; let body: any; @@ -902,7 +902,7 @@ export const serializeAws_json1_1ListSentimentDetectionJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListSentimentDetectionJobs", }; let body: any; @@ -915,7 +915,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListTagsForResource", }; let body: any; @@ -928,7 +928,7 @@ export const serializeAws_json1_1ListTopicsDetectionJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.ListTopicsDetectionJobs", }; let body: any; @@ -941,7 +941,7 @@ export const serializeAws_json1_1StartDocumentClassificationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StartDocumentClassificationJob", }; let body: any; @@ -954,7 +954,7 @@ export const serializeAws_json1_1StartDominantLanguageDetectionJobCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StartDominantLanguageDetectionJob", }; let body: any; @@ -967,7 +967,7 @@ export const serializeAws_json1_1StartEntitiesDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StartEntitiesDetectionJob", }; let body: any; @@ -980,7 +980,7 @@ export const serializeAws_json1_1StartEventsDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StartEventsDetectionJob", }; let body: any; @@ -993,7 +993,7 @@ export const serializeAws_json1_1StartKeyPhrasesDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StartKeyPhrasesDetectionJob", }; let body: any; @@ -1006,7 +1006,7 @@ export const serializeAws_json1_1StartPiiEntitiesDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StartPiiEntitiesDetectionJob", }; let body: any; @@ -1019,7 +1019,7 @@ export const serializeAws_json1_1StartSentimentDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StartSentimentDetectionJob", }; let body: any; @@ -1032,7 +1032,7 @@ export const serializeAws_json1_1StartTopicsDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StartTopicsDetectionJob", }; let body: any; @@ -1045,7 +1045,7 @@ export const serializeAws_json1_1StopDominantLanguageDetectionJobCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StopDominantLanguageDetectionJob", }; let body: any; @@ -1058,7 +1058,7 @@ export const serializeAws_json1_1StopEntitiesDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StopEntitiesDetectionJob", }; let body: any; @@ -1071,7 +1071,7 @@ export const serializeAws_json1_1StopEventsDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StopEventsDetectionJob", }; let body: any; @@ -1084,7 +1084,7 @@ export const serializeAws_json1_1StopKeyPhrasesDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StopKeyPhrasesDetectionJob", }; let body: any; @@ -1097,7 +1097,7 @@ export const serializeAws_json1_1StopPiiEntitiesDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StopPiiEntitiesDetectionJob", }; let body: any; @@ -1110,7 +1110,7 @@ export const serializeAws_json1_1StopSentimentDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StopSentimentDetectionJob", }; let body: any; @@ -1123,7 +1123,7 @@ export const serializeAws_json1_1StopTrainingDocumentClassifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StopTrainingDocumentClassifier", }; let body: any; @@ -1136,7 +1136,7 @@ export const serializeAws_json1_1StopTrainingEntityRecognizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.StopTrainingEntityRecognizer", }; let body: any; @@ -1149,7 +1149,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.TagResource", }; let body: any; @@ -1162,7 +1162,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.UntagResource", }; let body: any; @@ -1175,7 +1175,7 @@ export const serializeAws_json1_1UpdateEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Comprehend_20171127.UpdateEndpoint", }; let body: any; @@ -1210,8 +1210,7 @@ const deserializeAws_json1_1BatchDetectDominantLanguageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BatchSizeLimitExceededException": case "com.amazonaws.comprehend#BatchSizeLimitExceededException": @@ -1289,8 +1288,7 @@ const deserializeAws_json1_1BatchDetectEntitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BatchSizeLimitExceededException": case "com.amazonaws.comprehend#BatchSizeLimitExceededException": @@ -1376,8 +1374,7 @@ const deserializeAws_json1_1BatchDetectKeyPhrasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BatchSizeLimitExceededException": case "com.amazonaws.comprehend#BatchSizeLimitExceededException": @@ -1463,8 +1460,7 @@ const deserializeAws_json1_1BatchDetectSentimentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BatchSizeLimitExceededException": case "com.amazonaws.comprehend#BatchSizeLimitExceededException": @@ -1550,8 +1546,7 @@ const deserializeAws_json1_1BatchDetectSyntaxCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BatchSizeLimitExceededException": case "com.amazonaws.comprehend#BatchSizeLimitExceededException": @@ -1637,8 +1632,7 @@ const deserializeAws_json1_1ClassifyDocumentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -1716,8 +1710,7 @@ const deserializeAws_json1_1CreateDocumentClassifierCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -1827,8 +1820,7 @@ const deserializeAws_json1_1CreateEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -1938,8 +1930,7 @@ const deserializeAws_json1_1CreateEntityRecognizerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2049,8 +2040,7 @@ const deserializeAws_json1_1DeleteDocumentClassifierCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2144,8 +2134,7 @@ const deserializeAws_json1_1DeleteEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2231,8 +2220,7 @@ const deserializeAws_json1_1DeleteEntityRecognizerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2326,8 +2314,7 @@ const deserializeAws_json1_1DescribeDocumentClassificationJobCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2405,8 +2392,7 @@ const deserializeAws_json1_1DescribeDocumentClassifierCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2484,8 +2470,7 @@ const deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2563,8 +2548,7 @@ const deserializeAws_json1_1DescribeEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2642,8 +2626,7 @@ const deserializeAws_json1_1DescribeEntitiesDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2721,8 +2704,7 @@ const deserializeAws_json1_1DescribeEntityRecognizerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2800,8 +2782,7 @@ const deserializeAws_json1_1DescribeEventsDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2879,8 +2860,7 @@ const deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -2958,8 +2938,7 @@ const deserializeAws_json1_1DescribePiiEntitiesDetectionJobCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3037,8 +3016,7 @@ const deserializeAws_json1_1DescribeSentimentDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3116,8 +3094,7 @@ const deserializeAws_json1_1DescribeTopicsDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3195,8 +3172,7 @@ const deserializeAws_json1_1DetectDominantLanguageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3266,8 +3242,7 @@ const deserializeAws_json1_1DetectEntitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3353,8 +3328,7 @@ const deserializeAws_json1_1DetectKeyPhrasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3432,8 +3406,7 @@ const deserializeAws_json1_1DetectPiiEntitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3511,8 +3484,7 @@ const deserializeAws_json1_1DetectSentimentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3590,8 +3562,7 @@ const deserializeAws_json1_1DetectSyntaxCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3669,8 +3640,7 @@ const deserializeAws_json1_1ListDocumentClassificationJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3748,8 +3718,7 @@ const deserializeAws_json1_1ListDocumentClassifiersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3827,8 +3796,7 @@ const deserializeAws_json1_1ListDominantLanguageDetectionJobsCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3906,8 +3874,7 @@ const deserializeAws_json1_1ListEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -3977,8 +3944,7 @@ const deserializeAws_json1_1ListEntitiesDetectionJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4056,8 +4022,7 @@ const deserializeAws_json1_1ListEntityRecognizersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4135,8 +4100,7 @@ const deserializeAws_json1_1ListEventsDetectionJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4214,8 +4178,7 @@ const deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4293,8 +4256,7 @@ const deserializeAws_json1_1ListPiiEntitiesDetectionJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4372,8 +4334,7 @@ const deserializeAws_json1_1ListSentimentDetectionJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4451,8 +4412,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4522,8 +4482,7 @@ const deserializeAws_json1_1ListTopicsDetectionJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4601,8 +4560,7 @@ const deserializeAws_json1_1StartDocumentClassificationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4696,8 +4654,7 @@ const deserializeAws_json1_1StartDominantLanguageDetectionJobCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4775,8 +4732,7 @@ const deserializeAws_json1_1StartEntitiesDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4870,8 +4826,7 @@ const deserializeAws_json1_1StartEventsDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -4949,8 +4904,7 @@ const deserializeAws_json1_1StartKeyPhrasesDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5028,8 +4982,7 @@ const deserializeAws_json1_1StartPiiEntitiesDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5107,8 +5060,7 @@ const deserializeAws_json1_1StartSentimentDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5186,8 +5138,7 @@ const deserializeAws_json1_1StartTopicsDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5265,8 +5216,7 @@ const deserializeAws_json1_1StopDominantLanguageDetectionJobCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5336,8 +5286,7 @@ const deserializeAws_json1_1StopEntitiesDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5407,8 +5356,7 @@ const deserializeAws_json1_1StopEventsDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5478,8 +5426,7 @@ const deserializeAws_json1_1StopKeyPhrasesDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5549,8 +5496,7 @@ const deserializeAws_json1_1StopPiiEntitiesDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5620,8 +5566,7 @@ const deserializeAws_json1_1StopSentimentDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5691,8 +5636,7 @@ const deserializeAws_json1_1StopTrainingDocumentClassifierCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5770,8 +5714,7 @@ const deserializeAws_json1_1StopTrainingEntityRecognizerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -5849,8 +5792,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.comprehend#ConcurrentModificationException": @@ -5936,8 +5878,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.comprehend#ConcurrentModificationException": @@ -6023,8 +5964,7 @@ const deserializeAws_json1_1UpdateEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": @@ -6340,7 +6280,14 @@ const deserializeAws_json1_1UnsupportedLanguageExceptionResponse = async ( }; const serializeAws_json1_1AttributeNamesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AugmentedManifestsListItem = ( @@ -6348,10 +6295,11 @@ const serializeAws_json1_1AugmentedManifestsListItem = ( context: __SerdeContext ): any => { return { - ...(input.AttributeNames !== undefined && { - AttributeNames: serializeAws_json1_1AttributeNamesList(input.AttributeNames, context), - }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.AttributeNames !== undefined && + input.AttributeNames !== null && { + AttributeNames: serializeAws_json1_1AttributeNamesList(input.AttributeNames, context), + }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -6360,9 +6308,8 @@ const serializeAws_json1_1BatchDetectDominantLanguageRequest = ( context: __SerdeContext ): any => { return { - ...(input.TextList !== undefined && { - TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context), - }), + ...(input.TextList !== undefined && + input.TextList !== null && { TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context) }), }; }; @@ -6371,10 +6318,9 @@ const serializeAws_json1_1BatchDetectEntitiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.TextList !== undefined && { - TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context), - }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.TextList !== undefined && + input.TextList !== null && { TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context) }), }; }; @@ -6383,10 +6329,9 @@ const serializeAws_json1_1BatchDetectKeyPhrasesRequest = ( context: __SerdeContext ): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.TextList !== undefined && { - TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context), - }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.TextList !== undefined && + input.TextList !== null && { TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context) }), }; }; @@ -6395,10 +6340,9 @@ const serializeAws_json1_1BatchDetectSentimentRequest = ( context: __SerdeContext ): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.TextList !== undefined && { - TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context), - }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.TextList !== undefined && + input.TextList !== null && { TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context) }), }; }; @@ -6407,17 +6351,16 @@ const serializeAws_json1_1BatchDetectSyntaxRequest = ( context: __SerdeContext ): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.TextList !== undefined && { - TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context), - }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.TextList !== undefined && + input.TextList !== null && { TextList: serializeAws_json1_1CustomerInputStringList(input.TextList, context) }), }; }; const serializeAws_json1_1ClassifyDocumentRequest = (input: ClassifyDocumentRequest, context: __SerdeContext): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; @@ -6427,29 +6370,36 @@ const serializeAws_json1_1CreateDocumentClassifierRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.DocumentClassifierName !== undefined && { DocumentClassifierName: input.DocumentClassifierName }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1DocumentClassifierInputDataConfig(input.InputDataConfig, context), - }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Mode !== undefined && { Mode: input.Mode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1DocumentClassifierOutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.DocumentClassifierName !== undefined && + input.DocumentClassifierName !== null && { DocumentClassifierName: input.DocumentClassifierName }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1DocumentClassifierInputDataConfig(input.InputDataConfig, context), + }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1DocumentClassifierOutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; const serializeAws_json1_1CreateEndpointRequest = (input: CreateEndpointRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DesiredInferenceUnits !== undefined && { DesiredInferenceUnits: input.DesiredInferenceUnits }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.ModelArn !== undefined && { ModelArn: input.ModelArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.DesiredInferenceUnits !== undefined && + input.DesiredInferenceUnits !== null && { DesiredInferenceUnits: input.DesiredInferenceUnits }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.ModelArn !== undefined && input.ModelArn !== null && { ModelArn: input.ModelArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -6459,20 +6409,32 @@ const serializeAws_json1_1CreateEntityRecognizerRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1EntityRecognizerInputDataConfig(input.InputDataConfig, context), - }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.RecognizerName !== undefined && { RecognizerName: input.RecognizerName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1EntityRecognizerInputDataConfig(input.InputDataConfig, context), + }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.RecognizerName !== undefined && + input.RecognizerName !== null && { RecognizerName: input.RecognizerName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; const serializeAws_json1_1CustomerInputStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteDocumentClassifierRequest = ( @@ -6480,13 +6442,14 @@ const serializeAws_json1_1DeleteDocumentClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.DocumentClassifierArn !== undefined && { DocumentClassifierArn: input.DocumentClassifierArn }), + ...(input.DocumentClassifierArn !== undefined && + input.DocumentClassifierArn !== null && { DocumentClassifierArn: input.DocumentClassifierArn }), }; }; const serializeAws_json1_1DeleteEndpointRequest = (input: DeleteEndpointRequest, context: __SerdeContext): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), }; }; @@ -6495,7 +6458,8 @@ const serializeAws_json1_1DeleteEntityRecognizerRequest = ( context: __SerdeContext ): any => { return { - ...(input.EntityRecognizerArn !== undefined && { EntityRecognizerArn: input.EntityRecognizerArn }), + ...(input.EntityRecognizerArn !== undefined && + input.EntityRecognizerArn !== null && { EntityRecognizerArn: input.EntityRecognizerArn }), }; }; @@ -6504,7 +6468,7 @@ const serializeAws_json1_1DescribeDocumentClassificationJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -6513,7 +6477,8 @@ const serializeAws_json1_1DescribeDocumentClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.DocumentClassifierArn !== undefined && { DocumentClassifierArn: input.DocumentClassifierArn }), + ...(input.DocumentClassifierArn !== undefined && + input.DocumentClassifierArn !== null && { DocumentClassifierArn: input.DocumentClassifierArn }), }; }; @@ -6522,13 +6487,13 @@ const serializeAws_json1_1DescribeDominantLanguageDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; const serializeAws_json1_1DescribeEndpointRequest = (input: DescribeEndpointRequest, context: __SerdeContext): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), }; }; @@ -6537,7 +6502,7 @@ const serializeAws_json1_1DescribeEntitiesDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -6546,7 +6511,8 @@ const serializeAws_json1_1DescribeEntityRecognizerRequest = ( context: __SerdeContext ): any => { return { - ...(input.EntityRecognizerArn !== undefined && { EntityRecognizerArn: input.EntityRecognizerArn }), + ...(input.EntityRecognizerArn !== undefined && + input.EntityRecognizerArn !== null && { EntityRecognizerArn: input.EntityRecognizerArn }), }; }; @@ -6555,7 +6521,7 @@ const serializeAws_json1_1DescribeEventsDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -6564,7 +6530,7 @@ const serializeAws_json1_1DescribeKeyPhrasesDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -6573,7 +6539,7 @@ const serializeAws_json1_1DescribePiiEntitiesDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -6582,7 +6548,7 @@ const serializeAws_json1_1DescribeSentimentDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -6591,7 +6557,7 @@ const serializeAws_json1_1DescribeTopicsDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -6600,22 +6566,22 @@ const serializeAws_json1_1DetectDominantLanguageRequest = ( context: __SerdeContext ): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_json1_1DetectEntitiesRequest = (input: DetectEntitiesRequest, context: __SerdeContext): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_json1_1DetectKeyPhrasesRequest = (input: DetectKeyPhrasesRequest, context: __SerdeContext): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; @@ -6624,22 +6590,22 @@ const serializeAws_json1_1DetectPiiEntitiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_json1_1DetectSentimentRequest = (input: DetectSentimentRequest, context: __SerdeContext): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_json1_1DetectSyntaxRequest = (input: DetectSyntaxRequest, context: __SerdeContext): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; @@ -6648,12 +6614,12 @@ const serializeAws_json1_1DocumentClassificationJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; @@ -6661,7 +6627,14 @@ const serializeAws_json1_1DocumentClassifierAugmentedManifestsList = ( input: AugmentedManifestsListItem[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AugmentedManifestsListItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AugmentedManifestsListItem(entry, context); + }); }; const serializeAws_json1_1DocumentClassifierFilter = ( @@ -6669,11 +6642,11 @@ const serializeAws_json1_1DocumentClassifierFilter = ( context: __SerdeContext ): any => { return { - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; @@ -6682,15 +6655,17 @@ const serializeAws_json1_1DocumentClassifierInputDataConfig = ( context: __SerdeContext ): any => { return { - ...(input.AugmentedManifests !== undefined && { - AugmentedManifests: serializeAws_json1_1DocumentClassifierAugmentedManifestsList( - input.AugmentedManifests, - context - ), - }), - ...(input.DataFormat !== undefined && { DataFormat: input.DataFormat }), - ...(input.LabelDelimiter !== undefined && { LabelDelimiter: input.LabelDelimiter }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.AugmentedManifests !== undefined && + input.AugmentedManifests !== null && { + AugmentedManifests: serializeAws_json1_1DocumentClassifierAugmentedManifestsList( + input.AugmentedManifests, + context + ), + }), + ...(input.DataFormat !== undefined && input.DataFormat !== null && { DataFormat: input.DataFormat }), + ...(input.LabelDelimiter !== undefined && + input.LabelDelimiter !== null && { LabelDelimiter: input.LabelDelimiter }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -6699,8 +6674,8 @@ const serializeAws_json1_1DocumentClassifierOutputDataConfig = ( context: __SerdeContext ): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -6709,25 +6684,25 @@ const serializeAws_json1_1DominantLanguageDetectionJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; const serializeAws_json1_1EndpointFilter = (input: EndpointFilter, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.ModelArn !== undefined && { ModelArn: input.ModelArn }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.ModelArn !== undefined && input.ModelArn !== null && { ModelArn: input.ModelArn }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -6736,12 +6711,12 @@ const serializeAws_json1_1EntitiesDetectionJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; @@ -6750,7 +6725,7 @@ const serializeAws_json1_1EntityRecognizerAnnotations = ( context: __SerdeContext ): any => { return { - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -6758,7 +6733,14 @@ const serializeAws_json1_1EntityRecognizerAugmentedManifestsList = ( input: AugmentedManifestsListItem[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AugmentedManifestsListItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AugmentedManifestsListItem(entry, context); + }); }; const serializeAws_json1_1EntityRecognizerDocuments = ( @@ -6766,7 +6748,7 @@ const serializeAws_json1_1EntityRecognizerDocuments = ( context: __SerdeContext ): any => { return { - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -6775,17 +6757,17 @@ const serializeAws_json1_1EntityRecognizerEntityList = ( context: __SerdeContext ): any => { return { - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1EntityRecognizerFilter = (input: EntityRecognizerFilter, context: __SerdeContext): any => { return { - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; @@ -6794,32 +6776,45 @@ const serializeAws_json1_1EntityRecognizerInputDataConfig = ( context: __SerdeContext ): any => { return { - ...(input.Annotations !== undefined && { - Annotations: serializeAws_json1_1EntityRecognizerAnnotations(input.Annotations, context), - }), - ...(input.AugmentedManifests !== undefined && { - AugmentedManifests: serializeAws_json1_1EntityRecognizerAugmentedManifestsList(input.AugmentedManifests, context), - }), - ...(input.DataFormat !== undefined && { DataFormat: input.DataFormat }), - ...(input.Documents !== undefined && { - Documents: serializeAws_json1_1EntityRecognizerDocuments(input.Documents, context), - }), - ...(input.EntityList !== undefined && { - EntityList: serializeAws_json1_1EntityRecognizerEntityList(input.EntityList, context), - }), - ...(input.EntityTypes !== undefined && { - EntityTypes: serializeAws_json1_1EntityTypesList(input.EntityTypes, context), - }), + ...(input.Annotations !== undefined && + input.Annotations !== null && { + Annotations: serializeAws_json1_1EntityRecognizerAnnotations(input.Annotations, context), + }), + ...(input.AugmentedManifests !== undefined && + input.AugmentedManifests !== null && { + AugmentedManifests: serializeAws_json1_1EntityRecognizerAugmentedManifestsList( + input.AugmentedManifests, + context + ), + }), + ...(input.DataFormat !== undefined && input.DataFormat !== null && { DataFormat: input.DataFormat }), + ...(input.Documents !== undefined && + input.Documents !== null && { + Documents: serializeAws_json1_1EntityRecognizerDocuments(input.Documents, context), + }), + ...(input.EntityList !== undefined && + input.EntityList !== null && { + EntityList: serializeAws_json1_1EntityRecognizerEntityList(input.EntityList, context), + }), + ...(input.EntityTypes !== undefined && + input.EntityTypes !== null && { EntityTypes: serializeAws_json1_1EntityTypesList(input.EntityTypes, context) }), }; }; const serializeAws_json1_1EntityTypesList = (input: EntityTypesListItem[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EntityTypesListItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EntityTypesListItem(entry, context); + }); }; const serializeAws_json1_1EntityTypesListItem = (input: EntityTypesListItem, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -6828,19 +6823,19 @@ const serializeAws_json1_1EventsDetectionJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; const serializeAws_json1_1InputDataConfig = (input: InputDataConfig, context: __SerdeContext): any => { return { - ...(input.InputFormat !== undefined && { InputFormat: input.InputFormat }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.InputFormat !== undefined && input.InputFormat !== null && { InputFormat: input.InputFormat }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -6849,12 +6844,12 @@ const serializeAws_json1_1KeyPhrasesDetectionJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; @@ -6863,11 +6858,10 @@ const serializeAws_json1_1ListDocumentClassificationJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1DocumentClassificationJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1DocumentClassificationJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6876,9 +6870,10 @@ const serializeAws_json1_1ListDocumentClassifiersRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1DocumentClassifierFilter(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1DocumentClassifierFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6887,19 +6882,21 @@ const serializeAws_json1_1ListDominantLanguageDetectionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1DominantLanguageDetectionJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { + Filter: serializeAws_json1_1DominantLanguageDetectionJobFilter(input.Filter, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListEndpointsRequest = (input: ListEndpointsRequest, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1EndpointFilter(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1EndpointFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6908,11 +6905,10 @@ const serializeAws_json1_1ListEntitiesDetectionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1EntitiesDetectionJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1EntitiesDetectionJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6921,9 +6917,10 @@ const serializeAws_json1_1ListEntityRecognizersRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1EntityRecognizerFilter(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1EntityRecognizerFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6932,9 +6929,10 @@ const serializeAws_json1_1ListEventsDetectionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1EventsDetectionJobFilter(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1EventsDetectionJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6943,16 +6941,22 @@ const serializeAws_json1_1ListKeyPhrasesDetectionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1KeyPhrasesDetectionJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1KeyPhrasesDetectionJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListOfPiiEntityTypes = (input: (PiiEntityType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListPiiEntitiesDetectionJobsRequest = ( @@ -6960,11 +6964,10 @@ const serializeAws_json1_1ListPiiEntitiesDetectionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1PiiEntitiesDetectionJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1PiiEntitiesDetectionJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6973,11 +6976,10 @@ const serializeAws_json1_1ListSentimentDetectionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1SentimentDetectionJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1SentimentDetectionJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6986,7 +6988,7 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -6995,16 +6997,17 @@ const serializeAws_json1_1ListTopicsDetectionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1TopicsDetectionJobFilter(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1TopicsDetectionJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1OutputDataConfig = (input: OutputDataConfig, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -7013,27 +7016,35 @@ const serializeAws_json1_1PiiEntitiesDetectionJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; const serializeAws_json1_1RedactionConfig = (input: RedactionConfig, context: __SerdeContext): any => { return { - ...(input.MaskCharacter !== undefined && { MaskCharacter: input.MaskCharacter }), - ...(input.MaskMode !== undefined && { MaskMode: input.MaskMode }), - ...(input.PiiEntityTypes !== undefined && { - PiiEntityTypes: serializeAws_json1_1ListOfPiiEntityTypes(input.PiiEntityTypes, context), - }), + ...(input.MaskCharacter !== undefined && input.MaskCharacter !== null && { MaskCharacter: input.MaskCharacter }), + ...(input.MaskMode !== undefined && input.MaskMode !== null && { MaskMode: input.MaskMode }), + ...(input.PiiEntityTypes !== undefined && + input.PiiEntityTypes !== null && { + PiiEntityTypes: serializeAws_json1_1ListOfPiiEntityTypes(input.PiiEntityTypes, context), + }), }; }; const serializeAws_json1_1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SentimentDetectionJobFilter = ( @@ -7041,12 +7052,12 @@ const serializeAws_json1_1SentimentDetectionJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; @@ -7056,17 +7067,23 @@ const serializeAws_json1_1StartDocumentClassificationJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.DocumentClassifierArn !== undefined && { DocumentClassifierArn: input.DocumentClassifierArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.DocumentClassifierArn !== undefined && + input.DocumentClassifierArn !== null && { DocumentClassifierArn: input.DocumentClassifierArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -7076,16 +7093,21 @@ const serializeAws_json1_1StartDominantLanguageDetectionJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -7095,18 +7117,24 @@ const serializeAws_json1_1StartEntitiesDetectionJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.EntityRecognizerArn !== undefined && { EntityRecognizerArn: input.EntityRecognizerArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.EntityRecognizerArn !== undefined && + input.EntityRecognizerArn !== null && { EntityRecognizerArn: input.EntityRecognizerArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -7116,18 +7144,22 @@ const serializeAws_json1_1StartEventsDetectionJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.TargetEventTypes !== undefined && { - TargetEventTypes: serializeAws_json1_1TargetEventTypes(input.TargetEventTypes, context), - }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.TargetEventTypes !== undefined && + input.TargetEventTypes !== null && { + TargetEventTypes: serializeAws_json1_1TargetEventTypes(input.TargetEventTypes, context), + }), }; }; @@ -7137,17 +7169,22 @@ const serializeAws_json1_1StartKeyPhrasesDetectionJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -7157,19 +7194,23 @@ const serializeAws_json1_1StartPiiEntitiesDetectionJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Mode !== undefined && { Mode: input.Mode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.RedactionConfig !== undefined && { - RedactionConfig: serializeAws_json1_1RedactionConfig(input.RedactionConfig, context), - }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.RedactionConfig !== undefined && + input.RedactionConfig !== null && { + RedactionConfig: serializeAws_json1_1RedactionConfig(input.RedactionConfig, context), + }), }; }; @@ -7179,17 +7220,22 @@ const serializeAws_json1_1StartSentimentDetectionJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -7199,17 +7245,23 @@ const serializeAws_json1_1StartTopicsDetectionJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.NumberOfTopics !== undefined && { NumberOfTopics: input.NumberOfTopics }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.NumberOfTopics !== undefined && + input.NumberOfTopics !== null && { NumberOfTopics: input.NumberOfTopics }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -7218,7 +7270,7 @@ const serializeAws_json1_1StopDominantLanguageDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -7227,7 +7279,7 @@ const serializeAws_json1_1StopEntitiesDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -7236,7 +7288,7 @@ const serializeAws_json1_1StopEventsDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -7245,7 +7297,7 @@ const serializeAws_json1_1StopKeyPhrasesDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -7254,7 +7306,7 @@ const serializeAws_json1_1StopPiiEntitiesDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -7263,7 +7315,7 @@ const serializeAws_json1_1StopSentimentDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -7272,7 +7324,8 @@ const serializeAws_json1_1StopTrainingDocumentClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.DocumentClassifierArn !== undefined && { DocumentClassifierArn: input.DocumentClassifierArn }), + ...(input.DocumentClassifierArn !== undefined && + input.DocumentClassifierArn !== null && { DocumentClassifierArn: input.DocumentClassifierArn }), }; }; @@ -7281,38 +7334,67 @@ const serializeAws_json1_1StopTrainingEntityRecognizerRequest = ( context: __SerdeContext ): any => { return { - ...(input.EntityRecognizerArn !== undefined && { EntityRecognizerArn: input.EntityRecognizerArn }), + ...(input.EntityRecognizerArn !== undefined && + input.EntityRecognizerArn !== null && { EntityRecognizerArn: input.EntityRecognizerArn }), }; }; const serializeAws_json1_1Subnets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TargetEventTypes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TopicsDetectionJobFilter = ( @@ -7320,40 +7402,51 @@ const serializeAws_json1_1TopicsDetectionJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateEndpointRequest = (input: UpdateEndpointRequest, context: __SerdeContext): any => { return { - ...(input.DesiredInferenceUnits !== undefined && { DesiredInferenceUnits: input.DesiredInferenceUnits }), - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.DesiredInferenceUnits !== undefined && + input.DesiredInferenceUnits !== null && { DesiredInferenceUnits: input.DesiredInferenceUnits }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), }; }; const serializeAws_json1_1VpcConfig = (input: VpcConfig, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.Subnets !== undefined && { Subnets: serializeAws_json1_1Subnets(input.Subnets, context) }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.Subnets !== undefined && + input.Subnets !== null && { Subnets: serializeAws_json1_1Subnets(input.Subnets, context) }), }; }; const deserializeAws_json1_1AttributeNamesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AugmentedManifestsListItem = ( @@ -7524,7 +7617,14 @@ const deserializeAws_json1_1BatchItemError = (output: any, context: __SerdeConte }; const deserializeAws_json1_1BatchItemErrorList = (output: any, context: __SerdeContext): BatchItemError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchItemError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchItemError(entry, context); + }); }; const deserializeAws_json1_1BatchSizeLimitExceededException = ( @@ -7899,14 +7999,28 @@ const deserializeAws_json1_1DocumentClassificationJobPropertiesList = ( output: any, context: __SerdeContext ): DocumentClassificationJobProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentClassificationJobProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentClassificationJobProperties(entry, context); + }); }; const deserializeAws_json1_1DocumentClassifierAugmentedManifestsList = ( output: any, context: __SerdeContext ): AugmentedManifestsListItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AugmentedManifestsListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AugmentedManifestsListItem(entry, context); + }); }; const deserializeAws_json1_1DocumentClassifierInputDataConfig = ( @@ -7991,7 +8105,14 @@ const deserializeAws_json1_1DocumentClassifierPropertiesList = ( output: any, context: __SerdeContext ): DocumentClassifierProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentClassifierProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentClassifierProperties(entry, context); + }); }; const deserializeAws_json1_1DocumentLabel = (output: any, context: __SerdeContext): DocumentLabel => { @@ -8048,9 +8169,14 @@ const deserializeAws_json1_1DominantLanguageDetectionJobPropertiesList = ( output: any, context: __SerdeContext ): DominantLanguageDetectionJobProperties[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1DominantLanguageDetectionJobProperties(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DominantLanguageDetectionJobProperties(entry, context); + }); }; const deserializeAws_json1_1EndpointProperties = (output: any, context: __SerdeContext): EndpointProperties => { @@ -8079,7 +8205,14 @@ const deserializeAws_json1_1EndpointProperties = (output: any, context: __SerdeC }; const deserializeAws_json1_1EndpointPropertiesList = (output: any, context: __SerdeContext): EndpointProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EndpointProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EndpointProperties(entry, context); + }); }; const deserializeAws_json1_1EntitiesDetectionJobProperties = ( @@ -8127,7 +8260,14 @@ const deserializeAws_json1_1EntitiesDetectionJobPropertiesList = ( output: any, context: __SerdeContext ): EntitiesDetectionJobProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EntitiesDetectionJobProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EntitiesDetectionJobProperties(entry, context); + }); }; const deserializeAws_json1_1Entity = (output: any, context: __SerdeContext): Entity => { @@ -8153,7 +8293,14 @@ const deserializeAws_json1_1EntityRecognizerAugmentedManifestsList = ( output: any, context: __SerdeContext ): AugmentedManifestsListItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AugmentedManifestsListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AugmentedManifestsListItem(entry, context); + }); }; const deserializeAws_json1_1EntityRecognizerDocuments = ( @@ -8242,9 +8389,14 @@ const deserializeAws_json1_1EntityRecognizerMetadataEntityTypesList = ( output: any, context: __SerdeContext ): EntityRecognizerMetadataEntityTypesListItem[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1EntityRecognizerMetadataEntityTypesListItem(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EntityRecognizerMetadataEntityTypesListItem(entry, context); + }); }; const deserializeAws_json1_1EntityRecognizerMetadataEntityTypesListItem = ( @@ -8315,7 +8467,14 @@ const deserializeAws_json1_1EntityRecognizerPropertiesList = ( output: any, context: __SerdeContext ): EntityRecognizerProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EntityRecognizerProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EntityRecognizerProperties(entry, context); + }); }; const deserializeAws_json1_1EntityTypesEvaluationMetrics = ( @@ -8330,7 +8489,14 @@ const deserializeAws_json1_1EntityTypesEvaluationMetrics = ( }; const deserializeAws_json1_1EntityTypesList = (output: any, context: __SerdeContext): EntityTypesListItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EntityTypesListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EntityTypesListItem(entry, context); + }); }; const deserializeAws_json1_1EntityTypesListItem = (output: any, context: __SerdeContext): EntityTypesListItem => { @@ -8378,7 +8544,14 @@ const deserializeAws_json1_1EventsDetectionJobPropertiesList = ( output: any, context: __SerdeContext ): EventsDetectionJobProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventsDetectionJobProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventsDetectionJobProperties(entry, context); + }); }; const deserializeAws_json1_1InputDataConfig = (output: any, context: __SerdeContext): InputDataConfig => { @@ -8468,7 +8641,14 @@ const deserializeAws_json1_1KeyPhrasesDetectionJobPropertiesList = ( output: any, context: __SerdeContext ): KeyPhrasesDetectionJobProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyPhrasesDetectionJobProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyPhrasesDetectionJobProperties(entry, context); + }); }; const deserializeAws_json1_1KmsKeyValidationException = ( @@ -8593,75 +8773,164 @@ const deserializeAws_json1_1ListKeyPhrasesDetectionJobsResponse = ( }; const deserializeAws_json1_1ListOfClasses = (output: any, context: __SerdeContext): DocumentClass[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentClass(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentClass(entry, context); + }); }; const deserializeAws_json1_1ListOfDetectDominantLanguageResult = ( output: any, context: __SerdeContext ): BatchDetectDominantLanguageItemResult[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1BatchDetectDominantLanguageItemResult(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchDetectDominantLanguageItemResult(entry, context); + }); }; const deserializeAws_json1_1ListOfDetectEntitiesResult = ( output: any, context: __SerdeContext ): BatchDetectEntitiesItemResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchDetectEntitiesItemResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchDetectEntitiesItemResult(entry, context); + }); }; const deserializeAws_json1_1ListOfDetectKeyPhrasesResult = ( output: any, context: __SerdeContext ): BatchDetectKeyPhrasesItemResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchDetectKeyPhrasesItemResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchDetectKeyPhrasesItemResult(entry, context); + }); }; const deserializeAws_json1_1ListOfDetectSentimentResult = ( output: any, context: __SerdeContext ): BatchDetectSentimentItemResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchDetectSentimentItemResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchDetectSentimentItemResult(entry, context); + }); }; const deserializeAws_json1_1ListOfDetectSyntaxResult = ( output: any, context: __SerdeContext ): BatchDetectSyntaxItemResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchDetectSyntaxItemResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchDetectSyntaxItemResult(entry, context); + }); }; const deserializeAws_json1_1ListOfDominantLanguages = (output: any, context: __SerdeContext): DominantLanguage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DominantLanguage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DominantLanguage(entry, context); + }); }; const deserializeAws_json1_1ListOfEntities = (output: any, context: __SerdeContext): Entity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Entity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Entity(entry, context); + }); }; const deserializeAws_json1_1ListOfKeyPhrases = (output: any, context: __SerdeContext): KeyPhrase[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyPhrase(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyPhrase(entry, context); + }); }; const deserializeAws_json1_1ListOfLabels = (output: any, context: __SerdeContext): DocumentLabel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentLabel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentLabel(entry, context); + }); }; const deserializeAws_json1_1ListOfPiiEntities = (output: any, context: __SerdeContext): PiiEntity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PiiEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PiiEntity(entry, context); + }); }; const deserializeAws_json1_1ListOfPiiEntityTypes = ( output: any, context: __SerdeContext ): (PiiEntityType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ListOfSyntaxTokens = (output: any, context: __SerdeContext): SyntaxToken[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SyntaxToken(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SyntaxToken(entry, context); + }); }; const deserializeAws_json1_1ListPiiEntitiesDetectionJobsResponse = ( @@ -8774,7 +9043,14 @@ const deserializeAws_json1_1PiiEntitiesDetectionJobPropertiesList = ( output: any, context: __SerdeContext ): PiiEntitiesDetectionJobProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PiiEntitiesDetectionJobProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PiiEntitiesDetectionJobProperties(entry, context); + }); }; const deserializeAws_json1_1PiiEntity = (output: any, context: __SerdeContext): PiiEntity => { @@ -8839,7 +9115,14 @@ const deserializeAws_json1_1ResourceUnavailableException = ( }; const deserializeAws_json1_1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SentimentDetectionJobProperties = ( @@ -8883,7 +9166,14 @@ const deserializeAws_json1_1SentimentDetectionJobPropertiesList = ( output: any, context: __SerdeContext ): SentimentDetectionJobProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SentimentDetectionJobProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SentimentDetectionJobProperties(entry, context); + }); }; const deserializeAws_json1_1SentimentScore = (output: any, context: __SerdeContext): SentimentScore => { @@ -9050,7 +9340,14 @@ const deserializeAws_json1_1StopTrainingEntityRecognizerResponse = ( }; const deserializeAws_json1_1Subnets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SyntaxToken = (output: any, context: __SerdeContext): SyntaxToken => { @@ -9074,7 +9371,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -9082,7 +9386,14 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1TargetEventTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TextSizeLimitExceededException = ( @@ -9160,7 +9471,14 @@ const deserializeAws_json1_1TopicsDetectionJobPropertiesList = ( output: any, context: __SerdeContext ): TopicsDetectionJobProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TopicsDetectionJobProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TopicsDetectionJobProperties(entry, context); + }); }; const deserializeAws_json1_1UnsupportedLanguageException = ( @@ -9243,3 +9561,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-comprehendmedical/protocols/Aws_json1_1.ts b/clients/client-comprehendmedical/protocols/Aws_json1_1.ts index 01f23247471b..a9a68108b005 100644 --- a/clients/client-comprehendmedical/protocols/Aws_json1_1.ts +++ b/clients/client-comprehendmedical/protocols/Aws_json1_1.ts @@ -151,7 +151,7 @@ export const serializeAws_json1_1DescribeEntitiesDetectionV2JobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.DescribeEntitiesDetectionV2Job", }; let body: any; @@ -164,7 +164,7 @@ export const serializeAws_json1_1DescribeICD10CMInferenceJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.DescribeICD10CMInferenceJob", }; let body: any; @@ -177,7 +177,7 @@ export const serializeAws_json1_1DescribePHIDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.DescribePHIDetectionJob", }; let body: any; @@ -190,7 +190,7 @@ export const serializeAws_json1_1DescribeRxNormInferenceJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.DescribeRxNormInferenceJob", }; let body: any; @@ -203,7 +203,7 @@ export const serializeAws_json1_1DetectEntitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.DetectEntities", }; let body: any; @@ -216,7 +216,7 @@ export const serializeAws_json1_1DetectEntitiesV2Command = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.DetectEntitiesV2", }; let body: any; @@ -229,7 +229,7 @@ export const serializeAws_json1_1DetectPHICommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.DetectPHI", }; let body: any; @@ -242,7 +242,7 @@ export const serializeAws_json1_1InferICD10CMCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.InferICD10CM", }; let body: any; @@ -255,7 +255,7 @@ export const serializeAws_json1_1InferRxNormCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.InferRxNorm", }; let body: any; @@ -268,7 +268,7 @@ export const serializeAws_json1_1ListEntitiesDetectionV2JobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.ListEntitiesDetectionV2Jobs", }; let body: any; @@ -281,7 +281,7 @@ export const serializeAws_json1_1ListICD10CMInferenceJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.ListICD10CMInferenceJobs", }; let body: any; @@ -294,7 +294,7 @@ export const serializeAws_json1_1ListPHIDetectionJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.ListPHIDetectionJobs", }; let body: any; @@ -307,7 +307,7 @@ export const serializeAws_json1_1ListRxNormInferenceJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.ListRxNormInferenceJobs", }; let body: any; @@ -320,7 +320,7 @@ export const serializeAws_json1_1StartEntitiesDetectionV2JobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.StartEntitiesDetectionV2Job", }; let body: any; @@ -333,7 +333,7 @@ export const serializeAws_json1_1StartICD10CMInferenceJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.StartICD10CMInferenceJob", }; let body: any; @@ -346,7 +346,7 @@ export const serializeAws_json1_1StartPHIDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.StartPHIDetectionJob", }; let body: any; @@ -359,7 +359,7 @@ export const serializeAws_json1_1StartRxNormInferenceJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.StartRxNormInferenceJob", }; let body: any; @@ -372,7 +372,7 @@ export const serializeAws_json1_1StopEntitiesDetectionV2JobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.StopEntitiesDetectionV2Job", }; let body: any; @@ -385,7 +385,7 @@ export const serializeAws_json1_1StopICD10CMInferenceJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.StopICD10CMInferenceJob", }; let body: any; @@ -398,7 +398,7 @@ export const serializeAws_json1_1StopPHIDetectionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.StopPHIDetectionJob", }; let body: any; @@ -411,7 +411,7 @@ export const serializeAws_json1_1StopRxNormInferenceJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ComprehendMedical_20181030.StopRxNormInferenceJob", }; let body: any; @@ -446,8 +446,7 @@ const deserializeAws_json1_1DescribeEntitiesDetectionV2JobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -525,8 +524,7 @@ const deserializeAws_json1_1DescribeICD10CMInferenceJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -604,8 +602,7 @@ const deserializeAws_json1_1DescribePHIDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -683,8 +680,7 @@ const deserializeAws_json1_1DescribeRxNormInferenceJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -762,8 +758,7 @@ const deserializeAws_json1_1DetectEntitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -857,8 +852,7 @@ const deserializeAws_json1_1DetectEntitiesV2CommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -952,8 +946,7 @@ const deserializeAws_json1_1DetectPHICommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1047,8 +1040,7 @@ const deserializeAws_json1_1InferICD10CMCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1142,8 +1134,7 @@ const deserializeAws_json1_1InferRxNormCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1237,8 +1228,7 @@ const deserializeAws_json1_1ListEntitiesDetectionV2JobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1316,8 +1306,7 @@ const deserializeAws_json1_1ListICD10CMInferenceJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1395,8 +1384,7 @@ const deserializeAws_json1_1ListPHIDetectionJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1474,8 +1462,7 @@ const deserializeAws_json1_1ListRxNormInferenceJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1553,8 +1540,7 @@ const deserializeAws_json1_1StartEntitiesDetectionV2JobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1632,8 +1618,7 @@ const deserializeAws_json1_1StartICD10CMInferenceJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1711,8 +1696,7 @@ const deserializeAws_json1_1StartPHIDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1790,8 +1774,7 @@ const deserializeAws_json1_1StartRxNormInferenceJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1869,8 +1852,7 @@ const deserializeAws_json1_1StopEntitiesDetectionV2JobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -1940,8 +1922,7 @@ const deserializeAws_json1_1StopICD10CMInferenceJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -2011,8 +1992,7 @@ const deserializeAws_json1_1StopPHIDetectionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -2082,8 +2062,7 @@ const deserializeAws_json1_1StopRxNormInferenceJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.comprehendmedical#InternalServerException": @@ -2251,12 +2230,12 @@ const serializeAws_json1_1ComprehendMedicalAsyncJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmitTimeAfter !== undefined && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), - ...(input.SubmitTimeBefore !== undefined && { - SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmitTimeAfter !== undefined && + input.SubmitTimeAfter !== null && { SubmitTimeAfter: Math.round(input.SubmitTimeAfter.getTime() / 1000) }), + ...(input.SubmitTimeBefore !== undefined && + input.SubmitTimeBefore !== null && { SubmitTimeBefore: Math.round(input.SubmitTimeBefore.getTime() / 1000) }), }; }; @@ -2265,7 +2244,7 @@ const serializeAws_json1_1DescribeEntitiesDetectionV2JobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -2274,7 +2253,7 @@ const serializeAws_json1_1DescribeICD10CMInferenceJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -2283,7 +2262,7 @@ const serializeAws_json1_1DescribePHIDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -2292,44 +2271,44 @@ const serializeAws_json1_1DescribeRxNormInferenceJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; const serializeAws_json1_1DetectEntitiesRequest = (input: DetectEntitiesRequest, context: __SerdeContext): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_json1_1DetectEntitiesV2Request = (input: DetectEntitiesV2Request, context: __SerdeContext): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_json1_1DetectPHIRequest = (input: DetectPHIRequest, context: __SerdeContext): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_json1_1InferICD10CMRequest = (input: InferICD10CMRequest, context: __SerdeContext): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_json1_1InferRxNormRequest = (input: InferRxNormRequest, context: __SerdeContext): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_json1_1InputDataConfig = (input: InputDataConfig, context: __SerdeContext): any => { return { - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3Key !== undefined && { S3Key: input.S3Key }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3Key !== undefined && input.S3Key !== null && { S3Key: input.S3Key }), }; }; @@ -2338,11 +2317,10 @@ const serializeAws_json1_1ListEntitiesDetectionV2JobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2351,11 +2329,10 @@ const serializeAws_json1_1ListICD10CMInferenceJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2364,11 +2341,10 @@ const serializeAws_json1_1ListPHIDetectionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2377,18 +2353,17 @@ const serializeAws_json1_1ListRxNormInferenceJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { - Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter(input.Filter, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1OutputDataConfig = (input: OutputDataConfig, context: __SerdeContext): any => { return { - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3Key !== undefined && { S3Key: input.S3Key }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3Key !== undefined && input.S3Key !== null && { S3Key: input.S3Key }), }; }; @@ -2398,16 +2373,19 @@ const serializeAws_json1_1StartEntitiesDetectionV2JobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), }; }; @@ -2417,16 +2395,19 @@ const serializeAws_json1_1StartICD10CMInferenceJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), }; }; @@ -2436,16 +2417,19 @@ const serializeAws_json1_1StartPHIDetectionJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), }; }; @@ -2455,16 +2439,19 @@ const serializeAws_json1_1StartRxNormInferenceJobRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), }; }; @@ -2473,7 +2460,7 @@ const serializeAws_json1_1StopEntitiesDetectionV2JobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -2482,7 +2469,7 @@ const serializeAws_json1_1StopICD10CMInferenceJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -2491,7 +2478,7 @@ const serializeAws_json1_1StopPHIDetectionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -2500,7 +2487,7 @@ const serializeAws_json1_1StopRxNormInferenceJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -2527,7 +2514,14 @@ const deserializeAws_json1_1Attribute = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1AttributeList = (output: any, context: __SerdeContext): Attribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Attribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Attribute(entry, context); + }); }; const deserializeAws_json1_1ComprehendMedicalAsyncJobProperties = ( @@ -2573,7 +2567,14 @@ const deserializeAws_json1_1ComprehendMedicalAsyncJobPropertiesList = ( output: any, context: __SerdeContext ): ComprehendMedicalAsyncJobProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ComprehendMedicalAsyncJobProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ComprehendMedicalAsyncJobProperties(entry, context); + }); }; const deserializeAws_json1_1DescribeEntitiesDetectionV2JobResponse = ( @@ -2692,7 +2693,14 @@ const deserializeAws_json1_1Entity = (output: any, context: __SerdeContext): Ent }; const deserializeAws_json1_1EntityList = (output: any, context: __SerdeContext): Entity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Entity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Entity(entry, context); + }); }; const deserializeAws_json1_1ICD10CMAttribute = (output: any, context: __SerdeContext): ICD10CMAttribute => { @@ -2715,7 +2723,14 @@ const deserializeAws_json1_1ICD10CMAttribute = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ICD10CMAttributeList = (output: any, context: __SerdeContext): ICD10CMAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ICD10CMAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ICD10CMAttribute(entry, context); + }); }; const deserializeAws_json1_1ICD10CMConcept = (output: any, context: __SerdeContext): ICD10CMConcept => { @@ -2727,7 +2742,14 @@ const deserializeAws_json1_1ICD10CMConcept = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ICD10CMConceptList = (output: any, context: __SerdeContext): ICD10CMConcept[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ICD10CMConcept(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ICD10CMConcept(entry, context); + }); }; const deserializeAws_json1_1ICD10CMEntity = (output: any, context: __SerdeContext): ICD10CMEntity => { @@ -2755,7 +2777,14 @@ const deserializeAws_json1_1ICD10CMEntity = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ICD10CMEntityList = (output: any, context: __SerdeContext): ICD10CMEntity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ICD10CMEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ICD10CMEntity(entry, context); + }); }; const deserializeAws_json1_1ICD10CMTrait = (output: any, context: __SerdeContext): ICD10CMTrait => { @@ -2766,7 +2795,14 @@ const deserializeAws_json1_1ICD10CMTrait = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ICD10CMTraitList = (output: any, context: __SerdeContext): ICD10CMTrait[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ICD10CMTrait(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ICD10CMTrait(entry, context); + }); }; const deserializeAws_json1_1InferICD10CMResponse = (output: any, context: __SerdeContext): InferICD10CMResponse => { @@ -2931,7 +2967,14 @@ const deserializeAws_json1_1RxNormAttribute = (output: any, context: __SerdeCont }; const deserializeAws_json1_1RxNormAttributeList = (output: any, context: __SerdeContext): RxNormAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RxNormAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RxNormAttribute(entry, context); + }); }; const deserializeAws_json1_1RxNormConcept = (output: any, context: __SerdeContext): RxNormConcept => { @@ -2943,7 +2986,14 @@ const deserializeAws_json1_1RxNormConcept = (output: any, context: __SerdeContex }; const deserializeAws_json1_1RxNormConceptList = (output: any, context: __SerdeContext): RxNormConcept[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RxNormConcept(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RxNormConcept(entry, context); + }); }; const deserializeAws_json1_1RxNormEntity = (output: any, context: __SerdeContext): RxNormEntity => { @@ -2971,7 +3021,14 @@ const deserializeAws_json1_1RxNormEntity = (output: any, context: __SerdeContext }; const deserializeAws_json1_1RxNormEntityList = (output: any, context: __SerdeContext): RxNormEntity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RxNormEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RxNormEntity(entry, context); + }); }; const deserializeAws_json1_1RxNormTrait = (output: any, context: __SerdeContext): RxNormTrait => { @@ -2982,7 +3039,14 @@ const deserializeAws_json1_1RxNormTrait = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1RxNormTraitList = (output: any, context: __SerdeContext): RxNormTrait[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RxNormTrait(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RxNormTrait(entry, context); + }); }; const deserializeAws_json1_1ServiceUnavailableException = ( @@ -3092,7 +3156,14 @@ const deserializeAws_json1_1Trait = (output: any, context: __SerdeContext): Trai }; const deserializeAws_json1_1TraitList = (output: any, context: __SerdeContext): Trait[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Trait(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Trait(entry, context); + }); }; const deserializeAws_json1_1UnmappedAttribute = (output: any, context: __SerdeContext): UnmappedAttribute => { @@ -3106,7 +3177,14 @@ const deserializeAws_json1_1UnmappedAttribute = (output: any, context: __SerdeCo }; const deserializeAws_json1_1UnmappedAttributeList = (output: any, context: __SerdeContext): UnmappedAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UnmappedAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UnmappedAttribute(entry, context); + }); }; const deserializeAws_json1_1ValidationException = (output: any, context: __SerdeContext): ValidationException => { @@ -3165,3 +3243,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-compute-optimizer/protocols/Aws_json1_0.ts b/clients/client-compute-optimizer/protocols/Aws_json1_0.ts index b2ebcb021141..16fe98bebb83 100644 --- a/clients/client-compute-optimizer/protocols/Aws_json1_0.ts +++ b/clients/client-compute-optimizer/protocols/Aws_json1_0.ts @@ -109,7 +109,7 @@ export const serializeAws_json1_0DescribeRecommendationExportJobsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.DescribeRecommendationExportJobs", }; let body: any; @@ -122,7 +122,7 @@ export const serializeAws_json1_0ExportAutoScalingGroupRecommendationsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.ExportAutoScalingGroupRecommendations", }; let body: any; @@ -135,7 +135,7 @@ export const serializeAws_json1_0ExportEC2InstanceRecommendationsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.ExportEC2InstanceRecommendations", }; let body: any; @@ -148,7 +148,7 @@ export const serializeAws_json1_0GetAutoScalingGroupRecommendationsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.GetAutoScalingGroupRecommendations", }; let body: any; @@ -161,7 +161,7 @@ export const serializeAws_json1_0GetEBSVolumeRecommendationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.GetEBSVolumeRecommendations", }; let body: any; @@ -174,7 +174,7 @@ export const serializeAws_json1_0GetEC2InstanceRecommendationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.GetEC2InstanceRecommendations", }; let body: any; @@ -187,7 +187,7 @@ export const serializeAws_json1_0GetEC2RecommendationProjectedMetricsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.GetEC2RecommendationProjectedMetrics", }; let body: any; @@ -200,7 +200,7 @@ export const serializeAws_json1_0GetEnrollmentStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.GetEnrollmentStatus", }; let body: any; @@ -213,7 +213,7 @@ export const serializeAws_json1_0GetRecommendationSummariesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.GetRecommendationSummaries", }; let body: any; @@ -226,7 +226,7 @@ export const serializeAws_json1_0UpdateEnrollmentStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "ComputeOptimizerService.UpdateEnrollmentStatus", }; let body: any; @@ -261,8 +261,7 @@ const deserializeAws_json1_0DescribeRecommendationExportJobsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -372,8 +371,7 @@ const deserializeAws_json1_0ExportAutoScalingGroupRecommendationsCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -483,8 +481,7 @@ const deserializeAws_json1_0ExportEC2InstanceRecommendationsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -594,8 +591,7 @@ const deserializeAws_json1_0GetAutoScalingGroupRecommendationsCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -705,8 +701,7 @@ const deserializeAws_json1_0GetEBSVolumeRecommendationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -816,8 +811,7 @@ const deserializeAws_json1_0GetEC2InstanceRecommendationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -927,8 +921,7 @@ const deserializeAws_json1_0GetEC2RecommendationProjectedMetricsCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -1038,8 +1031,7 @@ const deserializeAws_json1_0GetEnrollmentStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -1133,8 +1125,7 @@ const deserializeAws_json1_0GetRecommendationSummariesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -1236,8 +1227,7 @@ const deserializeAws_json1_0UpdateEnrollmentStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.computeoptimizer#AccessDeniedException": @@ -1440,11 +1430,25 @@ const deserializeAws_json1_0ThrottlingExceptionResponse = async ( }; const serializeAws_json1_0AccountIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0AutoScalingGroupArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0DescribeRecommendationExportJobsRequest = ( @@ -1452,36 +1456,60 @@ const serializeAws_json1_0DescribeRecommendationExportJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.filters !== undefined && { filters: serializeAws_json1_0JobFilters(input.filters, context) }), - ...(input.jobIds !== undefined && { jobIds: serializeAws_json1_0JobIds(input.jobIds, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_0JobFilters(input.filters, context) }), + ...(input.jobIds !== undefined && + input.jobIds !== null && { jobIds: serializeAws_json1_0JobIds(input.jobIds, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_0EBSFilter = (input: EBSFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_json1_0FilterValues(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_0FilterValues(input.values, context) }), }; }; const serializeAws_json1_0EBSFilters = (input: EBSFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0EBSFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0EBSFilter(entry, context); + }); }; const serializeAws_json1_0ExportableAutoScalingGroupFields = ( input: (ExportableAutoScalingGroupField | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0ExportableInstanceFields = ( input: (ExportableInstanceField | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0ExportAutoScalingGroupRecommendationsRequest = ( @@ -1489,16 +1517,21 @@ const serializeAws_json1_0ExportAutoScalingGroupRecommendationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.accountIds !== undefined && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), - ...(input.fieldsToExport !== undefined && { - fieldsToExport: serializeAws_json1_0ExportableAutoScalingGroupFields(input.fieldsToExport, context), - }), - ...(input.fileFormat !== undefined && { fileFormat: input.fileFormat }), - ...(input.filters !== undefined && { filters: serializeAws_json1_0Filters(input.filters, context) }), - ...(input.includeMemberAccounts !== undefined && { includeMemberAccounts: input.includeMemberAccounts }), - ...(input.s3DestinationConfig !== undefined && { - s3DestinationConfig: serializeAws_json1_0S3DestinationConfig(input.s3DestinationConfig, context), - }), + ...(input.accountIds !== undefined && + input.accountIds !== null && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), + ...(input.fieldsToExport !== undefined && + input.fieldsToExport !== null && { + fieldsToExport: serializeAws_json1_0ExportableAutoScalingGroupFields(input.fieldsToExport, context), + }), + ...(input.fileFormat !== undefined && input.fileFormat !== null && { fileFormat: input.fileFormat }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_0Filters(input.filters, context) }), + ...(input.includeMemberAccounts !== undefined && + input.includeMemberAccounts !== null && { includeMemberAccounts: input.includeMemberAccounts }), + ...(input.s3DestinationConfig !== undefined && + input.s3DestinationConfig !== null && { + s3DestinationConfig: serializeAws_json1_0S3DestinationConfig(input.s3DestinationConfig, context), + }), }; }; @@ -1507,32 +1540,52 @@ const serializeAws_json1_0ExportEC2InstanceRecommendationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.accountIds !== undefined && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), - ...(input.fieldsToExport !== undefined && { - fieldsToExport: serializeAws_json1_0ExportableInstanceFields(input.fieldsToExport, context), - }), - ...(input.fileFormat !== undefined && { fileFormat: input.fileFormat }), - ...(input.filters !== undefined && { filters: serializeAws_json1_0Filters(input.filters, context) }), - ...(input.includeMemberAccounts !== undefined && { includeMemberAccounts: input.includeMemberAccounts }), - ...(input.s3DestinationConfig !== undefined && { - s3DestinationConfig: serializeAws_json1_0S3DestinationConfig(input.s3DestinationConfig, context), - }), + ...(input.accountIds !== undefined && + input.accountIds !== null && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), + ...(input.fieldsToExport !== undefined && + input.fieldsToExport !== null && { + fieldsToExport: serializeAws_json1_0ExportableInstanceFields(input.fieldsToExport, context), + }), + ...(input.fileFormat !== undefined && input.fileFormat !== null && { fileFormat: input.fileFormat }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_0Filters(input.filters, context) }), + ...(input.includeMemberAccounts !== undefined && + input.includeMemberAccounts !== null && { includeMemberAccounts: input.includeMemberAccounts }), + ...(input.s3DestinationConfig !== undefined && + input.s3DestinationConfig !== null && { + s3DestinationConfig: serializeAws_json1_0S3DestinationConfig(input.s3DestinationConfig, context), + }), }; }; const serializeAws_json1_0Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_json1_0FilterValues(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_0FilterValues(input.values, context) }), }; }; const serializeAws_json1_0Filters = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Filter(entry, context); + }); }; const serializeAws_json1_0FilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0GetAutoScalingGroupRecommendationsRequest = ( @@ -1540,13 +1593,16 @@ const serializeAws_json1_0GetAutoScalingGroupRecommendationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.accountIds !== undefined && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), - ...(input.autoScalingGroupArns !== undefined && { - autoScalingGroupArns: serializeAws_json1_0AutoScalingGroupArns(input.autoScalingGroupArns, context), - }), - ...(input.filters !== undefined && { filters: serializeAws_json1_0Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.accountIds !== undefined && + input.accountIds !== null && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), + ...(input.autoScalingGroupArns !== undefined && + input.autoScalingGroupArns !== null && { + autoScalingGroupArns: serializeAws_json1_0AutoScalingGroupArns(input.autoScalingGroupArns, context), + }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_0Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -1555,11 +1611,14 @@ const serializeAws_json1_0GetEBSVolumeRecommendationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.accountIds !== undefined && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), - ...(input.filters !== undefined && { filters: serializeAws_json1_0EBSFilters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.volumeArns !== undefined && { volumeArns: serializeAws_json1_0VolumeArns(input.volumeArns, context) }), + ...(input.accountIds !== undefined && + input.accountIds !== null && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_0EBSFilters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.volumeArns !== undefined && + input.volumeArns !== null && { volumeArns: serializeAws_json1_0VolumeArns(input.volumeArns, context) }), }; }; @@ -1568,13 +1627,14 @@ const serializeAws_json1_0GetEC2InstanceRecommendationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.accountIds !== undefined && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), - ...(input.filters !== undefined && { filters: serializeAws_json1_0Filters(input.filters, context) }), - ...(input.instanceArns !== undefined && { - instanceArns: serializeAws_json1_0InstanceArns(input.instanceArns, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.accountIds !== undefined && + input.accountIds !== null && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_0Filters(input.filters, context) }), + ...(input.instanceArns !== undefined && + input.instanceArns !== null && { instanceArns: serializeAws_json1_0InstanceArns(input.instanceArns, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -1583,11 +1643,13 @@ const serializeAws_json1_0GetEC2RecommendationProjectedMetricsRequest = ( context: __SerdeContext ): any => { return { - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.instanceArn !== undefined && { instanceArn: input.instanceArn }), - ...(input.period !== undefined && { period: input.period }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.stat !== undefined && { stat: input.stat }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.instanceArn !== undefined && input.instanceArn !== null && { instanceArn: input.instanceArn }), + ...(input.period !== undefined && input.period !== null && { period: input.period }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.stat !== undefined && input.stat !== null && { stat: input.stat }), }; }; @@ -1603,35 +1665,58 @@ const serializeAws_json1_0GetRecommendationSummariesRequest = ( context: __SerdeContext ): any => { return { - ...(input.accountIds !== undefined && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.accountIds !== undefined && + input.accountIds !== null && { accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_0InstanceArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0JobFilter = (input: JobFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_json1_0FilterValues(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_0FilterValues(input.values, context) }), }; }; const serializeAws_json1_0JobFilters = (input: JobFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0JobFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0JobFilter(entry, context); + }); }; const serializeAws_json1_0JobIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0S3DestinationConfig = (input: S3DestinationConfig, context: __SerdeContext): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.keyPrefix !== undefined && { keyPrefix: input.keyPrefix }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.keyPrefix !== undefined && input.keyPrefix !== null && { keyPrefix: input.keyPrefix }), }; }; @@ -1640,13 +1725,21 @@ const serializeAws_json1_0UpdateEnrollmentStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.includeMemberAccounts !== undefined && { includeMemberAccounts: input.includeMemberAccounts }), - ...(input.status !== undefined && { status: input.status }), + ...(input.includeMemberAccounts !== undefined && + input.includeMemberAccounts !== null && { includeMemberAccounts: input.includeMemberAccounts }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_0VolumeArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => { @@ -1729,14 +1822,28 @@ const deserializeAws_json1_0AutoScalingGroupRecommendationOptions = ( output: any, context: __SerdeContext ): AutoScalingGroupRecommendationOption[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0AutoScalingGroupRecommendationOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0AutoScalingGroupRecommendationOption(entry, context); + }); }; const deserializeAws_json1_0AutoScalingGroupRecommendations = ( output: any, context: __SerdeContext ): AutoScalingGroupRecommendation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0AutoScalingGroupRecommendation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0AutoScalingGroupRecommendation(entry, context); + }); }; const deserializeAws_json1_0DescribeRecommendationExportJobsResponse = ( @@ -1761,7 +1868,14 @@ const deserializeAws_json1_0EBSUtilizationMetric = (output: any, context: __Serd }; const deserializeAws_json1_0EBSUtilizationMetrics = (output: any, context: __SerdeContext): EBSUtilizationMetric[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0EBSUtilizationMetric(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0EBSUtilizationMetric(entry, context); + }); }; const deserializeAws_json1_0ExportAutoScalingGroupRecommendationsResponse = ( @@ -1888,7 +2002,14 @@ const deserializeAws_json1_0GetRecommendationErrors = ( output: any, context: __SerdeContext ): GetRecommendationError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0GetRecommendationError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0GetRecommendationError(entry, context); + }); }; const deserializeAws_json1_0GetRecommendationSummariesResponse = ( @@ -1957,7 +2078,14 @@ const deserializeAws_json1_0InstanceRecommendations = ( output: any, context: __SerdeContext ): InstanceRecommendation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0InstanceRecommendation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0InstanceRecommendation(entry, context); + }); }; const deserializeAws_json1_0InternalServerException = ( @@ -1985,7 +2113,14 @@ const deserializeAws_json1_0LimitExceededException = (output: any, context: __Se }; const deserializeAws_json1_0MetricValues = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0MissingAuthenticationToken = ( @@ -2018,14 +2153,28 @@ const deserializeAws_json1_0ProjectedMetric = (output: any, context: __SerdeCont }; const deserializeAws_json1_0ProjectedMetrics = (output: any, context: __SerdeContext): ProjectedMetric[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ProjectedMetric(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ProjectedMetric(entry, context); + }); }; const deserializeAws_json1_0ProjectedUtilizationMetrics = ( output: any, context: __SerdeContext ): UtilizationMetric[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0UtilizationMetric(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0UtilizationMetric(entry, context); + }); }; const deserializeAws_json1_0RecommendationExportJob = ( @@ -2057,14 +2206,28 @@ const deserializeAws_json1_0RecommendationExportJobs = ( output: any, context: __SerdeContext ): RecommendationExportJob[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0RecommendationExportJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0RecommendationExportJob(entry, context); + }); }; const deserializeAws_json1_0RecommendationOptions = ( output: any, context: __SerdeContext ): InstanceRecommendationOption[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0InstanceRecommendationOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0InstanceRecommendationOption(entry, context); + }); }; const deserializeAws_json1_0RecommendationSource = (output: any, context: __SerdeContext): RecommendationSource => { @@ -2081,14 +2244,28 @@ const deserializeAws_json1_0RecommendationSource = (output: any, context: __Serd }; const deserializeAws_json1_0RecommendationSources = (output: any, context: __SerdeContext): RecommendationSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0RecommendationSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0RecommendationSource(entry, context); + }); }; const deserializeAws_json1_0RecommendationSummaries = ( output: any, context: __SerdeContext ): RecommendationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0RecommendationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0RecommendationSummary(entry, context); + }); }; const deserializeAws_json1_0RecommendationSummary = (output: any, context: __SerdeContext): RecommendationSummary => { @@ -2126,7 +2303,14 @@ const deserializeAws_json1_0RecommendedOptionProjectedMetrics = ( output: any, context: __SerdeContext ): RecommendedOptionProjectedMetric[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0RecommendedOptionProjectedMetric(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0RecommendedOptionProjectedMetric(entry, context); + }); }; const deserializeAws_json1_0ResourceNotFoundException = ( @@ -2156,7 +2340,14 @@ const deserializeAws_json1_0ServiceUnavailableException = ( }; const deserializeAws_json1_0Summaries = (output: any, context: __SerdeContext): Summary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Summary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Summary(entry, context); + }); }; const deserializeAws_json1_0Summary = (output: any, context: __SerdeContext): Summary => { @@ -2173,7 +2364,14 @@ const deserializeAws_json1_0ThrottlingException = (output: any, context: __Serde }; const deserializeAws_json1_0Timestamps = (output: any, context: __SerdeContext): Date[] => { - return (output || []).map((entry: any) => new Date(Math.round(entry * 1000))); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return new Date(Math.round(entry * 1000)); + }); }; const deserializeAws_json1_0UpdateEnrollmentStatusResponse = ( @@ -2195,7 +2393,14 @@ const deserializeAws_json1_0UtilizationMetric = (output: any, context: __SerdeCo }; const deserializeAws_json1_0UtilizationMetrics = (output: any, context: __SerdeContext): UtilizationMetric[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0UtilizationMetric(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0UtilizationMetric(entry, context); + }); }; const deserializeAws_json1_0VolumeConfiguration = (output: any, context: __SerdeContext): VolumeConfiguration => { @@ -2266,11 +2471,25 @@ const deserializeAws_json1_0VolumeRecommendationOptions = ( output: any, context: __SerdeContext ): VolumeRecommendationOption[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0VolumeRecommendationOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0VolumeRecommendationOption(entry, context); + }); }; const deserializeAws_json1_0VolumeRecommendations = (output: any, context: __SerdeContext): VolumeRecommendation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0VolumeRecommendation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0VolumeRecommendation(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2323,3 +2542,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-config-service/protocols/Aws_json1_1.ts b/clients/client-config-service/protocols/Aws_json1_1.ts index b56dacc5f8d2..dc198bd0ab90 100644 --- a/clients/client-config-service/protocols/Aws_json1_1.ts +++ b/clients/client-config-service/protocols/Aws_json1_1.ts @@ -579,7 +579,7 @@ export const serializeAws_json1_1BatchGetAggregateResourceConfigCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.BatchGetAggregateResourceConfig", }; let body: any; @@ -592,7 +592,7 @@ export const serializeAws_json1_1BatchGetResourceConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.BatchGetResourceConfig", }; let body: any; @@ -605,7 +605,7 @@ export const serializeAws_json1_1DeleteAggregationAuthorizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteAggregationAuthorization", }; let body: any; @@ -618,7 +618,7 @@ export const serializeAws_json1_1DeleteConfigRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteConfigRule", }; let body: any; @@ -631,7 +631,7 @@ export const serializeAws_json1_1DeleteConfigurationAggregatorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteConfigurationAggregator", }; let body: any; @@ -644,7 +644,7 @@ export const serializeAws_json1_1DeleteConfigurationRecorderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteConfigurationRecorder", }; let body: any; @@ -657,7 +657,7 @@ export const serializeAws_json1_1DeleteConformancePackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteConformancePack", }; let body: any; @@ -670,7 +670,7 @@ export const serializeAws_json1_1DeleteDeliveryChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteDeliveryChannel", }; let body: any; @@ -683,7 +683,7 @@ export const serializeAws_json1_1DeleteEvaluationResultsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteEvaluationResults", }; let body: any; @@ -696,7 +696,7 @@ export const serializeAws_json1_1DeleteOrganizationConfigRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteOrganizationConfigRule", }; let body: any; @@ -709,7 +709,7 @@ export const serializeAws_json1_1DeleteOrganizationConformancePackCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteOrganizationConformancePack", }; let body: any; @@ -722,7 +722,7 @@ export const serializeAws_json1_1DeletePendingAggregationRequestCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeletePendingAggregationRequest", }; let body: any; @@ -735,7 +735,7 @@ export const serializeAws_json1_1DeleteRemediationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteRemediationConfiguration", }; let body: any; @@ -748,7 +748,7 @@ export const serializeAws_json1_1DeleteRemediationExceptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteRemediationExceptions", }; let body: any; @@ -761,7 +761,7 @@ export const serializeAws_json1_1DeleteResourceConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteResourceConfig", }; let body: any; @@ -774,7 +774,7 @@ export const serializeAws_json1_1DeleteRetentionConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeleteRetentionConfiguration", }; let body: any; @@ -787,7 +787,7 @@ export const serializeAws_json1_1DeliverConfigSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DeliverConfigSnapshot", }; let body: any; @@ -800,7 +800,7 @@ export const serializeAws_json1_1DescribeAggregateComplianceByConfigRulesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeAggregateComplianceByConfigRules", }; let body: any; @@ -813,7 +813,7 @@ export const serializeAws_json1_1DescribeAggregationAuthorizationsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeAggregationAuthorizations", }; let body: any; @@ -826,7 +826,7 @@ export const serializeAws_json1_1DescribeComplianceByConfigRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeComplianceByConfigRule", }; let body: any; @@ -839,7 +839,7 @@ export const serializeAws_json1_1DescribeComplianceByResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeComplianceByResource", }; let body: any; @@ -852,7 +852,7 @@ export const serializeAws_json1_1DescribeConfigRuleEvaluationStatusCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeConfigRuleEvaluationStatus", }; let body: any; @@ -865,7 +865,7 @@ export const serializeAws_json1_1DescribeConfigRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeConfigRules", }; let body: any; @@ -878,7 +878,7 @@ export const serializeAws_json1_1DescribeConfigurationAggregatorsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeConfigurationAggregators", }; let body: any; @@ -891,7 +891,7 @@ export const serializeAws_json1_1DescribeConfigurationAggregatorSourcesStatusCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeConfigurationAggregatorSourcesStatus", }; let body: any; @@ -904,7 +904,7 @@ export const serializeAws_json1_1DescribeConfigurationRecordersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeConfigurationRecorders", }; let body: any; @@ -917,7 +917,7 @@ export const serializeAws_json1_1DescribeConfigurationRecorderStatusCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeConfigurationRecorderStatus", }; let body: any; @@ -930,7 +930,7 @@ export const serializeAws_json1_1DescribeConformancePackComplianceCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeConformancePackCompliance", }; let body: any; @@ -943,7 +943,7 @@ export const serializeAws_json1_1DescribeConformancePacksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeConformancePacks", }; let body: any; @@ -956,7 +956,7 @@ export const serializeAws_json1_1DescribeConformancePackStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeConformancePackStatus", }; let body: any; @@ -969,7 +969,7 @@ export const serializeAws_json1_1DescribeDeliveryChannelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeDeliveryChannels", }; let body: any; @@ -982,7 +982,7 @@ export const serializeAws_json1_1DescribeDeliveryChannelStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeDeliveryChannelStatus", }; let body: any; @@ -995,7 +995,7 @@ export const serializeAws_json1_1DescribeOrganizationConfigRulesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeOrganizationConfigRules", }; let body: any; @@ -1008,7 +1008,7 @@ export const serializeAws_json1_1DescribeOrganizationConfigRuleStatusesCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeOrganizationConfigRuleStatuses", }; let body: any; @@ -1021,7 +1021,7 @@ export const serializeAws_json1_1DescribeOrganizationConformancePacksCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeOrganizationConformancePacks", }; let body: any; @@ -1034,7 +1034,7 @@ export const serializeAws_json1_1DescribeOrganizationConformancePackStatusesComm context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeOrganizationConformancePackStatuses", }; let body: any; @@ -1047,7 +1047,7 @@ export const serializeAws_json1_1DescribePendingAggregationRequestsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribePendingAggregationRequests", }; let body: any; @@ -1060,7 +1060,7 @@ export const serializeAws_json1_1DescribeRemediationConfigurationsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeRemediationConfigurations", }; let body: any; @@ -1073,7 +1073,7 @@ export const serializeAws_json1_1DescribeRemediationExceptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeRemediationExceptions", }; let body: any; @@ -1086,7 +1086,7 @@ export const serializeAws_json1_1DescribeRemediationExecutionStatusCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeRemediationExecutionStatus", }; let body: any; @@ -1099,7 +1099,7 @@ export const serializeAws_json1_1DescribeRetentionConfigurationsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.DescribeRetentionConfigurations", }; let body: any; @@ -1112,7 +1112,7 @@ export const serializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetAggregateComplianceDetailsByConfigRule", }; let body: any; @@ -1125,7 +1125,7 @@ export const serializeAws_json1_1GetAggregateConfigRuleComplianceSummaryCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetAggregateConfigRuleComplianceSummary", }; let body: any; @@ -1138,7 +1138,7 @@ export const serializeAws_json1_1GetAggregateDiscoveredResourceCountsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetAggregateDiscoveredResourceCounts", }; let body: any; @@ -1151,7 +1151,7 @@ export const serializeAws_json1_1GetAggregateResourceConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetAggregateResourceConfig", }; let body: any; @@ -1164,7 +1164,7 @@ export const serializeAws_json1_1GetComplianceDetailsByConfigRuleCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetComplianceDetailsByConfigRule", }; let body: any; @@ -1177,7 +1177,7 @@ export const serializeAws_json1_1GetComplianceDetailsByResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetComplianceDetailsByResource", }; let body: any; @@ -1190,7 +1190,7 @@ export const serializeAws_json1_1GetComplianceSummaryByConfigRuleCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetComplianceSummaryByConfigRule", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -1201,7 +1201,7 @@ export const serializeAws_json1_1GetComplianceSummaryByResourceTypeCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetComplianceSummaryByResourceType", }; let body: any; @@ -1214,7 +1214,7 @@ export const serializeAws_json1_1GetConformancePackComplianceDetailsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetConformancePackComplianceDetails", }; let body: any; @@ -1227,7 +1227,7 @@ export const serializeAws_json1_1GetConformancePackComplianceSummaryCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetConformancePackComplianceSummary", }; let body: any; @@ -1240,7 +1240,7 @@ export const serializeAws_json1_1GetDiscoveredResourceCountsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetDiscoveredResourceCounts", }; let body: any; @@ -1253,7 +1253,7 @@ export const serializeAws_json1_1GetOrganizationConfigRuleDetailedStatusCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetOrganizationConfigRuleDetailedStatus", }; let body: any; @@ -1266,7 +1266,7 @@ export const serializeAws_json1_1GetOrganizationConformancePackDetailedStatusCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetOrganizationConformancePackDetailedStatus", }; let body: any; @@ -1279,7 +1279,7 @@ export const serializeAws_json1_1GetResourceConfigHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.GetResourceConfigHistory", }; let body: any; @@ -1292,7 +1292,7 @@ export const serializeAws_json1_1ListAggregateDiscoveredResourcesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.ListAggregateDiscoveredResources", }; let body: any; @@ -1305,7 +1305,7 @@ export const serializeAws_json1_1ListDiscoveredResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.ListDiscoveredResources", }; let body: any; @@ -1318,7 +1318,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.ListTagsForResource", }; let body: any; @@ -1331,7 +1331,7 @@ export const serializeAws_json1_1PutAggregationAuthorizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutAggregationAuthorization", }; let body: any; @@ -1344,7 +1344,7 @@ export const serializeAws_json1_1PutConfigRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutConfigRule", }; let body: any; @@ -1357,7 +1357,7 @@ export const serializeAws_json1_1PutConfigurationAggregatorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutConfigurationAggregator", }; let body: any; @@ -1370,7 +1370,7 @@ export const serializeAws_json1_1PutConfigurationRecorderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutConfigurationRecorder", }; let body: any; @@ -1383,7 +1383,7 @@ export const serializeAws_json1_1PutConformancePackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutConformancePack", }; let body: any; @@ -1396,7 +1396,7 @@ export const serializeAws_json1_1PutDeliveryChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutDeliveryChannel", }; let body: any; @@ -1409,7 +1409,7 @@ export const serializeAws_json1_1PutEvaluationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutEvaluations", }; let body: any; @@ -1422,7 +1422,7 @@ export const serializeAws_json1_1PutOrganizationConfigRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutOrganizationConfigRule", }; let body: any; @@ -1435,7 +1435,7 @@ export const serializeAws_json1_1PutOrganizationConformancePackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutOrganizationConformancePack", }; let body: any; @@ -1448,7 +1448,7 @@ export const serializeAws_json1_1PutRemediationConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutRemediationConfigurations", }; let body: any; @@ -1461,7 +1461,7 @@ export const serializeAws_json1_1PutRemediationExceptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutRemediationExceptions", }; let body: any; @@ -1474,7 +1474,7 @@ export const serializeAws_json1_1PutResourceConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutResourceConfig", }; let body: any; @@ -1487,7 +1487,7 @@ export const serializeAws_json1_1PutRetentionConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.PutRetentionConfiguration", }; let body: any; @@ -1500,7 +1500,7 @@ export const serializeAws_json1_1SelectAggregateResourceConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.SelectAggregateResourceConfig", }; let body: any; @@ -1513,7 +1513,7 @@ export const serializeAws_json1_1SelectResourceConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.SelectResourceConfig", }; let body: any; @@ -1526,7 +1526,7 @@ export const serializeAws_json1_1StartConfigRulesEvaluationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.StartConfigRulesEvaluation", }; let body: any; @@ -1539,7 +1539,7 @@ export const serializeAws_json1_1StartConfigurationRecorderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.StartConfigurationRecorder", }; let body: any; @@ -1552,7 +1552,7 @@ export const serializeAws_json1_1StartRemediationExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.StartRemediationExecution", }; let body: any; @@ -1565,7 +1565,7 @@ export const serializeAws_json1_1StopConfigurationRecorderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.StopConfigurationRecorder", }; let body: any; @@ -1578,7 +1578,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.TagResource", }; let body: any; @@ -1591,7 +1591,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StarlingDoveService.UntagResource", }; let body: any; @@ -1626,8 +1626,7 @@ const deserializeAws_json1_1BatchGetAggregateResourceConfigCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConfigurationAggregatorException": case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": @@ -1689,8 +1688,7 @@ const deserializeAws_json1_1BatchGetResourceConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoAvailableConfigurationRecorderException": case "com.amazonaws.configservice#NoAvailableConfigurationRecorderException": @@ -1749,8 +1747,7 @@ const deserializeAws_json1_1DeleteAggregationAuthorizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -1801,8 +1798,7 @@ const deserializeAws_json1_1DeleteConfigRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConfigRuleException": case "com.amazonaws.configservice#NoSuchConfigRuleException": @@ -1861,8 +1857,7 @@ const deserializeAws_json1_1DeleteConfigurationAggregatorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConfigurationAggregatorException": case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": @@ -1913,8 +1908,7 @@ const deserializeAws_json1_1DeleteConfigurationRecorderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConfigurationRecorderException": case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": @@ -1965,8 +1959,7 @@ const deserializeAws_json1_1DeleteConformancePackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConformancePackException": case "com.amazonaws.configservice#NoSuchConformancePackException": @@ -2025,8 +2018,7 @@ const deserializeAws_json1_1DeleteDeliveryChannelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LastDeliveryChannelDeleteFailedException": case "com.amazonaws.configservice#LastDeliveryChannelDeleteFailedException": @@ -2088,8 +2080,7 @@ const deserializeAws_json1_1DeleteEvaluationResultsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConfigRuleException": case "com.amazonaws.configservice#NoSuchConfigRuleException": @@ -2148,8 +2139,7 @@ const deserializeAws_json1_1DeleteOrganizationConfigRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchOrganizationConfigRuleException": case "com.amazonaws.configservice#NoSuchOrganizationConfigRuleException": @@ -2216,8 +2206,7 @@ const deserializeAws_json1_1DeleteOrganizationConformancePackCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchOrganizationConformancePackException": case "com.amazonaws.configservice#NoSuchOrganizationConformancePackException": @@ -2284,8 +2273,7 @@ const deserializeAws_json1_1DeletePendingAggregationRequestCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -2339,8 +2327,7 @@ const deserializeAws_json1_1DeleteRemediationConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientPermissionsException": case "com.amazonaws.configservice#InsufficientPermissionsException": @@ -2410,8 +2397,7 @@ const deserializeAws_json1_1DeleteRemediationExceptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchRemediationExceptionException": case "com.amazonaws.configservice#NoSuchRemediationExceptionException": @@ -2462,8 +2448,7 @@ const deserializeAws_json1_1DeleteResourceConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoRunningConfigurationRecorderException": case "com.amazonaws.configservice#NoRunningConfigurationRecorderException": @@ -2522,8 +2507,7 @@ const deserializeAws_json1_1DeleteRetentionConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -2585,8 +2569,7 @@ const deserializeAws_json1_1DeliverConfigSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoAvailableConfigurationRecorderException": case "com.amazonaws.configservice#NoAvailableConfigurationRecorderException": @@ -2656,8 +2639,7 @@ const deserializeAws_json1_1DescribeAggregateComplianceByConfigRulesCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -2735,8 +2717,7 @@ const deserializeAws_json1_1DescribeAggregationAuthorizationsCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -2806,8 +2787,7 @@ const deserializeAws_json1_1DescribeComplianceByConfigRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.configservice#InvalidNextTokenException": @@ -2877,8 +2857,7 @@ const deserializeAws_json1_1DescribeComplianceByResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.configservice#InvalidNextTokenException": @@ -2940,8 +2919,7 @@ const deserializeAws_json1_1DescribeConfigRuleEvaluationStatusCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.configservice#InvalidNextTokenException": @@ -3011,8 +2989,7 @@ const deserializeAws_json1_1DescribeConfigRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.configservice#InvalidNextTokenException": @@ -3074,8 +3051,7 @@ const deserializeAws_json1_1DescribeConfigurationAggregatorsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -3153,8 +3129,7 @@ const deserializeAws_json1_1DescribeConfigurationAggregatorSourcesStatusCommandE }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -3232,8 +3207,7 @@ const deserializeAws_json1_1DescribeConfigurationRecordersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConfigurationRecorderException": case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": @@ -3287,8 +3261,7 @@ const deserializeAws_json1_1DescribeConfigurationRecorderStatusCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConfigurationRecorderException": case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": @@ -3342,8 +3315,7 @@ const deserializeAws_json1_1DescribeConformancePackComplianceCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -3429,8 +3401,7 @@ const deserializeAws_json1_1DescribeConformancePacksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -3508,8 +3479,7 @@ const deserializeAws_json1_1DescribeConformancePackStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -3579,8 +3549,7 @@ const deserializeAws_json1_1DescribeDeliveryChannelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchDeliveryChannelException": case "com.amazonaws.configservice#NoSuchDeliveryChannelException": @@ -3634,8 +3603,7 @@ const deserializeAws_json1_1DescribeDeliveryChannelStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchDeliveryChannelException": case "com.amazonaws.configservice#NoSuchDeliveryChannelException": @@ -3689,8 +3657,7 @@ const deserializeAws_json1_1DescribeOrganizationConfigRulesCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -3768,8 +3735,7 @@ const deserializeAws_json1_1DescribeOrganizationConfigRuleStatusesCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -3847,8 +3813,7 @@ const deserializeAws_json1_1DescribeOrganizationConformancePacksCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -3926,8 +3891,7 @@ const deserializeAws_json1_1DescribeOrganizationConformancePackStatusesCommandEr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -4005,8 +3969,7 @@ const deserializeAws_json1_1DescribePendingAggregationRequestsCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -4076,8 +4039,7 @@ const deserializeAws_json1_1DescribeRemediationConfigurationsCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4123,8 +4085,7 @@ const deserializeAws_json1_1DescribeRemediationExceptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.configservice#InvalidNextTokenException": @@ -4186,8 +4147,7 @@ const deserializeAws_json1_1DescribeRemediationExecutionStatusCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.configservice#InvalidNextTokenException": @@ -4249,8 +4209,7 @@ const deserializeAws_json1_1DescribeRetentionConfigurationsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.configservice#InvalidNextTokenException": @@ -4320,8 +4279,7 @@ const deserializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleCommandErro }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -4399,8 +4357,7 @@ const deserializeAws_json1_1GetAggregateConfigRuleComplianceSummaryCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -4478,8 +4435,7 @@ const deserializeAws_json1_1GetAggregateDiscoveredResourceCountsCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -4557,8 +4513,7 @@ const deserializeAws_json1_1GetAggregateResourceConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConfigurationAggregatorException": case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": @@ -4636,8 +4591,7 @@ const deserializeAws_json1_1GetComplianceDetailsByConfigRuleCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.configservice#InvalidNextTokenException": @@ -4707,8 +4661,7 @@ const deserializeAws_json1_1GetComplianceDetailsByResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -4762,8 +4715,7 @@ const deserializeAws_json1_1GetComplianceSummaryByConfigRuleCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4809,8 +4761,7 @@ const deserializeAws_json1_1GetComplianceSummaryByResourceTypeCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -4864,8 +4815,7 @@ const deserializeAws_json1_1GetConformancePackComplianceDetailsCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -4951,8 +4901,7 @@ const deserializeAws_json1_1GetConformancePackComplianceSummaryCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -5022,8 +4971,7 @@ const deserializeAws_json1_1GetDiscoveredResourceCountsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -5093,8 +5041,7 @@ const deserializeAws_json1_1GetOrganizationConfigRuleDetailedStatusCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -5172,8 +5119,7 @@ const deserializeAws_json1_1GetOrganizationConformancePackDetailedStatusCommandE }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -5251,8 +5197,7 @@ const deserializeAws_json1_1GetResourceConfigHistoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -5346,8 +5291,7 @@ const deserializeAws_json1_1ListAggregateDiscoveredResourcesCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -5425,8 +5369,7 @@ const deserializeAws_json1_1ListDiscoveredResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -5504,8 +5447,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLimitException": case "com.amazonaws.configservice#InvalidLimitException": @@ -5583,8 +5525,7 @@ const deserializeAws_json1_1PutAggregationAuthorizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -5635,8 +5576,7 @@ const deserializeAws_json1_1PutConfigRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientPermissionsException": case "com.amazonaws.configservice#InsufficientPermissionsException": @@ -5722,8 +5662,7 @@ const deserializeAws_json1_1PutConfigurationAggregatorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -5814,8 +5753,7 @@ const deserializeAws_json1_1PutConfigurationRecorderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidConfigurationRecorderNameException": case "com.amazonaws.configservice#InvalidConfigurationRecorderNameException": @@ -5896,8 +5834,7 @@ const deserializeAws_json1_1PutConformancePackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConformancePackTemplateValidationException": case "com.amazonaws.configservice#ConformancePackTemplateValidationException": @@ -5980,8 +5917,7 @@ const deserializeAws_json1_1PutDeliveryChannelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientDeliveryPolicyException": case "com.amazonaws.configservice#InsufficientDeliveryPolicyException": @@ -6083,8 +6019,7 @@ const deserializeAws_json1_1PutEvaluationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -6154,8 +6089,7 @@ const deserializeAws_json1_1PutOrganizationConfigRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientPermissionsException": case "com.amazonaws.configservice#InsufficientPermissionsException": @@ -6268,8 +6202,7 @@ const deserializeAws_json1_1PutOrganizationConformancePackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientPermissionsException": case "com.amazonaws.configservice#InsufficientPermissionsException": @@ -6385,8 +6318,7 @@ const deserializeAws_json1_1PutRemediationConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientPermissionsException": case "com.amazonaws.configservice#InsufficientPermissionsException": @@ -6448,8 +6380,7 @@ const deserializeAws_json1_1PutRemediationExceptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientPermissionsException": case "com.amazonaws.configservice#InsufficientPermissionsException": @@ -6508,8 +6439,7 @@ const deserializeAws_json1_1PutResourceConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientPermissionsException": case "com.amazonaws.configservice#InsufficientPermissionsException": @@ -6587,8 +6517,7 @@ const deserializeAws_json1_1PutRetentionConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -6653,8 +6582,7 @@ const deserializeAws_json1_1SelectAggregateResourceConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidExpressionException": case "com.amazonaws.configservice#InvalidExpressionException": @@ -6732,8 +6660,7 @@ const deserializeAws_json1_1SelectResourceConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidExpressionException": case "com.amazonaws.configservice#InvalidExpressionException": @@ -6803,8 +6730,7 @@ const deserializeAws_json1_1StartConfigRulesEvaluationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValueException": case "com.amazonaws.configservice#InvalidParameterValueException": @@ -6879,8 +6805,7 @@ const deserializeAws_json1_1StartConfigurationRecorderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoAvailableDeliveryChannelException": case "com.amazonaws.configservice#NoAvailableDeliveryChannelException": @@ -6942,8 +6867,7 @@ const deserializeAws_json1_1StartRemediationExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientPermissionsException": case "com.amazonaws.configservice#InsufficientPermissionsException": @@ -7010,8 +6934,7 @@ const deserializeAws_json1_1StopConfigurationRecorderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "NoSuchConfigurationRecorderException": case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": @@ -7062,8 +6985,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.configservice#ResourceNotFoundException": @@ -7130,8 +7052,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.configservice#ResourceNotFoundException": @@ -7939,32 +7860,53 @@ const serializeAws_json1_1AccountAggregationSource = ( context: __SerdeContext ): any => { return { - ...(input.AccountIds !== undefined && { - AccountIds: serializeAws_json1_1AccountAggregationSourceAccountList(input.AccountIds, context), - }), - ...(input.AllAwsRegions !== undefined && { AllAwsRegions: input.AllAwsRegions }), - ...(input.AwsRegions !== undefined && { - AwsRegions: serializeAws_json1_1AggregatorRegionList(input.AwsRegions, context), - }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { + AccountIds: serializeAws_json1_1AccountAggregationSourceAccountList(input.AccountIds, context), + }), + ...(input.AllAwsRegions !== undefined && input.AllAwsRegions !== null && { AllAwsRegions: input.AllAwsRegions }), + ...(input.AwsRegions !== undefined && + input.AwsRegions !== null && { AwsRegions: serializeAws_json1_1AggregatorRegionList(input.AwsRegions, context) }), }; }; const serializeAws_json1_1AccountAggregationSourceAccountList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AccountAggregationSourceList = ( input: AccountAggregationSource[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AccountAggregationSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AccountAggregationSource(entry, context); + }); }; const serializeAws_json1_1AggregatedSourceStatusTypeList = ( input: (AggregatedSourceStatusType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AggregateResourceIdentifier = ( @@ -7972,16 +7914,24 @@ const serializeAws_json1_1AggregateResourceIdentifier = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceName !== undefined && { ResourceName: input.ResourceName }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.SourceAccountId !== undefined && { SourceAccountId: input.SourceAccountId }), - ...(input.SourceRegion !== undefined && { SourceRegion: input.SourceRegion }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { ResourceName: input.ResourceName }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.SourceAccountId !== undefined && + input.SourceAccountId !== null && { SourceAccountId: input.SourceAccountId }), + ...(input.SourceRegion !== undefined && input.SourceRegion !== null && { SourceRegion: input.SourceRegion }), }; }; const serializeAws_json1_1AggregatorRegionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchGetAggregateResourceConfigRequest = ( @@ -7989,12 +7939,12 @@ const serializeAws_json1_1BatchGetAggregateResourceConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.ResourceIdentifiers !== undefined && { - ResourceIdentifiers: serializeAws_json1_1ResourceIdentifiersList(input.ResourceIdentifiers, context), - }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.ResourceIdentifiers !== undefined && + input.ResourceIdentifiers !== null && { + ResourceIdentifiers: serializeAws_json1_1ResourceIdentifiersList(input.ResourceIdentifiers, context), + }), }; }; @@ -8003,34 +7953,51 @@ const serializeAws_json1_1BatchGetResourceConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.resourceKeys !== undefined && { - resourceKeys: serializeAws_json1_1ResourceKeys(input.resourceKeys, context), - }), + ...(input.resourceKeys !== undefined && + input.resourceKeys !== null && { resourceKeys: serializeAws_json1_1ResourceKeys(input.resourceKeys, context) }), }; }; const serializeAws_json1_1ComplianceResourceTypes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ComplianceTypes = (input: (ComplianceType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConfigRule = (input: ConfigRule, context: __SerdeContext): any => { return { - ...(input.ConfigRuleArn !== undefined && { ConfigRuleArn: input.ConfigRuleArn }), - ...(input.ConfigRuleId !== undefined && { ConfigRuleId: input.ConfigRuleId }), - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.ConfigRuleState !== undefined && { ConfigRuleState: input.ConfigRuleState }), - ...(input.CreatedBy !== undefined && { CreatedBy: input.CreatedBy }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.InputParameters !== undefined && { InputParameters: input.InputParameters }), - ...(input.MaximumExecutionFrequency !== undefined && { - MaximumExecutionFrequency: input.MaximumExecutionFrequency, - }), - ...(input.Scope !== undefined && { Scope: serializeAws_json1_1Scope(input.Scope, context) }), - ...(input.Source !== undefined && { Source: serializeAws_json1_1Source(input.Source, context) }), + ...(input.ConfigRuleArn !== undefined && input.ConfigRuleArn !== null && { ConfigRuleArn: input.ConfigRuleArn }), + ...(input.ConfigRuleId !== undefined && input.ConfigRuleId !== null && { ConfigRuleId: input.ConfigRuleId }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.ConfigRuleState !== undefined && + input.ConfigRuleState !== null && { ConfigRuleState: input.ConfigRuleState }), + ...(input.CreatedBy !== undefined && input.CreatedBy !== null && { CreatedBy: input.CreatedBy }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.InputParameters !== undefined && + input.InputParameters !== null && { InputParameters: input.InputParameters }), + ...(input.MaximumExecutionFrequency !== undefined && + input.MaximumExecutionFrequency !== null && { MaximumExecutionFrequency: input.MaximumExecutionFrequency }), + ...(input.Scope !== undefined && + input.Scope !== null && { Scope: serializeAws_json1_1Scope(input.Scope, context) }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_json1_1Source(input.Source, context) }), }; }; @@ -8039,10 +8006,12 @@ const serializeAws_json1_1ConfigRuleComplianceFilters = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), - ...(input.ComplianceType !== undefined && { ComplianceType: input.ComplianceType }), - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), + ...(input.ComplianceType !== undefined && + input.ComplianceType !== null && { ComplianceType: input.ComplianceType }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), }; }; @@ -8051,13 +8020,20 @@ const serializeAws_json1_1ConfigRuleComplianceSummaryFilters = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), }; }; const serializeAws_json1_1ConfigRuleNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConfigSnapshotDeliveryProperties = ( @@ -8065,26 +8041,42 @@ const serializeAws_json1_1ConfigSnapshotDeliveryProperties = ( context: __SerdeContext ): any => { return { - ...(input.deliveryFrequency !== undefined && { deliveryFrequency: input.deliveryFrequency }), + ...(input.deliveryFrequency !== undefined && + input.deliveryFrequency !== null && { deliveryFrequency: input.deliveryFrequency }), }; }; const serializeAws_json1_1ConfigurationAggregatorNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConfigurationRecorder = (input: ConfigurationRecorder, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.recordingGroup !== undefined && { - recordingGroup: serializeAws_json1_1RecordingGroup(input.recordingGroup, context), - }), - ...(input.roleARN !== undefined && { roleARN: input.roleARN }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.recordingGroup !== undefined && + input.recordingGroup !== null && { + recordingGroup: serializeAws_json1_1RecordingGroup(input.recordingGroup, context), + }), + ...(input.roleARN !== undefined && input.roleARN !== null && { roleARN: input.roleARN }), }; }; const serializeAws_json1_1ConfigurationRecorderNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConformancePackComplianceFilters = ( @@ -8092,19 +8084,35 @@ const serializeAws_json1_1ConformancePackComplianceFilters = ( context: __SerdeContext ): any => { return { - ...(input.ComplianceType !== undefined && { ComplianceType: input.ComplianceType }), - ...(input.ConfigRuleNames !== undefined && { - ConfigRuleNames: serializeAws_json1_1ConformancePackConfigRuleNames(input.ConfigRuleNames, context), - }), + ...(input.ComplianceType !== undefined && + input.ComplianceType !== null && { ComplianceType: input.ComplianceType }), + ...(input.ConfigRuleNames !== undefined && + input.ConfigRuleNames !== null && { + ConfigRuleNames: serializeAws_json1_1ConformancePackConfigRuleNames(input.ConfigRuleNames, context), + }), }; }; const serializeAws_json1_1ConformancePackComplianceResourceIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConformancePackConfigRuleNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConformancePackEvaluationFilters = ( @@ -8112,14 +8120,17 @@ const serializeAws_json1_1ConformancePackEvaluationFilters = ( context: __SerdeContext ): any => { return { - ...(input.ComplianceType !== undefined && { ComplianceType: input.ComplianceType }), - ...(input.ConfigRuleNames !== undefined && { - ConfigRuleNames: serializeAws_json1_1ConformancePackConfigRuleNames(input.ConfigRuleNames, context), - }), - ...(input.ResourceIds !== undefined && { - ResourceIds: serializeAws_json1_1ConformancePackComplianceResourceIds(input.ResourceIds, context), - }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ComplianceType !== undefined && + input.ComplianceType !== null && { ComplianceType: input.ComplianceType }), + ...(input.ConfigRuleNames !== undefined && + input.ConfigRuleNames !== null && { + ConfigRuleNames: serializeAws_json1_1ConformancePackConfigRuleNames(input.ConfigRuleNames, context), + }), + ...(input.ResourceIds !== undefined && + input.ResourceIds !== null && { + ResourceIds: serializeAws_json1_1ConformancePackComplianceResourceIds(input.ResourceIds, context), + }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; @@ -8128,8 +8139,9 @@ const serializeAws_json1_1ConformancePackInputParameter = ( context: __SerdeContext ): any => { return { - ...(input.ParameterName !== undefined && { ParameterName: input.ParameterName }), - ...(input.ParameterValue !== undefined && { ParameterValue: input.ParameterValue }), + ...(input.ParameterName !== undefined && input.ParameterName !== null && { ParameterName: input.ParameterName }), + ...(input.ParameterValue !== undefined && + input.ParameterValue !== null && { ParameterValue: input.ParameterValue }), }; }; @@ -8137,15 +8149,36 @@ const serializeAws_json1_1ConformancePackInputParameters = ( input: ConformancePackInputParameter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ConformancePackInputParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ConformancePackInputParameter(entry, context); + }); }; const serializeAws_json1_1ConformancePackNamesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConformancePackNamesToSummarizeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteAggregationAuthorizationRequest = ( @@ -8153,14 +8186,17 @@ const serializeAws_json1_1DeleteAggregationAuthorizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AuthorizedAccountId !== undefined && { AuthorizedAccountId: input.AuthorizedAccountId }), - ...(input.AuthorizedAwsRegion !== undefined && { AuthorizedAwsRegion: input.AuthorizedAwsRegion }), + ...(input.AuthorizedAccountId !== undefined && + input.AuthorizedAccountId !== null && { AuthorizedAccountId: input.AuthorizedAccountId }), + ...(input.AuthorizedAwsRegion !== undefined && + input.AuthorizedAwsRegion !== null && { AuthorizedAwsRegion: input.AuthorizedAwsRegion }), }; }; const serializeAws_json1_1DeleteConfigRuleRequest = (input: DeleteConfigRuleRequest, context: __SerdeContext): any => { return { - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), }; }; @@ -8169,9 +8205,8 @@ const serializeAws_json1_1DeleteConfigurationAggregatorRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), }; }; @@ -8180,9 +8215,8 @@ const serializeAws_json1_1DeleteConfigurationRecorderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationRecorderName !== undefined && { - ConfigurationRecorderName: input.ConfigurationRecorderName, - }), + ...(input.ConfigurationRecorderName !== undefined && + input.ConfigurationRecorderName !== null && { ConfigurationRecorderName: input.ConfigurationRecorderName }), }; }; @@ -8191,7 +8225,8 @@ const serializeAws_json1_1DeleteConformancePackRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConformancePackName !== undefined && { ConformancePackName: input.ConformancePackName }), + ...(input.ConformancePackName !== undefined && + input.ConformancePackName !== null && { ConformancePackName: input.ConformancePackName }), }; }; @@ -8200,7 +8235,8 @@ const serializeAws_json1_1DeleteDeliveryChannelRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryChannelName !== undefined && { DeliveryChannelName: input.DeliveryChannelName }), + ...(input.DeliveryChannelName !== undefined && + input.DeliveryChannelName !== null && { DeliveryChannelName: input.DeliveryChannelName }), }; }; @@ -8209,7 +8245,8 @@ const serializeAws_json1_1DeleteEvaluationResultsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), }; }; @@ -8218,9 +8255,8 @@ const serializeAws_json1_1DeleteOrganizationConfigRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationConfigRuleName !== undefined && { - OrganizationConfigRuleName: input.OrganizationConfigRuleName, - }), + ...(input.OrganizationConfigRuleName !== undefined && + input.OrganizationConfigRuleName !== null && { OrganizationConfigRuleName: input.OrganizationConfigRuleName }), }; }; @@ -8229,9 +8265,10 @@ const serializeAws_json1_1DeleteOrganizationConformancePackRequest = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationConformancePackName !== undefined && { - OrganizationConformancePackName: input.OrganizationConformancePackName, - }), + ...(input.OrganizationConformancePackName !== undefined && + input.OrganizationConformancePackName !== null && { + OrganizationConformancePackName: input.OrganizationConformancePackName, + }), }; }; @@ -8240,8 +8277,10 @@ const serializeAws_json1_1DeletePendingAggregationRequestRequest = ( context: __SerdeContext ): any => { return { - ...(input.RequesterAccountId !== undefined && { RequesterAccountId: input.RequesterAccountId }), - ...(input.RequesterAwsRegion !== undefined && { RequesterAwsRegion: input.RequesterAwsRegion }), + ...(input.RequesterAccountId !== undefined && + input.RequesterAccountId !== null && { RequesterAccountId: input.RequesterAccountId }), + ...(input.RequesterAwsRegion !== undefined && + input.RequesterAwsRegion !== null && { RequesterAwsRegion: input.RequesterAwsRegion }), }; }; @@ -8250,8 +8289,9 @@ const serializeAws_json1_1DeleteRemediationConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; @@ -8260,10 +8300,12 @@ const serializeAws_json1_1DeleteRemediationExceptionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.ResourceKeys !== undefined && { - ResourceKeys: serializeAws_json1_1RemediationExceptionResourceKeys(input.ResourceKeys, context), - }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.ResourceKeys !== undefined && + input.ResourceKeys !== null && { + ResourceKeys: serializeAws_json1_1RemediationExceptionResourceKeys(input.ResourceKeys, context), + }), }; }; @@ -8272,8 +8314,8 @@ const serializeAws_json1_1DeleteResourceConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; @@ -8282,9 +8324,8 @@ const serializeAws_json1_1DeleteRetentionConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.RetentionConfigurationName !== undefined && { - RetentionConfigurationName: input.RetentionConfigurationName, - }), + ...(input.RetentionConfigurationName !== undefined && + input.RetentionConfigurationName !== null && { RetentionConfigurationName: input.RetentionConfigurationName }), }; }; @@ -8293,27 +8334,36 @@ const serializeAws_json1_1DeliverConfigSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.deliveryChannelName !== undefined && { deliveryChannelName: input.deliveryChannelName }), + ...(input.deliveryChannelName !== undefined && + input.deliveryChannelName !== null && { deliveryChannelName: input.deliveryChannelName }), }; }; const serializeAws_json1_1DeliveryChannel = (input: DeliveryChannel, context: __SerdeContext): any => { return { - ...(input.configSnapshotDeliveryProperties !== undefined && { - configSnapshotDeliveryProperties: serializeAws_json1_1ConfigSnapshotDeliveryProperties( - input.configSnapshotDeliveryProperties, - context - ), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.s3BucketName !== undefined && { s3BucketName: input.s3BucketName }), - ...(input.s3KeyPrefix !== undefined && { s3KeyPrefix: input.s3KeyPrefix }), - ...(input.snsTopicARN !== undefined && { snsTopicARN: input.snsTopicARN }), + ...(input.configSnapshotDeliveryProperties !== undefined && + input.configSnapshotDeliveryProperties !== null && { + configSnapshotDeliveryProperties: serializeAws_json1_1ConfigSnapshotDeliveryProperties( + input.configSnapshotDeliveryProperties, + context + ), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.s3BucketName !== undefined && input.s3BucketName !== null && { s3BucketName: input.s3BucketName }), + ...(input.s3KeyPrefix !== undefined && input.s3KeyPrefix !== null && { s3KeyPrefix: input.s3KeyPrefix }), + ...(input.snsTopicARN !== undefined && input.snsTopicARN !== null && { snsTopicARN: input.snsTopicARN }), }; }; const serializeAws_json1_1DeliveryChannelNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DescribeAggregateComplianceByConfigRulesRequest = ( @@ -8321,14 +8371,12 @@ const serializeAws_json1_1DescribeAggregateComplianceByConfigRulesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1ConfigRuleComplianceFilters(input.Filters, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ConfigRuleComplianceFilters(input.Filters, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8337,8 +8385,8 @@ const serializeAws_json1_1DescribeAggregationAuthorizationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8347,13 +8395,15 @@ const serializeAws_json1_1DescribeComplianceByConfigRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ComplianceTypes !== undefined && { - ComplianceTypes: serializeAws_json1_1ComplianceTypes(input.ComplianceTypes, context), - }), - ...(input.ConfigRuleNames !== undefined && { - ConfigRuleNames: serializeAws_json1_1ConfigRuleNames(input.ConfigRuleNames, context), - }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ComplianceTypes !== undefined && + input.ComplianceTypes !== null && { + ComplianceTypes: serializeAws_json1_1ComplianceTypes(input.ComplianceTypes, context), + }), + ...(input.ConfigRuleNames !== undefined && + input.ConfigRuleNames !== null && { + ConfigRuleNames: serializeAws_json1_1ConfigRuleNames(input.ConfigRuleNames, context), + }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8362,13 +8412,14 @@ const serializeAws_json1_1DescribeComplianceByResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ComplianceTypes !== undefined && { - ComplianceTypes: serializeAws_json1_1ComplianceTypes(input.ComplianceTypes, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ComplianceTypes !== undefined && + input.ComplianceTypes !== null && { + ComplianceTypes: serializeAws_json1_1ComplianceTypes(input.ComplianceTypes, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; @@ -8377,11 +8428,12 @@ const serializeAws_json1_1DescribeConfigRuleEvaluationStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleNames !== undefined && { - ConfigRuleNames: serializeAws_json1_1ConfigRuleNames(input.ConfigRuleNames, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConfigRuleNames !== undefined && + input.ConfigRuleNames !== null && { + ConfigRuleNames: serializeAws_json1_1ConfigRuleNames(input.ConfigRuleNames, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8390,10 +8442,11 @@ const serializeAws_json1_1DescribeConfigRulesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleNames !== undefined && { - ConfigRuleNames: serializeAws_json1_1ConfigRuleNames(input.ConfigRuleNames, context), - }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConfigRuleNames !== undefined && + input.ConfigRuleNames !== null && { + ConfigRuleNames: serializeAws_json1_1ConfigRuleNames(input.ConfigRuleNames, context), + }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8402,14 +8455,14 @@ const serializeAws_json1_1DescribeConfigurationAggregatorSourcesStatusRequest = context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.UpdateStatus !== undefined && { - UpdateStatus: serializeAws_json1_1AggregatedSourceStatusTypeList(input.UpdateStatus, context), - }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.UpdateStatus !== undefined && + input.UpdateStatus !== null && { + UpdateStatus: serializeAws_json1_1AggregatedSourceStatusTypeList(input.UpdateStatus, context), + }), }; }; @@ -8418,14 +8471,15 @@ const serializeAws_json1_1DescribeConfigurationAggregatorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorNames !== undefined && { - ConfigurationAggregatorNames: serializeAws_json1_1ConfigurationAggregatorNameList( - input.ConfigurationAggregatorNames, - context - ), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConfigurationAggregatorNames !== undefined && + input.ConfigurationAggregatorNames !== null && { + ConfigurationAggregatorNames: serializeAws_json1_1ConfigurationAggregatorNameList( + input.ConfigurationAggregatorNames, + context + ), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8434,12 +8488,13 @@ const serializeAws_json1_1DescribeConfigurationRecordersRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationRecorderNames !== undefined && { - ConfigurationRecorderNames: serializeAws_json1_1ConfigurationRecorderNameList( - input.ConfigurationRecorderNames, - context - ), - }), + ...(input.ConfigurationRecorderNames !== undefined && + input.ConfigurationRecorderNames !== null && { + ConfigurationRecorderNames: serializeAws_json1_1ConfigurationRecorderNameList( + input.ConfigurationRecorderNames, + context + ), + }), }; }; @@ -8448,12 +8503,13 @@ const serializeAws_json1_1DescribeConfigurationRecorderStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationRecorderNames !== undefined && { - ConfigurationRecorderNames: serializeAws_json1_1ConfigurationRecorderNameList( - input.ConfigurationRecorderNames, - context - ), - }), + ...(input.ConfigurationRecorderNames !== undefined && + input.ConfigurationRecorderNames !== null && { + ConfigurationRecorderNames: serializeAws_json1_1ConfigurationRecorderNameList( + input.ConfigurationRecorderNames, + context + ), + }), }; }; @@ -8462,12 +8518,14 @@ const serializeAws_json1_1DescribeConformancePackComplianceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConformancePackName !== undefined && { ConformancePackName: input.ConformancePackName }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1ConformancePackComplianceFilters(input.Filters, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConformancePackName !== undefined && + input.ConformancePackName !== null && { ConformancePackName: input.ConformancePackName }), + ...(input.Filters !== undefined && + input.Filters !== null && { + Filters: serializeAws_json1_1ConformancePackComplianceFilters(input.Filters, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8476,11 +8534,12 @@ const serializeAws_json1_1DescribeConformancePacksRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConformancePackNames !== undefined && { - ConformancePackNames: serializeAws_json1_1ConformancePackNamesList(input.ConformancePackNames, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConformancePackNames !== undefined && + input.ConformancePackNames !== null && { + ConformancePackNames: serializeAws_json1_1ConformancePackNamesList(input.ConformancePackNames, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8489,11 +8548,12 @@ const serializeAws_json1_1DescribeConformancePackStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConformancePackNames !== undefined && { - ConformancePackNames: serializeAws_json1_1ConformancePackNamesList(input.ConformancePackNames, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConformancePackNames !== undefined && + input.ConformancePackNames !== null && { + ConformancePackNames: serializeAws_json1_1ConformancePackNamesList(input.ConformancePackNames, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8502,9 +8562,10 @@ const serializeAws_json1_1DescribeDeliveryChannelsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryChannelNames !== undefined && { - DeliveryChannelNames: serializeAws_json1_1DeliveryChannelNameList(input.DeliveryChannelNames, context), - }), + ...(input.DeliveryChannelNames !== undefined && + input.DeliveryChannelNames !== null && { + DeliveryChannelNames: serializeAws_json1_1DeliveryChannelNameList(input.DeliveryChannelNames, context), + }), }; }; @@ -8513,9 +8574,10 @@ const serializeAws_json1_1DescribeDeliveryChannelStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryChannelNames !== undefined && { - DeliveryChannelNames: serializeAws_json1_1DeliveryChannelNameList(input.DeliveryChannelNames, context), - }), + ...(input.DeliveryChannelNames !== undefined && + input.DeliveryChannelNames !== null && { + DeliveryChannelNames: serializeAws_json1_1DeliveryChannelNameList(input.DeliveryChannelNames, context), + }), }; }; @@ -8524,14 +8586,15 @@ const serializeAws_json1_1DescribeOrganizationConfigRulesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationConfigRuleNames !== undefined && { - OrganizationConfigRuleNames: serializeAws_json1_1OrganizationConfigRuleNames( - input.OrganizationConfigRuleNames, - context - ), - }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationConfigRuleNames !== undefined && + input.OrganizationConfigRuleNames !== null && { + OrganizationConfigRuleNames: serializeAws_json1_1OrganizationConfigRuleNames( + input.OrganizationConfigRuleNames, + context + ), + }), }; }; @@ -8540,14 +8603,15 @@ const serializeAws_json1_1DescribeOrganizationConfigRuleStatusesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationConfigRuleNames !== undefined && { - OrganizationConfigRuleNames: serializeAws_json1_1OrganizationConfigRuleNames( - input.OrganizationConfigRuleNames, - context - ), - }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationConfigRuleNames !== undefined && + input.OrganizationConfigRuleNames !== null && { + OrganizationConfigRuleNames: serializeAws_json1_1OrganizationConfigRuleNames( + input.OrganizationConfigRuleNames, + context + ), + }), }; }; @@ -8556,14 +8620,15 @@ const serializeAws_json1_1DescribeOrganizationConformancePacksRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationConformancePackNames !== undefined && { - OrganizationConformancePackNames: serializeAws_json1_1OrganizationConformancePackNames( - input.OrganizationConformancePackNames, - context - ), - }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationConformancePackNames !== undefined && + input.OrganizationConformancePackNames !== null && { + OrganizationConformancePackNames: serializeAws_json1_1OrganizationConformancePackNames( + input.OrganizationConformancePackNames, + context + ), + }), }; }; @@ -8572,14 +8637,15 @@ const serializeAws_json1_1DescribeOrganizationConformancePackStatusesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationConformancePackNames !== undefined && { - OrganizationConformancePackNames: serializeAws_json1_1OrganizationConformancePackNames( - input.OrganizationConformancePackNames, - context - ), - }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationConformancePackNames !== undefined && + input.OrganizationConformancePackNames !== null && { + OrganizationConformancePackNames: serializeAws_json1_1OrganizationConformancePackNames( + input.OrganizationConformancePackNames, + context + ), + }), }; }; @@ -8588,8 +8654,8 @@ const serializeAws_json1_1DescribePendingAggregationRequestsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8598,9 +8664,10 @@ const serializeAws_json1_1DescribeRemediationConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleNames !== undefined && { - ConfigRuleNames: serializeAws_json1_1ConfigRuleNames(input.ConfigRuleNames, context), - }), + ...(input.ConfigRuleNames !== undefined && + input.ConfigRuleNames !== null && { + ConfigRuleNames: serializeAws_json1_1ConfigRuleNames(input.ConfigRuleNames, context), + }), }; }; @@ -8609,12 +8676,14 @@ const serializeAws_json1_1DescribeRemediationExceptionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceKeys !== undefined && { - ResourceKeys: serializeAws_json1_1RemediationExceptionResourceKeys(input.ResourceKeys, context), - }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceKeys !== undefined && + input.ResourceKeys !== null && { + ResourceKeys: serializeAws_json1_1RemediationExceptionResourceKeys(input.ResourceKeys, context), + }), }; }; @@ -8623,12 +8692,12 @@ const serializeAws_json1_1DescribeRemediationExecutionStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceKeys !== undefined && { - ResourceKeys: serializeAws_json1_1ResourceKeys(input.ResourceKeys, context), - }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceKeys !== undefined && + input.ResourceKeys !== null && { ResourceKeys: serializeAws_json1_1ResourceKeys(input.ResourceKeys, context) }), }; }; @@ -8637,41 +8706,57 @@ const serializeAws_json1_1DescribeRetentionConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.RetentionConfigurationNames !== undefined && { - RetentionConfigurationNames: serializeAws_json1_1RetentionConfigurationNameList( - input.RetentionConfigurationNames, - context - ), - }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.RetentionConfigurationNames !== undefined && + input.RetentionConfigurationNames !== null && { + RetentionConfigurationNames: serializeAws_json1_1RetentionConfigurationNameList( + input.RetentionConfigurationNames, + context + ), + }), }; }; const serializeAws_json1_1Evaluation = (input: Evaluation, context: __SerdeContext): any => { return { - ...(input.Annotation !== undefined && { Annotation: input.Annotation }), - ...(input.ComplianceResourceId !== undefined && { ComplianceResourceId: input.ComplianceResourceId }), - ...(input.ComplianceResourceType !== undefined && { ComplianceResourceType: input.ComplianceResourceType }), - ...(input.ComplianceType !== undefined && { ComplianceType: input.ComplianceType }), - ...(input.OrderingTimestamp !== undefined && { - OrderingTimestamp: Math.round(input.OrderingTimestamp.getTime() / 1000), - }), + ...(input.Annotation !== undefined && input.Annotation !== null && { Annotation: input.Annotation }), + ...(input.ComplianceResourceId !== undefined && + input.ComplianceResourceId !== null && { ComplianceResourceId: input.ComplianceResourceId }), + ...(input.ComplianceResourceType !== undefined && + input.ComplianceResourceType !== null && { ComplianceResourceType: input.ComplianceResourceType }), + ...(input.ComplianceType !== undefined && + input.ComplianceType !== null && { ComplianceType: input.ComplianceType }), + ...(input.OrderingTimestamp !== undefined && + input.OrderingTimestamp !== null && { OrderingTimestamp: Math.round(input.OrderingTimestamp.getTime() / 1000) }), }; }; const serializeAws_json1_1Evaluations = (input: Evaluation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Evaluation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Evaluation(entry, context); + }); }; const serializeAws_json1_1ExcludedAccounts = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ExecutionControls = (input: ExecutionControls, context: __SerdeContext): any => { return { - ...(input.SsmControls !== undefined && { - SsmControls: serializeAws_json1_1SsmControls(input.SsmControls, context), - }), + ...(input.SsmControls !== undefined && + input.SsmControls !== null && { SsmControls: serializeAws_json1_1SsmControls(input.SsmControls, context) }), }; }; @@ -8680,15 +8765,16 @@ const serializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), - ...(input.ComplianceType !== undefined && { ComplianceType: input.ComplianceType }), - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), + ...(input.ComplianceType !== undefined && + input.ComplianceType !== null && { ComplianceType: input.ComplianceType }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8697,15 +8783,15 @@ const serializeAws_json1_1GetAggregateConfigRuleComplianceSummaryRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1ConfigRuleComplianceSummaryFilters(input.Filters, context), - }), - ...(input.GroupByKey !== undefined && { GroupByKey: input.GroupByKey }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.Filters !== undefined && + input.Filters !== null && { + Filters: serializeAws_json1_1ConfigRuleComplianceSummaryFilters(input.Filters, context), + }), + ...(input.GroupByKey !== undefined && input.GroupByKey !== null && { GroupByKey: input.GroupByKey }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8714,13 +8800,13 @@ const serializeAws_json1_1GetAggregateDiscoveredResourceCountsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1ResourceCountFilters(input.Filters, context) }), - ...(input.GroupByKey !== undefined && { GroupByKey: input.GroupByKey }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ResourceCountFilters(input.Filters, context) }), + ...(input.GroupByKey !== undefined && input.GroupByKey !== null && { GroupByKey: input.GroupByKey }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8729,12 +8815,12 @@ const serializeAws_json1_1GetAggregateResourceConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.ResourceIdentifier !== undefined && { - ResourceIdentifier: serializeAws_json1_1AggregateResourceIdentifier(input.ResourceIdentifier, context), - }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.ResourceIdentifier !== undefined && + input.ResourceIdentifier !== null && { + ResourceIdentifier: serializeAws_json1_1AggregateResourceIdentifier(input.ResourceIdentifier, context), + }), }; }; @@ -8743,12 +8829,14 @@ const serializeAws_json1_1GetComplianceDetailsByConfigRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ComplianceTypes !== undefined && { - ComplianceTypes: serializeAws_json1_1ComplianceTypes(input.ComplianceTypes, context), - }), - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ComplianceTypes !== undefined && + input.ComplianceTypes !== null && { + ComplianceTypes: serializeAws_json1_1ComplianceTypes(input.ComplianceTypes, context), + }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8757,12 +8845,13 @@ const serializeAws_json1_1GetComplianceDetailsByResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ComplianceTypes !== undefined && { - ComplianceTypes: serializeAws_json1_1ComplianceTypes(input.ComplianceTypes, context), - }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ComplianceTypes !== undefined && + input.ComplianceTypes !== null && { + ComplianceTypes: serializeAws_json1_1ComplianceTypes(input.ComplianceTypes, context), + }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; @@ -8771,9 +8860,10 @@ const serializeAws_json1_1GetComplianceSummaryByResourceTypeRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceTypes !== undefined && { - ResourceTypes: serializeAws_json1_1ResourceTypes(input.ResourceTypes, context), - }), + ...(input.ResourceTypes !== undefined && + input.ResourceTypes !== null && { + ResourceTypes: serializeAws_json1_1ResourceTypes(input.ResourceTypes, context), + }), }; }; @@ -8782,12 +8872,14 @@ const serializeAws_json1_1GetConformancePackComplianceDetailsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConformancePackName !== undefined && { ConformancePackName: input.ConformancePackName }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1ConformancePackEvaluationFilters(input.Filters, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConformancePackName !== undefined && + input.ConformancePackName !== null && { ConformancePackName: input.ConformancePackName }), + ...(input.Filters !== undefined && + input.Filters !== null && { + Filters: serializeAws_json1_1ConformancePackEvaluationFilters(input.Filters, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8796,14 +8888,15 @@ const serializeAws_json1_1GetConformancePackComplianceSummaryRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConformancePackNames !== undefined && { - ConformancePackNames: serializeAws_json1_1ConformancePackNamesToSummarizeList( - input.ConformancePackNames, - context - ), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConformancePackNames !== undefined && + input.ConformancePackNames !== null && { + ConformancePackNames: serializeAws_json1_1ConformancePackNamesToSummarizeList( + input.ConformancePackNames, + context + ), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -8812,11 +8905,12 @@ const serializeAws_json1_1GetDiscoveredResourceCountsRequest = ( context: __SerdeContext ): any => { return { - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceTypes !== undefined && { - resourceTypes: serializeAws_json1_1ResourceTypes(input.resourceTypes, context), - }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceTypes !== undefined && + input.resourceTypes !== null && { + resourceTypes: serializeAws_json1_1ResourceTypes(input.resourceTypes, context), + }), }; }; @@ -8825,12 +8919,12 @@ const serializeAws_json1_1GetOrganizationConfigRuleDetailedStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1StatusDetailFilters(input.Filters, context) }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationConfigRuleName !== undefined && { - OrganizationConfigRuleName: input.OrganizationConfigRuleName, - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1StatusDetailFilters(input.Filters, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationConfigRuleName !== undefined && + input.OrganizationConfigRuleName !== null && { OrganizationConfigRuleName: input.OrganizationConfigRuleName }), }; }; @@ -8839,14 +8933,16 @@ const serializeAws_json1_1GetOrganizationConformancePackDetailedStatusRequest = context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1OrganizationResourceDetailedStatusFilters(input.Filters, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationConformancePackName !== undefined && { - OrganizationConformancePackName: input.OrganizationConformancePackName, - }), + ...(input.Filters !== undefined && + input.Filters !== null && { + Filters: serializeAws_json1_1OrganizationResourceDetailedStatusFilters(input.Filters, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationConformancePackName !== undefined && + input.OrganizationConformancePackName !== null && { + OrganizationConformancePackName: input.OrganizationConformancePackName, + }), }; }; @@ -8855,13 +8951,16 @@ const serializeAws_json1_1GetResourceConfigHistoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.chronologicalOrder !== undefined && { chronologicalOrder: input.chronologicalOrder }), - ...(input.earlierTime !== undefined && { earlierTime: Math.round(input.earlierTime.getTime() / 1000) }), - ...(input.laterTime !== undefined && { laterTime: Math.round(input.laterTime.getTime() / 1000) }), - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceId !== undefined && { resourceId: input.resourceId }), - ...(input.resourceType !== undefined && { resourceType: input.resourceType }), + ...(input.chronologicalOrder !== undefined && + input.chronologicalOrder !== null && { chronologicalOrder: input.chronologicalOrder }), + ...(input.earlierTime !== undefined && + input.earlierTime !== null && { earlierTime: Math.round(input.earlierTime.getTime() / 1000) }), + ...(input.laterTime !== undefined && + input.laterTime !== null && { laterTime: Math.round(input.laterTime.getTime() / 1000) }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceId !== undefined && input.resourceId !== null && { resourceId: input.resourceId }), + ...(input.resourceType !== undefined && input.resourceType !== null && { resourceType: input.resourceType }), }; }; @@ -8870,13 +8969,13 @@ const serializeAws_json1_1ListAggregateDiscoveredResourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1ResourceFilters(input.Filters, context) }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ResourceFilters(input.Filters, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; @@ -8885,14 +8984,14 @@ const serializeAws_json1_1ListDiscoveredResourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.includeDeletedResources !== undefined && { includeDeletedResources: input.includeDeletedResources }), - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceIds !== undefined && { - resourceIds: serializeAws_json1_1ResourceIdList(input.resourceIds, context), - }), - ...(input.resourceName !== undefined && { resourceName: input.resourceName }), - ...(input.resourceType !== undefined && { resourceType: input.resourceType }), + ...(input.includeDeletedResources !== undefined && + input.includeDeletedResources !== null && { includeDeletedResources: input.includeDeletedResources }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceIds !== undefined && + input.resourceIds !== null && { resourceIds: serializeAws_json1_1ResourceIdList(input.resourceIds, context) }), + ...(input.resourceName !== undefined && input.resourceName !== null && { resourceName: input.resourceName }), + ...(input.resourceType !== undefined && input.resourceType !== null && { resourceType: input.resourceType }), }; }; @@ -8901,9 +9000,9 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -8912,27 +9011,47 @@ const serializeAws_json1_1OrganizationAggregationSource = ( context: __SerdeContext ): any => { return { - ...(input.AllAwsRegions !== undefined && { AllAwsRegions: input.AllAwsRegions }), - ...(input.AwsRegions !== undefined && { - AwsRegions: serializeAws_json1_1AggregatorRegionList(input.AwsRegions, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.AllAwsRegions !== undefined && input.AllAwsRegions !== null && { AllAwsRegions: input.AllAwsRegions }), + ...(input.AwsRegions !== undefined && + input.AwsRegions !== null && { AwsRegions: serializeAws_json1_1AggregatorRegionList(input.AwsRegions, context) }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_json1_1OrganizationConfigRuleNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OrganizationConfigRuleTriggerTypes = ( input: (OrganizationConfigRuleTriggerType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OrganizationConformancePackNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OrganizationCustomRuleMetadata = ( @@ -8940,24 +9059,28 @@ const serializeAws_json1_1OrganizationCustomRuleMetadata = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.InputParameters !== undefined && { InputParameters: input.InputParameters }), - ...(input.LambdaFunctionArn !== undefined && { LambdaFunctionArn: input.LambdaFunctionArn }), - ...(input.MaximumExecutionFrequency !== undefined && { - MaximumExecutionFrequency: input.MaximumExecutionFrequency, - }), - ...(input.OrganizationConfigRuleTriggerTypes !== undefined && { - OrganizationConfigRuleTriggerTypes: serializeAws_json1_1OrganizationConfigRuleTriggerTypes( - input.OrganizationConfigRuleTriggerTypes, - context - ), - }), - ...(input.ResourceIdScope !== undefined && { ResourceIdScope: input.ResourceIdScope }), - ...(input.ResourceTypesScope !== undefined && { - ResourceTypesScope: serializeAws_json1_1ResourceTypesScope(input.ResourceTypesScope, context), - }), - ...(input.TagKeyScope !== undefined && { TagKeyScope: input.TagKeyScope }), - ...(input.TagValueScope !== undefined && { TagValueScope: input.TagValueScope }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.InputParameters !== undefined && + input.InputParameters !== null && { InputParameters: input.InputParameters }), + ...(input.LambdaFunctionArn !== undefined && + input.LambdaFunctionArn !== null && { LambdaFunctionArn: input.LambdaFunctionArn }), + ...(input.MaximumExecutionFrequency !== undefined && + input.MaximumExecutionFrequency !== null && { MaximumExecutionFrequency: input.MaximumExecutionFrequency }), + ...(input.OrganizationConfigRuleTriggerTypes !== undefined && + input.OrganizationConfigRuleTriggerTypes !== null && { + OrganizationConfigRuleTriggerTypes: serializeAws_json1_1OrganizationConfigRuleTriggerTypes( + input.OrganizationConfigRuleTriggerTypes, + context + ), + }), + ...(input.ResourceIdScope !== undefined && + input.ResourceIdScope !== null && { ResourceIdScope: input.ResourceIdScope }), + ...(input.ResourceTypesScope !== undefined && + input.ResourceTypesScope !== null && { + ResourceTypesScope: serializeAws_json1_1ResourceTypesScope(input.ResourceTypesScope, context), + }), + ...(input.TagKeyScope !== undefined && input.TagKeyScope !== null && { TagKeyScope: input.TagKeyScope }), + ...(input.TagValueScope !== undefined && input.TagValueScope !== null && { TagValueScope: input.TagValueScope }), }; }; @@ -8966,18 +9089,21 @@ const serializeAws_json1_1OrganizationManagedRuleMetadata = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.InputParameters !== undefined && { InputParameters: input.InputParameters }), - ...(input.MaximumExecutionFrequency !== undefined && { - MaximumExecutionFrequency: input.MaximumExecutionFrequency, - }), - ...(input.ResourceIdScope !== undefined && { ResourceIdScope: input.ResourceIdScope }), - ...(input.ResourceTypesScope !== undefined && { - ResourceTypesScope: serializeAws_json1_1ResourceTypesScope(input.ResourceTypesScope, context), - }), - ...(input.RuleIdentifier !== undefined && { RuleIdentifier: input.RuleIdentifier }), - ...(input.TagKeyScope !== undefined && { TagKeyScope: input.TagKeyScope }), - ...(input.TagValueScope !== undefined && { TagValueScope: input.TagValueScope }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.InputParameters !== undefined && + input.InputParameters !== null && { InputParameters: input.InputParameters }), + ...(input.MaximumExecutionFrequency !== undefined && + input.MaximumExecutionFrequency !== null && { MaximumExecutionFrequency: input.MaximumExecutionFrequency }), + ...(input.ResourceIdScope !== undefined && + input.ResourceIdScope !== null && { ResourceIdScope: input.ResourceIdScope }), + ...(input.ResourceTypesScope !== undefined && + input.ResourceTypesScope !== null && { + ResourceTypesScope: serializeAws_json1_1ResourceTypesScope(input.ResourceTypesScope, context), + }), + ...(input.RuleIdentifier !== undefined && + input.RuleIdentifier !== null && { RuleIdentifier: input.RuleIdentifier }), + ...(input.TagKeyScope !== undefined && input.TagKeyScope !== null && { TagKeyScope: input.TagKeyScope }), + ...(input.TagValueScope !== undefined && input.TagValueScope !== null && { TagValueScope: input.TagValueScope }), }; }; @@ -8986,8 +9112,8 @@ const serializeAws_json1_1OrganizationResourceDetailedStatusFilters = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -8996,16 +9122,19 @@ const serializeAws_json1_1PutAggregationAuthorizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AuthorizedAccountId !== undefined && { AuthorizedAccountId: input.AuthorizedAccountId }), - ...(input.AuthorizedAwsRegion !== undefined && { AuthorizedAwsRegion: input.AuthorizedAwsRegion }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsList(input.Tags, context) }), + ...(input.AuthorizedAccountId !== undefined && + input.AuthorizedAccountId !== null && { AuthorizedAccountId: input.AuthorizedAccountId }), + ...(input.AuthorizedAwsRegion !== undefined && + input.AuthorizedAwsRegion !== null && { AuthorizedAwsRegion: input.AuthorizedAwsRegion }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsList(input.Tags, context) }), }; }; const serializeAws_json1_1PutConfigRuleRequest = (input: PutConfigRuleRequest, context: __SerdeContext): any => { return { - ...(input.ConfigRule !== undefined && { ConfigRule: serializeAws_json1_1ConfigRule(input.ConfigRule, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsList(input.Tags, context) }), + ...(input.ConfigRule !== undefined && + input.ConfigRule !== null && { ConfigRule: serializeAws_json1_1ConfigRule(input.ConfigRule, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsList(input.Tags, context) }), }; }; @@ -9014,22 +9143,23 @@ const serializeAws_json1_1PutConfigurationAggregatorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountAggregationSources !== undefined && { - AccountAggregationSources: serializeAws_json1_1AccountAggregationSourceList( - input.AccountAggregationSources, - context - ), - }), - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.OrganizationAggregationSource !== undefined && { - OrganizationAggregationSource: serializeAws_json1_1OrganizationAggregationSource( - input.OrganizationAggregationSource, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsList(input.Tags, context) }), + ...(input.AccountAggregationSources !== undefined && + input.AccountAggregationSources !== null && { + AccountAggregationSources: serializeAws_json1_1AccountAggregationSourceList( + input.AccountAggregationSources, + context + ), + }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.OrganizationAggregationSource !== undefined && + input.OrganizationAggregationSource !== null && { + OrganizationAggregationSource: serializeAws_json1_1OrganizationAggregationSource( + input.OrganizationAggregationSource, + context + ), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsList(input.Tags, context) }), }; }; @@ -9038,9 +9168,10 @@ const serializeAws_json1_1PutConfigurationRecorderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationRecorder !== undefined && { - ConfigurationRecorder: serializeAws_json1_1ConfigurationRecorder(input.ConfigurationRecorder, context), - }), + ...(input.ConfigurationRecorder !== undefined && + input.ConfigurationRecorder !== null && { + ConfigurationRecorder: serializeAws_json1_1ConfigurationRecorder(input.ConfigurationRecorder, context), + }), }; }; @@ -9049,17 +9180,21 @@ const serializeAws_json1_1PutConformancePackRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConformancePackInputParameters !== undefined && { - ConformancePackInputParameters: serializeAws_json1_1ConformancePackInputParameters( - input.ConformancePackInputParameters, - context - ), - }), - ...(input.ConformancePackName !== undefined && { ConformancePackName: input.ConformancePackName }), - ...(input.DeliveryS3Bucket !== undefined && { DeliveryS3Bucket: input.DeliveryS3Bucket }), - ...(input.DeliveryS3KeyPrefix !== undefined && { DeliveryS3KeyPrefix: input.DeliveryS3KeyPrefix }), - ...(input.TemplateBody !== undefined && { TemplateBody: input.TemplateBody }), - ...(input.TemplateS3Uri !== undefined && { TemplateS3Uri: input.TemplateS3Uri }), + ...(input.ConformancePackInputParameters !== undefined && + input.ConformancePackInputParameters !== null && { + ConformancePackInputParameters: serializeAws_json1_1ConformancePackInputParameters( + input.ConformancePackInputParameters, + context + ), + }), + ...(input.ConformancePackName !== undefined && + input.ConformancePackName !== null && { ConformancePackName: input.ConformancePackName }), + ...(input.DeliveryS3Bucket !== undefined && + input.DeliveryS3Bucket !== null && { DeliveryS3Bucket: input.DeliveryS3Bucket }), + ...(input.DeliveryS3KeyPrefix !== undefined && + input.DeliveryS3KeyPrefix !== null && { DeliveryS3KeyPrefix: input.DeliveryS3KeyPrefix }), + ...(input.TemplateBody !== undefined && input.TemplateBody !== null && { TemplateBody: input.TemplateBody }), + ...(input.TemplateS3Uri !== undefined && input.TemplateS3Uri !== null && { TemplateS3Uri: input.TemplateS3Uri }), }; }; @@ -9068,19 +9203,19 @@ const serializeAws_json1_1PutDeliveryChannelRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryChannel !== undefined && { - DeliveryChannel: serializeAws_json1_1DeliveryChannel(input.DeliveryChannel, context), - }), + ...(input.DeliveryChannel !== undefined && + input.DeliveryChannel !== null && { + DeliveryChannel: serializeAws_json1_1DeliveryChannel(input.DeliveryChannel, context), + }), }; }; const serializeAws_json1_1PutEvaluationsRequest = (input: PutEvaluationsRequest, context: __SerdeContext): any => { return { - ...(input.Evaluations !== undefined && { - Evaluations: serializeAws_json1_1Evaluations(input.Evaluations, context), - }), - ...(input.ResultToken !== undefined && { ResultToken: input.ResultToken }), - ...(input.TestMode !== undefined && { TestMode: input.TestMode }), + ...(input.Evaluations !== undefined && + input.Evaluations !== null && { Evaluations: serializeAws_json1_1Evaluations(input.Evaluations, context) }), + ...(input.ResultToken !== undefined && input.ResultToken !== null && { ResultToken: input.ResultToken }), + ...(input.TestMode !== undefined && input.TestMode !== null && { TestMode: input.TestMode }), }; }; @@ -9089,24 +9224,26 @@ const serializeAws_json1_1PutOrganizationConfigRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ExcludedAccounts !== undefined && { - ExcludedAccounts: serializeAws_json1_1ExcludedAccounts(input.ExcludedAccounts, context), - }), - ...(input.OrganizationConfigRuleName !== undefined && { - OrganizationConfigRuleName: input.OrganizationConfigRuleName, - }), - ...(input.OrganizationCustomRuleMetadata !== undefined && { - OrganizationCustomRuleMetadata: serializeAws_json1_1OrganizationCustomRuleMetadata( - input.OrganizationCustomRuleMetadata, - context - ), - }), - ...(input.OrganizationManagedRuleMetadata !== undefined && { - OrganizationManagedRuleMetadata: serializeAws_json1_1OrganizationManagedRuleMetadata( - input.OrganizationManagedRuleMetadata, - context - ), - }), + ...(input.ExcludedAccounts !== undefined && + input.ExcludedAccounts !== null && { + ExcludedAccounts: serializeAws_json1_1ExcludedAccounts(input.ExcludedAccounts, context), + }), + ...(input.OrganizationConfigRuleName !== undefined && + input.OrganizationConfigRuleName !== null && { OrganizationConfigRuleName: input.OrganizationConfigRuleName }), + ...(input.OrganizationCustomRuleMetadata !== undefined && + input.OrganizationCustomRuleMetadata !== null && { + OrganizationCustomRuleMetadata: serializeAws_json1_1OrganizationCustomRuleMetadata( + input.OrganizationCustomRuleMetadata, + context + ), + }), + ...(input.OrganizationManagedRuleMetadata !== undefined && + input.OrganizationManagedRuleMetadata !== null && { + OrganizationManagedRuleMetadata: serializeAws_json1_1OrganizationManagedRuleMetadata( + input.OrganizationManagedRuleMetadata, + context + ), + }), }; }; @@ -9115,22 +9252,27 @@ const serializeAws_json1_1PutOrganizationConformancePackRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConformancePackInputParameters !== undefined && { - ConformancePackInputParameters: serializeAws_json1_1ConformancePackInputParameters( - input.ConformancePackInputParameters, - context - ), - }), - ...(input.DeliveryS3Bucket !== undefined && { DeliveryS3Bucket: input.DeliveryS3Bucket }), - ...(input.DeliveryS3KeyPrefix !== undefined && { DeliveryS3KeyPrefix: input.DeliveryS3KeyPrefix }), - ...(input.ExcludedAccounts !== undefined && { - ExcludedAccounts: serializeAws_json1_1ExcludedAccounts(input.ExcludedAccounts, context), - }), - ...(input.OrganizationConformancePackName !== undefined && { - OrganizationConformancePackName: input.OrganizationConformancePackName, - }), - ...(input.TemplateBody !== undefined && { TemplateBody: input.TemplateBody }), - ...(input.TemplateS3Uri !== undefined && { TemplateS3Uri: input.TemplateS3Uri }), + ...(input.ConformancePackInputParameters !== undefined && + input.ConformancePackInputParameters !== null && { + ConformancePackInputParameters: serializeAws_json1_1ConformancePackInputParameters( + input.ConformancePackInputParameters, + context + ), + }), + ...(input.DeliveryS3Bucket !== undefined && + input.DeliveryS3Bucket !== null && { DeliveryS3Bucket: input.DeliveryS3Bucket }), + ...(input.DeliveryS3KeyPrefix !== undefined && + input.DeliveryS3KeyPrefix !== null && { DeliveryS3KeyPrefix: input.DeliveryS3KeyPrefix }), + ...(input.ExcludedAccounts !== undefined && + input.ExcludedAccounts !== null && { + ExcludedAccounts: serializeAws_json1_1ExcludedAccounts(input.ExcludedAccounts, context), + }), + ...(input.OrganizationConformancePackName !== undefined && + input.OrganizationConformancePackName !== null && { + OrganizationConformancePackName: input.OrganizationConformancePackName, + }), + ...(input.TemplateBody !== undefined && input.TemplateBody !== null && { TemplateBody: input.TemplateBody }), + ...(input.TemplateS3Uri !== undefined && input.TemplateS3Uri !== null && { TemplateS3Uri: input.TemplateS3Uri }), }; }; @@ -9139,12 +9281,13 @@ const serializeAws_json1_1PutRemediationConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.RemediationConfigurations !== undefined && { - RemediationConfigurations: serializeAws_json1_1RemediationConfigurations( - input.RemediationConfigurations, - context - ), - }), + ...(input.RemediationConfigurations !== undefined && + input.RemediationConfigurations !== null && { + RemediationConfigurations: serializeAws_json1_1RemediationConfigurations( + input.RemediationConfigurations, + context + ), + }), }; }; @@ -9153,12 +9296,15 @@ const serializeAws_json1_1PutRemediationExceptionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.ExpirationTime !== undefined && { ExpirationTime: Math.round(input.ExpirationTime.getTime() / 1000) }), - ...(input.Message !== undefined && { Message: input.Message }), - ...(input.ResourceKeys !== undefined && { - ResourceKeys: serializeAws_json1_1RemediationExceptionResourceKeys(input.ResourceKeys, context), - }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.ExpirationTime !== undefined && + input.ExpirationTime !== null && { ExpirationTime: Math.round(input.ExpirationTime.getTime() / 1000) }), + ...(input.Message !== undefined && input.Message !== null && { Message: input.Message }), + ...(input.ResourceKeys !== undefined && + input.ResourceKeys !== null && { + ResourceKeys: serializeAws_json1_1RemediationExceptionResourceKeys(input.ResourceKeys, context), + }), }; }; @@ -9167,12 +9313,13 @@ const serializeAws_json1_1PutResourceConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.Configuration !== undefined && { Configuration: input.Configuration }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceName !== undefined && { ResourceName: input.ResourceName }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.SchemaVersionId !== undefined && { SchemaVersionId: input.SchemaVersionId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.Configuration !== undefined && input.Configuration !== null && { Configuration: input.Configuration }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { ResourceName: input.ResourceName }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.SchemaVersionId !== undefined && + input.SchemaVersionId !== null && { SchemaVersionId: input.SchemaVersionId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -9181,24 +9328,32 @@ const serializeAws_json1_1PutRetentionConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.RetentionPeriodInDays !== undefined && { RetentionPeriodInDays: input.RetentionPeriodInDays }), + ...(input.RetentionPeriodInDays !== undefined && + input.RetentionPeriodInDays !== null && { RetentionPeriodInDays: input.RetentionPeriodInDays }), }; }; const serializeAws_json1_1RecordingGroup = (input: RecordingGroup, context: __SerdeContext): any => { return { - ...(input.allSupported !== undefined && { allSupported: input.allSupported }), - ...(input.includeGlobalResourceTypes !== undefined && { - includeGlobalResourceTypes: input.includeGlobalResourceTypes, - }), - ...(input.resourceTypes !== undefined && { - resourceTypes: serializeAws_json1_1ResourceTypeList(input.resourceTypes, context), - }), + ...(input.allSupported !== undefined && input.allSupported !== null && { allSupported: input.allSupported }), + ...(input.includeGlobalResourceTypes !== undefined && + input.includeGlobalResourceTypes !== null && { includeGlobalResourceTypes: input.includeGlobalResourceTypes }), + ...(input.resourceTypes !== undefined && + input.resourceTypes !== null && { + resourceTypes: serializeAws_json1_1ResourceTypeList(input.resourceTypes, context), + }), }; }; const serializeAws_json1_1ReevaluateConfigRuleNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RemediationConfiguration = ( @@ -9206,22 +9361,28 @@ const serializeAws_json1_1RemediationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.Automatic !== undefined && { Automatic: input.Automatic }), - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.CreatedByService !== undefined && { CreatedByService: input.CreatedByService }), - ...(input.ExecutionControls !== undefined && { - ExecutionControls: serializeAws_json1_1ExecutionControls(input.ExecutionControls, context), - }), - ...(input.MaximumAutomaticAttempts !== undefined && { MaximumAutomaticAttempts: input.MaximumAutomaticAttempts }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1RemediationParameters(input.Parameters, context), - }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.RetryAttemptSeconds !== undefined && { RetryAttemptSeconds: input.RetryAttemptSeconds }), - ...(input.TargetId !== undefined && { TargetId: input.TargetId }), - ...(input.TargetType !== undefined && { TargetType: input.TargetType }), - ...(input.TargetVersion !== undefined && { TargetVersion: input.TargetVersion }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.Automatic !== undefined && input.Automatic !== null && { Automatic: input.Automatic }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.CreatedByService !== undefined && + input.CreatedByService !== null && { CreatedByService: input.CreatedByService }), + ...(input.ExecutionControls !== undefined && + input.ExecutionControls !== null && { + ExecutionControls: serializeAws_json1_1ExecutionControls(input.ExecutionControls, context), + }), + ...(input.MaximumAutomaticAttempts !== undefined && + input.MaximumAutomaticAttempts !== null && { MaximumAutomaticAttempts: input.MaximumAutomaticAttempts }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_1RemediationParameters(input.Parameters, context), + }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.RetryAttemptSeconds !== undefined && + input.RetryAttemptSeconds !== null && { RetryAttemptSeconds: input.RetryAttemptSeconds }), + ...(input.TargetId !== undefined && input.TargetId !== null && { TargetId: input.TargetId }), + ...(input.TargetType !== undefined && input.TargetType !== null && { TargetType: input.TargetType }), + ...(input.TargetVersion !== undefined && input.TargetVersion !== null && { TargetVersion: input.TargetVersion }), }; }; @@ -9229,7 +9390,14 @@ const serializeAws_json1_1RemediationConfigurations = ( input: RemediationConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1RemediationConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RemediationConfiguration(entry, context); + }); }; const serializeAws_json1_1RemediationExceptionResourceKey = ( @@ -9237,8 +9405,8 @@ const serializeAws_json1_1RemediationExceptionResourceKey = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; @@ -9246,7 +9414,14 @@ const serializeAws_json1_1RemediationExceptionResourceKeys = ( input: RemediationExceptionResourceKey[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1RemediationExceptionResourceKey(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RemediationExceptionResourceKey(entry, context); + }); }; const serializeAws_json1_1RemediationParameters = ( @@ -9254,10 +9429,15 @@ const serializeAws_json1_1RemediationParameters = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: RemediationParameterValue }, [key, value]: [string, any]) => ({ - ...acc, - [key]: serializeAws_json1_1RemediationParameterValue(value, context), - }), + (acc: { [key: string]: RemediationParameterValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_json1_1RemediationParameterValue(value, context), + }; + }, {} ); }; @@ -9267,29 +9447,29 @@ const serializeAws_json1_1RemediationParameterValue = ( context: __SerdeContext ): any => { return { - ...(input.ResourceValue !== undefined && { - ResourceValue: serializeAws_json1_1ResourceValue(input.ResourceValue, context), - }), - ...(input.StaticValue !== undefined && { - StaticValue: serializeAws_json1_1StaticValue(input.StaticValue, context), - }), + ...(input.ResourceValue !== undefined && + input.ResourceValue !== null && { + ResourceValue: serializeAws_json1_1ResourceValue(input.ResourceValue, context), + }), + ...(input.StaticValue !== undefined && + input.StaticValue !== null && { StaticValue: serializeAws_json1_1StaticValue(input.StaticValue, context) }), }; }; const serializeAws_json1_1ResourceCountFilters = (input: ResourceCountFilters, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.Region !== undefined && { Region: input.Region }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; const serializeAws_json1_1ResourceFilters = (input: ResourceFilters, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.Region !== undefined && { Region: input.Region }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceName !== undefined && { ResourceName: input.ResourceName }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { ResourceName: input.ResourceName }), }; }; @@ -9297,54 +9477,105 @@ const serializeAws_json1_1ResourceIdentifiersList = ( input: AggregateResourceIdentifier[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AggregateResourceIdentifier(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AggregateResourceIdentifier(entry, context); + }); }; const serializeAws_json1_1ResourceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ResourceKey = (input: ResourceKey, context: __SerdeContext): any => { return { - ...(input.resourceId !== undefined && { resourceId: input.resourceId }), - ...(input.resourceType !== undefined && { resourceType: input.resourceType }), + ...(input.resourceId !== undefined && input.resourceId !== null && { resourceId: input.resourceId }), + ...(input.resourceType !== undefined && input.resourceType !== null && { resourceType: input.resourceType }), }; }; const serializeAws_json1_1ResourceKeys = (input: ResourceKey[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ResourceKey(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ResourceKey(entry, context); + }); }; const serializeAws_json1_1ResourceTypeList = (input: (ResourceType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ResourceTypes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ResourceTypesScope = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ResourceValue = (input: ResourceValue, context: __SerdeContext): any => { return { - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1RetentionConfigurationNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Scope = (input: Scope, context: __SerdeContext): any => { return { - ...(input.ComplianceResourceId !== undefined && { ComplianceResourceId: input.ComplianceResourceId }), - ...(input.ComplianceResourceTypes !== undefined && { - ComplianceResourceTypes: serializeAws_json1_1ComplianceResourceTypes(input.ComplianceResourceTypes, context), - }), - ...(input.TagKey !== undefined && { TagKey: input.TagKey }), - ...(input.TagValue !== undefined && { TagValue: input.TagValue }), + ...(input.ComplianceResourceId !== undefined && + input.ComplianceResourceId !== null && { ComplianceResourceId: input.ComplianceResourceId }), + ...(input.ComplianceResourceTypes !== undefined && + input.ComplianceResourceTypes !== null && { + ComplianceResourceTypes: serializeAws_json1_1ComplianceResourceTypes(input.ComplianceResourceTypes, context), + }), + ...(input.TagKey !== undefined && input.TagKey !== null && { TagKey: input.TagKey }), + ...(input.TagValue !== undefined && input.TagValue !== null && { TagValue: input.TagValue }), }; }; @@ -9353,13 +9584,12 @@ const serializeAws_json1_1SelectAggregateResourceConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationAggregatorName !== undefined && { - ConfigurationAggregatorName: input.ConfigurationAggregatorName, - }), - ...(input.Expression !== undefined && { Expression: input.Expression }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ConfigurationAggregatorName !== undefined && + input.ConfigurationAggregatorName !== null && { ConfigurationAggregatorName: input.ConfigurationAggregatorName }), + ...(input.Expression !== undefined && input.Expression !== null && { Expression: input.Expression }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -9368,42 +9598,52 @@ const serializeAws_json1_1SelectResourceConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.Expression !== undefined && { Expression: input.Expression }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Expression !== undefined && input.Expression !== null && { Expression: input.Expression }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1Source = (input: Source, context: __SerdeContext): any => { return { - ...(input.Owner !== undefined && { Owner: input.Owner }), - ...(input.SourceDetails !== undefined && { - SourceDetails: serializeAws_json1_1SourceDetails(input.SourceDetails, context), - }), - ...(input.SourceIdentifier !== undefined && { SourceIdentifier: input.SourceIdentifier }), + ...(input.Owner !== undefined && input.Owner !== null && { Owner: input.Owner }), + ...(input.SourceDetails !== undefined && + input.SourceDetails !== null && { + SourceDetails: serializeAws_json1_1SourceDetails(input.SourceDetails, context), + }), + ...(input.SourceIdentifier !== undefined && + input.SourceIdentifier !== null && { SourceIdentifier: input.SourceIdentifier }), }; }; const serializeAws_json1_1SourceDetail = (input: SourceDetail, context: __SerdeContext): any => { return { - ...(input.EventSource !== undefined && { EventSource: input.EventSource }), - ...(input.MaximumExecutionFrequency !== undefined && { - MaximumExecutionFrequency: input.MaximumExecutionFrequency, - }), - ...(input.MessageType !== undefined && { MessageType: input.MessageType }), + ...(input.EventSource !== undefined && input.EventSource !== null && { EventSource: input.EventSource }), + ...(input.MaximumExecutionFrequency !== undefined && + input.MaximumExecutionFrequency !== null && { MaximumExecutionFrequency: input.MaximumExecutionFrequency }), + ...(input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType }), }; }; const serializeAws_json1_1SourceDetails = (input: SourceDetail[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SourceDetail(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SourceDetail(entry, context); + }); }; const serializeAws_json1_1SsmControls = (input: SsmControls, context: __SerdeContext): any => { return { - ...(input.ConcurrentExecutionRatePercentage !== undefined && { - ConcurrentExecutionRatePercentage: input.ConcurrentExecutionRatePercentage, - }), - ...(input.ErrorPercentage !== undefined && { ErrorPercentage: input.ErrorPercentage }), + ...(input.ConcurrentExecutionRatePercentage !== undefined && + input.ConcurrentExecutionRatePercentage !== null && { + ConcurrentExecutionRatePercentage: input.ConcurrentExecutionRatePercentage, + }), + ...(input.ErrorPercentage !== undefined && + input.ErrorPercentage !== null && { ErrorPercentage: input.ErrorPercentage }), }; }; @@ -9412,9 +9652,10 @@ const serializeAws_json1_1StartConfigRulesEvaluationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleNames !== undefined && { - ConfigRuleNames: serializeAws_json1_1ReevaluateConfigRuleNames(input.ConfigRuleNames, context), - }), + ...(input.ConfigRuleNames !== undefined && + input.ConfigRuleNames !== null && { + ConfigRuleNames: serializeAws_json1_1ReevaluateConfigRuleNames(input.ConfigRuleNames, context), + }), }; }; @@ -9423,9 +9664,8 @@ const serializeAws_json1_1StartConfigurationRecorderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationRecorderName !== undefined && { - ConfigurationRecorderName: input.ConfigurationRecorderName, - }), + ...(input.ConfigurationRecorderName !== undefined && + input.ConfigurationRecorderName !== null && { ConfigurationRecorderName: input.ConfigurationRecorderName }), }; }; @@ -9434,27 +9674,36 @@ const serializeAws_json1_1StartRemediationExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigRuleName !== undefined && { ConfigRuleName: input.ConfigRuleName }), - ...(input.ResourceKeys !== undefined && { - ResourceKeys: serializeAws_json1_1ResourceKeys(input.ResourceKeys, context), - }), + ...(input.ConfigRuleName !== undefined && + input.ConfigRuleName !== null && { ConfigRuleName: input.ConfigRuleName }), + ...(input.ResourceKeys !== undefined && + input.ResourceKeys !== null && { ResourceKeys: serializeAws_json1_1ResourceKeys(input.ResourceKeys, context) }), }; }; const serializeAws_json1_1StaticParameterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StaticValue = (input: StaticValue, context: __SerdeContext): any => { return { - ...(input.Values !== undefined && { Values: serializeAws_json1_1StaticParameterValues(input.Values, context) }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1StaticParameterValues(input.Values, context) }), }; }; const serializeAws_json1_1StatusDetailFilters = (input: StatusDetailFilters, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.MemberAccountRuleStatus !== undefined && { MemberAccountRuleStatus: input.MemberAccountRuleStatus }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.MemberAccountRuleStatus !== undefined && + input.MemberAccountRuleStatus !== null && { MemberAccountRuleStatus: input.MemberAccountRuleStatus }), }; }; @@ -9463,52 +9712,75 @@ const serializeAws_json1_1StopConfigurationRecorderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationRecorderName !== undefined && { - ConfigurationRecorderName: input.ConfigurationRecorderName, - }), + ...(input.ConfigurationRecorderName !== undefined && + input.ConfigurationRecorderName !== null && { ConfigurationRecorderName: input.ConfigurationRecorderName }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1TagsList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -9531,14 +9803,28 @@ const deserializeAws_json1_1AccountAggregationSource = ( }; const deserializeAws_json1_1AccountAggregationSourceAccountList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AccountAggregationSourceList = ( output: any, context: __SerdeContext ): AccountAggregationSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AccountAggregationSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccountAggregationSource(entry, context); + }); }; const deserializeAws_json1_1AggregateComplianceByConfigRule = ( @@ -9561,7 +9847,14 @@ const deserializeAws_json1_1AggregateComplianceByConfigRuleList = ( output: any, context: __SerdeContext ): AggregateComplianceByConfigRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AggregateComplianceByConfigRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AggregateComplianceByConfigRule(entry, context); + }); }; const deserializeAws_json1_1AggregateComplianceCount = ( @@ -9581,7 +9874,14 @@ const deserializeAws_json1_1AggregateComplianceCountList = ( output: any, context: __SerdeContext ): AggregateComplianceCount[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AggregateComplianceCount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AggregateComplianceCount(entry, context); + }); }; const deserializeAws_json1_1AggregatedSourceStatus = (output: any, context: __SerdeContext): AggregatedSourceStatus => { @@ -9606,7 +9906,14 @@ const deserializeAws_json1_1AggregatedSourceStatusList = ( output: any, context: __SerdeContext ): AggregatedSourceStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AggregatedSourceStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AggregatedSourceStatus(entry, context); + }); }; const deserializeAws_json1_1AggregateEvaluationResult = ( @@ -9638,7 +9945,14 @@ const deserializeAws_json1_1AggregateEvaluationResultList = ( output: any, context: __SerdeContext ): AggregateEvaluationResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AggregateEvaluationResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AggregateEvaluationResult(entry, context); + }); }; const deserializeAws_json1_1AggregateResourceIdentifier = ( @@ -9683,11 +9997,25 @@ const deserializeAws_json1_1AggregationAuthorizationList = ( output: any, context: __SerdeContext ): AggregationAuthorization[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AggregationAuthorization(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AggregationAuthorization(entry, context); + }); }; const deserializeAws_json1_1AggregatorRegionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1BaseConfigurationItem = (output: any, context: __SerdeContext): BaseConfigurationItem => { @@ -9730,7 +10058,14 @@ const deserializeAws_json1_1BaseConfigurationItems = ( output: any, context: __SerdeContext ): BaseConfigurationItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BaseConfigurationItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BaseConfigurationItem(entry, context); + }); }; const deserializeAws_json1_1BatchGetAggregateResourceConfigResponse = ( @@ -9791,7 +10126,14 @@ const deserializeAws_json1_1ComplianceByConfigRules = ( output: any, context: __SerdeContext ): ComplianceByConfigRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ComplianceByConfigRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ComplianceByConfigRule(entry, context); + }); }; const deserializeAws_json1_1ComplianceByResource = (output: any, context: __SerdeContext): ComplianceByResource => { @@ -9806,7 +10148,14 @@ const deserializeAws_json1_1ComplianceByResource = (output: any, context: __Serd }; const deserializeAws_json1_1ComplianceByResources = (output: any, context: __SerdeContext): ComplianceByResource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ComplianceByResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ComplianceByResource(entry, context); + }); }; const deserializeAws_json1_1ComplianceContributorCount = ( @@ -9820,14 +10169,28 @@ const deserializeAws_json1_1ComplianceContributorCount = ( }; const deserializeAws_json1_1ComplianceResourceTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ComplianceSummariesByResourceType = ( output: any, context: __SerdeContext ): ComplianceSummaryByResourceType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ComplianceSummaryByResourceType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ComplianceSummaryByResourceType(entry, context); + }); }; const deserializeAws_json1_1ComplianceSummary = (output: any, context: __SerdeContext): ComplianceSummary => { @@ -9962,11 +10325,25 @@ const deserializeAws_json1_1ConfigRuleEvaluationStatusList = ( output: any, context: __SerdeContext ): ConfigRuleEvaluationStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfigRuleEvaluationStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfigRuleEvaluationStatus(entry, context); + }); }; const deserializeAws_json1_1ConfigRules = (output: any, context: __SerdeContext): ConfigRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfigRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfigRule(entry, context); + }); }; const deserializeAws_json1_1ConfigSnapshotDeliveryProperties = ( @@ -10035,7 +10412,14 @@ const deserializeAws_json1_1ConfigurationAggregatorList = ( output: any, context: __SerdeContext ): ConfigurationAggregator[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfigurationAggregator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfigurationAggregator(entry, context); + }); }; const deserializeAws_json1_1ConfigurationItem = (output: any, context: __SerdeContext): ConfigurationItem => { @@ -10089,7 +10473,14 @@ const deserializeAws_json1_1ConfigurationItem = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ConfigurationItemList = (output: any, context: __SerdeContext): ConfigurationItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfigurationItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfigurationItem(entry, context); + }); }; const deserializeAws_json1_1ConfigurationRecorder = (output: any, context: __SerdeContext): ConfigurationRecorder => { @@ -10107,7 +10498,14 @@ const deserializeAws_json1_1ConfigurationRecorderList = ( output: any, context: __SerdeContext ): ConfigurationRecorder[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfigurationRecorder(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfigurationRecorder(entry, context); + }); }; const deserializeAws_json1_1ConfigurationRecorderStatus = ( @@ -10141,7 +10539,14 @@ const deserializeAws_json1_1ConfigurationRecorderStatusList = ( output: any, context: __SerdeContext ): ConfigurationRecorderStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfigurationRecorderStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfigurationRecorderStatus(entry, context); + }); }; const deserializeAws_json1_1ConformancePackComplianceSummary = ( @@ -10164,7 +10569,14 @@ const deserializeAws_json1_1ConformancePackComplianceSummaryList = ( output: any, context: __SerdeContext ): ConformancePackComplianceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConformancePackComplianceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConformancePackComplianceSummary(entry, context); + }); }; const deserializeAws_json1_1ConformancePackDetail = (output: any, context: __SerdeContext): ConformancePackDetail => { @@ -10203,7 +10615,14 @@ const deserializeAws_json1_1ConformancePackDetailList = ( output: any, context: __SerdeContext ): ConformancePackDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConformancePackDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConformancePackDetail(entry, context); + }); }; const deserializeAws_json1_1ConformancePackEvaluationResult = ( @@ -10245,7 +10664,14 @@ const deserializeAws_json1_1ConformancePackInputParameters = ( output: any, context: __SerdeContext ): ConformancePackInputParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConformancePackInputParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConformancePackInputParameter(entry, context); + }); }; const deserializeAws_json1_1ConformancePackRuleCompliance = ( @@ -10264,14 +10690,28 @@ const deserializeAws_json1_1ConformancePackRuleComplianceList = ( output: any, context: __SerdeContext ): ConformancePackRuleCompliance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConformancePackRuleCompliance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConformancePackRuleCompliance(entry, context); + }); }; const deserializeAws_json1_1ConformancePackRuleEvaluationResultsList = ( output: any, context: __SerdeContext ): ConformancePackEvaluationResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConformancePackEvaluationResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConformancePackEvaluationResult(entry, context); + }); }; const deserializeAws_json1_1ConformancePackStatusDetail = ( @@ -10315,7 +10755,14 @@ const deserializeAws_json1_1ConformancePackStatusDetailsList = ( output: any, context: __SerdeContext ): ConformancePackStatusDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConformancePackStatusDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConformancePackStatusDetail(entry, context); + }); }; const deserializeAws_json1_1ConformancePackTemplateValidationException = ( @@ -10377,7 +10824,14 @@ const deserializeAws_json1_1DeliveryChannel = (output: any, context: __SerdeCont }; const deserializeAws_json1_1DeliveryChannelList = (output: any, context: __SerdeContext): DeliveryChannel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeliveryChannel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeliveryChannel(entry, context); + }); }; const deserializeAws_json1_1DeliveryChannelStatus = (output: any, context: __SerdeContext): DeliveryChannelStatus => { @@ -10402,7 +10856,14 @@ const deserializeAws_json1_1DeliveryChannelStatusList = ( output: any, context: __SerdeContext ): DeliveryChannelStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeliveryChannelStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeliveryChannelStatus(entry, context); + }); }; const deserializeAws_json1_1DescribeAggregateComplianceByConfigRulesResponse = ( @@ -10720,7 +11181,14 @@ const deserializeAws_json1_1DiscoveredResourceIdentifierList = ( output: any, context: __SerdeContext ): AggregateResourceIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AggregateResourceIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AggregateResourceIdentifier(entry, context); + }); }; const deserializeAws_json1_1Evaluation = (output: any, context: __SerdeContext): Evaluation => { @@ -10793,15 +11261,36 @@ const deserializeAws_json1_1EvaluationResultQualifier = ( }; const deserializeAws_json1_1EvaluationResults = (output: any, context: __SerdeContext): EvaluationResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EvaluationResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EvaluationResult(entry, context); + }); }; const deserializeAws_json1_1Evaluations = (output: any, context: __SerdeContext): Evaluation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Evaluation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Evaluation(entry, context); + }); }; const deserializeAws_json1_1ExcludedAccounts = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ExecutionControls = (output: any, context: __SerdeContext): ExecutionControls => { @@ -10831,9 +11320,14 @@ const deserializeAws_json1_1FailedDeleteRemediationExceptionsBatches = ( output: any, context: __SerdeContext ): FailedDeleteRemediationExceptionsBatch[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1FailedDeleteRemediationExceptionsBatch(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedDeleteRemediationExceptionsBatch(entry, context); + }); }; const deserializeAws_json1_1FailedRemediationBatch = (output: any, context: __SerdeContext): FailedRemediationBatch => { @@ -10851,7 +11345,14 @@ const deserializeAws_json1_1FailedRemediationBatches = ( output: any, context: __SerdeContext ): FailedRemediationBatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedRemediationBatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedRemediationBatch(entry, context); + }); }; const deserializeAws_json1_1FailedRemediationExceptionBatch = ( @@ -10872,7 +11373,14 @@ const deserializeAws_json1_1FailedRemediationExceptionBatches = ( output: any, context: __SerdeContext ): FailedRemediationExceptionBatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedRemediationExceptionBatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedRemediationExceptionBatch(entry, context); + }); }; const deserializeAws_json1_1FieldInfo = (output: any, context: __SerdeContext): FieldInfo => { @@ -10882,7 +11390,14 @@ const deserializeAws_json1_1FieldInfo = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1FieldInfoList = (output: any, context: __SerdeContext): FieldInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FieldInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FieldInfo(entry, context); + }); }; const deserializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleResponse = ( @@ -11103,7 +11618,14 @@ const deserializeAws_json1_1GroupedResourceCountList = ( output: any, context: __SerdeContext ): GroupedResourceCount[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GroupedResourceCount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GroupedResourceCount(entry, context); + }); }; const deserializeAws_json1_1InsufficientDeliveryPolicyException = ( @@ -11577,14 +12099,28 @@ const deserializeAws_json1_1OrganizationConfigRuleDetailedStatus = ( output: any, context: __SerdeContext ): MemberAccountStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MemberAccountStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MemberAccountStatus(entry, context); + }); }; const deserializeAws_json1_1OrganizationConfigRules = ( output: any, context: __SerdeContext ): OrganizationConfigRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationConfigRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationConfigRule(entry, context); + }); }; const deserializeAws_json1_1OrganizationConfigRuleStatus = ( @@ -11613,14 +12149,28 @@ const deserializeAws_json1_1OrganizationConfigRuleStatuses = ( output: any, context: __SerdeContext ): OrganizationConfigRuleStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationConfigRuleStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationConfigRuleStatus(entry, context); + }); }; const deserializeAws_json1_1OrganizationConfigRuleTriggerTypes = ( output: any, context: __SerdeContext ): (OrganizationConfigRuleTriggerType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1OrganizationConformancePack = ( @@ -11681,16 +12231,28 @@ const deserializeAws_json1_1OrganizationConformancePackDetailedStatuses = ( output: any, context: __SerdeContext ): OrganizationConformancePackDetailedStatus[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1OrganizationConformancePackDetailedStatus(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationConformancePackDetailedStatus(entry, context); + }); }; const deserializeAws_json1_1OrganizationConformancePacks = ( output: any, context: __SerdeContext ): OrganizationConformancePack[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationConformancePack(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationConformancePack(entry, context); + }); }; const deserializeAws_json1_1OrganizationConformancePackStatus = ( @@ -11716,7 +12278,14 @@ const deserializeAws_json1_1OrganizationConformancePackStatuses = ( output: any, context: __SerdeContext ): OrganizationConformancePackStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationConformancePackStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationConformancePackStatus(entry, context); + }); }; const deserializeAws_json1_1OrganizationConformancePackTemplateValidationException = ( @@ -11815,7 +12384,14 @@ const deserializeAws_json1_1PendingAggregationRequestList = ( output: any, context: __SerdeContext ): PendingAggregationRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PendingAggregationRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PendingAggregationRequest(entry, context); + }); }; const deserializeAws_json1_1PutAggregationAuthorizationResponse = ( @@ -11947,7 +12523,14 @@ const deserializeAws_json1_1RecordingGroup = (output: any, context: __SerdeConte }; const deserializeAws_json1_1RelatedEventList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Relationship = (output: any, context: __SerdeContext): Relationship => { @@ -11961,7 +12544,14 @@ const deserializeAws_json1_1Relationship = (output: any, context: __SerdeContext }; const deserializeAws_json1_1RelationshipList = (output: any, context: __SerdeContext): Relationship[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Relationship(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Relationship(entry, context); + }); }; const deserializeAws_json1_1RemediationConfiguration = ( @@ -12003,7 +12593,14 @@ const deserializeAws_json1_1RemediationConfigurations = ( output: any, context: __SerdeContext ): RemediationConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RemediationConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RemediationConfiguration(entry, context); + }); }; const deserializeAws_json1_1RemediationException = (output: any, context: __SerdeContext): RemediationException => { @@ -12034,11 +12631,25 @@ const deserializeAws_json1_1RemediationExceptionResourceKeys = ( output: any, context: __SerdeContext ): RemediationExceptionResourceKey[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RemediationExceptionResourceKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RemediationExceptionResourceKey(entry, context); + }); }; const deserializeAws_json1_1RemediationExceptions = (output: any, context: __SerdeContext): RemediationException[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RemediationException(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RemediationException(entry, context); + }); }; const deserializeAws_json1_1RemediationExecutionStatus = ( @@ -12070,7 +12681,14 @@ const deserializeAws_json1_1RemediationExecutionStatuses = ( output: any, context: __SerdeContext ): RemediationExecutionStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RemediationExecutionStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RemediationExecutionStatus(entry, context); + }); }; const deserializeAws_json1_1RemediationExecutionStep = ( @@ -12096,7 +12714,14 @@ const deserializeAws_json1_1RemediationExecutionSteps = ( output: any, context: __SerdeContext ): RemediationExecutionStep[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RemediationExecutionStep(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RemediationExecutionStep(entry, context); + }); }; const deserializeAws_json1_1RemediationInProgressException = ( @@ -12113,10 +12738,15 @@ const deserializeAws_json1_1RemediationParameters = ( context: __SerdeContext ): { [key: string]: RemediationParameterValue } => { return Object.entries(output).reduce( - (acc: { [key: string]: RemediationParameterValue }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_1RemediationParameterValue(value, context), - }), + (acc: { [key: string]: RemediationParameterValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_1RemediationParameterValue(value, context), + }; + }, {} ); }; @@ -12145,7 +12775,14 @@ const deserializeAws_json1_1ResourceCount = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ResourceCounts = (output: any, context: __SerdeContext): ResourceCount[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceCount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceCount(entry, context); + }); }; const deserializeAws_json1_1ResourceIdentifier = (output: any, context: __SerdeContext): ResourceIdentifier => { @@ -12161,7 +12798,14 @@ const deserializeAws_json1_1ResourceIdentifier = (output: any, context: __SerdeC }; const deserializeAws_json1_1ResourceIdentifierList = (output: any, context: __SerdeContext): ResourceIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceIdentifier(entry, context); + }); }; const deserializeAws_json1_1ResourceInUseException = (output: any, context: __SerdeContext): ResourceInUseException => { @@ -12178,7 +12822,14 @@ const deserializeAws_json1_1ResourceKey = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ResourceKeys = (output: any, context: __SerdeContext): ResourceKey[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceKey(entry, context); + }); }; const deserializeAws_json1_1ResourceNotDiscoveredException = ( @@ -12200,11 +12851,25 @@ const deserializeAws_json1_1ResourceNotFoundException = ( }; const deserializeAws_json1_1ResourceTypeList = (output: any, context: __SerdeContext): (ResourceType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceTypesScope = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceValue = (output: any, context: __SerdeContext): ResourceValue => { @@ -12214,7 +12879,14 @@ const deserializeAws_json1_1ResourceValue = (output: any, context: __SerdeContex }; const deserializeAws_json1_1Results = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RetentionConfiguration = (output: any, context: __SerdeContext): RetentionConfiguration => { @@ -12231,7 +12903,14 @@ const deserializeAws_json1_1RetentionConfigurationList = ( output: any, context: __SerdeContext ): RetentionConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RetentionConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RetentionConfiguration(entry, context); + }); }; const deserializeAws_json1_1Scope = (output: any, context: __SerdeContext): Scope => { @@ -12307,7 +12986,14 @@ const deserializeAws_json1_1SourceDetail = (output: any, context: __SerdeContext }; const deserializeAws_json1_1SourceDetails = (output: any, context: __SerdeContext): SourceDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SourceDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SourceDetail(entry, context); + }); }; const deserializeAws_json1_1SsmControls = (output: any, context: __SerdeContext): SsmControls => { @@ -12343,7 +13029,14 @@ const deserializeAws_json1_1StartRemediationExecutionResponse = ( }; const deserializeAws_json1_1StaticParameterValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1StaticValue = (output: any, context: __SerdeContext): StaticValue => { @@ -12359,13 +13052,15 @@ const deserializeAws_json1_1SupplementaryConfiguration = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -12376,17 +13071,26 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1TooManyTagsException = (output: any, context: __SerdeContext): TooManyTagsException => { @@ -12399,7 +13103,14 @@ const deserializeAws_json1_1UnprocessedResourceIdentifierList = ( output: any, context: __SerdeContext ): AggregateResourceIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AggregateResourceIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AggregateResourceIdentifier(entry, context); + }); }; const deserializeAws_json1_1ValidationException = (output: any, context: __SerdeContext): ValidationException => { @@ -12458,3 +13169,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-connect-contact-lens/protocols/Aws_restJson1.ts b/clients/client-connect-contact-lens/protocols/Aws_restJson1.ts index 4218c5f1a95b..81874ac5b8be 100644 --- a/clients/client-connect-contact-lens/protocols/Aws_restJson1.ts +++ b/clients/client-connect-contact-lens/protocols/Aws_restJson1.ts @@ -30,15 +30,15 @@ export const serializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/realtime-contact-analysis/analysis-segments"; let body: any; body = JSON.stringify({ - ...(input.ContactId !== undefined && { ContactId: input.ContactId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ContactId !== undefined && input.ContactId !== null && { ContactId: input.ContactId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -269,24 +269,40 @@ const deserializeAws_restJson1IssueDetected = (output: any, context: __SerdeCont }; const deserializeAws_restJson1IssuesDetected = (output: any, context: __SerdeContext): IssueDetected[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IssueDetected(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IssueDetected(entry, context); + }); }; const deserializeAws_restJson1MatchedCategories = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1MatchedDetails = ( output: any, context: __SerdeContext ): { [key: string]: CategoryDetails } => { - return Object.entries(output).reduce( - (acc: { [key: string]: CategoryDetails }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: CategoryDetails }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1CategoryDetails(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1PointOfInterest = (output: any, context: __SerdeContext): PointOfInterest => { @@ -301,7 +317,14 @@ const deserializeAws_restJson1PointOfInterest = (output: any, context: __SerdeCo }; const deserializeAws_restJson1PointsOfInterest = (output: any, context: __SerdeContext): PointOfInterest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PointOfInterest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PointOfInterest(entry, context); + }); }; const deserializeAws_restJson1RealtimeContactAnalysisSegment = ( @@ -324,7 +347,14 @@ const deserializeAws_restJson1RealtimeContactAnalysisSegments = ( output: any, context: __SerdeContext ): RealtimeContactAnalysisSegment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RealtimeContactAnalysisSegment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RealtimeContactAnalysisSegment(entry, context); + }); }; const deserializeAws_restJson1Transcript = (output: any, context: __SerdeContext): Transcript => { @@ -369,6 +399,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-connect/protocols/Aws_restJson1.ts b/clients/client-connect/protocols/Aws_restJson1.ts index 30efa51287ee..80d3dcd76565 100644 --- a/clients/client-connect/protocols/Aws_restJson1.ts +++ b/clients/client-connect/protocols/Aws_restJson1.ts @@ -337,7 +337,7 @@ export const serializeAws_restJson1AssociateApprovedOriginCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance/{InstanceId}/approved-origin"; if (input.InstanceId !== undefined) { @@ -351,7 +351,7 @@ export const serializeAws_restJson1AssociateApprovedOriginCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Origin !== undefined && { Origin: input.Origin }), + ...(input.Origin !== undefined && input.Origin !== null && { Origin: input.Origin }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -370,7 +370,7 @@ export const serializeAws_restJson1AssociateInstanceStorageConfigCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance/{InstanceId}/storage-config"; if (input.InstanceId !== undefined) { @@ -384,10 +384,11 @@ export const serializeAws_restJson1AssociateInstanceStorageConfigCommand = async } let body: any; body = JSON.stringify({ - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.StorageConfig !== undefined && { - StorageConfig: serializeAws_restJson1InstanceStorageConfig(input.StorageConfig, context), - }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.StorageConfig !== undefined && + input.StorageConfig !== null && { + StorageConfig: serializeAws_restJson1InstanceStorageConfig(input.StorageConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -406,7 +407,7 @@ export const serializeAws_restJson1AssociateLambdaFunctionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance/{InstanceId}/lambda-function"; if (input.InstanceId !== undefined) { @@ -420,7 +421,7 @@ export const serializeAws_restJson1AssociateLambdaFunctionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.FunctionArn !== undefined && { FunctionArn: input.FunctionArn }), + ...(input.FunctionArn !== undefined && input.FunctionArn !== null && { FunctionArn: input.FunctionArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -439,7 +440,7 @@ export const serializeAws_restJson1AssociateLexBotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance/{InstanceId}/lex-bot"; if (input.InstanceId !== undefined) { @@ -453,7 +454,8 @@ export const serializeAws_restJson1AssociateLexBotCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.LexBot !== undefined && { LexBot: serializeAws_restJson1LexBot(input.LexBot, context) }), + ...(input.LexBot !== undefined && + input.LexBot !== null && { LexBot: serializeAws_restJson1LexBot(input.LexBot, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -472,7 +474,7 @@ export const serializeAws_restJson1AssociateRoutingProfileQueuesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/routing-profiles/{InstanceId}/{RoutingProfileId}/associate-queues"; if (input.InstanceId !== undefined) { @@ -495,9 +497,10 @@ export const serializeAws_restJson1AssociateRoutingProfileQueuesCommand = async } let body: any; body = JSON.stringify({ - ...(input.QueueConfigs !== undefined && { - QueueConfigs: serializeAws_restJson1RoutingProfileQueueConfigList(input.QueueConfigs, context), - }), + ...(input.QueueConfigs !== undefined && + input.QueueConfigs !== null && { + QueueConfigs: serializeAws_restJson1RoutingProfileQueueConfigList(input.QueueConfigs, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -516,7 +519,7 @@ export const serializeAws_restJson1AssociateSecurityKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance/{InstanceId}/security-key"; if (input.InstanceId !== undefined) { @@ -530,7 +533,7 @@ export const serializeAws_restJson1AssociateSecurityKeyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -549,7 +552,7 @@ export const serializeAws_restJson1CreateContactFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact-flows/{InstanceId}"; if (input.InstanceId !== undefined) { @@ -563,11 +566,11 @@ export const serializeAws_restJson1CreateContactFlowCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -586,17 +589,20 @@ export const serializeAws_restJson1CreateInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance"; let body: any; body = JSON.stringify({ - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.IdentityManagementType !== undefined && { IdentityManagementType: input.IdentityManagementType }), - ...(input.InboundCallsEnabled !== undefined && { InboundCallsEnabled: input.InboundCallsEnabled }), - ...(input.InstanceAlias !== undefined && { InstanceAlias: input.InstanceAlias }), - ...(input.OutboundCallsEnabled !== undefined && { OutboundCallsEnabled: input.OutboundCallsEnabled }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.IdentityManagementType !== undefined && + input.IdentityManagementType !== null && { IdentityManagementType: input.IdentityManagementType }), + ...(input.InboundCallsEnabled !== undefined && + input.InboundCallsEnabled !== null && { InboundCallsEnabled: input.InboundCallsEnabled }), + ...(input.InstanceAlias !== undefined && input.InstanceAlias !== null && { InstanceAlias: input.InstanceAlias }), + ...(input.OutboundCallsEnabled !== undefined && + input.OutboundCallsEnabled !== null && { OutboundCallsEnabled: input.OutboundCallsEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -615,7 +621,7 @@ export const serializeAws_restJson1CreateIntegrationAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance/{InstanceId}/integration-associations"; if (input.InstanceId !== undefined) { @@ -629,11 +635,15 @@ export const serializeAws_restJson1CreateIntegrationAssociationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.IntegrationArn !== undefined && { IntegrationArn: input.IntegrationArn }), - ...(input.IntegrationType !== undefined && { IntegrationType: input.IntegrationType }), - ...(input.SourceApplicationName !== undefined && { SourceApplicationName: input.SourceApplicationName }), - ...(input.SourceApplicationUrl !== undefined && { SourceApplicationUrl: input.SourceApplicationUrl }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), + ...(input.IntegrationArn !== undefined && + input.IntegrationArn !== null && { IntegrationArn: input.IntegrationArn }), + ...(input.IntegrationType !== undefined && + input.IntegrationType !== null && { IntegrationType: input.IntegrationType }), + ...(input.SourceApplicationName !== undefined && + input.SourceApplicationName !== null && { SourceApplicationName: input.SourceApplicationName }), + ...(input.SourceApplicationUrl !== undefined && + input.SourceApplicationUrl !== null && { SourceApplicationUrl: input.SourceApplicationUrl }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -652,7 +662,7 @@ export const serializeAws_restJson1CreateRoutingProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/routing-profiles/{InstanceId}"; if (input.InstanceId !== undefined) { @@ -666,16 +676,19 @@ export const serializeAws_restJson1CreateRoutingProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DefaultOutboundQueueId !== undefined && { DefaultOutboundQueueId: input.DefaultOutboundQueueId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.MediaConcurrencies !== undefined && { - MediaConcurrencies: serializeAws_restJson1MediaConcurrencies(input.MediaConcurrencies, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.QueueConfigs !== undefined && { - QueueConfigs: serializeAws_restJson1RoutingProfileQueueConfigList(input.QueueConfigs, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.DefaultOutboundQueueId !== undefined && + input.DefaultOutboundQueueId !== null && { DefaultOutboundQueueId: input.DefaultOutboundQueueId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.MediaConcurrencies !== undefined && + input.MediaConcurrencies !== null && { + MediaConcurrencies: serializeAws_restJson1MediaConcurrencies(input.MediaConcurrencies, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.QueueConfigs !== undefined && + input.QueueConfigs !== null && { + QueueConfigs: serializeAws_restJson1RoutingProfileQueueConfigList(input.QueueConfigs, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -694,7 +707,7 @@ export const serializeAws_restJson1CreateUseCaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}/use-cases"; if (input.InstanceId !== undefined) { @@ -717,7 +730,7 @@ export const serializeAws_restJson1CreateUseCaseCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.UseCaseType !== undefined && { UseCaseType: input.UseCaseType }), + ...(input.UseCaseType !== undefined && input.UseCaseType !== null && { UseCaseType: input.UseCaseType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -736,7 +749,7 @@ export const serializeAws_restJson1CreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/users/{InstanceId}"; if (input.InstanceId !== undefined) { @@ -750,21 +763,25 @@ export const serializeAws_restJson1CreateUserCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DirectoryUserId !== undefined && { DirectoryUserId: input.DirectoryUserId }), - ...(input.HierarchyGroupId !== undefined && { HierarchyGroupId: input.HierarchyGroupId }), - ...(input.IdentityInfo !== undefined && { - IdentityInfo: serializeAws_restJson1UserIdentityInfo(input.IdentityInfo, context), - }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.PhoneConfig !== undefined && { - PhoneConfig: serializeAws_restJson1UserPhoneConfig(input.PhoneConfig, context), - }), - ...(input.RoutingProfileId !== undefined && { RoutingProfileId: input.RoutingProfileId }), - ...(input.SecurityProfileIds !== undefined && { - SecurityProfileIds: serializeAws_restJson1SecurityProfileIds(input.SecurityProfileIds, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.DirectoryUserId !== undefined && + input.DirectoryUserId !== null && { DirectoryUserId: input.DirectoryUserId }), + ...(input.HierarchyGroupId !== undefined && + input.HierarchyGroupId !== null && { HierarchyGroupId: input.HierarchyGroupId }), + ...(input.IdentityInfo !== undefined && + input.IdentityInfo !== null && { + IdentityInfo: serializeAws_restJson1UserIdentityInfo(input.IdentityInfo, context), + }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.PhoneConfig !== undefined && + input.PhoneConfig !== null && { PhoneConfig: serializeAws_restJson1UserPhoneConfig(input.PhoneConfig, context) }), + ...(input.RoutingProfileId !== undefined && + input.RoutingProfileId !== null && { RoutingProfileId: input.RoutingProfileId }), + ...(input.SecurityProfileIds !== undefined && + input.SecurityProfileIds !== null && { + SecurityProfileIds: serializeAws_restJson1SecurityProfileIds(input.SecurityProfileIds, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -783,7 +800,7 @@ export const serializeAws_restJson1CreateUserHierarchyGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/user-hierarchy-groups/{InstanceId}"; if (input.InstanceId !== undefined) { @@ -797,8 +814,8 @@ export const serializeAws_restJson1CreateUserHierarchyGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParentGroupId !== undefined && { ParentGroupId: input.ParentGroupId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParentGroupId !== undefined && input.ParentGroupId !== null && { ParentGroupId: input.ParentGroupId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -816,9 +833,7 @@ export const serializeAws_restJson1DeleteInstanceCommand = async ( input: DeleteInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -846,9 +861,7 @@ export const serializeAws_restJson1DeleteIntegrationAssociationCommand = async ( input: DeleteIntegrationAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -885,9 +898,7 @@ export const serializeAws_restJson1DeleteUseCaseCommand = async ( input: DeleteUseCaseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}/use-cases/{UseCaseId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -933,9 +944,7 @@ export const serializeAws_restJson1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/users/{InstanceId}/{UserId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -972,9 +981,7 @@ export const serializeAws_restJson1DeleteUserHierarchyGroupCommand = async ( input: DeleteUserHierarchyGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/user-hierarchy-groups/{InstanceId}/{HierarchyGroupId}"; if (input.HierarchyGroupId !== undefined) { const labelValue: string = input.HierarchyGroupId; @@ -1011,9 +1018,7 @@ export const serializeAws_restJson1DescribeContactFlowCommand = async ( input: DescribeContactFlowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/contact-flows/{InstanceId}/{ContactFlowId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1050,9 +1055,7 @@ export const serializeAws_restJson1DescribeInstanceCommand = async ( input: DescribeInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1080,9 +1083,7 @@ export const serializeAws_restJson1DescribeInstanceAttributeCommand = async ( input: DescribeInstanceAttributeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/attribute/{AttributeType}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1119,9 +1120,7 @@ export const serializeAws_restJson1DescribeInstanceStorageConfigCommand = async input: DescribeInstanceStorageConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/storage-config/{AssociationId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1162,9 +1161,7 @@ export const serializeAws_restJson1DescribeRoutingProfileCommand = async ( input: DescribeRoutingProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/routing-profiles/{InstanceId}/{RoutingProfileId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1201,9 +1198,7 @@ export const serializeAws_restJson1DescribeUserCommand = async ( input: DescribeUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/users/{InstanceId}/{UserId}"; if (input.UserId !== undefined) { const labelValue: string = input.UserId; @@ -1240,9 +1235,7 @@ export const serializeAws_restJson1DescribeUserHierarchyGroupCommand = async ( input: DescribeUserHierarchyGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/user-hierarchy-groups/{InstanceId}/{HierarchyGroupId}"; if (input.HierarchyGroupId !== undefined) { const labelValue: string = input.HierarchyGroupId; @@ -1279,9 +1272,7 @@ export const serializeAws_restJson1DescribeUserHierarchyStructureCommand = async input: DescribeUserHierarchyStructureCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/user-hierarchy-structure/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1309,9 +1300,7 @@ export const serializeAws_restJson1DisassociateApprovedOriginCommand = async ( input: DisassociateApprovedOriginCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/approved-origin"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1343,9 +1332,7 @@ export const serializeAws_restJson1DisassociateInstanceStorageConfigCommand = as input: DisassociateInstanceStorageConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/storage-config/{AssociationId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1386,9 +1373,7 @@ export const serializeAws_restJson1DisassociateLambdaFunctionCommand = async ( input: DisassociateLambdaFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/lambda-function"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1420,9 +1405,7 @@ export const serializeAws_restJson1DisassociateLexBotCommand = async ( input: DisassociateLexBotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/lex-bot"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1456,7 +1439,7 @@ export const serializeAws_restJson1DisassociateRoutingProfileQueuesCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/routing-profiles/{InstanceId}/{RoutingProfileId}/disassociate-queues"; if (input.InstanceId !== undefined) { @@ -1479,9 +1462,10 @@ export const serializeAws_restJson1DisassociateRoutingProfileQueuesCommand = asy } let body: any; body = JSON.stringify({ - ...(input.QueueReferences !== undefined && { - QueueReferences: serializeAws_restJson1RoutingProfileQueueReferenceList(input.QueueReferences, context), - }), + ...(input.QueueReferences !== undefined && + input.QueueReferences !== null && { + QueueReferences: serializeAws_restJson1RoutingProfileQueueReferenceList(input.QueueReferences, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1499,9 +1483,7 @@ export const serializeAws_restJson1DisassociateSecurityKeyCommand = async ( input: DisassociateSecurityKeyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/security-key/{AssociationId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1538,9 +1520,7 @@ export const serializeAws_restJson1GetContactAttributesCommand = async ( input: GetContactAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/contact/attributes/{InstanceId}/{InitialContactId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1578,7 +1558,7 @@ export const serializeAws_restJson1GetCurrentMetricDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/metrics/current/{InstanceId}"; if (input.InstanceId !== undefined) { @@ -1592,13 +1572,16 @@ export const serializeAws_restJson1GetCurrentMetricDataCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CurrentMetrics !== undefined && { - CurrentMetrics: serializeAws_restJson1CurrentMetrics(input.CurrentMetrics, context), - }), - ...(input.Filters !== undefined && { Filters: serializeAws_restJson1Filters(input.Filters, context) }), - ...(input.Groupings !== undefined && { Groupings: serializeAws_restJson1Groupings(input.Groupings, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CurrentMetrics !== undefined && + input.CurrentMetrics !== null && { + CurrentMetrics: serializeAws_restJson1CurrentMetrics(input.CurrentMetrics, context), + }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1Filters(input.Filters, context) }), + ...(input.Groupings !== undefined && + input.Groupings !== null && { Groupings: serializeAws_restJson1Groupings(input.Groupings, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1616,9 +1599,7 @@ export const serializeAws_restJson1GetFederationTokenCommand = async ( input: GetFederationTokenCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/user/federate/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1647,7 +1628,7 @@ export const serializeAws_restJson1GetMetricDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/metrics/historical/{InstanceId}"; if (input.InstanceId !== undefined) { @@ -1661,15 +1642,20 @@ export const serializeAws_restJson1GetMetricDataCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.Filters !== undefined && { Filters: serializeAws_restJson1Filters(input.Filters, context) }), - ...(input.Groupings !== undefined && { Groupings: serializeAws_restJson1Groupings(input.Groupings, context) }), - ...(input.HistoricalMetrics !== undefined && { - HistoricalMetrics: serializeAws_restJson1HistoricalMetrics(input.HistoricalMetrics, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1Filters(input.Filters, context) }), + ...(input.Groupings !== undefined && + input.Groupings !== null && { Groupings: serializeAws_restJson1Groupings(input.Groupings, context) }), + ...(input.HistoricalMetrics !== undefined && + input.HistoricalMetrics !== null && { + HistoricalMetrics: serializeAws_restJson1HistoricalMetrics(input.HistoricalMetrics, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1687,9 +1673,7 @@ export const serializeAws_restJson1ListApprovedOriginsCommand = async ( input: ListApprovedOriginsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/approved-origins"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1722,9 +1706,7 @@ export const serializeAws_restJson1ListContactFlowsCommand = async ( input: ListContactFlowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/contact-flows-summary/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1760,9 +1742,7 @@ export const serializeAws_restJson1ListHoursOfOperationsCommand = async ( input: ListHoursOfOperationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/hours-of-operations-summary/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1795,9 +1775,7 @@ export const serializeAws_restJson1ListInstanceAttributesCommand = async ( input: ListInstanceAttributesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/attributes"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1830,9 +1808,7 @@ export const serializeAws_restJson1ListInstancesCommand = async ( input: ListInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -1856,9 +1832,7 @@ export const serializeAws_restJson1ListInstanceStorageConfigsCommand = async ( input: ListInstanceStorageConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/storage-configs"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1892,9 +1866,7 @@ export const serializeAws_restJson1ListIntegrationAssociationsCommand = async ( input: ListIntegrationAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/integration-associations"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1927,9 +1899,7 @@ export const serializeAws_restJson1ListLambdaFunctionsCommand = async ( input: ListLambdaFunctionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/lambda-functions"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1962,9 +1932,7 @@ export const serializeAws_restJson1ListLexBotsCommand = async ( input: ListLexBotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/lex-bots"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -1997,9 +1965,7 @@ export const serializeAws_restJson1ListPhoneNumbersCommand = async ( input: ListPhoneNumbersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/phone-numbers-summary/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2038,9 +2004,7 @@ export const serializeAws_restJson1ListPromptsCommand = async ( input: ListPromptsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prompts-summary/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2073,9 +2037,7 @@ export const serializeAws_restJson1ListQueuesCommand = async ( input: ListQueuesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/queues-summary/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2109,9 +2071,7 @@ export const serializeAws_restJson1ListRoutingProfileQueuesCommand = async ( input: ListRoutingProfileQueuesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/routing-profiles/{InstanceId}/{RoutingProfileId}/queues"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2153,9 +2113,7 @@ export const serializeAws_restJson1ListRoutingProfilesCommand = async ( input: ListRoutingProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/routing-profiles-summary/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2188,9 +2146,7 @@ export const serializeAws_restJson1ListSecurityKeysCommand = async ( input: ListSecurityKeysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/security-keys"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2223,9 +2179,7 @@ export const serializeAws_restJson1ListSecurityProfilesCommand = async ( input: ListSecurityProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/security-profiles-summary/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2258,9 +2212,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -2288,9 +2240,7 @@ export const serializeAws_restJson1ListUseCasesCommand = async ( input: ListUseCasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/instance/{InstanceId}/integration-associations/{IntegrationAssociationId}/use-cases"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2332,9 +2282,7 @@ export const serializeAws_restJson1ListUserHierarchyGroupsCommand = async ( input: ListUserHierarchyGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/user-hierarchy-groups-summary/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2367,9 +2315,7 @@ export const serializeAws_restJson1ListUsersCommand = async ( input: ListUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/users-summary/{InstanceId}"; if (input.InstanceId !== undefined) { const labelValue: string = input.InstanceId; @@ -2403,14 +2349,15 @@ export const serializeAws_restJson1ResumeContactRecordingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact/resume-recording"; let body: any; body = JSON.stringify({ - ...(input.ContactId !== undefined && { ContactId: input.ContactId }), - ...(input.InitialContactId !== undefined && { InitialContactId: input.InitialContactId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ContactId !== undefined && input.ContactId !== null && { ContactId: input.ContactId }), + ...(input.InitialContactId !== undefined && + input.InitialContactId !== null && { InitialContactId: input.InitialContactId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2429,21 +2376,24 @@ export const serializeAws_restJson1StartChatContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact/chat"; let body: any; body = JSON.stringify({ - ...(input.Attributes !== undefined && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.ContactFlowId !== undefined && { ContactFlowId: input.ContactFlowId }), - ...(input.InitialMessage !== undefined && { - InitialMessage: serializeAws_restJson1ChatMessage(input.InitialMessage, context), - }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.ParticipantDetails !== undefined && { - ParticipantDetails: serializeAws_restJson1ParticipantDetails(input.ParticipantDetails, context), - }), + ...(input.ContactFlowId !== undefined && input.ContactFlowId !== null && { ContactFlowId: input.ContactFlowId }), + ...(input.InitialMessage !== undefined && + input.InitialMessage !== null && { + InitialMessage: serializeAws_restJson1ChatMessage(input.InitialMessage, context), + }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.ParticipantDetails !== undefined && + input.ParticipantDetails !== null && { + ParticipantDetails: serializeAws_restJson1ParticipantDetails(input.ParticipantDetails, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2462,20 +2412,22 @@ export const serializeAws_restJson1StartContactRecordingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact/start-recording"; let body: any; body = JSON.stringify({ - ...(input.ContactId !== undefined && { ContactId: input.ContactId }), - ...(input.InitialContactId !== undefined && { InitialContactId: input.InitialContactId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.VoiceRecordingConfiguration !== undefined && { - VoiceRecordingConfiguration: serializeAws_restJson1VoiceRecordingConfiguration( - input.VoiceRecordingConfiguration, - context - ), - }), + ...(input.ContactId !== undefined && input.ContactId !== null && { ContactId: input.ContactId }), + ...(input.InitialContactId !== undefined && + input.InitialContactId !== null && { InitialContactId: input.InitialContactId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.VoiceRecordingConfiguration !== undefined && + input.VoiceRecordingConfiguration !== null && { + VoiceRecordingConfiguration: serializeAws_restJson1VoiceRecordingConfiguration( + input.VoiceRecordingConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2494,18 +2446,21 @@ export const serializeAws_restJson1StartOutboundVoiceContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact/outbound-voice"; let body: any; body = JSON.stringify({ - ...(input.Attributes !== undefined && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.ContactFlowId !== undefined && { ContactFlowId: input.ContactFlowId }), - ...(input.DestinationPhoneNumber !== undefined && { DestinationPhoneNumber: input.DestinationPhoneNumber }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.QueueId !== undefined && { QueueId: input.QueueId }), - ...(input.SourcePhoneNumber !== undefined && { SourcePhoneNumber: input.SourcePhoneNumber }), + ...(input.ContactFlowId !== undefined && input.ContactFlowId !== null && { ContactFlowId: input.ContactFlowId }), + ...(input.DestinationPhoneNumber !== undefined && + input.DestinationPhoneNumber !== null && { DestinationPhoneNumber: input.DestinationPhoneNumber }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.QueueId !== undefined && input.QueueId !== null && { QueueId: input.QueueId }), + ...(input.SourcePhoneNumber !== undefined && + input.SourcePhoneNumber !== null && { SourcePhoneNumber: input.SourcePhoneNumber }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2524,21 +2479,22 @@ export const serializeAws_restJson1StartTaskContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact/task"; let body: any; body = JSON.stringify({ - ...(input.Attributes !== undefined && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.ContactFlowId !== undefined && { ContactFlowId: input.ContactFlowId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PreviousContactId !== undefined && { PreviousContactId: input.PreviousContactId }), - ...(input.References !== undefined && { - References: serializeAws_restJson1ContactReferences(input.References, context), - }), + ...(input.ContactFlowId !== undefined && input.ContactFlowId !== null && { ContactFlowId: input.ContactFlowId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PreviousContactId !== undefined && + input.PreviousContactId !== null && { PreviousContactId: input.PreviousContactId }), + ...(input.References !== undefined && + input.References !== null && { References: serializeAws_restJson1ContactReferences(input.References, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2557,13 +2513,13 @@ export const serializeAws_restJson1StopContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact/stop"; let body: any; body = JSON.stringify({ - ...(input.ContactId !== undefined && { ContactId: input.ContactId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ContactId !== undefined && input.ContactId !== null && { ContactId: input.ContactId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2582,14 +2538,15 @@ export const serializeAws_restJson1StopContactRecordingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact/stop-recording"; let body: any; body = JSON.stringify({ - ...(input.ContactId !== undefined && { ContactId: input.ContactId }), - ...(input.InitialContactId !== undefined && { InitialContactId: input.InitialContactId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ContactId !== undefined && input.ContactId !== null && { ContactId: input.ContactId }), + ...(input.InitialContactId !== undefined && + input.InitialContactId !== null && { InitialContactId: input.InitialContactId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2608,14 +2565,15 @@ export const serializeAws_restJson1SuspendContactRecordingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact/suspend-recording"; let body: any; body = JSON.stringify({ - ...(input.ContactId !== undefined && { ContactId: input.ContactId }), - ...(input.InitialContactId !== undefined && { InitialContactId: input.InitialContactId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ContactId !== undefined && input.ContactId !== null && { ContactId: input.ContactId }), + ...(input.InitialContactId !== undefined && + input.InitialContactId !== null && { InitialContactId: input.InitialContactId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2634,7 +2592,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -2648,7 +2606,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2666,9 +2624,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -2701,14 +2657,16 @@ export const serializeAws_restJson1UpdateContactAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact/attributes"; let body: any; body = JSON.stringify({ - ...(input.Attributes !== undefined && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), - ...(input.InitialContactId !== undefined && { InitialContactId: input.InitialContactId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), + ...(input.InitialContactId !== undefined && + input.InitialContactId !== null && { InitialContactId: input.InitialContactId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2727,7 +2685,7 @@ export const serializeAws_restJson1UpdateContactFlowContentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact-flows/{InstanceId}/{ContactFlowId}/content"; if (input.InstanceId !== undefined) { @@ -2750,7 +2708,7 @@ export const serializeAws_restJson1UpdateContactFlowContentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Content !== undefined && { Content: input.Content }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2769,7 +2727,7 @@ export const serializeAws_restJson1UpdateContactFlowNameCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact-flows/{InstanceId}/{ContactFlowId}/name"; if (input.InstanceId !== undefined) { @@ -2792,8 +2750,8 @@ export const serializeAws_restJson1UpdateContactFlowNameCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2812,7 +2770,7 @@ export const serializeAws_restJson1UpdateInstanceAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance/{InstanceId}/attribute/{AttributeType}"; if (input.InstanceId !== undefined) { @@ -2835,7 +2793,7 @@ export const serializeAws_restJson1UpdateInstanceAttributeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2854,7 +2812,7 @@ export const serializeAws_restJson1UpdateInstanceStorageConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/instance/{InstanceId}/storage-config/{AssociationId}"; if (input.InstanceId !== undefined) { @@ -2880,9 +2838,10 @@ export const serializeAws_restJson1UpdateInstanceStorageConfigCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.StorageConfig !== undefined && { - StorageConfig: serializeAws_restJson1InstanceStorageConfig(input.StorageConfig, context), - }), + ...(input.StorageConfig !== undefined && + input.StorageConfig !== null && { + StorageConfig: serializeAws_restJson1InstanceStorageConfig(input.StorageConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2902,7 +2861,7 @@ export const serializeAws_restJson1UpdateRoutingProfileConcurrencyCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/routing-profiles/{InstanceId}/{RoutingProfileId}/concurrency"; if (input.InstanceId !== undefined) { @@ -2925,9 +2884,10 @@ export const serializeAws_restJson1UpdateRoutingProfileConcurrencyCommand = asyn } let body: any; body = JSON.stringify({ - ...(input.MediaConcurrencies !== undefined && { - MediaConcurrencies: serializeAws_restJson1MediaConcurrencies(input.MediaConcurrencies, context), - }), + ...(input.MediaConcurrencies !== undefined && + input.MediaConcurrencies !== null && { + MediaConcurrencies: serializeAws_restJson1MediaConcurrencies(input.MediaConcurrencies, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2946,7 +2906,7 @@ export const serializeAws_restJson1UpdateRoutingProfileDefaultOutboundQueueComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/routing-profiles/{InstanceId}/{RoutingProfileId}/default-outbound-queue"; if (input.InstanceId !== undefined) { @@ -2969,7 +2929,8 @@ export const serializeAws_restJson1UpdateRoutingProfileDefaultOutboundQueueComma } let body: any; body = JSON.stringify({ - ...(input.DefaultOutboundQueueId !== undefined && { DefaultOutboundQueueId: input.DefaultOutboundQueueId }), + ...(input.DefaultOutboundQueueId !== undefined && + input.DefaultOutboundQueueId !== null && { DefaultOutboundQueueId: input.DefaultOutboundQueueId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2988,7 +2949,7 @@ export const serializeAws_restJson1UpdateRoutingProfileNameCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/routing-profiles/{InstanceId}/{RoutingProfileId}/name"; if (input.InstanceId !== undefined) { @@ -3011,8 +2972,8 @@ export const serializeAws_restJson1UpdateRoutingProfileNameCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3031,7 +2992,7 @@ export const serializeAws_restJson1UpdateRoutingProfileQueuesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/routing-profiles/{InstanceId}/{RoutingProfileId}/queues"; if (input.InstanceId !== undefined) { @@ -3054,9 +3015,10 @@ export const serializeAws_restJson1UpdateRoutingProfileQueuesCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.QueueConfigs !== undefined && { - QueueConfigs: serializeAws_restJson1RoutingProfileQueueConfigList(input.QueueConfigs, context), - }), + ...(input.QueueConfigs !== undefined && + input.QueueConfigs !== null && { + QueueConfigs: serializeAws_restJson1RoutingProfileQueueConfigList(input.QueueConfigs, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3075,7 +3037,7 @@ export const serializeAws_restJson1UpdateUserHierarchyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/users/{InstanceId}/{UserId}/hierarchy"; if (input.UserId !== undefined) { @@ -3098,7 +3060,8 @@ export const serializeAws_restJson1UpdateUserHierarchyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.HierarchyGroupId !== undefined && { HierarchyGroupId: input.HierarchyGroupId }), + ...(input.HierarchyGroupId !== undefined && + input.HierarchyGroupId !== null && { HierarchyGroupId: input.HierarchyGroupId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3117,7 +3080,7 @@ export const serializeAws_restJson1UpdateUserHierarchyGroupNameCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/user-hierarchy-groups/{InstanceId}/{HierarchyGroupId}/name"; if (input.HierarchyGroupId !== undefined) { @@ -3140,7 +3103,7 @@ export const serializeAws_restJson1UpdateUserHierarchyGroupNameCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3159,7 +3122,7 @@ export const serializeAws_restJson1UpdateUserHierarchyStructureCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/user-hierarchy-structure/{InstanceId}"; if (input.InstanceId !== undefined) { @@ -3173,9 +3136,10 @@ export const serializeAws_restJson1UpdateUserHierarchyStructureCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.HierarchyStructure !== undefined && { - HierarchyStructure: serializeAws_restJson1HierarchyStructureUpdate(input.HierarchyStructure, context), - }), + ...(input.HierarchyStructure !== undefined && + input.HierarchyStructure !== null && { + HierarchyStructure: serializeAws_restJson1HierarchyStructureUpdate(input.HierarchyStructure, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3194,7 +3158,7 @@ export const serializeAws_restJson1UpdateUserIdentityInfoCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/users/{InstanceId}/{UserId}/identity-info"; if (input.UserId !== undefined) { @@ -3217,9 +3181,10 @@ export const serializeAws_restJson1UpdateUserIdentityInfoCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.IdentityInfo !== undefined && { - IdentityInfo: serializeAws_restJson1UserIdentityInfo(input.IdentityInfo, context), - }), + ...(input.IdentityInfo !== undefined && + input.IdentityInfo !== null && { + IdentityInfo: serializeAws_restJson1UserIdentityInfo(input.IdentityInfo, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3238,7 +3203,7 @@ export const serializeAws_restJson1UpdateUserPhoneConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/users/{InstanceId}/{UserId}/phone-config"; if (input.UserId !== undefined) { @@ -3261,9 +3226,8 @@ export const serializeAws_restJson1UpdateUserPhoneConfigCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.PhoneConfig !== undefined && { - PhoneConfig: serializeAws_restJson1UserPhoneConfig(input.PhoneConfig, context), - }), + ...(input.PhoneConfig !== undefined && + input.PhoneConfig !== null && { PhoneConfig: serializeAws_restJson1UserPhoneConfig(input.PhoneConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3282,7 +3246,7 @@ export const serializeAws_restJson1UpdateUserRoutingProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/users/{InstanceId}/{UserId}/routing-profile"; if (input.UserId !== undefined) { @@ -3305,7 +3269,8 @@ export const serializeAws_restJson1UpdateUserRoutingProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.RoutingProfileId !== undefined && { RoutingProfileId: input.RoutingProfileId }), + ...(input.RoutingProfileId !== undefined && + input.RoutingProfileId !== null && { RoutingProfileId: input.RoutingProfileId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3324,7 +3289,7 @@ export const serializeAws_restJson1UpdateUserSecurityProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/users/{InstanceId}/{UserId}/security-profiles"; if (input.UserId !== undefined) { @@ -3347,9 +3312,10 @@ export const serializeAws_restJson1UpdateUserSecurityProfilesCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.SecurityProfileIds !== undefined && { - SecurityProfileIds: serializeAws_restJson1SecurityProfileIds(input.SecurityProfileIds, context), - }), + ...(input.SecurityProfileIds !== undefined && + input.SecurityProfileIds !== null && { + SecurityProfileIds: serializeAws_restJson1SecurityProfileIds(input.SecurityProfileIds, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -10838,68 +10804,96 @@ const deserializeAws_restJson1UserNotFoundExceptionResponse = async ( }; const serializeAws_restJson1Attributes = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Channels = (input: (Channel | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ChatMessage = (input: ChatMessage, context: __SerdeContext): any => { return { - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), }; }; const serializeAws_restJson1ContactReferences = (input: { [key: string]: Reference }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Reference }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Reference }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1Reference(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1CurrentMetric = (input: CurrentMetric, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Unit !== undefined && { Unit: input.Unit }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), }; }; const serializeAws_restJson1CurrentMetrics = (input: CurrentMetric[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CurrentMetric(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CurrentMetric(entry, context); + }); }; const serializeAws_restJson1EncryptionConfig = (input: EncryptionConfig, context: __SerdeContext): any => { return { - ...(input.EncryptionType !== undefined && { EncryptionType: input.EncryptionType }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.EncryptionType !== undefined && + input.EncryptionType !== null && { EncryptionType: input.EncryptionType }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; const serializeAws_restJson1Filters = (input: Filters, context: __SerdeContext): any => { return { - ...(input.Channels !== undefined && { Channels: serializeAws_restJson1Channels(input.Channels, context) }), - ...(input.Queues !== undefined && { Queues: serializeAws_restJson1Queues(input.Queues, context) }), + ...(input.Channels !== undefined && + input.Channels !== null && { Channels: serializeAws_restJson1Channels(input.Channels, context) }), + ...(input.Queues !== undefined && + input.Queues !== null && { Queues: serializeAws_restJson1Queues(input.Queues, context) }), }; }; const serializeAws_restJson1Groupings = (input: (Grouping | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1HierarchyLevelUpdate = (input: HierarchyLevelUpdate, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -10908,63 +10902,75 @@ const serializeAws_restJson1HierarchyStructureUpdate = ( context: __SerdeContext ): any => { return { - ...(input.LevelFive !== undefined && { - LevelFive: serializeAws_restJson1HierarchyLevelUpdate(input.LevelFive, context), - }), - ...(input.LevelFour !== undefined && { - LevelFour: serializeAws_restJson1HierarchyLevelUpdate(input.LevelFour, context), - }), - ...(input.LevelOne !== undefined && { - LevelOne: serializeAws_restJson1HierarchyLevelUpdate(input.LevelOne, context), - }), - ...(input.LevelThree !== undefined && { - LevelThree: serializeAws_restJson1HierarchyLevelUpdate(input.LevelThree, context), - }), - ...(input.LevelTwo !== undefined && { - LevelTwo: serializeAws_restJson1HierarchyLevelUpdate(input.LevelTwo, context), - }), + ...(input.LevelFive !== undefined && + input.LevelFive !== null && { LevelFive: serializeAws_restJson1HierarchyLevelUpdate(input.LevelFive, context) }), + ...(input.LevelFour !== undefined && + input.LevelFour !== null && { LevelFour: serializeAws_restJson1HierarchyLevelUpdate(input.LevelFour, context) }), + ...(input.LevelOne !== undefined && + input.LevelOne !== null && { LevelOne: serializeAws_restJson1HierarchyLevelUpdate(input.LevelOne, context) }), + ...(input.LevelThree !== undefined && + input.LevelThree !== null && { + LevelThree: serializeAws_restJson1HierarchyLevelUpdate(input.LevelThree, context), + }), + ...(input.LevelTwo !== undefined && + input.LevelTwo !== null && { LevelTwo: serializeAws_restJson1HierarchyLevelUpdate(input.LevelTwo, context) }), }; }; const serializeAws_restJson1HistoricalMetric = (input: HistoricalMetric, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Statistic !== undefined && { Statistic: input.Statistic }), - ...(input.Threshold !== undefined && { Threshold: serializeAws_restJson1Threshold(input.Threshold, context) }), - ...(input.Unit !== undefined && { Unit: input.Unit }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Statistic !== undefined && input.Statistic !== null && { Statistic: input.Statistic }), + ...(input.Threshold !== undefined && + input.Threshold !== null && { Threshold: serializeAws_restJson1Threshold(input.Threshold, context) }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), }; }; const serializeAws_restJson1HistoricalMetrics = (input: HistoricalMetric[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1HistoricalMetric(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1HistoricalMetric(entry, context); + }); }; const serializeAws_restJson1InstanceStorageConfig = (input: InstanceStorageConfig, context: __SerdeContext): any => { return { - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.KinesisFirehoseConfig !== undefined && { - KinesisFirehoseConfig: serializeAws_restJson1KinesisFirehoseConfig(input.KinesisFirehoseConfig, context), - }), - ...(input.KinesisStreamConfig !== undefined && { - KinesisStreamConfig: serializeAws_restJson1KinesisStreamConfig(input.KinesisStreamConfig, context), - }), - ...(input.KinesisVideoStreamConfig !== undefined && { - KinesisVideoStreamConfig: serializeAws_restJson1KinesisVideoStreamConfig(input.KinesisVideoStreamConfig, context), - }), - ...(input.S3Config !== undefined && { S3Config: serializeAws_restJson1S3Config(input.S3Config, context) }), - ...(input.StorageType !== undefined && { StorageType: input.StorageType }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.KinesisFirehoseConfig !== undefined && + input.KinesisFirehoseConfig !== null && { + KinesisFirehoseConfig: serializeAws_restJson1KinesisFirehoseConfig(input.KinesisFirehoseConfig, context), + }), + ...(input.KinesisStreamConfig !== undefined && + input.KinesisStreamConfig !== null && { + KinesisStreamConfig: serializeAws_restJson1KinesisStreamConfig(input.KinesisStreamConfig, context), + }), + ...(input.KinesisVideoStreamConfig !== undefined && + input.KinesisVideoStreamConfig !== null && { + KinesisVideoStreamConfig: serializeAws_restJson1KinesisVideoStreamConfig( + input.KinesisVideoStreamConfig, + context + ), + }), + ...(input.S3Config !== undefined && + input.S3Config !== null && { S3Config: serializeAws_restJson1S3Config(input.S3Config, context) }), + ...(input.StorageType !== undefined && input.StorageType !== null && { StorageType: input.StorageType }), }; }; const serializeAws_restJson1KinesisFirehoseConfig = (input: KinesisFirehoseConfig, context: __SerdeContext): any => { return { - ...(input.FirehoseArn !== undefined && { FirehoseArn: input.FirehoseArn }), + ...(input.FirehoseArn !== undefined && input.FirehoseArn !== null && { FirehoseArn: input.FirehoseArn }), }; }; const serializeAws_restJson1KinesisStreamConfig = (input: KinesisStreamConfig, context: __SerdeContext): any => { return { - ...(input.StreamArn !== undefined && { StreamArn: input.StreamArn }), + ...(input.StreamArn !== undefined && input.StreamArn !== null && { StreamArn: input.StreamArn }), }; }; @@ -10973,46 +10979,62 @@ const serializeAws_restJson1KinesisVideoStreamConfig = ( context: __SerdeContext ): any => { return { - ...(input.EncryptionConfig !== undefined && { - EncryptionConfig: serializeAws_restJson1EncryptionConfig(input.EncryptionConfig, context), - }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.RetentionPeriodHours !== undefined && { RetentionPeriodHours: input.RetentionPeriodHours }), + ...(input.EncryptionConfig !== undefined && + input.EncryptionConfig !== null && { + EncryptionConfig: serializeAws_restJson1EncryptionConfig(input.EncryptionConfig, context), + }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.RetentionPeriodHours !== undefined && + input.RetentionPeriodHours !== null && { RetentionPeriodHours: input.RetentionPeriodHours }), }; }; const serializeAws_restJson1LexBot = (input: LexBot, context: __SerdeContext): any => { return { - ...(input.LexRegion !== undefined && { LexRegion: input.LexRegion }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.LexRegion !== undefined && input.LexRegion !== null && { LexRegion: input.LexRegion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_restJson1MediaConcurrencies = (input: MediaConcurrency[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1MediaConcurrency(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MediaConcurrency(entry, context); + }); }; const serializeAws_restJson1MediaConcurrency = (input: MediaConcurrency, context: __SerdeContext): any => { return { - ...(input.Channel !== undefined && { Channel: input.Channel }), - ...(input.Concurrency !== undefined && { Concurrency: input.Concurrency }), + ...(input.Channel !== undefined && input.Channel !== null && { Channel: input.Channel }), + ...(input.Concurrency !== undefined && input.Concurrency !== null && { Concurrency: input.Concurrency }), }; }; const serializeAws_restJson1ParticipantDetails = (input: ParticipantDetails, context: __SerdeContext): any => { return { - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), }; }; const serializeAws_restJson1Queues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Reference = (input: Reference, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -11021,11 +11043,12 @@ const serializeAws_restJson1RoutingProfileQueueConfig = ( context: __SerdeContext ): any => { return { - ...(input.Delay !== undefined && { Delay: input.Delay }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.QueueReference !== undefined && { - QueueReference: serializeAws_restJson1RoutingProfileQueueReference(input.QueueReference, context), - }), + ...(input.Delay !== undefined && input.Delay !== null && { Delay: input.Delay }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.QueueReference !== undefined && + input.QueueReference !== null && { + QueueReference: serializeAws_restJson1RoutingProfileQueueReference(input.QueueReference, context), + }), }; }; @@ -11033,7 +11056,14 @@ const serializeAws_restJson1RoutingProfileQueueConfigList = ( input: RoutingProfileQueueConfig[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1RoutingProfileQueueConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1RoutingProfileQueueConfig(entry, context); + }); }; const serializeAws_restJson1RoutingProfileQueueReference = ( @@ -11041,8 +11071,8 @@ const serializeAws_restJson1RoutingProfileQueueReference = ( context: __SerdeContext ): any => { return { - ...(input.Channel !== undefined && { Channel: input.Channel }), - ...(input.QueueId !== undefined && { QueueId: input.QueueId }), + ...(input.Channel !== undefined && input.Channel !== null && { Channel: input.Channel }), + ...(input.QueueId !== undefined && input.QueueId !== null && { QueueId: input.QueueId }), }; }; @@ -11050,56 +11080,74 @@ const serializeAws_restJson1RoutingProfileQueueReferenceList = ( input: RoutingProfileQueueReference[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1RoutingProfileQueueReference(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1RoutingProfileQueueReference(entry, context); + }); }; const serializeAws_restJson1S3Config = (input: S3Config, context: __SerdeContext): any => { return { - ...(input.BucketName !== undefined && { BucketName: input.BucketName }), - ...(input.BucketPrefix !== undefined && { BucketPrefix: input.BucketPrefix }), - ...(input.EncryptionConfig !== undefined && { - EncryptionConfig: serializeAws_restJson1EncryptionConfig(input.EncryptionConfig, context), - }), + ...(input.BucketName !== undefined && input.BucketName !== null && { BucketName: input.BucketName }), + ...(input.BucketPrefix !== undefined && input.BucketPrefix !== null && { BucketPrefix: input.BucketPrefix }), + ...(input.EncryptionConfig !== undefined && + input.EncryptionConfig !== null && { + EncryptionConfig: serializeAws_restJson1EncryptionConfig(input.EncryptionConfig, context), + }), }; }; const serializeAws_restJson1SecurityProfileIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Threshold = (input: Threshold, context: __SerdeContext): any => { return { - ...(input.Comparison !== undefined && { Comparison: input.Comparison }), - ...(input.ThresholdValue !== undefined && { ThresholdValue: input.ThresholdValue }), + ...(input.Comparison !== undefined && input.Comparison !== null && { Comparison: input.Comparison }), + ...(input.ThresholdValue !== undefined && + input.ThresholdValue !== null && { ThresholdValue: input.ThresholdValue }), }; }; const serializeAws_restJson1UserIdentityInfo = (input: UserIdentityInfo, context: __SerdeContext): any => { return { - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.FirstName !== undefined && { FirstName: input.FirstName }), - ...(input.LastName !== undefined && { LastName: input.LastName }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.FirstName !== undefined && input.FirstName !== null && { FirstName: input.FirstName }), + ...(input.LastName !== undefined && input.LastName !== null && { LastName: input.LastName }), }; }; const serializeAws_restJson1UserPhoneConfig = (input: UserPhoneConfig, context: __SerdeContext): any => { return { - ...(input.AfterContactWorkTimeLimit !== undefined && { - AfterContactWorkTimeLimit: input.AfterContactWorkTimeLimit, - }), - ...(input.AutoAccept !== undefined && { AutoAccept: input.AutoAccept }), - ...(input.DeskPhoneNumber !== undefined && { DeskPhoneNumber: input.DeskPhoneNumber }), - ...(input.PhoneType !== undefined && { PhoneType: input.PhoneType }), + ...(input.AfterContactWorkTimeLimit !== undefined && + input.AfterContactWorkTimeLimit !== null && { AfterContactWorkTimeLimit: input.AfterContactWorkTimeLimit }), + ...(input.AutoAccept !== undefined && input.AutoAccept !== null && { AutoAccept: input.AutoAccept }), + ...(input.DeskPhoneNumber !== undefined && + input.DeskPhoneNumber !== null && { DeskPhoneNumber: input.DeskPhoneNumber }), + ...(input.PhoneType !== undefined && input.PhoneType !== null && { PhoneType: input.PhoneType }), }; }; @@ -11108,7 +11156,8 @@ const serializeAws_restJson1VoiceRecordingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.VoiceRecordingTrack !== undefined && { VoiceRecordingTrack: input.VoiceRecordingTrack }), + ...(input.VoiceRecordingTrack !== undefined && + input.VoiceRecordingTrack !== null && { VoiceRecordingTrack: input.VoiceRecordingTrack }), }; }; @@ -11121,17 +11170,26 @@ const deserializeAws_restJson1Attribute = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1Attributes = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AttributesList = (output: any, context: __SerdeContext): Attribute[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Attribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Attribute(entry, context); + }); }; const deserializeAws_restJson1ContactFlow = (output: any, context: __SerdeContext): ContactFlow => { @@ -11160,7 +11218,14 @@ const deserializeAws_restJson1ContactFlowSummary = (output: any, context: __Serd }; const deserializeAws_restJson1ContactFlowSummaryList = (output: any, context: __SerdeContext): ContactFlowSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ContactFlowSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ContactFlowSummary(entry, context); + }); }; const deserializeAws_restJson1Credentials = (output: any, context: __SerdeContext): Credentials => { @@ -11199,7 +11264,14 @@ const deserializeAws_restJson1CurrentMetricDataCollections = ( output: any, context: __SerdeContext ): CurrentMetricData[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CurrentMetricData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CurrentMetricData(entry, context); + }); }; const deserializeAws_restJson1CurrentMetricResult = (output: any, context: __SerdeContext): CurrentMetricResult => { @@ -11216,7 +11288,14 @@ const deserializeAws_restJson1CurrentMetricResult = (output: any, context: __Ser }; const deserializeAws_restJson1CurrentMetricResults = (output: any, context: __SerdeContext): CurrentMetricResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CurrentMetricResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CurrentMetricResult(entry, context); + }); }; const deserializeAws_restJson1Dimensions = (output: any, context: __SerdeContext): Dimensions => { @@ -11238,7 +11317,14 @@ const deserializeAws_restJson1EncryptionConfig = (output: any, context: __SerdeC }; const deserializeAws_restJson1FunctionArnsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1HierarchyGroup = (output: any, context: __SerdeContext): HierarchyGroup => { @@ -11266,7 +11352,14 @@ const deserializeAws_restJson1HierarchyGroupSummaryList = ( output: any, context: __SerdeContext ): HierarchyGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HierarchyGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HierarchyGroupSummary(entry, context); + }); }; const deserializeAws_restJson1HierarchyLevel = (output: any, context: __SerdeContext): HierarchyLevel => { @@ -11353,7 +11446,14 @@ const deserializeAws_restJson1HistoricalMetricDataCollections = ( output: any, context: __SerdeContext ): HistoricalMetricData[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HistoricalMetricData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HistoricalMetricData(entry, context); + }); }; const deserializeAws_restJson1HistoricalMetricResult = ( @@ -11376,7 +11476,14 @@ const deserializeAws_restJson1HistoricalMetricResults = ( output: any, context: __SerdeContext ): HistoricalMetricResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HistoricalMetricResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HistoricalMetricResult(entry, context); + }); }; const deserializeAws_restJson1HoursOfOperationSummary = ( @@ -11394,7 +11501,14 @@ const deserializeAws_restJson1HoursOfOperationSummaryList = ( output: any, context: __SerdeContext ): HoursOfOperationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HoursOfOperationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HoursOfOperationSummary(entry, context); + }); }; const deserializeAws_restJson1Instance = (output: any, context: __SerdeContext): Instance => { @@ -11463,7 +11577,14 @@ const deserializeAws_restJson1InstanceStorageConfigs = ( output: any, context: __SerdeContext ): InstanceStorageConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InstanceStorageConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InstanceStorageConfig(entry, context); + }); }; const deserializeAws_restJson1InstanceSummary = (output: any, context: __SerdeContext): InstanceSummary => { @@ -11495,7 +11616,14 @@ const deserializeAws_restJson1InstanceSummary = (output: any, context: __SerdeCo }; const deserializeAws_restJson1InstanceSummaryList = (output: any, context: __SerdeContext): InstanceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InstanceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InstanceSummary(entry, context); + }); }; const deserializeAws_restJson1IntegrationAssociationSummary = ( @@ -11532,7 +11660,14 @@ const deserializeAws_restJson1IntegrationAssociationSummaryList = ( output: any, context: __SerdeContext ): IntegrationAssociationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IntegrationAssociationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IntegrationAssociationSummary(entry, context); + }); }; const deserializeAws_restJson1KinesisFirehoseConfig = (output: any, context: __SerdeContext): KinesisFirehoseConfig => { @@ -11572,11 +11707,25 @@ const deserializeAws_restJson1LexBot = (output: any, context: __SerdeContext): L }; const deserializeAws_restJson1LexBotsList = (output: any, context: __SerdeContext): LexBot[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LexBot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LexBot(entry, context); + }); }; const deserializeAws_restJson1MediaConcurrencies = (output: any, context: __SerdeContext): MediaConcurrency[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MediaConcurrency(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MediaConcurrency(entry, context); + }); }; const deserializeAws_restJson1MediaConcurrency = (output: any, context: __SerdeContext): MediaConcurrency => { @@ -11587,7 +11736,14 @@ const deserializeAws_restJson1MediaConcurrency = (output: any, context: __SerdeC }; const deserializeAws_restJson1OriginsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1PhoneNumberSummary = (output: any, context: __SerdeContext): PhoneNumberSummary => { @@ -11605,7 +11761,14 @@ const deserializeAws_restJson1PhoneNumberSummary = (output: any, context: __Serd }; const deserializeAws_restJson1PhoneNumberSummaryList = (output: any, context: __SerdeContext): PhoneNumberSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PhoneNumberSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PhoneNumberSummary(entry, context); + }); }; const deserializeAws_restJson1ProblemDetail = (output: any, context: __SerdeContext): ProblemDetail => { @@ -11615,7 +11778,14 @@ const deserializeAws_restJson1ProblemDetail = (output: any, context: __SerdeCont }; const deserializeAws_restJson1Problems = (output: any, context: __SerdeContext): ProblemDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProblemDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProblemDetail(entry, context); + }); }; const deserializeAws_restJson1PromptSummary = (output: any, context: __SerdeContext): PromptSummary => { @@ -11627,7 +11797,14 @@ const deserializeAws_restJson1PromptSummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1PromptSummaryList = (output: any, context: __SerdeContext): PromptSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PromptSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PromptSummary(entry, context); + }); }; const deserializeAws_restJson1QueueReference = (output: any, context: __SerdeContext): QueueReference => { @@ -11647,7 +11824,14 @@ const deserializeAws_restJson1QueueSummary = (output: any, context: __SerdeConte }; const deserializeAws_restJson1QueueSummaryList = (output: any, context: __SerdeContext): QueueSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1QueueSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1QueueSummary(entry, context); + }); }; const deserializeAws_restJson1RoutingProfile = (output: any, context: __SerdeContext): RoutingProfile => { @@ -11694,7 +11878,14 @@ const deserializeAws_restJson1RoutingProfileQueueConfigSummaryList = ( output: any, context: __SerdeContext ): RoutingProfileQueueConfigSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RoutingProfileQueueConfigSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RoutingProfileQueueConfigSummary(entry, context); + }); }; const deserializeAws_restJson1RoutingProfileSummary = (output: any, context: __SerdeContext): RoutingProfileSummary => { @@ -11709,7 +11900,14 @@ const deserializeAws_restJson1RoutingProfileSummaryList = ( output: any, context: __SerdeContext ): RoutingProfileSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RoutingProfileSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RoutingProfileSummary(entry, context); + }); }; const deserializeAws_restJson1S3Config = (output: any, context: __SerdeContext): S3Config => { @@ -11736,11 +11934,25 @@ const deserializeAws_restJson1SecurityKey = (output: any, context: __SerdeContex }; const deserializeAws_restJson1SecurityKeysList = (output: any, context: __SerdeContext): SecurityKey[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SecurityKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SecurityKey(entry, context); + }); }; const deserializeAws_restJson1SecurityProfileIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SecurityProfileSummary = ( @@ -11758,17 +11970,26 @@ const deserializeAws_restJson1SecurityProfileSummaryList = ( output: any, context: __SerdeContext ): SecurityProfileSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SecurityProfileSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SecurityProfileSummary(entry, context); + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Threshold = (output: any, context: __SerdeContext): Threshold => { @@ -11788,7 +12009,14 @@ const deserializeAws_restJson1UseCase = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1UseCaseSummaryList = (output: any, context: __SerdeContext): UseCase[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UseCase(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UseCase(entry, context); + }); }; const deserializeAws_restJson1User = (output: any, context: __SerdeContext): User => { @@ -11851,7 +12079,14 @@ const deserializeAws_restJson1UserSummary = (output: any, context: __SerdeContex }; const deserializeAws_restJson1UserSummaryList = (output: any, context: __SerdeContext): UserSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UserSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UserSummary(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -11874,6 +12109,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-connectparticipant/protocols/Aws_restJson1.ts b/clients/client-connectparticipant/protocols/Aws_restJson1.ts index 5e0ef8f11187..515ca42e9722 100644 --- a/clients/client-connectparticipant/protocols/Aws_restJson1.ts +++ b/clients/client-connectparticipant/protocols/Aws_restJson1.ts @@ -35,13 +35,14 @@ export const serializeAws_restJson1CreateParticipantConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ParticipantToken) && { "X-Amz-Bearer": input.ParticipantToken! }), }; let resolvedPath = "/participant/connection"; let body: any; body = JSON.stringify({ - ...(input.Type !== undefined && { Type: serializeAws_restJson1ConnectionTypeList(input.Type, context) }), + ...(input.Type !== undefined && + input.Type !== null && { Type: serializeAws_restJson1ConnectionTypeList(input.Type, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -60,7 +61,7 @@ export const serializeAws_restJson1DisconnectParticipantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ConnectionToken) && { "X-Amz-Bearer": input.ConnectionToken! }), }; let resolvedPath = "/participant/disconnect"; @@ -85,20 +86,21 @@ export const serializeAws_restJson1GetTranscriptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ConnectionToken) && { "X-Amz-Bearer": input.ConnectionToken! }), }; let resolvedPath = "/participant/transcript"; let body: any; body = JSON.stringify({ - ...(input.ContactId !== undefined && { ContactId: input.ContactId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ScanDirection !== undefined && { ScanDirection: input.ScanDirection }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StartPosition !== undefined && { - StartPosition: serializeAws_restJson1StartPosition(input.StartPosition, context), - }), + ...(input.ContactId !== undefined && input.ContactId !== null && { ContactId: input.ContactId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ScanDirection !== undefined && input.ScanDirection !== null && { ScanDirection: input.ScanDirection }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StartPosition !== undefined && + input.StartPosition !== null && { + StartPosition: serializeAws_restJson1StartPosition(input.StartPosition, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -117,15 +119,15 @@ export const serializeAws_restJson1SendEventCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ConnectionToken) && { "X-Amz-Bearer": input.ConnectionToken! }), }; let resolvedPath = "/participant/event"; let body: any; body = JSON.stringify({ ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -144,15 +146,15 @@ export const serializeAws_restJson1SendMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ConnectionToken) && { "X-Amz-Bearer": input.ConnectionToken! }), }; let resolvedPath = "/participant/message"; let body: any; body = JSON.stringify({ ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -646,14 +648,21 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1ConnectionTypeList = (input: (ConnectionType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1StartPosition = (input: StartPosition, context: __SerdeContext): any => { return { - ...(input.AbsoluteTime !== undefined && { AbsoluteTime: input.AbsoluteTime }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.MostRecent !== undefined && { MostRecent: input.MostRecent }), + ...(input.AbsoluteTime !== undefined && input.AbsoluteTime !== null && { AbsoluteTime: input.AbsoluteTime }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.MostRecent !== undefined && input.MostRecent !== null && { MostRecent: input.MostRecent }), }; }; @@ -681,7 +690,14 @@ const deserializeAws_restJson1Item = (output: any, context: __SerdeContext): Ite }; const deserializeAws_restJson1Transcript = (output: any, context: __SerdeContext): Item[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Item(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Item(entry, context); + }); }; const deserializeAws_restJson1Websocket = (output: any, context: __SerdeContext): Websocket => { @@ -712,6 +728,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-cost-and-usage-report-service/protocols/Aws_json1_1.ts b/clients/client-cost-and-usage-report-service/protocols/Aws_json1_1.ts index 483f9c939dac..ef1012865b76 100644 --- a/clients/client-cost-and-usage-report-service/protocols/Aws_json1_1.ts +++ b/clients/client-cost-and-usage-report-service/protocols/Aws_json1_1.ts @@ -46,7 +46,7 @@ export const serializeAws_json1_1DeleteReportDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrigamiServiceGatewayService.DeleteReportDefinition", }; let body: any; @@ -59,7 +59,7 @@ export const serializeAws_json1_1DescribeReportDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrigamiServiceGatewayService.DescribeReportDefinitions", }; let body: any; @@ -72,7 +72,7 @@ export const serializeAws_json1_1ModifyReportDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrigamiServiceGatewayService.ModifyReportDefinition", }; let body: any; @@ -85,7 +85,7 @@ export const serializeAws_json1_1PutReportDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrigamiServiceGatewayService.PutReportDefinition", }; let body: any; @@ -120,8 +120,7 @@ const deserializeAws_json1_1DeleteReportDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.costandusagereportservice#InternalErrorException": @@ -183,8 +182,7 @@ const deserializeAws_json1_1DescribeReportDefinitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.costandusagereportservice#InternalErrorException": @@ -238,8 +236,7 @@ const deserializeAws_json1_1ModifyReportDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.costandusagereportservice#InternalErrorException": @@ -301,8 +298,7 @@ const deserializeAws_json1_1PutReportDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateReportNameException": case "com.amazonaws.costandusagereportservice#DuplicateReportNameException": @@ -417,7 +413,14 @@ const serializeAws_json1_1AdditionalArtifactList = ( input: (AdditionalArtifact | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteReportDefinitionRequest = ( @@ -425,7 +428,7 @@ const serializeAws_json1_1DeleteReportDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ReportName !== undefined && { ReportName: input.ReportName }), + ...(input.ReportName !== undefined && input.ReportName !== null && { ReportName: input.ReportName }), }; }; @@ -434,8 +437,8 @@ const serializeAws_json1_1DescribeReportDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -444,10 +447,11 @@ const serializeAws_json1_1ModifyReportDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ReportDefinition !== undefined && { - ReportDefinition: serializeAws_json1_1ReportDefinition(input.ReportDefinition, context), - }), - ...(input.ReportName !== undefined && { ReportName: input.ReportName }), + ...(input.ReportDefinition !== undefined && + input.ReportDefinition !== null && { + ReportDefinition: serializeAws_json1_1ReportDefinition(input.ReportDefinition, context), + }), + ...(input.ReportName !== undefined && input.ReportName !== null && { ReportName: input.ReportName }), }; }; @@ -456,41 +460,60 @@ const serializeAws_json1_1PutReportDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ReportDefinition !== undefined && { - ReportDefinition: serializeAws_json1_1ReportDefinition(input.ReportDefinition, context), - }), + ...(input.ReportDefinition !== undefined && + input.ReportDefinition !== null && { + ReportDefinition: serializeAws_json1_1ReportDefinition(input.ReportDefinition, context), + }), }; }; const serializeAws_json1_1ReportDefinition = (input: ReportDefinition, context: __SerdeContext): any => { return { - ...(input.AdditionalArtifacts !== undefined && { - AdditionalArtifacts: serializeAws_json1_1AdditionalArtifactList(input.AdditionalArtifacts, context), - }), - ...(input.AdditionalSchemaElements !== undefined && { - AdditionalSchemaElements: serializeAws_json1_1SchemaElementList(input.AdditionalSchemaElements, context), - }), - ...(input.Compression !== undefined && { Compression: input.Compression }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.RefreshClosedReports !== undefined && { RefreshClosedReports: input.RefreshClosedReports }), - ...(input.ReportName !== undefined && { ReportName: input.ReportName }), - ...(input.ReportVersioning !== undefined && { ReportVersioning: input.ReportVersioning }), - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3Prefix !== undefined && { S3Prefix: input.S3Prefix }), - ...(input.S3Region !== undefined && { S3Region: input.S3Region }), - ...(input.TimeUnit !== undefined && { TimeUnit: input.TimeUnit }), + ...(input.AdditionalArtifacts !== undefined && + input.AdditionalArtifacts !== null && { + AdditionalArtifacts: serializeAws_json1_1AdditionalArtifactList(input.AdditionalArtifacts, context), + }), + ...(input.AdditionalSchemaElements !== undefined && + input.AdditionalSchemaElements !== null && { + AdditionalSchemaElements: serializeAws_json1_1SchemaElementList(input.AdditionalSchemaElements, context), + }), + ...(input.Compression !== undefined && input.Compression !== null && { Compression: input.Compression }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.RefreshClosedReports !== undefined && + input.RefreshClosedReports !== null && { RefreshClosedReports: input.RefreshClosedReports }), + ...(input.ReportName !== undefined && input.ReportName !== null && { ReportName: input.ReportName }), + ...(input.ReportVersioning !== undefined && + input.ReportVersioning !== null && { ReportVersioning: input.ReportVersioning }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3Prefix !== undefined && input.S3Prefix !== null && { S3Prefix: input.S3Prefix }), + ...(input.S3Region !== undefined && input.S3Region !== null && { S3Region: input.S3Region }), + ...(input.TimeUnit !== undefined && input.TimeUnit !== null && { TimeUnit: input.TimeUnit }), }; }; const serializeAws_json1_1SchemaElementList = (input: (SchemaElement | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AdditionalArtifactList = ( output: any, context: __SerdeContext ): (AdditionalArtifact | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeleteReportDefinitionResponse = ( @@ -572,7 +595,14 @@ const deserializeAws_json1_1ReportDefinition = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ReportDefinitionList = (output: any, context: __SerdeContext): ReportDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReportDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReportDefinition(entry, context); + }); }; const deserializeAws_json1_1ReportLimitReachedException = ( @@ -585,7 +615,14 @@ const deserializeAws_json1_1ReportLimitReachedException = ( }; const deserializeAws_json1_1SchemaElementList = (output: any, context: __SerdeContext): (SchemaElement | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ValidationException = (output: any, context: __SerdeContext): ValidationException => { @@ -644,3 +681,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-cost-explorer/protocols/Aws_json1_1.ts b/clients/client-cost-explorer/protocols/Aws_json1_1.ts index 03f8b6a0465c..8e983b7f998a 100644 --- a/clients/client-cost-explorer/protocols/Aws_json1_1.ts +++ b/clients/client-cost-explorer/protocols/Aws_json1_1.ts @@ -250,7 +250,7 @@ export const serializeAws_json1_1CreateAnomalyMonitorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.CreateAnomalyMonitor", }; let body: any; @@ -263,7 +263,7 @@ export const serializeAws_json1_1CreateAnomalySubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.CreateAnomalySubscription", }; let body: any; @@ -276,7 +276,7 @@ export const serializeAws_json1_1CreateCostCategoryDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.CreateCostCategoryDefinition", }; let body: any; @@ -289,7 +289,7 @@ export const serializeAws_json1_1DeleteAnomalyMonitorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.DeleteAnomalyMonitor", }; let body: any; @@ -302,7 +302,7 @@ export const serializeAws_json1_1DeleteAnomalySubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.DeleteAnomalySubscription", }; let body: any; @@ -315,7 +315,7 @@ export const serializeAws_json1_1DeleteCostCategoryDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.DeleteCostCategoryDefinition", }; let body: any; @@ -328,7 +328,7 @@ export const serializeAws_json1_1DescribeCostCategoryDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.DescribeCostCategoryDefinition", }; let body: any; @@ -341,7 +341,7 @@ export const serializeAws_json1_1GetAnomaliesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetAnomalies", }; let body: any; @@ -354,7 +354,7 @@ export const serializeAws_json1_1GetAnomalyMonitorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetAnomalyMonitors", }; let body: any; @@ -367,7 +367,7 @@ export const serializeAws_json1_1GetAnomalySubscriptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetAnomalySubscriptions", }; let body: any; @@ -380,7 +380,7 @@ export const serializeAws_json1_1GetCostAndUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetCostAndUsage", }; let body: any; @@ -393,7 +393,7 @@ export const serializeAws_json1_1GetCostAndUsageWithResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetCostAndUsageWithResources", }; let body: any; @@ -406,7 +406,7 @@ export const serializeAws_json1_1GetCostForecastCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetCostForecast", }; let body: any; @@ -419,7 +419,7 @@ export const serializeAws_json1_1GetDimensionValuesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetDimensionValues", }; let body: any; @@ -432,7 +432,7 @@ export const serializeAws_json1_1GetReservationCoverageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetReservationCoverage", }; let body: any; @@ -445,7 +445,7 @@ export const serializeAws_json1_1GetReservationPurchaseRecommendationCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetReservationPurchaseRecommendation", }; let body: any; @@ -458,7 +458,7 @@ export const serializeAws_json1_1GetReservationUtilizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetReservationUtilization", }; let body: any; @@ -471,7 +471,7 @@ export const serializeAws_json1_1GetRightsizingRecommendationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetRightsizingRecommendation", }; let body: any; @@ -484,7 +484,7 @@ export const serializeAws_json1_1GetSavingsPlansCoverageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetSavingsPlansCoverage", }; let body: any; @@ -497,7 +497,7 @@ export const serializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetSavingsPlansPurchaseRecommendation", }; let body: any; @@ -510,7 +510,7 @@ export const serializeAws_json1_1GetSavingsPlansUtilizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetSavingsPlansUtilization", }; let body: any; @@ -523,7 +523,7 @@ export const serializeAws_json1_1GetSavingsPlansUtilizationDetailsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetSavingsPlansUtilizationDetails", }; let body: any; @@ -536,7 +536,7 @@ export const serializeAws_json1_1GetTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetTags", }; let body: any; @@ -549,7 +549,7 @@ export const serializeAws_json1_1GetUsageForecastCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.GetUsageForecast", }; let body: any; @@ -562,7 +562,7 @@ export const serializeAws_json1_1ListCostCategoryDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.ListCostCategoryDefinitions", }; let body: any; @@ -575,7 +575,7 @@ export const serializeAws_json1_1ProvideAnomalyFeedbackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.ProvideAnomalyFeedback", }; let body: any; @@ -588,7 +588,7 @@ export const serializeAws_json1_1UpdateAnomalyMonitorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.UpdateAnomalyMonitor", }; let body: any; @@ -601,7 +601,7 @@ export const serializeAws_json1_1UpdateAnomalySubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.UpdateAnomalySubscription", }; let body: any; @@ -614,7 +614,7 @@ export const serializeAws_json1_1UpdateCostCategoryDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSInsightsIndexService.UpdateCostCategoryDefinition", }; let body: any; @@ -649,8 +649,7 @@ const deserializeAws_json1_1CreateAnomalyMonitorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -704,8 +703,7 @@ const deserializeAws_json1_1CreateAnomalySubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -767,8 +765,7 @@ const deserializeAws_json1_1CreateCostCategoryDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -830,8 +827,7 @@ const deserializeAws_json1_1DeleteAnomalyMonitorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -893,8 +889,7 @@ const deserializeAws_json1_1DeleteAnomalySubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -956,8 +951,7 @@ const deserializeAws_json1_1DeleteCostCategoryDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -1019,8 +1013,7 @@ const deserializeAws_json1_1DescribeCostCategoryDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -1082,8 +1075,7 @@ const deserializeAws_json1_1GetAnomaliesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.costexplorer#InvalidNextTokenException": @@ -1145,8 +1137,7 @@ const deserializeAws_json1_1GetAnomalyMonitorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.costexplorer#InvalidNextTokenException": @@ -1216,8 +1207,7 @@ const deserializeAws_json1_1GetAnomalySubscriptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.costexplorer#InvalidNextTokenException": @@ -1287,8 +1277,7 @@ const deserializeAws_json1_1GetCostAndUsageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BillExpirationException": case "com.amazonaws.costexplorer#BillExpirationException": @@ -1374,8 +1363,7 @@ const deserializeAws_json1_1GetCostAndUsageWithResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BillExpirationException": case "com.amazonaws.costexplorer#BillExpirationException": @@ -1461,8 +1449,7 @@ const deserializeAws_json1_1GetCostForecastCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DataUnavailableException": case "com.amazonaws.costexplorer#DataUnavailableException": @@ -1524,8 +1511,7 @@ const deserializeAws_json1_1GetDimensionValuesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BillExpirationException": case "com.amazonaws.costexplorer#BillExpirationException": @@ -1611,8 +1597,7 @@ const deserializeAws_json1_1GetReservationCoverageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DataUnavailableException": case "com.amazonaws.costexplorer#DataUnavailableException": @@ -1682,8 +1667,7 @@ const deserializeAws_json1_1GetReservationPurchaseRecommendationCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DataUnavailableException": case "com.amazonaws.costexplorer#DataUnavailableException": @@ -1753,8 +1737,7 @@ const deserializeAws_json1_1GetReservationUtilizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DataUnavailableException": case "com.amazonaws.costexplorer#DataUnavailableException": @@ -1824,8 +1807,7 @@ const deserializeAws_json1_1GetRightsizingRecommendationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.costexplorer#InvalidNextTokenException": @@ -1887,8 +1869,7 @@ const deserializeAws_json1_1GetSavingsPlansCoverageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DataUnavailableException": case "com.amazonaws.costexplorer#DataUnavailableException": @@ -1958,8 +1939,7 @@ const deserializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.costexplorer#InvalidNextTokenException": @@ -2021,8 +2001,7 @@ const deserializeAws_json1_1GetSavingsPlansUtilizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DataUnavailableException": case "com.amazonaws.costexplorer#DataUnavailableException": @@ -2084,8 +2063,7 @@ const deserializeAws_json1_1GetSavingsPlansUtilizationDetailsCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DataUnavailableException": case "com.amazonaws.costexplorer#DataUnavailableException": @@ -2155,8 +2133,7 @@ const deserializeAws_json1_1GetTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BillExpirationException": case "com.amazonaws.costexplorer#BillExpirationException": @@ -2242,8 +2219,7 @@ const deserializeAws_json1_1GetUsageForecastCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DataUnavailableException": case "com.amazonaws.costexplorer#DataUnavailableException": @@ -2313,8 +2289,7 @@ const deserializeAws_json1_1ListCostCategoryDefinitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -2368,8 +2343,7 @@ const deserializeAws_json1_1ProvideAnomalyFeedbackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -2423,8 +2397,7 @@ const deserializeAws_json1_1UpdateAnomalyMonitorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -2486,8 +2459,7 @@ const deserializeAws_json1_1UpdateAnomalySubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -2557,8 +2529,7 @@ const deserializeAws_json1_1UpdateCostCategoryDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": @@ -2753,61 +2724,74 @@ const deserializeAws_json1_1UnresolvableUsageUnitExceptionResponse = async ( const serializeAws_json1_1AnomalyDateInterval = (input: AnomalyDateInterval, context: __SerdeContext): any => { return { - ...(input.EndDate !== undefined && { EndDate: input.EndDate }), - ...(input.StartDate !== undefined && { StartDate: input.StartDate }), + ...(input.EndDate !== undefined && input.EndDate !== null && { EndDate: input.EndDate }), + ...(input.StartDate !== undefined && input.StartDate !== null && { StartDate: input.StartDate }), }; }; const serializeAws_json1_1AnomalyMonitor = (input: AnomalyMonitor, context: __SerdeContext): any => { return { - ...(input.CreationDate !== undefined && { CreationDate: input.CreationDate }), - ...(input.DimensionalValueCount !== undefined && { DimensionalValueCount: input.DimensionalValueCount }), - ...(input.LastEvaluatedDate !== undefined && { LastEvaluatedDate: input.LastEvaluatedDate }), - ...(input.LastUpdatedDate !== undefined && { LastUpdatedDate: input.LastUpdatedDate }), - ...(input.MonitorArn !== undefined && { MonitorArn: input.MonitorArn }), - ...(input.MonitorDimension !== undefined && { MonitorDimension: input.MonitorDimension }), - ...(input.MonitorName !== undefined && { MonitorName: input.MonitorName }), - ...(input.MonitorSpecification !== undefined && { - MonitorSpecification: serializeAws_json1_1Expression(input.MonitorSpecification, context), - }), - ...(input.MonitorType !== undefined && { MonitorType: input.MonitorType }), + ...(input.CreationDate !== undefined && input.CreationDate !== null && { CreationDate: input.CreationDate }), + ...(input.DimensionalValueCount !== undefined && + input.DimensionalValueCount !== null && { DimensionalValueCount: input.DimensionalValueCount }), + ...(input.LastEvaluatedDate !== undefined && + input.LastEvaluatedDate !== null && { LastEvaluatedDate: input.LastEvaluatedDate }), + ...(input.LastUpdatedDate !== undefined && + input.LastUpdatedDate !== null && { LastUpdatedDate: input.LastUpdatedDate }), + ...(input.MonitorArn !== undefined && input.MonitorArn !== null && { MonitorArn: input.MonitorArn }), + ...(input.MonitorDimension !== undefined && + input.MonitorDimension !== null && { MonitorDimension: input.MonitorDimension }), + ...(input.MonitorName !== undefined && input.MonitorName !== null && { MonitorName: input.MonitorName }), + ...(input.MonitorSpecification !== undefined && + input.MonitorSpecification !== null && { + MonitorSpecification: serializeAws_json1_1Expression(input.MonitorSpecification, context), + }), + ...(input.MonitorType !== undefined && input.MonitorType !== null && { MonitorType: input.MonitorType }), }; }; const serializeAws_json1_1AnomalySubscription = (input: AnomalySubscription, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.Frequency !== undefined && { Frequency: input.Frequency }), - ...(input.MonitorArnList !== undefined && { - MonitorArnList: serializeAws_json1_1Values(input.MonitorArnList, context), - }), - ...(input.Subscribers !== undefined && { - Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context), - }), - ...(input.SubscriptionArn !== undefined && { SubscriptionArn: input.SubscriptionArn }), - ...(input.SubscriptionName !== undefined && { SubscriptionName: input.SubscriptionName }), - ...(input.Threshold !== undefined && { Threshold: input.Threshold }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.Frequency !== undefined && input.Frequency !== null && { Frequency: input.Frequency }), + ...(input.MonitorArnList !== undefined && + input.MonitorArnList !== null && { MonitorArnList: serializeAws_json1_1Values(input.MonitorArnList, context) }), + ...(input.Subscribers !== undefined && + input.Subscribers !== null && { Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context) }), + ...(input.SubscriptionArn !== undefined && + input.SubscriptionArn !== null && { SubscriptionArn: input.SubscriptionArn }), + ...(input.SubscriptionName !== undefined && + input.SubscriptionName !== null && { SubscriptionName: input.SubscriptionName }), + ...(input.Threshold !== undefined && input.Threshold !== null && { Threshold: input.Threshold }), }; }; const serializeAws_json1_1CostCategoryRule = (input: CostCategoryRule, context: __SerdeContext): any => { return { - ...(input.Rule !== undefined && { Rule: serializeAws_json1_1Expression(input.Rule, context) }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Rule !== undefined && + input.Rule !== null && { Rule: serializeAws_json1_1Expression(input.Rule, context) }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1CostCategoryRulesList = (input: CostCategoryRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CostCategoryRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CostCategoryRule(entry, context); + }); }; const serializeAws_json1_1CostCategoryValues = (input: CostCategoryValues, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.MatchOptions !== undefined && { - MatchOptions: serializeAws_json1_1MatchOptions(input.MatchOptions, context), - }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1Values(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.MatchOptions !== undefined && + input.MatchOptions !== null && { MatchOptions: serializeAws_json1_1MatchOptions(input.MatchOptions, context) }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1Values(input.Values, context) }), }; }; @@ -2816,9 +2800,10 @@ const serializeAws_json1_1CreateAnomalyMonitorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnomalyMonitor !== undefined && { - AnomalyMonitor: serializeAws_json1_1AnomalyMonitor(input.AnomalyMonitor, context), - }), + ...(input.AnomalyMonitor !== undefined && + input.AnomalyMonitor !== null && { + AnomalyMonitor: serializeAws_json1_1AnomalyMonitor(input.AnomalyMonitor, context), + }), }; }; @@ -2827,9 +2812,10 @@ const serializeAws_json1_1CreateAnomalySubscriptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnomalySubscription !== undefined && { - AnomalySubscription: serializeAws_json1_1AnomalySubscription(input.AnomalySubscription, context), - }), + ...(input.AnomalySubscription !== undefined && + input.AnomalySubscription !== null && { + AnomalySubscription: serializeAws_json1_1AnomalySubscription(input.AnomalySubscription, context), + }), }; }; @@ -2838,16 +2824,17 @@ const serializeAws_json1_1CreateCostCategoryDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RuleVersion !== undefined && { RuleVersion: input.RuleVersion }), - ...(input.Rules !== undefined && { Rules: serializeAws_json1_1CostCategoryRulesList(input.Rules, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RuleVersion !== undefined && input.RuleVersion !== null && { RuleVersion: input.RuleVersion }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_json1_1CostCategoryRulesList(input.Rules, context) }), }; }; const serializeAws_json1_1DateInterval = (input: DateInterval, context: __SerdeContext): any => { return { - ...(input.End !== undefined && { End: input.End }), - ...(input.Start !== undefined && { Start: input.Start }), + ...(input.End !== undefined && input.End !== null && { End: input.End }), + ...(input.Start !== undefined && input.Start !== null && { Start: input.Start }), }; }; @@ -2856,7 +2843,7 @@ const serializeAws_json1_1DeleteAnomalyMonitorRequest = ( context: __SerdeContext ): any => { return { - ...(input.MonitorArn !== undefined && { MonitorArn: input.MonitorArn }), + ...(input.MonitorArn !== undefined && input.MonitorArn !== null && { MonitorArn: input.MonitorArn }), }; }; @@ -2865,7 +2852,8 @@ const serializeAws_json1_1DeleteAnomalySubscriptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.SubscriptionArn !== undefined && { SubscriptionArn: input.SubscriptionArn }), + ...(input.SubscriptionArn !== undefined && + input.SubscriptionArn !== null && { SubscriptionArn: input.SubscriptionArn }), }; }; @@ -2874,7 +2862,8 @@ const serializeAws_json1_1DeleteCostCategoryDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CostCategoryArn !== undefined && { CostCategoryArn: input.CostCategoryArn }), + ...(input.CostCategoryArn !== undefined && + input.CostCategoryArn !== null && { CostCategoryArn: input.CostCategoryArn }), }; }; @@ -2883,58 +2872,67 @@ const serializeAws_json1_1DescribeCostCategoryDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CostCategoryArn !== undefined && { CostCategoryArn: input.CostCategoryArn }), - ...(input.EffectiveOn !== undefined && { EffectiveOn: input.EffectiveOn }), + ...(input.CostCategoryArn !== undefined && + input.CostCategoryArn !== null && { CostCategoryArn: input.CostCategoryArn }), + ...(input.EffectiveOn !== undefined && input.EffectiveOn !== null && { EffectiveOn: input.EffectiveOn }), }; }; const serializeAws_json1_1DimensionValues = (input: DimensionValues, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.MatchOptions !== undefined && { - MatchOptions: serializeAws_json1_1MatchOptions(input.MatchOptions, context), - }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1Values(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.MatchOptions !== undefined && + input.MatchOptions !== null && { MatchOptions: serializeAws_json1_1MatchOptions(input.MatchOptions, context) }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1Values(input.Values, context) }), }; }; const serializeAws_json1_1EC2Specification = (input: EC2Specification, context: __SerdeContext): any => { return { - ...(input.OfferingClass !== undefined && { OfferingClass: input.OfferingClass }), + ...(input.OfferingClass !== undefined && input.OfferingClass !== null && { OfferingClass: input.OfferingClass }), }; }; const serializeAws_json1_1Expression = (input: Expression, context: __SerdeContext): any => { return { - ...(input.And !== undefined && { And: serializeAws_json1_1Expressions(input.And, context) }), - ...(input.CostCategories !== undefined && { - CostCategories: serializeAws_json1_1CostCategoryValues(input.CostCategories, context), - }), - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_json1_1DimensionValues(input.Dimensions, context), - }), - ...(input.Not !== undefined && { Not: serializeAws_json1_1Expression(input.Not, context) }), - ...(input.Or !== undefined && { Or: serializeAws_json1_1Expressions(input.Or, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagValues(input.Tags, context) }), + ...(input.And !== undefined && input.And !== null && { And: serializeAws_json1_1Expressions(input.And, context) }), + ...(input.CostCategories !== undefined && + input.CostCategories !== null && { + CostCategories: serializeAws_json1_1CostCategoryValues(input.CostCategories, context), + }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_json1_1DimensionValues(input.Dimensions, context) }), + ...(input.Not !== undefined && input.Not !== null && { Not: serializeAws_json1_1Expression(input.Not, context) }), + ...(input.Or !== undefined && input.Or !== null && { Or: serializeAws_json1_1Expressions(input.Or, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1TagValues(input.Tags, context) }), }; }; const serializeAws_json1_1Expressions = (input: Expression[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Expression(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Expression(entry, context); + }); }; const serializeAws_json1_1GetAnomaliesRequest = (input: GetAnomaliesRequest, context: __SerdeContext): any => { return { - ...(input.DateInterval !== undefined && { - DateInterval: serializeAws_json1_1AnomalyDateInterval(input.DateInterval, context), - }), - ...(input.Feedback !== undefined && { Feedback: input.Feedback }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MonitorArn !== undefined && { MonitorArn: input.MonitorArn }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.TotalImpact !== undefined && { - TotalImpact: serializeAws_json1_1TotalImpactFilter(input.TotalImpact, context), - }), + ...(input.DateInterval !== undefined && + input.DateInterval !== null && { + DateInterval: serializeAws_json1_1AnomalyDateInterval(input.DateInterval, context), + }), + ...(input.Feedback !== undefined && input.Feedback !== null && { Feedback: input.Feedback }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MonitorArn !== undefined && input.MonitorArn !== null && { MonitorArn: input.MonitorArn }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.TotalImpact !== undefined && + input.TotalImpact !== null && { TotalImpact: serializeAws_json1_1TotalImpactFilter(input.TotalImpact, context) }), }; }; @@ -2943,11 +2941,10 @@ const serializeAws_json1_1GetAnomalyMonitorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MonitorArnList !== undefined && { - MonitorArnList: serializeAws_json1_1Values(input.MonitorArnList, context), - }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MonitorArnList !== undefined && + input.MonitorArnList !== null && { MonitorArnList: serializeAws_json1_1Values(input.MonitorArnList, context) }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), }; }; @@ -2956,23 +2953,28 @@ const serializeAws_json1_1GetAnomalySubscriptionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MonitorArn !== undefined && { MonitorArn: input.MonitorArn }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.SubscriptionArnList !== undefined && { - SubscriptionArnList: serializeAws_json1_1Values(input.SubscriptionArnList, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MonitorArn !== undefined && input.MonitorArn !== null && { MonitorArn: input.MonitorArn }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.SubscriptionArnList !== undefined && + input.SubscriptionArnList !== null && { + SubscriptionArnList: serializeAws_json1_1Values(input.SubscriptionArnList, context), + }), }; }; const serializeAws_json1_1GetCostAndUsageRequest = (input: GetCostAndUsageRequest, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.Granularity !== undefined && { Granularity: input.Granularity }), - ...(input.GroupBy !== undefined && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_json1_1MetricNames(input.Metrics, context) }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.Granularity !== undefined && input.Granularity !== null && { Granularity: input.Granularity }), + ...(input.GroupBy !== undefined && + input.GroupBy !== null && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_json1_1MetricNames(input.Metrics, context) }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; @@ -2981,22 +2983,29 @@ const serializeAws_json1_1GetCostAndUsageWithResourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.Granularity !== undefined && { Granularity: input.Granularity }), - ...(input.GroupBy !== undefined && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_json1_1MetricNames(input.Metrics, context) }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.Granularity !== undefined && input.Granularity !== null && { Granularity: input.Granularity }), + ...(input.GroupBy !== undefined && + input.GroupBy !== null && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_json1_1MetricNames(input.Metrics, context) }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; const serializeAws_json1_1GetCostForecastRequest = (input: GetCostForecastRequest, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.Granularity !== undefined && { Granularity: input.Granularity }), - ...(input.Metric !== undefined && { Metric: input.Metric }), - ...(input.PredictionIntervalLevel !== undefined && { PredictionIntervalLevel: input.PredictionIntervalLevel }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.Granularity !== undefined && input.Granularity !== null && { Granularity: input.Granularity }), + ...(input.Metric !== undefined && input.Metric !== null && { Metric: input.Metric }), + ...(input.PredictionIntervalLevel !== undefined && + input.PredictionIntervalLevel !== null && { PredictionIntervalLevel: input.PredictionIntervalLevel }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; @@ -3005,11 +3014,12 @@ const serializeAws_json1_1GetDimensionValuesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Context !== undefined && { Context: input.Context }), - ...(input.Dimension !== undefined && { Dimension: input.Dimension }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.SearchString !== undefined && { SearchString: input.SearchString }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Context !== undefined && input.Context !== null && { Context: input.Context }), + ...(input.Dimension !== undefined && input.Dimension !== null && { Dimension: input.Dimension }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.SearchString !== undefined && input.SearchString !== null && { SearchString: input.SearchString }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; @@ -3018,12 +3028,16 @@ const serializeAws_json1_1GetReservationCoverageRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.Granularity !== undefined && { Granularity: input.Granularity }), - ...(input.GroupBy !== undefined && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_json1_1MetricNames(input.Metrics, context) }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.Granularity !== undefined && input.Granularity !== null && { Granularity: input.Granularity }), + ...(input.GroupBy !== undefined && + input.GroupBy !== null && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_json1_1MetricNames(input.Metrics, context) }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; @@ -3032,17 +3046,19 @@ const serializeAws_json1_1GetReservationPurchaseRecommendationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.AccountScope !== undefined && { AccountScope: input.AccountScope }), - ...(input.LookbackPeriodInDays !== undefined && { LookbackPeriodInDays: input.LookbackPeriodInDays }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PaymentOption !== undefined && { PaymentOption: input.PaymentOption }), - ...(input.Service !== undefined && { Service: input.Service }), - ...(input.ServiceSpecification !== undefined && { - ServiceSpecification: serializeAws_json1_1ServiceSpecification(input.ServiceSpecification, context), - }), - ...(input.TermInYears !== undefined && { TermInYears: input.TermInYears }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.AccountScope !== undefined && input.AccountScope !== null && { AccountScope: input.AccountScope }), + ...(input.LookbackPeriodInDays !== undefined && + input.LookbackPeriodInDays !== null && { LookbackPeriodInDays: input.LookbackPeriodInDays }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PaymentOption !== undefined && input.PaymentOption !== null && { PaymentOption: input.PaymentOption }), + ...(input.Service !== undefined && input.Service !== null && { Service: input.Service }), + ...(input.ServiceSpecification !== undefined && + input.ServiceSpecification !== null && { + ServiceSpecification: serializeAws_json1_1ServiceSpecification(input.ServiceSpecification, context), + }), + ...(input.TermInYears !== undefined && input.TermInYears !== null && { TermInYears: input.TermInYears }), }; }; @@ -3051,11 +3067,14 @@ const serializeAws_json1_1GetReservationUtilizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.Granularity !== undefined && { Granularity: input.Granularity }), - ...(input.GroupBy !== undefined && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.Granularity !== undefined && input.Granularity !== null && { Granularity: input.Granularity }), + ...(input.GroupBy !== undefined && + input.GroupBy !== null && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; @@ -3064,13 +3083,15 @@ const serializeAws_json1_1GetRightsizingRecommendationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Configuration !== undefined && { - Configuration: serializeAws_json1_1RightsizingRecommendationConfiguration(input.Configuration, context), - }), - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.Service !== undefined && { Service: input.Service }), + ...(input.Configuration !== undefined && + input.Configuration !== null && { + Configuration: serializeAws_json1_1RightsizingRecommendationConfiguration(input.Configuration, context), + }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.Service !== undefined && input.Service !== null && { Service: input.Service }), }; }; @@ -3079,13 +3100,17 @@ const serializeAws_json1_1GetSavingsPlansCoverageRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.Granularity !== undefined && { Granularity: input.Granularity }), - ...(input.GroupBy !== undefined && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_json1_1MetricNames(input.Metrics, context) }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.Granularity !== undefined && input.Granularity !== null && { Granularity: input.Granularity }), + ...(input.GroupBy !== undefined && + input.GroupBy !== null && { GroupBy: serializeAws_json1_1GroupDefinitions(input.GroupBy, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_json1_1MetricNames(input.Metrics, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; @@ -3094,14 +3119,17 @@ const serializeAws_json1_1GetSavingsPlansPurchaseRecommendationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountScope !== undefined && { AccountScope: input.AccountScope }), - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.LookbackPeriodInDays !== undefined && { LookbackPeriodInDays: input.LookbackPeriodInDays }), - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PaymentOption !== undefined && { PaymentOption: input.PaymentOption }), - ...(input.SavingsPlansType !== undefined && { SavingsPlansType: input.SavingsPlansType }), - ...(input.TermInYears !== undefined && { TermInYears: input.TermInYears }), + ...(input.AccountScope !== undefined && input.AccountScope !== null && { AccountScope: input.AccountScope }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.LookbackPeriodInDays !== undefined && + input.LookbackPeriodInDays !== null && { LookbackPeriodInDays: input.LookbackPeriodInDays }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PaymentOption !== undefined && input.PaymentOption !== null && { PaymentOption: input.PaymentOption }), + ...(input.SavingsPlansType !== undefined && + input.SavingsPlansType !== null && { SavingsPlansType: input.SavingsPlansType }), + ...(input.TermInYears !== undefined && input.TermInYears !== null && { TermInYears: input.TermInYears }), }; }; @@ -3110,10 +3138,12 @@ const serializeAws_json1_1GetSavingsPlansUtilizationDetailsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; @@ -3122,40 +3152,53 @@ const serializeAws_json1_1GetSavingsPlansUtilizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.Granularity !== undefined && { Granularity: input.Granularity }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.Granularity !== undefined && input.Granularity !== null && { Granularity: input.Granularity }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; const serializeAws_json1_1GetTagsRequest = (input: GetTagsRequest, context: __SerdeContext): any => { return { - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.SearchString !== undefined && { SearchString: input.SearchString }), - ...(input.TagKey !== undefined && { TagKey: input.TagKey }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.SearchString !== undefined && input.SearchString !== null && { SearchString: input.SearchString }), + ...(input.TagKey !== undefined && input.TagKey !== null && { TagKey: input.TagKey }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; const serializeAws_json1_1GetUsageForecastRequest = (input: GetUsageForecastRequest, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), - ...(input.Granularity !== undefined && { Granularity: input.Granularity }), - ...(input.Metric !== undefined && { Metric: input.Metric }), - ...(input.PredictionIntervalLevel !== undefined && { PredictionIntervalLevel: input.PredictionIntervalLevel }), - ...(input.TimePeriod !== undefined && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1Expression(input.Filter, context) }), + ...(input.Granularity !== undefined && input.Granularity !== null && { Granularity: input.Granularity }), + ...(input.Metric !== undefined && input.Metric !== null && { Metric: input.Metric }), + ...(input.PredictionIntervalLevel !== undefined && + input.PredictionIntervalLevel !== null && { PredictionIntervalLevel: input.PredictionIntervalLevel }), + ...(input.TimePeriod !== undefined && + input.TimePeriod !== null && { TimePeriod: serializeAws_json1_1DateInterval(input.TimePeriod, context) }), }; }; const serializeAws_json1_1GroupDefinition = (input: GroupDefinition, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1GroupDefinitions = (input: GroupDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1GroupDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1GroupDefinition(entry, context); + }); }; const serializeAws_json1_1ListCostCategoryDefinitionsRequest = ( @@ -3163,18 +3206,32 @@ const serializeAws_json1_1ListCostCategoryDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EffectiveOn !== undefined && { EffectiveOn: input.EffectiveOn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.EffectiveOn !== undefined && input.EffectiveOn !== null && { EffectiveOn: input.EffectiveOn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1MatchOptions = (input: (MatchOption | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MetricNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ProvideAnomalyFeedbackRequest = ( @@ -3182,8 +3239,8 @@ const serializeAws_json1_1ProvideAnomalyFeedbackRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnomalyId !== undefined && { AnomalyId: input.AnomalyId }), - ...(input.Feedback !== undefined && { Feedback: input.Feedback }), + ...(input.AnomalyId !== undefined && input.AnomalyId !== null && { AnomalyId: input.AnomalyId }), + ...(input.Feedback !== undefined && input.Feedback !== null && { Feedback: input.Feedback }), }; }; @@ -3192,46 +3249,57 @@ const serializeAws_json1_1RightsizingRecommendationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.BenefitsConsidered !== undefined && { BenefitsConsidered: input.BenefitsConsidered }), - ...(input.RecommendationTarget !== undefined && { RecommendationTarget: input.RecommendationTarget }), + ...(input.BenefitsConsidered !== undefined && + input.BenefitsConsidered !== null && { BenefitsConsidered: input.BenefitsConsidered }), + ...(input.RecommendationTarget !== undefined && + input.RecommendationTarget !== null && { RecommendationTarget: input.RecommendationTarget }), }; }; const serializeAws_json1_1ServiceSpecification = (input: ServiceSpecification, context: __SerdeContext): any => { return { - ...(input.EC2Specification !== undefined && { - EC2Specification: serializeAws_json1_1EC2Specification(input.EC2Specification, context), - }), + ...(input.EC2Specification !== undefined && + input.EC2Specification !== null && { + EC2Specification: serializeAws_json1_1EC2Specification(input.EC2Specification, context), + }), }; }; const serializeAws_json1_1Subscriber = (input: Subscriber, context: __SerdeContext): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1Subscribers = (input: Subscriber[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Subscriber(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Subscriber(entry, context); + }); }; const serializeAws_json1_1TagValues = (input: TagValues, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.MatchOptions !== undefined && { - MatchOptions: serializeAws_json1_1MatchOptions(input.MatchOptions, context), - }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1Values(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.MatchOptions !== undefined && + input.MatchOptions !== null && { MatchOptions: serializeAws_json1_1MatchOptions(input.MatchOptions, context) }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1Values(input.Values, context) }), }; }; const serializeAws_json1_1TotalImpactFilter = (input: TotalImpactFilter, context: __SerdeContext): any => { return { - ...(input.EndValue !== undefined && { EndValue: input.EndValue }), - ...(input.NumericOperator !== undefined && { NumericOperator: input.NumericOperator }), - ...(input.StartValue !== undefined && { StartValue: input.StartValue }), + ...(input.EndValue !== undefined && input.EndValue !== null && { EndValue: input.EndValue }), + ...(input.NumericOperator !== undefined && + input.NumericOperator !== null && { NumericOperator: input.NumericOperator }), + ...(input.StartValue !== undefined && input.StartValue !== null && { StartValue: input.StartValue }), }; }; @@ -3240,8 +3308,8 @@ const serializeAws_json1_1UpdateAnomalyMonitorRequest = ( context: __SerdeContext ): any => { return { - ...(input.MonitorArn !== undefined && { MonitorArn: input.MonitorArn }), - ...(input.MonitorName !== undefined && { MonitorName: input.MonitorName }), + ...(input.MonitorArn !== undefined && input.MonitorArn !== null && { MonitorArn: input.MonitorArn }), + ...(input.MonitorName !== undefined && input.MonitorName !== null && { MonitorName: input.MonitorName }), }; }; @@ -3250,16 +3318,16 @@ const serializeAws_json1_1UpdateAnomalySubscriptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.Frequency !== undefined && { Frequency: input.Frequency }), - ...(input.MonitorArnList !== undefined && { - MonitorArnList: serializeAws_json1_1Values(input.MonitorArnList, context), - }), - ...(input.Subscribers !== undefined && { - Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context), - }), - ...(input.SubscriptionArn !== undefined && { SubscriptionArn: input.SubscriptionArn }), - ...(input.SubscriptionName !== undefined && { SubscriptionName: input.SubscriptionName }), - ...(input.Threshold !== undefined && { Threshold: input.Threshold }), + ...(input.Frequency !== undefined && input.Frequency !== null && { Frequency: input.Frequency }), + ...(input.MonitorArnList !== undefined && + input.MonitorArnList !== null && { MonitorArnList: serializeAws_json1_1Values(input.MonitorArnList, context) }), + ...(input.Subscribers !== undefined && + input.Subscribers !== null && { Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context) }), + ...(input.SubscriptionArn !== undefined && + input.SubscriptionArn !== null && { SubscriptionArn: input.SubscriptionArn }), + ...(input.SubscriptionName !== undefined && + input.SubscriptionName !== null && { SubscriptionName: input.SubscriptionName }), + ...(input.Threshold !== undefined && input.Threshold !== null && { Threshold: input.Threshold }), }; }; @@ -3268,18 +3336,34 @@ const serializeAws_json1_1UpdateCostCategoryDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CostCategoryArn !== undefined && { CostCategoryArn: input.CostCategoryArn }), - ...(input.RuleVersion !== undefined && { RuleVersion: input.RuleVersion }), - ...(input.Rules !== undefined && { Rules: serializeAws_json1_1CostCategoryRulesList(input.Rules, context) }), + ...(input.CostCategoryArn !== undefined && + input.CostCategoryArn !== null && { CostCategoryArn: input.CostCategoryArn }), + ...(input.RuleVersion !== undefined && input.RuleVersion !== null && { RuleVersion: input.RuleVersion }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_json1_1CostCategoryRulesList(input.Rules, context) }), }; }; const serializeAws_json1_1Values = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Anomalies = (output: any, context: __SerdeContext): Anomaly[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Anomaly(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Anomaly(entry, context); + }); }; const deserializeAws_json1_1Anomaly = (output: any, context: __SerdeContext): Anomaly => { @@ -3334,7 +3418,14 @@ const deserializeAws_json1_1AnomalyMonitor = (output: any, context: __SerdeConte }; const deserializeAws_json1_1AnomalyMonitors = (output: any, context: __SerdeContext): AnomalyMonitor[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AnomalyMonitor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AnomalyMonitor(entry, context); + }); }; const deserializeAws_json1_1AnomalyScore = (output: any, context: __SerdeContext): AnomalyScore => { @@ -3365,17 +3456,26 @@ const deserializeAws_json1_1AnomalySubscription = (output: any, context: __Serde }; const deserializeAws_json1_1AnomalySubscriptions = (output: any, context: __SerdeContext): AnomalySubscription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AnomalySubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AnomalySubscription(entry, context); + }); }; const deserializeAws_json1_1Attributes = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1BillExpirationException = ( @@ -3421,7 +3521,14 @@ const deserializeAws_json1_1CostCategoryProcessingStatusList = ( output: any, context: __SerdeContext ): CostCategoryProcessingStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CostCategoryProcessingStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CostCategoryProcessingStatus(entry, context); + }); }; const deserializeAws_json1_1CostCategoryReference = (output: any, context: __SerdeContext): CostCategoryReference => { @@ -3449,7 +3556,14 @@ const deserializeAws_json1_1CostCategoryReferencesList = ( output: any, context: __SerdeContext ): CostCategoryReference[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CostCategoryReference(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CostCategoryReference(entry, context); + }); }; const deserializeAws_json1_1CostCategoryRule = (output: any, context: __SerdeContext): CostCategoryRule => { @@ -3463,7 +3577,14 @@ const deserializeAws_json1_1CostCategoryRule = (output: any, context: __SerdeCon }; const deserializeAws_json1_1CostCategoryRulesList = (output: any, context: __SerdeContext): CostCategoryRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CostCategoryRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CostCategoryRule(entry, context); + }); }; const deserializeAws_json1_1CostCategoryValues = (output: any, context: __SerdeContext): CostCategoryValues => { @@ -3481,7 +3602,14 @@ const deserializeAws_json1_1CostCategoryValues = (output: any, context: __SerdeC }; const deserializeAws_json1_1CostCategoryValuesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Coverage = (output: any, context: __SerdeContext): Coverage => { @@ -3566,7 +3694,14 @@ const deserializeAws_json1_1CoverageNormalizedUnits = ( }; const deserializeAws_json1_1CoveragesByTime = (output: any, context: __SerdeContext): CoverageByTime[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CoverageByTime(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CoverageByTime(entry, context); + }); }; const deserializeAws_json1_1CreateAnomalyMonitorResponse = ( @@ -3723,7 +3858,14 @@ const deserializeAws_json1_1DimensionValuesWithAttributesList = ( output: any, context: __SerdeContext ): DimensionValuesWithAttributes[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DimensionValuesWithAttributes(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DimensionValuesWithAttributes(entry, context); + }); }; const deserializeAws_json1_1EBSResourceUtilization = (output: any, context: __SerdeContext): EBSResourceUtilization => { @@ -3877,7 +4019,14 @@ const deserializeAws_json1_1Expression = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Expressions = (output: any, context: __SerdeContext): Expression[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Expression(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Expression(entry, context); + }); }; const deserializeAws_json1_1ForecastResult = (output: any, context: __SerdeContext): ForecastResult => { @@ -3899,7 +4048,14 @@ const deserializeAws_json1_1ForecastResult = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ForecastResultsByTime = (output: any, context: __SerdeContext): ForecastResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ForecastResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ForecastResult(entry, context); + }); }; const deserializeAws_json1_1GetAnomaliesResponse = (output: any, context: __SerdeContext): GetAnomaliesResponse => { @@ -4205,11 +4361,25 @@ const deserializeAws_json1_1GroupDefinition = (output: any, context: __SerdeCont }; const deserializeAws_json1_1GroupDefinitions = (output: any, context: __SerdeContext): GroupDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GroupDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GroupDefinition(entry, context); + }); }; const deserializeAws_json1_1Groups = (output: any, context: __SerdeContext): Group[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Group(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Group(entry, context); + }); }; const deserializeAws_json1_1Impact = (output: any, context: __SerdeContext): Impact => { @@ -4254,7 +4424,14 @@ const deserializeAws_json1_1InvalidNextTokenException = ( }; const deserializeAws_json1_1Keys = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -4277,17 +4454,26 @@ const deserializeAws_json1_1ListCostCategoryDefinitionsResponse = ( }; const deserializeAws_json1_1MatchOptions = (output: any, context: __SerdeContext): (MatchOption | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Metrics = (output: any, context: __SerdeContext): { [key: string]: MetricValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: MetricValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: MetricValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1MetricValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1MetricValue = (output: any, context: __SerdeContext): MetricValue => { @@ -4429,7 +4615,14 @@ const deserializeAws_json1_1ReservationCoverageGroups = ( output: any, context: __SerdeContext ): ReservationCoverageGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReservationCoverageGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReservationCoverageGroup(entry, context); + }); }; const deserializeAws_json1_1ReservationPurchaseRecommendation = ( @@ -4541,9 +4734,14 @@ const deserializeAws_json1_1ReservationPurchaseRecommendationDetails = ( output: any, context: __SerdeContext ): ReservationPurchaseRecommendationDetail[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1ReservationPurchaseRecommendationDetail(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReservationPurchaseRecommendationDetail(entry, context); + }); }; const deserializeAws_json1_1ReservationPurchaseRecommendationMetadata = ( @@ -4564,7 +4762,14 @@ const deserializeAws_json1_1ReservationPurchaseRecommendations = ( output: any, context: __SerdeContext ): ReservationPurchaseRecommendation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReservationPurchaseRecommendation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReservationPurchaseRecommendation(entry, context); + }); }; const deserializeAws_json1_1ReservationPurchaseRecommendationSummary = ( @@ -4607,7 +4812,14 @@ const deserializeAws_json1_1ReservationUtilizationGroups = ( output: any, context: __SerdeContext ): ReservationUtilizationGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReservationUtilizationGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReservationUtilizationGroup(entry, context); + }); }; const deserializeAws_json1_1ResourceDetails = (output: any, context: __SerdeContext): ResourceDetails => { @@ -4656,7 +4868,14 @@ const deserializeAws_json1_1ResultByTime = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ResultsByTime = (output: any, context: __SerdeContext): ResultByTime[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResultByTime(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResultByTime(entry, context); + }); }; const deserializeAws_json1_1RightsizingRecommendation = ( @@ -4702,7 +4921,14 @@ const deserializeAws_json1_1RightsizingRecommendationList = ( output: any, context: __SerdeContext ): RightsizingRecommendation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RightsizingRecommendation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RightsizingRecommendation(entry, context); + }); }; const deserializeAws_json1_1RightsizingRecommendationMetadata = ( @@ -4758,7 +4984,14 @@ const deserializeAws_json1_1RootCause = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1RootCauses = (output: any, context: __SerdeContext): RootCause[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RootCause(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RootCause(entry, context); + }); }; const deserializeAws_json1_1SavingsPlansAmortizedCommitment = ( @@ -4817,7 +5050,14 @@ const deserializeAws_json1_1SavingsPlansCoverageData = ( }; const deserializeAws_json1_1SavingsPlansCoverages = (output: any, context: __SerdeContext): SavingsPlansCoverage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SavingsPlansCoverage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SavingsPlansCoverage(entry, context); + }); }; const deserializeAws_json1_1SavingsPlansDetails = (output: any, context: __SerdeContext): SavingsPlansDetails => { @@ -4926,9 +5166,14 @@ const deserializeAws_json1_1SavingsPlansPurchaseRecommendationDetailList = ( output: any, context: __SerdeContext ): SavingsPlansPurchaseRecommendationDetail[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1SavingsPlansPurchaseRecommendationDetail(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SavingsPlansPurchaseRecommendationDetail(entry, context); + }); }; const deserializeAws_json1_1SavingsPlansPurchaseRecommendationMetadata = ( @@ -5098,14 +5343,28 @@ const deserializeAws_json1_1SavingsPlansUtilizationDetails = ( output: any, context: __SerdeContext ): SavingsPlansUtilizationDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SavingsPlansUtilizationDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SavingsPlansUtilizationDetail(entry, context); + }); }; const deserializeAws_json1_1SavingsPlansUtilizationsByTime = ( output: any, context: __SerdeContext ): SavingsPlansUtilizationByTime[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SavingsPlansUtilizationByTime(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SavingsPlansUtilizationByTime(entry, context); + }); }; const deserializeAws_json1_1ServiceQuotaExceededException = ( @@ -5135,11 +5394,25 @@ const deserializeAws_json1_1Subscriber = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Subscribers = (output: any, context: __SerdeContext): Subscriber[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Subscriber(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Subscriber(entry, context); + }); }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TagValues = (output: any, context: __SerdeContext): TagValues => { @@ -5157,7 +5430,14 @@ const deserializeAws_json1_1TagValues = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1TagValuesList = (output: any, context: __SerdeContext): TagValues[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TagValues(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TagValues(entry, context); + }); }; const deserializeAws_json1_1TargetInstance = (output: any, context: __SerdeContext): TargetInstance => { @@ -5187,7 +5467,14 @@ const deserializeAws_json1_1TargetInstance = (output: any, context: __SerdeConte }; const deserializeAws_json1_1TargetInstancesList = (output: any, context: __SerdeContext): TargetInstance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TargetInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TargetInstance(entry, context); + }); }; const deserializeAws_json1_1TerminateRecommendationDetail = ( @@ -5279,11 +5566,25 @@ const deserializeAws_json1_1UtilizationByTime = (output: any, context: __SerdeCo }; const deserializeAws_json1_1UtilizationsByTime = (output: any, context: __SerdeContext): UtilizationByTime[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UtilizationByTime(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UtilizationByTime(entry, context); + }); }; const deserializeAws_json1_1Values = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -5336,3 +5637,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-customer-profiles/protocols/Aws_restJson1.ts b/clients/client-customer-profiles/protocols/Aws_restJson1.ts index e4cec0ac7ddc..6983e34e8a32 100644 --- a/clients/client-customer-profiles/protocols/Aws_restJson1.ts +++ b/clients/client-customer-profiles/protocols/Aws_restJson1.ts @@ -89,7 +89,7 @@ export const serializeAws_restJson1AddProfileKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/profiles/keys"; if (input.DomainName !== undefined) { @@ -103,9 +103,10 @@ export const serializeAws_restJson1AddProfileKeyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.KeyName !== undefined && { KeyName: input.KeyName }), - ...(input.ProfileId !== undefined && { ProfileId: input.ProfileId }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1requestValueList(input.Values, context) }), + ...(input.KeyName !== undefined && input.KeyName !== null && { KeyName: input.KeyName }), + ...(input.ProfileId !== undefined && input.ProfileId !== null && { ProfileId: input.ProfileId }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1requestValueList(input.Values, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -124,7 +125,7 @@ export const serializeAws_restJson1CreateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}"; if (input.DomainName !== undefined) { @@ -138,10 +139,13 @@ export const serializeAws_restJson1CreateDomainCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DeadLetterQueueUrl !== undefined && { DeadLetterQueueUrl: input.DeadLetterQueueUrl }), - ...(input.DefaultEncryptionKey !== undefined && { DefaultEncryptionKey: input.DefaultEncryptionKey }), - ...(input.DefaultExpirationDays !== undefined && { DefaultExpirationDays: input.DefaultExpirationDays }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.DeadLetterQueueUrl !== undefined && + input.DeadLetterQueueUrl !== null && { DeadLetterQueueUrl: input.DeadLetterQueueUrl }), + ...(input.DefaultEncryptionKey !== undefined && + input.DefaultEncryptionKey !== null && { DefaultEncryptionKey: input.DefaultEncryptionKey }), + ...(input.DefaultExpirationDays !== undefined && + input.DefaultExpirationDays !== null && { DefaultExpirationDays: input.DefaultExpirationDays }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -160,7 +164,7 @@ export const serializeAws_restJson1CreateProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/profiles"; if (input.DomainName !== undefined) { @@ -174,33 +178,44 @@ export const serializeAws_restJson1CreateProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountNumber !== undefined && { AccountNumber: input.AccountNumber }), - ...(input.AdditionalInformation !== undefined && { AdditionalInformation: input.AdditionalInformation }), - ...(input.Address !== undefined && { Address: serializeAws_restJson1Address(input.Address, context) }), - ...(input.Attributes !== undefined && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), - ...(input.BillingAddress !== undefined && { - BillingAddress: serializeAws_restJson1Address(input.BillingAddress, context), - }), - ...(input.BirthDate !== undefined && { BirthDate: input.BirthDate }), - ...(input.BusinessEmailAddress !== undefined && { BusinessEmailAddress: input.BusinessEmailAddress }), - ...(input.BusinessName !== undefined && { BusinessName: input.BusinessName }), - ...(input.BusinessPhoneNumber !== undefined && { BusinessPhoneNumber: input.BusinessPhoneNumber }), - ...(input.EmailAddress !== undefined && { EmailAddress: input.EmailAddress }), - ...(input.FirstName !== undefined && { FirstName: input.FirstName }), - ...(input.Gender !== undefined && { Gender: input.Gender }), - ...(input.HomePhoneNumber !== undefined && { HomePhoneNumber: input.HomePhoneNumber }), - ...(input.LastName !== undefined && { LastName: input.LastName }), - ...(input.MailingAddress !== undefined && { - MailingAddress: serializeAws_restJson1Address(input.MailingAddress, context), - }), - ...(input.MiddleName !== undefined && { MiddleName: input.MiddleName }), - ...(input.MobilePhoneNumber !== undefined && { MobilePhoneNumber: input.MobilePhoneNumber }), - ...(input.PartyType !== undefined && { PartyType: input.PartyType }), - ...(input.PersonalEmailAddress !== undefined && { PersonalEmailAddress: input.PersonalEmailAddress }), - ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }), - ...(input.ShippingAddress !== undefined && { - ShippingAddress: serializeAws_restJson1Address(input.ShippingAddress, context), - }), + ...(input.AccountNumber !== undefined && input.AccountNumber !== null && { AccountNumber: input.AccountNumber }), + ...(input.AdditionalInformation !== undefined && + input.AdditionalInformation !== null && { AdditionalInformation: input.AdditionalInformation }), + ...(input.Address !== undefined && + input.Address !== null && { Address: serializeAws_restJson1Address(input.Address, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1Attributes(input.Attributes, context) }), + ...(input.BillingAddress !== undefined && + input.BillingAddress !== null && { + BillingAddress: serializeAws_restJson1Address(input.BillingAddress, context), + }), + ...(input.BirthDate !== undefined && input.BirthDate !== null && { BirthDate: input.BirthDate }), + ...(input.BusinessEmailAddress !== undefined && + input.BusinessEmailAddress !== null && { BusinessEmailAddress: input.BusinessEmailAddress }), + ...(input.BusinessName !== undefined && input.BusinessName !== null && { BusinessName: input.BusinessName }), + ...(input.BusinessPhoneNumber !== undefined && + input.BusinessPhoneNumber !== null && { BusinessPhoneNumber: input.BusinessPhoneNumber }), + ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }), + ...(input.FirstName !== undefined && input.FirstName !== null && { FirstName: input.FirstName }), + ...(input.Gender !== undefined && input.Gender !== null && { Gender: input.Gender }), + ...(input.HomePhoneNumber !== undefined && + input.HomePhoneNumber !== null && { HomePhoneNumber: input.HomePhoneNumber }), + ...(input.LastName !== undefined && input.LastName !== null && { LastName: input.LastName }), + ...(input.MailingAddress !== undefined && + input.MailingAddress !== null && { + MailingAddress: serializeAws_restJson1Address(input.MailingAddress, context), + }), + ...(input.MiddleName !== undefined && input.MiddleName !== null && { MiddleName: input.MiddleName }), + ...(input.MobilePhoneNumber !== undefined && + input.MobilePhoneNumber !== null && { MobilePhoneNumber: input.MobilePhoneNumber }), + ...(input.PartyType !== undefined && input.PartyType !== null && { PartyType: input.PartyType }), + ...(input.PersonalEmailAddress !== undefined && + input.PersonalEmailAddress !== null && { PersonalEmailAddress: input.PersonalEmailAddress }), + ...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }), + ...(input.ShippingAddress !== undefined && + input.ShippingAddress !== null && { + ShippingAddress: serializeAws_restJson1Address(input.ShippingAddress, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -218,9 +233,7 @@ export const serializeAws_restJson1DeleteDomainCommand = async ( input: DeleteDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domains/{DomainName}"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -249,7 +262,7 @@ export const serializeAws_restJson1DeleteIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/integrations/delete"; if (input.DomainName !== undefined) { @@ -263,7 +276,7 @@ export const serializeAws_restJson1DeleteIntegrationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Uri !== undefined && { Uri: input.Uri }), + ...(input.Uri !== undefined && input.Uri !== null && { Uri: input.Uri }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -282,7 +295,7 @@ export const serializeAws_restJson1DeleteProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/profiles/delete"; if (input.DomainName !== undefined) { @@ -296,7 +309,7 @@ export const serializeAws_restJson1DeleteProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ProfileId !== undefined && { ProfileId: input.ProfileId }), + ...(input.ProfileId !== undefined && input.ProfileId !== null && { ProfileId: input.ProfileId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -315,7 +328,7 @@ export const serializeAws_restJson1DeleteProfileKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/profiles/keys/delete"; if (input.DomainName !== undefined) { @@ -329,9 +342,10 @@ export const serializeAws_restJson1DeleteProfileKeyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.KeyName !== undefined && { KeyName: input.KeyName }), - ...(input.ProfileId !== undefined && { ProfileId: input.ProfileId }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1requestValueList(input.Values, context) }), + ...(input.KeyName !== undefined && input.KeyName !== null && { KeyName: input.KeyName }), + ...(input.ProfileId !== undefined && input.ProfileId !== null && { ProfileId: input.ProfileId }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1requestValueList(input.Values, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -350,7 +364,7 @@ export const serializeAws_restJson1DeleteProfileObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/profiles/objects/delete"; if (input.DomainName !== undefined) { @@ -364,9 +378,11 @@ export const serializeAws_restJson1DeleteProfileObjectCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ObjectTypeName !== undefined && { ObjectTypeName: input.ObjectTypeName }), - ...(input.ProfileId !== undefined && { ProfileId: input.ProfileId }), - ...(input.ProfileObjectUniqueKey !== undefined && { ProfileObjectUniqueKey: input.ProfileObjectUniqueKey }), + ...(input.ObjectTypeName !== undefined && + input.ObjectTypeName !== null && { ObjectTypeName: input.ObjectTypeName }), + ...(input.ProfileId !== undefined && input.ProfileId !== null && { ProfileId: input.ProfileId }), + ...(input.ProfileObjectUniqueKey !== undefined && + input.ProfileObjectUniqueKey !== null && { ProfileObjectUniqueKey: input.ProfileObjectUniqueKey }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -384,9 +400,7 @@ export const serializeAws_restJson1DeleteProfileObjectTypeCommand = async ( input: DeleteProfileObjectTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domains/{DomainName}/object-types/{ObjectTypeName}"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -423,9 +437,7 @@ export const serializeAws_restJson1GetDomainCommand = async ( input: GetDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domains/{DomainName}"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -454,7 +466,7 @@ export const serializeAws_restJson1GetIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/integrations"; if (input.DomainName !== undefined) { @@ -468,7 +480,7 @@ export const serializeAws_restJson1GetIntegrationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Uri !== undefined && { Uri: input.Uri }), + ...(input.Uri !== undefined && input.Uri !== null && { Uri: input.Uri }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -486,9 +498,7 @@ export const serializeAws_restJson1GetProfileObjectTypeCommand = async ( input: GetProfileObjectTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domains/{DomainName}/object-types/{ObjectTypeName}"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -525,9 +535,7 @@ export const serializeAws_restJson1GetProfileObjectTypeTemplateCommand = async ( input: GetProfileObjectTypeTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/templates/{TemplateId}"; if (input.TemplateId !== undefined) { const labelValue: string = input.TemplateId; @@ -556,7 +564,7 @@ export const serializeAws_restJson1ListAccountIntegrationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/integrations"; const query: any = { @@ -565,7 +573,7 @@ export const serializeAws_restJson1ListAccountIntegrationsCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Uri !== undefined && { Uri: input.Uri }), + ...(input.Uri !== undefined && input.Uri !== null && { Uri: input.Uri }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -584,9 +592,7 @@ export const serializeAws_restJson1ListDomainsCommand = async ( input: ListDomainsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domains"; const query: any = { ...(input.NextToken !== undefined && { "next-token": input.NextToken }), @@ -610,9 +616,7 @@ export const serializeAws_restJson1ListIntegrationsCommand = async ( input: ListIntegrationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domains/{DomainName}/integrations"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -646,7 +650,7 @@ export const serializeAws_restJson1ListProfileObjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/profiles/objects"; if (input.DomainName !== undefined) { @@ -664,8 +668,9 @@ export const serializeAws_restJson1ListProfileObjectsCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.ObjectTypeName !== undefined && { ObjectTypeName: input.ObjectTypeName }), - ...(input.ProfileId !== undefined && { ProfileId: input.ProfileId }), + ...(input.ObjectTypeName !== undefined && + input.ObjectTypeName !== null && { ObjectTypeName: input.ObjectTypeName }), + ...(input.ProfileId !== undefined && input.ProfileId !== null && { ProfileId: input.ProfileId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -684,9 +689,7 @@ export const serializeAws_restJson1ListProfileObjectTypesCommand = async ( input: ListProfileObjectTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domains/{DomainName}/object-types"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -719,9 +722,7 @@ export const serializeAws_restJson1ListProfileObjectTypeTemplatesCommand = async input: ListProfileObjectTypeTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/templates"; const query: any = { ...(input.NextToken !== undefined && { "next-token": input.NextToken }), @@ -745,9 +746,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -776,7 +775,7 @@ export const serializeAws_restJson1PutIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/integrations"; if (input.DomainName !== undefined) { @@ -790,9 +789,10 @@ export const serializeAws_restJson1PutIntegrationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ObjectTypeName !== undefined && { ObjectTypeName: input.ObjectTypeName }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), - ...(input.Uri !== undefined && { Uri: input.Uri }), + ...(input.ObjectTypeName !== undefined && + input.ObjectTypeName !== null && { ObjectTypeName: input.ObjectTypeName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Uri !== undefined && input.Uri !== null && { Uri: input.Uri }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -811,7 +811,7 @@ export const serializeAws_restJson1PutProfileObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/profiles/objects"; if (input.DomainName !== undefined) { @@ -825,8 +825,9 @@ export const serializeAws_restJson1PutProfileObjectCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Object !== undefined && { Object: input.Object }), - ...(input.ObjectTypeName !== undefined && { ObjectTypeName: input.ObjectTypeName }), + ...(input.Object !== undefined && input.Object !== null && { Object: input.Object }), + ...(input.ObjectTypeName !== undefined && + input.ObjectTypeName !== null && { ObjectTypeName: input.ObjectTypeName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -845,7 +846,7 @@ export const serializeAws_restJson1PutProfileObjectTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/object-types/{ObjectTypeName}"; if (input.DomainName !== undefined) { @@ -868,14 +869,17 @@ export const serializeAws_restJson1PutProfileObjectTypeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AllowProfileCreation !== undefined && { AllowProfileCreation: input.AllowProfileCreation }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EncryptionKey !== undefined && { EncryptionKey: input.EncryptionKey }), - ...(input.ExpirationDays !== undefined && { ExpirationDays: input.ExpirationDays }), - ...(input.Fields !== undefined && { Fields: serializeAws_restJson1FieldMap(input.Fields, context) }), - ...(input.Keys !== undefined && { Keys: serializeAws_restJson1KeyMap(input.Keys, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), - ...(input.TemplateId !== undefined && { TemplateId: input.TemplateId }), + ...(input.AllowProfileCreation !== undefined && + input.AllowProfileCreation !== null && { AllowProfileCreation: input.AllowProfileCreation }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EncryptionKey !== undefined && input.EncryptionKey !== null && { EncryptionKey: input.EncryptionKey }), + ...(input.ExpirationDays !== undefined && + input.ExpirationDays !== null && { ExpirationDays: input.ExpirationDays }), + ...(input.Fields !== undefined && + input.Fields !== null && { Fields: serializeAws_restJson1FieldMap(input.Fields, context) }), + ...(input.Keys !== undefined && input.Keys !== null && { Keys: serializeAws_restJson1KeyMap(input.Keys, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.TemplateId !== undefined && input.TemplateId !== null && { TemplateId: input.TemplateId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -894,7 +898,7 @@ export const serializeAws_restJson1SearchProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/profiles/search"; if (input.DomainName !== undefined) { @@ -912,8 +916,9 @@ export const serializeAws_restJson1SearchProfilesCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.KeyName !== undefined && { KeyName: input.KeyName }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1requestValueList(input.Values, context) }), + ...(input.KeyName !== undefined && input.KeyName !== null && { KeyName: input.KeyName }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1requestValueList(input.Values, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -933,7 +938,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -947,7 +952,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -965,9 +970,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1000,7 +1003,7 @@ export const serializeAws_restJson1UpdateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}"; if (input.DomainName !== undefined) { @@ -1014,10 +1017,13 @@ export const serializeAws_restJson1UpdateDomainCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DeadLetterQueueUrl !== undefined && { DeadLetterQueueUrl: input.DeadLetterQueueUrl }), - ...(input.DefaultEncryptionKey !== undefined && { DefaultEncryptionKey: input.DefaultEncryptionKey }), - ...(input.DefaultExpirationDays !== undefined && { DefaultExpirationDays: input.DefaultExpirationDays }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.DeadLetterQueueUrl !== undefined && + input.DeadLetterQueueUrl !== null && { DeadLetterQueueUrl: input.DeadLetterQueueUrl }), + ...(input.DefaultEncryptionKey !== undefined && + input.DefaultEncryptionKey !== null && { DefaultEncryptionKey: input.DefaultEncryptionKey }), + ...(input.DefaultExpirationDays !== undefined && + input.DefaultExpirationDays !== null && { DefaultExpirationDays: input.DefaultExpirationDays }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1036,7 +1042,7 @@ export const serializeAws_restJson1UpdateProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domains/{DomainName}/profiles"; if (input.DomainName !== undefined) { @@ -1050,36 +1056,45 @@ export const serializeAws_restJson1UpdateProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountNumber !== undefined && { AccountNumber: input.AccountNumber }), - ...(input.AdditionalInformation !== undefined && { AdditionalInformation: input.AdditionalInformation }), - ...(input.Address !== undefined && { Address: serializeAws_restJson1UpdateAddress(input.Address, context) }), - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1UpdateAttributes(input.Attributes, context), - }), - ...(input.BillingAddress !== undefined && { - BillingAddress: serializeAws_restJson1UpdateAddress(input.BillingAddress, context), - }), - ...(input.BirthDate !== undefined && { BirthDate: input.BirthDate }), - ...(input.BusinessEmailAddress !== undefined && { BusinessEmailAddress: input.BusinessEmailAddress }), - ...(input.BusinessName !== undefined && { BusinessName: input.BusinessName }), - ...(input.BusinessPhoneNumber !== undefined && { BusinessPhoneNumber: input.BusinessPhoneNumber }), - ...(input.EmailAddress !== undefined && { EmailAddress: input.EmailAddress }), - ...(input.FirstName !== undefined && { FirstName: input.FirstName }), - ...(input.Gender !== undefined && { Gender: input.Gender }), - ...(input.HomePhoneNumber !== undefined && { HomePhoneNumber: input.HomePhoneNumber }), - ...(input.LastName !== undefined && { LastName: input.LastName }), - ...(input.MailingAddress !== undefined && { - MailingAddress: serializeAws_restJson1UpdateAddress(input.MailingAddress, context), - }), - ...(input.MiddleName !== undefined && { MiddleName: input.MiddleName }), - ...(input.MobilePhoneNumber !== undefined && { MobilePhoneNumber: input.MobilePhoneNumber }), - ...(input.PartyType !== undefined && { PartyType: input.PartyType }), - ...(input.PersonalEmailAddress !== undefined && { PersonalEmailAddress: input.PersonalEmailAddress }), - ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }), - ...(input.ProfileId !== undefined && { ProfileId: input.ProfileId }), - ...(input.ShippingAddress !== undefined && { - ShippingAddress: serializeAws_restJson1UpdateAddress(input.ShippingAddress, context), - }), + ...(input.AccountNumber !== undefined && input.AccountNumber !== null && { AccountNumber: input.AccountNumber }), + ...(input.AdditionalInformation !== undefined && + input.AdditionalInformation !== null && { AdditionalInformation: input.AdditionalInformation }), + ...(input.Address !== undefined && + input.Address !== null && { Address: serializeAws_restJson1UpdateAddress(input.Address, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1UpdateAttributes(input.Attributes, context) }), + ...(input.BillingAddress !== undefined && + input.BillingAddress !== null && { + BillingAddress: serializeAws_restJson1UpdateAddress(input.BillingAddress, context), + }), + ...(input.BirthDate !== undefined && input.BirthDate !== null && { BirthDate: input.BirthDate }), + ...(input.BusinessEmailAddress !== undefined && + input.BusinessEmailAddress !== null && { BusinessEmailAddress: input.BusinessEmailAddress }), + ...(input.BusinessName !== undefined && input.BusinessName !== null && { BusinessName: input.BusinessName }), + ...(input.BusinessPhoneNumber !== undefined && + input.BusinessPhoneNumber !== null && { BusinessPhoneNumber: input.BusinessPhoneNumber }), + ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }), + ...(input.FirstName !== undefined && input.FirstName !== null && { FirstName: input.FirstName }), + ...(input.Gender !== undefined && input.Gender !== null && { Gender: input.Gender }), + ...(input.HomePhoneNumber !== undefined && + input.HomePhoneNumber !== null && { HomePhoneNumber: input.HomePhoneNumber }), + ...(input.LastName !== undefined && input.LastName !== null && { LastName: input.LastName }), + ...(input.MailingAddress !== undefined && + input.MailingAddress !== null && { + MailingAddress: serializeAws_restJson1UpdateAddress(input.MailingAddress, context), + }), + ...(input.MiddleName !== undefined && input.MiddleName !== null && { MiddleName: input.MiddleName }), + ...(input.MobilePhoneNumber !== undefined && + input.MobilePhoneNumber !== null && { MobilePhoneNumber: input.MobilePhoneNumber }), + ...(input.PartyType !== undefined && input.PartyType !== null && { PartyType: input.PartyType }), + ...(input.PersonalEmailAddress !== undefined && + input.PersonalEmailAddress !== null && { PersonalEmailAddress: input.PersonalEmailAddress }), + ...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }), + ...(input.ProfileId !== undefined && input.ProfileId !== null && { ProfileId: input.ProfileId }), + ...(input.ShippingAddress !== undefined && + input.ShippingAddress !== null && { + ShippingAddress: serializeAws_restJson1UpdateAddress(input.ShippingAddress, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3808,120 +3823,158 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async ( const serializeAws_restJson1Address = (input: Address, context: __SerdeContext): any => { return { - ...(input.Address1 !== undefined && { Address1: input.Address1 }), - ...(input.Address2 !== undefined && { Address2: input.Address2 }), - ...(input.Address3 !== undefined && { Address3: input.Address3 }), - ...(input.Address4 !== undefined && { Address4: input.Address4 }), - ...(input.City !== undefined && { City: input.City }), - ...(input.Country !== undefined && { Country: input.Country }), - ...(input.County !== undefined && { County: input.County }), - ...(input.PostalCode !== undefined && { PostalCode: input.PostalCode }), - ...(input.Province !== undefined && { Province: input.Province }), - ...(input.State !== undefined && { State: input.State }), + ...(input.Address1 !== undefined && input.Address1 !== null && { Address1: input.Address1 }), + ...(input.Address2 !== undefined && input.Address2 !== null && { Address2: input.Address2 }), + ...(input.Address3 !== undefined && input.Address3 !== null && { Address3: input.Address3 }), + ...(input.Address4 !== undefined && input.Address4 !== null && { Address4: input.Address4 }), + ...(input.City !== undefined && input.City !== null && { City: input.City }), + ...(input.Country !== undefined && input.Country !== null && { Country: input.Country }), + ...(input.County !== undefined && input.County !== null && { County: input.County }), + ...(input.PostalCode !== undefined && input.PostalCode !== null && { PostalCode: input.PostalCode }), + ...(input.Province !== undefined && input.Province !== null && { Province: input.Province }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; const serializeAws_restJson1Attributes = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1FieldMap = (input: { [key: string]: ObjectTypeField }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: ObjectTypeField }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: ObjectTypeField }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1ObjectTypeField(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1FieldNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1KeyMap = (input: { [key: string]: ObjectTypeKey[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: ObjectTypeKey[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: ObjectTypeKey[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1ObjectTypeKeyList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ObjectTypeField = (input: ObjectTypeField, context: __SerdeContext): any => { return { - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.Target !== undefined && { Target: input.Target }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.Target !== undefined && input.Target !== null && { Target: input.Target }), }; }; const serializeAws_restJson1ObjectTypeKey = (input: ObjectTypeKey, context: __SerdeContext): any => { return { - ...(input.FieldNames !== undefined && { - FieldNames: serializeAws_restJson1FieldNameList(input.FieldNames, context), - }), - ...(input.StandardIdentifiers !== undefined && { - StandardIdentifiers: serializeAws_restJson1StandardIdentifierList(input.StandardIdentifiers, context), - }), + ...(input.FieldNames !== undefined && + input.FieldNames !== null && { FieldNames: serializeAws_restJson1FieldNameList(input.FieldNames, context) }), + ...(input.StandardIdentifiers !== undefined && + input.StandardIdentifiers !== null && { + StandardIdentifiers: serializeAws_restJson1StandardIdentifierList(input.StandardIdentifiers, context), + }), }; }; const serializeAws_restJson1ObjectTypeKeyList = (input: ObjectTypeKey[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ObjectTypeKey(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ObjectTypeKey(entry, context); + }); }; const serializeAws_restJson1requestValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1StandardIdentifierList = ( input: (StandardIdentifier | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1UpdateAddress = (input: UpdateAddress, context: __SerdeContext): any => { return { - ...(input.Address1 !== undefined && { Address1: input.Address1 }), - ...(input.Address2 !== undefined && { Address2: input.Address2 }), - ...(input.Address3 !== undefined && { Address3: input.Address3 }), - ...(input.Address4 !== undefined && { Address4: input.Address4 }), - ...(input.City !== undefined && { City: input.City }), - ...(input.Country !== undefined && { Country: input.Country }), - ...(input.County !== undefined && { County: input.County }), - ...(input.PostalCode !== undefined && { PostalCode: input.PostalCode }), - ...(input.Province !== undefined && { Province: input.Province }), - ...(input.State !== undefined && { State: input.State }), + ...(input.Address1 !== undefined && input.Address1 !== null && { Address1: input.Address1 }), + ...(input.Address2 !== undefined && input.Address2 !== null && { Address2: input.Address2 }), + ...(input.Address3 !== undefined && input.Address3 !== null && { Address3: input.Address3 }), + ...(input.Address4 !== undefined && input.Address4 !== null && { Address4: input.Address4 }), + ...(input.City !== undefined && input.City !== null && { City: input.City }), + ...(input.Country !== undefined && input.Country !== null && { Country: input.Country }), + ...(input.County !== undefined && input.County !== null && { County: input.County }), + ...(input.PostalCode !== undefined && input.PostalCode !== null && { PostalCode: input.PostalCode }), + ...(input.Province !== undefined && input.Province !== null && { Province: input.Province }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; const serializeAws_restJson1UpdateAttributes = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Address = (output: any, context: __SerdeContext): Address => { @@ -3940,17 +3993,26 @@ const deserializeAws_restJson1Address = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Attributes = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DomainList = (output: any, context: __SerdeContext): ListDomainItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ListDomainItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ListDomainItem(entry, context); + }); }; const deserializeAws_restJson1DomainStats = (output: any, context: __SerdeContext): DomainStats => { @@ -3966,31 +4028,49 @@ const deserializeAws_restJson1DomainStats = (output: any, context: __SerdeContex }; const deserializeAws_restJson1FieldMap = (output: any, context: __SerdeContext): { [key: string]: ObjectTypeField } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ObjectTypeField }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ObjectTypeField }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ObjectTypeField(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1FieldNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1IntegrationList = (output: any, context: __SerdeContext): ListIntegrationItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ListIntegrationItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ListIntegrationItem(entry, context); + }); }; const deserializeAws_restJson1KeyMap = (output: any, context: __SerdeContext): { [key: string]: ObjectTypeKey[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ObjectTypeKey[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ObjectTypeKey[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ObjectTypeKeyList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ListDomainItem = (output: any, context: __SerdeContext): ListDomainItem => { @@ -4103,7 +4183,14 @@ const deserializeAws_restJson1ObjectTypeKey = (output: any, context: __SerdeCont }; const deserializeAws_restJson1ObjectTypeKeyList = (output: any, context: __SerdeContext): ObjectTypeKey[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ObjectTypeKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ObjectTypeKey(entry, context); + }); }; const deserializeAws_restJson1Profile = (output: any, context: __SerdeContext): Profile => { @@ -4166,46 +4253,90 @@ const deserializeAws_restJson1Profile = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1ProfileList = (output: any, context: __SerdeContext): Profile[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Profile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Profile(entry, context); + }); }; const deserializeAws_restJson1ProfileObjectList = (output: any, context: __SerdeContext): ListProfileObjectsItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ListProfileObjectsItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ListProfileObjectsItem(entry, context); + }); }; const deserializeAws_restJson1ProfileObjectTypeList = ( output: any, context: __SerdeContext ): ListProfileObjectTypeItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ListProfileObjectTypeItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ListProfileObjectTypeItem(entry, context); + }); }; const deserializeAws_restJson1ProfileObjectTypeTemplateList = ( output: any, context: __SerdeContext ): ListProfileObjectTypeTemplateItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ListProfileObjectTypeTemplateItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ListProfileObjectTypeTemplateItem(entry, context); + }); }; const deserializeAws_restJson1requestValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1StandardIdentifierList = ( output: any, context: __SerdeContext ): (StandardIdentifier | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4228,6 +4359,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-data-pipeline/protocols/Aws_json1_1.ts b/clients/client-data-pipeline/protocols/Aws_json1_1.ts index d89e32c2da86..881ff07cd206 100644 --- a/clients/client-data-pipeline/protocols/Aws_json1_1.ts +++ b/clients/client-data-pipeline/protocols/Aws_json1_1.ts @@ -102,7 +102,7 @@ export const serializeAws_json1_1ActivatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.ActivatePipeline", }; let body: any; @@ -115,7 +115,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.AddTags", }; let body: any; @@ -128,7 +128,7 @@ export const serializeAws_json1_1CreatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.CreatePipeline", }; let body: any; @@ -141,7 +141,7 @@ export const serializeAws_json1_1DeactivatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.DeactivatePipeline", }; let body: any; @@ -154,7 +154,7 @@ export const serializeAws_json1_1DeletePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.DeletePipeline", }; let body: any; @@ -167,7 +167,7 @@ export const serializeAws_json1_1DescribeObjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.DescribeObjects", }; let body: any; @@ -180,7 +180,7 @@ export const serializeAws_json1_1DescribePipelinesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.DescribePipelines", }; let body: any; @@ -193,7 +193,7 @@ export const serializeAws_json1_1EvaluateExpressionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.EvaluateExpression", }; let body: any; @@ -206,7 +206,7 @@ export const serializeAws_json1_1GetPipelineDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.GetPipelineDefinition", }; let body: any; @@ -219,7 +219,7 @@ export const serializeAws_json1_1ListPipelinesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.ListPipelines", }; let body: any; @@ -232,7 +232,7 @@ export const serializeAws_json1_1PollForTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.PollForTask", }; let body: any; @@ -245,7 +245,7 @@ export const serializeAws_json1_1PutPipelineDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.PutPipelineDefinition", }; let body: any; @@ -258,7 +258,7 @@ export const serializeAws_json1_1QueryObjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.QueryObjects", }; let body: any; @@ -271,7 +271,7 @@ export const serializeAws_json1_1RemoveTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.RemoveTags", }; let body: any; @@ -284,7 +284,7 @@ export const serializeAws_json1_1ReportTaskProgressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.ReportTaskProgress", }; let body: any; @@ -297,7 +297,7 @@ export const serializeAws_json1_1ReportTaskRunnerHeartbeatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.ReportTaskRunnerHeartbeat", }; let body: any; @@ -310,7 +310,7 @@ export const serializeAws_json1_1SetStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.SetStatus", }; let body: any; @@ -323,7 +323,7 @@ export const serializeAws_json1_1SetTaskStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.SetTaskStatus", }; let body: any; @@ -336,7 +336,7 @@ export const serializeAws_json1_1ValidatePipelineDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DataPipeline.ValidatePipelineDefinition", }; let body: any; @@ -371,8 +371,7 @@ const deserializeAws_json1_1ActivatePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -450,8 +449,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -529,8 +527,7 @@ const deserializeAws_json1_1CreatePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -592,8 +589,7 @@ const deserializeAws_json1_1DeactivatePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -668,8 +664,7 @@ const deserializeAws_json1_1DeletePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -739,8 +734,7 @@ const deserializeAws_json1_1DescribeObjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -818,8 +812,7 @@ const deserializeAws_json1_1DescribePipelinesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -897,8 +890,7 @@ const deserializeAws_json1_1EvaluateExpressionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -984,8 +976,7 @@ const deserializeAws_json1_1GetPipelineDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1063,8 +1054,7 @@ const deserializeAws_json1_1ListPipelinesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1126,8 +1116,7 @@ const deserializeAws_json1_1PollForTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1197,8 +1186,7 @@ const deserializeAws_json1_1PutPipelineDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1276,8 +1264,7 @@ const deserializeAws_json1_1QueryObjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1355,8 +1342,7 @@ const deserializeAws_json1_1RemoveTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1434,8 +1420,7 @@ const deserializeAws_json1_1ReportTaskProgressCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1521,8 +1506,7 @@ const deserializeAws_json1_1ReportTaskRunnerHeartbeatCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1581,8 +1565,7 @@ const deserializeAws_json1_1SetStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1660,8 +1643,7 @@ const deserializeAws_json1_1SetTaskStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1747,8 +1729,7 @@ const deserializeAws_json1_1ValidatePipelineDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.datapipeline#InternalServiceError": @@ -1876,76 +1857,88 @@ const deserializeAws_json1_1TaskNotFoundExceptionResponse = async ( const serializeAws_json1_1ActivatePipelineInput = (input: ActivatePipelineInput, context: __SerdeContext): any => { return { - ...(input.parameterValues !== undefined && { - parameterValues: serializeAws_json1_1ParameterValueList(input.parameterValues, context), - }), - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), - ...(input.startTimestamp !== undefined && { startTimestamp: Math.round(input.startTimestamp.getTime() / 1000) }), + ...(input.parameterValues !== undefined && + input.parameterValues !== null && { + parameterValues: serializeAws_json1_1ParameterValueList(input.parameterValues, context), + }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), + ...(input.startTimestamp !== undefined && + input.startTimestamp !== null && { startTimestamp: Math.round(input.startTimestamp.getTime() / 1000) }), }; }; const serializeAws_json1_1AddTagsInput = (input: AddTagsInput, context: __SerdeContext): any => { return { - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1CreatePipelineInput = (input: CreatePipelineInput, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), - ...(input.uniqueId !== undefined && { uniqueId: input.uniqueId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.uniqueId !== undefined && input.uniqueId !== null && { uniqueId: input.uniqueId }), }; }; const serializeAws_json1_1DeactivatePipelineInput = (input: DeactivatePipelineInput, context: __SerdeContext): any => { return { - ...(input.cancelActive !== undefined && { cancelActive: input.cancelActive }), - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), + ...(input.cancelActive !== undefined && input.cancelActive !== null && { cancelActive: input.cancelActive }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), }; }; const serializeAws_json1_1DeletePipelineInput = (input: DeletePipelineInput, context: __SerdeContext): any => { return { - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), }; }; const serializeAws_json1_1DescribeObjectsInput = (input: DescribeObjectsInput, context: __SerdeContext): any => { return { - ...(input.evaluateExpressions !== undefined && { evaluateExpressions: input.evaluateExpressions }), - ...(input.marker !== undefined && { marker: input.marker }), - ...(input.objectIds !== undefined && { objectIds: serializeAws_json1_1idList(input.objectIds, context) }), - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), + ...(input.evaluateExpressions !== undefined && + input.evaluateExpressions !== null && { evaluateExpressions: input.evaluateExpressions }), + ...(input.marker !== undefined && input.marker !== null && { marker: input.marker }), + ...(input.objectIds !== undefined && + input.objectIds !== null && { objectIds: serializeAws_json1_1idList(input.objectIds, context) }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), }; }; const serializeAws_json1_1DescribePipelinesInput = (input: DescribePipelinesInput, context: __SerdeContext): any => { return { - ...(input.pipelineIds !== undefined && { pipelineIds: serializeAws_json1_1idList(input.pipelineIds, context) }), + ...(input.pipelineIds !== undefined && + input.pipelineIds !== null && { pipelineIds: serializeAws_json1_1idList(input.pipelineIds, context) }), }; }; const serializeAws_json1_1EvaluateExpressionInput = (input: EvaluateExpressionInput, context: __SerdeContext): any => { return { - ...(input.expression !== undefined && { expression: input.expression }), - ...(input.objectId !== undefined && { objectId: input.objectId }), - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), + ...(input.expression !== undefined && input.expression !== null && { expression: input.expression }), + ...(input.objectId !== undefined && input.objectId !== null && { objectId: input.objectId }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), }; }; const serializeAws_json1_1Field = (input: Field, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.refValue !== undefined && { refValue: input.refValue }), - ...(input.stringValue !== undefined && { stringValue: input.stringValue }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.refValue !== undefined && input.refValue !== null && { refValue: input.refValue }), + ...(input.stringValue !== undefined && input.stringValue !== null && { stringValue: input.stringValue }), }; }; const serializeAws_json1_1fieldList = (input: Field[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Field(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Field(entry, context); + }); }; const serializeAws_json1_1GetPipelineDefinitionInput = ( @@ -1953,89 +1946,128 @@ const serializeAws_json1_1GetPipelineDefinitionInput = ( context: __SerdeContext ): any => { return { - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), - ...(input.version !== undefined && { version: input.version }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_json1_1idList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InstanceIdentity = (input: InstanceIdentity, context: __SerdeContext): any => { return { - ...(input.document !== undefined && { document: input.document }), - ...(input.signature !== undefined && { signature: input.signature }), + ...(input.document !== undefined && input.document !== null && { document: input.document }), + ...(input.signature !== undefined && input.signature !== null && { signature: input.signature }), }; }; const serializeAws_json1_1ListPipelinesInput = (input: ListPipelinesInput, context: __SerdeContext): any => { return { - ...(input.marker !== undefined && { marker: input.marker }), + ...(input.marker !== undefined && input.marker !== null && { marker: input.marker }), }; }; const serializeAws_json1_1Operator = (input: Operator, context: __SerdeContext): any => { return { - ...(input.type !== undefined && { type: input.type }), - ...(input.values !== undefined && { values: serializeAws_json1_1stringList(input.values, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_1stringList(input.values, context) }), }; }; const serializeAws_json1_1ParameterAttribute = (input: ParameterAttribute, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.stringValue !== undefined && { stringValue: input.stringValue }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.stringValue !== undefined && input.stringValue !== null && { stringValue: input.stringValue }), }; }; const serializeAws_json1_1ParameterAttributeList = (input: ParameterAttribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ParameterAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ParameterAttribute(entry, context); + }); }; const serializeAws_json1_1ParameterObject = (input: ParameterObject, context: __SerdeContext): any => { return { - ...(input.attributes !== undefined && { - attributes: serializeAws_json1_1ParameterAttributeList(input.attributes, context), - }), - ...(input.id !== undefined && { id: input.id }), + ...(input.attributes !== undefined && + input.attributes !== null && { + attributes: serializeAws_json1_1ParameterAttributeList(input.attributes, context), + }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_json1_1ParameterObjectList = (input: ParameterObject[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ParameterObject(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ParameterObject(entry, context); + }); }; const serializeAws_json1_1ParameterValue = (input: ParameterValue, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.stringValue !== undefined && { stringValue: input.stringValue }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.stringValue !== undefined && input.stringValue !== null && { stringValue: input.stringValue }), }; }; const serializeAws_json1_1ParameterValueList = (input: ParameterValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ParameterValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ParameterValue(entry, context); + }); }; const serializeAws_json1_1PipelineObject = (input: PipelineObject, context: __SerdeContext): any => { return { - ...(input.fields !== undefined && { fields: serializeAws_json1_1fieldList(input.fields, context) }), - ...(input.id !== undefined && { id: input.id }), - ...(input.name !== undefined && { name: input.name }), + ...(input.fields !== undefined && + input.fields !== null && { fields: serializeAws_json1_1fieldList(input.fields, context) }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1PipelineObjectList = (input: PipelineObject[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PipelineObject(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PipelineObject(entry, context); + }); }; const serializeAws_json1_1PollForTaskInput = (input: PollForTaskInput, context: __SerdeContext): any => { return { - ...(input.hostname !== undefined && { hostname: input.hostname }), - ...(input.instanceIdentity !== undefined && { - instanceIdentity: serializeAws_json1_1InstanceIdentity(input.instanceIdentity, context), - }), - ...(input.workerGroup !== undefined && { workerGroup: input.workerGroup }), + ...(input.hostname !== undefined && input.hostname !== null && { hostname: input.hostname }), + ...(input.instanceIdentity !== undefined && + input.instanceIdentity !== null && { + instanceIdentity: serializeAws_json1_1InstanceIdentity(input.instanceIdentity, context), + }), + ...(input.workerGroup !== undefined && input.workerGroup !== null && { workerGroup: input.workerGroup }), }; }; @@ -2044,46 +2076,53 @@ const serializeAws_json1_1PutPipelineDefinitionInput = ( context: __SerdeContext ): any => { return { - ...(input.parameterObjects !== undefined && { - parameterObjects: serializeAws_json1_1ParameterObjectList(input.parameterObjects, context), - }), - ...(input.parameterValues !== undefined && { - parameterValues: serializeAws_json1_1ParameterValueList(input.parameterValues, context), - }), - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), - ...(input.pipelineObjects !== undefined && { - pipelineObjects: serializeAws_json1_1PipelineObjectList(input.pipelineObjects, context), - }), + ...(input.parameterObjects !== undefined && + input.parameterObjects !== null && { + parameterObjects: serializeAws_json1_1ParameterObjectList(input.parameterObjects, context), + }), + ...(input.parameterValues !== undefined && + input.parameterValues !== null && { + parameterValues: serializeAws_json1_1ParameterValueList(input.parameterValues, context), + }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), + ...(input.pipelineObjects !== undefined && + input.pipelineObjects !== null && { + pipelineObjects: serializeAws_json1_1PipelineObjectList(input.pipelineObjects, context), + }), }; }; const serializeAws_json1_1Query = (input: Query, context: __SerdeContext): any => { return { - ...(input.selectors !== undefined && { selectors: serializeAws_json1_1SelectorList(input.selectors, context) }), + ...(input.selectors !== undefined && + input.selectors !== null && { selectors: serializeAws_json1_1SelectorList(input.selectors, context) }), }; }; const serializeAws_json1_1QueryObjectsInput = (input: QueryObjectsInput, context: __SerdeContext): any => { return { - ...(input.limit !== undefined && { limit: input.limit }), - ...(input.marker !== undefined && { marker: input.marker }), - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), - ...(input.query !== undefined && { query: serializeAws_json1_1Query(input.query, context) }), - ...(input.sphere !== undefined && { sphere: input.sphere }), + ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }), + ...(input.marker !== undefined && input.marker !== null && { marker: input.marker }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), + ...(input.query !== undefined && + input.query !== null && { query: serializeAws_json1_1Query(input.query, context) }), + ...(input.sphere !== undefined && input.sphere !== null && { sphere: input.sphere }), }; }; const serializeAws_json1_1RemoveTagsInput = (input: RemoveTagsInput, context: __SerdeContext): any => { return { - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1stringList(input.tagKeys, context) }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1stringList(input.tagKeys, context) }), }; }; const serializeAws_json1_1ReportTaskProgressInput = (input: ReportTaskProgressInput, context: __SerdeContext): any => { return { - ...(input.fields !== undefined && { fields: serializeAws_json1_1fieldList(input.fields, context) }), - ...(input.taskId !== undefined && { taskId: input.taskId }), + ...(input.fields !== undefined && + input.fields !== null && { fields: serializeAws_json1_1fieldList(input.fields, context) }), + ...(input.taskId !== undefined && input.taskId !== null && { taskId: input.taskId }), }; }; @@ -2092,54 +2131,78 @@ const serializeAws_json1_1ReportTaskRunnerHeartbeatInput = ( context: __SerdeContext ): any => { return { - ...(input.hostname !== undefined && { hostname: input.hostname }), - ...(input.taskrunnerId !== undefined && { taskrunnerId: input.taskrunnerId }), - ...(input.workerGroup !== undefined && { workerGroup: input.workerGroup }), + ...(input.hostname !== undefined && input.hostname !== null && { hostname: input.hostname }), + ...(input.taskrunnerId !== undefined && input.taskrunnerId !== null && { taskrunnerId: input.taskrunnerId }), + ...(input.workerGroup !== undefined && input.workerGroup !== null && { workerGroup: input.workerGroup }), }; }; const serializeAws_json1_1Selector = (input: Selector, context: __SerdeContext): any => { return { - ...(input.fieldName !== undefined && { fieldName: input.fieldName }), - ...(input.operator !== undefined && { operator: serializeAws_json1_1Operator(input.operator, context) }), + ...(input.fieldName !== undefined && input.fieldName !== null && { fieldName: input.fieldName }), + ...(input.operator !== undefined && + input.operator !== null && { operator: serializeAws_json1_1Operator(input.operator, context) }), }; }; const serializeAws_json1_1SelectorList = (input: Selector[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Selector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Selector(entry, context); + }); }; const serializeAws_json1_1SetStatusInput = (input: SetStatusInput, context: __SerdeContext): any => { return { - ...(input.objectIds !== undefined && { objectIds: serializeAws_json1_1idList(input.objectIds, context) }), - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), - ...(input.status !== undefined && { status: input.status }), + ...(input.objectIds !== undefined && + input.objectIds !== null && { objectIds: serializeAws_json1_1idList(input.objectIds, context) }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1SetTaskStatusInput = (input: SetTaskStatusInput, context: __SerdeContext): any => { return { - ...(input.errorId !== undefined && { errorId: input.errorId }), - ...(input.errorMessage !== undefined && { errorMessage: input.errorMessage }), - ...(input.errorStackTrace !== undefined && { errorStackTrace: input.errorStackTrace }), - ...(input.taskId !== undefined && { taskId: input.taskId }), - ...(input.taskStatus !== undefined && { taskStatus: input.taskStatus }), + ...(input.errorId !== undefined && input.errorId !== null && { errorId: input.errorId }), + ...(input.errorMessage !== undefined && input.errorMessage !== null && { errorMessage: input.errorMessage }), + ...(input.errorStackTrace !== undefined && + input.errorStackTrace !== null && { errorStackTrace: input.errorStackTrace }), + ...(input.taskId !== undefined && input.taskId !== null && { taskId: input.taskId }), + ...(input.taskStatus !== undefined && input.taskStatus !== null && { taskStatus: input.taskStatus }), }; }; const serializeAws_json1_1stringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1tagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1ValidatePipelineDefinitionInput = ( @@ -2147,16 +2210,19 @@ const serializeAws_json1_1ValidatePipelineDefinitionInput = ( context: __SerdeContext ): any => { return { - ...(input.parameterObjects !== undefined && { - parameterObjects: serializeAws_json1_1ParameterObjectList(input.parameterObjects, context), - }), - ...(input.parameterValues !== undefined && { - parameterValues: serializeAws_json1_1ParameterValueList(input.parameterValues, context), - }), - ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), - ...(input.pipelineObjects !== undefined && { - pipelineObjects: serializeAws_json1_1PipelineObjectList(input.pipelineObjects, context), - }), + ...(input.parameterObjects !== undefined && + input.parameterObjects !== null && { + parameterObjects: serializeAws_json1_1ParameterObjectList(input.parameterObjects, context), + }), + ...(input.parameterValues !== undefined && + input.parameterValues !== null && { + parameterValues: serializeAws_json1_1ParameterValueList(input.parameterValues, context), + }), + ...(input.pipelineId !== undefined && input.pipelineId !== null && { pipelineId: input.pipelineId }), + ...(input.pipelineObjects !== undefined && + input.pipelineObjects !== null && { + pipelineObjects: serializeAws_json1_1PipelineObjectList(input.pipelineObjects, context), + }), }; }; @@ -2226,7 +2292,14 @@ const deserializeAws_json1_1Field = (output: any, context: __SerdeContext): Fiel }; const deserializeAws_json1_1fieldList = (output: any, context: __SerdeContext): Field[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Field(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Field(entry, context); + }); }; const deserializeAws_json1_1GetPipelineDefinitionOutput = ( @@ -2250,7 +2323,14 @@ const deserializeAws_json1_1GetPipelineDefinitionOutput = ( }; const deserializeAws_json1_1idList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InternalServiceError = (output: any, context: __SerdeContext): InternalServiceError => { @@ -2288,7 +2368,14 @@ const deserializeAws_json1_1ParameterAttribute = (output: any, context: __SerdeC }; const deserializeAws_json1_1ParameterAttributeList = (output: any, context: __SerdeContext): ParameterAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParameterAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParameterAttribute(entry, context); + }); }; const deserializeAws_json1_1ParameterObject = (output: any, context: __SerdeContext): ParameterObject => { @@ -2302,7 +2389,14 @@ const deserializeAws_json1_1ParameterObject = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ParameterObjectList = (output: any, context: __SerdeContext): ParameterObject[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParameterObject(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParameterObject(entry, context); + }); }; const deserializeAws_json1_1ParameterValue = (output: any, context: __SerdeContext): ParameterValue => { @@ -2313,7 +2407,14 @@ const deserializeAws_json1_1ParameterValue = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ParameterValueList = (output: any, context: __SerdeContext): ParameterValue[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParameterValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParameterValue(entry, context); + }); }; const deserializeAws_json1_1PipelineDeletedException = ( @@ -2342,7 +2443,14 @@ const deserializeAws_json1_1PipelineDescription = (output: any, context: __Serde }; const deserializeAws_json1_1PipelineDescriptionList = (output: any, context: __SerdeContext): PipelineDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PipelineDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PipelineDescription(entry, context); + }); }; const deserializeAws_json1_1PipelineIdName = (output: any, context: __SerdeContext): PipelineIdName => { @@ -2353,7 +2461,14 @@ const deserializeAws_json1_1PipelineIdName = (output: any, context: __SerdeConte }; const deserializeAws_json1_1pipelineList = (output: any, context: __SerdeContext): PipelineIdName[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PipelineIdName(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PipelineIdName(entry, context); + }); }; const deserializeAws_json1_1PipelineNotFoundException = ( @@ -2377,20 +2492,29 @@ const deserializeAws_json1_1PipelineObject = (output: any, context: __SerdeConte }; const deserializeAws_json1_1PipelineObjectList = (output: any, context: __SerdeContext): PipelineObject[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PipelineObject(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PipelineObject(entry, context); + }); }; const deserializeAws_json1_1PipelineObjectMap = ( output: any, context: __SerdeContext ): { [key: string]: PipelineObject } => { - return Object.entries(output).reduce( - (acc: { [key: string]: PipelineObject }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: PipelineObject }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1PipelineObject(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1PollForTaskOutput = (output: any, context: __SerdeContext): PollForTaskOutput => { @@ -2463,7 +2587,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1tagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TaskNotFoundException = (output: any, context: __SerdeContext): TaskNotFoundException => { @@ -2512,11 +2643,25 @@ const deserializeAws_json1_1ValidationError = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ValidationErrors = (output: any, context: __SerdeContext): ValidationError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ValidationError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ValidationError(entry, context); + }); }; const deserializeAws_json1_1validationMessages = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ValidationWarning = (output: any, context: __SerdeContext): ValidationWarning => { @@ -2530,7 +2675,14 @@ const deserializeAws_json1_1ValidationWarning = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ValidationWarnings = (output: any, context: __SerdeContext): ValidationWarning[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ValidationWarning(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ValidationWarning(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2583,3 +2735,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-database-migration-service/protocols/Aws_json1_1.ts b/clients/client-database-migration-service/protocols/Aws_json1_1.ts index 1b7c618a18ca..6e54b4a617e2 100644 --- a/clients/client-database-migration-service/protocols/Aws_json1_1.ts +++ b/clients/client-database-migration-service/protocols/Aws_json1_1.ts @@ -368,7 +368,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.AddTagsToResource", }; let body: any; @@ -381,7 +381,7 @@ export const serializeAws_json1_1ApplyPendingMaintenanceActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.ApplyPendingMaintenanceAction", }; let body: any; @@ -394,7 +394,7 @@ export const serializeAws_json1_1CancelReplicationTaskAssessmentRunCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.CancelReplicationTaskAssessmentRun", }; let body: any; @@ -407,7 +407,7 @@ export const serializeAws_json1_1CreateEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.CreateEndpoint", }; let body: any; @@ -420,7 +420,7 @@ export const serializeAws_json1_1CreateEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.CreateEventSubscription", }; let body: any; @@ -433,7 +433,7 @@ export const serializeAws_json1_1CreateReplicationInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.CreateReplicationInstance", }; let body: any; @@ -446,7 +446,7 @@ export const serializeAws_json1_1CreateReplicationSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.CreateReplicationSubnetGroup", }; let body: any; @@ -459,7 +459,7 @@ export const serializeAws_json1_1CreateReplicationTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.CreateReplicationTask", }; let body: any; @@ -472,7 +472,7 @@ export const serializeAws_json1_1DeleteCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DeleteCertificate", }; let body: any; @@ -485,7 +485,7 @@ export const serializeAws_json1_1DeleteConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DeleteConnection", }; let body: any; @@ -498,7 +498,7 @@ export const serializeAws_json1_1DeleteEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DeleteEndpoint", }; let body: any; @@ -511,7 +511,7 @@ export const serializeAws_json1_1DeleteEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DeleteEventSubscription", }; let body: any; @@ -524,7 +524,7 @@ export const serializeAws_json1_1DeleteReplicationInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DeleteReplicationInstance", }; let body: any; @@ -537,7 +537,7 @@ export const serializeAws_json1_1DeleteReplicationSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DeleteReplicationSubnetGroup", }; let body: any; @@ -550,7 +550,7 @@ export const serializeAws_json1_1DeleteReplicationTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DeleteReplicationTask", }; let body: any; @@ -563,7 +563,7 @@ export const serializeAws_json1_1DeleteReplicationTaskAssessmentRunCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DeleteReplicationTaskAssessmentRun", }; let body: any; @@ -576,7 +576,7 @@ export const serializeAws_json1_1DescribeAccountAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeAccountAttributes", }; let body: any; @@ -589,7 +589,7 @@ export const serializeAws_json1_1DescribeApplicableIndividualAssessmentsCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeApplicableIndividualAssessments", }; let body: any; @@ -602,7 +602,7 @@ export const serializeAws_json1_1DescribeCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeCertificates", }; let body: any; @@ -615,7 +615,7 @@ export const serializeAws_json1_1DescribeConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeConnections", }; let body: any; @@ -628,7 +628,7 @@ export const serializeAws_json1_1DescribeEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeEndpoints", }; let body: any; @@ -641,7 +641,7 @@ export const serializeAws_json1_1DescribeEndpointTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeEndpointTypes", }; let body: any; @@ -654,7 +654,7 @@ export const serializeAws_json1_1DescribeEventCategoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeEventCategories", }; let body: any; @@ -667,7 +667,7 @@ export const serializeAws_json1_1DescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeEvents", }; let body: any; @@ -680,7 +680,7 @@ export const serializeAws_json1_1DescribeEventSubscriptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeEventSubscriptions", }; let body: any; @@ -693,7 +693,7 @@ export const serializeAws_json1_1DescribeOrderableReplicationInstancesCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeOrderableReplicationInstances", }; let body: any; @@ -706,7 +706,7 @@ export const serializeAws_json1_1DescribePendingMaintenanceActionsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribePendingMaintenanceActions", }; let body: any; @@ -719,7 +719,7 @@ export const serializeAws_json1_1DescribeRefreshSchemasStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeRefreshSchemasStatus", }; let body: any; @@ -732,7 +732,7 @@ export const serializeAws_json1_1DescribeReplicationInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeReplicationInstances", }; let body: any; @@ -745,7 +745,7 @@ export const serializeAws_json1_1DescribeReplicationInstanceTaskLogsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeReplicationInstanceTaskLogs", }; let body: any; @@ -758,7 +758,7 @@ export const serializeAws_json1_1DescribeReplicationSubnetGroupsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeReplicationSubnetGroups", }; let body: any; @@ -771,7 +771,7 @@ export const serializeAws_json1_1DescribeReplicationTaskAssessmentResultsCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeReplicationTaskAssessmentResults", }; let body: any; @@ -784,7 +784,7 @@ export const serializeAws_json1_1DescribeReplicationTaskAssessmentRunsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeReplicationTaskAssessmentRuns", }; let body: any; @@ -797,7 +797,7 @@ export const serializeAws_json1_1DescribeReplicationTaskIndividualAssessmentsCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeReplicationTaskIndividualAssessments", }; let body: any; @@ -810,7 +810,7 @@ export const serializeAws_json1_1DescribeReplicationTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeReplicationTasks", }; let body: any; @@ -823,7 +823,7 @@ export const serializeAws_json1_1DescribeSchemasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeSchemas", }; let body: any; @@ -836,7 +836,7 @@ export const serializeAws_json1_1DescribeTableStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.DescribeTableStatistics", }; let body: any; @@ -849,7 +849,7 @@ export const serializeAws_json1_1ImportCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.ImportCertificate", }; let body: any; @@ -862,7 +862,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.ListTagsForResource", }; let body: any; @@ -875,7 +875,7 @@ export const serializeAws_json1_1ModifyEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.ModifyEndpoint", }; let body: any; @@ -888,7 +888,7 @@ export const serializeAws_json1_1ModifyEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.ModifyEventSubscription", }; let body: any; @@ -901,7 +901,7 @@ export const serializeAws_json1_1ModifyReplicationInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.ModifyReplicationInstance", }; let body: any; @@ -914,7 +914,7 @@ export const serializeAws_json1_1ModifyReplicationSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.ModifyReplicationSubnetGroup", }; let body: any; @@ -927,7 +927,7 @@ export const serializeAws_json1_1ModifyReplicationTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.ModifyReplicationTask", }; let body: any; @@ -940,7 +940,7 @@ export const serializeAws_json1_1MoveReplicationTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.MoveReplicationTask", }; let body: any; @@ -953,7 +953,7 @@ export const serializeAws_json1_1RebootReplicationInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.RebootReplicationInstance", }; let body: any; @@ -966,7 +966,7 @@ export const serializeAws_json1_1RefreshSchemasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.RefreshSchemas", }; let body: any; @@ -979,7 +979,7 @@ export const serializeAws_json1_1ReloadTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.ReloadTables", }; let body: any; @@ -992,7 +992,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.RemoveTagsFromResource", }; let body: any; @@ -1005,7 +1005,7 @@ export const serializeAws_json1_1StartReplicationTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.StartReplicationTask", }; let body: any; @@ -1018,7 +1018,7 @@ export const serializeAws_json1_1StartReplicationTaskAssessmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.StartReplicationTaskAssessment", }; let body: any; @@ -1031,7 +1031,7 @@ export const serializeAws_json1_1StartReplicationTaskAssessmentRunCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.StartReplicationTaskAssessmentRun", }; let body: any; @@ -1044,7 +1044,7 @@ export const serializeAws_json1_1StopReplicationTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.StopReplicationTask", }; let body: any; @@ -1057,7 +1057,7 @@ export const serializeAws_json1_1TestConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDMSv20160101.TestConnection", }; let body: any; @@ -1092,8 +1092,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -1147,8 +1146,7 @@ const deserializeAws_json1_1ApplyPendingMaintenanceActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -1202,8 +1200,7 @@ const deserializeAws_json1_1CancelReplicationTaskAssessmentRunCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -1273,8 +1270,7 @@ const deserializeAws_json1_1CreateEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -1376,8 +1372,7 @@ const deserializeAws_json1_1CreateEventSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "KMSAccessDeniedFault": case "com.amazonaws.databasemigrationservice#KMSAccessDeniedFault": @@ -1503,8 +1498,7 @@ const deserializeAws_json1_1CreateReplicationInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -1630,8 +1624,7 @@ const deserializeAws_json1_1CreateReplicationSubnetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -1725,8 +1718,7 @@ const deserializeAws_json1_1CreateReplicationTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -1820,8 +1812,7 @@ const deserializeAws_json1_1DeleteCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -1883,8 +1874,7 @@ const deserializeAws_json1_1DeleteConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -1954,8 +1944,7 @@ const deserializeAws_json1_1DeleteEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -2017,8 +2006,7 @@ const deserializeAws_json1_1DeleteEventSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -2080,8 +2068,7 @@ const deserializeAws_json1_1DeleteReplicationInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -2143,8 +2130,7 @@ const deserializeAws_json1_1DeleteReplicationSubnetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -2206,8 +2192,7 @@ const deserializeAws_json1_1DeleteReplicationTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -2269,8 +2254,7 @@ const deserializeAws_json1_1DeleteReplicationTaskAssessmentRunCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -2340,8 +2324,7 @@ const deserializeAws_json1_1DescribeAccountAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -2387,8 +2370,7 @@ const deserializeAws_json1_1DescribeApplicableIndividualAssessmentsCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -2458,8 +2440,7 @@ const deserializeAws_json1_1DescribeCertificatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -2513,8 +2494,7 @@ const deserializeAws_json1_1DescribeConnectionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -2568,8 +2548,7 @@ const deserializeAws_json1_1DescribeEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -2623,8 +2602,7 @@ const deserializeAws_json1_1DescribeEndpointTypesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -2670,8 +2648,7 @@ const deserializeAws_json1_1DescribeEventCategoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -2717,8 +2694,7 @@ const deserializeAws_json1_1DescribeEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -2764,8 +2740,7 @@ const deserializeAws_json1_1DescribeEventSubscriptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -2819,8 +2794,7 @@ const deserializeAws_json1_1DescribeOrderableReplicationInstancesCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -2866,8 +2840,7 @@ const deserializeAws_json1_1DescribePendingMaintenanceActionsCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -2921,8 +2894,7 @@ const deserializeAws_json1_1DescribeRefreshSchemasStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -2984,8 +2956,7 @@ const deserializeAws_json1_1DescribeReplicationInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -3039,8 +3010,7 @@ const deserializeAws_json1_1DescribeReplicationInstanceTaskLogsCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -3102,8 +3072,7 @@ const deserializeAws_json1_1DescribeReplicationSubnetGroupsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -3157,8 +3126,7 @@ const deserializeAws_json1_1DescribeReplicationTaskAssessmentResultsCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -3212,8 +3180,7 @@ const deserializeAws_json1_1DescribeReplicationTaskAssessmentRunsCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -3267,8 +3234,7 @@ const deserializeAws_json1_1DescribeReplicationTaskIndividualAssessmentsCommandE }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -3322,8 +3288,7 @@ const deserializeAws_json1_1DescribeReplicationTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -3377,8 +3342,7 @@ const deserializeAws_json1_1DescribeSchemasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -3440,8 +3404,7 @@ const deserializeAws_json1_1DescribeTableStatisticsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -3503,8 +3466,7 @@ const deserializeAws_json1_1ImportCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidCertificateFault": case "com.amazonaws.databasemigrationservice#InvalidCertificateFault": @@ -3574,8 +3536,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -3629,8 +3590,7 @@ const deserializeAws_json1_1ModifyEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -3716,8 +3676,7 @@ const deserializeAws_json1_1ModifyEventSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "KMSAccessDeniedFault": case "com.amazonaws.databasemigrationservice#KMSAccessDeniedFault": @@ -3835,8 +3794,7 @@ const deserializeAws_json1_1ModifyReplicationInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -3938,8 +3896,7 @@ const deserializeAws_json1_1ModifyReplicationSubnetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -4033,8 +3990,7 @@ const deserializeAws_json1_1ModifyReplicationTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -4112,8 +4068,7 @@ const deserializeAws_json1_1MoveReplicationTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -4183,8 +4138,7 @@ const deserializeAws_json1_1RebootReplicationInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -4246,8 +4200,7 @@ const deserializeAws_json1_1RefreshSchemasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -4325,8 +4278,7 @@ const deserializeAws_json1_1ReloadTablesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -4388,8 +4340,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundFault": case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": @@ -4443,8 +4394,7 @@ const deserializeAws_json1_1StartReplicationTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -4514,8 +4464,7 @@ const deserializeAws_json1_1StartReplicationTaskAssessmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -4577,8 +4526,7 @@ const deserializeAws_json1_1StartReplicationTaskAssessmentRunCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": @@ -4720,8 +4668,7 @@ const deserializeAws_json1_1StopReplicationTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -4783,8 +4730,7 @@ const deserializeAws_json1_1TestConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": @@ -5185,8 +5131,8 @@ const serializeAws_json1_1AddTagsToResourceMessage = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -5195,9 +5141,10 @@ const serializeAws_json1_1ApplyPendingMaintenanceActionMessage = ( context: __SerdeContext ): any => { return { - ...(input.ApplyAction !== undefined && { ApplyAction: input.ApplyAction }), - ...(input.OptInType !== undefined && { OptInType: input.OptInType }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.ApplyAction !== undefined && input.ApplyAction !== null && { ApplyAction: input.ApplyAction }), + ...(input.OptInType !== undefined && input.OptInType !== null && { OptInType: input.OptInType }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), }; }; @@ -5206,81 +5153,102 @@ const serializeAws_json1_1CancelReplicationTaskAssessmentRunMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationTaskAssessmentRunArn !== undefined && { - ReplicationTaskAssessmentRunArn: input.ReplicationTaskAssessmentRunArn, - }), + ...(input.ReplicationTaskAssessmentRunArn !== undefined && + input.ReplicationTaskAssessmentRunArn !== null && { + ReplicationTaskAssessmentRunArn: input.ReplicationTaskAssessmentRunArn, + }), }; }; const serializeAws_json1_1CreateEndpointMessage = (input: CreateEndpointMessage, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.DmsTransferSettings !== undefined && { - DmsTransferSettings: serializeAws_json1_1DmsTransferSettings(input.DmsTransferSettings, context), - }), - ...(input.DocDbSettings !== undefined && { - DocDbSettings: serializeAws_json1_1DocDbSettings(input.DocDbSettings, context), - }), - ...(input.DynamoDbSettings !== undefined && { - DynamoDbSettings: serializeAws_json1_1DynamoDbSettings(input.DynamoDbSettings, context), - }), - ...(input.ElasticsearchSettings !== undefined && { - ElasticsearchSettings: serializeAws_json1_1ElasticsearchSettings(input.ElasticsearchSettings, context), - }), - ...(input.EndpointIdentifier !== undefined && { EndpointIdentifier: input.EndpointIdentifier }), - ...(input.EndpointType !== undefined && { EndpointType: input.EndpointType }), - ...(input.EngineName !== undefined && { EngineName: input.EngineName }), - ...(input.ExternalTableDefinition !== undefined && { ExternalTableDefinition: input.ExternalTableDefinition }), - ...(input.ExtraConnectionAttributes !== undefined && { - ExtraConnectionAttributes: input.ExtraConnectionAttributes, - }), - ...(input.IBMDb2Settings !== undefined && { - IBMDb2Settings: serializeAws_json1_1IBMDb2Settings(input.IBMDb2Settings, context), - }), - ...(input.KafkaSettings !== undefined && { - KafkaSettings: serializeAws_json1_1KafkaSettings(input.KafkaSettings, context), - }), - ...(input.KinesisSettings !== undefined && { - KinesisSettings: serializeAws_json1_1KinesisSettings(input.KinesisSettings, context), - }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.MicrosoftSQLServerSettings !== undefined && { - MicrosoftSQLServerSettings: serializeAws_json1_1MicrosoftSQLServerSettings( - input.MicrosoftSQLServerSettings, - context - ), - }), - ...(input.MongoDbSettings !== undefined && { - MongoDbSettings: serializeAws_json1_1MongoDbSettings(input.MongoDbSettings, context), - }), - ...(input.MySQLSettings !== undefined && { - MySQLSettings: serializeAws_json1_1MySQLSettings(input.MySQLSettings, context), - }), - ...(input.NeptuneSettings !== undefined && { - NeptuneSettings: serializeAws_json1_1NeptuneSettings(input.NeptuneSettings, context), - }), - ...(input.OracleSettings !== undefined && { - OracleSettings: serializeAws_json1_1OracleSettings(input.OracleSettings, context), - }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.PostgreSQLSettings !== undefined && { - PostgreSQLSettings: serializeAws_json1_1PostgreSQLSettings(input.PostgreSQLSettings, context), - }), - ...(input.RedshiftSettings !== undefined && { - RedshiftSettings: serializeAws_json1_1RedshiftSettings(input.RedshiftSettings, context), - }), - ...(input.ResourceIdentifier !== undefined && { ResourceIdentifier: input.ResourceIdentifier }), - ...(input.S3Settings !== undefined && { S3Settings: serializeAws_json1_1S3Settings(input.S3Settings, context) }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), - ...(input.SslMode !== undefined && { SslMode: input.SslMode }), - ...(input.SybaseSettings !== undefined && { - SybaseSettings: serializeAws_json1_1SybaseSettings(input.SybaseSettings, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.DmsTransferSettings !== undefined && + input.DmsTransferSettings !== null && { + DmsTransferSettings: serializeAws_json1_1DmsTransferSettings(input.DmsTransferSettings, context), + }), + ...(input.DocDbSettings !== undefined && + input.DocDbSettings !== null && { + DocDbSettings: serializeAws_json1_1DocDbSettings(input.DocDbSettings, context), + }), + ...(input.DynamoDbSettings !== undefined && + input.DynamoDbSettings !== null && { + DynamoDbSettings: serializeAws_json1_1DynamoDbSettings(input.DynamoDbSettings, context), + }), + ...(input.ElasticsearchSettings !== undefined && + input.ElasticsearchSettings !== null && { + ElasticsearchSettings: serializeAws_json1_1ElasticsearchSettings(input.ElasticsearchSettings, context), + }), + ...(input.EndpointIdentifier !== undefined && + input.EndpointIdentifier !== null && { EndpointIdentifier: input.EndpointIdentifier }), + ...(input.EndpointType !== undefined && input.EndpointType !== null && { EndpointType: input.EndpointType }), + ...(input.EngineName !== undefined && input.EngineName !== null && { EngineName: input.EngineName }), + ...(input.ExternalTableDefinition !== undefined && + input.ExternalTableDefinition !== null && { ExternalTableDefinition: input.ExternalTableDefinition }), + ...(input.ExtraConnectionAttributes !== undefined && + input.ExtraConnectionAttributes !== null && { ExtraConnectionAttributes: input.ExtraConnectionAttributes }), + ...(input.IBMDb2Settings !== undefined && + input.IBMDb2Settings !== null && { + IBMDb2Settings: serializeAws_json1_1IBMDb2Settings(input.IBMDb2Settings, context), + }), + ...(input.KafkaSettings !== undefined && + input.KafkaSettings !== null && { + KafkaSettings: serializeAws_json1_1KafkaSettings(input.KafkaSettings, context), + }), + ...(input.KinesisSettings !== undefined && + input.KinesisSettings !== null && { + KinesisSettings: serializeAws_json1_1KinesisSettings(input.KinesisSettings, context), + }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.MicrosoftSQLServerSettings !== undefined && + input.MicrosoftSQLServerSettings !== null && { + MicrosoftSQLServerSettings: serializeAws_json1_1MicrosoftSQLServerSettings( + input.MicrosoftSQLServerSettings, + context + ), + }), + ...(input.MongoDbSettings !== undefined && + input.MongoDbSettings !== null && { + MongoDbSettings: serializeAws_json1_1MongoDbSettings(input.MongoDbSettings, context), + }), + ...(input.MySQLSettings !== undefined && + input.MySQLSettings !== null && { + MySQLSettings: serializeAws_json1_1MySQLSettings(input.MySQLSettings, context), + }), + ...(input.NeptuneSettings !== undefined && + input.NeptuneSettings !== null && { + NeptuneSettings: serializeAws_json1_1NeptuneSettings(input.NeptuneSettings, context), + }), + ...(input.OracleSettings !== undefined && + input.OracleSettings !== null && { + OracleSettings: serializeAws_json1_1OracleSettings(input.OracleSettings, context), + }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.PostgreSQLSettings !== undefined && + input.PostgreSQLSettings !== null && { + PostgreSQLSettings: serializeAws_json1_1PostgreSQLSettings(input.PostgreSQLSettings, context), + }), + ...(input.RedshiftSettings !== undefined && + input.RedshiftSettings !== null && { + RedshiftSettings: serializeAws_json1_1RedshiftSettings(input.RedshiftSettings, context), + }), + ...(input.ResourceIdentifier !== undefined && + input.ResourceIdentifier !== null && { ResourceIdentifier: input.ResourceIdentifier }), + ...(input.S3Settings !== undefined && + input.S3Settings !== null && { S3Settings: serializeAws_json1_1S3Settings(input.S3Settings, context) }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.SslMode !== undefined && input.SslMode !== null && { SslMode: input.SslMode }), + ...(input.SybaseSettings !== undefined && + input.SybaseSettings !== null && { + SybaseSettings: serializeAws_json1_1SybaseSettings(input.SybaseSettings, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -5289,15 +5257,18 @@ const serializeAws_json1_1CreateEventSubscriptionMessage = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.EventCategories !== undefined && { - EventCategories: serializeAws_json1_1EventCategoriesList(input.EventCategories, context), - }), - ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), - ...(input.SourceIds !== undefined && { SourceIds: serializeAws_json1_1SourceIdsList(input.SourceIds, context) }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), - ...(input.SubscriptionName !== undefined && { SubscriptionName: input.SubscriptionName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.EventCategories !== undefined && + input.EventCategories !== null && { + EventCategories: serializeAws_json1_1EventCategoriesList(input.EventCategories, context), + }), + ...(input.SnsTopicArn !== undefined && input.SnsTopicArn !== null && { SnsTopicArn: input.SnsTopicArn }), + ...(input.SourceIds !== undefined && + input.SourceIds !== null && { SourceIds: serializeAws_json1_1SourceIdsList(input.SourceIds, context) }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), + ...(input.SubscriptionName !== undefined && + input.SubscriptionName !== null && { SubscriptionName: input.SubscriptionName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -5306,29 +5277,38 @@ const serializeAws_json1_1CreateReplicationInstanceMessage = ( context: __SerdeContext ): any => { return { - ...(input.AllocatedStorage !== undefined && { AllocatedStorage: input.AllocatedStorage }), - ...(input.AutoMinorVersionUpgrade !== undefined && { AutoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.DnsNameServers !== undefined && { DnsNameServers: input.DnsNameServers }), - ...(input.EngineVersion !== undefined && { EngineVersion: input.EngineVersion }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.MultiAZ !== undefined && { MultiAZ: input.MultiAZ }), - ...(input.PreferredMaintenanceWindow !== undefined && { - PreferredMaintenanceWindow: input.PreferredMaintenanceWindow, - }), - ...(input.PubliclyAccessible !== undefined && { PubliclyAccessible: input.PubliclyAccessible }), - ...(input.ReplicationInstanceClass !== undefined && { ReplicationInstanceClass: input.ReplicationInstanceClass }), - ...(input.ReplicationInstanceIdentifier !== undefined && { - ReplicationInstanceIdentifier: input.ReplicationInstanceIdentifier, - }), - ...(input.ReplicationSubnetGroupIdentifier !== undefined && { - ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier, - }), - ...(input.ResourceIdentifier !== undefined && { ResourceIdentifier: input.ResourceIdentifier }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VpcSecurityGroupIds !== undefined && { - VpcSecurityGroupIds: serializeAws_json1_1VpcSecurityGroupIdList(input.VpcSecurityGroupIds, context), - }), + ...(input.AllocatedStorage !== undefined && + input.AllocatedStorage !== null && { AllocatedStorage: input.AllocatedStorage }), + ...(input.AutoMinorVersionUpgrade !== undefined && + input.AutoMinorVersionUpgrade !== null && { AutoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.DnsNameServers !== undefined && + input.DnsNameServers !== null && { DnsNameServers: input.DnsNameServers }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { EngineVersion: input.EngineVersion }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.MultiAZ !== undefined && input.MultiAZ !== null && { MultiAZ: input.MultiAZ }), + ...(input.PreferredMaintenanceWindow !== undefined && + input.PreferredMaintenanceWindow !== null && { PreferredMaintenanceWindow: input.PreferredMaintenanceWindow }), + ...(input.PubliclyAccessible !== undefined && + input.PubliclyAccessible !== null && { PubliclyAccessible: input.PubliclyAccessible }), + ...(input.ReplicationInstanceClass !== undefined && + input.ReplicationInstanceClass !== null && { ReplicationInstanceClass: input.ReplicationInstanceClass }), + ...(input.ReplicationInstanceIdentifier !== undefined && + input.ReplicationInstanceIdentifier !== null && { + ReplicationInstanceIdentifier: input.ReplicationInstanceIdentifier, + }), + ...(input.ReplicationSubnetGroupIdentifier !== undefined && + input.ReplicationSubnetGroupIdentifier !== null && { + ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier, + }), + ...(input.ResourceIdentifier !== undefined && + input.ResourceIdentifier !== null && { ResourceIdentifier: input.ResourceIdentifier }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VpcSecurityGroupIds !== undefined && + input.VpcSecurityGroupIds !== null && { + VpcSecurityGroupIds: serializeAws_json1_1VpcSecurityGroupIdList(input.VpcSecurityGroupIds, context), + }), }; }; @@ -5337,16 +5317,17 @@ const serializeAws_json1_1CreateReplicationSubnetGroupMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationSubnetGroupDescription !== undefined && { - ReplicationSubnetGroupDescription: input.ReplicationSubnetGroupDescription, - }), - ...(input.ReplicationSubnetGroupIdentifier !== undefined && { - ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier, - }), - ...(input.SubnetIds !== undefined && { - SubnetIds: serializeAws_json1_1SubnetIdentifierList(input.SubnetIds, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ReplicationSubnetGroupDescription !== undefined && + input.ReplicationSubnetGroupDescription !== null && { + ReplicationSubnetGroupDescription: input.ReplicationSubnetGroupDescription, + }), + ...(input.ReplicationSubnetGroupIdentifier !== undefined && + input.ReplicationSubnetGroupIdentifier !== null && { + ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier, + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIdentifierList(input.SubnetIds, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -5355,21 +5336,28 @@ const serializeAws_json1_1CreateReplicationTaskMessage = ( context: __SerdeContext ): any => { return { - ...(input.CdcStartPosition !== undefined && { CdcStartPosition: input.CdcStartPosition }), - ...(input.CdcStartTime !== undefined && { CdcStartTime: Math.round(input.CdcStartTime.getTime() / 1000) }), - ...(input.CdcStopPosition !== undefined && { CdcStopPosition: input.CdcStopPosition }), - ...(input.MigrationType !== undefined && { MigrationType: input.MigrationType }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), - ...(input.ReplicationTaskIdentifier !== undefined && { - ReplicationTaskIdentifier: input.ReplicationTaskIdentifier, - }), - ...(input.ReplicationTaskSettings !== undefined && { ReplicationTaskSettings: input.ReplicationTaskSettings }), - ...(input.ResourceIdentifier !== undefined && { ResourceIdentifier: input.ResourceIdentifier }), - ...(input.SourceEndpointArn !== undefined && { SourceEndpointArn: input.SourceEndpointArn }), - ...(input.TableMappings !== undefined && { TableMappings: input.TableMappings }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TargetEndpointArn !== undefined && { TargetEndpointArn: input.TargetEndpointArn }), - ...(input.TaskData !== undefined && { TaskData: input.TaskData }), + ...(input.CdcStartPosition !== undefined && + input.CdcStartPosition !== null && { CdcStartPosition: input.CdcStartPosition }), + ...(input.CdcStartTime !== undefined && + input.CdcStartTime !== null && { CdcStartTime: Math.round(input.CdcStartTime.getTime() / 1000) }), + ...(input.CdcStopPosition !== undefined && + input.CdcStopPosition !== null && { CdcStopPosition: input.CdcStopPosition }), + ...(input.MigrationType !== undefined && input.MigrationType !== null && { MigrationType: input.MigrationType }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.ReplicationTaskIdentifier !== undefined && + input.ReplicationTaskIdentifier !== null && { ReplicationTaskIdentifier: input.ReplicationTaskIdentifier }), + ...(input.ReplicationTaskSettings !== undefined && + input.ReplicationTaskSettings !== null && { ReplicationTaskSettings: input.ReplicationTaskSettings }), + ...(input.ResourceIdentifier !== undefined && + input.ResourceIdentifier !== null && { ResourceIdentifier: input.ResourceIdentifier }), + ...(input.SourceEndpointArn !== undefined && + input.SourceEndpointArn !== null && { SourceEndpointArn: input.SourceEndpointArn }), + ...(input.TableMappings !== undefined && input.TableMappings !== null && { TableMappings: input.TableMappings }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TargetEndpointArn !== undefined && + input.TargetEndpointArn !== null && { TargetEndpointArn: input.TargetEndpointArn }), + ...(input.TaskData !== undefined && input.TaskData !== null && { TaskData: input.TaskData }), }; }; @@ -5378,20 +5366,22 @@ const serializeAws_json1_1DeleteCertificateMessage = ( context: __SerdeContext ): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), }; }; const serializeAws_json1_1DeleteConnectionMessage = (input: DeleteConnectionMessage, context: __SerdeContext): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), }; }; const serializeAws_json1_1DeleteEndpointMessage = (input: DeleteEndpointMessage, context: __SerdeContext): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), }; }; @@ -5400,7 +5390,8 @@ const serializeAws_json1_1DeleteEventSubscriptionMessage = ( context: __SerdeContext ): any => { return { - ...(input.SubscriptionName !== undefined && { SubscriptionName: input.SubscriptionName }), + ...(input.SubscriptionName !== undefined && + input.SubscriptionName !== null && { SubscriptionName: input.SubscriptionName }), }; }; @@ -5409,7 +5400,8 @@ const serializeAws_json1_1DeleteReplicationInstanceMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), }; }; @@ -5418,9 +5410,10 @@ const serializeAws_json1_1DeleteReplicationSubnetGroupMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationSubnetGroupIdentifier !== undefined && { - ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier, - }), + ...(input.ReplicationSubnetGroupIdentifier !== undefined && + input.ReplicationSubnetGroupIdentifier !== null && { + ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier, + }), }; }; @@ -5429,9 +5422,10 @@ const serializeAws_json1_1DeleteReplicationTaskAssessmentRunMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationTaskAssessmentRunArn !== undefined && { - ReplicationTaskAssessmentRunArn: input.ReplicationTaskAssessmentRunArn, - }), + ...(input.ReplicationTaskAssessmentRunArn !== undefined && + input.ReplicationTaskAssessmentRunArn !== null && { + ReplicationTaskAssessmentRunArn: input.ReplicationTaskAssessmentRunArn, + }), }; }; @@ -5440,7 +5434,8 @@ const serializeAws_json1_1DeleteReplicationTaskMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), }; }; @@ -5456,13 +5451,17 @@ const serializeAws_json1_1DescribeApplicableIndividualAssessmentsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), - ...(input.MigrationType !== undefined && { MigrationType: input.MigrationType }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), - ...(input.SourceEngineName !== undefined && { SourceEngineName: input.SourceEngineName }), - ...(input.TargetEngineName !== undefined && { TargetEngineName: input.TargetEngineName }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), + ...(input.MigrationType !== undefined && input.MigrationType !== null && { MigrationType: input.MigrationType }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.SourceEngineName !== undefined && + input.SourceEngineName !== null && { SourceEngineName: input.SourceEngineName }), + ...(input.TargetEngineName !== undefined && + input.TargetEngineName !== null && { TargetEngineName: input.TargetEngineName }), }; }; @@ -5471,9 +5470,10 @@ const serializeAws_json1_1DescribeCertificatesMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5482,9 +5482,10 @@ const serializeAws_json1_1DescribeConnectionsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5493,9 +5494,10 @@ const serializeAws_json1_1DescribeEndpointsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5504,9 +5506,10 @@ const serializeAws_json1_1DescribeEndpointTypesMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5515,24 +5518,30 @@ const serializeAws_json1_1DescribeEventCategoriesMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), }; }; const serializeAws_json1_1DescribeEventsMessage = (input: DescribeEventsMessage, context: __SerdeContext): any => { return { - ...(input.Duration !== undefined && { Duration: input.Duration }), - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.EventCategories !== undefined && { - EventCategories: serializeAws_json1_1EventCategoriesList(input.EventCategories, context), - }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), - ...(input.SourceIdentifier !== undefined && { SourceIdentifier: input.SourceIdentifier }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.Duration !== undefined && input.Duration !== null && { Duration: input.Duration }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.EventCategories !== undefined && + input.EventCategories !== null && { + EventCategories: serializeAws_json1_1EventCategoriesList(input.EventCategories, context), + }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), + ...(input.SourceIdentifier !== undefined && + input.SourceIdentifier !== null && { SourceIdentifier: input.SourceIdentifier }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; @@ -5541,10 +5550,12 @@ const serializeAws_json1_1DescribeEventSubscriptionsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), - ...(input.SubscriptionName !== undefined && { SubscriptionName: input.SubscriptionName }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), + ...(input.SubscriptionName !== undefined && + input.SubscriptionName !== null && { SubscriptionName: input.SubscriptionName }), }; }; @@ -5553,8 +5564,8 @@ const serializeAws_json1_1DescribeOrderableReplicationInstancesMessage = ( context: __SerdeContext ): any => { return { - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5563,10 +5574,12 @@ const serializeAws_json1_1DescribePendingMaintenanceActionsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), }; }; @@ -5575,7 +5588,7 @@ const serializeAws_json1_1DescribeRefreshSchemasStatusMessage = ( context: __SerdeContext ): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), }; }; @@ -5584,9 +5597,10 @@ const serializeAws_json1_1DescribeReplicationInstancesMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5595,9 +5609,10 @@ const serializeAws_json1_1DescribeReplicationInstanceTaskLogsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), }; }; @@ -5606,9 +5621,10 @@ const serializeAws_json1_1DescribeReplicationSubnetGroupsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5617,9 +5633,10 @@ const serializeAws_json1_1DescribeReplicationTaskAssessmentResultsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), }; }; @@ -5628,9 +5645,10 @@ const serializeAws_json1_1DescribeReplicationTaskAssessmentRunsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5639,9 +5657,10 @@ const serializeAws_json1_1DescribeReplicationTaskIndividualAssessmentsMessage = context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5650,18 +5669,20 @@ const serializeAws_json1_1DescribeReplicationTasksMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), - ...(input.WithoutSettings !== undefined && { WithoutSettings: input.WithoutSettings }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), + ...(input.WithoutSettings !== undefined && + input.WithoutSettings !== null && { WithoutSettings: input.WithoutSettings }), }; }; const serializeAws_json1_1DescribeSchemasMessage = (input: DescribeSchemasMessage, context: __SerdeContext): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), }; }; @@ -5670,82 +5691,121 @@ const serializeAws_json1_1DescribeTableStatisticsMessage = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && input.MaxRecords !== null && { MaxRecords: input.MaxRecords }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), }; }; const serializeAws_json1_1DmsTransferSettings = (input: DmsTransferSettings, context: __SerdeContext): any => { return { - ...(input.BucketName !== undefined && { BucketName: input.BucketName }), - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.BucketName !== undefined && input.BucketName !== null && { BucketName: input.BucketName }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), }; }; const serializeAws_json1_1DocDbSettings = (input: DocDbSettings, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.DocsToInvestigate !== undefined && { DocsToInvestigate: input.DocsToInvestigate }), - ...(input.ExtractDocId !== undefined && { ExtractDocId: input.ExtractDocId }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.NestingLevel !== undefined && { NestingLevel: input.NestingLevel }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.DocsToInvestigate !== undefined && + input.DocsToInvestigate !== null && { DocsToInvestigate: input.DocsToInvestigate }), + ...(input.ExtractDocId !== undefined && input.ExtractDocId !== null && { ExtractDocId: input.ExtractDocId }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.NestingLevel !== undefined && input.NestingLevel !== null && { NestingLevel: input.NestingLevel }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1DynamoDbSettings = (input: DynamoDbSettings, context: __SerdeContext): any => { return { - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), }; }; const serializeAws_json1_1ElasticsearchSettings = (input: ElasticsearchSettings, context: __SerdeContext): any => { return { - ...(input.EndpointUri !== undefined && { EndpointUri: input.EndpointUri }), - ...(input.ErrorRetryDuration !== undefined && { ErrorRetryDuration: input.ErrorRetryDuration }), - ...(input.FullLoadErrorPercentage !== undefined && { FullLoadErrorPercentage: input.FullLoadErrorPercentage }), - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.EndpointUri !== undefined && input.EndpointUri !== null && { EndpointUri: input.EndpointUri }), + ...(input.ErrorRetryDuration !== undefined && + input.ErrorRetryDuration !== null && { ErrorRetryDuration: input.ErrorRetryDuration }), + ...(input.FullLoadErrorPercentage !== undefined && + input.FullLoadErrorPercentage !== null && { FullLoadErrorPercentage: input.FullLoadErrorPercentage }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), }; }; const serializeAws_json1_1EventCategoriesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ExcludeTestList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValueList(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValueList(input.Values, context) }), }; }; const serializeAws_json1_1FilterList = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1FilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IBMDb2Settings = (input: IBMDb2Settings, context: __SerdeContext): any => { return { - ...(input.CurrentLsn !== undefined && { CurrentLsn: input.CurrentLsn }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.MaxKBytesPerRead !== undefined && { MaxKBytesPerRead: input.MaxKBytesPerRead }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.SetDataCaptureChanges !== undefined && { SetDataCaptureChanges: input.SetDataCaptureChanges }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.CurrentLsn !== undefined && input.CurrentLsn !== null && { CurrentLsn: input.CurrentLsn }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.MaxKBytesPerRead !== undefined && + input.MaxKBytesPerRead !== null && { MaxKBytesPerRead: input.MaxKBytesPerRead }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.SetDataCaptureChanges !== undefined && + input.SetDataCaptureChanges !== null && { SetDataCaptureChanges: input.SetDataCaptureChanges }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -5754,59 +5814,78 @@ const serializeAws_json1_1ImportCertificateMessage = ( context: __SerdeContext ): any => { return { - ...(input.CertificateIdentifier !== undefined && { CertificateIdentifier: input.CertificateIdentifier }), - ...(input.CertificatePem !== undefined && { CertificatePem: input.CertificatePem }), - ...(input.CertificateWallet !== undefined && { CertificateWallet: context.base64Encoder(input.CertificateWallet) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CertificateIdentifier !== undefined && + input.CertificateIdentifier !== null && { CertificateIdentifier: input.CertificateIdentifier }), + ...(input.CertificatePem !== undefined && + input.CertificatePem !== null && { CertificatePem: input.CertificatePem }), + ...(input.CertificateWallet !== undefined && + input.CertificateWallet !== null && { CertificateWallet: context.base64Encoder(input.CertificateWallet) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1IncludeTestList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1KafkaSettings = (input: KafkaSettings, context: __SerdeContext): any => { return { - ...(input.Broker !== undefined && { Broker: input.Broker }), - ...(input.IncludeControlDetails !== undefined && { IncludeControlDetails: input.IncludeControlDetails }), - ...(input.IncludeNullAndEmpty !== undefined && { IncludeNullAndEmpty: input.IncludeNullAndEmpty }), - ...(input.IncludePartitionValue !== undefined && { IncludePartitionValue: input.IncludePartitionValue }), - ...(input.IncludeTableAlterOperations !== undefined && { - IncludeTableAlterOperations: input.IncludeTableAlterOperations, - }), - ...(input.IncludeTransactionDetails !== undefined && { - IncludeTransactionDetails: input.IncludeTransactionDetails, - }), - ...(input.MessageFormat !== undefined && { MessageFormat: input.MessageFormat }), - ...(input.MessageMaxBytes !== undefined && { MessageMaxBytes: input.MessageMaxBytes }), - ...(input.PartitionIncludeSchemaTable !== undefined && { - PartitionIncludeSchemaTable: input.PartitionIncludeSchemaTable, - }), - ...(input.Topic !== undefined && { Topic: input.Topic }), + ...(input.Broker !== undefined && input.Broker !== null && { Broker: input.Broker }), + ...(input.IncludeControlDetails !== undefined && + input.IncludeControlDetails !== null && { IncludeControlDetails: input.IncludeControlDetails }), + ...(input.IncludeNullAndEmpty !== undefined && + input.IncludeNullAndEmpty !== null && { IncludeNullAndEmpty: input.IncludeNullAndEmpty }), + ...(input.IncludePartitionValue !== undefined && + input.IncludePartitionValue !== null && { IncludePartitionValue: input.IncludePartitionValue }), + ...(input.IncludeTableAlterOperations !== undefined && + input.IncludeTableAlterOperations !== null && { IncludeTableAlterOperations: input.IncludeTableAlterOperations }), + ...(input.IncludeTransactionDetails !== undefined && + input.IncludeTransactionDetails !== null && { IncludeTransactionDetails: input.IncludeTransactionDetails }), + ...(input.MessageFormat !== undefined && input.MessageFormat !== null && { MessageFormat: input.MessageFormat }), + ...(input.MessageMaxBytes !== undefined && + input.MessageMaxBytes !== null && { MessageMaxBytes: input.MessageMaxBytes }), + ...(input.PartitionIncludeSchemaTable !== undefined && + input.PartitionIncludeSchemaTable !== null && { PartitionIncludeSchemaTable: input.PartitionIncludeSchemaTable }), + ...(input.Topic !== undefined && input.Topic !== null && { Topic: input.Topic }), }; }; const serializeAws_json1_1KeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1KinesisSettings = (input: KinesisSettings, context: __SerdeContext): any => { return { - ...(input.IncludeControlDetails !== undefined && { IncludeControlDetails: input.IncludeControlDetails }), - ...(input.IncludeNullAndEmpty !== undefined && { IncludeNullAndEmpty: input.IncludeNullAndEmpty }), - ...(input.IncludePartitionValue !== undefined && { IncludePartitionValue: input.IncludePartitionValue }), - ...(input.IncludeTableAlterOperations !== undefined && { - IncludeTableAlterOperations: input.IncludeTableAlterOperations, - }), - ...(input.IncludeTransactionDetails !== undefined && { - IncludeTransactionDetails: input.IncludeTransactionDetails, - }), - ...(input.MessageFormat !== undefined && { MessageFormat: input.MessageFormat }), - ...(input.PartitionIncludeSchemaTable !== undefined && { - PartitionIncludeSchemaTable: input.PartitionIncludeSchemaTable, - }), - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), - ...(input.StreamArn !== undefined && { StreamArn: input.StreamArn }), + ...(input.IncludeControlDetails !== undefined && + input.IncludeControlDetails !== null && { IncludeControlDetails: input.IncludeControlDetails }), + ...(input.IncludeNullAndEmpty !== undefined && + input.IncludeNullAndEmpty !== null && { IncludeNullAndEmpty: input.IncludeNullAndEmpty }), + ...(input.IncludePartitionValue !== undefined && + input.IncludePartitionValue !== null && { IncludePartitionValue: input.IncludePartitionValue }), + ...(input.IncludeTableAlterOperations !== undefined && + input.IncludeTableAlterOperations !== null && { IncludeTableAlterOperations: input.IncludeTableAlterOperations }), + ...(input.IncludeTransactionDetails !== undefined && + input.IncludeTransactionDetails !== null && { IncludeTransactionDetails: input.IncludeTransactionDetails }), + ...(input.MessageFormat !== undefined && input.MessageFormat !== null && { MessageFormat: input.MessageFormat }), + ...(input.PartitionIncludeSchemaTable !== undefined && + input.PartitionIncludeSchemaTable !== null && { PartitionIncludeSchemaTable: input.PartitionIncludeSchemaTable }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.StreamArn !== undefined && input.StreamArn !== null && { StreamArn: input.StreamArn }), }; }; @@ -5815,7 +5894,7 @@ const serializeAws_json1_1ListTagsForResourceMessage = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -5824,86 +5903,109 @@ const serializeAws_json1_1MicrosoftSQLServerSettings = ( context: __SerdeContext ): any => { return { - ...(input.BcpPacketSize !== undefined && { BcpPacketSize: input.BcpPacketSize }), - ...(input.ControlTablesFileGroup !== undefined && { ControlTablesFileGroup: input.ControlTablesFileGroup }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ReadBackupOnly !== undefined && { ReadBackupOnly: input.ReadBackupOnly }), - ...(input.SafeguardPolicy !== undefined && { SafeguardPolicy: input.SafeguardPolicy }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.UseBcpFullLoad !== undefined && { UseBcpFullLoad: input.UseBcpFullLoad }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.BcpPacketSize !== undefined && input.BcpPacketSize !== null && { BcpPacketSize: input.BcpPacketSize }), + ...(input.ControlTablesFileGroup !== undefined && + input.ControlTablesFileGroup !== null && { ControlTablesFileGroup: input.ControlTablesFileGroup }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ReadBackupOnly !== undefined && + input.ReadBackupOnly !== null && { ReadBackupOnly: input.ReadBackupOnly }), + ...(input.SafeguardPolicy !== undefined && + input.SafeguardPolicy !== null && { SafeguardPolicy: input.SafeguardPolicy }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.UseBcpFullLoad !== undefined && + input.UseBcpFullLoad !== null && { UseBcpFullLoad: input.UseBcpFullLoad }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1ModifyEndpointMessage = (input: ModifyEndpointMessage, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.DmsTransferSettings !== undefined && { - DmsTransferSettings: serializeAws_json1_1DmsTransferSettings(input.DmsTransferSettings, context), - }), - ...(input.DocDbSettings !== undefined && { - DocDbSettings: serializeAws_json1_1DocDbSettings(input.DocDbSettings, context), - }), - ...(input.DynamoDbSettings !== undefined && { - DynamoDbSettings: serializeAws_json1_1DynamoDbSettings(input.DynamoDbSettings, context), - }), - ...(input.ElasticsearchSettings !== undefined && { - ElasticsearchSettings: serializeAws_json1_1ElasticsearchSettings(input.ElasticsearchSettings, context), - }), - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), - ...(input.EndpointIdentifier !== undefined && { EndpointIdentifier: input.EndpointIdentifier }), - ...(input.EndpointType !== undefined && { EndpointType: input.EndpointType }), - ...(input.EngineName !== undefined && { EngineName: input.EngineName }), - ...(input.ExternalTableDefinition !== undefined && { ExternalTableDefinition: input.ExternalTableDefinition }), - ...(input.ExtraConnectionAttributes !== undefined && { - ExtraConnectionAttributes: input.ExtraConnectionAttributes, - }), - ...(input.IBMDb2Settings !== undefined && { - IBMDb2Settings: serializeAws_json1_1IBMDb2Settings(input.IBMDb2Settings, context), - }), - ...(input.KafkaSettings !== undefined && { - KafkaSettings: serializeAws_json1_1KafkaSettings(input.KafkaSettings, context), - }), - ...(input.KinesisSettings !== undefined && { - KinesisSettings: serializeAws_json1_1KinesisSettings(input.KinesisSettings, context), - }), - ...(input.MicrosoftSQLServerSettings !== undefined && { - MicrosoftSQLServerSettings: serializeAws_json1_1MicrosoftSQLServerSettings( - input.MicrosoftSQLServerSettings, - context - ), - }), - ...(input.MongoDbSettings !== undefined && { - MongoDbSettings: serializeAws_json1_1MongoDbSettings(input.MongoDbSettings, context), - }), - ...(input.MySQLSettings !== undefined && { - MySQLSettings: serializeAws_json1_1MySQLSettings(input.MySQLSettings, context), - }), - ...(input.NeptuneSettings !== undefined && { - NeptuneSettings: serializeAws_json1_1NeptuneSettings(input.NeptuneSettings, context), - }), - ...(input.OracleSettings !== undefined && { - OracleSettings: serializeAws_json1_1OracleSettings(input.OracleSettings, context), - }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.PostgreSQLSettings !== undefined && { - PostgreSQLSettings: serializeAws_json1_1PostgreSQLSettings(input.PostgreSQLSettings, context), - }), - ...(input.RedshiftSettings !== undefined && { - RedshiftSettings: serializeAws_json1_1RedshiftSettings(input.RedshiftSettings, context), - }), - ...(input.S3Settings !== undefined && { S3Settings: serializeAws_json1_1S3Settings(input.S3Settings, context) }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), - ...(input.SslMode !== undefined && { SslMode: input.SslMode }), - ...(input.SybaseSettings !== undefined && { - SybaseSettings: serializeAws_json1_1SybaseSettings(input.SybaseSettings, context), - }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.DmsTransferSettings !== undefined && + input.DmsTransferSettings !== null && { + DmsTransferSettings: serializeAws_json1_1DmsTransferSettings(input.DmsTransferSettings, context), + }), + ...(input.DocDbSettings !== undefined && + input.DocDbSettings !== null && { + DocDbSettings: serializeAws_json1_1DocDbSettings(input.DocDbSettings, context), + }), + ...(input.DynamoDbSettings !== undefined && + input.DynamoDbSettings !== null && { + DynamoDbSettings: serializeAws_json1_1DynamoDbSettings(input.DynamoDbSettings, context), + }), + ...(input.ElasticsearchSettings !== undefined && + input.ElasticsearchSettings !== null && { + ElasticsearchSettings: serializeAws_json1_1ElasticsearchSettings(input.ElasticsearchSettings, context), + }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), + ...(input.EndpointIdentifier !== undefined && + input.EndpointIdentifier !== null && { EndpointIdentifier: input.EndpointIdentifier }), + ...(input.EndpointType !== undefined && input.EndpointType !== null && { EndpointType: input.EndpointType }), + ...(input.EngineName !== undefined && input.EngineName !== null && { EngineName: input.EngineName }), + ...(input.ExternalTableDefinition !== undefined && + input.ExternalTableDefinition !== null && { ExternalTableDefinition: input.ExternalTableDefinition }), + ...(input.ExtraConnectionAttributes !== undefined && + input.ExtraConnectionAttributes !== null && { ExtraConnectionAttributes: input.ExtraConnectionAttributes }), + ...(input.IBMDb2Settings !== undefined && + input.IBMDb2Settings !== null && { + IBMDb2Settings: serializeAws_json1_1IBMDb2Settings(input.IBMDb2Settings, context), + }), + ...(input.KafkaSettings !== undefined && + input.KafkaSettings !== null && { + KafkaSettings: serializeAws_json1_1KafkaSettings(input.KafkaSettings, context), + }), + ...(input.KinesisSettings !== undefined && + input.KinesisSettings !== null && { + KinesisSettings: serializeAws_json1_1KinesisSettings(input.KinesisSettings, context), + }), + ...(input.MicrosoftSQLServerSettings !== undefined && + input.MicrosoftSQLServerSettings !== null && { + MicrosoftSQLServerSettings: serializeAws_json1_1MicrosoftSQLServerSettings( + input.MicrosoftSQLServerSettings, + context + ), + }), + ...(input.MongoDbSettings !== undefined && + input.MongoDbSettings !== null && { + MongoDbSettings: serializeAws_json1_1MongoDbSettings(input.MongoDbSettings, context), + }), + ...(input.MySQLSettings !== undefined && + input.MySQLSettings !== null && { + MySQLSettings: serializeAws_json1_1MySQLSettings(input.MySQLSettings, context), + }), + ...(input.NeptuneSettings !== undefined && + input.NeptuneSettings !== null && { + NeptuneSettings: serializeAws_json1_1NeptuneSettings(input.NeptuneSettings, context), + }), + ...(input.OracleSettings !== undefined && + input.OracleSettings !== null && { + OracleSettings: serializeAws_json1_1OracleSettings(input.OracleSettings, context), + }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.PostgreSQLSettings !== undefined && + input.PostgreSQLSettings !== null && { + PostgreSQLSettings: serializeAws_json1_1PostgreSQLSettings(input.PostgreSQLSettings, context), + }), + ...(input.RedshiftSettings !== undefined && + input.RedshiftSettings !== null && { + RedshiftSettings: serializeAws_json1_1RedshiftSettings(input.RedshiftSettings, context), + }), + ...(input.S3Settings !== undefined && + input.S3Settings !== null && { S3Settings: serializeAws_json1_1S3Settings(input.S3Settings, context) }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.SslMode !== undefined && input.SslMode !== null && { SslMode: input.SslMode }), + ...(input.SybaseSettings !== undefined && + input.SybaseSettings !== null && { + SybaseSettings: serializeAws_json1_1SybaseSettings(input.SybaseSettings, context), + }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -5912,13 +6014,15 @@ const serializeAws_json1_1ModifyEventSubscriptionMessage = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.EventCategories !== undefined && { - EventCategories: serializeAws_json1_1EventCategoriesList(input.EventCategories, context), - }), - ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), - ...(input.SubscriptionName !== undefined && { SubscriptionName: input.SubscriptionName }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.EventCategories !== undefined && + input.EventCategories !== null && { + EventCategories: serializeAws_json1_1EventCategoriesList(input.EventCategories, context), + }), + ...(input.SnsTopicArn !== undefined && input.SnsTopicArn !== null && { SnsTopicArn: input.SnsTopicArn }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), + ...(input.SubscriptionName !== undefined && + input.SubscriptionName !== null && { SubscriptionName: input.SubscriptionName }), }; }; @@ -5927,23 +6031,30 @@ const serializeAws_json1_1ModifyReplicationInstanceMessage = ( context: __SerdeContext ): any => { return { - ...(input.AllocatedStorage !== undefined && { AllocatedStorage: input.AllocatedStorage }), - ...(input.AllowMajorVersionUpgrade !== undefined && { AllowMajorVersionUpgrade: input.AllowMajorVersionUpgrade }), - ...(input.ApplyImmediately !== undefined && { ApplyImmediately: input.ApplyImmediately }), - ...(input.AutoMinorVersionUpgrade !== undefined && { AutoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), - ...(input.EngineVersion !== undefined && { EngineVersion: input.EngineVersion }), - ...(input.MultiAZ !== undefined && { MultiAZ: input.MultiAZ }), - ...(input.PreferredMaintenanceWindow !== undefined && { - PreferredMaintenanceWindow: input.PreferredMaintenanceWindow, - }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), - ...(input.ReplicationInstanceClass !== undefined && { ReplicationInstanceClass: input.ReplicationInstanceClass }), - ...(input.ReplicationInstanceIdentifier !== undefined && { - ReplicationInstanceIdentifier: input.ReplicationInstanceIdentifier, - }), - ...(input.VpcSecurityGroupIds !== undefined && { - VpcSecurityGroupIds: serializeAws_json1_1VpcSecurityGroupIdList(input.VpcSecurityGroupIds, context), - }), + ...(input.AllocatedStorage !== undefined && + input.AllocatedStorage !== null && { AllocatedStorage: input.AllocatedStorage }), + ...(input.AllowMajorVersionUpgrade !== undefined && + input.AllowMajorVersionUpgrade !== null && { AllowMajorVersionUpgrade: input.AllowMajorVersionUpgrade }), + ...(input.ApplyImmediately !== undefined && + input.ApplyImmediately !== null && { ApplyImmediately: input.ApplyImmediately }), + ...(input.AutoMinorVersionUpgrade !== undefined && + input.AutoMinorVersionUpgrade !== null && { AutoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { EngineVersion: input.EngineVersion }), + ...(input.MultiAZ !== undefined && input.MultiAZ !== null && { MultiAZ: input.MultiAZ }), + ...(input.PreferredMaintenanceWindow !== undefined && + input.PreferredMaintenanceWindow !== null && { PreferredMaintenanceWindow: input.PreferredMaintenanceWindow }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.ReplicationInstanceClass !== undefined && + input.ReplicationInstanceClass !== null && { ReplicationInstanceClass: input.ReplicationInstanceClass }), + ...(input.ReplicationInstanceIdentifier !== undefined && + input.ReplicationInstanceIdentifier !== null && { + ReplicationInstanceIdentifier: input.ReplicationInstanceIdentifier, + }), + ...(input.VpcSecurityGroupIds !== undefined && + input.VpcSecurityGroupIds !== null && { + VpcSecurityGroupIds: serializeAws_json1_1VpcSecurityGroupIdList(input.VpcSecurityGroupIds, context), + }), }; }; @@ -5952,15 +6063,16 @@ const serializeAws_json1_1ModifyReplicationSubnetGroupMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationSubnetGroupDescription !== undefined && { - ReplicationSubnetGroupDescription: input.ReplicationSubnetGroupDescription, - }), - ...(input.ReplicationSubnetGroupIdentifier !== undefined && { - ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier, - }), - ...(input.SubnetIds !== undefined && { - SubnetIds: serializeAws_json1_1SubnetIdentifierList(input.SubnetIds, context), - }), + ...(input.ReplicationSubnetGroupDescription !== undefined && + input.ReplicationSubnetGroupDescription !== null && { + ReplicationSubnetGroupDescription: input.ReplicationSubnetGroupDescription, + }), + ...(input.ReplicationSubnetGroupIdentifier !== undefined && + input.ReplicationSubnetGroupIdentifier !== null && { + ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier, + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIdentifierList(input.SubnetIds, context) }), }; }; @@ -5969,34 +6081,39 @@ const serializeAws_json1_1ModifyReplicationTaskMessage = ( context: __SerdeContext ): any => { return { - ...(input.CdcStartPosition !== undefined && { CdcStartPosition: input.CdcStartPosition }), - ...(input.CdcStartTime !== undefined && { CdcStartTime: Math.round(input.CdcStartTime.getTime() / 1000) }), - ...(input.CdcStopPosition !== undefined && { CdcStopPosition: input.CdcStopPosition }), - ...(input.MigrationType !== undefined && { MigrationType: input.MigrationType }), - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), - ...(input.ReplicationTaskIdentifier !== undefined && { - ReplicationTaskIdentifier: input.ReplicationTaskIdentifier, - }), - ...(input.ReplicationTaskSettings !== undefined && { ReplicationTaskSettings: input.ReplicationTaskSettings }), - ...(input.TableMappings !== undefined && { TableMappings: input.TableMappings }), - ...(input.TaskData !== undefined && { TaskData: input.TaskData }), + ...(input.CdcStartPosition !== undefined && + input.CdcStartPosition !== null && { CdcStartPosition: input.CdcStartPosition }), + ...(input.CdcStartTime !== undefined && + input.CdcStartTime !== null && { CdcStartTime: Math.round(input.CdcStartTime.getTime() / 1000) }), + ...(input.CdcStopPosition !== undefined && + input.CdcStopPosition !== null && { CdcStopPosition: input.CdcStopPosition }), + ...(input.MigrationType !== undefined && input.MigrationType !== null && { MigrationType: input.MigrationType }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.ReplicationTaskIdentifier !== undefined && + input.ReplicationTaskIdentifier !== null && { ReplicationTaskIdentifier: input.ReplicationTaskIdentifier }), + ...(input.ReplicationTaskSettings !== undefined && + input.ReplicationTaskSettings !== null && { ReplicationTaskSettings: input.ReplicationTaskSettings }), + ...(input.TableMappings !== undefined && input.TableMappings !== null && { TableMappings: input.TableMappings }), + ...(input.TaskData !== undefined && input.TaskData !== null && { TaskData: input.TaskData }), }; }; const serializeAws_json1_1MongoDbSettings = (input: MongoDbSettings, context: __SerdeContext): any => { return { - ...(input.AuthMechanism !== undefined && { AuthMechanism: input.AuthMechanism }), - ...(input.AuthSource !== undefined && { AuthSource: input.AuthSource }), - ...(input.AuthType !== undefined && { AuthType: input.AuthType }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.DocsToInvestigate !== undefined && { DocsToInvestigate: input.DocsToInvestigate }), - ...(input.ExtractDocId !== undefined && { ExtractDocId: input.ExtractDocId }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.NestingLevel !== undefined && { NestingLevel: input.NestingLevel }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.AuthMechanism !== undefined && input.AuthMechanism !== null && { AuthMechanism: input.AuthMechanism }), + ...(input.AuthSource !== undefined && input.AuthSource !== null && { AuthSource: input.AuthSource }), + ...(input.AuthType !== undefined && input.AuthType !== null && { AuthType: input.AuthType }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.DocsToInvestigate !== undefined && + input.DocsToInvestigate !== null && { DocsToInvestigate: input.DocsToInvestigate }), + ...(input.ExtractDocId !== undefined && input.ExtractDocId !== null && { ExtractDocId: input.ExtractDocId }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.NestingLevel !== undefined && input.NestingLevel !== null && { NestingLevel: input.NestingLevel }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -6005,96 +6122,124 @@ const serializeAws_json1_1MoveReplicationTaskMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), - ...(input.TargetReplicationInstanceArn !== undefined && { - TargetReplicationInstanceArn: input.TargetReplicationInstanceArn, - }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.TargetReplicationInstanceArn !== undefined && + input.TargetReplicationInstanceArn !== null && { + TargetReplicationInstanceArn: input.TargetReplicationInstanceArn, + }), }; }; const serializeAws_json1_1MySQLSettings = (input: MySQLSettings, context: __SerdeContext): any => { return { - ...(input.AfterConnectScript !== undefined && { AfterConnectScript: input.AfterConnectScript }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.EventsPollInterval !== undefined && { EventsPollInterval: input.EventsPollInterval }), - ...(input.MaxFileSize !== undefined && { MaxFileSize: input.MaxFileSize }), - ...(input.ParallelLoadThreads !== undefined && { ParallelLoadThreads: input.ParallelLoadThreads }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.ServerTimezone !== undefined && { ServerTimezone: input.ServerTimezone }), - ...(input.TargetDbType !== undefined && { TargetDbType: input.TargetDbType }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.AfterConnectScript !== undefined && + input.AfterConnectScript !== null && { AfterConnectScript: input.AfterConnectScript }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.EventsPollInterval !== undefined && + input.EventsPollInterval !== null && { EventsPollInterval: input.EventsPollInterval }), + ...(input.MaxFileSize !== undefined && input.MaxFileSize !== null && { MaxFileSize: input.MaxFileSize }), + ...(input.ParallelLoadThreads !== undefined && + input.ParallelLoadThreads !== null && { ParallelLoadThreads: input.ParallelLoadThreads }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.ServerTimezone !== undefined && + input.ServerTimezone !== null && { ServerTimezone: input.ServerTimezone }), + ...(input.TargetDbType !== undefined && input.TargetDbType !== null && { TargetDbType: input.TargetDbType }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1NeptuneSettings = (input: NeptuneSettings, context: __SerdeContext): any => { return { - ...(input.ErrorRetryDuration !== undefined && { ErrorRetryDuration: input.ErrorRetryDuration }), - ...(input.IamAuthEnabled !== undefined && { IamAuthEnabled: input.IamAuthEnabled }), - ...(input.MaxFileSize !== undefined && { MaxFileSize: input.MaxFileSize }), - ...(input.MaxRetryCount !== undefined && { MaxRetryCount: input.MaxRetryCount }), - ...(input.S3BucketFolder !== undefined && { S3BucketFolder: input.S3BucketFolder }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.ErrorRetryDuration !== undefined && + input.ErrorRetryDuration !== null && { ErrorRetryDuration: input.ErrorRetryDuration }), + ...(input.IamAuthEnabled !== undefined && + input.IamAuthEnabled !== null && { IamAuthEnabled: input.IamAuthEnabled }), + ...(input.MaxFileSize !== undefined && input.MaxFileSize !== null && { MaxFileSize: input.MaxFileSize }), + ...(input.MaxRetryCount !== undefined && input.MaxRetryCount !== null && { MaxRetryCount: input.MaxRetryCount }), + ...(input.S3BucketFolder !== undefined && + input.S3BucketFolder !== null && { S3BucketFolder: input.S3BucketFolder }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), }; }; const serializeAws_json1_1OracleSettings = (input: OracleSettings, context: __SerdeContext): any => { return { - ...(input.AccessAlternateDirectly !== undefined && { AccessAlternateDirectly: input.AccessAlternateDirectly }), - ...(input.AddSupplementalLogging !== undefined && { AddSupplementalLogging: input.AddSupplementalLogging }), - ...(input.AdditionalArchivedLogDestId !== undefined && { - AdditionalArchivedLogDestId: input.AdditionalArchivedLogDestId, - }), - ...(input.AllowSelectNestedTables !== undefined && { AllowSelectNestedTables: input.AllowSelectNestedTables }), - ...(input.ArchivedLogDestId !== undefined && { ArchivedLogDestId: input.ArchivedLogDestId }), - ...(input.ArchivedLogsOnly !== undefined && { ArchivedLogsOnly: input.ArchivedLogsOnly }), - ...(input.AsmPassword !== undefined && { AsmPassword: input.AsmPassword }), - ...(input.AsmServer !== undefined && { AsmServer: input.AsmServer }), - ...(input.AsmUser !== undefined && { AsmUser: input.AsmUser }), - ...(input.CharLengthSemantics !== undefined && { CharLengthSemantics: input.CharLengthSemantics }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.DirectPathNoLog !== undefined && { DirectPathNoLog: input.DirectPathNoLog }), - ...(input.DirectPathParallelLoad !== undefined && { DirectPathParallelLoad: input.DirectPathParallelLoad }), - ...(input.EnableHomogenousTablespace !== undefined && { - EnableHomogenousTablespace: input.EnableHomogenousTablespace, - }), - ...(input.FailTasksOnLobTruncation !== undefined && { FailTasksOnLobTruncation: input.FailTasksOnLobTruncation }), - ...(input.NumberDatatypeScale !== undefined && { NumberDatatypeScale: input.NumberDatatypeScale }), - ...(input.OraclePathPrefix !== undefined && { OraclePathPrefix: input.OraclePathPrefix }), - ...(input.ParallelAsmReadThreads !== undefined && { ParallelAsmReadThreads: input.ParallelAsmReadThreads }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ReadAheadBlocks !== undefined && { ReadAheadBlocks: input.ReadAheadBlocks }), - ...(input.ReadTableSpaceName !== undefined && { ReadTableSpaceName: input.ReadTableSpaceName }), - ...(input.ReplacePathPrefix !== undefined && { ReplacePathPrefix: input.ReplacePathPrefix }), - ...(input.RetryInterval !== undefined && { RetryInterval: input.RetryInterval }), - ...(input.SecurityDbEncryption !== undefined && { SecurityDbEncryption: input.SecurityDbEncryption }), - ...(input.SecurityDbEncryptionName !== undefined && { SecurityDbEncryptionName: input.SecurityDbEncryptionName }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.UseAlternateFolderForOnline !== undefined && { - UseAlternateFolderForOnline: input.UseAlternateFolderForOnline, - }), - ...(input.UsePathPrefix !== undefined && { UsePathPrefix: input.UsePathPrefix }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.AccessAlternateDirectly !== undefined && + input.AccessAlternateDirectly !== null && { AccessAlternateDirectly: input.AccessAlternateDirectly }), + ...(input.AddSupplementalLogging !== undefined && + input.AddSupplementalLogging !== null && { AddSupplementalLogging: input.AddSupplementalLogging }), + ...(input.AdditionalArchivedLogDestId !== undefined && + input.AdditionalArchivedLogDestId !== null && { AdditionalArchivedLogDestId: input.AdditionalArchivedLogDestId }), + ...(input.AllowSelectNestedTables !== undefined && + input.AllowSelectNestedTables !== null && { AllowSelectNestedTables: input.AllowSelectNestedTables }), + ...(input.ArchivedLogDestId !== undefined && + input.ArchivedLogDestId !== null && { ArchivedLogDestId: input.ArchivedLogDestId }), + ...(input.ArchivedLogsOnly !== undefined && + input.ArchivedLogsOnly !== null && { ArchivedLogsOnly: input.ArchivedLogsOnly }), + ...(input.AsmPassword !== undefined && input.AsmPassword !== null && { AsmPassword: input.AsmPassword }), + ...(input.AsmServer !== undefined && input.AsmServer !== null && { AsmServer: input.AsmServer }), + ...(input.AsmUser !== undefined && input.AsmUser !== null && { AsmUser: input.AsmUser }), + ...(input.CharLengthSemantics !== undefined && + input.CharLengthSemantics !== null && { CharLengthSemantics: input.CharLengthSemantics }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.DirectPathNoLog !== undefined && + input.DirectPathNoLog !== null && { DirectPathNoLog: input.DirectPathNoLog }), + ...(input.DirectPathParallelLoad !== undefined && + input.DirectPathParallelLoad !== null && { DirectPathParallelLoad: input.DirectPathParallelLoad }), + ...(input.EnableHomogenousTablespace !== undefined && + input.EnableHomogenousTablespace !== null && { EnableHomogenousTablespace: input.EnableHomogenousTablespace }), + ...(input.FailTasksOnLobTruncation !== undefined && + input.FailTasksOnLobTruncation !== null && { FailTasksOnLobTruncation: input.FailTasksOnLobTruncation }), + ...(input.NumberDatatypeScale !== undefined && + input.NumberDatatypeScale !== null && { NumberDatatypeScale: input.NumberDatatypeScale }), + ...(input.OraclePathPrefix !== undefined && + input.OraclePathPrefix !== null && { OraclePathPrefix: input.OraclePathPrefix }), + ...(input.ParallelAsmReadThreads !== undefined && + input.ParallelAsmReadThreads !== null && { ParallelAsmReadThreads: input.ParallelAsmReadThreads }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ReadAheadBlocks !== undefined && + input.ReadAheadBlocks !== null && { ReadAheadBlocks: input.ReadAheadBlocks }), + ...(input.ReadTableSpaceName !== undefined && + input.ReadTableSpaceName !== null && { ReadTableSpaceName: input.ReadTableSpaceName }), + ...(input.ReplacePathPrefix !== undefined && + input.ReplacePathPrefix !== null && { ReplacePathPrefix: input.ReplacePathPrefix }), + ...(input.RetryInterval !== undefined && input.RetryInterval !== null && { RetryInterval: input.RetryInterval }), + ...(input.SecurityDbEncryption !== undefined && + input.SecurityDbEncryption !== null && { SecurityDbEncryption: input.SecurityDbEncryption }), + ...(input.SecurityDbEncryptionName !== undefined && + input.SecurityDbEncryptionName !== null && { SecurityDbEncryptionName: input.SecurityDbEncryptionName }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.UseAlternateFolderForOnline !== undefined && + input.UseAlternateFolderForOnline !== null && { UseAlternateFolderForOnline: input.UseAlternateFolderForOnline }), + ...(input.UsePathPrefix !== undefined && input.UsePathPrefix !== null && { UsePathPrefix: input.UsePathPrefix }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1PostgreSQLSettings = (input: PostgreSQLSettings, context: __SerdeContext): any => { return { - ...(input.AfterConnectScript !== undefined && { AfterConnectScript: input.AfterConnectScript }), - ...(input.CaptureDdls !== undefined && { CaptureDdls: input.CaptureDdls }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.DdlArtifactsSchema !== undefined && { DdlArtifactsSchema: input.DdlArtifactsSchema }), - ...(input.ExecuteTimeout !== undefined && { ExecuteTimeout: input.ExecuteTimeout }), - ...(input.FailTasksOnLobTruncation !== undefined && { FailTasksOnLobTruncation: input.FailTasksOnLobTruncation }), - ...(input.MaxFileSize !== undefined && { MaxFileSize: input.MaxFileSize }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.SlotName !== undefined && { SlotName: input.SlotName }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.AfterConnectScript !== undefined && + input.AfterConnectScript !== null && { AfterConnectScript: input.AfterConnectScript }), + ...(input.CaptureDdls !== undefined && input.CaptureDdls !== null && { CaptureDdls: input.CaptureDdls }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.DdlArtifactsSchema !== undefined && + input.DdlArtifactsSchema !== null && { DdlArtifactsSchema: input.DdlArtifactsSchema }), + ...(input.ExecuteTimeout !== undefined && + input.ExecuteTimeout !== null && { ExecuteTimeout: input.ExecuteTimeout }), + ...(input.FailTasksOnLobTruncation !== undefined && + input.FailTasksOnLobTruncation !== null && { FailTasksOnLobTruncation: input.FailTasksOnLobTruncation }), + ...(input.MaxFileSize !== undefined && input.MaxFileSize !== null && { MaxFileSize: input.MaxFileSize }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.SlotName !== undefined && input.SlotName !== null && { SlotName: input.SlotName }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -6103,62 +6248,74 @@ const serializeAws_json1_1RebootReplicationInstanceMessage = ( context: __SerdeContext ): any => { return { - ...(input.ForceFailover !== undefined && { ForceFailover: input.ForceFailover }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.ForceFailover !== undefined && input.ForceFailover !== null && { ForceFailover: input.ForceFailover }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), }; }; const serializeAws_json1_1RedshiftSettings = (input: RedshiftSettings, context: __SerdeContext): any => { return { - ...(input.AcceptAnyDate !== undefined && { AcceptAnyDate: input.AcceptAnyDate }), - ...(input.AfterConnectScript !== undefined && { AfterConnectScript: input.AfterConnectScript }), - ...(input.BucketFolder !== undefined && { BucketFolder: input.BucketFolder }), - ...(input.BucketName !== undefined && { BucketName: input.BucketName }), - ...(input.CaseSensitiveNames !== undefined && { CaseSensitiveNames: input.CaseSensitiveNames }), - ...(input.CompUpdate !== undefined && { CompUpdate: input.CompUpdate }), - ...(input.ConnectionTimeout !== undefined && { ConnectionTimeout: input.ConnectionTimeout }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.DateFormat !== undefined && { DateFormat: input.DateFormat }), - ...(input.EmptyAsNull !== undefined && { EmptyAsNull: input.EmptyAsNull }), - ...(input.EncryptionMode !== undefined && { EncryptionMode: input.EncryptionMode }), - ...(input.ExplicitIds !== undefined && { ExplicitIds: input.ExplicitIds }), - ...(input.FileTransferUploadStreams !== undefined && { - FileTransferUploadStreams: input.FileTransferUploadStreams, - }), - ...(input.LoadTimeout !== undefined && { LoadTimeout: input.LoadTimeout }), - ...(input.MaxFileSize !== undefined && { MaxFileSize: input.MaxFileSize }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.RemoveQuotes !== undefined && { RemoveQuotes: input.RemoveQuotes }), - ...(input.ReplaceChars !== undefined && { ReplaceChars: input.ReplaceChars }), - ...(input.ReplaceInvalidChars !== undefined && { ReplaceInvalidChars: input.ReplaceInvalidChars }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.ServerSideEncryptionKmsKeyId !== undefined && { - ServerSideEncryptionKmsKeyId: input.ServerSideEncryptionKmsKeyId, - }), - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), - ...(input.TimeFormat !== undefined && { TimeFormat: input.TimeFormat }), - ...(input.TrimBlanks !== undefined && { TrimBlanks: input.TrimBlanks }), - ...(input.TruncateColumns !== undefined && { TruncateColumns: input.TruncateColumns }), - ...(input.Username !== undefined && { Username: input.Username }), - ...(input.WriteBufferSize !== undefined && { WriteBufferSize: input.WriteBufferSize }), + ...(input.AcceptAnyDate !== undefined && input.AcceptAnyDate !== null && { AcceptAnyDate: input.AcceptAnyDate }), + ...(input.AfterConnectScript !== undefined && + input.AfterConnectScript !== null && { AfterConnectScript: input.AfterConnectScript }), + ...(input.BucketFolder !== undefined && input.BucketFolder !== null && { BucketFolder: input.BucketFolder }), + ...(input.BucketName !== undefined && input.BucketName !== null && { BucketName: input.BucketName }), + ...(input.CaseSensitiveNames !== undefined && + input.CaseSensitiveNames !== null && { CaseSensitiveNames: input.CaseSensitiveNames }), + ...(input.CompUpdate !== undefined && input.CompUpdate !== null && { CompUpdate: input.CompUpdate }), + ...(input.ConnectionTimeout !== undefined && + input.ConnectionTimeout !== null && { ConnectionTimeout: input.ConnectionTimeout }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.DateFormat !== undefined && input.DateFormat !== null && { DateFormat: input.DateFormat }), + ...(input.EmptyAsNull !== undefined && input.EmptyAsNull !== null && { EmptyAsNull: input.EmptyAsNull }), + ...(input.EncryptionMode !== undefined && + input.EncryptionMode !== null && { EncryptionMode: input.EncryptionMode }), + ...(input.ExplicitIds !== undefined && input.ExplicitIds !== null && { ExplicitIds: input.ExplicitIds }), + ...(input.FileTransferUploadStreams !== undefined && + input.FileTransferUploadStreams !== null && { FileTransferUploadStreams: input.FileTransferUploadStreams }), + ...(input.LoadTimeout !== undefined && input.LoadTimeout !== null && { LoadTimeout: input.LoadTimeout }), + ...(input.MaxFileSize !== undefined && input.MaxFileSize !== null && { MaxFileSize: input.MaxFileSize }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.RemoveQuotes !== undefined && input.RemoveQuotes !== null && { RemoveQuotes: input.RemoveQuotes }), + ...(input.ReplaceChars !== undefined && input.ReplaceChars !== null && { ReplaceChars: input.ReplaceChars }), + ...(input.ReplaceInvalidChars !== undefined && + input.ReplaceInvalidChars !== null && { ReplaceInvalidChars: input.ReplaceInvalidChars }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.ServerSideEncryptionKmsKeyId !== undefined && + input.ServerSideEncryptionKmsKeyId !== null && { + ServerSideEncryptionKmsKeyId: input.ServerSideEncryptionKmsKeyId, + }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.TimeFormat !== undefined && input.TimeFormat !== null && { TimeFormat: input.TimeFormat }), + ...(input.TrimBlanks !== undefined && input.TrimBlanks !== null && { TrimBlanks: input.TrimBlanks }), + ...(input.TruncateColumns !== undefined && + input.TruncateColumns !== null && { TruncateColumns: input.TruncateColumns }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), + ...(input.WriteBufferSize !== undefined && + input.WriteBufferSize !== null && { WriteBufferSize: input.WriteBufferSize }), }; }; const serializeAws_json1_1RefreshSchemasMessage = (input: RefreshSchemasMessage, context: __SerdeContext): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), }; }; const serializeAws_json1_1ReloadTablesMessage = (input: ReloadTablesMessage, context: __SerdeContext): any => { return { - ...(input.ReloadOption !== undefined && { ReloadOption: input.ReloadOption }), - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), - ...(input.TablesToReload !== undefined && { - TablesToReload: serializeAws_json1_1TableListToReload(input.TablesToReload, context), - }), + ...(input.ReloadOption !== undefined && input.ReloadOption !== null && { ReloadOption: input.ReloadOption }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.TablesToReload !== undefined && + input.TablesToReload !== null && { + TablesToReload: serializeAws_json1_1TableListToReload(input.TablesToReload, context), + }), }; }; @@ -6167,50 +6324,78 @@ const serializeAws_json1_1RemoveTagsFromResourceMessage = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1KeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1KeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1S3Settings = (input: S3Settings, context: __SerdeContext): any => { return { - ...(input.BucketFolder !== undefined && { BucketFolder: input.BucketFolder }), - ...(input.BucketName !== undefined && { BucketName: input.BucketName }), - ...(input.CdcInsertsAndUpdates !== undefined && { CdcInsertsAndUpdates: input.CdcInsertsAndUpdates }), - ...(input.CdcInsertsOnly !== undefined && { CdcInsertsOnly: input.CdcInsertsOnly }), - ...(input.CdcPath !== undefined && { CdcPath: input.CdcPath }), - ...(input.CompressionType !== undefined && { CompressionType: input.CompressionType }), - ...(input.CsvDelimiter !== undefined && { CsvDelimiter: input.CsvDelimiter }), - ...(input.CsvNoSupValue !== undefined && { CsvNoSupValue: input.CsvNoSupValue }), - ...(input.CsvRowDelimiter !== undefined && { CsvRowDelimiter: input.CsvRowDelimiter }), - ...(input.DataFormat !== undefined && { DataFormat: input.DataFormat }), - ...(input.DataPageSize !== undefined && { DataPageSize: input.DataPageSize }), - ...(input.DatePartitionDelimiter !== undefined && { DatePartitionDelimiter: input.DatePartitionDelimiter }), - ...(input.DatePartitionEnabled !== undefined && { DatePartitionEnabled: input.DatePartitionEnabled }), - ...(input.DatePartitionSequence !== undefined && { DatePartitionSequence: input.DatePartitionSequence }), - ...(input.DictPageSizeLimit !== undefined && { DictPageSizeLimit: input.DictPageSizeLimit }), - ...(input.EnableStatistics !== undefined && { EnableStatistics: input.EnableStatistics }), - ...(input.EncodingType !== undefined && { EncodingType: input.EncodingType }), - ...(input.EncryptionMode !== undefined && { EncryptionMode: input.EncryptionMode }), - ...(input.ExternalTableDefinition !== undefined && { ExternalTableDefinition: input.ExternalTableDefinition }), - ...(input.IncludeOpForFullLoad !== undefined && { IncludeOpForFullLoad: input.IncludeOpForFullLoad }), - ...(input.ParquetTimestampInMillisecond !== undefined && { - ParquetTimestampInMillisecond: input.ParquetTimestampInMillisecond, - }), - ...(input.ParquetVersion !== undefined && { ParquetVersion: input.ParquetVersion }), - ...(input.PreserveTransactions !== undefined && { PreserveTransactions: input.PreserveTransactions }), - ...(input.RowGroupLength !== undefined && { RowGroupLength: input.RowGroupLength }), - ...(input.ServerSideEncryptionKmsKeyId !== undefined && { - ServerSideEncryptionKmsKeyId: input.ServerSideEncryptionKmsKeyId, - }), - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), - ...(input.TimestampColumnName !== undefined && { TimestampColumnName: input.TimestampColumnName }), - ...(input.UseCsvNoSupValue !== undefined && { UseCsvNoSupValue: input.UseCsvNoSupValue }), + ...(input.BucketFolder !== undefined && input.BucketFolder !== null && { BucketFolder: input.BucketFolder }), + ...(input.BucketName !== undefined && input.BucketName !== null && { BucketName: input.BucketName }), + ...(input.CdcInsertsAndUpdates !== undefined && + input.CdcInsertsAndUpdates !== null && { CdcInsertsAndUpdates: input.CdcInsertsAndUpdates }), + ...(input.CdcInsertsOnly !== undefined && + input.CdcInsertsOnly !== null && { CdcInsertsOnly: input.CdcInsertsOnly }), + ...(input.CdcPath !== undefined && input.CdcPath !== null && { CdcPath: input.CdcPath }), + ...(input.CompressionType !== undefined && + input.CompressionType !== null && { CompressionType: input.CompressionType }), + ...(input.CsvDelimiter !== undefined && input.CsvDelimiter !== null && { CsvDelimiter: input.CsvDelimiter }), + ...(input.CsvNoSupValue !== undefined && input.CsvNoSupValue !== null && { CsvNoSupValue: input.CsvNoSupValue }), + ...(input.CsvRowDelimiter !== undefined && + input.CsvRowDelimiter !== null && { CsvRowDelimiter: input.CsvRowDelimiter }), + ...(input.DataFormat !== undefined && input.DataFormat !== null && { DataFormat: input.DataFormat }), + ...(input.DataPageSize !== undefined && input.DataPageSize !== null && { DataPageSize: input.DataPageSize }), + ...(input.DatePartitionDelimiter !== undefined && + input.DatePartitionDelimiter !== null && { DatePartitionDelimiter: input.DatePartitionDelimiter }), + ...(input.DatePartitionEnabled !== undefined && + input.DatePartitionEnabled !== null && { DatePartitionEnabled: input.DatePartitionEnabled }), + ...(input.DatePartitionSequence !== undefined && + input.DatePartitionSequence !== null && { DatePartitionSequence: input.DatePartitionSequence }), + ...(input.DictPageSizeLimit !== undefined && + input.DictPageSizeLimit !== null && { DictPageSizeLimit: input.DictPageSizeLimit }), + ...(input.EnableStatistics !== undefined && + input.EnableStatistics !== null && { EnableStatistics: input.EnableStatistics }), + ...(input.EncodingType !== undefined && input.EncodingType !== null && { EncodingType: input.EncodingType }), + ...(input.EncryptionMode !== undefined && + input.EncryptionMode !== null && { EncryptionMode: input.EncryptionMode }), + ...(input.ExternalTableDefinition !== undefined && + input.ExternalTableDefinition !== null && { ExternalTableDefinition: input.ExternalTableDefinition }), + ...(input.IncludeOpForFullLoad !== undefined && + input.IncludeOpForFullLoad !== null && { IncludeOpForFullLoad: input.IncludeOpForFullLoad }), + ...(input.ParquetTimestampInMillisecond !== undefined && + input.ParquetTimestampInMillisecond !== null && { + ParquetTimestampInMillisecond: input.ParquetTimestampInMillisecond, + }), + ...(input.ParquetVersion !== undefined && + input.ParquetVersion !== null && { ParquetVersion: input.ParquetVersion }), + ...(input.PreserveTransactions !== undefined && + input.PreserveTransactions !== null && { PreserveTransactions: input.PreserveTransactions }), + ...(input.RowGroupLength !== undefined && + input.RowGroupLength !== null && { RowGroupLength: input.RowGroupLength }), + ...(input.ServerSideEncryptionKmsKeyId !== undefined && + input.ServerSideEncryptionKmsKeyId !== null && { + ServerSideEncryptionKmsKeyId: input.ServerSideEncryptionKmsKeyId, + }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.TimestampColumnName !== undefined && + input.TimestampColumnName !== null && { TimestampColumnName: input.TimestampColumnName }), + ...(input.UseCsvNoSupValue !== undefined && + input.UseCsvNoSupValue !== null && { UseCsvNoSupValue: input.UseCsvNoSupValue }), }; }; const serializeAws_json1_1SourceIdsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartReplicationTaskAssessmentMessage = ( @@ -6218,7 +6403,8 @@ const serializeAws_json1_1StartReplicationTaskAssessmentMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), }; }; @@ -6227,17 +6413,24 @@ const serializeAws_json1_1StartReplicationTaskAssessmentRunMessage = ( context: __SerdeContext ): any => { return { - ...(input.AssessmentRunName !== undefined && { AssessmentRunName: input.AssessmentRunName }), - ...(input.Exclude !== undefined && { Exclude: serializeAws_json1_1ExcludeTestList(input.Exclude, context) }), - ...(input.IncludeOnly !== undefined && { - IncludeOnly: serializeAws_json1_1IncludeTestList(input.IncludeOnly, context), - }), - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), - ...(input.ResultEncryptionMode !== undefined && { ResultEncryptionMode: input.ResultEncryptionMode }), - ...(input.ResultKmsKeyArn !== undefined && { ResultKmsKeyArn: input.ResultKmsKeyArn }), - ...(input.ResultLocationBucket !== undefined && { ResultLocationBucket: input.ResultLocationBucket }), - ...(input.ResultLocationFolder !== undefined && { ResultLocationFolder: input.ResultLocationFolder }), - ...(input.ServiceAccessRoleArn !== undefined && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), + ...(input.AssessmentRunName !== undefined && + input.AssessmentRunName !== null && { AssessmentRunName: input.AssessmentRunName }), + ...(input.Exclude !== undefined && + input.Exclude !== null && { Exclude: serializeAws_json1_1ExcludeTestList(input.Exclude, context) }), + ...(input.IncludeOnly !== undefined && + input.IncludeOnly !== null && { IncludeOnly: serializeAws_json1_1IncludeTestList(input.IncludeOnly, context) }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.ResultEncryptionMode !== undefined && + input.ResultEncryptionMode !== null && { ResultEncryptionMode: input.ResultEncryptionMode }), + ...(input.ResultKmsKeyArn !== undefined && + input.ResultKmsKeyArn !== null && { ResultKmsKeyArn: input.ResultKmsKeyArn }), + ...(input.ResultLocationBucket !== undefined && + input.ResultLocationBucket !== null && { ResultLocationBucket: input.ResultLocationBucket }), + ...(input.ResultLocationFolder !== undefined && + input.ResultLocationFolder !== null && { ResultLocationFolder: input.ResultLocationFolder }), + ...(input.ServiceAccessRoleArn !== undefined && + input.ServiceAccessRoleArn !== null && { ServiceAccessRoleArn: input.ServiceAccessRoleArn }), }; }; @@ -6246,11 +6439,16 @@ const serializeAws_json1_1StartReplicationTaskMessage = ( context: __SerdeContext ): any => { return { - ...(input.CdcStartPosition !== undefined && { CdcStartPosition: input.CdcStartPosition }), - ...(input.CdcStartTime !== undefined && { CdcStartTime: Math.round(input.CdcStartTime.getTime() / 1000) }), - ...(input.CdcStopPosition !== undefined && { CdcStopPosition: input.CdcStopPosition }), - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), - ...(input.StartReplicationTaskType !== undefined && { StartReplicationTaskType: input.StartReplicationTaskType }), + ...(input.CdcStartPosition !== undefined && + input.CdcStartPosition !== null && { CdcStartPosition: input.CdcStartPosition }), + ...(input.CdcStartTime !== undefined && + input.CdcStartTime !== null && { CdcStartTime: Math.round(input.CdcStartTime.getTime() / 1000) }), + ...(input.CdcStopPosition !== undefined && + input.CdcStopPosition !== null && { CdcStopPosition: input.CdcStopPosition }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.StartReplicationTaskType !== undefined && + input.StartReplicationTaskType !== null && { StartReplicationTaskType: input.StartReplicationTaskType }), }; }; @@ -6259,55 +6457,85 @@ const serializeAws_json1_1StopReplicationTaskMessage = ( context: __SerdeContext ): any => { return { - ...(input.ReplicationTaskArn !== undefined && { ReplicationTaskArn: input.ReplicationTaskArn }), + ...(input.ReplicationTaskArn !== undefined && + input.ReplicationTaskArn !== null && { ReplicationTaskArn: input.ReplicationTaskArn }), }; }; const serializeAws_json1_1SubnetIdentifierList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SybaseSettings = (input: SybaseSettings, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1TableListToReload = (input: TableToReload[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TableToReload(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TableToReload(entry, context); + }); }; const serializeAws_json1_1TableToReload = (input: TableToReload, context: __SerdeContext): any => { return { - ...(input.SchemaName !== undefined && { SchemaName: input.SchemaName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.SchemaName !== undefined && input.SchemaName !== null && { SchemaName: input.SchemaName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TestConnectionMessage = (input: TestConnectionMessage, context: __SerdeContext): any => { return { - ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), - ...(input.ReplicationInstanceArn !== undefined && { ReplicationInstanceArn: input.ReplicationInstanceArn }), + ...(input.EndpointArn !== undefined && input.EndpointArn !== null && { EndpointArn: input.EndpointArn }), + ...(input.ReplicationInstanceArn !== undefined && + input.ReplicationInstanceArn !== null && { ReplicationInstanceArn: input.ReplicationInstanceArn }), }; }; const serializeAws_json1_1VpcSecurityGroupIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AccessDeniedFault = (output: any, context: __SerdeContext): AccessDeniedFault => { @@ -6326,7 +6554,14 @@ const deserializeAws_json1_1AccountQuota = (output: any, context: __SerdeContext }; const deserializeAws_json1_1AccountQuotaList = (output: any, context: __SerdeContext): AccountQuota[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AccountQuota(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccountQuota(entry, context); + }); }; const deserializeAws_json1_1AddTagsToResourceResponse = ( @@ -6355,7 +6590,14 @@ const deserializeAws_json1_1AvailabilityZone = (output: any, context: __SerdeCon }; const deserializeAws_json1_1AvailabilityZonesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CancelReplicationTaskAssessmentRunResponse = ( @@ -6405,7 +6647,14 @@ const deserializeAws_json1_1Certificate = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1CertificateList = (output: any, context: __SerdeContext): Certificate[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Certificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Certificate(entry, context); + }); }; const deserializeAws_json1_1Connection = (output: any, context: __SerdeContext): Connection => { @@ -6432,7 +6681,14 @@ const deserializeAws_json1_1Connection = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ConnectionList = (output: any, context: __SerdeContext): Connection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Connection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Connection(entry, context); + }); }; const deserializeAws_json1_1CreateEndpointResponse = (output: any, context: __SerdeContext): CreateEndpointResponse => { @@ -7020,7 +7276,14 @@ const deserializeAws_json1_1Endpoint = (output: any, context: __SerdeContext): E }; const deserializeAws_json1_1EndpointList = (output: any, context: __SerdeContext): Endpoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Endpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Endpoint(entry, context); + }); }; const deserializeAws_json1_1Event = (output: any, context: __SerdeContext): Event => { @@ -7038,7 +7301,14 @@ const deserializeAws_json1_1Event = (output: any, context: __SerdeContext): Even }; const deserializeAws_json1_1EventCategoriesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1EventCategoryGroup = (output: any, context: __SerdeContext): EventCategoryGroup => { @@ -7052,11 +7322,25 @@ const deserializeAws_json1_1EventCategoryGroup = (output: any, context: __SerdeC }; const deserializeAws_json1_1EventCategoryGroupList = (output: any, context: __SerdeContext): EventCategoryGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventCategoryGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventCategoryGroup(entry, context); + }); }; const deserializeAws_json1_1EventList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Event(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Event(entry, context); + }); }; const deserializeAws_json1_1EventSubscription = (output: any, context: __SerdeContext): EventSubscription => { @@ -7087,7 +7371,14 @@ const deserializeAws_json1_1EventSubscription = (output: any, context: __SerdeCo }; const deserializeAws_json1_1EventSubscriptionsList = (output: any, context: __SerdeContext): EventSubscription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventSubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventSubscription(entry, context); + }); }; const deserializeAws_json1_1IBMDb2Settings = (output: any, context: __SerdeContext): IBMDb2Settings => { @@ -7120,7 +7411,14 @@ const deserializeAws_json1_1ImportCertificateResponse = ( }; const deserializeAws_json1_1IndividualAssessmentNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InsufficientResourceCapacityFault = ( @@ -7576,7 +7874,14 @@ const deserializeAws_json1_1OrderableReplicationInstanceList = ( output: any, context: __SerdeContext ): OrderableReplicationInstance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrderableReplicationInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrderableReplicationInstance(entry, context); + }); }; const deserializeAws_json1_1PendingMaintenanceAction = ( @@ -7606,14 +7911,28 @@ const deserializeAws_json1_1PendingMaintenanceActionDetails = ( output: any, context: __SerdeContext ): PendingMaintenanceAction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PendingMaintenanceAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PendingMaintenanceAction(entry, context); + }); }; const deserializeAws_json1_1PendingMaintenanceActions = ( output: any, context: __SerdeContext ): ResourcePendingMaintenanceActions[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourcePendingMaintenanceActions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourcePendingMaintenanceActions(entry, context); + }); }; const deserializeAws_json1_1PostgreSQLSettings = (output: any, context: __SerdeContext): PostgreSQLSettings => { @@ -7848,21 +8167,42 @@ const deserializeAws_json1_1ReplicationInstance = (output: any, context: __Serde }; const deserializeAws_json1_1ReplicationInstanceList = (output: any, context: __SerdeContext): ReplicationInstance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationInstance(entry, context); + }); }; const deserializeAws_json1_1ReplicationInstancePrivateIpAddressList = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ReplicationInstancePublicIpAddressList = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ReplicationInstanceTaskLog = ( @@ -7889,7 +8229,14 @@ const deserializeAws_json1_1ReplicationInstanceTaskLogsList = ( output: any, context: __SerdeContext ): ReplicationInstanceTaskLog[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationInstanceTaskLog(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationInstanceTaskLog(entry, context); + }); }; const deserializeAws_json1_1ReplicationPendingModifiedValues = ( @@ -7944,7 +8291,14 @@ const deserializeAws_json1_1ReplicationSubnetGroups = ( output: any, context: __SerdeContext ): ReplicationSubnetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationSubnetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationSubnetGroup(entry, context); + }); }; const deserializeAws_json1_1ReplicationTask = (output: any, context: __SerdeContext): ReplicationTask => { @@ -8046,7 +8400,14 @@ const deserializeAws_json1_1ReplicationTaskAssessmentResultList = ( output: any, context: __SerdeContext ): ReplicationTaskAssessmentResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationTaskAssessmentResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationTaskAssessmentResult(entry, context); + }); }; const deserializeAws_json1_1ReplicationTaskAssessmentRun = ( @@ -8105,7 +8466,14 @@ const deserializeAws_json1_1ReplicationTaskAssessmentRunList = ( output: any, context: __SerdeContext ): ReplicationTaskAssessmentRun[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationTaskAssessmentRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationTaskAssessmentRun(entry, context); + }); }; const deserializeAws_json1_1ReplicationTaskAssessmentRunProgress = ( @@ -8155,11 +8523,25 @@ const deserializeAws_json1_1ReplicationTaskIndividualAssessmentList = ( output: any, context: __SerdeContext ): ReplicationTaskIndividualAssessment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationTaskIndividualAssessment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationTaskIndividualAssessment(entry, context); + }); }; const deserializeAws_json1_1ReplicationTaskList = (output: any, context: __SerdeContext): ReplicationTask[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationTask(entry, context); + }); }; const deserializeAws_json1_1ReplicationTaskStats = (output: any, context: __SerdeContext): ReplicationTaskStats => { @@ -8336,7 +8718,14 @@ const deserializeAws_json1_1S3Settings = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1SchemaList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SNSInvalidTopicFault = (output: any, context: __SerdeContext): SNSInvalidTopicFault => { @@ -8355,7 +8744,14 @@ const deserializeAws_json1_1SNSNoAuthorizationFault = ( }; const deserializeAws_json1_1SourceIdsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1StartReplicationTaskAssessmentResponse = ( @@ -8434,7 +8830,14 @@ const deserializeAws_json1_1SubnetAlreadyInUse = (output: any, context: __SerdeC }; const deserializeAws_json1_1SubnetList = (output: any, context: __SerdeContext): Subnet[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Subnet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Subnet(entry, context); + }); }; const deserializeAws_json1_1SupportedEndpointType = (output: any, context: __SerdeContext): SupportedEndpointType => { @@ -8458,7 +8861,14 @@ const deserializeAws_json1_1SupportedEndpointTypeList = ( output: any, context: __SerdeContext ): SupportedEndpointType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SupportedEndpointType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SupportedEndpointType(entry, context); + }); }; const deserializeAws_json1_1SybaseSettings = (output: any, context: __SerdeContext): SybaseSettings => { @@ -8525,7 +8935,14 @@ const deserializeAws_json1_1TableStatistics = (output: any, context: __SerdeCont }; const deserializeAws_json1_1TableStatisticsList = (output: any, context: __SerdeContext): TableStatistics[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TableStatistics(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TableStatistics(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -8536,7 +8953,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TestConnectionResponse = (output: any, context: __SerdeContext): TestConnectionResponse => { @@ -8574,7 +8998,14 @@ const deserializeAws_json1_1VpcSecurityGroupMembershipList = ( output: any, context: __SerdeContext ): VpcSecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VpcSecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VpcSecurityGroupMembership(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -8627,3 +9058,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-databrew/protocols/Aws_restJson1.ts b/clients/client-databrew/protocols/Aws_restJson1.ts index 9ade5e7344b5..6b652f2e9bf3 100644 --- a/clients/client-databrew/protocols/Aws_restJson1.ts +++ b/clients/client-databrew/protocols/Aws_restJson1.ts @@ -96,7 +96,7 @@ export const serializeAws_restJson1BatchDeleteRecipeVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/recipes/{Name}/batchDeleteRecipeVersion"; if (input.Name !== undefined) { @@ -110,9 +110,10 @@ export const serializeAws_restJson1BatchDeleteRecipeVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.RecipeVersions !== undefined && { - RecipeVersions: serializeAws_restJson1RecipeVersionList(input.RecipeVersions, context), - }), + ...(input.RecipeVersions !== undefined && + input.RecipeVersions !== null && { + RecipeVersions: serializeAws_restJson1RecipeVersionList(input.RecipeVersions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -131,17 +132,19 @@ export const serializeAws_restJson1CreateDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/datasets"; let body: any; body = JSON.stringify({ - ...(input.FormatOptions !== undefined && { - FormatOptions: serializeAws_restJson1FormatOptions(input.FormatOptions, context), - }), - ...(input.Input !== undefined && { Input: serializeAws_restJson1Input(input.Input, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.FormatOptions !== undefined && + input.FormatOptions !== null && { + FormatOptions: serializeAws_restJson1FormatOptions(input.FormatOptions, context), + }), + ...(input.Input !== undefined && + input.Input !== null && { Input: serializeAws_restJson1Input(input.Input, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -160,24 +163,28 @@ export const serializeAws_restJson1CreateProfileJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/profileJobs"; let body: any; body = JSON.stringify({ - ...(input.DatasetName !== undefined && { DatasetName: input.DatasetName }), - ...(input.EncryptionKeyArn !== undefined && { EncryptionKeyArn: input.EncryptionKeyArn }), - ...(input.EncryptionMode !== undefined && { EncryptionMode: input.EncryptionMode }), - ...(input.LogSubscription !== undefined && { LogSubscription: input.LogSubscription }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MaxRetries !== undefined && { MaxRetries: input.MaxRetries }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OutputLocation !== undefined && { - OutputLocation: serializeAws_restJson1S3Location(input.OutputLocation, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), + ...(input.DatasetName !== undefined && input.DatasetName !== null && { DatasetName: input.DatasetName }), + ...(input.EncryptionKeyArn !== undefined && + input.EncryptionKeyArn !== null && { EncryptionKeyArn: input.EncryptionKeyArn }), + ...(input.EncryptionMode !== undefined && + input.EncryptionMode !== null && { EncryptionMode: input.EncryptionMode }), + ...(input.LogSubscription !== undefined && + input.LogSubscription !== null && { LogSubscription: input.LogSubscription }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MaxRetries !== undefined && input.MaxRetries !== null && { MaxRetries: input.MaxRetries }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OutputLocation !== undefined && + input.OutputLocation !== null && { + OutputLocation: serializeAws_restJson1S3Location(input.OutputLocation, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -196,17 +203,18 @@ export const serializeAws_restJson1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects"; let body: any; body = JSON.stringify({ - ...(input.DatasetName !== undefined && { DatasetName: input.DatasetName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RecipeName !== undefined && { RecipeName: input.RecipeName }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Sample !== undefined && { Sample: serializeAws_restJson1Sample(input.Sample, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.DatasetName !== undefined && input.DatasetName !== null && { DatasetName: input.DatasetName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RecipeName !== undefined && input.RecipeName !== null && { RecipeName: input.RecipeName }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Sample !== undefined && + input.Sample !== null && { Sample: serializeAws_restJson1Sample(input.Sample, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -225,15 +233,16 @@ export const serializeAws_restJson1CreateRecipeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/recipes"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Steps !== undefined && { Steps: serializeAws_restJson1RecipeStepList(input.Steps, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Steps !== undefined && + input.Steps !== null && { Steps: serializeAws_restJson1RecipeStepList(input.Steps, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -252,26 +261,31 @@ export const serializeAws_restJson1CreateRecipeJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/recipeJobs"; let body: any; body = JSON.stringify({ - ...(input.DatasetName !== undefined && { DatasetName: input.DatasetName }), - ...(input.EncryptionKeyArn !== undefined && { EncryptionKeyArn: input.EncryptionKeyArn }), - ...(input.EncryptionMode !== undefined && { EncryptionMode: input.EncryptionMode }), - ...(input.LogSubscription !== undefined && { LogSubscription: input.LogSubscription }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MaxRetries !== undefined && { MaxRetries: input.MaxRetries }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Outputs !== undefined && { Outputs: serializeAws_restJson1OutputList(input.Outputs, context) }), - ...(input.ProjectName !== undefined && { ProjectName: input.ProjectName }), - ...(input.RecipeReference !== undefined && { - RecipeReference: serializeAws_restJson1RecipeReference(input.RecipeReference, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), + ...(input.DatasetName !== undefined && input.DatasetName !== null && { DatasetName: input.DatasetName }), + ...(input.EncryptionKeyArn !== undefined && + input.EncryptionKeyArn !== null && { EncryptionKeyArn: input.EncryptionKeyArn }), + ...(input.EncryptionMode !== undefined && + input.EncryptionMode !== null && { EncryptionMode: input.EncryptionMode }), + ...(input.LogSubscription !== undefined && + input.LogSubscription !== null && { LogSubscription: input.LogSubscription }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MaxRetries !== undefined && input.MaxRetries !== null && { MaxRetries: input.MaxRetries }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { Outputs: serializeAws_restJson1OutputList(input.Outputs, context) }), + ...(input.ProjectName !== undefined && input.ProjectName !== null && { ProjectName: input.ProjectName }), + ...(input.RecipeReference !== undefined && + input.RecipeReference !== null && { + RecipeReference: serializeAws_restJson1RecipeReference(input.RecipeReference, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -290,15 +304,17 @@ export const serializeAws_restJson1CreateScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/schedules"; let body: any; body = JSON.stringify({ - ...(input.CronExpression !== undefined && { CronExpression: input.CronExpression }), - ...(input.JobNames !== undefined && { JobNames: serializeAws_restJson1JobNameList(input.JobNames, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.CronExpression !== undefined && + input.CronExpression !== null && { CronExpression: input.CronExpression }), + ...(input.JobNames !== undefined && + input.JobNames !== null && { JobNames: serializeAws_restJson1JobNameList(input.JobNames, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -316,9 +332,7 @@ export const serializeAws_restJson1DeleteDatasetCommand = async ( input: DeleteDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datasets/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -346,9 +360,7 @@ export const serializeAws_restJson1DeleteJobCommand = async ( input: DeleteJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -376,9 +388,7 @@ export const serializeAws_restJson1DeleteProjectCommand = async ( input: DeleteProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -406,9 +416,7 @@ export const serializeAws_restJson1DeleteRecipeVersionCommand = async ( input: DeleteRecipeVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/recipes/{Name}/recipeVersion/{RecipeVersion}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -445,9 +453,7 @@ export const serializeAws_restJson1DeleteScheduleCommand = async ( input: DeleteScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/schedules/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -475,9 +481,7 @@ export const serializeAws_restJson1DescribeDatasetCommand = async ( input: DescribeDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datasets/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -505,9 +509,7 @@ export const serializeAws_restJson1DescribeJobCommand = async ( input: DescribeJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -535,9 +537,7 @@ export const serializeAws_restJson1DescribeProjectCommand = async ( input: DescribeProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -565,9 +565,7 @@ export const serializeAws_restJson1DescribeRecipeCommand = async ( input: DescribeRecipeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/recipes/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -599,9 +597,7 @@ export const serializeAws_restJson1DescribeScheduleCommand = async ( input: DescribeScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/schedules/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -629,9 +625,7 @@ export const serializeAws_restJson1ListDatasetsCommand = async ( input: ListDatasetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datasets"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -655,9 +649,7 @@ export const serializeAws_restJson1ListJobRunsCommand = async ( input: ListJobRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{Name}/jobRuns"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -690,9 +682,7 @@ export const serializeAws_restJson1ListJobsCommand = async ( input: ListJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs"; const query: any = { ...(input.DatasetName !== undefined && { datasetName: input.DatasetName }), @@ -718,9 +708,7 @@ export const serializeAws_restJson1ListProjectsCommand = async ( input: ListProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -744,9 +732,7 @@ export const serializeAws_restJson1ListRecipesCommand = async ( input: ListRecipesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/recipes"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -771,9 +757,7 @@ export const serializeAws_restJson1ListRecipeVersionsCommand = async ( input: ListRecipeVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/recipeVersions"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -798,9 +782,7 @@ export const serializeAws_restJson1ListSchedulesCommand = async ( input: ListSchedulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/schedules"; const query: any = { ...(input.JobName !== undefined && { jobName: input.JobName }), @@ -825,9 +807,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -856,7 +836,7 @@ export const serializeAws_restJson1PublishRecipeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/recipes/{Name}/publishRecipe"; if (input.Name !== undefined) { @@ -870,7 +850,7 @@ export const serializeAws_restJson1PublishRecipeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -889,7 +869,7 @@ export const serializeAws_restJson1SendProjectSessionActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{Name}/sendProjectSessionAction"; if (input.Name !== undefined) { @@ -903,11 +883,14 @@ export const serializeAws_restJson1SendProjectSessionActionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ClientSessionId !== undefined && { ClientSessionId: input.ClientSessionId }), - ...(input.Preview !== undefined && { Preview: input.Preview }), - ...(input.RecipeStep !== undefined && { RecipeStep: serializeAws_restJson1RecipeStep(input.RecipeStep, context) }), - ...(input.StepIndex !== undefined && { StepIndex: input.StepIndex }), - ...(input.ViewFrame !== undefined && { ViewFrame: serializeAws_restJson1ViewFrame(input.ViewFrame, context) }), + ...(input.ClientSessionId !== undefined && + input.ClientSessionId !== null && { ClientSessionId: input.ClientSessionId }), + ...(input.Preview !== undefined && input.Preview !== null && { Preview: input.Preview }), + ...(input.RecipeStep !== undefined && + input.RecipeStep !== null && { RecipeStep: serializeAws_restJson1RecipeStep(input.RecipeStep, context) }), + ...(input.StepIndex !== undefined && input.StepIndex !== null && { StepIndex: input.StepIndex }), + ...(input.ViewFrame !== undefined && + input.ViewFrame !== null && { ViewFrame: serializeAws_restJson1ViewFrame(input.ViewFrame, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -925,9 +908,7 @@ export const serializeAws_restJson1StartJobRunCommand = async ( input: StartJobRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{Name}/startJobRun"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -956,7 +937,7 @@ export const serializeAws_restJson1StartProjectSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{Name}/startProjectSession"; if (input.Name !== undefined) { @@ -970,7 +951,7 @@ export const serializeAws_restJson1StartProjectSessionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AssumeControl !== undefined && { AssumeControl: input.AssumeControl }), + ...(input.AssumeControl !== undefined && input.AssumeControl !== null && { AssumeControl: input.AssumeControl }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -988,9 +969,7 @@ export const serializeAws_restJson1StopJobRunCommand = async ( input: StopJobRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{Name}/jobRun/{RunId}/stopJobRun"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -1028,7 +1007,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -1042,7 +1021,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1060,9 +1039,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1095,7 +1072,7 @@ export const serializeAws_restJson1UpdateDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/datasets/{Name}"; if (input.Name !== undefined) { @@ -1109,10 +1086,12 @@ export const serializeAws_restJson1UpdateDatasetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.FormatOptions !== undefined && { - FormatOptions: serializeAws_restJson1FormatOptions(input.FormatOptions, context), - }), - ...(input.Input !== undefined && { Input: serializeAws_restJson1Input(input.Input, context) }), + ...(input.FormatOptions !== undefined && + input.FormatOptions !== null && { + FormatOptions: serializeAws_restJson1FormatOptions(input.FormatOptions, context), + }), + ...(input.Input !== undefined && + input.Input !== null && { Input: serializeAws_restJson1Input(input.Input, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1131,7 +1110,7 @@ export const serializeAws_restJson1UpdateProfileJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/profileJobs/{Name}"; if (input.Name !== undefined) { @@ -1145,16 +1124,20 @@ export const serializeAws_restJson1UpdateProfileJobCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.EncryptionKeyArn !== undefined && { EncryptionKeyArn: input.EncryptionKeyArn }), - ...(input.EncryptionMode !== undefined && { EncryptionMode: input.EncryptionMode }), - ...(input.LogSubscription !== undefined && { LogSubscription: input.LogSubscription }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MaxRetries !== undefined && { MaxRetries: input.MaxRetries }), - ...(input.OutputLocation !== undefined && { - OutputLocation: serializeAws_restJson1S3Location(input.OutputLocation, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), + ...(input.EncryptionKeyArn !== undefined && + input.EncryptionKeyArn !== null && { EncryptionKeyArn: input.EncryptionKeyArn }), + ...(input.EncryptionMode !== undefined && + input.EncryptionMode !== null && { EncryptionMode: input.EncryptionMode }), + ...(input.LogSubscription !== undefined && + input.LogSubscription !== null && { LogSubscription: input.LogSubscription }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MaxRetries !== undefined && input.MaxRetries !== null && { MaxRetries: input.MaxRetries }), + ...(input.OutputLocation !== undefined && + input.OutputLocation !== null && { + OutputLocation: serializeAws_restJson1S3Location(input.OutputLocation, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1173,7 +1156,7 @@ export const serializeAws_restJson1UpdateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{Name}"; if (input.Name !== undefined) { @@ -1187,8 +1170,9 @@ export const serializeAws_restJson1UpdateProjectCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Sample !== undefined && { Sample: serializeAws_restJson1Sample(input.Sample, context) }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Sample !== undefined && + input.Sample !== null && { Sample: serializeAws_restJson1Sample(input.Sample, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1207,7 +1191,7 @@ export const serializeAws_restJson1UpdateRecipeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/recipes/{Name}"; if (input.Name !== undefined) { @@ -1221,8 +1205,9 @@ export const serializeAws_restJson1UpdateRecipeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Steps !== undefined && { Steps: serializeAws_restJson1RecipeStepList(input.Steps, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Steps !== undefined && + input.Steps !== null && { Steps: serializeAws_restJson1RecipeStepList(input.Steps, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1241,7 +1226,7 @@ export const serializeAws_restJson1UpdateRecipeJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/recipeJobs/{Name}"; if (input.Name !== undefined) { @@ -1255,14 +1240,18 @@ export const serializeAws_restJson1UpdateRecipeJobCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.EncryptionKeyArn !== undefined && { EncryptionKeyArn: input.EncryptionKeyArn }), - ...(input.EncryptionMode !== undefined && { EncryptionMode: input.EncryptionMode }), - ...(input.LogSubscription !== undefined && { LogSubscription: input.LogSubscription }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MaxRetries !== undefined && { MaxRetries: input.MaxRetries }), - ...(input.Outputs !== undefined && { Outputs: serializeAws_restJson1OutputList(input.Outputs, context) }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), + ...(input.EncryptionKeyArn !== undefined && + input.EncryptionKeyArn !== null && { EncryptionKeyArn: input.EncryptionKeyArn }), + ...(input.EncryptionMode !== undefined && + input.EncryptionMode !== null && { EncryptionMode: input.EncryptionMode }), + ...(input.LogSubscription !== undefined && + input.LogSubscription !== null && { LogSubscription: input.LogSubscription }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MaxRetries !== undefined && input.MaxRetries !== null && { MaxRetries: input.MaxRetries }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { Outputs: serializeAws_restJson1OutputList(input.Outputs, context) }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1281,7 +1270,7 @@ export const serializeAws_restJson1UpdateScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/schedules/{Name}"; if (input.Name !== undefined) { @@ -1295,8 +1284,10 @@ export const serializeAws_restJson1UpdateScheduleCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CronExpression !== undefined && { CronExpression: input.CronExpression }), - ...(input.JobNames !== undefined && { JobNames: serializeAws_restJson1JobNameList(input.JobNames, context) }), + ...(input.CronExpression !== undefined && + input.CronExpression !== null && { CronExpression: input.CronExpression }), + ...(input.JobNames !== undefined && + input.JobNames !== null && { JobNames: serializeAws_restJson1JobNameList(input.JobNames, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4075,19 +4066,33 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1ColumnNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ConditionExpression = (input: ConditionExpression, context: __SerdeContext): any => { return { - ...(input.Condition !== undefined && { Condition: input.Condition }), - ...(input.TargetColumn !== undefined && { TargetColumn: input.TargetColumn }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Condition !== undefined && input.Condition !== null && { Condition: input.Condition }), + ...(input.TargetColumn !== undefined && input.TargetColumn !== null && { TargetColumn: input.TargetColumn }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1ConditionExpressionList = (input: ConditionExpression[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ConditionExpression(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ConditionExpression(entry, context); + }); }; const serializeAws_restJson1DataCatalogInputDefinition = ( @@ -4095,164 +4100,235 @@ const serializeAws_restJson1DataCatalogInputDefinition = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.TempDirectory !== undefined && { - TempDirectory: serializeAws_restJson1S3Location(input.TempDirectory, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.TempDirectory !== undefined && + input.TempDirectory !== null && { + TempDirectory: serializeAws_restJson1S3Location(input.TempDirectory, context), + }), }; }; const serializeAws_restJson1ExcelOptions = (input: ExcelOptions, context: __SerdeContext): any => { return { - ...(input.SheetIndexes !== undefined && { - SheetIndexes: serializeAws_restJson1SheetIndexList(input.SheetIndexes, context), - }), - ...(input.SheetNames !== undefined && { - SheetNames: serializeAws_restJson1SheetNameList(input.SheetNames, context), - }), + ...(input.SheetIndexes !== undefined && + input.SheetIndexes !== null && { + SheetIndexes: serializeAws_restJson1SheetIndexList(input.SheetIndexes, context), + }), + ...(input.SheetNames !== undefined && + input.SheetNames !== null && { SheetNames: serializeAws_restJson1SheetNameList(input.SheetNames, context) }), }; }; const serializeAws_restJson1FormatOptions = (input: FormatOptions, context: __SerdeContext): any => { return { - ...(input.Excel !== undefined && { Excel: serializeAws_restJson1ExcelOptions(input.Excel, context) }), - ...(input.Json !== undefined && { Json: serializeAws_restJson1JsonOptions(input.Json, context) }), + ...(input.Excel !== undefined && + input.Excel !== null && { Excel: serializeAws_restJson1ExcelOptions(input.Excel, context) }), + ...(input.Json !== undefined && + input.Json !== null && { Json: serializeAws_restJson1JsonOptions(input.Json, context) }), }; }; const serializeAws_restJson1HiddenColumnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Input = (input: Input, context: __SerdeContext): any => { return { - ...(input.DataCatalogInputDefinition !== undefined && { - DataCatalogInputDefinition: serializeAws_restJson1DataCatalogInputDefinition( - input.DataCatalogInputDefinition, - context - ), - }), - ...(input.S3InputDefinition !== undefined && { - S3InputDefinition: serializeAws_restJson1S3Location(input.S3InputDefinition, context), - }), + ...(input.DataCatalogInputDefinition !== undefined && + input.DataCatalogInputDefinition !== null && { + DataCatalogInputDefinition: serializeAws_restJson1DataCatalogInputDefinition( + input.DataCatalogInputDefinition, + context + ), + }), + ...(input.S3InputDefinition !== undefined && + input.S3InputDefinition !== null && { + S3InputDefinition: serializeAws_restJson1S3Location(input.S3InputDefinition, context), + }), }; }; const serializeAws_restJson1JobNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1JsonOptions = (input: JsonOptions, context: __SerdeContext): any => { return { - ...(input.MultiLine !== undefined && { MultiLine: input.MultiLine }), + ...(input.MultiLine !== undefined && input.MultiLine !== null && { MultiLine: input.MultiLine }), }; }; const serializeAws_restJson1Output = (input: Output, context: __SerdeContext): any => { return { - ...(input.CompressionFormat !== undefined && { CompressionFormat: input.CompressionFormat }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.Location !== undefined && { Location: serializeAws_restJson1S3Location(input.Location, context) }), - ...(input.Overwrite !== undefined && { Overwrite: input.Overwrite }), - ...(input.PartitionColumns !== undefined && { - PartitionColumns: serializeAws_restJson1ColumnNameList(input.PartitionColumns, context), - }), + ...(input.CompressionFormat !== undefined && + input.CompressionFormat !== null && { CompressionFormat: input.CompressionFormat }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_restJson1S3Location(input.Location, context) }), + ...(input.Overwrite !== undefined && input.Overwrite !== null && { Overwrite: input.Overwrite }), + ...(input.PartitionColumns !== undefined && + input.PartitionColumns !== null && { + PartitionColumns: serializeAws_restJson1ColumnNameList(input.PartitionColumns, context), + }), }; }; const serializeAws_restJson1OutputList = (input: Output[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Output(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Output(entry, context); + }); }; const serializeAws_restJson1ParameterMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1RecipeAction = (input: RecipeAction, context: __SerdeContext): any => { return { - ...(input.Operation !== undefined && { Operation: input.Operation }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_restJson1ParameterMap(input.Parameters, context), - }), + ...(input.Operation !== undefined && input.Operation !== null && { Operation: input.Operation }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_restJson1ParameterMap(input.Parameters, context) }), }; }; const serializeAws_restJson1RecipeReference = (input: RecipeReference, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RecipeVersion !== undefined && { RecipeVersion: input.RecipeVersion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RecipeVersion !== undefined && input.RecipeVersion !== null && { RecipeVersion: input.RecipeVersion }), }; }; const serializeAws_restJson1RecipeStep = (input: RecipeStep, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: serializeAws_restJson1RecipeAction(input.Action, context) }), - ...(input.ConditionExpressions !== undefined && { - ConditionExpressions: serializeAws_restJson1ConditionExpressionList(input.ConditionExpressions, context), - }), + ...(input.Action !== undefined && + input.Action !== null && { Action: serializeAws_restJson1RecipeAction(input.Action, context) }), + ...(input.ConditionExpressions !== undefined && + input.ConditionExpressions !== null && { + ConditionExpressions: serializeAws_restJson1ConditionExpressionList(input.ConditionExpressions, context), + }), }; }; const serializeAws_restJson1RecipeStepList = (input: RecipeStep[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1RecipeStep(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1RecipeStep(entry, context); + }); }; const serializeAws_restJson1RecipeVersionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1S3Location = (input: S3Location, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), }; }; const serializeAws_restJson1Sample = (input: Sample, context: __SerdeContext): any => { return { - ...(input.Size !== undefined && { Size: input.Size }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1SheetIndexList = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SheetNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ViewFrame = (input: ViewFrame, context: __SerdeContext): any => { return { - ...(input.ColumnRange !== undefined && { ColumnRange: input.ColumnRange }), - ...(input.HiddenColumns !== undefined && { - HiddenColumns: serializeAws_restJson1HiddenColumnList(input.HiddenColumns, context), - }), - ...(input.StartColumnIndex !== undefined && { StartColumnIndex: input.StartColumnIndex }), + ...(input.ColumnRange !== undefined && input.ColumnRange !== null && { ColumnRange: input.ColumnRange }), + ...(input.HiddenColumns !== undefined && + input.HiddenColumns !== null && { + HiddenColumns: serializeAws_restJson1HiddenColumnList(input.HiddenColumns, context), + }), + ...(input.StartColumnIndex !== undefined && + input.StartColumnIndex !== null && { StartColumnIndex: input.StartColumnIndex }), }; }; const deserializeAws_restJson1ColumnNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ConditionExpression = (output: any, context: __SerdeContext): ConditionExpression => { @@ -4267,7 +4343,14 @@ const deserializeAws_restJson1ConditionExpressionList = ( output: any, context: __SerdeContext ): ConditionExpression[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConditionExpression(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConditionExpression(entry, context); + }); }; const deserializeAws_restJson1DataCatalogInputDefinition = ( @@ -4318,7 +4401,14 @@ const deserializeAws_restJson1Dataset = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1DatasetList = (output: any, context: __SerdeContext): Dataset[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Dataset(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Dataset(entry, context); + }); }; const deserializeAws_restJson1ExcelOptions = (output: any, context: __SerdeContext): ExcelOptions => { @@ -4405,11 +4495,25 @@ const deserializeAws_restJson1Job = (output: any, context: __SerdeContext): Job }; const deserializeAws_restJson1JobList = (output: any, context: __SerdeContext): Job[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Job(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Job(entry, context); + }); }; const deserializeAws_restJson1JobNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1JobRun = (output: any, context: __SerdeContext): JobRun => { @@ -4446,7 +4550,14 @@ const deserializeAws_restJson1JobRun = (output: any, context: __SerdeContext): J }; const deserializeAws_restJson1JobRunList = (output: any, context: __SerdeContext): JobRun[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobRun(entry, context); + }); }; const deserializeAws_restJson1JsonOptions = (output: any, context: __SerdeContext): JsonOptions => { @@ -4475,17 +4586,26 @@ const deserializeAws_restJson1Output = (output: any, context: __SerdeContext): O }; const deserializeAws_restJson1OutputList = (output: any, context: __SerdeContext): Output[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Output(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Output(entry, context); + }); }; const deserializeAws_restJson1ParameterMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Project = (output: any, context: __SerdeContext): Project => { @@ -4524,7 +4644,14 @@ const deserializeAws_restJson1Project = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1ProjectList = (output: any, context: __SerdeContext): Project[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Project(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Project(entry, context); + }); }; const deserializeAws_restJson1Recipe = (output: any, context: __SerdeContext): Recipe => { @@ -4573,11 +4700,25 @@ const deserializeAws_restJson1RecipeAction = (output: any, context: __SerdeConte }; const deserializeAws_restJson1RecipeErrorList = (output: any, context: __SerdeContext): RecipeVersionErrorDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecipeVersionErrorDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecipeVersionErrorDetail(entry, context); + }); }; const deserializeAws_restJson1RecipeList = (output: any, context: __SerdeContext): Recipe[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Recipe(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Recipe(entry, context); + }); }; const deserializeAws_restJson1RecipeReference = (output: any, context: __SerdeContext): RecipeReference => { @@ -4602,7 +4743,14 @@ const deserializeAws_restJson1RecipeStep = (output: any, context: __SerdeContext }; const deserializeAws_restJson1RecipeStepList = (output: any, context: __SerdeContext): RecipeStep[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecipeStep(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecipeStep(entry, context); + }); }; const deserializeAws_restJson1RecipeVersionErrorDetail = ( @@ -4661,25 +4809,48 @@ const deserializeAws_restJson1Schedule = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1ScheduleList = (output: any, context: __SerdeContext): Schedule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Schedule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Schedule(entry, context); + }); }; const deserializeAws_restJson1SheetIndexList = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SheetNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4702,6 +4873,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-dataexchange/protocols/Aws_restJson1.ts b/clients/client-dataexchange/protocols/Aws_restJson1.ts index ed1997c87a03..9e069f76f7b4 100644 --- a/clients/client-dataexchange/protocols/Aws_restJson1.ts +++ b/clients/client-dataexchange/protocols/Aws_restJson1.ts @@ -74,9 +74,7 @@ export const serializeAws_restJson1CancelJobCommand = async ( input: CancelJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/jobs/{JobId}"; if (input.JobId !== undefined) { const labelValue: string = input.JobId; @@ -105,15 +103,16 @@ export const serializeAws_restJson1CreateDataSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/data-sets"; let body: any; body = JSON.stringify({ - ...(input.AssetType !== undefined && { AssetType: input.AssetType }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1MapOf__string(input.Tags, context) }), + ...(input.AssetType !== undefined && input.AssetType !== null && { AssetType: input.AssetType }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1MapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -132,13 +131,14 @@ export const serializeAws_restJson1CreateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/jobs"; let body: any; body = JSON.stringify({ - ...(input.Details !== undefined && { Details: serializeAws_restJson1RequestDetails(input.Details, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Details !== undefined && + input.Details !== null && { Details: serializeAws_restJson1RequestDetails(input.Details, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -157,7 +157,7 @@ export const serializeAws_restJson1CreateRevisionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/data-sets/{DataSetId}/revisions"; if (input.DataSetId !== undefined) { @@ -171,8 +171,9 @@ export const serializeAws_restJson1CreateRevisionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Comment !== undefined && { Comment: input.Comment }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1MapOf__string(input.Tags, context) }), + ...(input.Comment !== undefined && input.Comment !== null && { Comment: input.Comment }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1MapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -190,9 +191,7 @@ export const serializeAws_restJson1DeleteAssetCommand = async ( input: DeleteAssetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}"; if (input.RevisionId !== undefined) { const labelValue: string = input.RevisionId; @@ -238,9 +237,7 @@ export const serializeAws_restJson1DeleteDataSetCommand = async ( input: DeleteDataSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/data-sets/{DataSetId}"; if (input.DataSetId !== undefined) { const labelValue: string = input.DataSetId; @@ -268,9 +265,7 @@ export const serializeAws_restJson1DeleteRevisionCommand = async ( input: DeleteRevisionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/data-sets/{DataSetId}/revisions/{RevisionId}"; if (input.RevisionId !== undefined) { const labelValue: string = input.RevisionId; @@ -307,9 +302,7 @@ export const serializeAws_restJson1GetAssetCommand = async ( input: GetAssetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}"; if (input.RevisionId !== undefined) { const labelValue: string = input.RevisionId; @@ -355,9 +348,7 @@ export const serializeAws_restJson1GetDataSetCommand = async ( input: GetDataSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/data-sets/{DataSetId}"; if (input.DataSetId !== undefined) { const labelValue: string = input.DataSetId; @@ -385,9 +376,7 @@ export const serializeAws_restJson1GetJobCommand = async ( input: GetJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/jobs/{JobId}"; if (input.JobId !== undefined) { const labelValue: string = input.JobId; @@ -415,9 +404,7 @@ export const serializeAws_restJson1GetRevisionCommand = async ( input: GetRevisionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/data-sets/{DataSetId}/revisions/{RevisionId}"; if (input.DataSetId !== undefined) { const labelValue: string = input.DataSetId; @@ -454,9 +441,7 @@ export const serializeAws_restJson1ListDataSetRevisionsCommand = async ( input: ListDataSetRevisionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/data-sets/{DataSetId}/revisions"; if (input.DataSetId !== undefined) { const labelValue: string = input.DataSetId; @@ -489,9 +474,7 @@ export const serializeAws_restJson1ListDataSetsCommand = async ( input: ListDataSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/data-sets"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -516,9 +499,7 @@ export const serializeAws_restJson1ListJobsCommand = async ( input: ListJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/jobs"; const query: any = { ...(input.RevisionId !== undefined && { revisionId: input.RevisionId }), @@ -544,9 +525,7 @@ export const serializeAws_restJson1ListRevisionAssetsCommand = async ( input: ListRevisionAssetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets"; if (input.DataSetId !== undefined) { const labelValue: string = input.DataSetId; @@ -588,9 +567,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -618,9 +595,7 @@ export const serializeAws_restJson1StartJobCommand = async ( input: StartJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/jobs/{JobId}"; if (input.JobId !== undefined) { const labelValue: string = input.JobId; @@ -649,7 +624,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -663,7 +638,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1MapOf__string(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1MapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -681,9 +657,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -716,7 +690,7 @@ export const serializeAws_restJson1UpdateAssetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}"; if (input.RevisionId !== undefined) { @@ -748,7 +722,7 @@ export const serializeAws_restJson1UpdateAssetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -767,7 +741,7 @@ export const serializeAws_restJson1UpdateDataSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/data-sets/{DataSetId}"; if (input.DataSetId !== undefined) { @@ -781,8 +755,8 @@ export const serializeAws_restJson1UpdateDataSetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -801,7 +775,7 @@ export const serializeAws_restJson1UpdateRevisionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/data-sets/{DataSetId}/revisions/{RevisionId}"; if (input.RevisionId !== undefined) { @@ -824,8 +798,8 @@ export const serializeAws_restJson1UpdateRevisionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Comment !== undefined && { Comment: input.Comment }), - ...(input.Finalized !== undefined && { Finalized: input.Finalized }), + ...(input.Comment !== undefined && input.Comment !== null && { Comment: input.Comment }), + ...(input.Finalized !== undefined && input.Finalized !== null && { Finalized: input.Finalized }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3086,16 +3060,16 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1AssetDestinationEntry = (input: AssetDestinationEntry, context: __SerdeContext): any => { return { - ...(input.AssetId !== undefined && { AssetId: input.AssetId }), - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Key !== undefined && { Key: input.Key }), + ...(input.AssetId !== undefined && input.AssetId !== null && { AssetId: input.AssetId }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), }; }; const serializeAws_restJson1AssetSourceEntry = (input: AssetSourceEntry, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), }; }; @@ -3104,14 +3078,16 @@ const serializeAws_restJson1ExportAssetsToS3RequestDetails = ( context: __SerdeContext ): any => { return { - ...(input.AssetDestinations !== undefined && { - AssetDestinations: serializeAws_restJson1ListOfAssetDestinationEntry(input.AssetDestinations, context), - }), - ...(input.DataSetId !== undefined && { DataSetId: input.DataSetId }), - ...(input.Encryption !== undefined && { - Encryption: serializeAws_restJson1ExportServerSideEncryption(input.Encryption, context), - }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), + ...(input.AssetDestinations !== undefined && + input.AssetDestinations !== null && { + AssetDestinations: serializeAws_restJson1ListOfAssetDestinationEntry(input.AssetDestinations, context), + }), + ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { + Encryption: serializeAws_restJson1ExportServerSideEncryption(input.Encryption, context), + }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), }; }; @@ -3120,9 +3096,9 @@ const serializeAws_restJson1ExportAssetToSignedUrlRequestDetails = ( context: __SerdeContext ): any => { return { - ...(input.AssetId !== undefined && { AssetId: input.AssetId }), - ...(input.DataSetId !== undefined && { DataSetId: input.DataSetId }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), + ...(input.AssetId !== undefined && input.AssetId !== null && { AssetId: input.AssetId }), + ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), }; }; @@ -3131,8 +3107,8 @@ const serializeAws_restJson1ExportServerSideEncryption = ( context: __SerdeContext ): any => { return { - ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -3141,10 +3117,10 @@ const serializeAws_restJson1ImportAssetFromSignedUrlRequestDetails = ( context: __SerdeContext ): any => { return { - ...(input.AssetName !== undefined && { AssetName: input.AssetName }), - ...(input.DataSetId !== undefined && { DataSetId: input.DataSetId }), - ...(input.Md5Hash !== undefined && { Md5Hash: input.Md5Hash }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), + ...(input.AssetName !== undefined && input.AssetName !== null && { AssetName: input.AssetName }), + ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }), + ...(input.Md5Hash !== undefined && input.Md5Hash !== null && { Md5Hash: input.Md5Hash }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), }; }; @@ -3153,11 +3129,12 @@ const serializeAws_restJson1ImportAssetsFromS3RequestDetails = ( context: __SerdeContext ): any => { return { - ...(input.AssetSources !== undefined && { - AssetSources: serializeAws_restJson1ListOfAssetSourceEntry(input.AssetSources, context), - }), - ...(input.DataSetId !== undefined && { DataSetId: input.DataSetId }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), + ...(input.AssetSources !== undefined && + input.AssetSources !== null && { + AssetSources: serializeAws_restJson1ListOfAssetSourceEntry(input.AssetSources, context), + }), + ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), }; }; @@ -3165,43 +3142,63 @@ const serializeAws_restJson1ListOfAssetDestinationEntry = ( input: AssetDestinationEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AssetDestinationEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetDestinationEntry(entry, context); + }); }; const serializeAws_restJson1ListOfAssetSourceEntry = (input: AssetSourceEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AssetSourceEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetSourceEntry(entry, context); + }); }; const serializeAws_restJson1MapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1RequestDetails = (input: RequestDetails, context: __SerdeContext): any => { return { - ...(input.ExportAssetToSignedUrl !== undefined && { - ExportAssetToSignedUrl: serializeAws_restJson1ExportAssetToSignedUrlRequestDetails( - input.ExportAssetToSignedUrl, - context - ), - }), - ...(input.ExportAssetsToS3 !== undefined && { - ExportAssetsToS3: serializeAws_restJson1ExportAssetsToS3RequestDetails(input.ExportAssetsToS3, context), - }), - ...(input.ImportAssetFromSignedUrl !== undefined && { - ImportAssetFromSignedUrl: serializeAws_restJson1ImportAssetFromSignedUrlRequestDetails( - input.ImportAssetFromSignedUrl, - context - ), - }), - ...(input.ImportAssetsFromS3 !== undefined && { - ImportAssetsFromS3: serializeAws_restJson1ImportAssetsFromS3RequestDetails(input.ImportAssetsFromS3, context), - }), + ...(input.ExportAssetToSignedUrl !== undefined && + input.ExportAssetToSignedUrl !== null && { + ExportAssetToSignedUrl: serializeAws_restJson1ExportAssetToSignedUrlRequestDetails( + input.ExportAssetToSignedUrl, + context + ), + }), + ...(input.ExportAssetsToS3 !== undefined && + input.ExportAssetsToS3 !== null && { + ExportAssetsToS3: serializeAws_restJson1ExportAssetsToS3RequestDetails(input.ExportAssetsToS3, context), + }), + ...(input.ImportAssetFromSignedUrl !== undefined && + input.ImportAssetFromSignedUrl !== null && { + ImportAssetFromSignedUrl: serializeAws_restJson1ImportAssetFromSignedUrlRequestDetails( + input.ImportAssetFromSignedUrl, + context + ), + }), + ...(input.ImportAssetsFromS3 !== undefined && + input.ImportAssetsFromS3 !== null && { + ImportAssetsFromS3: serializeAws_restJson1ImportAssetsFromS3RequestDetails(input.ImportAssetsFromS3, context), + }), }; }; @@ -3404,41 +3401,92 @@ const deserializeAws_restJson1ListOfAssetDestinationEntry = ( output: any, context: __SerdeContext ): AssetDestinationEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetDestinationEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetDestinationEntry(entry, context); + }); }; const deserializeAws_restJson1ListOfAssetEntry = (output: any, context: __SerdeContext): AssetEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetEntry(entry, context); + }); }; const deserializeAws_restJson1ListOfAssetSourceEntry = (output: any, context: __SerdeContext): AssetSourceEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetSourceEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetSourceEntry(entry, context); + }); }; const deserializeAws_restJson1ListOfDataSetEntry = (output: any, context: __SerdeContext): DataSetEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataSetEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataSetEntry(entry, context); + }); }; const deserializeAws_restJson1ListOfJobEntry = (output: any, context: __SerdeContext): JobEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobEntry(entry, context); + }); }; const deserializeAws_restJson1ListOfJobError = (output: any, context: __SerdeContext): JobError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobError(entry, context); + }); }; const deserializeAws_restJson1ListOfRevisionEntry = (output: any, context: __SerdeContext): RevisionEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RevisionEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RevisionEntry(entry, context); + }); }; const deserializeAws_restJson1MapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1OriginDetails = (output: any, context: __SerdeContext): OriginDetails => { @@ -3507,6 +3555,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-datasync/protocols/Aws_json1_1.ts b/clients/client-datasync/protocols/Aws_json1_1.ts index e649cf33c6aa..3228cb1c7193 100644 --- a/clients/client-datasync/protocols/Aws_json1_1.ts +++ b/clients/client-datasync/protocols/Aws_json1_1.ts @@ -163,7 +163,7 @@ export const serializeAws_json1_1CancelTaskExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.CancelTaskExecution", }; let body: any; @@ -176,7 +176,7 @@ export const serializeAws_json1_1CreateAgentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.CreateAgent", }; let body: any; @@ -189,7 +189,7 @@ export const serializeAws_json1_1CreateLocationEfsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.CreateLocationEfs", }; let body: any; @@ -202,7 +202,7 @@ export const serializeAws_json1_1CreateLocationFsxWindowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.CreateLocationFsxWindows", }; let body: any; @@ -215,7 +215,7 @@ export const serializeAws_json1_1CreateLocationNfsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.CreateLocationNfs", }; let body: any; @@ -228,7 +228,7 @@ export const serializeAws_json1_1CreateLocationObjectStorageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.CreateLocationObjectStorage", }; let body: any; @@ -241,7 +241,7 @@ export const serializeAws_json1_1CreateLocationS3Command = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.CreateLocationS3", }; let body: any; @@ -254,7 +254,7 @@ export const serializeAws_json1_1CreateLocationSmbCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.CreateLocationSmb", }; let body: any; @@ -267,7 +267,7 @@ export const serializeAws_json1_1CreateTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.CreateTask", }; let body: any; @@ -280,7 +280,7 @@ export const serializeAws_json1_1DeleteAgentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DeleteAgent", }; let body: any; @@ -293,7 +293,7 @@ export const serializeAws_json1_1DeleteLocationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DeleteLocation", }; let body: any; @@ -306,7 +306,7 @@ export const serializeAws_json1_1DeleteTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DeleteTask", }; let body: any; @@ -319,7 +319,7 @@ export const serializeAws_json1_1DescribeAgentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DescribeAgent", }; let body: any; @@ -332,7 +332,7 @@ export const serializeAws_json1_1DescribeLocationEfsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DescribeLocationEfs", }; let body: any; @@ -345,7 +345,7 @@ export const serializeAws_json1_1DescribeLocationFsxWindowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DescribeLocationFsxWindows", }; let body: any; @@ -358,7 +358,7 @@ export const serializeAws_json1_1DescribeLocationNfsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DescribeLocationNfs", }; let body: any; @@ -371,7 +371,7 @@ export const serializeAws_json1_1DescribeLocationObjectStorageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DescribeLocationObjectStorage", }; let body: any; @@ -384,7 +384,7 @@ export const serializeAws_json1_1DescribeLocationS3Command = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DescribeLocationS3", }; let body: any; @@ -397,7 +397,7 @@ export const serializeAws_json1_1DescribeLocationSmbCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DescribeLocationSmb", }; let body: any; @@ -410,7 +410,7 @@ export const serializeAws_json1_1DescribeTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DescribeTask", }; let body: any; @@ -423,7 +423,7 @@ export const serializeAws_json1_1DescribeTaskExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.DescribeTaskExecution", }; let body: any; @@ -436,7 +436,7 @@ export const serializeAws_json1_1ListAgentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.ListAgents", }; let body: any; @@ -449,7 +449,7 @@ export const serializeAws_json1_1ListLocationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.ListLocations", }; let body: any; @@ -462,7 +462,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.ListTagsForResource", }; let body: any; @@ -475,7 +475,7 @@ export const serializeAws_json1_1ListTaskExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.ListTaskExecutions", }; let body: any; @@ -488,7 +488,7 @@ export const serializeAws_json1_1ListTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.ListTasks", }; let body: any; @@ -501,7 +501,7 @@ export const serializeAws_json1_1StartTaskExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.StartTaskExecution", }; let body: any; @@ -514,7 +514,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.TagResource", }; let body: any; @@ -527,7 +527,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.UntagResource", }; let body: any; @@ -540,7 +540,7 @@ export const serializeAws_json1_1UpdateAgentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.UpdateAgent", }; let body: any; @@ -553,7 +553,7 @@ export const serializeAws_json1_1UpdateTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.UpdateTask", }; let body: any; @@ -566,7 +566,7 @@ export const serializeAws_json1_1UpdateTaskExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "FmrsService.UpdateTaskExecution", }; let body: any; @@ -601,8 +601,7 @@ const deserializeAws_json1_1CancelTaskExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -664,8 +663,7 @@ const deserializeAws_json1_1CreateAgentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -727,8 +725,7 @@ const deserializeAws_json1_1CreateLocationEfsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -790,8 +787,7 @@ const deserializeAws_json1_1CreateLocationFsxWindowsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -853,8 +849,7 @@ const deserializeAws_json1_1CreateLocationNfsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -916,8 +911,7 @@ const deserializeAws_json1_1CreateLocationObjectStorageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -979,8 +973,7 @@ const deserializeAws_json1_1CreateLocationS3CommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1042,8 +1035,7 @@ const deserializeAws_json1_1CreateLocationSmbCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1105,8 +1097,7 @@ const deserializeAws_json1_1CreateTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1168,8 +1159,7 @@ const deserializeAws_json1_1DeleteAgentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1231,8 +1221,7 @@ const deserializeAws_json1_1DeleteLocationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1294,8 +1283,7 @@ const deserializeAws_json1_1DeleteTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1357,8 +1345,7 @@ const deserializeAws_json1_1DescribeAgentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1420,8 +1407,7 @@ const deserializeAws_json1_1DescribeLocationEfsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1483,8 +1469,7 @@ const deserializeAws_json1_1DescribeLocationFsxWindowsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1546,8 +1531,7 @@ const deserializeAws_json1_1DescribeLocationNfsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1609,8 +1593,7 @@ const deserializeAws_json1_1DescribeLocationObjectStorageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1672,8 +1655,7 @@ const deserializeAws_json1_1DescribeLocationS3CommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1735,8 +1717,7 @@ const deserializeAws_json1_1DescribeLocationSmbCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1798,8 +1779,7 @@ const deserializeAws_json1_1DescribeTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1861,8 +1841,7 @@ const deserializeAws_json1_1DescribeTaskExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1924,8 +1903,7 @@ const deserializeAws_json1_1ListAgentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -1987,8 +1965,7 @@ const deserializeAws_json1_1ListLocationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2050,8 +2027,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2113,8 +2089,7 @@ const deserializeAws_json1_1ListTaskExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2176,8 +2151,7 @@ const deserializeAws_json1_1ListTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2239,8 +2213,7 @@ const deserializeAws_json1_1StartTaskExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2302,8 +2275,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2365,8 +2337,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2428,8 +2399,7 @@ const deserializeAws_json1_1UpdateAgentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2491,8 +2461,7 @@ const deserializeAws_json1_1UpdateTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2554,8 +2523,7 @@ const deserializeAws_json1_1UpdateTaskExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.datasync#InternalException": @@ -2621,7 +2589,14 @@ const deserializeAws_json1_1InvalidRequestExceptionResponse = async ( }; const serializeAws_json1_1AgentArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CancelTaskExecutionRequest = ( @@ -2629,22 +2604,24 @@ const serializeAws_json1_1CancelTaskExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.TaskExecutionArn !== undefined && { TaskExecutionArn: input.TaskExecutionArn }), + ...(input.TaskExecutionArn !== undefined && + input.TaskExecutionArn !== null && { TaskExecutionArn: input.TaskExecutionArn }), }; }; const serializeAws_json1_1CreateAgentRequest = (input: CreateAgentRequest, context: __SerdeContext): any => { return { - ...(input.ActivationKey !== undefined && { ActivationKey: input.ActivationKey }), - ...(input.AgentName !== undefined && { AgentName: input.AgentName }), - ...(input.SecurityGroupArns !== undefined && { - SecurityGroupArns: serializeAws_json1_1PLSecurityGroupArnList(input.SecurityGroupArns, context), - }), - ...(input.SubnetArns !== undefined && { - SubnetArns: serializeAws_json1_1PLSubnetArnList(input.SubnetArns, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), - ...(input.VpcEndpointId !== undefined && { VpcEndpointId: input.VpcEndpointId }), + ...(input.ActivationKey !== undefined && input.ActivationKey !== null && { ActivationKey: input.ActivationKey }), + ...(input.AgentName !== undefined && input.AgentName !== null && { AgentName: input.AgentName }), + ...(input.SecurityGroupArns !== undefined && + input.SecurityGroupArns !== null && { + SecurityGroupArns: serializeAws_json1_1PLSecurityGroupArnList(input.SecurityGroupArns, context), + }), + ...(input.SubnetArns !== undefined && + input.SubnetArns !== null && { SubnetArns: serializeAws_json1_1PLSubnetArnList(input.SubnetArns, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), + ...(input.VpcEndpointId !== undefined && input.VpcEndpointId !== null && { VpcEndpointId: input.VpcEndpointId }), }; }; @@ -2653,10 +2630,13 @@ const serializeAws_json1_1CreateLocationEfsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Ec2Config !== undefined && { Ec2Config: serializeAws_json1_1Ec2Config(input.Ec2Config, context) }), - ...(input.EfsFilesystemArn !== undefined && { EfsFilesystemArn: input.EfsFilesystemArn }), - ...(input.Subdirectory !== undefined && { Subdirectory: input.Subdirectory }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), + ...(input.Ec2Config !== undefined && + input.Ec2Config !== null && { Ec2Config: serializeAws_json1_1Ec2Config(input.Ec2Config, context) }), + ...(input.EfsFilesystemArn !== undefined && + input.EfsFilesystemArn !== null && { EfsFilesystemArn: input.EfsFilesystemArn }), + ...(input.Subdirectory !== undefined && input.Subdirectory !== null && { Subdirectory: input.Subdirectory }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), }; }; @@ -2665,15 +2645,18 @@ const serializeAws_json1_1CreateLocationFsxWindowsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.FsxFilesystemArn !== undefined && { FsxFilesystemArn: input.FsxFilesystemArn }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.SecurityGroupArns !== undefined && { - SecurityGroupArns: serializeAws_json1_1Ec2SecurityGroupArnList(input.SecurityGroupArns, context), - }), - ...(input.Subdirectory !== undefined && { Subdirectory: input.Subdirectory }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), - ...(input.User !== undefined && { User: input.User }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.FsxFilesystemArn !== undefined && + input.FsxFilesystemArn !== null && { FsxFilesystemArn: input.FsxFilesystemArn }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.SecurityGroupArns !== undefined && + input.SecurityGroupArns !== null && { + SecurityGroupArns: serializeAws_json1_1Ec2SecurityGroupArnList(input.SecurityGroupArns, context), + }), + ...(input.Subdirectory !== undefined && input.Subdirectory !== null && { Subdirectory: input.Subdirectory }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), + ...(input.User !== undefined && input.User !== null && { User: input.User }), }; }; @@ -2682,15 +2665,17 @@ const serializeAws_json1_1CreateLocationNfsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MountOptions !== undefined && { - MountOptions: serializeAws_json1_1NfsMountOptions(input.MountOptions, context), - }), - ...(input.OnPremConfig !== undefined && { - OnPremConfig: serializeAws_json1_1OnPremConfig(input.OnPremConfig, context), - }), - ...(input.ServerHostname !== undefined && { ServerHostname: input.ServerHostname }), - ...(input.Subdirectory !== undefined && { Subdirectory: input.Subdirectory }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), + ...(input.MountOptions !== undefined && + input.MountOptions !== null && { + MountOptions: serializeAws_json1_1NfsMountOptions(input.MountOptions, context), + }), + ...(input.OnPremConfig !== undefined && + input.OnPremConfig !== null && { OnPremConfig: serializeAws_json1_1OnPremConfig(input.OnPremConfig, context) }), + ...(input.ServerHostname !== undefined && + input.ServerHostname !== null && { ServerHostname: input.ServerHostname }), + ...(input.Subdirectory !== undefined && input.Subdirectory !== null && { Subdirectory: input.Subdirectory }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), }; }; @@ -2699,26 +2684,34 @@ const serializeAws_json1_1CreateLocationObjectStorageRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccessKey !== undefined && { AccessKey: input.AccessKey }), - ...(input.AgentArns !== undefined && { AgentArns: serializeAws_json1_1AgentArnList(input.AgentArns, context) }), - ...(input.BucketName !== undefined && { BucketName: input.BucketName }), - ...(input.SecretKey !== undefined && { SecretKey: input.SecretKey }), - ...(input.ServerHostname !== undefined && { ServerHostname: input.ServerHostname }), - ...(input.ServerPort !== undefined && { ServerPort: input.ServerPort }), - ...(input.ServerProtocol !== undefined && { ServerProtocol: input.ServerProtocol }), - ...(input.Subdirectory !== undefined && { Subdirectory: input.Subdirectory }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), + ...(input.AccessKey !== undefined && input.AccessKey !== null && { AccessKey: input.AccessKey }), + ...(input.AgentArns !== undefined && + input.AgentArns !== null && { AgentArns: serializeAws_json1_1AgentArnList(input.AgentArns, context) }), + ...(input.BucketName !== undefined && input.BucketName !== null && { BucketName: input.BucketName }), + ...(input.SecretKey !== undefined && input.SecretKey !== null && { SecretKey: input.SecretKey }), + ...(input.ServerHostname !== undefined && + input.ServerHostname !== null && { ServerHostname: input.ServerHostname }), + ...(input.ServerPort !== undefined && input.ServerPort !== null && { ServerPort: input.ServerPort }), + ...(input.ServerProtocol !== undefined && + input.ServerProtocol !== null && { ServerProtocol: input.ServerProtocol }), + ...(input.Subdirectory !== undefined && input.Subdirectory !== null && { Subdirectory: input.Subdirectory }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateLocationS3Request = (input: CreateLocationS3Request, context: __SerdeContext): any => { return { - ...(input.AgentArns !== undefined && { AgentArns: serializeAws_json1_1AgentArnList(input.AgentArns, context) }), - ...(input.S3BucketArn !== undefined && { S3BucketArn: input.S3BucketArn }), - ...(input.S3Config !== undefined && { S3Config: serializeAws_json1_1S3Config(input.S3Config, context) }), - ...(input.S3StorageClass !== undefined && { S3StorageClass: input.S3StorageClass }), - ...(input.Subdirectory !== undefined && { Subdirectory: input.Subdirectory }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), + ...(input.AgentArns !== undefined && + input.AgentArns !== null && { AgentArns: serializeAws_json1_1AgentArnList(input.AgentArns, context) }), + ...(input.S3BucketArn !== undefined && input.S3BucketArn !== null && { S3BucketArn: input.S3BucketArn }), + ...(input.S3Config !== undefined && + input.S3Config !== null && { S3Config: serializeAws_json1_1S3Config(input.S3Config, context) }), + ...(input.S3StorageClass !== undefined && + input.S3StorageClass !== null && { S3StorageClass: input.S3StorageClass }), + ...(input.Subdirectory !== undefined && input.Subdirectory !== null && { Subdirectory: input.Subdirectory }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), }; }; @@ -2727,53 +2720,64 @@ const serializeAws_json1_1CreateLocationSmbRequest = ( context: __SerdeContext ): any => { return { - ...(input.AgentArns !== undefined && { AgentArns: serializeAws_json1_1AgentArnList(input.AgentArns, context) }), - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.MountOptions !== undefined && { - MountOptions: serializeAws_json1_1SmbMountOptions(input.MountOptions, context), - }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.ServerHostname !== undefined && { ServerHostname: input.ServerHostname }), - ...(input.Subdirectory !== undefined && { Subdirectory: input.Subdirectory }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), - ...(input.User !== undefined && { User: input.User }), + ...(input.AgentArns !== undefined && + input.AgentArns !== null && { AgentArns: serializeAws_json1_1AgentArnList(input.AgentArns, context) }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.MountOptions !== undefined && + input.MountOptions !== null && { + MountOptions: serializeAws_json1_1SmbMountOptions(input.MountOptions, context), + }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.ServerHostname !== undefined && + input.ServerHostname !== null && { ServerHostname: input.ServerHostname }), + ...(input.Subdirectory !== undefined && input.Subdirectory !== null && { Subdirectory: input.Subdirectory }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), + ...(input.User !== undefined && input.User !== null && { User: input.User }), }; }; const serializeAws_json1_1CreateTaskRequest = (input: CreateTaskRequest, context: __SerdeContext): any => { return { - ...(input.CloudWatchLogGroupArn !== undefined && { CloudWatchLogGroupArn: input.CloudWatchLogGroupArn }), - ...(input.DestinationLocationArn !== undefined && { DestinationLocationArn: input.DestinationLocationArn }), - ...(input.Excludes !== undefined && { Excludes: serializeAws_json1_1FilterList(input.Excludes, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Options !== undefined && { Options: serializeAws_json1_1Options(input.Options, context) }), - ...(input.Schedule !== undefined && { Schedule: serializeAws_json1_1TaskSchedule(input.Schedule, context) }), - ...(input.SourceLocationArn !== undefined && { SourceLocationArn: input.SourceLocationArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), + ...(input.CloudWatchLogGroupArn !== undefined && + input.CloudWatchLogGroupArn !== null && { CloudWatchLogGroupArn: input.CloudWatchLogGroupArn }), + ...(input.DestinationLocationArn !== undefined && + input.DestinationLocationArn !== null && { DestinationLocationArn: input.DestinationLocationArn }), + ...(input.Excludes !== undefined && + input.Excludes !== null && { Excludes: serializeAws_json1_1FilterList(input.Excludes, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Options !== undefined && + input.Options !== null && { Options: serializeAws_json1_1Options(input.Options, context) }), + ...(input.Schedule !== undefined && + input.Schedule !== null && { Schedule: serializeAws_json1_1TaskSchedule(input.Schedule, context) }), + ...(input.SourceLocationArn !== undefined && + input.SourceLocationArn !== null && { SourceLocationArn: input.SourceLocationArn }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), }; }; const serializeAws_json1_1DeleteAgentRequest = (input: DeleteAgentRequest, context: __SerdeContext): any => { return { - ...(input.AgentArn !== undefined && { AgentArn: input.AgentArn }), + ...(input.AgentArn !== undefined && input.AgentArn !== null && { AgentArn: input.AgentArn }), }; }; const serializeAws_json1_1DeleteLocationRequest = (input: DeleteLocationRequest, context: __SerdeContext): any => { return { - ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }), + ...(input.LocationArn !== undefined && input.LocationArn !== null && { LocationArn: input.LocationArn }), }; }; const serializeAws_json1_1DeleteTaskRequest = (input: DeleteTaskRequest, context: __SerdeContext): any => { return { - ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }), + ...(input.TaskArn !== undefined && input.TaskArn !== null && { TaskArn: input.TaskArn }), }; }; const serializeAws_json1_1DescribeAgentRequest = (input: DescribeAgentRequest, context: __SerdeContext): any => { return { - ...(input.AgentArn !== undefined && { AgentArn: input.AgentArn }), + ...(input.AgentArn !== undefined && input.AgentArn !== null && { AgentArn: input.AgentArn }), }; }; @@ -2782,7 +2786,7 @@ const serializeAws_json1_1DescribeLocationEfsRequest = ( context: __SerdeContext ): any => { return { - ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }), + ...(input.LocationArn !== undefined && input.LocationArn !== null && { LocationArn: input.LocationArn }), }; }; @@ -2791,7 +2795,7 @@ const serializeAws_json1_1DescribeLocationFsxWindowsRequest = ( context: __SerdeContext ): any => { return { - ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }), + ...(input.LocationArn !== undefined && input.LocationArn !== null && { LocationArn: input.LocationArn }), }; }; @@ -2800,7 +2804,7 @@ const serializeAws_json1_1DescribeLocationNfsRequest = ( context: __SerdeContext ): any => { return { - ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }), + ...(input.LocationArn !== undefined && input.LocationArn !== null && { LocationArn: input.LocationArn }), }; }; @@ -2809,7 +2813,7 @@ const serializeAws_json1_1DescribeLocationObjectStorageRequest = ( context: __SerdeContext ): any => { return { - ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }), + ...(input.LocationArn !== undefined && input.LocationArn !== null && { LocationArn: input.LocationArn }), }; }; @@ -2818,7 +2822,7 @@ const serializeAws_json1_1DescribeLocationS3Request = ( context: __SerdeContext ): any => { return { - ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }), + ...(input.LocationArn !== undefined && input.LocationArn !== null && { LocationArn: input.LocationArn }), }; }; @@ -2827,7 +2831,7 @@ const serializeAws_json1_1DescribeLocationSmbRequest = ( context: __SerdeContext ): any => { return { - ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }), + ...(input.LocationArn !== undefined && input.LocationArn !== null && { LocationArn: input.LocationArn }), }; }; @@ -2836,60 +2840,91 @@ const serializeAws_json1_1DescribeTaskExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.TaskExecutionArn !== undefined && { TaskExecutionArn: input.TaskExecutionArn }), + ...(input.TaskExecutionArn !== undefined && + input.TaskExecutionArn !== null && { TaskExecutionArn: input.TaskExecutionArn }), }; }; const serializeAws_json1_1DescribeTaskRequest = (input: DescribeTaskRequest, context: __SerdeContext): any => { return { - ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }), + ...(input.TaskArn !== undefined && input.TaskArn !== null && { TaskArn: input.TaskArn }), }; }; const serializeAws_json1_1Ec2Config = (input: Ec2Config, context: __SerdeContext): any => { return { - ...(input.SecurityGroupArns !== undefined && { - SecurityGroupArns: serializeAws_json1_1Ec2SecurityGroupArnList(input.SecurityGroupArns, context), - }), - ...(input.SubnetArn !== undefined && { SubnetArn: input.SubnetArn }), + ...(input.SecurityGroupArns !== undefined && + input.SecurityGroupArns !== null && { + SecurityGroupArns: serializeAws_json1_1Ec2SecurityGroupArnList(input.SecurityGroupArns, context), + }), + ...(input.SubnetArn !== undefined && input.SubnetArn !== null && { SubnetArn: input.SubnetArn }), }; }; const serializeAws_json1_1Ec2SecurityGroupArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FilterList = (input: FilterRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FilterRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FilterRule(entry, context); + }); }; const serializeAws_json1_1FilterRule = (input: FilterRule, context: __SerdeContext): any => { return { - ...(input.FilterType !== undefined && { FilterType: input.FilterType }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.FilterType !== undefined && input.FilterType !== null && { FilterType: input.FilterType }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1FilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InputTagList = (input: TagListEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TagListEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TagListEntry(entry, context); + }); }; const serializeAws_json1_1ListAgentsRequest = (input: ListAgentsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListLocationsRequest = (input: ListLocationsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1LocationFilters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1LocationFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2898,9 +2933,9 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -2909,79 +2944,108 @@ const serializeAws_json1_1ListTaskExecutionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TaskArn !== undefined && input.TaskArn !== null && { TaskArn: input.TaskArn }), }; }; const serializeAws_json1_1ListTasksRequest = (input: ListTasksRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1TaskFilters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1TaskFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1LocationFilter = (input: LocationFilter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Operator !== undefined && { Operator: input.Operator }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Operator !== undefined && input.Operator !== null && { Operator: input.Operator }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), }; }; const serializeAws_json1_1LocationFilters = (input: LocationFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1LocationFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1LocationFilter(entry, context); + }); }; const serializeAws_json1_1NfsMountOptions = (input: NfsMountOptions, context: __SerdeContext): any => { return { - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_json1_1OnPremConfig = (input: OnPremConfig, context: __SerdeContext): any => { return { - ...(input.AgentArns !== undefined && { AgentArns: serializeAws_json1_1AgentArnList(input.AgentArns, context) }), + ...(input.AgentArns !== undefined && + input.AgentArns !== null && { AgentArns: serializeAws_json1_1AgentArnList(input.AgentArns, context) }), }; }; const serializeAws_json1_1Options = (input: Options, context: __SerdeContext): any => { return { - ...(input.Atime !== undefined && { Atime: input.Atime }), - ...(input.BytesPerSecond !== undefined && { BytesPerSecond: input.BytesPerSecond }), - ...(input.Gid !== undefined && { Gid: input.Gid }), - ...(input.LogLevel !== undefined && { LogLevel: input.LogLevel }), - ...(input.Mtime !== undefined && { Mtime: input.Mtime }), - ...(input.OverwriteMode !== undefined && { OverwriteMode: input.OverwriteMode }), - ...(input.PosixPermissions !== undefined && { PosixPermissions: input.PosixPermissions }), - ...(input.PreserveDeletedFiles !== undefined && { PreserveDeletedFiles: input.PreserveDeletedFiles }), - ...(input.PreserveDevices !== undefined && { PreserveDevices: input.PreserveDevices }), - ...(input.TaskQueueing !== undefined && { TaskQueueing: input.TaskQueueing }), - ...(input.TransferMode !== undefined && { TransferMode: input.TransferMode }), - ...(input.Uid !== undefined && { Uid: input.Uid }), - ...(input.VerifyMode !== undefined && { VerifyMode: input.VerifyMode }), + ...(input.Atime !== undefined && input.Atime !== null && { Atime: input.Atime }), + ...(input.BytesPerSecond !== undefined && + input.BytesPerSecond !== null && { BytesPerSecond: input.BytesPerSecond }), + ...(input.Gid !== undefined && input.Gid !== null && { Gid: input.Gid }), + ...(input.LogLevel !== undefined && input.LogLevel !== null && { LogLevel: input.LogLevel }), + ...(input.Mtime !== undefined && input.Mtime !== null && { Mtime: input.Mtime }), + ...(input.OverwriteMode !== undefined && input.OverwriteMode !== null && { OverwriteMode: input.OverwriteMode }), + ...(input.PosixPermissions !== undefined && + input.PosixPermissions !== null && { PosixPermissions: input.PosixPermissions }), + ...(input.PreserveDeletedFiles !== undefined && + input.PreserveDeletedFiles !== null && { PreserveDeletedFiles: input.PreserveDeletedFiles }), + ...(input.PreserveDevices !== undefined && + input.PreserveDevices !== null && { PreserveDevices: input.PreserveDevices }), + ...(input.TaskQueueing !== undefined && input.TaskQueueing !== null && { TaskQueueing: input.TaskQueueing }), + ...(input.TransferMode !== undefined && input.TransferMode !== null && { TransferMode: input.TransferMode }), + ...(input.Uid !== undefined && input.Uid !== null && { Uid: input.Uid }), + ...(input.VerifyMode !== undefined && input.VerifyMode !== null && { VerifyMode: input.VerifyMode }), }; }; const serializeAws_json1_1PLSecurityGroupArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PLSubnetArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1S3Config = (input: S3Config, context: __SerdeContext): any => { return { - ...(input.BucketAccessRoleArn !== undefined && { BucketAccessRoleArn: input.BucketAccessRoleArn }), + ...(input.BucketAccessRoleArn !== undefined && + input.BucketAccessRoleArn !== null && { BucketAccessRoleArn: input.BucketAccessRoleArn }), }; }; const serializeAws_json1_1SmbMountOptions = (input: SmbMountOptions, context: __SerdeContext): any => { return { - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -2990,61 +3054,81 @@ const serializeAws_json1_1StartTaskExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.Includes !== undefined && { Includes: serializeAws_json1_1FilterList(input.Includes, context) }), - ...(input.OverrideOptions !== undefined && { - OverrideOptions: serializeAws_json1_1Options(input.OverrideOptions, context), - }), - ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }), + ...(input.Includes !== undefined && + input.Includes !== null && { Includes: serializeAws_json1_1FilterList(input.Includes, context) }), + ...(input.OverrideOptions !== undefined && + input.OverrideOptions !== null && { + OverrideOptions: serializeAws_json1_1Options(input.OverrideOptions, context), + }), + ...(input.TaskArn !== undefined && input.TaskArn !== null && { TaskArn: input.TaskArn }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagListEntry = (input: TagListEntry, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1InputTagList(input.Tags, context) }), }; }; const serializeAws_json1_1TaskFilter = (input: TaskFilter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Operator !== undefined && { Operator: input.Operator }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Operator !== undefined && input.Operator !== null && { Operator: input.Operator }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), }; }; const serializeAws_json1_1TaskFilters = (input: TaskFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TaskFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TaskFilter(entry, context); + }); }; const serializeAws_json1_1TaskSchedule = (input: TaskSchedule, context: __SerdeContext): any => { return { - ...(input.ScheduleExpression !== undefined && { ScheduleExpression: input.ScheduleExpression }), + ...(input.ScheduleExpression !== undefined && + input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.Keys !== undefined && { Keys: serializeAws_json1_1TagKeyList(input.Keys, context) }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Keys !== undefined && + input.Keys !== null && { Keys: serializeAws_json1_1TagKeyList(input.Keys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1UpdateAgentRequest = (input: UpdateAgentRequest, context: __SerdeContext): any => { return { - ...(input.AgentArn !== undefined && { AgentArn: input.AgentArn }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AgentArn !== undefined && input.AgentArn !== null && { AgentArn: input.AgentArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -3053,28 +3137,48 @@ const serializeAws_json1_1UpdateTaskExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.Options !== undefined && { Options: serializeAws_json1_1Options(input.Options, context) }), - ...(input.TaskExecutionArn !== undefined && { TaskExecutionArn: input.TaskExecutionArn }), + ...(input.Options !== undefined && + input.Options !== null && { Options: serializeAws_json1_1Options(input.Options, context) }), + ...(input.TaskExecutionArn !== undefined && + input.TaskExecutionArn !== null && { TaskExecutionArn: input.TaskExecutionArn }), }; }; const serializeAws_json1_1UpdateTaskRequest = (input: UpdateTaskRequest, context: __SerdeContext): any => { return { - ...(input.CloudWatchLogGroupArn !== undefined && { CloudWatchLogGroupArn: input.CloudWatchLogGroupArn }), - ...(input.Excludes !== undefined && { Excludes: serializeAws_json1_1FilterList(input.Excludes, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Options !== undefined && { Options: serializeAws_json1_1Options(input.Options, context) }), - ...(input.Schedule !== undefined && { Schedule: serializeAws_json1_1TaskSchedule(input.Schedule, context) }), - ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }), + ...(input.CloudWatchLogGroupArn !== undefined && + input.CloudWatchLogGroupArn !== null && { CloudWatchLogGroupArn: input.CloudWatchLogGroupArn }), + ...(input.Excludes !== undefined && + input.Excludes !== null && { Excludes: serializeAws_json1_1FilterList(input.Excludes, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Options !== undefined && + input.Options !== null && { Options: serializeAws_json1_1Options(input.Options, context) }), + ...(input.Schedule !== undefined && + input.Schedule !== null && { Schedule: serializeAws_json1_1TaskSchedule(input.Schedule, context) }), + ...(input.TaskArn !== undefined && input.TaskArn !== null && { TaskArn: input.TaskArn }), }; }; const deserializeAws_json1_1AgentArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AgentList = (output: any, context: __SerdeContext): AgentListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AgentListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AgentListEntry(entry, context); + }); }; const deserializeAws_json1_1AgentListEntry = (output: any, context: __SerdeContext): AgentListEntry => { @@ -3416,7 +3520,14 @@ const deserializeAws_json1_1DescribeTaskResponse = (output: any, context: __Serd }; const deserializeAws_json1_1DestinationNetworkInterfaceArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Ec2Config = (output: any, context: __SerdeContext): Ec2Config => { @@ -3430,11 +3541,25 @@ const deserializeAws_json1_1Ec2Config = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Ec2SecurityGroupArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FilterList = (output: any, context: __SerdeContext): FilterRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FilterRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FilterRule(entry, context); + }); }; const deserializeAws_json1_1FilterRule = (output: any, context: __SerdeContext): FilterRule => { @@ -3518,7 +3643,14 @@ const deserializeAws_json1_1ListTasksResponse = (output: any, context: __SerdeCo }; const deserializeAws_json1_1LocationList = (output: any, context: __SerdeContext): LocationListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LocationListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LocationListEntry(entry, context); + }); }; const deserializeAws_json1_1LocationListEntry = (output: any, context: __SerdeContext): LocationListEntry => { @@ -3569,15 +3701,36 @@ const deserializeAws_json1_1Options = (output: any, context: __SerdeContext): Op }; const deserializeAws_json1_1OutputTagList = (output: any, context: __SerdeContext): TagListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TagListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TagListEntry(entry, context); + }); }; const deserializeAws_json1_1PLSecurityGroupArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PLSubnetArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PrivateLinkConfig = (output: any, context: __SerdeContext): PrivateLinkConfig => { @@ -3615,7 +3768,14 @@ const deserializeAws_json1_1SmbMountOptions = (output: any, context: __SerdeCont }; const deserializeAws_json1_1SourceNetworkInterfaceArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1StartTaskExecutionResponse = ( @@ -3640,7 +3800,14 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1TaskExecutionList = (output: any, context: __SerdeContext): TaskExecutionListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TaskExecutionListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TaskExecutionListEntry(entry, context); + }); }; const deserializeAws_json1_1TaskExecutionListEntry = (output: any, context: __SerdeContext): TaskExecutionListEntry => { @@ -3675,7 +3842,14 @@ const deserializeAws_json1_1TaskExecutionResultDetail = ( }; const deserializeAws_json1_1TaskList = (output: any, context: __SerdeContext): TaskListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TaskListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TaskListEntry(entry, context); + }); }; const deserializeAws_json1_1TaskListEntry = (output: any, context: __SerdeContext): TaskListEntry => { @@ -3764,3 +3938,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-dax/protocols/Aws_json1_1.ts b/clients/client-dax/protocols/Aws_json1_1.ts index 29eab2b99658..8160971cb41e 100644 --- a/clients/client-dax/protocols/Aws_json1_1.ts +++ b/clients/client-dax/protocols/Aws_json1_1.ts @@ -144,7 +144,7 @@ export const serializeAws_json1_1CreateClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.CreateCluster", }; let body: any; @@ -157,7 +157,7 @@ export const serializeAws_json1_1CreateParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.CreateParameterGroup", }; let body: any; @@ -170,7 +170,7 @@ export const serializeAws_json1_1CreateSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.CreateSubnetGroup", }; let body: any; @@ -183,7 +183,7 @@ export const serializeAws_json1_1DecreaseReplicationFactorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DecreaseReplicationFactor", }; let body: any; @@ -196,7 +196,7 @@ export const serializeAws_json1_1DeleteClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DeleteCluster", }; let body: any; @@ -209,7 +209,7 @@ export const serializeAws_json1_1DeleteParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DeleteParameterGroup", }; let body: any; @@ -222,7 +222,7 @@ export const serializeAws_json1_1DeleteSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DeleteSubnetGroup", }; let body: any; @@ -235,7 +235,7 @@ export const serializeAws_json1_1DescribeClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DescribeClusters", }; let body: any; @@ -248,7 +248,7 @@ export const serializeAws_json1_1DescribeDefaultParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DescribeDefaultParameters", }; let body: any; @@ -261,7 +261,7 @@ export const serializeAws_json1_1DescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DescribeEvents", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1DescribeParameterGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DescribeParameterGroups", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1DescribeParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DescribeParameters", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1DescribeSubnetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.DescribeSubnetGroups", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1IncreaseReplicationFactorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.IncreaseReplicationFactor", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.ListTags", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1RebootNodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.RebootNode", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.TagResource", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.UntagResource", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1UpdateClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.UpdateCluster", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1UpdateParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.UpdateParameterGroup", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1UpdateSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonDAXV3.UpdateSubnetGroup", }; let body: any; @@ -439,8 +439,7 @@ const deserializeAws_json1_1CreateClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterAlreadyExistsFault": case "com.amazonaws.dax#ClusterAlreadyExistsFault": @@ -598,8 +597,7 @@ const deserializeAws_json1_1CreateParameterGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.dax#InvalidParameterCombinationException": @@ -693,8 +691,7 @@ const deserializeAws_json1_1CreateSubnetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidSubnet": case "com.amazonaws.dax#InvalidSubnet": @@ -780,8 +777,7 @@ const deserializeAws_json1_1DecreaseReplicationFactorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundFault": case "com.amazonaws.dax#ClusterNotFoundFault": @@ -875,8 +871,7 @@ const deserializeAws_json1_1DeleteClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundFault": case "com.amazonaws.dax#ClusterNotFoundFault": @@ -962,8 +957,7 @@ const deserializeAws_json1_1DeleteParameterGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.dax#InvalidParameterCombinationException": @@ -1049,8 +1043,7 @@ const deserializeAws_json1_1DeleteSubnetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ServiceLinkedRoleNotFoundFault": case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": @@ -1120,8 +1113,7 @@ const deserializeAws_json1_1DescribeClustersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundFault": case "com.amazonaws.dax#ClusterNotFoundFault": @@ -1199,8 +1191,7 @@ const deserializeAws_json1_1DescribeDefaultParametersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.dax#InvalidParameterCombinationException": @@ -1270,8 +1261,7 @@ const deserializeAws_json1_1DescribeEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.dax#InvalidParameterCombinationException": @@ -1341,8 +1331,7 @@ const deserializeAws_json1_1DescribeParameterGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.dax#InvalidParameterCombinationException": @@ -1420,8 +1409,7 @@ const deserializeAws_json1_1DescribeParametersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.dax#InvalidParameterCombinationException": @@ -1499,8 +1487,7 @@ const deserializeAws_json1_1DescribeSubnetGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ServiceLinkedRoleNotFoundFault": case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": @@ -1562,8 +1549,7 @@ const deserializeAws_json1_1IncreaseReplicationFactorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundFault": case "com.amazonaws.dax#ClusterNotFoundFault": @@ -1681,8 +1667,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundFault": case "com.amazonaws.dax#ClusterNotFoundFault": @@ -1776,8 +1761,7 @@ const deserializeAws_json1_1RebootNodeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundFault": case "com.amazonaws.dax#ClusterNotFoundFault": @@ -1871,8 +1855,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundFault": case "com.amazonaws.dax#ClusterNotFoundFault": @@ -1974,8 +1957,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundFault": case "com.amazonaws.dax#ClusterNotFoundFault": @@ -2077,8 +2059,7 @@ const deserializeAws_json1_1UpdateClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundFault": case "com.amazonaws.dax#ClusterNotFoundFault": @@ -2180,8 +2161,7 @@ const deserializeAws_json1_1UpdateParameterGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterCombinationException": case "com.amazonaws.dax#InvalidParameterCombinationException": @@ -2267,8 +2247,7 @@ const deserializeAws_json1_1UpdateSubnetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidSubnet": case "com.amazonaws.dax#InvalidSubnet": @@ -2718,36 +2697,56 @@ const deserializeAws_json1_1TagQuotaPerResourceExceededResponse = async ( }; const serializeAws_json1_1AvailabilityZoneList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ClusterNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateClusterRequest = (input: CreateClusterRequest, context: __SerdeContext): any => { return { - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_json1_1AvailabilityZoneList(input.AvailabilityZones, context), - }), - ...(input.ClusterName !== undefined && { ClusterName: input.ClusterName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.NodeType !== undefined && { NodeType: input.NodeType }), - ...(input.NotificationTopicArn !== undefined && { NotificationTopicArn: input.NotificationTopicArn }), - ...(input.ParameterGroupName !== undefined && { ParameterGroupName: input.ParameterGroupName }), - ...(input.PreferredMaintenanceWindow !== undefined && { - PreferredMaintenanceWindow: input.PreferredMaintenanceWindow, - }), - ...(input.ReplicationFactor !== undefined && { ReplicationFactor: input.ReplicationFactor }), - ...(input.SSESpecification !== undefined && { - SSESpecification: serializeAws_json1_1SSESpecification(input.SSESpecification, context), - }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIdentifierList(input.SecurityGroupIds, context), - }), - ...(input.SubnetGroupName !== undefined && { SubnetGroupName: input.SubnetGroupName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_json1_1AvailabilityZoneList(input.AvailabilityZones, context), + }), + ...(input.ClusterName !== undefined && input.ClusterName !== null && { ClusterName: input.ClusterName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.NodeType !== undefined && input.NodeType !== null && { NodeType: input.NodeType }), + ...(input.NotificationTopicArn !== undefined && + input.NotificationTopicArn !== null && { NotificationTopicArn: input.NotificationTopicArn }), + ...(input.ParameterGroupName !== undefined && + input.ParameterGroupName !== null && { ParameterGroupName: input.ParameterGroupName }), + ...(input.PreferredMaintenanceWindow !== undefined && + input.PreferredMaintenanceWindow !== null && { PreferredMaintenanceWindow: input.PreferredMaintenanceWindow }), + ...(input.ReplicationFactor !== undefined && + input.ReplicationFactor !== null && { ReplicationFactor: input.ReplicationFactor }), + ...(input.SSESpecification !== undefined && + input.SSESpecification !== null && { + SSESpecification: serializeAws_json1_1SSESpecification(input.SSESpecification, context), + }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIdentifierList(input.SecurityGroupIds, context), + }), + ...(input.SubnetGroupName !== undefined && + input.SubnetGroupName !== null && { SubnetGroupName: input.SubnetGroupName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -2756,8 +2755,9 @@ const serializeAws_json1_1CreateParameterGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ParameterGroupName !== undefined && { ParameterGroupName: input.ParameterGroupName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ParameterGroupName !== undefined && + input.ParameterGroupName !== null && { ParameterGroupName: input.ParameterGroupName }), }; }; @@ -2766,11 +2766,11 @@ const serializeAws_json1_1CreateSubnetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.SubnetGroupName !== undefined && { SubnetGroupName: input.SubnetGroupName }), - ...(input.SubnetIds !== undefined && { - SubnetIds: serializeAws_json1_1SubnetIdentifierList(input.SubnetIds, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.SubnetGroupName !== undefined && + input.SubnetGroupName !== null && { SubnetGroupName: input.SubnetGroupName }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIdentifierList(input.SubnetIds, context) }), }; }; @@ -2779,20 +2779,23 @@ const serializeAws_json1_1DecreaseReplicationFactorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_json1_1AvailabilityZoneList(input.AvailabilityZones, context), - }), - ...(input.ClusterName !== undefined && { ClusterName: input.ClusterName }), - ...(input.NewReplicationFactor !== undefined && { NewReplicationFactor: input.NewReplicationFactor }), - ...(input.NodeIdsToRemove !== undefined && { - NodeIdsToRemove: serializeAws_json1_1NodeIdentifierList(input.NodeIdsToRemove, context), - }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_json1_1AvailabilityZoneList(input.AvailabilityZones, context), + }), + ...(input.ClusterName !== undefined && input.ClusterName !== null && { ClusterName: input.ClusterName }), + ...(input.NewReplicationFactor !== undefined && + input.NewReplicationFactor !== null && { NewReplicationFactor: input.NewReplicationFactor }), + ...(input.NodeIdsToRemove !== undefined && + input.NodeIdsToRemove !== null && { + NodeIdsToRemove: serializeAws_json1_1NodeIdentifierList(input.NodeIdsToRemove, context), + }), }; }; const serializeAws_json1_1DeleteClusterRequest = (input: DeleteClusterRequest, context: __SerdeContext): any => { return { - ...(input.ClusterName !== undefined && { ClusterName: input.ClusterName }), + ...(input.ClusterName !== undefined && input.ClusterName !== null && { ClusterName: input.ClusterName }), }; }; @@ -2801,7 +2804,8 @@ const serializeAws_json1_1DeleteParameterGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.ParameterGroupName !== undefined && { ParameterGroupName: input.ParameterGroupName }), + ...(input.ParameterGroupName !== undefined && + input.ParameterGroupName !== null && { ParameterGroupName: input.ParameterGroupName }), }; }; @@ -2810,17 +2814,19 @@ const serializeAws_json1_1DeleteSubnetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.SubnetGroupName !== undefined && { SubnetGroupName: input.SubnetGroupName }), + ...(input.SubnetGroupName !== undefined && + input.SubnetGroupName !== null && { SubnetGroupName: input.SubnetGroupName }), }; }; const serializeAws_json1_1DescribeClustersRequest = (input: DescribeClustersRequest, context: __SerdeContext): any => { return { - ...(input.ClusterNames !== undefined && { - ClusterNames: serializeAws_json1_1ClusterNameList(input.ClusterNames, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ClusterNames !== undefined && + input.ClusterNames !== null && { + ClusterNames: serializeAws_json1_1ClusterNameList(input.ClusterNames, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2829,20 +2835,22 @@ const serializeAws_json1_1DescribeDefaultParametersRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1DescribeEventsRequest = (input: DescribeEventsRequest, context: __SerdeContext): any => { return { - ...(input.Duration !== undefined && { Duration: input.Duration }), - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SourceName !== undefined && { SourceName: input.SourceName }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.Duration !== undefined && input.Duration !== null && { Duration: input.Duration }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SourceName !== undefined && input.SourceName !== null && { SourceName: input.SourceName }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; @@ -2851,11 +2859,12 @@ const serializeAws_json1_1DescribeParameterGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ParameterGroupNames !== undefined && { - ParameterGroupNames: serializeAws_json1_1ParameterGroupNameList(input.ParameterGroupNames, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ParameterGroupNames !== undefined && + input.ParameterGroupNames !== null && { + ParameterGroupNames: serializeAws_json1_1ParameterGroupNameList(input.ParameterGroupNames, context), + }), }; }; @@ -2864,10 +2873,11 @@ const serializeAws_json1_1DescribeParametersRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ParameterGroupName !== undefined && { ParameterGroupName: input.ParameterGroupName }), - ...(input.Source !== undefined && { Source: input.Source }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ParameterGroupName !== undefined && + input.ParameterGroupName !== null && { ParameterGroupName: input.ParameterGroupName }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), }; }; @@ -2876,11 +2886,12 @@ const serializeAws_json1_1DescribeSubnetGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SubnetGroupNames !== undefined && { - SubnetGroupNames: serializeAws_json1_1SubnetGroupNameList(input.SubnetGroupNames, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SubnetGroupNames !== undefined && + input.SubnetGroupNames !== null && { + SubnetGroupNames: serializeAws_json1_1SubnetGroupNameList(input.SubnetGroupNames, context), + }), }; }; @@ -2889,107 +2900,170 @@ const serializeAws_json1_1IncreaseReplicationFactorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_json1_1AvailabilityZoneList(input.AvailabilityZones, context), - }), - ...(input.ClusterName !== undefined && { ClusterName: input.ClusterName }), - ...(input.NewReplicationFactor !== undefined && { NewReplicationFactor: input.NewReplicationFactor }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_json1_1AvailabilityZoneList(input.AvailabilityZones, context), + }), + ...(input.ClusterName !== undefined && input.ClusterName !== null && { ClusterName: input.ClusterName }), + ...(input.NewReplicationFactor !== undefined && + input.NewReplicationFactor !== null && { NewReplicationFactor: input.NewReplicationFactor }), }; }; const serializeAws_json1_1KeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListTagsRequest = (input: ListTagsRequest, context: __SerdeContext): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceName !== undefined && { ResourceName: input.ResourceName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { ResourceName: input.ResourceName }), }; }; const serializeAws_json1_1NodeIdentifierList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ParameterGroupNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ParameterNameValue = (input: ParameterNameValue, context: __SerdeContext): any => { return { - ...(input.ParameterName !== undefined && { ParameterName: input.ParameterName }), - ...(input.ParameterValue !== undefined && { ParameterValue: input.ParameterValue }), + ...(input.ParameterName !== undefined && input.ParameterName !== null && { ParameterName: input.ParameterName }), + ...(input.ParameterValue !== undefined && + input.ParameterValue !== null && { ParameterValue: input.ParameterValue }), }; }; const serializeAws_json1_1ParameterNameValueList = (input: ParameterNameValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ParameterNameValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ParameterNameValue(entry, context); + }); }; const serializeAws_json1_1RebootNodeRequest = (input: RebootNodeRequest, context: __SerdeContext): any => { return { - ...(input.ClusterName !== undefined && { ClusterName: input.ClusterName }), - ...(input.NodeId !== undefined && { NodeId: input.NodeId }), + ...(input.ClusterName !== undefined && input.ClusterName !== null && { ClusterName: input.ClusterName }), + ...(input.NodeId !== undefined && input.NodeId !== null && { NodeId: input.NodeId }), }; }; const serializeAws_json1_1SecurityGroupIdentifierList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SSESpecification = (input: SSESpecification, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; const serializeAws_json1_1SubnetGroupNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SubnetIdentifierList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceName !== undefined && { ResourceName: input.ResourceName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { ResourceName: input.ResourceName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceName !== undefined && { ResourceName: input.ResourceName }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1KeyList(input.TagKeys, context) }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { ResourceName: input.ResourceName }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1KeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateClusterRequest = (input: UpdateClusterRequest, context: __SerdeContext): any => { return { - ...(input.ClusterName !== undefined && { ClusterName: input.ClusterName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.NotificationTopicArn !== undefined && { NotificationTopicArn: input.NotificationTopicArn }), - ...(input.NotificationTopicStatus !== undefined && { NotificationTopicStatus: input.NotificationTopicStatus }), - ...(input.ParameterGroupName !== undefined && { ParameterGroupName: input.ParameterGroupName }), - ...(input.PreferredMaintenanceWindow !== undefined && { - PreferredMaintenanceWindow: input.PreferredMaintenanceWindow, - }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIdentifierList(input.SecurityGroupIds, context), - }), + ...(input.ClusterName !== undefined && input.ClusterName !== null && { ClusterName: input.ClusterName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.NotificationTopicArn !== undefined && + input.NotificationTopicArn !== null && { NotificationTopicArn: input.NotificationTopicArn }), + ...(input.NotificationTopicStatus !== undefined && + input.NotificationTopicStatus !== null && { NotificationTopicStatus: input.NotificationTopicStatus }), + ...(input.ParameterGroupName !== undefined && + input.ParameterGroupName !== null && { ParameterGroupName: input.ParameterGroupName }), + ...(input.PreferredMaintenanceWindow !== undefined && + input.PreferredMaintenanceWindow !== null && { PreferredMaintenanceWindow: input.PreferredMaintenanceWindow }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIdentifierList(input.SecurityGroupIds, context), + }), }; }; @@ -2998,10 +3072,12 @@ const serializeAws_json1_1UpdateParameterGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.ParameterGroupName !== undefined && { ParameterGroupName: input.ParameterGroupName }), - ...(input.ParameterNameValues !== undefined && { - ParameterNameValues: serializeAws_json1_1ParameterNameValueList(input.ParameterNameValues, context), - }), + ...(input.ParameterGroupName !== undefined && + input.ParameterGroupName !== null && { ParameterGroupName: input.ParameterGroupName }), + ...(input.ParameterNameValues !== undefined && + input.ParameterNameValues !== null && { + ParameterNameValues: serializeAws_json1_1ParameterNameValueList(input.ParameterNameValues, context), + }), }; }; @@ -3010,11 +3086,11 @@ const serializeAws_json1_1UpdateSubnetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.SubnetGroupName !== undefined && { SubnetGroupName: input.SubnetGroupName }), - ...(input.SubnetIds !== undefined && { - SubnetIds: serializeAws_json1_1SubnetIdentifierList(input.SubnetIds, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.SubnetGroupName !== undefined && + input.SubnetGroupName !== null && { SubnetGroupName: input.SubnetGroupName }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIdentifierList(input.SubnetIds, context) }), }; }; @@ -3074,7 +3150,14 @@ const deserializeAws_json1_1ClusterAlreadyExistsFault = ( }; const deserializeAws_json1_1ClusterList = (output: any, context: __SerdeContext): Cluster[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Cluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Cluster(entry, context); + }); }; const deserializeAws_json1_1ClusterNotFoundFault = (output: any, context: __SerdeContext): ClusterNotFoundFault => { @@ -3258,7 +3341,14 @@ const deserializeAws_json1_1Event = (output: any, context: __SerdeContext): Even }; const deserializeAws_json1_1EventList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Event(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Event(entry, context); + }); }; const deserializeAws_json1_1IncreaseReplicationFactorResponse = ( @@ -3371,11 +3461,25 @@ const deserializeAws_json1_1Node = (output: any, context: __SerdeContext): Node }; const deserializeAws_json1_1NodeIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NodeList = (output: any, context: __SerdeContext): Node[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Node(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Node(entry, context); + }); }; const deserializeAws_json1_1NodeNotFoundFault = (output: any, context: __SerdeContext): NodeNotFoundFault => { @@ -3413,7 +3517,14 @@ const deserializeAws_json1_1NodeTypeSpecificValueList = ( output: any, context: __SerdeContext ): NodeTypeSpecificValue[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NodeTypeSpecificValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NodeTypeSpecificValue(entry, context); + }); }; const deserializeAws_json1_1NotificationConfiguration = ( @@ -3468,7 +3579,14 @@ const deserializeAws_json1_1ParameterGroupAlreadyExistsFault = ( }; const deserializeAws_json1_1ParameterGroupList = (output: any, context: __SerdeContext): ParameterGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParameterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParameterGroup(entry, context); + }); }; const deserializeAws_json1_1ParameterGroupNotFoundFault = ( @@ -3507,7 +3625,14 @@ const deserializeAws_json1_1ParameterGroupStatus = (output: any, context: __Serd }; const deserializeAws_json1_1ParameterList = (output: any, context: __SerdeContext): Parameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Parameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Parameter(entry, context); + }); }; const deserializeAws_json1_1RebootNodeResponse = (output: any, context: __SerdeContext): RebootNodeResponse => { @@ -3536,7 +3661,14 @@ const deserializeAws_json1_1SecurityGroupMembershipList = ( output: any, context: __SerdeContext ): SecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SecurityGroupMembership(entry, context); + }); }; const deserializeAws_json1_1ServiceLinkedRoleNotFoundFault = ( @@ -3594,7 +3726,14 @@ const deserializeAws_json1_1SubnetGroupInUseFault = (output: any, context: __Ser }; const deserializeAws_json1_1SubnetGroupList = (output: any, context: __SerdeContext): SubnetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SubnetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SubnetGroup(entry, context); + }); }; const deserializeAws_json1_1SubnetGroupNotFoundFault = ( @@ -3622,7 +3761,14 @@ const deserializeAws_json1_1SubnetInUse = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1SubnetList = (output: any, context: __SerdeContext): Subnet[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Subnet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Subnet(entry, context); + }); }; const deserializeAws_json1_1SubnetQuotaExceededFault = ( @@ -3642,7 +3788,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagNotFoundFault = (output: any, context: __SerdeContext): TagNotFoundFault => { @@ -3761,3 +3914,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-detective/protocols/Aws_restJson1.ts b/clients/client-detective/protocols/Aws_restJson1.ts index 455053e5e79e..c09da1918078 100644 --- a/clients/client-detective/protocols/Aws_restJson1.ts +++ b/clients/client-detective/protocols/Aws_restJson1.ts @@ -41,12 +41,12 @@ export const serializeAws_restJson1AcceptInvitationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitation"; let body: any; body = JSON.stringify({ - ...(input.GraphArn !== undefined && { GraphArn: input.GraphArn }), + ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -64,12 +64,10 @@ export const serializeAws_restJson1CreateGraphCommand = async ( input: CreateGraphCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/graph"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -87,14 +85,15 @@ export const serializeAws_restJson1CreateMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/graph/members"; let body: any; body = JSON.stringify({ - ...(input.Accounts !== undefined && { Accounts: serializeAws_restJson1AccountList(input.Accounts, context) }), - ...(input.GraphArn !== undefined && { GraphArn: input.GraphArn }), - ...(input.Message !== undefined && { Message: input.Message }), + ...(input.Accounts !== undefined && + input.Accounts !== null && { Accounts: serializeAws_restJson1AccountList(input.Accounts, context) }), + ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }), + ...(input.Message !== undefined && input.Message !== null && { Message: input.Message }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -113,12 +112,12 @@ export const serializeAws_restJson1DeleteGraphCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/graph/removal"; let body: any; body = JSON.stringify({ - ...(input.GraphArn !== undefined && { GraphArn: input.GraphArn }), + ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -137,15 +136,14 @@ export const serializeAws_restJson1DeleteMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/graph/members/removal"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { - AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context), - }), - ...(input.GraphArn !== undefined && { GraphArn: input.GraphArn }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }), + ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -164,12 +162,12 @@ export const serializeAws_restJson1DisassociateMembershipCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/membership/removal"; let body: any; body = JSON.stringify({ - ...(input.GraphArn !== undefined && { GraphArn: input.GraphArn }), + ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -188,15 +186,14 @@ export const serializeAws_restJson1GetMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/graph/members/get"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { - AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context), - }), - ...(input.GraphArn !== undefined && { GraphArn: input.GraphArn }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }), + ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -215,13 +212,13 @@ export const serializeAws_restJson1ListGraphsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/graphs/list"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -240,13 +237,13 @@ export const serializeAws_restJson1ListInvitationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitations/list"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -265,14 +262,14 @@ export const serializeAws_restJson1ListMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/graph/members/list"; let body: any; body = JSON.stringify({ - ...(input.GraphArn !== undefined && { GraphArn: input.GraphArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -291,12 +288,12 @@ export const serializeAws_restJson1RejectInvitationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitation/removal"; let body: any; body = JSON.stringify({ - ...(input.GraphArn !== undefined && { GraphArn: input.GraphArn }), + ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -315,13 +312,13 @@ export const serializeAws_restJson1StartMonitoringMemberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/graph/member/monitoringstate"; let body: any; body = JSON.stringify({ - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.GraphArn !== undefined && { GraphArn: input.GraphArn }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.GraphArn !== undefined && input.GraphArn !== null && { GraphArn: input.GraphArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1318,21 +1315,42 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1Account = (input: Account, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.EmailAddress !== undefined && { EmailAddress: input.EmailAddress }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }), }; }; const serializeAws_restJson1AccountIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AccountList = (input: Account[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Account(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Account(entry, context); + }); }; const deserializeAws_restJson1AccountIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Graph = (output: any, context: __SerdeContext): Graph => { @@ -1346,7 +1364,14 @@ const deserializeAws_restJson1Graph = (output: any, context: __SerdeContext): Gr }; const deserializeAws_restJson1GraphList = (output: any, context: __SerdeContext): Graph[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Graph(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Graph(entry, context); + }); }; const deserializeAws_restJson1MemberDetail = (output: any, context: __SerdeContext): MemberDetail => { @@ -1378,7 +1403,14 @@ const deserializeAws_restJson1MemberDetail = (output: any, context: __SerdeConte }; const deserializeAws_restJson1MemberDetailList = (output: any, context: __SerdeContext): MemberDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MemberDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MemberDetail(entry, context); + }); }; const deserializeAws_restJson1UnprocessedAccount = (output: any, context: __SerdeContext): UnprocessedAccount => { @@ -1389,7 +1421,14 @@ const deserializeAws_restJson1UnprocessedAccount = (output: any, context: __Serd }; const deserializeAws_restJson1UnprocessedAccountList = (output: any, context: __SerdeContext): UnprocessedAccount[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UnprocessedAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UnprocessedAccount(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1412,6 +1451,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-device-farm/protocols/Aws_json1_1.ts b/clients/client-device-farm/protocols/Aws_json1_1.ts index 79a704efe1e9..32a9831207c7 100644 --- a/clients/client-device-farm/protocols/Aws_json1_1.ts +++ b/clients/client-device-farm/protocols/Aws_json1_1.ts @@ -404,7 +404,7 @@ export const serializeAws_json1_1CreateDevicePoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.CreateDevicePool", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1CreateInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.CreateInstanceProfile", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1CreateNetworkProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.CreateNetworkProfile", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.CreateProject", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1CreateRemoteAccessSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.CreateRemoteAccessSession", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1CreateTestGridProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.CreateTestGridProject", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1CreateTestGridUrlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.CreateTestGridUrl", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1CreateUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.CreateUpload", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1CreateVPCEConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.CreateVPCEConfiguration", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1DeleteDevicePoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.DeleteDevicePool", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1DeleteInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.DeleteInstanceProfile", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1DeleteNetworkProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.DeleteNetworkProfile", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.DeleteProject", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1DeleteRemoteAccessSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.DeleteRemoteAccessSession", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1DeleteRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.DeleteRun", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1DeleteTestGridProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.DeleteTestGridProject", }; let body: any; @@ -612,7 +612,7 @@ export const serializeAws_json1_1DeleteUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.DeleteUpload", }; let body: any; @@ -625,7 +625,7 @@ export const serializeAws_json1_1DeleteVPCEConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.DeleteVPCEConfiguration", }; let body: any; @@ -638,7 +638,7 @@ export const serializeAws_json1_1GetAccountSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetAccountSettings", }; let body: any; @@ -651,7 +651,7 @@ export const serializeAws_json1_1GetDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetDevice", }; let body: any; @@ -664,7 +664,7 @@ export const serializeAws_json1_1GetDeviceInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetDeviceInstance", }; let body: any; @@ -677,7 +677,7 @@ export const serializeAws_json1_1GetDevicePoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetDevicePool", }; let body: any; @@ -690,7 +690,7 @@ export const serializeAws_json1_1GetDevicePoolCompatibilityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetDevicePoolCompatibility", }; let body: any; @@ -703,7 +703,7 @@ export const serializeAws_json1_1GetInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetInstanceProfile", }; let body: any; @@ -716,7 +716,7 @@ export const serializeAws_json1_1GetJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetJob", }; let body: any; @@ -729,7 +729,7 @@ export const serializeAws_json1_1GetNetworkProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetNetworkProfile", }; let body: any; @@ -742,7 +742,7 @@ export const serializeAws_json1_1GetOfferingStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetOfferingStatus", }; let body: any; @@ -755,7 +755,7 @@ export const serializeAws_json1_1GetProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetProject", }; let body: any; @@ -768,7 +768,7 @@ export const serializeAws_json1_1GetRemoteAccessSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetRemoteAccessSession", }; let body: any; @@ -781,7 +781,7 @@ export const serializeAws_json1_1GetRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetRun", }; let body: any; @@ -794,7 +794,7 @@ export const serializeAws_json1_1GetSuiteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetSuite", }; let body: any; @@ -807,7 +807,7 @@ export const serializeAws_json1_1GetTestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetTest", }; let body: any; @@ -820,7 +820,7 @@ export const serializeAws_json1_1GetTestGridProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetTestGridProject", }; let body: any; @@ -833,7 +833,7 @@ export const serializeAws_json1_1GetTestGridSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetTestGridSession", }; let body: any; @@ -846,7 +846,7 @@ export const serializeAws_json1_1GetUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetUpload", }; let body: any; @@ -859,7 +859,7 @@ export const serializeAws_json1_1GetVPCEConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.GetVPCEConfiguration", }; let body: any; @@ -872,7 +872,7 @@ export const serializeAws_json1_1InstallToRemoteAccessSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.InstallToRemoteAccessSession", }; let body: any; @@ -885,7 +885,7 @@ export const serializeAws_json1_1ListArtifactsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListArtifacts", }; let body: any; @@ -898,7 +898,7 @@ export const serializeAws_json1_1ListDeviceInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListDeviceInstances", }; let body: any; @@ -911,7 +911,7 @@ export const serializeAws_json1_1ListDevicePoolsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListDevicePools", }; let body: any; @@ -924,7 +924,7 @@ export const serializeAws_json1_1ListDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListDevices", }; let body: any; @@ -937,7 +937,7 @@ export const serializeAws_json1_1ListInstanceProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListInstanceProfiles", }; let body: any; @@ -950,7 +950,7 @@ export const serializeAws_json1_1ListJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListJobs", }; let body: any; @@ -963,7 +963,7 @@ export const serializeAws_json1_1ListNetworkProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListNetworkProfiles", }; let body: any; @@ -976,7 +976,7 @@ export const serializeAws_json1_1ListOfferingPromotionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListOfferingPromotions", }; let body: any; @@ -989,7 +989,7 @@ export const serializeAws_json1_1ListOfferingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListOfferings", }; let body: any; @@ -1002,7 +1002,7 @@ export const serializeAws_json1_1ListOfferingTransactionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListOfferingTransactions", }; let body: any; @@ -1015,7 +1015,7 @@ export const serializeAws_json1_1ListProjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListProjects", }; let body: any; @@ -1028,7 +1028,7 @@ export const serializeAws_json1_1ListRemoteAccessSessionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListRemoteAccessSessions", }; let body: any; @@ -1041,7 +1041,7 @@ export const serializeAws_json1_1ListRunsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListRuns", }; let body: any; @@ -1054,7 +1054,7 @@ export const serializeAws_json1_1ListSamplesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListSamples", }; let body: any; @@ -1067,7 +1067,7 @@ export const serializeAws_json1_1ListSuitesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListSuites", }; let body: any; @@ -1080,7 +1080,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListTagsForResource", }; let body: any; @@ -1093,7 +1093,7 @@ export const serializeAws_json1_1ListTestGridProjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListTestGridProjects", }; let body: any; @@ -1106,7 +1106,7 @@ export const serializeAws_json1_1ListTestGridSessionActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListTestGridSessionActions", }; let body: any; @@ -1119,7 +1119,7 @@ export const serializeAws_json1_1ListTestGridSessionArtifactsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListTestGridSessionArtifacts", }; let body: any; @@ -1132,7 +1132,7 @@ export const serializeAws_json1_1ListTestGridSessionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListTestGridSessions", }; let body: any; @@ -1145,7 +1145,7 @@ export const serializeAws_json1_1ListTestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListTests", }; let body: any; @@ -1158,7 +1158,7 @@ export const serializeAws_json1_1ListUniqueProblemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListUniqueProblems", }; let body: any; @@ -1171,7 +1171,7 @@ export const serializeAws_json1_1ListUploadsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListUploads", }; let body: any; @@ -1184,7 +1184,7 @@ export const serializeAws_json1_1ListVPCEConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ListVPCEConfigurations", }; let body: any; @@ -1197,7 +1197,7 @@ export const serializeAws_json1_1PurchaseOfferingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.PurchaseOffering", }; let body: any; @@ -1210,7 +1210,7 @@ export const serializeAws_json1_1RenewOfferingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.RenewOffering", }; let body: any; @@ -1223,7 +1223,7 @@ export const serializeAws_json1_1ScheduleRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.ScheduleRun", }; let body: any; @@ -1236,7 +1236,7 @@ export const serializeAws_json1_1StopJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.StopJob", }; let body: any; @@ -1249,7 +1249,7 @@ export const serializeAws_json1_1StopRemoteAccessSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.StopRemoteAccessSession", }; let body: any; @@ -1262,7 +1262,7 @@ export const serializeAws_json1_1StopRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.StopRun", }; let body: any; @@ -1275,7 +1275,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.TagResource", }; let body: any; @@ -1288,7 +1288,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.UntagResource", }; let body: any; @@ -1301,7 +1301,7 @@ export const serializeAws_json1_1UpdateDeviceInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.UpdateDeviceInstance", }; let body: any; @@ -1314,7 +1314,7 @@ export const serializeAws_json1_1UpdateDevicePoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.UpdateDevicePool", }; let body: any; @@ -1327,7 +1327,7 @@ export const serializeAws_json1_1UpdateInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.UpdateInstanceProfile", }; let body: any; @@ -1340,7 +1340,7 @@ export const serializeAws_json1_1UpdateNetworkProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.UpdateNetworkProfile", }; let body: any; @@ -1353,7 +1353,7 @@ export const serializeAws_json1_1UpdateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.UpdateProject", }; let body: any; @@ -1366,7 +1366,7 @@ export const serializeAws_json1_1UpdateTestGridProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.UpdateTestGridProject", }; let body: any; @@ -1379,7 +1379,7 @@ export const serializeAws_json1_1UpdateUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.UpdateUpload", }; let body: any; @@ -1392,7 +1392,7 @@ export const serializeAws_json1_1UpdateVPCEConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DeviceFarm_20150623.UpdateVPCEConfiguration", }; let body: any; @@ -1427,8 +1427,7 @@ const deserializeAws_json1_1CreateDevicePoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -1506,8 +1505,7 @@ const deserializeAws_json1_1CreateInstanceProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -1585,8 +1583,7 @@ const deserializeAws_json1_1CreateNetworkProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -1664,8 +1661,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -1751,8 +1747,7 @@ const deserializeAws_json1_1CreateRemoteAccessSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -1830,8 +1825,7 @@ const deserializeAws_json1_1CreateTestGridProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.devicefarm#InternalServiceException": @@ -1885,8 +1879,7 @@ const deserializeAws_json1_1CreateTestGridUrlCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -1956,8 +1949,7 @@ const deserializeAws_json1_1CreateUploadCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2035,8 +2027,7 @@ const deserializeAws_json1_1CreateVPCEConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2106,8 +2097,7 @@ const deserializeAws_json1_1DeleteDevicePoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2185,8 +2175,7 @@ const deserializeAws_json1_1DeleteInstanceProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2264,8 +2253,7 @@ const deserializeAws_json1_1DeleteNetworkProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2343,8 +2331,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2422,8 +2409,7 @@ const deserializeAws_json1_1DeleteRemoteAccessSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2501,8 +2487,7 @@ const deserializeAws_json1_1DeleteRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2580,8 +2565,7 @@ const deserializeAws_json1_1DeleteTestGridProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2659,8 +2643,7 @@ const deserializeAws_json1_1DeleteUploadCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2738,8 +2721,7 @@ const deserializeAws_json1_1DeleteVPCEConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2817,8 +2799,7 @@ const deserializeAws_json1_1GetAccountSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2896,8 +2877,7 @@ const deserializeAws_json1_1GetDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -2975,8 +2955,7 @@ const deserializeAws_json1_1GetDeviceInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3054,8 +3033,7 @@ const deserializeAws_json1_1GetDevicePoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3133,8 +3111,7 @@ const deserializeAws_json1_1GetDevicePoolCompatibilityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3212,8 +3189,7 @@ const deserializeAws_json1_1GetInstanceProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3291,8 +3267,7 @@ const deserializeAws_json1_1GetJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3370,8 +3345,7 @@ const deserializeAws_json1_1GetNetworkProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3449,8 +3423,7 @@ const deserializeAws_json1_1GetOfferingStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3536,8 +3509,7 @@ const deserializeAws_json1_1GetProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3615,8 +3587,7 @@ const deserializeAws_json1_1GetRemoteAccessSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3694,8 +3665,7 @@ const deserializeAws_json1_1GetRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3773,8 +3743,7 @@ const deserializeAws_json1_1GetSuiteCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3852,8 +3821,7 @@ const deserializeAws_json1_1GetTestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -3931,8 +3899,7 @@ const deserializeAws_json1_1GetTestGridProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4002,8 +3969,7 @@ const deserializeAws_json1_1GetTestGridSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4073,8 +4039,7 @@ const deserializeAws_json1_1GetUploadCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4152,8 +4117,7 @@ const deserializeAws_json1_1GetVPCEConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4223,8 +4187,7 @@ const deserializeAws_json1_1InstallToRemoteAccessSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4302,8 +4265,7 @@ const deserializeAws_json1_1ListArtifactsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4381,8 +4343,7 @@ const deserializeAws_json1_1ListDeviceInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4460,8 +4421,7 @@ const deserializeAws_json1_1ListDevicePoolsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4539,8 +4499,7 @@ const deserializeAws_json1_1ListDevicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4618,8 +4577,7 @@ const deserializeAws_json1_1ListInstanceProfilesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4697,8 +4655,7 @@ const deserializeAws_json1_1ListJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4776,8 +4733,7 @@ const deserializeAws_json1_1ListNetworkProfilesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4855,8 +4811,7 @@ const deserializeAws_json1_1ListOfferingPromotionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -4942,8 +4897,7 @@ const deserializeAws_json1_1ListOfferingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5029,8 +4983,7 @@ const deserializeAws_json1_1ListOfferingTransactionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5116,8 +5069,7 @@ const deserializeAws_json1_1ListProjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5195,8 +5147,7 @@ const deserializeAws_json1_1ListRemoteAccessSessionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5274,8 +5225,7 @@ const deserializeAws_json1_1ListRunsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5353,8 +5303,7 @@ const deserializeAws_json1_1ListSamplesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5432,8 +5381,7 @@ const deserializeAws_json1_1ListSuitesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5511,8 +5459,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5582,8 +5529,7 @@ const deserializeAws_json1_1ListTestGridProjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5645,8 +5591,7 @@ const deserializeAws_json1_1ListTestGridSessionActionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5716,8 +5661,7 @@ const deserializeAws_json1_1ListTestGridSessionArtifactsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5787,8 +5731,7 @@ const deserializeAws_json1_1ListTestGridSessionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5858,8 +5801,7 @@ const deserializeAws_json1_1ListTestsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -5937,8 +5879,7 @@ const deserializeAws_json1_1ListUniqueProblemsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6016,8 +5957,7 @@ const deserializeAws_json1_1ListUploadsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6095,8 +6035,7 @@ const deserializeAws_json1_1ListVPCEConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6158,8 +6097,7 @@ const deserializeAws_json1_1PurchaseOfferingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6245,8 +6183,7 @@ const deserializeAws_json1_1RenewOfferingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6332,8 +6269,7 @@ const deserializeAws_json1_1ScheduleRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6419,8 +6355,7 @@ const deserializeAws_json1_1StopJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6498,8 +6433,7 @@ const deserializeAws_json1_1StopRemoteAccessSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6577,8 +6511,7 @@ const deserializeAws_json1_1StopRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6656,8 +6589,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6743,8 +6675,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6814,8 +6745,7 @@ const deserializeAws_json1_1UpdateDeviceInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6893,8 +6823,7 @@ const deserializeAws_json1_1UpdateDevicePoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -6972,8 +6901,7 @@ const deserializeAws_json1_1UpdateInstanceProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -7051,8 +6979,7 @@ const deserializeAws_json1_1UpdateNetworkProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -7130,8 +7057,7 @@ const deserializeAws_json1_1UpdateProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -7209,8 +7135,7 @@ const deserializeAws_json1_1UpdateTestGridProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -7280,8 +7205,7 @@ const deserializeAws_json1_1UpdateUploadCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -7359,8 +7283,7 @@ const deserializeAws_json1_1UpdateVPCEConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": @@ -7592,20 +7515,35 @@ const deserializeAws_json1_1TooManyTagsExceptionResponse = async ( }; const serializeAws_json1_1AmazonResourceNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AndroidPaths = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateDevicePoolRequest = (input: CreateDevicePoolRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.maxDevices !== undefined && { maxDevices: input.maxDevices }), - ...(input.name !== undefined && { name: input.name }), - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), - ...(input.rules !== undefined && { rules: serializeAws_json1_1Rules(input.rules, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.maxDevices !== undefined && input.maxDevices !== null && { maxDevices: input.maxDevices }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), + ...(input.rules !== undefined && + input.rules !== null && { rules: serializeAws_json1_1Rules(input.rules, context) }), }; }; @@ -7614,13 +7552,16 @@ const serializeAws_json1_1CreateInstanceProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.excludeAppPackagesFromCleanup !== undefined && { - excludeAppPackagesFromCleanup: serializeAws_json1_1PackageIds(input.excludeAppPackagesFromCleanup, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.packageCleanup !== undefined && { packageCleanup: input.packageCleanup }), - ...(input.rebootAfterUse !== undefined && { rebootAfterUse: input.rebootAfterUse }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.excludeAppPackagesFromCleanup !== undefined && + input.excludeAppPackagesFromCleanup !== null && { + excludeAppPackagesFromCleanup: serializeAws_json1_1PackageIds(input.excludeAppPackagesFromCleanup, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.packageCleanup !== undefined && + input.packageCleanup !== null && { packageCleanup: input.packageCleanup }), + ...(input.rebootAfterUse !== undefined && + input.rebootAfterUse !== null && { rebootAfterUse: input.rebootAfterUse }), }; }; @@ -7629,25 +7570,33 @@ const serializeAws_json1_1CreateNetworkProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.downlinkBandwidthBits !== undefined && { downlinkBandwidthBits: input.downlinkBandwidthBits }), - ...(input.downlinkDelayMs !== undefined && { downlinkDelayMs: input.downlinkDelayMs }), - ...(input.downlinkJitterMs !== undefined && { downlinkJitterMs: input.downlinkJitterMs }), - ...(input.downlinkLossPercent !== undefined && { downlinkLossPercent: input.downlinkLossPercent }), - ...(input.name !== undefined && { name: input.name }), - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), - ...(input.type !== undefined && { type: input.type }), - ...(input.uplinkBandwidthBits !== undefined && { uplinkBandwidthBits: input.uplinkBandwidthBits }), - ...(input.uplinkDelayMs !== undefined && { uplinkDelayMs: input.uplinkDelayMs }), - ...(input.uplinkJitterMs !== undefined && { uplinkJitterMs: input.uplinkJitterMs }), - ...(input.uplinkLossPercent !== undefined && { uplinkLossPercent: input.uplinkLossPercent }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.downlinkBandwidthBits !== undefined && + input.downlinkBandwidthBits !== null && { downlinkBandwidthBits: input.downlinkBandwidthBits }), + ...(input.downlinkDelayMs !== undefined && + input.downlinkDelayMs !== null && { downlinkDelayMs: input.downlinkDelayMs }), + ...(input.downlinkJitterMs !== undefined && + input.downlinkJitterMs !== null && { downlinkJitterMs: input.downlinkJitterMs }), + ...(input.downlinkLossPercent !== undefined && + input.downlinkLossPercent !== null && { downlinkLossPercent: input.downlinkLossPercent }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.uplinkBandwidthBits !== undefined && + input.uplinkBandwidthBits !== null && { uplinkBandwidthBits: input.uplinkBandwidthBits }), + ...(input.uplinkDelayMs !== undefined && input.uplinkDelayMs !== null && { uplinkDelayMs: input.uplinkDelayMs }), + ...(input.uplinkJitterMs !== undefined && + input.uplinkJitterMs !== null && { uplinkJitterMs: input.uplinkJitterMs }), + ...(input.uplinkLossPercent !== undefined && + input.uplinkLossPercent !== null && { uplinkLossPercent: input.uplinkLossPercent }), }; }; const serializeAws_json1_1CreateProjectRequest = (input: CreateProjectRequest, context: __SerdeContext): any => { return { - ...(input.defaultJobTimeoutMinutes !== undefined && { defaultJobTimeoutMinutes: input.defaultJobTimeoutMinutes }), - ...(input.name !== undefined && { name: input.name }), + ...(input.defaultJobTimeoutMinutes !== undefined && + input.defaultJobTimeoutMinutes !== null && { defaultJobTimeoutMinutes: input.defaultJobTimeoutMinutes }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -7656,10 +7605,11 @@ const serializeAws_json1_1CreateRemoteAccessSessionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.billingMethod !== undefined && { billingMethod: input.billingMethod }), - ...(input.vpceConfigurationArns !== undefined && { - vpceConfigurationArns: serializeAws_json1_1AmazonResourceNames(input.vpceConfigurationArns, context), - }), + ...(input.billingMethod !== undefined && input.billingMethod !== null && { billingMethod: input.billingMethod }), + ...(input.vpceConfigurationArns !== undefined && + input.vpceConfigurationArns !== null && { + vpceConfigurationArns: serializeAws_json1_1AmazonResourceNames(input.vpceConfigurationArns, context), + }), }; }; @@ -7668,20 +7618,25 @@ const serializeAws_json1_1CreateRemoteAccessSessionRequest = ( context: __SerdeContext ): any => { return { - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.configuration !== undefined && { - configuration: serializeAws_json1_1CreateRemoteAccessSessionConfiguration(input.configuration, context), - }), - ...(input.deviceArn !== undefined && { deviceArn: input.deviceArn }), - ...(input.instanceArn !== undefined && { instanceArn: input.instanceArn }), - ...(input.interactionMode !== undefined && { interactionMode: input.interactionMode }), - ...(input.name !== undefined && { name: input.name }), - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), - ...(input.remoteDebugEnabled !== undefined && { remoteDebugEnabled: input.remoteDebugEnabled }), - ...(input.remoteRecordAppArn !== undefined && { remoteRecordAppArn: input.remoteRecordAppArn }), - ...(input.remoteRecordEnabled !== undefined && { remoteRecordEnabled: input.remoteRecordEnabled }), - ...(input.skipAppResign !== undefined && { skipAppResign: input.skipAppResign }), - ...(input.sshPublicKey !== undefined && { sshPublicKey: input.sshPublicKey }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.configuration !== undefined && + input.configuration !== null && { + configuration: serializeAws_json1_1CreateRemoteAccessSessionConfiguration(input.configuration, context), + }), + ...(input.deviceArn !== undefined && input.deviceArn !== null && { deviceArn: input.deviceArn }), + ...(input.instanceArn !== undefined && input.instanceArn !== null && { instanceArn: input.instanceArn }), + ...(input.interactionMode !== undefined && + input.interactionMode !== null && { interactionMode: input.interactionMode }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), + ...(input.remoteDebugEnabled !== undefined && + input.remoteDebugEnabled !== null && { remoteDebugEnabled: input.remoteDebugEnabled }), + ...(input.remoteRecordAppArn !== undefined && + input.remoteRecordAppArn !== null && { remoteRecordAppArn: input.remoteRecordAppArn }), + ...(input.remoteRecordEnabled !== undefined && + input.remoteRecordEnabled !== null && { remoteRecordEnabled: input.remoteRecordEnabled }), + ...(input.skipAppResign !== undefined && input.skipAppResign !== null && { skipAppResign: input.skipAppResign }), + ...(input.sshPublicKey !== undefined && input.sshPublicKey !== null && { sshPublicKey: input.sshPublicKey }), }; }; @@ -7690,8 +7645,8 @@ const serializeAws_json1_1CreateTestGridProjectRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -7700,17 +7655,18 @@ const serializeAws_json1_1CreateTestGridUrlRequest = ( context: __SerdeContext ): any => { return { - ...(input.expiresInSeconds !== undefined && { expiresInSeconds: input.expiresInSeconds }), - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), + ...(input.expiresInSeconds !== undefined && + input.expiresInSeconds !== null && { expiresInSeconds: input.expiresInSeconds }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), }; }; const serializeAws_json1_1CreateUploadRequest = (input: CreateUploadRequest, context: __SerdeContext): any => { return { - ...(input.contentType !== undefined && { contentType: input.contentType }), - ...(input.name !== undefined && { name: input.name }), - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), - ...(input.type !== undefined && { type: input.type }), + ...(input.contentType !== undefined && input.contentType !== null && { contentType: input.contentType }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -7719,30 +7675,35 @@ const serializeAws_json1_1CreateVPCEConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.serviceDnsName !== undefined && { serviceDnsName: input.serviceDnsName }), - ...(input.vpceConfigurationDescription !== undefined && { - vpceConfigurationDescription: input.vpceConfigurationDescription, - }), - ...(input.vpceConfigurationName !== undefined && { vpceConfigurationName: input.vpceConfigurationName }), - ...(input.vpceServiceName !== undefined && { vpceServiceName: input.vpceServiceName }), + ...(input.serviceDnsName !== undefined && + input.serviceDnsName !== null && { serviceDnsName: input.serviceDnsName }), + ...(input.vpceConfigurationDescription !== undefined && + input.vpceConfigurationDescription !== null && { + vpceConfigurationDescription: input.vpceConfigurationDescription, + }), + ...(input.vpceConfigurationName !== undefined && + input.vpceConfigurationName !== null && { vpceConfigurationName: input.vpceConfigurationName }), + ...(input.vpceServiceName !== undefined && + input.vpceServiceName !== null && { vpceServiceName: input.vpceServiceName }), }; }; const serializeAws_json1_1CustomerArtifactPaths = (input: CustomerArtifactPaths, context: __SerdeContext): any => { return { - ...(input.androidPaths !== undefined && { - androidPaths: serializeAws_json1_1AndroidPaths(input.androidPaths, context), - }), - ...(input.deviceHostPaths !== undefined && { - deviceHostPaths: serializeAws_json1_1DeviceHostPaths(input.deviceHostPaths, context), - }), - ...(input.iosPaths !== undefined && { iosPaths: serializeAws_json1_1IosPaths(input.iosPaths, context) }), + ...(input.androidPaths !== undefined && + input.androidPaths !== null && { androidPaths: serializeAws_json1_1AndroidPaths(input.androidPaths, context) }), + ...(input.deviceHostPaths !== undefined && + input.deviceHostPaths !== null && { + deviceHostPaths: serializeAws_json1_1DeviceHostPaths(input.deviceHostPaths, context), + }), + ...(input.iosPaths !== undefined && + input.iosPaths !== null && { iosPaths: serializeAws_json1_1IosPaths(input.iosPaths, context) }), }; }; const serializeAws_json1_1DeleteDevicePoolRequest = (input: DeleteDevicePoolRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7751,7 +7712,7 @@ const serializeAws_json1_1DeleteInstanceProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7760,13 +7721,13 @@ const serializeAws_json1_1DeleteNetworkProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1DeleteProjectRequest = (input: DeleteProjectRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7775,13 +7736,13 @@ const serializeAws_json1_1DeleteRemoteAccessSessionRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1DeleteRunRequest = (input: DeleteRunRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7790,13 +7751,13 @@ const serializeAws_json1_1DeleteTestGridProjectRequest = ( context: __SerdeContext ): any => { return { - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), }; }; const serializeAws_json1_1DeleteUploadRequest = (input: DeleteUploadRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7805,28 +7766,50 @@ const serializeAws_json1_1DeleteVPCEConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1DeviceFilter = (input: DeviceFilter, context: __SerdeContext): any => { return { - ...(input.attribute !== undefined && { attribute: input.attribute }), - ...(input.operator !== undefined && { operator: input.operator }), - ...(input.values !== undefined && { values: serializeAws_json1_1DeviceFilterValues(input.values, context) }), + ...(input.attribute !== undefined && input.attribute !== null && { attribute: input.attribute }), + ...(input.operator !== undefined && input.operator !== null && { operator: input.operator }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_1DeviceFilterValues(input.values, context) }), }; }; const serializeAws_json1_1DeviceFilters = (input: DeviceFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DeviceFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DeviceFilter(entry, context); + }); }; const serializeAws_json1_1DeviceFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeviceHostPaths = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeviceSelectionConfiguration = ( @@ -7834,18 +7817,22 @@ const serializeAws_json1_1DeviceSelectionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.filters !== undefined && { filters: serializeAws_json1_1DeviceFilters(input.filters, context) }), - ...(input.maxDevices !== undefined && { maxDevices: input.maxDevices }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1DeviceFilters(input.filters, context) }), + ...(input.maxDevices !== undefined && input.maxDevices !== null && { maxDevices: input.maxDevices }), }; }; const serializeAws_json1_1ExecutionConfiguration = (input: ExecutionConfiguration, context: __SerdeContext): any => { return { - ...(input.accountsCleanup !== undefined && { accountsCleanup: input.accountsCleanup }), - ...(input.appPackagesCleanup !== undefined && { appPackagesCleanup: input.appPackagesCleanup }), - ...(input.jobTimeoutMinutes !== undefined && { jobTimeoutMinutes: input.jobTimeoutMinutes }), - ...(input.skipAppResign !== undefined && { skipAppResign: input.skipAppResign }), - ...(input.videoCapture !== undefined && { videoCapture: input.videoCapture }), + ...(input.accountsCleanup !== undefined && + input.accountsCleanup !== null && { accountsCleanup: input.accountsCleanup }), + ...(input.appPackagesCleanup !== undefined && + input.appPackagesCleanup !== null && { appPackagesCleanup: input.appPackagesCleanup }), + ...(input.jobTimeoutMinutes !== undefined && + input.jobTimeoutMinutes !== null && { jobTimeoutMinutes: input.jobTimeoutMinutes }), + ...(input.skipAppResign !== undefined && input.skipAppResign !== null && { skipAppResign: input.skipAppResign }), + ...(input.videoCapture !== undefined && input.videoCapture !== null && { videoCapture: input.videoCapture }), }; }; @@ -7861,7 +7848,7 @@ const serializeAws_json1_1GetDeviceInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7870,25 +7857,27 @@ const serializeAws_json1_1GetDevicePoolCompatibilityRequest = ( context: __SerdeContext ): any => { return { - ...(input.appArn !== undefined && { appArn: input.appArn }), - ...(input.configuration !== undefined && { - configuration: serializeAws_json1_1ScheduleRunConfiguration(input.configuration, context), - }), - ...(input.devicePoolArn !== undefined && { devicePoolArn: input.devicePoolArn }), - ...(input.test !== undefined && { test: serializeAws_json1_1ScheduleRunTest(input.test, context) }), - ...(input.testType !== undefined && { testType: input.testType }), + ...(input.appArn !== undefined && input.appArn !== null && { appArn: input.appArn }), + ...(input.configuration !== undefined && + input.configuration !== null && { + configuration: serializeAws_json1_1ScheduleRunConfiguration(input.configuration, context), + }), + ...(input.devicePoolArn !== undefined && input.devicePoolArn !== null && { devicePoolArn: input.devicePoolArn }), + ...(input.test !== undefined && + input.test !== null && { test: serializeAws_json1_1ScheduleRunTest(input.test, context) }), + ...(input.testType !== undefined && input.testType !== null && { testType: input.testType }), }; }; const serializeAws_json1_1GetDevicePoolRequest = (input: GetDevicePoolRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1GetDeviceRequest = (input: GetDeviceRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7897,13 +7886,13 @@ const serializeAws_json1_1GetInstanceProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1GetJobRequest = (input: GetJobRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7912,7 +7901,7 @@ const serializeAws_json1_1GetNetworkProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7921,13 +7910,13 @@ const serializeAws_json1_1GetOfferingStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1GetProjectRequest = (input: GetProjectRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7936,19 +7925,19 @@ const serializeAws_json1_1GetRemoteAccessSessionRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1GetRunRequest = (input: GetRunRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1GetSuiteRequest = (input: GetSuiteRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7957,7 +7946,7 @@ const serializeAws_json1_1GetTestGridProjectRequest = ( context: __SerdeContext ): any => { return { - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), }; }; @@ -7966,21 +7955,21 @@ const serializeAws_json1_1GetTestGridSessionRequest = ( context: __SerdeContext ): any => { return { - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), - ...(input.sessionArn !== undefined && { sessionArn: input.sessionArn }), - ...(input.sessionId !== undefined && { sessionId: input.sessionId }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), + ...(input.sessionArn !== undefined && input.sessionArn !== null && { sessionArn: input.sessionArn }), + ...(input.sessionId !== undefined && input.sessionId !== null && { sessionId: input.sessionId }), }; }; const serializeAws_json1_1GetTestRequest = (input: GetTestRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1GetUploadRequest = (input: GetUploadRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7989,7 +7978,7 @@ const serializeAws_json1_1GetVPCEConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -7998,24 +7987,39 @@ const serializeAws_json1_1InstallToRemoteAccessSessionRequest = ( context: __SerdeContext ): any => { return { - ...(input.appArn !== undefined && { appArn: input.appArn }), - ...(input.remoteAccessSessionArn !== undefined && { remoteAccessSessionArn: input.remoteAccessSessionArn }), + ...(input.appArn !== undefined && input.appArn !== null && { appArn: input.appArn }), + ...(input.remoteAccessSessionArn !== undefined && + input.remoteAccessSessionArn !== null && { remoteAccessSessionArn: input.remoteAccessSessionArn }), }; }; const serializeAws_json1_1InstanceLabels = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IosPaths = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListArtifactsRequest = (input: ListArtifactsRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.type !== undefined && { type: input.type }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -8024,24 +8028,25 @@ const serializeAws_json1_1ListDeviceInstancesRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListDevicePoolsRequest = (input: ListDevicePoolsRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.type !== undefined && { type: input.type }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1ListDevicesRequest = (input: ListDevicesRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.filters !== undefined && { filters: serializeAws_json1_1DeviceFilters(input.filters, context) }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1DeviceFilters(input.filters, context) }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8050,15 +8055,15 @@ const serializeAws_json1_1ListInstanceProfilesRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListJobsRequest = (input: ListJobsRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8067,9 +8072,9 @@ const serializeAws_json1_1ListNetworkProfilesRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.type !== undefined && { type: input.type }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -8078,13 +8083,13 @@ const serializeAws_json1_1ListOfferingPromotionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListOfferingsRequest = (input: ListOfferingsRequest, context: __SerdeContext): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8093,14 +8098,14 @@ const serializeAws_json1_1ListOfferingTransactionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListProjectsRequest = (input: ListProjectsRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8109,29 +8114,29 @@ const serializeAws_json1_1ListRemoteAccessSessionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListRunsRequest = (input: ListRunsRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListSamplesRequest = (input: ListSamplesRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListSuitesRequest = (input: ListSuitesRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8140,7 +8145,7 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; @@ -8149,8 +8154,8 @@ const serializeAws_json1_1ListTestGridProjectsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResult !== undefined && { maxResult: input.maxResult }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResult !== undefined && input.maxResult !== null && { maxResult: input.maxResult }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8159,9 +8164,9 @@ const serializeAws_json1_1ListTestGridSessionActionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResult !== undefined && { maxResult: input.maxResult }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sessionArn !== undefined && { sessionArn: input.sessionArn }), + ...(input.maxResult !== undefined && input.maxResult !== null && { maxResult: input.maxResult }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sessionArn !== undefined && input.sessionArn !== null && { sessionArn: input.sessionArn }), }; }; @@ -8170,10 +8175,10 @@ const serializeAws_json1_1ListTestGridSessionArtifactsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResult !== undefined && { maxResult: input.maxResult }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sessionArn !== undefined && { sessionArn: input.sessionArn }), - ...(input.type !== undefined && { type: input.type }), + ...(input.maxResult !== undefined && input.maxResult !== null && { maxResult: input.maxResult }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sessionArn !== undefined && input.sessionArn !== null && { sessionArn: input.sessionArn }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -8182,25 +8187,27 @@ const serializeAws_json1_1ListTestGridSessionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.creationTimeAfter !== undefined && { - creationTimeAfter: Math.round(input.creationTimeAfter.getTime() / 1000), - }), - ...(input.creationTimeBefore !== undefined && { - creationTimeBefore: Math.round(input.creationTimeBefore.getTime() / 1000), - }), - ...(input.endTimeAfter !== undefined && { endTimeAfter: Math.round(input.endTimeAfter.getTime() / 1000) }), - ...(input.endTimeBefore !== undefined && { endTimeBefore: Math.round(input.endTimeBefore.getTime() / 1000) }), - ...(input.maxResult !== undefined && { maxResult: input.maxResult }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), - ...(input.status !== undefined && { status: input.status }), + ...(input.creationTimeAfter !== undefined && + input.creationTimeAfter !== null && { creationTimeAfter: Math.round(input.creationTimeAfter.getTime() / 1000) }), + ...(input.creationTimeBefore !== undefined && + input.creationTimeBefore !== null && { + creationTimeBefore: Math.round(input.creationTimeBefore.getTime() / 1000), + }), + ...(input.endTimeAfter !== undefined && + input.endTimeAfter !== null && { endTimeAfter: Math.round(input.endTimeAfter.getTime() / 1000) }), + ...(input.endTimeBefore !== undefined && + input.endTimeBefore !== null && { endTimeBefore: Math.round(input.endTimeBefore.getTime() / 1000) }), + ...(input.maxResult !== undefined && input.maxResult !== null && { maxResult: input.maxResult }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1ListTestsRequest = (input: ListTestsRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -8209,16 +8216,16 @@ const serializeAws_json1_1ListUniqueProblemsRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListUploadsRequest = (input: ListUploadsRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.type !== undefined && { type: input.type }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -8227,56 +8234,71 @@ const serializeAws_json1_1ListVPCEConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1Location = (input: Location, context: __SerdeContext): any => { return { - ...(input.latitude !== undefined && { latitude: input.latitude }), - ...(input.longitude !== undefined && { longitude: input.longitude }), + ...(input.latitude !== undefined && input.latitude !== null && { latitude: input.latitude }), + ...(input.longitude !== undefined && input.longitude !== null && { longitude: input.longitude }), }; }; const serializeAws_json1_1PackageIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PurchaseOfferingRequest = (input: PurchaseOfferingRequest, context: __SerdeContext): any => { return { - ...(input.offeringId !== undefined && { offeringId: input.offeringId }), - ...(input.offeringPromotionId !== undefined && { offeringPromotionId: input.offeringPromotionId }), - ...(input.quantity !== undefined && { quantity: input.quantity }), + ...(input.offeringId !== undefined && input.offeringId !== null && { offeringId: input.offeringId }), + ...(input.offeringPromotionId !== undefined && + input.offeringPromotionId !== null && { offeringPromotionId: input.offeringPromotionId }), + ...(input.quantity !== undefined && input.quantity !== null && { quantity: input.quantity }), }; }; const serializeAws_json1_1Radios = (input: Radios, context: __SerdeContext): any => { return { - ...(input.bluetooth !== undefined && { bluetooth: input.bluetooth }), - ...(input.gps !== undefined && { gps: input.gps }), - ...(input.nfc !== undefined && { nfc: input.nfc }), - ...(input.wifi !== undefined && { wifi: input.wifi }), + ...(input.bluetooth !== undefined && input.bluetooth !== null && { bluetooth: input.bluetooth }), + ...(input.gps !== undefined && input.gps !== null && { gps: input.gps }), + ...(input.nfc !== undefined && input.nfc !== null && { nfc: input.nfc }), + ...(input.wifi !== undefined && input.wifi !== null && { wifi: input.wifi }), }; }; const serializeAws_json1_1RenewOfferingRequest = (input: RenewOfferingRequest, context: __SerdeContext): any => { return { - ...(input.offeringId !== undefined && { offeringId: input.offeringId }), - ...(input.quantity !== undefined && { quantity: input.quantity }), + ...(input.offeringId !== undefined && input.offeringId !== null && { offeringId: input.offeringId }), + ...(input.quantity !== undefined && input.quantity !== null && { quantity: input.quantity }), }; }; const serializeAws_json1_1Rule = (input: Rule, context: __SerdeContext): any => { return { - ...(input.attribute !== undefined && { attribute: input.attribute }), - ...(input.operator !== undefined && { operator: input.operator }), - ...(input.value !== undefined && { value: input.value }), + ...(input.attribute !== undefined && input.attribute !== null && { attribute: input.attribute }), + ...(input.operator !== undefined && input.operator !== null && { operator: input.operator }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1Rules = (input: Rule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Rule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Rule(entry, context); + }); }; const serializeAws_json1_1ScheduleRunConfiguration = ( @@ -8284,61 +8306,72 @@ const serializeAws_json1_1ScheduleRunConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.auxiliaryApps !== undefined && { - auxiliaryApps: serializeAws_json1_1AmazonResourceNames(input.auxiliaryApps, context), - }), - ...(input.billingMethod !== undefined && { billingMethod: input.billingMethod }), - ...(input.customerArtifactPaths !== undefined && { - customerArtifactPaths: serializeAws_json1_1CustomerArtifactPaths(input.customerArtifactPaths, context), - }), - ...(input.extraDataPackageArn !== undefined && { extraDataPackageArn: input.extraDataPackageArn }), - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.location !== undefined && { location: serializeAws_json1_1Location(input.location, context) }), - ...(input.networkProfileArn !== undefined && { networkProfileArn: input.networkProfileArn }), - ...(input.radios !== undefined && { radios: serializeAws_json1_1Radios(input.radios, context) }), - ...(input.vpceConfigurationArns !== undefined && { - vpceConfigurationArns: serializeAws_json1_1AmazonResourceNames(input.vpceConfigurationArns, context), - }), + ...(input.auxiliaryApps !== undefined && + input.auxiliaryApps !== null && { + auxiliaryApps: serializeAws_json1_1AmazonResourceNames(input.auxiliaryApps, context), + }), + ...(input.billingMethod !== undefined && input.billingMethod !== null && { billingMethod: input.billingMethod }), + ...(input.customerArtifactPaths !== undefined && + input.customerArtifactPaths !== null && { + customerArtifactPaths: serializeAws_json1_1CustomerArtifactPaths(input.customerArtifactPaths, context), + }), + ...(input.extraDataPackageArn !== undefined && + input.extraDataPackageArn !== null && { extraDataPackageArn: input.extraDataPackageArn }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.location !== undefined && + input.location !== null && { location: serializeAws_json1_1Location(input.location, context) }), + ...(input.networkProfileArn !== undefined && + input.networkProfileArn !== null && { networkProfileArn: input.networkProfileArn }), + ...(input.radios !== undefined && + input.radios !== null && { radios: serializeAws_json1_1Radios(input.radios, context) }), + ...(input.vpceConfigurationArns !== undefined && + input.vpceConfigurationArns !== null && { + vpceConfigurationArns: serializeAws_json1_1AmazonResourceNames(input.vpceConfigurationArns, context), + }), }; }; const serializeAws_json1_1ScheduleRunRequest = (input: ScheduleRunRequest, context: __SerdeContext): any => { return { - ...(input.appArn !== undefined && { appArn: input.appArn }), - ...(input.configuration !== undefined && { - configuration: serializeAws_json1_1ScheduleRunConfiguration(input.configuration, context), - }), - ...(input.devicePoolArn !== undefined && { devicePoolArn: input.devicePoolArn }), - ...(input.deviceSelectionConfiguration !== undefined && { - deviceSelectionConfiguration: serializeAws_json1_1DeviceSelectionConfiguration( - input.deviceSelectionConfiguration, - context - ), - }), - ...(input.executionConfiguration !== undefined && { - executionConfiguration: serializeAws_json1_1ExecutionConfiguration(input.executionConfiguration, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), - ...(input.test !== undefined && { test: serializeAws_json1_1ScheduleRunTest(input.test, context) }), + ...(input.appArn !== undefined && input.appArn !== null && { appArn: input.appArn }), + ...(input.configuration !== undefined && + input.configuration !== null && { + configuration: serializeAws_json1_1ScheduleRunConfiguration(input.configuration, context), + }), + ...(input.devicePoolArn !== undefined && input.devicePoolArn !== null && { devicePoolArn: input.devicePoolArn }), + ...(input.deviceSelectionConfiguration !== undefined && + input.deviceSelectionConfiguration !== null && { + deviceSelectionConfiguration: serializeAws_json1_1DeviceSelectionConfiguration( + input.deviceSelectionConfiguration, + context + ), + }), + ...(input.executionConfiguration !== undefined && + input.executionConfiguration !== null && { + executionConfiguration: serializeAws_json1_1ExecutionConfiguration(input.executionConfiguration, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), + ...(input.test !== undefined && + input.test !== null && { test: serializeAws_json1_1ScheduleRunTest(input.test, context) }), }; }; const serializeAws_json1_1ScheduleRunTest = (input: ScheduleRunTest, context: __SerdeContext): any => { return { - ...(input.filter !== undefined && { filter: input.filter }), - ...(input.parameters !== undefined && { - parameters: serializeAws_json1_1TestParameters(input.parameters, context), - }), - ...(input.testPackageArn !== undefined && { testPackageArn: input.testPackageArn }), - ...(input.testSpecArn !== undefined && { testSpecArn: input.testSpecArn }), - ...(input.type !== undefined && { type: input.type }), + ...(input.filter !== undefined && input.filter !== null && { filter: input.filter }), + ...(input.parameters !== undefined && + input.parameters !== null && { parameters: serializeAws_json1_1TestParameters(input.parameters, context) }), + ...(input.testPackageArn !== undefined && + input.testPackageArn !== null && { testPackageArn: input.testPackageArn }), + ...(input.testSpecArn !== undefined && input.testSpecArn !== null && { testSpecArn: input.testSpecArn }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1StopJobRequest = (input: StopJobRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; @@ -8347,52 +8380,69 @@ const serializeAws_json1_1StopRemoteAccessSessionRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1StopRunRequest = (input: StopRunRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TestParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -8401,20 +8451,23 @@ const serializeAws_json1_1UpdateDeviceInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.labels !== undefined && { labels: serializeAws_json1_1InstanceLabels(input.labels, context) }), - ...(input.profileArn !== undefined && { profileArn: input.profileArn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.labels !== undefined && + input.labels !== null && { labels: serializeAws_json1_1InstanceLabels(input.labels, context) }), + ...(input.profileArn !== undefined && input.profileArn !== null && { profileArn: input.profileArn }), }; }; const serializeAws_json1_1UpdateDevicePoolRequest = (input: UpdateDevicePoolRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.clearMaxDevices !== undefined && { clearMaxDevices: input.clearMaxDevices }), - ...(input.description !== undefined && { description: input.description }), - ...(input.maxDevices !== undefined && { maxDevices: input.maxDevices }), - ...(input.name !== undefined && { name: input.name }), - ...(input.rules !== undefined && { rules: serializeAws_json1_1Rules(input.rules, context) }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.clearMaxDevices !== undefined && + input.clearMaxDevices !== null && { clearMaxDevices: input.clearMaxDevices }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.maxDevices !== undefined && input.maxDevices !== null && { maxDevices: input.maxDevices }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.rules !== undefined && + input.rules !== null && { rules: serializeAws_json1_1Rules(input.rules, context) }), }; }; @@ -8423,14 +8476,17 @@ const serializeAws_json1_1UpdateInstanceProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.description !== undefined && { description: input.description }), - ...(input.excludeAppPackagesFromCleanup !== undefined && { - excludeAppPackagesFromCleanup: serializeAws_json1_1PackageIds(input.excludeAppPackagesFromCleanup, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.packageCleanup !== undefined && { packageCleanup: input.packageCleanup }), - ...(input.rebootAfterUse !== undefined && { rebootAfterUse: input.rebootAfterUse }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.excludeAppPackagesFromCleanup !== undefined && + input.excludeAppPackagesFromCleanup !== null && { + excludeAppPackagesFromCleanup: serializeAws_json1_1PackageIds(input.excludeAppPackagesFromCleanup, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.packageCleanup !== undefined && + input.packageCleanup !== null && { packageCleanup: input.packageCleanup }), + ...(input.rebootAfterUse !== undefined && + input.rebootAfterUse !== null && { rebootAfterUse: input.rebootAfterUse }), }; }; @@ -8439,26 +8495,34 @@ const serializeAws_json1_1UpdateNetworkProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.description !== undefined && { description: input.description }), - ...(input.downlinkBandwidthBits !== undefined && { downlinkBandwidthBits: input.downlinkBandwidthBits }), - ...(input.downlinkDelayMs !== undefined && { downlinkDelayMs: input.downlinkDelayMs }), - ...(input.downlinkJitterMs !== undefined && { downlinkJitterMs: input.downlinkJitterMs }), - ...(input.downlinkLossPercent !== undefined && { downlinkLossPercent: input.downlinkLossPercent }), - ...(input.name !== undefined && { name: input.name }), - ...(input.type !== undefined && { type: input.type }), - ...(input.uplinkBandwidthBits !== undefined && { uplinkBandwidthBits: input.uplinkBandwidthBits }), - ...(input.uplinkDelayMs !== undefined && { uplinkDelayMs: input.uplinkDelayMs }), - ...(input.uplinkJitterMs !== undefined && { uplinkJitterMs: input.uplinkJitterMs }), - ...(input.uplinkLossPercent !== undefined && { uplinkLossPercent: input.uplinkLossPercent }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.downlinkBandwidthBits !== undefined && + input.downlinkBandwidthBits !== null && { downlinkBandwidthBits: input.downlinkBandwidthBits }), + ...(input.downlinkDelayMs !== undefined && + input.downlinkDelayMs !== null && { downlinkDelayMs: input.downlinkDelayMs }), + ...(input.downlinkJitterMs !== undefined && + input.downlinkJitterMs !== null && { downlinkJitterMs: input.downlinkJitterMs }), + ...(input.downlinkLossPercent !== undefined && + input.downlinkLossPercent !== null && { downlinkLossPercent: input.downlinkLossPercent }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.uplinkBandwidthBits !== undefined && + input.uplinkBandwidthBits !== null && { uplinkBandwidthBits: input.uplinkBandwidthBits }), + ...(input.uplinkDelayMs !== undefined && input.uplinkDelayMs !== null && { uplinkDelayMs: input.uplinkDelayMs }), + ...(input.uplinkJitterMs !== undefined && + input.uplinkJitterMs !== null && { uplinkJitterMs: input.uplinkJitterMs }), + ...(input.uplinkLossPercent !== undefined && + input.uplinkLossPercent !== null && { uplinkLossPercent: input.uplinkLossPercent }), }; }; const serializeAws_json1_1UpdateProjectRequest = (input: UpdateProjectRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.defaultJobTimeoutMinutes !== undefined && { defaultJobTimeoutMinutes: input.defaultJobTimeoutMinutes }), - ...(input.name !== undefined && { name: input.name }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.defaultJobTimeoutMinutes !== undefined && + input.defaultJobTimeoutMinutes !== null && { defaultJobTimeoutMinutes: input.defaultJobTimeoutMinutes }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -8467,18 +8531,18 @@ const serializeAws_json1_1UpdateTestGridProjectRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.projectArn !== undefined && { projectArn: input.projectArn }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.projectArn !== undefined && input.projectArn !== null && { projectArn: input.projectArn }), }; }; const serializeAws_json1_1UpdateUploadRequest = (input: UpdateUploadRequest, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.contentType !== undefined && { contentType: input.contentType }), - ...(input.editContent !== undefined && { editContent: input.editContent }), - ...(input.name !== undefined && { name: input.name }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.contentType !== undefined && input.contentType !== null && { contentType: input.contentType }), + ...(input.editContent !== undefined && input.editContent !== null && { editContent: input.editContent }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -8487,13 +8551,17 @@ const serializeAws_json1_1UpdateVPCEConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.serviceDnsName !== undefined && { serviceDnsName: input.serviceDnsName }), - ...(input.vpceConfigurationDescription !== undefined && { - vpceConfigurationDescription: input.vpceConfigurationDescription, - }), - ...(input.vpceConfigurationName !== undefined && { vpceConfigurationName: input.vpceConfigurationName }), - ...(input.vpceServiceName !== undefined && { vpceServiceName: input.vpceServiceName }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.serviceDnsName !== undefined && + input.serviceDnsName !== null && { serviceDnsName: input.serviceDnsName }), + ...(input.vpceConfigurationDescription !== undefined && + input.vpceConfigurationDescription !== null && { + vpceConfigurationDescription: input.vpceConfigurationDescription, + }), + ...(input.vpceConfigurationName !== undefined && + input.vpceConfigurationName !== null && { vpceConfigurationName: input.vpceConfigurationName }), + ...(input.vpceServiceName !== undefined && + input.vpceServiceName !== null && { vpceServiceName: input.vpceServiceName }), }; }; @@ -8531,7 +8599,14 @@ const deserializeAws_json1_1AccountSettings = (output: any, context: __SerdeCont }; const deserializeAws_json1_1AndroidPaths = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ArgumentException = (output: any, context: __SerdeContext): ArgumentException => { @@ -8551,7 +8626,14 @@ const deserializeAws_json1_1Artifact = (output: any, context: __SerdeContext): A }; const deserializeAws_json1_1Artifacts = (output: any, context: __SerdeContext): Artifact[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Artifact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Artifact(entry, context); + }); }; const deserializeAws_json1_1CannotDeleteException = (output: any, context: __SerdeContext): CannotDeleteException => { @@ -8796,15 +8878,36 @@ const deserializeAws_json1_1DeviceFilter = (output: any, context: __SerdeContext }; const deserializeAws_json1_1DeviceFilters = (output: any, context: __SerdeContext): DeviceFilter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeviceFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeviceFilter(entry, context); + }); }; const deserializeAws_json1_1DeviceFilterValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeviceHostPaths = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeviceInstance = (output: any, context: __SerdeContext): DeviceInstance => { @@ -8825,7 +8928,14 @@ const deserializeAws_json1_1DeviceInstance = (output: any, context: __SerdeConte }; const deserializeAws_json1_1DeviceInstances = (output: any, context: __SerdeContext): DeviceInstance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeviceInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeviceInstance(entry, context); + }); }; const deserializeAws_json1_1DeviceMinutes = (output: any, context: __SerdeContext): DeviceMinutes => { @@ -8871,15 +8981,36 @@ const deserializeAws_json1_1DevicePoolCompatibilityResults = ( output: any, context: __SerdeContext ): DevicePoolCompatibilityResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DevicePoolCompatibilityResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DevicePoolCompatibilityResult(entry, context); + }); }; const deserializeAws_json1_1DevicePools = (output: any, context: __SerdeContext): DevicePool[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DevicePool(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DevicePool(entry, context); + }); }; const deserializeAws_json1_1Devices = (output: any, context: __SerdeContext): Device[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Device(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Device(entry, context); + }); }; const deserializeAws_json1_1DeviceSelectionResult = (output: any, context: __SerdeContext): DeviceSelectionResult => { @@ -9106,7 +9237,14 @@ const deserializeAws_json1_1IncompatibilityMessages = ( output: any, context: __SerdeContext ): IncompatibilityMessage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IncompatibilityMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IncompatibilityMessage(entry, context); + }); }; const deserializeAws_json1_1InstallToRemoteAccessSessionResult = ( @@ -9122,7 +9260,14 @@ const deserializeAws_json1_1InstallToRemoteAccessSessionResult = ( }; const deserializeAws_json1_1InstanceLabels = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InstanceProfile = (output: any, context: __SerdeContext): InstanceProfile => { @@ -9142,7 +9287,14 @@ const deserializeAws_json1_1InstanceProfile = (output: any, context: __SerdeCont }; const deserializeAws_json1_1InstanceProfiles = (output: any, context: __SerdeContext): InstanceProfile[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceProfile(entry, context); + }); }; const deserializeAws_json1_1InternalServiceException = ( @@ -9164,7 +9316,14 @@ const deserializeAws_json1_1InvalidOperationException = ( }; const deserializeAws_json1_1IosPaths = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Job = (output: any, context: __SerdeContext): Job => { @@ -9201,7 +9360,14 @@ const deserializeAws_json1_1Job = (output: any, context: __SerdeContext): Job => }; const deserializeAws_json1_1Jobs = (output: any, context: __SerdeContext): Job[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Job(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Job(entry, context); + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -9492,13 +9658,15 @@ const deserializeAws_json1_1Location = (output: any, context: __SerdeContext): L }; const deserializeAws_json1_1MaxSlotMap = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1MonetaryAmount = (output: any, context: __SerdeContext): MonetaryAmount => { @@ -9542,7 +9710,14 @@ const deserializeAws_json1_1NetworkProfile = (output: any, context: __SerdeConte }; const deserializeAws_json1_1NetworkProfiles = (output: any, context: __SerdeContext): NetworkProfile[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NetworkProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NetworkProfile(entry, context); + }); }; const deserializeAws_json1_1NotEligibleException = (output: any, context: __SerdeContext): NotEligibleException => { @@ -9578,11 +9753,25 @@ const deserializeAws_json1_1OfferingPromotion = (output: any, context: __SerdeCo }; const deserializeAws_json1_1OfferingPromotions = (output: any, context: __SerdeContext): OfferingPromotion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OfferingPromotion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OfferingPromotion(entry, context); + }); }; const deserializeAws_json1_1Offerings = (output: any, context: __SerdeContext): Offering[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Offering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Offering(entry, context); + }); }; const deserializeAws_json1_1OfferingStatus = (output: any, context: __SerdeContext): OfferingStatus => { @@ -9604,13 +9793,15 @@ const deserializeAws_json1_1OfferingStatusMap = ( output: any, context: __SerdeContext ): { [key: string]: OfferingStatus } => { - return Object.entries(output).reduce( - (acc: { [key: string]: OfferingStatus }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: OfferingStatus }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1OfferingStatus(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1OfferingTransaction = (output: any, context: __SerdeContext): OfferingTransaction => { @@ -9637,11 +9828,25 @@ const deserializeAws_json1_1OfferingTransaction = (output: any, context: __Serde }; const deserializeAws_json1_1OfferingTransactions = (output: any, context: __SerdeContext): OfferingTransaction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OfferingTransaction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OfferingTransaction(entry, context); + }); }; const deserializeAws_json1_1PackageIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Problem = (output: any, context: __SerdeContext): Problem => { @@ -9679,7 +9884,14 @@ const deserializeAws_json1_1ProblemDetail = (output: any, context: __SerdeContex }; const deserializeAws_json1_1Problems = (output: any, context: __SerdeContext): Problem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Problem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Problem(entry, context); + }); }; const deserializeAws_json1_1Project = (output: any, context: __SerdeContext): Project => { @@ -9696,15 +9908,27 @@ const deserializeAws_json1_1Project = (output: any, context: __SerdeContext): Pr }; const deserializeAws_json1_1Projects = (output: any, context: __SerdeContext): Project[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Project(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Project(entry, context); + }); }; const deserializeAws_json1_1PurchasedDevicesMap = (output: any, context: __SerdeContext): { [key: string]: number } => { return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [DevicePlatform | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: number }, [key, value]: [DevicePlatform | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -9738,7 +9962,14 @@ const deserializeAws_json1_1RecurringCharge = (output: any, context: __SerdeCont }; const deserializeAws_json1_1RecurringCharges = (output: any, context: __SerdeContext): RecurringCharge[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RecurringCharge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RecurringCharge(entry, context); + }); }; const deserializeAws_json1_1RemoteAccessSession = (output: any, context: __SerdeContext): RemoteAccessSession => { @@ -9789,7 +10020,14 @@ const deserializeAws_json1_1RemoteAccessSession = (output: any, context: __Serde }; const deserializeAws_json1_1RemoteAccessSessions = (output: any, context: __SerdeContext): RemoteAccessSession[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RemoteAccessSession(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RemoteAccessSession(entry, context); + }); }; const deserializeAws_json1_1RenewOfferingResult = (output: any, context: __SerdeContext): RenewOfferingResult => { @@ -9817,7 +10055,14 @@ const deserializeAws_json1_1Rule = (output: any, context: __SerdeContext): Rule }; const deserializeAws_json1_1Rules = (output: any, context: __SerdeContext): Rule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Rule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Rule(entry, context); + }); }; const deserializeAws_json1_1Run = (output: any, context: __SerdeContext): Run => { @@ -9889,7 +10134,14 @@ const deserializeAws_json1_1Run = (output: any, context: __SerdeContext): Run => }; const deserializeAws_json1_1Runs = (output: any, context: __SerdeContext): Run[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Run(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Run(entry, context); + }); }; const deserializeAws_json1_1Sample = (output: any, context: __SerdeContext): Sample => { @@ -9901,7 +10153,14 @@ const deserializeAws_json1_1Sample = (output: any, context: __SerdeContext): Sam }; const deserializeAws_json1_1Samples = (output: any, context: __SerdeContext): Sample[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Sample(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Sample(entry, context); + }); }; const deserializeAws_json1_1ScheduleRunResult = (output: any, context: __SerdeContext): ScheduleRunResult => { @@ -9969,7 +10228,14 @@ const deserializeAws_json1_1Suite = (output: any, context: __SerdeContext): Suit }; const deserializeAws_json1_1Suites = (output: any, context: __SerdeContext): Suite[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Suite(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Suite(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -9980,7 +10246,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagOperationException = (output: any, context: __SerdeContext): TagOperationException => { @@ -10037,7 +10310,14 @@ const deserializeAws_json1_1TestGridProject = (output: any, context: __SerdeCont }; const deserializeAws_json1_1TestGridProjects = (output: any, context: __SerdeContext): TestGridProject[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TestGridProject(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TestGridProject(entry, context); + }); }; const deserializeAws_json1_1TestGridSession = (output: any, context: __SerdeContext): TestGridSession => { @@ -10072,7 +10352,14 @@ const deserializeAws_json1_1TestGridSessionActions = ( output: any, context: __SerdeContext ): TestGridSessionAction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TestGridSessionAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TestGridSessionAction(entry, context); + }); }; const deserializeAws_json1_1TestGridSessionArtifact = ( @@ -10090,15 +10377,36 @@ const deserializeAws_json1_1TestGridSessionArtifacts = ( output: any, context: __SerdeContext ): TestGridSessionArtifact[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TestGridSessionArtifact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TestGridSessionArtifact(entry, context); + }); }; const deserializeAws_json1_1TestGridSessions = (output: any, context: __SerdeContext): TestGridSession[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TestGridSession(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TestGridSession(entry, context); + }); }; const deserializeAws_json1_1Tests = (output: any, context: __SerdeContext): Test[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Test(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Test(entry, context); + }); }; const deserializeAws_json1_1TooManyTagsException = (output: any, context: __SerdeContext): TooManyTagsException => { @@ -10126,7 +10434,14 @@ const deserializeAws_json1_1UniqueProblem = (output: any, context: __SerdeContex }; const deserializeAws_json1_1UniqueProblems = (output: any, context: __SerdeContext): UniqueProblem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UniqueProblem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UniqueProblem(entry, context); + }); }; const deserializeAws_json1_1UniqueProblemsByExecutionResultMap = ( @@ -10134,10 +10449,15 @@ const deserializeAws_json1_1UniqueProblemsByExecutionResultMap = ( context: __SerdeContext ): { [key: string]: UniqueProblem[] } => { return Object.entries(output).reduce( - (acc: { [key: string]: UniqueProblem[] }, [key, value]: [ExecutionResult | string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_1UniqueProblems(value, context), - }), + (acc: { [key: string]: UniqueProblem[] }, [key, value]: [ExecutionResult | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_1UniqueProblems(value, context), + }; + }, {} ); }; @@ -10250,7 +10570,14 @@ const deserializeAws_json1_1Upload = (output: any, context: __SerdeContext): Upl }; const deserializeAws_json1_1Uploads = (output: any, context: __SerdeContext): Upload[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Upload(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Upload(entry, context); + }); }; const deserializeAws_json1_1VPCEConfiguration = (output: any, context: __SerdeContext): VPCEConfiguration => { @@ -10272,7 +10599,14 @@ const deserializeAws_json1_1VPCEConfiguration = (output: any, context: __SerdeCo }; const deserializeAws_json1_1VPCEConfigurations = (output: any, context: __SerdeContext): VPCEConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VPCEConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VPCEConfiguration(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -10325,3 +10659,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-devops-guru/protocols/Aws_restJson1.ts b/clients/client-devops-guru/protocols/Aws_restJson1.ts index f6635fc0c533..8a1c51ad87e3 100644 --- a/clients/client-devops-guru/protocols/Aws_restJson1.ts +++ b/clients/client-devops-guru/protocols/Aws_restJson1.ts @@ -129,14 +129,13 @@ export const serializeAws_restJson1AddNotificationChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels"; let body: any; body = JSON.stringify({ - ...(input.Config !== undefined && { - Config: serializeAws_restJson1NotificationChannelConfig(input.Config, context), - }), + ...(input.Config !== undefined && + input.Config !== null && { Config: serializeAws_restJson1NotificationChannelConfig(input.Config, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -154,12 +153,10 @@ export const serializeAws_restJson1DescribeAccountHealthCommand = async ( input: DescribeAccountHealthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/health"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -177,13 +174,14 @@ export const serializeAws_restJson1DescribeAccountOverviewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/overview"; let body: any; body = JSON.stringify({ - ...(input.FromTime !== undefined && { FromTime: Math.round(input.FromTime.getTime() / 1000) }), - ...(input.ToTime !== undefined && { ToTime: Math.round(input.ToTime.getTime() / 1000) }), + ...(input.FromTime !== undefined && + input.FromTime !== null && { FromTime: Math.round(input.FromTime.getTime() / 1000) }), + ...(input.ToTime !== undefined && input.ToTime !== null && { ToTime: Math.round(input.ToTime.getTime() / 1000) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -201,9 +199,7 @@ export const serializeAws_restJson1DescribeAnomalyCommand = async ( input: DescribeAnomalyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/anomalies/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -231,9 +227,7 @@ export const serializeAws_restJson1DescribeInsightCommand = async ( input: DescribeInsightCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/insights/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -261,9 +255,7 @@ export const serializeAws_restJson1DescribeResourceCollectionHealthCommand = asy input: DescribeResourceCollectionHealthCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/health/resource-collection/{ResourceCollectionType}"; if (input.ResourceCollectionType !== undefined) { const labelValue: string = input.ResourceCollectionType; @@ -295,12 +287,10 @@ export const serializeAws_restJson1DescribeServiceIntegrationCommand = async ( input: DescribeServiceIntegrationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/service-integrations"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -317,9 +307,7 @@ export const serializeAws_restJson1GetResourceCollectionCommand = async ( input: GetResourceCollectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/resource-collections/{ResourceCollectionType}"; if (input.ResourceCollectionType !== undefined) { const labelValue: string = input.ResourceCollectionType; @@ -352,7 +340,7 @@ export const serializeAws_restJson1ListAnomaliesForInsightCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/anomalies/insight/{InsightId}"; if (input.InsightId !== undefined) { @@ -366,11 +354,12 @@ export const serializeAws_restJson1ListAnomaliesForInsightCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTimeRange !== undefined && { - StartTimeRange: serializeAws_restJson1StartTimeRange(input.StartTimeRange, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTimeRange !== undefined && + input.StartTimeRange !== null && { + StartTimeRange: serializeAws_restJson1StartTimeRange(input.StartTimeRange, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -389,14 +378,15 @@ export const serializeAws_restJson1ListEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/events"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { Filters: serializeAws_restJson1ListEventsFilters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1ListEventsFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -415,16 +405,17 @@ export const serializeAws_restJson1ListInsightsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/insights"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StatusFilter !== undefined && { - StatusFilter: serializeAws_restJson1ListInsightsStatusFilter(input.StatusFilter, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StatusFilter !== undefined && + input.StatusFilter !== null && { + StatusFilter: serializeAws_restJson1ListInsightsStatusFilter(input.StatusFilter, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -443,12 +434,12 @@ export const serializeAws_restJson1ListNotificationChannelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels"; let body: any; body = JSON.stringify({ - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -467,13 +458,13 @@ export const serializeAws_restJson1ListRecommendationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/recommendations"; let body: any; body = JSON.stringify({ - ...(input.InsightId !== undefined && { InsightId: input.InsightId }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.InsightId !== undefined && input.InsightId !== null && { InsightId: input.InsightId }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -492,14 +483,15 @@ export const serializeAws_restJson1PutFeedbackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/feedback"; let body: any; body = JSON.stringify({ - ...(input.InsightFeedback !== undefined && { - InsightFeedback: serializeAws_restJson1InsightFeedback(input.InsightFeedback, context), - }), + ...(input.InsightFeedback !== undefined && + input.InsightFeedback !== null && { + InsightFeedback: serializeAws_restJson1InsightFeedback(input.InsightFeedback, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -517,9 +509,7 @@ export const serializeAws_restJson1RemoveNotificationChannelCommand = async ( input: RemoveNotificationChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -548,20 +538,20 @@ export const serializeAws_restJson1SearchInsightsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/insights/search"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1SearchInsightsFilters(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTimeRange !== undefined && { - StartTimeRange: serializeAws_restJson1StartTimeRange(input.StartTimeRange, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1SearchInsightsFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTimeRange !== undefined && + input.StartTimeRange !== null && { + StartTimeRange: serializeAws_restJson1StartTimeRange(input.StartTimeRange, context), + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -580,15 +570,16 @@ export const serializeAws_restJson1UpdateResourceCollectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/resource-collections"; let body: any; body = JSON.stringify({ - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.ResourceCollection !== undefined && { - ResourceCollection: serializeAws_restJson1UpdateResourceCollectionFilter(input.ResourceCollection, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.ResourceCollection !== undefined && + input.ResourceCollection !== null && { + ResourceCollection: serializeAws_restJson1UpdateResourceCollectionFilter(input.ResourceCollection, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -607,14 +598,15 @@ export const serializeAws_restJson1UpdateServiceIntegrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/service-integrations"; let body: any; body = JSON.stringify({ - ...(input.ServiceIntegration !== undefined && { - ServiceIntegration: serializeAws_restJson1UpdateServiceIntegrationConfig(input.ServiceIntegration, context), - }), + ...(input.ServiceIntegration !== undefined && + input.ServiceIntegration !== null && { + ServiceIntegration: serializeAws_restJson1UpdateServiceIntegrationConfig(input.ServiceIntegration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2386,51 +2378,70 @@ const serializeAws_restJson1CloudFormationCollection = ( context: __SerdeContext ): any => { return { - ...(input.StackNames !== undefined && { StackNames: serializeAws_restJson1StackNames(input.StackNames, context) }), + ...(input.StackNames !== undefined && + input.StackNames !== null && { StackNames: serializeAws_restJson1StackNames(input.StackNames, context) }), }; }; const serializeAws_restJson1EndTimeRange = (input: EndTimeRange, context: __SerdeContext): any => { return { - ...(input.FromTime !== undefined && { FromTime: Math.round(input.FromTime.getTime() / 1000) }), - ...(input.ToTime !== undefined && { ToTime: Math.round(input.ToTime.getTime() / 1000) }), + ...(input.FromTime !== undefined && + input.FromTime !== null && { FromTime: Math.round(input.FromTime.getTime() / 1000) }), + ...(input.ToTime !== undefined && input.ToTime !== null && { ToTime: Math.round(input.ToTime.getTime() / 1000) }), }; }; const serializeAws_restJson1EventTimeRange = (input: EventTimeRange, context: __SerdeContext): any => { return { - ...(input.FromTime !== undefined && { FromTime: Math.round(input.FromTime.getTime() / 1000) }), - ...(input.ToTime !== undefined && { ToTime: Math.round(input.ToTime.getTime() / 1000) }), + ...(input.FromTime !== undefined && + input.FromTime !== null && { FromTime: Math.round(input.FromTime.getTime() / 1000) }), + ...(input.ToTime !== undefined && input.ToTime !== null && { ToTime: Math.round(input.ToTime.getTime() / 1000) }), }; }; const serializeAws_restJson1InsightFeedback = (input: InsightFeedback, context: __SerdeContext): any => { return { - ...(input.Feedback !== undefined && { Feedback: input.Feedback }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Feedback !== undefined && input.Feedback !== null && { Feedback: input.Feedback }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_restJson1InsightSeverities = (input: (InsightSeverity | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1InsightStatuses = (input: (InsightStatus | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListEventsFilters = (input: ListEventsFilters, context: __SerdeContext): any => { return { - ...(input.DataSource !== undefined && { DataSource: input.DataSource }), - ...(input.EventClass !== undefined && { EventClass: input.EventClass }), - ...(input.EventSource !== undefined && { EventSource: input.EventSource }), - ...(input.EventTimeRange !== undefined && { - EventTimeRange: serializeAws_restJson1EventTimeRange(input.EventTimeRange, context), - }), - ...(input.InsightId !== undefined && { InsightId: input.InsightId }), - ...(input.ResourceCollection !== undefined && { - ResourceCollection: serializeAws_restJson1ResourceCollection(input.ResourceCollection, context), - }), + ...(input.DataSource !== undefined && input.DataSource !== null && { DataSource: input.DataSource }), + ...(input.EventClass !== undefined && input.EventClass !== null && { EventClass: input.EventClass }), + ...(input.EventSource !== undefined && input.EventSource !== null && { EventSource: input.EventSource }), + ...(input.EventTimeRange !== undefined && + input.EventTimeRange !== null && { + EventTimeRange: serializeAws_restJson1EventTimeRange(input.EventTimeRange, context), + }), + ...(input.InsightId !== undefined && input.InsightId !== null && { InsightId: input.InsightId }), + ...(input.ResourceCollection !== undefined && + input.ResourceCollection !== null && { + ResourceCollection: serializeAws_restJson1ResourceCollection(input.ResourceCollection, context), + }), }; }; @@ -2439,10 +2450,11 @@ const serializeAws_restJson1ListInsightsAnyStatusFilter = ( context: __SerdeContext ): any => { return { - ...(input.StartTimeRange !== undefined && { - StartTimeRange: serializeAws_restJson1StartTimeRange(input.StartTimeRange, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.StartTimeRange !== undefined && + input.StartTimeRange !== null && { + StartTimeRange: serializeAws_restJson1StartTimeRange(input.StartTimeRange, context), + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -2451,10 +2463,9 @@ const serializeAws_restJson1ListInsightsClosedStatusFilter = ( context: __SerdeContext ): any => { return { - ...(input.EndTimeRange !== undefined && { - EndTimeRange: serializeAws_restJson1EndTimeRange(input.EndTimeRange, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.EndTimeRange !== undefined && + input.EndTimeRange !== null && { EndTimeRange: serializeAws_restJson1EndTimeRange(input.EndTimeRange, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -2463,7 +2474,7 @@ const serializeAws_restJson1ListInsightsOngoingStatusFilter = ( context: __SerdeContext ): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -2472,13 +2483,14 @@ const serializeAws_restJson1ListInsightsStatusFilter = ( context: __SerdeContext ): any => { return { - ...(input.Any !== undefined && { Any: serializeAws_restJson1ListInsightsAnyStatusFilter(input.Any, context) }), - ...(input.Closed !== undefined && { - Closed: serializeAws_restJson1ListInsightsClosedStatusFilter(input.Closed, context), - }), - ...(input.Ongoing !== undefined && { - Ongoing: serializeAws_restJson1ListInsightsOngoingStatusFilter(input.Ongoing, context), - }), + ...(input.Any !== undefined && + input.Any !== null && { Any: serializeAws_restJson1ListInsightsAnyStatusFilter(input.Any, context) }), + ...(input.Closed !== undefined && + input.Closed !== null && { Closed: serializeAws_restJson1ListInsightsClosedStatusFilter(input.Closed, context) }), + ...(input.Ongoing !== undefined && + input.Ongoing !== null && { + Ongoing: serializeAws_restJson1ListInsightsOngoingStatusFilter(input.Ongoing, context), + }), }; }; @@ -2487,7 +2499,8 @@ const serializeAws_restJson1NotificationChannelConfig = ( context: __SerdeContext ): any => { return { - ...(input.Sns !== undefined && { Sns: serializeAws_restJson1SnsChannelConfig(input.Sns, context) }), + ...(input.Sns !== undefined && + input.Sns !== null && { Sns: serializeAws_restJson1SnsChannelConfig(input.Sns, context) }), }; }; @@ -2496,44 +2509,54 @@ const serializeAws_restJson1OpsCenterIntegrationConfig = ( context: __SerdeContext ): any => { return { - ...(input.OptInStatus !== undefined && { OptInStatus: input.OptInStatus }), + ...(input.OptInStatus !== undefined && input.OptInStatus !== null && { OptInStatus: input.OptInStatus }), }; }; const serializeAws_restJson1ResourceCollection = (input: ResourceCollection, context: __SerdeContext): any => { return { - ...(input.CloudFormation !== undefined && { - CloudFormation: serializeAws_restJson1CloudFormationCollection(input.CloudFormation, context), - }), + ...(input.CloudFormation !== undefined && + input.CloudFormation !== null && { + CloudFormation: serializeAws_restJson1CloudFormationCollection(input.CloudFormation, context), + }), }; }; const serializeAws_restJson1SearchInsightsFilters = (input: SearchInsightsFilters, context: __SerdeContext): any => { return { - ...(input.ResourceCollection !== undefined && { - ResourceCollection: serializeAws_restJson1ResourceCollection(input.ResourceCollection, context), - }), - ...(input.Severities !== undefined && { - Severities: serializeAws_restJson1InsightSeverities(input.Severities, context), - }), - ...(input.Statuses !== undefined && { Statuses: serializeAws_restJson1InsightStatuses(input.Statuses, context) }), + ...(input.ResourceCollection !== undefined && + input.ResourceCollection !== null && { + ResourceCollection: serializeAws_restJson1ResourceCollection(input.ResourceCollection, context), + }), + ...(input.Severities !== undefined && + input.Severities !== null && { Severities: serializeAws_restJson1InsightSeverities(input.Severities, context) }), + ...(input.Statuses !== undefined && + input.Statuses !== null && { Statuses: serializeAws_restJson1InsightStatuses(input.Statuses, context) }), }; }; const serializeAws_restJson1SnsChannelConfig = (input: SnsChannelConfig, context: __SerdeContext): any => { return { - ...(input.TopicArn !== undefined && { TopicArn: input.TopicArn }), + ...(input.TopicArn !== undefined && input.TopicArn !== null && { TopicArn: input.TopicArn }), }; }; const serializeAws_restJson1StackNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1StartTimeRange = (input: StartTimeRange, context: __SerdeContext): any => { return { - ...(input.FromTime !== undefined && { FromTime: Math.round(input.FromTime.getTime() / 1000) }), - ...(input.ToTime !== undefined && { ToTime: Math.round(input.ToTime.getTime() / 1000) }), + ...(input.FromTime !== undefined && + input.FromTime !== null && { FromTime: Math.round(input.FromTime.getTime() / 1000) }), + ...(input.ToTime !== undefined && input.ToTime !== null && { ToTime: Math.round(input.ToTime.getTime() / 1000) }), }; }; @@ -2542,9 +2565,8 @@ const serializeAws_restJson1UpdateCloudFormationCollectionFilter = ( context: __SerdeContext ): any => { return { - ...(input.StackNames !== undefined && { - StackNames: serializeAws_restJson1UpdateStackNames(input.StackNames, context), - }), + ...(input.StackNames !== undefined && + input.StackNames !== null && { StackNames: serializeAws_restJson1UpdateStackNames(input.StackNames, context) }), }; }; @@ -2553,9 +2575,10 @@ const serializeAws_restJson1UpdateResourceCollectionFilter = ( context: __SerdeContext ): any => { return { - ...(input.CloudFormation !== undefined && { - CloudFormation: serializeAws_restJson1UpdateCloudFormationCollectionFilter(input.CloudFormation, context), - }), + ...(input.CloudFormation !== undefined && + input.CloudFormation !== null && { + CloudFormation: serializeAws_restJson1UpdateCloudFormationCollectionFilter(input.CloudFormation, context), + }), }; }; @@ -2564,14 +2587,22 @@ const serializeAws_restJson1UpdateServiceIntegrationConfig = ( context: __SerdeContext ): any => { return { - ...(input.OpsCenter !== undefined && { - OpsCenter: serializeAws_restJson1OpsCenterIntegrationConfig(input.OpsCenter, context), - }), + ...(input.OpsCenter !== undefined && + input.OpsCenter !== null && { + OpsCenter: serializeAws_restJson1OpsCenterIntegrationConfig(input.OpsCenter, context), + }), }; }; const serializeAws_restJson1UpdateStackNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AnomalySourceDetails = (output: any, context: __SerdeContext): AnomalySourceDetails => { @@ -2595,7 +2626,14 @@ const deserializeAws_restJson1AnomalyTimeRange = (output: any, context: __SerdeC }; const deserializeAws_restJson1Channels = (output: any, context: __SerdeContext): NotificationChannel[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NotificationChannel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NotificationChannel(entry, context); + }); }; const deserializeAws_restJson1CloudFormationCollection = ( @@ -2636,7 +2674,14 @@ const deserializeAws_restJson1CloudFormationHealths = ( output: any, context: __SerdeContext ): CloudFormationHealth[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CloudFormationHealth(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CloudFormationHealth(entry, context); + }); }; const deserializeAws_restJson1CloudWatchMetricsDetail = ( @@ -2660,7 +2705,14 @@ const deserializeAws_restJson1CloudWatchMetricsDetails = ( output: any, context: __SerdeContext ): CloudWatchMetricsDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CloudWatchMetricsDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CloudWatchMetricsDetail(entry, context); + }); }; const deserializeAws_restJson1CloudWatchMetricsDimension = ( @@ -2677,7 +2729,14 @@ const deserializeAws_restJson1CloudWatchMetricsDimensions = ( output: any, context: __SerdeContext ): CloudWatchMetricsDimension[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CloudWatchMetricsDimension(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CloudWatchMetricsDimension(entry, context); + }); }; const deserializeAws_restJson1Event = (output: any, context: __SerdeContext): Event => { @@ -2708,11 +2767,25 @@ const deserializeAws_restJson1EventResource = (output: any, context: __SerdeCont }; const deserializeAws_restJson1EventResources = (output: any, context: __SerdeContext): EventResource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EventResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EventResource(entry, context); + }); }; const deserializeAws_restJson1Events = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Event(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Event(entry, context); + }); }; const deserializeAws_restJson1InsightHealth = (output: any, context: __SerdeContext): InsightHealth => { @@ -2786,7 +2859,14 @@ const deserializeAws_restJson1ProactiveAnomalies = ( output: any, context: __SerdeContext ): ProactiveAnomalySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProactiveAnomalySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProactiveAnomalySummary(entry, context); + }); }; const deserializeAws_restJson1ProactiveAnomaly = (output: any, context: __SerdeContext): ProactiveAnomaly => { @@ -2881,7 +2961,14 @@ const deserializeAws_restJson1ProactiveInsight = (output: any, context: __SerdeC }; const deserializeAws_restJson1ProactiveInsights = (output: any, context: __SerdeContext): ProactiveInsightSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProactiveInsightSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProactiveInsightSummary(entry, context); + }); }; const deserializeAws_restJson1ProactiveInsightSummary = ( @@ -2909,7 +2996,14 @@ const deserializeAws_restJson1ProactiveInsightSummary = ( }; const deserializeAws_restJson1ReactiveAnomalies = (output: any, context: __SerdeContext): ReactiveAnomalySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ReactiveAnomalySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ReactiveAnomalySummary(entry, context); + }); }; const deserializeAws_restJson1ReactiveAnomaly = (output: any, context: __SerdeContext): ReactiveAnomaly => { @@ -2982,7 +3076,14 @@ const deserializeAws_restJson1ReactiveInsight = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ReactiveInsights = (output: any, context: __SerdeContext): ReactiveInsightSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ReactiveInsightSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ReactiveInsightSummary(entry, context); + }); }; const deserializeAws_restJson1ReactiveInsightSummary = ( @@ -3026,7 +3127,14 @@ const deserializeAws_restJson1RecommendationRelatedAnomalies = ( output: any, context: __SerdeContext ): RecommendationRelatedAnomaly[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecommendationRelatedAnomaly(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecommendationRelatedAnomaly(entry, context); + }); }; const deserializeAws_restJson1RecommendationRelatedAnomaly = ( @@ -3059,9 +3167,14 @@ const deserializeAws_restJson1RecommendationRelatedAnomalyResources = ( output: any, context: __SerdeContext ): RecommendationRelatedAnomalyResource[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1RecommendationRelatedAnomalyResource(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecommendationRelatedAnomalyResource(entry, context); + }); }; const deserializeAws_restJson1RecommendationRelatedAnomalySourceDetail = ( @@ -3090,9 +3203,14 @@ const deserializeAws_restJson1RecommendationRelatedCloudWatchMetricsSourceDetail output: any, context: __SerdeContext ): RecommendationRelatedCloudWatchMetricsSourceDetail[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1RecommendationRelatedCloudWatchMetricsSourceDetail(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecommendationRelatedCloudWatchMetricsSourceDetail(entry, context); + }); }; const deserializeAws_restJson1RecommendationRelatedEvent = ( @@ -3122,27 +3240,53 @@ const deserializeAws_restJson1RecommendationRelatedEventResources = ( output: any, context: __SerdeContext ): RecommendationRelatedEventResource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecommendationRelatedEventResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecommendationRelatedEventResource(entry, context); + }); }; const deserializeAws_restJson1RecommendationRelatedEvents = ( output: any, context: __SerdeContext ): RecommendationRelatedEvent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecommendationRelatedEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecommendationRelatedEvent(entry, context); + }); }; const deserializeAws_restJson1Recommendations = (output: any, context: __SerdeContext): Recommendation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Recommendation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Recommendation(entry, context); + }); }; const deserializeAws_restJson1RelatedAnomalySourceDetails = ( output: any, context: __SerdeContext ): RecommendationRelatedAnomalySourceDetail[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1RecommendationRelatedAnomalySourceDetail(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecommendationRelatedAnomalySourceDetail(entry, context); + }); }; const deserializeAws_restJson1ResourceCollection = (output: any, context: __SerdeContext): ResourceCollection => { @@ -3185,7 +3329,14 @@ const deserializeAws_restJson1SnsChannelConfig = (output: any, context: __SerdeC }; const deserializeAws_restJson1StackNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ValidationExceptionField = ( @@ -3202,7 +3353,14 @@ const deserializeAws_restJson1ValidationExceptionFields = ( output: any, context: __SerdeContext ): ValidationExceptionField[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ValidationExceptionField(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ValidationExceptionField(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -3225,6 +3383,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-direct-connect/protocols/Aws_json1_1.ts b/clients/client-direct-connect/protocols/Aws_json1_1.ts index 1b00cdc00ecd..1ed4ed4f8931 100644 --- a/clients/client-direct-connect/protocols/Aws_json1_1.ts +++ b/clients/client-direct-connect/protocols/Aws_json1_1.ts @@ -309,7 +309,7 @@ export const serializeAws_json1_1AcceptDirectConnectGatewayAssociationProposalCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.AcceptDirectConnectGatewayAssociationProposal", }; let body: any; @@ -322,7 +322,7 @@ export const serializeAws_json1_1AllocateConnectionOnInterconnectCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.AllocateConnectionOnInterconnect", }; let body: any; @@ -335,7 +335,7 @@ export const serializeAws_json1_1AllocateHostedConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.AllocateHostedConnection", }; let body: any; @@ -348,7 +348,7 @@ export const serializeAws_json1_1AllocatePrivateVirtualInterfaceCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.AllocatePrivateVirtualInterface", }; let body: any; @@ -361,7 +361,7 @@ export const serializeAws_json1_1AllocatePublicVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.AllocatePublicVirtualInterface", }; let body: any; @@ -374,7 +374,7 @@ export const serializeAws_json1_1AllocateTransitVirtualInterfaceCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.AllocateTransitVirtualInterface", }; let body: any; @@ -387,7 +387,7 @@ export const serializeAws_json1_1AssociateConnectionWithLagCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.AssociateConnectionWithLag", }; let body: any; @@ -400,7 +400,7 @@ export const serializeAws_json1_1AssociateHostedConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.AssociateHostedConnection", }; let body: any; @@ -413,7 +413,7 @@ export const serializeAws_json1_1AssociateVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.AssociateVirtualInterface", }; let body: any; @@ -426,7 +426,7 @@ export const serializeAws_json1_1ConfirmConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.ConfirmConnection", }; let body: any; @@ -439,7 +439,7 @@ export const serializeAws_json1_1ConfirmPrivateVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.ConfirmPrivateVirtualInterface", }; let body: any; @@ -452,7 +452,7 @@ export const serializeAws_json1_1ConfirmPublicVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.ConfirmPublicVirtualInterface", }; let body: any; @@ -465,7 +465,7 @@ export const serializeAws_json1_1ConfirmTransitVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.ConfirmTransitVirtualInterface", }; let body: any; @@ -478,7 +478,7 @@ export const serializeAws_json1_1CreateBGPPeerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreateBGPPeer", }; let body: any; @@ -491,7 +491,7 @@ export const serializeAws_json1_1CreateConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreateConnection", }; let body: any; @@ -504,7 +504,7 @@ export const serializeAws_json1_1CreateDirectConnectGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreateDirectConnectGateway", }; let body: any; @@ -517,7 +517,7 @@ export const serializeAws_json1_1CreateDirectConnectGatewayAssociationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreateDirectConnectGatewayAssociation", }; let body: any; @@ -530,7 +530,7 @@ export const serializeAws_json1_1CreateDirectConnectGatewayAssociationProposalCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreateDirectConnectGatewayAssociationProposal", }; let body: any; @@ -543,7 +543,7 @@ export const serializeAws_json1_1CreateInterconnectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreateInterconnect", }; let body: any; @@ -556,7 +556,7 @@ export const serializeAws_json1_1CreateLagCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreateLag", }; let body: any; @@ -569,7 +569,7 @@ export const serializeAws_json1_1CreatePrivateVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreatePrivateVirtualInterface", }; let body: any; @@ -582,7 +582,7 @@ export const serializeAws_json1_1CreatePublicVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreatePublicVirtualInterface", }; let body: any; @@ -595,7 +595,7 @@ export const serializeAws_json1_1CreateTransitVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.CreateTransitVirtualInterface", }; let body: any; @@ -608,7 +608,7 @@ export const serializeAws_json1_1DeleteBGPPeerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DeleteBGPPeer", }; let body: any; @@ -621,7 +621,7 @@ export const serializeAws_json1_1DeleteConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DeleteConnection", }; let body: any; @@ -634,7 +634,7 @@ export const serializeAws_json1_1DeleteDirectConnectGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DeleteDirectConnectGateway", }; let body: any; @@ -647,7 +647,7 @@ export const serializeAws_json1_1DeleteDirectConnectGatewayAssociationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DeleteDirectConnectGatewayAssociation", }; let body: any; @@ -660,7 +660,7 @@ export const serializeAws_json1_1DeleteDirectConnectGatewayAssociationProposalCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DeleteDirectConnectGatewayAssociationProposal", }; let body: any; @@ -673,7 +673,7 @@ export const serializeAws_json1_1DeleteInterconnectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DeleteInterconnect", }; let body: any; @@ -686,7 +686,7 @@ export const serializeAws_json1_1DeleteLagCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DeleteLag", }; let body: any; @@ -699,7 +699,7 @@ export const serializeAws_json1_1DeleteVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DeleteVirtualInterface", }; let body: any; @@ -712,7 +712,7 @@ export const serializeAws_json1_1DescribeConnectionLoaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeConnectionLoa", }; let body: any; @@ -725,7 +725,7 @@ export const serializeAws_json1_1DescribeConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeConnections", }; let body: any; @@ -738,7 +738,7 @@ export const serializeAws_json1_1DescribeConnectionsOnInterconnectCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeConnectionsOnInterconnect", }; let body: any; @@ -751,7 +751,7 @@ export const serializeAws_json1_1DescribeDirectConnectGatewayAssociationProposal context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeDirectConnectGatewayAssociationProposals", }; let body: any; @@ -764,7 +764,7 @@ export const serializeAws_json1_1DescribeDirectConnectGatewayAssociationsCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeDirectConnectGatewayAssociations", }; let body: any; @@ -777,7 +777,7 @@ export const serializeAws_json1_1DescribeDirectConnectGatewayAttachmentsCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeDirectConnectGatewayAttachments", }; let body: any; @@ -790,7 +790,7 @@ export const serializeAws_json1_1DescribeDirectConnectGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeDirectConnectGateways", }; let body: any; @@ -803,7 +803,7 @@ export const serializeAws_json1_1DescribeHostedConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeHostedConnections", }; let body: any; @@ -816,7 +816,7 @@ export const serializeAws_json1_1DescribeInterconnectLoaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeInterconnectLoa", }; let body: any; @@ -829,7 +829,7 @@ export const serializeAws_json1_1DescribeInterconnectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeInterconnects", }; let body: any; @@ -842,7 +842,7 @@ export const serializeAws_json1_1DescribeLagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeLags", }; let body: any; @@ -855,7 +855,7 @@ export const serializeAws_json1_1DescribeLoaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeLoa", }; let body: any; @@ -868,7 +868,7 @@ export const serializeAws_json1_1DescribeLocationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeLocations", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -879,7 +879,7 @@ export const serializeAws_json1_1DescribeTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeTags", }; let body: any; @@ -892,7 +892,7 @@ export const serializeAws_json1_1DescribeVirtualGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeVirtualGateways", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -903,7 +903,7 @@ export const serializeAws_json1_1DescribeVirtualInterfacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DescribeVirtualInterfaces", }; let body: any; @@ -916,7 +916,7 @@ export const serializeAws_json1_1DisassociateConnectionFromLagCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.DisassociateConnectionFromLag", }; let body: any; @@ -929,7 +929,7 @@ export const serializeAws_json1_1ListVirtualInterfaceTestHistoryCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.ListVirtualInterfaceTestHistory", }; let body: any; @@ -942,7 +942,7 @@ export const serializeAws_json1_1StartBgpFailoverTestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.StartBgpFailoverTest", }; let body: any; @@ -955,7 +955,7 @@ export const serializeAws_json1_1StopBgpFailoverTestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.StopBgpFailoverTest", }; let body: any; @@ -968,7 +968,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.TagResource", }; let body: any; @@ -981,7 +981,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.UntagResource", }; let body: any; @@ -994,7 +994,7 @@ export const serializeAws_json1_1UpdateDirectConnectGatewayAssociationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.UpdateDirectConnectGatewayAssociation", }; let body: any; @@ -1007,7 +1007,7 @@ export const serializeAws_json1_1UpdateLagCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.UpdateLag", }; let body: any; @@ -1020,7 +1020,7 @@ export const serializeAws_json1_1UpdateVirtualInterfaceAttributesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OvertureService.UpdateVirtualInterfaceAttributes", }; let body: any; @@ -1055,8 +1055,7 @@ const deserializeAws_json1_1AcceptDirectConnectGatewayAssociationProposalCommand }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1118,8 +1117,7 @@ const deserializeAws_json1_1AllocateConnectionOnInterconnectCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1181,8 +1179,7 @@ const deserializeAws_json1_1AllocateHostedConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1260,8 +1257,7 @@ const deserializeAws_json1_1AllocatePrivateVirtualInterfaceCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1339,8 +1335,7 @@ const deserializeAws_json1_1AllocatePublicVirtualInterfaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1418,8 +1413,7 @@ const deserializeAws_json1_1AllocateTransitVirtualInterfaceCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1497,8 +1491,7 @@ const deserializeAws_json1_1AssociateConnectionWithLagCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1560,8 +1553,7 @@ const deserializeAws_json1_1AssociateHostedConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1623,8 +1615,7 @@ const deserializeAws_json1_1AssociateVirtualInterfaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1686,8 +1677,7 @@ const deserializeAws_json1_1ConfirmConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1749,8 +1739,7 @@ const deserializeAws_json1_1ConfirmPrivateVirtualInterfaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1812,8 +1801,7 @@ const deserializeAws_json1_1ConfirmPublicVirtualInterfaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1875,8 +1863,7 @@ const deserializeAws_json1_1ConfirmTransitVirtualInterfaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -1938,8 +1925,7 @@ const deserializeAws_json1_1CreateBGPPeerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2001,8 +1987,7 @@ const deserializeAws_json1_1CreateConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2080,8 +2065,7 @@ const deserializeAws_json1_1CreateDirectConnectGatewayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2143,8 +2127,7 @@ const deserializeAws_json1_1CreateDirectConnectGatewayAssociationCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2206,8 +2189,7 @@ const deserializeAws_json1_1CreateDirectConnectGatewayAssociationProposalCommand }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2269,8 +2251,7 @@ const deserializeAws_json1_1CreateInterconnectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2348,8 +2329,7 @@ const deserializeAws_json1_1CreateLagCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2427,8 +2407,7 @@ const deserializeAws_json1_1CreatePrivateVirtualInterfaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2506,8 +2485,7 @@ const deserializeAws_json1_1CreatePublicVirtualInterfaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2585,8 +2563,7 @@ const deserializeAws_json1_1CreateTransitVirtualInterfaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2664,8 +2641,7 @@ const deserializeAws_json1_1DeleteBGPPeerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2727,8 +2703,7 @@ const deserializeAws_json1_1DeleteConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2790,8 +2765,7 @@ const deserializeAws_json1_1DeleteDirectConnectGatewayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2853,8 +2827,7 @@ const deserializeAws_json1_1DeleteDirectConnectGatewayAssociationCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2916,8 +2889,7 @@ const deserializeAws_json1_1DeleteDirectConnectGatewayAssociationProposalCommand }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -2979,8 +2951,7 @@ const deserializeAws_json1_1DeleteInterconnectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3042,8 +3013,7 @@ const deserializeAws_json1_1DeleteLagCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3105,8 +3075,7 @@ const deserializeAws_json1_1DeleteVirtualInterfaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3168,8 +3137,7 @@ const deserializeAws_json1_1DescribeConnectionLoaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3231,8 +3199,7 @@ const deserializeAws_json1_1DescribeConnectionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3294,8 +3261,7 @@ const deserializeAws_json1_1DescribeConnectionsOnInterconnectCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3357,8 +3323,7 @@ const deserializeAws_json1_1DescribeDirectConnectGatewayAssociationProposalsComm }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3420,8 +3385,7 @@ const deserializeAws_json1_1DescribeDirectConnectGatewayAssociationsCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3483,8 +3447,7 @@ const deserializeAws_json1_1DescribeDirectConnectGatewayAttachmentsCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3546,8 +3509,7 @@ const deserializeAws_json1_1DescribeDirectConnectGatewaysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3609,8 +3571,7 @@ const deserializeAws_json1_1DescribeHostedConnectionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3672,8 +3633,7 @@ const deserializeAws_json1_1DescribeInterconnectLoaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3735,8 +3695,7 @@ const deserializeAws_json1_1DescribeInterconnectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3798,8 +3757,7 @@ const deserializeAws_json1_1DescribeLagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3861,8 +3819,7 @@ const deserializeAws_json1_1DescribeLoaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3924,8 +3881,7 @@ const deserializeAws_json1_1DescribeLocationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -3987,8 +3943,7 @@ const deserializeAws_json1_1DescribeTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4050,8 +4005,7 @@ const deserializeAws_json1_1DescribeVirtualGatewaysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4113,8 +4067,7 @@ const deserializeAws_json1_1DescribeVirtualInterfacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4176,8 +4129,7 @@ const deserializeAws_json1_1DisassociateConnectionFromLagCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4239,8 +4191,7 @@ const deserializeAws_json1_1ListVirtualInterfaceTestHistoryCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4302,8 +4253,7 @@ const deserializeAws_json1_1StartBgpFailoverTestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4365,8 +4315,7 @@ const deserializeAws_json1_1StopBgpFailoverTestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4428,8 +4377,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4507,8 +4455,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4570,8 +4517,7 @@ const deserializeAws_json1_1UpdateDirectConnectGatewayAssociationCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4633,8 +4579,7 @@ const deserializeAws_json1_1UpdateLagCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4696,8 +4641,7 @@ const deserializeAws_json1_1UpdateVirtualInterfaceAttributesCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectConnectClientException": case "com.amazonaws.directconnect#DirectConnectClientException": @@ -4797,17 +4741,20 @@ const serializeAws_json1_1AcceptDirectConnectGatewayAssociationProposalRequest = context: __SerdeContext ): any => { return { - ...(input.associatedGatewayOwnerAccount !== undefined && { - associatedGatewayOwnerAccount: input.associatedGatewayOwnerAccount, - }), - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.overrideAllowedPrefixesToDirectConnectGateway !== undefined && { - overrideAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( - input.overrideAllowedPrefixesToDirectConnectGateway, - context - ), - }), - ...(input.proposalId !== undefined && { proposalId: input.proposalId }), + ...(input.associatedGatewayOwnerAccount !== undefined && + input.associatedGatewayOwnerAccount !== null && { + associatedGatewayOwnerAccount: input.associatedGatewayOwnerAccount, + }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.overrideAllowedPrefixesToDirectConnectGateway !== undefined && + input.overrideAllowedPrefixesToDirectConnectGateway !== null && { + overrideAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( + input.overrideAllowedPrefixesToDirectConnectGateway, + context + ), + }), + ...(input.proposalId !== undefined && input.proposalId !== null && { proposalId: input.proposalId }), }; }; @@ -4816,11 +4763,13 @@ const serializeAws_json1_1AllocateConnectionOnInterconnectRequest = ( context: __SerdeContext ): any => { return { - ...(input.bandwidth !== undefined && { bandwidth: input.bandwidth }), - ...(input.connectionName !== undefined && { connectionName: input.connectionName }), - ...(input.interconnectId !== undefined && { interconnectId: input.interconnectId }), - ...(input.ownerAccount !== undefined && { ownerAccount: input.ownerAccount }), - ...(input.vlan !== undefined && { vlan: input.vlan }), + ...(input.bandwidth !== undefined && input.bandwidth !== null && { bandwidth: input.bandwidth }), + ...(input.connectionName !== undefined && + input.connectionName !== null && { connectionName: input.connectionName }), + ...(input.interconnectId !== undefined && + input.interconnectId !== null && { interconnectId: input.interconnectId }), + ...(input.ownerAccount !== undefined && input.ownerAccount !== null && { ownerAccount: input.ownerAccount }), + ...(input.vlan !== undefined && input.vlan !== null && { vlan: input.vlan }), }; }; @@ -4829,12 +4778,13 @@ const serializeAws_json1_1AllocateHostedConnectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.bandwidth !== undefined && { bandwidth: input.bandwidth }), - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.connectionName !== undefined && { connectionName: input.connectionName }), - ...(input.ownerAccount !== undefined && { ownerAccount: input.ownerAccount }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.vlan !== undefined && { vlan: input.vlan }), + ...(input.bandwidth !== undefined && input.bandwidth !== null && { bandwidth: input.bandwidth }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.connectionName !== undefined && + input.connectionName !== null && { connectionName: input.connectionName }), + ...(input.ownerAccount !== undefined && input.ownerAccount !== null && { ownerAccount: input.ownerAccount }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.vlan !== undefined && input.vlan !== null && { vlan: input.vlan }), }; }; @@ -4843,14 +4793,15 @@ const serializeAws_json1_1AllocatePrivateVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.newPrivateVirtualInterfaceAllocation !== undefined && { - newPrivateVirtualInterfaceAllocation: serializeAws_json1_1NewPrivateVirtualInterfaceAllocation( - input.newPrivateVirtualInterfaceAllocation, - context - ), - }), - ...(input.ownerAccount !== undefined && { ownerAccount: input.ownerAccount }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.newPrivateVirtualInterfaceAllocation !== undefined && + input.newPrivateVirtualInterfaceAllocation !== null && { + newPrivateVirtualInterfaceAllocation: serializeAws_json1_1NewPrivateVirtualInterfaceAllocation( + input.newPrivateVirtualInterfaceAllocation, + context + ), + }), + ...(input.ownerAccount !== undefined && input.ownerAccount !== null && { ownerAccount: input.ownerAccount }), }; }; @@ -4859,14 +4810,15 @@ const serializeAws_json1_1AllocatePublicVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.newPublicVirtualInterfaceAllocation !== undefined && { - newPublicVirtualInterfaceAllocation: serializeAws_json1_1NewPublicVirtualInterfaceAllocation( - input.newPublicVirtualInterfaceAllocation, - context - ), - }), - ...(input.ownerAccount !== undefined && { ownerAccount: input.ownerAccount }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.newPublicVirtualInterfaceAllocation !== undefined && + input.newPublicVirtualInterfaceAllocation !== null && { + newPublicVirtualInterfaceAllocation: serializeAws_json1_1NewPublicVirtualInterfaceAllocation( + input.newPublicVirtualInterfaceAllocation, + context + ), + }), + ...(input.ownerAccount !== undefined && input.ownerAccount !== null && { ownerAccount: input.ownerAccount }), }; }; @@ -4875,14 +4827,15 @@ const serializeAws_json1_1AllocateTransitVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.newTransitVirtualInterfaceAllocation !== undefined && { - newTransitVirtualInterfaceAllocation: serializeAws_json1_1NewTransitVirtualInterfaceAllocation( - input.newTransitVirtualInterfaceAllocation, - context - ), - }), - ...(input.ownerAccount !== undefined && { ownerAccount: input.ownerAccount }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.newTransitVirtualInterfaceAllocation !== undefined && + input.newTransitVirtualInterfaceAllocation !== null && { + newTransitVirtualInterfaceAllocation: serializeAws_json1_1NewTransitVirtualInterfaceAllocation( + input.newTransitVirtualInterfaceAllocation, + context + ), + }), + ...(input.ownerAccount !== undefined && input.ownerAccount !== null && { ownerAccount: input.ownerAccount }), }; }; @@ -4891,8 +4844,8 @@ const serializeAws_json1_1AssociateConnectionWithLagRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.lagId !== undefined && { lagId: input.lagId }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.lagId !== undefined && input.lagId !== null && { lagId: input.lagId }), }; }; @@ -4901,8 +4854,9 @@ const serializeAws_json1_1AssociateHostedConnectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.parentConnectionId !== undefined && { parentConnectionId: input.parentConnectionId }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.parentConnectionId !== undefined && + input.parentConnectionId !== null && { parentConnectionId: input.parentConnectionId }), }; }; @@ -4911,13 +4865,21 @@ const serializeAws_json1_1AssociateVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; const serializeAws_json1_1BGPPeerIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConfirmConnectionRequest = ( @@ -4925,7 +4887,7 @@ const serializeAws_json1_1ConfirmConnectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), }; }; @@ -4934,9 +4896,12 @@ const serializeAws_json1_1ConfirmPrivateVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.virtualGatewayId !== undefined && { virtualGatewayId: input.virtualGatewayId }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.virtualGatewayId !== undefined && + input.virtualGatewayId !== null && { virtualGatewayId: input.virtualGatewayId }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; @@ -4945,7 +4910,8 @@ const serializeAws_json1_1ConfirmPublicVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; @@ -4954,26 +4920,31 @@ const serializeAws_json1_1ConfirmTransitVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; const serializeAws_json1_1CreateBGPPeerRequest = (input: CreateBGPPeerRequest, context: __SerdeContext): any => { return { - ...(input.newBGPPeer !== undefined && { newBGPPeer: serializeAws_json1_1NewBGPPeer(input.newBGPPeer, context) }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.newBGPPeer !== undefined && + input.newBGPPeer !== null && { newBGPPeer: serializeAws_json1_1NewBGPPeer(input.newBGPPeer, context) }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; const serializeAws_json1_1CreateConnectionRequest = (input: CreateConnectionRequest, context: __SerdeContext): any => { return { - ...(input.bandwidth !== undefined && { bandwidth: input.bandwidth }), - ...(input.connectionName !== undefined && { connectionName: input.connectionName }), - ...(input.lagId !== undefined && { lagId: input.lagId }), - ...(input.location !== undefined && { location: input.location }), - ...(input.providerName !== undefined && { providerName: input.providerName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.bandwidth !== undefined && input.bandwidth !== null && { bandwidth: input.bandwidth }), + ...(input.connectionName !== undefined && + input.connectionName !== null && { connectionName: input.connectionName }), + ...(input.lagId !== undefined && input.lagId !== null && { lagId: input.lagId }), + ...(input.location !== undefined && input.location !== null && { location: input.location }), + ...(input.providerName !== undefined && input.providerName !== null && { providerName: input.providerName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -4982,23 +4953,27 @@ const serializeAws_json1_1CreateDirectConnectGatewayAssociationProposalRequest = context: __SerdeContext ): any => { return { - ...(input.addAllowedPrefixesToDirectConnectGateway !== undefined && { - addAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( - input.addAllowedPrefixesToDirectConnectGateway, - context - ), - }), - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.directConnectGatewayOwnerAccount !== undefined && { - directConnectGatewayOwnerAccount: input.directConnectGatewayOwnerAccount, - }), - ...(input.gatewayId !== undefined && { gatewayId: input.gatewayId }), - ...(input.removeAllowedPrefixesToDirectConnectGateway !== undefined && { - removeAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( - input.removeAllowedPrefixesToDirectConnectGateway, - context - ), - }), + ...(input.addAllowedPrefixesToDirectConnectGateway !== undefined && + input.addAllowedPrefixesToDirectConnectGateway !== null && { + addAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( + input.addAllowedPrefixesToDirectConnectGateway, + context + ), + }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.directConnectGatewayOwnerAccount !== undefined && + input.directConnectGatewayOwnerAccount !== null && { + directConnectGatewayOwnerAccount: input.directConnectGatewayOwnerAccount, + }), + ...(input.gatewayId !== undefined && input.gatewayId !== null && { gatewayId: input.gatewayId }), + ...(input.removeAllowedPrefixesToDirectConnectGateway !== undefined && + input.removeAllowedPrefixesToDirectConnectGateway !== null && { + removeAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( + input.removeAllowedPrefixesToDirectConnectGateway, + context + ), + }), }; }; @@ -5007,15 +4982,18 @@ const serializeAws_json1_1CreateDirectConnectGatewayAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.addAllowedPrefixesToDirectConnectGateway !== undefined && { - addAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( - input.addAllowedPrefixesToDirectConnectGateway, - context - ), - }), - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.gatewayId !== undefined && { gatewayId: input.gatewayId }), - ...(input.virtualGatewayId !== undefined && { virtualGatewayId: input.virtualGatewayId }), + ...(input.addAllowedPrefixesToDirectConnectGateway !== undefined && + input.addAllowedPrefixesToDirectConnectGateway !== null && { + addAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( + input.addAllowedPrefixesToDirectConnectGateway, + context + ), + }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.gatewayId !== undefined && input.gatewayId !== null && { gatewayId: input.gatewayId }), + ...(input.virtualGatewayId !== undefined && + input.virtualGatewayId !== null && { virtualGatewayId: input.virtualGatewayId }), }; }; @@ -5024,8 +5002,9 @@ const serializeAws_json1_1CreateDirectConnectGatewayRequest = ( context: __SerdeContext ): any => { return { - ...(input.amazonSideAsn !== undefined && { amazonSideAsn: input.amazonSideAsn }), - ...(input.directConnectGatewayName !== undefined && { directConnectGatewayName: input.directConnectGatewayName }), + ...(input.amazonSideAsn !== undefined && input.amazonSideAsn !== null && { amazonSideAsn: input.amazonSideAsn }), + ...(input.directConnectGatewayName !== undefined && + input.directConnectGatewayName !== null && { directConnectGatewayName: input.directConnectGatewayName }), }; }; @@ -5034,27 +5013,31 @@ const serializeAws_json1_1CreateInterconnectRequest = ( context: __SerdeContext ): any => { return { - ...(input.bandwidth !== undefined && { bandwidth: input.bandwidth }), - ...(input.interconnectName !== undefined && { interconnectName: input.interconnectName }), - ...(input.lagId !== undefined && { lagId: input.lagId }), - ...(input.location !== undefined && { location: input.location }), - ...(input.providerName !== undefined && { providerName: input.providerName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.bandwidth !== undefined && input.bandwidth !== null && { bandwidth: input.bandwidth }), + ...(input.interconnectName !== undefined && + input.interconnectName !== null && { interconnectName: input.interconnectName }), + ...(input.lagId !== undefined && input.lagId !== null && { lagId: input.lagId }), + ...(input.location !== undefined && input.location !== null && { location: input.location }), + ...(input.providerName !== undefined && input.providerName !== null && { providerName: input.providerName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1CreateLagRequest = (input: CreateLagRequest, context: __SerdeContext): any => { return { - ...(input.childConnectionTags !== undefined && { - childConnectionTags: serializeAws_json1_1TagList(input.childConnectionTags, context), - }), - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.connectionsBandwidth !== undefined && { connectionsBandwidth: input.connectionsBandwidth }), - ...(input.lagName !== undefined && { lagName: input.lagName }), - ...(input.location !== undefined && { location: input.location }), - ...(input.numberOfConnections !== undefined && { numberOfConnections: input.numberOfConnections }), - ...(input.providerName !== undefined && { providerName: input.providerName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.childConnectionTags !== undefined && + input.childConnectionTags !== null && { + childConnectionTags: serializeAws_json1_1TagList(input.childConnectionTags, context), + }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.connectionsBandwidth !== undefined && + input.connectionsBandwidth !== null && { connectionsBandwidth: input.connectionsBandwidth }), + ...(input.lagName !== undefined && input.lagName !== null && { lagName: input.lagName }), + ...(input.location !== undefined && input.location !== null && { location: input.location }), + ...(input.numberOfConnections !== undefined && + input.numberOfConnections !== null && { numberOfConnections: input.numberOfConnections }), + ...(input.providerName !== undefined && input.providerName !== null && { providerName: input.providerName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -5063,13 +5046,14 @@ const serializeAws_json1_1CreatePrivateVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.newPrivateVirtualInterface !== undefined && { - newPrivateVirtualInterface: serializeAws_json1_1NewPrivateVirtualInterface( - input.newPrivateVirtualInterface, - context - ), - }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.newPrivateVirtualInterface !== undefined && + input.newPrivateVirtualInterface !== null && { + newPrivateVirtualInterface: serializeAws_json1_1NewPrivateVirtualInterface( + input.newPrivateVirtualInterface, + context + ), + }), }; }; @@ -5078,13 +5062,14 @@ const serializeAws_json1_1CreatePublicVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.newPublicVirtualInterface !== undefined && { - newPublicVirtualInterface: serializeAws_json1_1NewPublicVirtualInterface( - input.newPublicVirtualInterface, - context - ), - }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.newPublicVirtualInterface !== undefined && + input.newPublicVirtualInterface !== null && { + newPublicVirtualInterface: serializeAws_json1_1NewPublicVirtualInterface( + input.newPublicVirtualInterface, + context + ), + }), }; }; @@ -5093,28 +5078,31 @@ const serializeAws_json1_1CreateTransitVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.newTransitVirtualInterface !== undefined && { - newTransitVirtualInterface: serializeAws_json1_1NewTransitVirtualInterface( - input.newTransitVirtualInterface, - context - ), - }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.newTransitVirtualInterface !== undefined && + input.newTransitVirtualInterface !== null && { + newTransitVirtualInterface: serializeAws_json1_1NewTransitVirtualInterface( + input.newTransitVirtualInterface, + context + ), + }), }; }; const serializeAws_json1_1DeleteBGPPeerRequest = (input: DeleteBGPPeerRequest, context: __SerdeContext): any => { return { - ...(input.asn !== undefined && { asn: input.asn }), - ...(input.bgpPeerId !== undefined && { bgpPeerId: input.bgpPeerId }), - ...(input.customerAddress !== undefined && { customerAddress: input.customerAddress }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.asn !== undefined && input.asn !== null && { asn: input.asn }), + ...(input.bgpPeerId !== undefined && input.bgpPeerId !== null && { bgpPeerId: input.bgpPeerId }), + ...(input.customerAddress !== undefined && + input.customerAddress !== null && { customerAddress: input.customerAddress }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; const serializeAws_json1_1DeleteConnectionRequest = (input: DeleteConnectionRequest, context: __SerdeContext): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), }; }; @@ -5123,7 +5111,7 @@ const serializeAws_json1_1DeleteDirectConnectGatewayAssociationProposalRequest = context: __SerdeContext ): any => { return { - ...(input.proposalId !== undefined && { proposalId: input.proposalId }), + ...(input.proposalId !== undefined && input.proposalId !== null && { proposalId: input.proposalId }), }; }; @@ -5132,9 +5120,11 @@ const serializeAws_json1_1DeleteDirectConnectGatewayAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.associationId !== undefined && { associationId: input.associationId }), - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.virtualGatewayId !== undefined && { virtualGatewayId: input.virtualGatewayId }), + ...(input.associationId !== undefined && input.associationId !== null && { associationId: input.associationId }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.virtualGatewayId !== undefined && + input.virtualGatewayId !== null && { virtualGatewayId: input.virtualGatewayId }), }; }; @@ -5143,7 +5133,8 @@ const serializeAws_json1_1DeleteDirectConnectGatewayRequest = ( context: __SerdeContext ): any => { return { - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), }; }; @@ -5152,13 +5143,14 @@ const serializeAws_json1_1DeleteInterconnectRequest = ( context: __SerdeContext ): any => { return { - ...(input.interconnectId !== undefined && { interconnectId: input.interconnectId }), + ...(input.interconnectId !== undefined && + input.interconnectId !== null && { interconnectId: input.interconnectId }), }; }; const serializeAws_json1_1DeleteLagRequest = (input: DeleteLagRequest, context: __SerdeContext): any => { return { - ...(input.lagId !== undefined && { lagId: input.lagId }), + ...(input.lagId !== undefined && input.lagId !== null && { lagId: input.lagId }), }; }; @@ -5167,7 +5159,8 @@ const serializeAws_json1_1DeleteVirtualInterfaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; @@ -5176,9 +5169,10 @@ const serializeAws_json1_1DescribeConnectionLoaRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.loaContentType !== undefined && { loaContentType: input.loaContentType }), - ...(input.providerName !== undefined && { providerName: input.providerName }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.loaContentType !== undefined && + input.loaContentType !== null && { loaContentType: input.loaContentType }), + ...(input.providerName !== undefined && input.providerName !== null && { providerName: input.providerName }), }; }; @@ -5187,7 +5181,8 @@ const serializeAws_json1_1DescribeConnectionsOnInterconnectRequest = ( context: __SerdeContext ): any => { return { - ...(input.interconnectId !== undefined && { interconnectId: input.interconnectId }), + ...(input.interconnectId !== undefined && + input.interconnectId !== null && { interconnectId: input.interconnectId }), }; }; @@ -5196,7 +5191,7 @@ const serializeAws_json1_1DescribeConnectionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), }; }; @@ -5205,11 +5200,13 @@ const serializeAws_json1_1DescribeDirectConnectGatewayAssociationProposalsReques context: __SerdeContext ): any => { return { - ...(input.associatedGatewayId !== undefined && { associatedGatewayId: input.associatedGatewayId }), - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.proposalId !== undefined && { proposalId: input.proposalId }), + ...(input.associatedGatewayId !== undefined && + input.associatedGatewayId !== null && { associatedGatewayId: input.associatedGatewayId }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.proposalId !== undefined && input.proposalId !== null && { proposalId: input.proposalId }), }; }; @@ -5218,12 +5215,15 @@ const serializeAws_json1_1DescribeDirectConnectGatewayAssociationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.associatedGatewayId !== undefined && { associatedGatewayId: input.associatedGatewayId }), - ...(input.associationId !== undefined && { associationId: input.associationId }), - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.virtualGatewayId !== undefined && { virtualGatewayId: input.virtualGatewayId }), + ...(input.associatedGatewayId !== undefined && + input.associatedGatewayId !== null && { associatedGatewayId: input.associatedGatewayId }), + ...(input.associationId !== undefined && input.associationId !== null && { associationId: input.associationId }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.virtualGatewayId !== undefined && + input.virtualGatewayId !== null && { virtualGatewayId: input.virtualGatewayId }), }; }; @@ -5232,10 +5232,12 @@ const serializeAws_json1_1DescribeDirectConnectGatewayAttachmentsRequest = ( context: __SerdeContext ): any => { return { - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; @@ -5244,9 +5246,10 @@ const serializeAws_json1_1DescribeDirectConnectGatewaysRequest = ( context: __SerdeContext ): any => { return { - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -5255,7 +5258,7 @@ const serializeAws_json1_1DescribeHostedConnectionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), }; }; @@ -5264,9 +5267,11 @@ const serializeAws_json1_1DescribeInterconnectLoaRequest = ( context: __SerdeContext ): any => { return { - ...(input.interconnectId !== undefined && { interconnectId: input.interconnectId }), - ...(input.loaContentType !== undefined && { loaContentType: input.loaContentType }), - ...(input.providerName !== undefined && { providerName: input.providerName }), + ...(input.interconnectId !== undefined && + input.interconnectId !== null && { interconnectId: input.interconnectId }), + ...(input.loaContentType !== undefined && + input.loaContentType !== null && { loaContentType: input.loaContentType }), + ...(input.providerName !== undefined && input.providerName !== null && { providerName: input.providerName }), }; }; @@ -5275,29 +5280,32 @@ const serializeAws_json1_1DescribeInterconnectsRequest = ( context: __SerdeContext ): any => { return { - ...(input.interconnectId !== undefined && { interconnectId: input.interconnectId }), + ...(input.interconnectId !== undefined && + input.interconnectId !== null && { interconnectId: input.interconnectId }), }; }; const serializeAws_json1_1DescribeLagsRequest = (input: DescribeLagsRequest, context: __SerdeContext): any => { return { - ...(input.lagId !== undefined && { lagId: input.lagId }), + ...(input.lagId !== undefined && input.lagId !== null && { lagId: input.lagId }), }; }; const serializeAws_json1_1DescribeLoaRequest = (input: DescribeLoaRequest, context: __SerdeContext): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.loaContentType !== undefined && { loaContentType: input.loaContentType }), - ...(input.providerName !== undefined && { providerName: input.providerName }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.loaContentType !== undefined && + input.loaContentType !== null && { loaContentType: input.loaContentType }), + ...(input.providerName !== undefined && input.providerName !== null && { providerName: input.providerName }), }; }; const serializeAws_json1_1DescribeTagsRequest = (input: DescribeTagsRequest, context: __SerdeContext): any => { return { - ...(input.resourceArns !== undefined && { - resourceArns: serializeAws_json1_1ResourceArnList(input.resourceArns, context), - }), + ...(input.resourceArns !== undefined && + input.resourceArns !== null && { + resourceArns: serializeAws_json1_1ResourceArnList(input.resourceArns, context), + }), }; }; @@ -5306,8 +5314,9 @@ const serializeAws_json1_1DescribeVirtualInterfacesRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; @@ -5316,8 +5325,8 @@ const serializeAws_json1_1DisassociateConnectionFromLagRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectionId !== undefined && { connectionId: input.connectionId }), - ...(input.lagId !== undefined && { lagId: input.lagId }), + ...(input.connectionId !== undefined && input.connectionId !== null && { connectionId: input.connectionId }), + ...(input.lagId !== undefined && input.lagId !== null && { lagId: input.lagId }), }; }; @@ -5326,22 +5335,25 @@ const serializeAws_json1_1ListVirtualInterfaceTestHistoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.bgpPeers !== undefined && { bgpPeers: serializeAws_json1_1BGPPeerIdList(input.bgpPeers, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.status !== undefined && { status: input.status }), - ...(input.testId !== undefined && { testId: input.testId }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.bgpPeers !== undefined && + input.bgpPeers !== null && { bgpPeers: serializeAws_json1_1BGPPeerIdList(input.bgpPeers, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.testId !== undefined && input.testId !== null && { testId: input.testId }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; const serializeAws_json1_1NewBGPPeer = (input: NewBGPPeer, context: __SerdeContext): any => { return { - ...(input.addressFamily !== undefined && { addressFamily: input.addressFamily }), - ...(input.amazonAddress !== undefined && { amazonAddress: input.amazonAddress }), - ...(input.asn !== undefined && { asn: input.asn }), - ...(input.authKey !== undefined && { authKey: input.authKey }), - ...(input.customerAddress !== undefined && { customerAddress: input.customerAddress }), + ...(input.addressFamily !== undefined && input.addressFamily !== null && { addressFamily: input.addressFamily }), + ...(input.amazonAddress !== undefined && input.amazonAddress !== null && { amazonAddress: input.amazonAddress }), + ...(input.asn !== undefined && input.asn !== null && { asn: input.asn }), + ...(input.authKey !== undefined && input.authKey !== null && { authKey: input.authKey }), + ...(input.customerAddress !== undefined && + input.customerAddress !== null && { customerAddress: input.customerAddress }), }; }; @@ -5350,17 +5362,21 @@ const serializeAws_json1_1NewPrivateVirtualInterface = ( context: __SerdeContext ): any => { return { - ...(input.addressFamily !== undefined && { addressFamily: input.addressFamily }), - ...(input.amazonAddress !== undefined && { amazonAddress: input.amazonAddress }), - ...(input.asn !== undefined && { asn: input.asn }), - ...(input.authKey !== undefined && { authKey: input.authKey }), - ...(input.customerAddress !== undefined && { customerAddress: input.customerAddress }), - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.mtu !== undefined && { mtu: input.mtu }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.virtualGatewayId !== undefined && { virtualGatewayId: input.virtualGatewayId }), - ...(input.virtualInterfaceName !== undefined && { virtualInterfaceName: input.virtualInterfaceName }), - ...(input.vlan !== undefined && { vlan: input.vlan }), + ...(input.addressFamily !== undefined && input.addressFamily !== null && { addressFamily: input.addressFamily }), + ...(input.amazonAddress !== undefined && input.amazonAddress !== null && { amazonAddress: input.amazonAddress }), + ...(input.asn !== undefined && input.asn !== null && { asn: input.asn }), + ...(input.authKey !== undefined && input.authKey !== null && { authKey: input.authKey }), + ...(input.customerAddress !== undefined && + input.customerAddress !== null && { customerAddress: input.customerAddress }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.mtu !== undefined && input.mtu !== null && { mtu: input.mtu }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.virtualGatewayId !== undefined && + input.virtualGatewayId !== null && { virtualGatewayId: input.virtualGatewayId }), + ...(input.virtualInterfaceName !== undefined && + input.virtualInterfaceName !== null && { virtualInterfaceName: input.virtualInterfaceName }), + ...(input.vlan !== undefined && input.vlan !== null && { vlan: input.vlan }), }; }; @@ -5369,15 +5385,17 @@ const serializeAws_json1_1NewPrivateVirtualInterfaceAllocation = ( context: __SerdeContext ): any => { return { - ...(input.addressFamily !== undefined && { addressFamily: input.addressFamily }), - ...(input.amazonAddress !== undefined && { amazonAddress: input.amazonAddress }), - ...(input.asn !== undefined && { asn: input.asn }), - ...(input.authKey !== undefined && { authKey: input.authKey }), - ...(input.customerAddress !== undefined && { customerAddress: input.customerAddress }), - ...(input.mtu !== undefined && { mtu: input.mtu }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.virtualInterfaceName !== undefined && { virtualInterfaceName: input.virtualInterfaceName }), - ...(input.vlan !== undefined && { vlan: input.vlan }), + ...(input.addressFamily !== undefined && input.addressFamily !== null && { addressFamily: input.addressFamily }), + ...(input.amazonAddress !== undefined && input.amazonAddress !== null && { amazonAddress: input.amazonAddress }), + ...(input.asn !== undefined && input.asn !== null && { asn: input.asn }), + ...(input.authKey !== undefined && input.authKey !== null && { authKey: input.authKey }), + ...(input.customerAddress !== undefined && + input.customerAddress !== null && { customerAddress: input.customerAddress }), + ...(input.mtu !== undefined && input.mtu !== null && { mtu: input.mtu }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.virtualInterfaceName !== undefined && + input.virtualInterfaceName !== null && { virtualInterfaceName: input.virtualInterfaceName }), + ...(input.vlan !== undefined && input.vlan !== null && { vlan: input.vlan }), }; }; @@ -5386,17 +5404,20 @@ const serializeAws_json1_1NewPublicVirtualInterface = ( context: __SerdeContext ): any => { return { - ...(input.addressFamily !== undefined && { addressFamily: input.addressFamily }), - ...(input.amazonAddress !== undefined && { amazonAddress: input.amazonAddress }), - ...(input.asn !== undefined && { asn: input.asn }), - ...(input.authKey !== undefined && { authKey: input.authKey }), - ...(input.customerAddress !== undefined && { customerAddress: input.customerAddress }), - ...(input.routeFilterPrefixes !== undefined && { - routeFilterPrefixes: serializeAws_json1_1RouteFilterPrefixList(input.routeFilterPrefixes, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.virtualInterfaceName !== undefined && { virtualInterfaceName: input.virtualInterfaceName }), - ...(input.vlan !== undefined && { vlan: input.vlan }), + ...(input.addressFamily !== undefined && input.addressFamily !== null && { addressFamily: input.addressFamily }), + ...(input.amazonAddress !== undefined && input.amazonAddress !== null && { amazonAddress: input.amazonAddress }), + ...(input.asn !== undefined && input.asn !== null && { asn: input.asn }), + ...(input.authKey !== undefined && input.authKey !== null && { authKey: input.authKey }), + ...(input.customerAddress !== undefined && + input.customerAddress !== null && { customerAddress: input.customerAddress }), + ...(input.routeFilterPrefixes !== undefined && + input.routeFilterPrefixes !== null && { + routeFilterPrefixes: serializeAws_json1_1RouteFilterPrefixList(input.routeFilterPrefixes, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.virtualInterfaceName !== undefined && + input.virtualInterfaceName !== null && { virtualInterfaceName: input.virtualInterfaceName }), + ...(input.vlan !== undefined && input.vlan !== null && { vlan: input.vlan }), }; }; @@ -5405,17 +5426,20 @@ const serializeAws_json1_1NewPublicVirtualInterfaceAllocation = ( context: __SerdeContext ): any => { return { - ...(input.addressFamily !== undefined && { addressFamily: input.addressFamily }), - ...(input.amazonAddress !== undefined && { amazonAddress: input.amazonAddress }), - ...(input.asn !== undefined && { asn: input.asn }), - ...(input.authKey !== undefined && { authKey: input.authKey }), - ...(input.customerAddress !== undefined && { customerAddress: input.customerAddress }), - ...(input.routeFilterPrefixes !== undefined && { - routeFilterPrefixes: serializeAws_json1_1RouteFilterPrefixList(input.routeFilterPrefixes, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.virtualInterfaceName !== undefined && { virtualInterfaceName: input.virtualInterfaceName }), - ...(input.vlan !== undefined && { vlan: input.vlan }), + ...(input.addressFamily !== undefined && input.addressFamily !== null && { addressFamily: input.addressFamily }), + ...(input.amazonAddress !== undefined && input.amazonAddress !== null && { amazonAddress: input.amazonAddress }), + ...(input.asn !== undefined && input.asn !== null && { asn: input.asn }), + ...(input.authKey !== undefined && input.authKey !== null && { authKey: input.authKey }), + ...(input.customerAddress !== undefined && + input.customerAddress !== null && { customerAddress: input.customerAddress }), + ...(input.routeFilterPrefixes !== undefined && + input.routeFilterPrefixes !== null && { + routeFilterPrefixes: serializeAws_json1_1RouteFilterPrefixList(input.routeFilterPrefixes, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.virtualInterfaceName !== undefined && + input.virtualInterfaceName !== null && { virtualInterfaceName: input.virtualInterfaceName }), + ...(input.vlan !== undefined && input.vlan !== null && { vlan: input.vlan }), }; }; @@ -5424,16 +5448,19 @@ const serializeAws_json1_1NewTransitVirtualInterface = ( context: __SerdeContext ): any => { return { - ...(input.addressFamily !== undefined && { addressFamily: input.addressFamily }), - ...(input.amazonAddress !== undefined && { amazonAddress: input.amazonAddress }), - ...(input.asn !== undefined && { asn: input.asn }), - ...(input.authKey !== undefined && { authKey: input.authKey }), - ...(input.customerAddress !== undefined && { customerAddress: input.customerAddress }), - ...(input.directConnectGatewayId !== undefined && { directConnectGatewayId: input.directConnectGatewayId }), - ...(input.mtu !== undefined && { mtu: input.mtu }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.virtualInterfaceName !== undefined && { virtualInterfaceName: input.virtualInterfaceName }), - ...(input.vlan !== undefined && { vlan: input.vlan }), + ...(input.addressFamily !== undefined && input.addressFamily !== null && { addressFamily: input.addressFamily }), + ...(input.amazonAddress !== undefined && input.amazonAddress !== null && { amazonAddress: input.amazonAddress }), + ...(input.asn !== undefined && input.asn !== null && { asn: input.asn }), + ...(input.authKey !== undefined && input.authKey !== null && { authKey: input.authKey }), + ...(input.customerAddress !== undefined && + input.customerAddress !== null && { customerAddress: input.customerAddress }), + ...(input.directConnectGatewayId !== undefined && + input.directConnectGatewayId !== null && { directConnectGatewayId: input.directConnectGatewayId }), + ...(input.mtu !== undefined && input.mtu !== null && { mtu: input.mtu }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.virtualInterfaceName !== undefined && + input.virtualInterfaceName !== null && { virtualInterfaceName: input.virtualInterfaceName }), + ...(input.vlan !== undefined && input.vlan !== null && { vlan: input.vlan }), }; }; @@ -5442,30 +5469,46 @@ const serializeAws_json1_1NewTransitVirtualInterfaceAllocation = ( context: __SerdeContext ): any => { return { - ...(input.addressFamily !== undefined && { addressFamily: input.addressFamily }), - ...(input.amazonAddress !== undefined && { amazonAddress: input.amazonAddress }), - ...(input.asn !== undefined && { asn: input.asn }), - ...(input.authKey !== undefined && { authKey: input.authKey }), - ...(input.customerAddress !== undefined && { customerAddress: input.customerAddress }), - ...(input.mtu !== undefined && { mtu: input.mtu }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.virtualInterfaceName !== undefined && { virtualInterfaceName: input.virtualInterfaceName }), - ...(input.vlan !== undefined && { vlan: input.vlan }), + ...(input.addressFamily !== undefined && input.addressFamily !== null && { addressFamily: input.addressFamily }), + ...(input.amazonAddress !== undefined && input.amazonAddress !== null && { amazonAddress: input.amazonAddress }), + ...(input.asn !== undefined && input.asn !== null && { asn: input.asn }), + ...(input.authKey !== undefined && input.authKey !== null && { authKey: input.authKey }), + ...(input.customerAddress !== undefined && + input.customerAddress !== null && { customerAddress: input.customerAddress }), + ...(input.mtu !== undefined && input.mtu !== null && { mtu: input.mtu }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.virtualInterfaceName !== undefined && + input.virtualInterfaceName !== null && { virtualInterfaceName: input.virtualInterfaceName }), + ...(input.vlan !== undefined && input.vlan !== null && { vlan: input.vlan }), }; }; const serializeAws_json1_1ResourceArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RouteFilterPrefix = (input: RouteFilterPrefix, context: __SerdeContext): any => { return { - ...(input.cidr !== undefined && { cidr: input.cidr }), + ...(input.cidr !== undefined && input.cidr !== null && { cidr: input.cidr }), }; }; const serializeAws_json1_1RouteFilterPrefixList = (input: RouteFilterPrefix[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RouteFilterPrefix(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RouteFilterPrefix(entry, context); + }); }; const serializeAws_json1_1StartBgpFailoverTestRequest = ( @@ -5473,9 +5516,12 @@ const serializeAws_json1_1StartBgpFailoverTestRequest = ( context: __SerdeContext ): any => { return { - ...(input.bgpPeers !== undefined && { bgpPeers: serializeAws_json1_1BGPPeerIdList(input.bgpPeers, context) }), - ...(input.testDurationInMinutes !== undefined && { testDurationInMinutes: input.testDurationInMinutes }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.bgpPeers !== undefined && + input.bgpPeers !== null && { bgpPeers: serializeAws_json1_1BGPPeerIdList(input.bgpPeers, context) }), + ...(input.testDurationInMinutes !== undefined && + input.testDurationInMinutes !== null && { testDurationInMinutes: input.testDurationInMinutes }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; @@ -5484,36 +5530,52 @@ const serializeAws_json1_1StopBgpFailoverTestRequest = ( context: __SerdeContext ): any => { return { - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), }; }; @@ -5522,27 +5584,29 @@ const serializeAws_json1_1UpdateDirectConnectGatewayAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.addAllowedPrefixesToDirectConnectGateway !== undefined && { - addAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( - input.addAllowedPrefixesToDirectConnectGateway, - context - ), - }), - ...(input.associationId !== undefined && { associationId: input.associationId }), - ...(input.removeAllowedPrefixesToDirectConnectGateway !== undefined && { - removeAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( - input.removeAllowedPrefixesToDirectConnectGateway, - context - ), - }), + ...(input.addAllowedPrefixesToDirectConnectGateway !== undefined && + input.addAllowedPrefixesToDirectConnectGateway !== null && { + addAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( + input.addAllowedPrefixesToDirectConnectGateway, + context + ), + }), + ...(input.associationId !== undefined && input.associationId !== null && { associationId: input.associationId }), + ...(input.removeAllowedPrefixesToDirectConnectGateway !== undefined && + input.removeAllowedPrefixesToDirectConnectGateway !== null && { + removeAllowedPrefixesToDirectConnectGateway: serializeAws_json1_1RouteFilterPrefixList( + input.removeAllowedPrefixesToDirectConnectGateway, + context + ), + }), }; }; const serializeAws_json1_1UpdateLagRequest = (input: UpdateLagRequest, context: __SerdeContext): any => { return { - ...(input.lagId !== undefined && { lagId: input.lagId }), - ...(input.lagName !== undefined && { lagName: input.lagName }), - ...(input.minimumLinks !== undefined && { minimumLinks: input.minimumLinks }), + ...(input.lagId !== undefined && input.lagId !== null && { lagId: input.lagId }), + ...(input.lagName !== undefined && input.lagName !== null && { lagName: input.lagName }), + ...(input.minimumLinks !== undefined && input.minimumLinks !== null && { minimumLinks: input.minimumLinks }), }; }; @@ -5551,8 +5615,9 @@ const serializeAws_json1_1UpdateVirtualInterfaceAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.mtu !== undefined && { mtu: input.mtu }), - ...(input.virtualInterfaceId !== undefined && { virtualInterfaceId: input.virtualInterfaceId }), + ...(input.mtu !== undefined && input.mtu !== null && { mtu: input.mtu }), + ...(input.virtualInterfaceId !== undefined && + input.virtualInterfaceId !== null && { virtualInterfaceId: input.virtualInterfaceId }), }; }; @@ -5590,7 +5655,14 @@ const deserializeAws_json1_1AssociatedGateway = (output: any, context: __SerdeCo }; const deserializeAws_json1_1AvailablePortSpeeds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1BGPPeer = (output: any, context: __SerdeContext): BGPPeer => { @@ -5611,11 +5683,25 @@ const deserializeAws_json1_1BGPPeer = (output: any, context: __SerdeContext): BG }; const deserializeAws_json1_1BGPPeerIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1BGPPeerList = (output: any, context: __SerdeContext): BGPPeer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BGPPeer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BGPPeer(entry, context); + }); }; const deserializeAws_json1_1ConfirmConnectionResponse = ( @@ -5701,7 +5787,14 @@ const deserializeAws_json1_1Connection = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ConnectionList = (output: any, context: __SerdeContext): Connection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Connection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Connection(entry, context); + }); }; const deserializeAws_json1_1Connections = (output: any, context: __SerdeContext): Connections => { @@ -6006,7 +6099,14 @@ const deserializeAws_json1_1DirectConnectGatewayAssociationList = ( output: any, context: __SerdeContext ): DirectConnectGatewayAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DirectConnectGatewayAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DirectConnectGatewayAssociation(entry, context); + }); }; const deserializeAws_json1_1DirectConnectGatewayAssociationProposal = ( @@ -6046,9 +6146,14 @@ const deserializeAws_json1_1DirectConnectGatewayAssociationProposalList = ( output: any, context: __SerdeContext ): DirectConnectGatewayAssociationProposal[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1DirectConnectGatewayAssociationProposal(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DirectConnectGatewayAssociationProposal(entry, context); + }); }; const deserializeAws_json1_1DirectConnectGatewayAttachment = ( @@ -6085,14 +6190,28 @@ const deserializeAws_json1_1DirectConnectGatewayAttachmentList = ( output: any, context: __SerdeContext ): DirectConnectGatewayAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DirectConnectGatewayAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DirectConnectGatewayAttachment(entry, context); + }); }; const deserializeAws_json1_1DirectConnectGatewayList = ( output: any, context: __SerdeContext ): DirectConnectGateway[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DirectConnectGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DirectConnectGateway(entry, context); + }); }; const deserializeAws_json1_1DirectConnectServerException = ( @@ -6150,7 +6269,14 @@ const deserializeAws_json1_1Interconnect = (output: any, context: __SerdeContext }; const deserializeAws_json1_1InterconnectList = (output: any, context: __SerdeContext): Interconnect[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Interconnect(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Interconnect(entry, context); + }); }; const deserializeAws_json1_1Interconnects = (output: any, context: __SerdeContext): Interconnects => { @@ -6206,7 +6332,14 @@ const deserializeAws_json1_1Lag = (output: any, context: __SerdeContext): Lag => }; const deserializeAws_json1_1LagList = (output: any, context: __SerdeContext): Lag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Lag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Lag(entry, context); + }); }; const deserializeAws_json1_1Lags = (output: any, context: __SerdeContext): Lags => { @@ -6259,7 +6392,14 @@ const deserializeAws_json1_1Location = (output: any, context: __SerdeContext): L }; const deserializeAws_json1_1LocationList = (output: any, context: __SerdeContext): Location[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Location(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Location(entry, context); + }); }; const deserializeAws_json1_1Locations = (output: any, context: __SerdeContext): Locations => { @@ -6272,7 +6412,14 @@ const deserializeAws_json1_1Locations = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ProviderList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceTag = (output: any, context: __SerdeContext): ResourceTag => { @@ -6286,7 +6433,14 @@ const deserializeAws_json1_1ResourceTag = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ResourceTagList = (output: any, context: __SerdeContext): ResourceTag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceTag(entry, context); + }); }; const deserializeAws_json1_1RouteFilterPrefix = (output: any, context: __SerdeContext): RouteFilterPrefix => { @@ -6296,7 +6450,14 @@ const deserializeAws_json1_1RouteFilterPrefix = (output: any, context: __SerdeCo }; const deserializeAws_json1_1RouteFilterPrefixList = (output: any, context: __SerdeContext): RouteFilterPrefix[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RouteFilterPrefix(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RouteFilterPrefix(entry, context); + }); }; const deserializeAws_json1_1StartBgpFailoverTestResponse = ( @@ -6331,7 +6492,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -6372,7 +6540,14 @@ const deserializeAws_json1_1VirtualGateway = (output: any, context: __SerdeConte }; const deserializeAws_json1_1VirtualGatewayList = (output: any, context: __SerdeContext): VirtualGateway[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VirtualGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VirtualGateway(entry, context); + }); }; const deserializeAws_json1_1VirtualGateways = (output: any, context: __SerdeContext): VirtualGateways => { @@ -6449,7 +6624,14 @@ const deserializeAws_json1_1VirtualInterface = (output: any, context: __SerdeCon }; const deserializeAws_json1_1VirtualInterfaceList = (output: any, context: __SerdeContext): VirtualInterface[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VirtualInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VirtualInterface(entry, context); + }); }; const deserializeAws_json1_1VirtualInterfaces = (output: any, context: __SerdeContext): VirtualInterfaces => { @@ -6494,7 +6676,14 @@ const deserializeAws_json1_1VirtualInterfaceTestHistoryList = ( output: any, context: __SerdeContext ): VirtualInterfaceTestHistory[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VirtualInterfaceTestHistory(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VirtualInterfaceTestHistory(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -6547,3 +6736,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-directory-service/protocols/Aws_json1_1.ts b/clients/client-directory-service/protocols/Aws_json1_1.ts index e3f544e00bfc..2c7b136282ff 100644 --- a/clients/client-directory-service/protocols/Aws_json1_1.ts +++ b/clients/client-directory-service/protocols/Aws_json1_1.ts @@ -346,7 +346,7 @@ export const serializeAws_json1_1AcceptSharedDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.AcceptSharedDirectory", }; let body: any; @@ -359,7 +359,7 @@ export const serializeAws_json1_1AddIpRoutesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.AddIpRoutes", }; let body: any; @@ -372,7 +372,7 @@ export const serializeAws_json1_1AddRegionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.AddRegion", }; let body: any; @@ -385,7 +385,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.AddTagsToResource", }; let body: any; @@ -398,7 +398,7 @@ export const serializeAws_json1_1CancelSchemaExtensionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.CancelSchemaExtension", }; let body: any; @@ -411,7 +411,7 @@ export const serializeAws_json1_1ConnectDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.ConnectDirectory", }; let body: any; @@ -424,7 +424,7 @@ export const serializeAws_json1_1CreateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.CreateAlias", }; let body: any; @@ -437,7 +437,7 @@ export const serializeAws_json1_1CreateComputerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.CreateComputer", }; let body: any; @@ -450,7 +450,7 @@ export const serializeAws_json1_1CreateConditionalForwarderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.CreateConditionalForwarder", }; let body: any; @@ -463,7 +463,7 @@ export const serializeAws_json1_1CreateDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.CreateDirectory", }; let body: any; @@ -476,7 +476,7 @@ export const serializeAws_json1_1CreateLogSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.CreateLogSubscription", }; let body: any; @@ -489,7 +489,7 @@ export const serializeAws_json1_1CreateMicrosoftADCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.CreateMicrosoftAD", }; let body: any; @@ -502,7 +502,7 @@ export const serializeAws_json1_1CreateSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.CreateSnapshot", }; let body: any; @@ -515,7 +515,7 @@ export const serializeAws_json1_1CreateTrustCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.CreateTrust", }; let body: any; @@ -528,7 +528,7 @@ export const serializeAws_json1_1DeleteConditionalForwarderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DeleteConditionalForwarder", }; let body: any; @@ -541,7 +541,7 @@ export const serializeAws_json1_1DeleteDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DeleteDirectory", }; let body: any; @@ -554,7 +554,7 @@ export const serializeAws_json1_1DeleteLogSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DeleteLogSubscription", }; let body: any; @@ -567,7 +567,7 @@ export const serializeAws_json1_1DeleteSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DeleteSnapshot", }; let body: any; @@ -580,7 +580,7 @@ export const serializeAws_json1_1DeleteTrustCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DeleteTrust", }; let body: any; @@ -593,7 +593,7 @@ export const serializeAws_json1_1DeregisterCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DeregisterCertificate", }; let body: any; @@ -606,7 +606,7 @@ export const serializeAws_json1_1DeregisterEventTopicCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DeregisterEventTopic", }; let body: any; @@ -619,7 +619,7 @@ export const serializeAws_json1_1DescribeCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeCertificate", }; let body: any; @@ -632,7 +632,7 @@ export const serializeAws_json1_1DescribeConditionalForwardersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeConditionalForwarders", }; let body: any; @@ -645,7 +645,7 @@ export const serializeAws_json1_1DescribeDirectoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeDirectories", }; let body: any; @@ -658,7 +658,7 @@ export const serializeAws_json1_1DescribeDomainControllersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeDomainControllers", }; let body: any; @@ -671,7 +671,7 @@ export const serializeAws_json1_1DescribeEventTopicsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeEventTopics", }; let body: any; @@ -684,7 +684,7 @@ export const serializeAws_json1_1DescribeLDAPSSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeLDAPSSettings", }; let body: any; @@ -697,7 +697,7 @@ export const serializeAws_json1_1DescribeRegionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeRegions", }; let body: any; @@ -710,7 +710,7 @@ export const serializeAws_json1_1DescribeSharedDirectoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeSharedDirectories", }; let body: any; @@ -723,7 +723,7 @@ export const serializeAws_json1_1DescribeSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeSnapshots", }; let body: any; @@ -736,7 +736,7 @@ export const serializeAws_json1_1DescribeTrustsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DescribeTrusts", }; let body: any; @@ -749,7 +749,7 @@ export const serializeAws_json1_1DisableClientAuthenticationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DisableClientAuthentication", }; let body: any; @@ -762,7 +762,7 @@ export const serializeAws_json1_1DisableLDAPSCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DisableLDAPS", }; let body: any; @@ -775,7 +775,7 @@ export const serializeAws_json1_1DisableRadiusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DisableRadius", }; let body: any; @@ -788,7 +788,7 @@ export const serializeAws_json1_1DisableSsoCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.DisableSso", }; let body: any; @@ -801,7 +801,7 @@ export const serializeAws_json1_1EnableClientAuthenticationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.EnableClientAuthentication", }; let body: any; @@ -814,7 +814,7 @@ export const serializeAws_json1_1EnableLDAPSCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.EnableLDAPS", }; let body: any; @@ -827,7 +827,7 @@ export const serializeAws_json1_1EnableRadiusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.EnableRadius", }; let body: any; @@ -840,7 +840,7 @@ export const serializeAws_json1_1EnableSsoCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.EnableSso", }; let body: any; @@ -853,7 +853,7 @@ export const serializeAws_json1_1GetDirectoryLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.GetDirectoryLimits", }; let body: any; @@ -866,7 +866,7 @@ export const serializeAws_json1_1GetSnapshotLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.GetSnapshotLimits", }; let body: any; @@ -879,7 +879,7 @@ export const serializeAws_json1_1ListCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.ListCertificates", }; let body: any; @@ -892,7 +892,7 @@ export const serializeAws_json1_1ListIpRoutesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.ListIpRoutes", }; let body: any; @@ -905,7 +905,7 @@ export const serializeAws_json1_1ListLogSubscriptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.ListLogSubscriptions", }; let body: any; @@ -918,7 +918,7 @@ export const serializeAws_json1_1ListSchemaExtensionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.ListSchemaExtensions", }; let body: any; @@ -931,7 +931,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.ListTagsForResource", }; let body: any; @@ -944,7 +944,7 @@ export const serializeAws_json1_1RegisterCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.RegisterCertificate", }; let body: any; @@ -957,7 +957,7 @@ export const serializeAws_json1_1RegisterEventTopicCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.RegisterEventTopic", }; let body: any; @@ -970,7 +970,7 @@ export const serializeAws_json1_1RejectSharedDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.RejectSharedDirectory", }; let body: any; @@ -983,7 +983,7 @@ export const serializeAws_json1_1RemoveIpRoutesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.RemoveIpRoutes", }; let body: any; @@ -996,7 +996,7 @@ export const serializeAws_json1_1RemoveRegionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.RemoveRegion", }; let body: any; @@ -1009,7 +1009,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.RemoveTagsFromResource", }; let body: any; @@ -1022,7 +1022,7 @@ export const serializeAws_json1_1ResetUserPasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.ResetUserPassword", }; let body: any; @@ -1035,7 +1035,7 @@ export const serializeAws_json1_1RestoreFromSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.RestoreFromSnapshot", }; let body: any; @@ -1048,7 +1048,7 @@ export const serializeAws_json1_1ShareDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.ShareDirectory", }; let body: any; @@ -1061,7 +1061,7 @@ export const serializeAws_json1_1StartSchemaExtensionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.StartSchemaExtension", }; let body: any; @@ -1074,7 +1074,7 @@ export const serializeAws_json1_1UnshareDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.UnshareDirectory", }; let body: any; @@ -1087,7 +1087,7 @@ export const serializeAws_json1_1UpdateConditionalForwarderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.UpdateConditionalForwarder", }; let body: any; @@ -1100,7 +1100,7 @@ export const serializeAws_json1_1UpdateNumberOfDomainControllersCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.UpdateNumberOfDomainControllers", }; let body: any; @@ -1113,7 +1113,7 @@ export const serializeAws_json1_1UpdateRadiusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.UpdateRadius", }; let body: any; @@ -1126,7 +1126,7 @@ export const serializeAws_json1_1UpdateTrustCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.UpdateTrust", }; let body: any; @@ -1139,7 +1139,7 @@ export const serializeAws_json1_1VerifyTrustCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "DirectoryService_20150416.VerifyTrust", }; let body: any; @@ -1174,8 +1174,7 @@ const deserializeAws_json1_1AcceptSharedDirectoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -1261,8 +1260,7 @@ const deserializeAws_json1_1AddIpRoutesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -1364,8 +1362,7 @@ const deserializeAws_json1_1AddRegionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.directoryservice#AccessDeniedException": @@ -1491,8 +1488,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -1578,8 +1574,7 @@ const deserializeAws_json1_1CancelSchemaExtensionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -1649,8 +1644,7 @@ const deserializeAws_json1_1ConnectDirectoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -1728,8 +1722,7 @@ const deserializeAws_json1_1CreateAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -1815,8 +1808,7 @@ const deserializeAws_json1_1CreateComputerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthenticationFailedException": case "com.amazonaws.directoryservice#AuthenticationFailedException": @@ -1926,8 +1918,7 @@ const deserializeAws_json1_1CreateConditionalForwarderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2029,8 +2020,7 @@ const deserializeAws_json1_1CreateDirectoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2108,8 +2098,7 @@ const deserializeAws_json1_1CreateLogSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2203,8 +2192,7 @@ const deserializeAws_json1_1CreateMicrosoftADCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2290,8 +2278,7 @@ const deserializeAws_json1_1CreateSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2377,8 +2364,7 @@ const deserializeAws_json1_1CreateTrustCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2472,8 +2458,7 @@ const deserializeAws_json1_1DeleteConditionalForwarderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2567,8 +2552,7 @@ const deserializeAws_json1_1DeleteDirectoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2638,8 +2622,7 @@ const deserializeAws_json1_1DeleteLogSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2717,8 +2700,7 @@ const deserializeAws_json1_1DeleteSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2796,8 +2778,7 @@ const deserializeAws_json1_1DeleteTrustCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -2883,8 +2864,7 @@ const deserializeAws_json1_1DeregisterCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CertificateDoesNotExistException": case "com.amazonaws.directoryservice#CertificateDoesNotExistException": @@ -2994,8 +2974,7 @@ const deserializeAws_json1_1DeregisterEventTopicCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -3073,8 +3052,7 @@ const deserializeAws_json1_1DescribeCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CertificateDoesNotExistException": case "com.amazonaws.directoryservice#CertificateDoesNotExistException": @@ -3168,8 +3146,7 @@ const deserializeAws_json1_1DescribeConditionalForwardersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -3263,8 +3240,7 @@ const deserializeAws_json1_1DescribeDirectoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -3350,8 +3326,7 @@ const deserializeAws_json1_1DescribeDomainControllersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -3445,8 +3420,7 @@ const deserializeAws_json1_1DescribeEventTopicsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -3524,8 +3498,7 @@ const deserializeAws_json1_1DescribeLDAPSSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -3619,8 +3592,7 @@ const deserializeAws_json1_1DescribeRegionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.directoryservice#AccessDeniedException": @@ -3722,8 +3694,7 @@ const deserializeAws_json1_1DescribeSharedDirectoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -3817,8 +3788,7 @@ const deserializeAws_json1_1DescribeSnapshotsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -3904,8 +3874,7 @@ const deserializeAws_json1_1DescribeTrustsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -3999,8 +3968,7 @@ const deserializeAws_json1_1DisableClientAuthenticationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.directoryservice#AccessDeniedException": @@ -4094,8 +4062,7 @@ const deserializeAws_json1_1DisableLDAPSCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -4197,8 +4164,7 @@ const deserializeAws_json1_1DisableRadiusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -4268,8 +4234,7 @@ const deserializeAws_json1_1DisableSsoCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthenticationFailedException": case "com.amazonaws.directoryservice#AuthenticationFailedException": @@ -4355,8 +4320,7 @@ const deserializeAws_json1_1EnableClientAuthenticationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.directoryservice#AccessDeniedException": @@ -4458,8 +4422,7 @@ const deserializeAws_json1_1EnableLDAPSCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -4569,8 +4532,7 @@ const deserializeAws_json1_1EnableRadiusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -4656,8 +4618,7 @@ const deserializeAws_json1_1EnableSsoCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthenticationFailedException": case "com.amazonaws.directoryservice#AuthenticationFailedException": @@ -4743,8 +4704,7 @@ const deserializeAws_json1_1GetDirectoryLimitsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -4814,8 +4774,7 @@ const deserializeAws_json1_1GetSnapshotLimitsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -4885,8 +4844,7 @@ const deserializeAws_json1_1ListCertificatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -4980,8 +4938,7 @@ const deserializeAws_json1_1ListIpRoutesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -5067,8 +5024,7 @@ const deserializeAws_json1_1ListLogSubscriptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -5146,8 +5102,7 @@ const deserializeAws_json1_1ListSchemaExtensionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -5225,8 +5180,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -5312,8 +5266,7 @@ const deserializeAws_json1_1RegisterCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CertificateAlreadyExistsException": case "com.amazonaws.directoryservice#CertificateAlreadyExistsException": @@ -5431,8 +5384,7 @@ const deserializeAws_json1_1RegisterEventTopicCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -5510,8 +5462,7 @@ const deserializeAws_json1_1RejectSharedDirectoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -5597,8 +5548,7 @@ const deserializeAws_json1_1RemoveIpRoutesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -5684,8 +5634,7 @@ const deserializeAws_json1_1RemoveRegionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.directoryservice#AccessDeniedException": @@ -5779,8 +5728,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -5858,8 +5806,7 @@ const deserializeAws_json1_1ResetUserPasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -5961,8 +5908,7 @@ const deserializeAws_json1_1RestoreFromSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -6040,8 +5986,7 @@ const deserializeAws_json1_1ShareDirectoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.directoryservice#AccessDeniedException": @@ -6167,8 +6112,7 @@ const deserializeAws_json1_1StartSchemaExtensionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -6262,8 +6206,7 @@ const deserializeAws_json1_1UnshareDirectoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -6349,8 +6292,7 @@ const deserializeAws_json1_1UpdateConditionalForwarderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -6444,8 +6386,7 @@ const deserializeAws_json1_1UpdateNumberOfDomainControllersCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -6547,8 +6488,7 @@ const deserializeAws_json1_1UpdateRadiusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -6626,8 +6566,7 @@ const deserializeAws_json1_1UpdateTrustCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -6705,8 +6644,7 @@ const deserializeAws_json1_1VerifyTrustCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.directoryservice#ClientException": @@ -7280,27 +7218,31 @@ const serializeAws_json1_1AcceptSharedDirectoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.SharedDirectoryId !== undefined && { SharedDirectoryId: input.SharedDirectoryId }), + ...(input.SharedDirectoryId !== undefined && + input.SharedDirectoryId !== null && { SharedDirectoryId: input.SharedDirectoryId }), }; }; const serializeAws_json1_1AddIpRoutesRequest = (input: AddIpRoutesRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.IpRoutes !== undefined && { IpRoutes: serializeAws_json1_1IpRoutes(input.IpRoutes, context) }), - ...(input.UpdateSecurityGroupForDirectoryControllers !== undefined && { - UpdateSecurityGroupForDirectoryControllers: input.UpdateSecurityGroupForDirectoryControllers, - }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.IpRoutes !== undefined && + input.IpRoutes !== null && { IpRoutes: serializeAws_json1_1IpRoutes(input.IpRoutes, context) }), + ...(input.UpdateSecurityGroupForDirectoryControllers !== undefined && + input.UpdateSecurityGroupForDirectoryControllers !== null && { + UpdateSecurityGroupForDirectoryControllers: input.UpdateSecurityGroupForDirectoryControllers, + }), }; }; const serializeAws_json1_1AddRegionRequest = (input: AddRegionRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), - ...(input.VPCSettings !== undefined && { - VPCSettings: serializeAws_json1_1DirectoryVpcSettings(input.VPCSettings, context), - }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), + ...(input.VPCSettings !== undefined && + input.VPCSettings !== null && { + VPCSettings: serializeAws_json1_1DirectoryVpcSettings(input.VPCSettings, context), + }), }; }; @@ -7309,20 +7251,27 @@ const serializeAws_json1_1AddTagsToResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Attribute = (input: Attribute, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1Attributes = (input: Attribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Attribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Attribute(entry, context); + }); }; const serializeAws_json1_1CancelSchemaExtensionRequest = ( @@ -7330,53 +7279,64 @@ const serializeAws_json1_1CancelSchemaExtensionRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.SchemaExtensionId !== undefined && { SchemaExtensionId: input.SchemaExtensionId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.SchemaExtensionId !== undefined && + input.SchemaExtensionId !== null && { SchemaExtensionId: input.SchemaExtensionId }), }; }; const serializeAws_json1_1CidrIps = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ClientCertAuthSettings = (input: ClientCertAuthSettings, context: __SerdeContext): any => { return { - ...(input.OCSPUrl !== undefined && { OCSPUrl: input.OCSPUrl }), + ...(input.OCSPUrl !== undefined && input.OCSPUrl !== null && { OCSPUrl: input.OCSPUrl }), }; }; const serializeAws_json1_1ConnectDirectoryRequest = (input: ConnectDirectoryRequest, context: __SerdeContext): any => { return { - ...(input.ConnectSettings !== undefined && { - ConnectSettings: serializeAws_json1_1DirectoryConnectSettings(input.ConnectSettings, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.ShortName !== undefined && { ShortName: input.ShortName }), - ...(input.Size !== undefined && { Size: input.Size }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ConnectSettings !== undefined && + input.ConnectSettings !== null && { + ConnectSettings: serializeAws_json1_1DirectoryConnectSettings(input.ConnectSettings, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.ShortName !== undefined && input.ShortName !== null && { ShortName: input.ShortName }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1CreateAliasRequest = (input: CreateAliasRequest, context: __SerdeContext): any => { return { - ...(input.Alias !== undefined && { Alias: input.Alias }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Alias !== undefined && input.Alias !== null && { Alias: input.Alias }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; const serializeAws_json1_1CreateComputerRequest = (input: CreateComputerRequest, context: __SerdeContext): any => { return { - ...(input.ComputerAttributes !== undefined && { - ComputerAttributes: serializeAws_json1_1Attributes(input.ComputerAttributes, context), - }), - ...(input.ComputerName !== undefined && { ComputerName: input.ComputerName }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.OrganizationalUnitDistinguishedName !== undefined && { - OrganizationalUnitDistinguishedName: input.OrganizationalUnitDistinguishedName, - }), - ...(input.Password !== undefined && { Password: input.Password }), + ...(input.ComputerAttributes !== undefined && + input.ComputerAttributes !== null && { + ComputerAttributes: serializeAws_json1_1Attributes(input.ComputerAttributes, context), + }), + ...(input.ComputerName !== undefined && input.ComputerName !== null && { ComputerName: input.ComputerName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.OrganizationalUnitDistinguishedName !== undefined && + input.OrganizationalUnitDistinguishedName !== null && { + OrganizationalUnitDistinguishedName: input.OrganizationalUnitDistinguishedName, + }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), }; }; @@ -7385,23 +7345,26 @@ const serializeAws_json1_1CreateConditionalForwarderRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.DnsIpAddrs !== undefined && { DnsIpAddrs: serializeAws_json1_1DnsIpAddrs(input.DnsIpAddrs, context) }), - ...(input.RemoteDomainName !== undefined && { RemoteDomainName: input.RemoteDomainName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.DnsIpAddrs !== undefined && + input.DnsIpAddrs !== null && { DnsIpAddrs: serializeAws_json1_1DnsIpAddrs(input.DnsIpAddrs, context) }), + ...(input.RemoteDomainName !== undefined && + input.RemoteDomainName !== null && { RemoteDomainName: input.RemoteDomainName }), }; }; const serializeAws_json1_1CreateDirectoryRequest = (input: CreateDirectoryRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.ShortName !== undefined && { ShortName: input.ShortName }), - ...(input.Size !== undefined && { Size: input.Size }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.VpcSettings !== undefined && { - VpcSettings: serializeAws_json1_1DirectoryVpcSettings(input.VpcSettings, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.ShortName !== undefined && input.ShortName !== null && { ShortName: input.ShortName }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.VpcSettings !== undefined && + input.VpcSettings !== null && { + VpcSettings: serializeAws_json1_1DirectoryVpcSettings(input.VpcSettings, context), + }), }; }; @@ -7410,8 +7373,8 @@ const serializeAws_json1_1CreateLogSubscriptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.LogGroupName !== undefined && { LogGroupName: input.LogGroupName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.LogGroupName !== undefined && input.LogGroupName !== null && { LogGroupName: input.LogGroupName }), }; }; @@ -7420,36 +7383,40 @@ const serializeAws_json1_1CreateMicrosoftADRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Edition !== undefined && { Edition: input.Edition }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.ShortName !== undefined && { ShortName: input.ShortName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.VpcSettings !== undefined && { - VpcSettings: serializeAws_json1_1DirectoryVpcSettings(input.VpcSettings, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Edition !== undefined && input.Edition !== null && { Edition: input.Edition }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.ShortName !== undefined && input.ShortName !== null && { ShortName: input.ShortName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.VpcSettings !== undefined && + input.VpcSettings !== null && { + VpcSettings: serializeAws_json1_1DirectoryVpcSettings(input.VpcSettings, context), + }), }; }; const serializeAws_json1_1CreateSnapshotRequest = (input: CreateSnapshotRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1CreateTrustRequest = (input: CreateTrustRequest, context: __SerdeContext): any => { return { - ...(input.ConditionalForwarderIpAddrs !== undefined && { - ConditionalForwarderIpAddrs: serializeAws_json1_1DnsIpAddrs(input.ConditionalForwarderIpAddrs, context), - }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.RemoteDomainName !== undefined && { RemoteDomainName: input.RemoteDomainName }), - ...(input.SelectiveAuth !== undefined && { SelectiveAuth: input.SelectiveAuth }), - ...(input.TrustDirection !== undefined && { TrustDirection: input.TrustDirection }), - ...(input.TrustPassword !== undefined && { TrustPassword: input.TrustPassword }), - ...(input.TrustType !== undefined && { TrustType: input.TrustType }), + ...(input.ConditionalForwarderIpAddrs !== undefined && + input.ConditionalForwarderIpAddrs !== null && { + ConditionalForwarderIpAddrs: serializeAws_json1_1DnsIpAddrs(input.ConditionalForwarderIpAddrs, context), + }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.RemoteDomainName !== undefined && + input.RemoteDomainName !== null && { RemoteDomainName: input.RemoteDomainName }), + ...(input.SelectiveAuth !== undefined && input.SelectiveAuth !== null && { SelectiveAuth: input.SelectiveAuth }), + ...(input.TrustDirection !== undefined && + input.TrustDirection !== null && { TrustDirection: input.TrustDirection }), + ...(input.TrustPassword !== undefined && input.TrustPassword !== null && { TrustPassword: input.TrustPassword }), + ...(input.TrustType !== undefined && input.TrustType !== null && { TrustType: input.TrustType }), }; }; @@ -7458,14 +7425,15 @@ const serializeAws_json1_1DeleteConditionalForwarderRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.RemoteDomainName !== undefined && { RemoteDomainName: input.RemoteDomainName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.RemoteDomainName !== undefined && + input.RemoteDomainName !== null && { RemoteDomainName: input.RemoteDomainName }), }; }; const serializeAws_json1_1DeleteDirectoryRequest = (input: DeleteDirectoryRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; @@ -7474,22 +7442,23 @@ const serializeAws_json1_1DeleteLogSubscriptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; const serializeAws_json1_1DeleteSnapshotRequest = (input: DeleteSnapshotRequest, context: __SerdeContext): any => { return { - ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }), + ...(input.SnapshotId !== undefined && input.SnapshotId !== null && { SnapshotId: input.SnapshotId }), }; }; const serializeAws_json1_1DeleteTrustRequest = (input: DeleteTrustRequest, context: __SerdeContext): any => { return { - ...(input.DeleteAssociatedConditionalForwarder !== undefined && { - DeleteAssociatedConditionalForwarder: input.DeleteAssociatedConditionalForwarder, - }), - ...(input.TrustId !== undefined && { TrustId: input.TrustId }), + ...(input.DeleteAssociatedConditionalForwarder !== undefined && + input.DeleteAssociatedConditionalForwarder !== null && { + DeleteAssociatedConditionalForwarder: input.DeleteAssociatedConditionalForwarder, + }), + ...(input.TrustId !== undefined && input.TrustId !== null && { TrustId: input.TrustId }), }; }; @@ -7498,8 +7467,8 @@ const serializeAws_json1_1DeregisterCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateId !== undefined && { CertificateId: input.CertificateId }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.CertificateId !== undefined && input.CertificateId !== null && { CertificateId: input.CertificateId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; @@ -7508,8 +7477,8 @@ const serializeAws_json1_1DeregisterEventTopicRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.TopicName !== undefined && { TopicName: input.TopicName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.TopicName !== undefined && input.TopicName !== null && { TopicName: input.TopicName }), }; }; @@ -7518,8 +7487,8 @@ const serializeAws_json1_1DescribeCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateId !== undefined && { CertificateId: input.CertificateId }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.CertificateId !== undefined && input.CertificateId !== null && { CertificateId: input.CertificateId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; @@ -7528,10 +7497,11 @@ const serializeAws_json1_1DescribeConditionalForwardersRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.RemoteDomainNames !== undefined && { - RemoteDomainNames: serializeAws_json1_1RemoteDomainNames(input.RemoteDomainNames, context), - }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.RemoteDomainNames !== undefined && + input.RemoteDomainNames !== null && { + RemoteDomainNames: serializeAws_json1_1RemoteDomainNames(input.RemoteDomainNames, context), + }), }; }; @@ -7540,11 +7510,10 @@ const serializeAws_json1_1DescribeDirectoriesRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryIds !== undefined && { - DirectoryIds: serializeAws_json1_1DirectoryIds(input.DirectoryIds, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DirectoryIds !== undefined && + input.DirectoryIds !== null && { DirectoryIds: serializeAws_json1_1DirectoryIds(input.DirectoryIds, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7553,12 +7522,13 @@ const serializeAws_json1_1DescribeDomainControllersRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.DomainControllerIds !== undefined && { - DomainControllerIds: serializeAws_json1_1DomainControllerIds(input.DomainControllerIds, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.DomainControllerIds !== undefined && + input.DomainControllerIds !== null && { + DomainControllerIds: serializeAws_json1_1DomainControllerIds(input.DomainControllerIds, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7567,8 +7537,9 @@ const serializeAws_json1_1DescribeEventTopicsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.TopicNames !== undefined && { TopicNames: serializeAws_json1_1TopicNames(input.TopicNames, context) }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.TopicNames !== undefined && + input.TopicNames !== null && { TopicNames: serializeAws_json1_1TopicNames(input.TopicNames, context) }), }; }; @@ -7577,18 +7548,18 @@ const serializeAws_json1_1DescribeLDAPSSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1DescribeRegionsRequest = (input: DescribeRegionsRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), }; }; @@ -7597,12 +7568,14 @@ const serializeAws_json1_1DescribeSharedDirectoriesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OwnerDirectoryId !== undefined && { OwnerDirectoryId: input.OwnerDirectoryId }), - ...(input.SharedDirectoryIds !== undefined && { - SharedDirectoryIds: serializeAws_json1_1DirectoryIds(input.SharedDirectoryIds, context), - }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OwnerDirectoryId !== undefined && + input.OwnerDirectoryId !== null && { OwnerDirectoryId: input.OwnerDirectoryId }), + ...(input.SharedDirectoryIds !== undefined && + input.SharedDirectoryIds !== null && { + SharedDirectoryIds: serializeAws_json1_1DirectoryIds(input.SharedDirectoryIds, context), + }), }; }; @@ -7611,21 +7584,21 @@ const serializeAws_json1_1DescribeSnapshotsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SnapshotIds !== undefined && { - SnapshotIds: serializeAws_json1_1SnapshotIds(input.SnapshotIds, context), - }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SnapshotIds !== undefined && + input.SnapshotIds !== null && { SnapshotIds: serializeAws_json1_1SnapshotIds(input.SnapshotIds, context) }), }; }; const serializeAws_json1_1DescribeTrustsRequest = (input: DescribeTrustsRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TrustIds !== undefined && { TrustIds: serializeAws_json1_1TrustIds(input.TrustIds, context) }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TrustIds !== undefined && + input.TrustIds !== null && { TrustIds: serializeAws_json1_1TrustIds(input.TrustIds, context) }), }; }; @@ -7634,23 +7607,34 @@ const serializeAws_json1_1DirectoryConnectSettings = ( context: __SerdeContext ): any => { return { - ...(input.CustomerDnsIps !== undefined && { - CustomerDnsIps: serializeAws_json1_1DnsIpAddrs(input.CustomerDnsIps, context), - }), - ...(input.CustomerUserName !== undefined && { CustomerUserName: input.CustomerUserName }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.CustomerDnsIps !== undefined && + input.CustomerDnsIps !== null && { + CustomerDnsIps: serializeAws_json1_1DnsIpAddrs(input.CustomerDnsIps, context), + }), + ...(input.CustomerUserName !== undefined && + input.CustomerUserName !== null && { CustomerUserName: input.CustomerUserName }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; const serializeAws_json1_1DirectoryIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DirectoryVpcSettings = (input: DirectoryVpcSettings, context: __SerdeContext): any => { return { - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -7659,38 +7643,52 @@ const serializeAws_json1_1DisableClientAuthenticationRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1DisableLDAPSRequest = (input: DisableLDAPSRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1DisableRadiusRequest = (input: DisableRadiusRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; const serializeAws_json1_1DisableSsoRequest = (input: DisableSsoRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; const serializeAws_json1_1DnsIpAddrs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DomainControllerIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EnableClientAuthenticationRequest = ( @@ -7698,32 +7696,33 @@ const serializeAws_json1_1EnableClientAuthenticationRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1EnableLDAPSRequest = (input: EnableLDAPSRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1EnableRadiusRequest = (input: EnableRadiusRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.RadiusSettings !== undefined && { - RadiusSettings: serializeAws_json1_1RadiusSettings(input.RadiusSettings, context), - }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.RadiusSettings !== undefined && + input.RadiusSettings !== null && { + RadiusSettings: serializeAws_json1_1RadiusSettings(input.RadiusSettings, context), + }), }; }; const serializeAws_json1_1EnableSsoRequest = (input: EnableSsoRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -7739,34 +7738,41 @@ const serializeAws_json1_1GetSnapshotLimitsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; const serializeAws_json1_1IpRoute = (input: IpRoute, context: __SerdeContext): any => { return { - ...(input.CidrIp !== undefined && { CidrIp: input.CidrIp }), - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.CidrIp !== undefined && input.CidrIp !== null && { CidrIp: input.CidrIp }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }; }; const serializeAws_json1_1IpRoutes = (input: IpRoute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1IpRoute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1IpRoute(entry, context); + }); }; const serializeAws_json1_1ListCertificatesRequest = (input: ListCertificatesRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListIpRoutesRequest = (input: ListIpRoutesRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7775,9 +7781,9 @@ const serializeAws_json1_1ListLogSubscriptionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7786,9 +7792,9 @@ const serializeAws_json1_1ListSchemaExtensionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7797,24 +7803,25 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; const serializeAws_json1_1RadiusSettings = (input: RadiusSettings, context: __SerdeContext): any => { return { - ...(input.AuthenticationProtocol !== undefined && { AuthenticationProtocol: input.AuthenticationProtocol }), - ...(input.DisplayLabel !== undefined && { DisplayLabel: input.DisplayLabel }), - ...(input.RadiusPort !== undefined && { RadiusPort: input.RadiusPort }), - ...(input.RadiusRetries !== undefined && { RadiusRetries: input.RadiusRetries }), - ...(input.RadiusServers !== undefined && { - RadiusServers: serializeAws_json1_1Servers(input.RadiusServers, context), - }), - ...(input.RadiusTimeout !== undefined && { RadiusTimeout: input.RadiusTimeout }), - ...(input.SharedSecret !== undefined && { SharedSecret: input.SharedSecret }), - ...(input.UseSameUsername !== undefined && { UseSameUsername: input.UseSameUsername }), + ...(input.AuthenticationProtocol !== undefined && + input.AuthenticationProtocol !== null && { AuthenticationProtocol: input.AuthenticationProtocol }), + ...(input.DisplayLabel !== undefined && input.DisplayLabel !== null && { DisplayLabel: input.DisplayLabel }), + ...(input.RadiusPort !== undefined && input.RadiusPort !== null && { RadiusPort: input.RadiusPort }), + ...(input.RadiusRetries !== undefined && input.RadiusRetries !== null && { RadiusRetries: input.RadiusRetries }), + ...(input.RadiusServers !== undefined && + input.RadiusServers !== null && { RadiusServers: serializeAws_json1_1Servers(input.RadiusServers, context) }), + ...(input.RadiusTimeout !== undefined && input.RadiusTimeout !== null && { RadiusTimeout: input.RadiusTimeout }), + ...(input.SharedSecret !== undefined && input.SharedSecret !== null && { SharedSecret: input.SharedSecret }), + ...(input.UseSameUsername !== undefined && + input.UseSameUsername !== null && { UseSameUsername: input.UseSameUsername }), }; }; @@ -7823,12 +7830,14 @@ const serializeAws_json1_1RegisterCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.CertificateData !== undefined && { CertificateData: input.CertificateData }), - ...(input.ClientCertAuthSettings !== undefined && { - ClientCertAuthSettings: serializeAws_json1_1ClientCertAuthSettings(input.ClientCertAuthSettings, context), - }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.CertificateData !== undefined && + input.CertificateData !== null && { CertificateData: input.CertificateData }), + ...(input.ClientCertAuthSettings !== undefined && + input.ClientCertAuthSettings !== null && { + ClientCertAuthSettings: serializeAws_json1_1ClientCertAuthSettings(input.ClientCertAuthSettings, context), + }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -7837,8 +7846,8 @@ const serializeAws_json1_1RegisterEventTopicRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.TopicName !== undefined && { TopicName: input.TopicName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.TopicName !== undefined && input.TopicName !== null && { TopicName: input.TopicName }), }; }; @@ -7847,24 +7856,33 @@ const serializeAws_json1_1RejectSharedDirectoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.SharedDirectoryId !== undefined && { SharedDirectoryId: input.SharedDirectoryId }), + ...(input.SharedDirectoryId !== undefined && + input.SharedDirectoryId !== null && { SharedDirectoryId: input.SharedDirectoryId }), }; }; const serializeAws_json1_1RemoteDomainNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RemoveIpRoutesRequest = (input: RemoveIpRoutesRequest, context: __SerdeContext): any => { return { - ...(input.CidrIps !== undefined && { CidrIps: serializeAws_json1_1CidrIps(input.CidrIps, context) }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.CidrIps !== undefined && + input.CidrIps !== null && { CidrIps: serializeAws_json1_1CidrIps(input.CidrIps, context) }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; const serializeAws_json1_1RemoveRegionRequest = (input: RemoveRegionRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; @@ -7873,8 +7891,9 @@ const serializeAws_json1_1RemoveTagsFromResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; @@ -7883,9 +7902,9 @@ const serializeAws_json1_1ResetUserPasswordRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.NewPassword !== undefined && { NewPassword: input.NewPassword }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.NewPassword !== undefined && input.NewPassword !== null && { NewPassword: input.NewPassword }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -7894,34 +7913,47 @@ const serializeAws_json1_1RestoreFromSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }), + ...(input.SnapshotId !== undefined && input.SnapshotId !== null && { SnapshotId: input.SnapshotId }), }; }; const serializeAws_json1_1Servers = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ShareDirectoryRequest = (input: ShareDirectoryRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.ShareMethod !== undefined && { ShareMethod: input.ShareMethod }), - ...(input.ShareNotes !== undefined && { ShareNotes: input.ShareNotes }), - ...(input.ShareTarget !== undefined && { - ShareTarget: serializeAws_json1_1ShareTarget(input.ShareTarget, context), - }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.ShareMethod !== undefined && input.ShareMethod !== null && { ShareMethod: input.ShareMethod }), + ...(input.ShareNotes !== undefined && input.ShareNotes !== null && { ShareNotes: input.ShareNotes }), + ...(input.ShareTarget !== undefined && + input.ShareTarget !== null && { ShareTarget: serializeAws_json1_1ShareTarget(input.ShareTarget, context) }), }; }; const serializeAws_json1_1ShareTarget = (input: ShareTarget, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1SnapshotIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartSchemaExtensionRequest = ( @@ -7929,55 +7961,92 @@ const serializeAws_json1_1StartSchemaExtensionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreateSnapshotBeforeSchemaExtension !== undefined && { - CreateSnapshotBeforeSchemaExtension: input.CreateSnapshotBeforeSchemaExtension, - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.LdifContent !== undefined && { LdifContent: input.LdifContent }), + ...(input.CreateSnapshotBeforeSchemaExtension !== undefined && + input.CreateSnapshotBeforeSchemaExtension !== null && { + CreateSnapshotBeforeSchemaExtension: input.CreateSnapshotBeforeSchemaExtension, + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.LdifContent !== undefined && input.LdifContent !== null && { LdifContent: input.LdifContent }), }; }; const serializeAws_json1_1SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TopicNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TrustIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UnshareDirectoryRequest = (input: UnshareDirectoryRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.UnshareTarget !== undefined && { - UnshareTarget: serializeAws_json1_1UnshareTarget(input.UnshareTarget, context), - }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.UnshareTarget !== undefined && + input.UnshareTarget !== null && { + UnshareTarget: serializeAws_json1_1UnshareTarget(input.UnshareTarget, context), + }), }; }; const serializeAws_json1_1UnshareTarget = (input: UnshareTarget, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -7986,9 +8055,11 @@ const serializeAws_json1_1UpdateConditionalForwarderRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.DnsIpAddrs !== undefined && { DnsIpAddrs: serializeAws_json1_1DnsIpAddrs(input.DnsIpAddrs, context) }), - ...(input.RemoteDomainName !== undefined && { RemoteDomainName: input.RemoteDomainName }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.DnsIpAddrs !== undefined && + input.DnsIpAddrs !== null && { DnsIpAddrs: serializeAws_json1_1DnsIpAddrs(input.DnsIpAddrs, context) }), + ...(input.RemoteDomainName !== undefined && + input.RemoteDomainName !== null && { RemoteDomainName: input.RemoteDomainName }), }; }; @@ -7997,30 +8068,31 @@ const serializeAws_json1_1UpdateNumberOfDomainControllersRequest = ( context: __SerdeContext ): any => { return { - ...(input.DesiredNumber !== undefined && { DesiredNumber: input.DesiredNumber }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.DesiredNumber !== undefined && input.DesiredNumber !== null && { DesiredNumber: input.DesiredNumber }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; const serializeAws_json1_1UpdateRadiusRequest = (input: UpdateRadiusRequest, context: __SerdeContext): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.RadiusSettings !== undefined && { - RadiusSettings: serializeAws_json1_1RadiusSettings(input.RadiusSettings, context), - }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.RadiusSettings !== undefined && + input.RadiusSettings !== null && { + RadiusSettings: serializeAws_json1_1RadiusSettings(input.RadiusSettings, context), + }), }; }; const serializeAws_json1_1UpdateTrustRequest = (input: UpdateTrustRequest, context: __SerdeContext): any => { return { - ...(input.SelectiveAuth !== undefined && { SelectiveAuth: input.SelectiveAuth }), - ...(input.TrustId !== undefined && { TrustId: input.TrustId }), + ...(input.SelectiveAuth !== undefined && input.SelectiveAuth !== null && { SelectiveAuth: input.SelectiveAuth }), + ...(input.TrustId !== undefined && input.TrustId !== null && { TrustId: input.TrustId }), }; }; const serializeAws_json1_1VerifyTrustRequest = (input: VerifyTrustRequest, context: __SerdeContext): any => { return { - ...(input.TrustId !== undefined && { TrustId: input.TrustId }), + ...(input.TrustId !== undefined && input.TrustId !== null && { TrustId: input.TrustId }), }; }; @@ -8048,7 +8120,14 @@ const deserializeAws_json1_1AddIpRoutesResult = (output: any, context: __SerdeCo }; const deserializeAws_json1_1AdditionalRegions = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AddRegionResult = (output: any, context: __SerdeContext): AddRegionResult => { @@ -8070,7 +8149,14 @@ const deserializeAws_json1_1Attribute = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Attributes = (output: any, context: __SerdeContext): Attribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Attribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Attribute(entry, context); + }); }; const deserializeAws_json1_1AuthenticationFailedException = ( @@ -8084,7 +8170,14 @@ const deserializeAws_json1_1AuthenticationFailedException = ( }; const deserializeAws_json1_1AvailabilityZones = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CancelSchemaExtensionResult = ( @@ -8172,7 +8265,14 @@ const deserializeAws_json1_1CertificateLimitExceededException = ( }; const deserializeAws_json1_1CertificatesInfo = (output: any, context: __SerdeContext): CertificateInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CertificateInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CertificateInfo(entry, context); + }); }; const deserializeAws_json1_1ClientCertAuthSettings = (output: any, context: __SerdeContext): ClientCertAuthSettings => { @@ -8213,7 +8313,14 @@ const deserializeAws_json1_1ConditionalForwarder = (output: any, context: __Serd }; const deserializeAws_json1_1ConditionalForwarders = (output: any, context: __SerdeContext): ConditionalForwarder[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConditionalForwarder(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConditionalForwarder(entry, context); + }); }; const deserializeAws_json1_1ConnectDirectoryResult = (output: any, context: __SerdeContext): ConnectDirectoryResult => { @@ -8549,7 +8656,14 @@ const deserializeAws_json1_1DirectoryDescription = (output: any, context: __Serd }; const deserializeAws_json1_1DirectoryDescriptions = (output: any, context: __SerdeContext): DirectoryDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DirectoryDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DirectoryDescription(entry, context); + }); }; const deserializeAws_json1_1DirectoryDoesNotExistException = ( @@ -8682,7 +8796,14 @@ const deserializeAws_json1_1DisableSsoResult = (output: any, context: __SerdeCon }; const deserializeAws_json1_1DnsIpAddrs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DomainController = (output: any, context: __SerdeContext): DomainController => { @@ -8721,7 +8842,14 @@ const deserializeAws_json1_1DomainControllerLimitExceededException = ( }; const deserializeAws_json1_1DomainControllers = (output: any, context: __SerdeContext): DomainController[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DomainController(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DomainController(entry, context); + }); }; const deserializeAws_json1_1EnableClientAuthenticationResult = ( @@ -8777,7 +8905,14 @@ const deserializeAws_json1_1EventTopic = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1EventTopics = (output: any, context: __SerdeContext): EventTopic[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventTopic(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventTopic(entry, context); + }); }; const deserializeAws_json1_1GetDirectoryLimitsResult = ( @@ -8882,7 +9017,14 @@ const deserializeAws_json1_1InvalidTargetException = (output: any, context: __Se }; const deserializeAws_json1_1IpAddrs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1IpRouteInfo = (output: any, context: __SerdeContext): IpRouteInfo => { @@ -8914,7 +9056,14 @@ const deserializeAws_json1_1IpRouteLimitExceededException = ( }; const deserializeAws_json1_1IpRoutesInfo = (output: any, context: __SerdeContext): IpRouteInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IpRouteInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IpRouteInfo(entry, context); + }); }; const deserializeAws_json1_1LDAPSSettingInfo = (output: any, context: __SerdeContext): LDAPSSettingInfo => { @@ -8932,7 +9081,14 @@ const deserializeAws_json1_1LDAPSSettingInfo = (output: any, context: __SerdeCon }; const deserializeAws_json1_1LDAPSSettingsInfo = (output: any, context: __SerdeContext): LDAPSSettingInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LDAPSSettingInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LDAPSSettingInfo(entry, context); + }); }; const deserializeAws_json1_1ListCertificatesResult = (output: any, context: __SerdeContext): ListCertificatesResult => { @@ -9004,7 +9160,14 @@ const deserializeAws_json1_1LogSubscription = (output: any, context: __SerdeCont }; const deserializeAws_json1_1LogSubscriptions = (output: any, context: __SerdeContext): LogSubscription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LogSubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LogSubscription(entry, context); + }); }; const deserializeAws_json1_1NoAvailableCertificateException = ( @@ -9109,7 +9272,14 @@ const deserializeAws_json1_1RegionLimitExceededException = ( }; const deserializeAws_json1_1RegionsDescription = (output: any, context: __SerdeContext): RegionDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegionDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegionDescription(entry, context); + }); }; const deserializeAws_json1_1RegionsInfo = (output: any, context: __SerdeContext): RegionsInfo => { @@ -9209,11 +9379,25 @@ const deserializeAws_json1_1SchemaExtensionInfo = (output: any, context: __Serde }; const deserializeAws_json1_1SchemaExtensionsInfo = (output: any, context: __SerdeContext): SchemaExtensionInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SchemaExtensionInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SchemaExtensionInfo(entry, context); + }); }; const deserializeAws_json1_1Servers = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ServiceException = (output: any, context: __SerdeContext): ServiceException => { @@ -9224,7 +9408,14 @@ const deserializeAws_json1_1ServiceException = (output: any, context: __SerdeCon }; const deserializeAws_json1_1SharedDirectories = (output: any, context: __SerdeContext): SharedDirectory[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SharedDirectory(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SharedDirectory(entry, context); + }); }; const deserializeAws_json1_1SharedDirectory = (output: any, context: __SerdeContext): SharedDirectory => { @@ -9314,7 +9505,14 @@ const deserializeAws_json1_1SnapshotLimits = (output: any, context: __SerdeConte }; const deserializeAws_json1_1Snapshots = (output: any, context: __SerdeContext): Snapshot[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Snapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Snapshot(entry, context); + }); }; const deserializeAws_json1_1StartSchemaExtensionResult = ( @@ -9330,7 +9528,14 @@ const deserializeAws_json1_1StartSchemaExtensionResult = ( }; const deserializeAws_json1_1SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -9351,7 +9556,14 @@ const deserializeAws_json1_1TagLimitExceededException = ( }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1Trust = (output: any, context: __SerdeContext): Trust => { @@ -9384,7 +9596,14 @@ const deserializeAws_json1_1Trust = (output: any, context: __SerdeContext): Trus }; const deserializeAws_json1_1Trusts = (output: any, context: __SerdeContext): Trust[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Trust(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Trust(entry, context); + }); }; const deserializeAws_json1_1UnshareDirectoryResult = (output: any, context: __SerdeContext): UnshareDirectoryResult => { @@ -9497,3 +9716,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-dlm/protocols/Aws_restJson1.ts b/clients/client-dlm/protocols/Aws_restJson1.ts index b35c577db97b..82d6146c2fa2 100644 --- a/clients/client-dlm/protocols/Aws_restJson1.ts +++ b/clients/client-dlm/protocols/Aws_restJson1.ts @@ -56,18 +56,20 @@ export const serializeAws_restJson1CreateLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/policies"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ExecutionRoleArn !== undefined && { ExecutionRoleArn: input.ExecutionRoleArn }), - ...(input.PolicyDetails !== undefined && { - PolicyDetails: serializeAws_restJson1PolicyDetails(input.PolicyDetails, context), - }), - ...(input.State !== undefined && { State: input.State }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ExecutionRoleArn !== undefined && + input.ExecutionRoleArn !== null && { ExecutionRoleArn: input.ExecutionRoleArn }), + ...(input.PolicyDetails !== undefined && + input.PolicyDetails !== null && { + PolicyDetails: serializeAws_restJson1PolicyDetails(input.PolicyDetails, context), + }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -85,9 +87,7 @@ export const serializeAws_restJson1DeleteLifecyclePolicyCommand = async ( input: DeleteLifecyclePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies/{PolicyId}"; if (input.PolicyId !== undefined) { const labelValue: string = input.PolicyId; @@ -115,9 +115,7 @@ export const serializeAws_restJson1GetLifecyclePoliciesCommand = async ( input: GetLifecyclePoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies"; const query: any = { ...(input.State !== undefined && { state: input.State }), @@ -144,9 +142,7 @@ export const serializeAws_restJson1GetLifecyclePolicyCommand = async ( input: GetLifecyclePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies/{PolicyId}"; if (input.PolicyId !== undefined) { const labelValue: string = input.PolicyId; @@ -174,9 +170,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -205,7 +199,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -219,7 +213,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -237,9 +231,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -272,7 +264,7 @@ export const serializeAws_restJson1UpdateLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/policies/{PolicyId}"; if (input.PolicyId !== undefined) { @@ -286,12 +278,14 @@ export const serializeAws_restJson1UpdateLifecyclePolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ExecutionRoleArn !== undefined && { ExecutionRoleArn: input.ExecutionRoleArn }), - ...(input.PolicyDetails !== undefined && { - PolicyDetails: serializeAws_restJson1PolicyDetails(input.PolicyDetails, context), - }), - ...(input.State !== undefined && { State: input.State }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ExecutionRoleArn !== undefined && + input.ExecutionRoleArn !== null && { ExecutionRoleArn: input.ExecutionRoleArn }), + ...(input.PolicyDetails !== undefined && + input.PolicyDetails !== null && { + PolicyDetails: serializeAws_restJson1PolicyDetails(input.PolicyDetails, context), + }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -981,15 +975,24 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( }; const serializeAws_restJson1AvailabilityZoneList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1CreateRule = (input: CreateRule, context: __SerdeContext): any => { return { - ...(input.CronExpression !== undefined && { CronExpression: input.CronExpression }), - ...(input.Interval !== undefined && { Interval: input.Interval }), - ...(input.IntervalUnit !== undefined && { IntervalUnit: input.IntervalUnit }), - ...(input.Times !== undefined && { Times: serializeAws_restJson1TimesList(input.Times, context) }), + ...(input.CronExpression !== undefined && + input.CronExpression !== null && { CronExpression: input.CronExpression }), + ...(input.Interval !== undefined && input.Interval !== null && { Interval: input.Interval }), + ...(input.IntervalUnit !== undefined && input.IntervalUnit !== null && { IntervalUnit: input.IntervalUnit }), + ...(input.Times !== undefined && + input.Times !== null && { Times: serializeAws_restJson1TimesList(input.Times, context) }), }; }; @@ -998,56 +1001,68 @@ const serializeAws_restJson1CrossRegionCopyRetainRule = ( context: __SerdeContext ): any => { return { - ...(input.Interval !== undefined && { Interval: input.Interval }), - ...(input.IntervalUnit !== undefined && { IntervalUnit: input.IntervalUnit }), + ...(input.Interval !== undefined && input.Interval !== null && { Interval: input.Interval }), + ...(input.IntervalUnit !== undefined && input.IntervalUnit !== null && { IntervalUnit: input.IntervalUnit }), }; }; const serializeAws_restJson1CrossRegionCopyRule = (input: CrossRegionCopyRule, context: __SerdeContext): any => { return { - ...(input.CmkArn !== undefined && { CmkArn: input.CmkArn }), - ...(input.CopyTags !== undefined && { CopyTags: input.CopyTags }), - ...(input.Encrypted !== undefined && { Encrypted: input.Encrypted }), - ...(input.RetainRule !== undefined && { - RetainRule: serializeAws_restJson1CrossRegionCopyRetainRule(input.RetainRule, context), - }), - ...(input.TargetRegion !== undefined && { TargetRegion: input.TargetRegion }), + ...(input.CmkArn !== undefined && input.CmkArn !== null && { CmkArn: input.CmkArn }), + ...(input.CopyTags !== undefined && input.CopyTags !== null && { CopyTags: input.CopyTags }), + ...(input.Encrypted !== undefined && input.Encrypted !== null && { Encrypted: input.Encrypted }), + ...(input.RetainRule !== undefined && + input.RetainRule !== null && { + RetainRule: serializeAws_restJson1CrossRegionCopyRetainRule(input.RetainRule, context), + }), + ...(input.TargetRegion !== undefined && input.TargetRegion !== null && { TargetRegion: input.TargetRegion }), }; }; const serializeAws_restJson1CrossRegionCopyRules = (input: CrossRegionCopyRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CrossRegionCopyRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CrossRegionCopyRule(entry, context); + }); }; const serializeAws_restJson1FastRestoreRule = (input: FastRestoreRule, context: __SerdeContext): any => { return { - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_restJson1AvailabilityZoneList(input.AvailabilityZones, context), - }), - ...(input.Count !== undefined && { Count: input.Count }), - ...(input.Interval !== undefined && { Interval: input.Interval }), - ...(input.IntervalUnit !== undefined && { IntervalUnit: input.IntervalUnit }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_restJson1AvailabilityZoneList(input.AvailabilityZones, context), + }), + ...(input.Count !== undefined && input.Count !== null && { Count: input.Count }), + ...(input.Interval !== undefined && input.Interval !== null && { Interval: input.Interval }), + ...(input.IntervalUnit !== undefined && input.IntervalUnit !== null && { IntervalUnit: input.IntervalUnit }), }; }; const serializeAws_restJson1_Parameters = (input: _Parameters, context: __SerdeContext): any => { return { - ...(input.ExcludeBootVolume !== undefined && { ExcludeBootVolume: input.ExcludeBootVolume }), - ...(input.NoReboot !== undefined && { NoReboot: input.NoReboot }), + ...(input.ExcludeBootVolume !== undefined && + input.ExcludeBootVolume !== null && { ExcludeBootVolume: input.ExcludeBootVolume }), + ...(input.NoReboot !== undefined && input.NoReboot !== null && { NoReboot: input.NoReboot }), }; }; const serializeAws_restJson1PolicyDetails = (input: PolicyDetails, context: __SerdeContext): any => { return { - ...(input.Parameters !== undefined && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), - ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), - ...(input.ResourceTypes !== undefined && { - ResourceTypes: serializeAws_restJson1ResourceTypeValuesList(input.ResourceTypes, context), - }), - ...(input.Schedules !== undefined && { Schedules: serializeAws_restJson1ScheduleList(input.Schedules, context) }), - ...(input.TargetTags !== undefined && { - TargetTags: serializeAws_restJson1TargetTagList(input.TargetTags, context), - }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), + ...(input.PolicyType !== undefined && input.PolicyType !== null && { PolicyType: input.PolicyType }), + ...(input.ResourceTypes !== undefined && + input.ResourceTypes !== null && { + ResourceTypes: serializeAws_restJson1ResourceTypeValuesList(input.ResourceTypes, context), + }), + ...(input.Schedules !== undefined && + input.Schedules !== null && { Schedules: serializeAws_restJson1ScheduleList(input.Schedules, context) }), + ...(input.TargetTags !== undefined && + input.TargetTags !== null && { TargetTags: serializeAws_restJson1TargetTagList(input.TargetTags, context) }), }; }; @@ -1055,75 +1070,132 @@ const serializeAws_restJson1ResourceTypeValuesList = ( input: (ResourceTypeValues | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1RetainRule = (input: RetainRule, context: __SerdeContext): any => { return { - ...(input.Count !== undefined && { Count: input.Count }), - ...(input.Interval !== undefined && { Interval: input.Interval }), - ...(input.IntervalUnit !== undefined && { IntervalUnit: input.IntervalUnit }), + ...(input.Count !== undefined && input.Count !== null && { Count: input.Count }), + ...(input.Interval !== undefined && input.Interval !== null && { Interval: input.Interval }), + ...(input.IntervalUnit !== undefined && input.IntervalUnit !== null && { IntervalUnit: input.IntervalUnit }), }; }; const serializeAws_restJson1Schedule = (input: Schedule, context: __SerdeContext): any => { return { - ...(input.CopyTags !== undefined && { CopyTags: input.CopyTags }), - ...(input.CreateRule !== undefined && { CreateRule: serializeAws_restJson1CreateRule(input.CreateRule, context) }), - ...(input.CrossRegionCopyRules !== undefined && { - CrossRegionCopyRules: serializeAws_restJson1CrossRegionCopyRules(input.CrossRegionCopyRules, context), - }), - ...(input.FastRestoreRule !== undefined && { - FastRestoreRule: serializeAws_restJson1FastRestoreRule(input.FastRestoreRule, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RetainRule !== undefined && { RetainRule: serializeAws_restJson1RetainRule(input.RetainRule, context) }), - ...(input.TagsToAdd !== undefined && { TagsToAdd: serializeAws_restJson1TagsToAddList(input.TagsToAdd, context) }), - ...(input.VariableTags !== undefined && { - VariableTags: serializeAws_restJson1VariableTagsList(input.VariableTags, context), - }), + ...(input.CopyTags !== undefined && input.CopyTags !== null && { CopyTags: input.CopyTags }), + ...(input.CreateRule !== undefined && + input.CreateRule !== null && { CreateRule: serializeAws_restJson1CreateRule(input.CreateRule, context) }), + ...(input.CrossRegionCopyRules !== undefined && + input.CrossRegionCopyRules !== null && { + CrossRegionCopyRules: serializeAws_restJson1CrossRegionCopyRules(input.CrossRegionCopyRules, context), + }), + ...(input.FastRestoreRule !== undefined && + input.FastRestoreRule !== null && { + FastRestoreRule: serializeAws_restJson1FastRestoreRule(input.FastRestoreRule, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RetainRule !== undefined && + input.RetainRule !== null && { RetainRule: serializeAws_restJson1RetainRule(input.RetainRule, context) }), + ...(input.TagsToAdd !== undefined && + input.TagsToAdd !== null && { TagsToAdd: serializeAws_restJson1TagsToAddList(input.TagsToAdd, context) }), + ...(input.VariableTags !== undefined && + input.VariableTags !== null && { + VariableTags: serializeAws_restJson1VariableTagsList(input.VariableTags, context), + }), }; }; const serializeAws_restJson1ScheduleList = (input: Schedule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Schedule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Schedule(entry, context); + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TagsToAddList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TargetTagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TimesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1VariableTagsList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1AvailabilityZoneList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1CreateRule = (output: any, context: __SerdeContext): CreateRule => { @@ -1163,7 +1235,14 @@ const deserializeAws_restJson1CrossRegionCopyRule = (output: any, context: __Ser }; const deserializeAws_restJson1CrossRegionCopyRules = (output: any, context: __SerdeContext): CrossRegionCopyRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CrossRegionCopyRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CrossRegionCopyRule(entry, context); + }); }; const deserializeAws_restJson1FastRestoreRule = (output: any, context: __SerdeContext): FastRestoreRule => { @@ -1227,11 +1306,25 @@ const deserializeAws_restJson1LifecyclePolicySummaryList = ( output: any, context: __SerdeContext ): LifecyclePolicySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LifecyclePolicySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LifecyclePolicySummary(entry, context); + }); }; const deserializeAws_restJson1ParameterList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1_Parameters = (output: any, context: __SerdeContext): _Parameters => { @@ -1267,14 +1360,28 @@ const deserializeAws_restJson1PolicyDetails = (output: any, context: __SerdeCont }; const deserializeAws_restJson1PolicyIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ResourceTypeValuesList = ( output: any, context: __SerdeContext ): (ResourceTypeValues | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1RetainRule = (output: any, context: __SerdeContext): RetainRule => { @@ -1317,7 +1424,14 @@ const deserializeAws_restJson1Schedule = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1ScheduleList = (output: any, context: __SerdeContext): Schedule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Schedule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Schedule(entry, context); + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -1328,29 +1442,59 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TagsToAddList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TargetTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TimesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1VariableTagsList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1373,6 +1517,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-docdb/protocols/Aws_query.ts b/clients/client-docdb/protocols/Aws_query.ts index 140ce6338111..4802ae6999ac 100644 --- a/clients/client-docdb/protocols/Aws_query.ts +++ b/clients/client-docdb/protocols/Aws_query.ts @@ -302,7 +302,7 @@ export const serializeAws_queryAddTagsToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -318,7 +318,7 @@ export const serializeAws_queryApplyPendingMaintenanceActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -334,7 +334,7 @@ export const serializeAws_queryCopyDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -350,7 +350,7 @@ export const serializeAws_queryCopyDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -366,7 +366,7 @@ export const serializeAws_queryCreateDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -382,7 +382,7 @@ export const serializeAws_queryCreateDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -398,7 +398,7 @@ export const serializeAws_queryCreateDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -414,7 +414,7 @@ export const serializeAws_queryCreateDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -430,7 +430,7 @@ export const serializeAws_queryCreateDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -446,7 +446,7 @@ export const serializeAws_queryDeleteDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -462,7 +462,7 @@ export const serializeAws_queryDeleteDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -478,7 +478,7 @@ export const serializeAws_queryDeleteDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -494,7 +494,7 @@ export const serializeAws_queryDeleteDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -510,7 +510,7 @@ export const serializeAws_queryDeleteDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -526,7 +526,7 @@ export const serializeAws_queryDescribeCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -542,7 +542,7 @@ export const serializeAws_queryDescribeDBClusterParameterGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -558,7 +558,7 @@ export const serializeAws_queryDescribeDBClusterParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -574,7 +574,7 @@ export const serializeAws_queryDescribeDBClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -590,7 +590,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotAttributesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -606,7 +606,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -622,7 +622,7 @@ export const serializeAws_queryDescribeDBEngineVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -638,7 +638,7 @@ export const serializeAws_queryDescribeDBInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -654,7 +654,7 @@ export const serializeAws_queryDescribeDBSubnetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -670,7 +670,7 @@ export const serializeAws_queryDescribeEngineDefaultClusterParametersCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -686,7 +686,7 @@ export const serializeAws_queryDescribeEventCategoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -702,7 +702,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -718,7 +718,7 @@ export const serializeAws_queryDescribeOrderableDBInstanceOptionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -734,7 +734,7 @@ export const serializeAws_queryDescribePendingMaintenanceActionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -750,7 +750,7 @@ export const serializeAws_queryFailoverDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -766,7 +766,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -782,7 +782,7 @@ export const serializeAws_queryModifyDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -798,7 +798,7 @@ export const serializeAws_queryModifyDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -814,7 +814,7 @@ export const serializeAws_queryModifyDBClusterSnapshotAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -830,7 +830,7 @@ export const serializeAws_queryModifyDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -846,7 +846,7 @@ export const serializeAws_queryModifyDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -862,7 +862,7 @@ export const serializeAws_queryRebootDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -878,7 +878,7 @@ export const serializeAws_queryRemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -894,7 +894,7 @@ export const serializeAws_queryResetDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -910,7 +910,7 @@ export const serializeAws_queryRestoreDBClusterFromSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -926,7 +926,7 @@ export const serializeAws_queryRestoreDBClusterToPointInTimeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -942,7 +942,7 @@ export const serializeAws_queryStartDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -958,7 +958,7 @@ export const serializeAws_queryStopDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4886,14 +4886,14 @@ const deserializeAws_querySubnetAlreadyInUseResponse = async ( const serializeAws_queryAddTagsToResourceMessage = (input: AddTagsToResourceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } return entries; @@ -4904,13 +4904,13 @@ const serializeAws_queryApplyPendingMaintenanceActionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ApplyAction !== undefined) { + if (input.ApplyAction !== undefined && input.ApplyAction !== null) { entries["ApplyAction"] = input.ApplyAction; } - if (input.ResourceIdentifier !== undefined) { + if (input.ResourceIdentifier !== undefined && input.ResourceIdentifier !== null) { entries["ResourceIdentifier"] = input.ResourceIdentifier; } - if (input.OptInType !== undefined) { + if (input.OptInType !== undefined && input.OptInType !== null) { entries["OptInType"] = input.OptInType; } return entries; @@ -4920,6 +4920,9 @@ const serializeAws_queryAttributeValueList = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AttributeValue.${counter}`] = entry; counter++; } @@ -4930,6 +4933,9 @@ const serializeAws_queryAvailabilityZones = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AvailabilityZone.${counter}`] = entry; counter++; } @@ -4941,14 +4947,14 @@ const serializeAws_queryCloudwatchLogsExportConfiguration = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DisableLogTypes !== undefined) { + if (input.DisableLogTypes !== undefined && input.DisableLogTypes !== null) { const memberEntries = serializeAws_queryLogTypeList(input.DisableLogTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DisableLogTypes.${key}`; entries[loc] = value; }); } - if (input.EnableLogTypes !== undefined) { + if (input.EnableLogTypes !== undefined && input.EnableLogTypes !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableLogTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableLogTypes.${key}`; @@ -4963,20 +4969,29 @@ const serializeAws_queryCopyDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.TargetDBClusterParameterGroupIdentifier !== undefined) { + if ( + input.TargetDBClusterParameterGroupIdentifier !== undefined && + input.TargetDBClusterParameterGroupIdentifier !== null + ) { entries["TargetDBClusterParameterGroupIdentifier"] = input.TargetDBClusterParameterGroupIdentifier; } - if (input.TargetDBClusterParameterGroupDescription !== undefined) { + if ( + input.TargetDBClusterParameterGroupDescription !== undefined && + input.TargetDBClusterParameterGroupDescription !== null + ) { entries["TargetDBClusterParameterGroupDescription"] = input.TargetDBClusterParameterGroupDescription; } - if (input.SourceDBClusterParameterGroupIdentifier !== undefined) { + if ( + input.SourceDBClusterParameterGroupIdentifier !== undefined && + input.SourceDBClusterParameterGroupIdentifier !== null + ) { entries["SourceDBClusterParameterGroupIdentifier"] = input.SourceDBClusterParameterGroupIdentifier; } return entries; @@ -4987,26 +5002,26 @@ const serializeAws_queryCopyDBClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.TargetDBClusterSnapshotIdentifier !== undefined) { + if (input.TargetDBClusterSnapshotIdentifier !== undefined && input.TargetDBClusterSnapshotIdentifier !== null) { entries["TargetDBClusterSnapshotIdentifier"] = input.TargetDBClusterSnapshotIdentifier; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.PreSignedUrl !== undefined) { + if (input.PreSignedUrl !== undefined && input.PreSignedUrl !== null) { entries["PreSignedUrl"] = input.PreSignedUrl; } - if (input.CopyTags !== undefined) { + if (input.CopyTags !== undefined && input.CopyTags !== null) { entries["CopyTags"] = input.CopyTags; } - if (input.SourceDBClusterSnapshotIdentifier !== undefined) { + if (input.SourceDBClusterSnapshotIdentifier !== undefined && input.SourceDBClusterSnapshotIdentifier !== null) { entries["SourceDBClusterSnapshotIdentifier"] = input.SourceDBClusterSnapshotIdentifier; } return entries; @@ -5014,77 +5029,77 @@ const serializeAws_queryCopyDBClusterSnapshotMessage = ( const serializeAws_queryCreateDBClusterMessage = (input: CreateDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.StorageEncrypted !== undefined) { + if (input.StorageEncrypted !== undefined && input.StorageEncrypted !== null) { entries["StorageEncrypted"] = input.StorageEncrypted; } - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.MasterUsername !== undefined) { + if (input.MasterUsername !== undefined && input.MasterUsername !== null) { entries["MasterUsername"] = input.MasterUsername; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.PreSignedUrl !== undefined) { + if (input.PreSignedUrl !== undefined && input.PreSignedUrl !== null) { entries["PreSignedUrl"] = input.PreSignedUrl; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } return entries; @@ -5095,20 +5110,20 @@ const serializeAws_queryCreateDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } return entries; @@ -5119,13 +5134,13 @@ const serializeAws_queryCreateDBClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -5137,35 +5152,35 @@ const serializeAws_queryCreateDBClusterSnapshotMessage = ( const serializeAws_queryCreateDBInstanceMessage = (input: CreateDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.PromotionTier !== undefined) { + if (input.PromotionTier !== undefined && input.PromotionTier !== null) { entries["PromotionTier"] = input.PromotionTier; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } return entries; @@ -5176,24 +5191,24 @@ const serializeAws_queryCreateDBSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSubnetGroupDescription !== undefined) { + if (input.DBSubnetGroupDescription !== undefined && input.DBSubnetGroupDescription !== null) { entries["DBSubnetGroupDescription"] = input.DBSubnetGroupDescription; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } return entries; @@ -5201,13 +5216,13 @@ const serializeAws_queryCreateDBSubnetGroupMessage = ( const serializeAws_queryDeleteDBClusterMessage = (input: DeleteDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SkipFinalSnapshot !== undefined) { + if (input.SkipFinalSnapshot !== undefined && input.SkipFinalSnapshot !== null) { entries["SkipFinalSnapshot"] = input.SkipFinalSnapshot; } - if (input.FinalDBSnapshotIdentifier !== undefined) { + if (input.FinalDBSnapshotIdentifier !== undefined && input.FinalDBSnapshotIdentifier !== null) { entries["FinalDBSnapshotIdentifier"] = input.FinalDBSnapshotIdentifier; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -5218,7 +5233,7 @@ const serializeAws_queryDeleteDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } return entries; @@ -5229,7 +5244,7 @@ const serializeAws_queryDeleteDBClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } return entries; @@ -5237,7 +5252,7 @@ const serializeAws_queryDeleteDBClusterSnapshotMessage = ( const serializeAws_queryDeleteDBInstanceMessage = (input: DeleteDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } return entries; @@ -5248,7 +5263,7 @@ const serializeAws_queryDeleteDBSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } return entries; @@ -5259,20 +5274,20 @@ const serializeAws_queryDescribeCertificatesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.CertificateIdentifier !== undefined) { + if (input.CertificateIdentifier !== undefined && input.CertificateIdentifier !== null) { entries["CertificateIdentifier"] = input.CertificateIdentifier; } return entries; @@ -5283,20 +5298,20 @@ const serializeAws_queryDescribeDBClusterParameterGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -5307,23 +5322,23 @@ const serializeAws_queryDescribeDBClusterParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -5334,16 +5349,16 @@ const serializeAws_queryDescribeDBClustersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -5358,7 +5373,7 @@ const serializeAws_queryDescribeDBClusterSnapshotAttributesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } return entries; @@ -5369,32 +5384,32 @@ const serializeAws_queryDescribeDBClusterSnapshotsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.IncludeShared !== undefined) { + if (input.IncludeShared !== undefined && input.IncludeShared !== null) { entries["IncludeShared"] = input.IncludeShared; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.IncludePublic !== undefined) { + if (input.IncludePublic !== undefined && input.IncludePublic !== null) { entries["IncludePublic"] = input.IncludePublic; } - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } - if (input.SnapshotType !== undefined) { + if (input.SnapshotType !== undefined && input.SnapshotType !== null) { entries["SnapshotType"] = input.SnapshotType; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -5405,35 +5420,35 @@ const serializeAws_queryDescribeDBEngineVersionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.ListSupportedTimezones !== undefined) { + if (input.ListSupportedTimezones !== undefined && input.ListSupportedTimezones !== null) { entries["ListSupportedTimezones"] = input.ListSupportedTimezones; } - if (input.ListSupportedCharacterSets !== undefined) { + if (input.ListSupportedCharacterSets !== undefined && input.ListSupportedCharacterSets !== null) { entries["ListSupportedCharacterSets"] = input.ListSupportedCharacterSets; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.DefaultOnly !== undefined) { + if (input.DefaultOnly !== undefined && input.DefaultOnly !== null) { entries["DefaultOnly"] = input.DefaultOnly; } - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5444,20 +5459,20 @@ const serializeAws_queryDescribeDBInstancesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } return entries; @@ -5468,20 +5483,20 @@ const serializeAws_queryDescribeDBSubnetGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -5492,16 +5507,16 @@ const serializeAws_queryDescribeEngineDefaultClusterParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -5516,14 +5531,14 @@ const serializeAws_queryDescribeEventCategoriesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } return entries; @@ -5531,35 +5546,35 @@ const serializeAws_queryDescribeEventCategoriesMessage = ( const serializeAws_queryDescribeEventsMessage = (input: DescribeEventsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.EventCategories !== undefined) { + if (input.EventCategories !== undefined && input.EventCategories !== null) { const memberEntries = serializeAws_queryEventCategoriesList(input.EventCategories, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventCategories.${key}`; entries[loc] = value; }); } - if (input.Duration !== undefined) { + if (input.Duration !== undefined && input.Duration !== null) { entries["Duration"] = input.Duration; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.SourceIdentifier !== undefined) { + if (input.SourceIdentifier !== undefined && input.SourceIdentifier !== null) { entries["SourceIdentifier"] = input.SourceIdentifier; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -5574,32 +5589,32 @@ const serializeAws_queryDescribeOrderableDBInstanceOptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.Vpc !== undefined) { + if (input.Vpc !== undefined && input.Vpc !== null) { entries["Vpc"] = input.Vpc; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } return entries; @@ -5610,20 +5625,20 @@ const serializeAws_queryDescribePendingMaintenanceActionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.ResourceIdentifier !== undefined) { + if (input.ResourceIdentifier !== undefined && input.ResourceIdentifier !== null) { entries["ResourceIdentifier"] = input.ResourceIdentifier; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -5633,6 +5648,9 @@ const serializeAws_queryEventCategoriesList = (input: string[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`EventCategory.${counter}`] = entry; counter++; } @@ -5641,10 +5659,10 @@ const serializeAws_queryEventCategoriesList = (input: string[], context: __Serde const serializeAws_queryFailoverDBClusterMessage = (input: FailoverDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.TargetDBInstanceIdentifier !== undefined) { + if (input.TargetDBInstanceIdentifier !== undefined && input.TargetDBInstanceIdentifier !== null) { entries["TargetDBInstanceIdentifier"] = input.TargetDBInstanceIdentifier; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -5652,14 +5670,14 @@ const serializeAws_queryFailoverDBClusterMessage = (input: FailoverDBClusterMess const serializeAws_queryFilter = (input: Filter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryFilterValueList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; entries[loc] = value; }); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -5669,6 +5687,9 @@ const serializeAws_queryFilterList = (input: Filter[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Filter.${counter}.${key}`] = value; @@ -5682,6 +5703,9 @@ const serializeAws_queryFilterValueList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Value.${counter}`] = entry; counter++; } @@ -5692,6 +5716,9 @@ const serializeAws_queryKeyList = (input: string[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5703,14 +5730,14 @@ const serializeAws_queryListTagsForResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } return entries; @@ -5720,6 +5747,9 @@ const serializeAws_queryLogTypeList = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5728,22 +5758,22 @@ const serializeAws_queryLogTypeList = (input: string[], context: __SerdeContext) const serializeAws_queryModifyDBClusterMessage = (input: ModifyDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.NewDBClusterIdentifier !== undefined) { + if (input.NewDBClusterIdentifier !== undefined && input.NewDBClusterIdentifier !== null) { entries["NewDBClusterIdentifier"] = input.NewDBClusterIdentifier; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.CloudwatchLogsExportConfiguration !== undefined) { + if (input.CloudwatchLogsExportConfiguration !== undefined && input.CloudwatchLogsExportConfiguration !== null) { const memberEntries = serializeAws_queryCloudwatchLogsExportConfiguration( input.CloudwatchLogsExportConfiguration, context @@ -5753,29 +5783,29 @@ const serializeAws_queryModifyDBClusterMessage = (input: ModifyDBClusterMessage, entries[loc] = value; }); } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } return entries; @@ -5786,14 +5816,14 @@ const serializeAws_queryModifyDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; entries[loc] = value; }); } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } return entries; @@ -5804,20 +5834,20 @@ const serializeAws_queryModifyDBClusterSnapshotAttributeMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AttributeName !== undefined) { + if (input.AttributeName !== undefined && input.AttributeName !== null) { entries["AttributeName"] = input.AttributeName; } - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } - if (input.ValuesToAdd !== undefined) { + if (input.ValuesToAdd !== undefined && input.ValuesToAdd !== null) { const memberEntries = serializeAws_queryAttributeValueList(input.ValuesToAdd, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ValuesToAdd.${key}`; entries[loc] = value; }); } - if (input.ValuesToRemove !== undefined) { + if (input.ValuesToRemove !== undefined && input.ValuesToRemove !== null) { const memberEntries = serializeAws_queryAttributeValueList(input.ValuesToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ValuesToRemove.${key}`; @@ -5829,28 +5859,28 @@ const serializeAws_queryModifyDBClusterSnapshotAttributeMessage = ( const serializeAws_queryModifyDBInstanceMessage = (input: ModifyDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.PromotionTier !== undefined) { + if (input.PromotionTier !== undefined && input.PromotionTier !== null) { entries["PromotionTier"] = input.PromotionTier; } - if (input.CACertificateIdentifier !== undefined) { + if (input.CACertificateIdentifier !== undefined && input.CACertificateIdentifier !== null) { entries["CACertificateIdentifier"] = input.CACertificateIdentifier; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.NewDBInstanceIdentifier !== undefined) { + if (input.NewDBInstanceIdentifier !== undefined && input.NewDBInstanceIdentifier !== null) { entries["NewDBInstanceIdentifier"] = input.NewDBInstanceIdentifier; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } return entries; @@ -5861,17 +5891,17 @@ const serializeAws_queryModifyDBSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; entries[loc] = value; }); } - if (input.DBSubnetGroupDescription !== undefined) { + if (input.DBSubnetGroupDescription !== undefined && input.DBSubnetGroupDescription !== null) { entries["DBSubnetGroupDescription"] = input.DBSubnetGroupDescription; } return entries; @@ -5879,34 +5909,34 @@ const serializeAws_queryModifyDBSubnetGroupMessage = ( const serializeAws_queryParameter = (input: Parameter, context: __SerdeContext): any => { const entries: any = {}; - if (input.ParameterValue !== undefined) { + if (input.ParameterValue !== undefined && input.ParameterValue !== null) { entries["ParameterValue"] = input.ParameterValue; } - if (input.ApplyType !== undefined) { + if (input.ApplyType !== undefined && input.ApplyType !== null) { entries["ApplyType"] = input.ApplyType; } - if (input.DataType !== undefined) { + if (input.DataType !== undefined && input.DataType !== null) { entries["DataType"] = input.DataType; } - if (input.ParameterName !== undefined) { + if (input.ParameterName !== undefined && input.ParameterName !== null) { entries["ParameterName"] = input.ParameterName; } - if (input.AllowedValues !== undefined) { + if (input.AllowedValues !== undefined && input.AllowedValues !== null) { entries["AllowedValues"] = input.AllowedValues; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.IsModifiable !== undefined) { + if (input.IsModifiable !== undefined && input.IsModifiable !== null) { entries["IsModifiable"] = input.IsModifiable; } - if (input.MinimumEngineVersion !== undefined) { + if (input.MinimumEngineVersion !== undefined && input.MinimumEngineVersion !== null) { entries["MinimumEngineVersion"] = input.MinimumEngineVersion; } - if (input.ApplyMethod !== undefined) { + if (input.ApplyMethod !== undefined && input.ApplyMethod !== null) { entries["ApplyMethod"] = input.ApplyMethod; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -5916,6 +5946,9 @@ const serializeAws_queryParametersList = (input: Parameter[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryParameter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Parameter.${counter}.${key}`] = value; @@ -5927,10 +5960,10 @@ const serializeAws_queryParametersList = (input: Parameter[], context: __SerdeCo const serializeAws_queryRebootDBInstanceMessage = (input: RebootDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ForceFailover !== undefined) { + if (input.ForceFailover !== undefined && input.ForceFailover !== null) { entries["ForceFailover"] = input.ForceFailover; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } return entries; @@ -5941,10 +5974,10 @@ const serializeAws_queryRemoveTagsFromResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; @@ -5959,13 +5992,13 @@ const serializeAws_queryResetDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.ResetAllParameters !== undefined) { + if (input.ResetAllParameters !== undefined && input.ResetAllParameters !== null) { entries["ResetAllParameters"] = input.ResetAllParameters; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -5980,52 +6013,52 @@ const serializeAws_queryRestoreDBClusterFromSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; @@ -6040,49 +6073,49 @@ const serializeAws_queryRestoreDBClusterToPointInTimeMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.SourceDBClusterIdentifier !== undefined) { + if (input.SourceDBClusterIdentifier !== undefined && input.SourceDBClusterIdentifier !== null) { entries["SourceDBClusterIdentifier"] = input.SourceDBClusterIdentifier; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.RestoreToTime !== undefined) { + if (input.RestoreToTime !== undefined && input.RestoreToTime !== null) { entries["RestoreToTime"] = input.RestoreToTime.toISOString().split(".")[0] + "Z"; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.UseLatestRestorableTime !== undefined) { + if (input.UseLatestRestorableTime !== undefined && input.UseLatestRestorableTime !== null) { entries["UseLatestRestorableTime"] = input.UseLatestRestorableTime; } return entries; @@ -6090,7 +6123,7 @@ const serializeAws_queryRestoreDBClusterToPointInTimeMessage = ( const serializeAws_queryStartDBClusterMessage = (input: StartDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -6098,7 +6131,7 @@ const serializeAws_queryStartDBClusterMessage = (input: StartDBClusterMessage, c const serializeAws_queryStopDBClusterMessage = (input: StopDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -6108,6 +6141,9 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SubnetIdentifier.${counter}`] = entry; counter++; } @@ -6116,10 +6152,10 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } return entries; @@ -6129,6 +6165,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Tag.${counter}.${key}`] = value; @@ -6142,6 +6181,9 @@ const serializeAws_queryVpcSecurityGroupIdList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`VpcSecurityGroupId.${counter}`] = entry; counter++; } @@ -6165,7 +6207,14 @@ const deserializeAws_queryApplyPendingMaintenanceActionResult = ( }; const deserializeAws_queryAttributeValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryAuthorizationNotFoundFault = ( @@ -6192,11 +6241,25 @@ const deserializeAws_queryAvailabilityZone = (output: any, context: __SerdeConte }; const deserializeAws_queryAvailabilityZoneList = (output: any, context: __SerdeContext): AvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_queryAvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAvailabilityZone(entry, context); + }); }; const deserializeAws_queryAvailabilityZones = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryCertificate = (output: any, context: __SerdeContext): Certificate => { @@ -6230,7 +6293,14 @@ const deserializeAws_queryCertificate = (output: any, context: __SerdeContext): }; const deserializeAws_queryCertificateList = (output: any, context: __SerdeContext): Certificate[] => { - return (output || []).map((entry: any) => deserializeAws_queryCertificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCertificate(entry, context); + }); }; const deserializeAws_queryCertificateMessage = (output: any, context: __SerdeContext): CertificateMessage => { @@ -6529,7 +6599,14 @@ const deserializeAws_queryDBClusterAlreadyExistsFault = ( }; const deserializeAws_queryDBClusterList = (output: any, context: __SerdeContext): DBCluster[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBCluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBCluster(entry, context); + }); }; const deserializeAws_queryDBClusterMember = (output: any, context: __SerdeContext): DBClusterMember => { @@ -6555,7 +6632,14 @@ const deserializeAws_queryDBClusterMember = (output: any, context: __SerdeContex }; const deserializeAws_queryDBClusterMemberList = (output: any, context: __SerdeContext): DBClusterMember[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterMember(entry, context); + }); }; const deserializeAws_queryDBClusterMessage = (output: any, context: __SerdeContext): DBClusterMessage => { @@ -6637,7 +6721,14 @@ const deserializeAws_queryDBClusterParameterGroupList = ( output: any, context: __SerdeContext ): DBClusterParameterGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterParameterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterParameterGroup(entry, context); + }); }; const deserializeAws_queryDBClusterParameterGroupNameMessage = ( @@ -6720,7 +6811,14 @@ const deserializeAws_queryDBClusterRole = (output: any, context: __SerdeContext) }; const deserializeAws_queryDBClusterRoles = (output: any, context: __SerdeContext): DBClusterRole[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterRole(entry, context); + }); }; const deserializeAws_queryDBClusterSnapshot = (output: any, context: __SerdeContext): DBClusterSnapshot => { @@ -6843,7 +6941,14 @@ const deserializeAws_queryDBClusterSnapshotAttributeList = ( output: any, context: __SerdeContext ): DBClusterSnapshotAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterSnapshotAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterSnapshotAttribute(entry, context); + }); }; const deserializeAws_queryDBClusterSnapshotAttributesResult = ( @@ -6873,7 +6978,14 @@ const deserializeAws_queryDBClusterSnapshotAttributesResult = ( }; const deserializeAws_queryDBClusterSnapshotList = (output: any, context: __SerdeContext): DBClusterSnapshot[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterSnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterSnapshot(entry, context); + }); }; const deserializeAws_queryDBClusterSnapshotMessage = ( @@ -6963,7 +7075,14 @@ const deserializeAws_queryDBEngineVersion = (output: any, context: __SerdeContex }; const deserializeAws_queryDBEngineVersionList = (output: any, context: __SerdeContext): DBEngineVersion[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBEngineVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBEngineVersion(entry, context); + }); }; const deserializeAws_queryDBEngineVersionMessage = (output: any, context: __SerdeContext): DBEngineVersionMessage => { @@ -7137,7 +7256,14 @@ const deserializeAws_queryDBInstanceAlreadyExistsFault = ( }; const deserializeAws_queryDBInstanceList = (output: any, context: __SerdeContext): DBInstance[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBInstance(entry, context); + }); }; const deserializeAws_queryDBInstanceMessage = (output: any, context: __SerdeContext): DBInstanceMessage => { @@ -7193,7 +7319,14 @@ const deserializeAws_queryDBInstanceStatusInfo = (output: any, context: __SerdeC }; const deserializeAws_queryDBInstanceStatusInfoList = (output: any, context: __SerdeContext): DBInstanceStatusInfo[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBInstanceStatusInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBInstanceStatusInfo(entry, context); + }); }; const deserializeAws_queryDBParameterGroupAlreadyExistsFault = ( @@ -7377,7 +7510,14 @@ const deserializeAws_queryDBSubnetGroupQuotaExceededFault = ( }; const deserializeAws_queryDBSubnetGroups = (output: any, context: __SerdeContext): DBSubnetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBSubnetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBSubnetGroup(entry, context); + }); }; const deserializeAws_queryDBSubnetQuotaExceededFault = ( @@ -7547,7 +7687,14 @@ const deserializeAws_queryEvent = (output: any, context: __SerdeContext): Event }; const deserializeAws_queryEventCategoriesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryEventCategoriesMap = (output: any, context: __SerdeContext): EventCategoriesMap => { @@ -7571,7 +7718,14 @@ const deserializeAws_queryEventCategoriesMap = (output: any, context: __SerdeCon }; const deserializeAws_queryEventCategoriesMapList = (output: any, context: __SerdeContext): EventCategoriesMap[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventCategoriesMap(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventCategoriesMap(entry, context); + }); }; const deserializeAws_queryEventCategoriesMessage = (output: any, context: __SerdeContext): EventCategoriesMessage => { @@ -7594,7 +7748,14 @@ const deserializeAws_queryEventCategoriesMessage = (output: any, context: __Serd }; const deserializeAws_queryEventList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_queryEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEvent(entry, context); + }); }; const deserializeAws_queryEventsMessage = (output: any, context: __SerdeContext): EventsMessage => { @@ -7827,7 +7988,14 @@ const deserializeAws_queryKMSKeyNotAccessibleFault = ( }; const deserializeAws_queryLogTypeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryModifyDBClusterResult = (output: any, context: __SerdeContext): ModifyDBClusterResult => { @@ -7922,7 +8090,14 @@ const deserializeAws_queryOrderableDBInstanceOptionsList = ( output: any, context: __SerdeContext ): OrderableDBInstanceOption[] => { - return (output || []).map((entry: any) => deserializeAws_queryOrderableDBInstanceOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOrderableDBInstanceOption(entry, context); + }); }; const deserializeAws_queryOrderableDBInstanceOptionsMessage = ( @@ -7998,7 +8173,14 @@ const deserializeAws_queryParameter = (output: any, context: __SerdeContext): Pa }; const deserializeAws_queryParametersList = (output: any, context: __SerdeContext): Parameter[] => { - return (output || []).map((entry: any) => deserializeAws_queryParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryParameter(entry, context); + }); }; const deserializeAws_queryPendingCloudwatchLogsExports = ( @@ -8067,14 +8249,28 @@ const deserializeAws_queryPendingMaintenanceActionDetails = ( output: any, context: __SerdeContext ): PendingMaintenanceAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryPendingMaintenanceAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPendingMaintenanceAction(entry, context); + }); }; const deserializeAws_queryPendingMaintenanceActions = ( output: any, context: __SerdeContext ): ResourcePendingMaintenanceActions[] => { - return (output || []).map((entry: any) => deserializeAws_queryResourcePendingMaintenanceActions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryResourcePendingMaintenanceActions(entry, context); + }); }; const deserializeAws_queryPendingMaintenanceActionsMessage = ( @@ -8341,7 +8537,14 @@ const deserializeAws_querySubnetAlreadyInUse = (output: any, context: __SerdeCon }; const deserializeAws_querySubnetList = (output: any, context: __SerdeContext): Subnet[] => { - return (output || []).map((entry: any) => deserializeAws_querySubnet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySubnet(entry, context); + }); }; const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { @@ -8359,7 +8562,14 @@ const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTagListMessage = (output: any, context: __SerdeContext): TagListMessage => { @@ -8402,7 +8612,14 @@ const deserializeAws_queryUpgradeTarget = (output: any, context: __SerdeContext) }; const deserializeAws_queryValidUpgradeTargetList = (output: any, context: __SerdeContext): UpgradeTarget[] => { - return (output || []).map((entry: any) => deserializeAws_queryUpgradeTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUpgradeTarget(entry, context); + }); }; const deserializeAws_queryVpcSecurityGroupMembership = ( @@ -8426,7 +8643,14 @@ const deserializeAws_queryVpcSecurityGroupMembershipList = ( output: any, context: __SerdeContext ): VpcSecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryVpcSecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryVpcSecurityGroupMembership(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ diff --git a/clients/client-dynamodb-streams/protocols/Aws_json1_0.ts b/clients/client-dynamodb-streams/protocols/Aws_json1_0.ts index 67907224df36..0f291bef721a 100644 --- a/clients/client-dynamodb-streams/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb-streams/protocols/Aws_json1_0.ts @@ -41,7 +41,7 @@ export const serializeAws_json1_0DescribeStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDBStreams_20120810.DescribeStream", }; let body: any; @@ -54,7 +54,7 @@ export const serializeAws_json1_0GetRecordsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDBStreams_20120810.GetRecords", }; let body: any; @@ -67,7 +67,7 @@ export const serializeAws_json1_0GetShardIteratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDBStreams_20120810.GetShardIterator", }; let body: any; @@ -80,7 +80,7 @@ export const serializeAws_json1_0ListStreamsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDBStreams_20120810.ListStreams", }; let body: any; @@ -115,8 +115,7 @@ const deserializeAws_json1_0DescribeStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodbstreams#InternalServerError": @@ -178,8 +177,7 @@ const deserializeAws_json1_0GetRecordsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExpiredIteratorException": case "com.amazonaws.dynamodbstreams#ExpiredIteratorException": @@ -265,8 +263,7 @@ const deserializeAws_json1_0GetShardIteratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodbstreams#InternalServerError": @@ -336,8 +333,7 @@ const deserializeAws_json1_0ListStreamsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodbstreams#InternalServerError": @@ -449,33 +445,37 @@ const deserializeAws_json1_0TrimmedDataAccessExceptionResponse = async ( const serializeAws_json1_0DescribeStreamInput = (input: DescribeStreamInput, context: __SerdeContext): any => { return { - ...(input.ExclusiveStartShardId !== undefined && { ExclusiveStartShardId: input.ExclusiveStartShardId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.StreamArn !== undefined && { StreamArn: input.StreamArn }), + ...(input.ExclusiveStartShardId !== undefined && + input.ExclusiveStartShardId !== null && { ExclusiveStartShardId: input.ExclusiveStartShardId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.StreamArn !== undefined && input.StreamArn !== null && { StreamArn: input.StreamArn }), }; }; const serializeAws_json1_0GetRecordsInput = (input: GetRecordsInput, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.ShardIterator !== undefined && { ShardIterator: input.ShardIterator }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.ShardIterator !== undefined && input.ShardIterator !== null && { ShardIterator: input.ShardIterator }), }; }; const serializeAws_json1_0GetShardIteratorInput = (input: GetShardIteratorInput, context: __SerdeContext): any => { return { - ...(input.SequenceNumber !== undefined && { SequenceNumber: input.SequenceNumber }), - ...(input.ShardId !== undefined && { ShardId: input.ShardId }), - ...(input.ShardIteratorType !== undefined && { ShardIteratorType: input.ShardIteratorType }), - ...(input.StreamArn !== undefined && { StreamArn: input.StreamArn }), + ...(input.SequenceNumber !== undefined && + input.SequenceNumber !== null && { SequenceNumber: input.SequenceNumber }), + ...(input.ShardId !== undefined && input.ShardId !== null && { ShardId: input.ShardId }), + ...(input.ShardIteratorType !== undefined && + input.ShardIteratorType !== null && { ShardIteratorType: input.ShardIteratorType }), + ...(input.StreamArn !== undefined && input.StreamArn !== null && { StreamArn: input.StreamArn }), }; }; const serializeAws_json1_0ListStreamsInput = (input: ListStreamsInput, context: __SerdeContext): any => { return { - ...(input.ExclusiveStartStreamArn !== undefined && { ExclusiveStartStreamArn: input.ExclusiveStartStreamArn }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ExclusiveStartStreamArn !== undefined && + input.ExclusiveStartStreamArn !== null && { ExclusiveStartStreamArn: input.ExclusiveStartStreamArn }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -483,13 +483,15 @@ const deserializeAws_json1_0AttributeMap = ( output: any, context: __SerdeContext ): { [key: string]: AttributeValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0AttributeValue = (output: any, context: __SerdeContext): AttributeValue => { @@ -523,7 +525,14 @@ const deserializeAws_json1_0AttributeValue = (output: any, context: __SerdeConte }; const deserializeAws_json1_0BinarySetAttributeValue = (output: any, context: __SerdeContext): Uint8Array[] => { - return (output || []).map((entry: any) => context.base64Decoder(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return context.base64Decoder(entry); + }); }; const deserializeAws_json1_0DescribeStreamOutput = (output: any, context: __SerdeContext): DescribeStreamOutput => { @@ -578,7 +587,14 @@ const deserializeAws_json1_0InternalServerError = (output: any, context: __Serde }; const deserializeAws_json1_0KeySchema = (output: any, context: __SerdeContext): KeySchemaElement[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0KeySchemaElement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0KeySchemaElement(entry, context); + }); }; const deserializeAws_json1_0KeySchemaElement = (output: any, context: __SerdeContext): KeySchemaElement => { @@ -596,7 +612,14 @@ const deserializeAws_json1_0LimitExceededException = (output: any, context: __Se }; const deserializeAws_json1_0ListAttributeValue = (output: any, context: __SerdeContext): AttributeValue[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0AttributeValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0AttributeValue(entry, context); + }); }; const deserializeAws_json1_0ListStreamsOutput = (output: any, context: __SerdeContext): ListStreamsOutput => { @@ -616,17 +639,26 @@ const deserializeAws_json1_0MapAttributeValue = ( output: any, context: __SerdeContext ): { [key: string]: AttributeValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0NumberSetAttributeValue = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0_Record = (output: any, context: __SerdeContext): _Record => { @@ -648,7 +680,14 @@ const deserializeAws_json1_0_Record = (output: any, context: __SerdeContext): _R }; const deserializeAws_json1_0RecordList = (output: any, context: __SerdeContext): _Record[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0_Record(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0_Record(entry, context); + }); }; const deserializeAws_json1_0ResourceNotFoundException = ( @@ -686,7 +725,14 @@ const deserializeAws_json1_0Shard = (output: any, context: __SerdeContext): Shar }; const deserializeAws_json1_0ShardDescriptionList = (output: any, context: __SerdeContext): Shard[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Shard(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Shard(entry, context); + }); }; const deserializeAws_json1_0_Stream = (output: any, context: __SerdeContext): _Stream => { @@ -725,7 +771,14 @@ const deserializeAws_json1_0StreamDescription = (output: any, context: __SerdeCo }; const deserializeAws_json1_0StreamList = (output: any, context: __SerdeContext): _Stream[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0_Stream(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0_Stream(entry, context); + }); }; const deserializeAws_json1_0StreamRecord = (output: any, context: __SerdeContext): StreamRecord => { @@ -755,7 +808,14 @@ const deserializeAws_json1_0StreamRecord = (output: any, context: __SerdeContext }; const deserializeAws_json1_0StringSetAttributeValue = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0TrimmedDataAccessException = ( @@ -817,3 +877,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-dynamodb/protocols/Aws_json1_0.ts b/clients/client-dynamodb/protocols/Aws_json1_0.ts index 67053470b1f6..a18389e24e5b 100644 --- a/clients/client-dynamodb/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb/protocols/Aws_json1_0.ts @@ -337,7 +337,7 @@ export const serializeAws_json1_0BatchExecuteStatementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.BatchExecuteStatement", }; let body: any; @@ -350,7 +350,7 @@ export const serializeAws_json1_0BatchGetItemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.BatchGetItem", }; let body: any; @@ -363,7 +363,7 @@ export const serializeAws_json1_0BatchWriteItemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.BatchWriteItem", }; let body: any; @@ -376,7 +376,7 @@ export const serializeAws_json1_0CreateBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.CreateBackup", }; let body: any; @@ -389,7 +389,7 @@ export const serializeAws_json1_0CreateGlobalTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.CreateGlobalTable", }; let body: any; @@ -402,7 +402,7 @@ export const serializeAws_json1_0CreateTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.CreateTable", }; let body: any; @@ -415,7 +415,7 @@ export const serializeAws_json1_0DeleteBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DeleteBackup", }; let body: any; @@ -428,7 +428,7 @@ export const serializeAws_json1_0DeleteItemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DeleteItem", }; let body: any; @@ -441,7 +441,7 @@ export const serializeAws_json1_0DeleteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DeleteTable", }; let body: any; @@ -454,7 +454,7 @@ export const serializeAws_json1_0DescribeBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeBackup", }; let body: any; @@ -467,7 +467,7 @@ export const serializeAws_json1_0DescribeContinuousBackupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeContinuousBackups", }; let body: any; @@ -480,7 +480,7 @@ export const serializeAws_json1_0DescribeContributorInsightsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeContributorInsights", }; let body: any; @@ -493,7 +493,7 @@ export const serializeAws_json1_0DescribeEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeEndpoints", }; let body: any; @@ -506,7 +506,7 @@ export const serializeAws_json1_0DescribeExportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeExport", }; let body: any; @@ -519,7 +519,7 @@ export const serializeAws_json1_0DescribeGlobalTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeGlobalTable", }; let body: any; @@ -532,7 +532,7 @@ export const serializeAws_json1_0DescribeGlobalTableSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeGlobalTableSettings", }; let body: any; @@ -545,7 +545,7 @@ export const serializeAws_json1_0DescribeKinesisStreamingDestinationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeKinesisStreamingDestination", }; let body: any; @@ -558,7 +558,7 @@ export const serializeAws_json1_0DescribeLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeLimits", }; let body: any; @@ -571,7 +571,7 @@ export const serializeAws_json1_0DescribeTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeTable", }; let body: any; @@ -584,7 +584,7 @@ export const serializeAws_json1_0DescribeTableReplicaAutoScalingCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeTableReplicaAutoScaling", }; let body: any; @@ -597,7 +597,7 @@ export const serializeAws_json1_0DescribeTimeToLiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DescribeTimeToLive", }; let body: any; @@ -610,7 +610,7 @@ export const serializeAws_json1_0DisableKinesisStreamingDestinationCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.DisableKinesisStreamingDestination", }; let body: any; @@ -623,7 +623,7 @@ export const serializeAws_json1_0EnableKinesisStreamingDestinationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.EnableKinesisStreamingDestination", }; let body: any; @@ -636,7 +636,7 @@ export const serializeAws_json1_0ExecuteStatementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.ExecuteStatement", }; let body: any; @@ -649,7 +649,7 @@ export const serializeAws_json1_0ExecuteTransactionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.ExecuteTransaction", }; let body: any; @@ -662,7 +662,7 @@ export const serializeAws_json1_0ExportTableToPointInTimeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.ExportTableToPointInTime", }; let body: any; @@ -675,7 +675,7 @@ export const serializeAws_json1_0GetItemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.GetItem", }; let body: any; @@ -688,7 +688,7 @@ export const serializeAws_json1_0ListBackupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.ListBackups", }; let body: any; @@ -701,7 +701,7 @@ export const serializeAws_json1_0ListContributorInsightsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.ListContributorInsights", }; let body: any; @@ -714,7 +714,7 @@ export const serializeAws_json1_0ListExportsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.ListExports", }; let body: any; @@ -727,7 +727,7 @@ export const serializeAws_json1_0ListGlobalTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.ListGlobalTables", }; let body: any; @@ -740,7 +740,7 @@ export const serializeAws_json1_0ListTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.ListTables", }; let body: any; @@ -753,7 +753,7 @@ export const serializeAws_json1_0ListTagsOfResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.ListTagsOfResource", }; let body: any; @@ -766,7 +766,7 @@ export const serializeAws_json1_0PutItemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.PutItem", }; let body: any; @@ -779,7 +779,7 @@ export const serializeAws_json1_0QueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.Query", }; let body: any; @@ -792,7 +792,7 @@ export const serializeAws_json1_0RestoreTableFromBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.RestoreTableFromBackup", }; let body: any; @@ -805,7 +805,7 @@ export const serializeAws_json1_0RestoreTableToPointInTimeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.RestoreTableToPointInTime", }; let body: any; @@ -818,7 +818,7 @@ export const serializeAws_json1_0ScanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.Scan", }; let body: any; @@ -831,7 +831,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.TagResource", }; let body: any; @@ -844,7 +844,7 @@ export const serializeAws_json1_0TransactGetItemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.TransactGetItems", }; let body: any; @@ -857,7 +857,7 @@ export const serializeAws_json1_0TransactWriteItemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.TransactWriteItems", }; let body: any; @@ -870,7 +870,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.UntagResource", }; let body: any; @@ -883,7 +883,7 @@ export const serializeAws_json1_0UpdateContinuousBackupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.UpdateContinuousBackups", }; let body: any; @@ -896,7 +896,7 @@ export const serializeAws_json1_0UpdateContributorInsightsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.UpdateContributorInsights", }; let body: any; @@ -909,7 +909,7 @@ export const serializeAws_json1_0UpdateGlobalTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.UpdateGlobalTable", }; let body: any; @@ -922,7 +922,7 @@ export const serializeAws_json1_0UpdateGlobalTableSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.UpdateGlobalTableSettings", }; let body: any; @@ -935,7 +935,7 @@ export const serializeAws_json1_0UpdateItemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.UpdateItem", }; let body: any; @@ -948,7 +948,7 @@ export const serializeAws_json1_0UpdateTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.UpdateTable", }; let body: any; @@ -961,7 +961,7 @@ export const serializeAws_json1_0UpdateTableReplicaAutoScalingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.UpdateTableReplicaAutoScaling", }; let body: any; @@ -974,7 +974,7 @@ export const serializeAws_json1_0UpdateTimeToLiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "DynamoDB_20120810.UpdateTimeToLive", }; let body: any; @@ -1009,8 +1009,7 @@ const deserializeAws_json1_0BatchExecuteStatementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -1072,8 +1071,7 @@ const deserializeAws_json1_0BatchGetItemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -1159,8 +1157,7 @@ const deserializeAws_json1_0BatchWriteItemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -1254,8 +1251,7 @@ const deserializeAws_json1_0CreateBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BackupInUseException": case "com.amazonaws.dynamodb#BackupInUseException": @@ -1357,8 +1353,7 @@ const deserializeAws_json1_0CreateGlobalTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GlobalTableAlreadyExistsException": case "com.amazonaws.dynamodb#GlobalTableAlreadyExistsException": @@ -1444,8 +1439,7 @@ const deserializeAws_json1_0CreateTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -1523,8 +1517,7 @@ const deserializeAws_json1_0DeleteBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BackupInUseException": case "com.amazonaws.dynamodb#BackupInUseException": @@ -1610,8 +1603,7 @@ const deserializeAws_json1_0DeleteItemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConditionalCheckFailedException": case "com.amazonaws.dynamodb#ConditionalCheckFailedException": @@ -1721,8 +1713,7 @@ const deserializeAws_json1_0DeleteTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -1808,8 +1799,7 @@ const deserializeAws_json1_0DescribeBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BackupNotFoundException": case "com.amazonaws.dynamodb#BackupNotFoundException": @@ -1879,8 +1869,7 @@ const deserializeAws_json1_0DescribeContinuousBackupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -1950,8 +1939,7 @@ const deserializeAws_json1_0DescribeContributorInsightsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -2013,8 +2001,7 @@ const deserializeAws_json1_0DescribeEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -2060,8 +2047,7 @@ const deserializeAws_json1_0DescribeExportCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExportNotFoundException": case "com.amazonaws.dynamodb#ExportNotFoundException": @@ -2131,8 +2117,7 @@ const deserializeAws_json1_0DescribeGlobalTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GlobalTableNotFoundException": case "com.amazonaws.dynamodb#GlobalTableNotFoundException": @@ -2202,8 +2187,7 @@ const deserializeAws_json1_0DescribeGlobalTableSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GlobalTableNotFoundException": case "com.amazonaws.dynamodb#GlobalTableNotFoundException": @@ -2273,8 +2257,7 @@ const deserializeAws_json1_0DescribeKinesisStreamingDestinationCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -2344,8 +2327,7 @@ const deserializeAws_json1_0DescribeLimitsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -2407,8 +2389,7 @@ const deserializeAws_json1_0DescribeTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -2478,8 +2459,7 @@ const deserializeAws_json1_0DescribeTableReplicaAutoScalingCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -2541,8 +2521,7 @@ const deserializeAws_json1_0DescribeTimeToLiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -2612,8 +2591,7 @@ const deserializeAws_json1_0DisableKinesisStreamingDestinationCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -2699,8 +2677,7 @@ const deserializeAws_json1_0EnableKinesisStreamingDestinationCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -2786,8 +2763,7 @@ const deserializeAws_json1_0ExecuteStatementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConditionalCheckFailedException": case "com.amazonaws.dynamodb#ConditionalCheckFailedException": @@ -2897,8 +2873,7 @@ const deserializeAws_json1_0ExecuteTransactionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatchException": case "com.amazonaws.dynamodb#IdempotentParameterMismatchException": @@ -3000,8 +2975,7 @@ const deserializeAws_json1_0ExportTableToPointInTimeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExportConflictException": case "com.amazonaws.dynamodb#ExportConflictException": @@ -3095,8 +3069,7 @@ const deserializeAws_json1_0GetItemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -3182,8 +3155,7 @@ const deserializeAws_json1_0ListBackupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -3245,8 +3217,7 @@ const deserializeAws_json1_0ListContributorInsightsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -3308,8 +3279,7 @@ const deserializeAws_json1_0ListExportsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -3371,8 +3341,7 @@ const deserializeAws_json1_0ListGlobalTablesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -3434,8 +3403,7 @@ const deserializeAws_json1_0ListTablesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -3497,8 +3465,7 @@ const deserializeAws_json1_0ListTagsOfResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -3568,8 +3535,7 @@ const deserializeAws_json1_0PutItemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConditionalCheckFailedException": case "com.amazonaws.dynamodb#ConditionalCheckFailedException": @@ -3679,8 +3645,7 @@ const deserializeAws_json1_0QueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -3766,8 +3731,7 @@ const deserializeAws_json1_0RestoreTableFromBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BackupInUseException": case "com.amazonaws.dynamodb#BackupInUseException": @@ -3869,8 +3833,7 @@ const deserializeAws_json1_0RestoreTableToPointInTimeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -3980,8 +3943,7 @@ const deserializeAws_json1_0ScanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -4064,8 +4026,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -4151,8 +4112,7 @@ const deserializeAws_json1_0TransactGetItemsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -4246,8 +4206,7 @@ const deserializeAws_json1_0TransactWriteItemsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatchException": case "com.amazonaws.dynamodb#IdempotentParameterMismatchException": @@ -4354,8 +4313,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -4441,8 +4399,7 @@ const deserializeAws_json1_0UpdateContinuousBackupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContinuousBackupsUnavailableException": case "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException": @@ -4520,8 +4477,7 @@ const deserializeAws_json1_0UpdateContributorInsightsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -4583,8 +4539,7 @@ const deserializeAws_json1_0UpdateGlobalTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GlobalTableNotFoundException": case "com.amazonaws.dynamodb#GlobalTableNotFoundException": @@ -4678,8 +4633,7 @@ const deserializeAws_json1_0UpdateGlobalTableSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GlobalTableNotFoundException": case "com.amazonaws.dynamodb#GlobalTableNotFoundException": @@ -4781,8 +4735,7 @@ const deserializeAws_json1_0UpdateItemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConditionalCheckFailedException": case "com.amazonaws.dynamodb#ConditionalCheckFailedException": @@ -4892,8 +4845,7 @@ const deserializeAws_json1_0UpdateTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -4979,8 +4931,7 @@ const deserializeAws_json1_0UpdateTableReplicaAutoScalingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -5058,8 +5009,7 @@ const deserializeAws_json1_0UpdateTimeToLiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": @@ -5570,30 +5520,46 @@ const deserializeAws_json1_0TransactionInProgressExceptionResponse = async ( const serializeAws_json1_0AttributeDefinition = (input: AttributeDefinition, context: __SerdeContext): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.AttributeType !== undefined && { AttributeType: input.AttributeType }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.AttributeType !== undefined && input.AttributeType !== null && { AttributeType: input.AttributeType }), }; }; const serializeAws_json1_0AttributeDefinitions = (input: AttributeDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0AttributeDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0AttributeDefinition(entry, context); + }); }; const serializeAws_json1_0AttributeNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0AttributeUpdates = ( input: { [key: string]: AttributeValueUpdate }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AttributeValueUpdate }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AttributeValueUpdate }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0AttributeValueUpdate(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0AttributeValue = (input: AttributeValue, context: __SerdeContext): any => { @@ -5613,25 +5579,34 @@ const serializeAws_json1_0AttributeValue = (input: AttributeValue, context: __Se }; const serializeAws_json1_0AttributeValueList = (input: AttributeValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0AttributeValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0AttributeValue(entry, context); + }); }; const serializeAws_json1_0AttributeValueUpdate = (input: AttributeValueUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Value !== undefined && { Value: serializeAws_json1_0AttributeValue(input.Value, context) }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Value !== undefined && + input.Value !== null && { Value: serializeAws_json1_0AttributeValue(input.Value, context) }), }; }; const serializeAws_json1_0AutoScalingPolicyUpdate = (input: AutoScalingPolicyUpdate, context: __SerdeContext): any => { return { - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), - ...(input.TargetTrackingScalingPolicyConfiguration !== undefined && { - TargetTrackingScalingPolicyConfiguration: serializeAws_json1_0AutoScalingTargetTrackingScalingPolicyConfigurationUpdate( - input.TargetTrackingScalingPolicyConfiguration, - context - ), - }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), + ...(input.TargetTrackingScalingPolicyConfiguration !== undefined && + input.TargetTrackingScalingPolicyConfiguration !== null && { + TargetTrackingScalingPolicyConfiguration: serializeAws_json1_0AutoScalingTargetTrackingScalingPolicyConfigurationUpdate( + input.TargetTrackingScalingPolicyConfiguration, + context + ), + }), }; }; @@ -5640,13 +5615,16 @@ const serializeAws_json1_0AutoScalingSettingsUpdate = ( context: __SerdeContext ): any => { return { - ...(input.AutoScalingDisabled !== undefined && { AutoScalingDisabled: input.AutoScalingDisabled }), - ...(input.AutoScalingRoleArn !== undefined && { AutoScalingRoleArn: input.AutoScalingRoleArn }), - ...(input.MaximumUnits !== undefined && { MaximumUnits: input.MaximumUnits }), - ...(input.MinimumUnits !== undefined && { MinimumUnits: input.MinimumUnits }), - ...(input.ScalingPolicyUpdate !== undefined && { - ScalingPolicyUpdate: serializeAws_json1_0AutoScalingPolicyUpdate(input.ScalingPolicyUpdate, context), - }), + ...(input.AutoScalingDisabled !== undefined && + input.AutoScalingDisabled !== null && { AutoScalingDisabled: input.AutoScalingDisabled }), + ...(input.AutoScalingRoleArn !== undefined && + input.AutoScalingRoleArn !== null && { AutoScalingRoleArn: input.AutoScalingRoleArn }), + ...(input.MaximumUnits !== undefined && input.MaximumUnits !== null && { MaximumUnits: input.MaximumUnits }), + ...(input.MinimumUnits !== undefined && input.MinimumUnits !== null && { MinimumUnits: input.MinimumUnits }), + ...(input.ScalingPolicyUpdate !== undefined && + input.ScalingPolicyUpdate !== null && { + ScalingPolicyUpdate: serializeAws_json1_0AutoScalingPolicyUpdate(input.ScalingPolicyUpdate, context), + }), }; }; @@ -5655,10 +5633,13 @@ const serializeAws_json1_0AutoScalingTargetTrackingScalingPolicyConfigurationUpd context: __SerdeContext ): any => { return { - ...(input.DisableScaleIn !== undefined && { DisableScaleIn: input.DisableScaleIn }), - ...(input.ScaleInCooldown !== undefined && { ScaleInCooldown: input.ScaleInCooldown }), - ...(input.ScaleOutCooldown !== undefined && { ScaleOutCooldown: input.ScaleOutCooldown }), - ...(input.TargetValue !== undefined && { TargetValue: input.TargetValue }), + ...(input.DisableScaleIn !== undefined && + input.DisableScaleIn !== null && { DisableScaleIn: input.DisableScaleIn }), + ...(input.ScaleInCooldown !== undefined && + input.ScaleInCooldown !== null && { ScaleInCooldown: input.ScaleInCooldown }), + ...(input.ScaleOutCooldown !== undefined && + input.ScaleOutCooldown !== null && { ScaleOutCooldown: input.ScaleOutCooldown }), + ...(input.TargetValue !== undefined && input.TargetValue !== null && { TargetValue: input.TargetValue }), }; }; @@ -5667,18 +5648,19 @@ const serializeAws_json1_0BatchExecuteStatementInput = ( context: __SerdeContext ): any => { return { - ...(input.Statements !== undefined && { - Statements: serializeAws_json1_0PartiQLBatchRequest(input.Statements, context), - }), + ...(input.Statements !== undefined && + input.Statements !== null && { Statements: serializeAws_json1_0PartiQLBatchRequest(input.Statements, context) }), }; }; const serializeAws_json1_0BatchGetItemInput = (input: BatchGetItemInput, context: __SerdeContext): any => { return { - ...(input.RequestItems !== undefined && { - RequestItems: serializeAws_json1_0BatchGetRequestMap(input.RequestItems, context), - }), - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.RequestItems !== undefined && + input.RequestItems !== null && { + RequestItems: serializeAws_json1_0BatchGetRequestMap(input.RequestItems, context), + }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), }; }; @@ -5686,34 +5668,39 @@ const serializeAws_json1_0BatchGetRequestMap = ( input: { [key: string]: KeysAndAttributes }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: KeysAndAttributes }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: KeysAndAttributes }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0KeysAndAttributes(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0BatchStatementRequest = (input: BatchStatementRequest, context: __SerdeContext): any => { return { - ...(input.ConsistentRead !== undefined && { ConsistentRead: input.ConsistentRead }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_0PreparedStatementParameters(input.Parameters, context), - }), - ...(input.Statement !== undefined && { Statement: input.Statement }), + ...(input.ConsistentRead !== undefined && + input.ConsistentRead !== null && { ConsistentRead: input.ConsistentRead }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_0PreparedStatementParameters(input.Parameters, context), + }), + ...(input.Statement !== undefined && input.Statement !== null && { Statement: input.Statement }), }; }; const serializeAws_json1_0BatchWriteItemInput = (input: BatchWriteItemInput, context: __SerdeContext): any => { return { - ...(input.RequestItems !== undefined && { - RequestItems: serializeAws_json1_0BatchWriteItemRequestMap(input.RequestItems, context), - }), - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), - ...(input.ReturnItemCollectionMetrics !== undefined && { - ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics, - }), + ...(input.RequestItems !== undefined && + input.RequestItems !== null && { + RequestItems: serializeAws_json1_0BatchWriteItemRequestMap(input.RequestItems, context), + }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.ReturnItemCollectionMetrics !== undefined && + input.ReturnItemCollectionMetrics !== null && { ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics }), }; }; @@ -5721,52 +5708,70 @@ const serializeAws_json1_0BatchWriteItemRequestMap = ( input: { [key: string]: WriteRequest[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: WriteRequest[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: WriteRequest[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0WriteRequests(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0BinarySetAttributeValue = (input: Uint8Array[], context: __SerdeContext): any => { - return input.map((entry) => context.base64Encoder(entry)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return context.base64Encoder(entry); + }); }; const serializeAws_json1_0Condition = (input: Condition, context: __SerdeContext): any => { return { - ...(input.AttributeValueList !== undefined && { - AttributeValueList: serializeAws_json1_0AttributeValueList(input.AttributeValueList, context), - }), - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), + ...(input.AttributeValueList !== undefined && + input.AttributeValueList !== null && { + AttributeValueList: serializeAws_json1_0AttributeValueList(input.AttributeValueList, context), + }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), }; }; const serializeAws_json1_0ConditionCheck = (input: ConditionCheck, context: __SerdeContext): any => { return { - ...(input.ConditionExpression !== undefined && { ConditionExpression: input.ConditionExpression }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.ExpressionAttributeValues !== undefined && { - ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ), - }), - ...(input.Key !== undefined && { Key: serializeAws_json1_0Key(input.Key, context) }), - ...(input.ReturnValuesOnConditionCheckFailure !== undefined && { - ReturnValuesOnConditionCheckFailure: input.ReturnValuesOnConditionCheckFailure, - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ConditionExpression !== undefined && + input.ConditionExpression !== null && { ConditionExpression: input.ConditionExpression }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.ExpressionAttributeValues !== undefined && + input.ExpressionAttributeValues !== null && { + ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( + input.ExpressionAttributeValues, + context + ), + }), + ...(input.Key !== undefined && input.Key !== null && { Key: serializeAws_json1_0Key(input.Key, context) }), + ...(input.ReturnValuesOnConditionCheckFailure !== undefined && + input.ReturnValuesOnConditionCheckFailure !== null && { + ReturnValuesOnConditionCheckFailure: input.ReturnValuesOnConditionCheckFailure, + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0CreateBackupInput = (input: CreateBackupInput, context: __SerdeContext): any => { return { - ...(input.BackupName !== undefined && { BackupName: input.BackupName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.BackupName !== undefined && input.BackupName !== null && { BackupName: input.BackupName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -5775,27 +5780,32 @@ const serializeAws_json1_0CreateGlobalSecondaryIndexAction = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.KeySchema !== undefined && { KeySchema: serializeAws_json1_0KeySchema(input.KeySchema, context) }), - ...(input.Projection !== undefined && { Projection: serializeAws_json1_0Projection(input.Projection, context) }), - ...(input.ProvisionedThroughput !== undefined && { - ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), - }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.KeySchema !== undefined && + input.KeySchema !== null && { KeySchema: serializeAws_json1_0KeySchema(input.KeySchema, context) }), + ...(input.Projection !== undefined && + input.Projection !== null && { Projection: serializeAws_json1_0Projection(input.Projection, context) }), + ...(input.ProvisionedThroughput !== undefined && + input.ProvisionedThroughput !== null && { + ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), + }), }; }; const serializeAws_json1_0CreateGlobalTableInput = (input: CreateGlobalTableInput, context: __SerdeContext): any => { return { - ...(input.GlobalTableName !== undefined && { GlobalTableName: input.GlobalTableName }), - ...(input.ReplicationGroup !== undefined && { - ReplicationGroup: serializeAws_json1_0ReplicaList(input.ReplicationGroup, context), - }), + ...(input.GlobalTableName !== undefined && + input.GlobalTableName !== null && { GlobalTableName: input.GlobalTableName }), + ...(input.ReplicationGroup !== undefined && + input.ReplicationGroup !== null && { + ReplicationGroup: serializeAws_json1_0ReplicaList(input.ReplicationGroup, context), + }), }; }; const serializeAws_json1_0CreateReplicaAction = (input: CreateReplicaAction, context: __SerdeContext): any => { return { - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), }; }; @@ -5804,73 +5814,90 @@ const serializeAws_json1_0CreateReplicationGroupMemberAction = ( context: __SerdeContext ): any => { return { - ...(input.GlobalSecondaryIndexes !== undefined && { - GlobalSecondaryIndexes: serializeAws_json1_0ReplicaGlobalSecondaryIndexList( - input.GlobalSecondaryIndexes, - context - ), - }), - ...(input.KMSMasterKeyId !== undefined && { KMSMasterKeyId: input.KMSMasterKeyId }), - ...(input.ProvisionedThroughputOverride !== undefined && { - ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughputOverride( - input.ProvisionedThroughputOverride, - context - ), - }), - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), + ...(input.GlobalSecondaryIndexes !== undefined && + input.GlobalSecondaryIndexes !== null && { + GlobalSecondaryIndexes: serializeAws_json1_0ReplicaGlobalSecondaryIndexList( + input.GlobalSecondaryIndexes, + context + ), + }), + ...(input.KMSMasterKeyId !== undefined && + input.KMSMasterKeyId !== null && { KMSMasterKeyId: input.KMSMasterKeyId }), + ...(input.ProvisionedThroughputOverride !== undefined && + input.ProvisionedThroughputOverride !== null && { + ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughputOverride( + input.ProvisionedThroughputOverride, + context + ), + }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), }; }; const serializeAws_json1_0CreateTableInput = (input: CreateTableInput, context: __SerdeContext): any => { return { - ...(input.AttributeDefinitions !== undefined && { - AttributeDefinitions: serializeAws_json1_0AttributeDefinitions(input.AttributeDefinitions, context), - }), - ...(input.BillingMode !== undefined && { BillingMode: input.BillingMode }), - ...(input.GlobalSecondaryIndexes !== undefined && { - GlobalSecondaryIndexes: serializeAws_json1_0GlobalSecondaryIndexList(input.GlobalSecondaryIndexes, context), - }), - ...(input.KeySchema !== undefined && { KeySchema: serializeAws_json1_0KeySchema(input.KeySchema, context) }), - ...(input.LocalSecondaryIndexes !== undefined && { - LocalSecondaryIndexes: serializeAws_json1_0LocalSecondaryIndexList(input.LocalSecondaryIndexes, context), - }), - ...(input.ProvisionedThroughput !== undefined && { - ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), - }), - ...(input.SSESpecification !== undefined && { - SSESpecification: serializeAws_json1_0SSESpecification(input.SSESpecification, context), - }), - ...(input.StreamSpecification !== undefined && { - StreamSpecification: serializeAws_json1_0StreamSpecification(input.StreamSpecification, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.AttributeDefinitions !== undefined && + input.AttributeDefinitions !== null && { + AttributeDefinitions: serializeAws_json1_0AttributeDefinitions(input.AttributeDefinitions, context), + }), + ...(input.BillingMode !== undefined && input.BillingMode !== null && { BillingMode: input.BillingMode }), + ...(input.GlobalSecondaryIndexes !== undefined && + input.GlobalSecondaryIndexes !== null && { + GlobalSecondaryIndexes: serializeAws_json1_0GlobalSecondaryIndexList(input.GlobalSecondaryIndexes, context), + }), + ...(input.KeySchema !== undefined && + input.KeySchema !== null && { KeySchema: serializeAws_json1_0KeySchema(input.KeySchema, context) }), + ...(input.LocalSecondaryIndexes !== undefined && + input.LocalSecondaryIndexes !== null && { + LocalSecondaryIndexes: serializeAws_json1_0LocalSecondaryIndexList(input.LocalSecondaryIndexes, context), + }), + ...(input.ProvisionedThroughput !== undefined && + input.ProvisionedThroughput !== null && { + ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), + }), + ...(input.SSESpecification !== undefined && + input.SSESpecification !== null && { + SSESpecification: serializeAws_json1_0SSESpecification(input.SSESpecification, context), + }), + ...(input.StreamSpecification !== undefined && + input.StreamSpecification !== null && { + StreamSpecification: serializeAws_json1_0StreamSpecification(input.StreamSpecification, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), }; }; const serializeAws_json1_0Delete = (input: Delete, context: __SerdeContext): any => { return { - ...(input.ConditionExpression !== undefined && { ConditionExpression: input.ConditionExpression }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.ExpressionAttributeValues !== undefined && { - ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ), - }), - ...(input.Key !== undefined && { Key: serializeAws_json1_0Key(input.Key, context) }), - ...(input.ReturnValuesOnConditionCheckFailure !== undefined && { - ReturnValuesOnConditionCheckFailure: input.ReturnValuesOnConditionCheckFailure, - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ConditionExpression !== undefined && + input.ConditionExpression !== null && { ConditionExpression: input.ConditionExpression }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.ExpressionAttributeValues !== undefined && + input.ExpressionAttributeValues !== null && { + ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( + input.ExpressionAttributeValues, + context + ), + }), + ...(input.Key !== undefined && input.Key !== null && { Key: serializeAws_json1_0Key(input.Key, context) }), + ...(input.ReturnValuesOnConditionCheckFailure !== undefined && + input.ReturnValuesOnConditionCheckFailure !== null && { + ReturnValuesOnConditionCheckFailure: input.ReturnValuesOnConditionCheckFailure, + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0DeleteBackupInput = (input: DeleteBackupInput, context: __SerdeContext): any => { return { - ...(input.BackupArn !== undefined && { BackupArn: input.BackupArn }), + ...(input.BackupArn !== undefined && input.BackupArn !== null && { BackupArn: input.BackupArn }), }; }; @@ -5879,39 +5906,45 @@ const serializeAws_json1_0DeleteGlobalSecondaryIndexAction = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), }; }; const serializeAws_json1_0DeleteItemInput = (input: DeleteItemInput, context: __SerdeContext): any => { return { - ...(input.ConditionExpression !== undefined && { ConditionExpression: input.ConditionExpression }), - ...(input.ConditionalOperator !== undefined && { ConditionalOperator: input.ConditionalOperator }), - ...(input.Expected !== undefined && { - Expected: serializeAws_json1_0ExpectedAttributeMap(input.Expected, context), - }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.ExpressionAttributeValues !== undefined && { - ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ), - }), - ...(input.Key !== undefined && { Key: serializeAws_json1_0Key(input.Key, context) }), - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), - ...(input.ReturnItemCollectionMetrics !== undefined && { - ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics, - }), - ...(input.ReturnValues !== undefined && { ReturnValues: input.ReturnValues }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ConditionExpression !== undefined && + input.ConditionExpression !== null && { ConditionExpression: input.ConditionExpression }), + ...(input.ConditionalOperator !== undefined && + input.ConditionalOperator !== null && { ConditionalOperator: input.ConditionalOperator }), + ...(input.Expected !== undefined && + input.Expected !== null && { Expected: serializeAws_json1_0ExpectedAttributeMap(input.Expected, context) }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.ExpressionAttributeValues !== undefined && + input.ExpressionAttributeValues !== null && { + ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( + input.ExpressionAttributeValues, + context + ), + }), + ...(input.Key !== undefined && input.Key !== null && { Key: serializeAws_json1_0Key(input.Key, context) }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.ReturnItemCollectionMetrics !== undefined && + input.ReturnItemCollectionMetrics !== null && { ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics }), + ...(input.ReturnValues !== undefined && input.ReturnValues !== null && { ReturnValues: input.ReturnValues }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0DeleteReplicaAction = (input: DeleteReplicaAction, context: __SerdeContext): any => { return { - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), }; }; @@ -5920,25 +5953,25 @@ const serializeAws_json1_0DeleteReplicationGroupMemberAction = ( context: __SerdeContext ): any => { return { - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), }; }; const serializeAws_json1_0DeleteRequest = (input: DeleteRequest, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: serializeAws_json1_0Key(input.Key, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: serializeAws_json1_0Key(input.Key, context) }), }; }; const serializeAws_json1_0DeleteTableInput = (input: DeleteTableInput, context: __SerdeContext): any => { return { - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0DescribeBackupInput = (input: DescribeBackupInput, context: __SerdeContext): any => { return { - ...(input.BackupArn !== undefined && { BackupArn: input.BackupArn }), + ...(input.BackupArn !== undefined && input.BackupArn !== null && { BackupArn: input.BackupArn }), }; }; @@ -5947,7 +5980,7 @@ const serializeAws_json1_0DescribeContinuousBackupsInput = ( context: __SerdeContext ): any => { return { - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -5956,8 +5989,8 @@ const serializeAws_json1_0DescribeContributorInsightsInput = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -5970,7 +6003,7 @@ const serializeAws_json1_0DescribeEndpointsRequest = ( const serializeAws_json1_0DescribeExportInput = (input: DescribeExportInput, context: __SerdeContext): any => { return { - ...(input.ExportArn !== undefined && { ExportArn: input.ExportArn }), + ...(input.ExportArn !== undefined && input.ExportArn !== null && { ExportArn: input.ExportArn }), }; }; @@ -5979,7 +6012,8 @@ const serializeAws_json1_0DescribeGlobalTableInput = ( context: __SerdeContext ): any => { return { - ...(input.GlobalTableName !== undefined && { GlobalTableName: input.GlobalTableName }), + ...(input.GlobalTableName !== undefined && + input.GlobalTableName !== null && { GlobalTableName: input.GlobalTableName }), }; }; @@ -5988,7 +6022,8 @@ const serializeAws_json1_0DescribeGlobalTableSettingsInput = ( context: __SerdeContext ): any => { return { - ...(input.GlobalTableName !== undefined && { GlobalTableName: input.GlobalTableName }), + ...(input.GlobalTableName !== undefined && + input.GlobalTableName !== null && { GlobalTableName: input.GlobalTableName }), }; }; @@ -5997,7 +6032,7 @@ const serializeAws_json1_0DescribeKinesisStreamingDestinationInput = ( context: __SerdeContext ): any => { return { - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -6007,7 +6042,7 @@ const serializeAws_json1_0DescribeLimitsInput = (input: DescribeLimitsInput, con const serializeAws_json1_0DescribeTableInput = (input: DescribeTableInput, context: __SerdeContext): any => { return { - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -6016,33 +6051,36 @@ const serializeAws_json1_0DescribeTableReplicaAutoScalingInput = ( context: __SerdeContext ): any => { return { - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0DescribeTimeToLiveInput = (input: DescribeTimeToLiveInput, context: __SerdeContext): any => { return { - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0ExecuteStatementInput = (input: ExecuteStatementInput, context: __SerdeContext): any => { return { - ...(input.ConsistentRead !== undefined && { ConsistentRead: input.ConsistentRead }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_0PreparedStatementParameters(input.Parameters, context), - }), - ...(input.Statement !== undefined && { Statement: input.Statement }), + ...(input.ConsistentRead !== undefined && + input.ConsistentRead !== null && { ConsistentRead: input.ConsistentRead }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_0PreparedStatementParameters(input.Parameters, context), + }), + ...(input.Statement !== undefined && input.Statement !== null && { Statement: input.Statement }), }; }; const serializeAws_json1_0ExecuteTransactionInput = (input: ExecuteTransactionInput, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.TransactStatements !== undefined && { - TransactStatements: serializeAws_json1_0ParameterizedStatements(input.TransactStatements, context), - }), + ...(input.TransactStatements !== undefined && + input.TransactStatements !== null && { + TransactStatements: serializeAws_json1_0ParameterizedStatements(input.TransactStatements, context), + }), }; }; @@ -6050,23 +6088,28 @@ const serializeAws_json1_0ExpectedAttributeMap = ( input: { [key: string]: ExpectedAttributeValue }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: ExpectedAttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: ExpectedAttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0ExpectedAttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0ExpectedAttributeValue = (input: ExpectedAttributeValue, context: __SerdeContext): any => { return { - ...(input.AttributeValueList !== undefined && { - AttributeValueList: serializeAws_json1_0AttributeValueList(input.AttributeValueList, context), - }), - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.Exists !== undefined && { Exists: input.Exists }), - ...(input.Value !== undefined && { Value: serializeAws_json1_0AttributeValue(input.Value, context) }), + ...(input.AttributeValueList !== undefined && + input.AttributeValueList !== null && { + AttributeValueList: serializeAws_json1_0AttributeValueList(input.AttributeValueList, context), + }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.Exists !== undefined && input.Exists !== null && { Exists: input.Exists }), + ...(input.Value !== undefined && + input.Value !== null && { Value: serializeAws_json1_0AttributeValue(input.Value, context) }), }; }; @@ -6076,14 +6119,16 @@ const serializeAws_json1_0ExportTableToPointInTimeInput = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.ExportFormat !== undefined && { ExportFormat: input.ExportFormat }), - ...(input.ExportTime !== undefined && { ExportTime: Math.round(input.ExportTime.getTime() / 1000) }), - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3BucketOwner !== undefined && { S3BucketOwner: input.S3BucketOwner }), - ...(input.S3Prefix !== undefined && { S3Prefix: input.S3Prefix }), - ...(input.S3SseAlgorithm !== undefined && { S3SseAlgorithm: input.S3SseAlgorithm }), - ...(input.S3SseKmsKeyId !== undefined && { S3SseKmsKeyId: input.S3SseKmsKeyId }), - ...(input.TableArn !== undefined && { TableArn: input.TableArn }), + ...(input.ExportFormat !== undefined && input.ExportFormat !== null && { ExportFormat: input.ExportFormat }), + ...(input.ExportTime !== undefined && + input.ExportTime !== null && { ExportTime: Math.round(input.ExportTime.getTime() / 1000) }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3BucketOwner !== undefined && input.S3BucketOwner !== null && { S3BucketOwner: input.S3BucketOwner }), + ...(input.S3Prefix !== undefined && input.S3Prefix !== null && { S3Prefix: input.S3Prefix }), + ...(input.S3SseAlgorithm !== undefined && + input.S3SseAlgorithm !== null && { S3SseAlgorithm: input.S3SseAlgorithm }), + ...(input.S3SseKmsKeyId !== undefined && input.S3SseKmsKeyId !== null && { S3SseKmsKeyId: input.S3SseKmsKeyId }), + ...(input.TableArn !== undefined && input.TableArn !== null && { TableArn: input.TableArn }), }; }; @@ -6091,73 +6136,95 @@ const serializeAws_json1_0ExpressionAttributeNameMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0ExpressionAttributeValueMap = ( input: { [key: string]: AttributeValue }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0FilterConditionMap = (input: { [key: string]: Condition }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Condition }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Condition }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0Condition(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0Get = (input: Get, context: __SerdeContext): any => { return { - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.Key !== undefined && { Key: serializeAws_json1_0Key(input.Key, context) }), - ...(input.ProjectionExpression !== undefined && { ProjectionExpression: input.ProjectionExpression }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.Key !== undefined && input.Key !== null && { Key: serializeAws_json1_0Key(input.Key, context) }), + ...(input.ProjectionExpression !== undefined && + input.ProjectionExpression !== null && { ProjectionExpression: input.ProjectionExpression }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0GetItemInput = (input: GetItemInput, context: __SerdeContext): any => { return { - ...(input.AttributesToGet !== undefined && { - AttributesToGet: serializeAws_json1_0AttributeNameList(input.AttributesToGet, context), - }), - ...(input.ConsistentRead !== undefined && { ConsistentRead: input.ConsistentRead }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.Key !== undefined && { Key: serializeAws_json1_0Key(input.Key, context) }), - ...(input.ProjectionExpression !== undefined && { ProjectionExpression: input.ProjectionExpression }), - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.AttributesToGet !== undefined && + input.AttributesToGet !== null && { + AttributesToGet: serializeAws_json1_0AttributeNameList(input.AttributesToGet, context), + }), + ...(input.ConsistentRead !== undefined && + input.ConsistentRead !== null && { ConsistentRead: input.ConsistentRead }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.Key !== undefined && input.Key !== null && { Key: serializeAws_json1_0Key(input.Key, context) }), + ...(input.ProjectionExpression !== undefined && + input.ProjectionExpression !== null && { ProjectionExpression: input.ProjectionExpression }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0GlobalSecondaryIndex = (input: GlobalSecondaryIndex, context: __SerdeContext): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.KeySchema !== undefined && { KeySchema: serializeAws_json1_0KeySchema(input.KeySchema, context) }), - ...(input.Projection !== undefined && { Projection: serializeAws_json1_0Projection(input.Projection, context) }), - ...(input.ProvisionedThroughput !== undefined && { - ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), - }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.KeySchema !== undefined && + input.KeySchema !== null && { KeySchema: serializeAws_json1_0KeySchema(input.KeySchema, context) }), + ...(input.Projection !== undefined && + input.Projection !== null && { Projection: serializeAws_json1_0Projection(input.Projection, context) }), + ...(input.ProvisionedThroughput !== undefined && + input.ProvisionedThroughput !== null && { + ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), + }), }; }; @@ -6166,13 +6233,14 @@ const serializeAws_json1_0GlobalSecondaryIndexAutoScalingUpdate = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.ProvisionedWriteCapacityAutoScalingUpdate !== undefined && { - ProvisionedWriteCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedWriteCapacityAutoScalingUpdate, - context - ), - }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.ProvisionedWriteCapacityAutoScalingUpdate !== undefined && + input.ProvisionedWriteCapacityAutoScalingUpdate !== null && { + ProvisionedWriteCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ProvisionedWriteCapacityAutoScalingUpdate, + context + ), + }), }; }; @@ -6180,11 +6248,25 @@ const serializeAws_json1_0GlobalSecondaryIndexAutoScalingUpdateList = ( input: GlobalSecondaryIndexAutoScalingUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0GlobalSecondaryIndexAutoScalingUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0GlobalSecondaryIndexAutoScalingUpdate(entry, context); + }); }; const serializeAws_json1_0GlobalSecondaryIndexList = (input: GlobalSecondaryIndex[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0GlobalSecondaryIndex(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0GlobalSecondaryIndex(entry, context); + }); }; const serializeAws_json1_0GlobalSecondaryIndexUpdate = ( @@ -6192,15 +6274,12 @@ const serializeAws_json1_0GlobalSecondaryIndexUpdate = ( context: __SerdeContext ): any => { return { - ...(input.Create !== undefined && { - Create: serializeAws_json1_0CreateGlobalSecondaryIndexAction(input.Create, context), - }), - ...(input.Delete !== undefined && { - Delete: serializeAws_json1_0DeleteGlobalSecondaryIndexAction(input.Delete, context), - }), - ...(input.Update !== undefined && { - Update: serializeAws_json1_0UpdateGlobalSecondaryIndexAction(input.Update, context), - }), + ...(input.Create !== undefined && + input.Create !== null && { Create: serializeAws_json1_0CreateGlobalSecondaryIndexAction(input.Create, context) }), + ...(input.Delete !== undefined && + input.Delete !== null && { Delete: serializeAws_json1_0DeleteGlobalSecondaryIndexAction(input.Delete, context) }), + ...(input.Update !== undefined && + input.Update !== null && { Update: serializeAws_json1_0UpdateGlobalSecondaryIndexAction(input.Update, context) }), }; }; @@ -6208,7 +6287,14 @@ const serializeAws_json1_0GlobalSecondaryIndexUpdateList = ( input: GlobalSecondaryIndexUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0GlobalSecondaryIndexUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0GlobalSecondaryIndexUpdate(entry, context); + }); }; const serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdate = ( @@ -6216,16 +6302,18 @@ const serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdate = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.ProvisionedWriteCapacityAutoScalingSettingsUpdate !== undefined && { - ProvisionedWriteCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedWriteCapacityAutoScalingSettingsUpdate, - context - ), - }), - ...(input.ProvisionedWriteCapacityUnits !== undefined && { - ProvisionedWriteCapacityUnits: input.ProvisionedWriteCapacityUnits, - }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.ProvisionedWriteCapacityAutoScalingSettingsUpdate !== undefined && + input.ProvisionedWriteCapacityAutoScalingSettingsUpdate !== null && { + ProvisionedWriteCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ProvisionedWriteCapacityAutoScalingSettingsUpdate, + context + ), + }), + ...(input.ProvisionedWriteCapacityUnits !== undefined && + input.ProvisionedWriteCapacityUnits !== null && { + ProvisionedWriteCapacityUnits: input.ProvisionedWriteCapacityUnits, + }), }; }; @@ -6233,55 +6321,87 @@ const serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdateList = ( input: GlobalTableGlobalSecondaryIndexSettingsUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdate(entry, context); + }); }; const serializeAws_json1_0Key = (input: { [key: string]: AttributeValue }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0KeyConditions = (input: { [key: string]: Condition }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Condition }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Condition }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0Condition(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0KeyList = (input: { [key: string]: AttributeValue }[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Key(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Key(entry, context); + }); }; const serializeAws_json1_0KeysAndAttributes = (input: KeysAndAttributes, context: __SerdeContext): any => { return { - ...(input.AttributesToGet !== undefined && { - AttributesToGet: serializeAws_json1_0AttributeNameList(input.AttributesToGet, context), - }), - ...(input.ConsistentRead !== undefined && { ConsistentRead: input.ConsistentRead }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.Keys !== undefined && { Keys: serializeAws_json1_0KeyList(input.Keys, context) }), - ...(input.ProjectionExpression !== undefined && { ProjectionExpression: input.ProjectionExpression }), + ...(input.AttributesToGet !== undefined && + input.AttributesToGet !== null && { + AttributesToGet: serializeAws_json1_0AttributeNameList(input.AttributesToGet, context), + }), + ...(input.ConsistentRead !== undefined && + input.ConsistentRead !== null && { ConsistentRead: input.ConsistentRead }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.Keys !== undefined && input.Keys !== null && { Keys: serializeAws_json1_0KeyList(input.Keys, context) }), + ...(input.ProjectionExpression !== undefined && + input.ProjectionExpression !== null && { ProjectionExpression: input.ProjectionExpression }), }; }; const serializeAws_json1_0KeySchema = (input: KeySchemaElement[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0KeySchemaElement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0KeySchemaElement(entry, context); + }); }; const serializeAws_json1_0KeySchemaElement = (input: KeySchemaElement, context: __SerdeContext): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.KeyType !== undefined && { KeyType: input.KeyType }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.KeyType !== undefined && input.KeyType !== null && { KeyType: input.KeyType }), }; }; @@ -6290,27 +6410,37 @@ const serializeAws_json1_0KinesisStreamingDestinationInput = ( context: __SerdeContext ): any => { return { - ...(input.StreamArn !== undefined && { StreamArn: input.StreamArn }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.StreamArn !== undefined && input.StreamArn !== null && { StreamArn: input.StreamArn }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0ListAttributeValue = (input: AttributeValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0AttributeValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0AttributeValue(entry, context); + }); }; const serializeAws_json1_0ListBackupsInput = (input: ListBackupsInput, context: __SerdeContext): any => { return { - ...(input.BackupType !== undefined && { BackupType: input.BackupType }), - ...(input.ExclusiveStartBackupArn !== undefined && { ExclusiveStartBackupArn: input.ExclusiveStartBackupArn }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.TimeRangeLowerBound !== undefined && { - TimeRangeLowerBound: Math.round(input.TimeRangeLowerBound.getTime() / 1000), - }), - ...(input.TimeRangeUpperBound !== undefined && { - TimeRangeUpperBound: Math.round(input.TimeRangeUpperBound.getTime() / 1000), - }), + ...(input.BackupType !== undefined && input.BackupType !== null && { BackupType: input.BackupType }), + ...(input.ExclusiveStartBackupArn !== undefined && + input.ExclusiveStartBackupArn !== null && { ExclusiveStartBackupArn: input.ExclusiveStartBackupArn }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.TimeRangeLowerBound !== undefined && + input.TimeRangeLowerBound !== null && { + TimeRangeLowerBound: Math.round(input.TimeRangeLowerBound.getTime() / 1000), + }), + ...(input.TimeRangeUpperBound !== undefined && + input.TimeRangeUpperBound !== null && { + TimeRangeUpperBound: Math.round(input.TimeRangeUpperBound.getTime() / 1000), + }), }; }; @@ -6319,92 +6449,134 @@ const serializeAws_json1_0ListContributorInsightsInput = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0ListExportsInput = (input: ListExportsInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TableArn !== undefined && { TableArn: input.TableArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TableArn !== undefined && input.TableArn !== null && { TableArn: input.TableArn }), }; }; const serializeAws_json1_0ListGlobalTablesInput = (input: ListGlobalTablesInput, context: __SerdeContext): any => { return { - ...(input.ExclusiveStartGlobalTableName !== undefined && { - ExclusiveStartGlobalTableName: input.ExclusiveStartGlobalTableName, - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), + ...(input.ExclusiveStartGlobalTableName !== undefined && + input.ExclusiveStartGlobalTableName !== null && { + ExclusiveStartGlobalTableName: input.ExclusiveStartGlobalTableName, + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), }; }; const serializeAws_json1_0ListTablesInput = (input: ListTablesInput, context: __SerdeContext): any => { return { - ...(input.ExclusiveStartTableName !== undefined && { ExclusiveStartTableName: input.ExclusiveStartTableName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.ExclusiveStartTableName !== undefined && + input.ExclusiveStartTableName !== null && { ExclusiveStartTableName: input.ExclusiveStartTableName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), }; }; const serializeAws_json1_0ListTagsOfResourceInput = (input: ListTagsOfResourceInput, context: __SerdeContext): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_0LocalSecondaryIndex = (input: LocalSecondaryIndex, context: __SerdeContext): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.KeySchema !== undefined && { KeySchema: serializeAws_json1_0KeySchema(input.KeySchema, context) }), - ...(input.Projection !== undefined && { Projection: serializeAws_json1_0Projection(input.Projection, context) }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.KeySchema !== undefined && + input.KeySchema !== null && { KeySchema: serializeAws_json1_0KeySchema(input.KeySchema, context) }), + ...(input.Projection !== undefined && + input.Projection !== null && { Projection: serializeAws_json1_0Projection(input.Projection, context) }), }; }; const serializeAws_json1_0LocalSecondaryIndexList = (input: LocalSecondaryIndex[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0LocalSecondaryIndex(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0LocalSecondaryIndex(entry, context); + }); }; const serializeAws_json1_0MapAttributeValue = ( input: { [key: string]: AttributeValue }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0NonKeyAttributeNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0NumberSetAttributeValue = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0ParameterizedStatement = (input: ParameterizedStatement, context: __SerdeContext): any => { return { - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_0PreparedStatementParameters(input.Parameters, context), - }), - ...(input.Statement !== undefined && { Statement: input.Statement }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_0PreparedStatementParameters(input.Parameters, context), + }), + ...(input.Statement !== undefined && input.Statement !== null && { Statement: input.Statement }), }; }; const serializeAws_json1_0ParameterizedStatements = (input: ParameterizedStatement[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0ParameterizedStatement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ParameterizedStatement(entry, context); + }); }; const serializeAws_json1_0PartiQLBatchRequest = (input: BatchStatementRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0BatchStatementRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0BatchStatementRequest(entry, context); + }); }; const serializeAws_json1_0PointInTimeRecoverySpecification = ( @@ -6412,29 +6584,39 @@ const serializeAws_json1_0PointInTimeRecoverySpecification = ( context: __SerdeContext ): any => { return { - ...(input.PointInTimeRecoveryEnabled !== undefined && { - PointInTimeRecoveryEnabled: input.PointInTimeRecoveryEnabled, - }), + ...(input.PointInTimeRecoveryEnabled !== undefined && + input.PointInTimeRecoveryEnabled !== null && { PointInTimeRecoveryEnabled: input.PointInTimeRecoveryEnabled }), }; }; const serializeAws_json1_0PreparedStatementParameters = (input: AttributeValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0AttributeValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0AttributeValue(entry, context); + }); }; const serializeAws_json1_0Projection = (input: Projection, context: __SerdeContext): any => { return { - ...(input.NonKeyAttributes !== undefined && { - NonKeyAttributes: serializeAws_json1_0NonKeyAttributeNameList(input.NonKeyAttributes, context), - }), - ...(input.ProjectionType !== undefined && { ProjectionType: input.ProjectionType }), + ...(input.NonKeyAttributes !== undefined && + input.NonKeyAttributes !== null && { + NonKeyAttributes: serializeAws_json1_0NonKeyAttributeNameList(input.NonKeyAttributes, context), + }), + ...(input.ProjectionType !== undefined && + input.ProjectionType !== null && { ProjectionType: input.ProjectionType }), }; }; const serializeAws_json1_0ProvisionedThroughput = (input: ProvisionedThroughput, context: __SerdeContext): any => { return { - ...(input.ReadCapacityUnits !== undefined && { ReadCapacityUnits: input.ReadCapacityUnits }), - ...(input.WriteCapacityUnits !== undefined && { WriteCapacityUnits: input.WriteCapacityUnits }), + ...(input.ReadCapacityUnits !== undefined && + input.ReadCapacityUnits !== null && { ReadCapacityUnits: input.ReadCapacityUnits }), + ...(input.WriteCapacityUnits !== undefined && + input.WriteCapacityUnits !== null && { WriteCapacityUnits: input.WriteCapacityUnits }), }; }; @@ -6443,53 +6625,69 @@ const serializeAws_json1_0ProvisionedThroughputOverride = ( context: __SerdeContext ): any => { return { - ...(input.ReadCapacityUnits !== undefined && { ReadCapacityUnits: input.ReadCapacityUnits }), + ...(input.ReadCapacityUnits !== undefined && + input.ReadCapacityUnits !== null && { ReadCapacityUnits: input.ReadCapacityUnits }), }; }; const serializeAws_json1_0Put = (input: Put, context: __SerdeContext): any => { return { - ...(input.ConditionExpression !== undefined && { ConditionExpression: input.ConditionExpression }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.ExpressionAttributeValues !== undefined && { - ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ), - }), - ...(input.Item !== undefined && { Item: serializeAws_json1_0PutItemInputAttributeMap(input.Item, context) }), - ...(input.ReturnValuesOnConditionCheckFailure !== undefined && { - ReturnValuesOnConditionCheckFailure: input.ReturnValuesOnConditionCheckFailure, - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ConditionExpression !== undefined && + input.ConditionExpression !== null && { ConditionExpression: input.ConditionExpression }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.ExpressionAttributeValues !== undefined && + input.ExpressionAttributeValues !== null && { + ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( + input.ExpressionAttributeValues, + context + ), + }), + ...(input.Item !== undefined && + input.Item !== null && { Item: serializeAws_json1_0PutItemInputAttributeMap(input.Item, context) }), + ...(input.ReturnValuesOnConditionCheckFailure !== undefined && + input.ReturnValuesOnConditionCheckFailure !== null && { + ReturnValuesOnConditionCheckFailure: input.ReturnValuesOnConditionCheckFailure, + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0PutItemInput = (input: PutItemInput, context: __SerdeContext): any => { return { - ...(input.ConditionExpression !== undefined && { ConditionExpression: input.ConditionExpression }), - ...(input.ConditionalOperator !== undefined && { ConditionalOperator: input.ConditionalOperator }), - ...(input.Expected !== undefined && { - Expected: serializeAws_json1_0ExpectedAttributeMap(input.Expected, context), - }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.ExpressionAttributeValues !== undefined && { - ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ), - }), - ...(input.Item !== undefined && { Item: serializeAws_json1_0PutItemInputAttributeMap(input.Item, context) }), - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), - ...(input.ReturnItemCollectionMetrics !== undefined && { - ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics, - }), - ...(input.ReturnValues !== undefined && { ReturnValues: input.ReturnValues }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ConditionExpression !== undefined && + input.ConditionExpression !== null && { ConditionExpression: input.ConditionExpression }), + ...(input.ConditionalOperator !== undefined && + input.ConditionalOperator !== null && { ConditionalOperator: input.ConditionalOperator }), + ...(input.Expected !== undefined && + input.Expected !== null && { Expected: serializeAws_json1_0ExpectedAttributeMap(input.Expected, context) }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.ExpressionAttributeValues !== undefined && + input.ExpressionAttributeValues !== null && { + ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( + input.ExpressionAttributeValues, + context + ), + }), + ...(input.Item !== undefined && + input.Item !== null && { Item: serializeAws_json1_0PutItemInputAttributeMap(input.Item, context) }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.ReturnItemCollectionMetrics !== undefined && + input.ReturnItemCollectionMetrics !== null && { ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics }), + ...(input.ReturnValues !== undefined && input.ReturnValues !== null && { ReturnValues: input.ReturnValues }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -6497,61 +6695,80 @@ const serializeAws_json1_0PutItemInputAttributeMap = ( input: { [key: string]: AttributeValue }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0PutRequest = (input: PutRequest, context: __SerdeContext): any => { return { - ...(input.Item !== undefined && { Item: serializeAws_json1_0PutItemInputAttributeMap(input.Item, context) }), + ...(input.Item !== undefined && + input.Item !== null && { Item: serializeAws_json1_0PutItemInputAttributeMap(input.Item, context) }), }; }; const serializeAws_json1_0QueryInput = (input: QueryInput, context: __SerdeContext): any => { return { - ...(input.AttributesToGet !== undefined && { - AttributesToGet: serializeAws_json1_0AttributeNameList(input.AttributesToGet, context), - }), - ...(input.ConditionalOperator !== undefined && { ConditionalOperator: input.ConditionalOperator }), - ...(input.ConsistentRead !== undefined && { ConsistentRead: input.ConsistentRead }), - ...(input.ExclusiveStartKey !== undefined && { - ExclusiveStartKey: serializeAws_json1_0Key(input.ExclusiveStartKey, context), - }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.ExpressionAttributeValues !== undefined && { - ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ), - }), - ...(input.FilterExpression !== undefined && { FilterExpression: input.FilterExpression }), - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.KeyConditionExpression !== undefined && { KeyConditionExpression: input.KeyConditionExpression }), - ...(input.KeyConditions !== undefined && { - KeyConditions: serializeAws_json1_0KeyConditions(input.KeyConditions, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.ProjectionExpression !== undefined && { ProjectionExpression: input.ProjectionExpression }), - ...(input.QueryFilter !== undefined && { - QueryFilter: serializeAws_json1_0FilterConditionMap(input.QueryFilter, context), - }), - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), - ...(input.ScanIndexForward !== undefined && { ScanIndexForward: input.ScanIndexForward }), - ...(input.Select !== undefined && { Select: input.Select }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.AttributesToGet !== undefined && + input.AttributesToGet !== null && { + AttributesToGet: serializeAws_json1_0AttributeNameList(input.AttributesToGet, context), + }), + ...(input.ConditionalOperator !== undefined && + input.ConditionalOperator !== null && { ConditionalOperator: input.ConditionalOperator }), + ...(input.ConsistentRead !== undefined && + input.ConsistentRead !== null && { ConsistentRead: input.ConsistentRead }), + ...(input.ExclusiveStartKey !== undefined && + input.ExclusiveStartKey !== null && { + ExclusiveStartKey: serializeAws_json1_0Key(input.ExclusiveStartKey, context), + }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.ExpressionAttributeValues !== undefined && + input.ExpressionAttributeValues !== null && { + ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( + input.ExpressionAttributeValues, + context + ), + }), + ...(input.FilterExpression !== undefined && + input.FilterExpression !== null && { FilterExpression: input.FilterExpression }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.KeyConditionExpression !== undefined && + input.KeyConditionExpression !== null && { KeyConditionExpression: input.KeyConditionExpression }), + ...(input.KeyConditions !== undefined && + input.KeyConditions !== null && { + KeyConditions: serializeAws_json1_0KeyConditions(input.KeyConditions, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.ProjectionExpression !== undefined && + input.ProjectionExpression !== null && { ProjectionExpression: input.ProjectionExpression }), + ...(input.QueryFilter !== undefined && + input.QueryFilter !== null && { + QueryFilter: serializeAws_json1_0FilterConditionMap(input.QueryFilter, context), + }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.ScanIndexForward !== undefined && + input.ScanIndexForward !== null && { ScanIndexForward: input.ScanIndexForward }), + ...(input.Select !== undefined && input.Select !== null && { Select: input.Select }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0Replica = (input: Replica, context: __SerdeContext): any => { return { - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), }; }; @@ -6560,19 +6777,21 @@ const serializeAws_json1_0ReplicaAutoScalingUpdate = ( context: __SerdeContext ): any => { return { - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), - ...(input.ReplicaGlobalSecondaryIndexUpdates !== undefined && { - ReplicaGlobalSecondaryIndexUpdates: serializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingUpdateList( - input.ReplicaGlobalSecondaryIndexUpdates, - context - ), - }), - ...(input.ReplicaProvisionedReadCapacityAutoScalingUpdate !== undefined && { - ReplicaProvisionedReadCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( - input.ReplicaProvisionedReadCapacityAutoScalingUpdate, - context - ), - }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), + ...(input.ReplicaGlobalSecondaryIndexUpdates !== undefined && + input.ReplicaGlobalSecondaryIndexUpdates !== null && { + ReplicaGlobalSecondaryIndexUpdates: serializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingUpdateList( + input.ReplicaGlobalSecondaryIndexUpdates, + context + ), + }), + ...(input.ReplicaProvisionedReadCapacityAutoScalingUpdate !== undefined && + input.ReplicaProvisionedReadCapacityAutoScalingUpdate !== null && { + ReplicaProvisionedReadCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ReplicaProvisionedReadCapacityAutoScalingUpdate, + context + ), + }), }; }; @@ -6580,7 +6799,14 @@ const serializeAws_json1_0ReplicaAutoScalingUpdateList = ( input: ReplicaAutoScalingUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0ReplicaAutoScalingUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ReplicaAutoScalingUpdate(entry, context); + }); }; const serializeAws_json1_0ReplicaGlobalSecondaryIndex = ( @@ -6588,13 +6814,14 @@ const serializeAws_json1_0ReplicaGlobalSecondaryIndex = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.ProvisionedThroughputOverride !== undefined && { - ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughputOverride( - input.ProvisionedThroughputOverride, - context - ), - }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.ProvisionedThroughputOverride !== undefined && + input.ProvisionedThroughputOverride !== null && { + ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughputOverride( + input.ProvisionedThroughputOverride, + context + ), + }), }; }; @@ -6603,13 +6830,14 @@ const serializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingUpdate = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.ProvisionedReadCapacityAutoScalingUpdate !== undefined && { - ProvisionedReadCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedReadCapacityAutoScalingUpdate, - context - ), - }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.ProvisionedReadCapacityAutoScalingUpdate !== undefined && + input.ProvisionedReadCapacityAutoScalingUpdate !== null && { + ProvisionedReadCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ProvisionedReadCapacityAutoScalingUpdate, + context + ), + }), }; }; @@ -6617,14 +6845,28 @@ const serializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingUpdateList = ( input: ReplicaGlobalSecondaryIndexAutoScalingUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingUpdate(entry, context); + }); }; const serializeAws_json1_0ReplicaGlobalSecondaryIndexList = ( input: ReplicaGlobalSecondaryIndex[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0ReplicaGlobalSecondaryIndex(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ReplicaGlobalSecondaryIndex(entry, context); + }); }; const serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdate = ( @@ -6632,16 +6874,18 @@ const serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdate = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.ProvisionedReadCapacityAutoScalingSettingsUpdate !== undefined && { - ProvisionedReadCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedReadCapacityAutoScalingSettingsUpdate, - context - ), - }), - ...(input.ProvisionedReadCapacityUnits !== undefined && { - ProvisionedReadCapacityUnits: input.ProvisionedReadCapacityUnits, - }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.ProvisionedReadCapacityAutoScalingSettingsUpdate !== undefined && + input.ProvisionedReadCapacityAutoScalingSettingsUpdate !== null && { + ProvisionedReadCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ProvisionedReadCapacityAutoScalingSettingsUpdate, + context + ), + }), + ...(input.ProvisionedReadCapacityUnits !== undefined && + input.ProvisionedReadCapacityUnits !== null && { + ProvisionedReadCapacityUnits: input.ProvisionedReadCapacityUnits, + }), }; }; @@ -6649,31 +6893,48 @@ const serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdateList = ( input: ReplicaGlobalSecondaryIndexSettingsUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdate(entry, context); + }); }; const serializeAws_json1_0ReplicaList = (input: Replica[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Replica(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Replica(entry, context); + }); }; const serializeAws_json1_0ReplicaSettingsUpdate = (input: ReplicaSettingsUpdate, context: __SerdeContext): any => { return { - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), - ...(input.ReplicaGlobalSecondaryIndexSettingsUpdate !== undefined && { - ReplicaGlobalSecondaryIndexSettingsUpdate: serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdateList( - input.ReplicaGlobalSecondaryIndexSettingsUpdate, - context - ), - }), - ...(input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate !== undefined && { - ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( - input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, - context - ), - }), - ...(input.ReplicaProvisionedReadCapacityUnits !== undefined && { - ReplicaProvisionedReadCapacityUnits: input.ReplicaProvisionedReadCapacityUnits, - }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), + ...(input.ReplicaGlobalSecondaryIndexSettingsUpdate !== undefined && + input.ReplicaGlobalSecondaryIndexSettingsUpdate !== null && { + ReplicaGlobalSecondaryIndexSettingsUpdate: serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdateList( + input.ReplicaGlobalSecondaryIndexSettingsUpdate, + context + ), + }), + ...(input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate !== undefined && + input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate !== null && { + ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, + context + ), + }), + ...(input.ReplicaProvisionedReadCapacityUnits !== undefined && + input.ReplicaProvisionedReadCapacityUnits !== null && { + ReplicaProvisionedReadCapacityUnits: input.ReplicaProvisionedReadCapacityUnits, + }), }; }; @@ -6681,20 +6942,30 @@ const serializeAws_json1_0ReplicaSettingsUpdateList = ( input: ReplicaSettingsUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0ReplicaSettingsUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ReplicaSettingsUpdate(entry, context); + }); }; const serializeAws_json1_0ReplicationGroupUpdate = (input: ReplicationGroupUpdate, context: __SerdeContext): any => { return { - ...(input.Create !== undefined && { - Create: serializeAws_json1_0CreateReplicationGroupMemberAction(input.Create, context), - }), - ...(input.Delete !== undefined && { - Delete: serializeAws_json1_0DeleteReplicationGroupMemberAction(input.Delete, context), - }), - ...(input.Update !== undefined && { - Update: serializeAws_json1_0UpdateReplicationGroupMemberAction(input.Update, context), - }), + ...(input.Create !== undefined && + input.Create !== null && { + Create: serializeAws_json1_0CreateReplicationGroupMemberAction(input.Create, context), + }), + ...(input.Delete !== undefined && + input.Delete !== null && { + Delete: serializeAws_json1_0DeleteReplicationGroupMemberAction(input.Delete, context), + }), + ...(input.Update !== undefined && + input.Update !== null && { + Update: serializeAws_json1_0UpdateReplicationGroupMemberAction(input.Update, context), + }), }; }; @@ -6702,18 +6973,34 @@ const serializeAws_json1_0ReplicationGroupUpdateList = ( input: ReplicationGroupUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0ReplicationGroupUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ReplicationGroupUpdate(entry, context); + }); }; const serializeAws_json1_0ReplicaUpdate = (input: ReplicaUpdate, context: __SerdeContext): any => { return { - ...(input.Create !== undefined && { Create: serializeAws_json1_0CreateReplicaAction(input.Create, context) }), - ...(input.Delete !== undefined && { Delete: serializeAws_json1_0DeleteReplicaAction(input.Delete, context) }), + ...(input.Create !== undefined && + input.Create !== null && { Create: serializeAws_json1_0CreateReplicaAction(input.Create, context) }), + ...(input.Delete !== undefined && + input.Delete !== null && { Delete: serializeAws_json1_0DeleteReplicaAction(input.Delete, context) }), }; }; const serializeAws_json1_0ReplicaUpdateList = (input: ReplicaUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0ReplicaUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ReplicaUpdate(entry, context); + }); }; const serializeAws_json1_0RestoreTableFromBackupInput = ( @@ -6721,30 +7008,36 @@ const serializeAws_json1_0RestoreTableFromBackupInput = ( context: __SerdeContext ): any => { return { - ...(input.BackupArn !== undefined && { BackupArn: input.BackupArn }), - ...(input.BillingModeOverride !== undefined && { BillingModeOverride: input.BillingModeOverride }), - ...(input.GlobalSecondaryIndexOverride !== undefined && { - GlobalSecondaryIndexOverride: serializeAws_json1_0GlobalSecondaryIndexList( - input.GlobalSecondaryIndexOverride, - context - ), - }), - ...(input.LocalSecondaryIndexOverride !== undefined && { - LocalSecondaryIndexOverride: serializeAws_json1_0LocalSecondaryIndexList( - input.LocalSecondaryIndexOverride, - context - ), - }), - ...(input.ProvisionedThroughputOverride !== undefined && { - ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughput( - input.ProvisionedThroughputOverride, - context - ), - }), - ...(input.SSESpecificationOverride !== undefined && { - SSESpecificationOverride: serializeAws_json1_0SSESpecification(input.SSESpecificationOverride, context), - }), - ...(input.TargetTableName !== undefined && { TargetTableName: input.TargetTableName }), + ...(input.BackupArn !== undefined && input.BackupArn !== null && { BackupArn: input.BackupArn }), + ...(input.BillingModeOverride !== undefined && + input.BillingModeOverride !== null && { BillingModeOverride: input.BillingModeOverride }), + ...(input.GlobalSecondaryIndexOverride !== undefined && + input.GlobalSecondaryIndexOverride !== null && { + GlobalSecondaryIndexOverride: serializeAws_json1_0GlobalSecondaryIndexList( + input.GlobalSecondaryIndexOverride, + context + ), + }), + ...(input.LocalSecondaryIndexOverride !== undefined && + input.LocalSecondaryIndexOverride !== null && { + LocalSecondaryIndexOverride: serializeAws_json1_0LocalSecondaryIndexList( + input.LocalSecondaryIndexOverride, + context + ), + }), + ...(input.ProvisionedThroughputOverride !== undefined && + input.ProvisionedThroughputOverride !== null && { + ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughput( + input.ProvisionedThroughputOverride, + context + ), + }), + ...(input.SSESpecificationOverride !== undefined && + input.SSESpecificationOverride !== null && { + SSESpecificationOverride: serializeAws_json1_0SSESpecification(input.SSESpecificationOverride, context), + }), + ...(input.TargetTableName !== undefined && + input.TargetTableName !== null && { TargetTableName: input.TargetTableName }), }; }; @@ -6753,190 +7046,263 @@ const serializeAws_json1_0RestoreTableToPointInTimeInput = ( context: __SerdeContext ): any => { return { - ...(input.BillingModeOverride !== undefined && { BillingModeOverride: input.BillingModeOverride }), - ...(input.GlobalSecondaryIndexOverride !== undefined && { - GlobalSecondaryIndexOverride: serializeAws_json1_0GlobalSecondaryIndexList( - input.GlobalSecondaryIndexOverride, - context - ), - }), - ...(input.LocalSecondaryIndexOverride !== undefined && { - LocalSecondaryIndexOverride: serializeAws_json1_0LocalSecondaryIndexList( - input.LocalSecondaryIndexOverride, - context - ), - }), - ...(input.ProvisionedThroughputOverride !== undefined && { - ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughput( - input.ProvisionedThroughputOverride, - context - ), - }), - ...(input.RestoreDateTime !== undefined && { RestoreDateTime: Math.round(input.RestoreDateTime.getTime() / 1000) }), - ...(input.SSESpecificationOverride !== undefined && { - SSESpecificationOverride: serializeAws_json1_0SSESpecification(input.SSESpecificationOverride, context), - }), - ...(input.SourceTableArn !== undefined && { SourceTableArn: input.SourceTableArn }), - ...(input.SourceTableName !== undefined && { SourceTableName: input.SourceTableName }), - ...(input.TargetTableName !== undefined && { TargetTableName: input.TargetTableName }), - ...(input.UseLatestRestorableTime !== undefined && { UseLatestRestorableTime: input.UseLatestRestorableTime }), + ...(input.BillingModeOverride !== undefined && + input.BillingModeOverride !== null && { BillingModeOverride: input.BillingModeOverride }), + ...(input.GlobalSecondaryIndexOverride !== undefined && + input.GlobalSecondaryIndexOverride !== null && { + GlobalSecondaryIndexOverride: serializeAws_json1_0GlobalSecondaryIndexList( + input.GlobalSecondaryIndexOverride, + context + ), + }), + ...(input.LocalSecondaryIndexOverride !== undefined && + input.LocalSecondaryIndexOverride !== null && { + LocalSecondaryIndexOverride: serializeAws_json1_0LocalSecondaryIndexList( + input.LocalSecondaryIndexOverride, + context + ), + }), + ...(input.ProvisionedThroughputOverride !== undefined && + input.ProvisionedThroughputOverride !== null && { + ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughput( + input.ProvisionedThroughputOverride, + context + ), + }), + ...(input.RestoreDateTime !== undefined && + input.RestoreDateTime !== null && { RestoreDateTime: Math.round(input.RestoreDateTime.getTime() / 1000) }), + ...(input.SSESpecificationOverride !== undefined && + input.SSESpecificationOverride !== null && { + SSESpecificationOverride: serializeAws_json1_0SSESpecification(input.SSESpecificationOverride, context), + }), + ...(input.SourceTableArn !== undefined && + input.SourceTableArn !== null && { SourceTableArn: input.SourceTableArn }), + ...(input.SourceTableName !== undefined && + input.SourceTableName !== null && { SourceTableName: input.SourceTableName }), + ...(input.TargetTableName !== undefined && + input.TargetTableName !== null && { TargetTableName: input.TargetTableName }), + ...(input.UseLatestRestorableTime !== undefined && + input.UseLatestRestorableTime !== null && { UseLatestRestorableTime: input.UseLatestRestorableTime }), }; }; const serializeAws_json1_0ScanInput = (input: ScanInput, context: __SerdeContext): any => { return { - ...(input.AttributesToGet !== undefined && { - AttributesToGet: serializeAws_json1_0AttributeNameList(input.AttributesToGet, context), - }), - ...(input.ConditionalOperator !== undefined && { ConditionalOperator: input.ConditionalOperator }), - ...(input.ConsistentRead !== undefined && { ConsistentRead: input.ConsistentRead }), - ...(input.ExclusiveStartKey !== undefined && { - ExclusiveStartKey: serializeAws_json1_0Key(input.ExclusiveStartKey, context), - }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.ExpressionAttributeValues !== undefined && { - ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ), - }), - ...(input.FilterExpression !== undefined && { FilterExpression: input.FilterExpression }), - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.ProjectionExpression !== undefined && { ProjectionExpression: input.ProjectionExpression }), - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), - ...(input.ScanFilter !== undefined && { - ScanFilter: serializeAws_json1_0FilterConditionMap(input.ScanFilter, context), - }), - ...(input.Segment !== undefined && { Segment: input.Segment }), - ...(input.Select !== undefined && { Select: input.Select }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.TotalSegments !== undefined && { TotalSegments: input.TotalSegments }), + ...(input.AttributesToGet !== undefined && + input.AttributesToGet !== null && { + AttributesToGet: serializeAws_json1_0AttributeNameList(input.AttributesToGet, context), + }), + ...(input.ConditionalOperator !== undefined && + input.ConditionalOperator !== null && { ConditionalOperator: input.ConditionalOperator }), + ...(input.ConsistentRead !== undefined && + input.ConsistentRead !== null && { ConsistentRead: input.ConsistentRead }), + ...(input.ExclusiveStartKey !== undefined && + input.ExclusiveStartKey !== null && { + ExclusiveStartKey: serializeAws_json1_0Key(input.ExclusiveStartKey, context), + }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.ExpressionAttributeValues !== undefined && + input.ExpressionAttributeValues !== null && { + ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( + input.ExpressionAttributeValues, + context + ), + }), + ...(input.FilterExpression !== undefined && + input.FilterExpression !== null && { FilterExpression: input.FilterExpression }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.ProjectionExpression !== undefined && + input.ProjectionExpression !== null && { ProjectionExpression: input.ProjectionExpression }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.ScanFilter !== undefined && + input.ScanFilter !== null && { ScanFilter: serializeAws_json1_0FilterConditionMap(input.ScanFilter, context) }), + ...(input.Segment !== undefined && input.Segment !== null && { Segment: input.Segment }), + ...(input.Select !== undefined && input.Select !== null && { Select: input.Select }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.TotalSegments !== undefined && input.TotalSegments !== null && { TotalSegments: input.TotalSegments }), }; }; const serializeAws_json1_0SSESpecification = (input: SSESpecification, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.KMSMasterKeyId !== undefined && { KMSMasterKeyId: input.KMSMasterKeyId }), - ...(input.SSEType !== undefined && { SSEType: input.SSEType }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.KMSMasterKeyId !== undefined && + input.KMSMasterKeyId !== null && { KMSMasterKeyId: input.KMSMasterKeyId }), + ...(input.SSEType !== undefined && input.SSEType !== null && { SSEType: input.SSEType }), }; }; const serializeAws_json1_0StreamSpecification = (input: StreamSpecification, context: __SerdeContext): any => { return { - ...(input.StreamEnabled !== undefined && { StreamEnabled: input.StreamEnabled }), - ...(input.StreamViewType !== undefined && { StreamViewType: input.StreamViewType }), + ...(input.StreamEnabled !== undefined && input.StreamEnabled !== null && { StreamEnabled: input.StreamEnabled }), + ...(input.StreamViewType !== undefined && + input.StreamViewType !== null && { StreamViewType: input.StreamViewType }), }; }; const serializeAws_json1_0StringSetAttributeValue = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_0TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Tag(entry, context); + }); }; const serializeAws_json1_0TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), }; }; const serializeAws_json1_0TimeToLiveSpecification = (input: TimeToLiveSpecification, context: __SerdeContext): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; const serializeAws_json1_0TransactGetItem = (input: TransactGetItem, context: __SerdeContext): any => { return { - ...(input.Get !== undefined && { Get: serializeAws_json1_0Get(input.Get, context) }), + ...(input.Get !== undefined && input.Get !== null && { Get: serializeAws_json1_0Get(input.Get, context) }), }; }; const serializeAws_json1_0TransactGetItemList = (input: TransactGetItem[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0TransactGetItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0TransactGetItem(entry, context); + }); }; const serializeAws_json1_0TransactGetItemsInput = (input: TransactGetItemsInput, context: __SerdeContext): any => { return { - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), - ...(input.TransactItems !== undefined && { - TransactItems: serializeAws_json1_0TransactGetItemList(input.TransactItems, context), - }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.TransactItems !== undefined && + input.TransactItems !== null && { + TransactItems: serializeAws_json1_0TransactGetItemList(input.TransactItems, context), + }), }; }; const serializeAws_json1_0TransactWriteItem = (input: TransactWriteItem, context: __SerdeContext): any => { return { - ...(input.ConditionCheck !== undefined && { - ConditionCheck: serializeAws_json1_0ConditionCheck(input.ConditionCheck, context), - }), - ...(input.Delete !== undefined && { Delete: serializeAws_json1_0Delete(input.Delete, context) }), - ...(input.Put !== undefined && { Put: serializeAws_json1_0Put(input.Put, context) }), - ...(input.Update !== undefined && { Update: serializeAws_json1_0Update(input.Update, context) }), + ...(input.ConditionCheck !== undefined && + input.ConditionCheck !== null && { + ConditionCheck: serializeAws_json1_0ConditionCheck(input.ConditionCheck, context), + }), + ...(input.Delete !== undefined && + input.Delete !== null && { Delete: serializeAws_json1_0Delete(input.Delete, context) }), + ...(input.Put !== undefined && input.Put !== null && { Put: serializeAws_json1_0Put(input.Put, context) }), + ...(input.Update !== undefined && + input.Update !== null && { Update: serializeAws_json1_0Update(input.Update, context) }), }; }; const serializeAws_json1_0TransactWriteItemList = (input: TransactWriteItem[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0TransactWriteItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0TransactWriteItem(entry, context); + }); }; const serializeAws_json1_0TransactWriteItemsInput = (input: TransactWriteItemsInput, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), - ...(input.ReturnItemCollectionMetrics !== undefined && { - ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics, - }), - ...(input.TransactItems !== undefined && { - TransactItems: serializeAws_json1_0TransactWriteItemList(input.TransactItems, context), - }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.ReturnItemCollectionMetrics !== undefined && + input.ReturnItemCollectionMetrics !== null && { ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics }), + ...(input.TransactItems !== undefined && + input.TransactItems !== null && { + TransactItems: serializeAws_json1_0TransactWriteItemList(input.TransactItems, context), + }), }; }; const serializeAws_json1_0UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_0Update = (input: Update, context: __SerdeContext): any => { return { - ...(input.ConditionExpression !== undefined && { ConditionExpression: input.ConditionExpression }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.ExpressionAttributeValues !== undefined && { - ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ), - }), - ...(input.Key !== undefined && { Key: serializeAws_json1_0Key(input.Key, context) }), - ...(input.ReturnValuesOnConditionCheckFailure !== undefined && { - ReturnValuesOnConditionCheckFailure: input.ReturnValuesOnConditionCheckFailure, - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.UpdateExpression !== undefined && { UpdateExpression: input.UpdateExpression }), + ...(input.ConditionExpression !== undefined && + input.ConditionExpression !== null && { ConditionExpression: input.ConditionExpression }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.ExpressionAttributeValues !== undefined && + input.ExpressionAttributeValues !== null && { + ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( + input.ExpressionAttributeValues, + context + ), + }), + ...(input.Key !== undefined && input.Key !== null && { Key: serializeAws_json1_0Key(input.Key, context) }), + ...(input.ReturnValuesOnConditionCheckFailure !== undefined && + input.ReturnValuesOnConditionCheckFailure !== null && { + ReturnValuesOnConditionCheckFailure: input.ReturnValuesOnConditionCheckFailure, + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.UpdateExpression !== undefined && + input.UpdateExpression !== null && { UpdateExpression: input.UpdateExpression }), }; }; @@ -6945,13 +7311,14 @@ const serializeAws_json1_0UpdateContinuousBackupsInput = ( context: __SerdeContext ): any => { return { - ...(input.PointInTimeRecoverySpecification !== undefined && { - PointInTimeRecoverySpecification: serializeAws_json1_0PointInTimeRecoverySpecification( - input.PointInTimeRecoverySpecification, - context - ), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.PointInTimeRecoverySpecification !== undefined && + input.PointInTimeRecoverySpecification !== null && { + PointInTimeRecoverySpecification: serializeAws_json1_0PointInTimeRecoverySpecification( + input.PointInTimeRecoverySpecification, + context + ), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -6960,11 +7327,10 @@ const serializeAws_json1_0UpdateContributorInsightsInput = ( context: __SerdeContext ): any => { return { - ...(input.ContributorInsightsAction !== undefined && { - ContributorInsightsAction: input.ContributorInsightsAction, - }), - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ContributorInsightsAction !== undefined && + input.ContributorInsightsAction !== null && { ContributorInsightsAction: input.ContributorInsightsAction }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -6973,19 +7339,22 @@ const serializeAws_json1_0UpdateGlobalSecondaryIndexAction = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.ProvisionedThroughput !== undefined && { - ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), - }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.ProvisionedThroughput !== undefined && + input.ProvisionedThroughput !== null && { + ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), + }), }; }; const serializeAws_json1_0UpdateGlobalTableInput = (input: UpdateGlobalTableInput, context: __SerdeContext): any => { return { - ...(input.GlobalTableName !== undefined && { GlobalTableName: input.GlobalTableName }), - ...(input.ReplicaUpdates !== undefined && { - ReplicaUpdates: serializeAws_json1_0ReplicaUpdateList(input.ReplicaUpdates, context), - }), + ...(input.GlobalTableName !== undefined && + input.GlobalTableName !== null && { GlobalTableName: input.GlobalTableName }), + ...(input.ReplicaUpdates !== undefined && + input.ReplicaUpdates !== null && { + ReplicaUpdates: serializeAws_json1_0ReplicaUpdateList(input.ReplicaUpdates, context), + }), }; }; @@ -6994,56 +7363,70 @@ const serializeAws_json1_0UpdateGlobalTableSettingsInput = ( context: __SerdeContext ): any => { return { - ...(input.GlobalTableBillingMode !== undefined && { GlobalTableBillingMode: input.GlobalTableBillingMode }), - ...(input.GlobalTableGlobalSecondaryIndexSettingsUpdate !== undefined && { - GlobalTableGlobalSecondaryIndexSettingsUpdate: serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdateList( - input.GlobalTableGlobalSecondaryIndexSettingsUpdate, - context - ), - }), - ...(input.GlobalTableName !== undefined && { GlobalTableName: input.GlobalTableName }), - ...(input.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate !== undefined && { - GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( - input.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, - context - ), - }), - ...(input.GlobalTableProvisionedWriteCapacityUnits !== undefined && { - GlobalTableProvisionedWriteCapacityUnits: input.GlobalTableProvisionedWriteCapacityUnits, - }), - ...(input.ReplicaSettingsUpdate !== undefined && { - ReplicaSettingsUpdate: serializeAws_json1_0ReplicaSettingsUpdateList(input.ReplicaSettingsUpdate, context), - }), + ...(input.GlobalTableBillingMode !== undefined && + input.GlobalTableBillingMode !== null && { GlobalTableBillingMode: input.GlobalTableBillingMode }), + ...(input.GlobalTableGlobalSecondaryIndexSettingsUpdate !== undefined && + input.GlobalTableGlobalSecondaryIndexSettingsUpdate !== null && { + GlobalTableGlobalSecondaryIndexSettingsUpdate: serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdateList( + input.GlobalTableGlobalSecondaryIndexSettingsUpdate, + context + ), + }), + ...(input.GlobalTableName !== undefined && + input.GlobalTableName !== null && { GlobalTableName: input.GlobalTableName }), + ...(input.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate !== undefined && + input.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate !== null && { + GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, + context + ), + }), + ...(input.GlobalTableProvisionedWriteCapacityUnits !== undefined && + input.GlobalTableProvisionedWriteCapacityUnits !== null && { + GlobalTableProvisionedWriteCapacityUnits: input.GlobalTableProvisionedWriteCapacityUnits, + }), + ...(input.ReplicaSettingsUpdate !== undefined && + input.ReplicaSettingsUpdate !== null && { + ReplicaSettingsUpdate: serializeAws_json1_0ReplicaSettingsUpdateList(input.ReplicaSettingsUpdate, context), + }), }; }; const serializeAws_json1_0UpdateItemInput = (input: UpdateItemInput, context: __SerdeContext): any => { return { - ...(input.AttributeUpdates !== undefined && { - AttributeUpdates: serializeAws_json1_0AttributeUpdates(input.AttributeUpdates, context), - }), - ...(input.ConditionExpression !== undefined && { ConditionExpression: input.ConditionExpression }), - ...(input.ConditionalOperator !== undefined && { ConditionalOperator: input.ConditionalOperator }), - ...(input.Expected !== undefined && { - Expected: serializeAws_json1_0ExpectedAttributeMap(input.Expected, context), - }), - ...(input.ExpressionAttributeNames !== undefined && { - ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap(input.ExpressionAttributeNames, context), - }), - ...(input.ExpressionAttributeValues !== undefined && { - ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ), - }), - ...(input.Key !== undefined && { Key: serializeAws_json1_0Key(input.Key, context) }), - ...(input.ReturnConsumedCapacity !== undefined && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), - ...(input.ReturnItemCollectionMetrics !== undefined && { - ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics, - }), - ...(input.ReturnValues !== undefined && { ReturnValues: input.ReturnValues }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.UpdateExpression !== undefined && { UpdateExpression: input.UpdateExpression }), + ...(input.AttributeUpdates !== undefined && + input.AttributeUpdates !== null && { + AttributeUpdates: serializeAws_json1_0AttributeUpdates(input.AttributeUpdates, context), + }), + ...(input.ConditionExpression !== undefined && + input.ConditionExpression !== null && { ConditionExpression: input.ConditionExpression }), + ...(input.ConditionalOperator !== undefined && + input.ConditionalOperator !== null && { ConditionalOperator: input.ConditionalOperator }), + ...(input.Expected !== undefined && + input.Expected !== null && { Expected: serializeAws_json1_0ExpectedAttributeMap(input.Expected, context) }), + ...(input.ExpressionAttributeNames !== undefined && + input.ExpressionAttributeNames !== null && { + ExpressionAttributeNames: serializeAws_json1_0ExpressionAttributeNameMap( + input.ExpressionAttributeNames, + context + ), + }), + ...(input.ExpressionAttributeValues !== undefined && + input.ExpressionAttributeValues !== null && { + ExpressionAttributeValues: serializeAws_json1_0ExpressionAttributeValueMap( + input.ExpressionAttributeValues, + context + ), + }), + ...(input.Key !== undefined && input.Key !== null && { Key: serializeAws_json1_0Key(input.Key, context) }), + ...(input.ReturnConsumedCapacity !== undefined && + input.ReturnConsumedCapacity !== null && { ReturnConsumedCapacity: input.ReturnConsumedCapacity }), + ...(input.ReturnItemCollectionMetrics !== undefined && + input.ReturnItemCollectionMetrics !== null && { ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics }), + ...(input.ReturnValues !== undefined && input.ReturnValues !== null && { ReturnValues: input.ReturnValues }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.UpdateExpression !== undefined && + input.UpdateExpression !== null && { UpdateExpression: input.UpdateExpression }), }; }; @@ -7052,48 +7435,57 @@ const serializeAws_json1_0UpdateReplicationGroupMemberAction = ( context: __SerdeContext ): any => { return { - ...(input.GlobalSecondaryIndexes !== undefined && { - GlobalSecondaryIndexes: serializeAws_json1_0ReplicaGlobalSecondaryIndexList( - input.GlobalSecondaryIndexes, - context - ), - }), - ...(input.KMSMasterKeyId !== undefined && { KMSMasterKeyId: input.KMSMasterKeyId }), - ...(input.ProvisionedThroughputOverride !== undefined && { - ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughputOverride( - input.ProvisionedThroughputOverride, - context - ), - }), - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), + ...(input.GlobalSecondaryIndexes !== undefined && + input.GlobalSecondaryIndexes !== null && { + GlobalSecondaryIndexes: serializeAws_json1_0ReplicaGlobalSecondaryIndexList( + input.GlobalSecondaryIndexes, + context + ), + }), + ...(input.KMSMasterKeyId !== undefined && + input.KMSMasterKeyId !== null && { KMSMasterKeyId: input.KMSMasterKeyId }), + ...(input.ProvisionedThroughputOverride !== undefined && + input.ProvisionedThroughputOverride !== null && { + ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughputOverride( + input.ProvisionedThroughputOverride, + context + ), + }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), }; }; const serializeAws_json1_0UpdateTableInput = (input: UpdateTableInput, context: __SerdeContext): any => { return { - ...(input.AttributeDefinitions !== undefined && { - AttributeDefinitions: serializeAws_json1_0AttributeDefinitions(input.AttributeDefinitions, context), - }), - ...(input.BillingMode !== undefined && { BillingMode: input.BillingMode }), - ...(input.GlobalSecondaryIndexUpdates !== undefined && { - GlobalSecondaryIndexUpdates: serializeAws_json1_0GlobalSecondaryIndexUpdateList( - input.GlobalSecondaryIndexUpdates, - context - ), - }), - ...(input.ProvisionedThroughput !== undefined && { - ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), - }), - ...(input.ReplicaUpdates !== undefined && { - ReplicaUpdates: serializeAws_json1_0ReplicationGroupUpdateList(input.ReplicaUpdates, context), - }), - ...(input.SSESpecification !== undefined && { - SSESpecification: serializeAws_json1_0SSESpecification(input.SSESpecification, context), - }), - ...(input.StreamSpecification !== undefined && { - StreamSpecification: serializeAws_json1_0StreamSpecification(input.StreamSpecification, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.AttributeDefinitions !== undefined && + input.AttributeDefinitions !== null && { + AttributeDefinitions: serializeAws_json1_0AttributeDefinitions(input.AttributeDefinitions, context), + }), + ...(input.BillingMode !== undefined && input.BillingMode !== null && { BillingMode: input.BillingMode }), + ...(input.GlobalSecondaryIndexUpdates !== undefined && + input.GlobalSecondaryIndexUpdates !== null && { + GlobalSecondaryIndexUpdates: serializeAws_json1_0GlobalSecondaryIndexUpdateList( + input.GlobalSecondaryIndexUpdates, + context + ), + }), + ...(input.ProvisionedThroughput !== undefined && + input.ProvisionedThroughput !== null && { + ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput(input.ProvisionedThroughput, context), + }), + ...(input.ReplicaUpdates !== undefined && + input.ReplicaUpdates !== null && { + ReplicaUpdates: serializeAws_json1_0ReplicationGroupUpdateList(input.ReplicaUpdates, context), + }), + ...(input.SSESpecification !== undefined && + input.SSESpecification !== null && { + SSESpecification: serializeAws_json1_0SSESpecification(input.SSESpecification, context), + }), + ...(input.StreamSpecification !== undefined && + input.StreamSpecification !== null && { + StreamSpecification: serializeAws_json1_0StreamSpecification(input.StreamSpecification, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -7102,45 +7494,58 @@ const serializeAws_json1_0UpdateTableReplicaAutoScalingInput = ( context: __SerdeContext ): any => { return { - ...(input.GlobalSecondaryIndexUpdates !== undefined && { - GlobalSecondaryIndexUpdates: serializeAws_json1_0GlobalSecondaryIndexAutoScalingUpdateList( - input.GlobalSecondaryIndexUpdates, - context - ), - }), - ...(input.ProvisionedWriteCapacityAutoScalingUpdate !== undefined && { - ProvisionedWriteCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedWriteCapacityAutoScalingUpdate, - context - ), - }), - ...(input.ReplicaUpdates !== undefined && { - ReplicaUpdates: serializeAws_json1_0ReplicaAutoScalingUpdateList(input.ReplicaUpdates, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.GlobalSecondaryIndexUpdates !== undefined && + input.GlobalSecondaryIndexUpdates !== null && { + GlobalSecondaryIndexUpdates: serializeAws_json1_0GlobalSecondaryIndexAutoScalingUpdateList( + input.GlobalSecondaryIndexUpdates, + context + ), + }), + ...(input.ProvisionedWriteCapacityAutoScalingUpdate !== undefined && + input.ProvisionedWriteCapacityAutoScalingUpdate !== null && { + ProvisionedWriteCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ProvisionedWriteCapacityAutoScalingUpdate, + context + ), + }), + ...(input.ReplicaUpdates !== undefined && + input.ReplicaUpdates !== null && { + ReplicaUpdates: serializeAws_json1_0ReplicaAutoScalingUpdateList(input.ReplicaUpdates, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0UpdateTimeToLiveInput = (input: UpdateTimeToLiveInput, context: __SerdeContext): any => { return { - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.TimeToLiveSpecification !== undefined && { - TimeToLiveSpecification: serializeAws_json1_0TimeToLiveSpecification(input.TimeToLiveSpecification, context), - }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.TimeToLiveSpecification !== undefined && + input.TimeToLiveSpecification !== null && { + TimeToLiveSpecification: serializeAws_json1_0TimeToLiveSpecification(input.TimeToLiveSpecification, context), + }), }; }; const serializeAws_json1_0WriteRequest = (input: WriteRequest, context: __SerdeContext): any => { return { - ...(input.DeleteRequest !== undefined && { - DeleteRequest: serializeAws_json1_0DeleteRequest(input.DeleteRequest, context), - }), - ...(input.PutRequest !== undefined && { PutRequest: serializeAws_json1_0PutRequest(input.PutRequest, context) }), + ...(input.DeleteRequest !== undefined && + input.DeleteRequest !== null && { + DeleteRequest: serializeAws_json1_0DeleteRequest(input.DeleteRequest, context), + }), + ...(input.PutRequest !== undefined && + input.PutRequest !== null && { PutRequest: serializeAws_json1_0PutRequest(input.PutRequest, context) }), }; }; const serializeAws_json1_0WriteRequests = (input: WriteRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0WriteRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0WriteRequest(entry, context); + }); }; const deserializeAws_json1_0ArchivalSummary = (output: any, context: __SerdeContext): ArchivalSummary => { @@ -7168,24 +7573,40 @@ const deserializeAws_json1_0AttributeDefinition = (output: any, context: __Serde }; const deserializeAws_json1_0AttributeDefinitions = (output: any, context: __SerdeContext): AttributeDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0AttributeDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0AttributeDefinition(entry, context); + }); }; const deserializeAws_json1_0AttributeMap = ( output: any, context: __SerdeContext ): { [key: string]: AttributeValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0AttributeNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0AttributeValue = (output: any, context: __SerdeContext): AttributeValue => { @@ -7263,7 +7684,14 @@ const deserializeAws_json1_0AutoScalingPolicyDescriptionList = ( output: any, context: __SerdeContext ): AutoScalingPolicyDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0AutoScalingPolicyDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0AutoScalingPolicyDescription(entry, context); + }); }; const deserializeAws_json1_0AutoScalingSettingsDescription = ( @@ -7355,7 +7783,14 @@ const deserializeAws_json1_0BackupNotFoundException = ( }; const deserializeAws_json1_0BackupSummaries = (output: any, context: __SerdeContext): BackupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0BackupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0BackupSummary(entry, context); + }); }; const deserializeAws_json1_0BackupSummary = (output: any, context: __SerdeContext): BackupSummary => { @@ -7413,13 +7848,15 @@ const deserializeAws_json1_0BatchGetRequestMap = ( output: any, context: __SerdeContext ): { [key: string]: KeysAndAttributes } => { - return Object.entries(output).reduce( - (acc: { [key: string]: KeysAndAttributes }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: KeysAndAttributes }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0KeysAndAttributes(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0BatchGetResponseMap = ( @@ -7427,10 +7864,15 @@ const deserializeAws_json1_0BatchGetResponseMap = ( context: __SerdeContext ): { [key: string]: { [key: string]: AttributeValue }[] } => { return Object.entries(output).reduce( - (acc: { [key: string]: { [key: string]: AttributeValue }[] }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_0ItemList(value, context), - }), + (acc: { [key: string]: { [key: string]: AttributeValue }[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_0ItemList(value, context), + }; + }, {} ); }; @@ -7477,13 +7919,15 @@ const deserializeAws_json1_0BatchWriteItemRequestMap = ( output: any, context: __SerdeContext ): { [key: string]: WriteRequest[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: WriteRequest[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: WriteRequest[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0WriteRequests(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0BillingModeSummary = (output: any, context: __SerdeContext): BillingModeSummary => { @@ -7497,7 +7941,14 @@ const deserializeAws_json1_0BillingModeSummary = (output: any, context: __SerdeC }; const deserializeAws_json1_0BinarySetAttributeValue = (output: any, context: __SerdeContext): Uint8Array[] => { - return (output || []).map((entry: any) => context.base64Decoder(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return context.base64Decoder(entry); + }); }; const deserializeAws_json1_0CancellationReason = (output: any, context: __SerdeContext): CancellationReason => { @@ -7512,7 +7963,14 @@ const deserializeAws_json1_0CancellationReason = (output: any, context: __SerdeC }; const deserializeAws_json1_0CancellationReasonList = (output: any, context: __SerdeContext): CancellationReason[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0CancellationReason(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0CancellationReason(entry, context); + }); }; const deserializeAws_json1_0Capacity = (output: any, context: __SerdeContext): Capacity => { @@ -7568,7 +8026,14 @@ const deserializeAws_json1_0ConsumedCapacity = (output: any, context: __SerdeCon }; const deserializeAws_json1_0ConsumedCapacityMultiple = (output: any, context: __SerdeContext): ConsumedCapacity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ConsumedCapacity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ConsumedCapacity(entry, context); + }); }; const deserializeAws_json1_0ContinuousBackupsDescription = ( @@ -7597,14 +8062,28 @@ const deserializeAws_json1_0ContinuousBackupsUnavailableException = ( }; const deserializeAws_json1_0ContributorInsightsRuleList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0ContributorInsightsSummaries = ( output: any, context: __SerdeContext ): ContributorInsightsSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ContributorInsightsSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ContributorInsightsSummary(entry, context); + }); }; const deserializeAws_json1_0ContributorInsightsSummary = ( @@ -7870,7 +8349,14 @@ const deserializeAws_json1_0Endpoint = (output: any, context: __SerdeContext): E }; const deserializeAws_json1_0Endpoints = (output: any, context: __SerdeContext): Endpoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Endpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Endpoint(entry, context); + }); }; const deserializeAws_json1_0ExecuteStatementOutput = (output: any, context: __SerdeContext): ExecuteStatementOutput => { @@ -7951,7 +8437,14 @@ const deserializeAws_json1_0ExportNotFoundException = ( }; const deserializeAws_json1_0ExportSummaries = (output: any, context: __SerdeContext): ExportSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ExportSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ExportSummary(entry, context); + }); }; const deserializeAws_json1_0ExportSummary = (output: any, context: __SerdeContext): ExportSummary => { @@ -7977,13 +8470,15 @@ const deserializeAws_json1_0ExpressionAttributeNameMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0FailureException = (output: any, context: __SerdeContext): FailureException => { @@ -8041,14 +8536,28 @@ const deserializeAws_json1_0GlobalSecondaryIndexDescriptionList = ( output: any, context: __SerdeContext ): GlobalSecondaryIndexDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0GlobalSecondaryIndexDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0GlobalSecondaryIndexDescription(entry, context); + }); }; const deserializeAws_json1_0GlobalSecondaryIndexes = ( output: any, context: __SerdeContext ): GlobalSecondaryIndexInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0GlobalSecondaryIndexInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0GlobalSecondaryIndexInfo(entry, context); + }); }; const deserializeAws_json1_0GlobalSecondaryIndexInfo = ( @@ -8114,7 +8623,14 @@ const deserializeAws_json1_0GlobalTableDescription = (output: any, context: __Se }; const deserializeAws_json1_0GlobalTableList = (output: any, context: __SerdeContext): GlobalTable[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0GlobalTable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0GlobalTable(entry, context); + }); }; const deserializeAws_json1_0GlobalTableNotFoundException = ( @@ -8178,13 +8694,15 @@ const deserializeAws_json1_0ItemCollectionKeyAttributeMap = ( output: any, context: __SerdeContext ): { [key: string]: AttributeValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0ItemCollectionMetrics = (output: any, context: __SerdeContext): ItemCollectionMetrics => { @@ -8204,7 +8722,14 @@ const deserializeAws_json1_0ItemCollectionMetricsMultiple = ( output: any, context: __SerdeContext ): ItemCollectionMetrics[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ItemCollectionMetrics(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ItemCollectionMetrics(entry, context); + }); }; const deserializeAws_json1_0ItemCollectionMetricsPerTable = ( @@ -8212,16 +8737,28 @@ const deserializeAws_json1_0ItemCollectionMetricsPerTable = ( context: __SerdeContext ): { [key: string]: ItemCollectionMetrics[] } => { return Object.entries(output).reduce( - (acc: { [key: string]: ItemCollectionMetrics[] }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_0ItemCollectionMetricsMultiple(value, context), - }), + (acc: { [key: string]: ItemCollectionMetrics[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_0ItemCollectionMetricsMultiple(value, context), + }; + }, {} ); }; const deserializeAws_json1_0ItemCollectionSizeEstimateRange = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0ItemCollectionSizeLimitExceededException = ( @@ -8234,7 +8771,14 @@ const deserializeAws_json1_0ItemCollectionSizeLimitExceededException = ( }; const deserializeAws_json1_0ItemList = (output: any, context: __SerdeContext): { [key: string]: AttributeValue }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0AttributeMap(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0AttributeMap(entry, context); + }); }; const deserializeAws_json1_0ItemResponse = (output: any, context: __SerdeContext): ItemResponse => { @@ -8247,21 +8791,37 @@ const deserializeAws_json1_0ItemResponse = (output: any, context: __SerdeContext }; const deserializeAws_json1_0ItemResponseList = (output: any, context: __SerdeContext): ItemResponse[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ItemResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ItemResponse(entry, context); + }); }; const deserializeAws_json1_0Key = (output: any, context: __SerdeContext): { [key: string]: AttributeValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0KeyList = (output: any, context: __SerdeContext): { [key: string]: AttributeValue }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Key(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Key(entry, context); + }); }; const deserializeAws_json1_0KeysAndAttributes = (output: any, context: __SerdeContext): KeysAndAttributes => { @@ -8288,7 +8848,14 @@ const deserializeAws_json1_0KeysAndAttributes = (output: any, context: __SerdeCo }; const deserializeAws_json1_0KeySchema = (output: any, context: __SerdeContext): KeySchemaElement[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0KeySchemaElement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0KeySchemaElement(entry, context); + }); }; const deserializeAws_json1_0KeySchemaElement = (output: any, context: __SerdeContext): KeySchemaElement => { @@ -8320,7 +8887,14 @@ const deserializeAws_json1_0KinesisDataStreamDestinations = ( output: any, context: __SerdeContext ): KinesisDataStreamDestination[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0KinesisDataStreamDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0KinesisDataStreamDestination(entry, context); + }); }; const deserializeAws_json1_0KinesisStreamingDestinationOutput = ( @@ -8344,7 +8918,14 @@ const deserializeAws_json1_0LimitExceededException = (output: any, context: __Se }; const deserializeAws_json1_0ListAttributeValue = (output: any, context: __SerdeContext): AttributeValue[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0AttributeValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0AttributeValue(entry, context); + }); }; const deserializeAws_json1_0ListBackupsOutput = (output: any, context: __SerdeContext): ListBackupsOutput => { @@ -8447,14 +9028,28 @@ const deserializeAws_json1_0LocalSecondaryIndexDescriptionList = ( output: any, context: __SerdeContext ): LocalSecondaryIndexDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0LocalSecondaryIndexDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0LocalSecondaryIndexDescription(entry, context); + }); }; const deserializeAws_json1_0LocalSecondaryIndexes = ( output: any, context: __SerdeContext ): LocalSecondaryIndexInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0LocalSecondaryIndexInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0LocalSecondaryIndexInfo(entry, context); + }); }; const deserializeAws_json1_0LocalSecondaryIndexInfo = ( @@ -8478,25 +9073,48 @@ const deserializeAws_json1_0MapAttributeValue = ( output: any, context: __SerdeContext ): { [key: string]: AttributeValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0NonKeyAttributeNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0NumberSetAttributeValue = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0PartiQLBatchResponse = (output: any, context: __SerdeContext): BatchStatementResponse[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0BatchStatementResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0BatchStatementResponse(entry, context); + }); }; const deserializeAws_json1_0PointInTimeRecoveryDescription = ( @@ -8605,13 +9223,15 @@ const deserializeAws_json1_0PutItemInputAttributeMap = ( output: any, context: __SerdeContext ): { [key: string]: AttributeValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0PutItemOutput = (output: any, context: __SerdeContext): PutItemOutput => { @@ -8712,7 +9332,14 @@ const deserializeAws_json1_0ReplicaAutoScalingDescriptionList = ( output: any, context: __SerdeContext ): ReplicaAutoScalingDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ReplicaAutoScalingDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ReplicaAutoScalingDescription(entry, context); + }); }; const deserializeAws_json1_0ReplicaDescription = (output: any, context: __SerdeContext): ReplicaDescription => { @@ -8746,7 +9373,14 @@ const deserializeAws_json1_0ReplicaDescription = (output: any, context: __SerdeC }; const deserializeAws_json1_0ReplicaDescriptionList = (output: any, context: __SerdeContext): ReplicaDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ReplicaDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ReplicaDescription(entry, context); + }); }; const deserializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingDescription = ( @@ -8779,9 +9413,14 @@ const deserializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingDescriptionLis output: any, context: __SerdeContext ): ReplicaGlobalSecondaryIndexAutoScalingDescription[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingDescription(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingDescription(entry, context); + }); }; const deserializeAws_json1_0ReplicaGlobalSecondaryIndexDescription = ( @@ -8801,9 +9440,14 @@ const deserializeAws_json1_0ReplicaGlobalSecondaryIndexDescriptionList = ( output: any, context: __SerdeContext ): ReplicaGlobalSecondaryIndexDescription[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_0ReplicaGlobalSecondaryIndexDescription(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ReplicaGlobalSecondaryIndexDescription(entry, context); + }); }; const deserializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsDescription = ( @@ -8844,13 +9488,25 @@ const deserializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsDescriptionList = output: any, context: __SerdeContext ): ReplicaGlobalSecondaryIndexSettingsDescription[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsDescription(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsDescription(entry, context); + }); }; const deserializeAws_json1_0ReplicaList = (output: any, context: __SerdeContext): Replica[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Replica(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Replica(entry, context); + }); }; const deserializeAws_json1_0ReplicaNotFoundException = ( @@ -8912,7 +9568,14 @@ const deserializeAws_json1_0ReplicaSettingsDescriptionList = ( output: any, context: __SerdeContext ): ReplicaSettingsDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ReplicaSettingsDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ReplicaSettingsDescription(entry, context); + }); }; const deserializeAws_json1_0RequestLimitExceeded = (output: any, context: __SerdeContext): RequestLimitExceeded => { @@ -9000,13 +9663,15 @@ const deserializeAws_json1_0SecondaryIndexesCapacityMap = ( output: any, context: __SerdeContext ): { [key: string]: Capacity } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Capacity }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Capacity }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0Capacity(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0SourceTableDetails = (output: any, context: __SerdeContext): SourceTableDetails => { @@ -9084,7 +9749,14 @@ const deserializeAws_json1_0StreamSpecification = (output: any, context: __Serde }; const deserializeAws_json1_0StringSetAttributeValue = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0TableAlreadyExistsException = ( @@ -9187,7 +9859,14 @@ const deserializeAws_json1_0TableInUseException = (output: any, context: __Serde }; const deserializeAws_json1_0TableNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0TableNotFoundException = (output: any, context: __SerdeContext): TableNotFoundException => { @@ -9204,7 +9883,14 @@ const deserializeAws_json1_0Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_0TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Tag(entry, context); + }); }; const deserializeAws_json1_0TimeToLiveDescription = (output: any, context: __SerdeContext): TimeToLiveDescription => { @@ -9400,7 +10086,14 @@ const deserializeAws_json1_0WriteRequest = (output: any, context: __SerdeContext }; const deserializeAws_json1_0WriteRequests = (output: any, context: __SerdeContext): WriteRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0WriteRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0WriteRequest(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -9453,3 +10146,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-ebs/protocols/Aws_restJson1.ts b/clients/client-ebs/protocols/Aws_restJson1.ts index fe68e233d0c1..5652d69ae511 100644 --- a/clients/client-ebs/protocols/Aws_restJson1.ts +++ b/clients/client-ebs/protocols/Aws_restJson1.ts @@ -35,7 +35,6 @@ export const serializeAws_restJson1CompleteSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ChangedBlocksCount) && { "x-amz-ChangedBlocksCount": input.ChangedBlocksCount!.toString(), }), @@ -72,9 +71,7 @@ export const serializeAws_restJson1GetSnapshotBlockCommand = async ( input: GetSnapshotBlockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/snapshots/{SnapshotId}/blocks/{BlockIndex}"; if (input.SnapshotId !== undefined) { const labelValue: string = input.SnapshotId; @@ -115,9 +112,7 @@ export const serializeAws_restJson1ListChangedBlocksCommand = async ( input: ListChangedBlocksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/snapshots/{SecondSnapshotId}/changedblocks"; if (input.SecondSnapshotId !== undefined) { const labelValue: string = input.SecondSnapshotId; @@ -152,9 +147,7 @@ export const serializeAws_restJson1ListSnapshotBlocksCommand = async ( input: ListSnapshotBlocksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/snapshots/{SnapshotId}/blocks"; if (input.SnapshotId !== undefined) { const labelValue: string = input.SnapshotId; @@ -189,7 +182,7 @@ export const serializeAws_restJson1PutSnapshotBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", "x-amz-content-sha256": "UNSIGNED-PAYLOAD", ...(isSerializableHeaderValue(input.Checksum) && { "x-amz-Checksum": input.Checksum! }), ...(isSerializableHeaderValue(input.Progress) && { "x-amz-Progress": input.Progress!.toString() }), @@ -236,19 +229,20 @@ export const serializeAws_restJson1StartSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/snapshots"; let body: any; body = JSON.stringify({ ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Encrypted !== undefined && { Encrypted: input.Encrypted }), - ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), - ...(input.ParentSnapshotId !== undefined && { ParentSnapshotId: input.ParentSnapshotId }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.VolumeSize !== undefined && { VolumeSize: input.VolumeSize }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Encrypted !== undefined && input.Encrypted !== null && { Encrypted: input.Encrypted }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }), + ...(input.ParentSnapshotId !== undefined && + input.ParentSnapshotId !== null && { ParentSnapshotId: input.ParentSnapshotId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.VolumeSize !== undefined && input.VolumeSize !== null && { VolumeSize: input.VolumeSize }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1088,13 +1082,20 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1Block = (output: any, context: __SerdeContext): Block => { @@ -1105,7 +1106,14 @@ const deserializeAws_restJson1Block = (output: any, context: __SerdeContext): Bl }; const deserializeAws_restJson1Blocks = (output: any, context: __SerdeContext): Block[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Block(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Block(entry, context); + }); }; const deserializeAws_restJson1ChangedBlock = (output: any, context: __SerdeContext): ChangedBlock => { @@ -1119,7 +1127,14 @@ const deserializeAws_restJson1ChangedBlock = (output: any, context: __SerdeConte }; const deserializeAws_restJson1ChangedBlocks = (output: any, context: __SerdeContext): ChangedBlock[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChangedBlock(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChangedBlock(entry, context); + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -1130,7 +1145,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1153,6 +1175,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-ec2-instance-connect/protocols/Aws_json1_1.ts b/clients/client-ec2-instance-connect/protocols/Aws_json1_1.ts index 3a12803bc67f..e2ea56aabd77 100644 --- a/clients/client-ec2-instance-connect/protocols/Aws_json1_1.ts +++ b/clients/client-ec2-instance-connect/protocols/Aws_json1_1.ts @@ -23,7 +23,7 @@ export const serializeAws_json1_1SendSSHPublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEC2InstanceConnectService.SendSSHPublicKey", }; let body: any; @@ -58,8 +58,7 @@ const deserializeAws_json1_1SendSSHPublicKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AuthException": case "com.amazonaws.ec2instanceconnect#AuthException": @@ -195,10 +194,12 @@ const deserializeAws_json1_1ThrottlingExceptionResponse = async ( const serializeAws_json1_1SendSSHPublicKeyRequest = (input: SendSSHPublicKeyRequest, context: __SerdeContext): any => { return { - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.InstanceOSUser !== undefined && { InstanceOSUser: input.InstanceOSUser }), - ...(input.SSHPublicKey !== undefined && { SSHPublicKey: input.SSHPublicKey }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.InstanceOSUser !== undefined && + input.InstanceOSUser !== null && { InstanceOSUser: input.InstanceOSUser }), + ...(input.SSHPublicKey !== undefined && input.SSHPublicKey !== null && { SSHPublicKey: input.SSHPublicKey }), }; }; @@ -295,3 +296,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-ec2/protocols/Aws_ec2.ts b/clients/client-ec2/protocols/Aws_ec2.ts index b419b1242a48..b3b7e553fefa 100644 --- a/clients/client-ec2/protocols/Aws_ec2.ts +++ b/clients/client-ec2/protocols/Aws_ec2.ts @@ -2823,7 +2823,7 @@ export const serializeAws_ec2AcceptReservedInstancesExchangeQuoteCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2839,7 +2839,7 @@ export const serializeAws_ec2AcceptTransitGatewayMulticastDomainAssociationsComm context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2855,7 +2855,7 @@ export const serializeAws_ec2AcceptTransitGatewayPeeringAttachmentCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2871,7 +2871,7 @@ export const serializeAws_ec2AcceptTransitGatewayVpcAttachmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2887,7 +2887,7 @@ export const serializeAws_ec2AcceptVpcEndpointConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2903,7 +2903,7 @@ export const serializeAws_ec2AcceptVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2919,7 +2919,7 @@ export const serializeAws_ec2AdvertiseByoipCidrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2935,7 +2935,7 @@ export const serializeAws_ec2AllocateAddressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2951,7 +2951,7 @@ export const serializeAws_ec2AllocateHostsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2967,7 +2967,7 @@ export const serializeAws_ec2ApplySecurityGroupsToClientVpnTargetNetworkCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2983,7 +2983,7 @@ export const serializeAws_ec2AssignIpv6AddressesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2999,7 +2999,7 @@ export const serializeAws_ec2AssignPrivateIpAddressesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3015,7 +3015,7 @@ export const serializeAws_ec2AssociateAddressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3031,7 +3031,7 @@ export const serializeAws_ec2AssociateClientVpnTargetNetworkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3047,7 +3047,7 @@ export const serializeAws_ec2AssociateDhcpOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3063,7 +3063,7 @@ export const serializeAws_ec2AssociateEnclaveCertificateIamRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3079,7 +3079,7 @@ export const serializeAws_ec2AssociateIamInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3095,7 +3095,7 @@ export const serializeAws_ec2AssociateRouteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3111,7 +3111,7 @@ export const serializeAws_ec2AssociateSubnetCidrBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3127,7 +3127,7 @@ export const serializeAws_ec2AssociateTransitGatewayMulticastDomainCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3143,7 +3143,7 @@ export const serializeAws_ec2AssociateTransitGatewayRouteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3159,7 +3159,7 @@ export const serializeAws_ec2AssociateVpcCidrBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3175,7 +3175,7 @@ export const serializeAws_ec2AttachClassicLinkVpcCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3191,7 +3191,7 @@ export const serializeAws_ec2AttachInternetGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3207,7 +3207,7 @@ export const serializeAws_ec2AttachNetworkInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3223,7 +3223,7 @@ export const serializeAws_ec2AttachVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3239,7 +3239,7 @@ export const serializeAws_ec2AttachVpnGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3255,7 +3255,7 @@ export const serializeAws_ec2AuthorizeClientVpnIngressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3271,7 +3271,7 @@ export const serializeAws_ec2AuthorizeSecurityGroupEgressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3287,7 +3287,7 @@ export const serializeAws_ec2AuthorizeSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3303,7 +3303,7 @@ export const serializeAws_ec2BundleInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3319,7 +3319,7 @@ export const serializeAws_ec2CancelBundleTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3335,7 +3335,7 @@ export const serializeAws_ec2CancelCapacityReservationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3351,7 +3351,7 @@ export const serializeAws_ec2CancelConversionTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3367,7 +3367,7 @@ export const serializeAws_ec2CancelExportTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3383,7 +3383,7 @@ export const serializeAws_ec2CancelImportTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3399,7 +3399,7 @@ export const serializeAws_ec2CancelReservedInstancesListingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3415,7 +3415,7 @@ export const serializeAws_ec2CancelSpotFleetRequestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3431,7 +3431,7 @@ export const serializeAws_ec2CancelSpotInstanceRequestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3447,7 +3447,7 @@ export const serializeAws_ec2ConfirmProductInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3463,7 +3463,7 @@ export const serializeAws_ec2CopyFpgaImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3479,7 +3479,7 @@ export const serializeAws_ec2CopyImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3495,7 +3495,7 @@ export const serializeAws_ec2CopySnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3511,7 +3511,7 @@ export const serializeAws_ec2CreateCapacityReservationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3527,7 +3527,7 @@ export const serializeAws_ec2CreateCarrierGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3543,7 +3543,7 @@ export const serializeAws_ec2CreateClientVpnEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3559,7 +3559,7 @@ export const serializeAws_ec2CreateClientVpnRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3575,7 +3575,7 @@ export const serializeAws_ec2CreateCustomerGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3591,7 +3591,7 @@ export const serializeAws_ec2CreateDefaultSubnetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3607,7 +3607,7 @@ export const serializeAws_ec2CreateDefaultVpcCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3623,7 +3623,7 @@ export const serializeAws_ec2CreateDhcpOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3639,7 +3639,7 @@ export const serializeAws_ec2CreateEgressOnlyInternetGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3655,7 +3655,7 @@ export const serializeAws_ec2CreateFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3671,7 +3671,7 @@ export const serializeAws_ec2CreateFlowLogsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3687,7 +3687,7 @@ export const serializeAws_ec2CreateFpgaImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3703,7 +3703,7 @@ export const serializeAws_ec2CreateImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3719,7 +3719,7 @@ export const serializeAws_ec2CreateInstanceExportTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3735,7 +3735,7 @@ export const serializeAws_ec2CreateInternetGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3751,7 +3751,7 @@ export const serializeAws_ec2CreateKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3767,7 +3767,7 @@ export const serializeAws_ec2CreateLaunchTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3783,7 +3783,7 @@ export const serializeAws_ec2CreateLaunchTemplateVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3799,7 +3799,7 @@ export const serializeAws_ec2CreateLocalGatewayRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3815,7 +3815,7 @@ export const serializeAws_ec2CreateLocalGatewayRouteTableVpcAssociationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3831,7 +3831,7 @@ export const serializeAws_ec2CreateManagedPrefixListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3847,7 +3847,7 @@ export const serializeAws_ec2CreateNatGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3863,7 +3863,7 @@ export const serializeAws_ec2CreateNetworkAclCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3879,7 +3879,7 @@ export const serializeAws_ec2CreateNetworkAclEntryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3895,7 +3895,7 @@ export const serializeAws_ec2CreateNetworkInsightsPathCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3911,7 +3911,7 @@ export const serializeAws_ec2CreateNetworkInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3927,7 +3927,7 @@ export const serializeAws_ec2CreateNetworkInterfacePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3943,7 +3943,7 @@ export const serializeAws_ec2CreatePlacementGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3959,7 +3959,7 @@ export const serializeAws_ec2CreateReservedInstancesListingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3975,7 +3975,7 @@ export const serializeAws_ec2CreateRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3991,7 +3991,7 @@ export const serializeAws_ec2CreateRouteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4007,7 +4007,7 @@ export const serializeAws_ec2CreateSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4023,7 +4023,7 @@ export const serializeAws_ec2CreateSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4039,7 +4039,7 @@ export const serializeAws_ec2CreateSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4055,7 +4055,7 @@ export const serializeAws_ec2CreateSpotDatafeedSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4071,7 +4071,7 @@ export const serializeAws_ec2CreateSubnetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4087,7 +4087,7 @@ export const serializeAws_ec2CreateTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4103,7 +4103,7 @@ export const serializeAws_ec2CreateTrafficMirrorFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4119,7 +4119,7 @@ export const serializeAws_ec2CreateTrafficMirrorFilterRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4135,7 +4135,7 @@ export const serializeAws_ec2CreateTrafficMirrorSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4151,7 +4151,7 @@ export const serializeAws_ec2CreateTrafficMirrorTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4167,7 +4167,7 @@ export const serializeAws_ec2CreateTransitGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4183,7 +4183,7 @@ export const serializeAws_ec2CreateTransitGatewayConnectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4199,7 +4199,7 @@ export const serializeAws_ec2CreateTransitGatewayConnectPeerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4215,7 +4215,7 @@ export const serializeAws_ec2CreateTransitGatewayMulticastDomainCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4231,7 +4231,7 @@ export const serializeAws_ec2CreateTransitGatewayPeeringAttachmentCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4247,7 +4247,7 @@ export const serializeAws_ec2CreateTransitGatewayPrefixListReferenceCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4263,7 +4263,7 @@ export const serializeAws_ec2CreateTransitGatewayRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4279,7 +4279,7 @@ export const serializeAws_ec2CreateTransitGatewayRouteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4295,7 +4295,7 @@ export const serializeAws_ec2CreateTransitGatewayVpcAttachmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4311,7 +4311,7 @@ export const serializeAws_ec2CreateVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4327,7 +4327,7 @@ export const serializeAws_ec2CreateVpcCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4343,7 +4343,7 @@ export const serializeAws_ec2CreateVpcEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4359,7 +4359,7 @@ export const serializeAws_ec2CreateVpcEndpointConnectionNotificationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4375,7 +4375,7 @@ export const serializeAws_ec2CreateVpcEndpointServiceConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4391,7 +4391,7 @@ export const serializeAws_ec2CreateVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4407,7 +4407,7 @@ export const serializeAws_ec2CreateVpnConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4423,7 +4423,7 @@ export const serializeAws_ec2CreateVpnConnectionRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4439,7 +4439,7 @@ export const serializeAws_ec2CreateVpnGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4455,7 +4455,7 @@ export const serializeAws_ec2DeleteCarrierGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4471,7 +4471,7 @@ export const serializeAws_ec2DeleteClientVpnEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4487,7 +4487,7 @@ export const serializeAws_ec2DeleteClientVpnRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4503,7 +4503,7 @@ export const serializeAws_ec2DeleteCustomerGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4519,7 +4519,7 @@ export const serializeAws_ec2DeleteDhcpOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4535,7 +4535,7 @@ export const serializeAws_ec2DeleteEgressOnlyInternetGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4551,7 +4551,7 @@ export const serializeAws_ec2DeleteFleetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4567,7 +4567,7 @@ export const serializeAws_ec2DeleteFlowLogsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4583,7 +4583,7 @@ export const serializeAws_ec2DeleteFpgaImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4599,7 +4599,7 @@ export const serializeAws_ec2DeleteInternetGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4615,7 +4615,7 @@ export const serializeAws_ec2DeleteKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4631,7 +4631,7 @@ export const serializeAws_ec2DeleteLaunchTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4647,7 +4647,7 @@ export const serializeAws_ec2DeleteLaunchTemplateVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4663,7 +4663,7 @@ export const serializeAws_ec2DeleteLocalGatewayRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4679,7 +4679,7 @@ export const serializeAws_ec2DeleteLocalGatewayRouteTableVpcAssociationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4695,7 +4695,7 @@ export const serializeAws_ec2DeleteManagedPrefixListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4711,7 +4711,7 @@ export const serializeAws_ec2DeleteNatGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4727,7 +4727,7 @@ export const serializeAws_ec2DeleteNetworkAclCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4743,7 +4743,7 @@ export const serializeAws_ec2DeleteNetworkAclEntryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4759,7 +4759,7 @@ export const serializeAws_ec2DeleteNetworkInsightsAnalysisCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4775,7 +4775,7 @@ export const serializeAws_ec2DeleteNetworkInsightsPathCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4791,7 +4791,7 @@ export const serializeAws_ec2DeleteNetworkInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4807,7 +4807,7 @@ export const serializeAws_ec2DeleteNetworkInterfacePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4823,7 +4823,7 @@ export const serializeAws_ec2DeletePlacementGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4839,7 +4839,7 @@ export const serializeAws_ec2DeleteQueuedReservedInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4855,7 +4855,7 @@ export const serializeAws_ec2DeleteRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4871,7 +4871,7 @@ export const serializeAws_ec2DeleteRouteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4887,7 +4887,7 @@ export const serializeAws_ec2DeleteSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4903,7 +4903,7 @@ export const serializeAws_ec2DeleteSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4919,7 +4919,7 @@ export const serializeAws_ec2DeleteSpotDatafeedSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4935,7 +4935,7 @@ export const serializeAws_ec2DeleteSubnetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4951,7 +4951,7 @@ export const serializeAws_ec2DeleteTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4967,7 +4967,7 @@ export const serializeAws_ec2DeleteTrafficMirrorFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4983,7 +4983,7 @@ export const serializeAws_ec2DeleteTrafficMirrorFilterRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4999,7 +4999,7 @@ export const serializeAws_ec2DeleteTrafficMirrorSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5015,7 +5015,7 @@ export const serializeAws_ec2DeleteTrafficMirrorTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5031,7 +5031,7 @@ export const serializeAws_ec2DeleteTransitGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5047,7 +5047,7 @@ export const serializeAws_ec2DeleteTransitGatewayConnectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5063,7 +5063,7 @@ export const serializeAws_ec2DeleteTransitGatewayConnectPeerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5079,7 +5079,7 @@ export const serializeAws_ec2DeleteTransitGatewayMulticastDomainCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5095,7 +5095,7 @@ export const serializeAws_ec2DeleteTransitGatewayPeeringAttachmentCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5111,7 +5111,7 @@ export const serializeAws_ec2DeleteTransitGatewayPrefixListReferenceCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5127,7 +5127,7 @@ export const serializeAws_ec2DeleteTransitGatewayRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5143,7 +5143,7 @@ export const serializeAws_ec2DeleteTransitGatewayRouteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5159,7 +5159,7 @@ export const serializeAws_ec2DeleteTransitGatewayVpcAttachmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5175,7 +5175,7 @@ export const serializeAws_ec2DeleteVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5191,7 +5191,7 @@ export const serializeAws_ec2DeleteVpcCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5207,7 +5207,7 @@ export const serializeAws_ec2DeleteVpcEndpointConnectionNotificationsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5223,7 +5223,7 @@ export const serializeAws_ec2DeleteVpcEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5239,7 +5239,7 @@ export const serializeAws_ec2DeleteVpcEndpointServiceConfigurationsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5255,7 +5255,7 @@ export const serializeAws_ec2DeleteVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5271,7 +5271,7 @@ export const serializeAws_ec2DeleteVpnConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5287,7 +5287,7 @@ export const serializeAws_ec2DeleteVpnConnectionRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5303,7 +5303,7 @@ export const serializeAws_ec2DeleteVpnGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5319,7 +5319,7 @@ export const serializeAws_ec2DeprovisionByoipCidrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5335,7 +5335,7 @@ export const serializeAws_ec2DeregisterImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5351,7 +5351,7 @@ export const serializeAws_ec2DeregisterInstanceEventNotificationAttributesComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5367,7 +5367,7 @@ export const serializeAws_ec2DeregisterTransitGatewayMulticastGroupMembersComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5383,7 +5383,7 @@ export const serializeAws_ec2DeregisterTransitGatewayMulticastGroupSourcesComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5399,7 +5399,7 @@ export const serializeAws_ec2DescribeAccountAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5415,7 +5415,7 @@ export const serializeAws_ec2DescribeAddressesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5431,7 +5431,7 @@ export const serializeAws_ec2DescribeAggregateIdFormatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5447,7 +5447,7 @@ export const serializeAws_ec2DescribeAvailabilityZonesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5463,7 +5463,7 @@ export const serializeAws_ec2DescribeBundleTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5479,7 +5479,7 @@ export const serializeAws_ec2DescribeByoipCidrsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5495,7 +5495,7 @@ export const serializeAws_ec2DescribeCapacityReservationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5511,7 +5511,7 @@ export const serializeAws_ec2DescribeCarrierGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5527,7 +5527,7 @@ export const serializeAws_ec2DescribeClassicLinkInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5543,7 +5543,7 @@ export const serializeAws_ec2DescribeClientVpnAuthorizationRulesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5559,7 +5559,7 @@ export const serializeAws_ec2DescribeClientVpnConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5575,7 +5575,7 @@ export const serializeAws_ec2DescribeClientVpnEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5591,7 +5591,7 @@ export const serializeAws_ec2DescribeClientVpnRoutesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5607,7 +5607,7 @@ export const serializeAws_ec2DescribeClientVpnTargetNetworksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5623,7 +5623,7 @@ export const serializeAws_ec2DescribeCoipPoolsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5639,7 +5639,7 @@ export const serializeAws_ec2DescribeConversionTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5655,7 +5655,7 @@ export const serializeAws_ec2DescribeCustomerGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5671,7 +5671,7 @@ export const serializeAws_ec2DescribeDhcpOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5687,7 +5687,7 @@ export const serializeAws_ec2DescribeEgressOnlyInternetGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5703,7 +5703,7 @@ export const serializeAws_ec2DescribeElasticGpusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5719,7 +5719,7 @@ export const serializeAws_ec2DescribeExportImageTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5735,7 +5735,7 @@ export const serializeAws_ec2DescribeExportTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5751,7 +5751,7 @@ export const serializeAws_ec2DescribeFastSnapshotRestoresCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5767,7 +5767,7 @@ export const serializeAws_ec2DescribeFleetHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5783,7 +5783,7 @@ export const serializeAws_ec2DescribeFleetInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5799,7 +5799,7 @@ export const serializeAws_ec2DescribeFleetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5815,7 +5815,7 @@ export const serializeAws_ec2DescribeFlowLogsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5831,7 +5831,7 @@ export const serializeAws_ec2DescribeFpgaImageAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5847,7 +5847,7 @@ export const serializeAws_ec2DescribeFpgaImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5863,7 +5863,7 @@ export const serializeAws_ec2DescribeHostReservationOfferingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5879,7 +5879,7 @@ export const serializeAws_ec2DescribeHostReservationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5895,7 +5895,7 @@ export const serializeAws_ec2DescribeHostsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5911,7 +5911,7 @@ export const serializeAws_ec2DescribeIamInstanceProfileAssociationsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5927,7 +5927,7 @@ export const serializeAws_ec2DescribeIdentityIdFormatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5943,7 +5943,7 @@ export const serializeAws_ec2DescribeIdFormatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5959,7 +5959,7 @@ export const serializeAws_ec2DescribeImageAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5975,7 +5975,7 @@ export const serializeAws_ec2DescribeImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -5991,7 +5991,7 @@ export const serializeAws_ec2DescribeImportImageTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6007,7 +6007,7 @@ export const serializeAws_ec2DescribeImportSnapshotTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6023,7 +6023,7 @@ export const serializeAws_ec2DescribeInstanceAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6039,7 +6039,7 @@ export const serializeAws_ec2DescribeInstanceCreditSpecificationsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6055,7 +6055,7 @@ export const serializeAws_ec2DescribeInstanceEventNotificationAttributesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6071,7 +6071,7 @@ export const serializeAws_ec2DescribeInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6087,7 +6087,7 @@ export const serializeAws_ec2DescribeInstanceStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6103,7 +6103,7 @@ export const serializeAws_ec2DescribeInstanceTypeOfferingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6119,7 +6119,7 @@ export const serializeAws_ec2DescribeInstanceTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6135,7 +6135,7 @@ export const serializeAws_ec2DescribeInternetGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6151,7 +6151,7 @@ export const serializeAws_ec2DescribeIpv6PoolsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6167,7 +6167,7 @@ export const serializeAws_ec2DescribeKeyPairsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6183,7 +6183,7 @@ export const serializeAws_ec2DescribeLaunchTemplatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6199,7 +6199,7 @@ export const serializeAws_ec2DescribeLaunchTemplateVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6215,7 +6215,7 @@ export const serializeAws_ec2DescribeLocalGatewayRouteTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6231,7 +6231,7 @@ export const serializeAws_ec2DescribeLocalGatewayRouteTableVirtualInterfaceGroup context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6247,7 +6247,7 @@ export const serializeAws_ec2DescribeLocalGatewayRouteTableVpcAssociationsComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6263,7 +6263,7 @@ export const serializeAws_ec2DescribeLocalGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6279,7 +6279,7 @@ export const serializeAws_ec2DescribeLocalGatewayVirtualInterfaceGroupsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6295,7 +6295,7 @@ export const serializeAws_ec2DescribeLocalGatewayVirtualInterfacesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6311,7 +6311,7 @@ export const serializeAws_ec2DescribeManagedPrefixListsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6327,7 +6327,7 @@ export const serializeAws_ec2DescribeMovingAddressesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6343,7 +6343,7 @@ export const serializeAws_ec2DescribeNatGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6359,7 +6359,7 @@ export const serializeAws_ec2DescribeNetworkAclsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6375,7 +6375,7 @@ export const serializeAws_ec2DescribeNetworkInsightsAnalysesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6391,7 +6391,7 @@ export const serializeAws_ec2DescribeNetworkInsightsPathsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6407,7 +6407,7 @@ export const serializeAws_ec2DescribeNetworkInterfaceAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6423,7 +6423,7 @@ export const serializeAws_ec2DescribeNetworkInterfacePermissionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6439,7 +6439,7 @@ export const serializeAws_ec2DescribeNetworkInterfacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6455,7 +6455,7 @@ export const serializeAws_ec2DescribePlacementGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6471,7 +6471,7 @@ export const serializeAws_ec2DescribePrefixListsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6487,7 +6487,7 @@ export const serializeAws_ec2DescribePrincipalIdFormatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6503,7 +6503,7 @@ export const serializeAws_ec2DescribePublicIpv4PoolsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6519,7 +6519,7 @@ export const serializeAws_ec2DescribeRegionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6535,7 +6535,7 @@ export const serializeAws_ec2DescribeReservedInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6551,7 +6551,7 @@ export const serializeAws_ec2DescribeReservedInstancesListingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6567,7 +6567,7 @@ export const serializeAws_ec2DescribeReservedInstancesModificationsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6583,7 +6583,7 @@ export const serializeAws_ec2DescribeReservedInstancesOfferingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6599,7 +6599,7 @@ export const serializeAws_ec2DescribeRouteTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6615,7 +6615,7 @@ export const serializeAws_ec2DescribeScheduledInstanceAvailabilityCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6631,7 +6631,7 @@ export const serializeAws_ec2DescribeScheduledInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6647,7 +6647,7 @@ export const serializeAws_ec2DescribeSecurityGroupReferencesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6663,7 +6663,7 @@ export const serializeAws_ec2DescribeSecurityGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6679,7 +6679,7 @@ export const serializeAws_ec2DescribeSnapshotAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6695,7 +6695,7 @@ export const serializeAws_ec2DescribeSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6711,7 +6711,7 @@ export const serializeAws_ec2DescribeSpotDatafeedSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6727,7 +6727,7 @@ export const serializeAws_ec2DescribeSpotFleetInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6743,7 +6743,7 @@ export const serializeAws_ec2DescribeSpotFleetRequestHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6759,7 +6759,7 @@ export const serializeAws_ec2DescribeSpotFleetRequestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6775,7 +6775,7 @@ export const serializeAws_ec2DescribeSpotInstanceRequestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6791,7 +6791,7 @@ export const serializeAws_ec2DescribeSpotPriceHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6807,7 +6807,7 @@ export const serializeAws_ec2DescribeStaleSecurityGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6823,7 +6823,7 @@ export const serializeAws_ec2DescribeSubnetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6839,7 +6839,7 @@ export const serializeAws_ec2DescribeTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6855,7 +6855,7 @@ export const serializeAws_ec2DescribeTrafficMirrorFiltersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6871,7 +6871,7 @@ export const serializeAws_ec2DescribeTrafficMirrorSessionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6887,7 +6887,7 @@ export const serializeAws_ec2DescribeTrafficMirrorTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6903,7 +6903,7 @@ export const serializeAws_ec2DescribeTransitGatewayAttachmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6919,7 +6919,7 @@ export const serializeAws_ec2DescribeTransitGatewayConnectPeersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6935,7 +6935,7 @@ export const serializeAws_ec2DescribeTransitGatewayConnectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6951,7 +6951,7 @@ export const serializeAws_ec2DescribeTransitGatewayMulticastDomainsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6967,7 +6967,7 @@ export const serializeAws_ec2DescribeTransitGatewayPeeringAttachmentsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6983,7 +6983,7 @@ export const serializeAws_ec2DescribeTransitGatewayRouteTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6999,7 +6999,7 @@ export const serializeAws_ec2DescribeTransitGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7015,7 +7015,7 @@ export const serializeAws_ec2DescribeTransitGatewayVpcAttachmentsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7031,7 +7031,7 @@ export const serializeAws_ec2DescribeVolumeAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7047,7 +7047,7 @@ export const serializeAws_ec2DescribeVolumesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7063,7 +7063,7 @@ export const serializeAws_ec2DescribeVolumesModificationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7079,7 +7079,7 @@ export const serializeAws_ec2DescribeVolumeStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7095,7 +7095,7 @@ export const serializeAws_ec2DescribeVpcAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7111,7 +7111,7 @@ export const serializeAws_ec2DescribeVpcClassicLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7127,7 +7127,7 @@ export const serializeAws_ec2DescribeVpcClassicLinkDnsSupportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7143,7 +7143,7 @@ export const serializeAws_ec2DescribeVpcEndpointConnectionNotificationsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7159,7 +7159,7 @@ export const serializeAws_ec2DescribeVpcEndpointConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7175,7 +7175,7 @@ export const serializeAws_ec2DescribeVpcEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7191,7 +7191,7 @@ export const serializeAws_ec2DescribeVpcEndpointServiceConfigurationsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7207,7 +7207,7 @@ export const serializeAws_ec2DescribeVpcEndpointServicePermissionsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7223,7 +7223,7 @@ export const serializeAws_ec2DescribeVpcEndpointServicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7239,7 +7239,7 @@ export const serializeAws_ec2DescribeVpcPeeringConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7255,7 +7255,7 @@ export const serializeAws_ec2DescribeVpcsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7271,7 +7271,7 @@ export const serializeAws_ec2DescribeVpnConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7287,7 +7287,7 @@ export const serializeAws_ec2DescribeVpnGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7303,7 +7303,7 @@ export const serializeAws_ec2DetachClassicLinkVpcCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7319,7 +7319,7 @@ export const serializeAws_ec2DetachInternetGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7335,7 +7335,7 @@ export const serializeAws_ec2DetachNetworkInterfaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7351,7 +7351,7 @@ export const serializeAws_ec2DetachVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7367,7 +7367,7 @@ export const serializeAws_ec2DetachVpnGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7383,7 +7383,7 @@ export const serializeAws_ec2DisableEbsEncryptionByDefaultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7399,7 +7399,7 @@ export const serializeAws_ec2DisableFastSnapshotRestoresCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7415,7 +7415,7 @@ export const serializeAws_ec2DisableTransitGatewayRouteTablePropagationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7431,7 +7431,7 @@ export const serializeAws_ec2DisableVgwRoutePropagationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7447,7 +7447,7 @@ export const serializeAws_ec2DisableVpcClassicLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7463,7 +7463,7 @@ export const serializeAws_ec2DisableVpcClassicLinkDnsSupportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7479,7 +7479,7 @@ export const serializeAws_ec2DisassociateAddressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7495,7 +7495,7 @@ export const serializeAws_ec2DisassociateClientVpnTargetNetworkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7511,7 +7511,7 @@ export const serializeAws_ec2DisassociateEnclaveCertificateIamRoleCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7527,7 +7527,7 @@ export const serializeAws_ec2DisassociateIamInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7543,7 +7543,7 @@ export const serializeAws_ec2DisassociateRouteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7559,7 +7559,7 @@ export const serializeAws_ec2DisassociateSubnetCidrBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7575,7 +7575,7 @@ export const serializeAws_ec2DisassociateTransitGatewayMulticastDomainCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7591,7 +7591,7 @@ export const serializeAws_ec2DisassociateTransitGatewayRouteTableCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7607,7 +7607,7 @@ export const serializeAws_ec2DisassociateVpcCidrBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7623,7 +7623,7 @@ export const serializeAws_ec2EnableEbsEncryptionByDefaultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7639,7 +7639,7 @@ export const serializeAws_ec2EnableFastSnapshotRestoresCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7655,7 +7655,7 @@ export const serializeAws_ec2EnableTransitGatewayRouteTablePropagationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7671,7 +7671,7 @@ export const serializeAws_ec2EnableVgwRoutePropagationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7687,7 +7687,7 @@ export const serializeAws_ec2EnableVolumeIOCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7703,7 +7703,7 @@ export const serializeAws_ec2EnableVpcClassicLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7719,7 +7719,7 @@ export const serializeAws_ec2EnableVpcClassicLinkDnsSupportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7735,7 +7735,7 @@ export const serializeAws_ec2ExportClientVpnClientCertificateRevocationListComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7751,7 +7751,7 @@ export const serializeAws_ec2ExportClientVpnClientConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7767,7 +7767,7 @@ export const serializeAws_ec2ExportImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7783,7 +7783,7 @@ export const serializeAws_ec2ExportTransitGatewayRoutesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7799,7 +7799,7 @@ export const serializeAws_ec2GetAssociatedEnclaveCertificateIamRolesCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7815,7 +7815,7 @@ export const serializeAws_ec2GetAssociatedIpv6PoolCidrsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7831,7 +7831,7 @@ export const serializeAws_ec2GetCapacityReservationUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7847,7 +7847,7 @@ export const serializeAws_ec2GetCoipPoolUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7863,7 +7863,7 @@ export const serializeAws_ec2GetConsoleOutputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7879,7 +7879,7 @@ export const serializeAws_ec2GetConsoleScreenshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7895,7 +7895,7 @@ export const serializeAws_ec2GetDefaultCreditSpecificationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7911,7 +7911,7 @@ export const serializeAws_ec2GetEbsDefaultKmsKeyIdCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7927,7 +7927,7 @@ export const serializeAws_ec2GetEbsEncryptionByDefaultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7943,7 +7943,7 @@ export const serializeAws_ec2GetGroupsForCapacityReservationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7959,7 +7959,7 @@ export const serializeAws_ec2GetHostReservationPurchasePreviewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7975,7 +7975,7 @@ export const serializeAws_ec2GetLaunchTemplateDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7991,7 +7991,7 @@ export const serializeAws_ec2GetManagedPrefixListAssociationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8007,7 +8007,7 @@ export const serializeAws_ec2GetManagedPrefixListEntriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8023,7 +8023,7 @@ export const serializeAws_ec2GetPasswordDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8039,7 +8039,7 @@ export const serializeAws_ec2GetReservedInstancesExchangeQuoteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8055,7 +8055,7 @@ export const serializeAws_ec2GetTransitGatewayAttachmentPropagationsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8071,7 +8071,7 @@ export const serializeAws_ec2GetTransitGatewayMulticastDomainAssociationsCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8087,7 +8087,7 @@ export const serializeAws_ec2GetTransitGatewayPrefixListReferencesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8103,7 +8103,7 @@ export const serializeAws_ec2GetTransitGatewayRouteTableAssociationsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8119,7 +8119,7 @@ export const serializeAws_ec2GetTransitGatewayRouteTablePropagationsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8135,7 +8135,7 @@ export const serializeAws_ec2ImportClientVpnClientCertificateRevocationListComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8151,7 +8151,7 @@ export const serializeAws_ec2ImportImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8167,7 +8167,7 @@ export const serializeAws_ec2ImportInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8183,7 +8183,7 @@ export const serializeAws_ec2ImportKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8199,7 +8199,7 @@ export const serializeAws_ec2ImportSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8215,7 +8215,7 @@ export const serializeAws_ec2ImportVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8231,7 +8231,7 @@ export const serializeAws_ec2ModifyAvailabilityZoneGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8247,7 +8247,7 @@ export const serializeAws_ec2ModifyCapacityReservationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8263,7 +8263,7 @@ export const serializeAws_ec2ModifyClientVpnEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8279,7 +8279,7 @@ export const serializeAws_ec2ModifyDefaultCreditSpecificationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8295,7 +8295,7 @@ export const serializeAws_ec2ModifyEbsDefaultKmsKeyIdCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8311,7 +8311,7 @@ export const serializeAws_ec2ModifyFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8327,7 +8327,7 @@ export const serializeAws_ec2ModifyFpgaImageAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8343,7 +8343,7 @@ export const serializeAws_ec2ModifyHostsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8359,7 +8359,7 @@ export const serializeAws_ec2ModifyIdentityIdFormatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8375,7 +8375,7 @@ export const serializeAws_ec2ModifyIdFormatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8391,7 +8391,7 @@ export const serializeAws_ec2ModifyImageAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8407,7 +8407,7 @@ export const serializeAws_ec2ModifyInstanceAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8423,7 +8423,7 @@ export const serializeAws_ec2ModifyInstanceCapacityReservationAttributesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8439,7 +8439,7 @@ export const serializeAws_ec2ModifyInstanceCreditSpecificationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8455,7 +8455,7 @@ export const serializeAws_ec2ModifyInstanceEventStartTimeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8471,7 +8471,7 @@ export const serializeAws_ec2ModifyInstanceMetadataOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8487,7 +8487,7 @@ export const serializeAws_ec2ModifyInstancePlacementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8503,7 +8503,7 @@ export const serializeAws_ec2ModifyLaunchTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8519,7 +8519,7 @@ export const serializeAws_ec2ModifyManagedPrefixListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8535,7 +8535,7 @@ export const serializeAws_ec2ModifyNetworkInterfaceAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8551,7 +8551,7 @@ export const serializeAws_ec2ModifyReservedInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8567,7 +8567,7 @@ export const serializeAws_ec2ModifySnapshotAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8583,7 +8583,7 @@ export const serializeAws_ec2ModifySpotFleetRequestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8599,7 +8599,7 @@ export const serializeAws_ec2ModifySubnetAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8615,7 +8615,7 @@ export const serializeAws_ec2ModifyTrafficMirrorFilterNetworkServicesCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8631,7 +8631,7 @@ export const serializeAws_ec2ModifyTrafficMirrorFilterRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8647,7 +8647,7 @@ export const serializeAws_ec2ModifyTrafficMirrorSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8663,7 +8663,7 @@ export const serializeAws_ec2ModifyTransitGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8679,7 +8679,7 @@ export const serializeAws_ec2ModifyTransitGatewayPrefixListReferenceCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8695,7 +8695,7 @@ export const serializeAws_ec2ModifyTransitGatewayVpcAttachmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8711,7 +8711,7 @@ export const serializeAws_ec2ModifyVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8727,7 +8727,7 @@ export const serializeAws_ec2ModifyVolumeAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8743,7 +8743,7 @@ export const serializeAws_ec2ModifyVpcAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8759,7 +8759,7 @@ export const serializeAws_ec2ModifyVpcEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8775,7 +8775,7 @@ export const serializeAws_ec2ModifyVpcEndpointConnectionNotificationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8791,7 +8791,7 @@ export const serializeAws_ec2ModifyVpcEndpointServiceConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8807,7 +8807,7 @@ export const serializeAws_ec2ModifyVpcEndpointServicePermissionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8823,7 +8823,7 @@ export const serializeAws_ec2ModifyVpcPeeringConnectionOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8839,7 +8839,7 @@ export const serializeAws_ec2ModifyVpcTenancyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8855,7 +8855,7 @@ export const serializeAws_ec2ModifyVpnConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8871,7 +8871,7 @@ export const serializeAws_ec2ModifyVpnConnectionOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8887,7 +8887,7 @@ export const serializeAws_ec2ModifyVpnTunnelCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8903,7 +8903,7 @@ export const serializeAws_ec2ModifyVpnTunnelOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8919,7 +8919,7 @@ export const serializeAws_ec2MonitorInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8935,7 +8935,7 @@ export const serializeAws_ec2MoveAddressToVpcCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8951,7 +8951,7 @@ export const serializeAws_ec2ProvisionByoipCidrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8967,7 +8967,7 @@ export const serializeAws_ec2PurchaseHostReservationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8983,7 +8983,7 @@ export const serializeAws_ec2PurchaseReservedInstancesOfferingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8999,7 +8999,7 @@ export const serializeAws_ec2PurchaseScheduledInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9015,7 +9015,7 @@ export const serializeAws_ec2RebootInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9031,7 +9031,7 @@ export const serializeAws_ec2RegisterImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9047,7 +9047,7 @@ export const serializeAws_ec2RegisterInstanceEventNotificationAttributesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9063,7 +9063,7 @@ export const serializeAws_ec2RegisterTransitGatewayMulticastGroupMembersCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9079,7 +9079,7 @@ export const serializeAws_ec2RegisterTransitGatewayMulticastGroupSourcesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9095,7 +9095,7 @@ export const serializeAws_ec2RejectTransitGatewayMulticastDomainAssociationsComm context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9111,7 +9111,7 @@ export const serializeAws_ec2RejectTransitGatewayPeeringAttachmentCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9127,7 +9127,7 @@ export const serializeAws_ec2RejectTransitGatewayVpcAttachmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9143,7 +9143,7 @@ export const serializeAws_ec2RejectVpcEndpointConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9159,7 +9159,7 @@ export const serializeAws_ec2RejectVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9175,7 +9175,7 @@ export const serializeAws_ec2ReleaseAddressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9191,7 +9191,7 @@ export const serializeAws_ec2ReleaseHostsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9207,7 +9207,7 @@ export const serializeAws_ec2ReplaceIamInstanceProfileAssociationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9223,7 +9223,7 @@ export const serializeAws_ec2ReplaceNetworkAclAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9239,7 +9239,7 @@ export const serializeAws_ec2ReplaceNetworkAclEntryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9255,7 +9255,7 @@ export const serializeAws_ec2ReplaceRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9271,7 +9271,7 @@ export const serializeAws_ec2ReplaceRouteTableAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9287,7 +9287,7 @@ export const serializeAws_ec2ReplaceTransitGatewayRouteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9303,7 +9303,7 @@ export const serializeAws_ec2ReportInstanceStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9319,7 +9319,7 @@ export const serializeAws_ec2RequestSpotFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9335,7 +9335,7 @@ export const serializeAws_ec2RequestSpotInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9351,7 +9351,7 @@ export const serializeAws_ec2ResetEbsDefaultKmsKeyIdCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9367,7 +9367,7 @@ export const serializeAws_ec2ResetFpgaImageAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9383,7 +9383,7 @@ export const serializeAws_ec2ResetImageAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9399,7 +9399,7 @@ export const serializeAws_ec2ResetInstanceAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9415,7 +9415,7 @@ export const serializeAws_ec2ResetNetworkInterfaceAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9431,7 +9431,7 @@ export const serializeAws_ec2ResetSnapshotAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9447,7 +9447,7 @@ export const serializeAws_ec2RestoreAddressToClassicCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9463,7 +9463,7 @@ export const serializeAws_ec2RestoreManagedPrefixListVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9479,7 +9479,7 @@ export const serializeAws_ec2RevokeClientVpnIngressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9495,7 +9495,7 @@ export const serializeAws_ec2RevokeSecurityGroupEgressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9511,7 +9511,7 @@ export const serializeAws_ec2RevokeSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9527,7 +9527,7 @@ export const serializeAws_ec2RunInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9543,7 +9543,7 @@ export const serializeAws_ec2RunScheduledInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9559,7 +9559,7 @@ export const serializeAws_ec2SearchLocalGatewayRoutesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9575,7 +9575,7 @@ export const serializeAws_ec2SearchTransitGatewayMulticastGroupsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9591,7 +9591,7 @@ export const serializeAws_ec2SearchTransitGatewayRoutesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9607,7 +9607,7 @@ export const serializeAws_ec2SendDiagnosticInterruptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9623,7 +9623,7 @@ export const serializeAws_ec2StartInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9639,7 +9639,7 @@ export const serializeAws_ec2StartNetworkInsightsAnalysisCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9655,7 +9655,7 @@ export const serializeAws_ec2StartVpcEndpointServicePrivateDnsVerificationComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9671,7 +9671,7 @@ export const serializeAws_ec2StopInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9687,7 +9687,7 @@ export const serializeAws_ec2TerminateClientVpnConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9703,7 +9703,7 @@ export const serializeAws_ec2TerminateInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9719,7 +9719,7 @@ export const serializeAws_ec2UnassignIpv6AddressesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9735,7 +9735,7 @@ export const serializeAws_ec2UnassignPrivateIpAddressesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9751,7 +9751,7 @@ export const serializeAws_ec2UnmonitorInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9767,7 +9767,7 @@ export const serializeAws_ec2UpdateSecurityGroupRuleDescriptionsEgressCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9783,7 +9783,7 @@ export const serializeAws_ec2UpdateSecurityGroupRuleDescriptionsIngressCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -9799,7 +9799,7 @@ export const serializeAws_ec2WithdrawByoipCidrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -29746,17 +29746,17 @@ const serializeAws_ec2AcceptReservedInstancesExchangeQuoteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ReservedInstanceIds !== undefined) { + if (input.ReservedInstanceIds !== undefined && input.ReservedInstanceIds !== null) { const memberEntries = serializeAws_ec2ReservedInstanceIdSet(input.ReservedInstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReservedInstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.TargetConfigurations !== undefined) { + if (input.TargetConfigurations !== undefined && input.TargetConfigurations !== null) { const memberEntries = serializeAws_ec2TargetConfigurationRequestSet(input.TargetConfigurations, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetConfiguration.${key.substring(key.indexOf(".") + 1)}`; @@ -29771,20 +29771,20 @@ const serializeAws_ec2AcceptTransitGatewayMulticastDomainAssociationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -29795,10 +29795,10 @@ const serializeAws_ec2AcceptTransitGatewayPeeringAttachmentRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -29809,10 +29809,10 @@ const serializeAws_ec2AcceptTransitGatewayVpcAttachmentRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -29823,13 +29823,13 @@ const serializeAws_ec2AcceptVpcEndpointConnectionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceId !== undefined) { + if (input.ServiceId !== undefined && input.ServiceId !== null) { entries["ServiceId"] = input.ServiceId; } - if (input.VpcEndpointIds !== undefined) { + if (input.VpcEndpointIds !== undefined && input.VpcEndpointIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointIdList(input.VpcEndpointIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcEndpointId.${key.substring(key.indexOf(".") + 1)}`; @@ -29844,10 +29844,10 @@ const serializeAws_ec2AcceptVpcPeeringConnectionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcPeeringConnectionId !== undefined) { + if (input.VpcPeeringConnectionId !== undefined && input.VpcPeeringConnectionId !== null) { entries["VpcPeeringConnectionId"] = input.VpcPeeringConnectionId; } return entries; @@ -29860,6 +29860,9 @@ const serializeAws_ec2AccountAttributeNameStringList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AttributeName.${counter}`] = entry; counter++; } @@ -29870,6 +29873,9 @@ const serializeAws_ec2AddPrefixListEntries = (input: AddPrefixListEntry[], conte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2AddPrefixListEntry(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Member.${counter}.${key}`] = value; @@ -29881,10 +29887,10 @@ const serializeAws_ec2AddPrefixListEntries = (input: AddPrefixListEntry[], conte const serializeAws_ec2AddPrefixListEntry = (input: AddPrefixListEntry, context: __SerdeContext): any => { const entries: any = {}; - if (input.Cidr !== undefined) { + if (input.Cidr !== undefined && input.Cidr !== null) { entries["Cidr"] = input.Cidr; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -29892,10 +29898,10 @@ const serializeAws_ec2AddPrefixListEntry = (input: AddPrefixListEntry, context: const serializeAws_ec2AdvertiseByoipCidrRequest = (input: AdvertiseByoipCidrRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Cidr !== undefined) { + if (input.Cidr !== undefined && input.Cidr !== null) { entries["Cidr"] = input.Cidr; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -29903,22 +29909,22 @@ const serializeAws_ec2AdvertiseByoipCidrRequest = (input: AdvertiseByoipCidrRequ const serializeAws_ec2AllocateAddressRequest = (input: AllocateAddressRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.Address !== undefined) { + if (input.Address !== undefined && input.Address !== null) { entries["Address"] = input.Address; } - if (input.PublicIpv4Pool !== undefined) { + if (input.PublicIpv4Pool !== undefined && input.PublicIpv4Pool !== null) { entries["PublicIpv4Pool"] = input.PublicIpv4Pool; } - if (input.NetworkBorderGroup !== undefined) { + if (input.NetworkBorderGroup !== undefined && input.NetworkBorderGroup !== null) { entries["NetworkBorderGroup"] = input.NetworkBorderGroup; } - if (input.CustomerOwnedIpv4Pool !== undefined) { + if (input.CustomerOwnedIpv4Pool !== undefined && input.CustomerOwnedIpv4Pool !== null) { entries["CustomerOwnedIpv4Pool"] = input.CustomerOwnedIpv4Pool; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -29926,32 +29932,32 @@ const serializeAws_ec2AllocateAddressRequest = (input: AllocateAddressRequest, c const serializeAws_ec2AllocateHostsRequest = (input: AllocateHostsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoPlacement !== undefined) { + if (input.AutoPlacement !== undefined && input.AutoPlacement !== null) { entries["AutoPlacement"] = input.AutoPlacement; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.InstanceFamily !== undefined) { + if (input.InstanceFamily !== undefined && input.InstanceFamily !== null) { entries["InstanceFamily"] = input.InstanceFamily; } - if (input.Quantity !== undefined) { + if (input.Quantity !== undefined && input.Quantity !== null) { entries["Quantity"] = input.Quantity; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.HostRecovery !== undefined) { + if (input.HostRecovery !== undefined && input.HostRecovery !== null) { entries["HostRecovery"] = input.HostRecovery; } return entries; @@ -29961,6 +29967,9 @@ const serializeAws_ec2AllocationIdList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AllocationId.${counter}`] = entry; counter++; } @@ -29972,20 +29981,20 @@ const serializeAws_ec2ApplySecurityGroupsToClientVpnTargetNetworkRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_ec2ClientVpnSecurityGroupIdSet(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -29995,6 +30004,9 @@ const serializeAws_ec2ArnList = (input: string[], context: __SerdeContext): any const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -30006,17 +30018,17 @@ const serializeAws_ec2AssignIpv6AddressesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Ipv6AddressCount !== undefined) { + if (input.Ipv6AddressCount !== undefined && input.Ipv6AddressCount !== null) { entries["Ipv6AddressCount"] = input.Ipv6AddressCount; } - if (input.Ipv6Addresses !== undefined) { + if (input.Ipv6Addresses !== undefined && input.Ipv6Addresses !== null) { const memberEntries = serializeAws_ec2Ipv6AddressList(input.Ipv6Addresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ipv6Addresses.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } return entries; @@ -30027,20 +30039,20 @@ const serializeAws_ec2AssignPrivateIpAddressesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AllowReassignment !== undefined) { + if (input.AllowReassignment !== undefined && input.AllowReassignment !== null) { entries["AllowReassignment"] = input.AllowReassignment; } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.PrivateIpAddresses !== undefined) { + if (input.PrivateIpAddresses !== undefined && input.PrivateIpAddresses !== null) { const memberEntries = serializeAws_ec2PrivateIpAddressStringList(input.PrivateIpAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PrivateIpAddress.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SecondaryPrivateIpAddressCount !== undefined) { + if (input.SecondaryPrivateIpAddressCount !== undefined && input.SecondaryPrivateIpAddressCount !== null) { entries["SecondaryPrivateIpAddressCount"] = input.SecondaryPrivateIpAddressCount; } return entries; @@ -30048,25 +30060,25 @@ const serializeAws_ec2AssignPrivateIpAddressesRequest = ( const serializeAws_ec2AssociateAddressRequest = (input: AssociateAddressRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AllocationId !== undefined) { + if (input.AllocationId !== undefined && input.AllocationId !== null) { entries["AllocationId"] = input.AllocationId; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.PublicIp !== undefined) { + if (input.PublicIp !== undefined && input.PublicIp !== null) { entries["PublicIp"] = input.PublicIp; } - if (input.AllowReassociation !== undefined) { + if (input.AllowReassociation !== undefined && input.AllowReassociation !== null) { entries["AllowReassociation"] = input.AllowReassociation; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.PrivateIpAddress !== undefined) { + if (input.PrivateIpAddress !== undefined && input.PrivateIpAddress !== null) { entries["PrivateIpAddress"] = input.PrivateIpAddress; } return entries; @@ -30077,19 +30089,19 @@ const serializeAws_ec2AssociateClientVpnTargetNetworkRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30100,13 +30112,13 @@ const serializeAws_ec2AssociateDhcpOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DhcpOptionsId !== undefined) { + if (input.DhcpOptionsId !== undefined && input.DhcpOptionsId !== null) { entries["DhcpOptionsId"] = input.DhcpOptionsId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30117,13 +30129,13 @@ const serializeAws_ec2AssociateEnclaveCertificateIamRoleRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CertificateArn !== undefined) { + if (input.CertificateArn !== undefined && input.CertificateArn !== null) { entries["CertificateArn"] = input.CertificateArn; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30134,14 +30146,14 @@ const serializeAws_ec2AssociateIamInstanceProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.IamInstanceProfile !== undefined) { + if (input.IamInstanceProfile !== undefined && input.IamInstanceProfile !== null) { const memberEntries = serializeAws_ec2IamInstanceProfileSpecification(input.IamInstanceProfile, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IamInstanceProfile.${key}`; entries[loc] = value; }); } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } return entries; @@ -30152,16 +30164,16 @@ const serializeAws_ec2AssociateRouteTableRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.RouteTableId !== undefined) { + if (input.RouteTableId !== undefined && input.RouteTableId !== null) { entries["RouteTableId"] = input.RouteTableId; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.GatewayId !== undefined) { + if (input.GatewayId !== undefined && input.GatewayId !== null) { entries["GatewayId"] = input.GatewayId; } return entries; @@ -30172,10 +30184,10 @@ const serializeAws_ec2AssociateSubnetCidrBlockRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Ipv6CidrBlock !== undefined) { + if (input.Ipv6CidrBlock !== undefined && input.Ipv6CidrBlock !== null) { entries["Ipv6CidrBlock"] = input.Ipv6CidrBlock; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } return entries; @@ -30186,20 +30198,20 @@ const serializeAws_ec2AssociateTransitGatewayMulticastDomainRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_ec2TransitGatewaySubnetIdList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30210,13 +30222,13 @@ const serializeAws_ec2AssociateTransitGatewayRouteTableRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30227,22 +30239,22 @@ const serializeAws_ec2AssociateVpcCidrBlockRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AmazonProvidedIpv6CidrBlock !== undefined) { + if (input.AmazonProvidedIpv6CidrBlock !== undefined && input.AmazonProvidedIpv6CidrBlock !== null) { entries["AmazonProvidedIpv6CidrBlock"] = input.AmazonProvidedIpv6CidrBlock; } - if (input.CidrBlock !== undefined) { + if (input.CidrBlock !== undefined && input.CidrBlock !== null) { entries["CidrBlock"] = input.CidrBlock; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.Ipv6CidrBlockNetworkBorderGroup !== undefined) { + if (input.Ipv6CidrBlockNetworkBorderGroup !== undefined && input.Ipv6CidrBlockNetworkBorderGroup !== null) { entries["Ipv6CidrBlockNetworkBorderGroup"] = input.Ipv6CidrBlockNetworkBorderGroup; } - if (input.Ipv6Pool !== undefined) { + if (input.Ipv6Pool !== undefined && input.Ipv6Pool !== null) { entries["Ipv6Pool"] = input.Ipv6Pool; } - if (input.Ipv6CidrBlock !== undefined) { + if (input.Ipv6CidrBlock !== undefined && input.Ipv6CidrBlock !== null) { entries["Ipv6CidrBlock"] = input.Ipv6CidrBlock; } return entries; @@ -30252,6 +30264,9 @@ const serializeAws_ec2AssociationIdList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AssociationId.${counter}`] = entry; counter++; } @@ -30263,20 +30278,20 @@ const serializeAws_ec2AttachClassicLinkVpcRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Groups !== undefined) { + if (input.Groups !== undefined && input.Groups !== null) { const memberEntries = serializeAws_ec2GroupIdStringList(input.Groups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -30287,13 +30302,13 @@ const serializeAws_ec2AttachInternetGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InternetGatewayId !== undefined) { + if (input.InternetGatewayId !== undefined && input.InternetGatewayId !== null) { entries["InternetGatewayId"] = input.InternetGatewayId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -30304,19 +30319,19 @@ const serializeAws_ec2AttachNetworkInterfaceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DeviceIndex !== undefined) { + if (input.DeviceIndex !== undefined && input.DeviceIndex !== null) { entries["DeviceIndex"] = input.DeviceIndex; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.NetworkCardIndex !== undefined) { + if (input.NetworkCardIndex !== undefined && input.NetworkCardIndex !== null) { entries["NetworkCardIndex"] = input.NetworkCardIndex; } return entries; @@ -30324,16 +30339,16 @@ const serializeAws_ec2AttachNetworkInterfaceRequest = ( const serializeAws_ec2AttachVolumeRequest = (input: AttachVolumeRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Device !== undefined) { + if (input.Device !== undefined && input.Device !== null) { entries["Device"] = input.Device; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.VolumeId !== undefined) { + if (input.VolumeId !== undefined && input.VolumeId !== null) { entries["VolumeId"] = input.VolumeId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30341,13 +30356,13 @@ const serializeAws_ec2AttachVolumeRequest = (input: AttachVolumeRequest, context const serializeAws_ec2AttachVpnGatewayRequest = (input: AttachVpnGatewayRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.VpnGatewayId !== undefined) { + if (input.VpnGatewayId !== undefined && input.VpnGatewayId !== null) { entries["VpnGatewayId"] = input.VpnGatewayId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30355,7 +30370,7 @@ const serializeAws_ec2AttachVpnGatewayRequest = (input: AttachVpnGatewayRequest, const serializeAws_ec2AttributeBooleanValue = (input: AttributeBooleanValue, context: __SerdeContext): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -30363,7 +30378,7 @@ const serializeAws_ec2AttributeBooleanValue = (input: AttributeBooleanValue, con const serializeAws_ec2AttributeValue = (input: AttributeValue, context: __SerdeContext): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -30374,28 +30389,28 @@ const serializeAws_ec2AuthorizeClientVpnIngressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.TargetNetworkCidr !== undefined) { + if (input.TargetNetworkCidr !== undefined && input.TargetNetworkCidr !== null) { entries["TargetNetworkCidr"] = input.TargetNetworkCidr; } - if (input.AccessGroupId !== undefined) { + if (input.AccessGroupId !== undefined && input.AccessGroupId !== null) { entries["AccessGroupId"] = input.AccessGroupId; } - if (input.AuthorizeAllGroups !== undefined) { + if (input.AuthorizeAllGroups !== undefined && input.AuthorizeAllGroups !== null) { entries["AuthorizeAllGroups"] = input.AuthorizeAllGroups; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30406,35 +30421,35 @@ const serializeAws_ec2AuthorizeSecurityGroupEgressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { entries["GroupId"] = input.GroupId; } - if (input.IpPermissions !== undefined) { + if (input.IpPermissions !== undefined && input.IpPermissions !== null) { const memberEntries = serializeAws_ec2IpPermissionList(input.IpPermissions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IpPermissions.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.CidrIp !== undefined) { + if (input.CidrIp !== undefined && input.CidrIp !== null) { entries["CidrIp"] = input.CidrIp; } - if (input.FromPort !== undefined) { + if (input.FromPort !== undefined && input.FromPort !== null) { entries["FromPort"] = input.FromPort; } - if (input.IpProtocol !== undefined) { + if (input.IpProtocol !== undefined && input.IpProtocol !== null) { entries["IpProtocol"] = input.IpProtocol; } - if (input.ToPort !== undefined) { + if (input.ToPort !== undefined && input.ToPort !== null) { entries["ToPort"] = input.ToPort; } - if (input.SourceSecurityGroupName !== undefined) { + if (input.SourceSecurityGroupName !== undefined && input.SourceSecurityGroupName !== null) { entries["SourceSecurityGroupName"] = input.SourceSecurityGroupName; } - if (input.SourceSecurityGroupOwnerId !== undefined) { + if (input.SourceSecurityGroupOwnerId !== undefined && input.SourceSecurityGroupOwnerId !== null) { entries["SourceSecurityGroupOwnerId"] = input.SourceSecurityGroupOwnerId; } return entries; @@ -30445,38 +30460,38 @@ const serializeAws_ec2AuthorizeSecurityGroupIngressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CidrIp !== undefined) { + if (input.CidrIp !== undefined && input.CidrIp !== null) { entries["CidrIp"] = input.CidrIp; } - if (input.FromPort !== undefined) { + if (input.FromPort !== undefined && input.FromPort !== null) { entries["FromPort"] = input.FromPort; } - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { entries["GroupId"] = input.GroupId; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.IpPermissions !== undefined) { + if (input.IpPermissions !== undefined && input.IpPermissions !== null) { const memberEntries = serializeAws_ec2IpPermissionList(input.IpPermissions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IpPermissions.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.IpProtocol !== undefined) { + if (input.IpProtocol !== undefined && input.IpProtocol !== null) { entries["IpProtocol"] = input.IpProtocol; } - if (input.SourceSecurityGroupName !== undefined) { + if (input.SourceSecurityGroupName !== undefined && input.SourceSecurityGroupName !== null) { entries["SourceSecurityGroupName"] = input.SourceSecurityGroupName; } - if (input.SourceSecurityGroupOwnerId !== undefined) { + if (input.SourceSecurityGroupOwnerId !== undefined && input.SourceSecurityGroupOwnerId !== null) { entries["SourceSecurityGroupOwnerId"] = input.SourceSecurityGroupOwnerId; } - if (input.ToPort !== undefined) { + if (input.ToPort !== undefined && input.ToPort !== null) { entries["ToPort"] = input.ToPort; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30486,6 +30501,9 @@ const serializeAws_ec2AvailabilityZoneStringList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AvailabilityZone.${counter}`] = entry; counter++; } @@ -30496,6 +30514,9 @@ const serializeAws_ec2BillingProductList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -30504,7 +30525,7 @@ const serializeAws_ec2BillingProductList = (input: string[], context: __SerdeCon const serializeAws_ec2BlobAttributeValue = (input: BlobAttributeValue, context: __SerdeContext): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = context.base64Encoder(input.Value); } return entries; @@ -30512,20 +30533,20 @@ const serializeAws_ec2BlobAttributeValue = (input: BlobAttributeValue, context: const serializeAws_ec2BlockDeviceMapping = (input: BlockDeviceMapping, context: __SerdeContext): any => { const entries: any = {}; - if (input.DeviceName !== undefined) { + if (input.DeviceName !== undefined && input.DeviceName !== null) { entries["DeviceName"] = input.DeviceName; } - if (input.VirtualName !== undefined) { + if (input.VirtualName !== undefined && input.VirtualName !== null) { entries["VirtualName"] = input.VirtualName; } - if (input.Ebs !== undefined) { + if (input.Ebs !== undefined && input.Ebs !== null) { const memberEntries = serializeAws_ec2EbsBlockDevice(input.Ebs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ebs.${key}`; entries[loc] = value; }); } - if (input.NoDevice !== undefined) { + if (input.NoDevice !== undefined && input.NoDevice !== null) { entries["NoDevice"] = input.NoDevice; } return entries; @@ -30535,6 +30556,9 @@ const serializeAws_ec2BlockDeviceMappingList = (input: BlockDeviceMapping[], con const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2BlockDeviceMapping(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -30548,6 +30572,9 @@ const serializeAws_ec2BlockDeviceMappingRequestList = (input: BlockDeviceMapping const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2BlockDeviceMapping(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`BlockDeviceMapping.${counter}.${key}`] = value; @@ -30561,6 +30588,9 @@ const serializeAws_ec2BundleIdStringList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`BundleId.${counter}`] = entry; counter++; } @@ -30569,17 +30599,17 @@ const serializeAws_ec2BundleIdStringList = (input: string[], context: __SerdeCon const serializeAws_ec2BundleInstanceRequest = (input: BundleInstanceRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.Storage !== undefined) { + if (input.Storage !== undefined && input.Storage !== null) { const memberEntries = serializeAws_ec2Storage(input.Storage, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Storage.${key}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30587,10 +30617,10 @@ const serializeAws_ec2BundleInstanceRequest = (input: BundleInstanceRequest, con const serializeAws_ec2CancelBundleTaskRequest = (input: CancelBundleTaskRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.BundleId !== undefined) { + if (input.BundleId !== undefined && input.BundleId !== null) { entries["BundleId"] = input.BundleId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30601,10 +30631,10 @@ const serializeAws_ec2CancelCapacityReservationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CapacityReservationId !== undefined) { + if (input.CapacityReservationId !== undefined && input.CapacityReservationId !== null) { entries["CapacityReservationId"] = input.CapacityReservationId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30612,13 +30642,13 @@ const serializeAws_ec2CancelCapacityReservationRequest = ( const serializeAws_ec2CancelConversionRequest = (input: CancelConversionRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ConversionTaskId !== undefined) { + if (input.ConversionTaskId !== undefined && input.ConversionTaskId !== null) { entries["ConversionTaskId"] = input.ConversionTaskId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ReasonMessage !== undefined) { + if (input.ReasonMessage !== undefined && input.ReasonMessage !== null) { entries["ReasonMessage"] = input.ReasonMessage; } return entries; @@ -30626,7 +30656,7 @@ const serializeAws_ec2CancelConversionRequest = (input: CancelConversionRequest, const serializeAws_ec2CancelExportTaskRequest = (input: CancelExportTaskRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ExportTaskId !== undefined) { + if (input.ExportTaskId !== undefined && input.ExportTaskId !== null) { entries["ExportTaskId"] = input.ExportTaskId; } return entries; @@ -30634,13 +30664,13 @@ const serializeAws_ec2CancelExportTaskRequest = (input: CancelExportTaskRequest, const serializeAws_ec2CancelImportTaskRequest = (input: CancelImportTaskRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.CancelReason !== undefined) { + if (input.CancelReason !== undefined && input.CancelReason !== null) { entries["CancelReason"] = input.CancelReason; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ImportTaskId !== undefined) { + if (input.ImportTaskId !== undefined && input.ImportTaskId !== null) { entries["ImportTaskId"] = input.ImportTaskId; } return entries; @@ -30651,7 +30681,7 @@ const serializeAws_ec2CancelReservedInstancesListingRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedInstancesListingId !== undefined) { + if (input.ReservedInstancesListingId !== undefined && input.ReservedInstancesListingId !== null) { entries["ReservedInstancesListingId"] = input.ReservedInstancesListingId; } return entries; @@ -30662,17 +30692,17 @@ const serializeAws_ec2CancelSpotFleetRequestsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.SpotFleetRequestIds !== undefined) { + if (input.SpotFleetRequestIds !== undefined && input.SpotFleetRequestIds !== null) { const memberEntries = serializeAws_ec2SpotFleetRequestIdList(input.SpotFleetRequestIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SpotFleetRequestId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.TerminateInstances !== undefined) { + if (input.TerminateInstances !== undefined && input.TerminateInstances !== null) { entries["TerminateInstances"] = input.TerminateInstances; } return entries; @@ -30683,10 +30713,10 @@ const serializeAws_ec2CancelSpotInstanceRequestsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.SpotInstanceRequestIds !== undefined) { + if (input.SpotInstanceRequestIds !== undefined && input.SpotInstanceRequestIds !== null) { const memberEntries = serializeAws_ec2SpotInstanceRequestIdList(input.SpotInstanceRequestIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SpotInstanceRequestId.${key.substring(key.indexOf(".") + 1)}`; @@ -30700,6 +30730,9 @@ const serializeAws_ec2CapacityReservationIdSet = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -30711,7 +30744,7 @@ const serializeAws_ec2CapacityReservationOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UsageStrategy !== undefined) { + if (input.UsageStrategy !== undefined && input.UsageStrategy !== null) { entries["UsageStrategy"] = input.UsageStrategy; } return entries; @@ -30722,10 +30755,10 @@ const serializeAws_ec2CapacityReservationSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CapacityReservationPreference !== undefined) { + if (input.CapacityReservationPreference !== undefined && input.CapacityReservationPreference !== null) { entries["CapacityReservationPreference"] = input.CapacityReservationPreference; } - if (input.CapacityReservationTarget !== undefined) { + if (input.CapacityReservationTarget !== undefined && input.CapacityReservationTarget !== null) { const memberEntries = serializeAws_ec2CapacityReservationTarget(input.CapacityReservationTarget, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CapacityReservationTarget.${key}`; @@ -30737,10 +30770,10 @@ const serializeAws_ec2CapacityReservationSpecification = ( const serializeAws_ec2CapacityReservationTarget = (input: CapacityReservationTarget, context: __SerdeContext): any => { const entries: any = {}; - if (input.CapacityReservationId !== undefined) { + if (input.CapacityReservationId !== undefined && input.CapacityReservationId !== null) { entries["CapacityReservationId"] = input.CapacityReservationId; } - if (input.CapacityReservationResourceGroupArn !== undefined) { + if (input.CapacityReservationResourceGroupArn !== undefined && input.CapacityReservationResourceGroupArn !== null) { entries["CapacityReservationResourceGroupArn"] = input.CapacityReservationResourceGroupArn; } return entries; @@ -30750,6 +30783,9 @@ const serializeAws_ec2CarrierGatewayIdSet = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -30761,7 +30797,7 @@ const serializeAws_ec2CertificateAuthenticationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientRootCertificateChainArn !== undefined) { + if (input.ClientRootCertificateChainArn !== undefined && input.ClientRootCertificateChainArn !== null) { entries["ClientRootCertificateChainArn"] = input.ClientRootCertificateChainArn; } return entries; @@ -30769,10 +30805,10 @@ const serializeAws_ec2CertificateAuthenticationRequest = ( const serializeAws_ec2CidrAuthorizationContext = (input: CidrAuthorizationContext, context: __SerdeContext): any => { const entries: any = {}; - if (input.Message !== undefined) { + if (input.Message !== undefined && input.Message !== null) { entries["Message"] = input.Message; } - if (input.Signature !== undefined) { + if (input.Signature !== undefined && input.Signature !== null) { entries["Signature"] = input.Signature; } return entries; @@ -30780,7 +30816,7 @@ const serializeAws_ec2CidrAuthorizationContext = (input: CidrAuthorizationContex const serializeAws_ec2ClassicLoadBalancer = (input: ClassicLoadBalancer, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -30790,6 +30826,9 @@ const serializeAws_ec2ClassicLoadBalancers = (input: ClassicLoadBalancer[], cont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ClassicLoadBalancer(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -30804,7 +30843,7 @@ const serializeAws_ec2ClassicLoadBalancersConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClassicLoadBalancers !== undefined) { + if (input.ClassicLoadBalancers !== undefined && input.ClassicLoadBalancers !== null) { const memberEntries = serializeAws_ec2ClassicLoadBalancers(input.ClassicLoadBalancers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClassicLoadBalancers.${key.substring(key.indexOf(".") + 1)}`; @@ -30816,10 +30855,10 @@ const serializeAws_ec2ClassicLoadBalancersConfig = ( const serializeAws_ec2ClientConnectOptions = (input: ClientConnectOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.LambdaFunctionArn !== undefined) { + if (input.LambdaFunctionArn !== undefined && input.LambdaFunctionArn !== null) { entries["LambdaFunctionArn"] = input.LambdaFunctionArn; } return entries; @@ -30827,16 +30866,16 @@ const serializeAws_ec2ClientConnectOptions = (input: ClientConnectOptions, conte const serializeAws_ec2ClientData = (input: ClientData, context: __SerdeContext): any => { const entries: any = {}; - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { entries["Comment"] = input.Comment; } - if (input.UploadEnd !== undefined) { + if (input.UploadEnd !== undefined && input.UploadEnd !== null) { entries["UploadEnd"] = input.UploadEnd.toISOString().split(".")[0] + "Z"; } - if (input.UploadSize !== undefined) { + if (input.UploadSize !== undefined && input.UploadSize !== null) { entries["UploadSize"] = input.UploadSize; } - if (input.UploadStart !== undefined) { + if (input.UploadStart !== undefined && input.UploadStart !== null) { entries["UploadStart"] = input.UploadStart.toISOString().split(".")[0] + "Z"; } return entries; @@ -30847,24 +30886,24 @@ const serializeAws_ec2ClientVpnAuthenticationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.ActiveDirectory !== undefined) { + if (input.ActiveDirectory !== undefined && input.ActiveDirectory !== null) { const memberEntries = serializeAws_ec2DirectoryServiceAuthenticationRequest(input.ActiveDirectory, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ActiveDirectory.${key}`; entries[loc] = value; }); } - if (input.MutualAuthentication !== undefined) { + if (input.MutualAuthentication !== undefined && input.MutualAuthentication !== null) { const memberEntries = serializeAws_ec2CertificateAuthenticationRequest(input.MutualAuthentication, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MutualAuthentication.${key}`; entries[loc] = value; }); } - if (input.FederatedAuthentication !== undefined) { + if (input.FederatedAuthentication !== undefined && input.FederatedAuthentication !== null) { const memberEntries = serializeAws_ec2FederatedAuthenticationRequest(input.FederatedAuthentication, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FederatedAuthentication.${key}`; @@ -30881,6 +30920,9 @@ const serializeAws_ec2ClientVpnAuthenticationRequestList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ClientVpnAuthenticationRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Member.${counter}.${key}`] = value; @@ -30894,6 +30936,9 @@ const serializeAws_ec2ClientVpnEndpointIdList = (input: string[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -30904,6 +30949,9 @@ const serializeAws_ec2ClientVpnSecurityGroupIdSet = (input: string[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -30914,6 +30962,9 @@ const serializeAws_ec2CoipPoolIdSet = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -30925,13 +30976,13 @@ const serializeAws_ec2ConfirmProductInstanceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.ProductCode !== undefined) { + if (input.ProductCode !== undefined && input.ProductCode !== null) { entries["ProductCode"] = input.ProductCode; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -30939,13 +30990,13 @@ const serializeAws_ec2ConfirmProductInstanceRequest = ( const serializeAws_ec2ConnectionLogOptions = (input: ConnectionLogOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.CloudwatchLogGroup !== undefined) { + if (input.CloudwatchLogGroup !== undefined && input.CloudwatchLogGroup !== null) { entries["CloudwatchLogGroup"] = input.CloudwatchLogGroup; } - if (input.CloudwatchLogStream !== undefined) { + if (input.CloudwatchLogStream !== undefined && input.CloudwatchLogStream !== null) { entries["CloudwatchLogStream"] = input.CloudwatchLogStream; } return entries; @@ -30955,6 +31006,9 @@ const serializeAws_ec2ConnectionNotificationIdsList = (input: string[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -30965,6 +31019,9 @@ const serializeAws_ec2ConversionIdStringList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -30973,22 +31030,22 @@ const serializeAws_ec2ConversionIdStringList = (input: string[], context: __Serd const serializeAws_ec2CopyFpgaImageRequest = (input: CopyFpgaImageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.SourceFpgaImageId !== undefined) { + if (input.SourceFpgaImageId !== undefined && input.SourceFpgaImageId !== null) { entries["SourceFpgaImageId"] = input.SourceFpgaImageId; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.SourceRegion !== undefined) { + if (input.SourceRegion !== undefined && input.SourceRegion !== null) { entries["SourceRegion"] = input.SourceRegion; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -30996,28 +31053,28 @@ const serializeAws_ec2CopyFpgaImageRequest = (input: CopyFpgaImageRequest, conte const serializeAws_ec2CopyImageRequest = (input: CopyImageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.SourceImageId !== undefined) { + if (input.SourceImageId !== undefined && input.SourceImageId !== null) { entries["SourceImageId"] = input.SourceImageId; } - if (input.SourceRegion !== undefined) { + if (input.SourceRegion !== undefined && input.SourceRegion !== null) { entries["SourceRegion"] = input.SourceRegion; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31025,35 +31082,35 @@ const serializeAws_ec2CopyImageRequest = (input: CopyImageRequest, context: __Se const serializeAws_ec2CopySnapshotRequest = (input: CopySnapshotRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DestinationRegion !== undefined) { + if (input.DestinationRegion !== undefined && input.DestinationRegion !== null) { entries["DestinationRegion"] = input.DestinationRegion; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.PresignedUrl !== undefined) { + if (input.PresignedUrl !== undefined && input.PresignedUrl !== null) { entries["PresignedUrl"] = input.PresignedUrl; } - if (input.SourceRegion !== undefined) { + if (input.SourceRegion !== undefined && input.SourceRegion !== null) { entries["SourceRegion"] = input.SourceRegion; } - if (input.SourceSnapshotId !== undefined) { + if (input.SourceSnapshotId !== undefined && input.SourceSnapshotId !== null) { entries["SourceSnapshotId"] = input.SourceSnapshotId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31061,10 +31118,10 @@ const serializeAws_ec2CopySnapshotRequest = (input: CopySnapshotRequest, context const serializeAws_ec2CpuOptionsRequest = (input: CpuOptionsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.CoreCount !== undefined) { + if (input.CoreCount !== undefined && input.CoreCount !== null) { entries["CoreCount"] = input.CoreCount; } - if (input.ThreadsPerCore !== undefined) { + if (input.ThreadsPerCore !== undefined && input.ThreadsPerCore !== null) { entries["ThreadsPerCore"] = input.ThreadsPerCore; } return entries; @@ -31075,50 +31132,50 @@ const serializeAws_ec2CreateCapacityReservationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.InstancePlatform !== undefined) { + if (input.InstancePlatform !== undefined && input.InstancePlatform !== null) { entries["InstancePlatform"] = input.InstancePlatform; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.AvailabilityZoneId !== undefined) { + if (input.AvailabilityZoneId !== undefined && input.AvailabilityZoneId !== null) { entries["AvailabilityZoneId"] = input.AvailabilityZoneId; } - if (input.Tenancy !== undefined) { + if (input.Tenancy !== undefined && input.Tenancy !== null) { entries["Tenancy"] = input.Tenancy; } - if (input.InstanceCount !== undefined) { + if (input.InstanceCount !== undefined && input.InstanceCount !== null) { entries["InstanceCount"] = input.InstanceCount; } - if (input.EbsOptimized !== undefined) { + if (input.EbsOptimized !== undefined && input.EbsOptimized !== null) { entries["EbsOptimized"] = input.EbsOptimized; } - if (input.EphemeralStorage !== undefined) { + if (input.EphemeralStorage !== undefined && input.EphemeralStorage !== null) { entries["EphemeralStorage"] = input.EphemeralStorage; } - if (input.EndDate !== undefined) { + if (input.EndDate !== undefined && input.EndDate !== null) { entries["EndDate"] = input.EndDate.toISOString().split(".")[0] + "Z"; } - if (input.EndDateType !== undefined) { + if (input.EndDateType !== undefined && input.EndDateType !== null) { entries["EndDateType"] = input.EndDateType; } - if (input.InstanceMatchCriteria !== undefined) { + if (input.InstanceMatchCriteria !== undefined && input.InstanceMatchCriteria !== null) { entries["InstanceMatchCriteria"] = input.InstanceMatchCriteria; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecifications.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31129,23 +31186,23 @@ const serializeAws_ec2CreateCarrierGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -31156,75 +31213,75 @@ const serializeAws_ec2CreateClientVpnEndpointRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientCidrBlock !== undefined) { + if (input.ClientCidrBlock !== undefined && input.ClientCidrBlock !== null) { entries["ClientCidrBlock"] = input.ClientCidrBlock; } - if (input.ServerCertificateArn !== undefined) { + if (input.ServerCertificateArn !== undefined && input.ServerCertificateArn !== null) { entries["ServerCertificateArn"] = input.ServerCertificateArn; } - if (input.AuthenticationOptions !== undefined) { + if (input.AuthenticationOptions !== undefined && input.AuthenticationOptions !== null) { const memberEntries = serializeAws_ec2ClientVpnAuthenticationRequestList(input.AuthenticationOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Authentication.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ConnectionLogOptions !== undefined) { + if (input.ConnectionLogOptions !== undefined && input.ConnectionLogOptions !== null) { const memberEntries = serializeAws_ec2ConnectionLogOptions(input.ConnectionLogOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConnectionLogOptions.${key}`; entries[loc] = value; }); } - if (input.DnsServers !== undefined) { + if (input.DnsServers !== undefined && input.DnsServers !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.DnsServers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DnsServers.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.TransportProtocol !== undefined) { + if (input.TransportProtocol !== undefined && input.TransportProtocol !== null) { entries["TransportProtocol"] = input.TransportProtocol; } - if (input.VpnPort !== undefined) { + if (input.VpnPort !== undefined && input.VpnPort !== null) { entries["VpnPort"] = input.VpnPort; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.SplitTunnel !== undefined) { + if (input.SplitTunnel !== undefined && input.SplitTunnel !== null) { entries["SplitTunnel"] = input.SplitTunnel; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_ec2ClientVpnSecurityGroupIdSet(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.SelfServicePortal !== undefined) { + if (input.SelfServicePortal !== undefined && input.SelfServicePortal !== null) { entries["SelfServicePortal"] = input.SelfServicePortal; } - if (input.ClientConnectOptions !== undefined) { + if (input.ClientConnectOptions !== undefined && input.ClientConnectOptions !== null) { const memberEntries = serializeAws_ec2ClientConnectOptions(input.ClientConnectOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClientConnectOptions.${key}`; @@ -31239,25 +31296,25 @@ const serializeAws_ec2CreateClientVpnRouteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.TargetVpcSubnetId !== undefined) { + if (input.TargetVpcSubnetId !== undefined && input.TargetVpcSubnetId !== null) { entries["TargetVpcSubnetId"] = input.TargetVpcSubnetId; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31268,29 +31325,29 @@ const serializeAws_ec2CreateCustomerGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.BgpAsn !== undefined) { + if (input.BgpAsn !== undefined && input.BgpAsn !== null) { entries["BgpAsn"] = input.BgpAsn; } - if (input.PublicIp !== undefined) { + if (input.PublicIp !== undefined && input.PublicIp !== null) { entries["IpAddress"] = input.PublicIp; } - if (input.CertificateArn !== undefined) { + if (input.CertificateArn !== undefined && input.CertificateArn !== null) { entries["CertificateArn"] = input.CertificateArn; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DeviceName !== undefined) { + if (input.DeviceName !== undefined && input.DeviceName !== null) { entries["DeviceName"] = input.DeviceName; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31301,10 +31358,10 @@ const serializeAws_ec2CreateDefaultSubnetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31312,7 +31369,7 @@ const serializeAws_ec2CreateDefaultSubnetRequest = ( const serializeAws_ec2CreateDefaultVpcRequest = (input: CreateDefaultVpcRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31320,21 +31377,21 @@ const serializeAws_ec2CreateDefaultVpcRequest = (input: CreateDefaultVpcRequest, const serializeAws_ec2CreateDhcpOptionsRequest = (input: CreateDhcpOptionsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DhcpConfigurations !== undefined) { + if (input.DhcpConfigurations !== undefined && input.DhcpConfigurations !== null) { const memberEntries = serializeAws_ec2NewDhcpConfigurationList(input.DhcpConfigurations, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DhcpConfiguration.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31345,16 +31402,16 @@ const serializeAws_ec2CreateEgressOnlyInternetGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31366,37 +31423,37 @@ const serializeAws_ec2CreateEgressOnlyInternetGatewayRequest = ( const serializeAws_ec2CreateFleetRequest = (input: CreateFleetRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.SpotOptions !== undefined) { + if (input.SpotOptions !== undefined && input.SpotOptions !== null) { const memberEntries = serializeAws_ec2SpotOptionsRequest(input.SpotOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SpotOptions.${key}`; entries[loc] = value; }); } - if (input.OnDemandOptions !== undefined) { + if (input.OnDemandOptions !== undefined && input.OnDemandOptions !== null) { const memberEntries = serializeAws_ec2OnDemandOptionsRequest(input.OnDemandOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OnDemandOptions.${key}`; entries[loc] = value; }); } - if (input.ExcessCapacityTerminationPolicy !== undefined) { + if (input.ExcessCapacityTerminationPolicy !== undefined && input.ExcessCapacityTerminationPolicy !== null) { entries["ExcessCapacityTerminationPolicy"] = input.ExcessCapacityTerminationPolicy; } - if (input.LaunchTemplateConfigs !== undefined) { + if (input.LaunchTemplateConfigs !== undefined && input.LaunchTemplateConfigs !== null) { const memberEntries = serializeAws_ec2FleetLaunchTemplateConfigListRequest(input.LaunchTemplateConfigs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateConfigs.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.TargetCapacitySpecification !== undefined) { + if (input.TargetCapacitySpecification !== undefined && input.TargetCapacitySpecification !== null) { const memberEntries = serializeAws_ec2TargetCapacitySpecificationRequest( input.TargetCapacitySpecification, context @@ -31406,22 +31463,22 @@ const serializeAws_ec2CreateFleetRequest = (input: CreateFleetRequest, context: entries[loc] = value; }); } - if (input.TerminateInstancesWithExpiration !== undefined) { + if (input.TerminateInstancesWithExpiration !== undefined && input.TerminateInstancesWithExpiration !== null) { entries["TerminateInstancesWithExpiration"] = input.TerminateInstancesWithExpiration; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.ValidFrom !== undefined) { + if (input.ValidFrom !== undefined && input.ValidFrom !== null) { entries["ValidFrom"] = input.ValidFrom.toISOString().split(".")[0] + "Z"; } - if (input.ValidUntil !== undefined) { + if (input.ValidUntil !== undefined && input.ValidUntil !== null) { entries["ValidUntil"] = input.ValidUntil.toISOString().split(".")[0] + "Z"; } - if (input.ReplaceUnhealthyInstances !== undefined) { + if (input.ReplaceUnhealthyInstances !== undefined && input.ReplaceUnhealthyInstances !== null) { entries["ReplaceUnhealthyInstances"] = input.ReplaceUnhealthyInstances; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31433,48 +31490,48 @@ const serializeAws_ec2CreateFleetRequest = (input: CreateFleetRequest, context: const serializeAws_ec2CreateFlowLogsRequest = (input: CreateFlowLogsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DeliverLogsPermissionArn !== undefined) { + if (input.DeliverLogsPermissionArn !== undefined && input.DeliverLogsPermissionArn !== null) { entries["DeliverLogsPermissionArn"] = input.DeliverLogsPermissionArn; } - if (input.LogGroupName !== undefined) { + if (input.LogGroupName !== undefined && input.LogGroupName !== null) { entries["LogGroupName"] = input.LogGroupName; } - if (input.ResourceIds !== undefined) { + if (input.ResourceIds !== undefined && input.ResourceIds !== null) { const memberEntries = serializeAws_ec2FlowLogResourceIds(input.ResourceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ResourceType !== undefined) { + if (input.ResourceType !== undefined && input.ResourceType !== null) { entries["ResourceType"] = input.ResourceType; } - if (input.TrafficType !== undefined) { + if (input.TrafficType !== undefined && input.TrafficType !== null) { entries["TrafficType"] = input.TrafficType; } - if (input.LogDestinationType !== undefined) { + if (input.LogDestinationType !== undefined && input.LogDestinationType !== null) { entries["LogDestinationType"] = input.LogDestinationType; } - if (input.LogDestination !== undefined) { + if (input.LogDestination !== undefined && input.LogDestination !== null) { entries["LogDestination"] = input.LogDestination; } - if (input.LogFormat !== undefined) { + if (input.LogFormat !== undefined && input.LogFormat !== null) { entries["LogFormat"] = input.LogFormat; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxAggregationInterval !== undefined) { + if (input.MaxAggregationInterval !== undefined && input.MaxAggregationInterval !== null) { entries["MaxAggregationInterval"] = input.MaxAggregationInterval; } return entries; @@ -31482,33 +31539,33 @@ const serializeAws_ec2CreateFlowLogsRequest = (input: CreateFlowLogsRequest, con const serializeAws_ec2CreateFpgaImageRequest = (input: CreateFpgaImageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InputStorageLocation !== undefined) { + if (input.InputStorageLocation !== undefined && input.InputStorageLocation !== null) { const memberEntries = serializeAws_ec2StorageLocation(input.InputStorageLocation, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InputStorageLocation.${key}`; entries[loc] = value; }); } - if (input.LogsStorageLocation !== undefined) { + if (input.LogsStorageLocation !== undefined && input.LogsStorageLocation !== null) { const memberEntries = serializeAws_ec2StorageLocation(input.LogsStorageLocation, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LogsStorageLocation.${key}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31520,29 +31577,29 @@ const serializeAws_ec2CreateFpgaImageRequest = (input: CreateFpgaImageRequest, c const serializeAws_ec2CreateImageRequest = (input: CreateImageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.BlockDeviceMappings !== undefined) { + if (input.BlockDeviceMappings !== undefined && input.BlockDeviceMappings !== null) { const memberEntries = serializeAws_ec2BlockDeviceMappingRequestList(input.BlockDeviceMappings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BlockDeviceMapping.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.NoReboot !== undefined) { + if (input.NoReboot !== undefined && input.NoReboot !== null) { entries["NoReboot"] = input.NoReboot; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31557,23 +31614,23 @@ const serializeAws_ec2CreateInstanceExportTaskRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.ExportToS3Task !== undefined) { + if (input.ExportToS3Task !== undefined && input.ExportToS3Task !== null) { const memberEntries = serializeAws_ec2ExportToS3TaskSpecification(input.ExportToS3Task, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExportToS3.${key}`; entries[loc] = value; }); } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.TargetEnvironment !== undefined) { + if (input.TargetEnvironment !== undefined && input.TargetEnvironment !== null) { entries["TargetEnvironment"] = input.TargetEnvironment; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31588,14 +31645,14 @@ const serializeAws_ec2CreateInternetGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31603,13 +31660,13 @@ const serializeAws_ec2CreateInternetGatewayRequest = ( const serializeAws_ec2CreateKeyPairRequest = (input: CreateKeyPairRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.KeyName !== undefined) { + if (input.KeyName !== undefined && input.KeyName !== null) { entries["KeyName"] = input.KeyName; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31624,26 +31681,26 @@ const serializeAws_ec2CreateLaunchTemplateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } - if (input.VersionDescription !== undefined) { + if (input.VersionDescription !== undefined && input.VersionDescription !== null) { entries["VersionDescription"] = input.VersionDescription; } - if (input.LaunchTemplateData !== undefined) { + if (input.LaunchTemplateData !== undefined && input.LaunchTemplateData !== null) { const memberEntries = serializeAws_ec2RequestLaunchTemplateData(input.LaunchTemplateData, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateData.${key}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31658,25 +31715,25 @@ const serializeAws_ec2CreateLaunchTemplateVersionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.LaunchTemplateId !== undefined) { + if (input.LaunchTemplateId !== undefined && input.LaunchTemplateId !== null) { entries["LaunchTemplateId"] = input.LaunchTemplateId; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } - if (input.SourceVersion !== undefined) { + if (input.SourceVersion !== undefined && input.SourceVersion !== null) { entries["SourceVersion"] = input.SourceVersion; } - if (input.VersionDescription !== undefined) { + if (input.VersionDescription !== undefined && input.VersionDescription !== null) { entries["VersionDescription"] = input.VersionDescription; } - if (input.LaunchTemplateData !== undefined) { + if (input.LaunchTemplateData !== undefined && input.LaunchTemplateData !== null) { const memberEntries = serializeAws_ec2RequestLaunchTemplateData(input.LaunchTemplateData, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateData.${key}`; @@ -31691,16 +31748,16 @@ const serializeAws_ec2CreateLocalGatewayRouteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.LocalGatewayRouteTableId !== undefined) { + if (input.LocalGatewayRouteTableId !== undefined && input.LocalGatewayRouteTableId !== null) { entries["LocalGatewayRouteTableId"] = input.LocalGatewayRouteTableId; } - if (input.LocalGatewayVirtualInterfaceGroupId !== undefined) { + if (input.LocalGatewayVirtualInterfaceGroupId !== undefined && input.LocalGatewayVirtualInterfaceGroupId !== null) { entries["LocalGatewayVirtualInterfaceGroupId"] = input.LocalGatewayVirtualInterfaceGroupId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31711,20 +31768,20 @@ const serializeAws_ec2CreateLocalGatewayRouteTableVpcAssociationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LocalGatewayRouteTableId !== undefined) { + if (input.LocalGatewayRouteTableId !== undefined && input.LocalGatewayRouteTableId !== null) { entries["LocalGatewayRouteTableId"] = input.LocalGatewayRouteTableId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31735,36 +31792,36 @@ const serializeAws_ec2CreateManagedPrefixListRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PrefixListName !== undefined) { + if (input.PrefixListName !== undefined && input.PrefixListName !== null) { entries["PrefixListName"] = input.PrefixListName; } - if (input.Entries !== undefined) { + if (input.Entries !== undefined && input.Entries !== null) { const memberEntries = serializeAws_ec2AddPrefixListEntries(input.Entries, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Entry.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxEntries !== undefined) { + if (input.MaxEntries !== undefined && input.MaxEntries !== null) { entries["MaxEntries"] = input.MaxEntries; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AddressFamily !== undefined) { + if (input.AddressFamily !== undefined && input.AddressFamily !== null) { entries["AddressFamily"] = input.AddressFamily; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -31772,22 +31829,22 @@ const serializeAws_ec2CreateManagedPrefixListRequest = ( const serializeAws_ec2CreateNatGatewayRequest = (input: CreateNatGatewayRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AllocationId !== undefined) { + if (input.AllocationId !== undefined && input.AllocationId !== null) { entries["AllocationId"] = input.AllocationId; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31802,42 +31859,42 @@ const serializeAws_ec2CreateNetworkAclEntryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CidrBlock !== undefined) { + if (input.CidrBlock !== undefined && input.CidrBlock !== null) { entries["CidrBlock"] = input.CidrBlock; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Egress !== undefined) { + if (input.Egress !== undefined && input.Egress !== null) { entries["Egress"] = input.Egress; } - if (input.IcmpTypeCode !== undefined) { + if (input.IcmpTypeCode !== undefined && input.IcmpTypeCode !== null) { const memberEntries = serializeAws_ec2IcmpTypeCode(input.IcmpTypeCode, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Icmp.${key}`; entries[loc] = value; }); } - if (input.Ipv6CidrBlock !== undefined) { + if (input.Ipv6CidrBlock !== undefined && input.Ipv6CidrBlock !== null) { entries["Ipv6CidrBlock"] = input.Ipv6CidrBlock; } - if (input.NetworkAclId !== undefined) { + if (input.NetworkAclId !== undefined && input.NetworkAclId !== null) { entries["NetworkAclId"] = input.NetworkAclId; } - if (input.PortRange !== undefined) { + if (input.PortRange !== undefined && input.PortRange !== null) { const memberEntries = serializeAws_ec2PortRange(input.PortRange, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PortRange.${key}`; entries[loc] = value; }); } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.RuleAction !== undefined) { + if (input.RuleAction !== undefined && input.RuleAction !== null) { entries["RuleAction"] = input.RuleAction; } - if (input.RuleNumber !== undefined) { + if (input.RuleNumber !== undefined && input.RuleNumber !== null) { entries["RuleNumber"] = input.RuleNumber; } return entries; @@ -31845,13 +31902,13 @@ const serializeAws_ec2CreateNetworkAclEntryRequest = ( const serializeAws_ec2CreateNetworkAclRequest = (input: CreateNetworkAclRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31866,38 +31923,38 @@ const serializeAws_ec2CreateNetworkInsightsPathRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceIp !== undefined) { + if (input.SourceIp !== undefined && input.SourceIp !== null) { entries["SourceIp"] = input.SourceIp; } - if (input.DestinationIp !== undefined) { + if (input.DestinationIp !== undefined && input.DestinationIp !== null) { entries["DestinationIp"] = input.DestinationIp; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.Destination !== undefined) { + if (input.Destination !== undefined && input.Destination !== null) { entries["Destination"] = input.Destination; } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.DestinationPort !== undefined) { + if (input.DestinationPort !== undefined && input.DestinationPort !== null) { entries["DestinationPort"] = input.DestinationPort; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -31908,19 +31965,19 @@ const serializeAws_ec2CreateNetworkInterfacePermissionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.AwsAccountId !== undefined) { + if (input.AwsAccountId !== undefined && input.AwsAccountId !== null) { entries["AwsAccountId"] = input.AwsAccountId; } - if (input.AwsService !== undefined) { + if (input.AwsService !== undefined && input.AwsService !== null) { entries["AwsService"] = input.AwsService; } - if (input.Permission !== undefined) { + if (input.Permission !== undefined && input.Permission !== null) { entries["Permission"] = input.Permission; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -31931,49 +31988,49 @@ const serializeAws_ec2CreateNetworkInterfaceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Groups !== undefined) { + if (input.Groups !== undefined && input.Groups !== null) { const memberEntries = serializeAws_ec2SecurityGroupIdStringList(input.Groups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Ipv6AddressCount !== undefined) { + if (input.Ipv6AddressCount !== undefined && input.Ipv6AddressCount !== null) { entries["Ipv6AddressCount"] = input.Ipv6AddressCount; } - if (input.Ipv6Addresses !== undefined) { + if (input.Ipv6Addresses !== undefined && input.Ipv6Addresses !== null) { const memberEntries = serializeAws_ec2InstanceIpv6AddressList(input.Ipv6Addresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ipv6Addresses.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.PrivateIpAddress !== undefined) { + if (input.PrivateIpAddress !== undefined && input.PrivateIpAddress !== null) { entries["PrivateIpAddress"] = input.PrivateIpAddress; } - if (input.PrivateIpAddresses !== undefined) { + if (input.PrivateIpAddresses !== undefined && input.PrivateIpAddresses !== null) { const memberEntries = serializeAws_ec2PrivateIpAddressSpecificationList(input.PrivateIpAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PrivateIpAddresses.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SecondaryPrivateIpAddressCount !== undefined) { + if (input.SecondaryPrivateIpAddressCount !== undefined && input.SecondaryPrivateIpAddressCount !== null) { entries["SecondaryPrivateIpAddressCount"] = input.SecondaryPrivateIpAddressCount; } - if (input.InterfaceType !== undefined) { + if (input.InterfaceType !== undefined && input.InterfaceType !== null) { entries["InterfaceType"] = input.InterfaceType; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -31988,19 +32045,19 @@ const serializeAws_ec2CreatePlacementGroupRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.Strategy !== undefined) { + if (input.Strategy !== undefined && input.Strategy !== null) { entries["Strategy"] = input.Strategy; } - if (input.PartitionCount !== undefined) { + if (input.PartitionCount !== undefined && input.PartitionCount !== null) { entries["PartitionCount"] = input.PartitionCount; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -32015,20 +32072,20 @@ const serializeAws_ec2CreateReservedInstancesListingRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.InstanceCount !== undefined) { + if (input.InstanceCount !== undefined && input.InstanceCount !== null) { entries["InstanceCount"] = input.InstanceCount; } - if (input.PriceSchedules !== undefined) { + if (input.PriceSchedules !== undefined && input.PriceSchedules !== null) { const memberEntries = serializeAws_ec2PriceScheduleSpecificationList(input.PriceSchedules, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PriceSchedules.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ReservedInstancesId !== undefined) { + if (input.ReservedInstancesId !== undefined && input.ReservedInstancesId !== null) { entries["ReservedInstancesId"] = input.ReservedInstancesId; } return entries; @@ -32036,49 +32093,49 @@ const serializeAws_ec2CreateReservedInstancesListingRequest = ( const serializeAws_ec2CreateRouteRequest = (input: CreateRouteRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.DestinationIpv6CidrBlock !== undefined) { + if (input.DestinationIpv6CidrBlock !== undefined && input.DestinationIpv6CidrBlock !== null) { entries["DestinationIpv6CidrBlock"] = input.DestinationIpv6CidrBlock; } - if (input.DestinationPrefixListId !== undefined) { + if (input.DestinationPrefixListId !== undefined && input.DestinationPrefixListId !== null) { entries["DestinationPrefixListId"] = input.DestinationPrefixListId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcEndpointId !== undefined) { + if (input.VpcEndpointId !== undefined && input.VpcEndpointId !== null) { entries["VpcEndpointId"] = input.VpcEndpointId; } - if (input.EgressOnlyInternetGatewayId !== undefined) { + if (input.EgressOnlyInternetGatewayId !== undefined && input.EgressOnlyInternetGatewayId !== null) { entries["EgressOnlyInternetGatewayId"] = input.EgressOnlyInternetGatewayId; } - if (input.GatewayId !== undefined) { + if (input.GatewayId !== undefined && input.GatewayId !== null) { entries["GatewayId"] = input.GatewayId; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.NatGatewayId !== undefined) { + if (input.NatGatewayId !== undefined && input.NatGatewayId !== null) { entries["NatGatewayId"] = input.NatGatewayId; } - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.LocalGatewayId !== undefined) { + if (input.LocalGatewayId !== undefined && input.LocalGatewayId !== null) { entries["LocalGatewayId"] = input.LocalGatewayId; } - if (input.CarrierGatewayId !== undefined) { + if (input.CarrierGatewayId !== undefined && input.CarrierGatewayId !== null) { entries["CarrierGatewayId"] = input.CarrierGatewayId; } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.RouteTableId !== undefined) { + if (input.RouteTableId !== undefined && input.RouteTableId !== null) { entries["RouteTableId"] = input.RouteTableId; } - if (input.VpcPeeringConnectionId !== undefined) { + if (input.VpcPeeringConnectionId !== undefined && input.VpcPeeringConnectionId !== null) { entries["VpcPeeringConnectionId"] = input.VpcPeeringConnectionId; } return entries; @@ -32086,13 +32143,13 @@ const serializeAws_ec2CreateRouteRequest = (input: CreateRouteRequest, context: const serializeAws_ec2CreateRouteTableRequest = (input: CreateRouteTableRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -32107,23 +32164,23 @@ const serializeAws_ec2CreateSecurityGroupRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["GroupDescription"] = input.Description; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32131,20 +32188,20 @@ const serializeAws_ec2CreateSecurityGroupRequest = ( const serializeAws_ec2CreateSnapshotRequest = (input: CreateSnapshotRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.VolumeId !== undefined) { + if (input.VolumeId !== undefined && input.VolumeId !== null) { entries["VolumeId"] = input.VolumeId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32152,27 +32209,27 @@ const serializeAws_ec2CreateSnapshotRequest = (input: CreateSnapshotRequest, con const serializeAws_ec2CreateSnapshotsRequest = (input: CreateSnapshotsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.InstanceSpecification !== undefined) { + if (input.InstanceSpecification !== undefined && input.InstanceSpecification !== null) { const memberEntries = serializeAws_ec2InstanceSpecification(input.InstanceSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceSpecification.${key}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.CopyTagsFromSource !== undefined) { + if (input.CopyTagsFromSource !== undefined && input.CopyTagsFromSource !== null) { entries["CopyTagsFromSource"] = input.CopyTagsFromSource; } return entries; @@ -32183,13 +32240,13 @@ const serializeAws_ec2CreateSpotDatafeedSubscriptionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Bucket !== undefined) { + if (input.Bucket !== undefined && input.Bucket !== null) { entries["Bucket"] = input.Bucket; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { entries["Prefix"] = input.Prefix; } return entries; @@ -32197,32 +32254,32 @@ const serializeAws_ec2CreateSpotDatafeedSubscriptionRequest = ( const serializeAws_ec2CreateSubnetRequest = (input: CreateSubnetRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.AvailabilityZoneId !== undefined) { + if (input.AvailabilityZoneId !== undefined && input.AvailabilityZoneId !== null) { entries["AvailabilityZoneId"] = input.AvailabilityZoneId; } - if (input.CidrBlock !== undefined) { + if (input.CidrBlock !== undefined && input.CidrBlock !== null) { entries["CidrBlock"] = input.CidrBlock; } - if (input.Ipv6CidrBlock !== undefined) { + if (input.Ipv6CidrBlock !== undefined && input.Ipv6CidrBlock !== null) { entries["Ipv6CidrBlock"] = input.Ipv6CidrBlock; } - if (input.OutpostArn !== undefined) { + if (input.OutpostArn !== undefined && input.OutpostArn !== null) { entries["OutpostArn"] = input.OutpostArn; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32230,17 +32287,17 @@ const serializeAws_ec2CreateSubnetRequest = (input: CreateSubnetRequest, context const serializeAws_ec2CreateTagsRequest = (input: CreateTagsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Resources !== undefined) { + if (input.Resources !== undefined && input.Resources !== null) { const memberEntries = serializeAws_ec2ResourceIdList(input.Resources, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_ec2TagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tag.${key.substring(key.indexOf(".") + 1)}`; @@ -32255,23 +32312,23 @@ const serializeAws_ec2CreateTrafficMirrorFilterRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -32282,51 +32339,51 @@ const serializeAws_ec2CreateTrafficMirrorFilterRuleRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorFilterId !== undefined) { + if (input.TrafficMirrorFilterId !== undefined && input.TrafficMirrorFilterId !== null) { entries["TrafficMirrorFilterId"] = input.TrafficMirrorFilterId; } - if (input.TrafficDirection !== undefined) { + if (input.TrafficDirection !== undefined && input.TrafficDirection !== null) { entries["TrafficDirection"] = input.TrafficDirection; } - if (input.RuleNumber !== undefined) { + if (input.RuleNumber !== undefined && input.RuleNumber !== null) { entries["RuleNumber"] = input.RuleNumber; } - if (input.RuleAction !== undefined) { + if (input.RuleAction !== undefined && input.RuleAction !== null) { entries["RuleAction"] = input.RuleAction; } - if (input.DestinationPortRange !== undefined) { + if (input.DestinationPortRange !== undefined && input.DestinationPortRange !== null) { const memberEntries = serializeAws_ec2TrafficMirrorPortRangeRequest(input.DestinationPortRange, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DestinationPortRange.${key}`; entries[loc] = value; }); } - if (input.SourcePortRange !== undefined) { + if (input.SourcePortRange !== undefined && input.SourcePortRange !== null) { const memberEntries = serializeAws_ec2TrafficMirrorPortRangeRequest(input.SourcePortRange, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourcePortRange.${key}`; entries[loc] = value; }); } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.SourceCidrBlock !== undefined) { + if (input.SourceCidrBlock !== undefined && input.SourceCidrBlock !== null) { entries["SourceCidrBlock"] = input.SourceCidrBlock; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -32337,41 +32394,41 @@ const serializeAws_ec2CreateTrafficMirrorSessionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.TrafficMirrorTargetId !== undefined) { + if (input.TrafficMirrorTargetId !== undefined && input.TrafficMirrorTargetId !== null) { entries["TrafficMirrorTargetId"] = input.TrafficMirrorTargetId; } - if (input.TrafficMirrorFilterId !== undefined) { + if (input.TrafficMirrorFilterId !== undefined && input.TrafficMirrorFilterId !== null) { entries["TrafficMirrorFilterId"] = input.TrafficMirrorFilterId; } - if (input.PacketLength !== undefined) { + if (input.PacketLength !== undefined && input.PacketLength !== null) { entries["PacketLength"] = input.PacketLength; } - if (input.SessionNumber !== undefined) { + if (input.SessionNumber !== undefined && input.SessionNumber !== null) { entries["SessionNumber"] = input.SessionNumber; } - if (input.VirtualNetworkId !== undefined) { + if (input.VirtualNetworkId !== undefined && input.VirtualNetworkId !== null) { entries["VirtualNetworkId"] = input.VirtualNetworkId; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -32382,29 +32439,29 @@ const serializeAws_ec2CreateTrafficMirrorTargetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.NetworkLoadBalancerArn !== undefined) { + if (input.NetworkLoadBalancerArn !== undefined && input.NetworkLoadBalancerArn !== null) { entries["NetworkLoadBalancerArn"] = input.NetworkLoadBalancerArn; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -32415,37 +32472,37 @@ const serializeAws_ec2CreateTransitGatewayConnectPeerRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.TransitGatewayAddress !== undefined) { + if (input.TransitGatewayAddress !== undefined && input.TransitGatewayAddress !== null) { entries["TransitGatewayAddress"] = input.TransitGatewayAddress; } - if (input.PeerAddress !== undefined) { + if (input.PeerAddress !== undefined && input.PeerAddress !== null) { entries["PeerAddress"] = input.PeerAddress; } - if (input.BgpOptions !== undefined) { + if (input.BgpOptions !== undefined && input.BgpOptions !== null) { const memberEntries = serializeAws_ec2TransitGatewayConnectRequestBgpOptions(input.BgpOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BgpOptions.${key}`; entries[loc] = value; }); } - if (input.InsideCidrBlocks !== undefined) { + if (input.InsideCidrBlocks !== undefined && input.InsideCidrBlocks !== null) { const memberEntries = serializeAws_ec2InsideCidrBlocksStringList(input.InsideCidrBlocks, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InsideCidrBlocks.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32456,24 +32513,24 @@ const serializeAws_ec2CreateTransitGatewayConnectRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransportTransitGatewayAttachmentId !== undefined) { + if (input.TransportTransitGatewayAttachmentId !== undefined && input.TransportTransitGatewayAttachmentId !== null) { entries["TransportTransitGatewayAttachmentId"] = input.TransportTransitGatewayAttachmentId; } - if (input.Options !== undefined) { + if (input.Options !== undefined && input.Options !== null) { const memberEntries = serializeAws_ec2CreateTransitGatewayConnectRequestOptions(input.Options, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Options.${key}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32484,7 +32541,7 @@ const serializeAws_ec2CreateTransitGatewayConnectRequestOptions = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } return entries; @@ -32495,24 +32552,24 @@ const serializeAws_ec2CreateTransitGatewayMulticastDomainRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.Options !== undefined) { + if (input.Options !== undefined && input.Options !== null) { const memberEntries = serializeAws_ec2CreateTransitGatewayMulticastDomainRequestOptions(input.Options, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Options.${key}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32523,13 +32580,13 @@ const serializeAws_ec2CreateTransitGatewayMulticastDomainRequestOptions = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Igmpv2Support !== undefined) { + if (input.Igmpv2Support !== undefined && input.Igmpv2Support !== null) { entries["Igmpv2Support"] = input.Igmpv2Support; } - if (input.StaticSourcesSupport !== undefined) { + if (input.StaticSourcesSupport !== undefined && input.StaticSourcesSupport !== null) { entries["StaticSourcesSupport"] = input.StaticSourcesSupport; } - if (input.AutoAcceptSharedAssociations !== undefined) { + if (input.AutoAcceptSharedAssociations !== undefined && input.AutoAcceptSharedAssociations !== null) { entries["AutoAcceptSharedAssociations"] = input.AutoAcceptSharedAssociations; } return entries; @@ -32540,26 +32597,26 @@ const serializeAws_ec2CreateTransitGatewayPeeringAttachmentRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.PeerTransitGatewayId !== undefined) { + if (input.PeerTransitGatewayId !== undefined && input.PeerTransitGatewayId !== null) { entries["PeerTransitGatewayId"] = input.PeerTransitGatewayId; } - if (input.PeerAccountId !== undefined) { + if (input.PeerAccountId !== undefined && input.PeerAccountId !== null) { entries["PeerAccountId"] = input.PeerAccountId; } - if (input.PeerRegion !== undefined) { + if (input.PeerRegion !== undefined && input.PeerRegion !== null) { entries["PeerRegion"] = input.PeerRegion; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32570,19 +32627,19 @@ const serializeAws_ec2CreateTransitGatewayPrefixListReferenceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.PrefixListId !== undefined) { + if (input.PrefixListId !== undefined && input.PrefixListId !== null) { entries["PrefixListId"] = input.PrefixListId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.Blackhole !== undefined) { + if (input.Blackhole !== undefined && input.Blackhole !== null) { entries["Blackhole"] = input.Blackhole; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32593,24 +32650,24 @@ const serializeAws_ec2CreateTransitGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Options !== undefined) { + if (input.Options !== undefined && input.Options !== null) { const memberEntries = serializeAws_ec2TransitGatewayRequestOptions(input.Options, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Options.${key}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32621,19 +32678,19 @@ const serializeAws_ec2CreateTransitGatewayRouteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.Blackhole !== undefined) { + if (input.Blackhole !== undefined && input.Blackhole !== null) { entries["Blackhole"] = input.Blackhole; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32644,17 +32701,17 @@ const serializeAws_ec2CreateTransitGatewayRouteTableRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecifications.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32665,34 +32722,34 @@ const serializeAws_ec2CreateTransitGatewayVpcAttachmentRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_ec2TransitGatewaySubnetIdList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Options !== undefined) { + if (input.Options !== undefined && input.Options !== null) { const memberEntries = serializeAws_ec2CreateTransitGatewayVpcAttachmentRequestOptions(input.Options, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Options.${key}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecifications.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -32703,13 +32760,13 @@ const serializeAws_ec2CreateTransitGatewayVpcAttachmentRequestOptions = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DnsSupport !== undefined) { + if (input.DnsSupport !== undefined && input.DnsSupport !== null) { entries["DnsSupport"] = input.DnsSupport; } - if (input.Ipv6Support !== undefined) { + if (input.Ipv6Support !== undefined && input.Ipv6Support !== null) { entries["Ipv6Support"] = input.Ipv6Support; } - if (input.ApplianceModeSupport !== undefined) { + if (input.ApplianceModeSupport !== undefined && input.ApplianceModeSupport !== null) { entries["ApplianceModeSupport"] = input.ApplianceModeSupport; } return entries; @@ -32717,10 +32774,10 @@ const serializeAws_ec2CreateTransitGatewayVpcAttachmentRequestOptions = ( const serializeAws_ec2CreateVolumePermission = (input: CreateVolumePermission, context: __SerdeContext): any => { const entries: any = {}; - if (input.Group !== undefined) { + if (input.Group !== undefined && input.Group !== null) { entries["Group"] = input.Group; } - if (input.UserId !== undefined) { + if (input.UserId !== undefined && input.UserId !== null) { entries["UserId"] = input.UserId; } return entries; @@ -32730,6 +32787,9 @@ const serializeAws_ec2CreateVolumePermissionList = (input: CreateVolumePermissio const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2CreateVolumePermission(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -32744,14 +32804,14 @@ const serializeAws_ec2CreateVolumePermissionModifications = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Add !== undefined) { + if (input.Add !== undefined && input.Add !== null) { const memberEntries = serializeAws_ec2CreateVolumePermissionList(input.Add, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Add.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Remove !== undefined) { + if (input.Remove !== undefined && input.Remove !== null) { const memberEntries = serializeAws_ec2CreateVolumePermissionList(input.Remove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Remove.${key.substring(key.indexOf(".") + 1)}`; @@ -32763,44 +32823,44 @@ const serializeAws_ec2CreateVolumePermissionModifications = ( const serializeAws_ec2CreateVolumeRequest = (input: CreateVolumeRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.OutpostArn !== undefined) { + if (input.OutpostArn !== undefined && input.OutpostArn !== null) { entries["OutpostArn"] = input.OutpostArn; } - if (input.Size !== undefined) { + if (input.Size !== undefined && input.Size !== null) { entries["Size"] = input.Size; } - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.VolumeType !== undefined) { + if (input.VolumeType !== undefined && input.VolumeType !== null) { entries["VolumeType"] = input.VolumeType; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MultiAttachEnabled !== undefined) { + if (input.MultiAttachEnabled !== undefined && input.MultiAttachEnabled !== null) { entries["MultiAttachEnabled"] = input.MultiAttachEnabled; } - if (input.Throughput !== undefined) { + if (input.Throughput !== undefined && input.Throughput !== null) { entries["Throughput"] = input.Throughput; } return entries; @@ -32811,26 +32871,26 @@ const serializeAws_ec2CreateVpcEndpointConnectionNotificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceId !== undefined) { + if (input.ServiceId !== undefined && input.ServiceId !== null) { entries["ServiceId"] = input.ServiceId; } - if (input.VpcEndpointId !== undefined) { + if (input.VpcEndpointId !== undefined && input.VpcEndpointId !== null) { entries["VpcEndpointId"] = input.VpcEndpointId; } - if (input.ConnectionNotificationArn !== undefined) { + if (input.ConnectionNotificationArn !== undefined && input.ConnectionNotificationArn !== null) { entries["ConnectionNotificationArn"] = input.ConnectionNotificationArn; } - if (input.ConnectionEvents !== undefined) { + if (input.ConnectionEvents !== undefined && input.ConnectionEvents !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.ConnectionEvents, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConnectionEvents.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -32838,49 +32898,49 @@ const serializeAws_ec2CreateVpcEndpointConnectionNotificationRequest = ( const serializeAws_ec2CreateVpcEndpointRequest = (input: CreateVpcEndpointRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcEndpointType !== undefined) { + if (input.VpcEndpointType !== undefined && input.VpcEndpointType !== null) { entries["VpcEndpointType"] = input.VpcEndpointType; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.ServiceName !== undefined) { + if (input.ServiceName !== undefined && input.ServiceName !== null) { entries["ServiceName"] = input.ServiceName; } - if (input.PolicyDocument !== undefined) { + if (input.PolicyDocument !== undefined && input.PolicyDocument !== null) { entries["PolicyDocument"] = input.PolicyDocument; } - if (input.RouteTableIds !== undefined) { + if (input.RouteTableIds !== undefined && input.RouteTableIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointRouteTableIdList(input.RouteTableIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RouteTableId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointSubnetIdList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointSecurityGroupIdList(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.PrivateDnsEnabled !== undefined) { + if (input.PrivateDnsEnabled !== undefined && input.PrivateDnsEnabled !== null) { entries["PrivateDnsEnabled"] = input.PrivateDnsEnabled; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -32895,33 +32955,33 @@ const serializeAws_ec2CreateVpcEndpointServiceConfigurationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.AcceptanceRequired !== undefined) { + if (input.AcceptanceRequired !== undefined && input.AcceptanceRequired !== null) { entries["AcceptanceRequired"] = input.AcceptanceRequired; } - if (input.PrivateDnsName !== undefined) { + if (input.PrivateDnsName !== undefined && input.PrivateDnsName !== null) { entries["PrivateDnsName"] = input.PrivateDnsName; } - if (input.NetworkLoadBalancerArns !== undefined) { + if (input.NetworkLoadBalancerArns !== undefined && input.NetworkLoadBalancerArns !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.NetworkLoadBalancerArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkLoadBalancerArn.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.GatewayLoadBalancerArns !== undefined) { + if (input.GatewayLoadBalancerArns !== undefined && input.GatewayLoadBalancerArns !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.GatewayLoadBalancerArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GatewayLoadBalancerArn.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -32936,22 +32996,22 @@ const serializeAws_ec2CreateVpcPeeringConnectionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PeerOwnerId !== undefined) { + if (input.PeerOwnerId !== undefined && input.PeerOwnerId !== null) { entries["PeerOwnerId"] = input.PeerOwnerId; } - if (input.PeerVpcId !== undefined) { + if (input.PeerVpcId !== undefined && input.PeerVpcId !== null) { entries["PeerVpcId"] = input.PeerVpcId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.PeerRegion !== undefined) { + if (input.PeerRegion !== undefined && input.PeerRegion !== null) { entries["PeerRegion"] = input.PeerRegion; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -32963,28 +33023,28 @@ const serializeAws_ec2CreateVpcPeeringConnectionRequest = ( const serializeAws_ec2CreateVpcRequest = (input: CreateVpcRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.CidrBlock !== undefined) { + if (input.CidrBlock !== undefined && input.CidrBlock !== null) { entries["CidrBlock"] = input.CidrBlock; } - if (input.AmazonProvidedIpv6CidrBlock !== undefined) { + if (input.AmazonProvidedIpv6CidrBlock !== undefined && input.AmazonProvidedIpv6CidrBlock !== null) { entries["AmazonProvidedIpv6CidrBlock"] = input.AmazonProvidedIpv6CidrBlock; } - if (input.Ipv6Pool !== undefined) { + if (input.Ipv6Pool !== undefined && input.Ipv6Pool !== null) { entries["Ipv6Pool"] = input.Ipv6Pool; } - if (input.Ipv6CidrBlock !== undefined) { + if (input.Ipv6CidrBlock !== undefined && input.Ipv6CidrBlock !== null) { entries["Ipv6CidrBlock"] = input.Ipv6CidrBlock; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceTenancy !== undefined) { + if (input.InstanceTenancy !== undefined && input.InstanceTenancy !== null) { entries["InstanceTenancy"] = input.InstanceTenancy; } - if (input.Ipv6CidrBlockNetworkBorderGroup !== undefined) { + if (input.Ipv6CidrBlockNetworkBorderGroup !== undefined && input.Ipv6CidrBlockNetworkBorderGroup !== null) { entries["Ipv6CidrBlockNetworkBorderGroup"] = input.Ipv6CidrBlockNetworkBorderGroup; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -32999,29 +33059,29 @@ const serializeAws_ec2CreateVpnConnectionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CustomerGatewayId !== undefined) { + if (input.CustomerGatewayId !== undefined && input.CustomerGatewayId !== null) { entries["CustomerGatewayId"] = input.CustomerGatewayId; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.VpnGatewayId !== undefined) { + if (input.VpnGatewayId !== undefined && input.VpnGatewayId !== null) { entries["VpnGatewayId"] = input.VpnGatewayId; } - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Options !== undefined) { + if (input.Options !== undefined && input.Options !== null) { const memberEntries = serializeAws_ec2VpnConnectionOptionsSpecification(input.Options, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Options.${key}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -33036,10 +33096,10 @@ const serializeAws_ec2CreateVpnConnectionRouteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.VpnConnectionId !== undefined) { + if (input.VpnConnectionId !== undefined && input.VpnConnectionId !== null) { entries["VpnConnectionId"] = input.VpnConnectionId; } return entries; @@ -33047,23 +33107,23 @@ const serializeAws_ec2CreateVpnConnectionRouteRequest = ( const serializeAws_ec2CreateVpnGatewayRequest = (input: CreateVpnGatewayRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AmazonSideAsn !== undefined) { + if (input.AmazonSideAsn !== undefined && input.AmazonSideAsn !== null) { entries["AmazonSideAsn"] = input.AmazonSideAsn; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33074,7 +33134,7 @@ const serializeAws_ec2CreditSpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CpuCredits !== undefined) { + if (input.CpuCredits !== undefined && input.CpuCredits !== null) { entries["CpuCredits"] = input.CpuCredits; } return entries; @@ -33084,6 +33144,9 @@ const serializeAws_ec2CustomerGatewayIdStringList = (input: string[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`CustomerGatewayId.${counter}`] = entry; counter++; } @@ -33095,10 +33158,10 @@ const serializeAws_ec2DeleteCarrierGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CarrierGatewayId !== undefined) { + if (input.CarrierGatewayId !== undefined && input.CarrierGatewayId !== null) { entries["CarrierGatewayId"] = input.CarrierGatewayId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33109,10 +33172,10 @@ const serializeAws_ec2DeleteClientVpnEndpointRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33123,16 +33186,16 @@ const serializeAws_ec2DeleteClientVpnRouteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.TargetVpcSubnetId !== undefined) { + if (input.TargetVpcSubnetId !== undefined && input.TargetVpcSubnetId !== null) { entries["TargetVpcSubnetId"] = input.TargetVpcSubnetId; } - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33143,10 +33206,10 @@ const serializeAws_ec2DeleteCustomerGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CustomerGatewayId !== undefined) { + if (input.CustomerGatewayId !== undefined && input.CustomerGatewayId !== null) { entries["CustomerGatewayId"] = input.CustomerGatewayId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33154,10 +33217,10 @@ const serializeAws_ec2DeleteCustomerGatewayRequest = ( const serializeAws_ec2DeleteDhcpOptionsRequest = (input: DeleteDhcpOptionsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DhcpOptionsId !== undefined) { + if (input.DhcpOptionsId !== undefined && input.DhcpOptionsId !== null) { entries["DhcpOptionsId"] = input.DhcpOptionsId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33168,10 +33231,10 @@ const serializeAws_ec2DeleteEgressOnlyInternetGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.EgressOnlyInternetGatewayId !== undefined) { + if (input.EgressOnlyInternetGatewayId !== undefined && input.EgressOnlyInternetGatewayId !== null) { entries["EgressOnlyInternetGatewayId"] = input.EgressOnlyInternetGatewayId; } return entries; @@ -33179,17 +33242,17 @@ const serializeAws_ec2DeleteEgressOnlyInternetGatewayRequest = ( const serializeAws_ec2DeleteFleetsRequest = (input: DeleteFleetsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.FleetIds !== undefined) { + if (input.FleetIds !== undefined && input.FleetIds !== null) { const memberEntries = serializeAws_ec2FleetIdSet(input.FleetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FleetId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.TerminateInstances !== undefined) { + if (input.TerminateInstances !== undefined && input.TerminateInstances !== null) { entries["TerminateInstances"] = input.TerminateInstances; } return entries; @@ -33197,10 +33260,10 @@ const serializeAws_ec2DeleteFleetsRequest = (input: DeleteFleetsRequest, context const serializeAws_ec2DeleteFlowLogsRequest = (input: DeleteFlowLogsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.FlowLogIds !== undefined) { + if (input.FlowLogIds !== undefined && input.FlowLogIds !== null) { const memberEntries = serializeAws_ec2FlowLogIdList(input.FlowLogIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FlowLogId.${key.substring(key.indexOf(".") + 1)}`; @@ -33212,10 +33275,10 @@ const serializeAws_ec2DeleteFlowLogsRequest = (input: DeleteFlowLogsRequest, con const serializeAws_ec2DeleteFpgaImageRequest = (input: DeleteFpgaImageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.FpgaImageId !== undefined) { + if (input.FpgaImageId !== undefined && input.FpgaImageId !== null) { entries["FpgaImageId"] = input.FpgaImageId; } return entries; @@ -33226,10 +33289,10 @@ const serializeAws_ec2DeleteInternetGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InternetGatewayId !== undefined) { + if (input.InternetGatewayId !== undefined && input.InternetGatewayId !== null) { entries["InternetGatewayId"] = input.InternetGatewayId; } return entries; @@ -33237,13 +33300,13 @@ const serializeAws_ec2DeleteInternetGatewayRequest = ( const serializeAws_ec2DeleteKeyPairRequest = (input: DeleteKeyPairRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.KeyName !== undefined) { + if (input.KeyName !== undefined && input.KeyName !== null) { entries["KeyName"] = input.KeyName; } - if (input.KeyPairId !== undefined) { + if (input.KeyPairId !== undefined && input.KeyPairId !== null) { entries["KeyPairId"] = input.KeyPairId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33254,13 +33317,13 @@ const serializeAws_ec2DeleteLaunchTemplateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.LaunchTemplateId !== undefined) { + if (input.LaunchTemplateId !== undefined && input.LaunchTemplateId !== null) { entries["LaunchTemplateId"] = input.LaunchTemplateId; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } return entries; @@ -33271,16 +33334,16 @@ const serializeAws_ec2DeleteLaunchTemplateVersionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.LaunchTemplateId !== undefined) { + if (input.LaunchTemplateId !== undefined && input.LaunchTemplateId !== null) { entries["LaunchTemplateId"] = input.LaunchTemplateId; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } - if (input.Versions !== undefined) { + if (input.Versions !== undefined && input.Versions !== null) { const memberEntries = serializeAws_ec2VersionStringList(input.Versions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateVersion.${key.substring(key.indexOf(".") + 1)}`; @@ -33295,13 +33358,13 @@ const serializeAws_ec2DeleteLocalGatewayRouteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.LocalGatewayRouteTableId !== undefined) { + if (input.LocalGatewayRouteTableId !== undefined && input.LocalGatewayRouteTableId !== null) { entries["LocalGatewayRouteTableId"] = input.LocalGatewayRouteTableId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33312,10 +33375,13 @@ const serializeAws_ec2DeleteLocalGatewayRouteTableVpcAssociationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LocalGatewayRouteTableVpcAssociationId !== undefined) { + if ( + input.LocalGatewayRouteTableVpcAssociationId !== undefined && + input.LocalGatewayRouteTableVpcAssociationId !== null + ) { entries["LocalGatewayRouteTableVpcAssociationId"] = input.LocalGatewayRouteTableVpcAssociationId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33326,10 +33392,10 @@ const serializeAws_ec2DeleteManagedPrefixListRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PrefixListId !== undefined) { + if (input.PrefixListId !== undefined && input.PrefixListId !== null) { entries["PrefixListId"] = input.PrefixListId; } return entries; @@ -33337,10 +33403,10 @@ const serializeAws_ec2DeleteManagedPrefixListRequest = ( const serializeAws_ec2DeleteNatGatewayRequest = (input: DeleteNatGatewayRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NatGatewayId !== undefined) { + if (input.NatGatewayId !== undefined && input.NatGatewayId !== null) { entries["NatGatewayId"] = input.NatGatewayId; } return entries; @@ -33351,16 +33417,16 @@ const serializeAws_ec2DeleteNetworkAclEntryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Egress !== undefined) { + if (input.Egress !== undefined && input.Egress !== null) { entries["Egress"] = input.Egress; } - if (input.NetworkAclId !== undefined) { + if (input.NetworkAclId !== undefined && input.NetworkAclId !== null) { entries["NetworkAclId"] = input.NetworkAclId; } - if (input.RuleNumber !== undefined) { + if (input.RuleNumber !== undefined && input.RuleNumber !== null) { entries["RuleNumber"] = input.RuleNumber; } return entries; @@ -33368,10 +33434,10 @@ const serializeAws_ec2DeleteNetworkAclEntryRequest = ( const serializeAws_ec2DeleteNetworkAclRequest = (input: DeleteNetworkAclRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkAclId !== undefined) { + if (input.NetworkAclId !== undefined && input.NetworkAclId !== null) { entries["NetworkAclId"] = input.NetworkAclId; } return entries; @@ -33382,10 +33448,10 @@ const serializeAws_ec2DeleteNetworkInsightsAnalysisRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkInsightsAnalysisId !== undefined) { + if (input.NetworkInsightsAnalysisId !== undefined && input.NetworkInsightsAnalysisId !== null) { entries["NetworkInsightsAnalysisId"] = input.NetworkInsightsAnalysisId; } return entries; @@ -33396,10 +33462,10 @@ const serializeAws_ec2DeleteNetworkInsightsPathRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkInsightsPathId !== undefined) { + if (input.NetworkInsightsPathId !== undefined && input.NetworkInsightsPathId !== null) { entries["NetworkInsightsPathId"] = input.NetworkInsightsPathId; } return entries; @@ -33410,13 +33476,13 @@ const serializeAws_ec2DeleteNetworkInterfacePermissionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NetworkInterfacePermissionId !== undefined) { + if (input.NetworkInterfacePermissionId !== undefined && input.NetworkInterfacePermissionId !== null) { entries["NetworkInterfacePermissionId"] = input.NetworkInterfacePermissionId; } - if (input.Force !== undefined) { + if (input.Force !== undefined && input.Force !== null) { entries["Force"] = input.Force; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33427,10 +33493,10 @@ const serializeAws_ec2DeleteNetworkInterfaceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } return entries; @@ -33441,10 +33507,10 @@ const serializeAws_ec2DeletePlacementGroupRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } return entries; @@ -33454,6 +33520,9 @@ const serializeAws_ec2DeleteQueuedReservedInstancesIdList = (input: string[], co const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -33465,10 +33534,10 @@ const serializeAws_ec2DeleteQueuedReservedInstancesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ReservedInstancesIds !== undefined) { + if (input.ReservedInstancesIds !== undefined && input.ReservedInstancesIds !== null) { const memberEntries = serializeAws_ec2DeleteQueuedReservedInstancesIdList(input.ReservedInstancesIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReservedInstancesId.${key.substring(key.indexOf(".") + 1)}`; @@ -33480,19 +33549,19 @@ const serializeAws_ec2DeleteQueuedReservedInstancesRequest = ( const serializeAws_ec2DeleteRouteRequest = (input: DeleteRouteRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.DestinationIpv6CidrBlock !== undefined) { + if (input.DestinationIpv6CidrBlock !== undefined && input.DestinationIpv6CidrBlock !== null) { entries["DestinationIpv6CidrBlock"] = input.DestinationIpv6CidrBlock; } - if (input.DestinationPrefixListId !== undefined) { + if (input.DestinationPrefixListId !== undefined && input.DestinationPrefixListId !== null) { entries["DestinationPrefixListId"] = input.DestinationPrefixListId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.RouteTableId !== undefined) { + if (input.RouteTableId !== undefined && input.RouteTableId !== null) { entries["RouteTableId"] = input.RouteTableId; } return entries; @@ -33500,10 +33569,10 @@ const serializeAws_ec2DeleteRouteRequest = (input: DeleteRouteRequest, context: const serializeAws_ec2DeleteRouteTableRequest = (input: DeleteRouteTableRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.RouteTableId !== undefined) { + if (input.RouteTableId !== undefined && input.RouteTableId !== null) { entries["RouteTableId"] = input.RouteTableId; } return entries; @@ -33514,13 +33583,13 @@ const serializeAws_ec2DeleteSecurityGroupRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { entries["GroupId"] = input.GroupId; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33528,10 +33597,10 @@ const serializeAws_ec2DeleteSecurityGroupRequest = ( const serializeAws_ec2DeleteSnapshotRequest = (input: DeleteSnapshotRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33542,7 +33611,7 @@ const serializeAws_ec2DeleteSpotDatafeedSubscriptionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33550,10 +33619,10 @@ const serializeAws_ec2DeleteSpotDatafeedSubscriptionRequest = ( const serializeAws_ec2DeleteSubnetRequest = (input: DeleteSubnetRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33561,17 +33630,17 @@ const serializeAws_ec2DeleteSubnetRequest = (input: DeleteSubnetRequest, context const serializeAws_ec2DeleteTagsRequest = (input: DeleteTagsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Resources !== undefined) { + if (input.Resources !== undefined && input.Resources !== null) { const memberEntries = serializeAws_ec2ResourceIdList(input.Resources, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_ec2TagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tag.${key.substring(key.indexOf(".") + 1)}`; @@ -33586,10 +33655,10 @@ const serializeAws_ec2DeleteTrafficMirrorFilterRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorFilterId !== undefined) { + if (input.TrafficMirrorFilterId !== undefined && input.TrafficMirrorFilterId !== null) { entries["TrafficMirrorFilterId"] = input.TrafficMirrorFilterId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33600,10 +33669,10 @@ const serializeAws_ec2DeleteTrafficMirrorFilterRuleRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorFilterRuleId !== undefined) { + if (input.TrafficMirrorFilterRuleId !== undefined && input.TrafficMirrorFilterRuleId !== null) { entries["TrafficMirrorFilterRuleId"] = input.TrafficMirrorFilterRuleId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33614,10 +33683,10 @@ const serializeAws_ec2DeleteTrafficMirrorSessionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorSessionId !== undefined) { + if (input.TrafficMirrorSessionId !== undefined && input.TrafficMirrorSessionId !== null) { entries["TrafficMirrorSessionId"] = input.TrafficMirrorSessionId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33628,10 +33697,10 @@ const serializeAws_ec2DeleteTrafficMirrorTargetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorTargetId !== undefined) { + if (input.TrafficMirrorTargetId !== undefined && input.TrafficMirrorTargetId !== null) { entries["TrafficMirrorTargetId"] = input.TrafficMirrorTargetId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33642,10 +33711,10 @@ const serializeAws_ec2DeleteTransitGatewayConnectPeerRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayConnectPeerId !== undefined) { + if (input.TransitGatewayConnectPeerId !== undefined && input.TransitGatewayConnectPeerId !== null) { entries["TransitGatewayConnectPeerId"] = input.TransitGatewayConnectPeerId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33656,10 +33725,10 @@ const serializeAws_ec2DeleteTransitGatewayConnectRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33670,10 +33739,10 @@ const serializeAws_ec2DeleteTransitGatewayMulticastDomainRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33684,10 +33753,10 @@ const serializeAws_ec2DeleteTransitGatewayPeeringAttachmentRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33698,13 +33767,13 @@ const serializeAws_ec2DeleteTransitGatewayPrefixListReferenceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.PrefixListId !== undefined) { + if (input.PrefixListId !== undefined && input.PrefixListId !== null) { entries["PrefixListId"] = input.PrefixListId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33715,10 +33784,10 @@ const serializeAws_ec2DeleteTransitGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33729,13 +33798,13 @@ const serializeAws_ec2DeleteTransitGatewayRouteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33746,10 +33815,10 @@ const serializeAws_ec2DeleteTransitGatewayRouteTableRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33760,10 +33829,10 @@ const serializeAws_ec2DeleteTransitGatewayVpcAttachmentRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33771,10 +33840,10 @@ const serializeAws_ec2DeleteTransitGatewayVpcAttachmentRequest = ( const serializeAws_ec2DeleteVolumeRequest = (input: DeleteVolumeRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.VolumeId !== undefined) { + if (input.VolumeId !== undefined && input.VolumeId !== null) { entries["VolumeId"] = input.VolumeId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33785,10 +33854,10 @@ const serializeAws_ec2DeleteVpcEndpointConnectionNotificationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ConnectionNotificationIds !== undefined) { + if (input.ConnectionNotificationIds !== undefined && input.ConnectionNotificationIds !== null) { const memberEntries = serializeAws_ec2ConnectionNotificationIdsList(input.ConnectionNotificationIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConnectionNotificationId.${key.substring(key.indexOf(".") + 1)}`; @@ -33803,10 +33872,10 @@ const serializeAws_ec2DeleteVpcEndpointServiceConfigurationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceIds !== undefined) { + if (input.ServiceIds !== undefined && input.ServiceIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointServiceIdList(input.ServiceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ServiceId.${key.substring(key.indexOf(".") + 1)}`; @@ -33818,10 +33887,10 @@ const serializeAws_ec2DeleteVpcEndpointServiceConfigurationsRequest = ( const serializeAws_ec2DeleteVpcEndpointsRequest = (input: DeleteVpcEndpointsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcEndpointIds !== undefined) { + if (input.VpcEndpointIds !== undefined && input.VpcEndpointIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointIdList(input.VpcEndpointIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcEndpointId.${key.substring(key.indexOf(".") + 1)}`; @@ -33836,10 +33905,10 @@ const serializeAws_ec2DeleteVpcPeeringConnectionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcPeeringConnectionId !== undefined) { + if (input.VpcPeeringConnectionId !== undefined && input.VpcPeeringConnectionId !== null) { entries["VpcPeeringConnectionId"] = input.VpcPeeringConnectionId; } return entries; @@ -33847,10 +33916,10 @@ const serializeAws_ec2DeleteVpcPeeringConnectionRequest = ( const serializeAws_ec2DeleteVpcRequest = (input: DeleteVpcRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33861,10 +33930,10 @@ const serializeAws_ec2DeleteVpnConnectionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VpnConnectionId !== undefined) { + if (input.VpnConnectionId !== undefined && input.VpnConnectionId !== null) { entries["VpnConnectionId"] = input.VpnConnectionId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33875,10 +33944,10 @@ const serializeAws_ec2DeleteVpnConnectionRouteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.VpnConnectionId !== undefined) { + if (input.VpnConnectionId !== undefined && input.VpnConnectionId !== null) { entries["VpnConnectionId"] = input.VpnConnectionId; } return entries; @@ -33886,10 +33955,10 @@ const serializeAws_ec2DeleteVpnConnectionRouteRequest = ( const serializeAws_ec2DeleteVpnGatewayRequest = (input: DeleteVpnGatewayRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.VpnGatewayId !== undefined) { + if (input.VpnGatewayId !== undefined && input.VpnGatewayId !== null) { entries["VpnGatewayId"] = input.VpnGatewayId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33900,10 +33969,10 @@ const serializeAws_ec2DeprovisionByoipCidrRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Cidr !== undefined) { + if (input.Cidr !== undefined && input.Cidr !== null) { entries["Cidr"] = input.Cidr; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33911,10 +33980,10 @@ const serializeAws_ec2DeprovisionByoipCidrRequest = ( const serializeAws_ec2DeregisterImageRequest = (input: DeregisterImageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33925,10 +33994,10 @@ const serializeAws_ec2DeregisterInstanceEventNotificationAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceTagAttribute !== undefined) { + if (input.InstanceTagAttribute !== undefined && input.InstanceTagAttribute !== null) { const memberEntries = serializeAws_ec2DeregisterInstanceTagAttributeRequest(input.InstanceTagAttribute, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceTagAttribute.${key}`; @@ -33943,10 +34012,10 @@ const serializeAws_ec2DeregisterInstanceTagAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.IncludeAllTagsOfInstance !== undefined) { + if (input.IncludeAllTagsOfInstance !== undefined && input.IncludeAllTagsOfInstance !== null) { entries["IncludeAllTagsOfInstance"] = input.IncludeAllTagsOfInstance; } - if (input.InstanceTagKeys !== undefined) { + if (input.InstanceTagKeys !== undefined && input.InstanceTagKeys !== null) { const memberEntries = serializeAws_ec2InstanceTagKeySet(input.InstanceTagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceTagKey.${key.substring(key.indexOf(".") + 1)}`; @@ -33961,20 +34030,20 @@ const serializeAws_ec2DeregisterTransitGatewayMulticastGroupMembersRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.GroupIpAddress !== undefined) { + if (input.GroupIpAddress !== undefined && input.GroupIpAddress !== null) { entries["GroupIpAddress"] = input.GroupIpAddress; } - if (input.NetworkInterfaceIds !== undefined) { + if (input.NetworkInterfaceIds !== undefined && input.NetworkInterfaceIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayNetworkInterfaceIdList(input.NetworkInterfaceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInterfaceIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -33985,20 +34054,20 @@ const serializeAws_ec2DeregisterTransitGatewayMulticastGroupSourcesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.GroupIpAddress !== undefined) { + if (input.GroupIpAddress !== undefined && input.GroupIpAddress !== null) { entries["GroupIpAddress"] = input.GroupIpAddress; } - if (input.NetworkInterfaceIds !== undefined) { + if (input.NetworkInterfaceIds !== undefined && input.NetworkInterfaceIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayNetworkInterfaceIdList(input.NetworkInterfaceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInterfaceIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34009,14 +34078,14 @@ const serializeAws_ec2DescribeAccountAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AttributeNames !== undefined) { + if (input.AttributeNames !== undefined && input.AttributeNames !== null) { const memberEntries = serializeAws_ec2AccountAttributeNameStringList(input.AttributeNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AttributeName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34024,28 +34093,28 @@ const serializeAws_ec2DescribeAccountAttributesRequest = ( const serializeAws_ec2DescribeAddressesRequest = (input: DescribeAddressesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.PublicIps !== undefined) { + if (input.PublicIps !== undefined && input.PublicIps !== null) { const memberEntries = serializeAws_ec2PublicIpStringList(input.PublicIps, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PublicIp.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AllocationIds !== undefined) { + if (input.AllocationIds !== undefined && input.AllocationIds !== null) { const memberEntries = serializeAws_ec2AllocationIdList(input.AllocationIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AllocationId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34056,7 +34125,7 @@ const serializeAws_ec2DescribeAggregateIdFormatRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34067,31 +34136,31 @@ const serializeAws_ec2DescribeAvailabilityZonesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ZoneNames !== undefined) { + if (input.ZoneNames !== undefined && input.ZoneNames !== null) { const memberEntries = serializeAws_ec2ZoneNameStringList(input.ZoneNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ZoneName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ZoneIds !== undefined) { + if (input.ZoneIds !== undefined && input.ZoneIds !== null) { const memberEntries = serializeAws_ec2ZoneIdStringList(input.ZoneIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ZoneId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AllAvailabilityZones !== undefined) { + if (input.AllAvailabilityZones !== undefined && input.AllAvailabilityZones !== null) { entries["AllAvailabilityZones"] = input.AllAvailabilityZones; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34102,21 +34171,21 @@ const serializeAws_ec2DescribeBundleTasksRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.BundleIds !== undefined) { + if (input.BundleIds !== undefined && input.BundleIds !== null) { const memberEntries = serializeAws_ec2BundleIdStringList(input.BundleIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BundleId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34124,13 +34193,13 @@ const serializeAws_ec2DescribeBundleTasksRequest = ( const serializeAws_ec2DescribeByoipCidrsRequest = (input: DescribeByoipCidrsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -34141,27 +34210,27 @@ const serializeAws_ec2DescribeCapacityReservationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CapacityReservationIds !== undefined) { + if (input.CapacityReservationIds !== undefined && input.CapacityReservationIds !== null) { const memberEntries = serializeAws_ec2CapacityReservationIdSet(input.CapacityReservationIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CapacityReservationId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34172,27 +34241,27 @@ const serializeAws_ec2DescribeCarrierGatewaysRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CarrierGatewayIds !== undefined) { + if (input.CarrierGatewayIds !== undefined && input.CarrierGatewayIds !== null) { const memberEntries = serializeAws_ec2CarrierGatewayIdSet(input.CarrierGatewayIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CarrierGatewayId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34203,27 +34272,27 @@ const serializeAws_ec2DescribeClassicLinkInstancesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -34234,23 +34303,23 @@ const serializeAws_ec2DescribeClientVpnAuthorizationRulesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -34261,23 +34330,23 @@ const serializeAws_ec2DescribeClientVpnConnectionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34288,27 +34357,27 @@ const serializeAws_ec2DescribeClientVpnEndpointsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointIds !== undefined) { + if (input.ClientVpnEndpointIds !== undefined && input.ClientVpnEndpointIds !== null) { const memberEntries = serializeAws_ec2ClientVpnEndpointIdList(input.ClientVpnEndpointIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClientVpnEndpointId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34319,23 +34388,23 @@ const serializeAws_ec2DescribeClientVpnRoutesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34346,30 +34415,30 @@ const serializeAws_ec2DescribeClientVpnTargetNetworksRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.AssociationIds !== undefined) { + if (input.AssociationIds !== undefined && input.AssociationIds !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.AssociationIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AssociationIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34377,27 +34446,27 @@ const serializeAws_ec2DescribeClientVpnTargetNetworksRequest = ( const serializeAws_ec2DescribeCoipPoolsRequest = (input: DescribeCoipPoolsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PoolIds !== undefined) { + if (input.PoolIds !== undefined && input.PoolIds !== null) { const memberEntries = serializeAws_ec2CoipPoolIdSet(input.PoolIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PoolId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34408,14 +34477,14 @@ const serializeAws_ec2DescribeConversionTasksRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConversionTaskIds !== undefined) { + if (input.ConversionTaskIds !== undefined && input.ConversionTaskIds !== null) { const memberEntries = serializeAws_ec2ConversionIdStringList(input.ConversionTaskIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConversionTaskId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34426,21 +34495,21 @@ const serializeAws_ec2DescribeCustomerGatewaysRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CustomerGatewayIds !== undefined) { + if (input.CustomerGatewayIds !== undefined && input.CustomerGatewayIds !== null) { const memberEntries = serializeAws_ec2CustomerGatewayIdStringList(input.CustomerGatewayIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CustomerGatewayId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34451,27 +34520,27 @@ const serializeAws_ec2DescribeDhcpOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DhcpOptionsIds !== undefined) { + if (input.DhcpOptionsIds !== undefined && input.DhcpOptionsIds !== null) { const memberEntries = serializeAws_ec2DhcpOptionsIdStringList(input.DhcpOptionsIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DhcpOptionsId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -34482,23 +34551,23 @@ const serializeAws_ec2DescribeEgressOnlyInternetGatewaysRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.EgressOnlyInternetGatewayIds !== undefined) { + if (input.EgressOnlyInternetGatewayIds !== undefined && input.EgressOnlyInternetGatewayIds !== null) { const memberEntries = serializeAws_ec2EgressOnlyInternetGatewayIdList(input.EgressOnlyInternetGatewayIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EgressOnlyInternetGatewayId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; @@ -34513,27 +34582,27 @@ const serializeAws_ec2DescribeElasticGpusRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ElasticGpuIds !== undefined) { + if (input.ElasticGpuIds !== undefined && input.ElasticGpuIds !== null) { const memberEntries = serializeAws_ec2ElasticGpuIdSet(input.ElasticGpuIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ElasticGpuId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -34544,27 +34613,27 @@ const serializeAws_ec2DescribeExportImageTasksRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ExportImageTaskIds !== undefined) { + if (input.ExportImageTaskIds !== undefined && input.ExportImageTaskIds !== null) { const memberEntries = serializeAws_ec2ExportImageTaskIdList(input.ExportImageTaskIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExportImageTaskId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -34575,14 +34644,14 @@ const serializeAws_ec2DescribeExportTasksRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ExportTaskIds !== undefined) { + if (input.ExportTaskIds !== undefined && input.ExportTaskIds !== null) { const memberEntries = serializeAws_ec2ExportTaskIdStringList(input.ExportTaskIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExportTaskId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; @@ -34597,20 +34666,20 @@ const serializeAws_ec2DescribeFastSnapshotRestoresRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34621,22 +34690,22 @@ const serializeAws_ec2DescribeFleetHistoryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.EventType !== undefined) { + if (input.EventType !== undefined && input.EventType !== null) { entries["EventType"] = input.EventType; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.FleetId !== undefined) { + if (input.FleetId !== undefined && input.FleetId !== null) { entries["FleetId"] = input.FleetId; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } return entries; @@ -34647,19 +34716,19 @@ const serializeAws_ec2DescribeFleetInstancesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.FleetId !== undefined) { + if (input.FleetId !== undefined && input.FleetId !== null) { entries["FleetId"] = input.FleetId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; @@ -34671,23 +34740,23 @@ const serializeAws_ec2DescribeFleetInstancesRequest = ( const serializeAws_ec2DescribeFleetsRequest = (input: DescribeFleetsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.FleetIds !== undefined) { + if (input.FleetIds !== undefined && input.FleetIds !== null) { const memberEntries = serializeAws_ec2FleetIdSet(input.FleetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FleetId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; @@ -34699,27 +34768,27 @@ const serializeAws_ec2DescribeFleetsRequest = (input: DescribeFleetsRequest, con const serializeAws_ec2DescribeFlowLogsRequest = (input: DescribeFlowLogsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filter, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.FlowLogIds !== undefined) { + if (input.FlowLogIds !== undefined && input.FlowLogIds !== null) { const memberEntries = serializeAws_ec2FlowLogIdList(input.FlowLogIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FlowLogId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -34730,13 +34799,13 @@ const serializeAws_ec2DescribeFpgaImageAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.FpgaImageId !== undefined) { + if (input.FpgaImageId !== undefined && input.FpgaImageId !== null) { entries["FpgaImageId"] = input.FpgaImageId; } - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } return entries; @@ -34744,34 +34813,34 @@ const serializeAws_ec2DescribeFpgaImageAttributeRequest = ( const serializeAws_ec2DescribeFpgaImagesRequest = (input: DescribeFpgaImagesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.FpgaImageIds !== undefined) { + if (input.FpgaImageIds !== undefined && input.FpgaImageIds !== null) { const memberEntries = serializeAws_ec2FpgaImageIdList(input.FpgaImageIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FpgaImageId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Owners !== undefined) { + if (input.Owners !== undefined && input.Owners !== null) { const memberEntries = serializeAws_ec2OwnerStringList(input.Owners, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Owner.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -34782,26 +34851,26 @@ const serializeAws_ec2DescribeHostReservationOfferingsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filter, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxDuration !== undefined) { + if (input.MaxDuration !== undefined && input.MaxDuration !== null) { entries["MaxDuration"] = input.MaxDuration; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.MinDuration !== undefined) { + if (input.MinDuration !== undefined && input.MinDuration !== null) { entries["MinDuration"] = input.MinDuration; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.OfferingId !== undefined) { + if (input.OfferingId !== undefined && input.OfferingId !== null) { entries["OfferingId"] = input.OfferingId; } return entries; @@ -34812,24 +34881,24 @@ const serializeAws_ec2DescribeHostReservationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filter, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.HostReservationIdSet !== undefined) { + if (input.HostReservationIdSet !== undefined && input.HostReservationIdSet !== null) { const memberEntries = serializeAws_ec2HostReservationIdSet(input.HostReservationIdSet, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HostReservationIdSet.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -34837,24 +34906,24 @@ const serializeAws_ec2DescribeHostReservationsRequest = ( const serializeAws_ec2DescribeHostsRequest = (input: DescribeHostsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filter, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.HostIds !== undefined) { + if (input.HostIds !== undefined && input.HostIds !== null) { const memberEntries = serializeAws_ec2RequestHostIdList(input.HostIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HostId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -34865,24 +34934,24 @@ const serializeAws_ec2DescribeIamInstanceProfileAssociationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociationIds !== undefined) { + if (input.AssociationIds !== undefined && input.AssociationIds !== null) { const memberEntries = serializeAws_ec2AssociationIdList(input.AssociationIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AssociationId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -34893,10 +34962,10 @@ const serializeAws_ec2DescribeIdentityIdFormatRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PrincipalArn !== undefined) { + if (input.PrincipalArn !== undefined && input.PrincipalArn !== null) { entries["PrincipalArn"] = input.PrincipalArn; } - if (input.Resource !== undefined) { + if (input.Resource !== undefined && input.Resource !== null) { entries["Resource"] = input.Resource; } return entries; @@ -34904,7 +34973,7 @@ const serializeAws_ec2DescribeIdentityIdFormatRequest = ( const serializeAws_ec2DescribeIdFormatRequest = (input: DescribeIdFormatRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Resource !== undefined) { + if (input.Resource !== undefined && input.Resource !== null) { entries["Resource"] = input.Resource; } return entries; @@ -34915,13 +34984,13 @@ const serializeAws_ec2DescribeImageAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34929,35 +34998,35 @@ const serializeAws_ec2DescribeImageAttributeRequest = ( const serializeAws_ec2DescribeImagesRequest = (input: DescribeImagesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ExecutableUsers !== undefined) { + if (input.ExecutableUsers !== undefined && input.ExecutableUsers !== null) { const memberEntries = serializeAws_ec2ExecutableByStringList(input.ExecutableUsers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExecutableBy.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ImageIds !== undefined) { + if (input.ImageIds !== undefined && input.ImageIds !== null) { const memberEntries = serializeAws_ec2ImageIdStringList(input.ImageIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ImageId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Owners !== undefined) { + if (input.Owners !== undefined && input.Owners !== null) { const memberEntries = serializeAws_ec2OwnerStringList(input.Owners, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Owner.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -34968,27 +35037,27 @@ const serializeAws_ec2DescribeImportImageTasksRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ImportTaskIds !== undefined) { + if (input.ImportTaskIds !== undefined && input.ImportTaskIds !== null) { const memberEntries = serializeAws_ec2ImportTaskIdList(input.ImportTaskIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ImportTaskId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -34999,27 +35068,27 @@ const serializeAws_ec2DescribeImportSnapshotTasksRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ImportTaskIds !== undefined) { + if (input.ImportTaskIds !== undefined && input.ImportTaskIds !== null) { const memberEntries = serializeAws_ec2ImportSnapshotTaskIdList(input.ImportTaskIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ImportTaskId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -35030,13 +35099,13 @@ const serializeAws_ec2DescribeInstanceAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } return entries; @@ -35047,27 +35116,27 @@ const serializeAws_ec2DescribeInstanceCreditSpecificationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -35078,7 +35147,7 @@ const serializeAws_ec2DescribeInstanceEventNotificationAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -35086,27 +35155,27 @@ const serializeAws_ec2DescribeInstanceEventNotificationAttributesRequest = ( const serializeAws_ec2DescribeInstancesRequest = (input: DescribeInstancesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -35117,30 +35186,30 @@ const serializeAws_ec2DescribeInstanceStatusRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.IncludeAllInstances !== undefined) { + if (input.IncludeAllInstances !== undefined && input.IncludeAllInstances !== null) { entries["IncludeAllInstances"] = input.IncludeAllInstances; } return entries; @@ -35151,23 +35220,23 @@ const serializeAws_ec2DescribeInstanceTypeOfferingsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.LocationType !== undefined) { + if (input.LocationType !== undefined && input.LocationType !== null) { entries["LocationType"] = input.LocationType; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -35178,27 +35247,27 @@ const serializeAws_ec2DescribeInstanceTypesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceTypes !== undefined) { + if (input.InstanceTypes !== undefined && input.InstanceTypes !== null) { const memberEntries = serializeAws_ec2RequestInstanceTypeList(input.InstanceTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceType.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -35209,27 +35278,27 @@ const serializeAws_ec2DescribeInternetGatewaysRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InternetGatewayIds !== undefined) { + if (input.InternetGatewayIds !== undefined && input.InternetGatewayIds !== null) { const memberEntries = serializeAws_ec2InternetGatewayIdList(input.InternetGatewayIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InternetGatewayId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -35237,23 +35306,23 @@ const serializeAws_ec2DescribeInternetGatewaysRequest = ( const serializeAws_ec2DescribeIpv6PoolsRequest = (input: DescribeIpv6PoolsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PoolIds !== undefined) { + if (input.PoolIds !== undefined && input.PoolIds !== null) { const memberEntries = serializeAws_ec2Ipv6PoolIdList(input.PoolIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PoolId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; @@ -35265,28 +35334,28 @@ const serializeAws_ec2DescribeIpv6PoolsRequest = (input: DescribeIpv6PoolsReques const serializeAws_ec2DescribeKeyPairsRequest = (input: DescribeKeyPairsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.KeyNames !== undefined) { + if (input.KeyNames !== undefined && input.KeyNames !== null) { const memberEntries = serializeAws_ec2KeyNameStringList(input.KeyNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `KeyName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.KeyPairIds !== undefined) { + if (input.KeyPairIds !== undefined && input.KeyPairIds !== null) { const memberEntries = serializeAws_ec2KeyPairIdStringList(input.KeyPairIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `KeyPairId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -35297,34 +35366,34 @@ const serializeAws_ec2DescribeLaunchTemplatesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.LaunchTemplateIds !== undefined) { + if (input.LaunchTemplateIds !== undefined && input.LaunchTemplateIds !== null) { const memberEntries = serializeAws_ec2LaunchTemplateIdStringList(input.LaunchTemplateIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.LaunchTemplateNames !== undefined) { + if (input.LaunchTemplateNames !== undefined && input.LaunchTemplateNames !== null) { const memberEntries = serializeAws_ec2LaunchTemplateNameStringList(input.LaunchTemplateNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -35335,35 +35404,35 @@ const serializeAws_ec2DescribeLaunchTemplateVersionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.LaunchTemplateId !== undefined) { + if (input.LaunchTemplateId !== undefined && input.LaunchTemplateId !== null) { entries["LaunchTemplateId"] = input.LaunchTemplateId; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } - if (input.Versions !== undefined) { + if (input.Versions !== undefined && input.Versions !== null) { const memberEntries = serializeAws_ec2VersionStringList(input.Versions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateVersion.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MinVersion !== undefined) { + if (input.MinVersion !== undefined && input.MinVersion !== null) { entries["MinVersion"] = input.MinVersion; } - if (input.MaxVersion !== undefined) { + if (input.MaxVersion !== undefined && input.MaxVersion !== null) { entries["MaxVersion"] = input.MaxVersion; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; @@ -35378,27 +35447,27 @@ const serializeAws_ec2DescribeLocalGatewayRouteTablesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LocalGatewayRouteTableIds !== undefined) { + if (input.LocalGatewayRouteTableIds !== undefined && input.LocalGatewayRouteTableIds !== null) { const memberEntries = serializeAws_ec2LocalGatewayRouteTableIdSet(input.LocalGatewayRouteTableIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LocalGatewayRouteTableId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -35409,7 +35478,10 @@ const serializeAws_ec2DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssocia context: __SerdeContext ): any => { const entries: any = {}; - if (input.LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds !== undefined) { + if ( + input.LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds !== undefined && + input.LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds !== null + ) { const memberEntries = serializeAws_ec2LocalGatewayRouteTableVirtualInterfaceGroupAssociationIdSet( input.LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds, context @@ -35419,20 +35491,20 @@ const serializeAws_ec2DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssocia entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -35443,7 +35515,10 @@ const serializeAws_ec2DescribeLocalGatewayRouteTableVpcAssociationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LocalGatewayRouteTableVpcAssociationIds !== undefined) { + if ( + input.LocalGatewayRouteTableVpcAssociationIds !== undefined && + input.LocalGatewayRouteTableVpcAssociationIds !== null + ) { const memberEntries = serializeAws_ec2LocalGatewayRouteTableVpcAssociationIdSet( input.LocalGatewayRouteTableVpcAssociationIds, context @@ -35453,20 +35528,20 @@ const serializeAws_ec2DescribeLocalGatewayRouteTableVpcAssociationsRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -35477,27 +35552,27 @@ const serializeAws_ec2DescribeLocalGatewaysRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LocalGatewayIds !== undefined) { + if (input.LocalGatewayIds !== undefined && input.LocalGatewayIds !== null) { const memberEntries = serializeAws_ec2LocalGatewayIdSet(input.LocalGatewayIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LocalGatewayId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -35508,7 +35583,7 @@ const serializeAws_ec2DescribeLocalGatewayVirtualInterfaceGroupsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LocalGatewayVirtualInterfaceGroupIds !== undefined) { + if (input.LocalGatewayVirtualInterfaceGroupIds !== undefined && input.LocalGatewayVirtualInterfaceGroupIds !== null) { const memberEntries = serializeAws_ec2LocalGatewayVirtualInterfaceGroupIdSet( input.LocalGatewayVirtualInterfaceGroupIds, context @@ -35518,20 +35593,20 @@ const serializeAws_ec2DescribeLocalGatewayVirtualInterfaceGroupsRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -35542,7 +35617,7 @@ const serializeAws_ec2DescribeLocalGatewayVirtualInterfacesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LocalGatewayVirtualInterfaceIds !== undefined) { + if (input.LocalGatewayVirtualInterfaceIds !== undefined && input.LocalGatewayVirtualInterfaceIds !== null) { const memberEntries = serializeAws_ec2LocalGatewayVirtualInterfaceIdSet( input.LocalGatewayVirtualInterfaceIds, context @@ -35552,20 +35627,20 @@ const serializeAws_ec2DescribeLocalGatewayVirtualInterfacesRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -35576,23 +35651,23 @@ const serializeAws_ec2DescribeManagedPrefixListsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.PrefixListIds !== undefined) { + if (input.PrefixListIds !== undefined && input.PrefixListIds !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.PrefixListIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PrefixListId.${key.substring(key.indexOf(".") + 1)}`; @@ -35607,23 +35682,23 @@ const serializeAws_ec2DescribeMovingAddressesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.PublicIps !== undefined) { + if (input.PublicIps !== undefined && input.PublicIps !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.PublicIps, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PublicIp.${key.substring(key.indexOf(".") + 1)}`; @@ -35638,27 +35713,27 @@ const serializeAws_ec2DescribeNatGatewaysRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filter, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NatGatewayIds !== undefined) { + if (input.NatGatewayIds !== undefined && input.NatGatewayIds !== null) { const memberEntries = serializeAws_ec2NatGatewayIdStringList(input.NatGatewayIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NatGatewayId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -35669,27 +35744,27 @@ const serializeAws_ec2DescribeNetworkAclsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkAclIds !== undefined) { + if (input.NetworkAclIds !== undefined && input.NetworkAclIds !== null) { const memberEntries = serializeAws_ec2NetworkAclIdStringList(input.NetworkAclIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkAclId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -35700,36 +35775,36 @@ const serializeAws_ec2DescribeNetworkInsightsAnalysesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NetworkInsightsAnalysisIds !== undefined) { + if (input.NetworkInsightsAnalysisIds !== undefined && input.NetworkInsightsAnalysisIds !== null) { const memberEntries = serializeAws_ec2NetworkInsightsAnalysisIdList(input.NetworkInsightsAnalysisIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInsightsAnalysisId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NetworkInsightsPathId !== undefined) { + if (input.NetworkInsightsPathId !== undefined && input.NetworkInsightsPathId !== null) { entries["NetworkInsightsPathId"] = input.NetworkInsightsPathId; } - if (input.AnalysisStartTime !== undefined) { + if (input.AnalysisStartTime !== undefined && input.AnalysisStartTime !== null) { entries["AnalysisStartTime"] = input.AnalysisStartTime.toISOString().split(".")[0] + "Z"; } - if (input.AnalysisEndTime !== undefined) { + if (input.AnalysisEndTime !== undefined && input.AnalysisEndTime !== null) { entries["AnalysisEndTime"] = input.AnalysisEndTime.toISOString().split(".")[0] + "Z"; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -35740,27 +35815,27 @@ const serializeAws_ec2DescribeNetworkInsightsPathsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NetworkInsightsPathIds !== undefined) { + if (input.NetworkInsightsPathIds !== undefined && input.NetworkInsightsPathIds !== null) { const memberEntries = serializeAws_ec2NetworkInsightsPathIdList(input.NetworkInsightsPathIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInsightsPathId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -35771,13 +35846,13 @@ const serializeAws_ec2DescribeNetworkInterfaceAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } return entries; @@ -35788,7 +35863,7 @@ const serializeAws_ec2DescribeNetworkInterfacePermissionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NetworkInterfacePermissionIds !== undefined) { + if (input.NetworkInterfacePermissionIds !== undefined && input.NetworkInterfacePermissionIds !== null) { const memberEntries = serializeAws_ec2NetworkInterfacePermissionIdList( input.NetworkInterfacePermissionIds, context @@ -35798,17 +35873,17 @@ const serializeAws_ec2DescribeNetworkInterfacePermissionsRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -35819,27 +35894,27 @@ const serializeAws_ec2DescribeNetworkInterfacesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkInterfaceIds !== undefined) { + if (input.NetworkInterfaceIds !== undefined && input.NetworkInterfaceIds !== null) { const memberEntries = serializeAws_ec2NetworkInterfaceIdList(input.NetworkInterfaceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInterfaceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -35850,24 +35925,24 @@ const serializeAws_ec2DescribePlacementGroupsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.GroupNames !== undefined) { + if (input.GroupNames !== undefined && input.GroupNames !== null) { const memberEntries = serializeAws_ec2PlacementGroupStringList(input.GroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GroupName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.GroupIds !== undefined) { + if (input.GroupIds !== undefined && input.GroupIds !== null) { const memberEntries = serializeAws_ec2PlacementGroupIdStringList(input.GroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GroupId.${key.substring(key.indexOf(".") + 1)}`; @@ -35882,23 +35957,23 @@ const serializeAws_ec2DescribePrefixListsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.PrefixListIds !== undefined) { + if (input.PrefixListIds !== undefined && input.PrefixListIds !== null) { const memberEntries = serializeAws_ec2PrefixListResourceIdStringList(input.PrefixListIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PrefixListId.${key.substring(key.indexOf(".") + 1)}`; @@ -35913,20 +35988,20 @@ const serializeAws_ec2DescribePrincipalIdFormatRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Resources !== undefined) { + if (input.Resources !== undefined && input.Resources !== null) { const memberEntries = serializeAws_ec2ResourceList(input.Resources, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Resource.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -35937,20 +36012,20 @@ const serializeAws_ec2DescribePublicIpv4PoolsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PoolIds !== undefined) { + if (input.PoolIds !== undefined && input.PoolIds !== null) { const memberEntries = serializeAws_ec2PublicIpv4PoolIdStringList(input.PoolIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PoolId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; @@ -35962,24 +36037,24 @@ const serializeAws_ec2DescribePublicIpv4PoolsRequest = ( const serializeAws_ec2DescribeRegionsRequest = (input: DescribeRegionsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RegionNames !== undefined) { + if (input.RegionNames !== undefined && input.RegionNames !== null) { const memberEntries = serializeAws_ec2RegionNameStringList(input.RegionNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RegionName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.AllRegions !== undefined) { + if (input.AllRegions !== undefined && input.AllRegions !== null) { entries["AllRegions"] = input.AllRegions; } return entries; @@ -35990,17 +36065,17 @@ const serializeAws_ec2DescribeReservedInstancesListingsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ReservedInstancesId !== undefined) { + if (input.ReservedInstancesId !== undefined && input.ReservedInstancesId !== null) { entries["ReservedInstancesId"] = input.ReservedInstancesId; } - if (input.ReservedInstancesListingId !== undefined) { + if (input.ReservedInstancesListingId !== undefined && input.ReservedInstancesListingId !== null) { entries["ReservedInstancesListingId"] = input.ReservedInstancesListingId; } return entries; @@ -36011,14 +36086,14 @@ const serializeAws_ec2DescribeReservedInstancesModificationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ReservedInstancesModificationIds !== undefined) { + if (input.ReservedInstancesModificationIds !== undefined && input.ReservedInstancesModificationIds !== null) { const memberEntries = serializeAws_ec2ReservedInstancesModificationIdStringList( input.ReservedInstancesModificationIds, context @@ -36028,7 +36103,7 @@ const serializeAws_ec2DescribeReservedInstancesModificationsRequest = ( entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -36039,38 +36114,38 @@ const serializeAws_ec2DescribeReservedInstancesOfferingsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.IncludeMarketplace !== undefined) { + if (input.IncludeMarketplace !== undefined && input.IncludeMarketplace !== null) { entries["IncludeMarketplace"] = input.IncludeMarketplace; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.MaxDuration !== undefined) { + if (input.MaxDuration !== undefined && input.MaxDuration !== null) { entries["MaxDuration"] = input.MaxDuration; } - if (input.MaxInstanceCount !== undefined) { + if (input.MaxInstanceCount !== undefined && input.MaxInstanceCount !== null) { entries["MaxInstanceCount"] = input.MaxInstanceCount; } - if (input.MinDuration !== undefined) { + if (input.MinDuration !== undefined && input.MinDuration !== null) { entries["MinDuration"] = input.MinDuration; } - if (input.OfferingClass !== undefined) { + if (input.OfferingClass !== undefined && input.OfferingClass !== null) { entries["OfferingClass"] = input.OfferingClass; } - if (input.ProductDescription !== undefined) { + if (input.ProductDescription !== undefined && input.ProductDescription !== null) { entries["ProductDescription"] = input.ProductDescription; } - if (input.ReservedInstancesOfferingIds !== undefined) { + if (input.ReservedInstancesOfferingIds !== undefined && input.ReservedInstancesOfferingIds !== null) { const memberEntries = serializeAws_ec2ReservedInstancesOfferingIdStringList( input.ReservedInstancesOfferingIds, context @@ -36080,19 +36155,19 @@ const serializeAws_ec2DescribeReservedInstancesOfferingsRequest = ( entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceTenancy !== undefined) { + if (input.InstanceTenancy !== undefined && input.InstanceTenancy !== null) { entries["InstanceTenancy"] = input.InstanceTenancy; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.OfferingType !== undefined) { + if (input.OfferingType !== undefined && input.OfferingType !== null) { entries["OfferingType"] = input.OfferingType; } return entries; @@ -36103,27 +36178,27 @@ const serializeAws_ec2DescribeReservedInstancesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.OfferingClass !== undefined) { + if (input.OfferingClass !== undefined && input.OfferingClass !== null) { entries["OfferingClass"] = input.OfferingClass; } - if (input.ReservedInstancesIds !== undefined) { + if (input.ReservedInstancesIds !== undefined && input.ReservedInstancesIds !== null) { const memberEntries = serializeAws_ec2ReservedInstancesIdStringList(input.ReservedInstancesIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReservedInstancesId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.OfferingType !== undefined) { + if (input.OfferingType !== undefined && input.OfferingType !== null) { entries["OfferingType"] = input.OfferingType; } return entries; @@ -36134,27 +36209,27 @@ const serializeAws_ec2DescribeRouteTablesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.RouteTableIds !== undefined) { + if (input.RouteTableIds !== undefined && input.RouteTableIds !== null) { const memberEntries = serializeAws_ec2RouteTableIdStringList(input.RouteTableIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RouteTableId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -36165,36 +36240,36 @@ const serializeAws_ec2DescribeScheduledInstanceAvailabilityRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.FirstSlotStartTimeRange !== undefined) { + if (input.FirstSlotStartTimeRange !== undefined && input.FirstSlotStartTimeRange !== null) { const memberEntries = serializeAws_ec2SlotDateTimeRangeRequest(input.FirstSlotStartTimeRange, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FirstSlotStartTimeRange.${key}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.MaxSlotDurationInHours !== undefined) { + if (input.MaxSlotDurationInHours !== undefined && input.MaxSlotDurationInHours !== null) { entries["MaxSlotDurationInHours"] = input.MaxSlotDurationInHours; } - if (input.MinSlotDurationInHours !== undefined) { + if (input.MinSlotDurationInHours !== undefined && input.MinSlotDurationInHours !== null) { entries["MinSlotDurationInHours"] = input.MinSlotDurationInHours; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.Recurrence !== undefined) { + if (input.Recurrence !== undefined && input.Recurrence !== null) { const memberEntries = serializeAws_ec2ScheduledInstanceRecurrenceRequest(input.Recurrence, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Recurrence.${key}`; @@ -36209,30 +36284,30 @@ const serializeAws_ec2DescribeScheduledInstancesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.ScheduledInstanceIds !== undefined) { + if (input.ScheduledInstanceIds !== undefined && input.ScheduledInstanceIds !== null) { const memberEntries = serializeAws_ec2ScheduledInstanceIdRequestSet(input.ScheduledInstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScheduledInstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SlotStartTimeRange !== undefined) { + if (input.SlotStartTimeRange !== undefined && input.SlotStartTimeRange !== null) { const memberEntries = serializeAws_ec2SlotStartTimeRangeRequest(input.SlotStartTimeRange, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SlotStartTimeRange.${key}`; @@ -36247,10 +36322,10 @@ const serializeAws_ec2DescribeSecurityGroupReferencesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { const memberEntries = serializeAws_ec2GroupIds(input.GroupId, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GroupId.${key.substring(key.indexOf(".") + 1)}`; @@ -36265,34 +36340,34 @@ const serializeAws_ec2DescribeSecurityGroupsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.GroupIds !== undefined) { + if (input.GroupIds !== undefined && input.GroupIds !== null) { const memberEntries = serializeAws_ec2GroupIdStringList(input.GroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.GroupNames !== undefined) { + if (input.GroupNames !== undefined && input.GroupNames !== null) { const memberEntries = serializeAws_ec2GroupNameStringList(input.GroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GroupName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -36303,13 +36378,13 @@ const serializeAws_ec2DescribeSnapshotAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36317,41 +36392,41 @@ const serializeAws_ec2DescribeSnapshotAttributeRequest = ( const serializeAws_ec2DescribeSnapshotsRequest = (input: DescribeSnapshotsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.OwnerIds !== undefined) { + if (input.OwnerIds !== undefined && input.OwnerIds !== null) { const memberEntries = serializeAws_ec2OwnerStringList(input.OwnerIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Owner.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RestorableByUserIds !== undefined) { + if (input.RestorableByUserIds !== undefined && input.RestorableByUserIds !== null) { const memberEntries = serializeAws_ec2RestorableByStringList(input.RestorableByUserIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RestorableBy.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SnapshotIds !== undefined) { + if (input.SnapshotIds !== undefined && input.SnapshotIds !== null) { const memberEntries = serializeAws_ec2SnapshotIdStringList(input.SnapshotIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SnapshotId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36362,7 +36437,7 @@ const serializeAws_ec2DescribeSpotDatafeedSubscriptionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36373,16 +36448,16 @@ const serializeAws_ec2DescribeSpotFleetInstancesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.SpotFleetRequestId !== undefined) { + if (input.SpotFleetRequestId !== undefined && input.SpotFleetRequestId !== null) { entries["SpotFleetRequestId"] = input.SpotFleetRequestId; } return entries; @@ -36393,22 +36468,22 @@ const serializeAws_ec2DescribeSpotFleetRequestHistoryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.EventType !== undefined) { + if (input.EventType !== undefined && input.EventType !== null) { entries["EventType"] = input.EventType; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.SpotFleetRequestId !== undefined) { + if (input.SpotFleetRequestId !== undefined && input.SpotFleetRequestId !== null) { entries["SpotFleetRequestId"] = input.SpotFleetRequestId; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } return entries; @@ -36419,16 +36494,16 @@ const serializeAws_ec2DescribeSpotFleetRequestsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.SpotFleetRequestIds !== undefined) { + if (input.SpotFleetRequestIds !== undefined && input.SpotFleetRequestIds !== null) { const memberEntries = serializeAws_ec2SpotFleetRequestIdList(input.SpotFleetRequestIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SpotFleetRequestId.${key.substring(key.indexOf(".") + 1)}`; @@ -36443,27 +36518,27 @@ const serializeAws_ec2DescribeSpotInstanceRequestsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.SpotInstanceRequestIds !== undefined) { + if (input.SpotInstanceRequestIds !== undefined && input.SpotInstanceRequestIds !== null) { const memberEntries = serializeAws_ec2SpotInstanceRequestIdList(input.SpotInstanceRequestIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SpotInstanceRequestId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -36474,43 +36549,43 @@ const serializeAws_ec2DescribeSpotPriceHistoryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.InstanceTypes !== undefined) { + if (input.InstanceTypes !== undefined && input.InstanceTypes !== null) { const memberEntries = serializeAws_ec2InstanceTypeList(input.InstanceTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceType.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.ProductDescriptions !== undefined) { + if (input.ProductDescriptions !== undefined && input.ProductDescriptions !== null) { const memberEntries = serializeAws_ec2ProductDescriptionList(input.ProductDescriptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProductDescription.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } return entries; @@ -36521,16 +36596,16 @@ const serializeAws_ec2DescribeStaleSecurityGroupsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -36538,27 +36613,27 @@ const serializeAws_ec2DescribeStaleSecurityGroupsRequest = ( const serializeAws_ec2DescribeSubnetsRequest = (input: DescribeSubnetsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_ec2SubnetIdStringList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -36566,20 +36641,20 @@ const serializeAws_ec2DescribeSubnetsRequest = (input: DescribeSubnetsRequest, c const serializeAws_ec2DescribeTagsRequest = (input: DescribeTagsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -36590,27 +36665,27 @@ const serializeAws_ec2DescribeTrafficMirrorFiltersRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorFilterIds !== undefined) { + if (input.TrafficMirrorFilterIds !== undefined && input.TrafficMirrorFilterIds !== null) { const memberEntries = serializeAws_ec2TrafficMirrorFilterIdList(input.TrafficMirrorFilterIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TrafficMirrorFilterId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -36621,27 +36696,27 @@ const serializeAws_ec2DescribeTrafficMirrorSessionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorSessionIds !== undefined) { + if (input.TrafficMirrorSessionIds !== undefined && input.TrafficMirrorSessionIds !== null) { const memberEntries = serializeAws_ec2TrafficMirrorSessionIdList(input.TrafficMirrorSessionIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TrafficMirrorSessionId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -36652,27 +36727,27 @@ const serializeAws_ec2DescribeTrafficMirrorTargetsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorTargetIds !== undefined) { + if (input.TrafficMirrorTargetIds !== undefined && input.TrafficMirrorTargetIds !== null) { const memberEntries = serializeAws_ec2TrafficMirrorTargetIdList(input.TrafficMirrorTargetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TrafficMirrorTargetId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -36683,7 +36758,7 @@ const serializeAws_ec2DescribeTransitGatewayAttachmentsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentIds !== undefined) { + if (input.TransitGatewayAttachmentIds !== undefined && input.TransitGatewayAttachmentIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayAttachmentIdStringList( input.TransitGatewayAttachmentIds, context @@ -36693,20 +36768,20 @@ const serializeAws_ec2DescribeTransitGatewayAttachmentsRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36717,7 +36792,7 @@ const serializeAws_ec2DescribeTransitGatewayConnectPeersRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayConnectPeerIds !== undefined) { + if (input.TransitGatewayConnectPeerIds !== undefined && input.TransitGatewayConnectPeerIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayConnectPeerIdStringList( input.TransitGatewayConnectPeerIds, context @@ -36727,20 +36802,20 @@ const serializeAws_ec2DescribeTransitGatewayConnectPeersRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36751,7 +36826,7 @@ const serializeAws_ec2DescribeTransitGatewayConnectsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentIds !== undefined) { + if (input.TransitGatewayAttachmentIds !== undefined && input.TransitGatewayAttachmentIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayAttachmentIdStringList( input.TransitGatewayAttachmentIds, context @@ -36761,20 +36836,20 @@ const serializeAws_ec2DescribeTransitGatewayConnectsRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36785,7 +36860,7 @@ const serializeAws_ec2DescribeTransitGatewayMulticastDomainsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainIds !== undefined) { + if (input.TransitGatewayMulticastDomainIds !== undefined && input.TransitGatewayMulticastDomainIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayMulticastDomainIdStringList( input.TransitGatewayMulticastDomainIds, context @@ -36795,20 +36870,20 @@ const serializeAws_ec2DescribeTransitGatewayMulticastDomainsRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36819,7 +36894,7 @@ const serializeAws_ec2DescribeTransitGatewayPeeringAttachmentsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentIds !== undefined) { + if (input.TransitGatewayAttachmentIds !== undefined && input.TransitGatewayAttachmentIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayAttachmentIdStringList( input.TransitGatewayAttachmentIds, context @@ -36829,20 +36904,20 @@ const serializeAws_ec2DescribeTransitGatewayPeeringAttachmentsRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36853,7 +36928,7 @@ const serializeAws_ec2DescribeTransitGatewayRouteTablesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableIds !== undefined) { + if (input.TransitGatewayRouteTableIds !== undefined && input.TransitGatewayRouteTableIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayRouteTableIdStringList( input.TransitGatewayRouteTableIds, context @@ -36863,20 +36938,20 @@ const serializeAws_ec2DescribeTransitGatewayRouteTablesRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36887,27 +36962,27 @@ const serializeAws_ec2DescribeTransitGatewaysRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayIds !== undefined) { + if (input.TransitGatewayIds !== undefined && input.TransitGatewayIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayIdStringList(input.TransitGatewayIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TransitGatewayIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36918,7 +36993,7 @@ const serializeAws_ec2DescribeTransitGatewayVpcAttachmentsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentIds !== undefined) { + if (input.TransitGatewayAttachmentIds !== undefined && input.TransitGatewayAttachmentIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayAttachmentIdStringList( input.TransitGatewayAttachmentIds, context @@ -36928,20 +37003,20 @@ const serializeAws_ec2DescribeTransitGatewayVpcAttachmentsRequest = ( entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36952,13 +37027,13 @@ const serializeAws_ec2DescribeVolumeAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.VolumeId !== undefined) { + if (input.VolumeId !== undefined && input.VolumeId !== null) { entries["VolumeId"] = input.VolumeId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -36969,27 +37044,27 @@ const serializeAws_ec2DescribeVolumesModificationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VolumeIds !== undefined) { + if (input.VolumeIds !== undefined && input.VolumeIds !== null) { const memberEntries = serializeAws_ec2VolumeIdStringList(input.VolumeIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VolumeId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -36997,27 +37072,27 @@ const serializeAws_ec2DescribeVolumesModificationsRequest = ( const serializeAws_ec2DescribeVolumesRequest = (input: DescribeVolumesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.VolumeIds !== undefined) { + if (input.VolumeIds !== undefined && input.VolumeIds !== null) { const memberEntries = serializeAws_ec2VolumeIdStringList(input.VolumeIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VolumeId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -37028,27 +37103,27 @@ const serializeAws_ec2DescribeVolumeStatusRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.VolumeIds !== undefined) { + if (input.VolumeIds !== undefined && input.VolumeIds !== null) { const memberEntries = serializeAws_ec2VolumeIdStringList(input.VolumeIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VolumeId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37059,13 +37134,13 @@ const serializeAws_ec2DescribeVpcAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37076,13 +37151,13 @@ const serializeAws_ec2DescribeVpcClassicLinkDnsSupportRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.VpcIds !== undefined) { + if (input.VpcIds !== undefined && input.VpcIds !== null) { const memberEntries = serializeAws_ec2VpcClassicLinkIdList(input.VpcIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcIds.${key.substring(key.indexOf(".") + 1)}`; @@ -37097,17 +37172,17 @@ const serializeAws_ec2DescribeVpcClassicLinkRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcIds !== undefined) { + if (input.VpcIds !== undefined && input.VpcIds !== null) { const memberEntries = serializeAws_ec2VpcClassicLinkIdList(input.VpcIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcId.${key.substring(key.indexOf(".") + 1)}`; @@ -37122,23 +37197,23 @@ const serializeAws_ec2DescribeVpcEndpointConnectionNotificationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ConnectionNotificationId !== undefined) { + if (input.ConnectionNotificationId !== undefined && input.ConnectionNotificationId !== null) { entries["ConnectionNotificationId"] = input.ConnectionNotificationId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -37149,20 +37224,20 @@ const serializeAws_ec2DescribeVpcEndpointConnectionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -37173,27 +37248,27 @@ const serializeAws_ec2DescribeVpcEndpointServiceConfigurationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceIds !== undefined) { + if (input.ServiceIds !== undefined && input.ServiceIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointServiceIdList(input.ServiceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ServiceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -37204,23 +37279,23 @@ const serializeAws_ec2DescribeVpcEndpointServicePermissionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceId !== undefined) { + if (input.ServiceId !== undefined && input.ServiceId !== null) { entries["ServiceId"] = input.ServiceId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -37231,27 +37306,27 @@ const serializeAws_ec2DescribeVpcEndpointServicesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceNames !== undefined) { + if (input.ServiceNames !== undefined && input.ServiceNames !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.ServiceNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ServiceName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -37262,27 +37337,27 @@ const serializeAws_ec2DescribeVpcEndpointsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcEndpointIds !== undefined) { + if (input.VpcEndpointIds !== undefined && input.VpcEndpointIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointIdList(input.VpcEndpointIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcEndpointId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -37293,27 +37368,27 @@ const serializeAws_ec2DescribeVpcPeeringConnectionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcPeeringConnectionIds !== undefined) { + if (input.VpcPeeringConnectionIds !== undefined && input.VpcPeeringConnectionIds !== null) { const memberEntries = serializeAws_ec2VpcPeeringConnectionIdList(input.VpcPeeringConnectionIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcPeeringConnectionId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -37321,27 +37396,27 @@ const serializeAws_ec2DescribeVpcPeeringConnectionsRequest = ( const serializeAws_ec2DescribeVpcsRequest = (input: DescribeVpcsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.VpcIds !== undefined) { + if (input.VpcIds !== undefined && input.VpcIds !== null) { const memberEntries = serializeAws_ec2VpcIdStringList(input.VpcIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -37352,21 +37427,21 @@ const serializeAws_ec2DescribeVpnConnectionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.VpnConnectionIds !== undefined) { + if (input.VpnConnectionIds !== undefined && input.VpnConnectionIds !== null) { const memberEntries = serializeAws_ec2VpnConnectionIdStringList(input.VpnConnectionIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpnConnectionId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37377,21 +37452,21 @@ const serializeAws_ec2DescribeVpnGatewaysRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.VpnGatewayIds !== undefined) { + if (input.VpnGatewayIds !== undefined && input.VpnGatewayIds !== null) { const memberEntries = serializeAws_ec2VpnGatewayIdStringList(input.VpnGatewayIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpnGatewayId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37402,13 +37477,13 @@ const serializeAws_ec2DetachClassicLinkVpcRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -37419,13 +37494,13 @@ const serializeAws_ec2DetachInternetGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InternetGatewayId !== undefined) { + if (input.InternetGatewayId !== undefined && input.InternetGatewayId !== null) { entries["InternetGatewayId"] = input.InternetGatewayId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -37436,13 +37511,13 @@ const serializeAws_ec2DetachNetworkInterfaceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AttachmentId !== undefined) { + if (input.AttachmentId !== undefined && input.AttachmentId !== null) { entries["AttachmentId"] = input.AttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Force !== undefined) { + if (input.Force !== undefined && input.Force !== null) { entries["Force"] = input.Force; } return entries; @@ -37450,19 +37525,19 @@ const serializeAws_ec2DetachNetworkInterfaceRequest = ( const serializeAws_ec2DetachVolumeRequest = (input: DetachVolumeRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Device !== undefined) { + if (input.Device !== undefined && input.Device !== null) { entries["Device"] = input.Device; } - if (input.Force !== undefined) { + if (input.Force !== undefined && input.Force !== null) { entries["Force"] = input.Force; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.VolumeId !== undefined) { + if (input.VolumeId !== undefined && input.VolumeId !== null) { entries["VolumeId"] = input.VolumeId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37470,13 +37545,13 @@ const serializeAws_ec2DetachVolumeRequest = (input: DetachVolumeRequest, context const serializeAws_ec2DetachVpnGatewayRequest = (input: DetachVpnGatewayRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.VpnGatewayId !== undefined) { + if (input.VpnGatewayId !== undefined && input.VpnGatewayId !== null) { entries["VpnGatewayId"] = input.VpnGatewayId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37486,6 +37561,9 @@ const serializeAws_ec2DhcpOptionsIdStringList = (input: string[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`DhcpOptionsId.${counter}`] = entry; counter++; } @@ -37497,7 +37575,7 @@ const serializeAws_ec2DirectoryServiceAuthenticationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DirectoryId !== undefined) { + if (input.DirectoryId !== undefined && input.DirectoryId !== null) { entries["DirectoryId"] = input.DirectoryId; } return entries; @@ -37508,7 +37586,7 @@ const serializeAws_ec2DisableEbsEncryptionByDefaultRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37519,21 +37597,21 @@ const serializeAws_ec2DisableFastSnapshotRestoresRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_ec2AvailabilityZoneStringList(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZone.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SourceSnapshotIds !== undefined) { + if (input.SourceSnapshotIds !== undefined && input.SourceSnapshotIds !== null) { const memberEntries = serializeAws_ec2SnapshotIdStringList(input.SourceSnapshotIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceSnapshotId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37544,13 +37622,13 @@ const serializeAws_ec2DisableTransitGatewayRouteTablePropagationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37561,13 +37639,13 @@ const serializeAws_ec2DisableVgwRoutePropagationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GatewayId !== undefined) { + if (input.GatewayId !== undefined && input.GatewayId !== null) { entries["GatewayId"] = input.GatewayId; } - if (input.RouteTableId !== undefined) { + if (input.RouteTableId !== undefined && input.RouteTableId !== null) { entries["RouteTableId"] = input.RouteTableId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37578,7 +37656,7 @@ const serializeAws_ec2DisableVpcClassicLinkDnsSupportRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -37589,10 +37667,10 @@ const serializeAws_ec2DisableVpcClassicLinkRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -37603,13 +37681,13 @@ const serializeAws_ec2DisassociateAddressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociationId !== undefined) { + if (input.AssociationId !== undefined && input.AssociationId !== null) { entries["AssociationId"] = input.AssociationId; } - if (input.PublicIp !== undefined) { + if (input.PublicIp !== undefined && input.PublicIp !== null) { entries["PublicIp"] = input.PublicIp; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37620,13 +37698,13 @@ const serializeAws_ec2DisassociateClientVpnTargetNetworkRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.AssociationId !== undefined) { + if (input.AssociationId !== undefined && input.AssociationId !== null) { entries["AssociationId"] = input.AssociationId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37637,13 +37715,13 @@ const serializeAws_ec2DisassociateEnclaveCertificateIamRoleRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CertificateArn !== undefined) { + if (input.CertificateArn !== undefined && input.CertificateArn !== null) { entries["CertificateArn"] = input.CertificateArn; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37654,7 +37732,7 @@ const serializeAws_ec2DisassociateIamInstanceProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociationId !== undefined) { + if (input.AssociationId !== undefined && input.AssociationId !== null) { entries["AssociationId"] = input.AssociationId; } return entries; @@ -37665,10 +37743,10 @@ const serializeAws_ec2DisassociateRouteTableRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociationId !== undefined) { + if (input.AssociationId !== undefined && input.AssociationId !== null) { entries["AssociationId"] = input.AssociationId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37679,7 +37757,7 @@ const serializeAws_ec2DisassociateSubnetCidrBlockRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociationId !== undefined) { + if (input.AssociationId !== undefined && input.AssociationId !== null) { entries["AssociationId"] = input.AssociationId; } return entries; @@ -37690,20 +37768,20 @@ const serializeAws_ec2DisassociateTransitGatewayMulticastDomainRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_ec2TransitGatewaySubnetIdList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37714,13 +37792,13 @@ const serializeAws_ec2DisassociateTransitGatewayRouteTableRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37731,7 +37809,7 @@ const serializeAws_ec2DisassociateVpcCidrBlockRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociationId !== undefined) { + if (input.AssociationId !== undefined && input.AssociationId !== null) { entries["AssociationId"] = input.AssociationId; } return entries; @@ -37739,17 +37817,17 @@ const serializeAws_ec2DisassociateVpcCidrBlockRequest = ( const serializeAws_ec2DiskImage = (input: DiskImage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Image !== undefined) { + if (input.Image !== undefined && input.Image !== null) { const memberEntries = serializeAws_ec2DiskImageDetail(input.Image, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Image.${key}`; entries[loc] = value; }); } - if (input.Volume !== undefined) { + if (input.Volume !== undefined && input.Volume !== null) { const memberEntries = serializeAws_ec2VolumeDetail(input.Volume, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Volume.${key}`; @@ -37761,13 +37839,13 @@ const serializeAws_ec2DiskImage = (input: DiskImage, context: __SerdeContext): a const serializeAws_ec2DiskImageDetail = (input: DiskImageDetail, context: __SerdeContext): any => { const entries: any = {}; - if (input.Bytes !== undefined) { + if (input.Bytes !== undefined && input.Bytes !== null) { entries["Bytes"] = input.Bytes; } - if (input.Format !== undefined) { + if (input.Format !== undefined && input.Format !== null) { entries["Format"] = input.Format; } - if (input.ImportManifestUrl !== undefined) { + if (input.ImportManifestUrl !== undefined && input.ImportManifestUrl !== null) { entries["ImportManifestUrl"] = input.ImportManifestUrl; } return entries; @@ -37777,6 +37855,9 @@ const serializeAws_ec2DiskImageList = (input: DiskImage[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2DiskImage(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Member.${counter}.${key}`] = value; @@ -37791,14 +37872,14 @@ const serializeAws_ec2DnsServersOptionsModifyStructure = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CustomDnsServers !== undefined) { + if (input.CustomDnsServers !== undefined && input.CustomDnsServers !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.CustomDnsServers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CustomDnsServers.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -37806,28 +37887,28 @@ const serializeAws_ec2DnsServersOptionsModifyStructure = ( const serializeAws_ec2EbsBlockDevice = (input: EbsBlockDevice, context: __SerdeContext): any => { const entries: any = {}; - if (input.DeleteOnTermination !== undefined) { + if (input.DeleteOnTermination !== undefined && input.DeleteOnTermination !== null) { entries["DeleteOnTermination"] = input.DeleteOnTermination; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.VolumeSize !== undefined) { + if (input.VolumeSize !== undefined && input.VolumeSize !== null) { entries["VolumeSize"] = input.VolumeSize; } - if (input.VolumeType !== undefined) { + if (input.VolumeType !== undefined && input.VolumeType !== null) { entries["VolumeType"] = input.VolumeType; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.Throughput !== undefined) { + if (input.Throughput !== undefined && input.Throughput !== null) { entries["Throughput"] = input.Throughput; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } return entries; @@ -37838,10 +37919,10 @@ const serializeAws_ec2EbsInstanceBlockDeviceSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DeleteOnTermination !== undefined) { + if (input.DeleteOnTermination !== undefined && input.DeleteOnTermination !== null) { entries["DeleteOnTermination"] = input.DeleteOnTermination; } - if (input.VolumeId !== undefined) { + if (input.VolumeId !== undefined && input.VolumeId !== null) { entries["VolumeId"] = input.VolumeId; } return entries; @@ -37851,6 +37932,9 @@ const serializeAws_ec2EgressOnlyInternetGatewayIdList = (input: string[], contex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -37861,6 +37945,9 @@ const serializeAws_ec2ElasticGpuIdSet = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -37869,7 +37956,7 @@ const serializeAws_ec2ElasticGpuIdSet = (input: string[], context: __SerdeContex const serializeAws_ec2ElasticGpuSpecification = (input: ElasticGpuSpecification, context: __SerdeContext): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } return entries; @@ -37882,6 +37969,9 @@ const serializeAws_ec2ElasticGpuSpecificationList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ElasticGpuSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`ElasticGpuSpecification.${counter}.${key}`] = value; @@ -37895,6 +37985,9 @@ const serializeAws_ec2ElasticGpuSpecifications = (input: ElasticGpuSpecification const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ElasticGpuSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -37909,10 +38002,10 @@ const serializeAws_ec2ElasticInferenceAccelerator = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.Count !== undefined) { + if (input.Count !== undefined && input.Count !== null) { entries["Count"] = input.Count; } return entries; @@ -37925,6 +38018,9 @@ const serializeAws_ec2ElasticInferenceAccelerators = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ElasticInferenceAccelerator(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -37939,7 +38035,7 @@ const serializeAws_ec2EnableEbsEncryptionByDefaultRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37950,21 +38046,21 @@ const serializeAws_ec2EnableFastSnapshotRestoresRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_ec2AvailabilityZoneStringList(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZone.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SourceSnapshotIds !== undefined) { + if (input.SourceSnapshotIds !== undefined && input.SourceSnapshotIds !== null) { const memberEntries = serializeAws_ec2SnapshotIdStringList(input.SourceSnapshotIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceSnapshotId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37975,13 +38071,13 @@ const serializeAws_ec2EnableTransitGatewayRouteTablePropagationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -37992,13 +38088,13 @@ const serializeAws_ec2EnableVgwRoutePropagationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GatewayId !== undefined) { + if (input.GatewayId !== undefined && input.GatewayId !== null) { entries["GatewayId"] = input.GatewayId; } - if (input.RouteTableId !== undefined) { + if (input.RouteTableId !== undefined && input.RouteTableId !== null) { entries["RouteTableId"] = input.RouteTableId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38006,10 +38102,10 @@ const serializeAws_ec2EnableVgwRoutePropagationRequest = ( const serializeAws_ec2EnableVolumeIORequest = (input: EnableVolumeIORequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VolumeId !== undefined) { + if (input.VolumeId !== undefined && input.VolumeId !== null) { entries["VolumeId"] = input.VolumeId; } return entries; @@ -38020,7 +38116,7 @@ const serializeAws_ec2EnableVpcClassicLinkDnsSupportRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -38031,10 +38127,10 @@ const serializeAws_ec2EnableVpcClassicLinkRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -38042,7 +38138,7 @@ const serializeAws_ec2EnableVpcClassicLinkRequest = ( const serializeAws_ec2EnclaveOptionsRequest = (input: EnclaveOptionsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -38052,6 +38148,9 @@ const serializeAws_ec2ExecutableByStringList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ExecutableBy.${counter}`] = entry; counter++; } @@ -38063,10 +38162,10 @@ const serializeAws_ec2ExportClientVpnClientCertificateRevocationListRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38077,10 +38176,10 @@ const serializeAws_ec2ExportClientVpnClientConfigurationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38091,32 +38190,32 @@ const serializeAws_ec2ExportImageRequest = (input: ExportImageRequest, context: if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DiskImageFormat !== undefined) { + if (input.DiskImageFormat !== undefined && input.DiskImageFormat !== null) { entries["DiskImageFormat"] = input.DiskImageFormat; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.S3ExportLocation !== undefined) { + if (input.S3ExportLocation !== undefined && input.S3ExportLocation !== null) { const memberEntries = serializeAws_ec2ExportTaskS3LocationRequest(input.S3ExportLocation, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `S3ExportLocation.${key}`; entries[loc] = value; }); } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -38130,6 +38229,9 @@ const serializeAws_ec2ExportImageTaskIdList = (input: string[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ExportImageTaskId.${counter}`] = entry; counter++; } @@ -38140,6 +38242,9 @@ const serializeAws_ec2ExportTaskIdStringList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ExportTaskId.${counter}`] = entry; counter++; } @@ -38151,10 +38256,10 @@ const serializeAws_ec2ExportTaskS3LocationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.S3Bucket !== undefined) { + if (input.S3Bucket !== undefined && input.S3Bucket !== null) { entries["S3Bucket"] = input.S3Bucket; } - if (input.S3Prefix !== undefined) { + if (input.S3Prefix !== undefined && input.S3Prefix !== null) { entries["S3Prefix"] = input.S3Prefix; } return entries; @@ -38165,16 +38270,16 @@ const serializeAws_ec2ExportToS3TaskSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ContainerFormat !== undefined) { + if (input.ContainerFormat !== undefined && input.ContainerFormat !== null) { entries["ContainerFormat"] = input.ContainerFormat; } - if (input.DiskImageFormat !== undefined) { + if (input.DiskImageFormat !== undefined && input.DiskImageFormat !== null) { entries["DiskImageFormat"] = input.DiskImageFormat; } - if (input.S3Bucket !== undefined) { + if (input.S3Bucket !== undefined && input.S3Bucket !== null) { entries["S3Bucket"] = input.S3Bucket; } - if (input.S3Prefix !== undefined) { + if (input.S3Prefix !== undefined && input.S3Prefix !== null) { entries["S3Prefix"] = input.S3Prefix; } return entries; @@ -38185,20 +38290,20 @@ const serializeAws_ec2ExportTransitGatewayRoutesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.S3Bucket !== undefined) { + if (input.S3Bucket !== undefined && input.S3Bucket !== null) { entries["S3Bucket"] = input.S3Bucket; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38209,10 +38314,10 @@ const serializeAws_ec2FederatedAuthenticationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SAMLProviderArn !== undefined) { + if (input.SAMLProviderArn !== undefined && input.SAMLProviderArn !== null) { entries["SAMLProviderArn"] = input.SAMLProviderArn; } - if (input.SelfServiceSAMLProviderArn !== undefined) { + if (input.SelfServiceSAMLProviderArn !== undefined && input.SelfServiceSAMLProviderArn !== null) { entries["SelfServiceSAMLProviderArn"] = input.SelfServiceSAMLProviderArn; } return entries; @@ -38220,10 +38325,10 @@ const serializeAws_ec2FederatedAuthenticationRequest = ( const serializeAws_ec2Filter = (input: Filter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Value.${key.substring(key.indexOf(".") + 1)}`; @@ -38237,6 +38342,9 @@ const serializeAws_ec2FilterList = (input: Filter[], context: __SerdeContext): a const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2Filter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Filter.${counter}.${key}`] = value; @@ -38250,6 +38358,9 @@ const serializeAws_ec2FleetIdSet = (input: string[], context: __SerdeContext): a const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -38263,6 +38374,9 @@ const serializeAws_ec2FleetLaunchTemplateConfigListRequest = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2FleetLaunchTemplateConfigRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -38277,7 +38391,7 @@ const serializeAws_ec2FleetLaunchTemplateConfigRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LaunchTemplateSpecification !== undefined) { + if (input.LaunchTemplateSpecification !== undefined && input.LaunchTemplateSpecification !== null) { const memberEntries = serializeAws_ec2FleetLaunchTemplateSpecificationRequest( input.LaunchTemplateSpecification, context @@ -38287,7 +38401,7 @@ const serializeAws_ec2FleetLaunchTemplateConfigRequest = ( entries[loc] = value; }); } - if (input.Overrides !== undefined) { + if (input.Overrides !== undefined && input.Overrides !== null) { const memberEntries = serializeAws_ec2FleetLaunchTemplateOverridesListRequest(input.Overrides, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Overrides.${key.substring(key.indexOf(".") + 1)}`; @@ -38304,6 +38418,9 @@ const serializeAws_ec2FleetLaunchTemplateOverridesListRequest = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2FleetLaunchTemplateOverridesRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -38318,25 +38435,25 @@ const serializeAws_ec2FleetLaunchTemplateOverridesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.MaxPrice !== undefined) { + if (input.MaxPrice !== undefined && input.MaxPrice !== null) { entries["MaxPrice"] = input.MaxPrice; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.WeightedCapacity !== undefined) { + if (input.WeightedCapacity !== undefined && input.WeightedCapacity !== null) { entries["WeightedCapacity"] = input.WeightedCapacity; } - if (input.Priority !== undefined) { + if (input.Priority !== undefined && input.Priority !== null) { entries["Priority"] = input.Priority; } - if (input.Placement !== undefined) { + if (input.Placement !== undefined && input.Placement !== null) { const memberEntries = serializeAws_ec2Placement(input.Placement, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Placement.${key}`; @@ -38351,13 +38468,13 @@ const serializeAws_ec2FleetLaunchTemplateSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LaunchTemplateId !== undefined) { + if (input.LaunchTemplateId !== undefined && input.LaunchTemplateId !== null) { entries["LaunchTemplateId"] = input.LaunchTemplateId; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } - if (input.Version !== undefined) { + if (input.Version !== undefined && input.Version !== null) { entries["Version"] = input.Version; } return entries; @@ -38368,13 +38485,13 @@ const serializeAws_ec2FleetLaunchTemplateSpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LaunchTemplateId !== undefined) { + if (input.LaunchTemplateId !== undefined && input.LaunchTemplateId !== null) { entries["LaunchTemplateId"] = input.LaunchTemplateId; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } - if (input.Version !== undefined) { + if (input.Version !== undefined && input.Version !== null) { entries["Version"] = input.Version; } return entries; @@ -38385,7 +38502,7 @@ const serializeAws_ec2FleetSpotCapacityRebalanceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplacementStrategy !== undefined) { + if (input.ReplacementStrategy !== undefined && input.ReplacementStrategy !== null) { entries["ReplacementStrategy"] = input.ReplacementStrategy; } return entries; @@ -38396,7 +38513,7 @@ const serializeAws_ec2FleetSpotMaintenanceStrategiesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CapacityRebalance !== undefined) { + if (input.CapacityRebalance !== undefined && input.CapacityRebalance !== null) { const memberEntries = serializeAws_ec2FleetSpotCapacityRebalanceRequest(input.CapacityRebalance, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CapacityRebalance.${key}`; @@ -38410,6 +38527,9 @@ const serializeAws_ec2FlowLogIdList = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -38420,6 +38540,9 @@ const serializeAws_ec2FlowLogResourceIds = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -38430,6 +38553,9 @@ const serializeAws_ec2FpgaImageIdList = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -38441,10 +38567,10 @@ const serializeAws_ec2GetAssociatedEnclaveCertificateIamRolesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CertificateArn !== undefined) { + if (input.CertificateArn !== undefined && input.CertificateArn !== null) { entries["CertificateArn"] = input.CertificateArn; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38455,16 +38581,16 @@ const serializeAws_ec2GetAssociatedIpv6PoolCidrsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PoolId !== undefined) { + if (input.PoolId !== undefined && input.PoolId !== null) { entries["PoolId"] = input.PoolId; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38475,16 +38601,16 @@ const serializeAws_ec2GetCapacityReservationUsageRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CapacityReservationId !== undefined) { + if (input.CapacityReservationId !== undefined && input.CapacityReservationId !== null) { entries["CapacityReservationId"] = input.CapacityReservationId; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38492,23 +38618,23 @@ const serializeAws_ec2GetCapacityReservationUsageRequest = ( const serializeAws_ec2GetCoipPoolUsageRequest = (input: GetCoipPoolUsageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PoolId !== undefined) { + if (input.PoolId !== undefined && input.PoolId !== null) { entries["PoolId"] = input.PoolId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38516,13 +38642,13 @@ const serializeAws_ec2GetCoipPoolUsageRequest = (input: GetCoipPoolUsageRequest, const serializeAws_ec2GetConsoleOutputRequest = (input: GetConsoleOutputRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Latest !== undefined) { + if (input.Latest !== undefined && input.Latest !== null) { entries["Latest"] = input.Latest; } return entries; @@ -38533,13 +38659,13 @@ const serializeAws_ec2GetConsoleScreenshotRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.WakeUp !== undefined) { + if (input.WakeUp !== undefined && input.WakeUp !== null) { entries["WakeUp"] = input.WakeUp; } return entries; @@ -38550,10 +38676,10 @@ const serializeAws_ec2GetDefaultCreditSpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceFamily !== undefined) { + if (input.InstanceFamily !== undefined && input.InstanceFamily !== null) { entries["InstanceFamily"] = input.InstanceFamily; } return entries; @@ -38564,7 +38690,7 @@ const serializeAws_ec2GetEbsDefaultKmsKeyIdRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38575,7 +38701,7 @@ const serializeAws_ec2GetEbsEncryptionByDefaultRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38586,16 +38712,16 @@ const serializeAws_ec2GetGroupsForCapacityReservationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CapacityReservationId !== undefined) { + if (input.CapacityReservationId !== undefined && input.CapacityReservationId !== null) { entries["CapacityReservationId"] = input.CapacityReservationId; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38606,14 +38732,14 @@ const serializeAws_ec2GetHostReservationPurchasePreviewRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HostIdSet !== undefined) { + if (input.HostIdSet !== undefined && input.HostIdSet !== null) { const memberEntries = serializeAws_ec2RequestHostIdSet(input.HostIdSet, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HostIdSet.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.OfferingId !== undefined) { + if (input.OfferingId !== undefined && input.OfferingId !== null) { entries["OfferingId"] = input.OfferingId; } return entries; @@ -38624,10 +38750,10 @@ const serializeAws_ec2GetLaunchTemplateDataRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } return entries; @@ -38638,16 +38764,16 @@ const serializeAws_ec2GetManagedPrefixListAssociationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PrefixListId !== undefined) { + if (input.PrefixListId !== undefined && input.PrefixListId !== null) { entries["PrefixListId"] = input.PrefixListId; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -38658,19 +38784,19 @@ const serializeAws_ec2GetManagedPrefixListEntriesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PrefixListId !== undefined) { + if (input.PrefixListId !== undefined && input.PrefixListId !== null) { entries["PrefixListId"] = input.PrefixListId; } - if (input.TargetVersion !== undefined) { + if (input.TargetVersion !== undefined && input.TargetVersion !== null) { entries["TargetVersion"] = input.TargetVersion; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -38678,10 +38804,10 @@ const serializeAws_ec2GetManagedPrefixListEntriesRequest = ( const serializeAws_ec2GetPasswordDataRequest = (input: GetPasswordDataRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38692,17 +38818,17 @@ const serializeAws_ec2GetReservedInstancesExchangeQuoteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ReservedInstanceIds !== undefined) { + if (input.ReservedInstanceIds !== undefined && input.ReservedInstanceIds !== null) { const memberEntries = serializeAws_ec2ReservedInstanceIdSet(input.ReservedInstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReservedInstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.TargetConfigurations !== undefined) { + if (input.TargetConfigurations !== undefined && input.TargetConfigurations !== null) { const memberEntries = serializeAws_ec2TargetConfigurationRequestSet(input.TargetConfigurations, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetConfiguration.${key.substring(key.indexOf(".") + 1)}`; @@ -38717,23 +38843,23 @@ const serializeAws_ec2GetTransitGatewayAttachmentPropagationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38744,23 +38870,23 @@ const serializeAws_ec2GetTransitGatewayMulticastDomainAssociationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38771,23 +38897,23 @@ const serializeAws_ec2GetTransitGatewayPrefixListReferencesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38798,23 +38924,23 @@ const serializeAws_ec2GetTransitGatewayRouteTableAssociationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38825,23 +38951,23 @@ const serializeAws_ec2GetTransitGatewayRouteTablePropagationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -38849,10 +38975,10 @@ const serializeAws_ec2GetTransitGatewayRouteTablePropagationsRequest = ( const serializeAws_ec2GroupIdentifier = (input: GroupIdentifier, context: __SerdeContext): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { entries["GroupId"] = input.GroupId; } return entries; @@ -38862,6 +38988,9 @@ const serializeAws_ec2GroupIdentifierList = (input: GroupIdentifier[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2GroupIdentifier(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -38875,6 +39004,9 @@ const serializeAws_ec2GroupIds = (input: string[], context: __SerdeContext): any const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -38885,6 +39017,9 @@ const serializeAws_ec2GroupIdStringList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`GroupId.${counter}`] = entry; counter++; } @@ -38895,6 +39030,9 @@ const serializeAws_ec2GroupNameStringList = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`GroupName.${counter}`] = entry; counter++; } @@ -38903,7 +39041,7 @@ const serializeAws_ec2GroupNameStringList = (input: string[], context: __SerdeCo const serializeAws_ec2HibernationOptionsRequest = (input: HibernationOptionsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Configured !== undefined) { + if (input.Configured !== undefined && input.Configured !== null) { entries["Configured"] = input.Configured; } return entries; @@ -38913,6 +39051,9 @@ const serializeAws_ec2HostReservationIdSet = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -38924,10 +39065,10 @@ const serializeAws_ec2IamInstanceProfileSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -38935,10 +39076,10 @@ const serializeAws_ec2IamInstanceProfileSpecification = ( const serializeAws_ec2IcmpTypeCode = (input: IcmpTypeCode, context: __SerdeContext): any => { const entries: any = {}; - if (input.Code !== undefined) { + if (input.Code !== undefined && input.Code !== null) { entries["Code"] = input.Code; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } return entries; @@ -38948,6 +39089,9 @@ const serializeAws_ec2IKEVersionsRequestList = (input: IKEVersionsRequestListVal const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2IKEVersionsRequestListValue(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -38962,7 +39106,7 @@ const serializeAws_ec2IKEVersionsRequestListValue = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -38970,22 +39114,22 @@ const serializeAws_ec2IKEVersionsRequestListValue = ( const serializeAws_ec2ImageDiskContainer = (input: ImageDiskContainer, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DeviceName !== undefined) { + if (input.DeviceName !== undefined && input.DeviceName !== null) { entries["DeviceName"] = input.DeviceName; } - if (input.Format !== undefined) { + if (input.Format !== undefined && input.Format !== null) { entries["Format"] = input.Format; } - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.Url !== undefined) { + if (input.Url !== undefined && input.Url !== null) { entries["Url"] = input.Url; } - if (input.UserBucket !== undefined) { + if (input.UserBucket !== undefined && input.UserBucket !== null) { const memberEntries = serializeAws_ec2UserBucket(input.UserBucket, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserBucket.${key}`; @@ -38999,6 +39143,9 @@ const serializeAws_ec2ImageDiskContainerList = (input: ImageDiskContainer[], con const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ImageDiskContainer(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39012,6 +39159,9 @@ const serializeAws_ec2ImageIdStringList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ImageId.${counter}`] = entry; counter++; } @@ -39023,13 +39173,13 @@ const serializeAws_ec2ImportClientVpnClientCertificateRevocationListRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.CertificateRevocationList !== undefined) { + if (input.CertificateRevocationList !== undefined && input.CertificateRevocationList !== null) { entries["CertificateRevocationList"] = input.CertificateRevocationList; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -39040,7 +39190,7 @@ const serializeAws_ec2ImportImageLicenseConfigurationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LicenseConfigurationArn !== undefined) { + if (input.LicenseConfigurationArn !== undefined && input.LicenseConfigurationArn !== null) { entries["LicenseConfigurationArn"] = input.LicenseConfigurationArn; } return entries; @@ -39053,6 +39203,9 @@ const serializeAws_ec2ImportImageLicenseSpecificationListRequest = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ImportImageLicenseConfigurationRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39064,51 +39217,51 @@ const serializeAws_ec2ImportImageLicenseSpecificationListRequest = ( const serializeAws_ec2ImportImageRequest = (input: ImportImageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Architecture !== undefined) { + if (input.Architecture !== undefined && input.Architecture !== null) { entries["Architecture"] = input.Architecture; } - if (input.ClientData !== undefined) { + if (input.ClientData !== undefined && input.ClientData !== null) { const memberEntries = serializeAws_ec2ClientData(input.ClientData, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClientData.${key}`; entries[loc] = value; }); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DiskContainers !== undefined) { + if (input.DiskContainers !== undefined && input.DiskContainers !== null) { const memberEntries = serializeAws_ec2ImageDiskContainerList(input.DiskContainers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DiskContainer.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } - if (input.Hypervisor !== undefined) { + if (input.Hypervisor !== undefined && input.Hypervisor !== null) { entries["Hypervisor"] = input.Hypervisor; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.LicenseType !== undefined) { + if (input.LicenseType !== undefined && input.LicenseType !== null) { entries["LicenseType"] = input.LicenseType; } - if (input.Platform !== undefined) { + if (input.Platform !== undefined && input.Platform !== null) { entries["Platform"] = input.Platform; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.LicenseSpecifications !== undefined) { + if (input.LicenseSpecifications !== undefined && input.LicenseSpecifications !== null) { const memberEntries = serializeAws_ec2ImportImageLicenseSpecificationListRequest( input.LicenseSpecifications, context @@ -39118,7 +39271,7 @@ const serializeAws_ec2ImportImageRequest = (input: ImportImageRequest, context: entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -39133,49 +39286,49 @@ const serializeAws_ec2ImportInstanceLaunchSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AdditionalInfo !== undefined) { + if (input.AdditionalInfo !== undefined && input.AdditionalInfo !== null) { entries["AdditionalInfo"] = input.AdditionalInfo; } - if (input.Architecture !== undefined) { + if (input.Architecture !== undefined && input.Architecture !== null) { entries["Architecture"] = input.Architecture; } - if (input.GroupIds !== undefined) { + if (input.GroupIds !== undefined && input.GroupIds !== null) { const memberEntries = serializeAws_ec2SecurityGroupIdStringList(input.GroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.GroupNames !== undefined) { + if (input.GroupNames !== undefined && input.GroupNames !== null) { const memberEntries = serializeAws_ec2SecurityGroupStringList(input.GroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GroupName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.InstanceInitiatedShutdownBehavior !== undefined) { + if (input.InstanceInitiatedShutdownBehavior !== undefined && input.InstanceInitiatedShutdownBehavior !== null) { entries["InstanceInitiatedShutdownBehavior"] = input.InstanceInitiatedShutdownBehavior; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.Monitoring !== undefined) { + if (input.Monitoring !== undefined && input.Monitoring !== null) { entries["Monitoring"] = input.Monitoring; } - if (input.Placement !== undefined) { + if (input.Placement !== undefined && input.Placement !== null) { const memberEntries = serializeAws_ec2Placement(input.Placement, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Placement.${key}`; entries[loc] = value; }); } - if (input.PrivateIpAddress !== undefined) { + if (input.PrivateIpAddress !== undefined && input.PrivateIpAddress !== null) { entries["PrivateIpAddress"] = input.PrivateIpAddress; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.UserData !== undefined) { + if (input.UserData !== undefined && input.UserData !== null) { const memberEntries = serializeAws_ec2UserData(input.UserData, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserData.${key}`; @@ -39187,27 +39340,27 @@ const serializeAws_ec2ImportInstanceLaunchSpecification = ( const serializeAws_ec2ImportInstanceRequest = (input: ImportInstanceRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DiskImages !== undefined) { + if (input.DiskImages !== undefined && input.DiskImages !== null) { const memberEntries = serializeAws_ec2DiskImageList(input.DiskImages, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DiskImage.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.LaunchSpecification !== undefined) { + if (input.LaunchSpecification !== undefined && input.LaunchSpecification !== null) { const memberEntries = serializeAws_ec2ImportInstanceLaunchSpecification(input.LaunchSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchSpecification.${key}`; entries[loc] = value; }); } - if (input.Platform !== undefined) { + if (input.Platform !== undefined && input.Platform !== null) { entries["Platform"] = input.Platform; } return entries; @@ -39215,16 +39368,16 @@ const serializeAws_ec2ImportInstanceRequest = (input: ImportInstanceRequest, con const serializeAws_ec2ImportKeyPairRequest = (input: ImportKeyPairRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.KeyName !== undefined) { + if (input.KeyName !== undefined && input.KeyName !== null) { entries["KeyName"] = input.KeyName; } - if (input.PublicKeyMaterial !== undefined) { + if (input.PublicKeyMaterial !== undefined && input.PublicKeyMaterial !== null) { entries["PublicKeyMaterial"] = context.base64Encoder(input.PublicKeyMaterial); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -39236,39 +39389,39 @@ const serializeAws_ec2ImportKeyPairRequest = (input: ImportKeyPairRequest, conte const serializeAws_ec2ImportSnapshotRequest = (input: ImportSnapshotRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClientData !== undefined) { + if (input.ClientData !== undefined && input.ClientData !== null) { const memberEntries = serializeAws_ec2ClientData(input.ClientData, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClientData.${key}`; entries[loc] = value; }); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DiskContainer !== undefined) { + if (input.DiskContainer !== undefined && input.DiskContainer !== null) { const memberEntries = serializeAws_ec2SnapshotDiskContainer(input.DiskContainer, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DiskContainer.${key}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -39282,6 +39435,9 @@ const serializeAws_ec2ImportSnapshotTaskIdList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ImportTaskId.${counter}`] = entry; counter++; } @@ -39292,6 +39448,9 @@ const serializeAws_ec2ImportTaskIdList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ImportTaskId.${counter}`] = entry; counter++; } @@ -39300,23 +39459,23 @@ const serializeAws_ec2ImportTaskIdList = (input: string[], context: __SerdeConte const serializeAws_ec2ImportVolumeRequest = (input: ImportVolumeRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Image !== undefined) { + if (input.Image !== undefined && input.Image !== null) { const memberEntries = serializeAws_ec2DiskImageDetail(input.Image, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Image.${key}`; entries[loc] = value; }); } - if (input.Volume !== undefined) { + if (input.Volume !== undefined && input.Volume !== null) { const memberEntries = serializeAws_ec2VolumeDetail(input.Volume, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Volume.${key}`; @@ -39330,6 +39489,9 @@ const serializeAws_ec2InsideCidrBlocksStringList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -39341,20 +39503,20 @@ const serializeAws_ec2InstanceBlockDeviceMappingSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DeviceName !== undefined) { + if (input.DeviceName !== undefined && input.DeviceName !== null) { entries["DeviceName"] = input.DeviceName; } - if (input.Ebs !== undefined) { + if (input.Ebs !== undefined && input.Ebs !== null) { const memberEntries = serializeAws_ec2EbsInstanceBlockDeviceSpecification(input.Ebs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ebs.${key}`; entries[loc] = value; }); } - if (input.NoDevice !== undefined) { + if (input.NoDevice !== undefined && input.NoDevice !== null) { entries["NoDevice"] = input.NoDevice; } - if (input.VirtualName !== undefined) { + if (input.VirtualName !== undefined && input.VirtualName !== null) { entries["VirtualName"] = input.VirtualName; } return entries; @@ -39367,6 +39529,9 @@ const serializeAws_ec2InstanceBlockDeviceMappingSpecificationList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2InstanceBlockDeviceMappingSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39383,6 +39548,9 @@ const serializeAws_ec2InstanceCreditSpecificationListRequest = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2InstanceCreditSpecificationRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39397,10 +39565,10 @@ const serializeAws_ec2InstanceCreditSpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.CpuCredits !== undefined) { + if (input.CpuCredits !== undefined && input.CpuCredits !== null) { entries["CpuCredits"] = input.CpuCredits; } return entries; @@ -39410,6 +39578,9 @@ const serializeAws_ec2InstanceIdStringList = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`InstanceId.${counter}`] = entry; counter++; } @@ -39418,7 +39589,7 @@ const serializeAws_ec2InstanceIdStringList = (input: string[], context: __SerdeC const serializeAws_ec2InstanceIpv6Address = (input: InstanceIpv6Address, context: __SerdeContext): any => { const entries: any = {}; - if (input.Ipv6Address !== undefined) { + if (input.Ipv6Address !== undefined && input.Ipv6Address !== null) { entries["Ipv6Address"] = input.Ipv6Address; } return entries; @@ -39428,6 +39599,9 @@ const serializeAws_ec2InstanceIpv6AddressList = (input: InstanceIpv6Address[], c const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2InstanceIpv6Address(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39444,6 +39618,9 @@ const serializeAws_ec2InstanceIpv6AddressListRequest = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2InstanceIpv6AddressRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`InstanceIpv6Address.${counter}.${key}`] = value; @@ -39458,7 +39635,7 @@ const serializeAws_ec2InstanceIpv6AddressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Ipv6Address !== undefined) { + if (input.Ipv6Address !== undefined && input.Ipv6Address !== null) { entries["Ipv6Address"] = input.Ipv6Address; } return entries; @@ -39469,10 +39646,10 @@ const serializeAws_ec2InstanceMarketOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MarketType !== undefined) { + if (input.MarketType !== undefined && input.MarketType !== null) { entries["MarketType"] = input.MarketType; } - if (input.SpotOptions !== undefined) { + if (input.SpotOptions !== undefined && input.SpotOptions !== null) { const memberEntries = serializeAws_ec2SpotMarketOptions(input.SpotOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SpotOptions.${key}`; @@ -39487,13 +39664,13 @@ const serializeAws_ec2InstanceMetadataOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HttpTokens !== undefined) { + if (input.HttpTokens !== undefined && input.HttpTokens !== null) { entries["HttpTokens"] = input.HttpTokens; } - if (input.HttpPutResponseHopLimit !== undefined) { + if (input.HttpPutResponseHopLimit !== undefined && input.HttpPutResponseHopLimit !== null) { entries["HttpPutResponseHopLimit"] = input.HttpPutResponseHopLimit; } - if (input.HttpEndpoint !== undefined) { + if (input.HttpEndpoint !== undefined && input.HttpEndpoint !== null) { entries["HttpEndpoint"] = input.HttpEndpoint; } return entries; @@ -39504,61 +39681,61 @@ const serializeAws_ec2InstanceNetworkInterfaceSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociatePublicIpAddress !== undefined) { + if (input.AssociatePublicIpAddress !== undefined && input.AssociatePublicIpAddress !== null) { entries["AssociatePublicIpAddress"] = input.AssociatePublicIpAddress; } - if (input.DeleteOnTermination !== undefined) { + if (input.DeleteOnTermination !== undefined && input.DeleteOnTermination !== null) { entries["DeleteOnTermination"] = input.DeleteOnTermination; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DeviceIndex !== undefined) { + if (input.DeviceIndex !== undefined && input.DeviceIndex !== null) { entries["DeviceIndex"] = input.DeviceIndex; } - if (input.Groups !== undefined) { + if (input.Groups !== undefined && input.Groups !== null) { const memberEntries = serializeAws_ec2SecurityGroupIdStringList(input.Groups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Ipv6AddressCount !== undefined) { + if (input.Ipv6AddressCount !== undefined && input.Ipv6AddressCount !== null) { entries["Ipv6AddressCount"] = input.Ipv6AddressCount; } - if (input.Ipv6Addresses !== undefined) { + if (input.Ipv6Addresses !== undefined && input.Ipv6Addresses !== null) { const memberEntries = serializeAws_ec2InstanceIpv6AddressList(input.Ipv6Addresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ipv6Addresses.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.PrivateIpAddress !== undefined) { + if (input.PrivateIpAddress !== undefined && input.PrivateIpAddress !== null) { entries["PrivateIpAddress"] = input.PrivateIpAddress; } - if (input.PrivateIpAddresses !== undefined) { + if (input.PrivateIpAddresses !== undefined && input.PrivateIpAddresses !== null) { const memberEntries = serializeAws_ec2PrivateIpAddressSpecificationList(input.PrivateIpAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PrivateIpAddresses.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SecondaryPrivateIpAddressCount !== undefined) { + if (input.SecondaryPrivateIpAddressCount !== undefined && input.SecondaryPrivateIpAddressCount !== null) { entries["SecondaryPrivateIpAddressCount"] = input.SecondaryPrivateIpAddressCount; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.AssociateCarrierIpAddress !== undefined) { + if (input.AssociateCarrierIpAddress !== undefined && input.AssociateCarrierIpAddress !== null) { entries["AssociateCarrierIpAddress"] = input.AssociateCarrierIpAddress; } - if (input.InterfaceType !== undefined) { + if (input.InterfaceType !== undefined && input.InterfaceType !== null) { entries["InterfaceType"] = input.InterfaceType; } - if (input.NetworkCardIndex !== undefined) { + if (input.NetworkCardIndex !== undefined && input.NetworkCardIndex !== null) { entries["NetworkCardIndex"] = input.NetworkCardIndex; } return entries; @@ -39571,6 +39748,9 @@ const serializeAws_ec2InstanceNetworkInterfaceSpecificationList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2InstanceNetworkInterfaceSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39582,10 +39762,10 @@ const serializeAws_ec2InstanceNetworkInterfaceSpecificationList = ( const serializeAws_ec2InstanceSpecification = (input: InstanceSpecification, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.ExcludeBootVolume !== undefined) { + if (input.ExcludeBootVolume !== undefined && input.ExcludeBootVolume !== null) { entries["ExcludeBootVolume"] = input.ExcludeBootVolume; } return entries; @@ -39595,6 +39775,9 @@ const serializeAws_ec2InstanceTagKeySet = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -39605,6 +39788,9 @@ const serializeAws_ec2InstanceTypeList = (input: (_InstanceType | string)[], con const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -39615,6 +39801,9 @@ const serializeAws_ec2InternetGatewayIdList = (input: string[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -39623,37 +39812,37 @@ const serializeAws_ec2InternetGatewayIdList = (input: string[], context: __Serde const serializeAws_ec2IpPermission = (input: IpPermission, context: __SerdeContext): any => { const entries: any = {}; - if (input.FromPort !== undefined) { + if (input.FromPort !== undefined && input.FromPort !== null) { entries["FromPort"] = input.FromPort; } - if (input.IpProtocol !== undefined) { + if (input.IpProtocol !== undefined && input.IpProtocol !== null) { entries["IpProtocol"] = input.IpProtocol; } - if (input.IpRanges !== undefined) { + if (input.IpRanges !== undefined && input.IpRanges !== null) { const memberEntries = serializeAws_ec2IpRangeList(input.IpRanges, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IpRanges.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Ipv6Ranges !== undefined) { + if (input.Ipv6Ranges !== undefined && input.Ipv6Ranges !== null) { const memberEntries = serializeAws_ec2Ipv6RangeList(input.Ipv6Ranges, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ipv6Ranges.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.PrefixListIds !== undefined) { + if (input.PrefixListIds !== undefined && input.PrefixListIds !== null) { const memberEntries = serializeAws_ec2PrefixListIdList(input.PrefixListIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PrefixListIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ToPort !== undefined) { + if (input.ToPort !== undefined && input.ToPort !== null) { entries["ToPort"] = input.ToPort; } - if (input.UserIdGroupPairs !== undefined) { + if (input.UserIdGroupPairs !== undefined && input.UserIdGroupPairs !== null) { const memberEntries = serializeAws_ec2UserIdGroupPairList(input.UserIdGroupPairs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Groups.${key.substring(key.indexOf(".") + 1)}`; @@ -39667,6 +39856,9 @@ const serializeAws_ec2IpPermissionList = (input: IpPermission[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2IpPermission(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39678,10 +39870,10 @@ const serializeAws_ec2IpPermissionList = (input: IpPermission[], context: __Serd const serializeAws_ec2IpRange = (input: IpRange, context: __SerdeContext): any => { const entries: any = {}; - if (input.CidrIp !== undefined) { + if (input.CidrIp !== undefined && input.CidrIp !== null) { entries["CidrIp"] = input.CidrIp; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -39691,6 +39883,9 @@ const serializeAws_ec2IpRangeList = (input: IpRange[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2IpRange(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39704,6 +39899,9 @@ const serializeAws_ec2Ipv6AddressList = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -39714,6 +39912,9 @@ const serializeAws_ec2Ipv6PoolIdList = (input: string[], context: __SerdeContext const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -39722,10 +39923,10 @@ const serializeAws_ec2Ipv6PoolIdList = (input: string[], context: __SerdeContext const serializeAws_ec2Ipv6Range = (input: Ipv6Range, context: __SerdeContext): any => { const entries: any = {}; - if (input.CidrIpv6 !== undefined) { + if (input.CidrIpv6 !== undefined && input.CidrIpv6 !== null) { entries["CidrIpv6"] = input.CidrIpv6; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -39735,6 +39936,9 @@ const serializeAws_ec2Ipv6RangeList = (input: Ipv6Range[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2Ipv6Range(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39748,6 +39952,9 @@ const serializeAws_ec2KeyNameStringList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`KeyName.${counter}`] = entry; counter++; } @@ -39758,6 +39965,9 @@ const serializeAws_ec2KeyPairIdStringList = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`KeyPairId.${counter}`] = entry; counter++; } @@ -39766,10 +39976,10 @@ const serializeAws_ec2KeyPairIdStringList = (input: string[], context: __SerdeCo const serializeAws_ec2LaunchPermission = (input: LaunchPermission, context: __SerdeContext): any => { const entries: any = {}; - if (input.Group !== undefined) { + if (input.Group !== undefined && input.Group !== null) { entries["Group"] = input.Group; } - if (input.UserId !== undefined) { + if (input.UserId !== undefined && input.UserId !== null) { entries["UserId"] = input.UserId; } return entries; @@ -39779,6 +39989,9 @@ const serializeAws_ec2LaunchPermissionList = (input: LaunchPermission[], context const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LaunchPermission(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39793,14 +40006,14 @@ const serializeAws_ec2LaunchPermissionModifications = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Add !== undefined) { + if (input.Add !== undefined && input.Add !== null) { const memberEntries = serializeAws_ec2LaunchPermissionList(input.Add, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Add.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Remove !== undefined) { + if (input.Remove !== undefined && input.Remove !== null) { const memberEntries = serializeAws_ec2LaunchPermissionList(input.Remove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Remove.${key.substring(key.indexOf(".") + 1)}`; @@ -39814,6 +40027,9 @@ const serializeAws_ec2LaunchSpecsList = (input: SpotFleetLaunchSpecification[], const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2SpotFleetLaunchSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39828,20 +40044,20 @@ const serializeAws_ec2LaunchTemplateBlockDeviceMappingRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DeviceName !== undefined) { + if (input.DeviceName !== undefined && input.DeviceName !== null) { entries["DeviceName"] = input.DeviceName; } - if (input.VirtualName !== undefined) { + if (input.VirtualName !== undefined && input.VirtualName !== null) { entries["VirtualName"] = input.VirtualName; } - if (input.Ebs !== undefined) { + if (input.Ebs !== undefined && input.Ebs !== null) { const memberEntries = serializeAws_ec2LaunchTemplateEbsBlockDeviceRequest(input.Ebs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ebs.${key}`; entries[loc] = value; }); } - if (input.NoDevice !== undefined) { + if (input.NoDevice !== undefined && input.NoDevice !== null) { entries["NoDevice"] = input.NoDevice; } return entries; @@ -39854,6 +40070,9 @@ const serializeAws_ec2LaunchTemplateBlockDeviceMappingRequestList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LaunchTemplateBlockDeviceMappingRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`BlockDeviceMapping.${counter}.${key}`] = value; @@ -39868,10 +40087,10 @@ const serializeAws_ec2LaunchTemplateCapacityReservationSpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CapacityReservationPreference !== undefined) { + if (input.CapacityReservationPreference !== undefined && input.CapacityReservationPreference !== null) { entries["CapacityReservationPreference"] = input.CapacityReservationPreference; } - if (input.CapacityReservationTarget !== undefined) { + if (input.CapacityReservationTarget !== undefined && input.CapacityReservationTarget !== null) { const memberEntries = serializeAws_ec2CapacityReservationTarget(input.CapacityReservationTarget, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CapacityReservationTarget.${key}`; @@ -39883,14 +40102,14 @@ const serializeAws_ec2LaunchTemplateCapacityReservationSpecificationRequest = ( const serializeAws_ec2LaunchTemplateConfig = (input: LaunchTemplateConfig, context: __SerdeContext): any => { const entries: any = {}; - if (input.LaunchTemplateSpecification !== undefined) { + if (input.LaunchTemplateSpecification !== undefined && input.LaunchTemplateSpecification !== null) { const memberEntries = serializeAws_ec2FleetLaunchTemplateSpecification(input.LaunchTemplateSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateSpecification.${key}`; entries[loc] = value; }); } - if (input.Overrides !== undefined) { + if (input.Overrides !== undefined && input.Overrides !== null) { const memberEntries = serializeAws_ec2LaunchTemplateOverridesList(input.Overrides, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Overrides.${key.substring(key.indexOf(".") + 1)}`; @@ -39904,6 +40123,9 @@ const serializeAws_ec2LaunchTemplateConfigList = (input: LaunchTemplateConfig[], const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LaunchTemplateConfig(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39918,10 +40140,10 @@ const serializeAws_ec2LaunchTemplateCpuOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CoreCount !== undefined) { + if (input.CoreCount !== undefined && input.CoreCount !== null) { entries["CoreCount"] = input.CoreCount; } - if (input.ThreadsPerCore !== undefined) { + if (input.ThreadsPerCore !== undefined && input.ThreadsPerCore !== null) { entries["ThreadsPerCore"] = input.ThreadsPerCore; } return entries; @@ -39932,28 +40154,28 @@ const serializeAws_ec2LaunchTemplateEbsBlockDeviceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } - if (input.DeleteOnTermination !== undefined) { + if (input.DeleteOnTermination !== undefined && input.DeleteOnTermination !== null) { entries["DeleteOnTermination"] = input.DeleteOnTermination; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.VolumeSize !== undefined) { + if (input.VolumeSize !== undefined && input.VolumeSize !== null) { entries["VolumeSize"] = input.VolumeSize; } - if (input.VolumeType !== undefined) { + if (input.VolumeType !== undefined && input.VolumeType !== null) { entries["VolumeType"] = input.VolumeType; } - if (input.Throughput !== undefined) { + if (input.Throughput !== undefined && input.Throughput !== null) { entries["Throughput"] = input.Throughput; } return entries; @@ -39964,10 +40186,10 @@ const serializeAws_ec2LaunchTemplateElasticInferenceAccelerator = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.Count !== undefined) { + if (input.Count !== undefined && input.Count !== null) { entries["Count"] = input.Count; } return entries; @@ -39980,6 +40202,9 @@ const serializeAws_ec2LaunchTemplateElasticInferenceAcceleratorList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LaunchTemplateElasticInferenceAccelerator(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -39994,7 +40219,7 @@ const serializeAws_ec2LaunchTemplateEnclaveOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -40005,7 +40230,7 @@ const serializeAws_ec2LaunchTemplateHibernationOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Configured !== undefined) { + if (input.Configured !== undefined && input.Configured !== null) { entries["Configured"] = input.Configured; } return entries; @@ -40016,10 +40241,10 @@ const serializeAws_ec2LaunchTemplateIamInstanceProfileSpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -40029,6 +40254,9 @@ const serializeAws_ec2LaunchTemplateIdStringList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -40040,10 +40268,10 @@ const serializeAws_ec2LaunchTemplateInstanceMarketOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MarketType !== undefined) { + if (input.MarketType !== undefined && input.MarketType !== null) { entries["MarketType"] = input.MarketType; } - if (input.SpotOptions !== undefined) { + if (input.SpotOptions !== undefined && input.SpotOptions !== null) { const memberEntries = serializeAws_ec2LaunchTemplateSpotMarketOptionsRequest(input.SpotOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SpotOptions.${key}`; @@ -40058,13 +40286,13 @@ const serializeAws_ec2LaunchTemplateInstanceMetadataOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HttpTokens !== undefined) { + if (input.HttpTokens !== undefined && input.HttpTokens !== null) { entries["HttpTokens"] = input.HttpTokens; } - if (input.HttpPutResponseHopLimit !== undefined) { + if (input.HttpPutResponseHopLimit !== undefined && input.HttpPutResponseHopLimit !== null) { entries["HttpPutResponseHopLimit"] = input.HttpPutResponseHopLimit; } - if (input.HttpEndpoint !== undefined) { + if (input.HttpEndpoint !== undefined && input.HttpEndpoint !== null) { entries["HttpEndpoint"] = input.HttpEndpoint; } return entries; @@ -40075,61 +40303,61 @@ const serializeAws_ec2LaunchTemplateInstanceNetworkInterfaceSpecificationRequest context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociateCarrierIpAddress !== undefined) { + if (input.AssociateCarrierIpAddress !== undefined && input.AssociateCarrierIpAddress !== null) { entries["AssociateCarrierIpAddress"] = input.AssociateCarrierIpAddress; } - if (input.AssociatePublicIpAddress !== undefined) { + if (input.AssociatePublicIpAddress !== undefined && input.AssociatePublicIpAddress !== null) { entries["AssociatePublicIpAddress"] = input.AssociatePublicIpAddress; } - if (input.DeleteOnTermination !== undefined) { + if (input.DeleteOnTermination !== undefined && input.DeleteOnTermination !== null) { entries["DeleteOnTermination"] = input.DeleteOnTermination; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DeviceIndex !== undefined) { + if (input.DeviceIndex !== undefined && input.DeviceIndex !== null) { entries["DeviceIndex"] = input.DeviceIndex; } - if (input.Groups !== undefined) { + if (input.Groups !== undefined && input.Groups !== null) { const memberEntries = serializeAws_ec2SecurityGroupIdStringList(input.Groups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.InterfaceType !== undefined) { + if (input.InterfaceType !== undefined && input.InterfaceType !== null) { entries["InterfaceType"] = input.InterfaceType; } - if (input.Ipv6AddressCount !== undefined) { + if (input.Ipv6AddressCount !== undefined && input.Ipv6AddressCount !== null) { entries["Ipv6AddressCount"] = input.Ipv6AddressCount; } - if (input.Ipv6Addresses !== undefined) { + if (input.Ipv6Addresses !== undefined && input.Ipv6Addresses !== null) { const memberEntries = serializeAws_ec2InstanceIpv6AddressListRequest(input.Ipv6Addresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ipv6Addresses.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.PrivateIpAddress !== undefined) { + if (input.PrivateIpAddress !== undefined && input.PrivateIpAddress !== null) { entries["PrivateIpAddress"] = input.PrivateIpAddress; } - if (input.PrivateIpAddresses !== undefined) { + if (input.PrivateIpAddresses !== undefined && input.PrivateIpAddresses !== null) { const memberEntries = serializeAws_ec2PrivateIpAddressSpecificationList(input.PrivateIpAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PrivateIpAddresses.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SecondaryPrivateIpAddressCount !== undefined) { + if (input.SecondaryPrivateIpAddressCount !== undefined && input.SecondaryPrivateIpAddressCount !== null) { entries["SecondaryPrivateIpAddressCount"] = input.SecondaryPrivateIpAddressCount; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.NetworkCardIndex !== undefined) { + if (input.NetworkCardIndex !== undefined && input.NetworkCardIndex !== null) { entries["NetworkCardIndex"] = input.NetworkCardIndex; } return entries; @@ -40142,6 +40370,9 @@ const serializeAws_ec2LaunchTemplateInstanceNetworkInterfaceSpecificationRequest const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LaunchTemplateInstanceNetworkInterfaceSpecificationRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`InstanceNetworkInterfaceSpecification.${counter}.${key}`] = value; @@ -40156,7 +40387,7 @@ const serializeAws_ec2LaunchTemplateLicenseConfigurationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LicenseConfigurationArn !== undefined) { + if (input.LicenseConfigurationArn !== undefined && input.LicenseConfigurationArn !== null) { entries["LicenseConfigurationArn"] = input.LicenseConfigurationArn; } return entries; @@ -40169,6 +40400,9 @@ const serializeAws_ec2LaunchTemplateLicenseSpecificationListRequest = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LaunchTemplateLicenseConfigurationRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -40182,6 +40416,9 @@ const serializeAws_ec2LaunchTemplateNameStringList = (input: string[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -40190,22 +40427,22 @@ const serializeAws_ec2LaunchTemplateNameStringList = (input: string[], context: const serializeAws_ec2LaunchTemplateOverrides = (input: LaunchTemplateOverrides, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.SpotPrice !== undefined) { + if (input.SpotPrice !== undefined && input.SpotPrice !== null) { entries["SpotPrice"] = input.SpotPrice; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.WeightedCapacity !== undefined) { + if (input.WeightedCapacity !== undefined && input.WeightedCapacity !== null) { entries["WeightedCapacity"] = input.WeightedCapacity; } - if (input.Priority !== undefined) { + if (input.Priority !== undefined && input.Priority !== null) { entries["Priority"] = input.Priority; } return entries; @@ -40218,6 +40455,9 @@ const serializeAws_ec2LaunchTemplateOverridesList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LaunchTemplateOverrides(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -40232,28 +40472,28 @@ const serializeAws_ec2LaunchTemplatePlacementRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Affinity !== undefined) { + if (input.Affinity !== undefined && input.Affinity !== null) { entries["Affinity"] = input.Affinity; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.HostId !== undefined) { + if (input.HostId !== undefined && input.HostId !== null) { entries["HostId"] = input.HostId; } - if (input.Tenancy !== undefined) { + if (input.Tenancy !== undefined && input.Tenancy !== null) { entries["Tenancy"] = input.Tenancy; } - if (input.SpreadDomain !== undefined) { + if (input.SpreadDomain !== undefined && input.SpreadDomain !== null) { entries["SpreadDomain"] = input.SpreadDomain; } - if (input.HostResourceGroupArn !== undefined) { + if (input.HostResourceGroupArn !== undefined && input.HostResourceGroupArn !== null) { entries["HostResourceGroupArn"] = input.HostResourceGroupArn; } - if (input.PartitionNumber !== undefined) { + if (input.PartitionNumber !== undefined && input.PartitionNumber !== null) { entries["PartitionNumber"] = input.PartitionNumber; } return entries; @@ -40264,7 +40504,7 @@ const serializeAws_ec2LaunchTemplatesMonitoringRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -40275,13 +40515,13 @@ const serializeAws_ec2LaunchTemplateSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LaunchTemplateId !== undefined) { + if (input.LaunchTemplateId !== undefined && input.LaunchTemplateId !== null) { entries["LaunchTemplateId"] = input.LaunchTemplateId; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } - if (input.Version !== undefined) { + if (input.Version !== undefined && input.Version !== null) { entries["Version"] = input.Version; } return entries; @@ -40292,19 +40532,19 @@ const serializeAws_ec2LaunchTemplateSpotMarketOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxPrice !== undefined) { + if (input.MaxPrice !== undefined && input.MaxPrice !== null) { entries["MaxPrice"] = input.MaxPrice; } - if (input.SpotInstanceType !== undefined) { + if (input.SpotInstanceType !== undefined && input.SpotInstanceType !== null) { entries["SpotInstanceType"] = input.SpotInstanceType; } - if (input.BlockDurationMinutes !== undefined) { + if (input.BlockDurationMinutes !== undefined && input.BlockDurationMinutes !== null) { entries["BlockDurationMinutes"] = input.BlockDurationMinutes; } - if (input.ValidUntil !== undefined) { + if (input.ValidUntil !== undefined && input.ValidUntil !== null) { entries["ValidUntil"] = input.ValidUntil.toISOString().split(".")[0] + "Z"; } - if (input.InstanceInterruptionBehavior !== undefined) { + if (input.InstanceInterruptionBehavior !== undefined && input.InstanceInterruptionBehavior !== null) { entries["InstanceInterruptionBehavior"] = input.InstanceInterruptionBehavior; } return entries; @@ -40315,10 +40555,10 @@ const serializeAws_ec2LaunchTemplateTagSpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceType !== undefined) { + if (input.ResourceType !== undefined && input.ResourceType !== null) { entries["ResourceType"] = input.ResourceType; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_ec2TagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tag.${key.substring(key.indexOf(".") + 1)}`; @@ -40335,6 +40575,9 @@ const serializeAws_ec2LaunchTemplateTagSpecificationRequestList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LaunchTemplateTagSpecificationRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`LaunchTemplateTagSpecificationRequest.${counter}.${key}`] = value; @@ -40349,7 +40592,7 @@ const serializeAws_ec2LicenseConfigurationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LicenseConfigurationArn !== undefined) { + if (input.LicenseConfigurationArn !== undefined && input.LicenseConfigurationArn !== null) { entries["LicenseConfigurationArn"] = input.LicenseConfigurationArn; } return entries; @@ -40362,6 +40605,9 @@ const serializeAws_ec2LicenseSpecificationListRequest = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LicenseConfigurationRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -40373,14 +40619,14 @@ const serializeAws_ec2LicenseSpecificationListRequest = ( const serializeAws_ec2LoadBalancersConfig = (input: LoadBalancersConfig, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClassicLoadBalancersConfig !== undefined) { + if (input.ClassicLoadBalancersConfig !== undefined && input.ClassicLoadBalancersConfig !== null) { const memberEntries = serializeAws_ec2ClassicLoadBalancersConfig(input.ClassicLoadBalancersConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClassicLoadBalancersConfig.${key}`; entries[loc] = value; }); } - if (input.TargetGroupsConfig !== undefined) { + if (input.TargetGroupsConfig !== undefined && input.TargetGroupsConfig !== null) { const memberEntries = serializeAws_ec2TargetGroupsConfig(input.TargetGroupsConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetGroupsConfig.${key}`; @@ -40394,6 +40640,9 @@ const serializeAws_ec2LoadPermissionListRequest = (input: LoadPermissionRequest[ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2LoadPermissionRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -40408,14 +40657,14 @@ const serializeAws_ec2LoadPermissionModifications = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Add !== undefined) { + if (input.Add !== undefined && input.Add !== null) { const memberEntries = serializeAws_ec2LoadPermissionListRequest(input.Add, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Add.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Remove !== undefined) { + if (input.Remove !== undefined && input.Remove !== null) { const memberEntries = serializeAws_ec2LoadPermissionListRequest(input.Remove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Remove.${key.substring(key.indexOf(".") + 1)}`; @@ -40427,10 +40676,10 @@ const serializeAws_ec2LoadPermissionModifications = ( const serializeAws_ec2LoadPermissionRequest = (input: LoadPermissionRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Group !== undefined) { + if (input.Group !== undefined && input.Group !== null) { entries["Group"] = input.Group; } - if (input.UserId !== undefined) { + if (input.UserId !== undefined && input.UserId !== null) { entries["UserId"] = input.UserId; } return entries; @@ -40440,6 +40689,9 @@ const serializeAws_ec2LocalGatewayIdSet = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -40450,6 +40702,9 @@ const serializeAws_ec2LocalGatewayRouteTableIdSet = (input: string[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -40463,6 +40718,9 @@ const serializeAws_ec2LocalGatewayRouteTableVirtualInterfaceGroupAssociationIdSe const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -40473,6 +40731,9 @@ const serializeAws_ec2LocalGatewayRouteTableVpcAssociationIdSet = (input: string const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -40483,6 +40744,9 @@ const serializeAws_ec2LocalGatewayVirtualInterfaceGroupIdSet = (input: string[], const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -40493,6 +40757,9 @@ const serializeAws_ec2LocalGatewayVirtualInterfaceIdSet = (input: string[], cont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -40504,13 +40771,13 @@ const serializeAws_ec2ModifyAvailabilityZoneGroupRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.OptInStatus !== undefined) { + if (input.OptInStatus !== undefined && input.OptInStatus !== null) { entries["OptInStatus"] = input.OptInStatus; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -40521,19 +40788,19 @@ const serializeAws_ec2ModifyCapacityReservationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CapacityReservationId !== undefined) { + if (input.CapacityReservationId !== undefined && input.CapacityReservationId !== null) { entries["CapacityReservationId"] = input.CapacityReservationId; } - if (input.InstanceCount !== undefined) { + if (input.InstanceCount !== undefined && input.InstanceCount !== null) { entries["InstanceCount"] = input.InstanceCount; } - if (input.EndDate !== undefined) { + if (input.EndDate !== undefined && input.EndDate !== null) { entries["EndDate"] = input.EndDate.toISOString().split(".")[0] + "Z"; } - if (input.EndDateType !== undefined) { + if (input.EndDateType !== undefined && input.EndDateType !== null) { entries["EndDateType"] = input.EndDateType; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -40544,52 +40811,52 @@ const serializeAws_ec2ModifyClientVpnEndpointRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.ServerCertificateArn !== undefined) { + if (input.ServerCertificateArn !== undefined && input.ServerCertificateArn !== null) { entries["ServerCertificateArn"] = input.ServerCertificateArn; } - if (input.ConnectionLogOptions !== undefined) { + if (input.ConnectionLogOptions !== undefined && input.ConnectionLogOptions !== null) { const memberEntries = serializeAws_ec2ConnectionLogOptions(input.ConnectionLogOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConnectionLogOptions.${key}`; entries[loc] = value; }); } - if (input.DnsServers !== undefined) { + if (input.DnsServers !== undefined && input.DnsServers !== null) { const memberEntries = serializeAws_ec2DnsServersOptionsModifyStructure(input.DnsServers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DnsServers.${key}`; entries[loc] = value; }); } - if (input.VpnPort !== undefined) { + if (input.VpnPort !== undefined && input.VpnPort !== null) { entries["VpnPort"] = input.VpnPort; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.SplitTunnel !== undefined) { + if (input.SplitTunnel !== undefined && input.SplitTunnel !== null) { entries["SplitTunnel"] = input.SplitTunnel; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_ec2ClientVpnSecurityGroupIdSet(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.SelfServicePortal !== undefined) { + if (input.SelfServicePortal !== undefined && input.SelfServicePortal !== null) { entries["SelfServicePortal"] = input.SelfServicePortal; } - if (input.ClientConnectOptions !== undefined) { + if (input.ClientConnectOptions !== undefined && input.ClientConnectOptions !== null) { const memberEntries = serializeAws_ec2ClientConnectOptions(input.ClientConnectOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClientConnectOptions.${key}`; @@ -40604,13 +40871,13 @@ const serializeAws_ec2ModifyDefaultCreditSpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceFamily !== undefined) { + if (input.InstanceFamily !== undefined && input.InstanceFamily !== null) { entries["InstanceFamily"] = input.InstanceFamily; } - if (input.CpuCredits !== undefined) { + if (input.CpuCredits !== undefined && input.CpuCredits !== null) { entries["CpuCredits"] = input.CpuCredits; } return entries; @@ -40621,10 +40888,10 @@ const serializeAws_ec2ModifyEbsDefaultKmsKeyIdRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -40632,23 +40899,23 @@ const serializeAws_ec2ModifyEbsDefaultKmsKeyIdRequest = ( const serializeAws_ec2ModifyFleetRequest = (input: ModifyFleetRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ExcessCapacityTerminationPolicy !== undefined) { + if (input.ExcessCapacityTerminationPolicy !== undefined && input.ExcessCapacityTerminationPolicy !== null) { entries["ExcessCapacityTerminationPolicy"] = input.ExcessCapacityTerminationPolicy; } - if (input.LaunchTemplateConfigs !== undefined) { + if (input.LaunchTemplateConfigs !== undefined && input.LaunchTemplateConfigs !== null) { const memberEntries = serializeAws_ec2FleetLaunchTemplateConfigListRequest(input.LaunchTemplateConfigs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateConfig.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.FleetId !== undefined) { + if (input.FleetId !== undefined && input.FleetId !== null) { entries["FleetId"] = input.FleetId; } - if (input.TargetCapacitySpecification !== undefined) { + if (input.TargetCapacitySpecification !== undefined && input.TargetCapacitySpecification !== null) { const memberEntries = serializeAws_ec2TargetCapacitySpecificationRequest( input.TargetCapacitySpecification, context @@ -40666,50 +40933,50 @@ const serializeAws_ec2ModifyFpgaImageAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.FpgaImageId !== undefined) { + if (input.FpgaImageId !== undefined && input.FpgaImageId !== null) { entries["FpgaImageId"] = input.FpgaImageId; } - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.OperationType !== undefined) { + if (input.OperationType !== undefined && input.OperationType !== null) { entries["OperationType"] = input.OperationType; } - if (input.UserIds !== undefined) { + if (input.UserIds !== undefined && input.UserIds !== null) { const memberEntries = serializeAws_ec2UserIdStringList(input.UserIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.UserGroups !== undefined) { + if (input.UserGroups !== undefined && input.UserGroups !== null) { const memberEntries = serializeAws_ec2UserGroupStringList(input.UserGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserGroup.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ProductCodes !== undefined) { + if (input.ProductCodes !== undefined && input.ProductCodes !== null) { const memberEntries = serializeAws_ec2ProductCodeStringList(input.ProductCodes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProductCode.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.LoadPermission !== undefined) { + if (input.LoadPermission !== undefined && input.LoadPermission !== null) { const memberEntries = serializeAws_ec2LoadPermissionModifications(input.LoadPermission, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadPermission.${key}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -40717,23 +40984,23 @@ const serializeAws_ec2ModifyFpgaImageAttributeRequest = ( const serializeAws_ec2ModifyHostsRequest = (input: ModifyHostsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AutoPlacement !== undefined) { + if (input.AutoPlacement !== undefined && input.AutoPlacement !== null) { entries["AutoPlacement"] = input.AutoPlacement; } - if (input.HostIds !== undefined) { + if (input.HostIds !== undefined && input.HostIds !== null) { const memberEntries = serializeAws_ec2RequestHostIdList(input.HostIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HostId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.HostRecovery !== undefined) { + if (input.HostRecovery !== undefined && input.HostRecovery !== null) { entries["HostRecovery"] = input.HostRecovery; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.InstanceFamily !== undefined) { + if (input.InstanceFamily !== undefined && input.InstanceFamily !== null) { entries["InstanceFamily"] = input.InstanceFamily; } return entries; @@ -40744,13 +41011,13 @@ const serializeAws_ec2ModifyIdentityIdFormatRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PrincipalArn !== undefined) { + if (input.PrincipalArn !== undefined && input.PrincipalArn !== null) { entries["PrincipalArn"] = input.PrincipalArn; } - if (input.Resource !== undefined) { + if (input.Resource !== undefined && input.Resource !== null) { entries["Resource"] = input.Resource; } - if (input.UseLongIds !== undefined) { + if (input.UseLongIds !== undefined && input.UseLongIds !== null) { entries["UseLongIds"] = input.UseLongIds; } return entries; @@ -40758,10 +41025,10 @@ const serializeAws_ec2ModifyIdentityIdFormatRequest = ( const serializeAws_ec2ModifyIdFormatRequest = (input: ModifyIdFormatRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Resource !== undefined) { + if (input.Resource !== undefined && input.Resource !== null) { entries["Resource"] = input.Resource; } - if (input.UseLongIds !== undefined) { + if (input.UseLongIds !== undefined && input.UseLongIds !== null) { entries["UseLongIds"] = input.UseLongIds; } return entries; @@ -40772,54 +41039,54 @@ const serializeAws_ec2ModifyImageAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { const memberEntries = serializeAws_ec2AttributeValue(input.Description, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Description.${key}`; entries[loc] = value; }); } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.LaunchPermission !== undefined) { + if (input.LaunchPermission !== undefined && input.LaunchPermission !== null) { const memberEntries = serializeAws_ec2LaunchPermissionModifications(input.LaunchPermission, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchPermission.${key}`; entries[loc] = value; }); } - if (input.OperationType !== undefined) { + if (input.OperationType !== undefined && input.OperationType !== null) { entries["OperationType"] = input.OperationType; } - if (input.ProductCodes !== undefined) { + if (input.ProductCodes !== undefined && input.ProductCodes !== null) { const memberEntries = serializeAws_ec2ProductCodeStringList(input.ProductCodes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProductCode.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.UserGroups !== undefined) { + if (input.UserGroups !== undefined && input.UserGroups !== null) { const memberEntries = serializeAws_ec2UserGroupStringList(input.UserGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserGroup.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.UserIds !== undefined) { + if (input.UserIds !== undefined && input.UserIds !== null) { const memberEntries = serializeAws_ec2UserIdStringList(input.UserIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -40830,17 +41097,17 @@ const serializeAws_ec2ModifyInstanceAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceDestCheck !== undefined) { + if (input.SourceDestCheck !== undefined && input.SourceDestCheck !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.SourceDestCheck, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceDestCheck.${key}`; entries[loc] = value; }); } - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.BlockDeviceMappings !== undefined) { + if (input.BlockDeviceMappings !== undefined && input.BlockDeviceMappings !== null) { const memberEntries = serializeAws_ec2InstanceBlockDeviceMappingSpecificationList( input.BlockDeviceMappings, context @@ -40850,83 +41117,83 @@ const serializeAws_ec2ModifyInstanceAttributeRequest = ( entries[loc] = value; }); } - if (input.DisableApiTermination !== undefined) { + if (input.DisableApiTermination !== undefined && input.DisableApiTermination !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.DisableApiTermination, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DisableApiTermination.${key}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.EbsOptimized !== undefined) { + if (input.EbsOptimized !== undefined && input.EbsOptimized !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.EbsOptimized, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EbsOptimized.${key}`; entries[loc] = value; }); } - if (input.EnaSupport !== undefined) { + if (input.EnaSupport !== undefined && input.EnaSupport !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.EnaSupport, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnaSupport.${key}`; entries[loc] = value; }); } - if (input.Groups !== undefined) { + if (input.Groups !== undefined && input.Groups !== null) { const memberEntries = serializeAws_ec2GroupIdStringList(input.Groups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.InstanceInitiatedShutdownBehavior !== undefined) { + if (input.InstanceInitiatedShutdownBehavior !== undefined && input.InstanceInitiatedShutdownBehavior !== null) { const memberEntries = serializeAws_ec2AttributeValue(input.InstanceInitiatedShutdownBehavior, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceInitiatedShutdownBehavior.${key}`; entries[loc] = value; }); } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { const memberEntries = serializeAws_ec2AttributeValue(input.InstanceType, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceType.${key}`; entries[loc] = value; }); } - if (input.Kernel !== undefined) { + if (input.Kernel !== undefined && input.Kernel !== null) { const memberEntries = serializeAws_ec2AttributeValue(input.Kernel, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Kernel.${key}`; entries[loc] = value; }); } - if (input.Ramdisk !== undefined) { + if (input.Ramdisk !== undefined && input.Ramdisk !== null) { const memberEntries = serializeAws_ec2AttributeValue(input.Ramdisk, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ramdisk.${key}`; entries[loc] = value; }); } - if (input.SriovNetSupport !== undefined) { + if (input.SriovNetSupport !== undefined && input.SriovNetSupport !== null) { const memberEntries = serializeAws_ec2AttributeValue(input.SriovNetSupport, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SriovNetSupport.${key}`; entries[loc] = value; }); } - if (input.UserData !== undefined) { + if (input.UserData !== undefined && input.UserData !== null) { const memberEntries = serializeAws_ec2BlobAttributeValue(input.UserData, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserData.${key}`; entries[loc] = value; }); } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -40937,10 +41204,10 @@ const serializeAws_ec2ModifyInstanceCapacityReservationAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.CapacityReservationSpecification !== undefined) { + if (input.CapacityReservationSpecification !== undefined && input.CapacityReservationSpecification !== null) { const memberEntries = serializeAws_ec2CapacityReservationSpecification( input.CapacityReservationSpecification, context @@ -40950,7 +41217,7 @@ const serializeAws_ec2ModifyInstanceCapacityReservationAttributesRequest = ( entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -40961,13 +41228,13 @@ const serializeAws_ec2ModifyInstanceCreditSpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.InstanceCreditSpecifications !== undefined) { + if (input.InstanceCreditSpecifications !== undefined && input.InstanceCreditSpecifications !== null) { const memberEntries = serializeAws_ec2InstanceCreditSpecificationListRequest( input.InstanceCreditSpecifications, context @@ -40985,16 +41252,16 @@ const serializeAws_ec2ModifyInstanceEventStartTimeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.InstanceEventId !== undefined) { + if (input.InstanceEventId !== undefined && input.InstanceEventId !== null) { entries["InstanceEventId"] = input.InstanceEventId; } - if (input.NotBefore !== undefined) { + if (input.NotBefore !== undefined && input.NotBefore !== null) { entries["NotBefore"] = input.NotBefore.toISOString().split(".")[0] + "Z"; } return entries; @@ -41005,19 +41272,19 @@ const serializeAws_ec2ModifyInstanceMetadataOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.HttpTokens !== undefined) { + if (input.HttpTokens !== undefined && input.HttpTokens !== null) { entries["HttpTokens"] = input.HttpTokens; } - if (input.HttpPutResponseHopLimit !== undefined) { + if (input.HttpPutResponseHopLimit !== undefined && input.HttpPutResponseHopLimit !== null) { entries["HttpPutResponseHopLimit"] = input.HttpPutResponseHopLimit; } - if (input.HttpEndpoint !== undefined) { + if (input.HttpEndpoint !== undefined && input.HttpEndpoint !== null) { entries["HttpEndpoint"] = input.HttpEndpoint; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41028,25 +41295,25 @@ const serializeAws_ec2ModifyInstancePlacementRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Affinity !== undefined) { + if (input.Affinity !== undefined && input.Affinity !== null) { entries["Affinity"] = input.Affinity; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.HostId !== undefined) { + if (input.HostId !== undefined && input.HostId !== null) { entries["HostId"] = input.HostId; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.Tenancy !== undefined) { + if (input.Tenancy !== undefined && input.Tenancy !== null) { entries["Tenancy"] = input.Tenancy; } - if (input.PartitionNumber !== undefined) { + if (input.PartitionNumber !== undefined && input.PartitionNumber !== null) { entries["PartitionNumber"] = input.PartitionNumber; } - if (input.HostResourceGroupArn !== undefined) { + if (input.HostResourceGroupArn !== undefined && input.HostResourceGroupArn !== null) { entries["HostResourceGroupArn"] = input.HostResourceGroupArn; } return entries; @@ -41057,19 +41324,19 @@ const serializeAws_ec2ModifyLaunchTemplateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.LaunchTemplateId !== undefined) { + if (input.LaunchTemplateId !== undefined && input.LaunchTemplateId !== null) { entries["LaunchTemplateId"] = input.LaunchTemplateId; } - if (input.LaunchTemplateName !== undefined) { + if (input.LaunchTemplateName !== undefined && input.LaunchTemplateName !== null) { entries["LaunchTemplateName"] = input.LaunchTemplateName; } - if (input.DefaultVersion !== undefined) { + if (input.DefaultVersion !== undefined && input.DefaultVersion !== null) { entries["SetDefaultVersion"] = input.DefaultVersion; } return entries; @@ -41080,26 +41347,26 @@ const serializeAws_ec2ModifyManagedPrefixListRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PrefixListId !== undefined) { + if (input.PrefixListId !== undefined && input.PrefixListId !== null) { entries["PrefixListId"] = input.PrefixListId; } - if (input.CurrentVersion !== undefined) { + if (input.CurrentVersion !== undefined && input.CurrentVersion !== null) { entries["CurrentVersion"] = input.CurrentVersion; } - if (input.PrefixListName !== undefined) { + if (input.PrefixListName !== undefined && input.PrefixListName !== null) { entries["PrefixListName"] = input.PrefixListName; } - if (input.AddEntries !== undefined) { + if (input.AddEntries !== undefined && input.AddEntries !== null) { const memberEntries = serializeAws_ec2AddPrefixListEntries(input.AddEntries, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddEntry.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveEntries !== undefined) { + if (input.RemoveEntries !== undefined && input.RemoveEntries !== null) { const memberEntries = serializeAws_ec2RemovePrefixListEntries(input.RemoveEntries, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveEntry.${key.substring(key.indexOf(".") + 1)}`; @@ -41114,34 +41381,34 @@ const serializeAws_ec2ModifyNetworkInterfaceAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attachment !== undefined) { + if (input.Attachment !== undefined && input.Attachment !== null) { const memberEntries = serializeAws_ec2NetworkInterfaceAttachmentChanges(input.Attachment, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attachment.${key}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { const memberEntries = serializeAws_ec2AttributeValue(input.Description, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Description.${key}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Groups !== undefined) { + if (input.Groups !== undefined && input.Groups !== null) { const memberEntries = serializeAws_ec2SecurityGroupIdStringList(input.Groups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.SourceDestCheck !== undefined) { + if (input.SourceDestCheck !== undefined && input.SourceDestCheck !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.SourceDestCheck, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceDestCheck.${key}`; @@ -41156,17 +41423,17 @@ const serializeAws_ec2ModifyReservedInstancesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedInstancesIds !== undefined) { + if (input.ReservedInstancesIds !== undefined && input.ReservedInstancesIds !== null) { const memberEntries = serializeAws_ec2ReservedInstancesIdStringList(input.ReservedInstancesIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReservedInstancesId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.TargetConfigurations !== undefined) { + if (input.TargetConfigurations !== undefined && input.TargetConfigurations !== null) { const memberEntries = serializeAws_ec2ReservedInstancesConfigurationList(input.TargetConfigurations, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReservedInstancesConfigurationSetItemType.${key.substring(key.indexOf(".") + 1)}`; @@ -41181,37 +41448,37 @@ const serializeAws_ec2ModifySnapshotAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.CreateVolumePermission !== undefined) { + if (input.CreateVolumePermission !== undefined && input.CreateVolumePermission !== null) { const memberEntries = serializeAws_ec2CreateVolumePermissionModifications(input.CreateVolumePermission, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CreateVolumePermission.${key}`; entries[loc] = value; }); } - if (input.GroupNames !== undefined) { + if (input.GroupNames !== undefined && input.GroupNames !== null) { const memberEntries = serializeAws_ec2GroupNameStringList(input.GroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserGroup.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.OperationType !== undefined) { + if (input.OperationType !== undefined && input.OperationType !== null) { entries["OperationType"] = input.OperationType; } - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.UserIds !== undefined) { + if (input.UserIds !== undefined && input.UserIds !== null) { const memberEntries = serializeAws_ec2UserIdStringList(input.UserIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41222,23 +41489,23 @@ const serializeAws_ec2ModifySpotFleetRequestRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ExcessCapacityTerminationPolicy !== undefined) { + if (input.ExcessCapacityTerminationPolicy !== undefined && input.ExcessCapacityTerminationPolicy !== null) { entries["ExcessCapacityTerminationPolicy"] = input.ExcessCapacityTerminationPolicy; } - if (input.LaunchTemplateConfigs !== undefined) { + if (input.LaunchTemplateConfigs !== undefined && input.LaunchTemplateConfigs !== null) { const memberEntries = serializeAws_ec2LaunchTemplateConfigList(input.LaunchTemplateConfigs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateConfig.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SpotFleetRequestId !== undefined) { + if (input.SpotFleetRequestId !== undefined && input.SpotFleetRequestId !== null) { entries["SpotFleetRequestId"] = input.SpotFleetRequestId; } - if (input.TargetCapacity !== undefined) { + if (input.TargetCapacity !== undefined && input.TargetCapacity !== null) { entries["TargetCapacity"] = input.TargetCapacity; } - if (input.OnDemandTargetCapacity !== undefined) { + if (input.OnDemandTargetCapacity !== undefined && input.OnDemandTargetCapacity !== null) { entries["OnDemandTargetCapacity"] = input.OnDemandTargetCapacity; } return entries; @@ -41249,31 +41516,31 @@ const serializeAws_ec2ModifySubnetAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssignIpv6AddressOnCreation !== undefined) { + if (input.AssignIpv6AddressOnCreation !== undefined && input.AssignIpv6AddressOnCreation !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.AssignIpv6AddressOnCreation, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AssignIpv6AddressOnCreation.${key}`; entries[loc] = value; }); } - if (input.MapPublicIpOnLaunch !== undefined) { + if (input.MapPublicIpOnLaunch !== undefined && input.MapPublicIpOnLaunch !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.MapPublicIpOnLaunch, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MapPublicIpOnLaunch.${key}`; entries[loc] = value; }); } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.MapCustomerOwnedIpOnLaunch !== undefined) { + if (input.MapCustomerOwnedIpOnLaunch !== undefined && input.MapCustomerOwnedIpOnLaunch !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.MapCustomerOwnedIpOnLaunch, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MapCustomerOwnedIpOnLaunch.${key}`; entries[loc] = value; }); } - if (input.CustomerOwnedIpv4Pool !== undefined) { + if (input.CustomerOwnedIpv4Pool !== undefined && input.CustomerOwnedIpv4Pool !== null) { entries["CustomerOwnedIpv4Pool"] = input.CustomerOwnedIpv4Pool; } return entries; @@ -41284,24 +41551,24 @@ const serializeAws_ec2ModifyTrafficMirrorFilterNetworkServicesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorFilterId !== undefined) { + if (input.TrafficMirrorFilterId !== undefined && input.TrafficMirrorFilterId !== null) { entries["TrafficMirrorFilterId"] = input.TrafficMirrorFilterId; } - if (input.AddNetworkServices !== undefined) { + if (input.AddNetworkServices !== undefined && input.AddNetworkServices !== null) { const memberEntries = serializeAws_ec2TrafficMirrorNetworkServiceList(input.AddNetworkServices, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddNetworkService.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveNetworkServices !== undefined) { + if (input.RemoveNetworkServices !== undefined && input.RemoveNetworkServices !== null) { const memberEntries = serializeAws_ec2TrafficMirrorNetworkServiceList(input.RemoveNetworkServices, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveNetworkService.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41312,52 +41579,52 @@ const serializeAws_ec2ModifyTrafficMirrorFilterRuleRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorFilterRuleId !== undefined) { + if (input.TrafficMirrorFilterRuleId !== undefined && input.TrafficMirrorFilterRuleId !== null) { entries["TrafficMirrorFilterRuleId"] = input.TrafficMirrorFilterRuleId; } - if (input.TrafficDirection !== undefined) { + if (input.TrafficDirection !== undefined && input.TrafficDirection !== null) { entries["TrafficDirection"] = input.TrafficDirection; } - if (input.RuleNumber !== undefined) { + if (input.RuleNumber !== undefined && input.RuleNumber !== null) { entries["RuleNumber"] = input.RuleNumber; } - if (input.RuleAction !== undefined) { + if (input.RuleAction !== undefined && input.RuleAction !== null) { entries["RuleAction"] = input.RuleAction; } - if (input.DestinationPortRange !== undefined) { + if (input.DestinationPortRange !== undefined && input.DestinationPortRange !== null) { const memberEntries = serializeAws_ec2TrafficMirrorPortRangeRequest(input.DestinationPortRange, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DestinationPortRange.${key}`; entries[loc] = value; }); } - if (input.SourcePortRange !== undefined) { + if (input.SourcePortRange !== undefined && input.SourcePortRange !== null) { const memberEntries = serializeAws_ec2TrafficMirrorPortRangeRequest(input.SourcePortRange, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourcePortRange.${key}`; entries[loc] = value; }); } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.SourceCidrBlock !== undefined) { + if (input.SourceCidrBlock !== undefined && input.SourceCidrBlock !== null) { entries["SourceCidrBlock"] = input.SourceCidrBlock; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.RemoveFields !== undefined) { + if (input.RemoveFields !== undefined && input.RemoveFields !== null) { const memberEntries = serializeAws_ec2TrafficMirrorFilterRuleFieldList(input.RemoveFields, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveField.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41368,35 +41635,35 @@ const serializeAws_ec2ModifyTrafficMirrorSessionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TrafficMirrorSessionId !== undefined) { + if (input.TrafficMirrorSessionId !== undefined && input.TrafficMirrorSessionId !== null) { entries["TrafficMirrorSessionId"] = input.TrafficMirrorSessionId; } - if (input.TrafficMirrorTargetId !== undefined) { + if (input.TrafficMirrorTargetId !== undefined && input.TrafficMirrorTargetId !== null) { entries["TrafficMirrorTargetId"] = input.TrafficMirrorTargetId; } - if (input.TrafficMirrorFilterId !== undefined) { + if (input.TrafficMirrorFilterId !== undefined && input.TrafficMirrorFilterId !== null) { entries["TrafficMirrorFilterId"] = input.TrafficMirrorFilterId; } - if (input.PacketLength !== undefined) { + if (input.PacketLength !== undefined && input.PacketLength !== null) { entries["PacketLength"] = input.PacketLength; } - if (input.SessionNumber !== undefined) { + if (input.SessionNumber !== undefined && input.SessionNumber !== null) { entries["SessionNumber"] = input.SessionNumber; } - if (input.VirtualNetworkId !== undefined) { + if (input.VirtualNetworkId !== undefined && input.VirtualNetworkId !== null) { entries["VirtualNetworkId"] = input.VirtualNetworkId; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.RemoveFields !== undefined) { + if (input.RemoveFields !== undefined && input.RemoveFields !== null) { const memberEntries = serializeAws_ec2TrafficMirrorSessionFieldList(input.RemoveFields, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveField.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41407,14 +41674,14 @@ const serializeAws_ec2ModifyTransitGatewayOptions = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AddTransitGatewayCidrBlocks !== undefined) { + if (input.AddTransitGatewayCidrBlocks !== undefined && input.AddTransitGatewayCidrBlocks !== null) { const memberEntries = serializeAws_ec2TransitGatewayCidrBlockStringList(input.AddTransitGatewayCidrBlocks, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddTransitGatewayCidrBlocks.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveTransitGatewayCidrBlocks !== undefined) { + if (input.RemoveTransitGatewayCidrBlocks !== undefined && input.RemoveTransitGatewayCidrBlocks !== null) { const memberEntries = serializeAws_ec2TransitGatewayCidrBlockStringList( input.RemoveTransitGatewayCidrBlocks, context @@ -41424,25 +41691,25 @@ const serializeAws_ec2ModifyTransitGatewayOptions = ( entries[loc] = value; }); } - if (input.VpnEcmpSupport !== undefined) { + if (input.VpnEcmpSupport !== undefined && input.VpnEcmpSupport !== null) { entries["VpnEcmpSupport"] = input.VpnEcmpSupport; } - if (input.DnsSupport !== undefined) { + if (input.DnsSupport !== undefined && input.DnsSupport !== null) { entries["DnsSupport"] = input.DnsSupport; } - if (input.AutoAcceptSharedAttachments !== undefined) { + if (input.AutoAcceptSharedAttachments !== undefined && input.AutoAcceptSharedAttachments !== null) { entries["AutoAcceptSharedAttachments"] = input.AutoAcceptSharedAttachments; } - if (input.DefaultRouteTableAssociation !== undefined) { + if (input.DefaultRouteTableAssociation !== undefined && input.DefaultRouteTableAssociation !== null) { entries["DefaultRouteTableAssociation"] = input.DefaultRouteTableAssociation; } - if (input.AssociationDefaultRouteTableId !== undefined) { + if (input.AssociationDefaultRouteTableId !== undefined && input.AssociationDefaultRouteTableId !== null) { entries["AssociationDefaultRouteTableId"] = input.AssociationDefaultRouteTableId; } - if (input.DefaultRouteTablePropagation !== undefined) { + if (input.DefaultRouteTablePropagation !== undefined && input.DefaultRouteTablePropagation !== null) { entries["DefaultRouteTablePropagation"] = input.DefaultRouteTablePropagation; } - if (input.PropagationDefaultRouteTableId !== undefined) { + if (input.PropagationDefaultRouteTableId !== undefined && input.PropagationDefaultRouteTableId !== null) { entries["PropagationDefaultRouteTableId"] = input.PropagationDefaultRouteTableId; } return entries; @@ -41453,19 +41720,19 @@ const serializeAws_ec2ModifyTransitGatewayPrefixListReferenceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.PrefixListId !== undefined) { + if (input.PrefixListId !== undefined && input.PrefixListId !== null) { entries["PrefixListId"] = input.PrefixListId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.Blackhole !== undefined) { + if (input.Blackhole !== undefined && input.Blackhole !== null) { entries["Blackhole"] = input.Blackhole; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41476,20 +41743,20 @@ const serializeAws_ec2ModifyTransitGatewayRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Options !== undefined) { + if (input.Options !== undefined && input.Options !== null) { const memberEntries = serializeAws_ec2ModifyTransitGatewayOptions(input.Options, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Options.${key}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41500,31 +41767,31 @@ const serializeAws_ec2ModifyTransitGatewayVpcAttachmentRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.AddSubnetIds !== undefined) { + if (input.AddSubnetIds !== undefined && input.AddSubnetIds !== null) { const memberEntries = serializeAws_ec2TransitGatewaySubnetIdList(input.AddSubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddSubnetIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveSubnetIds !== undefined) { + if (input.RemoveSubnetIds !== undefined && input.RemoveSubnetIds !== null) { const memberEntries = serializeAws_ec2TransitGatewaySubnetIdList(input.RemoveSubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveSubnetIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Options !== undefined) { + if (input.Options !== undefined && input.Options !== null) { const memberEntries = serializeAws_ec2ModifyTransitGatewayVpcAttachmentRequestOptions(input.Options, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Options.${key}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41535,13 +41802,13 @@ const serializeAws_ec2ModifyTransitGatewayVpcAttachmentRequestOptions = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DnsSupport !== undefined) { + if (input.DnsSupport !== undefined && input.DnsSupport !== null) { entries["DnsSupport"] = input.DnsSupport; } - if (input.Ipv6Support !== undefined) { + if (input.Ipv6Support !== undefined && input.Ipv6Support !== null) { entries["Ipv6Support"] = input.Ipv6Support; } - if (input.ApplianceModeSupport !== undefined) { + if (input.ApplianceModeSupport !== undefined && input.ApplianceModeSupport !== null) { entries["ApplianceModeSupport"] = input.ApplianceModeSupport; } return entries; @@ -41552,17 +41819,17 @@ const serializeAws_ec2ModifyVolumeAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AutoEnableIO !== undefined) { + if (input.AutoEnableIO !== undefined && input.AutoEnableIO !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.AutoEnableIO, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AutoEnableIO.${key}`; entries[loc] = value; }); } - if (input.VolumeId !== undefined) { + if (input.VolumeId !== undefined && input.VolumeId !== null) { entries["VolumeId"] = input.VolumeId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41570,22 +41837,22 @@ const serializeAws_ec2ModifyVolumeAttributeRequest = ( const serializeAws_ec2ModifyVolumeRequest = (input: ModifyVolumeRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VolumeId !== undefined) { + if (input.VolumeId !== undefined && input.VolumeId !== null) { entries["VolumeId"] = input.VolumeId; } - if (input.Size !== undefined) { + if (input.Size !== undefined && input.Size !== null) { entries["Size"] = input.Size; } - if (input.VolumeType !== undefined) { + if (input.VolumeType !== undefined && input.VolumeType !== null) { entries["VolumeType"] = input.VolumeType; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.Throughput !== undefined) { + if (input.Throughput !== undefined && input.Throughput !== null) { entries["Throughput"] = input.Throughput; } return entries; @@ -41593,21 +41860,21 @@ const serializeAws_ec2ModifyVolumeRequest = (input: ModifyVolumeRequest, context const serializeAws_ec2ModifyVpcAttributeRequest = (input: ModifyVpcAttributeRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.EnableDnsHostnames !== undefined) { + if (input.EnableDnsHostnames !== undefined && input.EnableDnsHostnames !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.EnableDnsHostnames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableDnsHostnames.${key}`; entries[loc] = value; }); } - if (input.EnableDnsSupport !== undefined) { + if (input.EnableDnsSupport !== undefined && input.EnableDnsSupport !== null) { const memberEntries = serializeAws_ec2AttributeBooleanValue(input.EnableDnsSupport, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableDnsSupport.${key}`; entries[loc] = value; }); } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } return entries; @@ -41618,16 +41885,16 @@ const serializeAws_ec2ModifyVpcEndpointConnectionNotificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ConnectionNotificationId !== undefined) { + if (input.ConnectionNotificationId !== undefined && input.ConnectionNotificationId !== null) { entries["ConnectionNotificationId"] = input.ConnectionNotificationId; } - if (input.ConnectionNotificationArn !== undefined) { + if (input.ConnectionNotificationArn !== undefined && input.ConnectionNotificationArn !== null) { entries["ConnectionNotificationArn"] = input.ConnectionNotificationArn; } - if (input.ConnectionEvents !== undefined) { + if (input.ConnectionEvents !== undefined && input.ConnectionEvents !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.ConnectionEvents, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConnectionEvents.${key.substring(key.indexOf(".") + 1)}`; @@ -41639,61 +41906,61 @@ const serializeAws_ec2ModifyVpcEndpointConnectionNotificationRequest = ( const serializeAws_ec2ModifyVpcEndpointRequest = (input: ModifyVpcEndpointRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcEndpointId !== undefined) { + if (input.VpcEndpointId !== undefined && input.VpcEndpointId !== null) { entries["VpcEndpointId"] = input.VpcEndpointId; } - if (input.ResetPolicy !== undefined) { + if (input.ResetPolicy !== undefined && input.ResetPolicy !== null) { entries["ResetPolicy"] = input.ResetPolicy; } - if (input.PolicyDocument !== undefined) { + if (input.PolicyDocument !== undefined && input.PolicyDocument !== null) { entries["PolicyDocument"] = input.PolicyDocument; } - if (input.AddRouteTableIds !== undefined) { + if (input.AddRouteTableIds !== undefined && input.AddRouteTableIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointRouteTableIdList(input.AddRouteTableIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddRouteTableId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveRouteTableIds !== undefined) { + if (input.RemoveRouteTableIds !== undefined && input.RemoveRouteTableIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointRouteTableIdList(input.RemoveRouteTableIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveRouteTableId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AddSubnetIds !== undefined) { + if (input.AddSubnetIds !== undefined && input.AddSubnetIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointSubnetIdList(input.AddSubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddSubnetId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveSubnetIds !== undefined) { + if (input.RemoveSubnetIds !== undefined && input.RemoveSubnetIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointSubnetIdList(input.RemoveSubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveSubnetId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AddSecurityGroupIds !== undefined) { + if (input.AddSecurityGroupIds !== undefined && input.AddSecurityGroupIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointSecurityGroupIdList(input.AddSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddSecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveSecurityGroupIds !== undefined) { + if (input.RemoveSecurityGroupIds !== undefined && input.RemoveSecurityGroupIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointSecurityGroupIdList(input.RemoveSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveSecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.PrivateDnsEnabled !== undefined) { + if (input.PrivateDnsEnabled !== undefined && input.PrivateDnsEnabled !== null) { entries["PrivateDnsEnabled"] = input.PrivateDnsEnabled; } return entries; @@ -41704,43 +41971,43 @@ const serializeAws_ec2ModifyVpcEndpointServiceConfigurationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceId !== undefined) { + if (input.ServiceId !== undefined && input.ServiceId !== null) { entries["ServiceId"] = input.ServiceId; } - if (input.PrivateDnsName !== undefined) { + if (input.PrivateDnsName !== undefined && input.PrivateDnsName !== null) { entries["PrivateDnsName"] = input.PrivateDnsName; } - if (input.RemovePrivateDnsName !== undefined) { + if (input.RemovePrivateDnsName !== undefined && input.RemovePrivateDnsName !== null) { entries["RemovePrivateDnsName"] = input.RemovePrivateDnsName; } - if (input.AcceptanceRequired !== undefined) { + if (input.AcceptanceRequired !== undefined && input.AcceptanceRequired !== null) { entries["AcceptanceRequired"] = input.AcceptanceRequired; } - if (input.AddNetworkLoadBalancerArns !== undefined) { + if (input.AddNetworkLoadBalancerArns !== undefined && input.AddNetworkLoadBalancerArns !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.AddNetworkLoadBalancerArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddNetworkLoadBalancerArn.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveNetworkLoadBalancerArns !== undefined) { + if (input.RemoveNetworkLoadBalancerArns !== undefined && input.RemoveNetworkLoadBalancerArns !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.RemoveNetworkLoadBalancerArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveNetworkLoadBalancerArn.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AddGatewayLoadBalancerArns !== undefined) { + if (input.AddGatewayLoadBalancerArns !== undefined && input.AddGatewayLoadBalancerArns !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.AddGatewayLoadBalancerArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddGatewayLoadBalancerArn.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveGatewayLoadBalancerArns !== undefined) { + if (input.RemoveGatewayLoadBalancerArns !== undefined && input.RemoveGatewayLoadBalancerArns !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.RemoveGatewayLoadBalancerArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveGatewayLoadBalancerArn.${key.substring(key.indexOf(".") + 1)}`; @@ -41755,20 +42022,20 @@ const serializeAws_ec2ModifyVpcEndpointServicePermissionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceId !== undefined) { + if (input.ServiceId !== undefined && input.ServiceId !== null) { entries["ServiceId"] = input.ServiceId; } - if (input.AddAllowedPrincipals !== undefined) { + if (input.AddAllowedPrincipals !== undefined && input.AddAllowedPrincipals !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.AddAllowedPrincipals, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddAllowedPrincipals.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RemoveAllowedPrincipals !== undefined) { + if (input.RemoveAllowedPrincipals !== undefined && input.RemoveAllowedPrincipals !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.RemoveAllowedPrincipals, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveAllowedPrincipals.${key.substring(key.indexOf(".") + 1)}`; @@ -41783,7 +42050,7 @@ const serializeAws_ec2ModifyVpcPeeringConnectionOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AccepterPeeringConnectionOptions !== undefined) { + if (input.AccepterPeeringConnectionOptions !== undefined && input.AccepterPeeringConnectionOptions !== null) { const memberEntries = serializeAws_ec2PeeringConnectionOptionsRequest( input.AccepterPeeringConnectionOptions, context @@ -41793,10 +42060,10 @@ const serializeAws_ec2ModifyVpcPeeringConnectionOptionsRequest = ( entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.RequesterPeeringConnectionOptions !== undefined) { + if (input.RequesterPeeringConnectionOptions !== undefined && input.RequesterPeeringConnectionOptions !== null) { const memberEntries = serializeAws_ec2PeeringConnectionOptionsRequest( input.RequesterPeeringConnectionOptions, context @@ -41806,7 +42073,7 @@ const serializeAws_ec2ModifyVpcPeeringConnectionOptionsRequest = ( entries[loc] = value; }); } - if (input.VpcPeeringConnectionId !== undefined) { + if (input.VpcPeeringConnectionId !== undefined && input.VpcPeeringConnectionId !== null) { entries["VpcPeeringConnectionId"] = input.VpcPeeringConnectionId; } return entries; @@ -41814,13 +42081,13 @@ const serializeAws_ec2ModifyVpcPeeringConnectionOptionsRequest = ( const serializeAws_ec2ModifyVpcTenancyRequest = (input: ModifyVpcTenancyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.InstanceTenancy !== undefined) { + if (input.InstanceTenancy !== undefined && input.InstanceTenancy !== null) { entries["InstanceTenancy"] = input.InstanceTenancy; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41831,22 +42098,22 @@ const serializeAws_ec2ModifyVpnConnectionOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VpnConnectionId !== undefined) { + if (input.VpnConnectionId !== undefined && input.VpnConnectionId !== null) { entries["VpnConnectionId"] = input.VpnConnectionId; } - if (input.LocalIpv4NetworkCidr !== undefined) { + if (input.LocalIpv4NetworkCidr !== undefined && input.LocalIpv4NetworkCidr !== null) { entries["LocalIpv4NetworkCidr"] = input.LocalIpv4NetworkCidr; } - if (input.RemoteIpv4NetworkCidr !== undefined) { + if (input.RemoteIpv4NetworkCidr !== undefined && input.RemoteIpv4NetworkCidr !== null) { entries["RemoteIpv4NetworkCidr"] = input.RemoteIpv4NetworkCidr; } - if (input.LocalIpv6NetworkCidr !== undefined) { + if (input.LocalIpv6NetworkCidr !== undefined && input.LocalIpv6NetworkCidr !== null) { entries["LocalIpv6NetworkCidr"] = input.LocalIpv6NetworkCidr; } - if (input.RemoteIpv6NetworkCidr !== undefined) { + if (input.RemoteIpv6NetworkCidr !== undefined && input.RemoteIpv6NetworkCidr !== null) { entries["RemoteIpv6NetworkCidr"] = input.RemoteIpv6NetworkCidr; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41857,19 +42124,19 @@ const serializeAws_ec2ModifyVpnConnectionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VpnConnectionId !== undefined) { + if (input.VpnConnectionId !== undefined && input.VpnConnectionId !== null) { entries["VpnConnectionId"] = input.VpnConnectionId; } - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.CustomerGatewayId !== undefined) { + if (input.CustomerGatewayId !== undefined && input.CustomerGatewayId !== null) { entries["CustomerGatewayId"] = input.CustomerGatewayId; } - if (input.VpnGatewayId !== undefined) { + if (input.VpnGatewayId !== undefined && input.VpnGatewayId !== null) { entries["VpnGatewayId"] = input.VpnGatewayId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41880,13 +42147,13 @@ const serializeAws_ec2ModifyVpnTunnelCertificateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VpnConnectionId !== undefined) { + if (input.VpnConnectionId !== undefined && input.VpnConnectionId !== null) { entries["VpnConnectionId"] = input.VpnConnectionId; } - if (input.VpnTunnelOutsideIpAddress !== undefined) { + if (input.VpnTunnelOutsideIpAddress !== undefined && input.VpnTunnelOutsideIpAddress !== null) { entries["VpnTunnelOutsideIpAddress"] = input.VpnTunnelOutsideIpAddress; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41897,20 +42164,20 @@ const serializeAws_ec2ModifyVpnTunnelOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VpnConnectionId !== undefined) { + if (input.VpnConnectionId !== undefined && input.VpnConnectionId !== null) { entries["VpnConnectionId"] = input.VpnConnectionId; } - if (input.VpnTunnelOutsideIpAddress !== undefined) { + if (input.VpnTunnelOutsideIpAddress !== undefined && input.VpnTunnelOutsideIpAddress !== null) { entries["VpnTunnelOutsideIpAddress"] = input.VpnTunnelOutsideIpAddress; } - if (input.TunnelOptions !== undefined) { + if (input.TunnelOptions !== undefined && input.TunnelOptions !== null) { const memberEntries = serializeAws_ec2ModifyVpnTunnelOptionsSpecification(input.TunnelOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TunnelOptions.${key}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -41921,37 +42188,37 @@ const serializeAws_ec2ModifyVpnTunnelOptionsSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TunnelInsideCidr !== undefined) { + if (input.TunnelInsideCidr !== undefined && input.TunnelInsideCidr !== null) { entries["TunnelInsideCidr"] = input.TunnelInsideCidr; } - if (input.TunnelInsideIpv6Cidr !== undefined) { + if (input.TunnelInsideIpv6Cidr !== undefined && input.TunnelInsideIpv6Cidr !== null) { entries["TunnelInsideIpv6Cidr"] = input.TunnelInsideIpv6Cidr; } - if (input.PreSharedKey !== undefined) { + if (input.PreSharedKey !== undefined && input.PreSharedKey !== null) { entries["PreSharedKey"] = input.PreSharedKey; } - if (input.Phase1LifetimeSeconds !== undefined) { + if (input.Phase1LifetimeSeconds !== undefined && input.Phase1LifetimeSeconds !== null) { entries["Phase1LifetimeSeconds"] = input.Phase1LifetimeSeconds; } - if (input.Phase2LifetimeSeconds !== undefined) { + if (input.Phase2LifetimeSeconds !== undefined && input.Phase2LifetimeSeconds !== null) { entries["Phase2LifetimeSeconds"] = input.Phase2LifetimeSeconds; } - if (input.RekeyMarginTimeSeconds !== undefined) { + if (input.RekeyMarginTimeSeconds !== undefined && input.RekeyMarginTimeSeconds !== null) { entries["RekeyMarginTimeSeconds"] = input.RekeyMarginTimeSeconds; } - if (input.RekeyFuzzPercentage !== undefined) { + if (input.RekeyFuzzPercentage !== undefined && input.RekeyFuzzPercentage !== null) { entries["RekeyFuzzPercentage"] = input.RekeyFuzzPercentage; } - if (input.ReplayWindowSize !== undefined) { + if (input.ReplayWindowSize !== undefined && input.ReplayWindowSize !== null) { entries["ReplayWindowSize"] = input.ReplayWindowSize; } - if (input.DPDTimeoutSeconds !== undefined) { + if (input.DPDTimeoutSeconds !== undefined && input.DPDTimeoutSeconds !== null) { entries["DPDTimeoutSeconds"] = input.DPDTimeoutSeconds; } - if (input.DPDTimeoutAction !== undefined) { + if (input.DPDTimeoutAction !== undefined && input.DPDTimeoutAction !== null) { entries["DPDTimeoutAction"] = input.DPDTimeoutAction; } - if (input.Phase1EncryptionAlgorithms !== undefined) { + if (input.Phase1EncryptionAlgorithms !== undefined && input.Phase1EncryptionAlgorithms !== null) { const memberEntries = serializeAws_ec2Phase1EncryptionAlgorithmsRequestList( input.Phase1EncryptionAlgorithms, context @@ -41961,7 +42228,7 @@ const serializeAws_ec2ModifyVpnTunnelOptionsSpecification = ( entries[loc] = value; }); } - if (input.Phase2EncryptionAlgorithms !== undefined) { + if (input.Phase2EncryptionAlgorithms !== undefined && input.Phase2EncryptionAlgorithms !== null) { const memberEntries = serializeAws_ec2Phase2EncryptionAlgorithmsRequestList( input.Phase2EncryptionAlgorithms, context @@ -41971,7 +42238,7 @@ const serializeAws_ec2ModifyVpnTunnelOptionsSpecification = ( entries[loc] = value; }); } - if (input.Phase1IntegrityAlgorithms !== undefined) { + if (input.Phase1IntegrityAlgorithms !== undefined && input.Phase1IntegrityAlgorithms !== null) { const memberEntries = serializeAws_ec2Phase1IntegrityAlgorithmsRequestList( input.Phase1IntegrityAlgorithms, context @@ -41981,7 +42248,7 @@ const serializeAws_ec2ModifyVpnTunnelOptionsSpecification = ( entries[loc] = value; }); } - if (input.Phase2IntegrityAlgorithms !== undefined) { + if (input.Phase2IntegrityAlgorithms !== undefined && input.Phase2IntegrityAlgorithms !== null) { const memberEntries = serializeAws_ec2Phase2IntegrityAlgorithmsRequestList( input.Phase2IntegrityAlgorithms, context @@ -41991,28 +42258,28 @@ const serializeAws_ec2ModifyVpnTunnelOptionsSpecification = ( entries[loc] = value; }); } - if (input.Phase1DHGroupNumbers !== undefined) { + if (input.Phase1DHGroupNumbers !== undefined && input.Phase1DHGroupNumbers !== null) { const memberEntries = serializeAws_ec2Phase1DHGroupNumbersRequestList(input.Phase1DHGroupNumbers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Phase1DHGroupNumber.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Phase2DHGroupNumbers !== undefined) { + if (input.Phase2DHGroupNumbers !== undefined && input.Phase2DHGroupNumbers !== null) { const memberEntries = serializeAws_ec2Phase2DHGroupNumbersRequestList(input.Phase2DHGroupNumbers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Phase2DHGroupNumber.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.IKEVersions !== undefined) { + if (input.IKEVersions !== undefined && input.IKEVersions !== null) { const memberEntries = serializeAws_ec2IKEVersionsRequestList(input.IKEVersions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IKEVersion.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.StartupAction !== undefined) { + if (input.StartupAction !== undefined && input.StartupAction !== null) { entries["StartupAction"] = input.StartupAction; } return entries; @@ -42020,14 +42287,14 @@ const serializeAws_ec2ModifyVpnTunnelOptionsSpecification = ( const serializeAws_ec2MonitorInstancesRequest = (input: MonitorInstancesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -42035,10 +42302,10 @@ const serializeAws_ec2MonitorInstancesRequest = (input: MonitorInstancesRequest, const serializeAws_ec2MoveAddressToVpcRequest = (input: MoveAddressToVpcRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PublicIp !== undefined) { + if (input.PublicIp !== undefined && input.PublicIp !== null) { entries["PublicIp"] = input.PublicIp; } return entries; @@ -42048,6 +42315,9 @@ const serializeAws_ec2NatGatewayIdStringList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -42058,6 +42328,9 @@ const serializeAws_ec2NetworkAclIdStringList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -42068,6 +42341,9 @@ const serializeAws_ec2NetworkInsightsAnalysisIdList = (input: string[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -42078,6 +42354,9 @@ const serializeAws_ec2NetworkInsightsPathIdList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -42089,10 +42368,10 @@ const serializeAws_ec2NetworkInterfaceAttachmentChanges = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AttachmentId !== undefined) { + if (input.AttachmentId !== undefined && input.AttachmentId !== null) { entries["AttachmentId"] = input.AttachmentId; } - if (input.DeleteOnTermination !== undefined) { + if (input.DeleteOnTermination !== undefined && input.DeleteOnTermination !== null) { entries["DeleteOnTermination"] = input.DeleteOnTermination; } return entries; @@ -42102,6 +42381,9 @@ const serializeAws_ec2NetworkInterfaceIdList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -42112,6 +42394,9 @@ const serializeAws_ec2NetworkInterfacePermissionIdList = (input: string[], conte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -42120,10 +42405,10 @@ const serializeAws_ec2NetworkInterfacePermissionIdList = (input: string[], conte const serializeAws_ec2NewDhcpConfiguration = (input: NewDhcpConfiguration, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Value.${key.substring(key.indexOf(".") + 1)}`; @@ -42137,6 +42422,9 @@ const serializeAws_ec2NewDhcpConfigurationList = (input: NewDhcpConfiguration[], const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2NewDhcpConfiguration(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42150,6 +42438,9 @@ const serializeAws_ec2OccurrenceDayRequestSet = (input: number[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`OccurenceDay.${counter}`] = entry; counter++; } @@ -42158,26 +42449,26 @@ const serializeAws_ec2OccurrenceDayRequestSet = (input: number[], context: __Ser const serializeAws_ec2OnDemandOptionsRequest = (input: OnDemandOptionsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AllocationStrategy !== undefined) { + if (input.AllocationStrategy !== undefined && input.AllocationStrategy !== null) { entries["AllocationStrategy"] = input.AllocationStrategy; } - if (input.CapacityReservationOptions !== undefined) { + if (input.CapacityReservationOptions !== undefined && input.CapacityReservationOptions !== null) { const memberEntries = serializeAws_ec2CapacityReservationOptionsRequest(input.CapacityReservationOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CapacityReservationOptions.${key}`; entries[loc] = value; }); } - if (input.SingleInstanceType !== undefined) { + if (input.SingleInstanceType !== undefined && input.SingleInstanceType !== null) { entries["SingleInstanceType"] = input.SingleInstanceType; } - if (input.SingleAvailabilityZone !== undefined) { + if (input.SingleAvailabilityZone !== undefined && input.SingleAvailabilityZone !== null) { entries["SingleAvailabilityZone"] = input.SingleAvailabilityZone; } - if (input.MinTargetCapacity !== undefined) { + if (input.MinTargetCapacity !== undefined && input.MinTargetCapacity !== null) { entries["MinTargetCapacity"] = input.MinTargetCapacity; } - if (input.MaxTotalPrice !== undefined) { + if (input.MaxTotalPrice !== undefined && input.MaxTotalPrice !== null) { entries["MaxTotalPrice"] = input.MaxTotalPrice; } return entries; @@ -42187,6 +42478,9 @@ const serializeAws_ec2OwnerStringList = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Owner.${counter}`] = entry; counter++; } @@ -42198,13 +42492,19 @@ const serializeAws_ec2PeeringConnectionOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AllowDnsResolutionFromRemoteVpc !== undefined) { + if (input.AllowDnsResolutionFromRemoteVpc !== undefined && input.AllowDnsResolutionFromRemoteVpc !== null) { entries["AllowDnsResolutionFromRemoteVpc"] = input.AllowDnsResolutionFromRemoteVpc; } - if (input.AllowEgressFromLocalClassicLinkToRemoteVpc !== undefined) { + if ( + input.AllowEgressFromLocalClassicLinkToRemoteVpc !== undefined && + input.AllowEgressFromLocalClassicLinkToRemoteVpc !== null + ) { entries["AllowEgressFromLocalClassicLinkToRemoteVpc"] = input.AllowEgressFromLocalClassicLinkToRemoteVpc; } - if (input.AllowEgressFromLocalVpcToRemoteClassicLink !== undefined) { + if ( + input.AllowEgressFromLocalVpcToRemoteClassicLink !== undefined && + input.AllowEgressFromLocalVpcToRemoteClassicLink !== null + ) { entries["AllowEgressFromLocalVpcToRemoteClassicLink"] = input.AllowEgressFromLocalVpcToRemoteClassicLink; } return entries; @@ -42217,6 +42517,9 @@ const serializeAws_ec2Phase1DHGroupNumbersRequestList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2Phase1DHGroupNumbersRequestListValue(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42231,7 +42534,7 @@ const serializeAws_ec2Phase1DHGroupNumbersRequestListValue = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -42244,6 +42547,9 @@ const serializeAws_ec2Phase1EncryptionAlgorithmsRequestList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2Phase1EncryptionAlgorithmsRequestListValue(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42258,7 +42564,7 @@ const serializeAws_ec2Phase1EncryptionAlgorithmsRequestListValue = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -42271,6 +42577,9 @@ const serializeAws_ec2Phase1IntegrityAlgorithmsRequestList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2Phase1IntegrityAlgorithmsRequestListValue(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42285,7 +42594,7 @@ const serializeAws_ec2Phase1IntegrityAlgorithmsRequestListValue = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -42298,6 +42607,9 @@ const serializeAws_ec2Phase2DHGroupNumbersRequestList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2Phase2DHGroupNumbersRequestListValue(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42312,7 +42624,7 @@ const serializeAws_ec2Phase2DHGroupNumbersRequestListValue = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -42325,6 +42637,9 @@ const serializeAws_ec2Phase2EncryptionAlgorithmsRequestList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2Phase2EncryptionAlgorithmsRequestListValue(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42339,7 +42654,7 @@ const serializeAws_ec2Phase2EncryptionAlgorithmsRequestListValue = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -42352,6 +42667,9 @@ const serializeAws_ec2Phase2IntegrityAlgorithmsRequestList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2Phase2IntegrityAlgorithmsRequestListValue(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42366,7 +42684,7 @@ const serializeAws_ec2Phase2IntegrityAlgorithmsRequestListValue = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -42374,28 +42692,28 @@ const serializeAws_ec2Phase2IntegrityAlgorithmsRequestListValue = ( const serializeAws_ec2Placement = (input: Placement, context: __SerdeContext): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Affinity !== undefined) { + if (input.Affinity !== undefined && input.Affinity !== null) { entries["Affinity"] = input.Affinity; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.PartitionNumber !== undefined) { + if (input.PartitionNumber !== undefined && input.PartitionNumber !== null) { entries["PartitionNumber"] = input.PartitionNumber; } - if (input.HostId !== undefined) { + if (input.HostId !== undefined && input.HostId !== null) { entries["HostId"] = input.HostId; } - if (input.Tenancy !== undefined) { + if (input.Tenancy !== undefined && input.Tenancy !== null) { entries["Tenancy"] = input.Tenancy; } - if (input.SpreadDomain !== undefined) { + if (input.SpreadDomain !== undefined && input.SpreadDomain !== null) { entries["SpreadDomain"] = input.SpreadDomain; } - if (input.HostResourceGroupArn !== undefined) { + if (input.HostResourceGroupArn !== undefined && input.HostResourceGroupArn !== null) { entries["HostResourceGroupArn"] = input.HostResourceGroupArn; } return entries; @@ -42405,6 +42723,9 @@ const serializeAws_ec2PlacementGroupIdStringList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`GroupId.${counter}`] = entry; counter++; } @@ -42415,6 +42736,9 @@ const serializeAws_ec2PlacementGroupStringList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -42423,10 +42747,10 @@ const serializeAws_ec2PlacementGroupStringList = (input: string[], context: __Se const serializeAws_ec2PortRange = (input: PortRange, context: __SerdeContext): any => { const entries: any = {}; - if (input.From !== undefined) { + if (input.From !== undefined && input.From !== null) { entries["From"] = input.From; } - if (input.To !== undefined) { + if (input.To !== undefined && input.To !== null) { entries["To"] = input.To; } return entries; @@ -42434,10 +42758,10 @@ const serializeAws_ec2PortRange = (input: PortRange, context: __SerdeContext): a const serializeAws_ec2PrefixListId = (input: PrefixListId, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.PrefixListId !== undefined) { + if (input.PrefixListId !== undefined && input.PrefixListId !== null) { entries["PrefixListId"] = input.PrefixListId; } return entries; @@ -42447,6 +42771,9 @@ const serializeAws_ec2PrefixListIdList = (input: PrefixListId[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2PrefixListId(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42460,6 +42787,9 @@ const serializeAws_ec2PrefixListResourceIdStringList = (input: string[], context const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -42471,13 +42801,13 @@ const serializeAws_ec2PriceScheduleSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CurrencyCode !== undefined) { + if (input.CurrencyCode !== undefined && input.CurrencyCode !== null) { entries["CurrencyCode"] = input.CurrencyCode; } - if (input.Price !== undefined) { + if (input.Price !== undefined && input.Price !== null) { entries["Price"] = input.Price; } - if (input.Term !== undefined) { + if (input.Term !== undefined && input.Term !== null) { entries["Term"] = input.Term; } return entries; @@ -42490,6 +42820,9 @@ const serializeAws_ec2PriceScheduleSpecificationList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2PriceScheduleSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42506,6 +42839,9 @@ const serializeAws_ec2PrivateIpAddressConfigSet = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ScheduledInstancesPrivateIpAddressConfig(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`PrivateIpAddressConfigSet.${counter}.${key}`] = value; @@ -42520,10 +42856,10 @@ const serializeAws_ec2PrivateIpAddressSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Primary !== undefined) { + if (input.Primary !== undefined && input.Primary !== null) { entries["Primary"] = input.Primary; } - if (input.PrivateIpAddress !== undefined) { + if (input.PrivateIpAddress !== undefined && input.PrivateIpAddress !== null) { entries["PrivateIpAddress"] = input.PrivateIpAddress; } return entries; @@ -42536,6 +42872,9 @@ const serializeAws_ec2PrivateIpAddressSpecificationList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2PrivateIpAddressSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -42549,6 +42888,9 @@ const serializeAws_ec2PrivateIpAddressStringList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`PrivateIpAddress.${counter}`] = entry; counter++; } @@ -42559,6 +42901,9 @@ const serializeAws_ec2ProductCodeStringList = (input: string[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ProductCode.${counter}`] = entry; counter++; } @@ -42569,6 +42914,9 @@ const serializeAws_ec2ProductDescriptionList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -42577,26 +42925,26 @@ const serializeAws_ec2ProductDescriptionList = (input: string[], context: __Serd const serializeAws_ec2ProvisionByoipCidrRequest = (input: ProvisionByoipCidrRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Cidr !== undefined) { + if (input.Cidr !== undefined && input.Cidr !== null) { entries["Cidr"] = input.Cidr; } - if (input.CidrAuthorizationContext !== undefined) { + if (input.CidrAuthorizationContext !== undefined && input.CidrAuthorizationContext !== null) { const memberEntries = serializeAws_ec2CidrAuthorizationContext(input.CidrAuthorizationContext, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CidrAuthorizationContext.${key}`; entries[loc] = value; }); } - if (input.PubliclyAdvertisable !== undefined) { + if (input.PubliclyAdvertisable !== undefined && input.PubliclyAdvertisable !== null) { entries["PubliclyAdvertisable"] = input.PubliclyAdvertisable; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PoolTagSpecifications !== undefined) { + if (input.PoolTagSpecifications !== undefined && input.PoolTagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.PoolTagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PoolTagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -42610,6 +42958,9 @@ const serializeAws_ec2PublicIpStringList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`PublicIp.${counter}`] = entry; counter++; } @@ -42620,6 +42971,9 @@ const serializeAws_ec2PublicIpv4PoolIdStringList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -42631,26 +42985,26 @@ const serializeAws_ec2PurchaseHostReservationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.CurrencyCode !== undefined) { + if (input.CurrencyCode !== undefined && input.CurrencyCode !== null) { entries["CurrencyCode"] = input.CurrencyCode; } - if (input.HostIdSet !== undefined) { + if (input.HostIdSet !== undefined && input.HostIdSet !== null) { const memberEntries = serializeAws_ec2RequestHostIdSet(input.HostIdSet, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HostIdSet.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.LimitPrice !== undefined) { + if (input.LimitPrice !== undefined && input.LimitPrice !== null) { entries["LimitPrice"] = input.LimitPrice; } - if (input.OfferingId !== undefined) { + if (input.OfferingId !== undefined && input.OfferingId !== null) { entries["OfferingId"] = input.OfferingId; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -42662,10 +43016,10 @@ const serializeAws_ec2PurchaseHostReservationRequest = ( const serializeAws_ec2PurchaseRequest = (input: PurchaseRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceCount !== undefined) { + if (input.InstanceCount !== undefined && input.InstanceCount !== null) { entries["InstanceCount"] = input.InstanceCount; } - if (input.PurchaseToken !== undefined) { + if (input.PurchaseToken !== undefined && input.PurchaseToken !== null) { entries["PurchaseToken"] = input.PurchaseToken; } return entries; @@ -42675,6 +43029,9 @@ const serializeAws_ec2PurchaseRequestSet = (input: PurchaseRequest[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2PurchaseRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`PurchaseRequest.${counter}.${key}`] = value; @@ -42689,23 +43046,23 @@ const serializeAws_ec2PurchaseReservedInstancesOfferingRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceCount !== undefined) { + if (input.InstanceCount !== undefined && input.InstanceCount !== null) { entries["InstanceCount"] = input.InstanceCount; } - if (input.ReservedInstancesOfferingId !== undefined) { + if (input.ReservedInstancesOfferingId !== undefined && input.ReservedInstancesOfferingId !== null) { entries["ReservedInstancesOfferingId"] = input.ReservedInstancesOfferingId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.LimitPrice !== undefined) { + if (input.LimitPrice !== undefined && input.LimitPrice !== null) { const memberEntries = serializeAws_ec2ReservedInstanceLimitPrice(input.LimitPrice, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LimitPrice.${key}`; entries[loc] = value; }); } - if (input.PurchaseTime !== undefined) { + if (input.PurchaseTime !== undefined && input.PurchaseTime !== null) { entries["PurchaseTime"] = input.PurchaseTime.toISOString().split(".")[0] + "Z"; } return entries; @@ -42719,13 +43076,13 @@ const serializeAws_ec2PurchaseScheduledInstancesRequest = ( if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PurchaseRequests !== undefined) { + if (input.PurchaseRequests !== undefined && input.PurchaseRequests !== null) { const memberEntries = serializeAws_ec2PurchaseRequestSet(input.PurchaseRequests, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PurchaseRequest.${key.substring(key.indexOf(".") + 1)}`; @@ -42742,6 +43099,9 @@ const serializeAws_ec2ReasonCodesList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -42750,14 +43110,14 @@ const serializeAws_ec2ReasonCodesList = ( const serializeAws_ec2RebootInstancesRequest = (input: RebootInstancesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -42767,6 +43127,9 @@ const serializeAws_ec2RegionNameStringList = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`RegionName.${counter}`] = entry; counter++; } @@ -42775,51 +43138,51 @@ const serializeAws_ec2RegionNameStringList = (input: string[], context: __SerdeC const serializeAws_ec2RegisterImageRequest = (input: RegisterImageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ImageLocation !== undefined) { + if (input.ImageLocation !== undefined && input.ImageLocation !== null) { entries["ImageLocation"] = input.ImageLocation; } - if (input.Architecture !== undefined) { + if (input.Architecture !== undefined && input.Architecture !== null) { entries["Architecture"] = input.Architecture; } - if (input.BlockDeviceMappings !== undefined) { + if (input.BlockDeviceMappings !== undefined && input.BlockDeviceMappings !== null) { const memberEntries = serializeAws_ec2BlockDeviceMappingRequestList(input.BlockDeviceMappings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BlockDeviceMapping.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.EnaSupport !== undefined) { + if (input.EnaSupport !== undefined && input.EnaSupport !== null) { entries["EnaSupport"] = input.EnaSupport; } - if (input.KernelId !== undefined) { + if (input.KernelId !== undefined && input.KernelId !== null) { entries["KernelId"] = input.KernelId; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.BillingProducts !== undefined) { + if (input.BillingProducts !== undefined && input.BillingProducts !== null) { const memberEntries = serializeAws_ec2BillingProductList(input.BillingProducts, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BillingProduct.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.RamdiskId !== undefined) { + if (input.RamdiskId !== undefined && input.RamdiskId !== null) { entries["RamdiskId"] = input.RamdiskId; } - if (input.RootDeviceName !== undefined) { + if (input.RootDeviceName !== undefined && input.RootDeviceName !== null) { entries["RootDeviceName"] = input.RootDeviceName; } - if (input.SriovNetSupport !== undefined) { + if (input.SriovNetSupport !== undefined && input.SriovNetSupport !== null) { entries["SriovNetSupport"] = input.SriovNetSupport; } - if (input.VirtualizationType !== undefined) { + if (input.VirtualizationType !== undefined && input.VirtualizationType !== null) { entries["VirtualizationType"] = input.VirtualizationType; } return entries; @@ -42830,10 +43193,10 @@ const serializeAws_ec2RegisterInstanceEventNotificationAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceTagAttribute !== undefined) { + if (input.InstanceTagAttribute !== undefined && input.InstanceTagAttribute !== null) { const memberEntries = serializeAws_ec2RegisterInstanceTagAttributeRequest(input.InstanceTagAttribute, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceTagAttribute.${key}`; @@ -42848,10 +43211,10 @@ const serializeAws_ec2RegisterInstanceTagAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.IncludeAllTagsOfInstance !== undefined) { + if (input.IncludeAllTagsOfInstance !== undefined && input.IncludeAllTagsOfInstance !== null) { entries["IncludeAllTagsOfInstance"] = input.IncludeAllTagsOfInstance; } - if (input.InstanceTagKeys !== undefined) { + if (input.InstanceTagKeys !== undefined && input.InstanceTagKeys !== null) { const memberEntries = serializeAws_ec2InstanceTagKeySet(input.InstanceTagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceTagKey.${key.substring(key.indexOf(".") + 1)}`; @@ -42866,20 +43229,20 @@ const serializeAws_ec2RegisterTransitGatewayMulticastGroupMembersRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.GroupIpAddress !== undefined) { + if (input.GroupIpAddress !== undefined && input.GroupIpAddress !== null) { entries["GroupIpAddress"] = input.GroupIpAddress; } - if (input.NetworkInterfaceIds !== undefined) { + if (input.NetworkInterfaceIds !== undefined && input.NetworkInterfaceIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayNetworkInterfaceIdList(input.NetworkInterfaceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInterfaceIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -42890,20 +43253,20 @@ const serializeAws_ec2RegisterTransitGatewayMulticastGroupSourcesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.GroupIpAddress !== undefined) { + if (input.GroupIpAddress !== undefined && input.GroupIpAddress !== null) { entries["GroupIpAddress"] = input.GroupIpAddress; } - if (input.NetworkInterfaceIds !== undefined) { + if (input.NetworkInterfaceIds !== undefined && input.NetworkInterfaceIds !== null) { const memberEntries = serializeAws_ec2TransitGatewayNetworkInterfaceIdList(input.NetworkInterfaceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInterfaceIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -42914,20 +43277,20 @@ const serializeAws_ec2RejectTransitGatewayMulticastDomainAssociationsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_ec2ValueStringList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -42938,10 +43301,10 @@ const serializeAws_ec2RejectTransitGatewayPeeringAttachmentRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -42952,10 +43315,10 @@ const serializeAws_ec2RejectTransitGatewayVpcAttachmentRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -42966,13 +43329,13 @@ const serializeAws_ec2RejectVpcEndpointConnectionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceId !== undefined) { + if (input.ServiceId !== undefined && input.ServiceId !== null) { entries["ServiceId"] = input.ServiceId; } - if (input.VpcEndpointIds !== undefined) { + if (input.VpcEndpointIds !== undefined && input.VpcEndpointIds !== null) { const memberEntries = serializeAws_ec2VpcEndpointIdList(input.VpcEndpointIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcEndpointId.${key.substring(key.indexOf(".") + 1)}`; @@ -42987,10 +43350,10 @@ const serializeAws_ec2RejectVpcPeeringConnectionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcPeeringConnectionId !== undefined) { + if (input.VpcPeeringConnectionId !== undefined && input.VpcPeeringConnectionId !== null) { entries["VpcPeeringConnectionId"] = input.VpcPeeringConnectionId; } return entries; @@ -42998,16 +43361,16 @@ const serializeAws_ec2RejectVpcPeeringConnectionRequest = ( const serializeAws_ec2ReleaseAddressRequest = (input: ReleaseAddressRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AllocationId !== undefined) { + if (input.AllocationId !== undefined && input.AllocationId !== null) { entries["AllocationId"] = input.AllocationId; } - if (input.PublicIp !== undefined) { + if (input.PublicIp !== undefined && input.PublicIp !== null) { entries["PublicIp"] = input.PublicIp; } - if (input.NetworkBorderGroup !== undefined) { + if (input.NetworkBorderGroup !== undefined && input.NetworkBorderGroup !== null) { entries["NetworkBorderGroup"] = input.NetworkBorderGroup; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -43015,7 +43378,7 @@ const serializeAws_ec2ReleaseAddressRequest = (input: ReleaseAddressRequest, con const serializeAws_ec2ReleaseHostsRequest = (input: ReleaseHostsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.HostIds !== undefined) { + if (input.HostIds !== undefined && input.HostIds !== null) { const memberEntries = serializeAws_ec2RequestHostIdList(input.HostIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HostId.${key.substring(key.indexOf(".") + 1)}`; @@ -43029,6 +43392,9 @@ const serializeAws_ec2RemovePrefixListEntries = (input: RemovePrefixListEntry[], const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2RemovePrefixListEntry(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Member.${counter}.${key}`] = value; @@ -43040,7 +43406,7 @@ const serializeAws_ec2RemovePrefixListEntries = (input: RemovePrefixListEntry[], const serializeAws_ec2RemovePrefixListEntry = (input: RemovePrefixListEntry, context: __SerdeContext): any => { const entries: any = {}; - if (input.Cidr !== undefined) { + if (input.Cidr !== undefined && input.Cidr !== null) { entries["Cidr"] = input.Cidr; } return entries; @@ -43051,14 +43417,14 @@ const serializeAws_ec2ReplaceIamInstanceProfileAssociationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.IamInstanceProfile !== undefined) { + if (input.IamInstanceProfile !== undefined && input.IamInstanceProfile !== null) { const memberEntries = serializeAws_ec2IamInstanceProfileSpecification(input.IamInstanceProfile, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IamInstanceProfile.${key}`; entries[loc] = value; }); } - if (input.AssociationId !== undefined) { + if (input.AssociationId !== undefined && input.AssociationId !== null) { entries["AssociationId"] = input.AssociationId; } return entries; @@ -43069,13 +43435,13 @@ const serializeAws_ec2ReplaceNetworkAclAssociationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociationId !== undefined) { + if (input.AssociationId !== undefined && input.AssociationId !== null) { entries["AssociationId"] = input.AssociationId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkAclId !== undefined) { + if (input.NetworkAclId !== undefined && input.NetworkAclId !== null) { entries["NetworkAclId"] = input.NetworkAclId; } return entries; @@ -43086,42 +43452,42 @@ const serializeAws_ec2ReplaceNetworkAclEntryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CidrBlock !== undefined) { + if (input.CidrBlock !== undefined && input.CidrBlock !== null) { entries["CidrBlock"] = input.CidrBlock; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Egress !== undefined) { + if (input.Egress !== undefined && input.Egress !== null) { entries["Egress"] = input.Egress; } - if (input.IcmpTypeCode !== undefined) { + if (input.IcmpTypeCode !== undefined && input.IcmpTypeCode !== null) { const memberEntries = serializeAws_ec2IcmpTypeCode(input.IcmpTypeCode, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Icmp.${key}`; entries[loc] = value; }); } - if (input.Ipv6CidrBlock !== undefined) { + if (input.Ipv6CidrBlock !== undefined && input.Ipv6CidrBlock !== null) { entries["Ipv6CidrBlock"] = input.Ipv6CidrBlock; } - if (input.NetworkAclId !== undefined) { + if (input.NetworkAclId !== undefined && input.NetworkAclId !== null) { entries["NetworkAclId"] = input.NetworkAclId; } - if (input.PortRange !== undefined) { + if (input.PortRange !== undefined && input.PortRange !== null) { const memberEntries = serializeAws_ec2PortRange(input.PortRange, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PortRange.${key}`; entries[loc] = value; }); } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.RuleAction !== undefined) { + if (input.RuleAction !== undefined && input.RuleAction !== null) { entries["RuleAction"] = input.RuleAction; } - if (input.RuleNumber !== undefined) { + if (input.RuleNumber !== undefined && input.RuleNumber !== null) { entries["RuleNumber"] = input.RuleNumber; } return entries; @@ -43129,52 +43495,52 @@ const serializeAws_ec2ReplaceNetworkAclEntryRequest = ( const serializeAws_ec2ReplaceRouteRequest = (input: ReplaceRouteRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.DestinationIpv6CidrBlock !== undefined) { + if (input.DestinationIpv6CidrBlock !== undefined && input.DestinationIpv6CidrBlock !== null) { entries["DestinationIpv6CidrBlock"] = input.DestinationIpv6CidrBlock; } - if (input.DestinationPrefixListId !== undefined) { + if (input.DestinationPrefixListId !== undefined && input.DestinationPrefixListId !== null) { entries["DestinationPrefixListId"] = input.DestinationPrefixListId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.VpcEndpointId !== undefined) { + if (input.VpcEndpointId !== undefined && input.VpcEndpointId !== null) { entries["VpcEndpointId"] = input.VpcEndpointId; } - if (input.EgressOnlyInternetGatewayId !== undefined) { + if (input.EgressOnlyInternetGatewayId !== undefined && input.EgressOnlyInternetGatewayId !== null) { entries["EgressOnlyInternetGatewayId"] = input.EgressOnlyInternetGatewayId; } - if (input.GatewayId !== undefined) { + if (input.GatewayId !== undefined && input.GatewayId !== null) { entries["GatewayId"] = input.GatewayId; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.LocalTarget !== undefined) { + if (input.LocalTarget !== undefined && input.LocalTarget !== null) { entries["LocalTarget"] = input.LocalTarget; } - if (input.NatGatewayId !== undefined) { + if (input.NatGatewayId !== undefined && input.NatGatewayId !== null) { entries["NatGatewayId"] = input.NatGatewayId; } - if (input.TransitGatewayId !== undefined) { + if (input.TransitGatewayId !== undefined && input.TransitGatewayId !== null) { entries["TransitGatewayId"] = input.TransitGatewayId; } - if (input.LocalGatewayId !== undefined) { + if (input.LocalGatewayId !== undefined && input.LocalGatewayId !== null) { entries["LocalGatewayId"] = input.LocalGatewayId; } - if (input.CarrierGatewayId !== undefined) { + if (input.CarrierGatewayId !== undefined && input.CarrierGatewayId !== null) { entries["CarrierGatewayId"] = input.CarrierGatewayId; } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.RouteTableId !== undefined) { + if (input.RouteTableId !== undefined && input.RouteTableId !== null) { entries["RouteTableId"] = input.RouteTableId; } - if (input.VpcPeeringConnectionId !== undefined) { + if (input.VpcPeeringConnectionId !== undefined && input.VpcPeeringConnectionId !== null) { entries["VpcPeeringConnectionId"] = input.VpcPeeringConnectionId; } return entries; @@ -43185,13 +43551,13 @@ const serializeAws_ec2ReplaceRouteTableAssociationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociationId !== undefined) { + if (input.AssociationId !== undefined && input.AssociationId !== null) { entries["AssociationId"] = input.AssociationId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.RouteTableId !== undefined) { + if (input.RouteTableId !== undefined && input.RouteTableId !== null) { entries["RouteTableId"] = input.RouteTableId; } return entries; @@ -43202,19 +43568,19 @@ const serializeAws_ec2ReplaceTransitGatewayRouteRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DestinationCidrBlock !== undefined) { + if (input.DestinationCidrBlock !== undefined && input.DestinationCidrBlock !== null) { entries["DestinationCidrBlock"] = input.DestinationCidrBlock; } - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.TransitGatewayAttachmentId !== undefined) { + if (input.TransitGatewayAttachmentId !== undefined && input.TransitGatewayAttachmentId !== null) { entries["TransitGatewayAttachmentId"] = input.TransitGatewayAttachmentId; } - if (input.Blackhole !== undefined) { + if (input.Blackhole !== undefined && input.Blackhole !== null) { entries["Blackhole"] = input.Blackhole; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -43225,33 +43591,33 @@ const serializeAws_ec2ReportInstanceStatusRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Instances !== undefined) { + if (input.Instances !== undefined && input.Instances !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.Instances, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ReasonCodes !== undefined) { + if (input.ReasonCodes !== undefined && input.ReasonCodes !== null) { const memberEntries = serializeAws_ec2ReasonCodesList(input.ReasonCodes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReasonCode.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { entries["Status"] = input.Status; } return entries; @@ -43261,6 +43627,9 @@ const serializeAws_ec2RequestHostIdList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -43271,6 +43640,9 @@ const serializeAws_ec2RequestHostIdSet = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -43281,6 +43653,9 @@ const serializeAws_ec2RequestInstanceTypeList = (input: (_InstanceType | string) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -43289,13 +43664,13 @@ const serializeAws_ec2RequestInstanceTypeList = (input: (_InstanceType | string) const serializeAws_ec2RequestLaunchTemplateData = (input: RequestLaunchTemplateData, context: __SerdeContext): any => { const entries: any = {}; - if (input.KernelId !== undefined) { + if (input.KernelId !== undefined && input.KernelId !== null) { entries["KernelId"] = input.KernelId; } - if (input.EbsOptimized !== undefined) { + if (input.EbsOptimized !== undefined && input.EbsOptimized !== null) { entries["EbsOptimized"] = input.EbsOptimized; } - if (input.IamInstanceProfile !== undefined) { + if (input.IamInstanceProfile !== undefined && input.IamInstanceProfile !== null) { const memberEntries = serializeAws_ec2LaunchTemplateIamInstanceProfileSpecificationRequest( input.IamInstanceProfile, context @@ -43305,7 +43680,7 @@ const serializeAws_ec2RequestLaunchTemplateData = (input: RequestLaunchTemplateD entries[loc] = value; }); } - if (input.BlockDeviceMappings !== undefined) { + if (input.BlockDeviceMappings !== undefined && input.BlockDeviceMappings !== null) { const memberEntries = serializeAws_ec2LaunchTemplateBlockDeviceMappingRequestList( input.BlockDeviceMappings, context @@ -43315,7 +43690,7 @@ const serializeAws_ec2RequestLaunchTemplateData = (input: RequestLaunchTemplateD entries[loc] = value; }); } - if (input.NetworkInterfaces !== undefined) { + if (input.NetworkInterfaces !== undefined && input.NetworkInterfaces !== null) { const memberEntries = serializeAws_ec2LaunchTemplateInstanceNetworkInterfaceSpecificationRequestList( input.NetworkInterfaces, context @@ -43325,56 +43700,56 @@ const serializeAws_ec2RequestLaunchTemplateData = (input: RequestLaunchTemplateD entries[loc] = value; }); } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.KeyName !== undefined) { + if (input.KeyName !== undefined && input.KeyName !== null) { entries["KeyName"] = input.KeyName; } - if (input.Monitoring !== undefined) { + if (input.Monitoring !== undefined && input.Monitoring !== null) { const memberEntries = serializeAws_ec2LaunchTemplatesMonitoringRequest(input.Monitoring, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Monitoring.${key}`; entries[loc] = value; }); } - if (input.Placement !== undefined) { + if (input.Placement !== undefined && input.Placement !== null) { const memberEntries = serializeAws_ec2LaunchTemplatePlacementRequest(input.Placement, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Placement.${key}`; entries[loc] = value; }); } - if (input.RamDiskId !== undefined) { + if (input.RamDiskId !== undefined && input.RamDiskId !== null) { entries["RamDiskId"] = input.RamDiskId; } - if (input.DisableApiTermination !== undefined) { + if (input.DisableApiTermination !== undefined && input.DisableApiTermination !== null) { entries["DisableApiTermination"] = input.DisableApiTermination; } - if (input.InstanceInitiatedShutdownBehavior !== undefined) { + if (input.InstanceInitiatedShutdownBehavior !== undefined && input.InstanceInitiatedShutdownBehavior !== null) { entries["InstanceInitiatedShutdownBehavior"] = input.InstanceInitiatedShutdownBehavior; } - if (input.UserData !== undefined) { + if (input.UserData !== undefined && input.UserData !== null) { entries["UserData"] = input.UserData; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2LaunchTemplateTagSpecificationRequestList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ElasticGpuSpecifications !== undefined) { + if (input.ElasticGpuSpecifications !== undefined && input.ElasticGpuSpecifications !== null) { const memberEntries = serializeAws_ec2ElasticGpuSpecificationList(input.ElasticGpuSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ElasticGpuSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ElasticInferenceAccelerators !== undefined) { + if (input.ElasticInferenceAccelerators !== undefined && input.ElasticInferenceAccelerators !== null) { const memberEntries = serializeAws_ec2LaunchTemplateElasticInferenceAcceleratorList( input.ElasticInferenceAccelerators, context @@ -43384,21 +43759,21 @@ const serializeAws_ec2RequestLaunchTemplateData = (input: RequestLaunchTemplateD entries[loc] = value; }); } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_ec2SecurityGroupIdStringList(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_ec2SecurityGroupStringList(input.SecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroup.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.InstanceMarketOptions !== undefined) { + if (input.InstanceMarketOptions !== undefined && input.InstanceMarketOptions !== null) { const memberEntries = serializeAws_ec2LaunchTemplateInstanceMarketOptionsRequest( input.InstanceMarketOptions, context @@ -43408,21 +43783,21 @@ const serializeAws_ec2RequestLaunchTemplateData = (input: RequestLaunchTemplateD entries[loc] = value; }); } - if (input.CreditSpecification !== undefined) { + if (input.CreditSpecification !== undefined && input.CreditSpecification !== null) { const memberEntries = serializeAws_ec2CreditSpecificationRequest(input.CreditSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CreditSpecification.${key}`; entries[loc] = value; }); } - if (input.CpuOptions !== undefined) { + if (input.CpuOptions !== undefined && input.CpuOptions !== null) { const memberEntries = serializeAws_ec2LaunchTemplateCpuOptionsRequest(input.CpuOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CpuOptions.${key}`; entries[loc] = value; }); } - if (input.CapacityReservationSpecification !== undefined) { + if (input.CapacityReservationSpecification !== undefined && input.CapacityReservationSpecification !== null) { const memberEntries = serializeAws_ec2LaunchTemplateCapacityReservationSpecificationRequest( input.CapacityReservationSpecification, context @@ -43432,7 +43807,7 @@ const serializeAws_ec2RequestLaunchTemplateData = (input: RequestLaunchTemplateD entries[loc] = value; }); } - if (input.LicenseSpecifications !== undefined) { + if (input.LicenseSpecifications !== undefined && input.LicenseSpecifications !== null) { const memberEntries = serializeAws_ec2LaunchTemplateLicenseSpecificationListRequest( input.LicenseSpecifications, context @@ -43442,21 +43817,21 @@ const serializeAws_ec2RequestLaunchTemplateData = (input: RequestLaunchTemplateD entries[loc] = value; }); } - if (input.HibernationOptions !== undefined) { + if (input.HibernationOptions !== undefined && input.HibernationOptions !== null) { const memberEntries = serializeAws_ec2LaunchTemplateHibernationOptionsRequest(input.HibernationOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HibernationOptions.${key}`; entries[loc] = value; }); } - if (input.MetadataOptions !== undefined) { + if (input.MetadataOptions !== undefined && input.MetadataOptions !== null) { const memberEntries = serializeAws_ec2LaunchTemplateInstanceMetadataOptionsRequest(input.MetadataOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MetadataOptions.${key}`; entries[loc] = value; }); } - if (input.EnclaveOptions !== undefined) { + if (input.EnclaveOptions !== undefined && input.EnclaveOptions !== null) { const memberEntries = serializeAws_ec2LaunchTemplateEnclaveOptionsRequest(input.EnclaveOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnclaveOptions.${key}`; @@ -43468,10 +43843,10 @@ const serializeAws_ec2RequestLaunchTemplateData = (input: RequestLaunchTemplateD const serializeAws_ec2RequestSpotFleetRequest = (input: RequestSpotFleetRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.SpotFleetRequestConfig !== undefined) { + if (input.SpotFleetRequestConfig !== undefined && input.SpotFleetRequestConfig !== null) { const memberEntries = serializeAws_ec2SpotFleetRequestConfigData(input.SpotFleetRequestConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SpotFleetRequestConfig.${key}`; @@ -43486,51 +43861,51 @@ const serializeAws_ec2RequestSpotInstancesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZoneGroup !== undefined) { + if (input.AvailabilityZoneGroup !== undefined && input.AvailabilityZoneGroup !== null) { entries["AvailabilityZoneGroup"] = input.AvailabilityZoneGroup; } - if (input.BlockDurationMinutes !== undefined) { + if (input.BlockDurationMinutes !== undefined && input.BlockDurationMinutes !== null) { entries["BlockDurationMinutes"] = input.BlockDurationMinutes; } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceCount !== undefined) { + if (input.InstanceCount !== undefined && input.InstanceCount !== null) { entries["InstanceCount"] = input.InstanceCount; } - if (input.LaunchGroup !== undefined) { + if (input.LaunchGroup !== undefined && input.LaunchGroup !== null) { entries["LaunchGroup"] = input.LaunchGroup; } - if (input.LaunchSpecification !== undefined) { + if (input.LaunchSpecification !== undefined && input.LaunchSpecification !== null) { const memberEntries = serializeAws_ec2RequestSpotLaunchSpecification(input.LaunchSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchSpecification.${key}`; entries[loc] = value; }); } - if (input.SpotPrice !== undefined) { + if (input.SpotPrice !== undefined && input.SpotPrice !== null) { entries["SpotPrice"] = input.SpotPrice; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.ValidFrom !== undefined) { + if (input.ValidFrom !== undefined && input.ValidFrom !== null) { entries["ValidFrom"] = input.ValidFrom.toISOString().split(".")[0] + "Z"; } - if (input.ValidUntil !== undefined) { + if (input.ValidUntil !== undefined && input.ValidUntil !== null) { entries["ValidUntil"] = input.ValidUntil.toISOString().split(".")[0] + "Z"; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.InstanceInterruptionBehavior !== undefined) { + if (input.InstanceInterruptionBehavior !== undefined && input.InstanceInterruptionBehavior !== null) { entries["InstanceInterruptionBehavior"] = input.InstanceInterruptionBehavior; } return entries; @@ -43541,7 +43916,7 @@ const serializeAws_ec2RequestSpotLaunchSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_ec2RequestSpotLaunchSpecificationSecurityGroupIdList( input.SecurityGroupIds, context @@ -43551,7 +43926,7 @@ const serializeAws_ec2RequestSpotLaunchSpecification = ( entries[loc] = value; }); } - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_ec2RequestSpotLaunchSpecificationSecurityGroupList( input.SecurityGroups, context @@ -43561,66 +43936,66 @@ const serializeAws_ec2RequestSpotLaunchSpecification = ( entries[loc] = value; }); } - if (input.AddressingType !== undefined) { + if (input.AddressingType !== undefined && input.AddressingType !== null) { entries["AddressingType"] = input.AddressingType; } - if (input.BlockDeviceMappings !== undefined) { + if (input.BlockDeviceMappings !== undefined && input.BlockDeviceMappings !== null) { const memberEntries = serializeAws_ec2BlockDeviceMappingList(input.BlockDeviceMappings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BlockDeviceMapping.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.EbsOptimized !== undefined) { + if (input.EbsOptimized !== undefined && input.EbsOptimized !== null) { entries["EbsOptimized"] = input.EbsOptimized; } - if (input.IamInstanceProfile !== undefined) { + if (input.IamInstanceProfile !== undefined && input.IamInstanceProfile !== null) { const memberEntries = serializeAws_ec2IamInstanceProfileSpecification(input.IamInstanceProfile, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IamInstanceProfile.${key}`; entries[loc] = value; }); } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.KernelId !== undefined) { + if (input.KernelId !== undefined && input.KernelId !== null) { entries["KernelId"] = input.KernelId; } - if (input.KeyName !== undefined) { + if (input.KeyName !== undefined && input.KeyName !== null) { entries["KeyName"] = input.KeyName; } - if (input.Monitoring !== undefined) { + if (input.Monitoring !== undefined && input.Monitoring !== null) { const memberEntries = serializeAws_ec2RunInstancesMonitoringEnabled(input.Monitoring, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Monitoring.${key}`; entries[loc] = value; }); } - if (input.NetworkInterfaces !== undefined) { + if (input.NetworkInterfaces !== undefined && input.NetworkInterfaces !== null) { const memberEntries = serializeAws_ec2InstanceNetworkInterfaceSpecificationList(input.NetworkInterfaces, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInterface.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Placement !== undefined) { + if (input.Placement !== undefined && input.Placement !== null) { const memberEntries = serializeAws_ec2SpotPlacement(input.Placement, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Placement.${key}`; entries[loc] = value; }); } - if (input.RamdiskId !== undefined) { + if (input.RamdiskId !== undefined && input.RamdiskId !== null) { entries["RamdiskId"] = input.RamdiskId; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.UserData !== undefined) { + if (input.UserData !== undefined && input.UserData !== null) { entries["UserData"] = input.UserData; } return entries; @@ -43633,6 +44008,9 @@ const serializeAws_ec2RequestSpotLaunchSpecificationSecurityGroupIdList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -43646,6 +44024,9 @@ const serializeAws_ec2RequestSpotLaunchSpecificationSecurityGroupList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -43656,6 +44037,9 @@ const serializeAws_ec2ReservedInstanceIdSet = (input: string[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ReservedInstanceId.${counter}`] = entry; counter++; } @@ -43667,10 +44051,10 @@ const serializeAws_ec2ReservedInstanceLimitPrice = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Amount !== undefined) { + if (input.Amount !== undefined && input.Amount !== null) { entries["Amount"] = input.Amount; } - if (input.CurrencyCode !== undefined) { + if (input.CurrencyCode !== undefined && input.CurrencyCode !== null) { entries["CurrencyCode"] = input.CurrencyCode; } return entries; @@ -43681,19 +44065,19 @@ const serializeAws_ec2ReservedInstancesConfiguration = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.InstanceCount !== undefined) { + if (input.InstanceCount !== undefined && input.InstanceCount !== null) { entries["InstanceCount"] = input.InstanceCount; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.Platform !== undefined) { + if (input.Platform !== undefined && input.Platform !== null) { entries["Platform"] = input.Platform; } - if (input.Scope !== undefined) { + if (input.Scope !== undefined && input.Scope !== null) { entries["Scope"] = input.Scope; } return entries; @@ -43706,6 +44090,9 @@ const serializeAws_ec2ReservedInstancesConfigurationList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ReservedInstancesConfiguration(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -43719,6 +44106,9 @@ const serializeAws_ec2ReservedInstancesIdStringList = (input: string[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ReservedInstancesId.${counter}`] = entry; counter++; } @@ -43729,6 +44119,9 @@ const serializeAws_ec2ReservedInstancesModificationIdStringList = (input: string const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ReservedInstancesModificationId.${counter}`] = entry; counter++; } @@ -43739,6 +44132,9 @@ const serializeAws_ec2ReservedInstancesOfferingIdStringList = (input: string[], const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -43750,7 +44146,7 @@ const serializeAws_ec2ResetEbsDefaultKmsKeyIdRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -43761,13 +44157,13 @@ const serializeAws_ec2ResetFpgaImageAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.FpgaImageId !== undefined) { + if (input.FpgaImageId !== undefined && input.FpgaImageId !== null) { entries["FpgaImageId"] = input.FpgaImageId; } - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } return entries; @@ -43778,13 +44174,13 @@ const serializeAws_ec2ResetImageAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -43795,13 +44191,13 @@ const serializeAws_ec2ResetInstanceAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } return entries; @@ -43812,13 +44208,13 @@ const serializeAws_ec2ResetNetworkInterfaceAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.SourceDestCheck !== undefined) { + if (input.SourceDestCheck !== undefined && input.SourceDestCheck !== null) { entries["SourceDestCheck"] = input.SourceDestCheck; } return entries; @@ -43829,13 +44225,13 @@ const serializeAws_ec2ResetSnapshotAttributeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -43845,6 +44241,9 @@ const serializeAws_ec2ResourceIdList = (input: string[], context: __SerdeContext const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -43855,6 +44254,9 @@ const serializeAws_ec2ResourceList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -43865,6 +44267,9 @@ const serializeAws_ec2RestorableByStringList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -43876,10 +44281,10 @@ const serializeAws_ec2RestoreAddressToClassicRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PublicIp !== undefined) { + if (input.PublicIp !== undefined && input.PublicIp !== null) { entries["PublicIp"] = input.PublicIp; } return entries; @@ -43890,16 +44295,16 @@ const serializeAws_ec2RestoreManagedPrefixListVersionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.PrefixListId !== undefined) { + if (input.PrefixListId !== undefined && input.PrefixListId !== null) { entries["PrefixListId"] = input.PrefixListId; } - if (input.PreviousVersion !== undefined) { + if (input.PreviousVersion !== undefined && input.PreviousVersion !== null) { entries["PreviousVersion"] = input.PreviousVersion; } - if (input.CurrentVersion !== undefined) { + if (input.CurrentVersion !== undefined && input.CurrentVersion !== null) { entries["CurrentVersion"] = input.CurrentVersion; } return entries; @@ -43910,19 +44315,19 @@ const serializeAws_ec2RevokeClientVpnIngressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.TargetNetworkCidr !== undefined) { + if (input.TargetNetworkCidr !== undefined && input.TargetNetworkCidr !== null) { entries["TargetNetworkCidr"] = input.TargetNetworkCidr; } - if (input.AccessGroupId !== undefined) { + if (input.AccessGroupId !== undefined && input.AccessGroupId !== null) { entries["AccessGroupId"] = input.AccessGroupId; } - if (input.RevokeAllGroups !== undefined) { + if (input.RevokeAllGroups !== undefined && input.RevokeAllGroups !== null) { entries["RevokeAllGroups"] = input.RevokeAllGroups; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -43933,35 +44338,35 @@ const serializeAws_ec2RevokeSecurityGroupEgressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { entries["GroupId"] = input.GroupId; } - if (input.IpPermissions !== undefined) { + if (input.IpPermissions !== undefined && input.IpPermissions !== null) { const memberEntries = serializeAws_ec2IpPermissionList(input.IpPermissions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IpPermissions.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.CidrIp !== undefined) { + if (input.CidrIp !== undefined && input.CidrIp !== null) { entries["CidrIp"] = input.CidrIp; } - if (input.FromPort !== undefined) { + if (input.FromPort !== undefined && input.FromPort !== null) { entries["FromPort"] = input.FromPort; } - if (input.IpProtocol !== undefined) { + if (input.IpProtocol !== undefined && input.IpProtocol !== null) { entries["IpProtocol"] = input.IpProtocol; } - if (input.ToPort !== undefined) { + if (input.ToPort !== undefined && input.ToPort !== null) { entries["ToPort"] = input.ToPort; } - if (input.SourceSecurityGroupName !== undefined) { + if (input.SourceSecurityGroupName !== undefined && input.SourceSecurityGroupName !== null) { entries["SourceSecurityGroupName"] = input.SourceSecurityGroupName; } - if (input.SourceSecurityGroupOwnerId !== undefined) { + if (input.SourceSecurityGroupOwnerId !== undefined && input.SourceSecurityGroupOwnerId !== null) { entries["SourceSecurityGroupOwnerId"] = input.SourceSecurityGroupOwnerId; } return entries; @@ -43972,38 +44377,38 @@ const serializeAws_ec2RevokeSecurityGroupIngressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CidrIp !== undefined) { + if (input.CidrIp !== undefined && input.CidrIp !== null) { entries["CidrIp"] = input.CidrIp; } - if (input.FromPort !== undefined) { + if (input.FromPort !== undefined && input.FromPort !== null) { entries["FromPort"] = input.FromPort; } - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { entries["GroupId"] = input.GroupId; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.IpPermissions !== undefined) { + if (input.IpPermissions !== undefined && input.IpPermissions !== null) { const memberEntries = serializeAws_ec2IpPermissionList(input.IpPermissions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IpPermissions.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.IpProtocol !== undefined) { + if (input.IpProtocol !== undefined && input.IpProtocol !== null) { entries["IpProtocol"] = input.IpProtocol; } - if (input.SourceSecurityGroupName !== undefined) { + if (input.SourceSecurityGroupName !== undefined && input.SourceSecurityGroupName !== null) { entries["SourceSecurityGroupName"] = input.SourceSecurityGroupName; } - if (input.SourceSecurityGroupOwnerId !== undefined) { + if (input.SourceSecurityGroupOwnerId !== undefined && input.SourceSecurityGroupOwnerId !== null) { entries["SourceSecurityGroupOwnerId"] = input.SourceSecurityGroupOwnerId; } - if (input.ToPort !== undefined) { + if (input.ToPort !== undefined && input.ToPort !== null) { entries["ToPort"] = input.ToPort; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -44013,6 +44418,9 @@ const serializeAws_ec2RouteTableIdStringList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -44024,7 +44432,7 @@ const serializeAws_ec2RunInstancesMonitoringEnabled = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -44032,166 +44440,166 @@ const serializeAws_ec2RunInstancesMonitoringEnabled = ( const serializeAws_ec2RunInstancesRequest = (input: RunInstancesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.BlockDeviceMappings !== undefined) { + if (input.BlockDeviceMappings !== undefined && input.BlockDeviceMappings !== null) { const memberEntries = serializeAws_ec2BlockDeviceMappingRequestList(input.BlockDeviceMappings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BlockDeviceMapping.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.Ipv6AddressCount !== undefined) { + if (input.Ipv6AddressCount !== undefined && input.Ipv6AddressCount !== null) { entries["Ipv6AddressCount"] = input.Ipv6AddressCount; } - if (input.Ipv6Addresses !== undefined) { + if (input.Ipv6Addresses !== undefined && input.Ipv6Addresses !== null) { const memberEntries = serializeAws_ec2InstanceIpv6AddressList(input.Ipv6Addresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ipv6Address.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.KernelId !== undefined) { + if (input.KernelId !== undefined && input.KernelId !== null) { entries["KernelId"] = input.KernelId; } - if (input.KeyName !== undefined) { + if (input.KeyName !== undefined && input.KeyName !== null) { entries["KeyName"] = input.KeyName; } - if (input.MaxCount !== undefined) { + if (input.MaxCount !== undefined && input.MaxCount !== null) { entries["MaxCount"] = input.MaxCount; } - if (input.MinCount !== undefined) { + if (input.MinCount !== undefined && input.MinCount !== null) { entries["MinCount"] = input.MinCount; } - if (input.Monitoring !== undefined) { + if (input.Monitoring !== undefined && input.Monitoring !== null) { const memberEntries = serializeAws_ec2RunInstancesMonitoringEnabled(input.Monitoring, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Monitoring.${key}`; entries[loc] = value; }); } - if (input.Placement !== undefined) { + if (input.Placement !== undefined && input.Placement !== null) { const memberEntries = serializeAws_ec2Placement(input.Placement, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Placement.${key}`; entries[loc] = value; }); } - if (input.RamdiskId !== undefined) { + if (input.RamdiskId !== undefined && input.RamdiskId !== null) { entries["RamdiskId"] = input.RamdiskId; } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_ec2SecurityGroupIdStringList(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_ec2SecurityGroupStringList(input.SecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroup.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.UserData !== undefined) { + if (input.UserData !== undefined && input.UserData !== null) { entries["UserData"] = input.UserData; } - if (input.AdditionalInfo !== undefined) { + if (input.AdditionalInfo !== undefined && input.AdditionalInfo !== null) { entries["AdditionalInfo"] = input.AdditionalInfo; } if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DisableApiTermination !== undefined) { + if (input.DisableApiTermination !== undefined && input.DisableApiTermination !== null) { entries["DisableApiTermination"] = input.DisableApiTermination; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.EbsOptimized !== undefined) { + if (input.EbsOptimized !== undefined && input.EbsOptimized !== null) { entries["EbsOptimized"] = input.EbsOptimized; } - if (input.IamInstanceProfile !== undefined) { + if (input.IamInstanceProfile !== undefined && input.IamInstanceProfile !== null) { const memberEntries = serializeAws_ec2IamInstanceProfileSpecification(input.IamInstanceProfile, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IamInstanceProfile.${key}`; entries[loc] = value; }); } - if (input.InstanceInitiatedShutdownBehavior !== undefined) { + if (input.InstanceInitiatedShutdownBehavior !== undefined && input.InstanceInitiatedShutdownBehavior !== null) { entries["InstanceInitiatedShutdownBehavior"] = input.InstanceInitiatedShutdownBehavior; } - if (input.NetworkInterfaces !== undefined) { + if (input.NetworkInterfaces !== undefined && input.NetworkInterfaces !== null) { const memberEntries = serializeAws_ec2InstanceNetworkInterfaceSpecificationList(input.NetworkInterfaces, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInterface.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.PrivateIpAddress !== undefined) { + if (input.PrivateIpAddress !== undefined && input.PrivateIpAddress !== null) { entries["PrivateIpAddress"] = input.PrivateIpAddress; } - if (input.ElasticGpuSpecification !== undefined) { + if (input.ElasticGpuSpecification !== undefined && input.ElasticGpuSpecification !== null) { const memberEntries = serializeAws_ec2ElasticGpuSpecifications(input.ElasticGpuSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ElasticGpuSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.ElasticInferenceAccelerators !== undefined) { + if (input.ElasticInferenceAccelerators !== undefined && input.ElasticInferenceAccelerators !== null) { const memberEntries = serializeAws_ec2ElasticInferenceAccelerators(input.ElasticInferenceAccelerators, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ElasticInferenceAccelerator.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.LaunchTemplate !== undefined) { + if (input.LaunchTemplate !== undefined && input.LaunchTemplate !== null) { const memberEntries = serializeAws_ec2LaunchTemplateSpecification(input.LaunchTemplate, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplate.${key}`; entries[loc] = value; }); } - if (input.InstanceMarketOptions !== undefined) { + if (input.InstanceMarketOptions !== undefined && input.InstanceMarketOptions !== null) { const memberEntries = serializeAws_ec2InstanceMarketOptionsRequest(input.InstanceMarketOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceMarketOptions.${key}`; entries[loc] = value; }); } - if (input.CreditSpecification !== undefined) { + if (input.CreditSpecification !== undefined && input.CreditSpecification !== null) { const memberEntries = serializeAws_ec2CreditSpecificationRequest(input.CreditSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CreditSpecification.${key}`; entries[loc] = value; }); } - if (input.CpuOptions !== undefined) { + if (input.CpuOptions !== undefined && input.CpuOptions !== null) { const memberEntries = serializeAws_ec2CpuOptionsRequest(input.CpuOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CpuOptions.${key}`; entries[loc] = value; }); } - if (input.CapacityReservationSpecification !== undefined) { + if (input.CapacityReservationSpecification !== undefined && input.CapacityReservationSpecification !== null) { const memberEntries = serializeAws_ec2CapacityReservationSpecification( input.CapacityReservationSpecification, context @@ -44201,28 +44609,28 @@ const serializeAws_ec2RunInstancesRequest = (input: RunInstancesRequest, context entries[loc] = value; }); } - if (input.HibernationOptions !== undefined) { + if (input.HibernationOptions !== undefined && input.HibernationOptions !== null) { const memberEntries = serializeAws_ec2HibernationOptionsRequest(input.HibernationOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HibernationOptions.${key}`; entries[loc] = value; }); } - if (input.LicenseSpecifications !== undefined) { + if (input.LicenseSpecifications !== undefined && input.LicenseSpecifications !== null) { const memberEntries = serializeAws_ec2LicenseSpecificationListRequest(input.LicenseSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LicenseSpecification.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MetadataOptions !== undefined) { + if (input.MetadataOptions !== undefined && input.MetadataOptions !== null) { const memberEntries = serializeAws_ec2InstanceMetadataOptionsRequest(input.MetadataOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MetadataOptions.${key}`; entries[loc] = value; }); } - if (input.EnclaveOptions !== undefined) { + if (input.EnclaveOptions !== undefined && input.EnclaveOptions !== null) { const memberEntries = serializeAws_ec2EnclaveOptionsRequest(input.EnclaveOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnclaveOptions.${key}`; @@ -44240,23 +44648,23 @@ const serializeAws_ec2RunScheduledInstancesRequest = ( if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.InstanceCount !== undefined) { + if (input.InstanceCount !== undefined && input.InstanceCount !== null) { entries["InstanceCount"] = input.InstanceCount; } - if (input.LaunchSpecification !== undefined) { + if (input.LaunchSpecification !== undefined && input.LaunchSpecification !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesLaunchSpecification(input.LaunchSpecification, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchSpecification.${key}`; entries[loc] = value; }); } - if (input.ScheduledInstanceId !== undefined) { + if (input.ScheduledInstanceId !== undefined && input.ScheduledInstanceId !== null) { entries["ScheduledInstanceId"] = input.ScheduledInstanceId; } return entries; @@ -44264,19 +44672,19 @@ const serializeAws_ec2RunScheduledInstancesRequest = ( const serializeAws_ec2S3Storage = (input: S3Storage, context: __SerdeContext): any => { const entries: any = {}; - if (input.AWSAccessKeyId !== undefined) { + if (input.AWSAccessKeyId !== undefined && input.AWSAccessKeyId !== null) { entries["AWSAccessKeyId"] = input.AWSAccessKeyId; } - if (input.Bucket !== undefined) { + if (input.Bucket !== undefined && input.Bucket !== null) { entries["Bucket"] = input.Bucket; } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { entries["Prefix"] = input.Prefix; } - if (input.UploadPolicy !== undefined) { + if (input.UploadPolicy !== undefined && input.UploadPolicy !== null) { entries["UploadPolicy"] = context.base64Encoder(input.UploadPolicy); } - if (input.UploadPolicySignature !== undefined) { + if (input.UploadPolicySignature !== undefined && input.UploadPolicySignature !== null) { entries["UploadPolicySignature"] = input.UploadPolicySignature; } return entries; @@ -44286,6 +44694,9 @@ const serializeAws_ec2ScheduledInstanceIdRequestSet = (input: string[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ScheduledInstanceId.${counter}`] = entry; counter++; } @@ -44297,23 +44708,23 @@ const serializeAws_ec2ScheduledInstanceRecurrenceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Frequency !== undefined) { + if (input.Frequency !== undefined && input.Frequency !== null) { entries["Frequency"] = input.Frequency; } - if (input.Interval !== undefined) { + if (input.Interval !== undefined && input.Interval !== null) { entries["Interval"] = input.Interval; } - if (input.OccurrenceDays !== undefined) { + if (input.OccurrenceDays !== undefined && input.OccurrenceDays !== null) { const memberEntries = serializeAws_ec2OccurrenceDayRequestSet(input.OccurrenceDays, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OccurrenceDay.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.OccurrenceRelativeToEnd !== undefined) { + if (input.OccurrenceRelativeToEnd !== undefined && input.OccurrenceRelativeToEnd !== null) { entries["OccurrenceRelativeToEnd"] = input.OccurrenceRelativeToEnd; } - if (input.OccurrenceUnit !== undefined) { + if (input.OccurrenceUnit !== undefined && input.OccurrenceUnit !== null) { entries["OccurrenceUnit"] = input.OccurrenceUnit; } return entries; @@ -44324,20 +44735,20 @@ const serializeAws_ec2ScheduledInstancesBlockDeviceMapping = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DeviceName !== undefined) { + if (input.DeviceName !== undefined && input.DeviceName !== null) { entries["DeviceName"] = input.DeviceName; } - if (input.Ebs !== undefined) { + if (input.Ebs !== undefined && input.Ebs !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesEbs(input.Ebs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ebs.${key}`; entries[loc] = value; }); } - if (input.NoDevice !== undefined) { + if (input.NoDevice !== undefined && input.NoDevice !== null) { entries["NoDevice"] = input.NoDevice; } - if (input.VirtualName !== undefined) { + if (input.VirtualName !== undefined && input.VirtualName !== null) { entries["VirtualName"] = input.VirtualName; } return entries; @@ -44350,6 +44761,9 @@ const serializeAws_ec2ScheduledInstancesBlockDeviceMappingSet = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ScheduledInstancesBlockDeviceMapping(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`BlockDeviceMapping.${counter}.${key}`] = value; @@ -44361,22 +44775,22 @@ const serializeAws_ec2ScheduledInstancesBlockDeviceMappingSet = ( const serializeAws_ec2ScheduledInstancesEbs = (input: ScheduledInstancesEbs, context: __SerdeContext): any => { const entries: any = {}; - if (input.DeleteOnTermination !== undefined) { + if (input.DeleteOnTermination !== undefined && input.DeleteOnTermination !== null) { entries["DeleteOnTermination"] = input.DeleteOnTermination; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.SnapshotId !== undefined) { + if (input.SnapshotId !== undefined && input.SnapshotId !== null) { entries["SnapshotId"] = input.SnapshotId; } - if (input.VolumeSize !== undefined) { + if (input.VolumeSize !== undefined && input.VolumeSize !== null) { entries["VolumeSize"] = input.VolumeSize; } - if (input.VolumeType !== undefined) { + if (input.VolumeType !== undefined && input.VolumeType !== null) { entries["VolumeType"] = input.VolumeType; } return entries; @@ -44387,10 +44801,10 @@ const serializeAws_ec2ScheduledInstancesIamInstanceProfile = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -44401,7 +44815,7 @@ const serializeAws_ec2ScheduledInstancesIpv6Address = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Ipv6Address !== undefined) { + if (input.Ipv6Address !== undefined && input.Ipv6Address !== null) { entries["Ipv6Address"] = input.Ipv6Address; } return entries; @@ -44414,6 +44828,9 @@ const serializeAws_ec2ScheduledInstancesIpv6AddressList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ScheduledInstancesIpv6Address(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Ipv6Address.${counter}.${key}`] = value; @@ -44428,70 +44845,70 @@ const serializeAws_ec2ScheduledInstancesLaunchSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.BlockDeviceMappings !== undefined) { + if (input.BlockDeviceMappings !== undefined && input.BlockDeviceMappings !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesBlockDeviceMappingSet(input.BlockDeviceMappings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BlockDeviceMapping.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.EbsOptimized !== undefined) { + if (input.EbsOptimized !== undefined && input.EbsOptimized !== null) { entries["EbsOptimized"] = input.EbsOptimized; } - if (input.IamInstanceProfile !== undefined) { + if (input.IamInstanceProfile !== undefined && input.IamInstanceProfile !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesIamInstanceProfile(input.IamInstanceProfile, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IamInstanceProfile.${key}`; entries[loc] = value; }); } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.KernelId !== undefined) { + if (input.KernelId !== undefined && input.KernelId !== null) { entries["KernelId"] = input.KernelId; } - if (input.KeyName !== undefined) { + if (input.KeyName !== undefined && input.KeyName !== null) { entries["KeyName"] = input.KeyName; } - if (input.Monitoring !== undefined) { + if (input.Monitoring !== undefined && input.Monitoring !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesMonitoring(input.Monitoring, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Monitoring.${key}`; entries[loc] = value; }); } - if (input.NetworkInterfaces !== undefined) { + if (input.NetworkInterfaces !== undefined && input.NetworkInterfaces !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesNetworkInterfaceSet(input.NetworkInterfaces, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInterface.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Placement !== undefined) { + if (input.Placement !== undefined && input.Placement !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesPlacement(input.Placement, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Placement.${key}`; entries[loc] = value; }); } - if (input.RamdiskId !== undefined) { + if (input.RamdiskId !== undefined && input.RamdiskId !== null) { entries["RamdiskId"] = input.RamdiskId; } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesSecurityGroupIdSet(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.UserData !== undefined) { + if (input.UserData !== undefined && input.UserData !== null) { entries["UserData"] = input.UserData; } return entries; @@ -44502,7 +44919,7 @@ const serializeAws_ec2ScheduledInstancesMonitoring = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -44513,52 +44930,52 @@ const serializeAws_ec2ScheduledInstancesNetworkInterface = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AssociatePublicIpAddress !== undefined) { + if (input.AssociatePublicIpAddress !== undefined && input.AssociatePublicIpAddress !== null) { entries["AssociatePublicIpAddress"] = input.AssociatePublicIpAddress; } - if (input.DeleteOnTermination !== undefined) { + if (input.DeleteOnTermination !== undefined && input.DeleteOnTermination !== null) { entries["DeleteOnTermination"] = input.DeleteOnTermination; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DeviceIndex !== undefined) { + if (input.DeviceIndex !== undefined && input.DeviceIndex !== null) { entries["DeviceIndex"] = input.DeviceIndex; } - if (input.Groups !== undefined) { + if (input.Groups !== undefined && input.Groups !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesSecurityGroupIdSet(input.Groups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Group.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Ipv6AddressCount !== undefined) { + if (input.Ipv6AddressCount !== undefined && input.Ipv6AddressCount !== null) { entries["Ipv6AddressCount"] = input.Ipv6AddressCount; } - if (input.Ipv6Addresses !== undefined) { + if (input.Ipv6Addresses !== undefined && input.Ipv6Addresses !== null) { const memberEntries = serializeAws_ec2ScheduledInstancesIpv6AddressList(input.Ipv6Addresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ipv6Address.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.PrivateIpAddress !== undefined) { + if (input.PrivateIpAddress !== undefined && input.PrivateIpAddress !== null) { entries["PrivateIpAddress"] = input.PrivateIpAddress; } - if (input.PrivateIpAddressConfigs !== undefined) { + if (input.PrivateIpAddressConfigs !== undefined && input.PrivateIpAddressConfigs !== null) { const memberEntries = serializeAws_ec2PrivateIpAddressConfigSet(input.PrivateIpAddressConfigs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PrivateIpAddressConfig.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SecondaryPrivateIpAddressCount !== undefined) { + if (input.SecondaryPrivateIpAddressCount !== undefined && input.SecondaryPrivateIpAddressCount !== null) { entries["SecondaryPrivateIpAddressCount"] = input.SecondaryPrivateIpAddressCount; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } return entries; @@ -44571,6 +44988,9 @@ const serializeAws_ec2ScheduledInstancesNetworkInterfaceSet = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2ScheduledInstancesNetworkInterface(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`NetworkInterface.${counter}.${key}`] = value; @@ -44585,10 +45005,10 @@ const serializeAws_ec2ScheduledInstancesPlacement = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } return entries; @@ -44599,10 +45019,10 @@ const serializeAws_ec2ScheduledInstancesPrivateIpAddressConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Primary !== undefined) { + if (input.Primary !== undefined && input.Primary !== null) { entries["Primary"] = input.Primary; } - if (input.PrivateIpAddress !== undefined) { + if (input.PrivateIpAddress !== undefined && input.PrivateIpAddress !== null) { entries["PrivateIpAddress"] = input.PrivateIpAddress; } return entries; @@ -44612,6 +45032,9 @@ const serializeAws_ec2ScheduledInstancesSecurityGroupIdSet = (input: string[], c const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SecurityGroupId.${counter}`] = entry; counter++; } @@ -44623,23 +45046,23 @@ const serializeAws_ec2SearchLocalGatewayRoutesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LocalGatewayRouteTableId !== undefined) { + if (input.LocalGatewayRouteTableId !== undefined && input.LocalGatewayRouteTableId !== null) { entries["LocalGatewayRouteTableId"] = input.LocalGatewayRouteTableId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -44650,23 +45073,23 @@ const serializeAws_ec2SearchTransitGatewayMulticastGroupsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayMulticastDomainId !== undefined) { + if (input.TransitGatewayMulticastDomainId !== undefined && input.TransitGatewayMulticastDomainId !== null) { entries["TransitGatewayMulticastDomainId"] = input.TransitGatewayMulticastDomainId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -44677,20 +45100,20 @@ const serializeAws_ec2SearchTransitGatewayRoutesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TransitGatewayRouteTableId !== undefined) { + if (input.TransitGatewayRouteTableId !== undefined && input.TransitGatewayRouteTableId !== null) { entries["TransitGatewayRouteTableId"] = input.TransitGatewayRouteTableId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_ec2FilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -44700,6 +45123,9 @@ const serializeAws_ec2SecurityGroupIdStringList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SecurityGroupId.${counter}`] = entry; counter++; } @@ -44710,6 +45136,9 @@ const serializeAws_ec2SecurityGroupStringList = (input: string[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SecurityGroup.${counter}`] = entry; counter++; } @@ -44721,10 +45150,10 @@ const serializeAws_ec2SendDiagnosticInterruptRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -44732,10 +45161,10 @@ const serializeAws_ec2SendDiagnosticInterruptRequest = ( const serializeAws_ec2SlotDateTimeRangeRequest = (input: SlotDateTimeRangeRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.EarliestTime !== undefined) { + if (input.EarliestTime !== undefined && input.EarliestTime !== null) { entries["EarliestTime"] = input.EarliestTime.toISOString().split(".")[0] + "Z"; } - if (input.LatestTime !== undefined) { + if (input.LatestTime !== undefined && input.LatestTime !== null) { entries["LatestTime"] = input.LatestTime.toISOString().split(".")[0] + "Z"; } return entries; @@ -44743,10 +45172,10 @@ const serializeAws_ec2SlotDateTimeRangeRequest = (input: SlotDateTimeRangeReques const serializeAws_ec2SlotStartTimeRangeRequest = (input: SlotStartTimeRangeRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.EarliestTime !== undefined) { + if (input.EarliestTime !== undefined && input.EarliestTime !== null) { entries["EarliestTime"] = input.EarliestTime.toISOString().split(".")[0] + "Z"; } - if (input.LatestTime !== undefined) { + if (input.LatestTime !== undefined && input.LatestTime !== null) { entries["LatestTime"] = input.LatestTime.toISOString().split(".")[0] + "Z"; } return entries; @@ -44754,16 +45183,16 @@ const serializeAws_ec2SlotStartTimeRangeRequest = (input: SlotStartTimeRangeRequ const serializeAws_ec2SnapshotDiskContainer = (input: SnapshotDiskContainer, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Format !== undefined) { + if (input.Format !== undefined && input.Format !== null) { entries["Format"] = input.Format; } - if (input.Url !== undefined) { + if (input.Url !== undefined && input.Url !== null) { entries["Url"] = input.Url; } - if (input.UserBucket !== undefined) { + if (input.UserBucket !== undefined && input.UserBucket !== null) { const memberEntries = serializeAws_ec2UserBucket(input.UserBucket, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserBucket.${key}`; @@ -44777,6 +45206,9 @@ const serializeAws_ec2SnapshotIdStringList = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SnapshotId.${counter}`] = entry; counter++; } @@ -44785,7 +45217,7 @@ const serializeAws_ec2SnapshotIdStringList = (input: string[], context: __SerdeC const serializeAws_ec2SpotCapacityRebalance = (input: SpotCapacityRebalance, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReplacementStrategy !== undefined) { + if (input.ReplacementStrategy !== undefined && input.ReplacementStrategy !== null) { entries["ReplacementStrategy"] = input.ReplacementStrategy; } return entries; @@ -44796,82 +45228,82 @@ const serializeAws_ec2SpotFleetLaunchSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_ec2GroupIdentifierList(input.SecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GroupSet.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AddressingType !== undefined) { + if (input.AddressingType !== undefined && input.AddressingType !== null) { entries["AddressingType"] = input.AddressingType; } - if (input.BlockDeviceMappings !== undefined) { + if (input.BlockDeviceMappings !== undefined && input.BlockDeviceMappings !== null) { const memberEntries = serializeAws_ec2BlockDeviceMappingList(input.BlockDeviceMappings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BlockDeviceMapping.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.EbsOptimized !== undefined) { + if (input.EbsOptimized !== undefined && input.EbsOptimized !== null) { entries["EbsOptimized"] = input.EbsOptimized; } - if (input.IamInstanceProfile !== undefined) { + if (input.IamInstanceProfile !== undefined && input.IamInstanceProfile !== null) { const memberEntries = serializeAws_ec2IamInstanceProfileSpecification(input.IamInstanceProfile, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IamInstanceProfile.${key}`; entries[loc] = value; }); } - if (input.ImageId !== undefined) { + if (input.ImageId !== undefined && input.ImageId !== null) { entries["ImageId"] = input.ImageId; } - if (input.InstanceType !== undefined) { + if (input.InstanceType !== undefined && input.InstanceType !== null) { entries["InstanceType"] = input.InstanceType; } - if (input.KernelId !== undefined) { + if (input.KernelId !== undefined && input.KernelId !== null) { entries["KernelId"] = input.KernelId; } - if (input.KeyName !== undefined) { + if (input.KeyName !== undefined && input.KeyName !== null) { entries["KeyName"] = input.KeyName; } - if (input.Monitoring !== undefined) { + if (input.Monitoring !== undefined && input.Monitoring !== null) { const memberEntries = serializeAws_ec2SpotFleetMonitoring(input.Monitoring, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Monitoring.${key}`; entries[loc] = value; }); } - if (input.NetworkInterfaces !== undefined) { + if (input.NetworkInterfaces !== undefined && input.NetworkInterfaces !== null) { const memberEntries = serializeAws_ec2InstanceNetworkInterfaceSpecificationList(input.NetworkInterfaces, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NetworkInterfaceSet.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Placement !== undefined) { + if (input.Placement !== undefined && input.Placement !== null) { const memberEntries = serializeAws_ec2SpotPlacement(input.Placement, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Placement.${key}`; entries[loc] = value; }); } - if (input.RamdiskId !== undefined) { + if (input.RamdiskId !== undefined && input.RamdiskId !== null) { entries["RamdiskId"] = input.RamdiskId; } - if (input.SpotPrice !== undefined) { + if (input.SpotPrice !== undefined && input.SpotPrice !== null) { entries["SpotPrice"] = input.SpotPrice; } - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.UserData !== undefined) { + if (input.UserData !== undefined && input.UserData !== null) { entries["UserData"] = input.UserData; } - if (input.WeightedCapacity !== undefined) { + if (input.WeightedCapacity !== undefined && input.WeightedCapacity !== null) { entries["WeightedCapacity"] = input.WeightedCapacity; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2SpotFleetTagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecificationSet.${key.substring(key.indexOf(".") + 1)}`; @@ -44883,7 +45315,7 @@ const serializeAws_ec2SpotFleetLaunchSpecification = ( const serializeAws_ec2SpotFleetMonitoring = (input: SpotFleetMonitoring, context: __SerdeContext): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -44894,92 +45326,92 @@ const serializeAws_ec2SpotFleetRequestConfigData = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AllocationStrategy !== undefined) { + if (input.AllocationStrategy !== undefined && input.AllocationStrategy !== null) { entries["AllocationStrategy"] = input.AllocationStrategy; } - if (input.OnDemandAllocationStrategy !== undefined) { + if (input.OnDemandAllocationStrategy !== undefined && input.OnDemandAllocationStrategy !== null) { entries["OnDemandAllocationStrategy"] = input.OnDemandAllocationStrategy; } - if (input.SpotMaintenanceStrategies !== undefined) { + if (input.SpotMaintenanceStrategies !== undefined && input.SpotMaintenanceStrategies !== null) { const memberEntries = serializeAws_ec2SpotMaintenanceStrategies(input.SpotMaintenanceStrategies, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SpotMaintenanceStrategies.${key}`; entries[loc] = value; }); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } - if (input.ExcessCapacityTerminationPolicy !== undefined) { + if (input.ExcessCapacityTerminationPolicy !== undefined && input.ExcessCapacityTerminationPolicy !== null) { entries["ExcessCapacityTerminationPolicy"] = input.ExcessCapacityTerminationPolicy; } - if (input.FulfilledCapacity !== undefined) { + if (input.FulfilledCapacity !== undefined && input.FulfilledCapacity !== null) { entries["FulfilledCapacity"] = input.FulfilledCapacity; } - if (input.OnDemandFulfilledCapacity !== undefined) { + if (input.OnDemandFulfilledCapacity !== undefined && input.OnDemandFulfilledCapacity !== null) { entries["OnDemandFulfilledCapacity"] = input.OnDemandFulfilledCapacity; } - if (input.IamFleetRole !== undefined) { + if (input.IamFleetRole !== undefined && input.IamFleetRole !== null) { entries["IamFleetRole"] = input.IamFleetRole; } - if (input.LaunchSpecifications !== undefined) { + if (input.LaunchSpecifications !== undefined && input.LaunchSpecifications !== null) { const memberEntries = serializeAws_ec2LaunchSpecsList(input.LaunchSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchSpecifications.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.LaunchTemplateConfigs !== undefined) { + if (input.LaunchTemplateConfigs !== undefined && input.LaunchTemplateConfigs !== null) { const memberEntries = serializeAws_ec2LaunchTemplateConfigList(input.LaunchTemplateConfigs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LaunchTemplateConfigs.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.SpotPrice !== undefined) { + if (input.SpotPrice !== undefined && input.SpotPrice !== null) { entries["SpotPrice"] = input.SpotPrice; } - if (input.TargetCapacity !== undefined) { + if (input.TargetCapacity !== undefined && input.TargetCapacity !== null) { entries["TargetCapacity"] = input.TargetCapacity; } - if (input.OnDemandTargetCapacity !== undefined) { + if (input.OnDemandTargetCapacity !== undefined && input.OnDemandTargetCapacity !== null) { entries["OnDemandTargetCapacity"] = input.OnDemandTargetCapacity; } - if (input.OnDemandMaxTotalPrice !== undefined) { + if (input.OnDemandMaxTotalPrice !== undefined && input.OnDemandMaxTotalPrice !== null) { entries["OnDemandMaxTotalPrice"] = input.OnDemandMaxTotalPrice; } - if (input.SpotMaxTotalPrice !== undefined) { + if (input.SpotMaxTotalPrice !== undefined && input.SpotMaxTotalPrice !== null) { entries["SpotMaxTotalPrice"] = input.SpotMaxTotalPrice; } - if (input.TerminateInstancesWithExpiration !== undefined) { + if (input.TerminateInstancesWithExpiration !== undefined && input.TerminateInstancesWithExpiration !== null) { entries["TerminateInstancesWithExpiration"] = input.TerminateInstancesWithExpiration; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.ValidFrom !== undefined) { + if (input.ValidFrom !== undefined && input.ValidFrom !== null) { entries["ValidFrom"] = input.ValidFrom.toISOString().split(".")[0] + "Z"; } - if (input.ValidUntil !== undefined) { + if (input.ValidUntil !== undefined && input.ValidUntil !== null) { entries["ValidUntil"] = input.ValidUntil.toISOString().split(".")[0] + "Z"; } - if (input.ReplaceUnhealthyInstances !== undefined) { + if (input.ReplaceUnhealthyInstances !== undefined && input.ReplaceUnhealthyInstances !== null) { entries["ReplaceUnhealthyInstances"] = input.ReplaceUnhealthyInstances; } - if (input.InstanceInterruptionBehavior !== undefined) { + if (input.InstanceInterruptionBehavior !== undefined && input.InstanceInterruptionBehavior !== null) { entries["InstanceInterruptionBehavior"] = input.InstanceInterruptionBehavior; } - if (input.LoadBalancersConfig !== undefined) { + if (input.LoadBalancersConfig !== undefined && input.LoadBalancersConfig !== null) { const memberEntries = serializeAws_ec2LoadBalancersConfig(input.LoadBalancersConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancersConfig.${key}`; entries[loc] = value; }); } - if (input.InstancePoolsToUseCount !== undefined) { + if (input.InstancePoolsToUseCount !== undefined && input.InstancePoolsToUseCount !== null) { entries["InstancePoolsToUseCount"] = input.InstancePoolsToUseCount; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -44993,6 +45425,9 @@ const serializeAws_ec2SpotFleetRequestIdList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45001,10 +45436,10 @@ const serializeAws_ec2SpotFleetRequestIdList = (input: string[], context: __Serd const serializeAws_ec2SpotFleetTagSpecification = (input: SpotFleetTagSpecification, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceType !== undefined) { + if (input.ResourceType !== undefined && input.ResourceType !== null) { entries["ResourceType"] = input.ResourceType; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_ec2TagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tag.${key.substring(key.indexOf(".") + 1)}`; @@ -45021,6 +45456,9 @@ const serializeAws_ec2SpotFleetTagSpecificationList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2SpotFleetTagSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -45034,6 +45472,9 @@ const serializeAws_ec2SpotInstanceRequestIdList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SpotInstanceRequestId.${counter}`] = entry; counter++; } @@ -45042,7 +45483,7 @@ const serializeAws_ec2SpotInstanceRequestIdList = (input: string[], context: __S const serializeAws_ec2SpotMaintenanceStrategies = (input: SpotMaintenanceStrategies, context: __SerdeContext): any => { const entries: any = {}; - if (input.CapacityRebalance !== undefined) { + if (input.CapacityRebalance !== undefined && input.CapacityRebalance !== null) { const memberEntries = serializeAws_ec2SpotCapacityRebalance(input.CapacityRebalance, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CapacityRebalance.${key}`; @@ -45054,19 +45495,19 @@ const serializeAws_ec2SpotMaintenanceStrategies = (input: SpotMaintenanceStrateg const serializeAws_ec2SpotMarketOptions = (input: SpotMarketOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.MaxPrice !== undefined) { + if (input.MaxPrice !== undefined && input.MaxPrice !== null) { entries["MaxPrice"] = input.MaxPrice; } - if (input.SpotInstanceType !== undefined) { + if (input.SpotInstanceType !== undefined && input.SpotInstanceType !== null) { entries["SpotInstanceType"] = input.SpotInstanceType; } - if (input.BlockDurationMinutes !== undefined) { + if (input.BlockDurationMinutes !== undefined && input.BlockDurationMinutes !== null) { entries["BlockDurationMinutes"] = input.BlockDurationMinutes; } - if (input.ValidUntil !== undefined) { + if (input.ValidUntil !== undefined && input.ValidUntil !== null) { entries["ValidUntil"] = input.ValidUntil.toISOString().split(".")[0] + "Z"; } - if (input.InstanceInterruptionBehavior !== undefined) { + if (input.InstanceInterruptionBehavior !== undefined && input.InstanceInterruptionBehavior !== null) { entries["InstanceInterruptionBehavior"] = input.InstanceInterruptionBehavior; } return entries; @@ -45074,32 +45515,32 @@ const serializeAws_ec2SpotMarketOptions = (input: SpotMarketOptions, context: __ const serializeAws_ec2SpotOptionsRequest = (input: SpotOptionsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AllocationStrategy !== undefined) { + if (input.AllocationStrategy !== undefined && input.AllocationStrategy !== null) { entries["AllocationStrategy"] = input.AllocationStrategy; } - if (input.MaintenanceStrategies !== undefined) { + if (input.MaintenanceStrategies !== undefined && input.MaintenanceStrategies !== null) { const memberEntries = serializeAws_ec2FleetSpotMaintenanceStrategiesRequest(input.MaintenanceStrategies, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MaintenanceStrategies.${key}`; entries[loc] = value; }); } - if (input.InstanceInterruptionBehavior !== undefined) { + if (input.InstanceInterruptionBehavior !== undefined && input.InstanceInterruptionBehavior !== null) { entries["InstanceInterruptionBehavior"] = input.InstanceInterruptionBehavior; } - if (input.InstancePoolsToUseCount !== undefined) { + if (input.InstancePoolsToUseCount !== undefined && input.InstancePoolsToUseCount !== null) { entries["InstancePoolsToUseCount"] = input.InstancePoolsToUseCount; } - if (input.SingleInstanceType !== undefined) { + if (input.SingleInstanceType !== undefined && input.SingleInstanceType !== null) { entries["SingleInstanceType"] = input.SingleInstanceType; } - if (input.SingleAvailabilityZone !== undefined) { + if (input.SingleAvailabilityZone !== undefined && input.SingleAvailabilityZone !== null) { entries["SingleAvailabilityZone"] = input.SingleAvailabilityZone; } - if (input.MinTargetCapacity !== undefined) { + if (input.MinTargetCapacity !== undefined && input.MinTargetCapacity !== null) { entries["MinTargetCapacity"] = input.MinTargetCapacity; } - if (input.MaxTotalPrice !== undefined) { + if (input.MaxTotalPrice !== undefined && input.MaxTotalPrice !== null) { entries["MaxTotalPrice"] = input.MaxTotalPrice; } return entries; @@ -45107,13 +45548,13 @@ const serializeAws_ec2SpotOptionsRequest = (input: SpotOptionsRequest, context: const serializeAws_ec2SpotPlacement = (input: SpotPlacement, context: __SerdeContext): any => { const entries: any = {}; - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.Tenancy !== undefined) { + if (input.Tenancy !== undefined && input.Tenancy !== null) { entries["Tenancy"] = input.Tenancy; } return entries; @@ -45121,17 +45562,17 @@ const serializeAws_ec2SpotPlacement = (input: SpotPlacement, context: __SerdeCon const serializeAws_ec2StartInstancesRequest = (input: StartInstancesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.AdditionalInfo !== undefined) { + if (input.AdditionalInfo !== undefined && input.AdditionalInfo !== null) { entries["AdditionalInfo"] = input.AdditionalInfo; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -45142,20 +45583,20 @@ const serializeAws_ec2StartNetworkInsightsAnalysisRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NetworkInsightsPathId !== undefined) { + if (input.NetworkInsightsPathId !== undefined && input.NetworkInsightsPathId !== null) { entries["NetworkInsightsPathId"] = input.NetworkInsightsPathId; } - if (input.FilterInArns !== undefined) { + if (input.FilterInArns !== undefined && input.FilterInArns !== null) { const memberEntries = serializeAws_ec2ArnList(input.FilterInArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FilterInArn.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.TagSpecifications !== undefined) { + if (input.TagSpecifications !== undefined && input.TagSpecifications !== null) { const memberEntries = serializeAws_ec2TagSpecificationList(input.TagSpecifications, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagSpecification.${key.substring(key.indexOf(".") + 1)}`; @@ -45165,7 +45606,7 @@ const serializeAws_ec2StartNetworkInsightsAnalysisRequest = ( if (input.ClientToken === undefined) { input.ClientToken = generateIdempotencyToken(); } - if (input.ClientToken !== undefined) { + if (input.ClientToken !== undefined && input.ClientToken !== null) { entries["ClientToken"] = input.ClientToken; } return entries; @@ -45176,10 +45617,10 @@ const serializeAws_ec2StartVpcEndpointServicePrivateDnsVerificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.ServiceId !== undefined) { + if (input.ServiceId !== undefined && input.ServiceId !== null) { entries["ServiceId"] = input.ServiceId; } return entries; @@ -45187,20 +45628,20 @@ const serializeAws_ec2StartVpcEndpointServicePrivateDnsVerificationRequest = ( const serializeAws_ec2StopInstancesRequest = (input: StopInstancesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Hibernate !== undefined) { + if (input.Hibernate !== undefined && input.Hibernate !== null) { entries["Hibernate"] = input.Hibernate; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.Force !== undefined) { + if (input.Force !== undefined && input.Force !== null) { entries["Force"] = input.Force; } return entries; @@ -45208,7 +45649,7 @@ const serializeAws_ec2StopInstancesRequest = (input: StopInstancesRequest, conte const serializeAws_ec2Storage = (input: Storage, context: __SerdeContext): any => { const entries: any = {}; - if (input.S3 !== undefined) { + if (input.S3 !== undefined && input.S3 !== null) { const memberEntries = serializeAws_ec2S3Storage(input.S3, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `S3.${key}`; @@ -45220,10 +45661,10 @@ const serializeAws_ec2Storage = (input: Storage, context: __SerdeContext): any = const serializeAws_ec2StorageLocation = (input: StorageLocation, context: __SerdeContext): any => { const entries: any = {}; - if (input.Bucket !== undefined) { + if (input.Bucket !== undefined && input.Bucket !== null) { entries["Bucket"] = input.Bucket; } - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } return entries; @@ -45233,6 +45674,9 @@ const serializeAws_ec2SubnetIdStringList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SubnetId.${counter}`] = entry; counter++; } @@ -45241,10 +45685,10 @@ const serializeAws_ec2SubnetIdStringList = (input: string[], context: __SerdeCon const serializeAws_ec2Tag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -45254,6 +45698,9 @@ const serializeAws_ec2TagList = (input: Tag[], context: __SerdeContext): any => const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2Tag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -45265,10 +45712,10 @@ const serializeAws_ec2TagList = (input: Tag[], context: __SerdeContext): any => const serializeAws_ec2TagSpecification = (input: TagSpecification, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceType !== undefined) { + if (input.ResourceType !== undefined && input.ResourceType !== null) { entries["ResourceType"] = input.ResourceType; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_ec2TagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tag.${key.substring(key.indexOf(".") + 1)}`; @@ -45282,6 +45729,9 @@ const serializeAws_ec2TagSpecificationList = (input: TagSpecification[], context const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2TagSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -45296,16 +45746,16 @@ const serializeAws_ec2TargetCapacitySpecificationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TotalTargetCapacity !== undefined) { + if (input.TotalTargetCapacity !== undefined && input.TotalTargetCapacity !== null) { entries["TotalTargetCapacity"] = input.TotalTargetCapacity; } - if (input.OnDemandTargetCapacity !== undefined) { + if (input.OnDemandTargetCapacity !== undefined && input.OnDemandTargetCapacity !== null) { entries["OnDemandTargetCapacity"] = input.OnDemandTargetCapacity; } - if (input.SpotTargetCapacity !== undefined) { + if (input.SpotTargetCapacity !== undefined && input.SpotTargetCapacity !== null) { entries["SpotTargetCapacity"] = input.SpotTargetCapacity; } - if (input.DefaultTargetCapacityType !== undefined) { + if (input.DefaultTargetCapacityType !== undefined && input.DefaultTargetCapacityType !== null) { entries["DefaultTargetCapacityType"] = input.DefaultTargetCapacityType; } return entries; @@ -45316,10 +45766,10 @@ const serializeAws_ec2TargetConfigurationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceCount !== undefined) { + if (input.InstanceCount !== undefined && input.InstanceCount !== null) { entries["InstanceCount"] = input.InstanceCount; } - if (input.OfferingId !== undefined) { + if (input.OfferingId !== undefined && input.OfferingId !== null) { entries["OfferingId"] = input.OfferingId; } return entries; @@ -45332,6 +45782,9 @@ const serializeAws_ec2TargetConfigurationRequestSet = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2TargetConfigurationRequest(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`TargetConfigurationRequest.${counter}.${key}`] = value; @@ -45343,7 +45796,7 @@ const serializeAws_ec2TargetConfigurationRequestSet = ( const serializeAws_ec2TargetGroup = (input: TargetGroup, context: __SerdeContext): any => { const entries: any = {}; - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } return entries; @@ -45353,6 +45806,9 @@ const serializeAws_ec2TargetGroups = (input: TargetGroup[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2TargetGroup(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -45364,7 +45820,7 @@ const serializeAws_ec2TargetGroups = (input: TargetGroup[], context: __SerdeCont const serializeAws_ec2TargetGroupsConfig = (input: TargetGroupsConfig, context: __SerdeContext): any => { const entries: any = {}; - if (input.TargetGroups !== undefined) { + if (input.TargetGroups !== undefined && input.TargetGroups !== null) { const memberEntries = serializeAws_ec2TargetGroups(input.TargetGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetGroups.${key.substring(key.indexOf(".") + 1)}`; @@ -45379,16 +45835,16 @@ const serializeAws_ec2TerminateClientVpnConnectionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClientVpnEndpointId !== undefined) { + if (input.ClientVpnEndpointId !== undefined && input.ClientVpnEndpointId !== null) { entries["ClientVpnEndpointId"] = input.ClientVpnEndpointId; } - if (input.ConnectionId !== undefined) { + if (input.ConnectionId !== undefined && input.ConnectionId !== null) { entries["ConnectionId"] = input.ConnectionId; } - if (input.Username !== undefined) { + if (input.Username !== undefined && input.Username !== null) { entries["Username"] = input.Username; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -45396,14 +45852,14 @@ const serializeAws_ec2TerminateClientVpnConnectionsRequest = ( const serializeAws_ec2TerminateInstancesRequest = (input: TerminateInstancesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -45413,6 +45869,9 @@ const serializeAws_ec2TrafficMirrorFilterIdList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45426,6 +45885,9 @@ const serializeAws_ec2TrafficMirrorFilterRuleFieldList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -45439,6 +45901,9 @@ const serializeAws_ec2TrafficMirrorNetworkServiceList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45450,10 +45915,10 @@ const serializeAws_ec2TrafficMirrorPortRangeRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.FromPort !== undefined) { + if (input.FromPort !== undefined && input.FromPort !== null) { entries["FromPort"] = input.FromPort; } - if (input.ToPort !== undefined) { + if (input.ToPort !== undefined && input.ToPort !== null) { entries["ToPort"] = input.ToPort; } return entries; @@ -45466,6 +45931,9 @@ const serializeAws_ec2TrafficMirrorSessionFieldList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -45476,6 +45944,9 @@ const serializeAws_ec2TrafficMirrorSessionIdList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45486,6 +45957,9 @@ const serializeAws_ec2TrafficMirrorTargetIdList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45496,6 +45970,9 @@ const serializeAws_ec2TransitGatewayAttachmentIdStringList = (input: string[], c const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Member.${counter}`] = entry; counter++; } @@ -45506,6 +45983,9 @@ const serializeAws_ec2TransitGatewayCidrBlockStringList = (input: string[], cont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45516,6 +45996,9 @@ const serializeAws_ec2TransitGatewayConnectPeerIdStringList = (input: string[], const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45527,7 +46010,7 @@ const serializeAws_ec2TransitGatewayConnectRequestBgpOptions = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PeerAsn !== undefined) { + if (input.PeerAsn !== undefined && input.PeerAsn !== null) { entries["PeerAsn"] = input.PeerAsn; } return entries; @@ -45537,6 +46020,9 @@ const serializeAws_ec2TransitGatewayIdStringList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45547,6 +46033,9 @@ const serializeAws_ec2TransitGatewayMulticastDomainIdStringList = (input: string const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45557,6 +46046,9 @@ const serializeAws_ec2TransitGatewayNetworkInterfaceIdList = (input: string[], c const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45568,28 +46060,28 @@ const serializeAws_ec2TransitGatewayRequestOptions = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AmazonSideAsn !== undefined) { + if (input.AmazonSideAsn !== undefined && input.AmazonSideAsn !== null) { entries["AmazonSideAsn"] = input.AmazonSideAsn; } - if (input.AutoAcceptSharedAttachments !== undefined) { + if (input.AutoAcceptSharedAttachments !== undefined && input.AutoAcceptSharedAttachments !== null) { entries["AutoAcceptSharedAttachments"] = input.AutoAcceptSharedAttachments; } - if (input.DefaultRouteTableAssociation !== undefined) { + if (input.DefaultRouteTableAssociation !== undefined && input.DefaultRouteTableAssociation !== null) { entries["DefaultRouteTableAssociation"] = input.DefaultRouteTableAssociation; } - if (input.DefaultRouteTablePropagation !== undefined) { + if (input.DefaultRouteTablePropagation !== undefined && input.DefaultRouteTablePropagation !== null) { entries["DefaultRouteTablePropagation"] = input.DefaultRouteTablePropagation; } - if (input.VpnEcmpSupport !== undefined) { + if (input.VpnEcmpSupport !== undefined && input.VpnEcmpSupport !== null) { entries["VpnEcmpSupport"] = input.VpnEcmpSupport; } - if (input.DnsSupport !== undefined) { + if (input.DnsSupport !== undefined && input.DnsSupport !== null) { entries["DnsSupport"] = input.DnsSupport; } - if (input.MulticastSupport !== undefined) { + if (input.MulticastSupport !== undefined && input.MulticastSupport !== null) { entries["MulticastSupport"] = input.MulticastSupport; } - if (input.TransitGatewayCidrBlocks !== undefined) { + if (input.TransitGatewayCidrBlocks !== undefined && input.TransitGatewayCidrBlocks !== null) { const memberEntries = serializeAws_ec2TransitGatewayCidrBlockStringList(input.TransitGatewayCidrBlocks, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TransitGatewayCidrBlocks.${key.substring(key.indexOf(".") + 1)}`; @@ -45603,6 +46095,9 @@ const serializeAws_ec2TransitGatewayRouteTableIdStringList = (input: string[], c const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45613,6 +46108,9 @@ const serializeAws_ec2TransitGatewaySubnetIdList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45624,14 +46122,14 @@ const serializeAws_ec2UnassignIpv6AddressesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Ipv6Addresses !== undefined) { + if (input.Ipv6Addresses !== undefined && input.Ipv6Addresses !== null) { const memberEntries = serializeAws_ec2Ipv6AddressList(input.Ipv6Addresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Ipv6Addresses.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } return entries; @@ -45642,10 +46140,10 @@ const serializeAws_ec2UnassignPrivateIpAddressesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NetworkInterfaceId !== undefined) { + if (input.NetworkInterfaceId !== undefined && input.NetworkInterfaceId !== null) { entries["NetworkInterfaceId"] = input.NetworkInterfaceId; } - if (input.PrivateIpAddresses !== undefined) { + if (input.PrivateIpAddresses !== undefined && input.PrivateIpAddresses !== null) { const memberEntries = serializeAws_ec2PrivateIpAddressStringList(input.PrivateIpAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PrivateIpAddress.${key.substring(key.indexOf(".") + 1)}`; @@ -45657,14 +46155,14 @@ const serializeAws_ec2UnassignPrivateIpAddressesRequest = ( const serializeAws_ec2UnmonitorInstancesRequest = (input: UnmonitorInstancesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceIds !== undefined) { + if (input.InstanceIds !== undefined && input.InstanceIds !== null) { const memberEntries = serializeAws_ec2InstanceIdStringList(input.InstanceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `InstanceId.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -45675,16 +46173,16 @@ const serializeAws_ec2UpdateSecurityGroupRuleDescriptionsEgressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { entries["GroupId"] = input.GroupId; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.IpPermissions !== undefined) { + if (input.IpPermissions !== undefined && input.IpPermissions !== null) { const memberEntries = serializeAws_ec2IpPermissionList(input.IpPermissions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IpPermissions.${key.substring(key.indexOf(".") + 1)}`; @@ -45699,16 +46197,16 @@ const serializeAws_ec2UpdateSecurityGroupRuleDescriptionsIngressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { entries["GroupId"] = input.GroupId; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.IpPermissions !== undefined) { + if (input.IpPermissions !== undefined && input.IpPermissions !== null) { const memberEntries = serializeAws_ec2IpPermissionList(input.IpPermissions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IpPermissions.${key.substring(key.indexOf(".") + 1)}`; @@ -45720,10 +46218,10 @@ const serializeAws_ec2UpdateSecurityGroupRuleDescriptionsIngressRequest = ( const serializeAws_ec2UserBucket = (input: UserBucket, context: __SerdeContext): any => { const entries: any = {}; - if (input.S3Bucket !== undefined) { + if (input.S3Bucket !== undefined && input.S3Bucket !== null) { entries["S3Bucket"] = input.S3Bucket; } - if (input.S3Key !== undefined) { + if (input.S3Key !== undefined && input.S3Key !== null) { entries["S3Key"] = input.S3Key; } return entries; @@ -45731,7 +46229,7 @@ const serializeAws_ec2UserBucket = (input: UserBucket, context: __SerdeContext): const serializeAws_ec2UserData = (input: UserData, context: __SerdeContext): any => { const entries: any = {}; - if (input.Data !== undefined) { + if (input.Data !== undefined && input.Data !== null) { entries["Data"] = input.Data; } return entries; @@ -45741,6 +46239,9 @@ const serializeAws_ec2UserGroupStringList = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`UserGroup.${counter}`] = entry; counter++; } @@ -45749,25 +46250,25 @@ const serializeAws_ec2UserGroupStringList = (input: string[], context: __SerdeCo const serializeAws_ec2UserIdGroupPair = (input: UserIdGroupPair, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.GroupId !== undefined) { + if (input.GroupId !== undefined && input.GroupId !== null) { entries["GroupId"] = input.GroupId; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.PeeringStatus !== undefined) { + if (input.PeeringStatus !== undefined && input.PeeringStatus !== null) { entries["PeeringStatus"] = input.PeeringStatus; } - if (input.UserId !== undefined) { + if (input.UserId !== undefined && input.UserId !== null) { entries["UserId"] = input.UserId; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.VpcPeeringConnectionId !== undefined) { + if (input.VpcPeeringConnectionId !== undefined && input.VpcPeeringConnectionId !== null) { entries["VpcPeeringConnectionId"] = input.VpcPeeringConnectionId; } return entries; @@ -45777,6 +46278,9 @@ const serializeAws_ec2UserIdGroupPairList = (input: UserIdGroupPair[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2UserIdGroupPair(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Item.${counter}.${key}`] = value; @@ -45790,6 +46294,9 @@ const serializeAws_ec2UserIdStringList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`UserId.${counter}`] = entry; counter++; } @@ -45800,6 +46307,9 @@ const serializeAws_ec2ValueStringList = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45810,6 +46320,9 @@ const serializeAws_ec2VersionStringList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45818,7 +46331,7 @@ const serializeAws_ec2VersionStringList = (input: string[], context: __SerdeCont const serializeAws_ec2VolumeDetail = (input: VolumeDetail, context: __SerdeContext): any => { const entries: any = {}; - if (input.Size !== undefined) { + if (input.Size !== undefined && input.Size !== null) { entries["Size"] = input.Size; } return entries; @@ -45828,6 +46341,9 @@ const serializeAws_ec2VolumeIdStringList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`VolumeId.${counter}`] = entry; counter++; } @@ -45838,6 +46354,9 @@ const serializeAws_ec2VpcClassicLinkIdList = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`VpcId.${counter}`] = entry; counter++; } @@ -45848,6 +46367,9 @@ const serializeAws_ec2VpcEndpointIdList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45858,6 +46380,9 @@ const serializeAws_ec2VpcEndpointRouteTableIdList = (input: string[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45868,6 +46393,9 @@ const serializeAws_ec2VpcEndpointSecurityGroupIdList = (input: string[], context const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45878,6 +46406,9 @@ const serializeAws_ec2VpcEndpointServiceIdList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45888,6 +46419,9 @@ const serializeAws_ec2VpcEndpointSubnetIdList = (input: string[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45898,6 +46432,9 @@ const serializeAws_ec2VpcIdStringList = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`VpcId.${counter}`] = entry; counter++; } @@ -45908,6 +46445,9 @@ const serializeAws_ec2VpcPeeringConnectionIdList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Item.${counter}`] = entry; counter++; } @@ -45918,6 +46458,9 @@ const serializeAws_ec2VpnConnectionIdStringList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`VpnConnectionId.${counter}`] = entry; counter++; } @@ -45929,32 +46472,32 @@ const serializeAws_ec2VpnConnectionOptionsSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnableAcceleration !== undefined) { + if (input.EnableAcceleration !== undefined && input.EnableAcceleration !== null) { entries["EnableAcceleration"] = input.EnableAcceleration; } - if (input.StaticRoutesOnly !== undefined) { + if (input.StaticRoutesOnly !== undefined && input.StaticRoutesOnly !== null) { entries["StaticRoutesOnly"] = input.StaticRoutesOnly; } - if (input.TunnelInsideIpVersion !== undefined) { + if (input.TunnelInsideIpVersion !== undefined && input.TunnelInsideIpVersion !== null) { entries["TunnelInsideIpVersion"] = input.TunnelInsideIpVersion; } - if (input.TunnelOptions !== undefined) { + if (input.TunnelOptions !== undefined && input.TunnelOptions !== null) { const memberEntries = serializeAws_ec2VpnTunnelOptionsSpecificationsList(input.TunnelOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TunnelOptions.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.LocalIpv4NetworkCidr !== undefined) { + if (input.LocalIpv4NetworkCidr !== undefined && input.LocalIpv4NetworkCidr !== null) { entries["LocalIpv4NetworkCidr"] = input.LocalIpv4NetworkCidr; } - if (input.RemoteIpv4NetworkCidr !== undefined) { + if (input.RemoteIpv4NetworkCidr !== undefined && input.RemoteIpv4NetworkCidr !== null) { entries["RemoteIpv4NetworkCidr"] = input.RemoteIpv4NetworkCidr; } - if (input.LocalIpv6NetworkCidr !== undefined) { + if (input.LocalIpv6NetworkCidr !== undefined && input.LocalIpv6NetworkCidr !== null) { entries["LocalIpv6NetworkCidr"] = input.LocalIpv6NetworkCidr; } - if (input.RemoteIpv6NetworkCidr !== undefined) { + if (input.RemoteIpv6NetworkCidr !== undefined && input.RemoteIpv6NetworkCidr !== null) { entries["RemoteIpv6NetworkCidr"] = input.RemoteIpv6NetworkCidr; } return entries; @@ -45964,6 +46507,9 @@ const serializeAws_ec2VpnGatewayIdStringList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`VpnGatewayId.${counter}`] = entry; counter++; } @@ -45975,37 +46521,37 @@ const serializeAws_ec2VpnTunnelOptionsSpecification = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TunnelInsideCidr !== undefined) { + if (input.TunnelInsideCidr !== undefined && input.TunnelInsideCidr !== null) { entries["TunnelInsideCidr"] = input.TunnelInsideCidr; } - if (input.TunnelInsideIpv6Cidr !== undefined) { + if (input.TunnelInsideIpv6Cidr !== undefined && input.TunnelInsideIpv6Cidr !== null) { entries["TunnelInsideIpv6Cidr"] = input.TunnelInsideIpv6Cidr; } - if (input.PreSharedKey !== undefined) { + if (input.PreSharedKey !== undefined && input.PreSharedKey !== null) { entries["PreSharedKey"] = input.PreSharedKey; } - if (input.Phase1LifetimeSeconds !== undefined) { + if (input.Phase1LifetimeSeconds !== undefined && input.Phase1LifetimeSeconds !== null) { entries["Phase1LifetimeSeconds"] = input.Phase1LifetimeSeconds; } - if (input.Phase2LifetimeSeconds !== undefined) { + if (input.Phase2LifetimeSeconds !== undefined && input.Phase2LifetimeSeconds !== null) { entries["Phase2LifetimeSeconds"] = input.Phase2LifetimeSeconds; } - if (input.RekeyMarginTimeSeconds !== undefined) { + if (input.RekeyMarginTimeSeconds !== undefined && input.RekeyMarginTimeSeconds !== null) { entries["RekeyMarginTimeSeconds"] = input.RekeyMarginTimeSeconds; } - if (input.RekeyFuzzPercentage !== undefined) { + if (input.RekeyFuzzPercentage !== undefined && input.RekeyFuzzPercentage !== null) { entries["RekeyFuzzPercentage"] = input.RekeyFuzzPercentage; } - if (input.ReplayWindowSize !== undefined) { + if (input.ReplayWindowSize !== undefined && input.ReplayWindowSize !== null) { entries["ReplayWindowSize"] = input.ReplayWindowSize; } - if (input.DPDTimeoutSeconds !== undefined) { + if (input.DPDTimeoutSeconds !== undefined && input.DPDTimeoutSeconds !== null) { entries["DPDTimeoutSeconds"] = input.DPDTimeoutSeconds; } - if (input.DPDTimeoutAction !== undefined) { + if (input.DPDTimeoutAction !== undefined && input.DPDTimeoutAction !== null) { entries["DPDTimeoutAction"] = input.DPDTimeoutAction; } - if (input.Phase1EncryptionAlgorithms !== undefined) { + if (input.Phase1EncryptionAlgorithms !== undefined && input.Phase1EncryptionAlgorithms !== null) { const memberEntries = serializeAws_ec2Phase1EncryptionAlgorithmsRequestList( input.Phase1EncryptionAlgorithms, context @@ -46015,7 +46561,7 @@ const serializeAws_ec2VpnTunnelOptionsSpecification = ( entries[loc] = value; }); } - if (input.Phase2EncryptionAlgorithms !== undefined) { + if (input.Phase2EncryptionAlgorithms !== undefined && input.Phase2EncryptionAlgorithms !== null) { const memberEntries = serializeAws_ec2Phase2EncryptionAlgorithmsRequestList( input.Phase2EncryptionAlgorithms, context @@ -46025,7 +46571,7 @@ const serializeAws_ec2VpnTunnelOptionsSpecification = ( entries[loc] = value; }); } - if (input.Phase1IntegrityAlgorithms !== undefined) { + if (input.Phase1IntegrityAlgorithms !== undefined && input.Phase1IntegrityAlgorithms !== null) { const memberEntries = serializeAws_ec2Phase1IntegrityAlgorithmsRequestList( input.Phase1IntegrityAlgorithms, context @@ -46035,7 +46581,7 @@ const serializeAws_ec2VpnTunnelOptionsSpecification = ( entries[loc] = value; }); } - if (input.Phase2IntegrityAlgorithms !== undefined) { + if (input.Phase2IntegrityAlgorithms !== undefined && input.Phase2IntegrityAlgorithms !== null) { const memberEntries = serializeAws_ec2Phase2IntegrityAlgorithmsRequestList( input.Phase2IntegrityAlgorithms, context @@ -46045,28 +46591,28 @@ const serializeAws_ec2VpnTunnelOptionsSpecification = ( entries[loc] = value; }); } - if (input.Phase1DHGroupNumbers !== undefined) { + if (input.Phase1DHGroupNumbers !== undefined && input.Phase1DHGroupNumbers !== null) { const memberEntries = serializeAws_ec2Phase1DHGroupNumbersRequestList(input.Phase1DHGroupNumbers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Phase1DHGroupNumber.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Phase2DHGroupNumbers !== undefined) { + if (input.Phase2DHGroupNumbers !== undefined && input.Phase2DHGroupNumbers !== null) { const memberEntries = serializeAws_ec2Phase2DHGroupNumbersRequestList(input.Phase2DHGroupNumbers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Phase2DHGroupNumber.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.IKEVersions !== undefined) { + if (input.IKEVersions !== undefined && input.IKEVersions !== null) { const memberEntries = serializeAws_ec2IKEVersionsRequestList(input.IKEVersions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IKEVersion.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.StartupAction !== undefined) { + if (input.StartupAction !== undefined && input.StartupAction !== null) { entries["StartupAction"] = input.StartupAction; } return entries; @@ -46079,6 +46625,9 @@ const serializeAws_ec2VpnTunnelOptionsSpecificationsList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_ec2VpnTunnelOptionsSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Member.${counter}.${key}`] = value; @@ -46090,10 +46639,10 @@ const serializeAws_ec2VpnTunnelOptionsSpecificationsList = ( const serializeAws_ec2WithdrawByoipCidrRequest = (input: WithdrawByoipCidrRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Cidr !== undefined) { + if (input.Cidr !== undefined && input.Cidr !== null) { entries["Cidr"] = input.Cidr; } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } return entries; @@ -46103,6 +46652,9 @@ const serializeAws_ec2ZoneIdStringList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ZoneId.${counter}`] = entry; counter++; } @@ -46113,6 +46665,9 @@ const serializeAws_ec2ZoneNameStringList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ZoneName.${counter}`] = entry; counter++; } @@ -46233,7 +46788,14 @@ const deserializeAws_ec2AccountAttribute = (output: any, context: __SerdeContext }; const deserializeAws_ec2AccountAttributeList = (output: any, context: __SerdeContext): AccountAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AccountAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AccountAttribute(entry, context); + }); }; const deserializeAws_ec2AccountAttributeValue = (output: any, context: __SerdeContext): AccountAttributeValue => { @@ -46247,7 +46809,14 @@ const deserializeAws_ec2AccountAttributeValue = (output: any, context: __SerdeCo }; const deserializeAws_ec2AccountAttributeValueList = (output: any, context: __SerdeContext): AccountAttributeValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AccountAttributeValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AccountAttributeValue(entry, context); + }); }; const deserializeAws_ec2ActiveInstance = (output: any, context: __SerdeContext): ActiveInstance => { @@ -46273,7 +46842,14 @@ const deserializeAws_ec2ActiveInstance = (output: any, context: __SerdeContext): }; const deserializeAws_ec2ActiveInstanceSet = (output: any, context: __SerdeContext): ActiveInstance[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ActiveInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ActiveInstance(entry, context); + }); }; const deserializeAws_ec2Address = (output: any, context: __SerdeContext): Address => { @@ -46342,7 +46918,14 @@ const deserializeAws_ec2Address = (output: any, context: __SerdeContext): Addres }; const deserializeAws_ec2AddressList = (output: any, context: __SerdeContext): Address[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Address(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Address(entry, context); + }); }; const deserializeAws_ec2AdvertiseByoipCidrResult = (output: any, context: __SerdeContext): AdvertiseByoipCidrResult => { @@ -46424,7 +47007,14 @@ const deserializeAws_ec2AllowedPrincipal = (output: any, context: __SerdeContext }; const deserializeAws_ec2AllowedPrincipalSet = (output: any, context: __SerdeContext): AllowedPrincipal[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AllowedPrincipal(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AllowedPrincipal(entry, context); + }); }; const deserializeAws_ec2AlternatePathHint = (output: any, context: __SerdeContext): AlternatePathHint => { @@ -46442,7 +47032,14 @@ const deserializeAws_ec2AlternatePathHint = (output: any, context: __SerdeContex }; const deserializeAws_ec2AlternatePathHintList = (output: any, context: __SerdeContext): AlternatePathHint[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AlternatePathHint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AlternatePathHint(entry, context); + }); }; const deserializeAws_ec2AnalysisAclRule = (output: any, context: __SerdeContext): AnalysisAclRule => { @@ -46490,7 +47087,14 @@ const deserializeAws_ec2AnalysisComponent = (output: any, context: __SerdeContex }; const deserializeAws_ec2AnalysisComponentList = (output: any, context: __SerdeContext): AnalysisComponent[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AnalysisComponent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AnalysisComponent(entry, context); + }); }; const deserializeAws_ec2AnalysisLoadBalancerListener = ( @@ -46687,11 +47291,25 @@ const deserializeAws_ec2ArchitectureTypeList = ( output: any, context: __SerdeContext ): (ArchitectureType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2ArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2AssignedPrivateIpAddress = (output: any, context: __SerdeContext): AssignedPrivateIpAddress => { @@ -46708,7 +47326,14 @@ const deserializeAws_ec2AssignedPrivateIpAddressList = ( output: any, context: __SerdeContext ): AssignedPrivateIpAddress[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AssignedPrivateIpAddress(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AssignedPrivateIpAddress(entry, context); + }); }; const deserializeAws_ec2AssignIpv6AddressesResult = ( @@ -46810,7 +47435,14 @@ const deserializeAws_ec2AssociatedRole = (output: any, context: __SerdeContext): }; const deserializeAws_ec2AssociatedRolesList = (output: any, context: __SerdeContext): AssociatedRole[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AssociatedRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AssociatedRole(entry, context); + }); }; const deserializeAws_ec2AssociatedTargetNetwork = (output: any, context: __SerdeContext): AssociatedTargetNetwork => { @@ -46831,7 +47463,14 @@ const deserializeAws_ec2AssociatedTargetNetworkSet = ( output: any, context: __SerdeContext ): AssociatedTargetNetwork[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AssociatedTargetNetwork(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AssociatedTargetNetwork(entry, context); + }); }; const deserializeAws_ec2AssociateEnclaveCertificateIamRoleResult = ( @@ -47066,7 +47705,14 @@ const deserializeAws_ec2AuthorizationRule = (output: any, context: __SerdeContex }; const deserializeAws_ec2AuthorizationRuleSet = (output: any, context: __SerdeContext): AuthorizationRule[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AuthorizationRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AuthorizationRule(entry, context); + }); }; const deserializeAws_ec2AuthorizeClientVpnIngressResult = ( @@ -47139,7 +47785,14 @@ const deserializeAws_ec2AvailabilityZone = (output: any, context: __SerdeContext }; const deserializeAws_ec2AvailabilityZoneList = (output: any, context: __SerdeContext): AvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AvailabilityZone(entry, context); + }); }; const deserializeAws_ec2AvailabilityZoneMessage = (output: any, context: __SerdeContext): AvailabilityZoneMessage => { @@ -47156,7 +47809,14 @@ const deserializeAws_ec2AvailabilityZoneMessageList = ( output: any, context: __SerdeContext ): AvailabilityZoneMessage[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AvailabilityZoneMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AvailabilityZoneMessage(entry, context); + }); }; const deserializeAws_ec2AvailableCapacity = (output: any, context: __SerdeContext): AvailableCapacity => { @@ -47180,7 +47840,14 @@ const deserializeAws_ec2AvailableCapacity = (output: any, context: __SerdeContex }; const deserializeAws_ec2AvailableInstanceCapacityList = (output: any, context: __SerdeContext): InstanceCapacity[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceCapacity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceCapacity(entry, context); + }); }; const deserializeAws_ec2BlockDeviceMapping = (output: any, context: __SerdeContext): BlockDeviceMapping => { @@ -47206,7 +47873,14 @@ const deserializeAws_ec2BlockDeviceMapping = (output: any, context: __SerdeConte }; const deserializeAws_ec2BlockDeviceMappingList = (output: any, context: __SerdeContext): BlockDeviceMapping[] => { - return (output || []).map((entry: any) => deserializeAws_ec2BlockDeviceMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2BlockDeviceMapping(entry, context); + }); }; const deserializeAws_ec2BundleInstanceResult = (output: any, context: __SerdeContext): BundleInstanceResult => { @@ -47272,7 +47946,14 @@ const deserializeAws_ec2BundleTaskError = (output: any, context: __SerdeContext) }; const deserializeAws_ec2BundleTaskList = (output: any, context: __SerdeContext): BundleTask[] => { - return (output || []).map((entry: any) => deserializeAws_ec2BundleTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2BundleTask(entry, context); + }); }; const deserializeAws_ec2ByoipCidr = (output: any, context: __SerdeContext): ByoipCidr => { @@ -47298,7 +47979,14 @@ const deserializeAws_ec2ByoipCidr = (output: any, context: __SerdeContext): Byoi }; const deserializeAws_ec2ByoipCidrSet = (output: any, context: __SerdeContext): ByoipCidr[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ByoipCidr(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ByoipCidr(entry, context); + }); }; const deserializeAws_ec2CancelBundleTaskResult = (output: any, context: __SerdeContext): CancelBundleTaskResult => { @@ -47363,7 +48051,14 @@ const deserializeAws_ec2CancelledSpotInstanceRequestList = ( output: any, context: __SerdeContext ): CancelledSpotInstanceRequest[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CancelledSpotInstanceRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CancelledSpotInstanceRequest(entry, context); + }); }; const deserializeAws_ec2CancelReservedInstancesListingResult = ( @@ -47426,7 +48121,14 @@ const deserializeAws_ec2CancelSpotFleetRequestsErrorSet = ( output: any, context: __SerdeContext ): CancelSpotFleetRequestsErrorItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CancelSpotFleetRequestsErrorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CancelSpotFleetRequestsErrorItem(entry, context); + }); }; const deserializeAws_ec2CancelSpotFleetRequestsResponse = ( @@ -47486,7 +48188,14 @@ const deserializeAws_ec2CancelSpotFleetRequestsSuccessSet = ( output: any, context: __SerdeContext ): CancelSpotFleetRequestsSuccessItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CancelSpotFleetRequestsSuccessItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CancelSpotFleetRequestsSuccessItem(entry, context); + }); }; const deserializeAws_ec2CancelSpotInstanceRequestsResult = ( @@ -47607,7 +48316,14 @@ const deserializeAws_ec2CapacityReservationGroupSet = ( output: any, context: __SerdeContext ): CapacityReservationGroup[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CapacityReservationGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CapacityReservationGroup(entry, context); + }); }; const deserializeAws_ec2CapacityReservationOptions = ( @@ -47624,7 +48340,14 @@ const deserializeAws_ec2CapacityReservationOptions = ( }; const deserializeAws_ec2CapacityReservationSet = (output: any, context: __SerdeContext): CapacityReservation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CapacityReservation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CapacityReservation(entry, context); + }); }; const deserializeAws_ec2CapacityReservationSpecificationResponse = ( @@ -47694,7 +48417,14 @@ const deserializeAws_ec2CarrierGateway = (output: any, context: __SerdeContext): }; const deserializeAws_ec2CarrierGatewaySet = (output: any, context: __SerdeContext): CarrierGateway[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CarrierGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CarrierGateway(entry, context); + }); }; const deserializeAws_ec2CertificateAuthentication = ( @@ -47721,7 +48451,14 @@ const deserializeAws_ec2CidrBlock = (output: any, context: __SerdeContext): Cidr }; const deserializeAws_ec2CidrBlockSet = (output: any, context: __SerdeContext): CidrBlock[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CidrBlock(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CidrBlock(entry, context); + }); }; const deserializeAws_ec2ClassicLinkDnsSupport = (output: any, context: __SerdeContext): ClassicLinkDnsSupport => { @@ -47739,7 +48476,14 @@ const deserializeAws_ec2ClassicLinkDnsSupport = (output: any, context: __SerdeCo }; const deserializeAws_ec2ClassicLinkDnsSupportList = (output: any, context: __SerdeContext): ClassicLinkDnsSupport[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ClassicLinkDnsSupport(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ClassicLinkDnsSupport(entry, context); + }); }; const deserializeAws_ec2ClassicLinkInstance = (output: any, context: __SerdeContext): ClassicLinkInstance => { @@ -47774,7 +48518,14 @@ const deserializeAws_ec2ClassicLinkInstance = (output: any, context: __SerdeCont }; const deserializeAws_ec2ClassicLinkInstanceList = (output: any, context: __SerdeContext): ClassicLinkInstance[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ClassicLinkInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ClassicLinkInstance(entry, context); + }); }; const deserializeAws_ec2ClassicLoadBalancer = (output: any, context: __SerdeContext): ClassicLoadBalancer => { @@ -47788,7 +48539,14 @@ const deserializeAws_ec2ClassicLoadBalancer = (output: any, context: __SerdeCont }; const deserializeAws_ec2ClassicLoadBalancers = (output: any, context: __SerdeContext): ClassicLoadBalancer[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ClassicLoadBalancer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ClassicLoadBalancer(entry, context); + }); }; const deserializeAws_ec2ClassicLoadBalancersConfig = ( @@ -47880,7 +48638,14 @@ const deserializeAws_ec2ClientVpnAuthenticationList = ( output: any, context: __SerdeContext ): ClientVpnAuthentication[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ClientVpnAuthentication(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ClientVpnAuthentication(entry, context); + }); }; const deserializeAws_ec2ClientVpnAuthorizationRuleStatus = ( @@ -47972,7 +48737,14 @@ const deserializeAws_ec2ClientVpnConnection = (output: any, context: __SerdeCont }; const deserializeAws_ec2ClientVpnConnectionSet = (output: any, context: __SerdeContext): ClientVpnConnection[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ClientVpnConnection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ClientVpnConnection(entry, context); + }); }; const deserializeAws_ec2ClientVpnConnectionStatus = ( @@ -48181,7 +48953,14 @@ const deserializeAws_ec2ClientVpnRoute = (output: any, context: __SerdeContext): }; const deserializeAws_ec2ClientVpnRouteSet = (output: any, context: __SerdeContext): ClientVpnRoute[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ClientVpnRoute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ClientVpnRoute(entry, context); + }); }; const deserializeAws_ec2ClientVpnRouteStatus = (output: any, context: __SerdeContext): ClientVpnRouteStatus => { @@ -48199,7 +48978,14 @@ const deserializeAws_ec2ClientVpnRouteStatus = (output: any, context: __SerdeCon }; const deserializeAws_ec2ClientVpnSecurityGroupIdSet = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2CoipAddressUsage = (output: any, context: __SerdeContext): CoipAddressUsage => { @@ -48225,7 +49011,14 @@ const deserializeAws_ec2CoipAddressUsage = (output: any, context: __SerdeContext }; const deserializeAws_ec2CoipAddressUsageSet = (output: any, context: __SerdeContext): CoipAddressUsage[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CoipAddressUsage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CoipAddressUsage(entry, context); + }); }; const deserializeAws_ec2CoipPool = (output: any, context: __SerdeContext): CoipPool => { @@ -48264,7 +49057,14 @@ const deserializeAws_ec2CoipPool = (output: any, context: __SerdeContext): CoipP }; const deserializeAws_ec2CoipPoolSet = (output: any, context: __SerdeContext): CoipPool[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CoipPool(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CoipPool(entry, context); + }); }; const deserializeAws_ec2ConfirmProductInstanceResult = ( @@ -48349,7 +49149,14 @@ const deserializeAws_ec2ConnectionNotificationSet = ( output: any, context: __SerdeContext ): ConnectionNotification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ConnectionNotification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ConnectionNotification(entry, context); + }); }; const deserializeAws_ec2ConversionTask = (output: any, context: __SerdeContext): ConversionTask => { @@ -48427,7 +49234,14 @@ const deserializeAws_ec2CopySnapshotResult = (output: any, context: __SerdeConte }; const deserializeAws_ec2CoreCountList = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => parseInt(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return parseInt(entry); + }); }; const deserializeAws_ec2CpuOptions = (output: any, context: __SerdeContext): CpuOptions => { @@ -48596,7 +49410,14 @@ const deserializeAws_ec2CreateFleetError = (output: any, context: __SerdeContext }; const deserializeAws_ec2CreateFleetErrorsSet = (output: any, context: __SerdeContext): CreateFleetError[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CreateFleetError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CreateFleetError(entry, context); + }); }; const deserializeAws_ec2CreateFleetInstance = (output: any, context: __SerdeContext): CreateFleetInstance => { @@ -48635,7 +49456,14 @@ const deserializeAws_ec2CreateFleetInstance = (output: any, context: __SerdeCont }; const deserializeAws_ec2CreateFleetInstancesSet = (output: any, context: __SerdeContext): CreateFleetInstance[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CreateFleetInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CreateFleetInstance(entry, context); + }); }; const deserializeAws_ec2CreateFleetResult = (output: any, context: __SerdeContext): CreateFleetResult => { @@ -49225,7 +50053,14 @@ const deserializeAws_ec2CreateVolumePermissionList = ( output: any, context: __SerdeContext ): CreateVolumePermission[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CreateVolumePermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CreateVolumePermission(entry, context); + }); }; const deserializeAws_ec2CreateVpcEndpointConnectionNotificationResult = ( @@ -49377,7 +50212,14 @@ const deserializeAws_ec2CustomerGateway = (output: any, context: __SerdeContext) }; const deserializeAws_ec2CustomerGatewayList = (output: any, context: __SerdeContext): CustomerGateway[] => { - return (output || []).map((entry: any) => deserializeAws_ec2CustomerGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2CustomerGateway(entry, context); + }); }; const deserializeAws_ec2DeleteCarrierGatewayResult = ( @@ -49461,7 +50303,14 @@ const deserializeAws_ec2DeleteFleetErrorItem = (output: any, context: __SerdeCon }; const deserializeAws_ec2DeleteFleetErrorSet = (output: any, context: __SerdeContext): DeleteFleetErrorItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DeleteFleetErrorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DeleteFleetErrorItem(entry, context); + }); }; const deserializeAws_ec2DeleteFleetsResult = (output: any, context: __SerdeContext): DeleteFleetsResult => { @@ -49515,7 +50364,14 @@ const deserializeAws_ec2DeleteFleetSuccessItem = (output: any, context: __SerdeC }; const deserializeAws_ec2DeleteFleetSuccessSet = (output: any, context: __SerdeContext): DeleteFleetSuccessItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DeleteFleetSuccessItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DeleteFleetSuccessItem(entry, context); + }); }; const deserializeAws_ec2DeleteFlowLogsResult = (output: any, context: __SerdeContext): DeleteFlowLogsResult => { @@ -49586,9 +50442,14 @@ const deserializeAws_ec2DeleteLaunchTemplateVersionsResponseErrorSet = ( output: any, context: __SerdeContext ): DeleteLaunchTemplateVersionsResponseErrorItem[] => { - return (output || []).map((entry: any) => - deserializeAws_ec2DeleteLaunchTemplateVersionsResponseErrorItem(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DeleteLaunchTemplateVersionsResponseErrorItem(entry, context); + }); }; const deserializeAws_ec2DeleteLaunchTemplateVersionsResponseSuccessItem = ( @@ -49616,9 +50477,14 @@ const deserializeAws_ec2DeleteLaunchTemplateVersionsResponseSuccessSet = ( output: any, context: __SerdeContext ): DeleteLaunchTemplateVersionsResponseSuccessItem[] => { - return (output || []).map((entry: any) => - deserializeAws_ec2DeleteLaunchTemplateVersionsResponseSuccessItem(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DeleteLaunchTemplateVersionsResponseSuccessItem(entry, context); + }); }; const deserializeAws_ec2DeleteLaunchTemplateVersionsResult = ( @@ -50423,7 +51289,14 @@ const deserializeAws_ec2DescribeCoipPoolsResult = (output: any, context: __Serde }; const deserializeAws_ec2DescribeConversionTaskList = (output: any, context: __SerdeContext): ConversionTask[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ConversionTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ConversionTask(entry, context); + }); }; const deserializeAws_ec2DescribeConversionTasksResult = ( @@ -50662,7 +51535,14 @@ const deserializeAws_ec2DescribeFastSnapshotRestoreSuccessSet = ( output: any, context: __SerdeContext ): DescribeFastSnapshotRestoreSuccessItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DescribeFastSnapshotRestoreSuccessItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DescribeFastSnapshotRestoreSuccessItem(entry, context); + }); }; const deserializeAws_ec2DescribeFleetError = (output: any, context: __SerdeContext): DescribeFleetError => { @@ -50753,7 +51633,14 @@ const deserializeAws_ec2DescribeFleetInstancesResult = ( }; const deserializeAws_ec2DescribeFleetsErrorSet = (output: any, context: __SerdeContext): DescribeFleetError[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DescribeFleetError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DescribeFleetError(entry, context); + }); }; const deserializeAws_ec2DescribeFleetsInstances = (output: any, context: __SerdeContext): DescribeFleetsInstances => { @@ -50795,7 +51682,14 @@ const deserializeAws_ec2DescribeFleetsInstancesSet = ( output: any, context: __SerdeContext ): DescribeFleetsInstances[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DescribeFleetsInstances(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DescribeFleetsInstances(entry, context); + }); }; const deserializeAws_ec2DescribeFleetsResult = (output: any, context: __SerdeContext): DescribeFleetsResult => { @@ -52884,11 +53778,25 @@ const deserializeAws_ec2DhcpConfiguration = (output: any, context: __SerdeContex }; const deserializeAws_ec2DhcpConfigurationList = (output: any, context: __SerdeContext): DhcpConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DhcpConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DhcpConfiguration(entry, context); + }); }; const deserializeAws_ec2DhcpConfigurationValueList = (output: any, context: __SerdeContext): AttributeValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2AttributeValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2AttributeValue(entry, context); + }); }; const deserializeAws_ec2DhcpOptions = (output: any, context: __SerdeContext): DhcpOptions => { @@ -52923,7 +53831,14 @@ const deserializeAws_ec2DhcpOptions = (output: any, context: __SerdeContext): Dh }; const deserializeAws_ec2DhcpOptionsList = (output: any, context: __SerdeContext): DhcpOptions[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DhcpOptions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DhcpOptions(entry, context); + }); }; const deserializeAws_ec2DirectoryServiceAuthentication = ( @@ -52982,7 +53897,14 @@ const deserializeAws_ec2DisableFastSnapshotRestoreErrorSet = ( output: any, context: __SerdeContext ): DisableFastSnapshotRestoreErrorItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DisableFastSnapshotRestoreErrorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DisableFastSnapshotRestoreErrorItem(entry, context); + }); }; const deserializeAws_ec2DisableFastSnapshotRestoresResult = ( @@ -53052,7 +53974,14 @@ const deserializeAws_ec2DisableFastSnapshotRestoreStateErrorSet = ( output: any, context: __SerdeContext ): DisableFastSnapshotRestoreStateErrorItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DisableFastSnapshotRestoreStateErrorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DisableFastSnapshotRestoreStateErrorItem(entry, context); + }); }; const deserializeAws_ec2DisableFastSnapshotRestoreSuccessItem = ( @@ -53112,7 +54041,14 @@ const deserializeAws_ec2DisableFastSnapshotRestoreSuccessSet = ( output: any, context: __SerdeContext ): DisableFastSnapshotRestoreSuccessItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DisableFastSnapshotRestoreSuccessItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DisableFastSnapshotRestoreSuccessItem(entry, context); + }); }; const deserializeAws_ec2DisableTransitGatewayRouteTablePropagationResult = ( @@ -53331,7 +54267,14 @@ const deserializeAws_ec2DiskInfo = (output: any, context: __SerdeContext): DiskI }; const deserializeAws_ec2DiskInfoList = (output: any, context: __SerdeContext): DiskInfo[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DiskInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DiskInfo(entry, context); + }); }; const deserializeAws_ec2DnsEntry = (output: any, context: __SerdeContext): DnsEntry => { @@ -53349,7 +54292,14 @@ const deserializeAws_ec2DnsEntry = (output: any, context: __SerdeContext): DnsEn }; const deserializeAws_ec2DnsEntrySet = (output: any, context: __SerdeContext): DnsEntry[] => { - return (output || []).map((entry: any) => deserializeAws_ec2DnsEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2DnsEntry(entry, context); + }); }; const deserializeAws_ec2EbsBlockDevice = (output: any, context: __SerdeContext): EbsBlockDevice => { @@ -53498,7 +54448,14 @@ const deserializeAws_ec2EgressOnlyInternetGatewayList = ( output: any, context: __SerdeContext ): EgressOnlyInternetGateway[] => { - return (output || []).map((entry: any) => deserializeAws_ec2EgressOnlyInternetGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2EgressOnlyInternetGateway(entry, context); + }); }; const deserializeAws_ec2ElasticGpuAssociation = (output: any, context: __SerdeContext): ElasticGpuAssociation => { @@ -53524,7 +54481,14 @@ const deserializeAws_ec2ElasticGpuAssociation = (output: any, context: __SerdeCo }; const deserializeAws_ec2ElasticGpuAssociationList = (output: any, context: __SerdeContext): ElasticGpuAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ElasticGpuAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ElasticGpuAssociation(entry, context); + }); }; const deserializeAws_ec2ElasticGpuHealth = (output: any, context: __SerdeContext): ElasticGpuHealth => { @@ -53575,7 +54539,14 @@ const deserializeAws_ec2ElasticGpus = (output: any, context: __SerdeContext): El }; const deserializeAws_ec2ElasticGpuSet = (output: any, context: __SerdeContext): ElasticGpus[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ElasticGpus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ElasticGpus(entry, context); + }); }; const deserializeAws_ec2ElasticGpuSpecificationResponse = ( @@ -53595,7 +54566,14 @@ const deserializeAws_ec2ElasticGpuSpecificationResponseList = ( output: any, context: __SerdeContext ): ElasticGpuSpecificationResponse[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ElasticGpuSpecificationResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ElasticGpuSpecificationResponse(entry, context); + }); }; const deserializeAws_ec2ElasticInferenceAcceleratorAssociation = ( @@ -53629,7 +54607,14 @@ const deserializeAws_ec2ElasticInferenceAcceleratorAssociationList = ( output: any, context: __SerdeContext ): ElasticInferenceAcceleratorAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ElasticInferenceAcceleratorAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ElasticInferenceAcceleratorAssociation(entry, context); + }); }; const deserializeAws_ec2EnableEbsEncryptionByDefaultResult = ( @@ -53675,7 +54660,14 @@ const deserializeAws_ec2EnableFastSnapshotRestoreErrorSet = ( output: any, context: __SerdeContext ): EnableFastSnapshotRestoreErrorItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2EnableFastSnapshotRestoreErrorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2EnableFastSnapshotRestoreErrorItem(entry, context); + }); }; const deserializeAws_ec2EnableFastSnapshotRestoresResult = ( @@ -53745,7 +54737,14 @@ const deserializeAws_ec2EnableFastSnapshotRestoreStateErrorSet = ( output: any, context: __SerdeContext ): EnableFastSnapshotRestoreStateErrorItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2EnableFastSnapshotRestoreStateErrorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2EnableFastSnapshotRestoreStateErrorItem(entry, context); + }); }; const deserializeAws_ec2EnableFastSnapshotRestoreSuccessItem = ( @@ -53805,7 +54804,14 @@ const deserializeAws_ec2EnableFastSnapshotRestoreSuccessSet = ( output: any, context: __SerdeContext ): EnableFastSnapshotRestoreSuccessItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2EnableFastSnapshotRestoreSuccessItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2EnableFastSnapshotRestoreSuccessItem(entry, context); + }); }; const deserializeAws_ec2EnableTransitGatewayRouteTablePropagationResult = ( @@ -53858,11 +54864,25 @@ const deserializeAws_ec2EnclaveOptions = (output: any, context: __SerdeContext): }; const deserializeAws_ec2EndpointSet = (output: any, context: __SerdeContext): ClientVpnEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ClientVpnEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ClientVpnEndpoint(entry, context); + }); }; const deserializeAws_ec2ErrorSet = (output: any, context: __SerdeContext): ValidationError[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ValidationError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ValidationError(entry, context); + }); }; const deserializeAws_ec2EventInformation = (output: any, context: __SerdeContext): EventInformation => { @@ -54112,7 +55132,14 @@ const deserializeAws_ec2Explanation = (output: any, context: __SerdeContext): Ex }; const deserializeAws_ec2ExplanationList = (output: any, context: __SerdeContext): Explanation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Explanation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Explanation(entry, context); + }); }; const deserializeAws_ec2ExportClientVpnClientCertificateRevocationListResult = ( @@ -54236,7 +55263,14 @@ const deserializeAws_ec2ExportImageTask = (output: any, context: __SerdeContext) }; const deserializeAws_ec2ExportImageTaskList = (output: any, context: __SerdeContext): ExportImageTask[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ExportImageTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ExportImageTask(entry, context); + }); }; const deserializeAws_ec2ExportTask = (output: any, context: __SerdeContext): ExportTask => { @@ -54277,7 +55311,14 @@ const deserializeAws_ec2ExportTask = (output: any, context: __SerdeContext): Exp }; const deserializeAws_ec2ExportTaskList = (output: any, context: __SerdeContext): ExportTask[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ExportTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ExportTask(entry, context); + }); }; const deserializeAws_ec2ExportTaskS3Location = (output: any, context: __SerdeContext): ExportTaskS3Location => { @@ -54350,7 +55391,14 @@ const deserializeAws_ec2FailedQueuedPurchaseDeletionSet = ( output: any, context: __SerdeContext ): FailedQueuedPurchaseDeletion[] => { - return (output || []).map((entry: any) => deserializeAws_ec2FailedQueuedPurchaseDeletion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2FailedQueuedPurchaseDeletion(entry, context); + }); }; const deserializeAws_ec2FederatedAuthentication = (output: any, context: __SerdeContext): FederatedAuthentication => { @@ -54507,7 +55555,14 @@ const deserializeAws_ec2FleetLaunchTemplateConfigList = ( output: any, context: __SerdeContext ): FleetLaunchTemplateConfig[] => { - return (output || []).map((entry: any) => deserializeAws_ec2FleetLaunchTemplateConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2FleetLaunchTemplateConfig(entry, context); + }); }; const deserializeAws_ec2FleetLaunchTemplateOverrides = ( @@ -54551,7 +55606,14 @@ const deserializeAws_ec2FleetLaunchTemplateOverridesList = ( output: any, context: __SerdeContext ): FleetLaunchTemplateOverrides[] => { - return (output || []).map((entry: any) => deserializeAws_ec2FleetLaunchTemplateOverrides(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2FleetLaunchTemplateOverrides(entry, context); + }); }; const deserializeAws_ec2FleetLaunchTemplateSpecification = ( @@ -54576,7 +55638,14 @@ const deserializeAws_ec2FleetLaunchTemplateSpecification = ( }; const deserializeAws_ec2FleetSet = (output: any, context: __SerdeContext): FleetData[] => { - return (output || []).map((entry: any) => deserializeAws_ec2FleetData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2FleetData(entry, context); + }); }; const deserializeAws_ec2FleetSpotCapacityRebalance = ( @@ -54671,7 +55740,14 @@ const deserializeAws_ec2FlowLog = (output: any, context: __SerdeContext): FlowLo }; const deserializeAws_ec2FlowLogSet = (output: any, context: __SerdeContext): FlowLog[] => { - return (output || []).map((entry: any) => deserializeAws_ec2FlowLog(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2FlowLog(entry, context); + }); }; const deserializeAws_ec2FpgaDeviceInfo = (output: any, context: __SerdeContext): FpgaDeviceInfo => { @@ -54697,7 +55773,14 @@ const deserializeAws_ec2FpgaDeviceInfo = (output: any, context: __SerdeContext): }; const deserializeAws_ec2FpgaDeviceInfoList = (output: any, context: __SerdeContext): FpgaDeviceInfo[] => { - return (output || []).map((entry: any) => deserializeAws_ec2FpgaDeviceInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2FpgaDeviceInfo(entry, context); + }); }; const deserializeAws_ec2FpgaDeviceMemoryInfo = (output: any, context: __SerdeContext): FpgaDeviceMemoryInfo => { @@ -54824,7 +55907,14 @@ const deserializeAws_ec2FpgaImageAttribute = (output: any, context: __SerdeConte }; const deserializeAws_ec2FpgaImageList = (output: any, context: __SerdeContext): FpgaImage[] => { - return (output || []).map((entry: any) => deserializeAws_ec2FpgaImage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2FpgaImage(entry, context); + }); }; const deserializeAws_ec2FpgaImageState = (output: any, context: __SerdeContext): FpgaImageState => { @@ -55391,7 +56481,14 @@ const deserializeAws_ec2GpuDeviceInfo = (output: any, context: __SerdeContext): }; const deserializeAws_ec2GpuDeviceInfoList = (output: any, context: __SerdeContext): GpuDeviceInfo[] => { - return (output || []).map((entry: any) => deserializeAws_ec2GpuDeviceInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2GpuDeviceInfo(entry, context); + }); }; const deserializeAws_ec2GpuDeviceMemoryInfo = (output: any, context: __SerdeContext): GpuDeviceMemoryInfo => { @@ -55436,15 +56533,36 @@ const deserializeAws_ec2GroupIdentifier = (output: any, context: __SerdeContext) }; const deserializeAws_ec2GroupIdentifierList = (output: any, context: __SerdeContext): GroupIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_ec2GroupIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2GroupIdentifier(entry, context); + }); }; const deserializeAws_ec2GroupIdentifierSet = (output: any, context: __SerdeContext): SecurityGroupIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SecurityGroupIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SecurityGroupIdentifier(entry, context); + }); }; const deserializeAws_ec2GroupIdStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2HibernationOptions = (output: any, context: __SerdeContext): HibernationOptions => { @@ -55494,11 +56612,25 @@ const deserializeAws_ec2HistoryRecordEntry = (output: any, context: __SerdeConte }; const deserializeAws_ec2HistoryRecords = (output: any, context: __SerdeContext): HistoryRecord[] => { - return (output || []).map((entry: any) => deserializeAws_ec2HistoryRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2HistoryRecord(entry, context); + }); }; const deserializeAws_ec2HistoryRecordSet = (output: any, context: __SerdeContext): HistoryRecordEntry[] => { - return (output || []).map((entry: any) => deserializeAws_ec2HistoryRecordEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2HistoryRecordEntry(entry, context); + }); }; const deserializeAws_ec2Host = (output: any, context: __SerdeContext): Host => { @@ -55603,11 +56735,25 @@ const deserializeAws_ec2HostInstance = (output: any, context: __SerdeContext): H }; const deserializeAws_ec2HostInstanceList = (output: any, context: __SerdeContext): HostInstance[] => { - return (output || []).map((entry: any) => deserializeAws_ec2HostInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2HostInstance(entry, context); + }); }; const deserializeAws_ec2HostList = (output: any, context: __SerdeContext): Host[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Host(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Host(entry, context); + }); }; const deserializeAws_ec2HostOffering = (output: any, context: __SerdeContext): HostOffering => { @@ -55645,7 +56791,14 @@ const deserializeAws_ec2HostOffering = (output: any, context: __SerdeContext): H }; const deserializeAws_ec2HostOfferingSet = (output: any, context: __SerdeContext): HostOffering[] => { - return (output || []).map((entry: any) => deserializeAws_ec2HostOffering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2HostOffering(entry, context); + }); }; const deserializeAws_ec2HostProperties = (output: any, context: __SerdeContext): HostProperties => { @@ -55746,7 +56899,14 @@ const deserializeAws_ec2HostReservation = (output: any, context: __SerdeContext) }; const deserializeAws_ec2HostReservationSet = (output: any, context: __SerdeContext): HostReservation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2HostReservation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2HostReservation(entry, context); + }); }; const deserializeAws_ec2IamInstanceProfile = (output: any, context: __SerdeContext): IamInstanceProfile => { @@ -55796,7 +56956,14 @@ const deserializeAws_ec2IamInstanceProfileAssociationSet = ( output: any, context: __SerdeContext ): IamInstanceProfileAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2IamInstanceProfileAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2IamInstanceProfileAssociation(entry, context); + }); }; const deserializeAws_ec2IamInstanceProfileSpecification = ( @@ -55849,11 +57016,25 @@ const deserializeAws_ec2IdFormat = (output: any, context: __SerdeContext): IdFor }; const deserializeAws_ec2IdFormatList = (output: any, context: __SerdeContext): IdFormat[] => { - return (output || []).map((entry: any) => deserializeAws_ec2IdFormat(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2IdFormat(entry, context); + }); }; const deserializeAws_ec2IKEVersionsList = (output: any, context: __SerdeContext): IKEVersionsListValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2IKEVersionsListValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2IKEVersionsListValue(entry, context); + }); }; const deserializeAws_ec2IKEVersionsListValue = (output: any, context: __SerdeContext): IKEVersionsListValue => { @@ -56048,7 +57229,14 @@ const deserializeAws_ec2ImageAttribute = (output: any, context: __SerdeContext): }; const deserializeAws_ec2ImageList = (output: any, context: __SerdeContext): Image[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Image(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Image(entry, context); + }); }; const deserializeAws_ec2ImportClientVpnClientCertificateRevocationListResult = ( @@ -56081,7 +57269,14 @@ const deserializeAws_ec2ImportImageLicenseSpecificationListResponse = ( output: any, context: __SerdeContext ): ImportImageLicenseConfigurationResponse[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ImportImageLicenseConfigurationResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ImportImageLicenseConfigurationResponse(entry, context); + }); }; const deserializeAws_ec2ImportImageResult = (output: any, context: __SerdeContext): ImportImageResult => { @@ -56247,7 +57442,14 @@ const deserializeAws_ec2ImportImageTask = (output: any, context: __SerdeContext) }; const deserializeAws_ec2ImportImageTaskList = (output: any, context: __SerdeContext): ImportImageTask[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ImportImageTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ImportImageTask(entry, context); + }); }; const deserializeAws_ec2ImportInstanceResult = (output: any, context: __SerdeContext): ImportInstanceResult => { @@ -56332,7 +57534,14 @@ const deserializeAws_ec2ImportInstanceVolumeDetailSet = ( output: any, context: __SerdeContext ): ImportInstanceVolumeDetailItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ImportInstanceVolumeDetailItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ImportInstanceVolumeDetailItem(entry, context); + }); }; const deserializeAws_ec2ImportKeyPairResult = (output: any, context: __SerdeContext): ImportKeyPairResult => { @@ -56411,7 +57620,14 @@ const deserializeAws_ec2ImportSnapshotTask = (output: any, context: __SerdeConte }; const deserializeAws_ec2ImportSnapshotTaskList = (output: any, context: __SerdeContext): ImportSnapshotTask[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ImportSnapshotTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ImportSnapshotTask(entry, context); + }); }; const deserializeAws_ec2ImportVolumeResult = (output: any, context: __SerdeContext): ImportVolumeResult => { @@ -56485,11 +57701,25 @@ const deserializeAws_ec2InferenceDeviceInfo = (output: any, context: __SerdeCont }; const deserializeAws_ec2InferenceDeviceInfoList = (output: any, context: __SerdeContext): InferenceDeviceInfo[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InferenceDeviceInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InferenceDeviceInfo(entry, context); + }); }; const deserializeAws_ec2InsideCidrBlocksStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2Instance = (output: any, context: __SerdeContext): Instance => { @@ -56850,7 +58080,14 @@ const deserializeAws_ec2InstanceBlockDeviceMappingList = ( output: any, context: __SerdeContext ): InstanceBlockDeviceMapping[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceBlockDeviceMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceBlockDeviceMapping(entry, context); + }); }; const deserializeAws_ec2InstanceCapacity = (output: any, context: __SerdeContext): InstanceCapacity => { @@ -56886,7 +58123,14 @@ const deserializeAws_ec2InstanceCount = (output: any, context: __SerdeContext): }; const deserializeAws_ec2InstanceCountList = (output: any, context: __SerdeContext): InstanceCount[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceCount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceCount(entry, context); + }); }; const deserializeAws_ec2InstanceCreditSpecification = ( @@ -56910,7 +58154,14 @@ const deserializeAws_ec2InstanceCreditSpecificationList = ( output: any, context: __SerdeContext ): InstanceCreditSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceCreditSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceCreditSpecification(entry, context); + }); }; const deserializeAws_ec2InstanceExportDetails = (output: any, context: __SerdeContext): InstanceExportDetails => { @@ -56945,11 +58196,25 @@ const deserializeAws_ec2InstanceFamilyCreditSpecification = ( }; const deserializeAws_ec2InstanceIdSet = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2InstanceIdsSet = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2InstanceIpv6Address = (output: any, context: __SerdeContext): InstanceIpv6Address => { @@ -56963,11 +58228,25 @@ const deserializeAws_ec2InstanceIpv6Address = (output: any, context: __SerdeCont }; const deserializeAws_ec2InstanceIpv6AddressList = (output: any, context: __SerdeContext): InstanceIpv6Address[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceIpv6Address(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceIpv6Address(entry, context); + }); }; const deserializeAws_ec2InstanceList = (output: any, context: __SerdeContext): Instance[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Instance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Instance(entry, context); + }); }; const deserializeAws_ec2InstanceMetadataOptionsResponse = ( @@ -57010,7 +58289,14 @@ const deserializeAws_ec2InstanceMonitoring = (output: any, context: __SerdeConte }; const deserializeAws_ec2InstanceMonitoringList = (output: any, context: __SerdeContext): InstanceMonitoring[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceMonitoring(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceMonitoring(entry, context); + }); }; const deserializeAws_ec2InstanceNetworkInterface = (output: any, context: __SerdeContext): InstanceNetworkInterface => { @@ -57163,7 +58449,14 @@ const deserializeAws_ec2InstanceNetworkInterfaceList = ( output: any, context: __SerdeContext ): InstanceNetworkInterface[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceNetworkInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceNetworkInterface(entry, context); + }); }; const deserializeAws_ec2InstanceNetworkInterfaceSpecification = ( @@ -57257,7 +58550,14 @@ const deserializeAws_ec2InstanceNetworkInterfaceSpecificationList = ( output: any, context: __SerdeContext ): InstanceNetworkInterfaceSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceNetworkInterfaceSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceNetworkInterfaceSpecification(entry, context); + }); }; const deserializeAws_ec2InstancePrivateIpAddress = (output: any, context: __SerdeContext): InstancePrivateIpAddress => { @@ -57286,7 +58586,14 @@ const deserializeAws_ec2InstancePrivateIpAddressList = ( output: any, context: __SerdeContext ): InstancePrivateIpAddress[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstancePrivateIpAddress(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstancePrivateIpAddress(entry, context); + }); }; const deserializeAws_ec2InstanceState = (output: any, context: __SerdeContext): InstanceState => { @@ -57322,7 +58629,14 @@ const deserializeAws_ec2InstanceStateChange = (output: any, context: __SerdeCont }; const deserializeAws_ec2InstanceStateChangeList = (output: any, context: __SerdeContext): InstanceStateChange[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceStateChange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceStateChange(entry, context); + }); }; const deserializeAws_ec2InstanceStatus = (output: any, context: __SerdeContext): InstanceStatus => { @@ -57384,7 +58698,14 @@ const deserializeAws_ec2InstanceStatusDetails = (output: any, context: __SerdeCo }; const deserializeAws_ec2InstanceStatusDetailsList = (output: any, context: __SerdeContext): InstanceStatusDetails[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceStatusDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceStatusDetails(entry, context); + }); }; const deserializeAws_ec2InstanceStatusEvent = (output: any, context: __SerdeContext): InstanceStatusEvent => { @@ -57418,11 +58739,25 @@ const deserializeAws_ec2InstanceStatusEvent = (output: any, context: __SerdeCont }; const deserializeAws_ec2InstanceStatusEventList = (output: any, context: __SerdeContext): InstanceStatusEvent[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceStatusEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceStatusEvent(entry, context); + }); }; const deserializeAws_ec2InstanceStatusList = (output: any, context: __SerdeContext): InstanceStatus[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceStatus(entry, context); + }); }; const deserializeAws_ec2InstanceStatusSummary = (output: any, context: __SerdeContext): InstanceStatusSummary => { @@ -57467,7 +58802,14 @@ const deserializeAws_ec2InstanceStorageInfo = (output: any, context: __SerdeCont }; const deserializeAws_ec2InstanceTagKeySet = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2InstanceTagNotificationAttribute = ( @@ -57616,7 +58958,14 @@ const deserializeAws_ec2InstanceTypeInfo = (output: any, context: __SerdeContext }; const deserializeAws_ec2InstanceTypeInfoList = (output: any, context: __SerdeContext): InstanceTypeInfo[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceTypeInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceTypeInfo(entry, context); + }); }; const deserializeAws_ec2InstanceTypeOffering = (output: any, context: __SerdeContext): InstanceTypeOffering => { @@ -57638,7 +58987,14 @@ const deserializeAws_ec2InstanceTypeOffering = (output: any, context: __SerdeCon }; const deserializeAws_ec2InstanceTypeOfferingsList = (output: any, context: __SerdeContext): InstanceTypeOffering[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceTypeOffering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceTypeOffering(entry, context); + }); }; const deserializeAws_ec2InstanceUsage = (output: any, context: __SerdeContext): InstanceUsage => { @@ -57656,7 +59012,14 @@ const deserializeAws_ec2InstanceUsage = (output: any, context: __SerdeContext): }; const deserializeAws_ec2InstanceUsageSet = (output: any, context: __SerdeContext): InstanceUsage[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InstanceUsage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InstanceUsage(entry, context); + }); }; const deserializeAws_ec2InternetGateway = (output: any, context: __SerdeContext): InternetGateway => { @@ -57711,15 +59074,36 @@ const deserializeAws_ec2InternetGatewayAttachmentList = ( output: any, context: __SerdeContext ): InternetGatewayAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InternetGatewayAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InternetGatewayAttachment(entry, context); + }); }; const deserializeAws_ec2InternetGatewayList = (output: any, context: __SerdeContext): InternetGateway[] => { - return (output || []).map((entry: any) => deserializeAws_ec2InternetGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2InternetGateway(entry, context); + }); }; const deserializeAws_ec2IpAddressList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2IpPermission = (output: any, context: __SerdeContext): IpPermission => { @@ -57778,7 +59162,14 @@ const deserializeAws_ec2IpPermission = (output: any, context: __SerdeContext): I }; const deserializeAws_ec2IpPermissionList = (output: any, context: __SerdeContext): IpPermission[] => { - return (output || []).map((entry: any) => deserializeAws_ec2IpPermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2IpPermission(entry, context); + }); }; const deserializeAws_ec2IpRange = (output: any, context: __SerdeContext): IpRange => { @@ -57796,15 +59187,36 @@ const deserializeAws_ec2IpRange = (output: any, context: __SerdeContext): IpRang }; const deserializeAws_ec2IpRangeList = (output: any, context: __SerdeContext): IpRange[] => { - return (output || []).map((entry: any) => deserializeAws_ec2IpRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2IpRange(entry, context); + }); }; const deserializeAws_ec2IpRanges = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2Ipv6AddressList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2Ipv6CidrAssociation = (output: any, context: __SerdeContext): Ipv6CidrAssociation => { @@ -57822,7 +59234,14 @@ const deserializeAws_ec2Ipv6CidrAssociation = (output: any, context: __SerdeCont }; const deserializeAws_ec2Ipv6CidrAssociationSet = (output: any, context: __SerdeContext): Ipv6CidrAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Ipv6CidrAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Ipv6CidrAssociation(entry, context); + }); }; const deserializeAws_ec2Ipv6CidrBlock = (output: any, context: __SerdeContext): Ipv6CidrBlock => { @@ -57836,7 +59255,14 @@ const deserializeAws_ec2Ipv6CidrBlock = (output: any, context: __SerdeContext): }; const deserializeAws_ec2Ipv6CidrBlockSet = (output: any, context: __SerdeContext): Ipv6CidrBlock[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Ipv6CidrBlock(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Ipv6CidrBlock(entry, context); + }); }; const deserializeAws_ec2Ipv6Pool = (output: any, context: __SerdeContext): Ipv6Pool => { @@ -57871,7 +59297,14 @@ const deserializeAws_ec2Ipv6Pool = (output: any, context: __SerdeContext): Ipv6P }; const deserializeAws_ec2Ipv6PoolSet = (output: any, context: __SerdeContext): Ipv6Pool[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Ipv6Pool(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Ipv6Pool(entry, context); + }); }; const deserializeAws_ec2Ipv6Range = (output: any, context: __SerdeContext): Ipv6Range => { @@ -57889,7 +59322,14 @@ const deserializeAws_ec2Ipv6Range = (output: any, context: __SerdeContext): Ipv6 }; const deserializeAws_ec2Ipv6RangeList = (output: any, context: __SerdeContext): Ipv6Range[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Ipv6Range(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Ipv6Range(entry, context); + }); }; const deserializeAws_ec2KeyPair = (output: any, context: __SerdeContext): KeyPair => { @@ -57947,7 +59387,14 @@ const deserializeAws_ec2KeyPairInfo = (output: any, context: __SerdeContext): Ke }; const deserializeAws_ec2KeyPairList = (output: any, context: __SerdeContext): KeyPairInfo[] => { - return (output || []).map((entry: any) => deserializeAws_ec2KeyPairInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2KeyPairInfo(entry, context); + }); }; const deserializeAws_ec2LastError = (output: any, context: __SerdeContext): LastError => { @@ -57979,7 +59426,14 @@ const deserializeAws_ec2LaunchPermission = (output: any, context: __SerdeContext }; const deserializeAws_ec2LaunchPermissionList = (output: any, context: __SerdeContext): LaunchPermission[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LaunchPermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchPermission(entry, context); + }); }; const deserializeAws_ec2LaunchSpecification = (output: any, context: __SerdeContext): LaunchSpecification => { @@ -58070,7 +59524,14 @@ const deserializeAws_ec2LaunchSpecification = (output: any, context: __SerdeCont }; const deserializeAws_ec2LaunchSpecsList = (output: any, context: __SerdeContext): SpotFleetLaunchSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SpotFleetLaunchSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SpotFleetLaunchSpecification(entry, context); + }); }; const deserializeAws_ec2LaunchTemplate = (output: any, context: __SerdeContext): LaunchTemplate => { @@ -58159,7 +59620,14 @@ const deserializeAws_ec2LaunchTemplateBlockDeviceMappingList = ( output: any, context: __SerdeContext ): LaunchTemplateBlockDeviceMapping[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LaunchTemplateBlockDeviceMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchTemplateBlockDeviceMapping(entry, context); + }); }; const deserializeAws_ec2LaunchTemplateCapacityReservationSpecificationResponse = ( @@ -58206,7 +59674,14 @@ const deserializeAws_ec2LaunchTemplateConfig = (output: any, context: __SerdeCon }; const deserializeAws_ec2LaunchTemplateConfigList = (output: any, context: __SerdeContext): LaunchTemplateConfig[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LaunchTemplateConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchTemplateConfig(entry, context); + }); }; const deserializeAws_ec2LaunchTemplateCpuOptions = (output: any, context: __SerdeContext): LaunchTemplateCpuOptions => { @@ -58285,9 +59760,14 @@ const deserializeAws_ec2LaunchTemplateElasticInferenceAcceleratorResponseList = output: any, context: __SerdeContext ): LaunchTemplateElasticInferenceAcceleratorResponse[] => { - return (output || []).map((entry: any) => - deserializeAws_ec2LaunchTemplateElasticInferenceAcceleratorResponse(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchTemplateElasticInferenceAcceleratorResponse(entry, context); + }); }; const deserializeAws_ec2LaunchTemplateEnclaveOptions = ( @@ -58466,9 +59946,14 @@ const deserializeAws_ec2LaunchTemplateInstanceNetworkInterfaceSpecificationList output: any, context: __SerdeContext ): LaunchTemplateInstanceNetworkInterfaceSpecification[] => { - return (output || []).map((entry: any) => - deserializeAws_ec2LaunchTemplateInstanceNetworkInterfaceSpecification(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchTemplateInstanceNetworkInterfaceSpecification(entry, context); + }); }; const deserializeAws_ec2LaunchTemplateLicenseConfiguration = ( @@ -58488,7 +59973,14 @@ const deserializeAws_ec2LaunchTemplateLicenseList = ( output: any, context: __SerdeContext ): LaunchTemplateLicenseConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LaunchTemplateLicenseConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchTemplateLicenseConfiguration(entry, context); + }); }; const deserializeAws_ec2LaunchTemplateOverrides = (output: any, context: __SerdeContext): LaunchTemplateOverrides => { @@ -58525,7 +60017,14 @@ const deserializeAws_ec2LaunchTemplateOverridesList = ( output: any, context: __SerdeContext ): LaunchTemplateOverrides[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LaunchTemplateOverrides(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchTemplateOverrides(entry, context); + }); }; const deserializeAws_ec2LaunchTemplatePlacement = (output: any, context: __SerdeContext): LaunchTemplatePlacement => { @@ -58567,7 +60066,14 @@ const deserializeAws_ec2LaunchTemplatePlacement = (output: any, context: __Serde }; const deserializeAws_ec2LaunchTemplateSet = (output: any, context: __SerdeContext): LaunchTemplate[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LaunchTemplate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchTemplate(entry, context); + }); }; const deserializeAws_ec2LaunchTemplatesMonitoring = ( @@ -58636,7 +60142,14 @@ const deserializeAws_ec2LaunchTemplateTagSpecificationList = ( output: any, context: __SerdeContext ): LaunchTemplateTagSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LaunchTemplateTagSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchTemplateTagSpecification(entry, context); + }); }; const deserializeAws_ec2LaunchTemplateVersion = (output: any, context: __SerdeContext): LaunchTemplateVersion => { @@ -58678,7 +60191,14 @@ const deserializeAws_ec2LaunchTemplateVersion = (output: any, context: __SerdeCo }; const deserializeAws_ec2LaunchTemplateVersionSet = (output: any, context: __SerdeContext): LaunchTemplateVersion[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LaunchTemplateVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LaunchTemplateVersion(entry, context); + }); }; const deserializeAws_ec2LicenseConfiguration = (output: any, context: __SerdeContext): LicenseConfiguration => { @@ -58692,7 +60212,14 @@ const deserializeAws_ec2LicenseConfiguration = (output: any, context: __SerdeCon }; const deserializeAws_ec2LicenseList = (output: any, context: __SerdeContext): LicenseConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LicenseConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LicenseConfiguration(entry, context); + }); }; const deserializeAws_ec2LoadBalancersConfig = (output: any, context: __SerdeContext): LoadBalancersConfig => { @@ -58727,7 +60254,14 @@ const deserializeAws_ec2LoadPermission = (output: any, context: __SerdeContext): }; const deserializeAws_ec2LoadPermissionList = (output: any, context: __SerdeContext): LoadPermission[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LoadPermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LoadPermission(entry, context); + }); }; const deserializeAws_ec2LocalGateway = (output: any, context: __SerdeContext): LocalGateway => { @@ -58794,7 +60328,14 @@ const deserializeAws_ec2LocalGatewayRoute = (output: any, context: __SerdeContex }; const deserializeAws_ec2LocalGatewayRouteList = (output: any, context: __SerdeContext): LocalGatewayRoute[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LocalGatewayRoute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LocalGatewayRoute(entry, context); + }); }; const deserializeAws_ec2LocalGatewayRouteTable = (output: any, context: __SerdeContext): LocalGatewayRouteTable => { @@ -58838,7 +60379,14 @@ const deserializeAws_ec2LocalGatewayRouteTableSet = ( output: any, context: __SerdeContext ): LocalGatewayRouteTable[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LocalGatewayRouteTable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LocalGatewayRouteTable(entry, context); + }); }; const deserializeAws_ec2LocalGatewayRouteTableVirtualInterfaceGroupAssociation = ( @@ -58890,9 +60438,14 @@ const deserializeAws_ec2LocalGatewayRouteTableVirtualInterfaceGroupAssociationSe output: any, context: __SerdeContext ): LocalGatewayRouteTableVirtualInterfaceGroupAssociation[] => { - return (output || []).map((entry: any) => - deserializeAws_ec2LocalGatewayRouteTableVirtualInterfaceGroupAssociation(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LocalGatewayRouteTableVirtualInterfaceGroupAssociation(entry, context); + }); }; const deserializeAws_ec2LocalGatewayRouteTableVpcAssociation = ( @@ -58943,11 +60496,25 @@ const deserializeAws_ec2LocalGatewayRouteTableVpcAssociationSet = ( output: any, context: __SerdeContext ): LocalGatewayRouteTableVpcAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LocalGatewayRouteTableVpcAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LocalGatewayRouteTableVpcAssociation(entry, context); + }); }; const deserializeAws_ec2LocalGatewaySet = (output: any, context: __SerdeContext): LocalGateway[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LocalGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LocalGateway(entry, context); + }); }; const deserializeAws_ec2LocalGatewayVirtualInterface = ( @@ -59043,18 +60610,39 @@ const deserializeAws_ec2LocalGatewayVirtualInterfaceGroupSet = ( output: any, context: __SerdeContext ): LocalGatewayVirtualInterfaceGroup[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LocalGatewayVirtualInterfaceGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LocalGatewayVirtualInterfaceGroup(entry, context); + }); }; const deserializeAws_ec2LocalGatewayVirtualInterfaceIdSet = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2LocalGatewayVirtualInterfaceSet = ( output: any, context: __SerdeContext ): LocalGatewayVirtualInterface[] => { - return (output || []).map((entry: any) => deserializeAws_ec2LocalGatewayVirtualInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2LocalGatewayVirtualInterface(entry, context); + }); }; const deserializeAws_ec2ManagedPrefixList = (output: any, context: __SerdeContext): ManagedPrefixList => { @@ -59107,7 +60695,14 @@ const deserializeAws_ec2ManagedPrefixList = (output: any, context: __SerdeContex }; const deserializeAws_ec2ManagedPrefixListSet = (output: any, context: __SerdeContext): ManagedPrefixList[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ManagedPrefixList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ManagedPrefixList(entry, context); + }); }; const deserializeAws_ec2MemoryInfo = (output: any, context: __SerdeContext): MemoryInfo => { @@ -59669,7 +61264,14 @@ const deserializeAws_ec2MovingAddressStatus = (output: any, context: __SerdeCont }; const deserializeAws_ec2MovingAddressStatusSet = (output: any, context: __SerdeContext): MovingAddressStatus[] => { - return (output || []).map((entry: any) => deserializeAws_ec2MovingAddressStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2MovingAddressStatus(entry, context); + }); }; const deserializeAws_ec2NatGateway = (output: any, context: __SerdeContext): NatGateway => { @@ -59754,11 +61356,25 @@ const deserializeAws_ec2NatGatewayAddress = (output: any, context: __SerdeContex }; const deserializeAws_ec2NatGatewayAddressList = (output: any, context: __SerdeContext): NatGatewayAddress[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NatGatewayAddress(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NatGatewayAddress(entry, context); + }); }; const deserializeAws_ec2NatGatewayList = (output: any, context: __SerdeContext): NatGateway[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NatGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NatGateway(entry, context); + }); }; const deserializeAws_ec2NetworkAcl = (output: any, context: __SerdeContext): NetworkAcl => { @@ -59829,7 +61445,14 @@ const deserializeAws_ec2NetworkAclAssociation = (output: any, context: __SerdeCo }; const deserializeAws_ec2NetworkAclAssociationList = (output: any, context: __SerdeContext): NetworkAclAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkAclAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkAclAssociation(entry, context); + }); }; const deserializeAws_ec2NetworkAclEntry = (output: any, context: __SerdeContext): NetworkAclEntry => { @@ -59871,11 +61494,25 @@ const deserializeAws_ec2NetworkAclEntry = (output: any, context: __SerdeContext) }; const deserializeAws_ec2NetworkAclEntryList = (output: any, context: __SerdeContext): NetworkAclEntry[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkAclEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkAclEntry(entry, context); + }); }; const deserializeAws_ec2NetworkAclList = (output: any, context: __SerdeContext): NetworkAcl[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkAcl(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkAcl(entry, context); + }); }; const deserializeAws_ec2NetworkCardInfo = (output: any, context: __SerdeContext): NetworkCardInfo => { @@ -59897,7 +61534,14 @@ const deserializeAws_ec2NetworkCardInfo = (output: any, context: __SerdeContext) }; const deserializeAws_ec2NetworkCardInfoList = (output: any, context: __SerdeContext): NetworkCardInfo[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkCardInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkCardInfo(entry, context); + }); }; const deserializeAws_ec2NetworkInfo = (output: any, context: __SerdeContext): NetworkInfo => { @@ -60047,7 +61691,14 @@ const deserializeAws_ec2NetworkInsightsAnalysisList = ( output: any, context: __SerdeContext ): NetworkInsightsAnalysis[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkInsightsAnalysis(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkInsightsAnalysis(entry, context); + }); }; const deserializeAws_ec2NetworkInsightsPath = (output: any, context: __SerdeContext): NetworkInsightsPath => { @@ -60100,7 +61751,14 @@ const deserializeAws_ec2NetworkInsightsPath = (output: any, context: __SerdeCont }; const deserializeAws_ec2NetworkInsightsPathList = (output: any, context: __SerdeContext): NetworkInsightsPath[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkInsightsPath(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkInsightsPath(entry, context); + }); }; const deserializeAws_ec2NetworkInterface = (output: any, context: __SerdeContext): NetworkInterface => { @@ -60309,11 +61967,25 @@ const deserializeAws_ec2NetworkInterfaceIpv6AddressesList = ( output: any, context: __SerdeContext ): NetworkInterfaceIpv6Address[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkInterfaceIpv6Address(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkInterfaceIpv6Address(entry, context); + }); }; const deserializeAws_ec2NetworkInterfaceList = (output: any, context: __SerdeContext): NetworkInterface[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkInterface(entry, context); + }); }; const deserializeAws_ec2NetworkInterfacePermission = ( @@ -60353,7 +62025,14 @@ const deserializeAws_ec2NetworkInterfacePermissionList = ( output: any, context: __SerdeContext ): NetworkInterfacePermission[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkInterfacePermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkInterfacePermission(entry, context); + }); }; const deserializeAws_ec2NetworkInterfacePermissionState = ( @@ -60402,11 +62081,25 @@ const deserializeAws_ec2NetworkInterfacePrivateIpAddressList = ( output: any, context: __SerdeContext ): NetworkInterfacePrivateIpAddress[] => { - return (output || []).map((entry: any) => deserializeAws_ec2NetworkInterfacePrivateIpAddress(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2NetworkInterfacePrivateIpAddress(entry, context); + }); }; const deserializeAws_ec2OccurrenceDaySet = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => parseInt(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return parseInt(entry); + }); }; const deserializeAws_ec2OnDemandOptions = (output: any, context: __SerdeContext): OnDemandOptions => { @@ -60493,7 +62186,14 @@ const deserializeAws_ec2PathComponent = (output: any, context: __SerdeContext): }; const deserializeAws_ec2PathComponentList = (output: any, context: __SerdeContext): PathComponent[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PathComponent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PathComponent(entry, context); + }); }; const deserializeAws_ec2PciId = (output: any, context: __SerdeContext): PciId => { @@ -60574,7 +62274,14 @@ const deserializeAws_ec2Phase1DHGroupNumbersList = ( output: any, context: __SerdeContext ): Phase1DHGroupNumbersListValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Phase1DHGroupNumbersListValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Phase1DHGroupNumbersListValue(entry, context); + }); }; const deserializeAws_ec2Phase1DHGroupNumbersListValue = ( @@ -60594,7 +62301,14 @@ const deserializeAws_ec2Phase1EncryptionAlgorithmsList = ( output: any, context: __SerdeContext ): Phase1EncryptionAlgorithmsListValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Phase1EncryptionAlgorithmsListValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Phase1EncryptionAlgorithmsListValue(entry, context); + }); }; const deserializeAws_ec2Phase1EncryptionAlgorithmsListValue = ( @@ -60614,7 +62328,14 @@ const deserializeAws_ec2Phase1IntegrityAlgorithmsList = ( output: any, context: __SerdeContext ): Phase1IntegrityAlgorithmsListValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Phase1IntegrityAlgorithmsListValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Phase1IntegrityAlgorithmsListValue(entry, context); + }); }; const deserializeAws_ec2Phase1IntegrityAlgorithmsListValue = ( @@ -60634,7 +62355,14 @@ const deserializeAws_ec2Phase2DHGroupNumbersList = ( output: any, context: __SerdeContext ): Phase2DHGroupNumbersListValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Phase2DHGroupNumbersListValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Phase2DHGroupNumbersListValue(entry, context); + }); }; const deserializeAws_ec2Phase2DHGroupNumbersListValue = ( @@ -60654,7 +62382,14 @@ const deserializeAws_ec2Phase2EncryptionAlgorithmsList = ( output: any, context: __SerdeContext ): Phase2EncryptionAlgorithmsListValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Phase2EncryptionAlgorithmsListValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Phase2EncryptionAlgorithmsListValue(entry, context); + }); }; const deserializeAws_ec2Phase2EncryptionAlgorithmsListValue = ( @@ -60674,7 +62409,14 @@ const deserializeAws_ec2Phase2IntegrityAlgorithmsList = ( output: any, context: __SerdeContext ): Phase2IntegrityAlgorithmsListValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Phase2IntegrityAlgorithmsListValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Phase2IntegrityAlgorithmsListValue(entry, context); + }); }; const deserializeAws_ec2Phase2IntegrityAlgorithmsListValue = ( @@ -60778,14 +62520,28 @@ const deserializeAws_ec2PlacementGroupInfo = (output: any, context: __SerdeConte }; const deserializeAws_ec2PlacementGroupList = (output: any, context: __SerdeContext): PlacementGroup[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PlacementGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PlacementGroup(entry, context); + }); }; const deserializeAws_ec2PlacementGroupStrategyList = ( output: any, context: __SerdeContext ): (PlacementGroupStrategy | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2PlacementResponse = (output: any, context: __SerdeContext): PlacementResponse => { @@ -60809,7 +62565,14 @@ const deserializeAws_ec2PoolCidrBlock = (output: any, context: __SerdeContext): }; const deserializeAws_ec2PoolCidrBlocksSet = (output: any, context: __SerdeContext): PoolCidrBlock[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PoolCidrBlock(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PoolCidrBlock(entry, context); + }); }; const deserializeAws_ec2PortRange = (output: any, context: __SerdeContext): PortRange => { @@ -60827,7 +62590,14 @@ const deserializeAws_ec2PortRange = (output: any, context: __SerdeContext): Port }; const deserializeAws_ec2PortRangeList = (output: any, context: __SerdeContext): PortRange[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PortRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PortRange(entry, context); + }); }; const deserializeAws_ec2PrefixList = (output: any, context: __SerdeContext): PrefixList => { @@ -60866,7 +62636,14 @@ const deserializeAws_ec2PrefixListAssociation = (output: any, context: __SerdeCo }; const deserializeAws_ec2PrefixListAssociationSet = (output: any, context: __SerdeContext): PrefixListAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PrefixListAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PrefixListAssociation(entry, context); + }); }; const deserializeAws_ec2PrefixListEntry = (output: any, context: __SerdeContext): PrefixListEntry => { @@ -60884,7 +62661,14 @@ const deserializeAws_ec2PrefixListEntry = (output: any, context: __SerdeContext) }; const deserializeAws_ec2PrefixListEntrySet = (output: any, context: __SerdeContext): PrefixListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PrefixListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PrefixListEntry(entry, context); + }); }; const deserializeAws_ec2PrefixListId = (output: any, context: __SerdeContext): PrefixListId => { @@ -60902,15 +62686,36 @@ const deserializeAws_ec2PrefixListId = (output: any, context: __SerdeContext): P }; const deserializeAws_ec2PrefixListIdList = (output: any, context: __SerdeContext): PrefixListId[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PrefixListId(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PrefixListId(entry, context); + }); }; const deserializeAws_ec2PrefixListIdSet = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2PrefixListSet = (output: any, context: __SerdeContext): PrefixList[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PrefixList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PrefixList(entry, context); + }); }; const deserializeAws_ec2PriceSchedule = (output: any, context: __SerdeContext): PriceSchedule => { @@ -60936,7 +62741,14 @@ const deserializeAws_ec2PriceSchedule = (output: any, context: __SerdeContext): }; const deserializeAws_ec2PriceScheduleList = (output: any, context: __SerdeContext): PriceSchedule[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PriceSchedule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PriceSchedule(entry, context); + }); }; const deserializeAws_ec2PricingDetail = (output: any, context: __SerdeContext): PricingDetail => { @@ -60954,7 +62766,14 @@ const deserializeAws_ec2PricingDetail = (output: any, context: __SerdeContext): }; const deserializeAws_ec2PricingDetailsList = (output: any, context: __SerdeContext): PricingDetail[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PricingDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PricingDetail(entry, context); + }); }; const deserializeAws_ec2PrincipalIdFormat = (output: any, context: __SerdeContext): PrincipalIdFormat => { @@ -60975,7 +62794,14 @@ const deserializeAws_ec2PrincipalIdFormat = (output: any, context: __SerdeContex }; const deserializeAws_ec2PrincipalIdFormatList = (output: any, context: __SerdeContext): PrincipalIdFormat[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PrincipalIdFormat(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PrincipalIdFormat(entry, context); + }); }; const deserializeAws_ec2PrivateDnsDetails = (output: any, context: __SerdeContext): PrivateDnsDetails => { @@ -60989,7 +62815,14 @@ const deserializeAws_ec2PrivateDnsDetails = (output: any, context: __SerdeContex }; const deserializeAws_ec2PrivateDnsDetailsSet = (output: any, context: __SerdeContext): PrivateDnsDetails[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PrivateDnsDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PrivateDnsDetails(entry, context); + }); }; const deserializeAws_ec2PrivateDnsNameConfiguration = ( @@ -61038,7 +62871,14 @@ const deserializeAws_ec2PrivateIpAddressSpecificationList = ( output: any, context: __SerdeContext ): PrivateIpAddressSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PrivateIpAddressSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PrivateIpAddressSpecification(entry, context); + }); }; const deserializeAws_ec2ProcessorInfo = (output: any, context: __SerdeContext): ProcessorInfo => { @@ -61076,7 +62916,14 @@ const deserializeAws_ec2ProductCode = (output: any, context: __SerdeContext): Pr }; const deserializeAws_ec2ProductCodeList = (output: any, context: __SerdeContext): ProductCode[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ProductCode(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ProductCode(entry, context); + }); }; const deserializeAws_ec2PropagatingVgw = (output: any, context: __SerdeContext): PropagatingVgw => { @@ -61090,7 +62937,14 @@ const deserializeAws_ec2PropagatingVgw = (output: any, context: __SerdeContext): }; const deserializeAws_ec2PropagatingVgwList = (output: any, context: __SerdeContext): PropagatingVgw[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PropagatingVgw(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PropagatingVgw(entry, context); + }); }; const deserializeAws_ec2ProvisionByoipCidrResult = (output: any, context: __SerdeContext): ProvisionByoipCidrResult => { @@ -61195,11 +63049,25 @@ const deserializeAws_ec2PublicIpv4PoolRange = (output: any, context: __SerdeCont }; const deserializeAws_ec2PublicIpv4PoolRangeSet = (output: any, context: __SerdeContext): PublicIpv4PoolRange[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PublicIpv4PoolRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PublicIpv4PoolRange(entry, context); + }); }; const deserializeAws_ec2PublicIpv4PoolSet = (output: any, context: __SerdeContext): PublicIpv4Pool[] => { - return (output || []).map((entry: any) => deserializeAws_ec2PublicIpv4Pool(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2PublicIpv4Pool(entry, context); + }); }; const deserializeAws_ec2Purchase = (output: any, context: __SerdeContext): Purchase => { @@ -61247,7 +63115,14 @@ const deserializeAws_ec2Purchase = (output: any, context: __SerdeContext): Purch }; const deserializeAws_ec2PurchasedScheduledInstanceSet = (output: any, context: __SerdeContext): ScheduledInstance[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ScheduledInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ScheduledInstance(entry, context); + }); }; const deserializeAws_ec2PurchaseHostReservationResult = ( @@ -61315,7 +63190,14 @@ const deserializeAws_ec2PurchaseScheduledInstancesResult = ( }; const deserializeAws_ec2PurchaseSet = (output: any, context: __SerdeContext): Purchase[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Purchase(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Purchase(entry, context); + }); }; const deserializeAws_ec2RecurringCharge = (output: any, context: __SerdeContext): RecurringCharge => { @@ -61333,7 +63215,14 @@ const deserializeAws_ec2RecurringCharge = (output: any, context: __SerdeContext) }; const deserializeAws_ec2RecurringChargesList = (output: any, context: __SerdeContext): RecurringCharge[] => { - return (output || []).map((entry: any) => deserializeAws_ec2RecurringCharge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2RecurringCharge(entry, context); + }); }; const deserializeAws_ec2Region = (output: any, context: __SerdeContext): Region => { @@ -61355,7 +63244,14 @@ const deserializeAws_ec2Region = (output: any, context: __SerdeContext): Region }; const deserializeAws_ec2RegionList = (output: any, context: __SerdeContext): Region[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Region(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Region(entry, context); + }); }; const deserializeAws_ec2RegisterImageResult = (output: any, context: __SerdeContext): RegisterImageResult => { @@ -61649,7 +63545,14 @@ const deserializeAws_ec2Reservation = (output: any, context: __SerdeContext): Re }; const deserializeAws_ec2ReservationList = (output: any, context: __SerdeContext): Reservation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Reservation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Reservation(entry, context); + }); }; const deserializeAws_ec2ReservationValue = (output: any, context: __SerdeContext): ReservationValue => { @@ -61691,7 +63594,14 @@ const deserializeAws_ec2ReservedInstanceReservationValueSet = ( output: any, context: __SerdeContext ): ReservedInstanceReservationValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ReservedInstanceReservationValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ReservedInstanceReservationValue(entry, context); + }); }; const deserializeAws_ec2ReservedInstances = (output: any, context: __SerdeContext): ReservedInstances => { @@ -61821,7 +63731,14 @@ const deserializeAws_ec2ReservedInstancesId = (output: any, context: __SerdeCont }; const deserializeAws_ec2ReservedInstancesList = (output: any, context: __SerdeContext): ReservedInstances[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ReservedInstances(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ReservedInstances(entry, context); + }); }; const deserializeAws_ec2ReservedInstancesListing = (output: any, context: __SerdeContext): ReservedInstancesListing => { @@ -61889,7 +63806,14 @@ const deserializeAws_ec2ReservedInstancesListingList = ( output: any, context: __SerdeContext ): ReservedInstancesListing[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ReservedInstancesListing(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ReservedInstancesListing(entry, context); + }); }; const deserializeAws_ec2ReservedInstancesModification = ( @@ -61953,7 +63877,14 @@ const deserializeAws_ec2ReservedInstancesModificationList = ( output: any, context: __SerdeContext ): ReservedInstancesModification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ReservedInstancesModification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ReservedInstancesModification(entry, context); + }); }; const deserializeAws_ec2ReservedInstancesModificationResult = ( @@ -61980,7 +63911,14 @@ const deserializeAws_ec2ReservedInstancesModificationResultList = ( output: any, context: __SerdeContext ): ReservedInstancesModificationResult[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ReservedInstancesModificationResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ReservedInstancesModificationResult(entry, context); + }); }; const deserializeAws_ec2ReservedInstancesOffering = ( @@ -62068,11 +64006,25 @@ const deserializeAws_ec2ReservedInstancesOfferingList = ( output: any, context: __SerdeContext ): ReservedInstancesOffering[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ReservedInstancesOffering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ReservedInstancesOffering(entry, context); + }); }; const deserializeAws_ec2ReservedIntancesIds = (output: any, context: __SerdeContext): ReservedInstancesId[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ReservedInstancesId(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ReservedInstancesId(entry, context); + }); }; const deserializeAws_ec2ResetEbsDefaultKmsKeyIdResult = ( @@ -62116,11 +64068,25 @@ const deserializeAws_ec2ResponseError = (output: any, context: __SerdeContext): }; const deserializeAws_ec2ResponseHostIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2ResponseHostIdSet = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2ResponseLaunchTemplateData = ( @@ -62399,7 +64365,14 @@ const deserializeAws_ec2RevokeSecurityGroupIngressResult = ( }; const deserializeAws_ec2RootDeviceTypeList = (output: any, context: __SerdeContext): (RootDeviceType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2Route = (output: any, context: __SerdeContext): Route => { @@ -62469,7 +64442,14 @@ const deserializeAws_ec2Route = (output: any, context: __SerdeContext): Route => }; const deserializeAws_ec2RouteList = (output: any, context: __SerdeContext): Route[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Route(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Route(entry, context); + }); }; const deserializeAws_ec2RouteTable = (output: any, context: __SerdeContext): RouteTable => { @@ -62555,7 +64535,14 @@ const deserializeAws_ec2RouteTableAssociation = (output: any, context: __SerdeCo }; const deserializeAws_ec2RouteTableAssociationList = (output: any, context: __SerdeContext): RouteTableAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2RouteTableAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2RouteTableAssociation(entry, context); + }); }; const deserializeAws_ec2RouteTableAssociationState = ( @@ -62576,7 +64563,14 @@ const deserializeAws_ec2RouteTableAssociationState = ( }; const deserializeAws_ec2RouteTableList = (output: any, context: __SerdeContext): RouteTable[] => { - return (output || []).map((entry: any) => deserializeAws_ec2RouteTable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2RouteTable(entry, context); + }); }; const deserializeAws_ec2RunInstancesMonitoringEnabled = ( @@ -62768,7 +64762,14 @@ const deserializeAws_ec2ScheduledInstanceAvailabilitySet = ( output: any, context: __SerdeContext ): ScheduledInstanceAvailability[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ScheduledInstanceAvailability(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ScheduledInstanceAvailability(entry, context); + }); }; const deserializeAws_ec2ScheduledInstanceRecurrence = ( @@ -62807,7 +64808,14 @@ const deserializeAws_ec2ScheduledInstanceRecurrence = ( }; const deserializeAws_ec2ScheduledInstanceSet = (output: any, context: __SerdeContext): ScheduledInstance[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ScheduledInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ScheduledInstance(entry, context); + }); }; const deserializeAws_ec2SearchLocalGatewayRoutesResult = ( @@ -62947,11 +64955,25 @@ const deserializeAws_ec2SecurityGroupIdentifier = (output: any, context: __Serde }; const deserializeAws_ec2SecurityGroupIdStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2SecurityGroupList = (output: any, context: __SerdeContext): SecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SecurityGroup(entry, context); + }); }; const deserializeAws_ec2SecurityGroupReference = (output: any, context: __SerdeContext): SecurityGroupReference => { @@ -62973,7 +64995,14 @@ const deserializeAws_ec2SecurityGroupReference = (output: any, context: __SerdeC }; const deserializeAws_ec2SecurityGroupReferences = (output: any, context: __SerdeContext): SecurityGroupReference[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SecurityGroupReference(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SecurityGroupReference(entry, context); + }); }; const deserializeAws_ec2ServiceConfiguration = (output: any, context: __SerdeContext): ServiceConfiguration => { @@ -63071,7 +65100,14 @@ const deserializeAws_ec2ServiceConfiguration = (output: any, context: __SerdeCon }; const deserializeAws_ec2ServiceConfigurationSet = (output: any, context: __SerdeContext): ServiceConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ServiceConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ServiceConfiguration(entry, context); + }); }; const deserializeAws_ec2ServiceDetail = (output: any, context: __SerdeContext): ServiceDetail => { @@ -63160,7 +65196,14 @@ const deserializeAws_ec2ServiceDetail = (output: any, context: __SerdeContext): }; const deserializeAws_ec2ServiceDetailSet = (output: any, context: __SerdeContext): ServiceDetail[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ServiceDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ServiceDetail(entry, context); + }); }; const deserializeAws_ec2ServiceTypeDetail = (output: any, context: __SerdeContext): ServiceTypeDetail => { @@ -63174,7 +65217,14 @@ const deserializeAws_ec2ServiceTypeDetail = (output: any, context: __SerdeContex }; const deserializeAws_ec2ServiceTypeDetailSet = (output: any, context: __SerdeContext): ServiceTypeDetail[] => { - return (output || []).map((entry: any) => deserializeAws_ec2ServiceTypeDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2ServiceTypeDetail(entry, context); + }); }; const deserializeAws_ec2Snapshot = (output: any, context: __SerdeContext): Snapshot => { @@ -63289,7 +65339,14 @@ const deserializeAws_ec2SnapshotDetail = (output: any, context: __SerdeContext): }; const deserializeAws_ec2SnapshotDetailList = (output: any, context: __SerdeContext): SnapshotDetail[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SnapshotDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SnapshotDetail(entry, context); + }); }; const deserializeAws_ec2SnapshotInfo = (output: any, context: __SerdeContext): SnapshotInfo => { @@ -63342,11 +65399,25 @@ const deserializeAws_ec2SnapshotInfo = (output: any, context: __SerdeContext): S }; const deserializeAws_ec2SnapshotList = (output: any, context: __SerdeContext): Snapshot[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Snapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Snapshot(entry, context); + }); }; const deserializeAws_ec2SnapshotSet = (output: any, context: __SerdeContext): SnapshotInfo[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SnapshotInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SnapshotInfo(entry, context); + }); }; const deserializeAws_ec2SnapshotTaskDetail = (output: any, context: __SerdeContext): SnapshotTaskDetail => { @@ -63719,7 +65790,14 @@ const deserializeAws_ec2SpotFleetRequestConfigSet = ( output: any, context: __SerdeContext ): SpotFleetRequestConfig[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SpotFleetRequestConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SpotFleetRequestConfig(entry, context); + }); }; const deserializeAws_ec2SpotFleetTagSpecification = ( @@ -63746,7 +65824,14 @@ const deserializeAws_ec2SpotFleetTagSpecificationList = ( output: any, context: __SerdeContext ): SpotFleetTagSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SpotFleetTagSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SpotFleetTagSpecification(entry, context); + }); }; const deserializeAws_ec2SpotInstanceRequest = (output: any, context: __SerdeContext): SpotInstanceRequest => { @@ -63835,7 +65920,14 @@ const deserializeAws_ec2SpotInstanceRequest = (output: any, context: __SerdeCont }; const deserializeAws_ec2SpotInstanceRequestList = (output: any, context: __SerdeContext): SpotInstanceRequest[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SpotInstanceRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SpotInstanceRequest(entry, context); + }); }; const deserializeAws_ec2SpotInstanceStateFault = (output: any, context: __SerdeContext): SpotInstanceStateFault => { @@ -63969,7 +66061,14 @@ const deserializeAws_ec2SpotPrice = (output: any, context: __SerdeContext): Spot }; const deserializeAws_ec2SpotPriceHistoryList = (output: any, context: __SerdeContext): SpotPrice[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SpotPrice(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SpotPrice(entry, context); + }); }; const deserializeAws_ec2StaleIpPermission = (output: any, context: __SerdeContext): StaleIpPermission => { @@ -64018,7 +66117,14 @@ const deserializeAws_ec2StaleIpPermission = (output: any, context: __SerdeContex }; const deserializeAws_ec2StaleIpPermissionSet = (output: any, context: __SerdeContext): StaleIpPermission[] => { - return (output || []).map((entry: any) => deserializeAws_ec2StaleIpPermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2StaleIpPermission(entry, context); + }); }; const deserializeAws_ec2StaleSecurityGroup = (output: any, context: __SerdeContext): StaleSecurityGroup => { @@ -64064,7 +66170,14 @@ const deserializeAws_ec2StaleSecurityGroup = (output: any, context: __SerdeConte }; const deserializeAws_ec2StaleSecurityGroupSet = (output: any, context: __SerdeContext): StaleSecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_ec2StaleSecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2StaleSecurityGroup(entry, context); + }); }; const deserializeAws_ec2StartInstancesResult = (output: any, context: __SerdeContext): StartInstancesResult => { @@ -64153,7 +66266,14 @@ const deserializeAws_ec2Storage = (output: any, context: __SerdeContext): Storag }; const deserializeAws_ec2StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2Subnet = (output: any, context: __SerdeContext): Subnet => { @@ -64257,7 +66377,14 @@ const deserializeAws_ec2SubnetAssociation = (output: any, context: __SerdeContex }; const deserializeAws_ec2SubnetAssociationList = (output: any, context: __SerdeContext): SubnetAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SubnetAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SubnetAssociation(entry, context); + }); }; const deserializeAws_ec2SubnetCidrBlockState = (output: any, context: __SerdeContext): SubnetCidrBlockState => { @@ -64299,11 +66426,25 @@ const deserializeAws_ec2SubnetIpv6CidrBlockAssociationSet = ( output: any, context: __SerdeContext ): SubnetIpv6CidrBlockAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SubnetIpv6CidrBlockAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SubnetIpv6CidrBlockAssociation(entry, context); + }); }; const deserializeAws_ec2SubnetList = (output: any, context: __SerdeContext): Subnet[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Subnet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Subnet(entry, context); + }); }; const deserializeAws_ec2SuccessfulInstanceCreditSpecificationItem = ( @@ -64323,9 +66464,14 @@ const deserializeAws_ec2SuccessfulInstanceCreditSpecificationSet = ( output: any, context: __SerdeContext ): SuccessfulInstanceCreditSpecificationItem[] => { - return (output || []).map((entry: any) => - deserializeAws_ec2SuccessfulInstanceCreditSpecificationItem(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SuccessfulInstanceCreditSpecificationItem(entry, context); + }); }; const deserializeAws_ec2SuccessfulQueuedPurchaseDeletion = ( @@ -64345,7 +66491,14 @@ const deserializeAws_ec2SuccessfulQueuedPurchaseDeletionSet = ( output: any, context: __SerdeContext ): SuccessfulQueuedPurchaseDeletion[] => { - return (output || []).map((entry: any) => deserializeAws_ec2SuccessfulQueuedPurchaseDeletion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2SuccessfulQueuedPurchaseDeletion(entry, context); + }); }; const deserializeAws_ec2Tag = (output: any, context: __SerdeContext): Tag => { @@ -64385,11 +66538,25 @@ const deserializeAws_ec2TagDescription = (output: any, context: __SerdeContext): }; const deserializeAws_ec2TagDescriptionList = (output: any, context: __SerdeContext): TagDescription[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TagDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TagDescription(entry, context); + }); }; const deserializeAws_ec2TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Tag(entry, context); + }); }; const deserializeAws_ec2TagSpecification = (output: any, context: __SerdeContext): TagSpecification => { @@ -64410,7 +66577,14 @@ const deserializeAws_ec2TagSpecification = (output: any, context: __SerdeContext }; const deserializeAws_ec2TagSpecificationList = (output: any, context: __SerdeContext): TagSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TagSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TagSpecification(entry, context); + }); }; const deserializeAws_ec2TargetCapacitySpecification = ( @@ -64463,7 +66637,14 @@ const deserializeAws_ec2TargetGroup = (output: any, context: __SerdeContext): Ta }; const deserializeAws_ec2TargetGroups = (output: any, context: __SerdeContext): TargetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TargetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TargetGroup(entry, context); + }); }; const deserializeAws_ec2TargetGroupsConfig = (output: any, context: __SerdeContext): TargetGroupsConfig => { @@ -64519,7 +66700,14 @@ const deserializeAws_ec2TargetNetwork = (output: any, context: __SerdeContext): }; const deserializeAws_ec2TargetNetworkSet = (output: any, context: __SerdeContext): TargetNetwork[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TargetNetwork(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TargetNetwork(entry, context); + }); }; const deserializeAws_ec2TargetReservationValue = (output: any, context: __SerdeContext): TargetReservationValue => { @@ -64540,7 +66728,14 @@ const deserializeAws_ec2TargetReservationValueSet = ( output: any, context: __SerdeContext ): TargetReservationValue[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TargetReservationValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TargetReservationValue(entry, context); + }); }; const deserializeAws_ec2TerminateClientVpnConnectionsResult = ( @@ -64595,7 +66790,14 @@ const deserializeAws_ec2TerminateConnectionStatusSet = ( output: any, context: __SerdeContext ): TerminateConnectionStatus[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TerminateConnectionStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TerminateConnectionStatus(entry, context); + }); }; const deserializeAws_ec2TerminateInstancesResult = (output: any, context: __SerdeContext): TerminateInstancesResult => { @@ -64615,7 +66817,14 @@ const deserializeAws_ec2TerminateInstancesResult = (output: any, context: __Serd }; const deserializeAws_ec2ThreadsPerCoreList = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => parseInt(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return parseInt(entry); + }); }; const deserializeAws_ec2TrafficMirrorFilter = (output: any, context: __SerdeContext): TrafficMirrorFilter => { @@ -64723,18 +66932,39 @@ const deserializeAws_ec2TrafficMirrorFilterRuleList = ( output: any, context: __SerdeContext ): TrafficMirrorFilterRule[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TrafficMirrorFilterRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TrafficMirrorFilterRule(entry, context); + }); }; const deserializeAws_ec2TrafficMirrorFilterSet = (output: any, context: __SerdeContext): TrafficMirrorFilter[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TrafficMirrorFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TrafficMirrorFilter(entry, context); + }); }; const deserializeAws_ec2TrafficMirrorNetworkServiceList = ( output: any, context: __SerdeContext ): (TrafficMirrorNetworkService | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2TrafficMirrorPortRange = (output: any, context: __SerdeContext): TrafficMirrorPortRange => { @@ -64801,7 +67031,14 @@ const deserializeAws_ec2TrafficMirrorSession = (output: any, context: __SerdeCon }; const deserializeAws_ec2TrafficMirrorSessionSet = (output: any, context: __SerdeContext): TrafficMirrorSession[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TrafficMirrorSession(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TrafficMirrorSession(entry, context); + }); }; const deserializeAws_ec2TrafficMirrorTarget = (output: any, context: __SerdeContext): TrafficMirrorTarget => { @@ -64842,7 +67079,14 @@ const deserializeAws_ec2TrafficMirrorTarget = (output: any, context: __SerdeCont }; const deserializeAws_ec2TrafficMirrorTargetSet = (output: any, context: __SerdeContext): TrafficMirrorTarget[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TrafficMirrorTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TrafficMirrorTarget(entry, context); + }); }; const deserializeAws_ec2TransitGateway = (output: any, context: __SerdeContext): TransitGateway => { @@ -65014,14 +67258,28 @@ const deserializeAws_ec2TransitGatewayAttachmentBgpConfigurationList = ( output: any, context: __SerdeContext ): TransitGatewayAttachmentBgpConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayAttachmentBgpConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayAttachmentBgpConfiguration(entry, context); + }); }; const deserializeAws_ec2TransitGatewayAttachmentList = ( output: any, context: __SerdeContext ): TransitGatewayAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayAttachment(entry, context); + }); }; const deserializeAws_ec2TransitGatewayAttachmentPropagation = ( @@ -65045,7 +67303,14 @@ const deserializeAws_ec2TransitGatewayAttachmentPropagationList = ( output: any, context: __SerdeContext ): TransitGatewayAttachmentPropagation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayAttachmentPropagation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayAttachmentPropagation(entry, context); + }); }; const deserializeAws_ec2TransitGatewayConnect = (output: any, context: __SerdeContext): TransitGatewayConnect => { @@ -65086,7 +67351,14 @@ const deserializeAws_ec2TransitGatewayConnect = (output: any, context: __SerdeCo }; const deserializeAws_ec2TransitGatewayConnectList = (output: any, context: __SerdeContext): TransitGatewayConnect[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayConnect(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayConnect(entry, context); + }); }; const deserializeAws_ec2TransitGatewayConnectOptions = ( @@ -65186,11 +67458,25 @@ const deserializeAws_ec2TransitGatewayConnectPeerList = ( output: any, context: __SerdeContext ): TransitGatewayConnectPeer[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayConnectPeer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayConnectPeer(entry, context); + }); }; const deserializeAws_ec2TransitGatewayList = (output: any, context: __SerdeContext): TransitGateway[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGateway(entry, context); + }); }; const deserializeAws_ec2TransitGatewayMulticastDeregisteredGroupMembers = ( @@ -65330,7 +67616,14 @@ const deserializeAws_ec2TransitGatewayMulticastDomainAssociationList = ( output: any, context: __SerdeContext ): TransitGatewayMulticastDomainAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayMulticastDomainAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayMulticastDomainAssociation(entry, context); + }); }; const deserializeAws_ec2TransitGatewayMulticastDomainAssociations = ( @@ -65376,7 +67669,14 @@ const deserializeAws_ec2TransitGatewayMulticastDomainList = ( output: any, context: __SerdeContext ): TransitGatewayMulticastDomain[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayMulticastDomain(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayMulticastDomain(entry, context); + }); }; const deserializeAws_ec2TransitGatewayMulticastDomainOptions = ( @@ -65457,7 +67757,14 @@ const deserializeAws_ec2TransitGatewayMulticastGroupList = ( output: any, context: __SerdeContext ): TransitGatewayMulticastGroup[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayMulticastGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayMulticastGroup(entry, context); + }); }; const deserializeAws_ec2TransitGatewayMulticastRegisteredGroupMembers = ( @@ -65616,7 +67923,14 @@ const deserializeAws_ec2TransitGatewayPeeringAttachmentList = ( output: any, context: __SerdeContext ): TransitGatewayPeeringAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayPeeringAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayPeeringAttachment(entry, context); + }); }; const deserializeAws_ec2TransitGatewayPrefixListAttachment = ( @@ -65680,7 +67994,14 @@ const deserializeAws_ec2TransitGatewayPrefixListReferenceSet = ( output: any, context: __SerdeContext ): TransitGatewayPrefixListReference[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayPrefixListReference(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayPrefixListReference(entry, context); + }); }; const deserializeAws_ec2TransitGatewayPropagation = ( @@ -65769,11 +68090,25 @@ const deserializeAws_ec2TransitGatewayRouteAttachmentList = ( output: any, context: __SerdeContext ): TransitGatewayRouteAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayRouteAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayRouteAttachment(entry, context); + }); }; const deserializeAws_ec2TransitGatewayRouteList = (output: any, context: __SerdeContext): TransitGatewayRoute[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayRoute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayRoute(entry, context); + }); }; const deserializeAws_ec2TransitGatewayRouteTable = (output: any, context: __SerdeContext): TransitGatewayRouteTable => { @@ -65842,14 +68177,28 @@ const deserializeAws_ec2TransitGatewayRouteTableAssociationList = ( output: any, context: __SerdeContext ): TransitGatewayRouteTableAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayRouteTableAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayRouteTableAssociation(entry, context); + }); }; const deserializeAws_ec2TransitGatewayRouteTableList = ( output: any, context: __SerdeContext ): TransitGatewayRouteTable[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayRouteTable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayRouteTable(entry, context); + }); }; const deserializeAws_ec2TransitGatewayRouteTablePropagation = ( @@ -65881,7 +68230,14 @@ const deserializeAws_ec2TransitGatewayRouteTablePropagationList = ( output: any, context: __SerdeContext ): TransitGatewayRouteTablePropagation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayRouteTablePropagation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayRouteTablePropagation(entry, context); + }); }; const deserializeAws_ec2TransitGatewayVpcAttachment = ( @@ -65942,7 +68298,14 @@ const deserializeAws_ec2TransitGatewayVpcAttachmentList = ( output: any, context: __SerdeContext ): TransitGatewayVpcAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TransitGatewayVpcAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TransitGatewayVpcAttachment(entry, context); + }); }; const deserializeAws_ec2TransitGatewayVpcAttachmentOptions = ( @@ -66103,7 +68466,14 @@ const deserializeAws_ec2TunnelOption = (output: any, context: __SerdeContext): T }; const deserializeAws_ec2TunnelOptionsList = (output: any, context: __SerdeContext): TunnelOption[] => { - return (output || []).map((entry: any) => deserializeAws_ec2TunnelOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2TunnelOption(entry, context); + }); }; const deserializeAws_ec2UnassignIpv6AddressesResult = ( @@ -66183,9 +68553,14 @@ const deserializeAws_ec2UnsuccessfulInstanceCreditSpecificationSet = ( output: any, context: __SerdeContext ): UnsuccessfulInstanceCreditSpecificationItem[] => { - return (output || []).map((entry: any) => - deserializeAws_ec2UnsuccessfulInstanceCreditSpecificationItem(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2UnsuccessfulInstanceCreditSpecificationItem(entry, context); + }); }; const deserializeAws_ec2UnsuccessfulItem = (output: any, context: __SerdeContext): UnsuccessfulItem => { @@ -66217,11 +68592,25 @@ const deserializeAws_ec2UnsuccessfulItemError = (output: any, context: __SerdeCo }; const deserializeAws_ec2UnsuccessfulItemList = (output: any, context: __SerdeContext): UnsuccessfulItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2UnsuccessfulItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2UnsuccessfulItem(entry, context); + }); }; const deserializeAws_ec2UnsuccessfulItemSet = (output: any, context: __SerdeContext): UnsuccessfulItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2UnsuccessfulItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2UnsuccessfulItem(entry, context); + }); }; const deserializeAws_ec2UpdateSecurityGroupRuleDescriptionsEgressResult = ( @@ -66251,7 +68640,14 @@ const deserializeAws_ec2UpdateSecurityGroupRuleDescriptionsIngressResult = ( }; const deserializeAws_ec2UsageClassTypeList = (output: any, context: __SerdeContext): (UsageClassType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2UserBucketDetails = (output: any, context: __SerdeContext): UserBucketDetails => { @@ -66303,11 +68699,25 @@ const deserializeAws_ec2UserIdGroupPair = (output: any, context: __SerdeContext) }; const deserializeAws_ec2UserIdGroupPairList = (output: any, context: __SerdeContext): UserIdGroupPair[] => { - return (output || []).map((entry: any) => deserializeAws_ec2UserIdGroupPair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2UserIdGroupPair(entry, context); + }); }; const deserializeAws_ec2UserIdGroupPairSet = (output: any, context: __SerdeContext): UserIdGroupPair[] => { - return (output || []).map((entry: any) => deserializeAws_ec2UserIdGroupPair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2UserIdGroupPair(entry, context); + }); }; const deserializeAws_ec2ValidationError = (output: any, context: __SerdeContext): ValidationError => { @@ -66338,7 +68748,14 @@ const deserializeAws_ec2ValidationWarning = (output: any, context: __SerdeContex }; const deserializeAws_ec2ValueStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2VCpuInfo = (output: any, context: __SerdeContext): VCpuInfo => { @@ -66410,14 +68827,28 @@ const deserializeAws_ec2VgwTelemetry = (output: any, context: __SerdeContext): V }; const deserializeAws_ec2VgwTelemetryList = (output: any, context: __SerdeContext): VgwTelemetry[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VgwTelemetry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VgwTelemetry(entry, context); + }); }; const deserializeAws_ec2VirtualizationTypeList = ( output: any, context: __SerdeContext ): (VirtualizationType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_ec2Volume = (output: any, context: __SerdeContext): Volume => { @@ -66530,11 +68961,25 @@ const deserializeAws_ec2VolumeAttachment = (output: any, context: __SerdeContext }; const deserializeAws_ec2VolumeAttachmentList = (output: any, context: __SerdeContext): VolumeAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VolumeAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VolumeAttachment(entry, context); + }); }; const deserializeAws_ec2VolumeList = (output: any, context: __SerdeContext): Volume[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Volume(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Volume(entry, context); + }); }; const deserializeAws_ec2VolumeModification = (output: any, context: __SerdeContext): VolumeModification => { @@ -66600,7 +69045,14 @@ const deserializeAws_ec2VolumeModification = (output: any, context: __SerdeConte }; const deserializeAws_ec2VolumeModificationList = (output: any, context: __SerdeContext): VolumeModification[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VolumeModification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VolumeModification(entry, context); + }); }; const deserializeAws_ec2VolumeStatusAction = (output: any, context: __SerdeContext): VolumeStatusAction => { @@ -66626,7 +69078,14 @@ const deserializeAws_ec2VolumeStatusAction = (output: any, context: __SerdeConte }; const deserializeAws_ec2VolumeStatusActionsList = (output: any, context: __SerdeContext): VolumeStatusAction[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VolumeStatusAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VolumeStatusAction(entry, context); + }); }; const deserializeAws_ec2VolumeStatusAttachmentStatus = ( @@ -66650,7 +69109,14 @@ const deserializeAws_ec2VolumeStatusAttachmentStatusList = ( output: any, context: __SerdeContext ): VolumeStatusAttachmentStatus[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VolumeStatusAttachmentStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VolumeStatusAttachmentStatus(entry, context); + }); }; const deserializeAws_ec2VolumeStatusDetails = (output: any, context: __SerdeContext): VolumeStatusDetails => { @@ -66668,7 +69134,14 @@ const deserializeAws_ec2VolumeStatusDetails = (output: any, context: __SerdeCont }; const deserializeAws_ec2VolumeStatusDetailsList = (output: any, context: __SerdeContext): VolumeStatusDetails[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VolumeStatusDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VolumeStatusDetails(entry, context); + }); }; const deserializeAws_ec2VolumeStatusEvent = (output: any, context: __SerdeContext): VolumeStatusEvent => { @@ -66702,7 +69175,14 @@ const deserializeAws_ec2VolumeStatusEvent = (output: any, context: __SerdeContex }; const deserializeAws_ec2VolumeStatusEventsList = (output: any, context: __SerdeContext): VolumeStatusEvent[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VolumeStatusEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VolumeStatusEvent(entry, context); + }); }; const deserializeAws_ec2VolumeStatusInfo = (output: any, context: __SerdeContext): VolumeStatusInfo => { @@ -66778,7 +69258,14 @@ const deserializeAws_ec2VolumeStatusItem = (output: any, context: __SerdeContext }; const deserializeAws_ec2VolumeStatusList = (output: any, context: __SerdeContext): VolumeStatusItem[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VolumeStatusItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VolumeStatusItem(entry, context); + }); }; const deserializeAws_ec2Vpc = (output: any, context: __SerdeContext): Vpc => { @@ -66860,7 +69347,14 @@ const deserializeAws_ec2VpcAttachment = (output: any, context: __SerdeContext): }; const deserializeAws_ec2VpcAttachmentList = (output: any, context: __SerdeContext): VpcAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpcAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpcAttachment(entry, context); + }); }; const deserializeAws_ec2VpcCidrBlockAssociation = (output: any, context: __SerdeContext): VpcCidrBlockAssociation => { @@ -66885,7 +69379,14 @@ const deserializeAws_ec2VpcCidrBlockAssociationSet = ( output: any, context: __SerdeContext ): VpcCidrBlockAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpcCidrBlockAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpcCidrBlockAssociation(entry, context); + }); }; const deserializeAws_ec2VpcCidrBlockState = (output: any, context: __SerdeContext): VpcCidrBlockState => { @@ -66924,7 +69425,14 @@ const deserializeAws_ec2VpcClassicLink = (output: any, context: __SerdeContext): }; const deserializeAws_ec2VpcClassicLinkList = (output: any, context: __SerdeContext): VpcClassicLink[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpcClassicLink(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpcClassicLink(entry, context); + }); }; const deserializeAws_ec2VpcEndpoint = (output: any, context: __SerdeContext): VpcEndpoint => { @@ -67082,11 +69590,25 @@ const deserializeAws_ec2VpcEndpointConnection = (output: any, context: __SerdeCo }; const deserializeAws_ec2VpcEndpointConnectionSet = (output: any, context: __SerdeContext): VpcEndpointConnection[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpcEndpointConnection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpcEndpointConnection(entry, context); + }); }; const deserializeAws_ec2VpcEndpointSet = (output: any, context: __SerdeContext): VpcEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpcEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpcEndpoint(entry, context); + }); }; const deserializeAws_ec2VpcIpv6CidrBlockAssociation = ( @@ -67122,11 +69644,25 @@ const deserializeAws_ec2VpcIpv6CidrBlockAssociationSet = ( output: any, context: __SerdeContext ): VpcIpv6CidrBlockAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpcIpv6CidrBlockAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpcIpv6CidrBlockAssociation(entry, context); + }); }; const deserializeAws_ec2VpcList = (output: any, context: __SerdeContext): Vpc[] => { - return (output || []).map((entry: any) => deserializeAws_ec2Vpc(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2Vpc(entry, context); + }); }; const deserializeAws_ec2VpcPeeringConnection = (output: any, context: __SerdeContext): VpcPeeringConnection => { @@ -67163,7 +69699,14 @@ const deserializeAws_ec2VpcPeeringConnection = (output: any, context: __SerdeCon }; const deserializeAws_ec2VpcPeeringConnectionList = (output: any, context: __SerdeContext): VpcPeeringConnection[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpcPeeringConnection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpcPeeringConnection(entry, context); + }); }; const deserializeAws_ec2VpcPeeringConnectionOptionsDescription = ( @@ -67325,7 +69868,14 @@ const deserializeAws_ec2VpnConnection = (output: any, context: __SerdeContext): }; const deserializeAws_ec2VpnConnectionList = (output: any, context: __SerdeContext): VpnConnection[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpnConnection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpnConnection(entry, context); + }); }; const deserializeAws_ec2VpnConnectionOptions = (output: any, context: __SerdeContext): VpnConnectionOptions => { @@ -67416,7 +69966,14 @@ const deserializeAws_ec2VpnGateway = (output: any, context: __SerdeContext): Vpn }; const deserializeAws_ec2VpnGatewayList = (output: any, context: __SerdeContext): VpnGateway[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpnGateway(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpnGateway(entry, context); + }); }; const deserializeAws_ec2VpnStaticRoute = (output: any, context: __SerdeContext): VpnStaticRoute => { @@ -67438,7 +69995,14 @@ const deserializeAws_ec2VpnStaticRoute = (output: any, context: __SerdeContext): }; const deserializeAws_ec2VpnStaticRouteList = (output: any, context: __SerdeContext): VpnStaticRoute[] => { - return (output || []).map((entry: any) => deserializeAws_ec2VpnStaticRoute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_ec2VpnStaticRoute(entry, context); + }); }; const deserializeAws_ec2WithdrawByoipCidrResult = (output: any, context: __SerdeContext): WithdrawByoipCidrResult => { diff --git a/clients/client-ecr-public/protocols/Aws_json1_1.ts b/clients/client-ecr-public/protocols/Aws_json1_1.ts index 7d6c4ca17518..40218cba8f54 100644 --- a/clients/client-ecr-public/protocols/Aws_json1_1.ts +++ b/clients/client-ecr-public/protocols/Aws_json1_1.ts @@ -147,7 +147,7 @@ export const serializeAws_json1_1BatchCheckLayerAvailabilityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.BatchCheckLayerAvailability", }; let body: any; @@ -160,7 +160,7 @@ export const serializeAws_json1_1BatchDeleteImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.BatchDeleteImage", }; let body: any; @@ -173,7 +173,7 @@ export const serializeAws_json1_1CompleteLayerUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.CompleteLayerUpload", }; let body: any; @@ -186,7 +186,7 @@ export const serializeAws_json1_1CreateRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.CreateRepository", }; let body: any; @@ -199,7 +199,7 @@ export const serializeAws_json1_1DeleteRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.DeleteRepository", }; let body: any; @@ -212,7 +212,7 @@ export const serializeAws_json1_1DeleteRepositoryPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.DeleteRepositoryPolicy", }; let body: any; @@ -225,7 +225,7 @@ export const serializeAws_json1_1DescribeImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.DescribeImages", }; let body: any; @@ -238,7 +238,7 @@ export const serializeAws_json1_1DescribeImageTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.DescribeImageTags", }; let body: any; @@ -251,7 +251,7 @@ export const serializeAws_json1_1DescribeRegistriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.DescribeRegistries", }; let body: any; @@ -264,7 +264,7 @@ export const serializeAws_json1_1DescribeRepositoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.DescribeRepositories", }; let body: any; @@ -277,7 +277,7 @@ export const serializeAws_json1_1GetAuthorizationTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.GetAuthorizationToken", }; let body: any; @@ -290,7 +290,7 @@ export const serializeAws_json1_1GetRegistryCatalogDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.GetRegistryCatalogData", }; let body: any; @@ -303,7 +303,7 @@ export const serializeAws_json1_1GetRepositoryCatalogDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.GetRepositoryCatalogData", }; let body: any; @@ -316,7 +316,7 @@ export const serializeAws_json1_1GetRepositoryPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.GetRepositoryPolicy", }; let body: any; @@ -329,7 +329,7 @@ export const serializeAws_json1_1InitiateLayerUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.InitiateLayerUpload", }; let body: any; @@ -342,7 +342,7 @@ export const serializeAws_json1_1PutImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.PutImage", }; let body: any; @@ -355,7 +355,7 @@ export const serializeAws_json1_1PutRegistryCatalogDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.PutRegistryCatalogData", }; let body: any; @@ -368,7 +368,7 @@ export const serializeAws_json1_1PutRepositoryCatalogDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.PutRepositoryCatalogData", }; let body: any; @@ -381,7 +381,7 @@ export const serializeAws_json1_1SetRepositoryPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.SetRepositoryPolicy", }; let body: any; @@ -394,7 +394,7 @@ export const serializeAws_json1_1UploadLayerPartCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SpencerFrontendService.UploadLayerPart", }; let body: any; @@ -429,8 +429,7 @@ const deserializeAws_json1_1BatchCheckLayerAvailabilityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -508,8 +507,7 @@ const deserializeAws_json1_1BatchDeleteImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -579,8 +577,7 @@ const deserializeAws_json1_1CompleteLayerUploadCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EmptyUploadException": case "com.amazonaws.ecrpublic#EmptyUploadException": @@ -706,8 +703,7 @@ const deserializeAws_json1_1CreateRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -785,8 +781,7 @@ const deserializeAws_json1_1DeleteRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -864,8 +859,7 @@ const deserializeAws_json1_1DeleteRepositoryPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -943,8 +937,7 @@ const deserializeAws_json1_1DescribeImagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ImageNotFoundException": case "com.amazonaws.ecrpublic#ImageNotFoundException": @@ -1022,8 +1015,7 @@ const deserializeAws_json1_1DescribeImageTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1093,8 +1085,7 @@ const deserializeAws_json1_1DescribeRegistriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1164,8 +1155,7 @@ const deserializeAws_json1_1DescribeRepositoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1235,8 +1225,7 @@ const deserializeAws_json1_1GetAuthorizationTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1298,8 +1287,7 @@ const deserializeAws_json1_1GetRegistryCatalogDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ServerException": case "com.amazonaws.ecrpublic#ServerException": @@ -1361,8 +1349,7 @@ const deserializeAws_json1_1GetRepositoryCatalogDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1432,8 +1419,7 @@ const deserializeAws_json1_1GetRepositoryPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1511,8 +1497,7 @@ const deserializeAws_json1_1InitiateLayerUploadCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1598,8 +1583,7 @@ const deserializeAws_json1_1PutImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ImageAlreadyExistsException": case "com.amazonaws.ecrpublic#ImageAlreadyExistsException": @@ -1733,8 +1717,7 @@ const deserializeAws_json1_1PutRegistryCatalogDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1804,8 +1787,7 @@ const deserializeAws_json1_1PutRepositoryCatalogDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1875,8 +1857,7 @@ const deserializeAws_json1_1SetRepositoryPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": @@ -1946,8 +1927,7 @@ const deserializeAws_json1_1UploadLayerPartCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLayerPartException": case "com.amazonaws.ecrpublic#InvalidLayerPartException": @@ -2346,7 +2326,14 @@ const deserializeAws_json1_1UploadNotFoundExceptionResponse = async ( }; const serializeAws_json1_1ArchitectureList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchCheckLayerAvailabilityRequest = ( @@ -2354,24 +2341,35 @@ const serializeAws_json1_1BatchCheckLayerAvailabilityRequest = ( context: __SerdeContext ): any => { return { - ...(input.layerDigests !== undefined && { - layerDigests: serializeAws_json1_1BatchedOperationLayerDigestList(input.layerDigests, context), - }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.layerDigests !== undefined && + input.layerDigests !== null && { + layerDigests: serializeAws_json1_1BatchedOperationLayerDigestList(input.layerDigests, context), + }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1BatchDeleteImageRequest = (input: BatchDeleteImageRequest, context: __SerdeContext): any => { return { - ...(input.imageIds !== undefined && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.imageIds !== undefined && + input.imageIds !== null && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1BatchedOperationLayerDigestList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CompleteLayerUploadRequest = ( @@ -2379,21 +2377,25 @@ const serializeAws_json1_1CompleteLayerUploadRequest = ( context: __SerdeContext ): any => { return { - ...(input.layerDigests !== undefined && { - layerDigests: serializeAws_json1_1LayerDigestList(input.layerDigests, context), - }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.uploadId !== undefined && { uploadId: input.uploadId }), + ...(input.layerDigests !== undefined && + input.layerDigests !== null && { + layerDigests: serializeAws_json1_1LayerDigestList(input.layerDigests, context), + }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.uploadId !== undefined && input.uploadId !== null && { uploadId: input.uploadId }), }; }; const serializeAws_json1_1CreateRepositoryRequest = (input: CreateRepositoryRequest, context: __SerdeContext): any => { return { - ...(input.catalogData !== undefined && { - catalogData: serializeAws_json1_1RepositoryCatalogDataInput(input.catalogData, context), - }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.catalogData !== undefined && + input.catalogData !== null && { + catalogData: serializeAws_json1_1RepositoryCatalogDataInput(input.catalogData, context), + }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -2402,26 +2404,30 @@ const serializeAws_json1_1DeleteRepositoryPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1DeleteRepositoryRequest = (input: DeleteRepositoryRequest, context: __SerdeContext): any => { return { - ...(input.force !== undefined && { force: input.force }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1DescribeImagesRequest = (input: DescribeImagesRequest, context: __SerdeContext): any => { return { - ...(input.imageIds !== undefined && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.imageIds !== undefined && + input.imageIds !== null && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -2430,10 +2436,11 @@ const serializeAws_json1_1DescribeImageTagsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -2442,8 +2449,8 @@ const serializeAws_json1_1DescribeRegistriesRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -2452,12 +2459,13 @@ const serializeAws_json1_1DescribeRepositoriesRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryNames !== undefined && { - repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), - }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryNames !== undefined && + input.repositoryNames !== null && { + repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), + }), }; }; @@ -2480,8 +2488,9 @@ const serializeAws_json1_1GetRepositoryCatalogDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -2490,20 +2499,28 @@ const serializeAws_json1_1GetRepositoryPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1ImageIdentifier = (input: ImageIdentifier, context: __SerdeContext): any => { return { - ...(input.imageDigest !== undefined && { imageDigest: input.imageDigest }), - ...(input.imageTag !== undefined && { imageTag: input.imageTag }), + ...(input.imageDigest !== undefined && input.imageDigest !== null && { imageDigest: input.imageDigest }), + ...(input.imageTag !== undefined && input.imageTag !== null && { imageTag: input.imageTag }), }; }; const serializeAws_json1_1ImageIdentifierList = (input: ImageIdentifier[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ImageIdentifier(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ImageIdentifier(entry, context); + }); }; const serializeAws_json1_1InitiateLayerUploadRequest = ( @@ -2511,27 +2528,44 @@ const serializeAws_json1_1InitiateLayerUploadRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1LayerDigestList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OperatingSystemList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutImageRequest = (input: PutImageRequest, context: __SerdeContext): any => { return { - ...(input.imageDigest !== undefined && { imageDigest: input.imageDigest }), - ...(input.imageManifest !== undefined && { imageManifest: input.imageManifest }), - ...(input.imageManifestMediaType !== undefined && { imageManifestMediaType: input.imageManifestMediaType }), - ...(input.imageTag !== undefined && { imageTag: input.imageTag }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.imageDigest !== undefined && input.imageDigest !== null && { imageDigest: input.imageDigest }), + ...(input.imageManifest !== undefined && input.imageManifest !== null && { imageManifest: input.imageManifest }), + ...(input.imageManifestMediaType !== undefined && + input.imageManifestMediaType !== null && { imageManifestMediaType: input.imageManifestMediaType }), + ...(input.imageTag !== undefined && input.imageTag !== null && { imageTag: input.imageTag }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -2540,7 +2574,7 @@ const serializeAws_json1_1PutRegistryCatalogDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.displayName !== undefined && { displayName: input.displayName }), + ...(input.displayName !== undefined && input.displayName !== null && { displayName: input.displayName }), }; }; @@ -2549,11 +2583,13 @@ const serializeAws_json1_1PutRepositoryCatalogDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.catalogData !== undefined && { - catalogData: serializeAws_json1_1RepositoryCatalogDataInput(input.catalogData, context), - }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.catalogData !== undefined && + input.catalogData !== null && { + catalogData: serializeAws_json1_1RepositoryCatalogDataInput(input.catalogData, context), + }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -2562,21 +2598,31 @@ const serializeAws_json1_1RepositoryCatalogDataInput = ( context: __SerdeContext ): any => { return { - ...(input.aboutText !== undefined && { aboutText: input.aboutText }), - ...(input.architectures !== undefined && { - architectures: serializeAws_json1_1ArchitectureList(input.architectures, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.logoImageBlob !== undefined && { logoImageBlob: context.base64Encoder(input.logoImageBlob) }), - ...(input.operatingSystems !== undefined && { - operatingSystems: serializeAws_json1_1OperatingSystemList(input.operatingSystems, context), - }), - ...(input.usageText !== undefined && { usageText: input.usageText }), + ...(input.aboutText !== undefined && input.aboutText !== null && { aboutText: input.aboutText }), + ...(input.architectures !== undefined && + input.architectures !== null && { + architectures: serializeAws_json1_1ArchitectureList(input.architectures, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.logoImageBlob !== undefined && + input.logoImageBlob !== null && { logoImageBlob: context.base64Encoder(input.logoImageBlob) }), + ...(input.operatingSystems !== undefined && + input.operatingSystems !== null && { + operatingSystems: serializeAws_json1_1OperatingSystemList(input.operatingSystems, context), + }), + ...(input.usageText !== undefined && input.usageText !== null && { usageText: input.usageText }), }; }; const serializeAws_json1_1RepositoryNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SetRepositoryPolicyRequest = ( @@ -2584,26 +2630,36 @@ const serializeAws_json1_1SetRepositoryPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.force !== undefined && { force: input.force }), - ...(input.policyText !== undefined && { policyText: input.policyText }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), + ...(input.policyText !== undefined && input.policyText !== null && { policyText: input.policyText }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1UploadLayerPartRequest = (input: UploadLayerPartRequest, context: __SerdeContext): any => { return { - ...(input.layerPartBlob !== undefined && { layerPartBlob: context.base64Encoder(input.layerPartBlob) }), - ...(input.partFirstByte !== undefined && { partFirstByte: input.partFirstByte }), - ...(input.partLastByte !== undefined && { partLastByte: input.partLastByte }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.uploadId !== undefined && { uploadId: input.uploadId }), + ...(input.layerPartBlob !== undefined && + input.layerPartBlob !== null && { layerPartBlob: context.base64Encoder(input.layerPartBlob) }), + ...(input.partFirstByte !== undefined && input.partFirstByte !== null && { partFirstByte: input.partFirstByte }), + ...(input.partLastByte !== undefined && input.partLastByte !== null && { partLastByte: input.partLastByte }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.uploadId !== undefined && input.uploadId !== null && { uploadId: input.uploadId }), }; }; const deserializeAws_json1_1ArchitectureList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AuthorizationData = (output: any, context: __SerdeContext): AuthorizationData => { @@ -2862,7 +2918,14 @@ const deserializeAws_json1_1ImageDetail = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ImageDetailList = (output: any, context: __SerdeContext): ImageDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageDetail(entry, context); + }); }; const deserializeAws_json1_1ImageDigestDoesNotMatchException = ( @@ -2887,7 +2950,14 @@ const deserializeAws_json1_1ImageFailure = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ImageFailureList = (output: any, context: __SerdeContext): ImageFailure[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageFailure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageFailure(entry, context); + }); }; const deserializeAws_json1_1ImageIdentifier = (output: any, context: __SerdeContext): ImageIdentifier => { @@ -2898,7 +2968,14 @@ const deserializeAws_json1_1ImageIdentifier = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ImageIdentifierList = (output: any, context: __SerdeContext): ImageIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageIdentifier(entry, context); + }); }; const deserializeAws_json1_1ImageNotFoundException = (output: any, context: __SerdeContext): ImageNotFoundException => { @@ -2931,11 +3008,25 @@ const deserializeAws_json1_1ImageTagDetail = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ImageTagDetailList = (output: any, context: __SerdeContext): ImageTagDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageTagDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageTagDetail(entry, context); + }); }; const deserializeAws_json1_1ImageTagList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InitiateLayerUploadResponse = ( @@ -3011,11 +3102,25 @@ const deserializeAws_json1_1LayerFailure = (output: any, context: __SerdeContext }; const deserializeAws_json1_1LayerFailureList = (output: any, context: __SerdeContext): LayerFailure[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LayerFailure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LayerFailure(entry, context); + }); }; const deserializeAws_json1_1LayerList = (output: any, context: __SerdeContext): Layer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Layer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Layer(entry, context); + }); }; const deserializeAws_json1_1LayerPartTooSmallException = ( @@ -3043,7 +3148,14 @@ const deserializeAws_json1_1LimitExceededException = (output: any, context: __Se }; const deserializeAws_json1_1OperatingSystemList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PutImageResponse = (output: any, context: __SerdeContext): PutImageResponse => { @@ -3137,7 +3249,14 @@ const deserializeAws_json1_1RegistryAlias = (output: any, context: __SerdeContex }; const deserializeAws_json1_1RegistryAliasList = (output: any, context: __SerdeContext): RegistryAlias[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegistryAlias(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegistryAlias(entry, context); + }); }; const deserializeAws_json1_1RegistryCatalogData = (output: any, context: __SerdeContext): RegistryCatalogData => { @@ -3147,7 +3266,14 @@ const deserializeAws_json1_1RegistryCatalogData = (output: any, context: __Serde }; const deserializeAws_json1_1RegistryList = (output: any, context: __SerdeContext): Registry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Registry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Registry(entry, context); + }); }; const deserializeAws_json1_1RegistryNotFoundException = ( @@ -3206,7 +3332,14 @@ const deserializeAws_json1_1RepositoryCatalogData = (output: any, context: __Ser }; const deserializeAws_json1_1RepositoryList = (output: any, context: __SerdeContext): Repository[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Repository(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Repository(entry, context); + }); }; const deserializeAws_json1_1RepositoryNotEmptyException = ( @@ -3336,3 +3469,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-ecr/protocols/Aws_json1_1.ts b/clients/client-ecr/protocols/Aws_json1_1.ts index 29126c94e02a..f7957fadd5ec 100644 --- a/clients/client-ecr/protocols/Aws_json1_1.ts +++ b/clients/client-ecr/protocols/Aws_json1_1.ts @@ -227,7 +227,7 @@ export const serializeAws_json1_1BatchCheckLayerAvailabilityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.BatchCheckLayerAvailability", }; let body: any; @@ -240,7 +240,7 @@ export const serializeAws_json1_1BatchDeleteImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage", }; let body: any; @@ -253,7 +253,7 @@ export const serializeAws_json1_1BatchGetImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.BatchGetImage", }; let body: any; @@ -266,7 +266,7 @@ export const serializeAws_json1_1CompleteLayerUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.CompleteLayerUpload", }; let body: any; @@ -279,7 +279,7 @@ export const serializeAws_json1_1CreateRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.CreateRepository", }; let body: any; @@ -292,7 +292,7 @@ export const serializeAws_json1_1DeleteLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DeleteLifecyclePolicy", }; let body: any; @@ -305,7 +305,7 @@ export const serializeAws_json1_1DeleteRegistryPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DeleteRegistryPolicy", }; let body: any; @@ -318,7 +318,7 @@ export const serializeAws_json1_1DeleteRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DeleteRepository", }; let body: any; @@ -331,7 +331,7 @@ export const serializeAws_json1_1DeleteRepositoryPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DeleteRepositoryPolicy", }; let body: any; @@ -344,7 +344,7 @@ export const serializeAws_json1_1DescribeImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DescribeImages", }; let body: any; @@ -357,7 +357,7 @@ export const serializeAws_json1_1DescribeImageScanFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DescribeImageScanFindings", }; let body: any; @@ -370,7 +370,7 @@ export const serializeAws_json1_1DescribeRegistryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DescribeRegistry", }; let body: any; @@ -383,7 +383,7 @@ export const serializeAws_json1_1DescribeRepositoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.DescribeRepositories", }; let body: any; @@ -396,7 +396,7 @@ export const serializeAws_json1_1GetAuthorizationTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken", }; let body: any; @@ -409,7 +409,7 @@ export const serializeAws_json1_1GetDownloadUrlForLayerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.GetDownloadUrlForLayer", }; let body: any; @@ -422,7 +422,7 @@ export const serializeAws_json1_1GetLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy", }; let body: any; @@ -435,7 +435,7 @@ export const serializeAws_json1_1GetLifecyclePolicyPreviewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview", }; let body: any; @@ -448,7 +448,7 @@ export const serializeAws_json1_1GetRegistryPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.GetRegistryPolicy", }; let body: any; @@ -461,7 +461,7 @@ export const serializeAws_json1_1GetRepositoryPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy", }; let body: any; @@ -474,7 +474,7 @@ export const serializeAws_json1_1InitiateLayerUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.InitiateLayerUpload", }; let body: any; @@ -487,7 +487,7 @@ export const serializeAws_json1_1ListImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.ListImages", }; let body: any; @@ -500,7 +500,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.ListTagsForResource", }; let body: any; @@ -513,7 +513,7 @@ export const serializeAws_json1_1PutImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.PutImage", }; let body: any; @@ -526,7 +526,7 @@ export const serializeAws_json1_1PutImageScanningConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.PutImageScanningConfiguration", }; let body: any; @@ -539,7 +539,7 @@ export const serializeAws_json1_1PutImageTagMutabilityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.PutImageTagMutability", }; let body: any; @@ -552,7 +552,7 @@ export const serializeAws_json1_1PutLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy", }; let body: any; @@ -565,7 +565,7 @@ export const serializeAws_json1_1PutRegistryPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.PutRegistryPolicy", }; let body: any; @@ -578,7 +578,7 @@ export const serializeAws_json1_1PutReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.PutReplicationConfiguration", }; let body: any; @@ -591,7 +591,7 @@ export const serializeAws_json1_1SetRepositoryPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy", }; let body: any; @@ -604,7 +604,7 @@ export const serializeAws_json1_1StartImageScanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.StartImageScan", }; let body: any; @@ -617,7 +617,7 @@ export const serializeAws_json1_1StartLifecyclePolicyPreviewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview", }; let body: any; @@ -630,7 +630,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.TagResource", }; let body: any; @@ -643,7 +643,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.UntagResource", }; let body: any; @@ -656,7 +656,7 @@ export const serializeAws_json1_1UploadLayerPartCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerRegistry_V20150921.UploadLayerPart", }; let body: any; @@ -691,8 +691,7 @@ const deserializeAws_json1_1BatchCheckLayerAvailabilityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -762,8 +761,7 @@ const deserializeAws_json1_1BatchDeleteImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -833,8 +831,7 @@ const deserializeAws_json1_1BatchGetImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -904,8 +901,7 @@ const deserializeAws_json1_1CompleteLayerUploadCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EmptyUploadException": case "com.amazonaws.ecr#EmptyUploadException": @@ -1023,8 +1019,7 @@ const deserializeAws_json1_1CreateRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1126,8 +1121,7 @@ const deserializeAws_json1_1DeleteLifecyclePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1205,8 +1199,7 @@ const deserializeAws_json1_1DeleteRegistryPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1276,8 +1269,7 @@ const deserializeAws_json1_1DeleteRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1363,8 +1355,7 @@ const deserializeAws_json1_1DeleteRepositoryPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1442,8 +1433,7 @@ const deserializeAws_json1_1DescribeImagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ImageNotFoundException": case "com.amazonaws.ecr#ImageNotFoundException": @@ -1521,8 +1511,7 @@ const deserializeAws_json1_1DescribeImageScanFindingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ImageNotFoundException": case "com.amazonaws.ecr#ImageNotFoundException": @@ -1608,8 +1597,7 @@ const deserializeAws_json1_1DescribeRegistryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1679,8 +1667,7 @@ const deserializeAws_json1_1DescribeRepositoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1750,8 +1737,7 @@ const deserializeAws_json1_1GetAuthorizationTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1813,8 +1799,7 @@ const deserializeAws_json1_1GetDownloadUrlForLayerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1900,8 +1885,7 @@ const deserializeAws_json1_1GetLifecyclePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -1979,8 +1963,7 @@ const deserializeAws_json1_1GetLifecyclePolicyPreviewCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2058,8 +2041,7 @@ const deserializeAws_json1_1GetRegistryPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2129,8 +2111,7 @@ const deserializeAws_json1_1GetRepositoryPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2208,8 +2189,7 @@ const deserializeAws_json1_1InitiateLayerUploadCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2287,8 +2267,7 @@ const deserializeAws_json1_1ListImagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2358,8 +2337,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2429,8 +2407,7 @@ const deserializeAws_json1_1PutImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ImageAlreadyExistsException": case "com.amazonaws.ecr#ImageAlreadyExistsException": @@ -2556,8 +2533,7 @@ const deserializeAws_json1_1PutImageScanningConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2627,8 +2603,7 @@ const deserializeAws_json1_1PutImageTagMutabilityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2698,8 +2673,7 @@ const deserializeAws_json1_1PutLifecyclePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2769,8 +2743,7 @@ const deserializeAws_json1_1PutRegistryPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2832,8 +2805,7 @@ const deserializeAws_json1_1PutReplicationConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2903,8 +2875,7 @@ const deserializeAws_json1_1SetRepositoryPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -2974,8 +2945,7 @@ const deserializeAws_json1_1StartImageScanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ImageNotFoundException": case "com.amazonaws.ecr#ImageNotFoundException": @@ -3069,8 +3039,7 @@ const deserializeAws_json1_1StartLifecyclePolicyPreviewCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -3156,8 +3125,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -3243,8 +3211,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": @@ -3330,8 +3297,7 @@ const deserializeAws_json1_1UploadLayerPartCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidLayerPartException": case "com.amazonaws.ecr#InvalidLayerPartException": @@ -3861,34 +3827,48 @@ const serializeAws_json1_1BatchCheckLayerAvailabilityRequest = ( context: __SerdeContext ): any => { return { - ...(input.layerDigests !== undefined && { - layerDigests: serializeAws_json1_1BatchedOperationLayerDigestList(input.layerDigests, context), - }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.layerDigests !== undefined && + input.layerDigests !== null && { + layerDigests: serializeAws_json1_1BatchedOperationLayerDigestList(input.layerDigests, context), + }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1BatchDeleteImageRequest = (input: BatchDeleteImageRequest, context: __SerdeContext): any => { return { - ...(input.imageIds !== undefined && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.imageIds !== undefined && + input.imageIds !== null && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1BatchedOperationLayerDigestList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchGetImageRequest = (input: BatchGetImageRequest, context: __SerdeContext): any => { return { - ...(input.acceptedMediaTypes !== undefined && { - acceptedMediaTypes: serializeAws_json1_1MediaTypeList(input.acceptedMediaTypes, context), - }), - ...(input.imageIds !== undefined && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.acceptedMediaTypes !== undefined && + input.acceptedMediaTypes !== null && { + acceptedMediaTypes: serializeAws_json1_1MediaTypeList(input.acceptedMediaTypes, context), + }), + ...(input.imageIds !== undefined && + input.imageIds !== null && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -3897,29 +3877,35 @@ const serializeAws_json1_1CompleteLayerUploadRequest = ( context: __SerdeContext ): any => { return { - ...(input.layerDigests !== undefined && { - layerDigests: serializeAws_json1_1LayerDigestList(input.layerDigests, context), - }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.uploadId !== undefined && { uploadId: input.uploadId }), + ...(input.layerDigests !== undefined && + input.layerDigests !== null && { + layerDigests: serializeAws_json1_1LayerDigestList(input.layerDigests, context), + }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.uploadId !== undefined && input.uploadId !== null && { uploadId: input.uploadId }), }; }; const serializeAws_json1_1CreateRepositoryRequest = (input: CreateRepositoryRequest, context: __SerdeContext): any => { return { - ...(input.encryptionConfiguration !== undefined && { - encryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.encryptionConfiguration, context), - }), - ...(input.imageScanningConfiguration !== undefined && { - imageScanningConfiguration: serializeAws_json1_1ImageScanningConfiguration( - input.imageScanningConfiguration, - context - ), - }), - ...(input.imageTagMutability !== undefined && { imageTagMutability: input.imageTagMutability }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.encryptionConfiguration !== undefined && + input.encryptionConfiguration !== null && { + encryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.encryptionConfiguration, context), + }), + ...(input.imageScanningConfiguration !== undefined && + input.imageScanningConfiguration !== null && { + imageScanningConfiguration: serializeAws_json1_1ImageScanningConfiguration( + input.imageScanningConfiguration, + context + ), + }), + ...(input.imageTagMutability !== undefined && + input.imageTagMutability !== null && { imageTagMutability: input.imageTagMutability }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -3928,8 +3914,9 @@ const serializeAws_json1_1DeleteLifecyclePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -3945,16 +3932,18 @@ const serializeAws_json1_1DeleteRepositoryPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1DeleteRepositoryRequest = (input: DeleteRepositoryRequest, context: __SerdeContext): any => { return { - ...(input.force !== undefined && { force: input.force }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -3963,28 +3952,33 @@ const serializeAws_json1_1DescribeImageScanFindingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.imageId !== undefined && { imageId: serializeAws_json1_1ImageIdentifier(input.imageId, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.imageId !== undefined && + input.imageId !== null && { imageId: serializeAws_json1_1ImageIdentifier(input.imageId, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1DescribeImagesFilter = (input: DescribeImagesFilter, context: __SerdeContext): any => { return { - ...(input.tagStatus !== undefined && { tagStatus: input.tagStatus }), + ...(input.tagStatus !== undefined && input.tagStatus !== null && { tagStatus: input.tagStatus }), }; }; const serializeAws_json1_1DescribeImagesRequest = (input: DescribeImagesRequest, context: __SerdeContext): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1DescribeImagesFilter(input.filter, context) }), - ...(input.imageIds !== undefined && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1DescribeImagesFilter(input.filter, context) }), + ...(input.imageIds !== undefined && + input.imageIds !== null && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -3997,24 +3991,33 @@ const serializeAws_json1_1DescribeRepositoriesRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryNames !== undefined && { - repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), - }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryNames !== undefined && + input.repositoryNames !== null && { + repositoryNames: serializeAws_json1_1RepositoryNameList(input.repositoryNames, context), + }), }; }; const serializeAws_json1_1EncryptionConfiguration = (input: EncryptionConfiguration, context: __SerdeContext): any => { return { - ...(input.encryptionType !== undefined && { encryptionType: input.encryptionType }), - ...(input.kmsKey !== undefined && { kmsKey: input.kmsKey }), + ...(input.encryptionType !== undefined && + input.encryptionType !== null && { encryptionType: input.encryptionType }), + ...(input.kmsKey !== undefined && input.kmsKey !== null && { kmsKey: input.kmsKey }), }; }; const serializeAws_json1_1GetAuthorizationTokenRegistryIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetAuthorizationTokenRequest = ( @@ -4022,9 +4025,10 @@ const serializeAws_json1_1GetAuthorizationTokenRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryIds !== undefined && { - registryIds: serializeAws_json1_1GetAuthorizationTokenRegistryIdList(input.registryIds, context), - }), + ...(input.registryIds !== undefined && + input.registryIds !== null && { + registryIds: serializeAws_json1_1GetAuthorizationTokenRegistryIdList(input.registryIds, context), + }), }; }; @@ -4033,9 +4037,10 @@ const serializeAws_json1_1GetDownloadUrlForLayerRequest = ( context: __SerdeContext ): any => { return { - ...(input.layerDigest !== undefined && { layerDigest: input.layerDigest }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.layerDigest !== undefined && input.layerDigest !== null && { layerDigest: input.layerDigest }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -4044,14 +4049,15 @@ const serializeAws_json1_1GetLifecyclePolicyPreviewRequest = ( context: __SerdeContext ): any => { return { - ...(input.filter !== undefined && { - filter: serializeAws_json1_1LifecyclePolicyPreviewFilter(input.filter, context), - }), - ...(input.imageIds !== undefined && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1LifecyclePolicyPreviewFilter(input.filter, context) }), + ...(input.imageIds !== undefined && + input.imageIds !== null && { imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -4060,8 +4066,9 @@ const serializeAws_json1_1GetLifecyclePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -4077,20 +4084,28 @@ const serializeAws_json1_1GetRepositoryPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1ImageIdentifier = (input: ImageIdentifier, context: __SerdeContext): any => { return { - ...(input.imageDigest !== undefined && { imageDigest: input.imageDigest }), - ...(input.imageTag !== undefined && { imageTag: input.imageTag }), + ...(input.imageDigest !== undefined && input.imageDigest !== null && { imageDigest: input.imageDigest }), + ...(input.imageTag !== undefined && input.imageTag !== null && { imageTag: input.imageTag }), }; }; const serializeAws_json1_1ImageIdentifierList = (input: ImageIdentifier[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ImageIdentifier(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ImageIdentifier(entry, context); + }); }; const serializeAws_json1_1ImageScanningConfiguration = ( @@ -4098,7 +4113,7 @@ const serializeAws_json1_1ImageScanningConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.scanOnPush !== undefined && { scanOnPush: input.scanOnPush }), + ...(input.scanOnPush !== undefined && input.scanOnPush !== null && { scanOnPush: input.scanOnPush }), }; }; @@ -4107,13 +4122,21 @@ const serializeAws_json1_1InitiateLayerUploadRequest = ( context: __SerdeContext ): any => { return { - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1LayerDigestList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1LifecyclePolicyPreviewFilter = ( @@ -4121,23 +4144,25 @@ const serializeAws_json1_1LifecyclePolicyPreviewFilter = ( context: __SerdeContext ): any => { return { - ...(input.tagStatus !== undefined && { tagStatus: input.tagStatus }), + ...(input.tagStatus !== undefined && input.tagStatus !== null && { tagStatus: input.tagStatus }), }; }; const serializeAws_json1_1ListImagesFilter = (input: ListImagesFilter, context: __SerdeContext): any => { return { - ...(input.tagStatus !== undefined && { tagStatus: input.tagStatus }), + ...(input.tagStatus !== undefined && input.tagStatus !== null && { tagStatus: input.tagStatus }), }; }; const serializeAws_json1_1ListImagesRequest = (input: ListImagesRequest, context: __SerdeContext): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1ListImagesFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1ListImagesFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -4146,22 +4171,31 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_1MediaTypeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutImageRequest = (input: PutImageRequest, context: __SerdeContext): any => { return { - ...(input.imageDigest !== undefined && { imageDigest: input.imageDigest }), - ...(input.imageManifest !== undefined && { imageManifest: input.imageManifest }), - ...(input.imageManifestMediaType !== undefined && { imageManifestMediaType: input.imageManifestMediaType }), - ...(input.imageTag !== undefined && { imageTag: input.imageTag }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.imageDigest !== undefined && input.imageDigest !== null && { imageDigest: input.imageDigest }), + ...(input.imageManifest !== undefined && input.imageManifest !== null && { imageManifest: input.imageManifest }), + ...(input.imageManifestMediaType !== undefined && + input.imageManifestMediaType !== null && { imageManifestMediaType: input.imageManifestMediaType }), + ...(input.imageTag !== undefined && input.imageTag !== null && { imageTag: input.imageTag }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -4170,14 +4204,16 @@ const serializeAws_json1_1PutImageScanningConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.imageScanningConfiguration !== undefined && { - imageScanningConfiguration: serializeAws_json1_1ImageScanningConfiguration( - input.imageScanningConfiguration, - context - ), - }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.imageScanningConfiguration !== undefined && + input.imageScanningConfiguration !== null && { + imageScanningConfiguration: serializeAws_json1_1ImageScanningConfiguration( + input.imageScanningConfiguration, + context + ), + }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -4186,9 +4222,11 @@ const serializeAws_json1_1PutImageTagMutabilityRequest = ( context: __SerdeContext ): any => { return { - ...(input.imageTagMutability !== undefined && { imageTagMutability: input.imageTagMutability }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.imageTagMutability !== undefined && + input.imageTagMutability !== null && { imageTagMutability: input.imageTagMutability }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -4197,9 +4235,11 @@ const serializeAws_json1_1PutLifecyclePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.lifecyclePolicyText !== undefined && { lifecyclePolicyText: input.lifecyclePolicyText }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.lifecyclePolicyText !== undefined && + input.lifecyclePolicyText !== null && { lifecyclePolicyText: input.lifecyclePolicyText }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -4208,7 +4248,7 @@ const serializeAws_json1_1PutRegistryPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.policyText !== undefined && { policyText: input.policyText }), + ...(input.policyText !== undefined && input.policyText !== null && { policyText: input.policyText }), }; }; @@ -4217,9 +4257,10 @@ const serializeAws_json1_1PutReplicationConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.replicationConfiguration !== undefined && { - replicationConfiguration: serializeAws_json1_1ReplicationConfiguration(input.replicationConfiguration, context), - }), + ...(input.replicationConfiguration !== undefined && + input.replicationConfiguration !== null && { + replicationConfiguration: serializeAws_json1_1ReplicationConfiguration(input.replicationConfiguration, context), + }), }; }; @@ -4228,14 +4269,15 @@ const serializeAws_json1_1ReplicationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.rules !== undefined && { rules: serializeAws_json1_1ReplicationRuleList(input.rules, context) }), + ...(input.rules !== undefined && + input.rules !== null && { rules: serializeAws_json1_1ReplicationRuleList(input.rules, context) }), }; }; const serializeAws_json1_1ReplicationDestination = (input: ReplicationDestination, context: __SerdeContext): any => { return { - ...(input.region !== undefined && { region: input.region }), - ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.region !== undefined && input.region !== null && { region: input.region }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), }; }; @@ -4243,23 +4285,45 @@ const serializeAws_json1_1ReplicationDestinationList = ( input: ReplicationDestination[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ReplicationDestination(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ReplicationDestination(entry, context); + }); }; const serializeAws_json1_1ReplicationRule = (input: ReplicationRule, context: __SerdeContext): any => { return { - ...(input.destinations !== undefined && { - destinations: serializeAws_json1_1ReplicationDestinationList(input.destinations, context), - }), + ...(input.destinations !== undefined && + input.destinations !== null && { + destinations: serializeAws_json1_1ReplicationDestinationList(input.destinations, context), + }), }; }; const serializeAws_json1_1ReplicationRuleList = (input: ReplicationRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ReplicationRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ReplicationRule(entry, context); + }); }; const serializeAws_json1_1RepositoryNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SetRepositoryPolicyRequest = ( @@ -4267,18 +4331,21 @@ const serializeAws_json1_1SetRepositoryPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.force !== undefined && { force: input.force }), - ...(input.policyText !== undefined && { policyText: input.policyText }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), + ...(input.policyText !== undefined && input.policyText !== null && { policyText: input.policyText }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1StartImageScanRequest = (input: StartImageScanRequest, context: __SerdeContext): any => { return { - ...(input.imageId !== undefined && { imageId: serializeAws_json1_1ImageIdentifier(input.imageId, context) }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.imageId !== undefined && + input.imageId !== null && { imageId: serializeAws_json1_1ImageIdentifier(input.imageId, context) }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; @@ -4287,49 +4354,68 @@ const serializeAws_json1_1StartLifecyclePolicyPreviewRequest = ( context: __SerdeContext ): any => { return { - ...(input.lifecyclePolicyText !== undefined && { lifecyclePolicyText: input.lifecyclePolicyText }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), + ...(input.lifecyclePolicyText !== undefined && + input.lifecyclePolicyText !== null && { lifecyclePolicyText: input.lifecyclePolicyText }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), }; }; const serializeAws_json1_1UploadLayerPartRequest = (input: UploadLayerPartRequest, context: __SerdeContext): any => { return { - ...(input.layerPartBlob !== undefined && { layerPartBlob: context.base64Encoder(input.layerPartBlob) }), - ...(input.partFirstByte !== undefined && { partFirstByte: input.partFirstByte }), - ...(input.partLastByte !== undefined && { partLastByte: input.partLastByte }), - ...(input.registryId !== undefined && { registryId: input.registryId }), - ...(input.repositoryName !== undefined && { repositoryName: input.repositoryName }), - ...(input.uploadId !== undefined && { uploadId: input.uploadId }), + ...(input.layerPartBlob !== undefined && + input.layerPartBlob !== null && { layerPartBlob: context.base64Encoder(input.layerPartBlob) }), + ...(input.partFirstByte !== undefined && input.partFirstByte !== null && { partFirstByte: input.partFirstByte }), + ...(input.partLastByte !== undefined && input.partLastByte !== null && { partLastByte: input.partLastByte }), + ...(input.registryId !== undefined && input.registryId !== null && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && + input.repositoryName !== null && { repositoryName: input.repositoryName }), + ...(input.uploadId !== undefined && input.uploadId !== null && { uploadId: input.uploadId }), }; }; @@ -4341,7 +4427,14 @@ const deserializeAws_json1_1Attribute = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1AttributeList = (output: any, context: __SerdeContext): Attribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Attribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Attribute(entry, context); + }); }; const deserializeAws_json1_1AuthorizationData = (output: any, context: __SerdeContext): AuthorizationData => { @@ -4360,7 +4453,14 @@ const deserializeAws_json1_1AuthorizationData = (output: any, context: __SerdeCo }; const deserializeAws_json1_1AuthorizationDataList = (output: any, context: __SerdeContext): AuthorizationData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AuthorizationData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AuthorizationData(entry, context); + }); }; const deserializeAws_json1_1BatchCheckLayerAvailabilityResponse = ( @@ -4568,10 +4668,15 @@ const deserializeAws_json1_1FindingSeverityCounts = ( context: __SerdeContext ): { [key: string]: number } => { return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [FindingSeverity | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: number }, [key, value]: [FindingSeverity | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -4727,7 +4832,14 @@ const deserializeAws_json1_1ImageDetail = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ImageDetailList = (output: any, context: __SerdeContext): ImageDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageDetail(entry, context); + }); }; const deserializeAws_json1_1ImageDigestDoesNotMatchException = ( @@ -4752,7 +4864,14 @@ const deserializeAws_json1_1ImageFailure = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ImageFailureList = (output: any, context: __SerdeContext): ImageFailure[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageFailure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageFailure(entry, context); + }); }; const deserializeAws_json1_1ImageIdentifier = (output: any, context: __SerdeContext): ImageIdentifier => { @@ -4763,11 +4882,25 @@ const deserializeAws_json1_1ImageIdentifier = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ImageIdentifierList = (output: any, context: __SerdeContext): ImageIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageIdentifier(entry, context); + }); }; const deserializeAws_json1_1ImageList = (output: any, context: __SerdeContext): Image[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Image(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Image(entry, context); + }); }; const deserializeAws_json1_1ImageNotFoundException = (output: any, context: __SerdeContext): ImageNotFoundException => { @@ -4790,7 +4923,14 @@ const deserializeAws_json1_1ImageScanFinding = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ImageScanFindingList = (output: any, context: __SerdeContext): ImageScanFinding[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageScanFinding(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageScanFinding(entry, context); + }); }; const deserializeAws_json1_1ImageScanFindings = (output: any, context: __SerdeContext): ImageScanFindings => { @@ -4860,7 +5000,14 @@ const deserializeAws_json1_1ImageTagAlreadyExistsException = ( }; const deserializeAws_json1_1ImageTagList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InitiateLayerUploadResponse = ( @@ -4952,7 +5099,14 @@ const deserializeAws_json1_1LayerFailure = (output: any, context: __SerdeContext }; const deserializeAws_json1_1LayerFailureList = (output: any, context: __SerdeContext): LayerFailure[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LayerFailure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LayerFailure(entry, context); + }); }; const deserializeAws_json1_1LayerInaccessibleException = ( @@ -4965,7 +5119,14 @@ const deserializeAws_json1_1LayerInaccessibleException = ( }; const deserializeAws_json1_1LayerList = (output: any, context: __SerdeContext): Layer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Layer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Layer(entry, context); + }); }; const deserializeAws_json1_1LayerPartTooSmallException = ( @@ -5042,7 +5203,14 @@ const deserializeAws_json1_1LifecyclePolicyPreviewResultList = ( output: any, context: __SerdeContext ): LifecyclePolicyPreviewResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LifecyclePolicyPreviewResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LifecyclePolicyPreviewResult(entry, context); + }); }; const deserializeAws_json1_1LifecyclePolicyPreviewSummary = ( @@ -5211,7 +5379,14 @@ const deserializeAws_json1_1ReplicationDestinationList = ( output: any, context: __SerdeContext ): ReplicationDestination[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationDestination(entry, context); + }); }; const deserializeAws_json1_1ReplicationRule = (output: any, context: __SerdeContext): ReplicationRule => { @@ -5224,7 +5399,14 @@ const deserializeAws_json1_1ReplicationRule = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ReplicationRuleList = (output: any, context: __SerdeContext): ReplicationRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationRule(entry, context); + }); }; const deserializeAws_json1_1Repository = (output: any, context: __SerdeContext): Repository => { @@ -5265,7 +5447,14 @@ const deserializeAws_json1_1RepositoryAlreadyExistsException = ( }; const deserializeAws_json1_1RepositoryList = (output: any, context: __SerdeContext): Repository[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Repository(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Repository(entry, context); + }); }; const deserializeAws_json1_1RepositoryNotEmptyException = ( @@ -5359,7 +5548,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -5464,3 +5660,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-ecs/protocols/Aws_json1_1.ts b/clients/client-ecs/protocols/Aws_json1_1.ts index 3275d11dd753..3e1bcdf5d1de 100644 --- a/clients/client-ecs/protocols/Aws_json1_1.ts +++ b/clients/client-ecs/protocols/Aws_json1_1.ts @@ -345,7 +345,7 @@ export const serializeAws_json1_1CreateCapacityProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.CreateCapacityProvider", }; let body: any; @@ -358,7 +358,7 @@ export const serializeAws_json1_1CreateClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.CreateCluster", }; let body: any; @@ -371,7 +371,7 @@ export const serializeAws_json1_1CreateServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.CreateService", }; let body: any; @@ -384,7 +384,7 @@ export const serializeAws_json1_1CreateTaskSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.CreateTaskSet", }; let body: any; @@ -397,7 +397,7 @@ export const serializeAws_json1_1DeleteAccountSettingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DeleteAccountSetting", }; let body: any; @@ -410,7 +410,7 @@ export const serializeAws_json1_1DeleteAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DeleteAttributes", }; let body: any; @@ -423,7 +423,7 @@ export const serializeAws_json1_1DeleteCapacityProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DeleteCapacityProvider", }; let body: any; @@ -436,7 +436,7 @@ export const serializeAws_json1_1DeleteClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DeleteCluster", }; let body: any; @@ -449,7 +449,7 @@ export const serializeAws_json1_1DeleteServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DeleteService", }; let body: any; @@ -462,7 +462,7 @@ export const serializeAws_json1_1DeleteTaskSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DeleteTaskSet", }; let body: any; @@ -475,7 +475,7 @@ export const serializeAws_json1_1DeregisterContainerInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DeregisterContainerInstance", }; let body: any; @@ -488,7 +488,7 @@ export const serializeAws_json1_1DeregisterTaskDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DeregisterTaskDefinition", }; let body: any; @@ -501,7 +501,7 @@ export const serializeAws_json1_1DescribeCapacityProvidersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DescribeCapacityProviders", }; let body: any; @@ -514,7 +514,7 @@ export const serializeAws_json1_1DescribeClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DescribeClusters", }; let body: any; @@ -527,7 +527,7 @@ export const serializeAws_json1_1DescribeContainerInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DescribeContainerInstances", }; let body: any; @@ -540,7 +540,7 @@ export const serializeAws_json1_1DescribeServicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DescribeServices", }; let body: any; @@ -553,7 +553,7 @@ export const serializeAws_json1_1DescribeTaskDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DescribeTaskDefinition", }; let body: any; @@ -566,7 +566,7 @@ export const serializeAws_json1_1DescribeTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DescribeTasks", }; let body: any; @@ -579,7 +579,7 @@ export const serializeAws_json1_1DescribeTaskSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DescribeTaskSets", }; let body: any; @@ -592,7 +592,7 @@ export const serializeAws_json1_1DiscoverPollEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.DiscoverPollEndpoint", }; let body: any; @@ -605,7 +605,7 @@ export const serializeAws_json1_1ListAccountSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.ListAccountSettings", }; let body: any; @@ -618,7 +618,7 @@ export const serializeAws_json1_1ListAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.ListAttributes", }; let body: any; @@ -631,7 +631,7 @@ export const serializeAws_json1_1ListClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.ListClusters", }; let body: any; @@ -644,7 +644,7 @@ export const serializeAws_json1_1ListContainerInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.ListContainerInstances", }; let body: any; @@ -657,7 +657,7 @@ export const serializeAws_json1_1ListServicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.ListServices", }; let body: any; @@ -670,7 +670,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.ListTagsForResource", }; let body: any; @@ -683,7 +683,7 @@ export const serializeAws_json1_1ListTaskDefinitionFamiliesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.ListTaskDefinitionFamilies", }; let body: any; @@ -696,7 +696,7 @@ export const serializeAws_json1_1ListTaskDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.ListTaskDefinitions", }; let body: any; @@ -709,7 +709,7 @@ export const serializeAws_json1_1ListTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.ListTasks", }; let body: any; @@ -722,7 +722,7 @@ export const serializeAws_json1_1PutAccountSettingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.PutAccountSetting", }; let body: any; @@ -735,7 +735,7 @@ export const serializeAws_json1_1PutAccountSettingDefaultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.PutAccountSettingDefault", }; let body: any; @@ -748,7 +748,7 @@ export const serializeAws_json1_1PutAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.PutAttributes", }; let body: any; @@ -761,7 +761,7 @@ export const serializeAws_json1_1PutClusterCapacityProvidersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.PutClusterCapacityProviders", }; let body: any; @@ -774,7 +774,7 @@ export const serializeAws_json1_1RegisterContainerInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.RegisterContainerInstance", }; let body: any; @@ -787,7 +787,7 @@ export const serializeAws_json1_1RegisterTaskDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.RegisterTaskDefinition", }; let body: any; @@ -800,7 +800,7 @@ export const serializeAws_json1_1RunTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.RunTask", }; let body: any; @@ -813,7 +813,7 @@ export const serializeAws_json1_1StartTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.StartTask", }; let body: any; @@ -826,7 +826,7 @@ export const serializeAws_json1_1StopTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.StopTask", }; let body: any; @@ -839,7 +839,7 @@ export const serializeAws_json1_1SubmitAttachmentStateChangesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.SubmitAttachmentStateChanges", }; let body: any; @@ -852,7 +852,7 @@ export const serializeAws_json1_1SubmitContainerStateChangeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.SubmitContainerStateChange", }; let body: any; @@ -865,7 +865,7 @@ export const serializeAws_json1_1SubmitTaskStateChangeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.SubmitTaskStateChange", }; let body: any; @@ -878,7 +878,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.TagResource", }; let body: any; @@ -891,7 +891,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.UntagResource", }; let body: any; @@ -904,7 +904,7 @@ export const serializeAws_json1_1UpdateCapacityProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.UpdateCapacityProvider", }; let body: any; @@ -917,7 +917,7 @@ export const serializeAws_json1_1UpdateClusterSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.UpdateClusterSettings", }; let body: any; @@ -930,7 +930,7 @@ export const serializeAws_json1_1UpdateContainerAgentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.UpdateContainerAgent", }; let body: any; @@ -943,7 +943,7 @@ export const serializeAws_json1_1UpdateContainerInstancesStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.UpdateContainerInstancesState", }; let body: any; @@ -956,7 +956,7 @@ export const serializeAws_json1_1UpdateServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.UpdateService", }; let body: any; @@ -969,7 +969,7 @@ export const serializeAws_json1_1UpdateServicePrimaryTaskSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.UpdateServicePrimaryTaskSet", }; let body: any; @@ -982,7 +982,7 @@ export const serializeAws_json1_1UpdateTaskSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonEC2ContainerServiceV20141113.UpdateTaskSet", }; let body: any; @@ -1017,8 +1017,7 @@ const deserializeAws_json1_1CreateCapacityProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -1104,8 +1103,7 @@ const deserializeAws_json1_1CreateClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -1175,8 +1173,7 @@ const deserializeAws_json1_1CreateServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -1286,8 +1283,7 @@ const deserializeAws_json1_1CreateTaskSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -1413,8 +1409,7 @@ const deserializeAws_json1_1DeleteAccountSettingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -1484,8 +1479,7 @@ const deserializeAws_json1_1DeleteAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundException": case "com.amazonaws.ecs#ClusterNotFoundException": @@ -1555,8 +1549,7 @@ const deserializeAws_json1_1DeleteCapacityProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -1626,8 +1619,7 @@ const deserializeAws_json1_1DeleteClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -1737,8 +1729,7 @@ const deserializeAws_json1_1DeleteServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -1824,8 +1815,7 @@ const deserializeAws_json1_1DeleteTaskSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -1943,8 +1933,7 @@ const deserializeAws_json1_1DeregisterContainerInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2022,8 +2011,7 @@ const deserializeAws_json1_1DeregisterTaskDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2093,8 +2081,7 @@ const deserializeAws_json1_1DescribeCapacityProvidersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2164,8 +2151,7 @@ const deserializeAws_json1_1DescribeClustersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2235,8 +2221,7 @@ const deserializeAws_json1_1DescribeContainerInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2314,8 +2299,7 @@ const deserializeAws_json1_1DescribeServicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2393,8 +2377,7 @@ const deserializeAws_json1_1DescribeTaskDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2464,8 +2447,7 @@ const deserializeAws_json1_1DescribeTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2543,8 +2525,7 @@ const deserializeAws_json1_1DescribeTaskSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -2654,8 +2635,7 @@ const deserializeAws_json1_1DiscoverPollEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2717,8 +2697,7 @@ const deserializeAws_json1_1ListAccountSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2788,8 +2767,7 @@ const deserializeAws_json1_1ListAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterNotFoundException": case "com.amazonaws.ecs#ClusterNotFoundException": @@ -2851,8 +2829,7 @@ const deserializeAws_json1_1ListClustersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -2922,8 +2899,7 @@ const deserializeAws_json1_1ListContainerInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3001,8 +2977,7 @@ const deserializeAws_json1_1ListServicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3080,8 +3055,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3159,8 +3133,7 @@ const deserializeAws_json1_1ListTaskDefinitionFamiliesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3230,8 +3203,7 @@ const deserializeAws_json1_1ListTaskDefinitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3301,8 +3273,7 @@ const deserializeAws_json1_1ListTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3388,8 +3359,7 @@ const deserializeAws_json1_1PutAccountSettingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3459,8 +3429,7 @@ const deserializeAws_json1_1PutAccountSettingDefaultCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3530,8 +3499,7 @@ const deserializeAws_json1_1PutAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AttributeLimitExceededException": case "com.amazonaws.ecs#AttributeLimitExceededException": @@ -3609,8 +3577,7 @@ const deserializeAws_json1_1PutClusterCapacityProvidersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3704,8 +3671,7 @@ const deserializeAws_json1_1RegisterContainerInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3775,8 +3741,7 @@ const deserializeAws_json1_1RegisterTaskDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -3846,8 +3811,7 @@ const deserializeAws_json1_1RunTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -3965,8 +3929,7 @@ const deserializeAws_json1_1StartTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -4044,8 +4007,7 @@ const deserializeAws_json1_1StopTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -4123,8 +4085,7 @@ const deserializeAws_json1_1SubmitAttachmentStateChangesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -4202,8 +4163,7 @@ const deserializeAws_json1_1SubmitContainerStateChangeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -4273,8 +4233,7 @@ const deserializeAws_json1_1SubmitTaskStateChangeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -4352,8 +4311,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -4439,8 +4397,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -4526,8 +4483,7 @@ const deserializeAws_json1_1UpdateCapacityProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -4597,8 +4553,7 @@ const deserializeAws_json1_1UpdateClusterSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -4676,8 +4631,7 @@ const deserializeAws_json1_1UpdateContainerAgentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -4779,8 +4733,7 @@ const deserializeAws_json1_1UpdateContainerInstancesStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClientException": case "com.amazonaws.ecs#ClientException": @@ -4858,8 +4811,7 @@ const deserializeAws_json1_1UpdateServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -4977,8 +4929,7 @@ const deserializeAws_json1_1UpdateServicePrimaryTaskSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -5096,8 +5047,7 @@ const deserializeAws_json1_1UpdateTaskSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ecs#AccessDeniedException": @@ -5535,26 +5485,40 @@ const deserializeAws_json1_1UpdateInProgressExceptionResponse = async ( const serializeAws_json1_1AttachmentStateChange = (input: AttachmentStateChange, context: __SerdeContext): any => { return { - ...(input.attachmentArn !== undefined && { attachmentArn: input.attachmentArn }), - ...(input.status !== undefined && { status: input.status }), + ...(input.attachmentArn !== undefined && input.attachmentArn !== null && { attachmentArn: input.attachmentArn }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1AttachmentStateChanges = (input: AttachmentStateChange[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AttachmentStateChange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AttachmentStateChange(entry, context); + }); }; const serializeAws_json1_1Attribute = (input: Attribute, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.targetId !== undefined && { targetId: input.targetId }), - ...(input.targetType !== undefined && { targetType: input.targetType }), - ...(input.value !== undefined && { value: input.value }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.targetId !== undefined && input.targetId !== null && { targetId: input.targetId }), + ...(input.targetType !== undefined && input.targetType !== null && { targetType: input.targetType }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1Attributes = (input: Attribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Attribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Attribute(entry, context); + }); }; const serializeAws_json1_1AutoScalingGroupProvider = ( @@ -5562,13 +5526,16 @@ const serializeAws_json1_1AutoScalingGroupProvider = ( context: __SerdeContext ): any => { return { - ...(input.autoScalingGroupArn !== undefined && { autoScalingGroupArn: input.autoScalingGroupArn }), - ...(input.managedScaling !== undefined && { - managedScaling: serializeAws_json1_1ManagedScaling(input.managedScaling, context), - }), - ...(input.managedTerminationProtection !== undefined && { - managedTerminationProtection: input.managedTerminationProtection, - }), + ...(input.autoScalingGroupArn !== undefined && + input.autoScalingGroupArn !== null && { autoScalingGroupArn: input.autoScalingGroupArn }), + ...(input.managedScaling !== undefined && + input.managedScaling !== null && { + managedScaling: serializeAws_json1_1ManagedScaling(input.managedScaling, context), + }), + ...(input.managedTerminationProtection !== undefined && + input.managedTerminationProtection !== null && { + managedTerminationProtection: input.managedTerminationProtection, + }), }; }; @@ -5577,22 +5544,27 @@ const serializeAws_json1_1AutoScalingGroupProviderUpdate = ( context: __SerdeContext ): any => { return { - ...(input.managedScaling !== undefined && { - managedScaling: serializeAws_json1_1ManagedScaling(input.managedScaling, context), - }), - ...(input.managedTerminationProtection !== undefined && { - managedTerminationProtection: input.managedTerminationProtection, - }), + ...(input.managedScaling !== undefined && + input.managedScaling !== null && { + managedScaling: serializeAws_json1_1ManagedScaling(input.managedScaling, context), + }), + ...(input.managedTerminationProtection !== undefined && + input.managedTerminationProtection !== null && { + managedTerminationProtection: input.managedTerminationProtection, + }), }; }; const serializeAws_json1_1AwsVpcConfiguration = (input: AwsVpcConfiguration, context: __SerdeContext): any => { return { - ...(input.assignPublicIp !== undefined && { assignPublicIp: input.assignPublicIp }), - ...(input.securityGroups !== undefined && { - securityGroups: serializeAws_json1_1StringList(input.securityGroups, context), - }), - ...(input.subnets !== undefined && { subnets: serializeAws_json1_1StringList(input.subnets, context) }), + ...(input.assignPublicIp !== undefined && + input.assignPublicIp !== null && { assignPublicIp: input.assignPublicIp }), + ...(input.securityGroups !== undefined && + input.securityGroups !== null && { + securityGroups: serializeAws_json1_1StringList(input.securityGroups, context), + }), + ...(input.subnets !== undefined && + input.subnets !== null && { subnets: serializeAws_json1_1StringList(input.subnets, context) }), }; }; @@ -5600,14 +5572,28 @@ const serializeAws_json1_1CapacityProviderFieldList = ( input: (CapacityProviderField | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CapacityProviderStrategy = ( input: CapacityProviderStrategyItem[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CapacityProviderStrategyItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CapacityProviderStrategyItem(entry, context); + }); }; const serializeAws_json1_1CapacityProviderStrategyItem = ( @@ -5615,119 +5601,175 @@ const serializeAws_json1_1CapacityProviderStrategyItem = ( context: __SerdeContext ): any => { return { - ...(input.base !== undefined && { base: input.base }), - ...(input.capacityProvider !== undefined && { capacityProvider: input.capacityProvider }), - ...(input.weight !== undefined && { weight: input.weight }), + ...(input.base !== undefined && input.base !== null && { base: input.base }), + ...(input.capacityProvider !== undefined && + input.capacityProvider !== null && { capacityProvider: input.capacityProvider }), + ...(input.weight !== undefined && input.weight !== null && { weight: input.weight }), }; }; const serializeAws_json1_1ClusterFieldList = (input: (ClusterField | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ClusterSetting = (input: ClusterSetting, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: input.value }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1ClusterSettings = (input: ClusterSetting[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ClusterSetting(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ClusterSetting(entry, context); + }); }; const serializeAws_json1_1CompatibilityList = (input: (Compatibility | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ContainerDefinition = (input: ContainerDefinition, context: __SerdeContext): any => { return { - ...(input.command !== undefined && { command: serializeAws_json1_1StringList(input.command, context) }), - ...(input.cpu !== undefined && { cpu: input.cpu }), - ...(input.dependsOn !== undefined && { - dependsOn: serializeAws_json1_1ContainerDependencies(input.dependsOn, context), - }), - ...(input.disableNetworking !== undefined && { disableNetworking: input.disableNetworking }), - ...(input.dnsSearchDomains !== undefined && { - dnsSearchDomains: serializeAws_json1_1StringList(input.dnsSearchDomains, context), - }), - ...(input.dnsServers !== undefined && { dnsServers: serializeAws_json1_1StringList(input.dnsServers, context) }), - ...(input.dockerLabels !== undefined && { - dockerLabels: serializeAws_json1_1DockerLabelsMap(input.dockerLabels, context), - }), - ...(input.dockerSecurityOptions !== undefined && { - dockerSecurityOptions: serializeAws_json1_1StringList(input.dockerSecurityOptions, context), - }), - ...(input.entryPoint !== undefined && { entryPoint: serializeAws_json1_1StringList(input.entryPoint, context) }), - ...(input.environment !== undefined && { - environment: serializeAws_json1_1EnvironmentVariables(input.environment, context), - }), - ...(input.environmentFiles !== undefined && { - environmentFiles: serializeAws_json1_1EnvironmentFiles(input.environmentFiles, context), - }), - ...(input.essential !== undefined && { essential: input.essential }), - ...(input.extraHosts !== undefined && { extraHosts: serializeAws_json1_1HostEntryList(input.extraHosts, context) }), - ...(input.firelensConfiguration !== undefined && { - firelensConfiguration: serializeAws_json1_1FirelensConfiguration(input.firelensConfiguration, context), - }), - ...(input.healthCheck !== undefined && { - healthCheck: serializeAws_json1_1HealthCheck(input.healthCheck, context), - }), - ...(input.hostname !== undefined && { hostname: input.hostname }), - ...(input.image !== undefined && { image: input.image }), - ...(input.interactive !== undefined && { interactive: input.interactive }), - ...(input.links !== undefined && { links: serializeAws_json1_1StringList(input.links, context) }), - ...(input.linuxParameters !== undefined && { - linuxParameters: serializeAws_json1_1LinuxParameters(input.linuxParameters, context), - }), - ...(input.logConfiguration !== undefined && { - logConfiguration: serializeAws_json1_1LogConfiguration(input.logConfiguration, context), - }), - ...(input.memory !== undefined && { memory: input.memory }), - ...(input.memoryReservation !== undefined && { memoryReservation: input.memoryReservation }), - ...(input.mountPoints !== undefined && { - mountPoints: serializeAws_json1_1MountPointList(input.mountPoints, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.portMappings !== undefined && { - portMappings: serializeAws_json1_1PortMappingList(input.portMappings, context), - }), - ...(input.privileged !== undefined && { privileged: input.privileged }), - ...(input.pseudoTerminal !== undefined && { pseudoTerminal: input.pseudoTerminal }), - ...(input.readonlyRootFilesystem !== undefined && { readonlyRootFilesystem: input.readonlyRootFilesystem }), - ...(input.repositoryCredentials !== undefined && { - repositoryCredentials: serializeAws_json1_1RepositoryCredentials(input.repositoryCredentials, context), - }), - ...(input.resourceRequirements !== undefined && { - resourceRequirements: serializeAws_json1_1ResourceRequirements(input.resourceRequirements, context), - }), - ...(input.secrets !== undefined && { secrets: serializeAws_json1_1SecretList(input.secrets, context) }), - ...(input.startTimeout !== undefined && { startTimeout: input.startTimeout }), - ...(input.stopTimeout !== undefined && { stopTimeout: input.stopTimeout }), - ...(input.systemControls !== undefined && { - systemControls: serializeAws_json1_1SystemControls(input.systemControls, context), - }), - ...(input.ulimits !== undefined && { ulimits: serializeAws_json1_1UlimitList(input.ulimits, context) }), - ...(input.user !== undefined && { user: input.user }), - ...(input.volumesFrom !== undefined && { - volumesFrom: serializeAws_json1_1VolumeFromList(input.volumesFrom, context), - }), - ...(input.workingDirectory !== undefined && { workingDirectory: input.workingDirectory }), + ...(input.command !== undefined && + input.command !== null && { command: serializeAws_json1_1StringList(input.command, context) }), + ...(input.cpu !== undefined && input.cpu !== null && { cpu: input.cpu }), + ...(input.dependsOn !== undefined && + input.dependsOn !== null && { dependsOn: serializeAws_json1_1ContainerDependencies(input.dependsOn, context) }), + ...(input.disableNetworking !== undefined && + input.disableNetworking !== null && { disableNetworking: input.disableNetworking }), + ...(input.dnsSearchDomains !== undefined && + input.dnsSearchDomains !== null && { + dnsSearchDomains: serializeAws_json1_1StringList(input.dnsSearchDomains, context), + }), + ...(input.dnsServers !== undefined && + input.dnsServers !== null && { dnsServers: serializeAws_json1_1StringList(input.dnsServers, context) }), + ...(input.dockerLabels !== undefined && + input.dockerLabels !== null && { + dockerLabels: serializeAws_json1_1DockerLabelsMap(input.dockerLabels, context), + }), + ...(input.dockerSecurityOptions !== undefined && + input.dockerSecurityOptions !== null && { + dockerSecurityOptions: serializeAws_json1_1StringList(input.dockerSecurityOptions, context), + }), + ...(input.entryPoint !== undefined && + input.entryPoint !== null && { entryPoint: serializeAws_json1_1StringList(input.entryPoint, context) }), + ...(input.environment !== undefined && + input.environment !== null && { + environment: serializeAws_json1_1EnvironmentVariables(input.environment, context), + }), + ...(input.environmentFiles !== undefined && + input.environmentFiles !== null && { + environmentFiles: serializeAws_json1_1EnvironmentFiles(input.environmentFiles, context), + }), + ...(input.essential !== undefined && input.essential !== null && { essential: input.essential }), + ...(input.extraHosts !== undefined && + input.extraHosts !== null && { extraHosts: serializeAws_json1_1HostEntryList(input.extraHosts, context) }), + ...(input.firelensConfiguration !== undefined && + input.firelensConfiguration !== null && { + firelensConfiguration: serializeAws_json1_1FirelensConfiguration(input.firelensConfiguration, context), + }), + ...(input.healthCheck !== undefined && + input.healthCheck !== null && { healthCheck: serializeAws_json1_1HealthCheck(input.healthCheck, context) }), + ...(input.hostname !== undefined && input.hostname !== null && { hostname: input.hostname }), + ...(input.image !== undefined && input.image !== null && { image: input.image }), + ...(input.interactive !== undefined && input.interactive !== null && { interactive: input.interactive }), + ...(input.links !== undefined && + input.links !== null && { links: serializeAws_json1_1StringList(input.links, context) }), + ...(input.linuxParameters !== undefined && + input.linuxParameters !== null && { + linuxParameters: serializeAws_json1_1LinuxParameters(input.linuxParameters, context), + }), + ...(input.logConfiguration !== undefined && + input.logConfiguration !== null && { + logConfiguration: serializeAws_json1_1LogConfiguration(input.logConfiguration, context), + }), + ...(input.memory !== undefined && input.memory !== null && { memory: input.memory }), + ...(input.memoryReservation !== undefined && + input.memoryReservation !== null && { memoryReservation: input.memoryReservation }), + ...(input.mountPoints !== undefined && + input.mountPoints !== null && { mountPoints: serializeAws_json1_1MountPointList(input.mountPoints, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.portMappings !== undefined && + input.portMappings !== null && { + portMappings: serializeAws_json1_1PortMappingList(input.portMappings, context), + }), + ...(input.privileged !== undefined && input.privileged !== null && { privileged: input.privileged }), + ...(input.pseudoTerminal !== undefined && + input.pseudoTerminal !== null && { pseudoTerminal: input.pseudoTerminal }), + ...(input.readonlyRootFilesystem !== undefined && + input.readonlyRootFilesystem !== null && { readonlyRootFilesystem: input.readonlyRootFilesystem }), + ...(input.repositoryCredentials !== undefined && + input.repositoryCredentials !== null && { + repositoryCredentials: serializeAws_json1_1RepositoryCredentials(input.repositoryCredentials, context), + }), + ...(input.resourceRequirements !== undefined && + input.resourceRequirements !== null && { + resourceRequirements: serializeAws_json1_1ResourceRequirements(input.resourceRequirements, context), + }), + ...(input.secrets !== undefined && + input.secrets !== null && { secrets: serializeAws_json1_1SecretList(input.secrets, context) }), + ...(input.startTimeout !== undefined && input.startTimeout !== null && { startTimeout: input.startTimeout }), + ...(input.stopTimeout !== undefined && input.stopTimeout !== null && { stopTimeout: input.stopTimeout }), + ...(input.systemControls !== undefined && + input.systemControls !== null && { + systemControls: serializeAws_json1_1SystemControls(input.systemControls, context), + }), + ...(input.ulimits !== undefined && + input.ulimits !== null && { ulimits: serializeAws_json1_1UlimitList(input.ulimits, context) }), + ...(input.user !== undefined && input.user !== null && { user: input.user }), + ...(input.volumesFrom !== undefined && + input.volumesFrom !== null && { volumesFrom: serializeAws_json1_1VolumeFromList(input.volumesFrom, context) }), + ...(input.workingDirectory !== undefined && + input.workingDirectory !== null && { workingDirectory: input.workingDirectory }), }; }; const serializeAws_json1_1ContainerDefinitions = (input: ContainerDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ContainerDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ContainerDefinition(entry, context); + }); }; const serializeAws_json1_1ContainerDependencies = (input: ContainerDependency[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ContainerDependency(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ContainerDependency(entry, context); + }); }; const serializeAws_json1_1ContainerDependency = (input: ContainerDependency, context: __SerdeContext): any => { return { - ...(input.condition !== undefined && { condition: input.condition }), - ...(input.containerName !== undefined && { containerName: input.containerName }), + ...(input.condition !== undefined && input.condition !== null && { condition: input.condition }), + ...(input.containerName !== undefined && input.containerName !== null && { containerName: input.containerName }), }; }; @@ -5735,48 +5777,75 @@ const serializeAws_json1_1ContainerInstanceFieldList = ( input: (ContainerInstanceField | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ContainerOverride = (input: ContainerOverride, context: __SerdeContext): any => { return { - ...(input.command !== undefined && { command: serializeAws_json1_1StringList(input.command, context) }), - ...(input.cpu !== undefined && { cpu: input.cpu }), - ...(input.environment !== undefined && { - environment: serializeAws_json1_1EnvironmentVariables(input.environment, context), - }), - ...(input.environmentFiles !== undefined && { - environmentFiles: serializeAws_json1_1EnvironmentFiles(input.environmentFiles, context), - }), - ...(input.memory !== undefined && { memory: input.memory }), - ...(input.memoryReservation !== undefined && { memoryReservation: input.memoryReservation }), - ...(input.name !== undefined && { name: input.name }), - ...(input.resourceRequirements !== undefined && { - resourceRequirements: serializeAws_json1_1ResourceRequirements(input.resourceRequirements, context), - }), + ...(input.command !== undefined && + input.command !== null && { command: serializeAws_json1_1StringList(input.command, context) }), + ...(input.cpu !== undefined && input.cpu !== null && { cpu: input.cpu }), + ...(input.environment !== undefined && + input.environment !== null && { + environment: serializeAws_json1_1EnvironmentVariables(input.environment, context), + }), + ...(input.environmentFiles !== undefined && + input.environmentFiles !== null && { + environmentFiles: serializeAws_json1_1EnvironmentFiles(input.environmentFiles, context), + }), + ...(input.memory !== undefined && input.memory !== null && { memory: input.memory }), + ...(input.memoryReservation !== undefined && + input.memoryReservation !== null && { memoryReservation: input.memoryReservation }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.resourceRequirements !== undefined && + input.resourceRequirements !== null && { + resourceRequirements: serializeAws_json1_1ResourceRequirements(input.resourceRequirements, context), + }), }; }; const serializeAws_json1_1ContainerOverrides = (input: ContainerOverride[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ContainerOverride(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ContainerOverride(entry, context); + }); }; const serializeAws_json1_1ContainerStateChange = (input: ContainerStateChange, context: __SerdeContext): any => { return { - ...(input.containerName !== undefined && { containerName: input.containerName }), - ...(input.exitCode !== undefined && { exitCode: input.exitCode }), - ...(input.imageDigest !== undefined && { imageDigest: input.imageDigest }), - ...(input.networkBindings !== undefined && { - networkBindings: serializeAws_json1_1NetworkBindings(input.networkBindings, context), - }), - ...(input.reason !== undefined && { reason: input.reason }), - ...(input.runtimeId !== undefined && { runtimeId: input.runtimeId }), - ...(input.status !== undefined && { status: input.status }), + ...(input.containerName !== undefined && input.containerName !== null && { containerName: input.containerName }), + ...(input.exitCode !== undefined && input.exitCode !== null && { exitCode: input.exitCode }), + ...(input.imageDigest !== undefined && input.imageDigest !== null && { imageDigest: input.imageDigest }), + ...(input.networkBindings !== undefined && + input.networkBindings !== null && { + networkBindings: serializeAws_json1_1NetworkBindings(input.networkBindings, context), + }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), + ...(input.runtimeId !== undefined && input.runtimeId !== null && { runtimeId: input.runtimeId }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1ContainerStateChanges = (input: ContainerStateChange[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ContainerStateChange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ContainerStateChange(entry, context); + }); }; const serializeAws_json1_1CreateCapacityProviderRequest = ( @@ -5784,98 +5853,122 @@ const serializeAws_json1_1CreateCapacityProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.autoScalingGroupProvider !== undefined && { - autoScalingGroupProvider: serializeAws_json1_1AutoScalingGroupProvider(input.autoScalingGroupProvider, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.autoScalingGroupProvider !== undefined && + input.autoScalingGroupProvider !== null && { + autoScalingGroupProvider: serializeAws_json1_1AutoScalingGroupProvider(input.autoScalingGroupProvider, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), }; }; const serializeAws_json1_1CreateClusterRequest = (input: CreateClusterRequest, context: __SerdeContext): any => { return { - ...(input.capacityProviders !== undefined && { - capacityProviders: serializeAws_json1_1StringList(input.capacityProviders, context), - }), - ...(input.clusterName !== undefined && { clusterName: input.clusterName }), - ...(input.defaultCapacityProviderStrategy !== undefined && { - defaultCapacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy( - input.defaultCapacityProviderStrategy, - context - ), - }), - ...(input.settings !== undefined && { settings: serializeAws_json1_1ClusterSettings(input.settings, context) }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.capacityProviders !== undefined && + input.capacityProviders !== null && { + capacityProviders: serializeAws_json1_1StringList(input.capacityProviders, context), + }), + ...(input.clusterName !== undefined && input.clusterName !== null && { clusterName: input.clusterName }), + ...(input.defaultCapacityProviderStrategy !== undefined && + input.defaultCapacityProviderStrategy !== null && { + defaultCapacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy( + input.defaultCapacityProviderStrategy, + context + ), + }), + ...(input.settings !== undefined && + input.settings !== null && { settings: serializeAws_json1_1ClusterSettings(input.settings, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), }; }; const serializeAws_json1_1CreateServiceRequest = (input: CreateServiceRequest, context: __SerdeContext): any => { return { - ...(input.capacityProviderStrategy !== undefined && { - capacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy(input.capacityProviderStrategy, context), - }), - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.deploymentConfiguration !== undefined && { - deploymentConfiguration: serializeAws_json1_1DeploymentConfiguration(input.deploymentConfiguration, context), - }), - ...(input.deploymentController !== undefined && { - deploymentController: serializeAws_json1_1DeploymentController(input.deploymentController, context), - }), - ...(input.desiredCount !== undefined && { desiredCount: input.desiredCount }), - ...(input.enableECSManagedTags !== undefined && { enableECSManagedTags: input.enableECSManagedTags }), - ...(input.healthCheckGracePeriodSeconds !== undefined && { - healthCheckGracePeriodSeconds: input.healthCheckGracePeriodSeconds, - }), - ...(input.launchType !== undefined && { launchType: input.launchType }), - ...(input.loadBalancers !== undefined && { - loadBalancers: serializeAws_json1_1LoadBalancers(input.loadBalancers, context), - }), - ...(input.networkConfiguration !== undefined && { - networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), - }), - ...(input.placementConstraints !== undefined && { - placementConstraints: serializeAws_json1_1PlacementConstraints(input.placementConstraints, context), - }), - ...(input.placementStrategy !== undefined && { - placementStrategy: serializeAws_json1_1PlacementStrategies(input.placementStrategy, context), - }), - ...(input.platformVersion !== undefined && { platformVersion: input.platformVersion }), - ...(input.propagateTags !== undefined && { propagateTags: input.propagateTags }), - ...(input.role !== undefined && { role: input.role }), - ...(input.schedulingStrategy !== undefined && { schedulingStrategy: input.schedulingStrategy }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), - ...(input.serviceRegistries !== undefined && { - serviceRegistries: serializeAws_json1_1ServiceRegistries(input.serviceRegistries, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), - ...(input.taskDefinition !== undefined && { taskDefinition: input.taskDefinition }), + ...(input.capacityProviderStrategy !== undefined && + input.capacityProviderStrategy !== null && { + capacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy(input.capacityProviderStrategy, context), + }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.deploymentConfiguration !== undefined && + input.deploymentConfiguration !== null && { + deploymentConfiguration: serializeAws_json1_1DeploymentConfiguration(input.deploymentConfiguration, context), + }), + ...(input.deploymentController !== undefined && + input.deploymentController !== null && { + deploymentController: serializeAws_json1_1DeploymentController(input.deploymentController, context), + }), + ...(input.desiredCount !== undefined && input.desiredCount !== null && { desiredCount: input.desiredCount }), + ...(input.enableECSManagedTags !== undefined && + input.enableECSManagedTags !== null && { enableECSManagedTags: input.enableECSManagedTags }), + ...(input.healthCheckGracePeriodSeconds !== undefined && + input.healthCheckGracePeriodSeconds !== null && { + healthCheckGracePeriodSeconds: input.healthCheckGracePeriodSeconds, + }), + ...(input.launchType !== undefined && input.launchType !== null && { launchType: input.launchType }), + ...(input.loadBalancers !== undefined && + input.loadBalancers !== null && { + loadBalancers: serializeAws_json1_1LoadBalancers(input.loadBalancers, context), + }), + ...(input.networkConfiguration !== undefined && + input.networkConfiguration !== null && { + networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), + }), + ...(input.placementConstraints !== undefined && + input.placementConstraints !== null && { + placementConstraints: serializeAws_json1_1PlacementConstraints(input.placementConstraints, context), + }), + ...(input.placementStrategy !== undefined && + input.placementStrategy !== null && { + placementStrategy: serializeAws_json1_1PlacementStrategies(input.placementStrategy, context), + }), + ...(input.platformVersion !== undefined && + input.platformVersion !== null && { platformVersion: input.platformVersion }), + ...(input.propagateTags !== undefined && input.propagateTags !== null && { propagateTags: input.propagateTags }), + ...(input.role !== undefined && input.role !== null && { role: input.role }), + ...(input.schedulingStrategy !== undefined && + input.schedulingStrategy !== null && { schedulingStrategy: input.schedulingStrategy }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), + ...(input.serviceRegistries !== undefined && + input.serviceRegistries !== null && { + serviceRegistries: serializeAws_json1_1ServiceRegistries(input.serviceRegistries, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.taskDefinition !== undefined && + input.taskDefinition !== null && { taskDefinition: input.taskDefinition }), }; }; const serializeAws_json1_1CreateTaskSetRequest = (input: CreateTaskSetRequest, context: __SerdeContext): any => { return { - ...(input.capacityProviderStrategy !== undefined && { - capacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy(input.capacityProviderStrategy, context), - }), - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.externalId !== undefined && { externalId: input.externalId }), - ...(input.launchType !== undefined && { launchType: input.launchType }), - ...(input.loadBalancers !== undefined && { - loadBalancers: serializeAws_json1_1LoadBalancers(input.loadBalancers, context), - }), - ...(input.networkConfiguration !== undefined && { - networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), - }), - ...(input.platformVersion !== undefined && { platformVersion: input.platformVersion }), - ...(input.scale !== undefined && { scale: serializeAws_json1_1Scale(input.scale, context) }), - ...(input.service !== undefined && { service: input.service }), - ...(input.serviceRegistries !== undefined && { - serviceRegistries: serializeAws_json1_1ServiceRegistries(input.serviceRegistries, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), - ...(input.taskDefinition !== undefined && { taskDefinition: input.taskDefinition }), + ...(input.capacityProviderStrategy !== undefined && + input.capacityProviderStrategy !== null && { + capacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy(input.capacityProviderStrategy, context), + }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.externalId !== undefined && input.externalId !== null && { externalId: input.externalId }), + ...(input.launchType !== undefined && input.launchType !== null && { launchType: input.launchType }), + ...(input.loadBalancers !== undefined && + input.loadBalancers !== null && { + loadBalancers: serializeAws_json1_1LoadBalancers(input.loadBalancers, context), + }), + ...(input.networkConfiguration !== undefined && + input.networkConfiguration !== null && { + networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), + }), + ...(input.platformVersion !== undefined && + input.platformVersion !== null && { platformVersion: input.platformVersion }), + ...(input.scale !== undefined && + input.scale !== null && { scale: serializeAws_json1_1Scale(input.scale, context) }), + ...(input.service !== undefined && input.service !== null && { service: input.service }), + ...(input.serviceRegistries !== undefined && + input.serviceRegistries !== null && { + serviceRegistries: serializeAws_json1_1ServiceRegistries(input.serviceRegistries, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.taskDefinition !== undefined && + input.taskDefinition !== null && { taskDefinition: input.taskDefinition }), }; }; @@ -5884,15 +5977,16 @@ const serializeAws_json1_1DeleteAccountSettingRequest = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.principalArn !== undefined && { principalArn: input.principalArn }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.principalArn !== undefined && input.principalArn !== null && { principalArn: input.principalArn }), }; }; const serializeAws_json1_1DeleteAttributesRequest = (input: DeleteAttributesRequest, context: __SerdeContext): any => { return { - ...(input.attributes !== undefined && { attributes: serializeAws_json1_1Attributes(input.attributes, context) }), - ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_json1_1Attributes(input.attributes, context) }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), }; }; @@ -5901,30 +5995,31 @@ const serializeAws_json1_1DeleteCapacityProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.capacityProvider !== undefined && { capacityProvider: input.capacityProvider }), + ...(input.capacityProvider !== undefined && + input.capacityProvider !== null && { capacityProvider: input.capacityProvider }), }; }; const serializeAws_json1_1DeleteClusterRequest = (input: DeleteClusterRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), }; }; const serializeAws_json1_1DeleteServiceRequest = (input: DeleteServiceRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.force !== undefined && { force: input.force }), - ...(input.service !== undefined && { service: input.service }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), + ...(input.service !== undefined && input.service !== null && { service: input.service }), }; }; const serializeAws_json1_1DeleteTaskSetRequest = (input: DeleteTaskSetRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.force !== undefined && { force: input.force }), - ...(input.service !== undefined && { service: input.service }), - ...(input.taskSet !== undefined && { taskSet: input.taskSet }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), + ...(input.service !== undefined && input.service !== null && { service: input.service }), + ...(input.taskSet !== undefined && input.taskSet !== null && { taskSet: input.taskSet }), }; }; @@ -5933,24 +6028,27 @@ const serializeAws_json1_1DeploymentCircuitBreaker = ( context: __SerdeContext ): any => { return { - ...(input.enable !== undefined && { enable: input.enable }), - ...(input.rollback !== undefined && { rollback: input.rollback }), + ...(input.enable !== undefined && input.enable !== null && { enable: input.enable }), + ...(input.rollback !== undefined && input.rollback !== null && { rollback: input.rollback }), }; }; const serializeAws_json1_1DeploymentConfiguration = (input: DeploymentConfiguration, context: __SerdeContext): any => { return { - ...(input.deploymentCircuitBreaker !== undefined && { - deploymentCircuitBreaker: serializeAws_json1_1DeploymentCircuitBreaker(input.deploymentCircuitBreaker, context), - }), - ...(input.maximumPercent !== undefined && { maximumPercent: input.maximumPercent }), - ...(input.minimumHealthyPercent !== undefined && { minimumHealthyPercent: input.minimumHealthyPercent }), + ...(input.deploymentCircuitBreaker !== undefined && + input.deploymentCircuitBreaker !== null && { + deploymentCircuitBreaker: serializeAws_json1_1DeploymentCircuitBreaker(input.deploymentCircuitBreaker, context), + }), + ...(input.maximumPercent !== undefined && + input.maximumPercent !== null && { maximumPercent: input.maximumPercent }), + ...(input.minimumHealthyPercent !== undefined && + input.minimumHealthyPercent !== null && { minimumHealthyPercent: input.minimumHealthyPercent }), }; }; const serializeAws_json1_1DeploymentController = (input: DeploymentController, context: __SerdeContext): any => { return { - ...(input.type !== undefined && { type: input.type }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -5959,9 +6057,10 @@ const serializeAws_json1_1DeregisterContainerInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containerInstance !== undefined && { containerInstance: input.containerInstance }), - ...(input.force !== undefined && { force: input.force }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containerInstance !== undefined && + input.containerInstance !== null && { containerInstance: input.containerInstance }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), }; }; @@ -5970,7 +6069,8 @@ const serializeAws_json1_1DeregisterTaskDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.taskDefinition !== undefined && { taskDefinition: input.taskDefinition }), + ...(input.taskDefinition !== undefined && + input.taskDefinition !== null && { taskDefinition: input.taskDefinition }), }; }; @@ -5979,21 +6079,23 @@ const serializeAws_json1_1DescribeCapacityProvidersRequest = ( context: __SerdeContext ): any => { return { - ...(input.capacityProviders !== undefined && { - capacityProviders: serializeAws_json1_1StringList(input.capacityProviders, context), - }), - ...(input.include !== undefined && { - include: serializeAws_json1_1CapacityProviderFieldList(input.include, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.capacityProviders !== undefined && + input.capacityProviders !== null && { + capacityProviders: serializeAws_json1_1StringList(input.capacityProviders, context), + }), + ...(input.include !== undefined && + input.include !== null && { include: serializeAws_json1_1CapacityProviderFieldList(input.include, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1DescribeClustersRequest = (input: DescribeClustersRequest, context: __SerdeContext): any => { return { - ...(input.clusters !== undefined && { clusters: serializeAws_json1_1StringList(input.clusters, context) }), - ...(input.include !== undefined && { include: serializeAws_json1_1ClusterFieldList(input.include, context) }), + ...(input.clusters !== undefined && + input.clusters !== null && { clusters: serializeAws_json1_1StringList(input.clusters, context) }), + ...(input.include !== undefined && + input.include !== null && { include: serializeAws_json1_1ClusterFieldList(input.include, context) }), }; }; @@ -6002,21 +6104,23 @@ const serializeAws_json1_1DescribeContainerInstancesRequest = ( context: __SerdeContext ): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containerInstances !== undefined && { - containerInstances: serializeAws_json1_1StringList(input.containerInstances, context), - }), - ...(input.include !== undefined && { - include: serializeAws_json1_1ContainerInstanceFieldList(input.include, context), - }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containerInstances !== undefined && + input.containerInstances !== null && { + containerInstances: serializeAws_json1_1StringList(input.containerInstances, context), + }), + ...(input.include !== undefined && + input.include !== null && { include: serializeAws_json1_1ContainerInstanceFieldList(input.include, context) }), }; }; const serializeAws_json1_1DescribeServicesRequest = (input: DescribeServicesRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.include !== undefined && { include: serializeAws_json1_1ServiceFieldList(input.include, context) }), - ...(input.services !== undefined && { services: serializeAws_json1_1StringList(input.services, context) }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.include !== undefined && + input.include !== null && { include: serializeAws_json1_1ServiceFieldList(input.include, context) }), + ...(input.services !== undefined && + input.services !== null && { services: serializeAws_json1_1StringList(input.services, context) }), }; }; @@ -6025,37 +6129,42 @@ const serializeAws_json1_1DescribeTaskDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.include !== undefined && { - include: serializeAws_json1_1TaskDefinitionFieldList(input.include, context), - }), - ...(input.taskDefinition !== undefined && { taskDefinition: input.taskDefinition }), + ...(input.include !== undefined && + input.include !== null && { include: serializeAws_json1_1TaskDefinitionFieldList(input.include, context) }), + ...(input.taskDefinition !== undefined && + input.taskDefinition !== null && { taskDefinition: input.taskDefinition }), }; }; const serializeAws_json1_1DescribeTaskSetsRequest = (input: DescribeTaskSetsRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.include !== undefined && { include: serializeAws_json1_1TaskSetFieldList(input.include, context) }), - ...(input.service !== undefined && { service: input.service }), - ...(input.taskSets !== undefined && { taskSets: serializeAws_json1_1StringList(input.taskSets, context) }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.include !== undefined && + input.include !== null && { include: serializeAws_json1_1TaskSetFieldList(input.include, context) }), + ...(input.service !== undefined && input.service !== null && { service: input.service }), + ...(input.taskSets !== undefined && + input.taskSets !== null && { taskSets: serializeAws_json1_1StringList(input.taskSets, context) }), }; }; const serializeAws_json1_1DescribeTasksRequest = (input: DescribeTasksRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.include !== undefined && { include: serializeAws_json1_1TaskFieldList(input.include, context) }), - ...(input.tasks !== undefined && { tasks: serializeAws_json1_1StringList(input.tasks, context) }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.include !== undefined && + input.include !== null && { include: serializeAws_json1_1TaskFieldList(input.include, context) }), + ...(input.tasks !== undefined && + input.tasks !== null && { tasks: serializeAws_json1_1StringList(input.tasks, context) }), }; }; const serializeAws_json1_1Device = (input: Device, context: __SerdeContext): any => { return { - ...(input.containerPath !== undefined && { containerPath: input.containerPath }), - ...(input.hostPath !== undefined && { hostPath: input.hostPath }), - ...(input.permissions !== undefined && { - permissions: serializeAws_json1_1DeviceCgroupPermissions(input.permissions, context), - }), + ...(input.containerPath !== undefined && input.containerPath !== null && { containerPath: input.containerPath }), + ...(input.hostPath !== undefined && input.hostPath !== null && { hostPath: input.hostPath }), + ...(input.permissions !== undefined && + input.permissions !== null && { + permissions: serializeAws_json1_1DeviceCgroupPermissions(input.permissions, context), + }), }; }; @@ -6063,11 +6172,25 @@ const serializeAws_json1_1DeviceCgroupPermissions = ( input: (DeviceCgroupPermission | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DevicesList = (input: Device[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Device(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Device(entry, context); + }); }; const serializeAws_json1_1DiscoverPollEndpointRequest = ( @@ -6075,19 +6198,22 @@ const serializeAws_json1_1DiscoverPollEndpointRequest = ( context: __SerdeContext ): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containerInstance !== undefined && { containerInstance: input.containerInstance }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containerInstance !== undefined && + input.containerInstance !== null && { containerInstance: input.containerInstance }), }; }; const serializeAws_json1_1DockerLabelsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1DockerVolumeConfiguration = ( @@ -6095,54 +6221,74 @@ const serializeAws_json1_1DockerVolumeConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.autoprovision !== undefined && { autoprovision: input.autoprovision }), - ...(input.driver !== undefined && { driver: input.driver }), - ...(input.driverOpts !== undefined && { driverOpts: serializeAws_json1_1StringMap(input.driverOpts, context) }), - ...(input.labels !== undefined && { labels: serializeAws_json1_1StringMap(input.labels, context) }), - ...(input.scope !== undefined && { scope: input.scope }), + ...(input.autoprovision !== undefined && input.autoprovision !== null && { autoprovision: input.autoprovision }), + ...(input.driver !== undefined && input.driver !== null && { driver: input.driver }), + ...(input.driverOpts !== undefined && + input.driverOpts !== null && { driverOpts: serializeAws_json1_1StringMap(input.driverOpts, context) }), + ...(input.labels !== undefined && + input.labels !== null && { labels: serializeAws_json1_1StringMap(input.labels, context) }), + ...(input.scope !== undefined && input.scope !== null && { scope: input.scope }), }; }; const serializeAws_json1_1EFSAuthorizationConfig = (input: EFSAuthorizationConfig, context: __SerdeContext): any => { return { - ...(input.accessPointId !== undefined && { accessPointId: input.accessPointId }), - ...(input.iam !== undefined && { iam: input.iam }), + ...(input.accessPointId !== undefined && input.accessPointId !== null && { accessPointId: input.accessPointId }), + ...(input.iam !== undefined && input.iam !== null && { iam: input.iam }), }; }; const serializeAws_json1_1EFSVolumeConfiguration = (input: EFSVolumeConfiguration, context: __SerdeContext): any => { return { - ...(input.authorizationConfig !== undefined && { - authorizationConfig: serializeAws_json1_1EFSAuthorizationConfig(input.authorizationConfig, context), - }), - ...(input.fileSystemId !== undefined && { fileSystemId: input.fileSystemId }), - ...(input.rootDirectory !== undefined && { rootDirectory: input.rootDirectory }), - ...(input.transitEncryption !== undefined && { transitEncryption: input.transitEncryption }), - ...(input.transitEncryptionPort !== undefined && { transitEncryptionPort: input.transitEncryptionPort }), + ...(input.authorizationConfig !== undefined && + input.authorizationConfig !== null && { + authorizationConfig: serializeAws_json1_1EFSAuthorizationConfig(input.authorizationConfig, context), + }), + ...(input.fileSystemId !== undefined && input.fileSystemId !== null && { fileSystemId: input.fileSystemId }), + ...(input.rootDirectory !== undefined && input.rootDirectory !== null && { rootDirectory: input.rootDirectory }), + ...(input.transitEncryption !== undefined && + input.transitEncryption !== null && { transitEncryption: input.transitEncryption }), + ...(input.transitEncryptionPort !== undefined && + input.transitEncryptionPort !== null && { transitEncryptionPort: input.transitEncryptionPort }), }; }; const serializeAws_json1_1EnvironmentFile = (input: EnvironmentFile, context: __SerdeContext): any => { return { - ...(input.type !== undefined && { type: input.type }), - ...(input.value !== undefined && { value: input.value }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1EnvironmentFiles = (input: EnvironmentFile[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EnvironmentFile(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EnvironmentFile(entry, context); + }); }; const serializeAws_json1_1EnvironmentVariables = (input: KeyValuePair[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1KeyValuePair(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1KeyValuePair(entry, context); + }); }; const serializeAws_json1_1FirelensConfiguration = (input: FirelensConfiguration, context: __SerdeContext): any => { return { - ...(input.options !== undefined && { - options: serializeAws_json1_1FirelensConfigurationOptionsMap(input.options, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.options !== undefined && + input.options !== null && { + options: serializeAws_json1_1FirelensConfigurationOptionsMap(input.options, context), + }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -6150,13 +6296,15 @@ const serializeAws_json1_1FirelensConfigurationOptionsMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1FSxWindowsFileServerAuthorizationConfig = ( @@ -6164,8 +6312,9 @@ const serializeAws_json1_1FSxWindowsFileServerAuthorizationConfig = ( context: __SerdeContext ): any => { return { - ...(input.credentialsParameter !== undefined && { credentialsParameter: input.credentialsParameter }), - ...(input.domain !== undefined && { domain: input.domain }), + ...(input.credentialsParameter !== undefined && + input.credentialsParameter !== null && { credentialsParameter: input.credentialsParameter }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), }; }; @@ -6174,48 +6323,57 @@ const serializeAws_json1_1FSxWindowsFileServerVolumeConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.authorizationConfig !== undefined && { - authorizationConfig: serializeAws_json1_1FSxWindowsFileServerAuthorizationConfig( - input.authorizationConfig, - context - ), - }), - ...(input.fileSystemId !== undefined && { fileSystemId: input.fileSystemId }), - ...(input.rootDirectory !== undefined && { rootDirectory: input.rootDirectory }), + ...(input.authorizationConfig !== undefined && + input.authorizationConfig !== null && { + authorizationConfig: serializeAws_json1_1FSxWindowsFileServerAuthorizationConfig( + input.authorizationConfig, + context + ), + }), + ...(input.fileSystemId !== undefined && input.fileSystemId !== null && { fileSystemId: input.fileSystemId }), + ...(input.rootDirectory !== undefined && input.rootDirectory !== null && { rootDirectory: input.rootDirectory }), }; }; const serializeAws_json1_1HealthCheck = (input: HealthCheck, context: __SerdeContext): any => { return { - ...(input.command !== undefined && { command: serializeAws_json1_1StringList(input.command, context) }), - ...(input.interval !== undefined && { interval: input.interval }), - ...(input.retries !== undefined && { retries: input.retries }), - ...(input.startPeriod !== undefined && { startPeriod: input.startPeriod }), - ...(input.timeout !== undefined && { timeout: input.timeout }), + ...(input.command !== undefined && + input.command !== null && { command: serializeAws_json1_1StringList(input.command, context) }), + ...(input.interval !== undefined && input.interval !== null && { interval: input.interval }), + ...(input.retries !== undefined && input.retries !== null && { retries: input.retries }), + ...(input.startPeriod !== undefined && input.startPeriod !== null && { startPeriod: input.startPeriod }), + ...(input.timeout !== undefined && input.timeout !== null && { timeout: input.timeout }), }; }; const serializeAws_json1_1HostEntry = (input: HostEntry, context: __SerdeContext): any => { return { - ...(input.hostname !== undefined && { hostname: input.hostname }), - ...(input.ipAddress !== undefined && { ipAddress: input.ipAddress }), + ...(input.hostname !== undefined && input.hostname !== null && { hostname: input.hostname }), + ...(input.ipAddress !== undefined && input.ipAddress !== null && { ipAddress: input.ipAddress }), }; }; const serializeAws_json1_1HostEntryList = (input: HostEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1HostEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1HostEntry(entry, context); + }); }; const serializeAws_json1_1HostVolumeProperties = (input: HostVolumeProperties, context: __SerdeContext): any => { return { - ...(input.sourcePath !== undefined && { sourcePath: input.sourcePath }), + ...(input.sourcePath !== undefined && input.sourcePath !== null && { sourcePath: input.sourcePath }), }; }; const serializeAws_json1_1InferenceAccelerator = (input: InferenceAccelerator, context: __SerdeContext): any => { return { - ...(input.deviceName !== undefined && { deviceName: input.deviceName }), - ...(input.deviceType !== undefined && { deviceType: input.deviceType }), + ...(input.deviceName !== undefined && input.deviceName !== null && { deviceName: input.deviceName }), + ...(input.deviceType !== undefined && input.deviceType !== null && { deviceType: input.deviceType }), }; }; @@ -6224,8 +6382,8 @@ const serializeAws_json1_1InferenceAcceleratorOverride = ( context: __SerdeContext ): any => { return { - ...(input.deviceName !== undefined && { deviceName: input.deviceName }), - ...(input.deviceType !== undefined && { deviceType: input.deviceType }), + ...(input.deviceName !== undefined && input.deviceName !== null && { deviceName: input.deviceName }), + ...(input.deviceType !== undefined && input.deviceType !== null && { deviceType: input.deviceType }), }; }; @@ -6233,38 +6391,58 @@ const serializeAws_json1_1InferenceAcceleratorOverrides = ( input: InferenceAcceleratorOverride[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1InferenceAcceleratorOverride(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InferenceAcceleratorOverride(entry, context); + }); }; const serializeAws_json1_1InferenceAccelerators = (input: InferenceAccelerator[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InferenceAccelerator(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InferenceAccelerator(entry, context); + }); }; const serializeAws_json1_1KernelCapabilities = (input: KernelCapabilities, context: __SerdeContext): any => { return { - ...(input.add !== undefined && { add: serializeAws_json1_1StringList(input.add, context) }), - ...(input.drop !== undefined && { drop: serializeAws_json1_1StringList(input.drop, context) }), + ...(input.add !== undefined && input.add !== null && { add: serializeAws_json1_1StringList(input.add, context) }), + ...(input.drop !== undefined && + input.drop !== null && { drop: serializeAws_json1_1StringList(input.drop, context) }), }; }; const serializeAws_json1_1KeyValuePair = (input: KeyValuePair, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: input.value }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1LinuxParameters = (input: LinuxParameters, context: __SerdeContext): any => { return { - ...(input.capabilities !== undefined && { - capabilities: serializeAws_json1_1KernelCapabilities(input.capabilities, context), - }), - ...(input.devices !== undefined && { devices: serializeAws_json1_1DevicesList(input.devices, context) }), - ...(input.initProcessEnabled !== undefined && { initProcessEnabled: input.initProcessEnabled }), - ...(input.maxSwap !== undefined && { maxSwap: input.maxSwap }), - ...(input.sharedMemorySize !== undefined && { sharedMemorySize: input.sharedMemorySize }), - ...(input.swappiness !== undefined && { swappiness: input.swappiness }), - ...(input.tmpfs !== undefined && { tmpfs: serializeAws_json1_1TmpfsList(input.tmpfs, context) }), + ...(input.capabilities !== undefined && + input.capabilities !== null && { + capabilities: serializeAws_json1_1KernelCapabilities(input.capabilities, context), + }), + ...(input.devices !== undefined && + input.devices !== null && { devices: serializeAws_json1_1DevicesList(input.devices, context) }), + ...(input.initProcessEnabled !== undefined && + input.initProcessEnabled !== null && { initProcessEnabled: input.initProcessEnabled }), + ...(input.maxSwap !== undefined && input.maxSwap !== null && { maxSwap: input.maxSwap }), + ...(input.sharedMemorySize !== undefined && + input.sharedMemorySize !== null && { sharedMemorySize: input.sharedMemorySize }), + ...(input.swappiness !== undefined && input.swappiness !== null && { swappiness: input.swappiness }), + ...(input.tmpfs !== undefined && + input.tmpfs !== null && { tmpfs: serializeAws_json1_1TmpfsList(input.tmpfs, context) }), }; }; @@ -6273,30 +6451,32 @@ const serializeAws_json1_1ListAccountSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.effectiveSettings !== undefined && { effectiveSettings: input.effectiveSettings }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.name !== undefined && { name: input.name }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.principalArn !== undefined && { principalArn: input.principalArn }), - ...(input.value !== undefined && { value: input.value }), + ...(input.effectiveSettings !== undefined && + input.effectiveSettings !== null && { effectiveSettings: input.effectiveSettings }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.principalArn !== undefined && input.principalArn !== null && { principalArn: input.principalArn }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1ListAttributesRequest = (input: ListAttributesRequest, context: __SerdeContext): any => { return { - ...(input.attributeName !== undefined && { attributeName: input.attributeName }), - ...(input.attributeValue !== undefined && { attributeValue: input.attributeValue }), - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.targetType !== undefined && { targetType: input.targetType }), + ...(input.attributeName !== undefined && input.attributeName !== null && { attributeName: input.attributeName }), + ...(input.attributeValue !== undefined && + input.attributeValue !== null && { attributeValue: input.attributeValue }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.targetType !== undefined && input.targetType !== null && { targetType: input.targetType }), }; }; const serializeAws_json1_1ListClustersRequest = (input: ListClustersRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -6305,21 +6485,22 @@ const serializeAws_json1_1ListContainerInstancesRequest = ( context: __SerdeContext ): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.filter !== undefined && { filter: input.filter }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.status !== undefined && { status: input.status }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.filter !== undefined && input.filter !== null && { filter: input.filter }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1ListServicesRequest = (input: ListServicesRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.launchType !== undefined && { launchType: input.launchType }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.schedulingStrategy !== undefined && { schedulingStrategy: input.schedulingStrategy }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.launchType !== undefined && input.launchType !== null && { launchType: input.launchType }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.schedulingStrategy !== undefined && + input.schedulingStrategy !== null && { schedulingStrategy: input.schedulingStrategy }), }; }; @@ -6328,7 +6509,7 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; @@ -6337,10 +6518,10 @@ const serializeAws_json1_1ListTaskDefinitionFamiliesRequest = ( context: __SerdeContext ): any => { return { - ...(input.familyPrefix !== undefined && { familyPrefix: input.familyPrefix }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.status !== undefined && { status: input.status }), + ...(input.familyPrefix !== undefined && input.familyPrefix !== null && { familyPrefix: input.familyPrefix }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; @@ -6349,50 +6530,58 @@ const serializeAws_json1_1ListTaskDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.familyPrefix !== undefined && { familyPrefix: input.familyPrefix }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sort !== undefined && { sort: input.sort }), - ...(input.status !== undefined && { status: input.status }), + ...(input.familyPrefix !== undefined && input.familyPrefix !== null && { familyPrefix: input.familyPrefix }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sort !== undefined && input.sort !== null && { sort: input.sort }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1ListTasksRequest = (input: ListTasksRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containerInstance !== undefined && { containerInstance: input.containerInstance }), - ...(input.desiredStatus !== undefined && { desiredStatus: input.desiredStatus }), - ...(input.family !== undefined && { family: input.family }), - ...(input.launchType !== undefined && { launchType: input.launchType }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), - ...(input.startedBy !== undefined && { startedBy: input.startedBy }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containerInstance !== undefined && + input.containerInstance !== null && { containerInstance: input.containerInstance }), + ...(input.desiredStatus !== undefined && input.desiredStatus !== null && { desiredStatus: input.desiredStatus }), + ...(input.family !== undefined && input.family !== null && { family: input.family }), + ...(input.launchType !== undefined && input.launchType !== null && { launchType: input.launchType }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), + ...(input.startedBy !== undefined && input.startedBy !== null && { startedBy: input.startedBy }), }; }; const serializeAws_json1_1LoadBalancer = (input: LoadBalancer, context: __SerdeContext): any => { return { - ...(input.containerName !== undefined && { containerName: input.containerName }), - ...(input.containerPort !== undefined && { containerPort: input.containerPort }), - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), - ...(input.targetGroupArn !== undefined && { targetGroupArn: input.targetGroupArn }), + ...(input.containerName !== undefined && input.containerName !== null && { containerName: input.containerName }), + ...(input.containerPort !== undefined && input.containerPort !== null && { containerPort: input.containerPort }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), + ...(input.targetGroupArn !== undefined && + input.targetGroupArn !== null && { targetGroupArn: input.targetGroupArn }), }; }; const serializeAws_json1_1LoadBalancers = (input: LoadBalancer[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1LoadBalancer(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1LoadBalancer(entry, context); + }); }; const serializeAws_json1_1LogConfiguration = (input: LogConfiguration, context: __SerdeContext): any => { return { - ...(input.logDriver !== undefined && { logDriver: input.logDriver }), - ...(input.options !== undefined && { - options: serializeAws_json1_1LogConfigurationOptionsMap(input.options, context), - }), - ...(input.secretOptions !== undefined && { - secretOptions: serializeAws_json1_1SecretList(input.secretOptions, context), - }), + ...(input.logDriver !== undefined && input.logDriver !== null && { logDriver: input.logDriver }), + ...(input.options !== undefined && + input.options !== null && { options: serializeAws_json1_1LogConfigurationOptionsMap(input.options, context) }), + ...(input.secretOptions !== undefined && + input.secretOptions !== null && { secretOptions: serializeAws_json1_1SecretList(input.secretOptions, context) }), }; }; @@ -6400,115 +6589,172 @@ const serializeAws_json1_1LogConfigurationOptionsMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ManagedScaling = (input: ManagedScaling, context: __SerdeContext): any => { return { - ...(input.instanceWarmupPeriod !== undefined && { instanceWarmupPeriod: input.instanceWarmupPeriod }), - ...(input.maximumScalingStepSize !== undefined && { maximumScalingStepSize: input.maximumScalingStepSize }), - ...(input.minimumScalingStepSize !== undefined && { minimumScalingStepSize: input.minimumScalingStepSize }), - ...(input.status !== undefined && { status: input.status }), - ...(input.targetCapacity !== undefined && { targetCapacity: input.targetCapacity }), + ...(input.instanceWarmupPeriod !== undefined && + input.instanceWarmupPeriod !== null && { instanceWarmupPeriod: input.instanceWarmupPeriod }), + ...(input.maximumScalingStepSize !== undefined && + input.maximumScalingStepSize !== null && { maximumScalingStepSize: input.maximumScalingStepSize }), + ...(input.minimumScalingStepSize !== undefined && + input.minimumScalingStepSize !== null && { minimumScalingStepSize: input.minimumScalingStepSize }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.targetCapacity !== undefined && + input.targetCapacity !== null && { targetCapacity: input.targetCapacity }), }; }; const serializeAws_json1_1MountPoint = (input: MountPoint, context: __SerdeContext): any => { return { - ...(input.containerPath !== undefined && { containerPath: input.containerPath }), - ...(input.readOnly !== undefined && { readOnly: input.readOnly }), - ...(input.sourceVolume !== undefined && { sourceVolume: input.sourceVolume }), + ...(input.containerPath !== undefined && input.containerPath !== null && { containerPath: input.containerPath }), + ...(input.readOnly !== undefined && input.readOnly !== null && { readOnly: input.readOnly }), + ...(input.sourceVolume !== undefined && input.sourceVolume !== null && { sourceVolume: input.sourceVolume }), }; }; const serializeAws_json1_1MountPointList = (input: MountPoint[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MountPoint(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MountPoint(entry, context); + }); }; const serializeAws_json1_1NetworkBinding = (input: NetworkBinding, context: __SerdeContext): any => { return { - ...(input.bindIP !== undefined && { bindIP: input.bindIP }), - ...(input.containerPort !== undefined && { containerPort: input.containerPort }), - ...(input.hostPort !== undefined && { hostPort: input.hostPort }), - ...(input.protocol !== undefined && { protocol: input.protocol }), + ...(input.bindIP !== undefined && input.bindIP !== null && { bindIP: input.bindIP }), + ...(input.containerPort !== undefined && input.containerPort !== null && { containerPort: input.containerPort }), + ...(input.hostPort !== undefined && input.hostPort !== null && { hostPort: input.hostPort }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), }; }; const serializeAws_json1_1NetworkBindings = (input: NetworkBinding[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1NetworkBinding(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1NetworkBinding(entry, context); + }); }; const serializeAws_json1_1NetworkConfiguration = (input: NetworkConfiguration, context: __SerdeContext): any => { return { - ...(input.awsvpcConfiguration !== undefined && { - awsvpcConfiguration: serializeAws_json1_1AwsVpcConfiguration(input.awsvpcConfiguration, context), - }), + ...(input.awsvpcConfiguration !== undefined && + input.awsvpcConfiguration !== null && { + awsvpcConfiguration: serializeAws_json1_1AwsVpcConfiguration(input.awsvpcConfiguration, context), + }), }; }; const serializeAws_json1_1PlacementConstraint = (input: PlacementConstraint, context: __SerdeContext): any => { return { - ...(input.expression !== undefined && { expression: input.expression }), - ...(input.type !== undefined && { type: input.type }), + ...(input.expression !== undefined && input.expression !== null && { expression: input.expression }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1PlacementConstraints = (input: PlacementConstraint[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PlacementConstraint(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PlacementConstraint(entry, context); + }); }; const serializeAws_json1_1PlacementStrategies = (input: PlacementStrategy[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PlacementStrategy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PlacementStrategy(entry, context); + }); }; const serializeAws_json1_1PlacementStrategy = (input: PlacementStrategy, context: __SerdeContext): any => { return { - ...(input.field !== undefined && { field: input.field }), - ...(input.type !== undefined && { type: input.type }), + ...(input.field !== undefined && input.field !== null && { field: input.field }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1PlatformDevice = (input: PlatformDevice, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.type !== undefined && { type: input.type }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1PlatformDevices = (input: PlatformDevice[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PlatformDevice(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PlatformDevice(entry, context); + }); }; const serializeAws_json1_1PortMapping = (input: PortMapping, context: __SerdeContext): any => { return { - ...(input.containerPort !== undefined && { containerPort: input.containerPort }), - ...(input.hostPort !== undefined && { hostPort: input.hostPort }), - ...(input.protocol !== undefined && { protocol: input.protocol }), + ...(input.containerPort !== undefined && input.containerPort !== null && { containerPort: input.containerPort }), + ...(input.hostPort !== undefined && input.hostPort !== null && { hostPort: input.hostPort }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), }; }; const serializeAws_json1_1PortMappingList = (input: PortMapping[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PortMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PortMapping(entry, context); + }); }; const serializeAws_json1_1ProxyConfiguration = (input: ProxyConfiguration, context: __SerdeContext): any => { return { - ...(input.containerName !== undefined && { containerName: input.containerName }), - ...(input.properties !== undefined && { - properties: serializeAws_json1_1ProxyConfigurationProperties(input.properties, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.containerName !== undefined && input.containerName !== null && { containerName: input.containerName }), + ...(input.properties !== undefined && + input.properties !== null && { + properties: serializeAws_json1_1ProxyConfigurationProperties(input.properties, context), + }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1ProxyConfigurationProperties = (input: KeyValuePair[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1KeyValuePair(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1KeyValuePair(entry, context); + }); }; const serializeAws_json1_1PutAccountSettingDefaultRequest = ( @@ -6516,8 +6762,8 @@ const serializeAws_json1_1PutAccountSettingDefaultRequest = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: input.value }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; @@ -6526,16 +6772,17 @@ const serializeAws_json1_1PutAccountSettingRequest = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.principalArn !== undefined && { principalArn: input.principalArn }), - ...(input.value !== undefined && { value: input.value }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.principalArn !== undefined && input.principalArn !== null && { principalArn: input.principalArn }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1PutAttributesRequest = (input: PutAttributesRequest, context: __SerdeContext): any => { return { - ...(input.attributes !== undefined && { attributes: serializeAws_json1_1Attributes(input.attributes, context) }), - ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_json1_1Attributes(input.attributes, context) }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), }; }; @@ -6544,16 +6791,18 @@ const serializeAws_json1_1PutClusterCapacityProvidersRequest = ( context: __SerdeContext ): any => { return { - ...(input.capacityProviders !== undefined && { - capacityProviders: serializeAws_json1_1StringList(input.capacityProviders, context), - }), - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.defaultCapacityProviderStrategy !== undefined && { - defaultCapacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy( - input.defaultCapacityProviderStrategy, - context - ), - }), + ...(input.capacityProviders !== undefined && + input.capacityProviders !== null && { + capacityProviders: serializeAws_json1_1StringList(input.capacityProviders, context), + }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.defaultCapacityProviderStrategy !== undefined && + input.defaultCapacityProviderStrategy !== null && { + defaultCapacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy( + input.defaultCapacityProviderStrategy, + context + ), + }), }; }; @@ -6562,23 +6811,28 @@ const serializeAws_json1_1RegisterContainerInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.attributes !== undefined && { attributes: serializeAws_json1_1Attributes(input.attributes, context) }), - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containerInstanceArn !== undefined && { containerInstanceArn: input.containerInstanceArn }), - ...(input.instanceIdentityDocument !== undefined && { instanceIdentityDocument: input.instanceIdentityDocument }), - ...(input.instanceIdentityDocumentSignature !== undefined && { - instanceIdentityDocumentSignature: input.instanceIdentityDocumentSignature, - }), - ...(input.platformDevices !== undefined && { - platformDevices: serializeAws_json1_1PlatformDevices(input.platformDevices, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), - ...(input.totalResources !== undefined && { - totalResources: serializeAws_json1_1Resources(input.totalResources, context), - }), - ...(input.versionInfo !== undefined && { - versionInfo: serializeAws_json1_1VersionInfo(input.versionInfo, context), - }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_json1_1Attributes(input.attributes, context) }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containerInstanceArn !== undefined && + input.containerInstanceArn !== null && { containerInstanceArn: input.containerInstanceArn }), + ...(input.instanceIdentityDocument !== undefined && + input.instanceIdentityDocument !== null && { instanceIdentityDocument: input.instanceIdentityDocument }), + ...(input.instanceIdentityDocumentSignature !== undefined && + input.instanceIdentityDocumentSignature !== null && { + instanceIdentityDocumentSignature: input.instanceIdentityDocumentSignature, + }), + ...(input.platformDevices !== undefined && + input.platformDevices !== null && { + platformDevices: serializeAws_json1_1PlatformDevices(input.platformDevices, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.totalResources !== undefined && + input.totalResources !== null && { + totalResources: serializeAws_json1_1Resources(input.totalResources, context), + }), + ...(input.versionInfo !== undefined && + input.versionInfo !== null && { versionInfo: serializeAws_json1_1VersionInfo(input.versionInfo, context) }), }; }; @@ -6587,172 +6841,241 @@ const serializeAws_json1_1RegisterTaskDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.containerDefinitions !== undefined && { - containerDefinitions: serializeAws_json1_1ContainerDefinitions(input.containerDefinitions, context), - }), - ...(input.cpu !== undefined && { cpu: input.cpu }), - ...(input.executionRoleArn !== undefined && { executionRoleArn: input.executionRoleArn }), - ...(input.family !== undefined && { family: input.family }), - ...(input.inferenceAccelerators !== undefined && { - inferenceAccelerators: serializeAws_json1_1InferenceAccelerators(input.inferenceAccelerators, context), - }), - ...(input.ipcMode !== undefined && { ipcMode: input.ipcMode }), - ...(input.memory !== undefined && { memory: input.memory }), - ...(input.networkMode !== undefined && { networkMode: input.networkMode }), - ...(input.pidMode !== undefined && { pidMode: input.pidMode }), - ...(input.placementConstraints !== undefined && { - placementConstraints: serializeAws_json1_1TaskDefinitionPlacementConstraints(input.placementConstraints, context), - }), - ...(input.proxyConfiguration !== undefined && { - proxyConfiguration: serializeAws_json1_1ProxyConfiguration(input.proxyConfiguration, context), - }), - ...(input.requiresCompatibilities !== undefined && { - requiresCompatibilities: serializeAws_json1_1CompatibilityList(input.requiresCompatibilities, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), - ...(input.taskRoleArn !== undefined && { taskRoleArn: input.taskRoleArn }), - ...(input.volumes !== undefined && { volumes: serializeAws_json1_1VolumeList(input.volumes, context) }), + ...(input.containerDefinitions !== undefined && + input.containerDefinitions !== null && { + containerDefinitions: serializeAws_json1_1ContainerDefinitions(input.containerDefinitions, context), + }), + ...(input.cpu !== undefined && input.cpu !== null && { cpu: input.cpu }), + ...(input.executionRoleArn !== undefined && + input.executionRoleArn !== null && { executionRoleArn: input.executionRoleArn }), + ...(input.family !== undefined && input.family !== null && { family: input.family }), + ...(input.inferenceAccelerators !== undefined && + input.inferenceAccelerators !== null && { + inferenceAccelerators: serializeAws_json1_1InferenceAccelerators(input.inferenceAccelerators, context), + }), + ...(input.ipcMode !== undefined && input.ipcMode !== null && { ipcMode: input.ipcMode }), + ...(input.memory !== undefined && input.memory !== null && { memory: input.memory }), + ...(input.networkMode !== undefined && input.networkMode !== null && { networkMode: input.networkMode }), + ...(input.pidMode !== undefined && input.pidMode !== null && { pidMode: input.pidMode }), + ...(input.placementConstraints !== undefined && + input.placementConstraints !== null && { + placementConstraints: serializeAws_json1_1TaskDefinitionPlacementConstraints( + input.placementConstraints, + context + ), + }), + ...(input.proxyConfiguration !== undefined && + input.proxyConfiguration !== null && { + proxyConfiguration: serializeAws_json1_1ProxyConfiguration(input.proxyConfiguration, context), + }), + ...(input.requiresCompatibilities !== undefined && + input.requiresCompatibilities !== null && { + requiresCompatibilities: serializeAws_json1_1CompatibilityList(input.requiresCompatibilities, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.taskRoleArn !== undefined && input.taskRoleArn !== null && { taskRoleArn: input.taskRoleArn }), + ...(input.volumes !== undefined && + input.volumes !== null && { volumes: serializeAws_json1_1VolumeList(input.volumes, context) }), }; }; const serializeAws_json1_1RepositoryCredentials = (input: RepositoryCredentials, context: __SerdeContext): any => { return { - ...(input.credentialsParameter !== undefined && { credentialsParameter: input.credentialsParameter }), + ...(input.credentialsParameter !== undefined && + input.credentialsParameter !== null && { credentialsParameter: input.credentialsParameter }), }; }; const serializeAws_json1_1Resource = (input: Resource, context: __SerdeContext): any => { return { - ...(input.doubleValue !== undefined && { doubleValue: input.doubleValue }), - ...(input.integerValue !== undefined && { integerValue: input.integerValue }), - ...(input.longValue !== undefined && { longValue: input.longValue }), - ...(input.name !== undefined && { name: input.name }), - ...(input.stringSetValue !== undefined && { - stringSetValue: serializeAws_json1_1StringList(input.stringSetValue, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.doubleValue !== undefined && input.doubleValue !== null && { doubleValue: input.doubleValue }), + ...(input.integerValue !== undefined && input.integerValue !== null && { integerValue: input.integerValue }), + ...(input.longValue !== undefined && input.longValue !== null && { longValue: input.longValue }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.stringSetValue !== undefined && + input.stringSetValue !== null && { + stringSetValue: serializeAws_json1_1StringList(input.stringSetValue, context), + }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1ResourceRequirement = (input: ResourceRequirement, context: __SerdeContext): any => { return { - ...(input.type !== undefined && { type: input.type }), - ...(input.value !== undefined && { value: input.value }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1ResourceRequirements = (input: ResourceRequirement[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ResourceRequirement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ResourceRequirement(entry, context); + }); }; const serializeAws_json1_1Resources = (input: Resource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Resource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Resource(entry, context); + }); }; const serializeAws_json1_1RunTaskRequest = (input: RunTaskRequest, context: __SerdeContext): any => { return { - ...(input.capacityProviderStrategy !== undefined && { - capacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy(input.capacityProviderStrategy, context), - }), - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.count !== undefined && { count: input.count }), - ...(input.enableECSManagedTags !== undefined && { enableECSManagedTags: input.enableECSManagedTags }), - ...(input.group !== undefined && { group: input.group }), - ...(input.launchType !== undefined && { launchType: input.launchType }), - ...(input.networkConfiguration !== undefined && { - networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), - }), - ...(input.overrides !== undefined && { overrides: serializeAws_json1_1TaskOverride(input.overrides, context) }), - ...(input.placementConstraints !== undefined && { - placementConstraints: serializeAws_json1_1PlacementConstraints(input.placementConstraints, context), - }), - ...(input.placementStrategy !== undefined && { - placementStrategy: serializeAws_json1_1PlacementStrategies(input.placementStrategy, context), - }), - ...(input.platformVersion !== undefined && { platformVersion: input.platformVersion }), - ...(input.propagateTags !== undefined && { propagateTags: input.propagateTags }), - ...(input.referenceId !== undefined && { referenceId: input.referenceId }), - ...(input.startedBy !== undefined && { startedBy: input.startedBy }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), - ...(input.taskDefinition !== undefined && { taskDefinition: input.taskDefinition }), + ...(input.capacityProviderStrategy !== undefined && + input.capacityProviderStrategy !== null && { + capacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy(input.capacityProviderStrategy, context), + }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.count !== undefined && input.count !== null && { count: input.count }), + ...(input.enableECSManagedTags !== undefined && + input.enableECSManagedTags !== null && { enableECSManagedTags: input.enableECSManagedTags }), + ...(input.group !== undefined && input.group !== null && { group: input.group }), + ...(input.launchType !== undefined && input.launchType !== null && { launchType: input.launchType }), + ...(input.networkConfiguration !== undefined && + input.networkConfiguration !== null && { + networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), + }), + ...(input.overrides !== undefined && + input.overrides !== null && { overrides: serializeAws_json1_1TaskOverride(input.overrides, context) }), + ...(input.placementConstraints !== undefined && + input.placementConstraints !== null && { + placementConstraints: serializeAws_json1_1PlacementConstraints(input.placementConstraints, context), + }), + ...(input.placementStrategy !== undefined && + input.placementStrategy !== null && { + placementStrategy: serializeAws_json1_1PlacementStrategies(input.placementStrategy, context), + }), + ...(input.platformVersion !== undefined && + input.platformVersion !== null && { platformVersion: input.platformVersion }), + ...(input.propagateTags !== undefined && input.propagateTags !== null && { propagateTags: input.propagateTags }), + ...(input.referenceId !== undefined && input.referenceId !== null && { referenceId: input.referenceId }), + ...(input.startedBy !== undefined && input.startedBy !== null && { startedBy: input.startedBy }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.taskDefinition !== undefined && + input.taskDefinition !== null && { taskDefinition: input.taskDefinition }), }; }; const serializeAws_json1_1Scale = (input: Scale, context: __SerdeContext): any => { return { - ...(input.unit !== undefined && { unit: input.unit }), - ...(input.value !== undefined && { value: input.value }), + ...(input.unit !== undefined && input.unit !== null && { unit: input.unit }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1Secret = (input: Secret, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.valueFrom !== undefined && { valueFrom: input.valueFrom }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.valueFrom !== undefined && input.valueFrom !== null && { valueFrom: input.valueFrom }), }; }; const serializeAws_json1_1SecretList = (input: Secret[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Secret(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Secret(entry, context); + }); }; const serializeAws_json1_1ServiceFieldList = (input: (ServiceField | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ServiceRegistries = (input: ServiceRegistry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ServiceRegistry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServiceRegistry(entry, context); + }); }; const serializeAws_json1_1ServiceRegistry = (input: ServiceRegistry, context: __SerdeContext): any => { return { - ...(input.containerName !== undefined && { containerName: input.containerName }), - ...(input.containerPort !== undefined && { containerPort: input.containerPort }), - ...(input.port !== undefined && { port: input.port }), - ...(input.registryArn !== undefined && { registryArn: input.registryArn }), + ...(input.containerName !== undefined && input.containerName !== null && { containerName: input.containerName }), + ...(input.containerPort !== undefined && input.containerPort !== null && { containerPort: input.containerPort }), + ...(input.port !== undefined && input.port !== null && { port: input.port }), + ...(input.registryArn !== undefined && input.registryArn !== null && { registryArn: input.registryArn }), }; }; const serializeAws_json1_1StartTaskRequest = (input: StartTaskRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containerInstances !== undefined && { - containerInstances: serializeAws_json1_1StringList(input.containerInstances, context), - }), - ...(input.enableECSManagedTags !== undefined && { enableECSManagedTags: input.enableECSManagedTags }), - ...(input.group !== undefined && { group: input.group }), - ...(input.networkConfiguration !== undefined && { - networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), - }), - ...(input.overrides !== undefined && { overrides: serializeAws_json1_1TaskOverride(input.overrides, context) }), - ...(input.propagateTags !== undefined && { propagateTags: input.propagateTags }), - ...(input.referenceId !== undefined && { referenceId: input.referenceId }), - ...(input.startedBy !== undefined && { startedBy: input.startedBy }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), - ...(input.taskDefinition !== undefined && { taskDefinition: input.taskDefinition }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containerInstances !== undefined && + input.containerInstances !== null && { + containerInstances: serializeAws_json1_1StringList(input.containerInstances, context), + }), + ...(input.enableECSManagedTags !== undefined && + input.enableECSManagedTags !== null && { enableECSManagedTags: input.enableECSManagedTags }), + ...(input.group !== undefined && input.group !== null && { group: input.group }), + ...(input.networkConfiguration !== undefined && + input.networkConfiguration !== null && { + networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), + }), + ...(input.overrides !== undefined && + input.overrides !== null && { overrides: serializeAws_json1_1TaskOverride(input.overrides, context) }), + ...(input.propagateTags !== undefined && input.propagateTags !== null && { propagateTags: input.propagateTags }), + ...(input.referenceId !== undefined && input.referenceId !== null && { referenceId: input.referenceId }), + ...(input.startedBy !== undefined && input.startedBy !== null && { startedBy: input.startedBy }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.taskDefinition !== undefined && + input.taskDefinition !== null && { taskDefinition: input.taskDefinition }), }; }; const serializeAws_json1_1StopTaskRequest = (input: StopTaskRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.reason !== undefined && { reason: input.reason }), - ...(input.task !== undefined && { task: input.task }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), + ...(input.task !== undefined && input.task !== null && { task: input.task }), }; }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StringMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1SubmitAttachmentStateChangesRequest = ( @@ -6760,10 +7083,11 @@ const serializeAws_json1_1SubmitAttachmentStateChangesRequest = ( context: __SerdeContext ): any => { return { - ...(input.attachments !== undefined && { - attachments: serializeAws_json1_1AttachmentStateChanges(input.attachments, context), - }), - ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.attachments !== undefined && + input.attachments !== null && { + attachments: serializeAws_json1_1AttachmentStateChanges(input.attachments, context), + }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), }; }; @@ -6772,16 +7096,17 @@ const serializeAws_json1_1SubmitContainerStateChangeRequest = ( context: __SerdeContext ): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containerName !== undefined && { containerName: input.containerName }), - ...(input.exitCode !== undefined && { exitCode: input.exitCode }), - ...(input.networkBindings !== undefined && { - networkBindings: serializeAws_json1_1NetworkBindings(input.networkBindings, context), - }), - ...(input.reason !== undefined && { reason: input.reason }), - ...(input.runtimeId !== undefined && { runtimeId: input.runtimeId }), - ...(input.status !== undefined && { status: input.status }), - ...(input.task !== undefined && { task: input.task }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containerName !== undefined && input.containerName !== null && { containerName: input.containerName }), + ...(input.exitCode !== undefined && input.exitCode !== null && { exitCode: input.exitCode }), + ...(input.networkBindings !== undefined && + input.networkBindings !== null && { + networkBindings: serializeAws_json1_1NetworkBindings(input.networkBindings, context), + }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), + ...(input.runtimeId !== undefined && input.runtimeId !== null && { runtimeId: input.runtimeId }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.task !== undefined && input.task !== null && { task: input.task }), }; }; @@ -6790,62 +7115,95 @@ const serializeAws_json1_1SubmitTaskStateChangeRequest = ( context: __SerdeContext ): any => { return { - ...(input.attachments !== undefined && { - attachments: serializeAws_json1_1AttachmentStateChanges(input.attachments, context), - }), - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containers !== undefined && { - containers: serializeAws_json1_1ContainerStateChanges(input.containers, context), - }), - ...(input.executionStoppedAt !== undefined && { - executionStoppedAt: Math.round(input.executionStoppedAt.getTime() / 1000), - }), - ...(input.pullStartedAt !== undefined && { pullStartedAt: Math.round(input.pullStartedAt.getTime() / 1000) }), - ...(input.pullStoppedAt !== undefined && { pullStoppedAt: Math.round(input.pullStoppedAt.getTime() / 1000) }), - ...(input.reason !== undefined && { reason: input.reason }), - ...(input.status !== undefined && { status: input.status }), - ...(input.task !== undefined && { task: input.task }), + ...(input.attachments !== undefined && + input.attachments !== null && { + attachments: serializeAws_json1_1AttachmentStateChanges(input.attachments, context), + }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containers !== undefined && + input.containers !== null && { + containers: serializeAws_json1_1ContainerStateChanges(input.containers, context), + }), + ...(input.executionStoppedAt !== undefined && + input.executionStoppedAt !== null && { + executionStoppedAt: Math.round(input.executionStoppedAt.getTime() / 1000), + }), + ...(input.pullStartedAt !== undefined && + input.pullStartedAt !== null && { pullStartedAt: Math.round(input.pullStartedAt.getTime() / 1000) }), + ...(input.pullStoppedAt !== undefined && + input.pullStoppedAt !== null && { pullStoppedAt: Math.round(input.pullStoppedAt.getTime() / 1000) }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.task !== undefined && input.task !== null && { task: input.task }), }; }; const serializeAws_json1_1SystemControl = (input: SystemControl, context: __SerdeContext): any => { return { - ...(input.namespace !== undefined && { namespace: input.namespace }), - ...(input.value !== undefined && { value: input.value }), + ...(input.namespace !== undefined && input.namespace !== null && { namespace: input.namespace }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1SystemControls = (input: SystemControl[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SystemControl(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SystemControl(entry, context); + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), }; }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TaskDefinitionFieldList = ( input: (TaskDefinitionField | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TaskDefinitionPlacementConstraint = ( @@ -6853,8 +7211,8 @@ const serializeAws_json1_1TaskDefinitionPlacementConstraint = ( context: __SerdeContext ): any => { return { - ...(input.expression !== undefined && { expression: input.expression }), - ...(input.type !== undefined && { type: input.type }), + ...(input.expression !== undefined && input.expression !== null && { expression: input.expression }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -6862,65 +7220,103 @@ const serializeAws_json1_1TaskDefinitionPlacementConstraints = ( input: TaskDefinitionPlacementConstraint[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1TaskDefinitionPlacementConstraint(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TaskDefinitionPlacementConstraint(entry, context); + }); }; const serializeAws_json1_1TaskFieldList = (input: (TaskField | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TaskOverride = (input: TaskOverride, context: __SerdeContext): any => { return { - ...(input.containerOverrides !== undefined && { - containerOverrides: serializeAws_json1_1ContainerOverrides(input.containerOverrides, context), - }), - ...(input.cpu !== undefined && { cpu: input.cpu }), - ...(input.executionRoleArn !== undefined && { executionRoleArn: input.executionRoleArn }), - ...(input.inferenceAcceleratorOverrides !== undefined && { - inferenceAcceleratorOverrides: serializeAws_json1_1InferenceAcceleratorOverrides( - input.inferenceAcceleratorOverrides, - context - ), - }), - ...(input.memory !== undefined && { memory: input.memory }), - ...(input.taskRoleArn !== undefined && { taskRoleArn: input.taskRoleArn }), + ...(input.containerOverrides !== undefined && + input.containerOverrides !== null && { + containerOverrides: serializeAws_json1_1ContainerOverrides(input.containerOverrides, context), + }), + ...(input.cpu !== undefined && input.cpu !== null && { cpu: input.cpu }), + ...(input.executionRoleArn !== undefined && + input.executionRoleArn !== null && { executionRoleArn: input.executionRoleArn }), + ...(input.inferenceAcceleratorOverrides !== undefined && + input.inferenceAcceleratorOverrides !== null && { + inferenceAcceleratorOverrides: serializeAws_json1_1InferenceAcceleratorOverrides( + input.inferenceAcceleratorOverrides, + context + ), + }), + ...(input.memory !== undefined && input.memory !== null && { memory: input.memory }), + ...(input.taskRoleArn !== undefined && input.taskRoleArn !== null && { taskRoleArn: input.taskRoleArn }), }; }; const serializeAws_json1_1TaskSetFieldList = (input: (TaskSetField | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tmpfs = (input: Tmpfs, context: __SerdeContext): any => { return { - ...(input.containerPath !== undefined && { containerPath: input.containerPath }), - ...(input.mountOptions !== undefined && { - mountOptions: serializeAws_json1_1StringList(input.mountOptions, context), - }), - ...(input.size !== undefined && { size: input.size }), + ...(input.containerPath !== undefined && input.containerPath !== null && { containerPath: input.containerPath }), + ...(input.mountOptions !== undefined && + input.mountOptions !== null && { mountOptions: serializeAws_json1_1StringList(input.mountOptions, context) }), + ...(input.size !== undefined && input.size !== null && { size: input.size }), }; }; const serializeAws_json1_1TmpfsList = (input: Tmpfs[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tmpfs(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tmpfs(entry, context); + }); }; const serializeAws_json1_1Ulimit = (input: Ulimit, context: __SerdeContext): any => { return { - ...(input.hardLimit !== undefined && { hardLimit: input.hardLimit }), - ...(input.name !== undefined && { name: input.name }), - ...(input.softLimit !== undefined && { softLimit: input.softLimit }), + ...(input.hardLimit !== undefined && input.hardLimit !== null && { hardLimit: input.hardLimit }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.softLimit !== undefined && input.softLimit !== null && { softLimit: input.softLimit }), }; }; const serializeAws_json1_1UlimitList = (input: Ulimit[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Ulimit(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Ulimit(entry, context); + }); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1TagKeys(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1TagKeys(input.tagKeys, context) }), }; }; @@ -6929,13 +7325,14 @@ const serializeAws_json1_1UpdateCapacityProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.autoScalingGroupProvider !== undefined && { - autoScalingGroupProvider: serializeAws_json1_1AutoScalingGroupProviderUpdate( - input.autoScalingGroupProvider, - context - ), - }), - ...(input.name !== undefined && { name: input.name }), + ...(input.autoScalingGroupProvider !== undefined && + input.autoScalingGroupProvider !== null && { + autoScalingGroupProvider: serializeAws_json1_1AutoScalingGroupProviderUpdate( + input.autoScalingGroupProvider, + context + ), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -6944,8 +7341,9 @@ const serializeAws_json1_1UpdateClusterSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.settings !== undefined && { settings: serializeAws_json1_1ClusterSettings(input.settings, context) }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.settings !== undefined && + input.settings !== null && { settings: serializeAws_json1_1ClusterSettings(input.settings, context) }), }; }; @@ -6954,8 +7352,9 @@ const serializeAws_json1_1UpdateContainerAgentRequest = ( context: __SerdeContext ): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containerInstance !== undefined && { containerInstance: input.containerInstance }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containerInstance !== undefined && + input.containerInstance !== null && { containerInstance: input.containerInstance }), }; }; @@ -6964,11 +7363,12 @@ const serializeAws_json1_1UpdateContainerInstancesStateRequest = ( context: __SerdeContext ): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.containerInstances !== undefined && { - containerInstances: serializeAws_json1_1StringList(input.containerInstances, context), - }), - ...(input.status !== undefined && { status: input.status }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.containerInstances !== undefined && + input.containerInstances !== null && { + containerInstances: serializeAws_json1_1StringList(input.containerInstances, context), + }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; @@ -6977,93 +7377,123 @@ const serializeAws_json1_1UpdateServicePrimaryTaskSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.primaryTaskSet !== undefined && { primaryTaskSet: input.primaryTaskSet }), - ...(input.service !== undefined && { service: input.service }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.primaryTaskSet !== undefined && + input.primaryTaskSet !== null && { primaryTaskSet: input.primaryTaskSet }), + ...(input.service !== undefined && input.service !== null && { service: input.service }), }; }; const serializeAws_json1_1UpdateServiceRequest = (input: UpdateServiceRequest, context: __SerdeContext): any => { return { - ...(input.capacityProviderStrategy !== undefined && { - capacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy(input.capacityProviderStrategy, context), - }), - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.deploymentConfiguration !== undefined && { - deploymentConfiguration: serializeAws_json1_1DeploymentConfiguration(input.deploymentConfiguration, context), - }), - ...(input.desiredCount !== undefined && { desiredCount: input.desiredCount }), - ...(input.forceNewDeployment !== undefined && { forceNewDeployment: input.forceNewDeployment }), - ...(input.healthCheckGracePeriodSeconds !== undefined && { - healthCheckGracePeriodSeconds: input.healthCheckGracePeriodSeconds, - }), - ...(input.networkConfiguration !== undefined && { - networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), - }), - ...(input.placementConstraints !== undefined && { - placementConstraints: serializeAws_json1_1PlacementConstraints(input.placementConstraints, context), - }), - ...(input.placementStrategy !== undefined && { - placementStrategy: serializeAws_json1_1PlacementStrategies(input.placementStrategy, context), - }), - ...(input.platformVersion !== undefined && { platformVersion: input.platformVersion }), - ...(input.service !== undefined && { service: input.service }), - ...(input.taskDefinition !== undefined && { taskDefinition: input.taskDefinition }), + ...(input.capacityProviderStrategy !== undefined && + input.capacityProviderStrategy !== null && { + capacityProviderStrategy: serializeAws_json1_1CapacityProviderStrategy(input.capacityProviderStrategy, context), + }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.deploymentConfiguration !== undefined && + input.deploymentConfiguration !== null && { + deploymentConfiguration: serializeAws_json1_1DeploymentConfiguration(input.deploymentConfiguration, context), + }), + ...(input.desiredCount !== undefined && input.desiredCount !== null && { desiredCount: input.desiredCount }), + ...(input.forceNewDeployment !== undefined && + input.forceNewDeployment !== null && { forceNewDeployment: input.forceNewDeployment }), + ...(input.healthCheckGracePeriodSeconds !== undefined && + input.healthCheckGracePeriodSeconds !== null && { + healthCheckGracePeriodSeconds: input.healthCheckGracePeriodSeconds, + }), + ...(input.networkConfiguration !== undefined && + input.networkConfiguration !== null && { + networkConfiguration: serializeAws_json1_1NetworkConfiguration(input.networkConfiguration, context), + }), + ...(input.placementConstraints !== undefined && + input.placementConstraints !== null && { + placementConstraints: serializeAws_json1_1PlacementConstraints(input.placementConstraints, context), + }), + ...(input.placementStrategy !== undefined && + input.placementStrategy !== null && { + placementStrategy: serializeAws_json1_1PlacementStrategies(input.placementStrategy, context), + }), + ...(input.platformVersion !== undefined && + input.platformVersion !== null && { platformVersion: input.platformVersion }), + ...(input.service !== undefined && input.service !== null && { service: input.service }), + ...(input.taskDefinition !== undefined && + input.taskDefinition !== null && { taskDefinition: input.taskDefinition }), }; }; const serializeAws_json1_1UpdateTaskSetRequest = (input: UpdateTaskSetRequest, context: __SerdeContext): any => { return { - ...(input.cluster !== undefined && { cluster: input.cluster }), - ...(input.scale !== undefined && { scale: serializeAws_json1_1Scale(input.scale, context) }), - ...(input.service !== undefined && { service: input.service }), - ...(input.taskSet !== undefined && { taskSet: input.taskSet }), + ...(input.cluster !== undefined && input.cluster !== null && { cluster: input.cluster }), + ...(input.scale !== undefined && + input.scale !== null && { scale: serializeAws_json1_1Scale(input.scale, context) }), + ...(input.service !== undefined && input.service !== null && { service: input.service }), + ...(input.taskSet !== undefined && input.taskSet !== null && { taskSet: input.taskSet }), }; }; const serializeAws_json1_1VersionInfo = (input: VersionInfo, context: __SerdeContext): any => { return { - ...(input.agentHash !== undefined && { agentHash: input.agentHash }), - ...(input.agentVersion !== undefined && { agentVersion: input.agentVersion }), - ...(input.dockerVersion !== undefined && { dockerVersion: input.dockerVersion }), + ...(input.agentHash !== undefined && input.agentHash !== null && { agentHash: input.agentHash }), + ...(input.agentVersion !== undefined && input.agentVersion !== null && { agentVersion: input.agentVersion }), + ...(input.dockerVersion !== undefined && input.dockerVersion !== null && { dockerVersion: input.dockerVersion }), }; }; const serializeAws_json1_1Volume = (input: Volume, context: __SerdeContext): any => { return { - ...(input.dockerVolumeConfiguration !== undefined && { - dockerVolumeConfiguration: serializeAws_json1_1DockerVolumeConfiguration( - input.dockerVolumeConfiguration, - context - ), - }), - ...(input.efsVolumeConfiguration !== undefined && { - efsVolumeConfiguration: serializeAws_json1_1EFSVolumeConfiguration(input.efsVolumeConfiguration, context), - }), - ...(input.fsxWindowsFileServerVolumeConfiguration !== undefined && { - fsxWindowsFileServerVolumeConfiguration: serializeAws_json1_1FSxWindowsFileServerVolumeConfiguration( - input.fsxWindowsFileServerVolumeConfiguration, - context - ), - }), - ...(input.host !== undefined && { host: serializeAws_json1_1HostVolumeProperties(input.host, context) }), - ...(input.name !== undefined && { name: input.name }), + ...(input.dockerVolumeConfiguration !== undefined && + input.dockerVolumeConfiguration !== null && { + dockerVolumeConfiguration: serializeAws_json1_1DockerVolumeConfiguration( + input.dockerVolumeConfiguration, + context + ), + }), + ...(input.efsVolumeConfiguration !== undefined && + input.efsVolumeConfiguration !== null && { + efsVolumeConfiguration: serializeAws_json1_1EFSVolumeConfiguration(input.efsVolumeConfiguration, context), + }), + ...(input.fsxWindowsFileServerVolumeConfiguration !== undefined && + input.fsxWindowsFileServerVolumeConfiguration !== null && { + fsxWindowsFileServerVolumeConfiguration: serializeAws_json1_1FSxWindowsFileServerVolumeConfiguration( + input.fsxWindowsFileServerVolumeConfiguration, + context + ), + }), + ...(input.host !== undefined && + input.host !== null && { host: serializeAws_json1_1HostVolumeProperties(input.host, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1VolumeFrom = (input: VolumeFrom, context: __SerdeContext): any => { return { - ...(input.readOnly !== undefined && { readOnly: input.readOnly }), - ...(input.sourceContainer !== undefined && { sourceContainer: input.sourceContainer }), + ...(input.readOnly !== undefined && input.readOnly !== null && { readOnly: input.readOnly }), + ...(input.sourceContainer !== undefined && + input.sourceContainer !== null && { sourceContainer: input.sourceContainer }), }; }; const serializeAws_json1_1VolumeFromList = (input: VolumeFrom[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1VolumeFrom(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1VolumeFrom(entry, context); + }); }; const serializeAws_json1_1VolumeList = (input: Volume[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Volume(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Volume(entry, context); + }); }; const deserializeAws_json1_1AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => { @@ -7085,11 +7515,25 @@ const deserializeAws_json1_1Attachment = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1AttachmentDetails = (output: any, context: __SerdeContext): KeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyValuePair(entry, context); + }); }; const deserializeAws_json1_1Attachments = (output: any, context: __SerdeContext): Attachment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Attachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Attachment(entry, context); + }); }; const deserializeAws_json1_1Attribute = (output: any, context: __SerdeContext): Attribute => { @@ -7111,7 +7555,14 @@ const deserializeAws_json1_1AttributeLimitExceededException = ( }; const deserializeAws_json1_1Attributes = (output: any, context: __SerdeContext): Attribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Attribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Attribute(entry, context); + }); }; const deserializeAws_json1_1AutoScalingGroupProvider = ( @@ -7178,14 +7629,28 @@ const deserializeAws_json1_1CapacityProvider = (output: any, context: __SerdeCon }; const deserializeAws_json1_1CapacityProviders = (output: any, context: __SerdeContext): CapacityProvider[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CapacityProvider(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CapacityProvider(entry, context); + }); }; const deserializeAws_json1_1CapacityProviderStrategy = ( output: any, context: __SerdeContext ): CapacityProviderStrategyItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CapacityProviderStrategyItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CapacityProviderStrategyItem(entry, context); + }); }; const deserializeAws_json1_1CapacityProviderStrategyItem = ( @@ -7293,7 +7758,14 @@ const deserializeAws_json1_1ClusterNotFoundException = ( }; const deserializeAws_json1_1Clusters = (output: any, context: __SerdeContext): Cluster[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Cluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Cluster(entry, context); + }); }; const deserializeAws_json1_1ClusterSetting = (output: any, context: __SerdeContext): ClusterSetting => { @@ -7304,11 +7776,25 @@ const deserializeAws_json1_1ClusterSetting = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ClusterSettings = (output: any, context: __SerdeContext): ClusterSetting[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ClusterSetting(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ClusterSetting(entry, context); + }); }; const deserializeAws_json1_1CompatibilityList = (output: any, context: __SerdeContext): (Compatibility | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Container = (output: any, context: __SerdeContext): Container => { @@ -7469,11 +7955,25 @@ const deserializeAws_json1_1ContainerDefinition = (output: any, context: __Serde }; const deserializeAws_json1_1ContainerDefinitions = (output: any, context: __SerdeContext): ContainerDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerDefinition(entry, context); + }); }; const deserializeAws_json1_1ContainerDependencies = (output: any, context: __SerdeContext): ContainerDependency[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerDependency(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerDependency(entry, context); + }); }; const deserializeAws_json1_1ContainerDependency = (output: any, context: __SerdeContext): ContainerDependency => { @@ -7543,7 +8043,14 @@ const deserializeAws_json1_1ContainerInstance = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ContainerInstances = (output: any, context: __SerdeContext): ContainerInstance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerInstance(entry, context); + }); }; const deserializeAws_json1_1ContainerOverride = (output: any, context: __SerdeContext): ContainerOverride => { @@ -7575,11 +8082,25 @@ const deserializeAws_json1_1ContainerOverride = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ContainerOverrides = (output: any, context: __SerdeContext): ContainerOverride[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerOverride(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerOverride(entry, context); + }); }; const deserializeAws_json1_1Containers = (output: any, context: __SerdeContext): Container[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Container(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Container(entry, context); + }); }; const deserializeAws_json1_1CreateCapacityProviderResponse = ( @@ -7756,7 +8277,14 @@ const deserializeAws_json1_1DeploymentController = (output: any, context: __Serd }; const deserializeAws_json1_1Deployments = (output: any, context: __SerdeContext): Deployment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Deployment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Deployment(entry, context); + }); }; const deserializeAws_json1_1DeregisterContainerInstanceResponse = ( @@ -7907,11 +8435,25 @@ const deserializeAws_json1_1DeviceCgroupPermissions = ( output: any, context: __SerdeContext ): (DeviceCgroupPermission | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DevicesList = (output: any, context: __SerdeContext): Device[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Device(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Device(entry, context); + }); }; const deserializeAws_json1_1DiscoverPollEndpointResponse = ( @@ -7928,13 +8470,15 @@ const deserializeAws_json1_1DiscoverPollEndpointResponse = ( }; const deserializeAws_json1_1DockerLabelsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1DockerVolumeConfiguration = ( @@ -7993,11 +8537,25 @@ const deserializeAws_json1_1EnvironmentFile = (output: any, context: __SerdeCont }; const deserializeAws_json1_1EnvironmentFiles = (output: any, context: __SerdeContext): EnvironmentFile[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EnvironmentFile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EnvironmentFile(entry, context); + }); }; const deserializeAws_json1_1EnvironmentVariables = (output: any, context: __SerdeContext): KeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyValuePair(entry, context); + }); }; const deserializeAws_json1_1Failure = (output: any, context: __SerdeContext): Failure => { @@ -8009,7 +8567,14 @@ const deserializeAws_json1_1Failure = (output: any, context: __SerdeContext): Fa }; const deserializeAws_json1_1Failures = (output: any, context: __SerdeContext): Failure[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Failure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Failure(entry, context); + }); }; const deserializeAws_json1_1FirelensConfiguration = (output: any, context: __SerdeContext): FirelensConfiguration => { @@ -8026,13 +8591,15 @@ const deserializeAws_json1_1FirelensConfigurationOptionsMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1FSxWindowsFileServerAuthorizationConfig = ( @@ -8064,7 +8631,14 @@ const deserializeAws_json1_1FSxWindowsFileServerVolumeConfiguration = ( }; const deserializeAws_json1_1GpuIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1HealthCheck = (output: any, context: __SerdeContext): HealthCheck => { @@ -8088,7 +8662,14 @@ const deserializeAws_json1_1HostEntry = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1HostEntryList = (output: any, context: __SerdeContext): HostEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HostEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HostEntry(entry, context); + }); }; const deserializeAws_json1_1HostVolumeProperties = (output: any, context: __SerdeContext): HostVolumeProperties => { @@ -8118,11 +8699,25 @@ const deserializeAws_json1_1InferenceAcceleratorOverrides = ( output: any, context: __SerdeContext ): InferenceAcceleratorOverride[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InferenceAcceleratorOverride(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InferenceAcceleratorOverride(entry, context); + }); }; const deserializeAws_json1_1InferenceAccelerators = (output: any, context: __SerdeContext): InferenceAccelerator[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InferenceAccelerator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InferenceAccelerator(entry, context); + }); }; const deserializeAws_json1_1InvalidParameterException = ( @@ -8301,7 +8896,14 @@ const deserializeAws_json1_1LoadBalancer = (output: any, context: __SerdeContext }; const deserializeAws_json1_1LoadBalancers = (output: any, context: __SerdeContext): LoadBalancer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LoadBalancer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoadBalancer(entry, context); + }); }; const deserializeAws_json1_1LogConfiguration = (output: any, context: __SerdeContext): LogConfiguration => { @@ -8322,13 +8924,15 @@ const deserializeAws_json1_1LogConfigurationOptionsMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ManagedScaling = (output: any, context: __SerdeContext): ManagedScaling => { @@ -8370,7 +8974,14 @@ const deserializeAws_json1_1MountPoint = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1MountPointList = (output: any, context: __SerdeContext): MountPoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MountPoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MountPoint(entry, context); + }); }; const deserializeAws_json1_1NetworkBinding = (output: any, context: __SerdeContext): NetworkBinding => { @@ -8384,7 +8995,14 @@ const deserializeAws_json1_1NetworkBinding = (output: any, context: __SerdeConte }; const deserializeAws_json1_1NetworkBindings = (output: any, context: __SerdeContext): NetworkBinding[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NetworkBinding(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NetworkBinding(entry, context); + }); }; const deserializeAws_json1_1NetworkConfiguration = (output: any, context: __SerdeContext): NetworkConfiguration => { @@ -8408,7 +9026,14 @@ const deserializeAws_json1_1NetworkInterface = (output: any, context: __SerdeCon }; const deserializeAws_json1_1NetworkInterfaces = (output: any, context: __SerdeContext): NetworkInterface[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NetworkInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NetworkInterface(entry, context); + }); }; const deserializeAws_json1_1NoUpdateAvailableException = ( @@ -8428,11 +9053,25 @@ const deserializeAws_json1_1PlacementConstraint = (output: any, context: __Serde }; const deserializeAws_json1_1PlacementConstraints = (output: any, context: __SerdeContext): PlacementConstraint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PlacementConstraint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PlacementConstraint(entry, context); + }); }; const deserializeAws_json1_1PlacementStrategies = (output: any, context: __SerdeContext): PlacementStrategy[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PlacementStrategy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PlacementStrategy(entry, context); + }); }; const deserializeAws_json1_1PlacementStrategy = (output: any, context: __SerdeContext): PlacementStrategy => { @@ -8470,7 +9109,14 @@ const deserializeAws_json1_1PortMapping = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1PortMappingList = (output: any, context: __SerdeContext): PortMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PortMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PortMapping(entry, context); + }); }; const deserializeAws_json1_1ProxyConfiguration = (output: any, context: __SerdeContext): ProxyConfiguration => { @@ -8486,7 +9132,14 @@ const deserializeAws_json1_1ProxyConfiguration = (output: any, context: __SerdeC }; const deserializeAws_json1_1ProxyConfigurationProperties = (output: any, context: __SerdeContext): KeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyValuePair(entry, context); + }); }; const deserializeAws_json1_1PutAccountSettingDefaultResponse = ( @@ -8570,7 +9223,14 @@ const deserializeAws_json1_1RepositoryCredentials = (output: any, context: __Ser }; const deserializeAws_json1_1RequiresAttributes = (output: any, context: __SerdeContext): Attribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Attribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Attribute(entry, context); + }); }; const deserializeAws_json1_1Resource = (output: any, context: __SerdeContext): Resource => { @@ -8610,11 +9270,25 @@ const deserializeAws_json1_1ResourceRequirement = (output: any, context: __Serde }; const deserializeAws_json1_1ResourceRequirements = (output: any, context: __SerdeContext): ResourceRequirement[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceRequirement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceRequirement(entry, context); + }); }; const deserializeAws_json1_1Resources = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Resource(entry, context); + }); }; const deserializeAws_json1_1RunTaskResponse = (output: any, context: __SerdeContext): RunTaskResponse => { @@ -8645,7 +9319,14 @@ const deserializeAws_json1_1Secret = (output: any, context: __SerdeContext): Sec }; const deserializeAws_json1_1SecretList = (output: any, context: __SerdeContext): Secret[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Secret(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Secret(entry, context); + }); }; const deserializeAws_json1_1ServerException = (output: any, context: __SerdeContext): ServerException => { @@ -8749,7 +9430,14 @@ const deserializeAws_json1_1ServiceEvent = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ServiceEvents = (output: any, context: __SerdeContext): ServiceEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServiceEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServiceEvent(entry, context); + }); }; const deserializeAws_json1_1ServiceNotActiveException = ( @@ -8771,7 +9459,14 @@ const deserializeAws_json1_1ServiceNotFoundException = ( }; const deserializeAws_json1_1ServiceRegistries = (output: any, context: __SerdeContext): ServiceRegistry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServiceRegistry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServiceRegistry(entry, context); + }); }; const deserializeAws_json1_1ServiceRegistry = (output: any, context: __SerdeContext): ServiceRegistry => { @@ -8786,7 +9481,14 @@ const deserializeAws_json1_1ServiceRegistry = (output: any, context: __SerdeCont }; const deserializeAws_json1_1Services = (output: any, context: __SerdeContext): Service[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Service(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Service(entry, context); + }); }; const deserializeAws_json1_1Setting = (output: any, context: __SerdeContext): Setting => { @@ -8798,7 +9500,14 @@ const deserializeAws_json1_1Setting = (output: any, context: __SerdeContext): Se }; const deserializeAws_json1_1Settings = (output: any, context: __SerdeContext): Setting[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Setting(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Setting(entry, context); + }); }; const deserializeAws_json1_1StartTaskResponse = (output: any, context: __SerdeContext): StartTaskResponse => { @@ -8815,7 +9524,14 @@ const deserializeAws_json1_1StartTaskResponse = (output: any, context: __SerdeCo }; const deserializeAws_json1_1Statistics = (output: any, context: __SerdeContext): KeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyValuePair(entry, context); + }); }; const deserializeAws_json1_1StopTaskResponse = (output: any, context: __SerdeContext): StopTaskResponse => { @@ -8826,17 +9542,26 @@ const deserializeAws_json1_1StopTaskResponse = (output: any, context: __SerdeCon }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1StringMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1SubmitAttachmentStateChangesResponse = ( @@ -8877,7 +9602,14 @@ const deserializeAws_json1_1SystemControl = (output: any, context: __SerdeContex }; const deserializeAws_json1_1SystemControls = (output: any, context: __SerdeContext): SystemControl[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SystemControl(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SystemControl(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -8892,7 +9624,14 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TargetNotFoundException = ( @@ -9061,7 +9800,14 @@ const deserializeAws_json1_1TaskDefinitionPlacementConstraints = ( output: any, context: __SerdeContext ): TaskDefinitionPlacementConstraint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TaskDefinitionPlacementConstraint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TaskDefinitionPlacementConstraint(entry, context); + }); }; const deserializeAws_json1_1TaskOverride = (output: any, context: __SerdeContext): TaskOverride => { @@ -9083,7 +9829,14 @@ const deserializeAws_json1_1TaskOverride = (output: any, context: __SerdeContext }; const deserializeAws_json1_1Tasks = (output: any, context: __SerdeContext): Task[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Task(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Task(entry, context); + }); }; const deserializeAws_json1_1TaskSet = (output: any, context: __SerdeContext): TaskSet => { @@ -9155,7 +9908,14 @@ const deserializeAws_json1_1TaskSetNotFoundException = ( }; const deserializeAws_json1_1TaskSets = (output: any, context: __SerdeContext): TaskSet[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TaskSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TaskSet(entry, context); + }); }; const deserializeAws_json1_1Tmpfs = (output: any, context: __SerdeContext): Tmpfs => { @@ -9171,7 +9931,14 @@ const deserializeAws_json1_1Tmpfs = (output: any, context: __SerdeContext): Tmpf }; const deserializeAws_json1_1TmpfsList = (output: any, context: __SerdeContext): Tmpfs[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tmpfs(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tmpfs(entry, context); + }); }; const deserializeAws_json1_1Ulimit = (output: any, context: __SerdeContext): Ulimit => { @@ -9183,7 +9950,14 @@ const deserializeAws_json1_1Ulimit = (output: any, context: __SerdeContext): Uli }; const deserializeAws_json1_1UlimitList = (output: any, context: __SerdeContext): Ulimit[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Ulimit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Ulimit(entry, context); + }); }; const deserializeAws_json1_1UnsupportedFeatureException = ( @@ -9334,11 +10108,25 @@ const deserializeAws_json1_1VolumeFrom = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1VolumeFromList = (output: any, context: __SerdeContext): VolumeFrom[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VolumeFrom(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VolumeFrom(entry, context); + }); }; const deserializeAws_json1_1VolumeList = (output: any, context: __SerdeContext): Volume[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Volume(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Volume(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -9391,3 +10179,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-efs/protocols/Aws_restJson1.ts b/clients/client-efs/protocols/Aws_restJson1.ts index 916647625d7c..2d9fa8e71e7c 100644 --- a/clients/client-efs/protocols/Aws_restJson1.ts +++ b/clients/client-efs/protocols/Aws_restJson1.ts @@ -116,18 +116,20 @@ export const serializeAws_restJson1CreateAccessPointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/access-points"; let body: any; body = JSON.stringify({ ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), - ...(input.PosixUser !== undefined && { PosixUser: serializeAws_restJson1PosixUser(input.PosixUser, context) }), - ...(input.RootDirectory !== undefined && { - RootDirectory: serializeAws_restJson1RootDirectory(input.RootDirectory, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), + ...(input.PosixUser !== undefined && + input.PosixUser !== null && { PosixUser: serializeAws_restJson1PosixUser(input.PosixUser, context) }), + ...(input.RootDirectory !== undefined && + input.RootDirectory !== null && { + RootDirectory: serializeAws_restJson1RootDirectory(input.RootDirectory, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -146,20 +148,23 @@ export const serializeAws_restJson1CreateFileSystemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/file-systems"; let body: any; body = JSON.stringify({ CreationToken: input.CreationToken ?? generateIdempotencyToken(), - ...(input.Encrypted !== undefined && { Encrypted: input.Encrypted }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.PerformanceMode !== undefined && { PerformanceMode: input.PerformanceMode }), - ...(input.ProvisionedThroughputInMibps !== undefined && { - ProvisionedThroughputInMibps: input.ProvisionedThroughputInMibps, - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.ThroughputMode !== undefined && { ThroughputMode: input.ThroughputMode }), + ...(input.Encrypted !== undefined && input.Encrypted !== null && { Encrypted: input.Encrypted }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.PerformanceMode !== undefined && + input.PerformanceMode !== null && { PerformanceMode: input.PerformanceMode }), + ...(input.ProvisionedThroughputInMibps !== undefined && + input.ProvisionedThroughputInMibps !== null && { + ProvisionedThroughputInMibps: input.ProvisionedThroughputInMibps, + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.ThroughputMode !== undefined && + input.ThroughputMode !== null && { ThroughputMode: input.ThroughputMode }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -178,17 +183,18 @@ export const serializeAws_restJson1CreateMountTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/mount-targets"; let body: any; body = JSON.stringify({ - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), - ...(input.IpAddress !== undefined && { IpAddress: input.IpAddress }), - ...(input.SecurityGroups !== undefined && { - SecurityGroups: serializeAws_restJson1SecurityGroups(input.SecurityGroups, context), - }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), + ...(input.IpAddress !== undefined && input.IpAddress !== null && { IpAddress: input.IpAddress }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + SecurityGroups: serializeAws_restJson1SecurityGroups(input.SecurityGroups, context), + }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -207,7 +213,7 @@ export const serializeAws_restJson1CreateTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/create-tags/{FileSystemId}"; if (input.FileSystemId !== undefined) { @@ -221,7 +227,7 @@ export const serializeAws_restJson1CreateTagsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -239,9 +245,7 @@ export const serializeAws_restJson1DeleteAccessPointCommand = async ( input: DeleteAccessPointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/access-points/{AccessPointId}"; if (input.AccessPointId !== undefined) { const labelValue: string = input.AccessPointId; @@ -269,9 +273,7 @@ export const serializeAws_restJson1DeleteFileSystemCommand = async ( input: DeleteFileSystemCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/file-systems/{FileSystemId}"; if (input.FileSystemId !== undefined) { const labelValue: string = input.FileSystemId; @@ -299,9 +301,7 @@ export const serializeAws_restJson1DeleteFileSystemPolicyCommand = async ( input: DeleteFileSystemPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/file-systems/{FileSystemId}/policy"; if (input.FileSystemId !== undefined) { const labelValue: string = input.FileSystemId; @@ -329,9 +329,7 @@ export const serializeAws_restJson1DeleteMountTargetCommand = async ( input: DeleteMountTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/mount-targets/{MountTargetId}"; if (input.MountTargetId !== undefined) { const labelValue: string = input.MountTargetId; @@ -360,7 +358,7 @@ export const serializeAws_restJson1DeleteTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/delete-tags/{FileSystemId}"; if (input.FileSystemId !== undefined) { @@ -374,7 +372,8 @@ export const serializeAws_restJson1DeleteTagsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_restJson1TagKeys(input.TagKeys, context) }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_restJson1TagKeys(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -392,9 +391,7 @@ export const serializeAws_restJson1DescribeAccessPointsCommand = async ( input: DescribeAccessPointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/access-points"; const query: any = { ...(input.AccessPointId !== undefined && { AccessPointId: input.AccessPointId }), @@ -420,9 +417,7 @@ export const serializeAws_restJson1DescribeBackupPolicyCommand = async ( input: DescribeBackupPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/file-systems/{FileSystemId}/backup-policy"; if (input.FileSystemId !== undefined) { const labelValue: string = input.FileSystemId; @@ -450,9 +445,7 @@ export const serializeAws_restJson1DescribeFileSystemPolicyCommand = async ( input: DescribeFileSystemPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/file-systems/{FileSystemId}/policy"; if (input.FileSystemId !== undefined) { const labelValue: string = input.FileSystemId; @@ -480,9 +473,7 @@ export const serializeAws_restJson1DescribeFileSystemsCommand = async ( input: DescribeFileSystemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/file-systems"; const query: any = { ...(input.CreationToken !== undefined && { CreationToken: input.CreationToken }), @@ -508,9 +499,7 @@ export const serializeAws_restJson1DescribeLifecycleConfigurationCommand = async input: DescribeLifecycleConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/file-systems/{FileSystemId}/lifecycle-configuration"; if (input.FileSystemId !== undefined) { const labelValue: string = input.FileSystemId; @@ -538,9 +527,7 @@ export const serializeAws_restJson1DescribeMountTargetsCommand = async ( input: DescribeMountTargetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/mount-targets"; const query: any = { ...(input.MountTargetId !== undefined && { MountTargetId: input.MountTargetId }), @@ -567,9 +554,7 @@ export const serializeAws_restJson1DescribeMountTargetSecurityGroupsCommand = as input: DescribeMountTargetSecurityGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/mount-targets/{MountTargetId}/security-groups"; if (input.MountTargetId !== undefined) { const labelValue: string = input.MountTargetId; @@ -597,9 +582,7 @@ export const serializeAws_restJson1DescribeTagsCommand = async ( input: DescribeTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/tags/{FileSystemId}"; if (input.FileSystemId !== undefined) { const labelValue: string = input.FileSystemId; @@ -632,9 +615,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/resource-tags/{ResourceId}"; if (input.ResourceId !== undefined) { const labelValue: string = input.ResourceId; @@ -668,7 +649,7 @@ export const serializeAws_restJson1ModifyMountTargetSecurityGroupsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/mount-targets/{MountTargetId}/security-groups"; if (input.MountTargetId !== undefined) { @@ -682,9 +663,10 @@ export const serializeAws_restJson1ModifyMountTargetSecurityGroupsCommand = asyn } let body: any; body = JSON.stringify({ - ...(input.SecurityGroups !== undefined && { - SecurityGroups: serializeAws_restJson1SecurityGroups(input.SecurityGroups, context), - }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + SecurityGroups: serializeAws_restJson1SecurityGroups(input.SecurityGroups, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -703,7 +685,7 @@ export const serializeAws_restJson1PutBackupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/file-systems/{FileSystemId}/backup-policy"; if (input.FileSystemId !== undefined) { @@ -717,9 +699,8 @@ export const serializeAws_restJson1PutBackupPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BackupPolicy !== undefined && { - BackupPolicy: serializeAws_restJson1BackupPolicy(input.BackupPolicy, context), - }), + ...(input.BackupPolicy !== undefined && + input.BackupPolicy !== null && { BackupPolicy: serializeAws_restJson1BackupPolicy(input.BackupPolicy, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -738,7 +719,7 @@ export const serializeAws_restJson1PutFileSystemPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/file-systems/{FileSystemId}/policy"; if (input.FileSystemId !== undefined) { @@ -752,10 +733,11 @@ export const serializeAws_restJson1PutFileSystemPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BypassPolicyLockoutSafetyCheck !== undefined && { - BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck, - }), - ...(input.Policy !== undefined && { Policy: input.Policy }), + ...(input.BypassPolicyLockoutSafetyCheck !== undefined && + input.BypassPolicyLockoutSafetyCheck !== null && { + BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck, + }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -774,7 +756,7 @@ export const serializeAws_restJson1PutLifecycleConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/file-systems/{FileSystemId}/lifecycle-configuration"; if (input.FileSystemId !== undefined) { @@ -788,9 +770,10 @@ export const serializeAws_restJson1PutLifecycleConfigurationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.LifecyclePolicies !== undefined && { - LifecyclePolicies: serializeAws_restJson1LifecyclePolicies(input.LifecyclePolicies, context), - }), + ...(input.LifecyclePolicies !== undefined && + input.LifecyclePolicies !== null && { + LifecyclePolicies: serializeAws_restJson1LifecyclePolicies(input.LifecyclePolicies, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -809,7 +792,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/resource-tags/{ResourceId}"; if (input.ResourceId !== undefined) { @@ -823,7 +806,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -841,9 +824,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-02-01/resource-tags/{ResourceId}"; if (input.ResourceId !== undefined) { const labelValue: string = input.ResourceId; @@ -876,7 +857,7 @@ export const serializeAws_restJson1UpdateFileSystemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-02-01/file-systems/{FileSystemId}"; if (input.FileSystemId !== undefined) { @@ -890,10 +871,12 @@ export const serializeAws_restJson1UpdateFileSystemCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ProvisionedThroughputInMibps !== undefined && { - ProvisionedThroughputInMibps: input.ProvisionedThroughputInMibps, - }), - ...(input.ThroughputMode !== undefined && { ThroughputMode: input.ThroughputMode }), + ...(input.ProvisionedThroughputInMibps !== undefined && + input.ProvisionedThroughputInMibps !== null && { + ProvisionedThroughputInMibps: input.ProvisionedThroughputInMibps, + }), + ...(input.ThroughputMode !== undefined && + input.ThroughputMode !== null && { ThroughputMode: input.ThroughputMode }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3743,68 +3726,104 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1BackupPolicy = (input: BackupPolicy, context: __SerdeContext): any => { return { - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; const serializeAws_restJson1CreationInfo = (input: CreationInfo, context: __SerdeContext): any => { return { - ...(input.OwnerGid !== undefined && { OwnerGid: input.OwnerGid }), - ...(input.OwnerUid !== undefined && { OwnerUid: input.OwnerUid }), - ...(input.Permissions !== undefined && { Permissions: input.Permissions }), + ...(input.OwnerGid !== undefined && input.OwnerGid !== null && { OwnerGid: input.OwnerGid }), + ...(input.OwnerUid !== undefined && input.OwnerUid !== null && { OwnerUid: input.OwnerUid }), + ...(input.Permissions !== undefined && input.Permissions !== null && { Permissions: input.Permissions }), }; }; const serializeAws_restJson1LifecyclePolicies = (input: LifecyclePolicy[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1LifecyclePolicy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1LifecyclePolicy(entry, context); + }); }; const serializeAws_restJson1LifecyclePolicy = (input: LifecyclePolicy, context: __SerdeContext): any => { return { - ...(input.TransitionToIA !== undefined && { TransitionToIA: input.TransitionToIA }), + ...(input.TransitionToIA !== undefined && + input.TransitionToIA !== null && { TransitionToIA: input.TransitionToIA }), }; }; const serializeAws_restJson1PosixUser = (input: PosixUser, context: __SerdeContext): any => { return { - ...(input.Gid !== undefined && { Gid: input.Gid }), - ...(input.SecondaryGids !== undefined && { - SecondaryGids: serializeAws_restJson1SecondaryGids(input.SecondaryGids, context), - }), - ...(input.Uid !== undefined && { Uid: input.Uid }), + ...(input.Gid !== undefined && input.Gid !== null && { Gid: input.Gid }), + ...(input.SecondaryGids !== undefined && + input.SecondaryGids !== null && { + SecondaryGids: serializeAws_restJson1SecondaryGids(input.SecondaryGids, context), + }), + ...(input.Uid !== undefined && input.Uid !== null && { Uid: input.Uid }), }; }; const serializeAws_restJson1RootDirectory = (input: RootDirectory, context: __SerdeContext): any => { return { - ...(input.CreationInfo !== undefined && { - CreationInfo: serializeAws_restJson1CreationInfo(input.CreationInfo, context), - }), - ...(input.Path !== undefined && { Path: input.Path }), + ...(input.CreationInfo !== undefined && + input.CreationInfo !== null && { CreationInfo: serializeAws_restJson1CreationInfo(input.CreationInfo, context) }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), }; }; const serializeAws_restJson1SecondaryGids = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SecurityGroups = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1AccessPointDescription = ( @@ -3841,7 +3860,14 @@ const deserializeAws_restJson1AccessPointDescriptions = ( output: any, context: __SerdeContext ): AccessPointDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AccessPointDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AccessPointDescription(entry, context); + }); }; const deserializeAws_restJson1BackupPolicy = (output: any, context: __SerdeContext): BackupPolicy => { @@ -3902,7 +3928,14 @@ const deserializeAws_restJson1FileSystemDescriptions = ( output: any, context: __SerdeContext ): FileSystemDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FileSystemDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FileSystemDescription(entry, context); + }); }; const deserializeAws_restJson1FileSystemSize = (output: any, context: __SerdeContext): FileSystemSize => { @@ -3919,7 +3952,14 @@ const deserializeAws_restJson1FileSystemSize = (output: any, context: __SerdeCon }; const deserializeAws_restJson1LifecyclePolicies = (output: any, context: __SerdeContext): LifecyclePolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LifecyclePolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LifecyclePolicy(entry, context); + }); }; const deserializeAws_restJson1LifecyclePolicy = (output: any, context: __SerdeContext): LifecyclePolicy => { @@ -3962,7 +4002,14 @@ const deserializeAws_restJson1MountTargetDescriptions = ( output: any, context: __SerdeContext ): MountTargetDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MountTargetDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MountTargetDescription(entry, context); + }); }; const deserializeAws_restJson1PosixUser = (output: any, context: __SerdeContext): PosixUser => { @@ -3987,11 +4034,25 @@ const deserializeAws_restJson1RootDirectory = (output: any, context: __SerdeCont }; const deserializeAws_restJson1SecondaryGids = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SecurityGroups = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -4002,7 +4063,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4025,6 +4093,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-eks/protocols/Aws_restJson1.ts b/clients/client-eks/protocols/Aws_restJson1.ts index 214db0e1c68c..544cf45b884e 100644 --- a/clients/client-eks/protocols/Aws_restJson1.ts +++ b/clients/client-eks/protocols/Aws_restJson1.ts @@ -119,7 +119,7 @@ export const serializeAws_restJson1CreateAddonCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clusters/{clusterName}/addons"; if (input.clusterName !== undefined) { @@ -133,12 +133,14 @@ export const serializeAws_restJson1CreateAddonCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.addonName !== undefined && { addonName: input.addonName }), - ...(input.addonVersion !== undefined && { addonVersion: input.addonVersion }), + ...(input.addonName !== undefined && input.addonName !== null && { addonName: input.addonName }), + ...(input.addonVersion !== undefined && input.addonVersion !== null && { addonVersion: input.addonVersion }), clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.resolveConflicts !== undefined && { resolveConflicts: input.resolveConflicts }), - ...(input.serviceAccountRoleArn !== undefined && { serviceAccountRoleArn: input.serviceAccountRoleArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.resolveConflicts !== undefined && + input.resolveConflicts !== null && { resolveConflicts: input.resolveConflicts }), + ...(input.serviceAccountRoleArn !== undefined && + input.serviceAccountRoleArn !== null && { serviceAccountRoleArn: input.serviceAccountRoleArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -157,29 +159,33 @@ export const serializeAws_restJson1CreateClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clusters"; let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.encryptionConfig !== undefined && { - encryptionConfig: serializeAws_restJson1EncryptionConfigList(input.encryptionConfig, context), - }), - ...(input.kubernetesNetworkConfig !== undefined && { - kubernetesNetworkConfig: serializeAws_restJson1KubernetesNetworkConfigRequest( - input.kubernetesNetworkConfig, - context - ), - }), - ...(input.logging !== undefined && { logging: serializeAws_restJson1Logging(input.logging, context) }), - ...(input.name !== undefined && { name: input.name }), - ...(input.resourcesVpcConfig !== undefined && { - resourcesVpcConfig: serializeAws_restJson1VpcConfigRequest(input.resourcesVpcConfig, context), - }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.version !== undefined && { version: input.version }), + ...(input.encryptionConfig !== undefined && + input.encryptionConfig !== null && { + encryptionConfig: serializeAws_restJson1EncryptionConfigList(input.encryptionConfig, context), + }), + ...(input.kubernetesNetworkConfig !== undefined && + input.kubernetesNetworkConfig !== null && { + kubernetesNetworkConfig: serializeAws_restJson1KubernetesNetworkConfigRequest( + input.kubernetesNetworkConfig, + context + ), + }), + ...(input.logging !== undefined && + input.logging !== null && { logging: serializeAws_restJson1Logging(input.logging, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.resourcesVpcConfig !== undefined && + input.resourcesVpcConfig !== null && { + resourcesVpcConfig: serializeAws_restJson1VpcConfigRequest(input.resourcesVpcConfig, context), + }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -198,7 +204,7 @@ export const serializeAws_restJson1CreateFargateProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clusters/{clusterName}/fargate-profiles"; if (input.clusterName !== undefined) { @@ -213,13 +219,17 @@ export const serializeAws_restJson1CreateFargateProfileCommand = async ( let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.fargateProfileName !== undefined && { fargateProfileName: input.fargateProfileName }), - ...(input.podExecutionRoleArn !== undefined && { podExecutionRoleArn: input.podExecutionRoleArn }), - ...(input.selectors !== undefined && { - selectors: serializeAws_restJson1FargateProfileSelectors(input.selectors, context), - }), - ...(input.subnets !== undefined && { subnets: serializeAws_restJson1StringList(input.subnets, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.fargateProfileName !== undefined && + input.fargateProfileName !== null && { fargateProfileName: input.fargateProfileName }), + ...(input.podExecutionRoleArn !== undefined && + input.podExecutionRoleArn !== null && { podExecutionRoleArn: input.podExecutionRoleArn }), + ...(input.selectors !== undefined && + input.selectors !== null && { + selectors: serializeAws_restJson1FargateProfileSelectors(input.selectors, context), + }), + ...(input.subnets !== undefined && + input.subnets !== null && { subnets: serializeAws_restJson1StringList(input.subnets, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -238,7 +248,7 @@ export const serializeAws_restJson1CreateNodegroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clusters/{clusterName}/node-groups"; if (input.clusterName !== undefined) { @@ -252,29 +262,36 @@ export const serializeAws_restJson1CreateNodegroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.amiType !== undefined && { amiType: input.amiType }), - ...(input.capacityType !== undefined && { capacityType: input.capacityType }), + ...(input.amiType !== undefined && input.amiType !== null && { amiType: input.amiType }), + ...(input.capacityType !== undefined && input.capacityType !== null && { capacityType: input.capacityType }), clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.diskSize !== undefined && { diskSize: input.diskSize }), - ...(input.instanceTypes !== undefined && { - instanceTypes: serializeAws_restJson1StringList(input.instanceTypes, context), - }), - ...(input.labels !== undefined && { labels: serializeAws_restJson1labelsMap(input.labels, context) }), - ...(input.launchTemplate !== undefined && { - launchTemplate: serializeAws_restJson1LaunchTemplateSpecification(input.launchTemplate, context), - }), - ...(input.nodeRole !== undefined && { nodeRole: input.nodeRole }), - ...(input.nodegroupName !== undefined && { nodegroupName: input.nodegroupName }), - ...(input.releaseVersion !== undefined && { releaseVersion: input.releaseVersion }), - ...(input.remoteAccess !== undefined && { - remoteAccess: serializeAws_restJson1RemoteAccessConfig(input.remoteAccess, context), - }), - ...(input.scalingConfig !== undefined && { - scalingConfig: serializeAws_restJson1NodegroupScalingConfig(input.scalingConfig, context), - }), - ...(input.subnets !== undefined && { subnets: serializeAws_restJson1StringList(input.subnets, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.version !== undefined && { version: input.version }), + ...(input.diskSize !== undefined && input.diskSize !== null && { diskSize: input.diskSize }), + ...(input.instanceTypes !== undefined && + input.instanceTypes !== null && { + instanceTypes: serializeAws_restJson1StringList(input.instanceTypes, context), + }), + ...(input.labels !== undefined && + input.labels !== null && { labels: serializeAws_restJson1labelsMap(input.labels, context) }), + ...(input.launchTemplate !== undefined && + input.launchTemplate !== null && { + launchTemplate: serializeAws_restJson1LaunchTemplateSpecification(input.launchTemplate, context), + }), + ...(input.nodeRole !== undefined && input.nodeRole !== null && { nodeRole: input.nodeRole }), + ...(input.nodegroupName !== undefined && input.nodegroupName !== null && { nodegroupName: input.nodegroupName }), + ...(input.releaseVersion !== undefined && + input.releaseVersion !== null && { releaseVersion: input.releaseVersion }), + ...(input.remoteAccess !== undefined && + input.remoteAccess !== null && { + remoteAccess: serializeAws_restJson1RemoteAccessConfig(input.remoteAccess, context), + }), + ...(input.scalingConfig !== undefined && + input.scalingConfig !== null && { + scalingConfig: serializeAws_restJson1NodegroupScalingConfig(input.scalingConfig, context), + }), + ...(input.subnets !== undefined && + input.subnets !== null && { subnets: serializeAws_restJson1StringList(input.subnets, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -292,9 +309,7 @@ export const serializeAws_restJson1DeleteAddonCommand = async ( input: DeleteAddonCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{clusterName}/addons/{addonName}"; if (input.clusterName !== undefined) { const labelValue: string = input.clusterName; @@ -331,9 +346,7 @@ export const serializeAws_restJson1DeleteClusterCommand = async ( input: DeleteClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -361,9 +374,7 @@ export const serializeAws_restJson1DeleteFargateProfileCommand = async ( input: DeleteFargateProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{clusterName}/fargate-profiles/{fargateProfileName}"; if (input.clusterName !== undefined) { const labelValue: string = input.clusterName; @@ -400,9 +411,7 @@ export const serializeAws_restJson1DeleteNodegroupCommand = async ( input: DeleteNodegroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{clusterName}/node-groups/{nodegroupName}"; if (input.clusterName !== undefined) { const labelValue: string = input.clusterName; @@ -439,9 +448,7 @@ export const serializeAws_restJson1DescribeAddonCommand = async ( input: DescribeAddonCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{clusterName}/addons/{addonName}"; if (input.clusterName !== undefined) { const labelValue: string = input.clusterName; @@ -478,9 +485,7 @@ export const serializeAws_restJson1DescribeAddonVersionsCommand = async ( input: DescribeAddonVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/addons/supported-versions"; const query: any = { ...(input.kubernetesVersion !== undefined && { kubernetesVersion: input.kubernetesVersion }), @@ -506,9 +511,7 @@ export const serializeAws_restJson1DescribeClusterCommand = async ( input: DescribeClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -536,9 +539,7 @@ export const serializeAws_restJson1DescribeFargateProfileCommand = async ( input: DescribeFargateProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{clusterName}/fargate-profiles/{fargateProfileName}"; if (input.clusterName !== undefined) { const labelValue: string = input.clusterName; @@ -575,9 +576,7 @@ export const serializeAws_restJson1DescribeNodegroupCommand = async ( input: DescribeNodegroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{clusterName}/node-groups/{nodegroupName}"; if (input.clusterName !== undefined) { const labelValue: string = input.clusterName; @@ -614,9 +613,7 @@ export const serializeAws_restJson1DescribeUpdateCommand = async ( input: DescribeUpdateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{name}/updates/{updateId}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -658,9 +655,7 @@ export const serializeAws_restJson1ListAddonsCommand = async ( input: ListAddonsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{clusterName}/addons"; if (input.clusterName !== undefined) { const labelValue: string = input.clusterName; @@ -693,9 +688,7 @@ export const serializeAws_restJson1ListClustersCommand = async ( input: ListClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -719,9 +712,7 @@ export const serializeAws_restJson1ListFargateProfilesCommand = async ( input: ListFargateProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{clusterName}/fargate-profiles"; if (input.clusterName !== undefined) { const labelValue: string = input.clusterName; @@ -754,9 +745,7 @@ export const serializeAws_restJson1ListNodegroupsCommand = async ( input: ListNodegroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{clusterName}/node-groups"; if (input.clusterName !== undefined) { const labelValue: string = input.clusterName; @@ -789,9 +778,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -819,9 +806,7 @@ export const serializeAws_restJson1ListUpdatesCommand = async ( input: ListUpdatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/clusters/{name}/updates"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -857,7 +842,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -871,7 +856,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -889,9 +874,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -924,7 +907,7 @@ export const serializeAws_restJson1UpdateAddonCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clusters/{clusterName}/addons/{addonName}/update"; if (input.clusterName !== undefined) { @@ -947,10 +930,12 @@ export const serializeAws_restJson1UpdateAddonCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.addonVersion !== undefined && { addonVersion: input.addonVersion }), + ...(input.addonVersion !== undefined && input.addonVersion !== null && { addonVersion: input.addonVersion }), clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.resolveConflicts !== undefined && { resolveConflicts: input.resolveConflicts }), - ...(input.serviceAccountRoleArn !== undefined && { serviceAccountRoleArn: input.serviceAccountRoleArn }), + ...(input.resolveConflicts !== undefined && + input.resolveConflicts !== null && { resolveConflicts: input.resolveConflicts }), + ...(input.serviceAccountRoleArn !== undefined && + input.serviceAccountRoleArn !== null && { serviceAccountRoleArn: input.serviceAccountRoleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -969,7 +954,7 @@ export const serializeAws_restJson1UpdateClusterConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clusters/{name}/update-config"; if (input.name !== undefined) { @@ -984,10 +969,12 @@ export const serializeAws_restJson1UpdateClusterConfigCommand = async ( let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.logging !== undefined && { logging: serializeAws_restJson1Logging(input.logging, context) }), - ...(input.resourcesVpcConfig !== undefined && { - resourcesVpcConfig: serializeAws_restJson1VpcConfigRequest(input.resourcesVpcConfig, context), - }), + ...(input.logging !== undefined && + input.logging !== null && { logging: serializeAws_restJson1Logging(input.logging, context) }), + ...(input.resourcesVpcConfig !== undefined && + input.resourcesVpcConfig !== null && { + resourcesVpcConfig: serializeAws_restJson1VpcConfigRequest(input.resourcesVpcConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1006,7 +993,7 @@ export const serializeAws_restJson1UpdateClusterVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clusters/{name}/updates"; if (input.name !== undefined) { @@ -1021,7 +1008,7 @@ export const serializeAws_restJson1UpdateClusterVersionCommand = async ( let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.version !== undefined && { version: input.version }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1040,7 +1027,7 @@ export const serializeAws_restJson1UpdateNodegroupConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clusters/{clusterName}/node-groups/{nodegroupName}/update-config"; if (input.clusterName !== undefined) { @@ -1064,10 +1051,12 @@ export const serializeAws_restJson1UpdateNodegroupConfigCommand = async ( let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.labels !== undefined && { labels: serializeAws_restJson1UpdateLabelsPayload(input.labels, context) }), - ...(input.scalingConfig !== undefined && { - scalingConfig: serializeAws_restJson1NodegroupScalingConfig(input.scalingConfig, context), - }), + ...(input.labels !== undefined && + input.labels !== null && { labels: serializeAws_restJson1UpdateLabelsPayload(input.labels, context) }), + ...(input.scalingConfig !== undefined && + input.scalingConfig !== null && { + scalingConfig: serializeAws_restJson1NodegroupScalingConfig(input.scalingConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1086,7 +1075,7 @@ export const serializeAws_restJson1UpdateNodegroupVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/clusters/{clusterName}/node-groups/{nodegroupName}/update-version"; if (input.clusterName !== undefined) { @@ -1110,12 +1099,14 @@ export const serializeAws_restJson1UpdateNodegroupVersionCommand = async ( let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.force !== undefined && { force: input.force }), - ...(input.launchTemplate !== undefined && { - launchTemplate: serializeAws_restJson1LaunchTemplateSpecification(input.launchTemplate, context), - }), - ...(input.releaseVersion !== undefined && { releaseVersion: input.releaseVersion }), - ...(input.version !== undefined && { version: input.version }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), + ...(input.launchTemplate !== undefined && + input.launchTemplate !== null && { + launchTemplate: serializeAws_restJson1LaunchTemplateSpecification(input.launchTemplate, context), + }), + ...(input.releaseVersion !== undefined && + input.releaseVersion !== null && { releaseVersion: input.releaseVersion }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3735,29 +3726,41 @@ const deserializeAws_restJson1UnsupportedAvailabilityZoneExceptionResponse = asy const serializeAws_restJson1EncryptionConfig = (input: EncryptionConfig, context: __SerdeContext): any => { return { - ...(input.provider !== undefined && { provider: serializeAws_restJson1Provider(input.provider, context) }), - ...(input.resources !== undefined && { resources: serializeAws_restJson1StringList(input.resources, context) }), + ...(input.provider !== undefined && + input.provider !== null && { provider: serializeAws_restJson1Provider(input.provider, context) }), + ...(input.resources !== undefined && + input.resources !== null && { resources: serializeAws_restJson1StringList(input.resources, context) }), }; }; const serializeAws_restJson1EncryptionConfigList = (input: EncryptionConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1EncryptionConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1EncryptionConfig(entry, context); + }); }; const serializeAws_restJson1FargateProfileLabel = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1FargateProfileSelector = (input: FargateProfileSelector, context: __SerdeContext): any => { return { - ...(input.labels !== undefined && { labels: serializeAws_restJson1FargateProfileLabel(input.labels, context) }), - ...(input.namespace !== undefined && { namespace: input.namespace }), + ...(input.labels !== undefined && + input.labels !== null && { labels: serializeAws_restJson1FargateProfileLabel(input.labels, context) }), + ...(input.namespace !== undefined && input.namespace !== null && { namespace: input.namespace }), }; }; @@ -3765,7 +3768,14 @@ const serializeAws_restJson1FargateProfileSelectors = ( input: FargateProfileSelector[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1FargateProfileSelector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1FargateProfileSelector(entry, context); + }); }; const serializeAws_restJson1KubernetesNetworkConfigRequest = ( @@ -3773,22 +3783,32 @@ const serializeAws_restJson1KubernetesNetworkConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.serviceIpv4Cidr !== undefined && { serviceIpv4Cidr: input.serviceIpv4Cidr }), + ...(input.serviceIpv4Cidr !== undefined && + input.serviceIpv4Cidr !== null && { serviceIpv4Cidr: input.serviceIpv4Cidr }), }; }; const serializeAws_restJson1labelsKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1labelsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1LaunchTemplateSpecification = ( @@ -3796,94 +3816,127 @@ const serializeAws_restJson1LaunchTemplateSpecification = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_restJson1Logging = (input: Logging, context: __SerdeContext): any => { return { - ...(input.clusterLogging !== undefined && { - clusterLogging: serializeAws_restJson1LogSetups(input.clusterLogging, context), - }), + ...(input.clusterLogging !== undefined && + input.clusterLogging !== null && { + clusterLogging: serializeAws_restJson1LogSetups(input.clusterLogging, context), + }), }; }; const serializeAws_restJson1LogSetup = (input: LogSetup, context: __SerdeContext): any => { return { - ...(input.enabled !== undefined && { enabled: input.enabled }), - ...(input.types !== undefined && { types: serializeAws_restJson1LogTypes(input.types, context) }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), + ...(input.types !== undefined && + input.types !== null && { types: serializeAws_restJson1LogTypes(input.types, context) }), }; }; const serializeAws_restJson1LogSetups = (input: LogSetup[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1LogSetup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1LogSetup(entry, context); + }); }; const serializeAws_restJson1LogTypes = (input: (LogType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1NodegroupScalingConfig = (input: NodegroupScalingConfig, context: __SerdeContext): any => { return { - ...(input.desiredSize !== undefined && { desiredSize: input.desiredSize }), - ...(input.maxSize !== undefined && { maxSize: input.maxSize }), - ...(input.minSize !== undefined && { minSize: input.minSize }), + ...(input.desiredSize !== undefined && input.desiredSize !== null && { desiredSize: input.desiredSize }), + ...(input.maxSize !== undefined && input.maxSize !== null && { maxSize: input.maxSize }), + ...(input.minSize !== undefined && input.minSize !== null && { minSize: input.minSize }), }; }; const serializeAws_restJson1Provider = (input: Provider, context: __SerdeContext): any => { return { - ...(input.keyArn !== undefined && { keyArn: input.keyArn }), + ...(input.keyArn !== undefined && input.keyArn !== null && { keyArn: input.keyArn }), }; }; const serializeAws_restJson1RemoteAccessConfig = (input: RemoteAccessConfig, context: __SerdeContext): any => { return { - ...(input.ec2SshKey !== undefined && { ec2SshKey: input.ec2SshKey }), - ...(input.sourceSecurityGroups !== undefined && { - sourceSecurityGroups: serializeAws_restJson1StringList(input.sourceSecurityGroups, context), - }), + ...(input.ec2SshKey !== undefined && input.ec2SshKey !== null && { ec2SshKey: input.ec2SshKey }), + ...(input.sourceSecurityGroups !== undefined && + input.sourceSecurityGroups !== null && { + sourceSecurityGroups: serializeAws_restJson1StringList(input.sourceSecurityGroups, context), + }), }; }; const serializeAws_restJson1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1UpdateLabelsPayload = (input: UpdateLabelsPayload, context: __SerdeContext): any => { return { - ...(input.addOrUpdateLabels !== undefined && { - addOrUpdateLabels: serializeAws_restJson1labelsMap(input.addOrUpdateLabels, context), - }), - ...(input.removeLabels !== undefined && { - removeLabels: serializeAws_restJson1labelsKeyList(input.removeLabels, context), - }), + ...(input.addOrUpdateLabels !== undefined && + input.addOrUpdateLabels !== null && { + addOrUpdateLabels: serializeAws_restJson1labelsMap(input.addOrUpdateLabels, context), + }), + ...(input.removeLabels !== undefined && + input.removeLabels !== null && { + removeLabels: serializeAws_restJson1labelsKeyList(input.removeLabels, context), + }), }; }; const serializeAws_restJson1VpcConfigRequest = (input: VpcConfigRequest, context: __SerdeContext): any => { return { - ...(input.endpointPrivateAccess !== undefined && { endpointPrivateAccess: input.endpointPrivateAccess }), - ...(input.endpointPublicAccess !== undefined && { endpointPublicAccess: input.endpointPublicAccess }), - ...(input.publicAccessCidrs !== undefined && { - publicAccessCidrs: serializeAws_restJson1StringList(input.publicAccessCidrs, context), - }), - ...(input.securityGroupIds !== undefined && { - securityGroupIds: serializeAws_restJson1StringList(input.securityGroupIds, context), - }), - ...(input.subnetIds !== undefined && { subnetIds: serializeAws_restJson1StringList(input.subnetIds, context) }), + ...(input.endpointPrivateAccess !== undefined && + input.endpointPrivateAccess !== null && { endpointPrivateAccess: input.endpointPrivateAccess }), + ...(input.endpointPublicAccess !== undefined && + input.endpointPublicAccess !== null && { endpointPublicAccess: input.endpointPublicAccess }), + ...(input.publicAccessCidrs !== undefined && + input.publicAccessCidrs !== null && { + publicAccessCidrs: serializeAws_restJson1StringList(input.publicAccessCidrs, context), + }), + ...(input.securityGroupIds !== undefined && + input.securityGroupIds !== null && { + securityGroupIds: serializeAws_restJson1StringList(input.securityGroupIds, context), + }), + ...(input.subnetIds !== undefined && + input.subnetIds !== null && { subnetIds: serializeAws_restJson1StringList(input.subnetIds, context) }), }; }; @@ -3949,11 +4002,25 @@ const deserializeAws_restJson1AddonIssue = (output: any, context: __SerdeContext }; const deserializeAws_restJson1AddonIssueList = (output: any, context: __SerdeContext): AddonIssue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AddonIssue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AddonIssue(entry, context); + }); }; const deserializeAws_restJson1Addons = (output: any, context: __SerdeContext): AddonInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AddonInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AddonInfo(entry, context); + }); }; const deserializeAws_restJson1AddonVersionInfo = (output: any, context: __SerdeContext): AddonVersionInfo => { @@ -3971,7 +4038,14 @@ const deserializeAws_restJson1AddonVersionInfo = (output: any, context: __SerdeC }; const deserializeAws_restJson1AddonVersionInfoList = (output: any, context: __SerdeContext): AddonVersionInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AddonVersionInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AddonVersionInfo(entry, context); + }); }; const deserializeAws_restJson1AutoScalingGroup = (output: any, context: __SerdeContext): AutoScalingGroup => { @@ -3981,7 +4055,14 @@ const deserializeAws_restJson1AutoScalingGroup = (output: any, context: __SerdeC }; const deserializeAws_restJson1AutoScalingGroupList = (output: any, context: __SerdeContext): AutoScalingGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AutoScalingGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AutoScalingGroup(entry, context); + }); }; const deserializeAws_restJson1Certificate = (output: any, context: __SerdeContext): Certificate => { @@ -4040,7 +4121,14 @@ const deserializeAws_restJson1Cluster = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Compatibilities = (output: any, context: __SerdeContext): Compatibility[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Compatibility(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Compatibility(entry, context); + }); }; const deserializeAws_restJson1Compatibility = (output: any, context: __SerdeContext): Compatibility => { @@ -4070,7 +4158,14 @@ const deserializeAws_restJson1EncryptionConfig = (output: any, context: __SerdeC }; const deserializeAws_restJson1EncryptionConfigList = (output: any, context: __SerdeContext): EncryptionConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EncryptionConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EncryptionConfig(entry, context); + }); }; const deserializeAws_restJson1ErrorDetail = (output: any, context: __SerdeContext): ErrorDetail => { @@ -4085,7 +4180,14 @@ const deserializeAws_restJson1ErrorDetail = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ErrorDetails = (output: any, context: __SerdeContext): ErrorDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ErrorDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ErrorDetail(entry, context); + }); }; const deserializeAws_restJson1FargateProfile = (output: any, context: __SerdeContext): FargateProfile => { @@ -4127,13 +4229,15 @@ const deserializeAws_restJson1FargateProfileLabel = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1FargateProfileSelector = ( @@ -4153,7 +4257,14 @@ const deserializeAws_restJson1FargateProfileSelectors = ( output: any, context: __SerdeContext ): FargateProfileSelector[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FargateProfileSelector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FargateProfileSelector(entry, context); + }); }; const deserializeAws_restJson1Identity = (output: any, context: __SerdeContext): Identity => { @@ -4177,7 +4288,14 @@ const deserializeAws_restJson1Issue = (output: any, context: __SerdeContext): Is }; const deserializeAws_restJson1IssueList = (output: any, context: __SerdeContext): Issue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Issue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Issue(entry, context); + }); }; const deserializeAws_restJson1KubernetesNetworkConfigResponse = ( @@ -4191,13 +4309,15 @@ const deserializeAws_restJson1KubernetesNetworkConfigResponse = ( }; const deserializeAws_restJson1labelsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1LaunchTemplateSpecification = ( @@ -4231,11 +4351,25 @@ const deserializeAws_restJson1LogSetup = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1LogSetups = (output: any, context: __SerdeContext): LogSetup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LogSetup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LogSetup(entry, context); + }); }; const deserializeAws_restJson1LogTypes = (output: any, context: __SerdeContext): (LogType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Nodegroup = (output: any, context: __SerdeContext): Nodegroup => { @@ -4355,17 +4489,26 @@ const deserializeAws_restJson1RemoteAccessConfig = (output: any, context: __Serd }; const deserializeAws_restJson1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Update = (output: any, context: __SerdeContext): Update => { @@ -4396,7 +4539,14 @@ const deserializeAws_restJson1UpdateParam = (output: any, context: __SerdeContex }; const deserializeAws_restJson1UpdateParams = (output: any, context: __SerdeContext): UpdateParam[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UpdateParam(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UpdateParam(entry, context); + }); }; const deserializeAws_restJson1VpcConfigResponse = (output: any, context: __SerdeContext): VpcConfigResponse => { @@ -4449,6 +4599,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-elastic-beanstalk/protocols/Aws_query.ts b/clients/client-elastic-beanstalk/protocols/Aws_query.ts index e8cc13675f34..edf4d85f6742 100644 --- a/clients/client-elastic-beanstalk/protocols/Aws_query.ts +++ b/clients/client-elastic-beanstalk/protocols/Aws_query.ts @@ -332,7 +332,7 @@ export const serializeAws_queryAbortEnvironmentUpdateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -348,7 +348,7 @@ export const serializeAws_queryApplyEnvironmentManagedActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -364,7 +364,7 @@ export const serializeAws_queryAssociateEnvironmentOperationsRoleCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -380,7 +380,7 @@ export const serializeAws_queryCheckDNSAvailabilityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -396,7 +396,7 @@ export const serializeAws_queryComposeEnvironmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -412,7 +412,7 @@ export const serializeAws_queryCreateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -428,7 +428,7 @@ export const serializeAws_queryCreateApplicationVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -444,7 +444,7 @@ export const serializeAws_queryCreateConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -460,7 +460,7 @@ export const serializeAws_queryCreateEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -476,7 +476,7 @@ export const serializeAws_queryCreatePlatformVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -492,7 +492,7 @@ export const serializeAws_queryCreateStorageLocationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "CreateStorageLocation", @@ -506,7 +506,7 @@ export const serializeAws_queryDeleteApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -522,7 +522,7 @@ export const serializeAws_queryDeleteApplicationVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -538,7 +538,7 @@ export const serializeAws_queryDeleteConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -554,7 +554,7 @@ export const serializeAws_queryDeleteEnvironmentConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -570,7 +570,7 @@ export const serializeAws_queryDeletePlatformVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -586,7 +586,7 @@ export const serializeAws_queryDescribeAccountAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DescribeAccountAttributes", @@ -600,7 +600,7 @@ export const serializeAws_queryDescribeApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -616,7 +616,7 @@ export const serializeAws_queryDescribeApplicationVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -632,7 +632,7 @@ export const serializeAws_queryDescribeConfigurationOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -648,7 +648,7 @@ export const serializeAws_queryDescribeConfigurationSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -664,7 +664,7 @@ export const serializeAws_queryDescribeEnvironmentHealthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -680,7 +680,7 @@ export const serializeAws_queryDescribeEnvironmentManagedActionHistoryCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -696,7 +696,7 @@ export const serializeAws_queryDescribeEnvironmentManagedActionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -712,7 +712,7 @@ export const serializeAws_queryDescribeEnvironmentResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -728,7 +728,7 @@ export const serializeAws_queryDescribeEnvironmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -744,7 +744,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -760,7 +760,7 @@ export const serializeAws_queryDescribeInstancesHealthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -776,7 +776,7 @@ export const serializeAws_queryDescribePlatformVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -792,7 +792,7 @@ export const serializeAws_queryDisassociateEnvironmentOperationsRoleCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -808,7 +808,7 @@ export const serializeAws_queryListAvailableSolutionStacksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "ListAvailableSolutionStacks", @@ -822,7 +822,7 @@ export const serializeAws_queryListPlatformBranchesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -838,7 +838,7 @@ export const serializeAws_queryListPlatformVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -854,7 +854,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -870,7 +870,7 @@ export const serializeAws_queryRebuildEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -886,7 +886,7 @@ export const serializeAws_queryRequestEnvironmentInfoCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -902,7 +902,7 @@ export const serializeAws_queryRestartAppServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -918,7 +918,7 @@ export const serializeAws_queryRetrieveEnvironmentInfoCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -934,7 +934,7 @@ export const serializeAws_querySwapEnvironmentCNAMEsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -950,7 +950,7 @@ export const serializeAws_queryTerminateEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -966,7 +966,7 @@ export const serializeAws_queryUpdateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -982,7 +982,7 @@ export const serializeAws_queryUpdateApplicationResourceLifecycleCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -998,7 +998,7 @@ export const serializeAws_queryUpdateApplicationVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1014,7 +1014,7 @@ export const serializeAws_queryUpdateConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1030,7 +1030,7 @@ export const serializeAws_queryUpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1046,7 +1046,7 @@ export const serializeAws_queryUpdateTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1062,7 +1062,7 @@ export const serializeAws_queryValidateConfigurationSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4027,10 +4027,10 @@ const serializeAws_queryAbortEnvironmentUpdateMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } return entries; @@ -4040,6 +4040,9 @@ const serializeAws_queryApplicationNamesList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4051,14 +4054,14 @@ const serializeAws_queryApplicationResourceLifecycleConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VersionLifecycleConfig !== undefined) { + if (input.VersionLifecycleConfig !== undefined && input.VersionLifecycleConfig !== null) { const memberEntries = serializeAws_queryApplicationVersionLifecycleConfig(input.VersionLifecycleConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VersionLifecycleConfig.${key}`; entries[loc] = value; }); } - if (input.ServiceRole !== undefined) { + if (input.ServiceRole !== undefined && input.ServiceRole !== null) { entries["ServiceRole"] = input.ServiceRole; } return entries; @@ -4069,14 +4072,14 @@ const serializeAws_queryApplicationVersionLifecycleConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxAgeRule !== undefined) { + if (input.MaxAgeRule !== undefined && input.MaxAgeRule !== null) { const memberEntries = serializeAws_queryMaxAgeRule(input.MaxAgeRule, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MaxAgeRule.${key}`; entries[loc] = value; }); } - if (input.MaxCountRule !== undefined) { + if (input.MaxCountRule !== undefined && input.MaxCountRule !== null) { const memberEntries = serializeAws_queryMaxCountRule(input.MaxCountRule, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MaxCountRule.${key}`; @@ -4091,13 +4094,13 @@ const serializeAws_queryApplyEnvironmentManagedActionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.ActionId !== undefined) { + if (input.ActionId !== undefined && input.ActionId !== null) { entries["ActionId"] = input.ActionId; } return entries; @@ -4108,10 +4111,10 @@ const serializeAws_queryAssociateEnvironmentOperationsRoleMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.OperationsRole !== undefined) { + if (input.OperationsRole !== undefined && input.OperationsRole !== null) { entries["OperationsRole"] = input.OperationsRole; } return entries; @@ -4119,19 +4122,19 @@ const serializeAws_queryAssociateEnvironmentOperationsRoleMessage = ( const serializeAws_queryBuildConfiguration = (input: BuildConfiguration, context: __SerdeContext): any => { const entries: any = {}; - if (input.CodeBuildServiceRole !== undefined) { + if (input.CodeBuildServiceRole !== undefined && input.CodeBuildServiceRole !== null) { entries["CodeBuildServiceRole"] = input.CodeBuildServiceRole; } - if (input.TimeoutInMinutes !== undefined) { + if (input.TimeoutInMinutes !== undefined && input.TimeoutInMinutes !== null) { entries["TimeoutInMinutes"] = input.TimeoutInMinutes; } - if (input.ArtifactName !== undefined) { + if (input.ArtifactName !== undefined && input.ArtifactName !== null) { entries["ArtifactName"] = input.ArtifactName; } - if (input.Image !== undefined) { + if (input.Image !== undefined && input.Image !== null) { entries["Image"] = input.Image; } - if (input.ComputeType !== undefined) { + if (input.ComputeType !== undefined && input.ComputeType !== null) { entries["ComputeType"] = input.ComputeType; } return entries; @@ -4142,7 +4145,7 @@ const serializeAws_queryCheckDNSAvailabilityMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CNAMEPrefix !== undefined) { + if (input.CNAMEPrefix !== undefined && input.CNAMEPrefix !== null) { entries["CNAMEPrefix"] = input.CNAMEPrefix; } return entries; @@ -4153,13 +4156,13 @@ const serializeAws_queryComposeEnvironmentsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.VersionLabels !== undefined) { + if (input.VersionLabels !== undefined && input.VersionLabels !== null) { const memberEntries = serializeAws_queryVersionLabels(input.VersionLabels, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VersionLabels.${key}`; @@ -4174,16 +4177,16 @@ const serializeAws_queryConfigurationOptionSetting = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } - if (input.OptionName !== undefined) { + if (input.OptionName !== undefined && input.OptionName !== null) { entries["OptionName"] = input.OptionName; } - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } return entries; @@ -4196,6 +4199,9 @@ const serializeAws_queryConfigurationOptionSettingsList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryConfigurationOptionSetting(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -4207,24 +4213,24 @@ const serializeAws_queryConfigurationOptionSettingsList = ( const serializeAws_queryCreateApplicationMessage = (input: CreateApplicationMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ResourceLifecycleConfig !== undefined) { + if (input.ResourceLifecycleConfig !== undefined && input.ResourceLifecycleConfig !== null) { const memberEntries = serializeAws_queryApplicationResourceLifecycleConfig(input.ResourceLifecycleConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceLifecycleConfig.${key}`; entries[loc] = value; }); } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } return entries; @@ -4235,43 +4241,43 @@ const serializeAws_queryCreateApplicationVersionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.VersionLabel !== undefined) { + if (input.VersionLabel !== undefined && input.VersionLabel !== null) { entries["VersionLabel"] = input.VersionLabel; } - if (input.SourceBundle !== undefined) { + if (input.SourceBundle !== undefined && input.SourceBundle !== null) { const memberEntries = serializeAws_queryS3Location(input.SourceBundle, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceBundle.${key}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.AutoCreateApplication !== undefined) { + if (input.AutoCreateApplication !== undefined && input.AutoCreateApplication !== null) { entries["AutoCreateApplication"] = input.AutoCreateApplication; } - if (input.Process !== undefined) { + if (input.Process !== undefined && input.Process !== null) { entries["Process"] = input.Process; } - if (input.SourceBuildInformation !== undefined) { + if (input.SourceBuildInformation !== undefined && input.SourceBuildInformation !== null) { const memberEntries = serializeAws_querySourceBuildInformation(input.SourceBuildInformation, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceBuildInformation.${key}`; entries[loc] = value; }); } - if (input.BuildConfiguration !== undefined) { + if (input.BuildConfiguration !== undefined && input.BuildConfiguration !== null) { const memberEntries = serializeAws_queryBuildConfiguration(input.BuildConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BuildConfiguration.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -4286,43 +4292,43 @@ const serializeAws_queryCreateConfigurationTemplateMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SolutionStackName !== undefined) { + if (input.SolutionStackName !== undefined && input.SolutionStackName !== null) { entries["SolutionStackName"] = input.SolutionStackName; } - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.SourceConfiguration !== undefined) { + if (input.SourceConfiguration !== undefined && input.SourceConfiguration !== null) { const memberEntries = serializeAws_querySourceConfiguration(input.SourceConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceConfiguration.${key}`; entries[loc] = value; }); } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.OptionSettings !== undefined) { + if (input.OptionSettings !== undefined && input.OptionSettings !== null) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList(input.OptionSettings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionSettings.${key}`; entries[loc] = value; }); } - if (input.PlatformArn !== undefined) { + if (input.PlatformArn !== undefined && input.PlatformArn !== null) { entries["PlatformArn"] = input.PlatformArn; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -4330,62 +4336,62 @@ const serializeAws_queryCreateConfigurationTemplateMessage = ( const serializeAws_queryCreateEnvironmentMessage = (input: CreateEnvironmentMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.OptionsToRemove !== undefined) { + if (input.OptionsToRemove !== undefined && input.OptionsToRemove !== null) { const memberEntries = serializeAws_queryOptionsSpecifierList(input.OptionsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionsToRemove.${key}`; entries[loc] = value; }); } - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.CNAMEPrefix !== undefined) { + if (input.CNAMEPrefix !== undefined && input.CNAMEPrefix !== null) { entries["CNAMEPrefix"] = input.CNAMEPrefix; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.OptionSettings !== undefined) { + if (input.OptionSettings !== undefined && input.OptionSettings !== null) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList(input.OptionSettings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionSettings.${key}`; entries[loc] = value; }); } - if (input.OperationsRole !== undefined) { + if (input.OperationsRole !== undefined && input.OperationsRole !== null) { entries["OperationsRole"] = input.OperationsRole; } - if (input.Tier !== undefined) { + if (input.Tier !== undefined && input.Tier !== null) { const memberEntries = serializeAws_queryEnvironmentTier(input.Tier, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tier.${key}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.SolutionStackName !== undefined) { + if (input.SolutionStackName !== undefined && input.SolutionStackName !== null) { entries["SolutionStackName"] = input.SolutionStackName; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.VersionLabel !== undefined) { + if (input.VersionLabel !== undefined && input.VersionLabel !== null) { entries["VersionLabel"] = input.VersionLabel; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.PlatformArn !== undefined) { + if (input.PlatformArn !== undefined && input.PlatformArn !== null) { entries["PlatformArn"] = input.PlatformArn; } return entries; @@ -4396,30 +4402,30 @@ const serializeAws_queryCreatePlatformVersionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PlatformDefinitionBundle !== undefined) { + if (input.PlatformDefinitionBundle !== undefined && input.PlatformDefinitionBundle !== null) { const memberEntries = serializeAws_queryS3Location(input.PlatformDefinitionBundle, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PlatformDefinitionBundle.${key}`; entries[loc] = value; }); } - if (input.PlatformName !== undefined) { + if (input.PlatformName !== undefined && input.PlatformName !== null) { entries["PlatformName"] = input.PlatformName; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTags(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.PlatformVersion !== undefined) { + if (input.PlatformVersion !== undefined && input.PlatformVersion !== null) { entries["PlatformVersion"] = input.PlatformVersion; } - if (input.OptionSettings !== undefined) { + if (input.OptionSettings !== undefined && input.OptionSettings !== null) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList(input.OptionSettings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionSettings.${key}`; @@ -4431,10 +4437,10 @@ const serializeAws_queryCreatePlatformVersionRequest = ( const serializeAws_queryDeleteApplicationMessage = (input: DeleteApplicationMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.TerminateEnvByForce !== undefined) { + if (input.TerminateEnvByForce !== undefined && input.TerminateEnvByForce !== null) { entries["TerminateEnvByForce"] = input.TerminateEnvByForce; } return entries; @@ -4445,13 +4451,13 @@ const serializeAws_queryDeleteApplicationVersionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.VersionLabel !== undefined) { + if (input.VersionLabel !== undefined && input.VersionLabel !== null) { entries["VersionLabel"] = input.VersionLabel; } - if (input.DeleteSourceBundle !== undefined) { + if (input.DeleteSourceBundle !== undefined && input.DeleteSourceBundle !== null) { entries["DeleteSourceBundle"] = input.DeleteSourceBundle; } return entries; @@ -4462,10 +4468,10 @@ const serializeAws_queryDeleteConfigurationTemplateMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } return entries; @@ -4476,10 +4482,10 @@ const serializeAws_queryDeleteEnvironmentConfigurationMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } return entries; @@ -4490,7 +4496,7 @@ const serializeAws_queryDeletePlatformVersionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PlatformArn !== undefined) { + if (input.PlatformArn !== undefined && input.PlatformArn !== null) { entries["PlatformArn"] = input.PlatformArn; } return entries; @@ -4501,7 +4507,7 @@ const serializeAws_queryDescribeApplicationsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ApplicationNames !== undefined) { + if (input.ApplicationNames !== undefined && input.ApplicationNames !== null) { const memberEntries = serializeAws_queryApplicationNamesList(input.ApplicationNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ApplicationNames.${key}`; @@ -4516,16 +4522,16 @@ const serializeAws_queryDescribeApplicationVersionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.VersionLabels !== undefined) { + if (input.VersionLabels !== undefined && input.VersionLabels !== null) { const memberEntries = serializeAws_queryVersionLabelsList(input.VersionLabels, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VersionLabels.${key}`; @@ -4540,22 +4546,22 @@ const serializeAws_queryDescribeConfigurationOptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.PlatformArn !== undefined) { + if (input.PlatformArn !== undefined && input.PlatformArn !== null) { entries["PlatformArn"] = input.PlatformArn; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.SolutionStackName !== undefined) { + if (input.SolutionStackName !== undefined && input.SolutionStackName !== null) { entries["SolutionStackName"] = input.SolutionStackName; } - if (input.Options !== undefined) { + if (input.Options !== undefined && input.Options !== null) { const memberEntries = serializeAws_queryOptionsSpecifierList(input.Options, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Options.${key}`; @@ -4570,13 +4576,13 @@ const serializeAws_queryDescribeConfigurationSettingsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } return entries; @@ -4587,17 +4593,17 @@ const serializeAws_queryDescribeEnvironmentHealthRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AttributeNames !== undefined) { + if (input.AttributeNames !== undefined && input.AttributeNames !== null) { const memberEntries = serializeAws_queryEnvironmentHealthAttributes(input.AttributeNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AttributeNames.${key}`; entries[loc] = value; }); } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } return entries; @@ -4608,16 +4614,16 @@ const serializeAws_queryDescribeEnvironmentManagedActionHistoryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } return entries; @@ -4628,13 +4634,13 @@ const serializeAws_queryDescribeEnvironmentManagedActionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { entries["Status"] = input.Status; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } return entries; @@ -4645,10 +4651,10 @@ const serializeAws_queryDescribeEnvironmentResourcesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } return entries; @@ -4659,32 +4665,32 @@ const serializeAws_queryDescribeEnvironmentsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.VersionLabel !== undefined) { + if (input.VersionLabel !== undefined && input.VersionLabel !== null) { entries["VersionLabel"] = input.VersionLabel; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.IncludeDeleted !== undefined) { + if (input.IncludeDeleted !== undefined && input.IncludeDeleted !== null) { entries["IncludeDeleted"] = input.IncludeDeleted; } - if (input.EnvironmentIds !== undefined) { + if (input.EnvironmentIds !== undefined && input.EnvironmentIds !== null) { const memberEntries = serializeAws_queryEnvironmentIdList(input.EnvironmentIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnvironmentIds.${key}`; entries[loc] = value; }); } - if (input.IncludedDeletedBackTo !== undefined) { + if (input.IncludedDeletedBackTo !== undefined && input.IncludedDeletedBackTo !== null) { entries["IncludedDeletedBackTo"] = input.IncludedDeletedBackTo.toISOString().split(".")[0] + "Z"; } - if (input.EnvironmentNames !== undefined) { + if (input.EnvironmentNames !== undefined && input.EnvironmentNames !== null) { const memberEntries = serializeAws_queryEnvironmentNamesList(input.EnvironmentNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnvironmentNames.${key}`; @@ -4696,40 +4702,40 @@ const serializeAws_queryDescribeEnvironmentsMessage = ( const serializeAws_queryDescribeEventsMessage = (input: DescribeEventsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.Severity !== undefined) { + if (input.Severity !== undefined && input.Severity !== null) { entries["Severity"] = input.Severity; } - if (input.VersionLabel !== undefined) { + if (input.VersionLabel !== undefined && input.VersionLabel !== null) { entries["VersionLabel"] = input.VersionLabel; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.RequestId !== undefined) { + if (input.RequestId !== undefined && input.RequestId !== null) { entries["RequestId"] = input.RequestId; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.PlatformArn !== undefined) { + if (input.PlatformArn !== undefined && input.PlatformArn !== null) { entries["PlatformArn"] = input.PlatformArn; } return entries; @@ -4740,20 +4746,20 @@ const serializeAws_queryDescribeInstancesHealthRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AttributeNames !== undefined) { + if (input.AttributeNames !== undefined && input.AttributeNames !== null) { const memberEntries = serializeAws_queryInstancesHealthAttributes(input.AttributeNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AttributeNames.${key}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } return entries; @@ -4764,7 +4770,7 @@ const serializeAws_queryDescribePlatformVersionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PlatformArn !== undefined) { + if (input.PlatformArn !== undefined && input.PlatformArn !== null) { entries["PlatformArn"] = input.PlatformArn; } return entries; @@ -4775,7 +4781,7 @@ const serializeAws_queryDisassociateEnvironmentOperationsRoleMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } return entries; @@ -4788,6 +4794,9 @@ const serializeAws_queryEnvironmentHealthAttributes = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4798,6 +4807,9 @@ const serializeAws_queryEnvironmentIdList = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4808,6 +4820,9 @@ const serializeAws_queryEnvironmentNamesList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4816,13 +4831,13 @@ const serializeAws_queryEnvironmentNamesList = (input: string[], context: __Serd const serializeAws_queryEnvironmentTier = (input: EnvironmentTier, context: __SerdeContext): any => { const entries: any = {}; - if (input.Version !== undefined) { + if (input.Version !== undefined && input.Version !== null) { entries["Version"] = input.Version; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } return entries; @@ -4835,6 +4850,9 @@ const serializeAws_queryInstancesHealthAttributes = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4846,17 +4864,17 @@ const serializeAws_queryListPlatformBranchesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_querySearchFilters(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -4867,17 +4885,17 @@ const serializeAws_queryListPlatformVersionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryPlatformFilters(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -4888,7 +4906,7 @@ const serializeAws_queryListTagsForResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceArn !== undefined) { + if (input.ResourceArn !== undefined && input.ResourceArn !== null) { entries["ResourceArn"] = input.ResourceArn; } return entries; @@ -4896,13 +4914,13 @@ const serializeAws_queryListTagsForResourceMessage = ( const serializeAws_queryMaxAgeRule = (input: MaxAgeRule, context: __SerdeContext): any => { const entries: any = {}; - if (input.DeleteSourceFromS3 !== undefined) { + if (input.DeleteSourceFromS3 !== undefined && input.DeleteSourceFromS3 !== null) { entries["DeleteSourceFromS3"] = input.DeleteSourceFromS3; } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.MaxAgeInDays !== undefined) { + if (input.MaxAgeInDays !== undefined && input.MaxAgeInDays !== null) { entries["MaxAgeInDays"] = input.MaxAgeInDays; } return entries; @@ -4910,13 +4928,13 @@ const serializeAws_queryMaxAgeRule = (input: MaxAgeRule, context: __SerdeContext const serializeAws_queryMaxCountRule = (input: MaxCountRule, context: __SerdeContext): any => { const entries: any = {}; - if (input.MaxCount !== undefined) { + if (input.MaxCount !== undefined && input.MaxCount !== null) { entries["MaxCount"] = input.MaxCount; } - if (input.DeleteSourceFromS3 !== undefined) { + if (input.DeleteSourceFromS3 !== undefined && input.DeleteSourceFromS3 !== null) { entries["DeleteSourceFromS3"] = input.DeleteSourceFromS3; } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -4924,13 +4942,13 @@ const serializeAws_queryMaxCountRule = (input: MaxCountRule, context: __SerdeCon const serializeAws_queryOptionSpecification = (input: OptionSpecification, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.OptionName !== undefined) { + if (input.OptionName !== undefined && input.OptionName !== null) { entries["OptionName"] = input.OptionName; } - if (input.Namespace !== undefined) { + if (input.Namespace !== undefined && input.Namespace !== null) { entries["Namespace"] = input.Namespace; } return entries; @@ -4940,6 +4958,9 @@ const serializeAws_queryOptionsSpecifierList = (input: OptionSpecification[], co const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryOptionSpecification(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -4951,17 +4972,17 @@ const serializeAws_queryOptionsSpecifierList = (input: OptionSpecification[], co const serializeAws_queryPlatformFilter = (input: PlatformFilter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryPlatformFilterValueList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; entries[loc] = value; }); } - if (input.Operator !== undefined) { + if (input.Operator !== undefined && input.Operator !== null) { entries["Operator"] = input.Operator; } return entries; @@ -4971,6 +4992,9 @@ const serializeAws_queryPlatformFilters = (input: PlatformFilter[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryPlatformFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -4984,6 +5008,9 @@ const serializeAws_queryPlatformFilterValueList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4995,10 +5022,10 @@ const serializeAws_queryRebuildEnvironmentMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } return entries; @@ -5009,13 +5036,13 @@ const serializeAws_queryRequestEnvironmentInfoMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InfoType !== undefined) { + if (input.InfoType !== undefined && input.InfoType !== null) { entries["InfoType"] = input.InfoType; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } return entries; @@ -5023,10 +5050,10 @@ const serializeAws_queryRequestEnvironmentInfoMessage = ( const serializeAws_queryRestartAppServerMessage = (input: RestartAppServerMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } return entries; @@ -5037,13 +5064,13 @@ const serializeAws_queryRetrieveEnvironmentInfoMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.InfoType !== undefined) { + if (input.InfoType !== undefined && input.InfoType !== null) { entries["InfoType"] = input.InfoType; } return entries; @@ -5051,10 +5078,10 @@ const serializeAws_queryRetrieveEnvironmentInfoMessage = ( const serializeAws_queryS3Location = (input: S3Location, context: __SerdeContext): any => { const entries: any = {}; - if (input.S3Key !== undefined) { + if (input.S3Key !== undefined && input.S3Key !== null) { entries["S3Key"] = input.S3Key; } - if (input.S3Bucket !== undefined) { + if (input.S3Bucket !== undefined && input.S3Bucket !== null) { entries["S3Bucket"] = input.S3Bucket; } return entries; @@ -5062,17 +5089,17 @@ const serializeAws_queryS3Location = (input: S3Location, context: __SerdeContext const serializeAws_querySearchFilter = (input: SearchFilter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_querySearchFilterValues(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; entries[loc] = value; }); } - if (input.Operator !== undefined) { + if (input.Operator !== undefined && input.Operator !== null) { entries["Operator"] = input.Operator; } return entries; @@ -5082,6 +5109,9 @@ const serializeAws_querySearchFilters = (input: SearchFilter[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_querySearchFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5095,6 +5125,9 @@ const serializeAws_querySearchFilterValues = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5103,13 +5136,13 @@ const serializeAws_querySearchFilterValues = (input: string[], context: __SerdeC const serializeAws_querySourceBuildInformation = (input: SourceBuildInformation, context: __SerdeContext): any => { const entries: any = {}; - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.SourceLocation !== undefined) { + if (input.SourceLocation !== undefined && input.SourceLocation !== null) { entries["SourceLocation"] = input.SourceLocation; } - if (input.SourceRepository !== undefined) { + if (input.SourceRepository !== undefined && input.SourceRepository !== null) { entries["SourceRepository"] = input.SourceRepository; } return entries; @@ -5117,10 +5150,10 @@ const serializeAws_querySourceBuildInformation = (input: SourceBuildInformation, const serializeAws_querySourceConfiguration = (input: SourceConfiguration, context: __SerdeContext): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } return entries; @@ -5131,16 +5164,16 @@ const serializeAws_querySwapEnvironmentCNAMEsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DestinationEnvironmentName !== undefined) { + if (input.DestinationEnvironmentName !== undefined && input.DestinationEnvironmentName !== null) { entries["DestinationEnvironmentName"] = input.DestinationEnvironmentName; } - if (input.SourceEnvironmentName !== undefined) { + if (input.SourceEnvironmentName !== undefined && input.SourceEnvironmentName !== null) { entries["SourceEnvironmentName"] = input.SourceEnvironmentName; } - if (input.DestinationEnvironmentId !== undefined) { + if (input.DestinationEnvironmentId !== undefined && input.DestinationEnvironmentId !== null) { entries["DestinationEnvironmentId"] = input.DestinationEnvironmentId; } - if (input.SourceEnvironmentId !== undefined) { + if (input.SourceEnvironmentId !== undefined && input.SourceEnvironmentId !== null) { entries["SourceEnvironmentId"] = input.SourceEnvironmentId; } return entries; @@ -5148,10 +5181,10 @@ const serializeAws_querySwapEnvironmentCNAMEsMessage = ( const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -5161,6 +5194,9 @@ const serializeAws_queryTagKeyList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5171,6 +5207,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5184,6 +5223,9 @@ const serializeAws_queryTags = (input: Tag[], context: __SerdeContext): any => { const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5198,16 +5240,16 @@ const serializeAws_queryTerminateEnvironmentMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TerminateResources !== undefined) { + if (input.TerminateResources !== undefined && input.TerminateResources !== null) { entries["TerminateResources"] = input.TerminateResources; } - if (input.ForceTerminate !== undefined) { + if (input.ForceTerminate !== undefined && input.ForceTerminate !== null) { entries["ForceTerminate"] = input.ForceTerminate; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } return entries; @@ -5215,10 +5257,10 @@ const serializeAws_queryTerminateEnvironmentMessage = ( const serializeAws_queryUpdateApplicationMessage = (input: UpdateApplicationMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } return entries; @@ -5229,10 +5271,10 @@ const serializeAws_queryUpdateApplicationResourceLifecycleMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.ResourceLifecycleConfig !== undefined) { + if (input.ResourceLifecycleConfig !== undefined && input.ResourceLifecycleConfig !== null) { const memberEntries = serializeAws_queryApplicationResourceLifecycleConfig(input.ResourceLifecycleConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceLifecycleConfig.${key}`; @@ -5247,13 +5289,13 @@ const serializeAws_queryUpdateApplicationVersionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VersionLabel !== undefined) { + if (input.VersionLabel !== undefined && input.VersionLabel !== null) { entries["VersionLabel"] = input.VersionLabel; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -5264,23 +5306,23 @@ const serializeAws_queryUpdateConfigurationTemplateMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.OptionSettings !== undefined) { + if (input.OptionSettings !== undefined && input.OptionSettings !== null) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList(input.OptionSettings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionSettings.${key}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.OptionsToRemove !== undefined) { + if (input.OptionsToRemove !== undefined && input.OptionsToRemove !== null) { const memberEntries = serializeAws_queryOptionsSpecifierList(input.OptionsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionsToRemove.${key}`; @@ -5292,52 +5334,52 @@ const serializeAws_queryUpdateConfigurationTemplateMessage = ( const serializeAws_queryUpdateEnvironmentMessage = (input: UpdateEnvironmentMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.VersionLabel !== undefined) { + if (input.VersionLabel !== undefined && input.VersionLabel !== null) { entries["VersionLabel"] = input.VersionLabel; } - if (input.SolutionStackName !== undefined) { + if (input.SolutionStackName !== undefined && input.SolutionStackName !== null) { entries["SolutionStackName"] = input.SolutionStackName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } - if (input.EnvironmentId !== undefined) { + if (input.EnvironmentId !== undefined && input.EnvironmentId !== null) { entries["EnvironmentId"] = input.EnvironmentId; } - if (input.Tier !== undefined) { + if (input.Tier !== undefined && input.Tier !== null) { const memberEntries = serializeAws_queryEnvironmentTier(input.Tier, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tier.${key}`; entries[loc] = value; }); } - if (input.OptionsToRemove !== undefined) { + if (input.OptionsToRemove !== undefined && input.OptionsToRemove !== null) { const memberEntries = serializeAws_queryOptionsSpecifierList(input.OptionsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionsToRemove.${key}`; entries[loc] = value; }); } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.OptionSettings !== undefined) { + if (input.OptionSettings !== undefined && input.OptionSettings !== null) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList(input.OptionSettings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionSettings.${key}`; entries[loc] = value; }); } - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.PlatformArn !== undefined) { + if (input.PlatformArn !== undefined && input.PlatformArn !== null) { entries["PlatformArn"] = input.PlatformArn; } return entries; @@ -5348,17 +5390,17 @@ const serializeAws_queryUpdateTagsForResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceArn !== undefined) { + if (input.ResourceArn !== undefined && input.ResourceArn !== null) { entries["ResourceArn"] = input.ResourceArn; } - if (input.TagsToRemove !== undefined) { + if (input.TagsToRemove !== undefined && input.TagsToRemove !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagsToRemove.${key}`; entries[loc] = value; }); } - if (input.TagsToAdd !== undefined) { + if (input.TagsToAdd !== undefined && input.TagsToAdd !== null) { const memberEntries = serializeAws_queryTagList(input.TagsToAdd, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagsToAdd.${key}`; @@ -5373,20 +5415,20 @@ const serializeAws_queryValidateConfigurationSettingsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.OptionSettings !== undefined) { + if (input.OptionSettings !== undefined && input.OptionSettings !== null) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList(input.OptionSettings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionSettings.${key}`; entries[loc] = value; }); } - if (input.ApplicationName !== undefined) { + if (input.ApplicationName !== undefined && input.ApplicationName !== null) { entries["ApplicationName"] = input.ApplicationName; } - if (input.EnvironmentName !== undefined) { + if (input.EnvironmentName !== undefined && input.EnvironmentName !== null) { entries["EnvironmentName"] = input.EnvironmentName; } return entries; @@ -5396,6 +5438,9 @@ const serializeAws_queryVersionLabels = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5406,6 +5451,9 @@ const serializeAws_queryVersionLabelsList = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5469,7 +5517,14 @@ const deserializeAws_queryApplicationDescriptionList = ( output: any, context: __SerdeContext ): ApplicationDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryApplicationDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryApplicationDescription(entry, context); + }); }; const deserializeAws_queryApplicationDescriptionMessage = ( @@ -5622,7 +5677,14 @@ const deserializeAws_queryApplicationVersionDescriptionList = ( output: any, context: __SerdeContext ): ApplicationVersionDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryApplicationVersionDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryApplicationVersionDescription(entry, context); + }); }; const deserializeAws_queryApplicationVersionDescriptionMessage = ( @@ -5717,18 +5779,39 @@ const deserializeAws_queryAutoScalingGroup = (output: any, context: __SerdeConte }; const deserializeAws_queryAutoScalingGroupList = (output: any, context: __SerdeContext): AutoScalingGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryAutoScalingGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAutoScalingGroup(entry, context); + }); }; const deserializeAws_queryAvailableSolutionStackDetailsList = ( output: any, context: __SerdeContext ): SolutionStackDescription[] => { - return (output || []).map((entry: any) => deserializeAws_querySolutionStackDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySolutionStackDescription(entry, context); + }); }; const deserializeAws_queryAvailableSolutionStackNamesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryBuilder = (output: any, context: __SerdeContext): Builder => { @@ -5742,7 +5825,14 @@ const deserializeAws_queryBuilder = (output: any, context: __SerdeContext): Buil }; const deserializeAws_queryCauses = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryCheckDNSAvailabilityResultMessage = ( @@ -5838,11 +5928,25 @@ const deserializeAws_queryConfigurationOptionDescriptionsList = ( output: any, context: __SerdeContext ): ConfigurationOptionDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryConfigurationOptionDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryConfigurationOptionDescription(entry, context); + }); }; const deserializeAws_queryConfigurationOptionPossibleValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryConfigurationOptionsDescription = ( @@ -5901,7 +6005,14 @@ const deserializeAws_queryConfigurationOptionSettingsList = ( output: any, context: __SerdeContext ): ConfigurationOptionSetting[] => { - return (output || []).map((entry: any) => deserializeAws_queryConfigurationOptionSetting(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryConfigurationOptionSetting(entry, context); + }); }; const deserializeAws_queryConfigurationSettingsDescription = ( @@ -5963,7 +6074,14 @@ const deserializeAws_queryConfigurationSettingsDescriptionList = ( output: any, context: __SerdeContext ): ConfigurationSettingsDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryConfigurationSettingsDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryConfigurationSettingsDescription(entry, context); + }); }; const deserializeAws_queryConfigurationSettingsDescriptions = ( @@ -6005,7 +6123,14 @@ const deserializeAws_queryConfigurationSettingsValidationMessages = ( }; const deserializeAws_queryConfigurationTemplateNamesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryCPUUtilization = (output: any, context: __SerdeContext): CPUUtilization => { @@ -6091,7 +6216,14 @@ const deserializeAws_queryCustomAmi = (output: any, context: __SerdeContext): Cu }; const deserializeAws_queryCustomAmiList = (output: any, context: __SerdeContext): CustomAmi[] => { - return (output || []).map((entry: any) => deserializeAws_queryCustomAmi(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCustomAmi(entry, context); + }); }; const deserializeAws_queryDeletePlatformVersionResult = ( @@ -6384,7 +6516,14 @@ const deserializeAws_queryEnvironmentDescriptionsList = ( output: any, context: __SerdeContext ): EnvironmentDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryEnvironmentDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEnvironmentDescription(entry, context); + }); }; const deserializeAws_queryEnvironmentDescriptionsMessage = ( @@ -6439,7 +6578,14 @@ const deserializeAws_queryEnvironmentInfoDescriptionList = ( output: any, context: __SerdeContext ): EnvironmentInfoDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryEnvironmentInfoDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEnvironmentInfoDescription(entry, context); + }); }; const deserializeAws_queryEnvironmentLink = (output: any, context: __SerdeContext): EnvironmentLink => { @@ -6457,7 +6603,14 @@ const deserializeAws_queryEnvironmentLink = (output: any, context: __SerdeContex }; const deserializeAws_queryEnvironmentLinks = (output: any, context: __SerdeContext): EnvironmentLink[] => { - return (output || []).map((entry: any) => deserializeAws_queryEnvironmentLink(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEnvironmentLink(entry, context); + }); }; const deserializeAws_queryEnvironmentResourceDescription = ( @@ -6627,7 +6780,14 @@ const deserializeAws_queryEventDescription = (output: any, context: __SerdeConte }; const deserializeAws_queryEventDescriptionList = (output: any, context: __SerdeContext): EventDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventDescription(entry, context); + }); }; const deserializeAws_queryEventDescriptionsMessage = ( @@ -6664,7 +6824,14 @@ const deserializeAws_queryInstance = (output: any, context: __SerdeContext): Ins }; const deserializeAws_queryInstanceHealthList = (output: any, context: __SerdeContext): SingleInstanceHealth[] => { - return (output || []).map((entry: any) => deserializeAws_querySingleInstanceHealth(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySingleInstanceHealth(entry, context); + }); }; const deserializeAws_queryInstanceHealthSummary = (output: any, context: __SerdeContext): InstanceHealthSummary => { @@ -6706,7 +6873,14 @@ const deserializeAws_queryInstanceHealthSummary = (output: any, context: __Serde }; const deserializeAws_queryInstanceList = (output: any, context: __SerdeContext): Instance[] => { - return (output || []).map((entry: any) => deserializeAws_queryInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInstance(entry, context); + }); }; const deserializeAws_queryInsufficientPrivilegesException = ( @@ -6781,7 +6955,14 @@ const deserializeAws_queryLaunchConfiguration = (output: any, context: __SerdeCo }; const deserializeAws_queryLaunchConfigurationList = (output: any, context: __SerdeContext): LaunchConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_queryLaunchConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLaunchConfiguration(entry, context); + }); }; const deserializeAws_queryLaunchTemplate = (output: any, context: __SerdeContext): LaunchTemplate => { @@ -6795,7 +6976,14 @@ const deserializeAws_queryLaunchTemplate = (output: any, context: __SerdeContext }; const deserializeAws_queryLaunchTemplateList = (output: any, context: __SerdeContext): LaunchTemplate[] => { - return (output || []).map((entry: any) => deserializeAws_queryLaunchTemplate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLaunchTemplate(entry, context); + }); }; const deserializeAws_queryListAvailableSolutionStacksResultMessage = ( @@ -6891,7 +7079,14 @@ const deserializeAws_queryListPlatformVersionsResult = ( }; const deserializeAws_queryLoadAverage = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => parseFloat(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return parseFloat(entry); + }); }; const deserializeAws_queryLoadBalancer = (output: any, context: __SerdeContext): LoadBalancer => { @@ -6929,11 +7124,25 @@ const deserializeAws_queryLoadBalancerDescription = (output: any, context: __Ser }; const deserializeAws_queryLoadBalancerList = (output: any, context: __SerdeContext): LoadBalancer[] => { - return (output || []).map((entry: any) => deserializeAws_queryLoadBalancer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLoadBalancer(entry, context); + }); }; const deserializeAws_queryLoadBalancerListenersDescription = (output: any, context: __SerdeContext): Listener[] => { - return (output || []).map((entry: any) => deserializeAws_queryListener(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryListener(entry, context); + }); }; const deserializeAws_queryManagedAction = (output: any, context: __SerdeContext): ManagedAction => { @@ -7007,7 +7216,14 @@ const deserializeAws_queryManagedActionHistoryItems = ( output: any, context: __SerdeContext ): ManagedActionHistoryItem[] => { - return (output || []).map((entry: any) => deserializeAws_queryManagedActionHistoryItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryManagedActionHistoryItem(entry, context); + }); }; const deserializeAws_queryManagedActionInvalidStateException = ( @@ -7024,7 +7240,14 @@ const deserializeAws_queryManagedActionInvalidStateException = ( }; const deserializeAws_queryManagedActions = (output: any, context: __SerdeContext): ManagedAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryManagedAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryManagedAction(entry, context); + }); }; const deserializeAws_queryMaxAgeRule = (output: any, context: __SerdeContext): MaxAgeRule => { @@ -7126,7 +7349,14 @@ const deserializeAws_queryPlatformBranchSummaryList = ( output: any, context: __SerdeContext ): PlatformBranchSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryPlatformBranchSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPlatformBranchSummary(entry, context); + }); }; const deserializeAws_queryPlatformDescription = (output: any, context: __SerdeContext): PlatformDescription => { @@ -7264,7 +7494,14 @@ const deserializeAws_queryPlatformFramework = (output: any, context: __SerdeCont }; const deserializeAws_queryPlatformFrameworks = (output: any, context: __SerdeContext): PlatformFramework[] => { - return (output || []).map((entry: any) => deserializeAws_queryPlatformFramework(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPlatformFramework(entry, context); + }); }; const deserializeAws_queryPlatformProgrammingLanguage = ( @@ -7288,7 +7525,14 @@ const deserializeAws_queryPlatformProgrammingLanguages = ( output: any, context: __SerdeContext ): PlatformProgrammingLanguage[] => { - return (output || []).map((entry: any) => deserializeAws_queryPlatformProgrammingLanguage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPlatformProgrammingLanguage(entry, context); + }); }; const deserializeAws_queryPlatformSummary = (output: any, context: __SerdeContext): PlatformSummary => { @@ -7358,7 +7602,14 @@ const deserializeAws_queryPlatformSummary = (output: any, context: __SerdeContex }; const deserializeAws_queryPlatformSummaryList = (output: any, context: __SerdeContext): PlatformSummary[] => { - return (output || []).map((entry: any) => deserializeAws_queryPlatformSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPlatformSummary(entry, context); + }); }; const deserializeAws_queryPlatformVersionStillReferencedException = ( @@ -7389,7 +7640,14 @@ const deserializeAws_queryQueue = (output: any, context: __SerdeContext): Queue }; const deserializeAws_queryQueueList = (output: any, context: __SerdeContext): Queue[] => { - return (output || []).map((entry: any) => deserializeAws_queryQueue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryQueue(entry, context); + }); }; const deserializeAws_queryResourceNotFoundException = ( @@ -7612,7 +7870,14 @@ const deserializeAws_querySolutionStackDescription = ( }; const deserializeAws_querySolutionStackFileTypeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySourceBuildInformation = (output: any, context: __SerdeContext): SourceBuildInformation => { @@ -7669,11 +7934,25 @@ const deserializeAws_queryStatusCodes = (output: any, context: __SerdeContext): }; const deserializeAws_querySupportedAddonList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySupportedTierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySystemStatus = (output: any, context: __SerdeContext): SystemStatus => { @@ -7711,7 +7990,14 @@ const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTooManyApplicationsException = ( @@ -7810,7 +8096,14 @@ const deserializeAws_queryTrigger = (output: any, context: __SerdeContext): Trig }; const deserializeAws_queryTriggerList = (output: any, context: __SerdeContext): Trigger[] => { - return (output || []).map((entry: any) => deserializeAws_queryTrigger(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTrigger(entry, context); + }); }; const deserializeAws_queryValidationMessage = (output: any, context: __SerdeContext): ValidationMessage => { @@ -7836,11 +8129,25 @@ const deserializeAws_queryValidationMessage = (output: any, context: __SerdeCont }; const deserializeAws_queryValidationMessagesList = (output: any, context: __SerdeContext): ValidationMessage[] => { - return (output || []).map((entry: any) => deserializeAws_queryValidationMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryValidationMessage(entry, context); + }); }; const deserializeAws_queryVersionLabelsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ diff --git a/clients/client-elastic-inference/protocols/Aws_restJson1.ts b/clients/client-elastic-inference/protocols/Aws_restJson1.ts index 068d6b250363..61153f12c252 100644 --- a/clients/client-elastic-inference/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-inference/protocols/Aws_restJson1.ts @@ -45,15 +45,16 @@ export const serializeAws_restJson1DescribeAcceleratorOfferingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describe-accelerator-offerings"; let body: any; body = JSON.stringify({ - ...(input.acceleratorTypes !== undefined && { - acceleratorTypes: serializeAws_restJson1AcceleratorTypeNameList(input.acceleratorTypes, context), - }), - ...(input.locationType !== undefined && { locationType: input.locationType }), + ...(input.acceleratorTypes !== undefined && + input.acceleratorTypes !== null && { + acceleratorTypes: serializeAws_restJson1AcceleratorTypeNameList(input.acceleratorTypes, context), + }), + ...(input.locationType !== undefined && input.locationType !== null && { locationType: input.locationType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -72,17 +73,19 @@ export const serializeAws_restJson1DescribeAcceleratorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describe-accelerators"; let body: any; body = JSON.stringify({ - ...(input.acceleratorIds !== undefined && { - acceleratorIds: serializeAws_restJson1AcceleratorIdList(input.acceleratorIds, context), - }), - ...(input.filters !== undefined && { filters: serializeAws_restJson1FilterList(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.acceleratorIds !== undefined && + input.acceleratorIds !== null && { + acceleratorIds: serializeAws_restJson1AcceleratorIdList(input.acceleratorIds, context), + }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -100,12 +103,10 @@ export const serializeAws_restJson1DescribeAcceleratorTypesCommand = async ( input: DescribeAcceleratorTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/describe-accelerator-types"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -122,9 +123,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -153,7 +152,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -167,7 +166,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -185,9 +184,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -676,36 +673,67 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( }; const serializeAws_restJson1AcceleratorIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AcceleratorTypeNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_restJson1ValueStringList(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1ValueStringList(input.values, context) }), }; }; const serializeAws_restJson1FilterList = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Filter(entry, context); + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ValueStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AcceleratorType = (output: any, context: __SerdeContext): AcceleratorType => { @@ -726,7 +754,14 @@ const deserializeAws_restJson1AcceleratorType = (output: any, context: __SerdeCo }; const deserializeAws_restJson1AcceleratorTypeList = (output: any, context: __SerdeContext): AcceleratorType[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AcceleratorType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AcceleratorType(entry, context); + }); }; const deserializeAws_restJson1AcceleratorTypeOffering = ( @@ -745,7 +780,14 @@ const deserializeAws_restJson1AcceleratorTypeOfferingList = ( output: any, context: __SerdeContext ): AcceleratorTypeOffering[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AcceleratorTypeOffering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AcceleratorTypeOffering(entry, context); + }); }; const deserializeAws_restJson1ElasticInferenceAccelerator = ( @@ -781,7 +823,14 @@ const deserializeAws_restJson1ElasticInferenceAcceleratorSet = ( output: any, context: __SerdeContext ): ElasticInferenceAccelerator[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ElasticInferenceAccelerator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ElasticInferenceAccelerator(entry, context); + }); }; const deserializeAws_restJson1KeyValuePair = (output: any, context: __SerdeContext): KeyValuePair => { @@ -798,17 +847,26 @@ const deserializeAws_restJson1MemoryInfo = (output: any, context: __SerdeContext }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ThroughputInfoList = (output: any, context: __SerdeContext): KeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1KeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1KeyValuePair(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -831,6 +889,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-elastic-load-balancing-v2/protocols/Aws_query.ts b/clients/client-elastic-load-balancing-v2/protocols/Aws_query.ts index 0df3aa88d5e0..d3ecd0e55656 100644 --- a/clients/client-elastic-load-balancing-v2/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing-v2/protocols/Aws_query.ts @@ -233,7 +233,7 @@ export const serializeAws_queryAddListenerCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -249,7 +249,7 @@ export const serializeAws_queryAddTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -265,7 +265,7 @@ export const serializeAws_queryCreateListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -281,7 +281,7 @@ export const serializeAws_queryCreateLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -297,7 +297,7 @@ export const serializeAws_queryCreateRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -313,7 +313,7 @@ export const serializeAws_queryCreateTargetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -329,7 +329,7 @@ export const serializeAws_queryDeleteListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -345,7 +345,7 @@ export const serializeAws_queryDeleteLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -361,7 +361,7 @@ export const serializeAws_queryDeleteRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -377,7 +377,7 @@ export const serializeAws_queryDeleteTargetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -393,7 +393,7 @@ export const serializeAws_queryDeregisterTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -409,7 +409,7 @@ export const serializeAws_queryDescribeAccountLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -425,7 +425,7 @@ export const serializeAws_queryDescribeListenerCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -441,7 +441,7 @@ export const serializeAws_queryDescribeListenersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -457,7 +457,7 @@ export const serializeAws_queryDescribeLoadBalancerAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -473,7 +473,7 @@ export const serializeAws_queryDescribeLoadBalancersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -489,7 +489,7 @@ export const serializeAws_queryDescribeRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -505,7 +505,7 @@ export const serializeAws_queryDescribeSSLPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -521,7 +521,7 @@ export const serializeAws_queryDescribeTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -537,7 +537,7 @@ export const serializeAws_queryDescribeTargetGroupAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -553,7 +553,7 @@ export const serializeAws_queryDescribeTargetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -569,7 +569,7 @@ export const serializeAws_queryDescribeTargetHealthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -585,7 +585,7 @@ export const serializeAws_queryModifyListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -601,7 +601,7 @@ export const serializeAws_queryModifyLoadBalancerAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -617,7 +617,7 @@ export const serializeAws_queryModifyRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -633,7 +633,7 @@ export const serializeAws_queryModifyTargetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -649,7 +649,7 @@ export const serializeAws_queryModifyTargetGroupAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -665,7 +665,7 @@ export const serializeAws_queryRegisterTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -681,7 +681,7 @@ export const serializeAws_queryRemoveListenerCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -697,7 +697,7 @@ export const serializeAws_queryRemoveTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -713,7 +713,7 @@ export const serializeAws_querySetIpAddressTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -729,7 +729,7 @@ export const serializeAws_querySetRulePrioritiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -745,7 +745,7 @@ export const serializeAws_querySetSecurityGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -761,7 +761,7 @@ export const serializeAws_querySetSubnetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -4064,44 +4064,44 @@ const deserializeAws_queryUnsupportedProtocolExceptionResponse = async ( const serializeAws_queryAction = (input: Action, context: __SerdeContext): any => { const entries: any = {}; - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.TargetGroupArn !== undefined) { + if (input.TargetGroupArn !== undefined && input.TargetGroupArn !== null) { entries["TargetGroupArn"] = input.TargetGroupArn; } - if (input.AuthenticateOidcConfig !== undefined) { + if (input.AuthenticateOidcConfig !== undefined && input.AuthenticateOidcConfig !== null) { const memberEntries = serializeAws_queryAuthenticateOidcActionConfig(input.AuthenticateOidcConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AuthenticateOidcConfig.${key}`; entries[loc] = value; }); } - if (input.AuthenticateCognitoConfig !== undefined) { + if (input.AuthenticateCognitoConfig !== undefined && input.AuthenticateCognitoConfig !== null) { const memberEntries = serializeAws_queryAuthenticateCognitoActionConfig(input.AuthenticateCognitoConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AuthenticateCognitoConfig.${key}`; entries[loc] = value; }); } - if (input.Order !== undefined) { + if (input.Order !== undefined && input.Order !== null) { entries["Order"] = input.Order; } - if (input.RedirectConfig !== undefined) { + if (input.RedirectConfig !== undefined && input.RedirectConfig !== null) { const memberEntries = serializeAws_queryRedirectActionConfig(input.RedirectConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RedirectConfig.${key}`; entries[loc] = value; }); } - if (input.FixedResponseConfig !== undefined) { + if (input.FixedResponseConfig !== undefined && input.FixedResponseConfig !== null) { const memberEntries = serializeAws_queryFixedResponseActionConfig(input.FixedResponseConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `FixedResponseConfig.${key}`; entries[loc] = value; }); } - if (input.ForwardConfig !== undefined) { + if (input.ForwardConfig !== undefined && input.ForwardConfig !== null) { const memberEntries = serializeAws_queryForwardActionConfig(input.ForwardConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ForwardConfig.${key}`; @@ -4115,6 +4115,9 @@ const serializeAws_queryActions = (input: Action[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryAction(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -4129,10 +4132,10 @@ const serializeAws_queryAddListenerCertificatesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ListenerArn !== undefined) { + if (input.ListenerArn !== undefined && input.ListenerArn !== null) { entries["ListenerArn"] = input.ListenerArn; } - if (input.Certificates !== undefined) { + if (input.Certificates !== undefined && input.Certificates !== null) { const memberEntries = serializeAws_queryCertificateList(input.Certificates, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Certificates.${key}`; @@ -4144,14 +4147,14 @@ const serializeAws_queryAddListenerCertificatesInput = ( const serializeAws_queryAddTagsInput = (input: AddTagsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceArns !== undefined) { + if (input.ResourceArns !== undefined && input.ResourceArns !== null) { const memberEntries = serializeAws_queryResourceArns(input.ResourceArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceArns.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -4165,6 +4168,9 @@ const serializeAws_queryAlpnPolicyName = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4177,11 +4183,13 @@ const serializeAws_queryAuthenticateCognitoActionAuthenticationRequestExtraParam ): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.key`] = key; - entries[`entry.${counter}.value`] = input[key]; - counter++; - }); + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.key`] = key; + entries[`entry.${counter}.value`] = input[key]; + counter++; + }); return entries; }; @@ -4190,25 +4198,25 @@ const serializeAws_queryAuthenticateCognitoActionConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserPoolArn !== undefined) { + if (input.UserPoolArn !== undefined && input.UserPoolArn !== null) { entries["UserPoolArn"] = input.UserPoolArn; } - if (input.UserPoolClientId !== undefined) { + if (input.UserPoolClientId !== undefined && input.UserPoolClientId !== null) { entries["UserPoolClientId"] = input.UserPoolClientId; } - if (input.UserPoolDomain !== undefined) { + if (input.UserPoolDomain !== undefined && input.UserPoolDomain !== null) { entries["UserPoolDomain"] = input.UserPoolDomain; } - if (input.SessionCookieName !== undefined) { + if (input.SessionCookieName !== undefined && input.SessionCookieName !== null) { entries["SessionCookieName"] = input.SessionCookieName; } - if (input.Scope !== undefined) { + if (input.Scope !== undefined && input.Scope !== null) { entries["Scope"] = input.Scope; } - if (input.SessionTimeout !== undefined) { + if (input.SessionTimeout !== undefined && input.SessionTimeout !== null) { entries["SessionTimeout"] = input.SessionTimeout; } - if (input.AuthenticationRequestExtraParams !== undefined) { + if (input.AuthenticationRequestExtraParams !== undefined && input.AuthenticationRequestExtraParams !== null) { const memberEntries = serializeAws_queryAuthenticateCognitoActionAuthenticationRequestExtraParams( input.AuthenticationRequestExtraParams, context @@ -4218,7 +4226,7 @@ const serializeAws_queryAuthenticateCognitoActionConfig = ( entries[loc] = value; }); } - if (input.OnUnauthenticatedRequest !== undefined) { + if (input.OnUnauthenticatedRequest !== undefined && input.OnUnauthenticatedRequest !== null) { entries["OnUnauthenticatedRequest"] = input.OnUnauthenticatedRequest; } return entries; @@ -4230,11 +4238,13 @@ const serializeAws_queryAuthenticateOidcActionAuthenticationRequestExtraParams = ): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.key`] = key; - entries[`entry.${counter}.value`] = input[key]; - counter++; - }); + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.key`] = key; + entries[`entry.${counter}.value`] = input[key]; + counter++; + }); return entries; }; @@ -4243,34 +4253,34 @@ const serializeAws_queryAuthenticateOidcActionConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Issuer !== undefined) { + if (input.Issuer !== undefined && input.Issuer !== null) { entries["Issuer"] = input.Issuer; } - if (input.AuthorizationEndpoint !== undefined) { + if (input.AuthorizationEndpoint !== undefined && input.AuthorizationEndpoint !== null) { entries["AuthorizationEndpoint"] = input.AuthorizationEndpoint; } - if (input.TokenEndpoint !== undefined) { + if (input.TokenEndpoint !== undefined && input.TokenEndpoint !== null) { entries["TokenEndpoint"] = input.TokenEndpoint; } - if (input.UserInfoEndpoint !== undefined) { + if (input.UserInfoEndpoint !== undefined && input.UserInfoEndpoint !== null) { entries["UserInfoEndpoint"] = input.UserInfoEndpoint; } - if (input.ClientId !== undefined) { + if (input.ClientId !== undefined && input.ClientId !== null) { entries["ClientId"] = input.ClientId; } - if (input.ClientSecret !== undefined) { + if (input.ClientSecret !== undefined && input.ClientSecret !== null) { entries["ClientSecret"] = input.ClientSecret; } - if (input.SessionCookieName !== undefined) { + if (input.SessionCookieName !== undefined && input.SessionCookieName !== null) { entries["SessionCookieName"] = input.SessionCookieName; } - if (input.Scope !== undefined) { + if (input.Scope !== undefined && input.Scope !== null) { entries["Scope"] = input.Scope; } - if (input.SessionTimeout !== undefined) { + if (input.SessionTimeout !== undefined && input.SessionTimeout !== null) { entries["SessionTimeout"] = input.SessionTimeout; } - if (input.AuthenticationRequestExtraParams !== undefined) { + if (input.AuthenticationRequestExtraParams !== undefined && input.AuthenticationRequestExtraParams !== null) { const memberEntries = serializeAws_queryAuthenticateOidcActionAuthenticationRequestExtraParams( input.AuthenticationRequestExtraParams, context @@ -4280,10 +4290,10 @@ const serializeAws_queryAuthenticateOidcActionConfig = ( entries[loc] = value; }); } - if (input.OnUnauthenticatedRequest !== undefined) { + if (input.OnUnauthenticatedRequest !== undefined && input.OnUnauthenticatedRequest !== null) { entries["OnUnauthenticatedRequest"] = input.OnUnauthenticatedRequest; } - if (input.UseExistingClientSecret !== undefined) { + if (input.UseExistingClientSecret !== undefined && input.UseExistingClientSecret !== null) { entries["UseExistingClientSecret"] = input.UseExistingClientSecret; } return entries; @@ -4291,10 +4301,10 @@ const serializeAws_queryAuthenticateOidcActionConfig = ( const serializeAws_queryCertificate = (input: Certificate, context: __SerdeContext): any => { const entries: any = {}; - if (input.CertificateArn !== undefined) { + if (input.CertificateArn !== undefined && input.CertificateArn !== null) { entries["CertificateArn"] = input.CertificateArn; } - if (input.IsDefault !== undefined) { + if (input.IsDefault !== undefined && input.IsDefault !== null) { entries["IsDefault"] = input.IsDefault; } return entries; @@ -4304,6 +4314,9 @@ const serializeAws_queryCertificateList = (input: Certificate[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryCertificate(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -4315,40 +4328,40 @@ const serializeAws_queryCertificateList = (input: Certificate[], context: __Serd const serializeAws_queryCreateListenerInput = (input: CreateListenerInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerArn !== undefined) { + if (input.LoadBalancerArn !== undefined && input.LoadBalancerArn !== null) { entries["LoadBalancerArn"] = input.LoadBalancerArn; } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.SslPolicy !== undefined) { + if (input.SslPolicy !== undefined && input.SslPolicy !== null) { entries["SslPolicy"] = input.SslPolicy; } - if (input.Certificates !== undefined) { + if (input.Certificates !== undefined && input.Certificates !== null) { const memberEntries = serializeAws_queryCertificateList(input.Certificates, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Certificates.${key}`; entries[loc] = value; }); } - if (input.DefaultActions !== undefined) { + if (input.DefaultActions !== undefined && input.DefaultActions !== null) { const memberEntries = serializeAws_queryActions(input.DefaultActions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DefaultActions.${key}`; entries[loc] = value; }); } - if (input.AlpnPolicy !== undefined) { + if (input.AlpnPolicy !== undefined && input.AlpnPolicy !== null) { const memberEntries = serializeAws_queryAlpnPolicyName(input.AlpnPolicy, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlpnPolicy.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -4360,47 +4373,47 @@ const serializeAws_queryCreateListenerInput = (input: CreateListenerInput, conte const serializeAws_queryCreateLoadBalancerInput = (input: CreateLoadBalancerInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Subnets !== undefined) { + if (input.Subnets !== undefined && input.Subnets !== null) { const memberEntries = serializeAws_querySubnets(input.Subnets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Subnets.${key}`; entries[loc] = value; }); } - if (input.SubnetMappings !== undefined) { + if (input.SubnetMappings !== undefined && input.SubnetMappings !== null) { const memberEntries = serializeAws_querySubnetMappings(input.SubnetMappings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetMappings.${key}`; entries[loc] = value; }); } - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_querySecurityGroups(input.SecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroups.${key}`; entries[loc] = value; }); } - if (input.Scheme !== undefined) { + if (input.Scheme !== undefined && input.Scheme !== null) { entries["Scheme"] = input.Scheme; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { entries["Type"] = input.Type; } - if (input.IpAddressType !== undefined) { + if (input.IpAddressType !== undefined && input.IpAddressType !== null) { entries["IpAddressType"] = input.IpAddressType; } - if (input.CustomerOwnedIpv4Pool !== undefined) { + if (input.CustomerOwnedIpv4Pool !== undefined && input.CustomerOwnedIpv4Pool !== null) { entries["CustomerOwnedIpv4Pool"] = input.CustomerOwnedIpv4Pool; } return entries; @@ -4408,27 +4421,27 @@ const serializeAws_queryCreateLoadBalancerInput = (input: CreateLoadBalancerInpu const serializeAws_queryCreateRuleInput = (input: CreateRuleInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ListenerArn !== undefined) { + if (input.ListenerArn !== undefined && input.ListenerArn !== null) { entries["ListenerArn"] = input.ListenerArn; } - if (input.Conditions !== undefined) { + if (input.Conditions !== undefined && input.Conditions !== null) { const memberEntries = serializeAws_queryRuleConditionList(input.Conditions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Conditions.${key}`; entries[loc] = value; }); } - if (input.Priority !== undefined) { + if (input.Priority !== undefined && input.Priority !== null) { entries["Priority"] = input.Priority; } - if (input.Actions !== undefined) { + if (input.Actions !== undefined && input.Actions !== null) { const memberEntries = serializeAws_queryActions(input.Actions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Actions.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -4440,56 +4453,56 @@ const serializeAws_queryCreateRuleInput = (input: CreateRuleInput, context: __Se const serializeAws_queryCreateTargetGroupInput = (input: CreateTargetGroupInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.ProtocolVersion !== undefined) { + if (input.ProtocolVersion !== undefined && input.ProtocolVersion !== null) { entries["ProtocolVersion"] = input.ProtocolVersion; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { entries["VpcId"] = input.VpcId; } - if (input.HealthCheckProtocol !== undefined) { + if (input.HealthCheckProtocol !== undefined && input.HealthCheckProtocol !== null) { entries["HealthCheckProtocol"] = input.HealthCheckProtocol; } - if (input.HealthCheckPort !== undefined) { + if (input.HealthCheckPort !== undefined && input.HealthCheckPort !== null) { entries["HealthCheckPort"] = input.HealthCheckPort; } - if (input.HealthCheckEnabled !== undefined) { + if (input.HealthCheckEnabled !== undefined && input.HealthCheckEnabled !== null) { entries["HealthCheckEnabled"] = input.HealthCheckEnabled; } - if (input.HealthCheckPath !== undefined) { + if (input.HealthCheckPath !== undefined && input.HealthCheckPath !== null) { entries["HealthCheckPath"] = input.HealthCheckPath; } - if (input.HealthCheckIntervalSeconds !== undefined) { + if (input.HealthCheckIntervalSeconds !== undefined && input.HealthCheckIntervalSeconds !== null) { entries["HealthCheckIntervalSeconds"] = input.HealthCheckIntervalSeconds; } - if (input.HealthCheckTimeoutSeconds !== undefined) { + if (input.HealthCheckTimeoutSeconds !== undefined && input.HealthCheckTimeoutSeconds !== null) { entries["HealthCheckTimeoutSeconds"] = input.HealthCheckTimeoutSeconds; } - if (input.HealthyThresholdCount !== undefined) { + if (input.HealthyThresholdCount !== undefined && input.HealthyThresholdCount !== null) { entries["HealthyThresholdCount"] = input.HealthyThresholdCount; } - if (input.UnhealthyThresholdCount !== undefined) { + if (input.UnhealthyThresholdCount !== undefined && input.UnhealthyThresholdCount !== null) { entries["UnhealthyThresholdCount"] = input.UnhealthyThresholdCount; } - if (input.Matcher !== undefined) { + if (input.Matcher !== undefined && input.Matcher !== null) { const memberEntries = serializeAws_queryMatcher(input.Matcher, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Matcher.${key}`; entries[loc] = value; }); } - if (input.TargetType !== undefined) { + if (input.TargetType !== undefined && input.TargetType !== null) { entries["TargetType"] = input.TargetType; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -4501,7 +4514,7 @@ const serializeAws_queryCreateTargetGroupInput = (input: CreateTargetGroupInput, const serializeAws_queryDeleteListenerInput = (input: DeleteListenerInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ListenerArn !== undefined) { + if (input.ListenerArn !== undefined && input.ListenerArn !== null) { entries["ListenerArn"] = input.ListenerArn; } return entries; @@ -4509,7 +4522,7 @@ const serializeAws_queryDeleteListenerInput = (input: DeleteListenerInput, conte const serializeAws_queryDeleteLoadBalancerInput = (input: DeleteLoadBalancerInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerArn !== undefined) { + if (input.LoadBalancerArn !== undefined && input.LoadBalancerArn !== null) { entries["LoadBalancerArn"] = input.LoadBalancerArn; } return entries; @@ -4517,7 +4530,7 @@ const serializeAws_queryDeleteLoadBalancerInput = (input: DeleteLoadBalancerInpu const serializeAws_queryDeleteRuleInput = (input: DeleteRuleInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.RuleArn !== undefined) { + if (input.RuleArn !== undefined && input.RuleArn !== null) { entries["RuleArn"] = input.RuleArn; } return entries; @@ -4525,7 +4538,7 @@ const serializeAws_queryDeleteRuleInput = (input: DeleteRuleInput, context: __Se const serializeAws_queryDeleteTargetGroupInput = (input: DeleteTargetGroupInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TargetGroupArn !== undefined) { + if (input.TargetGroupArn !== undefined && input.TargetGroupArn !== null) { entries["TargetGroupArn"] = input.TargetGroupArn; } return entries; @@ -4533,10 +4546,10 @@ const serializeAws_queryDeleteTargetGroupInput = (input: DeleteTargetGroupInput, const serializeAws_queryDeregisterTargetsInput = (input: DeregisterTargetsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TargetGroupArn !== undefined) { + if (input.TargetGroupArn !== undefined && input.TargetGroupArn !== null) { entries["TargetGroupArn"] = input.TargetGroupArn; } - if (input.Targets !== undefined) { + if (input.Targets !== undefined && input.Targets !== null) { const memberEntries = serializeAws_queryTargetDescriptions(input.Targets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Targets.${key}`; @@ -4551,10 +4564,10 @@ const serializeAws_queryDescribeAccountLimitsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PageSize !== undefined) { + if (input.PageSize !== undefined && input.PageSize !== null) { entries["PageSize"] = input.PageSize; } return entries; @@ -4565,13 +4578,13 @@ const serializeAws_queryDescribeListenerCertificatesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ListenerArn !== undefined) { + if (input.ListenerArn !== undefined && input.ListenerArn !== null) { entries["ListenerArn"] = input.ListenerArn; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PageSize !== undefined) { + if (input.PageSize !== undefined && input.PageSize !== null) { entries["PageSize"] = input.PageSize; } return entries; @@ -4579,20 +4592,20 @@ const serializeAws_queryDescribeListenerCertificatesInput = ( const serializeAws_queryDescribeListenersInput = (input: DescribeListenersInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerArn !== undefined) { + if (input.LoadBalancerArn !== undefined && input.LoadBalancerArn !== null) { entries["LoadBalancerArn"] = input.LoadBalancerArn; } - if (input.ListenerArns !== undefined) { + if (input.ListenerArns !== undefined && input.ListenerArns !== null) { const memberEntries = serializeAws_queryListenerArns(input.ListenerArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ListenerArns.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PageSize !== undefined) { + if (input.PageSize !== undefined && input.PageSize !== null) { entries["PageSize"] = input.PageSize; } return entries; @@ -4603,7 +4616,7 @@ const serializeAws_queryDescribeLoadBalancerAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerArn !== undefined) { + if (input.LoadBalancerArn !== undefined && input.LoadBalancerArn !== null) { entries["LoadBalancerArn"] = input.LoadBalancerArn; } return entries; @@ -4614,24 +4627,24 @@ const serializeAws_queryDescribeLoadBalancersInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerArns !== undefined) { + if (input.LoadBalancerArns !== undefined && input.LoadBalancerArns !== null) { const memberEntries = serializeAws_queryLoadBalancerArns(input.LoadBalancerArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerArns.${key}`; entries[loc] = value; }); } - if (input.Names !== undefined) { + if (input.Names !== undefined && input.Names !== null) { const memberEntries = serializeAws_queryLoadBalancerNames(input.Names, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Names.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PageSize !== undefined) { + if (input.PageSize !== undefined && input.PageSize !== null) { entries["PageSize"] = input.PageSize; } return entries; @@ -4639,20 +4652,20 @@ const serializeAws_queryDescribeLoadBalancersInput = ( const serializeAws_queryDescribeRulesInput = (input: DescribeRulesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ListenerArn !== undefined) { + if (input.ListenerArn !== undefined && input.ListenerArn !== null) { entries["ListenerArn"] = input.ListenerArn; } - if (input.RuleArns !== undefined) { + if (input.RuleArns !== undefined && input.RuleArns !== null) { const memberEntries = serializeAws_queryRuleArns(input.RuleArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RuleArns.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PageSize !== undefined) { + if (input.PageSize !== undefined && input.PageSize !== null) { entries["PageSize"] = input.PageSize; } return entries; @@ -4660,17 +4673,17 @@ const serializeAws_queryDescribeRulesInput = (input: DescribeRulesInput, context const serializeAws_queryDescribeSSLPoliciesInput = (input: DescribeSSLPoliciesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Names !== undefined) { + if (input.Names !== undefined && input.Names !== null) { const memberEntries = serializeAws_querySslPolicyNames(input.Names, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Names.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PageSize !== undefined) { + if (input.PageSize !== undefined && input.PageSize !== null) { entries["PageSize"] = input.PageSize; } return entries; @@ -4678,7 +4691,7 @@ const serializeAws_queryDescribeSSLPoliciesInput = (input: DescribeSSLPoliciesIn const serializeAws_queryDescribeTagsInput = (input: DescribeTagsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceArns !== undefined) { + if (input.ResourceArns !== undefined && input.ResourceArns !== null) { const memberEntries = serializeAws_queryResourceArns(input.ResourceArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceArns.${key}`; @@ -4693,7 +4706,7 @@ const serializeAws_queryDescribeTargetGroupAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TargetGroupArn !== undefined) { + if (input.TargetGroupArn !== undefined && input.TargetGroupArn !== null) { entries["TargetGroupArn"] = input.TargetGroupArn; } return entries; @@ -4704,27 +4717,27 @@ const serializeAws_queryDescribeTargetGroupsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerArn !== undefined) { + if (input.LoadBalancerArn !== undefined && input.LoadBalancerArn !== null) { entries["LoadBalancerArn"] = input.LoadBalancerArn; } - if (input.TargetGroupArns !== undefined) { + if (input.TargetGroupArns !== undefined && input.TargetGroupArns !== null) { const memberEntries = serializeAws_queryTargetGroupArns(input.TargetGroupArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetGroupArns.${key}`; entries[loc] = value; }); } - if (input.Names !== undefined) { + if (input.Names !== undefined && input.Names !== null) { const memberEntries = serializeAws_queryTargetGroupNames(input.Names, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Names.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PageSize !== undefined) { + if (input.PageSize !== undefined && input.PageSize !== null) { entries["PageSize"] = input.PageSize; } return entries; @@ -4735,10 +4748,10 @@ const serializeAws_queryDescribeTargetHealthInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TargetGroupArn !== undefined) { + if (input.TargetGroupArn !== undefined && input.TargetGroupArn !== null) { entries["TargetGroupArn"] = input.TargetGroupArn; } - if (input.Targets !== undefined) { + if (input.Targets !== undefined && input.Targets !== null) { const memberEntries = serializeAws_queryTargetDescriptions(input.Targets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Targets.${key}`; @@ -4753,13 +4766,13 @@ const serializeAws_queryFixedResponseActionConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MessageBody !== undefined) { + if (input.MessageBody !== undefined && input.MessageBody !== null) { entries["MessageBody"] = input.MessageBody; } - if (input.StatusCode !== undefined) { + if (input.StatusCode !== undefined && input.StatusCode !== null) { entries["StatusCode"] = input.StatusCode; } - if (input.ContentType !== undefined) { + if (input.ContentType !== undefined && input.ContentType !== null) { entries["ContentType"] = input.ContentType; } return entries; @@ -4767,14 +4780,14 @@ const serializeAws_queryFixedResponseActionConfig = ( const serializeAws_queryForwardActionConfig = (input: ForwardActionConfig, context: __SerdeContext): any => { const entries: any = {}; - if (input.TargetGroups !== undefined) { + if (input.TargetGroups !== undefined && input.TargetGroups !== null) { const memberEntries = serializeAws_queryTargetGroupList(input.TargetGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetGroups.${key}`; entries[loc] = value; }); } - if (input.TargetGroupStickinessConfig !== undefined) { + if (input.TargetGroupStickinessConfig !== undefined && input.TargetGroupStickinessConfig !== null) { const memberEntries = serializeAws_queryTargetGroupStickinessConfig(input.TargetGroupStickinessConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetGroupStickinessConfig.${key}`; @@ -4789,7 +4802,7 @@ const serializeAws_queryHostHeaderConditionConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryListOfString(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -4804,10 +4817,10 @@ const serializeAws_queryHttpHeaderConditionConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HttpHeaderName !== undefined) { + if (input.HttpHeaderName !== undefined && input.HttpHeaderName !== null) { entries["HttpHeaderName"] = input.HttpHeaderName; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryListOfString(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -4822,7 +4835,7 @@ const serializeAws_queryHttpRequestMethodConditionConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryListOfString(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -4836,6 +4849,9 @@ const serializeAws_queryListenerArns = (input: string[], context: __SerdeContext const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4846,6 +4862,9 @@ const serializeAws_queryListOfString = (input: string[], context: __SerdeContext const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4856,6 +4875,9 @@ const serializeAws_queryLoadBalancerArns = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4864,10 +4886,10 @@ const serializeAws_queryLoadBalancerArns = (input: string[], context: __SerdeCon const serializeAws_queryLoadBalancerAttribute = (input: LoadBalancerAttribute, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -4877,6 +4899,9 @@ const serializeAws_queryLoadBalancerAttributes = (input: LoadBalancerAttribute[] const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryLoadBalancerAttribute(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -4890,6 +4915,9 @@ const serializeAws_queryLoadBalancerNames = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4898,10 +4926,10 @@ const serializeAws_queryLoadBalancerNames = (input: string[], context: __SerdeCo const serializeAws_queryMatcher = (input: Matcher, context: __SerdeContext): any => { const entries: any = {}; - if (input.HttpCode !== undefined) { + if (input.HttpCode !== undefined && input.HttpCode !== null) { entries["HttpCode"] = input.HttpCode; } - if (input.GrpcCode !== undefined) { + if (input.GrpcCode !== undefined && input.GrpcCode !== null) { entries["GrpcCode"] = input.GrpcCode; } return entries; @@ -4909,33 +4937,33 @@ const serializeAws_queryMatcher = (input: Matcher, context: __SerdeContext): any const serializeAws_queryModifyListenerInput = (input: ModifyListenerInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ListenerArn !== undefined) { + if (input.ListenerArn !== undefined && input.ListenerArn !== null) { entries["ListenerArn"] = input.ListenerArn; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.SslPolicy !== undefined) { + if (input.SslPolicy !== undefined && input.SslPolicy !== null) { entries["SslPolicy"] = input.SslPolicy; } - if (input.Certificates !== undefined) { + if (input.Certificates !== undefined && input.Certificates !== null) { const memberEntries = serializeAws_queryCertificateList(input.Certificates, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Certificates.${key}`; entries[loc] = value; }); } - if (input.DefaultActions !== undefined) { + if (input.DefaultActions !== undefined && input.DefaultActions !== null) { const memberEntries = serializeAws_queryActions(input.DefaultActions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DefaultActions.${key}`; entries[loc] = value; }); } - if (input.AlpnPolicy !== undefined) { + if (input.AlpnPolicy !== undefined && input.AlpnPolicy !== null) { const memberEntries = serializeAws_queryAlpnPolicyName(input.AlpnPolicy, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AlpnPolicy.${key}`; @@ -4950,10 +4978,10 @@ const serializeAws_queryModifyLoadBalancerAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerArn !== undefined) { + if (input.LoadBalancerArn !== undefined && input.LoadBalancerArn !== null) { entries["LoadBalancerArn"] = input.LoadBalancerArn; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_queryLoadBalancerAttributes(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attributes.${key}`; @@ -4965,17 +4993,17 @@ const serializeAws_queryModifyLoadBalancerAttributesInput = ( const serializeAws_queryModifyRuleInput = (input: ModifyRuleInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.RuleArn !== undefined) { + if (input.RuleArn !== undefined && input.RuleArn !== null) { entries["RuleArn"] = input.RuleArn; } - if (input.Conditions !== undefined) { + if (input.Conditions !== undefined && input.Conditions !== null) { const memberEntries = serializeAws_queryRuleConditionList(input.Conditions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Conditions.${key}`; entries[loc] = value; }); } - if (input.Actions !== undefined) { + if (input.Actions !== undefined && input.Actions !== null) { const memberEntries = serializeAws_queryActions(input.Actions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Actions.${key}`; @@ -4990,10 +5018,10 @@ const serializeAws_queryModifyTargetGroupAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TargetGroupArn !== undefined) { + if (input.TargetGroupArn !== undefined && input.TargetGroupArn !== null) { entries["TargetGroupArn"] = input.TargetGroupArn; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_queryTargetGroupAttributes(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attributes.${key}`; @@ -5005,34 +5033,34 @@ const serializeAws_queryModifyTargetGroupAttributesInput = ( const serializeAws_queryModifyTargetGroupInput = (input: ModifyTargetGroupInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TargetGroupArn !== undefined) { + if (input.TargetGroupArn !== undefined && input.TargetGroupArn !== null) { entries["TargetGroupArn"] = input.TargetGroupArn; } - if (input.HealthCheckProtocol !== undefined) { + if (input.HealthCheckProtocol !== undefined && input.HealthCheckProtocol !== null) { entries["HealthCheckProtocol"] = input.HealthCheckProtocol; } - if (input.HealthCheckPort !== undefined) { + if (input.HealthCheckPort !== undefined && input.HealthCheckPort !== null) { entries["HealthCheckPort"] = input.HealthCheckPort; } - if (input.HealthCheckPath !== undefined) { + if (input.HealthCheckPath !== undefined && input.HealthCheckPath !== null) { entries["HealthCheckPath"] = input.HealthCheckPath; } - if (input.HealthCheckEnabled !== undefined) { + if (input.HealthCheckEnabled !== undefined && input.HealthCheckEnabled !== null) { entries["HealthCheckEnabled"] = input.HealthCheckEnabled; } - if (input.HealthCheckIntervalSeconds !== undefined) { + if (input.HealthCheckIntervalSeconds !== undefined && input.HealthCheckIntervalSeconds !== null) { entries["HealthCheckIntervalSeconds"] = input.HealthCheckIntervalSeconds; } - if (input.HealthCheckTimeoutSeconds !== undefined) { + if (input.HealthCheckTimeoutSeconds !== undefined && input.HealthCheckTimeoutSeconds !== null) { entries["HealthCheckTimeoutSeconds"] = input.HealthCheckTimeoutSeconds; } - if (input.HealthyThresholdCount !== undefined) { + if (input.HealthyThresholdCount !== undefined && input.HealthyThresholdCount !== null) { entries["HealthyThresholdCount"] = input.HealthyThresholdCount; } - if (input.UnhealthyThresholdCount !== undefined) { + if (input.UnhealthyThresholdCount !== undefined && input.UnhealthyThresholdCount !== null) { entries["UnhealthyThresholdCount"] = input.UnhealthyThresholdCount; } - if (input.Matcher !== undefined) { + if (input.Matcher !== undefined && input.Matcher !== null) { const memberEntries = serializeAws_queryMatcher(input.Matcher, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Matcher.${key}`; @@ -5047,7 +5075,7 @@ const serializeAws_queryPathPatternConditionConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryListOfString(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -5062,7 +5090,7 @@ const serializeAws_queryQueryStringConditionConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryQueryStringKeyValuePairList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -5074,10 +5102,10 @@ const serializeAws_queryQueryStringConditionConfig = ( const serializeAws_queryQueryStringKeyValuePair = (input: QueryStringKeyValuePair, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -5090,6 +5118,9 @@ const serializeAws_queryQueryStringKeyValuePairList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryQueryStringKeyValuePair(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5101,22 +5132,22 @@ const serializeAws_queryQueryStringKeyValuePairList = ( const serializeAws_queryRedirectActionConfig = (input: RedirectActionConfig, context: __SerdeContext): any => { const entries: any = {}; - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.Host !== undefined) { + if (input.Host !== undefined && input.Host !== null) { entries["Host"] = input.Host; } - if (input.Path !== undefined) { + if (input.Path !== undefined && input.Path !== null) { entries["Path"] = input.Path; } - if (input.Query !== undefined) { + if (input.Query !== undefined && input.Query !== null) { entries["Query"] = input.Query; } - if (input.StatusCode !== undefined) { + if (input.StatusCode !== undefined && input.StatusCode !== null) { entries["StatusCode"] = input.StatusCode; } return entries; @@ -5124,10 +5155,10 @@ const serializeAws_queryRedirectActionConfig = (input: RedirectActionConfig, con const serializeAws_queryRegisterTargetsInput = (input: RegisterTargetsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TargetGroupArn !== undefined) { + if (input.TargetGroupArn !== undefined && input.TargetGroupArn !== null) { entries["TargetGroupArn"] = input.TargetGroupArn; } - if (input.Targets !== undefined) { + if (input.Targets !== undefined && input.Targets !== null) { const memberEntries = serializeAws_queryTargetDescriptions(input.Targets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Targets.${key}`; @@ -5142,10 +5173,10 @@ const serializeAws_queryRemoveListenerCertificatesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ListenerArn !== undefined) { + if (input.ListenerArn !== undefined && input.ListenerArn !== null) { entries["ListenerArn"] = input.ListenerArn; } - if (input.Certificates !== undefined) { + if (input.Certificates !== undefined && input.Certificates !== null) { const memberEntries = serializeAws_queryCertificateList(input.Certificates, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Certificates.${key}`; @@ -5157,14 +5188,14 @@ const serializeAws_queryRemoveListenerCertificatesInput = ( const serializeAws_queryRemoveTagsInput = (input: RemoveTagsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceArns !== undefined) { + if (input.ResourceArns !== undefined && input.ResourceArns !== null) { const memberEntries = serializeAws_queryResourceArns(input.ResourceArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceArns.${key}`; entries[loc] = value; }); } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeys(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; @@ -5178,6 +5209,9 @@ const serializeAws_queryResourceArns = (input: string[], context: __SerdeContext const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5188,6 +5222,9 @@ const serializeAws_queryRuleArns = (input: string[], context: __SerdeContext): a const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5196,52 +5233,52 @@ const serializeAws_queryRuleArns = (input: string[], context: __SerdeContext): a const serializeAws_queryRuleCondition = (input: RuleCondition, context: __SerdeContext): any => { const entries: any = {}; - if (input.Field !== undefined) { + if (input.Field !== undefined && input.Field !== null) { entries["Field"] = input.Field; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryListOfString(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; entries[loc] = value; }); } - if (input.HostHeaderConfig !== undefined) { + if (input.HostHeaderConfig !== undefined && input.HostHeaderConfig !== null) { const memberEntries = serializeAws_queryHostHeaderConditionConfig(input.HostHeaderConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HostHeaderConfig.${key}`; entries[loc] = value; }); } - if (input.PathPatternConfig !== undefined) { + if (input.PathPatternConfig !== undefined && input.PathPatternConfig !== null) { const memberEntries = serializeAws_queryPathPatternConditionConfig(input.PathPatternConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PathPatternConfig.${key}`; entries[loc] = value; }); } - if (input.HttpHeaderConfig !== undefined) { + if (input.HttpHeaderConfig !== undefined && input.HttpHeaderConfig !== null) { const memberEntries = serializeAws_queryHttpHeaderConditionConfig(input.HttpHeaderConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HttpHeaderConfig.${key}`; entries[loc] = value; }); } - if (input.QueryStringConfig !== undefined) { + if (input.QueryStringConfig !== undefined && input.QueryStringConfig !== null) { const memberEntries = serializeAws_queryQueryStringConditionConfig(input.QueryStringConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `QueryStringConfig.${key}`; entries[loc] = value; }); } - if (input.HttpRequestMethodConfig !== undefined) { + if (input.HttpRequestMethodConfig !== undefined && input.HttpRequestMethodConfig !== null) { const memberEntries = serializeAws_queryHttpRequestMethodConditionConfig(input.HttpRequestMethodConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HttpRequestMethodConfig.${key}`; entries[loc] = value; }); } - if (input.SourceIpConfig !== undefined) { + if (input.SourceIpConfig !== undefined && input.SourceIpConfig !== null) { const memberEntries = serializeAws_querySourceIpConditionConfig(input.SourceIpConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceIpConfig.${key}`; @@ -5255,6 +5292,9 @@ const serializeAws_queryRuleConditionList = (input: RuleCondition[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryRuleCondition(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5268,6 +5308,9 @@ const serializeAws_queryRulePriorityList = (input: RulePriorityPair[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryRulePriorityPair(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5279,10 +5322,10 @@ const serializeAws_queryRulePriorityList = (input: RulePriorityPair[], context: const serializeAws_queryRulePriorityPair = (input: RulePriorityPair, context: __SerdeContext): any => { const entries: any = {}; - if (input.RuleArn !== undefined) { + if (input.RuleArn !== undefined && input.RuleArn !== null) { entries["RuleArn"] = input.RuleArn; } - if (input.Priority !== undefined) { + if (input.Priority !== undefined && input.Priority !== null) { entries["Priority"] = input.Priority; } return entries; @@ -5292,6 +5335,9 @@ const serializeAws_querySecurityGroups = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5300,10 +5346,10 @@ const serializeAws_querySecurityGroups = (input: string[], context: __SerdeConte const serializeAws_querySetIpAddressTypeInput = (input: SetIpAddressTypeInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerArn !== undefined) { + if (input.LoadBalancerArn !== undefined && input.LoadBalancerArn !== null) { entries["LoadBalancerArn"] = input.LoadBalancerArn; } - if (input.IpAddressType !== undefined) { + if (input.IpAddressType !== undefined && input.IpAddressType !== null) { entries["IpAddressType"] = input.IpAddressType; } return entries; @@ -5311,7 +5357,7 @@ const serializeAws_querySetIpAddressTypeInput = (input: SetIpAddressTypeInput, c const serializeAws_querySetRulePrioritiesInput = (input: SetRulePrioritiesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.RulePriorities !== undefined) { + if (input.RulePriorities !== undefined && input.RulePriorities !== null) { const memberEntries = serializeAws_queryRulePriorityList(input.RulePriorities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RulePriorities.${key}`; @@ -5323,10 +5369,10 @@ const serializeAws_querySetRulePrioritiesInput = (input: SetRulePrioritiesInput, const serializeAws_querySetSecurityGroupsInput = (input: SetSecurityGroupsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerArn !== undefined) { + if (input.LoadBalancerArn !== undefined && input.LoadBalancerArn !== null) { entries["LoadBalancerArn"] = input.LoadBalancerArn; } - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_querySecurityGroups(input.SecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroups.${key}`; @@ -5338,24 +5384,24 @@ const serializeAws_querySetSecurityGroupsInput = (input: SetSecurityGroupsInput, const serializeAws_querySetSubnetsInput = (input: SetSubnetsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerArn !== undefined) { + if (input.LoadBalancerArn !== undefined && input.LoadBalancerArn !== null) { entries["LoadBalancerArn"] = input.LoadBalancerArn; } - if (input.Subnets !== undefined) { + if (input.Subnets !== undefined && input.Subnets !== null) { const memberEntries = serializeAws_querySubnets(input.Subnets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Subnets.${key}`; entries[loc] = value; }); } - if (input.SubnetMappings !== undefined) { + if (input.SubnetMappings !== undefined && input.SubnetMappings !== null) { const memberEntries = serializeAws_querySubnetMappings(input.SubnetMappings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetMappings.${key}`; entries[loc] = value; }); } - if (input.IpAddressType !== undefined) { + if (input.IpAddressType !== undefined && input.IpAddressType !== null) { entries["IpAddressType"] = input.IpAddressType; } return entries; @@ -5363,7 +5409,7 @@ const serializeAws_querySetSubnetsInput = (input: SetSubnetsInput, context: __Se const serializeAws_querySourceIpConditionConfig = (input: SourceIpConditionConfig, context: __SerdeContext): any => { const entries: any = {}; - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryListOfString(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -5377,6 +5423,9 @@ const serializeAws_querySslPolicyNames = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5385,16 +5434,16 @@ const serializeAws_querySslPolicyNames = (input: string[], context: __SerdeConte const serializeAws_querySubnetMapping = (input: SubnetMapping, context: __SerdeContext): any => { const entries: any = {}; - if (input.SubnetId !== undefined) { + if (input.SubnetId !== undefined && input.SubnetId !== null) { entries["SubnetId"] = input.SubnetId; } - if (input.AllocationId !== undefined) { + if (input.AllocationId !== undefined && input.AllocationId !== null) { entries["AllocationId"] = input.AllocationId; } - if (input.PrivateIPv4Address !== undefined) { + if (input.PrivateIPv4Address !== undefined && input.PrivateIPv4Address !== null) { entries["PrivateIPv4Address"] = input.PrivateIPv4Address; } - if (input.IPv6Address !== undefined) { + if (input.IPv6Address !== undefined && input.IPv6Address !== null) { entries["IPv6Address"] = input.IPv6Address; } return entries; @@ -5404,6 +5453,9 @@ const serializeAws_querySubnetMappings = (input: SubnetMapping[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_querySubnetMapping(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5417,6 +5469,9 @@ const serializeAws_querySubnets = (input: string[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5425,10 +5480,10 @@ const serializeAws_querySubnets = (input: string[], context: __SerdeContext): an const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -5438,6 +5493,9 @@ const serializeAws_queryTagKeys = (input: string[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5448,6 +5506,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5459,13 +5520,13 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const serializeAws_queryTargetDescription = (input: TargetDescription, context: __SerdeContext): any => { const entries: any = {}; - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { entries["Id"] = input.Id; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } return entries; @@ -5475,6 +5536,9 @@ const serializeAws_queryTargetDescriptions = (input: TargetDescription[], contex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTargetDescription(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5488,6 +5552,9 @@ const serializeAws_queryTargetGroupArns = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5496,10 +5563,10 @@ const serializeAws_queryTargetGroupArns = (input: string[], context: __SerdeCont const serializeAws_queryTargetGroupAttribute = (input: TargetGroupAttribute, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -5509,6 +5576,9 @@ const serializeAws_queryTargetGroupAttributes = (input: TargetGroupAttribute[], const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTargetGroupAttribute(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5522,6 +5592,9 @@ const serializeAws_queryTargetGroupList = (input: TargetGroupTuple[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTargetGroupTuple(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -5535,6 +5608,9 @@ const serializeAws_queryTargetGroupNames = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -5546,10 +5622,10 @@ const serializeAws_queryTargetGroupStickinessConfig = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.DurationSeconds !== undefined) { + if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) { entries["DurationSeconds"] = input.DurationSeconds; } return entries; @@ -5557,10 +5633,10 @@ const serializeAws_queryTargetGroupStickinessConfig = ( const serializeAws_queryTargetGroupTuple = (input: TargetGroupTuple, context: __SerdeContext): any => { const entries: any = {}; - if (input.TargetGroupArn !== undefined) { + if (input.TargetGroupArn !== undefined && input.TargetGroupArn !== null) { entries["TargetGroupArn"] = input.TargetGroupArn; } - if (input.Weight !== undefined) { + if (input.Weight !== undefined && input.Weight !== null) { entries["Weight"] = input.Weight; } return entries; @@ -5614,7 +5690,14 @@ const deserializeAws_queryAction = (output: any, context: __SerdeContext): Actio }; const deserializeAws_queryActions = (output: any, context: __SerdeContext): Action[] => { - return (output || []).map((entry: any) => deserializeAws_queryAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAction(entry, context); + }); }; const deserializeAws_queryAddListenerCertificatesOutput = ( @@ -5655,7 +5738,14 @@ const deserializeAws_queryAllocationIdNotFoundException = ( }; const deserializeAws_queryAlpnPolicyName = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryALPNPolicyNotSupportedException = ( @@ -5675,13 +5765,15 @@ const deserializeAws_queryAuthenticateCognitoActionAuthenticationRequestExtraPar output: any, context: __SerdeContext ): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: pair["value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryAuthenticateCognitoActionConfig = ( @@ -5738,13 +5830,15 @@ const deserializeAws_queryAuthenticateOidcActionAuthenticationRequestExtraParams output: any, context: __SerdeContext ): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: pair["value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryAuthenticateOidcActionConfig = ( @@ -5855,7 +5949,14 @@ const deserializeAws_queryAvailabilityZoneNotSupportedException = ( }; const deserializeAws_queryAvailabilityZones = (output: any, context: __SerdeContext): AvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_queryAvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAvailabilityZone(entry, context); + }); }; const deserializeAws_queryCertificate = (output: any, context: __SerdeContext): Certificate => { @@ -5873,7 +5974,14 @@ const deserializeAws_queryCertificate = (output: any, context: __SerdeContext): }; const deserializeAws_queryCertificateList = (output: any, context: __SerdeContext): Certificate[] => { - return (output || []).map((entry: any) => deserializeAws_queryCertificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCertificate(entry, context); + }); }; const deserializeAws_queryCertificateNotFoundException = ( @@ -5904,7 +6012,14 @@ const deserializeAws_queryCipher = (output: any, context: __SerdeContext): Ciphe }; const deserializeAws_queryCiphers = (output: any, context: __SerdeContext): Cipher[] => { - return (output || []).map((entry: any) => deserializeAws_queryCipher(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCipher(entry, context); + }); }; const deserializeAws_queryCreateListenerOutput = (output: any, context: __SerdeContext): CreateListenerOutput => { @@ -6473,7 +6588,14 @@ const deserializeAws_queryLimit = (output: any, context: __SerdeContext): Limit }; const deserializeAws_queryLimits = (output: any, context: __SerdeContext): Limit[] => { - return (output || []).map((entry: any) => deserializeAws_queryLimit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLimit(entry, context); + }); }; const deserializeAws_queryListener = (output: any, context: __SerdeContext): Listener => { @@ -6546,11 +6668,25 @@ const deserializeAws_queryListenerNotFoundException = ( }; const deserializeAws_queryListeners = (output: any, context: __SerdeContext): Listener[] => { - return (output || []).map((entry: any) => deserializeAws_queryListener(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryListener(entry, context); + }); }; const deserializeAws_queryListOfString = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryLoadBalancer = (output: any, context: __SerdeContext): LoadBalancer => { @@ -6646,11 +6782,25 @@ const deserializeAws_queryLoadBalancerAddress = (output: any, context: __SerdeCo }; const deserializeAws_queryLoadBalancerAddresses = (output: any, context: __SerdeContext): LoadBalancerAddress[] => { - return (output || []).map((entry: any) => deserializeAws_queryLoadBalancerAddress(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLoadBalancerAddress(entry, context); + }); }; const deserializeAws_queryLoadBalancerArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryLoadBalancerAttribute = (output: any, context: __SerdeContext): LoadBalancerAttribute => { @@ -6668,7 +6818,14 @@ const deserializeAws_queryLoadBalancerAttribute = (output: any, context: __Serde }; const deserializeAws_queryLoadBalancerAttributes = (output: any, context: __SerdeContext): LoadBalancerAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_queryLoadBalancerAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLoadBalancerAttribute(entry, context); + }); }; const deserializeAws_queryLoadBalancerNotFoundException = ( @@ -6685,7 +6842,14 @@ const deserializeAws_queryLoadBalancerNotFoundException = ( }; const deserializeAws_queryLoadBalancers = (output: any, context: __SerdeContext): LoadBalancer[] => { - return (output || []).map((entry: any) => deserializeAws_queryLoadBalancer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLoadBalancer(entry, context); + }); }; const deserializeAws_queryLoadBalancerState = (output: any, context: __SerdeContext): LoadBalancerState => { @@ -6872,7 +7036,14 @@ const deserializeAws_queryQueryStringKeyValuePairList = ( output: any, context: __SerdeContext ): QueryStringKeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_queryQueryStringKeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryQueryStringKeyValuePair(entry, context); + }); }; const deserializeAws_queryRedirectActionConfig = (output: any, context: __SerdeContext): RedirectActionConfig => { @@ -7013,7 +7184,14 @@ const deserializeAws_queryRuleCondition = (output: any, context: __SerdeContext) }; const deserializeAws_queryRuleConditionList = (output: any, context: __SerdeContext): RuleCondition[] => { - return (output || []).map((entry: any) => deserializeAws_queryRuleCondition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRuleCondition(entry, context); + }); }; const deserializeAws_queryRuleNotFoundException = (output: any, context: __SerdeContext): RuleNotFoundException => { @@ -7027,11 +7205,25 @@ const deserializeAws_queryRuleNotFoundException = (output: any, context: __Serde }; const deserializeAws_queryRules = (output: any, context: __SerdeContext): Rule[] => { - return (output || []).map((entry: any) => deserializeAws_queryRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRule(entry, context); + }); }; const deserializeAws_querySecurityGroups = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySetIpAddressTypeOutput = (output: any, context: __SerdeContext): SetIpAddressTypeOutput => { @@ -7107,7 +7299,14 @@ const deserializeAws_querySourceIpConditionConfig = (output: any, context: __Ser }; const deserializeAws_querySslPolicies = (output: any, context: __SerdeContext): SslPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_querySslPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySslPolicy(entry, context); + }); }; const deserializeAws_querySslPolicy = (output: any, context: __SerdeContext): SslPolicy => { @@ -7151,7 +7350,14 @@ const deserializeAws_querySSLPolicyNotFoundException = ( }; const deserializeAws_querySslProtocols = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySubnetNotFoundException = (output: any, context: __SerdeContext): SubnetNotFoundException => { @@ -7196,11 +7402,25 @@ const deserializeAws_queryTagDescription = (output: any, context: __SerdeContext }; const deserializeAws_queryTagDescriptions = (output: any, context: __SerdeContext): TagDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryTagDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTagDescription(entry, context); + }); }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTargetDescription = (output: any, context: __SerdeContext): TargetDescription => { @@ -7329,11 +7549,25 @@ const deserializeAws_queryTargetGroupAttribute = (output: any, context: __SerdeC }; const deserializeAws_queryTargetGroupAttributes = (output: any, context: __SerdeContext): TargetGroupAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_queryTargetGroupAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTargetGroupAttribute(entry, context); + }); }; const deserializeAws_queryTargetGroupList = (output: any, context: __SerdeContext): TargetGroupTuple[] => { - return (output || []).map((entry: any) => deserializeAws_queryTargetGroupTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTargetGroupTuple(entry, context); + }); }; const deserializeAws_queryTargetGroupNotFoundException = ( @@ -7350,7 +7584,14 @@ const deserializeAws_queryTargetGroupNotFoundException = ( }; const deserializeAws_queryTargetGroups = (output: any, context: __SerdeContext): TargetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryTargetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTargetGroup(entry, context); + }); }; const deserializeAws_queryTargetGroupStickinessConfig = ( @@ -7424,7 +7665,14 @@ const deserializeAws_queryTargetHealthDescriptions = ( output: any, context: __SerdeContext ): TargetHealthDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryTargetHealthDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTargetHealthDescription(entry, context); + }); }; const deserializeAws_queryTooManyActionsException = (output: any, context: __SerdeContext): TooManyActionsException => { diff --git a/clients/client-elastic-load-balancing/protocols/Aws_query.ts b/clients/client-elastic-load-balancing/protocols/Aws_query.ts index 81a1687d840a..c4743f655e42 100644 --- a/clients/client-elastic-load-balancing/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing/protocols/Aws_query.ts @@ -228,7 +228,7 @@ export const serializeAws_queryAddTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -244,7 +244,7 @@ export const serializeAws_queryApplySecurityGroupsToLoadBalancerCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -260,7 +260,7 @@ export const serializeAws_queryAttachLoadBalancerToSubnetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -276,7 +276,7 @@ export const serializeAws_queryConfigureHealthCheckCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -292,7 +292,7 @@ export const serializeAws_queryCreateAppCookieStickinessPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -308,7 +308,7 @@ export const serializeAws_queryCreateLBCookieStickinessPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -324,7 +324,7 @@ export const serializeAws_queryCreateLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -340,7 +340,7 @@ export const serializeAws_queryCreateLoadBalancerListenersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -356,7 +356,7 @@ export const serializeAws_queryCreateLoadBalancerPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -372,7 +372,7 @@ export const serializeAws_queryDeleteLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -388,7 +388,7 @@ export const serializeAws_queryDeleteLoadBalancerListenersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -404,7 +404,7 @@ export const serializeAws_queryDeleteLoadBalancerPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -420,7 +420,7 @@ export const serializeAws_queryDeregisterInstancesFromLoadBalancerCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -436,7 +436,7 @@ export const serializeAws_queryDescribeAccountLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -452,7 +452,7 @@ export const serializeAws_queryDescribeInstanceHealthCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -468,7 +468,7 @@ export const serializeAws_queryDescribeLoadBalancerAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -484,7 +484,7 @@ export const serializeAws_queryDescribeLoadBalancerPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -500,7 +500,7 @@ export const serializeAws_queryDescribeLoadBalancerPolicyTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -516,7 +516,7 @@ export const serializeAws_queryDescribeLoadBalancersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -532,7 +532,7 @@ export const serializeAws_queryDescribeTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -548,7 +548,7 @@ export const serializeAws_queryDetachLoadBalancerFromSubnetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -564,7 +564,7 @@ export const serializeAws_queryDisableAvailabilityZonesForLoadBalancerCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -580,7 +580,7 @@ export const serializeAws_queryEnableAvailabilityZonesForLoadBalancerCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -596,7 +596,7 @@ export const serializeAws_queryModifyLoadBalancerAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -612,7 +612,7 @@ export const serializeAws_queryRegisterInstancesWithLoadBalancerCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -628,7 +628,7 @@ export const serializeAws_queryRemoveTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -644,7 +644,7 @@ export const serializeAws_querySetLoadBalancerListenerSSLCertificateCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -660,7 +660,7 @@ export const serializeAws_querySetLoadBalancerPoliciesForBackendServerCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -676,7 +676,7 @@ export const serializeAws_querySetLoadBalancerPoliciesOfListenerCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3012,16 +3012,16 @@ const deserializeAws_queryUnsupportedProtocolExceptionResponse = async ( const serializeAws_queryAccessLog = (input: AccessLog, context: __SerdeContext): any => { const entries: any = {}; - if (input.S3BucketPrefix !== undefined) { + if (input.S3BucketPrefix !== undefined && input.S3BucketPrefix !== null) { entries["S3BucketPrefix"] = input.S3BucketPrefix; } - if (input.S3BucketName !== undefined) { + if (input.S3BucketName !== undefined && input.S3BucketName !== null) { entries["S3BucketName"] = input.S3BucketName; } - if (input.EmitInterval !== undefined) { + if (input.EmitInterval !== undefined && input.EmitInterval !== null) { entries["EmitInterval"] = input.EmitInterval; } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -3032,10 +3032,10 @@ const serializeAws_queryAddAvailabilityZonesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; @@ -3047,10 +3047,10 @@ const serializeAws_queryAddAvailabilityZonesInput = ( const serializeAws_queryAdditionalAttribute = (input: AdditionalAttribute, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -3060,6 +3060,9 @@ const serializeAws_queryAdditionalAttributes = (input: AdditionalAttribute[], co const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryAdditionalAttribute(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3071,14 +3074,14 @@ const serializeAws_queryAdditionalAttributes = (input: AdditionalAttribute[], co const serializeAws_queryAddTagsInput = (input: AddTagsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerNames !== undefined) { + if (input.LoadBalancerNames !== undefined && input.LoadBalancerNames !== null) { const memberEntries = serializeAws_queryLoadBalancerNames(input.LoadBalancerNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerNames.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -3093,10 +3096,10 @@ const serializeAws_queryApplySecurityGroupsToLoadBalancerInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_querySecurityGroups(input.SecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroups.${key}`; @@ -3111,14 +3114,14 @@ const serializeAws_queryAttachLoadBalancerToSubnetsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Subnets !== undefined) { + if (input.Subnets !== undefined && input.Subnets !== null) { const memberEntries = serializeAws_querySubnets(input.Subnets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Subnets.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3128,6 +3131,9 @@ const serializeAws_queryAvailabilityZones = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3139,14 +3145,14 @@ const serializeAws_queryConfigureHealthCheckInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HealthCheck !== undefined) { + if (input.HealthCheck !== undefined && input.HealthCheck !== null) { const memberEntries = serializeAws_queryHealthCheck(input.HealthCheck, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `HealthCheck.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3154,10 +3160,10 @@ const serializeAws_queryConfigureHealthCheckInput = ( const serializeAws_queryConnectionDraining = (input: ConnectionDraining, context: __SerdeContext): any => { const entries: any = {}; - if (input.Timeout !== undefined) { + if (input.Timeout !== undefined && input.Timeout !== null) { entries["Timeout"] = input.Timeout; } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -3165,7 +3171,7 @@ const serializeAws_queryConnectionDraining = (input: ConnectionDraining, context const serializeAws_queryConnectionSettings = (input: ConnectionSettings, context: __SerdeContext): any => { const entries: any = {}; - if (input.IdleTimeout !== undefined) { + if (input.IdleTimeout !== undefined && input.IdleTimeout !== null) { entries["IdleTimeout"] = input.IdleTimeout; } return entries; @@ -3173,45 +3179,45 @@ const serializeAws_queryConnectionSettings = (input: ConnectionSettings, context const serializeAws_queryCreateAccessPointInput = (input: CreateAccessPointInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.Subnets !== undefined) { + if (input.Subnets !== undefined && input.Subnets !== null) { const memberEntries = serializeAws_querySubnets(input.Subnets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Subnets.${key}`; entries[loc] = value; }); } - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_querySecurityGroups(input.SecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroups.${key}`; entries[loc] = value; }); } - if (input.Scheme !== undefined) { + if (input.Scheme !== undefined && input.Scheme !== null) { entries["Scheme"] = input.Scheme; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.Listeners !== undefined) { + if (input.Listeners !== undefined && input.Listeners !== null) { const memberEntries = serializeAws_queryListeners(input.Listeners, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Listeners.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3222,13 +3228,13 @@ const serializeAws_queryCreateAppCookieStickinessPolicyInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.CookieName !== undefined) { + if (input.CookieName !== undefined && input.CookieName !== null) { entries["CookieName"] = input.CookieName; } return entries; @@ -3239,13 +3245,13 @@ const serializeAws_queryCreateLBCookieStickinessPolicyInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.CookieExpirationPeriod !== undefined) { + if (input.CookieExpirationPeriod !== undefined && input.CookieExpirationPeriod !== null) { entries["CookieExpirationPeriod"] = input.CookieExpirationPeriod; } return entries; @@ -3256,14 +3262,14 @@ const serializeAws_queryCreateLoadBalancerListenerInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Listeners !== undefined) { + if (input.Listeners !== undefined && input.Listeners !== null) { const memberEntries = serializeAws_queryListeners(input.Listeners, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Listeners.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3274,20 +3280,20 @@ const serializeAws_queryCreateLoadBalancerPolicyInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.PolicyAttributes !== undefined) { + if (input.PolicyAttributes !== undefined && input.PolicyAttributes !== null) { const memberEntries = serializeAws_queryPolicyAttributes(input.PolicyAttributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyAttributes.${key}`; entries[loc] = value; }); } - if (input.PolicyTypeName !== undefined) { + if (input.PolicyTypeName !== undefined && input.PolicyTypeName !== null) { entries["PolicyTypeName"] = input.PolicyTypeName; } return entries; @@ -3295,7 +3301,7 @@ const serializeAws_queryCreateLoadBalancerPolicyInput = ( const serializeAws_queryCrossZoneLoadBalancing = (input: CrossZoneLoadBalancing, context: __SerdeContext): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -3303,7 +3309,7 @@ const serializeAws_queryCrossZoneLoadBalancing = (input: CrossZoneLoadBalancing, const serializeAws_queryDeleteAccessPointInput = (input: DeleteAccessPointInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3314,14 +3320,14 @@ const serializeAws_queryDeleteLoadBalancerListenerInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerPorts !== undefined) { + if (input.LoadBalancerPorts !== undefined && input.LoadBalancerPorts !== null) { const memberEntries = serializeAws_queryPorts(input.LoadBalancerPorts, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerPorts.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3332,10 +3338,10 @@ const serializeAws_queryDeleteLoadBalancerPolicyInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3343,14 +3349,14 @@ const serializeAws_queryDeleteLoadBalancerPolicyInput = ( const serializeAws_queryDeregisterEndPointsInput = (input: DeregisterEndPointsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Instances !== undefined) { + if (input.Instances !== undefined && input.Instances !== null) { const memberEntries = serializeAws_queryInstances(input.Instances, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Instances.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3361,17 +3367,17 @@ const serializeAws_queryDescribeAccessPointsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.LoadBalancerNames !== undefined) { + if (input.LoadBalancerNames !== undefined && input.LoadBalancerNames !== null) { const memberEntries = serializeAws_queryLoadBalancerNames(input.LoadBalancerNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerNames.${key}`; entries[loc] = value; }); } - if (input.PageSize !== undefined) { + if (input.PageSize !== undefined && input.PageSize !== null) { entries["PageSize"] = input.PageSize; } return entries; @@ -3382,10 +3388,10 @@ const serializeAws_queryDescribeAccountLimitsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PageSize !== undefined) { + if (input.PageSize !== undefined && input.PageSize !== null) { entries["PageSize"] = input.PageSize; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -3396,10 +3402,10 @@ const serializeAws_queryDescribeEndPointStateInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.Instances !== undefined) { + if (input.Instances !== undefined && input.Instances !== null) { const memberEntries = serializeAws_queryInstances(input.Instances, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Instances.${key}`; @@ -3414,7 +3420,7 @@ const serializeAws_queryDescribeLoadBalancerAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3425,14 +3431,14 @@ const serializeAws_queryDescribeLoadBalancerPoliciesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyNames !== undefined) { + if (input.PolicyNames !== undefined && input.PolicyNames !== null) { const memberEntries = serializeAws_queryPolicyNames(input.PolicyNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyNames.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3443,7 +3449,7 @@ const serializeAws_queryDescribeLoadBalancerPolicyTypesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyTypeNames !== undefined) { + if (input.PolicyTypeNames !== undefined && input.PolicyTypeNames !== null) { const memberEntries = serializeAws_queryPolicyTypeNames(input.PolicyTypeNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyTypeNames.${key}`; @@ -3455,7 +3461,7 @@ const serializeAws_queryDescribeLoadBalancerPolicyTypesInput = ( const serializeAws_queryDescribeTagsInput = (input: DescribeTagsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerNames !== undefined) { + if (input.LoadBalancerNames !== undefined && input.LoadBalancerNames !== null) { const memberEntries = serializeAws_queryLoadBalancerNamesMax20(input.LoadBalancerNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerNames.${key}`; @@ -3470,10 +3476,10 @@ const serializeAws_queryDetachLoadBalancerFromSubnetsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.Subnets !== undefined) { + if (input.Subnets !== undefined && input.Subnets !== null) { const memberEntries = serializeAws_querySubnets(input.Subnets, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Subnets.${key}`; @@ -3485,19 +3491,19 @@ const serializeAws_queryDetachLoadBalancerFromSubnetsInput = ( const serializeAws_queryHealthCheck = (input: HealthCheck, context: __SerdeContext): any => { const entries: any = {}; - if (input.HealthyThreshold !== undefined) { + if (input.HealthyThreshold !== undefined && input.HealthyThreshold !== null) { entries["HealthyThreshold"] = input.HealthyThreshold; } - if (input.UnhealthyThreshold !== undefined) { + if (input.UnhealthyThreshold !== undefined && input.UnhealthyThreshold !== null) { entries["UnhealthyThreshold"] = input.UnhealthyThreshold; } - if (input.Target !== undefined) { + if (input.Target !== undefined && input.Target !== null) { entries["Target"] = input.Target; } - if (input.Interval !== undefined) { + if (input.Interval !== undefined && input.Interval !== null) { entries["Interval"] = input.Interval; } - if (input.Timeout !== undefined) { + if (input.Timeout !== undefined && input.Timeout !== null) { entries["Timeout"] = input.Timeout; } return entries; @@ -3505,7 +3511,7 @@ const serializeAws_queryHealthCheck = (input: HealthCheck, context: __SerdeConte const serializeAws_queryInstance = (input: Instance, context: __SerdeContext): any => { const entries: any = {}; - if (input.InstanceId !== undefined) { + if (input.InstanceId !== undefined && input.InstanceId !== null) { entries["InstanceId"] = input.InstanceId; } return entries; @@ -3515,6 +3521,9 @@ const serializeAws_queryInstances = (input: Instance[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryInstance(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3526,19 +3535,19 @@ const serializeAws_queryInstances = (input: Instance[], context: __SerdeContext) const serializeAws_queryListener = (input: Listener, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerPort !== undefined) { + if (input.LoadBalancerPort !== undefined && input.LoadBalancerPort !== null) { entries["LoadBalancerPort"] = input.LoadBalancerPort; } - if (input.InstancePort !== undefined) { + if (input.InstancePort !== undefined && input.InstancePort !== null) { entries["InstancePort"] = input.InstancePort; } - if (input.InstanceProtocol !== undefined) { + if (input.InstanceProtocol !== undefined && input.InstanceProtocol !== null) { entries["InstanceProtocol"] = input.InstanceProtocol; } - if (input.SSLCertificateId !== undefined) { + if (input.SSLCertificateId !== undefined && input.SSLCertificateId !== null) { entries["SSLCertificateId"] = input.SSLCertificateId; } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } return entries; @@ -3548,6 +3557,9 @@ const serializeAws_queryListeners = (input: Listener[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryListener(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3559,35 +3571,35 @@ const serializeAws_queryListeners = (input: Listener[], context: __SerdeContext) const serializeAws_queryLoadBalancerAttributes = (input: LoadBalancerAttributes, context: __SerdeContext): any => { const entries: any = {}; - if (input.AccessLog !== undefined) { + if (input.AccessLog !== undefined && input.AccessLog !== null) { const memberEntries = serializeAws_queryAccessLog(input.AccessLog, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AccessLog.${key}`; entries[loc] = value; }); } - if (input.ConnectionSettings !== undefined) { + if (input.ConnectionSettings !== undefined && input.ConnectionSettings !== null) { const memberEntries = serializeAws_queryConnectionSettings(input.ConnectionSettings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConnectionSettings.${key}`; entries[loc] = value; }); } - if (input.AdditionalAttributes !== undefined) { + if (input.AdditionalAttributes !== undefined && input.AdditionalAttributes !== null) { const memberEntries = serializeAws_queryAdditionalAttributes(input.AdditionalAttributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AdditionalAttributes.${key}`; entries[loc] = value; }); } - if (input.CrossZoneLoadBalancing !== undefined) { + if (input.CrossZoneLoadBalancing !== undefined && input.CrossZoneLoadBalancing !== null) { const memberEntries = serializeAws_queryCrossZoneLoadBalancing(input.CrossZoneLoadBalancing, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CrossZoneLoadBalancing.${key}`; entries[loc] = value; }); } - if (input.ConnectionDraining !== undefined) { + if (input.ConnectionDraining !== undefined && input.ConnectionDraining !== null) { const memberEntries = serializeAws_queryConnectionDraining(input.ConnectionDraining, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConnectionDraining.${key}`; @@ -3601,6 +3613,9 @@ const serializeAws_queryLoadBalancerNames = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3611,6 +3626,9 @@ const serializeAws_queryLoadBalancerNamesMax20 = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3622,10 +3640,10 @@ const serializeAws_queryModifyLoadBalancerAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.LoadBalancerAttributes !== undefined) { + if (input.LoadBalancerAttributes !== undefined && input.LoadBalancerAttributes !== null) { const memberEntries = serializeAws_queryLoadBalancerAttributes(input.LoadBalancerAttributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerAttributes.${key}`; @@ -3637,10 +3655,10 @@ const serializeAws_queryModifyLoadBalancerAttributesInput = ( const serializeAws_queryPolicyAttribute = (input: PolicyAttribute, context: __SerdeContext): any => { const entries: any = {}; - if (input.AttributeValue !== undefined) { + if (input.AttributeValue !== undefined && input.AttributeValue !== null) { entries["AttributeValue"] = input.AttributeValue; } - if (input.AttributeName !== undefined) { + if (input.AttributeName !== undefined && input.AttributeName !== null) { entries["AttributeName"] = input.AttributeName; } return entries; @@ -3650,6 +3668,9 @@ const serializeAws_queryPolicyAttributes = (input: PolicyAttribute[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryPolicyAttribute(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3663,6 +3684,9 @@ const serializeAws_queryPolicyNames = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3673,6 +3697,9 @@ const serializeAws_queryPolicyTypeNames = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3683,6 +3710,9 @@ const serializeAws_queryPorts = (input: number[], context: __SerdeContext): any const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3691,14 +3721,14 @@ const serializeAws_queryPorts = (input: number[], context: __SerdeContext): any const serializeAws_queryRegisterEndPointsInput = (input: RegisterEndPointsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Instances !== undefined) { + if (input.Instances !== undefined && input.Instances !== null) { const memberEntries = serializeAws_queryInstances(input.Instances, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Instances.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3709,10 +3739,10 @@ const serializeAws_queryRemoveAvailabilityZonesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; @@ -3724,14 +3754,14 @@ const serializeAws_queryRemoveAvailabilityZonesInput = ( const serializeAws_queryRemoveTagsInput = (input: RemoveTagsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.LoadBalancerNames !== undefined) { + if (input.LoadBalancerNames !== undefined && input.LoadBalancerNames !== null) { const memberEntries = serializeAws_queryLoadBalancerNames(input.LoadBalancerNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LoadBalancerNames.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagKeyList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -3745,6 +3775,9 @@ const serializeAws_querySecurityGroups = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3756,13 +3789,13 @@ const serializeAws_querySetLoadBalancerListenerSSLCertificateInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.LoadBalancerPort !== undefined) { + if (input.LoadBalancerPort !== undefined && input.LoadBalancerPort !== null) { entries["LoadBalancerPort"] = input.LoadBalancerPort; } - if (input.SSLCertificateId !== undefined) { + if (input.SSLCertificateId !== undefined && input.SSLCertificateId !== null) { entries["SSLCertificateId"] = input.SSLCertificateId; } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3773,17 +3806,17 @@ const serializeAws_querySetLoadBalancerPoliciesForBackendServerInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyNames !== undefined) { + if (input.PolicyNames !== undefined && input.PolicyNames !== null) { const memberEntries = serializeAws_queryPolicyNames(input.PolicyNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyNames.${key}`; entries[loc] = value; }); } - if (input.InstancePort !== undefined) { + if (input.InstancePort !== undefined && input.InstancePort !== null) { entries["InstancePort"] = input.InstancePort; } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } return entries; @@ -3794,17 +3827,17 @@ const serializeAws_querySetLoadBalancerPoliciesOfListenerInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyNames !== undefined) { + if (input.PolicyNames !== undefined && input.PolicyNames !== null) { const memberEntries = serializeAws_queryPolicyNames(input.PolicyNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyNames.${key}`; entries[loc] = value; }); } - if (input.LoadBalancerName !== undefined) { + if (input.LoadBalancerName !== undefined && input.LoadBalancerName !== null) { entries["LoadBalancerName"] = input.LoadBalancerName; } - if (input.LoadBalancerPort !== undefined) { + if (input.LoadBalancerPort !== undefined && input.LoadBalancerPort !== null) { entries["LoadBalancerPort"] = input.LoadBalancerPort; } return entries; @@ -3814,6 +3847,9 @@ const serializeAws_querySubnets = (input: string[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3822,10 +3858,10 @@ const serializeAws_querySubnets = (input: string[], context: __SerdeContext): an const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -3835,6 +3871,9 @@ const serializeAws_queryTagKeyList = (input: TagKeyOnly[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTagKeyOnly(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3846,7 +3885,7 @@ const serializeAws_queryTagKeyList = (input: TagKeyOnly[], context: __SerdeConte const serializeAws_queryTagKeyOnly = (input: TagKeyOnly, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } return entries; @@ -3856,6 +3895,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -3934,7 +3976,14 @@ const deserializeAws_queryAdditionalAttribute = (output: any, context: __SerdeCo }; const deserializeAws_queryAdditionalAttributes = (output: any, context: __SerdeContext): AdditionalAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_queryAdditionalAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAdditionalAttribute(entry, context); + }); }; const deserializeAws_queryAddTagsOutput = (output: any, context: __SerdeContext): AddTagsOutput => { @@ -3946,7 +3995,14 @@ const deserializeAws_queryAppCookieStickinessPolicies = ( output: any, context: __SerdeContext ): AppCookieStickinessPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_queryAppCookieStickinessPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAppCookieStickinessPolicy(entry, context); + }); }; const deserializeAws_queryAppCookieStickinessPolicy = ( @@ -4002,7 +4058,14 @@ const deserializeAws_queryAttachLoadBalancerToSubnetsOutput = ( }; const deserializeAws_queryAvailabilityZones = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryBackendServerDescription = ( @@ -4032,7 +4095,14 @@ const deserializeAws_queryBackendServerDescriptions = ( output: any, context: __SerdeContext ): BackendServerDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryBackendServerDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryBackendServerDescription(entry, context); + }); }; const deserializeAws_queryCertificateNotFoundException = ( @@ -4424,7 +4494,14 @@ const deserializeAws_queryInstance = (output: any, context: __SerdeContext): Ins }; const deserializeAws_queryInstances = (output: any, context: __SerdeContext): Instance[] => { - return (output || []).map((entry: any) => deserializeAws_queryInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInstance(entry, context); + }); }; const deserializeAws_queryInstanceState = (output: any, context: __SerdeContext): InstanceState => { @@ -4450,7 +4527,14 @@ const deserializeAws_queryInstanceState = (output: any, context: __SerdeContext) }; const deserializeAws_queryInstanceStates = (output: any, context: __SerdeContext): InstanceState[] => { - return (output || []).map((entry: any) => deserializeAws_queryInstanceState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInstanceState(entry, context); + }); }; const deserializeAws_queryInvalidConfigurationRequestException = ( @@ -4516,7 +4600,14 @@ const deserializeAws_queryLBCookieStickinessPolicies = ( output: any, context: __SerdeContext ): LBCookieStickinessPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_queryLBCookieStickinessPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLBCookieStickinessPolicy(entry, context); + }); }; const deserializeAws_queryLBCookieStickinessPolicy = ( @@ -4551,7 +4642,14 @@ const deserializeAws_queryLimit = (output: any, context: __SerdeContext): Limit }; const deserializeAws_queryLimits = (output: any, context: __SerdeContext): Limit[] => { - return (output || []).map((entry: any) => deserializeAws_queryLimit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLimit(entry, context); + }); }; const deserializeAws_queryListener = (output: any, context: __SerdeContext): Listener => { @@ -4601,7 +4699,14 @@ const deserializeAws_queryListenerDescription = (output: any, context: __SerdeCo }; const deserializeAws_queryListenerDescriptions = (output: any, context: __SerdeContext): ListenerDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryListenerDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryListenerDescription(entry, context); + }); }; const deserializeAws_queryListenerNotFoundException = ( @@ -4772,7 +4877,14 @@ const deserializeAws_queryLoadBalancerDescriptions = ( output: any, context: __SerdeContext ): LoadBalancerDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryLoadBalancerDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryLoadBalancerDescription(entry, context); + }); }; const deserializeAws_queryModifyLoadBalancerAttributesOutput = ( @@ -4871,7 +4983,14 @@ const deserializeAws_queryPolicyAttributeDescriptions = ( output: any, context: __SerdeContext ): PolicyAttributeDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyAttributeDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyAttributeDescription(entry, context); + }); }; const deserializeAws_queryPolicyAttributeTypeDescription = ( @@ -4907,7 +5026,14 @@ const deserializeAws_queryPolicyAttributeTypeDescriptions = ( output: any, context: __SerdeContext ): PolicyAttributeTypeDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyAttributeTypeDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyAttributeTypeDescription(entry, context); + }); }; const deserializeAws_queryPolicyDescription = (output: any, context: __SerdeContext): PolicyDescription => { @@ -4938,11 +5064,25 @@ const deserializeAws_queryPolicyDescription = (output: any, context: __SerdeCont }; const deserializeAws_queryPolicyDescriptions = (output: any, context: __SerdeContext): PolicyDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyDescription(entry, context); + }); }; const deserializeAws_queryPolicyNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryPolicyNotFoundException = (output: any, context: __SerdeContext): PolicyNotFoundException => { @@ -4983,7 +5123,14 @@ const deserializeAws_queryPolicyTypeDescription = (output: any, context: __Serde }; const deserializeAws_queryPolicyTypeDescriptions = (output: any, context: __SerdeContext): PolicyTypeDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyTypeDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyTypeDescription(entry, context); + }); }; const deserializeAws_queryPolicyTypeNotFoundException = ( @@ -5037,7 +5184,14 @@ const deserializeAws_queryRemoveTagsOutput = (output: any, context: __SerdeConte }; const deserializeAws_querySecurityGroups = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySetLoadBalancerListenerSSLCertificateOutput = ( @@ -5089,7 +5243,14 @@ const deserializeAws_querySubnetNotFoundException = (output: any, context: __Ser }; const deserializeAws_querySubnets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { @@ -5124,11 +5285,25 @@ const deserializeAws_queryTagDescription = (output: any, context: __SerdeContext }; const deserializeAws_queryTagDescriptions = (output: any, context: __SerdeContext): TagDescription[] => { - return (output || []).map((entry: any) => deserializeAws_queryTagDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTagDescription(entry, context); + }); }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTooManyAccessPointsException = ( diff --git a/clients/client-elastic-transcoder/protocols/Aws_restJson1.ts b/clients/client-elastic-transcoder/protocols/Aws_restJson1.ts index a7de341ecc89..6e32d7cea9ab 100644 --- a/clients/client-elastic-transcoder/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-transcoder/protocols/Aws_restJson1.ts @@ -77,9 +77,7 @@ export const serializeAws_restJson1CancelJobCommand = async ( input: CancelJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/jobs/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -108,23 +106,26 @@ export const serializeAws_restJson1CreateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2012-09-25/jobs"; let body: any; body = JSON.stringify({ - ...(input.Input !== undefined && { Input: serializeAws_restJson1JobInput(input.Input, context) }), - ...(input.Inputs !== undefined && { Inputs: serializeAws_restJson1JobInputs(input.Inputs, context) }), - ...(input.Output !== undefined && { Output: serializeAws_restJson1CreateJobOutput(input.Output, context) }), - ...(input.OutputKeyPrefix !== undefined && { OutputKeyPrefix: input.OutputKeyPrefix }), - ...(input.Outputs !== undefined && { Outputs: serializeAws_restJson1CreateJobOutputs(input.Outputs, context) }), - ...(input.PipelineId !== undefined && { PipelineId: input.PipelineId }), - ...(input.Playlists !== undefined && { - Playlists: serializeAws_restJson1CreateJobPlaylists(input.Playlists, context), - }), - ...(input.UserMetadata !== undefined && { - UserMetadata: serializeAws_restJson1UserMetadata(input.UserMetadata, context), - }), + ...(input.Input !== undefined && + input.Input !== null && { Input: serializeAws_restJson1JobInput(input.Input, context) }), + ...(input.Inputs !== undefined && + input.Inputs !== null && { Inputs: serializeAws_restJson1JobInputs(input.Inputs, context) }), + ...(input.Output !== undefined && + input.Output !== null && { Output: serializeAws_restJson1CreateJobOutput(input.Output, context) }), + ...(input.OutputKeyPrefix !== undefined && + input.OutputKeyPrefix !== null && { OutputKeyPrefix: input.OutputKeyPrefix }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { Outputs: serializeAws_restJson1CreateJobOutputs(input.Outputs, context) }), + ...(input.PipelineId !== undefined && input.PipelineId !== null && { PipelineId: input.PipelineId }), + ...(input.Playlists !== undefined && + input.Playlists !== null && { Playlists: serializeAws_restJson1CreateJobPlaylists(input.Playlists, context) }), + ...(input.UserMetadata !== undefined && + input.UserMetadata !== null && { UserMetadata: serializeAws_restJson1UserMetadata(input.UserMetadata, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -143,25 +144,28 @@ export const serializeAws_restJson1CreatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2012-09-25/pipelines"; let body: any; body = JSON.stringify({ - ...(input.AwsKmsKeyArn !== undefined && { AwsKmsKeyArn: input.AwsKmsKeyArn }), - ...(input.ContentConfig !== undefined && { - ContentConfig: serializeAws_restJson1PipelineOutputConfig(input.ContentConfig, context), - }), - ...(input.InputBucket !== undefined && { InputBucket: input.InputBucket }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Notifications !== undefined && { - Notifications: serializeAws_restJson1Notifications(input.Notifications, context), - }), - ...(input.OutputBucket !== undefined && { OutputBucket: input.OutputBucket }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.ThumbnailConfig !== undefined && { - ThumbnailConfig: serializeAws_restJson1PipelineOutputConfig(input.ThumbnailConfig, context), - }), + ...(input.AwsKmsKeyArn !== undefined && input.AwsKmsKeyArn !== null && { AwsKmsKeyArn: input.AwsKmsKeyArn }), + ...(input.ContentConfig !== undefined && + input.ContentConfig !== null && { + ContentConfig: serializeAws_restJson1PipelineOutputConfig(input.ContentConfig, context), + }), + ...(input.InputBucket !== undefined && input.InputBucket !== null && { InputBucket: input.InputBucket }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Notifications !== undefined && + input.Notifications !== null && { + Notifications: serializeAws_restJson1Notifications(input.Notifications, context), + }), + ...(input.OutputBucket !== undefined && input.OutputBucket !== null && { OutputBucket: input.OutputBucket }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.ThumbnailConfig !== undefined && + input.ThumbnailConfig !== null && { + ThumbnailConfig: serializeAws_restJson1PipelineOutputConfig(input.ThumbnailConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -180,17 +184,20 @@ export const serializeAws_restJson1CreatePresetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2012-09-25/presets"; let body: any; body = JSON.stringify({ - ...(input.Audio !== undefined && { Audio: serializeAws_restJson1AudioParameters(input.Audio, context) }), - ...(input.Container !== undefined && { Container: input.Container }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Thumbnails !== undefined && { Thumbnails: serializeAws_restJson1Thumbnails(input.Thumbnails, context) }), - ...(input.Video !== undefined && { Video: serializeAws_restJson1VideoParameters(input.Video, context) }), + ...(input.Audio !== undefined && + input.Audio !== null && { Audio: serializeAws_restJson1AudioParameters(input.Audio, context) }), + ...(input.Container !== undefined && input.Container !== null && { Container: input.Container }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Thumbnails !== undefined && + input.Thumbnails !== null && { Thumbnails: serializeAws_restJson1Thumbnails(input.Thumbnails, context) }), + ...(input.Video !== undefined && + input.Video !== null && { Video: serializeAws_restJson1VideoParameters(input.Video, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -208,9 +215,7 @@ export const serializeAws_restJson1DeletePipelineCommand = async ( input: DeletePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/pipelines/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -238,9 +243,7 @@ export const serializeAws_restJson1DeletePresetCommand = async ( input: DeletePresetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/presets/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -268,9 +271,7 @@ export const serializeAws_restJson1ListJobsByPipelineCommand = async ( input: ListJobsByPipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/jobsByPipeline/{PipelineId}"; if (input.PipelineId !== undefined) { const labelValue: string = input.PipelineId; @@ -303,9 +304,7 @@ export const serializeAws_restJson1ListJobsByStatusCommand = async ( input: ListJobsByStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/jobsByStatus/{Status}"; if (input.Status !== undefined) { const labelValue: string = input.Status; @@ -338,9 +337,7 @@ export const serializeAws_restJson1ListPipelinesCommand = async ( input: ListPipelinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/pipelines"; const query: any = { ...(input.Ascending !== undefined && { Ascending: input.Ascending }), @@ -364,9 +361,7 @@ export const serializeAws_restJson1ListPresetsCommand = async ( input: ListPresetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/presets"; const query: any = { ...(input.PageToken !== undefined && { PageToken: input.PageToken }), @@ -390,9 +385,7 @@ export const serializeAws_restJson1ReadJobCommand = async ( input: ReadJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/jobs/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -420,9 +413,7 @@ export const serializeAws_restJson1ReadPipelineCommand = async ( input: ReadPipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/pipelines/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -450,9 +441,7 @@ export const serializeAws_restJson1ReadPresetCommand = async ( input: ReadPresetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2012-09-25/presets/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -481,15 +470,16 @@ export const serializeAws_restJson1TestRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2012-09-25/roleTests"; let body: any; body = JSON.stringify({ - ...(input.InputBucket !== undefined && { InputBucket: input.InputBucket }), - ...(input.OutputBucket !== undefined && { OutputBucket: input.OutputBucket }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Topics !== undefined && { Topics: serializeAws_restJson1SnsTopics(input.Topics, context) }), + ...(input.InputBucket !== undefined && input.InputBucket !== null && { InputBucket: input.InputBucket }), + ...(input.OutputBucket !== undefined && input.OutputBucket !== null && { OutputBucket: input.OutputBucket }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Topics !== undefined && + input.Topics !== null && { Topics: serializeAws_restJson1SnsTopics(input.Topics, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -508,7 +498,7 @@ export const serializeAws_restJson1UpdatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2012-09-25/pipelines/{Id}"; if (input.Id !== undefined) { @@ -522,19 +512,22 @@ export const serializeAws_restJson1UpdatePipelineCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AwsKmsKeyArn !== undefined && { AwsKmsKeyArn: input.AwsKmsKeyArn }), - ...(input.ContentConfig !== undefined && { - ContentConfig: serializeAws_restJson1PipelineOutputConfig(input.ContentConfig, context), - }), - ...(input.InputBucket !== undefined && { InputBucket: input.InputBucket }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Notifications !== undefined && { - Notifications: serializeAws_restJson1Notifications(input.Notifications, context), - }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.ThumbnailConfig !== undefined && { - ThumbnailConfig: serializeAws_restJson1PipelineOutputConfig(input.ThumbnailConfig, context), - }), + ...(input.AwsKmsKeyArn !== undefined && input.AwsKmsKeyArn !== null && { AwsKmsKeyArn: input.AwsKmsKeyArn }), + ...(input.ContentConfig !== undefined && + input.ContentConfig !== null && { + ContentConfig: serializeAws_restJson1PipelineOutputConfig(input.ContentConfig, context), + }), + ...(input.InputBucket !== undefined && input.InputBucket !== null && { InputBucket: input.InputBucket }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Notifications !== undefined && + input.Notifications !== null && { + Notifications: serializeAws_restJson1Notifications(input.Notifications, context), + }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.ThumbnailConfig !== undefined && + input.ThumbnailConfig !== null && { + ThumbnailConfig: serializeAws_restJson1PipelineOutputConfig(input.ThumbnailConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -553,7 +546,7 @@ export const serializeAws_restJson1UpdatePipelineNotificationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2012-09-25/pipelines/{Id}/notifications"; if (input.Id !== undefined) { @@ -567,9 +560,10 @@ export const serializeAws_restJson1UpdatePipelineNotificationsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Notifications !== undefined && { - Notifications: serializeAws_restJson1Notifications(input.Notifications, context), - }), + ...(input.Notifications !== undefined && + input.Notifications !== null && { + Notifications: serializeAws_restJson1Notifications(input.Notifications, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -588,7 +582,7 @@ export const serializeAws_restJson1UpdatePipelineStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2012-09-25/pipelines/{Id}/status"; if (input.Id !== undefined) { @@ -602,7 +596,7 @@ export const serializeAws_restJson1UpdatePipelineStatusCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2279,355 +2273,489 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1AccessControls = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Artwork = (input: Artwork, context: __SerdeContext): any => { return { - ...(input.AlbumArtFormat !== undefined && { AlbumArtFormat: input.AlbumArtFormat }), - ...(input.Encryption !== undefined && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), - ...(input.InputKey !== undefined && { InputKey: input.InputKey }), - ...(input.MaxHeight !== undefined && { MaxHeight: input.MaxHeight }), - ...(input.MaxWidth !== undefined && { MaxWidth: input.MaxWidth }), - ...(input.PaddingPolicy !== undefined && { PaddingPolicy: input.PaddingPolicy }), - ...(input.SizingPolicy !== undefined && { SizingPolicy: input.SizingPolicy }), + ...(input.AlbumArtFormat !== undefined && + input.AlbumArtFormat !== null && { AlbumArtFormat: input.AlbumArtFormat }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), + ...(input.InputKey !== undefined && input.InputKey !== null && { InputKey: input.InputKey }), + ...(input.MaxHeight !== undefined && input.MaxHeight !== null && { MaxHeight: input.MaxHeight }), + ...(input.MaxWidth !== undefined && input.MaxWidth !== null && { MaxWidth: input.MaxWidth }), + ...(input.PaddingPolicy !== undefined && input.PaddingPolicy !== null && { PaddingPolicy: input.PaddingPolicy }), + ...(input.SizingPolicy !== undefined && input.SizingPolicy !== null && { SizingPolicy: input.SizingPolicy }), }; }; const serializeAws_restJson1Artworks = (input: Artwork[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Artwork(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Artwork(entry, context); + }); }; const serializeAws_restJson1AudioCodecOptions = (input: AudioCodecOptions, context: __SerdeContext): any => { return { - ...(input.BitDepth !== undefined && { BitDepth: input.BitDepth }), - ...(input.BitOrder !== undefined && { BitOrder: input.BitOrder }), - ...(input.Profile !== undefined && { Profile: input.Profile }), - ...(input.Signed !== undefined && { Signed: input.Signed }), + ...(input.BitDepth !== undefined && input.BitDepth !== null && { BitDepth: input.BitDepth }), + ...(input.BitOrder !== undefined && input.BitOrder !== null && { BitOrder: input.BitOrder }), + ...(input.Profile !== undefined && input.Profile !== null && { Profile: input.Profile }), + ...(input.Signed !== undefined && input.Signed !== null && { Signed: input.Signed }), }; }; const serializeAws_restJson1AudioParameters = (input: AudioParameters, context: __SerdeContext): any => { return { - ...(input.AudioPackingMode !== undefined && { AudioPackingMode: input.AudioPackingMode }), - ...(input.BitRate !== undefined && { BitRate: input.BitRate }), - ...(input.Channels !== undefined && { Channels: input.Channels }), - ...(input.Codec !== undefined && { Codec: input.Codec }), - ...(input.CodecOptions !== undefined && { - CodecOptions: serializeAws_restJson1AudioCodecOptions(input.CodecOptions, context), - }), - ...(input.SampleRate !== undefined && { SampleRate: input.SampleRate }), + ...(input.AudioPackingMode !== undefined && + input.AudioPackingMode !== null && { AudioPackingMode: input.AudioPackingMode }), + ...(input.BitRate !== undefined && input.BitRate !== null && { BitRate: input.BitRate }), + ...(input.Channels !== undefined && input.Channels !== null && { Channels: input.Channels }), + ...(input.Codec !== undefined && input.Codec !== null && { Codec: input.Codec }), + ...(input.CodecOptions !== undefined && + input.CodecOptions !== null && { + CodecOptions: serializeAws_restJson1AudioCodecOptions(input.CodecOptions, context), + }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { SampleRate: input.SampleRate }), }; }; const serializeAws_restJson1CaptionFormat = (input: CaptionFormat, context: __SerdeContext): any => { return { - ...(input.Encryption !== undefined && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.Pattern !== undefined && { Pattern: input.Pattern }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.Pattern !== undefined && input.Pattern !== null && { Pattern: input.Pattern }), }; }; const serializeAws_restJson1CaptionFormats = (input: CaptionFormat[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CaptionFormat(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CaptionFormat(entry, context); + }); }; const serializeAws_restJson1Captions = (input: Captions, context: __SerdeContext): any => { return { - ...(input.CaptionFormats !== undefined && { - CaptionFormats: serializeAws_restJson1CaptionFormats(input.CaptionFormats, context), - }), - ...(input.CaptionSources !== undefined && { - CaptionSources: serializeAws_restJson1CaptionSources(input.CaptionSources, context), - }), - ...(input.MergePolicy !== undefined && { MergePolicy: input.MergePolicy }), + ...(input.CaptionFormats !== undefined && + input.CaptionFormats !== null && { + CaptionFormats: serializeAws_restJson1CaptionFormats(input.CaptionFormats, context), + }), + ...(input.CaptionSources !== undefined && + input.CaptionSources !== null && { + CaptionSources: serializeAws_restJson1CaptionSources(input.CaptionSources, context), + }), + ...(input.MergePolicy !== undefined && input.MergePolicy !== null && { MergePolicy: input.MergePolicy }), }; }; const serializeAws_restJson1CaptionSource = (input: CaptionSource, context: __SerdeContext): any => { return { - ...(input.Encryption !== undefined && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Label !== undefined && { Label: input.Label }), - ...(input.Language !== undefined && { Language: input.Language }), - ...(input.TimeOffset !== undefined && { TimeOffset: input.TimeOffset }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Label !== undefined && input.Label !== null && { Label: input.Label }), + ...(input.Language !== undefined && input.Language !== null && { Language: input.Language }), + ...(input.TimeOffset !== undefined && input.TimeOffset !== null && { TimeOffset: input.TimeOffset }), }; }; const serializeAws_restJson1CaptionSources = (input: CaptionSource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CaptionSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CaptionSource(entry, context); + }); }; const serializeAws_restJson1Clip = (input: Clip, context: __SerdeContext): any => { return { - ...(input.TimeSpan !== undefined && { TimeSpan: serializeAws_restJson1TimeSpan(input.TimeSpan, context) }), + ...(input.TimeSpan !== undefined && + input.TimeSpan !== null && { TimeSpan: serializeAws_restJson1TimeSpan(input.TimeSpan, context) }), }; }; const serializeAws_restJson1CodecOptions = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Composition = (input: Clip[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Clip(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Clip(entry, context); + }); }; const serializeAws_restJson1CreateJobOutput = (input: CreateJobOutput, context: __SerdeContext): any => { return { - ...(input.AlbumArt !== undefined && { AlbumArt: serializeAws_restJson1JobAlbumArt(input.AlbumArt, context) }), - ...(input.Captions !== undefined && { Captions: serializeAws_restJson1Captions(input.Captions, context) }), - ...(input.Composition !== undefined && { - Composition: serializeAws_restJson1Composition(input.Composition, context), - }), - ...(input.Encryption !== undefined && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.PresetId !== undefined && { PresetId: input.PresetId }), - ...(input.Rotate !== undefined && { Rotate: input.Rotate }), - ...(input.SegmentDuration !== undefined && { SegmentDuration: input.SegmentDuration }), - ...(input.ThumbnailEncryption !== undefined && { - ThumbnailEncryption: serializeAws_restJson1Encryption(input.ThumbnailEncryption, context), - }), - ...(input.ThumbnailPattern !== undefined && { ThumbnailPattern: input.ThumbnailPattern }), - ...(input.Watermarks !== undefined && { - Watermarks: serializeAws_restJson1JobWatermarks(input.Watermarks, context), - }), + ...(input.AlbumArt !== undefined && + input.AlbumArt !== null && { AlbumArt: serializeAws_restJson1JobAlbumArt(input.AlbumArt, context) }), + ...(input.Captions !== undefined && + input.Captions !== null && { Captions: serializeAws_restJson1Captions(input.Captions, context) }), + ...(input.Composition !== undefined && + input.Composition !== null && { Composition: serializeAws_restJson1Composition(input.Composition, context) }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.PresetId !== undefined && input.PresetId !== null && { PresetId: input.PresetId }), + ...(input.Rotate !== undefined && input.Rotate !== null && { Rotate: input.Rotate }), + ...(input.SegmentDuration !== undefined && + input.SegmentDuration !== null && { SegmentDuration: input.SegmentDuration }), + ...(input.ThumbnailEncryption !== undefined && + input.ThumbnailEncryption !== null && { + ThumbnailEncryption: serializeAws_restJson1Encryption(input.ThumbnailEncryption, context), + }), + ...(input.ThumbnailPattern !== undefined && + input.ThumbnailPattern !== null && { ThumbnailPattern: input.ThumbnailPattern }), + ...(input.Watermarks !== undefined && + input.Watermarks !== null && { Watermarks: serializeAws_restJson1JobWatermarks(input.Watermarks, context) }), }; }; const serializeAws_restJson1CreateJobOutputs = (input: CreateJobOutput[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CreateJobOutput(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CreateJobOutput(entry, context); + }); }; const serializeAws_restJson1CreateJobPlaylist = (input: CreateJobPlaylist, context: __SerdeContext): any => { return { - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.HlsContentProtection !== undefined && { - HlsContentProtection: serializeAws_restJson1HlsContentProtection(input.HlsContentProtection, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OutputKeys !== undefined && { OutputKeys: serializeAws_restJson1OutputKeys(input.OutputKeys, context) }), - ...(input.PlayReadyDrm !== undefined && { - PlayReadyDrm: serializeAws_restJson1PlayReadyDrm(input.PlayReadyDrm, context), - }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.HlsContentProtection !== undefined && + input.HlsContentProtection !== null && { + HlsContentProtection: serializeAws_restJson1HlsContentProtection(input.HlsContentProtection, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OutputKeys !== undefined && + input.OutputKeys !== null && { OutputKeys: serializeAws_restJson1OutputKeys(input.OutputKeys, context) }), + ...(input.PlayReadyDrm !== undefined && + input.PlayReadyDrm !== null && { PlayReadyDrm: serializeAws_restJson1PlayReadyDrm(input.PlayReadyDrm, context) }), }; }; const serializeAws_restJson1CreateJobPlaylists = (input: CreateJobPlaylist[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CreateJobPlaylist(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CreateJobPlaylist(entry, context); + }); }; const serializeAws_restJson1DetectedProperties = (input: DetectedProperties, context: __SerdeContext): any => { return { - ...(input.DurationMillis !== undefined && { DurationMillis: input.DurationMillis }), - ...(input.FileSize !== undefined && { FileSize: input.FileSize }), - ...(input.FrameRate !== undefined && { FrameRate: input.FrameRate }), - ...(input.Height !== undefined && { Height: input.Height }), - ...(input.Width !== undefined && { Width: input.Width }), + ...(input.DurationMillis !== undefined && + input.DurationMillis !== null && { DurationMillis: input.DurationMillis }), + ...(input.FileSize !== undefined && input.FileSize !== null && { FileSize: input.FileSize }), + ...(input.FrameRate !== undefined && input.FrameRate !== null && { FrameRate: input.FrameRate }), + ...(input.Height !== undefined && input.Height !== null && { Height: input.Height }), + ...(input.Width !== undefined && input.Width !== null && { Width: input.Width }), }; }; const serializeAws_restJson1Encryption = (input: Encryption, context: __SerdeContext): any => { return { - ...(input.InitializationVector !== undefined && { InitializationVector: input.InitializationVector }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.KeyMd5 !== undefined && { KeyMd5: input.KeyMd5 }), - ...(input.Mode !== undefined && { Mode: input.Mode }), + ...(input.InitializationVector !== undefined && + input.InitializationVector !== null && { InitializationVector: input.InitializationVector }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.KeyMd5 !== undefined && input.KeyMd5 !== null && { KeyMd5: input.KeyMd5 }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), }; }; const serializeAws_restJson1HlsContentProtection = (input: HlsContentProtection, context: __SerdeContext): any => { return { - ...(input.InitializationVector !== undefined && { InitializationVector: input.InitializationVector }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.KeyMd5 !== undefined && { KeyMd5: input.KeyMd5 }), - ...(input.KeyStoragePolicy !== undefined && { KeyStoragePolicy: input.KeyStoragePolicy }), - ...(input.LicenseAcquisitionUrl !== undefined && { LicenseAcquisitionUrl: input.LicenseAcquisitionUrl }), - ...(input.Method !== undefined && { Method: input.Method }), + ...(input.InitializationVector !== undefined && + input.InitializationVector !== null && { InitializationVector: input.InitializationVector }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.KeyMd5 !== undefined && input.KeyMd5 !== null && { KeyMd5: input.KeyMd5 }), + ...(input.KeyStoragePolicy !== undefined && + input.KeyStoragePolicy !== null && { KeyStoragePolicy: input.KeyStoragePolicy }), + ...(input.LicenseAcquisitionUrl !== undefined && + input.LicenseAcquisitionUrl !== null && { LicenseAcquisitionUrl: input.LicenseAcquisitionUrl }), + ...(input.Method !== undefined && input.Method !== null && { Method: input.Method }), }; }; const serializeAws_restJson1InputCaptions = (input: InputCaptions, context: __SerdeContext): any => { return { - ...(input.CaptionSources !== undefined && { - CaptionSources: serializeAws_restJson1CaptionSources(input.CaptionSources, context), - }), - ...(input.MergePolicy !== undefined && { MergePolicy: input.MergePolicy }), + ...(input.CaptionSources !== undefined && + input.CaptionSources !== null && { + CaptionSources: serializeAws_restJson1CaptionSources(input.CaptionSources, context), + }), + ...(input.MergePolicy !== undefined && input.MergePolicy !== null && { MergePolicy: input.MergePolicy }), }; }; const serializeAws_restJson1JobAlbumArt = (input: JobAlbumArt, context: __SerdeContext): any => { return { - ...(input.Artwork !== undefined && { Artwork: serializeAws_restJson1Artworks(input.Artwork, context) }), - ...(input.MergePolicy !== undefined && { MergePolicy: input.MergePolicy }), + ...(input.Artwork !== undefined && + input.Artwork !== null && { Artwork: serializeAws_restJson1Artworks(input.Artwork, context) }), + ...(input.MergePolicy !== undefined && input.MergePolicy !== null && { MergePolicy: input.MergePolicy }), }; }; const serializeAws_restJson1JobInput = (input: JobInput, context: __SerdeContext): any => { return { - ...(input.AspectRatio !== undefined && { AspectRatio: input.AspectRatio }), - ...(input.Container !== undefined && { Container: input.Container }), - ...(input.DetectedProperties !== undefined && { - DetectedProperties: serializeAws_restJson1DetectedProperties(input.DetectedProperties, context), - }), - ...(input.Encryption !== undefined && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), - ...(input.FrameRate !== undefined && { FrameRate: input.FrameRate }), - ...(input.InputCaptions !== undefined && { - InputCaptions: serializeAws_restJson1InputCaptions(input.InputCaptions, context), - }), - ...(input.Interlaced !== undefined && { Interlaced: input.Interlaced }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Resolution !== undefined && { Resolution: input.Resolution }), - ...(input.TimeSpan !== undefined && { TimeSpan: serializeAws_restJson1TimeSpan(input.TimeSpan, context) }), + ...(input.AspectRatio !== undefined && input.AspectRatio !== null && { AspectRatio: input.AspectRatio }), + ...(input.Container !== undefined && input.Container !== null && { Container: input.Container }), + ...(input.DetectedProperties !== undefined && + input.DetectedProperties !== null && { + DetectedProperties: serializeAws_restJson1DetectedProperties(input.DetectedProperties, context), + }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), + ...(input.FrameRate !== undefined && input.FrameRate !== null && { FrameRate: input.FrameRate }), + ...(input.InputCaptions !== undefined && + input.InputCaptions !== null && { + InputCaptions: serializeAws_restJson1InputCaptions(input.InputCaptions, context), + }), + ...(input.Interlaced !== undefined && input.Interlaced !== null && { Interlaced: input.Interlaced }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Resolution !== undefined && input.Resolution !== null && { Resolution: input.Resolution }), + ...(input.TimeSpan !== undefined && + input.TimeSpan !== null && { TimeSpan: serializeAws_restJson1TimeSpan(input.TimeSpan, context) }), }; }; const serializeAws_restJson1JobInputs = (input: JobInput[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1JobInput(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1JobInput(entry, context); + }); }; const serializeAws_restJson1JobWatermark = (input: JobWatermark, context: __SerdeContext): any => { return { - ...(input.Encryption !== undefined && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), - ...(input.InputKey !== undefined && { InputKey: input.InputKey }), - ...(input.PresetWatermarkId !== undefined && { PresetWatermarkId: input.PresetWatermarkId }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), + ...(input.InputKey !== undefined && input.InputKey !== null && { InputKey: input.InputKey }), + ...(input.PresetWatermarkId !== undefined && + input.PresetWatermarkId !== null && { PresetWatermarkId: input.PresetWatermarkId }), }; }; const serializeAws_restJson1JobWatermarks = (input: JobWatermark[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1JobWatermark(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1JobWatermark(entry, context); + }); }; const serializeAws_restJson1Notifications = (input: Notifications, context: __SerdeContext): any => { return { - ...(input.Completed !== undefined && { Completed: input.Completed }), - ...(input.Error !== undefined && { Error: input.Error }), - ...(input.Progressing !== undefined && { Progressing: input.Progressing }), - ...(input.Warning !== undefined && { Warning: input.Warning }), + ...(input.Completed !== undefined && input.Completed !== null && { Completed: input.Completed }), + ...(input.Error !== undefined && input.Error !== null && { Error: input.Error }), + ...(input.Progressing !== undefined && input.Progressing !== null && { Progressing: input.Progressing }), + ...(input.Warning !== undefined && input.Warning !== null && { Warning: input.Warning }), }; }; const serializeAws_restJson1OutputKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Permission = (input: Permission, context: __SerdeContext): any => { return { - ...(input.Access !== undefined && { Access: serializeAws_restJson1AccessControls(input.Access, context) }), - ...(input.Grantee !== undefined && { Grantee: input.Grantee }), - ...(input.GranteeType !== undefined && { GranteeType: input.GranteeType }), + ...(input.Access !== undefined && + input.Access !== null && { Access: serializeAws_restJson1AccessControls(input.Access, context) }), + ...(input.Grantee !== undefined && input.Grantee !== null && { Grantee: input.Grantee }), + ...(input.GranteeType !== undefined && input.GranteeType !== null && { GranteeType: input.GranteeType }), }; }; const serializeAws_restJson1Permissions = (input: Permission[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Permission(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Permission(entry, context); + }); }; const serializeAws_restJson1PipelineOutputConfig = (input: PipelineOutputConfig, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_restJson1Permissions(input.Permissions, context), - }), - ...(input.StorageClass !== undefined && { StorageClass: input.StorageClass }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { Permissions: serializeAws_restJson1Permissions(input.Permissions, context) }), + ...(input.StorageClass !== undefined && input.StorageClass !== null && { StorageClass: input.StorageClass }), }; }; const serializeAws_restJson1PlayReadyDrm = (input: PlayReadyDrm, context: __SerdeContext): any => { return { - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.InitializationVector !== undefined && { InitializationVector: input.InitializationVector }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.KeyMd5 !== undefined && { KeyMd5: input.KeyMd5 }), - ...(input.LicenseAcquisitionUrl !== undefined && { LicenseAcquisitionUrl: input.LicenseAcquisitionUrl }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.InitializationVector !== undefined && + input.InitializationVector !== null && { InitializationVector: input.InitializationVector }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.KeyMd5 !== undefined && input.KeyMd5 !== null && { KeyMd5: input.KeyMd5 }), + ...(input.LicenseAcquisitionUrl !== undefined && + input.LicenseAcquisitionUrl !== null && { LicenseAcquisitionUrl: input.LicenseAcquisitionUrl }), }; }; const serializeAws_restJson1PresetWatermark = (input: PresetWatermark, context: __SerdeContext): any => { return { - ...(input.HorizontalAlign !== undefined && { HorizontalAlign: input.HorizontalAlign }), - ...(input.HorizontalOffset !== undefined && { HorizontalOffset: input.HorizontalOffset }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.MaxHeight !== undefined && { MaxHeight: input.MaxHeight }), - ...(input.MaxWidth !== undefined && { MaxWidth: input.MaxWidth }), - ...(input.Opacity !== undefined && { Opacity: input.Opacity }), - ...(input.SizingPolicy !== undefined && { SizingPolicy: input.SizingPolicy }), - ...(input.Target !== undefined && { Target: input.Target }), - ...(input.VerticalAlign !== undefined && { VerticalAlign: input.VerticalAlign }), - ...(input.VerticalOffset !== undefined && { VerticalOffset: input.VerticalOffset }), + ...(input.HorizontalAlign !== undefined && + input.HorizontalAlign !== null && { HorizontalAlign: input.HorizontalAlign }), + ...(input.HorizontalOffset !== undefined && + input.HorizontalOffset !== null && { HorizontalOffset: input.HorizontalOffset }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.MaxHeight !== undefined && input.MaxHeight !== null && { MaxHeight: input.MaxHeight }), + ...(input.MaxWidth !== undefined && input.MaxWidth !== null && { MaxWidth: input.MaxWidth }), + ...(input.Opacity !== undefined && input.Opacity !== null && { Opacity: input.Opacity }), + ...(input.SizingPolicy !== undefined && input.SizingPolicy !== null && { SizingPolicy: input.SizingPolicy }), + ...(input.Target !== undefined && input.Target !== null && { Target: input.Target }), + ...(input.VerticalAlign !== undefined && input.VerticalAlign !== null && { VerticalAlign: input.VerticalAlign }), + ...(input.VerticalOffset !== undefined && + input.VerticalOffset !== null && { VerticalOffset: input.VerticalOffset }), }; }; const serializeAws_restJson1PresetWatermarks = (input: PresetWatermark[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1PresetWatermark(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1PresetWatermark(entry, context); + }); }; const serializeAws_restJson1SnsTopics = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Thumbnails = (input: Thumbnails, context: __SerdeContext): any => { return { - ...(input.AspectRatio !== undefined && { AspectRatio: input.AspectRatio }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.Interval !== undefined && { Interval: input.Interval }), - ...(input.MaxHeight !== undefined && { MaxHeight: input.MaxHeight }), - ...(input.MaxWidth !== undefined && { MaxWidth: input.MaxWidth }), - ...(input.PaddingPolicy !== undefined && { PaddingPolicy: input.PaddingPolicy }), - ...(input.Resolution !== undefined && { Resolution: input.Resolution }), - ...(input.SizingPolicy !== undefined && { SizingPolicy: input.SizingPolicy }), + ...(input.AspectRatio !== undefined && input.AspectRatio !== null && { AspectRatio: input.AspectRatio }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.Interval !== undefined && input.Interval !== null && { Interval: input.Interval }), + ...(input.MaxHeight !== undefined && input.MaxHeight !== null && { MaxHeight: input.MaxHeight }), + ...(input.MaxWidth !== undefined && input.MaxWidth !== null && { MaxWidth: input.MaxWidth }), + ...(input.PaddingPolicy !== undefined && input.PaddingPolicy !== null && { PaddingPolicy: input.PaddingPolicy }), + ...(input.Resolution !== undefined && input.Resolution !== null && { Resolution: input.Resolution }), + ...(input.SizingPolicy !== undefined && input.SizingPolicy !== null && { SizingPolicy: input.SizingPolicy }), }; }; const serializeAws_restJson1TimeSpan = (input: TimeSpan, context: __SerdeContext): any => { return { - ...(input.Duration !== undefined && { Duration: input.Duration }), - ...(input.StartTime !== undefined && { StartTime: input.StartTime }), + ...(input.Duration !== undefined && input.Duration !== null && { Duration: input.Duration }), + ...(input.StartTime !== undefined && input.StartTime !== null && { StartTime: input.StartTime }), }; }; const serializeAws_restJson1UserMetadata = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1VideoParameters = (input: VideoParameters, context: __SerdeContext): any => { return { - ...(input.AspectRatio !== undefined && { AspectRatio: input.AspectRatio }), - ...(input.BitRate !== undefined && { BitRate: input.BitRate }), - ...(input.Codec !== undefined && { Codec: input.Codec }), - ...(input.CodecOptions !== undefined && { - CodecOptions: serializeAws_restJson1CodecOptions(input.CodecOptions, context), - }), - ...(input.DisplayAspectRatio !== undefined && { DisplayAspectRatio: input.DisplayAspectRatio }), - ...(input.FixedGOP !== undefined && { FixedGOP: input.FixedGOP }), - ...(input.FrameRate !== undefined && { FrameRate: input.FrameRate }), - ...(input.KeyframesMaxDist !== undefined && { KeyframesMaxDist: input.KeyframesMaxDist }), - ...(input.MaxFrameRate !== undefined && { MaxFrameRate: input.MaxFrameRate }), - ...(input.MaxHeight !== undefined && { MaxHeight: input.MaxHeight }), - ...(input.MaxWidth !== undefined && { MaxWidth: input.MaxWidth }), - ...(input.PaddingPolicy !== undefined && { PaddingPolicy: input.PaddingPolicy }), - ...(input.Resolution !== undefined && { Resolution: input.Resolution }), - ...(input.SizingPolicy !== undefined && { SizingPolicy: input.SizingPolicy }), - ...(input.Watermarks !== undefined && { - Watermarks: serializeAws_restJson1PresetWatermarks(input.Watermarks, context), - }), + ...(input.AspectRatio !== undefined && input.AspectRatio !== null && { AspectRatio: input.AspectRatio }), + ...(input.BitRate !== undefined && input.BitRate !== null && { BitRate: input.BitRate }), + ...(input.Codec !== undefined && input.Codec !== null && { Codec: input.Codec }), + ...(input.CodecOptions !== undefined && + input.CodecOptions !== null && { CodecOptions: serializeAws_restJson1CodecOptions(input.CodecOptions, context) }), + ...(input.DisplayAspectRatio !== undefined && + input.DisplayAspectRatio !== null && { DisplayAspectRatio: input.DisplayAspectRatio }), + ...(input.FixedGOP !== undefined && input.FixedGOP !== null && { FixedGOP: input.FixedGOP }), + ...(input.FrameRate !== undefined && input.FrameRate !== null && { FrameRate: input.FrameRate }), + ...(input.KeyframesMaxDist !== undefined && + input.KeyframesMaxDist !== null && { KeyframesMaxDist: input.KeyframesMaxDist }), + ...(input.MaxFrameRate !== undefined && input.MaxFrameRate !== null && { MaxFrameRate: input.MaxFrameRate }), + ...(input.MaxHeight !== undefined && input.MaxHeight !== null && { MaxHeight: input.MaxHeight }), + ...(input.MaxWidth !== undefined && input.MaxWidth !== null && { MaxWidth: input.MaxWidth }), + ...(input.PaddingPolicy !== undefined && input.PaddingPolicy !== null && { PaddingPolicy: input.PaddingPolicy }), + ...(input.Resolution !== undefined && input.Resolution !== null && { Resolution: input.Resolution }), + ...(input.SizingPolicy !== undefined && input.SizingPolicy !== null && { SizingPolicy: input.SizingPolicy }), + ...(input.Watermarks !== undefined && + input.Watermarks !== null && { Watermarks: serializeAws_restJson1PresetWatermarks(input.Watermarks, context) }), }; }; const deserializeAws_restJson1AccessControls = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Artwork = (output: any, context: __SerdeContext): Artwork => { @@ -2648,7 +2776,14 @@ const deserializeAws_restJson1Artwork = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Artworks = (output: any, context: __SerdeContext): Artwork[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Artwork(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Artwork(entry, context); + }); }; const deserializeAws_restJson1AudioCodecOptions = (output: any, context: __SerdeContext): AudioCodecOptions => { @@ -2687,7 +2822,14 @@ const deserializeAws_restJson1CaptionFormat = (output: any, context: __SerdeCont }; const deserializeAws_restJson1CaptionFormats = (output: any, context: __SerdeContext): CaptionFormat[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CaptionFormat(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CaptionFormat(entry, context); + }); }; const deserializeAws_restJson1Captions = (output: any, context: __SerdeContext): Captions => { @@ -2718,7 +2860,14 @@ const deserializeAws_restJson1CaptionSource = (output: any, context: __SerdeCont }; const deserializeAws_restJson1CaptionSources = (output: any, context: __SerdeContext): CaptionSource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CaptionSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CaptionSource(entry, context); + }); }; const deserializeAws_restJson1Clip = (output: any, context: __SerdeContext): Clip => { @@ -2731,17 +2880,26 @@ const deserializeAws_restJson1Clip = (output: any, context: __SerdeContext): Cli }; const deserializeAws_restJson1CodecOptions = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Composition = (output: any, context: __SerdeContext): Clip[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Clip(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Clip(entry, context); + }); }; const deserializeAws_restJson1DetectedProperties = (output: any, context: __SerdeContext): DetectedProperties => { @@ -2768,7 +2926,14 @@ const deserializeAws_restJson1Encryption = (output: any, context: __SerdeContext }; const deserializeAws_restJson1ExceptionMessages = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1HlsContentProtection = (output: any, context: __SerdeContext): HlsContentProtection => { @@ -2876,7 +3041,14 @@ const deserializeAws_restJson1JobInput = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1JobInputs = (output: any, context: __SerdeContext): JobInput[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobInput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobInput(entry, context); + }); }; const deserializeAws_restJson1JobOutput = (output: any, context: __SerdeContext): JobOutput => { @@ -2930,11 +3102,25 @@ const deserializeAws_restJson1JobOutput = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1JobOutputs = (output: any, context: __SerdeContext): JobOutput[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobOutput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobOutput(entry, context); + }); }; const deserializeAws_restJson1Jobs = (output: any, context: __SerdeContext): Job[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Job(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Job(entry, context); + }); }; const deserializeAws_restJson1JobWatermark = (output: any, context: __SerdeContext): JobWatermark => { @@ -2952,7 +3138,14 @@ const deserializeAws_restJson1JobWatermark = (output: any, context: __SerdeConte }; const deserializeAws_restJson1JobWatermarks = (output: any, context: __SerdeContext): JobWatermark[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobWatermark(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobWatermark(entry, context); + }); }; const deserializeAws_restJson1Notifications = (output: any, context: __SerdeContext): Notifications => { @@ -2965,7 +3158,14 @@ const deserializeAws_restJson1Notifications = (output: any, context: __SerdeCont }; const deserializeAws_restJson1OutputKeys = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Permission = (output: any, context: __SerdeContext): Permission => { @@ -2980,7 +3180,14 @@ const deserializeAws_restJson1Permission = (output: any, context: __SerdeContext }; const deserializeAws_restJson1Permissions = (output: any, context: __SerdeContext): Permission[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Permission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Permission(entry, context); + }); }; const deserializeAws_restJson1Pipeline = (output: any, context: __SerdeContext): Pipeline => { @@ -3020,7 +3227,14 @@ const deserializeAws_restJson1PipelineOutputConfig = (output: any, context: __Se }; const deserializeAws_restJson1Pipelines = (output: any, context: __SerdeContext): Pipeline[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Pipeline(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Pipeline(entry, context); + }); }; const deserializeAws_restJson1Playlist = (output: any, context: __SerdeContext): Playlist => { @@ -3045,7 +3259,14 @@ const deserializeAws_restJson1Playlist = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Playlists = (output: any, context: __SerdeContext): Playlist[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Playlist(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Playlist(entry, context); + }); }; const deserializeAws_restJson1PlayReadyDrm = (output: any, context: __SerdeContext): PlayReadyDrm => { @@ -3089,7 +3310,14 @@ const deserializeAws_restJson1Preset = (output: any, context: __SerdeContext): P }; const deserializeAws_restJson1Presets = (output: any, context: __SerdeContext): Preset[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Preset(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Preset(entry, context); + }); }; const deserializeAws_restJson1PresetWatermark = (output: any, context: __SerdeContext): PresetWatermark => { @@ -3112,7 +3340,14 @@ const deserializeAws_restJson1PresetWatermark = (output: any, context: __SerdeCo }; const deserializeAws_restJson1PresetWatermarks = (output: any, context: __SerdeContext): PresetWatermark[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PresetWatermark(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PresetWatermark(entry, context); + }); }; const deserializeAws_restJson1Thumbnails = (output: any, context: __SerdeContext): Thumbnails => { @@ -3148,13 +3383,15 @@ const deserializeAws_restJson1Timing = (output: any, context: __SerdeContext): T }; const deserializeAws_restJson1UserMetadata = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1VideoParameters = (output: any, context: __SerdeContext): VideoParameters => { @@ -3196,7 +3433,14 @@ const deserializeAws_restJson1Warning = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Warnings = (output: any, context: __SerdeContext): Warning[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Warning(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Warning(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -3219,6 +3463,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-elasticache/protocols/Aws_query.ts b/clients/client-elasticache/protocols/Aws_query.ts index 13bf21bf3309..f4c0182af230 100644 --- a/clients/client-elasticache/protocols/Aws_query.ts +++ b/clients/client-elasticache/protocols/Aws_query.ts @@ -461,7 +461,7 @@ export const serializeAws_queryAddTagsToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -477,7 +477,7 @@ export const serializeAws_queryAuthorizeCacheSecurityGroupIngressCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -493,7 +493,7 @@ export const serializeAws_queryBatchApplyUpdateActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -509,7 +509,7 @@ export const serializeAws_queryBatchStopUpdateActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -525,7 +525,7 @@ export const serializeAws_queryCompleteMigrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -541,7 +541,7 @@ export const serializeAws_queryCopySnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -557,7 +557,7 @@ export const serializeAws_queryCreateCacheClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -573,7 +573,7 @@ export const serializeAws_queryCreateCacheParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -589,7 +589,7 @@ export const serializeAws_queryCreateCacheSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -605,7 +605,7 @@ export const serializeAws_queryCreateCacheSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -621,7 +621,7 @@ export const serializeAws_queryCreateGlobalReplicationGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -637,7 +637,7 @@ export const serializeAws_queryCreateReplicationGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -653,7 +653,7 @@ export const serializeAws_queryCreateSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -669,7 +669,7 @@ export const serializeAws_queryCreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -685,7 +685,7 @@ export const serializeAws_queryCreateUserGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -701,7 +701,7 @@ export const serializeAws_queryDecreaseNodeGroupsInGlobalReplicationGroupCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -717,7 +717,7 @@ export const serializeAws_queryDecreaseReplicaCountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -733,7 +733,7 @@ export const serializeAws_queryDeleteCacheClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -749,7 +749,7 @@ export const serializeAws_queryDeleteCacheParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -765,7 +765,7 @@ export const serializeAws_queryDeleteCacheSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -781,7 +781,7 @@ export const serializeAws_queryDeleteCacheSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -797,7 +797,7 @@ export const serializeAws_queryDeleteGlobalReplicationGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -813,7 +813,7 @@ export const serializeAws_queryDeleteReplicationGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -829,7 +829,7 @@ export const serializeAws_queryDeleteSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -845,7 +845,7 @@ export const serializeAws_queryDeleteUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -861,7 +861,7 @@ export const serializeAws_queryDeleteUserGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -877,7 +877,7 @@ export const serializeAws_queryDescribeCacheClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -893,7 +893,7 @@ export const serializeAws_queryDescribeCacheEngineVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -909,7 +909,7 @@ export const serializeAws_queryDescribeCacheParameterGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -925,7 +925,7 @@ export const serializeAws_queryDescribeCacheParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -941,7 +941,7 @@ export const serializeAws_queryDescribeCacheSecurityGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -957,7 +957,7 @@ export const serializeAws_queryDescribeCacheSubnetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -973,7 +973,7 @@ export const serializeAws_queryDescribeEngineDefaultParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -989,7 +989,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1005,7 +1005,7 @@ export const serializeAws_queryDescribeGlobalReplicationGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1021,7 +1021,7 @@ export const serializeAws_queryDescribeReplicationGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1037,7 +1037,7 @@ export const serializeAws_queryDescribeReservedCacheNodesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1053,7 +1053,7 @@ export const serializeAws_queryDescribeReservedCacheNodesOfferingsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1069,7 +1069,7 @@ export const serializeAws_queryDescribeServiceUpdatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1085,7 +1085,7 @@ export const serializeAws_queryDescribeSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1101,7 +1101,7 @@ export const serializeAws_queryDescribeUpdateActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1117,7 +1117,7 @@ export const serializeAws_queryDescribeUserGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1133,7 +1133,7 @@ export const serializeAws_queryDescribeUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1149,7 +1149,7 @@ export const serializeAws_queryDisassociateGlobalReplicationGroupCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1165,7 +1165,7 @@ export const serializeAws_queryFailoverGlobalReplicationGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1181,7 +1181,7 @@ export const serializeAws_queryIncreaseNodeGroupsInGlobalReplicationGroupCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1197,7 +1197,7 @@ export const serializeAws_queryIncreaseReplicaCountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1213,7 +1213,7 @@ export const serializeAws_queryListAllowedNodeTypeModificationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1229,7 +1229,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1245,7 +1245,7 @@ export const serializeAws_queryModifyCacheClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1261,7 +1261,7 @@ export const serializeAws_queryModifyCacheParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1277,7 +1277,7 @@ export const serializeAws_queryModifyCacheSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1293,7 +1293,7 @@ export const serializeAws_queryModifyGlobalReplicationGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1309,7 +1309,7 @@ export const serializeAws_queryModifyReplicationGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1325,7 +1325,7 @@ export const serializeAws_queryModifyReplicationGroupShardConfigurationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1341,7 +1341,7 @@ export const serializeAws_queryModifyUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1357,7 +1357,7 @@ export const serializeAws_queryModifyUserGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1373,7 +1373,7 @@ export const serializeAws_queryPurchaseReservedCacheNodesOfferingCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1389,7 +1389,7 @@ export const serializeAws_queryRebalanceSlotsInGlobalReplicationGroupCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1405,7 +1405,7 @@ export const serializeAws_queryRebootCacheClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1421,7 +1421,7 @@ export const serializeAws_queryRemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1437,7 +1437,7 @@ export const serializeAws_queryResetCacheParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1453,7 +1453,7 @@ export const serializeAws_queryRevokeCacheSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1469,7 +1469,7 @@ export const serializeAws_queryStartMigrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1485,7 +1485,7 @@ export const serializeAws_queryTestFailoverCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -8067,10 +8067,10 @@ const deserializeAws_queryUserQuotaExceededFaultResponse = async ( const serializeAws_queryAddTagsToResourceMessage = (input: AddTagsToResourceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -8085,13 +8085,13 @@ const serializeAws_queryAuthorizeCacheSecurityGroupIngressMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheSecurityGroupName !== undefined) { + if (input.CacheSecurityGroupName !== undefined && input.CacheSecurityGroupName !== null) { entries["CacheSecurityGroupName"] = input.CacheSecurityGroupName; } - if (input.EC2SecurityGroupName !== undefined) { + if (input.EC2SecurityGroupName !== undefined && input.EC2SecurityGroupName !== null) { entries["EC2SecurityGroupName"] = input.EC2SecurityGroupName; } - if (input.EC2SecurityGroupOwnerId !== undefined) { + if (input.EC2SecurityGroupOwnerId !== undefined && input.EC2SecurityGroupOwnerId !== null) { entries["EC2SecurityGroupOwnerId"] = input.EC2SecurityGroupOwnerId; } return entries; @@ -8101,6 +8101,9 @@ const serializeAws_queryAvailabilityZonesList = (input: string[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AvailabilityZone.${counter}`] = entry; counter++; } @@ -8112,21 +8115,21 @@ const serializeAws_queryBatchApplyUpdateActionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplicationGroupIds !== undefined) { + if (input.ReplicationGroupIds !== undefined && input.ReplicationGroupIds !== null) { const memberEntries = serializeAws_queryReplicationGroupIdList(input.ReplicationGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplicationGroupIds.${key}`; entries[loc] = value; }); } - if (input.CacheClusterIds !== undefined) { + if (input.CacheClusterIds !== undefined && input.CacheClusterIds !== null) { const memberEntries = serializeAws_queryCacheClusterIdList(input.CacheClusterIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CacheClusterIds.${key}`; entries[loc] = value; }); } - if (input.ServiceUpdateName !== undefined) { + if (input.ServiceUpdateName !== undefined && input.ServiceUpdateName !== null) { entries["ServiceUpdateName"] = input.ServiceUpdateName; } return entries; @@ -8137,21 +8140,21 @@ const serializeAws_queryBatchStopUpdateActionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplicationGroupIds !== undefined) { + if (input.ReplicationGroupIds !== undefined && input.ReplicationGroupIds !== null) { const memberEntries = serializeAws_queryReplicationGroupIdList(input.ReplicationGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplicationGroupIds.${key}`; entries[loc] = value; }); } - if (input.CacheClusterIds !== undefined) { + if (input.CacheClusterIds !== undefined && input.CacheClusterIds !== null) { const memberEntries = serializeAws_queryCacheClusterIdList(input.CacheClusterIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CacheClusterIds.${key}`; entries[loc] = value; }); } - if (input.ServiceUpdateName !== undefined) { + if (input.ServiceUpdateName !== undefined && input.ServiceUpdateName !== null) { entries["ServiceUpdateName"] = input.ServiceUpdateName; } return entries; @@ -8161,6 +8164,9 @@ const serializeAws_queryCacheClusterIdList = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -8171,6 +8177,9 @@ const serializeAws_queryCacheNodeIdsList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`CacheNodeId.${counter}`] = entry; counter++; } @@ -8181,6 +8190,9 @@ const serializeAws_queryCacheSecurityGroupNameList = (input: string[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`CacheSecurityGroupName.${counter}`] = entry; counter++; } @@ -8189,10 +8201,10 @@ const serializeAws_queryCacheSecurityGroupNameList = (input: string[], context: const serializeAws_queryCompleteMigrationMessage = (input: CompleteMigrationMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.Force !== undefined) { + if (input.Force !== undefined && input.Force !== null) { entries["Force"] = input.Force; } return entries; @@ -8200,20 +8212,20 @@ const serializeAws_queryCompleteMigrationMessage = (input: CompleteMigrationMess const serializeAws_queryConfigureShard = (input: ConfigureShard, context: __SerdeContext): any => { const entries: any = {}; - if (input.NodeGroupId !== undefined) { + if (input.NodeGroupId !== undefined && input.NodeGroupId !== null) { entries["NodeGroupId"] = input.NodeGroupId; } - if (input.NewReplicaCount !== undefined) { + if (input.NewReplicaCount !== undefined && input.NewReplicaCount !== null) { entries["NewReplicaCount"] = input.NewReplicaCount; } - if (input.PreferredAvailabilityZones !== undefined) { + if (input.PreferredAvailabilityZones !== undefined && input.PreferredAvailabilityZones !== null) { const memberEntries = serializeAws_queryPreferredAvailabilityZoneList(input.PreferredAvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PreferredAvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.PreferredOutpostArns !== undefined) { + if (input.PreferredOutpostArns !== undefined && input.PreferredOutpostArns !== null) { const memberEntries = serializeAws_queryPreferredOutpostArnList(input.PreferredOutpostArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PreferredOutpostArns.${key}`; @@ -8225,16 +8237,16 @@ const serializeAws_queryConfigureShard = (input: ConfigureShard, context: __Serd const serializeAws_queryCopySnapshotMessage = (input: CopySnapshotMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SourceSnapshotName !== undefined) { + if (input.SourceSnapshotName !== undefined && input.SourceSnapshotName !== null) { entries["SourceSnapshotName"] = input.SourceSnapshotName; } - if (input.TargetSnapshotName !== undefined) { + if (input.TargetSnapshotName !== undefined && input.TargetSnapshotName !== null) { entries["TargetSnapshotName"] = input.TargetSnapshotName; } - if (input.TargetBucket !== undefined) { + if (input.TargetBucket !== undefined && input.TargetBucket !== null) { entries["TargetBucket"] = input.TargetBucket; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } return entries; @@ -8245,102 +8257,102 @@ const serializeAws_queryCreateCacheClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheClusterId !== undefined) { + if (input.CacheClusterId !== undefined && input.CacheClusterId !== null) { entries["CacheClusterId"] = input.CacheClusterId; } - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.AZMode !== undefined) { + if (input.AZMode !== undefined && input.AZMode !== null) { entries["AZMode"] = input.AZMode; } - if (input.PreferredAvailabilityZone !== undefined) { + if (input.PreferredAvailabilityZone !== undefined && input.PreferredAvailabilityZone !== null) { entries["PreferredAvailabilityZone"] = input.PreferredAvailabilityZone; } - if (input.PreferredAvailabilityZones !== undefined) { + if (input.PreferredAvailabilityZones !== undefined && input.PreferredAvailabilityZones !== null) { const memberEntries = serializeAws_queryPreferredAvailabilityZoneList(input.PreferredAvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PreferredAvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.NumCacheNodes !== undefined) { + if (input.NumCacheNodes !== undefined && input.NumCacheNodes !== null) { entries["NumCacheNodes"] = input.NumCacheNodes; } - if (input.CacheNodeType !== undefined) { + if (input.CacheNodeType !== undefined && input.CacheNodeType !== null) { entries["CacheNodeType"] = input.CacheNodeType; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } - if (input.CacheSubnetGroupName !== undefined) { + if (input.CacheSubnetGroupName !== undefined && input.CacheSubnetGroupName !== null) { entries["CacheSubnetGroupName"] = input.CacheSubnetGroupName; } - if (input.CacheSecurityGroupNames !== undefined) { + if (input.CacheSecurityGroupNames !== undefined && input.CacheSecurityGroupNames !== null) { const memberEntries = serializeAws_queryCacheSecurityGroupNameList(input.CacheSecurityGroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CacheSecurityGroupNames.${key}`; entries[loc] = value; }); } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_querySecurityGroupIdsList(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.SnapshotArns !== undefined) { + if (input.SnapshotArns !== undefined && input.SnapshotArns !== null) { const memberEntries = serializeAws_querySnapshotArnsList(input.SnapshotArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SnapshotArns.${key}`; entries[loc] = value; }); } - if (input.SnapshotName !== undefined) { + if (input.SnapshotName !== undefined && input.SnapshotName !== null) { entries["SnapshotName"] = input.SnapshotName; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.NotificationTopicArn !== undefined) { + if (input.NotificationTopicArn !== undefined && input.NotificationTopicArn !== null) { entries["NotificationTopicArn"] = input.NotificationTopicArn; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.SnapshotRetentionLimit !== undefined) { + if (input.SnapshotRetentionLimit !== undefined && input.SnapshotRetentionLimit !== null) { entries["SnapshotRetentionLimit"] = input.SnapshotRetentionLimit; } - if (input.SnapshotWindow !== undefined) { + if (input.SnapshotWindow !== undefined && input.SnapshotWindow !== null) { entries["SnapshotWindow"] = input.SnapshotWindow; } - if (input.AuthToken !== undefined) { + if (input.AuthToken !== undefined && input.AuthToken !== null) { entries["AuthToken"] = input.AuthToken; } - if (input.OutpostMode !== undefined) { + if (input.OutpostMode !== undefined && input.OutpostMode !== null) { entries["OutpostMode"] = input.OutpostMode; } - if (input.PreferredOutpostArn !== undefined) { + if (input.PreferredOutpostArn !== undefined && input.PreferredOutpostArn !== null) { entries["PreferredOutpostArn"] = input.PreferredOutpostArn; } - if (input.PreferredOutpostArns !== undefined) { + if (input.PreferredOutpostArns !== undefined && input.PreferredOutpostArns !== null) { const memberEntries = serializeAws_queryPreferredOutpostArnList(input.PreferredOutpostArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PreferredOutpostArns.${key}`; @@ -8355,13 +8367,13 @@ const serializeAws_queryCreateCacheParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } - if (input.CacheParameterGroupFamily !== undefined) { + if (input.CacheParameterGroupFamily !== undefined && input.CacheParameterGroupFamily !== null) { entries["CacheParameterGroupFamily"] = input.CacheParameterGroupFamily; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -8372,10 +8384,10 @@ const serializeAws_queryCreateCacheSecurityGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheSecurityGroupName !== undefined) { + if (input.CacheSecurityGroupName !== undefined && input.CacheSecurityGroupName !== null) { entries["CacheSecurityGroupName"] = input.CacheSecurityGroupName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -8386,13 +8398,13 @@ const serializeAws_queryCreateCacheSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheSubnetGroupName !== undefined) { + if (input.CacheSubnetGroupName !== undefined && input.CacheSubnetGroupName !== null) { entries["CacheSubnetGroupName"] = input.CacheSubnetGroupName; } - if (input.CacheSubnetGroupDescription !== undefined) { + if (input.CacheSubnetGroupDescription !== undefined && input.CacheSubnetGroupDescription !== null) { entries["CacheSubnetGroupDescription"] = input.CacheSubnetGroupDescription; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; @@ -8407,13 +8419,13 @@ const serializeAws_queryCreateGlobalReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalReplicationGroupIdSuffix !== undefined) { + if (input.GlobalReplicationGroupIdSuffix !== undefined && input.GlobalReplicationGroupIdSuffix !== null) { entries["GlobalReplicationGroupIdSuffix"] = input.GlobalReplicationGroupIdSuffix; } - if (input.GlobalReplicationGroupDescription !== undefined) { + if (input.GlobalReplicationGroupDescription !== undefined && input.GlobalReplicationGroupDescription !== null) { entries["GlobalReplicationGroupDescription"] = input.GlobalReplicationGroupDescription; } - if (input.PrimaryReplicationGroupId !== undefined) { + if (input.PrimaryReplicationGroupId !== undefined && input.PrimaryReplicationGroupId !== null) { entries["PrimaryReplicationGroupId"] = input.PrimaryReplicationGroupId; } return entries; @@ -8424,124 +8436,124 @@ const serializeAws_queryCreateReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.ReplicationGroupDescription !== undefined) { + if (input.ReplicationGroupDescription !== undefined && input.ReplicationGroupDescription !== null) { entries["ReplicationGroupDescription"] = input.ReplicationGroupDescription; } - if (input.GlobalReplicationGroupId !== undefined) { + if (input.GlobalReplicationGroupId !== undefined && input.GlobalReplicationGroupId !== null) { entries["GlobalReplicationGroupId"] = input.GlobalReplicationGroupId; } - if (input.PrimaryClusterId !== undefined) { + if (input.PrimaryClusterId !== undefined && input.PrimaryClusterId !== null) { entries["PrimaryClusterId"] = input.PrimaryClusterId; } - if (input.AutomaticFailoverEnabled !== undefined) { + if (input.AutomaticFailoverEnabled !== undefined && input.AutomaticFailoverEnabled !== null) { entries["AutomaticFailoverEnabled"] = input.AutomaticFailoverEnabled; } - if (input.MultiAZEnabled !== undefined) { + if (input.MultiAZEnabled !== undefined && input.MultiAZEnabled !== null) { entries["MultiAZEnabled"] = input.MultiAZEnabled; } - if (input.NumCacheClusters !== undefined) { + if (input.NumCacheClusters !== undefined && input.NumCacheClusters !== null) { entries["NumCacheClusters"] = input.NumCacheClusters; } - if (input.PreferredCacheClusterAZs !== undefined) { + if (input.PreferredCacheClusterAZs !== undefined && input.PreferredCacheClusterAZs !== null) { const memberEntries = serializeAws_queryAvailabilityZonesList(input.PreferredCacheClusterAZs, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PreferredCacheClusterAZs.${key}`; entries[loc] = value; }); } - if (input.NumNodeGroups !== undefined) { + if (input.NumNodeGroups !== undefined && input.NumNodeGroups !== null) { entries["NumNodeGroups"] = input.NumNodeGroups; } - if (input.ReplicasPerNodeGroup !== undefined) { + if (input.ReplicasPerNodeGroup !== undefined && input.ReplicasPerNodeGroup !== null) { entries["ReplicasPerNodeGroup"] = input.ReplicasPerNodeGroup; } - if (input.NodeGroupConfiguration !== undefined) { + if (input.NodeGroupConfiguration !== undefined && input.NodeGroupConfiguration !== null) { const memberEntries = serializeAws_queryNodeGroupConfigurationList(input.NodeGroupConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NodeGroupConfiguration.${key}`; entries[loc] = value; }); } - if (input.CacheNodeType !== undefined) { + if (input.CacheNodeType !== undefined && input.CacheNodeType !== null) { entries["CacheNodeType"] = input.CacheNodeType; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } - if (input.CacheSubnetGroupName !== undefined) { + if (input.CacheSubnetGroupName !== undefined && input.CacheSubnetGroupName !== null) { entries["CacheSubnetGroupName"] = input.CacheSubnetGroupName; } - if (input.CacheSecurityGroupNames !== undefined) { + if (input.CacheSecurityGroupNames !== undefined && input.CacheSecurityGroupNames !== null) { const memberEntries = serializeAws_queryCacheSecurityGroupNameList(input.CacheSecurityGroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CacheSecurityGroupNames.${key}`; entries[loc] = value; }); } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_querySecurityGroupIdsList(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.SnapshotArns !== undefined) { + if (input.SnapshotArns !== undefined && input.SnapshotArns !== null) { const memberEntries = serializeAws_querySnapshotArnsList(input.SnapshotArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SnapshotArns.${key}`; entries[loc] = value; }); } - if (input.SnapshotName !== undefined) { + if (input.SnapshotName !== undefined && input.SnapshotName !== null) { entries["SnapshotName"] = input.SnapshotName; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.NotificationTopicArn !== undefined) { + if (input.NotificationTopicArn !== undefined && input.NotificationTopicArn !== null) { entries["NotificationTopicArn"] = input.NotificationTopicArn; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.SnapshotRetentionLimit !== undefined) { + if (input.SnapshotRetentionLimit !== undefined && input.SnapshotRetentionLimit !== null) { entries["SnapshotRetentionLimit"] = input.SnapshotRetentionLimit; } - if (input.SnapshotWindow !== undefined) { + if (input.SnapshotWindow !== undefined && input.SnapshotWindow !== null) { entries["SnapshotWindow"] = input.SnapshotWindow; } - if (input.AuthToken !== undefined) { + if (input.AuthToken !== undefined && input.AuthToken !== null) { entries["AuthToken"] = input.AuthToken; } - if (input.TransitEncryptionEnabled !== undefined) { + if (input.TransitEncryptionEnabled !== undefined && input.TransitEncryptionEnabled !== null) { entries["TransitEncryptionEnabled"] = input.TransitEncryptionEnabled; } - if (input.AtRestEncryptionEnabled !== undefined) { + if (input.AtRestEncryptionEnabled !== undefined && input.AtRestEncryptionEnabled !== null) { entries["AtRestEncryptionEnabled"] = input.AtRestEncryptionEnabled; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.UserGroupIds !== undefined) { + if (input.UserGroupIds !== undefined && input.UserGroupIds !== null) { const memberEntries = serializeAws_queryUserGroupIdListInput(input.UserGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserGroupIds.${key}`; @@ -8553,16 +8565,16 @@ const serializeAws_queryCreateReplicationGroupMessage = ( const serializeAws_queryCreateSnapshotMessage = (input: CreateSnapshotMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.CacheClusterId !== undefined) { + if (input.CacheClusterId !== undefined && input.CacheClusterId !== null) { entries["CacheClusterId"] = input.CacheClusterId; } - if (input.SnapshotName !== undefined) { + if (input.SnapshotName !== undefined && input.SnapshotName !== null) { entries["SnapshotName"] = input.SnapshotName; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } return entries; @@ -8570,13 +8582,13 @@ const serializeAws_queryCreateSnapshotMessage = (input: CreateSnapshotMessage, c const serializeAws_queryCreateUserGroupMessage = (input: CreateUserGroupMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserGroupId !== undefined) { + if (input.UserGroupId !== undefined && input.UserGroupId !== null) { entries["UserGroupId"] = input.UserGroupId; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.UserIds !== undefined) { + if (input.UserIds !== undefined && input.UserIds !== null) { const memberEntries = serializeAws_queryUserIdListInput(input.UserIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserIds.${key}`; @@ -8588,26 +8600,26 @@ const serializeAws_queryCreateUserGroupMessage = (input: CreateUserGroupMessage, const serializeAws_queryCreateUserMessage = (input: CreateUserMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserId !== undefined) { + if (input.UserId !== undefined && input.UserId !== null) { entries["UserId"] = input.UserId; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.Passwords !== undefined) { + if (input.Passwords !== undefined && input.Passwords !== null) { const memberEntries = serializeAws_queryPasswordListInput(input.Passwords, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Passwords.${key}`; entries[loc] = value; }); } - if (input.AccessString !== undefined) { + if (input.AccessString !== undefined && input.AccessString !== null) { entries["AccessString"] = input.AccessString; } - if (input.NoPasswordRequired !== undefined) { + if (input.NoPasswordRequired !== undefined && input.NoPasswordRequired !== null) { entries["NoPasswordRequired"] = input.NoPasswordRequired; } return entries; @@ -8615,10 +8627,10 @@ const serializeAws_queryCreateUserMessage = (input: CreateUserMessage, context: const serializeAws_queryCustomerNodeEndpoint = (input: CustomerNodeEndpoint, context: __SerdeContext): any => { const entries: any = {}; - if (input.Address !== undefined) { + if (input.Address !== undefined && input.Address !== null) { entries["Address"] = input.Address; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } return entries; @@ -8628,6 +8640,9 @@ const serializeAws_queryCustomerNodeEndpointList = (input: CustomerNodeEndpoint[ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryCustomerNodeEndpoint(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -8642,27 +8657,27 @@ const serializeAws_queryDecreaseNodeGroupsInGlobalReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalReplicationGroupId !== undefined) { + if (input.GlobalReplicationGroupId !== undefined && input.GlobalReplicationGroupId !== null) { entries["GlobalReplicationGroupId"] = input.GlobalReplicationGroupId; } - if (input.NodeGroupCount !== undefined) { + if (input.NodeGroupCount !== undefined && input.NodeGroupCount !== null) { entries["NodeGroupCount"] = input.NodeGroupCount; } - if (input.GlobalNodeGroupsToRemove !== undefined) { + if (input.GlobalNodeGroupsToRemove !== undefined && input.GlobalNodeGroupsToRemove !== null) { const memberEntries = serializeAws_queryGlobalNodeGroupIdList(input.GlobalNodeGroupsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GlobalNodeGroupsToRemove.${key}`; entries[loc] = value; }); } - if (input.GlobalNodeGroupsToRetain !== undefined) { + if (input.GlobalNodeGroupsToRetain !== undefined && input.GlobalNodeGroupsToRetain !== null) { const memberEntries = serializeAws_queryGlobalNodeGroupIdList(input.GlobalNodeGroupsToRetain, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `GlobalNodeGroupsToRetain.${key}`; entries[loc] = value; }); } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } return entries; @@ -8673,27 +8688,27 @@ const serializeAws_queryDecreaseReplicaCountMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.NewReplicaCount !== undefined) { + if (input.NewReplicaCount !== undefined && input.NewReplicaCount !== null) { entries["NewReplicaCount"] = input.NewReplicaCount; } - if (input.ReplicaConfiguration !== undefined) { + if (input.ReplicaConfiguration !== undefined && input.ReplicaConfiguration !== null) { const memberEntries = serializeAws_queryReplicaConfigurationList(input.ReplicaConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplicaConfiguration.${key}`; entries[loc] = value; }); } - if (input.ReplicasToRemove !== undefined) { + if (input.ReplicasToRemove !== undefined && input.ReplicasToRemove !== null) { const memberEntries = serializeAws_queryRemoveReplicasList(input.ReplicasToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplicasToRemove.${key}`; entries[loc] = value; }); } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } return entries; @@ -8704,10 +8719,10 @@ const serializeAws_queryDeleteCacheClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheClusterId !== undefined) { + if (input.CacheClusterId !== undefined && input.CacheClusterId !== null) { entries["CacheClusterId"] = input.CacheClusterId; } - if (input.FinalSnapshotIdentifier !== undefined) { + if (input.FinalSnapshotIdentifier !== undefined && input.FinalSnapshotIdentifier !== null) { entries["FinalSnapshotIdentifier"] = input.FinalSnapshotIdentifier; } return entries; @@ -8718,7 +8733,7 @@ const serializeAws_queryDeleteCacheParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } return entries; @@ -8729,7 +8744,7 @@ const serializeAws_queryDeleteCacheSecurityGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheSecurityGroupName !== undefined) { + if (input.CacheSecurityGroupName !== undefined && input.CacheSecurityGroupName !== null) { entries["CacheSecurityGroupName"] = input.CacheSecurityGroupName; } return entries; @@ -8740,7 +8755,7 @@ const serializeAws_queryDeleteCacheSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheSubnetGroupName !== undefined) { + if (input.CacheSubnetGroupName !== undefined && input.CacheSubnetGroupName !== null) { entries["CacheSubnetGroupName"] = input.CacheSubnetGroupName; } return entries; @@ -8751,10 +8766,10 @@ const serializeAws_queryDeleteGlobalReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalReplicationGroupId !== undefined) { + if (input.GlobalReplicationGroupId !== undefined && input.GlobalReplicationGroupId !== null) { entries["GlobalReplicationGroupId"] = input.GlobalReplicationGroupId; } - if (input.RetainPrimaryReplicationGroup !== undefined) { + if (input.RetainPrimaryReplicationGroup !== undefined && input.RetainPrimaryReplicationGroup !== null) { entries["RetainPrimaryReplicationGroup"] = input.RetainPrimaryReplicationGroup; } return entries; @@ -8765,13 +8780,13 @@ const serializeAws_queryDeleteReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.RetainPrimaryCluster !== undefined) { + if (input.RetainPrimaryCluster !== undefined && input.RetainPrimaryCluster !== null) { entries["RetainPrimaryCluster"] = input.RetainPrimaryCluster; } - if (input.FinalSnapshotIdentifier !== undefined) { + if (input.FinalSnapshotIdentifier !== undefined && input.FinalSnapshotIdentifier !== null) { entries["FinalSnapshotIdentifier"] = input.FinalSnapshotIdentifier; } return entries; @@ -8779,7 +8794,7 @@ const serializeAws_queryDeleteReplicationGroupMessage = ( const serializeAws_queryDeleteSnapshotMessage = (input: DeleteSnapshotMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SnapshotName !== undefined) { + if (input.SnapshotName !== undefined && input.SnapshotName !== null) { entries["SnapshotName"] = input.SnapshotName; } return entries; @@ -8787,7 +8802,7 @@ const serializeAws_queryDeleteSnapshotMessage = (input: DeleteSnapshotMessage, c const serializeAws_queryDeleteUserGroupMessage = (input: DeleteUserGroupMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserGroupId !== undefined) { + if (input.UserGroupId !== undefined && input.UserGroupId !== null) { entries["UserGroupId"] = input.UserGroupId; } return entries; @@ -8795,7 +8810,7 @@ const serializeAws_queryDeleteUserGroupMessage = (input: DeleteUserGroupMessage, const serializeAws_queryDeleteUserMessage = (input: DeleteUserMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserId !== undefined) { + if (input.UserId !== undefined && input.UserId !== null) { entries["UserId"] = input.UserId; } return entries; @@ -8806,19 +8821,22 @@ const serializeAws_queryDescribeCacheClustersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheClusterId !== undefined) { + if (input.CacheClusterId !== undefined && input.CacheClusterId !== null) { entries["CacheClusterId"] = input.CacheClusterId; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.ShowCacheNodeInfo !== undefined) { + if (input.ShowCacheNodeInfo !== undefined && input.ShowCacheNodeInfo !== null) { entries["ShowCacheNodeInfo"] = input.ShowCacheNodeInfo; } - if (input.ShowCacheClustersNotInReplicationGroups !== undefined) { + if ( + input.ShowCacheClustersNotInReplicationGroups !== undefined && + input.ShowCacheClustersNotInReplicationGroups !== null + ) { entries["ShowCacheClustersNotInReplicationGroups"] = input.ShowCacheClustersNotInReplicationGroups; } return entries; @@ -8829,22 +8847,22 @@ const serializeAws_queryDescribeCacheEngineVersionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.CacheParameterGroupFamily !== undefined) { + if (input.CacheParameterGroupFamily !== undefined && input.CacheParameterGroupFamily !== null) { entries["CacheParameterGroupFamily"] = input.CacheParameterGroupFamily; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.DefaultOnly !== undefined) { + if (input.DefaultOnly !== undefined && input.DefaultOnly !== null) { entries["DefaultOnly"] = input.DefaultOnly; } return entries; @@ -8855,13 +8873,13 @@ const serializeAws_queryDescribeCacheParameterGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8872,16 +8890,16 @@ const serializeAws_queryDescribeCacheParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8892,13 +8910,13 @@ const serializeAws_queryDescribeCacheSecurityGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheSecurityGroupName !== undefined) { + if (input.CacheSecurityGroupName !== undefined && input.CacheSecurityGroupName !== null) { entries["CacheSecurityGroupName"] = input.CacheSecurityGroupName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8909,13 +8927,13 @@ const serializeAws_queryDescribeCacheSubnetGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheSubnetGroupName !== undefined) { + if (input.CacheSubnetGroupName !== undefined && input.CacheSubnetGroupName !== null) { entries["CacheSubnetGroupName"] = input.CacheSubnetGroupName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8926,13 +8944,13 @@ const serializeAws_queryDescribeEngineDefaultParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheParameterGroupFamily !== undefined) { + if (input.CacheParameterGroupFamily !== undefined && input.CacheParameterGroupFamily !== null) { entries["CacheParameterGroupFamily"] = input.CacheParameterGroupFamily; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8940,25 +8958,25 @@ const serializeAws_queryDescribeEngineDefaultParametersMessage = ( const serializeAws_queryDescribeEventsMessage = (input: DescribeEventsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SourceIdentifier !== undefined) { + if (input.SourceIdentifier !== undefined && input.SourceIdentifier !== null) { entries["SourceIdentifier"] = input.SourceIdentifier; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Duration !== undefined) { + if (input.Duration !== undefined && input.Duration !== null) { entries["Duration"] = input.Duration; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8969,16 +8987,16 @@ const serializeAws_queryDescribeGlobalReplicationGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalReplicationGroupId !== undefined) { + if (input.GlobalReplicationGroupId !== undefined && input.GlobalReplicationGroupId !== null) { entries["GlobalReplicationGroupId"] = input.GlobalReplicationGroupId; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.ShowMemberInfo !== undefined) { + if (input.ShowMemberInfo !== undefined && input.ShowMemberInfo !== null) { entries["ShowMemberInfo"] = input.ShowMemberInfo; } return entries; @@ -8989,13 +9007,13 @@ const serializeAws_queryDescribeReplicationGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -9006,28 +9024,28 @@ const serializeAws_queryDescribeReservedCacheNodesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedCacheNodeId !== undefined) { + if (input.ReservedCacheNodeId !== undefined && input.ReservedCacheNodeId !== null) { entries["ReservedCacheNodeId"] = input.ReservedCacheNodeId; } - if (input.ReservedCacheNodesOfferingId !== undefined) { + if (input.ReservedCacheNodesOfferingId !== undefined && input.ReservedCacheNodesOfferingId !== null) { entries["ReservedCacheNodesOfferingId"] = input.ReservedCacheNodesOfferingId; } - if (input.CacheNodeType !== undefined) { + if (input.CacheNodeType !== undefined && input.CacheNodeType !== null) { entries["CacheNodeType"] = input.CacheNodeType; } - if (input.Duration !== undefined) { + if (input.Duration !== undefined && input.Duration !== null) { entries["Duration"] = input.Duration; } - if (input.ProductDescription !== undefined) { + if (input.ProductDescription !== undefined && input.ProductDescription !== null) { entries["ProductDescription"] = input.ProductDescription; } - if (input.OfferingType !== undefined) { + if (input.OfferingType !== undefined && input.OfferingType !== null) { entries["OfferingType"] = input.OfferingType; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -9038,25 +9056,25 @@ const serializeAws_queryDescribeReservedCacheNodesOfferingsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedCacheNodesOfferingId !== undefined) { + if (input.ReservedCacheNodesOfferingId !== undefined && input.ReservedCacheNodesOfferingId !== null) { entries["ReservedCacheNodesOfferingId"] = input.ReservedCacheNodesOfferingId; } - if (input.CacheNodeType !== undefined) { + if (input.CacheNodeType !== undefined && input.CacheNodeType !== null) { entries["CacheNodeType"] = input.CacheNodeType; } - if (input.Duration !== undefined) { + if (input.Duration !== undefined && input.Duration !== null) { entries["Duration"] = input.Duration; } - if (input.ProductDescription !== undefined) { + if (input.ProductDescription !== undefined && input.ProductDescription !== null) { entries["ProductDescription"] = input.ProductDescription; } - if (input.OfferingType !== undefined) { + if (input.OfferingType !== undefined && input.OfferingType !== null) { entries["OfferingType"] = input.OfferingType; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -9067,20 +9085,20 @@ const serializeAws_queryDescribeServiceUpdatesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ServiceUpdateName !== undefined) { + if (input.ServiceUpdateName !== undefined && input.ServiceUpdateName !== null) { entries["ServiceUpdateName"] = input.ServiceUpdateName; } - if (input.ServiceUpdateStatus !== undefined) { + if (input.ServiceUpdateStatus !== undefined && input.ServiceUpdateStatus !== null) { const memberEntries = serializeAws_queryServiceUpdateStatusList(input.ServiceUpdateStatus, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ServiceUpdateStatus.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -9088,25 +9106,25 @@ const serializeAws_queryDescribeServiceUpdatesMessage = ( const serializeAws_queryDescribeSnapshotsMessage = (input: DescribeSnapshotsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.CacheClusterId !== undefined) { + if (input.CacheClusterId !== undefined && input.CacheClusterId !== null) { entries["CacheClusterId"] = input.CacheClusterId; } - if (input.SnapshotName !== undefined) { + if (input.SnapshotName !== undefined && input.SnapshotName !== null) { entries["SnapshotName"] = input.SnapshotName; } - if (input.SnapshotSource !== undefined) { + if (input.SnapshotSource !== undefined && input.SnapshotSource !== null) { entries["SnapshotSource"] = input.SnapshotSource; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.ShowNodeGroupConfig !== undefined) { + if (input.ShowNodeGroupConfig !== undefined && input.ShowNodeGroupConfig !== null) { entries["ShowNodeGroupConfig"] = input.ShowNodeGroupConfig; } return entries; @@ -9117,54 +9135,54 @@ const serializeAws_queryDescribeUpdateActionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ServiceUpdateName !== undefined) { + if (input.ServiceUpdateName !== undefined && input.ServiceUpdateName !== null) { entries["ServiceUpdateName"] = input.ServiceUpdateName; } - if (input.ReplicationGroupIds !== undefined) { + if (input.ReplicationGroupIds !== undefined && input.ReplicationGroupIds !== null) { const memberEntries = serializeAws_queryReplicationGroupIdList(input.ReplicationGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplicationGroupIds.${key}`; entries[loc] = value; }); } - if (input.CacheClusterIds !== undefined) { + if (input.CacheClusterIds !== undefined && input.CacheClusterIds !== null) { const memberEntries = serializeAws_queryCacheClusterIdList(input.CacheClusterIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CacheClusterIds.${key}`; entries[loc] = value; }); } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.ServiceUpdateStatus !== undefined) { + if (input.ServiceUpdateStatus !== undefined && input.ServiceUpdateStatus !== null) { const memberEntries = serializeAws_queryServiceUpdateStatusList(input.ServiceUpdateStatus, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ServiceUpdateStatus.${key}`; entries[loc] = value; }); } - if (input.ServiceUpdateTimeRange !== undefined) { + if (input.ServiceUpdateTimeRange !== undefined && input.ServiceUpdateTimeRange !== null) { const memberEntries = serializeAws_queryTimeRangeFilter(input.ServiceUpdateTimeRange, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ServiceUpdateTimeRange.${key}`; entries[loc] = value; }); } - if (input.UpdateActionStatus !== undefined) { + if (input.UpdateActionStatus !== undefined && input.UpdateActionStatus !== null) { const memberEntries = serializeAws_queryUpdateActionStatusList(input.UpdateActionStatus, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UpdateActionStatus.${key}`; entries[loc] = value; }); } - if (input.ShowNodeLevelUpdateStatus !== undefined) { + if (input.ShowNodeLevelUpdateStatus !== undefined && input.ShowNodeLevelUpdateStatus !== null) { entries["ShowNodeLevelUpdateStatus"] = input.ShowNodeLevelUpdateStatus; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -9175,13 +9193,13 @@ const serializeAws_queryDescribeUserGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserGroupId !== undefined) { + if (input.UserGroupId !== undefined && input.UserGroupId !== null) { entries["UserGroupId"] = input.UserGroupId; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -9189,23 +9207,23 @@ const serializeAws_queryDescribeUserGroupsMessage = ( const serializeAws_queryDescribeUsersMessage = (input: DescribeUsersMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.UserId !== undefined) { + if (input.UserId !== undefined && input.UserId !== null) { entries["UserId"] = input.UserId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -9216,13 +9234,13 @@ const serializeAws_queryDisassociateGlobalReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalReplicationGroupId !== undefined) { + if (input.GlobalReplicationGroupId !== undefined && input.GlobalReplicationGroupId !== null) { entries["GlobalReplicationGroupId"] = input.GlobalReplicationGroupId; } - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.ReplicationGroupRegion !== undefined) { + if (input.ReplicationGroupRegion !== undefined && input.ReplicationGroupRegion !== null) { entries["ReplicationGroupRegion"] = input.ReplicationGroupRegion; } return entries; @@ -9233,13 +9251,13 @@ const serializeAws_queryFailoverGlobalReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalReplicationGroupId !== undefined) { + if (input.GlobalReplicationGroupId !== undefined && input.GlobalReplicationGroupId !== null) { entries["GlobalReplicationGroupId"] = input.GlobalReplicationGroupId; } - if (input.PrimaryRegion !== undefined) { + if (input.PrimaryRegion !== undefined && input.PrimaryRegion !== null) { entries["PrimaryRegion"] = input.PrimaryRegion; } - if (input.PrimaryReplicationGroupId !== undefined) { + if (input.PrimaryReplicationGroupId !== undefined && input.PrimaryReplicationGroupId !== null) { entries["PrimaryReplicationGroupId"] = input.PrimaryReplicationGroupId; } return entries; @@ -9247,10 +9265,10 @@ const serializeAws_queryFailoverGlobalReplicationGroupMessage = ( const serializeAws_queryFilter = (input: Filter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryFilterValueList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -9264,6 +9282,9 @@ const serializeAws_queryFilterList = (input: Filter[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -9277,6 +9298,9 @@ const serializeAws_queryFilterValueList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -9287,6 +9311,9 @@ const serializeAws_queryGlobalNodeGroupIdList = (input: string[], context: __Ser const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`GlobalNodeGroupId.${counter}`] = entry; counter++; } @@ -9298,20 +9325,20 @@ const serializeAws_queryIncreaseNodeGroupsInGlobalReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalReplicationGroupId !== undefined) { + if (input.GlobalReplicationGroupId !== undefined && input.GlobalReplicationGroupId !== null) { entries["GlobalReplicationGroupId"] = input.GlobalReplicationGroupId; } - if (input.NodeGroupCount !== undefined) { + if (input.NodeGroupCount !== undefined && input.NodeGroupCount !== null) { entries["NodeGroupCount"] = input.NodeGroupCount; } - if (input.RegionalConfigurations !== undefined) { + if (input.RegionalConfigurations !== undefined && input.RegionalConfigurations !== null) { const memberEntries = serializeAws_queryRegionalConfigurationList(input.RegionalConfigurations, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RegionalConfigurations.${key}`; entries[loc] = value; }); } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } return entries; @@ -9322,20 +9349,20 @@ const serializeAws_queryIncreaseReplicaCountMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.NewReplicaCount !== undefined) { + if (input.NewReplicaCount !== undefined && input.NewReplicaCount !== null) { entries["NewReplicaCount"] = input.NewReplicaCount; } - if (input.ReplicaConfiguration !== undefined) { + if (input.ReplicaConfiguration !== undefined && input.ReplicaConfiguration !== null) { const memberEntries = serializeAws_queryReplicaConfigurationList(input.ReplicaConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplicaConfiguration.${key}`; entries[loc] = value; }); } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } return entries; @@ -9345,6 +9372,9 @@ const serializeAws_queryKeyList = (input: string[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -9356,10 +9386,10 @@ const serializeAws_queryListAllowedNodeTypeModificationsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheClusterId !== undefined) { + if (input.CacheClusterId !== undefined && input.CacheClusterId !== null) { entries["CacheClusterId"] = input.CacheClusterId; } - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } return entries; @@ -9370,7 +9400,7 @@ const serializeAws_queryListTagsForResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } return entries; @@ -9381,77 +9411,77 @@ const serializeAws_queryModifyCacheClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheClusterId !== undefined) { + if (input.CacheClusterId !== undefined && input.CacheClusterId !== null) { entries["CacheClusterId"] = input.CacheClusterId; } - if (input.NumCacheNodes !== undefined) { + if (input.NumCacheNodes !== undefined && input.NumCacheNodes !== null) { entries["NumCacheNodes"] = input.NumCacheNodes; } - if (input.CacheNodeIdsToRemove !== undefined) { + if (input.CacheNodeIdsToRemove !== undefined && input.CacheNodeIdsToRemove !== null) { const memberEntries = serializeAws_queryCacheNodeIdsList(input.CacheNodeIdsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CacheNodeIdsToRemove.${key}`; entries[loc] = value; }); } - if (input.AZMode !== undefined) { + if (input.AZMode !== undefined && input.AZMode !== null) { entries["AZMode"] = input.AZMode; } - if (input.NewAvailabilityZones !== undefined) { + if (input.NewAvailabilityZones !== undefined && input.NewAvailabilityZones !== null) { const memberEntries = serializeAws_queryPreferredAvailabilityZoneList(input.NewAvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NewAvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.CacheSecurityGroupNames !== undefined) { + if (input.CacheSecurityGroupNames !== undefined && input.CacheSecurityGroupNames !== null) { const memberEntries = serializeAws_queryCacheSecurityGroupNameList(input.CacheSecurityGroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CacheSecurityGroupNames.${key}`; entries[loc] = value; }); } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_querySecurityGroupIdsList(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.NotificationTopicArn !== undefined) { + if (input.NotificationTopicArn !== undefined && input.NotificationTopicArn !== null) { entries["NotificationTopicArn"] = input.NotificationTopicArn; } - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } - if (input.NotificationTopicStatus !== undefined) { + if (input.NotificationTopicStatus !== undefined && input.NotificationTopicStatus !== null) { entries["NotificationTopicStatus"] = input.NotificationTopicStatus; } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.SnapshotRetentionLimit !== undefined) { + if (input.SnapshotRetentionLimit !== undefined && input.SnapshotRetentionLimit !== null) { entries["SnapshotRetentionLimit"] = input.SnapshotRetentionLimit; } - if (input.SnapshotWindow !== undefined) { + if (input.SnapshotWindow !== undefined && input.SnapshotWindow !== null) { entries["SnapshotWindow"] = input.SnapshotWindow; } - if (input.CacheNodeType !== undefined) { + if (input.CacheNodeType !== undefined && input.CacheNodeType !== null) { entries["CacheNodeType"] = input.CacheNodeType; } - if (input.AuthToken !== undefined) { + if (input.AuthToken !== undefined && input.AuthToken !== null) { entries["AuthToken"] = input.AuthToken; } - if (input.AuthTokenUpdateStrategy !== undefined) { + if (input.AuthTokenUpdateStrategy !== undefined && input.AuthTokenUpdateStrategy !== null) { entries["AuthTokenUpdateStrategy"] = input.AuthTokenUpdateStrategy; } return entries; @@ -9462,10 +9492,10 @@ const serializeAws_queryModifyCacheParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } - if (input.ParameterNameValues !== undefined) { + if (input.ParameterNameValues !== undefined && input.ParameterNameValues !== null) { const memberEntries = serializeAws_queryParameterNameValueList(input.ParameterNameValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ParameterNameValues.${key}`; @@ -9480,13 +9510,13 @@ const serializeAws_queryModifyCacheSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheSubnetGroupName !== undefined) { + if (input.CacheSubnetGroupName !== undefined && input.CacheSubnetGroupName !== null) { entries["CacheSubnetGroupName"] = input.CacheSubnetGroupName; } - if (input.CacheSubnetGroupDescription !== undefined) { + if (input.CacheSubnetGroupDescription !== undefined && input.CacheSubnetGroupDescription !== null) { entries["CacheSubnetGroupDescription"] = input.CacheSubnetGroupDescription; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; @@ -9501,22 +9531,22 @@ const serializeAws_queryModifyGlobalReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalReplicationGroupId !== undefined) { + if (input.GlobalReplicationGroupId !== undefined && input.GlobalReplicationGroupId !== null) { entries["GlobalReplicationGroupId"] = input.GlobalReplicationGroupId; } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } - if (input.CacheNodeType !== undefined) { + if (input.CacheNodeType !== undefined && input.CacheNodeType !== null) { entries["CacheNodeType"] = input.CacheNodeType; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.GlobalReplicationGroupDescription !== undefined) { + if (input.GlobalReplicationGroupDescription !== undefined && input.GlobalReplicationGroupDescription !== null) { entries["GlobalReplicationGroupDescription"] = input.GlobalReplicationGroupDescription; } - if (input.AutomaticFailoverEnabled !== undefined) { + if (input.AutomaticFailoverEnabled !== undefined && input.AutomaticFailoverEnabled !== null) { entries["AutomaticFailoverEnabled"] = input.AutomaticFailoverEnabled; } return entries; @@ -9527,92 +9557,92 @@ const serializeAws_queryModifyReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.ReplicationGroupDescription !== undefined) { + if (input.ReplicationGroupDescription !== undefined && input.ReplicationGroupDescription !== null) { entries["ReplicationGroupDescription"] = input.ReplicationGroupDescription; } - if (input.PrimaryClusterId !== undefined) { + if (input.PrimaryClusterId !== undefined && input.PrimaryClusterId !== null) { entries["PrimaryClusterId"] = input.PrimaryClusterId; } - if (input.SnapshottingClusterId !== undefined) { + if (input.SnapshottingClusterId !== undefined && input.SnapshottingClusterId !== null) { entries["SnapshottingClusterId"] = input.SnapshottingClusterId; } - if (input.AutomaticFailoverEnabled !== undefined) { + if (input.AutomaticFailoverEnabled !== undefined && input.AutomaticFailoverEnabled !== null) { entries["AutomaticFailoverEnabled"] = input.AutomaticFailoverEnabled; } - if (input.MultiAZEnabled !== undefined) { + if (input.MultiAZEnabled !== undefined && input.MultiAZEnabled !== null) { entries["MultiAZEnabled"] = input.MultiAZEnabled; } - if (input.NodeGroupId !== undefined) { + if (input.NodeGroupId !== undefined && input.NodeGroupId !== null) { entries["NodeGroupId"] = input.NodeGroupId; } - if (input.CacheSecurityGroupNames !== undefined) { + if (input.CacheSecurityGroupNames !== undefined && input.CacheSecurityGroupNames !== null) { const memberEntries = serializeAws_queryCacheSecurityGroupNameList(input.CacheSecurityGroupNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CacheSecurityGroupNames.${key}`; entries[loc] = value; }); } - if (input.SecurityGroupIds !== undefined) { + if (input.SecurityGroupIds !== undefined && input.SecurityGroupIds !== null) { const memberEntries = serializeAws_querySecurityGroupIdsList(input.SecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.NotificationTopicArn !== undefined) { + if (input.NotificationTopicArn !== undefined && input.NotificationTopicArn !== null) { entries["NotificationTopicArn"] = input.NotificationTopicArn; } - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } - if (input.NotificationTopicStatus !== undefined) { + if (input.NotificationTopicStatus !== undefined && input.NotificationTopicStatus !== null) { entries["NotificationTopicStatus"] = input.NotificationTopicStatus; } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.SnapshotRetentionLimit !== undefined) { + if (input.SnapshotRetentionLimit !== undefined && input.SnapshotRetentionLimit !== null) { entries["SnapshotRetentionLimit"] = input.SnapshotRetentionLimit; } - if (input.SnapshotWindow !== undefined) { + if (input.SnapshotWindow !== undefined && input.SnapshotWindow !== null) { entries["SnapshotWindow"] = input.SnapshotWindow; } - if (input.CacheNodeType !== undefined) { + if (input.CacheNodeType !== undefined && input.CacheNodeType !== null) { entries["CacheNodeType"] = input.CacheNodeType; } - if (input.AuthToken !== undefined) { + if (input.AuthToken !== undefined && input.AuthToken !== null) { entries["AuthToken"] = input.AuthToken; } - if (input.AuthTokenUpdateStrategy !== undefined) { + if (input.AuthTokenUpdateStrategy !== undefined && input.AuthTokenUpdateStrategy !== null) { entries["AuthTokenUpdateStrategy"] = input.AuthTokenUpdateStrategy; } - if (input.UserGroupIdsToAdd !== undefined) { + if (input.UserGroupIdsToAdd !== undefined && input.UserGroupIdsToAdd !== null) { const memberEntries = serializeAws_queryUserGroupIdList(input.UserGroupIdsToAdd, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserGroupIdsToAdd.${key}`; entries[loc] = value; }); } - if (input.UserGroupIdsToRemove !== undefined) { + if (input.UserGroupIdsToRemove !== undefined && input.UserGroupIdsToRemove !== null) { const memberEntries = serializeAws_queryUserGroupIdList(input.UserGroupIdsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserGroupIdsToRemove.${key}`; entries[loc] = value; }); } - if (input.RemoveUserGroups !== undefined) { + if (input.RemoveUserGroups !== undefined && input.RemoveUserGroups !== null) { entries["RemoveUserGroups"] = input.RemoveUserGroups; } return entries; @@ -9623,30 +9653,30 @@ const serializeAws_queryModifyReplicationGroupShardConfigurationMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.NodeGroupCount !== undefined) { + if (input.NodeGroupCount !== undefined && input.NodeGroupCount !== null) { entries["NodeGroupCount"] = input.NodeGroupCount; } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } - if (input.ReshardingConfiguration !== undefined) { + if (input.ReshardingConfiguration !== undefined && input.ReshardingConfiguration !== null) { const memberEntries = serializeAws_queryReshardingConfigurationList(input.ReshardingConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReshardingConfiguration.${key}`; entries[loc] = value; }); } - if (input.NodeGroupsToRemove !== undefined) { + if (input.NodeGroupsToRemove !== undefined && input.NodeGroupsToRemove !== null) { const memberEntries = serializeAws_queryNodeGroupsToRemoveList(input.NodeGroupsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NodeGroupsToRemove.${key}`; entries[loc] = value; }); } - if (input.NodeGroupsToRetain !== undefined) { + if (input.NodeGroupsToRetain !== undefined && input.NodeGroupsToRetain !== null) { const memberEntries = serializeAws_queryNodeGroupsToRetainList(input.NodeGroupsToRetain, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `NodeGroupsToRetain.${key}`; @@ -9658,17 +9688,17 @@ const serializeAws_queryModifyReplicationGroupShardConfigurationMessage = ( const serializeAws_queryModifyUserGroupMessage = (input: ModifyUserGroupMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserGroupId !== undefined) { + if (input.UserGroupId !== undefined && input.UserGroupId !== null) { entries["UserGroupId"] = input.UserGroupId; } - if (input.UserIdsToAdd !== undefined) { + if (input.UserIdsToAdd !== undefined && input.UserIdsToAdd !== null) { const memberEntries = serializeAws_queryUserIdListInput(input.UserIdsToAdd, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserIdsToAdd.${key}`; entries[loc] = value; }); } - if (input.UserIdsToRemove !== undefined) { + if (input.UserIdsToRemove !== undefined && input.UserIdsToRemove !== null) { const memberEntries = serializeAws_queryUserIdListInput(input.UserIdsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `UserIdsToRemove.${key}`; @@ -9680,23 +9710,23 @@ const serializeAws_queryModifyUserGroupMessage = (input: ModifyUserGroupMessage, const serializeAws_queryModifyUserMessage = (input: ModifyUserMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserId !== undefined) { + if (input.UserId !== undefined && input.UserId !== null) { entries["UserId"] = input.UserId; } - if (input.AccessString !== undefined) { + if (input.AccessString !== undefined && input.AccessString !== null) { entries["AccessString"] = input.AccessString; } - if (input.AppendAccessString !== undefined) { + if (input.AppendAccessString !== undefined && input.AppendAccessString !== null) { entries["AppendAccessString"] = input.AppendAccessString; } - if (input.Passwords !== undefined) { + if (input.Passwords !== undefined && input.Passwords !== null) { const memberEntries = serializeAws_queryPasswordListInput(input.Passwords, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Passwords.${key}`; entries[loc] = value; }); } - if (input.NoPasswordRequired !== undefined) { + if (input.NoPasswordRequired !== undefined && input.NoPasswordRequired !== null) { entries["NoPasswordRequired"] = input.NoPasswordRequired; } return entries; @@ -9704,29 +9734,29 @@ const serializeAws_queryModifyUserMessage = (input: ModifyUserMessage, context: const serializeAws_queryNodeGroupConfiguration = (input: NodeGroupConfiguration, context: __SerdeContext): any => { const entries: any = {}; - if (input.NodeGroupId !== undefined) { + if (input.NodeGroupId !== undefined && input.NodeGroupId !== null) { entries["NodeGroupId"] = input.NodeGroupId; } - if (input.Slots !== undefined) { + if (input.Slots !== undefined && input.Slots !== null) { entries["Slots"] = input.Slots; } - if (input.ReplicaCount !== undefined) { + if (input.ReplicaCount !== undefined && input.ReplicaCount !== null) { entries["ReplicaCount"] = input.ReplicaCount; } - if (input.PrimaryAvailabilityZone !== undefined) { + if (input.PrimaryAvailabilityZone !== undefined && input.PrimaryAvailabilityZone !== null) { entries["PrimaryAvailabilityZone"] = input.PrimaryAvailabilityZone; } - if (input.ReplicaAvailabilityZones !== undefined) { + if (input.ReplicaAvailabilityZones !== undefined && input.ReplicaAvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZonesList(input.ReplicaAvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplicaAvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.PrimaryOutpostArn !== undefined) { + if (input.PrimaryOutpostArn !== undefined && input.PrimaryOutpostArn !== null) { entries["PrimaryOutpostArn"] = input.PrimaryOutpostArn; } - if (input.ReplicaOutpostArns !== undefined) { + if (input.ReplicaOutpostArns !== undefined && input.ReplicaOutpostArns !== null) { const memberEntries = serializeAws_queryOutpostArnsList(input.ReplicaOutpostArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplicaOutpostArns.${key}`; @@ -9743,6 +9773,9 @@ const serializeAws_queryNodeGroupConfigurationList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryNodeGroupConfiguration(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`NodeGroupConfiguration.${counter}.${key}`] = value; @@ -9756,6 +9789,9 @@ const serializeAws_queryNodeGroupsToRemoveList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`NodeGroupToRemove.${counter}`] = entry; counter++; } @@ -9766,6 +9802,9 @@ const serializeAws_queryNodeGroupsToRetainList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`NodeGroupToRetain.${counter}`] = entry; counter++; } @@ -9776,6 +9815,9 @@ const serializeAws_queryOutpostArnsList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`OutpostArn.${counter}`] = entry; counter++; } @@ -9784,10 +9826,10 @@ const serializeAws_queryOutpostArnsList = (input: string[], context: __SerdeCont const serializeAws_queryParameterNameValue = (input: ParameterNameValue, context: __SerdeContext): any => { const entries: any = {}; - if (input.ParameterName !== undefined) { + if (input.ParameterName !== undefined && input.ParameterName !== null) { entries["ParameterName"] = input.ParameterName; } - if (input.ParameterValue !== undefined) { + if (input.ParameterValue !== undefined && input.ParameterValue !== null) { entries["ParameterValue"] = input.ParameterValue; } return entries; @@ -9797,6 +9839,9 @@ const serializeAws_queryParameterNameValueList = (input: ParameterNameValue[], c const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryParameterNameValue(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`ParameterNameValue.${counter}.${key}`] = value; @@ -9810,6 +9855,9 @@ const serializeAws_queryPasswordListInput = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -9820,6 +9868,9 @@ const serializeAws_queryPreferredAvailabilityZoneList = (input: string[], contex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`PreferredAvailabilityZone.${counter}`] = entry; counter++; } @@ -9830,6 +9881,9 @@ const serializeAws_queryPreferredOutpostArnList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`PreferredOutpostArn.${counter}`] = entry; counter++; } @@ -9841,13 +9895,13 @@ const serializeAws_queryPurchaseReservedCacheNodesOfferingMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedCacheNodesOfferingId !== undefined) { + if (input.ReservedCacheNodesOfferingId !== undefined && input.ReservedCacheNodesOfferingId !== null) { entries["ReservedCacheNodesOfferingId"] = input.ReservedCacheNodesOfferingId; } - if (input.ReservedCacheNodeId !== undefined) { + if (input.ReservedCacheNodeId !== undefined && input.ReservedCacheNodeId !== null) { entries["ReservedCacheNodeId"] = input.ReservedCacheNodeId; } - if (input.CacheNodeCount !== undefined) { + if (input.CacheNodeCount !== undefined && input.CacheNodeCount !== null) { entries["CacheNodeCount"] = input.CacheNodeCount; } return entries; @@ -9858,10 +9912,10 @@ const serializeAws_queryRebalanceSlotsInGlobalReplicationGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalReplicationGroupId !== undefined) { + if (input.GlobalReplicationGroupId !== undefined && input.GlobalReplicationGroupId !== null) { entries["GlobalReplicationGroupId"] = input.GlobalReplicationGroupId; } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } return entries; @@ -9872,10 +9926,10 @@ const serializeAws_queryRebootCacheClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheClusterId !== undefined) { + if (input.CacheClusterId !== undefined && input.CacheClusterId !== null) { entries["CacheClusterId"] = input.CacheClusterId; } - if (input.CacheNodeIdsToReboot !== undefined) { + if (input.CacheNodeIdsToReboot !== undefined && input.CacheNodeIdsToReboot !== null) { const memberEntries = serializeAws_queryCacheNodeIdsList(input.CacheNodeIdsToReboot, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CacheNodeIdsToReboot.${key}`; @@ -9887,13 +9941,13 @@ const serializeAws_queryRebootCacheClusterMessage = ( const serializeAws_queryRegionalConfiguration = (input: RegionalConfiguration, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.ReplicationGroupRegion !== undefined) { + if (input.ReplicationGroupRegion !== undefined && input.ReplicationGroupRegion !== null) { entries["ReplicationGroupRegion"] = input.ReplicationGroupRegion; } - if (input.ReshardingConfiguration !== undefined) { + if (input.ReshardingConfiguration !== undefined && input.ReshardingConfiguration !== null) { const memberEntries = serializeAws_queryReshardingConfigurationList(input.ReshardingConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReshardingConfiguration.${key}`; @@ -9907,6 +9961,9 @@ const serializeAws_queryRegionalConfigurationList = (input: RegionalConfiguratio const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryRegionalConfiguration(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`RegionalConfiguration.${counter}.${key}`] = value; @@ -9920,6 +9977,9 @@ const serializeAws_queryRemoveReplicasList = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -9931,10 +9991,10 @@ const serializeAws_queryRemoveTagsFromResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; @@ -9948,6 +10008,9 @@ const serializeAws_queryReplicaConfigurationList = (input: ConfigureShard[], con const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryConfigureShard(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`ConfigureShard.${counter}.${key}`] = value; @@ -9961,6 +10024,9 @@ const serializeAws_queryReplicationGroupIdList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -9972,13 +10038,13 @@ const serializeAws_queryResetCacheParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheParameterGroupName !== undefined) { + if (input.CacheParameterGroupName !== undefined && input.CacheParameterGroupName !== null) { entries["CacheParameterGroupName"] = input.CacheParameterGroupName; } - if (input.ResetAllParameters !== undefined) { + if (input.ResetAllParameters !== undefined && input.ResetAllParameters !== null) { entries["ResetAllParameters"] = input.ResetAllParameters; } - if (input.ParameterNameValues !== undefined) { + if (input.ParameterNameValues !== undefined && input.ParameterNameValues !== null) { const memberEntries = serializeAws_queryParameterNameValueList(input.ParameterNameValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ParameterNameValues.${key}`; @@ -9990,10 +10056,10 @@ const serializeAws_queryResetCacheParameterGroupMessage = ( const serializeAws_queryReshardingConfiguration = (input: ReshardingConfiguration, context: __SerdeContext): any => { const entries: any = {}; - if (input.NodeGroupId !== undefined) { + if (input.NodeGroupId !== undefined && input.NodeGroupId !== null) { entries["NodeGroupId"] = input.NodeGroupId; } - if (input.PreferredAvailabilityZones !== undefined) { + if (input.PreferredAvailabilityZones !== undefined && input.PreferredAvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZonesList(input.PreferredAvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PreferredAvailabilityZones.${key}`; @@ -10010,6 +10076,9 @@ const serializeAws_queryReshardingConfigurationList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryReshardingConfiguration(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`ReshardingConfiguration.${counter}.${key}`] = value; @@ -10024,13 +10093,13 @@ const serializeAws_queryRevokeCacheSecurityGroupIngressMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CacheSecurityGroupName !== undefined) { + if (input.CacheSecurityGroupName !== undefined && input.CacheSecurityGroupName !== null) { entries["CacheSecurityGroupName"] = input.CacheSecurityGroupName; } - if (input.EC2SecurityGroupName !== undefined) { + if (input.EC2SecurityGroupName !== undefined && input.EC2SecurityGroupName !== null) { entries["EC2SecurityGroupName"] = input.EC2SecurityGroupName; } - if (input.EC2SecurityGroupOwnerId !== undefined) { + if (input.EC2SecurityGroupOwnerId !== undefined && input.EC2SecurityGroupOwnerId !== null) { entries["EC2SecurityGroupOwnerId"] = input.EC2SecurityGroupOwnerId; } return entries; @@ -10040,6 +10109,9 @@ const serializeAws_querySecurityGroupIdsList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SecurityGroupId.${counter}`] = entry; counter++; } @@ -10053,6 +10125,9 @@ const serializeAws_queryServiceUpdateStatusList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -10063,6 +10138,9 @@ const serializeAws_querySnapshotArnsList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SnapshotArn.${counter}`] = entry; counter++; } @@ -10071,10 +10149,10 @@ const serializeAws_querySnapshotArnsList = (input: string[], context: __SerdeCon const serializeAws_queryStartMigrationMessage = (input: StartMigrationMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.CustomerNodeEndpointList !== undefined) { + if (input.CustomerNodeEndpointList !== undefined && input.CustomerNodeEndpointList !== null) { const memberEntries = serializeAws_queryCustomerNodeEndpointList(input.CustomerNodeEndpointList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CustomerNodeEndpointList.${key}`; @@ -10088,6 +10166,9 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SubnetIdentifier.${counter}`] = entry; counter++; } @@ -10096,10 +10177,10 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -10109,6 +10190,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Tag.${counter}.${key}`] = value; @@ -10120,10 +10204,10 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const serializeAws_queryTestFailoverMessage = (input: TestFailoverMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReplicationGroupId !== undefined) { + if (input.ReplicationGroupId !== undefined && input.ReplicationGroupId !== null) { entries["ReplicationGroupId"] = input.ReplicationGroupId; } - if (input.NodeGroupId !== undefined) { + if (input.NodeGroupId !== undefined && input.NodeGroupId !== null) { entries["NodeGroupId"] = input.NodeGroupId; } return entries; @@ -10131,10 +10215,10 @@ const serializeAws_queryTestFailoverMessage = (input: TestFailoverMessage, conte const serializeAws_queryTimeRangeFilter = (input: TimeRangeFilter, context: __SerdeContext): any => { const entries: any = {}; - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } return entries; @@ -10147,6 +10231,9 @@ const serializeAws_queryUpdateActionStatusList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -10157,6 +10244,9 @@ const serializeAws_queryUserGroupIdList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -10167,6 +10257,9 @@ const serializeAws_queryUserGroupIdListInput = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -10177,6 +10270,9 @@ const serializeAws_queryUserIdListInput = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -10289,7 +10385,14 @@ const deserializeAws_queryAvailabilityZone = (output: any, context: __SerdeConte }; const deserializeAws_queryAvailabilityZonesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryCacheCluster = (output: any, context: __SerdeContext): CacheCluster => { @@ -10454,7 +10557,14 @@ const deserializeAws_queryCacheClusterAlreadyExistsFault = ( }; const deserializeAws_queryCacheClusterList = (output: any, context: __SerdeContext): CacheCluster[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheCluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheCluster(entry, context); + }); }; const deserializeAws_queryCacheClusterMessage = (output: any, context: __SerdeContext): CacheClusterMessage => { @@ -10517,7 +10627,14 @@ const deserializeAws_queryCacheEngineVersion = (output: any, context: __SerdeCon }; const deserializeAws_queryCacheEngineVersionList = (output: any, context: __SerdeContext): CacheEngineVersion[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheEngineVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheEngineVersion(entry, context); + }); }; const deserializeAws_queryCacheEngineVersionMessage = ( @@ -10585,11 +10702,25 @@ const deserializeAws_queryCacheNode = (output: any, context: __SerdeContext): Ca }; const deserializeAws_queryCacheNodeIdsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryCacheNodeList = (output: any, context: __SerdeContext): CacheNode[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheNode(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheNode(entry, context); + }); }; const deserializeAws_queryCacheNodeTypeSpecificParameter = ( @@ -10650,7 +10781,14 @@ const deserializeAws_queryCacheNodeTypeSpecificParametersList = ( output: any, context: __SerdeContext ): CacheNodeTypeSpecificParameter[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheNodeTypeSpecificParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheNodeTypeSpecificParameter(entry, context); + }); }; const deserializeAws_queryCacheNodeTypeSpecificValue = ( @@ -10674,7 +10812,14 @@ const deserializeAws_queryCacheNodeTypeSpecificValueList = ( output: any, context: __SerdeContext ): CacheNodeTypeSpecificValue[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheNodeTypeSpecificValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheNodeTypeSpecificValue(entry, context); + }); }; const deserializeAws_queryCacheNodeUpdateStatus = (output: any, context: __SerdeContext): CacheNodeUpdateStatus => { @@ -10719,7 +10864,14 @@ const deserializeAws_queryCacheNodeUpdateStatusList = ( output: any, context: __SerdeContext ): CacheNodeUpdateStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheNodeUpdateStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheNodeUpdateStatus(entry, context); + }); }; const deserializeAws_queryCacheParameterGroup = (output: any, context: __SerdeContext): CacheParameterGroup => { @@ -10798,7 +10950,14 @@ const deserializeAws_queryCacheParameterGroupDetails = ( }; const deserializeAws_queryCacheParameterGroupList = (output: any, context: __SerdeContext): CacheParameterGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheParameterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheParameterGroup(entry, context); + }); }; const deserializeAws_queryCacheParameterGroupNameMessage = ( @@ -10959,7 +11118,14 @@ const deserializeAws_queryCacheSecurityGroupMembershipList = ( output: any, context: __SerdeContext ): CacheSecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheSecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheSecurityGroupMembership(entry, context); + }); }; const deserializeAws_queryCacheSecurityGroupMessage = ( @@ -11015,7 +11181,14 @@ const deserializeAws_queryCacheSecurityGroupQuotaExceededFault = ( }; const deserializeAws_queryCacheSecurityGroups = (output: any, context: __SerdeContext): CacheSecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheSecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheSecurityGroup(entry, context); + }); }; const deserializeAws_queryCacheSubnetGroup = (output: any, context: __SerdeContext): CacheSubnetGroup => { @@ -11117,7 +11290,14 @@ const deserializeAws_queryCacheSubnetGroupQuotaExceededFault = ( }; const deserializeAws_queryCacheSubnetGroups = (output: any, context: __SerdeContext): CacheSubnetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryCacheSubnetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCacheSubnetGroup(entry, context); + }); }; const deserializeAws_queryCacheSubnetQuotaExceededFault = ( @@ -11134,7 +11314,14 @@ const deserializeAws_queryCacheSubnetQuotaExceededFault = ( }; const deserializeAws_queryClusterIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryClusterQuotaForCustomerExceededFault = ( @@ -11515,7 +11702,14 @@ const deserializeAws_queryEC2SecurityGroup = (output: any, context: __SerdeConte }; const deserializeAws_queryEC2SecurityGroupList = (output: any, context: __SerdeContext): EC2SecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryEC2SecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEC2SecurityGroup(entry, context); + }); }; const deserializeAws_queryEndpoint = (output: any, context: __SerdeContext): Endpoint => { @@ -11592,7 +11786,14 @@ const deserializeAws_queryEvent = (output: any, context: __SerdeContext): Event }; const deserializeAws_queryEventList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_queryEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEvent(entry, context); + }); }; const deserializeAws_queryEventsMessage = (output: any, context: __SerdeContext): EventsMessage => { @@ -11643,7 +11844,14 @@ const deserializeAws_queryGlobalNodeGroup = (output: any, context: __SerdeContex }; const deserializeAws_queryGlobalNodeGroupList = (output: any, context: __SerdeContext): GlobalNodeGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryGlobalNodeGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryGlobalNodeGroup(entry, context); + }); }; const deserializeAws_queryGlobalReplicationGroup = (output: any, context: __SerdeContext): GlobalReplicationGroup => { @@ -11750,7 +11958,14 @@ const deserializeAws_queryGlobalReplicationGroupList = ( output: any, context: __SerdeContext ): GlobalReplicationGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryGlobalReplicationGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryGlobalReplicationGroup(entry, context); + }); }; const deserializeAws_queryGlobalReplicationGroupMember = ( @@ -11786,7 +12001,14 @@ const deserializeAws_queryGlobalReplicationGroupMemberList = ( output: any, context: __SerdeContext ): GlobalReplicationGroupMember[] => { - return (output || []).map((entry: any) => deserializeAws_queryGlobalReplicationGroupMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryGlobalReplicationGroupMember(entry, context); + }); }; const deserializeAws_queryGlobalReplicationGroupNotFoundFault = ( @@ -12168,7 +12390,14 @@ const deserializeAws_queryNodeGroupConfiguration = (output: any, context: __Serd }; const deserializeAws_queryNodeGroupList = (output: any, context: __SerdeContext): NodeGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryNodeGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryNodeGroup(entry, context); + }); }; const deserializeAws_queryNodeGroupMember = (output: any, context: __SerdeContext): NodeGroupMember => { @@ -12202,7 +12431,14 @@ const deserializeAws_queryNodeGroupMember = (output: any, context: __SerdeContex }; const deserializeAws_queryNodeGroupMemberList = (output: any, context: __SerdeContext): NodeGroupMember[] => { - return (output || []).map((entry: any) => deserializeAws_queryNodeGroupMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryNodeGroupMember(entry, context); + }); }; const deserializeAws_queryNodeGroupMemberUpdateStatus = ( @@ -12254,7 +12490,14 @@ const deserializeAws_queryNodeGroupMemberUpdateStatusList = ( output: any, context: __SerdeContext ): NodeGroupMemberUpdateStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryNodeGroupMemberUpdateStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryNodeGroupMemberUpdateStatus(entry, context); + }); }; const deserializeAws_queryNodeGroupNotFoundFault = (output: any, context: __SerdeContext): NodeGroupNotFoundFault => { @@ -12307,7 +12550,14 @@ const deserializeAws_queryNodeGroupUpdateStatusList = ( output: any, context: __SerdeContext ): NodeGroupUpdateStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryNodeGroupUpdateStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryNodeGroupUpdateStatus(entry, context); + }); }; const deserializeAws_queryNodeQuotaForClusterExceededFault = ( @@ -12374,11 +12624,25 @@ const deserializeAws_queryNodeSnapshot = (output: any, context: __SerdeContext): }; const deserializeAws_queryNodeSnapshotList = (output: any, context: __SerdeContext): NodeSnapshot[] => { - return (output || []).map((entry: any) => deserializeAws_queryNodeSnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryNodeSnapshot(entry, context); + }); }; const deserializeAws_queryNodeTypeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryNoOperationFault = (output: any, context: __SerdeContext): NoOperationFault => { @@ -12409,7 +12673,14 @@ const deserializeAws_queryNotificationConfiguration = ( }; const deserializeAws_queryOutpostArnsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryParameter = (output: any, context: __SerdeContext): Parameter => { @@ -12455,7 +12726,14 @@ const deserializeAws_queryParameter = (output: any, context: __SerdeContext): Pa }; const deserializeAws_queryParametersList = (output: any, context: __SerdeContext): Parameter[] => { - return (output || []).map((entry: any) => deserializeAws_queryParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryParameter(entry, context); + }); }; const deserializeAws_queryPendingModifiedValues = (output: any, context: __SerdeContext): PendingModifiedValues => { @@ -12516,7 +12794,14 @@ const deserializeAws_queryProcessedUpdateActionList = ( output: any, context: __SerdeContext ): ProcessedUpdateAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryProcessedUpdateAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryProcessedUpdateAction(entry, context); + }); }; const deserializeAws_queryPurchaseReservedCacheNodesOfferingResult = ( @@ -12576,7 +12861,14 @@ const deserializeAws_queryRecurringCharge = (output: any, context: __SerdeContex }; const deserializeAws_queryRecurringChargeList = (output: any, context: __SerdeContext): RecurringCharge[] => { - return (output || []).map((entry: any) => deserializeAws_queryRecurringCharge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRecurringCharge(entry, context); + }); }; const deserializeAws_queryReplicationGroup = (output: any, context: __SerdeContext): ReplicationGroup => { @@ -12737,7 +13029,14 @@ const deserializeAws_queryReplicationGroupAlreadyUnderMigrationFault = ( }; const deserializeAws_queryReplicationGroupList = (output: any, context: __SerdeContext): ReplicationGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryReplicationGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReplicationGroup(entry, context); + }); }; const deserializeAws_queryReplicationGroupMessage = (output: any, context: __SerdeContext): ReplicationGroupMessage => { @@ -12787,7 +13086,14 @@ const deserializeAws_queryReplicationGroupNotUnderMigrationFault = ( }; const deserializeAws_queryReplicationGroupOutpostArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryReplicationGroupPendingModifiedValues = ( @@ -12897,7 +13203,14 @@ const deserializeAws_queryReservedCacheNodeAlreadyExistsFault = ( }; const deserializeAws_queryReservedCacheNodeList = (output: any, context: __SerdeContext): ReservedCacheNode[] => { - return (output || []).map((entry: any) => deserializeAws_queryReservedCacheNode(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReservedCacheNode(entry, context); + }); }; const deserializeAws_queryReservedCacheNodeMessage = ( @@ -13000,7 +13313,14 @@ const deserializeAws_queryReservedCacheNodesOfferingList = ( output: any, context: __SerdeContext ): ReservedCacheNodesOffering[] => { - return (output || []).map((entry: any) => deserializeAws_queryReservedCacheNodesOffering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReservedCacheNodesOffering(entry, context); + }); }; const deserializeAws_queryReservedCacheNodesOfferingMessage = ( @@ -13083,7 +13403,14 @@ const deserializeAws_querySecurityGroupMembershipList = ( output: any, context: __SerdeContext ): SecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_querySecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySecurityGroupMembership(entry, context); + }); }; const deserializeAws_queryServiceLinkedRoleNotFoundFault = ( @@ -13154,7 +13481,14 @@ const deserializeAws_queryServiceUpdate = (output: any, context: __SerdeContext) }; const deserializeAws_queryServiceUpdateList = (output: any, context: __SerdeContext): ServiceUpdate[] => { - return (output || []).map((entry: any) => deserializeAws_queryServiceUpdate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryServiceUpdate(entry, context); + }); }; const deserializeAws_queryServiceUpdateNotFoundFault = ( @@ -13347,7 +13681,14 @@ const deserializeAws_querySnapshotFeatureNotSupportedFault = ( }; const deserializeAws_querySnapshotList = (output: any, context: __SerdeContext): Snapshot[] => { - return (output || []).map((entry: any) => deserializeAws_querySnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySnapshot(entry, context); + }); }; const deserializeAws_querySnapshotNotFoundFault = (output: any, context: __SerdeContext): SnapshotNotFoundFault => { @@ -13412,7 +13753,14 @@ const deserializeAws_querySubnetInUse = (output: any, context: __SerdeContext): }; const deserializeAws_querySubnetList = (output: any, context: __SerdeContext): Subnet[] => { - return (output || []).map((entry: any) => deserializeAws_querySubnet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySubnet(entry, context); + }); }; const deserializeAws_querySubnetNotAllowedFault = (output: any, context: __SerdeContext): SubnetNotAllowedFault => { @@ -13450,7 +13798,14 @@ const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTagListMessage = (output: any, context: __SerdeContext): TagListMessage => { @@ -13513,7 +13868,14 @@ const deserializeAws_queryTestFailoverResult = (output: any, context: __SerdeCon }; const deserializeAws_queryUGReplicationGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryUnprocessedUpdateAction = (output: any, context: __SerdeContext): UnprocessedUpdateAction => { @@ -13546,7 +13908,14 @@ const deserializeAws_queryUnprocessedUpdateActionList = ( output: any, context: __SerdeContext ): UnprocessedUpdateAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryUnprocessedUpdateAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUnprocessedUpdateAction(entry, context); + }); }; const deserializeAws_queryUpdateAction = (output: any, context: __SerdeContext): UpdateAction => { @@ -13642,7 +14011,14 @@ const deserializeAws_queryUpdateAction = (output: any, context: __SerdeContext): }; const deserializeAws_queryUpdateActionList = (output: any, context: __SerdeContext): UpdateAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryUpdateAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUpdateAction(entry, context); + }); }; const deserializeAws_queryUpdateActionResultsMessage = ( @@ -13811,11 +14187,25 @@ const deserializeAws_queryUserGroupAlreadyExistsFault = ( }; const deserializeAws_queryUserGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryUserGroupList = (output: any, context: __SerdeContext): UserGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryUserGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUserGroup(entry, context); + }); }; const deserializeAws_queryUserGroupNotFoundFault = (output: any, context: __SerdeContext): UserGroupNotFoundFault => { @@ -13894,11 +14284,25 @@ const deserializeAws_queryUserGroupsUpdateStatus = (output: any, context: __Serd }; const deserializeAws_queryUserIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryUserList = (output: any, context: __SerdeContext): User[] => { - return (output || []).map((entry: any) => deserializeAws_queryUser(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUser(entry, context); + }); }; const deserializeAws_queryUserNotFoundFault = (output: any, context: __SerdeContext): UserNotFoundFault => { diff --git a/clients/client-elasticsearch-service/protocols/Aws_restJson1.ts b/clients/client-elasticsearch-service/protocols/Aws_restJson1.ts index f272f30c5b61..3646950822d4 100644 --- a/clients/client-elasticsearch-service/protocols/Aws_restJson1.ts +++ b/clients/client-elasticsearch-service/protocols/Aws_restJson1.ts @@ -209,9 +209,7 @@ export const serializeAws_restJson1AcceptInboundCrossClusterSearchConnectionComm input: AcceptInboundCrossClusterSearchConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/ccs/inboundConnection/{CrossClusterSearchConnectionId}/accept"; if (input.CrossClusterSearchConnectionId !== undefined) { const labelValue: string = input.CrossClusterSearchConnectionId; @@ -240,13 +238,14 @@ export const serializeAws_restJson1AddTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/tags"; let body: any; body = JSON.stringify({ - ...(input.ARN !== undefined && { ARN: input.ARN }), - ...(input.TagList !== undefined && { TagList: serializeAws_restJson1TagList(input.TagList, context) }), + ...(input.ARN !== undefined && input.ARN !== null && { ARN: input.ARN }), + ...(input.TagList !== undefined && + input.TagList !== null && { TagList: serializeAws_restJson1TagList(input.TagList, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -264,9 +263,7 @@ export const serializeAws_restJson1AssociatePackageCommand = async ( input: AssociatePackageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/packages/associate/{PackageID}/{DomainName}"; if (input.PackageID !== undefined) { const labelValue: string = input.PackageID; @@ -304,12 +301,12 @@ export const serializeAws_restJson1CancelElasticsearchServiceSoftwareUpdateComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/serviceSoftwareUpdate/cancel"; let body: any; body = JSON.stringify({ - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -328,52 +325,65 @@ export const serializeAws_restJson1CreateElasticsearchDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/domain"; let body: any; body = JSON.stringify({ - ...(input.AccessPolicies !== undefined && { AccessPolicies: input.AccessPolicies }), - ...(input.AdvancedOptions !== undefined && { - AdvancedOptions: serializeAws_restJson1AdvancedOptions(input.AdvancedOptions, context), - }), - ...(input.AdvancedSecurityOptions !== undefined && { - AdvancedSecurityOptions: serializeAws_restJson1AdvancedSecurityOptionsInput( - input.AdvancedSecurityOptions, - context - ), - }), - ...(input.CognitoOptions !== undefined && { - CognitoOptions: serializeAws_restJson1CognitoOptions(input.CognitoOptions, context), - }), - ...(input.DomainEndpointOptions !== undefined && { - DomainEndpointOptions: serializeAws_restJson1DomainEndpointOptions(input.DomainEndpointOptions, context), - }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.EBSOptions !== undefined && { EBSOptions: serializeAws_restJson1EBSOptions(input.EBSOptions, context) }), - ...(input.ElasticsearchClusterConfig !== undefined && { - ElasticsearchClusterConfig: serializeAws_restJson1ElasticsearchClusterConfig( - input.ElasticsearchClusterConfig, - context - ), - }), - ...(input.ElasticsearchVersion !== undefined && { ElasticsearchVersion: input.ElasticsearchVersion }), - ...(input.EncryptionAtRestOptions !== undefined && { - EncryptionAtRestOptions: serializeAws_restJson1EncryptionAtRestOptions(input.EncryptionAtRestOptions, context), - }), - ...(input.LogPublishingOptions !== undefined && { - LogPublishingOptions: serializeAws_restJson1LogPublishingOptions(input.LogPublishingOptions, context), - }), - ...(input.NodeToNodeEncryptionOptions !== undefined && { - NodeToNodeEncryptionOptions: serializeAws_restJson1NodeToNodeEncryptionOptions( - input.NodeToNodeEncryptionOptions, - context - ), - }), - ...(input.SnapshotOptions !== undefined && { - SnapshotOptions: serializeAws_restJson1SnapshotOptions(input.SnapshotOptions, context), - }), - ...(input.VPCOptions !== undefined && { VPCOptions: serializeAws_restJson1VPCOptions(input.VPCOptions, context) }), + ...(input.AccessPolicies !== undefined && + input.AccessPolicies !== null && { AccessPolicies: input.AccessPolicies }), + ...(input.AdvancedOptions !== undefined && + input.AdvancedOptions !== null && { + AdvancedOptions: serializeAws_restJson1AdvancedOptions(input.AdvancedOptions, context), + }), + ...(input.AdvancedSecurityOptions !== undefined && + input.AdvancedSecurityOptions !== null && { + AdvancedSecurityOptions: serializeAws_restJson1AdvancedSecurityOptionsInput( + input.AdvancedSecurityOptions, + context + ), + }), + ...(input.CognitoOptions !== undefined && + input.CognitoOptions !== null && { + CognitoOptions: serializeAws_restJson1CognitoOptions(input.CognitoOptions, context), + }), + ...(input.DomainEndpointOptions !== undefined && + input.DomainEndpointOptions !== null && { + DomainEndpointOptions: serializeAws_restJson1DomainEndpointOptions(input.DomainEndpointOptions, context), + }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.EBSOptions !== undefined && + input.EBSOptions !== null && { EBSOptions: serializeAws_restJson1EBSOptions(input.EBSOptions, context) }), + ...(input.ElasticsearchClusterConfig !== undefined && + input.ElasticsearchClusterConfig !== null && { + ElasticsearchClusterConfig: serializeAws_restJson1ElasticsearchClusterConfig( + input.ElasticsearchClusterConfig, + context + ), + }), + ...(input.ElasticsearchVersion !== undefined && + input.ElasticsearchVersion !== null && { ElasticsearchVersion: input.ElasticsearchVersion }), + ...(input.EncryptionAtRestOptions !== undefined && + input.EncryptionAtRestOptions !== null && { + EncryptionAtRestOptions: serializeAws_restJson1EncryptionAtRestOptions(input.EncryptionAtRestOptions, context), + }), + ...(input.LogPublishingOptions !== undefined && + input.LogPublishingOptions !== null && { + LogPublishingOptions: serializeAws_restJson1LogPublishingOptions(input.LogPublishingOptions, context), + }), + ...(input.NodeToNodeEncryptionOptions !== undefined && + input.NodeToNodeEncryptionOptions !== null && { + NodeToNodeEncryptionOptions: serializeAws_restJson1NodeToNodeEncryptionOptions( + input.NodeToNodeEncryptionOptions, + context + ), + }), + ...(input.SnapshotOptions !== undefined && + input.SnapshotOptions !== null && { + SnapshotOptions: serializeAws_restJson1SnapshotOptions(input.SnapshotOptions, context), + }), + ...(input.VPCOptions !== undefined && + input.VPCOptions !== null && { VPCOptions: serializeAws_restJson1VPCOptions(input.VPCOptions, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -392,18 +402,21 @@ export const serializeAws_restJson1CreateOutboundCrossClusterSearchConnectionCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/ccs/outboundConnection"; let body: any; body = JSON.stringify({ - ...(input.ConnectionAlias !== undefined && { ConnectionAlias: input.ConnectionAlias }), - ...(input.DestinationDomainInfo !== undefined && { - DestinationDomainInfo: serializeAws_restJson1DomainInformation(input.DestinationDomainInfo, context), - }), - ...(input.SourceDomainInfo !== undefined && { - SourceDomainInfo: serializeAws_restJson1DomainInformation(input.SourceDomainInfo, context), - }), + ...(input.ConnectionAlias !== undefined && + input.ConnectionAlias !== null && { ConnectionAlias: input.ConnectionAlias }), + ...(input.DestinationDomainInfo !== undefined && + input.DestinationDomainInfo !== null && { + DestinationDomainInfo: serializeAws_restJson1DomainInformation(input.DestinationDomainInfo, context), + }), + ...(input.SourceDomainInfo !== undefined && + input.SourceDomainInfo !== null && { + SourceDomainInfo: serializeAws_restJson1DomainInformation(input.SourceDomainInfo, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -422,17 +435,19 @@ export const serializeAws_restJson1CreatePackageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/packages"; let body: any; body = JSON.stringify({ - ...(input.PackageDescription !== undefined && { PackageDescription: input.PackageDescription }), - ...(input.PackageName !== undefined && { PackageName: input.PackageName }), - ...(input.PackageSource !== undefined && { - PackageSource: serializeAws_restJson1PackageSource(input.PackageSource, context), - }), - ...(input.PackageType !== undefined && { PackageType: input.PackageType }), + ...(input.PackageDescription !== undefined && + input.PackageDescription !== null && { PackageDescription: input.PackageDescription }), + ...(input.PackageName !== undefined && input.PackageName !== null && { PackageName: input.PackageName }), + ...(input.PackageSource !== undefined && + input.PackageSource !== null && { + PackageSource: serializeAws_restJson1PackageSource(input.PackageSource, context), + }), + ...(input.PackageType !== undefined && input.PackageType !== null && { PackageType: input.PackageType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -450,9 +465,7 @@ export const serializeAws_restJson1DeleteElasticsearchDomainCommand = async ( input: DeleteElasticsearchDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/domain/{DomainName}"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -480,12 +493,10 @@ export const serializeAws_restJson1DeleteElasticsearchServiceRoleCommand = async input: DeleteElasticsearchServiceRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/role"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -502,9 +513,7 @@ export const serializeAws_restJson1DeleteInboundCrossClusterSearchConnectionComm input: DeleteInboundCrossClusterSearchConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/ccs/inboundConnection/{CrossClusterSearchConnectionId}"; if (input.CrossClusterSearchConnectionId !== undefined) { const labelValue: string = input.CrossClusterSearchConnectionId; @@ -532,9 +541,7 @@ export const serializeAws_restJson1DeleteOutboundCrossClusterSearchConnectionCom input: DeleteOutboundCrossClusterSearchConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/ccs/outboundConnection/{CrossClusterSearchConnectionId}"; if (input.CrossClusterSearchConnectionId !== undefined) { const labelValue: string = input.CrossClusterSearchConnectionId; @@ -562,9 +569,7 @@ export const serializeAws_restJson1DeletePackageCommand = async ( input: DeletePackageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/packages/{PackageID}"; if (input.PackageID !== undefined) { const labelValue: string = input.PackageID; @@ -592,9 +597,7 @@ export const serializeAws_restJson1DescribeElasticsearchDomainCommand = async ( input: DescribeElasticsearchDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/domain/{DomainName}"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -622,9 +625,7 @@ export const serializeAws_restJson1DescribeElasticsearchDomainConfigCommand = as input: DescribeElasticsearchDomainConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/domain/{DomainName}/config"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -653,14 +654,13 @@ export const serializeAws_restJson1DescribeElasticsearchDomainsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/domain-info"; let body: any; body = JSON.stringify({ - ...(input.DomainNames !== undefined && { - DomainNames: serializeAws_restJson1DomainNameList(input.DomainNames, context), - }), + ...(input.DomainNames !== undefined && + input.DomainNames !== null && { DomainNames: serializeAws_restJson1DomainNameList(input.DomainNames, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -678,9 +678,7 @@ export const serializeAws_restJson1DescribeElasticsearchInstanceTypeLimitsComman input: DescribeElasticsearchInstanceTypeLimitsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/instanceTypeLimits/{ElasticsearchVersion}/{InstanceType}"; if (input.InstanceType !== undefined) { const labelValue: string = input.InstanceType; @@ -722,14 +720,15 @@ export const serializeAws_restJson1DescribeInboundCrossClusterSearchConnectionsC context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/ccs/inboundConnection/search"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { Filters: serializeAws_restJson1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -748,14 +747,15 @@ export const serializeAws_restJson1DescribeOutboundCrossClusterSearchConnections context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/ccs/outboundConnection/search"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { Filters: serializeAws_restJson1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -774,16 +774,15 @@ export const serializeAws_restJson1DescribePackagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/packages/describe"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1DescribePackagesFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1DescribePackagesFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -801,9 +800,7 @@ export const serializeAws_restJson1DescribeReservedElasticsearchInstanceOffering input: DescribeReservedElasticsearchInstanceOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/reservedInstanceOfferings"; const query: any = { ...(input.ReservedElasticsearchInstanceOfferingId !== undefined && { @@ -830,9 +827,7 @@ export const serializeAws_restJson1DescribeReservedElasticsearchInstancesCommand input: DescribeReservedElasticsearchInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/reservedInstances"; const query: any = { ...(input.ReservedElasticsearchInstanceId !== undefined && { @@ -859,9 +854,7 @@ export const serializeAws_restJson1DissociatePackageCommand = async ( input: DissociatePackageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/packages/dissociate/{PackageID}/{DomainName}"; if (input.PackageID !== undefined) { const labelValue: string = input.PackageID; @@ -898,9 +891,7 @@ export const serializeAws_restJson1GetCompatibleElasticsearchVersionsCommand = a input: GetCompatibleElasticsearchVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/compatibleVersions"; const query: any = { ...(input.DomainName !== undefined && { domainName: input.DomainName }), @@ -923,9 +914,7 @@ export const serializeAws_restJson1GetPackageVersionHistoryCommand = async ( input: GetPackageVersionHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/packages/{PackageID}/history"; if (input.PackageID !== undefined) { const labelValue: string = input.PackageID; @@ -958,9 +947,7 @@ export const serializeAws_restJson1GetUpgradeHistoryCommand = async ( input: GetUpgradeHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/upgradeDomain/{DomainName}/history"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -993,9 +980,7 @@ export const serializeAws_restJson1GetUpgradeStatusCommand = async ( input: GetUpgradeStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/upgradeDomain/{DomainName}/status"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -1023,12 +1008,10 @@ export const serializeAws_restJson1ListDomainNamesCommand = async ( input: ListDomainNamesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/domain"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1045,9 +1028,7 @@ export const serializeAws_restJson1ListDomainsForPackageCommand = async ( input: ListDomainsForPackageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/packages/{PackageID}/domains"; if (input.PackageID !== undefined) { const labelValue: string = input.PackageID; @@ -1080,9 +1061,7 @@ export const serializeAws_restJson1ListElasticsearchInstanceTypesCommand = async input: ListElasticsearchInstanceTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/instanceTypes/{ElasticsearchVersion}"; if (input.ElasticsearchVersion !== undefined) { const labelValue: string = input.ElasticsearchVersion; @@ -1116,9 +1095,7 @@ export const serializeAws_restJson1ListElasticsearchVersionsCommand = async ( input: ListElasticsearchVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/versions"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1142,9 +1119,7 @@ export const serializeAws_restJson1ListPackagesForDomainCommand = async ( input: ListPackagesForDomainCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/domain/{DomainName}/packages"; if (input.DomainName !== undefined) { const labelValue: string = input.DomainName; @@ -1177,9 +1152,7 @@ export const serializeAws_restJson1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/tags"; const query: any = { ...(input.ARN !== undefined && { arn: input.ARN }), @@ -1203,16 +1176,18 @@ export const serializeAws_restJson1PurchaseReservedElasticsearchInstanceOffering context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/purchaseReservedInstanceOffering"; let body: any; body = JSON.stringify({ - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.ReservationName !== undefined && { ReservationName: input.ReservationName }), - ...(input.ReservedElasticsearchInstanceOfferingId !== undefined && { - ReservedElasticsearchInstanceOfferingId: input.ReservedElasticsearchInstanceOfferingId, - }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.ReservationName !== undefined && + input.ReservationName !== null && { ReservationName: input.ReservationName }), + ...(input.ReservedElasticsearchInstanceOfferingId !== undefined && + input.ReservedElasticsearchInstanceOfferingId !== null && { + ReservedElasticsearchInstanceOfferingId: input.ReservedElasticsearchInstanceOfferingId, + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1230,9 +1205,7 @@ export const serializeAws_restJson1RejectInboundCrossClusterSearchConnectionComm input: RejectInboundCrossClusterSearchConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-01-01/es/ccs/inboundConnection/{CrossClusterSearchConnectionId}/reject"; if (input.CrossClusterSearchConnectionId !== undefined) { const labelValue: string = input.CrossClusterSearchConnectionId; @@ -1261,13 +1234,14 @@ export const serializeAws_restJson1RemoveTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/tags-removal"; let body: any; body = JSON.stringify({ - ...(input.ARN !== undefined && { ARN: input.ARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_restJson1StringList(input.TagKeys, context) }), + ...(input.ARN !== undefined && input.ARN !== null && { ARN: input.ARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_restJson1StringList(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1286,12 +1260,12 @@ export const serializeAws_restJson1StartElasticsearchServiceSoftwareUpdateComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/serviceSoftwareUpdate/start"; let body: any; body = JSON.stringify({ - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1310,7 +1284,7 @@ export const serializeAws_restJson1UpdateElasticsearchDomainConfigCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/domain/{DomainName}/config"; if (input.DomainName !== undefined) { @@ -1324,36 +1298,46 @@ export const serializeAws_restJson1UpdateElasticsearchDomainConfigCommand = asyn } let body: any; body = JSON.stringify({ - ...(input.AccessPolicies !== undefined && { AccessPolicies: input.AccessPolicies }), - ...(input.AdvancedOptions !== undefined && { - AdvancedOptions: serializeAws_restJson1AdvancedOptions(input.AdvancedOptions, context), - }), - ...(input.AdvancedSecurityOptions !== undefined && { - AdvancedSecurityOptions: serializeAws_restJson1AdvancedSecurityOptionsInput( - input.AdvancedSecurityOptions, - context - ), - }), - ...(input.CognitoOptions !== undefined && { - CognitoOptions: serializeAws_restJson1CognitoOptions(input.CognitoOptions, context), - }), - ...(input.DomainEndpointOptions !== undefined && { - DomainEndpointOptions: serializeAws_restJson1DomainEndpointOptions(input.DomainEndpointOptions, context), - }), - ...(input.EBSOptions !== undefined && { EBSOptions: serializeAws_restJson1EBSOptions(input.EBSOptions, context) }), - ...(input.ElasticsearchClusterConfig !== undefined && { - ElasticsearchClusterConfig: serializeAws_restJson1ElasticsearchClusterConfig( - input.ElasticsearchClusterConfig, - context - ), - }), - ...(input.LogPublishingOptions !== undefined && { - LogPublishingOptions: serializeAws_restJson1LogPublishingOptions(input.LogPublishingOptions, context), - }), - ...(input.SnapshotOptions !== undefined && { - SnapshotOptions: serializeAws_restJson1SnapshotOptions(input.SnapshotOptions, context), - }), - ...(input.VPCOptions !== undefined && { VPCOptions: serializeAws_restJson1VPCOptions(input.VPCOptions, context) }), + ...(input.AccessPolicies !== undefined && + input.AccessPolicies !== null && { AccessPolicies: input.AccessPolicies }), + ...(input.AdvancedOptions !== undefined && + input.AdvancedOptions !== null && { + AdvancedOptions: serializeAws_restJson1AdvancedOptions(input.AdvancedOptions, context), + }), + ...(input.AdvancedSecurityOptions !== undefined && + input.AdvancedSecurityOptions !== null && { + AdvancedSecurityOptions: serializeAws_restJson1AdvancedSecurityOptionsInput( + input.AdvancedSecurityOptions, + context + ), + }), + ...(input.CognitoOptions !== undefined && + input.CognitoOptions !== null && { + CognitoOptions: serializeAws_restJson1CognitoOptions(input.CognitoOptions, context), + }), + ...(input.DomainEndpointOptions !== undefined && + input.DomainEndpointOptions !== null && { + DomainEndpointOptions: serializeAws_restJson1DomainEndpointOptions(input.DomainEndpointOptions, context), + }), + ...(input.EBSOptions !== undefined && + input.EBSOptions !== null && { EBSOptions: serializeAws_restJson1EBSOptions(input.EBSOptions, context) }), + ...(input.ElasticsearchClusterConfig !== undefined && + input.ElasticsearchClusterConfig !== null && { + ElasticsearchClusterConfig: serializeAws_restJson1ElasticsearchClusterConfig( + input.ElasticsearchClusterConfig, + context + ), + }), + ...(input.LogPublishingOptions !== undefined && + input.LogPublishingOptions !== null && { + LogPublishingOptions: serializeAws_restJson1LogPublishingOptions(input.LogPublishingOptions, context), + }), + ...(input.SnapshotOptions !== undefined && + input.SnapshotOptions !== null && { + SnapshotOptions: serializeAws_restJson1SnapshotOptions(input.SnapshotOptions, context), + }), + ...(input.VPCOptions !== undefined && + input.VPCOptions !== null && { VPCOptions: serializeAws_restJson1VPCOptions(input.VPCOptions, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1372,17 +1356,19 @@ export const serializeAws_restJson1UpdatePackageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/packages/update"; let body: any; body = JSON.stringify({ - ...(input.CommitMessage !== undefined && { CommitMessage: input.CommitMessage }), - ...(input.PackageDescription !== undefined && { PackageDescription: input.PackageDescription }), - ...(input.PackageID !== undefined && { PackageID: input.PackageID }), - ...(input.PackageSource !== undefined && { - PackageSource: serializeAws_restJson1PackageSource(input.PackageSource, context), - }), + ...(input.CommitMessage !== undefined && input.CommitMessage !== null && { CommitMessage: input.CommitMessage }), + ...(input.PackageDescription !== undefined && + input.PackageDescription !== null && { PackageDescription: input.PackageDescription }), + ...(input.PackageID !== undefined && input.PackageID !== null && { PackageID: input.PackageID }), + ...(input.PackageSource !== undefined && + input.PackageSource !== null && { + PackageSource: serializeAws_restJson1PackageSource(input.PackageSource, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1401,14 +1387,15 @@ export const serializeAws_restJson1UpgradeElasticsearchDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-01-01/es/upgradeDomain"; let body: any; body = JSON.stringify({ - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.PerformCheckOnly !== undefined && { PerformCheckOnly: input.PerformCheckOnly }), - ...(input.TargetVersion !== undefined && { TargetVersion: input.TargetVersion }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.PerformCheckOnly !== undefined && + input.PerformCheckOnly !== null && { PerformCheckOnly: input.PerformCheckOnly }), + ...(input.TargetVersion !== undefined && input.TargetVersion !== null && { TargetVersion: input.TargetVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4921,13 +4908,15 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1AdvancedOptions = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AdvancedSecurityOptionsInput = ( @@ -4935,34 +4924,35 @@ const serializeAws_restJson1AdvancedSecurityOptionsInput = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.InternalUserDatabaseEnabled !== undefined && { - InternalUserDatabaseEnabled: input.InternalUserDatabaseEnabled, - }), - ...(input.MasterUserOptions !== undefined && { - MasterUserOptions: serializeAws_restJson1MasterUserOptions(input.MasterUserOptions, context), - }), - ...(input.SAMLOptions !== undefined && { - SAMLOptions: serializeAws_restJson1SAMLOptionsInput(input.SAMLOptions, context), - }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.InternalUserDatabaseEnabled !== undefined && + input.InternalUserDatabaseEnabled !== null && { InternalUserDatabaseEnabled: input.InternalUserDatabaseEnabled }), + ...(input.MasterUserOptions !== undefined && + input.MasterUserOptions !== null && { + MasterUserOptions: serializeAws_restJson1MasterUserOptions(input.MasterUserOptions, context), + }), + ...(input.SAMLOptions !== undefined && + input.SAMLOptions !== null && { + SAMLOptions: serializeAws_restJson1SAMLOptionsInput(input.SAMLOptions, context), + }), }; }; const serializeAws_restJson1CognitoOptions = (input: CognitoOptions, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.IdentityPoolId !== undefined && { IdentityPoolId: input.IdentityPoolId }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.IdentityPoolId !== undefined && + input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.UserPoolId !== undefined && input.UserPoolId !== null && { UserPoolId: input.UserPoolId }), }; }; const serializeAws_restJson1DescribePackagesFilter = (input: DescribePackagesFilter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { - Value: serializeAws_restJson1DescribePackagesFilterValues(input.Value, context), - }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && + input.Value !== null && { Value: serializeAws_restJson1DescribePackagesFilterValues(input.Value, context) }), }; }; @@ -4970,43 +4960,68 @@ const serializeAws_restJson1DescribePackagesFilterList = ( input: DescribePackagesFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DescribePackagesFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DescribePackagesFilter(entry, context); + }); }; const serializeAws_restJson1DescribePackagesFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DomainEndpointOptions = (input: DomainEndpointOptions, context: __SerdeContext): any => { return { - ...(input.CustomEndpoint !== undefined && { CustomEndpoint: input.CustomEndpoint }), - ...(input.CustomEndpointCertificateArn !== undefined && { - CustomEndpointCertificateArn: input.CustomEndpointCertificateArn, - }), - ...(input.CustomEndpointEnabled !== undefined && { CustomEndpointEnabled: input.CustomEndpointEnabled }), - ...(input.EnforceHTTPS !== undefined && { EnforceHTTPS: input.EnforceHTTPS }), - ...(input.TLSSecurityPolicy !== undefined && { TLSSecurityPolicy: input.TLSSecurityPolicy }), + ...(input.CustomEndpoint !== undefined && + input.CustomEndpoint !== null && { CustomEndpoint: input.CustomEndpoint }), + ...(input.CustomEndpointCertificateArn !== undefined && + input.CustomEndpointCertificateArn !== null && { + CustomEndpointCertificateArn: input.CustomEndpointCertificateArn, + }), + ...(input.CustomEndpointEnabled !== undefined && + input.CustomEndpointEnabled !== null && { CustomEndpointEnabled: input.CustomEndpointEnabled }), + ...(input.EnforceHTTPS !== undefined && input.EnforceHTTPS !== null && { EnforceHTTPS: input.EnforceHTTPS }), + ...(input.TLSSecurityPolicy !== undefined && + input.TLSSecurityPolicy !== null && { TLSSecurityPolicy: input.TLSSecurityPolicy }), }; }; const serializeAws_restJson1DomainInformation = (input: DomainInformation, context: __SerdeContext): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.OwnerId !== undefined && { OwnerId: input.OwnerId }), - ...(input.Region !== undefined && { Region: input.Region }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.OwnerId !== undefined && input.OwnerId !== null && { OwnerId: input.OwnerId }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), }; }; const serializeAws_restJson1DomainNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1EBSOptions = (input: EBSOptions, context: __SerdeContext): any => { return { - ...(input.EBSEnabled !== undefined && { EBSEnabled: input.EBSEnabled }), - ...(input.Iops !== undefined && { Iops: input.Iops }), - ...(input.VolumeSize !== undefined && { VolumeSize: input.VolumeSize }), - ...(input.VolumeType !== undefined && { VolumeType: input.VolumeType }), + ...(input.EBSEnabled !== undefined && input.EBSEnabled !== null && { EBSEnabled: input.EBSEnabled }), + ...(input.Iops !== undefined && input.Iops !== null && { Iops: input.Iops }), + ...(input.VolumeSize !== undefined && input.VolumeSize !== null && { VolumeSize: input.VolumeSize }), + ...(input.VolumeType !== undefined && input.VolumeType !== null && { VolumeType: input.VolumeType }), }; }; @@ -5015,18 +5030,23 @@ const serializeAws_restJson1ElasticsearchClusterConfig = ( context: __SerdeContext ): any => { return { - ...(input.DedicatedMasterCount !== undefined && { DedicatedMasterCount: input.DedicatedMasterCount }), - ...(input.DedicatedMasterEnabled !== undefined && { DedicatedMasterEnabled: input.DedicatedMasterEnabled }), - ...(input.DedicatedMasterType !== undefined && { DedicatedMasterType: input.DedicatedMasterType }), - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.WarmCount !== undefined && { WarmCount: input.WarmCount }), - ...(input.WarmEnabled !== undefined && { WarmEnabled: input.WarmEnabled }), - ...(input.WarmType !== undefined && { WarmType: input.WarmType }), - ...(input.ZoneAwarenessConfig !== undefined && { - ZoneAwarenessConfig: serializeAws_restJson1ZoneAwarenessConfig(input.ZoneAwarenessConfig, context), - }), - ...(input.ZoneAwarenessEnabled !== undefined && { ZoneAwarenessEnabled: input.ZoneAwarenessEnabled }), + ...(input.DedicatedMasterCount !== undefined && + input.DedicatedMasterCount !== null && { DedicatedMasterCount: input.DedicatedMasterCount }), + ...(input.DedicatedMasterEnabled !== undefined && + input.DedicatedMasterEnabled !== null && { DedicatedMasterEnabled: input.DedicatedMasterEnabled }), + ...(input.DedicatedMasterType !== undefined && + input.DedicatedMasterType !== null && { DedicatedMasterType: input.DedicatedMasterType }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.WarmCount !== undefined && input.WarmCount !== null && { WarmCount: input.WarmCount }), + ...(input.WarmEnabled !== undefined && input.WarmEnabled !== null && { WarmEnabled: input.WarmEnabled }), + ...(input.WarmType !== undefined && input.WarmType !== null && { WarmType: input.WarmType }), + ...(input.ZoneAwarenessConfig !== undefined && + input.ZoneAwarenessConfig !== null && { + ZoneAwarenessConfig: serializeAws_restJson1ZoneAwarenessConfig(input.ZoneAwarenessConfig, context), + }), + ...(input.ZoneAwarenessEnabled !== undefined && + input.ZoneAwarenessEnabled !== null && { ZoneAwarenessEnabled: input.ZoneAwarenessEnabled }), }; }; @@ -5035,28 +5055,35 @@ const serializeAws_restJson1EncryptionAtRestOptions = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), }; }; const serializeAws_restJson1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1ValueStringList(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1ValueStringList(input.Values, context) }), }; }; const serializeAws_restJson1FilterList = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Filter(entry, context); + }); }; const serializeAws_restJson1LogPublishingOption = (input: LogPublishingOption, context: __SerdeContext): any => { return { - ...(input.CloudWatchLogsLogGroupArn !== undefined && { - CloudWatchLogsLogGroupArn: input.CloudWatchLogsLogGroupArn, - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.CloudWatchLogsLogGroupArn !== undefined && + input.CloudWatchLogsLogGroupArn !== null && { CloudWatchLogsLogGroupArn: input.CloudWatchLogsLogGroupArn }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; @@ -5065,19 +5092,26 @@ const serializeAws_restJson1LogPublishingOptions = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: LogPublishingOption }, [key, value]: [LogType | string, any]) => ({ - ...acc, - [key]: serializeAws_restJson1LogPublishingOption(value, context), - }), + (acc: { [key: string]: LogPublishingOption }, [key, value]: [LogType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_restJson1LogPublishingOption(value, context), + }; + }, {} ); }; const serializeAws_restJson1MasterUserOptions = (input: MasterUserOptions, context: __SerdeContext): any => { return { - ...(input.MasterUserARN !== undefined && { MasterUserARN: input.MasterUserARN }), - ...(input.MasterUserName !== undefined && { MasterUserName: input.MasterUserName }), - ...(input.MasterUserPassword !== undefined && { MasterUserPassword: input.MasterUserPassword }), + ...(input.MasterUserARN !== undefined && input.MasterUserARN !== null && { MasterUserARN: input.MasterUserARN }), + ...(input.MasterUserName !== undefined && + input.MasterUserName !== null && { MasterUserName: input.MasterUserName }), + ...(input.MasterUserPassword !== undefined && + input.MasterUserPassword !== null && { MasterUserPassword: input.MasterUserPassword }), }; }; @@ -5086,75 +5120,102 @@ const serializeAws_restJson1NodeToNodeEncryptionOptions = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; const serializeAws_restJson1PackageSource = (input: PackageSource, context: __SerdeContext): any => { return { - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.S3Key !== undefined && { S3Key: input.S3Key }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.S3Key !== undefined && input.S3Key !== null && { S3Key: input.S3Key }), }; }; const serializeAws_restJson1SAMLIdp = (input: SAMLIdp, context: __SerdeContext): any => { return { - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.MetadataContent !== undefined && { MetadataContent: input.MetadataContent }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.MetadataContent !== undefined && + input.MetadataContent !== null && { MetadataContent: input.MetadataContent }), }; }; const serializeAws_restJson1SAMLOptionsInput = (input: SAMLOptionsInput, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.Idp !== undefined && { Idp: serializeAws_restJson1SAMLIdp(input.Idp, context) }), - ...(input.MasterBackendRole !== undefined && { MasterBackendRole: input.MasterBackendRole }), - ...(input.MasterUserName !== undefined && { MasterUserName: input.MasterUserName }), - ...(input.RolesKey !== undefined && { RolesKey: input.RolesKey }), - ...(input.SessionTimeoutMinutes !== undefined && { SessionTimeoutMinutes: input.SessionTimeoutMinutes }), - ...(input.SubjectKey !== undefined && { SubjectKey: input.SubjectKey }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.Idp !== undefined && input.Idp !== null && { Idp: serializeAws_restJson1SAMLIdp(input.Idp, context) }), + ...(input.MasterBackendRole !== undefined && + input.MasterBackendRole !== null && { MasterBackendRole: input.MasterBackendRole }), + ...(input.MasterUserName !== undefined && + input.MasterUserName !== null && { MasterUserName: input.MasterUserName }), + ...(input.RolesKey !== undefined && input.RolesKey !== null && { RolesKey: input.RolesKey }), + ...(input.SessionTimeoutMinutes !== undefined && + input.SessionTimeoutMinutes !== null && { SessionTimeoutMinutes: input.SessionTimeoutMinutes }), + ...(input.SubjectKey !== undefined && input.SubjectKey !== null && { SubjectKey: input.SubjectKey }), }; }; const serializeAws_restJson1SnapshotOptions = (input: SnapshotOptions, context: __SerdeContext): any => { return { - ...(input.AutomatedSnapshotStartHour !== undefined && { - AutomatedSnapshotStartHour: input.AutomatedSnapshotStartHour, - }), + ...(input.AutomatedSnapshotStartHour !== undefined && + input.AutomatedSnapshotStartHour !== null && { AutomatedSnapshotStartHour: input.AutomatedSnapshotStartHour }), }; }; const serializeAws_restJson1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1ValueStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1VPCOptions = (input: VPCOptions, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_restJson1StringList(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_restJson1StringList(input.SubnetIds, context) }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_restJson1StringList(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_restJson1StringList(input.SubnetIds, context) }), }; }; const serializeAws_restJson1ZoneAwarenessConfig = (input: ZoneAwarenessConfig, context: __SerdeContext): any => { return { - ...(input.AvailabilityZoneCount !== undefined && { AvailabilityZoneCount: input.AvailabilityZoneCount }), + ...(input.AvailabilityZoneCount !== undefined && + input.AvailabilityZoneCount !== null && { AvailabilityZoneCount: input.AvailabilityZoneCount }), }; }; @@ -5179,17 +5240,26 @@ const deserializeAws_restJson1AdditionalLimit = (output: any, context: __SerdeCo }; const deserializeAws_restJson1AdditionalLimitList = (output: any, context: __SerdeContext): AdditionalLimit[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AdditionalLimit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AdditionalLimit(entry, context); + }); }; const deserializeAws_restJson1AdvancedOptions = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AdvancedOptionsStatus = (output: any, context: __SerdeContext): AdvancedOptionsStatus => { @@ -5265,7 +5335,14 @@ const deserializeAws_restJson1CompatibleElasticsearchVersionsList = ( output: any, context: __SerdeContext ): CompatibleVersionsMap[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CompatibleVersionsMap(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CompatibleVersionsMap(entry, context); + }); }; const deserializeAws_restJson1CompatibleVersionsMap = (output: any, context: __SerdeContext): CompatibleVersionsMap => { @@ -5322,7 +5399,14 @@ const deserializeAws_restJson1DomainInfo = (output: any, context: __SerdeContext }; const deserializeAws_restJson1DomainInfoList = (output: any, context: __SerdeContext): DomainInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainInfo(entry, context); + }); }; const deserializeAws_restJson1DomainInformation = (output: any, context: __SerdeContext): DomainInformation => { @@ -5362,7 +5446,14 @@ const deserializeAws_restJson1DomainPackageDetailsList = ( output: any, context: __SerdeContext ): DomainPackageDetails[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainPackageDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainPackageDetails(entry, context); + }); }; const deserializeAws_restJson1EBSOptions = (output: any, context: __SerdeContext): EBSOptions => { @@ -5578,18 +5669,39 @@ const deserializeAws_restJson1ElasticsearchDomainStatusList = ( output: any, context: __SerdeContext ): ElasticsearchDomainStatus[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ElasticsearchDomainStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ElasticsearchDomainStatus(entry, context); + }); }; const deserializeAws_restJson1ElasticsearchInstanceTypeList = ( output: any, context: __SerdeContext ): (ESPartitionInstanceType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ElasticsearchVersionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ElasticsearchVersionStatus = ( @@ -5632,13 +5744,15 @@ const deserializeAws_restJson1EncryptionAtRestOptionsStatus = ( }; const deserializeAws_restJson1EndpointsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ErrorDetails = (output: any, context: __SerdeContext): ErrorDetails => { @@ -5676,9 +5790,14 @@ const deserializeAws_restJson1InboundCrossClusterSearchConnections = ( output: any, context: __SerdeContext ): InboundCrossClusterSearchConnection[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1InboundCrossClusterSearchConnection(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InboundCrossClusterSearchConnection(entry, context); + }); }; const deserializeAws_restJson1InboundCrossClusterSearchConnectionStatus = ( @@ -5714,7 +5833,14 @@ const deserializeAws_restJson1InstanceLimits = (output: any, context: __SerdeCon }; const deserializeAws_restJson1Issues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Limits = (output: any, context: __SerdeContext): Limits => { @@ -5735,17 +5861,26 @@ const deserializeAws_restJson1Limits = (output: any, context: __SerdeContext): L }; const deserializeAws_restJson1LimitsByRole = (output: any, context: __SerdeContext): { [key: string]: Limits } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Limits }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Limits }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1Limits(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1LimitValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1LogPublishingOption = (output: any, context: __SerdeContext): LogPublishingOption => { @@ -5763,10 +5898,15 @@ const deserializeAws_restJson1LogPublishingOptions = ( context: __SerdeContext ): { [key: string]: LogPublishingOption } => { return Object.entries(output).reduce( - (acc: { [key: string]: LogPublishingOption }, [key, value]: [LogType | string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1LogPublishingOption(value, context), - }), + (acc: { [key: string]: LogPublishingOption }, [key, value]: [LogType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1LogPublishingOption(value, context), + }; + }, {} ); }; @@ -5860,9 +6000,14 @@ const deserializeAws_restJson1OutboundCrossClusterSearchConnections = ( output: any, context: __SerdeContext ): OutboundCrossClusterSearchConnection[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1OutboundCrossClusterSearchConnection(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutboundCrossClusterSearchConnection(entry, context); + }); }; const deserializeAws_restJson1OutboundCrossClusterSearchConnectionStatus = ( @@ -5906,7 +6051,14 @@ const deserializeAws_restJson1PackageDetails = (output: any, context: __SerdeCon }; const deserializeAws_restJson1PackageDetailsList = (output: any, context: __SerdeContext): PackageDetails[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PackageDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PackageDetails(entry, context); + }); }; const deserializeAws_restJson1PackageVersionHistory = (output: any, context: __SerdeContext): PackageVersionHistory => { @@ -5926,7 +6078,14 @@ const deserializeAws_restJson1PackageVersionHistoryList = ( output: any, context: __SerdeContext ): PackageVersionHistory[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PackageVersionHistory(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PackageVersionHistory(entry, context); + }); }; const deserializeAws_restJson1RecurringCharge = (output: any, context: __SerdeContext): RecurringCharge => { @@ -5943,7 +6102,14 @@ const deserializeAws_restJson1RecurringCharge = (output: any, context: __SerdeCo }; const deserializeAws_restJson1RecurringChargeList = (output: any, context: __SerdeContext): RecurringCharge[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecurringCharge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecurringCharge(entry, context); + }); }; const deserializeAws_restJson1ReservedElasticsearchInstance = ( @@ -5992,7 +6158,14 @@ const deserializeAws_restJson1ReservedElasticsearchInstanceList = ( output: any, context: __SerdeContext ): ReservedElasticsearchInstance[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ReservedElasticsearchInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ReservedElasticsearchInstance(entry, context); + }); }; const deserializeAws_restJson1ReservedElasticsearchInstanceOffering = ( @@ -6026,9 +6199,14 @@ const deserializeAws_restJson1ReservedElasticsearchInstanceOfferingList = ( output: any, context: __SerdeContext ): ReservedElasticsearchInstanceOffering[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1ReservedElasticsearchInstanceOffering(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ReservedElasticsearchInstanceOffering(entry, context); + }); }; const deserializeAws_restJson1SAMLIdp = (output: any, context: __SerdeContext): SAMLIdp => { @@ -6127,15 +6305,36 @@ const deserializeAws_restJson1StorageTypeLimit = (output: any, context: __SerdeC }; const deserializeAws_restJson1StorageTypeLimitList = (output: any, context: __SerdeContext): StorageTypeLimit[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StorageTypeLimit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StorageTypeLimit(entry, context); + }); }; const deserializeAws_restJson1StorageTypeList = (output: any, context: __SerdeContext): StorageType[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StorageType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StorageType(entry, context); + }); }; const deserializeAws_restJson1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -6146,7 +6345,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1UpgradeHistory = (output: any, context: __SerdeContext): UpgradeHistory => { @@ -6166,7 +6372,14 @@ const deserializeAws_restJson1UpgradeHistory = (output: any, context: __SerdeCon }; const deserializeAws_restJson1UpgradeHistoryList = (output: any, context: __SerdeContext): UpgradeHistory[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UpgradeHistory(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UpgradeHistory(entry, context); + }); }; const deserializeAws_restJson1UpgradeStepItem = (output: any, context: __SerdeContext): UpgradeStepItem => { @@ -6186,7 +6399,14 @@ const deserializeAws_restJson1UpgradeStepItem = (output: any, context: __SerdeCo }; const deserializeAws_restJson1UpgradeStepsList = (output: any, context: __SerdeContext): UpgradeStepItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UpgradeStepItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UpgradeStepItem(entry, context); + }); }; const deserializeAws_restJson1VPCDerivedInfo = (output: any, context: __SerdeContext): VPCDerivedInfo => { @@ -6249,6 +6469,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-emr-containers/protocols/Aws_restJson1.ts b/clients/client-emr-containers/protocols/Aws_restJson1.ts index 4cf71fe20a72..c7cbb93f38f5 100644 --- a/clients/client-emr-containers/protocols/Aws_restJson1.ts +++ b/clients/client-emr-containers/protocols/Aws_restJson1.ts @@ -75,9 +75,7 @@ export const serializeAws_restJson1CancelJobRunCommand = async ( input: CancelJobRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/virtualclusters/{virtualClusterId}/jobruns/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -115,7 +113,7 @@ export const serializeAws_restJson1CreateManagedEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/virtualclusters/{virtualClusterId}/endpoints"; if (input.virtualClusterId !== undefined) { @@ -129,16 +127,19 @@ export const serializeAws_restJson1CreateManagedEndpointCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.certificateArn !== undefined && { certificateArn: input.certificateArn }), + ...(input.certificateArn !== undefined && + input.certificateArn !== null && { certificateArn: input.certificateArn }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.configurationOverrides !== undefined && { - configurationOverrides: serializeAws_restJson1ConfigurationOverrides(input.configurationOverrides, context), - }), - ...(input.executionRoleArn !== undefined && { executionRoleArn: input.executionRoleArn }), - ...(input.name !== undefined && { name: input.name }), - ...(input.releaseLabel !== undefined && { releaseLabel: input.releaseLabel }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.configurationOverrides !== undefined && + input.configurationOverrides !== null && { + configurationOverrides: serializeAws_restJson1ConfigurationOverrides(input.configurationOverrides, context), + }), + ...(input.executionRoleArn !== undefined && + input.executionRoleArn !== null && { executionRoleArn: input.executionRoleArn }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.releaseLabel !== undefined && input.releaseLabel !== null && { releaseLabel: input.releaseLabel }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -157,17 +158,18 @@ export const serializeAws_restJson1CreateVirtualClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/virtualclusters"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.containerProvider !== undefined && { - containerProvider: serializeAws_restJson1ContainerProvider(input.containerProvider, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.containerProvider !== undefined && + input.containerProvider !== null && { + containerProvider: serializeAws_restJson1ContainerProvider(input.containerProvider, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -185,9 +187,7 @@ export const serializeAws_restJson1DeleteManagedEndpointCommand = async ( input: DeleteManagedEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/virtualclusters/{virtualClusterId}/endpoints/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -224,9 +224,7 @@ export const serializeAws_restJson1DeleteVirtualClusterCommand = async ( input: DeleteVirtualClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/virtualclusters/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -254,9 +252,7 @@ export const serializeAws_restJson1DescribeJobRunCommand = async ( input: DescribeJobRunCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/virtualclusters/{virtualClusterId}/jobruns/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -293,9 +289,7 @@ export const serializeAws_restJson1DescribeManagedEndpointCommand = async ( input: DescribeManagedEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/virtualclusters/{virtualClusterId}/endpoints/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -332,9 +326,7 @@ export const serializeAws_restJson1DescribeVirtualClusterCommand = async ( input: DescribeVirtualClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/virtualclusters/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -362,9 +354,7 @@ export const serializeAws_restJson1ListJobRunsCommand = async ( input: ListJobRunsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/virtualclusters/{virtualClusterId}/jobruns"; if (input.virtualClusterId !== undefined) { const labelValue: string = input.virtualClusterId; @@ -405,9 +395,7 @@ export const serializeAws_restJson1ListManagedEndpointsCommand = async ( input: ListManagedEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/virtualclusters/{virtualClusterId}/endpoints"; if (input.virtualClusterId !== undefined) { const labelValue: string = input.virtualClusterId; @@ -448,9 +436,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -478,9 +464,7 @@ export const serializeAws_restJson1ListVirtualClustersCommand = async ( input: ListVirtualClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/virtualclusters"; const query: any = { ...(input.containerProviderId !== undefined && { containerProviderId: input.containerProviderId }), @@ -514,7 +498,7 @@ export const serializeAws_restJson1StartJobRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/virtualclusters/{virtualClusterId}/jobruns"; if (input.virtualClusterId !== undefined) { @@ -529,14 +513,17 @@ export const serializeAws_restJson1StartJobRunCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.configurationOverrides !== undefined && { - configurationOverrides: serializeAws_restJson1ConfigurationOverrides(input.configurationOverrides, context), - }), - ...(input.executionRoleArn !== undefined && { executionRoleArn: input.executionRoleArn }), - ...(input.jobDriver !== undefined && { jobDriver: serializeAws_restJson1JobDriver(input.jobDriver, context) }), - ...(input.name !== undefined && { name: input.name }), - ...(input.releaseLabel !== undefined && { releaseLabel: input.releaseLabel }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.configurationOverrides !== undefined && + input.configurationOverrides !== null && { + configurationOverrides: serializeAws_restJson1ConfigurationOverrides(input.configurationOverrides, context), + }), + ...(input.executionRoleArn !== undefined && + input.executionRoleArn !== null && { executionRoleArn: input.executionRoleArn }), + ...(input.jobDriver !== undefined && + input.jobDriver !== null && { jobDriver: serializeAws_restJson1JobDriver(input.jobDriver, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.releaseLabel !== undefined && input.releaseLabel !== null && { releaseLabel: input.releaseLabel }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -555,7 +542,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -569,7 +556,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -587,9 +574,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1734,35 +1719,48 @@ const serializeAws_restJson1CloudWatchMonitoringConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.logStreamNamePrefix !== undefined && { logStreamNamePrefix: input.logStreamNamePrefix }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.logStreamNamePrefix !== undefined && + input.logStreamNamePrefix !== null && { logStreamNamePrefix: input.logStreamNamePrefix }), }; }; const serializeAws_restJson1Configuration = (input: Configuration, context: __SerdeContext): any => { return { - ...(input.classification !== undefined && { classification: input.classification }), - ...(input.configurations !== undefined && { - configurations: serializeAws_restJson1ConfigurationList(input.configurations, context), - }), - ...(input.properties !== undefined && { - properties: serializeAws_restJson1SensitivePropertiesMap(input.properties, context), - }), + ...(input.classification !== undefined && + input.classification !== null && { classification: input.classification }), + ...(input.configurations !== undefined && + input.configurations !== null && { + configurations: serializeAws_restJson1ConfigurationList(input.configurations, context), + }), + ...(input.properties !== undefined && + input.properties !== null && { + properties: serializeAws_restJson1SensitivePropertiesMap(input.properties, context), + }), }; }; const serializeAws_restJson1ConfigurationList = (input: Configuration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Configuration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Configuration(entry, context); + }); }; const serializeAws_restJson1ConfigurationOverrides = (input: ConfigurationOverrides, context: __SerdeContext): any => { return { - ...(input.applicationConfiguration !== undefined && { - applicationConfiguration: serializeAws_restJson1ConfigurationList(input.applicationConfiguration, context), - }), - ...(input.monitoringConfiguration !== undefined && { - monitoringConfiguration: serializeAws_restJson1MonitoringConfiguration(input.monitoringConfiguration, context), - }), + ...(input.applicationConfiguration !== undefined && + input.applicationConfiguration !== null && { + applicationConfiguration: serializeAws_restJson1ConfigurationList(input.applicationConfiguration, context), + }), + ...(input.monitoringConfiguration !== undefined && + input.monitoringConfiguration !== null && { + monitoringConfiguration: serializeAws_restJson1MonitoringConfiguration(input.monitoringConfiguration, context), + }), }; }; @@ -1775,27 +1773,36 @@ const serializeAws_restJson1ContainerInfo = (input: ContainerInfo, context: __Se const serializeAws_restJson1ContainerProvider = (input: ContainerProvider, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.info !== undefined && { info: serializeAws_restJson1ContainerInfo(input.info, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.info !== undefined && + input.info !== null && { info: serializeAws_restJson1ContainerInfo(input.info, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1EksInfo = (input: EksInfo, context: __SerdeContext): any => { return { - ...(input.namespace !== undefined && { namespace: input.namespace }), + ...(input.namespace !== undefined && input.namespace !== null && { namespace: input.namespace }), }; }; const serializeAws_restJson1EntryPointArguments = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1JobDriver = (input: JobDriver, context: __SerdeContext): any => { return { - ...(input.sparkSubmitJobDriver !== undefined && { - sparkSubmitJobDriver: serializeAws_restJson1SparkSubmitJobDriver(input.sparkSubmitJobDriver, context), - }), + ...(input.sparkSubmitJobDriver !== undefined && + input.sparkSubmitJobDriver !== null && { + sparkSubmitJobDriver: serializeAws_restJson1SparkSubmitJobDriver(input.sparkSubmitJobDriver, context), + }), }; }; @@ -1804,19 +1811,22 @@ const serializeAws_restJson1MonitoringConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.cloudWatchMonitoringConfiguration !== undefined && { - cloudWatchMonitoringConfiguration: serializeAws_restJson1CloudWatchMonitoringConfiguration( - input.cloudWatchMonitoringConfiguration, - context - ), - }), - ...(input.persistentAppUI !== undefined && { persistentAppUI: input.persistentAppUI }), - ...(input.s3MonitoringConfiguration !== undefined && { - s3MonitoringConfiguration: serializeAws_restJson1S3MonitoringConfiguration( - input.s3MonitoringConfiguration, - context - ), - }), + ...(input.cloudWatchMonitoringConfiguration !== undefined && + input.cloudWatchMonitoringConfiguration !== null && { + cloudWatchMonitoringConfiguration: serializeAws_restJson1CloudWatchMonitoringConfiguration( + input.cloudWatchMonitoringConfiguration, + context + ), + }), + ...(input.persistentAppUI !== undefined && + input.persistentAppUI !== null && { persistentAppUI: input.persistentAppUI }), + ...(input.s3MonitoringConfiguration !== undefined && + input.s3MonitoringConfiguration !== null && { + s3MonitoringConfiguration: serializeAws_restJson1S3MonitoringConfiguration( + input.s3MonitoringConfiguration, + context + ), + }), }; }; @@ -1825,7 +1835,7 @@ const serializeAws_restJson1S3MonitoringConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.logUri !== undefined && { logUri: input.logUri }), + ...(input.logUri !== undefined && input.logUri !== null && { logUri: input.logUri }), }; }; @@ -1833,33 +1843,39 @@ const serializeAws_restJson1SensitivePropertiesMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1SparkSubmitJobDriver = (input: SparkSubmitJobDriver, context: __SerdeContext): any => { return { - ...(input.entryPoint !== undefined && { entryPoint: input.entryPoint }), - ...(input.entryPointArguments !== undefined && { - entryPointArguments: serializeAws_restJson1EntryPointArguments(input.entryPointArguments, context), - }), - ...(input.sparkSubmitParameters !== undefined && { sparkSubmitParameters: input.sparkSubmitParameters }), + ...(input.entryPoint !== undefined && input.entryPoint !== null && { entryPoint: input.entryPoint }), + ...(input.entryPointArguments !== undefined && + input.entryPointArguments !== null && { + entryPointArguments: serializeAws_restJson1EntryPointArguments(input.entryPointArguments, context), + }), + ...(input.sparkSubmitParameters !== undefined && + input.sparkSubmitParameters !== null && { sparkSubmitParameters: input.sparkSubmitParameters }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1CloudWatchMonitoringConfiguration = ( @@ -1891,7 +1907,14 @@ const deserializeAws_restJson1Configuration = (output: any, context: __SerdeCont }; const deserializeAws_restJson1ConfigurationList = (output: any, context: __SerdeContext): Configuration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Configuration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Configuration(entry, context); + }); }; const deserializeAws_restJson1ConfigurationOverrides = ( @@ -1973,11 +1996,25 @@ const deserializeAws_restJson1Endpoint = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Endpoints = (output: any, context: __SerdeContext): Endpoint[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Endpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Endpoint(entry, context); + }); }; const deserializeAws_restJson1EntryPointArguments = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1JobDriver = (output: any, context: __SerdeContext): JobDriver => { @@ -2029,7 +2066,14 @@ const deserializeAws_restJson1JobRun = (output: any, context: __SerdeContext): J }; const deserializeAws_restJson1JobRuns = (output: any, context: __SerdeContext): JobRun[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobRun(entry, context); + }); }; const deserializeAws_restJson1MonitoringConfiguration = ( @@ -2063,13 +2107,15 @@ const deserializeAws_restJson1SensitivePropertiesMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1SparkSubmitJobDriver = (output: any, context: __SerdeContext): SparkSubmitJobDriver => { @@ -2087,17 +2133,26 @@ const deserializeAws_restJson1SparkSubmitJobDriver = (output: any, context: __Se }; const deserializeAws_restJson1SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1VirtualCluster = (output: any, context: __SerdeContext): VirtualCluster => { @@ -2122,7 +2177,14 @@ const deserializeAws_restJson1VirtualCluster = (output: any, context: __SerdeCon }; const deserializeAws_restJson1VirtualClusters = (output: any, context: __SerdeContext): VirtualCluster[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VirtualCluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VirtualCluster(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2145,6 +2207,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-emr/protocols/Aws_json1_1.ts b/clients/client-emr/protocols/Aws_json1_1.ts index f748f6eab11a..d384c0e1a8ca 100644 --- a/clients/client-emr/protocols/Aws_json1_1.ts +++ b/clients/client-emr/protocols/Aws_json1_1.ts @@ -313,7 +313,7 @@ export const serializeAws_json1_1AddInstanceFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.AddInstanceFleet", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1AddInstanceGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.AddInstanceGroups", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1AddJobFlowStepsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.AddJobFlowSteps", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.AddTags", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1CancelStepsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.CancelSteps", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1CreateSecurityConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.CreateSecurityConfiguration", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1CreateStudioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.CreateStudio", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1CreateStudioSessionMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.CreateStudioSessionMapping", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1DeleteSecurityConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.DeleteSecurityConfiguration", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1DeleteStudioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.DeleteStudio", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1DeleteStudioSessionMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.DeleteStudioSessionMapping", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1DescribeClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.DescribeCluster", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1DescribeJobFlowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.DescribeJobFlows", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1DescribeNotebookExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.DescribeNotebookExecution", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1DescribeSecurityConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.DescribeSecurityConfiguration", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1DescribeStepCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.DescribeStep", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1DescribeStudioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.DescribeStudio", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1GetBlockPublicAccessConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.GetBlockPublicAccessConfiguration", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1GetManagedScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.GetManagedScalingPolicy", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1GetStudioSessionMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.GetStudioSessionMapping", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1ListBootstrapActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListBootstrapActions", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1ListClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListClusters", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1ListInstanceFleetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListInstanceFleets", }; let body: any; @@ -612,7 +612,7 @@ export const serializeAws_json1_1ListInstanceGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListInstanceGroups", }; let body: any; @@ -625,7 +625,7 @@ export const serializeAws_json1_1ListInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListInstances", }; let body: any; @@ -638,7 +638,7 @@ export const serializeAws_json1_1ListNotebookExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListNotebookExecutions", }; let body: any; @@ -651,7 +651,7 @@ export const serializeAws_json1_1ListSecurityConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListSecurityConfigurations", }; let body: any; @@ -664,7 +664,7 @@ export const serializeAws_json1_1ListStepsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListSteps", }; let body: any; @@ -677,7 +677,7 @@ export const serializeAws_json1_1ListStudiosCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListStudios", }; let body: any; @@ -690,7 +690,7 @@ export const serializeAws_json1_1ListStudioSessionMappingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ListStudioSessionMappings", }; let body: any; @@ -703,7 +703,7 @@ export const serializeAws_json1_1ModifyClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ModifyCluster", }; let body: any; @@ -716,7 +716,7 @@ export const serializeAws_json1_1ModifyInstanceFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ModifyInstanceFleet", }; let body: any; @@ -729,7 +729,7 @@ export const serializeAws_json1_1ModifyInstanceGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.ModifyInstanceGroups", }; let body: any; @@ -742,7 +742,7 @@ export const serializeAws_json1_1PutAutoScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.PutAutoScalingPolicy", }; let body: any; @@ -755,7 +755,7 @@ export const serializeAws_json1_1PutBlockPublicAccessConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.PutBlockPublicAccessConfiguration", }; let body: any; @@ -768,7 +768,7 @@ export const serializeAws_json1_1PutManagedScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.PutManagedScalingPolicy", }; let body: any; @@ -781,7 +781,7 @@ export const serializeAws_json1_1RemoveAutoScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.RemoveAutoScalingPolicy", }; let body: any; @@ -794,7 +794,7 @@ export const serializeAws_json1_1RemoveManagedScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.RemoveManagedScalingPolicy", }; let body: any; @@ -807,7 +807,7 @@ export const serializeAws_json1_1RemoveTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.RemoveTags", }; let body: any; @@ -820,7 +820,7 @@ export const serializeAws_json1_1RunJobFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.RunJobFlow", }; let body: any; @@ -833,7 +833,7 @@ export const serializeAws_json1_1SetTerminationProtectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.SetTerminationProtection", }; let body: any; @@ -846,7 +846,7 @@ export const serializeAws_json1_1SetVisibleToAllUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.SetVisibleToAllUsers", }; let body: any; @@ -859,7 +859,7 @@ export const serializeAws_json1_1StartNotebookExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.StartNotebookExecution", }; let body: any; @@ -872,7 +872,7 @@ export const serializeAws_json1_1StopNotebookExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.StopNotebookExecution", }; let body: any; @@ -885,7 +885,7 @@ export const serializeAws_json1_1TerminateJobFlowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.TerminateJobFlows", }; let body: any; @@ -898,7 +898,7 @@ export const serializeAws_json1_1UpdateStudioSessionMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ElasticMapReduce.UpdateStudioSessionMapping", }; let body: any; @@ -933,8 +933,7 @@ const deserializeAws_json1_1AddInstanceFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -996,8 +995,7 @@ const deserializeAws_json1_1AddInstanceGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -1051,8 +1049,7 @@ const deserializeAws_json1_1AddJobFlowStepsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -1106,8 +1103,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -1169,8 +1165,7 @@ const deserializeAws_json1_1CancelStepsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -1232,8 +1227,7 @@ const deserializeAws_json1_1CreateSecurityConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -1295,8 +1289,7 @@ const deserializeAws_json1_1CreateStudioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -1355,8 +1348,7 @@ const deserializeAws_json1_1CreateStudioSessionMappingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -1418,8 +1410,7 @@ const deserializeAws_json1_1DeleteSecurityConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -1478,8 +1469,7 @@ const deserializeAws_json1_1DeleteStudioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -1538,8 +1528,7 @@ const deserializeAws_json1_1DeleteStudioSessionMappingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -1601,8 +1590,7 @@ const deserializeAws_json1_1DescribeClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -1664,8 +1652,7 @@ const deserializeAws_json1_1DescribeJobFlowsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -1719,8 +1706,7 @@ const deserializeAws_json1_1DescribeNotebookExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -1782,8 +1768,7 @@ const deserializeAws_json1_1DescribeSecurityConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -1845,8 +1830,7 @@ const deserializeAws_json1_1DescribeStepCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -1908,8 +1892,7 @@ const deserializeAws_json1_1DescribeStudioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -1971,8 +1954,7 @@ const deserializeAws_json1_1GetBlockPublicAccessConfigurationCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2034,8 +2016,7 @@ const deserializeAws_json1_1GetManagedScalingPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -2081,8 +2062,7 @@ const deserializeAws_json1_1GetStudioSessionMappingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -2144,8 +2124,7 @@ const deserializeAws_json1_1ListBootstrapActionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2207,8 +2186,7 @@ const deserializeAws_json1_1ListClustersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2270,8 +2248,7 @@ const deserializeAws_json1_1ListInstanceFleetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2333,8 +2310,7 @@ const deserializeAws_json1_1ListInstanceGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2396,8 +2372,7 @@ const deserializeAws_json1_1ListInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2459,8 +2434,7 @@ const deserializeAws_json1_1ListNotebookExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -2522,8 +2496,7 @@ const deserializeAws_json1_1ListSecurityConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2585,8 +2558,7 @@ const deserializeAws_json1_1ListStepsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2648,8 +2620,7 @@ const deserializeAws_json1_1ListStudiosCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2711,8 +2682,7 @@ const deserializeAws_json1_1ListStudioSessionMappingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -2774,8 +2744,7 @@ const deserializeAws_json1_1ModifyClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -2834,8 +2803,7 @@ const deserializeAws_json1_1ModifyInstanceFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -2894,8 +2862,7 @@ const deserializeAws_json1_1ModifyInstanceGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -2949,8 +2916,7 @@ const deserializeAws_json1_1PutAutoScalingPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -2996,8 +2962,7 @@ const deserializeAws_json1_1PutBlockPublicAccessConfigurationCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -3059,8 +3024,7 @@ const deserializeAws_json1_1PutManagedScalingPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3106,8 +3070,7 @@ const deserializeAws_json1_1RemoveAutoScalingPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3153,8 +3116,7 @@ const deserializeAws_json1_1RemoveManagedScalingPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3200,8 +3162,7 @@ const deserializeAws_json1_1RemoveTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -3263,8 +3224,7 @@ const deserializeAws_json1_1RunJobFlowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -3315,8 +3275,7 @@ const deserializeAws_json1_1SetTerminationProtectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -3367,8 +3326,7 @@ const deserializeAws_json1_1SetVisibleToAllUsersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -3422,8 +3380,7 @@ const deserializeAws_json1_1StartNotebookExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.emr#InternalServerException": @@ -3482,8 +3439,7 @@ const deserializeAws_json1_1StopNotebookExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -3542,8 +3498,7 @@ const deserializeAws_json1_1TerminateJobFlowsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -3594,8 +3549,7 @@ const deserializeAws_json1_1UpdateStudioSessionMappingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.emr#InternalServerError": @@ -3677,57 +3631,71 @@ const deserializeAws_json1_1InvalidRequestExceptionResponse = async ( const serializeAws_json1_1AddInstanceFleetInput = (input: AddInstanceFleetInput, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.InstanceFleet !== undefined && { - InstanceFleet: serializeAws_json1_1InstanceFleetConfig(input.InstanceFleet, context), - }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.InstanceFleet !== undefined && + input.InstanceFleet !== null && { + InstanceFleet: serializeAws_json1_1InstanceFleetConfig(input.InstanceFleet, context), + }), }; }; const serializeAws_json1_1AddInstanceGroupsInput = (input: AddInstanceGroupsInput, context: __SerdeContext): any => { return { - ...(input.InstanceGroups !== undefined && { - InstanceGroups: serializeAws_json1_1InstanceGroupConfigList(input.InstanceGroups, context), - }), - ...(input.JobFlowId !== undefined && { JobFlowId: input.JobFlowId }), + ...(input.InstanceGroups !== undefined && + input.InstanceGroups !== null && { + InstanceGroups: serializeAws_json1_1InstanceGroupConfigList(input.InstanceGroups, context), + }), + ...(input.JobFlowId !== undefined && input.JobFlowId !== null && { JobFlowId: input.JobFlowId }), }; }; const serializeAws_json1_1AddJobFlowStepsInput = (input: AddJobFlowStepsInput, context: __SerdeContext): any => { return { - ...(input.JobFlowId !== undefined && { JobFlowId: input.JobFlowId }), - ...(input.Steps !== undefined && { Steps: serializeAws_json1_1StepConfigList(input.Steps, context) }), + ...(input.JobFlowId !== undefined && input.JobFlowId !== null && { JobFlowId: input.JobFlowId }), + ...(input.Steps !== undefined && + input.Steps !== null && { Steps: serializeAws_json1_1StepConfigList(input.Steps, context) }), }; }; const serializeAws_json1_1AddTagsInput = (input: AddTagsInput, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1Application = (input: Application, context: __SerdeContext): any => { return { - ...(input.AdditionalInfo !== undefined && { - AdditionalInfo: serializeAws_json1_1StringMap(input.AdditionalInfo, context), - }), - ...(input.Args !== undefined && { Args: serializeAws_json1_1StringList(input.Args, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.AdditionalInfo !== undefined && + input.AdditionalInfo !== null && { + AdditionalInfo: serializeAws_json1_1StringMap(input.AdditionalInfo, context), + }), + ...(input.Args !== undefined && + input.Args !== null && { Args: serializeAws_json1_1StringList(input.Args, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_json1_1ApplicationList = (input: Application[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Application(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Application(entry, context); + }); }; const serializeAws_json1_1AutoScalingPolicy = (input: AutoScalingPolicy, context: __SerdeContext): any => { return { - ...(input.Constraints !== undefined && { - Constraints: serializeAws_json1_1ScalingConstraints(input.Constraints, context), - }), - ...(input.Rules !== undefined && { Rules: serializeAws_json1_1ScalingRuleList(input.Rules, context) }), + ...(input.Constraints !== undefined && + input.Constraints !== null && { + Constraints: serializeAws_json1_1ScalingConstraints(input.Constraints, context), + }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_json1_1ScalingRuleList(input.Rules, context) }), }; }; @@ -3736,29 +3704,35 @@ const serializeAws_json1_1BlockPublicAccessConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.BlockPublicSecurityGroupRules !== undefined && { - BlockPublicSecurityGroupRules: input.BlockPublicSecurityGroupRules, - }), - ...(input.Classification !== undefined && { Classification: input.Classification }), - ...(input.Configurations !== undefined && { - Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), - }), - ...(input.PermittedPublicSecurityGroupRuleRanges !== undefined && { - PermittedPublicSecurityGroupRuleRanges: serializeAws_json1_1PortRanges( - input.PermittedPublicSecurityGroupRuleRanges, - context - ), - }), - ...(input.Properties !== undefined && { Properties: serializeAws_json1_1StringMap(input.Properties, context) }), + ...(input.BlockPublicSecurityGroupRules !== undefined && + input.BlockPublicSecurityGroupRules !== null && { + BlockPublicSecurityGroupRules: input.BlockPublicSecurityGroupRules, + }), + ...(input.Classification !== undefined && + input.Classification !== null && { Classification: input.Classification }), + ...(input.Configurations !== undefined && + input.Configurations !== null && { + Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), + }), + ...(input.PermittedPublicSecurityGroupRuleRanges !== undefined && + input.PermittedPublicSecurityGroupRuleRanges !== null && { + PermittedPublicSecurityGroupRuleRanges: serializeAws_json1_1PortRanges( + input.PermittedPublicSecurityGroupRuleRanges, + context + ), + }), + ...(input.Properties !== undefined && + input.Properties !== null && { Properties: serializeAws_json1_1StringMap(input.Properties, context) }), }; }; const serializeAws_json1_1BootstrapActionConfig = (input: BootstrapActionConfig, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ScriptBootstrapAction !== undefined && { - ScriptBootstrapAction: serializeAws_json1_1ScriptBootstrapActionConfig(input.ScriptBootstrapAction, context), - }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ScriptBootstrapAction !== undefined && + input.ScriptBootstrapAction !== null && { + ScriptBootstrapAction: serializeAws_json1_1ScriptBootstrapActionConfig(input.ScriptBootstrapAction, context), + }), }; }; @@ -3766,14 +3740,23 @@ const serializeAws_json1_1BootstrapActionConfigList = ( input: BootstrapActionConfig[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1BootstrapActionConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1BootstrapActionConfig(entry, context); + }); }; const serializeAws_json1_1CancelStepsInput = (input: CancelStepsInput, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.StepCancellationOption !== undefined && { StepCancellationOption: input.StepCancellationOption }), - ...(input.StepIds !== undefined && { StepIds: serializeAws_json1_1StepIdsList(input.StepIds, context) }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.StepCancellationOption !== undefined && + input.StepCancellationOption !== null && { StepCancellationOption: input.StepCancellationOption }), + ...(input.StepIds !== undefined && + input.StepIds !== null && { StepIds: serializeAws_json1_1StepIdsList(input.StepIds, context) }), }; }; @@ -3782,48 +3765,70 @@ const serializeAws_json1_1CloudWatchAlarmDefinition = ( context: __SerdeContext ): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_json1_1MetricDimensionList(input.Dimensions, context), - }), - ...(input.EvaluationPeriods !== undefined && { EvaluationPeriods: input.EvaluationPeriods }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Namespace !== undefined && { Namespace: input.Namespace }), - ...(input.Period !== undefined && { Period: input.Period }), - ...(input.Statistic !== undefined && { Statistic: input.Statistic }), - ...(input.Threshold !== undefined && { Threshold: input.Threshold }), - ...(input.Unit !== undefined && { Unit: input.Unit }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_json1_1MetricDimensionList(input.Dimensions, context) }), + ...(input.EvaluationPeriods !== undefined && + input.EvaluationPeriods !== null && { EvaluationPeriods: input.EvaluationPeriods }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Namespace !== undefined && input.Namespace !== null && { Namespace: input.Namespace }), + ...(input.Period !== undefined && input.Period !== null && { Period: input.Period }), + ...(input.Statistic !== undefined && input.Statistic !== null && { Statistic: input.Statistic }), + ...(input.Threshold !== undefined && input.Threshold !== null && { Threshold: input.Threshold }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), }; }; const serializeAws_json1_1ClusterStateList = (input: (ClusterState | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ComputeLimits = (input: ComputeLimits, context: __SerdeContext): any => { return { - ...(input.MaximumCapacityUnits !== undefined && { MaximumCapacityUnits: input.MaximumCapacityUnits }), - ...(input.MaximumCoreCapacityUnits !== undefined && { MaximumCoreCapacityUnits: input.MaximumCoreCapacityUnits }), - ...(input.MaximumOnDemandCapacityUnits !== undefined && { - MaximumOnDemandCapacityUnits: input.MaximumOnDemandCapacityUnits, - }), - ...(input.MinimumCapacityUnits !== undefined && { MinimumCapacityUnits: input.MinimumCapacityUnits }), - ...(input.UnitType !== undefined && { UnitType: input.UnitType }), + ...(input.MaximumCapacityUnits !== undefined && + input.MaximumCapacityUnits !== null && { MaximumCapacityUnits: input.MaximumCapacityUnits }), + ...(input.MaximumCoreCapacityUnits !== undefined && + input.MaximumCoreCapacityUnits !== null && { MaximumCoreCapacityUnits: input.MaximumCoreCapacityUnits }), + ...(input.MaximumOnDemandCapacityUnits !== undefined && + input.MaximumOnDemandCapacityUnits !== null && { + MaximumOnDemandCapacityUnits: input.MaximumOnDemandCapacityUnits, + }), + ...(input.MinimumCapacityUnits !== undefined && + input.MinimumCapacityUnits !== null && { MinimumCapacityUnits: input.MinimumCapacityUnits }), + ...(input.UnitType !== undefined && input.UnitType !== null && { UnitType: input.UnitType }), }; }; const serializeAws_json1_1Configuration = (input: Configuration, context: __SerdeContext): any => { return { - ...(input.Classification !== undefined && { Classification: input.Classification }), - ...(input.Configurations !== undefined && { - Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), - }), - ...(input.Properties !== undefined && { Properties: serializeAws_json1_1StringMap(input.Properties, context) }), + ...(input.Classification !== undefined && + input.Classification !== null && { Classification: input.Classification }), + ...(input.Configurations !== undefined && + input.Configurations !== null && { + Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), + }), + ...(input.Properties !== undefined && + input.Properties !== null && { Properties: serializeAws_json1_1StringMap(input.Properties, context) }), }; }; const serializeAws_json1_1ConfigurationList = (input: Configuration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Configuration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Configuration(entry, context); + }); }; const serializeAws_json1_1CreateSecurityConfigurationInput = ( @@ -3831,24 +3836,29 @@ const serializeAws_json1_1CreateSecurityConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SecurityConfiguration !== undefined && { SecurityConfiguration: input.SecurityConfiguration }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SecurityConfiguration !== undefined && + input.SecurityConfiguration !== null && { SecurityConfiguration: input.SecurityConfiguration }), }; }; const serializeAws_json1_1CreateStudioInput = (input: CreateStudioInput, context: __SerdeContext): any => { return { - ...(input.AuthMode !== undefined && { AuthMode: input.AuthMode }), - ...(input.DefaultS3Location !== undefined && { DefaultS3Location: input.DefaultS3Location }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EngineSecurityGroupId !== undefined && { EngineSecurityGroupId: input.EngineSecurityGroupId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ServiceRole !== undefined && { ServiceRole: input.ServiceRole }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.UserRole !== undefined && { UserRole: input.UserRole }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), - ...(input.WorkspaceSecurityGroupId !== undefined && { WorkspaceSecurityGroupId: input.WorkspaceSecurityGroupId }), + ...(input.AuthMode !== undefined && input.AuthMode !== null && { AuthMode: input.AuthMode }), + ...(input.DefaultS3Location !== undefined && + input.DefaultS3Location !== null && { DefaultS3Location: input.DefaultS3Location }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EngineSecurityGroupId !== undefined && + input.EngineSecurityGroupId !== null && { EngineSecurityGroupId: input.EngineSecurityGroupId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ServiceRole !== undefined && input.ServiceRole !== null && { ServiceRole: input.ServiceRole }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.UserRole !== undefined && input.UserRole !== null && { UserRole: input.UserRole }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), + ...(input.WorkspaceSecurityGroupId !== undefined && + input.WorkspaceSecurityGroupId !== null && { WorkspaceSecurityGroupId: input.WorkspaceSecurityGroupId }), }; }; @@ -3857,11 +3867,12 @@ const serializeAws_json1_1CreateStudioSessionMappingInput = ( context: __SerdeContext ): any => { return { - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.IdentityName !== undefined && { IdentityName: input.IdentityName }), - ...(input.IdentityType !== undefined && { IdentityType: input.IdentityType }), - ...(input.SessionPolicyArn !== undefined && { SessionPolicyArn: input.SessionPolicyArn }), - ...(input.StudioId !== undefined && { StudioId: input.StudioId }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.IdentityName !== undefined && input.IdentityName !== null && { IdentityName: input.IdentityName }), + ...(input.IdentityType !== undefined && input.IdentityType !== null && { IdentityType: input.IdentityType }), + ...(input.SessionPolicyArn !== undefined && + input.SessionPolicyArn !== null && { SessionPolicyArn: input.SessionPolicyArn }), + ...(input.StudioId !== undefined && input.StudioId !== null && { StudioId: input.StudioId }), }; }; @@ -3870,13 +3881,13 @@ const serializeAws_json1_1DeleteSecurityConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeleteStudioInput = (input: DeleteStudioInput, context: __SerdeContext): any => { return { - ...(input.StudioId !== undefined && { StudioId: input.StudioId }), + ...(input.StudioId !== undefined && input.StudioId !== null && { StudioId: input.StudioId }), }; }; @@ -3885,27 +3896,31 @@ const serializeAws_json1_1DeleteStudioSessionMappingInput = ( context: __SerdeContext ): any => { return { - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.IdentityName !== undefined && { IdentityName: input.IdentityName }), - ...(input.IdentityType !== undefined && { IdentityType: input.IdentityType }), - ...(input.StudioId !== undefined && { StudioId: input.StudioId }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.IdentityName !== undefined && input.IdentityName !== null && { IdentityName: input.IdentityName }), + ...(input.IdentityType !== undefined && input.IdentityType !== null && { IdentityType: input.IdentityType }), + ...(input.StudioId !== undefined && input.StudioId !== null && { StudioId: input.StudioId }), }; }; const serializeAws_json1_1DescribeClusterInput = (input: DescribeClusterInput, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), }; }; const serializeAws_json1_1DescribeJobFlowsInput = (input: DescribeJobFlowsInput, context: __SerdeContext): any => { return { - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.JobFlowIds !== undefined && { JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) }), - ...(input.JobFlowStates !== undefined && { - JobFlowStates: serializeAws_json1_1JobFlowExecutionStateList(input.JobFlowStates, context), - }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.JobFlowIds !== undefined && + input.JobFlowIds !== null && { JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) }), + ...(input.JobFlowStates !== undefined && + input.JobFlowStates !== null && { + JobFlowStates: serializeAws_json1_1JobFlowExecutionStateList(input.JobFlowStates, context), + }), }; }; @@ -3914,7 +3929,8 @@ const serializeAws_json1_1DescribeNotebookExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookExecutionId !== undefined && { NotebookExecutionId: input.NotebookExecutionId }), + ...(input.NotebookExecutionId !== undefined && + input.NotebookExecutionId !== null && { NotebookExecutionId: input.NotebookExecutionId }), }; }; @@ -3923,60 +3939,85 @@ const serializeAws_json1_1DescribeSecurityConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DescribeStepInput = (input: DescribeStepInput, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.StepId !== undefined && { StepId: input.StepId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.StepId !== undefined && input.StepId !== null && { StepId: input.StepId }), }; }; const serializeAws_json1_1DescribeStudioInput = (input: DescribeStudioInput, context: __SerdeContext): any => { return { - ...(input.StudioId !== undefined && { StudioId: input.StudioId }), + ...(input.StudioId !== undefined && input.StudioId !== null && { StudioId: input.StudioId }), }; }; const serializeAws_json1_1EbsBlockDeviceConfig = (input: EbsBlockDeviceConfig, context: __SerdeContext): any => { return { - ...(input.VolumeSpecification !== undefined && { - VolumeSpecification: serializeAws_json1_1VolumeSpecification(input.VolumeSpecification, context), - }), - ...(input.VolumesPerInstance !== undefined && { VolumesPerInstance: input.VolumesPerInstance }), + ...(input.VolumeSpecification !== undefined && + input.VolumeSpecification !== null && { + VolumeSpecification: serializeAws_json1_1VolumeSpecification(input.VolumeSpecification, context), + }), + ...(input.VolumesPerInstance !== undefined && + input.VolumesPerInstance !== null && { VolumesPerInstance: input.VolumesPerInstance }), }; }; const serializeAws_json1_1EbsBlockDeviceConfigList = (input: EbsBlockDeviceConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EbsBlockDeviceConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EbsBlockDeviceConfig(entry, context); + }); }; const serializeAws_json1_1EbsConfiguration = (input: EbsConfiguration, context: __SerdeContext): any => { return { - ...(input.EbsBlockDeviceConfigs !== undefined && { - EbsBlockDeviceConfigs: serializeAws_json1_1EbsBlockDeviceConfigList(input.EbsBlockDeviceConfigs, context), - }), - ...(input.EbsOptimized !== undefined && { EbsOptimized: input.EbsOptimized }), + ...(input.EbsBlockDeviceConfigs !== undefined && + input.EbsBlockDeviceConfigs !== null && { + EbsBlockDeviceConfigs: serializeAws_json1_1EbsBlockDeviceConfigList(input.EbsBlockDeviceConfigs, context), + }), + ...(input.EbsOptimized !== undefined && input.EbsOptimized !== null && { EbsOptimized: input.EbsOptimized }), }; }; const serializeAws_json1_1EC2InstanceIdsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EC2InstanceIdsToTerminateList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ExecutionEngineConfig = (input: ExecutionEngineConfig, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.MasterInstanceSecurityGroupId !== undefined && { - MasterInstanceSecurityGroupId: input.MasterInstanceSecurityGroupId, - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.MasterInstanceSecurityGroupId !== undefined && + input.MasterInstanceSecurityGroupId !== null && { + MasterInstanceSecurityGroupId: input.MasterInstanceSecurityGroupId, + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -3992,7 +4033,7 @@ const serializeAws_json1_1GetManagedScalingPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), }; }; @@ -4001,42 +4042,56 @@ const serializeAws_json1_1GetStudioSessionMappingInput = ( context: __SerdeContext ): any => { return { - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.IdentityName !== undefined && { IdentityName: input.IdentityName }), - ...(input.IdentityType !== undefined && { IdentityType: input.IdentityType }), - ...(input.StudioId !== undefined && { StudioId: input.StudioId }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.IdentityName !== undefined && input.IdentityName !== null && { IdentityName: input.IdentityName }), + ...(input.IdentityType !== undefined && input.IdentityType !== null && { IdentityType: input.IdentityType }), + ...(input.StudioId !== undefined && input.StudioId !== null && { StudioId: input.StudioId }), }; }; const serializeAws_json1_1HadoopJarStepConfig = (input: HadoopJarStepConfig, context: __SerdeContext): any => { return { - ...(input.Args !== undefined && { Args: serializeAws_json1_1XmlStringList(input.Args, context) }), - ...(input.Jar !== undefined && { Jar: input.Jar }), - ...(input.MainClass !== undefined && { MainClass: input.MainClass }), - ...(input.Properties !== undefined && { Properties: serializeAws_json1_1KeyValueList(input.Properties, context) }), + ...(input.Args !== undefined && + input.Args !== null && { Args: serializeAws_json1_1XmlStringList(input.Args, context) }), + ...(input.Jar !== undefined && input.Jar !== null && { Jar: input.Jar }), + ...(input.MainClass !== undefined && input.MainClass !== null && { MainClass: input.MainClass }), + ...(input.Properties !== undefined && + input.Properties !== null && { Properties: serializeAws_json1_1KeyValueList(input.Properties, context) }), }; }; const serializeAws_json1_1InstanceFleetConfig = (input: InstanceFleetConfig, context: __SerdeContext): any => { return { - ...(input.InstanceFleetType !== undefined && { InstanceFleetType: input.InstanceFleetType }), - ...(input.InstanceTypeConfigs !== undefined && { - InstanceTypeConfigs: serializeAws_json1_1InstanceTypeConfigList(input.InstanceTypeConfigs, context), - }), - ...(input.LaunchSpecifications !== undefined && { - LaunchSpecifications: serializeAws_json1_1InstanceFleetProvisioningSpecifications( - input.LaunchSpecifications, - context - ), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.TargetOnDemandCapacity !== undefined && { TargetOnDemandCapacity: input.TargetOnDemandCapacity }), - ...(input.TargetSpotCapacity !== undefined && { TargetSpotCapacity: input.TargetSpotCapacity }), + ...(input.InstanceFleetType !== undefined && + input.InstanceFleetType !== null && { InstanceFleetType: input.InstanceFleetType }), + ...(input.InstanceTypeConfigs !== undefined && + input.InstanceTypeConfigs !== null && { + InstanceTypeConfigs: serializeAws_json1_1InstanceTypeConfigList(input.InstanceTypeConfigs, context), + }), + ...(input.LaunchSpecifications !== undefined && + input.LaunchSpecifications !== null && { + LaunchSpecifications: serializeAws_json1_1InstanceFleetProvisioningSpecifications( + input.LaunchSpecifications, + context + ), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.TargetOnDemandCapacity !== undefined && + input.TargetOnDemandCapacity !== null && { TargetOnDemandCapacity: input.TargetOnDemandCapacity }), + ...(input.TargetSpotCapacity !== undefined && + input.TargetSpotCapacity !== null && { TargetSpotCapacity: input.TargetSpotCapacity }), }; }; const serializeAws_json1_1InstanceFleetConfigList = (input: InstanceFleetConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InstanceFleetConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InstanceFleetConfig(entry, context); + }); }; const serializeAws_json1_1InstanceFleetModifyConfig = ( @@ -4044,9 +4099,12 @@ const serializeAws_json1_1InstanceFleetModifyConfig = ( context: __SerdeContext ): any => { return { - ...(input.InstanceFleetId !== undefined && { InstanceFleetId: input.InstanceFleetId }), - ...(input.TargetOnDemandCapacity !== undefined && { TargetOnDemandCapacity: input.TargetOnDemandCapacity }), - ...(input.TargetSpotCapacity !== undefined && { TargetSpotCapacity: input.TargetSpotCapacity }), + ...(input.InstanceFleetId !== undefined && + input.InstanceFleetId !== null && { InstanceFleetId: input.InstanceFleetId }), + ...(input.TargetOnDemandCapacity !== undefined && + input.TargetOnDemandCapacity !== null && { TargetOnDemandCapacity: input.TargetOnDemandCapacity }), + ...(input.TargetSpotCapacity !== undefined && + input.TargetSpotCapacity !== null && { TargetSpotCapacity: input.TargetSpotCapacity }), }; }; @@ -4055,40 +4113,52 @@ const serializeAws_json1_1InstanceFleetProvisioningSpecifications = ( context: __SerdeContext ): any => { return { - ...(input.OnDemandSpecification !== undefined && { - OnDemandSpecification: serializeAws_json1_1OnDemandProvisioningSpecification( - input.OnDemandSpecification, - context - ), - }), - ...(input.SpotSpecification !== undefined && { - SpotSpecification: serializeAws_json1_1SpotProvisioningSpecification(input.SpotSpecification, context), - }), + ...(input.OnDemandSpecification !== undefined && + input.OnDemandSpecification !== null && { + OnDemandSpecification: serializeAws_json1_1OnDemandProvisioningSpecification( + input.OnDemandSpecification, + context + ), + }), + ...(input.SpotSpecification !== undefined && + input.SpotSpecification !== null && { + SpotSpecification: serializeAws_json1_1SpotProvisioningSpecification(input.SpotSpecification, context), + }), }; }; const serializeAws_json1_1InstanceGroupConfig = (input: InstanceGroupConfig, context: __SerdeContext): any => { return { - ...(input.AutoScalingPolicy !== undefined && { - AutoScalingPolicy: serializeAws_json1_1AutoScalingPolicy(input.AutoScalingPolicy, context), - }), - ...(input.BidPrice !== undefined && { BidPrice: input.BidPrice }), - ...(input.Configurations !== undefined && { - Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), - }), - ...(input.EbsConfiguration !== undefined && { - EbsConfiguration: serializeAws_json1_1EbsConfiguration(input.EbsConfiguration, context), - }), - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.InstanceRole !== undefined && { InstanceRole: input.InstanceRole }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.Market !== undefined && { Market: input.Market }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AutoScalingPolicy !== undefined && + input.AutoScalingPolicy !== null && { + AutoScalingPolicy: serializeAws_json1_1AutoScalingPolicy(input.AutoScalingPolicy, context), + }), + ...(input.BidPrice !== undefined && input.BidPrice !== null && { BidPrice: input.BidPrice }), + ...(input.Configurations !== undefined && + input.Configurations !== null && { + Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), + }), + ...(input.EbsConfiguration !== undefined && + input.EbsConfiguration !== null && { + EbsConfiguration: serializeAws_json1_1EbsConfiguration(input.EbsConfiguration, context), + }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.InstanceRole !== undefined && input.InstanceRole !== null && { InstanceRole: input.InstanceRole }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.Market !== undefined && input.Market !== null && { Market: input.Market }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1InstanceGroupConfigList = (input: InstanceGroupConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InstanceGroupConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InstanceGroupConfig(entry, context); + }); }; const serializeAws_json1_1InstanceGroupModifyConfig = ( @@ -4096,20 +4166,22 @@ const serializeAws_json1_1InstanceGroupModifyConfig = ( context: __SerdeContext ): any => { return { - ...(input.Configurations !== undefined && { - Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), - }), - ...(input.EC2InstanceIdsToTerminate !== undefined && { - EC2InstanceIdsToTerminate: serializeAws_json1_1EC2InstanceIdsToTerminateList( - input.EC2InstanceIdsToTerminate, - context - ), - }), - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.InstanceGroupId !== undefined && { InstanceGroupId: input.InstanceGroupId }), - ...(input.ShrinkPolicy !== undefined && { - ShrinkPolicy: serializeAws_json1_1ShrinkPolicy(input.ShrinkPolicy, context), - }), + ...(input.Configurations !== undefined && + input.Configurations !== null && { + Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), + }), + ...(input.EC2InstanceIdsToTerminate !== undefined && + input.EC2InstanceIdsToTerminate !== null && { + EC2InstanceIdsToTerminate: serializeAws_json1_1EC2InstanceIdsToTerminateList( + input.EC2InstanceIdsToTerminate, + context + ), + }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.InstanceGroupId !== undefined && + input.InstanceGroupId !== null && { InstanceGroupId: input.InstanceGroupId }), + ...(input.ShrinkPolicy !== undefined && + input.ShrinkPolicy !== null && { ShrinkPolicy: serializeAws_json1_1ShrinkPolicy(input.ShrinkPolicy, context) }), }; }; @@ -4117,129 +4189,189 @@ const serializeAws_json1_1InstanceGroupModifyConfigList = ( input: InstanceGroupModifyConfig[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1InstanceGroupModifyConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InstanceGroupModifyConfig(entry, context); + }); }; const serializeAws_json1_1InstanceGroupTypeList = ( input: (InstanceGroupType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InstanceResizePolicy = (input: InstanceResizePolicy, context: __SerdeContext): any => { return { - ...(input.InstanceTerminationTimeout !== undefined && { - InstanceTerminationTimeout: input.InstanceTerminationTimeout, - }), - ...(input.InstancesToProtect !== undefined && { - InstancesToProtect: serializeAws_json1_1EC2InstanceIdsList(input.InstancesToProtect, context), - }), - ...(input.InstancesToTerminate !== undefined && { - InstancesToTerminate: serializeAws_json1_1EC2InstanceIdsList(input.InstancesToTerminate, context), - }), + ...(input.InstanceTerminationTimeout !== undefined && + input.InstanceTerminationTimeout !== null && { InstanceTerminationTimeout: input.InstanceTerminationTimeout }), + ...(input.InstancesToProtect !== undefined && + input.InstancesToProtect !== null && { + InstancesToProtect: serializeAws_json1_1EC2InstanceIdsList(input.InstancesToProtect, context), + }), + ...(input.InstancesToTerminate !== undefined && + input.InstancesToTerminate !== null && { + InstancesToTerminate: serializeAws_json1_1EC2InstanceIdsList(input.InstancesToTerminate, context), + }), }; }; const serializeAws_json1_1InstanceStateList = (input: (InstanceState | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InstanceTypeConfig = (input: InstanceTypeConfig, context: __SerdeContext): any => { return { - ...(input.BidPrice !== undefined && { BidPrice: input.BidPrice }), - ...(input.BidPriceAsPercentageOfOnDemandPrice !== undefined && { - BidPriceAsPercentageOfOnDemandPrice: input.BidPriceAsPercentageOfOnDemandPrice, - }), - ...(input.Configurations !== undefined && { - Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), - }), - ...(input.EbsConfiguration !== undefined && { - EbsConfiguration: serializeAws_json1_1EbsConfiguration(input.EbsConfiguration, context), - }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.WeightedCapacity !== undefined && { WeightedCapacity: input.WeightedCapacity }), + ...(input.BidPrice !== undefined && input.BidPrice !== null && { BidPrice: input.BidPrice }), + ...(input.BidPriceAsPercentageOfOnDemandPrice !== undefined && + input.BidPriceAsPercentageOfOnDemandPrice !== null && { + BidPriceAsPercentageOfOnDemandPrice: input.BidPriceAsPercentageOfOnDemandPrice, + }), + ...(input.Configurations !== undefined && + input.Configurations !== null && { + Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), + }), + ...(input.EbsConfiguration !== undefined && + input.EbsConfiguration !== null && { + EbsConfiguration: serializeAws_json1_1EbsConfiguration(input.EbsConfiguration, context), + }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.WeightedCapacity !== undefined && + input.WeightedCapacity !== null && { WeightedCapacity: input.WeightedCapacity }), }; }; const serializeAws_json1_1InstanceTypeConfigList = (input: InstanceTypeConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InstanceTypeConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InstanceTypeConfig(entry, context); + }); }; const serializeAws_json1_1JobFlowExecutionStateList = ( input: (JobFlowExecutionState | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1JobFlowInstancesConfig = (input: JobFlowInstancesConfig, context: __SerdeContext): any => { return { - ...(input.AdditionalMasterSecurityGroups !== undefined && { - AdditionalMasterSecurityGroups: serializeAws_json1_1SecurityGroupsList( - input.AdditionalMasterSecurityGroups, - context - ), - }), - ...(input.AdditionalSlaveSecurityGroups !== undefined && { - AdditionalSlaveSecurityGroups: serializeAws_json1_1SecurityGroupsList( - input.AdditionalSlaveSecurityGroups, - context - ), - }), - ...(input.Ec2KeyName !== undefined && { Ec2KeyName: input.Ec2KeyName }), - ...(input.Ec2SubnetId !== undefined && { Ec2SubnetId: input.Ec2SubnetId }), - ...(input.Ec2SubnetIds !== undefined && { - Ec2SubnetIds: serializeAws_json1_1XmlStringMaxLen256List(input.Ec2SubnetIds, context), - }), - ...(input.EmrManagedMasterSecurityGroup !== undefined && { - EmrManagedMasterSecurityGroup: input.EmrManagedMasterSecurityGroup, - }), - ...(input.EmrManagedSlaveSecurityGroup !== undefined && { - EmrManagedSlaveSecurityGroup: input.EmrManagedSlaveSecurityGroup, - }), - ...(input.HadoopVersion !== undefined && { HadoopVersion: input.HadoopVersion }), - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.InstanceFleets !== undefined && { - InstanceFleets: serializeAws_json1_1InstanceFleetConfigList(input.InstanceFleets, context), - }), - ...(input.InstanceGroups !== undefined && { - InstanceGroups: serializeAws_json1_1InstanceGroupConfigList(input.InstanceGroups, context), - }), - ...(input.KeepJobFlowAliveWhenNoSteps !== undefined && { - KeepJobFlowAliveWhenNoSteps: input.KeepJobFlowAliveWhenNoSteps, - }), - ...(input.MasterInstanceType !== undefined && { MasterInstanceType: input.MasterInstanceType }), - ...(input.Placement !== undefined && { Placement: serializeAws_json1_1PlacementType(input.Placement, context) }), - ...(input.ServiceAccessSecurityGroup !== undefined && { - ServiceAccessSecurityGroup: input.ServiceAccessSecurityGroup, - }), - ...(input.SlaveInstanceType !== undefined && { SlaveInstanceType: input.SlaveInstanceType }), - ...(input.TerminationProtected !== undefined && { TerminationProtected: input.TerminationProtected }), + ...(input.AdditionalMasterSecurityGroups !== undefined && + input.AdditionalMasterSecurityGroups !== null && { + AdditionalMasterSecurityGroups: serializeAws_json1_1SecurityGroupsList( + input.AdditionalMasterSecurityGroups, + context + ), + }), + ...(input.AdditionalSlaveSecurityGroups !== undefined && + input.AdditionalSlaveSecurityGroups !== null && { + AdditionalSlaveSecurityGroups: serializeAws_json1_1SecurityGroupsList( + input.AdditionalSlaveSecurityGroups, + context + ), + }), + ...(input.Ec2KeyName !== undefined && input.Ec2KeyName !== null && { Ec2KeyName: input.Ec2KeyName }), + ...(input.Ec2SubnetId !== undefined && input.Ec2SubnetId !== null && { Ec2SubnetId: input.Ec2SubnetId }), + ...(input.Ec2SubnetIds !== undefined && + input.Ec2SubnetIds !== null && { + Ec2SubnetIds: serializeAws_json1_1XmlStringMaxLen256List(input.Ec2SubnetIds, context), + }), + ...(input.EmrManagedMasterSecurityGroup !== undefined && + input.EmrManagedMasterSecurityGroup !== null && { + EmrManagedMasterSecurityGroup: input.EmrManagedMasterSecurityGroup, + }), + ...(input.EmrManagedSlaveSecurityGroup !== undefined && + input.EmrManagedSlaveSecurityGroup !== null && { + EmrManagedSlaveSecurityGroup: input.EmrManagedSlaveSecurityGroup, + }), + ...(input.HadoopVersion !== undefined && input.HadoopVersion !== null && { HadoopVersion: input.HadoopVersion }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.InstanceFleets !== undefined && + input.InstanceFleets !== null && { + InstanceFleets: serializeAws_json1_1InstanceFleetConfigList(input.InstanceFleets, context), + }), + ...(input.InstanceGroups !== undefined && + input.InstanceGroups !== null && { + InstanceGroups: serializeAws_json1_1InstanceGroupConfigList(input.InstanceGroups, context), + }), + ...(input.KeepJobFlowAliveWhenNoSteps !== undefined && + input.KeepJobFlowAliveWhenNoSteps !== null && { KeepJobFlowAliveWhenNoSteps: input.KeepJobFlowAliveWhenNoSteps }), + ...(input.MasterInstanceType !== undefined && + input.MasterInstanceType !== null && { MasterInstanceType: input.MasterInstanceType }), + ...(input.Placement !== undefined && + input.Placement !== null && { Placement: serializeAws_json1_1PlacementType(input.Placement, context) }), + ...(input.ServiceAccessSecurityGroup !== undefined && + input.ServiceAccessSecurityGroup !== null && { ServiceAccessSecurityGroup: input.ServiceAccessSecurityGroup }), + ...(input.SlaveInstanceType !== undefined && + input.SlaveInstanceType !== null && { SlaveInstanceType: input.SlaveInstanceType }), + ...(input.TerminationProtected !== undefined && + input.TerminationProtected !== null && { TerminationProtected: input.TerminationProtected }), }; }; const serializeAws_json1_1KerberosAttributes = (input: KerberosAttributes, context: __SerdeContext): any => { return { - ...(input.ADDomainJoinPassword !== undefined && { ADDomainJoinPassword: input.ADDomainJoinPassword }), - ...(input.ADDomainJoinUser !== undefined && { ADDomainJoinUser: input.ADDomainJoinUser }), - ...(input.CrossRealmTrustPrincipalPassword !== undefined && { - CrossRealmTrustPrincipalPassword: input.CrossRealmTrustPrincipalPassword, - }), - ...(input.KdcAdminPassword !== undefined && { KdcAdminPassword: input.KdcAdminPassword }), - ...(input.Realm !== undefined && { Realm: input.Realm }), + ...(input.ADDomainJoinPassword !== undefined && + input.ADDomainJoinPassword !== null && { ADDomainJoinPassword: input.ADDomainJoinPassword }), + ...(input.ADDomainJoinUser !== undefined && + input.ADDomainJoinUser !== null && { ADDomainJoinUser: input.ADDomainJoinUser }), + ...(input.CrossRealmTrustPrincipalPassword !== undefined && + input.CrossRealmTrustPrincipalPassword !== null && { + CrossRealmTrustPrincipalPassword: input.CrossRealmTrustPrincipalPassword, + }), + ...(input.KdcAdminPassword !== undefined && + input.KdcAdminPassword !== null && { KdcAdminPassword: input.KdcAdminPassword }), + ...(input.Realm !== undefined && input.Realm !== null && { Realm: input.Realm }), }; }; const serializeAws_json1_1KeyValue = (input: KeyValue, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1KeyValueList = (input: KeyValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1KeyValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1KeyValue(entry, context); + }); }; const serializeAws_json1_1ListBootstrapActionsInput = ( @@ -4247,49 +4379,57 @@ const serializeAws_json1_1ListBootstrapActionsInput = ( context: __SerdeContext ): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListClustersInput = (input: ListClustersInput, context: __SerdeContext): any => { return { - ...(input.ClusterStates !== undefined && { - ClusterStates: serializeAws_json1_1ClusterStateList(input.ClusterStates, context), - }), - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.ClusterStates !== undefined && + input.ClusterStates !== null && { + ClusterStates: serializeAws_json1_1ClusterStateList(input.ClusterStates, context), + }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListInstanceFleetsInput = (input: ListInstanceFleetsInput, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListInstanceGroupsInput = (input: ListInstanceGroupsInput, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListInstancesInput = (input: ListInstancesInput, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.InstanceFleetId !== undefined && { InstanceFleetId: input.InstanceFleetId }), - ...(input.InstanceFleetType !== undefined && { InstanceFleetType: input.InstanceFleetType }), - ...(input.InstanceGroupId !== undefined && { InstanceGroupId: input.InstanceGroupId }), - ...(input.InstanceGroupTypes !== undefined && { - InstanceGroupTypes: serializeAws_json1_1InstanceGroupTypeList(input.InstanceGroupTypes, context), - }), - ...(input.InstanceStates !== undefined && { - InstanceStates: serializeAws_json1_1InstanceStateList(input.InstanceStates, context), - }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.InstanceFleetId !== undefined && + input.InstanceFleetId !== null && { InstanceFleetId: input.InstanceFleetId }), + ...(input.InstanceFleetType !== undefined && + input.InstanceFleetType !== null && { InstanceFleetType: input.InstanceFleetType }), + ...(input.InstanceGroupId !== undefined && + input.InstanceGroupId !== null && { InstanceGroupId: input.InstanceGroupId }), + ...(input.InstanceGroupTypes !== undefined && + input.InstanceGroupTypes !== null && { + InstanceGroupTypes: serializeAws_json1_1InstanceGroupTypeList(input.InstanceGroupTypes, context), + }), + ...(input.InstanceStates !== undefined && + input.InstanceStates !== null && { + InstanceStates: serializeAws_json1_1InstanceStateList(input.InstanceStates, context), + }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; @@ -4298,11 +4438,11 @@ const serializeAws_json1_1ListNotebookExecutionsInput = ( context: __SerdeContext ): any => { return { - ...(input.EditorId !== undefined && { EditorId: input.EditorId }), - ...(input.From !== undefined && { From: Math.round(input.From.getTime() / 1000) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.To !== undefined && { To: Math.round(input.To.getTime() / 1000) }), + ...(input.EditorId !== undefined && input.EditorId !== null && { EditorId: input.EditorId }), + ...(input.From !== undefined && input.From !== null && { From: Math.round(input.From.getTime() / 1000) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.To !== undefined && input.To !== null && { To: Math.round(input.To.getTime() / 1000) }), }; }; @@ -4311,16 +4451,18 @@ const serializeAws_json1_1ListSecurityConfigurationsInput = ( context: __SerdeContext ): any => { return { - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListStepsInput = (input: ListStepsInput, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.StepIds !== undefined && { StepIds: serializeAws_json1_1XmlStringList(input.StepIds, context) }), - ...(input.StepStates !== undefined && { StepStates: serializeAws_json1_1StepStateList(input.StepStates, context) }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.StepIds !== undefined && + input.StepIds !== null && { StepIds: serializeAws_json1_1XmlStringList(input.StepIds, context) }), + ...(input.StepStates !== undefined && + input.StepStates !== null && { StepStates: serializeAws_json1_1StepStateList(input.StepStates, context) }), }; }; @@ -4329,41 +4471,50 @@ const serializeAws_json1_1ListStudioSessionMappingsInput = ( context: __SerdeContext ): any => { return { - ...(input.IdentityType !== undefined && { IdentityType: input.IdentityType }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.StudioId !== undefined && { StudioId: input.StudioId }), + ...(input.IdentityType !== undefined && input.IdentityType !== null && { IdentityType: input.IdentityType }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.StudioId !== undefined && input.StudioId !== null && { StudioId: input.StudioId }), }; }; const serializeAws_json1_1ListStudiosInput = (input: ListStudiosInput, context: __SerdeContext): any => { return { - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ManagedScalingPolicy = (input: ManagedScalingPolicy, context: __SerdeContext): any => { return { - ...(input.ComputeLimits !== undefined && { - ComputeLimits: serializeAws_json1_1ComputeLimits(input.ComputeLimits, context), - }), + ...(input.ComputeLimits !== undefined && + input.ComputeLimits !== null && { + ComputeLimits: serializeAws_json1_1ComputeLimits(input.ComputeLimits, context), + }), }; }; const serializeAws_json1_1MetricDimension = (input: MetricDimension, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1MetricDimensionList = (input: MetricDimension[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MetricDimension(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MetricDimension(entry, context); + }); }; const serializeAws_json1_1ModifyClusterInput = (input: ModifyClusterInput, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.StepConcurrencyLevel !== undefined && { StepConcurrencyLevel: input.StepConcurrencyLevel }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.StepConcurrencyLevel !== undefined && + input.StepConcurrencyLevel !== null && { StepConcurrencyLevel: input.StepConcurrencyLevel }), }; }; @@ -4372,10 +4523,11 @@ const serializeAws_json1_1ModifyInstanceFleetInput = ( context: __SerdeContext ): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.InstanceFleet !== undefined && { - InstanceFleet: serializeAws_json1_1InstanceFleetModifyConfig(input.InstanceFleet, context), - }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.InstanceFleet !== undefined && + input.InstanceFleet !== null && { + InstanceFleet: serializeAws_json1_1InstanceFleetModifyConfig(input.InstanceFleet, context), + }), }; }; @@ -4384,10 +4536,11 @@ const serializeAws_json1_1ModifyInstanceGroupsInput = ( context: __SerdeContext ): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.InstanceGroups !== undefined && { - InstanceGroups: serializeAws_json1_1InstanceGroupModifyConfigList(input.InstanceGroups, context), - }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.InstanceGroups !== undefined && + input.InstanceGroups !== null && { + InstanceGroups: serializeAws_json1_1InstanceGroupModifyConfigList(input.InstanceGroups, context), + }), }; }; @@ -4395,7 +4548,14 @@ const serializeAws_json1_1NewSupportedProductsList = ( input: SupportedProductConfig[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1SupportedProductConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SupportedProductConfig(entry, context); + }); }; const serializeAws_json1_1OnDemandProvisioningSpecification = ( @@ -4403,39 +4563,57 @@ const serializeAws_json1_1OnDemandProvisioningSpecification = ( context: __SerdeContext ): any => { return { - ...(input.AllocationStrategy !== undefined && { AllocationStrategy: input.AllocationStrategy }), + ...(input.AllocationStrategy !== undefined && + input.AllocationStrategy !== null && { AllocationStrategy: input.AllocationStrategy }), }; }; const serializeAws_json1_1PlacementGroupConfig = (input: PlacementGroupConfig, context: __SerdeContext): any => { return { - ...(input.InstanceRole !== undefined && { InstanceRole: input.InstanceRole }), - ...(input.PlacementStrategy !== undefined && { PlacementStrategy: input.PlacementStrategy }), + ...(input.InstanceRole !== undefined && input.InstanceRole !== null && { InstanceRole: input.InstanceRole }), + ...(input.PlacementStrategy !== undefined && + input.PlacementStrategy !== null && { PlacementStrategy: input.PlacementStrategy }), }; }; const serializeAws_json1_1PlacementGroupConfigList = (input: PlacementGroupConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PlacementGroupConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PlacementGroupConfig(entry, context); + }); }; const serializeAws_json1_1PlacementType = (input: PlacementType, context: __SerdeContext): any => { return { - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_json1_1XmlStringMaxLen256List(input.AvailabilityZones, context), - }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_json1_1XmlStringMaxLen256List(input.AvailabilityZones, context), + }), }; }; const serializeAws_json1_1PortRange = (input: PortRange, context: __SerdeContext): any => { return { - ...(input.MaxRange !== undefined && { MaxRange: input.MaxRange }), - ...(input.MinRange !== undefined && { MinRange: input.MinRange }), + ...(input.MaxRange !== undefined && input.MaxRange !== null && { MaxRange: input.MaxRange }), + ...(input.MinRange !== undefined && input.MinRange !== null && { MinRange: input.MinRange }), }; }; const serializeAws_json1_1PortRanges = (input: PortRange[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PortRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PortRange(entry, context); + }); }; const serializeAws_json1_1PutAutoScalingPolicyInput = ( @@ -4443,11 +4621,13 @@ const serializeAws_json1_1PutAutoScalingPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.AutoScalingPolicy !== undefined && { - AutoScalingPolicy: serializeAws_json1_1AutoScalingPolicy(input.AutoScalingPolicy, context), - }), - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.InstanceGroupId !== undefined && { InstanceGroupId: input.InstanceGroupId }), + ...(input.AutoScalingPolicy !== undefined && + input.AutoScalingPolicy !== null && { + AutoScalingPolicy: serializeAws_json1_1AutoScalingPolicy(input.AutoScalingPolicy, context), + }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.InstanceGroupId !== undefined && + input.InstanceGroupId !== null && { InstanceGroupId: input.InstanceGroupId }), }; }; @@ -4456,12 +4636,13 @@ const serializeAws_json1_1PutBlockPublicAccessConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.BlockPublicAccessConfiguration !== undefined && { - BlockPublicAccessConfiguration: serializeAws_json1_1BlockPublicAccessConfiguration( - input.BlockPublicAccessConfiguration, - context - ), - }), + ...(input.BlockPublicAccessConfiguration !== undefined && + input.BlockPublicAccessConfiguration !== null && { + BlockPublicAccessConfiguration: serializeAws_json1_1BlockPublicAccessConfiguration( + input.BlockPublicAccessConfiguration, + context + ), + }), }; }; @@ -4470,10 +4651,11 @@ const serializeAws_json1_1PutManagedScalingPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.ManagedScalingPolicy !== undefined && { - ManagedScalingPolicy: serializeAws_json1_1ManagedScalingPolicy(input.ManagedScalingPolicy, context), - }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.ManagedScalingPolicy !== undefined && + input.ManagedScalingPolicy !== null && { + ManagedScalingPolicy: serializeAws_json1_1ManagedScalingPolicy(input.ManagedScalingPolicy, context), + }), }; }; @@ -4482,8 +4664,9 @@ const serializeAws_json1_1RemoveAutoScalingPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.InstanceGroupId !== undefined && { InstanceGroupId: input.InstanceGroupId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.InstanceGroupId !== undefined && + input.InstanceGroupId !== null && { InstanceGroupId: input.InstanceGroupId }), }; }; @@ -4492,107 +4675,136 @@ const serializeAws_json1_1RemoveManagedScalingPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), }; }; const serializeAws_json1_1RemoveTagsInput = (input: RemoveTagsInput, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1StringList(input.TagKeys, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1StringList(input.TagKeys, context) }), }; }; const serializeAws_json1_1RunJobFlowInput = (input: RunJobFlowInput, context: __SerdeContext): any => { return { - ...(input.AdditionalInfo !== undefined && { AdditionalInfo: input.AdditionalInfo }), - ...(input.AmiVersion !== undefined && { AmiVersion: input.AmiVersion }), - ...(input.Applications !== undefined && { - Applications: serializeAws_json1_1ApplicationList(input.Applications, context), - }), - ...(input.AutoScalingRole !== undefined && { AutoScalingRole: input.AutoScalingRole }), - ...(input.BootstrapActions !== undefined && { - BootstrapActions: serializeAws_json1_1BootstrapActionConfigList(input.BootstrapActions, context), - }), - ...(input.Configurations !== undefined && { - Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), - }), - ...(input.CustomAmiId !== undefined && { CustomAmiId: input.CustomAmiId }), - ...(input.EbsRootVolumeSize !== undefined && { EbsRootVolumeSize: input.EbsRootVolumeSize }), - ...(input.Instances !== undefined && { - Instances: serializeAws_json1_1JobFlowInstancesConfig(input.Instances, context), - }), - ...(input.JobFlowRole !== undefined && { JobFlowRole: input.JobFlowRole }), - ...(input.KerberosAttributes !== undefined && { - KerberosAttributes: serializeAws_json1_1KerberosAttributes(input.KerberosAttributes, context), - }), - ...(input.LogEncryptionKmsKeyId !== undefined && { LogEncryptionKmsKeyId: input.LogEncryptionKmsKeyId }), - ...(input.LogUri !== undefined && { LogUri: input.LogUri }), - ...(input.ManagedScalingPolicy !== undefined && { - ManagedScalingPolicy: serializeAws_json1_1ManagedScalingPolicy(input.ManagedScalingPolicy, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NewSupportedProducts !== undefined && { - NewSupportedProducts: serializeAws_json1_1NewSupportedProductsList(input.NewSupportedProducts, context), - }), - ...(input.PlacementGroupConfigs !== undefined && { - PlacementGroupConfigs: serializeAws_json1_1PlacementGroupConfigList(input.PlacementGroupConfigs, context), - }), - ...(input.ReleaseLabel !== undefined && { ReleaseLabel: input.ReleaseLabel }), - ...(input.RepoUpgradeOnBoot !== undefined && { RepoUpgradeOnBoot: input.RepoUpgradeOnBoot }), - ...(input.ScaleDownBehavior !== undefined && { ScaleDownBehavior: input.ScaleDownBehavior }), - ...(input.SecurityConfiguration !== undefined && { SecurityConfiguration: input.SecurityConfiguration }), - ...(input.ServiceRole !== undefined && { ServiceRole: input.ServiceRole }), - ...(input.StepConcurrencyLevel !== undefined && { StepConcurrencyLevel: input.StepConcurrencyLevel }), - ...(input.Steps !== undefined && { Steps: serializeAws_json1_1StepConfigList(input.Steps, context) }), - ...(input.SupportedProducts !== undefined && { - SupportedProducts: serializeAws_json1_1SupportedProductsList(input.SupportedProducts, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VisibleToAllUsers !== undefined && { VisibleToAllUsers: input.VisibleToAllUsers }), + ...(input.AdditionalInfo !== undefined && + input.AdditionalInfo !== null && { AdditionalInfo: input.AdditionalInfo }), + ...(input.AmiVersion !== undefined && input.AmiVersion !== null && { AmiVersion: input.AmiVersion }), + ...(input.Applications !== undefined && + input.Applications !== null && { + Applications: serializeAws_json1_1ApplicationList(input.Applications, context), + }), + ...(input.AutoScalingRole !== undefined && + input.AutoScalingRole !== null && { AutoScalingRole: input.AutoScalingRole }), + ...(input.BootstrapActions !== undefined && + input.BootstrapActions !== null && { + BootstrapActions: serializeAws_json1_1BootstrapActionConfigList(input.BootstrapActions, context), + }), + ...(input.Configurations !== undefined && + input.Configurations !== null && { + Configurations: serializeAws_json1_1ConfigurationList(input.Configurations, context), + }), + ...(input.CustomAmiId !== undefined && input.CustomAmiId !== null && { CustomAmiId: input.CustomAmiId }), + ...(input.EbsRootVolumeSize !== undefined && + input.EbsRootVolumeSize !== null && { EbsRootVolumeSize: input.EbsRootVolumeSize }), + ...(input.Instances !== undefined && + input.Instances !== null && { Instances: serializeAws_json1_1JobFlowInstancesConfig(input.Instances, context) }), + ...(input.JobFlowRole !== undefined && input.JobFlowRole !== null && { JobFlowRole: input.JobFlowRole }), + ...(input.KerberosAttributes !== undefined && + input.KerberosAttributes !== null && { + KerberosAttributes: serializeAws_json1_1KerberosAttributes(input.KerberosAttributes, context), + }), + ...(input.LogEncryptionKmsKeyId !== undefined && + input.LogEncryptionKmsKeyId !== null && { LogEncryptionKmsKeyId: input.LogEncryptionKmsKeyId }), + ...(input.LogUri !== undefined && input.LogUri !== null && { LogUri: input.LogUri }), + ...(input.ManagedScalingPolicy !== undefined && + input.ManagedScalingPolicy !== null && { + ManagedScalingPolicy: serializeAws_json1_1ManagedScalingPolicy(input.ManagedScalingPolicy, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NewSupportedProducts !== undefined && + input.NewSupportedProducts !== null && { + NewSupportedProducts: serializeAws_json1_1NewSupportedProductsList(input.NewSupportedProducts, context), + }), + ...(input.PlacementGroupConfigs !== undefined && + input.PlacementGroupConfigs !== null && { + PlacementGroupConfigs: serializeAws_json1_1PlacementGroupConfigList(input.PlacementGroupConfigs, context), + }), + ...(input.ReleaseLabel !== undefined && input.ReleaseLabel !== null && { ReleaseLabel: input.ReleaseLabel }), + ...(input.RepoUpgradeOnBoot !== undefined && + input.RepoUpgradeOnBoot !== null && { RepoUpgradeOnBoot: input.RepoUpgradeOnBoot }), + ...(input.ScaleDownBehavior !== undefined && + input.ScaleDownBehavior !== null && { ScaleDownBehavior: input.ScaleDownBehavior }), + ...(input.SecurityConfiguration !== undefined && + input.SecurityConfiguration !== null && { SecurityConfiguration: input.SecurityConfiguration }), + ...(input.ServiceRole !== undefined && input.ServiceRole !== null && { ServiceRole: input.ServiceRole }), + ...(input.StepConcurrencyLevel !== undefined && + input.StepConcurrencyLevel !== null && { StepConcurrencyLevel: input.StepConcurrencyLevel }), + ...(input.Steps !== undefined && + input.Steps !== null && { Steps: serializeAws_json1_1StepConfigList(input.Steps, context) }), + ...(input.SupportedProducts !== undefined && + input.SupportedProducts !== null && { + SupportedProducts: serializeAws_json1_1SupportedProductsList(input.SupportedProducts, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VisibleToAllUsers !== undefined && + input.VisibleToAllUsers !== null && { VisibleToAllUsers: input.VisibleToAllUsers }), }; }; const serializeAws_json1_1ScalingAction = (input: ScalingAction, context: __SerdeContext): any => { return { - ...(input.Market !== undefined && { Market: input.Market }), - ...(input.SimpleScalingPolicyConfiguration !== undefined && { - SimpleScalingPolicyConfiguration: serializeAws_json1_1SimpleScalingPolicyConfiguration( - input.SimpleScalingPolicyConfiguration, - context - ), - }), + ...(input.Market !== undefined && input.Market !== null && { Market: input.Market }), + ...(input.SimpleScalingPolicyConfiguration !== undefined && + input.SimpleScalingPolicyConfiguration !== null && { + SimpleScalingPolicyConfiguration: serializeAws_json1_1SimpleScalingPolicyConfiguration( + input.SimpleScalingPolicyConfiguration, + context + ), + }), }; }; const serializeAws_json1_1ScalingConstraints = (input: ScalingConstraints, context: __SerdeContext): any => { return { - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MinCapacity !== undefined && { MinCapacity: input.MinCapacity }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MinCapacity !== undefined && input.MinCapacity !== null && { MinCapacity: input.MinCapacity }), }; }; const serializeAws_json1_1ScalingRule = (input: ScalingRule, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: serializeAws_json1_1ScalingAction(input.Action, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Trigger !== undefined && { Trigger: serializeAws_json1_1ScalingTrigger(input.Trigger, context) }), + ...(input.Action !== undefined && + input.Action !== null && { Action: serializeAws_json1_1ScalingAction(input.Action, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Trigger !== undefined && + input.Trigger !== null && { Trigger: serializeAws_json1_1ScalingTrigger(input.Trigger, context) }), }; }; const serializeAws_json1_1ScalingRuleList = (input: ScalingRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ScalingRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ScalingRule(entry, context); + }); }; const serializeAws_json1_1ScalingTrigger = (input: ScalingTrigger, context: __SerdeContext): any => { return { - ...(input.CloudWatchAlarmDefinition !== undefined && { - CloudWatchAlarmDefinition: serializeAws_json1_1CloudWatchAlarmDefinition( - input.CloudWatchAlarmDefinition, - context - ), - }), + ...(input.CloudWatchAlarmDefinition !== undefined && + input.CloudWatchAlarmDefinition !== null && { + CloudWatchAlarmDefinition: serializeAws_json1_1CloudWatchAlarmDefinition( + input.CloudWatchAlarmDefinition, + context + ), + }), }; }; @@ -4601,13 +4813,21 @@ const serializeAws_json1_1ScriptBootstrapActionConfig = ( context: __SerdeContext ): any => { return { - ...(input.Args !== undefined && { Args: serializeAws_json1_1XmlStringList(input.Args, context) }), - ...(input.Path !== undefined && { Path: input.Path }), + ...(input.Args !== undefined && + input.Args !== null && { Args: serializeAws_json1_1XmlStringList(input.Args, context) }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), }; }; const serializeAws_json1_1SecurityGroupsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SetTerminationProtectionInput = ( @@ -4615,8 +4835,10 @@ const serializeAws_json1_1SetTerminationProtectionInput = ( context: __SerdeContext ): any => { return { - ...(input.JobFlowIds !== undefined && { JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) }), - ...(input.TerminationProtected !== undefined && { TerminationProtected: input.TerminationProtected }), + ...(input.JobFlowIds !== undefined && + input.JobFlowIds !== null && { JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) }), + ...(input.TerminationProtected !== undefined && + input.TerminationProtected !== null && { TerminationProtected: input.TerminationProtected }), }; }; @@ -4625,17 +4847,21 @@ const serializeAws_json1_1SetVisibleToAllUsersInput = ( context: __SerdeContext ): any => { return { - ...(input.JobFlowIds !== undefined && { JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) }), - ...(input.VisibleToAllUsers !== undefined && { VisibleToAllUsers: input.VisibleToAllUsers }), + ...(input.JobFlowIds !== undefined && + input.JobFlowIds !== null && { JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) }), + ...(input.VisibleToAllUsers !== undefined && + input.VisibleToAllUsers !== null && { VisibleToAllUsers: input.VisibleToAllUsers }), }; }; const serializeAws_json1_1ShrinkPolicy = (input: ShrinkPolicy, context: __SerdeContext): any => { return { - ...(input.DecommissionTimeout !== undefined && { DecommissionTimeout: input.DecommissionTimeout }), - ...(input.InstanceResizePolicy !== undefined && { - InstanceResizePolicy: serializeAws_json1_1InstanceResizePolicy(input.InstanceResizePolicy, context), - }), + ...(input.DecommissionTimeout !== undefined && + input.DecommissionTimeout !== null && { DecommissionTimeout: input.DecommissionTimeout }), + ...(input.InstanceResizePolicy !== undefined && + input.InstanceResizePolicy !== null && { + InstanceResizePolicy: serializeAws_json1_1InstanceResizePolicy(input.InstanceResizePolicy, context), + }), }; }; @@ -4644,9 +4870,11 @@ const serializeAws_json1_1SimpleScalingPolicyConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AdjustmentType !== undefined && { AdjustmentType: input.AdjustmentType }), - ...(input.CoolDown !== undefined && { CoolDown: input.CoolDown }), - ...(input.ScalingAdjustment !== undefined && { ScalingAdjustment: input.ScalingAdjustment }), + ...(input.AdjustmentType !== undefined && + input.AdjustmentType !== null && { AdjustmentType: input.AdjustmentType }), + ...(input.CoolDown !== undefined && input.CoolDown !== null && { CoolDown: input.CoolDown }), + ...(input.ScalingAdjustment !== undefined && + input.ScalingAdjustment !== null && { ScalingAdjustment: input.ScalingAdjustment }), }; }; @@ -4655,10 +4883,13 @@ const serializeAws_json1_1SpotProvisioningSpecification = ( context: __SerdeContext ): any => { return { - ...(input.AllocationStrategy !== undefined && { AllocationStrategy: input.AllocationStrategy }), - ...(input.BlockDurationMinutes !== undefined && { BlockDurationMinutes: input.BlockDurationMinutes }), - ...(input.TimeoutAction !== undefined && { TimeoutAction: input.TimeoutAction }), - ...(input.TimeoutDurationMinutes !== undefined && { TimeoutDurationMinutes: input.TimeoutDurationMinutes }), + ...(input.AllocationStrategy !== undefined && + input.AllocationStrategy !== null && { AllocationStrategy: input.AllocationStrategy }), + ...(input.BlockDurationMinutes !== undefined && + input.BlockDurationMinutes !== null && { BlockDurationMinutes: input.BlockDurationMinutes }), + ...(input.TimeoutAction !== undefined && input.TimeoutAction !== null && { TimeoutAction: input.TimeoutAction }), + ...(input.TimeoutDurationMinutes !== undefined && + input.TimeoutDurationMinutes !== null && { TimeoutDurationMinutes: input.TimeoutDurationMinutes }), }; }; @@ -4667,41 +4898,68 @@ const serializeAws_json1_1StartNotebookExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.EditorId !== undefined && { EditorId: input.EditorId }), - ...(input.ExecutionEngine !== undefined && { - ExecutionEngine: serializeAws_json1_1ExecutionEngineConfig(input.ExecutionEngine, context), - }), - ...(input.NotebookExecutionName !== undefined && { NotebookExecutionName: input.NotebookExecutionName }), - ...(input.NotebookInstanceSecurityGroupId !== undefined && { - NotebookInstanceSecurityGroupId: input.NotebookInstanceSecurityGroupId, - }), - ...(input.NotebookParams !== undefined && { NotebookParams: input.NotebookParams }), - ...(input.RelativePath !== undefined && { RelativePath: input.RelativePath }), - ...(input.ServiceRole !== undefined && { ServiceRole: input.ServiceRole }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.EditorId !== undefined && input.EditorId !== null && { EditorId: input.EditorId }), + ...(input.ExecutionEngine !== undefined && + input.ExecutionEngine !== null && { + ExecutionEngine: serializeAws_json1_1ExecutionEngineConfig(input.ExecutionEngine, context), + }), + ...(input.NotebookExecutionName !== undefined && + input.NotebookExecutionName !== null && { NotebookExecutionName: input.NotebookExecutionName }), + ...(input.NotebookInstanceSecurityGroupId !== undefined && + input.NotebookInstanceSecurityGroupId !== null && { + NotebookInstanceSecurityGroupId: input.NotebookInstanceSecurityGroupId, + }), + ...(input.NotebookParams !== undefined && + input.NotebookParams !== null && { NotebookParams: input.NotebookParams }), + ...(input.RelativePath !== undefined && input.RelativePath !== null && { RelativePath: input.RelativePath }), + ...(input.ServiceRole !== undefined && input.ServiceRole !== null && { ServiceRole: input.ServiceRole }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1StepConfig = (input: StepConfig, context: __SerdeContext): any => { return { - ...(input.ActionOnFailure !== undefined && { ActionOnFailure: input.ActionOnFailure }), - ...(input.HadoopJarStep !== undefined && { - HadoopJarStep: serializeAws_json1_1HadoopJarStepConfig(input.HadoopJarStep, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ActionOnFailure !== undefined && + input.ActionOnFailure !== null && { ActionOnFailure: input.ActionOnFailure }), + ...(input.HadoopJarStep !== undefined && + input.HadoopJarStep !== null && { + HadoopJarStep: serializeAws_json1_1HadoopJarStepConfig(input.HadoopJarStep, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1StepConfigList = (input: StepConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1StepConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1StepConfig(entry, context); + }); }; const serializeAws_json1_1StepIdsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StepStateList = (input: (StepState | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StopNotebookExecutionInput = ( @@ -4709,53 +4967,86 @@ const serializeAws_json1_1StopNotebookExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookExecutionId !== undefined && { NotebookExecutionId: input.NotebookExecutionId }), + ...(input.NotebookExecutionId !== undefined && + input.NotebookExecutionId !== null && { NotebookExecutionId: input.NotebookExecutionId }), }; }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StringMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1SubnetIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SupportedProductConfig = (input: SupportedProductConfig, context: __SerdeContext): any => { return { - ...(input.Args !== undefined && { Args: serializeAws_json1_1XmlStringList(input.Args, context) }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Args !== undefined && + input.Args !== null && { Args: serializeAws_json1_1XmlStringList(input.Args, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1SupportedProductsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TerminateJobFlowsInput = (input: TerminateJobFlowsInput, context: __SerdeContext): any => { return { - ...(input.JobFlowIds !== undefined && { JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) }), + ...(input.JobFlowIds !== undefined && + input.JobFlowIds !== null && { JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) }), }; }; @@ -4764,28 +5055,43 @@ const serializeAws_json1_1UpdateStudioSessionMappingInput = ( context: __SerdeContext ): any => { return { - ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), - ...(input.IdentityName !== undefined && { IdentityName: input.IdentityName }), - ...(input.IdentityType !== undefined && { IdentityType: input.IdentityType }), - ...(input.SessionPolicyArn !== undefined && { SessionPolicyArn: input.SessionPolicyArn }), - ...(input.StudioId !== undefined && { StudioId: input.StudioId }), + ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }), + ...(input.IdentityName !== undefined && input.IdentityName !== null && { IdentityName: input.IdentityName }), + ...(input.IdentityType !== undefined && input.IdentityType !== null && { IdentityType: input.IdentityType }), + ...(input.SessionPolicyArn !== undefined && + input.SessionPolicyArn !== null && { SessionPolicyArn: input.SessionPolicyArn }), + ...(input.StudioId !== undefined && input.StudioId !== null && { StudioId: input.StudioId }), }; }; const serializeAws_json1_1VolumeSpecification = (input: VolumeSpecification, context: __SerdeContext): any => { return { - ...(input.Iops !== undefined && { Iops: input.Iops }), - ...(input.SizeInGB !== undefined && { SizeInGB: input.SizeInGB }), - ...(input.VolumeType !== undefined && { VolumeType: input.VolumeType }), + ...(input.Iops !== undefined && input.Iops !== null && { Iops: input.Iops }), + ...(input.SizeInGB !== undefined && input.SizeInGB !== null && { SizeInGB: input.SizeInGB }), + ...(input.VolumeType !== undefined && input.VolumeType !== null && { VolumeType: input.VolumeType }), }; }; const serializeAws_json1_1XmlStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1XmlStringMaxLen256List = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AddInstanceFleetOutput = (output: any, context: __SerdeContext): AddInstanceFleetOutput => { @@ -4840,7 +5146,14 @@ const deserializeAws_json1_1Application = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ApplicationList = (output: any, context: __SerdeContext): Application[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Application(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Application(entry, context); + }); }; const deserializeAws_json1_1AutoScalingPolicyDescription = ( @@ -4949,7 +5262,14 @@ const deserializeAws_json1_1BootstrapActionDetailList = ( output: any, context: __SerdeContext ): BootstrapActionDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BootstrapActionDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BootstrapActionDetail(entry, context); + }); }; const deserializeAws_json1_1CancelStepsInfo = (output: any, context: __SerdeContext): CancelStepsInfo => { @@ -4961,7 +5281,14 @@ const deserializeAws_json1_1CancelStepsInfo = (output: any, context: __SerdeCont }; const deserializeAws_json1_1CancelStepsInfoList = (output: any, context: __SerdeContext): CancelStepsInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CancelStepsInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CancelStepsInfo(entry, context); + }); }; const deserializeAws_json1_1CancelStepsOutput = (output: any, context: __SerdeContext): CancelStepsOutput => { @@ -5138,7 +5465,14 @@ const deserializeAws_json1_1ClusterSummary = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ClusterSummaryList = (output: any, context: __SerdeContext): ClusterSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ClusterSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ClusterSummary(entry, context); + }); }; const deserializeAws_json1_1ClusterTimeline = (output: any, context: __SerdeContext): ClusterTimeline => { @@ -5170,7 +5504,14 @@ const deserializeAws_json1_1Command = (output: any, context: __SerdeContext): Co }; const deserializeAws_json1_1CommandList = (output: any, context: __SerdeContext): Command[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Command(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Command(entry, context); + }); }; const deserializeAws_json1_1ComputeLimits = (output: any, context: __SerdeContext): ComputeLimits => { @@ -5211,7 +5552,14 @@ const deserializeAws_json1_1Configuration = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ConfigurationList = (output: any, context: __SerdeContext): Configuration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Configuration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Configuration(entry, context); + }); }; const deserializeAws_json1_1CreateSecurityConfigurationOutput = ( @@ -5315,7 +5663,14 @@ const deserializeAws_json1_1EbsBlockDevice = (output: any, context: __SerdeConte }; const deserializeAws_json1_1EbsBlockDeviceList = (output: any, context: __SerdeContext): EbsBlockDevice[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EbsBlockDevice(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EbsBlockDevice(entry, context); + }); }; const deserializeAws_json1_1EbsVolume = (output: any, context: __SerdeContext): EbsVolume => { @@ -5326,7 +5681,14 @@ const deserializeAws_json1_1EbsVolume = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1EbsVolumeList = (output: any, context: __SerdeContext): EbsVolume[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EbsVolume(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EbsVolume(entry, context); + }); }; const deserializeAws_json1_1Ec2InstanceAttributes = (output: any, context: __SerdeContext): Ec2InstanceAttributes => { @@ -5373,7 +5735,14 @@ const deserializeAws_json1_1Ec2InstanceAttributes = (output: any, context: __Ser }; const deserializeAws_json1_1EC2InstanceIdsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ExecutionEngineConfig = (output: any, context: __SerdeContext): ExecutionEngineConfig => { @@ -5539,7 +5908,14 @@ const deserializeAws_json1_1InstanceFleet = (output: any, context: __SerdeContex }; const deserializeAws_json1_1InstanceFleetList = (output: any, context: __SerdeContext): InstanceFleet[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceFleet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceFleet(entry, context); + }); }; const deserializeAws_json1_1InstanceFleetProvisioningSpecifications = ( @@ -5698,15 +6074,36 @@ const deserializeAws_json1_1InstanceGroupDetail = (output: any, context: __Serde }; const deserializeAws_json1_1InstanceGroupDetailList = (output: any, context: __SerdeContext): InstanceGroupDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceGroupDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceGroupDetail(entry, context); + }); }; const deserializeAws_json1_1InstanceGroupIdsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InstanceGroupList = (output: any, context: __SerdeContext): InstanceGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceGroup(entry, context); + }); }; const deserializeAws_json1_1InstanceGroupStateChangeReason = ( @@ -5751,7 +6148,14 @@ const deserializeAws_json1_1InstanceGroupTimeline = (output: any, context: __Ser }; const deserializeAws_json1_1InstanceList = (output: any, context: __SerdeContext): Instance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Instance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Instance(entry, context); + }); }; const deserializeAws_json1_1InstanceResizePolicy = (output: any, context: __SerdeContext): InstanceResizePolicy => { @@ -5841,7 +6245,14 @@ const deserializeAws_json1_1InstanceTypeSpecificationList = ( output: any, context: __SerdeContext ): InstanceTypeSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceTypeSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceTypeSpecification(entry, context); + }); }; const deserializeAws_json1_1InternalServerError = (output: any, context: __SerdeContext): InternalServerError => { @@ -5913,7 +6324,14 @@ const deserializeAws_json1_1JobFlowDetail = (output: any, context: __SerdeContex }; const deserializeAws_json1_1JobFlowDetailList = (output: any, context: __SerdeContext): JobFlowDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1JobFlowDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1JobFlowDetail(entry, context); + }); }; const deserializeAws_json1_1JobFlowExecutionStatusDetail = ( @@ -6016,7 +6434,14 @@ const deserializeAws_json1_1KeyValue = (output: any, context: __SerdeContext): K }; const deserializeAws_json1_1KeyValueList = (output: any, context: __SerdeContext): KeyValue[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyValue(entry, context); + }); }; const deserializeAws_json1_1ListBootstrapActionsOutput = ( @@ -6154,7 +6579,14 @@ const deserializeAws_json1_1MetricDimension = (output: any, context: __SerdeCont }; const deserializeAws_json1_1MetricDimensionList = (output: any, context: __SerdeContext): MetricDimension[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricDimension(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricDimension(entry, context); + }); }; const deserializeAws_json1_1ModifyClusterOutput = (output: any, context: __SerdeContext): ModifyClusterOutput => { @@ -6238,7 +6670,14 @@ const deserializeAws_json1_1NotebookExecutionSummaryList = ( output: any, context: __SerdeContext ): NotebookExecutionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NotebookExecutionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NotebookExecutionSummary(entry, context); + }); }; const deserializeAws_json1_1OnDemandProvisioningSpecification = ( @@ -6267,7 +6706,14 @@ const deserializeAws_json1_1PlacementGroupConfigList = ( output: any, context: __SerdeContext ): PlacementGroupConfig[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PlacementGroupConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PlacementGroupConfig(entry, context); + }); }; const deserializeAws_json1_1PlacementType = (output: any, context: __SerdeContext): PlacementType => { @@ -6289,7 +6735,14 @@ const deserializeAws_json1_1PortRange = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1PortRanges = (output: any, context: __SerdeContext): PortRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PortRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PortRange(entry, context); + }); }; const deserializeAws_json1_1PutAutoScalingPolicyOutput = ( @@ -6380,7 +6833,14 @@ const deserializeAws_json1_1ScalingRule = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ScalingRuleList = (output: any, context: __SerdeContext): ScalingRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScalingRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScalingRule(entry, context); + }); }; const deserializeAws_json1_1ScalingTrigger = (output: any, context: __SerdeContext): ScalingTrigger => { @@ -6409,7 +6869,14 @@ const deserializeAws_json1_1SecurityConfigurationList = ( output: any, context: __SerdeContext ): SecurityConfigurationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SecurityConfigurationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SecurityConfigurationSummary(entry, context); + }); }; const deserializeAws_json1_1SecurityConfigurationSummary = ( @@ -6463,7 +6930,14 @@ const deserializeAws_json1_1SessionMappingSummaryList = ( output: any, context: __SerdeContext ): SessionMappingSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SessionMappingSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SessionMappingSummary(entry, context); + }); }; const deserializeAws_json1_1ShrinkPolicy = (output: any, context: __SerdeContext): ShrinkPolicy => { @@ -6571,7 +7045,14 @@ const deserializeAws_json1_1StepDetail = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1StepDetailList = (output: any, context: __SerdeContext): StepDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StepDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StepDetail(entry, context); + }); }; const deserializeAws_json1_1StepExecutionStatusDetail = ( @@ -6600,7 +7081,14 @@ const deserializeAws_json1_1StepExecutionStatusDetail = ( }; const deserializeAws_json1_1StepIdsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1StepStateChangeReason = (output: any, context: __SerdeContext): StepStateChangeReason => { @@ -6646,7 +7134,14 @@ const deserializeAws_json1_1StepSummary = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1StepSummaryList = (output: any, context: __SerdeContext): StepSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StepSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StepSummary(entry, context); + }); }; const deserializeAws_json1_1StepTimeline = (output: any, context: __SerdeContext): StepTimeline => { @@ -6667,17 +7162,26 @@ const deserializeAws_json1_1StepTimeline = (output: any, context: __SerdeContext }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1StringMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Studio = (output: any, context: __SerdeContext): Studio => { @@ -6733,15 +7237,36 @@ const deserializeAws_json1_1StudioSummary = (output: any, context: __SerdeContex }; const deserializeAws_json1_1StudioSummaryList = (output: any, context: __SerdeContext): StudioSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StudioSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StudioSummary(entry, context); + }); }; const deserializeAws_json1_1SubnetIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SupportedProductsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -6752,7 +7277,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1VolumeSpecification = (output: any, context: __SerdeContext): VolumeSpecification => { @@ -6764,11 +7296,25 @@ const deserializeAws_json1_1VolumeSpecification = (output: any, context: __Serde }; const deserializeAws_json1_1XmlStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1XmlStringMaxLen256List = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -6821,3 +7367,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-eventbridge/protocols/Aws_json1_1.ts b/clients/client-eventbridge/protocols/Aws_json1_1.ts index 3d153adc5b28..36a4c90e290e 100644 --- a/clients/client-eventbridge/protocols/Aws_json1_1.ts +++ b/clients/client-eventbridge/protocols/Aws_json1_1.ts @@ -199,7 +199,7 @@ export const serializeAws_json1_1ActivateEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ActivateEventSource", }; let body: any; @@ -212,7 +212,7 @@ export const serializeAws_json1_1CancelReplayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.CancelReplay", }; let body: any; @@ -225,7 +225,7 @@ export const serializeAws_json1_1CreateArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.CreateArchive", }; let body: any; @@ -238,7 +238,7 @@ export const serializeAws_json1_1CreateEventBusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.CreateEventBus", }; let body: any; @@ -251,7 +251,7 @@ export const serializeAws_json1_1CreatePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.CreatePartnerEventSource", }; let body: any; @@ -264,7 +264,7 @@ export const serializeAws_json1_1DeactivateEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeactivateEventSource", }; let body: any; @@ -277,7 +277,7 @@ export const serializeAws_json1_1DeleteArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeleteArchive", }; let body: any; @@ -290,7 +290,7 @@ export const serializeAws_json1_1DeleteEventBusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeleteEventBus", }; let body: any; @@ -303,7 +303,7 @@ export const serializeAws_json1_1DeletePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeletePartnerEventSource", }; let body: any; @@ -316,7 +316,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DeleteRule", }; let body: any; @@ -329,7 +329,7 @@ export const serializeAws_json1_1DescribeArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeArchive", }; let body: any; @@ -342,7 +342,7 @@ export const serializeAws_json1_1DescribeEventBusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeEventBus", }; let body: any; @@ -355,7 +355,7 @@ export const serializeAws_json1_1DescribeEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeEventSource", }; let body: any; @@ -368,7 +368,7 @@ export const serializeAws_json1_1DescribePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribePartnerEventSource", }; let body: any; @@ -381,7 +381,7 @@ export const serializeAws_json1_1DescribeReplayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeReplay", }; let body: any; @@ -394,7 +394,7 @@ export const serializeAws_json1_1DescribeRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DescribeRule", }; let body: any; @@ -407,7 +407,7 @@ export const serializeAws_json1_1DisableRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.DisableRule", }; let body: any; @@ -420,7 +420,7 @@ export const serializeAws_json1_1EnableRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.EnableRule", }; let body: any; @@ -433,7 +433,7 @@ export const serializeAws_json1_1ListArchivesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListArchives", }; let body: any; @@ -446,7 +446,7 @@ export const serializeAws_json1_1ListEventBusesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListEventBuses", }; let body: any; @@ -459,7 +459,7 @@ export const serializeAws_json1_1ListEventSourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListEventSources", }; let body: any; @@ -472,7 +472,7 @@ export const serializeAws_json1_1ListPartnerEventSourceAccountsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListPartnerEventSourceAccounts", }; let body: any; @@ -485,7 +485,7 @@ export const serializeAws_json1_1ListPartnerEventSourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListPartnerEventSources", }; let body: any; @@ -498,7 +498,7 @@ export const serializeAws_json1_1ListReplaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListReplays", }; let body: any; @@ -511,7 +511,7 @@ export const serializeAws_json1_1ListRuleNamesByTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListRuleNamesByTarget", }; let body: any; @@ -524,7 +524,7 @@ export const serializeAws_json1_1ListRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListRules", }; let body: any; @@ -537,7 +537,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListTagsForResource", }; let body: any; @@ -550,7 +550,7 @@ export const serializeAws_json1_1ListTargetsByRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.ListTargetsByRule", }; let body: any; @@ -563,7 +563,7 @@ export const serializeAws_json1_1PutEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutEvents", }; let body: any; @@ -576,7 +576,7 @@ export const serializeAws_json1_1PutPartnerEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutPartnerEvents", }; let body: any; @@ -589,7 +589,7 @@ export const serializeAws_json1_1PutPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutPermission", }; let body: any; @@ -602,7 +602,7 @@ export const serializeAws_json1_1PutRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutRule", }; let body: any; @@ -615,7 +615,7 @@ export const serializeAws_json1_1PutTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.PutTargets", }; let body: any; @@ -628,7 +628,7 @@ export const serializeAws_json1_1RemovePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.RemovePermission", }; let body: any; @@ -641,7 +641,7 @@ export const serializeAws_json1_1RemoveTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.RemoveTargets", }; let body: any; @@ -654,7 +654,7 @@ export const serializeAws_json1_1StartReplayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.StartReplay", }; let body: any; @@ -667,7 +667,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.TagResource", }; let body: any; @@ -680,7 +680,7 @@ export const serializeAws_json1_1TestEventPatternCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.TestEventPattern", }; let body: any; @@ -693,7 +693,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.UntagResource", }; let body: any; @@ -706,7 +706,7 @@ export const serializeAws_json1_1UpdateArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSEvents.UpdateArchive", }; let body: any; @@ -738,8 +738,7 @@ const deserializeAws_json1_1ActivateEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -825,8 +824,7 @@ const deserializeAws_json1_1CancelReplayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -904,8 +902,7 @@ const deserializeAws_json1_1CreateArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -999,8 +996,7 @@ const deserializeAws_json1_1CreateEventBusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -1102,8 +1098,7 @@ const deserializeAws_json1_1CreatePartnerEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -1186,8 +1181,7 @@ const deserializeAws_json1_1DeactivateEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -1273,8 +1267,7 @@ const deserializeAws_json1_1DeleteArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -1341,8 +1334,7 @@ const deserializeAws_json1_1DeleteEventBusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -1401,8 +1393,7 @@ const deserializeAws_json1_1DeletePartnerEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -1469,8 +1460,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -1548,8 +1538,7 @@ const deserializeAws_json1_1DescribeArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -1619,8 +1608,7 @@ const deserializeAws_json1_1DescribeEventBusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -1682,8 +1670,7 @@ const deserializeAws_json1_1DescribeEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -1753,8 +1740,7 @@ const deserializeAws_json1_1DescribePartnerEventSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -1824,8 +1810,7 @@ const deserializeAws_json1_1DescribeReplayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -1887,8 +1872,7 @@ const deserializeAws_json1_1DescribeRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -1947,8 +1931,7 @@ const deserializeAws_json1_1DisableRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -2023,8 +2006,7 @@ const deserializeAws_json1_1EnableRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -2102,8 +2084,7 @@ const deserializeAws_json1_1ListArchivesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2165,8 +2146,7 @@ const deserializeAws_json1_1ListEventBusesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2220,8 +2200,7 @@ const deserializeAws_json1_1ListEventSourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2283,8 +2262,7 @@ const deserializeAws_json1_1ListPartnerEventSourceAccountsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2354,8 +2332,7 @@ const deserializeAws_json1_1ListPartnerEventSourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2417,8 +2394,7 @@ const deserializeAws_json1_1ListReplaysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2472,8 +2448,7 @@ const deserializeAws_json1_1ListRuleNamesByTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2535,8 +2510,7 @@ const deserializeAws_json1_1ListRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2598,8 +2572,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2661,8 +2634,7 @@ const deserializeAws_json1_1ListTargetsByRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2724,8 +2696,7 @@ const deserializeAws_json1_1PutEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2779,8 +2750,7 @@ const deserializeAws_json1_1PutPartnerEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -2839,8 +2809,7 @@ const deserializeAws_json1_1PutPermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -2926,8 +2895,7 @@ const deserializeAws_json1_1PutRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -3021,8 +2989,7 @@ const deserializeAws_json1_1PutTargetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -3105,8 +3072,7 @@ const deserializeAws_json1_1RemovePermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -3184,8 +3150,7 @@ const deserializeAws_json1_1RemoveTargetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -3263,8 +3228,7 @@ const deserializeAws_json1_1StartReplayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -3350,8 +3314,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -3429,8 +3392,7 @@ const deserializeAws_json1_1TestEventPatternCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.eventbridge#InternalException": @@ -3492,8 +3454,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -3571,8 +3532,7 @@ const deserializeAws_json1_1UpdateArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.eventbridge#ConcurrentModificationException": @@ -3801,74 +3761,81 @@ const serializeAws_json1_1ActivateEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1AwsVpcConfiguration = (input: AwsVpcConfiguration, context: __SerdeContext): any => { return { - ...(input.AssignPublicIp !== undefined && { AssignPublicIp: input.AssignPublicIp }), - ...(input.SecurityGroups !== undefined && { - SecurityGroups: serializeAws_json1_1StringList(input.SecurityGroups, context), - }), - ...(input.Subnets !== undefined && { Subnets: serializeAws_json1_1StringList(input.Subnets, context) }), + ...(input.AssignPublicIp !== undefined && + input.AssignPublicIp !== null && { AssignPublicIp: input.AssignPublicIp }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + SecurityGroups: serializeAws_json1_1StringList(input.SecurityGroups, context), + }), + ...(input.Subnets !== undefined && + input.Subnets !== null && { Subnets: serializeAws_json1_1StringList(input.Subnets, context) }), }; }; const serializeAws_json1_1BatchArrayProperties = (input: BatchArrayProperties, context: __SerdeContext): any => { return { - ...(input.Size !== undefined && { Size: input.Size }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), }; }; const serializeAws_json1_1BatchParameters = (input: BatchParameters, context: __SerdeContext): any => { return { - ...(input.ArrayProperties !== undefined && { - ArrayProperties: serializeAws_json1_1BatchArrayProperties(input.ArrayProperties, context), - }), - ...(input.JobDefinition !== undefined && { JobDefinition: input.JobDefinition }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.RetryStrategy !== undefined && { - RetryStrategy: serializeAws_json1_1BatchRetryStrategy(input.RetryStrategy, context), - }), + ...(input.ArrayProperties !== undefined && + input.ArrayProperties !== null && { + ArrayProperties: serializeAws_json1_1BatchArrayProperties(input.ArrayProperties, context), + }), + ...(input.JobDefinition !== undefined && input.JobDefinition !== null && { JobDefinition: input.JobDefinition }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.RetryStrategy !== undefined && + input.RetryStrategy !== null && { + RetryStrategy: serializeAws_json1_1BatchRetryStrategy(input.RetryStrategy, context), + }), }; }; const serializeAws_json1_1BatchRetryStrategy = (input: BatchRetryStrategy, context: __SerdeContext): any => { return { - ...(input.Attempts !== undefined && { Attempts: input.Attempts }), + ...(input.Attempts !== undefined && input.Attempts !== null && { Attempts: input.Attempts }), }; }; const serializeAws_json1_1CancelReplayRequest = (input: CancelReplayRequest, context: __SerdeContext): any => { return { - ...(input.ReplayName !== undefined && { ReplayName: input.ReplayName }), + ...(input.ReplayName !== undefined && input.ReplayName !== null && { ReplayName: input.ReplayName }), }; }; const serializeAws_json1_1Condition = (input: Condition, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1CreateArchiveRequest = (input: CreateArchiveRequest, context: __SerdeContext): any => { return { - ...(input.ArchiveName !== undefined && { ArchiveName: input.ArchiveName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EventPattern !== undefined && { EventPattern: input.EventPattern }), - ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), - ...(input.RetentionDays !== undefined && { RetentionDays: input.RetentionDays }), + ...(input.ArchiveName !== undefined && input.ArchiveName !== null && { ArchiveName: input.ArchiveName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EventPattern !== undefined && input.EventPattern !== null && { EventPattern: input.EventPattern }), + ...(input.EventSourceArn !== undefined && + input.EventSourceArn !== null && { EventSourceArn: input.EventSourceArn }), + ...(input.RetentionDays !== undefined && input.RetentionDays !== null && { RetentionDays: input.RetentionDays }), }; }; const serializeAws_json1_1CreateEventBusRequest = (input: CreateEventBusRequest, context: __SerdeContext): any => { return { - ...(input.EventSourceName !== undefined && { EventSourceName: input.EventSourceName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.EventSourceName !== undefined && + input.EventSourceName !== null && { EventSourceName: input.EventSourceName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -3877,8 +3844,8 @@ const serializeAws_json1_1CreatePartnerEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Account !== undefined && { Account: input.Account }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Account !== undefined && input.Account !== null && { Account: input.Account }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -3887,25 +3854,25 @@ const serializeAws_json1_1DeactivateEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeadLetterConfig = (input: DeadLetterConfig, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }; }; const serializeAws_json1_1DeleteArchiveRequest = (input: DeleteArchiveRequest, context: __SerdeContext): any => { return { - ...(input.ArchiveName !== undefined && { ArchiveName: input.ArchiveName }), + ...(input.ArchiveName !== undefined && input.ArchiveName !== null && { ArchiveName: input.ArchiveName }), }; }; const serializeAws_json1_1DeleteEventBusRequest = (input: DeleteEventBusRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -3914,28 +3881,28 @@ const serializeAws_json1_1DeletePartnerEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Account !== undefined && { Account: input.Account }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Account !== undefined && input.Account !== null && { Account: input.Account }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeleteRuleRequest = (input: DeleteRuleRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Force !== undefined && { Force: input.Force }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Force !== undefined && input.Force !== null && { Force: input.Force }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DescribeArchiveRequest = (input: DescribeArchiveRequest, context: __SerdeContext): any => { return { - ...(input.ArchiveName !== undefined && { ArchiveName: input.ArchiveName }), + ...(input.ArchiveName !== undefined && input.ArchiveName !== null && { ArchiveName: input.ArchiveName }), }; }; const serializeAws_json1_1DescribeEventBusRequest = (input: DescribeEventBusRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -3944,7 +3911,7 @@ const serializeAws_json1_1DescribeEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -3953,116 +3920,134 @@ const serializeAws_json1_1DescribePartnerEventSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DescribeReplayRequest = (input: DescribeReplayRequest, context: __SerdeContext): any => { return { - ...(input.ReplayName !== undefined && { ReplayName: input.ReplayName }), + ...(input.ReplayName !== undefined && input.ReplayName !== null && { ReplayName: input.ReplayName }), }; }; const serializeAws_json1_1DescribeRuleRequest = (input: DescribeRuleRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DisableRuleRequest = (input: DisableRuleRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1EcsParameters = (input: EcsParameters, context: __SerdeContext): any => { return { - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.LaunchType !== undefined && { LaunchType: input.LaunchType }), - ...(input.NetworkConfiguration !== undefined && { - NetworkConfiguration: serializeAws_json1_1NetworkConfiguration(input.NetworkConfiguration, context), - }), - ...(input.PlatformVersion !== undefined && { PlatformVersion: input.PlatformVersion }), - ...(input.TaskCount !== undefined && { TaskCount: input.TaskCount }), - ...(input.TaskDefinitionArn !== undefined && { TaskDefinitionArn: input.TaskDefinitionArn }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.LaunchType !== undefined && input.LaunchType !== null && { LaunchType: input.LaunchType }), + ...(input.NetworkConfiguration !== undefined && + input.NetworkConfiguration !== null && { + NetworkConfiguration: serializeAws_json1_1NetworkConfiguration(input.NetworkConfiguration, context), + }), + ...(input.PlatformVersion !== undefined && + input.PlatformVersion !== null && { PlatformVersion: input.PlatformVersion }), + ...(input.TaskCount !== undefined && input.TaskCount !== null && { TaskCount: input.TaskCount }), + ...(input.TaskDefinitionArn !== undefined && + input.TaskDefinitionArn !== null && { TaskDefinitionArn: input.TaskDefinitionArn }), }; }; const serializeAws_json1_1EnableRuleRequest = (input: EnableRuleRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1EventResourceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1HeaderParametersMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1HttpParameters = (input: HttpParameters, context: __SerdeContext): any => { return { - ...(input.HeaderParameters !== undefined && { - HeaderParameters: serializeAws_json1_1HeaderParametersMap(input.HeaderParameters, context), - }), - ...(input.PathParameterValues !== undefined && { - PathParameterValues: serializeAws_json1_1PathParameterList(input.PathParameterValues, context), - }), - ...(input.QueryStringParameters !== undefined && { - QueryStringParameters: serializeAws_json1_1QueryStringParametersMap(input.QueryStringParameters, context), - }), + ...(input.HeaderParameters !== undefined && + input.HeaderParameters !== null && { + HeaderParameters: serializeAws_json1_1HeaderParametersMap(input.HeaderParameters, context), + }), + ...(input.PathParameterValues !== undefined && + input.PathParameterValues !== null && { + PathParameterValues: serializeAws_json1_1PathParameterList(input.PathParameterValues, context), + }), + ...(input.QueryStringParameters !== undefined && + input.QueryStringParameters !== null && { + QueryStringParameters: serializeAws_json1_1QueryStringParametersMap(input.QueryStringParameters, context), + }), }; }; const serializeAws_json1_1InputTransformer = (input: InputTransformer, context: __SerdeContext): any => { return { - ...(input.InputPathsMap !== undefined && { - InputPathsMap: serializeAws_json1_1TransformerPaths(input.InputPathsMap, context), - }), - ...(input.InputTemplate !== undefined && { InputTemplate: input.InputTemplate }), + ...(input.InputPathsMap !== undefined && + input.InputPathsMap !== null && { + InputPathsMap: serializeAws_json1_1TransformerPaths(input.InputPathsMap, context), + }), + ...(input.InputTemplate !== undefined && input.InputTemplate !== null && { InputTemplate: input.InputTemplate }), }; }; const serializeAws_json1_1KinesisParameters = (input: KinesisParameters, context: __SerdeContext): any => { return { - ...(input.PartitionKeyPath !== undefined && { PartitionKeyPath: input.PartitionKeyPath }), + ...(input.PartitionKeyPath !== undefined && + input.PartitionKeyPath !== null && { PartitionKeyPath: input.PartitionKeyPath }), }; }; const serializeAws_json1_1ListArchivesRequest = (input: ListArchivesRequest, context: __SerdeContext): any => { return { - ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.State !== undefined && { State: input.State }), + ...(input.EventSourceArn !== undefined && + input.EventSourceArn !== null && { EventSourceArn: input.EventSourceArn }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; const serializeAws_json1_1ListEventBusesRequest = (input: ListEventBusesRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListEventSourcesRequest = (input: ListEventSourcesRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4071,9 +4056,10 @@ const serializeAws_json1_1ListPartnerEventSourceAccountsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EventSourceName !== undefined && { EventSourceName: input.EventSourceName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.EventSourceName !== undefined && + input.EventSourceName !== null && { EventSourceName: input.EventSourceName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4082,19 +4068,20 @@ const serializeAws_json1_1ListPartnerEventSourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListReplaysRequest = (input: ListReplaysRequest, context: __SerdeContext): any => { return { - ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.State !== undefined && { State: input.State }), + ...(input.EventSourceArn !== undefined && + input.EventSourceArn !== null && { EventSourceArn: input.EventSourceArn }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; @@ -4103,19 +4090,19 @@ const serializeAws_json1_1ListRuleNamesByTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TargetArn !== undefined && { TargetArn: input.TargetArn }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TargetArn !== undefined && input.TargetArn !== null && { TargetArn: input.TargetArn }), }; }; const serializeAws_json1_1ListRulesRequest = (input: ListRulesRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4124,7 +4111,7 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; @@ -4133,43 +4120,49 @@ const serializeAws_json1_1ListTargetsByRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Rule !== undefined && { Rule: input.Rule }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Rule !== undefined && input.Rule !== null && { Rule: input.Rule }), }; }; const serializeAws_json1_1NetworkConfiguration = (input: NetworkConfiguration, context: __SerdeContext): any => { return { - ...(input.awsvpcConfiguration !== undefined && { - awsvpcConfiguration: serializeAws_json1_1AwsVpcConfiguration(input.awsvpcConfiguration, context), - }), + ...(input.awsvpcConfiguration !== undefined && + input.awsvpcConfiguration !== null && { + awsvpcConfiguration: serializeAws_json1_1AwsVpcConfiguration(input.awsvpcConfiguration, context), + }), }; }; const serializeAws_json1_1PathParameterList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutEventsRequest = (input: PutEventsRequest, context: __SerdeContext): any => { return { - ...(input.Entries !== undefined && { - Entries: serializeAws_json1_1PutEventsRequestEntryList(input.Entries, context), - }), + ...(input.Entries !== undefined && + input.Entries !== null && { Entries: serializeAws_json1_1PutEventsRequestEntryList(input.Entries, context) }), }; }; const serializeAws_json1_1PutEventsRequestEntry = (input: PutEventsRequestEntry, context: __SerdeContext): any => { return { - ...(input.Detail !== undefined && { Detail: input.Detail }), - ...(input.DetailType !== undefined && { DetailType: input.DetailType }), - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Resources !== undefined && { - Resources: serializeAws_json1_1EventResourceList(input.Resources, context), - }), - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.Time !== undefined && { Time: Math.round(input.Time.getTime() / 1000) }), + ...(input.Detail !== undefined && input.Detail !== null && { Detail: input.Detail }), + ...(input.DetailType !== undefined && input.DetailType !== null && { DetailType: input.DetailType }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_json1_1EventResourceList(input.Resources, context) }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.Time !== undefined && input.Time !== null && { Time: Math.round(input.Time.getTime() / 1000) }), }; }; @@ -4177,14 +4170,22 @@ const serializeAws_json1_1PutEventsRequestEntryList = ( input: PutEventsRequestEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1PutEventsRequestEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PutEventsRequestEntry(entry, context); + }); }; const serializeAws_json1_1PutPartnerEventsRequest = (input: PutPartnerEventsRequest, context: __SerdeContext): any => { return { - ...(input.Entries !== undefined && { - Entries: serializeAws_json1_1PutPartnerEventsRequestEntryList(input.Entries, context), - }), + ...(input.Entries !== undefined && + input.Entries !== null && { + Entries: serializeAws_json1_1PutPartnerEventsRequestEntryList(input.Entries, context), + }), }; }; @@ -4193,13 +4194,12 @@ const serializeAws_json1_1PutPartnerEventsRequestEntry = ( context: __SerdeContext ): any => { return { - ...(input.Detail !== undefined && { Detail: input.Detail }), - ...(input.DetailType !== undefined && { DetailType: input.DetailType }), - ...(input.Resources !== undefined && { - Resources: serializeAws_json1_1EventResourceList(input.Resources, context), - }), - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.Time !== undefined && { Time: Math.round(input.Time.getTime() / 1000) }), + ...(input.Detail !== undefined && input.Detail !== null && { Detail: input.Detail }), + ...(input.DetailType !== undefined && input.DetailType !== null && { DetailType: input.DetailType }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_json1_1EventResourceList(input.Resources, context) }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.Time !== undefined && input.Time !== null && { Time: Math.round(input.Time.getTime() / 1000) }), }; }; @@ -4207,38 +4207,48 @@ const serializeAws_json1_1PutPartnerEventsRequestEntryList = ( input: PutPartnerEventsRequestEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1PutPartnerEventsRequestEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PutPartnerEventsRequestEntry(entry, context); + }); }; const serializeAws_json1_1PutPermissionRequest = (input: PutPermissionRequest, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Condition !== undefined && { Condition: serializeAws_json1_1Condition(input.Condition, context) }), - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.Principal !== undefined && { Principal: input.Principal }), - ...(input.StatementId !== undefined && { StatementId: input.StatementId }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Condition !== undefined && + input.Condition !== null && { Condition: serializeAws_json1_1Condition(input.Condition, context) }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.Principal !== undefined && input.Principal !== null && { Principal: input.Principal }), + ...(input.StatementId !== undefined && input.StatementId !== null && { StatementId: input.StatementId }), }; }; const serializeAws_json1_1PutRuleRequest = (input: PutRuleRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.EventPattern !== undefined && { EventPattern: input.EventPattern }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.ScheduleExpression !== undefined && { ScheduleExpression: input.ScheduleExpression }), - ...(input.State !== undefined && { State: input.State }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.EventPattern !== undefined && input.EventPattern !== null && { EventPattern: input.EventPattern }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.ScheduleExpression !== undefined && + input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1PutTargetsRequest = (input: PutTargetsRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Rule !== undefined && { Rule: input.Rule }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1TargetList(input.Targets, context) }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Rule !== undefined && input.Rule !== null && { Rule: input.Rule }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1TargetList(input.Targets, context) }), }; }; @@ -4246,209 +4256,288 @@ const serializeAws_json1_1QueryStringParametersMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1RedshiftDataParameters = (input: RedshiftDataParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.SecretManagerArn !== undefined && { SecretManagerArn: input.SecretManagerArn }), - ...(input.Sql !== undefined && { Sql: input.Sql }), - ...(input.StatementName !== undefined && { StatementName: input.StatementName }), - ...(input.WithEvent !== undefined && { WithEvent: input.WithEvent }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.SecretManagerArn !== undefined && + input.SecretManagerArn !== null && { SecretManagerArn: input.SecretManagerArn }), + ...(input.Sql !== undefined && input.Sql !== null && { Sql: input.Sql }), + ...(input.StatementName !== undefined && input.StatementName !== null && { StatementName: input.StatementName }), + ...(input.WithEvent !== undefined && input.WithEvent !== null && { WithEvent: input.WithEvent }), }; }; const serializeAws_json1_1RemovePermissionRequest = (input: RemovePermissionRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.RemoveAllPermissions !== undefined && { RemoveAllPermissions: input.RemoveAllPermissions }), - ...(input.StatementId !== undefined && { StatementId: input.StatementId }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.RemoveAllPermissions !== undefined && + input.RemoveAllPermissions !== null && { RemoveAllPermissions: input.RemoveAllPermissions }), + ...(input.StatementId !== undefined && input.StatementId !== null && { StatementId: input.StatementId }), }; }; const serializeAws_json1_1RemoveTargetsRequest = (input: RemoveTargetsRequest, context: __SerdeContext): any => { return { - ...(input.EventBusName !== undefined && { EventBusName: input.EventBusName }), - ...(input.Force !== undefined && { Force: input.Force }), - ...(input.Ids !== undefined && { Ids: serializeAws_json1_1TargetIdList(input.Ids, context) }), - ...(input.Rule !== undefined && { Rule: input.Rule }), + ...(input.EventBusName !== undefined && input.EventBusName !== null && { EventBusName: input.EventBusName }), + ...(input.Force !== undefined && input.Force !== null && { Force: input.Force }), + ...(input.Ids !== undefined && input.Ids !== null && { Ids: serializeAws_json1_1TargetIdList(input.Ids, context) }), + ...(input.Rule !== undefined && input.Rule !== null && { Rule: input.Rule }), }; }; const serializeAws_json1_1ReplayDestination = (input: ReplayDestination, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.FilterArns !== undefined && { - FilterArns: serializeAws_json1_1ReplayDestinationFilters(input.FilterArns, context), - }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.FilterArns !== undefined && + input.FilterArns !== null && { + FilterArns: serializeAws_json1_1ReplayDestinationFilters(input.FilterArns, context), + }), }; }; const serializeAws_json1_1ReplayDestinationFilters = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RetryPolicy = (input: RetryPolicy, context: __SerdeContext): any => { return { - ...(input.MaximumEventAgeInSeconds !== undefined && { MaximumEventAgeInSeconds: input.MaximumEventAgeInSeconds }), - ...(input.MaximumRetryAttempts !== undefined && { MaximumRetryAttempts: input.MaximumRetryAttempts }), + ...(input.MaximumEventAgeInSeconds !== undefined && + input.MaximumEventAgeInSeconds !== null && { MaximumEventAgeInSeconds: input.MaximumEventAgeInSeconds }), + ...(input.MaximumRetryAttempts !== undefined && + input.MaximumRetryAttempts !== null && { MaximumRetryAttempts: input.MaximumRetryAttempts }), }; }; const serializeAws_json1_1RunCommandParameters = (input: RunCommandParameters, context: __SerdeContext): any => { return { - ...(input.RunCommandTargets !== undefined && { - RunCommandTargets: serializeAws_json1_1RunCommandTargets(input.RunCommandTargets, context), - }), + ...(input.RunCommandTargets !== undefined && + input.RunCommandTargets !== null && { + RunCommandTargets: serializeAws_json1_1RunCommandTargets(input.RunCommandTargets, context), + }), }; }; const serializeAws_json1_1RunCommandTarget = (input: RunCommandTarget, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1RunCommandTargetValues(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1RunCommandTargetValues(input.Values, context) }), }; }; const serializeAws_json1_1RunCommandTargets = (input: RunCommandTarget[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RunCommandTarget(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RunCommandTarget(entry, context); + }); }; const serializeAws_json1_1RunCommandTargetValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SqsParameters = (input: SqsParameters, context: __SerdeContext): any => { return { - ...(input.MessageGroupId !== undefined && { MessageGroupId: input.MessageGroupId }), + ...(input.MessageGroupId !== undefined && + input.MessageGroupId !== null && { MessageGroupId: input.MessageGroupId }), }; }; const serializeAws_json1_1StartReplayRequest = (input: StartReplayRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Destination !== undefined && { - Destination: serializeAws_json1_1ReplayDestination(input.Destination, context), - }), - ...(input.EventEndTime !== undefined && { EventEndTime: Math.round(input.EventEndTime.getTime() / 1000) }), - ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), - ...(input.EventStartTime !== undefined && { EventStartTime: Math.round(input.EventStartTime.getTime() / 1000) }), - ...(input.ReplayName !== undefined && { ReplayName: input.ReplayName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Destination !== undefined && + input.Destination !== null && { Destination: serializeAws_json1_1ReplayDestination(input.Destination, context) }), + ...(input.EventEndTime !== undefined && + input.EventEndTime !== null && { EventEndTime: Math.round(input.EventEndTime.getTime() / 1000) }), + ...(input.EventSourceArn !== undefined && + input.EventSourceArn !== null && { EventSourceArn: input.EventSourceArn }), + ...(input.EventStartTime !== undefined && + input.EventStartTime !== null && { EventStartTime: Math.round(input.EventStartTime.getTime() / 1000) }), + ...(input.ReplayName !== undefined && input.ReplayName !== null && { ReplayName: input.ReplayName }), }; }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1Target = (input: Target, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.BatchParameters !== undefined && { - BatchParameters: serializeAws_json1_1BatchParameters(input.BatchParameters, context), - }), - ...(input.DeadLetterConfig !== undefined && { - DeadLetterConfig: serializeAws_json1_1DeadLetterConfig(input.DeadLetterConfig, context), - }), - ...(input.EcsParameters !== undefined && { - EcsParameters: serializeAws_json1_1EcsParameters(input.EcsParameters, context), - }), - ...(input.HttpParameters !== undefined && { - HttpParameters: serializeAws_json1_1HttpParameters(input.HttpParameters, context), - }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Input !== undefined && { Input: input.Input }), - ...(input.InputPath !== undefined && { InputPath: input.InputPath }), - ...(input.InputTransformer !== undefined && { - InputTransformer: serializeAws_json1_1InputTransformer(input.InputTransformer, context), - }), - ...(input.KinesisParameters !== undefined && { - KinesisParameters: serializeAws_json1_1KinesisParameters(input.KinesisParameters, context), - }), - ...(input.RedshiftDataParameters !== undefined && { - RedshiftDataParameters: serializeAws_json1_1RedshiftDataParameters(input.RedshiftDataParameters, context), - }), - ...(input.RetryPolicy !== undefined && { - RetryPolicy: serializeAws_json1_1RetryPolicy(input.RetryPolicy, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.RunCommandParameters !== undefined && { - RunCommandParameters: serializeAws_json1_1RunCommandParameters(input.RunCommandParameters, context), - }), - ...(input.SqsParameters !== undefined && { - SqsParameters: serializeAws_json1_1SqsParameters(input.SqsParameters, context), - }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.BatchParameters !== undefined && + input.BatchParameters !== null && { + BatchParameters: serializeAws_json1_1BatchParameters(input.BatchParameters, context), + }), + ...(input.DeadLetterConfig !== undefined && + input.DeadLetterConfig !== null && { + DeadLetterConfig: serializeAws_json1_1DeadLetterConfig(input.DeadLetterConfig, context), + }), + ...(input.EcsParameters !== undefined && + input.EcsParameters !== null && { + EcsParameters: serializeAws_json1_1EcsParameters(input.EcsParameters, context), + }), + ...(input.HttpParameters !== undefined && + input.HttpParameters !== null && { + HttpParameters: serializeAws_json1_1HttpParameters(input.HttpParameters, context), + }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Input !== undefined && input.Input !== null && { Input: input.Input }), + ...(input.InputPath !== undefined && input.InputPath !== null && { InputPath: input.InputPath }), + ...(input.InputTransformer !== undefined && + input.InputTransformer !== null && { + InputTransformer: serializeAws_json1_1InputTransformer(input.InputTransformer, context), + }), + ...(input.KinesisParameters !== undefined && + input.KinesisParameters !== null && { + KinesisParameters: serializeAws_json1_1KinesisParameters(input.KinesisParameters, context), + }), + ...(input.RedshiftDataParameters !== undefined && + input.RedshiftDataParameters !== null && { + RedshiftDataParameters: serializeAws_json1_1RedshiftDataParameters(input.RedshiftDataParameters, context), + }), + ...(input.RetryPolicy !== undefined && + input.RetryPolicy !== null && { RetryPolicy: serializeAws_json1_1RetryPolicy(input.RetryPolicy, context) }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.RunCommandParameters !== undefined && + input.RunCommandParameters !== null && { + RunCommandParameters: serializeAws_json1_1RunCommandParameters(input.RunCommandParameters, context), + }), + ...(input.SqsParameters !== undefined && + input.SqsParameters !== null && { + SqsParameters: serializeAws_json1_1SqsParameters(input.SqsParameters, context), + }), }; }; const serializeAws_json1_1TargetIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TargetList = (input: Target[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Target(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Target(entry, context); + }); }; const serializeAws_json1_1TestEventPatternRequest = (input: TestEventPatternRequest, context: __SerdeContext): any => { return { - ...(input.Event !== undefined && { Event: input.Event }), - ...(input.EventPattern !== undefined && { EventPattern: input.EventPattern }), + ...(input.Event !== undefined && input.Event !== null && { Event: input.Event }), + ...(input.EventPattern !== undefined && input.EventPattern !== null && { EventPattern: input.EventPattern }), }; }; const serializeAws_json1_1TransformerPaths = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateArchiveRequest = (input: UpdateArchiveRequest, context: __SerdeContext): any => { return { - ...(input.ArchiveName !== undefined && { ArchiveName: input.ArchiveName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EventPattern !== undefined && { EventPattern: input.EventPattern }), - ...(input.RetentionDays !== undefined && { RetentionDays: input.RetentionDays }), + ...(input.ArchiveName !== undefined && input.ArchiveName !== null && { ArchiveName: input.ArchiveName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EventPattern !== undefined && input.EventPattern !== null && { EventPattern: input.EventPattern }), + ...(input.RetentionDays !== undefined && input.RetentionDays !== null && { RetentionDays: input.RetentionDays }), }; }; @@ -4471,7 +4560,14 @@ const deserializeAws_json1_1Archive = (output: any, context: __SerdeContext): Ar }; const deserializeAws_json1_1ArchiveResponseList = (output: any, context: __SerdeContext): Archive[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Archive(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Archive(entry, context); + }); }; const deserializeAws_json1_1AwsVpcConfiguration = (output: any, context: __SerdeContext): AwsVpcConfiguration => { @@ -4718,7 +4814,14 @@ const deserializeAws_json1_1EventBus = (output: any, context: __SerdeContext): E }; const deserializeAws_json1_1EventBusList = (output: any, context: __SerdeContext): EventBus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventBus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventBus(entry, context); + }); }; const deserializeAws_json1_1EventSource = (output: any, context: __SerdeContext): EventSource => { @@ -4739,17 +4842,26 @@ const deserializeAws_json1_1EventSource = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1EventSourceList = (output: any, context: __SerdeContext): EventSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventSource(entry, context); + }); }; const deserializeAws_json1_1HeaderParametersMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1HttpParameters = (output: any, context: __SerdeContext): HttpParameters => { @@ -4990,15 +5102,36 @@ const deserializeAws_json1_1PartnerEventSourceAccountList = ( output: any, context: __SerdeContext ): PartnerEventSourceAccount[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PartnerEventSourceAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PartnerEventSourceAccount(entry, context); + }); }; const deserializeAws_json1_1PartnerEventSourceList = (output: any, context: __SerdeContext): PartnerEventSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PartnerEventSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PartnerEventSource(entry, context); + }); }; const deserializeAws_json1_1PathParameterList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PolicyLengthExceededException = ( @@ -5033,7 +5166,14 @@ const deserializeAws_json1_1PutEventsResultEntryList = ( output: any, context: __SerdeContext ): PutEventsResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PutEventsResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PutEventsResultEntry(entry, context); + }); }; const deserializeAws_json1_1PutPartnerEventsResponse = ( @@ -5065,7 +5205,14 @@ const deserializeAws_json1_1PutPartnerEventsResultEntryList = ( output: any, context: __SerdeContext ): PutPartnerEventsResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PutPartnerEventsResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PutPartnerEventsResultEntry(entry, context); + }); }; const deserializeAws_json1_1PutRuleResponse = (output: any, context: __SerdeContext): PutRuleResponse => { @@ -5097,20 +5244,29 @@ const deserializeAws_json1_1PutTargetsResultEntryList = ( output: any, context: __SerdeContext ): PutTargetsResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PutTargetsResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PutTargetsResultEntry(entry, context); + }); }; const deserializeAws_json1_1QueryStringParametersMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1RedshiftDataParameters = (output: any, context: __SerdeContext): RedshiftDataParameters => { @@ -5152,7 +5308,14 @@ const deserializeAws_json1_1RemoveTargetsResultEntryList = ( output: any, context: __SerdeContext ): RemoveTargetsResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RemoveTargetsResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RemoveTargetsResultEntry(entry, context); + }); }; const deserializeAws_json1_1Replay = (output: any, context: __SerdeContext): Replay => { @@ -5196,11 +5359,25 @@ const deserializeAws_json1_1ReplayDestination = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ReplayDestinationFilters = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ReplayList = (output: any, context: __SerdeContext): Replay[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Replay(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Replay(entry, context); + }); }; const deserializeAws_json1_1ResourceAlreadyExistsException = ( @@ -5252,11 +5429,25 @@ const deserializeAws_json1_1Rule = (output: any, context: __SerdeContext): Rule }; const deserializeAws_json1_1RuleNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RuleResponseList = (output: any, context: __SerdeContext): Rule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Rule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Rule(entry, context); + }); }; const deserializeAws_json1_1RunCommandParameters = (output: any, context: __SerdeContext): RunCommandParameters => { @@ -5279,11 +5470,25 @@ const deserializeAws_json1_1RunCommandTarget = (output: any, context: __SerdeCon }; const deserializeAws_json1_1RunCommandTargets = (output: any, context: __SerdeContext): RunCommandTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RunCommandTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RunCommandTarget(entry, context); + }); }; const deserializeAws_json1_1RunCommandTargetValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SqsParameters = (output: any, context: __SerdeContext): SqsParameters => { @@ -5306,7 +5511,14 @@ const deserializeAws_json1_1StartReplayResponse = (output: any, context: __Serde }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -5317,7 +5529,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -5375,7 +5594,14 @@ const deserializeAws_json1_1Target = (output: any, context: __SerdeContext): Tar }; const deserializeAws_json1_1TargetList = (output: any, context: __SerdeContext): Target[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Target(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Target(entry, context); + }); }; const deserializeAws_json1_1TestEventPatternResponse = ( @@ -5388,13 +5614,15 @@ const deserializeAws_json1_1TestEventPatternResponse = ( }; const deserializeAws_json1_1TransformerPaths = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => { @@ -5463,3 +5691,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-firehose/protocols/Aws_json1_1.ts b/clients/client-firehose/protocols/Aws_json1_1.ts index 9c542d84a66c..20c24e242716 100644 --- a/clients/client-firehose/protocols/Aws_json1_1.ts +++ b/clients/client-firehose/protocols/Aws_json1_1.ts @@ -141,7 +141,7 @@ export const serializeAws_json1_1CreateDeliveryStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.CreateDeliveryStream", }; let body: any; @@ -154,7 +154,7 @@ export const serializeAws_json1_1DeleteDeliveryStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.DeleteDeliveryStream", }; let body: any; @@ -167,7 +167,7 @@ export const serializeAws_json1_1DescribeDeliveryStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.DescribeDeliveryStream", }; let body: any; @@ -180,7 +180,7 @@ export const serializeAws_json1_1ListDeliveryStreamsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.ListDeliveryStreams", }; let body: any; @@ -193,7 +193,7 @@ export const serializeAws_json1_1ListTagsForDeliveryStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.ListTagsForDeliveryStream", }; let body: any; @@ -206,7 +206,7 @@ export const serializeAws_json1_1PutRecordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.PutRecord", }; let body: any; @@ -219,7 +219,7 @@ export const serializeAws_json1_1PutRecordBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.PutRecordBatch", }; let body: any; @@ -232,7 +232,7 @@ export const serializeAws_json1_1StartDeliveryStreamEncryptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.StartDeliveryStreamEncryption", }; let body: any; @@ -245,7 +245,7 @@ export const serializeAws_json1_1StopDeliveryStreamEncryptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.StopDeliveryStreamEncryption", }; let body: any; @@ -258,7 +258,7 @@ export const serializeAws_json1_1TagDeliveryStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.TagDeliveryStream", }; let body: any; @@ -271,7 +271,7 @@ export const serializeAws_json1_1UntagDeliveryStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.UntagDeliveryStream", }; let body: any; @@ -284,7 +284,7 @@ export const serializeAws_json1_1UpdateDestinationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Firehose_20150804.UpdateDestination", }; let body: any; @@ -319,8 +319,7 @@ const deserializeAws_json1_1CreateDeliveryStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.firehose#InvalidArgumentException": @@ -398,8 +397,7 @@ const deserializeAws_json1_1DeleteDeliveryStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUseException": case "com.amazonaws.firehose#ResourceInUseException": @@ -461,8 +459,7 @@ const deserializeAws_json1_1DescribeDeliveryStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.firehose#ResourceNotFoundException": @@ -516,8 +513,7 @@ const deserializeAws_json1_1ListDeliveryStreamsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -563,8 +559,7 @@ const deserializeAws_json1_1ListTagsForDeliveryStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.firehose#InvalidArgumentException": @@ -634,8 +629,7 @@ const deserializeAws_json1_1PutRecordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.firehose#InvalidArgumentException": @@ -713,8 +707,7 @@ const deserializeAws_json1_1PutRecordBatchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.firehose#InvalidArgumentException": @@ -792,8 +785,7 @@ const deserializeAws_json1_1StartDeliveryStreamEncryptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.firehose#InvalidArgumentException": @@ -879,8 +871,7 @@ const deserializeAws_json1_1StopDeliveryStreamEncryptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.firehose#InvalidArgumentException": @@ -958,8 +949,7 @@ const deserializeAws_json1_1TagDeliveryStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.firehose#InvalidArgumentException": @@ -1037,8 +1027,7 @@ const deserializeAws_json1_1UntagDeliveryStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.firehose#InvalidArgumentException": @@ -1116,8 +1105,7 @@ const deserializeAws_json1_1UpdateDestinationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.firehose#ConcurrentModificationException": @@ -1275,8 +1263,9 @@ const deserializeAws_json1_1ServiceUnavailableExceptionResponse = async ( const serializeAws_json1_1BufferingHints = (input: BufferingHints, context: __SerdeContext): any => { return { - ...(input.IntervalInSeconds !== undefined && { IntervalInSeconds: input.IntervalInSeconds }), - ...(input.SizeInMBs !== undefined && { SizeInMBs: input.SizeInMBs }), + ...(input.IntervalInSeconds !== undefined && + input.IntervalInSeconds !== null && { IntervalInSeconds: input.IntervalInSeconds }), + ...(input.SizeInMBs !== undefined && input.SizeInMBs !== null && { SizeInMBs: input.SizeInMBs }), }; }; @@ -1285,9 +1274,9 @@ const serializeAws_json1_1CloudWatchLoggingOptions = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.LogGroupName !== undefined && { LogGroupName: input.LogGroupName }), - ...(input.LogStreamName !== undefined && { LogStreamName: input.LogStreamName }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.LogGroupName !== undefined && input.LogGroupName !== null && { LogGroupName: input.LogGroupName }), + ...(input.LogStreamName !== undefined && input.LogStreamName !== null && { LogStreamName: input.LogStreamName }), }; }; @@ -1295,20 +1284,23 @@ const serializeAws_json1_1ColumnToJsonKeyMappings = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1CopyCommand = (input: CopyCommand, context: __SerdeContext): any => { return { - ...(input.CopyOptions !== undefined && { CopyOptions: input.CopyOptions }), - ...(input.DataTableColumns !== undefined && { DataTableColumns: input.DataTableColumns }), - ...(input.DataTableName !== undefined && { DataTableName: input.DataTableName }), + ...(input.CopyOptions !== undefined && input.CopyOptions !== null && { CopyOptions: input.CopyOptions }), + ...(input.DataTableColumns !== undefined && + input.DataTableColumns !== null && { DataTableColumns: input.DataTableColumns }), + ...(input.DataTableName !== undefined && input.DataTableName !== null && { DataTableName: input.DataTableName }), }; }; @@ -1317,57 +1309,68 @@ const serializeAws_json1_1CreateDeliveryStreamInput = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamEncryptionConfigurationInput !== undefined && { - DeliveryStreamEncryptionConfigurationInput: serializeAws_json1_1DeliveryStreamEncryptionConfigurationInput( - input.DeliveryStreamEncryptionConfigurationInput, - context - ), - }), - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), - ...(input.DeliveryStreamType !== undefined && { DeliveryStreamType: input.DeliveryStreamType }), - ...(input.ElasticsearchDestinationConfiguration !== undefined && { - ElasticsearchDestinationConfiguration: serializeAws_json1_1ElasticsearchDestinationConfiguration( - input.ElasticsearchDestinationConfiguration, - context - ), - }), - ...(input.ExtendedS3DestinationConfiguration !== undefined && { - ExtendedS3DestinationConfiguration: serializeAws_json1_1ExtendedS3DestinationConfiguration( - input.ExtendedS3DestinationConfiguration, - context - ), - }), - ...(input.HttpEndpointDestinationConfiguration !== undefined && { - HttpEndpointDestinationConfiguration: serializeAws_json1_1HttpEndpointDestinationConfiguration( - input.HttpEndpointDestinationConfiguration, - context - ), - }), - ...(input.KinesisStreamSourceConfiguration !== undefined && { - KinesisStreamSourceConfiguration: serializeAws_json1_1KinesisStreamSourceConfiguration( - input.KinesisStreamSourceConfiguration, - context - ), - }), - ...(input.RedshiftDestinationConfiguration !== undefined && { - RedshiftDestinationConfiguration: serializeAws_json1_1RedshiftDestinationConfiguration( - input.RedshiftDestinationConfiguration, - context - ), - }), - ...(input.S3DestinationConfiguration !== undefined && { - S3DestinationConfiguration: serializeAws_json1_1S3DestinationConfiguration( - input.S3DestinationConfiguration, - context - ), - }), - ...(input.SplunkDestinationConfiguration !== undefined && { - SplunkDestinationConfiguration: serializeAws_json1_1SplunkDestinationConfiguration( - input.SplunkDestinationConfiguration, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagDeliveryStreamInputTagList(input.Tags, context) }), + ...(input.DeliveryStreamEncryptionConfigurationInput !== undefined && + input.DeliveryStreamEncryptionConfigurationInput !== null && { + DeliveryStreamEncryptionConfigurationInput: serializeAws_json1_1DeliveryStreamEncryptionConfigurationInput( + input.DeliveryStreamEncryptionConfigurationInput, + context + ), + }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.DeliveryStreamType !== undefined && + input.DeliveryStreamType !== null && { DeliveryStreamType: input.DeliveryStreamType }), + ...(input.ElasticsearchDestinationConfiguration !== undefined && + input.ElasticsearchDestinationConfiguration !== null && { + ElasticsearchDestinationConfiguration: serializeAws_json1_1ElasticsearchDestinationConfiguration( + input.ElasticsearchDestinationConfiguration, + context + ), + }), + ...(input.ExtendedS3DestinationConfiguration !== undefined && + input.ExtendedS3DestinationConfiguration !== null && { + ExtendedS3DestinationConfiguration: serializeAws_json1_1ExtendedS3DestinationConfiguration( + input.ExtendedS3DestinationConfiguration, + context + ), + }), + ...(input.HttpEndpointDestinationConfiguration !== undefined && + input.HttpEndpointDestinationConfiguration !== null && { + HttpEndpointDestinationConfiguration: serializeAws_json1_1HttpEndpointDestinationConfiguration( + input.HttpEndpointDestinationConfiguration, + context + ), + }), + ...(input.KinesisStreamSourceConfiguration !== undefined && + input.KinesisStreamSourceConfiguration !== null && { + KinesisStreamSourceConfiguration: serializeAws_json1_1KinesisStreamSourceConfiguration( + input.KinesisStreamSourceConfiguration, + context + ), + }), + ...(input.RedshiftDestinationConfiguration !== undefined && + input.RedshiftDestinationConfiguration !== null && { + RedshiftDestinationConfiguration: serializeAws_json1_1RedshiftDestinationConfiguration( + input.RedshiftDestinationConfiguration, + context + ), + }), + ...(input.S3DestinationConfiguration !== undefined && + input.S3DestinationConfiguration !== null && { + S3DestinationConfiguration: serializeAws_json1_1S3DestinationConfiguration( + input.S3DestinationConfiguration, + context + ), + }), + ...(input.SplunkDestinationConfiguration !== undefined && + input.SplunkDestinationConfiguration !== null && { + SplunkDestinationConfiguration: serializeAws_json1_1SplunkDestinationConfiguration( + input.SplunkDestinationConfiguration, + context + ), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1TagDeliveryStreamInputTagList(input.Tags, context) }), }; }; @@ -1376,19 +1379,22 @@ const serializeAws_json1_1DataFormatConversionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.InputFormatConfiguration !== undefined && { - InputFormatConfiguration: serializeAws_json1_1InputFormatConfiguration(input.InputFormatConfiguration, context), - }), - ...(input.OutputFormatConfiguration !== undefined && { - OutputFormatConfiguration: serializeAws_json1_1OutputFormatConfiguration( - input.OutputFormatConfiguration, - context - ), - }), - ...(input.SchemaConfiguration !== undefined && { - SchemaConfiguration: serializeAws_json1_1SchemaConfiguration(input.SchemaConfiguration, context), - }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.InputFormatConfiguration !== undefined && + input.InputFormatConfiguration !== null && { + InputFormatConfiguration: serializeAws_json1_1InputFormatConfiguration(input.InputFormatConfiguration, context), + }), + ...(input.OutputFormatConfiguration !== undefined && + input.OutputFormatConfiguration !== null && { + OutputFormatConfiguration: serializeAws_json1_1OutputFormatConfiguration( + input.OutputFormatConfiguration, + context + ), + }), + ...(input.SchemaConfiguration !== undefined && + input.SchemaConfiguration !== null && { + SchemaConfiguration: serializeAws_json1_1SchemaConfiguration(input.SchemaConfiguration, context), + }), }; }; @@ -1397,8 +1403,10 @@ const serializeAws_json1_1DeleteDeliveryStreamInput = ( context: __SerdeContext ): any => { return { - ...(input.AllowForceDelete !== undefined && { AllowForceDelete: input.AllowForceDelete }), - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.AllowForceDelete !== undefined && + input.AllowForceDelete !== null && { AllowForceDelete: input.AllowForceDelete }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), }; }; @@ -1407,8 +1415,8 @@ const serializeAws_json1_1DeliveryStreamEncryptionConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.KeyARN !== undefined && { KeyARN: input.KeyARN }), - ...(input.KeyType !== undefined && { KeyType: input.KeyType }), + ...(input.KeyARN !== undefined && input.KeyARN !== null && { KeyARN: input.KeyARN }), + ...(input.KeyType !== undefined && input.KeyType !== null && { KeyType: input.KeyType }), }; }; @@ -1417,22 +1425,24 @@ const serializeAws_json1_1DescribeDeliveryStreamInput = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), - ...(input.ExclusiveStartDestinationId !== undefined && { - ExclusiveStartDestinationId: input.ExclusiveStartDestinationId, - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.ExclusiveStartDestinationId !== undefined && + input.ExclusiveStartDestinationId !== null && { ExclusiveStartDestinationId: input.ExclusiveStartDestinationId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), }; }; const serializeAws_json1_1Deserializer = (input: Deserializer, context: __SerdeContext): any => { return { - ...(input.HiveJsonSerDe !== undefined && { - HiveJsonSerDe: serializeAws_json1_1HiveJsonSerDe(input.HiveJsonSerDe, context), - }), - ...(input.OpenXJsonSerDe !== undefined && { - OpenXJsonSerDe: serializeAws_json1_1OpenXJsonSerDe(input.OpenXJsonSerDe, context), - }), + ...(input.HiveJsonSerDe !== undefined && + input.HiveJsonSerDe !== null && { + HiveJsonSerDe: serializeAws_json1_1HiveJsonSerDe(input.HiveJsonSerDe, context), + }), + ...(input.OpenXJsonSerDe !== undefined && + input.OpenXJsonSerDe !== null && { + OpenXJsonSerDe: serializeAws_json1_1OpenXJsonSerDe(input.OpenXJsonSerDe, context), + }), }; }; @@ -1441,8 +1451,9 @@ const serializeAws_json1_1ElasticsearchBufferingHints = ( context: __SerdeContext ): any => { return { - ...(input.IntervalInSeconds !== undefined && { IntervalInSeconds: input.IntervalInSeconds }), - ...(input.SizeInMBs !== undefined && { SizeInMBs: input.SizeInMBs }), + ...(input.IntervalInSeconds !== undefined && + input.IntervalInSeconds !== null && { IntervalInSeconds: input.IntervalInSeconds }), + ...(input.SizeInMBs !== undefined && input.SizeInMBs !== null && { SizeInMBs: input.SizeInMBs }), }; }; @@ -1451,31 +1462,39 @@ const serializeAws_json1_1ElasticsearchDestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.BufferingHints !== undefined && { - BufferingHints: serializeAws_json1_1ElasticsearchBufferingHints(input.BufferingHints, context), - }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.ClusterEndpoint !== undefined && { ClusterEndpoint: input.ClusterEndpoint }), - ...(input.DomainARN !== undefined && { DomainARN: input.DomainARN }), - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.IndexRotationPeriod !== undefined && { IndexRotationPeriod: input.IndexRotationPeriod }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RetryOptions !== undefined && { - RetryOptions: serializeAws_json1_1ElasticsearchRetryOptions(input.RetryOptions, context), - }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.S3BackupMode !== undefined && { S3BackupMode: input.S3BackupMode }), - ...(input.S3Configuration !== undefined && { - S3Configuration: serializeAws_json1_1S3DestinationConfiguration(input.S3Configuration, context), - }), - ...(input.TypeName !== undefined && { TypeName: input.TypeName }), - ...(input.VpcConfiguration !== undefined && { - VpcConfiguration: serializeAws_json1_1VpcConfiguration(input.VpcConfiguration, context), - }), + ...(input.BufferingHints !== undefined && + input.BufferingHints !== null && { + BufferingHints: serializeAws_json1_1ElasticsearchBufferingHints(input.BufferingHints, context), + }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.ClusterEndpoint !== undefined && + input.ClusterEndpoint !== null && { ClusterEndpoint: input.ClusterEndpoint }), + ...(input.DomainARN !== undefined && input.DomainARN !== null && { DomainARN: input.DomainARN }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.IndexRotationPeriod !== undefined && + input.IndexRotationPeriod !== null && { IndexRotationPeriod: input.IndexRotationPeriod }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RetryOptions !== undefined && + input.RetryOptions !== null && { + RetryOptions: serializeAws_json1_1ElasticsearchRetryOptions(input.RetryOptions, context), + }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.S3BackupMode !== undefined && input.S3BackupMode !== null && { S3BackupMode: input.S3BackupMode }), + ...(input.S3Configuration !== undefined && + input.S3Configuration !== null && { + S3Configuration: serializeAws_json1_1S3DestinationConfiguration(input.S3Configuration, context), + }), + ...(input.TypeName !== undefined && input.TypeName !== null && { TypeName: input.TypeName }), + ...(input.VpcConfiguration !== undefined && + input.VpcConfiguration !== null && { + VpcConfiguration: serializeAws_json1_1VpcConfiguration(input.VpcConfiguration, context), + }), }; }; @@ -1484,25 +1503,32 @@ const serializeAws_json1_1ElasticsearchDestinationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.BufferingHints !== undefined && { - BufferingHints: serializeAws_json1_1ElasticsearchBufferingHints(input.BufferingHints, context), - }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.ClusterEndpoint !== undefined && { ClusterEndpoint: input.ClusterEndpoint }), - ...(input.DomainARN !== undefined && { DomainARN: input.DomainARN }), - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.IndexRotationPeriod !== undefined && { IndexRotationPeriod: input.IndexRotationPeriod }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RetryOptions !== undefined && { - RetryOptions: serializeAws_json1_1ElasticsearchRetryOptions(input.RetryOptions, context), - }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.S3Update !== undefined && { S3Update: serializeAws_json1_1S3DestinationUpdate(input.S3Update, context) }), - ...(input.TypeName !== undefined && { TypeName: input.TypeName }), + ...(input.BufferingHints !== undefined && + input.BufferingHints !== null && { + BufferingHints: serializeAws_json1_1ElasticsearchBufferingHints(input.BufferingHints, context), + }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.ClusterEndpoint !== undefined && + input.ClusterEndpoint !== null && { ClusterEndpoint: input.ClusterEndpoint }), + ...(input.DomainARN !== undefined && input.DomainARN !== null && { DomainARN: input.DomainARN }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.IndexRotationPeriod !== undefined && + input.IndexRotationPeriod !== null && { IndexRotationPeriod: input.IndexRotationPeriod }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RetryOptions !== undefined && + input.RetryOptions !== null && { + RetryOptions: serializeAws_json1_1ElasticsearchRetryOptions(input.RetryOptions, context), + }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.S3Update !== undefined && + input.S3Update !== null && { S3Update: serializeAws_json1_1S3DestinationUpdate(input.S3Update, context) }), + ...(input.TypeName !== undefined && input.TypeName !== null && { TypeName: input.TypeName }), }; }; @@ -1511,16 +1537,19 @@ const serializeAws_json1_1ElasticsearchRetryOptions = ( context: __SerdeContext ): any => { return { - ...(input.DurationInSeconds !== undefined && { DurationInSeconds: input.DurationInSeconds }), + ...(input.DurationInSeconds !== undefined && + input.DurationInSeconds !== null && { DurationInSeconds: input.DurationInSeconds }), }; }; const serializeAws_json1_1EncryptionConfiguration = (input: EncryptionConfiguration, context: __SerdeContext): any => { return { - ...(input.KMSEncryptionConfig !== undefined && { - KMSEncryptionConfig: serializeAws_json1_1KMSEncryptionConfig(input.KMSEncryptionConfig, context), - }), - ...(input.NoEncryptionConfig !== undefined && { NoEncryptionConfig: input.NoEncryptionConfig }), + ...(input.KMSEncryptionConfig !== undefined && + input.KMSEncryptionConfig !== null && { + KMSEncryptionConfig: serializeAws_json1_1KMSEncryptionConfig(input.KMSEncryptionConfig, context), + }), + ...(input.NoEncryptionConfig !== undefined && + input.NoEncryptionConfig !== null && { NoEncryptionConfig: input.NoEncryptionConfig }), }; }; @@ -1529,33 +1558,41 @@ const serializeAws_json1_1ExtendedS3DestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), - ...(input.BufferingHints !== undefined && { - BufferingHints: serializeAws_json1_1BufferingHints(input.BufferingHints, context), - }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.CompressionFormat !== undefined && { CompressionFormat: input.CompressionFormat }), - ...(input.DataFormatConversionConfiguration !== undefined && { - DataFormatConversionConfiguration: serializeAws_json1_1DataFormatConversionConfiguration( - input.DataFormatConversionConfiguration, - context - ), - }), - ...(input.EncryptionConfiguration !== undefined && { - EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), - }), - ...(input.ErrorOutputPrefix !== undefined && { ErrorOutputPrefix: input.ErrorOutputPrefix }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.S3BackupConfiguration !== undefined && { - S3BackupConfiguration: serializeAws_json1_1S3DestinationConfiguration(input.S3BackupConfiguration, context), - }), - ...(input.S3BackupMode !== undefined && { S3BackupMode: input.S3BackupMode }), + ...(input.BucketARN !== undefined && input.BucketARN !== null && { BucketARN: input.BucketARN }), + ...(input.BufferingHints !== undefined && + input.BufferingHints !== null && { + BufferingHints: serializeAws_json1_1BufferingHints(input.BufferingHints, context), + }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.CompressionFormat !== undefined && + input.CompressionFormat !== null && { CompressionFormat: input.CompressionFormat }), + ...(input.DataFormatConversionConfiguration !== undefined && + input.DataFormatConversionConfiguration !== null && { + DataFormatConversionConfiguration: serializeAws_json1_1DataFormatConversionConfiguration( + input.DataFormatConversionConfiguration, + context + ), + }), + ...(input.EncryptionConfiguration !== undefined && + input.EncryptionConfiguration !== null && { + EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), + }), + ...(input.ErrorOutputPrefix !== undefined && + input.ErrorOutputPrefix !== null && { ErrorOutputPrefix: input.ErrorOutputPrefix }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.S3BackupConfiguration !== undefined && + input.S3BackupConfiguration !== null && { + S3BackupConfiguration: serializeAws_json1_1S3DestinationConfiguration(input.S3BackupConfiguration, context), + }), + ...(input.S3BackupMode !== undefined && input.S3BackupMode !== null && { S3BackupMode: input.S3BackupMode }), }; }; @@ -1564,41 +1601,50 @@ const serializeAws_json1_1ExtendedS3DestinationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), - ...(input.BufferingHints !== undefined && { - BufferingHints: serializeAws_json1_1BufferingHints(input.BufferingHints, context), - }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.CompressionFormat !== undefined && { CompressionFormat: input.CompressionFormat }), - ...(input.DataFormatConversionConfiguration !== undefined && { - DataFormatConversionConfiguration: serializeAws_json1_1DataFormatConversionConfiguration( - input.DataFormatConversionConfiguration, - context - ), - }), - ...(input.EncryptionConfiguration !== undefined && { - EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), - }), - ...(input.ErrorOutputPrefix !== undefined && { ErrorOutputPrefix: input.ErrorOutputPrefix }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.S3BackupMode !== undefined && { S3BackupMode: input.S3BackupMode }), - ...(input.S3BackupUpdate !== undefined && { - S3BackupUpdate: serializeAws_json1_1S3DestinationUpdate(input.S3BackupUpdate, context), - }), + ...(input.BucketARN !== undefined && input.BucketARN !== null && { BucketARN: input.BucketARN }), + ...(input.BufferingHints !== undefined && + input.BufferingHints !== null && { + BufferingHints: serializeAws_json1_1BufferingHints(input.BufferingHints, context), + }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.CompressionFormat !== undefined && + input.CompressionFormat !== null && { CompressionFormat: input.CompressionFormat }), + ...(input.DataFormatConversionConfiguration !== undefined && + input.DataFormatConversionConfiguration !== null && { + DataFormatConversionConfiguration: serializeAws_json1_1DataFormatConversionConfiguration( + input.DataFormatConversionConfiguration, + context + ), + }), + ...(input.EncryptionConfiguration !== undefined && + input.EncryptionConfiguration !== null && { + EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), + }), + ...(input.ErrorOutputPrefix !== undefined && + input.ErrorOutputPrefix !== null && { ErrorOutputPrefix: input.ErrorOutputPrefix }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.S3BackupMode !== undefined && input.S3BackupMode !== null && { S3BackupMode: input.S3BackupMode }), + ...(input.S3BackupUpdate !== undefined && + input.S3BackupUpdate !== null && { + S3BackupUpdate: serializeAws_json1_1S3DestinationUpdate(input.S3BackupUpdate, context), + }), }; }; const serializeAws_json1_1HiveJsonSerDe = (input: HiveJsonSerDe, context: __SerdeContext): any => { return { - ...(input.TimestampFormats !== undefined && { - TimestampFormats: serializeAws_json1_1ListOfNonEmptyStrings(input.TimestampFormats, context), - }), + ...(input.TimestampFormats !== undefined && + input.TimestampFormats !== null && { + TimestampFormats: serializeAws_json1_1ListOfNonEmptyStrings(input.TimestampFormats, context), + }), }; }; @@ -1607,8 +1653,9 @@ const serializeAws_json1_1HttpEndpointBufferingHints = ( context: __SerdeContext ): any => { return { - ...(input.IntervalInSeconds !== undefined && { IntervalInSeconds: input.IntervalInSeconds }), - ...(input.SizeInMBs !== undefined && { SizeInMBs: input.SizeInMBs }), + ...(input.IntervalInSeconds !== undefined && + input.IntervalInSeconds !== null && { IntervalInSeconds: input.IntervalInSeconds }), + ...(input.SizeInMBs !== undefined && input.SizeInMBs !== null && { SizeInMBs: input.SizeInMBs }), }; }; @@ -1617,8 +1664,9 @@ const serializeAws_json1_1HttpEndpointCommonAttribute = ( context: __SerdeContext ): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.AttributeValue !== undefined && { AttributeValue: input.AttributeValue }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.AttributeValue !== undefined && + input.AttributeValue !== null && { AttributeValue: input.AttributeValue }), }; }; @@ -1626,7 +1674,14 @@ const serializeAws_json1_1HttpEndpointCommonAttributesList = ( input: HttpEndpointCommonAttribute[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1HttpEndpointCommonAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1HttpEndpointCommonAttribute(entry, context); + }); }; const serializeAws_json1_1HttpEndpointConfiguration = ( @@ -1634,9 +1689,9 @@ const serializeAws_json1_1HttpEndpointConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AccessKey !== undefined && { AccessKey: input.AccessKey }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.AccessKey !== undefined && input.AccessKey !== null && { AccessKey: input.AccessKey }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; @@ -1645,29 +1700,36 @@ const serializeAws_json1_1HttpEndpointDestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.BufferingHints !== undefined && { - BufferingHints: serializeAws_json1_1HttpEndpointBufferingHints(input.BufferingHints, context), - }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.EndpointConfiguration !== undefined && { - EndpointConfiguration: serializeAws_json1_1HttpEndpointConfiguration(input.EndpointConfiguration, context), - }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RequestConfiguration !== undefined && { - RequestConfiguration: serializeAws_json1_1HttpEndpointRequestConfiguration(input.RequestConfiguration, context), - }), - ...(input.RetryOptions !== undefined && { - RetryOptions: serializeAws_json1_1HttpEndpointRetryOptions(input.RetryOptions, context), - }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.S3BackupMode !== undefined && { S3BackupMode: input.S3BackupMode }), - ...(input.S3Configuration !== undefined && { - S3Configuration: serializeAws_json1_1S3DestinationConfiguration(input.S3Configuration, context), - }), + ...(input.BufferingHints !== undefined && + input.BufferingHints !== null && { + BufferingHints: serializeAws_json1_1HttpEndpointBufferingHints(input.BufferingHints, context), + }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.EndpointConfiguration !== undefined && + input.EndpointConfiguration !== null && { + EndpointConfiguration: serializeAws_json1_1HttpEndpointConfiguration(input.EndpointConfiguration, context), + }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RequestConfiguration !== undefined && + input.RequestConfiguration !== null && { + RequestConfiguration: serializeAws_json1_1HttpEndpointRequestConfiguration(input.RequestConfiguration, context), + }), + ...(input.RetryOptions !== undefined && + input.RetryOptions !== null && { + RetryOptions: serializeAws_json1_1HttpEndpointRetryOptions(input.RetryOptions, context), + }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.S3BackupMode !== undefined && input.S3BackupMode !== null && { S3BackupMode: input.S3BackupMode }), + ...(input.S3Configuration !== undefined && + input.S3Configuration !== null && { + S3Configuration: serializeAws_json1_1S3DestinationConfiguration(input.S3Configuration, context), + }), }; }; @@ -1676,27 +1738,34 @@ const serializeAws_json1_1HttpEndpointDestinationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.BufferingHints !== undefined && { - BufferingHints: serializeAws_json1_1HttpEndpointBufferingHints(input.BufferingHints, context), - }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.EndpointConfiguration !== undefined && { - EndpointConfiguration: serializeAws_json1_1HttpEndpointConfiguration(input.EndpointConfiguration, context), - }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RequestConfiguration !== undefined && { - RequestConfiguration: serializeAws_json1_1HttpEndpointRequestConfiguration(input.RequestConfiguration, context), - }), - ...(input.RetryOptions !== undefined && { - RetryOptions: serializeAws_json1_1HttpEndpointRetryOptions(input.RetryOptions, context), - }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.S3BackupMode !== undefined && { S3BackupMode: input.S3BackupMode }), - ...(input.S3Update !== undefined && { S3Update: serializeAws_json1_1S3DestinationUpdate(input.S3Update, context) }), + ...(input.BufferingHints !== undefined && + input.BufferingHints !== null && { + BufferingHints: serializeAws_json1_1HttpEndpointBufferingHints(input.BufferingHints, context), + }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.EndpointConfiguration !== undefined && + input.EndpointConfiguration !== null && { + EndpointConfiguration: serializeAws_json1_1HttpEndpointConfiguration(input.EndpointConfiguration, context), + }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RequestConfiguration !== undefined && + input.RequestConfiguration !== null && { + RequestConfiguration: serializeAws_json1_1HttpEndpointRequestConfiguration(input.RequestConfiguration, context), + }), + ...(input.RetryOptions !== undefined && + input.RetryOptions !== null && { + RetryOptions: serializeAws_json1_1HttpEndpointRetryOptions(input.RetryOptions, context), + }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.S3BackupMode !== undefined && input.S3BackupMode !== null && { S3BackupMode: input.S3BackupMode }), + ...(input.S3Update !== undefined && + input.S3Update !== null && { S3Update: serializeAws_json1_1S3DestinationUpdate(input.S3Update, context) }), }; }; @@ -1705,10 +1774,12 @@ const serializeAws_json1_1HttpEndpointRequestConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CommonAttributes !== undefined && { - CommonAttributes: serializeAws_json1_1HttpEndpointCommonAttributesList(input.CommonAttributes, context), - }), - ...(input.ContentEncoding !== undefined && { ContentEncoding: input.ContentEncoding }), + ...(input.CommonAttributes !== undefined && + input.CommonAttributes !== null && { + CommonAttributes: serializeAws_json1_1HttpEndpointCommonAttributesList(input.CommonAttributes, context), + }), + ...(input.ContentEncoding !== undefined && + input.ContentEncoding !== null && { ContentEncoding: input.ContentEncoding }), }; }; @@ -1717,7 +1788,8 @@ const serializeAws_json1_1HttpEndpointRetryOptions = ( context: __SerdeContext ): any => { return { - ...(input.DurationInSeconds !== undefined && { DurationInSeconds: input.DurationInSeconds }), + ...(input.DurationInSeconds !== undefined && + input.DurationInSeconds !== null && { DurationInSeconds: input.DurationInSeconds }), }; }; @@ -1726,9 +1798,8 @@ const serializeAws_json1_1InputFormatConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Deserializer !== undefined && { - Deserializer: serializeAws_json1_1Deserializer(input.Deserializer, context), - }), + ...(input.Deserializer !== undefined && + input.Deserializer !== null && { Deserializer: serializeAws_json1_1Deserializer(input.Deserializer, context) }), }; }; @@ -1737,14 +1808,15 @@ const serializeAws_json1_1KinesisStreamSourceConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.KinesisStreamARN !== undefined && { KinesisStreamARN: input.KinesisStreamARN }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.KinesisStreamARN !== undefined && + input.KinesisStreamARN !== null && { KinesisStreamARN: input.KinesisStreamARN }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; const serializeAws_json1_1KMSEncryptionConfig = (input: KMSEncryptionConfig, context: __SerdeContext): any => { return { - ...(input.AWSKMSKeyARN !== undefined && { AWSKMSKeyARN: input.AWSKMSKeyARN }), + ...(input.AWSKMSKeyARN !== undefined && input.AWSKMSKeyARN !== null && { AWSKMSKeyARN: input.AWSKMSKeyARN }), }; }; @@ -1753,20 +1825,36 @@ const serializeAws_json1_1ListDeliveryStreamsInput = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamType !== undefined && { DeliveryStreamType: input.DeliveryStreamType }), - ...(input.ExclusiveStartDeliveryStreamName !== undefined && { - ExclusiveStartDeliveryStreamName: input.ExclusiveStartDeliveryStreamName, - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.DeliveryStreamType !== undefined && + input.DeliveryStreamType !== null && { DeliveryStreamType: input.DeliveryStreamType }), + ...(input.ExclusiveStartDeliveryStreamName !== undefined && + input.ExclusiveStartDeliveryStreamName !== null && { + ExclusiveStartDeliveryStreamName: input.ExclusiveStartDeliveryStreamName, + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), }; }; const serializeAws_json1_1ListOfNonEmptyStrings = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListOfNonEmptyStringsWithoutWhitespace = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListTagsForDeliveryStreamInput = ( @@ -1774,40 +1862,55 @@ const serializeAws_json1_1ListTagsForDeliveryStreamInput = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), - ...(input.ExclusiveStartTagKey !== undefined && { ExclusiveStartTagKey: input.ExclusiveStartTagKey }), - ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.ExclusiveStartTagKey !== undefined && + input.ExclusiveStartTagKey !== null && { ExclusiveStartTagKey: input.ExclusiveStartTagKey }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), }; }; const serializeAws_json1_1OpenXJsonSerDe = (input: OpenXJsonSerDe, context: __SerdeContext): any => { return { - ...(input.CaseInsensitive !== undefined && { CaseInsensitive: input.CaseInsensitive }), - ...(input.ColumnToJsonKeyMappings !== undefined && { - ColumnToJsonKeyMappings: serializeAws_json1_1ColumnToJsonKeyMappings(input.ColumnToJsonKeyMappings, context), - }), - ...(input.ConvertDotsInJsonKeysToUnderscores !== undefined && { - ConvertDotsInJsonKeysToUnderscores: input.ConvertDotsInJsonKeysToUnderscores, - }), + ...(input.CaseInsensitive !== undefined && + input.CaseInsensitive !== null && { CaseInsensitive: input.CaseInsensitive }), + ...(input.ColumnToJsonKeyMappings !== undefined && + input.ColumnToJsonKeyMappings !== null && { + ColumnToJsonKeyMappings: serializeAws_json1_1ColumnToJsonKeyMappings(input.ColumnToJsonKeyMappings, context), + }), + ...(input.ConvertDotsInJsonKeysToUnderscores !== undefined && + input.ConvertDotsInJsonKeysToUnderscores !== null && { + ConvertDotsInJsonKeysToUnderscores: input.ConvertDotsInJsonKeysToUnderscores, + }), }; }; const serializeAws_json1_1OrcSerDe = (input: OrcSerDe, context: __SerdeContext): any => { return { - ...(input.BlockSizeBytes !== undefined && { BlockSizeBytes: input.BlockSizeBytes }), - ...(input.BloomFilterColumns !== undefined && { - BloomFilterColumns: serializeAws_json1_1ListOfNonEmptyStringsWithoutWhitespace(input.BloomFilterColumns, context), - }), - ...(input.BloomFilterFalsePositiveProbability !== undefined && { - BloomFilterFalsePositiveProbability: input.BloomFilterFalsePositiveProbability, - }), - ...(input.Compression !== undefined && { Compression: input.Compression }), - ...(input.DictionaryKeyThreshold !== undefined && { DictionaryKeyThreshold: input.DictionaryKeyThreshold }), - ...(input.EnablePadding !== undefined && { EnablePadding: input.EnablePadding }), - ...(input.FormatVersion !== undefined && { FormatVersion: input.FormatVersion }), - ...(input.PaddingTolerance !== undefined && { PaddingTolerance: input.PaddingTolerance }), - ...(input.RowIndexStride !== undefined && { RowIndexStride: input.RowIndexStride }), - ...(input.StripeSizeBytes !== undefined && { StripeSizeBytes: input.StripeSizeBytes }), + ...(input.BlockSizeBytes !== undefined && + input.BlockSizeBytes !== null && { BlockSizeBytes: input.BlockSizeBytes }), + ...(input.BloomFilterColumns !== undefined && + input.BloomFilterColumns !== null && { + BloomFilterColumns: serializeAws_json1_1ListOfNonEmptyStringsWithoutWhitespace( + input.BloomFilterColumns, + context + ), + }), + ...(input.BloomFilterFalsePositiveProbability !== undefined && + input.BloomFilterFalsePositiveProbability !== null && { + BloomFilterFalsePositiveProbability: input.BloomFilterFalsePositiveProbability, + }), + ...(input.Compression !== undefined && input.Compression !== null && { Compression: input.Compression }), + ...(input.DictionaryKeyThreshold !== undefined && + input.DictionaryKeyThreshold !== null && { DictionaryKeyThreshold: input.DictionaryKeyThreshold }), + ...(input.EnablePadding !== undefined && input.EnablePadding !== null && { EnablePadding: input.EnablePadding }), + ...(input.FormatVersion !== undefined && input.FormatVersion !== null && { FormatVersion: input.FormatVersion }), + ...(input.PaddingTolerance !== undefined && + input.PaddingTolerance !== null && { PaddingTolerance: input.PaddingTolerance }), + ...(input.RowIndexStride !== undefined && + input.RowIndexStride !== null && { RowIndexStride: input.RowIndexStride }), + ...(input.StripeSizeBytes !== undefined && + input.StripeSizeBytes !== null && { StripeSizeBytes: input.StripeSizeBytes }), }; }; @@ -1816,77 +1919,107 @@ const serializeAws_json1_1OutputFormatConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Serializer !== undefined && { Serializer: serializeAws_json1_1Serializer(input.Serializer, context) }), + ...(input.Serializer !== undefined && + input.Serializer !== null && { Serializer: serializeAws_json1_1Serializer(input.Serializer, context) }), }; }; const serializeAws_json1_1ParquetSerDe = (input: ParquetSerDe, context: __SerdeContext): any => { return { - ...(input.BlockSizeBytes !== undefined && { BlockSizeBytes: input.BlockSizeBytes }), - ...(input.Compression !== undefined && { Compression: input.Compression }), - ...(input.EnableDictionaryCompression !== undefined && { - EnableDictionaryCompression: input.EnableDictionaryCompression, - }), - ...(input.MaxPaddingBytes !== undefined && { MaxPaddingBytes: input.MaxPaddingBytes }), - ...(input.PageSizeBytes !== undefined && { PageSizeBytes: input.PageSizeBytes }), - ...(input.WriterVersion !== undefined && { WriterVersion: input.WriterVersion }), + ...(input.BlockSizeBytes !== undefined && + input.BlockSizeBytes !== null && { BlockSizeBytes: input.BlockSizeBytes }), + ...(input.Compression !== undefined && input.Compression !== null && { Compression: input.Compression }), + ...(input.EnableDictionaryCompression !== undefined && + input.EnableDictionaryCompression !== null && { EnableDictionaryCompression: input.EnableDictionaryCompression }), + ...(input.MaxPaddingBytes !== undefined && + input.MaxPaddingBytes !== null && { MaxPaddingBytes: input.MaxPaddingBytes }), + ...(input.PageSizeBytes !== undefined && input.PageSizeBytes !== null && { PageSizeBytes: input.PageSizeBytes }), + ...(input.WriterVersion !== undefined && input.WriterVersion !== null && { WriterVersion: input.WriterVersion }), }; }; const serializeAws_json1_1ProcessingConfiguration = (input: ProcessingConfiguration, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.Processors !== undefined && { Processors: serializeAws_json1_1ProcessorList(input.Processors, context) }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.Processors !== undefined && + input.Processors !== null && { Processors: serializeAws_json1_1ProcessorList(input.Processors, context) }), }; }; const serializeAws_json1_1Processor = (input: Processor, context: __SerdeContext): any => { return { - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1ProcessorParameterList(input.Parameters, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_1ProcessorParameterList(input.Parameters, context), + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1ProcessorList = (input: Processor[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Processor(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Processor(entry, context); + }); }; const serializeAws_json1_1ProcessorParameter = (input: ProcessorParameter, context: __SerdeContext): any => { return { - ...(input.ParameterName !== undefined && { ParameterName: input.ParameterName }), - ...(input.ParameterValue !== undefined && { ParameterValue: input.ParameterValue }), + ...(input.ParameterName !== undefined && input.ParameterName !== null && { ParameterName: input.ParameterName }), + ...(input.ParameterValue !== undefined && + input.ParameterValue !== null && { ParameterValue: input.ParameterValue }), }; }; const serializeAws_json1_1ProcessorParameterList = (input: ProcessorParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ProcessorParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProcessorParameter(entry, context); + }); }; const serializeAws_json1_1PutRecordBatchInput = (input: PutRecordBatchInput, context: __SerdeContext): any => { return { - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), - ...(input.Records !== undefined && { - Records: serializeAws_json1_1PutRecordBatchRequestEntryList(input.Records, context), - }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.Records !== undefined && + input.Records !== null && { + Records: serializeAws_json1_1PutRecordBatchRequestEntryList(input.Records, context), + }), }; }; const serializeAws_json1_1PutRecordBatchRequestEntryList = (input: _Record[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1_Record(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1_Record(entry, context); + }); }; const serializeAws_json1_1PutRecordInput = (input: PutRecordInput, context: __SerdeContext): any => { return { - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), - ...(input.Record !== undefined && { Record: serializeAws_json1_1_Record(input.Record, context) }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.Record !== undefined && + input.Record !== null && { Record: serializeAws_json1_1_Record(input.Record, context) }), }; }; const serializeAws_json1_1_Record = (input: _Record, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }), + ...(input.Data !== undefined && input.Data !== null && { Data: context.base64Encoder(input.Data) }), }; }; @@ -1895,29 +2028,34 @@ const serializeAws_json1_1RedshiftDestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.ClusterJDBCURL !== undefined && { ClusterJDBCURL: input.ClusterJDBCURL }), - ...(input.CopyCommand !== undefined && { - CopyCommand: serializeAws_json1_1CopyCommand(input.CopyCommand, context), - }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RetryOptions !== undefined && { - RetryOptions: serializeAws_json1_1RedshiftRetryOptions(input.RetryOptions, context), - }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.S3BackupConfiguration !== undefined && { - S3BackupConfiguration: serializeAws_json1_1S3DestinationConfiguration(input.S3BackupConfiguration, context), - }), - ...(input.S3BackupMode !== undefined && { S3BackupMode: input.S3BackupMode }), - ...(input.S3Configuration !== undefined && { - S3Configuration: serializeAws_json1_1S3DestinationConfiguration(input.S3Configuration, context), - }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.ClusterJDBCURL !== undefined && + input.ClusterJDBCURL !== null && { ClusterJDBCURL: input.ClusterJDBCURL }), + ...(input.CopyCommand !== undefined && + input.CopyCommand !== null && { CopyCommand: serializeAws_json1_1CopyCommand(input.CopyCommand, context) }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RetryOptions !== undefined && + input.RetryOptions !== null && { + RetryOptions: serializeAws_json1_1RedshiftRetryOptions(input.RetryOptions, context), + }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.S3BackupConfiguration !== undefined && + input.S3BackupConfiguration !== null && { + S3BackupConfiguration: serializeAws_json1_1S3DestinationConfiguration(input.S3BackupConfiguration, context), + }), + ...(input.S3BackupMode !== undefined && input.S3BackupMode !== null && { S3BackupMode: input.S3BackupMode }), + ...(input.S3Configuration !== undefined && + input.S3Configuration !== null && { + S3Configuration: serializeAws_json1_1S3DestinationConfiguration(input.S3Configuration, context), + }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; @@ -1926,33 +2064,39 @@ const serializeAws_json1_1RedshiftDestinationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.ClusterJDBCURL !== undefined && { ClusterJDBCURL: input.ClusterJDBCURL }), - ...(input.CopyCommand !== undefined && { - CopyCommand: serializeAws_json1_1CopyCommand(input.CopyCommand, context), - }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RetryOptions !== undefined && { - RetryOptions: serializeAws_json1_1RedshiftRetryOptions(input.RetryOptions, context), - }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.S3BackupMode !== undefined && { S3BackupMode: input.S3BackupMode }), - ...(input.S3BackupUpdate !== undefined && { - S3BackupUpdate: serializeAws_json1_1S3DestinationUpdate(input.S3BackupUpdate, context), - }), - ...(input.S3Update !== undefined && { S3Update: serializeAws_json1_1S3DestinationUpdate(input.S3Update, context) }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.ClusterJDBCURL !== undefined && + input.ClusterJDBCURL !== null && { ClusterJDBCURL: input.ClusterJDBCURL }), + ...(input.CopyCommand !== undefined && + input.CopyCommand !== null && { CopyCommand: serializeAws_json1_1CopyCommand(input.CopyCommand, context) }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RetryOptions !== undefined && + input.RetryOptions !== null && { + RetryOptions: serializeAws_json1_1RedshiftRetryOptions(input.RetryOptions, context), + }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.S3BackupMode !== undefined && input.S3BackupMode !== null && { S3BackupMode: input.S3BackupMode }), + ...(input.S3BackupUpdate !== undefined && + input.S3BackupUpdate !== null && { + S3BackupUpdate: serializeAws_json1_1S3DestinationUpdate(input.S3BackupUpdate, context), + }), + ...(input.S3Update !== undefined && + input.S3Update !== null && { S3Update: serializeAws_json1_1S3DestinationUpdate(input.S3Update, context) }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1RedshiftRetryOptions = (input: RedshiftRetryOptions, context: __SerdeContext): any => { return { - ...(input.DurationInSeconds !== undefined && { DurationInSeconds: input.DurationInSeconds }), + ...(input.DurationInSeconds !== undefined && + input.DurationInSeconds !== null && { DurationInSeconds: input.DurationInSeconds }), }; }; @@ -1961,63 +2105,80 @@ const serializeAws_json1_1S3DestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), - ...(input.BufferingHints !== undefined && { - BufferingHints: serializeAws_json1_1BufferingHints(input.BufferingHints, context), - }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.CompressionFormat !== undefined && { CompressionFormat: input.CompressionFormat }), - ...(input.EncryptionConfiguration !== undefined && { - EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), - }), - ...(input.ErrorOutputPrefix !== undefined && { ErrorOutputPrefix: input.ErrorOutputPrefix }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.BucketARN !== undefined && input.BucketARN !== null && { BucketARN: input.BucketARN }), + ...(input.BufferingHints !== undefined && + input.BufferingHints !== null && { + BufferingHints: serializeAws_json1_1BufferingHints(input.BufferingHints, context), + }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.CompressionFormat !== undefined && + input.CompressionFormat !== null && { CompressionFormat: input.CompressionFormat }), + ...(input.EncryptionConfiguration !== undefined && + input.EncryptionConfiguration !== null && { + EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), + }), + ...(input.ErrorOutputPrefix !== undefined && + input.ErrorOutputPrefix !== null && { ErrorOutputPrefix: input.ErrorOutputPrefix }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; const serializeAws_json1_1S3DestinationUpdate = (input: S3DestinationUpdate, context: __SerdeContext): any => { return { - ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), - ...(input.BufferingHints !== undefined && { - BufferingHints: serializeAws_json1_1BufferingHints(input.BufferingHints, context), - }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.CompressionFormat !== undefined && { CompressionFormat: input.CompressionFormat }), - ...(input.EncryptionConfiguration !== undefined && { - EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), - }), - ...(input.ErrorOutputPrefix !== undefined && { ErrorOutputPrefix: input.ErrorOutputPrefix }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.BucketARN !== undefined && input.BucketARN !== null && { BucketARN: input.BucketARN }), + ...(input.BufferingHints !== undefined && + input.BufferingHints !== null && { + BufferingHints: serializeAws_json1_1BufferingHints(input.BufferingHints, context), + }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.CompressionFormat !== undefined && + input.CompressionFormat !== null && { CompressionFormat: input.CompressionFormat }), + ...(input.EncryptionConfiguration !== undefined && + input.EncryptionConfiguration !== null && { + EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), + }), + ...(input.ErrorOutputPrefix !== undefined && + input.ErrorOutputPrefix !== null && { ErrorOutputPrefix: input.ErrorOutputPrefix }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; const serializeAws_json1_1SchemaConfiguration = (input: SchemaConfiguration, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Region !== undefined && { Region: input.Region }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.VersionId !== undefined && { VersionId: input.VersionId }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.VersionId !== undefined && input.VersionId !== null && { VersionId: input.VersionId }), }; }; const serializeAws_json1_1SecurityGroupIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Serializer = (input: Serializer, context: __SerdeContext): any => { return { - ...(input.OrcSerDe !== undefined && { OrcSerDe: serializeAws_json1_1OrcSerDe(input.OrcSerDe, context) }), - ...(input.ParquetSerDe !== undefined && { - ParquetSerDe: serializeAws_json1_1ParquetSerDe(input.ParquetSerDe, context), - }), + ...(input.OrcSerDe !== undefined && + input.OrcSerDe !== null && { OrcSerDe: serializeAws_json1_1OrcSerDe(input.OrcSerDe, context) }), + ...(input.ParquetSerDe !== undefined && + input.ParquetSerDe !== null && { ParquetSerDe: serializeAws_json1_1ParquetSerDe(input.ParquetSerDe, context) }), }; }; @@ -2026,53 +2187,66 @@ const serializeAws_json1_1SplunkDestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.HECAcknowledgmentTimeoutInSeconds !== undefined && { - HECAcknowledgmentTimeoutInSeconds: input.HECAcknowledgmentTimeoutInSeconds, - }), - ...(input.HECEndpoint !== undefined && { HECEndpoint: input.HECEndpoint }), - ...(input.HECEndpointType !== undefined && { HECEndpointType: input.HECEndpointType }), - ...(input.HECToken !== undefined && { HECToken: input.HECToken }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RetryOptions !== undefined && { - RetryOptions: serializeAws_json1_1SplunkRetryOptions(input.RetryOptions, context), - }), - ...(input.S3BackupMode !== undefined && { S3BackupMode: input.S3BackupMode }), - ...(input.S3Configuration !== undefined && { - S3Configuration: serializeAws_json1_1S3DestinationConfiguration(input.S3Configuration, context), - }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.HECAcknowledgmentTimeoutInSeconds !== undefined && + input.HECAcknowledgmentTimeoutInSeconds !== null && { + HECAcknowledgmentTimeoutInSeconds: input.HECAcknowledgmentTimeoutInSeconds, + }), + ...(input.HECEndpoint !== undefined && input.HECEndpoint !== null && { HECEndpoint: input.HECEndpoint }), + ...(input.HECEndpointType !== undefined && + input.HECEndpointType !== null && { HECEndpointType: input.HECEndpointType }), + ...(input.HECToken !== undefined && input.HECToken !== null && { HECToken: input.HECToken }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RetryOptions !== undefined && + input.RetryOptions !== null && { + RetryOptions: serializeAws_json1_1SplunkRetryOptions(input.RetryOptions, context), + }), + ...(input.S3BackupMode !== undefined && input.S3BackupMode !== null && { S3BackupMode: input.S3BackupMode }), + ...(input.S3Configuration !== undefined && + input.S3Configuration !== null && { + S3Configuration: serializeAws_json1_1S3DestinationConfiguration(input.S3Configuration, context), + }), }; }; const serializeAws_json1_1SplunkDestinationUpdate = (input: SplunkDestinationUpdate, context: __SerdeContext): any => { return { - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.HECAcknowledgmentTimeoutInSeconds !== undefined && { - HECAcknowledgmentTimeoutInSeconds: input.HECAcknowledgmentTimeoutInSeconds, - }), - ...(input.HECEndpoint !== undefined && { HECEndpoint: input.HECEndpoint }), - ...(input.HECEndpointType !== undefined && { HECEndpointType: input.HECEndpointType }), - ...(input.HECToken !== undefined && { HECToken: input.HECToken }), - ...(input.ProcessingConfiguration !== undefined && { - ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), - }), - ...(input.RetryOptions !== undefined && { - RetryOptions: serializeAws_json1_1SplunkRetryOptions(input.RetryOptions, context), - }), - ...(input.S3BackupMode !== undefined && { S3BackupMode: input.S3BackupMode }), - ...(input.S3Update !== undefined && { S3Update: serializeAws_json1_1S3DestinationUpdate(input.S3Update, context) }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.HECAcknowledgmentTimeoutInSeconds !== undefined && + input.HECAcknowledgmentTimeoutInSeconds !== null && { + HECAcknowledgmentTimeoutInSeconds: input.HECAcknowledgmentTimeoutInSeconds, + }), + ...(input.HECEndpoint !== undefined && input.HECEndpoint !== null && { HECEndpoint: input.HECEndpoint }), + ...(input.HECEndpointType !== undefined && + input.HECEndpointType !== null && { HECEndpointType: input.HECEndpointType }), + ...(input.HECToken !== undefined && input.HECToken !== null && { HECToken: input.HECToken }), + ...(input.ProcessingConfiguration !== undefined && + input.ProcessingConfiguration !== null && { + ProcessingConfiguration: serializeAws_json1_1ProcessingConfiguration(input.ProcessingConfiguration, context), + }), + ...(input.RetryOptions !== undefined && + input.RetryOptions !== null && { + RetryOptions: serializeAws_json1_1SplunkRetryOptions(input.RetryOptions, context), + }), + ...(input.S3BackupMode !== undefined && input.S3BackupMode !== null && { S3BackupMode: input.S3BackupMode }), + ...(input.S3Update !== undefined && + input.S3Update !== null && { S3Update: serializeAws_json1_1S3DestinationUpdate(input.S3Update, context) }), }; }; const serializeAws_json1_1SplunkRetryOptions = (input: SplunkRetryOptions, context: __SerdeContext): any => { return { - ...(input.DurationInSeconds !== undefined && { DurationInSeconds: input.DurationInSeconds }), + ...(input.DurationInSeconds !== undefined && + input.DurationInSeconds !== null && { DurationInSeconds: input.DurationInSeconds }), }; }; @@ -2081,13 +2255,15 @@ const serializeAws_json1_1StartDeliveryStreamEncryptionInput = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamEncryptionConfigurationInput !== undefined && { - DeliveryStreamEncryptionConfigurationInput: serializeAws_json1_1DeliveryStreamEncryptionConfigurationInput( - input.DeliveryStreamEncryptionConfigurationInput, - context - ), - }), - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.DeliveryStreamEncryptionConfigurationInput !== undefined && + input.DeliveryStreamEncryptionConfigurationInput !== null && { + DeliveryStreamEncryptionConfigurationInput: serializeAws_json1_1DeliveryStreamEncryptionConfigurationInput( + input.DeliveryStreamEncryptionConfigurationInput, + context + ), + }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), }; }; @@ -2096,34 +2272,58 @@ const serializeAws_json1_1StopDeliveryStreamEncryptionInput = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), }; }; const serializeAws_json1_1SubnetIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagDeliveryStreamInput = (input: TagDeliveryStreamInput, context: __SerdeContext): any => { return { - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagDeliveryStreamInputTagList(input.Tags, context) }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1TagDeliveryStreamInputTagList(input.Tags, context) }), }; }; const serializeAws_json1_1TagDeliveryStreamInputTagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UntagDeliveryStreamInput = ( @@ -2131,58 +2331,70 @@ const serializeAws_json1_1UntagDeliveryStreamInput = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateDestinationInput = (input: UpdateDestinationInput, context: __SerdeContext): any => { return { - ...(input.CurrentDeliveryStreamVersionId !== undefined && { - CurrentDeliveryStreamVersionId: input.CurrentDeliveryStreamVersionId, - }), - ...(input.DeliveryStreamName !== undefined && { DeliveryStreamName: input.DeliveryStreamName }), - ...(input.DestinationId !== undefined && { DestinationId: input.DestinationId }), - ...(input.ElasticsearchDestinationUpdate !== undefined && { - ElasticsearchDestinationUpdate: serializeAws_json1_1ElasticsearchDestinationUpdate( - input.ElasticsearchDestinationUpdate, - context - ), - }), - ...(input.ExtendedS3DestinationUpdate !== undefined && { - ExtendedS3DestinationUpdate: serializeAws_json1_1ExtendedS3DestinationUpdate( - input.ExtendedS3DestinationUpdate, - context - ), - }), - ...(input.HttpEndpointDestinationUpdate !== undefined && { - HttpEndpointDestinationUpdate: serializeAws_json1_1HttpEndpointDestinationUpdate( - input.HttpEndpointDestinationUpdate, - context - ), - }), - ...(input.RedshiftDestinationUpdate !== undefined && { - RedshiftDestinationUpdate: serializeAws_json1_1RedshiftDestinationUpdate( - input.RedshiftDestinationUpdate, - context - ), - }), - ...(input.S3DestinationUpdate !== undefined && { - S3DestinationUpdate: serializeAws_json1_1S3DestinationUpdate(input.S3DestinationUpdate, context), - }), - ...(input.SplunkDestinationUpdate !== undefined && { - SplunkDestinationUpdate: serializeAws_json1_1SplunkDestinationUpdate(input.SplunkDestinationUpdate, context), - }), + ...(input.CurrentDeliveryStreamVersionId !== undefined && + input.CurrentDeliveryStreamVersionId !== null && { + CurrentDeliveryStreamVersionId: input.CurrentDeliveryStreamVersionId, + }), + ...(input.DeliveryStreamName !== undefined && + input.DeliveryStreamName !== null && { DeliveryStreamName: input.DeliveryStreamName }), + ...(input.DestinationId !== undefined && input.DestinationId !== null && { DestinationId: input.DestinationId }), + ...(input.ElasticsearchDestinationUpdate !== undefined && + input.ElasticsearchDestinationUpdate !== null && { + ElasticsearchDestinationUpdate: serializeAws_json1_1ElasticsearchDestinationUpdate( + input.ElasticsearchDestinationUpdate, + context + ), + }), + ...(input.ExtendedS3DestinationUpdate !== undefined && + input.ExtendedS3DestinationUpdate !== null && { + ExtendedS3DestinationUpdate: serializeAws_json1_1ExtendedS3DestinationUpdate( + input.ExtendedS3DestinationUpdate, + context + ), + }), + ...(input.HttpEndpointDestinationUpdate !== undefined && + input.HttpEndpointDestinationUpdate !== null && { + HttpEndpointDestinationUpdate: serializeAws_json1_1HttpEndpointDestinationUpdate( + input.HttpEndpointDestinationUpdate, + context + ), + }), + ...(input.RedshiftDestinationUpdate !== undefined && + input.RedshiftDestinationUpdate !== null && { + RedshiftDestinationUpdate: serializeAws_json1_1RedshiftDestinationUpdate( + input.RedshiftDestinationUpdate, + context + ), + }), + ...(input.S3DestinationUpdate !== undefined && + input.S3DestinationUpdate !== null && { + S3DestinationUpdate: serializeAws_json1_1S3DestinationUpdate(input.S3DestinationUpdate, context), + }), + ...(input.SplunkDestinationUpdate !== undefined && + input.SplunkDestinationUpdate !== null && { + SplunkDestinationUpdate: serializeAws_json1_1SplunkDestinationUpdate(input.SplunkDestinationUpdate, context), + }), }; }; const serializeAws_json1_1VpcConfiguration = (input: VpcConfiguration, context: __SerdeContext): any => { return { - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIdList(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIdList(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) }), }; }; @@ -2212,13 +2424,15 @@ const deserializeAws_json1_1ColumnToJsonKeyMappings = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ConcurrentModificationException = ( @@ -2353,7 +2567,14 @@ const deserializeAws_json1_1DeliveryStreamEncryptionConfiguration = ( }; const deserializeAws_json1_1DeliveryStreamNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DescribeDeliveryStreamOutput = ( @@ -2416,7 +2637,14 @@ const deserializeAws_json1_1DestinationDescriptionList = ( output: any, context: __SerdeContext ): DestinationDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DestinationDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DestinationDescription(entry, context); + }); }; const deserializeAws_json1_1ElasticsearchBufferingHints = ( @@ -2592,7 +2820,14 @@ const deserializeAws_json1_1HttpEndpointCommonAttributesList = ( output: any, context: __SerdeContext ): HttpEndpointCommonAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HttpEndpointCommonAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HttpEndpointCommonAttribute(entry, context); + }); }; const deserializeAws_json1_1HttpEndpointDescription = ( @@ -2744,14 +2979,28 @@ const deserializeAws_json1_1ListDeliveryStreamsOutput = ( }; const deserializeAws_json1_1ListOfNonEmptyStrings = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ListOfNonEmptyStringsWithoutWhitespace = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ListTagsForDeliveryStreamOutput = ( @@ -2768,7 +3017,14 @@ const deserializeAws_json1_1ListTagsForDeliveryStreamOutput = ( }; const deserializeAws_json1_1ListTagsForDeliveryStreamOutputTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1OpenXJsonSerDe = (output: any, context: __SerdeContext): OpenXJsonSerDe => { @@ -2870,7 +3126,14 @@ const deserializeAws_json1_1Processor = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ProcessorList = (output: any, context: __SerdeContext): Processor[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Processor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Processor(entry, context); + }); }; const deserializeAws_json1_1ProcessorParameter = (output: any, context: __SerdeContext): ProcessorParameter => { @@ -2883,7 +3146,14 @@ const deserializeAws_json1_1ProcessorParameter = (output: any, context: __SerdeC }; const deserializeAws_json1_1ProcessorParameterList = (output: any, context: __SerdeContext): ProcessorParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProcessorParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProcessorParameter(entry, context); + }); }; const deserializeAws_json1_1PutRecordBatchOutput = (output: any, context: __SerdeContext): PutRecordBatchOutput => { @@ -2913,7 +3183,14 @@ const deserializeAws_json1_1PutRecordBatchResponseEntryList = ( output: any, context: __SerdeContext ): PutRecordBatchResponseEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PutRecordBatchResponseEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PutRecordBatchResponseEntry(entry, context); + }); }; const deserializeAws_json1_1PutRecordOutput = (output: any, context: __SerdeContext): PutRecordOutput => { @@ -3027,7 +3304,14 @@ const deserializeAws_json1_1SchemaConfiguration = (output: any, context: __Serde }; const deserializeAws_json1_1SecurityGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Serializer = (output: any, context: __SerdeContext): Serializer => { @@ -3118,7 +3402,14 @@ const deserializeAws_json1_1StopDeliveryStreamEncryptionOutput = ( }; const deserializeAws_json1_1SubnetIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -3217,3 +3508,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-fms/protocols/Aws_json1_1.ts b/clients/client-fms/protocols/Aws_json1_1.ts index ed49d6d23b24..86d7f5200a63 100644 --- a/clients/client-fms/protocols/Aws_json1_1.ts +++ b/clients/client-fms/protocols/Aws_json1_1.ts @@ -156,7 +156,7 @@ export const serializeAws_json1_1AssociateAdminAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.AssociateAdminAccount", }; let body: any; @@ -169,7 +169,7 @@ export const serializeAws_json1_1DeleteAppsListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.DeleteAppsList", }; let body: any; @@ -182,7 +182,7 @@ export const serializeAws_json1_1DeleteNotificationChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.DeleteNotificationChannel", }; let body: any; @@ -195,7 +195,7 @@ export const serializeAws_json1_1DeletePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.DeletePolicy", }; let body: any; @@ -208,7 +208,7 @@ export const serializeAws_json1_1DeleteProtocolsListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.DeleteProtocolsList", }; let body: any; @@ -221,7 +221,7 @@ export const serializeAws_json1_1DisassociateAdminAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.DisassociateAdminAccount", }; let body: any; @@ -234,7 +234,7 @@ export const serializeAws_json1_1GetAdminAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.GetAdminAccount", }; let body: any; @@ -247,7 +247,7 @@ export const serializeAws_json1_1GetAppsListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.GetAppsList", }; let body: any; @@ -260,7 +260,7 @@ export const serializeAws_json1_1GetComplianceDetailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.GetComplianceDetail", }; let body: any; @@ -273,7 +273,7 @@ export const serializeAws_json1_1GetNotificationChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.GetNotificationChannel", }; let body: any; @@ -286,7 +286,7 @@ export const serializeAws_json1_1GetPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.GetPolicy", }; let body: any; @@ -299,7 +299,7 @@ export const serializeAws_json1_1GetProtectionStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.GetProtectionStatus", }; let body: any; @@ -312,7 +312,7 @@ export const serializeAws_json1_1GetProtocolsListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.GetProtocolsList", }; let body: any; @@ -325,7 +325,7 @@ export const serializeAws_json1_1GetViolationDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.GetViolationDetails", }; let body: any; @@ -338,7 +338,7 @@ export const serializeAws_json1_1ListAppsListsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.ListAppsLists", }; let body: any; @@ -351,7 +351,7 @@ export const serializeAws_json1_1ListComplianceStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.ListComplianceStatus", }; let body: any; @@ -364,7 +364,7 @@ export const serializeAws_json1_1ListMemberAccountsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.ListMemberAccounts", }; let body: any; @@ -377,7 +377,7 @@ export const serializeAws_json1_1ListPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.ListPolicies", }; let body: any; @@ -390,7 +390,7 @@ export const serializeAws_json1_1ListProtocolsListsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.ListProtocolsLists", }; let body: any; @@ -403,7 +403,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.ListTagsForResource", }; let body: any; @@ -416,7 +416,7 @@ export const serializeAws_json1_1PutAppsListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.PutAppsList", }; let body: any; @@ -429,7 +429,7 @@ export const serializeAws_json1_1PutNotificationChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.PutNotificationChannel", }; let body: any; @@ -442,7 +442,7 @@ export const serializeAws_json1_1PutPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.PutPolicy", }; let body: any; @@ -455,7 +455,7 @@ export const serializeAws_json1_1PutProtocolsListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.PutProtocolsList", }; let body: any; @@ -468,7 +468,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.TagResource", }; let body: any; @@ -481,7 +481,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSFMS_20180101.UntagResource", }; let body: any; @@ -513,8 +513,7 @@ const deserializeAws_json1_1AssociateAdminAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -589,8 +588,7 @@ const deserializeAws_json1_1DeleteAppsListCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -657,8 +655,7 @@ const deserializeAws_json1_1DeleteNotificationChannelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -725,8 +722,7 @@ const deserializeAws_json1_1DeletePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -809,8 +805,7 @@ const deserializeAws_json1_1DeleteProtocolsListCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -877,8 +872,7 @@ const deserializeAws_json1_1DisassociateAdminAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -948,8 +942,7 @@ const deserializeAws_json1_1GetAdminAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1019,8 +1012,7 @@ const deserializeAws_json1_1GetAppsListCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1090,8 +1082,7 @@ const deserializeAws_json1_1GetComplianceDetailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1169,8 +1160,7 @@ const deserializeAws_json1_1GetNotificationChannelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1240,8 +1230,7 @@ const deserializeAws_json1_1GetPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1319,8 +1308,7 @@ const deserializeAws_json1_1GetProtectionStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1390,8 +1378,7 @@ const deserializeAws_json1_1GetProtocolsListCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1461,8 +1448,7 @@ const deserializeAws_json1_1GetViolationDetailsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1532,8 +1518,7 @@ const deserializeAws_json1_1ListAppsListsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1611,8 +1596,7 @@ const deserializeAws_json1_1ListComplianceStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1674,8 +1658,7 @@ const deserializeAws_json1_1ListMemberAccountsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1737,8 +1720,7 @@ const deserializeAws_json1_1ListPoliciesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1816,8 +1798,7 @@ const deserializeAws_json1_1ListProtocolsListsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1887,8 +1868,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -1966,8 +1946,7 @@ const deserializeAws_json1_1PutAppsListCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -2050,8 +2029,7 @@ const deserializeAws_json1_1PutNotificationChannelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -2121,8 +2099,7 @@ const deserializeAws_json1_1PutPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -2216,8 +2193,7 @@ const deserializeAws_json1_1PutProtocolsListCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -2303,8 +2279,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -2390,8 +2365,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.fms#InternalErrorException": @@ -2534,27 +2508,39 @@ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( const serializeAws_json1_1App = (input: App, context: __SerdeContext): any => { return { - ...(input.AppName !== undefined && { AppName: input.AppName }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), + ...(input.AppName !== undefined && input.AppName !== null && { AppName: input.AppName }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), }; }; const serializeAws_json1_1AppsList = (input: App[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1App(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1App(entry, context); + }); }; const serializeAws_json1_1AppsListData = (input: AppsListData, context: __SerdeContext): any => { return { - ...(input.AppsList !== undefined && { AppsList: serializeAws_json1_1AppsList(input.AppsList, context) }), - ...(input.CreateTime !== undefined && { CreateTime: Math.round(input.CreateTime.getTime() / 1000) }), - ...(input.LastUpdateTime !== undefined && { LastUpdateTime: Math.round(input.LastUpdateTime.getTime() / 1000) }), - ...(input.ListId !== undefined && { ListId: input.ListId }), - ...(input.ListName !== undefined && { ListName: input.ListName }), - ...(input.ListUpdateToken !== undefined && { ListUpdateToken: input.ListUpdateToken }), - ...(input.PreviousAppsList !== undefined && { - PreviousAppsList: serializeAws_json1_1PreviousAppsList(input.PreviousAppsList, context), - }), + ...(input.AppsList !== undefined && + input.AppsList !== null && { AppsList: serializeAws_json1_1AppsList(input.AppsList, context) }), + ...(input.CreateTime !== undefined && + input.CreateTime !== null && { CreateTime: Math.round(input.CreateTime.getTime() / 1000) }), + ...(input.LastUpdateTime !== undefined && + input.LastUpdateTime !== null && { LastUpdateTime: Math.round(input.LastUpdateTime.getTime() / 1000) }), + ...(input.ListId !== undefined && input.ListId !== null && { ListId: input.ListId }), + ...(input.ListName !== undefined && input.ListName !== null && { ListName: input.ListName }), + ...(input.ListUpdateToken !== undefined && + input.ListUpdateToken !== null && { ListUpdateToken: input.ListUpdateToken }), + ...(input.PreviousAppsList !== undefined && + input.PreviousAppsList !== null && { + PreviousAppsList: serializeAws_json1_1PreviousAppsList(input.PreviousAppsList, context), + }), }; }; @@ -2563,12 +2549,19 @@ const serializeAws_json1_1AssociateAdminAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.AdminAccount !== undefined && { AdminAccount: input.AdminAccount }), + ...(input.AdminAccount !== undefined && input.AdminAccount !== null && { AdminAccount: input.AdminAccount }), }; }; const serializeAws_json1_1CustomerPolicyScopeIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CustomerPolicyScopeMap = ( @@ -2576,17 +2569,22 @@ const serializeAws_json1_1CustomerPolicyScopeMap = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [CustomerPolicyScopeIdType | string, any]) => ({ - ...acc, - [key]: serializeAws_json1_1CustomerPolicyScopeIdList(value, context), - }), + (acc: { [key: string]: string[] }, [key, value]: [CustomerPolicyScopeIdType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_json1_1CustomerPolicyScopeIdList(value, context), + }; + }, {} ); }; const serializeAws_json1_1DeleteAppsListRequest = (input: DeleteAppsListRequest, context: __SerdeContext): any => { return { - ...(input.ListId !== undefined && { ListId: input.ListId }), + ...(input.ListId !== undefined && input.ListId !== null && { ListId: input.ListId }), }; }; @@ -2599,8 +2597,9 @@ const serializeAws_json1_1DeleteNotificationChannelRequest = ( const serializeAws_json1_1DeletePolicyRequest = (input: DeletePolicyRequest, context: __SerdeContext): any => { return { - ...(input.DeleteAllPolicyResources !== undefined && { DeleteAllPolicyResources: input.DeleteAllPolicyResources }), - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.DeleteAllPolicyResources !== undefined && + input.DeleteAllPolicyResources !== null && { DeleteAllPolicyResources: input.DeleteAllPolicyResources }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), }; }; @@ -2609,7 +2608,7 @@ const serializeAws_json1_1DeleteProtocolsListRequest = ( context: __SerdeContext ): any => { return { - ...(input.ListId !== undefined && { ListId: input.ListId }), + ...(input.ListId !== undefined && input.ListId !== null && { ListId: input.ListId }), }; }; @@ -2626,8 +2625,8 @@ const serializeAws_json1_1GetAdminAccountRequest = (input: GetAdminAccountReques const serializeAws_json1_1GetAppsListRequest = (input: GetAppsListRequest, context: __SerdeContext): any => { return { - ...(input.DefaultList !== undefined && { DefaultList: input.DefaultList }), - ...(input.ListId !== undefined && { ListId: input.ListId }), + ...(input.DefaultList !== undefined && input.DefaultList !== null && { DefaultList: input.DefaultList }), + ...(input.ListId !== undefined && input.ListId !== null && { ListId: input.ListId }), }; }; @@ -2636,8 +2635,8 @@ const serializeAws_json1_1GetComplianceDetailRequest = ( context: __SerdeContext ): any => { return { - ...(input.MemberAccount !== undefined && { MemberAccount: input.MemberAccount }), - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.MemberAccount !== undefined && input.MemberAccount !== null && { MemberAccount: input.MemberAccount }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), }; }; @@ -2650,7 +2649,7 @@ const serializeAws_json1_1GetNotificationChannelRequest = ( const serializeAws_json1_1GetPolicyRequest = (input: GetPolicyRequest, context: __SerdeContext): any => { return { - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), }; }; @@ -2659,19 +2658,22 @@ const serializeAws_json1_1GetProtectionStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MemberAccountId !== undefined && { MemberAccountId: input.MemberAccountId }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MemberAccountId !== undefined && + input.MemberAccountId !== null && { MemberAccountId: input.MemberAccountId }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1GetProtocolsListRequest = (input: GetProtocolsListRequest, context: __SerdeContext): any => { return { - ...(input.DefaultList !== undefined && { DefaultList: input.DefaultList }), - ...(input.ListId !== undefined && { ListId: input.ListId }), + ...(input.DefaultList !== undefined && input.DefaultList !== null && { DefaultList: input.DefaultList }), + ...(input.ListId !== undefined && input.ListId !== null && { ListId: input.ListId }), }; }; @@ -2680,18 +2682,18 @@ const serializeAws_json1_1GetViolationDetailsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MemberAccount !== undefined && { MemberAccount: input.MemberAccount }), - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.MemberAccount !== undefined && input.MemberAccount !== null && { MemberAccount: input.MemberAccount }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; const serializeAws_json1_1ListAppsListsRequest = (input: ListAppsListsRequest, context: __SerdeContext): any => { return { - ...(input.DefaultLists !== undefined && { DefaultLists: input.DefaultLists }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DefaultLists !== undefined && input.DefaultLists !== null && { DefaultLists: input.DefaultLists }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2700,9 +2702,9 @@ const serializeAws_json1_1ListComplianceStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), }; }; @@ -2711,15 +2713,15 @@ const serializeAws_json1_1ListMemberAccountsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListPoliciesRequest = (input: ListPoliciesRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2728,9 +2730,9 @@ const serializeAws_json1_1ListProtocolsListsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DefaultLists !== undefined && { DefaultLists: input.DefaultLists }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DefaultLists !== undefined && input.DefaultLists !== null && { DefaultLists: input.DefaultLists }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2739,86 +2741,110 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1Policy = (input: Policy, context: __SerdeContext): any => { return { - ...(input.ExcludeMap !== undefined && { - ExcludeMap: serializeAws_json1_1CustomerPolicyScopeMap(input.ExcludeMap, context), - }), - ...(input.ExcludeResourceTags !== undefined && { ExcludeResourceTags: input.ExcludeResourceTags }), - ...(input.IncludeMap !== undefined && { - IncludeMap: serializeAws_json1_1CustomerPolicyScopeMap(input.IncludeMap, context), - }), - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), - ...(input.PolicyUpdateToken !== undefined && { PolicyUpdateToken: input.PolicyUpdateToken }), - ...(input.RemediationEnabled !== undefined && { RemediationEnabled: input.RemediationEnabled }), - ...(input.ResourceTags !== undefined && { - ResourceTags: serializeAws_json1_1ResourceTags(input.ResourceTags, context), - }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.ResourceTypeList !== undefined && { - ResourceTypeList: serializeAws_json1_1ResourceTypeList(input.ResourceTypeList, context), - }), - ...(input.SecurityServicePolicyData !== undefined && { - SecurityServicePolicyData: serializeAws_json1_1SecurityServicePolicyData( - input.SecurityServicePolicyData, - context - ), - }), + ...(input.ExcludeMap !== undefined && + input.ExcludeMap !== null && { + ExcludeMap: serializeAws_json1_1CustomerPolicyScopeMap(input.ExcludeMap, context), + }), + ...(input.ExcludeResourceTags !== undefined && + input.ExcludeResourceTags !== null && { ExcludeResourceTags: input.ExcludeResourceTags }), + ...(input.IncludeMap !== undefined && + input.IncludeMap !== null && { + IncludeMap: serializeAws_json1_1CustomerPolicyScopeMap(input.IncludeMap, context), + }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), + ...(input.PolicyUpdateToken !== undefined && + input.PolicyUpdateToken !== null && { PolicyUpdateToken: input.PolicyUpdateToken }), + ...(input.RemediationEnabled !== undefined && + input.RemediationEnabled !== null && { RemediationEnabled: input.RemediationEnabled }), + ...(input.ResourceTags !== undefined && + input.ResourceTags !== null && { ResourceTags: serializeAws_json1_1ResourceTags(input.ResourceTags, context) }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.ResourceTypeList !== undefined && + input.ResourceTypeList !== null && { + ResourceTypeList: serializeAws_json1_1ResourceTypeList(input.ResourceTypeList, context), + }), + ...(input.SecurityServicePolicyData !== undefined && + input.SecurityServicePolicyData !== null && { + SecurityServicePolicyData: serializeAws_json1_1SecurityServicePolicyData( + input.SecurityServicePolicyData, + context + ), + }), }; }; const serializeAws_json1_1PreviousAppsList = (input: { [key: string]: App[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: App[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: App[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1AppsList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1PreviousProtocolsList = ( input: { [key: string]: string[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1ProtocolsList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ProtocolsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ProtocolsListData = (input: ProtocolsListData, context: __SerdeContext): any => { return { - ...(input.CreateTime !== undefined && { CreateTime: Math.round(input.CreateTime.getTime() / 1000) }), - ...(input.LastUpdateTime !== undefined && { LastUpdateTime: Math.round(input.LastUpdateTime.getTime() / 1000) }), - ...(input.ListId !== undefined && { ListId: input.ListId }), - ...(input.ListName !== undefined && { ListName: input.ListName }), - ...(input.ListUpdateToken !== undefined && { ListUpdateToken: input.ListUpdateToken }), - ...(input.PreviousProtocolsList !== undefined && { - PreviousProtocolsList: serializeAws_json1_1PreviousProtocolsList(input.PreviousProtocolsList, context), - }), - ...(input.ProtocolsList !== undefined && { - ProtocolsList: serializeAws_json1_1ProtocolsList(input.ProtocolsList, context), - }), + ...(input.CreateTime !== undefined && + input.CreateTime !== null && { CreateTime: Math.round(input.CreateTime.getTime() / 1000) }), + ...(input.LastUpdateTime !== undefined && + input.LastUpdateTime !== null && { LastUpdateTime: Math.round(input.LastUpdateTime.getTime() / 1000) }), + ...(input.ListId !== undefined && input.ListId !== null && { ListId: input.ListId }), + ...(input.ListName !== undefined && input.ListName !== null && { ListName: input.ListName }), + ...(input.ListUpdateToken !== undefined && + input.ListUpdateToken !== null && { ListUpdateToken: input.ListUpdateToken }), + ...(input.PreviousProtocolsList !== undefined && + input.PreviousProtocolsList !== null && { + PreviousProtocolsList: serializeAws_json1_1PreviousProtocolsList(input.PreviousProtocolsList, context), + }), + ...(input.ProtocolsList !== undefined && + input.ProtocolsList !== null && { + ProtocolsList: serializeAws_json1_1ProtocolsList(input.ProtocolsList, context), + }), }; }; const serializeAws_json1_1PutAppsListRequest = (input: PutAppsListRequest, context: __SerdeContext): any => { return { - ...(input.AppsList !== undefined && { AppsList: serializeAws_json1_1AppsListData(input.AppsList, context) }), - ...(input.TagList !== undefined && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), + ...(input.AppsList !== undefined && + input.AppsList !== null && { AppsList: serializeAws_json1_1AppsListData(input.AppsList, context) }), + ...(input.TagList !== undefined && + input.TagList !== null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), }; }; @@ -2827,40 +2853,58 @@ const serializeAws_json1_1PutNotificationChannelRequest = ( context: __SerdeContext ): any => { return { - ...(input.SnsRoleName !== undefined && { SnsRoleName: input.SnsRoleName }), - ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), + ...(input.SnsRoleName !== undefined && input.SnsRoleName !== null && { SnsRoleName: input.SnsRoleName }), + ...(input.SnsTopicArn !== undefined && input.SnsTopicArn !== null && { SnsTopicArn: input.SnsTopicArn }), }; }; const serializeAws_json1_1PutPolicyRequest = (input: PutPolicyRequest, context: __SerdeContext): any => { return { - ...(input.Policy !== undefined && { Policy: serializeAws_json1_1Policy(input.Policy, context) }), - ...(input.TagList !== undefined && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), + ...(input.Policy !== undefined && + input.Policy !== null && { Policy: serializeAws_json1_1Policy(input.Policy, context) }), + ...(input.TagList !== undefined && + input.TagList !== null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), }; }; const serializeAws_json1_1PutProtocolsListRequest = (input: PutProtocolsListRequest, context: __SerdeContext): any => { return { - ...(input.ProtocolsList !== undefined && { - ProtocolsList: serializeAws_json1_1ProtocolsListData(input.ProtocolsList, context), - }), - ...(input.TagList !== undefined && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), + ...(input.ProtocolsList !== undefined && + input.ProtocolsList !== null && { + ProtocolsList: serializeAws_json1_1ProtocolsListData(input.ProtocolsList, context), + }), + ...(input.TagList !== undefined && + input.TagList !== null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), }; }; const serializeAws_json1_1ResourceTag = (input: ResourceTag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1ResourceTags = (input: ResourceTag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ResourceTag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ResourceTag(entry, context); + }); }; const serializeAws_json1_1ResourceTypeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SecurityServicePolicyData = ( @@ -2868,37 +2912,54 @@ const serializeAws_json1_1SecurityServicePolicyData = ( context: __SerdeContext ): any => { return { - ...(input.ManagedServiceData !== undefined && { ManagedServiceData: input.ManagedServiceData }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.ManagedServiceData !== undefined && + input.ManagedServiceData !== null && { ManagedServiceData: input.ManagedServiceData }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagList !== undefined && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagList !== undefined && + input.TagList !== null && { TagList: serializeAws_json1_1TagList(input.TagList, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -2911,7 +2972,14 @@ const deserializeAws_json1_1App = (output: any, context: __SerdeContext): App => }; const deserializeAws_json1_1AppsList = (output: any, context: __SerdeContext): App[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1App(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1App(entry, context); + }); }; const deserializeAws_json1_1AppsListData = (output: any, context: __SerdeContext): AppsListData => { @@ -2952,7 +3020,14 @@ const deserializeAws_json1_1AppsListDataSummary = (output: any, context: __Serde }; const deserializeAws_json1_1AppsListsData = (output: any, context: __SerdeContext): AppsListDataSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AppsListDataSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AppsListDataSummary(entry, context); + }); }; const deserializeAws_json1_1AwsEc2InstanceViolation = ( @@ -2987,7 +3062,14 @@ const deserializeAws_json1_1AwsEc2NetworkInterfaceViolations = ( output: any, context: __SerdeContext ): AwsEc2NetworkInterfaceViolation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AwsEc2NetworkInterfaceViolation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AwsEc2NetworkInterfaceViolation(entry, context); + }); }; const deserializeAws_json1_1AwsVPCSecurityGroupViolation = ( @@ -3023,11 +3105,25 @@ const deserializeAws_json1_1ComplianceViolator = (output: any, context: __SerdeC }; const deserializeAws_json1_1ComplianceViolators = (output: any, context: __SerdeContext): ComplianceViolator[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ComplianceViolator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ComplianceViolator(entry, context); + }); }; const deserializeAws_json1_1CustomerPolicyScopeIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CustomerPolicyScopeMap = ( @@ -3035,10 +3131,15 @@ const deserializeAws_json1_1CustomerPolicyScopeMap = ( context: __SerdeContext ): { [key: string]: string[] } => { return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [CustomerPolicyScopeIdType | string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_1CustomerPolicyScopeIdList(value, context), - }), + (acc: { [key: string]: string[] }, [key, value]: [CustomerPolicyScopeIdType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_1CustomerPolicyScopeIdList(value, context), + }; + }, {} ); }; @@ -3057,7 +3158,14 @@ const deserializeAws_json1_1EvaluationResult = (output: any, context: __SerdeCon }; const deserializeAws_json1_1EvaluationResults = (output: any, context: __SerdeContext): EvaluationResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EvaluationResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EvaluationResult(entry, context); + }); }; const deserializeAws_json1_1GetAdminAccountResponse = ( @@ -3180,10 +3288,15 @@ const deserializeAws_json1_1InvalidTypeException = (output: any, context: __Serd const deserializeAws_json1_1IssueInfoMap = (output: any, context: __SerdeContext): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [DependentServiceName | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [DependentServiceName | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -3266,11 +3379,25 @@ const deserializeAws_json1_1ListTagsForResourceResponse = ( }; const deserializeAws_json1_1MemberAccounts = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NetworkFirewallActionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NetworkFirewallMissingExpectedRTViolation = ( @@ -3385,7 +3512,14 @@ const deserializeAws_json1_1PartialMatch = (output: any, context: __SerdeContext }; const deserializeAws_json1_1PartialMatches = (output: any, context: __SerdeContext): PartialMatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PartialMatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PartialMatch(entry, context); + }); }; const deserializeAws_json1_1Policy = (output: any, context: __SerdeContext): Policy => { @@ -3479,7 +3613,14 @@ const deserializeAws_json1_1PolicyComplianceStatusList = ( output: any, context: __SerdeContext ): PolicyComplianceStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PolicyComplianceStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PolicyComplianceStatus(entry, context); + }); }; const deserializeAws_json1_1PolicySummary = (output: any, context: __SerdeContext): PolicySummary => { @@ -3500,34 +3641,52 @@ const deserializeAws_json1_1PolicySummary = (output: any, context: __SerdeContex }; const deserializeAws_json1_1PolicySummaryList = (output: any, context: __SerdeContext): PolicySummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PolicySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PolicySummary(entry, context); + }); }; const deserializeAws_json1_1PreviousAppsList = (output: any, context: __SerdeContext): { [key: string]: App[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: App[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: App[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1AppsList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1PreviousProtocolsList = ( output: any, context: __SerdeContext ): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1ProtocolsList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ProtocolsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ProtocolsListData = (output: any, context: __SerdeContext): ProtocolsListData => { @@ -3571,7 +3730,14 @@ const deserializeAws_json1_1ProtocolsListDataSummary = ( }; const deserializeAws_json1_1ProtocolsListsData = (output: any, context: __SerdeContext): ProtocolsListDataSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProtocolsListDataSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProtocolsListDataSummary(entry, context); + }); }; const deserializeAws_json1_1PutAppsListResponse = (output: any, context: __SerdeContext): PutAppsListResponse => { @@ -3609,7 +3775,14 @@ const deserializeAws_json1_1PutProtocolsListResponse = ( }; const deserializeAws_json1_1ResourceIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceNotFoundException = ( @@ -3629,11 +3802,25 @@ const deserializeAws_json1_1ResourceTag = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ResourceTags = (output: any, context: __SerdeContext): ResourceTag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceTag(entry, context); + }); }; const deserializeAws_json1_1ResourceTypeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceViolation = (output: any, context: __SerdeContext): ResourceViolation => { @@ -3686,7 +3873,14 @@ const deserializeAws_json1_1ResourceViolation = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ResourceViolations = (output: any, context: __SerdeContext): ResourceViolation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceViolation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceViolation(entry, context); + }); }; const deserializeAws_json1_1SecurityGroupRemediationAction = ( @@ -3712,7 +3906,14 @@ const deserializeAws_json1_1SecurityGroupRemediationActions = ( output: any, context: __SerdeContext ): SecurityGroupRemediationAction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SecurityGroupRemediationAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SecurityGroupRemediationAction(entry, context); + }); }; const deserializeAws_json1_1SecurityGroupRuleDescription = ( @@ -3751,7 +3952,14 @@ const deserializeAws_json1_1StatefulRuleGroup = (output: any, context: __SerdeCo }; const deserializeAws_json1_1StatefulRuleGroupList = (output: any, context: __SerdeContext): StatefulRuleGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StatefulRuleGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StatefulRuleGroup(entry, context); + }); }; const deserializeAws_json1_1StatelessRuleGroup = (output: any, context: __SerdeContext): StatelessRuleGroup => { @@ -3764,7 +3972,14 @@ const deserializeAws_json1_1StatelessRuleGroup = (output: any, context: __SerdeC }; const deserializeAws_json1_1StatelessRuleGroupList = (output: any, context: __SerdeContext): StatelessRuleGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StatelessRuleGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StatelessRuleGroup(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -3775,7 +3990,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -3783,7 +4005,14 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1TargetViolationReasons = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => { @@ -3862,3 +4091,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-forecast/protocols/Aws_json1_1.ts b/clients/client-forecast/protocols/Aws_json1_1.ts index 1fe9a53b5ddc..6c88adc539c7 100644 --- a/clients/client-forecast/protocols/Aws_json1_1.ts +++ b/clients/client-forecast/protocols/Aws_json1_1.ts @@ -190,7 +190,7 @@ export const serializeAws_json1_1CreateDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.CreateDataset", }; let body: any; @@ -203,7 +203,7 @@ export const serializeAws_json1_1CreateDatasetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.CreateDatasetGroup", }; let body: any; @@ -216,7 +216,7 @@ export const serializeAws_json1_1CreateDatasetImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.CreateDatasetImportJob", }; let body: any; @@ -229,7 +229,7 @@ export const serializeAws_json1_1CreateForecastCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.CreateForecast", }; let body: any; @@ -242,7 +242,7 @@ export const serializeAws_json1_1CreateForecastExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.CreateForecastExportJob", }; let body: any; @@ -255,7 +255,7 @@ export const serializeAws_json1_1CreatePredictorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.CreatePredictor", }; let body: any; @@ -268,7 +268,7 @@ export const serializeAws_json1_1CreatePredictorBacktestExportJobCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.CreatePredictorBacktestExportJob", }; let body: any; @@ -281,7 +281,7 @@ export const serializeAws_json1_1DeleteDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DeleteDataset", }; let body: any; @@ -294,7 +294,7 @@ export const serializeAws_json1_1DeleteDatasetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DeleteDatasetGroup", }; let body: any; @@ -307,7 +307,7 @@ export const serializeAws_json1_1DeleteDatasetImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DeleteDatasetImportJob", }; let body: any; @@ -320,7 +320,7 @@ export const serializeAws_json1_1DeleteForecastCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DeleteForecast", }; let body: any; @@ -333,7 +333,7 @@ export const serializeAws_json1_1DeleteForecastExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DeleteForecastExportJob", }; let body: any; @@ -346,7 +346,7 @@ export const serializeAws_json1_1DeletePredictorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DeletePredictor", }; let body: any; @@ -359,7 +359,7 @@ export const serializeAws_json1_1DeletePredictorBacktestExportJobCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DeletePredictorBacktestExportJob", }; let body: any; @@ -372,7 +372,7 @@ export const serializeAws_json1_1DescribeDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DescribeDataset", }; let body: any; @@ -385,7 +385,7 @@ export const serializeAws_json1_1DescribeDatasetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DescribeDatasetGroup", }; let body: any; @@ -398,7 +398,7 @@ export const serializeAws_json1_1DescribeDatasetImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DescribeDatasetImportJob", }; let body: any; @@ -411,7 +411,7 @@ export const serializeAws_json1_1DescribeForecastCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DescribeForecast", }; let body: any; @@ -424,7 +424,7 @@ export const serializeAws_json1_1DescribeForecastExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DescribeForecastExportJob", }; let body: any; @@ -437,7 +437,7 @@ export const serializeAws_json1_1DescribePredictorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DescribePredictor", }; let body: any; @@ -450,7 +450,7 @@ export const serializeAws_json1_1DescribePredictorBacktestExportJobCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.DescribePredictorBacktestExportJob", }; let body: any; @@ -463,7 +463,7 @@ export const serializeAws_json1_1GetAccuracyMetricsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.GetAccuracyMetrics", }; let body: any; @@ -476,7 +476,7 @@ export const serializeAws_json1_1ListDatasetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.ListDatasetGroups", }; let body: any; @@ -489,7 +489,7 @@ export const serializeAws_json1_1ListDatasetImportJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.ListDatasetImportJobs", }; let body: any; @@ -502,7 +502,7 @@ export const serializeAws_json1_1ListDatasetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.ListDatasets", }; let body: any; @@ -515,7 +515,7 @@ export const serializeAws_json1_1ListForecastExportJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.ListForecastExportJobs", }; let body: any; @@ -528,7 +528,7 @@ export const serializeAws_json1_1ListForecastsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.ListForecasts", }; let body: any; @@ -541,7 +541,7 @@ export const serializeAws_json1_1ListPredictorBacktestExportJobsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.ListPredictorBacktestExportJobs", }; let body: any; @@ -554,7 +554,7 @@ export const serializeAws_json1_1ListPredictorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.ListPredictors", }; let body: any; @@ -567,7 +567,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.ListTagsForResource", }; let body: any; @@ -580,7 +580,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.TagResource", }; let body: any; @@ -593,7 +593,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.UntagResource", }; let body: any; @@ -606,7 +606,7 @@ export const serializeAws_json1_1UpdateDatasetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecast.UpdateDatasetGroup", }; let body: any; @@ -641,8 +641,7 @@ const deserializeAws_json1_1CreateDatasetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -712,8 +711,7 @@ const deserializeAws_json1_1CreateDatasetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -799,8 +797,7 @@ const deserializeAws_json1_1CreateDatasetImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -886,8 +883,7 @@ const deserializeAws_json1_1CreateForecastCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -973,8 +969,7 @@ const deserializeAws_json1_1CreateForecastExportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1060,8 +1055,7 @@ const deserializeAws_json1_1CreatePredictorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1147,8 +1141,7 @@ const deserializeAws_json1_1CreatePredictorBacktestExportJobCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1231,8 +1224,7 @@ const deserializeAws_json1_1DeleteDatasetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1299,8 +1291,7 @@ const deserializeAws_json1_1DeleteDatasetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1367,8 +1358,7 @@ const deserializeAws_json1_1DeleteDatasetImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1435,8 +1425,7 @@ const deserializeAws_json1_1DeleteForecastCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1503,8 +1492,7 @@ const deserializeAws_json1_1DeleteForecastExportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1571,8 +1559,7 @@ const deserializeAws_json1_1DeletePredictorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1639,8 +1626,7 @@ const deserializeAws_json1_1DeletePredictorBacktestExportJobCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1710,8 +1696,7 @@ const deserializeAws_json1_1DescribeDatasetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1773,8 +1758,7 @@ const deserializeAws_json1_1DescribeDatasetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1836,8 +1820,7 @@ const deserializeAws_json1_1DescribeDatasetImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1899,8 +1882,7 @@ const deserializeAws_json1_1DescribeForecastCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -1962,8 +1944,7 @@ const deserializeAws_json1_1DescribeForecastExportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2025,8 +2006,7 @@ const deserializeAws_json1_1DescribePredictorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2088,8 +2068,7 @@ const deserializeAws_json1_1DescribePredictorBacktestExportJobCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2151,8 +2130,7 @@ const deserializeAws_json1_1GetAccuracyMetricsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2222,8 +2200,7 @@ const deserializeAws_json1_1ListDatasetGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.forecast#InvalidNextTokenException": @@ -2277,8 +2254,7 @@ const deserializeAws_json1_1ListDatasetImportJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2340,8 +2316,7 @@ const deserializeAws_json1_1ListDatasetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.forecast#InvalidNextTokenException": @@ -2395,8 +2370,7 @@ const deserializeAws_json1_1ListForecastExportJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2458,8 +2432,7 @@ const deserializeAws_json1_1ListForecastsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2521,8 +2494,7 @@ const deserializeAws_json1_1ListPredictorBacktestExportJobsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2584,8 +2556,7 @@ const deserializeAws_json1_1ListPredictorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2647,8 +2618,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2710,8 +2680,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2781,8 +2750,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2844,8 +2812,7 @@ const deserializeAws_json1_1UpdateDatasetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": @@ -2979,7 +2946,14 @@ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( }; const serializeAws_json1_1ArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CategoricalParameterRange = ( @@ -2987,8 +2961,9 @@ const serializeAws_json1_1CategoricalParameterRange = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1Values(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1Values(input.Values, context) }), }; }; @@ -2996,7 +2971,14 @@ const serializeAws_json1_1CategoricalParameterRanges = ( input: CategoricalParameterRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CategoricalParameterRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CategoricalParameterRange(entry, context); + }); }; const serializeAws_json1_1ContinuousParameterRange = ( @@ -3004,10 +2986,10 @@ const serializeAws_json1_1ContinuousParameterRange = ( context: __SerdeContext ): any => { return { - ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), - ...(input.MinValue !== undefined && { MinValue: input.MinValue }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ScalingType !== undefined && { ScalingType: input.ScalingType }), + ...(input.MaxValue !== undefined && input.MaxValue !== null && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && input.MinValue !== null && { MinValue: input.MinValue }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ScalingType !== undefined && input.ScalingType !== null && { ScalingType: input.ScalingType }), }; }; @@ -3015,7 +2997,14 @@ const serializeAws_json1_1ContinuousParameterRanges = ( input: ContinuousParameterRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ContinuousParameterRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ContinuousParameterRange(entry, context); + }); }; const serializeAws_json1_1CreateDatasetGroupRequest = ( @@ -3023,10 +3012,12 @@ const serializeAws_json1_1CreateDatasetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.DatasetArns !== undefined && { DatasetArns: serializeAws_json1_1ArnList(input.DatasetArns, context) }), - ...(input.DatasetGroupName !== undefined && { DatasetGroupName: input.DatasetGroupName }), - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.DatasetArns !== undefined && + input.DatasetArns !== null && { DatasetArns: serializeAws_json1_1ArnList(input.DatasetArns, context) }), + ...(input.DatasetGroupName !== undefined && + input.DatasetGroupName !== null && { DatasetGroupName: input.DatasetGroupName }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -3035,30 +3026,35 @@ const serializeAws_json1_1CreateDatasetImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.DataSource !== undefined && { DataSource: serializeAws_json1_1DataSource(input.DataSource, context) }), - ...(input.DatasetArn !== undefined && { DatasetArn: input.DatasetArn }), - ...(input.DatasetImportJobName !== undefined && { DatasetImportJobName: input.DatasetImportJobName }), - ...(input.GeolocationFormat !== undefined && { GeolocationFormat: input.GeolocationFormat }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.TimeZone !== undefined && { TimeZone: input.TimeZone }), - ...(input.TimestampFormat !== undefined && { TimestampFormat: input.TimestampFormat }), - ...(input.UseGeolocationForTimeZone !== undefined && { - UseGeolocationForTimeZone: input.UseGeolocationForTimeZone, - }), + ...(input.DataSource !== undefined && + input.DataSource !== null && { DataSource: serializeAws_json1_1DataSource(input.DataSource, context) }), + ...(input.DatasetArn !== undefined && input.DatasetArn !== null && { DatasetArn: input.DatasetArn }), + ...(input.DatasetImportJobName !== undefined && + input.DatasetImportJobName !== null && { DatasetImportJobName: input.DatasetImportJobName }), + ...(input.GeolocationFormat !== undefined && + input.GeolocationFormat !== null && { GeolocationFormat: input.GeolocationFormat }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.TimeZone !== undefined && input.TimeZone !== null && { TimeZone: input.TimeZone }), + ...(input.TimestampFormat !== undefined && + input.TimestampFormat !== null && { TimestampFormat: input.TimestampFormat }), + ...(input.UseGeolocationForTimeZone !== undefined && + input.UseGeolocationForTimeZone !== null && { UseGeolocationForTimeZone: input.UseGeolocationForTimeZone }), }; }; const serializeAws_json1_1CreateDatasetRequest = (input: CreateDatasetRequest, context: __SerdeContext): any => { return { - ...(input.DataFrequency !== undefined && { DataFrequency: input.DataFrequency }), - ...(input.DatasetName !== undefined && { DatasetName: input.DatasetName }), - ...(input.DatasetType !== undefined && { DatasetType: input.DatasetType }), - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.EncryptionConfig !== undefined && { - EncryptionConfig: serializeAws_json1_1EncryptionConfig(input.EncryptionConfig, context), - }), - ...(input.Schema !== undefined && { Schema: serializeAws_json1_1Schema(input.Schema, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.DataFrequency !== undefined && input.DataFrequency !== null && { DataFrequency: input.DataFrequency }), + ...(input.DatasetName !== undefined && input.DatasetName !== null && { DatasetName: input.DatasetName }), + ...(input.DatasetType !== undefined && input.DatasetType !== null && { DatasetType: input.DatasetType }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.EncryptionConfig !== undefined && + input.EncryptionConfig !== null && { + EncryptionConfig: serializeAws_json1_1EncryptionConfig(input.EncryptionConfig, context), + }), + ...(input.Schema !== undefined && + input.Schema !== null && { Schema: serializeAws_json1_1Schema(input.Schema, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -3067,23 +3063,24 @@ const serializeAws_json1_1CreateForecastExportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.Destination !== undefined && { - Destination: serializeAws_json1_1DataDestination(input.Destination, context), - }), - ...(input.ForecastArn !== undefined && { ForecastArn: input.ForecastArn }), - ...(input.ForecastExportJobName !== undefined && { ForecastExportJobName: input.ForecastExportJobName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.Destination !== undefined && + input.Destination !== null && { Destination: serializeAws_json1_1DataDestination(input.Destination, context) }), + ...(input.ForecastArn !== undefined && input.ForecastArn !== null && { ForecastArn: input.ForecastArn }), + ...(input.ForecastExportJobName !== undefined && + input.ForecastExportJobName !== null && { ForecastExportJobName: input.ForecastExportJobName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1CreateForecastRequest = (input: CreateForecastRequest, context: __SerdeContext): any => { return { - ...(input.ForecastName !== undefined && { ForecastName: input.ForecastName }), - ...(input.ForecastTypes !== undefined && { - ForecastTypes: serializeAws_json1_1ForecastTypes(input.ForecastTypes, context), - }), - ...(input.PredictorArn !== undefined && { PredictorArn: input.PredictorArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ForecastName !== undefined && input.ForecastName !== null && { ForecastName: input.ForecastName }), + ...(input.ForecastTypes !== undefined && + input.ForecastTypes !== null && { + ForecastTypes: serializeAws_json1_1ForecastTypes(input.ForecastTypes, context), + }), + ...(input.PredictorArn !== undefined && input.PredictorArn !== null && { PredictorArn: input.PredictorArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -3092,58 +3089,68 @@ const serializeAws_json1_1CreatePredictorBacktestExportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.Destination !== undefined && { - Destination: serializeAws_json1_1DataDestination(input.Destination, context), - }), - ...(input.PredictorArn !== undefined && { PredictorArn: input.PredictorArn }), - ...(input.PredictorBacktestExportJobName !== undefined && { - PredictorBacktestExportJobName: input.PredictorBacktestExportJobName, - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.Destination !== undefined && + input.Destination !== null && { Destination: serializeAws_json1_1DataDestination(input.Destination, context) }), + ...(input.PredictorArn !== undefined && input.PredictorArn !== null && { PredictorArn: input.PredictorArn }), + ...(input.PredictorBacktestExportJobName !== undefined && + input.PredictorBacktestExportJobName !== null && { + PredictorBacktestExportJobName: input.PredictorBacktestExportJobName, + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1CreatePredictorRequest = (input: CreatePredictorRequest, context: __SerdeContext): any => { return { - ...(input.AlgorithmArn !== undefined && { AlgorithmArn: input.AlgorithmArn }), - ...(input.EncryptionConfig !== undefined && { - EncryptionConfig: serializeAws_json1_1EncryptionConfig(input.EncryptionConfig, context), - }), - ...(input.EvaluationParameters !== undefined && { - EvaluationParameters: serializeAws_json1_1EvaluationParameters(input.EvaluationParameters, context), - }), - ...(input.FeaturizationConfig !== undefined && { - FeaturizationConfig: serializeAws_json1_1FeaturizationConfig(input.FeaturizationConfig, context), - }), - ...(input.ForecastHorizon !== undefined && { ForecastHorizon: input.ForecastHorizon }), - ...(input.ForecastTypes !== undefined && { - ForecastTypes: serializeAws_json1_1ForecastTypes(input.ForecastTypes, context), - }), - ...(input.HPOConfig !== undefined && { - HPOConfig: serializeAws_json1_1HyperParameterTuningJobConfig(input.HPOConfig, context), - }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.PerformAutoML !== undefined && { PerformAutoML: input.PerformAutoML }), - ...(input.PerformHPO !== undefined && { PerformHPO: input.PerformHPO }), - ...(input.PredictorName !== undefined && { PredictorName: input.PredictorName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.TrainingParameters !== undefined && { - TrainingParameters: serializeAws_json1_1TrainingParameters(input.TrainingParameters, context), - }), + ...(input.AlgorithmArn !== undefined && input.AlgorithmArn !== null && { AlgorithmArn: input.AlgorithmArn }), + ...(input.EncryptionConfig !== undefined && + input.EncryptionConfig !== null && { + EncryptionConfig: serializeAws_json1_1EncryptionConfig(input.EncryptionConfig, context), + }), + ...(input.EvaluationParameters !== undefined && + input.EvaluationParameters !== null && { + EvaluationParameters: serializeAws_json1_1EvaluationParameters(input.EvaluationParameters, context), + }), + ...(input.FeaturizationConfig !== undefined && + input.FeaturizationConfig !== null && { + FeaturizationConfig: serializeAws_json1_1FeaturizationConfig(input.FeaturizationConfig, context), + }), + ...(input.ForecastHorizon !== undefined && + input.ForecastHorizon !== null && { ForecastHorizon: input.ForecastHorizon }), + ...(input.ForecastTypes !== undefined && + input.ForecastTypes !== null && { + ForecastTypes: serializeAws_json1_1ForecastTypes(input.ForecastTypes, context), + }), + ...(input.HPOConfig !== undefined && + input.HPOConfig !== null && { + HPOConfig: serializeAws_json1_1HyperParameterTuningJobConfig(input.HPOConfig, context), + }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.PerformAutoML !== undefined && input.PerformAutoML !== null && { PerformAutoML: input.PerformAutoML }), + ...(input.PerformHPO !== undefined && input.PerformHPO !== null && { PerformHPO: input.PerformHPO }), + ...(input.PredictorName !== undefined && input.PredictorName !== null && { PredictorName: input.PredictorName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.TrainingParameters !== undefined && + input.TrainingParameters !== null && { + TrainingParameters: serializeAws_json1_1TrainingParameters(input.TrainingParameters, context), + }), }; }; const serializeAws_json1_1DataDestination = (input: DataDestination, context: __SerdeContext): any => { return { - ...(input.S3Config !== undefined && { S3Config: serializeAws_json1_1S3Config(input.S3Config, context) }), + ...(input.S3Config !== undefined && + input.S3Config !== null && { S3Config: serializeAws_json1_1S3Config(input.S3Config, context) }), }; }; const serializeAws_json1_1DataSource = (input: DataSource, context: __SerdeContext): any => { return { - ...(input.S3Config !== undefined && { S3Config: serializeAws_json1_1S3Config(input.S3Config, context) }), + ...(input.S3Config !== undefined && + input.S3Config !== null && { S3Config: serializeAws_json1_1S3Config(input.S3Config, context) }), }; }; @@ -3152,7 +3159,8 @@ const serializeAws_json1_1DeleteDatasetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.DatasetGroupArn !== undefined && { DatasetGroupArn: input.DatasetGroupArn }), + ...(input.DatasetGroupArn !== undefined && + input.DatasetGroupArn !== null && { DatasetGroupArn: input.DatasetGroupArn }), }; }; @@ -3161,13 +3169,14 @@ const serializeAws_json1_1DeleteDatasetImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.DatasetImportJobArn !== undefined && { DatasetImportJobArn: input.DatasetImportJobArn }), + ...(input.DatasetImportJobArn !== undefined && + input.DatasetImportJobArn !== null && { DatasetImportJobArn: input.DatasetImportJobArn }), }; }; const serializeAws_json1_1DeleteDatasetRequest = (input: DeleteDatasetRequest, context: __SerdeContext): any => { return { - ...(input.DatasetArn !== undefined && { DatasetArn: input.DatasetArn }), + ...(input.DatasetArn !== undefined && input.DatasetArn !== null && { DatasetArn: input.DatasetArn }), }; }; @@ -3176,13 +3185,14 @@ const serializeAws_json1_1DeleteForecastExportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.ForecastExportJobArn !== undefined && { ForecastExportJobArn: input.ForecastExportJobArn }), + ...(input.ForecastExportJobArn !== undefined && + input.ForecastExportJobArn !== null && { ForecastExportJobArn: input.ForecastExportJobArn }), }; }; const serializeAws_json1_1DeleteForecastRequest = (input: DeleteForecastRequest, context: __SerdeContext): any => { return { - ...(input.ForecastArn !== undefined && { ForecastArn: input.ForecastArn }), + ...(input.ForecastArn !== undefined && input.ForecastArn !== null && { ForecastArn: input.ForecastArn }), }; }; @@ -3191,15 +3201,16 @@ const serializeAws_json1_1DeletePredictorBacktestExportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.PredictorBacktestExportJobArn !== undefined && { - PredictorBacktestExportJobArn: input.PredictorBacktestExportJobArn, - }), + ...(input.PredictorBacktestExportJobArn !== undefined && + input.PredictorBacktestExportJobArn !== null && { + PredictorBacktestExportJobArn: input.PredictorBacktestExportJobArn, + }), }; }; const serializeAws_json1_1DeletePredictorRequest = (input: DeletePredictorRequest, context: __SerdeContext): any => { return { - ...(input.PredictorArn !== undefined && { PredictorArn: input.PredictorArn }), + ...(input.PredictorArn !== undefined && input.PredictorArn !== null && { PredictorArn: input.PredictorArn }), }; }; @@ -3208,7 +3219,8 @@ const serializeAws_json1_1DescribeDatasetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.DatasetGroupArn !== undefined && { DatasetGroupArn: input.DatasetGroupArn }), + ...(input.DatasetGroupArn !== undefined && + input.DatasetGroupArn !== null && { DatasetGroupArn: input.DatasetGroupArn }), }; }; @@ -3217,13 +3229,14 @@ const serializeAws_json1_1DescribeDatasetImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.DatasetImportJobArn !== undefined && { DatasetImportJobArn: input.DatasetImportJobArn }), + ...(input.DatasetImportJobArn !== undefined && + input.DatasetImportJobArn !== null && { DatasetImportJobArn: input.DatasetImportJobArn }), }; }; const serializeAws_json1_1DescribeDatasetRequest = (input: DescribeDatasetRequest, context: __SerdeContext): any => { return { - ...(input.DatasetArn !== undefined && { DatasetArn: input.DatasetArn }), + ...(input.DatasetArn !== undefined && input.DatasetArn !== null && { DatasetArn: input.DatasetArn }), }; }; @@ -3232,13 +3245,14 @@ const serializeAws_json1_1DescribeForecastExportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.ForecastExportJobArn !== undefined && { ForecastExportJobArn: input.ForecastExportJobArn }), + ...(input.ForecastExportJobArn !== undefined && + input.ForecastExportJobArn !== null && { ForecastExportJobArn: input.ForecastExportJobArn }), }; }; const serializeAws_json1_1DescribeForecastRequest = (input: DescribeForecastRequest, context: __SerdeContext): any => { return { - ...(input.ForecastArn !== undefined && { ForecastArn: input.ForecastArn }), + ...(input.ForecastArn !== undefined && input.ForecastArn !== null && { ForecastArn: input.ForecastArn }), }; }; @@ -3247,9 +3261,10 @@ const serializeAws_json1_1DescribePredictorBacktestExportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.PredictorBacktestExportJobArn !== undefined && { - PredictorBacktestExportJobArn: input.PredictorBacktestExportJobArn, - }), + ...(input.PredictorBacktestExportJobArn !== undefined && + input.PredictorBacktestExportJobArn !== null && { + PredictorBacktestExportJobArn: input.PredictorBacktestExportJobArn, + }), }; }; @@ -3258,54 +3273,62 @@ const serializeAws_json1_1DescribePredictorRequest = ( context: __SerdeContext ): any => { return { - ...(input.PredictorArn !== undefined && { PredictorArn: input.PredictorArn }), + ...(input.PredictorArn !== undefined && input.PredictorArn !== null && { PredictorArn: input.PredictorArn }), }; }; const serializeAws_json1_1EncryptionConfig = (input: EncryptionConfig, context: __SerdeContext): any => { return { - ...(input.KMSKeyArn !== undefined && { KMSKeyArn: input.KMSKeyArn }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.KMSKeyArn !== undefined && input.KMSKeyArn !== null && { KMSKeyArn: input.KMSKeyArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_json1_1EvaluationParameters = (input: EvaluationParameters, context: __SerdeContext): any => { return { - ...(input.BackTestWindowOffset !== undefined && { BackTestWindowOffset: input.BackTestWindowOffset }), - ...(input.NumberOfBacktestWindows !== undefined && { NumberOfBacktestWindows: input.NumberOfBacktestWindows }), + ...(input.BackTestWindowOffset !== undefined && + input.BackTestWindowOffset !== null && { BackTestWindowOffset: input.BackTestWindowOffset }), + ...(input.NumberOfBacktestWindows !== undefined && + input.NumberOfBacktestWindows !== null && { NumberOfBacktestWindows: input.NumberOfBacktestWindows }), }; }; const serializeAws_json1_1Featurization = (input: Featurization, context: __SerdeContext): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.FeaturizationPipeline !== undefined && { - FeaturizationPipeline: serializeAws_json1_1FeaturizationPipeline(input.FeaturizationPipeline, context), - }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.FeaturizationPipeline !== undefined && + input.FeaturizationPipeline !== null && { + FeaturizationPipeline: serializeAws_json1_1FeaturizationPipeline(input.FeaturizationPipeline, context), + }), }; }; const serializeAws_json1_1FeaturizationConfig = (input: FeaturizationConfig, context: __SerdeContext): any => { return { - ...(input.Featurizations !== undefined && { - Featurizations: serializeAws_json1_1Featurizations(input.Featurizations, context), - }), - ...(input.ForecastDimensions !== undefined && { - ForecastDimensions: serializeAws_json1_1ForecastDimensions(input.ForecastDimensions, context), - }), - ...(input.ForecastFrequency !== undefined && { ForecastFrequency: input.ForecastFrequency }), + ...(input.Featurizations !== undefined && + input.Featurizations !== null && { + Featurizations: serializeAws_json1_1Featurizations(input.Featurizations, context), + }), + ...(input.ForecastDimensions !== undefined && + input.ForecastDimensions !== null && { + ForecastDimensions: serializeAws_json1_1ForecastDimensions(input.ForecastDimensions, context), + }), + ...(input.ForecastFrequency !== undefined && + input.ForecastFrequency !== null && { ForecastFrequency: input.ForecastFrequency }), }; }; const serializeAws_json1_1FeaturizationMethod = (input: FeaturizationMethod, context: __SerdeContext): any => { return { - ...(input.FeaturizationMethodName !== undefined && { FeaturizationMethodName: input.FeaturizationMethodName }), - ...(input.FeaturizationMethodParameters !== undefined && { - FeaturizationMethodParameters: serializeAws_json1_1FeaturizationMethodParameters( - input.FeaturizationMethodParameters, - context - ), - }), + ...(input.FeaturizationMethodName !== undefined && + input.FeaturizationMethodName !== null && { FeaturizationMethodName: input.FeaturizationMethodName }), + ...(input.FeaturizationMethodParameters !== undefined && + input.FeaturizationMethodParameters !== null && { + FeaturizationMethodParameters: serializeAws_json1_1FeaturizationMethodParameters( + input.FeaturizationMethodParameters, + context + ), + }), }; }; @@ -3313,41 +3336,78 @@ const serializeAws_json1_1FeaturizationMethodParameters = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1FeaturizationPipeline = (input: FeaturizationMethod[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FeaturizationMethod(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FeaturizationMethod(entry, context); + }); }; const serializeAws_json1_1Featurizations = (input: Featurization[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Featurization(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Featurization(entry, context); + }); }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Condition !== undefined && { Condition: input.Condition }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Condition !== undefined && input.Condition !== null && { Condition: input.Condition }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1Filters = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1ForecastDimensions = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ForecastTypes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetAccuracyMetricsRequest = ( @@ -3355,7 +3415,7 @@ const serializeAws_json1_1GetAccuracyMetricsRequest = ( context: __SerdeContext ): any => { return { - ...(input.PredictorArn !== undefined && { PredictorArn: input.PredictorArn }), + ...(input.PredictorArn !== undefined && input.PredictorArn !== null && { PredictorArn: input.PredictorArn }), }; }; @@ -3364,32 +3424,42 @@ const serializeAws_json1_1HyperParameterTuningJobConfig = ( context: __SerdeContext ): any => { return { - ...(input.ParameterRanges !== undefined && { - ParameterRanges: serializeAws_json1_1ParameterRanges(input.ParameterRanges, context), - }), + ...(input.ParameterRanges !== undefined && + input.ParameterRanges !== null && { + ParameterRanges: serializeAws_json1_1ParameterRanges(input.ParameterRanges, context), + }), }; }; const serializeAws_json1_1InputDataConfig = (input: InputDataConfig, context: __SerdeContext): any => { return { - ...(input.DatasetGroupArn !== undefined && { DatasetGroupArn: input.DatasetGroupArn }), - ...(input.SupplementaryFeatures !== undefined && { - SupplementaryFeatures: serializeAws_json1_1SupplementaryFeatures(input.SupplementaryFeatures, context), - }), + ...(input.DatasetGroupArn !== undefined && + input.DatasetGroupArn !== null && { DatasetGroupArn: input.DatasetGroupArn }), + ...(input.SupplementaryFeatures !== undefined && + input.SupplementaryFeatures !== null && { + SupplementaryFeatures: serializeAws_json1_1SupplementaryFeatures(input.SupplementaryFeatures, context), + }), }; }; const serializeAws_json1_1IntegerParameterRange = (input: IntegerParameterRange, context: __SerdeContext): any => { return { - ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), - ...(input.MinValue !== undefined && { MinValue: input.MinValue }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ScalingType !== undefined && { ScalingType: input.ScalingType }), + ...(input.MaxValue !== undefined && input.MaxValue !== null && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && input.MinValue !== null && { MinValue: input.MinValue }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ScalingType !== undefined && input.ScalingType !== null && { ScalingType: input.ScalingType }), }; }; const serializeAws_json1_1IntegerParameterRanges = (input: IntegerParameterRange[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1IntegerParameterRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1IntegerParameterRange(entry, context); + }); }; const serializeAws_json1_1ListDatasetGroupsRequest = ( @@ -3397,8 +3467,8 @@ const serializeAws_json1_1ListDatasetGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3407,16 +3477,17 @@ const serializeAws_json1_1ListDatasetImportJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListDatasetsRequest = (input: ListDatasetsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3425,17 +3496,19 @@ const serializeAws_json1_1ListForecastExportJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListForecastsRequest = (input: ListForecastsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3444,17 +3517,19 @@ const serializeAws_json1_1ListPredictorBacktestExportJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListPredictorsRequest = (input: ListPredictorsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3463,104 +3538,137 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1ParameterRanges = (input: ParameterRanges, context: __SerdeContext): any => { return { - ...(input.CategoricalParameterRanges !== undefined && { - CategoricalParameterRanges: serializeAws_json1_1CategoricalParameterRanges( - input.CategoricalParameterRanges, - context - ), - }), - ...(input.ContinuousParameterRanges !== undefined && { - ContinuousParameterRanges: serializeAws_json1_1ContinuousParameterRanges( - input.ContinuousParameterRanges, - context - ), - }), - ...(input.IntegerParameterRanges !== undefined && { - IntegerParameterRanges: serializeAws_json1_1IntegerParameterRanges(input.IntegerParameterRanges, context), - }), + ...(input.CategoricalParameterRanges !== undefined && + input.CategoricalParameterRanges !== null && { + CategoricalParameterRanges: serializeAws_json1_1CategoricalParameterRanges( + input.CategoricalParameterRanges, + context + ), + }), + ...(input.ContinuousParameterRanges !== undefined && + input.ContinuousParameterRanges !== null && { + ContinuousParameterRanges: serializeAws_json1_1ContinuousParameterRanges( + input.ContinuousParameterRanges, + context + ), + }), + ...(input.IntegerParameterRanges !== undefined && + input.IntegerParameterRanges !== null && { + IntegerParameterRanges: serializeAws_json1_1IntegerParameterRanges(input.IntegerParameterRanges, context), + }), }; }; const serializeAws_json1_1S3Config = (input: S3Config, context: __SerdeContext): any => { return { - ...(input.KMSKeyArn !== undefined && { KMSKeyArn: input.KMSKeyArn }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.KMSKeyArn !== undefined && input.KMSKeyArn !== null && { KMSKeyArn: input.KMSKeyArn }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_json1_1Schema = (input: Schema, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_json1_1SchemaAttributes(input.Attributes, context), - }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1SchemaAttributes(input.Attributes, context) }), }; }; const serializeAws_json1_1SchemaAttribute = (input: SchemaAttribute, context: __SerdeContext): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.AttributeType !== undefined && { AttributeType: input.AttributeType }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.AttributeType !== undefined && input.AttributeType !== null && { AttributeType: input.AttributeType }), }; }; const serializeAws_json1_1SchemaAttributes = (input: SchemaAttribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SchemaAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SchemaAttribute(entry, context); + }); }; const serializeAws_json1_1SupplementaryFeature = (input: SupplementaryFeature, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1SupplementaryFeatures = (input: SupplementaryFeature[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SupplementaryFeature(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SupplementaryFeature(entry, context); + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TrainingParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; @@ -3569,17 +3677,33 @@ const serializeAws_json1_1UpdateDatasetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.DatasetArns !== undefined && { DatasetArns: serializeAws_json1_1ArnList(input.DatasetArns, context) }), - ...(input.DatasetGroupArn !== undefined && { DatasetGroupArn: input.DatasetGroupArn }), + ...(input.DatasetArns !== undefined && + input.DatasetArns !== null && { DatasetArns: serializeAws_json1_1ArnList(input.DatasetArns, context) }), + ...(input.DatasetGroupArn !== undefined && + input.DatasetGroupArn !== null && { DatasetGroupArn: input.DatasetGroupArn }), }; }; const serializeAws_json1_1Values = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CategoricalParameterRange = ( @@ -3599,7 +3723,14 @@ const deserializeAws_json1_1CategoricalParameterRanges = ( output: any, context: __SerdeContext ): CategoricalParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CategoricalParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CategoricalParameterRange(entry, context); + }); }; const deserializeAws_json1_1ContinuousParameterRange = ( @@ -3618,7 +3749,14 @@ const deserializeAws_json1_1ContinuousParameterRanges = ( output: any, context: __SerdeContext ): ContinuousParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContinuousParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContinuousParameterRange(entry, context); + }); }; const deserializeAws_json1_1CreateDatasetGroupResponse = ( @@ -3698,7 +3836,14 @@ const deserializeAws_json1_1DataDestination = (output: any, context: __SerdeCont }; const deserializeAws_json1_1DatasetGroups = (output: any, context: __SerdeContext): DatasetGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DatasetGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DatasetGroupSummary(entry, context); + }); }; const deserializeAws_json1_1DatasetGroupSummary = (output: any, context: __SerdeContext): DatasetGroupSummary => { @@ -3719,7 +3864,14 @@ const deserializeAws_json1_1DatasetGroupSummary = (output: any, context: __Serde }; const deserializeAws_json1_1DatasetImportJobs = (output: any, context: __SerdeContext): DatasetImportJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DatasetImportJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DatasetImportJobSummary(entry, context); + }); }; const deserializeAws_json1_1DatasetImportJobSummary = ( @@ -3753,7 +3905,14 @@ const deserializeAws_json1_1DatasetImportJobSummary = ( }; const deserializeAws_json1_1Datasets = (output: any, context: __SerdeContext): DatasetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DatasetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DatasetSummary(entry, context); + }); }; const deserializeAws_json1_1DatasetSummary = (output: any, context: __SerdeContext): DatasetSummary => { @@ -4058,7 +4217,14 @@ const deserializeAws_json1_1ErrorMetric = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ErrorMetrics = (output: any, context: __SerdeContext): ErrorMetric[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ErrorMetric(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ErrorMetric(entry, context); + }); }; const deserializeAws_json1_1EvaluationParameters = (output: any, context: __SerdeContext): EvaluationParameters => { @@ -4129,39 +4295,71 @@ const deserializeAws_json1_1FeaturizationMethodParameters = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1FeaturizationPipeline = (output: any, context: __SerdeContext): FeaturizationMethod[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FeaturizationMethod(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FeaturizationMethod(entry, context); + }); }; const deserializeAws_json1_1Featurizations = (output: any, context: __SerdeContext): Featurization[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Featurization(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Featurization(entry, context); + }); }; const deserializeAws_json1_1FieldStatistics = (output: any, context: __SerdeContext): { [key: string]: Statistics } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Statistics }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Statistics }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1Statistics(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ForecastDimensions = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ForecastExportJobs = (output: any, context: __SerdeContext): ForecastExportJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ForecastExportJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ForecastExportJobSummary(entry, context); + }); }; const deserializeAws_json1_1ForecastExportJobSummary = ( @@ -4195,7 +4393,14 @@ const deserializeAws_json1_1ForecastExportJobSummary = ( }; const deserializeAws_json1_1Forecasts = (output: any, context: __SerdeContext): ForecastSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ForecastSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ForecastSummary(entry, context); + }); }; const deserializeAws_json1_1ForecastSummary = (output: any, context: __SerdeContext): ForecastSummary => { @@ -4219,7 +4424,14 @@ const deserializeAws_json1_1ForecastSummary = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ForecastTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1GetAccuracyMetricsResponse = ( @@ -4270,7 +4482,14 @@ const deserializeAws_json1_1IntegerParameterRanges = ( output: any, context: __SerdeContext ): IntegerParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IntegerParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IntegerParameterRange(entry, context); + }); }; const deserializeAws_json1_1InvalidInputException = (output: any, context: __SerdeContext): InvalidInputException => { @@ -4421,7 +4640,14 @@ const deserializeAws_json1_1PredictorBacktestExportJobs = ( output: any, context: __SerdeContext ): PredictorBacktestExportJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PredictorBacktestExportJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PredictorBacktestExportJobSummary(entry, context); + }); }; const deserializeAws_json1_1PredictorBacktestExportJobSummary = ( @@ -4455,7 +4681,14 @@ const deserializeAws_json1_1PredictorBacktestExportJobSummary = ( }; const deserializeAws_json1_1PredictorEvaluationResults = (output: any, context: __SerdeContext): EvaluationResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EvaluationResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EvaluationResult(entry, context); + }); }; const deserializeAws_json1_1PredictorExecution = (output: any, context: __SerdeContext): PredictorExecution => { @@ -4481,11 +4714,25 @@ const deserializeAws_json1_1PredictorExecutionDetails = ( }; const deserializeAws_json1_1PredictorExecutions = (output: any, context: __SerdeContext): PredictorExecution[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PredictorExecution(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PredictorExecution(entry, context); + }); }; const deserializeAws_json1_1Predictors = (output: any, context: __SerdeContext): PredictorSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PredictorSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PredictorSummary(entry, context); + }); }; const deserializeAws_json1_1PredictorSummary = (output: any, context: __SerdeContext): PredictorSummary => { @@ -4559,7 +4806,14 @@ const deserializeAws_json1_1SchemaAttribute = (output: any, context: __SerdeCont }; const deserializeAws_json1_1SchemaAttributes = (output: any, context: __SerdeContext): SchemaAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SchemaAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SchemaAttribute(entry, context); + }); }; const deserializeAws_json1_1Statistics = (output: any, context: __SerdeContext): Statistics => { @@ -4584,7 +4838,14 @@ const deserializeAws_json1_1SupplementaryFeature = (output: any, context: __Serd }; const deserializeAws_json1_1SupplementaryFeatures = (output: any, context: __SerdeContext): SupplementaryFeature[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SupplementaryFeature(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SupplementaryFeature(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -4599,15 +4860,36 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TestWindowDetails = (output: any, context: __SerdeContext): TestWindowSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TestWindowSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TestWindowSummary(entry, context); + }); }; const deserializeAws_json1_1TestWindows = (output: any, context: __SerdeContext): WindowSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WindowSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WindowSummary(entry, context); + }); }; const deserializeAws_json1_1TestWindowSummary = (output: any, context: __SerdeContext): TestWindowSummary => { @@ -4626,13 +4908,15 @@ const deserializeAws_json1_1TestWindowSummary = (output: any, context: __SerdeCo }; const deserializeAws_json1_1TrainingParameters = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => { @@ -4647,7 +4931,14 @@ const deserializeAws_json1_1UpdateDatasetGroupResponse = ( }; const deserializeAws_json1_1Values = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1WeightedQuantileLoss = (output: any, context: __SerdeContext): WeightedQuantileLoss => { @@ -4658,7 +4949,14 @@ const deserializeAws_json1_1WeightedQuantileLoss = (output: any, context: __Serd }; const deserializeAws_json1_1WeightedQuantileLosses = (output: any, context: __SerdeContext): WeightedQuantileLoss[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WeightedQuantileLoss(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WeightedQuantileLoss(entry, context); + }); }; const deserializeAws_json1_1WindowSummary = (output: any, context: __SerdeContext): WindowSummary => { @@ -4731,3 +5029,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-forecastquery/protocols/Aws_json1_1.ts b/clients/client-forecastquery/protocols/Aws_json1_1.ts index d859c87cd9ef..a35023fd8d99 100644 --- a/clients/client-forecastquery/protocols/Aws_json1_1.ts +++ b/clients/client-forecastquery/protocols/Aws_json1_1.ts @@ -25,7 +25,7 @@ export const serializeAws_json1_1QueryForecastCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonForecastRuntime.QueryForecast", }; let body: any; @@ -60,8 +60,7 @@ const deserializeAws_json1_1QueryForecastCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.forecastquery#InvalidInputException": @@ -196,22 +195,25 @@ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( }; const serializeAws_json1_1Filters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1QueryForecastRequest = (input: QueryForecastRequest, context: __SerdeContext): any => { return { - ...(input.EndDate !== undefined && { EndDate: input.EndDate }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.ForecastArn !== undefined && { ForecastArn: input.ForecastArn }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartDate !== undefined && { StartDate: input.StartDate }), + ...(input.EndDate !== undefined && input.EndDate !== null && { EndDate: input.EndDate }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.ForecastArn !== undefined && input.ForecastArn !== null && { ForecastArn: input.ForecastArn }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartDate !== undefined && input.StartDate !== null && { StartDate: input.StartDate }), }; }; @@ -253,13 +255,15 @@ const deserializeAws_json1_1LimitExceededException = (output: any, context: __Se }; const deserializeAws_json1_1Predictions = (output: any, context: __SerdeContext): { [key: string]: DataPoint[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: DataPoint[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: DataPoint[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1TimeSeries(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1QueryForecastResponse = (output: any, context: __SerdeContext): QueryForecastResponse => { @@ -287,7 +291,14 @@ const deserializeAws_json1_1ResourceNotFoundException = ( }; const deserializeAws_json1_1TimeSeries = (output: any, context: __SerdeContext): DataPoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataPoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataPoint(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -340,3 +351,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-frauddetector/protocols/Aws_json1_1.ts b/clients/client-frauddetector/protocols/Aws_json1_1.ts index 5c35902908b3..8372cb319a8f 100644 --- a/clients/client-frauddetector/protocols/Aws_json1_1.ts +++ b/clients/client-frauddetector/protocols/Aws_json1_1.ts @@ -248,7 +248,7 @@ export const serializeAws_json1_1BatchCreateVariableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.BatchCreateVariable", }; let body: any; @@ -261,7 +261,7 @@ export const serializeAws_json1_1BatchGetVariableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.BatchGetVariable", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1CreateDetectorVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.CreateDetectorVersion", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1CreateModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.CreateModel", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1CreateModelVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.CreateModelVersion", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1CreateRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.CreateRule", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1CreateVariableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.CreateVariable", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1DeleteDetectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteDetector", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1DeleteDetectorVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteDetectorVersion", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1DeleteEntityTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteEntityType", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1DeleteEventCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteEvent", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1DeleteEventTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteEventType", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1DeleteExternalModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteExternalModel", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1DeleteLabelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteLabel", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1DeleteModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteModel", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1DeleteModelVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteModelVersion", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1DeleteOutcomeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteOutcome", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteRule", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1DeleteVariableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DeleteVariable", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1DescribeDetectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DescribeDetector", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1DescribeModelVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.DescribeModelVersions", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1GetDetectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetDetectors", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1GetDetectorVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetDetectorVersion", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1GetEntityTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetEntityTypes", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1GetEventPredictionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetEventPrediction", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1GetEventTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetEventTypes", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1GetExternalModelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetExternalModels", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1GetKMSEncryptionKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetKMSEncryptionKey", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -610,7 +610,7 @@ export const serializeAws_json1_1GetLabelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetLabels", }; let body: any; @@ -623,7 +623,7 @@ export const serializeAws_json1_1GetModelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetModels", }; let body: any; @@ -636,7 +636,7 @@ export const serializeAws_json1_1GetModelVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetModelVersion", }; let body: any; @@ -649,7 +649,7 @@ export const serializeAws_json1_1GetOutcomesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetOutcomes", }; let body: any; @@ -662,7 +662,7 @@ export const serializeAws_json1_1GetRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetRules", }; let body: any; @@ -675,7 +675,7 @@ export const serializeAws_json1_1GetVariablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.GetVariables", }; let body: any; @@ -688,7 +688,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.ListTagsForResource", }; let body: any; @@ -701,7 +701,7 @@ export const serializeAws_json1_1PutDetectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.PutDetector", }; let body: any; @@ -714,7 +714,7 @@ export const serializeAws_json1_1PutEntityTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.PutEntityType", }; let body: any; @@ -727,7 +727,7 @@ export const serializeAws_json1_1PutEventTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.PutEventType", }; let body: any; @@ -740,7 +740,7 @@ export const serializeAws_json1_1PutExternalModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.PutExternalModel", }; let body: any; @@ -753,7 +753,7 @@ export const serializeAws_json1_1PutKMSEncryptionKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.PutKMSEncryptionKey", }; let body: any; @@ -766,7 +766,7 @@ export const serializeAws_json1_1PutLabelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.PutLabel", }; let body: any; @@ -779,7 +779,7 @@ export const serializeAws_json1_1PutOutcomeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.PutOutcome", }; let body: any; @@ -792,7 +792,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.TagResource", }; let body: any; @@ -805,7 +805,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UntagResource", }; let body: any; @@ -818,7 +818,7 @@ export const serializeAws_json1_1UpdateDetectorVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UpdateDetectorVersion", }; let body: any; @@ -831,7 +831,7 @@ export const serializeAws_json1_1UpdateDetectorVersionMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UpdateDetectorVersionMetadata", }; let body: any; @@ -844,7 +844,7 @@ export const serializeAws_json1_1UpdateDetectorVersionStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UpdateDetectorVersionStatus", }; let body: any; @@ -857,7 +857,7 @@ export const serializeAws_json1_1UpdateModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UpdateModel", }; let body: any; @@ -870,7 +870,7 @@ export const serializeAws_json1_1UpdateModelVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UpdateModelVersion", }; let body: any; @@ -883,7 +883,7 @@ export const serializeAws_json1_1UpdateModelVersionStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UpdateModelVersionStatus", }; let body: any; @@ -896,7 +896,7 @@ export const serializeAws_json1_1UpdateRuleMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UpdateRuleMetadata", }; let body: any; @@ -909,7 +909,7 @@ export const serializeAws_json1_1UpdateRuleVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UpdateRuleVersion", }; let body: any; @@ -922,7 +922,7 @@ export const serializeAws_json1_1UpdateVariableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHawksNestServiceFacade.UpdateVariable", }; let body: any; @@ -957,8 +957,7 @@ const deserializeAws_json1_1BatchCreateVariableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1036,8 +1035,7 @@ const deserializeAws_json1_1BatchGetVariableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1115,8 +1113,7 @@ const deserializeAws_json1_1CreateDetectorVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1202,8 +1199,7 @@ const deserializeAws_json1_1CreateModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1273,8 +1269,7 @@ const deserializeAws_json1_1CreateModelVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1352,8 +1347,7 @@ const deserializeAws_json1_1CreateRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1431,8 +1425,7 @@ const deserializeAws_json1_1CreateVariableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1510,8 +1503,7 @@ const deserializeAws_json1_1DeleteDetectorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1597,8 +1589,7 @@ const deserializeAws_json1_1DeleteDetectorVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1692,8 +1683,7 @@ const deserializeAws_json1_1DeleteEntityTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1771,8 +1761,7 @@ const deserializeAws_json1_1DeleteEventCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1850,8 +1839,7 @@ const deserializeAws_json1_1DeleteEventTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -1929,8 +1917,7 @@ const deserializeAws_json1_1DeleteExternalModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2016,8 +2003,7 @@ const deserializeAws_json1_1DeleteLabelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.frauddetector#ConflictException": @@ -2087,8 +2073,7 @@ const deserializeAws_json1_1DeleteModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2166,8 +2151,7 @@ const deserializeAws_json1_1DeleteModelVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2245,8 +2229,7 @@ const deserializeAws_json1_1DeleteOutcomeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2332,8 +2315,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2419,8 +2401,7 @@ const deserializeAws_json1_1DeleteVariableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2506,8 +2487,7 @@ const deserializeAws_json1_1DescribeDetectorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2593,8 +2573,7 @@ const deserializeAws_json1_1DescribeModelVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2672,8 +2651,7 @@ const deserializeAws_json1_1GetDetectorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2759,8 +2737,7 @@ const deserializeAws_json1_1GetDetectorVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2846,8 +2823,7 @@ const deserializeAws_json1_1GetEntityTypesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -2925,8 +2901,7 @@ const deserializeAws_json1_1GetEventPredictionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3020,8 +2995,7 @@ const deserializeAws_json1_1GetEventTypesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3099,8 +3073,7 @@ const deserializeAws_json1_1GetExternalModelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3186,8 +3159,7 @@ const deserializeAws_json1_1GetKMSEncryptionKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3257,8 +3229,7 @@ const deserializeAws_json1_1GetLabelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3336,8 +3307,7 @@ const deserializeAws_json1_1GetModelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3415,8 +3385,7 @@ const deserializeAws_json1_1GetModelVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3494,8 +3463,7 @@ const deserializeAws_json1_1GetOutcomesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3581,8 +3549,7 @@ const deserializeAws_json1_1GetRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3668,8 +3635,7 @@ const deserializeAws_json1_1GetVariablesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3755,8 +3721,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3826,8 +3791,7 @@ const deserializeAws_json1_1PutDetectorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3905,8 +3869,7 @@ const deserializeAws_json1_1PutEntityTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -3976,8 +3939,7 @@ const deserializeAws_json1_1PutEventTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4047,8 +4009,7 @@ const deserializeAws_json1_1PutExternalModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4126,8 +4087,7 @@ const deserializeAws_json1_1PutKMSEncryptionKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4205,8 +4165,7 @@ const deserializeAws_json1_1PutLabelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4276,8 +4235,7 @@ const deserializeAws_json1_1PutOutcomeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4355,8 +4313,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4426,8 +4383,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4497,8 +4453,7 @@ const deserializeAws_json1_1UpdateDetectorVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4584,8 +4539,7 @@ const deserializeAws_json1_1UpdateDetectorVersionMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4663,8 +4617,7 @@ const deserializeAws_json1_1UpdateDetectorVersionStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4750,8 +4703,7 @@ const deserializeAws_json1_1UpdateModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4829,8 +4781,7 @@ const deserializeAws_json1_1UpdateModelVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4908,8 +4859,7 @@ const deserializeAws_json1_1UpdateModelVersionStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -4987,8 +4937,7 @@ const deserializeAws_json1_1UpdateRuleMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -5074,8 +5023,7 @@ const deserializeAws_json1_1UpdateRuleVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -5161,8 +5109,7 @@ const deserializeAws_json1_1UpdateVariableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": @@ -5316,16 +5263,18 @@ const serializeAws_json1_1BatchCreateVariableRequest = ( context: __SerdeContext ): any => { return { - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), - ...(input.variableEntries !== undefined && { - variableEntries: serializeAws_json1_1VariableEntryList(input.variableEntries, context), - }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.variableEntries !== undefined && + input.variableEntries !== null && { + variableEntries: serializeAws_json1_1VariableEntryList(input.variableEntries, context), + }), }; }; const serializeAws_json1_1BatchGetVariableRequest = (input: BatchGetVariableRequest, context: __SerdeContext): any => { return { - ...(input.names !== undefined && { names: serializeAws_json1_1NameList(input.names, context) }), + ...(input.names !== undefined && + input.names !== null && { names: serializeAws_json1_1NameList(input.names, context) }), }; }; @@ -5334,27 +5283,31 @@ const serializeAws_json1_1CreateDetectorVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.externalModelEndpoints !== undefined && { - externalModelEndpoints: serializeAws_json1_1ListOfStrings(input.externalModelEndpoints, context), - }), - ...(input.modelVersions !== undefined && { - modelVersions: serializeAws_json1_1ListOfModelVersions(input.modelVersions, context), - }), - ...(input.ruleExecutionMode !== undefined && { ruleExecutionMode: input.ruleExecutionMode }), - ...(input.rules !== undefined && { rules: serializeAws_json1_1RuleList(input.rules, context) }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.externalModelEndpoints !== undefined && + input.externalModelEndpoints !== null && { + externalModelEndpoints: serializeAws_json1_1ListOfStrings(input.externalModelEndpoints, context), + }), + ...(input.modelVersions !== undefined && + input.modelVersions !== null && { + modelVersions: serializeAws_json1_1ListOfModelVersions(input.modelVersions, context), + }), + ...(input.ruleExecutionMode !== undefined && + input.ruleExecutionMode !== null && { ruleExecutionMode: input.ruleExecutionMode }), + ...(input.rules !== undefined && + input.rules !== null && { rules: serializeAws_json1_1RuleList(input.rules, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1CreateModelRequest = (input: CreateModelRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.eventTypeName !== undefined && { eventTypeName: input.eventTypeName }), - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.eventTypeName !== undefined && input.eventTypeName !== null && { eventTypeName: input.eventTypeName }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; @@ -5363,58 +5316,62 @@ const serializeAws_json1_1CreateModelVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.externalEventsDetail !== undefined && { - externalEventsDetail: serializeAws_json1_1ExternalEventsDetail(input.externalEventsDetail, context), - }), - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), - ...(input.trainingDataSchema !== undefined && { - trainingDataSchema: serializeAws_json1_1TrainingDataSchema(input.trainingDataSchema, context), - }), - ...(input.trainingDataSource !== undefined && { trainingDataSource: input.trainingDataSource }), + ...(input.externalEventsDetail !== undefined && + input.externalEventsDetail !== null && { + externalEventsDetail: serializeAws_json1_1ExternalEventsDetail(input.externalEventsDetail, context), + }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.trainingDataSchema !== undefined && + input.trainingDataSchema !== null && { + trainingDataSchema: serializeAws_json1_1TrainingDataSchema(input.trainingDataSchema, context), + }), + ...(input.trainingDataSource !== undefined && + input.trainingDataSource !== null && { trainingDataSource: input.trainingDataSource }), }; }; const serializeAws_json1_1CreateRuleRequest = (input: CreateRuleRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.expression !== undefined && { expression: input.expression }), - ...(input.language !== undefined && { language: input.language }), - ...(input.outcomes !== undefined && { - outcomes: serializeAws_json1_1NonEmptyListOfStrings(input.outcomes, context), - }), - ...(input.ruleId !== undefined && { ruleId: input.ruleId }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.expression !== undefined && input.expression !== null && { expression: input.expression }), + ...(input.language !== undefined && input.language !== null && { language: input.language }), + ...(input.outcomes !== undefined && + input.outcomes !== null && { outcomes: serializeAws_json1_1NonEmptyListOfStrings(input.outcomes, context) }), + ...(input.ruleId !== undefined && input.ruleId !== null && { ruleId: input.ruleId }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1CreateVariableRequest = (input: CreateVariableRequest, context: __SerdeContext): any => { return { - ...(input.dataSource !== undefined && { dataSource: input.dataSource }), - ...(input.dataType !== undefined && { dataType: input.dataType }), - ...(input.defaultValue !== undefined && { defaultValue: input.defaultValue }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), - ...(input.variableType !== undefined && { variableType: input.variableType }), + ...(input.dataSource !== undefined && input.dataSource !== null && { dataSource: input.dataSource }), + ...(input.dataType !== undefined && input.dataType !== null && { dataType: input.dataType }), + ...(input.defaultValue !== undefined && input.defaultValue !== null && { defaultValue: input.defaultValue }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.variableType !== undefined && input.variableType !== null && { variableType: input.variableType }), }; }; const serializeAws_json1_1CsvIndexToVariableMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1DeleteDetectorRequest = (input: DeleteDetectorRequest, context: __SerdeContext): any => { return { - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), }; }; @@ -5423,27 +5380,28 @@ const serializeAws_json1_1DeleteDetectorVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.detectorVersionId !== undefined && { detectorVersionId: input.detectorVersionId }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && + input.detectorVersionId !== null && { detectorVersionId: input.detectorVersionId }), }; }; const serializeAws_json1_1DeleteEntityTypeRequest = (input: DeleteEntityTypeRequest, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1DeleteEventRequest = (input: DeleteEventRequest, context: __SerdeContext): any => { return { - ...(input.eventId !== undefined && { eventId: input.eventId }), - ...(input.eventTypeName !== undefined && { eventTypeName: input.eventTypeName }), + ...(input.eventId !== undefined && input.eventId !== null && { eventId: input.eventId }), + ...(input.eventTypeName !== undefined && input.eventTypeName !== null && { eventTypeName: input.eventTypeName }), }; }; const serializeAws_json1_1DeleteEventTypeRequest = (input: DeleteEventTypeRequest, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -5452,20 +5410,20 @@ const serializeAws_json1_1DeleteExternalModelRequest = ( context: __SerdeContext ): any => { return { - ...(input.modelEndpoint !== undefined && { modelEndpoint: input.modelEndpoint }), + ...(input.modelEndpoint !== undefined && input.modelEndpoint !== null && { modelEndpoint: input.modelEndpoint }), }; }; const serializeAws_json1_1DeleteLabelRequest = (input: DeleteLabelRequest, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1DeleteModelRequest = (input: DeleteModelRequest, context: __SerdeContext): any => { return { - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), }; }; @@ -5474,35 +5432,36 @@ const serializeAws_json1_1DeleteModelVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), - ...(input.modelVersionNumber !== undefined && { modelVersionNumber: input.modelVersionNumber }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), + ...(input.modelVersionNumber !== undefined && + input.modelVersionNumber !== null && { modelVersionNumber: input.modelVersionNumber }), }; }; const serializeAws_json1_1DeleteOutcomeRequest = (input: DeleteOutcomeRequest, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1DeleteRuleRequest = (input: DeleteRuleRequest, context: __SerdeContext): any => { return { - ...(input.rule !== undefined && { rule: serializeAws_json1_1Rule(input.rule, context) }), + ...(input.rule !== undefined && input.rule !== null && { rule: serializeAws_json1_1Rule(input.rule, context) }), }; }; const serializeAws_json1_1DeleteVariableRequest = (input: DeleteVariableRequest, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1DescribeDetectorRequest = (input: DescribeDetectorRequest, context: __SerdeContext): any => { return { - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -5511,35 +5470,39 @@ const serializeAws_json1_1DescribeModelVersionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), - ...(input.modelVersionNumber !== undefined && { modelVersionNumber: input.modelVersionNumber }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), + ...(input.modelVersionNumber !== undefined && + input.modelVersionNumber !== null && { modelVersionNumber: input.modelVersionNumber }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1Entity = (input: Entity, context: __SerdeContext): any => { return { - ...(input.entityId !== undefined && { entityId: input.entityId }), - ...(input.entityType !== undefined && { entityType: input.entityType }), + ...(input.entityId !== undefined && input.entityId !== null && { entityId: input.entityId }), + ...(input.entityType !== undefined && input.entityType !== null && { entityType: input.entityType }), }; }; const serializeAws_json1_1EventVariableMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ExternalEventsDetail = (input: ExternalEventsDetail, context: __SerdeContext): any => { return { - ...(input.dataAccessRoleArn !== undefined && { dataAccessRoleArn: input.dataAccessRoleArn }), - ...(input.dataLocation !== undefined && { dataLocation: input.dataLocation }), + ...(input.dataAccessRoleArn !== undefined && + input.dataAccessRoleArn !== null && { dataAccessRoleArn: input.dataAccessRoleArn }), + ...(input.dataLocation !== undefined && input.dataLocation !== null && { dataLocation: input.dataLocation }), }; }; @@ -5547,20 +5510,22 @@ const serializeAws_json1_1ExternalModelEndpointDataBlobMap = ( input: { [key: string]: ModelEndpointDataBlob }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: ModelEndpointDataBlob }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: ModelEndpointDataBlob }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1ModelEndpointDataBlob(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1GetDetectorsRequest = (input: GetDetectorsRequest, context: __SerdeContext): any => { return { - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -5569,16 +5534,17 @@ const serializeAws_json1_1GetDetectorVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.detectorVersionId !== undefined && { detectorVersionId: input.detectorVersionId }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && + input.detectorVersionId !== null && { detectorVersionId: input.detectorVersionId }), }; }; const serializeAws_json1_1GetEntityTypesRequest = (input: GetEntityTypesRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.name !== undefined && { name: input.name }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -5587,29 +5553,34 @@ const serializeAws_json1_1GetEventPredictionRequest = ( context: __SerdeContext ): any => { return { - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.detectorVersionId !== undefined && { detectorVersionId: input.detectorVersionId }), - ...(input.entities !== undefined && { entities: serializeAws_json1_1listOfEntities(input.entities, context) }), - ...(input.eventId !== undefined && { eventId: input.eventId }), - ...(input.eventTimestamp !== undefined && { eventTimestamp: input.eventTimestamp }), - ...(input.eventTypeName !== undefined && { eventTypeName: input.eventTypeName }), - ...(input.eventVariables !== undefined && { - eventVariables: serializeAws_json1_1EventVariableMap(input.eventVariables, context), - }), - ...(input.externalModelEndpointDataBlobs !== undefined && { - externalModelEndpointDataBlobs: serializeAws_json1_1ExternalModelEndpointDataBlobMap( - input.externalModelEndpointDataBlobs, - context - ), - }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && + input.detectorVersionId !== null && { detectorVersionId: input.detectorVersionId }), + ...(input.entities !== undefined && + input.entities !== null && { entities: serializeAws_json1_1listOfEntities(input.entities, context) }), + ...(input.eventId !== undefined && input.eventId !== null && { eventId: input.eventId }), + ...(input.eventTimestamp !== undefined && + input.eventTimestamp !== null && { eventTimestamp: input.eventTimestamp }), + ...(input.eventTypeName !== undefined && input.eventTypeName !== null && { eventTypeName: input.eventTypeName }), + ...(input.eventVariables !== undefined && + input.eventVariables !== null && { + eventVariables: serializeAws_json1_1EventVariableMap(input.eventVariables, context), + }), + ...(input.externalModelEndpointDataBlobs !== undefined && + input.externalModelEndpointDataBlobs !== null && { + externalModelEndpointDataBlobs: serializeAws_json1_1ExternalModelEndpointDataBlobMap( + input.externalModelEndpointDataBlobs, + context + ), + }), }; }; const serializeAws_json1_1GetEventTypesRequest = (input: GetEventTypesRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.name !== undefined && { name: input.name }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -5618,101 +5589,126 @@ const serializeAws_json1_1GetExternalModelsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.modelEndpoint !== undefined && { modelEndpoint: input.modelEndpoint }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.modelEndpoint !== undefined && input.modelEndpoint !== null && { modelEndpoint: input.modelEndpoint }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1GetLabelsRequest = (input: GetLabelsRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.name !== undefined && { name: input.name }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1GetModelsRequest = (input: GetModelsRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1GetModelVersionRequest = (input: GetModelVersionRequest, context: __SerdeContext): any => { return { - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), - ...(input.modelVersionNumber !== undefined && { modelVersionNumber: input.modelVersionNumber }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), + ...(input.modelVersionNumber !== undefined && + input.modelVersionNumber !== null && { modelVersionNumber: input.modelVersionNumber }), }; }; const serializeAws_json1_1GetOutcomesRequest = (input: GetOutcomesRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.name !== undefined && { name: input.name }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1GetRulesRequest = (input: GetRulesRequest, context: __SerdeContext): any => { return { - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.ruleId !== undefined && { ruleId: input.ruleId }), - ...(input.ruleVersion !== undefined && { ruleVersion: input.ruleVersion }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.ruleId !== undefined && input.ruleId !== null && { ruleId: input.ruleId }), + ...(input.ruleVersion !== undefined && input.ruleVersion !== null && { ruleVersion: input.ruleVersion }), }; }; const serializeAws_json1_1GetVariablesRequest = (input: GetVariablesRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.name !== undefined && { name: input.name }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1JsonKeyToVariableMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1labelMapper = (input: { [key: string]: string[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1ListOfStrings(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1LabelSchema = (input: LabelSchema, context: __SerdeContext): any => { return { - ...(input.labelMapper !== undefined && { - labelMapper: serializeAws_json1_1labelMapper(input.labelMapper, context), - }), + ...(input.labelMapper !== undefined && + input.labelMapper !== null && { labelMapper: serializeAws_json1_1labelMapper(input.labelMapper, context) }), }; }; const serializeAws_json1_1listOfEntities = (input: Entity[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Entity(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Entity(entry, context); + }); }; const serializeAws_json1_1ListOfModelVersions = (input: ModelVersion[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ModelVersion(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ModelVersion(entry, context); + }); }; const serializeAws_json1_1ListOfStrings = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListTagsForResourceRequest = ( @@ -5720,26 +5716,30 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceARN !== undefined && { resourceARN: input.resourceARN }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceARN !== undefined && input.resourceARN !== null && { resourceARN: input.resourceARN }), }; }; const serializeAws_json1_1ModelEndpointDataBlob = (input: ModelEndpointDataBlob, context: __SerdeContext): any => { return { - ...(input.byteBuffer !== undefined && { byteBuffer: context.base64Encoder(input.byteBuffer) }), - ...(input.contentType !== undefined && { contentType: input.contentType }), + ...(input.byteBuffer !== undefined && + input.byteBuffer !== null && { byteBuffer: context.base64Encoder(input.byteBuffer) }), + ...(input.contentType !== undefined && input.contentType !== null && { contentType: input.contentType }), }; }; const serializeAws_json1_1ModelInputConfiguration = (input: ModelInputConfiguration, context: __SerdeContext): any => { return { - ...(input.csvInputTemplate !== undefined && { csvInputTemplate: input.csvInputTemplate }), - ...(input.eventTypeName !== undefined && { eventTypeName: input.eventTypeName }), - ...(input.format !== undefined && { format: input.format }), - ...(input.jsonInputTemplate !== undefined && { jsonInputTemplate: input.jsonInputTemplate }), - ...(input.useEventVariables !== undefined && { useEventVariables: input.useEventVariables }), + ...(input.csvInputTemplate !== undefined && + input.csvInputTemplate !== null && { csvInputTemplate: input.csvInputTemplate }), + ...(input.eventTypeName !== undefined && input.eventTypeName !== null && { eventTypeName: input.eventTypeName }), + ...(input.format !== undefined && input.format !== null && { format: input.format }), + ...(input.jsonInputTemplate !== undefined && + input.jsonInputTemplate !== null && { jsonInputTemplate: input.jsonInputTemplate }), + ...(input.useEventVariables !== undefined && + input.useEventVariables !== null && { useEventVariables: input.useEventVariables }), }; }; @@ -5748,80 +5748,102 @@ const serializeAws_json1_1ModelOutputConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.csvIndexToVariableMap !== undefined && { - csvIndexToVariableMap: serializeAws_json1_1CsvIndexToVariableMap(input.csvIndexToVariableMap, context), - }), - ...(input.format !== undefined && { format: input.format }), - ...(input.jsonKeyToVariableMap !== undefined && { - jsonKeyToVariableMap: serializeAws_json1_1JsonKeyToVariableMap(input.jsonKeyToVariableMap, context), - }), + ...(input.csvIndexToVariableMap !== undefined && + input.csvIndexToVariableMap !== null && { + csvIndexToVariableMap: serializeAws_json1_1CsvIndexToVariableMap(input.csvIndexToVariableMap, context), + }), + ...(input.format !== undefined && input.format !== null && { format: input.format }), + ...(input.jsonKeyToVariableMap !== undefined && + input.jsonKeyToVariableMap !== null && { + jsonKeyToVariableMap: serializeAws_json1_1JsonKeyToVariableMap(input.jsonKeyToVariableMap, context), + }), }; }; const serializeAws_json1_1ModelVersion = (input: ModelVersion, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), - ...(input.modelVersionNumber !== undefined && { modelVersionNumber: input.modelVersionNumber }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), + ...(input.modelVersionNumber !== undefined && + input.modelVersionNumber !== null && { modelVersionNumber: input.modelVersionNumber }), }; }; const serializeAws_json1_1NameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1NonEmptyListOfStrings = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutDetectorRequest = (input: PutDetectorRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.eventTypeName !== undefined && { eventTypeName: input.eventTypeName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.eventTypeName !== undefined && input.eventTypeName !== null && { eventTypeName: input.eventTypeName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1PutEntityTypeRequest = (input: PutEntityTypeRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1PutEventTypeRequest = (input: PutEventTypeRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.entityTypes !== undefined && { - entityTypes: serializeAws_json1_1NonEmptyListOfStrings(input.entityTypes, context), - }), - ...(input.eventVariables !== undefined && { - eventVariables: serializeAws_json1_1NonEmptyListOfStrings(input.eventVariables, context), - }), - ...(input.labels !== undefined && { labels: serializeAws_json1_1ListOfStrings(input.labels, context) }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.entityTypes !== undefined && + input.entityTypes !== null && { + entityTypes: serializeAws_json1_1NonEmptyListOfStrings(input.entityTypes, context), + }), + ...(input.eventVariables !== undefined && + input.eventVariables !== null && { + eventVariables: serializeAws_json1_1NonEmptyListOfStrings(input.eventVariables, context), + }), + ...(input.labels !== undefined && + input.labels !== null && { labels: serializeAws_json1_1ListOfStrings(input.labels, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1PutExternalModelRequest = (input: PutExternalModelRequest, context: __SerdeContext): any => { return { - ...(input.inputConfiguration !== undefined && { - inputConfiguration: serializeAws_json1_1ModelInputConfiguration(input.inputConfiguration, context), - }), - ...(input.invokeModelEndpointRoleArn !== undefined && { - invokeModelEndpointRoleArn: input.invokeModelEndpointRoleArn, - }), - ...(input.modelEndpoint !== undefined && { modelEndpoint: input.modelEndpoint }), - ...(input.modelEndpointStatus !== undefined && { modelEndpointStatus: input.modelEndpointStatus }), - ...(input.modelSource !== undefined && { modelSource: input.modelSource }), - ...(input.outputConfiguration !== undefined && { - outputConfiguration: serializeAws_json1_1ModelOutputConfiguration(input.outputConfiguration, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.inputConfiguration !== undefined && + input.inputConfiguration !== null && { + inputConfiguration: serializeAws_json1_1ModelInputConfiguration(input.inputConfiguration, context), + }), + ...(input.invokeModelEndpointRoleArn !== undefined && + input.invokeModelEndpointRoleArn !== null && { invokeModelEndpointRoleArn: input.invokeModelEndpointRoleArn }), + ...(input.modelEndpoint !== undefined && input.modelEndpoint !== null && { modelEndpoint: input.modelEndpoint }), + ...(input.modelEndpointStatus !== undefined && + input.modelEndpointStatus !== null && { modelEndpointStatus: input.modelEndpointStatus }), + ...(input.modelSource !== undefined && input.modelSource !== null && { modelSource: input.modelSource }), + ...(input.outputConfiguration !== undefined && + input.outputConfiguration !== null && { + outputConfiguration: serializeAws_json1_1ModelOutputConfiguration(input.outputConfiguration, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; @@ -5830,75 +5852,98 @@ const serializeAws_json1_1PutKMSEncryptionKeyRequest = ( context: __SerdeContext ): any => { return { - ...(input.kmsEncryptionKeyArn !== undefined && { kmsEncryptionKeyArn: input.kmsEncryptionKeyArn }), + ...(input.kmsEncryptionKeyArn !== undefined && + input.kmsEncryptionKeyArn !== null && { kmsEncryptionKeyArn: input.kmsEncryptionKeyArn }), }; }; const serializeAws_json1_1PutLabelRequest = (input: PutLabelRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1PutOutcomeRequest = (input: PutOutcomeRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1Rule = (input: Rule, context: __SerdeContext): any => { return { - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.ruleId !== undefined && { ruleId: input.ruleId }), - ...(input.ruleVersion !== undefined && { ruleVersion: input.ruleVersion }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.ruleId !== undefined && input.ruleId !== null && { ruleId: input.ruleId }), + ...(input.ruleVersion !== undefined && input.ruleVersion !== null && { ruleVersion: input.ruleVersion }), }; }; const serializeAws_json1_1RuleList = (input: Rule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Rule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Rule(entry, context); + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1tagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1tagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceARN !== undefined && { resourceARN: input.resourceARN }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.resourceARN !== undefined && input.resourceARN !== null && { resourceARN: input.resourceARN }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1TrainingDataSchema = (input: TrainingDataSchema, context: __SerdeContext): any => { return { - ...(input.labelSchema !== undefined && { - labelSchema: serializeAws_json1_1LabelSchema(input.labelSchema, context), - }), - ...(input.modelVariables !== undefined && { - modelVariables: serializeAws_json1_1ListOfStrings(input.modelVariables, context), - }), + ...(input.labelSchema !== undefined && + input.labelSchema !== null && { labelSchema: serializeAws_json1_1LabelSchema(input.labelSchema, context) }), + ...(input.modelVariables !== undefined && + input.modelVariables !== null && { + modelVariables: serializeAws_json1_1ListOfStrings(input.modelVariables, context), + }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceARN !== undefined && { resourceARN: input.resourceARN }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1tagKeyList(input.tagKeys, context) }), + ...(input.resourceARN !== undefined && input.resourceARN !== null && { resourceARN: input.resourceARN }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1tagKeyList(input.tagKeys, context) }), }; }; @@ -5907,9 +5952,10 @@ const serializeAws_json1_1UpdateDetectorVersionMetadataRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.detectorVersionId !== undefined && { detectorVersionId: input.detectorVersionId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && + input.detectorVersionId !== null && { detectorVersionId: input.detectorVersionId }), }; }; @@ -5918,17 +5964,22 @@ const serializeAws_json1_1UpdateDetectorVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.detectorVersionId !== undefined && { detectorVersionId: input.detectorVersionId }), - ...(input.externalModelEndpoints !== undefined && { - externalModelEndpoints: serializeAws_json1_1ListOfStrings(input.externalModelEndpoints, context), - }), - ...(input.modelVersions !== undefined && { - modelVersions: serializeAws_json1_1ListOfModelVersions(input.modelVersions, context), - }), - ...(input.ruleExecutionMode !== undefined && { ruleExecutionMode: input.ruleExecutionMode }), - ...(input.rules !== undefined && { rules: serializeAws_json1_1RuleList(input.rules, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && + input.detectorVersionId !== null && { detectorVersionId: input.detectorVersionId }), + ...(input.externalModelEndpoints !== undefined && + input.externalModelEndpoints !== null && { + externalModelEndpoints: serializeAws_json1_1ListOfStrings(input.externalModelEndpoints, context), + }), + ...(input.modelVersions !== undefined && + input.modelVersions !== null && { + modelVersions: serializeAws_json1_1ListOfModelVersions(input.modelVersions, context), + }), + ...(input.ruleExecutionMode !== undefined && + input.ruleExecutionMode !== null && { ruleExecutionMode: input.ruleExecutionMode }), + ...(input.rules !== undefined && + input.rules !== null && { rules: serializeAws_json1_1RuleList(input.rules, context) }), }; }; @@ -5937,17 +5988,18 @@ const serializeAws_json1_1UpdateDetectorVersionStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.detectorId !== undefined && { detectorId: input.detectorId }), - ...(input.detectorVersionId !== undefined && { detectorVersionId: input.detectorVersionId }), - ...(input.status !== undefined && { status: input.status }), + ...(input.detectorId !== undefined && input.detectorId !== null && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && + input.detectorVersionId !== null && { detectorVersionId: input.detectorVersionId }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_json1_1UpdateModelRequest = (input: UpdateModelRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), }; }; @@ -5956,13 +6008,15 @@ const serializeAws_json1_1UpdateModelVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.externalEventsDetail !== undefined && { - externalEventsDetail: serializeAws_json1_1ExternalEventsDetail(input.externalEventsDetail, context), - }), - ...(input.majorVersionNumber !== undefined && { majorVersionNumber: input.majorVersionNumber }), - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.externalEventsDetail !== undefined && + input.externalEventsDetail !== null && { + externalEventsDetail: serializeAws_json1_1ExternalEventsDetail(input.externalEventsDetail, context), + }), + ...(input.majorVersionNumber !== undefined && + input.majorVersionNumber !== null && { majorVersionNumber: input.majorVersionNumber }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; @@ -5971,10 +6025,11 @@ const serializeAws_json1_1UpdateModelVersionStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.modelId !== undefined && { modelId: input.modelId }), - ...(input.modelType !== undefined && { modelType: input.modelType }), - ...(input.modelVersionNumber !== undefined && { modelVersionNumber: input.modelVersionNumber }), - ...(input.status !== undefined && { status: input.status }), + ...(input.modelId !== undefined && input.modelId !== null && { modelId: input.modelId }), + ...(input.modelType !== undefined && input.modelType !== null && { modelType: input.modelType }), + ...(input.modelVersionNumber !== undefined && + input.modelVersionNumber !== null && { modelVersionNumber: input.modelVersionNumber }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; @@ -5983,8 +6038,8 @@ const serializeAws_json1_1UpdateRuleMetadataRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.rule !== undefined && { rule: serializeAws_json1_1Rule(input.rule, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.rule !== undefined && input.rule !== null && { rule: serializeAws_json1_1Rule(input.rule, context) }), }; }; @@ -5993,39 +6048,45 @@ const serializeAws_json1_1UpdateRuleVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.expression !== undefined && { expression: input.expression }), - ...(input.language !== undefined && { language: input.language }), - ...(input.outcomes !== undefined && { - outcomes: serializeAws_json1_1NonEmptyListOfStrings(input.outcomes, context), - }), - ...(input.rule !== undefined && { rule: serializeAws_json1_1Rule(input.rule, context) }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.expression !== undefined && input.expression !== null && { expression: input.expression }), + ...(input.language !== undefined && input.language !== null && { language: input.language }), + ...(input.outcomes !== undefined && + input.outcomes !== null && { outcomes: serializeAws_json1_1NonEmptyListOfStrings(input.outcomes, context) }), + ...(input.rule !== undefined && input.rule !== null && { rule: serializeAws_json1_1Rule(input.rule, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1tagList(input.tags, context) }), }; }; const serializeAws_json1_1UpdateVariableRequest = (input: UpdateVariableRequest, context: __SerdeContext): any => { return { - ...(input.defaultValue !== undefined && { defaultValue: input.defaultValue }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.variableType !== undefined && { variableType: input.variableType }), + ...(input.defaultValue !== undefined && input.defaultValue !== null && { defaultValue: input.defaultValue }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.variableType !== undefined && input.variableType !== null && { variableType: input.variableType }), }; }; const serializeAws_json1_1VariableEntry = (input: VariableEntry, context: __SerdeContext): any => { return { - ...(input.dataSource !== undefined && { dataSource: input.dataSource }), - ...(input.dataType !== undefined && { dataType: input.dataType }), - ...(input.defaultValue !== undefined && { defaultValue: input.defaultValue }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.variableType !== undefined && { variableType: input.variableType }), + ...(input.dataSource !== undefined && input.dataSource !== null && { dataSource: input.dataSource }), + ...(input.dataType !== undefined && input.dataType !== null && { dataType: input.dataType }), + ...(input.defaultValue !== undefined && input.defaultValue !== null && { defaultValue: input.defaultValue }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.variableType !== undefined && input.variableType !== null && { variableType: input.variableType }), }; }; const serializeAws_json1_1VariableEntryList = (input: VariableEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1VariableEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1VariableEntry(entry, context); + }); }; const deserializeAws_json1_1AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => { @@ -6049,7 +6110,14 @@ const deserializeAws_json1_1BatchCreateVariableErrorList = ( output: any, context: __SerdeContext ): BatchCreateVariableError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchCreateVariableError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchCreateVariableError(entry, context); + }); }; const deserializeAws_json1_1BatchCreateVariableResult = ( @@ -6076,7 +6144,14 @@ const deserializeAws_json1_1BatchGetVariableErrorList = ( output: any, context: __SerdeContext ): BatchGetVariableError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchGetVariableError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchGetVariableError(entry, context); + }); }; const deserializeAws_json1_1BatchGetVariableResult = (output: any, context: __SerdeContext): BatchGetVariableResult => { @@ -6146,13 +6221,15 @@ const deserializeAws_json1_1CsvIndexToVariableMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1DataValidationMetrics = (output: any, context: __SerdeContext): DataValidationMetrics => { @@ -6264,7 +6341,14 @@ const deserializeAws_json1_1Detector = (output: any, context: __SerdeContext): D }; const deserializeAws_json1_1DetectorList = (output: any, context: __SerdeContext): Detector[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Detector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Detector(entry, context); + }); }; const deserializeAws_json1_1DetectorVersionSummary = (output: any, context: __SerdeContext): DetectorVersionSummary => { @@ -6284,7 +6368,14 @@ const deserializeAws_json1_1DetectorVersionSummaryList = ( output: any, context: __SerdeContext ): DetectorVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DetectorVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DetectorVersionSummary(entry, context); + }); }; const deserializeAws_json1_1EntityType = (output: any, context: __SerdeContext): EntityType => { @@ -6299,7 +6390,14 @@ const deserializeAws_json1_1EntityType = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1entityTypeList = (output: any, context: __SerdeContext): EntityType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EntityType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EntityType(entry, context); + }); }; const deserializeAws_json1_1EventType = (output: any, context: __SerdeContext): EventType => { @@ -6326,7 +6424,14 @@ const deserializeAws_json1_1EventType = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1eventTypeList = (output: any, context: __SerdeContext): EventType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventType(entry, context); + }); }; const deserializeAws_json1_1ExternalEventsDetail = (output: any, context: __SerdeContext): ExternalEventsDetail => { @@ -6368,7 +6473,14 @@ const deserializeAws_json1_1ExternalModel = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ExternalModelList = (output: any, context: __SerdeContext): ExternalModel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExternalModel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExternalModel(entry, context); + }); }; const deserializeAws_json1_1FieldValidationMessage = (output: any, context: __SerdeContext): FieldValidationMessage => { @@ -6385,7 +6497,14 @@ const deserializeAws_json1_1fieldValidationMessageList = ( output: any, context: __SerdeContext ): FieldValidationMessage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FieldValidationMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FieldValidationMessage(entry, context); + }); }; const deserializeAws_json1_1FileValidationMessage = (output: any, context: __SerdeContext): FileValidationMessage => { @@ -6400,7 +6519,14 @@ const deserializeAws_json1_1fileValidationMessageList = ( output: any, context: __SerdeContext ): FileValidationMessage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FileValidationMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FileValidationMessage(entry, context); + }); }; const deserializeAws_json1_1GetDetectorsResult = (output: any, context: __SerdeContext): GetDetectorsResult => { @@ -6597,13 +6723,15 @@ const deserializeAws_json1_1JsonKeyToVariableMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1KMSKey = (output: any, context: __SerdeContext): KMSKey => { @@ -6627,17 +6755,26 @@ const deserializeAws_json1_1Label = (output: any, context: __SerdeContext): Labe }; const deserializeAws_json1_1labelList = (output: any, context: __SerdeContext): Label[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Label(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Label(entry, context); + }); }; const deserializeAws_json1_1labelMapper = (output: any, context: __SerdeContext): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1ListOfStrings(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1LabelSchema = (output: any, context: __SerdeContext): LabelSchema => { @@ -6650,19 +6787,47 @@ const deserializeAws_json1_1LabelSchema = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ListOfModelScores = (output: any, context: __SerdeContext): ModelScores[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModelScores(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModelScores(entry, context); + }); }; const deserializeAws_json1_1ListOfModelVersions = (output: any, context: __SerdeContext): ModelVersion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModelVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModelVersion(entry, context); + }); }; const deserializeAws_json1_1ListOfRuleResults = (output: any, context: __SerdeContext): RuleResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RuleResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RuleResult(entry, context); + }); }; const deserializeAws_json1_1ListOfStrings = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ListTagsForResourceResult = ( @@ -6688,7 +6853,14 @@ const deserializeAws_json1_1MetricDataPoint = (output: any, context: __SerdeCont }; const deserializeAws_json1_1metricDataPointsList = (output: any, context: __SerdeContext): MetricDataPoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricDataPoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricDataPoint(entry, context); + }); }; const deserializeAws_json1_1Model = (output: any, context: __SerdeContext): Model => { @@ -6727,7 +6899,14 @@ const deserializeAws_json1_1ModelInputConfiguration = ( }; const deserializeAws_json1_1modelList = (output: any, context: __SerdeContext): Model[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Model(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Model(entry, context); + }); }; const deserializeAws_json1_1ModelOutputConfiguration = ( @@ -6748,13 +6927,15 @@ const deserializeAws_json1_1ModelOutputConfiguration = ( }; const deserializeAws_json1_1ModelPredictionMap = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ModelScores = (output: any, context: __SerdeContext): ModelScores => { @@ -6815,11 +6996,25 @@ const deserializeAws_json1_1ModelVersionDetail = (output: any, context: __SerdeC }; const deserializeAws_json1_1modelVersionDetailList = (output: any, context: __SerdeContext): ModelVersionDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModelVersionDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModelVersionDetail(entry, context); + }); }; const deserializeAws_json1_1NonEmptyListOfStrings = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Outcome = (output: any, context: __SerdeContext): Outcome => { @@ -6834,7 +7029,14 @@ const deserializeAws_json1_1Outcome = (output: any, context: __SerdeContext): Ou }; const deserializeAws_json1_1OutcomeList = (output: any, context: __SerdeContext): Outcome[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Outcome(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Outcome(entry, context); + }); }; const deserializeAws_json1_1PutDetectorResult = (output: any, context: __SerdeContext): PutDetectorResult => { @@ -6905,11 +7107,25 @@ const deserializeAws_json1_1RuleDetail = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1RuleDetailList = (output: any, context: __SerdeContext): RuleDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RuleDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RuleDetail(entry, context); + }); }; const deserializeAws_json1_1RuleList = (output: any, context: __SerdeContext): Rule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Rule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Rule(entry, context); + }); }; const deserializeAws_json1_1RuleResult = (output: any, context: __SerdeContext): RuleResult => { @@ -6930,7 +7146,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1tagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResult = (output: any, context: __SerdeContext): TagResourceResult => { @@ -7073,7 +7296,14 @@ const deserializeAws_json1_1Variable = (output: any, context: __SerdeContext): V }; const deserializeAws_json1_1VariableList = (output: any, context: __SerdeContext): Variable[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Variable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Variable(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -7126,3 +7356,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-fsx/protocols/Aws_json1_1.ts b/clients/client-fsx/protocols/Aws_json1_1.ts index 7425dbdcc5fc..bf1b48a0df8d 100644 --- a/clients/client-fsx/protocols/Aws_json1_1.ts +++ b/clients/client-fsx/protocols/Aws_json1_1.ts @@ -146,7 +146,7 @@ export const serializeAws_json1_1AssociateFileSystemAliasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.AssociateFileSystemAliases", }; let body: any; @@ -159,7 +159,7 @@ export const serializeAws_json1_1CancelDataRepositoryTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.CancelDataRepositoryTask", }; let body: any; @@ -172,7 +172,7 @@ export const serializeAws_json1_1CreateBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.CreateBackup", }; let body: any; @@ -185,7 +185,7 @@ export const serializeAws_json1_1CreateDataRepositoryTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.CreateDataRepositoryTask", }; let body: any; @@ -198,7 +198,7 @@ export const serializeAws_json1_1CreateFileSystemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.CreateFileSystem", }; let body: any; @@ -211,7 +211,7 @@ export const serializeAws_json1_1CreateFileSystemFromBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.CreateFileSystemFromBackup", }; let body: any; @@ -224,7 +224,7 @@ export const serializeAws_json1_1DeleteBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.DeleteBackup", }; let body: any; @@ -237,7 +237,7 @@ export const serializeAws_json1_1DeleteFileSystemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.DeleteFileSystem", }; let body: any; @@ -250,7 +250,7 @@ export const serializeAws_json1_1DescribeBackupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.DescribeBackups", }; let body: any; @@ -263,7 +263,7 @@ export const serializeAws_json1_1DescribeDataRepositoryTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.DescribeDataRepositoryTasks", }; let body: any; @@ -276,7 +276,7 @@ export const serializeAws_json1_1DescribeFileSystemAliasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.DescribeFileSystemAliases", }; let body: any; @@ -289,7 +289,7 @@ export const serializeAws_json1_1DescribeFileSystemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.DescribeFileSystems", }; let body: any; @@ -302,7 +302,7 @@ export const serializeAws_json1_1DisassociateFileSystemAliasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.DisassociateFileSystemAliases", }; let body: any; @@ -315,7 +315,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.ListTagsForResource", }; let body: any; @@ -328,7 +328,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.TagResource", }; let body: any; @@ -341,7 +341,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.UntagResource", }; let body: any; @@ -354,7 +354,7 @@ export const serializeAws_json1_1UpdateFileSystemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSimbaAPIService_v20180301.UpdateFileSystem", }; let body: any; @@ -389,8 +389,7 @@ const deserializeAws_json1_1AssociateFileSystemAliasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -460,8 +459,7 @@ const deserializeAws_json1_1CancelDataRepositoryTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -547,8 +545,7 @@ const deserializeAws_json1_1CreateBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BackupInProgress": case "com.amazonaws.fsx#BackupInProgress": @@ -650,8 +647,7 @@ const deserializeAws_json1_1CreateDataRepositoryTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -753,8 +749,7 @@ const deserializeAws_json1_1CreateFileSystemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActiveDirectoryError": case "com.amazonaws.fsx#ActiveDirectoryError": @@ -880,8 +875,7 @@ const deserializeAws_json1_1CreateFileSystemFromBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActiveDirectoryError": case "com.amazonaws.fsx#ActiveDirectoryError": @@ -999,8 +993,7 @@ const deserializeAws_json1_1DeleteBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BackupInProgress": case "com.amazonaws.fsx#BackupInProgress": @@ -1094,8 +1087,7 @@ const deserializeAws_json1_1DeleteFileSystemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -1181,8 +1173,7 @@ const deserializeAws_json1_1DescribeBackupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BackupNotFound": case "com.amazonaws.fsx#BackupNotFound": @@ -1260,8 +1251,7 @@ const deserializeAws_json1_1DescribeDataRepositoryTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -1339,8 +1329,7 @@ const deserializeAws_json1_1DescribeFileSystemAliasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -1410,8 +1399,7 @@ const deserializeAws_json1_1DescribeFileSystemsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -1481,8 +1469,7 @@ const deserializeAws_json1_1DisassociateFileSystemAliasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -1552,8 +1539,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -1639,8 +1625,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -1726,8 +1711,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -1813,8 +1797,7 @@ const deserializeAws_json1_1UpdateFileSystemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequest": case "com.amazonaws.fsx#BadRequest": @@ -2205,7 +2188,14 @@ const deserializeAws_json1_1UnsupportedOperationResponse = async ( }; const serializeAws_json1_1AlternateDNSNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssociateFileSystemAliasesRequest = ( @@ -2213,14 +2203,22 @@ const serializeAws_json1_1AssociateFileSystemAliasesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Aliases !== undefined && { Aliases: serializeAws_json1_1AlternateDNSNames(input.Aliases, context) }), + ...(input.Aliases !== undefined && + input.Aliases !== null && { Aliases: serializeAws_json1_1AlternateDNSNames(input.Aliases, context) }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), }; }; const serializeAws_json1_1BackupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CancelDataRepositoryTaskRequest = ( @@ -2228,24 +2226,24 @@ const serializeAws_json1_1CancelDataRepositoryTaskRequest = ( context: __SerdeContext ): any => { return { - ...(input.TaskId !== undefined && { TaskId: input.TaskId }), + ...(input.TaskId !== undefined && input.TaskId !== null && { TaskId: input.TaskId }), }; }; const serializeAws_json1_1CompletionReport = (input: CompletionReport, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; const serializeAws_json1_1CreateBackupRequest = (input: CreateBackupRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -2255,11 +2253,13 @@ const serializeAws_json1_1CreateDataRepositoryTaskRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), - ...(input.Paths !== undefined && { Paths: serializeAws_json1_1DataRepositoryTaskPaths(input.Paths, context) }), - ...(input.Report !== undefined && { Report: serializeAws_json1_1CompletionReport(input.Report, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), + ...(input.Paths !== undefined && + input.Paths !== null && { Paths: serializeAws_json1_1DataRepositoryTaskPaths(input.Paths, context) }), + ...(input.Report !== undefined && + input.Report !== null && { Report: serializeAws_json1_1CompletionReport(input.Report, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -2268,23 +2268,30 @@ const serializeAws_json1_1CreateFileSystemFromBackupRequest = ( context: __SerdeContext ): any => { return { - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.LustreConfiguration !== undefined && { - LustreConfiguration: serializeAws_json1_1CreateFileSystemLustreConfiguration(input.LustreConfiguration, context), - }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.StorageType !== undefined && { StorageType: input.StorageType }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.WindowsConfiguration !== undefined && { - WindowsConfiguration: serializeAws_json1_1CreateFileSystemWindowsConfiguration( - input.WindowsConfiguration, - context - ), - }), + ...(input.LustreConfiguration !== undefined && + input.LustreConfiguration !== null && { + LustreConfiguration: serializeAws_json1_1CreateFileSystemLustreConfiguration( + input.LustreConfiguration, + context + ), + }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.StorageType !== undefined && input.StorageType !== null && { StorageType: input.StorageType }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.WindowsConfiguration !== undefined && + input.WindowsConfiguration !== null && { + WindowsConfiguration: serializeAws_json1_1CreateFileSystemWindowsConfiguration( + input.WindowsConfiguration, + context + ), + }), }; }; @@ -2293,47 +2300,63 @@ const serializeAws_json1_1CreateFileSystemLustreConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AutoImportPolicy !== undefined && { AutoImportPolicy: input.AutoImportPolicy }), - ...(input.AutomaticBackupRetentionDays !== undefined && { - AutomaticBackupRetentionDays: input.AutomaticBackupRetentionDays, - }), - ...(input.CopyTagsToBackups !== undefined && { CopyTagsToBackups: input.CopyTagsToBackups }), - ...(input.DailyAutomaticBackupStartTime !== undefined && { - DailyAutomaticBackupStartTime: input.DailyAutomaticBackupStartTime, - }), - ...(input.DeploymentType !== undefined && { DeploymentType: input.DeploymentType }), - ...(input.DriveCacheType !== undefined && { DriveCacheType: input.DriveCacheType }), - ...(input.ExportPath !== undefined && { ExportPath: input.ExportPath }), - ...(input.ImportPath !== undefined && { ImportPath: input.ImportPath }), - ...(input.ImportedFileChunkSize !== undefined && { ImportedFileChunkSize: input.ImportedFileChunkSize }), - ...(input.PerUnitStorageThroughput !== undefined && { PerUnitStorageThroughput: input.PerUnitStorageThroughput }), - ...(input.WeeklyMaintenanceStartTime !== undefined && { - WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime, - }), + ...(input.AutoImportPolicy !== undefined && + input.AutoImportPolicy !== null && { AutoImportPolicy: input.AutoImportPolicy }), + ...(input.AutomaticBackupRetentionDays !== undefined && + input.AutomaticBackupRetentionDays !== null && { + AutomaticBackupRetentionDays: input.AutomaticBackupRetentionDays, + }), + ...(input.CopyTagsToBackups !== undefined && + input.CopyTagsToBackups !== null && { CopyTagsToBackups: input.CopyTagsToBackups }), + ...(input.DailyAutomaticBackupStartTime !== undefined && + input.DailyAutomaticBackupStartTime !== null && { + DailyAutomaticBackupStartTime: input.DailyAutomaticBackupStartTime, + }), + ...(input.DeploymentType !== undefined && + input.DeploymentType !== null && { DeploymentType: input.DeploymentType }), + ...(input.DriveCacheType !== undefined && + input.DriveCacheType !== null && { DriveCacheType: input.DriveCacheType }), + ...(input.ExportPath !== undefined && input.ExportPath !== null && { ExportPath: input.ExportPath }), + ...(input.ImportPath !== undefined && input.ImportPath !== null && { ImportPath: input.ImportPath }), + ...(input.ImportedFileChunkSize !== undefined && + input.ImportedFileChunkSize !== null && { ImportedFileChunkSize: input.ImportedFileChunkSize }), + ...(input.PerUnitStorageThroughput !== undefined && + input.PerUnitStorageThroughput !== null && { PerUnitStorageThroughput: input.PerUnitStorageThroughput }), + ...(input.WeeklyMaintenanceStartTime !== undefined && + input.WeeklyMaintenanceStartTime !== null && { WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime }), }; }; const serializeAws_json1_1CreateFileSystemRequest = (input: CreateFileSystemRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.FileSystemType !== undefined && { FileSystemType: input.FileSystemType }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.LustreConfiguration !== undefined && { - LustreConfiguration: serializeAws_json1_1CreateFileSystemLustreConfiguration(input.LustreConfiguration, context), - }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.StorageCapacity !== undefined && { StorageCapacity: input.StorageCapacity }), - ...(input.StorageType !== undefined && { StorageType: input.StorageType }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.WindowsConfiguration !== undefined && { - WindowsConfiguration: serializeAws_json1_1CreateFileSystemWindowsConfiguration( - input.WindowsConfiguration, - context - ), - }), + ...(input.FileSystemType !== undefined && + input.FileSystemType !== null && { FileSystemType: input.FileSystemType }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.LustreConfiguration !== undefined && + input.LustreConfiguration !== null && { + LustreConfiguration: serializeAws_json1_1CreateFileSystemLustreConfiguration( + input.LustreConfiguration, + context + ), + }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.StorageCapacity !== undefined && + input.StorageCapacity !== null && { StorageCapacity: input.StorageCapacity }), + ...(input.StorageType !== undefined && input.StorageType !== null && { StorageType: input.StorageType }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.WindowsConfiguration !== undefined && + input.WindowsConfiguration !== null && { + WindowsConfiguration: serializeAws_json1_1CreateFileSystemWindowsConfiguration( + input.WindowsConfiguration, + context + ), + }), }; }; @@ -2342,27 +2365,35 @@ const serializeAws_json1_1CreateFileSystemWindowsConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.ActiveDirectoryId !== undefined && { ActiveDirectoryId: input.ActiveDirectoryId }), - ...(input.Aliases !== undefined && { Aliases: serializeAws_json1_1AlternateDNSNames(input.Aliases, context) }), - ...(input.AutomaticBackupRetentionDays !== undefined && { - AutomaticBackupRetentionDays: input.AutomaticBackupRetentionDays, - }), - ...(input.CopyTagsToBackups !== undefined && { CopyTagsToBackups: input.CopyTagsToBackups }), - ...(input.DailyAutomaticBackupStartTime !== undefined && { - DailyAutomaticBackupStartTime: input.DailyAutomaticBackupStartTime, - }), - ...(input.DeploymentType !== undefined && { DeploymentType: input.DeploymentType }), - ...(input.PreferredSubnetId !== undefined && { PreferredSubnetId: input.PreferredSubnetId }), - ...(input.SelfManagedActiveDirectoryConfiguration !== undefined && { - SelfManagedActiveDirectoryConfiguration: serializeAws_json1_1SelfManagedActiveDirectoryConfiguration( - input.SelfManagedActiveDirectoryConfiguration, - context - ), - }), - ...(input.ThroughputCapacity !== undefined && { ThroughputCapacity: input.ThroughputCapacity }), - ...(input.WeeklyMaintenanceStartTime !== undefined && { - WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime, - }), + ...(input.ActiveDirectoryId !== undefined && + input.ActiveDirectoryId !== null && { ActiveDirectoryId: input.ActiveDirectoryId }), + ...(input.Aliases !== undefined && + input.Aliases !== null && { Aliases: serializeAws_json1_1AlternateDNSNames(input.Aliases, context) }), + ...(input.AutomaticBackupRetentionDays !== undefined && + input.AutomaticBackupRetentionDays !== null && { + AutomaticBackupRetentionDays: input.AutomaticBackupRetentionDays, + }), + ...(input.CopyTagsToBackups !== undefined && + input.CopyTagsToBackups !== null && { CopyTagsToBackups: input.CopyTagsToBackups }), + ...(input.DailyAutomaticBackupStartTime !== undefined && + input.DailyAutomaticBackupStartTime !== null && { + DailyAutomaticBackupStartTime: input.DailyAutomaticBackupStartTime, + }), + ...(input.DeploymentType !== undefined && + input.DeploymentType !== null && { DeploymentType: input.DeploymentType }), + ...(input.PreferredSubnetId !== undefined && + input.PreferredSubnetId !== null && { PreferredSubnetId: input.PreferredSubnetId }), + ...(input.SelfManagedActiveDirectoryConfiguration !== undefined && + input.SelfManagedActiveDirectoryConfiguration !== null && { + SelfManagedActiveDirectoryConfiguration: serializeAws_json1_1SelfManagedActiveDirectoryConfiguration( + input.SelfManagedActiveDirectoryConfiguration, + context + ), + }), + ...(input.ThroughputCapacity !== undefined && + input.ThroughputCapacity !== null && { ThroughputCapacity: input.ThroughputCapacity }), + ...(input.WeeklyMaintenanceStartTime !== undefined && + input.WeeklyMaintenanceStartTime !== null && { WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime }), }; }; @@ -2371,10 +2402,9 @@ const serializeAws_json1_1DataRepositoryTaskFilter = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1DataRepositoryTaskFilterValues(input.Values, context), - }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1DataRepositoryTaskFilterValues(input.Values, context) }), }; }; @@ -2382,20 +2412,41 @@ const serializeAws_json1_1DataRepositoryTaskFilters = ( input: DataRepositoryTaskFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1DataRepositoryTaskFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DataRepositoryTaskFilter(entry, context); + }); }; const serializeAws_json1_1DataRepositoryTaskFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DataRepositoryTaskPaths = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteBackupRequest = (input: DeleteBackupRequest, context: __SerdeContext): any => { return { - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), }; }; @@ -2405,26 +2456,31 @@ const serializeAws_json1_1DeleteFileSystemLustreConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.FinalBackupTags !== undefined && { - FinalBackupTags: serializeAws_json1_1Tags(input.FinalBackupTags, context), - }), - ...(input.SkipFinalBackup !== undefined && { SkipFinalBackup: input.SkipFinalBackup }), + ...(input.FinalBackupTags !== undefined && + input.FinalBackupTags !== null && { FinalBackupTags: serializeAws_json1_1Tags(input.FinalBackupTags, context) }), + ...(input.SkipFinalBackup !== undefined && + input.SkipFinalBackup !== null && { SkipFinalBackup: input.SkipFinalBackup }), }; }; const serializeAws_json1_1DeleteFileSystemRequest = (input: DeleteFileSystemRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), - ...(input.LustreConfiguration !== undefined && { - LustreConfiguration: serializeAws_json1_1DeleteFileSystemLustreConfiguration(input.LustreConfiguration, context), - }), - ...(input.WindowsConfiguration !== undefined && { - WindowsConfiguration: serializeAws_json1_1DeleteFileSystemWindowsConfiguration( - input.WindowsConfiguration, - context - ), - }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), + ...(input.LustreConfiguration !== undefined && + input.LustreConfiguration !== null && { + LustreConfiguration: serializeAws_json1_1DeleteFileSystemLustreConfiguration( + input.LustreConfiguration, + context + ), + }), + ...(input.WindowsConfiguration !== undefined && + input.WindowsConfiguration !== null && { + WindowsConfiguration: serializeAws_json1_1DeleteFileSystemWindowsConfiguration( + input.WindowsConfiguration, + context + ), + }), }; }; @@ -2433,19 +2489,21 @@ const serializeAws_json1_1DeleteFileSystemWindowsConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.FinalBackupTags !== undefined && { - FinalBackupTags: serializeAws_json1_1Tags(input.FinalBackupTags, context), - }), - ...(input.SkipFinalBackup !== undefined && { SkipFinalBackup: input.SkipFinalBackup }), + ...(input.FinalBackupTags !== undefined && + input.FinalBackupTags !== null && { FinalBackupTags: serializeAws_json1_1Tags(input.FinalBackupTags, context) }), + ...(input.SkipFinalBackup !== undefined && + input.SkipFinalBackup !== null && { SkipFinalBackup: input.SkipFinalBackup }), }; }; const serializeAws_json1_1DescribeBackupsRequest = (input: DescribeBackupsRequest, context: __SerdeContext): any => { return { - ...(input.BackupIds !== undefined && { BackupIds: serializeAws_json1_1BackupIds(input.BackupIds, context) }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.BackupIds !== undefined && + input.BackupIds !== null && { BackupIds: serializeAws_json1_1BackupIds(input.BackupIds, context) }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2454,12 +2512,12 @@ const serializeAws_json1_1DescribeDataRepositoryTasksRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1DataRepositoryTaskFilters(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TaskIds !== undefined && { TaskIds: serializeAws_json1_1TaskIds(input.TaskIds, context) }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1DataRepositoryTaskFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TaskIds !== undefined && + input.TaskIds !== null && { TaskIds: serializeAws_json1_1TaskIds(input.TaskIds, context) }), }; }; @@ -2469,9 +2527,9 @@ const serializeAws_json1_1DescribeFileSystemAliasesRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2480,11 +2538,12 @@ const serializeAws_json1_1DescribeFileSystemsRequest = ( context: __SerdeContext ): any => { return { - ...(input.FileSystemIds !== undefined && { - FileSystemIds: serializeAws_json1_1FileSystemIds(input.FileSystemIds, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FileSystemIds !== undefined && + input.FileSystemIds !== null && { + FileSystemIds: serializeAws_json1_1FileSystemIds(input.FileSystemIds, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2493,33 +2552,63 @@ const serializeAws_json1_1DisassociateFileSystemAliasesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Aliases !== undefined && { Aliases: serializeAws_json1_1AlternateDNSNames(input.Aliases, context) }), + ...(input.Aliases !== undefined && + input.Aliases !== null && { Aliases: serializeAws_json1_1AlternateDNSNames(input.Aliases, context) }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), }; }; const serializeAws_json1_1DnsIps = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FileSystemIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), }; }; const serializeAws_json1_1Filters = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1FilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListTagsForResourceRequest = ( @@ -2527,14 +2616,21 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SelfManagedActiveDirectoryConfiguration = ( @@ -2542,16 +2638,19 @@ const serializeAws_json1_1SelfManagedActiveDirectoryConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DnsIps !== undefined && { DnsIps: serializeAws_json1_1DnsIps(input.DnsIps, context) }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.FileSystemAdministratorsGroup !== undefined && { - FileSystemAdministratorsGroup: input.FileSystemAdministratorsGroup, - }), - ...(input.OrganizationalUnitDistinguishedName !== undefined && { - OrganizationalUnitDistinguishedName: input.OrganizationalUnitDistinguishedName, - }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.DnsIps !== undefined && + input.DnsIps !== null && { DnsIps: serializeAws_json1_1DnsIps(input.DnsIps, context) }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.FileSystemAdministratorsGroup !== undefined && + input.FileSystemAdministratorsGroup !== null && { + FileSystemAdministratorsGroup: input.FileSystemAdministratorsGroup, + }), + ...(input.OrganizationalUnitDistinguishedName !== undefined && + input.OrganizationalUnitDistinguishedName !== null && { + OrganizationalUnitDistinguishedName: input.OrganizationalUnitDistinguishedName, + }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -2560,46 +2659,76 @@ const serializeAws_json1_1SelfManagedActiveDirectoryConfigurationUpdates = ( context: __SerdeContext ): any => { return { - ...(input.DnsIps !== undefined && { DnsIps: serializeAws_json1_1DnsIps(input.DnsIps, context) }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.DnsIps !== undefined && + input.DnsIps !== null && { DnsIps: serializeAws_json1_1DnsIps(input.DnsIps, context) }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; const serializeAws_json1_1SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TaskIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; @@ -2608,33 +2737,41 @@ const serializeAws_json1_1UpdateFileSystemLustreConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AutoImportPolicy !== undefined && { AutoImportPolicy: input.AutoImportPolicy }), - ...(input.AutomaticBackupRetentionDays !== undefined && { - AutomaticBackupRetentionDays: input.AutomaticBackupRetentionDays, - }), - ...(input.DailyAutomaticBackupStartTime !== undefined && { - DailyAutomaticBackupStartTime: input.DailyAutomaticBackupStartTime, - }), - ...(input.WeeklyMaintenanceStartTime !== undefined && { - WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime, - }), + ...(input.AutoImportPolicy !== undefined && + input.AutoImportPolicy !== null && { AutoImportPolicy: input.AutoImportPolicy }), + ...(input.AutomaticBackupRetentionDays !== undefined && + input.AutomaticBackupRetentionDays !== null && { + AutomaticBackupRetentionDays: input.AutomaticBackupRetentionDays, + }), + ...(input.DailyAutomaticBackupStartTime !== undefined && + input.DailyAutomaticBackupStartTime !== null && { + DailyAutomaticBackupStartTime: input.DailyAutomaticBackupStartTime, + }), + ...(input.WeeklyMaintenanceStartTime !== undefined && + input.WeeklyMaintenanceStartTime !== null && { WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime }), }; }; const serializeAws_json1_1UpdateFileSystemRequest = (input: UpdateFileSystemRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), - ...(input.LustreConfiguration !== undefined && { - LustreConfiguration: serializeAws_json1_1UpdateFileSystemLustreConfiguration(input.LustreConfiguration, context), - }), - ...(input.StorageCapacity !== undefined && { StorageCapacity: input.StorageCapacity }), - ...(input.WindowsConfiguration !== undefined && { - WindowsConfiguration: serializeAws_json1_1UpdateFileSystemWindowsConfiguration( - input.WindowsConfiguration, - context - ), - }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), + ...(input.LustreConfiguration !== undefined && + input.LustreConfiguration !== null && { + LustreConfiguration: serializeAws_json1_1UpdateFileSystemLustreConfiguration( + input.LustreConfiguration, + context + ), + }), + ...(input.StorageCapacity !== undefined && + input.StorageCapacity !== null && { StorageCapacity: input.StorageCapacity }), + ...(input.WindowsConfiguration !== undefined && + input.WindowsConfiguration !== null && { + WindowsConfiguration: serializeAws_json1_1UpdateFileSystemWindowsConfiguration( + input.WindowsConfiguration, + context + ), + }), }; }; @@ -2643,22 +2780,25 @@ const serializeAws_json1_1UpdateFileSystemWindowsConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AutomaticBackupRetentionDays !== undefined && { - AutomaticBackupRetentionDays: input.AutomaticBackupRetentionDays, - }), - ...(input.DailyAutomaticBackupStartTime !== undefined && { - DailyAutomaticBackupStartTime: input.DailyAutomaticBackupStartTime, - }), - ...(input.SelfManagedActiveDirectoryConfiguration !== undefined && { - SelfManagedActiveDirectoryConfiguration: serializeAws_json1_1SelfManagedActiveDirectoryConfigurationUpdates( - input.SelfManagedActiveDirectoryConfiguration, - context - ), - }), - ...(input.ThroughputCapacity !== undefined && { ThroughputCapacity: input.ThroughputCapacity }), - ...(input.WeeklyMaintenanceStartTime !== undefined && { - WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime, - }), + ...(input.AutomaticBackupRetentionDays !== undefined && + input.AutomaticBackupRetentionDays !== null && { + AutomaticBackupRetentionDays: input.AutomaticBackupRetentionDays, + }), + ...(input.DailyAutomaticBackupStartTime !== undefined && + input.DailyAutomaticBackupStartTime !== null && { + DailyAutomaticBackupStartTime: input.DailyAutomaticBackupStartTime, + }), + ...(input.SelfManagedActiveDirectoryConfiguration !== undefined && + input.SelfManagedActiveDirectoryConfiguration !== null && { + SelfManagedActiveDirectoryConfiguration: serializeAws_json1_1SelfManagedActiveDirectoryConfigurationUpdates( + input.SelfManagedActiveDirectoryConfiguration, + context + ), + }), + ...(input.ThroughputCapacity !== undefined && + input.ThroughputCapacity !== null && { ThroughputCapacity: input.ThroughputCapacity }), + ...(input.WeeklyMaintenanceStartTime !== undefined && + input.WeeklyMaintenanceStartTime !== null && { WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime }), }; }; @@ -2720,7 +2860,14 @@ const deserializeAws_json1_1AdministrativeActionFailureDetails = ( }; const deserializeAws_json1_1AdministrativeActions = (output: any, context: __SerdeContext): AdministrativeAction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AdministrativeAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AdministrativeAction(entry, context); + }); }; const deserializeAws_json1_1Alias = (output: any, context: __SerdeContext): Alias => { @@ -2731,7 +2878,14 @@ const deserializeAws_json1_1Alias = (output: any, context: __SerdeContext): Alia }; const deserializeAws_json1_1Aliases = (output: any, context: __SerdeContext): Alias[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Alias(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Alias(entry, context); + }); }; const deserializeAws_json1_1AssociateFileSystemAliasesResponse = ( @@ -2802,7 +2956,14 @@ const deserializeAws_json1_1BackupRestoring = (output: any, context: __SerdeCont }; const deserializeAws_json1_1Backups = (output: any, context: __SerdeContext): Backup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Backup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Backup(entry, context); + }); }; const deserializeAws_json1_1BadRequest = (output: any, context: __SerdeContext): BadRequest => { @@ -2980,11 +3141,25 @@ const deserializeAws_json1_1DataRepositoryTaskNotFound = ( }; const deserializeAws_json1_1DataRepositoryTaskPaths = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DataRepositoryTasks = (output: any, context: __SerdeContext): DataRepositoryTask[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataRepositoryTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataRepositoryTask(entry, context); + }); }; const deserializeAws_json1_1DataRepositoryTaskStatus = ( @@ -3121,7 +3296,14 @@ const deserializeAws_json1_1DisassociateFileSystemAliasesResponse = ( }; const deserializeAws_json1_1DnsIps = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FileSystem = (output: any, context: __SerdeContext): FileSystem => { @@ -3184,7 +3366,14 @@ const deserializeAws_json1_1FileSystemMaintenanceOperations = ( output: any, context: __SerdeContext ): (FileSystemMaintenanceOperation | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FileSystemNotFound = (output: any, context: __SerdeContext): FileSystemNotFound => { @@ -3194,7 +3383,14 @@ const deserializeAws_json1_1FileSystemNotFound = (output: any, context: __SerdeC }; const deserializeAws_json1_1FileSystems = (output: any, context: __SerdeContext): FileSystem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FileSystem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FileSystem(entry, context); + }); }; const deserializeAws_json1_1IncompatibleParameterError = ( @@ -3304,7 +3500,14 @@ const deserializeAws_json1_1MissingFileSystemConfiguration = ( }; const deserializeAws_json1_1NetworkInterfaceIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NotServiceResourceError = ( @@ -3364,7 +3567,14 @@ const deserializeAws_json1_1ServiceLimitExceeded = (output: any, context: __Serd }; const deserializeAws_json1_1SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -3379,7 +3589,14 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1UnsupportedOperation = (output: any, context: __SerdeContext): UnsupportedOperation => { @@ -3516,3 +3733,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-gamelift/protocols/Aws_json1_1.ts b/clients/client-gamelift/protocols/Aws_json1_1.ts index 2e0a16addf2f..9264ae2a8ba6 100644 --- a/clients/client-gamelift/protocols/Aws_json1_1.ts +++ b/clients/client-gamelift/protocols/Aws_json1_1.ts @@ -503,7 +503,7 @@ export const serializeAws_json1_1AcceptMatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.AcceptMatch", }; let body: any; @@ -516,7 +516,7 @@ export const serializeAws_json1_1ClaimGameServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ClaimGameServer", }; let body: any; @@ -529,7 +529,7 @@ export const serializeAws_json1_1CreateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateAlias", }; let body: any; @@ -542,7 +542,7 @@ export const serializeAws_json1_1CreateBuildCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateBuild", }; let body: any; @@ -555,7 +555,7 @@ export const serializeAws_json1_1CreateFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateFleet", }; let body: any; @@ -568,7 +568,7 @@ export const serializeAws_json1_1CreateGameServerGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateGameServerGroup", }; let body: any; @@ -581,7 +581,7 @@ export const serializeAws_json1_1CreateGameSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateGameSession", }; let body: any; @@ -594,7 +594,7 @@ export const serializeAws_json1_1CreateGameSessionQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateGameSessionQueue", }; let body: any; @@ -607,7 +607,7 @@ export const serializeAws_json1_1CreateMatchmakingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateMatchmakingConfiguration", }; let body: any; @@ -620,7 +620,7 @@ export const serializeAws_json1_1CreateMatchmakingRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateMatchmakingRuleSet", }; let body: any; @@ -633,7 +633,7 @@ export const serializeAws_json1_1CreatePlayerSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreatePlayerSession", }; let body: any; @@ -646,7 +646,7 @@ export const serializeAws_json1_1CreatePlayerSessionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreatePlayerSessions", }; let body: any; @@ -659,7 +659,7 @@ export const serializeAws_json1_1CreateScriptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateScript", }; let body: any; @@ -672,7 +672,7 @@ export const serializeAws_json1_1CreateVpcPeeringAuthorizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateVpcPeeringAuthorization", }; let body: any; @@ -685,7 +685,7 @@ export const serializeAws_json1_1CreateVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.CreateVpcPeeringConnection", }; let body: any; @@ -698,7 +698,7 @@ export const serializeAws_json1_1DeleteAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteAlias", }; let body: any; @@ -711,7 +711,7 @@ export const serializeAws_json1_1DeleteBuildCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteBuild", }; let body: any; @@ -724,7 +724,7 @@ export const serializeAws_json1_1DeleteFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteFleet", }; let body: any; @@ -737,7 +737,7 @@ export const serializeAws_json1_1DeleteGameServerGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteGameServerGroup", }; let body: any; @@ -750,7 +750,7 @@ export const serializeAws_json1_1DeleteGameSessionQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteGameSessionQueue", }; let body: any; @@ -763,7 +763,7 @@ export const serializeAws_json1_1DeleteMatchmakingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteMatchmakingConfiguration", }; let body: any; @@ -776,7 +776,7 @@ export const serializeAws_json1_1DeleteMatchmakingRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteMatchmakingRuleSet", }; let body: any; @@ -789,7 +789,7 @@ export const serializeAws_json1_1DeleteScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteScalingPolicy", }; let body: any; @@ -802,7 +802,7 @@ export const serializeAws_json1_1DeleteScriptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteScript", }; let body: any; @@ -815,7 +815,7 @@ export const serializeAws_json1_1DeleteVpcPeeringAuthorizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteVpcPeeringAuthorization", }; let body: any; @@ -828,7 +828,7 @@ export const serializeAws_json1_1DeleteVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeleteVpcPeeringConnection", }; let body: any; @@ -841,7 +841,7 @@ export const serializeAws_json1_1DeregisterGameServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DeregisterGameServer", }; let body: any; @@ -854,7 +854,7 @@ export const serializeAws_json1_1DescribeAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeAlias", }; let body: any; @@ -867,7 +867,7 @@ export const serializeAws_json1_1DescribeBuildCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeBuild", }; let body: any; @@ -880,7 +880,7 @@ export const serializeAws_json1_1DescribeEC2InstanceLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeEC2InstanceLimits", }; let body: any; @@ -893,7 +893,7 @@ export const serializeAws_json1_1DescribeFleetAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeFleetAttributes", }; let body: any; @@ -906,7 +906,7 @@ export const serializeAws_json1_1DescribeFleetCapacityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeFleetCapacity", }; let body: any; @@ -919,7 +919,7 @@ export const serializeAws_json1_1DescribeFleetEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeFleetEvents", }; let body: any; @@ -932,7 +932,7 @@ export const serializeAws_json1_1DescribeFleetPortSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeFleetPortSettings", }; let body: any; @@ -945,7 +945,7 @@ export const serializeAws_json1_1DescribeFleetUtilizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeFleetUtilization", }; let body: any; @@ -958,7 +958,7 @@ export const serializeAws_json1_1DescribeGameServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeGameServer", }; let body: any; @@ -971,7 +971,7 @@ export const serializeAws_json1_1DescribeGameServerGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeGameServerGroup", }; let body: any; @@ -984,7 +984,7 @@ export const serializeAws_json1_1DescribeGameServerInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeGameServerInstances", }; let body: any; @@ -997,7 +997,7 @@ export const serializeAws_json1_1DescribeGameSessionDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeGameSessionDetails", }; let body: any; @@ -1010,7 +1010,7 @@ export const serializeAws_json1_1DescribeGameSessionPlacementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeGameSessionPlacement", }; let body: any; @@ -1023,7 +1023,7 @@ export const serializeAws_json1_1DescribeGameSessionQueuesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeGameSessionQueues", }; let body: any; @@ -1036,7 +1036,7 @@ export const serializeAws_json1_1DescribeGameSessionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeGameSessions", }; let body: any; @@ -1049,7 +1049,7 @@ export const serializeAws_json1_1DescribeInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeInstances", }; let body: any; @@ -1062,7 +1062,7 @@ export const serializeAws_json1_1DescribeMatchmakingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeMatchmaking", }; let body: any; @@ -1075,7 +1075,7 @@ export const serializeAws_json1_1DescribeMatchmakingConfigurationsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeMatchmakingConfigurations", }; let body: any; @@ -1088,7 +1088,7 @@ export const serializeAws_json1_1DescribeMatchmakingRuleSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeMatchmakingRuleSets", }; let body: any; @@ -1101,7 +1101,7 @@ export const serializeAws_json1_1DescribePlayerSessionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribePlayerSessions", }; let body: any; @@ -1114,7 +1114,7 @@ export const serializeAws_json1_1DescribeRuntimeConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeRuntimeConfiguration", }; let body: any; @@ -1127,7 +1127,7 @@ export const serializeAws_json1_1DescribeScalingPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeScalingPolicies", }; let body: any; @@ -1140,7 +1140,7 @@ export const serializeAws_json1_1DescribeScriptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeScript", }; let body: any; @@ -1153,7 +1153,7 @@ export const serializeAws_json1_1DescribeVpcPeeringAuthorizationsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeVpcPeeringAuthorizations", }; let body: any; @@ -1166,7 +1166,7 @@ export const serializeAws_json1_1DescribeVpcPeeringConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.DescribeVpcPeeringConnections", }; let body: any; @@ -1179,7 +1179,7 @@ export const serializeAws_json1_1GetGameSessionLogUrlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.GetGameSessionLogUrl", }; let body: any; @@ -1192,7 +1192,7 @@ export const serializeAws_json1_1GetInstanceAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.GetInstanceAccess", }; let body: any; @@ -1205,7 +1205,7 @@ export const serializeAws_json1_1ListAliasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ListAliases", }; let body: any; @@ -1218,7 +1218,7 @@ export const serializeAws_json1_1ListBuildsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ListBuilds", }; let body: any; @@ -1231,7 +1231,7 @@ export const serializeAws_json1_1ListFleetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ListFleets", }; let body: any; @@ -1244,7 +1244,7 @@ export const serializeAws_json1_1ListGameServerGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ListGameServerGroups", }; let body: any; @@ -1257,7 +1257,7 @@ export const serializeAws_json1_1ListGameServersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ListGameServers", }; let body: any; @@ -1270,7 +1270,7 @@ export const serializeAws_json1_1ListScriptsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ListScripts", }; let body: any; @@ -1283,7 +1283,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ListTagsForResource", }; let body: any; @@ -1296,7 +1296,7 @@ export const serializeAws_json1_1PutScalingPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.PutScalingPolicy", }; let body: any; @@ -1309,7 +1309,7 @@ export const serializeAws_json1_1RegisterGameServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.RegisterGameServer", }; let body: any; @@ -1322,7 +1322,7 @@ export const serializeAws_json1_1RequestUploadCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.RequestUploadCredentials", }; let body: any; @@ -1335,7 +1335,7 @@ export const serializeAws_json1_1ResolveAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ResolveAlias", }; let body: any; @@ -1348,7 +1348,7 @@ export const serializeAws_json1_1ResumeGameServerGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ResumeGameServerGroup", }; let body: any; @@ -1361,7 +1361,7 @@ export const serializeAws_json1_1SearchGameSessionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.SearchGameSessions", }; let body: any; @@ -1374,7 +1374,7 @@ export const serializeAws_json1_1StartFleetActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.StartFleetActions", }; let body: any; @@ -1387,7 +1387,7 @@ export const serializeAws_json1_1StartGameSessionPlacementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.StartGameSessionPlacement", }; let body: any; @@ -1400,7 +1400,7 @@ export const serializeAws_json1_1StartMatchBackfillCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.StartMatchBackfill", }; let body: any; @@ -1413,7 +1413,7 @@ export const serializeAws_json1_1StartMatchmakingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.StartMatchmaking", }; let body: any; @@ -1426,7 +1426,7 @@ export const serializeAws_json1_1StopFleetActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.StopFleetActions", }; let body: any; @@ -1439,7 +1439,7 @@ export const serializeAws_json1_1StopGameSessionPlacementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.StopGameSessionPlacement", }; let body: any; @@ -1452,7 +1452,7 @@ export const serializeAws_json1_1StopMatchmakingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.StopMatchmaking", }; let body: any; @@ -1465,7 +1465,7 @@ export const serializeAws_json1_1SuspendGameServerGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.SuspendGameServerGroup", }; let body: any; @@ -1478,7 +1478,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.TagResource", }; let body: any; @@ -1491,7 +1491,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UntagResource", }; let body: any; @@ -1504,7 +1504,7 @@ export const serializeAws_json1_1UpdateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateAlias", }; let body: any; @@ -1517,7 +1517,7 @@ export const serializeAws_json1_1UpdateBuildCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateBuild", }; let body: any; @@ -1530,7 +1530,7 @@ export const serializeAws_json1_1UpdateFleetAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateFleetAttributes", }; let body: any; @@ -1543,7 +1543,7 @@ export const serializeAws_json1_1UpdateFleetCapacityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateFleetCapacity", }; let body: any; @@ -1556,7 +1556,7 @@ export const serializeAws_json1_1UpdateFleetPortSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateFleetPortSettings", }; let body: any; @@ -1569,7 +1569,7 @@ export const serializeAws_json1_1UpdateGameServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateGameServer", }; let body: any; @@ -1582,7 +1582,7 @@ export const serializeAws_json1_1UpdateGameServerGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateGameServerGroup", }; let body: any; @@ -1595,7 +1595,7 @@ export const serializeAws_json1_1UpdateGameSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateGameSession", }; let body: any; @@ -1608,7 +1608,7 @@ export const serializeAws_json1_1UpdateGameSessionQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateGameSessionQueue", }; let body: any; @@ -1621,7 +1621,7 @@ export const serializeAws_json1_1UpdateMatchmakingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateMatchmakingConfiguration", }; let body: any; @@ -1634,7 +1634,7 @@ export const serializeAws_json1_1UpdateRuntimeConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateRuntimeConfiguration", }; let body: any; @@ -1647,7 +1647,7 @@ export const serializeAws_json1_1UpdateScriptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.UpdateScript", }; let body: any; @@ -1660,7 +1660,7 @@ export const serializeAws_json1_1ValidateMatchmakingRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GameLift.ValidateMatchmakingRuleSet", }; let body: any; @@ -1695,8 +1695,7 @@ const deserializeAws_json1_1AcceptMatchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -1774,8 +1773,7 @@ const deserializeAws_json1_1ClaimGameServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -1869,8 +1867,7 @@ const deserializeAws_json1_1CreateAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -1964,8 +1961,7 @@ const deserializeAws_json1_1CreateBuildCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -2051,8 +2047,7 @@ const deserializeAws_json1_1CreateFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -2154,8 +2149,7 @@ const deserializeAws_json1_1CreateGameServerGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -2241,8 +2235,7 @@ const deserializeAws_json1_1CreateGameSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -2368,8 +2361,7 @@ const deserializeAws_json1_1CreateGameSessionQueueCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -2455,8 +2447,7 @@ const deserializeAws_json1_1CreateMatchmakingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -2550,8 +2541,7 @@ const deserializeAws_json1_1CreateMatchmakingRuleSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -2629,8 +2619,7 @@ const deserializeAws_json1_1CreatePlayerSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GameSessionFullException": case "com.amazonaws.gamelift#GameSessionFullException": @@ -2732,8 +2721,7 @@ const deserializeAws_json1_1CreatePlayerSessionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GameSessionFullException": case "com.amazonaws.gamelift#GameSessionFullException": @@ -2835,8 +2823,7 @@ const deserializeAws_json1_1CreateScriptCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -2922,8 +2909,7 @@ const deserializeAws_json1_1CreateVpcPeeringAuthorizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3001,8 +2987,7 @@ const deserializeAws_json1_1CreateVpcPeeringConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3077,8 +3062,7 @@ const deserializeAws_json1_1DeleteAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3161,8 +3145,7 @@ const deserializeAws_json1_1DeleteBuildCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3245,8 +3228,7 @@ const deserializeAws_json1_1DeleteFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3340,8 +3322,7 @@ const deserializeAws_json1_1DeleteGameServerGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3419,8 +3400,7 @@ const deserializeAws_json1_1DeleteGameSessionQueueCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3506,8 +3486,7 @@ const deserializeAws_json1_1DeleteMatchmakingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3593,8 +3572,7 @@ const deserializeAws_json1_1DeleteMatchmakingRuleSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3677,8 +3655,7 @@ const deserializeAws_json1_1DeleteScalingPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3753,8 +3730,7 @@ const deserializeAws_json1_1DeleteScriptCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3840,8 +3816,7 @@ const deserializeAws_json1_1DeleteVpcPeeringAuthorizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3919,8 +3894,7 @@ const deserializeAws_json1_1DeleteVpcPeeringConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -3995,8 +3969,7 @@ const deserializeAws_json1_1DeregisterGameServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4074,8 +4047,7 @@ const deserializeAws_json1_1DescribeAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4153,8 +4125,7 @@ const deserializeAws_json1_1DescribeBuildCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4232,8 +4203,7 @@ const deserializeAws_json1_1DescribeEC2InstanceLimitsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4303,8 +4273,7 @@ const deserializeAws_json1_1DescribeFleetAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4382,8 +4351,7 @@ const deserializeAws_json1_1DescribeFleetCapacityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4461,8 +4429,7 @@ const deserializeAws_json1_1DescribeFleetEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4540,8 +4507,7 @@ const deserializeAws_json1_1DescribeFleetPortSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4619,8 +4585,7 @@ const deserializeAws_json1_1DescribeFleetUtilizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4698,8 +4663,7 @@ const deserializeAws_json1_1DescribeGameServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4777,8 +4741,7 @@ const deserializeAws_json1_1DescribeGameServerGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4856,8 +4819,7 @@ const deserializeAws_json1_1DescribeGameServerInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -4935,8 +4897,7 @@ const deserializeAws_json1_1DescribeGameSessionDetailsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5022,8 +4983,7 @@ const deserializeAws_json1_1DescribeGameSessionPlacementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5101,8 +5061,7 @@ const deserializeAws_json1_1DescribeGameSessionQueuesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5180,8 +5139,7 @@ const deserializeAws_json1_1DescribeGameSessionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5267,8 +5225,7 @@ const deserializeAws_json1_1DescribeInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5346,8 +5303,7 @@ const deserializeAws_json1_1DescribeMatchmakingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5417,8 +5373,7 @@ const deserializeAws_json1_1DescribeMatchmakingConfigurationsCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5488,8 +5443,7 @@ const deserializeAws_json1_1DescribeMatchmakingRuleSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5567,8 +5521,7 @@ const deserializeAws_json1_1DescribePlayerSessionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5646,8 +5599,7 @@ const deserializeAws_json1_1DescribeRuntimeConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5725,8 +5677,7 @@ const deserializeAws_json1_1DescribeScalingPoliciesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5804,8 +5755,7 @@ const deserializeAws_json1_1DescribeScriptCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5883,8 +5833,7 @@ const deserializeAws_json1_1DescribeVpcPeeringAuthorizationsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -5954,8 +5903,7 @@ const deserializeAws_json1_1DescribeVpcPeeringConnectionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6033,8 +5981,7 @@ const deserializeAws_json1_1GetGameSessionLogUrlCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6112,8 +6059,7 @@ const deserializeAws_json1_1GetInstanceAccessCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6191,8 +6137,7 @@ const deserializeAws_json1_1ListAliasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6262,8 +6207,7 @@ const deserializeAws_json1_1ListBuildsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6333,8 +6277,7 @@ const deserializeAws_json1_1ListFleetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6412,8 +6355,7 @@ const deserializeAws_json1_1ListGameServerGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6483,8 +6425,7 @@ const deserializeAws_json1_1ListGameServersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6554,8 +6495,7 @@ const deserializeAws_json1_1ListScriptsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6625,8 +6565,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6704,8 +6643,7 @@ const deserializeAws_json1_1PutScalingPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6783,8 +6721,7 @@ const deserializeAws_json1_1RegisterGameServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -6870,8 +6807,7 @@ const deserializeAws_json1_1RequestUploadCredentialsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -6949,8 +6885,7 @@ const deserializeAws_json1_1ResolveAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7036,8 +6971,7 @@ const deserializeAws_json1_1ResumeGameServerGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7115,8 +7049,7 @@ const deserializeAws_json1_1SearchGameSessionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7202,8 +7135,7 @@ const deserializeAws_json1_1StartFleetActionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7281,8 +7213,7 @@ const deserializeAws_json1_1StartGameSessionPlacementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7360,8 +7291,7 @@ const deserializeAws_json1_1StartMatchBackfillCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7439,8 +7369,7 @@ const deserializeAws_json1_1StartMatchmakingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7518,8 +7447,7 @@ const deserializeAws_json1_1StopFleetActionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7597,8 +7525,7 @@ const deserializeAws_json1_1StopGameSessionPlacementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7676,8 +7603,7 @@ const deserializeAws_json1_1StopMatchmakingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7755,8 +7681,7 @@ const deserializeAws_json1_1SuspendGameServerGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7834,8 +7759,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7913,8 +7837,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -7992,8 +7915,7 @@ const deserializeAws_json1_1UpdateAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -8071,8 +7993,7 @@ const deserializeAws_json1_1UpdateBuildCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -8150,8 +8071,7 @@ const deserializeAws_json1_1UpdateFleetAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -8253,8 +8173,7 @@ const deserializeAws_json1_1UpdateFleetCapacityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -8356,8 +8275,7 @@ const deserializeAws_json1_1UpdateFleetPortSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -8459,8 +8377,7 @@ const deserializeAws_json1_1UpdateGameServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -8538,8 +8455,7 @@ const deserializeAws_json1_1UpdateGameServerGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -8617,8 +8533,7 @@ const deserializeAws_json1_1UpdateGameSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.gamelift#ConflictException": @@ -8712,8 +8627,7 @@ const deserializeAws_json1_1UpdateGameSessionQueueCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -8791,8 +8705,7 @@ const deserializeAws_json1_1UpdateMatchmakingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -8870,8 +8783,7 @@ const deserializeAws_json1_1UpdateRuntimeConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -8957,8 +8869,7 @@ const deserializeAws_json1_1UpdateScriptCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -9036,8 +8947,7 @@ const deserializeAws_json1_1ValidateMatchmakingRuleSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.gamelift#InternalServiceException": @@ -9307,18 +9217,21 @@ const deserializeAws_json1_1UnsupportedRegionExceptionResponse = async ( const serializeAws_json1_1AcceptMatchInput = (input: AcceptMatchInput, context: __SerdeContext): any => { return { - ...(input.AcceptanceType !== undefined && { AcceptanceType: input.AcceptanceType }), - ...(input.PlayerIds !== undefined && { PlayerIds: serializeAws_json1_1StringList(input.PlayerIds, context) }), - ...(input.TicketId !== undefined && { TicketId: input.TicketId }), + ...(input.AcceptanceType !== undefined && + input.AcceptanceType !== null && { AcceptanceType: input.AcceptanceType }), + ...(input.PlayerIds !== undefined && + input.PlayerIds !== null && { PlayerIds: serializeAws_json1_1StringList(input.PlayerIds, context) }), + ...(input.TicketId !== undefined && input.TicketId !== null && { TicketId: input.TicketId }), }; }; const serializeAws_json1_1AttributeValue = (input: AttributeValue, context: __SerdeContext): any => { return { - ...(input.N !== undefined && { N: input.N }), - ...(input.S !== undefined && { S: input.S }), - ...(input.SDM !== undefined && { SDM: serializeAws_json1_1StringDoubleMap(input.SDM, context) }), - ...(input.SL !== undefined && { SL: serializeAws_json1_1StringList(input.SL, context) }), + ...(input.N !== undefined && input.N !== null && { N: input.N }), + ...(input.S !== undefined && input.S !== null && { S: input.S }), + ...(input.SDM !== undefined && + input.SDM !== null && { SDM: serializeAws_json1_1StringDoubleMap(input.SDM, context) }), + ...(input.SL !== undefined && input.SL !== null && { SL: serializeAws_json1_1StringList(input.SL, context) }), }; }; @@ -9327,77 +9240,95 @@ const serializeAws_json1_1CertificateConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CertificateType !== undefined && { CertificateType: input.CertificateType }), + ...(input.CertificateType !== undefined && + input.CertificateType !== null && { CertificateType: input.CertificateType }), }; }; const serializeAws_json1_1ClaimGameServerInput = (input: ClaimGameServerInput, context: __SerdeContext): any => { return { - ...(input.GameServerData !== undefined && { GameServerData: input.GameServerData }), - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.GameServerId !== undefined && { GameServerId: input.GameServerId }), + ...(input.GameServerData !== undefined && + input.GameServerData !== null && { GameServerData: input.GameServerData }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.GameServerId !== undefined && input.GameServerId !== null && { GameServerId: input.GameServerId }), }; }; const serializeAws_json1_1CreateAliasInput = (input: CreateAliasInput, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoutingStrategy !== undefined && { - RoutingStrategy: serializeAws_json1_1RoutingStrategy(input.RoutingStrategy, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoutingStrategy !== undefined && + input.RoutingStrategy !== null && { + RoutingStrategy: serializeAws_json1_1RoutingStrategy(input.RoutingStrategy, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateBuildInput = (input: CreateBuildInput, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OperatingSystem !== undefined && { OperatingSystem: input.OperatingSystem }), - ...(input.StorageLocation !== undefined && { - StorageLocation: serializeAws_json1_1S3Location(input.StorageLocation, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OperatingSystem !== undefined && + input.OperatingSystem !== null && { OperatingSystem: input.OperatingSystem }), + ...(input.StorageLocation !== undefined && + input.StorageLocation !== null && { + StorageLocation: serializeAws_json1_1S3Location(input.StorageLocation, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_json1_1CreateFleetInput = (input: CreateFleetInput, context: __SerdeContext): any => { return { - ...(input.BuildId !== undefined && { BuildId: input.BuildId }), - ...(input.CertificateConfiguration !== undefined && { - CertificateConfiguration: serializeAws_json1_1CertificateConfiguration(input.CertificateConfiguration, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EC2InboundPermissions !== undefined && { - EC2InboundPermissions: serializeAws_json1_1IpPermissionsList(input.EC2InboundPermissions, context), - }), - ...(input.EC2InstanceType !== undefined && { EC2InstanceType: input.EC2InstanceType }), - ...(input.FleetType !== undefined && { FleetType: input.FleetType }), - ...(input.InstanceRoleArn !== undefined && { InstanceRoleArn: input.InstanceRoleArn }), - ...(input.LogPaths !== undefined && { LogPaths: serializeAws_json1_1StringList(input.LogPaths, context) }), - ...(input.MetricGroups !== undefined && { - MetricGroups: serializeAws_json1_1MetricGroupList(input.MetricGroups, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NewGameSessionProtectionPolicy !== undefined && { - NewGameSessionProtectionPolicy: input.NewGameSessionProtectionPolicy, - }), - ...(input.PeerVpcAwsAccountId !== undefined && { PeerVpcAwsAccountId: input.PeerVpcAwsAccountId }), - ...(input.PeerVpcId !== undefined && { PeerVpcId: input.PeerVpcId }), - ...(input.ResourceCreationLimitPolicy !== undefined && { - ResourceCreationLimitPolicy: serializeAws_json1_1ResourceCreationLimitPolicy( - input.ResourceCreationLimitPolicy, - context - ), - }), - ...(input.RuntimeConfiguration !== undefined && { - RuntimeConfiguration: serializeAws_json1_1RuntimeConfiguration(input.RuntimeConfiguration, context), - }), - ...(input.ScriptId !== undefined && { ScriptId: input.ScriptId }), - ...(input.ServerLaunchParameters !== undefined && { ServerLaunchParameters: input.ServerLaunchParameters }), - ...(input.ServerLaunchPath !== undefined && { ServerLaunchPath: input.ServerLaunchPath }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.BuildId !== undefined && input.BuildId !== null && { BuildId: input.BuildId }), + ...(input.CertificateConfiguration !== undefined && + input.CertificateConfiguration !== null && { + CertificateConfiguration: serializeAws_json1_1CertificateConfiguration(input.CertificateConfiguration, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EC2InboundPermissions !== undefined && + input.EC2InboundPermissions !== null && { + EC2InboundPermissions: serializeAws_json1_1IpPermissionsList(input.EC2InboundPermissions, context), + }), + ...(input.EC2InstanceType !== undefined && + input.EC2InstanceType !== null && { EC2InstanceType: input.EC2InstanceType }), + ...(input.FleetType !== undefined && input.FleetType !== null && { FleetType: input.FleetType }), + ...(input.InstanceRoleArn !== undefined && + input.InstanceRoleArn !== null && { InstanceRoleArn: input.InstanceRoleArn }), + ...(input.LogPaths !== undefined && + input.LogPaths !== null && { LogPaths: serializeAws_json1_1StringList(input.LogPaths, context) }), + ...(input.MetricGroups !== undefined && + input.MetricGroups !== null && { + MetricGroups: serializeAws_json1_1MetricGroupList(input.MetricGroups, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NewGameSessionProtectionPolicy !== undefined && + input.NewGameSessionProtectionPolicy !== null && { + NewGameSessionProtectionPolicy: input.NewGameSessionProtectionPolicy, + }), + ...(input.PeerVpcAwsAccountId !== undefined && + input.PeerVpcAwsAccountId !== null && { PeerVpcAwsAccountId: input.PeerVpcAwsAccountId }), + ...(input.PeerVpcId !== undefined && input.PeerVpcId !== null && { PeerVpcId: input.PeerVpcId }), + ...(input.ResourceCreationLimitPolicy !== undefined && + input.ResourceCreationLimitPolicy !== null && { + ResourceCreationLimitPolicy: serializeAws_json1_1ResourceCreationLimitPolicy( + input.ResourceCreationLimitPolicy, + context + ), + }), + ...(input.RuntimeConfiguration !== undefined && + input.RuntimeConfiguration !== null && { + RuntimeConfiguration: serializeAws_json1_1RuntimeConfiguration(input.RuntimeConfiguration, context), + }), + ...(input.ScriptId !== undefined && input.ScriptId !== null && { ScriptId: input.ScriptId }), + ...(input.ServerLaunchParameters !== undefined && + input.ServerLaunchParameters !== null && { ServerLaunchParameters: input.ServerLaunchParameters }), + ...(input.ServerLaunchPath !== undefined && + input.ServerLaunchPath !== null && { ServerLaunchPath: input.ServerLaunchPath }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -9406,43 +9337,50 @@ const serializeAws_json1_1CreateGameServerGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.AutoScalingPolicy !== undefined && { - AutoScalingPolicy: serializeAws_json1_1GameServerGroupAutoScalingPolicy(input.AutoScalingPolicy, context), - }), - ...(input.BalancingStrategy !== undefined && { BalancingStrategy: input.BalancingStrategy }), - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.GameServerProtectionPolicy !== undefined && { - GameServerProtectionPolicy: input.GameServerProtectionPolicy, - }), - ...(input.InstanceDefinitions !== undefined && { - InstanceDefinitions: serializeAws_json1_1InstanceDefinitions(input.InstanceDefinitions, context), - }), - ...(input.LaunchTemplate !== undefined && { - LaunchTemplate: serializeAws_json1_1LaunchTemplateSpecification(input.LaunchTemplate, context), - }), - ...(input.MaxSize !== undefined && { MaxSize: input.MaxSize }), - ...(input.MinSize !== undefined && { MinSize: input.MinSize }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VpcSubnets !== undefined && { VpcSubnets: serializeAws_json1_1VpcSubnets(input.VpcSubnets, context) }), + ...(input.AutoScalingPolicy !== undefined && + input.AutoScalingPolicy !== null && { + AutoScalingPolicy: serializeAws_json1_1GameServerGroupAutoScalingPolicy(input.AutoScalingPolicy, context), + }), + ...(input.BalancingStrategy !== undefined && + input.BalancingStrategy !== null && { BalancingStrategy: input.BalancingStrategy }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.GameServerProtectionPolicy !== undefined && + input.GameServerProtectionPolicy !== null && { GameServerProtectionPolicy: input.GameServerProtectionPolicy }), + ...(input.InstanceDefinitions !== undefined && + input.InstanceDefinitions !== null && { + InstanceDefinitions: serializeAws_json1_1InstanceDefinitions(input.InstanceDefinitions, context), + }), + ...(input.LaunchTemplate !== undefined && + input.LaunchTemplate !== null && { + LaunchTemplate: serializeAws_json1_1LaunchTemplateSpecification(input.LaunchTemplate, context), + }), + ...(input.MaxSize !== undefined && input.MaxSize !== null && { MaxSize: input.MaxSize }), + ...(input.MinSize !== undefined && input.MinSize !== null && { MinSize: input.MinSize }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VpcSubnets !== undefined && + input.VpcSubnets !== null && { VpcSubnets: serializeAws_json1_1VpcSubnets(input.VpcSubnets, context) }), }; }; const serializeAws_json1_1CreateGameSessionInput = (input: CreateGameSessionInput, context: __SerdeContext): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), - ...(input.CreatorId !== undefined && { CreatorId: input.CreatorId }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.GameProperties !== undefined && { - GameProperties: serializeAws_json1_1GamePropertyList(input.GameProperties, context), - }), - ...(input.GameSessionData !== undefined && { GameSessionData: input.GameSessionData }), - ...(input.GameSessionId !== undefined && { GameSessionId: input.GameSessionId }), - ...(input.IdempotencyToken !== undefined && { IdempotencyToken: input.IdempotencyToken }), - ...(input.MaximumPlayerSessionCount !== undefined && { - MaximumPlayerSessionCount: input.MaximumPlayerSessionCount, - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), + ...(input.CreatorId !== undefined && input.CreatorId !== null && { CreatorId: input.CreatorId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.GameProperties !== undefined && + input.GameProperties !== null && { + GameProperties: serializeAws_json1_1GamePropertyList(input.GameProperties, context), + }), + ...(input.GameSessionData !== undefined && + input.GameSessionData !== null && { GameSessionData: input.GameSessionData }), + ...(input.GameSessionId !== undefined && input.GameSessionId !== null && { GameSessionId: input.GameSessionId }), + ...(input.IdempotencyToken !== undefined && + input.IdempotencyToken !== null && { IdempotencyToken: input.IdempotencyToken }), + ...(input.MaximumPlayerSessionCount !== undefined && + input.MaximumPlayerSessionCount !== null && { MaximumPlayerSessionCount: input.MaximumPlayerSessionCount }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -9451,15 +9389,18 @@ const serializeAws_json1_1CreateGameSessionQueueInput = ( context: __SerdeContext ): any => { return { - ...(input.Destinations !== undefined && { - Destinations: serializeAws_json1_1GameSessionQueueDestinationList(input.Destinations, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PlayerLatencyPolicies !== undefined && { - PlayerLatencyPolicies: serializeAws_json1_1PlayerLatencyPolicyList(input.PlayerLatencyPolicies, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TimeoutInSeconds !== undefined && { TimeoutInSeconds: input.TimeoutInSeconds }), + ...(input.Destinations !== undefined && + input.Destinations !== null && { + Destinations: serializeAws_json1_1GameSessionQueueDestinationList(input.Destinations, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PlayerLatencyPolicies !== undefined && + input.PlayerLatencyPolicies !== null && { + PlayerLatencyPolicies: serializeAws_json1_1PlayerLatencyPolicyList(input.PlayerLatencyPolicies, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TimeoutInSeconds !== undefined && + input.TimeoutInSeconds !== null && { TimeoutInSeconds: input.TimeoutInSeconds }), }; }; @@ -9468,25 +9409,34 @@ const serializeAws_json1_1CreateMatchmakingConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptanceRequired !== undefined && { AcceptanceRequired: input.AcceptanceRequired }), - ...(input.AcceptanceTimeoutSeconds !== undefined && { AcceptanceTimeoutSeconds: input.AcceptanceTimeoutSeconds }), - ...(input.AdditionalPlayerCount !== undefined && { AdditionalPlayerCount: input.AdditionalPlayerCount }), - ...(input.BackfillMode !== undefined && { BackfillMode: input.BackfillMode }), - ...(input.CustomEventData !== undefined && { CustomEventData: input.CustomEventData }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FlexMatchMode !== undefined && { FlexMatchMode: input.FlexMatchMode }), - ...(input.GameProperties !== undefined && { - GameProperties: serializeAws_json1_1GamePropertyList(input.GameProperties, context), - }), - ...(input.GameSessionData !== undefined && { GameSessionData: input.GameSessionData }), - ...(input.GameSessionQueueArns !== undefined && { - GameSessionQueueArns: serializeAws_json1_1QueueArnsList(input.GameSessionQueueArns, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NotificationTarget !== undefined && { NotificationTarget: input.NotificationTarget }), - ...(input.RequestTimeoutSeconds !== undefined && { RequestTimeoutSeconds: input.RequestTimeoutSeconds }), - ...(input.RuleSetName !== undefined && { RuleSetName: input.RuleSetName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.AcceptanceRequired !== undefined && + input.AcceptanceRequired !== null && { AcceptanceRequired: input.AcceptanceRequired }), + ...(input.AcceptanceTimeoutSeconds !== undefined && + input.AcceptanceTimeoutSeconds !== null && { AcceptanceTimeoutSeconds: input.AcceptanceTimeoutSeconds }), + ...(input.AdditionalPlayerCount !== undefined && + input.AdditionalPlayerCount !== null && { AdditionalPlayerCount: input.AdditionalPlayerCount }), + ...(input.BackfillMode !== undefined && input.BackfillMode !== null && { BackfillMode: input.BackfillMode }), + ...(input.CustomEventData !== undefined && + input.CustomEventData !== null && { CustomEventData: input.CustomEventData }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FlexMatchMode !== undefined && input.FlexMatchMode !== null && { FlexMatchMode: input.FlexMatchMode }), + ...(input.GameProperties !== undefined && + input.GameProperties !== null && { + GameProperties: serializeAws_json1_1GamePropertyList(input.GameProperties, context), + }), + ...(input.GameSessionData !== undefined && + input.GameSessionData !== null && { GameSessionData: input.GameSessionData }), + ...(input.GameSessionQueueArns !== undefined && + input.GameSessionQueueArns !== null && { + GameSessionQueueArns: serializeAws_json1_1QueueArnsList(input.GameSessionQueueArns, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NotificationTarget !== undefined && + input.NotificationTarget !== null && { NotificationTarget: input.NotificationTarget }), + ...(input.RequestTimeoutSeconds !== undefined && + input.RequestTimeoutSeconds !== null && { RequestTimeoutSeconds: input.RequestTimeoutSeconds }), + ...(input.RuleSetName !== undefined && input.RuleSetName !== null && { RuleSetName: input.RuleSetName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -9495,9 +9445,9 @@ const serializeAws_json1_1CreateMatchmakingRuleSetInput = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RuleSetBody !== undefined && { RuleSetBody: input.RuleSetBody }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RuleSetBody !== undefined && input.RuleSetBody !== null && { RuleSetBody: input.RuleSetBody }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -9506,9 +9456,9 @@ const serializeAws_json1_1CreatePlayerSessionInput = ( context: __SerdeContext ): any => { return { - ...(input.GameSessionId !== undefined && { GameSessionId: input.GameSessionId }), - ...(input.PlayerData !== undefined && { PlayerData: input.PlayerData }), - ...(input.PlayerId !== undefined && { PlayerId: input.PlayerId }), + ...(input.GameSessionId !== undefined && input.GameSessionId !== null && { GameSessionId: input.GameSessionId }), + ...(input.PlayerData !== undefined && input.PlayerData !== null && { PlayerData: input.PlayerData }), + ...(input.PlayerId !== undefined && input.PlayerId !== null && { PlayerId: input.PlayerId }), }; }; @@ -9517,23 +9467,26 @@ const serializeAws_json1_1CreatePlayerSessionsInput = ( context: __SerdeContext ): any => { return { - ...(input.GameSessionId !== undefined && { GameSessionId: input.GameSessionId }), - ...(input.PlayerDataMap !== undefined && { - PlayerDataMap: serializeAws_json1_1PlayerDataMap(input.PlayerDataMap, context), - }), - ...(input.PlayerIds !== undefined && { PlayerIds: serializeAws_json1_1PlayerIdList(input.PlayerIds, context) }), + ...(input.GameSessionId !== undefined && input.GameSessionId !== null && { GameSessionId: input.GameSessionId }), + ...(input.PlayerDataMap !== undefined && + input.PlayerDataMap !== null && { + PlayerDataMap: serializeAws_json1_1PlayerDataMap(input.PlayerDataMap, context), + }), + ...(input.PlayerIds !== undefined && + input.PlayerIds !== null && { PlayerIds: serializeAws_json1_1PlayerIdList(input.PlayerIds, context) }), }; }; const serializeAws_json1_1CreateScriptInput = (input: CreateScriptInput, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.StorageLocation !== undefined && { - StorageLocation: serializeAws_json1_1S3Location(input.StorageLocation, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.Version !== undefined && { Version: input.Version }), - ...(input.ZipFile !== undefined && { ZipFile: context.base64Encoder(input.ZipFile) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.StorageLocation !== undefined && + input.StorageLocation !== null && { + StorageLocation: serializeAws_json1_1S3Location(input.StorageLocation, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), + ...(input.ZipFile !== undefined && input.ZipFile !== null && { ZipFile: context.base64Encoder(input.ZipFile) }), }; }; @@ -9542,8 +9495,9 @@ const serializeAws_json1_1CreateVpcPeeringAuthorizationInput = ( context: __SerdeContext ): any => { return { - ...(input.GameLiftAwsAccountId !== undefined && { GameLiftAwsAccountId: input.GameLiftAwsAccountId }), - ...(input.PeerVpcId !== undefined && { PeerVpcId: input.PeerVpcId }), + ...(input.GameLiftAwsAccountId !== undefined && + input.GameLiftAwsAccountId !== null && { GameLiftAwsAccountId: input.GameLiftAwsAccountId }), + ...(input.PeerVpcId !== undefined && input.PeerVpcId !== null && { PeerVpcId: input.PeerVpcId }), }; }; @@ -9552,27 +9506,28 @@ const serializeAws_json1_1CreateVpcPeeringConnectionInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.PeerVpcAwsAccountId !== undefined && { PeerVpcAwsAccountId: input.PeerVpcAwsAccountId }), - ...(input.PeerVpcId !== undefined && { PeerVpcId: input.PeerVpcId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.PeerVpcAwsAccountId !== undefined && + input.PeerVpcAwsAccountId !== null && { PeerVpcAwsAccountId: input.PeerVpcAwsAccountId }), + ...(input.PeerVpcId !== undefined && input.PeerVpcId !== null && { PeerVpcId: input.PeerVpcId }), }; }; const serializeAws_json1_1DeleteAliasInput = (input: DeleteAliasInput, context: __SerdeContext): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), }; }; const serializeAws_json1_1DeleteBuildInput = (input: DeleteBuildInput, context: __SerdeContext): any => { return { - ...(input.BuildId !== undefined && { BuildId: input.BuildId }), + ...(input.BuildId !== undefined && input.BuildId !== null && { BuildId: input.BuildId }), }; }; const serializeAws_json1_1DeleteFleetInput = (input: DeleteFleetInput, context: __SerdeContext): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), }; }; @@ -9581,8 +9536,9 @@ const serializeAws_json1_1DeleteGameServerGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.DeleteOption !== undefined && { DeleteOption: input.DeleteOption }), - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), + ...(input.DeleteOption !== undefined && input.DeleteOption !== null && { DeleteOption: input.DeleteOption }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), }; }; @@ -9591,7 +9547,7 @@ const serializeAws_json1_1DeleteGameSessionQueueInput = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -9600,7 +9556,7 @@ const serializeAws_json1_1DeleteMatchmakingConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -9609,7 +9565,7 @@ const serializeAws_json1_1DeleteMatchmakingRuleSetInput = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -9618,14 +9574,14 @@ const serializeAws_json1_1DeleteScalingPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeleteScriptInput = (input: DeleteScriptInput, context: __SerdeContext): any => { return { - ...(input.ScriptId !== undefined && { ScriptId: input.ScriptId }), + ...(input.ScriptId !== undefined && input.ScriptId !== null && { ScriptId: input.ScriptId }), }; }; @@ -9634,8 +9590,9 @@ const serializeAws_json1_1DeleteVpcPeeringAuthorizationInput = ( context: __SerdeContext ): any => { return { - ...(input.GameLiftAwsAccountId !== undefined && { GameLiftAwsAccountId: input.GameLiftAwsAccountId }), - ...(input.PeerVpcId !== undefined && { PeerVpcId: input.PeerVpcId }), + ...(input.GameLiftAwsAccountId !== undefined && + input.GameLiftAwsAccountId !== null && { GameLiftAwsAccountId: input.GameLiftAwsAccountId }), + ...(input.PeerVpcId !== undefined && input.PeerVpcId !== null && { PeerVpcId: input.PeerVpcId }), }; }; @@ -9644,8 +9601,9 @@ const serializeAws_json1_1DeleteVpcPeeringConnectionInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.VpcPeeringConnectionId !== undefined && { VpcPeeringConnectionId: input.VpcPeeringConnectionId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.VpcPeeringConnectionId !== undefined && + input.VpcPeeringConnectionId !== null && { VpcPeeringConnectionId: input.VpcPeeringConnectionId }), }; }; @@ -9654,20 +9612,21 @@ const serializeAws_json1_1DeregisterGameServerInput = ( context: __SerdeContext ): any => { return { - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.GameServerId !== undefined && { GameServerId: input.GameServerId }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.GameServerId !== undefined && input.GameServerId !== null && { GameServerId: input.GameServerId }), }; }; const serializeAws_json1_1DescribeAliasInput = (input: DescribeAliasInput, context: __SerdeContext): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), }; }; const serializeAws_json1_1DescribeBuildInput = (input: DescribeBuildInput, context: __SerdeContext): any => { return { - ...(input.BuildId !== undefined && { BuildId: input.BuildId }), + ...(input.BuildId !== undefined && input.BuildId !== null && { BuildId: input.BuildId }), }; }; @@ -9676,7 +9635,8 @@ const serializeAws_json1_1DescribeEC2InstanceLimitsInput = ( context: __SerdeContext ): any => { return { - ...(input.EC2InstanceType !== undefined && { EC2InstanceType: input.EC2InstanceType }), + ...(input.EC2InstanceType !== undefined && + input.EC2InstanceType !== null && { EC2InstanceType: input.EC2InstanceType }), }; }; @@ -9685,9 +9645,10 @@ const serializeAws_json1_1DescribeFleetAttributesInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetIds !== undefined && { FleetIds: serializeAws_json1_1FleetIdOrArnList(input.FleetIds, context) }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FleetIds !== undefined && + input.FleetIds !== null && { FleetIds: serializeAws_json1_1FleetIdOrArnList(input.FleetIds, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -9696,9 +9657,10 @@ const serializeAws_json1_1DescribeFleetCapacityInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetIds !== undefined && { FleetIds: serializeAws_json1_1FleetIdOrArnList(input.FleetIds, context) }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FleetIds !== undefined && + input.FleetIds !== null && { FleetIds: serializeAws_json1_1FleetIdOrArnList(input.FleetIds, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -9707,11 +9669,13 @@ const serializeAws_json1_1DescribeFleetEventsInput = ( context: __SerdeContext ): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; @@ -9720,7 +9684,7 @@ const serializeAws_json1_1DescribeFleetPortSettingsInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), }; }; @@ -9729,9 +9693,10 @@ const serializeAws_json1_1DescribeFleetUtilizationInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetIds !== undefined && { FleetIds: serializeAws_json1_1FleetIdOrArnList(input.FleetIds, context) }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FleetIds !== undefined && + input.FleetIds !== null && { FleetIds: serializeAws_json1_1FleetIdOrArnList(input.FleetIds, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -9740,14 +9705,16 @@ const serializeAws_json1_1DescribeGameServerGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), }; }; const serializeAws_json1_1DescribeGameServerInput = (input: DescribeGameServerInput, context: __SerdeContext): any => { return { - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.GameServerId !== undefined && { GameServerId: input.GameServerId }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.GameServerId !== undefined && input.GameServerId !== null && { GameServerId: input.GameServerId }), }; }; @@ -9756,12 +9723,14 @@ const serializeAws_json1_1DescribeGameServerInstancesInput = ( context: __SerdeContext ): any => { return { - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.InstanceIds !== undefined && { - InstanceIds: serializeAws_json1_1GameServerInstanceIds(input.InstanceIds, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.InstanceIds !== undefined && + input.InstanceIds !== null && { + InstanceIds: serializeAws_json1_1GameServerInstanceIds(input.InstanceIds, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -9770,12 +9739,12 @@ const serializeAws_json1_1DescribeGameSessionDetailsInput = ( context: __SerdeContext ): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.GameSessionId !== undefined && { GameSessionId: input.GameSessionId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StatusFilter !== undefined && { StatusFilter: input.StatusFilter }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.GameSessionId !== undefined && input.GameSessionId !== null && { GameSessionId: input.GameSessionId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StatusFilter !== undefined && input.StatusFilter !== null && { StatusFilter: input.StatusFilter }), }; }; @@ -9784,7 +9753,7 @@ const serializeAws_json1_1DescribeGameSessionPlacementInput = ( context: __SerdeContext ): any => { return { - ...(input.PlacementId !== undefined && { PlacementId: input.PlacementId }), + ...(input.PlacementId !== undefined && input.PlacementId !== null && { PlacementId: input.PlacementId }), }; }; @@ -9793,11 +9762,10 @@ const serializeAws_json1_1DescribeGameSessionQueuesInput = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Names !== undefined && { - Names: serializeAws_json1_1GameSessionQueueNameOrArnList(input.Names, context), - }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1GameSessionQueueNameOrArnList(input.Names, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -9806,21 +9774,21 @@ const serializeAws_json1_1DescribeGameSessionsInput = ( context: __SerdeContext ): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.GameSessionId !== undefined && { GameSessionId: input.GameSessionId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StatusFilter !== undefined && { StatusFilter: input.StatusFilter }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.GameSessionId !== undefined && input.GameSessionId !== null && { GameSessionId: input.GameSessionId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StatusFilter !== undefined && input.StatusFilter !== null && { StatusFilter: input.StatusFilter }), }; }; const serializeAws_json1_1DescribeInstancesInput = (input: DescribeInstancesInput, context: __SerdeContext): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -9829,12 +9797,11 @@ const serializeAws_json1_1DescribeMatchmakingConfigurationsInput = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Names !== undefined && { - Names: serializeAws_json1_1MatchmakingConfigurationNameList(input.Names, context), - }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.RuleSetName !== undefined && { RuleSetName: input.RuleSetName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1MatchmakingConfigurationNameList(input.Names, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.RuleSetName !== undefined && input.RuleSetName !== null && { RuleSetName: input.RuleSetName }), }; }; @@ -9843,9 +9810,8 @@ const serializeAws_json1_1DescribeMatchmakingInput = ( context: __SerdeContext ): any => { return { - ...(input.TicketIds !== undefined && { - TicketIds: serializeAws_json1_1MatchmakingIdList(input.TicketIds, context), - }), + ...(input.TicketIds !== undefined && + input.TicketIds !== null && { TicketIds: serializeAws_json1_1MatchmakingIdList(input.TicketIds, context) }), }; }; @@ -9854,9 +9820,10 @@ const serializeAws_json1_1DescribeMatchmakingRuleSetsInput = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Names !== undefined && { Names: serializeAws_json1_1MatchmakingRuleSetNameList(input.Names, context) }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1MatchmakingRuleSetNameList(input.Names, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -9865,14 +9832,14 @@ const serializeAws_json1_1DescribePlayerSessionsInput = ( context: __SerdeContext ): any => { return { - ...(input.GameSessionId !== undefined && { GameSessionId: input.GameSessionId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PlayerId !== undefined && { PlayerId: input.PlayerId }), - ...(input.PlayerSessionId !== undefined && { PlayerSessionId: input.PlayerSessionId }), - ...(input.PlayerSessionStatusFilter !== undefined && { - PlayerSessionStatusFilter: input.PlayerSessionStatusFilter, - }), + ...(input.GameSessionId !== undefined && input.GameSessionId !== null && { GameSessionId: input.GameSessionId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PlayerId !== undefined && input.PlayerId !== null && { PlayerId: input.PlayerId }), + ...(input.PlayerSessionId !== undefined && + input.PlayerSessionId !== null && { PlayerSessionId: input.PlayerSessionId }), + ...(input.PlayerSessionStatusFilter !== undefined && + input.PlayerSessionStatusFilter !== null && { PlayerSessionStatusFilter: input.PlayerSessionStatusFilter }), }; }; @@ -9881,7 +9848,7 @@ const serializeAws_json1_1DescribeRuntimeConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), }; }; @@ -9890,16 +9857,16 @@ const serializeAws_json1_1DescribeScalingPoliciesInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StatusFilter !== undefined && { StatusFilter: input.StatusFilter }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StatusFilter !== undefined && input.StatusFilter !== null && { StatusFilter: input.StatusFilter }), }; }; const serializeAws_json1_1DescribeScriptInput = (input: DescribeScriptInput, context: __SerdeContext): any => { return { - ...(input.ScriptId !== undefined && { ScriptId: input.ScriptId }), + ...(input.ScriptId !== undefined && input.ScriptId !== null && { ScriptId: input.ScriptId }), }; }; @@ -9915,45 +9882,80 @@ const serializeAws_json1_1DescribeVpcPeeringConnectionsInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), }; }; const serializeAws_json1_1DesiredPlayerSession = (input: DesiredPlayerSession, context: __SerdeContext): any => { return { - ...(input.PlayerData !== undefined && { PlayerData: input.PlayerData }), - ...(input.PlayerId !== undefined && { PlayerId: input.PlayerId }), + ...(input.PlayerData !== undefined && input.PlayerData !== null && { PlayerData: input.PlayerData }), + ...(input.PlayerId !== undefined && input.PlayerId !== null && { PlayerId: input.PlayerId }), }; }; const serializeAws_json1_1DesiredPlayerSessionList = (input: DesiredPlayerSession[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DesiredPlayerSession(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DesiredPlayerSession(entry, context); + }); }; const serializeAws_json1_1FleetActionList = (input: (FleetAction | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FleetIdOrArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GameProperty = (input: GameProperty, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1GamePropertyList = (input: GameProperty[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1GameProperty(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1GameProperty(entry, context); + }); }; const serializeAws_json1_1GameServerGroupActions = ( input: (GameServerGroupAction | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GameServerGroupAutoScalingPolicy = ( @@ -9961,18 +9963,27 @@ const serializeAws_json1_1GameServerGroupAutoScalingPolicy = ( context: __SerdeContext ): any => { return { - ...(input.EstimatedInstanceWarmup !== undefined && { EstimatedInstanceWarmup: input.EstimatedInstanceWarmup }), - ...(input.TargetTrackingConfiguration !== undefined && { - TargetTrackingConfiguration: serializeAws_json1_1TargetTrackingConfiguration( - input.TargetTrackingConfiguration, - context - ), - }), + ...(input.EstimatedInstanceWarmup !== undefined && + input.EstimatedInstanceWarmup !== null && { EstimatedInstanceWarmup: input.EstimatedInstanceWarmup }), + ...(input.TargetTrackingConfiguration !== undefined && + input.TargetTrackingConfiguration !== null && { + TargetTrackingConfiguration: serializeAws_json1_1TargetTrackingConfiguration( + input.TargetTrackingConfiguration, + context + ), + }), }; }; const serializeAws_json1_1GameServerInstanceIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GameSessionQueueDestination = ( @@ -9980,7 +9991,8 @@ const serializeAws_json1_1GameSessionQueueDestination = ( context: __SerdeContext ): any => { return { - ...(input.DestinationArn !== undefined && { DestinationArn: input.DestinationArn }), + ...(input.DestinationArn !== undefined && + input.DestinationArn !== null && { DestinationArn: input.DestinationArn }), }; }; @@ -9988,11 +10000,25 @@ const serializeAws_json1_1GameSessionQueueDestinationList = ( input: GameSessionQueueDestination[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1GameSessionQueueDestination(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1GameSessionQueueDestination(entry, context); + }); }; const serializeAws_json1_1GameSessionQueueNameOrArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetGameSessionLogUrlInput = ( @@ -10000,49 +10026,66 @@ const serializeAws_json1_1GetGameSessionLogUrlInput = ( context: __SerdeContext ): any => { return { - ...(input.GameSessionId !== undefined && { GameSessionId: input.GameSessionId }), + ...(input.GameSessionId !== undefined && input.GameSessionId !== null && { GameSessionId: input.GameSessionId }), }; }; const serializeAws_json1_1GetInstanceAccessInput = (input: GetInstanceAccessInput, context: __SerdeContext): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; const serializeAws_json1_1InstanceDefinition = (input: InstanceDefinition, context: __SerdeContext): any => { return { - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.WeightedCapacity !== undefined && { WeightedCapacity: input.WeightedCapacity }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.WeightedCapacity !== undefined && + input.WeightedCapacity !== null && { WeightedCapacity: input.WeightedCapacity }), }; }; const serializeAws_json1_1InstanceDefinitions = (input: InstanceDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InstanceDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InstanceDefinition(entry, context); + }); }; const serializeAws_json1_1IpPermission = (input: IpPermission, context: __SerdeContext): any => { return { - ...(input.FromPort !== undefined && { FromPort: input.FromPort }), - ...(input.IpRange !== undefined && { IpRange: input.IpRange }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), - ...(input.ToPort !== undefined && { ToPort: input.ToPort }), + ...(input.FromPort !== undefined && input.FromPort !== null && { FromPort: input.FromPort }), + ...(input.IpRange !== undefined && input.IpRange !== null && { IpRange: input.IpRange }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), + ...(input.ToPort !== undefined && input.ToPort !== null && { ToPort: input.ToPort }), }; }; const serializeAws_json1_1IpPermissionsList = (input: IpPermission[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1IpPermission(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1IpPermission(entry, context); + }); }; const serializeAws_json1_1LatencyMap = (input: { [key: string]: number }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1LaunchTemplateSpecification = ( @@ -10050,35 +10093,38 @@ const serializeAws_json1_1LaunchTemplateSpecification = ( context: __SerdeContext ): any => { return { - ...(input.LaunchTemplateId !== undefined && { LaunchTemplateId: input.LaunchTemplateId }), - ...(input.LaunchTemplateName !== undefined && { LaunchTemplateName: input.LaunchTemplateName }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.LaunchTemplateId !== undefined && + input.LaunchTemplateId !== null && { LaunchTemplateId: input.LaunchTemplateId }), + ...(input.LaunchTemplateName !== undefined && + input.LaunchTemplateName !== null && { LaunchTemplateName: input.LaunchTemplateName }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_json1_1ListAliasesInput = (input: ListAliasesInput, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.RoutingStrategyType !== undefined && { RoutingStrategyType: input.RoutingStrategyType }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.RoutingStrategyType !== undefined && + input.RoutingStrategyType !== null && { RoutingStrategyType: input.RoutingStrategyType }), }; }; const serializeAws_json1_1ListBuildsInput = (input: ListBuildsInput, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; const serializeAws_json1_1ListFleetsInput = (input: ListFleetsInput, context: __SerdeContext): any => { return { - ...(input.BuildId !== undefined && { BuildId: input.BuildId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ScriptId !== undefined && { ScriptId: input.ScriptId }), + ...(input.BuildId !== undefined && input.BuildId !== null && { BuildId: input.BuildId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ScriptId !== undefined && input.ScriptId !== null && { ScriptId: input.ScriptId }), }; }; @@ -10087,24 +10133,25 @@ const serializeAws_json1_1ListGameServerGroupsInput = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListGameServersInput = (input: ListGameServersInput, context: __SerdeContext): any => { return { - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1ListScriptsInput = (input: ListScriptsInput, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -10113,34 +10160,64 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1MatchmakingConfigurationNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MatchmakingIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MatchmakingRuleSetNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MetricGroupList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Player = (input: Player, context: __SerdeContext): any => { return { - ...(input.LatencyInMs !== undefined && { LatencyInMs: serializeAws_json1_1LatencyMap(input.LatencyInMs, context) }), - ...(input.PlayerAttributes !== undefined && { - PlayerAttributes: serializeAws_json1_1PlayerAttributeMap(input.PlayerAttributes, context), - }), - ...(input.PlayerId !== undefined && { PlayerId: input.PlayerId }), - ...(input.Team !== undefined && { Team: input.Team }), + ...(input.LatencyInMs !== undefined && + input.LatencyInMs !== null && { LatencyInMs: serializeAws_json1_1LatencyMap(input.LatencyInMs, context) }), + ...(input.PlayerAttributes !== undefined && + input.PlayerAttributes !== null && { + PlayerAttributes: serializeAws_json1_1PlayerAttributeMap(input.PlayerAttributes, context), + }), + ...(input.PlayerId !== undefined && input.PlayerId !== null && { PlayerId: input.PlayerId }), + ...(input.Team !== undefined && input.Team !== null && { Team: input.Team }), }; }; @@ -10148,86 +10225,137 @@ const serializeAws_json1_1PlayerAttributeMap = ( input: { [key: string]: AttributeValue }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1PlayerDataMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1PlayerIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PlayerLatency = (input: PlayerLatency, context: __SerdeContext): any => { return { - ...(input.LatencyInMilliseconds !== undefined && { LatencyInMilliseconds: input.LatencyInMilliseconds }), - ...(input.PlayerId !== undefined && { PlayerId: input.PlayerId }), - ...(input.RegionIdentifier !== undefined && { RegionIdentifier: input.RegionIdentifier }), + ...(input.LatencyInMilliseconds !== undefined && + input.LatencyInMilliseconds !== null && { LatencyInMilliseconds: input.LatencyInMilliseconds }), + ...(input.PlayerId !== undefined && input.PlayerId !== null && { PlayerId: input.PlayerId }), + ...(input.RegionIdentifier !== undefined && + input.RegionIdentifier !== null && { RegionIdentifier: input.RegionIdentifier }), }; }; const serializeAws_json1_1PlayerLatencyList = (input: PlayerLatency[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PlayerLatency(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PlayerLatency(entry, context); + }); }; const serializeAws_json1_1PlayerLatencyPolicy = (input: PlayerLatencyPolicy, context: __SerdeContext): any => { return { - ...(input.MaximumIndividualPlayerLatencyMilliseconds !== undefined && { - MaximumIndividualPlayerLatencyMilliseconds: input.MaximumIndividualPlayerLatencyMilliseconds, - }), - ...(input.PolicyDurationSeconds !== undefined && { PolicyDurationSeconds: input.PolicyDurationSeconds }), + ...(input.MaximumIndividualPlayerLatencyMilliseconds !== undefined && + input.MaximumIndividualPlayerLatencyMilliseconds !== null && { + MaximumIndividualPlayerLatencyMilliseconds: input.MaximumIndividualPlayerLatencyMilliseconds, + }), + ...(input.PolicyDurationSeconds !== undefined && + input.PolicyDurationSeconds !== null && { PolicyDurationSeconds: input.PolicyDurationSeconds }), }; }; const serializeAws_json1_1PlayerLatencyPolicyList = (input: PlayerLatencyPolicy[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PlayerLatencyPolicy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PlayerLatencyPolicy(entry, context); + }); }; const serializeAws_json1_1PlayerList = (input: Player[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Player(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Player(entry, context); + }); }; const serializeAws_json1_1PutScalingPolicyInput = (input: PutScalingPolicyInput, context: __SerdeContext): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.EvaluationPeriods !== undefined && { EvaluationPeriods: input.EvaluationPeriods }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), - ...(input.ScalingAdjustment !== undefined && { ScalingAdjustment: input.ScalingAdjustment }), - ...(input.ScalingAdjustmentType !== undefined && { ScalingAdjustmentType: input.ScalingAdjustmentType }), - ...(input.TargetConfiguration !== undefined && { - TargetConfiguration: serializeAws_json1_1TargetConfiguration(input.TargetConfiguration, context), - }), - ...(input.Threshold !== undefined && { Threshold: input.Threshold }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.EvaluationPeriods !== undefined && + input.EvaluationPeriods !== null && { EvaluationPeriods: input.EvaluationPeriods }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PolicyType !== undefined && input.PolicyType !== null && { PolicyType: input.PolicyType }), + ...(input.ScalingAdjustment !== undefined && + input.ScalingAdjustment !== null && { ScalingAdjustment: input.ScalingAdjustment }), + ...(input.ScalingAdjustmentType !== undefined && + input.ScalingAdjustmentType !== null && { ScalingAdjustmentType: input.ScalingAdjustmentType }), + ...(input.TargetConfiguration !== undefined && + input.TargetConfiguration !== null && { + TargetConfiguration: serializeAws_json1_1TargetConfiguration(input.TargetConfiguration, context), + }), + ...(input.Threshold !== undefined && input.Threshold !== null && { Threshold: input.Threshold }), }; }; const serializeAws_json1_1QueueArnsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RegisterGameServerInput = (input: RegisterGameServerInput, context: __SerdeContext): any => { return { - ...(input.ConnectionInfo !== undefined && { ConnectionInfo: input.ConnectionInfo }), - ...(input.GameServerData !== undefined && { GameServerData: input.GameServerData }), - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.GameServerId !== undefined && { GameServerId: input.GameServerId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ConnectionInfo !== undefined && + input.ConnectionInfo !== null && { ConnectionInfo: input.ConnectionInfo }), + ...(input.GameServerData !== undefined && + input.GameServerData !== null && { GameServerData: input.GameServerData }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.GameServerId !== undefined && input.GameServerId !== null && { GameServerId: input.GameServerId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; @@ -10236,13 +10364,13 @@ const serializeAws_json1_1RequestUploadCredentialsInput = ( context: __SerdeContext ): any => { return { - ...(input.BuildId !== undefined && { BuildId: input.BuildId }), + ...(input.BuildId !== undefined && input.BuildId !== null && { BuildId: input.BuildId }), }; }; const serializeAws_json1_1ResolveAliasInput = (input: ResolveAliasInput, context: __SerdeContext): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), }; }; @@ -10251,10 +10379,10 @@ const serializeAws_json1_1ResourceCreationLimitPolicy = ( context: __SerdeContext ): any => { return { - ...(input.NewGameSessionsPerCreator !== undefined && { - NewGameSessionsPerCreator: input.NewGameSessionsPerCreator, - }), - ...(input.PolicyPeriodInMinutes !== undefined && { PolicyPeriodInMinutes: input.PolicyPeriodInMinutes }), + ...(input.NewGameSessionsPerCreator !== undefined && + input.NewGameSessionsPerCreator !== null && { NewGameSessionsPerCreator: input.NewGameSessionsPerCreator }), + ...(input.PolicyPeriodInMinutes !== undefined && + input.PolicyPeriodInMinutes !== null && { PolicyPeriodInMinutes: input.PolicyPeriodInMinutes }), }; }; @@ -10263,71 +10391,87 @@ const serializeAws_json1_1ResumeGameServerGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.ResumeActions !== undefined && { - ResumeActions: serializeAws_json1_1GameServerGroupActions(input.ResumeActions, context), - }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.ResumeActions !== undefined && + input.ResumeActions !== null && { + ResumeActions: serializeAws_json1_1GameServerGroupActions(input.ResumeActions, context), + }), }; }; const serializeAws_json1_1RoutingStrategy = (input: RoutingStrategy, context: __SerdeContext): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.Message !== undefined && { Message: input.Message }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.Message !== undefined && input.Message !== null && { Message: input.Message }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1RuntimeConfiguration = (input: RuntimeConfiguration, context: __SerdeContext): any => { return { - ...(input.GameSessionActivationTimeoutSeconds !== undefined && { - GameSessionActivationTimeoutSeconds: input.GameSessionActivationTimeoutSeconds, - }), - ...(input.MaxConcurrentGameSessionActivations !== undefined && { - MaxConcurrentGameSessionActivations: input.MaxConcurrentGameSessionActivations, - }), - ...(input.ServerProcesses !== undefined && { - ServerProcesses: serializeAws_json1_1ServerProcessList(input.ServerProcesses, context), - }), + ...(input.GameSessionActivationTimeoutSeconds !== undefined && + input.GameSessionActivationTimeoutSeconds !== null && { + GameSessionActivationTimeoutSeconds: input.GameSessionActivationTimeoutSeconds, + }), + ...(input.MaxConcurrentGameSessionActivations !== undefined && + input.MaxConcurrentGameSessionActivations !== null && { + MaxConcurrentGameSessionActivations: input.MaxConcurrentGameSessionActivations, + }), + ...(input.ServerProcesses !== undefined && + input.ServerProcesses !== null && { + ServerProcesses: serializeAws_json1_1ServerProcessList(input.ServerProcesses, context), + }), }; }; const serializeAws_json1_1S3Location = (input: S3Location, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.ObjectVersion !== undefined && { ObjectVersion: input.ObjectVersion }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.ObjectVersion !== undefined && input.ObjectVersion !== null && { ObjectVersion: input.ObjectVersion }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_json1_1SearchGameSessionsInput = (input: SearchGameSessionsInput, context: __SerdeContext): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), - ...(input.FilterExpression !== undefined && { FilterExpression: input.FilterExpression }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortExpression !== undefined && { SortExpression: input.SortExpression }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), + ...(input.FilterExpression !== undefined && + input.FilterExpression !== null && { FilterExpression: input.FilterExpression }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortExpression !== undefined && + input.SortExpression !== null && { SortExpression: input.SortExpression }), }; }; const serializeAws_json1_1ServerProcess = (input: ServerProcess, context: __SerdeContext): any => { return { - ...(input.ConcurrentExecutions !== undefined && { ConcurrentExecutions: input.ConcurrentExecutions }), - ...(input.LaunchPath !== undefined && { LaunchPath: input.LaunchPath }), - ...(input.Parameters !== undefined && { Parameters: input.Parameters }), + ...(input.ConcurrentExecutions !== undefined && + input.ConcurrentExecutions !== null && { ConcurrentExecutions: input.ConcurrentExecutions }), + ...(input.LaunchPath !== undefined && input.LaunchPath !== null && { LaunchPath: input.LaunchPath }), + ...(input.Parameters !== undefined && input.Parameters !== null && { Parameters: input.Parameters }), }; }; const serializeAws_json1_1ServerProcessList = (input: ServerProcess[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ServerProcess(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServerProcess(entry, context); + }); }; const serializeAws_json1_1StartFleetActionsInput = (input: StartFleetActionsInput, context: __SerdeContext): any => { return { - ...(input.Actions !== undefined && { Actions: serializeAws_json1_1FleetActionList(input.Actions, context) }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_json1_1FleetActionList(input.Actions, context) }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), }; }; @@ -10336,46 +10480,57 @@ const serializeAws_json1_1StartGameSessionPlacementInput = ( context: __SerdeContext ): any => { return { - ...(input.DesiredPlayerSessions !== undefined && { - DesiredPlayerSessions: serializeAws_json1_1DesiredPlayerSessionList(input.DesiredPlayerSessions, context), - }), - ...(input.GameProperties !== undefined && { - GameProperties: serializeAws_json1_1GamePropertyList(input.GameProperties, context), - }), - ...(input.GameSessionData !== undefined && { GameSessionData: input.GameSessionData }), - ...(input.GameSessionName !== undefined && { GameSessionName: input.GameSessionName }), - ...(input.GameSessionQueueName !== undefined && { GameSessionQueueName: input.GameSessionQueueName }), - ...(input.MaximumPlayerSessionCount !== undefined && { - MaximumPlayerSessionCount: input.MaximumPlayerSessionCount, - }), - ...(input.PlacementId !== undefined && { PlacementId: input.PlacementId }), - ...(input.PlayerLatencies !== undefined && { - PlayerLatencies: serializeAws_json1_1PlayerLatencyList(input.PlayerLatencies, context), - }), + ...(input.DesiredPlayerSessions !== undefined && + input.DesiredPlayerSessions !== null && { + DesiredPlayerSessions: serializeAws_json1_1DesiredPlayerSessionList(input.DesiredPlayerSessions, context), + }), + ...(input.GameProperties !== undefined && + input.GameProperties !== null && { + GameProperties: serializeAws_json1_1GamePropertyList(input.GameProperties, context), + }), + ...(input.GameSessionData !== undefined && + input.GameSessionData !== null && { GameSessionData: input.GameSessionData }), + ...(input.GameSessionName !== undefined && + input.GameSessionName !== null && { GameSessionName: input.GameSessionName }), + ...(input.GameSessionQueueName !== undefined && + input.GameSessionQueueName !== null && { GameSessionQueueName: input.GameSessionQueueName }), + ...(input.MaximumPlayerSessionCount !== undefined && + input.MaximumPlayerSessionCount !== null && { MaximumPlayerSessionCount: input.MaximumPlayerSessionCount }), + ...(input.PlacementId !== undefined && input.PlacementId !== null && { PlacementId: input.PlacementId }), + ...(input.PlayerLatencies !== undefined && + input.PlayerLatencies !== null && { + PlayerLatencies: serializeAws_json1_1PlayerLatencyList(input.PlayerLatencies, context), + }), }; }; const serializeAws_json1_1StartMatchBackfillInput = (input: StartMatchBackfillInput, context: __SerdeContext): any => { return { - ...(input.ConfigurationName !== undefined && { ConfigurationName: input.ConfigurationName }), - ...(input.GameSessionArn !== undefined && { GameSessionArn: input.GameSessionArn }), - ...(input.Players !== undefined && { Players: serializeAws_json1_1PlayerList(input.Players, context) }), - ...(input.TicketId !== undefined && { TicketId: input.TicketId }), + ...(input.ConfigurationName !== undefined && + input.ConfigurationName !== null && { ConfigurationName: input.ConfigurationName }), + ...(input.GameSessionArn !== undefined && + input.GameSessionArn !== null && { GameSessionArn: input.GameSessionArn }), + ...(input.Players !== undefined && + input.Players !== null && { Players: serializeAws_json1_1PlayerList(input.Players, context) }), + ...(input.TicketId !== undefined && input.TicketId !== null && { TicketId: input.TicketId }), }; }; const serializeAws_json1_1StartMatchmakingInput = (input: StartMatchmakingInput, context: __SerdeContext): any => { return { - ...(input.ConfigurationName !== undefined && { ConfigurationName: input.ConfigurationName }), - ...(input.Players !== undefined && { Players: serializeAws_json1_1PlayerList(input.Players, context) }), - ...(input.TicketId !== undefined && { TicketId: input.TicketId }), + ...(input.ConfigurationName !== undefined && + input.ConfigurationName !== null && { ConfigurationName: input.ConfigurationName }), + ...(input.Players !== undefined && + input.Players !== null && { Players: serializeAws_json1_1PlayerList(input.Players, context) }), + ...(input.TicketId !== undefined && input.TicketId !== null && { TicketId: input.TicketId }), }; }; const serializeAws_json1_1StopFleetActionsInput = (input: StopFleetActionsInput, context: __SerdeContext): any => { return { - ...(input.Actions !== undefined && { Actions: serializeAws_json1_1FleetActionList(input.Actions, context) }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_json1_1FleetActionList(input.Actions, context) }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), }; }; @@ -10384,28 +10539,37 @@ const serializeAws_json1_1StopGameSessionPlacementInput = ( context: __SerdeContext ): any => { return { - ...(input.PlacementId !== undefined && { PlacementId: input.PlacementId }), + ...(input.PlacementId !== undefined && input.PlacementId !== null && { PlacementId: input.PlacementId }), }; }; const serializeAws_json1_1StopMatchmakingInput = (input: StopMatchmakingInput, context: __SerdeContext): any => { return { - ...(input.TicketId !== undefined && { TicketId: input.TicketId }), + ...(input.TicketId !== undefined && input.TicketId !== null && { TicketId: input.TicketId }), }; }; const serializeAws_json1_1StringDoubleMap = (input: { [key: string]: number }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SuspendGameServerGroupInput = ( @@ -10413,38 +10577,54 @@ const serializeAws_json1_1SuspendGameServerGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.SuspendActions !== undefined && { - SuspendActions: serializeAws_json1_1GameServerGroupActions(input.SuspendActions, context), - }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.SuspendActions !== undefined && + input.SuspendActions !== null && { + SuspendActions: serializeAws_json1_1GameServerGroupActions(input.SuspendActions, context), + }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TargetConfiguration = (input: TargetConfiguration, context: __SerdeContext): any => { return { - ...(input.TargetValue !== undefined && { TargetValue: input.TargetValue }), + ...(input.TargetValue !== undefined && input.TargetValue !== null && { TargetValue: input.TargetValue }), }; }; @@ -10453,33 +10633,35 @@ const serializeAws_json1_1TargetTrackingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.TargetValue !== undefined && { TargetValue: input.TargetValue }), + ...(input.TargetValue !== undefined && input.TargetValue !== null && { TargetValue: input.TargetValue }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateAliasInput = (input: UpdateAliasInput, context: __SerdeContext): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoutingStrategy !== undefined && { - RoutingStrategy: serializeAws_json1_1RoutingStrategy(input.RoutingStrategy, context), - }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoutingStrategy !== undefined && + input.RoutingStrategy !== null && { + RoutingStrategy: serializeAws_json1_1RoutingStrategy(input.RoutingStrategy, context), + }), }; }; const serializeAws_json1_1UpdateBuildInput = (input: UpdateBuildInput, context: __SerdeContext): any => { return { - ...(input.BuildId !== undefined && { BuildId: input.BuildId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.BuildId !== undefined && input.BuildId !== null && { BuildId: input.BuildId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -10488,21 +10670,24 @@ const serializeAws_json1_1UpdateFleetAttributesInput = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.MetricGroups !== undefined && { - MetricGroups: serializeAws_json1_1MetricGroupList(input.MetricGroups, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NewGameSessionProtectionPolicy !== undefined && { - NewGameSessionProtectionPolicy: input.NewGameSessionProtectionPolicy, - }), - ...(input.ResourceCreationLimitPolicy !== undefined && { - ResourceCreationLimitPolicy: serializeAws_json1_1ResourceCreationLimitPolicy( - input.ResourceCreationLimitPolicy, - context - ), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.MetricGroups !== undefined && + input.MetricGroups !== null && { + MetricGroups: serializeAws_json1_1MetricGroupList(input.MetricGroups, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NewGameSessionProtectionPolicy !== undefined && + input.NewGameSessionProtectionPolicy !== null && { + NewGameSessionProtectionPolicy: input.NewGameSessionProtectionPolicy, + }), + ...(input.ResourceCreationLimitPolicy !== undefined && + input.ResourceCreationLimitPolicy !== null && { + ResourceCreationLimitPolicy: serializeAws_json1_1ResourceCreationLimitPolicy( + input.ResourceCreationLimitPolicy, + context + ), + }), }; }; @@ -10511,10 +10696,11 @@ const serializeAws_json1_1UpdateFleetCapacityInput = ( context: __SerdeContext ): any => { return { - ...(input.DesiredInstances !== undefined && { DesiredInstances: input.DesiredInstances }), - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.MaxSize !== undefined && { MaxSize: input.MaxSize }), - ...(input.MinSize !== undefined && { MinSize: input.MinSize }), + ...(input.DesiredInstances !== undefined && + input.DesiredInstances !== null && { DesiredInstances: input.DesiredInstances }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.MaxSize !== undefined && input.MaxSize !== null && { MaxSize: input.MaxSize }), + ...(input.MinSize !== undefined && input.MinSize !== null && { MinSize: input.MinSize }), }; }; @@ -10523,16 +10709,21 @@ const serializeAws_json1_1UpdateFleetPortSettingsInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.InboundPermissionAuthorizations !== undefined && { - InboundPermissionAuthorizations: serializeAws_json1_1IpPermissionsList( - input.InboundPermissionAuthorizations, - context - ), - }), - ...(input.InboundPermissionRevocations !== undefined && { - InboundPermissionRevocations: serializeAws_json1_1IpPermissionsList(input.InboundPermissionRevocations, context), - }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.InboundPermissionAuthorizations !== undefined && + input.InboundPermissionAuthorizations !== null && { + InboundPermissionAuthorizations: serializeAws_json1_1IpPermissionsList( + input.InboundPermissionAuthorizations, + context + ), + }), + ...(input.InboundPermissionRevocations !== undefined && + input.InboundPermissionRevocations !== null && { + InboundPermissionRevocations: serializeAws_json1_1IpPermissionsList( + input.InboundPermissionRevocations, + context + ), + }), }; }; @@ -10541,39 +10732,43 @@ const serializeAws_json1_1UpdateGameServerGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.BalancingStrategy !== undefined && { BalancingStrategy: input.BalancingStrategy }), - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.GameServerProtectionPolicy !== undefined && { - GameServerProtectionPolicy: input.GameServerProtectionPolicy, - }), - ...(input.InstanceDefinitions !== undefined && { - InstanceDefinitions: serializeAws_json1_1InstanceDefinitions(input.InstanceDefinitions, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.BalancingStrategy !== undefined && + input.BalancingStrategy !== null && { BalancingStrategy: input.BalancingStrategy }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.GameServerProtectionPolicy !== undefined && + input.GameServerProtectionPolicy !== null && { GameServerProtectionPolicy: input.GameServerProtectionPolicy }), + ...(input.InstanceDefinitions !== undefined && + input.InstanceDefinitions !== null && { + InstanceDefinitions: serializeAws_json1_1InstanceDefinitions(input.InstanceDefinitions, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_json1_1UpdateGameServerInput = (input: UpdateGameServerInput, context: __SerdeContext): any => { return { - ...(input.GameServerData !== undefined && { GameServerData: input.GameServerData }), - ...(input.GameServerGroupName !== undefined && { GameServerGroupName: input.GameServerGroupName }), - ...(input.GameServerId !== undefined && { GameServerId: input.GameServerId }), - ...(input.HealthCheck !== undefined && { HealthCheck: input.HealthCheck }), - ...(input.UtilizationStatus !== undefined && { UtilizationStatus: input.UtilizationStatus }), + ...(input.GameServerData !== undefined && + input.GameServerData !== null && { GameServerData: input.GameServerData }), + ...(input.GameServerGroupName !== undefined && + input.GameServerGroupName !== null && { GameServerGroupName: input.GameServerGroupName }), + ...(input.GameServerId !== undefined && input.GameServerId !== null && { GameServerId: input.GameServerId }), + ...(input.HealthCheck !== undefined && input.HealthCheck !== null && { HealthCheck: input.HealthCheck }), + ...(input.UtilizationStatus !== undefined && + input.UtilizationStatus !== null && { UtilizationStatus: input.UtilizationStatus }), }; }; const serializeAws_json1_1UpdateGameSessionInput = (input: UpdateGameSessionInput, context: __SerdeContext): any => { return { - ...(input.GameSessionId !== undefined && { GameSessionId: input.GameSessionId }), - ...(input.MaximumPlayerSessionCount !== undefined && { - MaximumPlayerSessionCount: input.MaximumPlayerSessionCount, - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PlayerSessionCreationPolicy !== undefined && { - PlayerSessionCreationPolicy: input.PlayerSessionCreationPolicy, - }), - ...(input.ProtectionPolicy !== undefined && { ProtectionPolicy: input.ProtectionPolicy }), + ...(input.GameSessionId !== undefined && input.GameSessionId !== null && { GameSessionId: input.GameSessionId }), + ...(input.MaximumPlayerSessionCount !== undefined && + input.MaximumPlayerSessionCount !== null && { MaximumPlayerSessionCount: input.MaximumPlayerSessionCount }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PlayerSessionCreationPolicy !== undefined && + input.PlayerSessionCreationPolicy !== null && { PlayerSessionCreationPolicy: input.PlayerSessionCreationPolicy }), + ...(input.ProtectionPolicy !== undefined && + input.ProtectionPolicy !== null && { ProtectionPolicy: input.ProtectionPolicy }), }; }; @@ -10582,14 +10777,17 @@ const serializeAws_json1_1UpdateGameSessionQueueInput = ( context: __SerdeContext ): any => { return { - ...(input.Destinations !== undefined && { - Destinations: serializeAws_json1_1GameSessionQueueDestinationList(input.Destinations, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PlayerLatencyPolicies !== undefined && { - PlayerLatencyPolicies: serializeAws_json1_1PlayerLatencyPolicyList(input.PlayerLatencyPolicies, context), - }), - ...(input.TimeoutInSeconds !== undefined && { TimeoutInSeconds: input.TimeoutInSeconds }), + ...(input.Destinations !== undefined && + input.Destinations !== null && { + Destinations: serializeAws_json1_1GameSessionQueueDestinationList(input.Destinations, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PlayerLatencyPolicies !== undefined && + input.PlayerLatencyPolicies !== null && { + PlayerLatencyPolicies: serializeAws_json1_1PlayerLatencyPolicyList(input.PlayerLatencyPolicies, context), + }), + ...(input.TimeoutInSeconds !== undefined && + input.TimeoutInSeconds !== null && { TimeoutInSeconds: input.TimeoutInSeconds }), }; }; @@ -10598,24 +10796,33 @@ const serializeAws_json1_1UpdateMatchmakingConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptanceRequired !== undefined && { AcceptanceRequired: input.AcceptanceRequired }), - ...(input.AcceptanceTimeoutSeconds !== undefined && { AcceptanceTimeoutSeconds: input.AcceptanceTimeoutSeconds }), - ...(input.AdditionalPlayerCount !== undefined && { AdditionalPlayerCount: input.AdditionalPlayerCount }), - ...(input.BackfillMode !== undefined && { BackfillMode: input.BackfillMode }), - ...(input.CustomEventData !== undefined && { CustomEventData: input.CustomEventData }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FlexMatchMode !== undefined && { FlexMatchMode: input.FlexMatchMode }), - ...(input.GameProperties !== undefined && { - GameProperties: serializeAws_json1_1GamePropertyList(input.GameProperties, context), - }), - ...(input.GameSessionData !== undefined && { GameSessionData: input.GameSessionData }), - ...(input.GameSessionQueueArns !== undefined && { - GameSessionQueueArns: serializeAws_json1_1QueueArnsList(input.GameSessionQueueArns, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NotificationTarget !== undefined && { NotificationTarget: input.NotificationTarget }), - ...(input.RequestTimeoutSeconds !== undefined && { RequestTimeoutSeconds: input.RequestTimeoutSeconds }), - ...(input.RuleSetName !== undefined && { RuleSetName: input.RuleSetName }), + ...(input.AcceptanceRequired !== undefined && + input.AcceptanceRequired !== null && { AcceptanceRequired: input.AcceptanceRequired }), + ...(input.AcceptanceTimeoutSeconds !== undefined && + input.AcceptanceTimeoutSeconds !== null && { AcceptanceTimeoutSeconds: input.AcceptanceTimeoutSeconds }), + ...(input.AdditionalPlayerCount !== undefined && + input.AdditionalPlayerCount !== null && { AdditionalPlayerCount: input.AdditionalPlayerCount }), + ...(input.BackfillMode !== undefined && input.BackfillMode !== null && { BackfillMode: input.BackfillMode }), + ...(input.CustomEventData !== undefined && + input.CustomEventData !== null && { CustomEventData: input.CustomEventData }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FlexMatchMode !== undefined && input.FlexMatchMode !== null && { FlexMatchMode: input.FlexMatchMode }), + ...(input.GameProperties !== undefined && + input.GameProperties !== null && { + GameProperties: serializeAws_json1_1GamePropertyList(input.GameProperties, context), + }), + ...(input.GameSessionData !== undefined && + input.GameSessionData !== null && { GameSessionData: input.GameSessionData }), + ...(input.GameSessionQueueArns !== undefined && + input.GameSessionQueueArns !== null && { + GameSessionQueueArns: serializeAws_json1_1QueueArnsList(input.GameSessionQueueArns, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NotificationTarget !== undefined && + input.NotificationTarget !== null && { NotificationTarget: input.NotificationTarget }), + ...(input.RequestTimeoutSeconds !== undefined && + input.RequestTimeoutSeconds !== null && { RequestTimeoutSeconds: input.RequestTimeoutSeconds }), + ...(input.RuleSetName !== undefined && input.RuleSetName !== null && { RuleSetName: input.RuleSetName }), }; }; @@ -10624,22 +10831,24 @@ const serializeAws_json1_1UpdateRuntimeConfigurationInput = ( context: __SerdeContext ): any => { return { - ...(input.FleetId !== undefined && { FleetId: input.FleetId }), - ...(input.RuntimeConfiguration !== undefined && { - RuntimeConfiguration: serializeAws_json1_1RuntimeConfiguration(input.RuntimeConfiguration, context), - }), + ...(input.FleetId !== undefined && input.FleetId !== null && { FleetId: input.FleetId }), + ...(input.RuntimeConfiguration !== undefined && + input.RuntimeConfiguration !== null && { + RuntimeConfiguration: serializeAws_json1_1RuntimeConfiguration(input.RuntimeConfiguration, context), + }), }; }; const serializeAws_json1_1UpdateScriptInput = (input: UpdateScriptInput, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ScriptId !== undefined && { ScriptId: input.ScriptId }), - ...(input.StorageLocation !== undefined && { - StorageLocation: serializeAws_json1_1S3Location(input.StorageLocation, context), - }), - ...(input.Version !== undefined && { Version: input.Version }), - ...(input.ZipFile !== undefined && { ZipFile: context.base64Encoder(input.ZipFile) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ScriptId !== undefined && input.ScriptId !== null && { ScriptId: input.ScriptId }), + ...(input.StorageLocation !== undefined && + input.StorageLocation !== null && { + StorageLocation: serializeAws_json1_1S3Location(input.StorageLocation, context), + }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), + ...(input.ZipFile !== undefined && input.ZipFile !== null && { ZipFile: context.base64Encoder(input.ZipFile) }), }; }; @@ -10648,12 +10857,19 @@ const serializeAws_json1_1ValidateMatchmakingRuleSetInput = ( context: __SerdeContext ): any => { return { - ...(input.RuleSetBody !== undefined && { RuleSetBody: input.RuleSetBody }), + ...(input.RuleSetBody !== undefined && input.RuleSetBody !== null && { RuleSetBody: input.RuleSetBody }), }; }; const serializeAws_json1_1VpcSubnets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AcceptMatchOutput = (output: any, context: __SerdeContext): AcceptMatchOutput => { @@ -10682,7 +10898,14 @@ const deserializeAws_json1_1Alias = (output: any, context: __SerdeContext): Alia }; const deserializeAws_json1_1AliasList = (output: any, context: __SerdeContext): Alias[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Alias(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Alias(entry, context); + }); }; const deserializeAws_json1_1AttributeValue = (output: any, context: __SerdeContext): AttributeValue => { @@ -10725,7 +10948,14 @@ const deserializeAws_json1_1Build = (output: any, context: __SerdeContext): Buil }; const deserializeAws_json1_1BuildList = (output: any, context: __SerdeContext): Build[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Build(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Build(entry, context); + }); }; const deserializeAws_json1_1CertificateConfiguration = ( @@ -11275,7 +11505,14 @@ const deserializeAws_json1_1EC2InstanceLimit = (output: any, context: __SerdeCon }; const deserializeAws_json1_1EC2InstanceLimitList = (output: any, context: __SerdeContext): EC2InstanceLimit[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EC2InstanceLimit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EC2InstanceLimit(entry, context); + }); }; const deserializeAws_json1_1Event = (output: any, context: __SerdeContext): Event => { @@ -11294,11 +11531,25 @@ const deserializeAws_json1_1Event = (output: any, context: __SerdeContext): Even }; const deserializeAws_json1_1EventList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Event(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Event(entry, context); + }); }; const deserializeAws_json1_1FleetActionList = (output: any, context: __SerdeContext): (FleetAction | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FleetAttributes = (output: any, context: __SerdeContext): FleetAttributes => { @@ -11360,7 +11611,14 @@ const deserializeAws_json1_1FleetAttributes = (output: any, context: __SerdeCont }; const deserializeAws_json1_1FleetAttributesList = (output: any, context: __SerdeContext): FleetAttributes[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FleetAttributes(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FleetAttributes(entry, context); + }); }; const deserializeAws_json1_1FleetCapacity = (output: any, context: __SerdeContext): FleetCapacity => { @@ -11384,11 +11642,25 @@ const deserializeAws_json1_1FleetCapacityExceededException = ( }; const deserializeAws_json1_1FleetCapacityList = (output: any, context: __SerdeContext): FleetCapacity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FleetCapacity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FleetCapacity(entry, context); + }); }; const deserializeAws_json1_1FleetIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FleetUtilization = (output: any, context: __SerdeContext): FleetUtilization => { @@ -11414,7 +11686,14 @@ const deserializeAws_json1_1FleetUtilization = (output: any, context: __SerdeCon }; const deserializeAws_json1_1FleetUtilizationList = (output: any, context: __SerdeContext): FleetUtilization[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FleetUtilization(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FleetUtilization(entry, context); + }); }; const deserializeAws_json1_1GameProperty = (output: any, context: __SerdeContext): GameProperty => { @@ -11425,7 +11704,14 @@ const deserializeAws_json1_1GameProperty = (output: any, context: __SerdeContext }; const deserializeAws_json1_1GamePropertyList = (output: any, context: __SerdeContext): GameProperty[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GameProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GameProperty(entry, context); + }); }; const deserializeAws_json1_1GameServer = (output: any, context: __SerdeContext): GameServer => { @@ -11512,11 +11798,25 @@ const deserializeAws_json1_1GameServerGroupActions = ( output: any, context: __SerdeContext ): (GameServerGroupAction | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1GameServerGroups = (output: any, context: __SerdeContext): GameServerGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GameServerGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GameServerGroup(entry, context); + }); }; const deserializeAws_json1_1GameServerInstance = (output: any, context: __SerdeContext): GameServerInstance => { @@ -11536,11 +11836,25 @@ const deserializeAws_json1_1GameServerInstance = (output: any, context: __SerdeC }; const deserializeAws_json1_1GameServerInstances = (output: any, context: __SerdeContext): GameServerInstance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GameServerInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GameServerInstance(entry, context); + }); }; const deserializeAws_json1_1GameServers = (output: any, context: __SerdeContext): GameServer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GameServer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GameServer(entry, context); + }); }; const deserializeAws_json1_1GameSession = (output: any, context: __SerdeContext): GameSession => { @@ -11616,7 +11930,14 @@ const deserializeAws_json1_1GameSessionDetail = (output: any, context: __SerdeCo }; const deserializeAws_json1_1GameSessionDetailList = (output: any, context: __SerdeContext): GameSessionDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GameSessionDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GameSessionDetail(entry, context); + }); }; const deserializeAws_json1_1GameSessionFullException = ( @@ -11629,7 +11950,14 @@ const deserializeAws_json1_1GameSessionFullException = ( }; const deserializeAws_json1_1GameSessionList = (output: any, context: __SerdeContext): GameSession[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GameSession(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GameSession(entry, context); + }); }; const deserializeAws_json1_1GameSessionPlacement = (output: any, context: __SerdeContext): GameSessionPlacement => { @@ -11716,11 +12044,25 @@ const deserializeAws_json1_1GameSessionQueueDestinationList = ( output: any, context: __SerdeContext ): GameSessionQueueDestination[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GameSessionQueueDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GameSessionQueueDestination(entry, context); + }); }; const deserializeAws_json1_1GameSessionQueueList = (output: any, context: __SerdeContext): GameSessionQueue[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GameSessionQueue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GameSessionQueue(entry, context); + }); }; const deserializeAws_json1_1GetGameSessionLogUrlOutput = ( @@ -11800,11 +12142,25 @@ const deserializeAws_json1_1InstanceDefinition = (output: any, context: __SerdeC }; const deserializeAws_json1_1InstanceDefinitions = (output: any, context: __SerdeContext): InstanceDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceDefinition(entry, context); + }); }; const deserializeAws_json1_1InstanceList = (output: any, context: __SerdeContext): Instance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Instance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Instance(entry, context); + }); }; const deserializeAws_json1_1InternalServiceException = ( @@ -11853,17 +12209,26 @@ const deserializeAws_json1_1IpPermission = (output: any, context: __SerdeContext }; const deserializeAws_json1_1IpPermissionsList = (output: any, context: __SerdeContext): IpPermission[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IpPermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IpPermission(entry, context); + }); }; const deserializeAws_json1_1LatencyMap = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -11959,7 +12324,14 @@ const deserializeAws_json1_1MatchedPlayerSessionList = ( output: any, context: __SerdeContext ): MatchedPlayerSession[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MatchedPlayerSession(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MatchedPlayerSession(entry, context); + }); }; const deserializeAws_json1_1MatchmakingConfiguration = ( @@ -12019,7 +12391,14 @@ const deserializeAws_json1_1MatchmakingConfigurationList = ( output: any, context: __SerdeContext ): MatchmakingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MatchmakingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MatchmakingConfiguration(entry, context); + }); }; const deserializeAws_json1_1MatchmakingRuleSet = (output: any, context: __SerdeContext): MatchmakingRuleSet => { @@ -12035,7 +12414,14 @@ const deserializeAws_json1_1MatchmakingRuleSet = (output: any, context: __SerdeC }; const deserializeAws_json1_1MatchmakingRuleSetList = (output: any, context: __SerdeContext): MatchmakingRuleSet[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MatchmakingRuleSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MatchmakingRuleSet(entry, context); + }); }; const deserializeAws_json1_1MatchmakingTicket = (output: any, context: __SerdeContext): MatchmakingTicket => { @@ -12073,11 +12459,25 @@ const deserializeAws_json1_1MatchmakingTicket = (output: any, context: __SerdeCo }; const deserializeAws_json1_1MatchmakingTicketList = (output: any, context: __SerdeContext): MatchmakingTicket[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MatchmakingTicket(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MatchmakingTicket(entry, context); + }); }; const deserializeAws_json1_1MetricGroupList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NotFoundException = (output: any, context: __SerdeContext): NotFoundException => { @@ -12101,7 +12501,14 @@ const deserializeAws_json1_1PlacedPlayerSession = (output: any, context: __Serde }; const deserializeAws_json1_1PlacedPlayerSessionList = (output: any, context: __SerdeContext): PlacedPlayerSession[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PlacedPlayerSession(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PlacedPlayerSession(entry, context); + }); }; const deserializeAws_json1_1Player = (output: any, context: __SerdeContext): Player => { @@ -12123,13 +12530,15 @@ const deserializeAws_json1_1PlayerAttributeMap = ( output: any, context: __SerdeContext ): { [key: string]: AttributeValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AttributeValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1AttributeValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1PlayerLatency = (output: any, context: __SerdeContext): PlayerLatency => { @@ -12145,7 +12554,14 @@ const deserializeAws_json1_1PlayerLatency = (output: any, context: __SerdeContex }; const deserializeAws_json1_1PlayerLatencyList = (output: any, context: __SerdeContext): PlayerLatency[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PlayerLatency(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PlayerLatency(entry, context); + }); }; const deserializeAws_json1_1PlayerLatencyPolicy = (output: any, context: __SerdeContext): PlayerLatencyPolicy => { @@ -12163,11 +12579,25 @@ const deserializeAws_json1_1PlayerLatencyPolicy = (output: any, context: __Serde }; const deserializeAws_json1_1PlayerLatencyPolicyList = (output: any, context: __SerdeContext): PlayerLatencyPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PlayerLatencyPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PlayerLatencyPolicy(entry, context); + }); }; const deserializeAws_json1_1PlayerList = (output: any, context: __SerdeContext): Player[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Player(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Player(entry, context); + }); }; const deserializeAws_json1_1PlayerSession = (output: any, context: __SerdeContext): PlayerSession => { @@ -12196,7 +12626,14 @@ const deserializeAws_json1_1PlayerSession = (output: any, context: __SerdeContex }; const deserializeAws_json1_1PlayerSessionList = (output: any, context: __SerdeContext): PlayerSession[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PlayerSession(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PlayerSession(entry, context); + }); }; const deserializeAws_json1_1PutScalingPolicyOutput = (output: any, context: __SerdeContext): PutScalingPolicyOutput => { @@ -12206,7 +12643,14 @@ const deserializeAws_json1_1PutScalingPolicyOutput = (output: any, context: __Se }; const deserializeAws_json1_1QueueArnsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RegisterGameServerOutput = ( @@ -12339,7 +12783,14 @@ const deserializeAws_json1_1ScalingPolicy = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ScalingPolicyList = (output: any, context: __SerdeContext): ScalingPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScalingPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScalingPolicy(entry, context); + }); }; const deserializeAws_json1_1Script = (output: any, context: __SerdeContext): Script => { @@ -12361,7 +12812,14 @@ const deserializeAws_json1_1Script = (output: any, context: __SerdeContext): Scr }; const deserializeAws_json1_1ScriptList = (output: any, context: __SerdeContext): Script[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Script(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Script(entry, context); + }); }; const deserializeAws_json1_1SearchGameSessionsOutput = ( @@ -12389,7 +12847,14 @@ const deserializeAws_json1_1ServerProcess = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ServerProcessList = (output: any, context: __SerdeContext): ServerProcess[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServerProcess(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServerProcess(entry, context); + }); }; const deserializeAws_json1_1StartFleetActionsOutput = ( @@ -12453,17 +12918,26 @@ const deserializeAws_json1_1StopMatchmakingOutput = (output: any, context: __Ser }; const deserializeAws_json1_1StringDoubleMap = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SuspendGameServerGroupOutput = ( @@ -12492,7 +12966,14 @@ const deserializeAws_json1_1TaggingFailedException = (output: any, context: __Se }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -12694,7 +13175,14 @@ const deserializeAws_json1_1VpcPeeringAuthorizationList = ( output: any, context: __SerdeContext ): VpcPeeringAuthorization[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VpcPeeringAuthorization(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VpcPeeringAuthorization(entry, context); + }); }; const deserializeAws_json1_1VpcPeeringConnection = (output: any, context: __SerdeContext): VpcPeeringConnection => { @@ -12721,7 +13209,14 @@ const deserializeAws_json1_1VpcPeeringConnectionList = ( output: any, context: __SerdeContext ): VpcPeeringConnection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VpcPeeringConnection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VpcPeeringConnection(entry, context); + }); }; const deserializeAws_json1_1VpcPeeringConnectionStatus = ( @@ -12784,3 +13279,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-glacier/protocols/Aws_restJson1.ts b/clients/client-glacier/protocols/Aws_restJson1.ts index a3a650c45b44..5b7858b399a2 100644 --- a/clients/client-glacier/protocols/Aws_restJson1.ts +++ b/clients/client-glacier/protocols/Aws_restJson1.ts @@ -128,9 +128,7 @@ export const serializeAws_restJson1AbortMultipartUploadCommand = async ( input: AbortMultipartUploadCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -176,9 +174,7 @@ export const serializeAws_restJson1AbortVaultLockCommand = async ( input: AbortVaultLockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/lock-policy"; if (input.accountId !== undefined) { const labelValue: string = input.accountId; @@ -216,7 +212,7 @@ export const serializeAws_restJson1AddTagsToVaultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/{accountId}/vaults/{vaultName}/tags"; if (input.vaultName !== undefined) { @@ -242,7 +238,7 @@ export const serializeAws_restJson1AddTagsToVaultCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -262,7 +258,6 @@ export const serializeAws_restJson1CompleteMultipartUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.archiveSize) && { "x-amz-archive-size": input.archiveSize! }), ...(isSerializableHeaderValue(input.checksum) && { "x-amz-sha256-tree-hash": input.checksum! }), }; @@ -311,9 +306,7 @@ export const serializeAws_restJson1CompleteVaultLockCommand = async ( input: CompleteVaultLockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/lock-policy/{lockId}"; if (input.lockId !== undefined) { const labelValue: string = input.lockId; @@ -359,9 +352,7 @@ export const serializeAws_restJson1CreateVaultCommand = async ( input: CreateVaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -398,9 +389,7 @@ export const serializeAws_restJson1DeleteArchiveCommand = async ( input: DeleteArchiveCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/archives/{archiveId}"; if (input.accountId !== undefined) { const labelValue: string = input.accountId; @@ -446,9 +435,7 @@ export const serializeAws_restJson1DeleteVaultCommand = async ( input: DeleteVaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -485,9 +472,7 @@ export const serializeAws_restJson1DeleteVaultAccessPolicyCommand = async ( input: DeleteVaultAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/access-policy"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -524,9 +509,7 @@ export const serializeAws_restJson1DeleteVaultNotificationsCommand = async ( input: DeleteVaultNotificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/notification-configuration"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -563,9 +546,7 @@ export const serializeAws_restJson1DescribeJobCommand = async ( input: DescribeJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/jobs/{jobId}"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -611,9 +592,7 @@ export const serializeAws_restJson1DescribeVaultCommand = async ( input: DescribeVaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -650,9 +629,7 @@ export const serializeAws_restJson1GetDataRetrievalPolicyCommand = async ( input: GetDataRetrievalPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/policies/data-retrieval"; if (input.accountId !== undefined) { const labelValue: string = input.accountId; @@ -681,7 +658,6 @@ export const serializeAws_restJson1GetJobOutputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.range) && { Range: input.range! }), }; let resolvedPath = "/{accountId}/vaults/{vaultName}/jobs/{jobId}/output"; @@ -729,9 +705,7 @@ export const serializeAws_restJson1GetVaultAccessPolicyCommand = async ( input: GetVaultAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/access-policy"; if (input.accountId !== undefined) { const labelValue: string = input.accountId; @@ -768,9 +742,7 @@ export const serializeAws_restJson1GetVaultLockCommand = async ( input: GetVaultLockCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/lock-policy"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -807,9 +779,7 @@ export const serializeAws_restJson1GetVaultNotificationsCommand = async ( input: GetVaultNotificationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/notification-configuration"; if (input.accountId !== undefined) { const labelValue: string = input.accountId; @@ -847,7 +817,7 @@ export const serializeAws_restJson1InitiateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/{accountId}/vaults/{vaultName}/jobs"; if (input.accountId !== undefined) { @@ -893,7 +863,6 @@ export const serializeAws_restJson1InitiateMultipartUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.archiveDescription) && { "x-amz-archive-description": input.archiveDescription!, }), @@ -936,7 +905,7 @@ export const serializeAws_restJson1InitiateVaultLockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/{accountId}/vaults/{vaultName}/lock-policy"; if (input.accountId !== undefined) { @@ -981,9 +950,7 @@ export const serializeAws_restJson1ListJobsCommand = async ( input: ListJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/jobs"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -1027,9 +994,7 @@ export const serializeAws_restJson1ListMultipartUploadsCommand = async ( input: ListMultipartUploadsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/multipart-uploads"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -1071,9 +1036,7 @@ export const serializeAws_restJson1ListPartsCommand = async ( input: ListPartsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}"; if (input.uploadId !== undefined) { const labelValue: string = input.uploadId; @@ -1124,9 +1087,7 @@ export const serializeAws_restJson1ListProvisionedCapacityCommand = async ( input: ListProvisionedCapacityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/provisioned-capacity"; if (input.accountId !== undefined) { const labelValue: string = input.accountId; @@ -1154,9 +1115,7 @@ export const serializeAws_restJson1ListTagsForVaultCommand = async ( input: ListTagsForVaultCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults/{vaultName}/tags"; if (input.vaultName !== undefined) { const labelValue: string = input.vaultName; @@ -1193,9 +1152,7 @@ export const serializeAws_restJson1ListVaultsCommand = async ( input: ListVaultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/vaults"; if (input.accountId !== undefined) { const labelValue: string = input.accountId; @@ -1228,9 +1185,7 @@ export const serializeAws_restJson1PurchaseProvisionedCapacityCommand = async ( input: PurchaseProvisionedCapacityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{accountId}/provisioned-capacity"; if (input.accountId !== undefined) { const labelValue: string = input.accountId; @@ -1259,7 +1214,7 @@ export const serializeAws_restJson1RemoveTagsFromVaultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/{accountId}/vaults/{vaultName}/tags"; if (input.accountId !== undefined) { @@ -1285,7 +1240,8 @@ export const serializeAws_restJson1RemoveTagsFromVaultCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1305,7 +1261,7 @@ export const serializeAws_restJson1SetDataRetrievalPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/{accountId}/policies/data-retrieval"; if (input.accountId !== undefined) { @@ -1319,7 +1275,8 @@ export const serializeAws_restJson1SetDataRetrievalPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Policy !== undefined && { Policy: serializeAws_restJson1DataRetrievalPolicy(input.Policy, context) }), + ...(input.Policy !== undefined && + input.Policy !== null && { Policy: serializeAws_restJson1DataRetrievalPolicy(input.Policy, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1338,7 +1295,7 @@ export const serializeAws_restJson1SetVaultAccessPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/{accountId}/vaults/{vaultName}/access-policy"; if (input.accountId !== undefined) { @@ -1384,7 +1341,7 @@ export const serializeAws_restJson1SetVaultNotificationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/{accountId}/vaults/{vaultName}/notification-configuration"; if (input.vaultName !== undefined) { @@ -1430,7 +1387,7 @@ export const serializeAws_restJson1UploadArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.checksum) && { "x-amz-sha256-tree-hash": input.checksum! }), ...(isSerializableHeaderValue(input.archiveDescription) && { "x-amz-archive-description": input.archiveDescription!, @@ -1476,7 +1433,7 @@ export const serializeAws_restJson1UploadMultipartPartCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.checksum) && { "x-amz-sha256-tree-hash": input.checksum! }), ...(isSerializableHeaderValue(input.range) && { "Content-Range": input.range! }), }; @@ -4497,85 +4454,113 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async ( }; const serializeAws_restJson1AccessControlPolicyList = (input: Grant[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Grant(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Grant(entry, context); + }); }; const serializeAws_restJson1CSVInput = (input: CSVInput, context: __SerdeContext): any => { return { - ...(input.Comments !== undefined && { Comments: input.Comments }), - ...(input.FieldDelimiter !== undefined && { FieldDelimiter: input.FieldDelimiter }), - ...(input.FileHeaderInfo !== undefined && { FileHeaderInfo: input.FileHeaderInfo }), - ...(input.QuoteCharacter !== undefined && { QuoteCharacter: input.QuoteCharacter }), - ...(input.QuoteEscapeCharacter !== undefined && { QuoteEscapeCharacter: input.QuoteEscapeCharacter }), - ...(input.RecordDelimiter !== undefined && { RecordDelimiter: input.RecordDelimiter }), + ...(input.Comments !== undefined && input.Comments !== null && { Comments: input.Comments }), + ...(input.FieldDelimiter !== undefined && + input.FieldDelimiter !== null && { FieldDelimiter: input.FieldDelimiter }), + ...(input.FileHeaderInfo !== undefined && + input.FileHeaderInfo !== null && { FileHeaderInfo: input.FileHeaderInfo }), + ...(input.QuoteCharacter !== undefined && + input.QuoteCharacter !== null && { QuoteCharacter: input.QuoteCharacter }), + ...(input.QuoteEscapeCharacter !== undefined && + input.QuoteEscapeCharacter !== null && { QuoteEscapeCharacter: input.QuoteEscapeCharacter }), + ...(input.RecordDelimiter !== undefined && + input.RecordDelimiter !== null && { RecordDelimiter: input.RecordDelimiter }), }; }; const serializeAws_restJson1CSVOutput = (input: CSVOutput, context: __SerdeContext): any => { return { - ...(input.FieldDelimiter !== undefined && { FieldDelimiter: input.FieldDelimiter }), - ...(input.QuoteCharacter !== undefined && { QuoteCharacter: input.QuoteCharacter }), - ...(input.QuoteEscapeCharacter !== undefined && { QuoteEscapeCharacter: input.QuoteEscapeCharacter }), - ...(input.QuoteFields !== undefined && { QuoteFields: input.QuoteFields }), - ...(input.RecordDelimiter !== undefined && { RecordDelimiter: input.RecordDelimiter }), + ...(input.FieldDelimiter !== undefined && + input.FieldDelimiter !== null && { FieldDelimiter: input.FieldDelimiter }), + ...(input.QuoteCharacter !== undefined && + input.QuoteCharacter !== null && { QuoteCharacter: input.QuoteCharacter }), + ...(input.QuoteEscapeCharacter !== undefined && + input.QuoteEscapeCharacter !== null && { QuoteEscapeCharacter: input.QuoteEscapeCharacter }), + ...(input.QuoteFields !== undefined && input.QuoteFields !== null && { QuoteFields: input.QuoteFields }), + ...(input.RecordDelimiter !== undefined && + input.RecordDelimiter !== null && { RecordDelimiter: input.RecordDelimiter }), }; }; const serializeAws_restJson1DataRetrievalPolicy = (input: DataRetrievalPolicy, context: __SerdeContext): any => { return { - ...(input.Rules !== undefined && { Rules: serializeAws_restJson1DataRetrievalRulesList(input.Rules, context) }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_restJson1DataRetrievalRulesList(input.Rules, context) }), }; }; const serializeAws_restJson1DataRetrievalRule = (input: DataRetrievalRule, context: __SerdeContext): any => { return { - ...(input.BytesPerHour !== undefined && { BytesPerHour: input.BytesPerHour }), - ...(input.Strategy !== undefined && { Strategy: input.Strategy }), + ...(input.BytesPerHour !== undefined && input.BytesPerHour !== null && { BytesPerHour: input.BytesPerHour }), + ...(input.Strategy !== undefined && input.Strategy !== null && { Strategy: input.Strategy }), }; }; const serializeAws_restJson1DataRetrievalRulesList = (input: DataRetrievalRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DataRetrievalRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DataRetrievalRule(entry, context); + }); }; const serializeAws_restJson1Encryption = (input: Encryption, context: __SerdeContext): any => { return { - ...(input.EncryptionType !== undefined && { EncryptionType: input.EncryptionType }), - ...(input.KMSContext !== undefined && { KMSContext: input.KMSContext }), - ...(input.KMSKeyId !== undefined && { KMSKeyId: input.KMSKeyId }), + ...(input.EncryptionType !== undefined && + input.EncryptionType !== null && { EncryptionType: input.EncryptionType }), + ...(input.KMSContext !== undefined && input.KMSContext !== null && { KMSContext: input.KMSContext }), + ...(input.KMSKeyId !== undefined && input.KMSKeyId !== null && { KMSKeyId: input.KMSKeyId }), }; }; const serializeAws_restJson1Grant = (input: Grant, context: __SerdeContext): any => { return { - ...(input.Grantee !== undefined && { Grantee: serializeAws_restJson1Grantee(input.Grantee, context) }), - ...(input.Permission !== undefined && { Permission: input.Permission }), + ...(input.Grantee !== undefined && + input.Grantee !== null && { Grantee: serializeAws_restJson1Grantee(input.Grantee, context) }), + ...(input.Permission !== undefined && input.Permission !== null && { Permission: input.Permission }), }; }; const serializeAws_restJson1Grantee = (input: Grantee, context: __SerdeContext): any => { return { - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.EmailAddress !== undefined && { EmailAddress: input.EmailAddress }), - ...(input.ID !== undefined && { ID: input.ID }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.URI !== undefined && { URI: input.URI }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }), + ...(input.ID !== undefined && input.ID !== null && { ID: input.ID }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.URI !== undefined && input.URI !== null && { URI: input.URI }), }; }; const serializeAws_restJson1hashmap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1InputSerialization = (input: InputSerialization, context: __SerdeContext): any => { return { - ...(input.csv !== undefined && { csv: serializeAws_restJson1CSVInput(input.csv, context) }), + ...(input.csv !== undefined && input.csv !== null && { csv: serializeAws_restJson1CSVInput(input.csv, context) }), }; }; @@ -4584,106 +4569,131 @@ const serializeAws_restJson1InventoryRetrievalJobInput = ( context: __SerdeContext ): any => { return { - ...(input.EndDate !== undefined && { EndDate: input.EndDate }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.StartDate !== undefined && { StartDate: input.StartDate }), + ...(input.EndDate !== undefined && input.EndDate !== null && { EndDate: input.EndDate }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.StartDate !== undefined && input.StartDate !== null && { StartDate: input.StartDate }), }; }; const serializeAws_restJson1JobParameters = (input: JobParameters, context: __SerdeContext): any => { return { - ...(input.ArchiveId !== undefined && { ArchiveId: input.ArchiveId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.InventoryRetrievalParameters !== undefined && { - InventoryRetrievalParameters: serializeAws_restJson1InventoryRetrievalJobInput( - input.InventoryRetrievalParameters, - context - ), - }), - ...(input.OutputLocation !== undefined && { - OutputLocation: serializeAws_restJson1OutputLocation(input.OutputLocation, context), - }), - ...(input.RetrievalByteRange !== undefined && { RetrievalByteRange: input.RetrievalByteRange }), - ...(input.SNSTopic !== undefined && { SNSTopic: input.SNSTopic }), - ...(input.SelectParameters !== undefined && { - SelectParameters: serializeAws_restJson1SelectParameters(input.SelectParameters, context), - }), - ...(input.Tier !== undefined && { Tier: input.Tier }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.ArchiveId !== undefined && input.ArchiveId !== null && { ArchiveId: input.ArchiveId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.InventoryRetrievalParameters !== undefined && + input.InventoryRetrievalParameters !== null && { + InventoryRetrievalParameters: serializeAws_restJson1InventoryRetrievalJobInput( + input.InventoryRetrievalParameters, + context + ), + }), + ...(input.OutputLocation !== undefined && + input.OutputLocation !== null && { + OutputLocation: serializeAws_restJson1OutputLocation(input.OutputLocation, context), + }), + ...(input.RetrievalByteRange !== undefined && + input.RetrievalByteRange !== null && { RetrievalByteRange: input.RetrievalByteRange }), + ...(input.SNSTopic !== undefined && input.SNSTopic !== null && { SNSTopic: input.SNSTopic }), + ...(input.SelectParameters !== undefined && + input.SelectParameters !== null && { + SelectParameters: serializeAws_restJson1SelectParameters(input.SelectParameters, context), + }), + ...(input.Tier !== undefined && input.Tier !== null && { Tier: input.Tier }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1NotificationEventList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1OutputLocation = (input: OutputLocation, context: __SerdeContext): any => { return { - ...(input.S3 !== undefined && { S3: serializeAws_restJson1S3Location(input.S3, context) }), + ...(input.S3 !== undefined && input.S3 !== null && { S3: serializeAws_restJson1S3Location(input.S3, context) }), }; }; const serializeAws_restJson1OutputSerialization = (input: OutputSerialization, context: __SerdeContext): any => { return { - ...(input.csv !== undefined && { csv: serializeAws_restJson1CSVOutput(input.csv, context) }), + ...(input.csv !== undefined && input.csv !== null && { csv: serializeAws_restJson1CSVOutput(input.csv, context) }), }; }; const serializeAws_restJson1S3Location = (input: S3Location, context: __SerdeContext): any => { return { - ...(input.AccessControlList !== undefined && { - AccessControlList: serializeAws_restJson1AccessControlPolicyList(input.AccessControlList, context), - }), - ...(input.BucketName !== undefined && { BucketName: input.BucketName }), - ...(input.CannedACL !== undefined && { CannedACL: input.CannedACL }), - ...(input.Encryption !== undefined && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.StorageClass !== undefined && { StorageClass: input.StorageClass }), - ...(input.Tagging !== undefined && { Tagging: serializeAws_restJson1hashmap(input.Tagging, context) }), - ...(input.UserMetadata !== undefined && { - UserMetadata: serializeAws_restJson1hashmap(input.UserMetadata, context), - }), + ...(input.AccessControlList !== undefined && + input.AccessControlList !== null && { + AccessControlList: serializeAws_restJson1AccessControlPolicyList(input.AccessControlList, context), + }), + ...(input.BucketName !== undefined && input.BucketName !== null && { BucketName: input.BucketName }), + ...(input.CannedACL !== undefined && input.CannedACL !== null && { CannedACL: input.CannedACL }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { Encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.StorageClass !== undefined && input.StorageClass !== null && { StorageClass: input.StorageClass }), + ...(input.Tagging !== undefined && + input.Tagging !== null && { Tagging: serializeAws_restJson1hashmap(input.Tagging, context) }), + ...(input.UserMetadata !== undefined && + input.UserMetadata !== null && { UserMetadata: serializeAws_restJson1hashmap(input.UserMetadata, context) }), }; }; const serializeAws_restJson1SelectParameters = (input: SelectParameters, context: __SerdeContext): any => { return { - ...(input.Expression !== undefined && { Expression: input.Expression }), - ...(input.ExpressionType !== undefined && { ExpressionType: input.ExpressionType }), - ...(input.InputSerialization !== undefined && { - InputSerialization: serializeAws_restJson1InputSerialization(input.InputSerialization, context), - }), - ...(input.OutputSerialization !== undefined && { - OutputSerialization: serializeAws_restJson1OutputSerialization(input.OutputSerialization, context), - }), + ...(input.Expression !== undefined && input.Expression !== null && { Expression: input.Expression }), + ...(input.ExpressionType !== undefined && + input.ExpressionType !== null && { ExpressionType: input.ExpressionType }), + ...(input.InputSerialization !== undefined && + input.InputSerialization !== null && { + InputSerialization: serializeAws_restJson1InputSerialization(input.InputSerialization, context), + }), + ...(input.OutputSerialization !== undefined && + input.OutputSerialization !== null && { + OutputSerialization: serializeAws_restJson1OutputSerialization(input.OutputSerialization, context), + }), }; }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1VaultAccessPolicy = (input: VaultAccessPolicy, context: __SerdeContext): any => { return { - ...(input.Policy !== undefined && { Policy: input.Policy }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), }; }; const serializeAws_restJson1VaultLockPolicy = (input: VaultLockPolicy, context: __SerdeContext): any => { return { - ...(input.Policy !== undefined && { Policy: input.Policy }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), }; }; @@ -4692,13 +4702,21 @@ const serializeAws_restJson1VaultNotificationConfig = ( context: __SerdeContext ): any => { return { - ...(input.Events !== undefined && { Events: serializeAws_restJson1NotificationEventList(input.Events, context) }), - ...(input.SNSTopic !== undefined && { SNSTopic: input.SNSTopic }), + ...(input.Events !== undefined && + input.Events !== null && { Events: serializeAws_restJson1NotificationEventList(input.Events, context) }), + ...(input.SNSTopic !== undefined && input.SNSTopic !== null && { SNSTopic: input.SNSTopic }), }; }; const deserializeAws_restJson1AccessControlPolicyList = (output: any, context: __SerdeContext): Grant[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Grant(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Grant(entry, context); + }); }; const deserializeAws_restJson1CSVInput = (output: any, context: __SerdeContext): CSVInput => { @@ -4752,7 +4770,14 @@ const deserializeAws_restJson1DataRetrievalRule = (output: any, context: __Serde }; const deserializeAws_restJson1DataRetrievalRulesList = (output: any, context: __SerdeContext): DataRetrievalRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataRetrievalRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataRetrievalRule(entry, context); + }); }; const deserializeAws_restJson1DescribeVaultOutput = (output: any, context: __SerdeContext): DescribeVaultOutput => { @@ -4852,13 +4877,15 @@ const deserializeAws_restJson1Grantee = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1hashmap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1InputSerialization = (output: any, context: __SerdeContext): InputSerialization => { @@ -4884,11 +4911,25 @@ const deserializeAws_restJson1InventoryRetrievalJobDescription = ( }; const deserializeAws_restJson1JobList = (output: any, context: __SerdeContext): GlacierJobDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GlacierJobDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GlacierJobDescription(entry, context); + }); }; const deserializeAws_restJson1NotificationEventList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1OutputLocation = (output: any, context: __SerdeContext): OutputLocation => { @@ -4910,7 +4951,14 @@ const deserializeAws_restJson1OutputSerialization = (output: any, context: __Ser }; const deserializeAws_restJson1PartList = (output: any, context: __SerdeContext): PartListElement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PartListElement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PartListElement(entry, context); + }); }; const deserializeAws_restJson1PartListElement = (output: any, context: __SerdeContext): PartListElement => { @@ -4937,7 +4985,14 @@ const deserializeAws_restJson1ProvisionedCapacityList = ( output: any, context: __SerdeContext ): ProvisionedCapacityDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProvisionedCapacityDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProvisionedCapacityDescription(entry, context); + }); }; const deserializeAws_restJson1S3Location = (output: any, context: __SerdeContext): S3Location => { @@ -4982,13 +5037,15 @@ const deserializeAws_restJson1SelectParameters = (output: any, context: __SerdeC }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1UploadListElement = (output: any, context: __SerdeContext): UploadListElement => { @@ -5009,7 +5066,14 @@ const deserializeAws_restJson1UploadListElement = (output: any, context: __Serde }; const deserializeAws_restJson1UploadsList = (output: any, context: __SerdeContext): UploadListElement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UploadListElement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UploadListElement(entry, context); + }); }; const deserializeAws_restJson1VaultAccessPolicy = (output: any, context: __SerdeContext): VaultAccessPolicy => { @@ -5019,7 +5083,14 @@ const deserializeAws_restJson1VaultAccessPolicy = (output: any, context: __Serde }; const deserializeAws_restJson1VaultList = (output: any, context: __SerdeContext): DescribeVaultOutput[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DescribeVaultOutput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DescribeVaultOutput(entry, context); + }); }; const deserializeAws_restJson1VaultNotificationConfig = ( @@ -5055,6 +5126,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-global-accelerator/protocols/Aws_json1_1.ts b/clients/client-global-accelerator/protocols/Aws_json1_1.ts index e5fee7664afa..e9b9e3060904 100644 --- a/clients/client-global-accelerator/protocols/Aws_json1_1.ts +++ b/clients/client-global-accelerator/protocols/Aws_json1_1.ts @@ -285,7 +285,7 @@ export const serializeAws_json1_1AddCustomRoutingEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.AddCustomRoutingEndpoints", }; let body: any; @@ -298,7 +298,7 @@ export const serializeAws_json1_1AdvertiseByoipCidrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.AdvertiseByoipCidr", }; let body: any; @@ -311,7 +311,7 @@ export const serializeAws_json1_1AllowCustomRoutingTrafficCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.AllowCustomRoutingTraffic", }; let body: any; @@ -324,7 +324,7 @@ export const serializeAws_json1_1CreateAcceleratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.CreateAccelerator", }; let body: any; @@ -337,7 +337,7 @@ export const serializeAws_json1_1CreateCustomRoutingAcceleratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator", }; let body: any; @@ -350,7 +350,7 @@ export const serializeAws_json1_1CreateCustomRoutingEndpointGroupCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup", }; let body: any; @@ -363,7 +363,7 @@ export const serializeAws_json1_1CreateCustomRoutingListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.CreateCustomRoutingListener", }; let body: any; @@ -376,7 +376,7 @@ export const serializeAws_json1_1CreateEndpointGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.CreateEndpointGroup", }; let body: any; @@ -389,7 +389,7 @@ export const serializeAws_json1_1CreateListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.CreateListener", }; let body: any; @@ -402,7 +402,7 @@ export const serializeAws_json1_1DeleteAcceleratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DeleteAccelerator", }; let body: any; @@ -415,7 +415,7 @@ export const serializeAws_json1_1DeleteCustomRoutingAcceleratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator", }; let body: any; @@ -428,7 +428,7 @@ export const serializeAws_json1_1DeleteCustomRoutingEndpointGroupCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup", }; let body: any; @@ -441,7 +441,7 @@ export const serializeAws_json1_1DeleteCustomRoutingListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DeleteCustomRoutingListener", }; let body: any; @@ -454,7 +454,7 @@ export const serializeAws_json1_1DeleteEndpointGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DeleteEndpointGroup", }; let body: any; @@ -467,7 +467,7 @@ export const serializeAws_json1_1DeleteListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DeleteListener", }; let body: any; @@ -480,7 +480,7 @@ export const serializeAws_json1_1DenyCustomRoutingTrafficCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DenyCustomRoutingTraffic", }; let body: any; @@ -493,7 +493,7 @@ export const serializeAws_json1_1DeprovisionByoipCidrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DeprovisionByoipCidr", }; let body: any; @@ -506,7 +506,7 @@ export const serializeAws_json1_1DescribeAcceleratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DescribeAccelerator", }; let body: any; @@ -519,7 +519,7 @@ export const serializeAws_json1_1DescribeAcceleratorAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DescribeAcceleratorAttributes", }; let body: any; @@ -532,7 +532,7 @@ export const serializeAws_json1_1DescribeCustomRoutingAcceleratorCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator", }; let body: any; @@ -545,7 +545,7 @@ export const serializeAws_json1_1DescribeCustomRoutingAcceleratorAttributesComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes", }; let body: any; @@ -558,7 +558,7 @@ export const serializeAws_json1_1DescribeCustomRoutingEndpointGroupCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup", }; let body: any; @@ -571,7 +571,7 @@ export const serializeAws_json1_1DescribeCustomRoutingListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DescribeCustomRoutingListener", }; let body: any; @@ -584,7 +584,7 @@ export const serializeAws_json1_1DescribeEndpointGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DescribeEndpointGroup", }; let body: any; @@ -597,7 +597,7 @@ export const serializeAws_json1_1DescribeListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.DescribeListener", }; let body: any; @@ -610,7 +610,7 @@ export const serializeAws_json1_1ListAcceleratorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListAccelerators", }; let body: any; @@ -623,7 +623,7 @@ export const serializeAws_json1_1ListByoipCidrsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListByoipCidrs", }; let body: any; @@ -636,7 +636,7 @@ export const serializeAws_json1_1ListCustomRoutingAcceleratorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListCustomRoutingAccelerators", }; let body: any; @@ -649,7 +649,7 @@ export const serializeAws_json1_1ListCustomRoutingEndpointGroupsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups", }; let body: any; @@ -662,7 +662,7 @@ export const serializeAws_json1_1ListCustomRoutingListenersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListCustomRoutingListeners", }; let body: any; @@ -675,7 +675,7 @@ export const serializeAws_json1_1ListCustomRoutingPortMappingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListCustomRoutingPortMappings", }; let body: any; @@ -688,7 +688,7 @@ export const serializeAws_json1_1ListCustomRoutingPortMappingsByDestinationComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination", }; let body: any; @@ -701,7 +701,7 @@ export const serializeAws_json1_1ListEndpointGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListEndpointGroups", }; let body: any; @@ -714,7 +714,7 @@ export const serializeAws_json1_1ListListenersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListListeners", }; let body: any; @@ -727,7 +727,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ListTagsForResource", }; let body: any; @@ -740,7 +740,7 @@ export const serializeAws_json1_1ProvisionByoipCidrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.ProvisionByoipCidr", }; let body: any; @@ -753,7 +753,7 @@ export const serializeAws_json1_1RemoveCustomRoutingEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints", }; let body: any; @@ -766,7 +766,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.TagResource", }; let body: any; @@ -779,7 +779,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.UntagResource", }; let body: any; @@ -792,7 +792,7 @@ export const serializeAws_json1_1UpdateAcceleratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.UpdateAccelerator", }; let body: any; @@ -805,7 +805,7 @@ export const serializeAws_json1_1UpdateAcceleratorAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.UpdateAcceleratorAttributes", }; let body: any; @@ -818,7 +818,7 @@ export const serializeAws_json1_1UpdateCustomRoutingAcceleratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator", }; let body: any; @@ -831,7 +831,7 @@ export const serializeAws_json1_1UpdateCustomRoutingAcceleratorAttributesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes", }; let body: any; @@ -844,7 +844,7 @@ export const serializeAws_json1_1UpdateCustomRoutingListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.UpdateCustomRoutingListener", }; let body: any; @@ -857,7 +857,7 @@ export const serializeAws_json1_1UpdateEndpointGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.UpdateEndpointGroup", }; let body: any; @@ -870,7 +870,7 @@ export const serializeAws_json1_1UpdateListenerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.UpdateListener", }; let body: any; @@ -883,7 +883,7 @@ export const serializeAws_json1_1WithdrawByoipCidrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "GlobalAccelerator_V20180706.WithdrawByoipCidr", }; let body: any; @@ -918,8 +918,7 @@ const deserializeAws_json1_1AddCustomRoutingEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": @@ -1021,8 +1020,7 @@ const deserializeAws_json1_1AdvertiseByoipCidrCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": @@ -1105,8 +1103,7 @@ const deserializeAws_json1_1AllowCustomRoutingTrafficCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -1168,8 +1165,7 @@ const deserializeAws_json1_1CreateAcceleratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -1239,8 +1235,7 @@ const deserializeAws_json1_1CreateCustomRoutingAcceleratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": @@ -1318,8 +1313,7 @@ const deserializeAws_json1_1CreateCustomRoutingEndpointGroupCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -1429,8 +1423,7 @@ const deserializeAws_json1_1CreateCustomRoutingListenerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -1516,8 +1509,7 @@ const deserializeAws_json1_1CreateEndpointGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -1619,8 +1611,7 @@ const deserializeAws_json1_1CreateListenerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -1703,8 +1694,7 @@ const deserializeAws_json1_1DeleteAcceleratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotDisabledException": case "com.amazonaws.globalaccelerator#AcceleratorNotDisabledException": @@ -1787,8 +1777,7 @@ const deserializeAws_json1_1DeleteCustomRoutingAcceleratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotDisabledException": case "com.amazonaws.globalaccelerator#AcceleratorNotDisabledException": @@ -1871,8 +1860,7 @@ const deserializeAws_json1_1DeleteCustomRoutingEndpointGroupCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EndpointGroupNotFoundException": case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": @@ -1939,8 +1927,7 @@ const deserializeAws_json1_1DeleteCustomRoutingListenerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociatedEndpointGroupFoundException": case "com.amazonaws.globalaccelerator#AssociatedEndpointGroupFoundException": @@ -2015,8 +2002,7 @@ const deserializeAws_json1_1DeleteEndpointGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EndpointGroupNotFoundException": case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": @@ -2083,8 +2069,7 @@ const deserializeAws_json1_1DeleteListenerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociatedEndpointGroupFoundException": case "com.amazonaws.globalaccelerator#AssociatedEndpointGroupFoundException": @@ -2159,8 +2144,7 @@ const deserializeAws_json1_1DenyCustomRoutingTrafficCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -2222,8 +2206,7 @@ const deserializeAws_json1_1DeprovisionByoipCidrCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": @@ -2309,8 +2292,7 @@ const deserializeAws_json1_1DescribeAcceleratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -2380,8 +2362,7 @@ const deserializeAws_json1_1DescribeAcceleratorAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -2451,8 +2432,7 @@ const deserializeAws_json1_1DescribeCustomRoutingAcceleratorCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -2522,8 +2502,7 @@ const deserializeAws_json1_1DescribeCustomRoutingAcceleratorAttributesCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -2593,8 +2572,7 @@ const deserializeAws_json1_1DescribeCustomRoutingEndpointGroupCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EndpointGroupNotFoundException": case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": @@ -2664,8 +2642,7 @@ const deserializeAws_json1_1DescribeCustomRoutingListenerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -2735,8 +2712,7 @@ const deserializeAws_json1_1DescribeEndpointGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EndpointGroupNotFoundException": case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": @@ -2806,8 +2782,7 @@ const deserializeAws_json1_1DescribeListenerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -2877,8 +2852,7 @@ const deserializeAws_json1_1ListAcceleratorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -2948,8 +2922,7 @@ const deserializeAws_json1_1ListByoipCidrsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": @@ -3027,8 +3000,7 @@ const deserializeAws_json1_1ListCustomRoutingAcceleratorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -3098,8 +3070,7 @@ const deserializeAws_json1_1ListCustomRoutingEndpointGroupsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -3177,8 +3148,7 @@ const deserializeAws_json1_1ListCustomRoutingListenersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -3256,8 +3226,7 @@ const deserializeAws_json1_1ListCustomRoutingPortMappingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -3343,8 +3312,7 @@ const deserializeAws_json1_1ListCustomRoutingPortMappingsByDestinationCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EndpointNotFoundException": case "com.amazonaws.globalaccelerator#EndpointNotFoundException": @@ -3422,8 +3390,7 @@ const deserializeAws_json1_1ListEndpointGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -3501,8 +3468,7 @@ const deserializeAws_json1_1ListListenersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -3580,8 +3546,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -3651,8 +3616,7 @@ const deserializeAws_json1_1ProvisionByoipCidrCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": @@ -3735,8 +3699,7 @@ const deserializeAws_json1_1RemoveCustomRoutingEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": @@ -3830,8 +3793,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -3901,8 +3863,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -3972,8 +3933,7 @@ const deserializeAws_json1_1UpdateAcceleratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -4043,8 +4003,7 @@ const deserializeAws_json1_1UpdateAcceleratorAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -4122,8 +4081,7 @@ const deserializeAws_json1_1UpdateCustomRoutingAcceleratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -4193,8 +4151,7 @@ const deserializeAws_json1_1UpdateCustomRoutingAcceleratorAttributesCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AcceleratorNotFoundException": case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": @@ -4272,8 +4229,7 @@ const deserializeAws_json1_1UpdateCustomRoutingListenerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -4359,8 +4315,7 @@ const deserializeAws_json1_1UpdateEndpointGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": @@ -4446,8 +4401,7 @@ const deserializeAws_json1_1UpdateListenerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": @@ -4533,8 +4487,7 @@ const deserializeAws_json1_1WithdrawByoipCidrCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": @@ -4868,13 +4821,15 @@ const serializeAws_json1_1AddCustomRoutingEndpointsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndpointConfigurations !== undefined && { - EndpointConfigurations: serializeAws_json1_1CustomRoutingEndpointConfigurations( - input.EndpointConfigurations, - context - ), - }), - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.EndpointConfigurations !== undefined && + input.EndpointConfigurations !== null && { + EndpointConfigurations: serializeAws_json1_1CustomRoutingEndpointConfigurations( + input.EndpointConfigurations, + context + ), + }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), }; }; @@ -4883,7 +4838,7 @@ const serializeAws_json1_1AdvertiseByoipCidrRequest = ( context: __SerdeContext ): any => { return { - ...(input.Cidr !== undefined && { Cidr: input.Cidr }), + ...(input.Cidr !== undefined && input.Cidr !== null && { Cidr: input.Cidr }), }; }; @@ -4892,17 +4847,19 @@ const serializeAws_json1_1AllowCustomRoutingTrafficRequest = ( context: __SerdeContext ): any => { return { - ...(input.AllowAllTrafficToEndpoint !== undefined && { - AllowAllTrafficToEndpoint: input.AllowAllTrafficToEndpoint, - }), - ...(input.DestinationAddresses !== undefined && { - DestinationAddresses: serializeAws_json1_1DestinationAddresses(input.DestinationAddresses, context), - }), - ...(input.DestinationPorts !== undefined && { - DestinationPorts: serializeAws_json1_1DestinationPorts(input.DestinationPorts, context), - }), - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), - ...(input.EndpointId !== undefined && { EndpointId: input.EndpointId }), + ...(input.AllowAllTrafficToEndpoint !== undefined && + input.AllowAllTrafficToEndpoint !== null && { AllowAllTrafficToEndpoint: input.AllowAllTrafficToEndpoint }), + ...(input.DestinationAddresses !== undefined && + input.DestinationAddresses !== null && { + DestinationAddresses: serializeAws_json1_1DestinationAddresses(input.DestinationAddresses, context), + }), + ...(input.DestinationPorts !== undefined && + input.DestinationPorts !== null && { + DestinationPorts: serializeAws_json1_1DestinationPorts(input.DestinationPorts, context), + }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.EndpointId !== undefined && input.EndpointId !== null && { EndpointId: input.EndpointId }), }; }; @@ -4911,8 +4868,8 @@ const serializeAws_json1_1CidrAuthorizationContext = ( context: __SerdeContext ): any => { return { - ...(input.Message !== undefined && { Message: input.Message }), - ...(input.Signature !== undefined && { Signature: input.Signature }), + ...(input.Message !== undefined && input.Message !== null && { Message: input.Message }), + ...(input.Signature !== undefined && input.Signature !== null && { Signature: input.Signature }), }; }; @@ -4921,14 +4878,13 @@ const serializeAws_json1_1CreateAcceleratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.IpAddressType !== undefined && { IpAddressType: input.IpAddressType }), - ...(input.IpAddresses !== undefined && { - IpAddresses: serializeAws_json1_1IpAddresses(input.IpAddresses, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.IpAddressType !== undefined && input.IpAddressType !== null && { IpAddressType: input.IpAddressType }), + ...(input.IpAddresses !== undefined && + input.IpAddresses !== null && { IpAddresses: serializeAws_json1_1IpAddresses(input.IpAddresses, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -4937,11 +4893,11 @@ const serializeAws_json1_1CreateCustomRoutingAcceleratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.IpAddressType !== undefined && { IpAddressType: input.IpAddressType }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.IpAddressType !== undefined && input.IpAddressType !== null && { IpAddressType: input.IpAddressType }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -4950,15 +4906,17 @@ const serializeAws_json1_1CreateCustomRoutingEndpointGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.DestinationConfigurations !== undefined && { - DestinationConfigurations: serializeAws_json1_1CustomRoutingDestinationConfigurations( - input.DestinationConfigurations, - context - ), - }), - ...(input.EndpointGroupRegion !== undefined && { EndpointGroupRegion: input.EndpointGroupRegion }), + ...(input.DestinationConfigurations !== undefined && + input.DestinationConfigurations !== null && { + DestinationConfigurations: serializeAws_json1_1CustomRoutingDestinationConfigurations( + input.DestinationConfigurations, + context + ), + }), + ...(input.EndpointGroupRegion !== undefined && + input.EndpointGroupRegion !== null && { EndpointGroupRegion: input.EndpointGroupRegion }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), }; }; @@ -4967,9 +4925,11 @@ const serializeAws_json1_1CreateCustomRoutingListenerRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.PortRanges !== undefined && { PortRanges: serializeAws_json1_1PortRanges(input.PortRanges, context) }), + ...(input.PortRanges !== undefined && + input.PortRanges !== null && { PortRanges: serializeAws_json1_1PortRanges(input.PortRanges, context) }), }; }; @@ -4978,33 +4938,43 @@ const serializeAws_json1_1CreateEndpointGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndpointConfigurations !== undefined && { - EndpointConfigurations: serializeAws_json1_1EndpointConfigurations(input.EndpointConfigurations, context), - }), - ...(input.EndpointGroupRegion !== undefined && { EndpointGroupRegion: input.EndpointGroupRegion }), - ...(input.HealthCheckIntervalSeconds !== undefined && { - HealthCheckIntervalSeconds: input.HealthCheckIntervalSeconds, - }), - ...(input.HealthCheckPath !== undefined && { HealthCheckPath: input.HealthCheckPath }), - ...(input.HealthCheckPort !== undefined && { HealthCheckPort: input.HealthCheckPort }), - ...(input.HealthCheckProtocol !== undefined && { HealthCheckProtocol: input.HealthCheckProtocol }), + ...(input.EndpointConfigurations !== undefined && + input.EndpointConfigurations !== null && { + EndpointConfigurations: serializeAws_json1_1EndpointConfigurations(input.EndpointConfigurations, context), + }), + ...(input.EndpointGroupRegion !== undefined && + input.EndpointGroupRegion !== null && { EndpointGroupRegion: input.EndpointGroupRegion }), + ...(input.HealthCheckIntervalSeconds !== undefined && + input.HealthCheckIntervalSeconds !== null && { HealthCheckIntervalSeconds: input.HealthCheckIntervalSeconds }), + ...(input.HealthCheckPath !== undefined && + input.HealthCheckPath !== null && { HealthCheckPath: input.HealthCheckPath }), + ...(input.HealthCheckPort !== undefined && + input.HealthCheckPort !== null && { HealthCheckPort: input.HealthCheckPort }), + ...(input.HealthCheckProtocol !== undefined && + input.HealthCheckProtocol !== null && { HealthCheckProtocol: input.HealthCheckProtocol }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), - ...(input.PortOverrides !== undefined && { - PortOverrides: serializeAws_json1_1PortOverrides(input.PortOverrides, context), - }), - ...(input.ThresholdCount !== undefined && { ThresholdCount: input.ThresholdCount }), - ...(input.TrafficDialPercentage !== undefined && { TrafficDialPercentage: input.TrafficDialPercentage }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), + ...(input.PortOverrides !== undefined && + input.PortOverrides !== null && { + PortOverrides: serializeAws_json1_1PortOverrides(input.PortOverrides, context), + }), + ...(input.ThresholdCount !== undefined && + input.ThresholdCount !== null && { ThresholdCount: input.ThresholdCount }), + ...(input.TrafficDialPercentage !== undefined && + input.TrafficDialPercentage !== null && { TrafficDialPercentage: input.TrafficDialPercentage }), }; }; const serializeAws_json1_1CreateListenerRequest = (input: CreateListenerRequest, context: __SerdeContext): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), - ...(input.ClientAffinity !== undefined && { ClientAffinity: input.ClientAffinity }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), + ...(input.ClientAffinity !== undefined && + input.ClientAffinity !== null && { ClientAffinity: input.ClientAffinity }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.PortRanges !== undefined && { PortRanges: serializeAws_json1_1PortRanges(input.PortRanges, context) }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), + ...(input.PortRanges !== undefined && + input.PortRanges !== null && { PortRanges: serializeAws_json1_1PortRanges(input.PortRanges, context) }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), }; }; @@ -5013,11 +4983,10 @@ const serializeAws_json1_1CustomRoutingDestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.FromPort !== undefined && { FromPort: input.FromPort }), - ...(input.Protocols !== undefined && { - Protocols: serializeAws_json1_1CustomRoutingProtocols(input.Protocols, context), - }), - ...(input.ToPort !== undefined && { ToPort: input.ToPort }), + ...(input.FromPort !== undefined && input.FromPort !== null && { FromPort: input.FromPort }), + ...(input.Protocols !== undefined && + input.Protocols !== null && { Protocols: serializeAws_json1_1CustomRoutingProtocols(input.Protocols, context) }), + ...(input.ToPort !== undefined && input.ToPort !== null && { ToPort: input.ToPort }), }; }; @@ -5025,7 +4994,14 @@ const serializeAws_json1_1CustomRoutingDestinationConfigurations = ( input: CustomRoutingDestinationConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CustomRoutingDestinationConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CustomRoutingDestinationConfiguration(entry, context); + }); }; const serializeAws_json1_1CustomRoutingEndpointConfiguration = ( @@ -5033,7 +5009,7 @@ const serializeAws_json1_1CustomRoutingEndpointConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.EndpointId !== undefined && { EndpointId: input.EndpointId }), + ...(input.EndpointId !== undefined && input.EndpointId !== null && { EndpointId: input.EndpointId }), }; }; @@ -5041,14 +5017,28 @@ const serializeAws_json1_1CustomRoutingEndpointConfigurations = ( input: CustomRoutingEndpointConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CustomRoutingEndpointConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CustomRoutingEndpointConfiguration(entry, context); + }); }; const serializeAws_json1_1CustomRoutingProtocols = ( input: (CustomRoutingProtocol | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteAcceleratorRequest = ( @@ -5056,7 +5046,8 @@ const serializeAws_json1_1DeleteAcceleratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), }; }; @@ -5065,7 +5056,8 @@ const serializeAws_json1_1DeleteCustomRoutingAcceleratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), }; }; @@ -5074,7 +5066,8 @@ const serializeAws_json1_1DeleteCustomRoutingEndpointGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), }; }; @@ -5083,7 +5076,7 @@ const serializeAws_json1_1DeleteCustomRoutingListenerRequest = ( context: __SerdeContext ): any => { return { - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), }; }; @@ -5092,13 +5085,14 @@ const serializeAws_json1_1DeleteEndpointGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), }; }; const serializeAws_json1_1DeleteListenerRequest = (input: DeleteListenerRequest, context: __SerdeContext): any => { return { - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), }; }; @@ -5107,15 +5101,19 @@ const serializeAws_json1_1DenyCustomRoutingTrafficRequest = ( context: __SerdeContext ): any => { return { - ...(input.DenyAllTrafficToEndpoint !== undefined && { DenyAllTrafficToEndpoint: input.DenyAllTrafficToEndpoint }), - ...(input.DestinationAddresses !== undefined && { - DestinationAddresses: serializeAws_json1_1DestinationAddresses(input.DestinationAddresses, context), - }), - ...(input.DestinationPorts !== undefined && { - DestinationPorts: serializeAws_json1_1DestinationPorts(input.DestinationPorts, context), - }), - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), - ...(input.EndpointId !== undefined && { EndpointId: input.EndpointId }), + ...(input.DenyAllTrafficToEndpoint !== undefined && + input.DenyAllTrafficToEndpoint !== null && { DenyAllTrafficToEndpoint: input.DenyAllTrafficToEndpoint }), + ...(input.DestinationAddresses !== undefined && + input.DestinationAddresses !== null && { + DestinationAddresses: serializeAws_json1_1DestinationAddresses(input.DestinationAddresses, context), + }), + ...(input.DestinationPorts !== undefined && + input.DestinationPorts !== null && { + DestinationPorts: serializeAws_json1_1DestinationPorts(input.DestinationPorts, context), + }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.EndpointId !== undefined && input.EndpointId !== null && { EndpointId: input.EndpointId }), }; }; @@ -5124,7 +5122,7 @@ const serializeAws_json1_1DeprovisionByoipCidrRequest = ( context: __SerdeContext ): any => { return { - ...(input.Cidr !== undefined && { Cidr: input.Cidr }), + ...(input.Cidr !== undefined && input.Cidr !== null && { Cidr: input.Cidr }), }; }; @@ -5133,7 +5131,8 @@ const serializeAws_json1_1DescribeAcceleratorAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), }; }; @@ -5142,7 +5141,8 @@ const serializeAws_json1_1DescribeAcceleratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), }; }; @@ -5151,7 +5151,8 @@ const serializeAws_json1_1DescribeCustomRoutingAcceleratorAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), }; }; @@ -5160,7 +5161,8 @@ const serializeAws_json1_1DescribeCustomRoutingAcceleratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), }; }; @@ -5169,7 +5171,8 @@ const serializeAws_json1_1DescribeCustomRoutingEndpointGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), }; }; @@ -5178,7 +5181,7 @@ const serializeAws_json1_1DescribeCustomRoutingListenerRequest = ( context: __SerdeContext ): any => { return { - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), }; }; @@ -5187,57 +5190,92 @@ const serializeAws_json1_1DescribeEndpointGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), }; }; const serializeAws_json1_1DescribeListenerRequest = (input: DescribeListenerRequest, context: __SerdeContext): any => { return { - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), }; }; const serializeAws_json1_1DestinationAddresses = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DestinationPorts = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EndpointConfiguration = (input: EndpointConfiguration, context: __SerdeContext): any => { return { - ...(input.ClientIPPreservationEnabled !== undefined && { - ClientIPPreservationEnabled: input.ClientIPPreservationEnabled, - }), - ...(input.EndpointId !== undefined && { EndpointId: input.EndpointId }), - ...(input.Weight !== undefined && { Weight: input.Weight }), + ...(input.ClientIPPreservationEnabled !== undefined && + input.ClientIPPreservationEnabled !== null && { ClientIPPreservationEnabled: input.ClientIPPreservationEnabled }), + ...(input.EndpointId !== undefined && input.EndpointId !== null && { EndpointId: input.EndpointId }), + ...(input.Weight !== undefined && input.Weight !== null && { Weight: input.Weight }), }; }; const serializeAws_json1_1EndpointConfigurations = (input: EndpointConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EndpointConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EndpointConfiguration(entry, context); + }); }; const serializeAws_json1_1EndpointIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IpAddresses = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListAcceleratorsRequest = (input: ListAcceleratorsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListByoipCidrsRequest = (input: ListByoipCidrsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5246,8 +5284,8 @@ const serializeAws_json1_1ListCustomRoutingAcceleratorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5256,9 +5294,9 @@ const serializeAws_json1_1ListCustomRoutingEndpointGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5267,9 +5305,10 @@ const serializeAws_json1_1ListCustomRoutingListenersRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5278,10 +5317,11 @@ const serializeAws_json1_1ListCustomRoutingPortMappingsByDestinationRequest = ( context: __SerdeContext ): any => { return { - ...(input.DestinationAddress !== undefined && { DestinationAddress: input.DestinationAddress }), - ...(input.EndpointId !== undefined && { EndpointId: input.EndpointId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DestinationAddress !== undefined && + input.DestinationAddress !== null && { DestinationAddress: input.DestinationAddress }), + ...(input.EndpointId !== undefined && input.EndpointId !== null && { EndpointId: input.EndpointId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5290,10 +5330,12 @@ const serializeAws_json1_1ListCustomRoutingPortMappingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5302,17 +5344,18 @@ const serializeAws_json1_1ListEndpointGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListListenersRequest = (input: ListListenersRequest, context: __SerdeContext): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5321,30 +5364,44 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1PortOverride = (input: PortOverride, context: __SerdeContext): any => { return { - ...(input.EndpointPort !== undefined && { EndpointPort: input.EndpointPort }), - ...(input.ListenerPort !== undefined && { ListenerPort: input.ListenerPort }), + ...(input.EndpointPort !== undefined && input.EndpointPort !== null && { EndpointPort: input.EndpointPort }), + ...(input.ListenerPort !== undefined && input.ListenerPort !== null && { ListenerPort: input.ListenerPort }), }; }; const serializeAws_json1_1PortOverrides = (input: PortOverride[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PortOverride(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PortOverride(entry, context); + }); }; const serializeAws_json1_1PortRange = (input: PortRange, context: __SerdeContext): any => { return { - ...(input.FromPort !== undefined && { FromPort: input.FromPort }), - ...(input.ToPort !== undefined && { ToPort: input.ToPort }), + ...(input.FromPort !== undefined && input.FromPort !== null && { FromPort: input.FromPort }), + ...(input.ToPort !== undefined && input.ToPort !== null && { ToPort: input.ToPort }), }; }; const serializeAws_json1_1PortRanges = (input: PortRange[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PortRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PortRange(entry, context); + }); }; const serializeAws_json1_1ProvisionByoipCidrRequest = ( @@ -5352,10 +5409,11 @@ const serializeAws_json1_1ProvisionByoipCidrRequest = ( context: __SerdeContext ): any => { return { - ...(input.Cidr !== undefined && { Cidr: input.Cidr }), - ...(input.CidrAuthorizationContext !== undefined && { - CidrAuthorizationContext: serializeAws_json1_1CidrAuthorizationContext(input.CidrAuthorizationContext, context), - }), + ...(input.Cidr !== undefined && input.Cidr !== null && { Cidr: input.Cidr }), + ...(input.CidrAuthorizationContext !== undefined && + input.CidrAuthorizationContext !== null && { + CidrAuthorizationContext: serializeAws_json1_1CidrAuthorizationContext(input.CidrAuthorizationContext, context), + }), }; }; @@ -5364,39 +5422,54 @@ const serializeAws_json1_1RemoveCustomRoutingEndpointsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), - ...(input.EndpointIds !== undefined && { - EndpointIds: serializeAws_json1_1EndpointIds(input.EndpointIds, context), - }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.EndpointIds !== undefined && + input.EndpointIds !== null && { EndpointIds: serializeAws_json1_1EndpointIds(input.EndpointIds, context) }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; @@ -5405,10 +5478,14 @@ const serializeAws_json1_1UpdateAcceleratorAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), - ...(input.FlowLogsEnabled !== undefined && { FlowLogsEnabled: input.FlowLogsEnabled }), - ...(input.FlowLogsS3Bucket !== undefined && { FlowLogsS3Bucket: input.FlowLogsS3Bucket }), - ...(input.FlowLogsS3Prefix !== undefined && { FlowLogsS3Prefix: input.FlowLogsS3Prefix }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), + ...(input.FlowLogsEnabled !== undefined && + input.FlowLogsEnabled !== null && { FlowLogsEnabled: input.FlowLogsEnabled }), + ...(input.FlowLogsS3Bucket !== undefined && + input.FlowLogsS3Bucket !== null && { FlowLogsS3Bucket: input.FlowLogsS3Bucket }), + ...(input.FlowLogsS3Prefix !== undefined && + input.FlowLogsS3Prefix !== null && { FlowLogsS3Prefix: input.FlowLogsS3Prefix }), }; }; @@ -5417,10 +5494,11 @@ const serializeAws_json1_1UpdateAcceleratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.IpAddressType !== undefined && { IpAddressType: input.IpAddressType }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.IpAddressType !== undefined && input.IpAddressType !== null && { IpAddressType: input.IpAddressType }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -5429,10 +5507,14 @@ const serializeAws_json1_1UpdateCustomRoutingAcceleratorAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), - ...(input.FlowLogsEnabled !== undefined && { FlowLogsEnabled: input.FlowLogsEnabled }), - ...(input.FlowLogsS3Bucket !== undefined && { FlowLogsS3Bucket: input.FlowLogsS3Bucket }), - ...(input.FlowLogsS3Prefix !== undefined && { FlowLogsS3Prefix: input.FlowLogsS3Prefix }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), + ...(input.FlowLogsEnabled !== undefined && + input.FlowLogsEnabled !== null && { FlowLogsEnabled: input.FlowLogsEnabled }), + ...(input.FlowLogsS3Bucket !== undefined && + input.FlowLogsS3Bucket !== null && { FlowLogsS3Bucket: input.FlowLogsS3Bucket }), + ...(input.FlowLogsS3Prefix !== undefined && + input.FlowLogsS3Prefix !== null && { FlowLogsS3Prefix: input.FlowLogsS3Prefix }), }; }; @@ -5441,10 +5523,11 @@ const serializeAws_json1_1UpdateCustomRoutingAcceleratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorArn !== undefined && { AcceleratorArn: input.AcceleratorArn }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.IpAddressType !== undefined && { IpAddressType: input.IpAddressType }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AcceleratorArn !== undefined && + input.AcceleratorArn !== null && { AcceleratorArn: input.AcceleratorArn }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.IpAddressType !== undefined && input.IpAddressType !== null && { IpAddressType: input.IpAddressType }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -5453,8 +5536,9 @@ const serializeAws_json1_1UpdateCustomRoutingListenerRequest = ( context: __SerdeContext ): any => { return { - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), - ...(input.PortRanges !== undefined && { PortRanges: serializeAws_json1_1PortRanges(input.PortRanges, context) }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), + ...(input.PortRanges !== undefined && + input.PortRanges !== null && { PortRanges: serializeAws_json1_1PortRanges(input.PortRanges, context) }), }; }; @@ -5463,30 +5547,39 @@ const serializeAws_json1_1UpdateEndpointGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndpointConfigurations !== undefined && { - EndpointConfigurations: serializeAws_json1_1EndpointConfigurations(input.EndpointConfigurations, context), - }), - ...(input.EndpointGroupArn !== undefined && { EndpointGroupArn: input.EndpointGroupArn }), - ...(input.HealthCheckIntervalSeconds !== undefined && { - HealthCheckIntervalSeconds: input.HealthCheckIntervalSeconds, - }), - ...(input.HealthCheckPath !== undefined && { HealthCheckPath: input.HealthCheckPath }), - ...(input.HealthCheckPort !== undefined && { HealthCheckPort: input.HealthCheckPort }), - ...(input.HealthCheckProtocol !== undefined && { HealthCheckProtocol: input.HealthCheckProtocol }), - ...(input.PortOverrides !== undefined && { - PortOverrides: serializeAws_json1_1PortOverrides(input.PortOverrides, context), - }), - ...(input.ThresholdCount !== undefined && { ThresholdCount: input.ThresholdCount }), - ...(input.TrafficDialPercentage !== undefined && { TrafficDialPercentage: input.TrafficDialPercentage }), + ...(input.EndpointConfigurations !== undefined && + input.EndpointConfigurations !== null && { + EndpointConfigurations: serializeAws_json1_1EndpointConfigurations(input.EndpointConfigurations, context), + }), + ...(input.EndpointGroupArn !== undefined && + input.EndpointGroupArn !== null && { EndpointGroupArn: input.EndpointGroupArn }), + ...(input.HealthCheckIntervalSeconds !== undefined && + input.HealthCheckIntervalSeconds !== null && { HealthCheckIntervalSeconds: input.HealthCheckIntervalSeconds }), + ...(input.HealthCheckPath !== undefined && + input.HealthCheckPath !== null && { HealthCheckPath: input.HealthCheckPath }), + ...(input.HealthCheckPort !== undefined && + input.HealthCheckPort !== null && { HealthCheckPort: input.HealthCheckPort }), + ...(input.HealthCheckProtocol !== undefined && + input.HealthCheckProtocol !== null && { HealthCheckProtocol: input.HealthCheckProtocol }), + ...(input.PortOverrides !== undefined && + input.PortOverrides !== null && { + PortOverrides: serializeAws_json1_1PortOverrides(input.PortOverrides, context), + }), + ...(input.ThresholdCount !== undefined && + input.ThresholdCount !== null && { ThresholdCount: input.ThresholdCount }), + ...(input.TrafficDialPercentage !== undefined && + input.TrafficDialPercentage !== null && { TrafficDialPercentage: input.TrafficDialPercentage }), }; }; const serializeAws_json1_1UpdateListenerRequest = (input: UpdateListenerRequest, context: __SerdeContext): any => { return { - ...(input.ClientAffinity !== undefined && { ClientAffinity: input.ClientAffinity }), - ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), - ...(input.PortRanges !== undefined && { PortRanges: serializeAws_json1_1PortRanges(input.PortRanges, context) }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), + ...(input.ClientAffinity !== undefined && + input.ClientAffinity !== null && { ClientAffinity: input.ClientAffinity }), + ...(input.ListenerArn !== undefined && input.ListenerArn !== null && { ListenerArn: input.ListenerArn }), + ...(input.PortRanges !== undefined && + input.PortRanges !== null && { PortRanges: serializeAws_json1_1PortRanges(input.PortRanges, context) }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), }; }; @@ -5495,7 +5588,7 @@ const serializeAws_json1_1WithdrawByoipCidrRequest = ( context: __SerdeContext ): any => { return { - ...(input.Cidr !== undefined && { Cidr: input.Cidr }), + ...(input.Cidr !== undefined && input.Cidr !== null && { Cidr: input.Cidr }), }; }; @@ -5554,7 +5647,14 @@ const deserializeAws_json1_1AcceleratorNotFoundException = ( }; const deserializeAws_json1_1Accelerators = (output: any, context: __SerdeContext): Accelerator[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Accelerator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Accelerator(entry, context); + }); }; const deserializeAws_json1_1AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => { @@ -5629,7 +5729,14 @@ const deserializeAws_json1_1ByoipCidrEvent = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ByoipCidrEvents = (output: any, context: __SerdeContext): ByoipCidrEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ByoipCidrEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ByoipCidrEvent(entry, context); + }); }; const deserializeAws_json1_1ByoipCidrNotFoundException = ( @@ -5642,7 +5749,14 @@ const deserializeAws_json1_1ByoipCidrNotFoundException = ( }; const deserializeAws_json1_1ByoipCidrs = (output: any, context: __SerdeContext): ByoipCidr[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ByoipCidr(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ByoipCidr(entry, context); + }); }; const deserializeAws_json1_1ConflictException = (output: any, context: __SerdeContext): ConflictException => { @@ -5766,7 +5880,14 @@ const deserializeAws_json1_1CustomRoutingAccelerators = ( output: any, context: __SerdeContext ): CustomRoutingAccelerator[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CustomRoutingAccelerator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CustomRoutingAccelerator(entry, context); + }); }; const deserializeAws_json1_1CustomRoutingDestinationDescription = ( @@ -5787,7 +5908,14 @@ const deserializeAws_json1_1CustomRoutingDestinationDescriptions = ( output: any, context: __SerdeContext ): CustomRoutingDestinationDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CustomRoutingDestinationDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CustomRoutingDestinationDescription(entry, context); + }); }; const deserializeAws_json1_1CustomRoutingEndpointDescription = ( @@ -5803,7 +5931,14 @@ const deserializeAws_json1_1CustomRoutingEndpointDescriptions = ( output: any, context: __SerdeContext ): CustomRoutingEndpointDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CustomRoutingEndpointDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CustomRoutingEndpointDescription(entry, context); + }); }; const deserializeAws_json1_1CustomRoutingEndpointGroup = ( @@ -5832,7 +5967,14 @@ const deserializeAws_json1_1CustomRoutingEndpointGroups = ( output: any, context: __SerdeContext ): CustomRoutingEndpointGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CustomRoutingEndpointGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CustomRoutingEndpointGroup(entry, context); + }); }; const deserializeAws_json1_1CustomRoutingListener = (output: any, context: __SerdeContext): CustomRoutingListener => { @@ -5849,14 +5991,28 @@ const deserializeAws_json1_1CustomRoutingListeners = ( output: any, context: __SerdeContext ): CustomRoutingListener[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CustomRoutingListener(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CustomRoutingListener(entry, context); + }); }; const deserializeAws_json1_1CustomRoutingProtocols = ( output: any, context: __SerdeContext ): (CustomRoutingProtocol | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeprovisionByoipCidrResponse = ( @@ -5999,7 +6155,14 @@ const deserializeAws_json1_1DestinationPortMappings = ( output: any, context: __SerdeContext ): DestinationPortMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DestinationPortMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DestinationPortMapping(entry, context); + }); }; const deserializeAws_json1_1EndpointAlreadyExistsException = ( @@ -6025,7 +6188,14 @@ const deserializeAws_json1_1EndpointDescription = (output: any, context: __Serde }; const deserializeAws_json1_1EndpointDescriptions = (output: any, context: __SerdeContext): EndpointDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EndpointDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EndpointDescription(entry, context); + }); }; const deserializeAws_json1_1EndpointGroup = (output: any, context: __SerdeContext): EndpointGroup => { @@ -6084,7 +6254,14 @@ const deserializeAws_json1_1EndpointGroupNotFoundException = ( }; const deserializeAws_json1_1EndpointGroups = (output: any, context: __SerdeContext): EndpointGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EndpointGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EndpointGroup(entry, context); + }); }; const deserializeAws_json1_1EndpointNotFoundException = ( @@ -6142,7 +6319,14 @@ const deserializeAws_json1_1InvalidPortRangeException = ( }; const deserializeAws_json1_1IpAddresses = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1IpSet = (output: any, context: __SerdeContext): IpSet => { @@ -6156,7 +6340,14 @@ const deserializeAws_json1_1IpSet = (output: any, context: __SerdeContext): IpSe }; const deserializeAws_json1_1IpSets = (output: any, context: __SerdeContext): IpSet[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IpSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IpSet(entry, context); + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -6289,7 +6480,14 @@ const deserializeAws_json1_1ListenerNotFoundException = ( }; const deserializeAws_json1_1Listeners = (output: any, context: __SerdeContext): Listener[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Listener(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Listener(entry, context); + }); }; const deserializeAws_json1_1ListListenersResponse = (output: any, context: __SerdeContext): ListListenersResponse => { @@ -6335,7 +6533,14 @@ const deserializeAws_json1_1PortMapping = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1PortMappings = (output: any, context: __SerdeContext): PortMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PortMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PortMapping(entry, context); + }); }; const deserializeAws_json1_1PortOverride = (output: any, context: __SerdeContext): PortOverride => { @@ -6346,7 +6551,14 @@ const deserializeAws_json1_1PortOverride = (output: any, context: __SerdeContext }; const deserializeAws_json1_1PortOverrides = (output: any, context: __SerdeContext): PortOverride[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PortOverride(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PortOverride(entry, context); + }); }; const deserializeAws_json1_1PortRange = (output: any, context: __SerdeContext): PortRange => { @@ -6357,11 +6569,25 @@ const deserializeAws_json1_1PortRange = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1PortRanges = (output: any, context: __SerdeContext): PortRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PortRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PortRange(entry, context); + }); }; const deserializeAws_json1_1Protocols = (output: any, context: __SerdeContext): (Protocol | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ProvisionByoipCidrResponse = ( @@ -6384,7 +6610,14 @@ const deserializeAws_json1_1SocketAddress = (output: any, context: __SerdeContex }; const deserializeAws_json1_1SocketAddresses = (output: any, context: __SerdeContext): SocketAddress[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SocketAddress(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SocketAddress(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -6399,7 +6632,14 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => { @@ -6549,3 +6789,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-glue/protocols/Aws_json1_1.ts b/clients/client-glue/protocols/Aws_json1_1.ts index e39fd985250d..96887fa7f7f8 100644 --- a/clients/client-glue/protocols/Aws_json1_1.ts +++ b/clients/client-glue/protocols/Aws_json1_1.ts @@ -805,7 +805,7 @@ export const serializeAws_json1_1BatchCreatePartitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchCreatePartition", }; let body: any; @@ -818,7 +818,7 @@ export const serializeAws_json1_1BatchDeleteConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchDeleteConnection", }; let body: any; @@ -831,7 +831,7 @@ export const serializeAws_json1_1BatchDeletePartitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchDeletePartition", }; let body: any; @@ -844,7 +844,7 @@ export const serializeAws_json1_1BatchDeleteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchDeleteTable", }; let body: any; @@ -857,7 +857,7 @@ export const serializeAws_json1_1BatchDeleteTableVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchDeleteTableVersion", }; let body: any; @@ -870,7 +870,7 @@ export const serializeAws_json1_1BatchGetCrawlersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchGetCrawlers", }; let body: any; @@ -883,7 +883,7 @@ export const serializeAws_json1_1BatchGetDevEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchGetDevEndpoints", }; let body: any; @@ -896,7 +896,7 @@ export const serializeAws_json1_1BatchGetJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchGetJobs", }; let body: any; @@ -909,7 +909,7 @@ export const serializeAws_json1_1BatchGetPartitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchGetPartition", }; let body: any; @@ -922,7 +922,7 @@ export const serializeAws_json1_1BatchGetTriggersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchGetTriggers", }; let body: any; @@ -935,7 +935,7 @@ export const serializeAws_json1_1BatchGetWorkflowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchGetWorkflows", }; let body: any; @@ -948,7 +948,7 @@ export const serializeAws_json1_1BatchStopJobRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchStopJobRun", }; let body: any; @@ -961,7 +961,7 @@ export const serializeAws_json1_1BatchUpdatePartitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.BatchUpdatePartition", }; let body: any; @@ -974,7 +974,7 @@ export const serializeAws_json1_1CancelMLTaskRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CancelMLTaskRun", }; let body: any; @@ -987,7 +987,7 @@ export const serializeAws_json1_1CheckSchemaVersionValidityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CheckSchemaVersionValidity", }; let body: any; @@ -1000,7 +1000,7 @@ export const serializeAws_json1_1CreateClassifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateClassifier", }; let body: any; @@ -1013,7 +1013,7 @@ export const serializeAws_json1_1CreateConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateConnection", }; let body: any; @@ -1026,7 +1026,7 @@ export const serializeAws_json1_1CreateCrawlerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateCrawler", }; let body: any; @@ -1039,7 +1039,7 @@ export const serializeAws_json1_1CreateDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateDatabase", }; let body: any; @@ -1052,7 +1052,7 @@ export const serializeAws_json1_1CreateDevEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateDevEndpoint", }; let body: any; @@ -1065,7 +1065,7 @@ export const serializeAws_json1_1CreateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateJob", }; let body: any; @@ -1078,7 +1078,7 @@ export const serializeAws_json1_1CreateMLTransformCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateMLTransform", }; let body: any; @@ -1091,7 +1091,7 @@ export const serializeAws_json1_1CreatePartitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreatePartition", }; let body: any; @@ -1104,7 +1104,7 @@ export const serializeAws_json1_1CreatePartitionIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreatePartitionIndex", }; let body: any; @@ -1117,7 +1117,7 @@ export const serializeAws_json1_1CreateRegistryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateRegistry", }; let body: any; @@ -1130,7 +1130,7 @@ export const serializeAws_json1_1CreateSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateSchema", }; let body: any; @@ -1143,7 +1143,7 @@ export const serializeAws_json1_1CreateScriptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateScript", }; let body: any; @@ -1156,7 +1156,7 @@ export const serializeAws_json1_1CreateSecurityConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateSecurityConfiguration", }; let body: any; @@ -1169,7 +1169,7 @@ export const serializeAws_json1_1CreateTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateTable", }; let body: any; @@ -1182,7 +1182,7 @@ export const serializeAws_json1_1CreateTriggerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateTrigger", }; let body: any; @@ -1195,7 +1195,7 @@ export const serializeAws_json1_1CreateUserDefinedFunctionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateUserDefinedFunction", }; let body: any; @@ -1208,7 +1208,7 @@ export const serializeAws_json1_1CreateWorkflowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.CreateWorkflow", }; let body: any; @@ -1221,7 +1221,7 @@ export const serializeAws_json1_1DeleteClassifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteClassifier", }; let body: any; @@ -1234,7 +1234,7 @@ export const serializeAws_json1_1DeleteColumnStatisticsForPartitionCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteColumnStatisticsForPartition", }; let body: any; @@ -1247,7 +1247,7 @@ export const serializeAws_json1_1DeleteColumnStatisticsForTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteColumnStatisticsForTable", }; let body: any; @@ -1260,7 +1260,7 @@ export const serializeAws_json1_1DeleteConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteConnection", }; let body: any; @@ -1273,7 +1273,7 @@ export const serializeAws_json1_1DeleteCrawlerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteCrawler", }; let body: any; @@ -1286,7 +1286,7 @@ export const serializeAws_json1_1DeleteDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteDatabase", }; let body: any; @@ -1299,7 +1299,7 @@ export const serializeAws_json1_1DeleteDevEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteDevEndpoint", }; let body: any; @@ -1312,7 +1312,7 @@ export const serializeAws_json1_1DeleteJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteJob", }; let body: any; @@ -1325,7 +1325,7 @@ export const serializeAws_json1_1DeleteMLTransformCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteMLTransform", }; let body: any; @@ -1338,7 +1338,7 @@ export const serializeAws_json1_1DeletePartitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeletePartition", }; let body: any; @@ -1351,7 +1351,7 @@ export const serializeAws_json1_1DeletePartitionIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeletePartitionIndex", }; let body: any; @@ -1364,7 +1364,7 @@ export const serializeAws_json1_1DeleteRegistryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteRegistry", }; let body: any; @@ -1377,7 +1377,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteResourcePolicy", }; let body: any; @@ -1390,7 +1390,7 @@ export const serializeAws_json1_1DeleteSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteSchema", }; let body: any; @@ -1403,7 +1403,7 @@ export const serializeAws_json1_1DeleteSchemaVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteSchemaVersions", }; let body: any; @@ -1416,7 +1416,7 @@ export const serializeAws_json1_1DeleteSecurityConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteSecurityConfiguration", }; let body: any; @@ -1429,7 +1429,7 @@ export const serializeAws_json1_1DeleteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteTable", }; let body: any; @@ -1442,7 +1442,7 @@ export const serializeAws_json1_1DeleteTableVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteTableVersion", }; let body: any; @@ -1455,7 +1455,7 @@ export const serializeAws_json1_1DeleteTriggerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteTrigger", }; let body: any; @@ -1468,7 +1468,7 @@ export const serializeAws_json1_1DeleteUserDefinedFunctionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteUserDefinedFunction", }; let body: any; @@ -1481,7 +1481,7 @@ export const serializeAws_json1_1DeleteWorkflowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.DeleteWorkflow", }; let body: any; @@ -1494,7 +1494,7 @@ export const serializeAws_json1_1GetCatalogImportStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetCatalogImportStatus", }; let body: any; @@ -1507,7 +1507,7 @@ export const serializeAws_json1_1GetClassifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetClassifier", }; let body: any; @@ -1520,7 +1520,7 @@ export const serializeAws_json1_1GetClassifiersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetClassifiers", }; let body: any; @@ -1533,7 +1533,7 @@ export const serializeAws_json1_1GetColumnStatisticsForPartitionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetColumnStatisticsForPartition", }; let body: any; @@ -1546,7 +1546,7 @@ export const serializeAws_json1_1GetColumnStatisticsForTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetColumnStatisticsForTable", }; let body: any; @@ -1559,7 +1559,7 @@ export const serializeAws_json1_1GetConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetConnection", }; let body: any; @@ -1572,7 +1572,7 @@ export const serializeAws_json1_1GetConnectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetConnections", }; let body: any; @@ -1585,7 +1585,7 @@ export const serializeAws_json1_1GetCrawlerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetCrawler", }; let body: any; @@ -1598,7 +1598,7 @@ export const serializeAws_json1_1GetCrawlerMetricsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetCrawlerMetrics", }; let body: any; @@ -1611,7 +1611,7 @@ export const serializeAws_json1_1GetCrawlersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetCrawlers", }; let body: any; @@ -1624,7 +1624,7 @@ export const serializeAws_json1_1GetDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetDatabase", }; let body: any; @@ -1637,7 +1637,7 @@ export const serializeAws_json1_1GetDatabasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetDatabases", }; let body: any; @@ -1650,7 +1650,7 @@ export const serializeAws_json1_1GetDataCatalogEncryptionSettingsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetDataCatalogEncryptionSettings", }; let body: any; @@ -1663,7 +1663,7 @@ export const serializeAws_json1_1GetDataflowGraphCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetDataflowGraph", }; let body: any; @@ -1676,7 +1676,7 @@ export const serializeAws_json1_1GetDevEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetDevEndpoint", }; let body: any; @@ -1689,7 +1689,7 @@ export const serializeAws_json1_1GetDevEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetDevEndpoints", }; let body: any; @@ -1702,7 +1702,7 @@ export const serializeAws_json1_1GetJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetJob", }; let body: any; @@ -1715,7 +1715,7 @@ export const serializeAws_json1_1GetJobBookmarkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetJobBookmark", }; let body: any; @@ -1728,7 +1728,7 @@ export const serializeAws_json1_1GetJobRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetJobRun", }; let body: any; @@ -1741,7 +1741,7 @@ export const serializeAws_json1_1GetJobRunsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetJobRuns", }; let body: any; @@ -1754,7 +1754,7 @@ export const serializeAws_json1_1GetJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetJobs", }; let body: any; @@ -1767,7 +1767,7 @@ export const serializeAws_json1_1GetMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetMapping", }; let body: any; @@ -1780,7 +1780,7 @@ export const serializeAws_json1_1GetMLTaskRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetMLTaskRun", }; let body: any; @@ -1793,7 +1793,7 @@ export const serializeAws_json1_1GetMLTaskRunsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetMLTaskRuns", }; let body: any; @@ -1806,7 +1806,7 @@ export const serializeAws_json1_1GetMLTransformCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetMLTransform", }; let body: any; @@ -1819,7 +1819,7 @@ export const serializeAws_json1_1GetMLTransformsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetMLTransforms", }; let body: any; @@ -1832,7 +1832,7 @@ export const serializeAws_json1_1GetPartitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetPartition", }; let body: any; @@ -1845,7 +1845,7 @@ export const serializeAws_json1_1GetPartitionIndexesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetPartitionIndexes", }; let body: any; @@ -1858,7 +1858,7 @@ export const serializeAws_json1_1GetPartitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetPartitions", }; let body: any; @@ -1871,7 +1871,7 @@ export const serializeAws_json1_1GetPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetPlan", }; let body: any; @@ -1884,7 +1884,7 @@ export const serializeAws_json1_1GetRegistryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetRegistry", }; let body: any; @@ -1897,7 +1897,7 @@ export const serializeAws_json1_1GetResourcePoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetResourcePolicies", }; let body: any; @@ -1910,7 +1910,7 @@ export const serializeAws_json1_1GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetResourcePolicy", }; let body: any; @@ -1923,7 +1923,7 @@ export const serializeAws_json1_1GetSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetSchema", }; let body: any; @@ -1936,7 +1936,7 @@ export const serializeAws_json1_1GetSchemaByDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetSchemaByDefinition", }; let body: any; @@ -1949,7 +1949,7 @@ export const serializeAws_json1_1GetSchemaVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetSchemaVersion", }; let body: any; @@ -1962,7 +1962,7 @@ export const serializeAws_json1_1GetSchemaVersionsDiffCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetSchemaVersionsDiff", }; let body: any; @@ -1975,7 +1975,7 @@ export const serializeAws_json1_1GetSecurityConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetSecurityConfiguration", }; let body: any; @@ -1988,7 +1988,7 @@ export const serializeAws_json1_1GetSecurityConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetSecurityConfigurations", }; let body: any; @@ -2001,7 +2001,7 @@ export const serializeAws_json1_1GetTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetTable", }; let body: any; @@ -2014,7 +2014,7 @@ export const serializeAws_json1_1GetTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetTables", }; let body: any; @@ -2027,7 +2027,7 @@ export const serializeAws_json1_1GetTableVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetTableVersion", }; let body: any; @@ -2040,7 +2040,7 @@ export const serializeAws_json1_1GetTableVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetTableVersions", }; let body: any; @@ -2053,7 +2053,7 @@ export const serializeAws_json1_1GetTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetTags", }; let body: any; @@ -2066,7 +2066,7 @@ export const serializeAws_json1_1GetTriggerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetTrigger", }; let body: any; @@ -2079,7 +2079,7 @@ export const serializeAws_json1_1GetTriggersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetTriggers", }; let body: any; @@ -2092,7 +2092,7 @@ export const serializeAws_json1_1GetUserDefinedFunctionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetUserDefinedFunction", }; let body: any; @@ -2105,7 +2105,7 @@ export const serializeAws_json1_1GetUserDefinedFunctionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetUserDefinedFunctions", }; let body: any; @@ -2118,7 +2118,7 @@ export const serializeAws_json1_1GetWorkflowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetWorkflow", }; let body: any; @@ -2131,7 +2131,7 @@ export const serializeAws_json1_1GetWorkflowRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetWorkflowRun", }; let body: any; @@ -2144,7 +2144,7 @@ export const serializeAws_json1_1GetWorkflowRunPropertiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetWorkflowRunProperties", }; let body: any; @@ -2157,7 +2157,7 @@ export const serializeAws_json1_1GetWorkflowRunsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.GetWorkflowRuns", }; let body: any; @@ -2170,7 +2170,7 @@ export const serializeAws_json1_1ImportCatalogToGlueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ImportCatalogToGlue", }; let body: any; @@ -2183,7 +2183,7 @@ export const serializeAws_json1_1ListCrawlersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ListCrawlers", }; let body: any; @@ -2196,7 +2196,7 @@ export const serializeAws_json1_1ListDevEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ListDevEndpoints", }; let body: any; @@ -2209,7 +2209,7 @@ export const serializeAws_json1_1ListJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ListJobs", }; let body: any; @@ -2222,7 +2222,7 @@ export const serializeAws_json1_1ListMLTransformsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ListMLTransforms", }; let body: any; @@ -2235,7 +2235,7 @@ export const serializeAws_json1_1ListRegistriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ListRegistries", }; let body: any; @@ -2248,7 +2248,7 @@ export const serializeAws_json1_1ListSchemasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ListSchemas", }; let body: any; @@ -2261,7 +2261,7 @@ export const serializeAws_json1_1ListSchemaVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ListSchemaVersions", }; let body: any; @@ -2274,7 +2274,7 @@ export const serializeAws_json1_1ListTriggersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ListTriggers", }; let body: any; @@ -2287,7 +2287,7 @@ export const serializeAws_json1_1ListWorkflowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ListWorkflows", }; let body: any; @@ -2300,7 +2300,7 @@ export const serializeAws_json1_1PutDataCatalogEncryptionSettingsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.PutDataCatalogEncryptionSettings", }; let body: any; @@ -2313,7 +2313,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.PutResourcePolicy", }; let body: any; @@ -2326,7 +2326,7 @@ export const serializeAws_json1_1PutSchemaVersionMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.PutSchemaVersionMetadata", }; let body: any; @@ -2339,7 +2339,7 @@ export const serializeAws_json1_1PutWorkflowRunPropertiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.PutWorkflowRunProperties", }; let body: any; @@ -2352,7 +2352,7 @@ export const serializeAws_json1_1QuerySchemaVersionMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.QuerySchemaVersionMetadata", }; let body: any; @@ -2365,7 +2365,7 @@ export const serializeAws_json1_1RegisterSchemaVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.RegisterSchemaVersion", }; let body: any; @@ -2378,7 +2378,7 @@ export const serializeAws_json1_1RemoveSchemaVersionMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.RemoveSchemaVersionMetadata", }; let body: any; @@ -2391,7 +2391,7 @@ export const serializeAws_json1_1ResetJobBookmarkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ResetJobBookmark", }; let body: any; @@ -2404,7 +2404,7 @@ export const serializeAws_json1_1ResumeWorkflowRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.ResumeWorkflowRun", }; let body: any; @@ -2417,7 +2417,7 @@ export const serializeAws_json1_1SearchTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.SearchTables", }; let body: any; @@ -2430,7 +2430,7 @@ export const serializeAws_json1_1StartCrawlerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StartCrawler", }; let body: any; @@ -2443,7 +2443,7 @@ export const serializeAws_json1_1StartCrawlerScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StartCrawlerSchedule", }; let body: any; @@ -2456,7 +2456,7 @@ export const serializeAws_json1_1StartExportLabelsTaskRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StartExportLabelsTaskRun", }; let body: any; @@ -2469,7 +2469,7 @@ export const serializeAws_json1_1StartImportLabelsTaskRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StartImportLabelsTaskRun", }; let body: any; @@ -2482,7 +2482,7 @@ export const serializeAws_json1_1StartJobRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StartJobRun", }; let body: any; @@ -2495,7 +2495,7 @@ export const serializeAws_json1_1StartMLEvaluationTaskRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StartMLEvaluationTaskRun", }; let body: any; @@ -2508,7 +2508,7 @@ export const serializeAws_json1_1StartMLLabelingSetGenerationTaskRunCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StartMLLabelingSetGenerationTaskRun", }; let body: any; @@ -2521,7 +2521,7 @@ export const serializeAws_json1_1StartTriggerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StartTrigger", }; let body: any; @@ -2534,7 +2534,7 @@ export const serializeAws_json1_1StartWorkflowRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StartWorkflowRun", }; let body: any; @@ -2547,7 +2547,7 @@ export const serializeAws_json1_1StopCrawlerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StopCrawler", }; let body: any; @@ -2560,7 +2560,7 @@ export const serializeAws_json1_1StopCrawlerScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StopCrawlerSchedule", }; let body: any; @@ -2573,7 +2573,7 @@ export const serializeAws_json1_1StopTriggerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StopTrigger", }; let body: any; @@ -2586,7 +2586,7 @@ export const serializeAws_json1_1StopWorkflowRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.StopWorkflowRun", }; let body: any; @@ -2599,7 +2599,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.TagResource", }; let body: any; @@ -2612,7 +2612,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UntagResource", }; let body: any; @@ -2625,7 +2625,7 @@ export const serializeAws_json1_1UpdateClassifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateClassifier", }; let body: any; @@ -2638,7 +2638,7 @@ export const serializeAws_json1_1UpdateColumnStatisticsForPartitionCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateColumnStatisticsForPartition", }; let body: any; @@ -2651,7 +2651,7 @@ export const serializeAws_json1_1UpdateColumnStatisticsForTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateColumnStatisticsForTable", }; let body: any; @@ -2664,7 +2664,7 @@ export const serializeAws_json1_1UpdateConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateConnection", }; let body: any; @@ -2677,7 +2677,7 @@ export const serializeAws_json1_1UpdateCrawlerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateCrawler", }; let body: any; @@ -2690,7 +2690,7 @@ export const serializeAws_json1_1UpdateCrawlerScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateCrawlerSchedule", }; let body: any; @@ -2703,7 +2703,7 @@ export const serializeAws_json1_1UpdateDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateDatabase", }; let body: any; @@ -2716,7 +2716,7 @@ export const serializeAws_json1_1UpdateDevEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateDevEndpoint", }; let body: any; @@ -2729,7 +2729,7 @@ export const serializeAws_json1_1UpdateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateJob", }; let body: any; @@ -2742,7 +2742,7 @@ export const serializeAws_json1_1UpdateMLTransformCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateMLTransform", }; let body: any; @@ -2755,7 +2755,7 @@ export const serializeAws_json1_1UpdatePartitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdatePartition", }; let body: any; @@ -2768,7 +2768,7 @@ export const serializeAws_json1_1UpdateRegistryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateRegistry", }; let body: any; @@ -2781,7 +2781,7 @@ export const serializeAws_json1_1UpdateSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateSchema", }; let body: any; @@ -2794,7 +2794,7 @@ export const serializeAws_json1_1UpdateTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateTable", }; let body: any; @@ -2807,7 +2807,7 @@ export const serializeAws_json1_1UpdateTriggerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateTrigger", }; let body: any; @@ -2820,7 +2820,7 @@ export const serializeAws_json1_1UpdateUserDefinedFunctionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateUserDefinedFunction", }; let body: any; @@ -2833,7 +2833,7 @@ export const serializeAws_json1_1UpdateWorkflowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSGlue.UpdateWorkflow", }; let body: any; @@ -2868,8 +2868,7 @@ const deserializeAws_json1_1BatchCreatePartitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -2971,8 +2970,7 @@ const deserializeAws_json1_1BatchDeleteConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -3034,8 +3032,7 @@ const deserializeAws_json1_1BatchDeletePartitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -3113,8 +3110,7 @@ const deserializeAws_json1_1BatchDeleteTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -3192,8 +3188,7 @@ const deserializeAws_json1_1BatchDeleteTableVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -3271,8 +3266,7 @@ const deserializeAws_json1_1BatchGetCrawlersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.glue#InvalidInputException": @@ -3334,8 +3328,7 @@ const deserializeAws_json1_1BatchGetDevEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -3413,8 +3406,7 @@ const deserializeAws_json1_1BatchGetJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -3484,8 +3476,7 @@ const deserializeAws_json1_1BatchGetPartitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -3571,8 +3562,7 @@ const deserializeAws_json1_1BatchGetTriggersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -3642,8 +3632,7 @@ const deserializeAws_json1_1BatchGetWorkflowsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -3713,8 +3702,7 @@ const deserializeAws_json1_1BatchStopJobRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -3784,8 +3772,7 @@ const deserializeAws_json1_1BatchUpdatePartitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -3871,8 +3858,7 @@ const deserializeAws_json1_1CancelMLTaskRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -3950,8 +3936,7 @@ const deserializeAws_json1_1CheckSchemaVersionValidityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -4021,8 +4006,7 @@ const deserializeAws_json1_1CreateClassifierCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -4092,8 +4076,7 @@ const deserializeAws_json1_1CreateConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -4179,8 +4162,7 @@ const deserializeAws_json1_1CreateCrawlerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -4258,8 +4240,7 @@ const deserializeAws_json1_1CreateDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -4353,8 +4334,7 @@ const deserializeAws_json1_1CreateDevEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -4464,8 +4444,7 @@ const deserializeAws_json1_1CreateJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -4567,8 +4546,7 @@ const deserializeAws_json1_1CreateMLTransformCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -4670,8 +4648,7 @@ const deserializeAws_json1_1CreatePartitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -4773,8 +4750,7 @@ const deserializeAws_json1_1CreatePartitionIndexCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -4876,8 +4852,7 @@ const deserializeAws_json1_1CreateRegistryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -4963,8 +4938,7 @@ const deserializeAws_json1_1CreateSchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -5058,8 +5032,7 @@ const deserializeAws_json1_1CreateScriptCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -5129,8 +5102,7 @@ const deserializeAws_json1_1CreateSecurityConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -5216,8 +5188,7 @@ const deserializeAws_json1_1CreateTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -5319,8 +5290,7 @@ const deserializeAws_json1_1CreateTriggerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -5430,8 +5400,7 @@ const deserializeAws_json1_1CreateUserDefinedFunctionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -5533,8 +5502,7 @@ const deserializeAws_json1_1CreateWorkflowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -5628,8 +5596,7 @@ const deserializeAws_json1_1DeleteClassifierCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -5691,8 +5658,7 @@ const deserializeAws_json1_1DeleteColumnStatisticsForPartitionCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -5778,8 +5744,7 @@ const deserializeAws_json1_1DeleteColumnStatisticsForTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -5865,8 +5830,7 @@ const deserializeAws_json1_1DeleteConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -5928,8 +5892,7 @@ const deserializeAws_json1_1DeleteCrawlerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CrawlerRunningException": case "com.amazonaws.glue#CrawlerRunningException": @@ -6007,8 +5970,7 @@ const deserializeAws_json1_1DeleteDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -6086,8 +6048,7 @@ const deserializeAws_json1_1DeleteDevEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -6165,8 +6126,7 @@ const deserializeAws_json1_1DeleteJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -6236,8 +6196,7 @@ const deserializeAws_json1_1DeleteMLTransformCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -6315,8 +6274,7 @@ const deserializeAws_json1_1DeletePartitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -6394,8 +6352,7 @@ const deserializeAws_json1_1DeletePartitionIndexCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.glue#ConflictException": @@ -6489,8 +6446,7 @@ const deserializeAws_json1_1DeleteRegistryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -6568,8 +6524,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConditionCheckFailureException": case "com.amazonaws.glue#ConditionCheckFailureException": @@ -6655,8 +6610,7 @@ const deserializeAws_json1_1DeleteSchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -6734,8 +6688,7 @@ const deserializeAws_json1_1DeleteSchemaVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -6813,8 +6766,7 @@ const deserializeAws_json1_1DeleteSecurityConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -6892,8 +6844,7 @@ const deserializeAws_json1_1DeleteTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -6971,8 +6922,7 @@ const deserializeAws_json1_1DeleteTableVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -7050,8 +7000,7 @@ const deserializeAws_json1_1DeleteTriggerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.glue#ConcurrentModificationException": @@ -7129,8 +7078,7 @@ const deserializeAws_json1_1DeleteUserDefinedFunctionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -7208,8 +7156,7 @@ const deserializeAws_json1_1DeleteWorkflowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.glue#ConcurrentModificationException": @@ -7287,8 +7234,7 @@ const deserializeAws_json1_1GetCatalogImportStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -7350,8 +7296,7 @@ const deserializeAws_json1_1GetClassifierCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -7413,8 +7358,7 @@ const deserializeAws_json1_1GetClassifiersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationTimeoutException": case "com.amazonaws.glue#OperationTimeoutException": @@ -7468,8 +7412,7 @@ const deserializeAws_json1_1GetColumnStatisticsForPartitionCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -7555,8 +7498,7 @@ const deserializeAws_json1_1GetColumnStatisticsForTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -7642,8 +7584,7 @@ const deserializeAws_json1_1GetConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -7721,8 +7662,7 @@ const deserializeAws_json1_1GetConnectionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -7800,8 +7740,7 @@ const deserializeAws_json1_1GetCrawlerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -7863,8 +7802,7 @@ const deserializeAws_json1_1GetCrawlerMetricsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationTimeoutException": case "com.amazonaws.glue#OperationTimeoutException": @@ -7918,8 +7856,7 @@ const deserializeAws_json1_1GetCrawlersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationTimeoutException": case "com.amazonaws.glue#OperationTimeoutException": @@ -7973,8 +7910,7 @@ const deserializeAws_json1_1GetDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -8060,8 +7996,7 @@ const deserializeAws_json1_1GetDatabasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GlueEncryptionException": case "com.amazonaws.glue#GlueEncryptionException": @@ -8139,8 +8074,7 @@ const deserializeAws_json1_1GetDataCatalogEncryptionSettingsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -8210,8 +8144,7 @@ const deserializeAws_json1_1GetDataflowGraphCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -8281,8 +8214,7 @@ const deserializeAws_json1_1GetDevEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -8360,8 +8292,7 @@ const deserializeAws_json1_1GetDevEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -8439,8 +8370,7 @@ const deserializeAws_json1_1GetJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -8518,8 +8448,7 @@ const deserializeAws_json1_1GetJobBookmarkCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -8605,8 +8534,7 @@ const deserializeAws_json1_1GetJobRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -8684,8 +8612,7 @@ const deserializeAws_json1_1GetJobRunsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -8763,8 +8690,7 @@ const deserializeAws_json1_1GetJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -8842,8 +8768,7 @@ const deserializeAws_json1_1GetMappingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -8921,8 +8846,7 @@ const deserializeAws_json1_1GetMLTaskRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -9000,8 +8924,7 @@ const deserializeAws_json1_1GetMLTaskRunsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -9079,8 +9002,7 @@ const deserializeAws_json1_1GetMLTransformCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -9158,8 +9080,7 @@ const deserializeAws_json1_1GetMLTransformsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -9237,8 +9158,7 @@ const deserializeAws_json1_1GetPartitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -9324,8 +9244,7 @@ const deserializeAws_json1_1GetPartitionIndexesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.glue#ConflictException": @@ -9411,8 +9330,7 @@ const deserializeAws_json1_1GetPartitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -9498,8 +9416,7 @@ const deserializeAws_json1_1GetPlanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -9569,8 +9486,7 @@ const deserializeAws_json1_1GetRegistryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -9648,8 +9564,7 @@ const deserializeAws_json1_1GetResourcePoliciesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "GlueEncryptionException": case "com.amazonaws.glue#GlueEncryptionException": @@ -9727,8 +9642,7 @@ const deserializeAws_json1_1GetResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -9806,8 +9720,7 @@ const deserializeAws_json1_1GetSchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -9885,8 +9798,7 @@ const deserializeAws_json1_1GetSchemaByDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -9964,8 +9876,7 @@ const deserializeAws_json1_1GetSchemaVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -10043,8 +9954,7 @@ const deserializeAws_json1_1GetSchemaVersionsDiffCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -10122,8 +10032,7 @@ const deserializeAws_json1_1GetSecurityConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10201,8 +10110,7 @@ const deserializeAws_json1_1GetSecurityConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10280,8 +10188,7 @@ const deserializeAws_json1_1GetTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10367,8 +10274,7 @@ const deserializeAws_json1_1GetTablesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10454,8 +10360,7 @@ const deserializeAws_json1_1GetTableVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10541,8 +10446,7 @@ const deserializeAws_json1_1GetTableVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10628,8 +10532,7 @@ const deserializeAws_json1_1GetTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10707,8 +10610,7 @@ const deserializeAws_json1_1GetTriggerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10786,8 +10688,7 @@ const deserializeAws_json1_1GetTriggersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10865,8 +10766,7 @@ const deserializeAws_json1_1GetUserDefinedFunctionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -10952,8 +10852,7 @@ const deserializeAws_json1_1GetUserDefinedFunctionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -11039,8 +10938,7 @@ const deserializeAws_json1_1GetWorkflowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -11118,8 +11016,7 @@ const deserializeAws_json1_1GetWorkflowRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -11197,8 +11094,7 @@ const deserializeAws_json1_1GetWorkflowRunPropertiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -11276,8 +11172,7 @@ const deserializeAws_json1_1GetWorkflowRunsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -11355,8 +11250,7 @@ const deserializeAws_json1_1ImportCatalogToGlueCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -11418,8 +11312,7 @@ const deserializeAws_json1_1ListCrawlersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationTimeoutException": case "com.amazonaws.glue#OperationTimeoutException": @@ -11473,8 +11366,7 @@ const deserializeAws_json1_1ListDevEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -11552,8 +11444,7 @@ const deserializeAws_json1_1ListJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -11631,8 +11522,7 @@ const deserializeAws_json1_1ListMLTransformsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -11710,8 +11600,7 @@ const deserializeAws_json1_1ListRegistriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -11781,8 +11670,7 @@ const deserializeAws_json1_1ListSchemasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -11860,8 +11748,7 @@ const deserializeAws_json1_1ListSchemaVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -11939,8 +11826,7 @@ const deserializeAws_json1_1ListTriggersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -12018,8 +11904,7 @@ const deserializeAws_json1_1ListWorkflowsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -12089,8 +11974,7 @@ const deserializeAws_json1_1PutDataCatalogEncryptionSettingsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -12160,8 +12044,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConditionCheckFailureException": case "com.amazonaws.glue#ConditionCheckFailureException": @@ -12247,8 +12130,7 @@ const deserializeAws_json1_1PutSchemaVersionMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -12334,8 +12216,7 @@ const deserializeAws_json1_1PutWorkflowRunPropertiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.glue#AlreadyExistsException": @@ -12437,8 +12318,7 @@ const deserializeAws_json1_1QuerySchemaVersionMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -12508,8 +12388,7 @@ const deserializeAws_json1_1RegisterSchemaVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -12603,8 +12482,7 @@ const deserializeAws_json1_1RemoveSchemaVersionMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -12674,8 +12552,7 @@ const deserializeAws_json1_1ResetJobBookmarkCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -12753,8 +12630,7 @@ const deserializeAws_json1_1ResumeWorkflowRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentRunsExceededException": case "com.amazonaws.glue#ConcurrentRunsExceededException": @@ -12848,8 +12724,7 @@ const deserializeAws_json1_1SearchTablesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": @@ -12919,8 +12794,7 @@ const deserializeAws_json1_1StartCrawlerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CrawlerRunningException": case "com.amazonaws.glue#CrawlerRunningException": @@ -12990,8 +12864,7 @@ const deserializeAws_json1_1StartCrawlerScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -13077,8 +12950,7 @@ const deserializeAws_json1_1StartExportLabelsTaskRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -13156,8 +13028,7 @@ const deserializeAws_json1_1StartImportLabelsTaskRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -13243,8 +13114,7 @@ const deserializeAws_json1_1StartJobRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentRunsExceededException": case "com.amazonaws.glue#ConcurrentRunsExceededException": @@ -13338,8 +13208,7 @@ const deserializeAws_json1_1StartMLEvaluationTaskRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentRunsExceededException": case "com.amazonaws.glue#ConcurrentRunsExceededException": @@ -13433,8 +13302,7 @@ const deserializeAws_json1_1StartMLLabelingSetGenerationTaskRunCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentRunsExceededException": case "com.amazonaws.glue#ConcurrentRunsExceededException": @@ -13520,8 +13388,7 @@ const deserializeAws_json1_1StartTriggerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentRunsExceededException": case "com.amazonaws.glue#ConcurrentRunsExceededException": @@ -13615,8 +13482,7 @@ const deserializeAws_json1_1StartWorkflowRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentRunsExceededException": case "com.amazonaws.glue#ConcurrentRunsExceededException": @@ -13710,8 +13576,7 @@ const deserializeAws_json1_1StopCrawlerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CrawlerNotRunningException": case "com.amazonaws.glue#CrawlerNotRunningException": @@ -13789,8 +13654,7 @@ const deserializeAws_json1_1StopCrawlerScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -13868,8 +13732,7 @@ const deserializeAws_json1_1StopTriggerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.glue#ConcurrentModificationException": @@ -13955,8 +13818,7 @@ const deserializeAws_json1_1StopWorkflowRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14042,8 +13904,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14121,8 +13982,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14200,8 +14060,7 @@ const deserializeAws_json1_1UpdateClassifierCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14279,8 +14138,7 @@ const deserializeAws_json1_1UpdateColumnStatisticsForPartitionCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14366,8 +14224,7 @@ const deserializeAws_json1_1UpdateColumnStatisticsForTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14453,8 +14310,7 @@ const deserializeAws_json1_1UpdateConnectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14532,8 +14388,7 @@ const deserializeAws_json1_1UpdateCrawlerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CrawlerRunningException": case "com.amazonaws.glue#CrawlerRunningException": @@ -14619,8 +14474,7 @@ const deserializeAws_json1_1UpdateCrawlerScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14706,8 +14560,7 @@ const deserializeAws_json1_1UpdateDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14793,8 +14646,7 @@ const deserializeAws_json1_1UpdateDevEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -14880,8 +14732,7 @@ const deserializeAws_json1_1UpdateJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.glue#ConcurrentModificationException": @@ -14967,8 +14818,7 @@ const deserializeAws_json1_1UpdateMLTransformCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -15054,8 +14904,7 @@ const deserializeAws_json1_1UpdatePartitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -15141,8 +14990,7 @@ const deserializeAws_json1_1UpdateRegistryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -15228,8 +15076,7 @@ const deserializeAws_json1_1UpdateSchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.glue#AccessDeniedException": @@ -15315,8 +15162,7 @@ const deserializeAws_json1_1UpdateTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.glue#ConcurrentModificationException": @@ -15418,8 +15264,7 @@ const deserializeAws_json1_1UpdateTriggerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.glue#ConcurrentModificationException": @@ -15505,8 +15350,7 @@ const deserializeAws_json1_1UpdateUserDefinedFunctionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": @@ -15592,8 +15436,7 @@ const deserializeAws_json1_1UpdateWorkflowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.glue#ConcurrentModificationException": @@ -16014,32 +15857,44 @@ const deserializeAws_json1_1VersionMismatchExceptionResponse = async ( const serializeAws_json1_1Action = (input: Action, context: __SerdeContext): any => { return { - ...(input.Arguments !== undefined && { Arguments: serializeAws_json1_1GenericMap(input.Arguments, context) }), - ...(input.CrawlerName !== undefined && { CrawlerName: input.CrawlerName }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.NotificationProperty !== undefined && { - NotificationProperty: serializeAws_json1_1NotificationProperty(input.NotificationProperty, context), - }), - ...(input.SecurityConfiguration !== undefined && { SecurityConfiguration: input.SecurityConfiguration }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), + ...(input.Arguments !== undefined && + input.Arguments !== null && { Arguments: serializeAws_json1_1GenericMap(input.Arguments, context) }), + ...(input.CrawlerName !== undefined && input.CrawlerName !== null && { CrawlerName: input.CrawlerName }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.NotificationProperty !== undefined && + input.NotificationProperty !== null && { + NotificationProperty: serializeAws_json1_1NotificationProperty(input.NotificationProperty, context), + }), + ...(input.SecurityConfiguration !== undefined && + input.SecurityConfiguration !== null && { SecurityConfiguration: input.SecurityConfiguration }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), }; }; const serializeAws_json1_1ActionList = (input: Action[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Action(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Action(entry, context); + }); }; const serializeAws_json1_1AdditionalPlanOptionsMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1BatchCreatePartitionRequest = ( @@ -16047,12 +15902,13 @@ const serializeAws_json1_1BatchCreatePartitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionInputList !== undefined && { - PartitionInputList: serializeAws_json1_1PartitionInputList(input.PartitionInputList, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionInputList !== undefined && + input.PartitionInputList !== null && { + PartitionInputList: serializeAws_json1_1PartitionInputList(input.PartitionInputList, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -16061,10 +15917,11 @@ const serializeAws_json1_1BatchDeleteConnectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ConnectionNameList !== undefined && { - ConnectionNameList: serializeAws_json1_1DeleteConnectionNameList(input.ConnectionNameList, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ConnectionNameList !== undefined && + input.ConnectionNameList !== null && { + ConnectionNameList: serializeAws_json1_1DeleteConnectionNameList(input.ConnectionNameList, context), + }), }; }; @@ -16073,12 +15930,13 @@ const serializeAws_json1_1BatchDeletePartitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionsToDelete !== undefined && { - PartitionsToDelete: serializeAws_json1_1BatchDeletePartitionValueList(input.PartitionsToDelete, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionsToDelete !== undefined && + input.PartitionsToDelete !== null && { + PartitionsToDelete: serializeAws_json1_1BatchDeletePartitionValueList(input.PartitionsToDelete, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -16086,25 +15944,47 @@ const serializeAws_json1_1BatchDeletePartitionValueList = ( input: PartitionValueList[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1PartitionValueList(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PartitionValueList(entry, context); + }); }; const serializeAws_json1_1BatchDeleteTableNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchDeleteTableRequest = (input: BatchDeleteTableRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TablesToDelete !== undefined && { - TablesToDelete: serializeAws_json1_1BatchDeleteTableNameList(input.TablesToDelete, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TablesToDelete !== undefined && + input.TablesToDelete !== null && { + TablesToDelete: serializeAws_json1_1BatchDeleteTableNameList(input.TablesToDelete, context), + }), }; }; const serializeAws_json1_1BatchDeleteTableVersionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchDeleteTableVersionRequest = ( @@ -16112,20 +15992,22 @@ const serializeAws_json1_1BatchDeleteTableVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.VersionIds !== undefined && { - VersionIds: serializeAws_json1_1BatchDeleteTableVersionList(input.VersionIds, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.VersionIds !== undefined && + input.VersionIds !== null && { + VersionIds: serializeAws_json1_1BatchDeleteTableVersionList(input.VersionIds, context), + }), }; }; const serializeAws_json1_1BatchGetCrawlersRequest = (input: BatchGetCrawlersRequest, context: __SerdeContext): any => { return { - ...(input.CrawlerNames !== undefined && { - CrawlerNames: serializeAws_json1_1CrawlerNameList(input.CrawlerNames, context), - }), + ...(input.CrawlerNames !== undefined && + input.CrawlerNames !== null && { + CrawlerNames: serializeAws_json1_1CrawlerNameList(input.CrawlerNames, context), + }), }; }; @@ -16134,15 +16016,17 @@ const serializeAws_json1_1BatchGetDevEndpointsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DevEndpointNames !== undefined && { - DevEndpointNames: serializeAws_json1_1DevEndpointNames(input.DevEndpointNames, context), - }), + ...(input.DevEndpointNames !== undefined && + input.DevEndpointNames !== null && { + DevEndpointNames: serializeAws_json1_1DevEndpointNames(input.DevEndpointNames, context), + }), }; }; const serializeAws_json1_1BatchGetJobsRequest = (input: BatchGetJobsRequest, context: __SerdeContext): any => { return { - ...(input.JobNames !== undefined && { JobNames: serializeAws_json1_1JobNameList(input.JobNames, context) }), + ...(input.JobNames !== undefined && + input.JobNames !== null && { JobNames: serializeAws_json1_1JobNameList(input.JobNames, context) }), }; }; @@ -16151,24 +16035,33 @@ const serializeAws_json1_1BatchGetPartitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionsToGet !== undefined && { - PartitionsToGet: serializeAws_json1_1BatchGetPartitionValueList(input.PartitionsToGet, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionsToGet !== undefined && + input.PartitionsToGet !== null && { + PartitionsToGet: serializeAws_json1_1BatchGetPartitionValueList(input.PartitionsToGet, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1BatchGetPartitionValueList = (input: PartitionValueList[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PartitionValueList(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PartitionValueList(entry, context); + }); }; const serializeAws_json1_1BatchGetTriggersRequest = (input: BatchGetTriggersRequest, context: __SerdeContext): any => { return { - ...(input.TriggerNames !== undefined && { - TriggerNames: serializeAws_json1_1TriggerNameList(input.TriggerNames, context), - }), + ...(input.TriggerNames !== undefined && + input.TriggerNames !== null && { + TriggerNames: serializeAws_json1_1TriggerNameList(input.TriggerNames, context), + }), }; }; @@ -16177,21 +16070,30 @@ const serializeAws_json1_1BatchGetWorkflowsRequest = ( context: __SerdeContext ): any => { return { - ...(input.IncludeGraph !== undefined && { IncludeGraph: input.IncludeGraph }), - ...(input.Names !== undefined && { Names: serializeAws_json1_1WorkflowNames(input.Names, context) }), + ...(input.IncludeGraph !== undefined && input.IncludeGraph !== null && { IncludeGraph: input.IncludeGraph }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1WorkflowNames(input.Names, context) }), }; }; const serializeAws_json1_1BatchStopJobRunJobRunIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchStopJobRunRequest = (input: BatchStopJobRunRequest, context: __SerdeContext): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobRunIds !== undefined && { - JobRunIds: serializeAws_json1_1BatchStopJobRunJobRunIdList(input.JobRunIds, context), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobRunIds !== undefined && + input.JobRunIds !== null && { + JobRunIds: serializeAws_json1_1BatchStopJobRunJobRunIdList(input.JobRunIds, context), + }), }; }; @@ -16200,12 +16102,13 @@ const serializeAws_json1_1BatchUpdatePartitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Entries !== undefined && { - Entries: serializeAws_json1_1BatchUpdatePartitionRequestEntryList(input.Entries, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Entries !== undefined && + input.Entries !== null && { + Entries: serializeAws_json1_1BatchUpdatePartitionRequestEntryList(input.Entries, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -16214,12 +16117,14 @@ const serializeAws_json1_1BatchUpdatePartitionRequestEntry = ( context: __SerdeContext ): any => { return { - ...(input.PartitionInput !== undefined && { - PartitionInput: serializeAws_json1_1PartitionInput(input.PartitionInput, context), - }), - ...(input.PartitionValueList !== undefined && { - PartitionValueList: serializeAws_json1_1BoundedPartitionValueList(input.PartitionValueList, context), - }), + ...(input.PartitionInput !== undefined && + input.PartitionInput !== null && { + PartitionInput: serializeAws_json1_1PartitionInput(input.PartitionInput, context), + }), + ...(input.PartitionValueList !== undefined && + input.PartitionValueList !== null && { + PartitionValueList: serializeAws_json1_1BoundedPartitionValueList(input.PartitionValueList, context), + }), }; }; @@ -16227,7 +16132,14 @@ const serializeAws_json1_1BatchUpdatePartitionRequestEntryList = ( input: BatchUpdatePartitionRequestEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1BatchUpdatePartitionRequestEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1BatchUpdatePartitionRequestEntry(entry, context); + }); }; const serializeAws_json1_1BinaryColumnStatisticsData = ( @@ -16235,9 +16147,9 @@ const serializeAws_json1_1BinaryColumnStatisticsData = ( context: __SerdeContext ): any => { return { - ...(input.AverageLength !== undefined && { AverageLength: input.AverageLength }), - ...(input.MaximumLength !== undefined && { MaximumLength: input.MaximumLength }), - ...(input.NumberOfNulls !== undefined && { NumberOfNulls: input.NumberOfNulls }), + ...(input.AverageLength !== undefined && input.AverageLength !== null && { AverageLength: input.AverageLength }), + ...(input.MaximumLength !== undefined && input.MaximumLength !== null && { MaximumLength: input.MaximumLength }), + ...(input.NumberOfNulls !== undefined && input.NumberOfNulls !== null && { NumberOfNulls: input.NumberOfNulls }), }; }; @@ -16246,47 +16158,77 @@ const serializeAws_json1_1BooleanColumnStatisticsData = ( context: __SerdeContext ): any => { return { - ...(input.NumberOfFalses !== undefined && { NumberOfFalses: input.NumberOfFalses }), - ...(input.NumberOfNulls !== undefined && { NumberOfNulls: input.NumberOfNulls }), - ...(input.NumberOfTrues !== undefined && { NumberOfTrues: input.NumberOfTrues }), + ...(input.NumberOfFalses !== undefined && + input.NumberOfFalses !== null && { NumberOfFalses: input.NumberOfFalses }), + ...(input.NumberOfNulls !== undefined && input.NumberOfNulls !== null && { NumberOfNulls: input.NumberOfNulls }), + ...(input.NumberOfTrues !== undefined && input.NumberOfTrues !== null && { NumberOfTrues: input.NumberOfTrues }), }; }; const serializeAws_json1_1BoundedPartitionValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CancelMLTaskRunRequest = (input: CancelMLTaskRunRequest, context: __SerdeContext): any => { return { - ...(input.TaskRunId !== undefined && { TaskRunId: input.TaskRunId }), - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), + ...(input.TaskRunId !== undefined && input.TaskRunId !== null && { TaskRunId: input.TaskRunId }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), }; }; const serializeAws_json1_1CatalogEntries = (input: CatalogEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CatalogEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CatalogEntry(entry, context); + }); }; const serializeAws_json1_1CatalogEntry = (input: CatalogEntry, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1CatalogTablesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CatalogTarget = (input: CatalogTarget, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Tables !== undefined && { Tables: serializeAws_json1_1CatalogTablesList(input.Tables, context) }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Tables !== undefined && + input.Tables !== null && { Tables: serializeAws_json1_1CatalogTablesList(input.Tables, context) }), }; }; const serializeAws_json1_1CatalogTargetList = (input: CatalogTarget[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CatalogTarget(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CatalogTarget(entry, context); + }); }; const serializeAws_json1_1CheckSchemaVersionValidityInput = ( @@ -16294,152 +16236,206 @@ const serializeAws_json1_1CheckSchemaVersionValidityInput = ( context: __SerdeContext ): any => { return { - ...(input.DataFormat !== undefined && { DataFormat: input.DataFormat }), - ...(input.SchemaDefinition !== undefined && { SchemaDefinition: input.SchemaDefinition }), + ...(input.DataFormat !== undefined && input.DataFormat !== null && { DataFormat: input.DataFormat }), + ...(input.SchemaDefinition !== undefined && + input.SchemaDefinition !== null && { SchemaDefinition: input.SchemaDefinition }), }; }; const serializeAws_json1_1ClassifierNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CloudWatchEncryption = (input: CloudWatchEncryption, context: __SerdeContext): any => { return { - ...(input.CloudWatchEncryptionMode !== undefined && { CloudWatchEncryptionMode: input.CloudWatchEncryptionMode }), - ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), + ...(input.CloudWatchEncryptionMode !== undefined && + input.CloudWatchEncryptionMode !== null && { CloudWatchEncryptionMode: input.CloudWatchEncryptionMode }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }), }; }; const serializeAws_json1_1CodeGenEdge = (input: CodeGenEdge, context: __SerdeContext): any => { return { - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.Target !== undefined && { Target: input.Target }), - ...(input.TargetParameter !== undefined && { TargetParameter: input.TargetParameter }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.Target !== undefined && input.Target !== null && { Target: input.Target }), + ...(input.TargetParameter !== undefined && + input.TargetParameter !== null && { TargetParameter: input.TargetParameter }), }; }; const serializeAws_json1_1CodeGenNode = (input: CodeGenNode, context: __SerdeContext): any => { return { - ...(input.Args !== undefined && { Args: serializeAws_json1_1CodeGenNodeArgs(input.Args, context) }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LineNumber !== undefined && { LineNumber: input.LineNumber }), - ...(input.NodeType !== undefined && { NodeType: input.NodeType }), + ...(input.Args !== undefined && + input.Args !== null && { Args: serializeAws_json1_1CodeGenNodeArgs(input.Args, context) }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LineNumber !== undefined && input.LineNumber !== null && { LineNumber: input.LineNumber }), + ...(input.NodeType !== undefined && input.NodeType !== null && { NodeType: input.NodeType }), }; }; const serializeAws_json1_1CodeGenNodeArg = (input: CodeGenNodeArg, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Param !== undefined && { Param: input.Param }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Param !== undefined && input.Param !== null && { Param: input.Param }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1CodeGenNodeArgs = (input: CodeGenNodeArg[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CodeGenNodeArg(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CodeGenNodeArg(entry, context); + }); }; const serializeAws_json1_1Column = (input: Column, context: __SerdeContext): any => { return { - ...(input.Comment !== undefined && { Comment: input.Comment }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Comment !== undefined && input.Comment !== null && { Comment: input.Comment }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1ColumnList = (input: Column[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Column(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Column(entry, context); + }); }; const serializeAws_json1_1ColumnStatistics = (input: ColumnStatistics, context: __SerdeContext): any => { return { - ...(input.AnalyzedTime !== undefined && { AnalyzedTime: Math.round(input.AnalyzedTime.getTime() / 1000) }), - ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), - ...(input.ColumnType !== undefined && { ColumnType: input.ColumnType }), - ...(input.StatisticsData !== undefined && { - StatisticsData: serializeAws_json1_1ColumnStatisticsData(input.StatisticsData, context), - }), + ...(input.AnalyzedTime !== undefined && + input.AnalyzedTime !== null && { AnalyzedTime: Math.round(input.AnalyzedTime.getTime() / 1000) }), + ...(input.ColumnName !== undefined && input.ColumnName !== null && { ColumnName: input.ColumnName }), + ...(input.ColumnType !== undefined && input.ColumnType !== null && { ColumnType: input.ColumnType }), + ...(input.StatisticsData !== undefined && + input.StatisticsData !== null && { + StatisticsData: serializeAws_json1_1ColumnStatisticsData(input.StatisticsData, context), + }), }; }; const serializeAws_json1_1ColumnStatisticsData = (input: ColumnStatisticsData, context: __SerdeContext): any => { return { - ...(input.BinaryColumnStatisticsData !== undefined && { - BinaryColumnStatisticsData: serializeAws_json1_1BinaryColumnStatisticsData( - input.BinaryColumnStatisticsData, - context - ), - }), - ...(input.BooleanColumnStatisticsData !== undefined && { - BooleanColumnStatisticsData: serializeAws_json1_1BooleanColumnStatisticsData( - input.BooleanColumnStatisticsData, - context - ), - }), - ...(input.DateColumnStatisticsData !== undefined && { - DateColumnStatisticsData: serializeAws_json1_1DateColumnStatisticsData(input.DateColumnStatisticsData, context), - }), - ...(input.DecimalColumnStatisticsData !== undefined && { - DecimalColumnStatisticsData: serializeAws_json1_1DecimalColumnStatisticsData( - input.DecimalColumnStatisticsData, - context - ), - }), - ...(input.DoubleColumnStatisticsData !== undefined && { - DoubleColumnStatisticsData: serializeAws_json1_1DoubleColumnStatisticsData( - input.DoubleColumnStatisticsData, - context - ), - }), - ...(input.LongColumnStatisticsData !== undefined && { - LongColumnStatisticsData: serializeAws_json1_1LongColumnStatisticsData(input.LongColumnStatisticsData, context), - }), - ...(input.StringColumnStatisticsData !== undefined && { - StringColumnStatisticsData: serializeAws_json1_1StringColumnStatisticsData( - input.StringColumnStatisticsData, - context - ), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.BinaryColumnStatisticsData !== undefined && + input.BinaryColumnStatisticsData !== null && { + BinaryColumnStatisticsData: serializeAws_json1_1BinaryColumnStatisticsData( + input.BinaryColumnStatisticsData, + context + ), + }), + ...(input.BooleanColumnStatisticsData !== undefined && + input.BooleanColumnStatisticsData !== null && { + BooleanColumnStatisticsData: serializeAws_json1_1BooleanColumnStatisticsData( + input.BooleanColumnStatisticsData, + context + ), + }), + ...(input.DateColumnStatisticsData !== undefined && + input.DateColumnStatisticsData !== null && { + DateColumnStatisticsData: serializeAws_json1_1DateColumnStatisticsData(input.DateColumnStatisticsData, context), + }), + ...(input.DecimalColumnStatisticsData !== undefined && + input.DecimalColumnStatisticsData !== null && { + DecimalColumnStatisticsData: serializeAws_json1_1DecimalColumnStatisticsData( + input.DecimalColumnStatisticsData, + context + ), + }), + ...(input.DoubleColumnStatisticsData !== undefined && + input.DoubleColumnStatisticsData !== null && { + DoubleColumnStatisticsData: serializeAws_json1_1DoubleColumnStatisticsData( + input.DoubleColumnStatisticsData, + context + ), + }), + ...(input.LongColumnStatisticsData !== undefined && + input.LongColumnStatisticsData !== null && { + LongColumnStatisticsData: serializeAws_json1_1LongColumnStatisticsData(input.LongColumnStatisticsData, context), + }), + ...(input.StringColumnStatisticsData !== undefined && + input.StringColumnStatisticsData !== null && { + StringColumnStatisticsData: serializeAws_json1_1StringColumnStatisticsData( + input.StringColumnStatisticsData, + context + ), + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1ColumnValueStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Condition = (input: Condition, context: __SerdeContext): any => { return { - ...(input.CrawlState !== undefined && { CrawlState: input.CrawlState }), - ...(input.CrawlerName !== undefined && { CrawlerName: input.CrawlerName }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.LogicalOperator !== undefined && { LogicalOperator: input.LogicalOperator }), - ...(input.State !== undefined && { State: input.State }), + ...(input.CrawlState !== undefined && input.CrawlState !== null && { CrawlState: input.CrawlState }), + ...(input.CrawlerName !== undefined && input.CrawlerName !== null && { CrawlerName: input.CrawlerName }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.LogicalOperator !== undefined && + input.LogicalOperator !== null && { LogicalOperator: input.LogicalOperator }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; const serializeAws_json1_1ConditionList = (input: Condition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Condition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Condition(entry, context); + }); }; const serializeAws_json1_1ConnectionInput = (input: ConnectionInput, context: __SerdeContext): any => { return { - ...(input.ConnectionProperties !== undefined && { - ConnectionProperties: serializeAws_json1_1ConnectionProperties(input.ConnectionProperties, context), - }), - ...(input.ConnectionType !== undefined && { ConnectionType: input.ConnectionType }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.MatchCriteria !== undefined && { - MatchCriteria: serializeAws_json1_1MatchCriteria(input.MatchCriteria, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PhysicalConnectionRequirements !== undefined && { - PhysicalConnectionRequirements: serializeAws_json1_1PhysicalConnectionRequirements( - input.PhysicalConnectionRequirements, - context - ), - }), + ...(input.ConnectionProperties !== undefined && + input.ConnectionProperties !== null && { + ConnectionProperties: serializeAws_json1_1ConnectionProperties(input.ConnectionProperties, context), + }), + ...(input.ConnectionType !== undefined && + input.ConnectionType !== null && { ConnectionType: input.ConnectionType }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.MatchCriteria !== undefined && + input.MatchCriteria !== null && { + MatchCriteria: serializeAws_json1_1MatchCriteria(input.MatchCriteria, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PhysicalConnectionRequirements !== undefined && + input.PhysicalConnectionRequirements !== null && { + PhysicalConnectionRequirements: serializeAws_json1_1PhysicalConnectionRequirements( + input.PhysicalConnectionRequirements, + context + ), + }), }; }; @@ -16448,105 +16444,133 @@ const serializeAws_json1_1ConnectionPasswordEncryption = ( context: __SerdeContext ): any => { return { - ...(input.AwsKmsKeyId !== undefined && { AwsKmsKeyId: input.AwsKmsKeyId }), - ...(input.ReturnConnectionPasswordEncrypted !== undefined && { - ReturnConnectionPasswordEncrypted: input.ReturnConnectionPasswordEncrypted, - }), + ...(input.AwsKmsKeyId !== undefined && input.AwsKmsKeyId !== null && { AwsKmsKeyId: input.AwsKmsKeyId }), + ...(input.ReturnConnectionPasswordEncrypted !== undefined && + input.ReturnConnectionPasswordEncrypted !== null && { + ReturnConnectionPasswordEncrypted: input.ReturnConnectionPasswordEncrypted, + }), }; }; const serializeAws_json1_1ConnectionProperties = (input: { [key: string]: string }, context: __SerdeContext): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [ConnectionPropertyKey | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [ConnectionPropertyKey | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; const serializeAws_json1_1ConnectionsList = (input: ConnectionsList, context: __SerdeContext): any => { return { - ...(input.Connections !== undefined && { - Connections: serializeAws_json1_1OrchestrationStringList(input.Connections, context), - }), + ...(input.Connections !== undefined && + input.Connections !== null && { + Connections: serializeAws_json1_1OrchestrationStringList(input.Connections, context), + }), }; }; const serializeAws_json1_1CrawlerNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CrawlerTargets = (input: CrawlerTargets, context: __SerdeContext): any => { return { - ...(input.CatalogTargets !== undefined && { - CatalogTargets: serializeAws_json1_1CatalogTargetList(input.CatalogTargets, context), - }), - ...(input.DynamoDBTargets !== undefined && { - DynamoDBTargets: serializeAws_json1_1DynamoDBTargetList(input.DynamoDBTargets, context), - }), - ...(input.JdbcTargets !== undefined && { - JdbcTargets: serializeAws_json1_1JdbcTargetList(input.JdbcTargets, context), - }), - ...(input.MongoDBTargets !== undefined && { - MongoDBTargets: serializeAws_json1_1MongoDBTargetList(input.MongoDBTargets, context), - }), - ...(input.S3Targets !== undefined && { S3Targets: serializeAws_json1_1S3TargetList(input.S3Targets, context) }), + ...(input.CatalogTargets !== undefined && + input.CatalogTargets !== null && { + CatalogTargets: serializeAws_json1_1CatalogTargetList(input.CatalogTargets, context), + }), + ...(input.DynamoDBTargets !== undefined && + input.DynamoDBTargets !== null && { + DynamoDBTargets: serializeAws_json1_1DynamoDBTargetList(input.DynamoDBTargets, context), + }), + ...(input.JdbcTargets !== undefined && + input.JdbcTargets !== null && { JdbcTargets: serializeAws_json1_1JdbcTargetList(input.JdbcTargets, context) }), + ...(input.MongoDBTargets !== undefined && + input.MongoDBTargets !== null && { + MongoDBTargets: serializeAws_json1_1MongoDBTargetList(input.MongoDBTargets, context), + }), + ...(input.S3Targets !== undefined && + input.S3Targets !== null && { S3Targets: serializeAws_json1_1S3TargetList(input.S3Targets, context) }), }; }; const serializeAws_json1_1CreateClassifierRequest = (input: CreateClassifierRequest, context: __SerdeContext): any => { return { - ...(input.CsvClassifier !== undefined && { - CsvClassifier: serializeAws_json1_1CreateCsvClassifierRequest(input.CsvClassifier, context), - }), - ...(input.GrokClassifier !== undefined && { - GrokClassifier: serializeAws_json1_1CreateGrokClassifierRequest(input.GrokClassifier, context), - }), - ...(input.JsonClassifier !== undefined && { - JsonClassifier: serializeAws_json1_1CreateJsonClassifierRequest(input.JsonClassifier, context), - }), - ...(input.XMLClassifier !== undefined && { - XMLClassifier: serializeAws_json1_1CreateXMLClassifierRequest(input.XMLClassifier, context), - }), + ...(input.CsvClassifier !== undefined && + input.CsvClassifier !== null && { + CsvClassifier: serializeAws_json1_1CreateCsvClassifierRequest(input.CsvClassifier, context), + }), + ...(input.GrokClassifier !== undefined && + input.GrokClassifier !== null && { + GrokClassifier: serializeAws_json1_1CreateGrokClassifierRequest(input.GrokClassifier, context), + }), + ...(input.JsonClassifier !== undefined && + input.JsonClassifier !== null && { + JsonClassifier: serializeAws_json1_1CreateJsonClassifierRequest(input.JsonClassifier, context), + }), + ...(input.XMLClassifier !== undefined && + input.XMLClassifier !== null && { + XMLClassifier: serializeAws_json1_1CreateXMLClassifierRequest(input.XMLClassifier, context), + }), }; }; const serializeAws_json1_1CreateConnectionRequest = (input: CreateConnectionRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ConnectionInput !== undefined && { - ConnectionInput: serializeAws_json1_1ConnectionInput(input.ConnectionInput, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ConnectionInput !== undefined && + input.ConnectionInput !== null && { + ConnectionInput: serializeAws_json1_1ConnectionInput(input.ConnectionInput, context), + }), }; }; const serializeAws_json1_1CreateCrawlerRequest = (input: CreateCrawlerRequest, context: __SerdeContext): any => { return { - ...(input.Classifiers !== undefined && { - Classifiers: serializeAws_json1_1ClassifierNameList(input.Classifiers, context), - }), - ...(input.Configuration !== undefined && { Configuration: input.Configuration }), - ...(input.CrawlerSecurityConfiguration !== undefined && { - CrawlerSecurityConfiguration: input.CrawlerSecurityConfiguration, - }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LineageConfiguration !== undefined && { - LineageConfiguration: serializeAws_json1_1LineageConfiguration(input.LineageConfiguration, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RecrawlPolicy !== undefined && { - RecrawlPolicy: serializeAws_json1_1RecrawlPolicy(input.RecrawlPolicy, context), - }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), - ...(input.SchemaChangePolicy !== undefined && { - SchemaChangePolicy: serializeAws_json1_1SchemaChangePolicy(input.SchemaChangePolicy, context), - }), - ...(input.TablePrefix !== undefined && { TablePrefix: input.TablePrefix }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1CrawlerTargets(input.Targets, context) }), + ...(input.Classifiers !== undefined && + input.Classifiers !== null && { + Classifiers: serializeAws_json1_1ClassifierNameList(input.Classifiers, context), + }), + ...(input.Configuration !== undefined && input.Configuration !== null && { Configuration: input.Configuration }), + ...(input.CrawlerSecurityConfiguration !== undefined && + input.CrawlerSecurityConfiguration !== null && { + CrawlerSecurityConfiguration: input.CrawlerSecurityConfiguration, + }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LineageConfiguration !== undefined && + input.LineageConfiguration !== null && { + LineageConfiguration: serializeAws_json1_1LineageConfiguration(input.LineageConfiguration, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RecrawlPolicy !== undefined && + input.RecrawlPolicy !== null && { + RecrawlPolicy: serializeAws_json1_1RecrawlPolicy(input.RecrawlPolicy, context), + }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), + ...(input.SchemaChangePolicy !== undefined && + input.SchemaChangePolicy !== null && { + SchemaChangePolicy: serializeAws_json1_1SchemaChangePolicy(input.SchemaChangePolicy, context), + }), + ...(input.TablePrefix !== undefined && input.TablePrefix !== null && { TablePrefix: input.TablePrefix }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1CrawlerTargets(input.Targets, context) }), }; }; @@ -16555,22 +16579,27 @@ const serializeAws_json1_1CreateCsvClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.AllowSingleColumn !== undefined && { AllowSingleColumn: input.AllowSingleColumn }), - ...(input.ContainsHeader !== undefined && { ContainsHeader: input.ContainsHeader }), - ...(input.Delimiter !== undefined && { Delimiter: input.Delimiter }), - ...(input.DisableValueTrimming !== undefined && { DisableValueTrimming: input.DisableValueTrimming }), - ...(input.Header !== undefined && { Header: serializeAws_json1_1CsvHeader(input.Header, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.QuoteSymbol !== undefined && { QuoteSymbol: input.QuoteSymbol }), + ...(input.AllowSingleColumn !== undefined && + input.AllowSingleColumn !== null && { AllowSingleColumn: input.AllowSingleColumn }), + ...(input.ContainsHeader !== undefined && + input.ContainsHeader !== null && { ContainsHeader: input.ContainsHeader }), + ...(input.Delimiter !== undefined && input.Delimiter !== null && { Delimiter: input.Delimiter }), + ...(input.DisableValueTrimming !== undefined && + input.DisableValueTrimming !== null && { DisableValueTrimming: input.DisableValueTrimming }), + ...(input.Header !== undefined && + input.Header !== null && { Header: serializeAws_json1_1CsvHeader(input.Header, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.QuoteSymbol !== undefined && input.QuoteSymbol !== null && { QuoteSymbol: input.QuoteSymbol }), }; }; const serializeAws_json1_1CreateDatabaseRequest = (input: CreateDatabaseRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseInput !== undefined && { - DatabaseInput: serializeAws_json1_1DatabaseInput(input.DatabaseInput, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseInput !== undefined && + input.DatabaseInput !== null && { + DatabaseInput: serializeAws_json1_1DatabaseInput(input.DatabaseInput, context), + }), }; }; @@ -16579,25 +16608,30 @@ const serializeAws_json1_1CreateDevEndpointRequest = ( context: __SerdeContext ): any => { return { - ...(input.Arguments !== undefined && { Arguments: serializeAws_json1_1MapValue(input.Arguments, context) }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.ExtraJarsS3Path !== undefined && { ExtraJarsS3Path: input.ExtraJarsS3Path }), - ...(input.ExtraPythonLibsS3Path !== undefined && { ExtraPythonLibsS3Path: input.ExtraPythonLibsS3Path }), - ...(input.GlueVersion !== undefined && { GlueVersion: input.GlueVersion }), - ...(input.NumberOfNodes !== undefined && { NumberOfNodes: input.NumberOfNodes }), - ...(input.NumberOfWorkers !== undefined && { NumberOfWorkers: input.NumberOfWorkers }), - ...(input.PublicKey !== undefined && { PublicKey: input.PublicKey }), - ...(input.PublicKeys !== undefined && { - PublicKeys: serializeAws_json1_1PublicKeysList(input.PublicKeys, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.SecurityConfiguration !== undefined && { SecurityConfiguration: input.SecurityConfiguration }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1StringList(input.SecurityGroupIds, context), - }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), - ...(input.WorkerType !== undefined && { WorkerType: input.WorkerType }), + ...(input.Arguments !== undefined && + input.Arguments !== null && { Arguments: serializeAws_json1_1MapValue(input.Arguments, context) }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.ExtraJarsS3Path !== undefined && + input.ExtraJarsS3Path !== null && { ExtraJarsS3Path: input.ExtraJarsS3Path }), + ...(input.ExtraPythonLibsS3Path !== undefined && + input.ExtraPythonLibsS3Path !== null && { ExtraPythonLibsS3Path: input.ExtraPythonLibsS3Path }), + ...(input.GlueVersion !== undefined && input.GlueVersion !== null && { GlueVersion: input.GlueVersion }), + ...(input.NumberOfNodes !== undefined && input.NumberOfNodes !== null && { NumberOfNodes: input.NumberOfNodes }), + ...(input.NumberOfWorkers !== undefined && + input.NumberOfWorkers !== null && { NumberOfWorkers: input.NumberOfWorkers }), + ...(input.PublicKey !== undefined && input.PublicKey !== null && { PublicKey: input.PublicKey }), + ...(input.PublicKeys !== undefined && + input.PublicKeys !== null && { PublicKeys: serializeAws_json1_1PublicKeysList(input.PublicKeys, context) }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.SecurityConfiguration !== undefined && + input.SecurityConfiguration !== null && { SecurityConfiguration: input.SecurityConfiguration }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1StringList(input.SecurityGroupIds, context), + }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.WorkerType !== undefined && input.WorkerType !== null && { WorkerType: input.WorkerType }), }; }; @@ -16606,44 +16640,53 @@ const serializeAws_json1_1CreateGrokClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.Classification !== undefined && { Classification: input.Classification }), - ...(input.CustomPatterns !== undefined && { CustomPatterns: input.CustomPatterns }), - ...(input.GrokPattern !== undefined && { GrokPattern: input.GrokPattern }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Classification !== undefined && + input.Classification !== null && { Classification: input.Classification }), + ...(input.CustomPatterns !== undefined && + input.CustomPatterns !== null && { CustomPatterns: input.CustomPatterns }), + ...(input.GrokPattern !== undefined && input.GrokPattern !== null && { GrokPattern: input.GrokPattern }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1CreateJobRequest = (input: CreateJobRequest, context: __SerdeContext): any => { return { - ...(input.AllocatedCapacity !== undefined && { AllocatedCapacity: input.AllocatedCapacity }), - ...(input.Command !== undefined && { Command: serializeAws_json1_1JobCommand(input.Command, context) }), - ...(input.Connections !== undefined && { - Connections: serializeAws_json1_1ConnectionsList(input.Connections, context), - }), - ...(input.DefaultArguments !== undefined && { - DefaultArguments: serializeAws_json1_1GenericMap(input.DefaultArguments, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ExecutionProperty !== undefined && { - ExecutionProperty: serializeAws_json1_1ExecutionProperty(input.ExecutionProperty, context), - }), - ...(input.GlueVersion !== undefined && { GlueVersion: input.GlueVersion }), - ...(input.LogUri !== undefined && { LogUri: input.LogUri }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MaxRetries !== undefined && { MaxRetries: input.MaxRetries }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NonOverridableArguments !== undefined && { - NonOverridableArguments: serializeAws_json1_1GenericMap(input.NonOverridableArguments, context), - }), - ...(input.NotificationProperty !== undefined && { - NotificationProperty: serializeAws_json1_1NotificationProperty(input.NotificationProperty, context), - }), - ...(input.NumberOfWorkers !== undefined && { NumberOfWorkers: input.NumberOfWorkers }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.SecurityConfiguration !== undefined && { SecurityConfiguration: input.SecurityConfiguration }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.WorkerType !== undefined && { WorkerType: input.WorkerType }), + ...(input.AllocatedCapacity !== undefined && + input.AllocatedCapacity !== null && { AllocatedCapacity: input.AllocatedCapacity }), + ...(input.Command !== undefined && + input.Command !== null && { Command: serializeAws_json1_1JobCommand(input.Command, context) }), + ...(input.Connections !== undefined && + input.Connections !== null && { Connections: serializeAws_json1_1ConnectionsList(input.Connections, context) }), + ...(input.DefaultArguments !== undefined && + input.DefaultArguments !== null && { + DefaultArguments: serializeAws_json1_1GenericMap(input.DefaultArguments, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ExecutionProperty !== undefined && + input.ExecutionProperty !== null && { + ExecutionProperty: serializeAws_json1_1ExecutionProperty(input.ExecutionProperty, context), + }), + ...(input.GlueVersion !== undefined && input.GlueVersion !== null && { GlueVersion: input.GlueVersion }), + ...(input.LogUri !== undefined && input.LogUri !== null && { LogUri: input.LogUri }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MaxRetries !== undefined && input.MaxRetries !== null && { MaxRetries: input.MaxRetries }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NonOverridableArguments !== undefined && + input.NonOverridableArguments !== null && { + NonOverridableArguments: serializeAws_json1_1GenericMap(input.NonOverridableArguments, context), + }), + ...(input.NotificationProperty !== undefined && + input.NotificationProperty !== null && { + NotificationProperty: serializeAws_json1_1NotificationProperty(input.NotificationProperty, context), + }), + ...(input.NumberOfWorkers !== undefined && + input.NumberOfWorkers !== null && { NumberOfWorkers: input.NumberOfWorkers }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.SecurityConfiguration !== undefined && + input.SecurityConfiguration !== null && { SecurityConfiguration: input.SecurityConfiguration }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.WorkerType !== undefined && input.WorkerType !== null && { WorkerType: input.WorkerType }), }; }; @@ -16652,8 +16695,8 @@ const serializeAws_json1_1CreateJsonClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.JsonPath !== undefined && { JsonPath: input.JsonPath }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.JsonPath !== undefined && input.JsonPath !== null && { JsonPath: input.JsonPath }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -16662,25 +16705,27 @@ const serializeAws_json1_1CreateMLTransformRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.GlueVersion !== undefined && { GlueVersion: input.GlueVersion }), - ...(input.InputRecordTables !== undefined && { - InputRecordTables: serializeAws_json1_1GlueTables(input.InputRecordTables, context), - }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MaxRetries !== undefined && { MaxRetries: input.MaxRetries }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NumberOfWorkers !== undefined && { NumberOfWorkers: input.NumberOfWorkers }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1TransformParameters(input.Parameters, context), - }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.TransformEncryption !== undefined && { - TransformEncryption: serializeAws_json1_1TransformEncryption(input.TransformEncryption, context), - }), - ...(input.WorkerType !== undefined && { WorkerType: input.WorkerType }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.GlueVersion !== undefined && input.GlueVersion !== null && { GlueVersion: input.GlueVersion }), + ...(input.InputRecordTables !== undefined && + input.InputRecordTables !== null && { + InputRecordTables: serializeAws_json1_1GlueTables(input.InputRecordTables, context), + }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MaxRetries !== undefined && input.MaxRetries !== null && { MaxRetries: input.MaxRetries }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NumberOfWorkers !== undefined && + input.NumberOfWorkers !== null && { NumberOfWorkers: input.NumberOfWorkers }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1TransformParameters(input.Parameters, context) }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.TransformEncryption !== undefined && + input.TransformEncryption !== null && { + TransformEncryption: serializeAws_json1_1TransformEncryption(input.TransformEncryption, context), + }), + ...(input.WorkerType !== undefined && input.WorkerType !== null && { WorkerType: input.WorkerType }), }; }; @@ -16689,51 +16734,57 @@ const serializeAws_json1_1CreatePartitionIndexRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionIndex !== undefined && { - PartitionIndex: serializeAws_json1_1PartitionIndex(input.PartitionIndex, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionIndex !== undefined && + input.PartitionIndex !== null && { + PartitionIndex: serializeAws_json1_1PartitionIndex(input.PartitionIndex, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1CreatePartitionRequest = (input: CreatePartitionRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionInput !== undefined && { - PartitionInput: serializeAws_json1_1PartitionInput(input.PartitionInput, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionInput !== undefined && + input.PartitionInput !== null && { + PartitionInput: serializeAws_json1_1PartitionInput(input.PartitionInput, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1CreateRegistryInput = (input: CreateRegistryInput, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.RegistryName !== undefined && { RegistryName: input.RegistryName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.RegistryName !== undefined && input.RegistryName !== null && { RegistryName: input.RegistryName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), }; }; const serializeAws_json1_1CreateSchemaInput = (input: CreateSchemaInput, context: __SerdeContext): any => { return { - ...(input.Compatibility !== undefined && { Compatibility: input.Compatibility }), - ...(input.DataFormat !== undefined && { DataFormat: input.DataFormat }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.RegistryId !== undefined && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), - ...(input.SchemaDefinition !== undefined && { SchemaDefinition: input.SchemaDefinition }), - ...(input.SchemaName !== undefined && { SchemaName: input.SchemaName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.Compatibility !== undefined && input.Compatibility !== null && { Compatibility: input.Compatibility }), + ...(input.DataFormat !== undefined && input.DataFormat !== null && { DataFormat: input.DataFormat }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.RegistryId !== undefined && + input.RegistryId !== null && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), + ...(input.SchemaDefinition !== undefined && + input.SchemaDefinition !== null && { SchemaDefinition: input.SchemaDefinition }), + ...(input.SchemaName !== undefined && input.SchemaName !== null && { SchemaName: input.SchemaName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), }; }; const serializeAws_json1_1CreateScriptRequest = (input: CreateScriptRequest, context: __SerdeContext): any => { return { - ...(input.DagEdges !== undefined && { DagEdges: serializeAws_json1_1DagEdges(input.DagEdges, context) }), - ...(input.DagNodes !== undefined && { DagNodes: serializeAws_json1_1DagNodes(input.DagNodes, context) }), - ...(input.Language !== undefined && { Language: input.Language }), + ...(input.DagEdges !== undefined && + input.DagEdges !== null && { DagEdges: serializeAws_json1_1DagEdges(input.DagEdges, context) }), + ...(input.DagNodes !== undefined && + input.DagNodes !== null && { DagNodes: serializeAws_json1_1DagNodes(input.DagNodes, context) }), + ...(input.Language !== undefined && input.Language !== null && { Language: input.Language }), }; }; @@ -16742,35 +16793,41 @@ const serializeAws_json1_1CreateSecurityConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.EncryptionConfiguration !== undefined && { - EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.EncryptionConfiguration !== undefined && + input.EncryptionConfiguration !== null && { + EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration(input.EncryptionConfiguration, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1CreateTableRequest = (input: CreateTableRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionIndexes !== undefined && { - PartitionIndexes: serializeAws_json1_1PartitionIndexList(input.PartitionIndexes, context), - }), - ...(input.TableInput !== undefined && { TableInput: serializeAws_json1_1TableInput(input.TableInput, context) }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionIndexes !== undefined && + input.PartitionIndexes !== null && { + PartitionIndexes: serializeAws_json1_1PartitionIndexList(input.PartitionIndexes, context), + }), + ...(input.TableInput !== undefined && + input.TableInput !== null && { TableInput: serializeAws_json1_1TableInput(input.TableInput, context) }), }; }; const serializeAws_json1_1CreateTriggerRequest = (input: CreateTriggerRequest, context: __SerdeContext): any => { return { - ...(input.Actions !== undefined && { Actions: serializeAws_json1_1ActionList(input.Actions, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Predicate !== undefined && { Predicate: serializeAws_json1_1Predicate(input.Predicate, context) }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), - ...(input.StartOnCreation !== undefined && { StartOnCreation: input.StartOnCreation }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.WorkflowName !== undefined && { WorkflowName: input.WorkflowName }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_json1_1ActionList(input.Actions, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Predicate !== undefined && + input.Predicate !== null && { Predicate: serializeAws_json1_1Predicate(input.Predicate, context) }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), + ...(input.StartOnCreation !== undefined && + input.StartOnCreation !== null && { StartOnCreation: input.StartOnCreation }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.WorkflowName !== undefined && input.WorkflowName !== null && { WorkflowName: input.WorkflowName }), }; }; @@ -16779,23 +16836,26 @@ const serializeAws_json1_1CreateUserDefinedFunctionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.FunctionInput !== undefined && { - FunctionInput: serializeAws_json1_1UserDefinedFunctionInput(input.FunctionInput, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.FunctionInput !== undefined && + input.FunctionInput !== null && { + FunctionInput: serializeAws_json1_1UserDefinedFunctionInput(input.FunctionInput, context), + }), }; }; const serializeAws_json1_1CreateWorkflowRequest = (input: CreateWorkflowRequest, context: __SerdeContext): any => { return { - ...(input.DefaultRunProperties !== undefined && { - DefaultRunProperties: serializeAws_json1_1WorkflowRunProperties(input.DefaultRunProperties, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.MaxConcurrentRuns !== undefined && { MaxConcurrentRuns: input.MaxConcurrentRuns }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.DefaultRunProperties !== undefined && + input.DefaultRunProperties !== null && { + DefaultRunProperties: serializeAws_json1_1WorkflowRunProperties(input.DefaultRunProperties, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.MaxConcurrentRuns !== undefined && + input.MaxConcurrentRuns !== null && { MaxConcurrentRuns: input.MaxConcurrentRuns }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), }; }; @@ -16804,46 +16864,71 @@ const serializeAws_json1_1CreateXMLClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.Classification !== undefined && { Classification: input.Classification }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RowTag !== undefined && { RowTag: input.RowTag }), + ...(input.Classification !== undefined && + input.Classification !== null && { Classification: input.Classification }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RowTag !== undefined && input.RowTag !== null && { RowTag: input.RowTag }), }; }; const serializeAws_json1_1CsvHeader = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DagEdges = (input: CodeGenEdge[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CodeGenEdge(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CodeGenEdge(entry, context); + }); }; const serializeAws_json1_1DagNodes = (input: CodeGenNode[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CodeGenNode(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CodeGenNode(entry, context); + }); }; const serializeAws_json1_1DatabaseIdentifier = (input: DatabaseIdentifier, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), }; }; const serializeAws_json1_1DatabaseInput = (input: DatabaseInput, context: __SerdeContext): any => { return { - ...(input.CreateTableDefaultPermissions !== undefined && { - CreateTableDefaultPermissions: serializeAws_json1_1PrincipalPermissionsList( - input.CreateTableDefaultPermissions, - context - ), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LocationUri !== undefined && { LocationUri: input.LocationUri }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), - ...(input.TargetDatabase !== undefined && { - TargetDatabase: serializeAws_json1_1DatabaseIdentifier(input.TargetDatabase, context), - }), + ...(input.CreateTableDefaultPermissions !== undefined && + input.CreateTableDefaultPermissions !== null && { + CreateTableDefaultPermissions: serializeAws_json1_1PrincipalPermissionsList( + input.CreateTableDefaultPermissions, + context + ), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LocationUri !== undefined && input.LocationUri !== null && { LocationUri: input.LocationUri }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), + ...(input.TargetDatabase !== undefined && + input.TargetDatabase !== null && { + TargetDatabase: serializeAws_json1_1DatabaseIdentifier(input.TargetDatabase, context), + }), }; }; @@ -16852,23 +16937,24 @@ const serializeAws_json1_1DataCatalogEncryptionSettings = ( context: __SerdeContext ): any => { return { - ...(input.ConnectionPasswordEncryption !== undefined && { - ConnectionPasswordEncryption: serializeAws_json1_1ConnectionPasswordEncryption( - input.ConnectionPasswordEncryption, - context - ), - }), - ...(input.EncryptionAtRest !== undefined && { - EncryptionAtRest: serializeAws_json1_1EncryptionAtRest(input.EncryptionAtRest, context), - }), + ...(input.ConnectionPasswordEncryption !== undefined && + input.ConnectionPasswordEncryption !== null && { + ConnectionPasswordEncryption: serializeAws_json1_1ConnectionPasswordEncryption( + input.ConnectionPasswordEncryption, + context + ), + }), + ...(input.EncryptionAtRest !== undefined && + input.EncryptionAtRest !== null && { + EncryptionAtRest: serializeAws_json1_1EncryptionAtRest(input.EncryptionAtRest, context), + }), }; }; const serializeAws_json1_1DataLakePrincipal = (input: DataLakePrincipal, context: __SerdeContext): any => { return { - ...(input.DataLakePrincipalIdentifier !== undefined && { - DataLakePrincipalIdentifier: input.DataLakePrincipalIdentifier, - }), + ...(input.DataLakePrincipalIdentifier !== undefined && + input.DataLakePrincipalIdentifier !== null && { DataLakePrincipalIdentifier: input.DataLakePrincipalIdentifier }), }; }; @@ -16877,10 +16963,13 @@ const serializeAws_json1_1DateColumnStatisticsData = ( context: __SerdeContext ): any => { return { - ...(input.MaximumValue !== undefined && { MaximumValue: Math.round(input.MaximumValue.getTime() / 1000) }), - ...(input.MinimumValue !== undefined && { MinimumValue: Math.round(input.MinimumValue.getTime() / 1000) }), - ...(input.NumberOfDistinctValues !== undefined && { NumberOfDistinctValues: input.NumberOfDistinctValues }), - ...(input.NumberOfNulls !== undefined && { NumberOfNulls: input.NumberOfNulls }), + ...(input.MaximumValue !== undefined && + input.MaximumValue !== null && { MaximumValue: Math.round(input.MaximumValue.getTime() / 1000) }), + ...(input.MinimumValue !== undefined && + input.MinimumValue !== null && { MinimumValue: Math.round(input.MinimumValue.getTime() / 1000) }), + ...(input.NumberOfDistinctValues !== undefined && + input.NumberOfDistinctValues !== null && { NumberOfDistinctValues: input.NumberOfDistinctValues }), + ...(input.NumberOfNulls !== undefined && input.NumberOfNulls !== null && { NumberOfNulls: input.NumberOfNulls }), }; }; @@ -16889,27 +16978,27 @@ const serializeAws_json1_1DecimalColumnStatisticsData = ( context: __SerdeContext ): any => { return { - ...(input.MaximumValue !== undefined && { - MaximumValue: serializeAws_json1_1DecimalNumber(input.MaximumValue, context), - }), - ...(input.MinimumValue !== undefined && { - MinimumValue: serializeAws_json1_1DecimalNumber(input.MinimumValue, context), - }), - ...(input.NumberOfDistinctValues !== undefined && { NumberOfDistinctValues: input.NumberOfDistinctValues }), - ...(input.NumberOfNulls !== undefined && { NumberOfNulls: input.NumberOfNulls }), + ...(input.MaximumValue !== undefined && + input.MaximumValue !== null && { MaximumValue: serializeAws_json1_1DecimalNumber(input.MaximumValue, context) }), + ...(input.MinimumValue !== undefined && + input.MinimumValue !== null && { MinimumValue: serializeAws_json1_1DecimalNumber(input.MinimumValue, context) }), + ...(input.NumberOfDistinctValues !== undefined && + input.NumberOfDistinctValues !== null && { NumberOfDistinctValues: input.NumberOfDistinctValues }), + ...(input.NumberOfNulls !== undefined && input.NumberOfNulls !== null && { NumberOfNulls: input.NumberOfNulls }), }; }; const serializeAws_json1_1DecimalNumber = (input: DecimalNumber, context: __SerdeContext): any => { return { - ...(input.Scale !== undefined && { Scale: input.Scale }), - ...(input.UnscaledValue !== undefined && { UnscaledValue: context.base64Encoder(input.UnscaledValue) }), + ...(input.Scale !== undefined && input.Scale !== null && { Scale: input.Scale }), + ...(input.UnscaledValue !== undefined && + input.UnscaledValue !== null && { UnscaledValue: context.base64Encoder(input.UnscaledValue) }), }; }; const serializeAws_json1_1DeleteClassifierRequest = (input: DeleteClassifierRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -16918,13 +17007,14 @@ const serializeAws_json1_1DeleteColumnStatisticsForPartitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionValues !== undefined && { - PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ColumnName !== undefined && input.ColumnName !== null && { ColumnName: input.ColumnName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionValues !== undefined && + input.PartitionValues !== null && { + PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -16933,34 +17023,42 @@ const serializeAws_json1_1DeleteColumnStatisticsForTableRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ColumnName !== undefined && input.ColumnName !== null && { ColumnName: input.ColumnName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1DeleteConnectionNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteConnectionRequest = (input: DeleteConnectionRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ConnectionName !== undefined && { ConnectionName: input.ConnectionName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ConnectionName !== undefined && + input.ConnectionName !== null && { ConnectionName: input.ConnectionName }), }; }; const serializeAws_json1_1DeleteCrawlerRequest = (input: DeleteCrawlerRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeleteDatabaseRequest = (input: DeleteDatabaseRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -16969,13 +17067,13 @@ const serializeAws_json1_1DeleteDevEndpointRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), }; }; const serializeAws_json1_1DeleteJobRequest = (input: DeleteJobRequest, context: __SerdeContext): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), }; }; @@ -16984,7 +17082,7 @@ const serializeAws_json1_1DeleteMLTransformRequest = ( context: __SerdeContext ): any => { return { - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), }; }; @@ -16993,27 +17091,29 @@ const serializeAws_json1_1DeletePartitionIndexRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1DeletePartitionRequest = (input: DeletePartitionRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionValues !== undefined && { - PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionValues !== undefined && + input.PartitionValues !== null && { + PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1DeleteRegistryInput = (input: DeleteRegistryInput, context: __SerdeContext): any => { return { - ...(input.RegistryId !== undefined && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), + ...(input.RegistryId !== undefined && + input.RegistryId !== null && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), }; }; @@ -17022,14 +17122,16 @@ const serializeAws_json1_1DeleteResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.PolicyHashCondition !== undefined && { PolicyHashCondition: input.PolicyHashCondition }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.PolicyHashCondition !== undefined && + input.PolicyHashCondition !== null && { PolicyHashCondition: input.PolicyHashCondition }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1DeleteSchemaInput = (input: DeleteSchemaInput, context: __SerdeContext): any => { return { - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), }; }; @@ -17038,8 +17140,9 @@ const serializeAws_json1_1DeleteSchemaVersionsInput = ( context: __SerdeContext ): any => { return { - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), - ...(input.Versions !== undefined && { Versions: input.Versions }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.Versions !== undefined && input.Versions !== null && { Versions: input.Versions }), }; }; @@ -17048,15 +17151,15 @@ const serializeAws_json1_1DeleteSecurityConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeleteTableRequest = (input: DeleteTableRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -17065,16 +17168,16 @@ const serializeAws_json1_1DeleteTableVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.VersionId !== undefined && { VersionId: input.VersionId }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.VersionId !== undefined && input.VersionId !== null && { VersionId: input.VersionId }), }; }; const serializeAws_json1_1DeleteTriggerRequest = (input: DeleteTriggerRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -17083,15 +17186,15 @@ const serializeAws_json1_1DeleteUserDefinedFunctionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.FunctionName !== undefined && { FunctionName: input.FunctionName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.FunctionName !== undefined && input.FunctionName !== null && { FunctionName: input.FunctionName }), }; }; const serializeAws_json1_1DeleteWorkflowRequest = (input: DeleteWorkflowRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -17100,13 +17203,22 @@ const serializeAws_json1_1DevEndpointCustomLibraries = ( context: __SerdeContext ): any => { return { - ...(input.ExtraJarsS3Path !== undefined && { ExtraJarsS3Path: input.ExtraJarsS3Path }), - ...(input.ExtraPythonLibsS3Path !== undefined && { ExtraPythonLibsS3Path: input.ExtraPythonLibsS3Path }), + ...(input.ExtraJarsS3Path !== undefined && + input.ExtraJarsS3Path !== null && { ExtraJarsS3Path: input.ExtraJarsS3Path }), + ...(input.ExtraPythonLibsS3Path !== undefined && + input.ExtraPythonLibsS3Path !== null && { ExtraPythonLibsS3Path: input.ExtraPythonLibsS3Path }), }; }; const serializeAws_json1_1DevEndpointNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DoubleColumnStatisticsData = ( @@ -17114,69 +17226,89 @@ const serializeAws_json1_1DoubleColumnStatisticsData = ( context: __SerdeContext ): any => { return { - ...(input.MaximumValue !== undefined && { MaximumValue: input.MaximumValue }), - ...(input.MinimumValue !== undefined && { MinimumValue: input.MinimumValue }), - ...(input.NumberOfDistinctValues !== undefined && { NumberOfDistinctValues: input.NumberOfDistinctValues }), - ...(input.NumberOfNulls !== undefined && { NumberOfNulls: input.NumberOfNulls }), + ...(input.MaximumValue !== undefined && input.MaximumValue !== null && { MaximumValue: input.MaximumValue }), + ...(input.MinimumValue !== undefined && input.MinimumValue !== null && { MinimumValue: input.MinimumValue }), + ...(input.NumberOfDistinctValues !== undefined && + input.NumberOfDistinctValues !== null && { NumberOfDistinctValues: input.NumberOfDistinctValues }), + ...(input.NumberOfNulls !== undefined && input.NumberOfNulls !== null && { NumberOfNulls: input.NumberOfNulls }), }; }; const serializeAws_json1_1DynamoDBTarget = (input: DynamoDBTarget, context: __SerdeContext): any => { return { - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.scanAll !== undefined && { scanAll: input.scanAll }), - ...(input.scanRate !== undefined && { scanRate: input.scanRate }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.scanAll !== undefined && input.scanAll !== null && { scanAll: input.scanAll }), + ...(input.scanRate !== undefined && input.scanRate !== null && { scanRate: input.scanRate }), }; }; const serializeAws_json1_1DynamoDBTargetList = (input: DynamoDBTarget[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DynamoDBTarget(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DynamoDBTarget(entry, context); + }); }; const serializeAws_json1_1EncryptionAtRest = (input: EncryptionAtRest, context: __SerdeContext): any => { return { - ...(input.CatalogEncryptionMode !== undefined && { CatalogEncryptionMode: input.CatalogEncryptionMode }), - ...(input.SseAwsKmsKeyId !== undefined && { SseAwsKmsKeyId: input.SseAwsKmsKeyId }), + ...(input.CatalogEncryptionMode !== undefined && + input.CatalogEncryptionMode !== null && { CatalogEncryptionMode: input.CatalogEncryptionMode }), + ...(input.SseAwsKmsKeyId !== undefined && + input.SseAwsKmsKeyId !== null && { SseAwsKmsKeyId: input.SseAwsKmsKeyId }), }; }; const serializeAws_json1_1EncryptionConfiguration = (input: EncryptionConfiguration, context: __SerdeContext): any => { return { - ...(input.CloudWatchEncryption !== undefined && { - CloudWatchEncryption: serializeAws_json1_1CloudWatchEncryption(input.CloudWatchEncryption, context), - }), - ...(input.JobBookmarksEncryption !== undefined && { - JobBookmarksEncryption: serializeAws_json1_1JobBookmarksEncryption(input.JobBookmarksEncryption, context), - }), - ...(input.S3Encryption !== undefined && { - S3Encryption: serializeAws_json1_1S3EncryptionList(input.S3Encryption, context), - }), + ...(input.CloudWatchEncryption !== undefined && + input.CloudWatchEncryption !== null && { + CloudWatchEncryption: serializeAws_json1_1CloudWatchEncryption(input.CloudWatchEncryption, context), + }), + ...(input.JobBookmarksEncryption !== undefined && + input.JobBookmarksEncryption !== null && { + JobBookmarksEncryption: serializeAws_json1_1JobBookmarksEncryption(input.JobBookmarksEncryption, context), + }), + ...(input.S3Encryption !== undefined && + input.S3Encryption !== null && { + S3Encryption: serializeAws_json1_1S3EncryptionList(input.S3Encryption, context), + }), }; }; const serializeAws_json1_1ExecutionProperty = (input: ExecutionProperty, context: __SerdeContext): any => { return { - ...(input.MaxConcurrentRuns !== undefined && { MaxConcurrentRuns: input.MaxConcurrentRuns }), + ...(input.MaxConcurrentRuns !== undefined && + input.MaxConcurrentRuns !== null && { MaxConcurrentRuns: input.MaxConcurrentRuns }), }; }; const serializeAws_json1_1FindMatchesParameters = (input: FindMatchesParameters, context: __SerdeContext): any => { return { - ...(input.AccuracyCostTradeoff !== undefined && { AccuracyCostTradeoff: input.AccuracyCostTradeoff }), - ...(input.EnforceProvidedLabels !== undefined && { EnforceProvidedLabels: input.EnforceProvidedLabels }), - ...(input.PrecisionRecallTradeoff !== undefined && { PrecisionRecallTradeoff: input.PrecisionRecallTradeoff }), - ...(input.PrimaryKeyColumnName !== undefined && { PrimaryKeyColumnName: input.PrimaryKeyColumnName }), + ...(input.AccuracyCostTradeoff !== undefined && + input.AccuracyCostTradeoff !== null && { AccuracyCostTradeoff: input.AccuracyCostTradeoff }), + ...(input.EnforceProvidedLabels !== undefined && + input.EnforceProvidedLabels !== null && { EnforceProvidedLabels: input.EnforceProvidedLabels }), + ...(input.PrecisionRecallTradeoff !== undefined && + input.PrecisionRecallTradeoff !== null && { PrecisionRecallTradeoff: input.PrecisionRecallTradeoff }), + ...(input.PrimaryKeyColumnName !== undefined && + input.PrimaryKeyColumnName !== null && { PrimaryKeyColumnName: input.PrimaryKeyColumnName }), }; }; const serializeAws_json1_1GenericMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1GetCatalogImportStatusRequest = ( @@ -17184,25 +17316,32 @@ const serializeAws_json1_1GetCatalogImportStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), }; }; const serializeAws_json1_1GetClassifierRequest = (input: GetClassifierRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1GetClassifiersRequest = (input: GetClassifiersRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetColumnNamesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetColumnStatisticsForPartitionRequest = ( @@ -17210,15 +17349,17 @@ const serializeAws_json1_1GetColumnStatisticsForPartitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ColumnNames !== undefined && { - ColumnNames: serializeAws_json1_1GetColumnNamesList(input.ColumnNames, context), - }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionValues !== undefined && { - PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ColumnNames !== undefined && + input.ColumnNames !== null && { + ColumnNames: serializeAws_json1_1GetColumnNamesList(input.ColumnNames, context), + }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionValues !== undefined && + input.PartitionValues !== null && { + PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -17227,39 +17368,43 @@ const serializeAws_json1_1GetColumnStatisticsForTableRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ColumnNames !== undefined && { - ColumnNames: serializeAws_json1_1GetColumnNamesList(input.ColumnNames, context), - }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ColumnNames !== undefined && + input.ColumnNames !== null && { + ColumnNames: serializeAws_json1_1GetColumnNamesList(input.ColumnNames, context), + }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1GetConnectionRequest = (input: GetConnectionRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.HidePassword !== undefined && { HidePassword: input.HidePassword }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.HidePassword !== undefined && input.HidePassword !== null && { HidePassword: input.HidePassword }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1GetConnectionsFilter = (input: GetConnectionsFilter, context: __SerdeContext): any => { return { - ...(input.ConnectionType !== undefined && { ConnectionType: input.ConnectionType }), - ...(input.MatchCriteria !== undefined && { - MatchCriteria: serializeAws_json1_1MatchCriteria(input.MatchCriteria, context), - }), + ...(input.ConnectionType !== undefined && + input.ConnectionType !== null && { ConnectionType: input.ConnectionType }), + ...(input.MatchCriteria !== undefined && + input.MatchCriteria !== null && { + MatchCriteria: serializeAws_json1_1MatchCriteria(input.MatchCriteria, context), + }), }; }; const serializeAws_json1_1GetConnectionsRequest = (input: GetConnectionsRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1GetConnectionsFilter(input.Filter, context) }), - ...(input.HidePassword !== undefined && { HidePassword: input.HidePassword }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1GetConnectionsFilter(input.Filter, context) }), + ...(input.HidePassword !== undefined && input.HidePassword !== null && { HidePassword: input.HidePassword }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -17268,40 +17413,42 @@ const serializeAws_json1_1GetCrawlerMetricsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CrawlerNameList !== undefined && { - CrawlerNameList: serializeAws_json1_1CrawlerNameList(input.CrawlerNameList, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CrawlerNameList !== undefined && + input.CrawlerNameList !== null && { + CrawlerNameList: serializeAws_json1_1CrawlerNameList(input.CrawlerNameList, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetCrawlerRequest = (input: GetCrawlerRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1GetCrawlersRequest = (input: GetCrawlersRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetDatabaseRequest = (input: GetDatabaseRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1GetDatabasesRequest = (input: GetDatabasesRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceShareType !== undefined && { ResourceShareType: input.ResourceShareType }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceShareType !== undefined && + input.ResourceShareType !== null && { ResourceShareType: input.ResourceShareType }), }; }; @@ -17310,102 +17457,110 @@ const serializeAws_json1_1GetDataCatalogEncryptionSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), }; }; const serializeAws_json1_1GetDataflowGraphRequest = (input: GetDataflowGraphRequest, context: __SerdeContext): any => { return { - ...(input.PythonScript !== undefined && { PythonScript: input.PythonScript }), + ...(input.PythonScript !== undefined && input.PythonScript !== null && { PythonScript: input.PythonScript }), }; }; const serializeAws_json1_1GetDevEndpointRequest = (input: GetDevEndpointRequest, context: __SerdeContext): any => { return { - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), }; }; const serializeAws_json1_1GetDevEndpointsRequest = (input: GetDevEndpointsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetJobBookmarkRequest = (input: GetJobBookmarkRequest, context: __SerdeContext): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.RunId !== undefined && { RunId: input.RunId }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.RunId !== undefined && input.RunId !== null && { RunId: input.RunId }), }; }; const serializeAws_json1_1GetJobRequest = (input: GetJobRequest, context: __SerdeContext): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), }; }; const serializeAws_json1_1GetJobRunRequest = (input: GetJobRunRequest, context: __SerdeContext): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.PredecessorsIncluded !== undefined && { PredecessorsIncluded: input.PredecessorsIncluded }), - ...(input.RunId !== undefined && { RunId: input.RunId }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.PredecessorsIncluded !== undefined && + input.PredecessorsIncluded !== null && { PredecessorsIncluded: input.PredecessorsIncluded }), + ...(input.RunId !== undefined && input.RunId !== null && { RunId: input.RunId }), }; }; const serializeAws_json1_1GetJobRunsRequest = (input: GetJobRunsRequest, context: __SerdeContext): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetJobsRequest = (input: GetJobsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetMappingRequest = (input: GetMappingRequest, context: __SerdeContext): any => { return { - ...(input.Location !== undefined && { Location: serializeAws_json1_1Location(input.Location, context) }), - ...(input.Sinks !== undefined && { Sinks: serializeAws_json1_1CatalogEntries(input.Sinks, context) }), - ...(input.Source !== undefined && { Source: serializeAws_json1_1CatalogEntry(input.Source, context) }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_json1_1Location(input.Location, context) }), + ...(input.Sinks !== undefined && + input.Sinks !== null && { Sinks: serializeAws_json1_1CatalogEntries(input.Sinks, context) }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_json1_1CatalogEntry(input.Source, context) }), }; }; const serializeAws_json1_1GetMLTaskRunRequest = (input: GetMLTaskRunRequest, context: __SerdeContext): any => { return { - ...(input.TaskRunId !== undefined && { TaskRunId: input.TaskRunId }), - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), + ...(input.TaskRunId !== undefined && input.TaskRunId !== null && { TaskRunId: input.TaskRunId }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), }; }; const serializeAws_json1_1GetMLTaskRunsRequest = (input: GetMLTaskRunsRequest, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1TaskRunFilterCriteria(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Sort !== undefined && { Sort: serializeAws_json1_1TaskRunSortCriteria(input.Sort, context) }), - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1TaskRunFilterCriteria(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Sort !== undefined && + input.Sort !== null && { Sort: serializeAws_json1_1TaskRunSortCriteria(input.Sort, context) }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), }; }; const serializeAws_json1_1GetMLTransformRequest = (input: GetMLTransformRequest, context: __SerdeContext): any => { return { - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), }; }; const serializeAws_json1_1GetMLTransformsRequest = (input: GetMLTransformsRequest, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1TransformFilterCriteria(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Sort !== undefined && { Sort: serializeAws_json1_1TransformSortCriteria(input.Sort, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1TransformFilterCriteria(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Sort !== undefined && + input.Sort !== null && { Sort: serializeAws_json1_1TransformSortCriteria(input.Sort, context) }), }; }; @@ -17414,52 +17569,60 @@ const serializeAws_json1_1GetPartitionIndexesRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1GetPartitionRequest = (input: GetPartitionRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionValues !== undefined && { - PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionValues !== undefined && + input.PartitionValues !== null && { + PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1GetPartitionsRequest = (input: GetPartitionsRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Expression !== undefined && { Expression: input.Expression }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Segment !== undefined && { Segment: serializeAws_json1_1Segment(input.Segment, context) }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Expression !== undefined && input.Expression !== null && { Expression: input.Expression }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Segment !== undefined && + input.Segment !== null && { Segment: serializeAws_json1_1Segment(input.Segment, context) }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1GetPlanRequest = (input: GetPlanRequest, context: __SerdeContext): any => { return { - ...(input.AdditionalPlanOptionsMap !== undefined && { - AdditionalPlanOptionsMap: serializeAws_json1_1AdditionalPlanOptionsMap(input.AdditionalPlanOptionsMap, context), - }), - ...(input.Language !== undefined && { Language: input.Language }), - ...(input.Location !== undefined && { Location: serializeAws_json1_1Location(input.Location, context) }), - ...(input.Mapping !== undefined && { Mapping: serializeAws_json1_1MappingList(input.Mapping, context) }), - ...(input.Sinks !== undefined && { Sinks: serializeAws_json1_1CatalogEntries(input.Sinks, context) }), - ...(input.Source !== undefined && { Source: serializeAws_json1_1CatalogEntry(input.Source, context) }), + ...(input.AdditionalPlanOptionsMap !== undefined && + input.AdditionalPlanOptionsMap !== null && { + AdditionalPlanOptionsMap: serializeAws_json1_1AdditionalPlanOptionsMap(input.AdditionalPlanOptionsMap, context), + }), + ...(input.Language !== undefined && input.Language !== null && { Language: input.Language }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_json1_1Location(input.Location, context) }), + ...(input.Mapping !== undefined && + input.Mapping !== null && { Mapping: serializeAws_json1_1MappingList(input.Mapping, context) }), + ...(input.Sinks !== undefined && + input.Sinks !== null && { Sinks: serializeAws_json1_1CatalogEntries(input.Sinks, context) }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_json1_1CatalogEntry(input.Source, context) }), }; }; const serializeAws_json1_1GetRegistryInput = (input: GetRegistryInput, context: __SerdeContext): any => { return { - ...(input.RegistryId !== undefined && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), + ...(input.RegistryId !== undefined && + input.RegistryId !== null && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), }; }; @@ -17468,8 +17631,8 @@ const serializeAws_json1_1GetResourcePoliciesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -17478,7 +17641,7 @@ const serializeAws_json1_1GetResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -17487,24 +17650,30 @@ const serializeAws_json1_1GetSchemaByDefinitionInput = ( context: __SerdeContext ): any => { return { - ...(input.SchemaDefinition !== undefined && { SchemaDefinition: input.SchemaDefinition }), - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaDefinition !== undefined && + input.SchemaDefinition !== null && { SchemaDefinition: input.SchemaDefinition }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), }; }; const serializeAws_json1_1GetSchemaInput = (input: GetSchemaInput, context: __SerdeContext): any => { return { - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), }; }; const serializeAws_json1_1GetSchemaVersionInput = (input: GetSchemaVersionInput, context: __SerdeContext): any => { return { - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), - ...(input.SchemaVersionId !== undefined && { SchemaVersionId: input.SchemaVersionId }), - ...(input.SchemaVersionNumber !== undefined && { - SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), - }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaVersionId !== undefined && + input.SchemaVersionId !== null && { SchemaVersionId: input.SchemaVersionId }), + ...(input.SchemaVersionNumber !== undefined && + input.SchemaVersionNumber !== null && { + SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), + }), }; }; @@ -17513,14 +17682,18 @@ const serializeAws_json1_1GetSchemaVersionsDiffInput = ( context: __SerdeContext ): any => { return { - ...(input.FirstSchemaVersionNumber !== undefined && { - FirstSchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.FirstSchemaVersionNumber, context), - }), - ...(input.SchemaDiffType !== undefined && { SchemaDiffType: input.SchemaDiffType }), - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), - ...(input.SecondSchemaVersionNumber !== undefined && { - SecondSchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SecondSchemaVersionNumber, context), - }), + ...(input.FirstSchemaVersionNumber !== undefined && + input.FirstSchemaVersionNumber !== null && { + FirstSchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.FirstSchemaVersionNumber, context), + }), + ...(input.SchemaDiffType !== undefined && + input.SchemaDiffType !== null && { SchemaDiffType: input.SchemaDiffType }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SecondSchemaVersionNumber !== undefined && + input.SecondSchemaVersionNumber !== null && { + SecondSchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SecondSchemaVersionNumber, context), + }), }; }; @@ -17529,7 +17702,7 @@ const serializeAws_json1_1GetSecurityConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -17538,65 +17711,66 @@ const serializeAws_json1_1GetSecurityConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetTableRequest = (input: GetTableRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1GetTablesRequest = (input: GetTablesRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Expression !== undefined && { Expression: input.Expression }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Expression !== undefined && input.Expression !== null && { Expression: input.Expression }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetTableVersionRequest = (input: GetTableVersionRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.VersionId !== undefined && { VersionId: input.VersionId }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.VersionId !== undefined && input.VersionId !== null && { VersionId: input.VersionId }), }; }; const serializeAws_json1_1GetTableVersionsRequest = (input: GetTableVersionsRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1GetTagsRequest = (input: GetTagsRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1GetTriggerRequest = (input: GetTriggerRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1GetTriggersRequest = (input: GetTriggersRequest, context: __SerdeContext): any => { return { - ...(input.DependentJobName !== undefined && { DependentJobName: input.DependentJobName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DependentJobName !== undefined && + input.DependentJobName !== null && { DependentJobName: input.DependentJobName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -17605,9 +17779,9 @@ const serializeAws_json1_1GetUserDefinedFunctionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.FunctionName !== undefined && { FunctionName: input.FunctionName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.FunctionName !== undefined && input.FunctionName !== null && { FunctionName: input.FunctionName }), }; }; @@ -17616,18 +17790,18 @@ const serializeAws_json1_1GetUserDefinedFunctionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Pattern !== undefined && { Pattern: input.Pattern }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Pattern !== undefined && input.Pattern !== null && { Pattern: input.Pattern }), }; }; const serializeAws_json1_1GetWorkflowRequest = (input: GetWorkflowRequest, context: __SerdeContext): any => { return { - ...(input.IncludeGraph !== undefined && { IncludeGraph: input.IncludeGraph }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.IncludeGraph !== undefined && input.IncludeGraph !== null && { IncludeGraph: input.IncludeGraph }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -17636,39 +17810,47 @@ const serializeAws_json1_1GetWorkflowRunPropertiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RunId !== undefined && { RunId: input.RunId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RunId !== undefined && input.RunId !== null && { RunId: input.RunId }), }; }; const serializeAws_json1_1GetWorkflowRunRequest = (input: GetWorkflowRunRequest, context: __SerdeContext): any => { return { - ...(input.IncludeGraph !== undefined && { IncludeGraph: input.IncludeGraph }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RunId !== undefined && { RunId: input.RunId }), + ...(input.IncludeGraph !== undefined && input.IncludeGraph !== null && { IncludeGraph: input.IncludeGraph }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RunId !== undefined && input.RunId !== null && { RunId: input.RunId }), }; }; const serializeAws_json1_1GetWorkflowRunsRequest = (input: GetWorkflowRunsRequest, context: __SerdeContext): any => { return { - ...(input.IncludeGraph !== undefined && { IncludeGraph: input.IncludeGraph }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.IncludeGraph !== undefined && input.IncludeGraph !== null && { IncludeGraph: input.IncludeGraph }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GlueTable = (input: GlueTable, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ConnectionName !== undefined && { ConnectionName: input.ConnectionName }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ConnectionName !== undefined && + input.ConnectionName !== null && { ConnectionName: input.ConnectionName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1GlueTables = (input: GlueTable[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1GlueTable(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1GlueTable(entry, context); + }); }; const serializeAws_json1_1ImportCatalogToGlueRequest = ( @@ -17676,174 +17858,214 @@ const serializeAws_json1_1ImportCatalogToGlueRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), }; }; const serializeAws_json1_1JdbcTarget = (input: JdbcTarget, context: __SerdeContext): any => { return { - ...(input.ConnectionName !== undefined && { ConnectionName: input.ConnectionName }), - ...(input.Exclusions !== undefined && { Exclusions: serializeAws_json1_1PathList(input.Exclusions, context) }), - ...(input.Path !== undefined && { Path: input.Path }), + ...(input.ConnectionName !== undefined && + input.ConnectionName !== null && { ConnectionName: input.ConnectionName }), + ...(input.Exclusions !== undefined && + input.Exclusions !== null && { Exclusions: serializeAws_json1_1PathList(input.Exclusions, context) }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), }; }; const serializeAws_json1_1JdbcTargetList = (input: JdbcTarget[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1JdbcTarget(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1JdbcTarget(entry, context); + }); }; const serializeAws_json1_1JobBookmarksEncryption = (input: JobBookmarksEncryption, context: __SerdeContext): any => { return { - ...(input.JobBookmarksEncryptionMode !== undefined && { - JobBookmarksEncryptionMode: input.JobBookmarksEncryptionMode, - }), - ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), + ...(input.JobBookmarksEncryptionMode !== undefined && + input.JobBookmarksEncryptionMode !== null && { JobBookmarksEncryptionMode: input.JobBookmarksEncryptionMode }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }), }; }; const serializeAws_json1_1JobCommand = (input: JobCommand, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PythonVersion !== undefined && { PythonVersion: input.PythonVersion }), - ...(input.ScriptLocation !== undefined && { ScriptLocation: input.ScriptLocation }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PythonVersion !== undefined && input.PythonVersion !== null && { PythonVersion: input.PythonVersion }), + ...(input.ScriptLocation !== undefined && + input.ScriptLocation !== null && { ScriptLocation: input.ScriptLocation }), }; }; const serializeAws_json1_1JobNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1JobUpdate = (input: JobUpdate, context: __SerdeContext): any => { return { - ...(input.AllocatedCapacity !== undefined && { AllocatedCapacity: input.AllocatedCapacity }), - ...(input.Command !== undefined && { Command: serializeAws_json1_1JobCommand(input.Command, context) }), - ...(input.Connections !== undefined && { - Connections: serializeAws_json1_1ConnectionsList(input.Connections, context), - }), - ...(input.DefaultArguments !== undefined && { - DefaultArguments: serializeAws_json1_1GenericMap(input.DefaultArguments, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ExecutionProperty !== undefined && { - ExecutionProperty: serializeAws_json1_1ExecutionProperty(input.ExecutionProperty, context), - }), - ...(input.GlueVersion !== undefined && { GlueVersion: input.GlueVersion }), - ...(input.LogUri !== undefined && { LogUri: input.LogUri }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MaxRetries !== undefined && { MaxRetries: input.MaxRetries }), - ...(input.NonOverridableArguments !== undefined && { - NonOverridableArguments: serializeAws_json1_1GenericMap(input.NonOverridableArguments, context), - }), - ...(input.NotificationProperty !== undefined && { - NotificationProperty: serializeAws_json1_1NotificationProperty(input.NotificationProperty, context), - }), - ...(input.NumberOfWorkers !== undefined && { NumberOfWorkers: input.NumberOfWorkers }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.SecurityConfiguration !== undefined && { SecurityConfiguration: input.SecurityConfiguration }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.WorkerType !== undefined && { WorkerType: input.WorkerType }), + ...(input.AllocatedCapacity !== undefined && + input.AllocatedCapacity !== null && { AllocatedCapacity: input.AllocatedCapacity }), + ...(input.Command !== undefined && + input.Command !== null && { Command: serializeAws_json1_1JobCommand(input.Command, context) }), + ...(input.Connections !== undefined && + input.Connections !== null && { Connections: serializeAws_json1_1ConnectionsList(input.Connections, context) }), + ...(input.DefaultArguments !== undefined && + input.DefaultArguments !== null && { + DefaultArguments: serializeAws_json1_1GenericMap(input.DefaultArguments, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ExecutionProperty !== undefined && + input.ExecutionProperty !== null && { + ExecutionProperty: serializeAws_json1_1ExecutionProperty(input.ExecutionProperty, context), + }), + ...(input.GlueVersion !== undefined && input.GlueVersion !== null && { GlueVersion: input.GlueVersion }), + ...(input.LogUri !== undefined && input.LogUri !== null && { LogUri: input.LogUri }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MaxRetries !== undefined && input.MaxRetries !== null && { MaxRetries: input.MaxRetries }), + ...(input.NonOverridableArguments !== undefined && + input.NonOverridableArguments !== null && { + NonOverridableArguments: serializeAws_json1_1GenericMap(input.NonOverridableArguments, context), + }), + ...(input.NotificationProperty !== undefined && + input.NotificationProperty !== null && { + NotificationProperty: serializeAws_json1_1NotificationProperty(input.NotificationProperty, context), + }), + ...(input.NumberOfWorkers !== undefined && + input.NumberOfWorkers !== null && { NumberOfWorkers: input.NumberOfWorkers }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.SecurityConfiguration !== undefined && + input.SecurityConfiguration !== null && { SecurityConfiguration: input.SecurityConfiguration }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.WorkerType !== undefined && input.WorkerType !== null && { WorkerType: input.WorkerType }), }; }; const serializeAws_json1_1KeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1LineageConfiguration = (input: LineageConfiguration, context: __SerdeContext): any => { return { - ...(input.CrawlerLineageSettings !== undefined && { CrawlerLineageSettings: input.CrawlerLineageSettings }), + ...(input.CrawlerLineageSettings !== undefined && + input.CrawlerLineageSettings !== null && { CrawlerLineageSettings: input.CrawlerLineageSettings }), }; }; const serializeAws_json1_1ListCrawlersRequest = (input: ListCrawlersRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), }; }; const serializeAws_json1_1ListDevEndpointsRequest = (input: ListDevEndpointsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), }; }; const serializeAws_json1_1ListJobsRequest = (input: ListJobsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), }; }; const serializeAws_json1_1ListMLTransformsRequest = (input: ListMLTransformsRequest, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1TransformFilterCriteria(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Sort !== undefined && { Sort: serializeAws_json1_1TransformSortCriteria(input.Sort, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1TransformFilterCriteria(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Sort !== undefined && + input.Sort !== null && { Sort: serializeAws_json1_1TransformSortCriteria(input.Sort, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), }; }; const serializeAws_json1_1ListRegistriesInput = (input: ListRegistriesInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListSchemasInput = (input: ListSchemasInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.RegistryId !== undefined && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.RegistryId !== undefined && + input.RegistryId !== null && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), }; }; const serializeAws_json1_1ListSchemaVersionsInput = (input: ListSchemaVersionsInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), }; }; const serializeAws_json1_1ListTriggersRequest = (input: ListTriggersRequest, context: __SerdeContext): any => { return { - ...(input.DependentJobName !== undefined && { DependentJobName: input.DependentJobName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), + ...(input.DependentJobName !== undefined && + input.DependentJobName !== null && { DependentJobName: input.DependentJobName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagsMap(input.Tags, context) }), }; }; const serializeAws_json1_1ListWorkflowsRequest = (input: ListWorkflowsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1Location = (input: Location, context: __SerdeContext): any => { return { - ...(input.DynamoDB !== undefined && { DynamoDB: serializeAws_json1_1CodeGenNodeArgs(input.DynamoDB, context) }), - ...(input.Jdbc !== undefined && { Jdbc: serializeAws_json1_1CodeGenNodeArgs(input.Jdbc, context) }), - ...(input.S3 !== undefined && { S3: serializeAws_json1_1CodeGenNodeArgs(input.S3, context) }), + ...(input.DynamoDB !== undefined && + input.DynamoDB !== null && { DynamoDB: serializeAws_json1_1CodeGenNodeArgs(input.DynamoDB, context) }), + ...(input.Jdbc !== undefined && + input.Jdbc !== null && { Jdbc: serializeAws_json1_1CodeGenNodeArgs(input.Jdbc, context) }), + ...(input.S3 !== undefined && input.S3 !== null && { S3: serializeAws_json1_1CodeGenNodeArgs(input.S3, context) }), }; }; const serializeAws_json1_1LocationMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1LongColumnStatisticsData = ( @@ -17851,152 +18073,248 @@ const serializeAws_json1_1LongColumnStatisticsData = ( context: __SerdeContext ): any => { return { - ...(input.MaximumValue !== undefined && { MaximumValue: input.MaximumValue }), - ...(input.MinimumValue !== undefined && { MinimumValue: input.MinimumValue }), - ...(input.NumberOfDistinctValues !== undefined && { NumberOfDistinctValues: input.NumberOfDistinctValues }), - ...(input.NumberOfNulls !== undefined && { NumberOfNulls: input.NumberOfNulls }), + ...(input.MaximumValue !== undefined && input.MaximumValue !== null && { MaximumValue: input.MaximumValue }), + ...(input.MinimumValue !== undefined && input.MinimumValue !== null && { MinimumValue: input.MinimumValue }), + ...(input.NumberOfDistinctValues !== undefined && + input.NumberOfDistinctValues !== null && { NumberOfDistinctValues: input.NumberOfDistinctValues }), + ...(input.NumberOfNulls !== undefined && input.NumberOfNulls !== null && { NumberOfNulls: input.NumberOfNulls }), }; }; const serializeAws_json1_1MappingEntry = (input: MappingEntry, context: __SerdeContext): any => { return { - ...(input.SourcePath !== undefined && { SourcePath: input.SourcePath }), - ...(input.SourceTable !== undefined && { SourceTable: input.SourceTable }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), - ...(input.TargetPath !== undefined && { TargetPath: input.TargetPath }), - ...(input.TargetTable !== undefined && { TargetTable: input.TargetTable }), - ...(input.TargetType !== undefined && { TargetType: input.TargetType }), + ...(input.SourcePath !== undefined && input.SourcePath !== null && { SourcePath: input.SourcePath }), + ...(input.SourceTable !== undefined && input.SourceTable !== null && { SourceTable: input.SourceTable }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), + ...(input.TargetPath !== undefined && input.TargetPath !== null && { TargetPath: input.TargetPath }), + ...(input.TargetTable !== undefined && input.TargetTable !== null && { TargetTable: input.TargetTable }), + ...(input.TargetType !== undefined && input.TargetType !== null && { TargetType: input.TargetType }), }; }; const serializeAws_json1_1MappingList = (input: MappingEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MappingEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MappingEntry(entry, context); + }); }; const serializeAws_json1_1MapValue = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1MatchCriteria = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MetadataKeyValuePair = (input: MetadataKeyValuePair, context: __SerdeContext): any => { return { - ...(input.MetadataKey !== undefined && { MetadataKey: input.MetadataKey }), - ...(input.MetadataValue !== undefined && { MetadataValue: input.MetadataValue }), + ...(input.MetadataKey !== undefined && input.MetadataKey !== null && { MetadataKey: input.MetadataKey }), + ...(input.MetadataValue !== undefined && input.MetadataValue !== null && { MetadataValue: input.MetadataValue }), }; }; const serializeAws_json1_1MetadataList = (input: MetadataKeyValuePair[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MetadataKeyValuePair(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MetadataKeyValuePair(entry, context); + }); }; const serializeAws_json1_1MLUserDataEncryption = (input: MLUserDataEncryption, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.MlUserDataEncryptionMode !== undefined && { MlUserDataEncryptionMode: input.MlUserDataEncryptionMode }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.MlUserDataEncryptionMode !== undefined && + input.MlUserDataEncryptionMode !== null && { MlUserDataEncryptionMode: input.MlUserDataEncryptionMode }), }; }; const serializeAws_json1_1MongoDBTarget = (input: MongoDBTarget, context: __SerdeContext): any => { return { - ...(input.ConnectionName !== undefined && { ConnectionName: input.ConnectionName }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.ScanAll !== undefined && { ScanAll: input.ScanAll }), + ...(input.ConnectionName !== undefined && + input.ConnectionName !== null && { ConnectionName: input.ConnectionName }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.ScanAll !== undefined && input.ScanAll !== null && { ScanAll: input.ScanAll }), }; }; const serializeAws_json1_1MongoDBTargetList = (input: MongoDBTarget[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MongoDBTarget(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MongoDBTarget(entry, context); + }); }; const serializeAws_json1_1NameStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1NodeIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1NotificationProperty = (input: NotificationProperty, context: __SerdeContext): any => { return { - ...(input.NotifyDelayAfter !== undefined && { NotifyDelayAfter: input.NotifyDelayAfter }), + ...(input.NotifyDelayAfter !== undefined && + input.NotifyDelayAfter !== null && { NotifyDelayAfter: input.NotifyDelayAfter }), }; }; const serializeAws_json1_1OrchestrationStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Order = (input: Order, context: __SerdeContext): any => { return { - ...(input.Column !== undefined && { Column: input.Column }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.Column !== undefined && input.Column !== null && { Column: input.Column }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1OrderList = (input: Order[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Order(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Order(entry, context); + }); }; const serializeAws_json1_1ParametersMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1PartitionIndex = (input: PartitionIndex, context: __SerdeContext): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.Keys !== undefined && { Keys: serializeAws_json1_1KeyList(input.Keys, context) }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.Keys !== undefined && input.Keys !== null && { Keys: serializeAws_json1_1KeyList(input.Keys, context) }), }; }; const serializeAws_json1_1PartitionIndexList = (input: PartitionIndex[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PartitionIndex(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PartitionIndex(entry, context); + }); }; const serializeAws_json1_1PartitionInput = (input: PartitionInput, context: __SerdeContext): any => { return { - ...(input.LastAccessTime !== undefined && { LastAccessTime: Math.round(input.LastAccessTime.getTime() / 1000) }), - ...(input.LastAnalyzedTime !== undefined && { - LastAnalyzedTime: Math.round(input.LastAnalyzedTime.getTime() / 1000), - }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), - ...(input.StorageDescriptor !== undefined && { - StorageDescriptor: serializeAws_json1_1StorageDescriptor(input.StorageDescriptor, context), - }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1ValueStringList(input.Values, context) }), + ...(input.LastAccessTime !== undefined && + input.LastAccessTime !== null && { LastAccessTime: Math.round(input.LastAccessTime.getTime() / 1000) }), + ...(input.LastAnalyzedTime !== undefined && + input.LastAnalyzedTime !== null && { LastAnalyzedTime: Math.round(input.LastAnalyzedTime.getTime() / 1000) }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), + ...(input.StorageDescriptor !== undefined && + input.StorageDescriptor !== null && { + StorageDescriptor: serializeAws_json1_1StorageDescriptor(input.StorageDescriptor, context), + }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1ValueStringList(input.Values, context) }), }; }; const serializeAws_json1_1PartitionInputList = (input: PartitionInput[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PartitionInput(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PartitionInput(entry, context); + }); }; const serializeAws_json1_1PartitionValueList = (input: PartitionValueList, context: __SerdeContext): any => { return { - ...(input.Values !== undefined && { Values: serializeAws_json1_1ValueStringList(input.Values, context) }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1ValueStringList(input.Values, context) }), }; }; const serializeAws_json1_1PathList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PermissionList = (input: (Permission | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PhysicalConnectionRequirements = ( @@ -18004,46 +18322,61 @@ const serializeAws_json1_1PhysicalConnectionRequirements = ( context: __SerdeContext ): any => { return { - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.SecurityGroupIdList !== undefined && { - SecurityGroupIdList: serializeAws_json1_1SecurityGroupIdList(input.SecurityGroupIdList, context), - }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.SecurityGroupIdList !== undefined && + input.SecurityGroupIdList !== null && { + SecurityGroupIdList: serializeAws_json1_1SecurityGroupIdList(input.SecurityGroupIdList, context), + }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), }; }; const serializeAws_json1_1Predicate = (input: Predicate, context: __SerdeContext): any => { return { - ...(input.Conditions !== undefined && { Conditions: serializeAws_json1_1ConditionList(input.Conditions, context) }), - ...(input.Logical !== undefined && { Logical: input.Logical }), + ...(input.Conditions !== undefined && + input.Conditions !== null && { Conditions: serializeAws_json1_1ConditionList(input.Conditions, context) }), + ...(input.Logical !== undefined && input.Logical !== null && { Logical: input.Logical }), }; }; const serializeAws_json1_1PrincipalPermissions = (input: PrincipalPermissions, context: __SerdeContext): any => { return { - ...(input.Permissions !== undefined && { - Permissions: serializeAws_json1_1PermissionList(input.Permissions, context), - }), - ...(input.Principal !== undefined && { - Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context), - }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { Permissions: serializeAws_json1_1PermissionList(input.Permissions, context) }), + ...(input.Principal !== undefined && + input.Principal !== null && { Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context) }), }; }; const serializeAws_json1_1PrincipalPermissionsList = (input: PrincipalPermissions[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PrincipalPermissions(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PrincipalPermissions(entry, context); + }); }; const serializeAws_json1_1PropertyPredicate = (input: PropertyPredicate, context: __SerdeContext): any => { return { - ...(input.Comparator !== undefined && { Comparator: input.Comparator }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Comparator !== undefined && input.Comparator !== null && { Comparator: input.Comparator }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1PublicKeysList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutDataCatalogEncryptionSettingsRequest = ( @@ -18051,13 +18384,14 @@ const serializeAws_json1_1PutDataCatalogEncryptionSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DataCatalogEncryptionSettings !== undefined && { - DataCatalogEncryptionSettings: serializeAws_json1_1DataCatalogEncryptionSettings( - input.DataCatalogEncryptionSettings, - context - ), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DataCatalogEncryptionSettings !== undefined && + input.DataCatalogEncryptionSettings !== null && { + DataCatalogEncryptionSettings: serializeAws_json1_1DataCatalogEncryptionSettings( + input.DataCatalogEncryptionSettings, + context + ), + }), }; }; @@ -18066,11 +18400,13 @@ const serializeAws_json1_1PutResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.EnableHybrid !== undefined && { EnableHybrid: input.EnableHybrid }), - ...(input.PolicyExistsCondition !== undefined && { PolicyExistsCondition: input.PolicyExistsCondition }), - ...(input.PolicyHashCondition !== undefined && { PolicyHashCondition: input.PolicyHashCondition }), - ...(input.PolicyInJson !== undefined && { PolicyInJson: input.PolicyInJson }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.EnableHybrid !== undefined && input.EnableHybrid !== null && { EnableHybrid: input.EnableHybrid }), + ...(input.PolicyExistsCondition !== undefined && + input.PolicyExistsCondition !== null && { PolicyExistsCondition: input.PolicyExistsCondition }), + ...(input.PolicyHashCondition !== undefined && + input.PolicyHashCondition !== null && { PolicyHashCondition: input.PolicyHashCondition }), + ...(input.PolicyInJson !== undefined && input.PolicyInJson !== null && { PolicyInJson: input.PolicyInJson }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -18079,14 +18415,18 @@ const serializeAws_json1_1PutSchemaVersionMetadataInput = ( context: __SerdeContext ): any => { return { - ...(input.MetadataKeyValue !== undefined && { - MetadataKeyValue: serializeAws_json1_1MetadataKeyValuePair(input.MetadataKeyValue, context), - }), - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), - ...(input.SchemaVersionId !== undefined && { SchemaVersionId: input.SchemaVersionId }), - ...(input.SchemaVersionNumber !== undefined && { - SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), - }), + ...(input.MetadataKeyValue !== undefined && + input.MetadataKeyValue !== null && { + MetadataKeyValue: serializeAws_json1_1MetadataKeyValuePair(input.MetadataKeyValue, context), + }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaVersionId !== undefined && + input.SchemaVersionId !== null && { SchemaVersionId: input.SchemaVersionId }), + ...(input.SchemaVersionNumber !== undefined && + input.SchemaVersionNumber !== null && { + SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), + }), }; }; @@ -18095,11 +18435,12 @@ const serializeAws_json1_1PutWorkflowRunPropertiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RunId !== undefined && { RunId: input.RunId }), - ...(input.RunProperties !== undefined && { - RunProperties: serializeAws_json1_1WorkflowRunProperties(input.RunProperties, context), - }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RunId !== undefined && input.RunId !== null && { RunId: input.RunId }), + ...(input.RunProperties !== undefined && + input.RunProperties !== null && { + RunProperties: serializeAws_json1_1WorkflowRunProperties(input.RunProperties, context), + }), }; }; @@ -18108,22 +18449,25 @@ const serializeAws_json1_1QuerySchemaVersionMetadataInput = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MetadataList !== undefined && { - MetadataList: serializeAws_json1_1MetadataList(input.MetadataList, context), - }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), - ...(input.SchemaVersionId !== undefined && { SchemaVersionId: input.SchemaVersionId }), - ...(input.SchemaVersionNumber !== undefined && { - SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MetadataList !== undefined && + input.MetadataList !== null && { MetadataList: serializeAws_json1_1MetadataList(input.MetadataList, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaVersionId !== undefined && + input.SchemaVersionId !== null && { SchemaVersionId: input.SchemaVersionId }), + ...(input.SchemaVersionNumber !== undefined && + input.SchemaVersionNumber !== null && { + SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), + }), }; }; const serializeAws_json1_1RecrawlPolicy = (input: RecrawlPolicy, context: __SerdeContext): any => { return { - ...(input.RecrawlBehavior !== undefined && { RecrawlBehavior: input.RecrawlBehavior }), + ...(input.RecrawlBehavior !== undefined && + input.RecrawlBehavior !== null && { RecrawlBehavior: input.RecrawlBehavior }), }; }; @@ -18132,15 +18476,17 @@ const serializeAws_json1_1RegisterSchemaVersionInput = ( context: __SerdeContext ): any => { return { - ...(input.SchemaDefinition !== undefined && { SchemaDefinition: input.SchemaDefinition }), - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaDefinition !== undefined && + input.SchemaDefinition !== null && { SchemaDefinition: input.SchemaDefinition }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), }; }; const serializeAws_json1_1RegistryId = (input: RegistryId, context: __SerdeContext): any => { return { - ...(input.RegistryArn !== undefined && { RegistryArn: input.RegistryArn }), - ...(input.RegistryName !== undefined && { RegistryName: input.RegistryName }), + ...(input.RegistryArn !== undefined && input.RegistryArn !== null && { RegistryArn: input.RegistryArn }), + ...(input.RegistryName !== undefined && input.RegistryName !== null && { RegistryName: input.RegistryName }), }; }; @@ -18149,33 +18495,44 @@ const serializeAws_json1_1RemoveSchemaVersionMetadataInput = ( context: __SerdeContext ): any => { return { - ...(input.MetadataKeyValue !== undefined && { - MetadataKeyValue: serializeAws_json1_1MetadataKeyValuePair(input.MetadataKeyValue, context), - }), - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), - ...(input.SchemaVersionId !== undefined && { SchemaVersionId: input.SchemaVersionId }), - ...(input.SchemaVersionNumber !== undefined && { - SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), - }), + ...(input.MetadataKeyValue !== undefined && + input.MetadataKeyValue !== null && { + MetadataKeyValue: serializeAws_json1_1MetadataKeyValuePair(input.MetadataKeyValue, context), + }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaVersionId !== undefined && + input.SchemaVersionId !== null && { SchemaVersionId: input.SchemaVersionId }), + ...(input.SchemaVersionNumber !== undefined && + input.SchemaVersionNumber !== null && { + SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), + }), }; }; const serializeAws_json1_1ResetJobBookmarkRequest = (input: ResetJobBookmarkRequest, context: __SerdeContext): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.RunId !== undefined && { RunId: input.RunId }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.RunId !== undefined && input.RunId !== null && { RunId: input.RunId }), }; }; const serializeAws_json1_1ResourceUri = (input: ResourceUri, context: __SerdeContext): any => { return { - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.Uri !== undefined && { Uri: input.Uri }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.Uri !== undefined && input.Uri !== null && { Uri: input.Uri }), }; }; const serializeAws_json1_1ResourceUriList = (input: ResourceUri[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ResourceUri(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ResourceUri(entry, context); + }); }; const serializeAws_json1_1ResumeWorkflowRunRequest = ( @@ -18183,139 +18540,187 @@ const serializeAws_json1_1ResumeWorkflowRunRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NodeIds !== undefined && { NodeIds: serializeAws_json1_1NodeIdList(input.NodeIds, context) }), - ...(input.RunId !== undefined && { RunId: input.RunId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NodeIds !== undefined && + input.NodeIds !== null && { NodeIds: serializeAws_json1_1NodeIdList(input.NodeIds, context) }), + ...(input.RunId !== undefined && input.RunId !== null && { RunId: input.RunId }), }; }; const serializeAws_json1_1S3Encryption = (input: S3Encryption, context: __SerdeContext): any => { return { - ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), - ...(input.S3EncryptionMode !== undefined && { S3EncryptionMode: input.S3EncryptionMode }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }), + ...(input.S3EncryptionMode !== undefined && + input.S3EncryptionMode !== null && { S3EncryptionMode: input.S3EncryptionMode }), }; }; const serializeAws_json1_1S3EncryptionList = (input: S3Encryption[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1S3Encryption(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1S3Encryption(entry, context); + }); }; const serializeAws_json1_1S3Target = (input: S3Target, context: __SerdeContext): any => { return { - ...(input.ConnectionName !== undefined && { ConnectionName: input.ConnectionName }), - ...(input.Exclusions !== undefined && { Exclusions: serializeAws_json1_1PathList(input.Exclusions, context) }), - ...(input.Path !== undefined && { Path: input.Path }), + ...(input.ConnectionName !== undefined && + input.ConnectionName !== null && { ConnectionName: input.ConnectionName }), + ...(input.Exclusions !== undefined && + input.Exclusions !== null && { Exclusions: serializeAws_json1_1PathList(input.Exclusions, context) }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), }; }; const serializeAws_json1_1S3TargetList = (input: S3Target[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1S3Target(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1S3Target(entry, context); + }); }; const serializeAws_json1_1SchemaChangePolicy = (input: SchemaChangePolicy, context: __SerdeContext): any => { return { - ...(input.DeleteBehavior !== undefined && { DeleteBehavior: input.DeleteBehavior }), - ...(input.UpdateBehavior !== undefined && { UpdateBehavior: input.UpdateBehavior }), + ...(input.DeleteBehavior !== undefined && + input.DeleteBehavior !== null && { DeleteBehavior: input.DeleteBehavior }), + ...(input.UpdateBehavior !== undefined && + input.UpdateBehavior !== null && { UpdateBehavior: input.UpdateBehavior }), }; }; const serializeAws_json1_1SchemaColumn = (input: SchemaColumn, context: __SerdeContext): any => { return { - ...(input.DataType !== undefined && { DataType: input.DataType }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.DataType !== undefined && input.DataType !== null && { DataType: input.DataType }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1SchemaId = (input: SchemaId, context: __SerdeContext): any => { return { - ...(input.RegistryName !== undefined && { RegistryName: input.RegistryName }), - ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }), - ...(input.SchemaName !== undefined && { SchemaName: input.SchemaName }), + ...(input.RegistryName !== undefined && input.RegistryName !== null && { RegistryName: input.RegistryName }), + ...(input.SchemaArn !== undefined && input.SchemaArn !== null && { SchemaArn: input.SchemaArn }), + ...(input.SchemaName !== undefined && input.SchemaName !== null && { SchemaName: input.SchemaName }), }; }; const serializeAws_json1_1SchemaReference = (input: SchemaReference, context: __SerdeContext): any => { return { - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), - ...(input.SchemaVersionId !== undefined && { SchemaVersionId: input.SchemaVersionId }), - ...(input.SchemaVersionNumber !== undefined && { SchemaVersionNumber: input.SchemaVersionNumber }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaVersionId !== undefined && + input.SchemaVersionId !== null && { SchemaVersionId: input.SchemaVersionId }), + ...(input.SchemaVersionNumber !== undefined && + input.SchemaVersionNumber !== null && { SchemaVersionNumber: input.SchemaVersionNumber }), }; }; const serializeAws_json1_1SchemaVersionNumber = (input: SchemaVersionNumber, context: __SerdeContext): any => { return { - ...(input.LatestVersion !== undefined && { LatestVersion: input.LatestVersion }), - ...(input.VersionNumber !== undefined && { VersionNumber: input.VersionNumber }), + ...(input.LatestVersion !== undefined && input.LatestVersion !== null && { LatestVersion: input.LatestVersion }), + ...(input.VersionNumber !== undefined && input.VersionNumber !== null && { VersionNumber: input.VersionNumber }), }; }; const serializeAws_json1_1SearchPropertyPredicates = (input: PropertyPredicate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PropertyPredicate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PropertyPredicate(entry, context); + }); }; const serializeAws_json1_1SearchTablesRequest = (input: SearchTablesRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1SearchPropertyPredicates(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceShareType !== undefined && { ResourceShareType: input.ResourceShareType }), - ...(input.SearchText !== undefined && { SearchText: input.SearchText }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_json1_1SortCriteria(input.SortCriteria, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1SearchPropertyPredicates(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceShareType !== undefined && + input.ResourceShareType !== null && { ResourceShareType: input.ResourceShareType }), + ...(input.SearchText !== undefined && input.SearchText !== null && { SearchText: input.SearchText }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_json1_1SortCriteria(input.SortCriteria, context) }), }; }; const serializeAws_json1_1SecurityGroupIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Segment = (input: Segment, context: __SerdeContext): any => { return { - ...(input.SegmentNumber !== undefined && { SegmentNumber: input.SegmentNumber }), - ...(input.TotalSegments !== undefined && { TotalSegments: input.TotalSegments }), + ...(input.SegmentNumber !== undefined && input.SegmentNumber !== null && { SegmentNumber: input.SegmentNumber }), + ...(input.TotalSegments !== undefined && input.TotalSegments !== null && { TotalSegments: input.TotalSegments }), }; }; const serializeAws_json1_1SerDeInfo = (input: SerDeInfo, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), - ...(input.SerializationLibrary !== undefined && { SerializationLibrary: input.SerializationLibrary }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), + ...(input.SerializationLibrary !== undefined && + input.SerializationLibrary !== null && { SerializationLibrary: input.SerializationLibrary }), }; }; const serializeAws_json1_1SkewedInfo = (input: SkewedInfo, context: __SerdeContext): any => { return { - ...(input.SkewedColumnNames !== undefined && { - SkewedColumnNames: serializeAws_json1_1NameStringList(input.SkewedColumnNames, context), - }), - ...(input.SkewedColumnValueLocationMaps !== undefined && { - SkewedColumnValueLocationMaps: serializeAws_json1_1LocationMap(input.SkewedColumnValueLocationMaps, context), - }), - ...(input.SkewedColumnValues !== undefined && { - SkewedColumnValues: serializeAws_json1_1ColumnValueStringList(input.SkewedColumnValues, context), - }), + ...(input.SkewedColumnNames !== undefined && + input.SkewedColumnNames !== null && { + SkewedColumnNames: serializeAws_json1_1NameStringList(input.SkewedColumnNames, context), + }), + ...(input.SkewedColumnValueLocationMaps !== undefined && + input.SkewedColumnValueLocationMaps !== null && { + SkewedColumnValueLocationMaps: serializeAws_json1_1LocationMap(input.SkewedColumnValueLocationMaps, context), + }), + ...(input.SkewedColumnValues !== undefined && + input.SkewedColumnValues !== null && { + SkewedColumnValues: serializeAws_json1_1ColumnValueStringList(input.SkewedColumnValues, context), + }), }; }; const serializeAws_json1_1SortCriteria = (input: SortCriterion[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SortCriterion(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SortCriterion(entry, context); + }); }; const serializeAws_json1_1SortCriterion = (input: SortCriterion, context: __SerdeContext): any => { return { - ...(input.FieldName !== undefined && { FieldName: input.FieldName }), - ...(input.Sort !== undefined && { Sort: input.Sort }), + ...(input.FieldName !== undefined && input.FieldName !== null && { FieldName: input.FieldName }), + ...(input.Sort !== undefined && input.Sort !== null && { Sort: input.Sort }), }; }; const serializeAws_json1_1StartCrawlerRequest = (input: StartCrawlerRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -18324,7 +18729,7 @@ const serializeAws_json1_1StartCrawlerScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.CrawlerName !== undefined && { CrawlerName: input.CrawlerName }), + ...(input.CrawlerName !== undefined && input.CrawlerName !== null && { CrawlerName: input.CrawlerName }), }; }; @@ -18333,8 +18738,8 @@ const serializeAws_json1_1StartExportLabelsTaskRunRequest = ( context: __SerdeContext ): any => { return { - ...(input.OutputS3Path !== undefined && { OutputS3Path: input.OutputS3Path }), - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), + ...(input.OutputS3Path !== undefined && input.OutputS3Path !== null && { OutputS3Path: input.OutputS3Path }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), }; }; @@ -18343,26 +18748,32 @@ const serializeAws_json1_1StartImportLabelsTaskRunRequest = ( context: __SerdeContext ): any => { return { - ...(input.InputS3Path !== undefined && { InputS3Path: input.InputS3Path }), - ...(input.ReplaceAllLabels !== undefined && { ReplaceAllLabels: input.ReplaceAllLabels }), - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), + ...(input.InputS3Path !== undefined && input.InputS3Path !== null && { InputS3Path: input.InputS3Path }), + ...(input.ReplaceAllLabels !== undefined && + input.ReplaceAllLabels !== null && { ReplaceAllLabels: input.ReplaceAllLabels }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), }; }; const serializeAws_json1_1StartJobRunRequest = (input: StartJobRunRequest, context: __SerdeContext): any => { return { - ...(input.AllocatedCapacity !== undefined && { AllocatedCapacity: input.AllocatedCapacity }), - ...(input.Arguments !== undefined && { Arguments: serializeAws_json1_1GenericMap(input.Arguments, context) }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobRunId !== undefined && { JobRunId: input.JobRunId }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.NotificationProperty !== undefined && { - NotificationProperty: serializeAws_json1_1NotificationProperty(input.NotificationProperty, context), - }), - ...(input.NumberOfWorkers !== undefined && { NumberOfWorkers: input.NumberOfWorkers }), - ...(input.SecurityConfiguration !== undefined && { SecurityConfiguration: input.SecurityConfiguration }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.WorkerType !== undefined && { WorkerType: input.WorkerType }), + ...(input.AllocatedCapacity !== undefined && + input.AllocatedCapacity !== null && { AllocatedCapacity: input.AllocatedCapacity }), + ...(input.Arguments !== undefined && + input.Arguments !== null && { Arguments: serializeAws_json1_1GenericMap(input.Arguments, context) }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobRunId !== undefined && input.JobRunId !== null && { JobRunId: input.JobRunId }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.NotificationProperty !== undefined && + input.NotificationProperty !== null && { + NotificationProperty: serializeAws_json1_1NotificationProperty(input.NotificationProperty, context), + }), + ...(input.NumberOfWorkers !== undefined && + input.NumberOfWorkers !== null && { NumberOfWorkers: input.NumberOfWorkers }), + ...(input.SecurityConfiguration !== undefined && + input.SecurityConfiguration !== null && { SecurityConfiguration: input.SecurityConfiguration }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.WorkerType !== undefined && input.WorkerType !== null && { WorkerType: input.WorkerType }), }; }; @@ -18371,7 +18782,7 @@ const serializeAws_json1_1StartMLEvaluationTaskRunRequest = ( context: __SerdeContext ): any => { return { - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), }; }; @@ -18380,26 +18791,26 @@ const serializeAws_json1_1StartMLLabelingSetGenerationTaskRunRequest = ( context: __SerdeContext ): any => { return { - ...(input.OutputS3Path !== undefined && { OutputS3Path: input.OutputS3Path }), - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), + ...(input.OutputS3Path !== undefined && input.OutputS3Path !== null && { OutputS3Path: input.OutputS3Path }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), }; }; const serializeAws_json1_1StartTriggerRequest = (input: StartTriggerRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1StartWorkflowRunRequest = (input: StartWorkflowRunRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1StopCrawlerRequest = (input: StopCrawlerRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -18408,42 +18819,51 @@ const serializeAws_json1_1StopCrawlerScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.CrawlerName !== undefined && { CrawlerName: input.CrawlerName }), + ...(input.CrawlerName !== undefined && input.CrawlerName !== null && { CrawlerName: input.CrawlerName }), }; }; const serializeAws_json1_1StopTriggerRequest = (input: StopTriggerRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1StopWorkflowRunRequest = (input: StopWorkflowRunRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RunId !== undefined && { RunId: input.RunId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RunId !== undefined && input.RunId !== null && { RunId: input.RunId }), }; }; const serializeAws_json1_1StorageDescriptor = (input: StorageDescriptor, context: __SerdeContext): any => { return { - ...(input.BucketColumns !== undefined && { - BucketColumns: serializeAws_json1_1NameStringList(input.BucketColumns, context), - }), - ...(input.Columns !== undefined && { Columns: serializeAws_json1_1ColumnList(input.Columns, context) }), - ...(input.Compressed !== undefined && { Compressed: input.Compressed }), - ...(input.InputFormat !== undefined && { InputFormat: input.InputFormat }), - ...(input.Location !== undefined && { Location: input.Location }), - ...(input.NumberOfBuckets !== undefined && { NumberOfBuckets: input.NumberOfBuckets }), - ...(input.OutputFormat !== undefined && { OutputFormat: input.OutputFormat }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), - ...(input.SchemaReference !== undefined && { - SchemaReference: serializeAws_json1_1SchemaReference(input.SchemaReference, context), - }), - ...(input.SerdeInfo !== undefined && { SerdeInfo: serializeAws_json1_1SerDeInfo(input.SerdeInfo, context) }), - ...(input.SkewedInfo !== undefined && { SkewedInfo: serializeAws_json1_1SkewedInfo(input.SkewedInfo, context) }), - ...(input.SortColumns !== undefined && { SortColumns: serializeAws_json1_1OrderList(input.SortColumns, context) }), - ...(input.StoredAsSubDirectories !== undefined && { StoredAsSubDirectories: input.StoredAsSubDirectories }), + ...(input.BucketColumns !== undefined && + input.BucketColumns !== null && { + BucketColumns: serializeAws_json1_1NameStringList(input.BucketColumns, context), + }), + ...(input.Columns !== undefined && + input.Columns !== null && { Columns: serializeAws_json1_1ColumnList(input.Columns, context) }), + ...(input.Compressed !== undefined && input.Compressed !== null && { Compressed: input.Compressed }), + ...(input.InputFormat !== undefined && input.InputFormat !== null && { InputFormat: input.InputFormat }), + ...(input.Location !== undefined && input.Location !== null && { Location: input.Location }), + ...(input.NumberOfBuckets !== undefined && + input.NumberOfBuckets !== null && { NumberOfBuckets: input.NumberOfBuckets }), + ...(input.OutputFormat !== undefined && input.OutputFormat !== null && { OutputFormat: input.OutputFormat }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), + ...(input.SchemaReference !== undefined && + input.SchemaReference !== null && { + SchemaReference: serializeAws_json1_1SchemaReference(input.SchemaReference, context), + }), + ...(input.SerdeInfo !== undefined && + input.SerdeInfo !== null && { SerdeInfo: serializeAws_json1_1SerDeInfo(input.SerdeInfo, context) }), + ...(input.SkewedInfo !== undefined && + input.SkewedInfo !== null && { SkewedInfo: serializeAws_json1_1SkewedInfo(input.SkewedInfo, context) }), + ...(input.SortColumns !== undefined && + input.SortColumns !== null && { SortColumns: serializeAws_json1_1OrderList(input.SortColumns, context) }), + ...(input.StoredAsSubDirectories !== undefined && + input.StoredAsSubDirectories !== null && { StoredAsSubDirectories: input.StoredAsSubDirectories }), }; }; @@ -18452,174 +18872,221 @@ const serializeAws_json1_1StringColumnStatisticsData = ( context: __SerdeContext ): any => { return { - ...(input.AverageLength !== undefined && { AverageLength: input.AverageLength }), - ...(input.MaximumLength !== undefined && { MaximumLength: input.MaximumLength }), - ...(input.NumberOfDistinctValues !== undefined && { NumberOfDistinctValues: input.NumberOfDistinctValues }), - ...(input.NumberOfNulls !== undefined && { NumberOfNulls: input.NumberOfNulls }), + ...(input.AverageLength !== undefined && input.AverageLength !== null && { AverageLength: input.AverageLength }), + ...(input.MaximumLength !== undefined && input.MaximumLength !== null && { MaximumLength: input.MaximumLength }), + ...(input.NumberOfDistinctValues !== undefined && + input.NumberOfDistinctValues !== null && { NumberOfDistinctValues: input.NumberOfDistinctValues }), + ...(input.NumberOfNulls !== undefined && input.NumberOfNulls !== null && { NumberOfNulls: input.NumberOfNulls }), }; }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TableIdentifier = (input: TableIdentifier, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1TableInput = (input: TableInput, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LastAccessTime !== undefined && { LastAccessTime: Math.round(input.LastAccessTime.getTime() / 1000) }), - ...(input.LastAnalyzedTime !== undefined && { - LastAnalyzedTime: Math.round(input.LastAnalyzedTime.getTime() / 1000), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Owner !== undefined && { Owner: input.Owner }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), - ...(input.PartitionKeys !== undefined && { - PartitionKeys: serializeAws_json1_1ColumnList(input.PartitionKeys, context), - }), - ...(input.Retention !== undefined && { Retention: input.Retention }), - ...(input.StorageDescriptor !== undefined && { - StorageDescriptor: serializeAws_json1_1StorageDescriptor(input.StorageDescriptor, context), - }), - ...(input.TableType !== undefined && { TableType: input.TableType }), - ...(input.TargetTable !== undefined && { - TargetTable: serializeAws_json1_1TableIdentifier(input.TargetTable, context), - }), - ...(input.ViewExpandedText !== undefined && { ViewExpandedText: input.ViewExpandedText }), - ...(input.ViewOriginalText !== undefined && { ViewOriginalText: input.ViewOriginalText }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LastAccessTime !== undefined && + input.LastAccessTime !== null && { LastAccessTime: Math.round(input.LastAccessTime.getTime() / 1000) }), + ...(input.LastAnalyzedTime !== undefined && + input.LastAnalyzedTime !== null && { LastAnalyzedTime: Math.round(input.LastAnalyzedTime.getTime() / 1000) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Owner !== undefined && input.Owner !== null && { Owner: input.Owner }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) }), + ...(input.PartitionKeys !== undefined && + input.PartitionKeys !== null && { PartitionKeys: serializeAws_json1_1ColumnList(input.PartitionKeys, context) }), + ...(input.Retention !== undefined && input.Retention !== null && { Retention: input.Retention }), + ...(input.StorageDescriptor !== undefined && + input.StorageDescriptor !== null && { + StorageDescriptor: serializeAws_json1_1StorageDescriptor(input.StorageDescriptor, context), + }), + ...(input.TableType !== undefined && input.TableType !== null && { TableType: input.TableType }), + ...(input.TargetTable !== undefined && + input.TargetTable !== null && { TargetTable: serializeAws_json1_1TableIdentifier(input.TargetTable, context) }), + ...(input.ViewExpandedText !== undefined && + input.ViewExpandedText !== null && { ViewExpandedText: input.ViewExpandedText }), + ...(input.ViewOriginalText !== undefined && + input.ViewOriginalText !== null && { ViewOriginalText: input.ViewOriginalText }), }; }; const serializeAws_json1_1TagKeysList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagsToAdd !== undefined && { TagsToAdd: serializeAws_json1_1TagsMap(input.TagsToAdd, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagsToAdd !== undefined && + input.TagsToAdd !== null && { TagsToAdd: serializeAws_json1_1TagsMap(input.TagsToAdd, context) }), }; }; const serializeAws_json1_1TagsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1TaskRunFilterCriteria = (input: TaskRunFilterCriteria, context: __SerdeContext): any => { return { - ...(input.StartedAfter !== undefined && { StartedAfter: Math.round(input.StartedAfter.getTime() / 1000) }), - ...(input.StartedBefore !== undefined && { StartedBefore: Math.round(input.StartedBefore.getTime() / 1000) }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.TaskRunType !== undefined && { TaskRunType: input.TaskRunType }), + ...(input.StartedAfter !== undefined && + input.StartedAfter !== null && { StartedAfter: Math.round(input.StartedAfter.getTime() / 1000) }), + ...(input.StartedBefore !== undefined && + input.StartedBefore !== null && { StartedBefore: Math.round(input.StartedBefore.getTime() / 1000) }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.TaskRunType !== undefined && input.TaskRunType !== null && { TaskRunType: input.TaskRunType }), }; }; const serializeAws_json1_1TaskRunSortCriteria = (input: TaskRunSortCriteria, context: __SerdeContext): any => { return { - ...(input.Column !== undefined && { Column: input.Column }), - ...(input.SortDirection !== undefined && { SortDirection: input.SortDirection }), + ...(input.Column !== undefined && input.Column !== null && { Column: input.Column }), + ...(input.SortDirection !== undefined && input.SortDirection !== null && { SortDirection: input.SortDirection }), }; }; const serializeAws_json1_1TransformEncryption = (input: TransformEncryption, context: __SerdeContext): any => { return { - ...(input.MlUserDataEncryption !== undefined && { - MlUserDataEncryption: serializeAws_json1_1MLUserDataEncryption(input.MlUserDataEncryption, context), - }), - ...(input.TaskRunSecurityConfigurationName !== undefined && { - TaskRunSecurityConfigurationName: input.TaskRunSecurityConfigurationName, - }), + ...(input.MlUserDataEncryption !== undefined && + input.MlUserDataEncryption !== null && { + MlUserDataEncryption: serializeAws_json1_1MLUserDataEncryption(input.MlUserDataEncryption, context), + }), + ...(input.TaskRunSecurityConfigurationName !== undefined && + input.TaskRunSecurityConfigurationName !== null && { + TaskRunSecurityConfigurationName: input.TaskRunSecurityConfigurationName, + }), }; }; const serializeAws_json1_1TransformFilterCriteria = (input: TransformFilterCriteria, context: __SerdeContext): any => { return { - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.GlueVersion !== undefined && { GlueVersion: input.GlueVersion }), - ...(input.LastModifiedAfter !== undefined && { - LastModifiedAfter: Math.round(input.LastModifiedAfter.getTime() / 1000), - }), - ...(input.LastModifiedBefore !== undefined && { - LastModifiedBefore: Math.round(input.LastModifiedBefore.getTime() / 1000), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Schema !== undefined && { Schema: serializeAws_json1_1TransformSchema(input.Schema, context) }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.TransformType !== undefined && { TransformType: input.TransformType }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.GlueVersion !== undefined && input.GlueVersion !== null && { GlueVersion: input.GlueVersion }), + ...(input.LastModifiedAfter !== undefined && + input.LastModifiedAfter !== null && { LastModifiedAfter: Math.round(input.LastModifiedAfter.getTime() / 1000) }), + ...(input.LastModifiedBefore !== undefined && + input.LastModifiedBefore !== null && { + LastModifiedBefore: Math.round(input.LastModifiedBefore.getTime() / 1000), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Schema !== undefined && + input.Schema !== null && { Schema: serializeAws_json1_1TransformSchema(input.Schema, context) }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.TransformType !== undefined && input.TransformType !== null && { TransformType: input.TransformType }), }; }; const serializeAws_json1_1TransformParameters = (input: TransformParameters, context: __SerdeContext): any => { return { - ...(input.FindMatchesParameters !== undefined && { - FindMatchesParameters: serializeAws_json1_1FindMatchesParameters(input.FindMatchesParameters, context), - }), - ...(input.TransformType !== undefined && { TransformType: input.TransformType }), + ...(input.FindMatchesParameters !== undefined && + input.FindMatchesParameters !== null && { + FindMatchesParameters: serializeAws_json1_1FindMatchesParameters(input.FindMatchesParameters, context), + }), + ...(input.TransformType !== undefined && input.TransformType !== null && { TransformType: input.TransformType }), }; }; const serializeAws_json1_1TransformSchema = (input: SchemaColumn[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SchemaColumn(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SchemaColumn(entry, context); + }); }; const serializeAws_json1_1TransformSortCriteria = (input: TransformSortCriteria, context: __SerdeContext): any => { return { - ...(input.Column !== undefined && { Column: input.Column }), - ...(input.SortDirection !== undefined && { SortDirection: input.SortDirection }), + ...(input.Column !== undefined && input.Column !== null && { Column: input.Column }), + ...(input.SortDirection !== undefined && input.SortDirection !== null && { SortDirection: input.SortDirection }), }; }; const serializeAws_json1_1TriggerNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TriggerUpdate = (input: TriggerUpdate, context: __SerdeContext): any => { return { - ...(input.Actions !== undefined && { Actions: serializeAws_json1_1ActionList(input.Actions, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Predicate !== undefined && { Predicate: serializeAws_json1_1Predicate(input.Predicate, context) }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_json1_1ActionList(input.Actions, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Predicate !== undefined && + input.Predicate !== null && { Predicate: serializeAws_json1_1Predicate(input.Predicate, context) }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagsToRemove !== undefined && { - TagsToRemove: serializeAws_json1_1TagKeysList(input.TagsToRemove, context), - }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagsToRemove !== undefined && + input.TagsToRemove !== null && { TagsToRemove: serializeAws_json1_1TagKeysList(input.TagsToRemove, context) }), }; }; const serializeAws_json1_1UpdateClassifierRequest = (input: UpdateClassifierRequest, context: __SerdeContext): any => { return { - ...(input.CsvClassifier !== undefined && { - CsvClassifier: serializeAws_json1_1UpdateCsvClassifierRequest(input.CsvClassifier, context), - }), - ...(input.GrokClassifier !== undefined && { - GrokClassifier: serializeAws_json1_1UpdateGrokClassifierRequest(input.GrokClassifier, context), - }), - ...(input.JsonClassifier !== undefined && { - JsonClassifier: serializeAws_json1_1UpdateJsonClassifierRequest(input.JsonClassifier, context), - }), - ...(input.XMLClassifier !== undefined && { - XMLClassifier: serializeAws_json1_1UpdateXMLClassifierRequest(input.XMLClassifier, context), - }), + ...(input.CsvClassifier !== undefined && + input.CsvClassifier !== null && { + CsvClassifier: serializeAws_json1_1UpdateCsvClassifierRequest(input.CsvClassifier, context), + }), + ...(input.GrokClassifier !== undefined && + input.GrokClassifier !== null && { + GrokClassifier: serializeAws_json1_1UpdateGrokClassifierRequest(input.GrokClassifier, context), + }), + ...(input.JsonClassifier !== undefined && + input.JsonClassifier !== null && { + JsonClassifier: serializeAws_json1_1UpdateJsonClassifierRequest(input.JsonClassifier, context), + }), + ...(input.XMLClassifier !== undefined && + input.XMLClassifier !== null && { + XMLClassifier: serializeAws_json1_1UpdateXMLClassifierRequest(input.XMLClassifier, context), + }), }; }; @@ -18628,15 +19095,17 @@ const serializeAws_json1_1UpdateColumnStatisticsForPartitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ColumnStatisticsList !== undefined && { - ColumnStatisticsList: serializeAws_json1_1UpdateColumnStatisticsList(input.ColumnStatisticsList, context), - }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionValues !== undefined && { - PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ColumnStatisticsList !== undefined && + input.ColumnStatisticsList !== null && { + ColumnStatisticsList: serializeAws_json1_1UpdateColumnStatisticsList(input.ColumnStatisticsList, context), + }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionValues !== undefined && + input.PartitionValues !== null && { + PartitionValues: serializeAws_json1_1ValueStringList(input.PartitionValues, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -18645,54 +19114,69 @@ const serializeAws_json1_1UpdateColumnStatisticsForTableRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ColumnStatisticsList !== undefined && { - ColumnStatisticsList: serializeAws_json1_1UpdateColumnStatisticsList(input.ColumnStatisticsList, context), - }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ColumnStatisticsList !== undefined && + input.ColumnStatisticsList !== null && { + ColumnStatisticsList: serializeAws_json1_1UpdateColumnStatisticsList(input.ColumnStatisticsList, context), + }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1UpdateColumnStatisticsList = (input: ColumnStatistics[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ColumnStatistics(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ColumnStatistics(entry, context); + }); }; const serializeAws_json1_1UpdateConnectionRequest = (input: UpdateConnectionRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ConnectionInput !== undefined && { - ConnectionInput: serializeAws_json1_1ConnectionInput(input.ConnectionInput, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ConnectionInput !== undefined && + input.ConnectionInput !== null && { + ConnectionInput: serializeAws_json1_1ConnectionInput(input.ConnectionInput, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1UpdateCrawlerRequest = (input: UpdateCrawlerRequest, context: __SerdeContext): any => { return { - ...(input.Classifiers !== undefined && { - Classifiers: serializeAws_json1_1ClassifierNameList(input.Classifiers, context), - }), - ...(input.Configuration !== undefined && { Configuration: input.Configuration }), - ...(input.CrawlerSecurityConfiguration !== undefined && { - CrawlerSecurityConfiguration: input.CrawlerSecurityConfiguration, - }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LineageConfiguration !== undefined && { - LineageConfiguration: serializeAws_json1_1LineageConfiguration(input.LineageConfiguration, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RecrawlPolicy !== undefined && { - RecrawlPolicy: serializeAws_json1_1RecrawlPolicy(input.RecrawlPolicy, context), - }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), - ...(input.SchemaChangePolicy !== undefined && { - SchemaChangePolicy: serializeAws_json1_1SchemaChangePolicy(input.SchemaChangePolicy, context), - }), - ...(input.TablePrefix !== undefined && { TablePrefix: input.TablePrefix }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1CrawlerTargets(input.Targets, context) }), + ...(input.Classifiers !== undefined && + input.Classifiers !== null && { + Classifiers: serializeAws_json1_1ClassifierNameList(input.Classifiers, context), + }), + ...(input.Configuration !== undefined && input.Configuration !== null && { Configuration: input.Configuration }), + ...(input.CrawlerSecurityConfiguration !== undefined && + input.CrawlerSecurityConfiguration !== null && { + CrawlerSecurityConfiguration: input.CrawlerSecurityConfiguration, + }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LineageConfiguration !== undefined && + input.LineageConfiguration !== null && { + LineageConfiguration: serializeAws_json1_1LineageConfiguration(input.LineageConfiguration, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RecrawlPolicy !== undefined && + input.RecrawlPolicy !== null && { + RecrawlPolicy: serializeAws_json1_1RecrawlPolicy(input.RecrawlPolicy, context), + }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), + ...(input.SchemaChangePolicy !== undefined && + input.SchemaChangePolicy !== null && { + SchemaChangePolicy: serializeAws_json1_1SchemaChangePolicy(input.SchemaChangePolicy, context), + }), + ...(input.TablePrefix !== undefined && input.TablePrefix !== null && { TablePrefix: input.TablePrefix }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1CrawlerTargets(input.Targets, context) }), }; }; @@ -18701,8 +19185,8 @@ const serializeAws_json1_1UpdateCrawlerScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.CrawlerName !== undefined && { CrawlerName: input.CrawlerName }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), + ...(input.CrawlerName !== undefined && input.CrawlerName !== null && { CrawlerName: input.CrawlerName }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), }; }; @@ -18711,23 +19195,28 @@ const serializeAws_json1_1UpdateCsvClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.AllowSingleColumn !== undefined && { AllowSingleColumn: input.AllowSingleColumn }), - ...(input.ContainsHeader !== undefined && { ContainsHeader: input.ContainsHeader }), - ...(input.Delimiter !== undefined && { Delimiter: input.Delimiter }), - ...(input.DisableValueTrimming !== undefined && { DisableValueTrimming: input.DisableValueTrimming }), - ...(input.Header !== undefined && { Header: serializeAws_json1_1CsvHeader(input.Header, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.QuoteSymbol !== undefined && { QuoteSymbol: input.QuoteSymbol }), + ...(input.AllowSingleColumn !== undefined && + input.AllowSingleColumn !== null && { AllowSingleColumn: input.AllowSingleColumn }), + ...(input.ContainsHeader !== undefined && + input.ContainsHeader !== null && { ContainsHeader: input.ContainsHeader }), + ...(input.Delimiter !== undefined && input.Delimiter !== null && { Delimiter: input.Delimiter }), + ...(input.DisableValueTrimming !== undefined && + input.DisableValueTrimming !== null && { DisableValueTrimming: input.DisableValueTrimming }), + ...(input.Header !== undefined && + input.Header !== null && { Header: serializeAws_json1_1CsvHeader(input.Header, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.QuoteSymbol !== undefined && input.QuoteSymbol !== null && { QuoteSymbol: input.QuoteSymbol }), }; }; const serializeAws_json1_1UpdateDatabaseRequest = (input: UpdateDatabaseRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseInput !== undefined && { - DatabaseInput: serializeAws_json1_1DatabaseInput(input.DatabaseInput, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseInput !== undefined && + input.DatabaseInput !== null && { + DatabaseInput: serializeAws_json1_1DatabaseInput(input.DatabaseInput, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -18736,24 +19225,28 @@ const serializeAws_json1_1UpdateDevEndpointRequest = ( context: __SerdeContext ): any => { return { - ...(input.AddArguments !== undefined && { - AddArguments: serializeAws_json1_1MapValue(input.AddArguments, context), - }), - ...(input.AddPublicKeys !== undefined && { - AddPublicKeys: serializeAws_json1_1PublicKeysList(input.AddPublicKeys, context), - }), - ...(input.CustomLibraries !== undefined && { - CustomLibraries: serializeAws_json1_1DevEndpointCustomLibraries(input.CustomLibraries, context), - }), - ...(input.DeleteArguments !== undefined && { - DeleteArguments: serializeAws_json1_1StringList(input.DeleteArguments, context), - }), - ...(input.DeletePublicKeys !== undefined && { - DeletePublicKeys: serializeAws_json1_1PublicKeysList(input.DeletePublicKeys, context), - }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.PublicKey !== undefined && { PublicKey: input.PublicKey }), - ...(input.UpdateEtlLibraries !== undefined && { UpdateEtlLibraries: input.UpdateEtlLibraries }), + ...(input.AddArguments !== undefined && + input.AddArguments !== null && { AddArguments: serializeAws_json1_1MapValue(input.AddArguments, context) }), + ...(input.AddPublicKeys !== undefined && + input.AddPublicKeys !== null && { + AddPublicKeys: serializeAws_json1_1PublicKeysList(input.AddPublicKeys, context), + }), + ...(input.CustomLibraries !== undefined && + input.CustomLibraries !== null && { + CustomLibraries: serializeAws_json1_1DevEndpointCustomLibraries(input.CustomLibraries, context), + }), + ...(input.DeleteArguments !== undefined && + input.DeleteArguments !== null && { + DeleteArguments: serializeAws_json1_1StringList(input.DeleteArguments, context), + }), + ...(input.DeletePublicKeys !== undefined && + input.DeletePublicKeys !== null && { + DeletePublicKeys: serializeAws_json1_1PublicKeysList(input.DeletePublicKeys, context), + }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.PublicKey !== undefined && input.PublicKey !== null && { PublicKey: input.PublicKey }), + ...(input.UpdateEtlLibraries !== undefined && + input.UpdateEtlLibraries !== null && { UpdateEtlLibraries: input.UpdateEtlLibraries }), }; }; @@ -18762,17 +19255,20 @@ const serializeAws_json1_1UpdateGrokClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.Classification !== undefined && { Classification: input.Classification }), - ...(input.CustomPatterns !== undefined && { CustomPatterns: input.CustomPatterns }), - ...(input.GrokPattern !== undefined && { GrokPattern: input.GrokPattern }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Classification !== undefined && + input.Classification !== null && { Classification: input.Classification }), + ...(input.CustomPatterns !== undefined && + input.CustomPatterns !== null && { CustomPatterns: input.CustomPatterns }), + ...(input.GrokPattern !== undefined && input.GrokPattern !== null && { GrokPattern: input.GrokPattern }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1UpdateJobRequest = (input: UpdateJobRequest, context: __SerdeContext): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobUpdate !== undefined && { JobUpdate: serializeAws_json1_1JobUpdate(input.JobUpdate, context) }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobUpdate !== undefined && + input.JobUpdate !== null && { JobUpdate: serializeAws_json1_1JobUpdate(input.JobUpdate, context) }), }; }; @@ -18781,8 +19277,8 @@ const serializeAws_json1_1UpdateJsonClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.JsonPath !== undefined && { JsonPath: input.JsonPath }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.JsonPath !== undefined && input.JsonPath !== null && { JsonPath: input.JsonPath }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -18791,69 +19287,76 @@ const serializeAws_json1_1UpdateMLTransformRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.GlueVersion !== undefined && { GlueVersion: input.GlueVersion }), - ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), - ...(input.MaxRetries !== undefined && { MaxRetries: input.MaxRetries }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NumberOfWorkers !== undefined && { NumberOfWorkers: input.NumberOfWorkers }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1TransformParameters(input.Parameters, context), - }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.TransformId !== undefined && { TransformId: input.TransformId }), - ...(input.WorkerType !== undefined && { WorkerType: input.WorkerType }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.GlueVersion !== undefined && input.GlueVersion !== null && { GlueVersion: input.GlueVersion }), + ...(input.MaxCapacity !== undefined && input.MaxCapacity !== null && { MaxCapacity: input.MaxCapacity }), + ...(input.MaxRetries !== undefined && input.MaxRetries !== null && { MaxRetries: input.MaxRetries }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NumberOfWorkers !== undefined && + input.NumberOfWorkers !== null && { NumberOfWorkers: input.NumberOfWorkers }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1TransformParameters(input.Parameters, context) }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.TransformId !== undefined && input.TransformId !== null && { TransformId: input.TransformId }), + ...(input.WorkerType !== undefined && input.WorkerType !== null && { WorkerType: input.WorkerType }), }; }; const serializeAws_json1_1UpdatePartitionRequest = (input: UpdatePartitionRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.PartitionInput !== undefined && { - PartitionInput: serializeAws_json1_1PartitionInput(input.PartitionInput, context), - }), - ...(input.PartitionValueList !== undefined && { - PartitionValueList: serializeAws_json1_1BoundedPartitionValueList(input.PartitionValueList, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.PartitionInput !== undefined && + input.PartitionInput !== null && { + PartitionInput: serializeAws_json1_1PartitionInput(input.PartitionInput, context), + }), + ...(input.PartitionValueList !== undefined && + input.PartitionValueList !== null && { + PartitionValueList: serializeAws_json1_1BoundedPartitionValueList(input.PartitionValueList, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1UpdateRegistryInput = (input: UpdateRegistryInput, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.RegistryId !== undefined && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.RegistryId !== undefined && + input.RegistryId !== null && { RegistryId: serializeAws_json1_1RegistryId(input.RegistryId, context) }), }; }; const serializeAws_json1_1UpdateSchemaInput = (input: UpdateSchemaInput, context: __SerdeContext): any => { return { - ...(input.Compatibility !== undefined && { Compatibility: input.Compatibility }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.SchemaId !== undefined && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), - ...(input.SchemaVersionNumber !== undefined && { - SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), - }), + ...(input.Compatibility !== undefined && input.Compatibility !== null && { Compatibility: input.Compatibility }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.SchemaId !== undefined && + input.SchemaId !== null && { SchemaId: serializeAws_json1_1SchemaId(input.SchemaId, context) }), + ...(input.SchemaVersionNumber !== undefined && + input.SchemaVersionNumber !== null && { + SchemaVersionNumber: serializeAws_json1_1SchemaVersionNumber(input.SchemaVersionNumber, context), + }), }; }; const serializeAws_json1_1UpdateTableRequest = (input: UpdateTableRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.SkipArchive !== undefined && { SkipArchive: input.SkipArchive }), - ...(input.TableInput !== undefined && { TableInput: serializeAws_json1_1TableInput(input.TableInput, context) }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.SkipArchive !== undefined && input.SkipArchive !== null && { SkipArchive: input.SkipArchive }), + ...(input.TableInput !== undefined && + input.TableInput !== null && { TableInput: serializeAws_json1_1TableInput(input.TableInput, context) }), }; }; const serializeAws_json1_1UpdateTriggerRequest = (input: UpdateTriggerRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.TriggerUpdate !== undefined && { - TriggerUpdate: serializeAws_json1_1TriggerUpdate(input.TriggerUpdate, context), - }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.TriggerUpdate !== undefined && + input.TriggerUpdate !== null && { + TriggerUpdate: serializeAws_json1_1TriggerUpdate(input.TriggerUpdate, context), + }), }; }; @@ -18862,23 +19365,26 @@ const serializeAws_json1_1UpdateUserDefinedFunctionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.FunctionInput !== undefined && { - FunctionInput: serializeAws_json1_1UserDefinedFunctionInput(input.FunctionInput, context), - }), - ...(input.FunctionName !== undefined && { FunctionName: input.FunctionName }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.FunctionInput !== undefined && + input.FunctionInput !== null && { + FunctionInput: serializeAws_json1_1UserDefinedFunctionInput(input.FunctionInput, context), + }), + ...(input.FunctionName !== undefined && input.FunctionName !== null && { FunctionName: input.FunctionName }), }; }; const serializeAws_json1_1UpdateWorkflowRequest = (input: UpdateWorkflowRequest, context: __SerdeContext): any => { return { - ...(input.DefaultRunProperties !== undefined && { - DefaultRunProperties: serializeAws_json1_1WorkflowRunProperties(input.DefaultRunProperties, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.MaxConcurrentRuns !== undefined && { MaxConcurrentRuns: input.MaxConcurrentRuns }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.DefaultRunProperties !== undefined && + input.DefaultRunProperties !== null && { + DefaultRunProperties: serializeAws_json1_1WorkflowRunProperties(input.DefaultRunProperties, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.MaxConcurrentRuns !== undefined && + input.MaxConcurrentRuns !== null && { MaxConcurrentRuns: input.MaxConcurrentRuns }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -18887,9 +19393,10 @@ const serializeAws_json1_1UpdateXMLClassifierRequest = ( context: __SerdeContext ): any => { return { - ...(input.Classification !== undefined && { Classification: input.Classification }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RowTag !== undefined && { RowTag: input.RowTag }), + ...(input.Classification !== undefined && + input.Classification !== null && { Classification: input.Classification }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RowTag !== undefined && input.RowTag !== null && { RowTag: input.RowTag }), }; }; @@ -18898,32 +19405,49 @@ const serializeAws_json1_1UserDefinedFunctionInput = ( context: __SerdeContext ): any => { return { - ...(input.ClassName !== undefined && { ClassName: input.ClassName }), - ...(input.FunctionName !== undefined && { FunctionName: input.FunctionName }), - ...(input.OwnerName !== undefined && { OwnerName: input.OwnerName }), - ...(input.OwnerType !== undefined && { OwnerType: input.OwnerType }), - ...(input.ResourceUris !== undefined && { - ResourceUris: serializeAws_json1_1ResourceUriList(input.ResourceUris, context), - }), + ...(input.ClassName !== undefined && input.ClassName !== null && { ClassName: input.ClassName }), + ...(input.FunctionName !== undefined && input.FunctionName !== null && { FunctionName: input.FunctionName }), + ...(input.OwnerName !== undefined && input.OwnerName !== null && { OwnerName: input.OwnerName }), + ...(input.OwnerType !== undefined && input.OwnerType !== null && { OwnerType: input.OwnerType }), + ...(input.ResourceUris !== undefined && + input.ResourceUris !== null && { + ResourceUris: serializeAws_json1_1ResourceUriList(input.ResourceUris, context), + }), }; }; const serializeAws_json1_1ValueStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1WorkflowNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1WorkflowRunProperties = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => { @@ -18953,7 +19477,14 @@ const deserializeAws_json1_1Action = (output: any, context: __SerdeContext): Act }; const deserializeAws_json1_1ActionList = (output: any, context: __SerdeContext): Action[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Action(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Action(entry, context); + }); }; const deserializeAws_json1_1AlreadyExistsException = (output: any, context: __SerdeContext): AlreadyExistsException => { @@ -18976,11 +19507,25 @@ const deserializeAws_json1_1BackfillErroredPartitionsList = ( output: any, context: __SerdeContext ): PartitionValueList[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PartitionValueList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PartitionValueList(entry, context); + }); }; const deserializeAws_json1_1BackfillErrors = (output: any, context: __SerdeContext): BackfillError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BackfillError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BackfillError(entry, context); + }); }; const deserializeAws_json1_1BatchCreatePartitionResponse = ( @@ -19112,7 +19657,14 @@ const deserializeAws_json1_1BatchGetPartitionValueList = ( output: any, context: __SerdeContext ): PartitionValueList[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PartitionValueList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PartitionValueList(entry, context); + }); }; const deserializeAws_json1_1BatchGetTriggersResponse = ( @@ -19162,7 +19714,14 @@ const deserializeAws_json1_1BatchStopJobRunErrorList = ( output: any, context: __SerdeContext ): BatchStopJobRunError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchStopJobRunError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchStopJobRunError(entry, context); + }); }; const deserializeAws_json1_1BatchStopJobRunResponse = ( @@ -19195,7 +19754,14 @@ const deserializeAws_json1_1BatchStopJobRunSuccessfulSubmissionList = ( output: any, context: __SerdeContext ): BatchStopJobRunSuccessfulSubmission[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchStopJobRunSuccessfulSubmission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchStopJobRunSuccessfulSubmission(entry, context); + }); }; const deserializeAws_json1_1BatchUpdatePartitionFailureEntry = ( @@ -19218,7 +19784,14 @@ const deserializeAws_json1_1BatchUpdatePartitionFailureList = ( output: any, context: __SerdeContext ): BatchUpdatePartitionFailureEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchUpdatePartitionFailureEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchUpdatePartitionFailureEntry(entry, context); + }); }; const deserializeAws_json1_1BatchUpdatePartitionResponse = ( @@ -19262,7 +19835,14 @@ const deserializeAws_json1_1BooleanColumnStatisticsData = ( }; const deserializeAws_json1_1BoundedPartitionValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CancelMLTaskRunResponse = ( @@ -19289,7 +19869,14 @@ const deserializeAws_json1_1CatalogImportStatus = (output: any, context: __Serde }; const deserializeAws_json1_1CatalogTablesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CatalogTarget = (output: any, context: __SerdeContext): CatalogTarget => { @@ -19303,7 +19890,14 @@ const deserializeAws_json1_1CatalogTarget = (output: any, context: __SerdeContex }; const deserializeAws_json1_1CatalogTargetList = (output: any, context: __SerdeContext): CatalogTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CatalogTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CatalogTarget(entry, context); + }); }; const deserializeAws_json1_1CheckSchemaVersionValidityResponse = ( @@ -19338,11 +19932,25 @@ const deserializeAws_json1_1Classifier = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ClassifierList = (output: any, context: __SerdeContext): Classifier[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Classifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Classifier(entry, context); + }); }; const deserializeAws_json1_1ClassifierNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CloudWatchEncryption = (output: any, context: __SerdeContext): CloudWatchEncryption => { @@ -19385,7 +19993,14 @@ const deserializeAws_json1_1CodeGenNodeArg = (output: any, context: __SerdeConte }; const deserializeAws_json1_1CodeGenNodeArgs = (output: any, context: __SerdeContext): CodeGenNodeArg[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CodeGenNodeArg(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CodeGenNodeArg(entry, context); + }); }; const deserializeAws_json1_1Column = (output: any, context: __SerdeContext): Column => { @@ -19411,11 +20026,25 @@ const deserializeAws_json1_1ColumnError = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ColumnErrors = (output: any, context: __SerdeContext): ColumnError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ColumnError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ColumnError(entry, context); + }); }; const deserializeAws_json1_1ColumnList = (output: any, context: __SerdeContext): Column[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Column(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Column(entry, context); + }); }; const deserializeAws_json1_1ColumnStatistics = (output: any, context: __SerdeContext): ColumnStatistics => { @@ -19484,15 +20113,36 @@ const deserializeAws_json1_1ColumnStatisticsErrors = ( output: any, context: __SerdeContext ): ColumnStatisticsError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ColumnStatisticsError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ColumnStatisticsError(entry, context); + }); }; const deserializeAws_json1_1ColumnStatisticsList = (output: any, context: __SerdeContext): ColumnStatistics[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ColumnStatistics(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ColumnStatistics(entry, context); + }); }; const deserializeAws_json1_1ColumnValueStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ConcurrentModificationException = ( @@ -19534,7 +20184,14 @@ const deserializeAws_json1_1ConditionCheckFailureException = ( }; const deserializeAws_json1_1ConditionList = (output: any, context: __SerdeContext): Condition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Condition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Condition(entry, context); + }); }; const deserializeAws_json1_1ConflictException = (output: any, context: __SerdeContext): ConflictException => { @@ -19592,7 +20249,14 @@ const deserializeAws_json1_1Connection = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ConnectionList = (output: any, context: __SerdeContext): Connection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Connection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Connection(entry, context); + }); }; const deserializeAws_json1_1ConnectionPasswordEncryption = ( @@ -19613,10 +20277,15 @@ const deserializeAws_json1_1ConnectionProperties = ( context: __SerdeContext ): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [ConnectionPropertyKey | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [ConnectionPropertyKey | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -19704,7 +20373,14 @@ const deserializeAws_json1_1Crawler = (output: any, context: __SerdeContext): Cr }; const deserializeAws_json1_1CrawlerList = (output: any, context: __SerdeContext): Crawler[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Crawler(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Crawler(entry, context); + }); }; const deserializeAws_json1_1CrawlerMetrics = (output: any, context: __SerdeContext): CrawlerMetrics => { @@ -19732,11 +20408,25 @@ const deserializeAws_json1_1CrawlerMetrics = (output: any, context: __SerdeConte }; const deserializeAws_json1_1CrawlerMetricsList = (output: any, context: __SerdeContext): CrawlerMetrics[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CrawlerMetrics(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CrawlerMetrics(entry, context); + }); }; const deserializeAws_json1_1CrawlerNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CrawlerNodeDetails = (output: any, context: __SerdeContext): CrawlerNodeDetails => { @@ -19801,7 +20491,14 @@ const deserializeAws_json1_1CrawlerTargets = (output: any, context: __SerdeConte }; const deserializeAws_json1_1CrawlList = (output: any, context: __SerdeContext): Crawl[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Crawl(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Crawl(entry, context); + }); }; const deserializeAws_json1_1CreateClassifierResponse = ( @@ -20029,15 +20726,36 @@ const deserializeAws_json1_1CsvClassifier = (output: any, context: __SerdeContex }; const deserializeAws_json1_1CsvHeader = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DagEdges = (output: any, context: __SerdeContext): CodeGenEdge[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CodeGenEdge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CodeGenEdge(entry, context); + }); }; const deserializeAws_json1_1DagNodes = (output: any, context: __SerdeContext): CodeGenNode[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CodeGenNode(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CodeGenNode(entry, context); + }); }; const deserializeAws_json1_1Database = (output: any, context: __SerdeContext): Database => { @@ -20073,7 +20791,14 @@ const deserializeAws_json1_1DatabaseIdentifier = (output: any, context: __SerdeC }; const deserializeAws_json1_1DatabaseList = (output: any, context: __SerdeContext): Database[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Database(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Database(entry, context); + }); }; const deserializeAws_json1_1DataCatalogEncryptionSettings = ( @@ -20365,15 +21090,36 @@ const deserializeAws_json1_1DevEndpoint = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1DevEndpointList = (output: any, context: __SerdeContext): DevEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DevEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DevEndpoint(entry, context); + }); }; const deserializeAws_json1_1DevEndpointNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DevEndpointNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DoubleColumnStatisticsData = ( @@ -20401,7 +21147,14 @@ const deserializeAws_json1_1DynamoDBTarget = (output: any, context: __SerdeConte }; const deserializeAws_json1_1DynamoDBTargetList = (output: any, context: __SerdeContext): DynamoDBTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DynamoDBTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DynamoDBTarget(entry, context); + }); }; const deserializeAws_json1_1Edge = (output: any, context: __SerdeContext): Edge => { @@ -20413,7 +21166,14 @@ const deserializeAws_json1_1Edge = (output: any, context: __SerdeContext): Edge }; const deserializeAws_json1_1EdgeList = (output: any, context: __SerdeContext): Edge[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Edge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Edge(entry, context); + }); }; const deserializeAws_json1_1EncryptionAtRest = (output: any, context: __SerdeContext): EncryptionAtRest => { @@ -20457,13 +21217,15 @@ const deserializeAws_json1_1EntityNotFoundException = ( }; const deserializeAws_json1_1ErrorByName = (output: any, context: __SerdeContext): { [key: string]: ErrorDetail } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ErrorDetail }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ErrorDetail }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1ErrorDetail(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ErrorDetail = (output: any, context: __SerdeContext): ErrorDetail => { @@ -20556,13 +21318,15 @@ const deserializeAws_json1_1FindMatchesTaskRunProperties = ( }; const deserializeAws_json1_1GenericMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1GetCatalogImportStatusResponse = ( @@ -20962,7 +21726,14 @@ const deserializeAws_json1_1GetResourcePoliciesResponse = ( }; const deserializeAws_json1_1GetResourcePoliciesResponseList = (output: any, context: __SerdeContext): GluePolicy[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GluePolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GluePolicy(entry, context); + }); }; const deserializeAws_json1_1GetResourcePolicyResponse = ( @@ -21107,7 +21878,14 @@ const deserializeAws_json1_1GetTableVersionResponse = ( }; const deserializeAws_json1_1GetTableVersionsList = (output: any, context: __SerdeContext): TableVersion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TableVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TableVersion(entry, context); + }); }; const deserializeAws_json1_1GetTableVersionsResponse = ( @@ -21254,7 +22032,14 @@ const deserializeAws_json1_1GlueTable = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1GlueTables = (output: any, context: __SerdeContext): GlueTable[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GlueTable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GlueTable(entry, context); + }); }; const deserializeAws_json1_1GrokClassifier = (output: any, context: __SerdeContext): GrokClassifier => { @@ -21340,7 +22125,14 @@ const deserializeAws_json1_1JdbcTarget = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1JdbcTargetList = (output: any, context: __SerdeContext): JdbcTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1JdbcTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1JdbcTarget(entry, context); + }); }; const deserializeAws_json1_1Job = (output: any, context: __SerdeContext): Job => { @@ -21433,11 +22225,25 @@ const deserializeAws_json1_1JobCommand = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1JobList = (output: any, context: __SerdeContext): Job[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Job(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Job(entry, context); + }); }; const deserializeAws_json1_1JobNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1JobNodeDetails = (output: any, context: __SerdeContext): JobNodeDetails => { @@ -21504,7 +22310,14 @@ const deserializeAws_json1_1JobRun = (output: any, context: __SerdeContext): Job }; const deserializeAws_json1_1JobRunList = (output: any, context: __SerdeContext): JobRun[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1JobRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1JobRun(entry, context); + }); }; const deserializeAws_json1_1JsonClassifier = (output: any, context: __SerdeContext): JsonClassifier => { @@ -21531,7 +22344,14 @@ const deserializeAws_json1_1KeySchemaElement = (output: any, context: __SerdeCon }; const deserializeAws_json1_1KeySchemaElementList = (output: any, context: __SerdeContext): KeySchemaElement[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeySchemaElement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeySchemaElement(entry, context); + }); }; const deserializeAws_json1_1LabelingSetGenerationTaskRunProperties = ( @@ -21667,13 +22487,15 @@ const deserializeAws_json1_1ListWorkflowsResponse = (output: any, context: __Ser }; const deserializeAws_json1_1LocationMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1LongColumnStatisticsData = ( @@ -21704,21 +22526,37 @@ const deserializeAws_json1_1MappingEntry = (output: any, context: __SerdeContext }; const deserializeAws_json1_1MappingList = (output: any, context: __SerdeContext): MappingEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MappingEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MappingEntry(entry, context); + }); }; const deserializeAws_json1_1MapValue = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1MatchCriteria = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1MetadataInfo = (output: any, context: __SerdeContext): MetadataInfo => { @@ -21733,13 +22571,15 @@ const deserializeAws_json1_1MetadataInfoMap = ( output: any, context: __SerdeContext ): { [key: string]: MetadataInfo } => { - return Object.entries(output).reduce( - (acc: { [key: string]: MetadataInfo }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: MetadataInfo }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1MetadataInfo(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1MLTransform = (output: any, context: __SerdeContext): MLTransform => { @@ -21817,11 +22657,25 @@ const deserializeAws_json1_1MongoDBTarget = (output: any, context: __SerdeContex }; const deserializeAws_json1_1MongoDBTargetList = (output: any, context: __SerdeContext): MongoDBTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MongoDBTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MongoDBTarget(entry, context); + }); }; const deserializeAws_json1_1NameStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Node = (output: any, context: __SerdeContext): Node => { @@ -21845,11 +22699,25 @@ const deserializeAws_json1_1Node = (output: any, context: __SerdeContext): Node }; const deserializeAws_json1_1NodeIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NodeList = (output: any, context: __SerdeContext): Node[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Node(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Node(entry, context); + }); }; const deserializeAws_json1_1NoScheduleException = (output: any, context: __SerdeContext): NoScheduleException => { @@ -21875,7 +22743,14 @@ const deserializeAws_json1_1OperationTimeoutException = ( }; const deserializeAws_json1_1OrchestrationStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Order = (output: any, context: __SerdeContext): Order => { @@ -21886,17 +22761,26 @@ const deserializeAws_json1_1Order = (output: any, context: __SerdeContext): Orde }; const deserializeAws_json1_1OrderList = (output: any, context: __SerdeContext): Order[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Order(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Order(entry, context); + }); }; const deserializeAws_json1_1ParametersMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Partition = (output: any, context: __SerdeContext): Partition => { @@ -21945,7 +22829,14 @@ const deserializeAws_json1_1PartitionError = (output: any, context: __SerdeConte }; const deserializeAws_json1_1PartitionErrors = (output: any, context: __SerdeContext): PartitionError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PartitionError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PartitionError(entry, context); + }); }; const deserializeAws_json1_1PartitionIndexDescriptor = ( @@ -21970,11 +22861,25 @@ const deserializeAws_json1_1PartitionIndexDescriptorList = ( output: any, context: __SerdeContext ): PartitionIndexDescriptor[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PartitionIndexDescriptor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PartitionIndexDescriptor(entry, context); + }); }; const deserializeAws_json1_1PartitionList = (output: any, context: __SerdeContext): Partition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Partition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Partition(entry, context); + }); }; const deserializeAws_json1_1PartitionValueList = (output: any, context: __SerdeContext): PartitionValueList => { @@ -21987,11 +22892,25 @@ const deserializeAws_json1_1PartitionValueList = (output: any, context: __SerdeC }; const deserializeAws_json1_1PathList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PermissionList = (output: any, context: __SerdeContext): (Permission | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PhysicalConnectionRequirements = ( @@ -22017,7 +22936,14 @@ const deserializeAws_json1_1Predecessor = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1PredecessorList = (output: any, context: __SerdeContext): Predecessor[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Predecessor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Predecessor(entry, context); + }); }; const deserializeAws_json1_1Predicate = (output: any, context: __SerdeContext): Predicate => { @@ -22047,11 +22973,25 @@ const deserializeAws_json1_1PrincipalPermissionsList = ( output: any, context: __SerdeContext ): PrincipalPermissions[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PrincipalPermissions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PrincipalPermissions(entry, context); + }); }; const deserializeAws_json1_1PublicKeysList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PutDataCatalogEncryptionSettingsResponse = ( @@ -22133,7 +23073,14 @@ const deserializeAws_json1_1RegisterSchemaVersionResponse = ( }; const deserializeAws_json1_1RegistryListDefinition = (output: any, context: __SerdeContext): RegistryListItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegistryListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegistryListItem(entry, context); + }); }; const deserializeAws_json1_1RegistryListItem = (output: any, context: __SerdeContext): RegistryListItem => { @@ -22196,7 +23143,14 @@ const deserializeAws_json1_1ResourceUri = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ResourceUriList = (output: any, context: __SerdeContext): ResourceUri[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceUri(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceUri(entry, context); + }); }; const deserializeAws_json1_1ResumeWorkflowRunResponse = ( @@ -22221,7 +23175,14 @@ const deserializeAws_json1_1S3Encryption = (output: any, context: __SerdeContext }; const deserializeAws_json1_1S3EncryptionList = (output: any, context: __SerdeContext): S3Encryption[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1S3Encryption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1S3Encryption(entry, context); + }); }; const deserializeAws_json1_1S3Target = (output: any, context: __SerdeContext): S3Target => { @@ -22237,7 +23198,14 @@ const deserializeAws_json1_1S3Target = (output: any, context: __SerdeContext): S }; const deserializeAws_json1_1S3TargetList = (output: any, context: __SerdeContext): S3Target[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1S3Target(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1S3Target(entry, context); + }); }; const deserializeAws_json1_1Schedule = (output: any, context: __SerdeContext): Schedule => { @@ -22302,7 +23270,14 @@ const deserializeAws_json1_1SchemaId = (output: any, context: __SerdeContext): S }; const deserializeAws_json1_1SchemaListDefinition = (output: any, context: __SerdeContext): SchemaListItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SchemaListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SchemaListItem(entry, context); + }); }; const deserializeAws_json1_1SchemaListItem = (output: any, context: __SerdeContext): SchemaListItem => { @@ -22347,11 +23322,25 @@ const deserializeAws_json1_1SchemaVersionErrorList = ( output: any, context: __SerdeContext ): SchemaVersionErrorItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SchemaVersionErrorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SchemaVersionErrorItem(entry, context); + }); }; const deserializeAws_json1_1SchemaVersionList = (output: any, context: __SerdeContext): SchemaVersionListItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SchemaVersionListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SchemaVersionListItem(entry, context); + }); }; const deserializeAws_json1_1SchemaVersionListItem = (output: any, context: __SerdeContext): SchemaVersionListItem => { @@ -22394,11 +23383,25 @@ const deserializeAws_json1_1SecurityConfigurationList = ( output: any, context: __SerdeContext ): SecurityConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SecurityConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SecurityConfiguration(entry, context); + }); }; const deserializeAws_json1_1SecurityGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SerDeInfo = (output: any, context: __SerdeContext): SerDeInfo => { @@ -22586,7 +23589,14 @@ const deserializeAws_json1_1StringColumnStatisticsData = ( }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Table = (output: any, context: __SerdeContext): Table => { @@ -22653,7 +23663,14 @@ const deserializeAws_json1_1TableError = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1TableErrors = (output: any, context: __SerdeContext): TableError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TableError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TableError(entry, context); + }); }; const deserializeAws_json1_1TableIdentifier = (output: any, context: __SerdeContext): TableIdentifier => { @@ -22665,7 +23682,14 @@ const deserializeAws_json1_1TableIdentifier = (output: any, context: __SerdeCont }; const deserializeAws_json1_1TableList = (output: any, context: __SerdeContext): Table[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Table(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Table(entry, context); + }); }; const deserializeAws_json1_1TableVersion = (output: any, context: __SerdeContext): TableVersion => { @@ -22690,7 +23714,14 @@ const deserializeAws_json1_1TableVersionError = (output: any, context: __SerdeCo }; const deserializeAws_json1_1TableVersionErrors = (output: any, context: __SerdeContext): TableVersionError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TableVersionError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TableVersionError(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -22698,13 +23729,15 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1TagsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1TaskRun = (output: any, context: __SerdeContext): TaskRun => { @@ -22736,7 +23769,14 @@ const deserializeAws_json1_1TaskRun = (output: any, context: __SerdeContext): Ta }; const deserializeAws_json1_1TaskRunList = (output: any, context: __SerdeContext): TaskRun[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TaskRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TaskRun(entry, context); + }); }; const deserializeAws_json1_1TaskRunProperties = (output: any, context: __SerdeContext): TaskRunProperties => { @@ -22779,11 +23819,25 @@ const deserializeAws_json1_1TransformEncryption = (output: any, context: __Serde }; const deserializeAws_json1_1TransformIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TransformList = (output: any, context: __SerdeContext): MLTransform[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MLTransform(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MLTransform(entry, context); + }); }; const deserializeAws_json1_1TransformParameters = (output: any, context: __SerdeContext): TransformParameters => { @@ -22798,7 +23852,14 @@ const deserializeAws_json1_1TransformParameters = (output: any, context: __Serde }; const deserializeAws_json1_1TransformSchema = (output: any, context: __SerdeContext): SchemaColumn[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SchemaColumn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SchemaColumn(entry, context); + }); }; const deserializeAws_json1_1Trigger = (output: any, context: __SerdeContext): Trigger => { @@ -22822,11 +23883,25 @@ const deserializeAws_json1_1Trigger = (output: any, context: __SerdeContext): Tr }; const deserializeAws_json1_1TriggerList = (output: any, context: __SerdeContext): Trigger[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Trigger(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Trigger(entry, context); + }); }; const deserializeAws_json1_1TriggerNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TriggerNodeDetails = (output: any, context: __SerdeContext): TriggerNodeDetails => { @@ -22985,7 +24060,14 @@ const deserializeAws_json1_1UserDefinedFunction = (output: any, context: __Serde }; const deserializeAws_json1_1UserDefinedFunctionList = (output: any, context: __SerdeContext): UserDefinedFunction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserDefinedFunction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserDefinedFunction(entry, context); + }); }; const deserializeAws_json1_1ValidationException = (output: any, context: __SerdeContext): ValidationException => { @@ -22995,7 +24077,14 @@ const deserializeAws_json1_1ValidationException = (output: any, context: __Serde }; const deserializeAws_json1_1ValueStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1VersionMismatchException = ( @@ -23052,7 +24141,14 @@ const deserializeAws_json1_1WorkflowGraph = (output: any, context: __SerdeContex }; const deserializeAws_json1_1WorkflowNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1WorkflowRun = (output: any, context: __SerdeContext): WorkflowRun => { @@ -23091,17 +24187,26 @@ const deserializeAws_json1_1WorkflowRunProperties = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1WorkflowRuns = (output: any, context: __SerdeContext): WorkflowRun[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WorkflowRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WorkflowRun(entry, context); + }); }; const deserializeAws_json1_1WorkflowRunStatistics = (output: any, context: __SerdeContext): WorkflowRunStatistics => { @@ -23121,7 +24226,14 @@ const deserializeAws_json1_1WorkflowRunStatistics = (output: any, context: __Ser }; const deserializeAws_json1_1Workflows = (output: any, context: __SerdeContext): Workflow[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Workflow(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Workflow(entry, context); + }); }; const deserializeAws_json1_1XMLClassifier = (output: any, context: __SerdeContext): XMLClassifier => { @@ -23192,3 +24304,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-greengrass/protocols/Aws_restJson1.ts b/clients/client-greengrass/protocols/Aws_restJson1.ts index 3c1cd74dcfd9..435191ee7919 100644 --- a/clients/client-greengrass/protocols/Aws_restJson1.ts +++ b/clients/client-greengrass/protocols/Aws_restJson1.ts @@ -382,7 +382,7 @@ export const serializeAws_restJson1AssociateRoleToGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/groups/{GroupId}/role"; if (input.GroupId !== undefined) { @@ -396,7 +396,7 @@ export const serializeAws_restJson1AssociateRoleToGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -415,12 +415,12 @@ export const serializeAws_restJson1AssociateServiceRoleToAccountCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/servicerole"; let body: any; body = JSON.stringify({ - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -439,17 +439,18 @@ export const serializeAws_restJson1CreateConnectorDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/connectors"; let body: any; body = JSON.stringify({ - ...(input.InitialVersion !== undefined && { - InitialVersion: serializeAws_restJson1ConnectorDefinitionVersion(input.InitialVersion, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.InitialVersion !== undefined && + input.InitialVersion !== null && { + InitialVersion: serializeAws_restJson1ConnectorDefinitionVersion(input.InitialVersion, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -468,7 +469,7 @@ export const serializeAws_restJson1CreateConnectorDefinitionVersionCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/connectors/{ConnectorDefinitionId}/versions"; @@ -483,9 +484,8 @@ export const serializeAws_restJson1CreateConnectorDefinitionVersionCommand = asy } let body: any; body = JSON.stringify({ - ...(input.Connectors !== undefined && { - Connectors: serializeAws_restJson1__listOfConnector(input.Connectors, context), - }), + ...(input.Connectors !== undefined && + input.Connectors !== null && { Connectors: serializeAws_restJson1__listOfConnector(input.Connectors, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -504,17 +504,18 @@ export const serializeAws_restJson1CreateCoreDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/cores"; let body: any; body = JSON.stringify({ - ...(input.InitialVersion !== undefined && { - InitialVersion: serializeAws_restJson1CoreDefinitionVersion(input.InitialVersion, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.InitialVersion !== undefined && + input.InitialVersion !== null && { + InitialVersion: serializeAws_restJson1CoreDefinitionVersion(input.InitialVersion, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -533,7 +534,7 @@ export const serializeAws_restJson1CreateCoreDefinitionVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/cores/{CoreDefinitionId}/versions"; @@ -548,7 +549,8 @@ export const serializeAws_restJson1CreateCoreDefinitionVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Cores !== undefined && { Cores: serializeAws_restJson1__listOfCore(input.Cores, context) }), + ...(input.Cores !== undefined && + input.Cores !== null && { Cores: serializeAws_restJson1__listOfCore(input.Cores, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -567,7 +569,7 @@ export const serializeAws_restJson1CreateDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/groups/{GroupId}/deployments"; @@ -582,9 +584,11 @@ export const serializeAws_restJson1CreateDeploymentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DeploymentId !== undefined && { DeploymentId: input.DeploymentId }), - ...(input.DeploymentType !== undefined && { DeploymentType: input.DeploymentType }), - ...(input.GroupVersionId !== undefined && { GroupVersionId: input.GroupVersionId }), + ...(input.DeploymentId !== undefined && input.DeploymentId !== null && { DeploymentId: input.DeploymentId }), + ...(input.DeploymentType !== undefined && + input.DeploymentType !== null && { DeploymentType: input.DeploymentType }), + ...(input.GroupVersionId !== undefined && + input.GroupVersionId !== null && { GroupVersionId: input.GroupVersionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -603,17 +607,18 @@ export const serializeAws_restJson1CreateDeviceDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/devices"; let body: any; body = JSON.stringify({ - ...(input.InitialVersion !== undefined && { - InitialVersion: serializeAws_restJson1DeviceDefinitionVersion(input.InitialVersion, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.InitialVersion !== undefined && + input.InitialVersion !== null && { + InitialVersion: serializeAws_restJson1DeviceDefinitionVersion(input.InitialVersion, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -632,7 +637,7 @@ export const serializeAws_restJson1CreateDeviceDefinitionVersionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/devices/{DeviceDefinitionId}/versions"; @@ -647,7 +652,8 @@ export const serializeAws_restJson1CreateDeviceDefinitionVersionCommand = async } let body: any; body = JSON.stringify({ - ...(input.Devices !== undefined && { Devices: serializeAws_restJson1__listOfDevice(input.Devices, context) }), + ...(input.Devices !== undefined && + input.Devices !== null && { Devices: serializeAws_restJson1__listOfDevice(input.Devices, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -666,17 +672,18 @@ export const serializeAws_restJson1CreateFunctionDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/functions"; let body: any; body = JSON.stringify({ - ...(input.InitialVersion !== undefined && { - InitialVersion: serializeAws_restJson1FunctionDefinitionVersion(input.InitialVersion, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.InitialVersion !== undefined && + input.InitialVersion !== null && { + InitialVersion: serializeAws_restJson1FunctionDefinitionVersion(input.InitialVersion, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -695,7 +702,7 @@ export const serializeAws_restJson1CreateFunctionDefinitionVersionCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/functions/{FunctionDefinitionId}/versions"; @@ -710,12 +717,12 @@ export const serializeAws_restJson1CreateFunctionDefinitionVersionCommand = asyn } let body: any; body = JSON.stringify({ - ...(input.DefaultConfig !== undefined && { - DefaultConfig: serializeAws_restJson1FunctionDefaultConfig(input.DefaultConfig, context), - }), - ...(input.Functions !== undefined && { - Functions: serializeAws_restJson1__listOfFunction(input.Functions, context), - }), + ...(input.DefaultConfig !== undefined && + input.DefaultConfig !== null && { + DefaultConfig: serializeAws_restJson1FunctionDefaultConfig(input.DefaultConfig, context), + }), + ...(input.Functions !== undefined && + input.Functions !== null && { Functions: serializeAws_restJson1__listOfFunction(input.Functions, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -734,17 +741,18 @@ export const serializeAws_restJson1CreateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/groups"; let body: any; body = JSON.stringify({ - ...(input.InitialVersion !== undefined && { - InitialVersion: serializeAws_restJson1GroupVersion(input.InitialVersion, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.InitialVersion !== undefined && + input.InitialVersion !== null && { + InitialVersion: serializeAws_restJson1GroupVersion(input.InitialVersion, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -763,7 +771,6 @@ export const serializeAws_restJson1CreateGroupCertificateAuthorityCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/groups/{GroupId}/certificateauthorities"; @@ -794,7 +801,7 @@ export const serializeAws_restJson1CreateGroupVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/groups/{GroupId}/versions"; @@ -809,25 +816,28 @@ export const serializeAws_restJson1CreateGroupVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConnectorDefinitionVersionArn !== undefined && { - ConnectorDefinitionVersionArn: input.ConnectorDefinitionVersionArn, - }), - ...(input.CoreDefinitionVersionArn !== undefined && { CoreDefinitionVersionArn: input.CoreDefinitionVersionArn }), - ...(input.DeviceDefinitionVersionArn !== undefined && { - DeviceDefinitionVersionArn: input.DeviceDefinitionVersionArn, - }), - ...(input.FunctionDefinitionVersionArn !== undefined && { - FunctionDefinitionVersionArn: input.FunctionDefinitionVersionArn, - }), - ...(input.LoggerDefinitionVersionArn !== undefined && { - LoggerDefinitionVersionArn: input.LoggerDefinitionVersionArn, - }), - ...(input.ResourceDefinitionVersionArn !== undefined && { - ResourceDefinitionVersionArn: input.ResourceDefinitionVersionArn, - }), - ...(input.SubscriptionDefinitionVersionArn !== undefined && { - SubscriptionDefinitionVersionArn: input.SubscriptionDefinitionVersionArn, - }), + ...(input.ConnectorDefinitionVersionArn !== undefined && + input.ConnectorDefinitionVersionArn !== null && { + ConnectorDefinitionVersionArn: input.ConnectorDefinitionVersionArn, + }), + ...(input.CoreDefinitionVersionArn !== undefined && + input.CoreDefinitionVersionArn !== null && { CoreDefinitionVersionArn: input.CoreDefinitionVersionArn }), + ...(input.DeviceDefinitionVersionArn !== undefined && + input.DeviceDefinitionVersionArn !== null && { DeviceDefinitionVersionArn: input.DeviceDefinitionVersionArn }), + ...(input.FunctionDefinitionVersionArn !== undefined && + input.FunctionDefinitionVersionArn !== null && { + FunctionDefinitionVersionArn: input.FunctionDefinitionVersionArn, + }), + ...(input.LoggerDefinitionVersionArn !== undefined && + input.LoggerDefinitionVersionArn !== null && { LoggerDefinitionVersionArn: input.LoggerDefinitionVersionArn }), + ...(input.ResourceDefinitionVersionArn !== undefined && + input.ResourceDefinitionVersionArn !== null && { + ResourceDefinitionVersionArn: input.ResourceDefinitionVersionArn, + }), + ...(input.SubscriptionDefinitionVersionArn !== undefined && + input.SubscriptionDefinitionVersionArn !== null && { + SubscriptionDefinitionVersionArn: input.SubscriptionDefinitionVersionArn, + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -846,17 +856,18 @@ export const serializeAws_restJson1CreateLoggerDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/loggers"; let body: any; body = JSON.stringify({ - ...(input.InitialVersion !== undefined && { - InitialVersion: serializeAws_restJson1LoggerDefinitionVersion(input.InitialVersion, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.InitialVersion !== undefined && + input.InitialVersion !== null && { + InitialVersion: serializeAws_restJson1LoggerDefinitionVersion(input.InitialVersion, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -875,7 +886,7 @@ export const serializeAws_restJson1CreateLoggerDefinitionVersionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/loggers/{LoggerDefinitionId}/versions"; @@ -890,7 +901,8 @@ export const serializeAws_restJson1CreateLoggerDefinitionVersionCommand = async } let body: any; body = JSON.stringify({ - ...(input.Loggers !== undefined && { Loggers: serializeAws_restJson1__listOfLogger(input.Loggers, context) }), + ...(input.Loggers !== undefined && + input.Loggers !== null && { Loggers: serializeAws_restJson1__listOfLogger(input.Loggers, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -909,17 +921,18 @@ export const serializeAws_restJson1CreateResourceDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/resources"; let body: any; body = JSON.stringify({ - ...(input.InitialVersion !== undefined && { - InitialVersion: serializeAws_restJson1ResourceDefinitionVersion(input.InitialVersion, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.InitialVersion !== undefined && + input.InitialVersion !== null && { + InitialVersion: serializeAws_restJson1ResourceDefinitionVersion(input.InitialVersion, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -938,7 +951,7 @@ export const serializeAws_restJson1CreateResourceDefinitionVersionCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/resources/{ResourceDefinitionId}/versions"; @@ -953,9 +966,8 @@ export const serializeAws_restJson1CreateResourceDefinitionVersionCommand = asyn } let body: any; body = JSON.stringify({ - ...(input.Resources !== undefined && { - Resources: serializeAws_restJson1__listOfResource(input.Resources, context), - }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_restJson1__listOfResource(input.Resources, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -974,24 +986,28 @@ export const serializeAws_restJson1CreateSoftwareUpdateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/updates"; let body: any; body = JSON.stringify({ - ...(input.S3UrlSignerRole !== undefined && { S3UrlSignerRole: input.S3UrlSignerRole }), - ...(input.SoftwareToUpdate !== undefined && { SoftwareToUpdate: input.SoftwareToUpdate }), - ...(input.UpdateAgentLogLevel !== undefined && { UpdateAgentLogLevel: input.UpdateAgentLogLevel }), - ...(input.UpdateTargets !== undefined && { - UpdateTargets: serializeAws_restJson1UpdateTargets(input.UpdateTargets, context), - }), - ...(input.UpdateTargetsArchitecture !== undefined && { - UpdateTargetsArchitecture: input.UpdateTargetsArchitecture, - }), - ...(input.UpdateTargetsOperatingSystem !== undefined && { - UpdateTargetsOperatingSystem: input.UpdateTargetsOperatingSystem, - }), + ...(input.S3UrlSignerRole !== undefined && + input.S3UrlSignerRole !== null && { S3UrlSignerRole: input.S3UrlSignerRole }), + ...(input.SoftwareToUpdate !== undefined && + input.SoftwareToUpdate !== null && { SoftwareToUpdate: input.SoftwareToUpdate }), + ...(input.UpdateAgentLogLevel !== undefined && + input.UpdateAgentLogLevel !== null && { UpdateAgentLogLevel: input.UpdateAgentLogLevel }), + ...(input.UpdateTargets !== undefined && + input.UpdateTargets !== null && { + UpdateTargets: serializeAws_restJson1UpdateTargets(input.UpdateTargets, context), + }), + ...(input.UpdateTargetsArchitecture !== undefined && + input.UpdateTargetsArchitecture !== null && { UpdateTargetsArchitecture: input.UpdateTargetsArchitecture }), + ...(input.UpdateTargetsOperatingSystem !== undefined && + input.UpdateTargetsOperatingSystem !== null && { + UpdateTargetsOperatingSystem: input.UpdateTargetsOperatingSystem, + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1010,17 +1026,18 @@ export const serializeAws_restJson1CreateSubscriptionDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/subscriptions"; let body: any; body = JSON.stringify({ - ...(input.InitialVersion !== undefined && { - InitialVersion: serializeAws_restJson1SubscriptionDefinitionVersion(input.InitialVersion, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.InitialVersion !== undefined && + input.InitialVersion !== null && { + InitialVersion: serializeAws_restJson1SubscriptionDefinitionVersion(input.InitialVersion, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1039,7 +1056,7 @@ export const serializeAws_restJson1CreateSubscriptionDefinitionVersionCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}/versions"; @@ -1054,9 +1071,10 @@ export const serializeAws_restJson1CreateSubscriptionDefinitionVersionCommand = } let body: any; body = JSON.stringify({ - ...(input.Subscriptions !== undefined && { - Subscriptions: serializeAws_restJson1__listOfSubscription(input.Subscriptions, context), - }), + ...(input.Subscriptions !== undefined && + input.Subscriptions !== null && { + Subscriptions: serializeAws_restJson1__listOfSubscription(input.Subscriptions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1074,9 +1092,7 @@ export const serializeAws_restJson1DeleteConnectorDefinitionCommand = async ( input: DeleteConnectorDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/connectors/{ConnectorDefinitionId}"; if (input.ConnectorDefinitionId !== undefined) { const labelValue: string = input.ConnectorDefinitionId; @@ -1104,9 +1120,7 @@ export const serializeAws_restJson1DeleteCoreDefinitionCommand = async ( input: DeleteCoreDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/cores/{CoreDefinitionId}"; if (input.CoreDefinitionId !== undefined) { const labelValue: string = input.CoreDefinitionId; @@ -1134,9 +1148,7 @@ export const serializeAws_restJson1DeleteDeviceDefinitionCommand = async ( input: DeleteDeviceDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/devices/{DeviceDefinitionId}"; if (input.DeviceDefinitionId !== undefined) { const labelValue: string = input.DeviceDefinitionId; @@ -1164,9 +1176,7 @@ export const serializeAws_restJson1DeleteFunctionDefinitionCommand = async ( input: DeleteFunctionDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/functions/{FunctionDefinitionId}"; if (input.FunctionDefinitionId !== undefined) { const labelValue: string = input.FunctionDefinitionId; @@ -1194,9 +1204,7 @@ export const serializeAws_restJson1DeleteGroupCommand = async ( input: DeleteGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -1224,9 +1232,7 @@ export const serializeAws_restJson1DeleteLoggerDefinitionCommand = async ( input: DeleteLoggerDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/loggers/{LoggerDefinitionId}"; if (input.LoggerDefinitionId !== undefined) { const labelValue: string = input.LoggerDefinitionId; @@ -1254,9 +1260,7 @@ export const serializeAws_restJson1DeleteResourceDefinitionCommand = async ( input: DeleteResourceDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/resources/{ResourceDefinitionId}"; if (input.ResourceDefinitionId !== undefined) { const labelValue: string = input.ResourceDefinitionId; @@ -1284,9 +1288,7 @@ export const serializeAws_restJson1DeleteSubscriptionDefinitionCommand = async ( input: DeleteSubscriptionDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}"; if (input.SubscriptionDefinitionId !== undefined) { const labelValue: string = input.SubscriptionDefinitionId; @@ -1314,9 +1316,7 @@ export const serializeAws_restJson1DisassociateRoleFromGroupCommand = async ( input: DisassociateRoleFromGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}/role"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -1344,12 +1344,10 @@ export const serializeAws_restJson1DisassociateServiceRoleFromAccountCommand = a input: DisassociateServiceRoleFromAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/servicerole"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1366,9 +1364,7 @@ export const serializeAws_restJson1GetAssociatedRoleCommand = async ( input: GetAssociatedRoleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}/role"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -1396,9 +1392,7 @@ export const serializeAws_restJson1GetBulkDeploymentStatusCommand = async ( input: GetBulkDeploymentStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/bulk/deployments/{BulkDeploymentId}/status"; if (input.BulkDeploymentId !== undefined) { const labelValue: string = input.BulkDeploymentId; @@ -1426,9 +1420,7 @@ export const serializeAws_restJson1GetConnectivityInfoCommand = async ( input: GetConnectivityInfoCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/things/{ThingName}/connectivityInfo"; if (input.ThingName !== undefined) { const labelValue: string = input.ThingName; @@ -1456,9 +1448,7 @@ export const serializeAws_restJson1GetConnectorDefinitionCommand = async ( input: GetConnectorDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/connectors/{ConnectorDefinitionId}"; if (input.ConnectorDefinitionId !== undefined) { const labelValue: string = input.ConnectorDefinitionId; @@ -1486,9 +1476,7 @@ export const serializeAws_restJson1GetConnectorDefinitionVersionCommand = async input: GetConnectorDefinitionVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/connectors/{ConnectorDefinitionId}/versions/{ConnectorDefinitionVersionId}"; if (input.ConnectorDefinitionVersionId !== undefined) { @@ -1530,9 +1518,7 @@ export const serializeAws_restJson1GetCoreDefinitionCommand = async ( input: GetCoreDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/cores/{CoreDefinitionId}"; if (input.CoreDefinitionId !== undefined) { const labelValue: string = input.CoreDefinitionId; @@ -1560,9 +1546,7 @@ export const serializeAws_restJson1GetCoreDefinitionVersionCommand = async ( input: GetCoreDefinitionVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/cores/{CoreDefinitionId}/versions/{CoreDefinitionVersionId}"; if (input.CoreDefinitionVersionId !== undefined) { const labelValue: string = input.CoreDefinitionVersionId; @@ -1599,9 +1583,7 @@ export const serializeAws_restJson1GetDeploymentStatusCommand = async ( input: GetDeploymentStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}/deployments/{DeploymentId}/status"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -1638,9 +1620,7 @@ export const serializeAws_restJson1GetDeviceDefinitionCommand = async ( input: GetDeviceDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/devices/{DeviceDefinitionId}"; if (input.DeviceDefinitionId !== undefined) { const labelValue: string = input.DeviceDefinitionId; @@ -1668,9 +1648,7 @@ export const serializeAws_restJson1GetDeviceDefinitionVersionCommand = async ( input: GetDeviceDefinitionVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/devices/{DeviceDefinitionId}/versions/{DeviceDefinitionVersionId}"; if (input.DeviceDefinitionId !== undefined) { const labelValue: string = input.DeviceDefinitionId; @@ -1711,9 +1689,7 @@ export const serializeAws_restJson1GetFunctionDefinitionCommand = async ( input: GetFunctionDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/functions/{FunctionDefinitionId}"; if (input.FunctionDefinitionId !== undefined) { const labelValue: string = input.FunctionDefinitionId; @@ -1741,9 +1717,7 @@ export const serializeAws_restJson1GetFunctionDefinitionVersionCommand = async ( input: GetFunctionDefinitionVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/functions/{FunctionDefinitionId}/versions/{FunctionDefinitionVersionId}"; if (input.FunctionDefinitionVersionId !== undefined) { const labelValue: string = input.FunctionDefinitionVersionId; @@ -1784,9 +1758,7 @@ export const serializeAws_restJson1GetGroupCommand = async ( input: GetGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -1814,9 +1786,7 @@ export const serializeAws_restJson1GetGroupCertificateAuthorityCommand = async ( input: GetGroupCertificateAuthorityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}/certificateauthorities/{CertificateAuthorityId}"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -1853,9 +1823,7 @@ export const serializeAws_restJson1GetGroupCertificateConfigurationCommand = asy input: GetGroupCertificateConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}/certificateauthorities/configuration/expiry"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -1883,9 +1851,7 @@ export const serializeAws_restJson1GetGroupVersionCommand = async ( input: GetGroupVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}/versions/{GroupVersionId}"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -1922,9 +1888,7 @@ export const serializeAws_restJson1GetLoggerDefinitionCommand = async ( input: GetLoggerDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/loggers/{LoggerDefinitionId}"; if (input.LoggerDefinitionId !== undefined) { const labelValue: string = input.LoggerDefinitionId; @@ -1952,9 +1916,7 @@ export const serializeAws_restJson1GetLoggerDefinitionVersionCommand = async ( input: GetLoggerDefinitionVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/loggers/{LoggerDefinitionId}/versions/{LoggerDefinitionVersionId}"; if (input.LoggerDefinitionVersionId !== undefined) { const labelValue: string = input.LoggerDefinitionVersionId; @@ -1995,9 +1957,7 @@ export const serializeAws_restJson1GetResourceDefinitionCommand = async ( input: GetResourceDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/resources/{ResourceDefinitionId}"; if (input.ResourceDefinitionId !== undefined) { const labelValue: string = input.ResourceDefinitionId; @@ -2025,9 +1985,7 @@ export const serializeAws_restJson1GetResourceDefinitionVersionCommand = async ( input: GetResourceDefinitionVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/resources/{ResourceDefinitionId}/versions/{ResourceDefinitionVersionId}"; if (input.ResourceDefinitionVersionId !== undefined) { const labelValue: string = input.ResourceDefinitionVersionId; @@ -2064,12 +2022,10 @@ export const serializeAws_restJson1GetServiceRoleForAccountCommand = async ( input: GetServiceRoleForAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/servicerole"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -2086,9 +2042,7 @@ export const serializeAws_restJson1GetSubscriptionDefinitionCommand = async ( input: GetSubscriptionDefinitionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}"; if (input.SubscriptionDefinitionId !== undefined) { const labelValue: string = input.SubscriptionDefinitionId; @@ -2116,9 +2070,7 @@ export const serializeAws_restJson1GetSubscriptionDefinitionVersionCommand = asy input: GetSubscriptionDefinitionVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}/versions/{SubscriptionDefinitionVersionId}"; if (input.SubscriptionDefinitionId !== undefined) { @@ -2160,9 +2112,7 @@ export const serializeAws_restJson1GetThingRuntimeConfigurationCommand = async ( input: GetThingRuntimeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/things/{ThingName}/runtimeconfig"; if (input.ThingName !== undefined) { const labelValue: string = input.ThingName; @@ -2190,9 +2140,7 @@ export const serializeAws_restJson1ListBulkDeploymentDetailedReportsCommand = as input: ListBulkDeploymentDetailedReportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/bulk/deployments/{BulkDeploymentId}/detailed-reports"; if (input.BulkDeploymentId !== undefined) { const labelValue: string = input.BulkDeploymentId; @@ -2225,9 +2173,7 @@ export const serializeAws_restJson1ListBulkDeploymentsCommand = async ( input: ListBulkDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/bulk/deployments"; const query: any = { ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), @@ -2251,9 +2197,7 @@ export const serializeAws_restJson1ListConnectorDefinitionsCommand = async ( input: ListConnectorDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/connectors"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -2277,9 +2221,7 @@ export const serializeAws_restJson1ListConnectorDefinitionVersionsCommand = asyn input: ListConnectorDefinitionVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/connectors/{ConnectorDefinitionId}/versions"; if (input.ConnectorDefinitionId !== undefined) { const labelValue: string = input.ConnectorDefinitionId; @@ -2312,9 +2254,7 @@ export const serializeAws_restJson1ListCoreDefinitionsCommand = async ( input: ListCoreDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/cores"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -2338,9 +2278,7 @@ export const serializeAws_restJson1ListCoreDefinitionVersionsCommand = async ( input: ListCoreDefinitionVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/cores/{CoreDefinitionId}/versions"; if (input.CoreDefinitionId !== undefined) { const labelValue: string = input.CoreDefinitionId; @@ -2373,9 +2311,7 @@ export const serializeAws_restJson1ListDeploymentsCommand = async ( input: ListDeploymentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}/deployments"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -2408,9 +2344,7 @@ export const serializeAws_restJson1ListDeviceDefinitionsCommand = async ( input: ListDeviceDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/devices"; const query: any = { ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), @@ -2434,9 +2368,7 @@ export const serializeAws_restJson1ListDeviceDefinitionVersionsCommand = async ( input: ListDeviceDefinitionVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/devices/{DeviceDefinitionId}/versions"; if (input.DeviceDefinitionId !== undefined) { const labelValue: string = input.DeviceDefinitionId; @@ -2469,9 +2401,7 @@ export const serializeAws_restJson1ListFunctionDefinitionsCommand = async ( input: ListFunctionDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/functions"; const query: any = { ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), @@ -2495,9 +2425,7 @@ export const serializeAws_restJson1ListFunctionDefinitionVersionsCommand = async input: ListFunctionDefinitionVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/functions/{FunctionDefinitionId}/versions"; if (input.FunctionDefinitionId !== undefined) { const labelValue: string = input.FunctionDefinitionId; @@ -2530,9 +2458,7 @@ export const serializeAws_restJson1ListGroupCertificateAuthoritiesCommand = asyn input: ListGroupCertificateAuthoritiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}/certificateauthorities"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -2560,9 +2486,7 @@ export const serializeAws_restJson1ListGroupsCommand = async ( input: ListGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -2586,9 +2510,7 @@ export const serializeAws_restJson1ListGroupVersionsCommand = async ( input: ListGroupVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/groups/{GroupId}/versions"; if (input.GroupId !== undefined) { const labelValue: string = input.GroupId; @@ -2621,9 +2543,7 @@ export const serializeAws_restJson1ListLoggerDefinitionsCommand = async ( input: ListLoggerDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/loggers"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -2647,9 +2567,7 @@ export const serializeAws_restJson1ListLoggerDefinitionVersionsCommand = async ( input: ListLoggerDefinitionVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/loggers/{LoggerDefinitionId}/versions"; if (input.LoggerDefinitionId !== undefined) { const labelValue: string = input.LoggerDefinitionId; @@ -2682,9 +2600,7 @@ export const serializeAws_restJson1ListResourceDefinitionsCommand = async ( input: ListResourceDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/resources"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -2708,9 +2624,7 @@ export const serializeAws_restJson1ListResourceDefinitionVersionsCommand = async input: ListResourceDefinitionVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/resources/{ResourceDefinitionId}/versions"; if (input.ResourceDefinitionId !== undefined) { const labelValue: string = input.ResourceDefinitionId; @@ -2743,9 +2657,7 @@ export const serializeAws_restJson1ListSubscriptionDefinitionsCommand = async ( input: ListSubscriptionDefinitionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/subscriptions"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -2769,9 +2681,7 @@ export const serializeAws_restJson1ListSubscriptionDefinitionVersionsCommand = a input: ListSubscriptionDefinitionVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}/versions"; if (input.SubscriptionDefinitionId !== undefined) { const labelValue: string = input.SubscriptionDefinitionId; @@ -2804,9 +2714,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -2835,7 +2743,7 @@ export const serializeAws_restJson1ResetDeploymentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/groups/{GroupId}/deployments/$reset"; @@ -2850,7 +2758,7 @@ export const serializeAws_restJson1ResetDeploymentsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Force !== undefined && { Force: input.Force }), + ...(input.Force !== undefined && input.Force !== null && { Force: input.Force }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2869,15 +2777,16 @@ export const serializeAws_restJson1StartBulkDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AmznClientToken) && { "X-Amzn-Client-Token": input.AmznClientToken! }), }; let resolvedPath = "/greengrass/bulk/deployments"; let body: any; body = JSON.stringify({ - ...(input.ExecutionRoleArn !== undefined && { ExecutionRoleArn: input.ExecutionRoleArn }), - ...(input.InputFileUri !== undefined && { InputFileUri: input.InputFileUri }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.ExecutionRoleArn !== undefined && + input.ExecutionRoleArn !== null && { ExecutionRoleArn: input.ExecutionRoleArn }), + ...(input.InputFileUri !== undefined && input.InputFileUri !== null && { InputFileUri: input.InputFileUri }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2895,9 +2804,7 @@ export const serializeAws_restJson1StopBulkDeploymentCommand = async ( input: StopBulkDeploymentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/greengrass/bulk/deployments/{BulkDeploymentId}/$stop"; if (input.BulkDeploymentId !== undefined) { const labelValue: string = input.BulkDeploymentId; @@ -2926,7 +2833,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -2940,7 +2847,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2958,9 +2865,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -2993,7 +2898,7 @@ export const serializeAws_restJson1UpdateConnectivityInfoCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/things/{ThingName}/connectivityInfo"; if (input.ThingName !== undefined) { @@ -3007,9 +2912,10 @@ export const serializeAws_restJson1UpdateConnectivityInfoCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConnectivityInfo !== undefined && { - ConnectivityInfo: serializeAws_restJson1__listOfConnectivityInfo(input.ConnectivityInfo, context), - }), + ...(input.ConnectivityInfo !== undefined && + input.ConnectivityInfo !== null && { + ConnectivityInfo: serializeAws_restJson1__listOfConnectivityInfo(input.ConnectivityInfo, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3028,7 +2934,7 @@ export const serializeAws_restJson1UpdateConnectorDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/definition/connectors/{ConnectorDefinitionId}"; if (input.ConnectorDefinitionId !== undefined) { @@ -3042,7 +2948,7 @@ export const serializeAws_restJson1UpdateConnectorDefinitionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3061,7 +2967,7 @@ export const serializeAws_restJson1UpdateCoreDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/definition/cores/{CoreDefinitionId}"; if (input.CoreDefinitionId !== undefined) { @@ -3075,7 +2981,7 @@ export const serializeAws_restJson1UpdateCoreDefinitionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3094,7 +3000,7 @@ export const serializeAws_restJson1UpdateDeviceDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/definition/devices/{DeviceDefinitionId}"; if (input.DeviceDefinitionId !== undefined) { @@ -3108,7 +3014,7 @@ export const serializeAws_restJson1UpdateDeviceDefinitionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3127,7 +3033,7 @@ export const serializeAws_restJson1UpdateFunctionDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/definition/functions/{FunctionDefinitionId}"; if (input.FunctionDefinitionId !== undefined) { @@ -3141,7 +3047,7 @@ export const serializeAws_restJson1UpdateFunctionDefinitionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3160,7 +3066,7 @@ export const serializeAws_restJson1UpdateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/groups/{GroupId}"; if (input.GroupId !== undefined) { @@ -3174,7 +3080,7 @@ export const serializeAws_restJson1UpdateGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3193,7 +3099,7 @@ export const serializeAws_restJson1UpdateGroupCertificateConfigurationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/groups/{GroupId}/certificateauthorities/configuration/expiry"; if (input.GroupId !== undefined) { @@ -3207,9 +3113,10 @@ export const serializeAws_restJson1UpdateGroupCertificateConfigurationCommand = } let body: any; body = JSON.stringify({ - ...(input.CertificateExpiryInMilliseconds !== undefined && { - CertificateExpiryInMilliseconds: input.CertificateExpiryInMilliseconds, - }), + ...(input.CertificateExpiryInMilliseconds !== undefined && + input.CertificateExpiryInMilliseconds !== null && { + CertificateExpiryInMilliseconds: input.CertificateExpiryInMilliseconds, + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3228,7 +3135,7 @@ export const serializeAws_restJson1UpdateLoggerDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/definition/loggers/{LoggerDefinitionId}"; if (input.LoggerDefinitionId !== undefined) { @@ -3242,7 +3149,7 @@ export const serializeAws_restJson1UpdateLoggerDefinitionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3261,7 +3168,7 @@ export const serializeAws_restJson1UpdateResourceDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/definition/resources/{ResourceDefinitionId}"; if (input.ResourceDefinitionId !== undefined) { @@ -3275,7 +3182,7 @@ export const serializeAws_restJson1UpdateResourceDefinitionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3294,7 +3201,7 @@ export const serializeAws_restJson1UpdateSubscriptionDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}"; if (input.SubscriptionDefinitionId !== undefined) { @@ -3308,7 +3215,7 @@ export const serializeAws_restJson1UpdateSubscriptionDefinitionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3327,7 +3234,7 @@ export const serializeAws_restJson1UpdateThingRuntimeConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/greengrass/things/{ThingName}/runtimeconfig"; if (input.ThingName !== undefined) { @@ -3341,9 +3248,13 @@ export const serializeAws_restJson1UpdateThingRuntimeConfigurationCommand = asyn } let body: any; body = JSON.stringify({ - ...(input.TelemetryConfiguration !== undefined && { - TelemetryConfiguration: serializeAws_restJson1TelemetryConfigurationUpdate(input.TelemetryConfiguration, context), - }), + ...(input.TelemetryConfiguration !== undefined && + input.TelemetryConfiguration !== null && { + TelemetryConfiguration: serializeAws_restJson1TelemetryConfigurationUpdate( + input.TelemetryConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -9269,74 +9180,145 @@ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async ( }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfConnectivityInfo = (input: ConnectivityInfo[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ConnectivityInfo(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ConnectivityInfo(entry, context); + }); }; const serializeAws_restJson1__listOfConnector = (input: Connector[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Connector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Connector(entry, context); + }); }; const serializeAws_restJson1__listOfCore = (input: Core[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Core(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Core(entry, context); + }); }; const serializeAws_restJson1__listOfDevice = (input: Device[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Device(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Device(entry, context); + }); }; const serializeAws_restJson1__listOfFunction = (input: Function[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Function(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Function(entry, context); + }); }; const serializeAws_restJson1__listOfLogger = (input: Logger[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Logger(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Logger(entry, context); + }); }; const serializeAws_restJson1__listOfResource = (input: Resource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Resource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Resource(entry, context); + }); }; const serializeAws_restJson1__listOfResourceAccessPolicy = ( input: ResourceAccessPolicy[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ResourceAccessPolicy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ResourceAccessPolicy(entry, context); + }); }; const serializeAws_restJson1__listOfSubscription = (input: Subscription[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Subscription(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Subscription(entry, context); + }); }; const serializeAws_restJson1__mapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ConnectivityInfo = (input: ConnectivityInfo, context: __SerdeContext): any => { return { - ...(input.HostAddress !== undefined && { HostAddress: input.HostAddress }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Metadata !== undefined && { Metadata: input.Metadata }), - ...(input.PortNumber !== undefined && { PortNumber: input.PortNumber }), + ...(input.HostAddress !== undefined && input.HostAddress !== null && { HostAddress: input.HostAddress }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Metadata !== undefined && input.Metadata !== null && { Metadata: input.Metadata }), + ...(input.PortNumber !== undefined && input.PortNumber !== null && { PortNumber: input.PortNumber }), }; }; const serializeAws_restJson1Connector = (input: Connector, context: __SerdeContext): any => { return { - ...(input.ConnectorArn !== undefined && { ConnectorArn: input.ConnectorArn }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_restJson1__mapOf__string(input.Parameters, context), - }), + ...(input.ConnectorArn !== undefined && input.ConnectorArn !== null && { ConnectorArn: input.ConnectorArn }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_restJson1__mapOf__string(input.Parameters, context) }), }; }; @@ -9345,33 +9327,35 @@ const serializeAws_restJson1ConnectorDefinitionVersion = ( context: __SerdeContext ): any => { return { - ...(input.Connectors !== undefined && { - Connectors: serializeAws_restJson1__listOfConnector(input.Connectors, context), - }), + ...(input.Connectors !== undefined && + input.Connectors !== null && { Connectors: serializeAws_restJson1__listOfConnector(input.Connectors, context) }), }; }; const serializeAws_restJson1Core = (input: Core, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.SyncShadow !== undefined && { SyncShadow: input.SyncShadow }), - ...(input.ThingArn !== undefined && { ThingArn: input.ThingArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.SyncShadow !== undefined && input.SyncShadow !== null && { SyncShadow: input.SyncShadow }), + ...(input.ThingArn !== undefined && input.ThingArn !== null && { ThingArn: input.ThingArn }), }; }; const serializeAws_restJson1CoreDefinitionVersion = (input: CoreDefinitionVersion, context: __SerdeContext): any => { return { - ...(input.Cores !== undefined && { Cores: serializeAws_restJson1__listOfCore(input.Cores, context) }), + ...(input.Cores !== undefined && + input.Cores !== null && { Cores: serializeAws_restJson1__listOfCore(input.Cores, context) }), }; }; const serializeAws_restJson1Device = (input: Device, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { CertificateArn: input.CertificateArn }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.SyncShadow !== undefined && { SyncShadow: input.SyncShadow }), - ...(input.ThingArn !== undefined && { ThingArn: input.ThingArn }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { CertificateArn: input.CertificateArn }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.SyncShadow !== undefined && input.SyncShadow !== null && { SyncShadow: input.SyncShadow }), + ...(input.ThingArn !== undefined && input.ThingArn !== null && { ThingArn: input.ThingArn }), }; }; @@ -9380,31 +9364,34 @@ const serializeAws_restJson1DeviceDefinitionVersion = ( context: __SerdeContext ): any => { return { - ...(input.Devices !== undefined && { Devices: serializeAws_restJson1__listOfDevice(input.Devices, context) }), + ...(input.Devices !== undefined && + input.Devices !== null && { Devices: serializeAws_restJson1__listOfDevice(input.Devices, context) }), }; }; const serializeAws_restJson1Function = (input: Function, context: __SerdeContext): any => { return { - ...(input.FunctionArn !== undefined && { FunctionArn: input.FunctionArn }), - ...(input.FunctionConfiguration !== undefined && { - FunctionConfiguration: serializeAws_restJson1FunctionConfiguration(input.FunctionConfiguration, context), - }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.FunctionArn !== undefined && input.FunctionArn !== null && { FunctionArn: input.FunctionArn }), + ...(input.FunctionConfiguration !== undefined && + input.FunctionConfiguration !== null && { + FunctionConfiguration: serializeAws_restJson1FunctionConfiguration(input.FunctionConfiguration, context), + }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_restJson1FunctionConfiguration = (input: FunctionConfiguration, context: __SerdeContext): any => { return { - ...(input.EncodingType !== undefined && { EncodingType: input.EncodingType }), - ...(input.Environment !== undefined && { - Environment: serializeAws_restJson1FunctionConfigurationEnvironment(input.Environment, context), - }), - ...(input.ExecArgs !== undefined && { ExecArgs: input.ExecArgs }), - ...(input.Executable !== undefined && { Executable: input.Executable }), - ...(input.MemorySize !== undefined && { MemorySize: input.MemorySize }), - ...(input.Pinned !== undefined && { Pinned: input.Pinned }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), + ...(input.EncodingType !== undefined && input.EncodingType !== null && { EncodingType: input.EncodingType }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_restJson1FunctionConfigurationEnvironment(input.Environment, context), + }), + ...(input.ExecArgs !== undefined && input.ExecArgs !== null && { ExecArgs: input.ExecArgs }), + ...(input.Executable !== undefined && input.Executable !== null && { Executable: input.Executable }), + ...(input.MemorySize !== undefined && input.MemorySize !== null && { MemorySize: input.MemorySize }), + ...(input.Pinned !== undefined && input.Pinned !== null && { Pinned: input.Pinned }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), }; }; @@ -9413,24 +9400,29 @@ const serializeAws_restJson1FunctionConfigurationEnvironment = ( context: __SerdeContext ): any => { return { - ...(input.AccessSysfs !== undefined && { AccessSysfs: input.AccessSysfs }), - ...(input.Execution !== undefined && { - Execution: serializeAws_restJson1FunctionExecutionConfig(input.Execution, context), - }), - ...(input.ResourceAccessPolicies !== undefined && { - ResourceAccessPolicies: serializeAws_restJson1__listOfResourceAccessPolicy(input.ResourceAccessPolicies, context), - }), - ...(input.Variables !== undefined && { - Variables: serializeAws_restJson1__mapOf__string(input.Variables, context), - }), + ...(input.AccessSysfs !== undefined && input.AccessSysfs !== null && { AccessSysfs: input.AccessSysfs }), + ...(input.Execution !== undefined && + input.Execution !== null && { + Execution: serializeAws_restJson1FunctionExecutionConfig(input.Execution, context), + }), + ...(input.ResourceAccessPolicies !== undefined && + input.ResourceAccessPolicies !== null && { + ResourceAccessPolicies: serializeAws_restJson1__listOfResourceAccessPolicy( + input.ResourceAccessPolicies, + context + ), + }), + ...(input.Variables !== undefined && + input.Variables !== null && { Variables: serializeAws_restJson1__mapOf__string(input.Variables, context) }), }; }; const serializeAws_restJson1FunctionDefaultConfig = (input: FunctionDefaultConfig, context: __SerdeContext): any => { return { - ...(input.Execution !== undefined && { - Execution: serializeAws_restJson1FunctionDefaultExecutionConfig(input.Execution, context), - }), + ...(input.Execution !== undefined && + input.Execution !== null && { + Execution: serializeAws_restJson1FunctionDefaultExecutionConfig(input.Execution, context), + }), }; }; @@ -9439,8 +9431,9 @@ const serializeAws_restJson1FunctionDefaultExecutionConfig = ( context: __SerdeContext ): any => { return { - ...(input.IsolationMode !== undefined && { IsolationMode: input.IsolationMode }), - ...(input.RunAs !== undefined && { RunAs: serializeAws_restJson1FunctionRunAsConfig(input.RunAs, context) }), + ...(input.IsolationMode !== undefined && input.IsolationMode !== null && { IsolationMode: input.IsolationMode }), + ...(input.RunAs !== undefined && + input.RunAs !== null && { RunAs: serializeAws_restJson1FunctionRunAsConfig(input.RunAs, context) }), }; }; @@ -9449,12 +9442,12 @@ const serializeAws_restJson1FunctionDefinitionVersion = ( context: __SerdeContext ): any => { return { - ...(input.DefaultConfig !== undefined && { - DefaultConfig: serializeAws_restJson1FunctionDefaultConfig(input.DefaultConfig, context), - }), - ...(input.Functions !== undefined && { - Functions: serializeAws_restJson1__listOfFunction(input.Functions, context), - }), + ...(input.DefaultConfig !== undefined && + input.DefaultConfig !== null && { + DefaultConfig: serializeAws_restJson1FunctionDefaultConfig(input.DefaultConfig, context), + }), + ...(input.Functions !== undefined && + input.Functions !== null && { Functions: serializeAws_restJson1__listOfFunction(input.Functions, context) }), }; }; @@ -9463,46 +9456,51 @@ const serializeAws_restJson1FunctionExecutionConfig = ( context: __SerdeContext ): any => { return { - ...(input.IsolationMode !== undefined && { IsolationMode: input.IsolationMode }), - ...(input.RunAs !== undefined && { RunAs: serializeAws_restJson1FunctionRunAsConfig(input.RunAs, context) }), + ...(input.IsolationMode !== undefined && input.IsolationMode !== null && { IsolationMode: input.IsolationMode }), + ...(input.RunAs !== undefined && + input.RunAs !== null && { RunAs: serializeAws_restJson1FunctionRunAsConfig(input.RunAs, context) }), }; }; const serializeAws_restJson1FunctionRunAsConfig = (input: FunctionRunAsConfig, context: __SerdeContext): any => { return { - ...(input.Gid !== undefined && { Gid: input.Gid }), - ...(input.Uid !== undefined && { Uid: input.Uid }), + ...(input.Gid !== undefined && input.Gid !== null && { Gid: input.Gid }), + ...(input.Uid !== undefined && input.Uid !== null && { Uid: input.Uid }), }; }; const serializeAws_restJson1GroupOwnerSetting = (input: GroupOwnerSetting, context: __SerdeContext): any => { return { - ...(input.AutoAddGroupOwner !== undefined && { AutoAddGroupOwner: input.AutoAddGroupOwner }), - ...(input.GroupOwner !== undefined && { GroupOwner: input.GroupOwner }), + ...(input.AutoAddGroupOwner !== undefined && + input.AutoAddGroupOwner !== null && { AutoAddGroupOwner: input.AutoAddGroupOwner }), + ...(input.GroupOwner !== undefined && input.GroupOwner !== null && { GroupOwner: input.GroupOwner }), }; }; const serializeAws_restJson1GroupVersion = (input: GroupVersion, context: __SerdeContext): any => { return { - ...(input.ConnectorDefinitionVersionArn !== undefined && { - ConnectorDefinitionVersionArn: input.ConnectorDefinitionVersionArn, - }), - ...(input.CoreDefinitionVersionArn !== undefined && { CoreDefinitionVersionArn: input.CoreDefinitionVersionArn }), - ...(input.DeviceDefinitionVersionArn !== undefined && { - DeviceDefinitionVersionArn: input.DeviceDefinitionVersionArn, - }), - ...(input.FunctionDefinitionVersionArn !== undefined && { - FunctionDefinitionVersionArn: input.FunctionDefinitionVersionArn, - }), - ...(input.LoggerDefinitionVersionArn !== undefined && { - LoggerDefinitionVersionArn: input.LoggerDefinitionVersionArn, - }), - ...(input.ResourceDefinitionVersionArn !== undefined && { - ResourceDefinitionVersionArn: input.ResourceDefinitionVersionArn, - }), - ...(input.SubscriptionDefinitionVersionArn !== undefined && { - SubscriptionDefinitionVersionArn: input.SubscriptionDefinitionVersionArn, - }), + ...(input.ConnectorDefinitionVersionArn !== undefined && + input.ConnectorDefinitionVersionArn !== null && { + ConnectorDefinitionVersionArn: input.ConnectorDefinitionVersionArn, + }), + ...(input.CoreDefinitionVersionArn !== undefined && + input.CoreDefinitionVersionArn !== null && { CoreDefinitionVersionArn: input.CoreDefinitionVersionArn }), + ...(input.DeviceDefinitionVersionArn !== undefined && + input.DeviceDefinitionVersionArn !== null && { DeviceDefinitionVersionArn: input.DeviceDefinitionVersionArn }), + ...(input.FunctionDefinitionVersionArn !== undefined && + input.FunctionDefinitionVersionArn !== null && { + FunctionDefinitionVersionArn: input.FunctionDefinitionVersionArn, + }), + ...(input.LoggerDefinitionVersionArn !== undefined && + input.LoggerDefinitionVersionArn !== null && { LoggerDefinitionVersionArn: input.LoggerDefinitionVersionArn }), + ...(input.ResourceDefinitionVersionArn !== undefined && + input.ResourceDefinitionVersionArn !== null && { + ResourceDefinitionVersionArn: input.ResourceDefinitionVersionArn, + }), + ...(input.SubscriptionDefinitionVersionArn !== undefined && + input.SubscriptionDefinitionVersionArn !== null && { + SubscriptionDefinitionVersionArn: input.SubscriptionDefinitionVersionArn, + }), }; }; @@ -9511,10 +9509,11 @@ const serializeAws_restJson1LocalDeviceResourceData = ( context: __SerdeContext ): any => { return { - ...(input.GroupOwnerSetting !== undefined && { - GroupOwnerSetting: serializeAws_restJson1GroupOwnerSetting(input.GroupOwnerSetting, context), - }), - ...(input.SourcePath !== undefined && { SourcePath: input.SourcePath }), + ...(input.GroupOwnerSetting !== undefined && + input.GroupOwnerSetting !== null && { + GroupOwnerSetting: serializeAws_restJson1GroupOwnerSetting(input.GroupOwnerSetting, context), + }), + ...(input.SourcePath !== undefined && input.SourcePath !== null && { SourcePath: input.SourcePath }), }; }; @@ -9523,21 +9522,23 @@ const serializeAws_restJson1LocalVolumeResourceData = ( context: __SerdeContext ): any => { return { - ...(input.DestinationPath !== undefined && { DestinationPath: input.DestinationPath }), - ...(input.GroupOwnerSetting !== undefined && { - GroupOwnerSetting: serializeAws_restJson1GroupOwnerSetting(input.GroupOwnerSetting, context), - }), - ...(input.SourcePath !== undefined && { SourcePath: input.SourcePath }), + ...(input.DestinationPath !== undefined && + input.DestinationPath !== null && { DestinationPath: input.DestinationPath }), + ...(input.GroupOwnerSetting !== undefined && + input.GroupOwnerSetting !== null && { + GroupOwnerSetting: serializeAws_restJson1GroupOwnerSetting(input.GroupOwnerSetting, context), + }), + ...(input.SourcePath !== undefined && input.SourcePath !== null && { SourcePath: input.SourcePath }), }; }; const serializeAws_restJson1Logger = (input: Logger, context: __SerdeContext): any => { return { - ...(input.Component !== undefined && { Component: input.Component }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Level !== undefined && { Level: input.Level }), - ...(input.Space !== undefined && { Space: input.Space }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Component !== undefined && input.Component !== null && { Component: input.Component }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Level !== undefined && input.Level !== null && { Level: input.Level }), + ...(input.Space !== undefined && input.Space !== null && { Space: input.Space }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -9546,53 +9547,60 @@ const serializeAws_restJson1LoggerDefinitionVersion = ( context: __SerdeContext ): any => { return { - ...(input.Loggers !== undefined && { Loggers: serializeAws_restJson1__listOfLogger(input.Loggers, context) }), + ...(input.Loggers !== undefined && + input.Loggers !== null && { Loggers: serializeAws_restJson1__listOfLogger(input.Loggers, context) }), }; }; const serializeAws_restJson1Resource = (input: Resource, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ResourceDataContainer !== undefined && { - ResourceDataContainer: serializeAws_restJson1ResourceDataContainer(input.ResourceDataContainer, context), - }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ResourceDataContainer !== undefined && + input.ResourceDataContainer !== null && { + ResourceDataContainer: serializeAws_restJson1ResourceDataContainer(input.ResourceDataContainer, context), + }), }; }; const serializeAws_restJson1ResourceAccessPolicy = (input: ResourceAccessPolicy, context: __SerdeContext): any => { return { - ...(input.Permission !== undefined && { Permission: input.Permission }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.Permission !== undefined && input.Permission !== null && { Permission: input.Permission }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; const serializeAws_restJson1ResourceDataContainer = (input: ResourceDataContainer, context: __SerdeContext): any => { return { - ...(input.LocalDeviceResourceData !== undefined && { - LocalDeviceResourceData: serializeAws_restJson1LocalDeviceResourceData(input.LocalDeviceResourceData, context), - }), - ...(input.LocalVolumeResourceData !== undefined && { - LocalVolumeResourceData: serializeAws_restJson1LocalVolumeResourceData(input.LocalVolumeResourceData, context), - }), - ...(input.S3MachineLearningModelResourceData !== undefined && { - S3MachineLearningModelResourceData: serializeAws_restJson1S3MachineLearningModelResourceData( - input.S3MachineLearningModelResourceData, - context - ), - }), - ...(input.SageMakerMachineLearningModelResourceData !== undefined && { - SageMakerMachineLearningModelResourceData: serializeAws_restJson1SageMakerMachineLearningModelResourceData( - input.SageMakerMachineLearningModelResourceData, - context - ), - }), - ...(input.SecretsManagerSecretResourceData !== undefined && { - SecretsManagerSecretResourceData: serializeAws_restJson1SecretsManagerSecretResourceData( - input.SecretsManagerSecretResourceData, - context - ), - }), + ...(input.LocalDeviceResourceData !== undefined && + input.LocalDeviceResourceData !== null && { + LocalDeviceResourceData: serializeAws_restJson1LocalDeviceResourceData(input.LocalDeviceResourceData, context), + }), + ...(input.LocalVolumeResourceData !== undefined && + input.LocalVolumeResourceData !== null && { + LocalVolumeResourceData: serializeAws_restJson1LocalVolumeResourceData(input.LocalVolumeResourceData, context), + }), + ...(input.S3MachineLearningModelResourceData !== undefined && + input.S3MachineLearningModelResourceData !== null && { + S3MachineLearningModelResourceData: serializeAws_restJson1S3MachineLearningModelResourceData( + input.S3MachineLearningModelResourceData, + context + ), + }), + ...(input.SageMakerMachineLearningModelResourceData !== undefined && + input.SageMakerMachineLearningModelResourceData !== null && { + SageMakerMachineLearningModelResourceData: serializeAws_restJson1SageMakerMachineLearningModelResourceData( + input.SageMakerMachineLearningModelResourceData, + context + ), + }), + ...(input.SecretsManagerSecretResourceData !== undefined && + input.SecretsManagerSecretResourceData !== null && { + SecretsManagerSecretResourceData: serializeAws_restJson1SecretsManagerSecretResourceData( + input.SecretsManagerSecretResourceData, + context + ), + }), }; }; @@ -9601,9 +9609,8 @@ const serializeAws_restJson1ResourceDefinitionVersion = ( context: __SerdeContext ): any => { return { - ...(input.Resources !== undefined && { - Resources: serializeAws_restJson1__listOfResource(input.Resources, context), - }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_restJson1__listOfResource(input.Resources, context) }), }; }; @@ -9612,8 +9619,9 @@ const serializeAws_restJson1ResourceDownloadOwnerSetting = ( context: __SerdeContext ): any => { return { - ...(input.GroupOwner !== undefined && { GroupOwner: input.GroupOwner }), - ...(input.GroupPermission !== undefined && { GroupPermission: input.GroupPermission }), + ...(input.GroupOwner !== undefined && input.GroupOwner !== null && { GroupOwner: input.GroupOwner }), + ...(input.GroupPermission !== undefined && + input.GroupPermission !== null && { GroupPermission: input.GroupPermission }), }; }; @@ -9622,11 +9630,13 @@ const serializeAws_restJson1S3MachineLearningModelResourceData = ( context: __SerdeContext ): any => { return { - ...(input.DestinationPath !== undefined && { DestinationPath: input.DestinationPath }), - ...(input.OwnerSetting !== undefined && { - OwnerSetting: serializeAws_restJson1ResourceDownloadOwnerSetting(input.OwnerSetting, context), - }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.DestinationPath !== undefined && + input.DestinationPath !== null && { DestinationPath: input.DestinationPath }), + ...(input.OwnerSetting !== undefined && + input.OwnerSetting !== null && { + OwnerSetting: serializeAws_restJson1ResourceDownloadOwnerSetting(input.OwnerSetting, context), + }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -9635,11 +9645,14 @@ const serializeAws_restJson1SageMakerMachineLearningModelResourceData = ( context: __SerdeContext ): any => { return { - ...(input.DestinationPath !== undefined && { DestinationPath: input.DestinationPath }), - ...(input.OwnerSetting !== undefined && { - OwnerSetting: serializeAws_restJson1ResourceDownloadOwnerSetting(input.OwnerSetting, context), - }), - ...(input.SageMakerJobArn !== undefined && { SageMakerJobArn: input.SageMakerJobArn }), + ...(input.DestinationPath !== undefined && + input.DestinationPath !== null && { DestinationPath: input.DestinationPath }), + ...(input.OwnerSetting !== undefined && + input.OwnerSetting !== null && { + OwnerSetting: serializeAws_restJson1ResourceDownloadOwnerSetting(input.OwnerSetting, context), + }), + ...(input.SageMakerJobArn !== undefined && + input.SageMakerJobArn !== null && { SageMakerJobArn: input.SageMakerJobArn }), }; }; @@ -9648,22 +9661,23 @@ const serializeAws_restJson1SecretsManagerSecretResourceData = ( context: __SerdeContext ): any => { return { - ...(input.ARN !== undefined && { ARN: input.ARN }), - ...(input.AdditionalStagingLabelsToDownload !== undefined && { - AdditionalStagingLabelsToDownload: serializeAws_restJson1__listOf__string( - input.AdditionalStagingLabelsToDownload, - context - ), - }), + ...(input.ARN !== undefined && input.ARN !== null && { ARN: input.ARN }), + ...(input.AdditionalStagingLabelsToDownload !== undefined && + input.AdditionalStagingLabelsToDownload !== null && { + AdditionalStagingLabelsToDownload: serializeAws_restJson1__listOf__string( + input.AdditionalStagingLabelsToDownload, + context + ), + }), }; }; const serializeAws_restJson1Subscription = (input: Subscription, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.Subject !== undefined && { Subject: input.Subject }), - ...(input.Target !== undefined && { Target: input.Target }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.Subject !== undefined && input.Subject !== null && { Subject: input.Subject }), + ...(input.Target !== undefined && input.Target !== null && { Target: input.Target }), }; }; @@ -9672,20 +9686,23 @@ const serializeAws_restJson1SubscriptionDefinitionVersion = ( context: __SerdeContext ): any => { return { - ...(input.Subscriptions !== undefined && { - Subscriptions: serializeAws_restJson1__listOfSubscription(input.Subscriptions, context), - }), + ...(input.Subscriptions !== undefined && + input.Subscriptions !== null && { + Subscriptions: serializeAws_restJson1__listOfSubscription(input.Subscriptions, context), + }), }; }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TelemetryConfigurationUpdate = ( @@ -9693,92 +9710,197 @@ const serializeAws_restJson1TelemetryConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.Telemetry !== undefined && { Telemetry: input.Telemetry }), + ...(input.Telemetry !== undefined && input.Telemetry !== null && { Telemetry: input.Telemetry }), }; }; const serializeAws_restJson1UpdateTargets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfConnectivityInfo = (output: any, context: __SerdeContext): ConnectivityInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConnectivityInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConnectivityInfo(entry, context); + }); }; const deserializeAws_restJson1__listOfConnector = (output: any, context: __SerdeContext): Connector[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Connector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Connector(entry, context); + }); }; const deserializeAws_restJson1__listOfCore = (output: any, context: __SerdeContext): Core[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Core(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Core(entry, context); + }); }; const deserializeAws_restJson1__listOfDefinitionInformation = ( output: any, context: __SerdeContext ): DefinitionInformation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DefinitionInformation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DefinitionInformation(entry, context); + }); }; const deserializeAws_restJson1__listOfDevice = (output: any, context: __SerdeContext): Device[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Device(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Device(entry, context); + }); }; const deserializeAws_restJson1__listOfFunction = (output: any, context: __SerdeContext): Function[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Function(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Function(entry, context); + }); }; const deserializeAws_restJson1__listOfGroupCertificateAuthorityProperties = ( output: any, context: __SerdeContext ): GroupCertificateAuthorityProperties[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1GroupCertificateAuthorityProperties(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupCertificateAuthorityProperties(entry, context); + }); }; const deserializeAws_restJson1__listOfGroupInformation = (output: any, context: __SerdeContext): GroupInformation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupInformation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupInformation(entry, context); + }); }; const deserializeAws_restJson1__listOfLogger = (output: any, context: __SerdeContext): Logger[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Logger(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Logger(entry, context); + }); }; const deserializeAws_restJson1__listOfResource = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Resource(entry, context); + }); }; const deserializeAws_restJson1__listOfResourceAccessPolicy = ( output: any, context: __SerdeContext ): ResourceAccessPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceAccessPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceAccessPolicy(entry, context); + }); }; const deserializeAws_restJson1__listOfSubscription = (output: any, context: __SerdeContext): Subscription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Subscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Subscription(entry, context); + }); }; const deserializeAws_restJson1__listOfVersionInformation = ( output: any, context: __SerdeContext ): VersionInformation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VersionInformation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VersionInformation(entry, context); + }); }; const deserializeAws_restJson1__mapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1BulkDeployment = (output: any, context: __SerdeContext): BulkDeployment => { @@ -9829,11 +9951,25 @@ const deserializeAws_restJson1BulkDeploymentResults = ( output: any, context: __SerdeContext ): BulkDeploymentResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BulkDeploymentResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BulkDeploymentResult(entry, context); + }); }; const deserializeAws_restJson1BulkDeployments = (output: any, context: __SerdeContext): BulkDeployment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BulkDeployment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BulkDeployment(entry, context); + }); }; const deserializeAws_restJson1ConnectivityInfo = (output: any, context: __SerdeContext): ConnectivityInfo => { @@ -9924,7 +10060,14 @@ const deserializeAws_restJson1Deployment = (output: any, context: __SerdeContext }; const deserializeAws_restJson1Deployments = (output: any, context: __SerdeContext): Deployment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Deployment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Deployment(entry, context); + }); }; const deserializeAws_restJson1Device = (output: any, context: __SerdeContext): Device => { @@ -9963,7 +10106,14 @@ const deserializeAws_restJson1ErrorDetail = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ErrorDetails = (output: any, context: __SerdeContext): ErrorDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ErrorDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ErrorDetail(entry, context); + }); }; const deserializeAws_restJson1Function = (output: any, context: __SerdeContext): Function => { @@ -10347,13 +10497,15 @@ const deserializeAws_restJson1SubscriptionDefinitionVersion = ( }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TelemetryConfiguration = ( @@ -10401,6 +10553,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-groundstation/protocols/Aws_restJson1.ts b/clients/client-groundstation/protocols/Aws_restJson1.ts index 463a440be0dd..f11e9320cc4b 100644 --- a/clients/client-groundstation/protocols/Aws_restJson1.ts +++ b/clients/client-groundstation/protocols/Aws_restJson1.ts @@ -98,9 +98,7 @@ export const serializeAws_restJson1CancelContactCommand = async ( input: CancelContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/contact/{contactId}"; if (input.contactId !== undefined) { const labelValue: string = input.contactId; @@ -129,16 +127,16 @@ export const serializeAws_restJson1CreateConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/config"; let body: any; body = JSON.stringify({ - ...(input.configData !== undefined && { - configData: serializeAws_restJson1ConfigTypeData(input.configData, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), + ...(input.configData !== undefined && + input.configData !== null && { configData: serializeAws_restJson1ConfigTypeData(input.configData, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -157,15 +155,17 @@ export const serializeAws_restJson1CreateDataflowEndpointGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/dataflowEndpointGroup"; let body: any; body = JSON.stringify({ - ...(input.endpointDetails !== undefined && { - endpointDetails: serializeAws_restJson1EndpointDetailsList(input.endpointDetails, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), + ...(input.endpointDetails !== undefined && + input.endpointDetails !== null && { + endpointDetails: serializeAws_restJson1EndpointDetailsList(input.endpointDetails, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -184,26 +184,32 @@ export const serializeAws_restJson1CreateMissionProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/missionprofile"; let body: any; body = JSON.stringify({ - ...(input.contactPostPassDurationSeconds !== undefined && { - contactPostPassDurationSeconds: input.contactPostPassDurationSeconds, - }), - ...(input.contactPrePassDurationSeconds !== undefined && { - contactPrePassDurationSeconds: input.contactPrePassDurationSeconds, - }), - ...(input.dataflowEdges !== undefined && { - dataflowEdges: serializeAws_restJson1DataflowEdgeList(input.dataflowEdges, context), - }), - ...(input.minimumViableContactDurationSeconds !== undefined && { - minimumViableContactDurationSeconds: input.minimumViableContactDurationSeconds, - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), - ...(input.trackingConfigArn !== undefined && { trackingConfigArn: input.trackingConfigArn }), + ...(input.contactPostPassDurationSeconds !== undefined && + input.contactPostPassDurationSeconds !== null && { + contactPostPassDurationSeconds: input.contactPostPassDurationSeconds, + }), + ...(input.contactPrePassDurationSeconds !== undefined && + input.contactPrePassDurationSeconds !== null && { + contactPrePassDurationSeconds: input.contactPrePassDurationSeconds, + }), + ...(input.dataflowEdges !== undefined && + input.dataflowEdges !== null && { + dataflowEdges: serializeAws_restJson1DataflowEdgeList(input.dataflowEdges, context), + }), + ...(input.minimumViableContactDurationSeconds !== undefined && + input.minimumViableContactDurationSeconds !== null && { + minimumViableContactDurationSeconds: input.minimumViableContactDurationSeconds, + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), + ...(input.trackingConfigArn !== undefined && + input.trackingConfigArn !== null && { trackingConfigArn: input.trackingConfigArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -221,9 +227,7 @@ export const serializeAws_restJson1DeleteConfigCommand = async ( input: DeleteConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/config/{configType}/{configId}"; if (input.configId !== undefined) { const labelValue: string = input.configId; @@ -260,9 +264,7 @@ export const serializeAws_restJson1DeleteDataflowEndpointGroupCommand = async ( input: DeleteDataflowEndpointGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dataflowEndpointGroup/{dataflowEndpointGroupId}"; if (input.dataflowEndpointGroupId !== undefined) { const labelValue: string = input.dataflowEndpointGroupId; @@ -290,9 +292,7 @@ export const serializeAws_restJson1DeleteMissionProfileCommand = async ( input: DeleteMissionProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/missionprofile/{missionProfileId}"; if (input.missionProfileId !== undefined) { const labelValue: string = input.missionProfileId; @@ -320,9 +320,7 @@ export const serializeAws_restJson1DescribeContactCommand = async ( input: DescribeContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/contact/{contactId}"; if (input.contactId !== undefined) { const labelValue: string = input.contactId; @@ -350,9 +348,7 @@ export const serializeAws_restJson1GetConfigCommand = async ( input: GetConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/config/{configType}/{configId}"; if (input.configId !== undefined) { const labelValue: string = input.configId; @@ -389,9 +385,7 @@ export const serializeAws_restJson1GetDataflowEndpointGroupCommand = async ( input: GetDataflowEndpointGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dataflowEndpointGroup/{dataflowEndpointGroupId}"; if (input.dataflowEndpointGroupId !== undefined) { const labelValue: string = input.dataflowEndpointGroupId; @@ -420,13 +414,13 @@ export const serializeAws_restJson1GetMinuteUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/minute-usage"; let body: any; body = JSON.stringify({ - ...(input.month !== undefined && { month: input.month }), - ...(input.year !== undefined && { year: input.year }), + ...(input.month !== undefined && input.month !== null && { month: input.month }), + ...(input.year !== undefined && input.year !== null && { year: input.year }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -444,9 +438,7 @@ export const serializeAws_restJson1GetMissionProfileCommand = async ( input: GetMissionProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/missionprofile/{missionProfileId}"; if (input.missionProfileId !== undefined) { const labelValue: string = input.missionProfileId; @@ -474,9 +466,7 @@ export const serializeAws_restJson1GetSatelliteCommand = async ( input: GetSatelliteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/satellite/{satelliteId}"; if (input.satelliteId !== undefined) { const labelValue: string = input.satelliteId; @@ -504,9 +494,7 @@ export const serializeAws_restJson1ListConfigsCommand = async ( input: ListConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/config"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -531,19 +519,23 @@ export const serializeAws_restJson1ListContactsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contacts"; let body: any; body = JSON.stringify({ - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.groundStation !== undefined && { groundStation: input.groundStation }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.missionProfileArn !== undefined && { missionProfileArn: input.missionProfileArn }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.satelliteArn !== undefined && { satelliteArn: input.satelliteArn }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.statusList !== undefined && { statusList: serializeAws_restJson1StatusList(input.statusList, context) }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.groundStation !== undefined && input.groundStation !== null && { groundStation: input.groundStation }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.missionProfileArn !== undefined && + input.missionProfileArn !== null && { missionProfileArn: input.missionProfileArn }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.satelliteArn !== undefined && input.satelliteArn !== null && { satelliteArn: input.satelliteArn }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.statusList !== undefined && + input.statusList !== null && { statusList: serializeAws_restJson1StatusList(input.statusList, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -561,9 +553,7 @@ export const serializeAws_restJson1ListDataflowEndpointGroupsCommand = async ( input: ListDataflowEndpointGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dataflowEndpointGroup"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -587,9 +577,7 @@ export const serializeAws_restJson1ListGroundStationsCommand = async ( input: ListGroundStationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/groundstation"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -614,9 +602,7 @@ export const serializeAws_restJson1ListMissionProfilesCommand = async ( input: ListMissionProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/missionprofile"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -640,9 +626,7 @@ export const serializeAws_restJson1ListSatellitesCommand = async ( input: ListSatellitesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/satellite"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -666,9 +650,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -697,17 +679,21 @@ export const serializeAws_restJson1ReserveContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/contact"; let body: any; body = JSON.stringify({ - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.groundStation !== undefined && { groundStation: input.groundStation }), - ...(input.missionProfileArn !== undefined && { missionProfileArn: input.missionProfileArn }), - ...(input.satelliteArn !== undefined && { satelliteArn: input.satelliteArn }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.groundStation !== undefined && input.groundStation !== null && { groundStation: input.groundStation }), + ...(input.missionProfileArn !== undefined && + input.missionProfileArn !== null && { missionProfileArn: input.missionProfileArn }), + ...(input.satelliteArn !== undefined && input.satelliteArn !== null && { satelliteArn: input.satelliteArn }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -726,7 +712,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -740,7 +726,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -758,9 +745,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -793,7 +778,7 @@ export const serializeAws_restJson1UpdateConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/config/{configType}/{configId}"; if (input.configId !== undefined) { @@ -816,10 +801,9 @@ export const serializeAws_restJson1UpdateConfigCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.configData !== undefined && { - configData: serializeAws_restJson1ConfigTypeData(input.configData, context), - }), - ...(input.name !== undefined && { name: input.name }), + ...(input.configData !== undefined && + input.configData !== null && { configData: serializeAws_restJson1ConfigTypeData(input.configData, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -838,7 +822,7 @@ export const serializeAws_restJson1UpdateMissionProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/missionprofile/{missionProfileId}"; if (input.missionProfileId !== undefined) { @@ -852,20 +836,25 @@ export const serializeAws_restJson1UpdateMissionProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.contactPostPassDurationSeconds !== undefined && { - contactPostPassDurationSeconds: input.contactPostPassDurationSeconds, - }), - ...(input.contactPrePassDurationSeconds !== undefined && { - contactPrePassDurationSeconds: input.contactPrePassDurationSeconds, - }), - ...(input.dataflowEdges !== undefined && { - dataflowEdges: serializeAws_restJson1DataflowEdgeList(input.dataflowEdges, context), - }), - ...(input.minimumViableContactDurationSeconds !== undefined && { - minimumViableContactDurationSeconds: input.minimumViableContactDurationSeconds, - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.trackingConfigArn !== undefined && { trackingConfigArn: input.trackingConfigArn }), + ...(input.contactPostPassDurationSeconds !== undefined && + input.contactPostPassDurationSeconds !== null && { + contactPostPassDurationSeconds: input.contactPostPassDurationSeconds, + }), + ...(input.contactPrePassDurationSeconds !== undefined && + input.contactPrePassDurationSeconds !== null && { + contactPrePassDurationSeconds: input.contactPrePassDurationSeconds, + }), + ...(input.dataflowEdges !== undefined && + input.dataflowEdges !== null && { + dataflowEdges: serializeAws_restJson1DataflowEdgeList(input.dataflowEdges, context), + }), + ...(input.minimumViableContactDurationSeconds !== undefined && + input.minimumViableContactDurationSeconds !== null && { + minimumViableContactDurationSeconds: input.minimumViableContactDurationSeconds, + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.trackingConfigArn !== undefined && + input.trackingConfigArn !== null && { trackingConfigArn: input.trackingConfigArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2931,9 +2920,10 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( const serializeAws_restJson1AntennaDownlinkConfig = (input: AntennaDownlinkConfig, context: __SerdeContext): any => { return { - ...(input.spectrumConfig !== undefined && { - spectrumConfig: serializeAws_restJson1SpectrumConfig(input.spectrumConfig, context), - }), + ...(input.spectrumConfig !== undefined && + input.spectrumConfig !== null && { + spectrumConfig: serializeAws_restJson1SpectrumConfig(input.spectrumConfig, context), + }), }; }; @@ -2942,25 +2932,29 @@ const serializeAws_restJson1AntennaDownlinkDemodDecodeConfig = ( context: __SerdeContext ): any => { return { - ...(input.decodeConfig !== undefined && { - decodeConfig: serializeAws_restJson1DecodeConfig(input.decodeConfig, context), - }), - ...(input.demodulationConfig !== undefined && { - demodulationConfig: serializeAws_restJson1DemodulationConfig(input.demodulationConfig, context), - }), - ...(input.spectrumConfig !== undefined && { - spectrumConfig: serializeAws_restJson1SpectrumConfig(input.spectrumConfig, context), - }), + ...(input.decodeConfig !== undefined && + input.decodeConfig !== null && { decodeConfig: serializeAws_restJson1DecodeConfig(input.decodeConfig, context) }), + ...(input.demodulationConfig !== undefined && + input.demodulationConfig !== null && { + demodulationConfig: serializeAws_restJson1DemodulationConfig(input.demodulationConfig, context), + }), + ...(input.spectrumConfig !== undefined && + input.spectrumConfig !== null && { + spectrumConfig: serializeAws_restJson1SpectrumConfig(input.spectrumConfig, context), + }), }; }; const serializeAws_restJson1AntennaUplinkConfig = (input: AntennaUplinkConfig, context: __SerdeContext): any => { return { - ...(input.spectrumConfig !== undefined && { - spectrumConfig: serializeAws_restJson1UplinkSpectrumConfig(input.spectrumConfig, context), - }), - ...(input.targetEirp !== undefined && { targetEirp: serializeAws_restJson1Eirp(input.targetEirp, context) }), - ...(input.transmitDisabled !== undefined && { transmitDisabled: input.transmitDisabled }), + ...(input.spectrumConfig !== undefined && + input.spectrumConfig !== null && { + spectrumConfig: serializeAws_restJson1UplinkSpectrumConfig(input.spectrumConfig, context), + }), + ...(input.targetEirp !== undefined && + input.targetEirp !== null && { targetEirp: serializeAws_restJson1Eirp(input.targetEirp, context) }), + ...(input.transmitDisabled !== undefined && + input.transmitDisabled !== null && { transmitDisabled: input.transmitDisabled }), }; }; @@ -2985,145 +2979,200 @@ const serializeAws_restJson1ConfigTypeData = (input: ConfigTypeData, context: __ }; const serializeAws_restJson1DataflowEdge = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DataflowEdgeList = (input: string[][], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DataflowEdge(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DataflowEdge(entry, context); + }); }; const serializeAws_restJson1DataflowEndpoint = (input: DataflowEndpoint, context: __SerdeContext): any => { return { - ...(input.address !== undefined && { address: serializeAws_restJson1SocketAddress(input.address, context) }), - ...(input.mtu !== undefined && { mtu: input.mtu }), - ...(input.name !== undefined && { name: input.name }), - ...(input.status !== undefined && { status: input.status }), + ...(input.address !== undefined && + input.address !== null && { address: serializeAws_restJson1SocketAddress(input.address, context) }), + ...(input.mtu !== undefined && input.mtu !== null && { mtu: input.mtu }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; const serializeAws_restJson1DataflowEndpointConfig = (input: DataflowEndpointConfig, context: __SerdeContext): any => { return { - ...(input.dataflowEndpointName !== undefined && { dataflowEndpointName: input.dataflowEndpointName }), - ...(input.dataflowEndpointRegion !== undefined && { dataflowEndpointRegion: input.dataflowEndpointRegion }), + ...(input.dataflowEndpointName !== undefined && + input.dataflowEndpointName !== null && { dataflowEndpointName: input.dataflowEndpointName }), + ...(input.dataflowEndpointRegion !== undefined && + input.dataflowEndpointRegion !== null && { dataflowEndpointRegion: input.dataflowEndpointRegion }), }; }; const serializeAws_restJson1DecodeConfig = (input: DecodeConfig, context: __SerdeContext): any => { return { - ...(input.unvalidatedJSON !== undefined && { unvalidatedJSON: input.unvalidatedJSON }), + ...(input.unvalidatedJSON !== undefined && + input.unvalidatedJSON !== null && { unvalidatedJSON: input.unvalidatedJSON }), }; }; const serializeAws_restJson1DemodulationConfig = (input: DemodulationConfig, context: __SerdeContext): any => { return { - ...(input.unvalidatedJSON !== undefined && { unvalidatedJSON: input.unvalidatedJSON }), + ...(input.unvalidatedJSON !== undefined && + input.unvalidatedJSON !== null && { unvalidatedJSON: input.unvalidatedJSON }), }; }; const serializeAws_restJson1Eirp = (input: Eirp, context: __SerdeContext): any => { return { - ...(input.units !== undefined && { units: input.units }), - ...(input.value !== undefined && { value: input.value }), + ...(input.units !== undefined && input.units !== null && { units: input.units }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1EndpointDetails = (input: EndpointDetails, context: __SerdeContext): any => { return { - ...(input.endpoint !== undefined && { endpoint: serializeAws_restJson1DataflowEndpoint(input.endpoint, context) }), - ...(input.securityDetails !== undefined && { - securityDetails: serializeAws_restJson1SecurityDetails(input.securityDetails, context), - }), + ...(input.endpoint !== undefined && + input.endpoint !== null && { endpoint: serializeAws_restJson1DataflowEndpoint(input.endpoint, context) }), + ...(input.securityDetails !== undefined && + input.securityDetails !== null && { + securityDetails: serializeAws_restJson1SecurityDetails(input.securityDetails, context), + }), }; }; const serializeAws_restJson1EndpointDetailsList = (input: EndpointDetails[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1EndpointDetails(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1EndpointDetails(entry, context); + }); }; const serializeAws_restJson1Frequency = (input: Frequency, context: __SerdeContext): any => { return { - ...(input.units !== undefined && { units: input.units }), - ...(input.value !== undefined && { value: input.value }), + ...(input.units !== undefined && input.units !== null && { units: input.units }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1FrequencyBandwidth = (input: FrequencyBandwidth, context: __SerdeContext): any => { return { - ...(input.units !== undefined && { units: input.units }), - ...(input.value !== undefined && { value: input.value }), + ...(input.units !== undefined && input.units !== null && { units: input.units }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1SecurityDetails = (input: SecurityDetails, context: __SerdeContext): any => { return { - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.securityGroupIds !== undefined && { - securityGroupIds: serializeAws_restJson1SecurityGroupIdList(input.securityGroupIds, context), - }), - ...(input.subnetIds !== undefined && { subnetIds: serializeAws_restJson1SubnetList(input.subnetIds, context) }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.securityGroupIds !== undefined && + input.securityGroupIds !== null && { + securityGroupIds: serializeAws_restJson1SecurityGroupIdList(input.securityGroupIds, context), + }), + ...(input.subnetIds !== undefined && + input.subnetIds !== null && { subnetIds: serializeAws_restJson1SubnetList(input.subnetIds, context) }), }; }; const serializeAws_restJson1SecurityGroupIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SocketAddress = (input: SocketAddress, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.port !== undefined && { port: input.port }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.port !== undefined && input.port !== null && { port: input.port }), }; }; const serializeAws_restJson1SpectrumConfig = (input: SpectrumConfig, context: __SerdeContext): any => { return { - ...(input.bandwidth !== undefined && { - bandwidth: serializeAws_restJson1FrequencyBandwidth(input.bandwidth, context), - }), - ...(input.centerFrequency !== undefined && { - centerFrequency: serializeAws_restJson1Frequency(input.centerFrequency, context), - }), - ...(input.polarization !== undefined && { polarization: input.polarization }), + ...(input.bandwidth !== undefined && + input.bandwidth !== null && { bandwidth: serializeAws_restJson1FrequencyBandwidth(input.bandwidth, context) }), + ...(input.centerFrequency !== undefined && + input.centerFrequency !== null && { + centerFrequency: serializeAws_restJson1Frequency(input.centerFrequency, context), + }), + ...(input.polarization !== undefined && input.polarization !== null && { polarization: input.polarization }), }; }; const serializeAws_restJson1StatusList = (input: (ContactStatus | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SubnetList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TrackingConfig = (input: TrackingConfig, context: __SerdeContext): any => { return { - ...(input.autotrack !== undefined && { autotrack: input.autotrack }), + ...(input.autotrack !== undefined && input.autotrack !== null && { autotrack: input.autotrack }), }; }; const serializeAws_restJson1UplinkEchoConfig = (input: UplinkEchoConfig, context: __SerdeContext): any => { return { - ...(input.antennaUplinkConfigArn !== undefined && { antennaUplinkConfigArn: input.antennaUplinkConfigArn }), - ...(input.enabled !== undefined && { enabled: input.enabled }), + ...(input.antennaUplinkConfigArn !== undefined && + input.antennaUplinkConfigArn !== null && { antennaUplinkConfigArn: input.antennaUplinkConfigArn }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), }; }; const serializeAws_restJson1UplinkSpectrumConfig = (input: UplinkSpectrumConfig, context: __SerdeContext): any => { return { - ...(input.centerFrequency !== undefined && { - centerFrequency: serializeAws_restJson1Frequency(input.centerFrequency, context), - }), - ...(input.polarization !== undefined && { polarization: input.polarization }), + ...(input.centerFrequency !== undefined && + input.centerFrequency !== null && { + centerFrequency: serializeAws_restJson1Frequency(input.centerFrequency, context), + }), + ...(input.polarization !== undefined && input.polarization !== null && { polarization: input.polarization }), }; }; @@ -3172,7 +3221,14 @@ const deserializeAws_restJson1AntennaUplinkConfig = (output: any, context: __Ser }; const deserializeAws_restJson1ConfigList = (output: any, context: __SerdeContext): ConfigListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConfigListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConfigListItem(entry, context); + }); }; const deserializeAws_restJson1ConfigListItem = (output: any, context: __SerdeContext): ConfigListItem => { @@ -3261,15 +3317,36 @@ const deserializeAws_restJson1ContactData = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ContactList = (output: any, context: __SerdeContext): ContactData[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ContactData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ContactData(entry, context); + }); }; const deserializeAws_restJson1DataflowEdge = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DataflowEdgeList = (output: any, context: __SerdeContext): string[][] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataflowEdge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataflowEdge(entry, context); + }); }; const deserializeAws_restJson1DataflowEndpoint = (output: any, context: __SerdeContext): DataflowEndpoint => { @@ -3304,7 +3381,14 @@ const deserializeAws_restJson1DataflowEndpointGroupList = ( output: any, context: __SerdeContext ): DataflowEndpointListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataflowEndpointListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataflowEndpointListItem(entry, context); + }); }; const deserializeAws_restJson1DataflowEndpointListItem = ( @@ -3365,7 +3449,14 @@ const deserializeAws_restJson1EndpointDetails = (output: any, context: __SerdeCo }; const deserializeAws_restJson1EndpointDetailsList = (output: any, context: __SerdeContext): EndpointDetails[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EndpointDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EndpointDetails(entry, context); + }); }; const deserializeAws_restJson1Frequency = (output: any, context: __SerdeContext): Frequency => { @@ -3395,15 +3486,36 @@ const deserializeAws_restJson1GroundStationData = (output: any, context: __Serde }; const deserializeAws_restJson1GroundStationIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1GroundStationList = (output: any, context: __SerdeContext): GroundStationData[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroundStationData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroundStationData(entry, context); + }); }; const deserializeAws_restJson1MissionProfileList = (output: any, context: __SerdeContext): MissionProfileListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MissionProfileListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MissionProfileListItem(entry, context); + }); }; const deserializeAws_restJson1MissionProfileListItem = ( @@ -3423,7 +3535,14 @@ const deserializeAws_restJson1MissionProfileListItem = ( }; const deserializeAws_restJson1SatelliteList = (output: any, context: __SerdeContext): SatelliteListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SatelliteListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SatelliteListItem(entry, context); + }); }; const deserializeAws_restJson1SatelliteListItem = (output: any, context: __SerdeContext): SatelliteListItem => { @@ -3454,7 +3573,14 @@ const deserializeAws_restJson1SecurityDetails = (output: any, context: __SerdeCo }; const deserializeAws_restJson1SecurityGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SocketAddress = (output: any, context: __SerdeContext): SocketAddress => { @@ -3479,17 +3605,26 @@ const deserializeAws_restJson1SpectrumConfig = (output: any, context: __SerdeCon }; const deserializeAws_restJson1SubnetList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TrackingConfig = (output: any, context: __SerdeContext): TrackingConfig => { @@ -3538,6 +3673,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-guardduty/protocols/Aws_restJson1.ts b/clients/client-guardduty/protocols/Aws_restJson1.ts index de14751ff72c..71a344b1a97e 100644 --- a/clients/client-guardduty/protocols/Aws_restJson1.ts +++ b/clients/client-guardduty/protocols/Aws_restJson1.ts @@ -220,7 +220,7 @@ export const serializeAws_restJson1AcceptInvitationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/master"; if (input.DetectorId !== undefined) { @@ -234,8 +234,8 @@ export const serializeAws_restJson1AcceptInvitationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.InvitationId !== undefined && { invitationId: input.InvitationId }), - ...(input.MasterId !== undefined && { masterId: input.MasterId }), + ...(input.InvitationId !== undefined && input.InvitationId !== null && { invitationId: input.InvitationId }), + ...(input.MasterId !== undefined && input.MasterId !== null && { masterId: input.MasterId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -254,7 +254,7 @@ export const serializeAws_restJson1ArchiveFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/findings/archive"; if (input.DetectorId !== undefined) { @@ -268,7 +268,8 @@ export const serializeAws_restJson1ArchiveFindingsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.FindingIds !== undefined && { findingIds: serializeAws_restJson1FindingIds(input.FindingIds, context) }), + ...(input.FindingIds !== undefined && + input.FindingIds !== null && { findingIds: serializeAws_restJson1FindingIds(input.FindingIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -287,20 +288,20 @@ export const serializeAws_restJson1CreateDetectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector"; let body: any; body = JSON.stringify({ clientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.DataSources !== undefined && { - dataSources: serializeAws_restJson1DataSourceConfigurations(input.DataSources, context), - }), - ...(input.Enable !== undefined && { enable: input.Enable }), - ...(input.FindingPublishingFrequency !== undefined && { - findingPublishingFrequency: input.FindingPublishingFrequency, - }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.DataSources !== undefined && + input.DataSources !== null && { + dataSources: serializeAws_restJson1DataSourceConfigurations(input.DataSources, context), + }), + ...(input.Enable !== undefined && input.Enable !== null && { enable: input.Enable }), + ...(input.FindingPublishingFrequency !== undefined && + input.FindingPublishingFrequency !== null && { findingPublishingFrequency: input.FindingPublishingFrequency }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -319,7 +320,7 @@ export const serializeAws_restJson1CreateFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/filter"; if (input.DetectorId !== undefined) { @@ -333,15 +334,16 @@ export const serializeAws_restJson1CreateFilterCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Action !== undefined && { action: input.Action }), + ...(input.Action !== undefined && input.Action !== null && { action: input.Action }), clientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.FindingCriteria !== undefined && { - findingCriteria: serializeAws_restJson1FindingCriteria(input.FindingCriteria, context), - }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Rank !== undefined && { rank: input.Rank }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.FindingCriteria !== undefined && + input.FindingCriteria !== null && { + findingCriteria: serializeAws_restJson1FindingCriteria(input.FindingCriteria, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Rank !== undefined && input.Rank !== null && { rank: input.Rank }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -360,7 +362,7 @@ export const serializeAws_restJson1CreateIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/ipset"; if (input.DetectorId !== undefined) { @@ -374,12 +376,12 @@ export const serializeAws_restJson1CreateIPSetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Activate !== undefined && { activate: input.Activate }), + ...(input.Activate !== undefined && input.Activate !== null && { activate: input.Activate }), clientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Format !== undefined && { format: input.Format }), - ...(input.Location !== undefined && { location: input.Location }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Format !== undefined && input.Format !== null && { format: input.Format }), + ...(input.Location !== undefined && input.Location !== null && { location: input.Location }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -398,7 +400,7 @@ export const serializeAws_restJson1CreateMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/member"; if (input.DetectorId !== undefined) { @@ -412,9 +414,10 @@ export const serializeAws_restJson1CreateMembersCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountDetails !== undefined && { - accountDetails: serializeAws_restJson1AccountDetails(input.AccountDetails, context), - }), + ...(input.AccountDetails !== undefined && + input.AccountDetails !== null && { + accountDetails: serializeAws_restJson1AccountDetails(input.AccountDetails, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -433,7 +436,7 @@ export const serializeAws_restJson1CreatePublishingDestinationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/publishingDestination"; if (input.DetectorId !== undefined) { @@ -448,10 +451,12 @@ export const serializeAws_restJson1CreatePublishingDestinationCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.DestinationProperties !== undefined && { - destinationProperties: serializeAws_restJson1DestinationProperties(input.DestinationProperties, context), - }), - ...(input.DestinationType !== undefined && { destinationType: input.DestinationType }), + ...(input.DestinationProperties !== undefined && + input.DestinationProperties !== null && { + destinationProperties: serializeAws_restJson1DestinationProperties(input.DestinationProperties, context), + }), + ...(input.DestinationType !== undefined && + input.DestinationType !== null && { destinationType: input.DestinationType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -470,7 +475,7 @@ export const serializeAws_restJson1CreateSampleFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/findings/create"; if (input.DetectorId !== undefined) { @@ -484,9 +489,8 @@ export const serializeAws_restJson1CreateSampleFindingsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.FindingTypes !== undefined && { - findingTypes: serializeAws_restJson1FindingTypes(input.FindingTypes, context), - }), + ...(input.FindingTypes !== undefined && + input.FindingTypes !== null && { findingTypes: serializeAws_restJson1FindingTypes(input.FindingTypes, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -505,7 +509,7 @@ export const serializeAws_restJson1CreateThreatIntelSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/threatintelset"; if (input.DetectorId !== undefined) { @@ -519,12 +523,12 @@ export const serializeAws_restJson1CreateThreatIntelSetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Activate !== undefined && { activate: input.Activate }), + ...(input.Activate !== undefined && input.Activate !== null && { activate: input.Activate }), clientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Format !== undefined && { format: input.Format }), - ...(input.Location !== undefined && { location: input.Location }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Format !== undefined && input.Format !== null && { format: input.Format }), + ...(input.Location !== undefined && input.Location !== null && { location: input.Location }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -543,12 +547,13 @@ export const serializeAws_restJson1DeclineInvitationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitation/decline"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -566,9 +571,7 @@ export const serializeAws_restJson1DeleteDetectorCommand = async ( input: DeleteDetectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -596,9 +599,7 @@ export const serializeAws_restJson1DeleteFilterCommand = async ( input: DeleteFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/filter/{FilterName}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -636,12 +637,13 @@ export const serializeAws_restJson1DeleteInvitationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitation/delete"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -659,9 +661,7 @@ export const serializeAws_restJson1DeleteIPSetCommand = async ( input: DeleteIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/ipset/{IpSetId}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -699,7 +699,7 @@ export const serializeAws_restJson1DeleteMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/member/delete"; if (input.DetectorId !== undefined) { @@ -713,7 +713,8 @@ export const serializeAws_restJson1DeleteMembersCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -731,9 +732,7 @@ export const serializeAws_restJson1DeletePublishingDestinationCommand = async ( input: DeletePublishingDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/publishingDestination/{DestinationId}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -770,9 +769,7 @@ export const serializeAws_restJson1DeleteThreatIntelSetCommand = async ( input: DeleteThreatIntelSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/threatintelset/{ThreatIntelSetId}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -809,9 +806,7 @@ export const serializeAws_restJson1DescribeOrganizationConfigurationCommand = as input: DescribeOrganizationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/admin"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -839,9 +834,7 @@ export const serializeAws_restJson1DescribePublishingDestinationCommand = async input: DescribePublishingDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/publishingDestination/{DestinationId}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -879,12 +872,13 @@ export const serializeAws_restJson1DisableOrganizationAdminAccountCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/admin/disable"; let body: any; body = JSON.stringify({ - ...(input.AdminAccountId !== undefined && { adminAccountId: input.AdminAccountId }), + ...(input.AdminAccountId !== undefined && + input.AdminAccountId !== null && { adminAccountId: input.AdminAccountId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -902,9 +896,7 @@ export const serializeAws_restJson1DisassociateFromMasterAccountCommand = async input: DisassociateFromMasterAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/master/disassociate"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -933,7 +925,7 @@ export const serializeAws_restJson1DisassociateMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/member/disassociate"; if (input.DetectorId !== undefined) { @@ -947,7 +939,8 @@ export const serializeAws_restJson1DisassociateMembersCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -966,12 +959,13 @@ export const serializeAws_restJson1EnableOrganizationAdminAccountCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/admin/enable"; let body: any; body = JSON.stringify({ - ...(input.AdminAccountId !== undefined && { adminAccountId: input.AdminAccountId }), + ...(input.AdminAccountId !== undefined && + input.AdminAccountId !== null && { adminAccountId: input.AdminAccountId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -989,9 +983,7 @@ export const serializeAws_restJson1GetDetectorCommand = async ( input: GetDetectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1019,9 +1011,7 @@ export const serializeAws_restJson1GetFilterCommand = async ( input: GetFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/filter/{FilterName}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1059,7 +1049,7 @@ export const serializeAws_restJson1GetFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/findings/get"; if (input.DetectorId !== undefined) { @@ -1073,10 +1063,10 @@ export const serializeAws_restJson1GetFindingsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.FindingIds !== undefined && { findingIds: serializeAws_restJson1FindingIds(input.FindingIds, context) }), - ...(input.SortCriteria !== undefined && { - sortCriteria: serializeAws_restJson1SortCriteria(input.SortCriteria, context), - }), + ...(input.FindingIds !== undefined && + input.FindingIds !== null && { findingIds: serializeAws_restJson1FindingIds(input.FindingIds, context) }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { sortCriteria: serializeAws_restJson1SortCriteria(input.SortCriteria, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1095,7 +1085,7 @@ export const serializeAws_restJson1GetFindingsStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/findings/statistics"; if (input.DetectorId !== undefined) { @@ -1109,12 +1099,14 @@ export const serializeAws_restJson1GetFindingsStatisticsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.FindingCriteria !== undefined && { - findingCriteria: serializeAws_restJson1FindingCriteria(input.FindingCriteria, context), - }), - ...(input.FindingStatisticTypes !== undefined && { - findingStatisticTypes: serializeAws_restJson1FindingStatisticTypes(input.FindingStatisticTypes, context), - }), + ...(input.FindingCriteria !== undefined && + input.FindingCriteria !== null && { + findingCriteria: serializeAws_restJson1FindingCriteria(input.FindingCriteria, context), + }), + ...(input.FindingStatisticTypes !== undefined && + input.FindingStatisticTypes !== null && { + findingStatisticTypes: serializeAws_restJson1FindingStatisticTypes(input.FindingStatisticTypes, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1132,12 +1124,10 @@ export const serializeAws_restJson1GetInvitationsCountCommand = async ( input: GetInvitationsCountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/invitation/count"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1154,9 +1144,7 @@ export const serializeAws_restJson1GetIPSetCommand = async ( input: GetIPSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/ipset/{IpSetId}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1193,9 +1181,7 @@ export const serializeAws_restJson1GetMasterAccountCommand = async ( input: GetMasterAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/master"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1224,7 +1210,7 @@ export const serializeAws_restJson1GetMemberDetectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/member/detector/get"; if (input.DetectorId !== undefined) { @@ -1238,7 +1224,8 @@ export const serializeAws_restJson1GetMemberDetectorsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1257,7 +1244,7 @@ export const serializeAws_restJson1GetMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/member/get"; if (input.DetectorId !== undefined) { @@ -1271,7 +1258,8 @@ export const serializeAws_restJson1GetMembersCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1289,9 +1277,7 @@ export const serializeAws_restJson1GetThreatIntelSetCommand = async ( input: GetThreatIntelSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/threatintelset/{ThreatIntelSetId}"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1329,7 +1315,7 @@ export const serializeAws_restJson1GetUsageStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/usage/statistics"; if (input.DetectorId !== undefined) { @@ -1343,13 +1329,15 @@ export const serializeAws_restJson1GetUsageStatisticsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { maxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { nextToken: input.NextToken }), - ...(input.Unit !== undefined && { unit: input.Unit }), - ...(input.UsageCriteria !== undefined && { - usageCriteria: serializeAws_restJson1UsageCriteria(input.UsageCriteria, context), - }), - ...(input.UsageStatisticType !== undefined && { usageStatisticsType: input.UsageStatisticType }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { maxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { nextToken: input.NextToken }), + ...(input.Unit !== undefined && input.Unit !== null && { unit: input.Unit }), + ...(input.UsageCriteria !== undefined && + input.UsageCriteria !== null && { + usageCriteria: serializeAws_restJson1UsageCriteria(input.UsageCriteria, context), + }), + ...(input.UsageStatisticType !== undefined && + input.UsageStatisticType !== null && { usageStatisticsType: input.UsageStatisticType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1368,7 +1356,7 @@ export const serializeAws_restJson1InviteMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/member/invite"; if (input.DetectorId !== undefined) { @@ -1382,9 +1370,11 @@ export const serializeAws_restJson1InviteMembersCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), - ...(input.DisableEmailNotification !== undefined && { disableEmailNotification: input.DisableEmailNotification }), - ...(input.Message !== undefined && { message: input.Message }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.DisableEmailNotification !== undefined && + input.DisableEmailNotification !== null && { disableEmailNotification: input.DisableEmailNotification }), + ...(input.Message !== undefined && input.Message !== null && { message: input.Message }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1402,9 +1392,7 @@ export const serializeAws_restJson1ListDetectorsCommand = async ( input: ListDetectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1428,9 +1416,7 @@ export const serializeAws_restJson1ListFiltersCommand = async ( input: ListFiltersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/filter"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1464,7 +1450,7 @@ export const serializeAws_restJson1ListFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/findings"; if (input.DetectorId !== undefined) { @@ -1478,14 +1464,14 @@ export const serializeAws_restJson1ListFindingsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.FindingCriteria !== undefined && { - findingCriteria: serializeAws_restJson1FindingCriteria(input.FindingCriteria, context), - }), - ...(input.MaxResults !== undefined && { maxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { nextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - sortCriteria: serializeAws_restJson1SortCriteria(input.SortCriteria, context), - }), + ...(input.FindingCriteria !== undefined && + input.FindingCriteria !== null && { + findingCriteria: serializeAws_restJson1FindingCriteria(input.FindingCriteria, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { maxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { nextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { sortCriteria: serializeAws_restJson1SortCriteria(input.SortCriteria, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1503,9 +1489,7 @@ export const serializeAws_restJson1ListInvitationsCommand = async ( input: ListInvitationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/invitation"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1529,9 +1513,7 @@ export const serializeAws_restJson1ListIPSetsCommand = async ( input: ListIPSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/ipset"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1564,9 +1546,7 @@ export const serializeAws_restJson1ListMembersCommand = async ( input: ListMembersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/member"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1600,9 +1580,7 @@ export const serializeAws_restJson1ListOrganizationAdminAccountsCommand = async input: ListOrganizationAdminAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/admin"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1626,9 +1604,7 @@ export const serializeAws_restJson1ListPublishingDestinationsCommand = async ( input: ListPublishingDestinationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/publishingDestination"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1661,9 +1637,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1691,9 +1665,7 @@ export const serializeAws_restJson1ListThreatIntelSetsCommand = async ( input: ListThreatIntelSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector/{DetectorId}/threatintelset"; if (input.DetectorId !== undefined) { const labelValue: string = input.DetectorId; @@ -1727,7 +1699,7 @@ export const serializeAws_restJson1StartMonitoringMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/member/start"; if (input.DetectorId !== undefined) { @@ -1741,7 +1713,8 @@ export const serializeAws_restJson1StartMonitoringMembersCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1760,7 +1733,7 @@ export const serializeAws_restJson1StopMonitoringMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/member/stop"; if (input.DetectorId !== undefined) { @@ -1774,7 +1747,8 @@ export const serializeAws_restJson1StopMonitoringMembersCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1793,7 +1767,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -1807,7 +1781,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1826,7 +1800,7 @@ export const serializeAws_restJson1UnarchiveFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/findings/unarchive"; if (input.DetectorId !== undefined) { @@ -1840,7 +1814,8 @@ export const serializeAws_restJson1UnarchiveFindingsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.FindingIds !== undefined && { findingIds: serializeAws_restJson1FindingIds(input.FindingIds, context) }), + ...(input.FindingIds !== undefined && + input.FindingIds !== null && { findingIds: serializeAws_restJson1FindingIds(input.FindingIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1858,9 +1833,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1893,7 +1866,7 @@ export const serializeAws_restJson1UpdateDetectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}"; if (input.DetectorId !== undefined) { @@ -1907,13 +1880,13 @@ export const serializeAws_restJson1UpdateDetectorCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DataSources !== undefined && { - dataSources: serializeAws_restJson1DataSourceConfigurations(input.DataSources, context), - }), - ...(input.Enable !== undefined && { enable: input.Enable }), - ...(input.FindingPublishingFrequency !== undefined && { - findingPublishingFrequency: input.FindingPublishingFrequency, - }), + ...(input.DataSources !== undefined && + input.DataSources !== null && { + dataSources: serializeAws_restJson1DataSourceConfigurations(input.DataSources, context), + }), + ...(input.Enable !== undefined && input.Enable !== null && { enable: input.Enable }), + ...(input.FindingPublishingFrequency !== undefined && + input.FindingPublishingFrequency !== null && { findingPublishingFrequency: input.FindingPublishingFrequency }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1932,7 +1905,7 @@ export const serializeAws_restJson1UpdateFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/filter/{FilterName}"; if (input.DetectorId !== undefined) { @@ -1955,12 +1928,13 @@ export const serializeAws_restJson1UpdateFilterCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Action !== undefined && { action: input.Action }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.FindingCriteria !== undefined && { - findingCriteria: serializeAws_restJson1FindingCriteria(input.FindingCriteria, context), - }), - ...(input.Rank !== undefined && { rank: input.Rank }), + ...(input.Action !== undefined && input.Action !== null && { action: input.Action }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.FindingCriteria !== undefined && + input.FindingCriteria !== null && { + findingCriteria: serializeAws_restJson1FindingCriteria(input.FindingCriteria, context), + }), + ...(input.Rank !== undefined && input.Rank !== null && { rank: input.Rank }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1979,7 +1953,7 @@ export const serializeAws_restJson1UpdateFindingsFeedbackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/findings/feedback"; if (input.DetectorId !== undefined) { @@ -1993,9 +1967,10 @@ export const serializeAws_restJson1UpdateFindingsFeedbackCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Comments !== undefined && { comments: input.Comments }), - ...(input.Feedback !== undefined && { feedback: input.Feedback }), - ...(input.FindingIds !== undefined && { findingIds: serializeAws_restJson1FindingIds(input.FindingIds, context) }), + ...(input.Comments !== undefined && input.Comments !== null && { comments: input.Comments }), + ...(input.Feedback !== undefined && input.Feedback !== null && { feedback: input.Feedback }), + ...(input.FindingIds !== undefined && + input.FindingIds !== null && { findingIds: serializeAws_restJson1FindingIds(input.FindingIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2014,7 +1989,7 @@ export const serializeAws_restJson1UpdateIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/ipset/{IpSetId}"; if (input.DetectorId !== undefined) { @@ -2037,9 +2012,9 @@ export const serializeAws_restJson1UpdateIPSetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Activate !== undefined && { activate: input.Activate }), - ...(input.Location !== undefined && { location: input.Location }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.Activate !== undefined && input.Activate !== null && { activate: input.Activate }), + ...(input.Location !== undefined && input.Location !== null && { location: input.Location }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2058,7 +2033,7 @@ export const serializeAws_restJson1UpdateMemberDetectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/member/detector/update"; if (input.DetectorId !== undefined) { @@ -2072,10 +2047,12 @@ export const serializeAws_restJson1UpdateMemberDetectorsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), - ...(input.DataSources !== undefined && { - dataSources: serializeAws_restJson1DataSourceConfigurations(input.DataSources, context), - }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.DataSources !== undefined && + input.DataSources !== null && { + dataSources: serializeAws_restJson1DataSourceConfigurations(input.DataSources, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2094,7 +2071,7 @@ export const serializeAws_restJson1UpdateOrganizationConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/admin"; if (input.DetectorId !== undefined) { @@ -2108,10 +2085,11 @@ export const serializeAws_restJson1UpdateOrganizationConfigurationCommand = asyn } let body: any; body = JSON.stringify({ - ...(input.AutoEnable !== undefined && { autoEnable: input.AutoEnable }), - ...(input.DataSources !== undefined && { - dataSources: serializeAws_restJson1OrganizationDataSourceConfigurations(input.DataSources, context), - }), + ...(input.AutoEnable !== undefined && input.AutoEnable !== null && { autoEnable: input.AutoEnable }), + ...(input.DataSources !== undefined && + input.DataSources !== null && { + dataSources: serializeAws_restJson1OrganizationDataSourceConfigurations(input.DataSources, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2130,7 +2108,7 @@ export const serializeAws_restJson1UpdatePublishingDestinationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/publishingDestination/{DestinationId}"; if (input.DetectorId !== undefined) { @@ -2153,9 +2131,10 @@ export const serializeAws_restJson1UpdatePublishingDestinationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DestinationProperties !== undefined && { - destinationProperties: serializeAws_restJson1DestinationProperties(input.DestinationProperties, context), - }), + ...(input.DestinationProperties !== undefined && + input.DestinationProperties !== null && { + destinationProperties: serializeAws_restJson1DestinationProperties(input.DestinationProperties, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2174,7 +2153,7 @@ export const serializeAws_restJson1UpdateThreatIntelSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector/{DetectorId}/threatintelset/{ThreatIntelSetId}"; if (input.DetectorId !== undefined) { @@ -2197,9 +2176,9 @@ export const serializeAws_restJson1UpdateThreatIntelSetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Activate !== undefined && { activate: input.Activate }), - ...(input.Location !== undefined && { location: input.Location }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.Activate !== undefined && input.Activate !== null && { activate: input.Activate }), + ...(input.Location !== undefined && input.Location !== null && { location: input.Location }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5985,44 +5964,64 @@ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async ( const serializeAws_restJson1AccountDetail = (input: AccountDetail, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { accountId: input.AccountId }), - ...(input.Email !== undefined && { email: input.Email }), + ...(input.AccountId !== undefined && input.AccountId !== null && { accountId: input.AccountId }), + ...(input.Email !== undefined && input.Email !== null && { email: input.Email }), }; }; const serializeAws_restJson1AccountDetails = (input: AccountDetail[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AccountDetail(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AccountDetail(entry, context); + }); }; const serializeAws_restJson1AccountIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Condition = (input: Condition, context: __SerdeContext): any => { return { - ...(input.Eq !== undefined && { eq: serializeAws_restJson1Eq(input.Eq, context) }), - ...(input.Equals !== undefined && { equals: serializeAws_restJson1Equals(input.Equals, context) }), - ...(input.GreaterThan !== undefined && { greaterThan: input.GreaterThan }), - ...(input.GreaterThanOrEqual !== undefined && { greaterThanOrEqual: input.GreaterThanOrEqual }), - ...(input.Gt !== undefined && { gt: input.Gt }), - ...(input.Gte !== undefined && { gte: input.Gte }), - ...(input.LessThan !== undefined && { lessThan: input.LessThan }), - ...(input.LessThanOrEqual !== undefined && { lessThanOrEqual: input.LessThanOrEqual }), - ...(input.Lt !== undefined && { lt: input.Lt }), - ...(input.Lte !== undefined && { lte: input.Lte }), - ...(input.Neq !== undefined && { neq: serializeAws_restJson1Neq(input.Neq, context) }), - ...(input.NotEquals !== undefined && { notEquals: serializeAws_restJson1NotEquals(input.NotEquals, context) }), + ...(input.Eq !== undefined && input.Eq !== null && { eq: serializeAws_restJson1Eq(input.Eq, context) }), + ...(input.Equals !== undefined && + input.Equals !== null && { equals: serializeAws_restJson1Equals(input.Equals, context) }), + ...(input.GreaterThan !== undefined && input.GreaterThan !== null && { greaterThan: input.GreaterThan }), + ...(input.GreaterThanOrEqual !== undefined && + input.GreaterThanOrEqual !== null && { greaterThanOrEqual: input.GreaterThanOrEqual }), + ...(input.Gt !== undefined && input.Gt !== null && { gt: input.Gt }), + ...(input.Gte !== undefined && input.Gte !== null && { gte: input.Gte }), + ...(input.LessThan !== undefined && input.LessThan !== null && { lessThan: input.LessThan }), + ...(input.LessThanOrEqual !== undefined && + input.LessThanOrEqual !== null && { lessThanOrEqual: input.LessThanOrEqual }), + ...(input.Lt !== undefined && input.Lt !== null && { lt: input.Lt }), + ...(input.Lte !== undefined && input.Lte !== null && { lte: input.Lte }), + ...(input.Neq !== undefined && input.Neq !== null && { neq: serializeAws_restJson1Neq(input.Neq, context) }), + ...(input.NotEquals !== undefined && + input.NotEquals !== null && { notEquals: serializeAws_restJson1NotEquals(input.NotEquals, context) }), }; }; const serializeAws_restJson1Criterion = (input: { [key: string]: Condition }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Condition }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Condition }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1Condition(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1DataSourceConfigurations = ( @@ -6030,56 +6029,115 @@ const serializeAws_restJson1DataSourceConfigurations = ( context: __SerdeContext ): any => { return { - ...(input.S3Logs !== undefined && { s3Logs: serializeAws_restJson1S3LogsConfiguration(input.S3Logs, context) }), + ...(input.S3Logs !== undefined && + input.S3Logs !== null && { s3Logs: serializeAws_restJson1S3LogsConfiguration(input.S3Logs, context) }), }; }; const serializeAws_restJson1DataSourceList = (input: (DataSource | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DestinationProperties = (input: DestinationProperties, context: __SerdeContext): any => { return { - ...(input.DestinationArn !== undefined && { destinationArn: input.DestinationArn }), - ...(input.KmsKeyArn !== undefined && { kmsKeyArn: input.KmsKeyArn }), + ...(input.DestinationArn !== undefined && + input.DestinationArn !== null && { destinationArn: input.DestinationArn }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { kmsKeyArn: input.KmsKeyArn }), }; }; const serializeAws_restJson1Eq = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Equals = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1FindingCriteria = (input: FindingCriteria, context: __SerdeContext): any => { return { - ...(input.Criterion !== undefined && { criterion: serializeAws_restJson1Criterion(input.Criterion, context) }), + ...(input.Criterion !== undefined && + input.Criterion !== null && { criterion: serializeAws_restJson1Criterion(input.Criterion, context) }), }; }; const serializeAws_restJson1FindingIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1FindingStatisticTypes = ( input: (FindingStatisticType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1FindingTypes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Neq = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1NotEquals = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1OrganizationDataSourceConfigurations = ( @@ -6087,9 +6145,10 @@ const serializeAws_restJson1OrganizationDataSourceConfigurations = ( context: __SerdeContext ): any => { return { - ...(input.S3Logs !== undefined && { - s3Logs: serializeAws_restJson1OrganizationS3LogsConfiguration(input.S3Logs, context), - }), + ...(input.S3Logs !== undefined && + input.S3Logs !== null && { + s3Logs: serializeAws_restJson1OrganizationS3LogsConfiguration(input.S3Logs, context), + }), }; }; @@ -6098,44 +6157,54 @@ const serializeAws_restJson1OrganizationS3LogsConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AutoEnable !== undefined && { autoEnable: input.AutoEnable }), + ...(input.AutoEnable !== undefined && input.AutoEnable !== null && { autoEnable: input.AutoEnable }), }; }; const serializeAws_restJson1ResourceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1S3LogsConfiguration = (input: S3LogsConfiguration, context: __SerdeContext): any => { return { - ...(input.Enable !== undefined && { enable: input.Enable }), + ...(input.Enable !== undefined && input.Enable !== null && { enable: input.Enable }), }; }; const serializeAws_restJson1SortCriteria = (input: SortCriteria, context: __SerdeContext): any => { return { - ...(input.AttributeName !== undefined && { attributeName: input.AttributeName }), - ...(input.OrderBy !== undefined && { orderBy: input.OrderBy }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { attributeName: input.AttributeName }), + ...(input.OrderBy !== undefined && input.OrderBy !== null && { orderBy: input.OrderBy }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1UsageCriteria = (input: UsageCriteria, context: __SerdeContext): any => { return { - ...(input.AccountIds !== undefined && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), - ...(input.DataSources !== undefined && { - dataSources: serializeAws_restJson1DataSourceList(input.DataSources, context), - }), - ...(input.Resources !== undefined && { resources: serializeAws_restJson1ResourceList(input.Resources, context) }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) }), + ...(input.DataSources !== undefined && + input.DataSources !== null && { dataSources: serializeAws_restJson1DataSourceList(input.DataSources, context) }), + ...(input.Resources !== undefined && + input.Resources !== null && { resources: serializeAws_restJson1ResourceList(input.Resources, context) }), }; }; @@ -6204,7 +6273,14 @@ const deserializeAws_restJson1AdminAccount = (output: any, context: __SerdeConte }; const deserializeAws_restJson1AdminAccounts = (output: any, context: __SerdeContext): AdminAccount[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AdminAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AdminAccount(entry, context); + }); }; const deserializeAws_restJson1AwsApiCallAction = (output: any, context: __SerdeContext): AwsApiCallAction => { @@ -6317,13 +6393,15 @@ const deserializeAws_restJson1Condition = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1CountBySeverity = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Country = (output: any, context: __SerdeContext): Country => { @@ -6334,13 +6412,15 @@ const deserializeAws_restJson1Country = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Criterion = (output: any, context: __SerdeContext): { [key: string]: Condition } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Condition }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Condition }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1Condition(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DataSourceConfigurationsResult = ( @@ -6398,11 +6478,25 @@ const deserializeAws_restJson1DestinationProperties = (output: any, context: __S }; const deserializeAws_restJson1Destinations = (output: any, context: __SerdeContext): Destination[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Destination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Destination(entry, context); + }); }; const deserializeAws_restJson1DetectorIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DNSLogsConfigurationResult = ( @@ -6427,11 +6521,25 @@ const deserializeAws_restJson1DomainDetails = (output: any, context: __SerdeCont }; const deserializeAws_restJson1Eq = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Equals = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Evidence = (output: any, context: __SerdeContext): Evidence => { @@ -6444,7 +6552,14 @@ const deserializeAws_restJson1Evidence = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1FilterNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Finding = (output: any, context: __SerdeContext): Finding => { @@ -6484,11 +6599,25 @@ const deserializeAws_restJson1FindingCriteria = (output: any, context: __SerdeCo }; const deserializeAws_restJson1FindingIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Findings = (output: any, context: __SerdeContext): Finding[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Finding(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Finding(entry, context); + }); }; const deserializeAws_restJson1FindingStatistics = (output: any, context: __SerdeContext): FindingStatistics => { @@ -6569,15 +6698,36 @@ const deserializeAws_restJson1Invitation = (output: any, context: __SerdeContext }; const deserializeAws_restJson1Invitations = (output: any, context: __SerdeContext): Invitation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Invitation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Invitation(entry, context); + }); }; const deserializeAws_restJson1IpSetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Ipv6Addresses = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1LocalIpDetails = (output: any, context: __SerdeContext): LocalIpDetails => { @@ -6637,15 +6787,36 @@ const deserializeAws_restJson1MemberDataSourceConfigurations = ( output: any, context: __SerdeContext ): MemberDataSourceConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MemberDataSourceConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MemberDataSourceConfiguration(entry, context); + }); }; const deserializeAws_restJson1Members = (output: any, context: __SerdeContext): Member[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Member(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Member(entry, context); + }); }; const deserializeAws_restJson1Neq = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1NetworkConnectionAction = ( @@ -6709,11 +6880,25 @@ const deserializeAws_restJson1NetworkInterface = (output: any, context: __SerdeC }; const deserializeAws_restJson1NetworkInterfaces = (output: any, context: __SerdeContext): NetworkInterface[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NetworkInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NetworkInterface(entry, context); + }); }; const deserializeAws_restJson1NotEquals = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Organization = (output: any, context: __SerdeContext): Organization => { @@ -6796,7 +6981,14 @@ const deserializeAws_restJson1PortProbeDetail = (output: any, context: __SerdeCo }; const deserializeAws_restJson1PortProbeDetails = (output: any, context: __SerdeContext): PortProbeDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PortProbeDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PortProbeDetail(entry, context); + }); }; const deserializeAws_restJson1PrivateIpAddressDetails = ( @@ -6815,7 +7007,14 @@ const deserializeAws_restJson1PrivateIpAddresses = ( output: any, context: __SerdeContext ): PrivateIpAddressDetails[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PrivateIpAddressDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PrivateIpAddressDetails(entry, context); + }); }; const deserializeAws_restJson1ProductCode = (output: any, context: __SerdeContext): ProductCode => { @@ -6826,7 +7025,14 @@ const deserializeAws_restJson1ProductCode = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ProductCodes = (output: any, context: __SerdeContext): ProductCode[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProductCode(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProductCode(entry, context); + }); }; const deserializeAws_restJson1PublicAccess = (output: any, context: __SerdeContext): PublicAccess => { @@ -6918,7 +7124,14 @@ const deserializeAws_restJson1S3BucketDetail = (output: any, context: __SerdeCon }; const deserializeAws_restJson1S3BucketDetails = (output: any, context: __SerdeContext): S3BucketDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1S3BucketDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1S3BucketDetail(entry, context); + }); }; const deserializeAws_restJson1S3LogsConfigurationResult = ( @@ -6938,7 +7151,14 @@ const deserializeAws_restJson1SecurityGroup = (output: any, context: __SerdeCont }; const deserializeAws_restJson1SecurityGroups = (output: any, context: __SerdeContext): SecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SecurityGroup(entry, context); + }); }; const deserializeAws_restJson1Service = (output: any, context: __SerdeContext): Service => { @@ -6972,17 +7192,26 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1ThreatIntelligenceDetail = ( @@ -7003,15 +7232,36 @@ const deserializeAws_restJson1ThreatIntelligenceDetails = ( output: any, context: __SerdeContext ): ThreatIntelligenceDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThreatIntelligenceDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThreatIntelligenceDetail(entry, context); + }); }; const deserializeAws_restJson1ThreatIntelSetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ThreatNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Total = (output: any, context: __SerdeContext): Total => { @@ -7029,7 +7279,14 @@ const deserializeAws_restJson1UnprocessedAccount = (output: any, context: __Serd }; const deserializeAws_restJson1UnprocessedAccounts = (output: any, context: __SerdeContext): UnprocessedAccount[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UnprocessedAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UnprocessedAccount(entry, context); + }); }; const deserializeAws_restJson1UsageAccountResult = (output: any, context: __SerdeContext): UsageAccountResult => { @@ -7043,7 +7300,14 @@ const deserializeAws_restJson1UsageAccountResult = (output: any, context: __Serd }; const deserializeAws_restJson1UsageAccountResultList = (output: any, context: __SerdeContext): UsageAccountResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UsageAccountResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UsageAccountResult(entry, context); + }); }; const deserializeAws_restJson1UsageDataSourceResult = (output: any, context: __SerdeContext): UsageDataSourceResult => { @@ -7060,7 +7324,14 @@ const deserializeAws_restJson1UsageDataSourceResultList = ( output: any, context: __SerdeContext ): UsageDataSourceResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UsageDataSourceResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UsageDataSourceResult(entry, context); + }); }; const deserializeAws_restJson1UsageResourceResult = (output: any, context: __SerdeContext): UsageResourceResult => { @@ -7077,7 +7348,14 @@ const deserializeAws_restJson1UsageResourceResultList = ( output: any, context: __SerdeContext ): UsageResourceResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UsageResourceResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UsageResourceResult(entry, context); + }); }; const deserializeAws_restJson1UsageStatistics = (output: any, context: __SerdeContext): UsageStatistics => { @@ -7121,6 +7399,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-health/protocols/Aws_json1_1.ts b/clients/client-health/protocols/Aws_json1_1.ts index b199f5ac4749..dc862b2fc960 100644 --- a/clients/client-health/protocols/Aws_json1_1.ts +++ b/clients/client-health/protocols/Aws_json1_1.ts @@ -106,7 +106,7 @@ export const serializeAws_json1_1DescribeAffectedAccountsForOrganizationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeAffectedAccountsForOrganization", }; let body: any; @@ -119,7 +119,7 @@ export const serializeAws_json1_1DescribeAffectedEntitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeAffectedEntities", }; let body: any; @@ -132,7 +132,7 @@ export const serializeAws_json1_1DescribeAffectedEntitiesForOrganizationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeAffectedEntitiesForOrganization", }; let body: any; @@ -145,7 +145,7 @@ export const serializeAws_json1_1DescribeEntityAggregatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeEntityAggregates", }; let body: any; @@ -158,7 +158,7 @@ export const serializeAws_json1_1DescribeEventAggregatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeEventAggregates", }; let body: any; @@ -171,7 +171,7 @@ export const serializeAws_json1_1DescribeEventDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeEventDetails", }; let body: any; @@ -184,7 +184,7 @@ export const serializeAws_json1_1DescribeEventDetailsForOrganizationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeEventDetailsForOrganization", }; let body: any; @@ -197,7 +197,7 @@ export const serializeAws_json1_1DescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeEvents", }; let body: any; @@ -210,7 +210,7 @@ export const serializeAws_json1_1DescribeEventsForOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeEventsForOrganization", }; let body: any; @@ -223,7 +223,7 @@ export const serializeAws_json1_1DescribeEventTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeEventTypes", }; let body: any; @@ -236,7 +236,7 @@ export const serializeAws_json1_1DescribeHealthServiceStatusForOrganizationComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DescribeHealthServiceStatusForOrganization", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -247,7 +247,7 @@ export const serializeAws_json1_1DisableHealthServiceAccessForOrganizationComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.DisableHealthServiceAccessForOrganization", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -258,7 +258,7 @@ export const serializeAws_json1_1EnableHealthServiceAccessForOrganizationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSHealth_20160804.EnableHealthServiceAccessForOrganization", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -291,8 +291,7 @@ const deserializeAws_json1_1DescribeAffectedAccountsForOrganizationCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidPaginationToken": case "com.amazonaws.health#InvalidPaginationToken": @@ -346,8 +345,7 @@ const deserializeAws_json1_1DescribeAffectedEntitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidPaginationToken": case "com.amazonaws.health#InvalidPaginationToken": @@ -409,8 +407,7 @@ const deserializeAws_json1_1DescribeAffectedEntitiesForOrganizationCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidPaginationToken": case "com.amazonaws.health#InvalidPaginationToken": @@ -472,8 +469,7 @@ const deserializeAws_json1_1DescribeEntityAggregatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -519,8 +515,7 @@ const deserializeAws_json1_1DescribeEventAggregatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidPaginationToken": case "com.amazonaws.health#InvalidPaginationToken": @@ -574,8 +569,7 @@ const deserializeAws_json1_1DescribeEventDetailsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "UnsupportedLocale": case "com.amazonaws.health#UnsupportedLocale": @@ -629,8 +623,7 @@ const deserializeAws_json1_1DescribeEventDetailsForOrganizationCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "UnsupportedLocale": case "com.amazonaws.health#UnsupportedLocale": @@ -684,8 +677,7 @@ const deserializeAws_json1_1DescribeEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidPaginationToken": case "com.amazonaws.health#InvalidPaginationToken": @@ -747,8 +739,7 @@ const deserializeAws_json1_1DescribeEventsForOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidPaginationToken": case "com.amazonaws.health#InvalidPaginationToken": @@ -810,8 +801,7 @@ const deserializeAws_json1_1DescribeEventTypesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidPaginationToken": case "com.amazonaws.health#InvalidPaginationToken": @@ -873,8 +863,7 @@ const deserializeAws_json1_1DescribeHealthServiceStatusForOrganizationCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -917,8 +906,7 @@ const deserializeAws_json1_1DisableHealthServiceAccessForOrganizationCommandErro }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.health#ConcurrentModificationException": @@ -969,8 +957,7 @@ const deserializeAws_json1_1EnableHealthServiceAccessForOrganizationCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.health#ConcurrentModificationException": @@ -1043,22 +1030,43 @@ const deserializeAws_json1_1UnsupportedLocaleResponse = async ( }; const serializeAws_json1_1availabilityZones = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1awsAccountIdsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DateTimeRange = (input: DateTimeRange, context: __SerdeContext): any => { return { - ...(input.from !== undefined && { from: Math.round(input.from.getTime() / 1000) }), - ...(input.to !== undefined && { to: Math.round(input.to.getTime() / 1000) }), + ...(input.from !== undefined && input.from !== null && { from: Math.round(input.from.getTime() / 1000) }), + ...(input.to !== undefined && input.to !== null && { to: Math.round(input.to.getTime() / 1000) }), }; }; const serializeAws_json1_1dateTimeRangeList = (input: DateTimeRange[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DateTimeRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DateTimeRange(entry, context); + }); }; const serializeAws_json1_1DescribeAffectedAccountsForOrganizationRequest = ( @@ -1066,9 +1074,9 @@ const serializeAws_json1_1DescribeAffectedAccountsForOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.eventArn !== undefined && { eventArn: input.eventArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.eventArn !== undefined && input.eventArn !== null && { eventArn: input.eventArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -1077,15 +1085,16 @@ const serializeAws_json1_1DescribeAffectedEntitiesForOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.organizationEntityFilters !== undefined && { - organizationEntityFilters: serializeAws_json1_1OrganizationEntityFiltersList( - input.organizationEntityFilters, - context - ), - }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.organizationEntityFilters !== undefined && + input.organizationEntityFilters !== null && { + organizationEntityFilters: serializeAws_json1_1OrganizationEntityFiltersList( + input.organizationEntityFilters, + context + ), + }), }; }; @@ -1094,10 +1103,11 @@ const serializeAws_json1_1DescribeAffectedEntitiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1EntityFilter(input.filter, context) }), - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1EntityFilter(input.filter, context) }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -1106,7 +1116,8 @@ const serializeAws_json1_1DescribeEntityAggregatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.eventArns !== undefined && { eventArns: serializeAws_json1_1EventArnsList(input.eventArns, context) }), + ...(input.eventArns !== undefined && + input.eventArns !== null && { eventArns: serializeAws_json1_1EventArnsList(input.eventArns, context) }), }; }; @@ -1115,10 +1126,12 @@ const serializeAws_json1_1DescribeEventAggregatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.aggregateField !== undefined && { aggregateField: input.aggregateField }), - ...(input.filter !== undefined && { filter: serializeAws_json1_1EventFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.aggregateField !== undefined && + input.aggregateField !== null && { aggregateField: input.aggregateField }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1EventFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -1127,13 +1140,14 @@ const serializeAws_json1_1DescribeEventDetailsForOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.organizationEventDetailFilters !== undefined && { - organizationEventDetailFilters: serializeAws_json1_1OrganizationEventDetailFiltersList( - input.organizationEventDetailFilters, - context - ), - }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.organizationEventDetailFilters !== undefined && + input.organizationEventDetailFilters !== null && { + organizationEventDetailFilters: serializeAws_json1_1OrganizationEventDetailFiltersList( + input.organizationEventDetailFilters, + context + ), + }), }; }; @@ -1142,8 +1156,9 @@ const serializeAws_json1_1DescribeEventDetailsRequest = ( context: __SerdeContext ): any => { return { - ...(input.eventArns !== undefined && { eventArns: serializeAws_json1_1eventArnList(input.eventArns, context) }), - ...(input.locale !== undefined && { locale: input.locale }), + ...(input.eventArns !== undefined && + input.eventArns !== null && { eventArns: serializeAws_json1_1eventArnList(input.eventArns, context) }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), }; }; @@ -1152,19 +1167,21 @@ const serializeAws_json1_1DescribeEventsForOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1OrganizationEventFilter(input.filter, context) }), - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1OrganizationEventFilter(input.filter, context) }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1DescribeEventsRequest = (input: DescribeEventsRequest, context: __SerdeContext): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1EventFilter(input.filter, context) }), - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1EventFilter(input.filter, context) }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -1173,31 +1190,45 @@ const serializeAws_json1_1DescribeEventTypesRequest = ( context: __SerdeContext ): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1EventTypeFilter(input.filter, context) }), - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1EventTypeFilter(input.filter, context) }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1entityArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EntityFilter = (input: EntityFilter, context: __SerdeContext): any => { return { - ...(input.entityArns !== undefined && { entityArns: serializeAws_json1_1entityArnList(input.entityArns, context) }), - ...(input.entityValues !== undefined && { - entityValues: serializeAws_json1_1entityValueList(input.entityValues, context), - }), - ...(input.eventArns !== undefined && { eventArns: serializeAws_json1_1eventArnList(input.eventArns, context) }), - ...(input.lastUpdatedTimes !== undefined && { - lastUpdatedTimes: serializeAws_json1_1dateTimeRangeList(input.lastUpdatedTimes, context), - }), - ...(input.statusCodes !== undefined && { - statusCodes: serializeAws_json1_1entityStatusCodeList(input.statusCodes, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagFilter(input.tags, context) }), + ...(input.entityArns !== undefined && + input.entityArns !== null && { entityArns: serializeAws_json1_1entityArnList(input.entityArns, context) }), + ...(input.entityValues !== undefined && + input.entityValues !== null && { + entityValues: serializeAws_json1_1entityValueList(input.entityValues, context), + }), + ...(input.eventArns !== undefined && + input.eventArns !== null && { eventArns: serializeAws_json1_1eventArnList(input.eventArns, context) }), + ...(input.lastUpdatedTimes !== undefined && + input.lastUpdatedTimes !== null && { + lastUpdatedTimes: serializeAws_json1_1dateTimeRangeList(input.lastUpdatedTimes, context), + }), + ...(input.statusCodes !== undefined && + input.statusCodes !== null && { + statusCodes: serializeAws_json1_1entityStatusCodeList(input.statusCodes, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_json1_1tagFilter(input.tags, context) }), }; }; @@ -1205,164 +1236,296 @@ const serializeAws_json1_1entityStatusCodeList = ( input: (EntityStatusCode | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1entityValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EventAccountFilter = (input: EventAccountFilter, context: __SerdeContext): any => { return { - ...(input.awsAccountId !== undefined && { awsAccountId: input.awsAccountId }), - ...(input.eventArn !== undefined && { eventArn: input.eventArn }), + ...(input.awsAccountId !== undefined && input.awsAccountId !== null && { awsAccountId: input.awsAccountId }), + ...(input.eventArn !== undefined && input.eventArn !== null && { eventArn: input.eventArn }), }; }; const serializeAws_json1_1eventArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EventArnsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EventFilter = (input: EventFilter, context: __SerdeContext): any => { return { - ...(input.availabilityZones !== undefined && { - availabilityZones: serializeAws_json1_1availabilityZones(input.availabilityZones, context), - }), - ...(input.endTimes !== undefined && { endTimes: serializeAws_json1_1dateTimeRangeList(input.endTimes, context) }), - ...(input.entityArns !== undefined && { entityArns: serializeAws_json1_1entityArnList(input.entityArns, context) }), - ...(input.entityValues !== undefined && { - entityValues: serializeAws_json1_1entityValueList(input.entityValues, context), - }), - ...(input.eventArns !== undefined && { eventArns: serializeAws_json1_1eventArnList(input.eventArns, context) }), - ...(input.eventStatusCodes !== undefined && { - eventStatusCodes: serializeAws_json1_1eventStatusCodeList(input.eventStatusCodes, context), - }), - ...(input.eventTypeCategories !== undefined && { - eventTypeCategories: serializeAws_json1_1eventTypeCategoryList2(input.eventTypeCategories, context), - }), - ...(input.eventTypeCodes !== undefined && { - eventTypeCodes: serializeAws_json1_1eventTypeList2(input.eventTypeCodes, context), - }), - ...(input.lastUpdatedTimes !== undefined && { - lastUpdatedTimes: serializeAws_json1_1dateTimeRangeList(input.lastUpdatedTimes, context), - }), - ...(input.regions !== undefined && { regions: serializeAws_json1_1regionList(input.regions, context) }), - ...(input.services !== undefined && { services: serializeAws_json1_1serviceList(input.services, context) }), - ...(input.startTimes !== undefined && { - startTimes: serializeAws_json1_1dateTimeRangeList(input.startTimes, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1tagFilter(input.tags, context) }), + ...(input.availabilityZones !== undefined && + input.availabilityZones !== null && { + availabilityZones: serializeAws_json1_1availabilityZones(input.availabilityZones, context), + }), + ...(input.endTimes !== undefined && + input.endTimes !== null && { endTimes: serializeAws_json1_1dateTimeRangeList(input.endTimes, context) }), + ...(input.entityArns !== undefined && + input.entityArns !== null && { entityArns: serializeAws_json1_1entityArnList(input.entityArns, context) }), + ...(input.entityValues !== undefined && + input.entityValues !== null && { + entityValues: serializeAws_json1_1entityValueList(input.entityValues, context), + }), + ...(input.eventArns !== undefined && + input.eventArns !== null && { eventArns: serializeAws_json1_1eventArnList(input.eventArns, context) }), + ...(input.eventStatusCodes !== undefined && + input.eventStatusCodes !== null && { + eventStatusCodes: serializeAws_json1_1eventStatusCodeList(input.eventStatusCodes, context), + }), + ...(input.eventTypeCategories !== undefined && + input.eventTypeCategories !== null && { + eventTypeCategories: serializeAws_json1_1eventTypeCategoryList2(input.eventTypeCategories, context), + }), + ...(input.eventTypeCodes !== undefined && + input.eventTypeCodes !== null && { + eventTypeCodes: serializeAws_json1_1eventTypeList2(input.eventTypeCodes, context), + }), + ...(input.lastUpdatedTimes !== undefined && + input.lastUpdatedTimes !== null && { + lastUpdatedTimes: serializeAws_json1_1dateTimeRangeList(input.lastUpdatedTimes, context), + }), + ...(input.regions !== undefined && + input.regions !== null && { regions: serializeAws_json1_1regionList(input.regions, context) }), + ...(input.services !== undefined && + input.services !== null && { services: serializeAws_json1_1serviceList(input.services, context) }), + ...(input.startTimes !== undefined && + input.startTimes !== null && { startTimes: serializeAws_json1_1dateTimeRangeList(input.startTimes, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_json1_1tagFilter(input.tags, context) }), }; }; const serializeAws_json1_1eventStatusCodeList = (input: (EventStatusCode | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EventTypeCategoryList = ( input: (EventTypeCategory | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1eventTypeCategoryList2 = ( input: (EventTypeCategory | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EventTypeCodeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EventTypeFilter = (input: EventTypeFilter, context: __SerdeContext): any => { return { - ...(input.eventTypeCategories !== undefined && { - eventTypeCategories: serializeAws_json1_1EventTypeCategoryList(input.eventTypeCategories, context), - }), - ...(input.eventTypeCodes !== undefined && { - eventTypeCodes: serializeAws_json1_1EventTypeCodeList(input.eventTypeCodes, context), - }), - ...(input.services !== undefined && { services: serializeAws_json1_1serviceList(input.services, context) }), + ...(input.eventTypeCategories !== undefined && + input.eventTypeCategories !== null && { + eventTypeCategories: serializeAws_json1_1EventTypeCategoryList(input.eventTypeCategories, context), + }), + ...(input.eventTypeCodes !== undefined && + input.eventTypeCodes !== null && { + eventTypeCodes: serializeAws_json1_1EventTypeCodeList(input.eventTypeCodes, context), + }), + ...(input.services !== undefined && + input.services !== null && { services: serializeAws_json1_1serviceList(input.services, context) }), }; }; const serializeAws_json1_1eventTypeList2 = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OrganizationEntityFiltersList = ( input: EventAccountFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1EventAccountFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EventAccountFilter(entry, context); + }); }; const serializeAws_json1_1OrganizationEventDetailFiltersList = ( input: EventAccountFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1EventAccountFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EventAccountFilter(entry, context); + }); }; const serializeAws_json1_1OrganizationEventFilter = (input: OrganizationEventFilter, context: __SerdeContext): any => { return { - ...(input.awsAccountIds !== undefined && { - awsAccountIds: serializeAws_json1_1awsAccountIdsList(input.awsAccountIds, context), - }), - ...(input.endTime !== undefined && { endTime: serializeAws_json1_1DateTimeRange(input.endTime, context) }), - ...(input.entityArns !== undefined && { entityArns: serializeAws_json1_1entityArnList(input.entityArns, context) }), - ...(input.entityValues !== undefined && { - entityValues: serializeAws_json1_1entityValueList(input.entityValues, context), - }), - ...(input.eventStatusCodes !== undefined && { - eventStatusCodes: serializeAws_json1_1eventStatusCodeList(input.eventStatusCodes, context), - }), - ...(input.eventTypeCategories !== undefined && { - eventTypeCategories: serializeAws_json1_1eventTypeCategoryList2(input.eventTypeCategories, context), - }), - ...(input.eventTypeCodes !== undefined && { - eventTypeCodes: serializeAws_json1_1eventTypeList2(input.eventTypeCodes, context), - }), - ...(input.lastUpdatedTime !== undefined && { - lastUpdatedTime: serializeAws_json1_1DateTimeRange(input.lastUpdatedTime, context), - }), - ...(input.regions !== undefined && { regions: serializeAws_json1_1regionList(input.regions, context) }), - ...(input.services !== undefined && { services: serializeAws_json1_1serviceList(input.services, context) }), - ...(input.startTime !== undefined && { startTime: serializeAws_json1_1DateTimeRange(input.startTime, context) }), + ...(input.awsAccountIds !== undefined && + input.awsAccountIds !== null && { + awsAccountIds: serializeAws_json1_1awsAccountIdsList(input.awsAccountIds, context), + }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: serializeAws_json1_1DateTimeRange(input.endTime, context) }), + ...(input.entityArns !== undefined && + input.entityArns !== null && { entityArns: serializeAws_json1_1entityArnList(input.entityArns, context) }), + ...(input.entityValues !== undefined && + input.entityValues !== null && { + entityValues: serializeAws_json1_1entityValueList(input.entityValues, context), + }), + ...(input.eventStatusCodes !== undefined && + input.eventStatusCodes !== null && { + eventStatusCodes: serializeAws_json1_1eventStatusCodeList(input.eventStatusCodes, context), + }), + ...(input.eventTypeCategories !== undefined && + input.eventTypeCategories !== null && { + eventTypeCategories: serializeAws_json1_1eventTypeCategoryList2(input.eventTypeCategories, context), + }), + ...(input.eventTypeCodes !== undefined && + input.eventTypeCodes !== null && { + eventTypeCodes: serializeAws_json1_1eventTypeList2(input.eventTypeCodes, context), + }), + ...(input.lastUpdatedTime !== undefined && + input.lastUpdatedTime !== null && { + lastUpdatedTime: serializeAws_json1_1DateTimeRange(input.lastUpdatedTime, context), + }), + ...(input.regions !== undefined && + input.regions !== null && { regions: serializeAws_json1_1regionList(input.regions, context) }), + ...(input.services !== undefined && + input.services !== null && { services: serializeAws_json1_1serviceList(input.services, context) }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: serializeAws_json1_1DateTimeRange(input.startTime, context) }), }; }; const serializeAws_json1_1regionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1serviceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1tagFilter = (input: { [key: string]: string }[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1tagSet(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1tagSet(entry, context); + }); }; const serializeAws_json1_1tagSet = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1affectedAccountsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AffectedEntity = (output: any, context: __SerdeContext): AffectedEntity => { @@ -1412,9 +1575,14 @@ const deserializeAws_json1_1DescribeAffectedEntitiesForOrganizationFailedSet = ( output: any, context: __SerdeContext ): OrganizationAffectedEntitiesErrorItem[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1OrganizationAffectedEntitiesErrorItem(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationAffectedEntitiesErrorItem(entry, context); + }); }; const deserializeAws_json1_1DescribeAffectedEntitiesForOrganizationResponse = ( @@ -1476,14 +1644,28 @@ const deserializeAws_json1_1DescribeEventDetailsFailedSet = ( output: any, context: __SerdeContext ): EventDetailsErrorItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventDetailsErrorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventDetailsErrorItem(entry, context); + }); }; const deserializeAws_json1_1DescribeEventDetailsForOrganizationFailedSet = ( output: any, context: __SerdeContext ): OrganizationEventDetailsErrorItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationEventDetailsErrorItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationEventDetailsErrorItem(entry, context); + }); }; const deserializeAws_json1_1DescribeEventDetailsForOrganizationResponse = ( @@ -1506,7 +1688,14 @@ const deserializeAws_json1_1DescribeEventDetailsForOrganizationSuccessfulSet = ( output: any, context: __SerdeContext ): OrganizationEventDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationEventDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationEventDetails(entry, context); + }); }; const deserializeAws_json1_1DescribeEventDetailsResponse = ( @@ -1529,7 +1718,14 @@ const deserializeAws_json1_1DescribeEventDetailsSuccessfulSet = ( output: any, context: __SerdeContext ): EventDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventDetails(entry, context); + }); }; const deserializeAws_json1_1DescribeEventsForOrganizationResponse = ( @@ -1589,11 +1785,25 @@ const deserializeAws_json1_1EntityAggregate = (output: any, context: __SerdeCont }; const deserializeAws_json1_1EntityAggregateList = (output: any, context: __SerdeContext): EntityAggregate[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EntityAggregate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EntityAggregate(entry, context); + }); }; const deserializeAws_json1_1EntityList = (output: any, context: __SerdeContext): AffectedEntity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AffectedEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AffectedEntity(entry, context); + }); }; const deserializeAws_json1_1Event = (output: any, context: __SerdeContext): Event => { @@ -1634,7 +1844,14 @@ const deserializeAws_json1_1EventAggregate = (output: any, context: __SerdeConte }; const deserializeAws_json1_1EventAggregateList = (output: any, context: __SerdeContext): EventAggregate[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventAggregate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventAggregate(entry, context); + }); }; const deserializeAws_json1_1EventDescription = (output: any, context: __SerdeContext): EventDescription => { @@ -1672,17 +1889,26 @@ const deserializeAws_json1_1EventDetailsErrorItem = (output: any, context: __Ser }; const deserializeAws_json1_1EventList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Event(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Event(entry, context); + }); }; const deserializeAws_json1_1eventMetadata = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1EventType = (output: any, context: __SerdeContext): EventType => { @@ -1694,7 +1920,14 @@ const deserializeAws_json1_1EventType = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1EventTypeList = (output: any, context: __SerdeContext): EventType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventType(entry, context); + }); }; const deserializeAws_json1_1InvalidPaginationToken = (output: any, context: __SerdeContext): InvalidPaginationToken => { @@ -1776,17 +2009,26 @@ const deserializeAws_json1_1OrganizationEventDetailsErrorItem = ( }; const deserializeAws_json1_1OrganizationEventList = (output: any, context: __SerdeContext): OrganizationEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationEvent(entry, context); + }); }; const deserializeAws_json1_1tagSet = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1UnsupportedLocale = (output: any, context: __SerdeContext): UnsupportedLocale => { @@ -1845,3 +2087,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-healthlake/protocols/Aws_json1_0.ts b/clients/client-healthlake/protocols/Aws_json1_0.ts index 0ef84555e0de..80c50cbc9318 100644 --- a/clients/client-healthlake/protocols/Aws_json1_0.ts +++ b/clients/client-healthlake/protocols/Aws_json1_0.ts @@ -57,7 +57,7 @@ export const serializeAws_json1_0CreateFHIRDatastoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "HealthLake.CreateFHIRDatastore", }; let body: any; @@ -70,7 +70,7 @@ export const serializeAws_json1_0DeleteFHIRDatastoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "HealthLake.DeleteFHIRDatastore", }; let body: any; @@ -83,7 +83,7 @@ export const serializeAws_json1_0DescribeFHIRDatastoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "HealthLake.DescribeFHIRDatastore", }; let body: any; @@ -96,7 +96,7 @@ export const serializeAws_json1_0DescribeFHIRImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "HealthLake.DescribeFHIRImportJob", }; let body: any; @@ -109,7 +109,7 @@ export const serializeAws_json1_0ListFHIRDatastoresCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "HealthLake.ListFHIRDatastores", }; let body: any; @@ -122,7 +122,7 @@ export const serializeAws_json1_0StartFHIRImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "HealthLake.StartFHIRImportJob", }; let body: any; @@ -157,8 +157,7 @@ const deserializeAws_json1_0CreateFHIRDatastoreCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.healthlake#InternalServerException": @@ -228,8 +227,7 @@ const deserializeAws_json1_0DeleteFHIRDatastoreCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.healthlake#AccessDeniedException": @@ -323,8 +321,7 @@ const deserializeAws_json1_0DescribeFHIRDatastoreCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.healthlake#InternalServerException": @@ -402,8 +399,7 @@ const deserializeAws_json1_0DescribeFHIRImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.healthlake#InternalServerException": @@ -481,8 +477,7 @@ const deserializeAws_json1_0ListFHIRDatastoresCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.healthlake#InternalServerException": @@ -552,8 +547,7 @@ const deserializeAws_json1_0StartFHIRImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.healthlake#AccessDeniedException": @@ -708,20 +702,25 @@ const serializeAws_json1_0CreateFHIRDatastoreRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.DatastoreName !== undefined && { DatastoreName: input.DatastoreName }), - ...(input.DatastoreTypeVersion !== undefined && { DatastoreTypeVersion: input.DatastoreTypeVersion }), - ...(input.PreloadDataConfig !== undefined && { - PreloadDataConfig: serializeAws_json1_0PreloadDataConfig(input.PreloadDataConfig, context), - }), + ...(input.DatastoreName !== undefined && input.DatastoreName !== null && { DatastoreName: input.DatastoreName }), + ...(input.DatastoreTypeVersion !== undefined && + input.DatastoreTypeVersion !== null && { DatastoreTypeVersion: input.DatastoreTypeVersion }), + ...(input.PreloadDataConfig !== undefined && + input.PreloadDataConfig !== null && { + PreloadDataConfig: serializeAws_json1_0PreloadDataConfig(input.PreloadDataConfig, context), + }), }; }; const serializeAws_json1_0DatastoreFilter = (input: DatastoreFilter, context: __SerdeContext): any => { return { - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.DatastoreName !== undefined && { DatastoreName: input.DatastoreName }), - ...(input.DatastoreStatus !== undefined && { DatastoreStatus: input.DatastoreStatus }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.DatastoreName !== undefined && input.DatastoreName !== null && { DatastoreName: input.DatastoreName }), + ...(input.DatastoreStatus !== undefined && + input.DatastoreStatus !== null && { DatastoreStatus: input.DatastoreStatus }), }; }; @@ -730,7 +729,7 @@ const serializeAws_json1_0DeleteFHIRDatastoreRequest = ( context: __SerdeContext ): any => { return { - ...(input.DatastoreId !== undefined && { DatastoreId: input.DatastoreId }), + ...(input.DatastoreId !== undefined && input.DatastoreId !== null && { DatastoreId: input.DatastoreId }), }; }; @@ -739,7 +738,7 @@ const serializeAws_json1_0DescribeFHIRDatastoreRequest = ( context: __SerdeContext ): any => { return { - ...(input.DatastoreId !== undefined && { DatastoreId: input.DatastoreId }), + ...(input.DatastoreId !== undefined && input.DatastoreId !== null && { DatastoreId: input.DatastoreId }), }; }; @@ -748,8 +747,8 @@ const serializeAws_json1_0DescribeFHIRImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.DatastoreId !== undefined && { DatastoreId: input.DatastoreId }), - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.DatastoreId !== undefined && input.DatastoreId !== null && { DatastoreId: input.DatastoreId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -765,15 +764,17 @@ const serializeAws_json1_0ListFHIRDatastoresRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_0DatastoreFilter(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_0DatastoreFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_0PreloadDataConfig = (input: PreloadDataConfig, context: __SerdeContext): any => { return { - ...(input.PreloadDataType !== undefined && { PreloadDataType: input.PreloadDataType }), + ...(input.PreloadDataType !== undefined && + input.PreloadDataType !== null && { PreloadDataType: input.PreloadDataType }), }; }; @@ -783,12 +784,14 @@ const serializeAws_json1_0StartFHIRImportJobRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.DatastoreId !== undefined && { DatastoreId: input.DatastoreId }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_0InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.DatastoreId !== undefined && input.DatastoreId !== null && { DatastoreId: input.DatastoreId }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_0InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), }; }; @@ -848,7 +851,14 @@ const deserializeAws_json1_0DatastoreProperties = (output: any, context: __Serde }; const deserializeAws_json1_0DatastorePropertiesList = (output: any, context: __SerdeContext): DatastoreProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0DatastoreProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0DatastoreProperties(entry, context); + }); }; const deserializeAws_json1_0DeleteFHIRDatastoreResponse = ( @@ -1035,3 +1045,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-honeycode/protocols/Aws_restJson1.ts b/clients/client-honeycode/protocols/Aws_restJson1.ts index 324b1ae6fa84..67f865563a9d 100644 --- a/clients/client-honeycode/protocols/Aws_restJson1.ts +++ b/clients/client-honeycode/protocols/Aws_restJson1.ts @@ -84,7 +84,7 @@ export const serializeAws_restJson1BatchCreateTableRowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/workbooks/{workbookId}/tables/{tableId}/rows/batchcreate"; if (input.workbookId !== undefined) { @@ -107,10 +107,12 @@ export const serializeAws_restJson1BatchCreateTableRowsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.rowsToCreate !== undefined && { - rowsToCreate: serializeAws_restJson1CreateRowDataList(input.rowsToCreate, context), - }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.rowsToCreate !== undefined && + input.rowsToCreate !== null && { + rowsToCreate: serializeAws_restJson1CreateRowDataList(input.rowsToCreate, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -129,7 +131,7 @@ export const serializeAws_restJson1BatchDeleteTableRowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/workbooks/{workbookId}/tables/{tableId}/rows/batchdelete"; if (input.workbookId !== undefined) { @@ -152,8 +154,10 @@ export const serializeAws_restJson1BatchDeleteTableRowsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.rowIds !== undefined && { rowIds: serializeAws_restJson1RowIdList(input.rowIds, context) }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.rowIds !== undefined && + input.rowIds !== null && { rowIds: serializeAws_restJson1RowIdList(input.rowIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -172,7 +176,7 @@ export const serializeAws_restJson1BatchUpdateTableRowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/workbooks/{workbookId}/tables/{tableId}/rows/batchupdate"; if (input.workbookId !== undefined) { @@ -195,10 +199,12 @@ export const serializeAws_restJson1BatchUpdateTableRowsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.rowsToUpdate !== undefined && { - rowsToUpdate: serializeAws_restJson1UpdateRowDataList(input.rowsToUpdate, context), - }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.rowsToUpdate !== undefined && + input.rowsToUpdate !== null && { + rowsToUpdate: serializeAws_restJson1UpdateRowDataList(input.rowsToUpdate, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -217,7 +223,7 @@ export const serializeAws_restJson1BatchUpsertTableRowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/workbooks/{workbookId}/tables/{tableId}/rows/batchupsert"; if (input.workbookId !== undefined) { @@ -240,10 +246,12 @@ export const serializeAws_restJson1BatchUpsertTableRowsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.rowsToUpsert !== undefined && { - rowsToUpsert: serializeAws_restJson1UpsertRowDataList(input.rowsToUpsert, context), - }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.rowsToUpsert !== undefined && + input.rowsToUpsert !== null && { + rowsToUpsert: serializeAws_restJson1UpsertRowDataList(input.rowsToUpsert, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -261,9 +269,7 @@ export const serializeAws_restJson1DescribeTableDataImportJobCommand = async ( input: DescribeTableDataImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/workbooks/{workbookId}/tables/{tableId}/import/{jobId}"; if (input.workbookId !== undefined) { const labelValue: string = input.workbookId; @@ -310,19 +316,18 @@ export const serializeAws_restJson1GetScreenDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/screendata"; let body: any; body = JSON.stringify({ - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.screenId !== undefined && { screenId: input.screenId }), - ...(input.variables !== undefined && { - variables: serializeAws_restJson1VariableValueMap(input.variables, context), - }), - ...(input.workbookId !== undefined && { workbookId: input.workbookId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.screenId !== undefined && input.screenId !== null && { screenId: input.screenId }), + ...(input.variables !== undefined && + input.variables !== null && { variables: serializeAws_restJson1VariableValueMap(input.variables, context) }), + ...(input.workbookId !== undefined && input.workbookId !== null && { workbookId: input.workbookId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -341,7 +346,7 @@ export const serializeAws_restJson1InvokeScreenAutomationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/workbooks/{workbookId}/apps/{appId}/screens/{screenId}/automations/{screenAutomationId}"; if (input.workbookId !== undefined) { @@ -382,11 +387,11 @@ export const serializeAws_restJson1InvokeScreenAutomationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.rowId !== undefined && { rowId: input.rowId }), - ...(input.variables !== undefined && { - variables: serializeAws_restJson1VariableValueMap(input.variables, context), - }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.rowId !== undefined && input.rowId !== null && { rowId: input.rowId }), + ...(input.variables !== undefined && + input.variables !== null && { variables: serializeAws_restJson1VariableValueMap(input.variables, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -404,9 +409,7 @@ export const serializeAws_restJson1ListTableColumnsCommand = async ( input: ListTableColumnsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/workbooks/{workbookId}/tables/{tableId}/columns"; if (input.workbookId !== undefined) { const labelValue: string = input.workbookId; @@ -448,7 +451,7 @@ export const serializeAws_restJson1ListTableRowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/workbooks/{workbookId}/tables/{tableId}/rows/list"; if (input.workbookId !== undefined) { @@ -471,9 +474,10 @@ export const serializeAws_restJson1ListTableRowsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.rowIds !== undefined && { rowIds: serializeAws_restJson1RowIdList(input.rowIds, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.rowIds !== undefined && + input.rowIds !== null && { rowIds: serializeAws_restJson1RowIdList(input.rowIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -491,9 +495,7 @@ export const serializeAws_restJson1ListTablesCommand = async ( input: ListTablesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/workbooks/{workbookId}/tables"; if (input.workbookId !== undefined) { const labelValue: string = input.workbookId; @@ -527,7 +529,7 @@ export const serializeAws_restJson1QueryTableRowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/workbooks/{workbookId}/tables/{tableId}/rows/query"; if (input.workbookId !== undefined) { @@ -550,11 +552,10 @@ export const serializeAws_restJson1QueryTableRowsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.filterFormula !== undefined && { - filterFormula: serializeAws_restJson1Filter(input.filterFormula, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filterFormula !== undefined && + input.filterFormula !== null && { filterFormula: serializeAws_restJson1Filter(input.filterFormula, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -573,7 +574,7 @@ export const serializeAws_restJson1StartTableDataImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/workbooks/{workbookId}/tables/{destinationTableId}/import"; if (input.workbookId !== undefined) { @@ -596,14 +597,15 @@ export const serializeAws_restJson1StartTableDataImportJobCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.dataFormat !== undefined && { dataFormat: input.dataFormat }), - ...(input.dataSource !== undefined && { - dataSource: serializeAws_restJson1ImportDataSource(input.dataSource, context), - }), - ...(input.importOptions !== undefined && { - importOptions: serializeAws_restJson1ImportOptions(input.importOptions, context), - }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.dataFormat !== undefined && input.dataFormat !== null && { dataFormat: input.dataFormat }), + ...(input.dataSource !== undefined && + input.dataSource !== null && { dataSource: serializeAws_restJson1ImportDataSource(input.dataSource, context) }), + ...(input.importOptions !== undefined && + input.importOptions !== null && { + importOptions: serializeAws_restJson1ImportOptions(input.importOptions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2129,21 +2131,29 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1CellInput = (input: CellInput, context: __SerdeContext): any => { return { - ...(input.fact !== undefined && { fact: input.fact }), + ...(input.fact !== undefined && input.fact !== null && { fact: input.fact }), }; }; const serializeAws_restJson1CreateRowData = (input: CreateRowData, context: __SerdeContext): any => { return { - ...(input.batchItemId !== undefined && { batchItemId: input.batchItemId }), - ...(input.cellsToCreate !== undefined && { - cellsToCreate: serializeAws_restJson1RowDataInput(input.cellsToCreate, context), - }), + ...(input.batchItemId !== undefined && input.batchItemId !== null && { batchItemId: input.batchItemId }), + ...(input.cellsToCreate !== undefined && + input.cellsToCreate !== null && { + cellsToCreate: serializeAws_restJson1RowDataInput(input.cellsToCreate, context), + }), }; }; const serializeAws_restJson1CreateRowDataList = (input: CreateRowData[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CreateRowData(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CreateRowData(entry, context); + }); }; const serializeAws_restJson1DelimitedTextImportOptions = ( @@ -2151,25 +2161,26 @@ const serializeAws_restJson1DelimitedTextImportOptions = ( context: __SerdeContext ): any => { return { - ...(input.dataCharacterEncoding !== undefined && { dataCharacterEncoding: input.dataCharacterEncoding }), - ...(input.delimiter !== undefined && { delimiter: input.delimiter }), - ...(input.hasHeaderRow !== undefined && { hasHeaderRow: input.hasHeaderRow }), - ...(input.ignoreEmptyRows !== undefined && { ignoreEmptyRows: input.ignoreEmptyRows }), + ...(input.dataCharacterEncoding !== undefined && + input.dataCharacterEncoding !== null && { dataCharacterEncoding: input.dataCharacterEncoding }), + ...(input.delimiter !== undefined && input.delimiter !== null && { delimiter: input.delimiter }), + ...(input.hasHeaderRow !== undefined && input.hasHeaderRow !== null && { hasHeaderRow: input.hasHeaderRow }), + ...(input.ignoreEmptyRows !== undefined && + input.ignoreEmptyRows !== null && { ignoreEmptyRows: input.ignoreEmptyRows }), }; }; const serializeAws_restJson1DestinationOptions = (input: DestinationOptions, context: __SerdeContext): any => { return { - ...(input.columnMap !== undefined && { - columnMap: serializeAws_restJson1ImportColumnMap(input.columnMap, context), - }), + ...(input.columnMap !== undefined && + input.columnMap !== null && { columnMap: serializeAws_restJson1ImportColumnMap(input.columnMap, context) }), }; }; const serializeAws_restJson1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.contextRowId !== undefined && { contextRowId: input.contextRowId }), - ...(input.formula !== undefined && { formula: input.formula }), + ...(input.contextRowId !== undefined && input.contextRowId !== null && { contextRowId: input.contextRowId }), + ...(input.formula !== undefined && input.formula !== null && { formula: input.formula }), }; }; @@ -2178,51 +2189,68 @@ const serializeAws_restJson1ImportColumnMap = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: SourceDataColumnProperties }, [key, value]: [string, any]) => ({ - ...acc, - [key]: serializeAws_restJson1SourceDataColumnProperties(value, context), - }), + (acc: { [key: string]: SourceDataColumnProperties }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_restJson1SourceDataColumnProperties(value, context), + }; + }, {} ); }; const serializeAws_restJson1ImportDataSource = (input: ImportDataSource, context: __SerdeContext): any => { return { - ...(input.dataSourceConfig !== undefined && { - dataSourceConfig: serializeAws_restJson1ImportDataSourceConfig(input.dataSourceConfig, context), - }), + ...(input.dataSourceConfig !== undefined && + input.dataSourceConfig !== null && { + dataSourceConfig: serializeAws_restJson1ImportDataSourceConfig(input.dataSourceConfig, context), + }), }; }; const serializeAws_restJson1ImportDataSourceConfig = (input: ImportDataSourceConfig, context: __SerdeContext): any => { return { - ...(input.dataSourceUrl !== undefined && { dataSourceUrl: input.dataSourceUrl }), + ...(input.dataSourceUrl !== undefined && input.dataSourceUrl !== null && { dataSourceUrl: input.dataSourceUrl }), }; }; const serializeAws_restJson1ImportOptions = (input: ImportOptions, context: __SerdeContext): any => { return { - ...(input.delimitedTextOptions !== undefined && { - delimitedTextOptions: serializeAws_restJson1DelimitedTextImportOptions(input.delimitedTextOptions, context), - }), - ...(input.destinationOptions !== undefined && { - destinationOptions: serializeAws_restJson1DestinationOptions(input.destinationOptions, context), - }), + ...(input.delimitedTextOptions !== undefined && + input.delimitedTextOptions !== null && { + delimitedTextOptions: serializeAws_restJson1DelimitedTextImportOptions(input.delimitedTextOptions, context), + }), + ...(input.destinationOptions !== undefined && + input.destinationOptions !== null && { + destinationOptions: serializeAws_restJson1DestinationOptions(input.destinationOptions, context), + }), }; }; const serializeAws_restJson1RowDataInput = (input: { [key: string]: CellInput }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: CellInput }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: CellInput }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1CellInput(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1RowIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SourceDataColumnProperties = ( @@ -2230,40 +2258,57 @@ const serializeAws_restJson1SourceDataColumnProperties = ( context: __SerdeContext ): any => { return { - ...(input.columnIndex !== undefined && { columnIndex: input.columnIndex }), + ...(input.columnIndex !== undefined && input.columnIndex !== null && { columnIndex: input.columnIndex }), }; }; const serializeAws_restJson1UpdateRowData = (input: UpdateRowData, context: __SerdeContext): any => { return { - ...(input.cellsToUpdate !== undefined && { - cellsToUpdate: serializeAws_restJson1RowDataInput(input.cellsToUpdate, context), - }), - ...(input.rowId !== undefined && { rowId: input.rowId }), + ...(input.cellsToUpdate !== undefined && + input.cellsToUpdate !== null && { + cellsToUpdate: serializeAws_restJson1RowDataInput(input.cellsToUpdate, context), + }), + ...(input.rowId !== undefined && input.rowId !== null && { rowId: input.rowId }), }; }; const serializeAws_restJson1UpdateRowDataList = (input: UpdateRowData[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1UpdateRowData(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1UpdateRowData(entry, context); + }); }; const serializeAws_restJson1UpsertRowData = (input: UpsertRowData, context: __SerdeContext): any => { return { - ...(input.batchItemId !== undefined && { batchItemId: input.batchItemId }), - ...(input.cellsToUpdate !== undefined && { - cellsToUpdate: serializeAws_restJson1RowDataInput(input.cellsToUpdate, context), - }), - ...(input.filter !== undefined && { filter: serializeAws_restJson1Filter(input.filter, context) }), + ...(input.batchItemId !== undefined && input.batchItemId !== null && { batchItemId: input.batchItemId }), + ...(input.cellsToUpdate !== undefined && + input.cellsToUpdate !== null && { + cellsToUpdate: serializeAws_restJson1RowDataInput(input.cellsToUpdate, context), + }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_restJson1Filter(input.filter, context) }), }; }; const serializeAws_restJson1UpsertRowDataList = (input: UpsertRowData[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1UpsertRowData(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1UpsertRowData(entry, context); + }); }; const serializeAws_restJson1VariableValue = (input: VariableValue, context: __SerdeContext): any => { return { - ...(input.rawValue !== undefined && { rawValue: input.rawValue }), + ...(input.rawValue !== undefined && input.rawValue !== null && { rawValue: input.rawValue }), }; }; @@ -2271,13 +2316,15 @@ const serializeAws_restJson1VariableValueMap = ( input: { [key: string]: VariableValue }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: VariableValue }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: VariableValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1VariableValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Cell = (output: any, context: __SerdeContext): Cell => { @@ -2291,7 +2338,14 @@ const deserializeAws_restJson1Cell = (output: any, context: __SerdeContext): Cel }; const deserializeAws_restJson1Cells = (output: any, context: __SerdeContext): Cell[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Cell(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Cell(entry, context); + }); }; const deserializeAws_restJson1ColumnMetadata = (output: any, context: __SerdeContext): ColumnMetadata => { @@ -2302,13 +2356,15 @@ const deserializeAws_restJson1ColumnMetadata = (output: any, context: __SerdeCon }; const deserializeAws_restJson1CreatedRowsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DataItem = (output: any, context: __SerdeContext): DataItem => { @@ -2322,7 +2378,14 @@ const deserializeAws_restJson1DataItem = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1DataItems = (output: any, context: __SerdeContext): DataItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataItem(entry, context); + }); }; const deserializeAws_restJson1DelimitedTextImportOptions = ( @@ -2358,7 +2421,14 @@ const deserializeAws_restJson1FailedBatchItem = (output: any, context: __SerdeCo }; const deserializeAws_restJson1FailedBatchItems = (output: any, context: __SerdeContext): FailedBatchItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FailedBatchItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FailedBatchItem(entry, context); + }); }; const deserializeAws_restJson1ImportColumnMap = ( @@ -2366,10 +2436,15 @@ const deserializeAws_restJson1ImportColumnMap = ( context: __SerdeContext ): { [key: string]: SourceDataColumnProperties } => { return Object.entries(output).reduce( - (acc: { [key: string]: SourceDataColumnProperties }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1SourceDataColumnProperties(value, context), - }), + (acc: { [key: string]: SourceDataColumnProperties }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1SourceDataColumnProperties(value, context), + }; + }, {} ); }; @@ -2414,11 +2489,25 @@ const deserializeAws_restJson1ImportOptions = (output: any, context: __SerdeCont }; const deserializeAws_restJson1ResourceIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ResultHeader = (output: any, context: __SerdeContext): ColumnMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ColumnMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ColumnMetadata(entry, context); + }); }; const deserializeAws_restJson1ResultRow = (output: any, context: __SerdeContext): ResultRow => { @@ -2432,7 +2521,14 @@ const deserializeAws_restJson1ResultRow = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1ResultRows = (output: any, context: __SerdeContext): ResultRow[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResultRow(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResultRow(entry, context); + }); }; const deserializeAws_restJson1ResultSet = (output: any, context: __SerdeContext): ResultSet => { @@ -2449,17 +2545,26 @@ const deserializeAws_restJson1ResultSet = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1ResultSetMap = (output: any, context: __SerdeContext): { [key: string]: ResultSet } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ResultSet }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ResultSet }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ResultSet(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1RowIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SourceDataColumnProperties = ( @@ -2489,7 +2594,14 @@ const deserializeAws_restJson1TableColumn = (output: any, context: __SerdeContex }; const deserializeAws_restJson1TableColumns = (output: any, context: __SerdeContext): TableColumn[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TableColumn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TableColumn(entry, context); + }); }; const deserializeAws_restJson1TableDataImportJobMetadata = ( @@ -2527,11 +2639,25 @@ const deserializeAws_restJson1TableRow = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1TableRows = (output: any, context: __SerdeContext): TableRow[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TableRow(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TableRow(entry, context); + }); }; const deserializeAws_restJson1Tables = (output: any, context: __SerdeContext): Table[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Table(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Table(entry, context); + }); }; const deserializeAws_restJson1UpsertRowsResult = (output: any, context: __SerdeContext): UpsertRowsResult => { @@ -2548,13 +2674,15 @@ const deserializeAws_restJson1UpsertRowsResultMap = ( output: any, context: __SerdeContext ): { [key: string]: UpsertRowsResult } => { - return Object.entries(output).reduce( - (acc: { [key: string]: UpsertRowsResult }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: UpsertRowsResult }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1UpsertRowsResult(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2577,6 +2705,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iam/protocols/Aws_query.ts b/clients/client-iam/protocols/Aws_query.ts index 7621c741876e..4c25ba80ddec 100644 --- a/clients/client-iam/protocols/Aws_query.ts +++ b/clients/client-iam/protocols/Aws_query.ts @@ -653,7 +653,7 @@ export const serializeAws_queryAddClientIDToOpenIDConnectProviderCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -669,7 +669,7 @@ export const serializeAws_queryAddRoleToInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -685,7 +685,7 @@ export const serializeAws_queryAddUserToGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -701,7 +701,7 @@ export const serializeAws_queryAttachGroupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -717,7 +717,7 @@ export const serializeAws_queryAttachRolePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -733,7 +733,7 @@ export const serializeAws_queryAttachUserPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -749,7 +749,7 @@ export const serializeAws_queryChangePasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -765,7 +765,7 @@ export const serializeAws_queryCreateAccessKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -781,7 +781,7 @@ export const serializeAws_queryCreateAccountAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -797,7 +797,7 @@ export const serializeAws_queryCreateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -813,7 +813,7 @@ export const serializeAws_queryCreateInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -829,7 +829,7 @@ export const serializeAws_queryCreateLoginProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -845,7 +845,7 @@ export const serializeAws_queryCreateOpenIDConnectProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -861,7 +861,7 @@ export const serializeAws_queryCreatePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -877,7 +877,7 @@ export const serializeAws_queryCreatePolicyVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -893,7 +893,7 @@ export const serializeAws_queryCreateRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -909,7 +909,7 @@ export const serializeAws_queryCreateSAMLProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -925,7 +925,7 @@ export const serializeAws_queryCreateServiceLinkedRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -941,7 +941,7 @@ export const serializeAws_queryCreateServiceSpecificCredentialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -957,7 +957,7 @@ export const serializeAws_queryCreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -973,7 +973,7 @@ export const serializeAws_queryCreateVirtualMFADeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -989,7 +989,7 @@ export const serializeAws_queryDeactivateMFADeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1005,7 +1005,7 @@ export const serializeAws_queryDeleteAccessKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1021,7 +1021,7 @@ export const serializeAws_queryDeleteAccountAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1037,7 +1037,7 @@ export const serializeAws_queryDeleteAccountPasswordPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DeleteAccountPasswordPolicy", @@ -1051,7 +1051,7 @@ export const serializeAws_queryDeleteGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1067,7 +1067,7 @@ export const serializeAws_queryDeleteGroupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1083,7 +1083,7 @@ export const serializeAws_queryDeleteInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1099,7 +1099,7 @@ export const serializeAws_queryDeleteLoginProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1115,7 +1115,7 @@ export const serializeAws_queryDeleteOpenIDConnectProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1131,7 +1131,7 @@ export const serializeAws_queryDeletePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1147,7 +1147,7 @@ export const serializeAws_queryDeletePolicyVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1163,7 +1163,7 @@ export const serializeAws_queryDeleteRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1179,7 +1179,7 @@ export const serializeAws_queryDeleteRolePermissionsBoundaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1195,7 +1195,7 @@ export const serializeAws_queryDeleteRolePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1211,7 +1211,7 @@ export const serializeAws_queryDeleteSAMLProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1227,7 +1227,7 @@ export const serializeAws_queryDeleteServerCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1243,7 +1243,7 @@ export const serializeAws_queryDeleteServiceLinkedRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1259,7 +1259,7 @@ export const serializeAws_queryDeleteServiceSpecificCredentialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1275,7 +1275,7 @@ export const serializeAws_queryDeleteSigningCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1291,7 +1291,7 @@ export const serializeAws_queryDeleteSSHPublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1307,7 +1307,7 @@ export const serializeAws_queryDeleteUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1323,7 +1323,7 @@ export const serializeAws_queryDeleteUserPermissionsBoundaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1339,7 +1339,7 @@ export const serializeAws_queryDeleteUserPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1355,7 +1355,7 @@ export const serializeAws_queryDeleteVirtualMFADeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1371,7 +1371,7 @@ export const serializeAws_queryDetachGroupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1387,7 +1387,7 @@ export const serializeAws_queryDetachRolePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1403,7 +1403,7 @@ export const serializeAws_queryDetachUserPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1419,7 +1419,7 @@ export const serializeAws_queryEnableMFADeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1435,7 +1435,7 @@ export const serializeAws_queryGenerateCredentialReportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "GenerateCredentialReport", @@ -1449,7 +1449,7 @@ export const serializeAws_queryGenerateOrganizationsAccessReportCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1465,7 +1465,7 @@ export const serializeAws_queryGenerateServiceLastAccessedDetailsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1481,7 +1481,7 @@ export const serializeAws_queryGetAccessKeyLastUsedCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1497,7 +1497,7 @@ export const serializeAws_queryGetAccountAuthorizationDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1513,7 +1513,7 @@ export const serializeAws_queryGetAccountPasswordPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "GetAccountPasswordPolicy", @@ -1527,7 +1527,7 @@ export const serializeAws_queryGetAccountSummaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "GetAccountSummary", @@ -1541,7 +1541,7 @@ export const serializeAws_queryGetContextKeysForCustomPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1557,7 +1557,7 @@ export const serializeAws_queryGetContextKeysForPrincipalPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1573,7 +1573,7 @@ export const serializeAws_queryGetCredentialReportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "GetCredentialReport", @@ -1587,7 +1587,7 @@ export const serializeAws_queryGetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1603,7 +1603,7 @@ export const serializeAws_queryGetGroupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1619,7 +1619,7 @@ export const serializeAws_queryGetInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1635,7 +1635,7 @@ export const serializeAws_queryGetLoginProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1651,7 +1651,7 @@ export const serializeAws_queryGetOpenIDConnectProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1667,7 +1667,7 @@ export const serializeAws_queryGetOrganizationsAccessReportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1683,7 +1683,7 @@ export const serializeAws_queryGetPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1699,7 +1699,7 @@ export const serializeAws_queryGetPolicyVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1715,7 +1715,7 @@ export const serializeAws_queryGetRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1731,7 +1731,7 @@ export const serializeAws_queryGetRolePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1747,7 +1747,7 @@ export const serializeAws_queryGetSAMLProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1763,7 +1763,7 @@ export const serializeAws_queryGetServerCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1779,7 +1779,7 @@ export const serializeAws_queryGetServiceLastAccessedDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1795,7 +1795,7 @@ export const serializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1811,7 +1811,7 @@ export const serializeAws_queryGetServiceLinkedRoleDeletionStatusCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1827,7 +1827,7 @@ export const serializeAws_queryGetSSHPublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1843,7 +1843,7 @@ export const serializeAws_queryGetUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1859,7 +1859,7 @@ export const serializeAws_queryGetUserPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1875,7 +1875,7 @@ export const serializeAws_queryListAccessKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1891,7 +1891,7 @@ export const serializeAws_queryListAccountAliasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1907,7 +1907,7 @@ export const serializeAws_queryListAttachedGroupPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1923,7 +1923,7 @@ export const serializeAws_queryListAttachedRolePoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1939,7 +1939,7 @@ export const serializeAws_queryListAttachedUserPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1955,7 +1955,7 @@ export const serializeAws_queryListEntitiesForPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1971,7 +1971,7 @@ export const serializeAws_queryListGroupPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1987,7 +1987,7 @@ export const serializeAws_queryListGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2003,7 +2003,7 @@ export const serializeAws_queryListGroupsForUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2019,7 +2019,7 @@ export const serializeAws_queryListInstanceProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2035,7 +2035,7 @@ export const serializeAws_queryListInstanceProfilesForRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2051,7 +2051,7 @@ export const serializeAws_queryListMFADevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2067,7 +2067,7 @@ export const serializeAws_queryListOpenIDConnectProvidersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2083,7 +2083,7 @@ export const serializeAws_queryListPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2099,7 +2099,7 @@ export const serializeAws_queryListPoliciesGrantingServiceAccessCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2115,7 +2115,7 @@ export const serializeAws_queryListPolicyVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2131,7 +2131,7 @@ export const serializeAws_queryListRolePoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2147,7 +2147,7 @@ export const serializeAws_queryListRolesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2163,7 +2163,7 @@ export const serializeAws_queryListRoleTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2179,7 +2179,7 @@ export const serializeAws_queryListSAMLProvidersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2195,7 +2195,7 @@ export const serializeAws_queryListServerCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2211,7 +2211,7 @@ export const serializeAws_queryListServiceSpecificCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2227,7 +2227,7 @@ export const serializeAws_queryListSigningCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2243,7 +2243,7 @@ export const serializeAws_queryListSSHPublicKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2259,7 +2259,7 @@ export const serializeAws_queryListUserPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2275,7 +2275,7 @@ export const serializeAws_queryListUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2291,7 +2291,7 @@ export const serializeAws_queryListUserTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2307,7 +2307,7 @@ export const serializeAws_queryListVirtualMFADevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2323,7 +2323,7 @@ export const serializeAws_queryPutGroupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2339,7 +2339,7 @@ export const serializeAws_queryPutRolePermissionsBoundaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2355,7 +2355,7 @@ export const serializeAws_queryPutRolePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2371,7 +2371,7 @@ export const serializeAws_queryPutUserPermissionsBoundaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2387,7 +2387,7 @@ export const serializeAws_queryPutUserPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2403,7 +2403,7 @@ export const serializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2419,7 +2419,7 @@ export const serializeAws_queryRemoveRoleFromInstanceProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2435,7 +2435,7 @@ export const serializeAws_queryRemoveUserFromGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2451,7 +2451,7 @@ export const serializeAws_queryResetServiceSpecificCredentialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2467,7 +2467,7 @@ export const serializeAws_queryResyncMFADeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2483,7 +2483,7 @@ export const serializeAws_querySetDefaultPolicyVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2499,7 +2499,7 @@ export const serializeAws_querySetSecurityTokenServicePreferencesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2515,7 +2515,7 @@ export const serializeAws_querySimulateCustomPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2531,7 +2531,7 @@ export const serializeAws_querySimulatePrincipalPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2547,7 +2547,7 @@ export const serializeAws_queryTagRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2563,7 +2563,7 @@ export const serializeAws_queryTagUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2579,7 +2579,7 @@ export const serializeAws_queryUntagRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2595,7 +2595,7 @@ export const serializeAws_queryUntagUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2611,7 +2611,7 @@ export const serializeAws_queryUpdateAccessKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2627,7 +2627,7 @@ export const serializeAws_queryUpdateAccountPasswordPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2643,7 +2643,7 @@ export const serializeAws_queryUpdateAssumeRolePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2659,7 +2659,7 @@ export const serializeAws_queryUpdateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2675,7 +2675,7 @@ export const serializeAws_queryUpdateLoginProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2691,7 +2691,7 @@ export const serializeAws_queryUpdateOpenIDConnectProviderThumbprintCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2707,7 +2707,7 @@ export const serializeAws_queryUpdateRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2723,7 +2723,7 @@ export const serializeAws_queryUpdateRoleDescriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2739,7 +2739,7 @@ export const serializeAws_queryUpdateSAMLProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2755,7 +2755,7 @@ export const serializeAws_queryUpdateServerCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2771,7 +2771,7 @@ export const serializeAws_queryUpdateServiceSpecificCredentialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2787,7 +2787,7 @@ export const serializeAws_queryUpdateSigningCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2803,7 +2803,7 @@ export const serializeAws_queryUpdateSSHPublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2819,7 +2819,7 @@ export const serializeAws_queryUpdateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2835,7 +2835,7 @@ export const serializeAws_queryUploadServerCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2851,7 +2851,7 @@ export const serializeAws_queryUploadSigningCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2867,7 +2867,7 @@ export const serializeAws_queryUploadSSHPublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -13006,6 +13006,9 @@ const serializeAws_queryActionNameListType = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -13017,10 +13020,10 @@ const serializeAws_queryAddClientIDToOpenIDConnectProviderRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.OpenIDConnectProviderArn !== undefined) { + if (input.OpenIDConnectProviderArn !== undefined && input.OpenIDConnectProviderArn !== null) { entries["OpenIDConnectProviderArn"] = input.OpenIDConnectProviderArn; } - if (input.ClientID !== undefined) { + if (input.ClientID !== undefined && input.ClientID !== null) { entries["ClientID"] = input.ClientID; } return entries; @@ -13031,10 +13034,10 @@ const serializeAws_queryAddRoleToInstanceProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceProfileName !== undefined) { + if (input.InstanceProfileName !== undefined && input.InstanceProfileName !== null) { entries["InstanceProfileName"] = input.InstanceProfileName; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -13042,10 +13045,10 @@ const serializeAws_queryAddRoleToInstanceProfileRequest = ( const serializeAws_queryAddUserToGroupRequest = (input: AddUserToGroupRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13053,10 +13056,10 @@ const serializeAws_queryAddUserToGroupRequest = (input: AddUserToGroupRequest, c const serializeAws_queryAttachGroupPolicyRequest = (input: AttachGroupPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } return entries; @@ -13064,10 +13067,10 @@ const serializeAws_queryAttachGroupPolicyRequest = (input: AttachGroupPolicyRequ const serializeAws_queryAttachRolePolicyRequest = (input: AttachRolePolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -13075,10 +13078,10 @@ const serializeAws_queryAttachRolePolicyRequest = (input: AttachRolePolicyReques const serializeAws_queryAttachUserPolicyRequest = (input: AttachUserPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } return entries; @@ -13086,10 +13089,10 @@ const serializeAws_queryAttachUserPolicyRequest = (input: AttachUserPolicyReques const serializeAws_queryChangePasswordRequest = (input: ChangePasswordRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.NewPassword !== undefined) { + if (input.NewPassword !== undefined && input.NewPassword !== null) { entries["NewPassword"] = input.NewPassword; } - if (input.OldPassword !== undefined) { + if (input.OldPassword !== undefined && input.OldPassword !== null) { entries["OldPassword"] = input.OldPassword; } return entries; @@ -13099,6 +13102,9 @@ const serializeAws_queryclientIDListType = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -13107,13 +13113,13 @@ const serializeAws_queryclientIDListType = (input: string[], context: __SerdeCon const serializeAws_queryContextEntry = (input: ContextEntry, context: __SerdeContext): any => { const entries: any = {}; - if (input.ContextKeyName !== undefined) { + if (input.ContextKeyName !== undefined && input.ContextKeyName !== null) { entries["ContextKeyName"] = input.ContextKeyName; } - if (input.ContextKeyType !== undefined) { + if (input.ContextKeyType !== undefined && input.ContextKeyType !== null) { entries["ContextKeyType"] = input.ContextKeyType; } - if (input.ContextKeyValues !== undefined) { + if (input.ContextKeyValues !== undefined && input.ContextKeyValues !== null) { const memberEntries = serializeAws_queryContextKeyValueListType(input.ContextKeyValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ContextKeyValues.${key}`; @@ -13127,6 +13133,9 @@ const serializeAws_queryContextEntryListType = (input: ContextEntry[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryContextEntry(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -13140,6 +13149,9 @@ const serializeAws_queryContextKeyValueListType = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -13148,7 +13160,7 @@ const serializeAws_queryContextKeyValueListType = (input: string[], context: __S const serializeAws_queryCreateAccessKeyRequest = (input: CreateAccessKeyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13159,7 +13171,7 @@ const serializeAws_queryCreateAccountAliasRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AccountAlias !== undefined) { + if (input.AccountAlias !== undefined && input.AccountAlias !== null) { entries["AccountAlias"] = input.AccountAlias; } return entries; @@ -13167,10 +13179,10 @@ const serializeAws_queryCreateAccountAliasRequest = ( const serializeAws_queryCreateGroupRequest = (input: CreateGroupRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Path !== undefined) { + if (input.Path !== undefined && input.Path !== null) { entries["Path"] = input.Path; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } return entries; @@ -13181,10 +13193,10 @@ const serializeAws_queryCreateInstanceProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Path !== undefined) { + if (input.Path !== undefined && input.Path !== null) { entries["Path"] = input.Path; } - if (input.InstanceProfileName !== undefined) { + if (input.InstanceProfileName !== undefined && input.InstanceProfileName !== null) { entries["InstanceProfileName"] = input.InstanceProfileName; } return entries; @@ -13195,13 +13207,13 @@ const serializeAws_queryCreateLoginProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Password !== undefined) { + if (input.Password !== undefined && input.Password !== null) { entries["Password"] = input.Password; } - if (input.PasswordResetRequired !== undefined) { + if (input.PasswordResetRequired !== undefined && input.PasswordResetRequired !== null) { entries["PasswordResetRequired"] = input.PasswordResetRequired; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13212,17 +13224,17 @@ const serializeAws_queryCreateOpenIDConnectProviderRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Url !== undefined) { + if (input.Url !== undefined && input.Url !== null) { entries["Url"] = input.Url; } - if (input.ClientIDList !== undefined) { + if (input.ClientIDList !== undefined && input.ClientIDList !== null) { const memberEntries = serializeAws_queryclientIDListType(input.ClientIDList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClientIDList.${key}`; entries[loc] = value; }); } - if (input.ThumbprintList !== undefined) { + if (input.ThumbprintList !== undefined && input.ThumbprintList !== null) { const memberEntries = serializeAws_querythumbprintListType(input.ThumbprintList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ThumbprintList.${key}`; @@ -13234,16 +13246,16 @@ const serializeAws_queryCreateOpenIDConnectProviderRequest = ( const serializeAws_queryCreatePolicyRequest = (input: CreatePolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyDocument !== undefined) { + if (input.PolicyDocument !== undefined && input.PolicyDocument !== null) { entries["PolicyDocument"] = input.PolicyDocument; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Path !== undefined) { + if (input.Path !== undefined && input.Path !== null) { entries["Path"] = input.Path; } return entries; @@ -13254,13 +13266,13 @@ const serializeAws_queryCreatePolicyVersionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyDocument !== undefined) { + if (input.PolicyDocument !== undefined && input.PolicyDocument !== null) { entries["PolicyDocument"] = input.PolicyDocument; } - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } - if (input.SetAsDefault !== undefined) { + if (input.SetAsDefault !== undefined && input.SetAsDefault !== null) { entries["SetAsDefault"] = input.SetAsDefault; } return entries; @@ -13268,29 +13280,29 @@ const serializeAws_queryCreatePolicyVersionRequest = ( const serializeAws_queryCreateRoleRequest = (input: CreateRoleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PermissionsBoundary !== undefined) { + if (input.PermissionsBoundary !== undefined && input.PermissionsBoundary !== null) { entries["PermissionsBoundary"] = input.PermissionsBoundary; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Path !== undefined) { + if (input.Path !== undefined && input.Path !== null) { entries["Path"] = input.Path; } - if (input.MaxSessionDuration !== undefined) { + if (input.MaxSessionDuration !== undefined && input.MaxSessionDuration !== null) { entries["MaxSessionDuration"] = input.MaxSessionDuration; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_querytagListType(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.AssumeRolePolicyDocument !== undefined) { + if (input.AssumeRolePolicyDocument !== undefined && input.AssumeRolePolicyDocument !== null) { entries["AssumeRolePolicyDocument"] = input.AssumeRolePolicyDocument; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -13301,10 +13313,10 @@ const serializeAws_queryCreateSAMLProviderRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SAMLMetadataDocument !== undefined) { + if (input.SAMLMetadataDocument !== undefined && input.SAMLMetadataDocument !== null) { entries["SAMLMetadataDocument"] = input.SAMLMetadataDocument; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -13315,13 +13327,13 @@ const serializeAws_queryCreateServiceLinkedRoleRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CustomSuffix !== undefined) { + if (input.CustomSuffix !== undefined && input.CustomSuffix !== null) { entries["CustomSuffix"] = input.CustomSuffix; } - if (input.AWSServiceName !== undefined) { + if (input.AWSServiceName !== undefined && input.AWSServiceName !== null) { entries["AWSServiceName"] = input.AWSServiceName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -13332,10 +13344,10 @@ const serializeAws_queryCreateServiceSpecificCredentialRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.ServiceName !== undefined) { + if (input.ServiceName !== undefined && input.ServiceName !== null) { entries["ServiceName"] = input.ServiceName; } return entries; @@ -13343,20 +13355,20 @@ const serializeAws_queryCreateServiceSpecificCredentialRequest = ( const serializeAws_queryCreateUserRequest = (input: CreateUserRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.Path !== undefined) { + if (input.Path !== undefined && input.Path !== null) { entries["Path"] = input.Path; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_querytagListType(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.PermissionsBoundary !== undefined) { + if (input.PermissionsBoundary !== undefined && input.PermissionsBoundary !== null) { entries["PermissionsBoundary"] = input.PermissionsBoundary; } return entries; @@ -13367,10 +13379,10 @@ const serializeAws_queryCreateVirtualMFADeviceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VirtualMFADeviceName !== undefined) { + if (input.VirtualMFADeviceName !== undefined && input.VirtualMFADeviceName !== null) { entries["VirtualMFADeviceName"] = input.VirtualMFADeviceName; } - if (input.Path !== undefined) { + if (input.Path !== undefined && input.Path !== null) { entries["Path"] = input.Path; } return entries; @@ -13381,10 +13393,10 @@ const serializeAws_queryDeactivateMFADeviceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.SerialNumber !== undefined) { + if (input.SerialNumber !== undefined && input.SerialNumber !== null) { entries["SerialNumber"] = input.SerialNumber; } return entries; @@ -13392,10 +13404,10 @@ const serializeAws_queryDeactivateMFADeviceRequest = ( const serializeAws_queryDeleteAccessKeyRequest = (input: DeleteAccessKeyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AccessKeyId !== undefined) { + if (input.AccessKeyId !== undefined && input.AccessKeyId !== null) { entries["AccessKeyId"] = input.AccessKeyId; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13406,7 +13418,7 @@ const serializeAws_queryDeleteAccountAliasRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AccountAlias !== undefined) { + if (input.AccountAlias !== undefined && input.AccountAlias !== null) { entries["AccountAlias"] = input.AccountAlias; } return entries; @@ -13414,10 +13426,10 @@ const serializeAws_queryDeleteAccountAliasRequest = ( const serializeAws_queryDeleteGroupPolicyRequest = (input: DeleteGroupPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } return entries; @@ -13425,7 +13437,7 @@ const serializeAws_queryDeleteGroupPolicyRequest = (input: DeleteGroupPolicyRequ const serializeAws_queryDeleteGroupRequest = (input: DeleteGroupRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } return entries; @@ -13436,7 +13448,7 @@ const serializeAws_queryDeleteInstanceProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceProfileName !== undefined) { + if (input.InstanceProfileName !== undefined && input.InstanceProfileName !== null) { entries["InstanceProfileName"] = input.InstanceProfileName; } return entries; @@ -13447,7 +13459,7 @@ const serializeAws_queryDeleteLoginProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13458,7 +13470,7 @@ const serializeAws_queryDeleteOpenIDConnectProviderRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.OpenIDConnectProviderArn !== undefined) { + if (input.OpenIDConnectProviderArn !== undefined && input.OpenIDConnectProviderArn !== null) { entries["OpenIDConnectProviderArn"] = input.OpenIDConnectProviderArn; } return entries; @@ -13466,7 +13478,7 @@ const serializeAws_queryDeleteOpenIDConnectProviderRequest = ( const serializeAws_queryDeletePolicyRequest = (input: DeletePolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } return entries; @@ -13477,10 +13489,10 @@ const serializeAws_queryDeletePolicyVersionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VersionId !== undefined) { + if (input.VersionId !== undefined && input.VersionId !== null) { entries["VersionId"] = input.VersionId; } - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } return entries; @@ -13491,7 +13503,7 @@ const serializeAws_queryDeleteRolePermissionsBoundaryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -13499,10 +13511,10 @@ const serializeAws_queryDeleteRolePermissionsBoundaryRequest = ( const serializeAws_queryDeleteRolePolicyRequest = (input: DeleteRolePolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } return entries; @@ -13510,7 +13522,7 @@ const serializeAws_queryDeleteRolePolicyRequest = (input: DeleteRolePolicyReques const serializeAws_queryDeleteRoleRequest = (input: DeleteRoleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -13521,7 +13533,7 @@ const serializeAws_queryDeleteSAMLProviderRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SAMLProviderArn !== undefined) { + if (input.SAMLProviderArn !== undefined && input.SAMLProviderArn !== null) { entries["SAMLProviderArn"] = input.SAMLProviderArn; } return entries; @@ -13532,7 +13544,7 @@ const serializeAws_queryDeleteServerCertificateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ServerCertificateName !== undefined) { + if (input.ServerCertificateName !== undefined && input.ServerCertificateName !== null) { entries["ServerCertificateName"] = input.ServerCertificateName; } return entries; @@ -13543,7 +13555,7 @@ const serializeAws_queryDeleteServiceLinkedRoleRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -13554,10 +13566,10 @@ const serializeAws_queryDeleteServiceSpecificCredentialRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.ServiceSpecificCredentialId !== undefined) { + if (input.ServiceSpecificCredentialId !== undefined && input.ServiceSpecificCredentialId !== null) { entries["ServiceSpecificCredentialId"] = input.ServiceSpecificCredentialId; } return entries; @@ -13568,10 +13580,10 @@ const serializeAws_queryDeleteSigningCertificateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CertificateId !== undefined) { + if (input.CertificateId !== undefined && input.CertificateId !== null) { entries["CertificateId"] = input.CertificateId; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13582,10 +13594,10 @@ const serializeAws_queryDeleteSSHPublicKeyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.SSHPublicKeyId !== undefined) { + if (input.SSHPublicKeyId !== undefined && input.SSHPublicKeyId !== null) { entries["SSHPublicKeyId"] = input.SSHPublicKeyId; } return entries; @@ -13596,7 +13608,7 @@ const serializeAws_queryDeleteUserPermissionsBoundaryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13604,10 +13616,10 @@ const serializeAws_queryDeleteUserPermissionsBoundaryRequest = ( const serializeAws_queryDeleteUserPolicyRequest = (input: DeleteUserPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } return entries; @@ -13615,7 +13627,7 @@ const serializeAws_queryDeleteUserPolicyRequest = (input: DeleteUserPolicyReques const serializeAws_queryDeleteUserRequest = (input: DeleteUserRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13626,7 +13638,7 @@ const serializeAws_queryDeleteVirtualMFADeviceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SerialNumber !== undefined) { + if (input.SerialNumber !== undefined && input.SerialNumber !== null) { entries["SerialNumber"] = input.SerialNumber; } return entries; @@ -13634,10 +13646,10 @@ const serializeAws_queryDeleteVirtualMFADeviceRequest = ( const serializeAws_queryDetachGroupPolicyRequest = (input: DetachGroupPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } return entries; @@ -13645,10 +13657,10 @@ const serializeAws_queryDetachGroupPolicyRequest = (input: DetachGroupPolicyRequ const serializeAws_queryDetachRolePolicyRequest = (input: DetachRolePolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -13656,10 +13668,10 @@ const serializeAws_queryDetachRolePolicyRequest = (input: DetachRolePolicyReques const serializeAws_queryDetachUserPolicyRequest = (input: DetachUserPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13667,16 +13679,16 @@ const serializeAws_queryDetachUserPolicyRequest = (input: DetachUserPolicyReques const serializeAws_queryEnableMFADeviceRequest = (input: EnableMFADeviceRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.SerialNumber !== undefined) { + if (input.SerialNumber !== undefined && input.SerialNumber !== null) { entries["SerialNumber"] = input.SerialNumber; } - if (input.AuthenticationCode2 !== undefined) { + if (input.AuthenticationCode2 !== undefined && input.AuthenticationCode2 !== null) { entries["AuthenticationCode2"] = input.AuthenticationCode2; } - if (input.AuthenticationCode1 !== undefined) { + if (input.AuthenticationCode1 !== undefined && input.AuthenticationCode1 !== null) { entries["AuthenticationCode1"] = input.AuthenticationCode1; } return entries; @@ -13686,6 +13698,9 @@ const serializeAws_queryentityListType = (input: (EntityType | string)[], contex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -13697,10 +13712,10 @@ const serializeAws_queryGenerateOrganizationsAccessReportRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.OrganizationsPolicyId !== undefined) { + if (input.OrganizationsPolicyId !== undefined && input.OrganizationsPolicyId !== null) { entries["OrganizationsPolicyId"] = input.OrganizationsPolicyId; } - if (input.EntityPath !== undefined) { + if (input.EntityPath !== undefined && input.EntityPath !== null) { entries["EntityPath"] = input.EntityPath; } return entries; @@ -13711,10 +13726,10 @@ const serializeAws_queryGenerateServiceLastAccessedDetailsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Granularity !== undefined) { + if (input.Granularity !== undefined && input.Granularity !== null) { entries["Granularity"] = input.Granularity; } - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } return entries; @@ -13725,7 +13740,7 @@ const serializeAws_queryGetAccessKeyLastUsedRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AccessKeyId !== undefined) { + if (input.AccessKeyId !== undefined && input.AccessKeyId !== null) { entries["AccessKeyId"] = input.AccessKeyId; } return entries; @@ -13736,17 +13751,17 @@ const serializeAws_queryGetAccountAuthorizationDetailsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const memberEntries = serializeAws_queryentityListType(input.Filter, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -13757,7 +13772,7 @@ const serializeAws_queryGetContextKeysForCustomPolicyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyInputList !== undefined) { + if (input.PolicyInputList !== undefined && input.PolicyInputList !== null) { const memberEntries = serializeAws_querySimulationPolicyListType(input.PolicyInputList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyInputList.${key}`; @@ -13772,14 +13787,14 @@ const serializeAws_queryGetContextKeysForPrincipalPolicyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyInputList !== undefined) { + if (input.PolicyInputList !== undefined && input.PolicyInputList !== null) { const memberEntries = serializeAws_querySimulationPolicyListType(input.PolicyInputList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyInputList.${key}`; entries[loc] = value; }); } - if (input.PolicySourceArn !== undefined) { + if (input.PolicySourceArn !== undefined && input.PolicySourceArn !== null) { entries["PolicySourceArn"] = input.PolicySourceArn; } return entries; @@ -13787,10 +13802,10 @@ const serializeAws_queryGetContextKeysForPrincipalPolicyRequest = ( const serializeAws_queryGetGroupPolicyRequest = (input: GetGroupPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } return entries; @@ -13798,13 +13813,13 @@ const serializeAws_queryGetGroupPolicyRequest = (input: GetGroupPolicyRequest, c const serializeAws_queryGetGroupRequest = (input: GetGroupRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -13815,7 +13830,7 @@ const serializeAws_queryGetInstanceProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceProfileName !== undefined) { + if (input.InstanceProfileName !== undefined && input.InstanceProfileName !== null) { entries["InstanceProfileName"] = input.InstanceProfileName; } return entries; @@ -13823,7 +13838,7 @@ const serializeAws_queryGetInstanceProfileRequest = ( const serializeAws_queryGetLoginProfileRequest = (input: GetLoginProfileRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13834,7 +13849,7 @@ const serializeAws_queryGetOpenIDConnectProviderRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.OpenIDConnectProviderArn !== undefined) { + if (input.OpenIDConnectProviderArn !== undefined && input.OpenIDConnectProviderArn !== null) { entries["OpenIDConnectProviderArn"] = input.OpenIDConnectProviderArn; } return entries; @@ -13845,16 +13860,16 @@ const serializeAws_queryGetOrganizationsAccessReportRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SortKey !== undefined) { + if (input.SortKey !== undefined && input.SortKey !== null) { entries["SortKey"] = input.SortKey; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.JobId !== undefined) { + if (input.JobId !== undefined && input.JobId !== null) { entries["JobId"] = input.JobId; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -13862,7 +13877,7 @@ const serializeAws_queryGetOrganizationsAccessReportRequest = ( const serializeAws_queryGetPolicyRequest = (input: GetPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } return entries; @@ -13870,10 +13885,10 @@ const serializeAws_queryGetPolicyRequest = (input: GetPolicyRequest, context: __ const serializeAws_queryGetPolicyVersionRequest = (input: GetPolicyVersionRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } - if (input.VersionId !== undefined) { + if (input.VersionId !== undefined && input.VersionId !== null) { entries["VersionId"] = input.VersionId; } return entries; @@ -13881,10 +13896,10 @@ const serializeAws_queryGetPolicyVersionRequest = (input: GetPolicyVersionReques const serializeAws_queryGetRolePolicyRequest = (input: GetRolePolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } return entries; @@ -13892,7 +13907,7 @@ const serializeAws_queryGetRolePolicyRequest = (input: GetRolePolicyRequest, con const serializeAws_queryGetRoleRequest = (input: GetRoleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -13900,7 +13915,7 @@ const serializeAws_queryGetRoleRequest = (input: GetRoleRequest, context: __Serd const serializeAws_queryGetSAMLProviderRequest = (input: GetSAMLProviderRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.SAMLProviderArn !== undefined) { + if (input.SAMLProviderArn !== undefined && input.SAMLProviderArn !== null) { entries["SAMLProviderArn"] = input.SAMLProviderArn; } return entries; @@ -13911,7 +13926,7 @@ const serializeAws_queryGetServerCertificateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ServerCertificateName !== undefined) { + if (input.ServerCertificateName !== undefined && input.ServerCertificateName !== null) { entries["ServerCertificateName"] = input.ServerCertificateName; } return entries; @@ -13922,13 +13937,13 @@ const serializeAws_queryGetServiceLastAccessedDetailsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.JobId !== undefined) { + if (input.JobId !== undefined && input.JobId !== null) { entries["JobId"] = input.JobId; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -13939,16 +13954,16 @@ const serializeAws_queryGetServiceLastAccessedDetailsWithEntitiesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.ServiceNamespace !== undefined) { + if (input.ServiceNamespace !== undefined && input.ServiceNamespace !== null) { entries["ServiceNamespace"] = input.ServiceNamespace; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.JobId !== undefined) { + if (input.JobId !== undefined && input.JobId !== null) { entries["JobId"] = input.JobId; } return entries; @@ -13959,7 +13974,7 @@ const serializeAws_queryGetServiceLinkedRoleDeletionStatusRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DeletionTaskId !== undefined) { + if (input.DeletionTaskId !== undefined && input.DeletionTaskId !== null) { entries["DeletionTaskId"] = input.DeletionTaskId; } return entries; @@ -13967,13 +13982,13 @@ const serializeAws_queryGetServiceLinkedRoleDeletionStatusRequest = ( const serializeAws_queryGetSSHPublicKeyRequest = (input: GetSSHPublicKeyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.SSHPublicKeyId !== undefined) { + if (input.SSHPublicKeyId !== undefined && input.SSHPublicKeyId !== null) { entries["SSHPublicKeyId"] = input.SSHPublicKeyId; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.Encoding !== undefined) { + if (input.Encoding !== undefined && input.Encoding !== null) { entries["Encoding"] = input.Encoding; } return entries; @@ -13981,10 +13996,10 @@ const serializeAws_queryGetSSHPublicKeyRequest = (input: GetSSHPublicKeyRequest, const serializeAws_queryGetUserPolicyRequest = (input: GetUserPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -13992,7 +14007,7 @@ const serializeAws_queryGetUserPolicyRequest = (input: GetUserPolicyRequest, con const serializeAws_queryGetUserRequest = (input: GetUserRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -14000,13 +14015,13 @@ const serializeAws_queryGetUserRequest = (input: GetUserRequest, context: __Serd const serializeAws_queryListAccessKeysRequest = (input: ListAccessKeysRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14017,10 +14032,10 @@ const serializeAws_queryListAccountAliasesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14031,16 +14046,16 @@ const serializeAws_queryListAttachedGroupPoliciesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } return entries; @@ -14051,16 +14066,16 @@ const serializeAws_queryListAttachedRolePoliciesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } return entries; @@ -14071,16 +14086,16 @@ const serializeAws_queryListAttachedUserPoliciesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14091,22 +14106,22 @@ const serializeAws_queryListEntitiesForPolicyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.EntityFilter !== undefined) { + if (input.EntityFilter !== undefined && input.EntityFilter !== null) { entries["EntityFilter"] = input.EntityFilter; } - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } - if (input.PolicyUsageFilter !== undefined) { + if (input.PolicyUsageFilter !== undefined && input.PolicyUsageFilter !== null) { entries["PolicyUsageFilter"] = input.PolicyUsageFilter; } return entries; @@ -14114,13 +14129,13 @@ const serializeAws_queryListEntitiesForPolicyRequest = ( const serializeAws_queryListGroupPoliciesRequest = (input: ListGroupPoliciesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -14128,13 +14143,13 @@ const serializeAws_queryListGroupPoliciesRequest = (input: ListGroupPoliciesRequ const serializeAws_queryListGroupsForUserRequest = (input: ListGroupsForUserRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14142,13 +14157,13 @@ const serializeAws_queryListGroupsForUserRequest = (input: ListGroupsForUserRequ const serializeAws_queryListGroupsRequest = (input: ListGroupsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14159,13 +14174,13 @@ const serializeAws_queryListInstanceProfilesForRoleRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -14176,13 +14191,13 @@ const serializeAws_queryListInstanceProfilesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } return entries; @@ -14190,13 +14205,13 @@ const serializeAws_queryListInstanceProfilesRequest = ( const serializeAws_queryListMFADevicesRequest = (input: ListMFADevicesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -14215,17 +14230,17 @@ const serializeAws_queryListPoliciesGrantingServiceAccessRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ServiceNamespaces !== undefined) { + if (input.ServiceNamespaces !== undefined && input.ServiceNamespaces !== null) { const memberEntries = serializeAws_queryserviceNamespaceListType(input.ServiceNamespaces, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ServiceNamespaces.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { entries["Arn"] = input.Arn; } return entries; @@ -14233,22 +14248,22 @@ const serializeAws_queryListPoliciesGrantingServiceAccessRequest = ( const serializeAws_queryListPoliciesRequest = (input: ListPoliciesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyUsageFilter !== undefined) { + if (input.PolicyUsageFilter !== undefined && input.PolicyUsageFilter !== null) { entries["PolicyUsageFilter"] = input.PolicyUsageFilter; } - if (input.Scope !== undefined) { + if (input.Scope !== undefined && input.Scope !== null) { entries["Scope"] = input.Scope; } - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.OnlyAttached !== undefined) { + if (input.OnlyAttached !== undefined && input.OnlyAttached !== null) { entries["OnlyAttached"] = input.OnlyAttached; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -14259,13 +14274,13 @@ const serializeAws_queryListPolicyVersionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -14273,13 +14288,13 @@ const serializeAws_queryListPolicyVersionsRequest = ( const serializeAws_queryListRolePoliciesRequest = (input: ListRolePoliciesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -14287,13 +14302,13 @@ const serializeAws_queryListRolePoliciesRequest = (input: ListRolePoliciesReques const serializeAws_queryListRolesRequest = (input: ListRolesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -14301,13 +14316,13 @@ const serializeAws_queryListRolesRequest = (input: ListRolesRequest, context: __ const serializeAws_queryListRoleTagsRequest = (input: ListRoleTagsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -14323,13 +14338,13 @@ const serializeAws_queryListServerCertificatesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14340,10 +14355,10 @@ const serializeAws_queryListServiceSpecificCredentialsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ServiceName !== undefined) { + if (input.ServiceName !== undefined && input.ServiceName !== null) { entries["ServiceName"] = input.ServiceName; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -14354,13 +14369,13 @@ const serializeAws_queryListSigningCertificatesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14368,13 +14383,13 @@ const serializeAws_queryListSigningCertificatesRequest = ( const serializeAws_queryListSSHPublicKeysRequest = (input: ListSSHPublicKeysRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14382,13 +14397,13 @@ const serializeAws_queryListSSHPublicKeysRequest = (input: ListSSHPublicKeysRequ const serializeAws_queryListUserPoliciesRequest = (input: ListUserPoliciesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14396,13 +14411,13 @@ const serializeAws_queryListUserPoliciesRequest = (input: ListUserPoliciesReques const serializeAws_queryListUsersRequest = (input: ListUsersRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PathPrefix !== undefined) { + if (input.PathPrefix !== undefined && input.PathPrefix !== null) { entries["PathPrefix"] = input.PathPrefix; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14410,13 +14425,13 @@ const serializeAws_queryListUsersRequest = (input: ListUsersRequest, context: __ const serializeAws_queryListUserTagsRequest = (input: ListUserTagsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14427,13 +14442,13 @@ const serializeAws_queryListVirtualMFADevicesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.AssignmentStatus !== undefined) { + if (input.AssignmentStatus !== undefined && input.AssignmentStatus !== null) { entries["AssignmentStatus"] = input.AssignmentStatus; } return entries; @@ -14441,13 +14456,13 @@ const serializeAws_queryListVirtualMFADevicesRequest = ( const serializeAws_queryPutGroupPolicyRequest = (input: PutGroupPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.PolicyDocument !== undefined) { + if (input.PolicyDocument !== undefined && input.PolicyDocument !== null) { entries["PolicyDocument"] = input.PolicyDocument; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } return entries; @@ -14458,10 +14473,10 @@ const serializeAws_queryPutRolePermissionsBoundaryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.PermissionsBoundary !== undefined) { + if (input.PermissionsBoundary !== undefined && input.PermissionsBoundary !== null) { entries["PermissionsBoundary"] = input.PermissionsBoundary; } return entries; @@ -14469,13 +14484,13 @@ const serializeAws_queryPutRolePermissionsBoundaryRequest = ( const serializeAws_queryPutRolePolicyRequest = (input: PutRolePolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } - if (input.PolicyDocument !== undefined) { + if (input.PolicyDocument !== undefined && input.PolicyDocument !== null) { entries["PolicyDocument"] = input.PolicyDocument; } return entries; @@ -14486,10 +14501,10 @@ const serializeAws_queryPutUserPermissionsBoundaryRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PermissionsBoundary !== undefined) { + if (input.PermissionsBoundary !== undefined && input.PermissionsBoundary !== null) { entries["PermissionsBoundary"] = input.PermissionsBoundary; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -14497,13 +14512,13 @@ const serializeAws_queryPutUserPermissionsBoundaryRequest = ( const serializeAws_queryPutUserPolicyRequest = (input: PutUserPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.PolicyDocument !== undefined) { + if (input.PolicyDocument !== undefined && input.PolicyDocument !== null) { entries["PolicyDocument"] = input.PolicyDocument; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } return entries; @@ -14514,10 +14529,10 @@ const serializeAws_queryRemoveClientIDFromOpenIDConnectProviderRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.OpenIDConnectProviderArn !== undefined) { + if (input.OpenIDConnectProviderArn !== undefined && input.OpenIDConnectProviderArn !== null) { entries["OpenIDConnectProviderArn"] = input.OpenIDConnectProviderArn; } - if (input.ClientID !== undefined) { + if (input.ClientID !== undefined && input.ClientID !== null) { entries["ClientID"] = input.ClientID; } return entries; @@ -14528,10 +14543,10 @@ const serializeAws_queryRemoveRoleFromInstanceProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstanceProfileName !== undefined) { + if (input.InstanceProfileName !== undefined && input.InstanceProfileName !== null) { entries["InstanceProfileName"] = input.InstanceProfileName; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -14542,10 +14557,10 @@ const serializeAws_queryRemoveUserFromGroupRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -14556,10 +14571,10 @@ const serializeAws_queryResetServiceSpecificCredentialRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.ServiceSpecificCredentialId !== undefined) { + if (input.ServiceSpecificCredentialId !== undefined && input.ServiceSpecificCredentialId !== null) { entries["ServiceSpecificCredentialId"] = input.ServiceSpecificCredentialId; } return entries; @@ -14569,6 +14584,9 @@ const serializeAws_queryResourceNameListType = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -14577,16 +14595,16 @@ const serializeAws_queryResourceNameListType = (input: string[], context: __Serd const serializeAws_queryResyncMFADeviceRequest = (input: ResyncMFADeviceRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AuthenticationCode2 !== undefined) { + if (input.AuthenticationCode2 !== undefined && input.AuthenticationCode2 !== null) { entries["AuthenticationCode2"] = input.AuthenticationCode2; } - if (input.AuthenticationCode1 !== undefined) { + if (input.AuthenticationCode1 !== undefined && input.AuthenticationCode1 !== null) { entries["AuthenticationCode1"] = input.AuthenticationCode1; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.SerialNumber !== undefined) { + if (input.SerialNumber !== undefined && input.SerialNumber !== null) { entries["SerialNumber"] = input.SerialNumber; } return entries; @@ -14596,6 +14614,9 @@ const serializeAws_queryserviceNamespaceListType = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -14607,10 +14628,10 @@ const serializeAws_querySetDefaultPolicyVersionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VersionId !== undefined) { + if (input.VersionId !== undefined && input.VersionId !== null) { entries["VersionId"] = input.VersionId; } - if (input.PolicyArn !== undefined) { + if (input.PolicyArn !== undefined && input.PolicyArn !== null) { entries["PolicyArn"] = input.PolicyArn; } return entries; @@ -14621,7 +14642,7 @@ const serializeAws_querySetSecurityTokenServicePreferencesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalEndpointTokenVersion !== undefined) { + if (input.GlobalEndpointTokenVersion !== undefined && input.GlobalEndpointTokenVersion !== null) { entries["GlobalEndpointTokenVersion"] = input.GlobalEndpointTokenVersion; } return entries; @@ -14632,57 +14653,57 @@ const serializeAws_querySimulateCustomPolicyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourcePolicy !== undefined) { + if (input.ResourcePolicy !== undefined && input.ResourcePolicy !== null) { entries["ResourcePolicy"] = input.ResourcePolicy; } - if (input.CallerArn !== undefined) { + if (input.CallerArn !== undefined && input.CallerArn !== null) { entries["CallerArn"] = input.CallerArn; } - if (input.ResourceHandlingOption !== undefined) { + if (input.ResourceHandlingOption !== undefined && input.ResourceHandlingOption !== null) { entries["ResourceHandlingOption"] = input.ResourceHandlingOption; } - if (input.ResourceArns !== undefined) { + if (input.ResourceArns !== undefined && input.ResourceArns !== null) { const memberEntries = serializeAws_queryResourceNameListType(input.ResourceArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceArns.${key}`; entries[loc] = value; }); } - if (input.ActionNames !== undefined) { + if (input.ActionNames !== undefined && input.ActionNames !== null) { const memberEntries = serializeAws_queryActionNameListType(input.ActionNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ActionNames.${key}`; entries[loc] = value; }); } - if (input.PolicyInputList !== undefined) { + if (input.PolicyInputList !== undefined && input.PolicyInputList !== null) { const memberEntries = serializeAws_querySimulationPolicyListType(input.PolicyInputList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyInputList.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.PermissionsBoundaryPolicyInputList !== undefined) { + if (input.PermissionsBoundaryPolicyInputList !== undefined && input.PermissionsBoundaryPolicyInputList !== null) { const memberEntries = serializeAws_querySimulationPolicyListType(input.PermissionsBoundaryPolicyInputList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PermissionsBoundaryPolicyInputList.${key}`; entries[loc] = value; }); } - if (input.ResourceOwner !== undefined) { + if (input.ResourceOwner !== undefined && input.ResourceOwner !== null) { entries["ResourceOwner"] = input.ResourceOwner; } - if (input.ContextEntries !== undefined) { + if (input.ContextEntries !== undefined && input.ContextEntries !== null) { const memberEntries = serializeAws_queryContextEntryListType(input.ContextEntries, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ContextEntries.${key}`; entries[loc] = value; }); } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -14693,60 +14714,60 @@ const serializeAws_querySimulatePrincipalPolicyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.ResourceHandlingOption !== undefined) { + if (input.ResourceHandlingOption !== undefined && input.ResourceHandlingOption !== null) { entries["ResourceHandlingOption"] = input.ResourceHandlingOption; } - if (input.ActionNames !== undefined) { + if (input.ActionNames !== undefined && input.ActionNames !== null) { const memberEntries = serializeAws_queryActionNameListType(input.ActionNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ActionNames.${key}`; entries[loc] = value; }); } - if (input.ResourcePolicy !== undefined) { + if (input.ResourcePolicy !== undefined && input.ResourcePolicy !== null) { entries["ResourcePolicy"] = input.ResourcePolicy; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.ContextEntries !== undefined) { + if (input.ContextEntries !== undefined && input.ContextEntries !== null) { const memberEntries = serializeAws_queryContextEntryListType(input.ContextEntries, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ContextEntries.${key}`; entries[loc] = value; }); } - if (input.PermissionsBoundaryPolicyInputList !== undefined) { + if (input.PermissionsBoundaryPolicyInputList !== undefined && input.PermissionsBoundaryPolicyInputList !== null) { const memberEntries = serializeAws_querySimulationPolicyListType(input.PermissionsBoundaryPolicyInputList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PermissionsBoundaryPolicyInputList.${key}`; entries[loc] = value; }); } - if (input.PolicyInputList !== undefined) { + if (input.PolicyInputList !== undefined && input.PolicyInputList !== null) { const memberEntries = serializeAws_querySimulationPolicyListType(input.PolicyInputList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyInputList.${key}`; entries[loc] = value; }); } - if (input.ResourceOwner !== undefined) { + if (input.ResourceOwner !== undefined && input.ResourceOwner !== null) { entries["ResourceOwner"] = input.ResourceOwner; } - if (input.PolicySourceArn !== undefined) { + if (input.PolicySourceArn !== undefined && input.PolicySourceArn !== null) { entries["PolicySourceArn"] = input.PolicySourceArn; } - if (input.ResourceArns !== undefined) { + if (input.ResourceArns !== undefined && input.ResourceArns !== null) { const memberEntries = serializeAws_queryResourceNameListType(input.ResourceArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResourceArns.${key}`; entries[loc] = value; }); } - if (input.CallerArn !== undefined) { + if (input.CallerArn !== undefined && input.CallerArn !== null) { entries["CallerArn"] = input.CallerArn; } return entries; @@ -14756,6 +14777,9 @@ const serializeAws_querySimulationPolicyListType = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -14764,10 +14788,10 @@ const serializeAws_querySimulationPolicyListType = (input: string[], context: __ const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } return entries; @@ -14777,6 +14801,9 @@ const serializeAws_querytagKeyListType = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -14787,6 +14814,9 @@ const serializeAws_querytagListType = (input: Tag[], context: __SerdeContext): a const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -14798,14 +14828,14 @@ const serializeAws_querytagListType = (input: Tag[], context: __SerdeContext): a const serializeAws_queryTagRoleRequest = (input: TagRoleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_querytagListType(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -14813,14 +14843,14 @@ const serializeAws_queryTagRoleRequest = (input: TagRoleRequest, context: __Serd const serializeAws_queryTagUserRequest = (input: TagUserRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_querytagListType(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -14830,6 +14860,9 @@ const serializeAws_querythumbprintListType = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -14838,14 +14871,14 @@ const serializeAws_querythumbprintListType = (input: string[], context: __SerdeC const serializeAws_queryUntagRoleRequest = (input: UntagRoleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_querytagKeyListType(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -14853,14 +14886,14 @@ const serializeAws_queryUntagRoleRequest = (input: UntagRoleRequest, context: __ const serializeAws_queryUntagUserRequest = (input: UntagUserRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_querytagKeyListType(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -14868,13 +14901,13 @@ const serializeAws_queryUntagUserRequest = (input: UntagUserRequest, context: __ const serializeAws_queryUpdateAccessKeyRequest = (input: UpdateAccessKeyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.AccessKeyId !== undefined) { + if (input.AccessKeyId !== undefined && input.AccessKeyId !== null) { entries["AccessKeyId"] = input.AccessKeyId; } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { entries["Status"] = input.Status; } return entries; @@ -14885,31 +14918,31 @@ const serializeAws_queryUpdateAccountPasswordPolicyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RequireLowercaseCharacters !== undefined) { + if (input.RequireLowercaseCharacters !== undefined && input.RequireLowercaseCharacters !== null) { entries["RequireLowercaseCharacters"] = input.RequireLowercaseCharacters; } - if (input.PasswordReusePrevention !== undefined) { + if (input.PasswordReusePrevention !== undefined && input.PasswordReusePrevention !== null) { entries["PasswordReusePrevention"] = input.PasswordReusePrevention; } - if (input.HardExpiry !== undefined) { + if (input.HardExpiry !== undefined && input.HardExpiry !== null) { entries["HardExpiry"] = input.HardExpiry; } - if (input.MaxPasswordAge !== undefined) { + if (input.MaxPasswordAge !== undefined && input.MaxPasswordAge !== null) { entries["MaxPasswordAge"] = input.MaxPasswordAge; } - if (input.RequireUppercaseCharacters !== undefined) { + if (input.RequireUppercaseCharacters !== undefined && input.RequireUppercaseCharacters !== null) { entries["RequireUppercaseCharacters"] = input.RequireUppercaseCharacters; } - if (input.RequireSymbols !== undefined) { + if (input.RequireSymbols !== undefined && input.RequireSymbols !== null) { entries["RequireSymbols"] = input.RequireSymbols; } - if (input.AllowUsersToChangePassword !== undefined) { + if (input.AllowUsersToChangePassword !== undefined && input.AllowUsersToChangePassword !== null) { entries["AllowUsersToChangePassword"] = input.AllowUsersToChangePassword; } - if (input.RequireNumbers !== undefined) { + if (input.RequireNumbers !== undefined && input.RequireNumbers !== null) { entries["RequireNumbers"] = input.RequireNumbers; } - if (input.MinimumPasswordLength !== undefined) { + if (input.MinimumPasswordLength !== undefined && input.MinimumPasswordLength !== null) { entries["MinimumPasswordLength"] = input.MinimumPasswordLength; } return entries; @@ -14920,10 +14953,10 @@ const serializeAws_queryUpdateAssumeRolePolicyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.PolicyDocument !== undefined) { + if (input.PolicyDocument !== undefined && input.PolicyDocument !== null) { entries["PolicyDocument"] = input.PolicyDocument; } return entries; @@ -14931,13 +14964,13 @@ const serializeAws_queryUpdateAssumeRolePolicyRequest = ( const serializeAws_queryUpdateGroupRequest = (input: UpdateGroupRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.NewGroupName !== undefined) { + if (input.NewGroupName !== undefined && input.NewGroupName !== null) { entries["NewGroupName"] = input.NewGroupName; } - if (input.GroupName !== undefined) { + if (input.GroupName !== undefined && input.GroupName !== null) { entries["GroupName"] = input.GroupName; } - if (input.NewPath !== undefined) { + if (input.NewPath !== undefined && input.NewPath !== null) { entries["NewPath"] = input.NewPath; } return entries; @@ -14948,13 +14981,13 @@ const serializeAws_queryUpdateLoginProfileRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Password !== undefined) { + if (input.Password !== undefined && input.Password !== null) { entries["Password"] = input.Password; } - if (input.PasswordResetRequired !== undefined) { + if (input.PasswordResetRequired !== undefined && input.PasswordResetRequired !== null) { entries["PasswordResetRequired"] = input.PasswordResetRequired; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -14965,14 +14998,14 @@ const serializeAws_queryUpdateOpenIDConnectProviderThumbprintRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ThumbprintList !== undefined) { + if (input.ThumbprintList !== undefined && input.ThumbprintList !== null) { const memberEntries = serializeAws_querythumbprintListType(input.ThumbprintList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ThumbprintList.${key}`; entries[loc] = value; }); } - if (input.OpenIDConnectProviderArn !== undefined) { + if (input.OpenIDConnectProviderArn !== undefined && input.OpenIDConnectProviderArn !== null) { entries["OpenIDConnectProviderArn"] = input.OpenIDConnectProviderArn; } return entries; @@ -14983,10 +15016,10 @@ const serializeAws_queryUpdateRoleDescriptionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } return entries; @@ -14994,13 +15027,13 @@ const serializeAws_queryUpdateRoleDescriptionRequest = ( const serializeAws_queryUpdateRoleRequest = (input: UpdateRoleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.MaxSessionDuration !== undefined) { + if (input.MaxSessionDuration !== undefined && input.MaxSessionDuration !== null) { entries["MaxSessionDuration"] = input.MaxSessionDuration; } - if (input.RoleName !== undefined) { + if (input.RoleName !== undefined && input.RoleName !== null) { entries["RoleName"] = input.RoleName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -15011,10 +15044,10 @@ const serializeAws_queryUpdateSAMLProviderRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SAMLMetadataDocument !== undefined) { + if (input.SAMLMetadataDocument !== undefined && input.SAMLMetadataDocument !== null) { entries["SAMLMetadataDocument"] = input.SAMLMetadataDocument; } - if (input.SAMLProviderArn !== undefined) { + if (input.SAMLProviderArn !== undefined && input.SAMLProviderArn !== null) { entries["SAMLProviderArn"] = input.SAMLProviderArn; } return entries; @@ -15025,13 +15058,13 @@ const serializeAws_queryUpdateServerCertificateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NewPath !== undefined) { + if (input.NewPath !== undefined && input.NewPath !== null) { entries["NewPath"] = input.NewPath; } - if (input.NewServerCertificateName !== undefined) { + if (input.NewServerCertificateName !== undefined && input.NewServerCertificateName !== null) { entries["NewServerCertificateName"] = input.NewServerCertificateName; } - if (input.ServerCertificateName !== undefined) { + if (input.ServerCertificateName !== undefined && input.ServerCertificateName !== null) { entries["ServerCertificateName"] = input.ServerCertificateName; } return entries; @@ -15042,13 +15075,13 @@ const serializeAws_queryUpdateServiceSpecificCredentialRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ServiceSpecificCredentialId !== undefined) { + if (input.ServiceSpecificCredentialId !== undefined && input.ServiceSpecificCredentialId !== null) { entries["ServiceSpecificCredentialId"] = input.ServiceSpecificCredentialId; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { entries["Status"] = input.Status; } return entries; @@ -15059,13 +15092,13 @@ const serializeAws_queryUpdateSigningCertificateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CertificateId !== undefined) { + if (input.CertificateId !== undefined && input.CertificateId !== null) { entries["CertificateId"] = input.CertificateId; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { entries["Status"] = input.Status; } return entries; @@ -15076,13 +15109,13 @@ const serializeAws_queryUpdateSSHPublicKeyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SSHPublicKeyId !== undefined) { + if (input.SSHPublicKeyId !== undefined && input.SSHPublicKeyId !== null) { entries["SSHPublicKeyId"] = input.SSHPublicKeyId; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { entries["Status"] = input.Status; } return entries; @@ -15090,13 +15123,13 @@ const serializeAws_queryUpdateSSHPublicKeyRequest = ( const serializeAws_queryUpdateUserRequest = (input: UpdateUserRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.NewUserName !== undefined) { + if (input.NewUserName !== undefined && input.NewUserName !== null) { entries["NewUserName"] = input.NewUserName; } - if (input.NewPath !== undefined) { + if (input.NewPath !== undefined && input.NewPath !== null) { entries["NewPath"] = input.NewPath; } return entries; @@ -15107,19 +15140,19 @@ const serializeAws_queryUploadServerCertificateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CertificateChain !== undefined) { + if (input.CertificateChain !== undefined && input.CertificateChain !== null) { entries["CertificateChain"] = input.CertificateChain; } - if (input.ServerCertificateName !== undefined) { + if (input.ServerCertificateName !== undefined && input.ServerCertificateName !== null) { entries["ServerCertificateName"] = input.ServerCertificateName; } - if (input.CertificateBody !== undefined) { + if (input.CertificateBody !== undefined && input.CertificateBody !== null) { entries["CertificateBody"] = input.CertificateBody; } - if (input.PrivateKey !== undefined) { + if (input.PrivateKey !== undefined && input.PrivateKey !== null) { entries["PrivateKey"] = input.PrivateKey; } - if (input.Path !== undefined) { + if (input.Path !== undefined && input.Path !== null) { entries["Path"] = input.Path; } return entries; @@ -15130,10 +15163,10 @@ const serializeAws_queryUploadSigningCertificateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CertificateBody !== undefined) { + if (input.CertificateBody !== undefined && input.CertificateBody !== null) { entries["CertificateBody"] = input.CertificateBody; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } return entries; @@ -15144,10 +15177,10 @@ const serializeAws_queryUploadSSHPublicKeyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.SSHPublicKeyBody !== undefined) { + if (input.SSHPublicKeyBody !== undefined && input.SSHPublicKeyBody !== null) { entries["SSHPublicKeyBody"] = input.SSHPublicKeyBody; } return entries; @@ -15184,7 +15217,14 @@ const deserializeAws_queryAccessDetail = (output: any, context: __SerdeContext): }; const deserializeAws_queryAccessDetails = (output: any, context: __SerdeContext): AccessDetail[] => { - return (output || []).map((entry: any) => deserializeAws_queryAccessDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAccessDetail(entry, context); + }); }; const deserializeAws_queryAccessKey = (output: any, context: __SerdeContext): AccessKey => { @@ -15254,15 +15294,36 @@ const deserializeAws_queryAccessKeyMetadata = (output: any, context: __SerdeCont }; const deserializeAws_queryaccessKeyMetadataListType = (output: any, context: __SerdeContext): AccessKeyMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_queryAccessKeyMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAccessKeyMetadata(entry, context); + }); }; const deserializeAws_queryaccountAliasListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryArnListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryAttachedPermissionsBoundary = ( @@ -15283,7 +15344,14 @@ const deserializeAws_queryAttachedPermissionsBoundary = ( }; const deserializeAws_queryattachedPoliciesListType = (output: any, context: __SerdeContext): AttachedPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_queryAttachedPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAttachedPolicy(entry, context); + }); }; const deserializeAws_queryAttachedPolicy = (output: any, context: __SerdeContext): AttachedPolicy => { @@ -15301,11 +15369,25 @@ const deserializeAws_queryAttachedPolicy = (output: any, context: __SerdeContext }; const deserializeAws_querycertificateListType = (output: any, context: __SerdeContext): SigningCertificate[] => { - return (output || []).map((entry: any) => deserializeAws_querySigningCertificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySigningCertificate(entry, context); + }); }; const deserializeAws_queryclientIDListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryConcurrentModificationException = ( @@ -15322,7 +15404,14 @@ const deserializeAws_queryConcurrentModificationException = ( }; const deserializeAws_queryContextKeyNamesResultListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryCreateAccessKeyResponse = (output: any, context: __SerdeContext): CreateAccessKeyResponse => { @@ -15621,7 +15710,14 @@ const deserializeAws_queryEntityDetails = (output: any, context: __SerdeContext) }; const deserializeAws_queryentityDetailsListType = (output: any, context: __SerdeContext): EntityDetails[] => { - return (output || []).map((entry: any) => deserializeAws_queryEntityDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEntityDetails(entry, context); + }); }; const deserializeAws_queryEntityInfo = (output: any, context: __SerdeContext): EntityInfo => { @@ -15681,13 +15777,15 @@ const deserializeAws_queryEvalDecisionDetailsType = ( output: any, context: __SerdeContext ): { [key: string]: PolicyEvaluationDecisionType | string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: pair["value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryEvaluationResult = (output: any, context: __SerdeContext): EvaluationResult => { @@ -15763,7 +15861,14 @@ const deserializeAws_queryEvaluationResult = (output: any, context: __SerdeConte }; const deserializeAws_queryEvaluationResultsListType = (output: any, context: __SerdeContext): EvaluationResult[] => { - return (output || []).map((entry: any) => deserializeAws_queryEvaluationResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEvaluationResult(entry, context); + }); }; const deserializeAws_queryGenerateCredentialReportResponse = ( @@ -16409,15 +16514,36 @@ const deserializeAws_queryGroupDetail = (output: any, context: __SerdeContext): }; const deserializeAws_querygroupDetailListType = (output: any, context: __SerdeContext): GroupDetail[] => { - return (output || []).map((entry: any) => deserializeAws_queryGroupDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryGroupDetail(entry, context); + }); }; const deserializeAws_querygroupListType = (output: any, context: __SerdeContext): Group[] => { - return (output || []).map((entry: any) => deserializeAws_queryGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryGroup(entry, context); + }); }; const deserializeAws_querygroupNameListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryInstanceProfile = (output: any, context: __SerdeContext): InstanceProfile => { @@ -16454,7 +16580,14 @@ const deserializeAws_queryInstanceProfile = (output: any, context: __SerdeContex }; const deserializeAws_queryinstanceProfileListType = (output: any, context: __SerdeContext): InstanceProfile[] => { - return (output || []).map((entry: any) => deserializeAws_queryInstanceProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInstanceProfile(entry, context); + }); }; const deserializeAws_queryInvalidAuthenticationCodeException = ( @@ -16974,7 +17107,14 @@ const deserializeAws_querylistPolicyGrantingServiceAccessResponseListType = ( output: any, context: __SerdeContext ): ListPoliciesGrantingServiceAccessEntry[] => { - return (output || []).map((entry: any) => deserializeAws_queryListPoliciesGrantingServiceAccessEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryListPoliciesGrantingServiceAccessEntry(entry, context); + }); }; const deserializeAws_queryListPolicyVersionsResponse = ( @@ -17402,7 +17542,14 @@ const deserializeAws_queryManagedPolicyDetailListType = ( output: any, context: __SerdeContext ): ManagedPolicyDetail[] => { - return (output || []).map((entry: any) => deserializeAws_queryManagedPolicyDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryManagedPolicyDetail(entry, context); + }); }; const deserializeAws_queryMFADevice = (output: any, context: __SerdeContext): MFADevice => { @@ -17424,7 +17571,14 @@ const deserializeAws_queryMFADevice = (output: any, context: __SerdeContext): MF }; const deserializeAws_querymfaDeviceListType = (output: any, context: __SerdeContext): MFADevice[] => { - return (output || []).map((entry: any) => deserializeAws_queryMFADevice(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMFADevice(entry, context); + }); }; const deserializeAws_queryNoSuchEntityException = (output: any, context: __SerdeContext): NoSuchEntityException => { @@ -17454,7 +17608,14 @@ const deserializeAws_queryOpenIDConnectProviderListType = ( output: any, context: __SerdeContext ): OpenIDConnectProviderListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_queryOpenIDConnectProviderListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOpenIDConnectProviderListEntry(entry, context); + }); }; const deserializeAws_queryOrganizationsDecisionDetail = ( @@ -17607,11 +17768,25 @@ const deserializeAws_queryPolicyDetail = (output: any, context: __SerdeContext): }; const deserializeAws_querypolicyDetailListType = (output: any, context: __SerdeContext): PolicyDetail[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyDetail(entry, context); + }); }; const deserializeAws_querypolicyDocumentVersionListType = (output: any, context: __SerdeContext): PolicyVersion[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyVersion(entry, context); + }); }; const deserializeAws_queryPolicyEvaluationException = ( @@ -17660,7 +17835,14 @@ const deserializeAws_querypolicyGrantingServiceAccessListType = ( output: any, context: __SerdeContext ): PolicyGrantingServiceAccess[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyGrantingServiceAccess(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyGrantingServiceAccess(entry, context); + }); }; const deserializeAws_queryPolicyGroup = (output: any, context: __SerdeContext): PolicyGroup => { @@ -17678,15 +17860,36 @@ const deserializeAws_queryPolicyGroup = (output: any, context: __SerdeContext): }; const deserializeAws_queryPolicyGroupListType = (output: any, context: __SerdeContext): PolicyGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyGroup(entry, context); + }); }; const deserializeAws_querypolicyListType = (output: any, context: __SerdeContext): Policy[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicy(entry, context); + }); }; const deserializeAws_querypolicyNameListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryPolicyNotAttachableException = ( @@ -17717,7 +17920,14 @@ const deserializeAws_queryPolicyRole = (output: any, context: __SerdeContext): P }; const deserializeAws_queryPolicyRoleListType = (output: any, context: __SerdeContext): PolicyRole[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyRole(entry, context); + }); }; const deserializeAws_queryPolicyUser = (output: any, context: __SerdeContext): PolicyUser => { @@ -17735,7 +17945,14 @@ const deserializeAws_queryPolicyUser = (output: any, context: __SerdeContext): P }; const deserializeAws_queryPolicyUserListType = (output: any, context: __SerdeContext): PolicyUser[] => { - return (output || []).map((entry: any) => deserializeAws_queryPolicyUser(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPolicyUser(entry, context); + }); }; const deserializeAws_queryPolicyVersion = (output: any, context: __SerdeContext): PolicyVersion => { @@ -17858,7 +18075,14 @@ const deserializeAws_queryResourceSpecificResultListType = ( output: any, context: __SerdeContext ): ResourceSpecificResult[] => { - return (output || []).map((entry: any) => deserializeAws_queryResourceSpecificResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryResourceSpecificResult(entry, context); + }); }; const deserializeAws_queryRole = (output: any, context: __SerdeContext): Role => { @@ -17996,7 +18220,14 @@ const deserializeAws_queryRoleDetail = (output: any, context: __SerdeContext): R }; const deserializeAws_queryroleDetailListType = (output: any, context: __SerdeContext): RoleDetail[] => { - return (output || []).map((entry: any) => deserializeAws_queryRoleDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRoleDetail(entry, context); + }); }; const deserializeAws_queryRoleLastUsed = (output: any, context: __SerdeContext): RoleLastUsed => { @@ -18014,11 +18245,25 @@ const deserializeAws_queryRoleLastUsed = (output: any, context: __SerdeContext): }; const deserializeAws_queryroleListType = (output: any, context: __SerdeContext): Role[] => { - return (output || []).map((entry: any) => deserializeAws_queryRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRole(entry, context); + }); }; const deserializeAws_queryRoleUsageListType = (output: any, context: __SerdeContext): RoleUsageType[] => { - return (output || []).map((entry: any) => deserializeAws_queryRoleUsageType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRoleUsageType(entry, context); + }); }; const deserializeAws_queryRoleUsageType = (output: any, context: __SerdeContext): RoleUsageType => { @@ -18060,7 +18305,14 @@ const deserializeAws_querySAMLProviderListEntry = (output: any, context: __Serde }; const deserializeAws_querySAMLProviderListType = (output: any, context: __SerdeContext): SAMLProviderListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_querySAMLProviderListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySAMLProviderListEntry(entry, context); + }); }; const deserializeAws_queryServerCertificate = (output: any, context: __SerdeContext): ServerCertificate => { @@ -18121,7 +18373,14 @@ const deserializeAws_queryserverCertificateMetadataListType = ( output: any, context: __SerdeContext ): ServerCertificateMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_queryServerCertificateMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryServerCertificateMetadata(entry, context); + }); }; const deserializeAws_queryServiceFailureException = (output: any, context: __SerdeContext): ServiceFailureException => { @@ -18191,7 +18450,14 @@ const deserializeAws_queryServiceNotSupportedException = ( }; const deserializeAws_queryServicesLastAccessed = (output: any, context: __SerdeContext): ServiceLastAccessed[] => { - return (output || []).map((entry: any) => deserializeAws_queryServiceLastAccessed(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryServiceLastAccessed(entry, context); + }); }; const deserializeAws_queryServiceSpecificCredential = ( @@ -18268,7 +18534,14 @@ const deserializeAws_queryServiceSpecificCredentialsListType = ( output: any, context: __SerdeContext ): ServiceSpecificCredentialMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_queryServiceSpecificCredentialMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryServiceSpecificCredentialMetadata(entry, context); + }); }; const deserializeAws_querySigningCertificate = (output: any, context: __SerdeContext): SigningCertificate => { @@ -18352,7 +18625,14 @@ const deserializeAws_querySSHPublicKey = (output: any, context: __SerdeContext): }; const deserializeAws_querySSHPublicKeyListType = (output: any, context: __SerdeContext): SSHPublicKeyMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_querySSHPublicKeyMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySSHPublicKeyMetadata(entry, context); + }); }; const deserializeAws_querySSHPublicKeyMetadata = (output: any, context: __SerdeContext): SSHPublicKeyMetadata => { @@ -18400,17 +18680,26 @@ const deserializeAws_queryStatement = (output: any, context: __SerdeContext): St }; const deserializeAws_queryStatementListType = (output: any, context: __SerdeContext): Statement[] => { - return (output || []).map((entry: any) => deserializeAws_queryStatement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryStatement(entry, context); + }); }; const deserializeAws_querysummaryMapType = (output: any, context: __SerdeContext): { [key: string]: number } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: parseInt(pair["value"]), - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { @@ -18428,11 +18717,25 @@ const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { }; const deserializeAws_querytagListType = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_querythumbprintListType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryTrackedActionLastAccessed = ( @@ -18464,7 +18767,14 @@ const deserializeAws_queryTrackedActionsLastAccessed = ( output: any, context: __SerdeContext ): TrackedActionLastAccessed[] => { - return (output || []).map((entry: any) => deserializeAws_queryTrackedActionLastAccessed(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTrackedActionLastAccessed(entry, context); + }); }; const deserializeAws_queryUnmodifiableEntityException = ( @@ -18681,11 +18991,25 @@ const deserializeAws_queryUserDetail = (output: any, context: __SerdeContext): U }; const deserializeAws_queryuserDetailListType = (output: any, context: __SerdeContext): UserDetail[] => { - return (output || []).map((entry: any) => deserializeAws_queryUserDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUserDetail(entry, context); + }); }; const deserializeAws_queryuserListType = (output: any, context: __SerdeContext): User[] => { - return (output || []).map((entry: any) => deserializeAws_queryUser(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUser(entry, context); + }); }; const deserializeAws_queryVirtualMFADevice = (output: any, context: __SerdeContext): VirtualMFADevice => { @@ -18715,7 +19039,14 @@ const deserializeAws_queryVirtualMFADevice = (output: any, context: __SerdeConte }; const deserializeAws_queryvirtualMFADeviceListType = (output: any, context: __SerdeContext): VirtualMFADevice[] => { - return (output || []).map((entry: any) => deserializeAws_queryVirtualMFADevice(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryVirtualMFADevice(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ diff --git a/clients/client-identitystore/protocols/Aws_json1_1.ts b/clients/client-identitystore/protocols/Aws_json1_1.ts index 3582f79bcf3e..b0ba7dbdd4b5 100644 --- a/clients/client-identitystore/protocols/Aws_json1_1.ts +++ b/clients/client-identitystore/protocols/Aws_json1_1.ts @@ -35,7 +35,7 @@ export const serializeAws_json1_1DescribeGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIdentityStore.DescribeGroup", }; let body: any; @@ -48,7 +48,7 @@ export const serializeAws_json1_1DescribeUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIdentityStore.DescribeUser", }; let body: any; @@ -61,7 +61,7 @@ export const serializeAws_json1_1ListGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIdentityStore.ListGroups", }; let body: any; @@ -74,7 +74,7 @@ export const serializeAws_json1_1ListUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIdentityStore.ListUsers", }; let body: any; @@ -109,8 +109,7 @@ const deserializeAws_json1_1DescribeGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.identitystore#AccessDeniedException": @@ -196,8 +195,7 @@ const deserializeAws_json1_1DescribeUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.identitystore#AccessDeniedException": @@ -283,8 +281,7 @@ const deserializeAws_json1_1ListGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.identitystore#AccessDeniedException": @@ -370,8 +367,7 @@ const deserializeAws_json1_1ListUsersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.identitystore#AccessDeniedException": @@ -507,44 +503,58 @@ const deserializeAws_json1_1ValidationExceptionResponse = async ( const serializeAws_json1_1DescribeGroupRequest = (input: DescribeGroupRequest, context: __SerdeContext): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.IdentityStoreId !== undefined && { IdentityStoreId: input.IdentityStoreId }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.IdentityStoreId !== undefined && + input.IdentityStoreId !== null && { IdentityStoreId: input.IdentityStoreId }), }; }; const serializeAws_json1_1DescribeUserRequest = (input: DescribeUserRequest, context: __SerdeContext): any => { return { - ...(input.IdentityStoreId !== undefined && { IdentityStoreId: input.IdentityStoreId }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.IdentityStoreId !== undefined && + input.IdentityStoreId !== null && { IdentityStoreId: input.IdentityStoreId }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.AttributePath !== undefined && { AttributePath: input.AttributePath }), - ...(input.AttributeValue !== undefined && { AttributeValue: input.AttributeValue }), + ...(input.AttributePath !== undefined && input.AttributePath !== null && { AttributePath: input.AttributePath }), + ...(input.AttributeValue !== undefined && + input.AttributeValue !== null && { AttributeValue: input.AttributeValue }), }; }; const serializeAws_json1_1Filters = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1ListGroupsRequest = (input: ListGroupsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.IdentityStoreId !== undefined && { IdentityStoreId: input.IdentityStoreId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.IdentityStoreId !== undefined && + input.IdentityStoreId !== null && { IdentityStoreId: input.IdentityStoreId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListUsersRequest = (input: ListUsersRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.IdentityStoreId !== undefined && { IdentityStoreId: input.IdentityStoreId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.IdentityStoreId !== undefined && + input.IdentityStoreId !== null && { IdentityStoreId: input.IdentityStoreId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -577,7 +587,14 @@ const deserializeAws_json1_1Group = (output: any, context: __SerdeContext): Grou }; const deserializeAws_json1_1Groups = (output: any, context: __SerdeContext): Group[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Group(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Group(entry, context); + }); }; const deserializeAws_json1_1InternalServerException = ( @@ -637,7 +654,14 @@ const deserializeAws_json1_1User = (output: any, context: __SerdeContext): User }; const deserializeAws_json1_1Users = (output: any, context: __SerdeContext): User[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1User(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1User(entry, context); + }); }; const deserializeAws_json1_1ValidationException = (output: any, context: __SerdeContext): ValidationException => { @@ -697,3 +721,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-imagebuilder/protocols/Aws_restJson1.ts b/clients/client-imagebuilder/protocols/Aws_restJson1.ts index c63a15fd8c03..d32478ea96ec 100644 --- a/clients/client-imagebuilder/protocols/Aws_restJson1.ts +++ b/clients/client-imagebuilder/protocols/Aws_restJson1.ts @@ -167,13 +167,14 @@ export const serializeAws_restJson1CancelImageCreationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CancelImageCreation"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.imageBuildVersionArn !== undefined && { imageBuildVersionArn: input.imageBuildVersionArn }), + ...(input.imageBuildVersionArn !== undefined && + input.imageBuildVersionArn !== null && { imageBuildVersionArn: input.imageBuildVersionArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -192,24 +193,27 @@ export const serializeAws_restJson1CreateComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateComponent"; let body: any; body = JSON.stringify({ - ...(input.changeDescription !== undefined && { changeDescription: input.changeDescription }), + ...(input.changeDescription !== undefined && + input.changeDescription !== null && { changeDescription: input.changeDescription }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.data !== undefined && { data: input.data }), - ...(input.description !== undefined && { description: input.description }), - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), - ...(input.name !== undefined && { name: input.name }), - ...(input.platform !== undefined && { platform: input.platform }), - ...(input.semanticVersion !== undefined && { semanticVersion: input.semanticVersion }), - ...(input.supportedOsVersions !== undefined && { - supportedOsVersions: serializeAws_restJson1OsVersionList(input.supportedOsVersions, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.uri !== undefined && { uri: input.uri }), + ...(input.data !== undefined && input.data !== null && { data: input.data }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.platform !== undefined && input.platform !== null && { platform: input.platform }), + ...(input.semanticVersion !== undefined && + input.semanticVersion !== null && { semanticVersion: input.semanticVersion }), + ...(input.supportedOsVersions !== undefined && + input.supportedOsVersions !== null && { + supportedOsVersions: serializeAws_restJson1OsVersionList(input.supportedOsVersions, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.uri !== undefined && input.uri !== null && { uri: input.uri }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -228,18 +232,19 @@ export const serializeAws_restJson1CreateDistributionConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateDistributionConfiguration"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.distributions !== undefined && { - distributions: serializeAws_restJson1DistributionList(input.distributions, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.distributions !== undefined && + input.distributions !== null && { + distributions: serializeAws_restJson1DistributionList(input.distributions, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -258,26 +263,31 @@ export const serializeAws_restJson1CreateImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateImage"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.distributionConfigurationArn !== undefined && { - distributionConfigurationArn: input.distributionConfigurationArn, - }), - ...(input.enhancedImageMetadataEnabled !== undefined && { - enhancedImageMetadataEnabled: input.enhancedImageMetadataEnabled, - }), - ...(input.imageRecipeArn !== undefined && { imageRecipeArn: input.imageRecipeArn }), - ...(input.imageTestsConfiguration !== undefined && { - imageTestsConfiguration: serializeAws_restJson1ImageTestsConfiguration(input.imageTestsConfiguration, context), - }), - ...(input.infrastructureConfigurationArn !== undefined && { - infrastructureConfigurationArn: input.infrastructureConfigurationArn, - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.distributionConfigurationArn !== undefined && + input.distributionConfigurationArn !== null && { + distributionConfigurationArn: input.distributionConfigurationArn, + }), + ...(input.enhancedImageMetadataEnabled !== undefined && + input.enhancedImageMetadataEnabled !== null && { + enhancedImageMetadataEnabled: input.enhancedImageMetadataEnabled, + }), + ...(input.imageRecipeArn !== undefined && + input.imageRecipeArn !== null && { imageRecipeArn: input.imageRecipeArn }), + ...(input.imageTestsConfiguration !== undefined && + input.imageTestsConfiguration !== null && { + imageTestsConfiguration: serializeAws_restJson1ImageTestsConfiguration(input.imageTestsConfiguration, context), + }), + ...(input.infrastructureConfigurationArn !== undefined && + input.infrastructureConfigurationArn !== null && { + infrastructureConfigurationArn: input.infrastructureConfigurationArn, + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -296,30 +306,36 @@ export const serializeAws_restJson1CreateImagePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateImagePipeline"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.distributionConfigurationArn !== undefined && { - distributionConfigurationArn: input.distributionConfigurationArn, - }), - ...(input.enhancedImageMetadataEnabled !== undefined && { - enhancedImageMetadataEnabled: input.enhancedImageMetadataEnabled, - }), - ...(input.imageRecipeArn !== undefined && { imageRecipeArn: input.imageRecipeArn }), - ...(input.imageTestsConfiguration !== undefined && { - imageTestsConfiguration: serializeAws_restJson1ImageTestsConfiguration(input.imageTestsConfiguration, context), - }), - ...(input.infrastructureConfigurationArn !== undefined && { - infrastructureConfigurationArn: input.infrastructureConfigurationArn, - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.schedule !== undefined && { schedule: serializeAws_restJson1Schedule(input.schedule, context) }), - ...(input.status !== undefined && { status: input.status }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.distributionConfigurationArn !== undefined && + input.distributionConfigurationArn !== null && { + distributionConfigurationArn: input.distributionConfigurationArn, + }), + ...(input.enhancedImageMetadataEnabled !== undefined && + input.enhancedImageMetadataEnabled !== null && { + enhancedImageMetadataEnabled: input.enhancedImageMetadataEnabled, + }), + ...(input.imageRecipeArn !== undefined && + input.imageRecipeArn !== null && { imageRecipeArn: input.imageRecipeArn }), + ...(input.imageTestsConfiguration !== undefined && + input.imageTestsConfiguration !== null && { + imageTestsConfiguration: serializeAws_restJson1ImageTestsConfiguration(input.imageTestsConfiguration, context), + }), + ...(input.infrastructureConfigurationArn !== undefined && + input.infrastructureConfigurationArn !== null && { + infrastructureConfigurationArn: input.infrastructureConfigurationArn, + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.schedule !== undefined && + input.schedule !== null && { schedule: serializeAws_restJson1Schedule(input.schedule, context) }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -338,24 +354,28 @@ export const serializeAws_restJson1CreateImageRecipeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateImageRecipe"; let body: any; body = JSON.stringify({ - ...(input.blockDeviceMappings !== undefined && { - blockDeviceMappings: serializeAws_restJson1InstanceBlockDeviceMappings(input.blockDeviceMappings, context), - }), + ...(input.blockDeviceMappings !== undefined && + input.blockDeviceMappings !== null && { + blockDeviceMappings: serializeAws_restJson1InstanceBlockDeviceMappings(input.blockDeviceMappings, context), + }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.components !== undefined && { - components: serializeAws_restJson1ComponentConfigurationList(input.components, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.parentImage !== undefined && { parentImage: input.parentImage }), - ...(input.semanticVersion !== undefined && { semanticVersion: input.semanticVersion }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.workingDirectory !== undefined && { workingDirectory: input.workingDirectory }), + ...(input.components !== undefined && + input.components !== null && { + components: serializeAws_restJson1ComponentConfigurationList(input.components, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.parentImage !== undefined && input.parentImage !== null && { parentImage: input.parentImage }), + ...(input.semanticVersion !== undefined && + input.semanticVersion !== null && { semanticVersion: input.semanticVersion }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.workingDirectory !== undefined && + input.workingDirectory !== null && { workingDirectory: input.workingDirectory }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -374,32 +394,36 @@ export const serializeAws_restJson1CreateInfrastructureConfigurationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateInfrastructureConfiguration"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.instanceProfileName !== undefined && { instanceProfileName: input.instanceProfileName }), - ...(input.instanceTypes !== undefined && { - instanceTypes: serializeAws_restJson1InstanceTypeList(input.instanceTypes, context), - }), - ...(input.keyPair !== undefined && { keyPair: input.keyPair }), - ...(input.logging !== undefined && { logging: serializeAws_restJson1Logging(input.logging, context) }), - ...(input.name !== undefined && { name: input.name }), - ...(input.resourceTags !== undefined && { - resourceTags: serializeAws_restJson1ResourceTagMap(input.resourceTags, context), - }), - ...(input.securityGroupIds !== undefined && { - securityGroupIds: serializeAws_restJson1SecurityGroupIds(input.securityGroupIds, context), - }), - ...(input.snsTopicArn !== undefined && { snsTopicArn: input.snsTopicArn }), - ...(input.subnetId !== undefined && { subnetId: input.subnetId }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.terminateInstanceOnFailure !== undefined && { - terminateInstanceOnFailure: input.terminateInstanceOnFailure, - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.instanceProfileName !== undefined && + input.instanceProfileName !== null && { instanceProfileName: input.instanceProfileName }), + ...(input.instanceTypes !== undefined && + input.instanceTypes !== null && { + instanceTypes: serializeAws_restJson1InstanceTypeList(input.instanceTypes, context), + }), + ...(input.keyPair !== undefined && input.keyPair !== null && { keyPair: input.keyPair }), + ...(input.logging !== undefined && + input.logging !== null && { logging: serializeAws_restJson1Logging(input.logging, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.resourceTags !== undefined && + input.resourceTags !== null && { + resourceTags: serializeAws_restJson1ResourceTagMap(input.resourceTags, context), + }), + ...(input.securityGroupIds !== undefined && + input.securityGroupIds !== null && { + securityGroupIds: serializeAws_restJson1SecurityGroupIds(input.securityGroupIds, context), + }), + ...(input.snsTopicArn !== undefined && input.snsTopicArn !== null && { snsTopicArn: input.snsTopicArn }), + ...(input.subnetId !== undefined && input.subnetId !== null && { subnetId: input.subnetId }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.terminateInstanceOnFailure !== undefined && + input.terminateInstanceOnFailure !== null && { terminateInstanceOnFailure: input.terminateInstanceOnFailure }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -417,9 +441,7 @@ export const serializeAws_restJson1DeleteComponentCommand = async ( input: DeleteComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/DeleteComponent"; const query: any = { ...(input.componentBuildVersionArn !== undefined && { componentBuildVersionArn: input.componentBuildVersionArn }), @@ -442,9 +464,7 @@ export const serializeAws_restJson1DeleteDistributionConfigurationCommand = asyn input: DeleteDistributionConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/DeleteDistributionConfiguration"; const query: any = { ...(input.distributionConfigurationArn !== undefined && { @@ -469,9 +489,7 @@ export const serializeAws_restJson1DeleteImageCommand = async ( input: DeleteImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/DeleteImage"; const query: any = { ...(input.imageBuildVersionArn !== undefined && { imageBuildVersionArn: input.imageBuildVersionArn }), @@ -494,9 +512,7 @@ export const serializeAws_restJson1DeleteImagePipelineCommand = async ( input: DeleteImagePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/DeleteImagePipeline"; const query: any = { ...(input.imagePipelineArn !== undefined && { imagePipelineArn: input.imagePipelineArn }), @@ -519,9 +535,7 @@ export const serializeAws_restJson1DeleteImageRecipeCommand = async ( input: DeleteImageRecipeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/DeleteImageRecipe"; const query: any = { ...(input.imageRecipeArn !== undefined && { imageRecipeArn: input.imageRecipeArn }), @@ -544,9 +558,7 @@ export const serializeAws_restJson1DeleteInfrastructureConfigurationCommand = as input: DeleteInfrastructureConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/DeleteInfrastructureConfiguration"; const query: any = { ...(input.infrastructureConfigurationArn !== undefined && { @@ -571,9 +583,7 @@ export const serializeAws_restJson1GetComponentCommand = async ( input: GetComponentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/GetComponent"; const query: any = { ...(input.componentBuildVersionArn !== undefined && { componentBuildVersionArn: input.componentBuildVersionArn }), @@ -596,9 +606,7 @@ export const serializeAws_restJson1GetComponentPolicyCommand = async ( input: GetComponentPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/GetComponentPolicy"; const query: any = { ...(input.componentArn !== undefined && { componentArn: input.componentArn }), @@ -621,9 +629,7 @@ export const serializeAws_restJson1GetDistributionConfigurationCommand = async ( input: GetDistributionConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/GetDistributionConfiguration"; const query: any = { ...(input.distributionConfigurationArn !== undefined && { @@ -648,9 +654,7 @@ export const serializeAws_restJson1GetImageCommand = async ( input: GetImageCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/GetImage"; const query: any = { ...(input.imageBuildVersionArn !== undefined && { imageBuildVersionArn: input.imageBuildVersionArn }), @@ -673,9 +677,7 @@ export const serializeAws_restJson1GetImagePipelineCommand = async ( input: GetImagePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/GetImagePipeline"; const query: any = { ...(input.imagePipelineArn !== undefined && { imagePipelineArn: input.imagePipelineArn }), @@ -698,9 +700,7 @@ export const serializeAws_restJson1GetImagePolicyCommand = async ( input: GetImagePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/GetImagePolicy"; const query: any = { ...(input.imageArn !== undefined && { imageArn: input.imageArn }), @@ -723,9 +723,7 @@ export const serializeAws_restJson1GetImageRecipeCommand = async ( input: GetImageRecipeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/GetImageRecipe"; const query: any = { ...(input.imageRecipeArn !== undefined && { imageRecipeArn: input.imageRecipeArn }), @@ -748,9 +746,7 @@ export const serializeAws_restJson1GetImageRecipePolicyCommand = async ( input: GetImageRecipePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/GetImageRecipePolicy"; const query: any = { ...(input.imageRecipeArn !== undefined && { imageRecipeArn: input.imageRecipeArn }), @@ -773,9 +769,7 @@ export const serializeAws_restJson1GetInfrastructureConfigurationCommand = async input: GetInfrastructureConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/GetInfrastructureConfiguration"; const query: any = { ...(input.infrastructureConfigurationArn !== undefined && { @@ -801,23 +795,25 @@ export const serializeAws_restJson1ImportComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ImportComponent"; let body: any; body = JSON.stringify({ - ...(input.changeDescription !== undefined && { changeDescription: input.changeDescription }), + ...(input.changeDescription !== undefined && + input.changeDescription !== null && { changeDescription: input.changeDescription }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.data !== undefined && { data: input.data }), - ...(input.description !== undefined && { description: input.description }), - ...(input.format !== undefined && { format: input.format }), - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), - ...(input.name !== undefined && { name: input.name }), - ...(input.platform !== undefined && { platform: input.platform }), - ...(input.semanticVersion !== undefined && { semanticVersion: input.semanticVersion }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.type !== undefined && { type: input.type }), - ...(input.uri !== undefined && { uri: input.uri }), + ...(input.data !== undefined && input.data !== null && { data: input.data }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.format !== undefined && input.format !== null && { format: input.format }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.platform !== undefined && input.platform !== null && { platform: input.platform }), + ...(input.semanticVersion !== undefined && + input.semanticVersion !== null && { semanticVersion: input.semanticVersion }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.uri !== undefined && input.uri !== null && { uri: input.uri }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -836,14 +832,15 @@ export const serializeAws_restJson1ListComponentBuildVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListComponentBuildVersions"; let body: any; body = JSON.stringify({ - ...(input.componentVersionArn !== undefined && { componentVersionArn: input.componentVersionArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.componentVersionArn !== undefined && + input.componentVersionArn !== null && { componentVersionArn: input.componentVersionArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -862,15 +859,16 @@ export const serializeAws_restJson1ListComponentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListComponents"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1FilterList(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.owner !== undefined && { owner: input.owner }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.owner !== undefined && input.owner !== null && { owner: input.owner }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -889,14 +887,15 @@ export const serializeAws_restJson1ListDistributionConfigurationsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListDistributionConfigurations"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1FilterList(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -915,15 +914,17 @@ export const serializeAws_restJson1ListImageBuildVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListImageBuildVersions"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1FilterList(input.filters, context) }), - ...(input.imageVersionArn !== undefined && { imageVersionArn: input.imageVersionArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }), + ...(input.imageVersionArn !== undefined && + input.imageVersionArn !== null && { imageVersionArn: input.imageVersionArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -942,15 +943,17 @@ export const serializeAws_restJson1ListImagePipelineImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListImagePipelineImages"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1FilterList(input.filters, context) }), - ...(input.imagePipelineArn !== undefined && { imagePipelineArn: input.imagePipelineArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }), + ...(input.imagePipelineArn !== undefined && + input.imagePipelineArn !== null && { imagePipelineArn: input.imagePipelineArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -969,14 +972,15 @@ export const serializeAws_restJson1ListImagePipelinesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListImagePipelines"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1FilterList(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -995,15 +999,16 @@ export const serializeAws_restJson1ListImageRecipesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListImageRecipes"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1FilterList(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.owner !== undefined && { owner: input.owner }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.owner !== undefined && input.owner !== null && { owner: input.owner }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1022,15 +1027,16 @@ export const serializeAws_restJson1ListImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListImages"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1FilterList(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.owner !== undefined && { owner: input.owner }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.owner !== undefined && input.owner !== null && { owner: input.owner }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1049,14 +1055,15 @@ export const serializeAws_restJson1ListInfrastructureConfigurationsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListInfrastructureConfigurations"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1FilterList(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1FilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1074,9 +1081,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1105,13 +1110,13 @@ export const serializeAws_restJson1PutComponentPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/PutComponentPolicy"; let body: any; body = JSON.stringify({ - ...(input.componentArn !== undefined && { componentArn: input.componentArn }), - ...(input.policy !== undefined && { policy: input.policy }), + ...(input.componentArn !== undefined && input.componentArn !== null && { componentArn: input.componentArn }), + ...(input.policy !== undefined && input.policy !== null && { policy: input.policy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1130,13 +1135,13 @@ export const serializeAws_restJson1PutImagePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/PutImagePolicy"; let body: any; body = JSON.stringify({ - ...(input.imageArn !== undefined && { imageArn: input.imageArn }), - ...(input.policy !== undefined && { policy: input.policy }), + ...(input.imageArn !== undefined && input.imageArn !== null && { imageArn: input.imageArn }), + ...(input.policy !== undefined && input.policy !== null && { policy: input.policy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1155,13 +1160,14 @@ export const serializeAws_restJson1PutImageRecipePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/PutImageRecipePolicy"; let body: any; body = JSON.stringify({ - ...(input.imageRecipeArn !== undefined && { imageRecipeArn: input.imageRecipeArn }), - ...(input.policy !== undefined && { policy: input.policy }), + ...(input.imageRecipeArn !== undefined && + input.imageRecipeArn !== null && { imageRecipeArn: input.imageRecipeArn }), + ...(input.policy !== undefined && input.policy !== null && { policy: input.policy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1180,13 +1186,14 @@ export const serializeAws_restJson1StartImagePipelineExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/StartImagePipelineExecution"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.imagePipelineArn !== undefined && { imagePipelineArn: input.imagePipelineArn }), + ...(input.imagePipelineArn !== undefined && + input.imagePipelineArn !== null && { imagePipelineArn: input.imagePipelineArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1205,7 +1212,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -1219,7 +1226,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1237,9 +1244,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1272,19 +1277,21 @@ export const serializeAws_restJson1UpdateDistributionConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UpdateDistributionConfiguration"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.distributionConfigurationArn !== undefined && { - distributionConfigurationArn: input.distributionConfigurationArn, - }), - ...(input.distributions !== undefined && { - distributions: serializeAws_restJson1DistributionList(input.distributions, context), - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.distributionConfigurationArn !== undefined && + input.distributionConfigurationArn !== null && { + distributionConfigurationArn: input.distributionConfigurationArn, + }), + ...(input.distributions !== undefined && + input.distributions !== null && { + distributions: serializeAws_restJson1DistributionList(input.distributions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1303,29 +1310,36 @@ export const serializeAws_restJson1UpdateImagePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UpdateImagePipeline"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.distributionConfigurationArn !== undefined && { - distributionConfigurationArn: input.distributionConfigurationArn, - }), - ...(input.enhancedImageMetadataEnabled !== undefined && { - enhancedImageMetadataEnabled: input.enhancedImageMetadataEnabled, - }), - ...(input.imagePipelineArn !== undefined && { imagePipelineArn: input.imagePipelineArn }), - ...(input.imageRecipeArn !== undefined && { imageRecipeArn: input.imageRecipeArn }), - ...(input.imageTestsConfiguration !== undefined && { - imageTestsConfiguration: serializeAws_restJson1ImageTestsConfiguration(input.imageTestsConfiguration, context), - }), - ...(input.infrastructureConfigurationArn !== undefined && { - infrastructureConfigurationArn: input.infrastructureConfigurationArn, - }), - ...(input.schedule !== undefined && { schedule: serializeAws_restJson1Schedule(input.schedule, context) }), - ...(input.status !== undefined && { status: input.status }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.distributionConfigurationArn !== undefined && + input.distributionConfigurationArn !== null && { + distributionConfigurationArn: input.distributionConfigurationArn, + }), + ...(input.enhancedImageMetadataEnabled !== undefined && + input.enhancedImageMetadataEnabled !== null && { + enhancedImageMetadataEnabled: input.enhancedImageMetadataEnabled, + }), + ...(input.imagePipelineArn !== undefined && + input.imagePipelineArn !== null && { imagePipelineArn: input.imagePipelineArn }), + ...(input.imageRecipeArn !== undefined && + input.imageRecipeArn !== null && { imageRecipeArn: input.imageRecipeArn }), + ...(input.imageTestsConfiguration !== undefined && + input.imageTestsConfiguration !== null && { + imageTestsConfiguration: serializeAws_restJson1ImageTestsConfiguration(input.imageTestsConfiguration, context), + }), + ...(input.infrastructureConfigurationArn !== undefined && + input.infrastructureConfigurationArn !== null && { + infrastructureConfigurationArn: input.infrastructureConfigurationArn, + }), + ...(input.schedule !== undefined && + input.schedule !== null && { schedule: serializeAws_restJson1Schedule(input.schedule, context) }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1344,33 +1358,38 @@ export const serializeAws_restJson1UpdateInfrastructureConfigurationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UpdateInfrastructureConfiguration"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.infrastructureConfigurationArn !== undefined && { - infrastructureConfigurationArn: input.infrastructureConfigurationArn, - }), - ...(input.instanceProfileName !== undefined && { instanceProfileName: input.instanceProfileName }), - ...(input.instanceTypes !== undefined && { - instanceTypes: serializeAws_restJson1InstanceTypeList(input.instanceTypes, context), - }), - ...(input.keyPair !== undefined && { keyPair: input.keyPair }), - ...(input.logging !== undefined && { logging: serializeAws_restJson1Logging(input.logging, context) }), - ...(input.resourceTags !== undefined && { - resourceTags: serializeAws_restJson1ResourceTagMap(input.resourceTags, context), - }), - ...(input.securityGroupIds !== undefined && { - securityGroupIds: serializeAws_restJson1SecurityGroupIds(input.securityGroupIds, context), - }), - ...(input.snsTopicArn !== undefined && { snsTopicArn: input.snsTopicArn }), - ...(input.subnetId !== undefined && { subnetId: input.subnetId }), - ...(input.terminateInstanceOnFailure !== undefined && { - terminateInstanceOnFailure: input.terminateInstanceOnFailure, - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.infrastructureConfigurationArn !== undefined && + input.infrastructureConfigurationArn !== null && { + infrastructureConfigurationArn: input.infrastructureConfigurationArn, + }), + ...(input.instanceProfileName !== undefined && + input.instanceProfileName !== null && { instanceProfileName: input.instanceProfileName }), + ...(input.instanceTypes !== undefined && + input.instanceTypes !== null && { + instanceTypes: serializeAws_restJson1InstanceTypeList(input.instanceTypes, context), + }), + ...(input.keyPair !== undefined && input.keyPair !== null && { keyPair: input.keyPair }), + ...(input.logging !== undefined && + input.logging !== null && { logging: serializeAws_restJson1Logging(input.logging, context) }), + ...(input.resourceTags !== undefined && + input.resourceTags !== null && { + resourceTags: serializeAws_restJson1ResourceTagMap(input.resourceTags, context), + }), + ...(input.securityGroupIds !== undefined && + input.securityGroupIds !== null && { + securityGroupIds: serializeAws_restJson1SecurityGroupIds(input.securityGroupIds, context), + }), + ...(input.snsTopicArn !== undefined && input.snsTopicArn !== null && { snsTopicArn: input.snsTopicArn }), + ...(input.subnetId !== undefined && input.subnetId !== null && { subnetId: input.subnetId }), + ...(input.terminateInstanceOnFailure !== undefined && + input.terminateInstanceOnFailure !== null && { terminateInstanceOnFailure: input.terminateInstanceOnFailure }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6354,7 +6373,14 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async ( }; const serializeAws_restJson1AccountList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AmiDistributionConfiguration = ( @@ -6362,22 +6388,25 @@ const serializeAws_restJson1AmiDistributionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.amiTags !== undefined && { amiTags: serializeAws_restJson1TagMap(input.amiTags, context) }), - ...(input.description !== undefined && { description: input.description }), - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), - ...(input.launchPermission !== undefined && { - launchPermission: serializeAws_restJson1LaunchPermissionConfiguration(input.launchPermission, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.targetAccountIds !== undefined && { - targetAccountIds: serializeAws_restJson1AccountList(input.targetAccountIds, context), - }), + ...(input.amiTags !== undefined && + input.amiTags !== null && { amiTags: serializeAws_restJson1TagMap(input.amiTags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), + ...(input.launchPermission !== undefined && + input.launchPermission !== null && { + launchPermission: serializeAws_restJson1LaunchPermissionConfiguration(input.launchPermission, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.targetAccountIds !== undefined && + input.targetAccountIds !== null && { + targetAccountIds: serializeAws_restJson1AccountList(input.targetAccountIds, context), + }), }; }; const serializeAws_restJson1ComponentConfiguration = (input: ComponentConfiguration, context: __SerdeContext): any => { return { - ...(input.componentArn !== undefined && { componentArn: input.componentArn }), + ...(input.componentArn !== undefined && input.componentArn !== null && { componentArn: input.componentArn }), }; }; @@ -6385,29 +6414,45 @@ const serializeAws_restJson1ComponentConfigurationList = ( input: ComponentConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ComponentConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ComponentConfiguration(entry, context); + }); }; const serializeAws_restJson1Distribution = (input: Distribution, context: __SerdeContext): any => { return { - ...(input.amiDistributionConfiguration !== undefined && { - amiDistributionConfiguration: serializeAws_restJson1AmiDistributionConfiguration( - input.amiDistributionConfiguration, - context - ), - }), - ...(input.licenseConfigurationArns !== undefined && { - licenseConfigurationArns: serializeAws_restJson1LicenseConfigurationArnList( - input.licenseConfigurationArns, - context - ), - }), - ...(input.region !== undefined && { region: input.region }), + ...(input.amiDistributionConfiguration !== undefined && + input.amiDistributionConfiguration !== null && { + amiDistributionConfiguration: serializeAws_restJson1AmiDistributionConfiguration( + input.amiDistributionConfiguration, + context + ), + }), + ...(input.licenseConfigurationArns !== undefined && + input.licenseConfigurationArns !== null && { + licenseConfigurationArns: serializeAws_restJson1LicenseConfigurationArnList( + input.licenseConfigurationArns, + context + ), + }), + ...(input.region !== undefined && input.region !== null && { region: input.region }), }; }; const serializeAws_restJson1DistributionList = (input: Distribution[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Distribution(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Distribution(entry, context); + }); }; const serializeAws_restJson1EbsInstanceBlockDeviceSpecification = ( @@ -6415,29 +6460,45 @@ const serializeAws_restJson1EbsInstanceBlockDeviceSpecification = ( context: __SerdeContext ): any => { return { - ...(input.deleteOnTermination !== undefined && { deleteOnTermination: input.deleteOnTermination }), - ...(input.encrypted !== undefined && { encrypted: input.encrypted }), - ...(input.iops !== undefined && { iops: input.iops }), - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), - ...(input.snapshotId !== undefined && { snapshotId: input.snapshotId }), - ...(input.volumeSize !== undefined && { volumeSize: input.volumeSize }), - ...(input.volumeType !== undefined && { volumeType: input.volumeType }), + ...(input.deleteOnTermination !== undefined && + input.deleteOnTermination !== null && { deleteOnTermination: input.deleteOnTermination }), + ...(input.encrypted !== undefined && input.encrypted !== null && { encrypted: input.encrypted }), + ...(input.iops !== undefined && input.iops !== null && { iops: input.iops }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), + ...(input.snapshotId !== undefined && input.snapshotId !== null && { snapshotId: input.snapshotId }), + ...(input.volumeSize !== undefined && input.volumeSize !== null && { volumeSize: input.volumeSize }), + ...(input.volumeType !== undefined && input.volumeType !== null && { volumeType: input.volumeType }), }; }; const serializeAws_restJson1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_restJson1FilterValues(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1FilterValues(input.values, context) }), }; }; const serializeAws_restJson1FilterList = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Filter(entry, context); + }); }; const serializeAws_restJson1FilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ImageTestsConfiguration = ( @@ -6445,8 +6506,10 @@ const serializeAws_restJson1ImageTestsConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.imageTestsEnabled !== undefined && { imageTestsEnabled: input.imageTestsEnabled }), - ...(input.timeoutMinutes !== undefined && { timeoutMinutes: input.timeoutMinutes }), + ...(input.imageTestsEnabled !== undefined && + input.imageTestsEnabled !== null && { imageTestsEnabled: input.imageTestsEnabled }), + ...(input.timeoutMinutes !== undefined && + input.timeoutMinutes !== null && { timeoutMinutes: input.timeoutMinutes }), }; }; @@ -6455,12 +6518,11 @@ const serializeAws_restJson1InstanceBlockDeviceMapping = ( context: __SerdeContext ): any => { return { - ...(input.deviceName !== undefined && { deviceName: input.deviceName }), - ...(input.ebs !== undefined && { - ebs: serializeAws_restJson1EbsInstanceBlockDeviceSpecification(input.ebs, context), - }), - ...(input.noDevice !== undefined && { noDevice: input.noDevice }), - ...(input.virtualName !== undefined && { virtualName: input.virtualName }), + ...(input.deviceName !== undefined && input.deviceName !== null && { deviceName: input.deviceName }), + ...(input.ebs !== undefined && + input.ebs !== null && { ebs: serializeAws_restJson1EbsInstanceBlockDeviceSpecification(input.ebs, context) }), + ...(input.noDevice !== undefined && input.noDevice !== null && { noDevice: input.noDevice }), + ...(input.virtualName !== undefined && input.virtualName !== null && { virtualName: input.virtualName }), }; }; @@ -6468,11 +6530,25 @@ const serializeAws_restJson1InstanceBlockDeviceMappings = ( input: InstanceBlockDeviceMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1InstanceBlockDeviceMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InstanceBlockDeviceMapping(entry, context); + }); }; const serializeAws_restJson1InstanceTypeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1LaunchPermissionConfiguration = ( @@ -6480,71 +6556,115 @@ const serializeAws_restJson1LaunchPermissionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.userGroups !== undefined && { userGroups: serializeAws_restJson1StringList(input.userGroups, context) }), - ...(input.userIds !== undefined && { userIds: serializeAws_restJson1AccountList(input.userIds, context) }), + ...(input.userGroups !== undefined && + input.userGroups !== null && { userGroups: serializeAws_restJson1StringList(input.userGroups, context) }), + ...(input.userIds !== undefined && + input.userIds !== null && { userIds: serializeAws_restJson1AccountList(input.userIds, context) }), }; }; const serializeAws_restJson1LicenseConfigurationArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Logging = (input: Logging, context: __SerdeContext): any => { return { - ...(input.s3Logs !== undefined && { s3Logs: serializeAws_restJson1S3Logs(input.s3Logs, context) }), + ...(input.s3Logs !== undefined && + input.s3Logs !== null && { s3Logs: serializeAws_restJson1S3Logs(input.s3Logs, context) }), }; }; const serializeAws_restJson1OsVersionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResourceTagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1S3Logs = (input: S3Logs, context: __SerdeContext): any => { return { - ...(input.s3BucketName !== undefined && { s3BucketName: input.s3BucketName }), - ...(input.s3KeyPrefix !== undefined && { s3KeyPrefix: input.s3KeyPrefix }), + ...(input.s3BucketName !== undefined && input.s3BucketName !== null && { s3BucketName: input.s3BucketName }), + ...(input.s3KeyPrefix !== undefined && input.s3KeyPrefix !== null && { s3KeyPrefix: input.s3KeyPrefix }), }; }; const serializeAws_restJson1Schedule = (input: Schedule, context: __SerdeContext): any => { return { - ...(input.pipelineExecutionStartCondition !== undefined && { - pipelineExecutionStartCondition: input.pipelineExecutionStartCondition, - }), - ...(input.scheduleExpression !== undefined && { scheduleExpression: input.scheduleExpression }), + ...(input.pipelineExecutionStartCondition !== undefined && + input.pipelineExecutionStartCondition !== null && { + pipelineExecutionStartCondition: input.pipelineExecutionStartCondition, + }), + ...(input.scheduleExpression !== undefined && + input.scheduleExpression !== null && { scheduleExpression: input.scheduleExpression }), }; }; const serializeAws_restJson1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AccountList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Ami = (output: any, context: __SerdeContext): Ami => { @@ -6585,7 +6705,14 @@ const deserializeAws_restJson1AmiDistributionConfiguration = ( }; const deserializeAws_restJson1AmiList = (output: any, context: __SerdeContext): Ami[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Ami(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Ami(entry, context); + }); }; const deserializeAws_restJson1Component = (output: any, context: __SerdeContext): Component => { @@ -6629,7 +6756,14 @@ const deserializeAws_restJson1ComponentConfigurationList = ( output: any, context: __SerdeContext ): ComponentConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ComponentConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ComponentConfiguration(entry, context); + }); }; const deserializeAws_restJson1ComponentSummary = (output: any, context: __SerdeContext): ComponentSummary => { @@ -6658,7 +6792,14 @@ const deserializeAws_restJson1ComponentSummary = (output: any, context: __SerdeC }; const deserializeAws_restJson1ComponentSummaryList = (output: any, context: __SerdeContext): ComponentSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ComponentSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ComponentSummary(entry, context); + }); }; const deserializeAws_restJson1ComponentVersion = (output: any, context: __SerdeContext): ComponentVersion => { @@ -6679,7 +6820,14 @@ const deserializeAws_restJson1ComponentVersion = (output: any, context: __SerdeC }; const deserializeAws_restJson1ComponentVersionList = (output: any, context: __SerdeContext): ComponentVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ComponentVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ComponentVersion(entry, context); + }); }; const deserializeAws_restJson1Distribution = (output: any, context: __SerdeContext): Distribution => { @@ -6740,11 +6888,25 @@ const deserializeAws_restJson1DistributionConfigurationSummaryList = ( output: any, context: __SerdeContext ): DistributionConfigurationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DistributionConfigurationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DistributionConfigurationSummary(entry, context); + }); }; const deserializeAws_restJson1DistributionList = (output: any, context: __SerdeContext): Distribution[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Distribution(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Distribution(entry, context); + }); }; const deserializeAws_restJson1EbsInstanceBlockDeviceSpecification = ( @@ -6857,7 +7019,14 @@ const deserializeAws_restJson1ImagePipeline = (output: any, context: __SerdeCont }; const deserializeAws_restJson1ImagePipelineList = (output: any, context: __SerdeContext): ImagePipeline[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ImagePipeline(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ImagePipeline(entry, context); + }); }; const deserializeAws_restJson1ImageRecipe = (output: any, context: __SerdeContext): ImageRecipe => { @@ -6903,7 +7072,14 @@ const deserializeAws_restJson1ImageRecipeSummary = (output: any, context: __Serd }; const deserializeAws_restJson1ImageRecipeSummaryList = (output: any, context: __SerdeContext): ImageRecipeSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ImageRecipeSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ImageRecipeSummary(entry, context); + }); }; const deserializeAws_restJson1ImageState = (output: any, context: __SerdeContext): ImageState => { @@ -6938,7 +7114,14 @@ const deserializeAws_restJson1ImageSummary = (output: any, context: __SerdeConte }; const deserializeAws_restJson1ImageSummaryList = (output: any, context: __SerdeContext): ImageSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ImageSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ImageSummary(entry, context); + }); }; const deserializeAws_restJson1ImageTestsConfiguration = ( @@ -6968,7 +7151,14 @@ const deserializeAws_restJson1ImageVersion = (output: any, context: __SerdeConte }; const deserializeAws_restJson1ImageVersionList = (output: any, context: __SerdeContext): ImageVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ImageVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ImageVersion(entry, context); + }); }; const deserializeAws_restJson1InfrastructureConfiguration = ( @@ -7040,7 +7230,14 @@ const deserializeAws_restJson1InfrastructureConfigurationSummaryList = ( output: any, context: __SerdeContext ): InfrastructureConfigurationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InfrastructureConfigurationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InfrastructureConfigurationSummary(entry, context); + }); }; const deserializeAws_restJson1InstanceBlockDeviceMapping = ( @@ -7062,11 +7259,25 @@ const deserializeAws_restJson1InstanceBlockDeviceMappings = ( output: any, context: __SerdeContext ): InstanceBlockDeviceMapping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InstanceBlockDeviceMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InstanceBlockDeviceMapping(entry, context); + }); }; const deserializeAws_restJson1InstanceTypeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1LaunchPermissionConfiguration = ( @@ -7086,7 +7297,14 @@ const deserializeAws_restJson1LaunchPermissionConfiguration = ( }; const deserializeAws_restJson1LicenseConfigurationArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Logging = (output: any, context: __SerdeContext): Logging => { @@ -7099,7 +7317,14 @@ const deserializeAws_restJson1Logging = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1OsVersionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1OutputResources = (output: any, context: __SerdeContext): OutputResources => { @@ -7112,13 +7337,15 @@ const deserializeAws_restJson1OutputResources = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ResourceTagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1S3Logs = (output: any, context: __SerdeContext): S3Logs => { @@ -7142,21 +7369,37 @@ const deserializeAws_restJson1Schedule = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -7179,6 +7422,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-inspector/protocols/Aws_json1_1.ts b/clients/client-inspector/protocols/Aws_json1_1.ts index 8aa2b2689e55..66cf9c982a3c 100644 --- a/clients/client-inspector/protocols/Aws_json1_1.ts +++ b/clients/client-inspector/protocols/Aws_json1_1.ts @@ -242,7 +242,7 @@ export const serializeAws_json1_1AddAttributesToFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.AddAttributesToFindings", }; let body: any; @@ -255,7 +255,7 @@ export const serializeAws_json1_1CreateAssessmentTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.CreateAssessmentTarget", }; let body: any; @@ -268,7 +268,7 @@ export const serializeAws_json1_1CreateAssessmentTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.CreateAssessmentTemplate", }; let body: any; @@ -281,7 +281,7 @@ export const serializeAws_json1_1CreateExclusionsPreviewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.CreateExclusionsPreview", }; let body: any; @@ -294,7 +294,7 @@ export const serializeAws_json1_1CreateResourceGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.CreateResourceGroup", }; let body: any; @@ -307,7 +307,7 @@ export const serializeAws_json1_1DeleteAssessmentRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DeleteAssessmentRun", }; let body: any; @@ -320,7 +320,7 @@ export const serializeAws_json1_1DeleteAssessmentTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DeleteAssessmentTarget", }; let body: any; @@ -333,7 +333,7 @@ export const serializeAws_json1_1DeleteAssessmentTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DeleteAssessmentTemplate", }; let body: any; @@ -346,7 +346,7 @@ export const serializeAws_json1_1DescribeAssessmentRunsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DescribeAssessmentRuns", }; let body: any; @@ -359,7 +359,7 @@ export const serializeAws_json1_1DescribeAssessmentTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DescribeAssessmentTargets", }; let body: any; @@ -372,7 +372,7 @@ export const serializeAws_json1_1DescribeAssessmentTemplatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DescribeAssessmentTemplates", }; let body: any; @@ -385,7 +385,7 @@ export const serializeAws_json1_1DescribeCrossAccountAccessRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DescribeCrossAccountAccessRole", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -396,7 +396,7 @@ export const serializeAws_json1_1DescribeExclusionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DescribeExclusions", }; let body: any; @@ -409,7 +409,7 @@ export const serializeAws_json1_1DescribeFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DescribeFindings", }; let body: any; @@ -422,7 +422,7 @@ export const serializeAws_json1_1DescribeResourceGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DescribeResourceGroups", }; let body: any; @@ -435,7 +435,7 @@ export const serializeAws_json1_1DescribeRulesPackagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.DescribeRulesPackages", }; let body: any; @@ -448,7 +448,7 @@ export const serializeAws_json1_1GetAssessmentReportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.GetAssessmentReport", }; let body: any; @@ -461,7 +461,7 @@ export const serializeAws_json1_1GetExclusionsPreviewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.GetExclusionsPreview", }; let body: any; @@ -474,7 +474,7 @@ export const serializeAws_json1_1GetTelemetryMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.GetTelemetryMetadata", }; let body: any; @@ -487,7 +487,7 @@ export const serializeAws_json1_1ListAssessmentRunAgentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.ListAssessmentRunAgents", }; let body: any; @@ -500,7 +500,7 @@ export const serializeAws_json1_1ListAssessmentRunsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.ListAssessmentRuns", }; let body: any; @@ -513,7 +513,7 @@ export const serializeAws_json1_1ListAssessmentTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.ListAssessmentTargets", }; let body: any; @@ -526,7 +526,7 @@ export const serializeAws_json1_1ListAssessmentTemplatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.ListAssessmentTemplates", }; let body: any; @@ -539,7 +539,7 @@ export const serializeAws_json1_1ListEventSubscriptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.ListEventSubscriptions", }; let body: any; @@ -552,7 +552,7 @@ export const serializeAws_json1_1ListExclusionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.ListExclusions", }; let body: any; @@ -565,7 +565,7 @@ export const serializeAws_json1_1ListFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.ListFindings", }; let body: any; @@ -578,7 +578,7 @@ export const serializeAws_json1_1ListRulesPackagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.ListRulesPackages", }; let body: any; @@ -591,7 +591,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.ListTagsForResource", }; let body: any; @@ -604,7 +604,7 @@ export const serializeAws_json1_1PreviewAgentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.PreviewAgents", }; let body: any; @@ -617,7 +617,7 @@ export const serializeAws_json1_1RegisterCrossAccountAccessRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.RegisterCrossAccountAccessRole", }; let body: any; @@ -630,7 +630,7 @@ export const serializeAws_json1_1RemoveAttributesFromFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.RemoveAttributesFromFindings", }; let body: any; @@ -643,7 +643,7 @@ export const serializeAws_json1_1SetTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.SetTagsForResource", }; let body: any; @@ -656,7 +656,7 @@ export const serializeAws_json1_1StartAssessmentRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.StartAssessmentRun", }; let body: any; @@ -669,7 +669,7 @@ export const serializeAws_json1_1StopAssessmentRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.StopAssessmentRun", }; let body: any; @@ -682,7 +682,7 @@ export const serializeAws_json1_1SubscribeToEventCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.SubscribeToEvent", }; let body: any; @@ -695,7 +695,7 @@ export const serializeAws_json1_1UnsubscribeFromEventCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.UnsubscribeFromEvent", }; let body: any; @@ -708,7 +708,7 @@ export const serializeAws_json1_1UpdateAssessmentTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "InspectorService.UpdateAssessmentTarget", }; let body: any; @@ -743,8 +743,7 @@ const deserializeAws_json1_1AddAttributesToFindingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -830,8 +829,7 @@ const deserializeAws_json1_1CreateAssessmentTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -933,8 +931,7 @@ const deserializeAws_json1_1CreateAssessmentTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -1028,8 +1025,7 @@ const deserializeAws_json1_1CreateExclusionsPreviewCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -1123,8 +1119,7 @@ const deserializeAws_json1_1CreateResourceGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -1207,8 +1202,7 @@ const deserializeAws_json1_1DeleteAssessmentRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -1299,8 +1293,7 @@ const deserializeAws_json1_1DeleteAssessmentTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -1391,8 +1384,7 @@ const deserializeAws_json1_1DeleteAssessmentTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -1486,8 +1478,7 @@ const deserializeAws_json1_1DescribeAssessmentRunsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.inspector#InternalException": @@ -1549,8 +1540,7 @@ const deserializeAws_json1_1DescribeAssessmentTargetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.inspector#InternalException": @@ -1612,8 +1602,7 @@ const deserializeAws_json1_1DescribeAssessmentTemplatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.inspector#InternalException": @@ -1675,8 +1664,7 @@ const deserializeAws_json1_1DescribeCrossAccountAccessRoleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.inspector#InternalException": @@ -1730,8 +1718,7 @@ const deserializeAws_json1_1DescribeExclusionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.inspector#InternalException": @@ -1793,8 +1780,7 @@ const deserializeAws_json1_1DescribeFindingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.inspector#InternalException": @@ -1856,8 +1842,7 @@ const deserializeAws_json1_1DescribeResourceGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.inspector#InternalException": @@ -1919,8 +1904,7 @@ const deserializeAws_json1_1DescribeRulesPackagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.inspector#InternalException": @@ -1982,8 +1966,7 @@ const deserializeAws_json1_1GetAssessmentReportCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2085,8 +2068,7 @@ const deserializeAws_json1_1GetExclusionsPreviewCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2164,8 +2146,7 @@ const deserializeAws_json1_1GetTelemetryMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2243,8 +2224,7 @@ const deserializeAws_json1_1ListAssessmentRunAgentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2322,8 +2302,7 @@ const deserializeAws_json1_1ListAssessmentRunsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2401,8 +2380,7 @@ const deserializeAws_json1_1ListAssessmentTargetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2472,8 +2450,7 @@ const deserializeAws_json1_1ListAssessmentTemplatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2551,8 +2528,7 @@ const deserializeAws_json1_1ListEventSubscriptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2630,8 +2606,7 @@ const deserializeAws_json1_1ListExclusionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2709,8 +2684,7 @@ const deserializeAws_json1_1ListFindingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2788,8 +2762,7 @@ const deserializeAws_json1_1ListRulesPackagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2859,8 +2832,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -2938,8 +2910,7 @@ const deserializeAws_json1_1PreviewAgentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -3022,8 +2993,7 @@ const deserializeAws_json1_1RegisterCrossAccountAccessRoleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -3109,8 +3079,7 @@ const deserializeAws_json1_1RemoveAttributesFromFindingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -3193,8 +3162,7 @@ const deserializeAws_json1_1SetTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -3280,8 +3248,7 @@ const deserializeAws_json1_1StartAssessmentRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -3388,8 +3355,7 @@ const deserializeAws_json1_1StopAssessmentRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -3472,8 +3438,7 @@ const deserializeAws_json1_1SubscribeToEventCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -3564,8 +3529,7 @@ const deserializeAws_json1_1UnsubscribeFromEventCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -3648,8 +3612,7 @@ const deserializeAws_json1_1UpdateAssessmentTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.inspector#AccessDeniedException": @@ -3878,61 +3841,97 @@ const serializeAws_json1_1AddAttributesToFindingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.attributes !== undefined && { - attributes: serializeAws_json1_1UserAttributeList(input.attributes, context), - }), - ...(input.findingArns !== undefined && { - findingArns: serializeAws_json1_1AddRemoveAttributesFindingArnList(input.findingArns, context), - }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_json1_1UserAttributeList(input.attributes, context) }), + ...(input.findingArns !== undefined && + input.findingArns !== null && { + findingArns: serializeAws_json1_1AddRemoveAttributesFindingArnList(input.findingArns, context), + }), }; }; const serializeAws_json1_1AddRemoveAttributesFindingArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AgentFilter = (input: AgentFilter, context: __SerdeContext): any => { return { - ...(input.agentHealthCodes !== undefined && { - agentHealthCodes: serializeAws_json1_1AgentHealthCodeList(input.agentHealthCodes, context), - }), - ...(input.agentHealths !== undefined && { - agentHealths: serializeAws_json1_1AgentHealthList(input.agentHealths, context), - }), + ...(input.agentHealthCodes !== undefined && + input.agentHealthCodes !== null && { + agentHealthCodes: serializeAws_json1_1AgentHealthCodeList(input.agentHealthCodes, context), + }), + ...(input.agentHealths !== undefined && + input.agentHealths !== null && { + agentHealths: serializeAws_json1_1AgentHealthList(input.agentHealths, context), + }), }; }; const serializeAws_json1_1AgentHealthCodeList = (input: (AgentHealthCode | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AgentHealthList = (input: (AgentHealth | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AgentIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssessmentRunFilter = (input: AssessmentRunFilter, context: __SerdeContext): any => { return { - ...(input.completionTimeRange !== undefined && { - completionTimeRange: serializeAws_json1_1TimestampRange(input.completionTimeRange, context), - }), - ...(input.durationRange !== undefined && { - durationRange: serializeAws_json1_1DurationRange(input.durationRange, context), - }), - ...(input.namePattern !== undefined && { namePattern: input.namePattern }), - ...(input.rulesPackageArns !== undefined && { - rulesPackageArns: serializeAws_json1_1FilterRulesPackageArnList(input.rulesPackageArns, context), - }), - ...(input.startTimeRange !== undefined && { - startTimeRange: serializeAws_json1_1TimestampRange(input.startTimeRange, context), - }), - ...(input.stateChangeTimeRange !== undefined && { - stateChangeTimeRange: serializeAws_json1_1TimestampRange(input.stateChangeTimeRange, context), - }), - ...(input.states !== undefined && { states: serializeAws_json1_1AssessmentRunStateList(input.states, context) }), + ...(input.completionTimeRange !== undefined && + input.completionTimeRange !== null && { + completionTimeRange: serializeAws_json1_1TimestampRange(input.completionTimeRange, context), + }), + ...(input.durationRange !== undefined && + input.durationRange !== null && { + durationRange: serializeAws_json1_1DurationRange(input.durationRange, context), + }), + ...(input.namePattern !== undefined && input.namePattern !== null && { namePattern: input.namePattern }), + ...(input.rulesPackageArns !== undefined && + input.rulesPackageArns !== null && { + rulesPackageArns: serializeAws_json1_1FilterRulesPackageArnList(input.rulesPackageArns, context), + }), + ...(input.startTimeRange !== undefined && + input.startTimeRange !== null && { + startTimeRange: serializeAws_json1_1TimestampRange(input.startTimeRange, context), + }), + ...(input.stateChangeTimeRange !== undefined && + input.stateChangeTimeRange !== null && { + stateChangeTimeRange: serializeAws_json1_1TimestampRange(input.stateChangeTimeRange, context), + }), + ...(input.states !== undefined && + input.states !== null && { states: serializeAws_json1_1AssessmentRunStateList(input.states, context) }), }; }; @@ -3940,14 +3939,20 @@ const serializeAws_json1_1AssessmentRunStateList = ( input: (AssessmentRunState | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssessmentTargetFilter = (input: AssessmentTargetFilter, context: __SerdeContext): any => { return { - ...(input.assessmentTargetNamePattern !== undefined && { - assessmentTargetNamePattern: input.assessmentTargetNamePattern, - }), + ...(input.assessmentTargetNamePattern !== undefined && + input.assessmentTargetNamePattern !== null && { assessmentTargetNamePattern: input.assessmentTargetNamePattern }), }; }; @@ -3956,41 +3961,78 @@ const serializeAws_json1_1AssessmentTemplateFilter = ( context: __SerdeContext ): any => { return { - ...(input.durationRange !== undefined && { - durationRange: serializeAws_json1_1DurationRange(input.durationRange, context), - }), - ...(input.namePattern !== undefined && { namePattern: input.namePattern }), - ...(input.rulesPackageArns !== undefined && { - rulesPackageArns: serializeAws_json1_1FilterRulesPackageArnList(input.rulesPackageArns, context), - }), + ...(input.durationRange !== undefined && + input.durationRange !== null && { + durationRange: serializeAws_json1_1DurationRange(input.durationRange, context), + }), + ...(input.namePattern !== undefined && input.namePattern !== null && { namePattern: input.namePattern }), + ...(input.rulesPackageArns !== undefined && + input.rulesPackageArns !== null && { + rulesPackageArns: serializeAws_json1_1FilterRulesPackageArnList(input.rulesPackageArns, context), + }), }; }; const serializeAws_json1_1AssessmentTemplateRulesPackageArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Attribute = (input: Attribute, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1AttributeList = (input: Attribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Attribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Attribute(entry, context); + }); }; const serializeAws_json1_1AutoScalingGroupList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchDescribeArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BatchDescribeExclusionsArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateAssessmentTargetRequest = ( @@ -3998,8 +4040,10 @@ const serializeAws_json1_1CreateAssessmentTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTargetName !== undefined && { assessmentTargetName: input.assessmentTargetName }), - ...(input.resourceGroupArn !== undefined && { resourceGroupArn: input.resourceGroupArn }), + ...(input.assessmentTargetName !== undefined && + input.assessmentTargetName !== null && { assessmentTargetName: input.assessmentTargetName }), + ...(input.resourceGroupArn !== undefined && + input.resourceGroupArn !== null && { resourceGroupArn: input.resourceGroupArn }), }; }; @@ -4008,15 +4052,20 @@ const serializeAws_json1_1CreateAssessmentTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTargetArn !== undefined && { assessmentTargetArn: input.assessmentTargetArn }), - ...(input.assessmentTemplateName !== undefined && { assessmentTemplateName: input.assessmentTemplateName }), - ...(input.durationInSeconds !== undefined && { durationInSeconds: input.durationInSeconds }), - ...(input.rulesPackageArns !== undefined && { - rulesPackageArns: serializeAws_json1_1AssessmentTemplateRulesPackageArnList(input.rulesPackageArns, context), - }), - ...(input.userAttributesForFindings !== undefined && { - userAttributesForFindings: serializeAws_json1_1UserAttributeList(input.userAttributesForFindings, context), - }), + ...(input.assessmentTargetArn !== undefined && + input.assessmentTargetArn !== null && { assessmentTargetArn: input.assessmentTargetArn }), + ...(input.assessmentTemplateName !== undefined && + input.assessmentTemplateName !== null && { assessmentTemplateName: input.assessmentTemplateName }), + ...(input.durationInSeconds !== undefined && + input.durationInSeconds !== null && { durationInSeconds: input.durationInSeconds }), + ...(input.rulesPackageArns !== undefined && + input.rulesPackageArns !== null && { + rulesPackageArns: serializeAws_json1_1AssessmentTemplateRulesPackageArnList(input.rulesPackageArns, context), + }), + ...(input.userAttributesForFindings !== undefined && + input.userAttributesForFindings !== null && { + userAttributesForFindings: serializeAws_json1_1UserAttributeList(input.userAttributesForFindings, context), + }), }; }; @@ -4025,7 +4074,8 @@ const serializeAws_json1_1CreateExclusionsPreviewRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTemplateArn !== undefined && { assessmentTemplateArn: input.assessmentTemplateArn }), + ...(input.assessmentTemplateArn !== undefined && + input.assessmentTemplateArn !== null && { assessmentTemplateArn: input.assessmentTemplateArn }), }; }; @@ -4034,9 +4084,10 @@ const serializeAws_json1_1CreateResourceGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.resourceGroupTags !== undefined && { - resourceGroupTags: serializeAws_json1_1ResourceGroupTags(input.resourceGroupTags, context), - }), + ...(input.resourceGroupTags !== undefined && + input.resourceGroupTags !== null && { + resourceGroupTags: serializeAws_json1_1ResourceGroupTags(input.resourceGroupTags, context), + }), }; }; @@ -4045,7 +4096,8 @@ const serializeAws_json1_1DeleteAssessmentRunRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentRunArn !== undefined && { assessmentRunArn: input.assessmentRunArn }), + ...(input.assessmentRunArn !== undefined && + input.assessmentRunArn !== null && { assessmentRunArn: input.assessmentRunArn }), }; }; @@ -4054,7 +4106,8 @@ const serializeAws_json1_1DeleteAssessmentTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTargetArn !== undefined && { assessmentTargetArn: input.assessmentTargetArn }), + ...(input.assessmentTargetArn !== undefined && + input.assessmentTargetArn !== null && { assessmentTargetArn: input.assessmentTargetArn }), }; }; @@ -4063,7 +4116,8 @@ const serializeAws_json1_1DeleteAssessmentTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTemplateArn !== undefined && { assessmentTemplateArn: input.assessmentTemplateArn }), + ...(input.assessmentTemplateArn !== undefined && + input.assessmentTemplateArn !== null && { assessmentTemplateArn: input.assessmentTemplateArn }), }; }; @@ -4072,9 +4126,10 @@ const serializeAws_json1_1DescribeAssessmentRunsRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentRunArns !== undefined && { - assessmentRunArns: serializeAws_json1_1BatchDescribeArnList(input.assessmentRunArns, context), - }), + ...(input.assessmentRunArns !== undefined && + input.assessmentRunArns !== null && { + assessmentRunArns: serializeAws_json1_1BatchDescribeArnList(input.assessmentRunArns, context), + }), }; }; @@ -4083,9 +4138,10 @@ const serializeAws_json1_1DescribeAssessmentTargetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTargetArns !== undefined && { - assessmentTargetArns: serializeAws_json1_1BatchDescribeArnList(input.assessmentTargetArns, context), - }), + ...(input.assessmentTargetArns !== undefined && + input.assessmentTargetArns !== null && { + assessmentTargetArns: serializeAws_json1_1BatchDescribeArnList(input.assessmentTargetArns, context), + }), }; }; @@ -4094,9 +4150,10 @@ const serializeAws_json1_1DescribeAssessmentTemplatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTemplateArns !== undefined && { - assessmentTemplateArns: serializeAws_json1_1BatchDescribeArnList(input.assessmentTemplateArns, context), - }), + ...(input.assessmentTemplateArns !== undefined && + input.assessmentTemplateArns !== null && { + assessmentTemplateArns: serializeAws_json1_1BatchDescribeArnList(input.assessmentTemplateArns, context), + }), }; }; @@ -4105,19 +4162,21 @@ const serializeAws_json1_1DescribeExclusionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.exclusionArns !== undefined && { - exclusionArns: serializeAws_json1_1BatchDescribeExclusionsArnList(input.exclusionArns, context), - }), - ...(input.locale !== undefined && { locale: input.locale }), + ...(input.exclusionArns !== undefined && + input.exclusionArns !== null && { + exclusionArns: serializeAws_json1_1BatchDescribeExclusionsArnList(input.exclusionArns, context), + }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), }; }; const serializeAws_json1_1DescribeFindingsRequest = (input: DescribeFindingsRequest, context: __SerdeContext): any => { return { - ...(input.findingArns !== undefined && { - findingArns: serializeAws_json1_1BatchDescribeArnList(input.findingArns, context), - }), - ...(input.locale !== undefined && { locale: input.locale }), + ...(input.findingArns !== undefined && + input.findingArns !== null && { + findingArns: serializeAws_json1_1BatchDescribeArnList(input.findingArns, context), + }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), }; }; @@ -4126,9 +4185,10 @@ const serializeAws_json1_1DescribeResourceGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.resourceGroupArns !== undefined && { - resourceGroupArns: serializeAws_json1_1BatchDescribeArnList(input.resourceGroupArns, context), - }), + ...(input.resourceGroupArns !== undefined && + input.resourceGroupArns !== null && { + resourceGroupArns: serializeAws_json1_1BatchDescribeArnList(input.resourceGroupArns, context), + }), }; }; @@ -4137,42 +4197,58 @@ const serializeAws_json1_1DescribeRulesPackagesRequest = ( context: __SerdeContext ): any => { return { - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.rulesPackageArns !== undefined && { - rulesPackageArns: serializeAws_json1_1BatchDescribeArnList(input.rulesPackageArns, context), - }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.rulesPackageArns !== undefined && + input.rulesPackageArns !== null && { + rulesPackageArns: serializeAws_json1_1BatchDescribeArnList(input.rulesPackageArns, context), + }), }; }; const serializeAws_json1_1DurationRange = (input: DurationRange, context: __SerdeContext): any => { return { - ...(input.maxSeconds !== undefined && { maxSeconds: input.maxSeconds }), - ...(input.minSeconds !== undefined && { minSeconds: input.minSeconds }), + ...(input.maxSeconds !== undefined && input.maxSeconds !== null && { maxSeconds: input.maxSeconds }), + ...(input.minSeconds !== undefined && input.minSeconds !== null && { minSeconds: input.minSeconds }), }; }; const serializeAws_json1_1FilterRulesPackageArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FindingFilter = (input: FindingFilter, context: __SerdeContext): any => { return { - ...(input.agentIds !== undefined && { agentIds: serializeAws_json1_1AgentIdList(input.agentIds, context) }), - ...(input.attributes !== undefined && { attributes: serializeAws_json1_1AttributeList(input.attributes, context) }), - ...(input.autoScalingGroups !== undefined && { - autoScalingGroups: serializeAws_json1_1AutoScalingGroupList(input.autoScalingGroups, context), - }), - ...(input.creationTimeRange !== undefined && { - creationTimeRange: serializeAws_json1_1TimestampRange(input.creationTimeRange, context), - }), - ...(input.ruleNames !== undefined && { ruleNames: serializeAws_json1_1RuleNameList(input.ruleNames, context) }), - ...(input.rulesPackageArns !== undefined && { - rulesPackageArns: serializeAws_json1_1FilterRulesPackageArnList(input.rulesPackageArns, context), - }), - ...(input.severities !== undefined && { severities: serializeAws_json1_1SeverityList(input.severities, context) }), - ...(input.userAttributes !== undefined && { - userAttributes: serializeAws_json1_1AttributeList(input.userAttributes, context), - }), + ...(input.agentIds !== undefined && + input.agentIds !== null && { agentIds: serializeAws_json1_1AgentIdList(input.agentIds, context) }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_json1_1AttributeList(input.attributes, context) }), + ...(input.autoScalingGroups !== undefined && + input.autoScalingGroups !== null && { + autoScalingGroups: serializeAws_json1_1AutoScalingGroupList(input.autoScalingGroups, context), + }), + ...(input.creationTimeRange !== undefined && + input.creationTimeRange !== null && { + creationTimeRange: serializeAws_json1_1TimestampRange(input.creationTimeRange, context), + }), + ...(input.ruleNames !== undefined && + input.ruleNames !== null && { ruleNames: serializeAws_json1_1RuleNameList(input.ruleNames, context) }), + ...(input.rulesPackageArns !== undefined && + input.rulesPackageArns !== null && { + rulesPackageArns: serializeAws_json1_1FilterRulesPackageArnList(input.rulesPackageArns, context), + }), + ...(input.severities !== undefined && + input.severities !== null && { severities: serializeAws_json1_1SeverityList(input.severities, context) }), + ...(input.userAttributes !== undefined && + input.userAttributes !== null && { + userAttributes: serializeAws_json1_1AttributeList(input.userAttributes, context), + }), }; }; @@ -4181,9 +4257,11 @@ const serializeAws_json1_1GetAssessmentReportRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentRunArn !== undefined && { assessmentRunArn: input.assessmentRunArn }), - ...(input.reportFileFormat !== undefined && { reportFileFormat: input.reportFileFormat }), - ...(input.reportType !== undefined && { reportType: input.reportType }), + ...(input.assessmentRunArn !== undefined && + input.assessmentRunArn !== null && { assessmentRunArn: input.assessmentRunArn }), + ...(input.reportFileFormat !== undefined && + input.reportFileFormat !== null && { reportFileFormat: input.reportFileFormat }), + ...(input.reportType !== undefined && input.reportType !== null && { reportType: input.reportType }), }; }; @@ -4192,11 +4270,12 @@ const serializeAws_json1_1GetExclusionsPreviewRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTemplateArn !== undefined && { assessmentTemplateArn: input.assessmentTemplateArn }), - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.previewToken !== undefined && { previewToken: input.previewToken }), + ...(input.assessmentTemplateArn !== undefined && + input.assessmentTemplateArn !== null && { assessmentTemplateArn: input.assessmentTemplateArn }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.previewToken !== undefined && input.previewToken !== null && { previewToken: input.previewToken }), }; }; @@ -4205,7 +4284,8 @@ const serializeAws_json1_1GetTelemetryMetadataRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentRunArn !== undefined && { assessmentRunArn: input.assessmentRunArn }), + ...(input.assessmentRunArn !== undefined && + input.assessmentRunArn !== null && { assessmentRunArn: input.assessmentRunArn }), }; }; @@ -4214,10 +4294,12 @@ const serializeAws_json1_1ListAssessmentRunAgentsRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentRunArn !== undefined && { assessmentRunArn: input.assessmentRunArn }), - ...(input.filter !== undefined && { filter: serializeAws_json1_1AgentFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.assessmentRunArn !== undefined && + input.assessmentRunArn !== null && { assessmentRunArn: input.assessmentRunArn }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1AgentFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4226,12 +4308,14 @@ const serializeAws_json1_1ListAssessmentRunsRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTemplateArns !== undefined && { - assessmentTemplateArns: serializeAws_json1_1ListParentArnList(input.assessmentTemplateArns, context), - }), - ...(input.filter !== undefined && { filter: serializeAws_json1_1AssessmentRunFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.assessmentTemplateArns !== undefined && + input.assessmentTemplateArns !== null && { + assessmentTemplateArns: serializeAws_json1_1ListParentArnList(input.assessmentTemplateArns, context), + }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1AssessmentRunFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4240,9 +4324,10 @@ const serializeAws_json1_1ListAssessmentTargetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.filter !== undefined && { filter: serializeAws_json1_1AssessmentTargetFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1AssessmentTargetFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4251,12 +4336,14 @@ const serializeAws_json1_1ListAssessmentTemplatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTargetArns !== undefined && { - assessmentTargetArns: serializeAws_json1_1ListParentArnList(input.assessmentTargetArns, context), - }), - ...(input.filter !== undefined && { filter: serializeAws_json1_1AssessmentTemplateFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.assessmentTargetArns !== undefined && + input.assessmentTargetArns !== null && { + assessmentTargetArns: serializeAws_json1_1ListParentArnList(input.assessmentTargetArns, context), + }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1AssessmentTemplateFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4265,33 +4352,43 @@ const serializeAws_json1_1ListEventSubscriptionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_1ListExclusionsRequest = (input: ListExclusionsRequest, context: __SerdeContext): any => { return { - ...(input.assessmentRunArn !== undefined && { assessmentRunArn: input.assessmentRunArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.assessmentRunArn !== undefined && + input.assessmentRunArn !== null && { assessmentRunArn: input.assessmentRunArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListFindingsRequest = (input: ListFindingsRequest, context: __SerdeContext): any => { return { - ...(input.assessmentRunArns !== undefined && { - assessmentRunArns: serializeAws_json1_1ListParentArnList(input.assessmentRunArns, context), - }), - ...(input.filter !== undefined && { filter: serializeAws_json1_1FindingFilter(input.filter, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.assessmentRunArns !== undefined && + input.assessmentRunArns !== null && { + assessmentRunArns: serializeAws_json1_1ListParentArnList(input.assessmentRunArns, context), + }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_json1_1FindingFilter(input.filter, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListParentArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListRulesPackagesRequest = ( @@ -4299,8 +4396,8 @@ const serializeAws_json1_1ListRulesPackagesRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4309,15 +4406,16 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_1PreviewAgentsRequest = (input: PreviewAgentsRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.previewAgentsArn !== undefined && { previewAgentsArn: input.previewAgentsArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.previewAgentsArn !== undefined && + input.previewAgentsArn !== null && { previewAgentsArn: input.previewAgentsArn }), }; }; @@ -4326,7 +4424,7 @@ const serializeAws_json1_1RegisterCrossAccountAccessRoleRequest = ( context: __SerdeContext ): any => { return { - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; @@ -4335,28 +4433,44 @@ const serializeAws_json1_1RemoveAttributesFromFindingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.attributeKeys !== undefined && { - attributeKeys: serializeAws_json1_1UserAttributeKeyList(input.attributeKeys, context), - }), - ...(input.findingArns !== undefined && { - findingArns: serializeAws_json1_1AddRemoveAttributesFindingArnList(input.findingArns, context), - }), + ...(input.attributeKeys !== undefined && + input.attributeKeys !== null && { + attributeKeys: serializeAws_json1_1UserAttributeKeyList(input.attributeKeys, context), + }), + ...(input.findingArns !== undefined && + input.findingArns !== null && { + findingArns: serializeAws_json1_1AddRemoveAttributesFindingArnList(input.findingArns, context), + }), }; }; const serializeAws_json1_1ResourceGroupTag = (input: ResourceGroupTag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1ResourceGroupTags = (input: ResourceGroupTag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ResourceGroupTag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ResourceGroupTag(entry, context); + }); }; const serializeAws_json1_1RuleNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SetTagsForResourceRequest = ( @@ -4364,13 +4478,20 @@ const serializeAws_json1_1SetTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1SeverityList = (input: (Severity | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartAssessmentRunRequest = ( @@ -4378,8 +4499,10 @@ const serializeAws_json1_1StartAssessmentRunRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentRunName !== undefined && { assessmentRunName: input.assessmentRunName }), - ...(input.assessmentTemplateArn !== undefined && { assessmentTemplateArn: input.assessmentTemplateArn }), + ...(input.assessmentRunName !== undefined && + input.assessmentRunName !== null && { assessmentRunName: input.assessmentRunName }), + ...(input.assessmentTemplateArn !== undefined && + input.assessmentTemplateArn !== null && { assessmentTemplateArn: input.assessmentTemplateArn }), }; }; @@ -4388,34 +4511,44 @@ const serializeAws_json1_1StopAssessmentRunRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentRunArn !== undefined && { assessmentRunArn: input.assessmentRunArn }), - ...(input.stopAction !== undefined && { stopAction: input.stopAction }), + ...(input.assessmentRunArn !== undefined && + input.assessmentRunArn !== null && { assessmentRunArn: input.assessmentRunArn }), + ...(input.stopAction !== undefined && input.stopAction !== null && { stopAction: input.stopAction }), }; }; const serializeAws_json1_1SubscribeToEventRequest = (input: SubscribeToEventRequest, context: __SerdeContext): any => { return { - ...(input.event !== undefined && { event: input.event }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.topicArn !== undefined && { topicArn: input.topicArn }), + ...(input.event !== undefined && input.event !== null && { event: input.event }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.topicArn !== undefined && input.topicArn !== null && { topicArn: input.topicArn }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TimestampRange = (input: TimestampRange, context: __SerdeContext): any => { return { - ...(input.beginDate !== undefined && { beginDate: Math.round(input.beginDate.getTime() / 1000) }), - ...(input.endDate !== undefined && { endDate: Math.round(input.endDate.getTime() / 1000) }), + ...(input.beginDate !== undefined && + input.beginDate !== null && { beginDate: Math.round(input.beginDate.getTime() / 1000) }), + ...(input.endDate !== undefined && + input.endDate !== null && { endDate: Math.round(input.endDate.getTime() / 1000) }), }; }; @@ -4424,9 +4557,9 @@ const serializeAws_json1_1UnsubscribeFromEventRequest = ( context: __SerdeContext ): any => { return { - ...(input.event !== undefined && { event: input.event }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.topicArn !== undefined && { topicArn: input.topicArn }), + ...(input.event !== undefined && input.event !== null && { event: input.event }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.topicArn !== undefined && input.topicArn !== null && { topicArn: input.topicArn }), }; }; @@ -4435,18 +4568,35 @@ const serializeAws_json1_1UpdateAssessmentTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.assessmentTargetArn !== undefined && { assessmentTargetArn: input.assessmentTargetArn }), - ...(input.assessmentTargetName !== undefined && { assessmentTargetName: input.assessmentTargetName }), - ...(input.resourceGroupArn !== undefined && { resourceGroupArn: input.resourceGroupArn }), + ...(input.assessmentTargetArn !== undefined && + input.assessmentTargetArn !== null && { assessmentTargetArn: input.assessmentTargetArn }), + ...(input.assessmentTargetName !== undefined && + input.assessmentTargetName !== null && { assessmentTargetName: input.assessmentTargetName }), + ...(input.resourceGroupArn !== undefined && + input.resourceGroupArn !== null && { resourceGroupArn: input.resourceGroupArn }), }; }; const serializeAws_json1_1UserAttributeKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UserAttributeList = (input: Attribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Attribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Attribute(entry, context); + }); }; const deserializeAws_json1_1AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => { @@ -4484,7 +4634,14 @@ const deserializeAws_json1_1AgentAlreadyRunningAssessmentList = ( output: any, context: __SerdeContext ): AgentAlreadyRunningAssessment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AgentAlreadyRunningAssessment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AgentAlreadyRunningAssessment(entry, context); + }); }; const deserializeAws_json1_1AgentPreview = (output: any, context: __SerdeContext): AgentPreview => { @@ -4504,7 +4661,14 @@ const deserializeAws_json1_1AgentPreview = (output: any, context: __SerdeContext }; const deserializeAws_json1_1AgentPreviewList = (output: any, context: __SerdeContext): AgentPreview[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AgentPreview(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AgentPreview(entry, context); + }); }; const deserializeAws_json1_1AgentsAlreadyRunningAssessmentException = ( @@ -4524,7 +4688,14 @@ const deserializeAws_json1_1AgentsAlreadyRunningAssessmentException = ( }; const deserializeAws_json1_1AssessmentRulesPackageArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AssessmentRun = (output: any, context: __SerdeContext): AssessmentRun => { @@ -4603,24 +4774,40 @@ const deserializeAws_json1_1AssessmentRunAgent = (output: any, context: __SerdeC }; const deserializeAws_json1_1AssessmentRunAgentList = (output: any, context: __SerdeContext): AssessmentRunAgent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssessmentRunAgent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssessmentRunAgent(entry, context); + }); }; const deserializeAws_json1_1AssessmentRunFindingCounts = ( output: any, context: __SerdeContext ): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [Severity | string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [Severity | string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1AssessmentRunInProgressArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AssessmentRunInProgressException = ( @@ -4642,7 +4829,14 @@ const deserializeAws_json1_1AssessmentRunInProgressException = ( }; const deserializeAws_json1_1AssessmentRunList = (output: any, context: __SerdeContext): AssessmentRun[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssessmentRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssessmentRun(entry, context); + }); }; const deserializeAws_json1_1AssessmentRunNotification = ( @@ -4666,7 +4860,14 @@ const deserializeAws_json1_1AssessmentRunNotificationList = ( output: any, context: __SerdeContext ): AssessmentRunNotification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssessmentRunNotification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssessmentRunNotification(entry, context); + }); }; const deserializeAws_json1_1AssessmentRunStateChange = ( @@ -4686,7 +4887,14 @@ const deserializeAws_json1_1AssessmentRunStateChangeList = ( output: any, context: __SerdeContext ): AssessmentRunStateChange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssessmentRunStateChange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssessmentRunStateChange(entry, context); + }); }; const deserializeAws_json1_1AssessmentTarget = (output: any, context: __SerdeContext): AssessmentTarget => { @@ -4707,7 +4915,14 @@ const deserializeAws_json1_1AssessmentTarget = (output: any, context: __SerdeCon }; const deserializeAws_json1_1AssessmentTargetList = (output: any, context: __SerdeContext): AssessmentTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssessmentTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssessmentTarget(entry, context); + }); }; const deserializeAws_json1_1AssessmentTemplate = (output: any, context: __SerdeContext): AssessmentTemplate => { @@ -4746,14 +4961,28 @@ const deserializeAws_json1_1AssessmentTemplate = (output: any, context: __SerdeC }; const deserializeAws_json1_1AssessmentTemplateList = (output: any, context: __SerdeContext): AssessmentTemplate[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssessmentTemplate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssessmentTemplate(entry, context); + }); }; const deserializeAws_json1_1AssessmentTemplateRulesPackageArnList = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AssetAttributes = (output: any, context: __SerdeContext): AssetAttributes => { @@ -4786,7 +5015,14 @@ const deserializeAws_json1_1Attribute = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1AttributeList = (output: any, context: __SerdeContext): Attribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Attribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Attribute(entry, context); + }); }; const deserializeAws_json1_1CreateAssessmentTargetResponse = ( @@ -4969,7 +5205,14 @@ const deserializeAws_json1_1EventSubscription = (output: any, context: __SerdeCo }; const deserializeAws_json1_1EventSubscriptionList = (output: any, context: __SerdeContext): EventSubscription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventSubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventSubscription(entry, context); + }); }; const deserializeAws_json1_1Exclusion = (output: any, context: __SerdeContext): Exclusion => { @@ -4991,13 +5234,15 @@ const deserializeAws_json1_1Exclusion = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ExclusionMap = (output: any, context: __SerdeContext): { [key: string]: Exclusion } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Exclusion }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Exclusion }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1Exclusion(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ExclusionPreview = (output: any, context: __SerdeContext): ExclusionPreview => { @@ -5018,7 +5263,14 @@ const deserializeAws_json1_1ExclusionPreview = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ExclusionPreviewList = (output: any, context: __SerdeContext): ExclusionPreview[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExclusionPreview(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExclusionPreview(entry, context); + }); }; const deserializeAws_json1_1FailedItemDetails = (output: any, context: __SerdeContext): FailedItemDetails => { @@ -5032,13 +5284,15 @@ const deserializeAws_json1_1FailedItems = ( output: any, context: __SerdeContext ): { [key: string]: FailedItemDetails } => { - return Object.entries(output).reduce( - (acc: { [key: string]: FailedItemDetails }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: FailedItemDetails }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1FailedItemDetails(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Finding = (output: any, context: __SerdeContext): Finding => { @@ -5089,7 +5343,14 @@ const deserializeAws_json1_1Finding = (output: any, context: __SerdeContext): Fi }; const deserializeAws_json1_1FindingList = (output: any, context: __SerdeContext): Finding[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Finding(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Finding(entry, context); + }); }; const deserializeAws_json1_1GetAssessmentReportResponse = ( @@ -5170,11 +5431,25 @@ const deserializeAws_json1_1InvalidInputException = (output: any, context: __Ser }; const deserializeAws_json1_1Ipv4AddressList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Ipv6Addresses = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -5271,7 +5546,14 @@ const deserializeAws_json1_1ListFindingsResponse = (output: any, context: __Serd }; const deserializeAws_json1_1ListReturnedArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ListRulesPackagesResponse = ( @@ -5330,7 +5612,14 @@ const deserializeAws_json1_1NetworkInterface = (output: any, context: __SerdeCon }; const deserializeAws_json1_1NetworkInterfaces = (output: any, context: __SerdeContext): NetworkInterface[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NetworkInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NetworkInterface(entry, context); + }); }; const deserializeAws_json1_1NoSuchEntityException = (output: any, context: __SerdeContext): NoSuchEntityException => { @@ -5370,7 +5659,14 @@ const deserializeAws_json1_1PrivateIp = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1PrivateIpAddresses = (output: any, context: __SerdeContext): PrivateIp[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PrivateIp(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PrivateIp(entry, context); + }); }; const deserializeAws_json1_1RemoveAttributesFromFindingsResponse = ( @@ -5400,7 +5696,14 @@ const deserializeAws_json1_1ResourceGroup = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ResourceGroupList = (output: any, context: __SerdeContext): ResourceGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceGroup(entry, context); + }); }; const deserializeAws_json1_1ResourceGroupTag = (output: any, context: __SerdeContext): ResourceGroupTag => { @@ -5411,7 +5714,14 @@ const deserializeAws_json1_1ResourceGroupTag = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ResourceGroupTags = (output: any, context: __SerdeContext): ResourceGroupTag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceGroupTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceGroupTag(entry, context); + }); }; const deserializeAws_json1_1RulesPackage = (output: any, context: __SerdeContext): RulesPackage => { @@ -5425,7 +5735,14 @@ const deserializeAws_json1_1RulesPackage = (output: any, context: __SerdeContext }; const deserializeAws_json1_1RulesPackageList = (output: any, context: __SerdeContext): RulesPackage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RulesPackage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RulesPackage(entry, context); + }); }; const deserializeAws_json1_1Scope = (output: any, context: __SerdeContext): Scope => { @@ -5436,7 +5753,14 @@ const deserializeAws_json1_1Scope = (output: any, context: __SerdeContext): Scop }; const deserializeAws_json1_1ScopeList = (output: any, context: __SerdeContext): Scope[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Scope(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Scope(entry, context); + }); }; const deserializeAws_json1_1SecurityGroup = (output: any, context: __SerdeContext): SecurityGroup => { @@ -5447,7 +5771,14 @@ const deserializeAws_json1_1SecurityGroup = (output: any, context: __SerdeContex }; const deserializeAws_json1_1SecurityGroups = (output: any, context: __SerdeContext): SecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SecurityGroup(entry, context); + }); }; const deserializeAws_json1_1ServiceTemporarilyUnavailableException = ( @@ -5482,7 +5813,14 @@ const deserializeAws_json1_1Subscription = (output: any, context: __SerdeContext }; const deserializeAws_json1_1SubscriptionList = (output: any, context: __SerdeContext): Subscription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Subscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Subscription(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -5493,11 +5831,25 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TelemetryMetadata = (output: any, context: __SerdeContext): TelemetryMetadata => { @@ -5509,7 +5861,14 @@ const deserializeAws_json1_1TelemetryMetadata = (output: any, context: __SerdeCo }; const deserializeAws_json1_1TelemetryMetadataList = (output: any, context: __SerdeContext): TelemetryMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TelemetryMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TelemetryMetadata(entry, context); + }); }; const deserializeAws_json1_1UnsupportedFeatureException = ( @@ -5523,7 +5882,14 @@ const deserializeAws_json1_1UnsupportedFeatureException = ( }; const deserializeAws_json1_1UserAttributeList = (output: any, context: __SerdeContext): Attribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Attribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Attribute(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -5576,3 +5942,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-iot-1click-devices-service/protocols/Aws_restJson1.ts b/clients/client-iot-1click-devices-service/protocols/Aws_restJson1.ts index 14acd8ea2204..1836da129a7c 100644 --- a/clients/client-iot-1click-devices-service/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-devices-service/protocols/Aws_restJson1.ts @@ -53,9 +53,7 @@ export const serializeAws_restJson1ClaimDevicesByClaimCodeCommand = async ( input: ClaimDevicesByClaimCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/claims/{ClaimCode}"; if (input.ClaimCode !== undefined) { const labelValue: string = input.ClaimCode; @@ -83,9 +81,7 @@ export const serializeAws_restJson1DescribeDeviceCommand = async ( input: DescribeDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/devices/{DeviceId}"; if (input.DeviceId !== undefined) { const labelValue: string = input.DeviceId; @@ -114,7 +110,7 @@ export const serializeAws_restJson1FinalizeDeviceClaimCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/devices/{DeviceId}/finalize-claim"; if (input.DeviceId !== undefined) { @@ -128,7 +124,8 @@ export const serializeAws_restJson1FinalizeDeviceClaimCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -146,9 +143,7 @@ export const serializeAws_restJson1GetDeviceMethodsCommand = async ( input: GetDeviceMethodsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/devices/{DeviceId}/methods"; if (input.DeviceId !== undefined) { const labelValue: string = input.DeviceId; @@ -176,9 +171,7 @@ export const serializeAws_restJson1InitiateDeviceClaimCommand = async ( input: InitiateDeviceClaimCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/devices/{DeviceId}/initiate-claim"; if (input.DeviceId !== undefined) { const labelValue: string = input.DeviceId; @@ -207,7 +200,7 @@ export const serializeAws_restJson1InvokeDeviceMethodCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/devices/{DeviceId}/methods"; if (input.DeviceId !== undefined) { @@ -221,10 +214,10 @@ export const serializeAws_restJson1InvokeDeviceMethodCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DeviceMethod !== undefined && { - deviceMethod: serializeAws_restJson1DeviceMethod(input.DeviceMethod, context), - }), - ...(input.DeviceMethodParameters !== undefined && { deviceMethodParameters: input.DeviceMethodParameters }), + ...(input.DeviceMethod !== undefined && + input.DeviceMethod !== null && { deviceMethod: serializeAws_restJson1DeviceMethod(input.DeviceMethod, context) }), + ...(input.DeviceMethodParameters !== undefined && + input.DeviceMethodParameters !== null && { deviceMethodParameters: input.DeviceMethodParameters }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -242,9 +235,7 @@ export const serializeAws_restJson1ListDeviceEventsCommand = async ( input: ListDeviceEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/devices/{DeviceId}/events"; if (input.DeviceId !== undefined) { const labelValue: string = input.DeviceId; @@ -283,9 +274,7 @@ export const serializeAws_restJson1ListDevicesCommand = async ( input: ListDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/devices"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -310,9 +299,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -341,7 +328,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -355,7 +342,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -373,9 +361,7 @@ export const serializeAws_restJson1UnclaimDeviceCommand = async ( input: UnclaimDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/devices/{DeviceId}/unclaim"; if (input.DeviceId !== undefined) { const labelValue: string = input.DeviceId; @@ -403,9 +389,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -438,7 +422,7 @@ export const serializeAws_restJson1UpdateDeviceStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/devices/{DeviceId}/state"; if (input.DeviceId !== undefined) { @@ -452,7 +436,7 @@ export const serializeAws_restJson1UpdateDeviceStateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Enabled !== undefined && { enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { enabled: input.Enabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1585,19 +1569,21 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( }; const serializeAws_restJson1__mapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1DeviceMethod = (input: DeviceMethod, context: __SerdeContext): any => { return { - ...(input.DeviceType !== undefined && { deviceType: input.DeviceType }), - ...(input.MethodName !== undefined && { methodName: input.MethodName }), + ...(input.DeviceType !== undefined && input.DeviceType !== null && { deviceType: input.DeviceType }), + ...(input.MethodName !== undefined && input.MethodName !== null && { methodName: input.MethodName }), }; }; @@ -1605,25 +1591,48 @@ const deserializeAws_restJson1__listOfDeviceDescription = ( output: any, context: __SerdeContext ): DeviceDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeviceDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeviceDescription(entry, context); + }); }; const deserializeAws_restJson1__listOfDeviceEvent = (output: any, context: __SerdeContext): DeviceEvent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeviceEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeviceEvent(entry, context); + }); }; const deserializeAws_restJson1__listOfDeviceMethod = (output: any, context: __SerdeContext): DeviceMethod[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeviceMethod(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeviceMethod(entry, context); + }); }; const deserializeAws_restJson1__mapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Attributes = (output: any, context: __SerdeContext): Attributes => { @@ -1642,13 +1651,15 @@ const deserializeAws_restJson1Device = (output: any, context: __SerdeContext): D }; const deserializeAws_restJson1DeviceAttributes = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DeviceDescription = (output: any, context: __SerdeContext): DeviceDescription => { @@ -1707,6 +1718,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iot-1click-projects/protocols/Aws_restJson1.ts b/clients/client-iot-1click-projects/protocols/Aws_restJson1.ts index 196131515683..053eddbcf90e 100644 --- a/clients/client-iot-1click-projects/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-projects/protocols/Aws_restJson1.ts @@ -56,7 +56,7 @@ export const serializeAws_restJson1AssociateDeviceWithPlacementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{projectName}/placements/{placementName}/devices/{deviceTemplateName}"; if (input.placementName !== undefined) { @@ -88,7 +88,7 @@ export const serializeAws_restJson1AssociateDeviceWithPlacementCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.deviceId !== undefined && { deviceId: input.deviceId }), + ...(input.deviceId !== undefined && input.deviceId !== null && { deviceId: input.deviceId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -107,7 +107,7 @@ export const serializeAws_restJson1CreatePlacementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{projectName}/placements"; if (input.projectName !== undefined) { @@ -121,10 +121,11 @@ export const serializeAws_restJson1CreatePlacementCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.attributes !== undefined && { - attributes: serializeAws_restJson1PlacementAttributeMap(input.attributes, context), - }), - ...(input.placementName !== undefined && { placementName: input.placementName }), + ...(input.attributes !== undefined && + input.attributes !== null && { + attributes: serializeAws_restJson1PlacementAttributeMap(input.attributes, context), + }), + ...(input.placementName !== undefined && input.placementName !== null && { placementName: input.placementName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -143,17 +144,18 @@ export const serializeAws_restJson1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects"; let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.placementTemplate !== undefined && { - placementTemplate: serializeAws_restJson1PlacementTemplate(input.placementTemplate, context), - }), - ...(input.projectName !== undefined && { projectName: input.projectName }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.placementTemplate !== undefined && + input.placementTemplate !== null && { + placementTemplate: serializeAws_restJson1PlacementTemplate(input.placementTemplate, context), + }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -171,9 +173,7 @@ export const serializeAws_restJson1DeletePlacementCommand = async ( input: DeletePlacementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectName}/placements/{placementName}"; if (input.projectName !== undefined) { const labelValue: string = input.projectName; @@ -210,9 +210,7 @@ export const serializeAws_restJson1DeleteProjectCommand = async ( input: DeleteProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectName}"; if (input.projectName !== undefined) { const labelValue: string = input.projectName; @@ -240,9 +238,7 @@ export const serializeAws_restJson1DescribePlacementCommand = async ( input: DescribePlacementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectName}/placements/{placementName}"; if (input.projectName !== undefined) { const labelValue: string = input.projectName; @@ -279,9 +275,7 @@ export const serializeAws_restJson1DescribeProjectCommand = async ( input: DescribeProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectName}"; if (input.projectName !== undefined) { const labelValue: string = input.projectName; @@ -309,9 +303,7 @@ export const serializeAws_restJson1DisassociateDeviceFromPlacementCommand = asyn input: DisassociateDeviceFromPlacementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectName}/placements/{placementName}/devices/{deviceTemplateName}"; if (input.placementName !== undefined) { const labelValue: string = input.placementName; @@ -357,9 +349,7 @@ export const serializeAws_restJson1GetDevicesInPlacementCommand = async ( input: GetDevicesInPlacementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectName}/placements/{placementName}/devices"; if (input.placementName !== undefined) { const labelValue: string = input.placementName; @@ -396,9 +386,7 @@ export const serializeAws_restJson1ListPlacementsCommand = async ( input: ListPlacementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectName}/placements"; if (input.projectName !== undefined) { const labelValue: string = input.projectName; @@ -431,9 +419,7 @@ export const serializeAws_restJson1ListProjectsCommand = async ( input: ListProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -457,9 +443,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -488,7 +472,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -502,7 +486,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -520,9 +504,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -555,7 +537,7 @@ export const serializeAws_restJson1UpdatePlacementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{projectName}/placements/{placementName}"; if (input.placementName !== undefined) { @@ -578,9 +560,10 @@ export const serializeAws_restJson1UpdatePlacementCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.attributes !== undefined && { - attributes: serializeAws_restJson1PlacementAttributeMap(input.attributes, context), - }), + ...(input.attributes !== undefined && + input.attributes !== null && { + attributes: serializeAws_restJson1PlacementAttributeMap(input.attributes, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -599,7 +582,7 @@ export const serializeAws_restJson1UpdateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{projectName}"; if (input.projectName !== undefined) { @@ -613,10 +596,11 @@ export const serializeAws_restJson1UpdateProjectCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.placementTemplate !== undefined && { - placementTemplate: serializeAws_restJson1PlacementTemplate(input.placementTemplate, context), - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.placementTemplate !== undefined && + input.placementTemplate !== null && { + placementTemplate: serializeAws_restJson1PlacementTemplate(input.placementTemplate, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1891,34 +1875,39 @@ const serializeAws_restJson1DefaultPlacementAttributeMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1DeviceCallbackOverrideMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1DeviceTemplate = (input: DeviceTemplate, context: __SerdeContext): any => { return { - ...(input.callbackOverrides !== undefined && { - callbackOverrides: serializeAws_restJson1DeviceCallbackOverrideMap(input.callbackOverrides, context), - }), - ...(input.deviceType !== undefined && { deviceType: input.deviceType }), + ...(input.callbackOverrides !== undefined && + input.callbackOverrides !== null && { + callbackOverrides: serializeAws_restJson1DeviceCallbackOverrideMap(input.callbackOverrides, context), + }), + ...(input.deviceType !== undefined && input.deviceType !== null && { deviceType: input.deviceType }), }; }; @@ -1926,83 +1915,97 @@ const serializeAws_restJson1DeviceTemplateMap = ( input: { [key: string]: DeviceTemplate }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: DeviceTemplate }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: DeviceTemplate }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1DeviceTemplate(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1PlacementAttributeMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1PlacementTemplate = (input: PlacementTemplate, context: __SerdeContext): any => { return { - ...(input.defaultAttributes !== undefined && { - defaultAttributes: serializeAws_restJson1DefaultPlacementAttributeMap(input.defaultAttributes, context), - }), - ...(input.deviceTemplates !== undefined && { - deviceTemplates: serializeAws_restJson1DeviceTemplateMap(input.deviceTemplates, context), - }), + ...(input.defaultAttributes !== undefined && + input.defaultAttributes !== null && { + defaultAttributes: serializeAws_restJson1DefaultPlacementAttributeMap(input.defaultAttributes, context), + }), + ...(input.deviceTemplates !== undefined && + input.deviceTemplates !== null && { + deviceTemplates: serializeAws_restJson1DeviceTemplateMap(input.deviceTemplates, context), + }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DefaultPlacementAttributeMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DeviceCallbackOverrideMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DeviceMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DeviceTemplate = (output: any, context: __SerdeContext): DeviceTemplate => { @@ -2019,26 +2022,30 @@ const deserializeAws_restJson1DeviceTemplateMap = ( output: any, context: __SerdeContext ): { [key: string]: DeviceTemplate } => { - return Object.entries(output).reduce( - (acc: { [key: string]: DeviceTemplate }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: DeviceTemplate }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1DeviceTemplate(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1PlacementAttributeMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1PlacementDescription = (output: any, context: __SerdeContext): PlacementDescription => { @@ -2078,7 +2085,14 @@ const deserializeAws_restJson1PlacementSummary = (output: any, context: __SerdeC }; const deserializeAws_restJson1PlacementSummaryList = (output: any, context: __SerdeContext): PlacementSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PlacementSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PlacementSummary(entry, context); + }); }; const deserializeAws_restJson1PlacementTemplate = (output: any, context: __SerdeContext): PlacementTemplate => { @@ -2138,17 +2152,26 @@ const deserializeAws_restJson1ProjectSummary = (output: any, context: __SerdeCon }; const deserializeAws_restJson1ProjectSummaryList = (output: any, context: __SerdeContext): ProjectSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProjectSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProjectSummary(entry, context); + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2171,6 +2194,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iot-data-plane/protocols/Aws_restJson1.ts b/clients/client-iot-data-plane/protocols/Aws_restJson1.ts index 7f315cbe9684..77946f781141 100644 --- a/clients/client-iot-data-plane/protocols/Aws_restJson1.ts +++ b/clients/client-iot-data-plane/protocols/Aws_restJson1.ts @@ -34,9 +34,7 @@ export const serializeAws_restJson1DeleteThingShadowCommand = async ( input: DeleteThingShadowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}/shadow"; if (input.thingName !== undefined) { const labelValue: string = input.thingName; @@ -68,9 +66,7 @@ export const serializeAws_restJson1GetThingShadowCommand = async ( input: GetThingShadowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}/shadow"; if (input.thingName !== undefined) { const labelValue: string = input.thingName; @@ -102,9 +98,7 @@ export const serializeAws_restJson1ListNamedShadowsForThingCommand = async ( input: ListNamedShadowsForThingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/api/things/shadow/ListNamedShadowsForThing/{thingName}"; if (input.thingName !== undefined) { const labelValue: string = input.thingName; @@ -138,7 +132,7 @@ export const serializeAws_restJson1PublishCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", }; let resolvedPath = "/topics/{topic}"; if (input.topic !== undefined) { @@ -175,7 +169,7 @@ export const serializeAws_restJson1UpdateThingShadowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", }; let resolvedPath = "/things/{thingName}/shadow"; if (input.thingName !== undefined) { @@ -899,7 +893,14 @@ const deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse = asy }; const deserializeAws_restJson1NamedShadowList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -922,6 +923,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iot-events-data/protocols/Aws_restJson1.ts b/clients/client-iot-events-data/protocols/Aws_restJson1.ts index 44a296f02a62..8fb60049e3e0 100644 --- a/clients/client-iot-events-data/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events-data/protocols/Aws_restJson1.ts @@ -42,12 +42,13 @@ export const serializeAws_restJson1BatchPutMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/inputs/messages"; let body: any; body = JSON.stringify({ - ...(input.messages !== undefined && { messages: serializeAws_restJson1Messages(input.messages, context) }), + ...(input.messages !== undefined && + input.messages !== null && { messages: serializeAws_restJson1Messages(input.messages, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -66,14 +67,15 @@ export const serializeAws_restJson1BatchUpdateDetectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detectors"; let body: any; body = JSON.stringify({ - ...(input.detectors !== undefined && { - detectors: serializeAws_restJson1UpdateDetectorRequests(input.detectors, context), - }), + ...(input.detectors !== undefined && + input.detectors !== null && { + detectors: serializeAws_restJson1UpdateDetectorRequests(input.detectors, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -91,9 +93,7 @@ export const serializeAws_restJson1DescribeDetectorCommand = async ( input: DescribeDetectorCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detectors/{detectorModelName}/keyValues"; if (input.detectorModelName !== undefined) { const labelValue: string = input.detectorModelName; @@ -125,9 +125,7 @@ export const serializeAws_restJson1ListDetectorsCommand = async ( input: ListDetectorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detectors/{detectorModelName}"; if (input.detectorModelName !== undefined) { const labelValue: string = input.detectorModelName; @@ -589,66 +587,103 @@ const serializeAws_restJson1DetectorStateDefinition = ( context: __SerdeContext ): any => { return { - ...(input.stateName !== undefined && { stateName: input.stateName }), - ...(input.timers !== undefined && { timers: serializeAws_restJson1TimerDefinitions(input.timers, context) }), - ...(input.variables !== undefined && { - variables: serializeAws_restJson1VariableDefinitions(input.variables, context), - }), + ...(input.stateName !== undefined && input.stateName !== null && { stateName: input.stateName }), + ...(input.timers !== undefined && + input.timers !== null && { timers: serializeAws_restJson1TimerDefinitions(input.timers, context) }), + ...(input.variables !== undefined && + input.variables !== null && { variables: serializeAws_restJson1VariableDefinitions(input.variables, context) }), }; }; const serializeAws_restJson1Message = (input: Message, context: __SerdeContext): any => { return { - ...(input.inputName !== undefined && { inputName: input.inputName }), - ...(input.messageId !== undefined && { messageId: input.messageId }), - ...(input.payload !== undefined && { payload: context.base64Encoder(input.payload) }), + ...(input.inputName !== undefined && input.inputName !== null && { inputName: input.inputName }), + ...(input.messageId !== undefined && input.messageId !== null && { messageId: input.messageId }), + ...(input.payload !== undefined && input.payload !== null && { payload: context.base64Encoder(input.payload) }), }; }; const serializeAws_restJson1Messages = (input: Message[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Message(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Message(entry, context); + }); }; const serializeAws_restJson1TimerDefinition = (input: TimerDefinition, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.seconds !== undefined && { seconds: input.seconds }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.seconds !== undefined && input.seconds !== null && { seconds: input.seconds }), }; }; const serializeAws_restJson1TimerDefinitions = (input: TimerDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1TimerDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TimerDefinition(entry, context); + }); }; const serializeAws_restJson1UpdateDetectorRequest = (input: UpdateDetectorRequest, context: __SerdeContext): any => { return { - ...(input.detectorModelName !== undefined && { detectorModelName: input.detectorModelName }), - ...(input.keyValue !== undefined && { keyValue: input.keyValue }), - ...(input.messageId !== undefined && { messageId: input.messageId }), - ...(input.state !== undefined && { state: serializeAws_restJson1DetectorStateDefinition(input.state, context) }), + ...(input.detectorModelName !== undefined && + input.detectorModelName !== null && { detectorModelName: input.detectorModelName }), + ...(input.keyValue !== undefined && input.keyValue !== null && { keyValue: input.keyValue }), + ...(input.messageId !== undefined && input.messageId !== null && { messageId: input.messageId }), + ...(input.state !== undefined && + input.state !== null && { state: serializeAws_restJson1DetectorStateDefinition(input.state, context) }), }; }; const serializeAws_restJson1UpdateDetectorRequests = (input: UpdateDetectorRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1UpdateDetectorRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1UpdateDetectorRequest(entry, context); + }); }; const serializeAws_restJson1VariableDefinition = (input: VariableDefinition, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: input.value }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1VariableDefinitions = (input: VariableDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1VariableDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1VariableDefinition(entry, context); + }); }; const deserializeAws_restJson1BatchPutMessageErrorEntries = ( output: any, context: __SerdeContext ): BatchPutMessageErrorEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchPutMessageErrorEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchPutMessageErrorEntry(entry, context); + }); }; const deserializeAws_restJson1BatchPutMessageErrorEntry = ( @@ -666,7 +701,14 @@ const deserializeAws_restJson1BatchUpdateDetectorErrorEntries = ( output: any, context: __SerdeContext ): BatchUpdateDetectorErrorEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchUpdateDetectorErrorEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchUpdateDetectorErrorEntry(entry, context); + }); }; const deserializeAws_restJson1BatchUpdateDetectorErrorEntry = ( @@ -727,7 +769,14 @@ const deserializeAws_restJson1DetectorStateSummary = (output: any, context: __Se }; const deserializeAws_restJson1DetectorSummaries = (output: any, context: __SerdeContext): DetectorSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DetectorSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DetectorSummary(entry, context); + }); }; const deserializeAws_restJson1DetectorSummary = (output: any, context: __SerdeContext): DetectorSummary => { @@ -767,7 +816,14 @@ const deserializeAws_restJson1Timer = (output: any, context: __SerdeContext): Ti }; const deserializeAws_restJson1Timers = (output: any, context: __SerdeContext): Timer[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Timer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Timer(entry, context); + }); }; const deserializeAws_restJson1Variable = (output: any, context: __SerdeContext): Variable => { @@ -778,7 +834,14 @@ const deserializeAws_restJson1Variable = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Variables = (output: any, context: __SerdeContext): Variable[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Variable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Variable(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -801,6 +864,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iot-events/protocols/Aws_restJson1.ts b/clients/client-iot-events/protocols/Aws_restJson1.ts index db05c61c9466..7d2f1bc69cfb 100644 --- a/clients/client-iot-events/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events/protocols/Aws_restJson1.ts @@ -100,20 +100,24 @@ export const serializeAws_restJson1CreateDetectorModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector-models"; let body: any; body = JSON.stringify({ - ...(input.detectorModelDefinition !== undefined && { - detectorModelDefinition: serializeAws_restJson1DetectorModelDefinition(input.detectorModelDefinition, context), - }), - ...(input.detectorModelDescription !== undefined && { detectorModelDescription: input.detectorModelDescription }), - ...(input.detectorModelName !== undefined && { detectorModelName: input.detectorModelName }), - ...(input.evaluationMethod !== undefined && { evaluationMethod: input.evaluationMethod }), - ...(input.key !== undefined && { key: input.key }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.detectorModelDefinition !== undefined && + input.detectorModelDefinition !== null && { + detectorModelDefinition: serializeAws_restJson1DetectorModelDefinition(input.detectorModelDefinition, context), + }), + ...(input.detectorModelDescription !== undefined && + input.detectorModelDescription !== null && { detectorModelDescription: input.detectorModelDescription }), + ...(input.detectorModelName !== undefined && + input.detectorModelName !== null && { detectorModelName: input.detectorModelName }), + ...(input.evaluationMethod !== undefined && + input.evaluationMethod !== null && { evaluationMethod: input.evaluationMethod }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -132,17 +136,19 @@ export const serializeAws_restJson1CreateInputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/inputs"; let body: any; body = JSON.stringify({ - ...(input.inputDefinition !== undefined && { - inputDefinition: serializeAws_restJson1InputDefinition(input.inputDefinition, context), - }), - ...(input.inputDescription !== undefined && { inputDescription: input.inputDescription }), - ...(input.inputName !== undefined && { inputName: input.inputName }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.inputDefinition !== undefined && + input.inputDefinition !== null && { + inputDefinition: serializeAws_restJson1InputDefinition(input.inputDefinition, context), + }), + ...(input.inputDescription !== undefined && + input.inputDescription !== null && { inputDescription: input.inputDescription }), + ...(input.inputName !== undefined && input.inputName !== null && { inputName: input.inputName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -160,9 +166,7 @@ export const serializeAws_restJson1DeleteDetectorModelCommand = async ( input: DeleteDetectorModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector-models/{detectorModelName}"; if (input.detectorModelName !== undefined) { const labelValue: string = input.detectorModelName; @@ -190,9 +194,7 @@ export const serializeAws_restJson1DeleteInputCommand = async ( input: DeleteInputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/inputs/{inputName}"; if (input.inputName !== undefined) { const labelValue: string = input.inputName; @@ -220,9 +222,7 @@ export const serializeAws_restJson1DescribeDetectorModelCommand = async ( input: DescribeDetectorModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector-models/{detectorModelName}"; if (input.detectorModelName !== undefined) { const labelValue: string = input.detectorModelName; @@ -254,9 +254,7 @@ export const serializeAws_restJson1DescribeInputCommand = async ( input: DescribeInputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/inputs/{inputName}"; if (input.inputName !== undefined) { const labelValue: string = input.inputName; @@ -284,12 +282,10 @@ export const serializeAws_restJson1DescribeLoggingOptionsCommand = async ( input: DescribeLoggingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/logging"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -306,9 +302,7 @@ export const serializeAws_restJson1ListDetectorModelsCommand = async ( input: ListDetectorModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector-models"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -332,9 +326,7 @@ export const serializeAws_restJson1ListDetectorModelVersionsCommand = async ( input: ListDetectorModelVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/detector-models/{detectorModelName}/versions"; if (input.detectorModelName !== undefined) { const labelValue: string = input.detectorModelName; @@ -367,9 +359,7 @@ export const serializeAws_restJson1ListInputsCommand = async ( input: ListInputsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/inputs"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -393,9 +383,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags"; const query: any = { ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), @@ -419,14 +407,15 @@ export const serializeAws_restJson1PutLoggingOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/logging"; let body: any; body = JSON.stringify({ - ...(input.loggingOptions !== undefined && { - loggingOptions: serializeAws_restJson1LoggingOptions(input.loggingOptions, context), - }), + ...(input.loggingOptions !== undefined && + input.loggingOptions !== null && { + loggingOptions: serializeAws_restJson1LoggingOptions(input.loggingOptions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -445,7 +434,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags"; const query: any = { @@ -453,7 +442,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -472,9 +461,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags"; const query: any = { ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), @@ -499,7 +486,7 @@ export const serializeAws_restJson1UpdateDetectorModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/detector-models/{detectorModelName}"; if (input.detectorModelName !== undefined) { @@ -513,12 +500,15 @@ export const serializeAws_restJson1UpdateDetectorModelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.detectorModelDefinition !== undefined && { - detectorModelDefinition: serializeAws_restJson1DetectorModelDefinition(input.detectorModelDefinition, context), - }), - ...(input.detectorModelDescription !== undefined && { detectorModelDescription: input.detectorModelDescription }), - ...(input.evaluationMethod !== undefined && { evaluationMethod: input.evaluationMethod }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.detectorModelDefinition !== undefined && + input.detectorModelDefinition !== null && { + detectorModelDefinition: serializeAws_restJson1DetectorModelDefinition(input.detectorModelDefinition, context), + }), + ...(input.detectorModelDescription !== undefined && + input.detectorModelDescription !== null && { detectorModelDescription: input.detectorModelDescription }), + ...(input.evaluationMethod !== undefined && + input.evaluationMethod !== null && { evaluationMethod: input.evaluationMethod }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -537,7 +527,7 @@ export const serializeAws_restJson1UpdateInputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/inputs/{inputName}"; if (input.inputName !== undefined) { @@ -551,10 +541,12 @@ export const serializeAws_restJson1UpdateInputCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.inputDefinition !== undefined && { - inputDefinition: serializeAws_restJson1InputDefinition(input.inputDefinition, context), - }), - ...(input.inputDescription !== undefined && { inputDescription: input.inputDescription }), + ...(input.inputDefinition !== undefined && + input.inputDefinition !== null && { + inputDefinition: serializeAws_restJson1InputDefinition(input.inputDefinition, context), + }), + ...(input.inputDescription !== undefined && + input.inputDescription !== null && { inputDescription: input.inputDescription }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2183,91 +2175,119 @@ const deserializeAws_restJson1UnsupportedOperationExceptionResponse = async ( const serializeAws_restJson1Action = (input: Action, context: __SerdeContext): any => { return { - ...(input.clearTimer !== undefined && { - clearTimer: serializeAws_restJson1ClearTimerAction(input.clearTimer, context), - }), - ...(input.dynamoDB !== undefined && { dynamoDB: serializeAws_restJson1DynamoDBAction(input.dynamoDB, context) }), - ...(input.dynamoDBv2 !== undefined && { - dynamoDBv2: serializeAws_restJson1DynamoDBv2Action(input.dynamoDBv2, context), - }), - ...(input.firehose !== undefined && { firehose: serializeAws_restJson1FirehoseAction(input.firehose, context) }), - ...(input.iotEvents !== undefined && { - iotEvents: serializeAws_restJson1IotEventsAction(input.iotEvents, context), - }), - ...(input.iotSiteWise !== undefined && { - iotSiteWise: serializeAws_restJson1IotSiteWiseAction(input.iotSiteWise, context), - }), - ...(input.iotTopicPublish !== undefined && { - iotTopicPublish: serializeAws_restJson1IotTopicPublishAction(input.iotTopicPublish, context), - }), - ...(input.lambda !== undefined && { lambda: serializeAws_restJson1LambdaAction(input.lambda, context) }), - ...(input.resetTimer !== undefined && { - resetTimer: serializeAws_restJson1ResetTimerAction(input.resetTimer, context), - }), - ...(input.setTimer !== undefined && { setTimer: serializeAws_restJson1SetTimerAction(input.setTimer, context) }), - ...(input.setVariable !== undefined && { - setVariable: serializeAws_restJson1SetVariableAction(input.setVariable, context), - }), - ...(input.sns !== undefined && { sns: serializeAws_restJson1SNSTopicPublishAction(input.sns, context) }), - ...(input.sqs !== undefined && { sqs: serializeAws_restJson1SqsAction(input.sqs, context) }), + ...(input.clearTimer !== undefined && + input.clearTimer !== null && { clearTimer: serializeAws_restJson1ClearTimerAction(input.clearTimer, context) }), + ...(input.dynamoDB !== undefined && + input.dynamoDB !== null && { dynamoDB: serializeAws_restJson1DynamoDBAction(input.dynamoDB, context) }), + ...(input.dynamoDBv2 !== undefined && + input.dynamoDBv2 !== null && { dynamoDBv2: serializeAws_restJson1DynamoDBv2Action(input.dynamoDBv2, context) }), + ...(input.firehose !== undefined && + input.firehose !== null && { firehose: serializeAws_restJson1FirehoseAction(input.firehose, context) }), + ...(input.iotEvents !== undefined && + input.iotEvents !== null && { iotEvents: serializeAws_restJson1IotEventsAction(input.iotEvents, context) }), + ...(input.iotSiteWise !== undefined && + input.iotSiteWise !== null && { + iotSiteWise: serializeAws_restJson1IotSiteWiseAction(input.iotSiteWise, context), + }), + ...(input.iotTopicPublish !== undefined && + input.iotTopicPublish !== null && { + iotTopicPublish: serializeAws_restJson1IotTopicPublishAction(input.iotTopicPublish, context), + }), + ...(input.lambda !== undefined && + input.lambda !== null && { lambda: serializeAws_restJson1LambdaAction(input.lambda, context) }), + ...(input.resetTimer !== undefined && + input.resetTimer !== null && { resetTimer: serializeAws_restJson1ResetTimerAction(input.resetTimer, context) }), + ...(input.setTimer !== undefined && + input.setTimer !== null && { setTimer: serializeAws_restJson1SetTimerAction(input.setTimer, context) }), + ...(input.setVariable !== undefined && + input.setVariable !== null && { + setVariable: serializeAws_restJson1SetVariableAction(input.setVariable, context), + }), + ...(input.sns !== undefined && + input.sns !== null && { sns: serializeAws_restJson1SNSTopicPublishAction(input.sns, context) }), + ...(input.sqs !== undefined && input.sqs !== null && { sqs: serializeAws_restJson1SqsAction(input.sqs, context) }), }; }; const serializeAws_restJson1Actions = (input: Action[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Action(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Action(entry, context); + }); }; const serializeAws_restJson1AssetPropertyTimestamp = (input: AssetPropertyTimestamp, context: __SerdeContext): any => { return { - ...(input.offsetInNanos !== undefined && { offsetInNanos: input.offsetInNanos }), - ...(input.timeInSeconds !== undefined && { timeInSeconds: input.timeInSeconds }), + ...(input.offsetInNanos !== undefined && input.offsetInNanos !== null && { offsetInNanos: input.offsetInNanos }), + ...(input.timeInSeconds !== undefined && input.timeInSeconds !== null && { timeInSeconds: input.timeInSeconds }), }; }; const serializeAws_restJson1AssetPropertyValue = (input: AssetPropertyValue, context: __SerdeContext): any => { return { - ...(input.quality !== undefined && { quality: input.quality }), - ...(input.timestamp !== undefined && { - timestamp: serializeAws_restJson1AssetPropertyTimestamp(input.timestamp, context), - }), - ...(input.value !== undefined && { value: serializeAws_restJson1AssetPropertyVariant(input.value, context) }), + ...(input.quality !== undefined && input.quality !== null && { quality: input.quality }), + ...(input.timestamp !== undefined && + input.timestamp !== null && { + timestamp: serializeAws_restJson1AssetPropertyTimestamp(input.timestamp, context), + }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_restJson1AssetPropertyVariant(input.value, context) }), }; }; const serializeAws_restJson1AssetPropertyVariant = (input: AssetPropertyVariant, context: __SerdeContext): any => { return { - ...(input.booleanValue !== undefined && { booleanValue: input.booleanValue }), - ...(input.doubleValue !== undefined && { doubleValue: input.doubleValue }), - ...(input.integerValue !== undefined && { integerValue: input.integerValue }), - ...(input.stringValue !== undefined && { stringValue: input.stringValue }), + ...(input.booleanValue !== undefined && input.booleanValue !== null && { booleanValue: input.booleanValue }), + ...(input.doubleValue !== undefined && input.doubleValue !== null && { doubleValue: input.doubleValue }), + ...(input.integerValue !== undefined && input.integerValue !== null && { integerValue: input.integerValue }), + ...(input.stringValue !== undefined && input.stringValue !== null && { stringValue: input.stringValue }), }; }; const serializeAws_restJson1Attribute = (input: Attribute, context: __SerdeContext): any => { return { - ...(input.jsonPath !== undefined && { jsonPath: input.jsonPath }), + ...(input.jsonPath !== undefined && input.jsonPath !== null && { jsonPath: input.jsonPath }), }; }; const serializeAws_restJson1Attributes = (input: Attribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Attribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Attribute(entry, context); + }); }; const serializeAws_restJson1ClearTimerAction = (input: ClearTimerAction, context: __SerdeContext): any => { return { - ...(input.timerName !== undefined && { timerName: input.timerName }), + ...(input.timerName !== undefined && input.timerName !== null && { timerName: input.timerName }), }; }; const serializeAws_restJson1DetectorDebugOption = (input: DetectorDebugOption, context: __SerdeContext): any => { return { - ...(input.detectorModelName !== undefined && { detectorModelName: input.detectorModelName }), - ...(input.keyValue !== undefined && { keyValue: input.keyValue }), + ...(input.detectorModelName !== undefined && + input.detectorModelName !== null && { detectorModelName: input.detectorModelName }), + ...(input.keyValue !== undefined && input.keyValue !== null && { keyValue: input.keyValue }), }; }; const serializeAws_restJson1DetectorDebugOptions = (input: DetectorDebugOption[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DetectorDebugOption(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DetectorDebugOption(entry, context); + }); }; const serializeAws_restJson1DetectorModelDefinition = ( @@ -2275,202 +2295,255 @@ const serializeAws_restJson1DetectorModelDefinition = ( context: __SerdeContext ): any => { return { - ...(input.initialStateName !== undefined && { initialStateName: input.initialStateName }), - ...(input.states !== undefined && { states: serializeAws_restJson1States(input.states, context) }), + ...(input.initialStateName !== undefined && + input.initialStateName !== null && { initialStateName: input.initialStateName }), + ...(input.states !== undefined && + input.states !== null && { states: serializeAws_restJson1States(input.states, context) }), }; }; const serializeAws_restJson1DynamoDBAction = (input: DynamoDBAction, context: __SerdeContext): any => { return { - ...(input.hashKeyField !== undefined && { hashKeyField: input.hashKeyField }), - ...(input.hashKeyType !== undefined && { hashKeyType: input.hashKeyType }), - ...(input.hashKeyValue !== undefined && { hashKeyValue: input.hashKeyValue }), - ...(input.operation !== undefined && { operation: input.operation }), - ...(input.payload !== undefined && { payload: serializeAws_restJson1Payload(input.payload, context) }), - ...(input.payloadField !== undefined && { payloadField: input.payloadField }), - ...(input.rangeKeyField !== undefined && { rangeKeyField: input.rangeKeyField }), - ...(input.rangeKeyType !== undefined && { rangeKeyType: input.rangeKeyType }), - ...(input.rangeKeyValue !== undefined && { rangeKeyValue: input.rangeKeyValue }), - ...(input.tableName !== undefined && { tableName: input.tableName }), + ...(input.hashKeyField !== undefined && input.hashKeyField !== null && { hashKeyField: input.hashKeyField }), + ...(input.hashKeyType !== undefined && input.hashKeyType !== null && { hashKeyType: input.hashKeyType }), + ...(input.hashKeyValue !== undefined && input.hashKeyValue !== null && { hashKeyValue: input.hashKeyValue }), + ...(input.operation !== undefined && input.operation !== null && { operation: input.operation }), + ...(input.payload !== undefined && + input.payload !== null && { payload: serializeAws_restJson1Payload(input.payload, context) }), + ...(input.payloadField !== undefined && input.payloadField !== null && { payloadField: input.payloadField }), + ...(input.rangeKeyField !== undefined && input.rangeKeyField !== null && { rangeKeyField: input.rangeKeyField }), + ...(input.rangeKeyType !== undefined && input.rangeKeyType !== null && { rangeKeyType: input.rangeKeyType }), + ...(input.rangeKeyValue !== undefined && input.rangeKeyValue !== null && { rangeKeyValue: input.rangeKeyValue }), + ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }), }; }; const serializeAws_restJson1DynamoDBv2Action = (input: DynamoDBv2Action, context: __SerdeContext): any => { return { - ...(input.payload !== undefined && { payload: serializeAws_restJson1Payload(input.payload, context) }), - ...(input.tableName !== undefined && { tableName: input.tableName }), + ...(input.payload !== undefined && + input.payload !== null && { payload: serializeAws_restJson1Payload(input.payload, context) }), + ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }), }; }; const serializeAws_restJson1Event = (input: Event, context: __SerdeContext): any => { return { - ...(input.actions !== undefined && { actions: serializeAws_restJson1Actions(input.actions, context) }), - ...(input.condition !== undefined && { condition: input.condition }), - ...(input.eventName !== undefined && { eventName: input.eventName }), + ...(input.actions !== undefined && + input.actions !== null && { actions: serializeAws_restJson1Actions(input.actions, context) }), + ...(input.condition !== undefined && input.condition !== null && { condition: input.condition }), + ...(input.eventName !== undefined && input.eventName !== null && { eventName: input.eventName }), }; }; const serializeAws_restJson1Events = (input: Event[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Event(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Event(entry, context); + }); }; const serializeAws_restJson1FirehoseAction = (input: FirehoseAction, context: __SerdeContext): any => { return { - ...(input.deliveryStreamName !== undefined && { deliveryStreamName: input.deliveryStreamName }), - ...(input.payload !== undefined && { payload: serializeAws_restJson1Payload(input.payload, context) }), - ...(input.separator !== undefined && { separator: input.separator }), + ...(input.deliveryStreamName !== undefined && + input.deliveryStreamName !== null && { deliveryStreamName: input.deliveryStreamName }), + ...(input.payload !== undefined && + input.payload !== null && { payload: serializeAws_restJson1Payload(input.payload, context) }), + ...(input.separator !== undefined && input.separator !== null && { separator: input.separator }), }; }; const serializeAws_restJson1InputDefinition = (input: InputDefinition, context: __SerdeContext): any => { return { - ...(input.attributes !== undefined && { attributes: serializeAws_restJson1Attributes(input.attributes, context) }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_restJson1Attributes(input.attributes, context) }), }; }; const serializeAws_restJson1IotEventsAction = (input: IotEventsAction, context: __SerdeContext): any => { return { - ...(input.inputName !== undefined && { inputName: input.inputName }), - ...(input.payload !== undefined && { payload: serializeAws_restJson1Payload(input.payload, context) }), + ...(input.inputName !== undefined && input.inputName !== null && { inputName: input.inputName }), + ...(input.payload !== undefined && + input.payload !== null && { payload: serializeAws_restJson1Payload(input.payload, context) }), }; }; const serializeAws_restJson1IotSiteWiseAction = (input: IotSiteWiseAction, context: __SerdeContext): any => { return { - ...(input.assetId !== undefined && { assetId: input.assetId }), - ...(input.entryId !== undefined && { entryId: input.entryId }), - ...(input.propertyAlias !== undefined && { propertyAlias: input.propertyAlias }), - ...(input.propertyId !== undefined && { propertyId: input.propertyId }), - ...(input.propertyValue !== undefined && { - propertyValue: serializeAws_restJson1AssetPropertyValue(input.propertyValue, context), - }), + ...(input.assetId !== undefined && input.assetId !== null && { assetId: input.assetId }), + ...(input.entryId !== undefined && input.entryId !== null && { entryId: input.entryId }), + ...(input.propertyAlias !== undefined && input.propertyAlias !== null && { propertyAlias: input.propertyAlias }), + ...(input.propertyId !== undefined && input.propertyId !== null && { propertyId: input.propertyId }), + ...(input.propertyValue !== undefined && + input.propertyValue !== null && { + propertyValue: serializeAws_restJson1AssetPropertyValue(input.propertyValue, context), + }), }; }; const serializeAws_restJson1IotTopicPublishAction = (input: IotTopicPublishAction, context: __SerdeContext): any => { return { - ...(input.mqttTopic !== undefined && { mqttTopic: input.mqttTopic }), - ...(input.payload !== undefined && { payload: serializeAws_restJson1Payload(input.payload, context) }), + ...(input.mqttTopic !== undefined && input.mqttTopic !== null && { mqttTopic: input.mqttTopic }), + ...(input.payload !== undefined && + input.payload !== null && { payload: serializeAws_restJson1Payload(input.payload, context) }), }; }; const serializeAws_restJson1LambdaAction = (input: LambdaAction, context: __SerdeContext): any => { return { - ...(input.functionArn !== undefined && { functionArn: input.functionArn }), - ...(input.payload !== undefined && { payload: serializeAws_restJson1Payload(input.payload, context) }), + ...(input.functionArn !== undefined && input.functionArn !== null && { functionArn: input.functionArn }), + ...(input.payload !== undefined && + input.payload !== null && { payload: serializeAws_restJson1Payload(input.payload, context) }), }; }; const serializeAws_restJson1LoggingOptions = (input: LoggingOptions, context: __SerdeContext): any => { return { - ...(input.detectorDebugOptions !== undefined && { - detectorDebugOptions: serializeAws_restJson1DetectorDebugOptions(input.detectorDebugOptions, context), - }), - ...(input.enabled !== undefined && { enabled: input.enabled }), - ...(input.level !== undefined && { level: input.level }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.detectorDebugOptions !== undefined && + input.detectorDebugOptions !== null && { + detectorDebugOptions: serializeAws_restJson1DetectorDebugOptions(input.detectorDebugOptions, context), + }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), + ...(input.level !== undefined && input.level !== null && { level: input.level }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1OnEnterLifecycle = (input: OnEnterLifecycle, context: __SerdeContext): any => { return { - ...(input.events !== undefined && { events: serializeAws_restJson1Events(input.events, context) }), + ...(input.events !== undefined && + input.events !== null && { events: serializeAws_restJson1Events(input.events, context) }), }; }; const serializeAws_restJson1OnExitLifecycle = (input: OnExitLifecycle, context: __SerdeContext): any => { return { - ...(input.events !== undefined && { events: serializeAws_restJson1Events(input.events, context) }), + ...(input.events !== undefined && + input.events !== null && { events: serializeAws_restJson1Events(input.events, context) }), }; }; const serializeAws_restJson1OnInputLifecycle = (input: OnInputLifecycle, context: __SerdeContext): any => { return { - ...(input.events !== undefined && { events: serializeAws_restJson1Events(input.events, context) }), - ...(input.transitionEvents !== undefined && { - transitionEvents: serializeAws_restJson1TransitionEvents(input.transitionEvents, context), - }), + ...(input.events !== undefined && + input.events !== null && { events: serializeAws_restJson1Events(input.events, context) }), + ...(input.transitionEvents !== undefined && + input.transitionEvents !== null && { + transitionEvents: serializeAws_restJson1TransitionEvents(input.transitionEvents, context), + }), }; }; const serializeAws_restJson1Payload = (input: Payload, context: __SerdeContext): any => { return { - ...(input.contentExpression !== undefined && { contentExpression: input.contentExpression }), - ...(input.type !== undefined && { type: input.type }), + ...(input.contentExpression !== undefined && + input.contentExpression !== null && { contentExpression: input.contentExpression }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1ResetTimerAction = (input: ResetTimerAction, context: __SerdeContext): any => { return { - ...(input.timerName !== undefined && { timerName: input.timerName }), + ...(input.timerName !== undefined && input.timerName !== null && { timerName: input.timerName }), }; }; const serializeAws_restJson1SetTimerAction = (input: SetTimerAction, context: __SerdeContext): any => { return { - ...(input.durationExpression !== undefined && { durationExpression: input.durationExpression }), - ...(input.seconds !== undefined && { seconds: input.seconds }), - ...(input.timerName !== undefined && { timerName: input.timerName }), + ...(input.durationExpression !== undefined && + input.durationExpression !== null && { durationExpression: input.durationExpression }), + ...(input.seconds !== undefined && input.seconds !== null && { seconds: input.seconds }), + ...(input.timerName !== undefined && input.timerName !== null && { timerName: input.timerName }), }; }; const serializeAws_restJson1SetVariableAction = (input: SetVariableAction, context: __SerdeContext): any => { return { - ...(input.value !== undefined && { value: input.value }), - ...(input.variableName !== undefined && { variableName: input.variableName }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), + ...(input.variableName !== undefined && input.variableName !== null && { variableName: input.variableName }), }; }; const serializeAws_restJson1SNSTopicPublishAction = (input: SNSTopicPublishAction, context: __SerdeContext): any => { return { - ...(input.payload !== undefined && { payload: serializeAws_restJson1Payload(input.payload, context) }), - ...(input.targetArn !== undefined && { targetArn: input.targetArn }), + ...(input.payload !== undefined && + input.payload !== null && { payload: serializeAws_restJson1Payload(input.payload, context) }), + ...(input.targetArn !== undefined && input.targetArn !== null && { targetArn: input.targetArn }), }; }; const serializeAws_restJson1SqsAction = (input: SqsAction, context: __SerdeContext): any => { return { - ...(input.payload !== undefined && { payload: serializeAws_restJson1Payload(input.payload, context) }), - ...(input.queueUrl !== undefined && { queueUrl: input.queueUrl }), - ...(input.useBase64 !== undefined && { useBase64: input.useBase64 }), + ...(input.payload !== undefined && + input.payload !== null && { payload: serializeAws_restJson1Payload(input.payload, context) }), + ...(input.queueUrl !== undefined && input.queueUrl !== null && { queueUrl: input.queueUrl }), + ...(input.useBase64 !== undefined && input.useBase64 !== null && { useBase64: input.useBase64 }), }; }; const serializeAws_restJson1State = (input: State, context: __SerdeContext): any => { return { - ...(input.onEnter !== undefined && { onEnter: serializeAws_restJson1OnEnterLifecycle(input.onEnter, context) }), - ...(input.onExit !== undefined && { onExit: serializeAws_restJson1OnExitLifecycle(input.onExit, context) }), - ...(input.onInput !== undefined && { onInput: serializeAws_restJson1OnInputLifecycle(input.onInput, context) }), - ...(input.stateName !== undefined && { stateName: input.stateName }), + ...(input.onEnter !== undefined && + input.onEnter !== null && { onEnter: serializeAws_restJson1OnEnterLifecycle(input.onEnter, context) }), + ...(input.onExit !== undefined && + input.onExit !== null && { onExit: serializeAws_restJson1OnExitLifecycle(input.onExit, context) }), + ...(input.onInput !== undefined && + input.onInput !== null && { onInput: serializeAws_restJson1OnInputLifecycle(input.onInput, context) }), + ...(input.stateName !== undefined && input.stateName !== null && { stateName: input.stateName }), }; }; const serializeAws_restJson1States = (input: State[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1State(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1State(entry, context); + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TransitionEvent = (input: TransitionEvent, context: __SerdeContext): any => { return { - ...(input.actions !== undefined && { actions: serializeAws_restJson1Actions(input.actions, context) }), - ...(input.condition !== undefined && { condition: input.condition }), - ...(input.eventName !== undefined && { eventName: input.eventName }), - ...(input.nextState !== undefined && { nextState: input.nextState }), + ...(input.actions !== undefined && + input.actions !== null && { actions: serializeAws_restJson1Actions(input.actions, context) }), + ...(input.condition !== undefined && input.condition !== null && { condition: input.condition }), + ...(input.eventName !== undefined && input.eventName !== null && { eventName: input.eventName }), + ...(input.nextState !== undefined && input.nextState !== null && { nextState: input.nextState }), }; }; const serializeAws_restJson1TransitionEvents = (input: TransitionEvent[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1TransitionEvent(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TransitionEvent(entry, context); + }); }; const deserializeAws_restJson1Action = (output: any, context: __SerdeContext): Action => { @@ -2531,7 +2604,14 @@ const deserializeAws_restJson1Action = (output: any, context: __SerdeContext): A }; const deserializeAws_restJson1Actions = (output: any, context: __SerdeContext): Action[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Action(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Action(entry, context); + }); }; const deserializeAws_restJson1AssetPropertyTimestamp = ( @@ -2576,7 +2656,14 @@ const deserializeAws_restJson1Attribute = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1Attributes = (output: any, context: __SerdeContext): Attribute[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Attribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Attribute(entry, context); + }); }; const deserializeAws_restJson1ClearTimerAction = (output: any, context: __SerdeContext): ClearTimerAction => { @@ -2596,7 +2683,14 @@ const deserializeAws_restJson1DetectorDebugOption = (output: any, context: __Ser }; const deserializeAws_restJson1DetectorDebugOptions = (output: any, context: __SerdeContext): DetectorDebugOption[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DetectorDebugOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DetectorDebugOption(entry, context); + }); }; const deserializeAws_restJson1DetectorModel = (output: any, context: __SerdeContext): DetectorModel => { @@ -2665,7 +2759,14 @@ const deserializeAws_restJson1DetectorModelSummaries = ( output: any, context: __SerdeContext ): DetectorModelSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DetectorModelSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DetectorModelSummary(entry, context); + }); }; const deserializeAws_restJson1DetectorModelSummary = (output: any, context: __SerdeContext): DetectorModelSummary => { @@ -2689,7 +2790,14 @@ const deserializeAws_restJson1DetectorModelVersionSummaries = ( output: any, context: __SerdeContext ): DetectorModelVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DetectorModelVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DetectorModelVersionSummary(entry, context); + }); }; const deserializeAws_restJson1DetectorModelVersionSummary = ( @@ -2764,7 +2872,14 @@ const deserializeAws_restJson1Event = (output: any, context: __SerdeContext): Ev }; const deserializeAws_restJson1Events = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Event(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Event(entry, context); + }); }; const deserializeAws_restJson1FirehoseAction = (output: any, context: __SerdeContext): FirehoseAction => { @@ -2822,7 +2937,14 @@ const deserializeAws_restJson1InputDefinition = (output: any, context: __SerdeCo }; const deserializeAws_restJson1InputSummaries = (output: any, context: __SerdeContext): InputSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputSummary(entry, context); + }); }; const deserializeAws_restJson1InputSummary = (output: any, context: __SerdeContext): InputSummary => { @@ -3004,7 +3126,14 @@ const deserializeAws_restJson1State = (output: any, context: __SerdeContext): St }; const deserializeAws_restJson1States = (output: any, context: __SerdeContext): State[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1State(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1State(entry, context); + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -3015,7 +3144,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TransitionEvent = (output: any, context: __SerdeContext): TransitionEvent => { @@ -3031,7 +3167,14 @@ const deserializeAws_restJson1TransitionEvent = (output: any, context: __SerdeCo }; const deserializeAws_restJson1TransitionEvents = (output: any, context: __SerdeContext): TransitionEvent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TransitionEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TransitionEvent(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -3054,6 +3197,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iot-jobs-data-plane/protocols/Aws_restJson1.ts b/clients/client-iot-jobs-data-plane/protocols/Aws_restJson1.ts index 9cf6a3bd5fa2..c2ac8b0f6ac8 100644 --- a/clients/client-iot-jobs-data-plane/protocols/Aws_restJson1.ts +++ b/clients/client-iot-jobs-data-plane/protocols/Aws_restJson1.ts @@ -39,9 +39,7 @@ export const serializeAws_restJson1DescribeJobExecutionCommand = async ( input: DescribeJobExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}/jobs/{jobId}"; if (input.jobId !== undefined) { const labelValue: string = input.jobId; @@ -83,9 +81,7 @@ export const serializeAws_restJson1GetPendingJobExecutionsCommand = async ( input: GetPendingJobExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}/jobs"; if (input.thingName !== undefined) { const labelValue: string = input.thingName; @@ -114,7 +110,7 @@ export const serializeAws_restJson1StartNextPendingJobExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/things/{thingName}/jobs/$next"; if (input.thingName !== undefined) { @@ -128,10 +124,12 @@ export const serializeAws_restJson1StartNextPendingJobExecutionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.statusDetails !== undefined && { - statusDetails: serializeAws_restJson1DetailsMap(input.statusDetails, context), - }), - ...(input.stepTimeoutInMinutes !== undefined && { stepTimeoutInMinutes: input.stepTimeoutInMinutes }), + ...(input.statusDetails !== undefined && + input.statusDetails !== null && { + statusDetails: serializeAws_restJson1DetailsMap(input.statusDetails, context), + }), + ...(input.stepTimeoutInMinutes !== undefined && + input.stepTimeoutInMinutes !== null && { stepTimeoutInMinutes: input.stepTimeoutInMinutes }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -150,7 +148,7 @@ export const serializeAws_restJson1UpdateJobExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/things/{thingName}/jobs/{jobId}"; if (input.jobId !== undefined) { @@ -173,15 +171,21 @@ export const serializeAws_restJson1UpdateJobExecutionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.executionNumber !== undefined && { executionNumber: input.executionNumber }), - ...(input.expectedVersion !== undefined && { expectedVersion: input.expectedVersion }), - ...(input.includeJobDocument !== undefined && { includeJobDocument: input.includeJobDocument }), - ...(input.includeJobExecutionState !== undefined && { includeJobExecutionState: input.includeJobExecutionState }), - ...(input.status !== undefined && { status: input.status }), - ...(input.statusDetails !== undefined && { - statusDetails: serializeAws_restJson1DetailsMap(input.statusDetails, context), - }), - ...(input.stepTimeoutInMinutes !== undefined && { stepTimeoutInMinutes: input.stepTimeoutInMinutes }), + ...(input.executionNumber !== undefined && + input.executionNumber !== null && { executionNumber: input.executionNumber }), + ...(input.expectedVersion !== undefined && + input.expectedVersion !== null && { expectedVersion: input.expectedVersion }), + ...(input.includeJobDocument !== undefined && + input.includeJobDocument !== null && { includeJobDocument: input.includeJobDocument }), + ...(input.includeJobExecutionState !== undefined && + input.includeJobExecutionState !== null && { includeJobExecutionState: input.includeJobExecutionState }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.statusDetails !== undefined && + input.statusDetails !== null && { + statusDetails: serializeAws_restJson1DetailsMap(input.statusDetails, context), + }), + ...(input.stepTimeoutInMinutes !== undefined && + input.stepTimeoutInMinutes !== null && { stepTimeoutInMinutes: input.stepTimeoutInMinutes }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -691,23 +695,27 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async ( }; const serializeAws_restJson1DetailsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DetailsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1JobExecution = (output: any, context: __SerdeContext): JobExecution => { @@ -765,7 +773,14 @@ const deserializeAws_restJson1JobExecutionSummaryList = ( output: any, context: __SerdeContext ): JobExecutionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobExecutionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobExecutionSummary(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -788,6 +803,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iot/protocols/Aws_restJson1.ts b/clients/client-iot/protocols/Aws_restJson1.ts index d676cb252e08..3acb105d4e37 100644 --- a/clients/client-iot/protocols/Aws_restJson1.ts +++ b/clients/client-iot/protocols/Aws_restJson1.ts @@ -802,9 +802,7 @@ export const serializeAws_restJson1AcceptCertificateTransferCommand = async ( input: AcceptCertificateTransferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accept-certificate-transfer/{certificateId}"; if (input.certificateId !== undefined) { const labelValue: string = input.certificateId; @@ -837,15 +835,17 @@ export const serializeAws_restJson1AddThingToBillingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/billing-groups/addThingToBillingGroup"; let body: any; body = JSON.stringify({ - ...(input.billingGroupArn !== undefined && { billingGroupArn: input.billingGroupArn }), - ...(input.billingGroupName !== undefined && { billingGroupName: input.billingGroupName }), - ...(input.thingArn !== undefined && { thingArn: input.thingArn }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.billingGroupArn !== undefined && + input.billingGroupArn !== null && { billingGroupArn: input.billingGroupArn }), + ...(input.billingGroupName !== undefined && + input.billingGroupName !== null && { billingGroupName: input.billingGroupName }), + ...(input.thingArn !== undefined && input.thingArn !== null && { thingArn: input.thingArn }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -864,16 +864,18 @@ export const serializeAws_restJson1AddThingToThingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/thing-groups/addThingToThingGroup"; let body: any; body = JSON.stringify({ - ...(input.overrideDynamicGroups !== undefined && { overrideDynamicGroups: input.overrideDynamicGroups }), - ...(input.thingArn !== undefined && { thingArn: input.thingArn }), - ...(input.thingGroupArn !== undefined && { thingGroupArn: input.thingGroupArn }), - ...(input.thingGroupName !== undefined && { thingGroupName: input.thingGroupName }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.overrideDynamicGroups !== undefined && + input.overrideDynamicGroups !== null && { overrideDynamicGroups: input.overrideDynamicGroups }), + ...(input.thingArn !== undefined && input.thingArn !== null && { thingArn: input.thingArn }), + ...(input.thingGroupArn !== undefined && input.thingGroupArn !== null && { thingGroupArn: input.thingGroupArn }), + ...(input.thingGroupName !== undefined && + input.thingGroupName !== null && { thingGroupName: input.thingGroupName }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -892,7 +894,7 @@ export const serializeAws_restJson1AssociateTargetsWithJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/jobs/{jobId}/targets"; if (input.jobId !== undefined) { @@ -909,8 +911,9 @@ export const serializeAws_restJson1AssociateTargetsWithJobCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.comment !== undefined && { comment: input.comment }), - ...(input.targets !== undefined && { targets: serializeAws_restJson1JobTargets(input.targets, context) }), + ...(input.comment !== undefined && input.comment !== null && { comment: input.comment }), + ...(input.targets !== undefined && + input.targets !== null && { targets: serializeAws_restJson1JobTargets(input.targets, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -930,7 +933,7 @@ export const serializeAws_restJson1AttachPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/target-policies/{policyName}"; if (input.policyName !== undefined) { @@ -944,7 +947,7 @@ export const serializeAws_restJson1AttachPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.target !== undefined && { target: input.target }), + ...(input.target !== undefined && input.target !== null && { target: input.target }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -963,7 +966,6 @@ export const serializeAws_restJson1AttachPrincipalPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.principal) && { "x-amzn-iot-principal": input.principal! }), }; let resolvedPath = "/principal-policies/{policyName}"; @@ -993,9 +995,7 @@ export const serializeAws_restJson1AttachSecurityProfileCommand = async ( input: AttachSecurityProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/security-profiles/{securityProfileName}/targets"; if (input.securityProfileName !== undefined) { const labelValue: string = input.securityProfileName; @@ -1028,7 +1028,6 @@ export const serializeAws_restJson1AttachThingPrincipalCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.principal) && { "x-amzn-principal": input.principal! }), }; let resolvedPath = "/things/{thingName}/principals"; @@ -1058,9 +1057,7 @@ export const serializeAws_restJson1CancelAuditMitigationActionsTaskCommand = asy input: CancelAuditMitigationActionsTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/mitigationactions/tasks/{taskId}/cancel"; if (input.taskId !== undefined) { const labelValue: string = input.taskId; @@ -1088,9 +1085,7 @@ export const serializeAws_restJson1CancelAuditTaskCommand = async ( input: CancelAuditTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/tasks/{taskId}/cancel"; if (input.taskId !== undefined) { const labelValue: string = input.taskId; @@ -1118,9 +1113,7 @@ export const serializeAws_restJson1CancelCertificateTransferCommand = async ( input: CancelCertificateTransferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/cancel-certificate-transfer/{certificateId}"; if (input.certificateId !== undefined) { const labelValue: string = input.certificateId; @@ -1149,7 +1142,7 @@ export const serializeAws_restJson1CancelJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/jobs/{jobId}/cancel"; if (input.jobId !== undefined) { @@ -1166,8 +1159,8 @@ export const serializeAws_restJson1CancelJobCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.comment !== undefined && { comment: input.comment }), - ...(input.reasonCode !== undefined && { reasonCode: input.reasonCode }), + ...(input.comment !== undefined && input.comment !== null && { comment: input.comment }), + ...(input.reasonCode !== undefined && input.reasonCode !== null && { reasonCode: input.reasonCode }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1187,7 +1180,7 @@ export const serializeAws_restJson1CancelJobExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/things/{thingName}/jobs/{jobId}/cancel"; if (input.jobId !== undefined) { @@ -1213,10 +1206,12 @@ export const serializeAws_restJson1CancelJobExecutionCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.expectedVersion !== undefined && { expectedVersion: input.expectedVersion }), - ...(input.statusDetails !== undefined && { - statusDetails: serializeAws_restJson1DetailsMap(input.statusDetails, context), - }), + ...(input.expectedVersion !== undefined && + input.expectedVersion !== null && { expectedVersion: input.expectedVersion }), + ...(input.statusDetails !== undefined && + input.statusDetails !== null && { + statusDetails: serializeAws_restJson1DetailsMap(input.statusDetails, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1235,12 +1230,10 @@ export const serializeAws_restJson1ClearDefaultAuthorizerCommand = async ( input: ClearDefaultAuthorizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/default-authorizer"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1257,9 +1250,7 @@ export const serializeAws_restJson1ConfirmTopicRuleDestinationCommand = async ( input: ConfirmTopicRuleDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/confirmdestination/{confirmationToken+}"; if (input.confirmationToken !== undefined) { const labelValue: string = input.confirmationToken; @@ -1294,19 +1285,22 @@ export const serializeAws_restJson1CreateAuditSuppressionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/suppressions/create"; let body: any; body = JSON.stringify({ - ...(input.checkName !== undefined && { checkName: input.checkName }), + ...(input.checkName !== undefined && input.checkName !== null && { checkName: input.checkName }), clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.expirationDate !== undefined && { expirationDate: Math.round(input.expirationDate.getTime() / 1000) }), - ...(input.resourceIdentifier !== undefined && { - resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), - }), - ...(input.suppressIndefinitely !== undefined && { suppressIndefinitely: input.suppressIndefinitely }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.expirationDate !== undefined && + input.expirationDate !== null && { expirationDate: Math.round(input.expirationDate.getTime() / 1000) }), + ...(input.resourceIdentifier !== undefined && + input.resourceIdentifier !== null && { + resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), + }), + ...(input.suppressIndefinitely !== undefined && + input.suppressIndefinitely !== null && { suppressIndefinitely: input.suppressIndefinitely }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1325,7 +1319,7 @@ export const serializeAws_restJson1CreateAuthorizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/authorizer/{authorizerName}"; if (input.authorizerName !== undefined) { @@ -1339,14 +1333,18 @@ export const serializeAws_restJson1CreateAuthorizerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.authorizerFunctionArn !== undefined && { authorizerFunctionArn: input.authorizerFunctionArn }), - ...(input.signingDisabled !== undefined && { signingDisabled: input.signingDisabled }), - ...(input.status !== undefined && { status: input.status }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.tokenKeyName !== undefined && { tokenKeyName: input.tokenKeyName }), - ...(input.tokenSigningPublicKeys !== undefined && { - tokenSigningPublicKeys: serializeAws_restJson1PublicKeyMap(input.tokenSigningPublicKeys, context), - }), + ...(input.authorizerFunctionArn !== undefined && + input.authorizerFunctionArn !== null && { authorizerFunctionArn: input.authorizerFunctionArn }), + ...(input.signingDisabled !== undefined && + input.signingDisabled !== null && { signingDisabled: input.signingDisabled }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.tokenKeyName !== undefined && input.tokenKeyName !== null && { tokenKeyName: input.tokenKeyName }), + ...(input.tokenSigningPublicKeys !== undefined && + input.tokenSigningPublicKeys !== null && { + tokenSigningPublicKeys: serializeAws_restJson1PublicKeyMap(input.tokenSigningPublicKeys, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1365,7 +1363,7 @@ export const serializeAws_restJson1CreateBillingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/billing-groups/{billingGroupName}"; if (input.billingGroupName !== undefined) { @@ -1379,10 +1377,12 @@ export const serializeAws_restJson1CreateBillingGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.billingGroupProperties !== undefined && { - billingGroupProperties: serializeAws_restJson1BillingGroupProperties(input.billingGroupProperties, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.billingGroupProperties !== undefined && + input.billingGroupProperties !== null && { + billingGroupProperties: serializeAws_restJson1BillingGroupProperties(input.billingGroupProperties, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1401,7 +1401,7 @@ export const serializeAws_restJson1CreateCertificateFromCsrCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/certificates"; const query: any = { @@ -1409,9 +1409,8 @@ export const serializeAws_restJson1CreateCertificateFromCsrCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.certificateSigningRequest !== undefined && { - certificateSigningRequest: input.certificateSigningRequest, - }), + ...(input.certificateSigningRequest !== undefined && + input.certificateSigningRequest !== null && { certificateSigningRequest: input.certificateSigningRequest }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1431,7 +1430,7 @@ export const serializeAws_restJson1CreateDimensionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/dimensions/{name}"; if (input.name !== undefined) { @@ -1446,11 +1445,13 @@ export const serializeAws_restJson1CreateDimensionCommand = async ( let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.stringValues !== undefined && { - stringValues: serializeAws_restJson1DimensionStringValues(input.stringValues, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.stringValues !== undefined && + input.stringValues !== null && { + stringValues: serializeAws_restJson1DimensionStringValues(input.stringValues, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1469,7 +1470,7 @@ export const serializeAws_restJson1CreateDomainConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domainConfigurations/{domainConfigurationName}"; if (input.domainConfigurationName !== undefined) { @@ -1483,16 +1484,20 @@ export const serializeAws_restJson1CreateDomainConfigurationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.authorizerConfig !== undefined && { - authorizerConfig: serializeAws_restJson1AuthorizerConfig(input.authorizerConfig, context), - }), - ...(input.domainName !== undefined && { domainName: input.domainName }), - ...(input.serverCertificateArns !== undefined && { - serverCertificateArns: serializeAws_restJson1ServerCertificateArns(input.serverCertificateArns, context), - }), - ...(input.serviceType !== undefined && { serviceType: input.serviceType }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.validationCertificateArn !== undefined && { validationCertificateArn: input.validationCertificateArn }), + ...(input.authorizerConfig !== undefined && + input.authorizerConfig !== null && { + authorizerConfig: serializeAws_restJson1AuthorizerConfig(input.authorizerConfig, context), + }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), + ...(input.serverCertificateArns !== undefined && + input.serverCertificateArns !== null && { + serverCertificateArns: serializeAws_restJson1ServerCertificateArns(input.serverCertificateArns, context), + }), + ...(input.serviceType !== undefined && input.serviceType !== null && { serviceType: input.serviceType }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.validationCertificateArn !== undefined && + input.validationCertificateArn !== null && { validationCertificateArn: input.validationCertificateArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1511,7 +1516,7 @@ export const serializeAws_restJson1CreateDynamicThingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/dynamic-thing-groups/{thingGroupName}"; if (input.thingGroupName !== undefined) { @@ -1525,13 +1530,15 @@ export const serializeAws_restJson1CreateDynamicThingGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.indexName !== undefined && { indexName: input.indexName }), - ...(input.queryString !== undefined && { queryString: input.queryString }), - ...(input.queryVersion !== undefined && { queryVersion: input.queryVersion }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.thingGroupProperties !== undefined && { - thingGroupProperties: serializeAws_restJson1ThingGroupProperties(input.thingGroupProperties, context), - }), + ...(input.indexName !== undefined && input.indexName !== null && { indexName: input.indexName }), + ...(input.queryString !== undefined && input.queryString !== null && { queryString: input.queryString }), + ...(input.queryVersion !== undefined && input.queryVersion !== null && { queryVersion: input.queryVersion }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.thingGroupProperties !== undefined && + input.thingGroupProperties !== null && { + thingGroupProperties: serializeAws_restJson1ThingGroupProperties(input.thingGroupProperties, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1550,7 +1557,7 @@ export const serializeAws_restJson1CreateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/jobs/{jobId}"; if (input.jobId !== undefined) { @@ -1564,28 +1571,34 @@ export const serializeAws_restJson1CreateJobCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.abortConfig !== undefined && { - abortConfig: serializeAws_restJson1AbortConfig(input.abortConfig, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.document !== undefined && { document: input.document }), - ...(input.documentSource !== undefined && { documentSource: input.documentSource }), - ...(input.jobExecutionsRolloutConfig !== undefined && { - jobExecutionsRolloutConfig: serializeAws_restJson1JobExecutionsRolloutConfig( - input.jobExecutionsRolloutConfig, - context - ), - }), - ...(input.namespaceId !== undefined && { namespaceId: input.namespaceId }), - ...(input.presignedUrlConfig !== undefined && { - presignedUrlConfig: serializeAws_restJson1PresignedUrlConfig(input.presignedUrlConfig, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.targetSelection !== undefined && { targetSelection: input.targetSelection }), - ...(input.targets !== undefined && { targets: serializeAws_restJson1JobTargets(input.targets, context) }), - ...(input.timeoutConfig !== undefined && { - timeoutConfig: serializeAws_restJson1TimeoutConfig(input.timeoutConfig, context), - }), + ...(input.abortConfig !== undefined && + input.abortConfig !== null && { abortConfig: serializeAws_restJson1AbortConfig(input.abortConfig, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.document !== undefined && input.document !== null && { document: input.document }), + ...(input.documentSource !== undefined && + input.documentSource !== null && { documentSource: input.documentSource }), + ...(input.jobExecutionsRolloutConfig !== undefined && + input.jobExecutionsRolloutConfig !== null && { + jobExecutionsRolloutConfig: serializeAws_restJson1JobExecutionsRolloutConfig( + input.jobExecutionsRolloutConfig, + context + ), + }), + ...(input.namespaceId !== undefined && input.namespaceId !== null && { namespaceId: input.namespaceId }), + ...(input.presignedUrlConfig !== undefined && + input.presignedUrlConfig !== null && { + presignedUrlConfig: serializeAws_restJson1PresignedUrlConfig(input.presignedUrlConfig, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.targetSelection !== undefined && + input.targetSelection !== null && { targetSelection: input.targetSelection }), + ...(input.targets !== undefined && + input.targets !== null && { targets: serializeAws_restJson1JobTargets(input.targets, context) }), + ...(input.timeoutConfig !== undefined && + input.timeoutConfig !== null && { + timeoutConfig: serializeAws_restJson1TimeoutConfig(input.timeoutConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1603,9 +1616,7 @@ export const serializeAws_restJson1CreateKeysAndCertificateCommand = async ( input: CreateKeysAndCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/keys-and-certificate"; const query: any = { ...(input.setAsActive !== undefined && { setAsActive: input.setAsActive.toString() }), @@ -1629,7 +1640,7 @@ export const serializeAws_restJson1CreateMitigationActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/mitigationactions/actions/{actionName}"; if (input.actionName !== undefined) { @@ -1643,11 +1654,13 @@ export const serializeAws_restJson1CreateMitigationActionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.actionParams !== undefined && { - actionParams: serializeAws_restJson1MitigationActionParams(input.actionParams, context), - }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.actionParams !== undefined && + input.actionParams !== null && { + actionParams: serializeAws_restJson1MitigationActionParams(input.actionParams, context), + }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1666,7 +1679,7 @@ export const serializeAws_restJson1CreateOTAUpdateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/otaUpdates/{otaUpdateId}"; if (input.otaUpdateId !== undefined) { @@ -1680,31 +1693,44 @@ export const serializeAws_restJson1CreateOTAUpdateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.additionalParameters !== undefined && { - additionalParameters: serializeAws_restJson1AdditionalParameterMap(input.additionalParameters, context), - }), - ...(input.awsJobAbortConfig !== undefined && { - awsJobAbortConfig: serializeAws_restJson1AwsJobAbortConfig(input.awsJobAbortConfig, context), - }), - ...(input.awsJobExecutionsRolloutConfig !== undefined && { - awsJobExecutionsRolloutConfig: serializeAws_restJson1AwsJobExecutionsRolloutConfig( - input.awsJobExecutionsRolloutConfig, - context - ), - }), - ...(input.awsJobPresignedUrlConfig !== undefined && { - awsJobPresignedUrlConfig: serializeAws_restJson1AwsJobPresignedUrlConfig(input.awsJobPresignedUrlConfig, context), - }), - ...(input.awsJobTimeoutConfig !== undefined && { - awsJobTimeoutConfig: serializeAws_restJson1AwsJobTimeoutConfig(input.awsJobTimeoutConfig, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.files !== undefined && { files: serializeAws_restJson1OTAUpdateFiles(input.files, context) }), - ...(input.protocols !== undefined && { protocols: serializeAws_restJson1Protocols(input.protocols, context) }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.targetSelection !== undefined && { targetSelection: input.targetSelection }), - ...(input.targets !== undefined && { targets: serializeAws_restJson1Targets(input.targets, context) }), + ...(input.additionalParameters !== undefined && + input.additionalParameters !== null && { + additionalParameters: serializeAws_restJson1AdditionalParameterMap(input.additionalParameters, context), + }), + ...(input.awsJobAbortConfig !== undefined && + input.awsJobAbortConfig !== null && { + awsJobAbortConfig: serializeAws_restJson1AwsJobAbortConfig(input.awsJobAbortConfig, context), + }), + ...(input.awsJobExecutionsRolloutConfig !== undefined && + input.awsJobExecutionsRolloutConfig !== null && { + awsJobExecutionsRolloutConfig: serializeAws_restJson1AwsJobExecutionsRolloutConfig( + input.awsJobExecutionsRolloutConfig, + context + ), + }), + ...(input.awsJobPresignedUrlConfig !== undefined && + input.awsJobPresignedUrlConfig !== null && { + awsJobPresignedUrlConfig: serializeAws_restJson1AwsJobPresignedUrlConfig( + input.awsJobPresignedUrlConfig, + context + ), + }), + ...(input.awsJobTimeoutConfig !== undefined && + input.awsJobTimeoutConfig !== null && { + awsJobTimeoutConfig: serializeAws_restJson1AwsJobTimeoutConfig(input.awsJobTimeoutConfig, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.files !== undefined && + input.files !== null && { files: serializeAws_restJson1OTAUpdateFiles(input.files, context) }), + ...(input.protocols !== undefined && + input.protocols !== null && { protocols: serializeAws_restJson1Protocols(input.protocols, context) }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.targetSelection !== undefined && + input.targetSelection !== null && { targetSelection: input.targetSelection }), + ...(input.targets !== undefined && + input.targets !== null && { targets: serializeAws_restJson1Targets(input.targets, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1723,7 +1749,7 @@ export const serializeAws_restJson1CreatePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/policies/{policyName}"; if (input.policyName !== undefined) { @@ -1737,8 +1763,10 @@ export const serializeAws_restJson1CreatePolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.policyDocument !== undefined && { policyDocument: input.policyDocument }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.policyDocument !== undefined && + input.policyDocument !== null && { policyDocument: input.policyDocument }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1757,7 +1785,7 @@ export const serializeAws_restJson1CreatePolicyVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/policies/{policyName}/version"; if (input.policyName !== undefined) { @@ -1774,7 +1802,8 @@ export const serializeAws_restJson1CreatePolicyVersionCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.policyDocument !== undefined && { policyDocument: input.policyDocument }), + ...(input.policyDocument !== undefined && + input.policyDocument !== null && { policyDocument: input.policyDocument }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1793,9 +1822,7 @@ export const serializeAws_restJson1CreateProvisioningClaimCommand = async ( input: CreateProvisioningClaimCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/provisioning-templates/{templateName}/provisioning-claim"; if (input.templateName !== undefined) { const labelValue: string = input.templateName; @@ -1824,20 +1851,23 @@ export const serializeAws_restJson1CreateProvisioningTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/provisioning-templates"; let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.enabled !== undefined && { enabled: input.enabled }), - ...(input.preProvisioningHook !== undefined && { - preProvisioningHook: serializeAws_restJson1ProvisioningHook(input.preProvisioningHook, context), - }), - ...(input.provisioningRoleArn !== undefined && { provisioningRoleArn: input.provisioningRoleArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.templateBody !== undefined && { templateBody: input.templateBody }), - ...(input.templateName !== undefined && { templateName: input.templateName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), + ...(input.preProvisioningHook !== undefined && + input.preProvisioningHook !== null && { + preProvisioningHook: serializeAws_restJson1ProvisioningHook(input.preProvisioningHook, context), + }), + ...(input.provisioningRoleArn !== undefined && + input.provisioningRoleArn !== null && { provisioningRoleArn: input.provisioningRoleArn }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.templateBody !== undefined && input.templateBody !== null && { templateBody: input.templateBody }), + ...(input.templateName !== undefined && input.templateName !== null && { templateName: input.templateName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1856,7 +1886,7 @@ export const serializeAws_restJson1CreateProvisioningTemplateVersionCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/provisioning-templates/{templateName}/versions"; if (input.templateName !== undefined) { @@ -1873,7 +1903,7 @@ export const serializeAws_restJson1CreateProvisioningTemplateVersionCommand = as }; let body: any; body = JSON.stringify({ - ...(input.templateBody !== undefined && { templateBody: input.templateBody }), + ...(input.templateBody !== undefined && input.templateBody !== null && { templateBody: input.templateBody }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1893,7 +1923,7 @@ export const serializeAws_restJson1CreateRoleAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/role-aliases/{roleAlias}"; if (input.roleAlias !== undefined) { @@ -1907,11 +1937,11 @@ export const serializeAws_restJson1CreateRoleAliasCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.credentialDurationSeconds !== undefined && { - credentialDurationSeconds: input.credentialDurationSeconds, - }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.credentialDurationSeconds !== undefined && + input.credentialDurationSeconds !== null && { credentialDurationSeconds: input.credentialDurationSeconds }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1930,7 +1960,7 @@ export const serializeAws_restJson1CreateScheduledAuditCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/scheduledaudits/{scheduledAuditName}"; if (input.scheduledAuditName !== undefined) { @@ -1944,13 +1974,15 @@ export const serializeAws_restJson1CreateScheduledAuditCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.dayOfMonth !== undefined && { dayOfMonth: input.dayOfMonth }), - ...(input.dayOfWeek !== undefined && { dayOfWeek: input.dayOfWeek }), - ...(input.frequency !== undefined && { frequency: input.frequency }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.targetCheckNames !== undefined && { - targetCheckNames: serializeAws_restJson1TargetAuditCheckNames(input.targetCheckNames, context), - }), + ...(input.dayOfMonth !== undefined && input.dayOfMonth !== null && { dayOfMonth: input.dayOfMonth }), + ...(input.dayOfWeek !== undefined && input.dayOfWeek !== null && { dayOfWeek: input.dayOfWeek }), + ...(input.frequency !== undefined && input.frequency !== null && { frequency: input.frequency }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.targetCheckNames !== undefined && + input.targetCheckNames !== null && { + targetCheckNames: serializeAws_restJson1TargetAuditCheckNames(input.targetCheckNames, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1969,7 +2001,7 @@ export const serializeAws_restJson1CreateSecurityProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/security-profiles/{securityProfileName}"; if (input.securityProfileName !== undefined) { @@ -1983,26 +2015,28 @@ export const serializeAws_restJson1CreateSecurityProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.additionalMetricsToRetain !== undefined && { - additionalMetricsToRetain: serializeAws_restJson1AdditionalMetricsToRetainList( - input.additionalMetricsToRetain, - context - ), - }), - ...(input.additionalMetricsToRetainV2 !== undefined && { - additionalMetricsToRetainV2: serializeAws_restJson1AdditionalMetricsToRetainV2List( - input.additionalMetricsToRetainV2, - context - ), - }), - ...(input.alertTargets !== undefined && { - alertTargets: serializeAws_restJson1AlertTargets(input.alertTargets, context), - }), - ...(input.behaviors !== undefined && { behaviors: serializeAws_restJson1Behaviors(input.behaviors, context) }), - ...(input.securityProfileDescription !== undefined && { - securityProfileDescription: input.securityProfileDescription, - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.additionalMetricsToRetain !== undefined && + input.additionalMetricsToRetain !== null && { + additionalMetricsToRetain: serializeAws_restJson1AdditionalMetricsToRetainList( + input.additionalMetricsToRetain, + context + ), + }), + ...(input.additionalMetricsToRetainV2 !== undefined && + input.additionalMetricsToRetainV2 !== null && { + additionalMetricsToRetainV2: serializeAws_restJson1AdditionalMetricsToRetainV2List( + input.additionalMetricsToRetainV2, + context + ), + }), + ...(input.alertTargets !== undefined && + input.alertTargets !== null && { alertTargets: serializeAws_restJson1AlertTargets(input.alertTargets, context) }), + ...(input.behaviors !== undefined && + input.behaviors !== null && { behaviors: serializeAws_restJson1Behaviors(input.behaviors, context) }), + ...(input.securityProfileDescription !== undefined && + input.securityProfileDescription !== null && { securityProfileDescription: input.securityProfileDescription }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2021,7 +2055,7 @@ export const serializeAws_restJson1CreateStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/streams/{streamId}"; if (input.streamId !== undefined) { @@ -2035,10 +2069,12 @@ export const serializeAws_restJson1CreateStreamCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.files !== undefined && { files: serializeAws_restJson1StreamFiles(input.files, context) }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.files !== undefined && + input.files !== null && { files: serializeAws_restJson1StreamFiles(input.files, context) }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2057,7 +2093,7 @@ export const serializeAws_restJson1CreateThingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/things/{thingName}"; if (input.thingName !== undefined) { @@ -2071,11 +2107,13 @@ export const serializeAws_restJson1CreateThingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.attributePayload !== undefined && { - attributePayload: serializeAws_restJson1AttributePayload(input.attributePayload, context), - }), - ...(input.billingGroupName !== undefined && { billingGroupName: input.billingGroupName }), - ...(input.thingTypeName !== undefined && { thingTypeName: input.thingTypeName }), + ...(input.attributePayload !== undefined && + input.attributePayload !== null && { + attributePayload: serializeAws_restJson1AttributePayload(input.attributePayload, context), + }), + ...(input.billingGroupName !== undefined && + input.billingGroupName !== null && { billingGroupName: input.billingGroupName }), + ...(input.thingTypeName !== undefined && input.thingTypeName !== null && { thingTypeName: input.thingTypeName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2094,7 +2132,7 @@ export const serializeAws_restJson1CreateThingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/thing-groups/{thingGroupName}"; if (input.thingGroupName !== undefined) { @@ -2108,11 +2146,14 @@ export const serializeAws_restJson1CreateThingGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.parentGroupName !== undefined && { parentGroupName: input.parentGroupName }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.thingGroupProperties !== undefined && { - thingGroupProperties: serializeAws_restJson1ThingGroupProperties(input.thingGroupProperties, context), - }), + ...(input.parentGroupName !== undefined && + input.parentGroupName !== null && { parentGroupName: input.parentGroupName }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.thingGroupProperties !== undefined && + input.thingGroupProperties !== null && { + thingGroupProperties: serializeAws_restJson1ThingGroupProperties(input.thingGroupProperties, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2131,7 +2172,7 @@ export const serializeAws_restJson1CreateThingTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/thing-types/{thingTypeName}"; if (input.thingTypeName !== undefined) { @@ -2145,10 +2186,12 @@ export const serializeAws_restJson1CreateThingTypeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.thingTypeProperties !== undefined && { - thingTypeProperties: serializeAws_restJson1ThingTypeProperties(input.thingTypeProperties, context), - }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.thingTypeProperties !== undefined && + input.thingTypeProperties !== null && { + thingTypeProperties: serializeAws_restJson1ThingTypeProperties(input.thingTypeProperties, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2167,7 +2210,7 @@ export const serializeAws_restJson1CreateTopicRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.tags) && { "x-amz-tagging": input.tags! }), }; let resolvedPath = "/rules/{ruleName}"; @@ -2205,17 +2248,18 @@ export const serializeAws_restJson1CreateTopicRuleDestinationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/destinations"; let body: any; body = JSON.stringify({ - ...(input.destinationConfiguration !== undefined && { - destinationConfiguration: serializeAws_restJson1TopicRuleDestinationConfiguration( - input.destinationConfiguration, - context - ), - }), + ...(input.destinationConfiguration !== undefined && + input.destinationConfiguration !== null && { + destinationConfiguration: serializeAws_restJson1TopicRuleDestinationConfiguration( + input.destinationConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2233,9 +2277,7 @@ export const serializeAws_restJson1DeleteAccountAuditConfigurationCommand = asyn input: DeleteAccountAuditConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/configuration"; const query: any = { ...(input.deleteScheduledAudits !== undefined && { deleteScheduledAudits: input.deleteScheduledAudits.toString() }), @@ -2259,15 +2301,16 @@ export const serializeAws_restJson1DeleteAuditSuppressionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/suppressions/delete"; let body: any; body = JSON.stringify({ - ...(input.checkName !== undefined && { checkName: input.checkName }), - ...(input.resourceIdentifier !== undefined && { - resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), - }), + ...(input.checkName !== undefined && input.checkName !== null && { checkName: input.checkName }), + ...(input.resourceIdentifier !== undefined && + input.resourceIdentifier !== null && { + resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2285,9 +2328,7 @@ export const serializeAws_restJson1DeleteAuthorizerCommand = async ( input: DeleteAuthorizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/authorizer/{authorizerName}"; if (input.authorizerName !== undefined) { const labelValue: string = input.authorizerName; @@ -2315,9 +2356,7 @@ export const serializeAws_restJson1DeleteBillingGroupCommand = async ( input: DeleteBillingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/billing-groups/{billingGroupName}"; if (input.billingGroupName !== undefined) { const labelValue: string = input.billingGroupName; @@ -2349,9 +2388,7 @@ export const serializeAws_restJson1DeleteCACertificateCommand = async ( input: DeleteCACertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/cacertificate/{certificateId}"; if (input.certificateId !== undefined) { const labelValue: string = input.certificateId; @@ -2379,9 +2416,7 @@ export const serializeAws_restJson1DeleteCertificateCommand = async ( input: DeleteCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/certificates/{certificateId}"; if (input.certificateId !== undefined) { const labelValue: string = input.certificateId; @@ -2413,9 +2448,7 @@ export const serializeAws_restJson1DeleteDimensionCommand = async ( input: DeleteDimensionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dimensions/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -2443,9 +2476,7 @@ export const serializeAws_restJson1DeleteDomainConfigurationCommand = async ( input: DeleteDomainConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domainConfigurations/{domainConfigurationName}"; if (input.domainConfigurationName !== undefined) { const labelValue: string = input.domainConfigurationName; @@ -2473,9 +2504,7 @@ export const serializeAws_restJson1DeleteDynamicThingGroupCommand = async ( input: DeleteDynamicThingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dynamic-thing-groups/{thingGroupName}"; if (input.thingGroupName !== undefined) { const labelValue: string = input.thingGroupName; @@ -2507,9 +2536,7 @@ export const serializeAws_restJson1DeleteJobCommand = async ( input: DeleteJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{jobId}"; if (input.jobId !== undefined) { const labelValue: string = input.jobId; @@ -2542,9 +2569,7 @@ export const serializeAws_restJson1DeleteJobExecutionCommand = async ( input: DeleteJobExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}/jobs/{jobId}/executionNumber/{executionNumber}"; if (input.jobId !== undefined) { const labelValue: string = input.jobId; @@ -2595,9 +2620,7 @@ export const serializeAws_restJson1DeleteMitigationActionCommand = async ( input: DeleteMitigationActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/mitigationactions/actions/{actionName}"; if (input.actionName !== undefined) { const labelValue: string = input.actionName; @@ -2625,9 +2648,7 @@ export const serializeAws_restJson1DeleteOTAUpdateCommand = async ( input: DeleteOTAUpdateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/otaUpdates/{otaUpdateId}"; if (input.otaUpdateId !== undefined) { const labelValue: string = input.otaUpdateId; @@ -2660,9 +2681,7 @@ export const serializeAws_restJson1DeletePolicyCommand = async ( input: DeletePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies/{policyName}"; if (input.policyName !== undefined) { const labelValue: string = input.policyName; @@ -2690,9 +2709,7 @@ export const serializeAws_restJson1DeletePolicyVersionCommand = async ( input: DeletePolicyVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies/{policyName}/version/{policyVersionId}"; if (input.policyName !== undefined) { const labelValue: string = input.policyName; @@ -2729,9 +2746,7 @@ export const serializeAws_restJson1DeleteProvisioningTemplateCommand = async ( input: DeleteProvisioningTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/provisioning-templates/{templateName}"; if (input.templateName !== undefined) { const labelValue: string = input.templateName; @@ -2759,9 +2774,7 @@ export const serializeAws_restJson1DeleteProvisioningTemplateVersionCommand = as input: DeleteProvisioningTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/provisioning-templates/{templateName}/versions/{versionId}"; if (input.templateName !== undefined) { const labelValue: string = input.templateName; @@ -2798,12 +2811,10 @@ export const serializeAws_restJson1DeleteRegistrationCodeCommand = async ( input: DeleteRegistrationCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/registrationcode"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -2820,9 +2831,7 @@ export const serializeAws_restJson1DeleteRoleAliasCommand = async ( input: DeleteRoleAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/role-aliases/{roleAlias}"; if (input.roleAlias !== undefined) { const labelValue: string = input.roleAlias; @@ -2850,9 +2859,7 @@ export const serializeAws_restJson1DeleteScheduledAuditCommand = async ( input: DeleteScheduledAuditCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/scheduledaudits/{scheduledAuditName}"; if (input.scheduledAuditName !== undefined) { const labelValue: string = input.scheduledAuditName; @@ -2880,9 +2887,7 @@ export const serializeAws_restJson1DeleteSecurityProfileCommand = async ( input: DeleteSecurityProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/security-profiles/{securityProfileName}"; if (input.securityProfileName !== undefined) { const labelValue: string = input.securityProfileName; @@ -2914,9 +2919,7 @@ export const serializeAws_restJson1DeleteStreamCommand = async ( input: DeleteStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/streams/{streamId}"; if (input.streamId !== undefined) { const labelValue: string = input.streamId; @@ -2944,9 +2947,7 @@ export const serializeAws_restJson1DeleteThingCommand = async ( input: DeleteThingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}"; if (input.thingName !== undefined) { const labelValue: string = input.thingName; @@ -2978,9 +2979,7 @@ export const serializeAws_restJson1DeleteThingGroupCommand = async ( input: DeleteThingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-groups/{thingGroupName}"; if (input.thingGroupName !== undefined) { const labelValue: string = input.thingGroupName; @@ -3012,9 +3011,7 @@ export const serializeAws_restJson1DeleteThingTypeCommand = async ( input: DeleteThingTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-types/{thingTypeName}"; if (input.thingTypeName !== undefined) { const labelValue: string = input.thingTypeName; @@ -3042,9 +3039,7 @@ export const serializeAws_restJson1DeleteTopicRuleCommand = async ( input: DeleteTopicRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/rules/{ruleName}"; if (input.ruleName !== undefined) { const labelValue: string = input.ruleName; @@ -3072,9 +3067,7 @@ export const serializeAws_restJson1DeleteTopicRuleDestinationCommand = async ( input: DeleteTopicRuleDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/destinations/{arn+}"; if (input.arn !== undefined) { const labelValue: string = input.arn; @@ -3108,9 +3101,7 @@ export const serializeAws_restJson1DeleteV2LoggingLevelCommand = async ( input: DeleteV2LoggingLevelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2LoggingLevel"; const query: any = { ...(input.targetType !== undefined && { targetType: input.targetType }), @@ -3135,7 +3126,7 @@ export const serializeAws_restJson1DeprecateThingTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/thing-types/{thingTypeName}/deprecate"; if (input.thingTypeName !== undefined) { @@ -3149,7 +3140,7 @@ export const serializeAws_restJson1DeprecateThingTypeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.undoDeprecate !== undefined && { undoDeprecate: input.undoDeprecate }), + ...(input.undoDeprecate !== undefined && input.undoDeprecate !== null && { undoDeprecate: input.undoDeprecate }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3167,12 +3158,10 @@ export const serializeAws_restJson1DescribeAccountAuditConfigurationCommand = as input: DescribeAccountAuditConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/configuration"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -3189,9 +3178,7 @@ export const serializeAws_restJson1DescribeAuditFindingCommand = async ( input: DescribeAuditFindingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/findings/{findingId}"; if (input.findingId !== undefined) { const labelValue: string = input.findingId; @@ -3219,9 +3206,7 @@ export const serializeAws_restJson1DescribeAuditMitigationActionsTaskCommand = a input: DescribeAuditMitigationActionsTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/mitigationactions/tasks/{taskId}"; if (input.taskId !== undefined) { const labelValue: string = input.taskId; @@ -3250,15 +3235,16 @@ export const serializeAws_restJson1DescribeAuditSuppressionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/suppressions/describe"; let body: any; body = JSON.stringify({ - ...(input.checkName !== undefined && { checkName: input.checkName }), - ...(input.resourceIdentifier !== undefined && { - resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), - }), + ...(input.checkName !== undefined && input.checkName !== null && { checkName: input.checkName }), + ...(input.resourceIdentifier !== undefined && + input.resourceIdentifier !== null && { + resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3276,9 +3262,7 @@ export const serializeAws_restJson1DescribeAuditTaskCommand = async ( input: DescribeAuditTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/tasks/{taskId}"; if (input.taskId !== undefined) { const labelValue: string = input.taskId; @@ -3306,9 +3290,7 @@ export const serializeAws_restJson1DescribeAuthorizerCommand = async ( input: DescribeAuthorizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/authorizer/{authorizerName}"; if (input.authorizerName !== undefined) { const labelValue: string = input.authorizerName; @@ -3336,9 +3318,7 @@ export const serializeAws_restJson1DescribeBillingGroupCommand = async ( input: DescribeBillingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/billing-groups/{billingGroupName}"; if (input.billingGroupName !== undefined) { const labelValue: string = input.billingGroupName; @@ -3366,9 +3346,7 @@ export const serializeAws_restJson1DescribeCACertificateCommand = async ( input: DescribeCACertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/cacertificate/{certificateId}"; if (input.certificateId !== undefined) { const labelValue: string = input.certificateId; @@ -3396,9 +3374,7 @@ export const serializeAws_restJson1DescribeCertificateCommand = async ( input: DescribeCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/certificates/{certificateId}"; if (input.certificateId !== undefined) { const labelValue: string = input.certificateId; @@ -3426,12 +3402,10 @@ export const serializeAws_restJson1DescribeDefaultAuthorizerCommand = async ( input: DescribeDefaultAuthorizerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/default-authorizer"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -3448,9 +3422,7 @@ export const serializeAws_restJson1DescribeDimensionCommand = async ( input: DescribeDimensionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dimensions/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -3478,9 +3450,7 @@ export const serializeAws_restJson1DescribeDomainConfigurationCommand = async ( input: DescribeDomainConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domainConfigurations/{domainConfigurationName}"; if (input.domainConfigurationName !== undefined) { const labelValue: string = input.domainConfigurationName; @@ -3508,9 +3478,7 @@ export const serializeAws_restJson1DescribeEndpointCommand = async ( input: DescribeEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/endpoint"; const query: any = { ...(input.endpointType !== undefined && { endpointType: input.endpointType }), @@ -3533,12 +3501,10 @@ export const serializeAws_restJson1DescribeEventConfigurationsCommand = async ( input: DescribeEventConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/event-configurations"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -3555,9 +3521,7 @@ export const serializeAws_restJson1DescribeIndexCommand = async ( input: DescribeIndexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/indices/{indexName}"; if (input.indexName !== undefined) { const labelValue: string = input.indexName; @@ -3585,9 +3549,7 @@ export const serializeAws_restJson1DescribeJobCommand = async ( input: DescribeJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{jobId}"; if (input.jobId !== undefined) { const labelValue: string = input.jobId; @@ -3615,9 +3577,7 @@ export const serializeAws_restJson1DescribeJobExecutionCommand = async ( input: DescribeJobExecutionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}/jobs/{jobId}"; if (input.jobId !== undefined) { const labelValue: string = input.jobId; @@ -3658,9 +3618,7 @@ export const serializeAws_restJson1DescribeMitigationActionCommand = async ( input: DescribeMitigationActionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/mitigationactions/actions/{actionName}"; if (input.actionName !== undefined) { const labelValue: string = input.actionName; @@ -3688,9 +3646,7 @@ export const serializeAws_restJson1DescribeProvisioningTemplateCommand = async ( input: DescribeProvisioningTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/provisioning-templates/{templateName}"; if (input.templateName !== undefined) { const labelValue: string = input.templateName; @@ -3718,9 +3674,7 @@ export const serializeAws_restJson1DescribeProvisioningTemplateVersionCommand = input: DescribeProvisioningTemplateVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/provisioning-templates/{templateName}/versions/{versionId}"; if (input.templateName !== undefined) { const labelValue: string = input.templateName; @@ -3757,9 +3711,7 @@ export const serializeAws_restJson1DescribeRoleAliasCommand = async ( input: DescribeRoleAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/role-aliases/{roleAlias}"; if (input.roleAlias !== undefined) { const labelValue: string = input.roleAlias; @@ -3787,9 +3739,7 @@ export const serializeAws_restJson1DescribeScheduledAuditCommand = async ( input: DescribeScheduledAuditCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/scheduledaudits/{scheduledAuditName}"; if (input.scheduledAuditName !== undefined) { const labelValue: string = input.scheduledAuditName; @@ -3817,9 +3767,7 @@ export const serializeAws_restJson1DescribeSecurityProfileCommand = async ( input: DescribeSecurityProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/security-profiles/{securityProfileName}"; if (input.securityProfileName !== undefined) { const labelValue: string = input.securityProfileName; @@ -3847,9 +3795,7 @@ export const serializeAws_restJson1DescribeStreamCommand = async ( input: DescribeStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/streams/{streamId}"; if (input.streamId !== undefined) { const labelValue: string = input.streamId; @@ -3877,9 +3823,7 @@ export const serializeAws_restJson1DescribeThingCommand = async ( input: DescribeThingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}"; if (input.thingName !== undefined) { const labelValue: string = input.thingName; @@ -3907,9 +3851,7 @@ export const serializeAws_restJson1DescribeThingGroupCommand = async ( input: DescribeThingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-groups/{thingGroupName}"; if (input.thingGroupName !== undefined) { const labelValue: string = input.thingGroupName; @@ -3937,9 +3879,7 @@ export const serializeAws_restJson1DescribeThingRegistrationTaskCommand = async input: DescribeThingRegistrationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-registration-tasks/{taskId}"; if (input.taskId !== undefined) { const labelValue: string = input.taskId; @@ -3967,9 +3907,7 @@ export const serializeAws_restJson1DescribeThingTypeCommand = async ( input: DescribeThingTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-types/{thingTypeName}"; if (input.thingTypeName !== undefined) { const labelValue: string = input.thingTypeName; @@ -3998,7 +3936,7 @@ export const serializeAws_restJson1DetachPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/target-policies/{policyName}"; if (input.policyName !== undefined) { @@ -4012,7 +3950,7 @@ export const serializeAws_restJson1DetachPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.target !== undefined && { target: input.target }), + ...(input.target !== undefined && input.target !== null && { target: input.target }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4031,7 +3969,6 @@ export const serializeAws_restJson1DetachPrincipalPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.principal) && { "x-amzn-iot-principal": input.principal! }), }; let resolvedPath = "/principal-policies/{policyName}"; @@ -4061,9 +3998,7 @@ export const serializeAws_restJson1DetachSecurityProfileCommand = async ( input: DetachSecurityProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/security-profiles/{securityProfileName}/targets"; if (input.securityProfileName !== undefined) { const labelValue: string = input.securityProfileName; @@ -4096,7 +4031,6 @@ export const serializeAws_restJson1DetachThingPrincipalCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.principal) && { "x-amzn-principal": input.principal! }), }; let resolvedPath = "/things/{thingName}/principals"; @@ -4126,9 +4060,7 @@ export const serializeAws_restJson1DisableTopicRuleCommand = async ( input: DisableTopicRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/rules/{ruleName}/disable"; if (input.ruleName !== undefined) { const labelValue: string = input.ruleName; @@ -4156,9 +4088,7 @@ export const serializeAws_restJson1EnableTopicRuleCommand = async ( input: EnableTopicRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/rules/{ruleName}/enable"; if (input.ruleName !== undefined) { const labelValue: string = input.ruleName; @@ -4187,15 +4117,16 @@ export const serializeAws_restJson1GetCardinalityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/indices/cardinality"; let body: any; body = JSON.stringify({ - ...(input.aggregationField !== undefined && { aggregationField: input.aggregationField }), - ...(input.indexName !== undefined && { indexName: input.indexName }), - ...(input.queryString !== undefined && { queryString: input.queryString }), - ...(input.queryVersion !== undefined && { queryVersion: input.queryVersion }), + ...(input.aggregationField !== undefined && + input.aggregationField !== null && { aggregationField: input.aggregationField }), + ...(input.indexName !== undefined && input.indexName !== null && { indexName: input.indexName }), + ...(input.queryString !== undefined && input.queryString !== null && { queryString: input.queryString }), + ...(input.queryVersion !== undefined && input.queryVersion !== null && { queryVersion: input.queryVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4214,7 +4145,7 @@ export const serializeAws_restJson1GetEffectivePoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/effective-policies"; const query: any = { @@ -4222,8 +4153,9 @@ export const serializeAws_restJson1GetEffectivePoliciesCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.cognitoIdentityPoolId !== undefined && { cognitoIdentityPoolId: input.cognitoIdentityPoolId }), - ...(input.principal !== undefined && { principal: input.principal }), + ...(input.cognitoIdentityPoolId !== undefined && + input.cognitoIdentityPoolId !== null && { cognitoIdentityPoolId: input.cognitoIdentityPoolId }), + ...(input.principal !== undefined && input.principal !== null && { principal: input.principal }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4242,12 +4174,10 @@ export const serializeAws_restJson1GetIndexingConfigurationCommand = async ( input: GetIndexingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/indexing/config"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -4264,9 +4194,7 @@ export const serializeAws_restJson1GetJobDocumentCommand = async ( input: GetJobDocumentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{jobId}/job-document"; if (input.jobId !== undefined) { const labelValue: string = input.jobId; @@ -4294,12 +4222,10 @@ export const serializeAws_restJson1GetLoggingOptionsCommand = async ( input: GetLoggingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/loggingOptions"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -4316,9 +4242,7 @@ export const serializeAws_restJson1GetOTAUpdateCommand = async ( input: GetOTAUpdateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/otaUpdates/{otaUpdateId}"; if (input.otaUpdateId !== undefined) { const labelValue: string = input.otaUpdateId; @@ -4347,16 +4271,18 @@ export const serializeAws_restJson1GetPercentilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/indices/percentiles"; let body: any; body = JSON.stringify({ - ...(input.aggregationField !== undefined && { aggregationField: input.aggregationField }), - ...(input.indexName !== undefined && { indexName: input.indexName }), - ...(input.percents !== undefined && { percents: serializeAws_restJson1PercentList(input.percents, context) }), - ...(input.queryString !== undefined && { queryString: input.queryString }), - ...(input.queryVersion !== undefined && { queryVersion: input.queryVersion }), + ...(input.aggregationField !== undefined && + input.aggregationField !== null && { aggregationField: input.aggregationField }), + ...(input.indexName !== undefined && input.indexName !== null && { indexName: input.indexName }), + ...(input.percents !== undefined && + input.percents !== null && { percents: serializeAws_restJson1PercentList(input.percents, context) }), + ...(input.queryString !== undefined && input.queryString !== null && { queryString: input.queryString }), + ...(input.queryVersion !== undefined && input.queryVersion !== null && { queryVersion: input.queryVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4374,9 +4300,7 @@ export const serializeAws_restJson1GetPolicyCommand = async ( input: GetPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies/{policyName}"; if (input.policyName !== undefined) { const labelValue: string = input.policyName; @@ -4404,9 +4328,7 @@ export const serializeAws_restJson1GetPolicyVersionCommand = async ( input: GetPolicyVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies/{policyName}/version/{policyVersionId}"; if (input.policyName !== undefined) { const labelValue: string = input.policyName; @@ -4443,12 +4365,10 @@ export const serializeAws_restJson1GetRegistrationCodeCommand = async ( input: GetRegistrationCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/registrationcode"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -4466,15 +4386,16 @@ export const serializeAws_restJson1GetStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/indices/statistics"; let body: any; body = JSON.stringify({ - ...(input.aggregationField !== undefined && { aggregationField: input.aggregationField }), - ...(input.indexName !== undefined && { indexName: input.indexName }), - ...(input.queryString !== undefined && { queryString: input.queryString }), - ...(input.queryVersion !== undefined && { queryVersion: input.queryVersion }), + ...(input.aggregationField !== undefined && + input.aggregationField !== null && { aggregationField: input.aggregationField }), + ...(input.indexName !== undefined && input.indexName !== null && { indexName: input.indexName }), + ...(input.queryString !== undefined && input.queryString !== null && { queryString: input.queryString }), + ...(input.queryVersion !== undefined && input.queryVersion !== null && { queryVersion: input.queryVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4492,9 +4413,7 @@ export const serializeAws_restJson1GetTopicRuleCommand = async ( input: GetTopicRuleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/rules/{ruleName}"; if (input.ruleName !== undefined) { const labelValue: string = input.ruleName; @@ -4522,9 +4441,7 @@ export const serializeAws_restJson1GetTopicRuleDestinationCommand = async ( input: GetTopicRuleDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/destinations/{arn+}"; if (input.arn !== undefined) { const labelValue: string = input.arn; @@ -4558,12 +4475,10 @@ export const serializeAws_restJson1GetV2LoggingOptionsCommand = async ( input: GetV2LoggingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2LoggingOptions"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -4580,9 +4495,7 @@ export const serializeAws_restJson1ListActiveViolationsCommand = async ( input: ListActiveViolationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/active-violations"; const query: any = { ...(input.thingName !== undefined && { thingName: input.thingName }), @@ -4608,9 +4521,7 @@ export const serializeAws_restJson1ListAttachedPoliciesCommand = async ( input: ListAttachedPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/attached-policies/{target}"; if (input.target !== undefined) { const labelValue: string = input.target; @@ -4645,21 +4556,25 @@ export const serializeAws_restJson1ListAuditFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/findings"; let body: any; body = JSON.stringify({ - ...(input.checkName !== undefined && { checkName: input.checkName }), - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.listSuppressedFindings !== undefined && { listSuppressedFindings: input.listSuppressedFindings }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceIdentifier !== undefined && { - resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), - }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.taskId !== undefined && { taskId: input.taskId }), + ...(input.checkName !== undefined && input.checkName !== null && { checkName: input.checkName }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.listSuppressedFindings !== undefined && + input.listSuppressedFindings !== null && { listSuppressedFindings: input.listSuppressedFindings }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceIdentifier !== undefined && + input.resourceIdentifier !== null && { + resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), + }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.taskId !== undefined && input.taskId !== null && { taskId: input.taskId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4677,9 +4592,7 @@ export const serializeAws_restJson1ListAuditMitigationActionsExecutionsCommand = input: ListAuditMitigationActionsExecutionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/mitigationactions/executions"; const query: any = { ...(input.taskId !== undefined && { taskId: input.taskId }), @@ -4706,9 +4619,7 @@ export const serializeAws_restJson1ListAuditMitigationActionsTasksCommand = asyn input: ListAuditMitigationActionsTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/mitigationactions/tasks"; const query: any = { ...(input.auditTaskId !== undefined && { auditTaskId: input.auditTaskId }), @@ -4738,18 +4649,20 @@ export const serializeAws_restJson1ListAuditSuppressionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/suppressions/list"; let body: any; body = JSON.stringify({ - ...(input.ascendingOrder !== undefined && { ascendingOrder: input.ascendingOrder }), - ...(input.checkName !== undefined && { checkName: input.checkName }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceIdentifier !== undefined && { - resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), - }), + ...(input.ascendingOrder !== undefined && + input.ascendingOrder !== null && { ascendingOrder: input.ascendingOrder }), + ...(input.checkName !== undefined && input.checkName !== null && { checkName: input.checkName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceIdentifier !== undefined && + input.resourceIdentifier !== null && { + resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4767,9 +4680,7 @@ export const serializeAws_restJson1ListAuditTasksCommand = async ( input: ListAuditTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/tasks"; const query: any = { ...(input.startTime !== undefined && { startTime: (input.startTime.toISOString().split(".")[0] + "Z").toString() }), @@ -4797,9 +4708,7 @@ export const serializeAws_restJson1ListAuthorizersCommand = async ( input: ListAuthorizersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/authorizers"; const query: any = { ...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }), @@ -4825,9 +4734,7 @@ export const serializeAws_restJson1ListBillingGroupsCommand = async ( input: ListBillingGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/billing-groups"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -4852,9 +4759,7 @@ export const serializeAws_restJson1ListCACertificatesCommand = async ( input: ListCACertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/cacertificates"; const query: any = { ...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }), @@ -4879,9 +4784,7 @@ export const serializeAws_restJson1ListCertificatesCommand = async ( input: ListCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/certificates"; const query: any = { ...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }), @@ -4906,9 +4809,7 @@ export const serializeAws_restJson1ListCertificatesByCACommand = async ( input: ListCertificatesByCACommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/certificates-by-ca/{caCertificateId}"; if (input.caCertificateId !== undefined) { const labelValue: string = input.caCertificateId; @@ -4942,9 +4843,7 @@ export const serializeAws_restJson1ListDimensionsCommand = async ( input: ListDimensionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dimensions"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -4968,9 +4867,7 @@ export const serializeAws_restJson1ListDomainConfigurationsCommand = async ( input: ListDomainConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/domainConfigurations"; const query: any = { ...(input.marker !== undefined && { marker: input.marker }), @@ -4995,9 +4892,7 @@ export const serializeAws_restJson1ListIndicesCommand = async ( input: ListIndicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/indices"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -5021,9 +4916,7 @@ export const serializeAws_restJson1ListJobExecutionsForJobCommand = async ( input: ListJobExecutionsForJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{jobId}/things"; if (input.jobId !== undefined) { const labelValue: string = input.jobId; @@ -5057,9 +4950,7 @@ export const serializeAws_restJson1ListJobExecutionsForThingCommand = async ( input: ListJobExecutionsForThingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}/jobs"; if (input.thingName !== undefined) { const labelValue: string = input.thingName; @@ -5094,9 +4985,7 @@ export const serializeAws_restJson1ListJobsCommand = async ( input: ListJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs"; const query: any = { ...(input.status !== undefined && { status: input.status }), @@ -5125,9 +5014,7 @@ export const serializeAws_restJson1ListMitigationActionsCommand = async ( input: ListMitigationActionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/mitigationactions/actions"; const query: any = { ...(input.actionType !== undefined && { actionType: input.actionType }), @@ -5152,9 +5039,7 @@ export const serializeAws_restJson1ListOTAUpdatesCommand = async ( input: ListOTAUpdatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/otaUpdates"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -5179,9 +5064,7 @@ export const serializeAws_restJson1ListOutgoingCertificatesCommand = async ( input: ListOutgoingCertificatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/certificates-out-going"; const query: any = { ...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }), @@ -5206,9 +5089,7 @@ export const serializeAws_restJson1ListPoliciesCommand = async ( input: ListPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies"; const query: any = { ...(input.marker !== undefined && { marker: input.marker }), @@ -5234,7 +5115,6 @@ export const serializeAws_restJson1ListPolicyPrincipalsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.policyName) && { "x-amzn-iot-policy": input.policyName! }), }; let resolvedPath = "/policy-principals"; @@ -5261,9 +5141,7 @@ export const serializeAws_restJson1ListPolicyVersionsCommand = async ( input: ListPolicyVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies/{policyName}/version"; if (input.policyName !== undefined) { const labelValue: string = input.policyName; @@ -5292,7 +5170,6 @@ export const serializeAws_restJson1ListPrincipalPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.principal) && { "x-amzn-iot-principal": input.principal! }), }; let resolvedPath = "/principal-policies"; @@ -5320,7 +5197,6 @@ export const serializeAws_restJson1ListPrincipalThingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.principal) && { "x-amzn-principal": input.principal! }), }; let resolvedPath = "/principals/things"; @@ -5346,9 +5222,7 @@ export const serializeAws_restJson1ListProvisioningTemplatesCommand = async ( input: ListProvisioningTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/provisioning-templates"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -5372,9 +5246,7 @@ export const serializeAws_restJson1ListProvisioningTemplateVersionsCommand = asy input: ListProvisioningTemplateVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/provisioning-templates/{templateName}/versions"; if (input.templateName !== undefined) { const labelValue: string = input.templateName; @@ -5407,9 +5279,7 @@ export const serializeAws_restJson1ListRoleAliasesCommand = async ( input: ListRoleAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/role-aliases"; const query: any = { ...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }), @@ -5434,9 +5304,7 @@ export const serializeAws_restJson1ListScheduledAuditsCommand = async ( input: ListScheduledAuditsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/audit/scheduledaudits"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -5460,9 +5328,7 @@ export const serializeAws_restJson1ListSecurityProfilesCommand = async ( input: ListSecurityProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/security-profiles"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -5487,9 +5353,7 @@ export const serializeAws_restJson1ListSecurityProfilesForTargetCommand = async input: ListSecurityProfilesForTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/security-profiles-for-target"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -5515,9 +5379,7 @@ export const serializeAws_restJson1ListStreamsCommand = async ( input: ListStreamsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/streams"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -5542,9 +5404,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags"; const query: any = { ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), @@ -5568,9 +5428,7 @@ export const serializeAws_restJson1ListTargetsForPolicyCommand = async ( input: ListTargetsForPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policy-targets/{policyName}"; if (input.policyName !== undefined) { const labelValue: string = input.policyName; @@ -5603,9 +5461,7 @@ export const serializeAws_restJson1ListTargetsForSecurityProfileCommand = async input: ListTargetsForSecurityProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/security-profiles/{securityProfileName}/targets"; if (input.securityProfileName !== undefined) { const labelValue: string = input.securityProfileName; @@ -5638,9 +5494,7 @@ export const serializeAws_restJson1ListThingGroupsCommand = async ( input: ListThingGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-groups"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -5667,9 +5521,7 @@ export const serializeAws_restJson1ListThingGroupsForThingCommand = async ( input: ListThingGroupsForThingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}/thing-groups"; if (input.thingName !== undefined) { const labelValue: string = input.thingName; @@ -5702,9 +5554,7 @@ export const serializeAws_restJson1ListThingPrincipalsCommand = async ( input: ListThingPrincipalsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things/{thingName}/principals"; if (input.thingName !== undefined) { const labelValue: string = input.thingName; @@ -5737,9 +5587,7 @@ export const serializeAws_restJson1ListThingRegistrationTaskReportsCommand = asy input: ListThingRegistrationTaskReportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-registration-tasks/{taskId}/reports"; if (input.taskId !== undefined) { const labelValue: string = input.taskId; @@ -5773,9 +5621,7 @@ export const serializeAws_restJson1ListThingRegistrationTasksCommand = async ( input: ListThingRegistrationTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-registration-tasks"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -5800,9 +5646,7 @@ export const serializeAws_restJson1ListThingsCommand = async ( input: ListThingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/things"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -5829,9 +5673,7 @@ export const serializeAws_restJson1ListThingsInBillingGroupCommand = async ( input: ListThingsInBillingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/billing-groups/{billingGroupName}/things"; if (input.billingGroupName !== undefined) { const labelValue: string = input.billingGroupName; @@ -5864,9 +5706,7 @@ export const serializeAws_restJson1ListThingsInThingGroupCommand = async ( input: ListThingsInThingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-groups/{thingGroupName}/things"; if (input.thingGroupName !== undefined) { const labelValue: string = input.thingGroupName; @@ -5900,9 +5740,7 @@ export const serializeAws_restJson1ListThingTypesCommand = async ( input: ListThingTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-types"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -5927,9 +5765,7 @@ export const serializeAws_restJson1ListTopicRuleDestinationsCommand = async ( input: ListTopicRuleDestinationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/destinations"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -5953,9 +5789,7 @@ export const serializeAws_restJson1ListTopicRulesCommand = async ( input: ListTopicRulesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/rules"; const query: any = { ...(input.topic !== undefined && { topic: input.topic }), @@ -5981,9 +5815,7 @@ export const serializeAws_restJson1ListV2LoggingLevelsCommand = async ( input: ListV2LoggingLevelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2LoggingLevel"; const query: any = { ...(input.targetType !== undefined && { targetType: input.targetType }), @@ -6008,9 +5840,7 @@ export const serializeAws_restJson1ListViolationEventsCommand = async ( input: ListViolationEventsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/violation-events"; const query: any = { ...(input.startTime !== undefined && { startTime: (input.startTime.toISOString().split(".")[0] + "Z").toString() }), @@ -6039,7 +5869,7 @@ export const serializeAws_restJson1RegisterCACertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/cacertificate"; const query: any = { @@ -6048,12 +5878,15 @@ export const serializeAws_restJson1RegisterCACertificateCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.caCertificate !== undefined && { caCertificate: input.caCertificate }), - ...(input.registrationConfig !== undefined && { - registrationConfig: serializeAws_restJson1RegistrationConfig(input.registrationConfig, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.verificationCertificate !== undefined && { verificationCertificate: input.verificationCertificate }), + ...(input.caCertificate !== undefined && input.caCertificate !== null && { caCertificate: input.caCertificate }), + ...(input.registrationConfig !== undefined && + input.registrationConfig !== null && { + registrationConfig: serializeAws_restJson1RegistrationConfig(input.registrationConfig, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.verificationCertificate !== undefined && + input.verificationCertificate !== null && { verificationCertificate: input.verificationCertificate }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6073,7 +5906,7 @@ export const serializeAws_restJson1RegisterCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/certificate/register"; const query: any = { @@ -6081,9 +5914,11 @@ export const serializeAws_restJson1RegisterCertificateCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.caCertificatePem !== undefined && { caCertificatePem: input.caCertificatePem }), - ...(input.certificatePem !== undefined && { certificatePem: input.certificatePem }), - ...(input.status !== undefined && { status: input.status }), + ...(input.caCertificatePem !== undefined && + input.caCertificatePem !== null && { caCertificatePem: input.caCertificatePem }), + ...(input.certificatePem !== undefined && + input.certificatePem !== null && { certificatePem: input.certificatePem }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6103,13 +5938,14 @@ export const serializeAws_restJson1RegisterCertificateWithoutCACommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/certificate/register-no-ca"; let body: any; body = JSON.stringify({ - ...(input.certificatePem !== undefined && { certificatePem: input.certificatePem }), - ...(input.status !== undefined && { status: input.status }), + ...(input.certificatePem !== undefined && + input.certificatePem !== null && { certificatePem: input.certificatePem }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6128,13 +5964,14 @@ export const serializeAws_restJson1RegisterThingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/things"; let body: any; body = JSON.stringify({ - ...(input.parameters !== undefined && { parameters: serializeAws_restJson1Parameters(input.parameters, context) }), - ...(input.templateBody !== undefined && { templateBody: input.templateBody }), + ...(input.parameters !== undefined && + input.parameters !== null && { parameters: serializeAws_restJson1Parameters(input.parameters, context) }), + ...(input.templateBody !== undefined && input.templateBody !== null && { templateBody: input.templateBody }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6153,7 +5990,7 @@ export const serializeAws_restJson1RejectCertificateTransferCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/reject-certificate-transfer/{certificateId}"; if (input.certificateId !== undefined) { @@ -6167,7 +6004,7 @@ export const serializeAws_restJson1RejectCertificateTransferCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.rejectReason !== undefined && { rejectReason: input.rejectReason }), + ...(input.rejectReason !== undefined && input.rejectReason !== null && { rejectReason: input.rejectReason }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6186,15 +6023,17 @@ export const serializeAws_restJson1RemoveThingFromBillingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/billing-groups/removeThingFromBillingGroup"; let body: any; body = JSON.stringify({ - ...(input.billingGroupArn !== undefined && { billingGroupArn: input.billingGroupArn }), - ...(input.billingGroupName !== undefined && { billingGroupName: input.billingGroupName }), - ...(input.thingArn !== undefined && { thingArn: input.thingArn }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.billingGroupArn !== undefined && + input.billingGroupArn !== null && { billingGroupArn: input.billingGroupArn }), + ...(input.billingGroupName !== undefined && + input.billingGroupName !== null && { billingGroupName: input.billingGroupName }), + ...(input.thingArn !== undefined && input.thingArn !== null && { thingArn: input.thingArn }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6213,15 +6052,16 @@ export const serializeAws_restJson1RemoveThingFromThingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/thing-groups/removeThingFromThingGroup"; let body: any; body = JSON.stringify({ - ...(input.thingArn !== undefined && { thingArn: input.thingArn }), - ...(input.thingGroupArn !== undefined && { thingGroupArn: input.thingGroupArn }), - ...(input.thingGroupName !== undefined && { thingGroupName: input.thingGroupName }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.thingArn !== undefined && input.thingArn !== null && { thingArn: input.thingArn }), + ...(input.thingGroupArn !== undefined && input.thingGroupArn !== null && { thingGroupArn: input.thingGroupArn }), + ...(input.thingGroupName !== undefined && + input.thingGroupName !== null && { thingGroupName: input.thingGroupName }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6240,7 +6080,7 @@ export const serializeAws_restJson1ReplaceTopicRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/rules/{ruleName}"; if (input.ruleName !== undefined) { @@ -6277,16 +6117,16 @@ export const serializeAws_restJson1SearchIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/indices/search"; let body: any; body = JSON.stringify({ - ...(input.indexName !== undefined && { indexName: input.indexName }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.queryString !== undefined && { queryString: input.queryString }), - ...(input.queryVersion !== undefined && { queryVersion: input.queryVersion }), + ...(input.indexName !== undefined && input.indexName !== null && { indexName: input.indexName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.queryString !== undefined && input.queryString !== null && { queryString: input.queryString }), + ...(input.queryVersion !== undefined && input.queryVersion !== null && { queryVersion: input.queryVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6305,12 +6145,13 @@ export const serializeAws_restJson1SetDefaultAuthorizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/default-authorizer"; let body: any; body = JSON.stringify({ - ...(input.authorizerName !== undefined && { authorizerName: input.authorizerName }), + ...(input.authorizerName !== undefined && + input.authorizerName !== null && { authorizerName: input.authorizerName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6328,9 +6169,7 @@ export const serializeAws_restJson1SetDefaultPolicyVersionCommand = async ( input: SetDefaultPolicyVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/policies/{policyName}/version/{policyVersionId}"; if (input.policyName !== undefined) { const labelValue: string = input.policyName; @@ -6368,7 +6207,7 @@ export const serializeAws_restJson1SetLoggingOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/loggingOptions"; let body: any; @@ -6396,13 +6235,14 @@ export const serializeAws_restJson1SetV2LoggingLevelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2LoggingLevel"; let body: any; body = JSON.stringify({ - ...(input.logLevel !== undefined && { logLevel: input.logLevel }), - ...(input.logTarget !== undefined && { logTarget: serializeAws_restJson1LogTarget(input.logTarget, context) }), + ...(input.logLevel !== undefined && input.logLevel !== null && { logLevel: input.logLevel }), + ...(input.logTarget !== undefined && + input.logTarget !== null && { logTarget: serializeAws_restJson1LogTarget(input.logTarget, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6421,14 +6261,16 @@ export const serializeAws_restJson1SetV2LoggingOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2LoggingOptions"; let body: any; body = JSON.stringify({ - ...(input.defaultLogLevel !== undefined && { defaultLogLevel: input.defaultLogLevel }), - ...(input.disableAllLogs !== undefined && { disableAllLogs: input.disableAllLogs }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.defaultLogLevel !== undefined && + input.defaultLogLevel !== null && { defaultLogLevel: input.defaultLogLevel }), + ...(input.disableAllLogs !== undefined && + input.disableAllLogs !== null && { disableAllLogs: input.disableAllLogs }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6447,7 +6289,7 @@ export const serializeAws_restJson1StartAuditMitigationActionsTaskCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/mitigationactions/tasks/{taskId}"; if (input.taskId !== undefined) { @@ -6461,16 +6303,18 @@ export const serializeAws_restJson1StartAuditMitigationActionsTaskCommand = asyn } let body: any; body = JSON.stringify({ - ...(input.auditCheckToActionsMapping !== undefined && { - auditCheckToActionsMapping: serializeAws_restJson1AuditCheckToActionsMapping( - input.auditCheckToActionsMapping, - context - ), - }), + ...(input.auditCheckToActionsMapping !== undefined && + input.auditCheckToActionsMapping !== null && { + auditCheckToActionsMapping: serializeAws_restJson1AuditCheckToActionsMapping( + input.auditCheckToActionsMapping, + context + ), + }), clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.target !== undefined && { - target: serializeAws_restJson1AuditMitigationActionsTaskTarget(input.target, context), - }), + ...(input.target !== undefined && + input.target !== null && { + target: serializeAws_restJson1AuditMitigationActionsTaskTarget(input.target, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6489,14 +6333,15 @@ export const serializeAws_restJson1StartOnDemandAuditTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/tasks"; let body: any; body = JSON.stringify({ - ...(input.targetCheckNames !== undefined && { - targetCheckNames: serializeAws_restJson1TargetAuditCheckNames(input.targetCheckNames, context), - }), + ...(input.targetCheckNames !== undefined && + input.targetCheckNames !== null && { + targetCheckNames: serializeAws_restJson1TargetAuditCheckNames(input.targetCheckNames, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6515,15 +6360,16 @@ export const serializeAws_restJson1StartThingRegistrationTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/thing-registration-tasks"; let body: any; body = JSON.stringify({ - ...(input.inputFileBucket !== undefined && { inputFileBucket: input.inputFileBucket }), - ...(input.inputFileKey !== undefined && { inputFileKey: input.inputFileKey }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.templateBody !== undefined && { templateBody: input.templateBody }), + ...(input.inputFileBucket !== undefined && + input.inputFileBucket !== null && { inputFileBucket: input.inputFileBucket }), + ...(input.inputFileKey !== undefined && input.inputFileKey !== null && { inputFileKey: input.inputFileKey }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.templateBody !== undefined && input.templateBody !== null && { templateBody: input.templateBody }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6541,9 +6387,7 @@ export const serializeAws_restJson1StopThingRegistrationTaskCommand = async ( input: StopThingRegistrationTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/thing-registration-tasks/{taskId}/cancel"; if (input.taskId !== undefined) { const labelValue: string = input.taskId; @@ -6572,13 +6416,14 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags"; let body: any; body = JSON.stringify({ - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6597,7 +6442,7 @@ export const serializeAws_restJson1TestAuthorizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/test-authorization"; const query: any = { @@ -6605,15 +6450,19 @@ export const serializeAws_restJson1TestAuthorizationCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.authInfos !== undefined && { authInfos: serializeAws_restJson1AuthInfos(input.authInfos, context) }), - ...(input.cognitoIdentityPoolId !== undefined && { cognitoIdentityPoolId: input.cognitoIdentityPoolId }), - ...(input.policyNamesToAdd !== undefined && { - policyNamesToAdd: serializeAws_restJson1PolicyNames(input.policyNamesToAdd, context), - }), - ...(input.policyNamesToSkip !== undefined && { - policyNamesToSkip: serializeAws_restJson1PolicyNames(input.policyNamesToSkip, context), - }), - ...(input.principal !== undefined && { principal: input.principal }), + ...(input.authInfos !== undefined && + input.authInfos !== null && { authInfos: serializeAws_restJson1AuthInfos(input.authInfos, context) }), + ...(input.cognitoIdentityPoolId !== undefined && + input.cognitoIdentityPoolId !== null && { cognitoIdentityPoolId: input.cognitoIdentityPoolId }), + ...(input.policyNamesToAdd !== undefined && + input.policyNamesToAdd !== null && { + policyNamesToAdd: serializeAws_restJson1PolicyNames(input.policyNamesToAdd, context), + }), + ...(input.policyNamesToSkip !== undefined && + input.policyNamesToSkip !== null && { + policyNamesToSkip: serializeAws_restJson1PolicyNames(input.policyNamesToSkip, context), + }), + ...(input.principal !== undefined && input.principal !== null && { principal: input.principal }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6633,7 +6482,7 @@ export const serializeAws_restJson1TestInvokeAuthorizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/authorizer/{authorizerName}/test"; if (input.authorizerName !== undefined) { @@ -6647,15 +6496,15 @@ export const serializeAws_restJson1TestInvokeAuthorizerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.httpContext !== undefined && { - httpContext: serializeAws_restJson1HttpContext(input.httpContext, context), - }), - ...(input.mqttContext !== undefined && { - mqttContext: serializeAws_restJson1MqttContext(input.mqttContext, context), - }), - ...(input.tlsContext !== undefined && { tlsContext: serializeAws_restJson1TlsContext(input.tlsContext, context) }), - ...(input.token !== undefined && { token: input.token }), - ...(input.tokenSignature !== undefined && { tokenSignature: input.tokenSignature }), + ...(input.httpContext !== undefined && + input.httpContext !== null && { httpContext: serializeAws_restJson1HttpContext(input.httpContext, context) }), + ...(input.mqttContext !== undefined && + input.mqttContext !== null && { mqttContext: serializeAws_restJson1MqttContext(input.mqttContext, context) }), + ...(input.tlsContext !== undefined && + input.tlsContext !== null && { tlsContext: serializeAws_restJson1TlsContext(input.tlsContext, context) }), + ...(input.token !== undefined && input.token !== null && { token: input.token }), + ...(input.tokenSignature !== undefined && + input.tokenSignature !== null && { tokenSignature: input.tokenSignature }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6674,7 +6523,7 @@ export const serializeAws_restJson1TransferCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/transfer-certificate/{certificateId}"; if (input.certificateId !== undefined) { @@ -6691,7 +6540,8 @@ export const serializeAws_restJson1TransferCertificateCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.transferMessage !== undefined && { transferMessage: input.transferMessage }), + ...(input.transferMessage !== undefined && + input.transferMessage !== null && { transferMessage: input.transferMessage }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6711,13 +6561,14 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/untag"; let body: any; body = JSON.stringify({ - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6736,21 +6587,26 @@ export const serializeAws_restJson1UpdateAccountAuditConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/configuration"; let body: any; body = JSON.stringify({ - ...(input.auditCheckConfigurations !== undefined && { - auditCheckConfigurations: serializeAws_restJson1AuditCheckConfigurations(input.auditCheckConfigurations, context), - }), - ...(input.auditNotificationTargetConfigurations !== undefined && { - auditNotificationTargetConfigurations: serializeAws_restJson1AuditNotificationTargetConfigurations( - input.auditNotificationTargetConfigurations, - context - ), - }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.auditCheckConfigurations !== undefined && + input.auditCheckConfigurations !== null && { + auditCheckConfigurations: serializeAws_restJson1AuditCheckConfigurations( + input.auditCheckConfigurations, + context + ), + }), + ...(input.auditNotificationTargetConfigurations !== undefined && + input.auditNotificationTargetConfigurations !== null && { + auditNotificationTargetConfigurations: serializeAws_restJson1AuditNotificationTargetConfigurations( + input.auditNotificationTargetConfigurations, + context + ), + }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6769,18 +6625,21 @@ export const serializeAws_restJson1UpdateAuditSuppressionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/suppressions/update"; let body: any; body = JSON.stringify({ - ...(input.checkName !== undefined && { checkName: input.checkName }), - ...(input.description !== undefined && { description: input.description }), - ...(input.expirationDate !== undefined && { expirationDate: Math.round(input.expirationDate.getTime() / 1000) }), - ...(input.resourceIdentifier !== undefined && { - resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), - }), - ...(input.suppressIndefinitely !== undefined && { suppressIndefinitely: input.suppressIndefinitely }), + ...(input.checkName !== undefined && input.checkName !== null && { checkName: input.checkName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.expirationDate !== undefined && + input.expirationDate !== null && { expirationDate: Math.round(input.expirationDate.getTime() / 1000) }), + ...(input.resourceIdentifier !== undefined && + input.resourceIdentifier !== null && { + resourceIdentifier: serializeAws_restJson1ResourceIdentifier(input.resourceIdentifier, context), + }), + ...(input.suppressIndefinitely !== undefined && + input.suppressIndefinitely !== null && { suppressIndefinitely: input.suppressIndefinitely }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6799,7 +6658,7 @@ export const serializeAws_restJson1UpdateAuthorizerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/authorizer/{authorizerName}"; if (input.authorizerName !== undefined) { @@ -6813,12 +6672,14 @@ export const serializeAws_restJson1UpdateAuthorizerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.authorizerFunctionArn !== undefined && { authorizerFunctionArn: input.authorizerFunctionArn }), - ...(input.status !== undefined && { status: input.status }), - ...(input.tokenKeyName !== undefined && { tokenKeyName: input.tokenKeyName }), - ...(input.tokenSigningPublicKeys !== undefined && { - tokenSigningPublicKeys: serializeAws_restJson1PublicKeyMap(input.tokenSigningPublicKeys, context), - }), + ...(input.authorizerFunctionArn !== undefined && + input.authorizerFunctionArn !== null && { authorizerFunctionArn: input.authorizerFunctionArn }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.tokenKeyName !== undefined && input.tokenKeyName !== null && { tokenKeyName: input.tokenKeyName }), + ...(input.tokenSigningPublicKeys !== undefined && + input.tokenSigningPublicKeys !== null && { + tokenSigningPublicKeys: serializeAws_restJson1PublicKeyMap(input.tokenSigningPublicKeys, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6837,7 +6698,7 @@ export const serializeAws_restJson1UpdateBillingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/billing-groups/{billingGroupName}"; if (input.billingGroupName !== undefined) { @@ -6851,10 +6712,12 @@ export const serializeAws_restJson1UpdateBillingGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.billingGroupProperties !== undefined && { - billingGroupProperties: serializeAws_restJson1BillingGroupProperties(input.billingGroupProperties, context), - }), - ...(input.expectedVersion !== undefined && { expectedVersion: input.expectedVersion }), + ...(input.billingGroupProperties !== undefined && + input.billingGroupProperties !== null && { + billingGroupProperties: serializeAws_restJson1BillingGroupProperties(input.billingGroupProperties, context), + }), + ...(input.expectedVersion !== undefined && + input.expectedVersion !== null && { expectedVersion: input.expectedVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6873,7 +6736,7 @@ export const serializeAws_restJson1UpdateCACertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/cacertificate/{certificateId}"; if (input.certificateId !== undefined) { @@ -6893,10 +6756,12 @@ export const serializeAws_restJson1UpdateCACertificateCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.registrationConfig !== undefined && { - registrationConfig: serializeAws_restJson1RegistrationConfig(input.registrationConfig, context), - }), - ...(input.removeAutoRegistration !== undefined && { removeAutoRegistration: input.removeAutoRegistration }), + ...(input.registrationConfig !== undefined && + input.registrationConfig !== null && { + registrationConfig: serializeAws_restJson1RegistrationConfig(input.registrationConfig, context), + }), + ...(input.removeAutoRegistration !== undefined && + input.removeAutoRegistration !== null && { removeAutoRegistration: input.removeAutoRegistration }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6915,9 +6780,7 @@ export const serializeAws_restJson1UpdateCertificateCommand = async ( input: UpdateCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/certificates/{certificateId}"; if (input.certificateId !== undefined) { const labelValue: string = input.certificateId; @@ -6950,7 +6813,7 @@ export const serializeAws_restJson1UpdateDimensionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/dimensions/{name}"; if (input.name !== undefined) { @@ -6964,9 +6827,10 @@ export const serializeAws_restJson1UpdateDimensionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.stringValues !== undefined && { - stringValues: serializeAws_restJson1DimensionStringValues(input.stringValues, context), - }), + ...(input.stringValues !== undefined && + input.stringValues !== null && { + stringValues: serializeAws_restJson1DimensionStringValues(input.stringValues, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -6985,7 +6849,7 @@ export const serializeAws_restJson1UpdateDomainConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/domainConfigurations/{domainConfigurationName}"; if (input.domainConfigurationName !== undefined) { @@ -6999,13 +6863,14 @@ export const serializeAws_restJson1UpdateDomainConfigurationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.authorizerConfig !== undefined && { - authorizerConfig: serializeAws_restJson1AuthorizerConfig(input.authorizerConfig, context), - }), - ...(input.domainConfigurationStatus !== undefined && { - domainConfigurationStatus: input.domainConfigurationStatus, - }), - ...(input.removeAuthorizerConfig !== undefined && { removeAuthorizerConfig: input.removeAuthorizerConfig }), + ...(input.authorizerConfig !== undefined && + input.authorizerConfig !== null && { + authorizerConfig: serializeAws_restJson1AuthorizerConfig(input.authorizerConfig, context), + }), + ...(input.domainConfigurationStatus !== undefined && + input.domainConfigurationStatus !== null && { domainConfigurationStatus: input.domainConfigurationStatus }), + ...(input.removeAuthorizerConfig !== undefined && + input.removeAuthorizerConfig !== null && { removeAuthorizerConfig: input.removeAuthorizerConfig }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7024,7 +6889,7 @@ export const serializeAws_restJson1UpdateDynamicThingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/dynamic-thing-groups/{thingGroupName}"; if (input.thingGroupName !== undefined) { @@ -7038,13 +6903,15 @@ export const serializeAws_restJson1UpdateDynamicThingGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.expectedVersion !== undefined && { expectedVersion: input.expectedVersion }), - ...(input.indexName !== undefined && { indexName: input.indexName }), - ...(input.queryString !== undefined && { queryString: input.queryString }), - ...(input.queryVersion !== undefined && { queryVersion: input.queryVersion }), - ...(input.thingGroupProperties !== undefined && { - thingGroupProperties: serializeAws_restJson1ThingGroupProperties(input.thingGroupProperties, context), - }), + ...(input.expectedVersion !== undefined && + input.expectedVersion !== null && { expectedVersion: input.expectedVersion }), + ...(input.indexName !== undefined && input.indexName !== null && { indexName: input.indexName }), + ...(input.queryString !== undefined && input.queryString !== null && { queryString: input.queryString }), + ...(input.queryVersion !== undefined && input.queryVersion !== null && { queryVersion: input.queryVersion }), + ...(input.thingGroupProperties !== undefined && + input.thingGroupProperties !== null && { + thingGroupProperties: serializeAws_restJson1ThingGroupProperties(input.thingGroupProperties, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7063,14 +6930,15 @@ export const serializeAws_restJson1UpdateEventConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/event-configurations"; let body: any; body = JSON.stringify({ - ...(input.eventConfigurations !== undefined && { - eventConfigurations: serializeAws_restJson1EventConfigurations(input.eventConfigurations, context), - }), + ...(input.eventConfigurations !== undefined && + input.eventConfigurations !== null && { + eventConfigurations: serializeAws_restJson1EventConfigurations(input.eventConfigurations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7089,23 +6957,25 @@ export const serializeAws_restJson1UpdateIndexingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/indexing/config"; let body: any; body = JSON.stringify({ - ...(input.thingGroupIndexingConfiguration !== undefined && { - thingGroupIndexingConfiguration: serializeAws_restJson1ThingGroupIndexingConfiguration( - input.thingGroupIndexingConfiguration, - context - ), - }), - ...(input.thingIndexingConfiguration !== undefined && { - thingIndexingConfiguration: serializeAws_restJson1ThingIndexingConfiguration( - input.thingIndexingConfiguration, - context - ), - }), + ...(input.thingGroupIndexingConfiguration !== undefined && + input.thingGroupIndexingConfiguration !== null && { + thingGroupIndexingConfiguration: serializeAws_restJson1ThingGroupIndexingConfiguration( + input.thingGroupIndexingConfiguration, + context + ), + }), + ...(input.thingIndexingConfiguration !== undefined && + input.thingIndexingConfiguration !== null && { + thingIndexingConfiguration: serializeAws_restJson1ThingIndexingConfiguration( + input.thingIndexingConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7124,7 +6994,7 @@ export const serializeAws_restJson1UpdateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/jobs/{jobId}"; if (input.jobId !== undefined) { @@ -7141,22 +7011,24 @@ export const serializeAws_restJson1UpdateJobCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.abortConfig !== undefined && { - abortConfig: serializeAws_restJson1AbortConfig(input.abortConfig, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.jobExecutionsRolloutConfig !== undefined && { - jobExecutionsRolloutConfig: serializeAws_restJson1JobExecutionsRolloutConfig( - input.jobExecutionsRolloutConfig, - context - ), - }), - ...(input.presignedUrlConfig !== undefined && { - presignedUrlConfig: serializeAws_restJson1PresignedUrlConfig(input.presignedUrlConfig, context), - }), - ...(input.timeoutConfig !== undefined && { - timeoutConfig: serializeAws_restJson1TimeoutConfig(input.timeoutConfig, context), - }), + ...(input.abortConfig !== undefined && + input.abortConfig !== null && { abortConfig: serializeAws_restJson1AbortConfig(input.abortConfig, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.jobExecutionsRolloutConfig !== undefined && + input.jobExecutionsRolloutConfig !== null && { + jobExecutionsRolloutConfig: serializeAws_restJson1JobExecutionsRolloutConfig( + input.jobExecutionsRolloutConfig, + context + ), + }), + ...(input.presignedUrlConfig !== undefined && + input.presignedUrlConfig !== null && { + presignedUrlConfig: serializeAws_restJson1PresignedUrlConfig(input.presignedUrlConfig, context), + }), + ...(input.timeoutConfig !== undefined && + input.timeoutConfig !== null && { + timeoutConfig: serializeAws_restJson1TimeoutConfig(input.timeoutConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7176,7 +7048,7 @@ export const serializeAws_restJson1UpdateMitigationActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/mitigationactions/actions/{actionName}"; if (input.actionName !== undefined) { @@ -7190,10 +7062,11 @@ export const serializeAws_restJson1UpdateMitigationActionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.actionParams !== undefined && { - actionParams: serializeAws_restJson1MitigationActionParams(input.actionParams, context), - }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.actionParams !== undefined && + input.actionParams !== null && { + actionParams: serializeAws_restJson1MitigationActionParams(input.actionParams, context), + }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7212,7 +7085,7 @@ export const serializeAws_restJson1UpdateProvisioningTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/provisioning-templates/{templateName}"; if (input.templateName !== undefined) { @@ -7226,16 +7099,18 @@ export const serializeAws_restJson1UpdateProvisioningTemplateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.defaultVersionId !== undefined && { defaultVersionId: input.defaultVersionId }), - ...(input.description !== undefined && { description: input.description }), - ...(input.enabled !== undefined && { enabled: input.enabled }), - ...(input.preProvisioningHook !== undefined && { - preProvisioningHook: serializeAws_restJson1ProvisioningHook(input.preProvisioningHook, context), - }), - ...(input.provisioningRoleArn !== undefined && { provisioningRoleArn: input.provisioningRoleArn }), - ...(input.removePreProvisioningHook !== undefined && { - removePreProvisioningHook: input.removePreProvisioningHook, - }), + ...(input.defaultVersionId !== undefined && + input.defaultVersionId !== null && { defaultVersionId: input.defaultVersionId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), + ...(input.preProvisioningHook !== undefined && + input.preProvisioningHook !== null && { + preProvisioningHook: serializeAws_restJson1ProvisioningHook(input.preProvisioningHook, context), + }), + ...(input.provisioningRoleArn !== undefined && + input.provisioningRoleArn !== null && { provisioningRoleArn: input.provisioningRoleArn }), + ...(input.removePreProvisioningHook !== undefined && + input.removePreProvisioningHook !== null && { removePreProvisioningHook: input.removePreProvisioningHook }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7254,7 +7129,7 @@ export const serializeAws_restJson1UpdateRoleAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/role-aliases/{roleAlias}"; if (input.roleAlias !== undefined) { @@ -7268,10 +7143,9 @@ export const serializeAws_restJson1UpdateRoleAliasCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.credentialDurationSeconds !== undefined && { - credentialDurationSeconds: input.credentialDurationSeconds, - }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.credentialDurationSeconds !== undefined && + input.credentialDurationSeconds !== null && { credentialDurationSeconds: input.credentialDurationSeconds }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7290,7 +7164,7 @@ export const serializeAws_restJson1UpdateScheduledAuditCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/audit/scheduledaudits/{scheduledAuditName}"; if (input.scheduledAuditName !== undefined) { @@ -7304,12 +7178,13 @@ export const serializeAws_restJson1UpdateScheduledAuditCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.dayOfMonth !== undefined && { dayOfMonth: input.dayOfMonth }), - ...(input.dayOfWeek !== undefined && { dayOfWeek: input.dayOfWeek }), - ...(input.frequency !== undefined && { frequency: input.frequency }), - ...(input.targetCheckNames !== undefined && { - targetCheckNames: serializeAws_restJson1TargetAuditCheckNames(input.targetCheckNames, context), - }), + ...(input.dayOfMonth !== undefined && input.dayOfMonth !== null && { dayOfMonth: input.dayOfMonth }), + ...(input.dayOfWeek !== undefined && input.dayOfWeek !== null && { dayOfWeek: input.dayOfWeek }), + ...(input.frequency !== undefined && input.frequency !== null && { frequency: input.frequency }), + ...(input.targetCheckNames !== undefined && + input.targetCheckNames !== null && { + targetCheckNames: serializeAws_restJson1TargetAuditCheckNames(input.targetCheckNames, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7328,7 +7203,7 @@ export const serializeAws_restJson1UpdateSecurityProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/security-profiles/{securityProfileName}"; if (input.securityProfileName !== undefined) { @@ -7345,30 +7220,34 @@ export const serializeAws_restJson1UpdateSecurityProfileCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.additionalMetricsToRetain !== undefined && { - additionalMetricsToRetain: serializeAws_restJson1AdditionalMetricsToRetainList( - input.additionalMetricsToRetain, - context - ), - }), - ...(input.additionalMetricsToRetainV2 !== undefined && { - additionalMetricsToRetainV2: serializeAws_restJson1AdditionalMetricsToRetainV2List( - input.additionalMetricsToRetainV2, - context - ), - }), - ...(input.alertTargets !== undefined && { - alertTargets: serializeAws_restJson1AlertTargets(input.alertTargets, context), - }), - ...(input.behaviors !== undefined && { behaviors: serializeAws_restJson1Behaviors(input.behaviors, context) }), - ...(input.deleteAdditionalMetricsToRetain !== undefined && { - deleteAdditionalMetricsToRetain: input.deleteAdditionalMetricsToRetain, - }), - ...(input.deleteAlertTargets !== undefined && { deleteAlertTargets: input.deleteAlertTargets }), - ...(input.deleteBehaviors !== undefined && { deleteBehaviors: input.deleteBehaviors }), - ...(input.securityProfileDescription !== undefined && { - securityProfileDescription: input.securityProfileDescription, - }), + ...(input.additionalMetricsToRetain !== undefined && + input.additionalMetricsToRetain !== null && { + additionalMetricsToRetain: serializeAws_restJson1AdditionalMetricsToRetainList( + input.additionalMetricsToRetain, + context + ), + }), + ...(input.additionalMetricsToRetainV2 !== undefined && + input.additionalMetricsToRetainV2 !== null && { + additionalMetricsToRetainV2: serializeAws_restJson1AdditionalMetricsToRetainV2List( + input.additionalMetricsToRetainV2, + context + ), + }), + ...(input.alertTargets !== undefined && + input.alertTargets !== null && { alertTargets: serializeAws_restJson1AlertTargets(input.alertTargets, context) }), + ...(input.behaviors !== undefined && + input.behaviors !== null && { behaviors: serializeAws_restJson1Behaviors(input.behaviors, context) }), + ...(input.deleteAdditionalMetricsToRetain !== undefined && + input.deleteAdditionalMetricsToRetain !== null && { + deleteAdditionalMetricsToRetain: input.deleteAdditionalMetricsToRetain, + }), + ...(input.deleteAlertTargets !== undefined && + input.deleteAlertTargets !== null && { deleteAlertTargets: input.deleteAlertTargets }), + ...(input.deleteBehaviors !== undefined && + input.deleteBehaviors !== null && { deleteBehaviors: input.deleteBehaviors }), + ...(input.securityProfileDescription !== undefined && + input.securityProfileDescription !== null && { securityProfileDescription: input.securityProfileDescription }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7388,7 +7267,7 @@ export const serializeAws_restJson1UpdateStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/streams/{streamId}"; if (input.streamId !== undefined) { @@ -7402,9 +7281,10 @@ export const serializeAws_restJson1UpdateStreamCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.files !== undefined && { files: serializeAws_restJson1StreamFiles(input.files, context) }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.files !== undefined && + input.files !== null && { files: serializeAws_restJson1StreamFiles(input.files, context) }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7423,7 +7303,7 @@ export const serializeAws_restJson1UpdateThingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/things/{thingName}"; if (input.thingName !== undefined) { @@ -7437,12 +7317,15 @@ export const serializeAws_restJson1UpdateThingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.attributePayload !== undefined && { - attributePayload: serializeAws_restJson1AttributePayload(input.attributePayload, context), - }), - ...(input.expectedVersion !== undefined && { expectedVersion: input.expectedVersion }), - ...(input.removeThingType !== undefined && { removeThingType: input.removeThingType }), - ...(input.thingTypeName !== undefined && { thingTypeName: input.thingTypeName }), + ...(input.attributePayload !== undefined && + input.attributePayload !== null && { + attributePayload: serializeAws_restJson1AttributePayload(input.attributePayload, context), + }), + ...(input.expectedVersion !== undefined && + input.expectedVersion !== null && { expectedVersion: input.expectedVersion }), + ...(input.removeThingType !== undefined && + input.removeThingType !== null && { removeThingType: input.removeThingType }), + ...(input.thingTypeName !== undefined && input.thingTypeName !== null && { thingTypeName: input.thingTypeName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7461,7 +7344,7 @@ export const serializeAws_restJson1UpdateThingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/thing-groups/{thingGroupName}"; if (input.thingGroupName !== undefined) { @@ -7475,10 +7358,12 @@ export const serializeAws_restJson1UpdateThingGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.expectedVersion !== undefined && { expectedVersion: input.expectedVersion }), - ...(input.thingGroupProperties !== undefined && { - thingGroupProperties: serializeAws_restJson1ThingGroupProperties(input.thingGroupProperties, context), - }), + ...(input.expectedVersion !== undefined && + input.expectedVersion !== null && { expectedVersion: input.expectedVersion }), + ...(input.thingGroupProperties !== undefined && + input.thingGroupProperties !== null && { + thingGroupProperties: serializeAws_restJson1ThingGroupProperties(input.thingGroupProperties, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7497,19 +7382,22 @@ export const serializeAws_restJson1UpdateThingGroupsForThingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/thing-groups/updateThingGroupsForThing"; let body: any; body = JSON.stringify({ - ...(input.overrideDynamicGroups !== undefined && { overrideDynamicGroups: input.overrideDynamicGroups }), - ...(input.thingGroupsToAdd !== undefined && { - thingGroupsToAdd: serializeAws_restJson1ThingGroupList(input.thingGroupsToAdd, context), - }), - ...(input.thingGroupsToRemove !== undefined && { - thingGroupsToRemove: serializeAws_restJson1ThingGroupList(input.thingGroupsToRemove, context), - }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.overrideDynamicGroups !== undefined && + input.overrideDynamicGroups !== null && { overrideDynamicGroups: input.overrideDynamicGroups }), + ...(input.thingGroupsToAdd !== undefined && + input.thingGroupsToAdd !== null && { + thingGroupsToAdd: serializeAws_restJson1ThingGroupList(input.thingGroupsToAdd, context), + }), + ...(input.thingGroupsToRemove !== undefined && + input.thingGroupsToRemove !== null && { + thingGroupsToRemove: serializeAws_restJson1ThingGroupList(input.thingGroupsToRemove, context), + }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7528,13 +7416,13 @@ export const serializeAws_restJson1UpdateTopicRuleDestinationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/destinations"; let body: any; body = JSON.stringify({ - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.status !== undefined && { status: input.status }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7553,12 +7441,13 @@ export const serializeAws_restJson1ValidateSecurityProfileBehaviorsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/security-profile-behaviors/validate"; let body: any; body = JSON.stringify({ - ...(input.behaviors !== undefined && { behaviors: serializeAws_restJson1Behaviors(input.behaviors, context) }), + ...(input.behaviors !== undefined && + input.behaviors !== null && { behaviors: serializeAws_restJson1Behaviors(input.behaviors, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -27641,102 +27530,140 @@ const deserializeAws_restJson1VersionsLimitExceededExceptionResponse = async ( const serializeAws_restJson1AbortConfig = (input: AbortConfig, context: __SerdeContext): any => { return { - ...(input.criteriaList !== undefined && { - criteriaList: serializeAws_restJson1AbortCriteriaList(input.criteriaList, context), - }), + ...(input.criteriaList !== undefined && + input.criteriaList !== null && { + criteriaList: serializeAws_restJson1AbortCriteriaList(input.criteriaList, context), + }), }; }; const serializeAws_restJson1AbortCriteria = (input: AbortCriteria, context: __SerdeContext): any => { return { - ...(input.action !== undefined && { action: input.action }), - ...(input.failureType !== undefined && { failureType: input.failureType }), - ...(input.minNumberOfExecutedThings !== undefined && { - minNumberOfExecutedThings: input.minNumberOfExecutedThings, - }), - ...(input.thresholdPercentage !== undefined && { thresholdPercentage: input.thresholdPercentage }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), + ...(input.failureType !== undefined && input.failureType !== null && { failureType: input.failureType }), + ...(input.minNumberOfExecutedThings !== undefined && + input.minNumberOfExecutedThings !== null && { minNumberOfExecutedThings: input.minNumberOfExecutedThings }), + ...(input.thresholdPercentage !== undefined && + input.thresholdPercentage !== null && { thresholdPercentage: input.thresholdPercentage }), }; }; const serializeAws_restJson1AbortCriteriaList = (input: AbortCriteria[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AbortCriteria(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AbortCriteria(entry, context); + }); }; const serializeAws_restJson1Action = (input: Action, context: __SerdeContext): any => { return { - ...(input.cloudwatchAlarm !== undefined && { - cloudwatchAlarm: serializeAws_restJson1CloudwatchAlarmAction(input.cloudwatchAlarm, context), - }), - ...(input.cloudwatchLogs !== undefined && { - cloudwatchLogs: serializeAws_restJson1CloudwatchLogsAction(input.cloudwatchLogs, context), - }), - ...(input.cloudwatchMetric !== undefined && { - cloudwatchMetric: serializeAws_restJson1CloudwatchMetricAction(input.cloudwatchMetric, context), - }), - ...(input.dynamoDB !== undefined && { dynamoDB: serializeAws_restJson1DynamoDBAction(input.dynamoDB, context) }), - ...(input.dynamoDBv2 !== undefined && { - dynamoDBv2: serializeAws_restJson1DynamoDBv2Action(input.dynamoDBv2, context), - }), - ...(input.elasticsearch !== undefined && { - elasticsearch: serializeAws_restJson1ElasticsearchAction(input.elasticsearch, context), - }), - ...(input.firehose !== undefined && { firehose: serializeAws_restJson1FirehoseAction(input.firehose, context) }), - ...(input.http !== undefined && { http: serializeAws_restJson1HttpAction(input.http, context) }), - ...(input.iotAnalytics !== undefined && { - iotAnalytics: serializeAws_restJson1IotAnalyticsAction(input.iotAnalytics, context), - }), - ...(input.iotEvents !== undefined && { - iotEvents: serializeAws_restJson1IotEventsAction(input.iotEvents, context), - }), - ...(input.iotSiteWise !== undefined && { - iotSiteWise: serializeAws_restJson1IotSiteWiseAction(input.iotSiteWise, context), - }), - ...(input.kinesis !== undefined && { kinesis: serializeAws_restJson1KinesisAction(input.kinesis, context) }), - ...(input.lambda !== undefined && { lambda: serializeAws_restJson1LambdaAction(input.lambda, context) }), - ...(input.republish !== undefined && { - republish: serializeAws_restJson1RepublishAction(input.republish, context), - }), - ...(input.s3 !== undefined && { s3: serializeAws_restJson1S3Action(input.s3, context) }), - ...(input.salesforce !== undefined && { - salesforce: serializeAws_restJson1SalesforceAction(input.salesforce, context), - }), - ...(input.sns !== undefined && { sns: serializeAws_restJson1SnsAction(input.sns, context) }), - ...(input.sqs !== undefined && { sqs: serializeAws_restJson1SqsAction(input.sqs, context) }), - ...(input.stepFunctions !== undefined && { - stepFunctions: serializeAws_restJson1StepFunctionsAction(input.stepFunctions, context), - }), - ...(input.timestream !== undefined && { - timestream: serializeAws_restJson1TimestreamAction(input.timestream, context), - }), + ...(input.cloudwatchAlarm !== undefined && + input.cloudwatchAlarm !== null && { + cloudwatchAlarm: serializeAws_restJson1CloudwatchAlarmAction(input.cloudwatchAlarm, context), + }), + ...(input.cloudwatchLogs !== undefined && + input.cloudwatchLogs !== null && { + cloudwatchLogs: serializeAws_restJson1CloudwatchLogsAction(input.cloudwatchLogs, context), + }), + ...(input.cloudwatchMetric !== undefined && + input.cloudwatchMetric !== null && { + cloudwatchMetric: serializeAws_restJson1CloudwatchMetricAction(input.cloudwatchMetric, context), + }), + ...(input.dynamoDB !== undefined && + input.dynamoDB !== null && { dynamoDB: serializeAws_restJson1DynamoDBAction(input.dynamoDB, context) }), + ...(input.dynamoDBv2 !== undefined && + input.dynamoDBv2 !== null && { dynamoDBv2: serializeAws_restJson1DynamoDBv2Action(input.dynamoDBv2, context) }), + ...(input.elasticsearch !== undefined && + input.elasticsearch !== null && { + elasticsearch: serializeAws_restJson1ElasticsearchAction(input.elasticsearch, context), + }), + ...(input.firehose !== undefined && + input.firehose !== null && { firehose: serializeAws_restJson1FirehoseAction(input.firehose, context) }), + ...(input.http !== undefined && + input.http !== null && { http: serializeAws_restJson1HttpAction(input.http, context) }), + ...(input.iotAnalytics !== undefined && + input.iotAnalytics !== null && { + iotAnalytics: serializeAws_restJson1IotAnalyticsAction(input.iotAnalytics, context), + }), + ...(input.iotEvents !== undefined && + input.iotEvents !== null && { iotEvents: serializeAws_restJson1IotEventsAction(input.iotEvents, context) }), + ...(input.iotSiteWise !== undefined && + input.iotSiteWise !== null && { + iotSiteWise: serializeAws_restJson1IotSiteWiseAction(input.iotSiteWise, context), + }), + ...(input.kinesis !== undefined && + input.kinesis !== null && { kinesis: serializeAws_restJson1KinesisAction(input.kinesis, context) }), + ...(input.lambda !== undefined && + input.lambda !== null && { lambda: serializeAws_restJson1LambdaAction(input.lambda, context) }), + ...(input.republish !== undefined && + input.republish !== null && { republish: serializeAws_restJson1RepublishAction(input.republish, context) }), + ...(input.s3 !== undefined && input.s3 !== null && { s3: serializeAws_restJson1S3Action(input.s3, context) }), + ...(input.salesforce !== undefined && + input.salesforce !== null && { salesforce: serializeAws_restJson1SalesforceAction(input.salesforce, context) }), + ...(input.sns !== undefined && input.sns !== null && { sns: serializeAws_restJson1SnsAction(input.sns, context) }), + ...(input.sqs !== undefined && input.sqs !== null && { sqs: serializeAws_restJson1SqsAction(input.sqs, context) }), + ...(input.stepFunctions !== undefined && + input.stepFunctions !== null && { + stepFunctions: serializeAws_restJson1StepFunctionsAction(input.stepFunctions, context), + }), + ...(input.timestream !== undefined && + input.timestream !== null && { timestream: serializeAws_restJson1TimestreamAction(input.timestream, context) }), }; }; const serializeAws_restJson1ActionList = (input: Action[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Action(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Action(entry, context); + }); }; const serializeAws_restJson1AdditionalMetricsToRetainList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AdditionalMetricsToRetainV2List = ( input: MetricToRetain[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1MetricToRetain(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MetricToRetain(entry, context); + }); }; const serializeAws_restJson1AdditionalParameterMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AddThingsToThingGroupParams = ( @@ -27744,49 +27671,66 @@ const serializeAws_restJson1AddThingsToThingGroupParams = ( context: __SerdeContext ): any => { return { - ...(input.overrideDynamicGroups !== undefined && { overrideDynamicGroups: input.overrideDynamicGroups }), - ...(input.thingGroupNames !== undefined && { - thingGroupNames: serializeAws_restJson1ThingGroupNames(input.thingGroupNames, context), - }), + ...(input.overrideDynamicGroups !== undefined && + input.overrideDynamicGroups !== null && { overrideDynamicGroups: input.overrideDynamicGroups }), + ...(input.thingGroupNames !== undefined && + input.thingGroupNames !== null && { + thingGroupNames: serializeAws_restJson1ThingGroupNames(input.thingGroupNames, context), + }), }; }; const serializeAws_restJson1AlertTarget = (input: AlertTarget, context: __SerdeContext): any => { return { - ...(input.alertTargetArn !== undefined && { alertTargetArn: input.alertTargetArn }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.alertTargetArn !== undefined && + input.alertTargetArn !== null && { alertTargetArn: input.alertTargetArn }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1AlertTargets = (input: { [key: string]: AlertTarget }, context: __SerdeContext): any => { return Object.entries(input).reduce( - (acc: { [key: string]: AlertTarget }, [key, value]: [AlertTargetType | string, any]) => ({ - ...acc, - [key]: serializeAws_restJson1AlertTarget(value, context), - }), + (acc: { [key: string]: AlertTarget }, [key, value]: [AlertTargetType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_restJson1AlertTarget(value, context), + }; + }, {} ); }; const serializeAws_restJson1AssetPropertyTimestamp = (input: AssetPropertyTimestamp, context: __SerdeContext): any => { return { - ...(input.offsetInNanos !== undefined && { offsetInNanos: input.offsetInNanos }), - ...(input.timeInSeconds !== undefined && { timeInSeconds: input.timeInSeconds }), + ...(input.offsetInNanos !== undefined && input.offsetInNanos !== null && { offsetInNanos: input.offsetInNanos }), + ...(input.timeInSeconds !== undefined && input.timeInSeconds !== null && { timeInSeconds: input.timeInSeconds }), }; }; const serializeAws_restJson1AssetPropertyValue = (input: AssetPropertyValue, context: __SerdeContext): any => { return { - ...(input.quality !== undefined && { quality: input.quality }), - ...(input.timestamp !== undefined && { - timestamp: serializeAws_restJson1AssetPropertyTimestamp(input.timestamp, context), - }), - ...(input.value !== undefined && { value: serializeAws_restJson1AssetPropertyVariant(input.value, context) }), + ...(input.quality !== undefined && input.quality !== null && { quality: input.quality }), + ...(input.timestamp !== undefined && + input.timestamp !== null && { + timestamp: serializeAws_restJson1AssetPropertyTimestamp(input.timestamp, context), + }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_restJson1AssetPropertyVariant(input.value, context) }), }; }; const serializeAws_restJson1AssetPropertyValueList = (input: AssetPropertyValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AssetPropertyValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetPropertyValue(entry, context); + }); }; const serializeAws_restJson1AssetPropertyVariant = (input: AssetPropertyVariant, context: __SerdeContext): any => { @@ -27801,29 +27745,34 @@ const serializeAws_restJson1AssetPropertyVariant = (input: AssetPropertyVariant, const serializeAws_restJson1AttributePayload = (input: AttributePayload, context: __SerdeContext): any => { return { - ...(input.attributes !== undefined && { attributes: serializeAws_restJson1Attributes(input.attributes, context) }), - ...(input.merge !== undefined && { merge: input.merge }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_restJson1Attributes(input.attributes, context) }), + ...(input.merge !== undefined && input.merge !== null && { merge: input.merge }), }; }; const serializeAws_restJson1Attributes = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AttributesMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AuditCheckConfiguration = ( @@ -27831,7 +27780,7 @@ const serializeAws_restJson1AuditCheckConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.enabled !== undefined && { enabled: input.enabled }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), }; }; @@ -27840,10 +27789,15 @@ const serializeAws_restJson1AuditCheckConfigurations = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: AuditCheckConfiguration }, [key, value]: [string, any]) => ({ - ...acc, - [key]: serializeAws_restJson1AuditCheckConfiguration(value, context), - }), + (acc: { [key: string]: AuditCheckConfiguration }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_restJson1AuditCheckConfiguration(value, context), + }; + }, {} ); }; @@ -27852,26 +27806,30 @@ const serializeAws_restJson1AuditCheckToActionsMapping = ( input: { [key: string]: string[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1MitigationActionNameList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AuditCheckToReasonCodeFilter = ( input: { [key: string]: string[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1ReasonForNonComplianceCodes(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AuditMitigationActionsTaskTarget = ( @@ -27879,14 +27837,16 @@ const serializeAws_restJson1AuditMitigationActionsTaskTarget = ( context: __SerdeContext ): any => { return { - ...(input.auditCheckToReasonCodeFilter !== undefined && { - auditCheckToReasonCodeFilter: serializeAws_restJson1AuditCheckToReasonCodeFilter( - input.auditCheckToReasonCodeFilter, - context - ), - }), - ...(input.auditTaskId !== undefined && { auditTaskId: input.auditTaskId }), - ...(input.findingIds !== undefined && { findingIds: serializeAws_restJson1FindingIds(input.findingIds, context) }), + ...(input.auditCheckToReasonCodeFilter !== undefined && + input.auditCheckToReasonCodeFilter !== null && { + auditCheckToReasonCodeFilter: serializeAws_restJson1AuditCheckToReasonCodeFilter( + input.auditCheckToReasonCodeFilter, + context + ), + }), + ...(input.auditTaskId !== undefined && input.auditTaskId !== null && { auditTaskId: input.auditTaskId }), + ...(input.findingIds !== undefined && + input.findingIds !== null && { findingIds: serializeAws_restJson1FindingIds(input.findingIds, context) }), }; }; @@ -27895,9 +27855,9 @@ const serializeAws_restJson1AuditNotificationTarget = ( context: __SerdeContext ): any => { return { - ...(input.enabled !== undefined && { enabled: input.enabled }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.targetArn !== undefined && { targetArn: input.targetArn }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.targetArn !== undefined && input.targetArn !== null && { targetArn: input.targetArn }), }; }; @@ -27906,53 +27866,76 @@ const serializeAws_restJson1AuditNotificationTargetConfigurations = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: AuditNotificationTarget }, [key, value]: [AuditNotificationType | string, any]) => ({ - ...acc, - [key]: serializeAws_restJson1AuditNotificationTarget(value, context), - }), + (acc: { [key: string]: AuditNotificationTarget }, [key, value]: [AuditNotificationType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_restJson1AuditNotificationTarget(value, context), + }; + }, {} ); }; const serializeAws_restJson1AuthInfo = (input: AuthInfo, context: __SerdeContext): any => { return { - ...(input.actionType !== undefined && { actionType: input.actionType }), - ...(input.resources !== undefined && { resources: serializeAws_restJson1Resources(input.resources, context) }), + ...(input.actionType !== undefined && input.actionType !== null && { actionType: input.actionType }), + ...(input.resources !== undefined && + input.resources !== null && { resources: serializeAws_restJson1Resources(input.resources, context) }), }; }; const serializeAws_restJson1AuthInfos = (input: AuthInfo[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AuthInfo(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AuthInfo(entry, context); + }); }; const serializeAws_restJson1AuthorizerConfig = (input: AuthorizerConfig, context: __SerdeContext): any => { return { - ...(input.allowAuthorizerOverride !== undefined && { allowAuthorizerOverride: input.allowAuthorizerOverride }), - ...(input.defaultAuthorizerName !== undefined && { defaultAuthorizerName: input.defaultAuthorizerName }), + ...(input.allowAuthorizerOverride !== undefined && + input.allowAuthorizerOverride !== null && { allowAuthorizerOverride: input.allowAuthorizerOverride }), + ...(input.defaultAuthorizerName !== undefined && + input.defaultAuthorizerName !== null && { defaultAuthorizerName: input.defaultAuthorizerName }), }; }; const serializeAws_restJson1AwsJobAbortConfig = (input: AwsJobAbortConfig, context: __SerdeContext): any => { return { - ...(input.abortCriteriaList !== undefined && { - abortCriteriaList: serializeAws_restJson1AwsJobAbortCriteriaList(input.abortCriteriaList, context), - }), + ...(input.abortCriteriaList !== undefined && + input.abortCriteriaList !== null && { + abortCriteriaList: serializeAws_restJson1AwsJobAbortCriteriaList(input.abortCriteriaList, context), + }), }; }; const serializeAws_restJson1AwsJobAbortCriteria = (input: AwsJobAbortCriteria, context: __SerdeContext): any => { return { - ...(input.action !== undefined && { action: input.action }), - ...(input.failureType !== undefined && { failureType: input.failureType }), - ...(input.minNumberOfExecutedThings !== undefined && { - minNumberOfExecutedThings: input.minNumberOfExecutedThings, - }), - ...(input.thresholdPercentage !== undefined && { thresholdPercentage: input.thresholdPercentage }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), + ...(input.failureType !== undefined && input.failureType !== null && { failureType: input.failureType }), + ...(input.minNumberOfExecutedThings !== undefined && + input.minNumberOfExecutedThings !== null && { minNumberOfExecutedThings: input.minNumberOfExecutedThings }), + ...(input.thresholdPercentage !== undefined && + input.thresholdPercentage !== null && { thresholdPercentage: input.thresholdPercentage }), }; }; const serializeAws_restJson1AwsJobAbortCriteriaList = (input: AwsJobAbortCriteria[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AwsJobAbortCriteria(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsJobAbortCriteria(entry, context); + }); }; const serializeAws_restJson1AwsJobExecutionsRolloutConfig = ( @@ -27960,10 +27943,12 @@ const serializeAws_restJson1AwsJobExecutionsRolloutConfig = ( context: __SerdeContext ): any => { return { - ...(input.exponentialRate !== undefined && { - exponentialRate: serializeAws_restJson1AwsJobExponentialRolloutRate(input.exponentialRate, context), - }), - ...(input.maximumPerMinute !== undefined && { maximumPerMinute: input.maximumPerMinute }), + ...(input.exponentialRate !== undefined && + input.exponentialRate !== null && { + exponentialRate: serializeAws_restJson1AwsJobExponentialRolloutRate(input.exponentialRate, context), + }), + ...(input.maximumPerMinute !== undefined && + input.maximumPerMinute !== null && { maximumPerMinute: input.maximumPerMinute }), }; }; @@ -27972,11 +27957,14 @@ const serializeAws_restJson1AwsJobExponentialRolloutRate = ( context: __SerdeContext ): any => { return { - ...(input.baseRatePerMinute !== undefined && { baseRatePerMinute: input.baseRatePerMinute }), - ...(input.incrementFactor !== undefined && { incrementFactor: input.incrementFactor }), - ...(input.rateIncreaseCriteria !== undefined && { - rateIncreaseCriteria: serializeAws_restJson1AwsJobRateIncreaseCriteria(input.rateIncreaseCriteria, context), - }), + ...(input.baseRatePerMinute !== undefined && + input.baseRatePerMinute !== null && { baseRatePerMinute: input.baseRatePerMinute }), + ...(input.incrementFactor !== undefined && + input.incrementFactor !== null && { incrementFactor: input.incrementFactor }), + ...(input.rateIncreaseCriteria !== undefined && + input.rateIncreaseCriteria !== null && { + rateIncreaseCriteria: serializeAws_restJson1AwsJobRateIncreaseCriteria(input.rateIncreaseCriteria, context), + }), }; }; @@ -27985,7 +27973,7 @@ const serializeAws_restJson1AwsJobPresignedUrlConfig = ( context: __SerdeContext ): any => { return { - ...(input.expiresInSec !== undefined && { expiresInSec: input.expiresInSec }), + ...(input.expiresInSec !== undefined && input.expiresInSec !== null && { expiresInSec: input.expiresInSec }), }; }; @@ -27994,97 +27982,129 @@ const serializeAws_restJson1AwsJobRateIncreaseCriteria = ( context: __SerdeContext ): any => { return { - ...(input.numberOfNotifiedThings !== undefined && { numberOfNotifiedThings: input.numberOfNotifiedThings }), - ...(input.numberOfSucceededThings !== undefined && { numberOfSucceededThings: input.numberOfSucceededThings }), + ...(input.numberOfNotifiedThings !== undefined && + input.numberOfNotifiedThings !== null && { numberOfNotifiedThings: input.numberOfNotifiedThings }), + ...(input.numberOfSucceededThings !== undefined && + input.numberOfSucceededThings !== null && { numberOfSucceededThings: input.numberOfSucceededThings }), }; }; const serializeAws_restJson1AwsJobTimeoutConfig = (input: AwsJobTimeoutConfig, context: __SerdeContext): any => { return { - ...(input.inProgressTimeoutInMinutes !== undefined && { - inProgressTimeoutInMinutes: input.inProgressTimeoutInMinutes, - }), + ...(input.inProgressTimeoutInMinutes !== undefined && + input.inProgressTimeoutInMinutes !== null && { inProgressTimeoutInMinutes: input.inProgressTimeoutInMinutes }), }; }; const serializeAws_restJson1Behavior = (input: Behavior, context: __SerdeContext): any => { return { - ...(input.criteria !== undefined && { criteria: serializeAws_restJson1BehaviorCriteria(input.criteria, context) }), - ...(input.metric !== undefined && { metric: input.metric }), - ...(input.metricDimension !== undefined && { - metricDimension: serializeAws_restJson1MetricDimension(input.metricDimension, context), - }), - ...(input.name !== undefined && { name: input.name }), + ...(input.criteria !== undefined && + input.criteria !== null && { criteria: serializeAws_restJson1BehaviorCriteria(input.criteria, context) }), + ...(input.metric !== undefined && input.metric !== null && { metric: input.metric }), + ...(input.metricDimension !== undefined && + input.metricDimension !== null && { + metricDimension: serializeAws_restJson1MetricDimension(input.metricDimension, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_restJson1BehaviorCriteria = (input: BehaviorCriteria, context: __SerdeContext): any => { return { - ...(input.comparisonOperator !== undefined && { comparisonOperator: input.comparisonOperator }), - ...(input.consecutiveDatapointsToAlarm !== undefined && { - consecutiveDatapointsToAlarm: input.consecutiveDatapointsToAlarm, - }), - ...(input.consecutiveDatapointsToClear !== undefined && { - consecutiveDatapointsToClear: input.consecutiveDatapointsToClear, - }), - ...(input.durationSeconds !== undefined && { durationSeconds: input.durationSeconds }), - ...(input.statisticalThreshold !== undefined && { - statisticalThreshold: serializeAws_restJson1StatisticalThreshold(input.statisticalThreshold, context), - }), - ...(input.value !== undefined && { value: serializeAws_restJson1MetricValue(input.value, context) }), + ...(input.comparisonOperator !== undefined && + input.comparisonOperator !== null && { comparisonOperator: input.comparisonOperator }), + ...(input.consecutiveDatapointsToAlarm !== undefined && + input.consecutiveDatapointsToAlarm !== null && { + consecutiveDatapointsToAlarm: input.consecutiveDatapointsToAlarm, + }), + ...(input.consecutiveDatapointsToClear !== undefined && + input.consecutiveDatapointsToClear !== null && { + consecutiveDatapointsToClear: input.consecutiveDatapointsToClear, + }), + ...(input.durationSeconds !== undefined && + input.durationSeconds !== null && { durationSeconds: input.durationSeconds }), + ...(input.statisticalThreshold !== undefined && + input.statisticalThreshold !== null && { + statisticalThreshold: serializeAws_restJson1StatisticalThreshold(input.statisticalThreshold, context), + }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_restJson1MetricValue(input.value, context) }), }; }; const serializeAws_restJson1Behaviors = (input: Behavior[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Behavior(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Behavior(entry, context); + }); }; const serializeAws_restJson1BillingGroupProperties = (input: BillingGroupProperties, context: __SerdeContext): any => { return { - ...(input.billingGroupDescription !== undefined && { billingGroupDescription: input.billingGroupDescription }), + ...(input.billingGroupDescription !== undefined && + input.billingGroupDescription !== null && { billingGroupDescription: input.billingGroupDescription }), }; }; const serializeAws_restJson1Cidrs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1CloudwatchAlarmAction = (input: CloudwatchAlarmAction, context: __SerdeContext): any => { return { - ...(input.alarmName !== undefined && { alarmName: input.alarmName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.stateReason !== undefined && { stateReason: input.stateReason }), - ...(input.stateValue !== undefined && { stateValue: input.stateValue }), + ...(input.alarmName !== undefined && input.alarmName !== null && { alarmName: input.alarmName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.stateReason !== undefined && input.stateReason !== null && { stateReason: input.stateReason }), + ...(input.stateValue !== undefined && input.stateValue !== null && { stateValue: input.stateValue }), }; }; const serializeAws_restJson1CloudwatchLogsAction = (input: CloudwatchLogsAction, context: __SerdeContext): any => { return { - ...(input.logGroupName !== undefined && { logGroupName: input.logGroupName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1CloudwatchMetricAction = (input: CloudwatchMetricAction, context: __SerdeContext): any => { return { - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.metricNamespace !== undefined && { metricNamespace: input.metricNamespace }), - ...(input.metricTimestamp !== undefined && { metricTimestamp: input.metricTimestamp }), - ...(input.metricUnit !== undefined && { metricUnit: input.metricUnit }), - ...(input.metricValue !== undefined && { metricValue: input.metricValue }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.metricNamespace !== undefined && + input.metricNamespace !== null && { metricNamespace: input.metricNamespace }), + ...(input.metricTimestamp !== undefined && + input.metricTimestamp !== null && { metricTimestamp: input.metricTimestamp }), + ...(input.metricUnit !== undefined && input.metricUnit !== null && { metricUnit: input.metricUnit }), + ...(input.metricValue !== undefined && input.metricValue !== null && { metricValue: input.metricValue }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1CodeSigning = (input: CodeSigning, context: __SerdeContext): any => { return { - ...(input.awsSignerJobId !== undefined && { awsSignerJobId: input.awsSignerJobId }), - ...(input.customCodeSigning !== undefined && { - customCodeSigning: serializeAws_restJson1CustomCodeSigning(input.customCodeSigning, context), - }), - ...(input.startSigningJobParameter !== undefined && { - startSigningJobParameter: serializeAws_restJson1StartSigningJobParameter(input.startSigningJobParameter, context), - }), + ...(input.awsSignerJobId !== undefined && + input.awsSignerJobId !== null && { awsSignerJobId: input.awsSignerJobId }), + ...(input.customCodeSigning !== undefined && + input.customCodeSigning !== null && { + customCodeSigning: serializeAws_restJson1CustomCodeSigning(input.customCodeSigning, context), + }), + ...(input.startSigningJobParameter !== undefined && + input.startSigningJobParameter !== null && { + startSigningJobParameter: serializeAws_restJson1StartSigningJobParameter( + input.startSigningJobParameter, + context + ), + }), }; }; @@ -28093,94 +28113,110 @@ const serializeAws_restJson1CodeSigningCertificateChain = ( context: __SerdeContext ): any => { return { - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), - ...(input.inlineDocument !== undefined && { inlineDocument: input.inlineDocument }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), + ...(input.inlineDocument !== undefined && + input.inlineDocument !== null && { inlineDocument: input.inlineDocument }), }; }; const serializeAws_restJson1CodeSigningSignature = (input: CodeSigningSignature, context: __SerdeContext): any => { return { - ...(input.inlineDocument !== undefined && { inlineDocument: context.base64Encoder(input.inlineDocument) }), + ...(input.inlineDocument !== undefined && + input.inlineDocument !== null && { inlineDocument: context.base64Encoder(input.inlineDocument) }), }; }; const serializeAws_restJson1Configuration = (input: Configuration, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; const serializeAws_restJson1CustomCodeSigning = (input: CustomCodeSigning, context: __SerdeContext): any => { return { - ...(input.certificateChain !== undefined && { - certificateChain: serializeAws_restJson1CodeSigningCertificateChain(input.certificateChain, context), - }), - ...(input.hashAlgorithm !== undefined && { hashAlgorithm: input.hashAlgorithm }), - ...(input.signature !== undefined && { - signature: serializeAws_restJson1CodeSigningSignature(input.signature, context), - }), - ...(input.signatureAlgorithm !== undefined && { signatureAlgorithm: input.signatureAlgorithm }), + ...(input.certificateChain !== undefined && + input.certificateChain !== null && { + certificateChain: serializeAws_restJson1CodeSigningCertificateChain(input.certificateChain, context), + }), + ...(input.hashAlgorithm !== undefined && input.hashAlgorithm !== null && { hashAlgorithm: input.hashAlgorithm }), + ...(input.signature !== undefined && + input.signature !== null && { signature: serializeAws_restJson1CodeSigningSignature(input.signature, context) }), + ...(input.signatureAlgorithm !== undefined && + input.signatureAlgorithm !== null && { signatureAlgorithm: input.signatureAlgorithm }), }; }; const serializeAws_restJson1Destination = (input: Destination, context: __SerdeContext): any => { return { - ...(input.s3Destination !== undefined && { - s3Destination: serializeAws_restJson1S3Destination(input.s3Destination, context), - }), + ...(input.s3Destination !== undefined && + input.s3Destination !== null && { + s3Destination: serializeAws_restJson1S3Destination(input.s3Destination, context), + }), }; }; const serializeAws_restJson1DetailsMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1DimensionStringValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DynamoDBAction = (input: DynamoDBAction, context: __SerdeContext): any => { return { - ...(input.hashKeyField !== undefined && { hashKeyField: input.hashKeyField }), - ...(input.hashKeyType !== undefined && { hashKeyType: input.hashKeyType }), - ...(input.hashKeyValue !== undefined && { hashKeyValue: input.hashKeyValue }), - ...(input.operation !== undefined && { operation: input.operation }), - ...(input.payloadField !== undefined && { payloadField: input.payloadField }), - ...(input.rangeKeyField !== undefined && { rangeKeyField: input.rangeKeyField }), - ...(input.rangeKeyType !== undefined && { rangeKeyType: input.rangeKeyType }), - ...(input.rangeKeyValue !== undefined && { rangeKeyValue: input.rangeKeyValue }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tableName !== undefined && { tableName: input.tableName }), + ...(input.hashKeyField !== undefined && input.hashKeyField !== null && { hashKeyField: input.hashKeyField }), + ...(input.hashKeyType !== undefined && input.hashKeyType !== null && { hashKeyType: input.hashKeyType }), + ...(input.hashKeyValue !== undefined && input.hashKeyValue !== null && { hashKeyValue: input.hashKeyValue }), + ...(input.operation !== undefined && input.operation !== null && { operation: input.operation }), + ...(input.payloadField !== undefined && input.payloadField !== null && { payloadField: input.payloadField }), + ...(input.rangeKeyField !== undefined && input.rangeKeyField !== null && { rangeKeyField: input.rangeKeyField }), + ...(input.rangeKeyType !== undefined && input.rangeKeyType !== null && { rangeKeyType: input.rangeKeyType }), + ...(input.rangeKeyValue !== undefined && input.rangeKeyValue !== null && { rangeKeyValue: input.rangeKeyValue }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }), }; }; const serializeAws_restJson1DynamoDBv2Action = (input: DynamoDBv2Action, context: __SerdeContext): any => { return { - ...(input.putItem !== undefined && { putItem: serializeAws_restJson1PutItemInput(input.putItem, context) }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.putItem !== undefined && + input.putItem !== null && { putItem: serializeAws_restJson1PutItemInput(input.putItem, context) }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1ElasticsearchAction = (input: ElasticsearchAction, context: __SerdeContext): any => { return { - ...(input.endpoint !== undefined && { endpoint: input.endpoint }), - ...(input.id !== undefined && { id: input.id }), - ...(input.index !== undefined && { index: input.index }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.type !== undefined && { type: input.type }), + ...(input.endpoint !== undefined && input.endpoint !== null && { endpoint: input.endpoint }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.index !== undefined && input.index !== null && { index: input.index }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1EnableIoTLoggingParams = (input: EnableIoTLoggingParams, context: __SerdeContext): any => { return { - ...(input.logLevel !== undefined && { logLevel: input.logLevel }), - ...(input.roleArnForLogging !== undefined && { roleArnForLogging: input.roleArnForLogging }), + ...(input.logLevel !== undefined && input.logLevel !== null && { logLevel: input.logLevel }), + ...(input.roleArnForLogging !== undefined && + input.roleArnForLogging !== null && { roleArnForLogging: input.roleArnForLogging }), }; }; @@ -28189,96 +28225,135 @@ const serializeAws_restJson1EventConfigurations = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: Configuration }, [key, value]: [EventType | string, any]) => ({ - ...acc, - [key]: serializeAws_restJson1Configuration(value, context), - }), + (acc: { [key: string]: Configuration }, [key, value]: [EventType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_restJson1Configuration(value, context), + }; + }, {} ); }; const serializeAws_restJson1ExponentialRolloutRate = (input: ExponentialRolloutRate, context: __SerdeContext): any => { return { - ...(input.baseRatePerMinute !== undefined && { baseRatePerMinute: input.baseRatePerMinute }), - ...(input.incrementFactor !== undefined && { incrementFactor: input.incrementFactor }), - ...(input.rateIncreaseCriteria !== undefined && { - rateIncreaseCriteria: serializeAws_restJson1RateIncreaseCriteria(input.rateIncreaseCriteria, context), - }), + ...(input.baseRatePerMinute !== undefined && + input.baseRatePerMinute !== null && { baseRatePerMinute: input.baseRatePerMinute }), + ...(input.incrementFactor !== undefined && + input.incrementFactor !== null && { incrementFactor: input.incrementFactor }), + ...(input.rateIncreaseCriteria !== undefined && + input.rateIncreaseCriteria !== null && { + rateIncreaseCriteria: serializeAws_restJson1RateIncreaseCriteria(input.rateIncreaseCriteria, context), + }), }; }; const serializeAws_restJson1Field = (input: Field, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.type !== undefined && { type: input.type }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1Fields = (input: Field[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Field(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Field(entry, context); + }); }; const serializeAws_restJson1FileLocation = (input: FileLocation, context: __SerdeContext): any => { return { - ...(input.s3Location !== undefined && { s3Location: serializeAws_restJson1S3Location(input.s3Location, context) }), - ...(input.stream !== undefined && { stream: serializeAws_restJson1_Stream(input.stream, context) }), + ...(input.s3Location !== undefined && + input.s3Location !== null && { s3Location: serializeAws_restJson1S3Location(input.s3Location, context) }), + ...(input.stream !== undefined && + input.stream !== null && { stream: serializeAws_restJson1_Stream(input.stream, context) }), }; }; const serializeAws_restJson1FindingIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1FirehoseAction = (input: FirehoseAction, context: __SerdeContext): any => { return { - ...(input.batchMode !== undefined && { batchMode: input.batchMode }), - ...(input.deliveryStreamName !== undefined && { deliveryStreamName: input.deliveryStreamName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.separator !== undefined && { separator: input.separator }), + ...(input.batchMode !== undefined && input.batchMode !== null && { batchMode: input.batchMode }), + ...(input.deliveryStreamName !== undefined && + input.deliveryStreamName !== null && { deliveryStreamName: input.deliveryStreamName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.separator !== undefined && input.separator !== null && { separator: input.separator }), }; }; const serializeAws_restJson1HeaderList = (input: HttpActionHeader[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1HttpActionHeader(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1HttpActionHeader(entry, context); + }); }; const serializeAws_restJson1HttpAction = (input: HttpAction, context: __SerdeContext): any => { return { - ...(input.auth !== undefined && { auth: serializeAws_restJson1HttpAuthorization(input.auth, context) }), - ...(input.confirmationUrl !== undefined && { confirmationUrl: input.confirmationUrl }), - ...(input.headers !== undefined && { headers: serializeAws_restJson1HeaderList(input.headers, context) }), - ...(input.url !== undefined && { url: input.url }), + ...(input.auth !== undefined && + input.auth !== null && { auth: serializeAws_restJson1HttpAuthorization(input.auth, context) }), + ...(input.confirmationUrl !== undefined && + input.confirmationUrl !== null && { confirmationUrl: input.confirmationUrl }), + ...(input.headers !== undefined && + input.headers !== null && { headers: serializeAws_restJson1HeaderList(input.headers, context) }), + ...(input.url !== undefined && input.url !== null && { url: input.url }), }; }; const serializeAws_restJson1HttpActionHeader = (input: HttpActionHeader, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1HttpAuthorization = (input: HttpAuthorization, context: __SerdeContext): any => { return { - ...(input.sigv4 !== undefined && { sigv4: serializeAws_restJson1SigV4Authorization(input.sigv4, context) }), + ...(input.sigv4 !== undefined && + input.sigv4 !== null && { sigv4: serializeAws_restJson1SigV4Authorization(input.sigv4, context) }), }; }; const serializeAws_restJson1HttpContext = (input: HttpContext, context: __SerdeContext): any => { return { - ...(input.headers !== undefined && { headers: serializeAws_restJson1HttpHeaders(input.headers, context) }), - ...(input.queryString !== undefined && { queryString: input.queryString }), + ...(input.headers !== undefined && + input.headers !== null && { headers: serializeAws_restJson1HttpHeaders(input.headers, context) }), + ...(input.queryString !== undefined && input.queryString !== null && { queryString: input.queryString }), }; }; const serializeAws_restJson1HttpHeaders = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1HttpUrlDestinationConfiguration = ( @@ -28286,37 +28361,39 @@ const serializeAws_restJson1HttpUrlDestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.confirmationUrl !== undefined && { confirmationUrl: input.confirmationUrl }), + ...(input.confirmationUrl !== undefined && + input.confirmationUrl !== null && { confirmationUrl: input.confirmationUrl }), }; }; const serializeAws_restJson1IotAnalyticsAction = (input: IotAnalyticsAction, context: __SerdeContext): any => { return { - ...(input.batchMode !== undefined && { batchMode: input.batchMode }), - ...(input.channelArn !== undefined && { channelArn: input.channelArn }), - ...(input.channelName !== undefined && { channelName: input.channelName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.batchMode !== undefined && input.batchMode !== null && { batchMode: input.batchMode }), + ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }), + ...(input.channelName !== undefined && input.channelName !== null && { channelName: input.channelName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1IotEventsAction = (input: IotEventsAction, context: __SerdeContext): any => { return { - ...(input.batchMode !== undefined && { batchMode: input.batchMode }), - ...(input.inputName !== undefined && { inputName: input.inputName }), - ...(input.messageId !== undefined && { messageId: input.messageId }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.batchMode !== undefined && input.batchMode !== null && { batchMode: input.batchMode }), + ...(input.inputName !== undefined && input.inputName !== null && { inputName: input.inputName }), + ...(input.messageId !== undefined && input.messageId !== null && { messageId: input.messageId }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1IotSiteWiseAction = (input: IotSiteWiseAction, context: __SerdeContext): any => { return { - ...(input.putAssetPropertyValueEntries !== undefined && { - putAssetPropertyValueEntries: serializeAws_restJson1PutAssetPropertyValueEntryList( - input.putAssetPropertyValueEntries, - context - ), - }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.putAssetPropertyValueEntries !== undefined && + input.putAssetPropertyValueEntries !== null && { + putAssetPropertyValueEntries: serializeAws_restJson1PutAssetPropertyValueEntryList( + input.putAssetPropertyValueEntries, + context + ), + }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; @@ -28325,156 +28402,201 @@ const serializeAws_restJson1JobExecutionsRolloutConfig = ( context: __SerdeContext ): any => { return { - ...(input.exponentialRate !== undefined && { - exponentialRate: serializeAws_restJson1ExponentialRolloutRate(input.exponentialRate, context), - }), - ...(input.maximumPerMinute !== undefined && { maximumPerMinute: input.maximumPerMinute }), + ...(input.exponentialRate !== undefined && + input.exponentialRate !== null && { + exponentialRate: serializeAws_restJson1ExponentialRolloutRate(input.exponentialRate, context), + }), + ...(input.maximumPerMinute !== undefined && + input.maximumPerMinute !== null && { maximumPerMinute: input.maximumPerMinute }), }; }; const serializeAws_restJson1JobTargets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1KinesisAction = (input: KinesisAction, context: __SerdeContext): any => { return { - ...(input.partitionKey !== undefined && { partitionKey: input.partitionKey }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.streamName !== undefined && { streamName: input.streamName }), + ...(input.partitionKey !== undefined && input.partitionKey !== null && { partitionKey: input.partitionKey }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.streamName !== undefined && input.streamName !== null && { streamName: input.streamName }), }; }; const serializeAws_restJson1LambdaAction = (input: LambdaAction, context: __SerdeContext): any => { return { - ...(input.functionArn !== undefined && { functionArn: input.functionArn }), + ...(input.functionArn !== undefined && input.functionArn !== null && { functionArn: input.functionArn }), }; }; const serializeAws_restJson1LoggingOptionsPayload = (input: LoggingOptionsPayload, context: __SerdeContext): any => { return { - ...(input.logLevel !== undefined && { logLevel: input.logLevel }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.logLevel !== undefined && input.logLevel !== null && { logLevel: input.logLevel }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1LogTarget = (input: LogTarget, context: __SerdeContext): any => { return { - ...(input.targetName !== undefined && { targetName: input.targetName }), - ...(input.targetType !== undefined && { targetType: input.targetType }), + ...(input.targetName !== undefined && input.targetName !== null && { targetName: input.targetName }), + ...(input.targetType !== undefined && input.targetType !== null && { targetType: input.targetType }), }; }; const serializeAws_restJson1MetricDimension = (input: MetricDimension, context: __SerdeContext): any => { return { - ...(input.dimensionName !== undefined && { dimensionName: input.dimensionName }), - ...(input.operator !== undefined && { operator: input.operator }), + ...(input.dimensionName !== undefined && input.dimensionName !== null && { dimensionName: input.dimensionName }), + ...(input.operator !== undefined && input.operator !== null && { operator: input.operator }), }; }; const serializeAws_restJson1MetricToRetain = (input: MetricToRetain, context: __SerdeContext): any => { return { - ...(input.metric !== undefined && { metric: input.metric }), - ...(input.metricDimension !== undefined && { - metricDimension: serializeAws_restJson1MetricDimension(input.metricDimension, context), - }), + ...(input.metric !== undefined && input.metric !== null && { metric: input.metric }), + ...(input.metricDimension !== undefined && + input.metricDimension !== null && { + metricDimension: serializeAws_restJson1MetricDimension(input.metricDimension, context), + }), }; }; const serializeAws_restJson1MetricValue = (input: MetricValue, context: __SerdeContext): any => { return { - ...(input.cidrs !== undefined && { cidrs: serializeAws_restJson1Cidrs(input.cidrs, context) }), - ...(input.count !== undefined && { count: input.count }), - ...(input.ports !== undefined && { ports: serializeAws_restJson1Ports(input.ports, context) }), + ...(input.cidrs !== undefined && + input.cidrs !== null && { cidrs: serializeAws_restJson1Cidrs(input.cidrs, context) }), + ...(input.count !== undefined && input.count !== null && { count: input.count }), + ...(input.ports !== undefined && + input.ports !== null && { ports: serializeAws_restJson1Ports(input.ports, context) }), }; }; const serializeAws_restJson1MitigationActionNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1MitigationActionParams = (input: MitigationActionParams, context: __SerdeContext): any => { return { - ...(input.addThingsToThingGroupParams !== undefined && { - addThingsToThingGroupParams: serializeAws_restJson1AddThingsToThingGroupParams( - input.addThingsToThingGroupParams, - context - ), - }), - ...(input.enableIoTLoggingParams !== undefined && { - enableIoTLoggingParams: serializeAws_restJson1EnableIoTLoggingParams(input.enableIoTLoggingParams, context), - }), - ...(input.publishFindingToSnsParams !== undefined && { - publishFindingToSnsParams: serializeAws_restJson1PublishFindingToSnsParams( - input.publishFindingToSnsParams, - context - ), - }), - ...(input.replaceDefaultPolicyVersionParams !== undefined && { - replaceDefaultPolicyVersionParams: serializeAws_restJson1ReplaceDefaultPolicyVersionParams( - input.replaceDefaultPolicyVersionParams, - context - ), - }), - ...(input.updateCACertificateParams !== undefined && { - updateCACertificateParams: serializeAws_restJson1UpdateCACertificateParams( - input.updateCACertificateParams, - context - ), - }), - ...(input.updateDeviceCertificateParams !== undefined && { - updateDeviceCertificateParams: serializeAws_restJson1UpdateDeviceCertificateParams( - input.updateDeviceCertificateParams, - context - ), - }), + ...(input.addThingsToThingGroupParams !== undefined && + input.addThingsToThingGroupParams !== null && { + addThingsToThingGroupParams: serializeAws_restJson1AddThingsToThingGroupParams( + input.addThingsToThingGroupParams, + context + ), + }), + ...(input.enableIoTLoggingParams !== undefined && + input.enableIoTLoggingParams !== null && { + enableIoTLoggingParams: serializeAws_restJson1EnableIoTLoggingParams(input.enableIoTLoggingParams, context), + }), + ...(input.publishFindingToSnsParams !== undefined && + input.publishFindingToSnsParams !== null && { + publishFindingToSnsParams: serializeAws_restJson1PublishFindingToSnsParams( + input.publishFindingToSnsParams, + context + ), + }), + ...(input.replaceDefaultPolicyVersionParams !== undefined && + input.replaceDefaultPolicyVersionParams !== null && { + replaceDefaultPolicyVersionParams: serializeAws_restJson1ReplaceDefaultPolicyVersionParams( + input.replaceDefaultPolicyVersionParams, + context + ), + }), + ...(input.updateCACertificateParams !== undefined && + input.updateCACertificateParams !== null && { + updateCACertificateParams: serializeAws_restJson1UpdateCACertificateParams( + input.updateCACertificateParams, + context + ), + }), + ...(input.updateDeviceCertificateParams !== undefined && + input.updateDeviceCertificateParams !== null && { + updateDeviceCertificateParams: serializeAws_restJson1UpdateDeviceCertificateParams( + input.updateDeviceCertificateParams, + context + ), + }), }; }; const serializeAws_restJson1MqttContext = (input: MqttContext, context: __SerdeContext): any => { return { - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.password !== undefined && { password: context.base64Encoder(input.password) }), - ...(input.username !== undefined && { username: input.username }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.password !== undefined && input.password !== null && { password: context.base64Encoder(input.password) }), + ...(input.username !== undefined && input.username !== null && { username: input.username }), }; }; const serializeAws_restJson1OTAUpdateFile = (input: OTAUpdateFile, context: __SerdeContext): any => { return { - ...(input.attributes !== undefined && { - attributes: serializeAws_restJson1AttributesMap(input.attributes, context), - }), - ...(input.codeSigning !== undefined && { - codeSigning: serializeAws_restJson1CodeSigning(input.codeSigning, context), - }), - ...(input.fileLocation !== undefined && { - fileLocation: serializeAws_restJson1FileLocation(input.fileLocation, context), - }), - ...(input.fileName !== undefined && { fileName: input.fileName }), - ...(input.fileType !== undefined && { fileType: input.fileType }), - ...(input.fileVersion !== undefined && { fileVersion: input.fileVersion }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_restJson1AttributesMap(input.attributes, context) }), + ...(input.codeSigning !== undefined && + input.codeSigning !== null && { codeSigning: serializeAws_restJson1CodeSigning(input.codeSigning, context) }), + ...(input.fileLocation !== undefined && + input.fileLocation !== null && { fileLocation: serializeAws_restJson1FileLocation(input.fileLocation, context) }), + ...(input.fileName !== undefined && input.fileName !== null && { fileName: input.fileName }), + ...(input.fileType !== undefined && input.fileType !== null && { fileType: input.fileType }), + ...(input.fileVersion !== undefined && input.fileVersion !== null && { fileVersion: input.fileVersion }), }; }; const serializeAws_restJson1OTAUpdateFiles = (input: OTAUpdateFile[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1OTAUpdateFile(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1OTAUpdateFile(entry, context); + }); }; const serializeAws_restJson1Parameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1PercentList = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1PolicyNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1PolicyVersionIdentifier = ( @@ -28482,41 +28604,59 @@ const serializeAws_restJson1PolicyVersionIdentifier = ( context: __SerdeContext ): any => { return { - ...(input.policyName !== undefined && { policyName: input.policyName }), - ...(input.policyVersionId !== undefined && { policyVersionId: input.policyVersionId }), + ...(input.policyName !== undefined && input.policyName !== null && { policyName: input.policyName }), + ...(input.policyVersionId !== undefined && + input.policyVersionId !== null && { policyVersionId: input.policyVersionId }), }; }; const serializeAws_restJson1Ports = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1PresignedUrlConfig = (input: PresignedUrlConfig, context: __SerdeContext): any => { return { - ...(input.expiresInSec !== undefined && { expiresInSec: input.expiresInSec }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.expiresInSec !== undefined && input.expiresInSec !== null && { expiresInSec: input.expiresInSec }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1Protocols = (input: (Protocol | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ProvisioningHook = (input: ProvisioningHook, context: __SerdeContext): any => { return { - ...(input.payloadVersion !== undefined && { payloadVersion: input.payloadVersion }), - ...(input.targetArn !== undefined && { targetArn: input.targetArn }), + ...(input.payloadVersion !== undefined && + input.payloadVersion !== null && { payloadVersion: input.payloadVersion }), + ...(input.targetArn !== undefined && input.targetArn !== null && { targetArn: input.targetArn }), }; }; const serializeAws_restJson1PublicKeyMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1PublishFindingToSnsParams = ( @@ -28524,7 +28664,7 @@ const serializeAws_restJson1PublishFindingToSnsParams = ( context: __SerdeContext ): any => { return { - ...(input.topicArn !== undefined && { topicArn: input.topicArn }), + ...(input.topicArn !== undefined && input.topicArn !== null && { topicArn: input.topicArn }), }; }; @@ -28533,13 +28673,14 @@ const serializeAws_restJson1PutAssetPropertyValueEntry = ( context: __SerdeContext ): any => { return { - ...(input.assetId !== undefined && { assetId: input.assetId }), - ...(input.entryId !== undefined && { entryId: input.entryId }), - ...(input.propertyAlias !== undefined && { propertyAlias: input.propertyAlias }), - ...(input.propertyId !== undefined && { propertyId: input.propertyId }), - ...(input.propertyValues !== undefined && { - propertyValues: serializeAws_restJson1AssetPropertyValueList(input.propertyValues, context), - }), + ...(input.assetId !== undefined && input.assetId !== null && { assetId: input.assetId }), + ...(input.entryId !== undefined && input.entryId !== null && { entryId: input.entryId }), + ...(input.propertyAlias !== undefined && input.propertyAlias !== null && { propertyAlias: input.propertyAlias }), + ...(input.propertyId !== undefined && input.propertyId !== null && { propertyId: input.propertyId }), + ...(input.propertyValues !== undefined && + input.propertyValues !== null && { + propertyValues: serializeAws_restJson1AssetPropertyValueList(input.propertyValues, context), + }), }; }; @@ -28547,30 +28688,46 @@ const serializeAws_restJson1PutAssetPropertyValueEntryList = ( input: PutAssetPropertyValueEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1PutAssetPropertyValueEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1PutAssetPropertyValueEntry(entry, context); + }); }; const serializeAws_restJson1PutItemInput = (input: PutItemInput, context: __SerdeContext): any => { return { - ...(input.tableName !== undefined && { tableName: input.tableName }), + ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }), }; }; const serializeAws_restJson1RateIncreaseCriteria = (input: RateIncreaseCriteria, context: __SerdeContext): any => { return { - ...(input.numberOfNotifiedThings !== undefined && { numberOfNotifiedThings: input.numberOfNotifiedThings }), - ...(input.numberOfSucceededThings !== undefined && { numberOfSucceededThings: input.numberOfSucceededThings }), + ...(input.numberOfNotifiedThings !== undefined && + input.numberOfNotifiedThings !== null && { numberOfNotifiedThings: input.numberOfNotifiedThings }), + ...(input.numberOfSucceededThings !== undefined && + input.numberOfSucceededThings !== null && { numberOfSucceededThings: input.numberOfSucceededThings }), }; }; const serializeAws_restJson1ReasonForNonComplianceCodes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1RegistrationConfig = (input: RegistrationConfig, context: __SerdeContext): any => { return { - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.templateBody !== undefined && { templateBody: input.templateBody }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.templateBody !== undefined && input.templateBody !== null && { templateBody: input.templateBody }), }; }; @@ -28579,74 +28736,99 @@ const serializeAws_restJson1ReplaceDefaultPolicyVersionParams = ( context: __SerdeContext ): any => { return { - ...(input.templateName !== undefined && { templateName: input.templateName }), + ...(input.templateName !== undefined && input.templateName !== null && { templateName: input.templateName }), }; }; const serializeAws_restJson1RepublishAction = (input: RepublishAction, context: __SerdeContext): any => { return { - ...(input.qos !== undefined && { qos: input.qos }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.topic !== undefined && { topic: input.topic }), + ...(input.qos !== undefined && input.qos !== null && { qos: input.qos }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.topic !== undefined && input.topic !== null && { topic: input.topic }), }; }; const serializeAws_restJson1ResourceIdentifier = (input: ResourceIdentifier, context: __SerdeContext): any => { return { - ...(input.account !== undefined && { account: input.account }), - ...(input.caCertificateId !== undefined && { caCertificateId: input.caCertificateId }), - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.cognitoIdentityPoolId !== undefined && { cognitoIdentityPoolId: input.cognitoIdentityPoolId }), - ...(input.deviceCertificateId !== undefined && { deviceCertificateId: input.deviceCertificateId }), - ...(input.iamRoleArn !== undefined && { iamRoleArn: input.iamRoleArn }), - ...(input.policyVersionIdentifier !== undefined && { - policyVersionIdentifier: serializeAws_restJson1PolicyVersionIdentifier(input.policyVersionIdentifier, context), - }), - ...(input.roleAliasArn !== undefined && { roleAliasArn: input.roleAliasArn }), + ...(input.account !== undefined && input.account !== null && { account: input.account }), + ...(input.caCertificateId !== undefined && + input.caCertificateId !== null && { caCertificateId: input.caCertificateId }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.cognitoIdentityPoolId !== undefined && + input.cognitoIdentityPoolId !== null && { cognitoIdentityPoolId: input.cognitoIdentityPoolId }), + ...(input.deviceCertificateId !== undefined && + input.deviceCertificateId !== null && { deviceCertificateId: input.deviceCertificateId }), + ...(input.iamRoleArn !== undefined && input.iamRoleArn !== null && { iamRoleArn: input.iamRoleArn }), + ...(input.policyVersionIdentifier !== undefined && + input.policyVersionIdentifier !== null && { + policyVersionIdentifier: serializeAws_restJson1PolicyVersionIdentifier(input.policyVersionIdentifier, context), + }), + ...(input.roleAliasArn !== undefined && input.roleAliasArn !== null && { roleAliasArn: input.roleAliasArn }), }; }; const serializeAws_restJson1Resources = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1S3Action = (input: S3Action, context: __SerdeContext): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.cannedAcl !== undefined && { cannedAcl: input.cannedAcl }), - ...(input.key !== undefined && { key: input.key }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.cannedAcl !== undefined && input.cannedAcl !== null && { cannedAcl: input.cannedAcl }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1S3Destination = (input: S3Destination, context: __SerdeContext): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.prefix !== undefined && { prefix: input.prefix }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }), }; }; const serializeAws_restJson1S3Location = (input: S3Location, context: __SerdeContext): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.key !== undefined && { key: input.key }), - ...(input.version !== undefined && { version: input.version }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_restJson1SalesforceAction = (input: SalesforceAction, context: __SerdeContext): any => { return { - ...(input.token !== undefined && { token: input.token }), - ...(input.url !== undefined && { url: input.url }), + ...(input.token !== undefined && input.token !== null && { token: input.token }), + ...(input.url !== undefined && input.url !== null && { url: input.url }), }; }; const serializeAws_restJson1SearchableAttributes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ServerCertificateArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SigningProfileParameter = ( @@ -28654,33 +28836,35 @@ const serializeAws_restJson1SigningProfileParameter = ( context: __SerdeContext ): any => { return { - ...(input.certificateArn !== undefined && { certificateArn: input.certificateArn }), - ...(input.certificatePathOnDevice !== undefined && { certificatePathOnDevice: input.certificatePathOnDevice }), - ...(input.platform !== undefined && { platform: input.platform }), + ...(input.certificateArn !== undefined && + input.certificateArn !== null && { certificateArn: input.certificateArn }), + ...(input.certificatePathOnDevice !== undefined && + input.certificatePathOnDevice !== null && { certificatePathOnDevice: input.certificatePathOnDevice }), + ...(input.platform !== undefined && input.platform !== null && { platform: input.platform }), }; }; const serializeAws_restJson1SigV4Authorization = (input: SigV4Authorization, context: __SerdeContext): any => { return { - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), - ...(input.signingRegion !== undefined && { signingRegion: input.signingRegion }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), + ...(input.signingRegion !== undefined && input.signingRegion !== null && { signingRegion: input.signingRegion }), }; }; const serializeAws_restJson1SnsAction = (input: SnsAction, context: __SerdeContext): any => { return { - ...(input.messageFormat !== undefined && { messageFormat: input.messageFormat }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.targetArn !== undefined && { targetArn: input.targetArn }), + ...(input.messageFormat !== undefined && input.messageFormat !== null && { messageFormat: input.messageFormat }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.targetArn !== undefined && input.targetArn !== null && { targetArn: input.targetArn }), }; }; const serializeAws_restJson1SqsAction = (input: SqsAction, context: __SerdeContext): any => { return { - ...(input.queueUrl !== undefined && { queueUrl: input.queueUrl }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.useBase64 !== undefined && { useBase64: input.useBase64 }), + ...(input.queueUrl !== undefined && input.queueUrl !== null && { queueUrl: input.queueUrl }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.useBase64 !== undefined && input.useBase64 !== null && { useBase64: input.useBase64 }), }; }; @@ -28689,69 +28873,108 @@ const serializeAws_restJson1StartSigningJobParameter = ( context: __SerdeContext ): any => { return { - ...(input.destination !== undefined && { - destination: serializeAws_restJson1Destination(input.destination, context), - }), - ...(input.signingProfileName !== undefined && { signingProfileName: input.signingProfileName }), - ...(input.signingProfileParameter !== undefined && { - signingProfileParameter: serializeAws_restJson1SigningProfileParameter(input.signingProfileParameter, context), - }), + ...(input.destination !== undefined && + input.destination !== null && { destination: serializeAws_restJson1Destination(input.destination, context) }), + ...(input.signingProfileName !== undefined && + input.signingProfileName !== null && { signingProfileName: input.signingProfileName }), + ...(input.signingProfileParameter !== undefined && + input.signingProfileParameter !== null && { + signingProfileParameter: serializeAws_restJson1SigningProfileParameter(input.signingProfileParameter, context), + }), }; }; const serializeAws_restJson1StatisticalThreshold = (input: StatisticalThreshold, context: __SerdeContext): any => { return { - ...(input.statistic !== undefined && { statistic: input.statistic }), + ...(input.statistic !== undefined && input.statistic !== null && { statistic: input.statistic }), }; }; const serializeAws_restJson1StepFunctionsAction = (input: StepFunctionsAction, context: __SerdeContext): any => { return { - ...(input.executionNamePrefix !== undefined && { executionNamePrefix: input.executionNamePrefix }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.stateMachineName !== undefined && { stateMachineName: input.stateMachineName }), + ...(input.executionNamePrefix !== undefined && + input.executionNamePrefix !== null && { executionNamePrefix: input.executionNamePrefix }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.stateMachineName !== undefined && + input.stateMachineName !== null && { stateMachineName: input.stateMachineName }), }; }; const serializeAws_restJson1_Stream = (input: _Stream, context: __SerdeContext): any => { return { - ...(input.fileId !== undefined && { fileId: input.fileId }), - ...(input.streamId !== undefined && { streamId: input.streamId }), + ...(input.fileId !== undefined && input.fileId !== null && { fileId: input.fileId }), + ...(input.streamId !== undefined && input.streamId !== null && { streamId: input.streamId }), }; }; const serializeAws_restJson1StreamFile = (input: StreamFile, context: __SerdeContext): any => { return { - ...(input.fileId !== undefined && { fileId: input.fileId }), - ...(input.s3Location !== undefined && { s3Location: serializeAws_restJson1S3Location(input.s3Location, context) }), + ...(input.fileId !== undefined && input.fileId !== null && { fileId: input.fileId }), + ...(input.s3Location !== undefined && + input.s3Location !== null && { s3Location: serializeAws_restJson1S3Location(input.s3Location, context) }), }; }; const serializeAws_restJson1StreamFiles = (input: StreamFile[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1StreamFile(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1StreamFile(entry, context); + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TargetAuditCheckNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Targets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ThingGroupIndexingConfiguration = ( @@ -28759,30 +28982,45 @@ const serializeAws_restJson1ThingGroupIndexingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.customFields !== undefined && { - customFields: serializeAws_restJson1Fields(input.customFields, context), - }), - ...(input.managedFields !== undefined && { - managedFields: serializeAws_restJson1Fields(input.managedFields, context), - }), - ...(input.thingGroupIndexingMode !== undefined && { thingGroupIndexingMode: input.thingGroupIndexingMode }), + ...(input.customFields !== undefined && + input.customFields !== null && { customFields: serializeAws_restJson1Fields(input.customFields, context) }), + ...(input.managedFields !== undefined && + input.managedFields !== null && { managedFields: serializeAws_restJson1Fields(input.managedFields, context) }), + ...(input.thingGroupIndexingMode !== undefined && + input.thingGroupIndexingMode !== null && { thingGroupIndexingMode: input.thingGroupIndexingMode }), }; }; const serializeAws_restJson1ThingGroupList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ThingGroupNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ThingGroupProperties = (input: ThingGroupProperties, context: __SerdeContext): any => { return { - ...(input.attributePayload !== undefined && { - attributePayload: serializeAws_restJson1AttributePayload(input.attributePayload, context), - }), - ...(input.thingGroupDescription !== undefined && { thingGroupDescription: input.thingGroupDescription }), + ...(input.attributePayload !== undefined && + input.attributePayload !== null && { + attributePayload: serializeAws_restJson1AttributePayload(input.attributePayload, context), + }), + ...(input.thingGroupDescription !== undefined && + input.thingGroupDescription !== null && { thingGroupDescription: input.thingGroupDescription }), }; }; @@ -28791,71 +29029,79 @@ const serializeAws_restJson1ThingIndexingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.customFields !== undefined && { - customFields: serializeAws_restJson1Fields(input.customFields, context), - }), - ...(input.managedFields !== undefined && { - managedFields: serializeAws_restJson1Fields(input.managedFields, context), - }), - ...(input.thingConnectivityIndexingMode !== undefined && { - thingConnectivityIndexingMode: input.thingConnectivityIndexingMode, - }), - ...(input.thingIndexingMode !== undefined && { thingIndexingMode: input.thingIndexingMode }), + ...(input.customFields !== undefined && + input.customFields !== null && { customFields: serializeAws_restJson1Fields(input.customFields, context) }), + ...(input.managedFields !== undefined && + input.managedFields !== null && { managedFields: serializeAws_restJson1Fields(input.managedFields, context) }), + ...(input.thingConnectivityIndexingMode !== undefined && + input.thingConnectivityIndexingMode !== null && { + thingConnectivityIndexingMode: input.thingConnectivityIndexingMode, + }), + ...(input.thingIndexingMode !== undefined && + input.thingIndexingMode !== null && { thingIndexingMode: input.thingIndexingMode }), }; }; const serializeAws_restJson1ThingTypeProperties = (input: ThingTypeProperties, context: __SerdeContext): any => { return { - ...(input.searchableAttributes !== undefined && { - searchableAttributes: serializeAws_restJson1SearchableAttributes(input.searchableAttributes, context), - }), - ...(input.thingTypeDescription !== undefined && { thingTypeDescription: input.thingTypeDescription }), + ...(input.searchableAttributes !== undefined && + input.searchableAttributes !== null && { + searchableAttributes: serializeAws_restJson1SearchableAttributes(input.searchableAttributes, context), + }), + ...(input.thingTypeDescription !== undefined && + input.thingTypeDescription !== null && { thingTypeDescription: input.thingTypeDescription }), }; }; const serializeAws_restJson1TimeoutConfig = (input: TimeoutConfig, context: __SerdeContext): any => { return { - ...(input.inProgressTimeoutInMinutes !== undefined && { - inProgressTimeoutInMinutes: input.inProgressTimeoutInMinutes, - }), + ...(input.inProgressTimeoutInMinutes !== undefined && + input.inProgressTimeoutInMinutes !== null && { inProgressTimeoutInMinutes: input.inProgressTimeoutInMinutes }), }; }; const serializeAws_restJson1TimestreamAction = (input: TimestreamAction, context: __SerdeContext): any => { return { - ...(input.databaseName !== undefined && { databaseName: input.databaseName }), - ...(input.dimensions !== undefined && { - dimensions: serializeAws_restJson1TimestreamDimensionList(input.dimensions, context), - }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tableName !== undefined && { tableName: input.tableName }), - ...(input.timestamp !== undefined && { - timestamp: serializeAws_restJson1TimestreamTimestamp(input.timestamp, context), - }), + ...(input.databaseName !== undefined && input.databaseName !== null && { databaseName: input.databaseName }), + ...(input.dimensions !== undefined && + input.dimensions !== null && { + dimensions: serializeAws_restJson1TimestreamDimensionList(input.dimensions, context), + }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }), + ...(input.timestamp !== undefined && + input.timestamp !== null && { timestamp: serializeAws_restJson1TimestreamTimestamp(input.timestamp, context) }), }; }; const serializeAws_restJson1TimestreamDimension = (input: TimestreamDimension, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: input.value }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1TimestreamDimensionList = (input: TimestreamDimension[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1TimestreamDimension(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TimestreamDimension(entry, context); + }); }; const serializeAws_restJson1TimestreamTimestamp = (input: TimestreamTimestamp, context: __SerdeContext): any => { return { - ...(input.unit !== undefined && { unit: input.unit }), - ...(input.value !== undefined && { value: input.value }), + ...(input.unit !== undefined && input.unit !== null && { unit: input.unit }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1TlsContext = (input: TlsContext, context: __SerdeContext): any => { return { - ...(input.serverName !== undefined && { serverName: input.serverName }), + ...(input.serverName !== undefined && input.serverName !== null && { serverName: input.serverName }), }; }; @@ -28864,20 +29110,27 @@ const serializeAws_restJson1TopicRuleDestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.httpUrlConfiguration !== undefined && { - httpUrlConfiguration: serializeAws_restJson1HttpUrlDestinationConfiguration(input.httpUrlConfiguration, context), - }), + ...(input.httpUrlConfiguration !== undefined && + input.httpUrlConfiguration !== null && { + httpUrlConfiguration: serializeAws_restJson1HttpUrlDestinationConfiguration( + input.httpUrlConfiguration, + context + ), + }), }; }; const serializeAws_restJson1TopicRulePayload = (input: TopicRulePayload, context: __SerdeContext): any => { return { - ...(input.actions !== undefined && { actions: serializeAws_restJson1ActionList(input.actions, context) }), - ...(input.awsIotSqlVersion !== undefined && { awsIotSqlVersion: input.awsIotSqlVersion }), - ...(input.description !== undefined && { description: input.description }), - ...(input.errorAction !== undefined && { errorAction: serializeAws_restJson1Action(input.errorAction, context) }), - ...(input.ruleDisabled !== undefined && { ruleDisabled: input.ruleDisabled }), - ...(input.sql !== undefined && { sql: input.sql }), + ...(input.actions !== undefined && + input.actions !== null && { actions: serializeAws_restJson1ActionList(input.actions, context) }), + ...(input.awsIotSqlVersion !== undefined && + input.awsIotSqlVersion !== null && { awsIotSqlVersion: input.awsIotSqlVersion }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.errorAction !== undefined && + input.errorAction !== null && { errorAction: serializeAws_restJson1Action(input.errorAction, context) }), + ...(input.ruleDisabled !== undefined && input.ruleDisabled !== null && { ruleDisabled: input.ruleDisabled }), + ...(input.sql !== undefined && input.sql !== null && { sql: input.sql }), }; }; @@ -28886,7 +29139,7 @@ const serializeAws_restJson1UpdateCACertificateParams = ( context: __SerdeContext ): any => { return { - ...(input.action !== undefined && { action: input.action }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), }; }; @@ -28895,7 +29148,7 @@ const serializeAws_restJson1UpdateDeviceCertificateParams = ( context: __SerdeContext ): any => { return { - ...(input.action !== undefined && { action: input.action }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), }; }; @@ -28924,7 +29177,14 @@ const deserializeAws_restJson1AbortCriteria = (output: any, context: __SerdeCont }; const deserializeAws_restJson1AbortCriteriaList = (output: any, context: __SerdeContext): AbortCriteria[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AbortCriteria(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AbortCriteria(entry, context); + }); }; const deserializeAws_restJson1Action = (output: any, context: __SerdeContext): Action => { @@ -29011,7 +29271,14 @@ const deserializeAws_restJson1Action = (output: any, context: __SerdeContext): A }; const deserializeAws_restJson1ActionList = (output: any, context: __SerdeContext): Action[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Action(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Action(entry, context); + }); }; const deserializeAws_restJson1ActiveViolation = (output: any, context: __SerdeContext): ActiveViolation => { @@ -29042,31 +29309,54 @@ const deserializeAws_restJson1ActiveViolation = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ActiveViolations = (output: any, context: __SerdeContext): ActiveViolation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ActiveViolation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ActiveViolation(entry, context); + }); }; const deserializeAws_restJson1AdditionalMetricsToRetainList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AdditionalMetricsToRetainV2List = ( output: any, context: __SerdeContext ): MetricToRetain[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MetricToRetain(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MetricToRetain(entry, context); + }); }; const deserializeAws_restJson1AdditionalParameterMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AddThingsToThingGroupParams = ( @@ -29095,10 +29385,15 @@ const deserializeAws_restJson1AlertTarget = (output: any, context: __SerdeContex const deserializeAws_restJson1AlertTargets = (output: any, context: __SerdeContext): { [key: string]: AlertTarget } => { return Object.entries(output).reduce( - (acc: { [key: string]: AlertTarget }, [key, value]: [AlertTargetType | string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1AlertTarget(value, context), - }), + (acc: { [key: string]: AlertTarget }, [key, value]: [AlertTargetType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1AlertTarget(value, context), + }; + }, {} ); }; @@ -29139,7 +29434,14 @@ const deserializeAws_restJson1AssetPropertyValue = (output: any, context: __Serd }; const deserializeAws_restJson1AssetPropertyValueList = (output: any, context: __SerdeContext): AssetPropertyValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetPropertyValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetPropertyValue(entry, context); + }); }; const deserializeAws_restJson1AssetPropertyVariant = (output: any, context: __SerdeContext): AssetPropertyVariant => { @@ -29177,23 +29479,27 @@ const deserializeAws_restJson1AttributePayload = (output: any, context: __SerdeC }; const deserializeAws_restJson1Attributes = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AttributesMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AuditCheckConfiguration = ( @@ -29210,10 +29516,15 @@ const deserializeAws_restJson1AuditCheckConfigurations = ( context: __SerdeContext ): { [key: string]: AuditCheckConfiguration } => { return Object.entries(output).reduce( - (acc: { [key: string]: AuditCheckConfiguration }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1AuditCheckConfiguration(value, context), - }), + (acc: { [key: string]: AuditCheckConfiguration }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1AuditCheckConfiguration(value, context), + }; + }, {} ); }; @@ -29245,39 +29556,45 @@ const deserializeAws_restJson1AuditCheckToActionsMapping = ( output: any, context: __SerdeContext ): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1MitigationActionNameList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AuditCheckToReasonCodeFilter = ( output: any, context: __SerdeContext ): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ReasonForNonComplianceCodes(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AuditDetails = ( output: any, context: __SerdeContext ): { [key: string]: AuditCheckDetails } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AuditCheckDetails }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AuditCheckDetails }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1AuditCheckDetails(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AuditFinding = (output: any, context: __SerdeContext): AuditFinding => { @@ -29315,7 +29632,14 @@ const deserializeAws_restJson1AuditFinding = (output: any, context: __SerdeConte }; const deserializeAws_restJson1AuditFindings = (output: any, context: __SerdeContext): AuditFinding[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AuditFinding(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AuditFinding(entry, context); + }); }; const deserializeAws_restJson1AuditMitigationActionExecutionMetadata = ( @@ -29343,9 +29667,14 @@ const deserializeAws_restJson1AuditMitigationActionExecutionMetadataList = ( output: any, context: __SerdeContext ): AuditMitigationActionExecutionMetadata[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AuditMitigationActionExecutionMetadata(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AuditMitigationActionExecutionMetadata(entry, context); + }); }; const deserializeAws_restJson1AuditMitigationActionsTaskMetadata = ( @@ -29366,7 +29695,14 @@ const deserializeAws_restJson1AuditMitigationActionsTaskMetadataList = ( output: any, context: __SerdeContext ): AuditMitigationActionsTaskMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AuditMitigationActionsTaskMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AuditMitigationActionsTaskMetadata(entry, context); + }); }; const deserializeAws_restJson1AuditMitigationActionsTaskStatistics = ( @@ -29374,10 +29710,15 @@ const deserializeAws_restJson1AuditMitigationActionsTaskStatistics = ( context: __SerdeContext ): { [key: string]: TaskStatisticsForAuditCheck } => { return Object.entries(output).reduce( - (acc: { [key: string]: TaskStatisticsForAuditCheck }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1TaskStatisticsForAuditCheck(value, context), - }), + (acc: { [key: string]: TaskStatisticsForAuditCheck }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1TaskStatisticsForAuditCheck(value, context), + }; + }, {} ); }; @@ -29415,10 +29756,15 @@ const deserializeAws_restJson1AuditNotificationTargetConfigurations = ( context: __SerdeContext ): { [key: string]: AuditNotificationTarget } => { return Object.entries(output).reduce( - (acc: { [key: string]: AuditNotificationTarget }, [key, value]: [AuditNotificationType | string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1AuditNotificationTarget(value, context), - }), + (acc: { [key: string]: AuditNotificationTarget }, [key, value]: [AuditNotificationType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1AuditNotificationTarget(value, context), + }; + }, {} ); }; @@ -29443,7 +29789,14 @@ const deserializeAws_restJson1AuditSuppression = (output: any, context: __SerdeC }; const deserializeAws_restJson1AuditSuppressionList = (output: any, context: __SerdeContext): AuditSuppression[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AuditSuppression(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AuditSuppression(entry, context); + }); }; const deserializeAws_restJson1AuditTaskMetadata = (output: any, context: __SerdeContext): AuditTaskMetadata => { @@ -29455,7 +29808,14 @@ const deserializeAws_restJson1AuditTaskMetadata = (output: any, context: __Serde }; const deserializeAws_restJson1AuditTaskMetadataList = (output: any, context: __SerdeContext): AuditTaskMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AuditTaskMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AuditTaskMetadata(entry, context); + }); }; const deserializeAws_restJson1AuthInfo = (output: any, context: __SerdeContext): AuthInfo => { @@ -29511,7 +29871,14 @@ const deserializeAws_restJson1AuthorizerDescription = (output: any, context: __S }; const deserializeAws_restJson1Authorizers = (output: any, context: __SerdeContext): AuthorizerSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AuthorizerSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AuthorizerSummary(entry, context); + }); }; const deserializeAws_restJson1AuthorizerSummary = (output: any, context: __SerdeContext): AuthorizerSummary => { @@ -29546,7 +29913,14 @@ const deserializeAws_restJson1AuthResult = (output: any, context: __SerdeContext }; const deserializeAws_restJson1AuthResults = (output: any, context: __SerdeContext): AuthResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AuthResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AuthResult(entry, context); + }); }; const deserializeAws_restJson1AwsJobExecutionsRolloutConfig = ( @@ -29649,7 +30023,14 @@ const deserializeAws_restJson1BehaviorCriteria = (output: any, context: __SerdeC }; const deserializeAws_restJson1Behaviors = (output: any, context: __SerdeContext): Behavior[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Behavior(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Behavior(entry, context); + }); }; const deserializeAws_restJson1BillingGroupMetadata = (output: any, context: __SerdeContext): BillingGroupMetadata => { @@ -29665,7 +30046,14 @@ const deserializeAws_restJson1BillingGroupNameAndArnList = ( output: any, context: __SerdeContext ): GroupNameAndArn[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupNameAndArn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupNameAndArn(entry, context); + }); }; const deserializeAws_restJson1BillingGroupProperties = ( @@ -29730,7 +30118,14 @@ const deserializeAws_restJson1CACertificateDescription = ( }; const deserializeAws_restJson1CACertificates = (output: any, context: __SerdeContext): CACertificate[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CACertificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CACertificate(entry, context); + }); }; const deserializeAws_restJson1Certificate = (output: any, context: __SerdeContext): Certificate => { @@ -29791,7 +30186,14 @@ const deserializeAws_restJson1CertificateDescription = ( }; const deserializeAws_restJson1Certificates = (output: any, context: __SerdeContext): Certificate[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Certificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Certificate(entry, context); + }); }; const deserializeAws_restJson1CertificateValidity = (output: any, context: __SerdeContext): CertificateValidity => { @@ -29808,7 +30210,14 @@ const deserializeAws_restJson1CertificateValidity = (output: any, context: __Ser }; const deserializeAws_restJson1Cidrs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1CloudwatchAlarmAction = (output: any, context: __SerdeContext): CloudwatchAlarmAction => { @@ -29927,28 +30336,51 @@ const deserializeAws_restJson1Destination = (output: any, context: __SerdeContex }; const deserializeAws_restJson1DetailsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DimensionNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DimensionStringValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DomainConfigurations = ( output: any, context: __SerdeContext ): DomainConfigurationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainConfigurationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainConfigurationSummary(entry, context); + }); }; const deserializeAws_restJson1DomainConfigurationSummary = ( @@ -29996,7 +30428,14 @@ const deserializeAws_restJson1DynamoDBv2Action = (output: any, context: __SerdeC }; const deserializeAws_restJson1EffectivePolicies = (output: any, context: __SerdeContext): EffectivePolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EffectivePolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EffectivePolicy(entry, context); + }); }; const deserializeAws_restJson1EffectivePolicy = (output: any, context: __SerdeContext): EffectivePolicy => { @@ -30043,10 +30482,15 @@ const deserializeAws_restJson1EventConfigurations = ( context: __SerdeContext ): { [key: string]: Configuration } => { return Object.entries(output).reduce( - (acc: { [key: string]: Configuration }, [key, value]: [EventType | string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1Configuration(value, context), - }), + (acc: { [key: string]: Configuration }, [key, value]: [EventType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1Configuration(value, context), + }; + }, {} ); }; @@ -30086,7 +30530,14 @@ const deserializeAws_restJson1Field = (output: any, context: __SerdeContext): Fi }; const deserializeAws_restJson1Fields = (output: any, context: __SerdeContext): Field[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Field(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Field(entry, context); + }); }; const deserializeAws_restJson1FileLocation = (output: any, context: __SerdeContext): FileLocation => { @@ -30103,7 +30554,14 @@ const deserializeAws_restJson1FileLocation = (output: any, context: __SerdeConte }; const deserializeAws_restJson1FindingIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1FirehoseAction = (output: any, context: __SerdeContext): FirehoseAction => { @@ -30126,7 +30584,14 @@ const deserializeAws_restJson1GroupNameAndArn = (output: any, context: __SerdeCo }; const deserializeAws_restJson1HeaderList = (output: any, context: __SerdeContext): HttpActionHeader[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HttpActionHeader(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HttpActionHeader(entry, context); + }); }; const deserializeAws_restJson1HttpAction = (output: any, context: __SerdeContext): HttpAction => { @@ -30191,7 +30656,14 @@ const deserializeAws_restJson1ImplicitDeny = (output: any, context: __SerdeConte }; const deserializeAws_restJson1IndexNamesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1IotAnalyticsAction = (output: any, context: __SerdeContext): IotAnalyticsAction => { @@ -30371,7 +30843,14 @@ const deserializeAws_restJson1JobExecutionSummaryForJobList = ( output: any, context: __SerdeContext ): JobExecutionSummaryForJob[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobExecutionSummaryForJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobExecutionSummaryForJob(entry, context); + }); }; const deserializeAws_restJson1JobExecutionSummaryForThing = ( @@ -30391,7 +30870,14 @@ const deserializeAws_restJson1JobExecutionSummaryForThingList = ( output: any, context: __SerdeContext ): JobExecutionSummaryForThing[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobExecutionSummaryForThing(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobExecutionSummaryForThing(entry, context); + }); }; const deserializeAws_restJson1JobProcessDetails = (output: any, context: __SerdeContext): JobProcessDetails => { @@ -30459,11 +30945,25 @@ const deserializeAws_restJson1JobSummary = (output: any, context: __SerdeContext }; const deserializeAws_restJson1JobSummaryList = (output: any, context: __SerdeContext): JobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobSummary(entry, context); + }); }; const deserializeAws_restJson1JobTargets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1KeyPair = (output: any, context: __SerdeContext): KeyPair => { @@ -30511,7 +31011,14 @@ const deserializeAws_restJson1LogTargetConfigurations = ( output: any, context: __SerdeContext ): LogTargetConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LogTargetConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LogTargetConfiguration(entry, context); + }); }; const deserializeAws_restJson1MetricDimension = (output: any, context: __SerdeContext): MetricDimension => { @@ -30547,7 +31054,14 @@ const deserializeAws_restJson1MetricValue = (output: any, context: __SerdeContex }; const deserializeAws_restJson1MissingContextValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1MitigationAction = (output: any, context: __SerdeContext): MitigationAction => { @@ -30580,15 +31094,36 @@ const deserializeAws_restJson1MitigationActionIdentifierList = ( output: any, context: __SerdeContext ): MitigationActionIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MitigationActionIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MitigationActionIdentifier(entry, context); + }); }; const deserializeAws_restJson1MitigationActionList = (output: any, context: __SerdeContext): MitigationAction[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MitigationAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MitigationAction(entry, context); + }); }; const deserializeAws_restJson1MitigationActionNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1MitigationActionParams = ( @@ -30658,7 +31193,14 @@ const deserializeAws_restJson1OTAUpdateFile = (output: any, context: __SerdeCont }; const deserializeAws_restJson1OTAUpdateFiles = (output: any, context: __SerdeContext): OTAUpdateFile[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OTAUpdateFile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OTAUpdateFile(entry, context); + }); }; const deserializeAws_restJson1OTAUpdateInfo = (output: any, context: __SerdeContext): OTAUpdateInfo => { @@ -30712,7 +31254,14 @@ const deserializeAws_restJson1OTAUpdateInfo = (output: any, context: __SerdeCont }; const deserializeAws_restJson1OTAUpdatesSummary = (output: any, context: __SerdeContext): OTAUpdateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OTAUpdateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OTAUpdateSummary(entry, context); + }); }; const deserializeAws_restJson1OTAUpdateSummary = (output: any, context: __SerdeContext): OTAUpdateSummary => { @@ -30748,11 +31297,25 @@ const deserializeAws_restJson1OutgoingCertificate = (output: any, context: __Ser }; const deserializeAws_restJson1OutgoingCertificates = (output: any, context: __SerdeContext): OutgoingCertificate[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutgoingCertificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutgoingCertificate(entry, context); + }); }; const deserializeAws_restJson1Percentiles = (output: any, context: __SerdeContext): PercentPair[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PercentPair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PercentPair(entry, context); + }); }; const deserializeAws_restJson1PercentPair = (output: any, context: __SerdeContext): PercentPair => { @@ -30763,7 +31326,14 @@ const deserializeAws_restJson1PercentPair = (output: any, context: __SerdeContex }; const deserializeAws_restJson1Policies = (output: any, context: __SerdeContext): Policy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Policy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Policy(entry, context); + }); }; const deserializeAws_restJson1Policy = (output: any, context: __SerdeContext): Policy => { @@ -30774,11 +31344,25 @@ const deserializeAws_restJson1Policy = (output: any, context: __SerdeContext): P }; const deserializeAws_restJson1PolicyDocuments = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1PolicyTargets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1PolicyVersion = (output: any, context: __SerdeContext): PolicyVersion => { @@ -30805,11 +31389,25 @@ const deserializeAws_restJson1PolicyVersionIdentifier = ( }; const deserializeAws_restJson1PolicyVersions = (output: any, context: __SerdeContext): PolicyVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PolicyVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PolicyVersion(entry, context); + }); }; const deserializeAws_restJson1Ports = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1PresignedUrlConfig = (output: any, context: __SerdeContext): PresignedUrlConfig => { @@ -30820,15 +31418,36 @@ const deserializeAws_restJson1PresignedUrlConfig = (output: any, context: __Serd }; const deserializeAws_restJson1Principals = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ProcessingTargetNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Protocols = (output: any, context: __SerdeContext): (Protocol | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ProvisioningHook = (output: any, context: __SerdeContext): ProvisioningHook => { @@ -30843,7 +31462,14 @@ const deserializeAws_restJson1ProvisioningTemplateListing = ( output: any, context: __SerdeContext ): ProvisioningTemplateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProvisioningTemplateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProvisioningTemplateSummary(entry, context); + }); }; const deserializeAws_restJson1ProvisioningTemplateSummary = ( @@ -30870,7 +31496,14 @@ const deserializeAws_restJson1ProvisioningTemplateVersionListing = ( output: any, context: __SerdeContext ): ProvisioningTemplateVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProvisioningTemplateVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProvisioningTemplateVersionSummary(entry, context); + }); }; const deserializeAws_restJson1ProvisioningTemplateVersionSummary = ( @@ -30889,13 +31522,15 @@ const deserializeAws_restJson1ProvisioningTemplateVersionSummary = ( }; const deserializeAws_restJson1PublicKeyMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1PublishFindingToSnsParams = ( @@ -30928,7 +31563,14 @@ const deserializeAws_restJson1PutAssetPropertyValueEntryList = ( output: any, context: __SerdeContext ): PutAssetPropertyValueEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PutAssetPropertyValueEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PutAssetPropertyValueEntry(entry, context); + }); }; const deserializeAws_restJson1PutItemInput = (output: any, context: __SerdeContext): PutItemInput => { @@ -30951,7 +31593,14 @@ const deserializeAws_restJson1RateIncreaseCriteria = (output: any, context: __Se }; const deserializeAws_restJson1ReasonForNonComplianceCodes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1RegistrationConfig = (output: any, context: __SerdeContext): RegistrationConfig => { @@ -30976,7 +31625,14 @@ const deserializeAws_restJson1RelatedResource = (output: any, context: __SerdeCo }; const deserializeAws_restJson1RelatedResources = (output: any, context: __SerdeContext): RelatedResource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RelatedResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RelatedResource(entry, context); + }); }; const deserializeAws_restJson1ReplaceDefaultPolicyVersionParams = ( @@ -30997,13 +31653,15 @@ const deserializeAws_restJson1RepublishAction = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ResourceArns = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ResourceIdentifier = (output: any, context: __SerdeContext): ResourceIdentifier => { @@ -31030,7 +31688,14 @@ const deserializeAws_restJson1ResourceIdentifier = (output: any, context: __Serd }; const deserializeAws_restJson1Resources = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1RoleAliasDescription = (output: any, context: __SerdeContext): RoleAliasDescription => { @@ -31055,7 +31720,14 @@ const deserializeAws_restJson1RoleAliasDescription = (output: any, context: __Se }; const deserializeAws_restJson1RoleAliases = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1S3Action = (output: any, context: __SerdeContext): S3Action => { @@ -31075,7 +31747,14 @@ const deserializeAws_restJson1S3Destination = (output: any, context: __SerdeCont }; const deserializeAws_restJson1S3FileUrlList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1S3Location = (output: any, context: __SerdeContext): S3Location => { @@ -31116,11 +31795,25 @@ const deserializeAws_restJson1ScheduledAuditMetadataList = ( output: any, context: __SerdeContext ): ScheduledAuditMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ScheduledAuditMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ScheduledAuditMetadata(entry, context); + }); }; const deserializeAws_restJson1SearchableAttributes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SecurityProfileIdentifier = ( @@ -31137,7 +31830,14 @@ const deserializeAws_restJson1SecurityProfileIdentifiers = ( output: any, context: __SerdeContext ): SecurityProfileIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SecurityProfileIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SecurityProfileIdentifier(entry, context); + }); }; const deserializeAws_restJson1SecurityProfileTarget = (output: any, context: __SerdeContext): SecurityProfileTarget => { @@ -31166,21 +31866,42 @@ const deserializeAws_restJson1SecurityProfileTargetMappings = ( output: any, context: __SerdeContext ): SecurityProfileTargetMapping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SecurityProfileTargetMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SecurityProfileTargetMapping(entry, context); + }); }; const deserializeAws_restJson1SecurityProfileTargets = ( output: any, context: __SerdeContext ): SecurityProfileTarget[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SecurityProfileTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SecurityProfileTarget(entry, context); + }); }; const deserializeAws_restJson1ServerCertificates = ( output: any, context: __SerdeContext ): ServerCertificateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ServerCertificateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ServerCertificateSummary(entry, context); + }); }; const deserializeAws_restJson1ServerCertificateSummary = ( @@ -31313,7 +32034,14 @@ const deserializeAws_restJson1StreamFile = (output: any, context: __SerdeContext }; const deserializeAws_restJson1StreamFiles = (output: any, context: __SerdeContext): StreamFile[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StreamFile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StreamFile(entry, context); + }); }; const deserializeAws_restJson1StreamInfo = (output: any, context: __SerdeContext): StreamInfo => { @@ -31340,7 +32068,14 @@ const deserializeAws_restJson1StreamInfo = (output: any, context: __SerdeContext }; const deserializeAws_restJson1StreamsSummary = (output: any, context: __SerdeContext): StreamSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StreamSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StreamSummary(entry, context); + }); }; const deserializeAws_restJson1StreamSummary = (output: any, context: __SerdeContext): StreamSummary => { @@ -31354,13 +32089,15 @@ const deserializeAws_restJson1StreamSummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1StringMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -31371,19 +32108,47 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TargetAuditCheckNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Targets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TaskIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TaskStatistics = (output: any, context: __SerdeContext): TaskStatistics => { @@ -31450,7 +32215,14 @@ const deserializeAws_restJson1ThingAttribute = (output: any, context: __SerdeCon }; const deserializeAws_restJson1ThingAttributeList = (output: any, context: __SerdeContext): ThingAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThingAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThingAttribute(entry, context); + }); }; const deserializeAws_restJson1ThingConnectivity = (output: any, context: __SerdeContext): ThingConnectivity => { @@ -31483,7 +32255,14 @@ const deserializeAws_restJson1ThingDocument = (output: any, context: __SerdeCont }; const deserializeAws_restJson1ThingDocumentList = (output: any, context: __SerdeContext): ThingDocument[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThingDocument(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThingDocument(entry, context); + }); }; const deserializeAws_restJson1ThingGroupDocument = (output: any, context: __SerdeContext): ThingGroupDocument => { @@ -31507,7 +32286,14 @@ const deserializeAws_restJson1ThingGroupDocument = (output: any, context: __Serd }; const deserializeAws_restJson1ThingGroupDocumentList = (output: any, context: __SerdeContext): ThingGroupDocument[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThingGroupDocument(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThingGroupDocument(entry, context); + }); }; const deserializeAws_restJson1ThingGroupIndexingConfiguration = ( @@ -31546,15 +32332,36 @@ const deserializeAws_restJson1ThingGroupMetadata = (output: any, context: __Serd }; const deserializeAws_restJson1ThingGroupNameAndArnList = (output: any, context: __SerdeContext): GroupNameAndArn[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupNameAndArn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupNameAndArn(entry, context); + }); }; const deserializeAws_restJson1ThingGroupNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ThingGroupNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ThingGroupProperties = (output: any, context: __SerdeContext): ThingGroupProperties => { @@ -31595,7 +32402,14 @@ const deserializeAws_restJson1ThingIndexingConfiguration = ( }; const deserializeAws_restJson1ThingNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ThingTypeDefinition = (output: any, context: __SerdeContext): ThingTypeDefinition => { @@ -31615,7 +32429,14 @@ const deserializeAws_restJson1ThingTypeDefinition = (output: any, context: __Ser }; const deserializeAws_restJson1ThingTypeList = (output: any, context: __SerdeContext): ThingTypeDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThingTypeDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThingTypeDefinition(entry, context); + }); }; const deserializeAws_restJson1ThingTypeMetadata = (output: any, context: __SerdeContext): ThingTypeMetadata => { @@ -31681,7 +32502,14 @@ const deserializeAws_restJson1TimestreamDimensionList = ( output: any, context: __SerdeContext ): TimestreamDimension[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TimestreamDimension(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TimestreamDimension(entry, context); + }); }; const deserializeAws_restJson1TimestreamTimestamp = (output: any, context: __SerdeContext): TimestreamTimestamp => { @@ -31730,7 +32558,14 @@ const deserializeAws_restJson1TopicRuleDestinationSummaries = ( output: any, context: __SerdeContext ): TopicRuleDestinationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TopicRuleDestinationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TopicRuleDestinationSummary(entry, context); + }); }; const deserializeAws_restJson1TopicRuleDestinationSummary = ( @@ -31749,7 +32584,14 @@ const deserializeAws_restJson1TopicRuleDestinationSummary = ( }; const deserializeAws_restJson1TopicRuleList = (output: any, context: __SerdeContext): TopicRuleListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TopicRuleListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TopicRuleListItem(entry, context); + }); }; const deserializeAws_restJson1TopicRuleListItem = (output: any, context: __SerdeContext): TopicRuleListItem => { @@ -31810,7 +32652,14 @@ const deserializeAws_restJson1ValidationError = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ValidationErrors = (output: any, context: __SerdeContext): ValidationError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ValidationError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ValidationError(entry, context); + }); }; const deserializeAws_restJson1ViolationEvent = (output: any, context: __SerdeContext): ViolationEvent => { @@ -31841,7 +32690,14 @@ const deserializeAws_restJson1ViolationEvent = (output: any, context: __SerdeCon }; const deserializeAws_restJson1ViolationEvents = (output: any, context: __SerdeContext): ViolationEvent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ViolationEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ViolationEvent(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -31864,6 +32720,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iotanalytics/protocols/Aws_restJson1.ts b/clients/client-iotanalytics/protocols/Aws_restJson1.ts index 4d6e7b4b4de0..afba981a4cf0 100644 --- a/clients/client-iotanalytics/protocols/Aws_restJson1.ts +++ b/clients/client-iotanalytics/protocols/Aws_restJson1.ts @@ -147,13 +147,14 @@ export const serializeAws_restJson1BatchPutMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/messages/batch"; let body: any; body = JSON.stringify({ - ...(input.channelName !== undefined && { channelName: input.channelName }), - ...(input.messages !== undefined && { messages: serializeAws_restJson1Messages(input.messages, context) }), + ...(input.channelName !== undefined && input.channelName !== null && { channelName: input.channelName }), + ...(input.messages !== undefined && + input.messages !== null && { messages: serializeAws_restJson1Messages(input.messages, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -171,9 +172,7 @@ export const serializeAws_restJson1CancelPipelineReprocessingCommand = async ( input: CancelPipelineReprocessingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/pipelines/{pipelineName}/reprocessing/{reprocessingId}"; if (input.pipelineName !== undefined) { const labelValue: string = input.pipelineName; @@ -211,19 +210,22 @@ export const serializeAws_restJson1CreateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels"; let body: any; body = JSON.stringify({ - ...(input.channelName !== undefined && { channelName: input.channelName }), - ...(input.channelStorage !== undefined && { - channelStorage: serializeAws_restJson1ChannelStorage(input.channelStorage, context), - }), - ...(input.retentionPeriod !== undefined && { - retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.channelName !== undefined && input.channelName !== null && { channelName: input.channelName }), + ...(input.channelStorage !== undefined && + input.channelStorage !== null && { + channelStorage: serializeAws_restJson1ChannelStorage(input.channelStorage, context), + }), + ...(input.retentionPeriod !== undefined && + input.retentionPeriod !== null && { + retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -242,27 +244,34 @@ export const serializeAws_restJson1CreateDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/datasets"; let body: any; body = JSON.stringify({ - ...(input.actions !== undefined && { actions: serializeAws_restJson1DatasetActions(input.actions, context) }), - ...(input.contentDeliveryRules !== undefined && { - contentDeliveryRules: serializeAws_restJson1DatasetContentDeliveryRules(input.contentDeliveryRules, context), - }), - ...(input.datasetName !== undefined && { datasetName: input.datasetName }), - ...(input.lateDataRules !== undefined && { - lateDataRules: serializeAws_restJson1LateDataRules(input.lateDataRules, context), - }), - ...(input.retentionPeriod !== undefined && { - retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.triggers !== undefined && { triggers: serializeAws_restJson1DatasetTriggers(input.triggers, context) }), - ...(input.versioningConfiguration !== undefined && { - versioningConfiguration: serializeAws_restJson1VersioningConfiguration(input.versioningConfiguration, context), - }), + ...(input.actions !== undefined && + input.actions !== null && { actions: serializeAws_restJson1DatasetActions(input.actions, context) }), + ...(input.contentDeliveryRules !== undefined && + input.contentDeliveryRules !== null && { + contentDeliveryRules: serializeAws_restJson1DatasetContentDeliveryRules(input.contentDeliveryRules, context), + }), + ...(input.datasetName !== undefined && input.datasetName !== null && { datasetName: input.datasetName }), + ...(input.lateDataRules !== undefined && + input.lateDataRules !== null && { + lateDataRules: serializeAws_restJson1LateDataRules(input.lateDataRules, context), + }), + ...(input.retentionPeriod !== undefined && + input.retentionPeriod !== null && { + retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.triggers !== undefined && + input.triggers !== null && { triggers: serializeAws_restJson1DatasetTriggers(input.triggers, context) }), + ...(input.versioningConfiguration !== undefined && + input.versioningConfiguration !== null && { + versioningConfiguration: serializeAws_restJson1VersioningConfiguration(input.versioningConfiguration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -281,7 +290,7 @@ export const serializeAws_restJson1CreateDatasetContentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/datasets/{datasetName}/content"; if (input.datasetName !== undefined) { @@ -295,7 +304,7 @@ export const serializeAws_restJson1CreateDatasetContentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.versionId !== undefined && { versionId: input.versionId }), + ...(input.versionId !== undefined && input.versionId !== null && { versionId: input.versionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -314,19 +323,22 @@ export const serializeAws_restJson1CreateDatastoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/datastores"; let body: any; body = JSON.stringify({ - ...(input.datastoreName !== undefined && { datastoreName: input.datastoreName }), - ...(input.datastoreStorage !== undefined && { - datastoreStorage: serializeAws_restJson1DatastoreStorage(input.datastoreStorage, context), - }), - ...(input.retentionPeriod !== undefined && { - retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.datastoreName !== undefined && input.datastoreName !== null && { datastoreName: input.datastoreName }), + ...(input.datastoreStorage !== undefined && + input.datastoreStorage !== null && { + datastoreStorage: serializeAws_restJson1DatastoreStorage(input.datastoreStorage, context), + }), + ...(input.retentionPeriod !== undefined && + input.retentionPeriod !== null && { + retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -345,16 +357,18 @@ export const serializeAws_restJson1CreatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/pipelines"; let body: any; body = JSON.stringify({ - ...(input.pipelineActivities !== undefined && { - pipelineActivities: serializeAws_restJson1PipelineActivities(input.pipelineActivities, context), - }), - ...(input.pipelineName !== undefined && { pipelineName: input.pipelineName }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.pipelineActivities !== undefined && + input.pipelineActivities !== null && { + pipelineActivities: serializeAws_restJson1PipelineActivities(input.pipelineActivities, context), + }), + ...(input.pipelineName !== undefined && input.pipelineName !== null && { pipelineName: input.pipelineName }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -372,9 +386,7 @@ export const serializeAws_restJson1DeleteChannelCommand = async ( input: DeleteChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{channelName}"; if (input.channelName !== undefined) { const labelValue: string = input.channelName; @@ -402,9 +414,7 @@ export const serializeAws_restJson1DeleteDatasetCommand = async ( input: DeleteDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datasets/{datasetName}"; if (input.datasetName !== undefined) { const labelValue: string = input.datasetName; @@ -432,9 +442,7 @@ export const serializeAws_restJson1DeleteDatasetContentCommand = async ( input: DeleteDatasetContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datasets/{datasetName}/content"; if (input.datasetName !== undefined) { const labelValue: string = input.datasetName; @@ -466,9 +474,7 @@ export const serializeAws_restJson1DeleteDatastoreCommand = async ( input: DeleteDatastoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datastores/{datastoreName}"; if (input.datastoreName !== undefined) { const labelValue: string = input.datastoreName; @@ -496,9 +502,7 @@ export const serializeAws_restJson1DeletePipelineCommand = async ( input: DeletePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/pipelines/{pipelineName}"; if (input.pipelineName !== undefined) { const labelValue: string = input.pipelineName; @@ -526,9 +530,7 @@ export const serializeAws_restJson1DescribeChannelCommand = async ( input: DescribeChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{channelName}"; if (input.channelName !== undefined) { const labelValue: string = input.channelName; @@ -560,9 +562,7 @@ export const serializeAws_restJson1DescribeDatasetCommand = async ( input: DescribeDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datasets/{datasetName}"; if (input.datasetName !== undefined) { const labelValue: string = input.datasetName; @@ -590,9 +590,7 @@ export const serializeAws_restJson1DescribeDatastoreCommand = async ( input: DescribeDatastoreCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datastores/{datastoreName}"; if (input.datastoreName !== undefined) { const labelValue: string = input.datastoreName; @@ -624,12 +622,10 @@ export const serializeAws_restJson1DescribeLoggingOptionsCommand = async ( input: DescribeLoggingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/logging"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -646,9 +642,7 @@ export const serializeAws_restJson1DescribePipelineCommand = async ( input: DescribePipelineCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/pipelines/{pipelineName}"; if (input.pipelineName !== undefined) { const labelValue: string = input.pipelineName; @@ -676,9 +670,7 @@ export const serializeAws_restJson1GetDatasetContentCommand = async ( input: GetDatasetContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datasets/{datasetName}/content"; if (input.datasetName !== undefined) { const labelValue: string = input.datasetName; @@ -710,9 +702,7 @@ export const serializeAws_restJson1ListChannelsCommand = async ( input: ListChannelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -736,9 +726,7 @@ export const serializeAws_restJson1ListDatasetContentsCommand = async ( input: ListDatasetContentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datasets/{datasetName}/contents"; if (input.datasetName !== undefined) { const labelValue: string = input.datasetName; @@ -777,9 +765,7 @@ export const serializeAws_restJson1ListDatasetsCommand = async ( input: ListDatasetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datasets"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -803,9 +789,7 @@ export const serializeAws_restJson1ListDatastoresCommand = async ( input: ListDatastoresCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/datastores"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -829,9 +813,7 @@ export const serializeAws_restJson1ListPipelinesCommand = async ( input: ListPipelinesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/pipelines"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -855,9 +837,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags"; const query: any = { ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), @@ -881,14 +861,15 @@ export const serializeAws_restJson1PutLoggingOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/logging"; let body: any; body = JSON.stringify({ - ...(input.loggingOptions !== undefined && { - loggingOptions: serializeAws_restJson1LoggingOptions(input.loggingOptions, context), - }), + ...(input.loggingOptions !== undefined && + input.loggingOptions !== null && { + loggingOptions: serializeAws_restJson1LoggingOptions(input.loggingOptions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -907,15 +888,17 @@ export const serializeAws_restJson1RunPipelineActivityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/pipelineactivities/run"; let body: any; body = JSON.stringify({ - ...(input.payloads !== undefined && { payloads: serializeAws_restJson1MessagePayloads(input.payloads, context) }), - ...(input.pipelineActivity !== undefined && { - pipelineActivity: serializeAws_restJson1PipelineActivity(input.pipelineActivity, context), - }), + ...(input.payloads !== undefined && + input.payloads !== null && { payloads: serializeAws_restJson1MessagePayloads(input.payloads, context) }), + ...(input.pipelineActivity !== undefined && + input.pipelineActivity !== null && { + pipelineActivity: serializeAws_restJson1PipelineActivity(input.pipelineActivity, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -933,9 +916,7 @@ export const serializeAws_restJson1SampleChannelDataCommand = async ( input: SampleChannelDataCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{channelName}/sample"; if (input.channelName !== undefined) { const labelValue: string = input.channelName; @@ -970,7 +951,7 @@ export const serializeAws_restJson1StartPipelineReprocessingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/pipelines/{pipelineName}/reprocessing"; if (input.pipelineName !== undefined) { @@ -984,8 +965,10 @@ export const serializeAws_restJson1StartPipelineReprocessingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1004,7 +987,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags"; const query: any = { @@ -1012,7 +995,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1031,9 +1015,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags"; const query: any = { ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), @@ -1058,7 +1040,7 @@ export const serializeAws_restJson1UpdateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels/{channelName}"; if (input.channelName !== undefined) { @@ -1072,12 +1054,14 @@ export const serializeAws_restJson1UpdateChannelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.channelStorage !== undefined && { - channelStorage: serializeAws_restJson1ChannelStorage(input.channelStorage, context), - }), - ...(input.retentionPeriod !== undefined && { - retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), - }), + ...(input.channelStorage !== undefined && + input.channelStorage !== null && { + channelStorage: serializeAws_restJson1ChannelStorage(input.channelStorage, context), + }), + ...(input.retentionPeriod !== undefined && + input.retentionPeriod !== null && { + retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1096,7 +1080,7 @@ export const serializeAws_restJson1UpdateDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/datasets/{datasetName}"; if (input.datasetName !== undefined) { @@ -1110,20 +1094,26 @@ export const serializeAws_restJson1UpdateDatasetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.actions !== undefined && { actions: serializeAws_restJson1DatasetActions(input.actions, context) }), - ...(input.contentDeliveryRules !== undefined && { - contentDeliveryRules: serializeAws_restJson1DatasetContentDeliveryRules(input.contentDeliveryRules, context), - }), - ...(input.lateDataRules !== undefined && { - lateDataRules: serializeAws_restJson1LateDataRules(input.lateDataRules, context), - }), - ...(input.retentionPeriod !== undefined && { - retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), - }), - ...(input.triggers !== undefined && { triggers: serializeAws_restJson1DatasetTriggers(input.triggers, context) }), - ...(input.versioningConfiguration !== undefined && { - versioningConfiguration: serializeAws_restJson1VersioningConfiguration(input.versioningConfiguration, context), - }), + ...(input.actions !== undefined && + input.actions !== null && { actions: serializeAws_restJson1DatasetActions(input.actions, context) }), + ...(input.contentDeliveryRules !== undefined && + input.contentDeliveryRules !== null && { + contentDeliveryRules: serializeAws_restJson1DatasetContentDeliveryRules(input.contentDeliveryRules, context), + }), + ...(input.lateDataRules !== undefined && + input.lateDataRules !== null && { + lateDataRules: serializeAws_restJson1LateDataRules(input.lateDataRules, context), + }), + ...(input.retentionPeriod !== undefined && + input.retentionPeriod !== null && { + retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), + }), + ...(input.triggers !== undefined && + input.triggers !== null && { triggers: serializeAws_restJson1DatasetTriggers(input.triggers, context) }), + ...(input.versioningConfiguration !== undefined && + input.versioningConfiguration !== null && { + versioningConfiguration: serializeAws_restJson1VersioningConfiguration(input.versioningConfiguration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1142,7 +1132,7 @@ export const serializeAws_restJson1UpdateDatastoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/datastores/{datastoreName}"; if (input.datastoreName !== undefined) { @@ -1156,12 +1146,14 @@ export const serializeAws_restJson1UpdateDatastoreCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.datastoreStorage !== undefined && { - datastoreStorage: serializeAws_restJson1DatastoreStorage(input.datastoreStorage, context), - }), - ...(input.retentionPeriod !== undefined && { - retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), - }), + ...(input.datastoreStorage !== undefined && + input.datastoreStorage !== null && { + datastoreStorage: serializeAws_restJson1DatastoreStorage(input.datastoreStorage, context), + }), + ...(input.retentionPeriod !== undefined && + input.retentionPeriod !== null && { + retentionPeriod: serializeAws_restJson1RetentionPeriod(input.retentionPeriod, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1180,7 +1172,7 @@ export const serializeAws_restJson1UpdatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/pipelines/{pipelineName}"; if (input.pipelineName !== undefined) { @@ -1194,9 +1186,10 @@ export const serializeAws_restJson1UpdatePipelineCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.pipelineActivities !== undefined && { - pipelineActivities: serializeAws_restJson1PipelineActivities(input.pipelineActivities, context), - }), + ...(input.pipelineActivities !== undefined && + input.pipelineActivities !== null && { + pipelineActivities: serializeAws_restJson1PipelineActivities(input.pipelineActivities, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4343,55 +4336,70 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async ( const serializeAws_restJson1AddAttributesActivity = (input: AddAttributesActivity, context: __SerdeContext): any => { return { - ...(input.attributes !== undefined && { - attributes: serializeAws_restJson1AttributeNameMapping(input.attributes, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.next !== undefined && { next: input.next }), + ...(input.attributes !== undefined && + input.attributes !== null && { + attributes: serializeAws_restJson1AttributeNameMapping(input.attributes, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.next !== undefined && input.next !== null && { next: input.next }), }; }; const serializeAws_restJson1AttributeNameMapping = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AttributeNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ChannelActivity = (input: ChannelActivity, context: __SerdeContext): any => { return { - ...(input.channelName !== undefined && { channelName: input.channelName }), - ...(input.name !== undefined && { name: input.name }), - ...(input.next !== undefined && { next: input.next }), + ...(input.channelName !== undefined && input.channelName !== null && { channelName: input.channelName }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.next !== undefined && input.next !== null && { next: input.next }), }; }; const serializeAws_restJson1ChannelStorage = (input: ChannelStorage, context: __SerdeContext): any => { return { - ...(input.customerManagedS3 !== undefined && { - customerManagedS3: serializeAws_restJson1CustomerManagedChannelS3Storage(input.customerManagedS3, context), - }), - ...(input.serviceManagedS3 !== undefined && { - serviceManagedS3: serializeAws_restJson1ServiceManagedChannelS3Storage(input.serviceManagedS3, context), - }), + ...(input.customerManagedS3 !== undefined && + input.customerManagedS3 !== null && { + customerManagedS3: serializeAws_restJson1CustomerManagedChannelS3Storage(input.customerManagedS3, context), + }), + ...(input.serviceManagedS3 !== undefined && + input.serviceManagedS3 !== null && { + serviceManagedS3: serializeAws_restJson1ServiceManagedChannelS3Storage(input.serviceManagedS3, context), + }), }; }; const serializeAws_restJson1ContainerDatasetAction = (input: ContainerDatasetAction, context: __SerdeContext): any => { return { - ...(input.executionRoleArn !== undefined && { executionRoleArn: input.executionRoleArn }), - ...(input.image !== undefined && { image: input.image }), - ...(input.resourceConfiguration !== undefined && { - resourceConfiguration: serializeAws_restJson1ResourceConfiguration(input.resourceConfiguration, context), - }), - ...(input.variables !== undefined && { variables: serializeAws_restJson1Variables(input.variables, context) }), + ...(input.executionRoleArn !== undefined && + input.executionRoleArn !== null && { executionRoleArn: input.executionRoleArn }), + ...(input.image !== undefined && input.image !== null && { image: input.image }), + ...(input.resourceConfiguration !== undefined && + input.resourceConfiguration !== null && { + resourceConfiguration: serializeAws_restJson1ResourceConfiguration(input.resourceConfiguration, context), + }), + ...(input.variables !== undefined && + input.variables !== null && { variables: serializeAws_restJson1Variables(input.variables, context) }), }; }; @@ -4400,9 +4408,9 @@ const serializeAws_restJson1CustomerManagedChannelS3Storage = ( context: __SerdeContext ): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.keyPrefix !== undefined && { keyPrefix: input.keyPrefix }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.keyPrefix !== undefined && input.keyPrefix !== null && { keyPrefix: input.keyPrefix }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; @@ -4411,26 +4419,35 @@ const serializeAws_restJson1CustomerManagedDatastoreS3Storage = ( context: __SerdeContext ): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.keyPrefix !== undefined && { keyPrefix: input.keyPrefix }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.keyPrefix !== undefined && input.keyPrefix !== null && { keyPrefix: input.keyPrefix }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1DatasetAction = (input: DatasetAction, context: __SerdeContext): any => { return { - ...(input.actionName !== undefined && { actionName: input.actionName }), - ...(input.containerAction !== undefined && { - containerAction: serializeAws_restJson1ContainerDatasetAction(input.containerAction, context), - }), - ...(input.queryAction !== undefined && { - queryAction: serializeAws_restJson1SqlQueryDatasetAction(input.queryAction, context), - }), + ...(input.actionName !== undefined && input.actionName !== null && { actionName: input.actionName }), + ...(input.containerAction !== undefined && + input.containerAction !== null && { + containerAction: serializeAws_restJson1ContainerDatasetAction(input.containerAction, context), + }), + ...(input.queryAction !== undefined && + input.queryAction !== null && { + queryAction: serializeAws_restJson1SqlQueryDatasetAction(input.queryAction, context), + }), }; }; const serializeAws_restJson1DatasetActions = (input: DatasetAction[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DatasetAction(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DatasetAction(entry, context); + }); }; const serializeAws_restJson1DatasetContentDeliveryDestination = ( @@ -4438,18 +4455,20 @@ const serializeAws_restJson1DatasetContentDeliveryDestination = ( context: __SerdeContext ): any => { return { - ...(input.iotEventsDestinationConfiguration !== undefined && { - iotEventsDestinationConfiguration: serializeAws_restJson1IotEventsDestinationConfiguration( - input.iotEventsDestinationConfiguration, - context - ), - }), - ...(input.s3DestinationConfiguration !== undefined && { - s3DestinationConfiguration: serializeAws_restJson1S3DestinationConfiguration( - input.s3DestinationConfiguration, - context - ), - }), + ...(input.iotEventsDestinationConfiguration !== undefined && + input.iotEventsDestinationConfiguration !== null && { + iotEventsDestinationConfiguration: serializeAws_restJson1IotEventsDestinationConfiguration( + input.iotEventsDestinationConfiguration, + context + ), + }), + ...(input.s3DestinationConfiguration !== undefined && + input.s3DestinationConfiguration !== null && { + s3DestinationConfiguration: serializeAws_restJson1S3DestinationConfiguration( + input.s3DestinationConfiguration, + context + ), + }), }; }; @@ -4458,10 +4477,11 @@ const serializeAws_restJson1DatasetContentDeliveryRule = ( context: __SerdeContext ): any => { return { - ...(input.destination !== undefined && { - destination: serializeAws_restJson1DatasetContentDeliveryDestination(input.destination, context), - }), - ...(input.entryName !== undefined && { entryName: input.entryName }), + ...(input.destination !== undefined && + input.destination !== null && { + destination: serializeAws_restJson1DatasetContentDeliveryDestination(input.destination, context), + }), + ...(input.entryName !== undefined && input.entryName !== null && { entryName: input.entryName }), }; }; @@ -4469,7 +4489,14 @@ const serializeAws_restJson1DatasetContentDeliveryRules = ( input: DatasetContentDeliveryRule[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DatasetContentDeliveryRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DatasetContentDeliveryRule(entry, context); + }); }; const serializeAws_restJson1DatasetContentVersionValue = ( @@ -4477,43 +4504,55 @@ const serializeAws_restJson1DatasetContentVersionValue = ( context: __SerdeContext ): any => { return { - ...(input.datasetName !== undefined && { datasetName: input.datasetName }), + ...(input.datasetName !== undefined && input.datasetName !== null && { datasetName: input.datasetName }), }; }; const serializeAws_restJson1DatasetTrigger = (input: DatasetTrigger, context: __SerdeContext): any => { return { - ...(input.dataset !== undefined && { dataset: serializeAws_restJson1TriggeringDataset(input.dataset, context) }), - ...(input.schedule !== undefined && { schedule: serializeAws_restJson1Schedule(input.schedule, context) }), + ...(input.dataset !== undefined && + input.dataset !== null && { dataset: serializeAws_restJson1TriggeringDataset(input.dataset, context) }), + ...(input.schedule !== undefined && + input.schedule !== null && { schedule: serializeAws_restJson1Schedule(input.schedule, context) }), }; }; const serializeAws_restJson1DatasetTriggers = (input: DatasetTrigger[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DatasetTrigger(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DatasetTrigger(entry, context); + }); }; const serializeAws_restJson1DatastoreActivity = (input: DatastoreActivity, context: __SerdeContext): any => { return { - ...(input.datastoreName !== undefined && { datastoreName: input.datastoreName }), - ...(input.name !== undefined && { name: input.name }), + ...(input.datastoreName !== undefined && input.datastoreName !== null && { datastoreName: input.datastoreName }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_restJson1DatastoreStorage = (input: DatastoreStorage, context: __SerdeContext): any => { return { - ...(input.customerManagedS3 !== undefined && { - customerManagedS3: serializeAws_restJson1CustomerManagedDatastoreS3Storage(input.customerManagedS3, context), - }), - ...(input.serviceManagedS3 !== undefined && { - serviceManagedS3: serializeAws_restJson1ServiceManagedDatastoreS3Storage(input.serviceManagedS3, context), - }), + ...(input.customerManagedS3 !== undefined && + input.customerManagedS3 !== null && { + customerManagedS3: serializeAws_restJson1CustomerManagedDatastoreS3Storage(input.customerManagedS3, context), + }), + ...(input.serviceManagedS3 !== undefined && + input.serviceManagedS3 !== null && { + serviceManagedS3: serializeAws_restJson1ServiceManagedDatastoreS3Storage(input.serviceManagedS3, context), + }), }; }; const serializeAws_restJson1DeltaTime = (input: DeltaTime, context: __SerdeContext): any => { return { - ...(input.offsetSeconds !== undefined && { offsetSeconds: input.offsetSeconds }), - ...(input.timeExpression !== undefined && { timeExpression: input.timeExpression }), + ...(input.offsetSeconds !== undefined && input.offsetSeconds !== null && { offsetSeconds: input.offsetSeconds }), + ...(input.timeExpression !== undefined && + input.timeExpression !== null && { timeExpression: input.timeExpression }), }; }; @@ -4522,7 +4561,8 @@ const serializeAws_restJson1DeltaTimeSessionWindowConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.timeoutInMinutes !== undefined && { timeoutInMinutes: input.timeoutInMinutes }), + ...(input.timeoutInMinutes !== undefined && + input.timeoutInMinutes !== null && { timeoutInMinutes: input.timeoutInMinutes }), }; }; @@ -4531,11 +4571,11 @@ const serializeAws_restJson1DeviceRegistryEnrichActivity = ( context: __SerdeContext ): any => { return { - ...(input.attribute !== undefined && { attribute: input.attribute }), - ...(input.name !== undefined && { name: input.name }), - ...(input.next !== undefined && { next: input.next }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.attribute !== undefined && input.attribute !== null && { attribute: input.attribute }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.next !== undefined && input.next !== null && { next: input.next }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }; }; @@ -4544,26 +4584,26 @@ const serializeAws_restJson1DeviceShadowEnrichActivity = ( context: __SerdeContext ): any => { return { - ...(input.attribute !== undefined && { attribute: input.attribute }), - ...(input.name !== undefined && { name: input.name }), - ...(input.next !== undefined && { next: input.next }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.attribute !== undefined && input.attribute !== null && { attribute: input.attribute }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.next !== undefined && input.next !== null && { next: input.next }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }; }; const serializeAws_restJson1FilterActivity = (input: FilterActivity, context: __SerdeContext): any => { return { - ...(input.filter !== undefined && { filter: input.filter }), - ...(input.name !== undefined && { name: input.name }), - ...(input.next !== undefined && { next: input.next }), + ...(input.filter !== undefined && input.filter !== null && { filter: input.filter }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.next !== undefined && input.next !== null && { next: input.next }), }; }; const serializeAws_restJson1GlueConfiguration = (input: GlueConfiguration, context: __SerdeContext): any => { return { - ...(input.databaseName !== undefined && { databaseName: input.databaseName }), - ...(input.tableName !== undefined && { tableName: input.tableName }), + ...(input.databaseName !== undefined && input.databaseName !== null && { databaseName: input.databaseName }), + ...(input.tableName !== undefined && input.tableName !== null && { tableName: input.tableName }), }; }; @@ -4572,26 +4612,27 @@ const serializeAws_restJson1IotEventsDestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.inputName !== undefined && { inputName: input.inputName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.inputName !== undefined && input.inputName !== null && { inputName: input.inputName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1LambdaActivity = (input: LambdaActivity, context: __SerdeContext): any => { return { - ...(input.batchSize !== undefined && { batchSize: input.batchSize }), - ...(input.lambdaName !== undefined && { lambdaName: input.lambdaName }), - ...(input.name !== undefined && { name: input.name }), - ...(input.next !== undefined && { next: input.next }), + ...(input.batchSize !== undefined && input.batchSize !== null && { batchSize: input.batchSize }), + ...(input.lambdaName !== undefined && input.lambdaName !== null && { lambdaName: input.lambdaName }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.next !== undefined && input.next !== null && { next: input.next }), }; }; const serializeAws_restJson1LateDataRule = (input: LateDataRule, context: __SerdeContext): any => { return { - ...(input.ruleConfiguration !== undefined && { - ruleConfiguration: serializeAws_restJson1LateDataRuleConfiguration(input.ruleConfiguration, context), - }), - ...(input.ruleName !== undefined && { ruleName: input.ruleName }), + ...(input.ruleConfiguration !== undefined && + input.ruleConfiguration !== null && { + ruleConfiguration: serializeAws_restJson1LateDataRuleConfiguration(input.ruleConfiguration, context), + }), + ...(input.ruleName !== undefined && input.ruleName !== null && { ruleName: input.ruleName }), }; }; @@ -4600,96 +4641,141 @@ const serializeAws_restJson1LateDataRuleConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.deltaTimeSessionWindowConfiguration !== undefined && { - deltaTimeSessionWindowConfiguration: serializeAws_restJson1DeltaTimeSessionWindowConfiguration( - input.deltaTimeSessionWindowConfiguration, - context - ), - }), + ...(input.deltaTimeSessionWindowConfiguration !== undefined && + input.deltaTimeSessionWindowConfiguration !== null && { + deltaTimeSessionWindowConfiguration: serializeAws_restJson1DeltaTimeSessionWindowConfiguration( + input.deltaTimeSessionWindowConfiguration, + context + ), + }), }; }; const serializeAws_restJson1LateDataRules = (input: LateDataRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1LateDataRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1LateDataRule(entry, context); + }); }; const serializeAws_restJson1LoggingOptions = (input: LoggingOptions, context: __SerdeContext): any => { return { - ...(input.enabled !== undefined && { enabled: input.enabled }), - ...(input.level !== undefined && { level: input.level }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), + ...(input.level !== undefined && input.level !== null && { level: input.level }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1MathActivity = (input: MathActivity, context: __SerdeContext): any => { return { - ...(input.attribute !== undefined && { attribute: input.attribute }), - ...(input.math !== undefined && { math: input.math }), - ...(input.name !== undefined && { name: input.name }), - ...(input.next !== undefined && { next: input.next }), + ...(input.attribute !== undefined && input.attribute !== null && { attribute: input.attribute }), + ...(input.math !== undefined && input.math !== null && { math: input.math }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.next !== undefined && input.next !== null && { next: input.next }), }; }; const serializeAws_restJson1Message = (input: Message, context: __SerdeContext): any => { return { - ...(input.messageId !== undefined && { messageId: input.messageId }), - ...(input.payload !== undefined && { payload: context.base64Encoder(input.payload) }), + ...(input.messageId !== undefined && input.messageId !== null && { messageId: input.messageId }), + ...(input.payload !== undefined && input.payload !== null && { payload: context.base64Encoder(input.payload) }), }; }; const serializeAws_restJson1MessagePayloads = (input: Uint8Array[], context: __SerdeContext): any => { - return input.map((entry) => context.base64Encoder(entry)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return context.base64Encoder(entry); + }); }; const serializeAws_restJson1Messages = (input: Message[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Message(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Message(entry, context); + }); }; const serializeAws_restJson1OutputFileUriValue = (input: OutputFileUriValue, context: __SerdeContext): any => { return { - ...(input.fileName !== undefined && { fileName: input.fileName }), + ...(input.fileName !== undefined && input.fileName !== null && { fileName: input.fileName }), }; }; const serializeAws_restJson1PipelineActivities = (input: PipelineActivity[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1PipelineActivity(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1PipelineActivity(entry, context); + }); }; const serializeAws_restJson1PipelineActivity = (input: PipelineActivity, context: __SerdeContext): any => { return { - ...(input.addAttributes !== undefined && { - addAttributes: serializeAws_restJson1AddAttributesActivity(input.addAttributes, context), - }), - ...(input.channel !== undefined && { channel: serializeAws_restJson1ChannelActivity(input.channel, context) }), - ...(input.datastore !== undefined && { - datastore: serializeAws_restJson1DatastoreActivity(input.datastore, context), - }), - ...(input.deviceRegistryEnrich !== undefined && { - deviceRegistryEnrich: serializeAws_restJson1DeviceRegistryEnrichActivity(input.deviceRegistryEnrich, context), - }), - ...(input.deviceShadowEnrich !== undefined && { - deviceShadowEnrich: serializeAws_restJson1DeviceShadowEnrichActivity(input.deviceShadowEnrich, context), - }), - ...(input.filter !== undefined && { filter: serializeAws_restJson1FilterActivity(input.filter, context) }), - ...(input.lambda !== undefined && { lambda: serializeAws_restJson1LambdaActivity(input.lambda, context) }), - ...(input.math !== undefined && { math: serializeAws_restJson1MathActivity(input.math, context) }), - ...(input.removeAttributes !== undefined && { - removeAttributes: serializeAws_restJson1RemoveAttributesActivity(input.removeAttributes, context), - }), - ...(input.selectAttributes !== undefined && { - selectAttributes: serializeAws_restJson1SelectAttributesActivity(input.selectAttributes, context), - }), + ...(input.addAttributes !== undefined && + input.addAttributes !== null && { + addAttributes: serializeAws_restJson1AddAttributesActivity(input.addAttributes, context), + }), + ...(input.channel !== undefined && + input.channel !== null && { channel: serializeAws_restJson1ChannelActivity(input.channel, context) }), + ...(input.datastore !== undefined && + input.datastore !== null && { datastore: serializeAws_restJson1DatastoreActivity(input.datastore, context) }), + ...(input.deviceRegistryEnrich !== undefined && + input.deviceRegistryEnrich !== null && { + deviceRegistryEnrich: serializeAws_restJson1DeviceRegistryEnrichActivity(input.deviceRegistryEnrich, context), + }), + ...(input.deviceShadowEnrich !== undefined && + input.deviceShadowEnrich !== null && { + deviceShadowEnrich: serializeAws_restJson1DeviceShadowEnrichActivity(input.deviceShadowEnrich, context), + }), + ...(input.filter !== undefined && + input.filter !== null && { filter: serializeAws_restJson1FilterActivity(input.filter, context) }), + ...(input.lambda !== undefined && + input.lambda !== null && { lambda: serializeAws_restJson1LambdaActivity(input.lambda, context) }), + ...(input.math !== undefined && + input.math !== null && { math: serializeAws_restJson1MathActivity(input.math, context) }), + ...(input.removeAttributes !== undefined && + input.removeAttributes !== null && { + removeAttributes: serializeAws_restJson1RemoveAttributesActivity(input.removeAttributes, context), + }), + ...(input.selectAttributes !== undefined && + input.selectAttributes !== null && { + selectAttributes: serializeAws_restJson1SelectAttributesActivity(input.selectAttributes, context), + }), }; }; const serializeAws_restJson1QueryFilter = (input: QueryFilter, context: __SerdeContext): any => { return { - ...(input.deltaTime !== undefined && { deltaTime: serializeAws_restJson1DeltaTime(input.deltaTime, context) }), + ...(input.deltaTime !== undefined && + input.deltaTime !== null && { deltaTime: serializeAws_restJson1DeltaTime(input.deltaTime, context) }), }; }; const serializeAws_restJson1QueryFilters = (input: QueryFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1QueryFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1QueryFilter(entry, context); + }); }; const serializeAws_restJson1RemoveAttributesActivity = ( @@ -4697,25 +4783,25 @@ const serializeAws_restJson1RemoveAttributesActivity = ( context: __SerdeContext ): any => { return { - ...(input.attributes !== undefined && { - attributes: serializeAws_restJson1AttributeNames(input.attributes, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.next !== undefined && { next: input.next }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_restJson1AttributeNames(input.attributes, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.next !== undefined && input.next !== null && { next: input.next }), }; }; const serializeAws_restJson1ResourceConfiguration = (input: ResourceConfiguration, context: __SerdeContext): any => { return { - ...(input.computeType !== undefined && { computeType: input.computeType }), - ...(input.volumeSizeInGB !== undefined && { volumeSizeInGB: input.volumeSizeInGB }), + ...(input.computeType !== undefined && input.computeType !== null && { computeType: input.computeType }), + ...(input.volumeSizeInGB !== undefined && + input.volumeSizeInGB !== null && { volumeSizeInGB: input.volumeSizeInGB }), }; }; const serializeAws_restJson1RetentionPeriod = (input: RetentionPeriod, context: __SerdeContext): any => { return { - ...(input.numberOfDays !== undefined && { numberOfDays: input.numberOfDays }), - ...(input.unlimited !== undefined && { unlimited: input.unlimited }), + ...(input.numberOfDays !== undefined && input.numberOfDays !== null && { numberOfDays: input.numberOfDays }), + ...(input.unlimited !== undefined && input.unlimited !== null && { unlimited: input.unlimited }), }; }; @@ -4724,18 +4810,19 @@ const serializeAws_restJson1S3DestinationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.glueConfiguration !== undefined && { - glueConfiguration: serializeAws_restJson1GlueConfiguration(input.glueConfiguration, context), - }), - ...(input.key !== undefined && { key: input.key }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.glueConfiguration !== undefined && + input.glueConfiguration !== null && { + glueConfiguration: serializeAws_restJson1GlueConfiguration(input.glueConfiguration, context), + }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_restJson1Schedule = (input: Schedule, context: __SerdeContext): any => { return { - ...(input.expression !== undefined && { expression: input.expression }), + ...(input.expression !== undefined && input.expression !== null && { expression: input.expression }), }; }; @@ -4744,11 +4831,10 @@ const serializeAws_restJson1SelectAttributesActivity = ( context: __SerdeContext ): any => { return { - ...(input.attributes !== undefined && { - attributes: serializeAws_restJson1AttributeNames(input.attributes, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.next !== undefined && { next: input.next }), + ...(input.attributes !== undefined && + input.attributes !== null && { attributes: serializeAws_restJson1AttributeNames(input.attributes, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.next !== undefined && input.next !== null && { next: input.next }), }; }; @@ -4768,47 +4854,64 @@ const serializeAws_restJson1ServiceManagedDatastoreS3Storage = ( const serializeAws_restJson1SqlQueryDatasetAction = (input: SqlQueryDatasetAction, context: __SerdeContext): any => { return { - ...(input.filters !== undefined && { filters: serializeAws_restJson1QueryFilters(input.filters, context) }), - ...(input.sqlQuery !== undefined && { sqlQuery: input.sqlQuery }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1QueryFilters(input.filters, context) }), + ...(input.sqlQuery !== undefined && input.sqlQuery !== null && { sqlQuery: input.sqlQuery }), }; }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TriggeringDataset = (input: TriggeringDataset, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_restJson1Variable = (input: Variable, context: __SerdeContext): any => { return { - ...(input.datasetContentVersionValue !== undefined && { - datasetContentVersionValue: serializeAws_restJson1DatasetContentVersionValue( - input.datasetContentVersionValue, - context - ), - }), - ...(input.doubleValue !== undefined && { doubleValue: input.doubleValue }), - ...(input.name !== undefined && { name: input.name }), - ...(input.outputFileUriValue !== undefined && { - outputFileUriValue: serializeAws_restJson1OutputFileUriValue(input.outputFileUriValue, context), - }), - ...(input.stringValue !== undefined && { stringValue: input.stringValue }), + ...(input.datasetContentVersionValue !== undefined && + input.datasetContentVersionValue !== null && { + datasetContentVersionValue: serializeAws_restJson1DatasetContentVersionValue( + input.datasetContentVersionValue, + context + ), + }), + ...(input.doubleValue !== undefined && input.doubleValue !== null && { doubleValue: input.doubleValue }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.outputFileUriValue !== undefined && + input.outputFileUriValue !== null && { + outputFileUriValue: serializeAws_restJson1OutputFileUriValue(input.outputFileUriValue, context), + }), + ...(input.stringValue !== undefined && input.stringValue !== null && { stringValue: input.stringValue }), }; }; const serializeAws_restJson1Variables = (input: Variable[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Variable(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Variable(entry, context); + }); }; const serializeAws_restJson1VersioningConfiguration = ( @@ -4816,8 +4919,8 @@ const serializeAws_restJson1VersioningConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.maxVersions !== undefined && { maxVersions: input.maxVersions }), - ...(input.unlimited !== undefined && { unlimited: input.unlimited }), + ...(input.maxVersions !== undefined && input.maxVersions !== null && { maxVersions: input.maxVersions }), + ...(input.unlimited !== undefined && input.unlimited !== null && { unlimited: input.unlimited }), }; }; @@ -4836,24 +4939,40 @@ const deserializeAws_restJson1AttributeNameMapping = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AttributeNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1BatchPutMessageErrorEntries = ( output: any, context: __SerdeContext ): BatchPutMessageErrorEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchPutMessageErrorEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchPutMessageErrorEntry(entry, context); + }); }; const deserializeAws_restJson1BatchPutMessageErrorEntry = ( @@ -4939,7 +5058,14 @@ const deserializeAws_restJson1ChannelStorageSummary = (output: any, context: __S }; const deserializeAws_restJson1ChannelSummaries = (output: any, context: __SerdeContext): ChannelSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelSummary(entry, context); + }); }; const deserializeAws_restJson1ChannelSummary = (output: any, context: __SerdeContext): ChannelSummary => { @@ -5083,14 +5209,28 @@ const deserializeAws_restJson1DatasetAction = (output: any, context: __SerdeCont }; const deserializeAws_restJson1DatasetActions = (output: any, context: __SerdeContext): DatasetAction[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DatasetAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DatasetAction(entry, context); + }); }; const deserializeAws_restJson1DatasetActionSummaries = ( output: any, context: __SerdeContext ): DatasetActionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DatasetActionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DatasetActionSummary(entry, context); + }); }; const deserializeAws_restJson1DatasetActionSummary = (output: any, context: __SerdeContext): DatasetActionSummary => { @@ -5133,7 +5273,14 @@ const deserializeAws_restJson1DatasetContentDeliveryRules = ( output: any, context: __SerdeContext ): DatasetContentDeliveryRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DatasetContentDeliveryRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DatasetContentDeliveryRule(entry, context); + }); }; const deserializeAws_restJson1DatasetContentStatus = (output: any, context: __SerdeContext): DatasetContentStatus => { @@ -5147,7 +5294,14 @@ const deserializeAws_restJson1DatasetContentSummaries = ( output: any, context: __SerdeContext ): DatasetContentSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DatasetContentSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DatasetContentSummary(entry, context); + }); }; const deserializeAws_restJson1DatasetContentSummary = (output: any, context: __SerdeContext): DatasetContentSummary => { @@ -5182,7 +5336,14 @@ const deserializeAws_restJson1DatasetContentVersionValue = ( }; const deserializeAws_restJson1DatasetEntries = (output: any, context: __SerdeContext): DatasetEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DatasetEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DatasetEntry(entry, context); + }); }; const deserializeAws_restJson1DatasetEntry = (output: any, context: __SerdeContext): DatasetEntry => { @@ -5193,7 +5354,14 @@ const deserializeAws_restJson1DatasetEntry = (output: any, context: __SerdeConte }; const deserializeAws_restJson1DatasetSummaries = (output: any, context: __SerdeContext): DatasetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DatasetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DatasetSummary(entry, context); + }); }; const deserializeAws_restJson1DatasetSummary = (output: any, context: __SerdeContext): DatasetSummary => { @@ -5233,7 +5401,14 @@ const deserializeAws_restJson1DatasetTrigger = (output: any, context: __SerdeCon }; const deserializeAws_restJson1DatasetTriggers = (output: any, context: __SerdeContext): DatasetTrigger[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DatasetTrigger(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DatasetTrigger(entry, context); + }); }; const deserializeAws_restJson1Datastore = (output: any, context: __SerdeContext): Datastore => { @@ -5311,7 +5486,14 @@ const deserializeAws_restJson1DatastoreStorageSummary = ( }; const deserializeAws_restJson1DatastoreSummaries = (output: any, context: __SerdeContext): DatastoreSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DatastoreSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DatastoreSummary(entry, context); + }); }; const deserializeAws_restJson1DatastoreSummary = (output: any, context: __SerdeContext): DatastoreSummary => { @@ -5456,7 +5638,14 @@ const deserializeAws_restJson1LateDataRuleConfiguration = ( }; const deserializeAws_restJson1LateDataRules = (output: any, context: __SerdeContext): LateDataRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LateDataRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LateDataRule(entry, context); + }); }; const deserializeAws_restJson1LoggingOptions = (output: any, context: __SerdeContext): LoggingOptions => { @@ -5477,7 +5666,14 @@ const deserializeAws_restJson1MathActivity = (output: any, context: __SerdeConte }; const deserializeAws_restJson1MessagePayloads = (output: any, context: __SerdeContext): Uint8Array[] => { - return (output || []).map((entry: any) => context.base64Decoder(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return context.base64Decoder(entry); + }); }; const deserializeAws_restJson1OutputFileUriValue = (output: any, context: __SerdeContext): OutputFileUriValue => { @@ -5510,7 +5706,14 @@ const deserializeAws_restJson1Pipeline = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1PipelineActivities = (output: any, context: __SerdeContext): PipelineActivity[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PipelineActivity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PipelineActivity(entry, context); + }); }; const deserializeAws_restJson1PipelineActivity = (output: any, context: __SerdeContext): PipelineActivity => { @@ -5559,7 +5762,14 @@ const deserializeAws_restJson1PipelineActivity = (output: any, context: __SerdeC }; const deserializeAws_restJson1PipelineSummaries = (output: any, context: __SerdeContext): PipelineSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PipelineSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PipelineSummary(entry, context); + }); }; const deserializeAws_restJson1PipelineSummary = (output: any, context: __SerdeContext): PipelineSummary => { @@ -5590,7 +5800,14 @@ const deserializeAws_restJson1QueryFilter = (output: any, context: __SerdeContex }; const deserializeAws_restJson1QueryFilters = (output: any, context: __SerdeContext): QueryFilter[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1QueryFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1QueryFilter(entry, context); + }); }; const deserializeAws_restJson1RemoveAttributesActivity = ( @@ -5608,7 +5825,14 @@ const deserializeAws_restJson1RemoveAttributesActivity = ( }; const deserializeAws_restJson1ReprocessingSummaries = (output: any, context: __SerdeContext): ReprocessingSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ReprocessingSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ReprocessingSummary(entry, context); + }); }; const deserializeAws_restJson1ReprocessingSummary = (output: any, context: __SerdeContext): ReprocessingSummary => { @@ -5718,7 +5942,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TriggeringDataset = (output: any, context: __SerdeContext): TriggeringDataset => { @@ -5744,7 +5975,14 @@ const deserializeAws_restJson1Variable = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Variables = (output: any, context: __SerdeContext): Variable[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Variable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Variable(entry, context); + }); }; const deserializeAws_restJson1VersioningConfiguration = ( @@ -5777,6 +6015,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts b/clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts index dabfbcb7125f..4bd8defe18b1 100644 --- a/clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts +++ b/clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts @@ -47,7 +47,7 @@ export const serializeAws_json1_1CloseTunnelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IoTSecuredTunneling.CloseTunnel", }; let body: any; @@ -60,7 +60,7 @@ export const serializeAws_json1_1DescribeTunnelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IoTSecuredTunneling.DescribeTunnel", }; let body: any; @@ -73,7 +73,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IoTSecuredTunneling.ListTagsForResource", }; let body: any; @@ -86,7 +86,7 @@ export const serializeAws_json1_1ListTunnelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IoTSecuredTunneling.ListTunnels", }; let body: any; @@ -99,7 +99,7 @@ export const serializeAws_json1_1OpenTunnelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IoTSecuredTunneling.OpenTunnel", }; let body: any; @@ -112,7 +112,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IoTSecuredTunneling.TagResource", }; let body: any; @@ -125,7 +125,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IoTSecuredTunneling.UntagResource", }; let body: any; @@ -160,8 +160,7 @@ const deserializeAws_json1_1CloseTunnelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": @@ -215,8 +214,7 @@ const deserializeAws_json1_1DescribeTunnelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": @@ -270,8 +268,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": @@ -325,8 +322,7 @@ const deserializeAws_json1_1ListTunnelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -372,8 +368,7 @@ const deserializeAws_json1_1OpenTunnelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.iotsecuretunneling#LimitExceededException": @@ -427,8 +422,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": @@ -482,8 +476,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": @@ -542,21 +535,22 @@ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( const serializeAws_json1_1CloseTunnelRequest = (input: CloseTunnelRequest, context: __SerdeContext): any => { return { - ...(input.delete !== undefined && { delete: input.delete }), - ...(input.tunnelId !== undefined && { tunnelId: input.tunnelId }), + ...(input.delete !== undefined && input.delete !== null && { delete: input.delete }), + ...(input.tunnelId !== undefined && input.tunnelId !== null && { tunnelId: input.tunnelId }), }; }; const serializeAws_json1_1DescribeTunnelRequest = (input: DescribeTunnelRequest, context: __SerdeContext): any => { return { - ...(input.tunnelId !== undefined && { tunnelId: input.tunnelId }), + ...(input.tunnelId !== undefined && input.tunnelId !== null && { tunnelId: input.tunnelId }), }; }; const serializeAws_json1_1DestinationConfig = (input: DestinationConfig, context: __SerdeContext): any => { return { - ...(input.services !== undefined && { services: serializeAws_json1_1ServiceList(input.services, context) }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.services !== undefined && + input.services !== null && { services: serializeAws_json1_1ServiceList(input.services, context) }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }; }; @@ -565,69 +559,92 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_1ListTunnelsRequest = (input: ListTunnelsRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }; }; const serializeAws_json1_1OpenTunnelRequest = (input: OpenTunnelRequest, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.destinationConfig !== undefined && { - destinationConfig: serializeAws_json1_1DestinationConfig(input.destinationConfig, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.timeoutConfig !== undefined && { - timeoutConfig: serializeAws_json1_1TimeoutConfig(input.timeoutConfig, context), - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.destinationConfig !== undefined && + input.destinationConfig !== null && { + destinationConfig: serializeAws_json1_1DestinationConfig(input.destinationConfig, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.timeoutConfig !== undefined && + input.timeoutConfig !== null && { + timeoutConfig: serializeAws_json1_1TimeoutConfig(input.timeoutConfig, context), + }), }; }; const serializeAws_json1_1ServiceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1TimeoutConfig = (input: TimeoutConfig, context: __SerdeContext): any => { return { - ...(input.maxLifetimeTimeoutMinutes !== undefined && { - maxLifetimeTimeoutMinutes: input.maxLifetimeTimeoutMinutes, - }), + ...(input.maxLifetimeTimeoutMinutes !== undefined && + input.maxLifetimeTimeoutMinutes !== null && { maxLifetimeTimeoutMinutes: input.maxLifetimeTimeoutMinutes }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), }; }; @@ -717,7 +734,14 @@ const deserializeAws_json1_1ResourceNotFoundException = ( }; const deserializeAws_json1_1ServiceList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -728,7 +752,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -799,7 +830,14 @@ const deserializeAws_json1_1TunnelSummary = (output: any, context: __SerdeContex }; const deserializeAws_json1_1TunnelSummaryList = (output: any, context: __SerdeContext): TunnelSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TunnelSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TunnelSummary(entry, context); + }); }; const deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => { @@ -856,3 +894,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-iotsitewise/protocols/Aws_restJson1.ts b/clients/client-iotsitewise/protocols/Aws_restJson1.ts index c468cb5fd9b2..8f59b4fca697 100644 --- a/clients/client-iotsitewise/protocols/Aws_restJson1.ts +++ b/clients/client-iotsitewise/protocols/Aws_restJson1.ts @@ -201,7 +201,7 @@ export const serializeAws_restJson1AssociateAssetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assets/{assetId}/associate"; if (input.assetId !== undefined) { @@ -215,9 +215,9 @@ export const serializeAws_restJson1AssociateAssetsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.childAssetId !== undefined && { childAssetId: input.childAssetId }), + ...(input.childAssetId !== undefined && input.childAssetId !== null && { childAssetId: input.childAssetId }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.hierarchyId !== undefined && { hierarchyId: input.hierarchyId }), + ...(input.hierarchyId !== undefined && input.hierarchyId !== null && { hierarchyId: input.hierarchyId }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -243,7 +243,7 @@ export const serializeAws_restJson1BatchAssociateProjectAssetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{projectId}/assets/associate"; if (input.projectId !== undefined) { @@ -257,7 +257,8 @@ export const serializeAws_restJson1BatchAssociateProjectAssetsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.assetIds !== undefined && { assetIds: serializeAws_restJson1IDs(input.assetIds, context) }), + ...(input.assetIds !== undefined && + input.assetIds !== null && { assetIds: serializeAws_restJson1IDs(input.assetIds, context) }), clientToken: input.clientToken ?? generateIdempotencyToken(), }); let { hostname: resolvedHostname } = await context.endpoint(); @@ -284,7 +285,7 @@ export const serializeAws_restJson1BatchDisassociateProjectAssetsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{projectId}/assets/disassociate"; if (input.projectId !== undefined) { @@ -298,7 +299,8 @@ export const serializeAws_restJson1BatchDisassociateProjectAssetsCommand = async } let body: any; body = JSON.stringify({ - ...(input.assetIds !== undefined && { assetIds: serializeAws_restJson1IDs(input.assetIds, context) }), + ...(input.assetIds !== undefined && + input.assetIds !== null && { assetIds: serializeAws_restJson1IDs(input.assetIds, context) }), clientToken: input.clientToken ?? generateIdempotencyToken(), }); let { hostname: resolvedHostname } = await context.endpoint(); @@ -325,14 +327,15 @@ export const serializeAws_restJson1BatchPutAssetPropertyValueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/properties"; let body: any; body = JSON.stringify({ - ...(input.entries !== undefined && { - entries: serializeAws_restJson1PutAssetPropertyValueEntries(input.entries, context), - }), + ...(input.entries !== undefined && + input.entries !== null && { + entries: serializeAws_restJson1PutAssetPropertyValueEntries(input.entries, context), + }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -358,20 +361,23 @@ export const serializeAws_restJson1CreateAccessPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/access-policies"; let body: any; body = JSON.stringify({ - ...(input.accessPolicyIdentity !== undefined && { - accessPolicyIdentity: serializeAws_restJson1Identity(input.accessPolicyIdentity, context), - }), - ...(input.accessPolicyPermission !== undefined && { accessPolicyPermission: input.accessPolicyPermission }), - ...(input.accessPolicyResource !== undefined && { - accessPolicyResource: serializeAws_restJson1Resource(input.accessPolicyResource, context), - }), + ...(input.accessPolicyIdentity !== undefined && + input.accessPolicyIdentity !== null && { + accessPolicyIdentity: serializeAws_restJson1Identity(input.accessPolicyIdentity, context), + }), + ...(input.accessPolicyPermission !== undefined && + input.accessPolicyPermission !== null && { accessPolicyPermission: input.accessPolicyPermission }), + ...(input.accessPolicyResource !== undefined && + input.accessPolicyResource !== null && { + accessPolicyResource: serializeAws_restJson1Resource(input.accessPolicyResource, context), + }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -397,15 +403,15 @@ export const serializeAws_restJson1CreateAssetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assets"; let body: any; body = JSON.stringify({ - ...(input.assetModelId !== undefined && { assetModelId: input.assetModelId }), - ...(input.assetName !== undefined && { assetName: input.assetName }), + ...(input.assetModelId !== undefined && input.assetModelId !== null && { assetModelId: input.assetModelId }), + ...(input.assetName !== undefined && input.assetName !== null && { assetName: input.assetName }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -431,27 +437,35 @@ export const serializeAws_restJson1CreateAssetModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/asset-models"; let body: any; body = JSON.stringify({ - ...(input.assetModelCompositeModels !== undefined && { - assetModelCompositeModels: serializeAws_restJson1AssetModelCompositeModelDefinitions( - input.assetModelCompositeModels, - context - ), - }), - ...(input.assetModelDescription !== undefined && { assetModelDescription: input.assetModelDescription }), - ...(input.assetModelHierarchies !== undefined && { - assetModelHierarchies: serializeAws_restJson1AssetModelHierarchyDefinitions(input.assetModelHierarchies, context), - }), - ...(input.assetModelName !== undefined && { assetModelName: input.assetModelName }), - ...(input.assetModelProperties !== undefined && { - assetModelProperties: serializeAws_restJson1AssetModelPropertyDefinitions(input.assetModelProperties, context), - }), + ...(input.assetModelCompositeModels !== undefined && + input.assetModelCompositeModels !== null && { + assetModelCompositeModels: serializeAws_restJson1AssetModelCompositeModelDefinitions( + input.assetModelCompositeModels, + context + ), + }), + ...(input.assetModelDescription !== undefined && + input.assetModelDescription !== null && { assetModelDescription: input.assetModelDescription }), + ...(input.assetModelHierarchies !== undefined && + input.assetModelHierarchies !== null && { + assetModelHierarchies: serializeAws_restJson1AssetModelHierarchyDefinitions( + input.assetModelHierarchies, + context + ), + }), + ...(input.assetModelName !== undefined && + input.assetModelName !== null && { assetModelName: input.assetModelName }), + ...(input.assetModelProperties !== undefined && + input.assetModelProperties !== null && { + assetModelProperties: serializeAws_restJson1AssetModelPropertyDefinitions(input.assetModelProperties, context), + }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -477,17 +491,19 @@ export const serializeAws_restJson1CreateDashboardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/dashboards"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.dashboardDefinition !== undefined && { dashboardDefinition: input.dashboardDefinition }), - ...(input.dashboardDescription !== undefined && { dashboardDescription: input.dashboardDescription }), - ...(input.dashboardName !== undefined && { dashboardName: input.dashboardName }), - ...(input.projectId !== undefined && { projectId: input.projectId }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.dashboardDefinition !== undefined && + input.dashboardDefinition !== null && { dashboardDefinition: input.dashboardDefinition }), + ...(input.dashboardDescription !== undefined && + input.dashboardDescription !== null && { dashboardDescription: input.dashboardDescription }), + ...(input.dashboardName !== undefined && input.dashboardName !== null && { dashboardName: input.dashboardName }), + ...(input.projectId !== undefined && input.projectId !== null && { projectId: input.projectId }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -513,16 +529,17 @@ export const serializeAws_restJson1CreateGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/20200301/gateways"; let body: any; body = JSON.stringify({ - ...(input.gatewayName !== undefined && { gatewayName: input.gatewayName }), - ...(input.gatewayPlatform !== undefined && { - gatewayPlatform: serializeAws_restJson1GatewayPlatform(input.gatewayPlatform, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.gatewayName !== undefined && input.gatewayName !== null && { gatewayName: input.gatewayName }), + ...(input.gatewayPlatform !== undefined && + input.gatewayPlatform !== null && { + gatewayPlatform: serializeAws_restJson1GatewayPlatform(input.gatewayPlatform, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -548,21 +565,25 @@ export const serializeAws_restJson1CreatePortalCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/portals"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.portalAuthMode !== undefined && { portalAuthMode: input.portalAuthMode }), - ...(input.portalContactEmail !== undefined && { portalContactEmail: input.portalContactEmail }), - ...(input.portalDescription !== undefined && { portalDescription: input.portalDescription }), - ...(input.portalLogoImageFile !== undefined && { - portalLogoImageFile: serializeAws_restJson1ImageFile(input.portalLogoImageFile, context), - }), - ...(input.portalName !== undefined && { portalName: input.portalName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.portalAuthMode !== undefined && + input.portalAuthMode !== null && { portalAuthMode: input.portalAuthMode }), + ...(input.portalContactEmail !== undefined && + input.portalContactEmail !== null && { portalContactEmail: input.portalContactEmail }), + ...(input.portalDescription !== undefined && + input.portalDescription !== null && { portalDescription: input.portalDescription }), + ...(input.portalLogoImageFile !== undefined && + input.portalLogoImageFile !== null && { + portalLogoImageFile: serializeAws_restJson1ImageFile(input.portalLogoImageFile, context), + }), + ...(input.portalName !== undefined && input.portalName !== null && { portalName: input.portalName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -588,16 +609,17 @@ export const serializeAws_restJson1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.portalId !== undefined && { portalId: input.portalId }), - ...(input.projectDescription !== undefined && { projectDescription: input.projectDescription }), - ...(input.projectName !== undefined && { projectName: input.projectName }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.portalId !== undefined && input.portalId !== null && { portalId: input.portalId }), + ...(input.projectDescription !== undefined && + input.projectDescription !== null && { projectDescription: input.projectDescription }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -622,9 +644,7 @@ export const serializeAws_restJson1DeleteAccessPolicyCommand = async ( input: DeleteAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/access-policies/{accessPolicyId}"; if (input.accessPolicyId !== undefined) { const labelValue: string = input.accessPolicyId; @@ -663,9 +683,7 @@ export const serializeAws_restJson1DeleteAssetCommand = async ( input: DeleteAssetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assets/{assetId}"; if (input.assetId !== undefined) { const labelValue: string = input.assetId; @@ -704,9 +722,7 @@ export const serializeAws_restJson1DeleteAssetModelCommand = async ( input: DeleteAssetModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/asset-models/{assetModelId}"; if (input.assetModelId !== undefined) { const labelValue: string = input.assetModelId; @@ -745,9 +761,7 @@ export const serializeAws_restJson1DeleteDashboardCommand = async ( input: DeleteDashboardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dashboards/{dashboardId}"; if (input.dashboardId !== undefined) { const labelValue: string = input.dashboardId; @@ -786,9 +800,7 @@ export const serializeAws_restJson1DeleteGatewayCommand = async ( input: DeleteGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/20200301/gateways/{gatewayId}"; if (input.gatewayId !== undefined) { const labelValue: string = input.gatewayId; @@ -823,9 +835,7 @@ export const serializeAws_restJson1DeletePortalCommand = async ( input: DeletePortalCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/portals/{portalId}"; if (input.portalId !== undefined) { const labelValue: string = input.portalId; @@ -864,9 +874,7 @@ export const serializeAws_restJson1DeleteProjectCommand = async ( input: DeleteProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectId}"; if (input.projectId !== undefined) { const labelValue: string = input.projectId; @@ -905,9 +913,7 @@ export const serializeAws_restJson1DescribeAccessPolicyCommand = async ( input: DescribeAccessPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/access-policies/{accessPolicyId}"; if (input.accessPolicyId !== undefined) { const labelValue: string = input.accessPolicyId; @@ -942,9 +948,7 @@ export const serializeAws_restJson1DescribeAssetCommand = async ( input: DescribeAssetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assets/{assetId}"; if (input.assetId !== undefined) { const labelValue: string = input.assetId; @@ -979,9 +983,7 @@ export const serializeAws_restJson1DescribeAssetModelCommand = async ( input: DescribeAssetModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/asset-models/{assetModelId}"; if (input.assetModelId !== undefined) { const labelValue: string = input.assetModelId; @@ -1016,9 +1018,7 @@ export const serializeAws_restJson1DescribeAssetPropertyCommand = async ( input: DescribeAssetPropertyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assets/{assetId}/properties/{propertyId}"; if (input.assetId !== undefined) { const labelValue: string = input.assetId; @@ -1062,9 +1062,7 @@ export const serializeAws_restJson1DescribeDashboardCommand = async ( input: DescribeDashboardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dashboards/{dashboardId}"; if (input.dashboardId !== undefined) { const labelValue: string = input.dashboardId; @@ -1099,12 +1097,10 @@ export const serializeAws_restJson1DescribeDefaultEncryptionConfigurationCommand input: DescribeDefaultEncryptionConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/configuration/account/encryption"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1121,9 +1117,7 @@ export const serializeAws_restJson1DescribeGatewayCommand = async ( input: DescribeGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/20200301/gateways/{gatewayId}"; if (input.gatewayId !== undefined) { const labelValue: string = input.gatewayId; @@ -1158,9 +1152,7 @@ export const serializeAws_restJson1DescribeGatewayCapabilityConfigurationCommand input: DescribeGatewayCapabilityConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/20200301/gateways/{gatewayId}/capability/{capabilityNamespace}"; if (input.gatewayId !== undefined) { const labelValue: string = input.gatewayId; @@ -1204,12 +1196,10 @@ export const serializeAws_restJson1DescribeLoggingOptionsCommand = async ( input: DescribeLoggingOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/logging"; let body: any; - body = "{}"; + body = ""; let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { resolvedHostname = "model." + resolvedHostname; @@ -1233,9 +1223,7 @@ export const serializeAws_restJson1DescribePortalCommand = async ( input: DescribePortalCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/portals/{portalId}"; if (input.portalId !== undefined) { const labelValue: string = input.portalId; @@ -1270,9 +1258,7 @@ export const serializeAws_restJson1DescribeProjectCommand = async ( input: DescribeProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectId}"; if (input.projectId !== undefined) { const labelValue: string = input.projectId; @@ -1308,7 +1294,7 @@ export const serializeAws_restJson1DisassociateAssetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assets/{assetId}/disassociate"; if (input.assetId !== undefined) { @@ -1322,9 +1308,9 @@ export const serializeAws_restJson1DisassociateAssetsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.childAssetId !== undefined && { childAssetId: input.childAssetId }), + ...(input.childAssetId !== undefined && input.childAssetId !== null && { childAssetId: input.childAssetId }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.hierarchyId !== undefined && { hierarchyId: input.hierarchyId }), + ...(input.hierarchyId !== undefined && input.hierarchyId !== null && { hierarchyId: input.hierarchyId }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -1349,9 +1335,7 @@ export const serializeAws_restJson1GetAssetPropertyAggregatesCommand = async ( input: GetAssetPropertyAggregatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/properties/aggregates"; const query: any = { ...(input.assetId !== undefined && { assetId: input.assetId }), @@ -1391,9 +1375,7 @@ export const serializeAws_restJson1GetAssetPropertyValueCommand = async ( input: GetAssetPropertyValueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/properties/latest"; const query: any = { ...(input.assetId !== undefined && { assetId: input.assetId }), @@ -1425,9 +1407,7 @@ export const serializeAws_restJson1GetAssetPropertyValueHistoryCommand = async ( input: GetAssetPropertyValueHistoryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/properties/history"; const query: any = { ...(input.assetId !== undefined && { assetId: input.assetId }), @@ -1465,9 +1445,7 @@ export const serializeAws_restJson1ListAccessPoliciesCommand = async ( input: ListAccessPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/access-policies"; const query: any = { ...(input.identityType !== undefined && { identityType: input.identityType }), @@ -1503,9 +1481,7 @@ export const serializeAws_restJson1ListAssetModelsCommand = async ( input: ListAssetModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/asset-models"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1536,9 +1512,7 @@ export const serializeAws_restJson1ListAssetRelationshipsCommand = async ( input: ListAssetRelationshipsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assets/{assetId}/assetRelationships"; if (input.assetId !== undefined) { const labelValue: string = input.assetId; @@ -1579,9 +1553,7 @@ export const serializeAws_restJson1ListAssetsCommand = async ( input: ListAssetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assets"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1614,9 +1586,7 @@ export const serializeAws_restJson1ListAssociatedAssetsCommand = async ( input: ListAssociatedAssetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assets/{assetId}/hierarchies"; if (input.assetId !== undefined) { const labelValue: string = input.assetId; @@ -1658,9 +1628,7 @@ export const serializeAws_restJson1ListDashboardsCommand = async ( input: ListDashboardsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/dashboards"; const query: any = { ...(input.projectId !== undefined && { projectId: input.projectId }), @@ -1692,9 +1660,7 @@ export const serializeAws_restJson1ListGatewaysCommand = async ( input: ListGatewaysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/20200301/gateways"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1725,9 +1691,7 @@ export const serializeAws_restJson1ListPortalsCommand = async ( input: ListPortalsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/portals"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1758,9 +1722,7 @@ export const serializeAws_restJson1ListProjectAssetsCommand = async ( input: ListProjectAssetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectId}/assets"; if (input.projectId !== undefined) { const labelValue: string = input.projectId; @@ -1800,9 +1762,7 @@ export const serializeAws_restJson1ListProjectsCommand = async ( input: ListProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects"; const query: any = { ...(input.portalId !== undefined && { portalId: input.portalId }), @@ -1834,9 +1794,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags"; const query: any = { ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), @@ -1860,13 +1818,14 @@ export const serializeAws_restJson1PutDefaultEncryptionConfigurationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/configuration/account/encryption"; let body: any; body = JSON.stringify({ - ...(input.encryptionType !== undefined && { encryptionType: input.encryptionType }), - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), + ...(input.encryptionType !== undefined && + input.encryptionType !== null && { encryptionType: input.encryptionType }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1885,14 +1844,15 @@ export const serializeAws_restJson1PutLoggingOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/logging"; let body: any; body = JSON.stringify({ - ...(input.loggingOptions !== undefined && { - loggingOptions: serializeAws_restJson1LoggingOptions(input.loggingOptions, context), - }), + ...(input.loggingOptions !== undefined && + input.loggingOptions !== null && { + loggingOptions: serializeAws_restJson1LoggingOptions(input.loggingOptions, context), + }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -1918,7 +1878,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags"; const query: any = { @@ -1926,7 +1886,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1945,9 +1905,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags"; const query: any = { ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), @@ -1972,7 +1930,7 @@ export const serializeAws_restJson1UpdateAccessPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/access-policies/{accessPolicyId}"; if (input.accessPolicyId !== undefined) { @@ -1986,13 +1944,16 @@ export const serializeAws_restJson1UpdateAccessPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.accessPolicyIdentity !== undefined && { - accessPolicyIdentity: serializeAws_restJson1Identity(input.accessPolicyIdentity, context), - }), - ...(input.accessPolicyPermission !== undefined && { accessPolicyPermission: input.accessPolicyPermission }), - ...(input.accessPolicyResource !== undefined && { - accessPolicyResource: serializeAws_restJson1Resource(input.accessPolicyResource, context), - }), + ...(input.accessPolicyIdentity !== undefined && + input.accessPolicyIdentity !== null && { + accessPolicyIdentity: serializeAws_restJson1Identity(input.accessPolicyIdentity, context), + }), + ...(input.accessPolicyPermission !== undefined && + input.accessPolicyPermission !== null && { accessPolicyPermission: input.accessPolicyPermission }), + ...(input.accessPolicyResource !== undefined && + input.accessPolicyResource !== null && { + accessPolicyResource: serializeAws_restJson1Resource(input.accessPolicyResource, context), + }), clientToken: input.clientToken ?? generateIdempotencyToken(), }); let { hostname: resolvedHostname } = await context.endpoint(); @@ -2019,7 +1980,7 @@ export const serializeAws_restJson1UpdateAssetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assets/{assetId}"; if (input.assetId !== undefined) { @@ -2033,7 +1994,7 @@ export const serializeAws_restJson1UpdateAssetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.assetName !== undefined && { assetName: input.assetName }), + ...(input.assetName !== undefined && input.assetName !== null && { assetName: input.assetName }), clientToken: input.clientToken ?? generateIdempotencyToken(), }); let { hostname: resolvedHostname } = await context.endpoint(); @@ -2060,7 +2021,7 @@ export const serializeAws_restJson1UpdateAssetModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/asset-models/{assetModelId}"; if (input.assetModelId !== undefined) { @@ -2074,20 +2035,25 @@ export const serializeAws_restJson1UpdateAssetModelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.assetModelCompositeModels !== undefined && { - assetModelCompositeModels: serializeAws_restJson1AssetModelCompositeModels( - input.assetModelCompositeModels, - context - ), - }), - ...(input.assetModelDescription !== undefined && { assetModelDescription: input.assetModelDescription }), - ...(input.assetModelHierarchies !== undefined && { - assetModelHierarchies: serializeAws_restJson1AssetModelHierarchies(input.assetModelHierarchies, context), - }), - ...(input.assetModelName !== undefined && { assetModelName: input.assetModelName }), - ...(input.assetModelProperties !== undefined && { - assetModelProperties: serializeAws_restJson1AssetModelProperties(input.assetModelProperties, context), - }), + ...(input.assetModelCompositeModels !== undefined && + input.assetModelCompositeModels !== null && { + assetModelCompositeModels: serializeAws_restJson1AssetModelCompositeModels( + input.assetModelCompositeModels, + context + ), + }), + ...(input.assetModelDescription !== undefined && + input.assetModelDescription !== null && { assetModelDescription: input.assetModelDescription }), + ...(input.assetModelHierarchies !== undefined && + input.assetModelHierarchies !== null && { + assetModelHierarchies: serializeAws_restJson1AssetModelHierarchies(input.assetModelHierarchies, context), + }), + ...(input.assetModelName !== undefined && + input.assetModelName !== null && { assetModelName: input.assetModelName }), + ...(input.assetModelProperties !== undefined && + input.assetModelProperties !== null && { + assetModelProperties: serializeAws_restJson1AssetModelProperties(input.assetModelProperties, context), + }), clientToken: input.clientToken ?? generateIdempotencyToken(), }); let { hostname: resolvedHostname } = await context.endpoint(); @@ -2114,7 +2080,7 @@ export const serializeAws_restJson1UpdateAssetPropertyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assets/{assetId}/properties/{propertyId}"; if (input.assetId !== undefined) { @@ -2138,10 +2104,9 @@ export const serializeAws_restJson1UpdateAssetPropertyCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.propertyAlias !== undefined && { propertyAlias: input.propertyAlias }), - ...(input.propertyNotificationState !== undefined && { - propertyNotificationState: input.propertyNotificationState, - }), + ...(input.propertyAlias !== undefined && input.propertyAlias !== null && { propertyAlias: input.propertyAlias }), + ...(input.propertyNotificationState !== undefined && + input.propertyNotificationState !== null && { propertyNotificationState: input.propertyNotificationState }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -2167,7 +2132,7 @@ export const serializeAws_restJson1UpdateDashboardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/dashboards/{dashboardId}"; if (input.dashboardId !== undefined) { @@ -2182,9 +2147,11 @@ export const serializeAws_restJson1UpdateDashboardCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.dashboardDefinition !== undefined && { dashboardDefinition: input.dashboardDefinition }), - ...(input.dashboardDescription !== undefined && { dashboardDescription: input.dashboardDescription }), - ...(input.dashboardName !== undefined && { dashboardName: input.dashboardName }), + ...(input.dashboardDefinition !== undefined && + input.dashboardDefinition !== null && { dashboardDefinition: input.dashboardDefinition }), + ...(input.dashboardDescription !== undefined && + input.dashboardDescription !== null && { dashboardDescription: input.dashboardDescription }), + ...(input.dashboardName !== undefined && input.dashboardName !== null && { dashboardName: input.dashboardName }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -2210,7 +2177,7 @@ export const serializeAws_restJson1UpdateGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/20200301/gateways/{gatewayId}"; if (input.gatewayId !== undefined) { @@ -2224,7 +2191,7 @@ export const serializeAws_restJson1UpdateGatewayCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.gatewayName !== undefined && { gatewayName: input.gatewayName }), + ...(input.gatewayName !== undefined && input.gatewayName !== null && { gatewayName: input.gatewayName }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -2250,7 +2217,7 @@ export const serializeAws_restJson1UpdateGatewayCapabilityConfigurationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/20200301/gateways/{gatewayId}/capability"; if (input.gatewayId !== undefined) { @@ -2264,8 +2231,10 @@ export const serializeAws_restJson1UpdateGatewayCapabilityConfigurationCommand = } let body: any; body = JSON.stringify({ - ...(input.capabilityConfiguration !== undefined && { capabilityConfiguration: input.capabilityConfiguration }), - ...(input.capabilityNamespace !== undefined && { capabilityNamespace: input.capabilityNamespace }), + ...(input.capabilityConfiguration !== undefined && + input.capabilityConfiguration !== null && { capabilityConfiguration: input.capabilityConfiguration }), + ...(input.capabilityNamespace !== undefined && + input.capabilityNamespace !== null && { capabilityNamespace: input.capabilityNamespace }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -2291,7 +2260,7 @@ export const serializeAws_restJson1UpdatePortalCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/portals/{portalId}"; if (input.portalId !== undefined) { @@ -2306,13 +2275,16 @@ export const serializeAws_restJson1UpdatePortalCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.portalContactEmail !== undefined && { portalContactEmail: input.portalContactEmail }), - ...(input.portalDescription !== undefined && { portalDescription: input.portalDescription }), - ...(input.portalLogoImage !== undefined && { - portalLogoImage: serializeAws_restJson1Image(input.portalLogoImage, context), - }), - ...(input.portalName !== undefined && { portalName: input.portalName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.portalContactEmail !== undefined && + input.portalContactEmail !== null && { portalContactEmail: input.portalContactEmail }), + ...(input.portalDescription !== undefined && + input.portalDescription !== null && { portalDescription: input.portalDescription }), + ...(input.portalLogoImage !== undefined && + input.portalLogoImage !== null && { + portalLogoImage: serializeAws_restJson1Image(input.portalLogoImage, context), + }), + ...(input.portalName !== undefined && input.portalName !== null && { portalName: input.portalName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -2338,7 +2310,7 @@ export const serializeAws_restJson1UpdateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/projects/{projectId}"; if (input.projectId !== undefined) { @@ -2353,8 +2325,9 @@ export const serializeAws_restJson1UpdateProjectCommand = async ( let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.projectDescription !== undefined && { projectDescription: input.projectDescription }), - ...(input.projectName !== undefined && { projectName: input.projectName }), + ...(input.projectDescription !== undefined && + input.projectDescription !== null && { projectDescription: input.projectDescription }), + ...(input.projectName !== undefined && input.projectName !== null && { projectName: input.projectName }), }); let { hostname: resolvedHostname } = await context.endpoint(); if (context.disableHostPrefix !== true) { @@ -7697,12 +7670,13 @@ const serializeAws_restJson1AssetModelCompositeModel = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.properties !== undefined && { - properties: serializeAws_restJson1AssetModelProperties(input.properties, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.properties !== undefined && + input.properties !== null && { + properties: serializeAws_restJson1AssetModelProperties(input.properties, context), + }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -7711,12 +7685,13 @@ const serializeAws_restJson1AssetModelCompositeModelDefinition = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.properties !== undefined && { - properties: serializeAws_restJson1AssetModelPropertyDefinitions(input.properties, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.properties !== undefined && + input.properties !== null && { + properties: serializeAws_restJson1AssetModelPropertyDefinitions(input.properties, context), + }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; @@ -7724,25 +7699,47 @@ const serializeAws_restJson1AssetModelCompositeModelDefinitions = ( input: AssetModelCompositeModelDefinition[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AssetModelCompositeModelDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetModelCompositeModelDefinition(entry, context); + }); }; const serializeAws_restJson1AssetModelCompositeModels = ( input: AssetModelCompositeModel[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AssetModelCompositeModel(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetModelCompositeModel(entry, context); + }); }; const serializeAws_restJson1AssetModelHierarchies = (input: AssetModelHierarchy[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AssetModelHierarchy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetModelHierarchy(entry, context); + }); }; const serializeAws_restJson1AssetModelHierarchy = (input: AssetModelHierarchy, context: __SerdeContext): any => { return { - ...(input.childAssetModelId !== undefined && { childAssetModelId: input.childAssetModelId }), - ...(input.id !== undefined && { id: input.id }), - ...(input.name !== undefined && { name: input.name }), + ...(input.childAssetModelId !== undefined && + input.childAssetModelId !== null && { childAssetModelId: input.childAssetModelId }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -7751,8 +7748,9 @@ const serializeAws_restJson1AssetModelHierarchyDefinition = ( context: __SerdeContext ): any => { return { - ...(input.childAssetModelId !== undefined && { childAssetModelId: input.childAssetModelId }), - ...(input.name !== undefined && { name: input.name }), + ...(input.childAssetModelId !== undefined && + input.childAssetModelId !== null && { childAssetModelId: input.childAssetModelId }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -7760,21 +7758,36 @@ const serializeAws_restJson1AssetModelHierarchyDefinitions = ( input: AssetModelHierarchyDefinition[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AssetModelHierarchyDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetModelHierarchyDefinition(entry, context); + }); }; const serializeAws_restJson1AssetModelProperties = (input: AssetModelProperty[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AssetModelProperty(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetModelProperty(entry, context); + }); }; const serializeAws_restJson1AssetModelProperty = (input: AssetModelProperty, context: __SerdeContext): any => { return { - ...(input.dataType !== undefined && { dataType: input.dataType }), - ...(input.dataTypeSpec !== undefined && { dataTypeSpec: input.dataTypeSpec }), - ...(input.id !== undefined && { id: input.id }), - ...(input.name !== undefined && { name: input.name }), - ...(input.type !== undefined && { type: serializeAws_restJson1PropertyType(input.type, context) }), - ...(input.unit !== undefined && { unit: input.unit }), + ...(input.dataType !== undefined && input.dataType !== null && { dataType: input.dataType }), + ...(input.dataTypeSpec !== undefined && input.dataTypeSpec !== null && { dataTypeSpec: input.dataTypeSpec }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.type !== undefined && + input.type !== null && { type: serializeAws_restJson1PropertyType(input.type, context) }), + ...(input.unit !== undefined && input.unit !== null && { unit: input.unit }), }; }; @@ -7783,11 +7796,12 @@ const serializeAws_restJson1AssetModelPropertyDefinition = ( context: __SerdeContext ): any => { return { - ...(input.dataType !== undefined && { dataType: input.dataType }), - ...(input.dataTypeSpec !== undefined && { dataTypeSpec: input.dataTypeSpec }), - ...(input.name !== undefined && { name: input.name }), - ...(input.type !== undefined && { type: serializeAws_restJson1PropertyType(input.type, context) }), - ...(input.unit !== undefined && { unit: input.unit }), + ...(input.dataType !== undefined && input.dataType !== null && { dataType: input.dataType }), + ...(input.dataTypeSpec !== undefined && input.dataTypeSpec !== null && { dataTypeSpec: input.dataTypeSpec }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.type !== undefined && + input.type !== null && { type: serializeAws_restJson1PropertyType(input.type, context) }), + ...(input.unit !== undefined && input.unit !== null && { unit: input.unit }), }; }; @@ -7795,91 +7809,127 @@ const serializeAws_restJson1AssetModelPropertyDefinitions = ( input: AssetModelPropertyDefinition[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AssetModelPropertyDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetModelPropertyDefinition(entry, context); + }); }; const serializeAws_restJson1AssetPropertyValue = (input: AssetPropertyValue, context: __SerdeContext): any => { return { - ...(input.quality !== undefined && { quality: input.quality }), - ...(input.timestamp !== undefined && { timestamp: serializeAws_restJson1TimeInNanos(input.timestamp, context) }), - ...(input.value !== undefined && { value: serializeAws_restJson1Variant(input.value, context) }), + ...(input.quality !== undefined && input.quality !== null && { quality: input.quality }), + ...(input.timestamp !== undefined && + input.timestamp !== null && { timestamp: serializeAws_restJson1TimeInNanos(input.timestamp, context) }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_restJson1Variant(input.value, context) }), }; }; const serializeAws_restJson1AssetPropertyValues = (input: AssetPropertyValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AssetPropertyValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AssetPropertyValue(entry, context); + }); }; const serializeAws_restJson1Attribute = (input: Attribute, context: __SerdeContext): any => { return { - ...(input.defaultValue !== undefined && { defaultValue: input.defaultValue }), + ...(input.defaultValue !== undefined && input.defaultValue !== null && { defaultValue: input.defaultValue }), }; }; const serializeAws_restJson1ExpressionVariable = (input: ExpressionVariable, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: serializeAws_restJson1VariableValue(input.value, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_restJson1VariableValue(input.value, context) }), }; }; const serializeAws_restJson1ExpressionVariables = (input: ExpressionVariable[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ExpressionVariable(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ExpressionVariable(entry, context); + }); }; const serializeAws_restJson1GatewayPlatform = (input: GatewayPlatform, context: __SerdeContext): any => { return { - ...(input.greengrass !== undefined && { greengrass: serializeAws_restJson1Greengrass(input.greengrass, context) }), + ...(input.greengrass !== undefined && + input.greengrass !== null && { greengrass: serializeAws_restJson1Greengrass(input.greengrass, context) }), }; }; const serializeAws_restJson1Greengrass = (input: Greengrass, context: __SerdeContext): any => { return { - ...(input.groupArn !== undefined && { groupArn: input.groupArn }), + ...(input.groupArn !== undefined && input.groupArn !== null && { groupArn: input.groupArn }), }; }; const serializeAws_restJson1GroupIdentity = (input: GroupIdentity, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_restJson1IAMUserIdentity = (input: IAMUserIdentity, context: __SerdeContext): any => { return { - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }; }; const serializeAws_restJson1Identity = (input: Identity, context: __SerdeContext): any => { return { - ...(input.group !== undefined && { group: serializeAws_restJson1GroupIdentity(input.group, context) }), - ...(input.iamUser !== undefined && { iamUser: serializeAws_restJson1IAMUserIdentity(input.iamUser, context) }), - ...(input.user !== undefined && { user: serializeAws_restJson1UserIdentity(input.user, context) }), + ...(input.group !== undefined && + input.group !== null && { group: serializeAws_restJson1GroupIdentity(input.group, context) }), + ...(input.iamUser !== undefined && + input.iamUser !== null && { iamUser: serializeAws_restJson1IAMUserIdentity(input.iamUser, context) }), + ...(input.user !== undefined && + input.user !== null && { user: serializeAws_restJson1UserIdentity(input.user, context) }), }; }; const serializeAws_restJson1IDs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Image = (input: Image, context: __SerdeContext): any => { return { - ...(input.file !== undefined && { file: serializeAws_restJson1ImageFile(input.file, context) }), - ...(input.id !== undefined && { id: input.id }), + ...(input.file !== undefined && + input.file !== null && { file: serializeAws_restJson1ImageFile(input.file, context) }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_restJson1ImageFile = (input: ImageFile, context: __SerdeContext): any => { return { - ...(input.data !== undefined && { data: context.base64Encoder(input.data) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1LoggingOptions = (input: LoggingOptions, context: __SerdeContext): any => { return { - ...(input.level !== undefined && { level: input.level }), + ...(input.level !== undefined && input.level !== null && { level: input.level }), }; }; @@ -7889,40 +7939,43 @@ const serializeAws_restJson1Measurement = (input: Measurement, context: __SerdeC const serializeAws_restJson1Metric = (input: Metric, context: __SerdeContext): any => { return { - ...(input.expression !== undefined && { expression: input.expression }), - ...(input.variables !== undefined && { - variables: serializeAws_restJson1ExpressionVariables(input.variables, context), - }), - ...(input.window !== undefined && { window: serializeAws_restJson1MetricWindow(input.window, context) }), + ...(input.expression !== undefined && input.expression !== null && { expression: input.expression }), + ...(input.variables !== undefined && + input.variables !== null && { variables: serializeAws_restJson1ExpressionVariables(input.variables, context) }), + ...(input.window !== undefined && + input.window !== null && { window: serializeAws_restJson1MetricWindow(input.window, context) }), }; }; const serializeAws_restJson1MetricWindow = (input: MetricWindow, context: __SerdeContext): any => { return { - ...(input.tumbling !== undefined && { tumbling: serializeAws_restJson1TumblingWindow(input.tumbling, context) }), + ...(input.tumbling !== undefined && + input.tumbling !== null && { tumbling: serializeAws_restJson1TumblingWindow(input.tumbling, context) }), }; }; const serializeAws_restJson1PortalResource = (input: PortalResource, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_restJson1ProjectResource = (input: ProjectResource, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_restJson1PropertyType = (input: PropertyType, context: __SerdeContext): any => { return { - ...(input.attribute !== undefined && { attribute: serializeAws_restJson1Attribute(input.attribute, context) }), - ...(input.measurement !== undefined && { - measurement: serializeAws_restJson1Measurement(input.measurement, context), - }), - ...(input.metric !== undefined && { metric: serializeAws_restJson1Metric(input.metric, context) }), - ...(input.transform !== undefined && { transform: serializeAws_restJson1Transform(input.transform, context) }), + ...(input.attribute !== undefined && + input.attribute !== null && { attribute: serializeAws_restJson1Attribute(input.attribute, context) }), + ...(input.measurement !== undefined && + input.measurement !== null && { measurement: serializeAws_restJson1Measurement(input.measurement, context) }), + ...(input.metric !== undefined && + input.metric !== null && { metric: serializeAws_restJson1Metric(input.metric, context) }), + ...(input.transform !== undefined && + input.transform !== null && { transform: serializeAws_restJson1Transform(input.transform, context) }), }; }; @@ -7930,7 +7983,14 @@ const serializeAws_restJson1PutAssetPropertyValueEntries = ( input: PutAssetPropertyValueEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1PutAssetPropertyValueEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1PutAssetPropertyValueEntry(entry, context); + }); }; const serializeAws_restJson1PutAssetPropertyValueEntry = ( @@ -7938,79 +7998,90 @@ const serializeAws_restJson1PutAssetPropertyValueEntry = ( context: __SerdeContext ): any => { return { - ...(input.assetId !== undefined && { assetId: input.assetId }), - ...(input.entryId !== undefined && { entryId: input.entryId }), - ...(input.propertyAlias !== undefined && { propertyAlias: input.propertyAlias }), - ...(input.propertyId !== undefined && { propertyId: input.propertyId }), - ...(input.propertyValues !== undefined && { - propertyValues: serializeAws_restJson1AssetPropertyValues(input.propertyValues, context), - }), + ...(input.assetId !== undefined && input.assetId !== null && { assetId: input.assetId }), + ...(input.entryId !== undefined && input.entryId !== null && { entryId: input.entryId }), + ...(input.propertyAlias !== undefined && input.propertyAlias !== null && { propertyAlias: input.propertyAlias }), + ...(input.propertyId !== undefined && input.propertyId !== null && { propertyId: input.propertyId }), + ...(input.propertyValues !== undefined && + input.propertyValues !== null && { + propertyValues: serializeAws_restJson1AssetPropertyValues(input.propertyValues, context), + }), }; }; const serializeAws_restJson1Resource = (input: Resource, context: __SerdeContext): any => { return { - ...(input.portal !== undefined && { portal: serializeAws_restJson1PortalResource(input.portal, context) }), - ...(input.project !== undefined && { project: serializeAws_restJson1ProjectResource(input.project, context) }), + ...(input.portal !== undefined && + input.portal !== null && { portal: serializeAws_restJson1PortalResource(input.portal, context) }), + ...(input.project !== undefined && + input.project !== null && { project: serializeAws_restJson1ProjectResource(input.project, context) }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TimeInNanos = (input: TimeInNanos, context: __SerdeContext): any => { return { - ...(input.offsetInNanos !== undefined && { offsetInNanos: input.offsetInNanos }), - ...(input.timeInSeconds !== undefined && { timeInSeconds: input.timeInSeconds }), + ...(input.offsetInNanos !== undefined && input.offsetInNanos !== null && { offsetInNanos: input.offsetInNanos }), + ...(input.timeInSeconds !== undefined && input.timeInSeconds !== null && { timeInSeconds: input.timeInSeconds }), }; }; const serializeAws_restJson1Transform = (input: Transform, context: __SerdeContext): any => { return { - ...(input.expression !== undefined && { expression: input.expression }), - ...(input.variables !== undefined && { - variables: serializeAws_restJson1ExpressionVariables(input.variables, context), - }), + ...(input.expression !== undefined && input.expression !== null && { expression: input.expression }), + ...(input.variables !== undefined && + input.variables !== null && { variables: serializeAws_restJson1ExpressionVariables(input.variables, context) }), }; }; const serializeAws_restJson1TumblingWindow = (input: TumblingWindow, context: __SerdeContext): any => { return { - ...(input.interval !== undefined && { interval: input.interval }), + ...(input.interval !== undefined && input.interval !== null && { interval: input.interval }), }; }; const serializeAws_restJson1UserIdentity = (input: UserIdentity, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_restJson1VariableValue = (input: VariableValue, context: __SerdeContext): any => { return { - ...(input.hierarchyId !== undefined && { hierarchyId: input.hierarchyId }), - ...(input.propertyId !== undefined && { propertyId: input.propertyId }), + ...(input.hierarchyId !== undefined && input.hierarchyId !== null && { hierarchyId: input.hierarchyId }), + ...(input.propertyId !== undefined && input.propertyId !== null && { propertyId: input.propertyId }), }; }; const serializeAws_restJson1Variant = (input: Variant, context: __SerdeContext): any => { return { - ...(input.booleanValue !== undefined && { booleanValue: input.booleanValue }), - ...(input.doubleValue !== undefined && { doubleValue: input.doubleValue }), - ...(input.integerValue !== undefined && { integerValue: input.integerValue }), - ...(input.stringValue !== undefined && { stringValue: input.stringValue }), + ...(input.booleanValue !== undefined && input.booleanValue !== null && { booleanValue: input.booleanValue }), + ...(input.doubleValue !== undefined && input.doubleValue !== null && { doubleValue: input.doubleValue }), + ...(input.integerValue !== undefined && input.integerValue !== null && { integerValue: input.integerValue }), + ...(input.stringValue !== undefined && input.stringValue !== null && { stringValue: input.stringValue }), }; }; const deserializeAws_restJson1AccessPolicySummaries = (output: any, context: __SerdeContext): AccessPolicySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AccessPolicySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AccessPolicySummary(entry, context); + }); }; const deserializeAws_restJson1AccessPolicySummary = (output: any, context: __SerdeContext): AccessPolicySummary => { @@ -8051,7 +8122,14 @@ const deserializeAws_restJson1AggregatedValue = (output: any, context: __SerdeCo }; const deserializeAws_restJson1AggregatedValues = (output: any, context: __SerdeContext): AggregatedValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AggregatedValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AggregatedValue(entry, context); + }); }; const deserializeAws_restJson1Aggregates = (output: any, context: __SerdeContext): Aggregates => { @@ -8081,7 +8159,14 @@ const deserializeAws_restJson1AssetCompositeModel = (output: any, context: __Ser }; const deserializeAws_restJson1AssetCompositeModels = (output: any, context: __SerdeContext): AssetCompositeModel[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetCompositeModel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetCompositeModel(entry, context); + }); }; const deserializeAws_restJson1AssetErrorDetails = (output: any, context: __SerdeContext): AssetErrorDetails => { @@ -8093,7 +8178,14 @@ const deserializeAws_restJson1AssetErrorDetails = (output: any, context: __Serde }; const deserializeAws_restJson1AssetHierarchies = (output: any, context: __SerdeContext): AssetHierarchy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetHierarchy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetHierarchy(entry, context); + }); }; const deserializeAws_restJson1AssetHierarchy = (output: any, context: __SerdeContext): AssetHierarchy => { @@ -8112,7 +8204,14 @@ const deserializeAws_restJson1AssetHierarchyInfo = (output: any, context: __Serd }; const deserializeAws_restJson1AssetIDs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AssetModelCompositeModel = ( @@ -8134,11 +8233,25 @@ const deserializeAws_restJson1AssetModelCompositeModels = ( output: any, context: __SerdeContext ): AssetModelCompositeModel[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetModelCompositeModel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetModelCompositeModel(entry, context); + }); }; const deserializeAws_restJson1AssetModelHierarchies = (output: any, context: __SerdeContext): AssetModelHierarchy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetModelHierarchy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetModelHierarchy(entry, context); + }); }; const deserializeAws_restJson1AssetModelHierarchy = (output: any, context: __SerdeContext): AssetModelHierarchy => { @@ -8153,7 +8266,14 @@ const deserializeAws_restJson1AssetModelHierarchy = (output: any, context: __Ser }; const deserializeAws_restJson1AssetModelProperties = (output: any, context: __SerdeContext): AssetModelProperty[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetModelProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetModelProperty(entry, context); + }); }; const deserializeAws_restJson1AssetModelProperty = (output: any, context: __SerdeContext): AssetModelProperty => { @@ -8181,7 +8301,14 @@ const deserializeAws_restJson1AssetModelStatus = (output: any, context: __SerdeC }; const deserializeAws_restJson1AssetModelSummaries = (output: any, context: __SerdeContext): AssetModelSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetModelSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetModelSummary(entry, context); + }); }; const deserializeAws_restJson1AssetModelSummary = (output: any, context: __SerdeContext): AssetModelSummary => { @@ -8206,7 +8333,14 @@ const deserializeAws_restJson1AssetModelSummary = (output: any, context: __Serde }; const deserializeAws_restJson1AssetProperties = (output: any, context: __SerdeContext): AssetProperty[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetProperty(entry, context); + }); }; const deserializeAws_restJson1AssetProperty = (output: any, context: __SerdeContext): AssetProperty => { @@ -8242,14 +8376,28 @@ const deserializeAws_restJson1AssetPropertyValueHistory = ( output: any, context: __SerdeContext ): AssetPropertyValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetPropertyValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetPropertyValue(entry, context); + }); }; const deserializeAws_restJson1AssetRelationshipSummaries = ( output: any, context: __SerdeContext ): AssetRelationshipSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetRelationshipSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetRelationshipSummary(entry, context); + }); }; const deserializeAws_restJson1AssetRelationshipSummary = ( @@ -8277,7 +8425,14 @@ const deserializeAws_restJson1AssetStatus = (output: any, context: __SerdeContex }; const deserializeAws_restJson1AssetSummaries = (output: any, context: __SerdeContext): AssetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetSummary(entry, context); + }); }; const deserializeAws_restJson1AssetSummary = (output: any, context: __SerdeContext): AssetSummary => { @@ -8309,7 +8464,14 @@ const deserializeAws_restJson1AssociatedAssetsSummaries = ( output: any, context: __SerdeContext ): AssociatedAssetsSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssociatedAssetsSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssociatedAssetsSummary(entry, context); + }); }; const deserializeAws_restJson1AssociatedAssetsSummary = ( @@ -8350,14 +8512,28 @@ const deserializeAws_restJson1BatchAssociateProjectAssetsErrors = ( output: any, context: __SerdeContext ): AssetErrorDetails[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetErrorDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetErrorDetails(entry, context); + }); }; const deserializeAws_restJson1BatchDisassociateProjectAssetsErrors = ( output: any, context: __SerdeContext ): AssetErrorDetails[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetErrorDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetErrorDetails(entry, context); + }); }; const deserializeAws_restJson1BatchPutAssetPropertyError = ( @@ -8378,7 +8554,14 @@ const deserializeAws_restJson1BatchPutAssetPropertyErrorEntries = ( output: any, context: __SerdeContext ): BatchPutAssetPropertyErrorEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchPutAssetPropertyErrorEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchPutAssetPropertyErrorEntry(entry, context); + }); }; const deserializeAws_restJson1BatchPutAssetPropertyErrorEntry = ( @@ -8398,7 +8581,14 @@ const deserializeAws_restJson1BatchPutAssetPropertyErrors = ( output: any, context: __SerdeContext ): BatchPutAssetPropertyError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchPutAssetPropertyError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchPutAssetPropertyError(entry, context); + }); }; const deserializeAws_restJson1CompositeModelProperty = ( @@ -8436,7 +8626,14 @@ const deserializeAws_restJson1ConfigurationStatus = (output: any, context: __Ser }; const deserializeAws_restJson1DashboardSummaries = (output: any, context: __SerdeContext): DashboardSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DashboardSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DashboardSummary(entry, context); + }); }; const deserializeAws_restJson1DashboardSummary = (output: any, context: __SerdeContext): DashboardSummary => { @@ -8473,14 +8670,28 @@ const deserializeAws_restJson1ExpressionVariable = (output: any, context: __Serd }; const deserializeAws_restJson1ExpressionVariables = (output: any, context: __SerdeContext): ExpressionVariable[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ExpressionVariable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ExpressionVariable(entry, context); + }); }; const deserializeAws_restJson1GatewayCapabilitySummaries = ( output: any, context: __SerdeContext ): GatewayCapabilitySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GatewayCapabilitySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GatewayCapabilitySummary(entry, context); + }); }; const deserializeAws_restJson1GatewayCapabilitySummary = ( @@ -8509,7 +8720,14 @@ const deserializeAws_restJson1GatewayPlatform = (output: any, context: __SerdeCo }; const deserializeAws_restJson1GatewaySummaries = (output: any, context: __SerdeContext): GatewaySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GatewaySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GatewaySummary(entry, context); + }); }; const deserializeAws_restJson1GatewaySummary = (output: any, context: __SerdeContext): GatewaySummary => { @@ -8630,7 +8848,14 @@ const deserializeAws_restJson1PortalStatus = (output: any, context: __SerdeConte }; const deserializeAws_restJson1PortalSummaries = (output: any, context: __SerdeContext): PortalSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PortalSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PortalSummary(entry, context); + }); }; const deserializeAws_restJson1PortalSummary = (output: any, context: __SerdeContext): PortalSummary => { @@ -8662,7 +8887,14 @@ const deserializeAws_restJson1ProjectResource = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ProjectSummaries = (output: any, context: __SerdeContext): ProjectSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProjectSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProjectSummary(entry, context); + }); }; const deserializeAws_restJson1ProjectSummary = (output: any, context: __SerdeContext): ProjectSummary => { @@ -8741,13 +8973,15 @@ const deserializeAws_restJson1Resource = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TimeInNanos = (output: any, context: __SerdeContext): TimeInNanos => { @@ -8760,7 +8994,14 @@ const deserializeAws_restJson1TimeInNanos = (output: any, context: __SerdeContex }; const deserializeAws_restJson1Timestamps = (output: any, context: __SerdeContext): TimeInNanos[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TimeInNanos(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TimeInNanos(entry, context); + }); }; const deserializeAws_restJson1Transform = (output: any, context: __SerdeContext): Transform => { @@ -8821,6 +9062,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-iotthingsgraph/protocols/Aws_json1_1.ts b/clients/client-iotthingsgraph/protocols/Aws_json1_1.ts index 164b2ff7f318..f8d1269bb52a 100644 --- a/clients/client-iotthingsgraph/protocols/Aws_json1_1.ts +++ b/clients/client-iotthingsgraph/protocols/Aws_json1_1.ts @@ -209,7 +209,7 @@ export const serializeAws_json1_1AssociateEntityToThingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.AssociateEntityToThing", }; let body: any; @@ -222,7 +222,7 @@ export const serializeAws_json1_1CreateFlowTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.CreateFlowTemplate", }; let body: any; @@ -235,7 +235,7 @@ export const serializeAws_json1_1CreateSystemInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.CreateSystemInstance", }; let body: any; @@ -248,7 +248,7 @@ export const serializeAws_json1_1CreateSystemTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.CreateSystemTemplate", }; let body: any; @@ -261,7 +261,7 @@ export const serializeAws_json1_1DeleteFlowTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.DeleteFlowTemplate", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1DeleteNamespaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.DeleteNamespace", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1DeleteSystemInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.DeleteSystemInstance", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1DeleteSystemTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.DeleteSystemTemplate", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1DeploySystemInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.DeploySystemInstance", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1DeprecateFlowTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.DeprecateFlowTemplate", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1DeprecateSystemTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.DeprecateSystemTemplate", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1DescribeNamespaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.DescribeNamespace", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1DissociateEntityFromThingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.DissociateEntityFromThing", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1GetEntitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.GetEntities", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1GetFlowTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.GetFlowTemplate", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1GetFlowTemplateRevisionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.GetFlowTemplateRevisions", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1GetNamespaceDeletionStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.GetNamespaceDeletionStatus", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1GetSystemInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.GetSystemInstance", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1GetSystemTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.GetSystemTemplate", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1GetSystemTemplateRevisionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.GetSystemTemplateRevisions", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1GetUploadStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.GetUploadStatus", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1ListFlowExecutionMessagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.ListFlowExecutionMessages", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.ListTagsForResource", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1SearchEntitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.SearchEntities", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1SearchFlowExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.SearchFlowExecutions", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1SearchFlowTemplatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.SearchFlowTemplates", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1SearchSystemInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.SearchSystemInstances", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1SearchSystemTemplatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.SearchSystemTemplates", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1SearchThingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.SearchThings", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.TagResource", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1UndeploySystemInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.UndeploySystemInstance", }; let body: any; @@ -612,7 +612,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.UntagResource", }; let body: any; @@ -625,7 +625,7 @@ export const serializeAws_json1_1UpdateFlowTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.UpdateFlowTemplate", }; let body: any; @@ -638,7 +638,7 @@ export const serializeAws_json1_1UpdateSystemTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.UpdateSystemTemplate", }; let body: any; @@ -651,7 +651,7 @@ export const serializeAws_json1_1UploadEntityDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "IotThingsGraphFrontEndService.UploadEntityDefinitions", }; let body: any; @@ -686,8 +686,7 @@ const deserializeAws_json1_1AssociateEntityToThingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -765,8 +764,7 @@ const deserializeAws_json1_1CreateFlowTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -852,8 +850,7 @@ const deserializeAws_json1_1CreateSystemInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -939,8 +936,7 @@ const deserializeAws_json1_1CreateSystemTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1018,8 +1014,7 @@ const deserializeAws_json1_1DeleteFlowTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1097,8 +1092,7 @@ const deserializeAws_json1_1DeleteNamespaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1160,8 +1154,7 @@ const deserializeAws_json1_1DeleteSystemInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1239,8 +1232,7 @@ const deserializeAws_json1_1DeleteSystemTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1318,8 +1310,7 @@ const deserializeAws_json1_1DeploySystemInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1405,8 +1396,7 @@ const deserializeAws_json1_1DeprecateFlowTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1484,8 +1474,7 @@ const deserializeAws_json1_1DeprecateSystemTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1563,8 +1552,7 @@ const deserializeAws_json1_1DescribeNamespaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1642,8 +1630,7 @@ const deserializeAws_json1_1DissociateEntityFromThingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1721,8 +1708,7 @@ const deserializeAws_json1_1GetEntitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1800,8 +1786,7 @@ const deserializeAws_json1_1GetFlowTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1879,8 +1864,7 @@ const deserializeAws_json1_1GetFlowTemplateRevisionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -1958,8 +1942,7 @@ const deserializeAws_json1_1GetNamespaceDeletionStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2029,8 +2012,7 @@ const deserializeAws_json1_1GetSystemInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2108,8 +2090,7 @@ const deserializeAws_json1_1GetSystemTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2187,8 +2168,7 @@ const deserializeAws_json1_1GetSystemTemplateRevisionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2266,8 +2246,7 @@ const deserializeAws_json1_1GetUploadStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2345,8 +2324,7 @@ const deserializeAws_json1_1ListFlowExecutionMessagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2424,8 +2402,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2503,8 +2480,7 @@ const deserializeAws_json1_1SearchEntitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2574,8 +2550,7 @@ const deserializeAws_json1_1SearchFlowExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2653,8 +2628,7 @@ const deserializeAws_json1_1SearchFlowTemplatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2724,8 +2698,7 @@ const deserializeAws_json1_1SearchSystemInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2795,8 +2768,7 @@ const deserializeAws_json1_1SearchSystemTemplatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2866,8 +2838,7 @@ const deserializeAws_json1_1SearchThingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -2945,8 +2916,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -3024,8 +2994,7 @@ const deserializeAws_json1_1UndeploySystemInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -3111,8 +3080,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -3190,8 +3158,7 @@ const deserializeAws_json1_1UpdateFlowTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -3269,8 +3236,7 @@ const deserializeAws_json1_1UpdateSystemTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -3348,8 +3314,7 @@ const deserializeAws_json1_1UploadEntityDefinitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalFailureException": case "com.amazonaws.iotthingsgraph#InternalFailureException": @@ -3502,9 +3467,10 @@ const serializeAws_json1_1AssociateEntityToThingRequest = ( context: __SerdeContext ): any => { return { - ...(input.entityId !== undefined && { entityId: input.entityId }), - ...(input.namespaceVersion !== undefined && { namespaceVersion: input.namespaceVersion }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.entityId !== undefined && input.entityId !== null && { entityId: input.entityId }), + ...(input.namespaceVersion !== undefined && + input.namespaceVersion !== null && { namespaceVersion: input.namespaceVersion }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }; }; @@ -3513,12 +3479,10 @@ const serializeAws_json1_1CreateFlowTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.compatibleNamespaceVersion !== undefined && { - compatibleNamespaceVersion: input.compatibleNamespaceVersion, - }), - ...(input.definition !== undefined && { - definition: serializeAws_json1_1DefinitionDocument(input.definition, context), - }), + ...(input.compatibleNamespaceVersion !== undefined && + input.compatibleNamespaceVersion !== null && { compatibleNamespaceVersion: input.compatibleNamespaceVersion }), + ...(input.definition !== undefined && + input.definition !== null && { definition: serializeAws_json1_1DefinitionDocument(input.definition, context) }), }; }; @@ -3527,17 +3491,19 @@ const serializeAws_json1_1CreateSystemInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.definition !== undefined && { - definition: serializeAws_json1_1DefinitionDocument(input.definition, context), - }), - ...(input.flowActionsRoleArn !== undefined && { flowActionsRoleArn: input.flowActionsRoleArn }), - ...(input.greengrassGroupName !== undefined && { greengrassGroupName: input.greengrassGroupName }), - ...(input.metricsConfiguration !== undefined && { - metricsConfiguration: serializeAws_json1_1MetricsConfiguration(input.metricsConfiguration, context), - }), - ...(input.s3BucketName !== undefined && { s3BucketName: input.s3BucketName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.target !== undefined && { target: input.target }), + ...(input.definition !== undefined && + input.definition !== null && { definition: serializeAws_json1_1DefinitionDocument(input.definition, context) }), + ...(input.flowActionsRoleArn !== undefined && + input.flowActionsRoleArn !== null && { flowActionsRoleArn: input.flowActionsRoleArn }), + ...(input.greengrassGroupName !== undefined && + input.greengrassGroupName !== null && { greengrassGroupName: input.greengrassGroupName }), + ...(input.metricsConfiguration !== undefined && + input.metricsConfiguration !== null && { + metricsConfiguration: serializeAws_json1_1MetricsConfiguration(input.metricsConfiguration, context), + }), + ...(input.s3BucketName !== undefined && input.s3BucketName !== null && { s3BucketName: input.s3BucketName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.target !== undefined && input.target !== null && { target: input.target }), }; }; @@ -3546,19 +3512,17 @@ const serializeAws_json1_1CreateSystemTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.compatibleNamespaceVersion !== undefined && { - compatibleNamespaceVersion: input.compatibleNamespaceVersion, - }), - ...(input.definition !== undefined && { - definition: serializeAws_json1_1DefinitionDocument(input.definition, context), - }), + ...(input.compatibleNamespaceVersion !== undefined && + input.compatibleNamespaceVersion !== null && { compatibleNamespaceVersion: input.compatibleNamespaceVersion }), + ...(input.definition !== undefined && + input.definition !== null && { definition: serializeAws_json1_1DefinitionDocument(input.definition, context) }), }; }; const serializeAws_json1_1DefinitionDocument = (input: DefinitionDocument, context: __SerdeContext): any => { return { - ...(input.language !== undefined && { language: input.language }), - ...(input.text !== undefined && { text: input.text }), + ...(input.language !== undefined && input.language !== null && { language: input.language }), + ...(input.text !== undefined && input.text !== null && { text: input.text }), }; }; @@ -3567,7 +3531,7 @@ const serializeAws_json1_1DeleteFlowTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -3580,7 +3544,7 @@ const serializeAws_json1_1DeleteSystemInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -3589,7 +3553,7 @@ const serializeAws_json1_1DeleteSystemTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -3598,7 +3562,7 @@ const serializeAws_json1_1DeploySystemInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -3607,7 +3571,7 @@ const serializeAws_json1_1DeprecateFlowTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -3616,7 +3580,7 @@ const serializeAws_json1_1DeprecateSystemTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -3625,7 +3589,7 @@ const serializeAws_json1_1DescribeNamespaceRequest = ( context: __SerdeContext ): any => { return { - ...(input.namespaceName !== undefined && { namespaceName: input.namespaceName }), + ...(input.namespaceName !== undefined && input.namespaceName !== null && { namespaceName: input.namespaceName }), }; }; @@ -3634,56 +3598,95 @@ const serializeAws_json1_1DissociateEntityFromThingRequest = ( context: __SerdeContext ): any => { return { - ...(input.entityType !== undefined && { entityType: input.entityType }), - ...(input.thingName !== undefined && { thingName: input.thingName }), + ...(input.entityType !== undefined && input.entityType !== null && { entityType: input.entityType }), + ...(input.thingName !== undefined && input.thingName !== null && { thingName: input.thingName }), }; }; const serializeAws_json1_1EntityFilter = (input: EntityFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: serializeAws_json1_1EntityFilterValues(input.value, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_json1_1EntityFilterValues(input.value, context) }), }; }; const serializeAws_json1_1EntityFilters = (input: EntityFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EntityFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EntityFilter(entry, context); + }); }; const serializeAws_json1_1EntityFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1EntityTypes = (input: (EntityType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FlowTemplateFilter = (input: FlowTemplateFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: serializeAws_json1_1FlowTemplateFilterValues(input.value, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_json1_1FlowTemplateFilterValues(input.value, context) }), }; }; const serializeAws_json1_1FlowTemplateFilters = (input: FlowTemplateFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FlowTemplateFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FlowTemplateFilter(entry, context); + }); }; const serializeAws_json1_1FlowTemplateFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetEntitiesRequest = (input: GetEntitiesRequest, context: __SerdeContext): any => { return { - ...(input.ids !== undefined && { ids: serializeAws_json1_1Urns(input.ids, context) }), - ...(input.namespaceVersion !== undefined && { namespaceVersion: input.namespaceVersion }), + ...(input.ids !== undefined && input.ids !== null && { ids: serializeAws_json1_1Urns(input.ids, context) }), + ...(input.namespaceVersion !== undefined && + input.namespaceVersion !== null && { namespaceVersion: input.namespaceVersion }), }; }; const serializeAws_json1_1GetFlowTemplateRequest = (input: GetFlowTemplateRequest, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.revisionNumber !== undefined && { revisionNumber: input.revisionNumber }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.revisionNumber !== undefined && + input.revisionNumber !== null && { revisionNumber: input.revisionNumber }), }; }; @@ -3692,9 +3695,9 @@ const serializeAws_json1_1GetFlowTemplateRevisionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -3710,7 +3713,7 @@ const serializeAws_json1_1GetSystemInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -3719,8 +3722,9 @@ const serializeAws_json1_1GetSystemTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.revisionNumber !== undefined && { revisionNumber: input.revisionNumber }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.revisionNumber !== undefined && + input.revisionNumber !== null && { revisionNumber: input.revisionNumber }), }; }; @@ -3729,15 +3733,15 @@ const serializeAws_json1_1GetSystemTemplateRevisionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1GetUploadStatusRequest = (input: GetUploadStatusRequest, context: __SerdeContext): any => { return { - ...(input.uploadId !== undefined && { uploadId: input.uploadId }), + ...(input.uploadId !== undefined && input.uploadId !== null && { uploadId: input.uploadId }), }; }; @@ -3746,9 +3750,10 @@ const serializeAws_json1_1ListFlowExecutionMessagesRequest = ( context: __SerdeContext ): any => { return { - ...(input.flowExecutionId !== undefined && { flowExecutionId: input.flowExecutionId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.flowExecutionId !== undefined && + input.flowExecutionId !== null && { flowExecutionId: input.flowExecutionId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -3757,28 +3762,31 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_1MetricsConfiguration = (input: MetricsConfiguration, context: __SerdeContext): any => { return { - ...(input.cloudMetricEnabled !== undefined && { cloudMetricEnabled: input.cloudMetricEnabled }), - ...(input.metricRuleRoleArn !== undefined && { metricRuleRoleArn: input.metricRuleRoleArn }), + ...(input.cloudMetricEnabled !== undefined && + input.cloudMetricEnabled !== null && { cloudMetricEnabled: input.cloudMetricEnabled }), + ...(input.metricRuleRoleArn !== undefined && + input.metricRuleRoleArn !== null && { metricRuleRoleArn: input.metricRuleRoleArn }), }; }; const serializeAws_json1_1SearchEntitiesRequest = (input: SearchEntitiesRequest, context: __SerdeContext): any => { return { - ...(input.entityTypes !== undefined && { - entityTypes: serializeAws_json1_1EntityTypes(input.entityTypes, context), - }), - ...(input.filters !== undefined && { filters: serializeAws_json1_1EntityFilters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.namespaceVersion !== undefined && { namespaceVersion: input.namespaceVersion }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.entityTypes !== undefined && + input.entityTypes !== null && { entityTypes: serializeAws_json1_1EntityTypes(input.entityTypes, context) }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1EntityFilters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.namespaceVersion !== undefined && + input.namespaceVersion !== null && { namespaceVersion: input.namespaceVersion }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -3787,12 +3795,16 @@ const serializeAws_json1_1SearchFlowExecutionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.flowExecutionId !== undefined && { flowExecutionId: input.flowExecutionId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.systemInstanceId !== undefined && { systemInstanceId: input.systemInstanceId }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.flowExecutionId !== undefined && + input.flowExecutionId !== null && { flowExecutionId: input.flowExecutionId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.systemInstanceId !== undefined && + input.systemInstanceId !== null && { systemInstanceId: input.systemInstanceId }), }; }; @@ -3801,9 +3813,10 @@ const serializeAws_json1_1SearchFlowTemplatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.filters !== undefined && { filters: serializeAws_json1_1FlowTemplateFilters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1FlowTemplateFilters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -3812,9 +3825,10 @@ const serializeAws_json1_1SearchSystemInstancesRequest = ( context: __SerdeContext ): any => { return { - ...(input.filters !== undefined && { filters: serializeAws_json1_1SystemInstanceFilters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1SystemInstanceFilters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -3823,70 +3837,116 @@ const serializeAws_json1_1SearchSystemTemplatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.filters !== undefined && { filters: serializeAws_json1_1SystemTemplateFilters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_json1_1SystemTemplateFilters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1SearchThingsRequest = (input: SearchThingsRequest, context: __SerdeContext): any => { return { - ...(input.entityId !== undefined && { entityId: input.entityId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.namespaceVersion !== undefined && { namespaceVersion: input.namespaceVersion }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.entityId !== undefined && input.entityId !== null && { entityId: input.entityId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.namespaceVersion !== undefined && + input.namespaceVersion !== null && { namespaceVersion: input.namespaceVersion }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1SystemInstanceFilter = (input: SystemInstanceFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: serializeAws_json1_1SystemInstanceFilterValues(input.value, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_json1_1SystemInstanceFilterValues(input.value, context) }), }; }; const serializeAws_json1_1SystemInstanceFilters = (input: SystemInstanceFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SystemInstanceFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SystemInstanceFilter(entry, context); + }); }; const serializeAws_json1_1SystemInstanceFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SystemTemplateFilter = (input: SystemTemplateFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.value !== undefined && { value: serializeAws_json1_1SystemTemplateFilterValues(input.value, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_json1_1SystemTemplateFilterValues(input.value, context) }), }; }; const serializeAws_json1_1SystemTemplateFilters = (input: SystemTemplateFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SystemTemplateFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SystemTemplateFilter(entry, context); + }); }; const serializeAws_json1_1SystemTemplateFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -3895,14 +3955,15 @@ const serializeAws_json1_1UndeploySystemInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.id !== undefined && { id: input.id }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), }; }; @@ -3911,13 +3972,11 @@ const serializeAws_json1_1UpdateFlowTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.compatibleNamespaceVersion !== undefined && { - compatibleNamespaceVersion: input.compatibleNamespaceVersion, - }), - ...(input.definition !== undefined && { - definition: serializeAws_json1_1DefinitionDocument(input.definition, context), - }), - ...(input.id !== undefined && { id: input.id }), + ...(input.compatibleNamespaceVersion !== undefined && + input.compatibleNamespaceVersion !== null && { compatibleNamespaceVersion: input.compatibleNamespaceVersion }), + ...(input.definition !== undefined && + input.definition !== null && { definition: serializeAws_json1_1DefinitionDocument(input.definition, context) }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -3926,13 +3985,11 @@ const serializeAws_json1_1UpdateSystemTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.compatibleNamespaceVersion !== undefined && { - compatibleNamespaceVersion: input.compatibleNamespaceVersion, - }), - ...(input.definition !== undefined && { - definition: serializeAws_json1_1DefinitionDocument(input.definition, context), - }), - ...(input.id !== undefined && { id: input.id }), + ...(input.compatibleNamespaceVersion !== undefined && + input.compatibleNamespaceVersion !== null && { compatibleNamespaceVersion: input.compatibleNamespaceVersion }), + ...(input.definition !== undefined && + input.definition !== null && { definition: serializeAws_json1_1DefinitionDocument(input.definition, context) }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), }; }; @@ -3941,16 +3998,24 @@ const serializeAws_json1_1UploadEntityDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.deprecateExistingEntities !== undefined && { - deprecateExistingEntities: input.deprecateExistingEntities, - }), - ...(input.document !== undefined && { document: serializeAws_json1_1DefinitionDocument(input.document, context) }), - ...(input.syncWithPublicNamespace !== undefined && { syncWithPublicNamespace: input.syncWithPublicNamespace }), + ...(input.deprecateExistingEntities !== undefined && + input.deprecateExistingEntities !== null && { deprecateExistingEntities: input.deprecateExistingEntities }), + ...(input.document !== undefined && + input.document !== null && { document: serializeAws_json1_1DefinitionDocument(input.document, context) }), + ...(input.syncWithPublicNamespace !== undefined && + input.syncWithPublicNamespace !== null && { syncWithPublicNamespace: input.syncWithPublicNamespace }), }; }; const serializeAws_json1_1Urns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AssociateEntityToThingResponse = ( @@ -4044,7 +4109,14 @@ const deserializeAws_json1_1DependencyRevision = (output: any, context: __SerdeC }; const deserializeAws_json1_1DependencyRevisions = (output: any, context: __SerdeContext): DependencyRevision[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DependencyRevision(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DependencyRevision(entry, context); + }); }; const deserializeAws_json1_1DeploySystemInstanceResponse = ( @@ -4122,7 +4194,14 @@ const deserializeAws_json1_1EntityDescription = (output: any, context: __SerdeCo }; const deserializeAws_json1_1EntityDescriptions = (output: any, context: __SerdeContext): EntityDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EntityDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EntityDescription(entry, context); + }); }; const deserializeAws_json1_1FlowExecutionMessage = (output: any, context: __SerdeContext): FlowExecutionMessage => { @@ -4138,11 +4217,25 @@ const deserializeAws_json1_1FlowExecutionMessage = (output: any, context: __Serd }; const deserializeAws_json1_1FlowExecutionMessages = (output: any, context: __SerdeContext): FlowExecutionMessage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FlowExecutionMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FlowExecutionMessage(entry, context); + }); }; const deserializeAws_json1_1FlowExecutionSummaries = (output: any, context: __SerdeContext): FlowExecutionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FlowExecutionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FlowExecutionSummary(entry, context); + }); }; const deserializeAws_json1_1FlowExecutionSummary = (output: any, context: __SerdeContext): FlowExecutionSummary => { @@ -4186,7 +4279,14 @@ const deserializeAws_json1_1FlowTemplateDescription = ( }; const deserializeAws_json1_1FlowTemplateSummaries = (output: any, context: __SerdeContext): FlowTemplateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FlowTemplateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FlowTemplateSummary(entry, context); + }); }; const deserializeAws_json1_1FlowTemplateSummary = (output: any, context: __SerdeContext): FlowTemplateSummary => { @@ -4470,7 +4570,14 @@ const deserializeAws_json1_1SearchThingsResponse = (output: any, context: __Serd }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SystemInstanceDescription = ( @@ -4510,7 +4617,14 @@ const deserializeAws_json1_1SystemInstanceSummaries = ( output: any, context: __SerdeContext ): SystemInstanceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SystemInstanceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SystemInstanceSummary(entry, context); + }); }; const deserializeAws_json1_1SystemInstanceSummary = (output: any, context: __SerdeContext): SystemInstanceSummary => { @@ -4566,7 +4680,14 @@ const deserializeAws_json1_1SystemTemplateSummaries = ( output: any, context: __SerdeContext ): SystemTemplateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SystemTemplateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SystemTemplateSummary(entry, context); + }); }; const deserializeAws_json1_1SystemTemplateSummary = (output: any, context: __SerdeContext): SystemTemplateSummary => { @@ -4590,7 +4711,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -4605,7 +4733,14 @@ const deserializeAws_json1_1Thing = (output: any, context: __SerdeContext): Thin }; const deserializeAws_json1_1Things = (output: any, context: __SerdeContext): Thing[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Thing(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Thing(entry, context); + }); }; const deserializeAws_json1_1ThrottlingException = (output: any, context: __SerdeContext): ThrottlingException => { @@ -4713,3 +4848,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-ivs/protocols/Aws_restJson1.ts b/clients/client-ivs/protocols/Aws_restJson1.ts index cc7e8b8e57d3..82d26de90639 100644 --- a/clients/client-ivs/protocols/Aws_restJson1.ts +++ b/clients/client-ivs/protocols/Aws_restJson1.ts @@ -70,12 +70,13 @@ export const serializeAws_restJson1BatchGetChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/BatchGetChannel"; let body: any; body = JSON.stringify({ - ...(input.arns !== undefined && { arns: serializeAws_restJson1ChannelArnList(input.arns, context) }), + ...(input.arns !== undefined && + input.arns !== null && { arns: serializeAws_restJson1ChannelArnList(input.arns, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -94,12 +95,13 @@ export const serializeAws_restJson1BatchGetStreamKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/BatchGetStreamKey"; let body: any; body = JSON.stringify({ - ...(input.arns !== undefined && { arns: serializeAws_restJson1StreamKeyArnList(input.arns, context) }), + ...(input.arns !== undefined && + input.arns !== null && { arns: serializeAws_restJson1StreamKeyArnList(input.arns, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -118,16 +120,16 @@ export const serializeAws_restJson1CreateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateChannel"; let body: any; body = JSON.stringify({ - ...(input.authorized !== undefined && { authorized: input.authorized }), - ...(input.latencyMode !== undefined && { latencyMode: input.latencyMode }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.authorized !== undefined && input.authorized !== null && { authorized: input.authorized }), + ...(input.latencyMode !== undefined && input.latencyMode !== null && { latencyMode: input.latencyMode }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -146,13 +148,13 @@ export const serializeAws_restJson1CreateStreamKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateStreamKey"; let body: any; body = JSON.stringify({ - ...(input.channelArn !== undefined && { channelArn: input.channelArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -171,12 +173,12 @@ export const serializeAws_restJson1DeleteChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DeleteChannel"; let body: any; body = JSON.stringify({ - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -195,12 +197,12 @@ export const serializeAws_restJson1DeletePlaybackKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DeletePlaybackKeyPair"; let body: any; body = JSON.stringify({ - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -219,12 +221,12 @@ export const serializeAws_restJson1DeleteStreamKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DeleteStreamKey"; let body: any; body = JSON.stringify({ - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -243,12 +245,12 @@ export const serializeAws_restJson1GetChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/GetChannel"; let body: any; body = JSON.stringify({ - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -267,12 +269,12 @@ export const serializeAws_restJson1GetPlaybackKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/GetPlaybackKeyPair"; let body: any; body = JSON.stringify({ - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -291,12 +293,12 @@ export const serializeAws_restJson1GetStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/GetStream"; let body: any; body = JSON.stringify({ - ...(input.channelArn !== undefined && { channelArn: input.channelArn }), + ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -315,12 +317,12 @@ export const serializeAws_restJson1GetStreamKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/GetStreamKey"; let body: any; body = JSON.stringify({ - ...(input.arn !== undefined && { arn: input.arn }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -339,14 +341,15 @@ export const serializeAws_restJson1ImportPlaybackKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ImportPlaybackKeyPair"; let body: any; body = JSON.stringify({ - ...(input.name !== undefined && { name: input.name }), - ...(input.publicKeyMaterial !== undefined && { publicKeyMaterial: input.publicKeyMaterial }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.publicKeyMaterial !== undefined && + input.publicKeyMaterial !== null && { publicKeyMaterial: input.publicKeyMaterial }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -365,14 +368,14 @@ export const serializeAws_restJson1ListChannelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListChannels"; let body: any; body = JSON.stringify({ - ...(input.filterByName !== undefined && { filterByName: input.filterByName }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filterByName !== undefined && input.filterByName !== null && { filterByName: input.filterByName }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -391,13 +394,13 @@ export const serializeAws_restJson1ListPlaybackKeyPairsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListPlaybackKeyPairs"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -416,14 +419,14 @@ export const serializeAws_restJson1ListStreamKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListStreamKeys"; let body: any; body = JSON.stringify({ - ...(input.channelArn !== undefined && { channelArn: input.channelArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -442,13 +445,13 @@ export const serializeAws_restJson1ListStreamsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListStreams"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -467,7 +470,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -481,8 +484,8 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -501,13 +504,13 @@ export const serializeAws_restJson1PutMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/PutMetadata"; let body: any; body = JSON.stringify({ - ...(input.channelArn !== undefined && { channelArn: input.channelArn }), - ...(input.metadata !== undefined && { metadata: input.metadata }), + ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }), + ...(input.metadata !== undefined && input.metadata !== null && { metadata: input.metadata }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -526,12 +529,12 @@ export const serializeAws_restJson1StopStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/StopStream"; let body: any; body = JSON.stringify({ - ...(input.channelArn !== undefined && { channelArn: input.channelArn }), + ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -550,7 +553,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -564,7 +567,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -582,9 +585,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -617,16 +618,16 @@ export const serializeAws_restJson1UpdateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UpdateChannel"; let body: any; body = JSON.stringify({ - ...(input.arn !== undefined && { arn: input.arn }), - ...(input.authorized !== undefined && { authorized: input.authorized }), - ...(input.latencyMode !== undefined && { latencyMode: input.latencyMode }), - ...(input.name !== undefined && { name: input.name }), - ...(input.type !== undefined && { type: input.type }), + ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }), + ...(input.authorized !== undefined && input.authorized !== null && { authorized: input.authorized }), + ...(input.latencyMode !== undefined && input.latencyMode !== null && { latencyMode: input.latencyMode }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2425,21 +2426,37 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1ChannelArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1StreamKeyArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1BatchError = (output: any, context: __SerdeContext): BatchError => { @@ -2451,7 +2468,14 @@ const deserializeAws_restJson1BatchError = (output: any, context: __SerdeContext }; const deserializeAws_restJson1BatchErrors = (output: any, context: __SerdeContext): BatchError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchError(entry, context); + }); }; const deserializeAws_restJson1Channel = (output: any, context: __SerdeContext): Channel => { @@ -2472,11 +2496,25 @@ const deserializeAws_restJson1Channel = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1ChannelList = (output: any, context: __SerdeContext): ChannelSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelSummary(entry, context); + }); }; const deserializeAws_restJson1Channels = (output: any, context: __SerdeContext): Channel[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Channel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Channel(entry, context); + }); }; const deserializeAws_restJson1ChannelSummary = (output: any, context: __SerdeContext): ChannelSummary => { @@ -2508,7 +2546,14 @@ const deserializeAws_restJson1PlaybackKeyPairList = ( output: any, context: __SerdeContext ): PlaybackKeyPairSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PlaybackKeyPairSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PlaybackKeyPairSummary(entry, context); + }); }; const deserializeAws_restJson1PlaybackKeyPairSummary = ( @@ -2552,11 +2597,25 @@ const deserializeAws_restJson1StreamKey = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1StreamKeyList = (output: any, context: __SerdeContext): StreamKeySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StreamKeySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StreamKeySummary(entry, context); + }); }; const deserializeAws_restJson1StreamKeys = (output: any, context: __SerdeContext): StreamKey[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StreamKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StreamKey(entry, context); + }); }; const deserializeAws_restJson1StreamKeySummary = (output: any, context: __SerdeContext): StreamKeySummary => { @@ -2571,7 +2630,14 @@ const deserializeAws_restJson1StreamKeySummary = (output: any, context: __SerdeC }; const deserializeAws_restJson1StreamList = (output: any, context: __SerdeContext): StreamSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StreamSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StreamSummary(entry, context); + }); }; const deserializeAws_restJson1StreamSummary = (output: any, context: __SerdeContext): StreamSummary => { @@ -2588,13 +2654,15 @@ const deserializeAws_restJson1StreamSummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2617,6 +2685,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-kafka/protocols/Aws_restJson1.ts b/clients/client-kafka/protocols/Aws_restJson1.ts index 5ae6a2fc3aa6..edfa2055bbf3 100644 --- a/clients/client-kafka/protocols/Aws_restJson1.ts +++ b/clients/client-kafka/protocols/Aws_restJson1.ts @@ -143,7 +143,7 @@ export const serializeAws_restJson1BatchAssociateScramSecretCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/clusters/{ClusterArn}/scram-secrets"; if (input.ClusterArn !== undefined) { @@ -157,9 +157,10 @@ export const serializeAws_restJson1BatchAssociateScramSecretCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.SecretArnList !== undefined && { - secretArnList: serializeAws_restJson1__listOf__string(input.SecretArnList, context), - }), + ...(input.SecretArnList !== undefined && + input.SecretArnList !== null && { + secretArnList: serializeAws_restJson1__listOf__string(input.SecretArnList, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -178,7 +179,7 @@ export const serializeAws_restJson1BatchDisassociateScramSecretCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/clusters/{ClusterArn}/scram-secrets"; if (input.ClusterArn !== undefined) { @@ -192,9 +193,10 @@ export const serializeAws_restJson1BatchDisassociateScramSecretCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.SecretArnList !== undefined && { - secretArnList: serializeAws_restJson1__listOf__string(input.SecretArnList, context), - }), + ...(input.SecretArnList !== undefined && + input.SecretArnList !== null && { + secretArnList: serializeAws_restJson1__listOf__string(input.SecretArnList, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -213,34 +215,41 @@ export const serializeAws_restJson1CreateClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/clusters"; let body: any; body = JSON.stringify({ - ...(input.BrokerNodeGroupInfo !== undefined && { - brokerNodeGroupInfo: serializeAws_restJson1BrokerNodeGroupInfo(input.BrokerNodeGroupInfo, context), - }), - ...(input.ClientAuthentication !== undefined && { - clientAuthentication: serializeAws_restJson1ClientAuthentication(input.ClientAuthentication, context), - }), - ...(input.ClusterName !== undefined && { clusterName: input.ClusterName }), - ...(input.ConfigurationInfo !== undefined && { - configurationInfo: serializeAws_restJson1ConfigurationInfo(input.ConfigurationInfo, context), - }), - ...(input.EncryptionInfo !== undefined && { - encryptionInfo: serializeAws_restJson1EncryptionInfo(input.EncryptionInfo, context), - }), - ...(input.EnhancedMonitoring !== undefined && { enhancedMonitoring: input.EnhancedMonitoring }), - ...(input.KafkaVersion !== undefined && { kafkaVersion: input.KafkaVersion }), - ...(input.LoggingInfo !== undefined && { - loggingInfo: serializeAws_restJson1LoggingInfo(input.LoggingInfo, context), - }), - ...(input.NumberOfBrokerNodes !== undefined && { numberOfBrokerNodes: input.NumberOfBrokerNodes }), - ...(input.OpenMonitoring !== undefined && { - openMonitoring: serializeAws_restJson1OpenMonitoringInfo(input.OpenMonitoring, context), - }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.BrokerNodeGroupInfo !== undefined && + input.BrokerNodeGroupInfo !== null && { + brokerNodeGroupInfo: serializeAws_restJson1BrokerNodeGroupInfo(input.BrokerNodeGroupInfo, context), + }), + ...(input.ClientAuthentication !== undefined && + input.ClientAuthentication !== null && { + clientAuthentication: serializeAws_restJson1ClientAuthentication(input.ClientAuthentication, context), + }), + ...(input.ClusterName !== undefined && input.ClusterName !== null && { clusterName: input.ClusterName }), + ...(input.ConfigurationInfo !== undefined && + input.ConfigurationInfo !== null && { + configurationInfo: serializeAws_restJson1ConfigurationInfo(input.ConfigurationInfo, context), + }), + ...(input.EncryptionInfo !== undefined && + input.EncryptionInfo !== null && { + encryptionInfo: serializeAws_restJson1EncryptionInfo(input.EncryptionInfo, context), + }), + ...(input.EnhancedMonitoring !== undefined && + input.EnhancedMonitoring !== null && { enhancedMonitoring: input.EnhancedMonitoring }), + ...(input.KafkaVersion !== undefined && input.KafkaVersion !== null && { kafkaVersion: input.KafkaVersion }), + ...(input.LoggingInfo !== undefined && + input.LoggingInfo !== null && { loggingInfo: serializeAws_restJson1LoggingInfo(input.LoggingInfo, context) }), + ...(input.NumberOfBrokerNodes !== undefined && + input.NumberOfBrokerNodes !== null && { numberOfBrokerNodes: input.NumberOfBrokerNodes }), + ...(input.OpenMonitoring !== undefined && + input.OpenMonitoring !== null && { + openMonitoring: serializeAws_restJson1OpenMonitoringInfo(input.OpenMonitoring, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -259,17 +268,19 @@ export const serializeAws_restJson1CreateConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/configurations"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { description: input.Description }), - ...(input.KafkaVersions !== undefined && { - kafkaVersions: serializeAws_restJson1__listOf__string(input.KafkaVersions, context), - }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.ServerProperties !== undefined && { serverProperties: context.base64Encoder(input.ServerProperties) }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.KafkaVersions !== undefined && + input.KafkaVersions !== null && { + kafkaVersions: serializeAws_restJson1__listOf__string(input.KafkaVersions, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.ServerProperties !== undefined && + input.ServerProperties !== null && { serverProperties: context.base64Encoder(input.ServerProperties) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -287,9 +298,7 @@ export const serializeAws_restJson1DeleteClusterCommand = async ( input: DeleteClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/clusters/{ClusterArn}"; if (input.ClusterArn !== undefined) { const labelValue: string = input.ClusterArn; @@ -321,9 +330,7 @@ export const serializeAws_restJson1DeleteConfigurationCommand = async ( input: DeleteConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/configurations/{Arn}"; if (input.Arn !== undefined) { const labelValue: string = input.Arn; @@ -351,9 +358,7 @@ export const serializeAws_restJson1DescribeClusterCommand = async ( input: DescribeClusterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/clusters/{ClusterArn}"; if (input.ClusterArn !== undefined) { const labelValue: string = input.ClusterArn; @@ -381,9 +386,7 @@ export const serializeAws_restJson1DescribeClusterOperationCommand = async ( input: DescribeClusterOperationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/operations/{ClusterOperationArn}"; if (input.ClusterOperationArn !== undefined) { const labelValue: string = input.ClusterOperationArn; @@ -411,9 +414,7 @@ export const serializeAws_restJson1DescribeConfigurationCommand = async ( input: DescribeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/configurations/{Arn}"; if (input.Arn !== undefined) { const labelValue: string = input.Arn; @@ -441,9 +442,7 @@ export const serializeAws_restJson1DescribeConfigurationRevisionCommand = async input: DescribeConfigurationRevisionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/configurations/{Arn}/revisions/{Revision}"; if (input.Arn !== undefined) { const labelValue: string = input.Arn; @@ -480,9 +479,7 @@ export const serializeAws_restJson1GetBootstrapBrokersCommand = async ( input: GetBootstrapBrokersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/clusters/{ClusterArn}/bootstrap-brokers"; if (input.ClusterArn !== undefined) { const labelValue: string = input.ClusterArn; @@ -510,9 +507,7 @@ export const serializeAws_restJson1GetCompatibleKafkaVersionsCommand = async ( input: GetCompatibleKafkaVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/compatible-kafka-versions"; const query: any = { ...(input.ClusterArn !== undefined && { clusterArn: input.ClusterArn }), @@ -535,9 +530,7 @@ export const serializeAws_restJson1ListClusterOperationsCommand = async ( input: ListClusterOperationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/clusters/{ClusterArn}/operations"; if (input.ClusterArn !== undefined) { const labelValue: string = input.ClusterArn; @@ -570,9 +563,7 @@ export const serializeAws_restJson1ListClustersCommand = async ( input: ListClustersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/clusters"; const query: any = { ...(input.ClusterNameFilter !== undefined && { clusterNameFilter: input.ClusterNameFilter }), @@ -597,9 +588,7 @@ export const serializeAws_restJson1ListConfigurationRevisionsCommand = async ( input: ListConfigurationRevisionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/configurations/{Arn}/revisions"; if (input.Arn !== undefined) { const labelValue: string = input.Arn; @@ -632,9 +621,7 @@ export const serializeAws_restJson1ListConfigurationsCommand = async ( input: ListConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/configurations"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -658,9 +645,7 @@ export const serializeAws_restJson1ListKafkaVersionsCommand = async ( input: ListKafkaVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/kafka-versions"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -684,9 +669,7 @@ export const serializeAws_restJson1ListNodesCommand = async ( input: ListNodesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/clusters/{ClusterArn}/nodes"; if (input.ClusterArn !== undefined) { const labelValue: string = input.ClusterArn; @@ -719,9 +702,7 @@ export const serializeAws_restJson1ListScramSecretsCommand = async ( input: ListScramSecretsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/clusters/{ClusterArn}/scram-secrets"; if (input.ClusterArn !== undefined) { const labelValue: string = input.ClusterArn; @@ -754,9 +735,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -785,7 +764,7 @@ export const serializeAws_restJson1RebootBrokerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/clusters/{ClusterArn}/reboot-broker"; if (input.ClusterArn !== undefined) { @@ -799,9 +778,8 @@ export const serializeAws_restJson1RebootBrokerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BrokerIds !== undefined && { - brokerIds: serializeAws_restJson1__listOf__string(input.BrokerIds, context), - }), + ...(input.BrokerIds !== undefined && + input.BrokerIds !== null && { brokerIds: serializeAws_restJson1__listOf__string(input.BrokerIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -820,7 +798,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -834,7 +812,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -852,9 +831,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -887,7 +864,7 @@ export const serializeAws_restJson1UpdateBrokerCountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/clusters/{ClusterArn}/nodes/count"; if (input.ClusterArn !== undefined) { @@ -901,10 +878,10 @@ export const serializeAws_restJson1UpdateBrokerCountCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CurrentVersion !== undefined && { currentVersion: input.CurrentVersion }), - ...(input.TargetNumberOfBrokerNodes !== undefined && { - targetNumberOfBrokerNodes: input.TargetNumberOfBrokerNodes, - }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { currentVersion: input.CurrentVersion }), + ...(input.TargetNumberOfBrokerNodes !== undefined && + input.TargetNumberOfBrokerNodes !== null && { targetNumberOfBrokerNodes: input.TargetNumberOfBrokerNodes }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -923,7 +900,7 @@ export const serializeAws_restJson1UpdateBrokerStorageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/clusters/{ClusterArn}/nodes/storage"; if (input.ClusterArn !== undefined) { @@ -937,13 +914,15 @@ export const serializeAws_restJson1UpdateBrokerStorageCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CurrentVersion !== undefined && { currentVersion: input.CurrentVersion }), - ...(input.TargetBrokerEBSVolumeInfo !== undefined && { - targetBrokerEBSVolumeInfo: serializeAws_restJson1__listOfBrokerEBSVolumeInfo( - input.TargetBrokerEBSVolumeInfo, - context - ), - }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { currentVersion: input.CurrentVersion }), + ...(input.TargetBrokerEBSVolumeInfo !== undefined && + input.TargetBrokerEBSVolumeInfo !== null && { + targetBrokerEBSVolumeInfo: serializeAws_restJson1__listOfBrokerEBSVolumeInfo( + input.TargetBrokerEBSVolumeInfo, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -962,7 +941,7 @@ export const serializeAws_restJson1UpdateClusterConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/clusters/{ClusterArn}/configuration"; if (input.ClusterArn !== undefined) { @@ -976,10 +955,12 @@ export const serializeAws_restJson1UpdateClusterConfigurationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConfigurationInfo !== undefined && { - configurationInfo: serializeAws_restJson1ConfigurationInfo(input.ConfigurationInfo, context), - }), - ...(input.CurrentVersion !== undefined && { currentVersion: input.CurrentVersion }), + ...(input.ConfigurationInfo !== undefined && + input.ConfigurationInfo !== null && { + configurationInfo: serializeAws_restJson1ConfigurationInfo(input.ConfigurationInfo, context), + }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { currentVersion: input.CurrentVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -998,7 +979,7 @@ export const serializeAws_restJson1UpdateClusterKafkaVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/clusters/{ClusterArn}/version"; if (input.ClusterArn !== undefined) { @@ -1012,11 +993,14 @@ export const serializeAws_restJson1UpdateClusterKafkaVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConfigurationInfo !== undefined && { - configurationInfo: serializeAws_restJson1ConfigurationInfo(input.ConfigurationInfo, context), - }), - ...(input.CurrentVersion !== undefined && { currentVersion: input.CurrentVersion }), - ...(input.TargetKafkaVersion !== undefined && { targetKafkaVersion: input.TargetKafkaVersion }), + ...(input.ConfigurationInfo !== undefined && + input.ConfigurationInfo !== null && { + configurationInfo: serializeAws_restJson1ConfigurationInfo(input.ConfigurationInfo, context), + }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { currentVersion: input.CurrentVersion }), + ...(input.TargetKafkaVersion !== undefined && + input.TargetKafkaVersion !== null && { targetKafkaVersion: input.TargetKafkaVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1035,7 +1019,7 @@ export const serializeAws_restJson1UpdateConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/configurations/{Arn}"; if (input.Arn !== undefined) { @@ -1049,8 +1033,9 @@ export const serializeAws_restJson1UpdateConfigurationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { description: input.Description }), - ...(input.ServerProperties !== undefined && { serverProperties: context.base64Encoder(input.ServerProperties) }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.ServerProperties !== undefined && + input.ServerProperties !== null && { serverProperties: context.base64Encoder(input.ServerProperties) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1069,7 +1054,7 @@ export const serializeAws_restJson1UpdateMonitoringCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/clusters/{ClusterArn}/monitoring"; if (input.ClusterArn !== undefined) { @@ -1083,14 +1068,16 @@ export const serializeAws_restJson1UpdateMonitoringCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CurrentVersion !== undefined && { currentVersion: input.CurrentVersion }), - ...(input.EnhancedMonitoring !== undefined && { enhancedMonitoring: input.EnhancedMonitoring }), - ...(input.LoggingInfo !== undefined && { - loggingInfo: serializeAws_restJson1LoggingInfo(input.LoggingInfo, context), - }), - ...(input.OpenMonitoring !== undefined && { - openMonitoring: serializeAws_restJson1OpenMonitoringInfo(input.OpenMonitoring, context), - }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { currentVersion: input.CurrentVersion }), + ...(input.EnhancedMonitoring !== undefined && + input.EnhancedMonitoring !== null && { enhancedMonitoring: input.EnhancedMonitoring }), + ...(input.LoggingInfo !== undefined && + input.LoggingInfo !== null && { loggingInfo: serializeAws_restJson1LoggingInfo(input.LoggingInfo, context) }), + ...(input.OpenMonitoring !== undefined && + input.OpenMonitoring !== null && { + openMonitoring: serializeAws_restJson1OpenMonitoringInfo(input.OpenMonitoring, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4016,260 +4003,369 @@ const deserializeAws_restJson1UnauthorizedExceptionResponse = async ( }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfBrokerEBSVolumeInfo = ( input: BrokerEBSVolumeInfo[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1BrokerEBSVolumeInfo(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1BrokerEBSVolumeInfo(entry, context); + }); }; const serializeAws_restJson1__mapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1BrokerEBSVolumeInfo = (input: BrokerEBSVolumeInfo, context: __SerdeContext): any => { return { - ...(input.KafkaBrokerNodeId !== undefined && { kafkaBrokerNodeId: input.KafkaBrokerNodeId }), - ...(input.VolumeSizeGB !== undefined && { volumeSizeGB: input.VolumeSizeGB }), + ...(input.KafkaBrokerNodeId !== undefined && + input.KafkaBrokerNodeId !== null && { kafkaBrokerNodeId: input.KafkaBrokerNodeId }), + ...(input.VolumeSizeGB !== undefined && input.VolumeSizeGB !== null && { volumeSizeGB: input.VolumeSizeGB }), }; }; const serializeAws_restJson1BrokerLogs = (input: BrokerLogs, context: __SerdeContext): any => { return { - ...(input.CloudWatchLogs !== undefined && { - cloudWatchLogs: serializeAws_restJson1CloudWatchLogs(input.CloudWatchLogs, context), - }), - ...(input.Firehose !== undefined && { firehose: serializeAws_restJson1Firehose(input.Firehose, context) }), - ...(input.S3 !== undefined && { s3: serializeAws_restJson1S3(input.S3, context) }), + ...(input.CloudWatchLogs !== undefined && + input.CloudWatchLogs !== null && { + cloudWatchLogs: serializeAws_restJson1CloudWatchLogs(input.CloudWatchLogs, context), + }), + ...(input.Firehose !== undefined && + input.Firehose !== null && { firehose: serializeAws_restJson1Firehose(input.Firehose, context) }), + ...(input.S3 !== undefined && input.S3 !== null && { s3: serializeAws_restJson1S3(input.S3, context) }), }; }; const serializeAws_restJson1BrokerNodeGroupInfo = (input: BrokerNodeGroupInfo, context: __SerdeContext): any => { return { - ...(input.BrokerAZDistribution !== undefined && { brokerAZDistribution: input.BrokerAZDistribution }), - ...(input.ClientSubnets !== undefined && { - clientSubnets: serializeAws_restJson1__listOf__string(input.ClientSubnets, context), - }), - ...(input.InstanceType !== undefined && { instanceType: input.InstanceType }), - ...(input.SecurityGroups !== undefined && { - securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context), - }), - ...(input.StorageInfo !== undefined && { - storageInfo: serializeAws_restJson1StorageInfo(input.StorageInfo, context), - }), + ...(input.BrokerAZDistribution !== undefined && + input.BrokerAZDistribution !== null && { brokerAZDistribution: input.BrokerAZDistribution }), + ...(input.ClientSubnets !== undefined && + input.ClientSubnets !== null && { + clientSubnets: serializeAws_restJson1__listOf__string(input.ClientSubnets, context), + }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { instanceType: input.InstanceType }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context), + }), + ...(input.StorageInfo !== undefined && + input.StorageInfo !== null && { storageInfo: serializeAws_restJson1StorageInfo(input.StorageInfo, context) }), }; }; const serializeAws_restJson1ClientAuthentication = (input: ClientAuthentication, context: __SerdeContext): any => { return { - ...(input.Sasl !== undefined && { sasl: serializeAws_restJson1Sasl(input.Sasl, context) }), - ...(input.Tls !== undefined && { tls: serializeAws_restJson1Tls(input.Tls, context) }), + ...(input.Sasl !== undefined && input.Sasl !== null && { sasl: serializeAws_restJson1Sasl(input.Sasl, context) }), + ...(input.Tls !== undefined && input.Tls !== null && { tls: serializeAws_restJson1Tls(input.Tls, context) }), }; }; const serializeAws_restJson1CloudWatchLogs = (input: CloudWatchLogs, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { enabled: input.Enabled }), - ...(input.LogGroup !== undefined && { logGroup: input.LogGroup }), + ...(input.Enabled !== undefined && input.Enabled !== null && { enabled: input.Enabled }), + ...(input.LogGroup !== undefined && input.LogGroup !== null && { logGroup: input.LogGroup }), }; }; const serializeAws_restJson1ConfigurationInfo = (input: ConfigurationInfo, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { arn: input.Arn }), - ...(input.Revision !== undefined && { revision: input.Revision }), + ...(input.Arn !== undefined && input.Arn !== null && { arn: input.Arn }), + ...(input.Revision !== undefined && input.Revision !== null && { revision: input.Revision }), }; }; const serializeAws_restJson1EBSStorageInfo = (input: EBSStorageInfo, context: __SerdeContext): any => { return { - ...(input.VolumeSize !== undefined && { volumeSize: input.VolumeSize }), + ...(input.VolumeSize !== undefined && input.VolumeSize !== null && { volumeSize: input.VolumeSize }), }; }; const serializeAws_restJson1EncryptionAtRest = (input: EncryptionAtRest, context: __SerdeContext): any => { return { - ...(input.DataVolumeKMSKeyId !== undefined && { dataVolumeKMSKeyId: input.DataVolumeKMSKeyId }), + ...(input.DataVolumeKMSKeyId !== undefined && + input.DataVolumeKMSKeyId !== null && { dataVolumeKMSKeyId: input.DataVolumeKMSKeyId }), }; }; const serializeAws_restJson1EncryptionInfo = (input: EncryptionInfo, context: __SerdeContext): any => { return { - ...(input.EncryptionAtRest !== undefined && { - encryptionAtRest: serializeAws_restJson1EncryptionAtRest(input.EncryptionAtRest, context), - }), - ...(input.EncryptionInTransit !== undefined && { - encryptionInTransit: serializeAws_restJson1EncryptionInTransit(input.EncryptionInTransit, context), - }), + ...(input.EncryptionAtRest !== undefined && + input.EncryptionAtRest !== null && { + encryptionAtRest: serializeAws_restJson1EncryptionAtRest(input.EncryptionAtRest, context), + }), + ...(input.EncryptionInTransit !== undefined && + input.EncryptionInTransit !== null && { + encryptionInTransit: serializeAws_restJson1EncryptionInTransit(input.EncryptionInTransit, context), + }), }; }; const serializeAws_restJson1EncryptionInTransit = (input: EncryptionInTransit, context: __SerdeContext): any => { return { - ...(input.ClientBroker !== undefined && { clientBroker: input.ClientBroker }), - ...(input.InCluster !== undefined && { inCluster: input.InCluster }), + ...(input.ClientBroker !== undefined && input.ClientBroker !== null && { clientBroker: input.ClientBroker }), + ...(input.InCluster !== undefined && input.InCluster !== null && { inCluster: input.InCluster }), }; }; const serializeAws_restJson1Firehose = (input: Firehose, context: __SerdeContext): any => { return { - ...(input.DeliveryStream !== undefined && { deliveryStream: input.DeliveryStream }), - ...(input.Enabled !== undefined && { enabled: input.Enabled }), + ...(input.DeliveryStream !== undefined && + input.DeliveryStream !== null && { deliveryStream: input.DeliveryStream }), + ...(input.Enabled !== undefined && input.Enabled !== null && { enabled: input.Enabled }), }; }; const serializeAws_restJson1JmxExporterInfo = (input: JmxExporterInfo, context: __SerdeContext): any => { return { - ...(input.EnabledInBroker !== undefined && { enabledInBroker: input.EnabledInBroker }), + ...(input.EnabledInBroker !== undefined && + input.EnabledInBroker !== null && { enabledInBroker: input.EnabledInBroker }), }; }; const serializeAws_restJson1LoggingInfo = (input: LoggingInfo, context: __SerdeContext): any => { return { - ...(input.BrokerLogs !== undefined && { brokerLogs: serializeAws_restJson1BrokerLogs(input.BrokerLogs, context) }), + ...(input.BrokerLogs !== undefined && + input.BrokerLogs !== null && { brokerLogs: serializeAws_restJson1BrokerLogs(input.BrokerLogs, context) }), }; }; const serializeAws_restJson1NodeExporterInfo = (input: NodeExporterInfo, context: __SerdeContext): any => { return { - ...(input.EnabledInBroker !== undefined && { enabledInBroker: input.EnabledInBroker }), + ...(input.EnabledInBroker !== undefined && + input.EnabledInBroker !== null && { enabledInBroker: input.EnabledInBroker }), }; }; const serializeAws_restJson1OpenMonitoringInfo = (input: OpenMonitoringInfo, context: __SerdeContext): any => { return { - ...(input.Prometheus !== undefined && { - prometheus: serializeAws_restJson1PrometheusInfo(input.Prometheus, context), - }), + ...(input.Prometheus !== undefined && + input.Prometheus !== null && { prometheus: serializeAws_restJson1PrometheusInfo(input.Prometheus, context) }), }; }; const serializeAws_restJson1PrometheusInfo = (input: PrometheusInfo, context: __SerdeContext): any => { return { - ...(input.JmxExporter !== undefined && { - jmxExporter: serializeAws_restJson1JmxExporterInfo(input.JmxExporter, context), - }), - ...(input.NodeExporter !== undefined && { - nodeExporter: serializeAws_restJson1NodeExporterInfo(input.NodeExporter, context), - }), + ...(input.JmxExporter !== undefined && + input.JmxExporter !== null && { jmxExporter: serializeAws_restJson1JmxExporterInfo(input.JmxExporter, context) }), + ...(input.NodeExporter !== undefined && + input.NodeExporter !== null && { + nodeExporter: serializeAws_restJson1NodeExporterInfo(input.NodeExporter, context), + }), }; }; const serializeAws_restJson1S3 = (input: S3, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { bucket: input.Bucket }), - ...(input.Enabled !== undefined && { enabled: input.Enabled }), - ...(input.Prefix !== undefined && { prefix: input.Prefix }), + ...(input.Bucket !== undefined && input.Bucket !== null && { bucket: input.Bucket }), + ...(input.Enabled !== undefined && input.Enabled !== null && { enabled: input.Enabled }), + ...(input.Prefix !== undefined && input.Prefix !== null && { prefix: input.Prefix }), }; }; const serializeAws_restJson1Sasl = (input: Sasl, context: __SerdeContext): any => { return { - ...(input.Scram !== undefined && { scram: serializeAws_restJson1Scram(input.Scram, context) }), + ...(input.Scram !== undefined && + input.Scram !== null && { scram: serializeAws_restJson1Scram(input.Scram, context) }), }; }; const serializeAws_restJson1Scram = (input: Scram, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { enabled: input.Enabled }), }; }; const serializeAws_restJson1StorageInfo = (input: StorageInfo, context: __SerdeContext): any => { return { - ...(input.EbsStorageInfo !== undefined && { - ebsStorageInfo: serializeAws_restJson1EBSStorageInfo(input.EbsStorageInfo, context), - }), + ...(input.EbsStorageInfo !== undefined && + input.EbsStorageInfo !== null && { + ebsStorageInfo: serializeAws_restJson1EBSStorageInfo(input.EbsStorageInfo, context), + }), }; }; const serializeAws_restJson1Tls = (input: Tls, context: __SerdeContext): any => { return { - ...(input.CertificateAuthorityArnList !== undefined && { - certificateAuthorityArnList: serializeAws_restJson1__listOf__string(input.CertificateAuthorityArnList, context), - }), + ...(input.CertificateAuthorityArnList !== undefined && + input.CertificateAuthorityArnList !== null && { + certificateAuthorityArnList: serializeAws_restJson1__listOf__string(input.CertificateAuthorityArnList, context), + }), }; }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfBrokerEBSVolumeInfo = ( output: any, context: __SerdeContext ): BrokerEBSVolumeInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BrokerEBSVolumeInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BrokerEBSVolumeInfo(entry, context); + }); }; const deserializeAws_restJson1__listOfClusterInfo = (output: any, context: __SerdeContext): ClusterInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ClusterInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ClusterInfo(entry, context); + }); }; const deserializeAws_restJson1__listOfClusterOperationInfo = ( output: any, context: __SerdeContext ): ClusterOperationInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ClusterOperationInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ClusterOperationInfo(entry, context); + }); }; const deserializeAws_restJson1__listOfClusterOperationStep = ( output: any, context: __SerdeContext ): ClusterOperationStep[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ClusterOperationStep(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ClusterOperationStep(entry, context); + }); }; const deserializeAws_restJson1__listOfCompatibleKafkaVersion = ( output: any, context: __SerdeContext ): CompatibleKafkaVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CompatibleKafkaVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CompatibleKafkaVersion(entry, context); + }); }; const deserializeAws_restJson1__listOfConfiguration = (output: any, context: __SerdeContext): Configuration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Configuration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Configuration(entry, context); + }); }; const deserializeAws_restJson1__listOfConfigurationRevision = ( output: any, context: __SerdeContext ): ConfigurationRevision[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConfigurationRevision(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConfigurationRevision(entry, context); + }); }; const deserializeAws_restJson1__listOfKafkaVersion = (output: any, context: __SerdeContext): KafkaVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1KafkaVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1KafkaVersion(entry, context); + }); }; const deserializeAws_restJson1__listOfNodeInfo = (output: any, context: __SerdeContext): NodeInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NodeInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NodeInfo(entry, context); + }); }; const deserializeAws_restJson1__listOfUnprocessedScramSecret = ( output: any, context: __SerdeContext ): UnprocessedScramSecret[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UnprocessedScramSecret(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UnprocessedScramSecret(entry, context); + }); }; const deserializeAws_restJson1__mapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1BrokerEBSVolumeInfo = (output: any, context: __SerdeContext): BrokerEBSVolumeInfo => { @@ -4781,6 +4877,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-kendra/protocols/Aws_json1_1.ts b/clients/client-kendra/protocols/Aws_json1_1.ts index 0dcd8128c9f7..b06b16aadc22 100644 --- a/clients/client-kendra/protocols/Aws_json1_1.ts +++ b/clients/client-kendra/protocols/Aws_json1_1.ts @@ -196,7 +196,7 @@ export const serializeAws_json1_1BatchDeleteDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.BatchDeleteDocument", }; let body: any; @@ -209,7 +209,7 @@ export const serializeAws_json1_1BatchPutDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.BatchPutDocument", }; let body: any; @@ -222,7 +222,7 @@ export const serializeAws_json1_1CreateDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.CreateDataSource", }; let body: any; @@ -235,7 +235,7 @@ export const serializeAws_json1_1CreateFaqCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.CreateFaq", }; let body: any; @@ -248,7 +248,7 @@ export const serializeAws_json1_1CreateIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.CreateIndex", }; let body: any; @@ -261,7 +261,7 @@ export const serializeAws_json1_1CreateThesaurusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.CreateThesaurus", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1DeleteDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.DeleteDataSource", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1DeleteFaqCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.DeleteFaq", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1DeleteIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.DeleteIndex", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1DeleteThesaurusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.DeleteThesaurus", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1DescribeDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.DescribeDataSource", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1DescribeFaqCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.DescribeFaq", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1DescribeIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.DescribeIndex", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1DescribeThesaurusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.DescribeThesaurus", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1ListDataSourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.ListDataSources", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1ListDataSourceSyncJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.ListDataSourceSyncJobs", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1ListFaqsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.ListFaqs", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1ListIndicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.ListIndices", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.ListTagsForResource", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1ListThesauriCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.ListThesauri", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1QueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.Query", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1StartDataSourceSyncJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.StartDataSourceSyncJob", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1StopDataSourceSyncJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.StopDataSourceSyncJob", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1SubmitFeedbackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.SubmitFeedback", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.TagResource", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.UntagResource", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1UpdateDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.UpdateDataSource", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1UpdateIndexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.UpdateIndex", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1UpdateThesaurusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSKendraFrontendService.UpdateThesaurus", }; let body: any; @@ -595,8 +595,7 @@ const deserializeAws_json1_1BatchDeleteDocumentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -690,8 +689,7 @@ const deserializeAws_json1_1BatchPutDocumentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -793,8 +791,7 @@ const deserializeAws_json1_1CreateDataSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -904,8 +901,7 @@ const deserializeAws_json1_1CreateFaqCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1007,8 +1003,7 @@ const deserializeAws_json1_1CreateIndexCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1110,8 +1105,7 @@ const deserializeAws_json1_1CreateThesaurusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1210,8 +1204,7 @@ const deserializeAws_json1_1DeleteDataSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1302,8 +1295,7 @@ const deserializeAws_json1_1DeleteFaqCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1394,8 +1386,7 @@ const deserializeAws_json1_1DeleteIndexCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1486,8 +1477,7 @@ const deserializeAws_json1_1DeleteThesaurusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1581,8 +1571,7 @@ const deserializeAws_json1_1DescribeDataSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1668,8 +1657,7 @@ const deserializeAws_json1_1DescribeFaqCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1755,8 +1743,7 @@ const deserializeAws_json1_1DescribeIndexCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1842,8 +1829,7 @@ const deserializeAws_json1_1DescribeThesaurusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -1929,8 +1915,7 @@ const deserializeAws_json1_1ListDataSourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2016,8 +2001,7 @@ const deserializeAws_json1_1ListDataSourceSyncJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2111,8 +2095,7 @@ const deserializeAws_json1_1ListFaqsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2198,8 +2181,7 @@ const deserializeAws_json1_1ListIndicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2277,8 +2259,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2364,8 +2345,7 @@ const deserializeAws_json1_1ListThesauriCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2451,8 +2431,7 @@ const deserializeAws_json1_1QueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2554,8 +2533,7 @@ const deserializeAws_json1_1StartDataSourceSyncJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2654,8 +2632,7 @@ const deserializeAws_json1_1StopDataSourceSyncJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2738,8 +2715,7 @@ const deserializeAws_json1_1SubmitFeedbackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2833,8 +2809,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -2920,8 +2895,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -3004,8 +2978,7 @@ const deserializeAws_json1_1UpdateDataSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -3096,8 +3069,7 @@ const deserializeAws_json1_1UpdateIndexCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -3196,8 +3168,7 @@ const deserializeAws_json1_1UpdateThesaurusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": @@ -3419,47 +3390,59 @@ const serializeAws_json1_1AccessControlListConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.KeyPath !== undefined && { KeyPath: input.KeyPath }), + ...(input.KeyPath !== undefined && input.KeyPath !== null && { KeyPath: input.KeyPath }), }; }; const serializeAws_json1_1AclConfiguration = (input: AclConfiguration, context: __SerdeContext): any => { return { - ...(input.AllowedGroupsColumnName !== undefined && { AllowedGroupsColumnName: input.AllowedGroupsColumnName }), + ...(input.AllowedGroupsColumnName !== undefined && + input.AllowedGroupsColumnName !== null && { AllowedGroupsColumnName: input.AllowedGroupsColumnName }), }; }; const serializeAws_json1_1AttributeFilter = (input: AttributeFilter, context: __SerdeContext): any => { return { - ...(input.AndAllFilters !== undefined && { - AndAllFilters: serializeAws_json1_1AttributeFilterList(input.AndAllFilters, context), - }), - ...(input.ContainsAll !== undefined && { - ContainsAll: serializeAws_json1_1DocumentAttribute(input.ContainsAll, context), - }), - ...(input.ContainsAny !== undefined && { - ContainsAny: serializeAws_json1_1DocumentAttribute(input.ContainsAny, context), - }), - ...(input.EqualsTo !== undefined && { EqualsTo: serializeAws_json1_1DocumentAttribute(input.EqualsTo, context) }), - ...(input.GreaterThan !== undefined && { - GreaterThan: serializeAws_json1_1DocumentAttribute(input.GreaterThan, context), - }), - ...(input.GreaterThanOrEquals !== undefined && { - GreaterThanOrEquals: serializeAws_json1_1DocumentAttribute(input.GreaterThanOrEquals, context), - }), - ...(input.LessThan !== undefined && { LessThan: serializeAws_json1_1DocumentAttribute(input.LessThan, context) }), - ...(input.LessThanOrEquals !== undefined && { - LessThanOrEquals: serializeAws_json1_1DocumentAttribute(input.LessThanOrEquals, context), - }), - ...(input.NotFilter !== undefined && { NotFilter: serializeAws_json1_1AttributeFilter(input.NotFilter, context) }), - ...(input.OrAllFilters !== undefined && { - OrAllFilters: serializeAws_json1_1AttributeFilterList(input.OrAllFilters, context), - }), + ...(input.AndAllFilters !== undefined && + input.AndAllFilters !== null && { + AndAllFilters: serializeAws_json1_1AttributeFilterList(input.AndAllFilters, context), + }), + ...(input.ContainsAll !== undefined && + input.ContainsAll !== null && { ContainsAll: serializeAws_json1_1DocumentAttribute(input.ContainsAll, context) }), + ...(input.ContainsAny !== undefined && + input.ContainsAny !== null && { ContainsAny: serializeAws_json1_1DocumentAttribute(input.ContainsAny, context) }), + ...(input.EqualsTo !== undefined && + input.EqualsTo !== null && { EqualsTo: serializeAws_json1_1DocumentAttribute(input.EqualsTo, context) }), + ...(input.GreaterThan !== undefined && + input.GreaterThan !== null && { GreaterThan: serializeAws_json1_1DocumentAttribute(input.GreaterThan, context) }), + ...(input.GreaterThanOrEquals !== undefined && + input.GreaterThanOrEquals !== null && { + GreaterThanOrEquals: serializeAws_json1_1DocumentAttribute(input.GreaterThanOrEquals, context), + }), + ...(input.LessThan !== undefined && + input.LessThan !== null && { LessThan: serializeAws_json1_1DocumentAttribute(input.LessThan, context) }), + ...(input.LessThanOrEquals !== undefined && + input.LessThanOrEquals !== null && { + LessThanOrEquals: serializeAws_json1_1DocumentAttribute(input.LessThanOrEquals, context), + }), + ...(input.NotFilter !== undefined && + input.NotFilter !== null && { NotFilter: serializeAws_json1_1AttributeFilter(input.NotFilter, context) }), + ...(input.OrAllFilters !== undefined && + input.OrAllFilters !== null && { + OrAllFilters: serializeAws_json1_1AttributeFilterList(input.OrAllFilters, context), + }), }; }; const serializeAws_json1_1AttributeFilterList = (input: AttributeFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AttributeFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AttributeFilter(entry, context); + }); }; const serializeAws_json1_1BatchDeleteDocumentRequest = ( @@ -3467,24 +3450,27 @@ const serializeAws_json1_1BatchDeleteDocumentRequest = ( context: __SerdeContext ): any => { return { - ...(input.DataSourceSyncJobMetricTarget !== undefined && { - DataSourceSyncJobMetricTarget: serializeAws_json1_1DataSourceSyncJobMetricTarget( - input.DataSourceSyncJobMetricTarget, - context - ), - }), - ...(input.DocumentIdList !== undefined && { - DocumentIdList: serializeAws_json1_1DocumentIdList(input.DocumentIdList, context), - }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.DataSourceSyncJobMetricTarget !== undefined && + input.DataSourceSyncJobMetricTarget !== null && { + DataSourceSyncJobMetricTarget: serializeAws_json1_1DataSourceSyncJobMetricTarget( + input.DataSourceSyncJobMetricTarget, + context + ), + }), + ...(input.DocumentIdList !== undefined && + input.DocumentIdList !== null && { + DocumentIdList: serializeAws_json1_1DocumentIdList(input.DocumentIdList, context), + }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), }; }; const serializeAws_json1_1BatchPutDocumentRequest = (input: BatchPutDocumentRequest, context: __SerdeContext): any => { return { - ...(input.Documents !== undefined && { Documents: serializeAws_json1_1DocumentList(input.Documents, context) }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.Documents !== undefined && + input.Documents !== null && { Documents: serializeAws_json1_1DocumentList(input.Documents, context) }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; @@ -3493,37 +3479,59 @@ const serializeAws_json1_1CapacityUnitsConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.QueryCapacityUnits !== undefined && { QueryCapacityUnits: input.QueryCapacityUnits }), - ...(input.StorageCapacityUnits !== undefined && { StorageCapacityUnits: input.StorageCapacityUnits }), + ...(input.QueryCapacityUnits !== undefined && + input.QueryCapacityUnits !== null && { QueryCapacityUnits: input.QueryCapacityUnits }), + ...(input.StorageCapacityUnits !== undefined && + input.StorageCapacityUnits !== null && { StorageCapacityUnits: input.StorageCapacityUnits }), }; }; const serializeAws_json1_1ChangeDetectingColumns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ClickFeedback = (input: ClickFeedback, context: __SerdeContext): any => { return { - ...(input.ClickTime !== undefined && { ClickTime: Math.round(input.ClickTime.getTime() / 1000) }), - ...(input.ResultId !== undefined && { ResultId: input.ResultId }), + ...(input.ClickTime !== undefined && + input.ClickTime !== null && { ClickTime: Math.round(input.ClickTime.getTime() / 1000) }), + ...(input.ResultId !== undefined && input.ResultId !== null && { ResultId: input.ResultId }), }; }; const serializeAws_json1_1ClickFeedbackList = (input: ClickFeedback[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ClickFeedback(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ClickFeedback(entry, context); + }); }; const serializeAws_json1_1ColumnConfiguration = (input: ColumnConfiguration, context: __SerdeContext): any => { return { - ...(input.ChangeDetectingColumns !== undefined && { - ChangeDetectingColumns: serializeAws_json1_1ChangeDetectingColumns(input.ChangeDetectingColumns, context), - }), - ...(input.DocumentDataColumnName !== undefined && { DocumentDataColumnName: input.DocumentDataColumnName }), - ...(input.DocumentIdColumnName !== undefined && { DocumentIdColumnName: input.DocumentIdColumnName }), - ...(input.DocumentTitleColumnName !== undefined && { DocumentTitleColumnName: input.DocumentTitleColumnName }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), + ...(input.ChangeDetectingColumns !== undefined && + input.ChangeDetectingColumns !== null && { + ChangeDetectingColumns: serializeAws_json1_1ChangeDetectingColumns(input.ChangeDetectingColumns, context), + }), + ...(input.DocumentDataColumnName !== undefined && + input.DocumentDataColumnName !== null && { DocumentDataColumnName: input.DocumentDataColumnName }), + ...(input.DocumentIdColumnName !== undefined && + input.DocumentIdColumnName !== null && { DocumentIdColumnName: input.DocumentIdColumnName }), + ...(input.DocumentTitleColumnName !== undefined && + input.DocumentTitleColumnName !== null && { DocumentTitleColumnName: input.DocumentTitleColumnName }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), }; }; @@ -3532,13 +3540,15 @@ const serializeAws_json1_1ConfluenceAttachmentConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AttachmentFieldMappings !== undefined && { - AttachmentFieldMappings: serializeAws_json1_1ConfluenceAttachmentFieldMappingsList( - input.AttachmentFieldMappings, - context - ), - }), - ...(input.CrawlAttachments !== undefined && { CrawlAttachments: input.CrawlAttachments }), + ...(input.AttachmentFieldMappings !== undefined && + input.AttachmentFieldMappings !== null && { + AttachmentFieldMappings: serializeAws_json1_1ConfluenceAttachmentFieldMappingsList( + input.AttachmentFieldMappings, + context + ), + }), + ...(input.CrawlAttachments !== undefined && + input.CrawlAttachments !== null && { CrawlAttachments: input.CrawlAttachments }), }; }; @@ -3546,7 +3556,14 @@ const serializeAws_json1_1ConfluenceAttachmentFieldMappingsList = ( input: ConfluenceAttachmentToIndexFieldMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ConfluenceAttachmentToIndexFieldMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ConfluenceAttachmentToIndexFieldMapping(entry, context); + }); }; const serializeAws_json1_1ConfluenceAttachmentToIndexFieldMapping = ( @@ -3554,9 +3571,12 @@ const serializeAws_json1_1ConfluenceAttachmentToIndexFieldMapping = ( context: __SerdeContext ): any => { return { - ...(input.DataSourceFieldName !== undefined && { DataSourceFieldName: input.DataSourceFieldName }), - ...(input.DateFieldFormat !== undefined && { DateFieldFormat: input.DateFieldFormat }), - ...(input.IndexFieldName !== undefined && { IndexFieldName: input.IndexFieldName }), + ...(input.DataSourceFieldName !== undefined && + input.DataSourceFieldName !== null && { DataSourceFieldName: input.DataSourceFieldName }), + ...(input.DateFieldFormat !== undefined && + input.DateFieldFormat !== null && { DateFieldFormat: input.DateFieldFormat }), + ...(input.IndexFieldName !== undefined && + input.IndexFieldName !== null && { IndexFieldName: input.IndexFieldName }), }; }; @@ -3565,9 +3585,10 @@ const serializeAws_json1_1ConfluenceBlogConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.BlogFieldMappings !== undefined && { - BlogFieldMappings: serializeAws_json1_1ConfluenceBlogFieldMappingsList(input.BlogFieldMappings, context), - }), + ...(input.BlogFieldMappings !== undefined && + input.BlogFieldMappings !== null && { + BlogFieldMappings: serializeAws_json1_1ConfluenceBlogFieldMappingsList(input.BlogFieldMappings, context), + }), }; }; @@ -3575,7 +3596,14 @@ const serializeAws_json1_1ConfluenceBlogFieldMappingsList = ( input: ConfluenceBlogToIndexFieldMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ConfluenceBlogToIndexFieldMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ConfluenceBlogToIndexFieldMapping(entry, context); + }); }; const serializeAws_json1_1ConfluenceBlogToIndexFieldMapping = ( @@ -3583,41 +3611,51 @@ const serializeAws_json1_1ConfluenceBlogToIndexFieldMapping = ( context: __SerdeContext ): any => { return { - ...(input.DataSourceFieldName !== undefined && { DataSourceFieldName: input.DataSourceFieldName }), - ...(input.DateFieldFormat !== undefined && { DateFieldFormat: input.DateFieldFormat }), - ...(input.IndexFieldName !== undefined && { IndexFieldName: input.IndexFieldName }), + ...(input.DataSourceFieldName !== undefined && + input.DataSourceFieldName !== null && { DataSourceFieldName: input.DataSourceFieldName }), + ...(input.DateFieldFormat !== undefined && + input.DateFieldFormat !== null && { DateFieldFormat: input.DateFieldFormat }), + ...(input.IndexFieldName !== undefined && + input.IndexFieldName !== null && { IndexFieldName: input.IndexFieldName }), }; }; const serializeAws_json1_1ConfluenceConfiguration = (input: ConfluenceConfiguration, context: __SerdeContext): any => { return { - ...(input.AttachmentConfiguration !== undefined && { - AttachmentConfiguration: serializeAws_json1_1ConfluenceAttachmentConfiguration( - input.AttachmentConfiguration, - context - ), - }), - ...(input.BlogConfiguration !== undefined && { - BlogConfiguration: serializeAws_json1_1ConfluenceBlogConfiguration(input.BlogConfiguration, context), - }), - ...(input.ExclusionPatterns !== undefined && { - ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), - }), - ...(input.InclusionPatterns !== undefined && { - InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), - }), - ...(input.PageConfiguration !== undefined && { - PageConfiguration: serializeAws_json1_1ConfluencePageConfiguration(input.PageConfiguration, context), - }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), - ...(input.ServerUrl !== undefined && { ServerUrl: input.ServerUrl }), - ...(input.SpaceConfiguration !== undefined && { - SpaceConfiguration: serializeAws_json1_1ConfluenceSpaceConfiguration(input.SpaceConfiguration, context), - }), - ...(input.Version !== undefined && { Version: input.Version }), - ...(input.VpcConfiguration !== undefined && { - VpcConfiguration: serializeAws_json1_1DataSourceVpcConfiguration(input.VpcConfiguration, context), - }), + ...(input.AttachmentConfiguration !== undefined && + input.AttachmentConfiguration !== null && { + AttachmentConfiguration: serializeAws_json1_1ConfluenceAttachmentConfiguration( + input.AttachmentConfiguration, + context + ), + }), + ...(input.BlogConfiguration !== undefined && + input.BlogConfiguration !== null && { + BlogConfiguration: serializeAws_json1_1ConfluenceBlogConfiguration(input.BlogConfiguration, context), + }), + ...(input.ExclusionPatterns !== undefined && + input.ExclusionPatterns !== null && { + ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), + }), + ...(input.InclusionPatterns !== undefined && + input.InclusionPatterns !== null && { + InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), + }), + ...(input.PageConfiguration !== undefined && + input.PageConfiguration !== null && { + PageConfiguration: serializeAws_json1_1ConfluencePageConfiguration(input.PageConfiguration, context), + }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), + ...(input.ServerUrl !== undefined && input.ServerUrl !== null && { ServerUrl: input.ServerUrl }), + ...(input.SpaceConfiguration !== undefined && + input.SpaceConfiguration !== null && { + SpaceConfiguration: serializeAws_json1_1ConfluenceSpaceConfiguration(input.SpaceConfiguration, context), + }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), + ...(input.VpcConfiguration !== undefined && + input.VpcConfiguration !== null && { + VpcConfiguration: serializeAws_json1_1DataSourceVpcConfiguration(input.VpcConfiguration, context), + }), }; }; @@ -3626,9 +3664,10 @@ const serializeAws_json1_1ConfluencePageConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.PageFieldMappings !== undefined && { - PageFieldMappings: serializeAws_json1_1ConfluencePageFieldMappingsList(input.PageFieldMappings, context), - }), + ...(input.PageFieldMappings !== undefined && + input.PageFieldMappings !== null && { + PageFieldMappings: serializeAws_json1_1ConfluencePageFieldMappingsList(input.PageFieldMappings, context), + }), }; }; @@ -3636,7 +3675,14 @@ const serializeAws_json1_1ConfluencePageFieldMappingsList = ( input: ConfluencePageToIndexFieldMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ConfluencePageToIndexFieldMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ConfluencePageToIndexFieldMapping(entry, context); + }); }; const serializeAws_json1_1ConfluencePageToIndexFieldMapping = ( @@ -3644,9 +3690,12 @@ const serializeAws_json1_1ConfluencePageToIndexFieldMapping = ( context: __SerdeContext ): any => { return { - ...(input.DataSourceFieldName !== undefined && { DataSourceFieldName: input.DataSourceFieldName }), - ...(input.DateFieldFormat !== undefined && { DateFieldFormat: input.DateFieldFormat }), - ...(input.IndexFieldName !== undefined && { IndexFieldName: input.IndexFieldName }), + ...(input.DataSourceFieldName !== undefined && + input.DataSourceFieldName !== null && { DataSourceFieldName: input.DataSourceFieldName }), + ...(input.DateFieldFormat !== undefined && + input.DateFieldFormat !== null && { DateFieldFormat: input.DateFieldFormat }), + ...(input.IndexFieldName !== undefined && + input.IndexFieldName !== null && { IndexFieldName: input.IndexFieldName }), }; }; @@ -3655,17 +3704,22 @@ const serializeAws_json1_1ConfluenceSpaceConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CrawlArchivedSpaces !== undefined && { CrawlArchivedSpaces: input.CrawlArchivedSpaces }), - ...(input.CrawlPersonalSpaces !== undefined && { CrawlPersonalSpaces: input.CrawlPersonalSpaces }), - ...(input.ExcludeSpaces !== undefined && { - ExcludeSpaces: serializeAws_json1_1ConfluenceSpaceList(input.ExcludeSpaces, context), - }), - ...(input.IncludeSpaces !== undefined && { - IncludeSpaces: serializeAws_json1_1ConfluenceSpaceList(input.IncludeSpaces, context), - }), - ...(input.SpaceFieldMappings !== undefined && { - SpaceFieldMappings: serializeAws_json1_1ConfluenceSpaceFieldMappingsList(input.SpaceFieldMappings, context), - }), + ...(input.CrawlArchivedSpaces !== undefined && + input.CrawlArchivedSpaces !== null && { CrawlArchivedSpaces: input.CrawlArchivedSpaces }), + ...(input.CrawlPersonalSpaces !== undefined && + input.CrawlPersonalSpaces !== null && { CrawlPersonalSpaces: input.CrawlPersonalSpaces }), + ...(input.ExcludeSpaces !== undefined && + input.ExcludeSpaces !== null && { + ExcludeSpaces: serializeAws_json1_1ConfluenceSpaceList(input.ExcludeSpaces, context), + }), + ...(input.IncludeSpaces !== undefined && + input.IncludeSpaces !== null && { + IncludeSpaces: serializeAws_json1_1ConfluenceSpaceList(input.IncludeSpaces, context), + }), + ...(input.SpaceFieldMappings !== undefined && + input.SpaceFieldMappings !== null && { + SpaceFieldMappings: serializeAws_json1_1ConfluenceSpaceFieldMappingsList(input.SpaceFieldMappings, context), + }), }; }; @@ -3673,11 +3727,25 @@ const serializeAws_json1_1ConfluenceSpaceFieldMappingsList = ( input: ConfluenceSpaceToIndexFieldMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ConfluenceSpaceToIndexFieldMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ConfluenceSpaceToIndexFieldMapping(entry, context); + }); }; const serializeAws_json1_1ConfluenceSpaceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConfluenceSpaceToIndexFieldMapping = ( @@ -3685,136 +3753,166 @@ const serializeAws_json1_1ConfluenceSpaceToIndexFieldMapping = ( context: __SerdeContext ): any => { return { - ...(input.DataSourceFieldName !== undefined && { DataSourceFieldName: input.DataSourceFieldName }), - ...(input.DateFieldFormat !== undefined && { DateFieldFormat: input.DateFieldFormat }), - ...(input.IndexFieldName !== undefined && { IndexFieldName: input.IndexFieldName }), + ...(input.DataSourceFieldName !== undefined && + input.DataSourceFieldName !== null && { DataSourceFieldName: input.DataSourceFieldName }), + ...(input.DateFieldFormat !== undefined && + input.DateFieldFormat !== null && { DateFieldFormat: input.DateFieldFormat }), + ...(input.IndexFieldName !== undefined && + input.IndexFieldName !== null && { IndexFieldName: input.IndexFieldName }), }; }; const serializeAws_json1_1ConnectionConfiguration = (input: ConnectionConfiguration, context: __SerdeContext): any => { return { - ...(input.DatabaseHost !== undefined && { DatabaseHost: input.DatabaseHost }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.DatabasePort !== undefined && { DatabasePort: input.DatabasePort }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.DatabaseHost !== undefined && input.DatabaseHost !== null && { DatabaseHost: input.DatabaseHost }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.DatabasePort !== undefined && input.DatabasePort !== null && { DatabasePort: input.DatabasePort }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1CreateDataSourceRequest = (input: CreateDataSourceRequest, context: __SerdeContext): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Configuration !== undefined && { - Configuration: serializeAws_json1_1DataSourceConfiguration(input.Configuration, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Configuration !== undefined && + input.Configuration !== null && { + Configuration: serializeAws_json1_1DataSourceConfiguration(input.Configuration, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1CreateFaqRequest = (input: CreateFaqRequest, context: __SerdeContext): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FileFormat !== undefined && { FileFormat: input.FileFormat }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.S3Path !== undefined && { S3Path: serializeAws_json1_1S3Path(input.S3Path, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FileFormat !== undefined && input.FileFormat !== null && { FileFormat: input.FileFormat }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.S3Path !== undefined && + input.S3Path !== null && { S3Path: serializeAws_json1_1S3Path(input.S3Path, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateIndexRequest = (input: CreateIndexRequest, context: __SerdeContext): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Edition !== undefined && { Edition: input.Edition }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.ServerSideEncryptionConfiguration !== undefined && { - ServerSideEncryptionConfiguration: serializeAws_json1_1ServerSideEncryptionConfiguration( - input.ServerSideEncryptionConfiguration, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.UserContextPolicy !== undefined && { UserContextPolicy: input.UserContextPolicy }), - ...(input.UserTokenConfigurations !== undefined && { - UserTokenConfigurations: serializeAws_json1_1UserTokenConfigurationList(input.UserTokenConfigurations, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Edition !== undefined && input.Edition !== null && { Edition: input.Edition }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.ServerSideEncryptionConfiguration !== undefined && + input.ServerSideEncryptionConfiguration !== null && { + ServerSideEncryptionConfiguration: serializeAws_json1_1ServerSideEncryptionConfiguration( + input.ServerSideEncryptionConfiguration, + context + ), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.UserContextPolicy !== undefined && + input.UserContextPolicy !== null && { UserContextPolicy: input.UserContextPolicy }), + ...(input.UserTokenConfigurations !== undefined && + input.UserTokenConfigurations !== null && { + UserTokenConfigurations: serializeAws_json1_1UserTokenConfigurationList(input.UserTokenConfigurations, context), + }), }; }; const serializeAws_json1_1CreateThesaurusRequest = (input: CreateThesaurusRequest, context: __SerdeContext): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.SourceS3Path !== undefined && { SourceS3Path: serializeAws_json1_1S3Path(input.SourceS3Path, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.SourceS3Path !== undefined && + input.SourceS3Path !== null && { SourceS3Path: serializeAws_json1_1S3Path(input.SourceS3Path, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1DatabaseConfiguration = (input: DatabaseConfiguration, context: __SerdeContext): any => { return { - ...(input.AclConfiguration !== undefined && { - AclConfiguration: serializeAws_json1_1AclConfiguration(input.AclConfiguration, context), - }), - ...(input.ColumnConfiguration !== undefined && { - ColumnConfiguration: serializeAws_json1_1ColumnConfiguration(input.ColumnConfiguration, context), - }), - ...(input.ConnectionConfiguration !== undefined && { - ConnectionConfiguration: serializeAws_json1_1ConnectionConfiguration(input.ConnectionConfiguration, context), - }), - ...(input.DatabaseEngineType !== undefined && { DatabaseEngineType: input.DatabaseEngineType }), - ...(input.SqlConfiguration !== undefined && { - SqlConfiguration: serializeAws_json1_1SqlConfiguration(input.SqlConfiguration, context), - }), - ...(input.VpcConfiguration !== undefined && { - VpcConfiguration: serializeAws_json1_1DataSourceVpcConfiguration(input.VpcConfiguration, context), - }), + ...(input.AclConfiguration !== undefined && + input.AclConfiguration !== null && { + AclConfiguration: serializeAws_json1_1AclConfiguration(input.AclConfiguration, context), + }), + ...(input.ColumnConfiguration !== undefined && + input.ColumnConfiguration !== null && { + ColumnConfiguration: serializeAws_json1_1ColumnConfiguration(input.ColumnConfiguration, context), + }), + ...(input.ConnectionConfiguration !== undefined && + input.ConnectionConfiguration !== null && { + ConnectionConfiguration: serializeAws_json1_1ConnectionConfiguration(input.ConnectionConfiguration, context), + }), + ...(input.DatabaseEngineType !== undefined && + input.DatabaseEngineType !== null && { DatabaseEngineType: input.DatabaseEngineType }), + ...(input.SqlConfiguration !== undefined && + input.SqlConfiguration !== null && { + SqlConfiguration: serializeAws_json1_1SqlConfiguration(input.SqlConfiguration, context), + }), + ...(input.VpcConfiguration !== undefined && + input.VpcConfiguration !== null && { + VpcConfiguration: serializeAws_json1_1DataSourceVpcConfiguration(input.VpcConfiguration, context), + }), }; }; const serializeAws_json1_1DataSourceConfiguration = (input: DataSourceConfiguration, context: __SerdeContext): any => { return { - ...(input.ConfluenceConfiguration !== undefined && { - ConfluenceConfiguration: serializeAws_json1_1ConfluenceConfiguration(input.ConfluenceConfiguration, context), - }), - ...(input.DatabaseConfiguration !== undefined && { - DatabaseConfiguration: serializeAws_json1_1DatabaseConfiguration(input.DatabaseConfiguration, context), - }), - ...(input.GoogleDriveConfiguration !== undefined && { - GoogleDriveConfiguration: serializeAws_json1_1GoogleDriveConfiguration(input.GoogleDriveConfiguration, context), - }), - ...(input.OneDriveConfiguration !== undefined && { - OneDriveConfiguration: serializeAws_json1_1OneDriveConfiguration(input.OneDriveConfiguration, context), - }), - ...(input.S3Configuration !== undefined && { - S3Configuration: serializeAws_json1_1S3DataSourceConfiguration(input.S3Configuration, context), - }), - ...(input.SalesforceConfiguration !== undefined && { - SalesforceConfiguration: serializeAws_json1_1SalesforceConfiguration(input.SalesforceConfiguration, context), - }), - ...(input.ServiceNowConfiguration !== undefined && { - ServiceNowConfiguration: serializeAws_json1_1ServiceNowConfiguration(input.ServiceNowConfiguration, context), - }), - ...(input.SharePointConfiguration !== undefined && { - SharePointConfiguration: serializeAws_json1_1SharePointConfiguration(input.SharePointConfiguration, context), - }), + ...(input.ConfluenceConfiguration !== undefined && + input.ConfluenceConfiguration !== null && { + ConfluenceConfiguration: serializeAws_json1_1ConfluenceConfiguration(input.ConfluenceConfiguration, context), + }), + ...(input.DatabaseConfiguration !== undefined && + input.DatabaseConfiguration !== null && { + DatabaseConfiguration: serializeAws_json1_1DatabaseConfiguration(input.DatabaseConfiguration, context), + }), + ...(input.GoogleDriveConfiguration !== undefined && + input.GoogleDriveConfiguration !== null && { + GoogleDriveConfiguration: serializeAws_json1_1GoogleDriveConfiguration(input.GoogleDriveConfiguration, context), + }), + ...(input.OneDriveConfiguration !== undefined && + input.OneDriveConfiguration !== null && { + OneDriveConfiguration: serializeAws_json1_1OneDriveConfiguration(input.OneDriveConfiguration, context), + }), + ...(input.S3Configuration !== undefined && + input.S3Configuration !== null && { + S3Configuration: serializeAws_json1_1S3DataSourceConfiguration(input.S3Configuration, context), + }), + ...(input.SalesforceConfiguration !== undefined && + input.SalesforceConfiguration !== null && { + SalesforceConfiguration: serializeAws_json1_1SalesforceConfiguration(input.SalesforceConfiguration, context), + }), + ...(input.ServiceNowConfiguration !== undefined && + input.ServiceNowConfiguration !== null && { + ServiceNowConfiguration: serializeAws_json1_1ServiceNowConfiguration(input.ServiceNowConfiguration, context), + }), + ...(input.SharePointConfiguration !== undefined && + input.SharePointConfiguration !== null && { + SharePointConfiguration: serializeAws_json1_1SharePointConfiguration(input.SharePointConfiguration, context), + }), }; }; const serializeAws_json1_1DataSourceInclusionsExclusionsStrings = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DataSourceSyncJobMetricTarget = ( @@ -3822,8 +3920,9 @@ const serializeAws_json1_1DataSourceSyncJobMetricTarget = ( context: __SerdeContext ): any => { return { - ...(input.DataSourceId !== undefined && { DataSourceId: input.DataSourceId }), - ...(input.DataSourceSyncJobId !== undefined && { DataSourceSyncJobId: input.DataSourceSyncJobId }), + ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }), + ...(input.DataSourceSyncJobId !== undefined && + input.DataSourceSyncJobId !== null && { DataSourceSyncJobId: input.DataSourceSyncJobId }), }; }; @@ -3832,9 +3931,12 @@ const serializeAws_json1_1DataSourceToIndexFieldMapping = ( context: __SerdeContext ): any => { return { - ...(input.DataSourceFieldName !== undefined && { DataSourceFieldName: input.DataSourceFieldName }), - ...(input.DateFieldFormat !== undefined && { DateFieldFormat: input.DateFieldFormat }), - ...(input.IndexFieldName !== undefined && { IndexFieldName: input.IndexFieldName }), + ...(input.DataSourceFieldName !== undefined && + input.DataSourceFieldName !== null && { DataSourceFieldName: input.DataSourceFieldName }), + ...(input.DateFieldFormat !== undefined && + input.DateFieldFormat !== null && { DateFieldFormat: input.DateFieldFormat }), + ...(input.IndexFieldName !== undefined && + input.IndexFieldName !== null && { IndexFieldName: input.IndexFieldName }), }; }; @@ -3842,7 +3944,14 @@ const serializeAws_json1_1DataSourceToIndexFieldMappingList = ( input: DataSourceToIndexFieldMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1DataSourceToIndexFieldMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DataSourceToIndexFieldMapping(entry, context); + }); }; const serializeAws_json1_1DataSourceVpcConfiguration = ( @@ -3850,37 +3959,39 @@ const serializeAws_json1_1DataSourceVpcConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIdList(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIdList(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) }), }; }; const serializeAws_json1_1DeleteDataSourceRequest = (input: DeleteDataSourceRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), }; }; const serializeAws_json1_1DeleteFaqRequest = (input: DeleteFaqRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), }; }; const serializeAws_json1_1DeleteIndexRequest = (input: DeleteIndexRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_json1_1DeleteThesaurusRequest = (input: DeleteThesaurusRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), }; }; @@ -3889,21 +4000,21 @@ const serializeAws_json1_1DescribeDataSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), }; }; const serializeAws_json1_1DescribeFaqRequest = (input: DescribeFaqRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), }; }; const serializeAws_json1_1DescribeIndexRequest = (input: DescribeIndexRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -3912,44 +4023,69 @@ const serializeAws_json1_1DescribeThesaurusRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), }; }; const serializeAws_json1_1Document = (input: Document, context: __SerdeContext): any => { return { - ...(input.AccessControlList !== undefined && { - AccessControlList: serializeAws_json1_1PrincipalList(input.AccessControlList, context), - }), - ...(input.Attributes !== undefined && { - Attributes: serializeAws_json1_1DocumentAttributeList(input.Attributes, context), - }), - ...(input.Blob !== undefined && { Blob: context.base64Encoder(input.Blob) }), - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.S3Path !== undefined && { S3Path: serializeAws_json1_1S3Path(input.S3Path, context) }), - ...(input.Title !== undefined && { Title: input.Title }), + ...(input.AccessControlList !== undefined && + input.AccessControlList !== null && { + AccessControlList: serializeAws_json1_1PrincipalList(input.AccessControlList, context), + }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_json1_1DocumentAttributeList(input.Attributes, context), + }), + ...(input.Blob !== undefined && input.Blob !== null && { Blob: context.base64Encoder(input.Blob) }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.S3Path !== undefined && + input.S3Path !== null && { S3Path: serializeAws_json1_1S3Path(input.S3Path, context) }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), }; }; const serializeAws_json1_1DocumentAttribute = (input: DocumentAttribute, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: serializeAws_json1_1DocumentAttributeValue(input.Value, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && + input.Value !== null && { Value: serializeAws_json1_1DocumentAttributeValue(input.Value, context) }), }; }; const serializeAws_json1_1DocumentAttributeKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DocumentAttributeList = (input: DocumentAttribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DocumentAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DocumentAttribute(entry, context); + }); }; const serializeAws_json1_1DocumentAttributeStringListValue = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DocumentAttributeValue = (input: DocumentAttributeValue, context: __SerdeContext): any => { @@ -3965,11 +4101,25 @@ const serializeAws_json1_1DocumentAttributeValue = (input: DocumentAttributeValu }; const serializeAws_json1_1DocumentIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DocumentList = (input: Document[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Document(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Document(entry, context); + }); }; const serializeAws_json1_1DocumentMetadataConfiguration = ( @@ -3977,10 +4127,12 @@ const serializeAws_json1_1DocumentMetadataConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Relevance !== undefined && { Relevance: serializeAws_json1_1Relevance(input.Relevance, context) }), - ...(input.Search !== undefined && { Search: serializeAws_json1_1Search(input.Search, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Relevance !== undefined && + input.Relevance !== null && { Relevance: serializeAws_json1_1Relevance(input.Relevance, context) }), + ...(input.Search !== undefined && + input.Search !== null && { Search: serializeAws_json1_1Search(input.Search, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -3988,7 +4140,14 @@ const serializeAws_json1_1DocumentMetadataConfigurationList = ( input: DocumentMetadataConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1DocumentMetadataConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DocumentMetadataConfiguration(entry, context); + }); }; const serializeAws_json1_1DocumentsMetadataConfiguration = ( @@ -3996,30 +4155,59 @@ const serializeAws_json1_1DocumentsMetadataConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.S3Prefix !== undefined && { S3Prefix: input.S3Prefix }), + ...(input.S3Prefix !== undefined && input.S3Prefix !== null && { S3Prefix: input.S3Prefix }), }; }; const serializeAws_json1_1ExcludeMimeTypesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ExcludeSharedDrivesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ExcludeUserAccountsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Facet = (input: Facet, context: __SerdeContext): any => { return { - ...(input.DocumentAttributeKey !== undefined && { DocumentAttributeKey: input.DocumentAttributeKey }), + ...(input.DocumentAttributeKey !== undefined && + input.DocumentAttributeKey !== null && { DocumentAttributeKey: input.DocumentAttributeKey }), }; }; const serializeAws_json1_1FacetList = (input: Facet[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Facet(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Facet(entry, context); + }); }; const serializeAws_json1_1GoogleDriveConfiguration = ( @@ -4027,25 +4215,31 @@ const serializeAws_json1_1GoogleDriveConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.ExcludeMimeTypes !== undefined && { - ExcludeMimeTypes: serializeAws_json1_1ExcludeMimeTypesList(input.ExcludeMimeTypes, context), - }), - ...(input.ExcludeSharedDrives !== undefined && { - ExcludeSharedDrives: serializeAws_json1_1ExcludeSharedDrivesList(input.ExcludeSharedDrives, context), - }), - ...(input.ExcludeUserAccounts !== undefined && { - ExcludeUserAccounts: serializeAws_json1_1ExcludeUserAccountsList(input.ExcludeUserAccounts, context), - }), - ...(input.ExclusionPatterns !== undefined && { - ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), - }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), - ...(input.InclusionPatterns !== undefined && { - InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), - }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), + ...(input.ExcludeMimeTypes !== undefined && + input.ExcludeMimeTypes !== null && { + ExcludeMimeTypes: serializeAws_json1_1ExcludeMimeTypesList(input.ExcludeMimeTypes, context), + }), + ...(input.ExcludeSharedDrives !== undefined && + input.ExcludeSharedDrives !== null && { + ExcludeSharedDrives: serializeAws_json1_1ExcludeSharedDrivesList(input.ExcludeSharedDrives, context), + }), + ...(input.ExcludeUserAccounts !== undefined && + input.ExcludeUserAccounts !== null && { + ExcludeUserAccounts: serializeAws_json1_1ExcludeUserAccountsList(input.ExcludeUserAccounts, context), + }), + ...(input.ExclusionPatterns !== undefined && + input.ExclusionPatterns !== null && { + ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), + }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), + ...(input.InclusionPatterns !== undefined && + input.InclusionPatterns !== null && { + InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), + }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), }; }; @@ -4054,8 +4248,10 @@ const serializeAws_json1_1JsonTokenTypeConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.GroupAttributeField !== undefined && { GroupAttributeField: input.GroupAttributeField }), - ...(input.UserNameAttributeField !== undefined && { UserNameAttributeField: input.UserNameAttributeField }), + ...(input.GroupAttributeField !== undefined && + input.GroupAttributeField !== null && { GroupAttributeField: input.GroupAttributeField }), + ...(input.UserNameAttributeField !== undefined && + input.UserNameAttributeField !== null && { UserNameAttributeField: input.UserNameAttributeField }), }; }; @@ -4064,21 +4260,24 @@ const serializeAws_json1_1JwtTokenTypeConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.ClaimRegex !== undefined && { ClaimRegex: input.ClaimRegex }), - ...(input.GroupAttributeField !== undefined && { GroupAttributeField: input.GroupAttributeField }), - ...(input.Issuer !== undefined && { Issuer: input.Issuer }), - ...(input.KeyLocation !== undefined && { KeyLocation: input.KeyLocation }), - ...(input.SecretManagerArn !== undefined && { SecretManagerArn: input.SecretManagerArn }), - ...(input.URL !== undefined && { URL: input.URL }), - ...(input.UserNameAttributeField !== undefined && { UserNameAttributeField: input.UserNameAttributeField }), + ...(input.ClaimRegex !== undefined && input.ClaimRegex !== null && { ClaimRegex: input.ClaimRegex }), + ...(input.GroupAttributeField !== undefined && + input.GroupAttributeField !== null && { GroupAttributeField: input.GroupAttributeField }), + ...(input.Issuer !== undefined && input.Issuer !== null && { Issuer: input.Issuer }), + ...(input.KeyLocation !== undefined && input.KeyLocation !== null && { KeyLocation: input.KeyLocation }), + ...(input.SecretManagerArn !== undefined && + input.SecretManagerArn !== null && { SecretManagerArn: input.SecretManagerArn }), + ...(input.URL !== undefined && input.URL !== null && { URL: input.URL }), + ...(input.UserNameAttributeField !== undefined && + input.UserNameAttributeField !== null && { UserNameAttributeField: input.UserNameAttributeField }), }; }; const serializeAws_json1_1ListDataSourcesRequest = (input: ListDataSourcesRequest, context: __SerdeContext): any => { return { - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4087,29 +4286,30 @@ const serializeAws_json1_1ListDataSourceSyncJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTimeFilter !== undefined && { - StartTimeFilter: serializeAws_json1_1TimeRange(input.StartTimeFilter, context), - }), - ...(input.StatusFilter !== undefined && { StatusFilter: input.StatusFilter }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTimeFilter !== undefined && + input.StartTimeFilter !== null && { + StartTimeFilter: serializeAws_json1_1TimeRange(input.StartTimeFilter, context), + }), + ...(input.StatusFilter !== undefined && input.StatusFilter !== null && { StatusFilter: input.StatusFilter }), }; }; const serializeAws_json1_1ListFaqsRequest = (input: ListFaqsRequest, context: __SerdeContext): any => { return { - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListIndicesRequest = (input: ListIndicesRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4118,113 +4318,147 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1ListThesauriRequest = (input: ListThesauriRequest, context: __SerdeContext): any => { return { - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1OneDriveConfiguration = (input: OneDriveConfiguration, context: __SerdeContext): any => { return { - ...(input.DisableLocalGroups !== undefined && { DisableLocalGroups: input.DisableLocalGroups }), - ...(input.ExclusionPatterns !== undefined && { - ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), - }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), - ...(input.InclusionPatterns !== undefined && { - InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), - }), - ...(input.OneDriveUsers !== undefined && { - OneDriveUsers: serializeAws_json1_1OneDriveUsers(input.OneDriveUsers, context), - }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), - ...(input.TenantDomain !== undefined && { TenantDomain: input.TenantDomain }), + ...(input.DisableLocalGroups !== undefined && + input.DisableLocalGroups !== null && { DisableLocalGroups: input.DisableLocalGroups }), + ...(input.ExclusionPatterns !== undefined && + input.ExclusionPatterns !== null && { + ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), + }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), + ...(input.InclusionPatterns !== undefined && + input.InclusionPatterns !== null && { + InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), + }), + ...(input.OneDriveUsers !== undefined && + input.OneDriveUsers !== null && { + OneDriveUsers: serializeAws_json1_1OneDriveUsers(input.OneDriveUsers, context), + }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), + ...(input.TenantDomain !== undefined && input.TenantDomain !== null && { TenantDomain: input.TenantDomain }), }; }; const serializeAws_json1_1OneDriveUserList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OneDriveUsers = (input: OneDriveUsers, context: __SerdeContext): any => { return { - ...(input.OneDriveUserList !== undefined && { - OneDriveUserList: serializeAws_json1_1OneDriveUserList(input.OneDriveUserList, context), - }), - ...(input.OneDriveUserS3Path !== undefined && { - OneDriveUserS3Path: serializeAws_json1_1S3Path(input.OneDriveUserS3Path, context), - }), + ...(input.OneDriveUserList !== undefined && + input.OneDriveUserList !== null && { + OneDriveUserList: serializeAws_json1_1OneDriveUserList(input.OneDriveUserList, context), + }), + ...(input.OneDriveUserS3Path !== undefined && + input.OneDriveUserS3Path !== null && { + OneDriveUserS3Path: serializeAws_json1_1S3Path(input.OneDriveUserS3Path, context), + }), }; }; const serializeAws_json1_1Principal = (input: Principal, context: __SerdeContext): any => { return { - ...(input.Access !== undefined && { Access: input.Access }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Access !== undefined && input.Access !== null && { Access: input.Access }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1PrincipalList = (input: Principal[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Principal(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Principal(entry, context); + }); }; const serializeAws_json1_1QueryRequest = (input: QueryRequest, context: __SerdeContext): any => { return { - ...(input.AttributeFilter !== undefined && { - AttributeFilter: serializeAws_json1_1AttributeFilter(input.AttributeFilter, context), - }), - ...(input.Facets !== undefined && { Facets: serializeAws_json1_1FacetList(input.Facets, context) }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.PageNumber !== undefined && { PageNumber: input.PageNumber }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.QueryResultTypeFilter !== undefined && { QueryResultTypeFilter: input.QueryResultTypeFilter }), - ...(input.QueryText !== undefined && { QueryText: input.QueryText }), - ...(input.RequestedDocumentAttributes !== undefined && { - RequestedDocumentAttributes: serializeAws_json1_1DocumentAttributeKeyList( - input.RequestedDocumentAttributes, - context - ), - }), - ...(input.SortingConfiguration !== undefined && { - SortingConfiguration: serializeAws_json1_1SortingConfiguration(input.SortingConfiguration, context), - }), - ...(input.UserContext !== undefined && { - UserContext: serializeAws_json1_1UserContext(input.UserContext, context), - }), - ...(input.VisitorId !== undefined && { VisitorId: input.VisitorId }), + ...(input.AttributeFilter !== undefined && + input.AttributeFilter !== null && { + AttributeFilter: serializeAws_json1_1AttributeFilter(input.AttributeFilter, context), + }), + ...(input.Facets !== undefined && + input.Facets !== null && { Facets: serializeAws_json1_1FacetList(input.Facets, context) }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.PageNumber !== undefined && input.PageNumber !== null && { PageNumber: input.PageNumber }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.QueryResultTypeFilter !== undefined && + input.QueryResultTypeFilter !== null && { QueryResultTypeFilter: input.QueryResultTypeFilter }), + ...(input.QueryText !== undefined && input.QueryText !== null && { QueryText: input.QueryText }), + ...(input.RequestedDocumentAttributes !== undefined && + input.RequestedDocumentAttributes !== null && { + RequestedDocumentAttributes: serializeAws_json1_1DocumentAttributeKeyList( + input.RequestedDocumentAttributes, + context + ), + }), + ...(input.SortingConfiguration !== undefined && + input.SortingConfiguration !== null && { + SortingConfiguration: serializeAws_json1_1SortingConfiguration(input.SortingConfiguration, context), + }), + ...(input.UserContext !== undefined && + input.UserContext !== null && { UserContext: serializeAws_json1_1UserContext(input.UserContext, context) }), + ...(input.VisitorId !== undefined && input.VisitorId !== null && { VisitorId: input.VisitorId }), }; }; const serializeAws_json1_1Relevance = (input: Relevance, context: __SerdeContext): any => { return { - ...(input.Duration !== undefined && { Duration: input.Duration }), - ...(input.Freshness !== undefined && { Freshness: input.Freshness }), - ...(input.Importance !== undefined && { Importance: input.Importance }), - ...(input.RankOrder !== undefined && { RankOrder: input.RankOrder }), - ...(input.ValueImportanceMap !== undefined && { - ValueImportanceMap: serializeAws_json1_1ValueImportanceMap(input.ValueImportanceMap, context), - }), + ...(input.Duration !== undefined && input.Duration !== null && { Duration: input.Duration }), + ...(input.Freshness !== undefined && input.Freshness !== null && { Freshness: input.Freshness }), + ...(input.Importance !== undefined && input.Importance !== null && { Importance: input.Importance }), + ...(input.RankOrder !== undefined && input.RankOrder !== null && { RankOrder: input.RankOrder }), + ...(input.ValueImportanceMap !== undefined && + input.ValueImportanceMap !== null && { + ValueImportanceMap: serializeAws_json1_1ValueImportanceMap(input.ValueImportanceMap, context), + }), }; }; const serializeAws_json1_1RelevanceFeedback = (input: RelevanceFeedback, context: __SerdeContext): any => { return { - ...(input.RelevanceValue !== undefined && { RelevanceValue: input.RelevanceValue }), - ...(input.ResultId !== undefined && { ResultId: input.ResultId }), + ...(input.RelevanceValue !== undefined && + input.RelevanceValue !== null && { RelevanceValue: input.RelevanceValue }), + ...(input.ResultId !== undefined && input.ResultId !== null && { ResultId: input.ResultId }), }; }; const serializeAws_json1_1RelevanceFeedbackList = (input: RelevanceFeedback[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RelevanceFeedback(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RelevanceFeedback(entry, context); + }); }; const serializeAws_json1_1S3DataSourceConfiguration = ( @@ -4232,35 +4466,40 @@ const serializeAws_json1_1S3DataSourceConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AccessControlListConfiguration !== undefined && { - AccessControlListConfiguration: serializeAws_json1_1AccessControlListConfiguration( - input.AccessControlListConfiguration, - context - ), - }), - ...(input.BucketName !== undefined && { BucketName: input.BucketName }), - ...(input.DocumentsMetadataConfiguration !== undefined && { - DocumentsMetadataConfiguration: serializeAws_json1_1DocumentsMetadataConfiguration( - input.DocumentsMetadataConfiguration, - context - ), - }), - ...(input.ExclusionPatterns !== undefined && { - ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), - }), - ...(input.InclusionPatterns !== undefined && { - InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), - }), - ...(input.InclusionPrefixes !== undefined && { - InclusionPrefixes: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPrefixes, context), - }), + ...(input.AccessControlListConfiguration !== undefined && + input.AccessControlListConfiguration !== null && { + AccessControlListConfiguration: serializeAws_json1_1AccessControlListConfiguration( + input.AccessControlListConfiguration, + context + ), + }), + ...(input.BucketName !== undefined && input.BucketName !== null && { BucketName: input.BucketName }), + ...(input.DocumentsMetadataConfiguration !== undefined && + input.DocumentsMetadataConfiguration !== null && { + DocumentsMetadataConfiguration: serializeAws_json1_1DocumentsMetadataConfiguration( + input.DocumentsMetadataConfiguration, + context + ), + }), + ...(input.ExclusionPatterns !== undefined && + input.ExclusionPatterns !== null && { + ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), + }), + ...(input.InclusionPatterns !== undefined && + input.InclusionPatterns !== null && { + InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), + }), + ...(input.InclusionPrefixes !== undefined && + input.InclusionPrefixes !== null && { + InclusionPrefixes: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPrefixes, context), + }), }; }; const serializeAws_json1_1S3Path = (input: S3Path, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), }; }; @@ -4269,17 +4508,21 @@ const serializeAws_json1_1SalesforceChatterFeedConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DocumentDataFieldName !== undefined && { DocumentDataFieldName: input.DocumentDataFieldName }), - ...(input.DocumentTitleFieldName !== undefined && { DocumentTitleFieldName: input.DocumentTitleFieldName }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), - ...(input.IncludeFilterTypes !== undefined && { - IncludeFilterTypes: serializeAws_json1_1SalesforceChatterFeedIncludeFilterTypes( - input.IncludeFilterTypes, - context - ), - }), + ...(input.DocumentDataFieldName !== undefined && + input.DocumentDataFieldName !== null && { DocumentDataFieldName: input.DocumentDataFieldName }), + ...(input.DocumentTitleFieldName !== undefined && + input.DocumentTitleFieldName !== null && { DocumentTitleFieldName: input.DocumentTitleFieldName }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), + ...(input.IncludeFilterTypes !== undefined && + input.IncludeFilterTypes !== null && { + IncludeFilterTypes: serializeAws_json1_1SalesforceChatterFeedIncludeFilterTypes( + input.IncludeFilterTypes, + context + ), + }), }; }; @@ -4287,50 +4530,64 @@ const serializeAws_json1_1SalesforceChatterFeedIncludeFilterTypes = ( input: (SalesforceChatterFeedIncludeFilterType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SalesforceConfiguration = (input: SalesforceConfiguration, context: __SerdeContext): any => { return { - ...(input.ChatterFeedConfiguration !== undefined && { - ChatterFeedConfiguration: serializeAws_json1_1SalesforceChatterFeedConfiguration( - input.ChatterFeedConfiguration, - context - ), - }), - ...(input.CrawlAttachments !== undefined && { CrawlAttachments: input.CrawlAttachments }), - ...(input.ExcludeAttachmentFilePatterns !== undefined && { - ExcludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( - input.ExcludeAttachmentFilePatterns, - context - ), - }), - ...(input.IncludeAttachmentFilePatterns !== undefined && { - IncludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( - input.IncludeAttachmentFilePatterns, - context - ), - }), - ...(input.KnowledgeArticleConfiguration !== undefined && { - KnowledgeArticleConfiguration: serializeAws_json1_1SalesforceKnowledgeArticleConfiguration( - input.KnowledgeArticleConfiguration, - context - ), - }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), - ...(input.ServerUrl !== undefined && { ServerUrl: input.ServerUrl }), - ...(input.StandardObjectAttachmentConfiguration !== undefined && { - StandardObjectAttachmentConfiguration: serializeAws_json1_1SalesforceStandardObjectAttachmentConfiguration( - input.StandardObjectAttachmentConfiguration, - context - ), - }), - ...(input.StandardObjectConfigurations !== undefined && { - StandardObjectConfigurations: serializeAws_json1_1SalesforceStandardObjectConfigurationList( - input.StandardObjectConfigurations, - context - ), - }), + ...(input.ChatterFeedConfiguration !== undefined && + input.ChatterFeedConfiguration !== null && { + ChatterFeedConfiguration: serializeAws_json1_1SalesforceChatterFeedConfiguration( + input.ChatterFeedConfiguration, + context + ), + }), + ...(input.CrawlAttachments !== undefined && + input.CrawlAttachments !== null && { CrawlAttachments: input.CrawlAttachments }), + ...(input.ExcludeAttachmentFilePatterns !== undefined && + input.ExcludeAttachmentFilePatterns !== null && { + ExcludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( + input.ExcludeAttachmentFilePatterns, + context + ), + }), + ...(input.IncludeAttachmentFilePatterns !== undefined && + input.IncludeAttachmentFilePatterns !== null && { + IncludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( + input.IncludeAttachmentFilePatterns, + context + ), + }), + ...(input.KnowledgeArticleConfiguration !== undefined && + input.KnowledgeArticleConfiguration !== null && { + KnowledgeArticleConfiguration: serializeAws_json1_1SalesforceKnowledgeArticleConfiguration( + input.KnowledgeArticleConfiguration, + context + ), + }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), + ...(input.ServerUrl !== undefined && input.ServerUrl !== null && { ServerUrl: input.ServerUrl }), + ...(input.StandardObjectAttachmentConfiguration !== undefined && + input.StandardObjectAttachmentConfiguration !== null && { + StandardObjectAttachmentConfiguration: serializeAws_json1_1SalesforceStandardObjectAttachmentConfiguration( + input.StandardObjectAttachmentConfiguration, + context + ), + }), + ...(input.StandardObjectConfigurations !== undefined && + input.StandardObjectConfigurations !== null && { + StandardObjectConfigurations: serializeAws_json1_1SalesforceStandardObjectConfigurationList( + input.StandardObjectConfigurations, + context + ), + }), }; }; @@ -4339,12 +4596,15 @@ const serializeAws_json1_1SalesforceCustomKnowledgeArticleTypeConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DocumentDataFieldName !== undefined && { DocumentDataFieldName: input.DocumentDataFieldName }), - ...(input.DocumentTitleFieldName !== undefined && { DocumentTitleFieldName: input.DocumentTitleFieldName }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.DocumentDataFieldName !== undefined && + input.DocumentDataFieldName !== null && { DocumentDataFieldName: input.DocumentDataFieldName }), + ...(input.DocumentTitleFieldName !== undefined && + input.DocumentTitleFieldName !== null && { DocumentTitleFieldName: input.DocumentTitleFieldName }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -4352,7 +4612,14 @@ const serializeAws_json1_1SalesforceCustomKnowledgeArticleTypeConfigurationList input: SalesforceCustomKnowledgeArticleTypeConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1SalesforceCustomKnowledgeArticleTypeConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SalesforceCustomKnowledgeArticleTypeConfiguration(entry, context); + }); }; const serializeAws_json1_1SalesforceKnowledgeArticleConfiguration = ( @@ -4360,21 +4627,24 @@ const serializeAws_json1_1SalesforceKnowledgeArticleConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CustomKnowledgeArticleTypeConfigurations !== undefined && { - CustomKnowledgeArticleTypeConfigurations: serializeAws_json1_1SalesforceCustomKnowledgeArticleTypeConfigurationList( - input.CustomKnowledgeArticleTypeConfigurations, - context - ), - }), - ...(input.IncludedStates !== undefined && { - IncludedStates: serializeAws_json1_1SalesforceKnowledgeArticleStateList(input.IncludedStates, context), - }), - ...(input.StandardKnowledgeArticleTypeConfiguration !== undefined && { - StandardKnowledgeArticleTypeConfiguration: serializeAws_json1_1SalesforceStandardKnowledgeArticleTypeConfiguration( - input.StandardKnowledgeArticleTypeConfiguration, - context - ), - }), + ...(input.CustomKnowledgeArticleTypeConfigurations !== undefined && + input.CustomKnowledgeArticleTypeConfigurations !== null && { + CustomKnowledgeArticleTypeConfigurations: serializeAws_json1_1SalesforceCustomKnowledgeArticleTypeConfigurationList( + input.CustomKnowledgeArticleTypeConfigurations, + context + ), + }), + ...(input.IncludedStates !== undefined && + input.IncludedStates !== null && { + IncludedStates: serializeAws_json1_1SalesforceKnowledgeArticleStateList(input.IncludedStates, context), + }), + ...(input.StandardKnowledgeArticleTypeConfiguration !== undefined && + input.StandardKnowledgeArticleTypeConfiguration !== null && { + StandardKnowledgeArticleTypeConfiguration: serializeAws_json1_1SalesforceStandardKnowledgeArticleTypeConfiguration( + input.StandardKnowledgeArticleTypeConfiguration, + context + ), + }), }; }; @@ -4382,7 +4652,14 @@ const serializeAws_json1_1SalesforceKnowledgeArticleStateList = ( input: (SalesforceKnowledgeArticleState | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SalesforceStandardKnowledgeArticleTypeConfiguration = ( @@ -4390,11 +4667,14 @@ const serializeAws_json1_1SalesforceStandardKnowledgeArticleTypeConfiguration = context: __SerdeContext ): any => { return { - ...(input.DocumentDataFieldName !== undefined && { DocumentDataFieldName: input.DocumentDataFieldName }), - ...(input.DocumentTitleFieldName !== undefined && { DocumentTitleFieldName: input.DocumentTitleFieldName }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), + ...(input.DocumentDataFieldName !== undefined && + input.DocumentDataFieldName !== null && { DocumentDataFieldName: input.DocumentDataFieldName }), + ...(input.DocumentTitleFieldName !== undefined && + input.DocumentTitleFieldName !== null && { DocumentTitleFieldName: input.DocumentTitleFieldName }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), }; }; @@ -4403,10 +4683,12 @@ const serializeAws_json1_1SalesforceStandardObjectAttachmentConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DocumentTitleFieldName !== undefined && { DocumentTitleFieldName: input.DocumentTitleFieldName }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), + ...(input.DocumentTitleFieldName !== undefined && + input.DocumentTitleFieldName !== null && { DocumentTitleFieldName: input.DocumentTitleFieldName }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), }; }; @@ -4415,12 +4697,15 @@ const serializeAws_json1_1SalesforceStandardObjectConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DocumentDataFieldName !== undefined && { DocumentDataFieldName: input.DocumentDataFieldName }), - ...(input.DocumentTitleFieldName !== undefined && { DocumentTitleFieldName: input.DocumentTitleFieldName }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.DocumentDataFieldName !== undefined && + input.DocumentDataFieldName !== null && { DocumentDataFieldName: input.DocumentDataFieldName }), + ...(input.DocumentTitleFieldName !== undefined && + input.DocumentTitleFieldName !== null && { DocumentTitleFieldName: input.DocumentTitleFieldName }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -4428,20 +4713,34 @@ const serializeAws_json1_1SalesforceStandardObjectConfigurationList = ( input: SalesforceStandardObjectConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1SalesforceStandardObjectConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SalesforceStandardObjectConfiguration(entry, context); + }); }; const serializeAws_json1_1Search = (input: Search, context: __SerdeContext): any => { return { - ...(input.Displayable !== undefined && { Displayable: input.Displayable }), - ...(input.Facetable !== undefined && { Facetable: input.Facetable }), - ...(input.Searchable !== undefined && { Searchable: input.Searchable }), - ...(input.Sortable !== undefined && { Sortable: input.Sortable }), + ...(input.Displayable !== undefined && input.Displayable !== null && { Displayable: input.Displayable }), + ...(input.Facetable !== undefined && input.Facetable !== null && { Facetable: input.Facetable }), + ...(input.Searchable !== undefined && input.Searchable !== null && { Searchable: input.Searchable }), + ...(input.Sortable !== undefined && input.Sortable !== null && { Sortable: input.Sortable }), }; }; const serializeAws_json1_1SecurityGroupIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ServerSideEncryptionConfiguration = ( @@ -4449,27 +4748,30 @@ const serializeAws_json1_1ServerSideEncryptionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), }; }; const serializeAws_json1_1ServiceNowConfiguration = (input: ServiceNowConfiguration, context: __SerdeContext): any => { return { - ...(input.HostUrl !== undefined && { HostUrl: input.HostUrl }), - ...(input.KnowledgeArticleConfiguration !== undefined && { - KnowledgeArticleConfiguration: serializeAws_json1_1ServiceNowKnowledgeArticleConfiguration( - input.KnowledgeArticleConfiguration, - context - ), - }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), - ...(input.ServiceCatalogConfiguration !== undefined && { - ServiceCatalogConfiguration: serializeAws_json1_1ServiceNowServiceCatalogConfiguration( - input.ServiceCatalogConfiguration, - context - ), - }), - ...(input.ServiceNowBuildVersion !== undefined && { ServiceNowBuildVersion: input.ServiceNowBuildVersion }), + ...(input.HostUrl !== undefined && input.HostUrl !== null && { HostUrl: input.HostUrl }), + ...(input.KnowledgeArticleConfiguration !== undefined && + input.KnowledgeArticleConfiguration !== null && { + KnowledgeArticleConfiguration: serializeAws_json1_1ServiceNowKnowledgeArticleConfiguration( + input.KnowledgeArticleConfiguration, + context + ), + }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), + ...(input.ServiceCatalogConfiguration !== undefined && + input.ServiceCatalogConfiguration !== null && { + ServiceCatalogConfiguration: serializeAws_json1_1ServiceNowServiceCatalogConfiguration( + input.ServiceCatalogConfiguration, + context + ), + }), + ...(input.ServiceNowBuildVersion !== undefined && + input.ServiceNowBuildVersion !== null && { ServiceNowBuildVersion: input.ServiceNowBuildVersion }), }; }; @@ -4478,24 +4780,30 @@ const serializeAws_json1_1ServiceNowKnowledgeArticleConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CrawlAttachments !== undefined && { CrawlAttachments: input.CrawlAttachments }), - ...(input.DocumentDataFieldName !== undefined && { DocumentDataFieldName: input.DocumentDataFieldName }), - ...(input.DocumentTitleFieldName !== undefined && { DocumentTitleFieldName: input.DocumentTitleFieldName }), - ...(input.ExcludeAttachmentFilePatterns !== undefined && { - ExcludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( - input.ExcludeAttachmentFilePatterns, - context - ), - }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), - ...(input.IncludeAttachmentFilePatterns !== undefined && { - IncludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( - input.IncludeAttachmentFilePatterns, - context - ), - }), + ...(input.CrawlAttachments !== undefined && + input.CrawlAttachments !== null && { CrawlAttachments: input.CrawlAttachments }), + ...(input.DocumentDataFieldName !== undefined && + input.DocumentDataFieldName !== null && { DocumentDataFieldName: input.DocumentDataFieldName }), + ...(input.DocumentTitleFieldName !== undefined && + input.DocumentTitleFieldName !== null && { DocumentTitleFieldName: input.DocumentTitleFieldName }), + ...(input.ExcludeAttachmentFilePatterns !== undefined && + input.ExcludeAttachmentFilePatterns !== null && { + ExcludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( + input.ExcludeAttachmentFilePatterns, + context + ), + }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), + ...(input.IncludeAttachmentFilePatterns !== undefined && + input.IncludeAttachmentFilePatterns !== null && { + IncludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( + input.IncludeAttachmentFilePatterns, + context + ), + }), }; }; @@ -4504,67 +4812,91 @@ const serializeAws_json1_1ServiceNowServiceCatalogConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CrawlAttachments !== undefined && { CrawlAttachments: input.CrawlAttachments }), - ...(input.DocumentDataFieldName !== undefined && { DocumentDataFieldName: input.DocumentDataFieldName }), - ...(input.DocumentTitleFieldName !== undefined && { DocumentTitleFieldName: input.DocumentTitleFieldName }), - ...(input.ExcludeAttachmentFilePatterns !== undefined && { - ExcludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( - input.ExcludeAttachmentFilePatterns, - context - ), - }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), - ...(input.IncludeAttachmentFilePatterns !== undefined && { - IncludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( - input.IncludeAttachmentFilePatterns, - context - ), - }), + ...(input.CrawlAttachments !== undefined && + input.CrawlAttachments !== null && { CrawlAttachments: input.CrawlAttachments }), + ...(input.DocumentDataFieldName !== undefined && + input.DocumentDataFieldName !== null && { DocumentDataFieldName: input.DocumentDataFieldName }), + ...(input.DocumentTitleFieldName !== undefined && + input.DocumentTitleFieldName !== null && { DocumentTitleFieldName: input.DocumentTitleFieldName }), + ...(input.ExcludeAttachmentFilePatterns !== undefined && + input.ExcludeAttachmentFilePatterns !== null && { + ExcludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( + input.ExcludeAttachmentFilePatterns, + context + ), + }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), + ...(input.IncludeAttachmentFilePatterns !== undefined && + input.IncludeAttachmentFilePatterns !== null && { + IncludeAttachmentFilePatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( + input.IncludeAttachmentFilePatterns, + context + ), + }), }; }; const serializeAws_json1_1SharePointConfiguration = (input: SharePointConfiguration, context: __SerdeContext): any => { return { - ...(input.CrawlAttachments !== undefined && { CrawlAttachments: input.CrawlAttachments }), - ...(input.DisableLocalGroups !== undefined && { DisableLocalGroups: input.DisableLocalGroups }), - ...(input.DocumentTitleFieldName !== undefined && { DocumentTitleFieldName: input.DocumentTitleFieldName }), - ...(input.ExclusionPatterns !== undefined && { - ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), - }), - ...(input.FieldMappings !== undefined && { - FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), - }), - ...(input.InclusionPatterns !== undefined && { - InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), - }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), - ...(input.SharePointVersion !== undefined && { SharePointVersion: input.SharePointVersion }), - ...(input.Urls !== undefined && { Urls: serializeAws_json1_1SharePointUrlList(input.Urls, context) }), - ...(input.UseChangeLog !== undefined && { UseChangeLog: input.UseChangeLog }), - ...(input.VpcConfiguration !== undefined && { - VpcConfiguration: serializeAws_json1_1DataSourceVpcConfiguration(input.VpcConfiguration, context), - }), + ...(input.CrawlAttachments !== undefined && + input.CrawlAttachments !== null && { CrawlAttachments: input.CrawlAttachments }), + ...(input.DisableLocalGroups !== undefined && + input.DisableLocalGroups !== null && { DisableLocalGroups: input.DisableLocalGroups }), + ...(input.DocumentTitleFieldName !== undefined && + input.DocumentTitleFieldName !== null && { DocumentTitleFieldName: input.DocumentTitleFieldName }), + ...(input.ExclusionPatterns !== undefined && + input.ExclusionPatterns !== null && { + ExclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.ExclusionPatterns, context), + }), + ...(input.FieldMappings !== undefined && + input.FieldMappings !== null && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList(input.FieldMappings, context), + }), + ...(input.InclusionPatterns !== undefined && + input.InclusionPatterns !== null && { + InclusionPatterns: serializeAws_json1_1DataSourceInclusionsExclusionsStrings(input.InclusionPatterns, context), + }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), + ...(input.SharePointVersion !== undefined && + input.SharePointVersion !== null && { SharePointVersion: input.SharePointVersion }), + ...(input.Urls !== undefined && + input.Urls !== null && { Urls: serializeAws_json1_1SharePointUrlList(input.Urls, context) }), + ...(input.UseChangeLog !== undefined && input.UseChangeLog !== null && { UseChangeLog: input.UseChangeLog }), + ...(input.VpcConfiguration !== undefined && + input.VpcConfiguration !== null && { + VpcConfiguration: serializeAws_json1_1DataSourceVpcConfiguration(input.VpcConfiguration, context), + }), }; }; const serializeAws_json1_1SharePointUrlList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SortingConfiguration = (input: SortingConfiguration, context: __SerdeContext): any => { return { - ...(input.DocumentAttributeKey !== undefined && { DocumentAttributeKey: input.DocumentAttributeKey }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.DocumentAttributeKey !== undefined && + input.DocumentAttributeKey !== null && { DocumentAttributeKey: input.DocumentAttributeKey }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1SqlConfiguration = (input: SqlConfiguration, context: __SerdeContext): any => { return { - ...(input.QueryIdentifiersEnclosingOption !== undefined && { - QueryIdentifiersEnclosingOption: input.QueryIdentifiersEnclosingOption, - }), + ...(input.QueryIdentifiersEnclosingOption !== undefined && + input.QueryIdentifiersEnclosingOption !== null && { + QueryIdentifiersEnclosingOption: input.QueryIdentifiersEnclosingOption, + }), }; }; @@ -4573,8 +4905,8 @@ const serializeAws_json1_1StartDataSourceSyncJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), }; }; @@ -4583,131 +4915,165 @@ const serializeAws_json1_1StopDataSourceSyncJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), }; }; const serializeAws_json1_1SubmitFeedbackRequest = (input: SubmitFeedbackRequest, context: __SerdeContext): any => { return { - ...(input.ClickFeedbackItems !== undefined && { - ClickFeedbackItems: serializeAws_json1_1ClickFeedbackList(input.ClickFeedbackItems, context), - }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.QueryId !== undefined && { QueryId: input.QueryId }), - ...(input.RelevanceFeedbackItems !== undefined && { - RelevanceFeedbackItems: serializeAws_json1_1RelevanceFeedbackList(input.RelevanceFeedbackItems, context), - }), + ...(input.ClickFeedbackItems !== undefined && + input.ClickFeedbackItems !== null && { + ClickFeedbackItems: serializeAws_json1_1ClickFeedbackList(input.ClickFeedbackItems, context), + }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.QueryId !== undefined && input.QueryId !== null && { QueryId: input.QueryId }), + ...(input.RelevanceFeedbackItems !== undefined && + input.RelevanceFeedbackItems !== null && { + RelevanceFeedbackItems: serializeAws_json1_1RelevanceFeedbackList(input.RelevanceFeedbackItems, context), + }), }; }; const serializeAws_json1_1SubnetIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TimeRange = (input: TimeRange, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateDataSourceRequest = (input: UpdateDataSourceRequest, context: __SerdeContext): any => { return { - ...(input.Configuration !== undefined && { - Configuration: serializeAws_json1_1DataSourceConfiguration(input.Configuration, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), + ...(input.Configuration !== undefined && + input.Configuration !== null && { + Configuration: serializeAws_json1_1DataSourceConfiguration(input.Configuration, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), }; }; const serializeAws_json1_1UpdateIndexRequest = (input: UpdateIndexRequest, context: __SerdeContext): any => { return { - ...(input.CapacityUnits !== undefined && { - CapacityUnits: serializeAws_json1_1CapacityUnitsConfiguration(input.CapacityUnits, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DocumentMetadataConfigurationUpdates !== undefined && { - DocumentMetadataConfigurationUpdates: serializeAws_json1_1DocumentMetadataConfigurationList( - input.DocumentMetadataConfigurationUpdates, - context - ), - }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.UserContextPolicy !== undefined && { UserContextPolicy: input.UserContextPolicy }), - ...(input.UserTokenConfigurations !== undefined && { - UserTokenConfigurations: serializeAws_json1_1UserTokenConfigurationList(input.UserTokenConfigurations, context), - }), + ...(input.CapacityUnits !== undefined && + input.CapacityUnits !== null && { + CapacityUnits: serializeAws_json1_1CapacityUnitsConfiguration(input.CapacityUnits, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DocumentMetadataConfigurationUpdates !== undefined && + input.DocumentMetadataConfigurationUpdates !== null && { + DocumentMetadataConfigurationUpdates: serializeAws_json1_1DocumentMetadataConfigurationList( + input.DocumentMetadataConfigurationUpdates, + context + ), + }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.UserContextPolicy !== undefined && + input.UserContextPolicy !== null && { UserContextPolicy: input.UserContextPolicy }), + ...(input.UserTokenConfigurations !== undefined && + input.UserTokenConfigurations !== null && { + UserTokenConfigurations: serializeAws_json1_1UserTokenConfigurationList(input.UserTokenConfigurations, context), + }), }; }; const serializeAws_json1_1UpdateThesaurusRequest = (input: UpdateThesaurusRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.IndexId !== undefined && { IndexId: input.IndexId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.SourceS3Path !== undefined && { SourceS3Path: serializeAws_json1_1S3Path(input.SourceS3Path, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.IndexId !== undefined && input.IndexId !== null && { IndexId: input.IndexId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.SourceS3Path !== undefined && + input.SourceS3Path !== null && { SourceS3Path: serializeAws_json1_1S3Path(input.SourceS3Path, context) }), }; }; const serializeAws_json1_1UserContext = (input: UserContext, context: __SerdeContext): any => { return { - ...(input.Token !== undefined && { Token: input.Token }), + ...(input.Token !== undefined && input.Token !== null && { Token: input.Token }), }; }; const serializeAws_json1_1UserTokenConfiguration = (input: UserTokenConfiguration, context: __SerdeContext): any => { return { - ...(input.JsonTokenTypeConfiguration !== undefined && { - JsonTokenTypeConfiguration: serializeAws_json1_1JsonTokenTypeConfiguration( - input.JsonTokenTypeConfiguration, - context - ), - }), - ...(input.JwtTokenTypeConfiguration !== undefined && { - JwtTokenTypeConfiguration: serializeAws_json1_1JwtTokenTypeConfiguration( - input.JwtTokenTypeConfiguration, - context - ), - }), + ...(input.JsonTokenTypeConfiguration !== undefined && + input.JsonTokenTypeConfiguration !== null && { + JsonTokenTypeConfiguration: serializeAws_json1_1JsonTokenTypeConfiguration( + input.JsonTokenTypeConfiguration, + context + ), + }), + ...(input.JwtTokenTypeConfiguration !== undefined && + input.JwtTokenTypeConfiguration !== null && { + JwtTokenTypeConfiguration: serializeAws_json1_1JwtTokenTypeConfiguration( + input.JwtTokenTypeConfiguration, + context + ), + }), }; }; @@ -4715,17 +5081,26 @@ const serializeAws_json1_1UserTokenConfigurationList = ( input: UserTokenConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1UserTokenConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1UserTokenConfiguration(entry, context); + }); }; const serializeAws_json1_1ValueImportanceMap = (input: { [key: string]: number }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1AccessControlListConfiguration = ( @@ -4770,7 +5145,14 @@ const deserializeAws_json1_1AdditionalResultAttributeList = ( output: any, context: __SerdeContext ): AdditionalResultAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AdditionalResultAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AdditionalResultAttribute(entry, context); + }); }; const deserializeAws_json1_1AdditionalResultAttributeValue = ( @@ -4812,9 +5194,14 @@ const deserializeAws_json1_1BatchDeleteDocumentResponseFailedDocuments = ( output: any, context: __SerdeContext ): BatchDeleteDocumentResponseFailedDocument[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1BatchDeleteDocumentResponseFailedDocument(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchDeleteDocumentResponseFailedDocument(entry, context); + }); }; const deserializeAws_json1_1BatchPutDocumentResponse = ( @@ -4844,9 +5231,14 @@ const deserializeAws_json1_1BatchPutDocumentResponseFailedDocuments = ( output: any, context: __SerdeContext ): BatchPutDocumentResponseFailedDocument[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1BatchPutDocumentResponseFailedDocument(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchPutDocumentResponseFailedDocument(entry, context); + }); }; const deserializeAws_json1_1CapacityUnitsConfiguration = ( @@ -4866,7 +5258,14 @@ const deserializeAws_json1_1CapacityUnitsConfiguration = ( }; const deserializeAws_json1_1ChangeDetectingColumns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ColumnConfiguration = (output: any, context: __SerdeContext): ColumnConfiguration => { @@ -4918,9 +5317,14 @@ const deserializeAws_json1_1ConfluenceAttachmentFieldMappingsList = ( output: any, context: __SerdeContext ): ConfluenceAttachmentToIndexFieldMapping[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1ConfluenceAttachmentToIndexFieldMapping(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfluenceAttachmentToIndexFieldMapping(entry, context); + }); }; const deserializeAws_json1_1ConfluenceAttachmentToIndexFieldMapping = ( @@ -4955,7 +5359,14 @@ const deserializeAws_json1_1ConfluenceBlogFieldMappingsList = ( output: any, context: __SerdeContext ): ConfluenceBlogToIndexFieldMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfluenceBlogToIndexFieldMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfluenceBlogToIndexFieldMapping(entry, context); + }); }; const deserializeAws_json1_1ConfluenceBlogToIndexFieldMapping = ( @@ -5029,7 +5440,14 @@ const deserializeAws_json1_1ConfluencePageFieldMappingsList = ( output: any, context: __SerdeContext ): ConfluencePageToIndexFieldMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfluencePageToIndexFieldMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfluencePageToIndexFieldMapping(entry, context); + }); }; const deserializeAws_json1_1ConfluencePageToIndexFieldMapping = ( @@ -5080,11 +5498,25 @@ const deserializeAws_json1_1ConfluenceSpaceFieldMappingsList = ( output: any, context: __SerdeContext ): ConfluenceSpaceToIndexFieldMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConfluenceSpaceToIndexFieldMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConfluenceSpaceToIndexFieldMapping(entry, context); + }); }; const deserializeAws_json1_1ConfluenceSpaceList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ConfluenceSpaceToIndexFieldMapping = ( @@ -5219,7 +5651,14 @@ const deserializeAws_json1_1DataSourceInclusionsExclusionsStrings = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DataSourceSummary = (output: any, context: __SerdeContext): DataSourceSummary => { @@ -5240,7 +5679,14 @@ const deserializeAws_json1_1DataSourceSummary = (output: any, context: __SerdeCo }; const deserializeAws_json1_1DataSourceSummaryList = (output: any, context: __SerdeContext): DataSourceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataSourceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataSourceSummary(entry, context); + }); }; const deserializeAws_json1_1DataSourceSyncJob = (output: any, context: __SerdeContext): DataSourceSyncJob => { @@ -5270,7 +5716,14 @@ const deserializeAws_json1_1DataSourceSyncJobHistoryList = ( output: any, context: __SerdeContext ): DataSourceSyncJob[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataSourceSyncJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataSourceSyncJob(entry, context); + }); }; const deserializeAws_json1_1DataSourceSyncJobMetrics = ( @@ -5313,7 +5766,14 @@ const deserializeAws_json1_1DataSourceToIndexFieldMappingList = ( output: any, context: __SerdeContext ): DataSourceToIndexFieldMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataSourceToIndexFieldMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataSourceToIndexFieldMapping(entry, context); + }); }; const deserializeAws_json1_1DataSourceVpcConfiguration = ( @@ -5473,11 +5933,25 @@ const deserializeAws_json1_1DocumentAttribute = (output: any, context: __SerdeCo }; const deserializeAws_json1_1DocumentAttributeList = (output: any, context: __SerdeContext): DocumentAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentAttribute(entry, context); + }); }; const deserializeAws_json1_1DocumentAttributeStringListValue = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DocumentAttributeValue = (output: any, context: __SerdeContext): DocumentAttributeValue => { @@ -5521,7 +5995,14 @@ const deserializeAws_json1_1DocumentAttributeValueCountPairList = ( output: any, context: __SerdeContext ): DocumentAttributeValueCountPair[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentAttributeValueCountPair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentAttributeValueCountPair(entry, context); + }); }; const deserializeAws_json1_1DocumentMetadataConfiguration = ( @@ -5546,7 +6027,14 @@ const deserializeAws_json1_1DocumentMetadataConfigurationList = ( output: any, context: __SerdeContext ): DocumentMetadataConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentMetadataConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentMetadataConfiguration(entry, context); + }); }; const deserializeAws_json1_1DocumentsMetadataConfiguration = ( @@ -5559,15 +6047,36 @@ const deserializeAws_json1_1DocumentsMetadataConfiguration = ( }; const deserializeAws_json1_1ExcludeMimeTypesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ExcludeSharedDrivesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ExcludeUserAccountsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FacetResult = (output: any, context: __SerdeContext): FacetResult => { @@ -5588,7 +6097,14 @@ const deserializeAws_json1_1FacetResult = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1FacetResultList = (output: any, context: __SerdeContext): FacetResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FacetResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FacetResult(entry, context); + }); }; const deserializeAws_json1_1FaqStatistics = (output: any, context: __SerdeContext): FaqStatistics => { @@ -5618,7 +6134,14 @@ const deserializeAws_json1_1FaqSummary = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1FaqSummaryItems = (output: any, context: __SerdeContext): FaqSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FaqSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FaqSummary(entry, context); + }); }; const deserializeAws_json1_1GoogleDriveConfiguration = ( @@ -5664,7 +6187,14 @@ const deserializeAws_json1_1Highlight = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1HighlightList = (output: any, context: __SerdeContext): Highlight[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Highlight(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Highlight(entry, context); + }); }; const deserializeAws_json1_1IndexConfigurationSummary = ( @@ -5691,7 +6221,14 @@ const deserializeAws_json1_1IndexConfigurationSummaryList = ( output: any, context: __SerdeContext ): IndexConfigurationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IndexConfigurationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IndexConfigurationSummary(entry, context); + }); }; const deserializeAws_json1_1IndexStatistics = (output: any, context: __SerdeContext): IndexStatistics => { @@ -5850,7 +6387,14 @@ const deserializeAws_json1_1OneDriveConfiguration = (output: any, context: __Ser }; const deserializeAws_json1_1OneDriveUserList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1OneDriveUsers = (output: any, context: __SerdeContext): OneDriveUsers => { @@ -5916,7 +6460,14 @@ const deserializeAws_json1_1QueryResultItem = (output: any, context: __SerdeCont }; const deserializeAws_json1_1QueryResultItemList = (output: any, context: __SerdeContext): QueryResultItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1QueryResultItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1QueryResultItem(entry, context); + }); }; const deserializeAws_json1_1Relevance = (output: any, context: __SerdeContext): Relevance => { @@ -6029,7 +6580,14 @@ const deserializeAws_json1_1SalesforceChatterFeedIncludeFilterTypes = ( output: any, context: __SerdeContext ): (SalesforceChatterFeedIncludeFilterType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SalesforceConfiguration = ( @@ -6097,9 +6655,14 @@ const deserializeAws_json1_1SalesforceCustomKnowledgeArticleTypeConfigurationLis output: any, context: __SerdeContext ): SalesforceCustomKnowledgeArticleTypeConfiguration[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1SalesforceCustomKnowledgeArticleTypeConfiguration(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SalesforceCustomKnowledgeArticleTypeConfiguration(entry, context); + }); }; const deserializeAws_json1_1SalesforceKnowledgeArticleConfiguration = ( @@ -6134,7 +6697,14 @@ const deserializeAws_json1_1SalesforceKnowledgeArticleStateList = ( output: any, context: __SerdeContext ): (SalesforceKnowledgeArticleState | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SalesforceStandardKnowledgeArticleTypeConfiguration = ( @@ -6198,9 +6768,14 @@ const deserializeAws_json1_1SalesforceStandardObjectConfigurationList = ( output: any, context: __SerdeContext ): SalesforceStandardObjectConfiguration[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1SalesforceStandardObjectConfiguration(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SalesforceStandardObjectConfiguration(entry, context); + }); }; const deserializeAws_json1_1ScoreAttributes = (output: any, context: __SerdeContext): ScoreAttributes => { @@ -6220,7 +6795,14 @@ const deserializeAws_json1_1Search = (output: any, context: __SerdeContext): Sea }; const deserializeAws_json1_1SecurityGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ServerSideEncryptionConfiguration = ( @@ -6368,7 +6950,14 @@ const deserializeAws_json1_1SharePointConfiguration = ( }; const deserializeAws_json1_1SharePointUrlList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SqlConfiguration = (output: any, context: __SerdeContext): SqlConfiguration => { @@ -6390,7 +6979,14 @@ const deserializeAws_json1_1StartDataSourceSyncJobResponse = ( }; const deserializeAws_json1_1SubnetIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -6401,7 +6997,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -6446,7 +7049,14 @@ const deserializeAws_json1_1ThesaurusSummary = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ThesaurusSummaryItems = (output: any, context: __SerdeContext): ThesaurusSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ThesaurusSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ThesaurusSummary(entry, context); + }); }; const deserializeAws_json1_1ThrottlingException = (output: any, context: __SerdeContext): ThrottlingException => { @@ -6476,7 +7086,14 @@ const deserializeAws_json1_1UserTokenConfigurationList = ( output: any, context: __SerdeContext ): UserTokenConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserTokenConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserTokenConfiguration(entry, context); + }); }; const deserializeAws_json1_1ValidationException = (output: any, context: __SerdeContext): ValidationException => { @@ -6486,13 +7103,15 @@ const deserializeAws_json1_1ValidationException = (output: any, context: __Serde }; const deserializeAws_json1_1ValueImportanceMap = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -6545,3 +7164,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-kinesis-analytics-v2/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics-v2/protocols/Aws_json1_1.ts index ee7409136d81..32cff232e148 100644 --- a/clients/client-kinesis-analytics-v2/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics-v2/protocols/Aws_json1_1.ts @@ -261,7 +261,7 @@ export const serializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.AddApplicationCloudWatchLoggingOption", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1AddApplicationInputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.AddApplicationInput", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1AddApplicationInputProcessingConfigurationComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.AddApplicationInputProcessingConfiguration", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1AddApplicationOutputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.AddApplicationOutput", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1AddApplicationReferenceDataSourceCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.AddApplicationReferenceDataSource", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1AddApplicationVpcConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.AddApplicationVpcConfiguration", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.CreateApplication", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1CreateApplicationPresignedUrlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.CreateApplicationPresignedUrl", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1CreateApplicationSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.CreateApplicationSnapshot", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1DeleteApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DeleteApplication", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DeleteApplicationCloudWatchLoggingOption", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1DeleteApplicationInputProcessingConfigurationCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DeleteApplicationInputProcessingConfiguration", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1DeleteApplicationOutputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DeleteApplicationOutput", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1DeleteApplicationReferenceDataSourceCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DeleteApplicationReferenceDataSource", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1DeleteApplicationSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DeleteApplicationSnapshot", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1DeleteApplicationVpcConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DeleteApplicationVpcConfiguration", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1DescribeApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DescribeApplication", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1DescribeApplicationSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DescribeApplicationSnapshot", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1DiscoverInputSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.DiscoverInputSchema", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1ListApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.ListApplications", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1ListApplicationSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.ListApplicationSnapshots", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.ListTagsForResource", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1StartApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.StartApplication", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1StopApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.StopApplication", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.TagResource", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.UntagResource", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20180523.UpdateApplication", }; let body: any; @@ -634,8 +634,7 @@ const deserializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -729,8 +728,7 @@ const deserializeAws_json1_1AddApplicationInputCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeValidationException": case "com.amazonaws.kinesisanalyticsv2#CodeValidationException": @@ -824,8 +822,7 @@ const deserializeAws_json1_1AddApplicationInputProcessingConfigurationCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -911,8 +908,7 @@ const deserializeAws_json1_1AddApplicationOutputCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -998,8 +994,7 @@ const deserializeAws_json1_1AddApplicationReferenceDataSourceCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -1085,8 +1080,7 @@ const deserializeAws_json1_1AddApplicationVpcConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -1172,8 +1166,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeValidationException": case "com.amazonaws.kinesisanalyticsv2#CodeValidationException": @@ -1275,8 +1268,7 @@ const deserializeAws_json1_1CreateApplicationPresignedUrlCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": @@ -1346,8 +1338,7 @@ const deserializeAws_json1_1CreateApplicationSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidApplicationConfigurationException": case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": @@ -1449,8 +1440,7 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -1544,8 +1534,7 @@ const deserializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -1639,8 +1628,7 @@ const deserializeAws_json1_1DeleteApplicationInputProcessingConfigurationCommand }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -1726,8 +1714,7 @@ const deserializeAws_json1_1DeleteApplicationOutputCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -1813,8 +1800,7 @@ const deserializeAws_json1_1DeleteApplicationReferenceDataSourceCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -1900,8 +1886,7 @@ const deserializeAws_json1_1DeleteApplicationSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": @@ -1987,8 +1972,7 @@ const deserializeAws_json1_1DeleteApplicationVpcConfigurationCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -2074,8 +2058,7 @@ const deserializeAws_json1_1DescribeApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": @@ -2145,8 +2128,7 @@ const deserializeAws_json1_1DescribeApplicationSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": @@ -2216,8 +2198,7 @@ const deserializeAws_json1_1DiscoverInputSchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": @@ -2303,8 +2284,7 @@ const deserializeAws_json1_1ListApplicationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidRequestException": case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": @@ -2358,8 +2338,7 @@ const deserializeAws_json1_1ListApplicationSnapshotsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": @@ -2421,8 +2400,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -2492,8 +2470,7 @@ const deserializeAws_json1_1StartApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidApplicationConfigurationException": case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": @@ -2579,8 +2556,7 @@ const deserializeAws_json1_1StopApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -2674,8 +2650,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -2761,8 +2736,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": @@ -2848,8 +2822,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeValidationException": case "com.amazonaws.kinesisanalyticsv2#CodeValidationException": @@ -3124,13 +3097,14 @@ const serializeAws_json1_1AddApplicationCloudWatchLoggingOptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CloudWatchLoggingOption !== undefined && { - CloudWatchLoggingOption: serializeAws_json1_1CloudWatchLoggingOption(input.CloudWatchLoggingOption, context), - }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CloudWatchLoggingOption !== undefined && + input.CloudWatchLoggingOption !== null && { + CloudWatchLoggingOption: serializeAws_json1_1CloudWatchLoggingOption(input.CloudWatchLoggingOption, context), + }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), }; }; @@ -3139,17 +3113,18 @@ const serializeAws_json1_1AddApplicationInputProcessingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.InputId !== undefined && { InputId: input.InputId }), - ...(input.InputProcessingConfiguration !== undefined && { - InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ), - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.InputId !== undefined && input.InputId !== null && { InputId: input.InputId }), + ...(input.InputProcessingConfiguration !== undefined && + input.InputProcessingConfiguration !== null && { + InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( + input.InputProcessingConfiguration, + context + ), + }), }; }; @@ -3158,11 +3133,12 @@ const serializeAws_json1_1AddApplicationInputRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.Input !== undefined && { Input: serializeAws_json1_1Input(input.Input, context) }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.Input !== undefined && + input.Input !== null && { Input: serializeAws_json1_1Input(input.Input, context) }), }; }; @@ -3171,11 +3147,12 @@ const serializeAws_json1_1AddApplicationOutputRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.Output !== undefined && { Output: serializeAws_json1_1Output(input.Output, context) }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.Output !== undefined && + input.Output !== null && { Output: serializeAws_json1_1Output(input.Output, context) }), }; }; @@ -3184,13 +3161,14 @@ const serializeAws_json1_1AddApplicationReferenceDataSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.ReferenceDataSource !== undefined && { - ReferenceDataSource: serializeAws_json1_1ReferenceDataSource(input.ReferenceDataSource, context), - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.ReferenceDataSource !== undefined && + input.ReferenceDataSource !== null && { + ReferenceDataSource: serializeAws_json1_1ReferenceDataSource(input.ReferenceDataSource, context), + }), }; }; @@ -3199,13 +3177,14 @@ const serializeAws_json1_1AddApplicationVpcConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.VpcConfiguration !== undefined && { - VpcConfiguration: serializeAws_json1_1VpcConfiguration(input.VpcConfiguration, context), - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.VpcConfiguration !== undefined && + input.VpcConfiguration !== null && { + VpcConfiguration: serializeAws_json1_1VpcConfiguration(input.VpcConfiguration, context), + }), }; }; @@ -3214,10 +3193,10 @@ const serializeAws_json1_1ApplicationCodeConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CodeContent !== undefined && { - CodeContent: serializeAws_json1_1CodeContent(input.CodeContent, context), - }), - ...(input.CodeContentType !== undefined && { CodeContentType: input.CodeContentType }), + ...(input.CodeContent !== undefined && + input.CodeContent !== null && { CodeContent: serializeAws_json1_1CodeContent(input.CodeContent, context) }), + ...(input.CodeContentType !== undefined && + input.CodeContentType !== null && { CodeContentType: input.CodeContentType }), }; }; @@ -3226,10 +3205,12 @@ const serializeAws_json1_1ApplicationCodeConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.CodeContentTypeUpdate !== undefined && { CodeContentTypeUpdate: input.CodeContentTypeUpdate }), - ...(input.CodeContentUpdate !== undefined && { - CodeContentUpdate: serializeAws_json1_1CodeContentUpdate(input.CodeContentUpdate, context), - }), + ...(input.CodeContentTypeUpdate !== undefined && + input.CodeContentTypeUpdate !== null && { CodeContentTypeUpdate: input.CodeContentTypeUpdate }), + ...(input.CodeContentUpdate !== undefined && + input.CodeContentUpdate !== null && { + CodeContentUpdate: serializeAws_json1_1CodeContentUpdate(input.CodeContentUpdate, context), + }), }; }; @@ -3238,36 +3219,42 @@ const serializeAws_json1_1ApplicationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationCodeConfiguration !== undefined && { - ApplicationCodeConfiguration: serializeAws_json1_1ApplicationCodeConfiguration( - input.ApplicationCodeConfiguration, - context - ), - }), - ...(input.ApplicationSnapshotConfiguration !== undefined && { - ApplicationSnapshotConfiguration: serializeAws_json1_1ApplicationSnapshotConfiguration( - input.ApplicationSnapshotConfiguration, - context - ), - }), - ...(input.EnvironmentProperties !== undefined && { - EnvironmentProperties: serializeAws_json1_1EnvironmentProperties(input.EnvironmentProperties, context), - }), - ...(input.FlinkApplicationConfiguration !== undefined && { - FlinkApplicationConfiguration: serializeAws_json1_1FlinkApplicationConfiguration( - input.FlinkApplicationConfiguration, - context - ), - }), - ...(input.SqlApplicationConfiguration !== undefined && { - SqlApplicationConfiguration: serializeAws_json1_1SqlApplicationConfiguration( - input.SqlApplicationConfiguration, - context - ), - }), - ...(input.VpcConfigurations !== undefined && { - VpcConfigurations: serializeAws_json1_1VpcConfigurations(input.VpcConfigurations, context), - }), + ...(input.ApplicationCodeConfiguration !== undefined && + input.ApplicationCodeConfiguration !== null && { + ApplicationCodeConfiguration: serializeAws_json1_1ApplicationCodeConfiguration( + input.ApplicationCodeConfiguration, + context + ), + }), + ...(input.ApplicationSnapshotConfiguration !== undefined && + input.ApplicationSnapshotConfiguration !== null && { + ApplicationSnapshotConfiguration: serializeAws_json1_1ApplicationSnapshotConfiguration( + input.ApplicationSnapshotConfiguration, + context + ), + }), + ...(input.EnvironmentProperties !== undefined && + input.EnvironmentProperties !== null && { + EnvironmentProperties: serializeAws_json1_1EnvironmentProperties(input.EnvironmentProperties, context), + }), + ...(input.FlinkApplicationConfiguration !== undefined && + input.FlinkApplicationConfiguration !== null && { + FlinkApplicationConfiguration: serializeAws_json1_1FlinkApplicationConfiguration( + input.FlinkApplicationConfiguration, + context + ), + }), + ...(input.SqlApplicationConfiguration !== undefined && + input.SqlApplicationConfiguration !== null && { + SqlApplicationConfiguration: serializeAws_json1_1SqlApplicationConfiguration( + input.SqlApplicationConfiguration, + context + ), + }), + ...(input.VpcConfigurations !== undefined && + input.VpcConfigurations !== null && { + VpcConfigurations: serializeAws_json1_1VpcConfigurations(input.VpcConfigurations, context), + }), }; }; @@ -3276,39 +3263,45 @@ const serializeAws_json1_1ApplicationConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationCodeConfigurationUpdate !== undefined && { - ApplicationCodeConfigurationUpdate: serializeAws_json1_1ApplicationCodeConfigurationUpdate( - input.ApplicationCodeConfigurationUpdate, - context - ), - }), - ...(input.ApplicationSnapshotConfigurationUpdate !== undefined && { - ApplicationSnapshotConfigurationUpdate: serializeAws_json1_1ApplicationSnapshotConfigurationUpdate( - input.ApplicationSnapshotConfigurationUpdate, - context - ), - }), - ...(input.EnvironmentPropertyUpdates !== undefined && { - EnvironmentPropertyUpdates: serializeAws_json1_1EnvironmentPropertyUpdates( - input.EnvironmentPropertyUpdates, - context - ), - }), - ...(input.FlinkApplicationConfigurationUpdate !== undefined && { - FlinkApplicationConfigurationUpdate: serializeAws_json1_1FlinkApplicationConfigurationUpdate( - input.FlinkApplicationConfigurationUpdate, - context - ), - }), - ...(input.SqlApplicationConfigurationUpdate !== undefined && { - SqlApplicationConfigurationUpdate: serializeAws_json1_1SqlApplicationConfigurationUpdate( - input.SqlApplicationConfigurationUpdate, - context - ), - }), - ...(input.VpcConfigurationUpdates !== undefined && { - VpcConfigurationUpdates: serializeAws_json1_1VpcConfigurationUpdates(input.VpcConfigurationUpdates, context), - }), + ...(input.ApplicationCodeConfigurationUpdate !== undefined && + input.ApplicationCodeConfigurationUpdate !== null && { + ApplicationCodeConfigurationUpdate: serializeAws_json1_1ApplicationCodeConfigurationUpdate( + input.ApplicationCodeConfigurationUpdate, + context + ), + }), + ...(input.ApplicationSnapshotConfigurationUpdate !== undefined && + input.ApplicationSnapshotConfigurationUpdate !== null && { + ApplicationSnapshotConfigurationUpdate: serializeAws_json1_1ApplicationSnapshotConfigurationUpdate( + input.ApplicationSnapshotConfigurationUpdate, + context + ), + }), + ...(input.EnvironmentPropertyUpdates !== undefined && + input.EnvironmentPropertyUpdates !== null && { + EnvironmentPropertyUpdates: serializeAws_json1_1EnvironmentPropertyUpdates( + input.EnvironmentPropertyUpdates, + context + ), + }), + ...(input.FlinkApplicationConfigurationUpdate !== undefined && + input.FlinkApplicationConfigurationUpdate !== null && { + FlinkApplicationConfigurationUpdate: serializeAws_json1_1FlinkApplicationConfigurationUpdate( + input.FlinkApplicationConfigurationUpdate, + context + ), + }), + ...(input.SqlApplicationConfigurationUpdate !== undefined && + input.SqlApplicationConfigurationUpdate !== null && { + SqlApplicationConfigurationUpdate: serializeAws_json1_1SqlApplicationConfigurationUpdate( + input.SqlApplicationConfigurationUpdate, + context + ), + }), + ...(input.VpcConfigurationUpdates !== undefined && + input.VpcConfigurationUpdates !== null && { + VpcConfigurationUpdates: serializeAws_json1_1VpcConfigurationUpdates(input.VpcConfigurationUpdates, context), + }), }; }; @@ -3317,8 +3310,9 @@ const serializeAws_json1_1ApplicationRestoreConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationRestoreType !== undefined && { ApplicationRestoreType: input.ApplicationRestoreType }), - ...(input.SnapshotName !== undefined && { SnapshotName: input.SnapshotName }), + ...(input.ApplicationRestoreType !== undefined && + input.ApplicationRestoreType !== null && { ApplicationRestoreType: input.ApplicationRestoreType }), + ...(input.SnapshotName !== undefined && input.SnapshotName !== null && { SnapshotName: input.SnapshotName }), }; }; @@ -3327,7 +3321,8 @@ const serializeAws_json1_1ApplicationSnapshotConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.SnapshotsEnabled !== undefined && { SnapshotsEnabled: input.SnapshotsEnabled }), + ...(input.SnapshotsEnabled !== undefined && + input.SnapshotsEnabled !== null && { SnapshotsEnabled: input.SnapshotsEnabled }), }; }; @@ -3336,18 +3331,21 @@ const serializeAws_json1_1ApplicationSnapshotConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.SnapshotsEnabledUpdate !== undefined && { SnapshotsEnabledUpdate: input.SnapshotsEnabledUpdate }), + ...(input.SnapshotsEnabledUpdate !== undefined && + input.SnapshotsEnabledUpdate !== null && { SnapshotsEnabledUpdate: input.SnapshotsEnabledUpdate }), }; }; const serializeAws_json1_1CheckpointConfiguration = (input: CheckpointConfiguration, context: __SerdeContext): any => { return { - ...(input.CheckpointInterval !== undefined && { CheckpointInterval: input.CheckpointInterval }), - ...(input.CheckpointingEnabled !== undefined && { CheckpointingEnabled: input.CheckpointingEnabled }), - ...(input.ConfigurationType !== undefined && { ConfigurationType: input.ConfigurationType }), - ...(input.MinPauseBetweenCheckpoints !== undefined && { - MinPauseBetweenCheckpoints: input.MinPauseBetweenCheckpoints, - }), + ...(input.CheckpointInterval !== undefined && + input.CheckpointInterval !== null && { CheckpointInterval: input.CheckpointInterval }), + ...(input.CheckpointingEnabled !== undefined && + input.CheckpointingEnabled !== null && { CheckpointingEnabled: input.CheckpointingEnabled }), + ...(input.ConfigurationType !== undefined && + input.ConfigurationType !== null && { ConfigurationType: input.ConfigurationType }), + ...(input.MinPauseBetweenCheckpoints !== undefined && + input.MinPauseBetweenCheckpoints !== null && { MinPauseBetweenCheckpoints: input.MinPauseBetweenCheckpoints }), }; }; @@ -3356,20 +3354,22 @@ const serializeAws_json1_1CheckpointConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.CheckpointIntervalUpdate !== undefined && { CheckpointIntervalUpdate: input.CheckpointIntervalUpdate }), - ...(input.CheckpointingEnabledUpdate !== undefined && { - CheckpointingEnabledUpdate: input.CheckpointingEnabledUpdate, - }), - ...(input.ConfigurationTypeUpdate !== undefined && { ConfigurationTypeUpdate: input.ConfigurationTypeUpdate }), - ...(input.MinPauseBetweenCheckpointsUpdate !== undefined && { - MinPauseBetweenCheckpointsUpdate: input.MinPauseBetweenCheckpointsUpdate, - }), + ...(input.CheckpointIntervalUpdate !== undefined && + input.CheckpointIntervalUpdate !== null && { CheckpointIntervalUpdate: input.CheckpointIntervalUpdate }), + ...(input.CheckpointingEnabledUpdate !== undefined && + input.CheckpointingEnabledUpdate !== null && { CheckpointingEnabledUpdate: input.CheckpointingEnabledUpdate }), + ...(input.ConfigurationTypeUpdate !== undefined && + input.ConfigurationTypeUpdate !== null && { ConfigurationTypeUpdate: input.ConfigurationTypeUpdate }), + ...(input.MinPauseBetweenCheckpointsUpdate !== undefined && + input.MinPauseBetweenCheckpointsUpdate !== null && { + MinPauseBetweenCheckpointsUpdate: input.MinPauseBetweenCheckpointsUpdate, + }), }; }; const serializeAws_json1_1CloudWatchLoggingOption = (input: CloudWatchLoggingOption, context: __SerdeContext): any => { return { - ...(input.LogStreamARN !== undefined && { LogStreamARN: input.LogStreamARN }), + ...(input.LogStreamARN !== undefined && input.LogStreamARN !== null && { LogStreamARN: input.LogStreamARN }), }; }; @@ -3377,7 +3377,14 @@ const serializeAws_json1_1CloudWatchLoggingOptions = ( input: CloudWatchLoggingOption[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CloudWatchLoggingOption(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CloudWatchLoggingOption(entry, context); + }); }; const serializeAws_json1_1CloudWatchLoggingOptionUpdate = ( @@ -3385,10 +3392,10 @@ const serializeAws_json1_1CloudWatchLoggingOptionUpdate = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchLoggingOptionId !== undefined && { - CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId, - }), - ...(input.LogStreamARNUpdate !== undefined && { LogStreamARNUpdate: input.LogStreamARNUpdate }), + ...(input.CloudWatchLoggingOptionId !== undefined && + input.CloudWatchLoggingOptionId !== null && { CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId }), + ...(input.LogStreamARNUpdate !== undefined && + input.LogStreamARNUpdate !== null && { LogStreamARNUpdate: input.LogStreamARNUpdate }), }; }; @@ -3396,28 +3403,40 @@ const serializeAws_json1_1CloudWatchLoggingOptionUpdates = ( input: CloudWatchLoggingOptionUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CloudWatchLoggingOptionUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CloudWatchLoggingOptionUpdate(entry, context); + }); }; const serializeAws_json1_1CodeContent = (input: CodeContent, context: __SerdeContext): any => { return { - ...(input.S3ContentLocation !== undefined && { - S3ContentLocation: serializeAws_json1_1S3ContentLocation(input.S3ContentLocation, context), - }), - ...(input.TextContent !== undefined && { TextContent: input.TextContent }), - ...(input.ZipFileContent !== undefined && { ZipFileContent: context.base64Encoder(input.ZipFileContent) }), + ...(input.S3ContentLocation !== undefined && + input.S3ContentLocation !== null && { + S3ContentLocation: serializeAws_json1_1S3ContentLocation(input.S3ContentLocation, context), + }), + ...(input.TextContent !== undefined && input.TextContent !== null && { TextContent: input.TextContent }), + ...(input.ZipFileContent !== undefined && + input.ZipFileContent !== null && { ZipFileContent: context.base64Encoder(input.ZipFileContent) }), }; }; const serializeAws_json1_1CodeContentUpdate = (input: CodeContentUpdate, context: __SerdeContext): any => { return { - ...(input.S3ContentLocationUpdate !== undefined && { - S3ContentLocationUpdate: serializeAws_json1_1S3ContentLocationUpdate(input.S3ContentLocationUpdate, context), - }), - ...(input.TextContentUpdate !== undefined && { TextContentUpdate: input.TextContentUpdate }), - ...(input.ZipFileContentUpdate !== undefined && { - ZipFileContentUpdate: context.base64Encoder(input.ZipFileContentUpdate), - }), + ...(input.S3ContentLocationUpdate !== undefined && + input.S3ContentLocationUpdate !== null && { + S3ContentLocationUpdate: serializeAws_json1_1S3ContentLocationUpdate(input.S3ContentLocationUpdate, context), + }), + ...(input.TextContentUpdate !== undefined && + input.TextContentUpdate !== null && { TextContentUpdate: input.TextContentUpdate }), + ...(input.ZipFileContentUpdate !== undefined && + input.ZipFileContentUpdate !== null && { + ZipFileContentUpdate: context.base64Encoder(input.ZipFileContentUpdate), + }), }; }; @@ -3426,11 +3445,13 @@ const serializeAws_json1_1CreateApplicationPresignedUrlRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.SessionExpirationDurationInSeconds !== undefined && { - SessionExpirationDurationInSeconds: input.SessionExpirationDurationInSeconds, - }), - ...(input.UrlType !== undefined && { UrlType: input.UrlType }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.SessionExpirationDurationInSeconds !== undefined && + input.SessionExpirationDurationInSeconds !== null && { + SessionExpirationDurationInSeconds: input.SessionExpirationDurationInSeconds, + }), + ...(input.UrlType !== undefined && input.UrlType !== null && { UrlType: input.UrlType }), }; }; @@ -3439,17 +3460,23 @@ const serializeAws_json1_1CreateApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationConfiguration !== undefined && { - ApplicationConfiguration: serializeAws_json1_1ApplicationConfiguration(input.ApplicationConfiguration, context), - }), - ...(input.ApplicationDescription !== undefined && { ApplicationDescription: input.ApplicationDescription }), - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.RuntimeEnvironment !== undefined && { RuntimeEnvironment: input.RuntimeEnvironment }), - ...(input.ServiceExecutionRole !== undefined && { ServiceExecutionRole: input.ServiceExecutionRole }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ApplicationConfiguration !== undefined && + input.ApplicationConfiguration !== null && { + ApplicationConfiguration: serializeAws_json1_1ApplicationConfiguration(input.ApplicationConfiguration, context), + }), + ...(input.ApplicationDescription !== undefined && + input.ApplicationDescription !== null && { ApplicationDescription: input.ApplicationDescription }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.RuntimeEnvironment !== undefined && + input.RuntimeEnvironment !== null && { RuntimeEnvironment: input.RuntimeEnvironment }), + ...(input.ServiceExecutionRole !== undefined && + input.ServiceExecutionRole !== null && { ServiceExecutionRole: input.ServiceExecutionRole }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -3458,15 +3485,18 @@ const serializeAws_json1_1CreateApplicationSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.SnapshotName !== undefined && { SnapshotName: input.SnapshotName }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.SnapshotName !== undefined && input.SnapshotName !== null && { SnapshotName: input.SnapshotName }), }; }; const serializeAws_json1_1CSVMappingParameters = (input: CSVMappingParameters, context: __SerdeContext): any => { return { - ...(input.RecordColumnDelimiter !== undefined && { RecordColumnDelimiter: input.RecordColumnDelimiter }), - ...(input.RecordRowDelimiter !== undefined && { RecordRowDelimiter: input.RecordRowDelimiter }), + ...(input.RecordColumnDelimiter !== undefined && + input.RecordColumnDelimiter !== null && { RecordColumnDelimiter: input.RecordColumnDelimiter }), + ...(input.RecordRowDelimiter !== undefined && + input.RecordRowDelimiter !== null && { RecordRowDelimiter: input.RecordRowDelimiter }), }; }; @@ -3475,13 +3505,12 @@ const serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CloudWatchLoggingOptionId !== undefined && { - CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId, - }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CloudWatchLoggingOptionId !== undefined && + input.CloudWatchLoggingOptionId !== null && { CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), }; }; @@ -3490,11 +3519,11 @@ const serializeAws_json1_1DeleteApplicationInputProcessingConfigurationRequest = context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.InputId !== undefined && { InputId: input.InputId }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.InputId !== undefined && input.InputId !== null && { InputId: input.InputId }), }; }; @@ -3503,11 +3532,11 @@ const serializeAws_json1_1DeleteApplicationOutputRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.OutputId !== undefined && { OutputId: input.OutputId }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.OutputId !== undefined && input.OutputId !== null && { OutputId: input.OutputId }), }; }; @@ -3516,11 +3545,11 @@ const serializeAws_json1_1DeleteApplicationReferenceDataSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.ReferenceId !== undefined && { ReferenceId: input.ReferenceId }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.ReferenceId !== undefined && input.ReferenceId !== null && { ReferenceId: input.ReferenceId }), }; }; @@ -3529,8 +3558,10 @@ const serializeAws_json1_1DeleteApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CreateTimestamp !== undefined && { CreateTimestamp: Math.round(input.CreateTimestamp.getTime() / 1000) }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CreateTimestamp !== undefined && + input.CreateTimestamp !== null && { CreateTimestamp: Math.round(input.CreateTimestamp.getTime() / 1000) }), }; }; @@ -3539,11 +3570,13 @@ const serializeAws_json1_1DeleteApplicationSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.SnapshotCreationTimestamp !== undefined && { - SnapshotCreationTimestamp: Math.round(input.SnapshotCreationTimestamp.getTime() / 1000), - }), - ...(input.SnapshotName !== undefined && { SnapshotName: input.SnapshotName }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.SnapshotCreationTimestamp !== undefined && + input.SnapshotCreationTimestamp !== null && { + SnapshotCreationTimestamp: Math.round(input.SnapshotCreationTimestamp.getTime() / 1000), + }), + ...(input.SnapshotName !== undefined && input.SnapshotName !== null && { SnapshotName: input.SnapshotName }), }; }; @@ -3552,11 +3585,12 @@ const serializeAws_json1_1DeleteApplicationVpcConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.VpcConfigurationId !== undefined && { VpcConfigurationId: input.VpcConfigurationId }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.VpcConfigurationId !== undefined && + input.VpcConfigurationId !== null && { VpcConfigurationId: input.VpcConfigurationId }), }; }; @@ -3565,8 +3599,10 @@ const serializeAws_json1_1DescribeApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.IncludeAdditionalDetails !== undefined && { IncludeAdditionalDetails: input.IncludeAdditionalDetails }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.IncludeAdditionalDetails !== undefined && + input.IncludeAdditionalDetails !== null && { IncludeAdditionalDetails: input.IncludeAdditionalDetails }), }; }; @@ -3575,14 +3611,16 @@ const serializeAws_json1_1DescribeApplicationSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.SnapshotName !== undefined && { SnapshotName: input.SnapshotName }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.SnapshotName !== undefined && input.SnapshotName !== null && { SnapshotName: input.SnapshotName }), }; }; const serializeAws_json1_1DestinationSchema = (input: DestinationSchema, context: __SerdeContext): any => { return { - ...(input.RecordFormatType !== undefined && { RecordFormatType: input.RecordFormatType }), + ...(input.RecordFormatType !== undefined && + input.RecordFormatType !== null && { RecordFormatType: input.RecordFormatType }), }; }; @@ -3591,31 +3629,36 @@ const serializeAws_json1_1DiscoverInputSchemaRequest = ( context: __SerdeContext ): any => { return { - ...(input.InputProcessingConfiguration !== undefined && { - InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ), - }), - ...(input.InputStartingPositionConfiguration !== undefined && { - InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( - input.InputStartingPositionConfiguration, - context - ), - }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.S3Configuration !== undefined && { - S3Configuration: serializeAws_json1_1S3Configuration(input.S3Configuration, context), - }), - ...(input.ServiceExecutionRole !== undefined && { ServiceExecutionRole: input.ServiceExecutionRole }), + ...(input.InputProcessingConfiguration !== undefined && + input.InputProcessingConfiguration !== null && { + InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( + input.InputProcessingConfiguration, + context + ), + }), + ...(input.InputStartingPositionConfiguration !== undefined && + input.InputStartingPositionConfiguration !== null && { + InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( + input.InputStartingPositionConfiguration, + context + ), + }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.S3Configuration !== undefined && + input.S3Configuration !== null && { + S3Configuration: serializeAws_json1_1S3Configuration(input.S3Configuration, context), + }), + ...(input.ServiceExecutionRole !== undefined && + input.ServiceExecutionRole !== null && { ServiceExecutionRole: input.ServiceExecutionRole }), }; }; const serializeAws_json1_1EnvironmentProperties = (input: EnvironmentProperties, context: __SerdeContext): any => { return { - ...(input.PropertyGroups !== undefined && { - PropertyGroups: serializeAws_json1_1PropertyGroups(input.PropertyGroups, context), - }), + ...(input.PropertyGroups !== undefined && + input.PropertyGroups !== null && { + PropertyGroups: serializeAws_json1_1PropertyGroups(input.PropertyGroups, context), + }), }; }; @@ -3624,9 +3667,10 @@ const serializeAws_json1_1EnvironmentPropertyUpdates = ( context: __SerdeContext ): any => { return { - ...(input.PropertyGroups !== undefined && { - PropertyGroups: serializeAws_json1_1PropertyGroups(input.PropertyGroups, context), - }), + ...(input.PropertyGroups !== undefined && + input.PropertyGroups !== null && { + PropertyGroups: serializeAws_json1_1PropertyGroups(input.PropertyGroups, context), + }), }; }; @@ -3635,15 +3679,18 @@ const serializeAws_json1_1FlinkApplicationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CheckpointConfiguration !== undefined && { - CheckpointConfiguration: serializeAws_json1_1CheckpointConfiguration(input.CheckpointConfiguration, context), - }), - ...(input.MonitoringConfiguration !== undefined && { - MonitoringConfiguration: serializeAws_json1_1MonitoringConfiguration(input.MonitoringConfiguration, context), - }), - ...(input.ParallelismConfiguration !== undefined && { - ParallelismConfiguration: serializeAws_json1_1ParallelismConfiguration(input.ParallelismConfiguration, context), - }), + ...(input.CheckpointConfiguration !== undefined && + input.CheckpointConfiguration !== null && { + CheckpointConfiguration: serializeAws_json1_1CheckpointConfiguration(input.CheckpointConfiguration, context), + }), + ...(input.MonitoringConfiguration !== undefined && + input.MonitoringConfiguration !== null && { + MonitoringConfiguration: serializeAws_json1_1MonitoringConfiguration(input.MonitoringConfiguration, context), + }), + ...(input.ParallelismConfiguration !== undefined && + input.ParallelismConfiguration !== null && { + ParallelismConfiguration: serializeAws_json1_1ParallelismConfiguration(input.ParallelismConfiguration, context), + }), }; }; @@ -3652,60 +3699,67 @@ const serializeAws_json1_1FlinkApplicationConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.CheckpointConfigurationUpdate !== undefined && { - CheckpointConfigurationUpdate: serializeAws_json1_1CheckpointConfigurationUpdate( - input.CheckpointConfigurationUpdate, - context - ), - }), - ...(input.MonitoringConfigurationUpdate !== undefined && { - MonitoringConfigurationUpdate: serializeAws_json1_1MonitoringConfigurationUpdate( - input.MonitoringConfigurationUpdate, - context - ), - }), - ...(input.ParallelismConfigurationUpdate !== undefined && { - ParallelismConfigurationUpdate: serializeAws_json1_1ParallelismConfigurationUpdate( - input.ParallelismConfigurationUpdate, - context - ), - }), + ...(input.CheckpointConfigurationUpdate !== undefined && + input.CheckpointConfigurationUpdate !== null && { + CheckpointConfigurationUpdate: serializeAws_json1_1CheckpointConfigurationUpdate( + input.CheckpointConfigurationUpdate, + context + ), + }), + ...(input.MonitoringConfigurationUpdate !== undefined && + input.MonitoringConfigurationUpdate !== null && { + MonitoringConfigurationUpdate: serializeAws_json1_1MonitoringConfigurationUpdate( + input.MonitoringConfigurationUpdate, + context + ), + }), + ...(input.ParallelismConfigurationUpdate !== undefined && + input.ParallelismConfigurationUpdate !== null && { + ParallelismConfigurationUpdate: serializeAws_json1_1ParallelismConfigurationUpdate( + input.ParallelismConfigurationUpdate, + context + ), + }), }; }; const serializeAws_json1_1FlinkRunConfiguration = (input: FlinkRunConfiguration, context: __SerdeContext): any => { return { - ...(input.AllowNonRestoredState !== undefined && { AllowNonRestoredState: input.AllowNonRestoredState }), + ...(input.AllowNonRestoredState !== undefined && + input.AllowNonRestoredState !== null && { AllowNonRestoredState: input.AllowNonRestoredState }), }; }; const serializeAws_json1_1Input = (input: Input, context: __SerdeContext): any => { return { - ...(input.InputParallelism !== undefined && { - InputParallelism: serializeAws_json1_1InputParallelism(input.InputParallelism, context), - }), - ...(input.InputProcessingConfiguration !== undefined && { - InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ), - }), - ...(input.InputSchema !== undefined && { - InputSchema: serializeAws_json1_1SourceSchema(input.InputSchema, context), - }), - ...(input.KinesisFirehoseInput !== undefined && { - KinesisFirehoseInput: serializeAws_json1_1KinesisFirehoseInput(input.KinesisFirehoseInput, context), - }), - ...(input.KinesisStreamsInput !== undefined && { - KinesisStreamsInput: serializeAws_json1_1KinesisStreamsInput(input.KinesisStreamsInput, context), - }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), + ...(input.InputParallelism !== undefined && + input.InputParallelism !== null && { + InputParallelism: serializeAws_json1_1InputParallelism(input.InputParallelism, context), + }), + ...(input.InputProcessingConfiguration !== undefined && + input.InputProcessingConfiguration !== null && { + InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( + input.InputProcessingConfiguration, + context + ), + }), + ...(input.InputSchema !== undefined && + input.InputSchema !== null && { InputSchema: serializeAws_json1_1SourceSchema(input.InputSchema, context) }), + ...(input.KinesisFirehoseInput !== undefined && + input.KinesisFirehoseInput !== null && { + KinesisFirehoseInput: serializeAws_json1_1KinesisFirehoseInput(input.KinesisFirehoseInput, context), + }), + ...(input.KinesisStreamsInput !== undefined && + input.KinesisStreamsInput !== null && { + KinesisStreamsInput: serializeAws_json1_1KinesisStreamsInput(input.KinesisStreamsInput, context), + }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), }; }; const serializeAws_json1_1InputLambdaProcessor = (input: InputLambdaProcessor, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; @@ -3714,19 +3768,20 @@ const serializeAws_json1_1InputLambdaProcessorUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), }; }; const serializeAws_json1_1InputParallelism = (input: InputParallelism, context: __SerdeContext): any => { return { - ...(input.Count !== undefined && { Count: input.Count }), + ...(input.Count !== undefined && input.Count !== null && { Count: input.Count }), }; }; const serializeAws_json1_1InputParallelismUpdate = (input: InputParallelismUpdate, context: __SerdeContext): any => { return { - ...(input.CountUpdate !== undefined && { CountUpdate: input.CountUpdate }), + ...(input.CountUpdate !== undefined && input.CountUpdate !== null && { CountUpdate: input.CountUpdate }), }; }; @@ -3735,9 +3790,10 @@ const serializeAws_json1_1InputProcessingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.InputLambdaProcessor !== undefined && { - InputLambdaProcessor: serializeAws_json1_1InputLambdaProcessor(input.InputLambdaProcessor, context), - }), + ...(input.InputLambdaProcessor !== undefined && + input.InputLambdaProcessor !== null && { + InputLambdaProcessor: serializeAws_json1_1InputLambdaProcessor(input.InputLambdaProcessor, context), + }), }; }; @@ -3746,28 +3802,39 @@ const serializeAws_json1_1InputProcessingConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.InputLambdaProcessorUpdate !== undefined && { - InputLambdaProcessorUpdate: serializeAws_json1_1InputLambdaProcessorUpdate( - input.InputLambdaProcessorUpdate, - context - ), - }), + ...(input.InputLambdaProcessorUpdate !== undefined && + input.InputLambdaProcessorUpdate !== null && { + InputLambdaProcessorUpdate: serializeAws_json1_1InputLambdaProcessorUpdate( + input.InputLambdaProcessorUpdate, + context + ), + }), }; }; const serializeAws_json1_1Inputs = (input: Input[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Input(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Input(entry, context); + }); }; const serializeAws_json1_1InputSchemaUpdate = (input: InputSchemaUpdate, context: __SerdeContext): any => { return { - ...(input.RecordColumnUpdates !== undefined && { - RecordColumnUpdates: serializeAws_json1_1RecordColumns(input.RecordColumnUpdates, context), - }), - ...(input.RecordEncodingUpdate !== undefined && { RecordEncodingUpdate: input.RecordEncodingUpdate }), - ...(input.RecordFormatUpdate !== undefined && { - RecordFormatUpdate: serializeAws_json1_1RecordFormat(input.RecordFormatUpdate, context), - }), + ...(input.RecordColumnUpdates !== undefined && + input.RecordColumnUpdates !== null && { + RecordColumnUpdates: serializeAws_json1_1RecordColumns(input.RecordColumnUpdates, context), + }), + ...(input.RecordEncodingUpdate !== undefined && + input.RecordEncodingUpdate !== null && { RecordEncodingUpdate: input.RecordEncodingUpdate }), + ...(input.RecordFormatUpdate !== undefined && + input.RecordFormatUpdate !== null && { + RecordFormatUpdate: serializeAws_json1_1RecordFormat(input.RecordFormatUpdate, context), + }), }; }; @@ -3776,54 +3843,68 @@ const serializeAws_json1_1InputStartingPositionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.InputStartingPosition !== undefined && { InputStartingPosition: input.InputStartingPosition }), + ...(input.InputStartingPosition !== undefined && + input.InputStartingPosition !== null && { InputStartingPosition: input.InputStartingPosition }), }; }; const serializeAws_json1_1InputUpdate = (input: InputUpdate, context: __SerdeContext): any => { return { - ...(input.InputId !== undefined && { InputId: input.InputId }), - ...(input.InputParallelismUpdate !== undefined && { - InputParallelismUpdate: serializeAws_json1_1InputParallelismUpdate(input.InputParallelismUpdate, context), - }), - ...(input.InputProcessingConfigurationUpdate !== undefined && { - InputProcessingConfigurationUpdate: serializeAws_json1_1InputProcessingConfigurationUpdate( - input.InputProcessingConfigurationUpdate, - context - ), - }), - ...(input.InputSchemaUpdate !== undefined && { - InputSchemaUpdate: serializeAws_json1_1InputSchemaUpdate(input.InputSchemaUpdate, context), - }), - ...(input.KinesisFirehoseInputUpdate !== undefined && { - KinesisFirehoseInputUpdate: serializeAws_json1_1KinesisFirehoseInputUpdate( - input.KinesisFirehoseInputUpdate, - context - ), - }), - ...(input.KinesisStreamsInputUpdate !== undefined && { - KinesisStreamsInputUpdate: serializeAws_json1_1KinesisStreamsInputUpdate( - input.KinesisStreamsInputUpdate, - context - ), - }), - ...(input.NamePrefixUpdate !== undefined && { NamePrefixUpdate: input.NamePrefixUpdate }), + ...(input.InputId !== undefined && input.InputId !== null && { InputId: input.InputId }), + ...(input.InputParallelismUpdate !== undefined && + input.InputParallelismUpdate !== null && { + InputParallelismUpdate: serializeAws_json1_1InputParallelismUpdate(input.InputParallelismUpdate, context), + }), + ...(input.InputProcessingConfigurationUpdate !== undefined && + input.InputProcessingConfigurationUpdate !== null && { + InputProcessingConfigurationUpdate: serializeAws_json1_1InputProcessingConfigurationUpdate( + input.InputProcessingConfigurationUpdate, + context + ), + }), + ...(input.InputSchemaUpdate !== undefined && + input.InputSchemaUpdate !== null && { + InputSchemaUpdate: serializeAws_json1_1InputSchemaUpdate(input.InputSchemaUpdate, context), + }), + ...(input.KinesisFirehoseInputUpdate !== undefined && + input.KinesisFirehoseInputUpdate !== null && { + KinesisFirehoseInputUpdate: serializeAws_json1_1KinesisFirehoseInputUpdate( + input.KinesisFirehoseInputUpdate, + context + ), + }), + ...(input.KinesisStreamsInputUpdate !== undefined && + input.KinesisStreamsInputUpdate !== null && { + KinesisStreamsInputUpdate: serializeAws_json1_1KinesisStreamsInputUpdate( + input.KinesisStreamsInputUpdate, + context + ), + }), + ...(input.NamePrefixUpdate !== undefined && + input.NamePrefixUpdate !== null && { NamePrefixUpdate: input.NamePrefixUpdate }), }; }; const serializeAws_json1_1InputUpdates = (input: InputUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InputUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InputUpdate(entry, context); + }); }; const serializeAws_json1_1JSONMappingParameters = (input: JSONMappingParameters, context: __SerdeContext): any => { return { - ...(input.RecordRowPath !== undefined && { RecordRowPath: input.RecordRowPath }), + ...(input.RecordRowPath !== undefined && input.RecordRowPath !== null && { RecordRowPath: input.RecordRowPath }), }; }; const serializeAws_json1_1KinesisFirehoseInput = (input: KinesisFirehoseInput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; @@ -3832,13 +3913,14 @@ const serializeAws_json1_1KinesisFirehoseInputUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), }; }; const serializeAws_json1_1KinesisFirehoseOutput = (input: KinesisFirehoseOutput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; @@ -3847,13 +3929,14 @@ const serializeAws_json1_1KinesisFirehoseOutputUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), }; }; const serializeAws_json1_1KinesisStreamsInput = (input: KinesisStreamsInput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; @@ -3862,13 +3945,14 @@ const serializeAws_json1_1KinesisStreamsInputUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), }; }; const serializeAws_json1_1KinesisStreamsOutput = (input: KinesisStreamsOutput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; @@ -3877,19 +3961,21 @@ const serializeAws_json1_1KinesisStreamsOutputUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), }; }; const serializeAws_json1_1LambdaOutput = (input: LambdaOutput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1LambdaOutputUpdate = (input: LambdaOutputUpdate, context: __SerdeContext): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), }; }; @@ -3898,16 +3984,17 @@ const serializeAws_json1_1ListApplicationSnapshotsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListApplicationsRequest = (input: ListApplicationsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3916,26 +4003,29 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1MappingParameters = (input: MappingParameters, context: __SerdeContext): any => { return { - ...(input.CSVMappingParameters !== undefined && { - CSVMappingParameters: serializeAws_json1_1CSVMappingParameters(input.CSVMappingParameters, context), - }), - ...(input.JSONMappingParameters !== undefined && { - JSONMappingParameters: serializeAws_json1_1JSONMappingParameters(input.JSONMappingParameters, context), - }), + ...(input.CSVMappingParameters !== undefined && + input.CSVMappingParameters !== null && { + CSVMappingParameters: serializeAws_json1_1CSVMappingParameters(input.CSVMappingParameters, context), + }), + ...(input.JSONMappingParameters !== undefined && + input.JSONMappingParameters !== null && { + JSONMappingParameters: serializeAws_json1_1JSONMappingParameters(input.JSONMappingParameters, context), + }), }; }; const serializeAws_json1_1MonitoringConfiguration = (input: MonitoringConfiguration, context: __SerdeContext): any => { return { - ...(input.ConfigurationType !== undefined && { ConfigurationType: input.ConfigurationType }), - ...(input.LogLevel !== undefined && { LogLevel: input.LogLevel }), - ...(input.MetricsLevel !== undefined && { MetricsLevel: input.MetricsLevel }), + ...(input.ConfigurationType !== undefined && + input.ConfigurationType !== null && { ConfigurationType: input.ConfigurationType }), + ...(input.LogLevel !== undefined && input.LogLevel !== null && { LogLevel: input.LogLevel }), + ...(input.MetricsLevel !== undefined && input.MetricsLevel !== null && { MetricsLevel: input.MetricsLevel }), }; }; @@ -3944,61 +4034,84 @@ const serializeAws_json1_1MonitoringConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationTypeUpdate !== undefined && { ConfigurationTypeUpdate: input.ConfigurationTypeUpdate }), - ...(input.LogLevelUpdate !== undefined && { LogLevelUpdate: input.LogLevelUpdate }), - ...(input.MetricsLevelUpdate !== undefined && { MetricsLevelUpdate: input.MetricsLevelUpdate }), + ...(input.ConfigurationTypeUpdate !== undefined && + input.ConfigurationTypeUpdate !== null && { ConfigurationTypeUpdate: input.ConfigurationTypeUpdate }), + ...(input.LogLevelUpdate !== undefined && + input.LogLevelUpdate !== null && { LogLevelUpdate: input.LogLevelUpdate }), + ...(input.MetricsLevelUpdate !== undefined && + input.MetricsLevelUpdate !== null && { MetricsLevelUpdate: input.MetricsLevelUpdate }), }; }; const serializeAws_json1_1Output = (input: Output, context: __SerdeContext): any => { return { - ...(input.DestinationSchema !== undefined && { - DestinationSchema: serializeAws_json1_1DestinationSchema(input.DestinationSchema, context), - }), - ...(input.KinesisFirehoseOutput !== undefined && { - KinesisFirehoseOutput: serializeAws_json1_1KinesisFirehoseOutput(input.KinesisFirehoseOutput, context), - }), - ...(input.KinesisStreamsOutput !== undefined && { - KinesisStreamsOutput: serializeAws_json1_1KinesisStreamsOutput(input.KinesisStreamsOutput, context), - }), - ...(input.LambdaOutput !== undefined && { - LambdaOutput: serializeAws_json1_1LambdaOutput(input.LambdaOutput, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.DestinationSchema !== undefined && + input.DestinationSchema !== null && { + DestinationSchema: serializeAws_json1_1DestinationSchema(input.DestinationSchema, context), + }), + ...(input.KinesisFirehoseOutput !== undefined && + input.KinesisFirehoseOutput !== null && { + KinesisFirehoseOutput: serializeAws_json1_1KinesisFirehoseOutput(input.KinesisFirehoseOutput, context), + }), + ...(input.KinesisStreamsOutput !== undefined && + input.KinesisStreamsOutput !== null && { + KinesisStreamsOutput: serializeAws_json1_1KinesisStreamsOutput(input.KinesisStreamsOutput, context), + }), + ...(input.LambdaOutput !== undefined && + input.LambdaOutput !== null && { LambdaOutput: serializeAws_json1_1LambdaOutput(input.LambdaOutput, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1Outputs = (input: Output[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Output(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Output(entry, context); + }); }; const serializeAws_json1_1OutputUpdate = (input: OutputUpdate, context: __SerdeContext): any => { return { - ...(input.DestinationSchemaUpdate !== undefined && { - DestinationSchemaUpdate: serializeAws_json1_1DestinationSchema(input.DestinationSchemaUpdate, context), - }), - ...(input.KinesisFirehoseOutputUpdate !== undefined && { - KinesisFirehoseOutputUpdate: serializeAws_json1_1KinesisFirehoseOutputUpdate( - input.KinesisFirehoseOutputUpdate, - context - ), - }), - ...(input.KinesisStreamsOutputUpdate !== undefined && { - KinesisStreamsOutputUpdate: serializeAws_json1_1KinesisStreamsOutputUpdate( - input.KinesisStreamsOutputUpdate, - context - ), - }), - ...(input.LambdaOutputUpdate !== undefined && { - LambdaOutputUpdate: serializeAws_json1_1LambdaOutputUpdate(input.LambdaOutputUpdate, context), - }), - ...(input.NameUpdate !== undefined && { NameUpdate: input.NameUpdate }), - ...(input.OutputId !== undefined && { OutputId: input.OutputId }), + ...(input.DestinationSchemaUpdate !== undefined && + input.DestinationSchemaUpdate !== null && { + DestinationSchemaUpdate: serializeAws_json1_1DestinationSchema(input.DestinationSchemaUpdate, context), + }), + ...(input.KinesisFirehoseOutputUpdate !== undefined && + input.KinesisFirehoseOutputUpdate !== null && { + KinesisFirehoseOutputUpdate: serializeAws_json1_1KinesisFirehoseOutputUpdate( + input.KinesisFirehoseOutputUpdate, + context + ), + }), + ...(input.KinesisStreamsOutputUpdate !== undefined && + input.KinesisStreamsOutputUpdate !== null && { + KinesisStreamsOutputUpdate: serializeAws_json1_1KinesisStreamsOutputUpdate( + input.KinesisStreamsOutputUpdate, + context + ), + }), + ...(input.LambdaOutputUpdate !== undefined && + input.LambdaOutputUpdate !== null && { + LambdaOutputUpdate: serializeAws_json1_1LambdaOutputUpdate(input.LambdaOutputUpdate, context), + }), + ...(input.NameUpdate !== undefined && input.NameUpdate !== null && { NameUpdate: input.NameUpdate }), + ...(input.OutputId !== undefined && input.OutputId !== null && { OutputId: input.OutputId }), }; }; const serializeAws_json1_1OutputUpdates = (input: OutputUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OutputUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OutputUpdate(entry, context); + }); }; const serializeAws_json1_1ParallelismConfiguration = ( @@ -4006,10 +4119,13 @@ const serializeAws_json1_1ParallelismConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AutoScalingEnabled !== undefined && { AutoScalingEnabled: input.AutoScalingEnabled }), - ...(input.ConfigurationType !== undefined && { ConfigurationType: input.ConfigurationType }), - ...(input.Parallelism !== undefined && { Parallelism: input.Parallelism }), - ...(input.ParallelismPerKPU !== undefined && { ParallelismPerKPU: input.ParallelismPerKPU }), + ...(input.AutoScalingEnabled !== undefined && + input.AutoScalingEnabled !== null && { AutoScalingEnabled: input.AutoScalingEnabled }), + ...(input.ConfigurationType !== undefined && + input.ConfigurationType !== null && { ConfigurationType: input.ConfigurationType }), + ...(input.Parallelism !== undefined && input.Parallelism !== null && { Parallelism: input.Parallelism }), + ...(input.ParallelismPerKPU !== undefined && + input.ParallelismPerKPU !== null && { ParallelismPerKPU: input.ParallelismPerKPU }), }; }; @@ -4018,71 +4134,102 @@ const serializeAws_json1_1ParallelismConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.AutoScalingEnabledUpdate !== undefined && { AutoScalingEnabledUpdate: input.AutoScalingEnabledUpdate }), - ...(input.ConfigurationTypeUpdate !== undefined && { ConfigurationTypeUpdate: input.ConfigurationTypeUpdate }), - ...(input.ParallelismPerKPUUpdate !== undefined && { ParallelismPerKPUUpdate: input.ParallelismPerKPUUpdate }), - ...(input.ParallelismUpdate !== undefined && { ParallelismUpdate: input.ParallelismUpdate }), + ...(input.AutoScalingEnabledUpdate !== undefined && + input.AutoScalingEnabledUpdate !== null && { AutoScalingEnabledUpdate: input.AutoScalingEnabledUpdate }), + ...(input.ConfigurationTypeUpdate !== undefined && + input.ConfigurationTypeUpdate !== null && { ConfigurationTypeUpdate: input.ConfigurationTypeUpdate }), + ...(input.ParallelismPerKPUUpdate !== undefined && + input.ParallelismPerKPUUpdate !== null && { ParallelismPerKPUUpdate: input.ParallelismPerKPUUpdate }), + ...(input.ParallelismUpdate !== undefined && + input.ParallelismUpdate !== null && { ParallelismUpdate: input.ParallelismUpdate }), }; }; const serializeAws_json1_1PropertyGroup = (input: PropertyGroup, context: __SerdeContext): any => { return { - ...(input.PropertyGroupId !== undefined && { PropertyGroupId: input.PropertyGroupId }), - ...(input.PropertyMap !== undefined && { - PropertyMap: serializeAws_json1_1PropertyMap(input.PropertyMap, context), - }), + ...(input.PropertyGroupId !== undefined && + input.PropertyGroupId !== null && { PropertyGroupId: input.PropertyGroupId }), + ...(input.PropertyMap !== undefined && + input.PropertyMap !== null && { PropertyMap: serializeAws_json1_1PropertyMap(input.PropertyMap, context) }), }; }; const serializeAws_json1_1PropertyGroups = (input: PropertyGroup[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PropertyGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PropertyGroup(entry, context); + }); }; const serializeAws_json1_1PropertyMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1RecordColumn = (input: RecordColumn, context: __SerdeContext): any => { return { - ...(input.Mapping !== undefined && { Mapping: input.Mapping }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SqlType !== undefined && { SqlType: input.SqlType }), + ...(input.Mapping !== undefined && input.Mapping !== null && { Mapping: input.Mapping }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SqlType !== undefined && input.SqlType !== null && { SqlType: input.SqlType }), }; }; const serializeAws_json1_1RecordColumns = (input: RecordColumn[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RecordColumn(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RecordColumn(entry, context); + }); }; const serializeAws_json1_1RecordFormat = (input: RecordFormat, context: __SerdeContext): any => { return { - ...(input.MappingParameters !== undefined && { - MappingParameters: serializeAws_json1_1MappingParameters(input.MappingParameters, context), - }), - ...(input.RecordFormatType !== undefined && { RecordFormatType: input.RecordFormatType }), + ...(input.MappingParameters !== undefined && + input.MappingParameters !== null && { + MappingParameters: serializeAws_json1_1MappingParameters(input.MappingParameters, context), + }), + ...(input.RecordFormatType !== undefined && + input.RecordFormatType !== null && { RecordFormatType: input.RecordFormatType }), }; }; const serializeAws_json1_1ReferenceDataSource = (input: ReferenceDataSource, context: __SerdeContext): any => { return { - ...(input.ReferenceSchema !== undefined && { - ReferenceSchema: serializeAws_json1_1SourceSchema(input.ReferenceSchema, context), - }), - ...(input.S3ReferenceDataSource !== undefined && { - S3ReferenceDataSource: serializeAws_json1_1S3ReferenceDataSource(input.S3ReferenceDataSource, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ReferenceSchema !== undefined && + input.ReferenceSchema !== null && { + ReferenceSchema: serializeAws_json1_1SourceSchema(input.ReferenceSchema, context), + }), + ...(input.S3ReferenceDataSource !== undefined && + input.S3ReferenceDataSource !== null && { + S3ReferenceDataSource: serializeAws_json1_1S3ReferenceDataSource(input.S3ReferenceDataSource, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1ReferenceDataSources = (input: ReferenceDataSource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ReferenceDataSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ReferenceDataSource(entry, context); + }); }; const serializeAws_json1_1ReferenceDataSourceUpdate = ( @@ -4090,17 +4237,20 @@ const serializeAws_json1_1ReferenceDataSourceUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ReferenceId !== undefined && { ReferenceId: input.ReferenceId }), - ...(input.ReferenceSchemaUpdate !== undefined && { - ReferenceSchemaUpdate: serializeAws_json1_1SourceSchema(input.ReferenceSchemaUpdate, context), - }), - ...(input.S3ReferenceDataSourceUpdate !== undefined && { - S3ReferenceDataSourceUpdate: serializeAws_json1_1S3ReferenceDataSourceUpdate( - input.S3ReferenceDataSourceUpdate, - context - ), - }), - ...(input.TableNameUpdate !== undefined && { TableNameUpdate: input.TableNameUpdate }), + ...(input.ReferenceId !== undefined && input.ReferenceId !== null && { ReferenceId: input.ReferenceId }), + ...(input.ReferenceSchemaUpdate !== undefined && + input.ReferenceSchemaUpdate !== null && { + ReferenceSchemaUpdate: serializeAws_json1_1SourceSchema(input.ReferenceSchemaUpdate, context), + }), + ...(input.S3ReferenceDataSourceUpdate !== undefined && + input.S3ReferenceDataSourceUpdate !== null && { + S3ReferenceDataSourceUpdate: serializeAws_json1_1S3ReferenceDataSourceUpdate( + input.S3ReferenceDataSourceUpdate, + context + ), + }), + ...(input.TableNameUpdate !== undefined && + input.TableNameUpdate !== null && { TableNameUpdate: input.TableNameUpdate }), }; }; @@ -4108,67 +4258,81 @@ const serializeAws_json1_1ReferenceDataSourceUpdates = ( input: ReferenceDataSourceUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ReferenceDataSourceUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ReferenceDataSourceUpdate(entry, context); + }); }; const serializeAws_json1_1RunConfiguration = (input: RunConfiguration, context: __SerdeContext): any => { return { - ...(input.ApplicationRestoreConfiguration !== undefined && { - ApplicationRestoreConfiguration: serializeAws_json1_1ApplicationRestoreConfiguration( - input.ApplicationRestoreConfiguration, - context - ), - }), - ...(input.FlinkRunConfiguration !== undefined && { - FlinkRunConfiguration: serializeAws_json1_1FlinkRunConfiguration(input.FlinkRunConfiguration, context), - }), - ...(input.SqlRunConfigurations !== undefined && { - SqlRunConfigurations: serializeAws_json1_1SqlRunConfigurations(input.SqlRunConfigurations, context), - }), + ...(input.ApplicationRestoreConfiguration !== undefined && + input.ApplicationRestoreConfiguration !== null && { + ApplicationRestoreConfiguration: serializeAws_json1_1ApplicationRestoreConfiguration( + input.ApplicationRestoreConfiguration, + context + ), + }), + ...(input.FlinkRunConfiguration !== undefined && + input.FlinkRunConfiguration !== null && { + FlinkRunConfiguration: serializeAws_json1_1FlinkRunConfiguration(input.FlinkRunConfiguration, context), + }), + ...(input.SqlRunConfigurations !== undefined && + input.SqlRunConfigurations !== null && { + SqlRunConfigurations: serializeAws_json1_1SqlRunConfigurations(input.SqlRunConfigurations, context), + }), }; }; const serializeAws_json1_1RunConfigurationUpdate = (input: RunConfigurationUpdate, context: __SerdeContext): any => { return { - ...(input.ApplicationRestoreConfiguration !== undefined && { - ApplicationRestoreConfiguration: serializeAws_json1_1ApplicationRestoreConfiguration( - input.ApplicationRestoreConfiguration, - context - ), - }), - ...(input.FlinkRunConfiguration !== undefined && { - FlinkRunConfiguration: serializeAws_json1_1FlinkRunConfiguration(input.FlinkRunConfiguration, context), - }), + ...(input.ApplicationRestoreConfiguration !== undefined && + input.ApplicationRestoreConfiguration !== null && { + ApplicationRestoreConfiguration: serializeAws_json1_1ApplicationRestoreConfiguration( + input.ApplicationRestoreConfiguration, + context + ), + }), + ...(input.FlinkRunConfiguration !== undefined && + input.FlinkRunConfiguration !== null && { + FlinkRunConfiguration: serializeAws_json1_1FlinkRunConfiguration(input.FlinkRunConfiguration, context), + }), }; }; const serializeAws_json1_1S3Configuration = (input: S3Configuration, context: __SerdeContext): any => { return { - ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), - ...(input.FileKey !== undefined && { FileKey: input.FileKey }), + ...(input.BucketARN !== undefined && input.BucketARN !== null && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && input.FileKey !== null && { FileKey: input.FileKey }), }; }; const serializeAws_json1_1S3ContentLocation = (input: S3ContentLocation, context: __SerdeContext): any => { return { - ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), - ...(input.FileKey !== undefined && { FileKey: input.FileKey }), - ...(input.ObjectVersion !== undefined && { ObjectVersion: input.ObjectVersion }), + ...(input.BucketARN !== undefined && input.BucketARN !== null && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && input.FileKey !== null && { FileKey: input.FileKey }), + ...(input.ObjectVersion !== undefined && input.ObjectVersion !== null && { ObjectVersion: input.ObjectVersion }), }; }; const serializeAws_json1_1S3ContentLocationUpdate = (input: S3ContentLocationUpdate, context: __SerdeContext): any => { return { - ...(input.BucketARNUpdate !== undefined && { BucketARNUpdate: input.BucketARNUpdate }), - ...(input.FileKeyUpdate !== undefined && { FileKeyUpdate: input.FileKeyUpdate }), - ...(input.ObjectVersionUpdate !== undefined && { ObjectVersionUpdate: input.ObjectVersionUpdate }), + ...(input.BucketARNUpdate !== undefined && + input.BucketARNUpdate !== null && { BucketARNUpdate: input.BucketARNUpdate }), + ...(input.FileKeyUpdate !== undefined && input.FileKeyUpdate !== null && { FileKeyUpdate: input.FileKeyUpdate }), + ...(input.ObjectVersionUpdate !== undefined && + input.ObjectVersionUpdate !== null && { ObjectVersionUpdate: input.ObjectVersionUpdate }), }; }; const serializeAws_json1_1S3ReferenceDataSource = (input: S3ReferenceDataSource, context: __SerdeContext): any => { return { - ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), - ...(input.FileKey !== undefined && { FileKey: input.FileKey }), + ...(input.BucketARN !== undefined && input.BucketARN !== null && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && input.FileKey !== null && { FileKey: input.FileKey }), }; }; @@ -4177,24 +4341,33 @@ const serializeAws_json1_1S3ReferenceDataSourceUpdate = ( context: __SerdeContext ): any => { return { - ...(input.BucketARNUpdate !== undefined && { BucketARNUpdate: input.BucketARNUpdate }), - ...(input.FileKeyUpdate !== undefined && { FileKeyUpdate: input.FileKeyUpdate }), + ...(input.BucketARNUpdate !== undefined && + input.BucketARNUpdate !== null && { BucketARNUpdate: input.BucketARNUpdate }), + ...(input.FileKeyUpdate !== undefined && input.FileKeyUpdate !== null && { FileKeyUpdate: input.FileKeyUpdate }), }; }; const serializeAws_json1_1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SourceSchema = (input: SourceSchema, context: __SerdeContext): any => { return { - ...(input.RecordColumns !== undefined && { - RecordColumns: serializeAws_json1_1RecordColumns(input.RecordColumns, context), - }), - ...(input.RecordEncoding !== undefined && { RecordEncoding: input.RecordEncoding }), - ...(input.RecordFormat !== undefined && { - RecordFormat: serializeAws_json1_1RecordFormat(input.RecordFormat, context), - }), + ...(input.RecordColumns !== undefined && + input.RecordColumns !== null && { + RecordColumns: serializeAws_json1_1RecordColumns(input.RecordColumns, context), + }), + ...(input.RecordEncoding !== undefined && + input.RecordEncoding !== null && { RecordEncoding: input.RecordEncoding }), + ...(input.RecordFormat !== undefined && + input.RecordFormat !== null && { RecordFormat: serializeAws_json1_1RecordFormat(input.RecordFormat, context) }), }; }; @@ -4203,11 +4376,14 @@ const serializeAws_json1_1SqlApplicationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Inputs !== undefined && { Inputs: serializeAws_json1_1Inputs(input.Inputs, context) }), - ...(input.Outputs !== undefined && { Outputs: serializeAws_json1_1Outputs(input.Outputs, context) }), - ...(input.ReferenceDataSources !== undefined && { - ReferenceDataSources: serializeAws_json1_1ReferenceDataSources(input.ReferenceDataSources, context), - }), + ...(input.Inputs !== undefined && + input.Inputs !== null && { Inputs: serializeAws_json1_1Inputs(input.Inputs, context) }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { Outputs: serializeAws_json1_1Outputs(input.Outputs, context) }), + ...(input.ReferenceDataSources !== undefined && + input.ReferenceDataSources !== null && { + ReferenceDataSources: serializeAws_json1_1ReferenceDataSources(input.ReferenceDataSources, context), + }), }; }; @@ -4216,83 +4392,117 @@ const serializeAws_json1_1SqlApplicationConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.InputUpdates !== undefined && { - InputUpdates: serializeAws_json1_1InputUpdates(input.InputUpdates, context), - }), - ...(input.OutputUpdates !== undefined && { - OutputUpdates: serializeAws_json1_1OutputUpdates(input.OutputUpdates, context), - }), - ...(input.ReferenceDataSourceUpdates !== undefined && { - ReferenceDataSourceUpdates: serializeAws_json1_1ReferenceDataSourceUpdates( - input.ReferenceDataSourceUpdates, - context - ), - }), + ...(input.InputUpdates !== undefined && + input.InputUpdates !== null && { InputUpdates: serializeAws_json1_1InputUpdates(input.InputUpdates, context) }), + ...(input.OutputUpdates !== undefined && + input.OutputUpdates !== null && { + OutputUpdates: serializeAws_json1_1OutputUpdates(input.OutputUpdates, context), + }), + ...(input.ReferenceDataSourceUpdates !== undefined && + input.ReferenceDataSourceUpdates !== null && { + ReferenceDataSourceUpdates: serializeAws_json1_1ReferenceDataSourceUpdates( + input.ReferenceDataSourceUpdates, + context + ), + }), }; }; const serializeAws_json1_1SqlRunConfiguration = (input: SqlRunConfiguration, context: __SerdeContext): any => { return { - ...(input.InputId !== undefined && { InputId: input.InputId }), - ...(input.InputStartingPositionConfiguration !== undefined && { - InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( - input.InputStartingPositionConfiguration, - context - ), - }), + ...(input.InputId !== undefined && input.InputId !== null && { InputId: input.InputId }), + ...(input.InputStartingPositionConfiguration !== undefined && + input.InputStartingPositionConfiguration !== null && { + InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( + input.InputStartingPositionConfiguration, + context + ), + }), }; }; const serializeAws_json1_1SqlRunConfigurations = (input: SqlRunConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SqlRunConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SqlRunConfiguration(entry, context); + }); }; const serializeAws_json1_1StartApplicationRequest = (input: StartApplicationRequest, context: __SerdeContext): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.RunConfiguration !== undefined && { - RunConfiguration: serializeAws_json1_1RunConfiguration(input.RunConfiguration, context), - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.RunConfiguration !== undefined && + input.RunConfiguration !== null && { + RunConfiguration: serializeAws_json1_1RunConfiguration(input.RunConfiguration, context), + }), }; }; const serializeAws_json1_1StopApplicationRequest = (input: StopApplicationRequest, context: __SerdeContext): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.Force !== undefined && { Force: input.Force }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.Force !== undefined && input.Force !== null && { Force: input.Force }), }; }; const serializeAws_json1_1SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; @@ -4301,58 +4511,79 @@ const serializeAws_json1_1UpdateApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationConfigurationUpdate !== undefined && { - ApplicationConfigurationUpdate: serializeAws_json1_1ApplicationConfigurationUpdate( - input.ApplicationConfigurationUpdate, - context - ), - }), - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CloudWatchLoggingOptionUpdates !== undefined && { - CloudWatchLoggingOptionUpdates: serializeAws_json1_1CloudWatchLoggingOptionUpdates( - input.CloudWatchLoggingOptionUpdates, - context - ), - }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.RunConfigurationUpdate !== undefined && { - RunConfigurationUpdate: serializeAws_json1_1RunConfigurationUpdate(input.RunConfigurationUpdate, context), - }), - ...(input.ServiceExecutionRoleUpdate !== undefined && { - ServiceExecutionRoleUpdate: input.ServiceExecutionRoleUpdate, - }), + ...(input.ApplicationConfigurationUpdate !== undefined && + input.ApplicationConfigurationUpdate !== null && { + ApplicationConfigurationUpdate: serializeAws_json1_1ApplicationConfigurationUpdate( + input.ApplicationConfigurationUpdate, + context + ), + }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CloudWatchLoggingOptionUpdates !== undefined && + input.CloudWatchLoggingOptionUpdates !== null && { + CloudWatchLoggingOptionUpdates: serializeAws_json1_1CloudWatchLoggingOptionUpdates( + input.CloudWatchLoggingOptionUpdates, + context + ), + }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.RunConfigurationUpdate !== undefined && + input.RunConfigurationUpdate !== null && { + RunConfigurationUpdate: serializeAws_json1_1RunConfigurationUpdate(input.RunConfigurationUpdate, context), + }), + ...(input.ServiceExecutionRoleUpdate !== undefined && + input.ServiceExecutionRoleUpdate !== null && { ServiceExecutionRoleUpdate: input.ServiceExecutionRoleUpdate }), }; }; const serializeAws_json1_1VpcConfiguration = (input: VpcConfiguration, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), }; }; const serializeAws_json1_1VpcConfigurations = (input: VpcConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1VpcConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1VpcConfiguration(entry, context); + }); }; const serializeAws_json1_1VpcConfigurationUpdate = (input: VpcConfigurationUpdate, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIdUpdates !== undefined && { - SecurityGroupIdUpdates: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIdUpdates, context), - }), - ...(input.SubnetIdUpdates !== undefined && { - SubnetIdUpdates: serializeAws_json1_1SubnetIds(input.SubnetIdUpdates, context), - }), - ...(input.VpcConfigurationId !== undefined && { VpcConfigurationId: input.VpcConfigurationId }), + ...(input.SecurityGroupIdUpdates !== undefined && + input.SecurityGroupIdUpdates !== null && { + SecurityGroupIdUpdates: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIdUpdates, context), + }), + ...(input.SubnetIdUpdates !== undefined && + input.SubnetIdUpdates !== null && { + SubnetIdUpdates: serializeAws_json1_1SubnetIds(input.SubnetIdUpdates, context), + }), + ...(input.VpcConfigurationId !== undefined && + input.VpcConfigurationId !== null && { VpcConfigurationId: input.VpcConfigurationId }), }; }; const serializeAws_json1_1VpcConfigurationUpdates = (input: VpcConfigurationUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1VpcConfigurationUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1VpcConfigurationUpdate(entry, context); + }); }; const deserializeAws_json1_1AddApplicationCloudWatchLoggingOptionResponse = ( @@ -4603,7 +4834,14 @@ const deserializeAws_json1_1ApplicationSnapshotConfigurationDescription = ( }; const deserializeAws_json1_1ApplicationSummaries = (output: any, context: __SerdeContext): ApplicationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ApplicationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ApplicationSummary(entry, context); + }); }; const deserializeAws_json1_1ApplicationSummary = (output: any, context: __SerdeContext): ApplicationSummary => { @@ -4669,7 +4907,14 @@ const deserializeAws_json1_1CloudWatchLoggingOptionDescriptions = ( output: any, context: __SerdeContext ): CloudWatchLoggingOptionDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CloudWatchLoggingOptionDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CloudWatchLoggingOptionDescription(entry, context); + }); }; const deserializeAws_json1_1CodeContentDescription = (output: any, context: __SerdeContext): CodeContentDescription => { @@ -4936,7 +5181,14 @@ const deserializeAws_json1_1FlinkRunConfiguration = (output: any, context: __Ser }; const deserializeAws_json1_1InAppStreamNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InputDescription = (output: any, context: __SerdeContext): InputDescription => { @@ -4979,7 +5231,14 @@ const deserializeAws_json1_1InputDescription = (output: any, context: __SerdeCon }; const deserializeAws_json1_1InputDescriptions = (output: any, context: __SerdeContext): InputDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InputDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InputDescription(entry, context); + }); }; const deserializeAws_json1_1InputLambdaProcessorDescription = ( @@ -5199,7 +5458,14 @@ const deserializeAws_json1_1OutputDescription = (output: any, context: __SerdeCo }; const deserializeAws_json1_1OutputDescriptions = (output: any, context: __SerdeContext): OutputDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OutputDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OutputDescription(entry, context); + }); }; const deserializeAws_json1_1ParallelismConfigurationDescription = ( @@ -5228,15 +5494,36 @@ const deserializeAws_json1_1ParallelismConfigurationDescription = ( }; const deserializeAws_json1_1ParsedInputRecord = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ParsedInputRecords = (output: any, context: __SerdeContext): string[][] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParsedInputRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParsedInputRecord(entry, context); + }); }; const deserializeAws_json1_1ProcessedInputRecords = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PropertyGroup = (output: any, context: __SerdeContext): PropertyGroup => { @@ -5251,21 +5538,37 @@ const deserializeAws_json1_1PropertyGroup = (output: any, context: __SerdeContex }; const deserializeAws_json1_1PropertyGroups = (output: any, context: __SerdeContext): PropertyGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PropertyGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PropertyGroup(entry, context); + }); }; const deserializeAws_json1_1PropertyMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1RawInputRecords = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RecordColumn = (output: any, context: __SerdeContext): RecordColumn => { @@ -5277,7 +5580,14 @@ const deserializeAws_json1_1RecordColumn = (output: any, context: __SerdeContext }; const deserializeAws_json1_1RecordColumns = (output: any, context: __SerdeContext): RecordColumn[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RecordColumn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RecordColumn(entry, context); + }); }; const deserializeAws_json1_1RecordFormat = (output: any, context: __SerdeContext): RecordFormat => { @@ -5313,7 +5623,14 @@ const deserializeAws_json1_1ReferenceDataSourceDescriptions = ( output: any, context: __SerdeContext ): ReferenceDataSourceDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReferenceDataSourceDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReferenceDataSourceDescription(entry, context); + }); }; const deserializeAws_json1_1ResourceInUseException = (output: any, context: __SerdeContext): ResourceInUseException => { @@ -5385,7 +5702,14 @@ const deserializeAws_json1_1S3ReferenceDataSourceDescription = ( }; const deserializeAws_json1_1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ServiceUnavailableException = ( @@ -5414,7 +5738,14 @@ const deserializeAws_json1_1SnapshotDetails = (output: any, context: __SerdeCont }; const deserializeAws_json1_1SnapshotSummaries = (output: any, context: __SerdeContext): SnapshotDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SnapshotDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SnapshotDetails(entry, context); + }); }; const deserializeAws_json1_1SourceSchema = (output: any, context: __SerdeContext): SourceSchema => { @@ -5467,7 +5798,14 @@ const deserializeAws_json1_1StopApplicationResponse = ( }; const deserializeAws_json1_1SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -5482,7 +5820,14 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TooManyTagsException = (output: any, context: __SerdeContext): TooManyTagsException => { @@ -5558,7 +5903,14 @@ const deserializeAws_json1_1VpcConfigurationDescriptions = ( output: any, context: __SerdeContext ): VpcConfigurationDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VpcConfigurationDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VpcConfigurationDescription(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -5611,3 +5963,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-kinesis-analytics/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics/protocols/Aws_json1_1.ts index 4210c92b94c7..cf417459bab4 100644 --- a/clients/client-kinesis-analytics/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics/protocols/Aws_json1_1.ts @@ -176,7 +176,7 @@ export const serializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.AddApplicationCloudWatchLoggingOption", }; let body: any; @@ -189,7 +189,7 @@ export const serializeAws_json1_1AddApplicationInputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.AddApplicationInput", }; let body: any; @@ -202,7 +202,7 @@ export const serializeAws_json1_1AddApplicationInputProcessingConfigurationComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.AddApplicationInputProcessingConfiguration", }; let body: any; @@ -215,7 +215,7 @@ export const serializeAws_json1_1AddApplicationOutputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.AddApplicationOutput", }; let body: any; @@ -228,7 +228,7 @@ export const serializeAws_json1_1AddApplicationReferenceDataSourceCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.AddApplicationReferenceDataSource", }; let body: any; @@ -241,7 +241,7 @@ export const serializeAws_json1_1CreateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.CreateApplication", }; let body: any; @@ -254,7 +254,7 @@ export const serializeAws_json1_1DeleteApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.DeleteApplication", }; let body: any; @@ -267,7 +267,7 @@ export const serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.DeleteApplicationCloudWatchLoggingOption", }; let body: any; @@ -280,7 +280,7 @@ export const serializeAws_json1_1DeleteApplicationInputProcessingConfigurationCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.DeleteApplicationInputProcessingConfiguration", }; let body: any; @@ -293,7 +293,7 @@ export const serializeAws_json1_1DeleteApplicationOutputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.DeleteApplicationOutput", }; let body: any; @@ -306,7 +306,7 @@ export const serializeAws_json1_1DeleteApplicationReferenceDataSourceCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.DeleteApplicationReferenceDataSource", }; let body: any; @@ -319,7 +319,7 @@ export const serializeAws_json1_1DescribeApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.DescribeApplication", }; let body: any; @@ -332,7 +332,7 @@ export const serializeAws_json1_1DiscoverInputSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.DiscoverInputSchema", }; let body: any; @@ -345,7 +345,7 @@ export const serializeAws_json1_1ListApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.ListApplications", }; let body: any; @@ -358,7 +358,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.ListTagsForResource", }; let body: any; @@ -371,7 +371,7 @@ export const serializeAws_json1_1StartApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.StartApplication", }; let body: any; @@ -384,7 +384,7 @@ export const serializeAws_json1_1StopApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.StopApplication", }; let body: any; @@ -397,7 +397,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.TagResource", }; let body: any; @@ -410,7 +410,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.UntagResource", }; let body: any; @@ -423,7 +423,7 @@ export const serializeAws_json1_1UpdateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "KinesisAnalytics_20150814.UpdateApplication", }; let body: any; @@ -458,8 +458,7 @@ const deserializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -545,8 +544,7 @@ const deserializeAws_json1_1AddApplicationInputCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeValidationException": case "com.amazonaws.kinesisanalytics#CodeValidationException": @@ -640,8 +638,7 @@ const deserializeAws_json1_1AddApplicationInputProcessingConfigurationCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -727,8 +724,7 @@ const deserializeAws_json1_1AddApplicationOutputCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -814,8 +810,7 @@ const deserializeAws_json1_1AddApplicationReferenceDataSourceCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -901,8 +896,7 @@ const deserializeAws_json1_1CreateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeValidationException": case "com.amazonaws.kinesisanalytics#CodeValidationException": @@ -996,8 +990,7 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -1075,8 +1068,7 @@ const deserializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -1162,8 +1154,7 @@ const deserializeAws_json1_1DeleteApplicationInputProcessingConfigurationCommand }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -1249,8 +1240,7 @@ const deserializeAws_json1_1DeleteApplicationOutputCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -1336,8 +1326,7 @@ const deserializeAws_json1_1DeleteApplicationReferenceDataSourceCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -1423,8 +1412,7 @@ const deserializeAws_json1_1DescribeApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": @@ -1486,8 +1474,7 @@ const deserializeAws_json1_1DiscoverInputSchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesisanalytics#InvalidArgumentException": @@ -1565,8 +1552,7 @@ const deserializeAws_json1_1ListApplicationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -1612,8 +1598,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -1683,8 +1668,7 @@ const deserializeAws_json1_1StartApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidApplicationConfigurationException": case "com.amazonaws.kinesisanalytics#InvalidApplicationConfigurationException": @@ -1770,8 +1754,7 @@ const deserializeAws_json1_1StopApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUseException": case "com.amazonaws.kinesisanalytics#ResourceInUseException": @@ -1841,8 +1824,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -1928,8 +1910,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": @@ -2015,8 +1996,7 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CodeValidationException": case "com.amazonaws.kinesisanalytics#CodeValidationException": @@ -2268,13 +2248,14 @@ const serializeAws_json1_1AddApplicationCloudWatchLoggingOptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CloudWatchLoggingOption !== undefined && { - CloudWatchLoggingOption: serializeAws_json1_1CloudWatchLoggingOption(input.CloudWatchLoggingOption, context), - }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CloudWatchLoggingOption !== undefined && + input.CloudWatchLoggingOption !== null && { + CloudWatchLoggingOption: serializeAws_json1_1CloudWatchLoggingOption(input.CloudWatchLoggingOption, context), + }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), }; }; @@ -2283,17 +2264,18 @@ const serializeAws_json1_1AddApplicationInputProcessingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.InputId !== undefined && { InputId: input.InputId }), - ...(input.InputProcessingConfiguration !== undefined && { - InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ), - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.InputId !== undefined && input.InputId !== null && { InputId: input.InputId }), + ...(input.InputProcessingConfiguration !== undefined && + input.InputProcessingConfiguration !== null && { + InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( + input.InputProcessingConfiguration, + context + ), + }), }; }; @@ -2302,11 +2284,12 @@ const serializeAws_json1_1AddApplicationInputRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.Input !== undefined && { Input: serializeAws_json1_1Input(input.Input, context) }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.Input !== undefined && + input.Input !== null && { Input: serializeAws_json1_1Input(input.Input, context) }), }; }; @@ -2315,11 +2298,12 @@ const serializeAws_json1_1AddApplicationOutputRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.Output !== undefined && { Output: serializeAws_json1_1Output(input.Output, context) }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.Output !== undefined && + input.Output !== null && { Output: serializeAws_json1_1Output(input.Output, context) }), }; }; @@ -2328,44 +2312,48 @@ const serializeAws_json1_1AddApplicationReferenceDataSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.ReferenceDataSource !== undefined && { - ReferenceDataSource: serializeAws_json1_1ReferenceDataSource(input.ReferenceDataSource, context), - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.ReferenceDataSource !== undefined && + input.ReferenceDataSource !== null && { + ReferenceDataSource: serializeAws_json1_1ReferenceDataSource(input.ReferenceDataSource, context), + }), }; }; const serializeAws_json1_1ApplicationUpdate = (input: ApplicationUpdate, context: __SerdeContext): any => { return { - ...(input.ApplicationCodeUpdate !== undefined && { ApplicationCodeUpdate: input.ApplicationCodeUpdate }), - ...(input.CloudWatchLoggingOptionUpdates !== undefined && { - CloudWatchLoggingOptionUpdates: serializeAws_json1_1CloudWatchLoggingOptionUpdates( - input.CloudWatchLoggingOptionUpdates, - context - ), - }), - ...(input.InputUpdates !== undefined && { - InputUpdates: serializeAws_json1_1InputUpdates(input.InputUpdates, context), - }), - ...(input.OutputUpdates !== undefined && { - OutputUpdates: serializeAws_json1_1OutputUpdates(input.OutputUpdates, context), - }), - ...(input.ReferenceDataSourceUpdates !== undefined && { - ReferenceDataSourceUpdates: serializeAws_json1_1ReferenceDataSourceUpdates( - input.ReferenceDataSourceUpdates, - context - ), - }), + ...(input.ApplicationCodeUpdate !== undefined && + input.ApplicationCodeUpdate !== null && { ApplicationCodeUpdate: input.ApplicationCodeUpdate }), + ...(input.CloudWatchLoggingOptionUpdates !== undefined && + input.CloudWatchLoggingOptionUpdates !== null && { + CloudWatchLoggingOptionUpdates: serializeAws_json1_1CloudWatchLoggingOptionUpdates( + input.CloudWatchLoggingOptionUpdates, + context + ), + }), + ...(input.InputUpdates !== undefined && + input.InputUpdates !== null && { InputUpdates: serializeAws_json1_1InputUpdates(input.InputUpdates, context) }), + ...(input.OutputUpdates !== undefined && + input.OutputUpdates !== null && { + OutputUpdates: serializeAws_json1_1OutputUpdates(input.OutputUpdates, context), + }), + ...(input.ReferenceDataSourceUpdates !== undefined && + input.ReferenceDataSourceUpdates !== null && { + ReferenceDataSourceUpdates: serializeAws_json1_1ReferenceDataSourceUpdates( + input.ReferenceDataSourceUpdates, + context + ), + }), }; }; const serializeAws_json1_1CloudWatchLoggingOption = (input: CloudWatchLoggingOption, context: __SerdeContext): any => { return { - ...(input.LogStreamARN !== undefined && { LogStreamARN: input.LogStreamARN }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.LogStreamARN !== undefined && input.LogStreamARN !== null && { LogStreamARN: input.LogStreamARN }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; @@ -2373,7 +2361,14 @@ const serializeAws_json1_1CloudWatchLoggingOptions = ( input: CloudWatchLoggingOption[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CloudWatchLoggingOption(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CloudWatchLoggingOption(entry, context); + }); }; const serializeAws_json1_1CloudWatchLoggingOptionUpdate = ( @@ -2381,11 +2376,11 @@ const serializeAws_json1_1CloudWatchLoggingOptionUpdate = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchLoggingOptionId !== undefined && { - CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId, - }), - ...(input.LogStreamARNUpdate !== undefined && { LogStreamARNUpdate: input.LogStreamARNUpdate }), - ...(input.RoleARNUpdate !== undefined && { RoleARNUpdate: input.RoleARNUpdate }), + ...(input.CloudWatchLoggingOptionId !== undefined && + input.CloudWatchLoggingOptionId !== null && { CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId }), + ...(input.LogStreamARNUpdate !== undefined && + input.LogStreamARNUpdate !== null && { LogStreamARNUpdate: input.LogStreamARNUpdate }), + ...(input.RoleARNUpdate !== undefined && input.RoleARNUpdate !== null && { RoleARNUpdate: input.RoleARNUpdate }), }; }; @@ -2393,7 +2388,14 @@ const serializeAws_json1_1CloudWatchLoggingOptionUpdates = ( input: CloudWatchLoggingOptionUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CloudWatchLoggingOptionUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CloudWatchLoggingOptionUpdate(entry, context); + }); }; const serializeAws_json1_1CreateApplicationRequest = ( @@ -2401,22 +2403,30 @@ const serializeAws_json1_1CreateApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationCode !== undefined && { ApplicationCode: input.ApplicationCode }), - ...(input.ApplicationDescription !== undefined && { ApplicationDescription: input.ApplicationDescription }), - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CloudWatchLoggingOptions !== undefined && { - CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), - }), - ...(input.Inputs !== undefined && { Inputs: serializeAws_json1_1Inputs(input.Inputs, context) }), - ...(input.Outputs !== undefined && { Outputs: serializeAws_json1_1Outputs(input.Outputs, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ApplicationCode !== undefined && + input.ApplicationCode !== null && { ApplicationCode: input.ApplicationCode }), + ...(input.ApplicationDescription !== undefined && + input.ApplicationDescription !== null && { ApplicationDescription: input.ApplicationDescription }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CloudWatchLoggingOptions !== undefined && + input.CloudWatchLoggingOptions !== null && { + CloudWatchLoggingOptions: serializeAws_json1_1CloudWatchLoggingOptions(input.CloudWatchLoggingOptions, context), + }), + ...(input.Inputs !== undefined && + input.Inputs !== null && { Inputs: serializeAws_json1_1Inputs(input.Inputs, context) }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { Outputs: serializeAws_json1_1Outputs(input.Outputs, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1CSVMappingParameters = (input: CSVMappingParameters, context: __SerdeContext): any => { return { - ...(input.RecordColumnDelimiter !== undefined && { RecordColumnDelimiter: input.RecordColumnDelimiter }), - ...(input.RecordRowDelimiter !== undefined && { RecordRowDelimiter: input.RecordRowDelimiter }), + ...(input.RecordColumnDelimiter !== undefined && + input.RecordColumnDelimiter !== null && { RecordColumnDelimiter: input.RecordColumnDelimiter }), + ...(input.RecordRowDelimiter !== undefined && + input.RecordRowDelimiter !== null && { RecordRowDelimiter: input.RecordRowDelimiter }), }; }; @@ -2425,13 +2435,12 @@ const serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CloudWatchLoggingOptionId !== undefined && { - CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId, - }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CloudWatchLoggingOptionId !== undefined && + input.CloudWatchLoggingOptionId !== null && { CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), }; }; @@ -2440,11 +2449,11 @@ const serializeAws_json1_1DeleteApplicationInputProcessingConfigurationRequest = context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.InputId !== undefined && { InputId: input.InputId }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.InputId !== undefined && input.InputId !== null && { InputId: input.InputId }), }; }; @@ -2453,11 +2462,11 @@ const serializeAws_json1_1DeleteApplicationOutputRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.OutputId !== undefined && { OutputId: input.OutputId }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.OutputId !== undefined && input.OutputId !== null && { OutputId: input.OutputId }), }; }; @@ -2466,11 +2475,11 @@ const serializeAws_json1_1DeleteApplicationReferenceDataSourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), - ...(input.ReferenceId !== undefined && { ReferenceId: input.ReferenceId }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), + ...(input.ReferenceId !== undefined && input.ReferenceId !== null && { ReferenceId: input.ReferenceId }), }; }; @@ -2479,8 +2488,10 @@ const serializeAws_json1_1DeleteApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.CreateTimestamp !== undefined && { CreateTimestamp: Math.round(input.CreateTimestamp.getTime() / 1000) }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.CreateTimestamp !== undefined && + input.CreateTimestamp !== null && { CreateTimestamp: Math.round(input.CreateTimestamp.getTime() / 1000) }), }; }; @@ -2489,13 +2500,15 @@ const serializeAws_json1_1DescribeApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), }; }; const serializeAws_json1_1DestinationSchema = (input: DestinationSchema, context: __SerdeContext): any => { return { - ...(input.RecordFormatType !== undefined && { RecordFormatType: input.RecordFormatType }), + ...(input.RecordFormatType !== undefined && + input.RecordFormatType !== null && { RecordFormatType: input.RecordFormatType }), }; }; @@ -2504,70 +2517,84 @@ const serializeAws_json1_1DiscoverInputSchemaRequest = ( context: __SerdeContext ): any => { return { - ...(input.InputProcessingConfiguration !== undefined && { - InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ), - }), - ...(input.InputStartingPositionConfiguration !== undefined && { - InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( - input.InputStartingPositionConfiguration, - context - ), - }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.S3Configuration !== undefined && { - S3Configuration: serializeAws_json1_1S3Configuration(input.S3Configuration, context), - }), + ...(input.InputProcessingConfiguration !== undefined && + input.InputProcessingConfiguration !== null && { + InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( + input.InputProcessingConfiguration, + context + ), + }), + ...(input.InputStartingPositionConfiguration !== undefined && + input.InputStartingPositionConfiguration !== null && { + InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( + input.InputStartingPositionConfiguration, + context + ), + }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.S3Configuration !== undefined && + input.S3Configuration !== null && { + S3Configuration: serializeAws_json1_1S3Configuration(input.S3Configuration, context), + }), }; }; const serializeAws_json1_1Input = (input: Input, context: __SerdeContext): any => { return { - ...(input.InputParallelism !== undefined && { - InputParallelism: serializeAws_json1_1InputParallelism(input.InputParallelism, context), - }), - ...(input.InputProcessingConfiguration !== undefined && { - InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ), - }), - ...(input.InputSchema !== undefined && { - InputSchema: serializeAws_json1_1SourceSchema(input.InputSchema, context), - }), - ...(input.KinesisFirehoseInput !== undefined && { - KinesisFirehoseInput: serializeAws_json1_1KinesisFirehoseInput(input.KinesisFirehoseInput, context), - }), - ...(input.KinesisStreamsInput !== undefined && { - KinesisStreamsInput: serializeAws_json1_1KinesisStreamsInput(input.KinesisStreamsInput, context), - }), - ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), + ...(input.InputParallelism !== undefined && + input.InputParallelism !== null && { + InputParallelism: serializeAws_json1_1InputParallelism(input.InputParallelism, context), + }), + ...(input.InputProcessingConfiguration !== undefined && + input.InputProcessingConfiguration !== null && { + InputProcessingConfiguration: serializeAws_json1_1InputProcessingConfiguration( + input.InputProcessingConfiguration, + context + ), + }), + ...(input.InputSchema !== undefined && + input.InputSchema !== null && { InputSchema: serializeAws_json1_1SourceSchema(input.InputSchema, context) }), + ...(input.KinesisFirehoseInput !== undefined && + input.KinesisFirehoseInput !== null && { + KinesisFirehoseInput: serializeAws_json1_1KinesisFirehoseInput(input.KinesisFirehoseInput, context), + }), + ...(input.KinesisStreamsInput !== undefined && + input.KinesisStreamsInput !== null && { + KinesisStreamsInput: serializeAws_json1_1KinesisStreamsInput(input.KinesisStreamsInput, context), + }), + ...(input.NamePrefix !== undefined && input.NamePrefix !== null && { NamePrefix: input.NamePrefix }), }; }; const serializeAws_json1_1InputConfiguration = (input: InputConfiguration, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.InputStartingPositionConfiguration !== undefined && { - InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( - input.InputStartingPositionConfiguration, - context - ), - }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.InputStartingPositionConfiguration !== undefined && + input.InputStartingPositionConfiguration !== null && { + InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( + input.InputStartingPositionConfiguration, + context + ), + }), }; }; const serializeAws_json1_1InputConfigurations = (input: InputConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InputConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InputConfiguration(entry, context); + }); }; const serializeAws_json1_1InputLambdaProcessor = (input: InputLambdaProcessor, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; @@ -2576,20 +2603,21 @@ const serializeAws_json1_1InputLambdaProcessorUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), - ...(input.RoleARNUpdate !== undefined && { RoleARNUpdate: input.RoleARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.RoleARNUpdate !== undefined && input.RoleARNUpdate !== null && { RoleARNUpdate: input.RoleARNUpdate }), }; }; const serializeAws_json1_1InputParallelism = (input: InputParallelism, context: __SerdeContext): any => { return { - ...(input.Count !== undefined && { Count: input.Count }), + ...(input.Count !== undefined && input.Count !== null && { Count: input.Count }), }; }; const serializeAws_json1_1InputParallelismUpdate = (input: InputParallelismUpdate, context: __SerdeContext): any => { return { - ...(input.CountUpdate !== undefined && { CountUpdate: input.CountUpdate }), + ...(input.CountUpdate !== undefined && input.CountUpdate !== null && { CountUpdate: input.CountUpdate }), }; }; @@ -2598,9 +2626,10 @@ const serializeAws_json1_1InputProcessingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.InputLambdaProcessor !== undefined && { - InputLambdaProcessor: serializeAws_json1_1InputLambdaProcessor(input.InputLambdaProcessor, context), - }), + ...(input.InputLambdaProcessor !== undefined && + input.InputLambdaProcessor !== null && { + InputLambdaProcessor: serializeAws_json1_1InputLambdaProcessor(input.InputLambdaProcessor, context), + }), }; }; @@ -2609,28 +2638,39 @@ const serializeAws_json1_1InputProcessingConfigurationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.InputLambdaProcessorUpdate !== undefined && { - InputLambdaProcessorUpdate: serializeAws_json1_1InputLambdaProcessorUpdate( - input.InputLambdaProcessorUpdate, - context - ), - }), + ...(input.InputLambdaProcessorUpdate !== undefined && + input.InputLambdaProcessorUpdate !== null && { + InputLambdaProcessorUpdate: serializeAws_json1_1InputLambdaProcessorUpdate( + input.InputLambdaProcessorUpdate, + context + ), + }), }; }; const serializeAws_json1_1Inputs = (input: Input[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Input(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Input(entry, context); + }); }; const serializeAws_json1_1InputSchemaUpdate = (input: InputSchemaUpdate, context: __SerdeContext): any => { return { - ...(input.RecordColumnUpdates !== undefined && { - RecordColumnUpdates: serializeAws_json1_1RecordColumns(input.RecordColumnUpdates, context), - }), - ...(input.RecordEncodingUpdate !== undefined && { RecordEncodingUpdate: input.RecordEncodingUpdate }), - ...(input.RecordFormatUpdate !== undefined && { - RecordFormatUpdate: serializeAws_json1_1RecordFormat(input.RecordFormatUpdate, context), - }), + ...(input.RecordColumnUpdates !== undefined && + input.RecordColumnUpdates !== null && { + RecordColumnUpdates: serializeAws_json1_1RecordColumns(input.RecordColumnUpdates, context), + }), + ...(input.RecordEncodingUpdate !== undefined && + input.RecordEncodingUpdate !== null && { RecordEncodingUpdate: input.RecordEncodingUpdate }), + ...(input.RecordFormatUpdate !== undefined && + input.RecordFormatUpdate !== null && { + RecordFormatUpdate: serializeAws_json1_1RecordFormat(input.RecordFormatUpdate, context), + }), }; }; @@ -2639,55 +2679,69 @@ const serializeAws_json1_1InputStartingPositionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.InputStartingPosition !== undefined && { InputStartingPosition: input.InputStartingPosition }), + ...(input.InputStartingPosition !== undefined && + input.InputStartingPosition !== null && { InputStartingPosition: input.InputStartingPosition }), }; }; const serializeAws_json1_1InputUpdate = (input: InputUpdate, context: __SerdeContext): any => { return { - ...(input.InputId !== undefined && { InputId: input.InputId }), - ...(input.InputParallelismUpdate !== undefined && { - InputParallelismUpdate: serializeAws_json1_1InputParallelismUpdate(input.InputParallelismUpdate, context), - }), - ...(input.InputProcessingConfigurationUpdate !== undefined && { - InputProcessingConfigurationUpdate: serializeAws_json1_1InputProcessingConfigurationUpdate( - input.InputProcessingConfigurationUpdate, - context - ), - }), - ...(input.InputSchemaUpdate !== undefined && { - InputSchemaUpdate: serializeAws_json1_1InputSchemaUpdate(input.InputSchemaUpdate, context), - }), - ...(input.KinesisFirehoseInputUpdate !== undefined && { - KinesisFirehoseInputUpdate: serializeAws_json1_1KinesisFirehoseInputUpdate( - input.KinesisFirehoseInputUpdate, - context - ), - }), - ...(input.KinesisStreamsInputUpdate !== undefined && { - KinesisStreamsInputUpdate: serializeAws_json1_1KinesisStreamsInputUpdate( - input.KinesisStreamsInputUpdate, - context - ), - }), - ...(input.NamePrefixUpdate !== undefined && { NamePrefixUpdate: input.NamePrefixUpdate }), + ...(input.InputId !== undefined && input.InputId !== null && { InputId: input.InputId }), + ...(input.InputParallelismUpdate !== undefined && + input.InputParallelismUpdate !== null && { + InputParallelismUpdate: serializeAws_json1_1InputParallelismUpdate(input.InputParallelismUpdate, context), + }), + ...(input.InputProcessingConfigurationUpdate !== undefined && + input.InputProcessingConfigurationUpdate !== null && { + InputProcessingConfigurationUpdate: serializeAws_json1_1InputProcessingConfigurationUpdate( + input.InputProcessingConfigurationUpdate, + context + ), + }), + ...(input.InputSchemaUpdate !== undefined && + input.InputSchemaUpdate !== null && { + InputSchemaUpdate: serializeAws_json1_1InputSchemaUpdate(input.InputSchemaUpdate, context), + }), + ...(input.KinesisFirehoseInputUpdate !== undefined && + input.KinesisFirehoseInputUpdate !== null && { + KinesisFirehoseInputUpdate: serializeAws_json1_1KinesisFirehoseInputUpdate( + input.KinesisFirehoseInputUpdate, + context + ), + }), + ...(input.KinesisStreamsInputUpdate !== undefined && + input.KinesisStreamsInputUpdate !== null && { + KinesisStreamsInputUpdate: serializeAws_json1_1KinesisStreamsInputUpdate( + input.KinesisStreamsInputUpdate, + context + ), + }), + ...(input.NamePrefixUpdate !== undefined && + input.NamePrefixUpdate !== null && { NamePrefixUpdate: input.NamePrefixUpdate }), }; }; const serializeAws_json1_1InputUpdates = (input: InputUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InputUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InputUpdate(entry, context); + }); }; const serializeAws_json1_1JSONMappingParameters = (input: JSONMappingParameters, context: __SerdeContext): any => { return { - ...(input.RecordRowPath !== undefined && { RecordRowPath: input.RecordRowPath }), + ...(input.RecordRowPath !== undefined && input.RecordRowPath !== null && { RecordRowPath: input.RecordRowPath }), }; }; const serializeAws_json1_1KinesisFirehoseInput = (input: KinesisFirehoseInput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; @@ -2696,15 +2750,16 @@ const serializeAws_json1_1KinesisFirehoseInputUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), - ...(input.RoleARNUpdate !== undefined && { RoleARNUpdate: input.RoleARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.RoleARNUpdate !== undefined && input.RoleARNUpdate !== null && { RoleARNUpdate: input.RoleARNUpdate }), }; }; const serializeAws_json1_1KinesisFirehoseOutput = (input: KinesisFirehoseOutput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; @@ -2713,15 +2768,16 @@ const serializeAws_json1_1KinesisFirehoseOutputUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), - ...(input.RoleARNUpdate !== undefined && { RoleARNUpdate: input.RoleARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.RoleARNUpdate !== undefined && input.RoleARNUpdate !== null && { RoleARNUpdate: input.RoleARNUpdate }), }; }; const serializeAws_json1_1KinesisStreamsInput = (input: KinesisStreamsInput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; @@ -2730,15 +2786,16 @@ const serializeAws_json1_1KinesisStreamsInputUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), - ...(input.RoleARNUpdate !== undefined && { RoleARNUpdate: input.RoleARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.RoleARNUpdate !== undefined && input.RoleARNUpdate !== null && { RoleARNUpdate: input.RoleARNUpdate }), }; }; const serializeAws_json1_1KinesisStreamsOutput = (input: KinesisStreamsOutput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; @@ -2747,31 +2804,34 @@ const serializeAws_json1_1KinesisStreamsOutputUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), - ...(input.RoleARNUpdate !== undefined && { RoleARNUpdate: input.RoleARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.RoleARNUpdate !== undefined && input.RoleARNUpdate !== null && { RoleARNUpdate: input.RoleARNUpdate }), }; }; const serializeAws_json1_1LambdaOutput = (input: LambdaOutput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; const serializeAws_json1_1LambdaOutputUpdate = (input: LambdaOutputUpdate, context: __SerdeContext): any => { return { - ...(input.ResourceARNUpdate !== undefined && { ResourceARNUpdate: input.ResourceARNUpdate }), - ...(input.RoleARNUpdate !== undefined && { RoleARNUpdate: input.RoleARNUpdate }), + ...(input.ResourceARNUpdate !== undefined && + input.ResourceARNUpdate !== null && { ResourceARNUpdate: input.ResourceARNUpdate }), + ...(input.RoleARNUpdate !== undefined && input.RoleARNUpdate !== null && { RoleARNUpdate: input.RoleARNUpdate }), }; }; const serializeAws_json1_1ListApplicationsRequest = (input: ListApplicationsRequest, context: __SerdeContext): any => { return { - ...(input.ExclusiveStartApplicationName !== undefined && { - ExclusiveStartApplicationName: input.ExclusiveStartApplicationName, - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.ExclusiveStartApplicationName !== undefined && + input.ExclusiveStartApplicationName !== null && { + ExclusiveStartApplicationName: input.ExclusiveStartApplicationName, + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), }; }; @@ -2780,102 +2840,135 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1MappingParameters = (input: MappingParameters, context: __SerdeContext): any => { return { - ...(input.CSVMappingParameters !== undefined && { - CSVMappingParameters: serializeAws_json1_1CSVMappingParameters(input.CSVMappingParameters, context), - }), - ...(input.JSONMappingParameters !== undefined && { - JSONMappingParameters: serializeAws_json1_1JSONMappingParameters(input.JSONMappingParameters, context), - }), + ...(input.CSVMappingParameters !== undefined && + input.CSVMappingParameters !== null && { + CSVMappingParameters: serializeAws_json1_1CSVMappingParameters(input.CSVMappingParameters, context), + }), + ...(input.JSONMappingParameters !== undefined && + input.JSONMappingParameters !== null && { + JSONMappingParameters: serializeAws_json1_1JSONMappingParameters(input.JSONMappingParameters, context), + }), }; }; const serializeAws_json1_1Output = (input: Output, context: __SerdeContext): any => { return { - ...(input.DestinationSchema !== undefined && { - DestinationSchema: serializeAws_json1_1DestinationSchema(input.DestinationSchema, context), - }), - ...(input.KinesisFirehoseOutput !== undefined && { - KinesisFirehoseOutput: serializeAws_json1_1KinesisFirehoseOutput(input.KinesisFirehoseOutput, context), - }), - ...(input.KinesisStreamsOutput !== undefined && { - KinesisStreamsOutput: serializeAws_json1_1KinesisStreamsOutput(input.KinesisStreamsOutput, context), - }), - ...(input.LambdaOutput !== undefined && { - LambdaOutput: serializeAws_json1_1LambdaOutput(input.LambdaOutput, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.DestinationSchema !== undefined && + input.DestinationSchema !== null && { + DestinationSchema: serializeAws_json1_1DestinationSchema(input.DestinationSchema, context), + }), + ...(input.KinesisFirehoseOutput !== undefined && + input.KinesisFirehoseOutput !== null && { + KinesisFirehoseOutput: serializeAws_json1_1KinesisFirehoseOutput(input.KinesisFirehoseOutput, context), + }), + ...(input.KinesisStreamsOutput !== undefined && + input.KinesisStreamsOutput !== null && { + KinesisStreamsOutput: serializeAws_json1_1KinesisStreamsOutput(input.KinesisStreamsOutput, context), + }), + ...(input.LambdaOutput !== undefined && + input.LambdaOutput !== null && { LambdaOutput: serializeAws_json1_1LambdaOutput(input.LambdaOutput, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1Outputs = (input: Output[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Output(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Output(entry, context); + }); }; const serializeAws_json1_1OutputUpdate = (input: OutputUpdate, context: __SerdeContext): any => { return { - ...(input.DestinationSchemaUpdate !== undefined && { - DestinationSchemaUpdate: serializeAws_json1_1DestinationSchema(input.DestinationSchemaUpdate, context), - }), - ...(input.KinesisFirehoseOutputUpdate !== undefined && { - KinesisFirehoseOutputUpdate: serializeAws_json1_1KinesisFirehoseOutputUpdate( - input.KinesisFirehoseOutputUpdate, - context - ), - }), - ...(input.KinesisStreamsOutputUpdate !== undefined && { - KinesisStreamsOutputUpdate: serializeAws_json1_1KinesisStreamsOutputUpdate( - input.KinesisStreamsOutputUpdate, - context - ), - }), - ...(input.LambdaOutputUpdate !== undefined && { - LambdaOutputUpdate: serializeAws_json1_1LambdaOutputUpdate(input.LambdaOutputUpdate, context), - }), - ...(input.NameUpdate !== undefined && { NameUpdate: input.NameUpdate }), - ...(input.OutputId !== undefined && { OutputId: input.OutputId }), + ...(input.DestinationSchemaUpdate !== undefined && + input.DestinationSchemaUpdate !== null && { + DestinationSchemaUpdate: serializeAws_json1_1DestinationSchema(input.DestinationSchemaUpdate, context), + }), + ...(input.KinesisFirehoseOutputUpdate !== undefined && + input.KinesisFirehoseOutputUpdate !== null && { + KinesisFirehoseOutputUpdate: serializeAws_json1_1KinesisFirehoseOutputUpdate( + input.KinesisFirehoseOutputUpdate, + context + ), + }), + ...(input.KinesisStreamsOutputUpdate !== undefined && + input.KinesisStreamsOutputUpdate !== null && { + KinesisStreamsOutputUpdate: serializeAws_json1_1KinesisStreamsOutputUpdate( + input.KinesisStreamsOutputUpdate, + context + ), + }), + ...(input.LambdaOutputUpdate !== undefined && + input.LambdaOutputUpdate !== null && { + LambdaOutputUpdate: serializeAws_json1_1LambdaOutputUpdate(input.LambdaOutputUpdate, context), + }), + ...(input.NameUpdate !== undefined && input.NameUpdate !== null && { NameUpdate: input.NameUpdate }), + ...(input.OutputId !== undefined && input.OutputId !== null && { OutputId: input.OutputId }), }; }; const serializeAws_json1_1OutputUpdates = (input: OutputUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OutputUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OutputUpdate(entry, context); + }); }; const serializeAws_json1_1RecordColumn = (input: RecordColumn, context: __SerdeContext): any => { return { - ...(input.Mapping !== undefined && { Mapping: input.Mapping }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SqlType !== undefined && { SqlType: input.SqlType }), + ...(input.Mapping !== undefined && input.Mapping !== null && { Mapping: input.Mapping }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SqlType !== undefined && input.SqlType !== null && { SqlType: input.SqlType }), }; }; const serializeAws_json1_1RecordColumns = (input: RecordColumn[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RecordColumn(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RecordColumn(entry, context); + }); }; const serializeAws_json1_1RecordFormat = (input: RecordFormat, context: __SerdeContext): any => { return { - ...(input.MappingParameters !== undefined && { - MappingParameters: serializeAws_json1_1MappingParameters(input.MappingParameters, context), - }), - ...(input.RecordFormatType !== undefined && { RecordFormatType: input.RecordFormatType }), + ...(input.MappingParameters !== undefined && + input.MappingParameters !== null && { + MappingParameters: serializeAws_json1_1MappingParameters(input.MappingParameters, context), + }), + ...(input.RecordFormatType !== undefined && + input.RecordFormatType !== null && { RecordFormatType: input.RecordFormatType }), }; }; const serializeAws_json1_1ReferenceDataSource = (input: ReferenceDataSource, context: __SerdeContext): any => { return { - ...(input.ReferenceSchema !== undefined && { - ReferenceSchema: serializeAws_json1_1SourceSchema(input.ReferenceSchema, context), - }), - ...(input.S3ReferenceDataSource !== undefined && { - S3ReferenceDataSource: serializeAws_json1_1S3ReferenceDataSource(input.S3ReferenceDataSource, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.ReferenceSchema !== undefined && + input.ReferenceSchema !== null && { + ReferenceSchema: serializeAws_json1_1SourceSchema(input.ReferenceSchema, context), + }), + ...(input.S3ReferenceDataSource !== undefined && + input.S3ReferenceDataSource !== null && { + S3ReferenceDataSource: serializeAws_json1_1S3ReferenceDataSource(input.S3ReferenceDataSource, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -2884,17 +2977,20 @@ const serializeAws_json1_1ReferenceDataSourceUpdate = ( context: __SerdeContext ): any => { return { - ...(input.ReferenceId !== undefined && { ReferenceId: input.ReferenceId }), - ...(input.ReferenceSchemaUpdate !== undefined && { - ReferenceSchemaUpdate: serializeAws_json1_1SourceSchema(input.ReferenceSchemaUpdate, context), - }), - ...(input.S3ReferenceDataSourceUpdate !== undefined && { - S3ReferenceDataSourceUpdate: serializeAws_json1_1S3ReferenceDataSourceUpdate( - input.S3ReferenceDataSourceUpdate, - context - ), - }), - ...(input.TableNameUpdate !== undefined && { TableNameUpdate: input.TableNameUpdate }), + ...(input.ReferenceId !== undefined && input.ReferenceId !== null && { ReferenceId: input.ReferenceId }), + ...(input.ReferenceSchemaUpdate !== undefined && + input.ReferenceSchemaUpdate !== null && { + ReferenceSchemaUpdate: serializeAws_json1_1SourceSchema(input.ReferenceSchemaUpdate, context), + }), + ...(input.S3ReferenceDataSourceUpdate !== undefined && + input.S3ReferenceDataSourceUpdate !== null && { + S3ReferenceDataSourceUpdate: serializeAws_json1_1S3ReferenceDataSourceUpdate( + input.S3ReferenceDataSourceUpdate, + context + ), + }), + ...(input.TableNameUpdate !== undefined && + input.TableNameUpdate !== null && { TableNameUpdate: input.TableNameUpdate }), }; }; @@ -2902,22 +2998,30 @@ const serializeAws_json1_1ReferenceDataSourceUpdates = ( input: ReferenceDataSourceUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ReferenceDataSourceUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ReferenceDataSourceUpdate(entry, context); + }); }; const serializeAws_json1_1S3Configuration = (input: S3Configuration, context: __SerdeContext): any => { return { - ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), - ...(input.FileKey !== undefined && { FileKey: input.FileKey }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.BucketARN !== undefined && input.BucketARN !== null && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && input.FileKey !== null && { FileKey: input.FileKey }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; const serializeAws_json1_1S3ReferenceDataSource = (input: S3ReferenceDataSource, context: __SerdeContext): any => { return { - ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), - ...(input.FileKey !== undefined && { FileKey: input.FileKey }), - ...(input.ReferenceRoleARN !== undefined && { ReferenceRoleARN: input.ReferenceRoleARN }), + ...(input.BucketARN !== undefined && input.BucketARN !== null && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && input.FileKey !== null && { FileKey: input.FileKey }), + ...(input.ReferenceRoleARN !== undefined && + input.ReferenceRoleARN !== null && { ReferenceRoleARN: input.ReferenceRoleARN }), }; }; @@ -2926,65 +3030,86 @@ const serializeAws_json1_1S3ReferenceDataSourceUpdate = ( context: __SerdeContext ): any => { return { - ...(input.BucketARNUpdate !== undefined && { BucketARNUpdate: input.BucketARNUpdate }), - ...(input.FileKeyUpdate !== undefined && { FileKeyUpdate: input.FileKeyUpdate }), - ...(input.ReferenceRoleARNUpdate !== undefined && { ReferenceRoleARNUpdate: input.ReferenceRoleARNUpdate }), + ...(input.BucketARNUpdate !== undefined && + input.BucketARNUpdate !== null && { BucketARNUpdate: input.BucketARNUpdate }), + ...(input.FileKeyUpdate !== undefined && input.FileKeyUpdate !== null && { FileKeyUpdate: input.FileKeyUpdate }), + ...(input.ReferenceRoleARNUpdate !== undefined && + input.ReferenceRoleARNUpdate !== null && { ReferenceRoleARNUpdate: input.ReferenceRoleARNUpdate }), }; }; const serializeAws_json1_1SourceSchema = (input: SourceSchema, context: __SerdeContext): any => { return { - ...(input.RecordColumns !== undefined && { - RecordColumns: serializeAws_json1_1RecordColumns(input.RecordColumns, context), - }), - ...(input.RecordEncoding !== undefined && { RecordEncoding: input.RecordEncoding }), - ...(input.RecordFormat !== undefined && { - RecordFormat: serializeAws_json1_1RecordFormat(input.RecordFormat, context), - }), + ...(input.RecordColumns !== undefined && + input.RecordColumns !== null && { + RecordColumns: serializeAws_json1_1RecordColumns(input.RecordColumns, context), + }), + ...(input.RecordEncoding !== undefined && + input.RecordEncoding !== null && { RecordEncoding: input.RecordEncoding }), + ...(input.RecordFormat !== undefined && + input.RecordFormat !== null && { RecordFormat: serializeAws_json1_1RecordFormat(input.RecordFormat, context) }), }; }; const serializeAws_json1_1StartApplicationRequest = (input: StartApplicationRequest, context: __SerdeContext): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.InputConfigurations !== undefined && { - InputConfigurations: serializeAws_json1_1InputConfigurations(input.InputConfigurations, context), - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.InputConfigurations !== undefined && + input.InputConfigurations !== null && { + InputConfigurations: serializeAws_json1_1InputConfigurations(input.InputConfigurations, context), + }), }; }; const serializeAws_json1_1StopApplicationRequest = (input: StopApplicationRequest, context: __SerdeContext): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; @@ -2993,13 +3118,14 @@ const serializeAws_json1_1UpdateApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationName !== undefined && { ApplicationName: input.ApplicationName }), - ...(input.ApplicationUpdate !== undefined && { - ApplicationUpdate: serializeAws_json1_1ApplicationUpdate(input.ApplicationUpdate, context), - }), - ...(input.CurrentApplicationVersionId !== undefined && { - CurrentApplicationVersionId: input.CurrentApplicationVersionId, - }), + ...(input.ApplicationName !== undefined && + input.ApplicationName !== null && { ApplicationName: input.ApplicationName }), + ...(input.ApplicationUpdate !== undefined && + input.ApplicationUpdate !== null && { + ApplicationUpdate: serializeAws_json1_1ApplicationUpdate(input.ApplicationUpdate, context), + }), + ...(input.CurrentApplicationVersionId !== undefined && + input.CurrentApplicationVersionId !== null && { CurrentApplicationVersionId: input.CurrentApplicationVersionId }), }; }; @@ -3086,7 +3212,14 @@ const deserializeAws_json1_1ApplicationDetail = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ApplicationSummaries = (output: any, context: __SerdeContext): ApplicationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ApplicationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ApplicationSummary(entry, context); + }); }; const deserializeAws_json1_1ApplicationSummary = (output: any, context: __SerdeContext): ApplicationSummary => { @@ -3120,7 +3253,14 @@ const deserializeAws_json1_1CloudWatchLoggingOptionDescriptions = ( output: any, context: __SerdeContext ): CloudWatchLoggingOptionDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CloudWatchLoggingOptionDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CloudWatchLoggingOptionDescription(entry, context); + }); }; const deserializeAws_json1_1CodeValidationException = ( @@ -3245,7 +3385,14 @@ const deserializeAws_json1_1DiscoverInputSchemaResponse = ( }; const deserializeAws_json1_1InAppStreamNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InputDescription = (output: any, context: __SerdeContext): InputDescription => { @@ -3288,7 +3435,14 @@ const deserializeAws_json1_1InputDescription = (output: any, context: __SerdeCon }; const deserializeAws_json1_1InputDescriptions = (output: any, context: __SerdeContext): InputDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InputDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InputDescription(entry, context); + }); }; const deserializeAws_json1_1InputLambdaProcessorDescription = ( @@ -3475,23 +3629,58 @@ const deserializeAws_json1_1OutputDescription = (output: any, context: __SerdeCo }; const deserializeAws_json1_1OutputDescriptions = (output: any, context: __SerdeContext): OutputDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OutputDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OutputDescription(entry, context); + }); }; const deserializeAws_json1_1ParsedInputRecord = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ParsedInputRecords = (output: any, context: __SerdeContext): string[][] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParsedInputRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParsedInputRecord(entry, context); + }); }; const deserializeAws_json1_1ProcessedInputRecords = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RawInputRecords = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RecordColumn = (output: any, context: __SerdeContext): RecordColumn => { @@ -3503,7 +3692,14 @@ const deserializeAws_json1_1RecordColumn = (output: any, context: __SerdeContext }; const deserializeAws_json1_1RecordColumns = (output: any, context: __SerdeContext): RecordColumn[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RecordColumn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RecordColumn(entry, context); + }); }; const deserializeAws_json1_1RecordFormat = (output: any, context: __SerdeContext): RecordFormat => { @@ -3539,7 +3735,14 @@ const deserializeAws_json1_1ReferenceDataSourceDescriptions = ( output: any, context: __SerdeContext ): ReferenceDataSourceDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReferenceDataSourceDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReferenceDataSourceDescription(entry, context); + }); }; const deserializeAws_json1_1ResourceInUseException = (output: any, context: __SerdeContext): ResourceInUseException => { @@ -3628,7 +3831,14 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TooManyTagsException = (output: any, context: __SerdeContext): TooManyTagsException => { @@ -3724,3 +3934,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-kinesis-video-archived-media/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-archived-media/protocols/Aws_restJson1.ts index 57acc9eb01bf..fac005077482 100644 --- a/clients/client-kinesis-video-archived-media/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-archived-media/protocols/Aws_restJson1.ts @@ -46,16 +46,17 @@ export const serializeAws_restJson1GetClipCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getClip"; let body: any; body = JSON.stringify({ - ...(input.ClipFragmentSelector !== undefined && { - ClipFragmentSelector: serializeAws_restJson1ClipFragmentSelector(input.ClipFragmentSelector, context), - }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.ClipFragmentSelector !== undefined && + input.ClipFragmentSelector !== null && { + ClipFragmentSelector: serializeAws_restJson1ClipFragmentSelector(input.ClipFragmentSelector, context), + }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -74,23 +75,25 @@ export const serializeAws_restJson1GetDASHStreamingSessionURLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getDASHStreamingSessionURL"; let body: any; body = JSON.stringify({ - ...(input.DASHFragmentSelector !== undefined && { - DASHFragmentSelector: serializeAws_restJson1DASHFragmentSelector(input.DASHFragmentSelector, context), - }), - ...(input.DisplayFragmentNumber !== undefined && { DisplayFragmentNumber: input.DisplayFragmentNumber }), - ...(input.DisplayFragmentTimestamp !== undefined && { DisplayFragmentTimestamp: input.DisplayFragmentTimestamp }), - ...(input.Expires !== undefined && { Expires: input.Expires }), - ...(input.MaxManifestFragmentResults !== undefined && { - MaxManifestFragmentResults: input.MaxManifestFragmentResults, - }), - ...(input.PlaybackMode !== undefined && { PlaybackMode: input.PlaybackMode }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.DASHFragmentSelector !== undefined && + input.DASHFragmentSelector !== null && { + DASHFragmentSelector: serializeAws_restJson1DASHFragmentSelector(input.DASHFragmentSelector, context), + }), + ...(input.DisplayFragmentNumber !== undefined && + input.DisplayFragmentNumber !== null && { DisplayFragmentNumber: input.DisplayFragmentNumber }), + ...(input.DisplayFragmentTimestamp !== undefined && + input.DisplayFragmentTimestamp !== null && { DisplayFragmentTimestamp: input.DisplayFragmentTimestamp }), + ...(input.Expires !== undefined && input.Expires !== null && { Expires: input.Expires }), + ...(input.MaxManifestFragmentResults !== undefined && + input.MaxManifestFragmentResults !== null && { MaxManifestFragmentResults: input.MaxManifestFragmentResults }), + ...(input.PlaybackMode !== undefined && input.PlaybackMode !== null && { PlaybackMode: input.PlaybackMode }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -109,24 +112,29 @@ export const serializeAws_restJson1GetHLSStreamingSessionURLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getHLSStreamingSessionURL"; let body: any; body = JSON.stringify({ - ...(input.ContainerFormat !== undefined && { ContainerFormat: input.ContainerFormat }), - ...(input.DiscontinuityMode !== undefined && { DiscontinuityMode: input.DiscontinuityMode }), - ...(input.DisplayFragmentTimestamp !== undefined && { DisplayFragmentTimestamp: input.DisplayFragmentTimestamp }), - ...(input.Expires !== undefined && { Expires: input.Expires }), - ...(input.HLSFragmentSelector !== undefined && { - HLSFragmentSelector: serializeAws_restJson1HLSFragmentSelector(input.HLSFragmentSelector, context), - }), - ...(input.MaxMediaPlaylistFragmentResults !== undefined && { - MaxMediaPlaylistFragmentResults: input.MaxMediaPlaylistFragmentResults, - }), - ...(input.PlaybackMode !== undefined && { PlaybackMode: input.PlaybackMode }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.ContainerFormat !== undefined && + input.ContainerFormat !== null && { ContainerFormat: input.ContainerFormat }), + ...(input.DiscontinuityMode !== undefined && + input.DiscontinuityMode !== null && { DiscontinuityMode: input.DiscontinuityMode }), + ...(input.DisplayFragmentTimestamp !== undefined && + input.DisplayFragmentTimestamp !== null && { DisplayFragmentTimestamp: input.DisplayFragmentTimestamp }), + ...(input.Expires !== undefined && input.Expires !== null && { Expires: input.Expires }), + ...(input.HLSFragmentSelector !== undefined && + input.HLSFragmentSelector !== null && { + HLSFragmentSelector: serializeAws_restJson1HLSFragmentSelector(input.HLSFragmentSelector, context), + }), + ...(input.MaxMediaPlaylistFragmentResults !== undefined && + input.MaxMediaPlaylistFragmentResults !== null && { + MaxMediaPlaylistFragmentResults: input.MaxMediaPlaylistFragmentResults, + }), + ...(input.PlaybackMode !== undefined && input.PlaybackMode !== null && { PlaybackMode: input.PlaybackMode }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -145,15 +153,14 @@ export const serializeAws_restJson1GetMediaForFragmentListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getMediaForFragmentList"; let body: any; body = JSON.stringify({ - ...(input.Fragments !== undefined && { - Fragments: serializeAws_restJson1FragmentNumberList(input.Fragments, context), - }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.Fragments !== undefined && + input.Fragments !== null && { Fragments: serializeAws_restJson1FragmentNumberList(input.Fragments, context) }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -172,17 +179,18 @@ export const serializeAws_restJson1ListFragmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listFragments"; let body: any; body = JSON.stringify({ - ...(input.FragmentSelector !== undefined && { - FragmentSelector: serializeAws_restJson1FragmentSelector(input.FragmentSelector, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.FragmentSelector !== undefined && + input.FragmentSelector !== null && { + FragmentSelector: serializeAws_restJson1FragmentSelector(input.FragmentSelector, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -858,69 +866,92 @@ const deserializeAws_restJson1UnsupportedStreamMediaTypeExceptionResponse = asyn const serializeAws_restJson1ClipFragmentSelector = (input: ClipFragmentSelector, context: __SerdeContext): any => { return { - ...(input.FragmentSelectorType !== undefined && { FragmentSelectorType: input.FragmentSelectorType }), - ...(input.TimestampRange !== undefined && { - TimestampRange: serializeAws_restJson1ClipTimestampRange(input.TimestampRange, context), - }), + ...(input.FragmentSelectorType !== undefined && + input.FragmentSelectorType !== null && { FragmentSelectorType: input.FragmentSelectorType }), + ...(input.TimestampRange !== undefined && + input.TimestampRange !== null && { + TimestampRange: serializeAws_restJson1ClipTimestampRange(input.TimestampRange, context), + }), }; }; const serializeAws_restJson1ClipTimestampRange = (input: ClipTimestampRange, context: __SerdeContext): any => { return { - ...(input.EndTimestamp !== undefined && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }), - ...(input.StartTimestamp !== undefined && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), + ...(input.EndTimestamp !== undefined && + input.EndTimestamp !== null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }), + ...(input.StartTimestamp !== undefined && + input.StartTimestamp !== null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), }; }; const serializeAws_restJson1DASHFragmentSelector = (input: DASHFragmentSelector, context: __SerdeContext): any => { return { - ...(input.FragmentSelectorType !== undefined && { FragmentSelectorType: input.FragmentSelectorType }), - ...(input.TimestampRange !== undefined && { - TimestampRange: serializeAws_restJson1DASHTimestampRange(input.TimestampRange, context), - }), + ...(input.FragmentSelectorType !== undefined && + input.FragmentSelectorType !== null && { FragmentSelectorType: input.FragmentSelectorType }), + ...(input.TimestampRange !== undefined && + input.TimestampRange !== null && { + TimestampRange: serializeAws_restJson1DASHTimestampRange(input.TimestampRange, context), + }), }; }; const serializeAws_restJson1DASHTimestampRange = (input: DASHTimestampRange, context: __SerdeContext): any => { return { - ...(input.EndTimestamp !== undefined && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }), - ...(input.StartTimestamp !== undefined && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), + ...(input.EndTimestamp !== undefined && + input.EndTimestamp !== null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }), + ...(input.StartTimestamp !== undefined && + input.StartTimestamp !== null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), }; }; const serializeAws_restJson1FragmentNumberList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1FragmentSelector = (input: FragmentSelector, context: __SerdeContext): any => { return { - ...(input.FragmentSelectorType !== undefined && { FragmentSelectorType: input.FragmentSelectorType }), - ...(input.TimestampRange !== undefined && { - TimestampRange: serializeAws_restJson1TimestampRange(input.TimestampRange, context), - }), + ...(input.FragmentSelectorType !== undefined && + input.FragmentSelectorType !== null && { FragmentSelectorType: input.FragmentSelectorType }), + ...(input.TimestampRange !== undefined && + input.TimestampRange !== null && { + TimestampRange: serializeAws_restJson1TimestampRange(input.TimestampRange, context), + }), }; }; const serializeAws_restJson1HLSFragmentSelector = (input: HLSFragmentSelector, context: __SerdeContext): any => { return { - ...(input.FragmentSelectorType !== undefined && { FragmentSelectorType: input.FragmentSelectorType }), - ...(input.TimestampRange !== undefined && { - TimestampRange: serializeAws_restJson1HLSTimestampRange(input.TimestampRange, context), - }), + ...(input.FragmentSelectorType !== undefined && + input.FragmentSelectorType !== null && { FragmentSelectorType: input.FragmentSelectorType }), + ...(input.TimestampRange !== undefined && + input.TimestampRange !== null && { + TimestampRange: serializeAws_restJson1HLSTimestampRange(input.TimestampRange, context), + }), }; }; const serializeAws_restJson1HLSTimestampRange = (input: HLSTimestampRange, context: __SerdeContext): any => { return { - ...(input.EndTimestamp !== undefined && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }), - ...(input.StartTimestamp !== undefined && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), + ...(input.EndTimestamp !== undefined && + input.EndTimestamp !== null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }), + ...(input.StartTimestamp !== undefined && + input.StartTimestamp !== null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), }; }; const serializeAws_restJson1TimestampRange = (input: TimestampRange, context: __SerdeContext): any => { return { - ...(input.EndTimestamp !== undefined && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }), - ...(input.StartTimestamp !== undefined && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), + ...(input.EndTimestamp !== undefined && + input.EndTimestamp !== null && { EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) }), + ...(input.StartTimestamp !== undefined && + input.StartTimestamp !== null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), }; }; @@ -948,7 +979,14 @@ const deserializeAws_restJson1Fragment = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1FragmentList = (output: any, context: __SerdeContext): Fragment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Fragment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Fragment(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -971,6 +1009,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-kinesis-video-media/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-media/protocols/Aws_restJson1.ts index 21b1cc100855..92ddd57d0e4c 100644 --- a/clients/client-kinesis-video-media/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-media/protocols/Aws_restJson1.ts @@ -22,16 +22,17 @@ export const serializeAws_restJson1GetMediaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getMedia"; let body: any; body = JSON.stringify({ - ...(input.StartSelector !== undefined && { - StartSelector: serializeAws_restJson1StartSelector(input.StartSelector, context), - }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.StartSelector !== undefined && + input.StartSelector !== null && { + StartSelector: serializeAws_restJson1StartSelector(input.StartSelector, context), + }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -246,10 +247,14 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( const serializeAws_restJson1StartSelector = (input: StartSelector, context: __SerdeContext): any => { return { - ...(input.AfterFragmentNumber !== undefined && { AfterFragmentNumber: input.AfterFragmentNumber }), - ...(input.ContinuationToken !== undefined && { ContinuationToken: input.ContinuationToken }), - ...(input.StartSelectorType !== undefined && { StartSelectorType: input.StartSelectorType }), - ...(input.StartTimestamp !== undefined && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), + ...(input.AfterFragmentNumber !== undefined && + input.AfterFragmentNumber !== null && { AfterFragmentNumber: input.AfterFragmentNumber }), + ...(input.ContinuationToken !== undefined && + input.ContinuationToken !== null && { ContinuationToken: input.ContinuationToken }), + ...(input.StartSelectorType !== undefined && + input.StartSelectorType !== null && { StartSelectorType: input.StartSelectorType }), + ...(input.StartTimestamp !== undefined && + input.StartTimestamp !== null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }), }; }; @@ -273,6 +278,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-kinesis-video-signaling/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-signaling/protocols/Aws_restJson1.ts index ad7e520788db..d18667dbe483 100644 --- a/clients/client-kinesis-video-signaling/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-signaling/protocols/Aws_restJson1.ts @@ -26,15 +26,15 @@ export const serializeAws_restJson1GetIceServerConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/get-ice-server-config"; let body: any; body = JSON.stringify({ - ...(input.ChannelARN !== undefined && { ChannelARN: input.ChannelARN }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.Service !== undefined && { Service: input.Service }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.ChannelARN !== undefined && input.ChannelARN !== null && { ChannelARN: input.ChannelARN }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.Service !== undefined && input.Service !== null && { Service: input.Service }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -53,14 +53,16 @@ export const serializeAws_restJson1SendAlexaOfferToMasterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/send-alexa-offer-to-master"; let body: any; body = JSON.stringify({ - ...(input.ChannelARN !== undefined && { ChannelARN: input.ChannelARN }), - ...(input.MessagePayload !== undefined && { MessagePayload: input.MessagePayload }), - ...(input.SenderClientId !== undefined && { SenderClientId: input.SenderClientId }), + ...(input.ChannelARN !== undefined && input.ChannelARN !== null && { ChannelARN: input.ChannelARN }), + ...(input.MessagePayload !== undefined && + input.MessagePayload !== null && { MessagePayload: input.MessagePayload }), + ...(input.SenderClientId !== undefined && + input.SenderClientId !== null && { SenderClientId: input.SenderClientId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -363,11 +365,25 @@ const deserializeAws_restJson1IceServer = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1IceServerList = (output: any, context: __SerdeContext): IceServer[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IceServer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IceServer(entry, context); + }); }; const deserializeAws_restJson1Uris = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -390,6 +406,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-kinesis-video/protocols/Aws_restJson1.ts b/clients/client-kinesis-video/protocols/Aws_restJson1.ts index d912b389c5d6..ca6117a62e36 100644 --- a/clients/client-kinesis-video/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video/protocols/Aws_restJson1.ts @@ -79,20 +79,22 @@ export const serializeAws_restJson1CreateSignalingChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createSignalingChannel"; let body: any; body = JSON.stringify({ - ...(input.ChannelName !== undefined && { ChannelName: input.ChannelName }), - ...(input.ChannelType !== undefined && { ChannelType: input.ChannelType }), - ...(input.SingleMasterConfiguration !== undefined && { - SingleMasterConfiguration: serializeAws_restJson1SingleMasterConfiguration( - input.SingleMasterConfiguration, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagOnCreateList(input.Tags, context) }), + ...(input.ChannelName !== undefined && input.ChannelName !== null && { ChannelName: input.ChannelName }), + ...(input.ChannelType !== undefined && input.ChannelType !== null && { ChannelType: input.ChannelType }), + ...(input.SingleMasterConfiguration !== undefined && + input.SingleMasterConfiguration !== null && { + SingleMasterConfiguration: serializeAws_restJson1SingleMasterConfiguration( + input.SingleMasterConfiguration, + context + ), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagOnCreateList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -111,17 +113,19 @@ export const serializeAws_restJson1CreateStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createStream"; let body: any; body = JSON.stringify({ - ...(input.DataRetentionInHours !== undefined && { DataRetentionInHours: input.DataRetentionInHours }), - ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.MediaType !== undefined && { MediaType: input.MediaType }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1ResourceTags(input.Tags, context) }), + ...(input.DataRetentionInHours !== undefined && + input.DataRetentionInHours !== null && { DataRetentionInHours: input.DataRetentionInHours }), + ...(input.DeviceName !== undefined && input.DeviceName !== null && { DeviceName: input.DeviceName }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.MediaType !== undefined && input.MediaType !== null && { MediaType: input.MediaType }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1ResourceTags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -140,13 +144,14 @@ export const serializeAws_restJson1DeleteSignalingChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteSignalingChannel"; let body: any; body = JSON.stringify({ - ...(input.ChannelARN !== undefined && { ChannelARN: input.ChannelARN }), - ...(input.CurrentVersion !== undefined && { CurrentVersion: input.CurrentVersion }), + ...(input.ChannelARN !== undefined && input.ChannelARN !== null && { ChannelARN: input.ChannelARN }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { CurrentVersion: input.CurrentVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -165,13 +170,14 @@ export const serializeAws_restJson1DeleteStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteStream"; let body: any; body = JSON.stringify({ - ...(input.CurrentVersion !== undefined && { CurrentVersion: input.CurrentVersion }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { CurrentVersion: input.CurrentVersion }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -190,13 +196,13 @@ export const serializeAws_restJson1DescribeSignalingChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeSignalingChannel"; let body: any; body = JSON.stringify({ - ...(input.ChannelARN !== undefined && { ChannelARN: input.ChannelARN }), - ...(input.ChannelName !== undefined && { ChannelName: input.ChannelName }), + ...(input.ChannelARN !== undefined && input.ChannelARN !== null && { ChannelARN: input.ChannelARN }), + ...(input.ChannelName !== undefined && input.ChannelName !== null && { ChannelName: input.ChannelName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -215,13 +221,13 @@ export const serializeAws_restJson1DescribeStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeStream"; let body: any; body = JSON.stringify({ - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -240,14 +246,14 @@ export const serializeAws_restJson1GetDataEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getDataEndpoint"; let body: any; body = JSON.stringify({ - ...(input.APIName !== undefined && { APIName: input.APIName }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.APIName !== undefined && input.APIName !== null && { APIName: input.APIName }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -266,18 +272,19 @@ export const serializeAws_restJson1GetSignalingChannelEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getSignalingChannelEndpoint"; let body: any; body = JSON.stringify({ - ...(input.ChannelARN !== undefined && { ChannelARN: input.ChannelARN }), - ...(input.SingleMasterChannelEndpointConfiguration !== undefined && { - SingleMasterChannelEndpointConfiguration: serializeAws_restJson1SingleMasterChannelEndpointConfiguration( - input.SingleMasterChannelEndpointConfiguration, - context - ), - }), + ...(input.ChannelARN !== undefined && input.ChannelARN !== null && { ChannelARN: input.ChannelARN }), + ...(input.SingleMasterChannelEndpointConfiguration !== undefined && + input.SingleMasterChannelEndpointConfiguration !== null && { + SingleMasterChannelEndpointConfiguration: serializeAws_restJson1SingleMasterChannelEndpointConfiguration( + input.SingleMasterChannelEndpointConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -296,16 +303,17 @@ export const serializeAws_restJson1ListSignalingChannelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listSignalingChannels"; let body: any; body = JSON.stringify({ - ...(input.ChannelNameCondition !== undefined && { - ChannelNameCondition: serializeAws_restJson1ChannelNameCondition(input.ChannelNameCondition, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ChannelNameCondition !== undefined && + input.ChannelNameCondition !== null && { + ChannelNameCondition: serializeAws_restJson1ChannelNameCondition(input.ChannelNameCondition, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -324,16 +332,17 @@ export const serializeAws_restJson1ListStreamsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listStreams"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StreamNameCondition !== undefined && { - StreamNameCondition: serializeAws_restJson1StreamNameCondition(input.StreamNameCondition, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StreamNameCondition !== undefined && + input.StreamNameCondition !== null && { + StreamNameCondition: serializeAws_restJson1StreamNameCondition(input.StreamNameCondition, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -352,13 +361,13 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListTagsForResource"; let body: any; body = JSON.stringify({ - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -377,14 +386,14 @@ export const serializeAws_restJson1ListTagsForStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listTagsForStream"; let body: any; body = JSON.stringify({ - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -403,13 +412,14 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/TagResource"; let body: any; body = JSON.stringify({ - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -428,14 +438,15 @@ export const serializeAws_restJson1TagStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tagStream"; let body: any; body = JSON.stringify({ - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1ResourceTags(input.Tags, context) }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1ResourceTags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -454,13 +465,14 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UntagResource"; let body: any; body = JSON.stringify({ - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeyList !== undefined && { TagKeyList: serializeAws_restJson1TagKeyList(input.TagKeyList, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeyList !== undefined && + input.TagKeyList !== null && { TagKeyList: serializeAws_restJson1TagKeyList(input.TagKeyList, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -479,14 +491,15 @@ export const serializeAws_restJson1UntagStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/untagStream"; let body: any; body = JSON.stringify({ - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), - ...(input.TagKeyList !== undefined && { TagKeyList: serializeAws_restJson1TagKeyList(input.TagKeyList, context) }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), + ...(input.TagKeyList !== undefined && + input.TagKeyList !== null && { TagKeyList: serializeAws_restJson1TagKeyList(input.TagKeyList, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -505,18 +518,18 @@ export const serializeAws_restJson1UpdateDataRetentionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateDataRetention"; let body: any; body = JSON.stringify({ - ...(input.CurrentVersion !== undefined && { CurrentVersion: input.CurrentVersion }), - ...(input.DataRetentionChangeInHours !== undefined && { - DataRetentionChangeInHours: input.DataRetentionChangeInHours, - }), - ...(input.Operation !== undefined && { Operation: input.Operation }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { CurrentVersion: input.CurrentVersion }), + ...(input.DataRetentionChangeInHours !== undefined && + input.DataRetentionChangeInHours !== null && { DataRetentionChangeInHours: input.DataRetentionChangeInHours }), + ...(input.Operation !== undefined && input.Operation !== null && { Operation: input.Operation }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -535,19 +548,21 @@ export const serializeAws_restJson1UpdateSignalingChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateSignalingChannel"; let body: any; body = JSON.stringify({ - ...(input.ChannelARN !== undefined && { ChannelARN: input.ChannelARN }), - ...(input.CurrentVersion !== undefined && { CurrentVersion: input.CurrentVersion }), - ...(input.SingleMasterConfiguration !== undefined && { - SingleMasterConfiguration: serializeAws_restJson1SingleMasterConfiguration( - input.SingleMasterConfiguration, - context - ), - }), + ...(input.ChannelARN !== undefined && input.ChannelARN !== null && { ChannelARN: input.ChannelARN }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { CurrentVersion: input.CurrentVersion }), + ...(input.SingleMasterConfiguration !== undefined && + input.SingleMasterConfiguration !== null && { + SingleMasterConfiguration: serializeAws_restJson1SingleMasterConfiguration( + input.SingleMasterConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -566,16 +581,17 @@ export const serializeAws_restJson1UpdateStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateStream"; let body: any; body = JSON.stringify({ - ...(input.CurrentVersion !== undefined && { CurrentVersion: input.CurrentVersion }), - ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }), - ...(input.MediaType !== undefined && { MediaType: input.MediaType }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.CurrentVersion !== undefined && + input.CurrentVersion !== null && { CurrentVersion: input.CurrentVersion }), + ...(input.DeviceName !== undefined && input.DeviceName !== null && { DeviceName: input.DeviceName }), + ...(input.MediaType !== undefined && input.MediaType !== null && { MediaType: input.MediaType }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2437,23 +2453,34 @@ const deserializeAws_restJson1VersionMismatchExceptionResponse = async ( const serializeAws_restJson1ChannelNameCondition = (input: ChannelNameCondition, context: __SerdeContext): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.ComparisonValue !== undefined && { ComparisonValue: input.ComparisonValue }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.ComparisonValue !== undefined && + input.ComparisonValue !== null && { ComparisonValue: input.ComparisonValue }), }; }; const serializeAws_restJson1ListOfProtocols = (input: (ChannelProtocol | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResourceTags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1SingleMasterChannelEndpointConfiguration = ( @@ -2461,10 +2488,9 @@ const serializeAws_restJson1SingleMasterChannelEndpointConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Protocols !== undefined && { - Protocols: serializeAws_restJson1ListOfProtocols(input.Protocols, context), - }), - ...(input.Role !== undefined && { Role: input.Role }), + ...(input.Protocols !== undefined && + input.Protocols !== null && { Protocols: serializeAws_restJson1ListOfProtocols(input.Protocols, context) }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), }; }; @@ -2473,34 +2499,58 @@ const serializeAws_restJson1SingleMasterConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.MessageTtlSeconds !== undefined && { MessageTtlSeconds: input.MessageTtlSeconds }), + ...(input.MessageTtlSeconds !== undefined && + input.MessageTtlSeconds !== null && { MessageTtlSeconds: input.MessageTtlSeconds }), }; }; const serializeAws_restJson1StreamNameCondition = (input: StreamNameCondition, context: __SerdeContext): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.ComparisonValue !== undefined && { ComparisonValue: input.ComparisonValue }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.ComparisonValue !== undefined && + input.ComparisonValue !== null && { ComparisonValue: input.ComparisonValue }), }; }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TagOnCreateList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1ChannelInfo = (output: any, context: __SerdeContext): ChannelInfo => { @@ -2523,14 +2573,28 @@ const deserializeAws_restJson1ChannelInfo = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ChannelInfoList = (output: any, context: __SerdeContext): ChannelInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelInfo(entry, context); + }); }; const deserializeAws_restJson1ResourceEndpointList = ( output: any, context: __SerdeContext ): ResourceEndpointListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceEndpointListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceEndpointListItem(entry, context); + }); }; const deserializeAws_restJson1ResourceEndpointListItem = ( @@ -2545,13 +2609,15 @@ const deserializeAws_restJson1ResourceEndpointListItem = ( }; const deserializeAws_restJson1ResourceTags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1SingleMasterConfiguration = ( @@ -2587,7 +2653,14 @@ const deserializeAws_restJson1StreamInfo = (output: any, context: __SerdeContext }; const deserializeAws_restJson1StreamInfoList = (output: any, context: __SerdeContext): StreamInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StreamInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StreamInfo(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2610,6 +2683,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-kinesis/protocols/Aws_json1_1.ts b/clients/client-kinesis/protocols/Aws_json1_1.ts index 8ad9cb8c5427..7130a553ddc9 100644 --- a/clients/client-kinesis/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis/protocols/Aws_json1_1.ts @@ -155,7 +155,7 @@ export const serializeAws_json1_1AddTagsToStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.AddTagsToStream", }; let body: any; @@ -168,7 +168,7 @@ export const serializeAws_json1_1CreateStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.CreateStream", }; let body: any; @@ -181,7 +181,7 @@ export const serializeAws_json1_1DecreaseStreamRetentionPeriodCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.DecreaseStreamRetentionPeriod", }; let body: any; @@ -194,7 +194,7 @@ export const serializeAws_json1_1DeleteStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.DeleteStream", }; let body: any; @@ -207,7 +207,7 @@ export const serializeAws_json1_1DeregisterStreamConsumerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.DeregisterStreamConsumer", }; let body: any; @@ -220,7 +220,7 @@ export const serializeAws_json1_1DescribeLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.DescribeLimits", }; let body: any; @@ -233,7 +233,7 @@ export const serializeAws_json1_1DescribeStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.DescribeStream", }; let body: any; @@ -246,7 +246,7 @@ export const serializeAws_json1_1DescribeStreamConsumerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.DescribeStreamConsumer", }; let body: any; @@ -259,7 +259,7 @@ export const serializeAws_json1_1DescribeStreamSummaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.DescribeStreamSummary", }; let body: any; @@ -272,7 +272,7 @@ export const serializeAws_json1_1DisableEnhancedMonitoringCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.DisableEnhancedMonitoring", }; let body: any; @@ -285,7 +285,7 @@ export const serializeAws_json1_1EnableEnhancedMonitoringCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.EnableEnhancedMonitoring", }; let body: any; @@ -298,7 +298,7 @@ export const serializeAws_json1_1GetRecordsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.GetRecords", }; let body: any; @@ -311,7 +311,7 @@ export const serializeAws_json1_1GetShardIteratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.GetShardIterator", }; let body: any; @@ -324,7 +324,7 @@ export const serializeAws_json1_1IncreaseStreamRetentionPeriodCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.IncreaseStreamRetentionPeriod", }; let body: any; @@ -337,7 +337,7 @@ export const serializeAws_json1_1ListShardsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.ListShards", }; let body: any; @@ -350,7 +350,7 @@ export const serializeAws_json1_1ListStreamConsumersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.ListStreamConsumers", }; let body: any; @@ -363,7 +363,7 @@ export const serializeAws_json1_1ListStreamsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.ListStreams", }; let body: any; @@ -376,7 +376,7 @@ export const serializeAws_json1_1ListTagsForStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.ListTagsForStream", }; let body: any; @@ -389,7 +389,7 @@ export const serializeAws_json1_1MergeShardsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.MergeShards", }; let body: any; @@ -402,7 +402,7 @@ export const serializeAws_json1_1PutRecordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.PutRecord", }; let body: any; @@ -415,7 +415,7 @@ export const serializeAws_json1_1PutRecordsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.PutRecords", }; let body: any; @@ -428,7 +428,7 @@ export const serializeAws_json1_1RegisterStreamConsumerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.RegisterStreamConsumer", }; let body: any; @@ -441,7 +441,7 @@ export const serializeAws_json1_1RemoveTagsFromStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.RemoveTagsFromStream", }; let body: any; @@ -454,7 +454,7 @@ export const serializeAws_json1_1SplitShardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.SplitShard", }; let body: any; @@ -467,7 +467,7 @@ export const serializeAws_json1_1StartStreamEncryptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.StartStreamEncryption", }; let body: any; @@ -480,7 +480,7 @@ export const serializeAws_json1_1StopStreamEncryptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.StopStreamEncryption", }; let body: any; @@ -493,7 +493,7 @@ export const serializeAws_json1_1SubscribeToShardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.SubscribeToShard", }; let body: any; @@ -506,7 +506,7 @@ export const serializeAws_json1_1UpdateShardCountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Kinesis_20131202.UpdateShardCount", }; let body: any; @@ -538,8 +538,7 @@ const deserializeAws_json1_1AddTagsToStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -614,8 +613,7 @@ const deserializeAws_json1_1CreateStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -682,8 +680,7 @@ const deserializeAws_json1_1DecreaseStreamRetentionPeriodCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -758,8 +755,7 @@ const deserializeAws_json1_1DeleteStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.kinesis#LimitExceededException": @@ -826,8 +822,7 @@ const deserializeAws_json1_1DeregisterStreamConsumerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -897,8 +892,7 @@ const deserializeAws_json1_1DescribeLimitsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.kinesis#LimitExceededException": @@ -952,8 +946,7 @@ const deserializeAws_json1_1DescribeStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.kinesis#LimitExceededException": @@ -1015,8 +1008,7 @@ const deserializeAws_json1_1DescribeStreamConsumerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -1086,8 +1078,7 @@ const deserializeAws_json1_1DescribeStreamSummaryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.kinesis#LimitExceededException": @@ -1149,8 +1140,7 @@ const deserializeAws_json1_1DisableEnhancedMonitoringCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -1228,8 +1218,7 @@ const deserializeAws_json1_1EnableEnhancedMonitoringCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -1307,8 +1296,7 @@ const deserializeAws_json1_1GetRecordsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExpiredIteratorException": case "com.amazonaws.kinesis#ExpiredIteratorException": @@ -1434,8 +1422,7 @@ const deserializeAws_json1_1GetShardIteratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -1502,8 +1489,7 @@ const deserializeAws_json1_1IncreaseStreamRetentionPeriodCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -1581,8 +1567,7 @@ const deserializeAws_json1_1ListShardsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExpiredNextTokenException": case "com.amazonaws.kinesis#ExpiredNextTokenException": @@ -1668,8 +1653,7 @@ const deserializeAws_json1_1ListStreamConsumersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExpiredNextTokenException": case "com.amazonaws.kinesis#ExpiredNextTokenException": @@ -1755,8 +1739,7 @@ const deserializeAws_json1_1ListStreamsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.kinesis#LimitExceededException": @@ -1810,8 +1793,7 @@ const deserializeAws_json1_1ListTagsForStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -1878,8 +1860,7 @@ const deserializeAws_json1_1MergeShardsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -1957,8 +1938,7 @@ const deserializeAws_json1_1PutRecordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -2076,8 +2056,7 @@ const deserializeAws_json1_1PutRecordsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -2195,8 +2174,7 @@ const deserializeAws_json1_1RegisterStreamConsumerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -2271,8 +2249,7 @@ const deserializeAws_json1_1RemoveTagsFromStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -2347,8 +2324,7 @@ const deserializeAws_json1_1SplitShardCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -2423,8 +2399,7 @@ const deserializeAws_json1_1StartStreamEncryptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -2547,8 +2522,7 @@ const deserializeAws_json1_1StopStreamEncryptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -2626,8 +2600,7 @@ const deserializeAws_json1_1SubscribeToShardCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -2705,8 +2678,7 @@ const deserializeAws_json1_1UpdateShardCountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": @@ -2954,15 +2926,15 @@ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( const serializeAws_json1_1AddTagsToStreamInput = (input: AddTagsToStreamInput, context: __SerdeContext): any => { return { - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagMap(input.Tags, context) }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagMap(input.Tags, context) }), }; }; const serializeAws_json1_1CreateStreamInput = (input: CreateStreamInput, context: __SerdeContext): any => { return { - ...(input.ShardCount !== undefined && { ShardCount: input.ShardCount }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.ShardCount !== undefined && input.ShardCount !== null && { ShardCount: input.ShardCount }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; @@ -2971,15 +2943,17 @@ const serializeAws_json1_1DecreaseStreamRetentionPeriodInput = ( context: __SerdeContext ): any => { return { - ...(input.RetentionPeriodHours !== undefined && { RetentionPeriodHours: input.RetentionPeriodHours }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.RetentionPeriodHours !== undefined && + input.RetentionPeriodHours !== null && { RetentionPeriodHours: input.RetentionPeriodHours }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; const serializeAws_json1_1DeleteStreamInput = (input: DeleteStreamInput, context: __SerdeContext): any => { return { - ...(input.EnforceConsumerDeletion !== undefined && { EnforceConsumerDeletion: input.EnforceConsumerDeletion }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.EnforceConsumerDeletion !== undefined && + input.EnforceConsumerDeletion !== null && { EnforceConsumerDeletion: input.EnforceConsumerDeletion }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; @@ -2988,9 +2962,9 @@ const serializeAws_json1_1DeregisterStreamConsumerInput = ( context: __SerdeContext ): any => { return { - ...(input.ConsumerARN !== undefined && { ConsumerARN: input.ConsumerARN }), - ...(input.ConsumerName !== undefined && { ConsumerName: input.ConsumerName }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), + ...(input.ConsumerARN !== undefined && input.ConsumerARN !== null && { ConsumerARN: input.ConsumerARN }), + ...(input.ConsumerName !== undefined && input.ConsumerName !== null && { ConsumerName: input.ConsumerName }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), }; }; @@ -3003,17 +2977,18 @@ const serializeAws_json1_1DescribeStreamConsumerInput = ( context: __SerdeContext ): any => { return { - ...(input.ConsumerARN !== undefined && { ConsumerARN: input.ConsumerARN }), - ...(input.ConsumerName !== undefined && { ConsumerName: input.ConsumerName }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), + ...(input.ConsumerARN !== undefined && input.ConsumerARN !== null && { ConsumerARN: input.ConsumerARN }), + ...(input.ConsumerName !== undefined && input.ConsumerName !== null && { ConsumerName: input.ConsumerName }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), }; }; const serializeAws_json1_1DescribeStreamInput = (input: DescribeStreamInput, context: __SerdeContext): any => { return { - ...(input.ExclusiveStartShardId !== undefined && { ExclusiveStartShardId: input.ExclusiveStartShardId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.ExclusiveStartShardId !== undefined && + input.ExclusiveStartShardId !== null && { ExclusiveStartShardId: input.ExclusiveStartShardId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; @@ -3022,7 +2997,7 @@ const serializeAws_json1_1DescribeStreamSummaryInput = ( context: __SerdeContext ): any => { return { - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; @@ -3031,10 +3006,11 @@ const serializeAws_json1_1DisableEnhancedMonitoringInput = ( context: __SerdeContext ): any => { return { - ...(input.ShardLevelMetrics !== undefined && { - ShardLevelMetrics: serializeAws_json1_1MetricsNameList(input.ShardLevelMetrics, context), - }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.ShardLevelMetrics !== undefined && + input.ShardLevelMetrics !== null && { + ShardLevelMetrics: serializeAws_json1_1MetricsNameList(input.ShardLevelMetrics, context), + }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; @@ -3043,27 +3019,31 @@ const serializeAws_json1_1EnableEnhancedMonitoringInput = ( context: __SerdeContext ): any => { return { - ...(input.ShardLevelMetrics !== undefined && { - ShardLevelMetrics: serializeAws_json1_1MetricsNameList(input.ShardLevelMetrics, context), - }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.ShardLevelMetrics !== undefined && + input.ShardLevelMetrics !== null && { + ShardLevelMetrics: serializeAws_json1_1MetricsNameList(input.ShardLevelMetrics, context), + }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; const serializeAws_json1_1GetRecordsInput = (input: GetRecordsInput, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.ShardIterator !== undefined && { ShardIterator: input.ShardIterator }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.ShardIterator !== undefined && input.ShardIterator !== null && { ShardIterator: input.ShardIterator }), }; }; const serializeAws_json1_1GetShardIteratorInput = (input: GetShardIteratorInput, context: __SerdeContext): any => { return { - ...(input.ShardId !== undefined && { ShardId: input.ShardId }), - ...(input.ShardIteratorType !== undefined && { ShardIteratorType: input.ShardIteratorType }), - ...(input.StartingSequenceNumber !== undefined && { StartingSequenceNumber: input.StartingSequenceNumber }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), - ...(input.Timestamp !== undefined && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), + ...(input.ShardId !== undefined && input.ShardId !== null && { ShardId: input.ShardId }), + ...(input.ShardIteratorType !== undefined && + input.ShardIteratorType !== null && { ShardIteratorType: input.ShardIteratorType }), + ...(input.StartingSequenceNumber !== undefined && + input.StartingSequenceNumber !== null && { StartingSequenceNumber: input.StartingSequenceNumber }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), + ...(input.Timestamp !== undefined && + input.Timestamp !== null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), }; }; @@ -3072,23 +3052,25 @@ const serializeAws_json1_1IncreaseStreamRetentionPeriodInput = ( context: __SerdeContext ): any => { return { - ...(input.RetentionPeriodHours !== undefined && { RetentionPeriodHours: input.RetentionPeriodHours }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.RetentionPeriodHours !== undefined && + input.RetentionPeriodHours !== null && { RetentionPeriodHours: input.RetentionPeriodHours }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; const serializeAws_json1_1ListShardsInput = (input: ListShardsInput, context: __SerdeContext): any => { return { - ...(input.ExclusiveStartShardId !== undefined && { ExclusiveStartShardId: input.ExclusiveStartShardId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ShardFilter !== undefined && { - ShardFilter: serializeAws_json1_1ShardFilter(input.ShardFilter, context), - }), - ...(input.StreamCreationTimestamp !== undefined && { - StreamCreationTimestamp: Math.round(input.StreamCreationTimestamp.getTime() / 1000), - }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.ExclusiveStartShardId !== undefined && + input.ExclusiveStartShardId !== null && { ExclusiveStartShardId: input.ExclusiveStartShardId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ShardFilter !== undefined && + input.ShardFilter !== null && { ShardFilter: serializeAws_json1_1ShardFilter(input.ShardFilter, context) }), + ...(input.StreamCreationTimestamp !== undefined && + input.StreamCreationTimestamp !== null && { + StreamCreationTimestamp: Math.round(input.StreamCreationTimestamp.getTime() / 1000), + }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; @@ -3097,68 +3079,79 @@ const serializeAws_json1_1ListStreamConsumersInput = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), - ...(input.StreamCreationTimestamp !== undefined && { - StreamCreationTimestamp: Math.round(input.StreamCreationTimestamp.getTime() / 1000), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), + ...(input.StreamCreationTimestamp !== undefined && + input.StreamCreationTimestamp !== null && { + StreamCreationTimestamp: Math.round(input.StreamCreationTimestamp.getTime() / 1000), + }), }; }; const serializeAws_json1_1ListStreamsInput = (input: ListStreamsInput, context: __SerdeContext): any => { return { - ...(input.ExclusiveStartStreamName !== undefined && { ExclusiveStartStreamName: input.ExclusiveStartStreamName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.ExclusiveStartStreamName !== undefined && + input.ExclusiveStartStreamName !== null && { ExclusiveStartStreamName: input.ExclusiveStartStreamName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), }; }; const serializeAws_json1_1ListTagsForStreamInput = (input: ListTagsForStreamInput, context: __SerdeContext): any => { return { - ...(input.ExclusiveStartTagKey !== undefined && { ExclusiveStartTagKey: input.ExclusiveStartTagKey }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.ExclusiveStartTagKey !== undefined && + input.ExclusiveStartTagKey !== null && { ExclusiveStartTagKey: input.ExclusiveStartTagKey }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; const serializeAws_json1_1MergeShardsInput = (input: MergeShardsInput, context: __SerdeContext): any => { return { - ...(input.AdjacentShardToMerge !== undefined && { AdjacentShardToMerge: input.AdjacentShardToMerge }), - ...(input.ShardToMerge !== undefined && { ShardToMerge: input.ShardToMerge }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.AdjacentShardToMerge !== undefined && + input.AdjacentShardToMerge !== null && { AdjacentShardToMerge: input.AdjacentShardToMerge }), + ...(input.ShardToMerge !== undefined && input.ShardToMerge !== null && { ShardToMerge: input.ShardToMerge }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; const serializeAws_json1_1MetricsNameList = (input: (MetricsName | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutRecordInput = (input: PutRecordInput, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }), - ...(input.ExplicitHashKey !== undefined && { ExplicitHashKey: input.ExplicitHashKey }), - ...(input.PartitionKey !== undefined && { PartitionKey: input.PartitionKey }), - ...(input.SequenceNumberForOrdering !== undefined && { - SequenceNumberForOrdering: input.SequenceNumberForOrdering, - }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.Data !== undefined && input.Data !== null && { Data: context.base64Encoder(input.Data) }), + ...(input.ExplicitHashKey !== undefined && + input.ExplicitHashKey !== null && { ExplicitHashKey: input.ExplicitHashKey }), + ...(input.PartitionKey !== undefined && input.PartitionKey !== null && { PartitionKey: input.PartitionKey }), + ...(input.SequenceNumberForOrdering !== undefined && + input.SequenceNumberForOrdering !== null && { SequenceNumberForOrdering: input.SequenceNumberForOrdering }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; const serializeAws_json1_1PutRecordsInput = (input: PutRecordsInput, context: __SerdeContext): any => { return { - ...(input.Records !== undefined && { - Records: serializeAws_json1_1PutRecordsRequestEntryList(input.Records, context), - }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.Records !== undefined && + input.Records !== null && { Records: serializeAws_json1_1PutRecordsRequestEntryList(input.Records, context) }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; const serializeAws_json1_1PutRecordsRequestEntry = (input: PutRecordsRequestEntry, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }), - ...(input.ExplicitHashKey !== undefined && { ExplicitHashKey: input.ExplicitHashKey }), - ...(input.PartitionKey !== undefined && { PartitionKey: input.PartitionKey }), + ...(input.Data !== undefined && input.Data !== null && { Data: context.base64Encoder(input.Data) }), + ...(input.ExplicitHashKey !== undefined && + input.ExplicitHashKey !== null && { ExplicitHashKey: input.ExplicitHashKey }), + ...(input.PartitionKey !== undefined && input.PartitionKey !== null && { PartitionKey: input.PartitionKey }), }; }; @@ -3166,7 +3159,14 @@ const serializeAws_json1_1PutRecordsRequestEntryList = ( input: PutRecordsRequestEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1PutRecordsRequestEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PutRecordsRequestEntry(entry, context); + }); }; const serializeAws_json1_1RegisterStreamConsumerInput = ( @@ -3174,8 +3174,8 @@ const serializeAws_json1_1RegisterStreamConsumerInput = ( context: __SerdeContext ): any => { return { - ...(input.ConsumerName !== undefined && { ConsumerName: input.ConsumerName }), - ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }), + ...(input.ConsumerName !== undefined && input.ConsumerName !== null && { ConsumerName: input.ConsumerName }), + ...(input.StreamARN !== undefined && input.StreamARN !== null && { StreamARN: input.StreamARN }), }; }; @@ -3184,32 +3184,37 @@ const serializeAws_json1_1RemoveTagsFromStreamInput = ( context: __SerdeContext ): any => { return { - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1ShardFilter = (input: ShardFilter, context: __SerdeContext): any => { return { - ...(input.ShardId !== undefined && { ShardId: input.ShardId }), - ...(input.Timestamp !== undefined && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.ShardId !== undefined && input.ShardId !== null && { ShardId: input.ShardId }), + ...(input.Timestamp !== undefined && + input.Timestamp !== null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1SplitShardInput = (input: SplitShardInput, context: __SerdeContext): any => { return { - ...(input.NewStartingHashKey !== undefined && { NewStartingHashKey: input.NewStartingHashKey }), - ...(input.ShardToSplit !== undefined && { ShardToSplit: input.ShardToSplit }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.NewStartingHashKey !== undefined && + input.NewStartingHashKey !== null && { NewStartingHashKey: input.NewStartingHashKey }), + ...(input.ShardToSplit !== undefined && input.ShardToSplit !== null && { ShardToSplit: input.ShardToSplit }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; const serializeAws_json1_1StartingPosition = (input: StartingPosition, context: __SerdeContext): any => { return { - ...(input.SequenceNumber !== undefined && { SequenceNumber: input.SequenceNumber }), - ...(input.Timestamp !== undefined && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.SequenceNumber !== undefined && + input.SequenceNumber !== null && { SequenceNumber: input.SequenceNumber }), + ...(input.Timestamp !== undefined && + input.Timestamp !== null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -3218,9 +3223,10 @@ const serializeAws_json1_1StartStreamEncryptionInput = ( context: __SerdeContext ): any => { return { - ...(input.EncryptionType !== undefined && { EncryptionType: input.EncryptionType }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.EncryptionType !== undefined && + input.EncryptionType !== null && { EncryptionType: input.EncryptionType }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; @@ -3229,41 +3235,53 @@ const serializeAws_json1_1StopStreamEncryptionInput = ( context: __SerdeContext ): any => { return { - ...(input.EncryptionType !== undefined && { EncryptionType: input.EncryptionType }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.EncryptionType !== undefined && + input.EncryptionType !== null && { EncryptionType: input.EncryptionType }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), }; }; const serializeAws_json1_1SubscribeToShardInput = (input: SubscribeToShardInput, context: __SerdeContext): any => { return { - ...(input.ConsumerARN !== undefined && { ConsumerARN: input.ConsumerARN }), - ...(input.ShardId !== undefined && { ShardId: input.ShardId }), - ...(input.StartingPosition !== undefined && { - StartingPosition: serializeAws_json1_1StartingPosition(input.StartingPosition, context), - }), + ...(input.ConsumerARN !== undefined && input.ConsumerARN !== null && { ConsumerARN: input.ConsumerARN }), + ...(input.ShardId !== undefined && input.ShardId !== null && { ShardId: input.ShardId }), + ...(input.StartingPosition !== undefined && + input.StartingPosition !== null && { + StartingPosition: serializeAws_json1_1StartingPosition(input.StartingPosition, context), + }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1UpdateShardCountInput = (input: UpdateShardCountInput, context: __SerdeContext): any => { return { - ...(input.ScalingType !== undefined && { ScalingType: input.ScalingType }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), - ...(input.TargetShardCount !== undefined && { TargetShardCount: input.TargetShardCount }), + ...(input.ScalingType !== undefined && input.ScalingType !== null && { ScalingType: input.ScalingType }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), + ...(input.TargetShardCount !== undefined && + input.TargetShardCount !== null && { TargetShardCount: input.TargetShardCount }), }; }; @@ -3282,7 +3300,14 @@ const deserializeAws_json1_1ChildShard = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ChildShardList = (output: any, context: __SerdeContext): ChildShard[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ChildShard(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ChildShard(entry, context); + }); }; const deserializeAws_json1_1Consumer = (output: any, context: __SerdeContext): Consumer => { @@ -3313,7 +3338,14 @@ const deserializeAws_json1_1ConsumerDescription = (output: any, context: __Serde }; const deserializeAws_json1_1ConsumerList = (output: any, context: __SerdeContext): Consumer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Consumer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Consumer(entry, context); + }); }; const deserializeAws_json1_1DescribeLimitsOutput = (output: any, context: __SerdeContext): DescribeLimitsOutput => { @@ -3367,7 +3399,14 @@ const deserializeAws_json1_1EnhancedMetrics = (output: any, context: __SerdeCont }; const deserializeAws_json1_1EnhancedMonitoringList = (output: any, context: __SerdeContext): EnhancedMetrics[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EnhancedMetrics(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EnhancedMetrics(entry, context); + }); }; const deserializeAws_json1_1EnhancedMonitoringOutput = ( @@ -3556,7 +3595,14 @@ const deserializeAws_json1_1ListTagsForStreamOutput = ( }; const deserializeAws_json1_1MetricsNameList = (output: any, context: __SerdeContext): (MetricsName | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ProvisionedThroughputExceededException = ( @@ -3607,7 +3653,14 @@ const deserializeAws_json1_1PutRecordsResultEntryList = ( output: any, context: __SerdeContext ): PutRecordsResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PutRecordsResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PutRecordsResultEntry(entry, context); + }); }; const deserializeAws_json1_1_Record = (output: any, context: __SerdeContext): _Record => { @@ -3626,7 +3679,14 @@ const deserializeAws_json1_1_Record = (output: any, context: __SerdeContext): _R }; const deserializeAws_json1_1RecordList = (output: any, context: __SerdeContext): _Record[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1_Record(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1_Record(entry, context); + }); }; const deserializeAws_json1_1RegisterStreamConsumerOutput = ( @@ -3690,11 +3750,25 @@ const deserializeAws_json1_1Shard = (output: any, context: __SerdeContext): Shar }; const deserializeAws_json1_1ShardIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ShardList = (output: any, context: __SerdeContext): Shard[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Shard(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Shard(entry, context); + }); }; const deserializeAws_json1_1StreamDescription = (output: any, context: __SerdeContext): StreamDescription => { @@ -3757,7 +3831,14 @@ const deserializeAws_json1_1StreamDescriptionSummary = ( }; const deserializeAws_json1_1StreamNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SubscribeToShardEvent = (output: any, context: __SerdeContext): SubscribeToShardEvent => { @@ -3867,7 +3948,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1UpdateShardCountOutput = (output: any, context: __SerdeContext): UpdateShardCountOutput => { @@ -3932,3 +4020,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-kms/protocols/Aws_json1_1.ts b/clients/client-kms/protocols/Aws_json1_1.ts index 589be61a14a0..3b5ce80729b5 100644 --- a/clients/client-kms/protocols/Aws_json1_1.ts +++ b/clients/client-kms/protocols/Aws_json1_1.ts @@ -226,7 +226,7 @@ export const serializeAws_json1_1CancelKeyDeletionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.CancelKeyDeletion", }; let body: any; @@ -239,7 +239,7 @@ export const serializeAws_json1_1ConnectCustomKeyStoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ConnectCustomKeyStore", }; let body: any; @@ -252,7 +252,7 @@ export const serializeAws_json1_1CreateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.CreateAlias", }; let body: any; @@ -265,7 +265,7 @@ export const serializeAws_json1_1CreateCustomKeyStoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.CreateCustomKeyStore", }; let body: any; @@ -278,7 +278,7 @@ export const serializeAws_json1_1CreateGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.CreateGrant", }; let body: any; @@ -291,7 +291,7 @@ export const serializeAws_json1_1CreateKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.CreateKey", }; let body: any; @@ -304,7 +304,7 @@ export const serializeAws_json1_1DecryptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.Decrypt", }; let body: any; @@ -317,7 +317,7 @@ export const serializeAws_json1_1DeleteAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.DeleteAlias", }; let body: any; @@ -330,7 +330,7 @@ export const serializeAws_json1_1DeleteCustomKeyStoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.DeleteCustomKeyStore", }; let body: any; @@ -343,7 +343,7 @@ export const serializeAws_json1_1DeleteImportedKeyMaterialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.DeleteImportedKeyMaterial", }; let body: any; @@ -356,7 +356,7 @@ export const serializeAws_json1_1DescribeCustomKeyStoresCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.DescribeCustomKeyStores", }; let body: any; @@ -369,7 +369,7 @@ export const serializeAws_json1_1DescribeKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.DescribeKey", }; let body: any; @@ -382,7 +382,7 @@ export const serializeAws_json1_1DisableKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.DisableKey", }; let body: any; @@ -395,7 +395,7 @@ export const serializeAws_json1_1DisableKeyRotationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.DisableKeyRotation", }; let body: any; @@ -408,7 +408,7 @@ export const serializeAws_json1_1DisconnectCustomKeyStoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.DisconnectCustomKeyStore", }; let body: any; @@ -421,7 +421,7 @@ export const serializeAws_json1_1EnableKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.EnableKey", }; let body: any; @@ -434,7 +434,7 @@ export const serializeAws_json1_1EnableKeyRotationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.EnableKeyRotation", }; let body: any; @@ -447,7 +447,7 @@ export const serializeAws_json1_1EncryptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.Encrypt", }; let body: any; @@ -460,7 +460,7 @@ export const serializeAws_json1_1GenerateDataKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.GenerateDataKey", }; let body: any; @@ -473,7 +473,7 @@ export const serializeAws_json1_1GenerateDataKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.GenerateDataKeyPair", }; let body: any; @@ -486,7 +486,7 @@ export const serializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.GenerateDataKeyPairWithoutPlaintext", }; let body: any; @@ -499,7 +499,7 @@ export const serializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.GenerateDataKeyWithoutPlaintext", }; let body: any; @@ -512,7 +512,7 @@ export const serializeAws_json1_1GenerateRandomCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.GenerateRandom", }; let body: any; @@ -525,7 +525,7 @@ export const serializeAws_json1_1GetKeyPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.GetKeyPolicy", }; let body: any; @@ -538,7 +538,7 @@ export const serializeAws_json1_1GetKeyRotationStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.GetKeyRotationStatus", }; let body: any; @@ -551,7 +551,7 @@ export const serializeAws_json1_1GetParametersForImportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.GetParametersForImport", }; let body: any; @@ -564,7 +564,7 @@ export const serializeAws_json1_1GetPublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.GetPublicKey", }; let body: any; @@ -577,7 +577,7 @@ export const serializeAws_json1_1ImportKeyMaterialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ImportKeyMaterial", }; let body: any; @@ -590,7 +590,7 @@ export const serializeAws_json1_1ListAliasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ListAliases", }; let body: any; @@ -603,7 +603,7 @@ export const serializeAws_json1_1ListGrantsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ListGrants", }; let body: any; @@ -616,7 +616,7 @@ export const serializeAws_json1_1ListKeyPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ListKeyPolicies", }; let body: any; @@ -629,7 +629,7 @@ export const serializeAws_json1_1ListKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ListKeys", }; let body: any; @@ -642,7 +642,7 @@ export const serializeAws_json1_1ListResourceTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ListResourceTags", }; let body: any; @@ -655,7 +655,7 @@ export const serializeAws_json1_1ListRetirableGrantsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ListRetirableGrants", }; let body: any; @@ -668,7 +668,7 @@ export const serializeAws_json1_1PutKeyPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.PutKeyPolicy", }; let body: any; @@ -681,7 +681,7 @@ export const serializeAws_json1_1ReEncryptCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ReEncrypt", }; let body: any; @@ -694,7 +694,7 @@ export const serializeAws_json1_1RetireGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.RetireGrant", }; let body: any; @@ -707,7 +707,7 @@ export const serializeAws_json1_1RevokeGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.RevokeGrant", }; let body: any; @@ -720,7 +720,7 @@ export const serializeAws_json1_1ScheduleKeyDeletionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.ScheduleKeyDeletion", }; let body: any; @@ -733,7 +733,7 @@ export const serializeAws_json1_1SignCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.Sign", }; let body: any; @@ -746,7 +746,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.TagResource", }; let body: any; @@ -759,7 +759,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.UntagResource", }; let body: any; @@ -772,7 +772,7 @@ export const serializeAws_json1_1UpdateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.UpdateAlias", }; let body: any; @@ -785,7 +785,7 @@ export const serializeAws_json1_1UpdateCustomKeyStoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.UpdateCustomKeyStore", }; let body: any; @@ -798,7 +798,7 @@ export const serializeAws_json1_1UpdateKeyDescriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.UpdateKeyDescription", }; let body: any; @@ -811,7 +811,7 @@ export const serializeAws_json1_1VerifyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TrentService.Verify", }; let body: any; @@ -846,8 +846,7 @@ const deserializeAws_json1_1CancelKeyDeletionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -933,8 +932,7 @@ const deserializeAws_json1_1ConnectCustomKeyStoreCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmClusterInvalidConfigurationException": case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException": @@ -1017,8 +1015,7 @@ const deserializeAws_json1_1CreateAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.kms#AlreadyExistsException": @@ -1120,8 +1117,7 @@ const deserializeAws_json1_1CreateCustomKeyStoreCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmClusterInUseException": case "com.amazonaws.kms#CloudHsmClusterInUseException": @@ -1223,8 +1219,7 @@ const deserializeAws_json1_1CreateGrantCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -1334,8 +1329,7 @@ const deserializeAws_json1_1CreateKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmClusterInvalidConfigurationException": case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException": @@ -1461,8 +1455,7 @@ const deserializeAws_json1_1DecryptCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -1585,8 +1578,7 @@ const deserializeAws_json1_1DeleteAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -1664,8 +1656,7 @@ const deserializeAws_json1_1DeleteCustomKeyStoreCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CustomKeyStoreHasCMKsException": case "com.amazonaws.kms#CustomKeyStoreHasCMKsException": @@ -1740,8 +1731,7 @@ const deserializeAws_json1_1DeleteImportedKeyMaterialCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -1835,8 +1825,7 @@ const deserializeAws_json1_1DescribeCustomKeyStoresCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CustomKeyStoreNotFoundException": case "com.amazonaws.kms#CustomKeyStoreNotFoundException": @@ -1898,8 +1887,7 @@ const deserializeAws_json1_1DescribeKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -1974,8 +1962,7 @@ const deserializeAws_json1_1DisableKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -2058,8 +2045,7 @@ const deserializeAws_json1_1DisableKeyRotationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -2161,8 +2147,7 @@ const deserializeAws_json1_1DisconnectCustomKeyStoreCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CustomKeyStoreInvalidStateException": case "com.amazonaws.kms#CustomKeyStoreInvalidStateException": @@ -2229,8 +2214,7 @@ const deserializeAws_json1_1EnableKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -2321,8 +2305,7 @@ const deserializeAws_json1_1EnableKeyRotationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -2424,8 +2407,7 @@ const deserializeAws_json1_1EncryptCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -2535,8 +2517,7 @@ const deserializeAws_json1_1GenerateDataKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -2646,8 +2627,7 @@ const deserializeAws_json1_1GenerateDataKeyPairCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -2765,8 +2745,7 @@ const deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -2884,8 +2863,7 @@ const deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -2995,8 +2973,7 @@ const deserializeAws_json1_1GenerateRandomCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CustomKeyStoreInvalidStateException": case "com.amazonaws.kms#CustomKeyStoreInvalidStateException": @@ -3074,8 +3051,7 @@ const deserializeAws_json1_1GetKeyPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -3161,8 +3137,7 @@ const deserializeAws_json1_1GetKeyRotationStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -3256,8 +3231,7 @@ const deserializeAws_json1_1GetParametersForImportCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -3351,8 +3325,7 @@ const deserializeAws_json1_1GetPublicKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -3478,8 +3451,7 @@ const deserializeAws_json1_1ImportKeyMaterialCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -3605,8 +3577,7 @@ const deserializeAws_json1_1ListAliasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -3692,8 +3663,7 @@ const deserializeAws_json1_1ListGrantsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -3787,8 +3757,7 @@ const deserializeAws_json1_1ListKeyPoliciesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -3874,8 +3843,7 @@ const deserializeAws_json1_1ListKeysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -3945,8 +3913,7 @@ const deserializeAws_json1_1ListResourceTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.kms#InvalidArnException": @@ -4024,8 +3991,7 @@ const deserializeAws_json1_1ListRetirableGrantsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -4108,8 +4074,7 @@ const deserializeAws_json1_1PutKeyPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -4219,8 +4184,7 @@ const deserializeAws_json1_1ReEncryptCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -4343,8 +4307,7 @@ const deserializeAws_json1_1RetireGrantCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -4443,8 +4406,7 @@ const deserializeAws_json1_1RevokeGrantCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -4538,8 +4500,7 @@ const deserializeAws_json1_1ScheduleKeyDeletionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -4625,8 +4586,7 @@ const deserializeAws_json1_1SignCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -4733,8 +4693,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.kms#InvalidArnException": @@ -4825,8 +4784,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArnException": case "com.amazonaws.kms#InvalidArnException": @@ -4909,8 +4867,7 @@ const deserializeAws_json1_1UpdateAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -4996,8 +4953,7 @@ const deserializeAws_json1_1UpdateCustomKeyStoreCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CloudHsmClusterInvalidConfigurationException": case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException": @@ -5104,8 +5060,7 @@ const deserializeAws_json1_1UpdateKeyDescriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -5191,8 +5146,7 @@ const deserializeAws_json1_1VerifyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DependencyTimeoutException": case "com.amazonaws.kms#DependencyTimeoutException": @@ -5783,7 +5737,7 @@ const serializeAws_json1_1CancelKeyDeletionRequest = ( context: __SerdeContext ): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; @@ -5792,14 +5746,15 @@ const serializeAws_json1_1ConnectCustomKeyStoreRequest = ( context: __SerdeContext ): any => { return { - ...(input.CustomKeyStoreId !== undefined && { CustomKeyStoreId: input.CustomKeyStoreId }), + ...(input.CustomKeyStoreId !== undefined && + input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }), }; }; const serializeAws_json1_1CreateAliasRequest = (input: CreateAliasRequest, context: __SerdeContext): any => { return { - ...(input.AliasName !== undefined && { AliasName: input.AliasName }), - ...(input.TargetKeyId !== undefined && { TargetKeyId: input.TargetKeyId }), + ...(input.AliasName !== undefined && input.AliasName !== null && { AliasName: input.AliasName }), + ...(input.TargetKeyId !== undefined && input.TargetKeyId !== null && { TargetKeyId: input.TargetKeyId }), }; }; @@ -5808,63 +5763,71 @@ const serializeAws_json1_1CreateCustomKeyStoreRequest = ( context: __SerdeContext ): any => { return { - ...(input.CloudHsmClusterId !== undefined && { CloudHsmClusterId: input.CloudHsmClusterId }), - ...(input.CustomKeyStoreName !== undefined && { CustomKeyStoreName: input.CustomKeyStoreName }), - ...(input.KeyStorePassword !== undefined && { KeyStorePassword: input.KeyStorePassword }), - ...(input.TrustAnchorCertificate !== undefined && { TrustAnchorCertificate: input.TrustAnchorCertificate }), + ...(input.CloudHsmClusterId !== undefined && + input.CloudHsmClusterId !== null && { CloudHsmClusterId: input.CloudHsmClusterId }), + ...(input.CustomKeyStoreName !== undefined && + input.CustomKeyStoreName !== null && { CustomKeyStoreName: input.CustomKeyStoreName }), + ...(input.KeyStorePassword !== undefined && + input.KeyStorePassword !== null && { KeyStorePassword: input.KeyStorePassword }), + ...(input.TrustAnchorCertificate !== undefined && + input.TrustAnchorCertificate !== null && { TrustAnchorCertificate: input.TrustAnchorCertificate }), }; }; const serializeAws_json1_1CreateGrantRequest = (input: CreateGrantRequest, context: __SerdeContext): any => { return { - ...(input.Constraints !== undefined && { - Constraints: serializeAws_json1_1GrantConstraints(input.Constraints, context), - }), - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.GranteePrincipal !== undefined && { GranteePrincipal: input.GranteePrincipal }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Operations !== undefined && { - Operations: serializeAws_json1_1GrantOperationList(input.Operations, context), - }), - ...(input.RetiringPrincipal !== undefined && { RetiringPrincipal: input.RetiringPrincipal }), + ...(input.Constraints !== undefined && + input.Constraints !== null && { Constraints: serializeAws_json1_1GrantConstraints(input.Constraints, context) }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.GranteePrincipal !== undefined && + input.GranteePrincipal !== null && { GranteePrincipal: input.GranteePrincipal }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Operations !== undefined && + input.Operations !== null && { Operations: serializeAws_json1_1GrantOperationList(input.Operations, context) }), + ...(input.RetiringPrincipal !== undefined && + input.RetiringPrincipal !== null && { RetiringPrincipal: input.RetiringPrincipal }), }; }; const serializeAws_json1_1CreateKeyRequest = (input: CreateKeyRequest, context: __SerdeContext): any => { return { - ...(input.BypassPolicyLockoutSafetyCheck !== undefined && { - BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck, - }), - ...(input.CustomKeyStoreId !== undefined && { CustomKeyStoreId: input.CustomKeyStoreId }), - ...(input.CustomerMasterKeySpec !== undefined && { CustomerMasterKeySpec: input.CustomerMasterKeySpec }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.KeyUsage !== undefined && { KeyUsage: input.KeyUsage }), - ...(input.Origin !== undefined && { Origin: input.Origin }), - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.BypassPolicyLockoutSafetyCheck !== undefined && + input.BypassPolicyLockoutSafetyCheck !== null && { + BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck, + }), + ...(input.CustomKeyStoreId !== undefined && + input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }), + ...(input.CustomerMasterKeySpec !== undefined && + input.CustomerMasterKeySpec !== null && { CustomerMasterKeySpec: input.CustomerMasterKeySpec }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.KeyUsage !== undefined && input.KeyUsage !== null && { KeyUsage: input.KeyUsage }), + ...(input.Origin !== undefined && input.Origin !== null && { Origin: input.Origin }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1DecryptRequest = (input: DecryptRequest, context: __SerdeContext): any => { return { - ...(input.CiphertextBlob !== undefined && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) }), - ...(input.EncryptionAlgorithm !== undefined && { EncryptionAlgorithm: input.EncryptionAlgorithm }), - ...(input.EncryptionContext !== undefined && { - EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), - }), - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.CiphertextBlob !== undefined && + input.CiphertextBlob !== null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) }), + ...(input.EncryptionAlgorithm !== undefined && + input.EncryptionAlgorithm !== null && { EncryptionAlgorithm: input.EncryptionAlgorithm }), + ...(input.EncryptionContext !== undefined && + input.EncryptionContext !== null && { + EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), + }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; const serializeAws_json1_1DeleteAliasRequest = (input: DeleteAliasRequest, context: __SerdeContext): any => { return { - ...(input.AliasName !== undefined && { AliasName: input.AliasName }), + ...(input.AliasName !== undefined && input.AliasName !== null && { AliasName: input.AliasName }), }; }; @@ -5873,7 +5836,8 @@ const serializeAws_json1_1DeleteCustomKeyStoreRequest = ( context: __SerdeContext ): any => { return { - ...(input.CustomKeyStoreId !== undefined && { CustomKeyStoreId: input.CustomKeyStoreId }), + ...(input.CustomKeyStoreId !== undefined && + input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }), }; }; @@ -5882,7 +5846,7 @@ const serializeAws_json1_1DeleteImportedKeyMaterialRequest = ( context: __SerdeContext ): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; @@ -5891,25 +5855,26 @@ const serializeAws_json1_1DescribeCustomKeyStoresRequest = ( context: __SerdeContext ): any => { return { - ...(input.CustomKeyStoreId !== undefined && { CustomKeyStoreId: input.CustomKeyStoreId }), - ...(input.CustomKeyStoreName !== undefined && { CustomKeyStoreName: input.CustomKeyStoreName }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.CustomKeyStoreId !== undefined && + input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }), + ...(input.CustomKeyStoreName !== undefined && + input.CustomKeyStoreName !== null && { CustomKeyStoreName: input.CustomKeyStoreName }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1DescribeKeyRequest = (input: DescribeKeyRequest, context: __SerdeContext): any => { return { - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; const serializeAws_json1_1DisableKeyRequest = (input: DisableKeyRequest, context: __SerdeContext): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; @@ -5918,7 +5883,7 @@ const serializeAws_json1_1DisableKeyRotationRequest = ( context: __SerdeContext ): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; @@ -5927,13 +5892,14 @@ const serializeAws_json1_1DisconnectCustomKeyStoreRequest = ( context: __SerdeContext ): any => { return { - ...(input.CustomKeyStoreId !== undefined && { CustomKeyStoreId: input.CustomKeyStoreId }), + ...(input.CustomKeyStoreId !== undefined && + input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }), }; }; const serializeAws_json1_1EnableKeyRequest = (input: EnableKeyRequest, context: __SerdeContext): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; @@ -5942,31 +5908,35 @@ const serializeAws_json1_1EnableKeyRotationRequest = ( context: __SerdeContext ): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; const serializeAws_json1_1EncryptionContextType = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1EncryptRequest = (input: EncryptRequest, context: __SerdeContext): any => { return { - ...(input.EncryptionAlgorithm !== undefined && { EncryptionAlgorithm: input.EncryptionAlgorithm }), - ...(input.EncryptionContext !== undefined && { - EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), - }), - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Plaintext !== undefined && { Plaintext: context.base64Encoder(input.Plaintext) }), + ...(input.EncryptionAlgorithm !== undefined && + input.EncryptionAlgorithm !== null && { EncryptionAlgorithm: input.EncryptionAlgorithm }), + ...(input.EncryptionContext !== undefined && + input.EncryptionContext !== null && { + EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), + }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Plaintext !== undefined && + input.Plaintext !== null && { Plaintext: context.base64Encoder(input.Plaintext) }), }; }; @@ -5975,14 +5945,14 @@ const serializeAws_json1_1GenerateDataKeyPairRequest = ( context: __SerdeContext ): any => { return { - ...(input.EncryptionContext !== undefined && { - EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), - }), - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.KeyPairSpec !== undefined && { KeyPairSpec: input.KeyPairSpec }), + ...(input.EncryptionContext !== undefined && + input.EncryptionContext !== null && { + EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), + }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.KeyPairSpec !== undefined && input.KeyPairSpec !== null && { KeyPairSpec: input.KeyPairSpec }), }; }; @@ -5991,28 +5961,28 @@ const serializeAws_json1_1GenerateDataKeyPairWithoutPlaintextRequest = ( context: __SerdeContext ): any => { return { - ...(input.EncryptionContext !== undefined && { - EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), - }), - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.KeyPairSpec !== undefined && { KeyPairSpec: input.KeyPairSpec }), + ...(input.EncryptionContext !== undefined && + input.EncryptionContext !== null && { + EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), + }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.KeyPairSpec !== undefined && input.KeyPairSpec !== null && { KeyPairSpec: input.KeyPairSpec }), }; }; const serializeAws_json1_1GenerateDataKeyRequest = (input: GenerateDataKeyRequest, context: __SerdeContext): any => { return { - ...(input.EncryptionContext !== undefined && { - EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), - }), - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.KeySpec !== undefined && { KeySpec: input.KeySpec }), - ...(input.NumberOfBytes !== undefined && { NumberOfBytes: input.NumberOfBytes }), + ...(input.EncryptionContext !== undefined && + input.EncryptionContext !== null && { + EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), + }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.KeySpec !== undefined && input.KeySpec !== null && { KeySpec: input.KeySpec }), + ...(input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }), }; }; @@ -6021,29 +5991,30 @@ const serializeAws_json1_1GenerateDataKeyWithoutPlaintextRequest = ( context: __SerdeContext ): any => { return { - ...(input.EncryptionContext !== undefined && { - EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), - }), - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.KeySpec !== undefined && { KeySpec: input.KeySpec }), - ...(input.NumberOfBytes !== undefined && { NumberOfBytes: input.NumberOfBytes }), + ...(input.EncryptionContext !== undefined && + input.EncryptionContext !== null && { + EncryptionContext: serializeAws_json1_1EncryptionContextType(input.EncryptionContext, context), + }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.KeySpec !== undefined && input.KeySpec !== null && { KeySpec: input.KeySpec }), + ...(input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }), }; }; const serializeAws_json1_1GenerateRandomRequest = (input: GenerateRandomRequest, context: __SerdeContext): any => { return { - ...(input.CustomKeyStoreId !== undefined && { CustomKeyStoreId: input.CustomKeyStoreId }), - ...(input.NumberOfBytes !== undefined && { NumberOfBytes: input.NumberOfBytes }), + ...(input.CustomKeyStoreId !== undefined && + input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }), + ...(input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }), }; }; const serializeAws_json1_1GetKeyPolicyRequest = (input: GetKeyPolicyRequest, context: __SerdeContext): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), }; }; @@ -6052,7 +6023,7 @@ const serializeAws_json1_1GetKeyRotationStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; @@ -6061,38 +6032,55 @@ const serializeAws_json1_1GetParametersForImportRequest = ( context: __SerdeContext ): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.WrappingAlgorithm !== undefined && { WrappingAlgorithm: input.WrappingAlgorithm }), - ...(input.WrappingKeySpec !== undefined && { WrappingKeySpec: input.WrappingKeySpec }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.WrappingAlgorithm !== undefined && + input.WrappingAlgorithm !== null && { WrappingAlgorithm: input.WrappingAlgorithm }), + ...(input.WrappingKeySpec !== undefined && + input.WrappingKeySpec !== null && { WrappingKeySpec: input.WrappingKeySpec }), }; }; const serializeAws_json1_1GetPublicKeyRequest = (input: GetPublicKeyRequest, context: __SerdeContext): any => { return { - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; const serializeAws_json1_1GrantConstraints = (input: GrantConstraints, context: __SerdeContext): any => { return { - ...(input.EncryptionContextEquals !== undefined && { - EncryptionContextEquals: serializeAws_json1_1EncryptionContextType(input.EncryptionContextEquals, context), - }), - ...(input.EncryptionContextSubset !== undefined && { - EncryptionContextSubset: serializeAws_json1_1EncryptionContextType(input.EncryptionContextSubset, context), - }), + ...(input.EncryptionContextEquals !== undefined && + input.EncryptionContextEquals !== null && { + EncryptionContextEquals: serializeAws_json1_1EncryptionContextType(input.EncryptionContextEquals, context), + }), + ...(input.EncryptionContextSubset !== undefined && + input.EncryptionContextSubset !== null && { + EncryptionContextSubset: serializeAws_json1_1EncryptionContextType(input.EncryptionContextSubset, context), + }), }; }; const serializeAws_json1_1GrantOperationList = (input: (GrantOperation | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GrantTokenList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ImportKeyMaterialRequest = ( @@ -6100,52 +6088,56 @@ const serializeAws_json1_1ImportKeyMaterialRequest = ( context: __SerdeContext ): any => { return { - ...(input.EncryptedKeyMaterial !== undefined && { - EncryptedKeyMaterial: context.base64Encoder(input.EncryptedKeyMaterial), - }), - ...(input.ExpirationModel !== undefined && { ExpirationModel: input.ExpirationModel }), - ...(input.ImportToken !== undefined && { ImportToken: context.base64Encoder(input.ImportToken) }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.ValidTo !== undefined && { ValidTo: Math.round(input.ValidTo.getTime() / 1000) }), + ...(input.EncryptedKeyMaterial !== undefined && + input.EncryptedKeyMaterial !== null && { + EncryptedKeyMaterial: context.base64Encoder(input.EncryptedKeyMaterial), + }), + ...(input.ExpirationModel !== undefined && + input.ExpirationModel !== null && { ExpirationModel: input.ExpirationModel }), + ...(input.ImportToken !== undefined && + input.ImportToken !== null && { ImportToken: context.base64Encoder(input.ImportToken) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.ValidTo !== undefined && + input.ValidTo !== null && { ValidTo: Math.round(input.ValidTo.getTime() / 1000) }), }; }; const serializeAws_json1_1ListAliasesRequest = (input: ListAliasesRequest, context: __SerdeContext): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListGrantsRequest = (input: ListGrantsRequest, context: __SerdeContext): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListKeyPoliciesRequest = (input: ListKeyPoliciesRequest, context: __SerdeContext): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListKeysRequest = (input: ListKeysRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListResourceTagsRequest = (input: ListResourceTagsRequest, context: __SerdeContext): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; @@ -6154,61 +6146,66 @@ const serializeAws_json1_1ListRetirableGrantsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.RetiringPrincipal !== undefined && { RetiringPrincipal: input.RetiringPrincipal }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.RetiringPrincipal !== undefined && + input.RetiringPrincipal !== null && { RetiringPrincipal: input.RetiringPrincipal }), }; }; const serializeAws_json1_1PutKeyPolicyRequest = (input: PutKeyPolicyRequest, context: __SerdeContext): any => { return { - ...(input.BypassPolicyLockoutSafetyCheck !== undefined && { - BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck, - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.BypassPolicyLockoutSafetyCheck !== undefined && + input.BypassPolicyLockoutSafetyCheck !== null && { + BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck, + }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), }; }; const serializeAws_json1_1ReEncryptRequest = (input: ReEncryptRequest, context: __SerdeContext): any => { return { - ...(input.CiphertextBlob !== undefined && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) }), - ...(input.DestinationEncryptionAlgorithm !== undefined && { - DestinationEncryptionAlgorithm: input.DestinationEncryptionAlgorithm, - }), - ...(input.DestinationEncryptionContext !== undefined && { - DestinationEncryptionContext: serializeAws_json1_1EncryptionContextType( - input.DestinationEncryptionContext, - context - ), - }), - ...(input.DestinationKeyId !== undefined && { DestinationKeyId: input.DestinationKeyId }), - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.SourceEncryptionAlgorithm !== undefined && { - SourceEncryptionAlgorithm: input.SourceEncryptionAlgorithm, - }), - ...(input.SourceEncryptionContext !== undefined && { - SourceEncryptionContext: serializeAws_json1_1EncryptionContextType(input.SourceEncryptionContext, context), - }), - ...(input.SourceKeyId !== undefined && { SourceKeyId: input.SourceKeyId }), + ...(input.CiphertextBlob !== undefined && + input.CiphertextBlob !== null && { CiphertextBlob: context.base64Encoder(input.CiphertextBlob) }), + ...(input.DestinationEncryptionAlgorithm !== undefined && + input.DestinationEncryptionAlgorithm !== null && { + DestinationEncryptionAlgorithm: input.DestinationEncryptionAlgorithm, + }), + ...(input.DestinationEncryptionContext !== undefined && + input.DestinationEncryptionContext !== null && { + DestinationEncryptionContext: serializeAws_json1_1EncryptionContextType( + input.DestinationEncryptionContext, + context + ), + }), + ...(input.DestinationKeyId !== undefined && + input.DestinationKeyId !== null && { DestinationKeyId: input.DestinationKeyId }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.SourceEncryptionAlgorithm !== undefined && + input.SourceEncryptionAlgorithm !== null && { SourceEncryptionAlgorithm: input.SourceEncryptionAlgorithm }), + ...(input.SourceEncryptionContext !== undefined && + input.SourceEncryptionContext !== null && { + SourceEncryptionContext: serializeAws_json1_1EncryptionContextType(input.SourceEncryptionContext, context), + }), + ...(input.SourceKeyId !== undefined && input.SourceKeyId !== null && { SourceKeyId: input.SourceKeyId }), }; }; const serializeAws_json1_1RetireGrantRequest = (input: RetireGrantRequest, context: __SerdeContext): any => { return { - ...(input.GrantId !== undefined && { GrantId: input.GrantId }), - ...(input.GrantToken !== undefined && { GrantToken: input.GrantToken }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.GrantId !== undefined && input.GrantId !== null && { GrantId: input.GrantId }), + ...(input.GrantToken !== undefined && input.GrantToken !== null && { GrantToken: input.GrantToken }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; const serializeAws_json1_1RevokeGrantRequest = (input: RevokeGrantRequest, context: __SerdeContext): any => { return { - ...(input.GrantId !== undefined && { GrantId: input.GrantId }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.GrantId !== undefined && input.GrantId !== null && { GrantId: input.GrantId }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; @@ -6217,56 +6214,72 @@ const serializeAws_json1_1ScheduleKeyDeletionRequest = ( context: __SerdeContext ): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.PendingWindowInDays !== undefined && { PendingWindowInDays: input.PendingWindowInDays }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.PendingWindowInDays !== undefined && + input.PendingWindowInDays !== null && { PendingWindowInDays: input.PendingWindowInDays }), }; }; const serializeAws_json1_1SignRequest = (input: SignRequest, context: __SerdeContext): any => { return { - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Message !== undefined && { Message: context.base64Encoder(input.Message) }), - ...(input.MessageType !== undefined && { MessageType: input.MessageType }), - ...(input.SigningAlgorithm !== undefined && { SigningAlgorithm: input.SigningAlgorithm }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }), + ...(input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType }), + ...(input.SigningAlgorithm !== undefined && + input.SigningAlgorithm !== null && { SigningAlgorithm: input.SigningAlgorithm }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.TagKey !== undefined && { TagKey: input.TagKey }), - ...(input.TagValue !== undefined && { TagValue: input.TagValue }), + ...(input.TagKey !== undefined && input.TagKey !== null && { TagKey: input.TagKey }), + ...(input.TagValue !== undefined && input.TagValue !== null && { TagValue: input.TagValue }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateAliasRequest = (input: UpdateAliasRequest, context: __SerdeContext): any => { return { - ...(input.AliasName !== undefined && { AliasName: input.AliasName }), - ...(input.TargetKeyId !== undefined && { TargetKeyId: input.TargetKeyId }), + ...(input.AliasName !== undefined && input.AliasName !== null && { AliasName: input.AliasName }), + ...(input.TargetKeyId !== undefined && input.TargetKeyId !== null && { TargetKeyId: input.TargetKeyId }), }; }; @@ -6275,10 +6288,14 @@ const serializeAws_json1_1UpdateCustomKeyStoreRequest = ( context: __SerdeContext ): any => { return { - ...(input.CloudHsmClusterId !== undefined && { CloudHsmClusterId: input.CloudHsmClusterId }), - ...(input.CustomKeyStoreId !== undefined && { CustomKeyStoreId: input.CustomKeyStoreId }), - ...(input.KeyStorePassword !== undefined && { KeyStorePassword: input.KeyStorePassword }), - ...(input.NewCustomKeyStoreName !== undefined && { NewCustomKeyStoreName: input.NewCustomKeyStoreName }), + ...(input.CloudHsmClusterId !== undefined && + input.CloudHsmClusterId !== null && { CloudHsmClusterId: input.CloudHsmClusterId }), + ...(input.CustomKeyStoreId !== undefined && + input.CustomKeyStoreId !== null && { CustomKeyStoreId: input.CustomKeyStoreId }), + ...(input.KeyStorePassword !== undefined && + input.KeyStorePassword !== null && { KeyStorePassword: input.KeyStorePassword }), + ...(input.NewCustomKeyStoreName !== undefined && + input.NewCustomKeyStoreName !== null && { NewCustomKeyStoreName: input.NewCustomKeyStoreName }), }; }; @@ -6287,26 +6304,34 @@ const serializeAws_json1_1UpdateKeyDescriptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), }; }; const serializeAws_json1_1VerifyRequest = (input: VerifyRequest, context: __SerdeContext): any => { return { - ...(input.GrantTokens !== undefined && { - GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context), - }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Message !== undefined && { Message: context.base64Encoder(input.Message) }), - ...(input.MessageType !== undefined && { MessageType: input.MessageType }), - ...(input.Signature !== undefined && { Signature: context.base64Encoder(input.Signature) }), - ...(input.SigningAlgorithm !== undefined && { SigningAlgorithm: input.SigningAlgorithm }), + ...(input.GrantTokens !== undefined && + input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }), + ...(input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType }), + ...(input.Signature !== undefined && + input.Signature !== null && { Signature: context.base64Encoder(input.Signature) }), + ...(input.SigningAlgorithm !== undefined && + input.SigningAlgorithm !== null && { SigningAlgorithm: input.SigningAlgorithm }), }; }; const deserializeAws_json1_1AliasList = (output: any, context: __SerdeContext): AliasListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AliasListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AliasListEntry(entry, context); + }); }; const deserializeAws_json1_1AliasListEntry = (output: any, context: __SerdeContext): AliasListEntry => { @@ -6450,7 +6475,14 @@ const deserializeAws_json1_1CustomKeyStoresList = ( output: any, context: __SerdeContext ): CustomKeyStoresListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CustomKeyStoresListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CustomKeyStoresListEntry(entry, context); + }); }; const deserializeAws_json1_1CustomKeyStoresListEntry = ( @@ -6553,20 +6585,29 @@ const deserializeAws_json1_1EncryptionAlgorithmSpecList = ( output: any, context: __SerdeContext ): (EncryptionAlgorithmSpec | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1EncryptionContextType = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1EncryptResponse = (output: any, context: __SerdeContext): EncryptResponse => { @@ -6735,7 +6776,14 @@ const deserializeAws_json1_1GrantConstraints = (output: any, context: __SerdeCon }; const deserializeAws_json1_1GrantList = (output: any, context: __SerdeContext): GrantListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GrantListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GrantListEntry(entry, context); + }); }; const deserializeAws_json1_1GrantListEntry = (output: any, context: __SerdeContext): GrantListEntry => { @@ -6770,7 +6818,14 @@ const deserializeAws_json1_1GrantOperationList = ( output: any, context: __SerdeContext ): (GrantOperation | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ImportKeyMaterialResponse = ( @@ -6871,7 +6926,14 @@ const deserializeAws_json1_1InvalidMarkerException = (output: any, context: __Se }; const deserializeAws_json1_1KeyList = (output: any, context: __SerdeContext): KeyListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyListEntry(entry, context); + }); }; const deserializeAws_json1_1KeyListEntry = (output: any, context: __SerdeContext): KeyListEntry => { @@ -7041,7 +7103,14 @@ const deserializeAws_json1_1NotFoundException = (output: any, context: __SerdeCo }; const deserializeAws_json1_1PolicyNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ReEncryptResponse = (output: any, context: __SerdeContext): ReEncryptResponse => { @@ -7080,7 +7149,14 @@ const deserializeAws_json1_1SigningAlgorithmSpecList = ( output: any, context: __SerdeContext ): (SigningAlgorithmSpec | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SignResponse = (output: any, context: __SerdeContext): SignResponse => { @@ -7107,7 +7183,14 @@ const deserializeAws_json1_1TagException = (output: any, context: __SerdeContext }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1UnsupportedOperationException = ( @@ -7186,3 +7269,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-lakeformation/protocols/Aws_json1_1.ts b/clients/client-lakeformation/protocols/Aws_json1_1.ts index f742555b63d6..a34cdf7b261b 100644 --- a/clients/client-lakeformation/protocols/Aws_json1_1.ts +++ b/clients/client-lakeformation/protocols/Aws_json1_1.ts @@ -94,7 +94,7 @@ export const serializeAws_json1_1BatchGrantPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.BatchGrantPermissions", }; let body: any; @@ -107,7 +107,7 @@ export const serializeAws_json1_1BatchRevokePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.BatchRevokePermissions", }; let body: any; @@ -120,7 +120,7 @@ export const serializeAws_json1_1DeregisterResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.DeregisterResource", }; let body: any; @@ -133,7 +133,7 @@ export const serializeAws_json1_1DescribeResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.DescribeResource", }; let body: any; @@ -146,7 +146,7 @@ export const serializeAws_json1_1GetDataLakeSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.GetDataLakeSettings", }; let body: any; @@ -159,7 +159,7 @@ export const serializeAws_json1_1GetEffectivePermissionsForPathCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.GetEffectivePermissionsForPath", }; let body: any; @@ -172,7 +172,7 @@ export const serializeAws_json1_1GrantPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.GrantPermissions", }; let body: any; @@ -185,7 +185,7 @@ export const serializeAws_json1_1ListPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.ListPermissions", }; let body: any; @@ -198,7 +198,7 @@ export const serializeAws_json1_1ListResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.ListResources", }; let body: any; @@ -211,7 +211,7 @@ export const serializeAws_json1_1PutDataLakeSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.PutDataLakeSettings", }; let body: any; @@ -224,7 +224,7 @@ export const serializeAws_json1_1RegisterResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.RegisterResource", }; let body: any; @@ -237,7 +237,7 @@ export const serializeAws_json1_1RevokePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.RevokePermissions", }; let body: any; @@ -250,7 +250,7 @@ export const serializeAws_json1_1UpdateResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLakeFormation.UpdateResource", }; let body: any; @@ -285,8 +285,7 @@ const deserializeAws_json1_1BatchGrantPermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.lakeformation#InvalidInputException": @@ -348,8 +347,7 @@ const deserializeAws_json1_1BatchRevokePermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.lakeformation#InvalidInputException": @@ -411,8 +409,7 @@ const deserializeAws_json1_1DeregisterResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.lakeformation#EntityNotFoundException": @@ -490,8 +487,7 @@ const deserializeAws_json1_1DescribeResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.lakeformation#EntityNotFoundException": @@ -569,8 +565,7 @@ const deserializeAws_json1_1GetDataLakeSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.lakeformation#EntityNotFoundException": @@ -640,8 +635,7 @@ const deserializeAws_json1_1GetEffectivePermissionsForPathCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.lakeformation#EntityNotFoundException": @@ -719,8 +713,7 @@ const deserializeAws_json1_1GrantPermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.lakeformation#ConcurrentModificationException": @@ -790,8 +783,7 @@ const deserializeAws_json1_1ListPermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.lakeformation#InternalServiceException": @@ -861,8 +853,7 @@ const deserializeAws_json1_1ListResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.lakeformation#InternalServiceException": @@ -932,8 +923,7 @@ const deserializeAws_json1_1PutDataLakeSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.lakeformation#InternalServiceException": @@ -995,8 +985,7 @@ const deserializeAws_json1_1RegisterResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.lakeformation#AlreadyExistsException": @@ -1074,8 +1063,7 @@ const deserializeAws_json1_1RevokePermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.lakeformation#ConcurrentModificationException": @@ -1145,8 +1133,7 @@ const deserializeAws_json1_1UpdateResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.lakeformation#EntityNotFoundException": @@ -1292,10 +1279,11 @@ const serializeAws_json1_1BatchGrantPermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.Entries !== undefined && { - Entries: serializeAws_json1_1BatchPermissionsRequestEntryList(input.Entries, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.Entries !== undefined && + input.Entries !== null && { + Entries: serializeAws_json1_1BatchPermissionsRequestEntryList(input.Entries, context), + }), }; }; @@ -1304,17 +1292,17 @@ const serializeAws_json1_1BatchPermissionsRequestEntry = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_json1_1PermissionList(input.Permissions, context), - }), - ...(input.PermissionsWithGrantOption !== undefined && { - PermissionsWithGrantOption: serializeAws_json1_1PermissionList(input.PermissionsWithGrantOption, context), - }), - ...(input.Principal !== undefined && { - Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context), - }), - ...(input.Resource !== undefined && { Resource: serializeAws_json1_1Resource(input.Resource, context) }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { Permissions: serializeAws_json1_1PermissionList(input.Permissions, context) }), + ...(input.PermissionsWithGrantOption !== undefined && + input.PermissionsWithGrantOption !== null && { + PermissionsWithGrantOption: serializeAws_json1_1PermissionList(input.PermissionsWithGrantOption, context), + }), + ...(input.Principal !== undefined && + input.Principal !== null && { Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context) }), + ...(input.Resource !== undefined && + input.Resource !== null && { Resource: serializeAws_json1_1Resource(input.Resource, context) }), }; }; @@ -1322,7 +1310,14 @@ const serializeAws_json1_1BatchPermissionsRequestEntryList = ( input: BatchPermissionsRequestEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1BatchPermissionsRequestEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1BatchPermissionsRequestEntry(entry, context); + }); }; const serializeAws_json1_1BatchRevokePermissionsRequest = ( @@ -1330,10 +1325,11 @@ const serializeAws_json1_1BatchRevokePermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.Entries !== undefined && { - Entries: serializeAws_json1_1BatchPermissionsRequestEntryList(input.Entries, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.Entries !== undefined && + input.Entries !== null && { + Entries: serializeAws_json1_1BatchPermissionsRequestEntryList(input.Entries, context), + }), }; }; @@ -1342,63 +1338,81 @@ const serializeAws_json1_1CatalogResource = (input: CatalogResource, context: __ }; const serializeAws_json1_1ColumnNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ColumnWildcard = (input: ColumnWildcard, context: __SerdeContext): any => { return { - ...(input.ExcludedColumnNames !== undefined && { - ExcludedColumnNames: serializeAws_json1_1ColumnNames(input.ExcludedColumnNames, context), - }), + ...(input.ExcludedColumnNames !== undefined && + input.ExcludedColumnNames !== null && { + ExcludedColumnNames: serializeAws_json1_1ColumnNames(input.ExcludedColumnNames, context), + }), }; }; const serializeAws_json1_1DatabaseResource = (input: DatabaseResource, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DataLakePrincipal = (input: DataLakePrincipal, context: __SerdeContext): any => { return { - ...(input.DataLakePrincipalIdentifier !== undefined && { - DataLakePrincipalIdentifier: input.DataLakePrincipalIdentifier, - }), + ...(input.DataLakePrincipalIdentifier !== undefined && + input.DataLakePrincipalIdentifier !== null && { DataLakePrincipalIdentifier: input.DataLakePrincipalIdentifier }), }; }; const serializeAws_json1_1DataLakePrincipalList = (input: DataLakePrincipal[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DataLakePrincipal(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DataLakePrincipal(entry, context); + }); }; const serializeAws_json1_1DataLakeSettings = (input: DataLakeSettings, context: __SerdeContext): any => { return { - ...(input.CreateDatabaseDefaultPermissions !== undefined && { - CreateDatabaseDefaultPermissions: serializeAws_json1_1PrincipalPermissionsList( - input.CreateDatabaseDefaultPermissions, - context - ), - }), - ...(input.CreateTableDefaultPermissions !== undefined && { - CreateTableDefaultPermissions: serializeAws_json1_1PrincipalPermissionsList( - input.CreateTableDefaultPermissions, - context - ), - }), - ...(input.DataLakeAdmins !== undefined && { - DataLakeAdmins: serializeAws_json1_1DataLakePrincipalList(input.DataLakeAdmins, context), - }), - ...(input.TrustedResourceOwners !== undefined && { - TrustedResourceOwners: serializeAws_json1_1TrustedResourceOwners(input.TrustedResourceOwners, context), - }), + ...(input.CreateDatabaseDefaultPermissions !== undefined && + input.CreateDatabaseDefaultPermissions !== null && { + CreateDatabaseDefaultPermissions: serializeAws_json1_1PrincipalPermissionsList( + input.CreateDatabaseDefaultPermissions, + context + ), + }), + ...(input.CreateTableDefaultPermissions !== undefined && + input.CreateTableDefaultPermissions !== null && { + CreateTableDefaultPermissions: serializeAws_json1_1PrincipalPermissionsList( + input.CreateTableDefaultPermissions, + context + ), + }), + ...(input.DataLakeAdmins !== undefined && + input.DataLakeAdmins !== null && { + DataLakeAdmins: serializeAws_json1_1DataLakePrincipalList(input.DataLakeAdmins, context), + }), + ...(input.TrustedResourceOwners !== undefined && + input.TrustedResourceOwners !== null && { + TrustedResourceOwners: serializeAws_json1_1TrustedResourceOwners(input.TrustedResourceOwners, context), + }), }; }; const serializeAws_json1_1DataLocationResource = (input: DataLocationResource, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -1407,28 +1421,37 @@ const serializeAws_json1_1DeregisterResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1DescribeResourceRequest = (input: DescribeResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1FilterCondition = (input: FilterCondition, context: __SerdeContext): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.Field !== undefined && { Field: input.Field }), - ...(input.StringValueList !== undefined && { - StringValueList: serializeAws_json1_1StringValueList(input.StringValueList, context), - }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.Field !== undefined && input.Field !== null && { Field: input.Field }), + ...(input.StringValueList !== undefined && + input.StringValueList !== null && { + StringValueList: serializeAws_json1_1StringValueList(input.StringValueList, context), + }), }; }; const serializeAws_json1_1FilterConditionList = (input: FilterCondition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FilterCondition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FilterCondition(entry, context); + }); }; const serializeAws_json1_1GetDataLakeSettingsRequest = ( @@ -1436,7 +1459,7 @@ const serializeAws_json1_1GetDataLakeSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), }; }; @@ -1445,69 +1468,82 @@ const serializeAws_json1_1GetEffectivePermissionsForPathRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1GrantPermissionsRequest = (input: GrantPermissionsRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_json1_1PermissionList(input.Permissions, context), - }), - ...(input.PermissionsWithGrantOption !== undefined && { - PermissionsWithGrantOption: serializeAws_json1_1PermissionList(input.PermissionsWithGrantOption, context), - }), - ...(input.Principal !== undefined && { - Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context), - }), - ...(input.Resource !== undefined && { Resource: serializeAws_json1_1Resource(input.Resource, context) }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { Permissions: serializeAws_json1_1PermissionList(input.Permissions, context) }), + ...(input.PermissionsWithGrantOption !== undefined && + input.PermissionsWithGrantOption !== null && { + PermissionsWithGrantOption: serializeAws_json1_1PermissionList(input.PermissionsWithGrantOption, context), + }), + ...(input.Principal !== undefined && + input.Principal !== null && { Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context) }), + ...(input.Resource !== undefined && + input.Resource !== null && { Resource: serializeAws_json1_1Resource(input.Resource, context) }), }; }; const serializeAws_json1_1ListPermissionsRequest = (input: ListPermissionsRequest, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Principal !== undefined && { - Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context), - }), - ...(input.Resource !== undefined && { Resource: serializeAws_json1_1Resource(input.Resource, context) }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Principal !== undefined && + input.Principal !== null && { Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context) }), + ...(input.Resource !== undefined && + input.Resource !== null && { Resource: serializeAws_json1_1Resource(input.Resource, context) }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; const serializeAws_json1_1ListResourcesRequest = (input: ListResourcesRequest, context: __SerdeContext): any => { return { - ...(input.FilterConditionList !== undefined && { - FilterConditionList: serializeAws_json1_1FilterConditionList(input.FilterConditionList, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FilterConditionList !== undefined && + input.FilterConditionList !== null && { + FilterConditionList: serializeAws_json1_1FilterConditionList(input.FilterConditionList, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1PermissionList = (input: (Permission | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PrincipalPermissions = (input: PrincipalPermissions, context: __SerdeContext): any => { return { - ...(input.Permissions !== undefined && { - Permissions: serializeAws_json1_1PermissionList(input.Permissions, context), - }), - ...(input.Principal !== undefined && { - Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context), - }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { Permissions: serializeAws_json1_1PermissionList(input.Permissions, context) }), + ...(input.Principal !== undefined && + input.Principal !== null && { Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context) }), }; }; const serializeAws_json1_1PrincipalPermissionsList = (input: PrincipalPermissions[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PrincipalPermissions(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PrincipalPermissions(entry, context); + }); }; const serializeAws_json1_1PutDataLakeSettingsRequest = ( @@ -1515,32 +1551,39 @@ const serializeAws_json1_1PutDataLakeSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DataLakeSettings !== undefined && { - DataLakeSettings: serializeAws_json1_1DataLakeSettings(input.DataLakeSettings, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DataLakeSettings !== undefined && + input.DataLakeSettings !== null && { + DataLakeSettings: serializeAws_json1_1DataLakeSettings(input.DataLakeSettings, context), + }), }; }; const serializeAws_json1_1RegisterResourceRequest = (input: RegisterResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.UseServiceLinkedRole !== undefined && { UseServiceLinkedRole: input.UseServiceLinkedRole }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.UseServiceLinkedRole !== undefined && + input.UseServiceLinkedRole !== null && { UseServiceLinkedRole: input.UseServiceLinkedRole }), }; }; const serializeAws_json1_1Resource = (input: Resource, context: __SerdeContext): any => { return { - ...(input.Catalog !== undefined && { Catalog: serializeAws_json1_1CatalogResource(input.Catalog, context) }), - ...(input.DataLocation !== undefined && { - DataLocation: serializeAws_json1_1DataLocationResource(input.DataLocation, context), - }), - ...(input.Database !== undefined && { Database: serializeAws_json1_1DatabaseResource(input.Database, context) }), - ...(input.Table !== undefined && { Table: serializeAws_json1_1TableResource(input.Table, context) }), - ...(input.TableWithColumns !== undefined && { - TableWithColumns: serializeAws_json1_1TableWithColumnsResource(input.TableWithColumns, context), - }), + ...(input.Catalog !== undefined && + input.Catalog !== null && { Catalog: serializeAws_json1_1CatalogResource(input.Catalog, context) }), + ...(input.DataLocation !== undefined && + input.DataLocation !== null && { + DataLocation: serializeAws_json1_1DataLocationResource(input.DataLocation, context), + }), + ...(input.Database !== undefined && + input.Database !== null && { Database: serializeAws_json1_1DatabaseResource(input.Database, context) }), + ...(input.Table !== undefined && + input.Table !== null && { Table: serializeAws_json1_1TableResource(input.Table, context) }), + ...(input.TableWithColumns !== undefined && + input.TableWithColumns !== null && { + TableWithColumns: serializeAws_json1_1TableWithColumnsResource(input.TableWithColumns, context), + }), }; }; @@ -1549,32 +1592,40 @@ const serializeAws_json1_1RevokePermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_json1_1PermissionList(input.Permissions, context), - }), - ...(input.PermissionsWithGrantOption !== undefined && { - PermissionsWithGrantOption: serializeAws_json1_1PermissionList(input.PermissionsWithGrantOption, context), - }), - ...(input.Principal !== undefined && { - Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context), - }), - ...(input.Resource !== undefined && { Resource: serializeAws_json1_1Resource(input.Resource, context) }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { Permissions: serializeAws_json1_1PermissionList(input.Permissions, context) }), + ...(input.PermissionsWithGrantOption !== undefined && + input.PermissionsWithGrantOption !== null && { + PermissionsWithGrantOption: serializeAws_json1_1PermissionList(input.PermissionsWithGrantOption, context), + }), + ...(input.Principal !== undefined && + input.Principal !== null && { Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context) }), + ...(input.Resource !== undefined && + input.Resource !== null && { Resource: serializeAws_json1_1Resource(input.Resource, context) }), }; }; const serializeAws_json1_1StringValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TableResource = (input: TableResource, context: __SerdeContext): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.TableWildcard !== undefined && { - TableWildcard: serializeAws_json1_1TableWildcard(input.TableWildcard, context), - }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.TableWildcard !== undefined && + input.TableWildcard !== null && { + TableWildcard: serializeAws_json1_1TableWildcard(input.TableWildcard, context), + }), }; }; @@ -1587,26 +1638,33 @@ const serializeAws_json1_1TableWithColumnsResource = ( context: __SerdeContext ): any => { return { - ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), - ...(input.ColumnNames !== undefined && { - ColumnNames: serializeAws_json1_1ColumnNames(input.ColumnNames, context), - }), - ...(input.ColumnWildcard !== undefined && { - ColumnWildcard: serializeAws_json1_1ColumnWildcard(input.ColumnWildcard, context), - }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.CatalogId !== undefined && input.CatalogId !== null && { CatalogId: input.CatalogId }), + ...(input.ColumnNames !== undefined && + input.ColumnNames !== null && { ColumnNames: serializeAws_json1_1ColumnNames(input.ColumnNames, context) }), + ...(input.ColumnWildcard !== undefined && + input.ColumnWildcard !== null && { + ColumnWildcard: serializeAws_json1_1ColumnWildcard(input.ColumnWildcard, context), + }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1TrustedResourceOwners = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UpdateResourceRequest = (input: UpdateResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; @@ -1648,7 +1706,14 @@ const deserializeAws_json1_1BatchPermissionsFailureList = ( output: any, context: __SerdeContext ): BatchPermissionsFailureEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchPermissionsFailureEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchPermissionsFailureEntry(entry, context); + }); }; const deserializeAws_json1_1BatchPermissionsRequestEntry = ( @@ -1693,7 +1758,14 @@ const deserializeAws_json1_1CatalogResource = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ColumnNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ColumnWildcard = (output: any, context: __SerdeContext): ColumnWildcard => { @@ -1731,7 +1803,14 @@ const deserializeAws_json1_1DataLakePrincipal = (output: any, context: __SerdeCo }; const deserializeAws_json1_1DataLakePrincipalList = (output: any, context: __SerdeContext): DataLakePrincipal[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataLakePrincipal(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataLakePrincipal(entry, context); + }); }; const deserializeAws_json1_1DataLakeSettings = (output: any, context: __SerdeContext): DataLakeSettings => { @@ -1886,7 +1965,14 @@ const deserializeAws_json1_1OperationTimeoutException = ( }; const deserializeAws_json1_1PermissionList = (output: any, context: __SerdeContext): (Permission | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PrincipalPermissions = (output: any, context: __SerdeContext): PrincipalPermissions => { @@ -1906,7 +1992,14 @@ const deserializeAws_json1_1PrincipalPermissionsList = ( output: any, context: __SerdeContext ): PrincipalPermissions[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PrincipalPermissions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PrincipalPermissions(entry, context); + }); }; const deserializeAws_json1_1PrincipalResourcePermissions = ( @@ -1941,7 +2034,14 @@ const deserializeAws_json1_1PrincipalResourcePermissionsList = ( output: any, context: __SerdeContext ): PrincipalResourcePermissions[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PrincipalResourcePermissions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PrincipalResourcePermissions(entry, context); + }); }; const deserializeAws_json1_1PutDataLakeSettingsResponse = ( @@ -1995,11 +2095,25 @@ const deserializeAws_json1_1ResourceInfo = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ResourceInfoList = (output: any, context: __SerdeContext): ResourceInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceInfo(entry, context); + }); }; const deserializeAws_json1_1ResourceShareList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RevokePermissionsResponse = ( @@ -2045,7 +2159,14 @@ const deserializeAws_json1_1TableWithColumnsResource = ( }; const deserializeAws_json1_1TrustedResourceOwners = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1UpdateResourceResponse = (output: any, context: __SerdeContext): UpdateResourceResponse => { @@ -2102,3 +2223,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-lambda/protocols/Aws_restJson1.ts b/clients/client-lambda/protocols/Aws_restJson1.ts index 73b50cf7c994..a00f7cab77d7 100644 --- a/clients/client-lambda/protocols/Aws_restJson1.ts +++ b/clients/client-lambda/protocols/Aws_restJson1.ts @@ -247,7 +247,7 @@ export const serializeAws_restJson1AddLayerVersionPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy"; if (input.LayerName !== undefined) { @@ -273,10 +273,11 @@ export const serializeAws_restJson1AddLayerVersionPermissionCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.Principal !== undefined && { Principal: input.Principal }), - ...(input.StatementId !== undefined && { StatementId: input.StatementId }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.Principal !== undefined && input.Principal !== null && { Principal: input.Principal }), + ...(input.StatementId !== undefined && input.StatementId !== null && { StatementId: input.StatementId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -296,7 +297,7 @@ export const serializeAws_restJson1AddPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-03-31/functions/{FunctionName}/policy"; if (input.FunctionName !== undefined) { @@ -313,13 +314,14 @@ export const serializeAws_restJson1AddPermissionCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.EventSourceToken !== undefined && { EventSourceToken: input.EventSourceToken }), - ...(input.Principal !== undefined && { Principal: input.Principal }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), - ...(input.SourceAccount !== undefined && { SourceAccount: input.SourceAccount }), - ...(input.SourceArn !== undefined && { SourceArn: input.SourceArn }), - ...(input.StatementId !== undefined && { StatementId: input.StatementId }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.EventSourceToken !== undefined && + input.EventSourceToken !== null && { EventSourceToken: input.EventSourceToken }), + ...(input.Principal !== undefined && input.Principal !== null && { Principal: input.Principal }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), + ...(input.SourceAccount !== undefined && input.SourceAccount !== null && { SourceAccount: input.SourceAccount }), + ...(input.SourceArn !== undefined && input.SourceArn !== null && { SourceArn: input.SourceArn }), + ...(input.StatementId !== undefined && input.StatementId !== null && { StatementId: input.StatementId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -339,7 +341,7 @@ export const serializeAws_restJson1CreateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-03-31/functions/{FunctionName}/aliases"; if (input.FunctionName !== undefined) { @@ -353,12 +355,14 @@ export const serializeAws_restJson1CreateAliasCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FunctionVersion !== undefined && { FunctionVersion: input.FunctionVersion }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RoutingConfig !== undefined && { - RoutingConfig: serializeAws_restJson1AliasRoutingConfiguration(input.RoutingConfig, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FunctionVersion !== undefined && + input.FunctionVersion !== null && { FunctionVersion: input.FunctionVersion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RoutingConfig !== undefined && + input.RoutingConfig !== null && { + RoutingConfig: serializeAws_restJson1AliasRoutingConfiguration(input.RoutingConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -377,18 +381,20 @@ export const serializeAws_restJson1CreateCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2020-04-22/code-signing-configs"; let body: any; body = JSON.stringify({ - ...(input.AllowedPublishers !== undefined && { - AllowedPublishers: serializeAws_restJson1AllowedPublishers(input.AllowedPublishers, context), - }), - ...(input.CodeSigningPolicies !== undefined && { - CodeSigningPolicies: serializeAws_restJson1CodeSigningPolicies(input.CodeSigningPolicies, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.AllowedPublishers !== undefined && + input.AllowedPublishers !== null && { + AllowedPublishers: serializeAws_restJson1AllowedPublishers(input.AllowedPublishers, context), + }), + ...(input.CodeSigningPolicies !== undefined && + input.CodeSigningPolicies !== null && { + CodeSigningPolicies: serializeAws_restJson1CodeSigningPolicies(input.CodeSigningPolicies, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -407,41 +413,49 @@ export const serializeAws_restJson1CreateEventSourceMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-03-31/event-source-mappings"; let body: any; body = JSON.stringify({ - ...(input.BatchSize !== undefined && { BatchSize: input.BatchSize }), - ...(input.BisectBatchOnFunctionError !== undefined && { - BisectBatchOnFunctionError: input.BisectBatchOnFunctionError, - }), - ...(input.DestinationConfig !== undefined && { - DestinationConfig: serializeAws_restJson1DestinationConfig(input.DestinationConfig, context), - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), - ...(input.FunctionName !== undefined && { FunctionName: input.FunctionName }), - ...(input.MaximumBatchingWindowInSeconds !== undefined && { - MaximumBatchingWindowInSeconds: input.MaximumBatchingWindowInSeconds, - }), - ...(input.MaximumRecordAgeInSeconds !== undefined && { - MaximumRecordAgeInSeconds: input.MaximumRecordAgeInSeconds, - }), - ...(input.MaximumRetryAttempts !== undefined && { MaximumRetryAttempts: input.MaximumRetryAttempts }), - ...(input.ParallelizationFactor !== undefined && { ParallelizationFactor: input.ParallelizationFactor }), - ...(input.Queues !== undefined && { Queues: serializeAws_restJson1Queues(input.Queues, context) }), - ...(input.SourceAccessConfigurations !== undefined && { - SourceAccessConfigurations: serializeAws_restJson1SourceAccessConfigurations( - input.SourceAccessConfigurations, - context - ), - }), - ...(input.StartingPosition !== undefined && { StartingPosition: input.StartingPosition }), - ...(input.StartingPositionTimestamp !== undefined && { - StartingPositionTimestamp: Math.round(input.StartingPositionTimestamp.getTime() / 1000), - }), - ...(input.Topics !== undefined && { Topics: serializeAws_restJson1Topics(input.Topics, context) }), + ...(input.BatchSize !== undefined && input.BatchSize !== null && { BatchSize: input.BatchSize }), + ...(input.BisectBatchOnFunctionError !== undefined && + input.BisectBatchOnFunctionError !== null && { BisectBatchOnFunctionError: input.BisectBatchOnFunctionError }), + ...(input.DestinationConfig !== undefined && + input.DestinationConfig !== null && { + DestinationConfig: serializeAws_restJson1DestinationConfig(input.DestinationConfig, context), + }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.EventSourceArn !== undefined && + input.EventSourceArn !== null && { EventSourceArn: input.EventSourceArn }), + ...(input.FunctionName !== undefined && input.FunctionName !== null && { FunctionName: input.FunctionName }), + ...(input.MaximumBatchingWindowInSeconds !== undefined && + input.MaximumBatchingWindowInSeconds !== null && { + MaximumBatchingWindowInSeconds: input.MaximumBatchingWindowInSeconds, + }), + ...(input.MaximumRecordAgeInSeconds !== undefined && + input.MaximumRecordAgeInSeconds !== null && { MaximumRecordAgeInSeconds: input.MaximumRecordAgeInSeconds }), + ...(input.MaximumRetryAttempts !== undefined && + input.MaximumRetryAttempts !== null && { MaximumRetryAttempts: input.MaximumRetryAttempts }), + ...(input.ParallelizationFactor !== undefined && + input.ParallelizationFactor !== null && { ParallelizationFactor: input.ParallelizationFactor }), + ...(input.Queues !== undefined && + input.Queues !== null && { Queues: serializeAws_restJson1Queues(input.Queues, context) }), + ...(input.SourceAccessConfigurations !== undefined && + input.SourceAccessConfigurations !== null && { + SourceAccessConfigurations: serializeAws_restJson1SourceAccessConfigurations( + input.SourceAccessConfigurations, + context + ), + }), + ...(input.StartingPosition !== undefined && + input.StartingPosition !== null && { StartingPosition: input.StartingPosition }), + ...(input.StartingPositionTimestamp !== undefined && + input.StartingPositionTimestamp !== null && { + StartingPositionTimestamp: Math.round(input.StartingPositionTimestamp.getTime() / 1000), + }), + ...(input.Topics !== undefined && + input.Topics !== null && { Topics: serializeAws_restJson1Topics(input.Topics, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -460,41 +474,46 @@ export const serializeAws_restJson1CreateFunctionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-03-31/functions"; let body: any; body = JSON.stringify({ - ...(input.Code !== undefined && { Code: serializeAws_restJson1FunctionCode(input.Code, context) }), - ...(input.CodeSigningConfigArn !== undefined && { CodeSigningConfigArn: input.CodeSigningConfigArn }), - ...(input.DeadLetterConfig !== undefined && { - DeadLetterConfig: serializeAws_restJson1DeadLetterConfig(input.DeadLetterConfig, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Environment !== undefined && { - Environment: serializeAws_restJson1Environment(input.Environment, context), - }), - ...(input.FileSystemConfigs !== undefined && { - FileSystemConfigs: serializeAws_restJson1FileSystemConfigList(input.FileSystemConfigs, context), - }), - ...(input.FunctionName !== undefined && { FunctionName: input.FunctionName }), - ...(input.Handler !== undefined && { Handler: input.Handler }), - ...(input.ImageConfig !== undefined && { - ImageConfig: serializeAws_restJson1ImageConfig(input.ImageConfig, context), - }), - ...(input.KMSKeyArn !== undefined && { KMSKeyArn: input.KMSKeyArn }), - ...(input.Layers !== undefined && { Layers: serializeAws_restJson1LayerList(input.Layers, context) }), - ...(input.MemorySize !== undefined && { MemorySize: input.MemorySize }), - ...(input.PackageType !== undefined && { PackageType: input.PackageType }), - ...(input.Publish !== undefined && { Publish: input.Publish }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Runtime !== undefined && { Runtime: input.Runtime }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.TracingConfig !== undefined && { - TracingConfig: serializeAws_restJson1TracingConfig(input.TracingConfig, context), - }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_restJson1VpcConfig(input.VpcConfig, context) }), + ...(input.Code !== undefined && + input.Code !== null && { Code: serializeAws_restJson1FunctionCode(input.Code, context) }), + ...(input.CodeSigningConfigArn !== undefined && + input.CodeSigningConfigArn !== null && { CodeSigningConfigArn: input.CodeSigningConfigArn }), + ...(input.DeadLetterConfig !== undefined && + input.DeadLetterConfig !== null && { + DeadLetterConfig: serializeAws_restJson1DeadLetterConfig(input.DeadLetterConfig, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Environment !== undefined && + input.Environment !== null && { Environment: serializeAws_restJson1Environment(input.Environment, context) }), + ...(input.FileSystemConfigs !== undefined && + input.FileSystemConfigs !== null && { + FileSystemConfigs: serializeAws_restJson1FileSystemConfigList(input.FileSystemConfigs, context), + }), + ...(input.FunctionName !== undefined && input.FunctionName !== null && { FunctionName: input.FunctionName }), + ...(input.Handler !== undefined && input.Handler !== null && { Handler: input.Handler }), + ...(input.ImageConfig !== undefined && + input.ImageConfig !== null && { ImageConfig: serializeAws_restJson1ImageConfig(input.ImageConfig, context) }), + ...(input.KMSKeyArn !== undefined && input.KMSKeyArn !== null && { KMSKeyArn: input.KMSKeyArn }), + ...(input.Layers !== undefined && + input.Layers !== null && { Layers: serializeAws_restJson1LayerList(input.Layers, context) }), + ...(input.MemorySize !== undefined && input.MemorySize !== null && { MemorySize: input.MemorySize }), + ...(input.PackageType !== undefined && input.PackageType !== null && { PackageType: input.PackageType }), + ...(input.Publish !== undefined && input.Publish !== null && { Publish: input.Publish }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Runtime !== undefined && input.Runtime !== null && { Runtime: input.Runtime }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.TracingConfig !== undefined && + input.TracingConfig !== null && { + TracingConfig: serializeAws_restJson1TracingConfig(input.TracingConfig, context), + }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_restJson1VpcConfig(input.VpcConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -512,9 +531,7 @@ export const serializeAws_restJson1DeleteAliasCommand = async ( input: DeleteAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions/{FunctionName}/aliases/{Name}"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -551,9 +568,7 @@ export const serializeAws_restJson1DeleteCodeSigningConfigCommand = async ( input: DeleteCodeSigningConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}"; if (input.CodeSigningConfigArn !== undefined) { const labelValue: string = input.CodeSigningConfigArn; @@ -581,9 +596,7 @@ export const serializeAws_restJson1DeleteEventSourceMappingCommand = async ( input: DeleteEventSourceMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/event-source-mappings/{UUID}"; if (input.UUID !== undefined) { const labelValue: string = input.UUID; @@ -611,9 +624,7 @@ export const serializeAws_restJson1DeleteFunctionCommand = async ( input: DeleteFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions/{FunctionName}"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -645,9 +656,7 @@ export const serializeAws_restJson1DeleteFunctionCodeSigningConfigCommand = asyn input: DeleteFunctionCodeSigningConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-06-30/functions/{FunctionName}/code-signing-config"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -675,9 +684,7 @@ export const serializeAws_restJson1DeleteFunctionConcurrencyCommand = async ( input: DeleteFunctionConcurrencyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-10-31/functions/{FunctionName}/concurrency"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -705,9 +712,7 @@ export const serializeAws_restJson1DeleteFunctionEventInvokeConfigCommand = asyn input: DeleteFunctionEventInvokeConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2019-09-25/functions/{FunctionName}/event-invoke-config"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -739,9 +744,7 @@ export const serializeAws_restJson1DeleteLayerVersionCommand = async ( input: DeleteLayerVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}"; if (input.LayerName !== undefined) { const labelValue: string = input.LayerName; @@ -778,9 +781,7 @@ export const serializeAws_restJson1DeleteProvisionedConcurrencyConfigCommand = a input: DeleteProvisionedConcurrencyConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2019-09-30/functions/{FunctionName}/provisioned-concurrency"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -812,12 +813,10 @@ export const serializeAws_restJson1GetAccountSettingsCommand = async ( input: GetAccountSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2016-08-19/account-settings"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -834,9 +833,7 @@ export const serializeAws_restJson1GetAliasCommand = async ( input: GetAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions/{FunctionName}/aliases/{Name}"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -873,9 +870,7 @@ export const serializeAws_restJson1GetCodeSigningConfigCommand = async ( input: GetCodeSigningConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}"; if (input.CodeSigningConfigArn !== undefined) { const labelValue: string = input.CodeSigningConfigArn; @@ -903,9 +898,7 @@ export const serializeAws_restJson1GetEventSourceMappingCommand = async ( input: GetEventSourceMappingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/event-source-mappings/{UUID}"; if (input.UUID !== undefined) { const labelValue: string = input.UUID; @@ -933,9 +926,7 @@ export const serializeAws_restJson1GetFunctionCommand = async ( input: GetFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions/{FunctionName}"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -967,9 +958,7 @@ export const serializeAws_restJson1GetFunctionCodeSigningConfigCommand = async ( input: GetFunctionCodeSigningConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-06-30/functions/{FunctionName}/code-signing-config"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -997,9 +986,7 @@ export const serializeAws_restJson1GetFunctionConcurrencyCommand = async ( input: GetFunctionConcurrencyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2019-09-30/functions/{FunctionName}/concurrency"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -1027,9 +1014,7 @@ export const serializeAws_restJson1GetFunctionConfigurationCommand = async ( input: GetFunctionConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions/{FunctionName}/configuration"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -1061,9 +1046,7 @@ export const serializeAws_restJson1GetFunctionEventInvokeConfigCommand = async ( input: GetFunctionEventInvokeConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2019-09-25/functions/{FunctionName}/event-invoke-config"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -1095,9 +1078,7 @@ export const serializeAws_restJson1GetLayerVersionCommand = async ( input: GetLayerVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}"; if (input.LayerName !== undefined) { const labelValue: string = input.LayerName; @@ -1134,9 +1115,7 @@ export const serializeAws_restJson1GetLayerVersionByArnCommand = async ( input: GetLayerVersionByArnCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2018-10-31/layers"; const query: any = { find: "LayerVersion", @@ -1160,9 +1139,7 @@ export const serializeAws_restJson1GetLayerVersionPolicyCommand = async ( input: GetLayerVersionPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy"; if (input.LayerName !== undefined) { const labelValue: string = input.LayerName; @@ -1199,9 +1176,7 @@ export const serializeAws_restJson1GetPolicyCommand = async ( input: GetPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions/{FunctionName}/policy"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -1233,9 +1208,7 @@ export const serializeAws_restJson1GetProvisionedConcurrencyConfigCommand = asyn input: GetProvisionedConcurrencyConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2019-09-30/functions/{FunctionName}/provisioned-concurrency"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -1268,7 +1241,7 @@ export const serializeAws_restJson1InvokeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.InvocationType) && { "X-Amz-Invocation-Type": input.InvocationType! }), ...(isSerializableHeaderValue(input.LogType) && { "X-Amz-Log-Type": input.LogType! }), ...(isSerializableHeaderValue(input.ClientContext) && { "X-Amz-Client-Context": input.ClientContext! }), @@ -1308,7 +1281,7 @@ export const serializeAws_restJson1InvokeAsyncCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", }; let resolvedPath = "/2014-11-13/functions/{FunctionName}/invoke-async"; if (input.FunctionName !== undefined) { @@ -1340,9 +1313,7 @@ export const serializeAws_restJson1ListAliasesCommand = async ( input: ListAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions/{FunctionName}/aliases"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -1376,9 +1347,7 @@ export const serializeAws_restJson1ListCodeSigningConfigsCommand = async ( input: ListCodeSigningConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-04-22/code-signing-configs"; const query: any = { ...(input.Marker !== undefined && { Marker: input.Marker }), @@ -1402,9 +1371,7 @@ export const serializeAws_restJson1ListEventSourceMappingsCommand = async ( input: ListEventSourceMappingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/event-source-mappings"; const query: any = { ...(input.EventSourceArn !== undefined && { EventSourceArn: input.EventSourceArn }), @@ -1430,9 +1397,7 @@ export const serializeAws_restJson1ListFunctionEventInvokeConfigsCommand = async input: ListFunctionEventInvokeConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2019-09-25/functions/{FunctionName}/event-invoke-config/list"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -1465,9 +1430,7 @@ export const serializeAws_restJson1ListFunctionsCommand = async ( input: ListFunctionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions"; const query: any = { ...(input.MasterRegion !== undefined && { MasterRegion: input.MasterRegion }), @@ -1493,9 +1456,7 @@ export const serializeAws_restJson1ListFunctionsByCodeSigningConfigCommand = asy input: ListFunctionsByCodeSigningConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}/functions"; if (input.CodeSigningConfigArn !== undefined) { const labelValue: string = input.CodeSigningConfigArn; @@ -1528,9 +1489,7 @@ export const serializeAws_restJson1ListLayersCommand = async ( input: ListLayersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2018-10-31/layers"; const query: any = { ...(input.CompatibleRuntime !== undefined && { CompatibleRuntime: input.CompatibleRuntime }), @@ -1555,9 +1514,7 @@ export const serializeAws_restJson1ListLayerVersionsCommand = async ( input: ListLayerVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2018-10-31/layers/{LayerName}/versions"; if (input.LayerName !== undefined) { const labelValue: string = input.LayerName; @@ -1591,9 +1548,7 @@ export const serializeAws_restJson1ListProvisionedConcurrencyConfigsCommand = as input: ListProvisionedConcurrencyConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2019-09-30/functions/{FunctionName}/provisioned-concurrency"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -1627,9 +1582,7 @@ export const serializeAws_restJson1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-03-31/tags/{Resource}"; if (input.Resource !== undefined) { const labelValue: string = input.Resource; @@ -1657,9 +1610,7 @@ export const serializeAws_restJson1ListVersionsByFunctionCommand = async ( input: ListVersionsByFunctionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions/{FunctionName}/versions"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -1693,7 +1644,7 @@ export const serializeAws_restJson1PublishLayerVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2018-10-31/layers/{LayerName}/versions"; if (input.LayerName !== undefined) { @@ -1707,14 +1658,14 @@ export const serializeAws_restJson1PublishLayerVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CompatibleRuntimes !== undefined && { - CompatibleRuntimes: serializeAws_restJson1CompatibleRuntimes(input.CompatibleRuntimes, context), - }), - ...(input.Content !== undefined && { - Content: serializeAws_restJson1LayerVersionContentInput(input.Content, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LicenseInfo !== undefined && { LicenseInfo: input.LicenseInfo }), + ...(input.CompatibleRuntimes !== undefined && + input.CompatibleRuntimes !== null && { + CompatibleRuntimes: serializeAws_restJson1CompatibleRuntimes(input.CompatibleRuntimes, context), + }), + ...(input.Content !== undefined && + input.Content !== null && { Content: serializeAws_restJson1LayerVersionContentInput(input.Content, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LicenseInfo !== undefined && input.LicenseInfo !== null && { LicenseInfo: input.LicenseInfo }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1733,7 +1684,7 @@ export const serializeAws_restJson1PublishVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-03-31/functions/{FunctionName}/versions"; if (input.FunctionName !== undefined) { @@ -1747,9 +1698,9 @@ export const serializeAws_restJson1PublishVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CodeSha256 !== undefined && { CodeSha256: input.CodeSha256 }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), + ...(input.CodeSha256 !== undefined && input.CodeSha256 !== null && { CodeSha256: input.CodeSha256 }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1768,7 +1719,7 @@ export const serializeAws_restJson1PutFunctionCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2020-06-30/functions/{FunctionName}/code-signing-config"; if (input.FunctionName !== undefined) { @@ -1782,7 +1733,8 @@ export const serializeAws_restJson1PutFunctionCodeSigningConfigCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CodeSigningConfigArn !== undefined && { CodeSigningConfigArn: input.CodeSigningConfigArn }), + ...(input.CodeSigningConfigArn !== undefined && + input.CodeSigningConfigArn !== null && { CodeSigningConfigArn: input.CodeSigningConfigArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1801,7 +1753,7 @@ export const serializeAws_restJson1PutFunctionConcurrencyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-10-31/functions/{FunctionName}/concurrency"; if (input.FunctionName !== undefined) { @@ -1815,9 +1767,10 @@ export const serializeAws_restJson1PutFunctionConcurrencyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ReservedConcurrentExecutions !== undefined && { - ReservedConcurrentExecutions: input.ReservedConcurrentExecutions, - }), + ...(input.ReservedConcurrentExecutions !== undefined && + input.ReservedConcurrentExecutions !== null && { + ReservedConcurrentExecutions: input.ReservedConcurrentExecutions, + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1836,7 +1789,7 @@ export const serializeAws_restJson1PutFunctionEventInvokeConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2019-09-25/functions/{FunctionName}/event-invoke-config"; if (input.FunctionName !== undefined) { @@ -1853,11 +1806,14 @@ export const serializeAws_restJson1PutFunctionEventInvokeConfigCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.DestinationConfig !== undefined && { - DestinationConfig: serializeAws_restJson1DestinationConfig(input.DestinationConfig, context), - }), - ...(input.MaximumEventAgeInSeconds !== undefined && { MaximumEventAgeInSeconds: input.MaximumEventAgeInSeconds }), - ...(input.MaximumRetryAttempts !== undefined && { MaximumRetryAttempts: input.MaximumRetryAttempts }), + ...(input.DestinationConfig !== undefined && + input.DestinationConfig !== null && { + DestinationConfig: serializeAws_restJson1DestinationConfig(input.DestinationConfig, context), + }), + ...(input.MaximumEventAgeInSeconds !== undefined && + input.MaximumEventAgeInSeconds !== null && { MaximumEventAgeInSeconds: input.MaximumEventAgeInSeconds }), + ...(input.MaximumRetryAttempts !== undefined && + input.MaximumRetryAttempts !== null && { MaximumRetryAttempts: input.MaximumRetryAttempts }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1877,7 +1833,7 @@ export const serializeAws_restJson1PutProvisionedConcurrencyConfigCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2019-09-30/functions/{FunctionName}/provisioned-concurrency"; if (input.FunctionName !== undefined) { @@ -1894,9 +1850,10 @@ export const serializeAws_restJson1PutProvisionedConcurrencyConfigCommand = asyn }; let body: any; body = JSON.stringify({ - ...(input.ProvisionedConcurrentExecutions !== undefined && { - ProvisionedConcurrentExecutions: input.ProvisionedConcurrentExecutions, - }), + ...(input.ProvisionedConcurrentExecutions !== undefined && + input.ProvisionedConcurrentExecutions !== null && { + ProvisionedConcurrentExecutions: input.ProvisionedConcurrentExecutions, + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1915,9 +1872,7 @@ export const serializeAws_restJson1RemoveLayerVersionPermissionCommand = async ( input: RemoveLayerVersionPermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}"; if (input.LayerName !== undefined) { const labelValue: string = input.LayerName; @@ -1967,9 +1922,7 @@ export const serializeAws_restJson1RemovePermissionCommand = async ( input: RemovePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2015-03-31/functions/{FunctionName}/policy/{StatementId}"; if (input.FunctionName !== undefined) { const labelValue: string = input.FunctionName; @@ -2012,7 +1965,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-03-31/tags/{Resource}"; if (input.Resource !== undefined) { @@ -2026,7 +1979,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2044,9 +1997,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-03-31/tags/{Resource}"; if (input.Resource !== undefined) { const labelValue: string = input.Resource; @@ -2079,7 +2030,7 @@ export const serializeAws_restJson1UpdateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-03-31/functions/{FunctionName}/aliases/{Name}"; if (input.FunctionName !== undefined) { @@ -2102,12 +2053,14 @@ export const serializeAws_restJson1UpdateAliasCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FunctionVersion !== undefined && { FunctionVersion: input.FunctionVersion }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), - ...(input.RoutingConfig !== undefined && { - RoutingConfig: serializeAws_restJson1AliasRoutingConfiguration(input.RoutingConfig, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FunctionVersion !== undefined && + input.FunctionVersion !== null && { FunctionVersion: input.FunctionVersion }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), + ...(input.RoutingConfig !== undefined && + input.RoutingConfig !== null && { + RoutingConfig: serializeAws_restJson1AliasRoutingConfiguration(input.RoutingConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2126,7 +2079,7 @@ export const serializeAws_restJson1UpdateCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}"; if (input.CodeSigningConfigArn !== undefined) { @@ -2140,13 +2093,15 @@ export const serializeAws_restJson1UpdateCodeSigningConfigCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AllowedPublishers !== undefined && { - AllowedPublishers: serializeAws_restJson1AllowedPublishers(input.AllowedPublishers, context), - }), - ...(input.CodeSigningPolicies !== undefined && { - CodeSigningPolicies: serializeAws_restJson1CodeSigningPolicies(input.CodeSigningPolicies, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.AllowedPublishers !== undefined && + input.AllowedPublishers !== null && { + AllowedPublishers: serializeAws_restJson1AllowedPublishers(input.AllowedPublishers, context), + }), + ...(input.CodeSigningPolicies !== undefined && + input.CodeSigningPolicies !== null && { + CodeSigningPolicies: serializeAws_restJson1CodeSigningPolicies(input.CodeSigningPolicies, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2165,7 +2120,7 @@ export const serializeAws_restJson1UpdateEventSourceMappingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-03-31/event-source-mappings/{UUID}"; if (input.UUID !== undefined) { @@ -2179,29 +2134,32 @@ export const serializeAws_restJson1UpdateEventSourceMappingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BatchSize !== undefined && { BatchSize: input.BatchSize }), - ...(input.BisectBatchOnFunctionError !== undefined && { - BisectBatchOnFunctionError: input.BisectBatchOnFunctionError, - }), - ...(input.DestinationConfig !== undefined && { - DestinationConfig: serializeAws_restJson1DestinationConfig(input.DestinationConfig, context), - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.FunctionName !== undefined && { FunctionName: input.FunctionName }), - ...(input.MaximumBatchingWindowInSeconds !== undefined && { - MaximumBatchingWindowInSeconds: input.MaximumBatchingWindowInSeconds, - }), - ...(input.MaximumRecordAgeInSeconds !== undefined && { - MaximumRecordAgeInSeconds: input.MaximumRecordAgeInSeconds, - }), - ...(input.MaximumRetryAttempts !== undefined && { MaximumRetryAttempts: input.MaximumRetryAttempts }), - ...(input.ParallelizationFactor !== undefined && { ParallelizationFactor: input.ParallelizationFactor }), - ...(input.SourceAccessConfigurations !== undefined && { - SourceAccessConfigurations: serializeAws_restJson1SourceAccessConfigurations( - input.SourceAccessConfigurations, - context - ), - }), + ...(input.BatchSize !== undefined && input.BatchSize !== null && { BatchSize: input.BatchSize }), + ...(input.BisectBatchOnFunctionError !== undefined && + input.BisectBatchOnFunctionError !== null && { BisectBatchOnFunctionError: input.BisectBatchOnFunctionError }), + ...(input.DestinationConfig !== undefined && + input.DestinationConfig !== null && { + DestinationConfig: serializeAws_restJson1DestinationConfig(input.DestinationConfig, context), + }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.FunctionName !== undefined && input.FunctionName !== null && { FunctionName: input.FunctionName }), + ...(input.MaximumBatchingWindowInSeconds !== undefined && + input.MaximumBatchingWindowInSeconds !== null && { + MaximumBatchingWindowInSeconds: input.MaximumBatchingWindowInSeconds, + }), + ...(input.MaximumRecordAgeInSeconds !== undefined && + input.MaximumRecordAgeInSeconds !== null && { MaximumRecordAgeInSeconds: input.MaximumRecordAgeInSeconds }), + ...(input.MaximumRetryAttempts !== undefined && + input.MaximumRetryAttempts !== null && { MaximumRetryAttempts: input.MaximumRetryAttempts }), + ...(input.ParallelizationFactor !== undefined && + input.ParallelizationFactor !== null && { ParallelizationFactor: input.ParallelizationFactor }), + ...(input.SourceAccessConfigurations !== undefined && + input.SourceAccessConfigurations !== null && { + SourceAccessConfigurations: serializeAws_restJson1SourceAccessConfigurations( + input.SourceAccessConfigurations, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2220,7 +2178,7 @@ export const serializeAws_restJson1UpdateFunctionCodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-03-31/functions/{FunctionName}/code"; if (input.FunctionName !== undefined) { @@ -2234,14 +2192,15 @@ export const serializeAws_restJson1UpdateFunctionCodeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.ImageUri !== undefined && { ImageUri: input.ImageUri }), - ...(input.Publish !== undefined && { Publish: input.Publish }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3Key !== undefined && { S3Key: input.S3Key }), - ...(input.S3ObjectVersion !== undefined && { S3ObjectVersion: input.S3ObjectVersion }), - ...(input.ZipFile !== undefined && { ZipFile: context.base64Encoder(input.ZipFile) }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.ImageUri !== undefined && input.ImageUri !== null && { ImageUri: input.ImageUri }), + ...(input.Publish !== undefined && input.Publish !== null && { Publish: input.Publish }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3Key !== undefined && input.S3Key !== null && { S3Key: input.S3Key }), + ...(input.S3ObjectVersion !== undefined && + input.S3ObjectVersion !== null && { S3ObjectVersion: input.S3ObjectVersion }), + ...(input.ZipFile !== undefined && input.ZipFile !== null && { ZipFile: context.base64Encoder(input.ZipFile) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2260,7 +2219,7 @@ export const serializeAws_restJson1UpdateFunctionConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2015-03-31/functions/{FunctionName}/configuration"; if (input.FunctionName !== undefined) { @@ -2274,31 +2233,34 @@ export const serializeAws_restJson1UpdateFunctionConfigurationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DeadLetterConfig !== undefined && { - DeadLetterConfig: serializeAws_restJson1DeadLetterConfig(input.DeadLetterConfig, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Environment !== undefined && { - Environment: serializeAws_restJson1Environment(input.Environment, context), - }), - ...(input.FileSystemConfigs !== undefined && { - FileSystemConfigs: serializeAws_restJson1FileSystemConfigList(input.FileSystemConfigs, context), - }), - ...(input.Handler !== undefined && { Handler: input.Handler }), - ...(input.ImageConfig !== undefined && { - ImageConfig: serializeAws_restJson1ImageConfig(input.ImageConfig, context), - }), - ...(input.KMSKeyArn !== undefined && { KMSKeyArn: input.KMSKeyArn }), - ...(input.Layers !== undefined && { Layers: serializeAws_restJson1LayerList(input.Layers, context) }), - ...(input.MemorySize !== undefined && { MemorySize: input.MemorySize }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Runtime !== undefined && { Runtime: input.Runtime }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.TracingConfig !== undefined && { - TracingConfig: serializeAws_restJson1TracingConfig(input.TracingConfig, context), - }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_restJson1VpcConfig(input.VpcConfig, context) }), + ...(input.DeadLetterConfig !== undefined && + input.DeadLetterConfig !== null && { + DeadLetterConfig: serializeAws_restJson1DeadLetterConfig(input.DeadLetterConfig, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Environment !== undefined && + input.Environment !== null && { Environment: serializeAws_restJson1Environment(input.Environment, context) }), + ...(input.FileSystemConfigs !== undefined && + input.FileSystemConfigs !== null && { + FileSystemConfigs: serializeAws_restJson1FileSystemConfigList(input.FileSystemConfigs, context), + }), + ...(input.Handler !== undefined && input.Handler !== null && { Handler: input.Handler }), + ...(input.ImageConfig !== undefined && + input.ImageConfig !== null && { ImageConfig: serializeAws_restJson1ImageConfig(input.ImageConfig, context) }), + ...(input.KMSKeyArn !== undefined && input.KMSKeyArn !== null && { KMSKeyArn: input.KMSKeyArn }), + ...(input.Layers !== undefined && + input.Layers !== null && { Layers: serializeAws_restJson1LayerList(input.Layers, context) }), + ...(input.MemorySize !== undefined && input.MemorySize !== null && { MemorySize: input.MemorySize }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Runtime !== undefined && input.Runtime !== null && { Runtime: input.Runtime }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.TracingConfig !== undefined && + input.TracingConfig !== null && { + TracingConfig: serializeAws_restJson1TracingConfig(input.TracingConfig, context), + }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_restJson1VpcConfig(input.VpcConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2317,7 +2279,7 @@ export const serializeAws_restJson1UpdateFunctionEventInvokeConfigCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2019-09-25/functions/{FunctionName}/event-invoke-config"; if (input.FunctionName !== undefined) { @@ -2334,11 +2296,14 @@ export const serializeAws_restJson1UpdateFunctionEventInvokeConfigCommand = asyn }; let body: any; body = JSON.stringify({ - ...(input.DestinationConfig !== undefined && { - DestinationConfig: serializeAws_restJson1DestinationConfig(input.DestinationConfig, context), - }), - ...(input.MaximumEventAgeInSeconds !== undefined && { MaximumEventAgeInSeconds: input.MaximumEventAgeInSeconds }), - ...(input.MaximumRetryAttempts !== undefined && { MaximumRetryAttempts: input.MaximumRetryAttempts }), + ...(input.DestinationConfig !== undefined && + input.DestinationConfig !== null && { + DestinationConfig: serializeAws_restJson1DestinationConfig(input.DestinationConfig, context), + }), + ...(input.MaximumEventAgeInSeconds !== undefined && + input.MaximumEventAgeInSeconds !== null && { MaximumEventAgeInSeconds: input.MaximumEventAgeInSeconds }), + ...(input.MaximumRetryAttempts !== undefined && + input.MaximumRetryAttempts !== null && { MaximumRetryAttempts: input.MaximumRetryAttempts }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5631,6 +5596,9 @@ export const deserializeAws_restJson1InvokeAsyncCommand = async ( $metadata: deserializeMetadata(output), Status: undefined, }; + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } await collectBody(output.body, context); return Promise.resolve(contents); }; @@ -9313,13 +9281,15 @@ const serializeAws_restJson1AdditionalVersionWeights = ( input: { [key: string]: number }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AliasRoutingConfiguration = ( @@ -9327,97 +9297,132 @@ const serializeAws_restJson1AliasRoutingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AdditionalVersionWeights !== undefined && { - AdditionalVersionWeights: serializeAws_restJson1AdditionalVersionWeights(input.AdditionalVersionWeights, context), - }), + ...(input.AdditionalVersionWeights !== undefined && + input.AdditionalVersionWeights !== null && { + AdditionalVersionWeights: serializeAws_restJson1AdditionalVersionWeights( + input.AdditionalVersionWeights, + context + ), + }), }; }; const serializeAws_restJson1AllowedPublishers = (input: AllowedPublishers, context: __SerdeContext): any => { return { - ...(input.SigningProfileVersionArns !== undefined && { - SigningProfileVersionArns: serializeAws_restJson1SigningProfileVersionArns( - input.SigningProfileVersionArns, - context - ), - }), + ...(input.SigningProfileVersionArns !== undefined && + input.SigningProfileVersionArns !== null && { + SigningProfileVersionArns: serializeAws_restJson1SigningProfileVersionArns( + input.SigningProfileVersionArns, + context + ), + }), }; }; const serializeAws_restJson1CodeSigningPolicies = (input: CodeSigningPolicies, context: __SerdeContext): any => { return { - ...(input.UntrustedArtifactOnDeployment !== undefined && { - UntrustedArtifactOnDeployment: input.UntrustedArtifactOnDeployment, - }), + ...(input.UntrustedArtifactOnDeployment !== undefined && + input.UntrustedArtifactOnDeployment !== null && { + UntrustedArtifactOnDeployment: input.UntrustedArtifactOnDeployment, + }), }; }; const serializeAws_restJson1CompatibleRuntimes = (input: (Runtime | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DeadLetterConfig = (input: DeadLetterConfig, context: __SerdeContext): any => { return { - ...(input.TargetArn !== undefined && { TargetArn: input.TargetArn }), + ...(input.TargetArn !== undefined && input.TargetArn !== null && { TargetArn: input.TargetArn }), }; }; const serializeAws_restJson1DestinationConfig = (input: DestinationConfig, context: __SerdeContext): any => { return { - ...(input.OnFailure !== undefined && { OnFailure: serializeAws_restJson1OnFailure(input.OnFailure, context) }), - ...(input.OnSuccess !== undefined && { OnSuccess: serializeAws_restJson1OnSuccess(input.OnSuccess, context) }), + ...(input.OnFailure !== undefined && + input.OnFailure !== null && { OnFailure: serializeAws_restJson1OnFailure(input.OnFailure, context) }), + ...(input.OnSuccess !== undefined && + input.OnSuccess !== null && { OnSuccess: serializeAws_restJson1OnSuccess(input.OnSuccess, context) }), }; }; const serializeAws_restJson1Environment = (input: Environment, context: __SerdeContext): any => { return { - ...(input.Variables !== undefined && { - Variables: serializeAws_restJson1EnvironmentVariables(input.Variables, context), - }), + ...(input.Variables !== undefined && + input.Variables !== null && { Variables: serializeAws_restJson1EnvironmentVariables(input.Variables, context) }), }; }; const serializeAws_restJson1EnvironmentVariables = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1FileSystemConfig = (input: FileSystemConfig, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.LocalMountPath !== undefined && { LocalMountPath: input.LocalMountPath }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.LocalMountPath !== undefined && + input.LocalMountPath !== null && { LocalMountPath: input.LocalMountPath }), }; }; const serializeAws_restJson1FileSystemConfigList = (input: FileSystemConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1FileSystemConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1FileSystemConfig(entry, context); + }); }; const serializeAws_restJson1FunctionCode = (input: FunctionCode, context: __SerdeContext): any => { return { - ...(input.ImageUri !== undefined && { ImageUri: input.ImageUri }), - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3Key !== undefined && { S3Key: input.S3Key }), - ...(input.S3ObjectVersion !== undefined && { S3ObjectVersion: input.S3ObjectVersion }), - ...(input.ZipFile !== undefined && { ZipFile: context.base64Encoder(input.ZipFile) }), + ...(input.ImageUri !== undefined && input.ImageUri !== null && { ImageUri: input.ImageUri }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3Key !== undefined && input.S3Key !== null && { S3Key: input.S3Key }), + ...(input.S3ObjectVersion !== undefined && + input.S3ObjectVersion !== null && { S3ObjectVersion: input.S3ObjectVersion }), + ...(input.ZipFile !== undefined && input.ZipFile !== null && { ZipFile: context.base64Encoder(input.ZipFile) }), }; }; const serializeAws_restJson1ImageConfig = (input: ImageConfig, context: __SerdeContext): any => { return { - ...(input.Command !== undefined && { Command: serializeAws_restJson1StringList(input.Command, context) }), - ...(input.EntryPoint !== undefined && { EntryPoint: serializeAws_restJson1StringList(input.EntryPoint, context) }), - ...(input.WorkingDirectory !== undefined && { WorkingDirectory: input.WorkingDirectory }), + ...(input.Command !== undefined && + input.Command !== null && { Command: serializeAws_restJson1StringList(input.Command, context) }), + ...(input.EntryPoint !== undefined && + input.EntryPoint !== null && { EntryPoint: serializeAws_restJson1StringList(input.EntryPoint, context) }), + ...(input.WorkingDirectory !== undefined && + input.WorkingDirectory !== null && { WorkingDirectory: input.WorkingDirectory }), }; }; const serializeAws_restJson1LayerList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1LayerVersionContentInput = ( @@ -9425,35 +9430,57 @@ const serializeAws_restJson1LayerVersionContentInput = ( context: __SerdeContext ): any => { return { - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3Key !== undefined && { S3Key: input.S3Key }), - ...(input.S3ObjectVersion !== undefined && { S3ObjectVersion: input.S3ObjectVersion }), - ...(input.ZipFile !== undefined && { ZipFile: context.base64Encoder(input.ZipFile) }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3Key !== undefined && input.S3Key !== null && { S3Key: input.S3Key }), + ...(input.S3ObjectVersion !== undefined && + input.S3ObjectVersion !== null && { S3ObjectVersion: input.S3ObjectVersion }), + ...(input.ZipFile !== undefined && input.ZipFile !== null && { ZipFile: context.base64Encoder(input.ZipFile) }), }; }; const serializeAws_restJson1OnFailure = (input: OnFailure, context: __SerdeContext): any => { return { - ...(input.Destination !== undefined && { Destination: input.Destination }), + ...(input.Destination !== undefined && input.Destination !== null && { Destination: input.Destination }), }; }; const serializeAws_restJson1OnSuccess = (input: OnSuccess, context: __SerdeContext): any => { return { - ...(input.Destination !== undefined && { Destination: input.Destination }), + ...(input.Destination !== undefined && input.Destination !== null && { Destination: input.Destination }), }; }; const serializeAws_restJson1Queues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SigningProfileVersionArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SourceAccessConfiguration = ( @@ -9461,8 +9488,8 @@ const serializeAws_restJson1SourceAccessConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.URI !== undefined && { URI: input.URI }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.URI !== undefined && input.URI !== null && { URI: input.URI }), }; }; @@ -9470,43 +9497,75 @@ const serializeAws_restJson1SourceAccessConfigurations = ( input: SourceAccessConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SourceAccessConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SourceAccessConfiguration(entry, context); + }); }; const serializeAws_restJson1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Topics = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TracingConfig = (input: TracingConfig, context: __SerdeContext): any => { return { - ...(input.Mode !== undefined && { Mode: input.Mode }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), }; }; const serializeAws_restJson1VpcConfig = (input: VpcConfig, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_restJson1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_restJson1SubnetIds(input.SubnetIds, context) }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_restJson1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_restJson1SubnetIds(input.SubnetIds, context) }), }; }; @@ -9542,13 +9601,15 @@ const deserializeAws_restJson1AdditionalVersionWeights = ( output: any, context: __SerdeContext ): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AliasConfiguration = (output: any, context: __SerdeContext): AliasConfiguration => { @@ -9567,7 +9628,14 @@ const deserializeAws_restJson1AliasConfiguration = (output: any, context: __Serd }; const deserializeAws_restJson1AliasList = (output: any, context: __SerdeContext): AliasConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AliasConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AliasConfiguration(entry, context); + }); }; const deserializeAws_restJson1AliasRoutingConfiguration = ( @@ -9615,7 +9683,14 @@ const deserializeAws_restJson1CodeSigningConfig = (output: any, context: __Serde }; const deserializeAws_restJson1CodeSigningConfigList = (output: any, context: __SerdeContext): CodeSigningConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CodeSigningConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CodeSigningConfig(entry, context); + }); }; const deserializeAws_restJson1CodeSigningPolicies = (output: any, context: __SerdeContext): CodeSigningPolicies => { @@ -9628,7 +9703,14 @@ const deserializeAws_restJson1CodeSigningPolicies = (output: any, context: __Ser }; const deserializeAws_restJson1CompatibleRuntimes = (output: any, context: __SerdeContext): (Runtime | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Concurrency = (output: any, context: __SerdeContext): Concurrency => { @@ -9683,13 +9765,15 @@ const deserializeAws_restJson1EnvironmentVariables = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1EventSourceMappingConfiguration = ( @@ -9764,7 +9848,14 @@ const deserializeAws_restJson1EventSourceMappingsList = ( output: any, context: __SerdeContext ): EventSourceMappingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EventSourceMappingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EventSourceMappingConfiguration(entry, context); + }); }; const deserializeAws_restJson1FileSystemConfig = (output: any, context: __SerdeContext): FileSystemConfig => { @@ -9776,11 +9867,25 @@ const deserializeAws_restJson1FileSystemConfig = (output: any, context: __SerdeC }; const deserializeAws_restJson1FileSystemConfigList = (output: any, context: __SerdeContext): FileSystemConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FileSystemConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FileSystemConfig(entry, context); + }); }; const deserializeAws_restJson1FunctionArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1FunctionCodeLocation = (output: any, context: __SerdeContext): FunctionCodeLocation => { @@ -9892,11 +9997,25 @@ const deserializeAws_restJson1FunctionEventInvokeConfigList = ( output: any, context: __SerdeContext ): FunctionEventInvokeConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FunctionEventInvokeConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FunctionEventInvokeConfig(entry, context); + }); }; const deserializeAws_restJson1FunctionList = (output: any, context: __SerdeContext): FunctionConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FunctionConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FunctionConfiguration(entry, context); + }); }; const deserializeAws_restJson1ImageConfig = (output: any, context: __SerdeContext): ImageConfig => { @@ -9948,7 +10067,14 @@ const deserializeAws_restJson1Layer = (output: any, context: __SerdeContext): La }; const deserializeAws_restJson1LayersList = (output: any, context: __SerdeContext): LayersListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LayersListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LayersListItem(entry, context); + }); }; const deserializeAws_restJson1LayersListItem = (output: any, context: __SerdeContext): LayersListItem => { @@ -9963,7 +10089,14 @@ const deserializeAws_restJson1LayersListItem = (output: any, context: __SerdeCon }; const deserializeAws_restJson1LayersReferenceList = (output: any, context: __SerdeContext): Layer[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Layer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Layer(entry, context); + }); }; const deserializeAws_restJson1LayerVersionContentOutput = ( @@ -9984,7 +10117,14 @@ const deserializeAws_restJson1LayerVersionContentOutput = ( }; const deserializeAws_restJson1LayerVersionsList = (output: any, context: __SerdeContext): LayerVersionsListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LayerVersionsListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LayerVersionsListItem(entry, context); + }); }; const deserializeAws_restJson1LayerVersionsListItem = (output: any, context: __SerdeContext): LayerVersionsListItem => { @@ -10018,9 +10158,14 @@ const deserializeAws_restJson1ProvisionedConcurrencyConfigList = ( output: any, context: __SerdeContext ): ProvisionedConcurrencyConfigListItem[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1ProvisionedConcurrencyConfigListItem(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProvisionedConcurrencyConfigListItem(entry, context); + }); }; const deserializeAws_restJson1ProvisionedConcurrencyConfigListItem = ( @@ -10051,15 +10196,36 @@ const deserializeAws_restJson1ProvisionedConcurrencyConfigListItem = ( }; const deserializeAws_restJson1Queues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SigningProfileVersionArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SourceAccessConfiguration = ( @@ -10076,29 +10242,59 @@ const deserializeAws_restJson1SourceAccessConfigurations = ( output: any, context: __SerdeContext ): SourceAccessConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SourceAccessConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SourceAccessConfiguration(entry, context); + }); }; const deserializeAws_restJson1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Topics = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TracingConfigResponse = (output: any, context: __SerdeContext): TracingConfigResponse => { @@ -10141,6 +10337,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-lex-model-building-service/protocols/Aws_restJson1.ts b/clients/client-lex-model-building-service/protocols/Aws_restJson1.ts index 7e862e3cc627..be0949aa8938 100644 --- a/clients/client-lex-model-building-service/protocols/Aws_restJson1.ts +++ b/clients/client-lex-model-building-service/protocols/Aws_restJson1.ts @@ -126,7 +126,7 @@ export const serializeAws_restJson1CreateBotVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/bots/{name}/versions"; if (input.name !== undefined) { @@ -140,7 +140,7 @@ export const serializeAws_restJson1CreateBotVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.checksum !== undefined && { checksum: input.checksum }), + ...(input.checksum !== undefined && input.checksum !== null && { checksum: input.checksum }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -159,7 +159,7 @@ export const serializeAws_restJson1CreateIntentVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/intents/{name}/versions"; if (input.name !== undefined) { @@ -173,7 +173,7 @@ export const serializeAws_restJson1CreateIntentVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.checksum !== undefined && { checksum: input.checksum }), + ...(input.checksum !== undefined && input.checksum !== null && { checksum: input.checksum }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -192,7 +192,7 @@ export const serializeAws_restJson1CreateSlotTypeVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/slottypes/{name}/versions"; if (input.name !== undefined) { @@ -206,7 +206,7 @@ export const serializeAws_restJson1CreateSlotTypeVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.checksum !== undefined && { checksum: input.checksum }), + ...(input.checksum !== undefined && input.checksum !== null && { checksum: input.checksum }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -224,9 +224,7 @@ export const serializeAws_restJson1DeleteBotCommand = async ( input: DeleteBotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -254,9 +252,7 @@ export const serializeAws_restJson1DeleteBotAliasCommand = async ( input: DeleteBotAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{botName}/aliases/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -293,9 +289,7 @@ export const serializeAws_restJson1DeleteBotChannelAssociationCommand = async ( input: DeleteBotChannelAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{botName}/aliases/{botAlias}/channels/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -341,9 +335,7 @@ export const serializeAws_restJson1DeleteBotVersionCommand = async ( input: DeleteBotVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{name}/versions/{version}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -380,9 +372,7 @@ export const serializeAws_restJson1DeleteIntentCommand = async ( input: DeleteIntentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/intents/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -410,9 +400,7 @@ export const serializeAws_restJson1DeleteIntentVersionCommand = async ( input: DeleteIntentVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/intents/{name}/versions/{version}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -449,9 +437,7 @@ export const serializeAws_restJson1DeleteSlotTypeCommand = async ( input: DeleteSlotTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/slottypes/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -479,9 +465,7 @@ export const serializeAws_restJson1DeleteSlotTypeVersionCommand = async ( input: DeleteSlotTypeVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/slottypes/{name}/version/{version}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -518,9 +502,7 @@ export const serializeAws_restJson1DeleteUtterancesCommand = async ( input: DeleteUtterancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{botName}/utterances/{userId}"; if (input.botName !== undefined) { const labelValue: string = input.botName; @@ -557,9 +539,7 @@ export const serializeAws_restJson1GetBotCommand = async ( input: GetBotCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{name}/versions/{versionOrAlias}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -596,9 +576,7 @@ export const serializeAws_restJson1GetBotAliasCommand = async ( input: GetBotAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{botName}/aliases/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -635,9 +613,7 @@ export const serializeAws_restJson1GetBotAliasesCommand = async ( input: GetBotAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{botName}/aliases"; if (input.botName !== undefined) { const labelValue: string = input.botName; @@ -671,9 +647,7 @@ export const serializeAws_restJson1GetBotChannelAssociationCommand = async ( input: GetBotChannelAssociationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{botName}/aliases/{botAlias}/channels/{name}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -719,9 +693,7 @@ export const serializeAws_restJson1GetBotChannelAssociationsCommand = async ( input: GetBotChannelAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{botName}/aliases/{botAlias}/channels"; if (input.botName !== undefined) { const labelValue: string = input.botName; @@ -764,9 +736,7 @@ export const serializeAws_restJson1GetBotsCommand = async ( input: GetBotsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -791,9 +761,7 @@ export const serializeAws_restJson1GetBotVersionsCommand = async ( input: GetBotVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{name}/versions"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -826,9 +794,7 @@ export const serializeAws_restJson1GetBuiltinIntentCommand = async ( input: GetBuiltinIntentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/builtins/intents/{signature}"; if (input.signature !== undefined) { const labelValue: string = input.signature; @@ -856,9 +822,7 @@ export const serializeAws_restJson1GetBuiltinIntentsCommand = async ( input: GetBuiltinIntentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/builtins/intents"; const query: any = { ...(input.locale !== undefined && { locale: input.locale }), @@ -884,9 +848,7 @@ export const serializeAws_restJson1GetBuiltinSlotTypesCommand = async ( input: GetBuiltinSlotTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/builtins/slottypes"; const query: any = { ...(input.locale !== undefined && { locale: input.locale }), @@ -912,9 +874,7 @@ export const serializeAws_restJson1GetExportCommand = async ( input: GetExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/exports"; const query: any = { ...(input.name !== undefined && { name: input.name }), @@ -940,9 +900,7 @@ export const serializeAws_restJson1GetImportCommand = async ( input: GetImportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/imports/{importId}"; if (input.importId !== undefined) { const labelValue: string = input.importId; @@ -970,9 +928,7 @@ export const serializeAws_restJson1GetIntentCommand = async ( input: GetIntentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/intents/{name}/versions/{version}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -1009,9 +965,7 @@ export const serializeAws_restJson1GetIntentsCommand = async ( input: GetIntentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/intents"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1036,9 +990,7 @@ export const serializeAws_restJson1GetIntentVersionsCommand = async ( input: GetIntentVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/intents/{name}/versions"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -1071,9 +1023,7 @@ export const serializeAws_restJson1GetSlotTypeCommand = async ( input: GetSlotTypeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/slottypes/{name}/versions/{version}"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -1110,9 +1060,7 @@ export const serializeAws_restJson1GetSlotTypesCommand = async ( input: GetSlotTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/slottypes"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -1137,9 +1085,7 @@ export const serializeAws_restJson1GetSlotTypeVersionsCommand = async ( input: GetSlotTypeVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/slottypes/{name}/versions"; if (input.name !== undefined) { const labelValue: string = input.name; @@ -1172,9 +1118,7 @@ export const serializeAws_restJson1GetUtterancesViewCommand = async ( input: GetUtterancesViewCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bots/{botName}/utterances"; if (input.botName !== undefined) { const labelValue: string = input.botName; @@ -1208,9 +1152,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1239,7 +1181,7 @@ export const serializeAws_restJson1PutBotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/bots/{name}/versions/$LATEST"; if (input.name !== undefined) { @@ -1253,27 +1195,36 @@ export const serializeAws_restJson1PutBotCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.abortStatement !== undefined && { - abortStatement: serializeAws_restJson1Statement(input.abortStatement, context), - }), - ...(input.checksum !== undefined && { checksum: input.checksum }), - ...(input.childDirected !== undefined && { childDirected: input.childDirected }), - ...(input.clarificationPrompt !== undefined && { - clarificationPrompt: serializeAws_restJson1Prompt(input.clarificationPrompt, context), - }), - ...(input.createVersion !== undefined && { createVersion: input.createVersion }), - ...(input.description !== undefined && { description: input.description }), - ...(input.detectSentiment !== undefined && { detectSentiment: input.detectSentiment }), - ...(input.enableModelImprovements !== undefined && { enableModelImprovements: input.enableModelImprovements }), - ...(input.idleSessionTTLInSeconds !== undefined && { idleSessionTTLInSeconds: input.idleSessionTTLInSeconds }), - ...(input.intents !== undefined && { intents: serializeAws_restJson1IntentList(input.intents, context) }), - ...(input.locale !== undefined && { locale: input.locale }), - ...(input.nluIntentConfidenceThreshold !== undefined && { - nluIntentConfidenceThreshold: input.nluIntentConfidenceThreshold, - }), - ...(input.processBehavior !== undefined && { processBehavior: input.processBehavior }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), - ...(input.voiceId !== undefined && { voiceId: input.voiceId }), + ...(input.abortStatement !== undefined && + input.abortStatement !== null && { + abortStatement: serializeAws_restJson1Statement(input.abortStatement, context), + }), + ...(input.checksum !== undefined && input.checksum !== null && { checksum: input.checksum }), + ...(input.childDirected !== undefined && input.childDirected !== null && { childDirected: input.childDirected }), + ...(input.clarificationPrompt !== undefined && + input.clarificationPrompt !== null && { + clarificationPrompt: serializeAws_restJson1Prompt(input.clarificationPrompt, context), + }), + ...(input.createVersion !== undefined && input.createVersion !== null && { createVersion: input.createVersion }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.detectSentiment !== undefined && + input.detectSentiment !== null && { detectSentiment: input.detectSentiment }), + ...(input.enableModelImprovements !== undefined && + input.enableModelImprovements !== null && { enableModelImprovements: input.enableModelImprovements }), + ...(input.idleSessionTTLInSeconds !== undefined && + input.idleSessionTTLInSeconds !== null && { idleSessionTTLInSeconds: input.idleSessionTTLInSeconds }), + ...(input.intents !== undefined && + input.intents !== null && { intents: serializeAws_restJson1IntentList(input.intents, context) }), + ...(input.locale !== undefined && input.locale !== null && { locale: input.locale }), + ...(input.nluIntentConfidenceThreshold !== undefined && + input.nluIntentConfidenceThreshold !== null && { + nluIntentConfidenceThreshold: input.nluIntentConfidenceThreshold, + }), + ...(input.processBehavior !== undefined && + input.processBehavior !== null && { processBehavior: input.processBehavior }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.voiceId !== undefined && input.voiceId !== null && { voiceId: input.voiceId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1292,7 +1243,7 @@ export const serializeAws_restJson1PutBotAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/bots/{botName}/aliases/{name}"; if (input.name !== undefined) { @@ -1315,13 +1266,15 @@ export const serializeAws_restJson1PutBotAliasCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.botVersion !== undefined && { botVersion: input.botVersion }), - ...(input.checksum !== undefined && { checksum: input.checksum }), - ...(input.conversationLogs !== undefined && { - conversationLogs: serializeAws_restJson1ConversationLogsRequest(input.conversationLogs, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.botVersion !== undefined && input.botVersion !== null && { botVersion: input.botVersion }), + ...(input.checksum !== undefined && input.checksum !== null && { checksum: input.checksum }), + ...(input.conversationLogs !== undefined && + input.conversationLogs !== null && { + conversationLogs: serializeAws_restJson1ConversationLogsRequest(input.conversationLogs, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1340,7 +1293,7 @@ export const serializeAws_restJson1PutIntentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/intents/{name}/versions/$LATEST"; if (input.name !== undefined) { @@ -1354,41 +1307,53 @@ export const serializeAws_restJson1PutIntentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.checksum !== undefined && { checksum: input.checksum }), - ...(input.conclusionStatement !== undefined && { - conclusionStatement: serializeAws_restJson1Statement(input.conclusionStatement, context), - }), - ...(input.confirmationPrompt !== undefined && { - confirmationPrompt: serializeAws_restJson1Prompt(input.confirmationPrompt, context), - }), - ...(input.createVersion !== undefined && { createVersion: input.createVersion }), - ...(input.description !== undefined && { description: input.description }), - ...(input.dialogCodeHook !== undefined && { - dialogCodeHook: serializeAws_restJson1CodeHook(input.dialogCodeHook, context), - }), - ...(input.followUpPrompt !== undefined && { - followUpPrompt: serializeAws_restJson1FollowUpPrompt(input.followUpPrompt, context), - }), - ...(input.fulfillmentActivity !== undefined && { - fulfillmentActivity: serializeAws_restJson1FulfillmentActivity(input.fulfillmentActivity, context), - }), - ...(input.inputContexts !== undefined && { - inputContexts: serializeAws_restJson1InputContextList(input.inputContexts, context), - }), - ...(input.kendraConfiguration !== undefined && { - kendraConfiguration: serializeAws_restJson1KendraConfiguration(input.kendraConfiguration, context), - }), - ...(input.outputContexts !== undefined && { - outputContexts: serializeAws_restJson1OutputContextList(input.outputContexts, context), - }), - ...(input.parentIntentSignature !== undefined && { parentIntentSignature: input.parentIntentSignature }), - ...(input.rejectionStatement !== undefined && { - rejectionStatement: serializeAws_restJson1Statement(input.rejectionStatement, context), - }), - ...(input.sampleUtterances !== undefined && { - sampleUtterances: serializeAws_restJson1IntentUtteranceList(input.sampleUtterances, context), - }), - ...(input.slots !== undefined && { slots: serializeAws_restJson1SlotList(input.slots, context) }), + ...(input.checksum !== undefined && input.checksum !== null && { checksum: input.checksum }), + ...(input.conclusionStatement !== undefined && + input.conclusionStatement !== null && { + conclusionStatement: serializeAws_restJson1Statement(input.conclusionStatement, context), + }), + ...(input.confirmationPrompt !== undefined && + input.confirmationPrompt !== null && { + confirmationPrompt: serializeAws_restJson1Prompt(input.confirmationPrompt, context), + }), + ...(input.createVersion !== undefined && input.createVersion !== null && { createVersion: input.createVersion }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.dialogCodeHook !== undefined && + input.dialogCodeHook !== null && { + dialogCodeHook: serializeAws_restJson1CodeHook(input.dialogCodeHook, context), + }), + ...(input.followUpPrompt !== undefined && + input.followUpPrompt !== null && { + followUpPrompt: serializeAws_restJson1FollowUpPrompt(input.followUpPrompt, context), + }), + ...(input.fulfillmentActivity !== undefined && + input.fulfillmentActivity !== null && { + fulfillmentActivity: serializeAws_restJson1FulfillmentActivity(input.fulfillmentActivity, context), + }), + ...(input.inputContexts !== undefined && + input.inputContexts !== null && { + inputContexts: serializeAws_restJson1InputContextList(input.inputContexts, context), + }), + ...(input.kendraConfiguration !== undefined && + input.kendraConfiguration !== null && { + kendraConfiguration: serializeAws_restJson1KendraConfiguration(input.kendraConfiguration, context), + }), + ...(input.outputContexts !== undefined && + input.outputContexts !== null && { + outputContexts: serializeAws_restJson1OutputContextList(input.outputContexts, context), + }), + ...(input.parentIntentSignature !== undefined && + input.parentIntentSignature !== null && { parentIntentSignature: input.parentIntentSignature }), + ...(input.rejectionStatement !== undefined && + input.rejectionStatement !== null && { + rejectionStatement: serializeAws_restJson1Statement(input.rejectionStatement, context), + }), + ...(input.sampleUtterances !== undefined && + input.sampleUtterances !== null && { + sampleUtterances: serializeAws_restJson1IntentUtteranceList(input.sampleUtterances, context), + }), + ...(input.slots !== undefined && + input.slots !== null && { slots: serializeAws_restJson1SlotList(input.slots, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1407,7 +1372,7 @@ export const serializeAws_restJson1PutSlotTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/slottypes/{name}/versions/$LATEST"; if (input.name !== undefined) { @@ -1421,17 +1386,21 @@ export const serializeAws_restJson1PutSlotTypeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.checksum !== undefined && { checksum: input.checksum }), - ...(input.createVersion !== undefined && { createVersion: input.createVersion }), - ...(input.description !== undefined && { description: input.description }), - ...(input.enumerationValues !== undefined && { - enumerationValues: serializeAws_restJson1EnumerationValues(input.enumerationValues, context), - }), - ...(input.parentSlotTypeSignature !== undefined && { parentSlotTypeSignature: input.parentSlotTypeSignature }), - ...(input.slotTypeConfigurations !== undefined && { - slotTypeConfigurations: serializeAws_restJson1SlotTypeConfigurations(input.slotTypeConfigurations, context), - }), - ...(input.valueSelectionStrategy !== undefined && { valueSelectionStrategy: input.valueSelectionStrategy }), + ...(input.checksum !== undefined && input.checksum !== null && { checksum: input.checksum }), + ...(input.createVersion !== undefined && input.createVersion !== null && { createVersion: input.createVersion }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.enumerationValues !== undefined && + input.enumerationValues !== null && { + enumerationValues: serializeAws_restJson1EnumerationValues(input.enumerationValues, context), + }), + ...(input.parentSlotTypeSignature !== undefined && + input.parentSlotTypeSignature !== null && { parentSlotTypeSignature: input.parentSlotTypeSignature }), + ...(input.slotTypeConfigurations !== undefined && + input.slotTypeConfigurations !== null && { + slotTypeConfigurations: serializeAws_restJson1SlotTypeConfigurations(input.slotTypeConfigurations, context), + }), + ...(input.valueSelectionStrategy !== undefined && + input.valueSelectionStrategy !== null && { valueSelectionStrategy: input.valueSelectionStrategy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1450,15 +1419,16 @@ export const serializeAws_restJson1StartImportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/imports"; let body: any; body = JSON.stringify({ - ...(input.mergeStrategy !== undefined && { mergeStrategy: input.mergeStrategy }), - ...(input.payload !== undefined && { payload: context.base64Encoder(input.payload) }), - ...(input.resourceType !== undefined && { resourceType: input.resourceType }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.mergeStrategy !== undefined && input.mergeStrategy !== null && { mergeStrategy: input.mergeStrategy }), + ...(input.payload !== undefined && input.payload !== null && { payload: context.base64Encoder(input.payload) }), + ...(input.resourceType !== undefined && input.resourceType !== null && { resourceType: input.resourceType }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1477,7 +1447,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -1491,7 +1461,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1509,9 +1480,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -5629,8 +5598,9 @@ const deserializeAws_restJson1ResourceInUseExceptionResponse = async ( const serializeAws_restJson1CodeHook = (input: CodeHook, context: __SerdeContext): any => { return { - ...(input.messageVersion !== undefined && { messageVersion: input.messageVersion }), - ...(input.uri !== undefined && { uri: input.uri }), + ...(input.messageVersion !== undefined && + input.messageVersion !== null && { messageVersion: input.messageVersion }), + ...(input.uri !== undefined && input.uri !== null && { uri: input.uri }), }; }; @@ -5639,172 +5609,258 @@ const serializeAws_restJson1ConversationLogsRequest = ( context: __SerdeContext ): any => { return { - ...(input.iamRoleArn !== undefined && { iamRoleArn: input.iamRoleArn }), - ...(input.logSettings !== undefined && { - logSettings: serializeAws_restJson1LogSettingsRequestList(input.logSettings, context), - }), + ...(input.iamRoleArn !== undefined && input.iamRoleArn !== null && { iamRoleArn: input.iamRoleArn }), + ...(input.logSettings !== undefined && + input.logSettings !== null && { + logSettings: serializeAws_restJson1LogSettingsRequestList(input.logSettings, context), + }), }; }; const serializeAws_restJson1EnumerationValue = (input: EnumerationValue, context: __SerdeContext): any => { return { - ...(input.synonyms !== undefined && { synonyms: serializeAws_restJson1SynonymList(input.synonyms, context) }), - ...(input.value !== undefined && { value: input.value }), + ...(input.synonyms !== undefined && + input.synonyms !== null && { synonyms: serializeAws_restJson1SynonymList(input.synonyms, context) }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1EnumerationValues = (input: EnumerationValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1EnumerationValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1EnumerationValue(entry, context); + }); }; const serializeAws_restJson1FollowUpPrompt = (input: FollowUpPrompt, context: __SerdeContext): any => { return { - ...(input.prompt !== undefined && { prompt: serializeAws_restJson1Prompt(input.prompt, context) }), - ...(input.rejectionStatement !== undefined && { - rejectionStatement: serializeAws_restJson1Statement(input.rejectionStatement, context), - }), + ...(input.prompt !== undefined && + input.prompt !== null && { prompt: serializeAws_restJson1Prompt(input.prompt, context) }), + ...(input.rejectionStatement !== undefined && + input.rejectionStatement !== null && { + rejectionStatement: serializeAws_restJson1Statement(input.rejectionStatement, context), + }), }; }; const serializeAws_restJson1FulfillmentActivity = (input: FulfillmentActivity, context: __SerdeContext): any => { return { - ...(input.codeHook !== undefined && { codeHook: serializeAws_restJson1CodeHook(input.codeHook, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.codeHook !== undefined && + input.codeHook !== null && { codeHook: serializeAws_restJson1CodeHook(input.codeHook, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1InputContext = (input: InputContext, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_restJson1InputContextList = (input: InputContext[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1InputContext(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputContext(entry, context); + }); }; const serializeAws_restJson1Intent = (input: Intent, context: __SerdeContext): any => { return { - ...(input.intentName !== undefined && { intentName: input.intentName }), - ...(input.intentVersion !== undefined && { intentVersion: input.intentVersion }), + ...(input.intentName !== undefined && input.intentName !== null && { intentName: input.intentName }), + ...(input.intentVersion !== undefined && input.intentVersion !== null && { intentVersion: input.intentVersion }), }; }; const serializeAws_restJson1IntentList = (input: Intent[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Intent(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Intent(entry, context); + }); }; const serializeAws_restJson1IntentUtteranceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1KendraConfiguration = (input: KendraConfiguration, context: __SerdeContext): any => { return { - ...(input.kendraIndex !== undefined && { kendraIndex: input.kendraIndex }), - ...(input.queryFilterString !== undefined && { queryFilterString: input.queryFilterString }), - ...(input.role !== undefined && { role: input.role }), + ...(input.kendraIndex !== undefined && input.kendraIndex !== null && { kendraIndex: input.kendraIndex }), + ...(input.queryFilterString !== undefined && + input.queryFilterString !== null && { queryFilterString: input.queryFilterString }), + ...(input.role !== undefined && input.role !== null && { role: input.role }), }; }; const serializeAws_restJson1LogSettingsRequest = (input: LogSettingsRequest, context: __SerdeContext): any => { return { - ...(input.destination !== undefined && { destination: input.destination }), - ...(input.kmsKeyArn !== undefined && { kmsKeyArn: input.kmsKeyArn }), - ...(input.logType !== undefined && { logType: input.logType }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.destination !== undefined && input.destination !== null && { destination: input.destination }), + ...(input.kmsKeyArn !== undefined && input.kmsKeyArn !== null && { kmsKeyArn: input.kmsKeyArn }), + ...(input.logType !== undefined && input.logType !== null && { logType: input.logType }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_restJson1LogSettingsRequestList = (input: LogSettingsRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1LogSettingsRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1LogSettingsRequest(entry, context); + }); }; const serializeAws_restJson1Message = (input: Message, context: __SerdeContext): any => { return { - ...(input.content !== undefined && { content: input.content }), - ...(input.contentType !== undefined && { contentType: input.contentType }), - ...(input.groupNumber !== undefined && { groupNumber: input.groupNumber }), + ...(input.content !== undefined && input.content !== null && { content: input.content }), + ...(input.contentType !== undefined && input.contentType !== null && { contentType: input.contentType }), + ...(input.groupNumber !== undefined && input.groupNumber !== null && { groupNumber: input.groupNumber }), }; }; const serializeAws_restJson1MessageList = (input: Message[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Message(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Message(entry, context); + }); }; const serializeAws_restJson1OutputContext = (input: OutputContext, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.timeToLiveInSeconds !== undefined && { timeToLiveInSeconds: input.timeToLiveInSeconds }), - ...(input.turnsToLive !== undefined && { turnsToLive: input.turnsToLive }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.timeToLiveInSeconds !== undefined && + input.timeToLiveInSeconds !== null && { timeToLiveInSeconds: input.timeToLiveInSeconds }), + ...(input.turnsToLive !== undefined && input.turnsToLive !== null && { turnsToLive: input.turnsToLive }), }; }; const serializeAws_restJson1OutputContextList = (input: OutputContext[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1OutputContext(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1OutputContext(entry, context); + }); }; const serializeAws_restJson1Prompt = (input: Prompt, context: __SerdeContext): any => { return { - ...(input.maxAttempts !== undefined && { maxAttempts: input.maxAttempts }), - ...(input.messages !== undefined && { messages: serializeAws_restJson1MessageList(input.messages, context) }), - ...(input.responseCard !== undefined && { responseCard: input.responseCard }), + ...(input.maxAttempts !== undefined && input.maxAttempts !== null && { maxAttempts: input.maxAttempts }), + ...(input.messages !== undefined && + input.messages !== null && { messages: serializeAws_restJson1MessageList(input.messages, context) }), + ...(input.responseCard !== undefined && input.responseCard !== null && { responseCard: input.responseCard }), }; }; const serializeAws_restJson1Slot = (input: Slot, context: __SerdeContext): any => { return { - ...(input.defaultValueSpec !== undefined && { - defaultValueSpec: serializeAws_restJson1SlotDefaultValueSpec(input.defaultValueSpec, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.obfuscationSetting !== undefined && { obfuscationSetting: input.obfuscationSetting }), - ...(input.priority !== undefined && { priority: input.priority }), - ...(input.responseCard !== undefined && { responseCard: input.responseCard }), - ...(input.sampleUtterances !== undefined && { - sampleUtterances: serializeAws_restJson1SlotUtteranceList(input.sampleUtterances, context), - }), - ...(input.slotConstraint !== undefined && { slotConstraint: input.slotConstraint }), - ...(input.slotType !== undefined && { slotType: input.slotType }), - ...(input.slotTypeVersion !== undefined && { slotTypeVersion: input.slotTypeVersion }), - ...(input.valueElicitationPrompt !== undefined && { - valueElicitationPrompt: serializeAws_restJson1Prompt(input.valueElicitationPrompt, context), - }), + ...(input.defaultValueSpec !== undefined && + input.defaultValueSpec !== null && { + defaultValueSpec: serializeAws_restJson1SlotDefaultValueSpec(input.defaultValueSpec, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.obfuscationSetting !== undefined && + input.obfuscationSetting !== null && { obfuscationSetting: input.obfuscationSetting }), + ...(input.priority !== undefined && input.priority !== null && { priority: input.priority }), + ...(input.responseCard !== undefined && input.responseCard !== null && { responseCard: input.responseCard }), + ...(input.sampleUtterances !== undefined && + input.sampleUtterances !== null && { + sampleUtterances: serializeAws_restJson1SlotUtteranceList(input.sampleUtterances, context), + }), + ...(input.slotConstraint !== undefined && + input.slotConstraint !== null && { slotConstraint: input.slotConstraint }), + ...(input.slotType !== undefined && input.slotType !== null && { slotType: input.slotType }), + ...(input.slotTypeVersion !== undefined && + input.slotTypeVersion !== null && { slotTypeVersion: input.slotTypeVersion }), + ...(input.valueElicitationPrompt !== undefined && + input.valueElicitationPrompt !== null && { + valueElicitationPrompt: serializeAws_restJson1Prompt(input.valueElicitationPrompt, context), + }), }; }; const serializeAws_restJson1SlotDefaultValue = (input: SlotDefaultValue, context: __SerdeContext): any => { return { - ...(input.defaultValue !== undefined && { defaultValue: input.defaultValue }), + ...(input.defaultValue !== undefined && input.defaultValue !== null && { defaultValue: input.defaultValue }), }; }; const serializeAws_restJson1SlotDefaultValueList = (input: SlotDefaultValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SlotDefaultValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SlotDefaultValue(entry, context); + }); }; const serializeAws_restJson1SlotDefaultValueSpec = (input: SlotDefaultValueSpec, context: __SerdeContext): any => { return { - ...(input.defaultValueList !== undefined && { - defaultValueList: serializeAws_restJson1SlotDefaultValueList(input.defaultValueList, context), - }), + ...(input.defaultValueList !== undefined && + input.defaultValueList !== null && { + defaultValueList: serializeAws_restJson1SlotDefaultValueList(input.defaultValueList, context), + }), }; }; const serializeAws_restJson1SlotList = (input: Slot[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Slot(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Slot(entry, context); + }); }; const serializeAws_restJson1SlotTypeConfiguration = (input: SlotTypeConfiguration, context: __SerdeContext): any => { return { - ...(input.regexConfiguration !== undefined && { - regexConfiguration: serializeAws_restJson1SlotTypeRegexConfiguration(input.regexConfiguration, context), - }), + ...(input.regexConfiguration !== undefined && + input.regexConfiguration !== null && { + regexConfiguration: serializeAws_restJson1SlotTypeRegexConfiguration(input.regexConfiguration, context), + }), }; }; const serializeAws_restJson1SlotTypeConfigurations = (input: SlotTypeConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SlotTypeConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SlotTypeConfiguration(entry, context); + }); }; const serializeAws_restJson1SlotTypeRegexConfiguration = ( @@ -5812,34 +5868,56 @@ const serializeAws_restJson1SlotTypeRegexConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.pattern !== undefined && { pattern: input.pattern }), + ...(input.pattern !== undefined && input.pattern !== null && { pattern: input.pattern }), }; }; const serializeAws_restJson1SlotUtteranceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Statement = (input: Statement, context: __SerdeContext): any => { return { - ...(input.messages !== undefined && { messages: serializeAws_restJson1MessageList(input.messages, context) }), - ...(input.responseCard !== undefined && { responseCard: input.responseCard }), + ...(input.messages !== undefined && + input.messages !== null && { messages: serializeAws_restJson1MessageList(input.messages, context) }), + ...(input.responseCard !== undefined && input.responseCard !== null && { responseCard: input.responseCard }), }; }; const serializeAws_restJson1SynonymList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1BotAliasMetadata = (output: any, context: __SerdeContext): BotAliasMetadata => { @@ -5865,7 +5943,14 @@ const deserializeAws_restJson1BotAliasMetadata = (output: any, context: __SerdeC }; const deserializeAws_restJson1BotAliasMetadataList = (output: any, context: __SerdeContext): BotAliasMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BotAliasMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BotAliasMetadata(entry, context); + }); }; const deserializeAws_restJson1BotChannelAssociation = (output: any, context: __SerdeContext): BotChannelAssociation => { @@ -5893,7 +5978,14 @@ const deserializeAws_restJson1BotChannelAssociationList = ( output: any, context: __SerdeContext ): BotChannelAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BotChannelAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BotChannelAssociation(entry, context); + }); }; const deserializeAws_restJson1BotMetadata = (output: any, context: __SerdeContext): BotMetadata => { @@ -5914,7 +6006,14 @@ const deserializeAws_restJson1BotMetadata = (output: any, context: __SerdeContex }; const deserializeAws_restJson1BotMetadataList = (output: any, context: __SerdeContext): BotMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BotMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BotMetadata(entry, context); + }); }; const deserializeAws_restJson1BuiltinIntentMetadata = (output: any, context: __SerdeContext): BuiltinIntentMetadata => { @@ -5931,7 +6030,14 @@ const deserializeAws_restJson1BuiltinIntentMetadataList = ( output: any, context: __SerdeContext ): BuiltinIntentMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BuiltinIntentMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BuiltinIntentMetadata(entry, context); + }); }; const deserializeAws_restJson1BuiltinIntentSlot = (output: any, context: __SerdeContext): BuiltinIntentSlot => { @@ -5941,7 +6047,14 @@ const deserializeAws_restJson1BuiltinIntentSlot = (output: any, context: __Serde }; const deserializeAws_restJson1BuiltinIntentSlotList = (output: any, context: __SerdeContext): BuiltinIntentSlot[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BuiltinIntentSlot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BuiltinIntentSlot(entry, context); + }); }; const deserializeAws_restJson1BuiltinSlotTypeMetadata = ( @@ -5961,20 +6074,29 @@ const deserializeAws_restJson1BuiltinSlotTypeMetadataList = ( output: any, context: __SerdeContext ): BuiltinSlotTypeMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BuiltinSlotTypeMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BuiltinSlotTypeMetadata(entry, context); + }); }; const deserializeAws_restJson1ChannelConfigurationMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1CodeHook = (output: any, context: __SerdeContext): CodeHook => { @@ -6009,7 +6131,14 @@ const deserializeAws_restJson1EnumerationValue = (output: any, context: __SerdeC }; const deserializeAws_restJson1EnumerationValues = (output: any, context: __SerdeContext): EnumerationValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EnumerationValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EnumerationValue(entry, context); + }); }; const deserializeAws_restJson1FollowUpPrompt = (output: any, context: __SerdeContext): FollowUpPrompt => { @@ -6042,7 +6171,14 @@ const deserializeAws_restJson1InputContext = (output: any, context: __SerdeConte }; const deserializeAws_restJson1InputContextList = (output: any, context: __SerdeContext): InputContext[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputContext(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputContext(entry, context); + }); }; const deserializeAws_restJson1Intent = (output: any, context: __SerdeContext): Intent => { @@ -6054,7 +6190,14 @@ const deserializeAws_restJson1Intent = (output: any, context: __SerdeContext): I }; const deserializeAws_restJson1IntentList = (output: any, context: __SerdeContext): Intent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Intent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Intent(entry, context); + }); }; const deserializeAws_restJson1IntentMetadata = (output: any, context: __SerdeContext): IntentMetadata => { @@ -6074,11 +6217,25 @@ const deserializeAws_restJson1IntentMetadata = (output: any, context: __SerdeCon }; const deserializeAws_restJson1IntentMetadataList = (output: any, context: __SerdeContext): IntentMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IntentMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IntentMetadata(entry, context); + }); }; const deserializeAws_restJson1IntentUtteranceList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1KendraConfiguration = (output: any, context: __SerdeContext): KendraConfiguration => { @@ -6093,15 +6250,36 @@ const deserializeAws_restJson1KendraConfiguration = (output: any, context: __Ser }; const deserializeAws_restJson1ListOfUtterance = (output: any, context: __SerdeContext): UtteranceData[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UtteranceData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UtteranceData(entry, context); + }); }; const deserializeAws_restJson1ListsOfUtterances = (output: any, context: __SerdeContext): UtteranceList[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UtteranceList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UtteranceList(entry, context); + }); }; const deserializeAws_restJson1LocaleList = (output: any, context: __SerdeContext): (Locale | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1LogSettingsResponse = (output: any, context: __SerdeContext): LogSettingsResponse => { @@ -6119,7 +6297,14 @@ const deserializeAws_restJson1LogSettingsResponseList = ( output: any, context: __SerdeContext ): LogSettingsResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LogSettingsResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LogSettingsResponse(entry, context); + }); }; const deserializeAws_restJson1Message = (output: any, context: __SerdeContext): Message => { @@ -6131,7 +6316,14 @@ const deserializeAws_restJson1Message = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1MessageList = (output: any, context: __SerdeContext): Message[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Message(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Message(entry, context); + }); }; const deserializeAws_restJson1OutputContext = (output: any, context: __SerdeContext): OutputContext => { @@ -6146,7 +6338,14 @@ const deserializeAws_restJson1OutputContext = (output: any, context: __SerdeCont }; const deserializeAws_restJson1OutputContextList = (output: any, context: __SerdeContext): OutputContext[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutputContext(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutputContext(entry, context); + }); }; const deserializeAws_restJson1Prompt = (output: any, context: __SerdeContext): Prompt => { @@ -6204,7 +6403,14 @@ const deserializeAws_restJson1SlotDefaultValue = (output: any, context: __SerdeC }; const deserializeAws_restJson1SlotDefaultValueList = (output: any, context: __SerdeContext): SlotDefaultValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SlotDefaultValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SlotDefaultValue(entry, context); + }); }; const deserializeAws_restJson1SlotDefaultValueSpec = (output: any, context: __SerdeContext): SlotDefaultValueSpec => { @@ -6217,7 +6423,14 @@ const deserializeAws_restJson1SlotDefaultValueSpec = (output: any, context: __Se }; const deserializeAws_restJson1SlotList = (output: any, context: __SerdeContext): Slot[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Slot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Slot(entry, context); + }); }; const deserializeAws_restJson1SlotTypeConfiguration = (output: any, context: __SerdeContext): SlotTypeConfiguration => { @@ -6233,7 +6446,14 @@ const deserializeAws_restJson1SlotTypeConfigurations = ( output: any, context: __SerdeContext ): SlotTypeConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SlotTypeConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SlotTypeConfiguration(entry, context); + }); }; const deserializeAws_restJson1SlotTypeMetadata = (output: any, context: __SerdeContext): SlotTypeMetadata => { @@ -6253,7 +6473,14 @@ const deserializeAws_restJson1SlotTypeMetadata = (output: any, context: __SerdeC }; const deserializeAws_restJson1SlotTypeMetadataList = (output: any, context: __SerdeContext): SlotTypeMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SlotTypeMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SlotTypeMetadata(entry, context); + }); }; const deserializeAws_restJson1SlotTypeRegexConfiguration = ( @@ -6266,7 +6493,14 @@ const deserializeAws_restJson1SlotTypeRegexConfiguration = ( }; const deserializeAws_restJson1SlotUtteranceList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Statement = (output: any, context: __SerdeContext): Statement => { @@ -6280,11 +6514,25 @@ const deserializeAws_restJson1Statement = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SynonymList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -6295,7 +6543,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1UtteranceData = (output: any, context: __SerdeContext): UtteranceData => { @@ -6346,6 +6601,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-lex-runtime-service/protocols/Aws_restJson1.ts b/clients/client-lex-runtime-service/protocols/Aws_restJson1.ts index 488fa86adedd..1089326d8c37 100644 --- a/clients/client-lex-runtime-service/protocols/Aws_restJson1.ts +++ b/clients/client-lex-runtime-service/protocols/Aws_restJson1.ts @@ -43,9 +43,7 @@ export const serializeAws_restJson1DeleteSessionCommand = async ( input: DeleteSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bot/{botName}/alias/{botAlias}/user/{userId}/session"; if (input.botName !== undefined) { const labelValue: string = input.botName; @@ -91,9 +89,7 @@ export const serializeAws_restJson1GetSessionCommand = async ( input: GetSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bot/{botName}/alias/{botAlias}/user/{userId}/session"; if (input.botName !== undefined) { const labelValue: string = input.botName; @@ -144,18 +140,22 @@ export const serializeAws_restJson1PostContentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", "x-amz-content-sha256": "UNSIGNED-PAYLOAD", ...(isSerializableHeaderValue(input.sessionAttributes) && { - "x-amz-lex-session-attributes": __LazyJsonString.fromObject(input.sessionAttributes!), + "x-amz-lex-session-attributes": Buffer.from(__LazyJsonString.fromObject(input.sessionAttributes!)).toString( + "base64" + ), }), ...(isSerializableHeaderValue(input.requestAttributes) && { - "x-amz-lex-request-attributes": __LazyJsonString.fromObject(input.requestAttributes!), + "x-amz-lex-request-attributes": Buffer.from(__LazyJsonString.fromObject(input.requestAttributes!)).toString( + "base64" + ), }), ...(isSerializableHeaderValue(input.contentType) && { "Content-Type": input.contentType! }), ...(isSerializableHeaderValue(input.accept) && { Accept: input.accept! }), ...(isSerializableHeaderValue(input.activeContexts) && { - "x-amz-lex-active-contexts": __LazyJsonString.fromObject(input.activeContexts!), + "x-amz-lex-active-contexts": Buffer.from(__LazyJsonString.fromObject(input.activeContexts!)).toString("base64"), }), }; let resolvedPath = "/bot/{botName}/alias/{botAlias}/user/{userId}/content"; @@ -207,7 +207,7 @@ export const serializeAws_restJson1PostTextCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/bot/{botName}/alias/{botAlias}/user/{userId}/text"; if (input.botName !== undefined) { @@ -239,16 +239,19 @@ export const serializeAws_restJson1PostTextCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.activeContexts !== undefined && { - activeContexts: serializeAws_restJson1ActiveContextsList(input.activeContexts, context), - }), - ...(input.inputText !== undefined && { inputText: input.inputText }), - ...(input.requestAttributes !== undefined && { - requestAttributes: serializeAws_restJson1StringMap(input.requestAttributes, context), - }), - ...(input.sessionAttributes !== undefined && { - sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context), - }), + ...(input.activeContexts !== undefined && + input.activeContexts !== null && { + activeContexts: serializeAws_restJson1ActiveContextsList(input.activeContexts, context), + }), + ...(input.inputText !== undefined && input.inputText !== null && { inputText: input.inputText }), + ...(input.requestAttributes !== undefined && + input.requestAttributes !== null && { + requestAttributes: serializeAws_restJson1StringMap(input.requestAttributes, context), + }), + ...(input.sessionAttributes !== undefined && + input.sessionAttributes !== null && { + sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -267,7 +270,7 @@ export const serializeAws_restJson1PutSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.accept) && { Accept: input.accept! }), }; let resolvedPath = "/bot/{botName}/alias/{botAlias}/user/{userId}/session"; @@ -300,18 +303,20 @@ export const serializeAws_restJson1PutSessionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.activeContexts !== undefined && { - activeContexts: serializeAws_restJson1ActiveContextsList(input.activeContexts, context), - }), - ...(input.dialogAction !== undefined && { - dialogAction: serializeAws_restJson1DialogAction(input.dialogAction, context), - }), - ...(input.recentIntentSummaryView !== undefined && { - recentIntentSummaryView: serializeAws_restJson1IntentSummaryList(input.recentIntentSummaryView, context), - }), - ...(input.sessionAttributes !== undefined && { - sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context), - }), + ...(input.activeContexts !== undefined && + input.activeContexts !== null && { + activeContexts: serializeAws_restJson1ActiveContextsList(input.activeContexts, context), + }), + ...(input.dialogAction !== undefined && + input.dialogAction !== null && { dialogAction: serializeAws_restJson1DialogAction(input.dialogAction, context) }), + ...(input.recentIntentSummaryView !== undefined && + input.recentIntentSummaryView !== null && { + recentIntentSummaryView: serializeAws_restJson1IntentSummaryList(input.recentIntentSummaryView, context), + }), + ...(input.sessionAttributes !== undefined && + input.sessionAttributes !== null && { + sessionAttributes: serializeAws_restJson1StringMap(input.sessionAttributes, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -552,16 +557,22 @@ export const deserializeAws_restJson1PostContentCommand = async ( contents.intentName = output.headers["x-amz-lex-intent-name"]; } if (output.headers["x-amz-lex-nlu-intent-confidence"] !== undefined) { - contents.nluIntentConfidence = new __LazyJsonString(output.headers["x-amz-lex-nlu-intent-confidence"]); + contents.nluIntentConfidence = new __LazyJsonString( + Buffer.from(output.headers["x-amz-lex-nlu-intent-confidence"], "base64").toString("ascii") + ); } if (output.headers["x-amz-lex-alternative-intents"] !== undefined) { - contents.alternativeIntents = new __LazyJsonString(output.headers["x-amz-lex-alternative-intents"]); + contents.alternativeIntents = new __LazyJsonString( + Buffer.from(output.headers["x-amz-lex-alternative-intents"], "base64").toString("ascii") + ); } if (output.headers["x-amz-lex-slots"] !== undefined) { - contents.slots = new __LazyJsonString(output.headers["x-amz-lex-slots"]); + contents.slots = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-slots"], "base64").toString("ascii")); } if (output.headers["x-amz-lex-session-attributes"] !== undefined) { - contents.sessionAttributes = new __LazyJsonString(output.headers["x-amz-lex-session-attributes"]); + contents.sessionAttributes = new __LazyJsonString( + Buffer.from(output.headers["x-amz-lex-session-attributes"], "base64").toString("ascii") + ); } if (output.headers["x-amz-lex-sentiment"] !== undefined) { contents.sentimentResponse = output.headers["x-amz-lex-sentiment"]; @@ -588,7 +599,9 @@ export const deserializeAws_restJson1PostContentCommand = async ( contents.sessionId = output.headers["x-amz-lex-session-id"]; } if (output.headers["x-amz-lex-active-contexts"] !== undefined) { - contents.activeContexts = new __LazyJsonString(output.headers["x-amz-lex-active-contexts"]); + contents.activeContexts = new __LazyJsonString( + Buffer.from(output.headers["x-amz-lex-active-contexts"], "base64").toString("ascii") + ); } const data: any = output.body; contents.audioStream = data; @@ -903,10 +916,12 @@ export const deserializeAws_restJson1PutSessionCommand = async ( contents.intentName = output.headers["x-amz-lex-intent-name"]; } if (output.headers["x-amz-lex-slots"] !== undefined) { - contents.slots = new __LazyJsonString(output.headers["x-amz-lex-slots"]); + contents.slots = new __LazyJsonString(Buffer.from(output.headers["x-amz-lex-slots"], "base64").toString("ascii")); } if (output.headers["x-amz-lex-session-attributes"] !== undefined) { - contents.sessionAttributes = new __LazyJsonString(output.headers["x-amz-lex-session-attributes"]); + contents.sessionAttributes = new __LazyJsonString( + Buffer.from(output.headers["x-amz-lex-session-attributes"], "base64").toString("ascii") + ); } if (output.headers["x-amz-lex-message"] !== undefined) { contents.message = output.headers["x-amz-lex-message"]; @@ -924,7 +939,9 @@ export const deserializeAws_restJson1PutSessionCommand = async ( contents.sessionId = output.headers["x-amz-lex-session-id"]; } if (output.headers["x-amz-lex-active-contexts"] !== undefined) { - contents.activeContexts = new __LazyJsonString(output.headers["x-amz-lex-active-contexts"]); + contents.activeContexts = new __LazyJsonString( + Buffer.from(output.headers["x-amz-lex-active-contexts"], "base64").toString("ascii") + ); } const data: any = output.body; contents.audioStream = data; @@ -1217,13 +1234,15 @@ const deserializeAws_restJson1UnsupportedMediaTypeExceptionResponse = async ( const serializeAws_restJson1ActiveContext = (input: ActiveContext, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.parameters !== undefined && { - parameters: serializeAws_restJson1ActiveContextParametersMap(input.parameters, context), - }), - ...(input.timeToLive !== undefined && { - timeToLive: serializeAws_restJson1ActiveContextTimeToLive(input.timeToLive, context), - }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.parameters !== undefined && + input.parameters !== null && { + parameters: serializeAws_restJson1ActiveContextParametersMap(input.parameters, context), + }), + ...(input.timeToLive !== undefined && + input.timeToLive !== null && { + timeToLive: serializeAws_restJson1ActiveContextTimeToLive(input.timeToLive, context), + }), }; }; @@ -1231,17 +1250,26 @@ const serializeAws_restJson1ActiveContextParametersMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ActiveContextsList = (input: ActiveContext[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ActiveContext(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ActiveContext(entry, context); + }); }; const serializeAws_restJson1ActiveContextTimeToLive = ( @@ -1249,47 +1277,64 @@ const serializeAws_restJson1ActiveContextTimeToLive = ( context: __SerdeContext ): any => { return { - ...(input.timeToLiveInSeconds !== undefined && { timeToLiveInSeconds: input.timeToLiveInSeconds }), - ...(input.turnsToLive !== undefined && { turnsToLive: input.turnsToLive }), + ...(input.timeToLiveInSeconds !== undefined && + input.timeToLiveInSeconds !== null && { timeToLiveInSeconds: input.timeToLiveInSeconds }), + ...(input.turnsToLive !== undefined && input.turnsToLive !== null && { turnsToLive: input.turnsToLive }), }; }; const serializeAws_restJson1DialogAction = (input: DialogAction, context: __SerdeContext): any => { return { - ...(input.fulfillmentState !== undefined && { fulfillmentState: input.fulfillmentState }), - ...(input.intentName !== undefined && { intentName: input.intentName }), - ...(input.message !== undefined && { message: input.message }), - ...(input.messageFormat !== undefined && { messageFormat: input.messageFormat }), - ...(input.slotToElicit !== undefined && { slotToElicit: input.slotToElicit }), - ...(input.slots !== undefined && { slots: serializeAws_restJson1StringMap(input.slots, context) }), - ...(input.type !== undefined && { type: input.type }), + ...(input.fulfillmentState !== undefined && + input.fulfillmentState !== null && { fulfillmentState: input.fulfillmentState }), + ...(input.intentName !== undefined && input.intentName !== null && { intentName: input.intentName }), + ...(input.message !== undefined && input.message !== null && { message: input.message }), + ...(input.messageFormat !== undefined && input.messageFormat !== null && { messageFormat: input.messageFormat }), + ...(input.slotToElicit !== undefined && input.slotToElicit !== null && { slotToElicit: input.slotToElicit }), + ...(input.slots !== undefined && + input.slots !== null && { slots: serializeAws_restJson1StringMap(input.slots, context) }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_restJson1IntentSummary = (input: IntentSummary, context: __SerdeContext): any => { return { - ...(input.checkpointLabel !== undefined && { checkpointLabel: input.checkpointLabel }), - ...(input.confirmationStatus !== undefined && { confirmationStatus: input.confirmationStatus }), - ...(input.dialogActionType !== undefined && { dialogActionType: input.dialogActionType }), - ...(input.fulfillmentState !== undefined && { fulfillmentState: input.fulfillmentState }), - ...(input.intentName !== undefined && { intentName: input.intentName }), - ...(input.slotToElicit !== undefined && { slotToElicit: input.slotToElicit }), - ...(input.slots !== undefined && { slots: serializeAws_restJson1StringMap(input.slots, context) }), + ...(input.checkpointLabel !== undefined && + input.checkpointLabel !== null && { checkpointLabel: input.checkpointLabel }), + ...(input.confirmationStatus !== undefined && + input.confirmationStatus !== null && { confirmationStatus: input.confirmationStatus }), + ...(input.dialogActionType !== undefined && + input.dialogActionType !== null && { dialogActionType: input.dialogActionType }), + ...(input.fulfillmentState !== undefined && + input.fulfillmentState !== null && { fulfillmentState: input.fulfillmentState }), + ...(input.intentName !== undefined && input.intentName !== null && { intentName: input.intentName }), + ...(input.slotToElicit !== undefined && input.slotToElicit !== null && { slotToElicit: input.slotToElicit }), + ...(input.slots !== undefined && + input.slots !== null && { slots: serializeAws_restJson1StringMap(input.slots, context) }), }; }; const serializeAws_restJson1IntentSummaryList = (input: IntentSummary[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1IntentSummary(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1IntentSummary(entry, context); + }); }; const serializeAws_restJson1StringMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ActiveContext = (output: any, context: __SerdeContext): ActiveContext => { @@ -1310,17 +1355,26 @@ const deserializeAws_restJson1ActiveContextParametersMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ActiveContextsList = (output: any, context: __SerdeContext): ActiveContext[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ActiveContext(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ActiveContext(entry, context); + }); }; const deserializeAws_restJson1ActiveContextTimeToLive = ( @@ -1377,7 +1431,14 @@ const deserializeAws_restJson1GenericAttachment = (output: any, context: __Serde }; const deserializeAws_restJson1genericAttachmentList = (output: any, context: __SerdeContext): GenericAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GenericAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GenericAttachment(entry, context); + }); }; const deserializeAws_restJson1IntentConfidence = (output: any, context: __SerdeContext): IntentConfidence => { @@ -1387,7 +1448,14 @@ const deserializeAws_restJson1IntentConfidence = (output: any, context: __SerdeC }; const deserializeAws_restJson1IntentList = (output: any, context: __SerdeContext): PredictedIntent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PredictedIntent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PredictedIntent(entry, context); + }); }; const deserializeAws_restJson1IntentSummary = (output: any, context: __SerdeContext): IntentSummary => { @@ -1412,11 +1480,25 @@ const deserializeAws_restJson1IntentSummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1IntentSummaryList = (output: any, context: __SerdeContext): IntentSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IntentSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IntentSummary(entry, context); + }); }; const deserializeAws_restJson1listOfButtons = (output: any, context: __SerdeContext): Button[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Button(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Button(entry, context); + }); }; const deserializeAws_restJson1PredictedIntent = (output: any, context: __SerdeContext): PredictedIntent => { @@ -1454,13 +1536,15 @@ const deserializeAws_restJson1SentimentResponse = (output: any, context: __Serde }; const deserializeAws_restJson1StringMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1483,6 +1567,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-license-manager/protocols/Aws_json1_1.ts b/clients/client-license-manager/protocols/Aws_json1_1.ts index f5a18a1f2050..2640bff68622 100644 --- a/clients/client-license-manager/protocols/Aws_json1_1.ts +++ b/clients/client-license-manager/protocols/Aws_json1_1.ts @@ -241,7 +241,7 @@ export const serializeAws_json1_1AcceptGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.AcceptGrant", }; let body: any; @@ -254,7 +254,7 @@ export const serializeAws_json1_1CheckInLicenseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.CheckInLicense", }; let body: any; @@ -267,7 +267,7 @@ export const serializeAws_json1_1CheckoutBorrowLicenseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.CheckoutBorrowLicense", }; let body: any; @@ -280,7 +280,7 @@ export const serializeAws_json1_1CheckoutLicenseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.CheckoutLicense", }; let body: any; @@ -293,7 +293,7 @@ export const serializeAws_json1_1CreateGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.CreateGrant", }; let body: any; @@ -306,7 +306,7 @@ export const serializeAws_json1_1CreateGrantVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.CreateGrantVersion", }; let body: any; @@ -319,7 +319,7 @@ export const serializeAws_json1_1CreateLicenseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.CreateLicense", }; let body: any; @@ -332,7 +332,7 @@ export const serializeAws_json1_1CreateLicenseConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.CreateLicenseConfiguration", }; let body: any; @@ -345,7 +345,7 @@ export const serializeAws_json1_1CreateLicenseVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.CreateLicenseVersion", }; let body: any; @@ -358,7 +358,7 @@ export const serializeAws_json1_1CreateTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.CreateToken", }; let body: any; @@ -371,7 +371,7 @@ export const serializeAws_json1_1DeleteGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.DeleteGrant", }; let body: any; @@ -384,7 +384,7 @@ export const serializeAws_json1_1DeleteLicenseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.DeleteLicense", }; let body: any; @@ -397,7 +397,7 @@ export const serializeAws_json1_1DeleteLicenseConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.DeleteLicenseConfiguration", }; let body: any; @@ -410,7 +410,7 @@ export const serializeAws_json1_1DeleteTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.DeleteToken", }; let body: any; @@ -423,7 +423,7 @@ export const serializeAws_json1_1ExtendLicenseConsumptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ExtendLicenseConsumption", }; let body: any; @@ -436,7 +436,7 @@ export const serializeAws_json1_1GetAccessTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.GetAccessToken", }; let body: any; @@ -449,7 +449,7 @@ export const serializeAws_json1_1GetGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.GetGrant", }; let body: any; @@ -462,7 +462,7 @@ export const serializeAws_json1_1GetLicenseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.GetLicense", }; let body: any; @@ -475,7 +475,7 @@ export const serializeAws_json1_1GetLicenseConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.GetLicenseConfiguration", }; let body: any; @@ -488,7 +488,7 @@ export const serializeAws_json1_1GetLicenseUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.GetLicenseUsage", }; let body: any; @@ -501,7 +501,7 @@ export const serializeAws_json1_1GetServiceSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.GetServiceSettings", }; let body: any; @@ -514,7 +514,7 @@ export const serializeAws_json1_1ListAssociationsForLicenseConfigurationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListAssociationsForLicenseConfiguration", }; let body: any; @@ -527,7 +527,7 @@ export const serializeAws_json1_1ListDistributedGrantsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListDistributedGrants", }; let body: any; @@ -540,7 +540,7 @@ export const serializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListFailuresForLicenseConfigurationOperations", }; let body: any; @@ -553,7 +553,7 @@ export const serializeAws_json1_1ListLicenseConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListLicenseConfigurations", }; let body: any; @@ -566,7 +566,7 @@ export const serializeAws_json1_1ListLicensesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListLicenses", }; let body: any; @@ -579,7 +579,7 @@ export const serializeAws_json1_1ListLicenseSpecificationsForResourceCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListLicenseSpecificationsForResource", }; let body: any; @@ -592,7 +592,7 @@ export const serializeAws_json1_1ListLicenseVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListLicenseVersions", }; let body: any; @@ -605,7 +605,7 @@ export const serializeAws_json1_1ListReceivedGrantsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListReceivedGrants", }; let body: any; @@ -618,7 +618,7 @@ export const serializeAws_json1_1ListReceivedLicensesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListReceivedLicenses", }; let body: any; @@ -631,7 +631,7 @@ export const serializeAws_json1_1ListResourceInventoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListResourceInventory", }; let body: any; @@ -644,7 +644,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListTagsForResource", }; let body: any; @@ -657,7 +657,7 @@ export const serializeAws_json1_1ListTokensCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListTokens", }; let body: any; @@ -670,7 +670,7 @@ export const serializeAws_json1_1ListUsageForLicenseConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.ListUsageForLicenseConfiguration", }; let body: any; @@ -683,7 +683,7 @@ export const serializeAws_json1_1RejectGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.RejectGrant", }; let body: any; @@ -696,7 +696,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.TagResource", }; let body: any; @@ -709,7 +709,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.UntagResource", }; let body: any; @@ -722,7 +722,7 @@ export const serializeAws_json1_1UpdateLicenseConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.UpdateLicenseConfiguration", }; let body: any; @@ -735,7 +735,7 @@ export const serializeAws_json1_1UpdateLicenseSpecificationsForResourceCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.UpdateLicenseSpecificationsForResource", }; let body: any; @@ -748,7 +748,7 @@ export const serializeAws_json1_1UpdateServiceSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSLicenseManager.UpdateServiceSettings", }; let body: any; @@ -783,8 +783,7 @@ const deserializeAws_json1_1AcceptGrantCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -886,8 +885,7 @@ const deserializeAws_json1_1CheckInLicenseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -989,8 +987,7 @@ const deserializeAws_json1_1CheckoutBorrowLicenseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -1116,8 +1113,7 @@ const deserializeAws_json1_1CheckoutLicenseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -1235,8 +1231,7 @@ const deserializeAws_json1_1CreateGrantCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -1338,8 +1333,7 @@ const deserializeAws_json1_1CreateGrantVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -1441,8 +1435,7 @@ const deserializeAws_json1_1CreateLicenseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -1544,8 +1537,7 @@ const deserializeAws_json1_1CreateLicenseConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -1639,8 +1631,7 @@ const deserializeAws_json1_1CreateLicenseVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -1750,8 +1741,7 @@ const deserializeAws_json1_1CreateTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -1861,8 +1851,7 @@ const deserializeAws_json1_1DeleteGrantCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -1964,8 +1953,7 @@ const deserializeAws_json1_1DeleteLicenseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2075,8 +2063,7 @@ const deserializeAws_json1_1DeleteLicenseConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2162,8 +2149,7 @@ const deserializeAws_json1_1DeleteTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2265,8 +2251,7 @@ const deserializeAws_json1_1ExtendLicenseConsumptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2368,8 +2353,7 @@ const deserializeAws_json1_1GetAccessTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2455,8 +2439,7 @@ const deserializeAws_json1_1GetGrantCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2558,8 +2541,7 @@ const deserializeAws_json1_1GetLicenseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2653,8 +2635,7 @@ const deserializeAws_json1_1GetLicenseConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2740,8 +2721,7 @@ const deserializeAws_json1_1GetLicenseUsageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2835,8 +2815,7 @@ const deserializeAws_json1_1GetServiceSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -2914,8 +2893,7 @@ const deserializeAws_json1_1ListAssociationsForLicenseConfigurationCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3009,8 +2987,7 @@ const deserializeAws_json1_1ListDistributedGrantsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3112,8 +3089,7 @@ const deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCommand }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3199,8 +3175,7 @@ const deserializeAws_json1_1ListLicenseConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3294,8 +3269,7 @@ const deserializeAws_json1_1ListLicensesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3389,8 +3363,7 @@ const deserializeAws_json1_1ListLicenseSpecificationsForResourceCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3476,8 +3449,7 @@ const deserializeAws_json1_1ListLicenseVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3563,8 +3535,7 @@ const deserializeAws_json1_1ListReceivedGrantsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3666,8 +3637,7 @@ const deserializeAws_json1_1ListReceivedLicensesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3769,8 +3739,7 @@ const deserializeAws_json1_1ListResourceInventoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3872,8 +3841,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -3959,8 +3927,7 @@ const deserializeAws_json1_1ListTokensCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -4046,8 +4013,7 @@ const deserializeAws_json1_1ListUsageForLicenseConfigurationCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -4141,8 +4107,7 @@ const deserializeAws_json1_1RejectGrantCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -4244,8 +4209,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -4331,8 +4295,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -4418,8 +4381,7 @@ const deserializeAws_json1_1UpdateLicenseConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -4513,8 +4475,7 @@ const deserializeAws_json1_1UpdateLicenseSpecificationsForResourceCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -4616,8 +4577,7 @@ const deserializeAws_json1_1UpdateServiceSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.licensemanager#AccessDeniedException": @@ -4933,7 +4893,7 @@ const deserializeAws_json1_1ValidationExceptionResponse = async ( const serializeAws_json1_1AcceptGrantRequest = (input: AcceptGrantRequest, context: __SerdeContext): any => { return { - ...(input.GrantArn !== undefined && { GrantArn: input.GrantArn }), + ...(input.GrantArn !== undefined && input.GrantArn !== null && { GrantArn: input.GrantArn }), }; }; @@ -4941,24 +4901,41 @@ const serializeAws_json1_1AllowedOperationList = ( input: (AllowedOperation | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BorrowConfiguration = (input: BorrowConfiguration, context: __SerdeContext): any => { return { - ...(input.AllowEarlyCheckIn !== undefined && { AllowEarlyCheckIn: input.AllowEarlyCheckIn }), - ...(input.MaxTimeToLiveInMinutes !== undefined && { MaxTimeToLiveInMinutes: input.MaxTimeToLiveInMinutes }), + ...(input.AllowEarlyCheckIn !== undefined && + input.AllowEarlyCheckIn !== null && { AllowEarlyCheckIn: input.AllowEarlyCheckIn }), + ...(input.MaxTimeToLiveInMinutes !== undefined && + input.MaxTimeToLiveInMinutes !== null && { MaxTimeToLiveInMinutes: input.MaxTimeToLiveInMinutes }), }; }; const serializeAws_json1_1CheckInLicenseRequest = (input: CheckInLicenseRequest, context: __SerdeContext): any => { return { - ...(input.Beneficiary !== undefined && { Beneficiary: input.Beneficiary }), - ...(input.LicenseConsumptionToken !== undefined && { LicenseConsumptionToken: input.LicenseConsumptionToken }), + ...(input.Beneficiary !== undefined && input.Beneficiary !== null && { Beneficiary: input.Beneficiary }), + ...(input.LicenseConsumptionToken !== undefined && + input.LicenseConsumptionToken !== null && { LicenseConsumptionToken: input.LicenseConsumptionToken }), }; }; @@ -4967,30 +4944,35 @@ const serializeAws_json1_1CheckoutBorrowLicenseRequest = ( context: __SerdeContext ): any => { return { - ...(input.CheckoutMetadata !== undefined && { - CheckoutMetadata: serializeAws_json1_1MetadataList(input.CheckoutMetadata, context), - }), - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.DigitalSignatureMethod !== undefined && { DigitalSignatureMethod: input.DigitalSignatureMethod }), - ...(input.Entitlements !== undefined && { - Entitlements: serializeAws_json1_1EntitlementDataList(input.Entitlements, context), - }), - ...(input.LicenseArn !== undefined && { LicenseArn: input.LicenseArn }), - ...(input.NodeId !== undefined && { NodeId: input.NodeId }), + ...(input.CheckoutMetadata !== undefined && + input.CheckoutMetadata !== null && { + CheckoutMetadata: serializeAws_json1_1MetadataList(input.CheckoutMetadata, context), + }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.DigitalSignatureMethod !== undefined && + input.DigitalSignatureMethod !== null && { DigitalSignatureMethod: input.DigitalSignatureMethod }), + ...(input.Entitlements !== undefined && + input.Entitlements !== null && { + Entitlements: serializeAws_json1_1EntitlementDataList(input.Entitlements, context), + }), + ...(input.LicenseArn !== undefined && input.LicenseArn !== null && { LicenseArn: input.LicenseArn }), + ...(input.NodeId !== undefined && input.NodeId !== null && { NodeId: input.NodeId }), }; }; const serializeAws_json1_1CheckoutLicenseRequest = (input: CheckoutLicenseRequest, context: __SerdeContext): any => { return { - ...(input.Beneficiary !== undefined && { Beneficiary: input.Beneficiary }), - ...(input.CheckoutType !== undefined && { CheckoutType: input.CheckoutType }), - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.Entitlements !== undefined && { - Entitlements: serializeAws_json1_1EntitlementDataList(input.Entitlements, context), - }), - ...(input.KeyFingerprint !== undefined && { KeyFingerprint: input.KeyFingerprint }), - ...(input.NodeId !== undefined && { NodeId: input.NodeId }), - ...(input.ProductSKU !== undefined && { ProductSKU: input.ProductSKU }), + ...(input.Beneficiary !== undefined && input.Beneficiary !== null && { Beneficiary: input.Beneficiary }), + ...(input.CheckoutType !== undefined && input.CheckoutType !== null && { CheckoutType: input.CheckoutType }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.Entitlements !== undefined && + input.Entitlements !== null && { + Entitlements: serializeAws_json1_1EntitlementDataList(input.Entitlements, context), + }), + ...(input.KeyFingerprint !== undefined && + input.KeyFingerprint !== null && { KeyFingerprint: input.KeyFingerprint }), + ...(input.NodeId !== undefined && input.NodeId !== null && { NodeId: input.NodeId }), + ...(input.ProductSKU !== undefined && input.ProductSKU !== null && { ProductSKU: input.ProductSKU }), }; }; @@ -4999,28 +4981,30 @@ const serializeAws_json1_1ConsumptionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.BorrowConfiguration !== undefined && { - BorrowConfiguration: serializeAws_json1_1BorrowConfiguration(input.BorrowConfiguration, context), - }), - ...(input.ProvisionalConfiguration !== undefined && { - ProvisionalConfiguration: serializeAws_json1_1ProvisionalConfiguration(input.ProvisionalConfiguration, context), - }), - ...(input.RenewType !== undefined && { RenewType: input.RenewType }), + ...(input.BorrowConfiguration !== undefined && + input.BorrowConfiguration !== null && { + BorrowConfiguration: serializeAws_json1_1BorrowConfiguration(input.BorrowConfiguration, context), + }), + ...(input.ProvisionalConfiguration !== undefined && + input.ProvisionalConfiguration !== null && { + ProvisionalConfiguration: serializeAws_json1_1ProvisionalConfiguration(input.ProvisionalConfiguration, context), + }), + ...(input.RenewType !== undefined && input.RenewType !== null && { RenewType: input.RenewType }), }; }; const serializeAws_json1_1CreateGrantRequest = (input: CreateGrantRequest, context: __SerdeContext): any => { return { - ...(input.AllowedOperations !== undefined && { - AllowedOperations: serializeAws_json1_1AllowedOperationList(input.AllowedOperations, context), - }), - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.GrantName !== undefined && { GrantName: input.GrantName }), - ...(input.HomeRegion !== undefined && { HomeRegion: input.HomeRegion }), - ...(input.LicenseArn !== undefined && { LicenseArn: input.LicenseArn }), - ...(input.Principals !== undefined && { - Principals: serializeAws_json1_1PrincipalArnList(input.Principals, context), - }), + ...(input.AllowedOperations !== undefined && + input.AllowedOperations !== null && { + AllowedOperations: serializeAws_json1_1AllowedOperationList(input.AllowedOperations, context), + }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.GrantName !== undefined && input.GrantName !== null && { GrantName: input.GrantName }), + ...(input.HomeRegion !== undefined && input.HomeRegion !== null && { HomeRegion: input.HomeRegion }), + ...(input.LicenseArn !== undefined && input.LicenseArn !== null && { LicenseArn: input.LicenseArn }), + ...(input.Principals !== undefined && + input.Principals !== null && { Principals: serializeAws_json1_1PrincipalArnList(input.Principals, context) }), }; }; @@ -5029,14 +5013,15 @@ const serializeAws_json1_1CreateGrantVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AllowedOperations !== undefined && { - AllowedOperations: serializeAws_json1_1AllowedOperationList(input.AllowedOperations, context), - }), - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.GrantArn !== undefined && { GrantArn: input.GrantArn }), - ...(input.GrantName !== undefined && { GrantName: input.GrantName }), - ...(input.SourceVersion !== undefined && { SourceVersion: input.SourceVersion }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.AllowedOperations !== undefined && + input.AllowedOperations !== null && { + AllowedOperations: serializeAws_json1_1AllowedOperationList(input.AllowedOperations, context), + }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.GrantArn !== undefined && input.GrantArn !== null && { GrantArn: input.GrantArn }), + ...(input.GrantName !== undefined && input.GrantName !== null && { GrantName: input.GrantName }), + ...(input.SourceVersion !== undefined && input.SourceVersion !== null && { SourceVersion: input.SourceVersion }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -5045,41 +5030,49 @@ const serializeAws_json1_1CreateLicenseConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisassociateWhenNotFound !== undefined && { DisassociateWhenNotFound: input.DisassociateWhenNotFound }), - ...(input.LicenseCount !== undefined && { LicenseCount: input.LicenseCount }), - ...(input.LicenseCountHardLimit !== undefined && { LicenseCountHardLimit: input.LicenseCountHardLimit }), - ...(input.LicenseCountingType !== undefined && { LicenseCountingType: input.LicenseCountingType }), - ...(input.LicenseRules !== undefined && { - LicenseRules: serializeAws_json1_1StringList(input.LicenseRules, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ProductInformationList !== undefined && { - ProductInformationList: serializeAws_json1_1ProductInformationList(input.ProductInformationList, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisassociateWhenNotFound !== undefined && + input.DisassociateWhenNotFound !== null && { DisassociateWhenNotFound: input.DisassociateWhenNotFound }), + ...(input.LicenseCount !== undefined && input.LicenseCount !== null && { LicenseCount: input.LicenseCount }), + ...(input.LicenseCountHardLimit !== undefined && + input.LicenseCountHardLimit !== null && { LicenseCountHardLimit: input.LicenseCountHardLimit }), + ...(input.LicenseCountingType !== undefined && + input.LicenseCountingType !== null && { LicenseCountingType: input.LicenseCountingType }), + ...(input.LicenseRules !== undefined && + input.LicenseRules !== null && { LicenseRules: serializeAws_json1_1StringList(input.LicenseRules, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ProductInformationList !== undefined && + input.ProductInformationList !== null && { + ProductInformationList: serializeAws_json1_1ProductInformationList(input.ProductInformationList, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateLicenseRequest = (input: CreateLicenseRequest, context: __SerdeContext): any => { return { - ...(input.Beneficiary !== undefined && { Beneficiary: input.Beneficiary }), - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.ConsumptionConfiguration !== undefined && { - ConsumptionConfiguration: serializeAws_json1_1ConsumptionConfiguration(input.ConsumptionConfiguration, context), - }), - ...(input.Entitlements !== undefined && { - Entitlements: serializeAws_json1_1EntitlementList(input.Entitlements, context), - }), - ...(input.HomeRegion !== undefined && { HomeRegion: input.HomeRegion }), - ...(input.Issuer !== undefined && { Issuer: serializeAws_json1_1Issuer(input.Issuer, context) }), - ...(input.LicenseMetadata !== undefined && { - LicenseMetadata: serializeAws_json1_1MetadataList(input.LicenseMetadata, context), - }), - ...(input.LicenseName !== undefined && { LicenseName: input.LicenseName }), - ...(input.ProductName !== undefined && { ProductName: input.ProductName }), - ...(input.ProductSKU !== undefined && { ProductSKU: input.ProductSKU }), - ...(input.Validity !== undefined && { Validity: serializeAws_json1_1DatetimeRange(input.Validity, context) }), + ...(input.Beneficiary !== undefined && input.Beneficiary !== null && { Beneficiary: input.Beneficiary }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.ConsumptionConfiguration !== undefined && + input.ConsumptionConfiguration !== null && { + ConsumptionConfiguration: serializeAws_json1_1ConsumptionConfiguration(input.ConsumptionConfiguration, context), + }), + ...(input.Entitlements !== undefined && + input.Entitlements !== null && { + Entitlements: serializeAws_json1_1EntitlementList(input.Entitlements, context), + }), + ...(input.HomeRegion !== undefined && input.HomeRegion !== null && { HomeRegion: input.HomeRegion }), + ...(input.Issuer !== undefined && + input.Issuer !== null && { Issuer: serializeAws_json1_1Issuer(input.Issuer, context) }), + ...(input.LicenseMetadata !== undefined && + input.LicenseMetadata !== null && { + LicenseMetadata: serializeAws_json1_1MetadataList(input.LicenseMetadata, context), + }), + ...(input.LicenseName !== undefined && input.LicenseName !== null && { LicenseName: input.LicenseName }), + ...(input.ProductName !== undefined && input.ProductName !== null && { ProductName: input.ProductName }), + ...(input.ProductSKU !== undefined && input.ProductSKU !== null && { ProductSKU: input.ProductSKU }), + ...(input.Validity !== undefined && + input.Validity !== null && { Validity: serializeAws_json1_1DatetimeRange(input.Validity, context) }), }; }; @@ -5088,50 +5081,58 @@ const serializeAws_json1_1CreateLicenseVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.ConsumptionConfiguration !== undefined && { - ConsumptionConfiguration: serializeAws_json1_1ConsumptionConfiguration(input.ConsumptionConfiguration, context), - }), - ...(input.Entitlements !== undefined && { - Entitlements: serializeAws_json1_1EntitlementList(input.Entitlements, context), - }), - ...(input.HomeRegion !== undefined && { HomeRegion: input.HomeRegion }), - ...(input.Issuer !== undefined && { Issuer: serializeAws_json1_1Issuer(input.Issuer, context) }), - ...(input.LicenseArn !== undefined && { LicenseArn: input.LicenseArn }), - ...(input.LicenseMetadata !== undefined && { - LicenseMetadata: serializeAws_json1_1MetadataList(input.LicenseMetadata, context), - }), - ...(input.LicenseName !== undefined && { LicenseName: input.LicenseName }), - ...(input.ProductName !== undefined && { ProductName: input.ProductName }), - ...(input.SourceVersion !== undefined && { SourceVersion: input.SourceVersion }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.Validity !== undefined && { Validity: serializeAws_json1_1DatetimeRange(input.Validity, context) }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.ConsumptionConfiguration !== undefined && + input.ConsumptionConfiguration !== null && { + ConsumptionConfiguration: serializeAws_json1_1ConsumptionConfiguration(input.ConsumptionConfiguration, context), + }), + ...(input.Entitlements !== undefined && + input.Entitlements !== null && { + Entitlements: serializeAws_json1_1EntitlementList(input.Entitlements, context), + }), + ...(input.HomeRegion !== undefined && input.HomeRegion !== null && { HomeRegion: input.HomeRegion }), + ...(input.Issuer !== undefined && + input.Issuer !== null && { Issuer: serializeAws_json1_1Issuer(input.Issuer, context) }), + ...(input.LicenseArn !== undefined && input.LicenseArn !== null && { LicenseArn: input.LicenseArn }), + ...(input.LicenseMetadata !== undefined && + input.LicenseMetadata !== null && { + LicenseMetadata: serializeAws_json1_1MetadataList(input.LicenseMetadata, context), + }), + ...(input.LicenseName !== undefined && input.LicenseName !== null && { LicenseName: input.LicenseName }), + ...(input.ProductName !== undefined && input.ProductName !== null && { ProductName: input.ProductName }), + ...(input.SourceVersion !== undefined && input.SourceVersion !== null && { SourceVersion: input.SourceVersion }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.Validity !== undefined && + input.Validity !== null && { Validity: serializeAws_json1_1DatetimeRange(input.Validity, context) }), }; }; const serializeAws_json1_1CreateTokenRequest = (input: CreateTokenRequest, context: __SerdeContext): any => { return { - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.ExpirationInDays !== undefined && { ExpirationInDays: input.ExpirationInDays }), - ...(input.LicenseArn !== undefined && { LicenseArn: input.LicenseArn }), - ...(input.RoleArns !== undefined && { RoleArns: serializeAws_json1_1ArnList(input.RoleArns, context) }), - ...(input.TokenProperties !== undefined && { - TokenProperties: serializeAws_json1_1MaxSize3StringList(input.TokenProperties, context), - }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.ExpirationInDays !== undefined && + input.ExpirationInDays !== null && { ExpirationInDays: input.ExpirationInDays }), + ...(input.LicenseArn !== undefined && input.LicenseArn !== null && { LicenseArn: input.LicenseArn }), + ...(input.RoleArns !== undefined && + input.RoleArns !== null && { RoleArns: serializeAws_json1_1ArnList(input.RoleArns, context) }), + ...(input.TokenProperties !== undefined && + input.TokenProperties !== null && { + TokenProperties: serializeAws_json1_1MaxSize3StringList(input.TokenProperties, context), + }), }; }; const serializeAws_json1_1DatetimeRange = (input: DatetimeRange, context: __SerdeContext): any => { return { - ...(input.Begin !== undefined && { Begin: input.Begin }), - ...(input.End !== undefined && { End: input.End }), + ...(input.Begin !== undefined && input.Begin !== null && { Begin: input.Begin }), + ...(input.End !== undefined && input.End !== null && { End: input.End }), }; }; const serializeAws_json1_1DeleteGrantRequest = (input: DeleteGrantRequest, context: __SerdeContext): any => { return { - ...(input.GrantArn !== undefined && { GrantArn: input.GrantArn }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.GrantArn !== undefined && input.GrantArn !== null && { GrantArn: input.GrantArn }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -5140,48 +5141,63 @@ const serializeAws_json1_1DeleteLicenseConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.LicenseConfigurationArn !== undefined && { LicenseConfigurationArn: input.LicenseConfigurationArn }), + ...(input.LicenseConfigurationArn !== undefined && + input.LicenseConfigurationArn !== null && { LicenseConfigurationArn: input.LicenseConfigurationArn }), }; }; const serializeAws_json1_1DeleteLicenseRequest = (input: DeleteLicenseRequest, context: __SerdeContext): any => { return { - ...(input.LicenseArn !== undefined && { LicenseArn: input.LicenseArn }), - ...(input.SourceVersion !== undefined && { SourceVersion: input.SourceVersion }), + ...(input.LicenseArn !== undefined && input.LicenseArn !== null && { LicenseArn: input.LicenseArn }), + ...(input.SourceVersion !== undefined && input.SourceVersion !== null && { SourceVersion: input.SourceVersion }), }; }; const serializeAws_json1_1DeleteTokenRequest = (input: DeleteTokenRequest, context: __SerdeContext): any => { return { - ...(input.TokenId !== undefined && { TokenId: input.TokenId }), + ...(input.TokenId !== undefined && input.TokenId !== null && { TokenId: input.TokenId }), }; }; const serializeAws_json1_1Entitlement = (input: Entitlement, context: __SerdeContext): any => { return { - ...(input.AllowCheckIn !== undefined && { AllowCheckIn: input.AllowCheckIn }), - ...(input.MaxCount !== undefined && { MaxCount: input.MaxCount }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Overage !== undefined && { Overage: input.Overage }), - ...(input.Unit !== undefined && { Unit: input.Unit }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.AllowCheckIn !== undefined && input.AllowCheckIn !== null && { AllowCheckIn: input.AllowCheckIn }), + ...(input.MaxCount !== undefined && input.MaxCount !== null && { MaxCount: input.MaxCount }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Overage !== undefined && input.Overage !== null && { Overage: input.Overage }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1EntitlementData = (input: EntitlementData, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Unit !== undefined && { Unit: input.Unit }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1EntitlementDataList = (input: EntitlementData[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EntitlementData(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EntitlementData(entry, context); + }); }; const serializeAws_json1_1EntitlementList = (input: Entitlement[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Entitlement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Entitlement(entry, context); + }); }; const serializeAws_json1_1ExtendLicenseConsumptionRequest = ( @@ -5189,43 +5205,67 @@ const serializeAws_json1_1ExtendLicenseConsumptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.LicenseConsumptionToken !== undefined && { LicenseConsumptionToken: input.LicenseConsumptionToken }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.LicenseConsumptionToken !== undefined && + input.LicenseConsumptionToken !== null && { LicenseConsumptionToken: input.LicenseConsumptionToken }), }; }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), }; }; const serializeAws_json1_1FilterList = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1Filters = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1FilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetAccessTokenRequest = (input: GetAccessTokenRequest, context: __SerdeContext): any => { return { - ...(input.Token !== undefined && { Token: input.Token }), - ...(input.TokenProperties !== undefined && { - TokenProperties: serializeAws_json1_1MaxSize3StringList(input.TokenProperties, context), - }), + ...(input.Token !== undefined && input.Token !== null && { Token: input.Token }), + ...(input.TokenProperties !== undefined && + input.TokenProperties !== null && { + TokenProperties: serializeAws_json1_1MaxSize3StringList(input.TokenProperties, context), + }), }; }; const serializeAws_json1_1GetGrantRequest = (input: GetGrantRequest, context: __SerdeContext): any => { return { - ...(input.GrantArn !== undefined && { GrantArn: input.GrantArn }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.GrantArn !== undefined && input.GrantArn !== null && { GrantArn: input.GrantArn }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -5234,20 +5274,21 @@ const serializeAws_json1_1GetLicenseConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.LicenseConfigurationArn !== undefined && { LicenseConfigurationArn: input.LicenseConfigurationArn }), + ...(input.LicenseConfigurationArn !== undefined && + input.LicenseConfigurationArn !== null && { LicenseConfigurationArn: input.LicenseConfigurationArn }), }; }; const serializeAws_json1_1GetLicenseRequest = (input: GetLicenseRequest, context: __SerdeContext): any => { return { - ...(input.LicenseArn !== undefined && { LicenseArn: input.LicenseArn }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.LicenseArn !== undefined && input.LicenseArn !== null && { LicenseArn: input.LicenseArn }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_json1_1GetLicenseUsageRequest = (input: GetLicenseUsageRequest, context: __SerdeContext): any => { return { - ...(input.LicenseArn !== undefined && { LicenseArn: input.LicenseArn }), + ...(input.LicenseArn !== undefined && input.LicenseArn !== null && { LicenseArn: input.LicenseArn }), }; }; @@ -5260,32 +5301,48 @@ const serializeAws_json1_1GetServiceSettingsRequest = ( const serializeAws_json1_1InventoryFilter = (input: InventoryFilter, context: __SerdeContext): any => { return { - ...(input.Condition !== undefined && { Condition: input.Condition }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Condition !== undefined && input.Condition !== null && { Condition: input.Condition }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1InventoryFilterList = (input: InventoryFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InventoryFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InventoryFilter(entry, context); + }); }; const serializeAws_json1_1Issuer = (input: Issuer, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SignKey !== undefined && { SignKey: input.SignKey }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SignKey !== undefined && input.SignKey !== null && { SignKey: input.SignKey }), }; }; const serializeAws_json1_1LicenseSpecification = (input: LicenseSpecification, context: __SerdeContext): any => { return { - ...(input.AmiAssociationScope !== undefined && { AmiAssociationScope: input.AmiAssociationScope }), - ...(input.LicenseConfigurationArn !== undefined && { LicenseConfigurationArn: input.LicenseConfigurationArn }), + ...(input.AmiAssociationScope !== undefined && + input.AmiAssociationScope !== null && { AmiAssociationScope: input.AmiAssociationScope }), + ...(input.LicenseConfigurationArn !== undefined && + input.LicenseConfigurationArn !== null && { LicenseConfigurationArn: input.LicenseConfigurationArn }), }; }; const serializeAws_json1_1LicenseSpecifications = (input: LicenseSpecification[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1LicenseSpecification(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1LicenseSpecification(entry, context); + }); }; const serializeAws_json1_1ListAssociationsForLicenseConfigurationRequest = ( @@ -5293,9 +5350,10 @@ const serializeAws_json1_1ListAssociationsForLicenseConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.LicenseConfigurationArn !== undefined && { LicenseConfigurationArn: input.LicenseConfigurationArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.LicenseConfigurationArn !== undefined && + input.LicenseConfigurationArn !== null && { LicenseConfigurationArn: input.LicenseConfigurationArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5304,10 +5362,12 @@ const serializeAws_json1_1ListDistributedGrantsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.GrantArns !== undefined && { GrantArns: serializeAws_json1_1ArnList(input.GrantArns, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.GrantArns !== undefined && + input.GrantArns !== null && { GrantArns: serializeAws_json1_1ArnList(input.GrantArns, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5316,9 +5376,10 @@ const serializeAws_json1_1ListFailuresForLicenseConfigurationOperationsRequest = context: __SerdeContext ): any => { return { - ...(input.LicenseConfigurationArn !== undefined && { LicenseConfigurationArn: input.LicenseConfigurationArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.LicenseConfigurationArn !== undefined && + input.LicenseConfigurationArn !== null && { LicenseConfigurationArn: input.LicenseConfigurationArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5327,12 +5388,14 @@ const serializeAws_json1_1ListLicenseConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.LicenseConfigurationArns !== undefined && { - LicenseConfigurationArns: serializeAws_json1_1StringList(input.LicenseConfigurationArns, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.LicenseConfigurationArns !== undefined && + input.LicenseConfigurationArns !== null && { + LicenseConfigurationArns: serializeAws_json1_1StringList(input.LicenseConfigurationArns, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5341,18 +5404,20 @@ const serializeAws_json1_1ListLicenseSpecificationsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1ListLicensesRequest = (input: ListLicensesRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.LicenseArns !== undefined && { LicenseArns: serializeAws_json1_1ArnList(input.LicenseArns, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.LicenseArns !== undefined && + input.LicenseArns !== null && { LicenseArns: serializeAws_json1_1ArnList(input.LicenseArns, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5361,9 +5426,9 @@ const serializeAws_json1_1ListLicenseVersionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.LicenseArn !== undefined && { LicenseArn: input.LicenseArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.LicenseArn !== undefined && input.LicenseArn !== null && { LicenseArn: input.LicenseArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5372,10 +5437,12 @@ const serializeAws_json1_1ListReceivedGrantsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.GrantArns !== undefined && { GrantArns: serializeAws_json1_1ArnList(input.GrantArns, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.GrantArns !== undefined && + input.GrantArns !== null && { GrantArns: serializeAws_json1_1ArnList(input.GrantArns, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5384,10 +5451,12 @@ const serializeAws_json1_1ListReceivedLicensesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.LicenseArns !== undefined && { LicenseArns: serializeAws_json1_1ArnList(input.LicenseArns, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.LicenseArns !== undefined && + input.LicenseArns !== null && { LicenseArns: serializeAws_json1_1ArnList(input.LicenseArns, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5396,9 +5465,10 @@ const serializeAws_json1_1ListResourceInventoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5407,16 +5477,18 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1ListTokensRequest = (input: ListTokensRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TokenIds !== undefined && { TokenIds: serializeAws_json1_1StringList(input.TokenIds, context) }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TokenIds !== undefined && + input.TokenIds !== null && { TokenIds: serializeAws_json1_1StringList(input.TokenIds, context) }), }; }; @@ -5425,26 +5497,42 @@ const serializeAws_json1_1ListUsageForLicenseConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.LicenseConfigurationArn !== undefined && { LicenseConfigurationArn: input.LicenseConfigurationArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.LicenseConfigurationArn !== undefined && + input.LicenseConfigurationArn !== null && { LicenseConfigurationArn: input.LicenseConfigurationArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1MaxSize3StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Metadata = (input: Metadata, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1MetadataList = (input: Metadata[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Metadata(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Metadata(entry, context); + }); }; const serializeAws_json1_1OrganizationConfiguration = ( @@ -5452,23 +5540,32 @@ const serializeAws_json1_1OrganizationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.EnableIntegration !== undefined && { EnableIntegration: input.EnableIntegration }), + ...(input.EnableIntegration !== undefined && + input.EnableIntegration !== null && { EnableIntegration: input.EnableIntegration }), }; }; const serializeAws_json1_1PrincipalArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ProductInformation = (input: ProductInformation, context: __SerdeContext): any => { return { - ...(input.ProductInformationFilterList !== undefined && { - ProductInformationFilterList: serializeAws_json1_1ProductInformationFilterList( - input.ProductInformationFilterList, - context - ), - }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ProductInformationFilterList !== undefined && + input.ProductInformationFilterList !== null && { + ProductInformationFilterList: serializeAws_json1_1ProductInformationFilterList( + input.ProductInformationFilterList, + context + ), + }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; @@ -5477,15 +5574,18 @@ const serializeAws_json1_1ProductInformationFilter = ( context: __SerdeContext ): any => { return { - ...(input.ProductInformationFilterComparator !== undefined && { - ProductInformationFilterComparator: input.ProductInformationFilterComparator, - }), - ...(input.ProductInformationFilterName !== undefined && { - ProductInformationFilterName: input.ProductInformationFilterName, - }), - ...(input.ProductInformationFilterValue !== undefined && { - ProductInformationFilterValue: serializeAws_json1_1StringList(input.ProductInformationFilterValue, context), - }), + ...(input.ProductInformationFilterComparator !== undefined && + input.ProductInformationFilterComparator !== null && { + ProductInformationFilterComparator: input.ProductInformationFilterComparator, + }), + ...(input.ProductInformationFilterName !== undefined && + input.ProductInformationFilterName !== null && { + ProductInformationFilterName: input.ProductInformationFilterName, + }), + ...(input.ProductInformationFilterValue !== undefined && + input.ProductInformationFilterValue !== null && { + ProductInformationFilterValue: serializeAws_json1_1StringList(input.ProductInformationFilterValue, context), + }), }; }; @@ -5493,11 +5593,25 @@ const serializeAws_json1_1ProductInformationFilterList = ( input: ProductInformationFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ProductInformationFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProductInformationFilter(entry, context); + }); }; const serializeAws_json1_1ProductInformationList = (input: ProductInformation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ProductInformation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProductInformation(entry, context); + }); }; const serializeAws_json1_1ProvisionalConfiguration = ( @@ -5505,46 +5619,69 @@ const serializeAws_json1_1ProvisionalConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.MaxTimeToLiveInMinutes !== undefined && { MaxTimeToLiveInMinutes: input.MaxTimeToLiveInMinutes }), + ...(input.MaxTimeToLiveInMinutes !== undefined && + input.MaxTimeToLiveInMinutes !== null && { MaxTimeToLiveInMinutes: input.MaxTimeToLiveInMinutes }), }; }; const serializeAws_json1_1RejectGrantRequest = (input: RejectGrantRequest, context: __SerdeContext): any => { return { - ...(input.GrantArn !== undefined && { GrantArn: input.GrantArn }), + ...(input.GrantArn !== undefined && input.GrantArn !== null && { GrantArn: input.GrantArn }), }; }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -5553,21 +5690,23 @@ const serializeAws_json1_1UpdateLicenseConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisassociateWhenNotFound !== undefined && { DisassociateWhenNotFound: input.DisassociateWhenNotFound }), - ...(input.LicenseConfigurationArn !== undefined && { LicenseConfigurationArn: input.LicenseConfigurationArn }), - ...(input.LicenseConfigurationStatus !== undefined && { - LicenseConfigurationStatus: input.LicenseConfigurationStatus, - }), - ...(input.LicenseCount !== undefined && { LicenseCount: input.LicenseCount }), - ...(input.LicenseCountHardLimit !== undefined && { LicenseCountHardLimit: input.LicenseCountHardLimit }), - ...(input.LicenseRules !== undefined && { - LicenseRules: serializeAws_json1_1StringList(input.LicenseRules, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ProductInformationList !== undefined && { - ProductInformationList: serializeAws_json1_1ProductInformationList(input.ProductInformationList, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisassociateWhenNotFound !== undefined && + input.DisassociateWhenNotFound !== null && { DisassociateWhenNotFound: input.DisassociateWhenNotFound }), + ...(input.LicenseConfigurationArn !== undefined && + input.LicenseConfigurationArn !== null && { LicenseConfigurationArn: input.LicenseConfigurationArn }), + ...(input.LicenseConfigurationStatus !== undefined && + input.LicenseConfigurationStatus !== null && { LicenseConfigurationStatus: input.LicenseConfigurationStatus }), + ...(input.LicenseCount !== undefined && input.LicenseCount !== null && { LicenseCount: input.LicenseCount }), + ...(input.LicenseCountHardLimit !== undefined && + input.LicenseCountHardLimit !== null && { LicenseCountHardLimit: input.LicenseCountHardLimit }), + ...(input.LicenseRules !== undefined && + input.LicenseRules !== null && { LicenseRules: serializeAws_json1_1StringList(input.LicenseRules, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ProductInformationList !== undefined && + input.ProductInformationList !== null && { + ProductInformationList: serializeAws_json1_1ProductInformationList(input.ProductInformationList, context), + }), }; }; @@ -5576,16 +5715,18 @@ const serializeAws_json1_1UpdateLicenseSpecificationsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.AddLicenseSpecifications !== undefined && { - AddLicenseSpecifications: serializeAws_json1_1LicenseSpecifications(input.AddLicenseSpecifications, context), - }), - ...(input.RemoveLicenseSpecifications !== undefined && { - RemoveLicenseSpecifications: serializeAws_json1_1LicenseSpecifications( - input.RemoveLicenseSpecifications, - context - ), - }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.AddLicenseSpecifications !== undefined && + input.AddLicenseSpecifications !== null && { + AddLicenseSpecifications: serializeAws_json1_1LicenseSpecifications(input.AddLicenseSpecifications, context), + }), + ...(input.RemoveLicenseSpecifications !== undefined && + input.RemoveLicenseSpecifications !== null && { + RemoveLicenseSpecifications: serializeAws_json1_1LicenseSpecifications( + input.RemoveLicenseSpecifications, + context + ), + }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -5594,17 +5735,19 @@ const serializeAws_json1_1UpdateServiceSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EnableCrossAccountsDiscovery !== undefined && { - EnableCrossAccountsDiscovery: input.EnableCrossAccountsDiscovery, - }), - ...(input.OrganizationConfiguration !== undefined && { - OrganizationConfiguration: serializeAws_json1_1OrganizationConfiguration( - input.OrganizationConfiguration, - context - ), - }), - ...(input.S3BucketArn !== undefined && { S3BucketArn: input.S3BucketArn }), - ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), + ...(input.EnableCrossAccountsDiscovery !== undefined && + input.EnableCrossAccountsDiscovery !== null && { + EnableCrossAccountsDiscovery: input.EnableCrossAccountsDiscovery, + }), + ...(input.OrganizationConfiguration !== undefined && + input.OrganizationConfiguration !== null && { + OrganizationConfiguration: serializeAws_json1_1OrganizationConfiguration( + input.OrganizationConfiguration, + context + ), + }), + ...(input.S3BucketArn !== undefined && input.S3BucketArn !== null && { S3BucketArn: input.S3BucketArn }), + ...(input.SnsTopicArn !== undefined && input.SnsTopicArn !== null && { SnsTopicArn: input.SnsTopicArn }), }; }; @@ -5626,11 +5769,25 @@ const deserializeAws_json1_1AllowedOperationList = ( output: any, context: __SerdeContext ): (AllowedOperation | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AuthorizationException = (output: any, context: __SerdeContext): AuthorizationException => { @@ -5732,7 +5889,14 @@ const deserializeAws_json1_1ConsumedLicenseSummaryList = ( output: any, context: __SerdeContext ): ConsumedLicenseSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConsumedLicenseSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConsumedLicenseSummary(entry, context); + }); }; const deserializeAws_json1_1ConsumptionConfiguration = ( @@ -5863,11 +6027,25 @@ const deserializeAws_json1_1EntitlementData = (output: any, context: __SerdeCont }; const deserializeAws_json1_1EntitlementDataList = (output: any, context: __SerdeContext): EntitlementData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EntitlementData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EntitlementData(entry, context); + }); }; const deserializeAws_json1_1EntitlementList = (output: any, context: __SerdeContext): Entitlement[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Entitlement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Entitlement(entry, context); + }); }; const deserializeAws_json1_1EntitlementNotAllowedException = ( @@ -5890,7 +6068,14 @@ const deserializeAws_json1_1EntitlementUsage = (output: any, context: __SerdeCon }; const deserializeAws_json1_1EntitlementUsageList = (output: any, context: __SerdeContext): EntitlementUsage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EntitlementUsage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EntitlementUsage(entry, context); + }); }; const deserializeAws_json1_1ExtendLicenseConsumptionResponse = ( @@ -6103,11 +6288,25 @@ const deserializeAws_json1_1GrantedLicense = (output: any, context: __SerdeConte }; const deserializeAws_json1_1GrantedLicenseList = (output: any, context: __SerdeContext): GrantedLicense[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GrantedLicense(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GrantedLicense(entry, context); + }); }; const deserializeAws_json1_1GrantList = (output: any, context: __SerdeContext): Grant[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Grant(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Grant(entry, context); + }); }; const deserializeAws_json1_1InvalidParameterValueException = ( @@ -6248,11 +6447,25 @@ const deserializeAws_json1_1LicenseConfigurationAssociations = ( output: any, context: __SerdeContext ): LicenseConfigurationAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LicenseConfigurationAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LicenseConfigurationAssociation(entry, context); + }); }; const deserializeAws_json1_1LicenseConfigurations = (output: any, context: __SerdeContext): LicenseConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LicenseConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LicenseConfiguration(entry, context); + }); }; const deserializeAws_json1_1LicenseConfigurationUsage = ( @@ -6279,11 +6492,25 @@ const deserializeAws_json1_1LicenseConfigurationUsageList = ( output: any, context: __SerdeContext ): LicenseConfigurationUsage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LicenseConfigurationUsage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LicenseConfigurationUsage(entry, context); + }); }; const deserializeAws_json1_1LicenseList = (output: any, context: __SerdeContext): License[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1License(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1License(entry, context); + }); }; const deserializeAws_json1_1LicenseOperationFailure = ( @@ -6317,7 +6544,14 @@ const deserializeAws_json1_1LicenseOperationFailureList = ( output: any, context: __SerdeContext ): LicenseOperationFailure[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LicenseOperationFailure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LicenseOperationFailure(entry, context); + }); }; const deserializeAws_json1_1LicenseSpecification = (output: any, context: __SerdeContext): LicenseSpecification => { @@ -6334,7 +6568,14 @@ const deserializeAws_json1_1LicenseSpecification = (output: any, context: __Serd }; const deserializeAws_json1_1LicenseSpecifications = (output: any, context: __SerdeContext): LicenseSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LicenseSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LicenseSpecification(entry, context); + }); }; const deserializeAws_json1_1LicenseUsage = (output: any, context: __SerdeContext): LicenseUsage => { @@ -6526,11 +6767,25 @@ const deserializeAws_json1_1ManagedResourceSummaryList = ( output: any, context: __SerdeContext ): ManagedResourceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ManagedResourceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ManagedResourceSummary(entry, context); + }); }; const deserializeAws_json1_1MaxSize3StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Metadata = (output: any, context: __SerdeContext): Metadata => { @@ -6541,7 +6796,14 @@ const deserializeAws_json1_1Metadata = (output: any, context: __SerdeContext): M }; const deserializeAws_json1_1MetadataList = (output: any, context: __SerdeContext): Metadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Metadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Metadata(entry, context); + }); }; const deserializeAws_json1_1NoEntitlementsAllowedException = ( @@ -6599,11 +6861,25 @@ const deserializeAws_json1_1ProductInformationFilterList = ( output: any, context: __SerdeContext ): ProductInformationFilter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProductInformationFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProductInformationFilter(entry, context); + }); }; const deserializeAws_json1_1ProductInformationList = (output: any, context: __SerdeContext): ProductInformation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProductInformation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProductInformation(entry, context); + }); }; const deserializeAws_json1_1ProvisionalConfiguration = ( @@ -6669,7 +6945,14 @@ const deserializeAws_json1_1ResourceInventory = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ResourceInventoryList = (output: any, context: __SerdeContext): ResourceInventory[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceInventory(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceInventory(entry, context); + }); }; const deserializeAws_json1_1ResourceLimitExceededException = ( @@ -6700,7 +6983,14 @@ const deserializeAws_json1_1ServerInternalException = ( }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -6711,7 +7001,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -6738,7 +7035,14 @@ const deserializeAws_json1_1TokenData = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1TokenList = (output: any, context: __SerdeContext): TokenData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TokenData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TokenData(entry, context); + }); }; const deserializeAws_json1_1UnsupportedDigitalSignatureMethodException = ( @@ -6831,3 +7135,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-lightsail/protocols/Aws_json1_1.ts b/clients/client-lightsail/protocols/Aws_json1_1.ts index 911bd73a5d4d..5536d3e3dfb0 100644 --- a/clients/client-lightsail/protocols/Aws_json1_1.ts +++ b/clients/client-lightsail/protocols/Aws_json1_1.ts @@ -753,7 +753,7 @@ export const serializeAws_json1_1AllocateStaticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.AllocateStaticIp", }; let body: any; @@ -766,7 +766,7 @@ export const serializeAws_json1_1AttachCertificateToDistributionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.AttachCertificateToDistribution", }; let body: any; @@ -779,7 +779,7 @@ export const serializeAws_json1_1AttachDiskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.AttachDisk", }; let body: any; @@ -792,7 +792,7 @@ export const serializeAws_json1_1AttachInstancesToLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.AttachInstancesToLoadBalancer", }; let body: any; @@ -805,7 +805,7 @@ export const serializeAws_json1_1AttachLoadBalancerTlsCertificateCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.AttachLoadBalancerTlsCertificate", }; let body: any; @@ -818,7 +818,7 @@ export const serializeAws_json1_1AttachStaticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.AttachStaticIp", }; let body: any; @@ -831,7 +831,7 @@ export const serializeAws_json1_1CloseInstancePublicPortsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CloseInstancePublicPorts", }; let body: any; @@ -844,7 +844,7 @@ export const serializeAws_json1_1CopySnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CopySnapshot", }; let body: any; @@ -857,7 +857,7 @@ export const serializeAws_json1_1CreateCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateCertificate", }; let body: any; @@ -870,7 +870,7 @@ export const serializeAws_json1_1CreateCloudFormationStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateCloudFormationStack", }; let body: any; @@ -883,7 +883,7 @@ export const serializeAws_json1_1CreateContactMethodCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateContactMethod", }; let body: any; @@ -896,7 +896,7 @@ export const serializeAws_json1_1CreateContainerServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateContainerService", }; let body: any; @@ -909,7 +909,7 @@ export const serializeAws_json1_1CreateContainerServiceDeploymentCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateContainerServiceDeployment", }; let body: any; @@ -922,7 +922,7 @@ export const serializeAws_json1_1CreateContainerServiceRegistryLoginCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateContainerServiceRegistryLogin", }; let body: any; @@ -935,7 +935,7 @@ export const serializeAws_json1_1CreateDiskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateDisk", }; let body: any; @@ -948,7 +948,7 @@ export const serializeAws_json1_1CreateDiskFromSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateDiskFromSnapshot", }; let body: any; @@ -961,7 +961,7 @@ export const serializeAws_json1_1CreateDiskSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateDiskSnapshot", }; let body: any; @@ -974,7 +974,7 @@ export const serializeAws_json1_1CreateDistributionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateDistribution", }; let body: any; @@ -987,7 +987,7 @@ export const serializeAws_json1_1CreateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateDomain", }; let body: any; @@ -1000,7 +1000,7 @@ export const serializeAws_json1_1CreateDomainEntryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateDomainEntry", }; let body: any; @@ -1013,7 +1013,7 @@ export const serializeAws_json1_1CreateInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateInstances", }; let body: any; @@ -1026,7 +1026,7 @@ export const serializeAws_json1_1CreateInstancesFromSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateInstancesFromSnapshot", }; let body: any; @@ -1039,7 +1039,7 @@ export const serializeAws_json1_1CreateInstanceSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateInstanceSnapshot", }; let body: any; @@ -1052,7 +1052,7 @@ export const serializeAws_json1_1CreateKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateKeyPair", }; let body: any; @@ -1065,7 +1065,7 @@ export const serializeAws_json1_1CreateLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateLoadBalancer", }; let body: any; @@ -1078,7 +1078,7 @@ export const serializeAws_json1_1CreateLoadBalancerTlsCertificateCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateLoadBalancerTlsCertificate", }; let body: any; @@ -1091,7 +1091,7 @@ export const serializeAws_json1_1CreateRelationalDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateRelationalDatabase", }; let body: any; @@ -1104,7 +1104,7 @@ export const serializeAws_json1_1CreateRelationalDatabaseFromSnapshotCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateRelationalDatabaseFromSnapshot", }; let body: any; @@ -1117,7 +1117,7 @@ export const serializeAws_json1_1CreateRelationalDatabaseSnapshotCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.CreateRelationalDatabaseSnapshot", }; let body: any; @@ -1130,7 +1130,7 @@ export const serializeAws_json1_1DeleteAlarmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteAlarm", }; let body: any; @@ -1143,7 +1143,7 @@ export const serializeAws_json1_1DeleteAutoSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteAutoSnapshot", }; let body: any; @@ -1156,7 +1156,7 @@ export const serializeAws_json1_1DeleteCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteCertificate", }; let body: any; @@ -1169,7 +1169,7 @@ export const serializeAws_json1_1DeleteContactMethodCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteContactMethod", }; let body: any; @@ -1182,7 +1182,7 @@ export const serializeAws_json1_1DeleteContainerImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteContainerImage", }; let body: any; @@ -1195,7 +1195,7 @@ export const serializeAws_json1_1DeleteContainerServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteContainerService", }; let body: any; @@ -1208,7 +1208,7 @@ export const serializeAws_json1_1DeleteDiskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteDisk", }; let body: any; @@ -1221,7 +1221,7 @@ export const serializeAws_json1_1DeleteDiskSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteDiskSnapshot", }; let body: any; @@ -1234,7 +1234,7 @@ export const serializeAws_json1_1DeleteDistributionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteDistribution", }; let body: any; @@ -1247,7 +1247,7 @@ export const serializeAws_json1_1DeleteDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteDomain", }; let body: any; @@ -1260,7 +1260,7 @@ export const serializeAws_json1_1DeleteDomainEntryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteDomainEntry", }; let body: any; @@ -1273,7 +1273,7 @@ export const serializeAws_json1_1DeleteInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteInstance", }; let body: any; @@ -1286,7 +1286,7 @@ export const serializeAws_json1_1DeleteInstanceSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteInstanceSnapshot", }; let body: any; @@ -1299,7 +1299,7 @@ export const serializeAws_json1_1DeleteKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteKeyPair", }; let body: any; @@ -1312,7 +1312,7 @@ export const serializeAws_json1_1DeleteKnownHostKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteKnownHostKeys", }; let body: any; @@ -1325,7 +1325,7 @@ export const serializeAws_json1_1DeleteLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteLoadBalancer", }; let body: any; @@ -1338,7 +1338,7 @@ export const serializeAws_json1_1DeleteLoadBalancerTlsCertificateCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteLoadBalancerTlsCertificate", }; let body: any; @@ -1351,7 +1351,7 @@ export const serializeAws_json1_1DeleteRelationalDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteRelationalDatabase", }; let body: any; @@ -1364,7 +1364,7 @@ export const serializeAws_json1_1DeleteRelationalDatabaseSnapshotCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DeleteRelationalDatabaseSnapshot", }; let body: any; @@ -1377,7 +1377,7 @@ export const serializeAws_json1_1DetachCertificateFromDistributionCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DetachCertificateFromDistribution", }; let body: any; @@ -1390,7 +1390,7 @@ export const serializeAws_json1_1DetachDiskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DetachDisk", }; let body: any; @@ -1403,7 +1403,7 @@ export const serializeAws_json1_1DetachInstancesFromLoadBalancerCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DetachInstancesFromLoadBalancer", }; let body: any; @@ -1416,7 +1416,7 @@ export const serializeAws_json1_1DetachStaticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DetachStaticIp", }; let body: any; @@ -1429,7 +1429,7 @@ export const serializeAws_json1_1DisableAddOnCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DisableAddOn", }; let body: any; @@ -1442,7 +1442,7 @@ export const serializeAws_json1_1DownloadDefaultKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.DownloadDefaultKeyPair", }; let body: any; @@ -1455,7 +1455,7 @@ export const serializeAws_json1_1EnableAddOnCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.EnableAddOn", }; let body: any; @@ -1468,7 +1468,7 @@ export const serializeAws_json1_1ExportSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.ExportSnapshot", }; let body: any; @@ -1481,7 +1481,7 @@ export const serializeAws_json1_1GetActiveNamesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetActiveNames", }; let body: any; @@ -1494,7 +1494,7 @@ export const serializeAws_json1_1GetAlarmsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetAlarms", }; let body: any; @@ -1507,7 +1507,7 @@ export const serializeAws_json1_1GetAutoSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetAutoSnapshots", }; let body: any; @@ -1520,7 +1520,7 @@ export const serializeAws_json1_1GetBlueprintsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetBlueprints", }; let body: any; @@ -1533,7 +1533,7 @@ export const serializeAws_json1_1GetBundlesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetBundles", }; let body: any; @@ -1546,7 +1546,7 @@ export const serializeAws_json1_1GetCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetCertificates", }; let body: any; @@ -1559,7 +1559,7 @@ export const serializeAws_json1_1GetCloudFormationStackRecordsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetCloudFormationStackRecords", }; let body: any; @@ -1572,7 +1572,7 @@ export const serializeAws_json1_1GetContactMethodsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetContactMethods", }; let body: any; @@ -1585,7 +1585,7 @@ export const serializeAws_json1_1GetContainerAPIMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetContainerAPIMetadata", }; let body: any; @@ -1598,7 +1598,7 @@ export const serializeAws_json1_1GetContainerImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetContainerImages", }; let body: any; @@ -1611,7 +1611,7 @@ export const serializeAws_json1_1GetContainerLogCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetContainerLog", }; let body: any; @@ -1624,7 +1624,7 @@ export const serializeAws_json1_1GetContainerServiceDeploymentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetContainerServiceDeployments", }; let body: any; @@ -1637,7 +1637,7 @@ export const serializeAws_json1_1GetContainerServiceMetricDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetContainerServiceMetricData", }; let body: any; @@ -1650,7 +1650,7 @@ export const serializeAws_json1_1GetContainerServicePowersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetContainerServicePowers", }; let body: any; @@ -1663,7 +1663,7 @@ export const serializeAws_json1_1GetContainerServicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetContainerServices", }; let body: any; @@ -1676,7 +1676,7 @@ export const serializeAws_json1_1GetDiskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDisk", }; let body: any; @@ -1689,7 +1689,7 @@ export const serializeAws_json1_1GetDisksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDisks", }; let body: any; @@ -1702,7 +1702,7 @@ export const serializeAws_json1_1GetDiskSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDiskSnapshot", }; let body: any; @@ -1715,7 +1715,7 @@ export const serializeAws_json1_1GetDiskSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDiskSnapshots", }; let body: any; @@ -1728,7 +1728,7 @@ export const serializeAws_json1_1GetDistributionBundlesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDistributionBundles", }; let body: any; @@ -1741,7 +1741,7 @@ export const serializeAws_json1_1GetDistributionLatestCacheResetCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDistributionLatestCacheReset", }; let body: any; @@ -1754,7 +1754,7 @@ export const serializeAws_json1_1GetDistributionMetricDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDistributionMetricData", }; let body: any; @@ -1767,7 +1767,7 @@ export const serializeAws_json1_1GetDistributionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDistributions", }; let body: any; @@ -1780,7 +1780,7 @@ export const serializeAws_json1_1GetDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDomain", }; let body: any; @@ -1793,7 +1793,7 @@ export const serializeAws_json1_1GetDomainsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetDomains", }; let body: any; @@ -1806,7 +1806,7 @@ export const serializeAws_json1_1GetExportSnapshotRecordsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetExportSnapshotRecords", }; let body: any; @@ -1819,7 +1819,7 @@ export const serializeAws_json1_1GetInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetInstance", }; let body: any; @@ -1832,7 +1832,7 @@ export const serializeAws_json1_1GetInstanceAccessDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetInstanceAccessDetails", }; let body: any; @@ -1845,7 +1845,7 @@ export const serializeAws_json1_1GetInstanceMetricDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetInstanceMetricData", }; let body: any; @@ -1858,7 +1858,7 @@ export const serializeAws_json1_1GetInstancePortStatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetInstancePortStates", }; let body: any; @@ -1871,7 +1871,7 @@ export const serializeAws_json1_1GetInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetInstances", }; let body: any; @@ -1884,7 +1884,7 @@ export const serializeAws_json1_1GetInstanceSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetInstanceSnapshot", }; let body: any; @@ -1897,7 +1897,7 @@ export const serializeAws_json1_1GetInstanceSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetInstanceSnapshots", }; let body: any; @@ -1910,7 +1910,7 @@ export const serializeAws_json1_1GetInstanceStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetInstanceState", }; let body: any; @@ -1923,7 +1923,7 @@ export const serializeAws_json1_1GetKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetKeyPair", }; let body: any; @@ -1936,7 +1936,7 @@ export const serializeAws_json1_1GetKeyPairsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetKeyPairs", }; let body: any; @@ -1949,7 +1949,7 @@ export const serializeAws_json1_1GetLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetLoadBalancer", }; let body: any; @@ -1962,7 +1962,7 @@ export const serializeAws_json1_1GetLoadBalancerMetricDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetLoadBalancerMetricData", }; let body: any; @@ -1975,7 +1975,7 @@ export const serializeAws_json1_1GetLoadBalancersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetLoadBalancers", }; let body: any; @@ -1988,7 +1988,7 @@ export const serializeAws_json1_1GetLoadBalancerTlsCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetLoadBalancerTlsCertificates", }; let body: any; @@ -2001,7 +2001,7 @@ export const serializeAws_json1_1GetOperationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetOperation", }; let body: any; @@ -2014,7 +2014,7 @@ export const serializeAws_json1_1GetOperationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetOperations", }; let body: any; @@ -2027,7 +2027,7 @@ export const serializeAws_json1_1GetOperationsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetOperationsForResource", }; let body: any; @@ -2040,7 +2040,7 @@ export const serializeAws_json1_1GetRegionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRegions", }; let body: any; @@ -2053,7 +2053,7 @@ export const serializeAws_json1_1GetRelationalDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabase", }; let body: any; @@ -2066,7 +2066,7 @@ export const serializeAws_json1_1GetRelationalDatabaseBlueprintsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseBlueprints", }; let body: any; @@ -2079,7 +2079,7 @@ export const serializeAws_json1_1GetRelationalDatabaseBundlesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseBundles", }; let body: any; @@ -2092,7 +2092,7 @@ export const serializeAws_json1_1GetRelationalDatabaseEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseEvents", }; let body: any; @@ -2105,7 +2105,7 @@ export const serializeAws_json1_1GetRelationalDatabaseLogEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseLogEvents", }; let body: any; @@ -2118,7 +2118,7 @@ export const serializeAws_json1_1GetRelationalDatabaseLogStreamsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseLogStreams", }; let body: any; @@ -2131,7 +2131,7 @@ export const serializeAws_json1_1GetRelationalDatabaseMasterUserPasswordCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseMasterUserPassword", }; let body: any; @@ -2144,7 +2144,7 @@ export const serializeAws_json1_1GetRelationalDatabaseMetricDataCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseMetricData", }; let body: any; @@ -2157,7 +2157,7 @@ export const serializeAws_json1_1GetRelationalDatabaseParametersCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseParameters", }; let body: any; @@ -2170,7 +2170,7 @@ export const serializeAws_json1_1GetRelationalDatabasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabases", }; let body: any; @@ -2183,7 +2183,7 @@ export const serializeAws_json1_1GetRelationalDatabaseSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseSnapshot", }; let body: any; @@ -2196,7 +2196,7 @@ export const serializeAws_json1_1GetRelationalDatabaseSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetRelationalDatabaseSnapshots", }; let body: any; @@ -2209,7 +2209,7 @@ export const serializeAws_json1_1GetStaticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetStaticIp", }; let body: any; @@ -2222,7 +2222,7 @@ export const serializeAws_json1_1GetStaticIpsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.GetStaticIps", }; let body: any; @@ -2235,7 +2235,7 @@ export const serializeAws_json1_1ImportKeyPairCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.ImportKeyPair", }; let body: any; @@ -2248,7 +2248,7 @@ export const serializeAws_json1_1IsVpcPeeredCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.IsVpcPeered", }; let body: any; @@ -2261,7 +2261,7 @@ export const serializeAws_json1_1OpenInstancePublicPortsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.OpenInstancePublicPorts", }; let body: any; @@ -2274,7 +2274,7 @@ export const serializeAws_json1_1PeerVpcCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.PeerVpc", }; let body: any; @@ -2287,7 +2287,7 @@ export const serializeAws_json1_1PutAlarmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.PutAlarm", }; let body: any; @@ -2300,7 +2300,7 @@ export const serializeAws_json1_1PutInstancePublicPortsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.PutInstancePublicPorts", }; let body: any; @@ -2313,7 +2313,7 @@ export const serializeAws_json1_1RebootInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.RebootInstance", }; let body: any; @@ -2326,7 +2326,7 @@ export const serializeAws_json1_1RebootRelationalDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.RebootRelationalDatabase", }; let body: any; @@ -2339,7 +2339,7 @@ export const serializeAws_json1_1RegisterContainerImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.RegisterContainerImage", }; let body: any; @@ -2352,7 +2352,7 @@ export const serializeAws_json1_1ReleaseStaticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.ReleaseStaticIp", }; let body: any; @@ -2365,7 +2365,7 @@ export const serializeAws_json1_1ResetDistributionCacheCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.ResetDistributionCache", }; let body: any; @@ -2378,7 +2378,7 @@ export const serializeAws_json1_1SendContactMethodVerificationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.SendContactMethodVerification", }; let body: any; @@ -2391,7 +2391,7 @@ export const serializeAws_json1_1StartInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.StartInstance", }; let body: any; @@ -2404,7 +2404,7 @@ export const serializeAws_json1_1StartRelationalDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.StartRelationalDatabase", }; let body: any; @@ -2417,7 +2417,7 @@ export const serializeAws_json1_1StopInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.StopInstance", }; let body: any; @@ -2430,7 +2430,7 @@ export const serializeAws_json1_1StopRelationalDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.StopRelationalDatabase", }; let body: any; @@ -2443,7 +2443,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.TagResource", }; let body: any; @@ -2456,7 +2456,7 @@ export const serializeAws_json1_1TestAlarmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.TestAlarm", }; let body: any; @@ -2469,7 +2469,7 @@ export const serializeAws_json1_1UnpeerVpcCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.UnpeerVpc", }; let body: any; @@ -2482,7 +2482,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.UntagResource", }; let body: any; @@ -2495,7 +2495,7 @@ export const serializeAws_json1_1UpdateContainerServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.UpdateContainerService", }; let body: any; @@ -2508,7 +2508,7 @@ export const serializeAws_json1_1UpdateDistributionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.UpdateDistribution", }; let body: any; @@ -2521,7 +2521,7 @@ export const serializeAws_json1_1UpdateDistributionBundleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.UpdateDistributionBundle", }; let body: any; @@ -2534,7 +2534,7 @@ export const serializeAws_json1_1UpdateDomainEntryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.UpdateDomainEntry", }; let body: any; @@ -2547,7 +2547,7 @@ export const serializeAws_json1_1UpdateLoadBalancerAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.UpdateLoadBalancerAttribute", }; let body: any; @@ -2560,7 +2560,7 @@ export const serializeAws_json1_1UpdateRelationalDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.UpdateRelationalDatabase", }; let body: any; @@ -2573,7 +2573,7 @@ export const serializeAws_json1_1UpdateRelationalDatabaseParametersCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Lightsail_20161128.UpdateRelationalDatabaseParameters", }; let body: any; @@ -2608,8 +2608,7 @@ const deserializeAws_json1_1AllocateStaticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -2711,8 +2710,7 @@ const deserializeAws_json1_1AttachCertificateToDistributionCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -2806,8 +2804,7 @@ const deserializeAws_json1_1AttachDiskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -2909,8 +2906,7 @@ const deserializeAws_json1_1AttachInstancesToLoadBalancerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3012,8 +3008,7 @@ const deserializeAws_json1_1AttachLoadBalancerTlsCertificateCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3115,8 +3110,7 @@ const deserializeAws_json1_1AttachStaticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3218,8 +3212,7 @@ const deserializeAws_json1_1CloseInstancePublicPortsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3321,8 +3314,7 @@ const deserializeAws_json1_1CopySnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3424,8 +3416,7 @@ const deserializeAws_json1_1CreateCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3511,8 +3502,7 @@ const deserializeAws_json1_1CreateCloudFormationStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3614,8 +3604,7 @@ const deserializeAws_json1_1CreateContactMethodCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3709,8 +3698,7 @@ const deserializeAws_json1_1CreateContainerServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3796,8 +3784,7 @@ const deserializeAws_json1_1CreateContainerServiceDeploymentCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3883,8 +3870,7 @@ const deserializeAws_json1_1CreateContainerServiceRegistryLoginCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -3970,8 +3956,7 @@ const deserializeAws_json1_1CreateDiskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4073,8 +4058,7 @@ const deserializeAws_json1_1CreateDiskFromSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4176,8 +4160,7 @@ const deserializeAws_json1_1CreateDiskSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4279,8 +4262,7 @@ const deserializeAws_json1_1CreateDistributionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4374,8 +4356,7 @@ const deserializeAws_json1_1CreateDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4477,8 +4458,7 @@ const deserializeAws_json1_1CreateDomainEntryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4580,8 +4560,7 @@ const deserializeAws_json1_1CreateInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4683,8 +4662,7 @@ const deserializeAws_json1_1CreateInstancesFromSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4786,8 +4764,7 @@ const deserializeAws_json1_1CreateInstanceSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4889,8 +4866,7 @@ const deserializeAws_json1_1CreateKeyPairCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -4992,8 +4968,7 @@ const deserializeAws_json1_1CreateLoadBalancerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5095,8 +5070,7 @@ const deserializeAws_json1_1CreateLoadBalancerTlsCertificateCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5198,8 +5172,7 @@ const deserializeAws_json1_1CreateRelationalDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5301,8 +5274,7 @@ const deserializeAws_json1_1CreateRelationalDatabaseFromSnapshotCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5404,8 +5376,7 @@ const deserializeAws_json1_1CreateRelationalDatabaseSnapshotCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5507,8 +5478,7 @@ const deserializeAws_json1_1DeleteAlarmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5602,8 +5572,7 @@ const deserializeAws_json1_1DeleteAutoSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5697,8 +5666,7 @@ const deserializeAws_json1_1DeleteCertificateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5784,8 +5752,7 @@ const deserializeAws_json1_1DeleteContactMethodCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5879,8 +5846,7 @@ const deserializeAws_json1_1DeleteContainerImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -5966,8 +5932,7 @@ const deserializeAws_json1_1DeleteContainerServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6053,8 +6018,7 @@ const deserializeAws_json1_1DeleteDiskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6156,8 +6120,7 @@ const deserializeAws_json1_1DeleteDiskSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6259,8 +6222,7 @@ const deserializeAws_json1_1DeleteDistributionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6354,8 +6316,7 @@ const deserializeAws_json1_1DeleteDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6457,8 +6418,7 @@ const deserializeAws_json1_1DeleteDomainEntryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6560,8 +6520,7 @@ const deserializeAws_json1_1DeleteInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6663,8 +6622,7 @@ const deserializeAws_json1_1DeleteInstanceSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6766,8 +6724,7 @@ const deserializeAws_json1_1DeleteKeyPairCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6869,8 +6826,7 @@ const deserializeAws_json1_1DeleteKnownHostKeysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -6972,8 +6928,7 @@ const deserializeAws_json1_1DeleteLoadBalancerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7075,8 +7030,7 @@ const deserializeAws_json1_1DeleteLoadBalancerTlsCertificateCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7178,8 +7132,7 @@ const deserializeAws_json1_1DeleteRelationalDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7281,8 +7234,7 @@ const deserializeAws_json1_1DeleteRelationalDatabaseSnapshotCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7384,8 +7336,7 @@ const deserializeAws_json1_1DetachCertificateFromDistributionCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7479,8 +7430,7 @@ const deserializeAws_json1_1DetachDiskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7582,8 +7532,7 @@ const deserializeAws_json1_1DetachInstancesFromLoadBalancerCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7685,8 +7634,7 @@ const deserializeAws_json1_1DetachStaticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7788,8 +7736,7 @@ const deserializeAws_json1_1DisableAddOnCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7883,8 +7830,7 @@ const deserializeAws_json1_1DownloadDefaultKeyPairCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -7986,8 +7932,7 @@ const deserializeAws_json1_1EnableAddOnCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8081,8 +8026,7 @@ const deserializeAws_json1_1ExportSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8184,8 +8128,7 @@ const deserializeAws_json1_1GetActiveNamesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8287,8 +8230,7 @@ const deserializeAws_json1_1GetAlarmsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8382,8 +8324,7 @@ const deserializeAws_json1_1GetAutoSnapshotsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8477,8 +8418,7 @@ const deserializeAws_json1_1GetBlueprintsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8580,8 +8520,7 @@ const deserializeAws_json1_1GetBundlesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8683,8 +8622,7 @@ const deserializeAws_json1_1GetCertificatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8770,8 +8708,7 @@ const deserializeAws_json1_1GetCloudFormationStackRecordsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8873,8 +8810,7 @@ const deserializeAws_json1_1GetContactMethodsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -8968,8 +8904,7 @@ const deserializeAws_json1_1GetContainerAPIMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9039,8 +8974,7 @@ const deserializeAws_json1_1GetContainerImagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9126,8 +9060,7 @@ const deserializeAws_json1_1GetContainerLogCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9213,8 +9146,7 @@ const deserializeAws_json1_1GetContainerServiceDeploymentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9300,8 +9232,7 @@ const deserializeAws_json1_1GetContainerServiceMetricDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9387,8 +9318,7 @@ const deserializeAws_json1_1GetContainerServicePowersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9474,8 +9404,7 @@ const deserializeAws_json1_1GetContainerServicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9561,8 +9490,7 @@ const deserializeAws_json1_1GetDiskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9664,8 +9592,7 @@ const deserializeAws_json1_1GetDisksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9767,8 +9694,7 @@ const deserializeAws_json1_1GetDiskSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9870,8 +9796,7 @@ const deserializeAws_json1_1GetDiskSnapshotsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -9973,8 +9898,7 @@ const deserializeAws_json1_1GetDistributionBundlesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10068,8 +9992,7 @@ const deserializeAws_json1_1GetDistributionLatestCacheResetCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10163,8 +10086,7 @@ const deserializeAws_json1_1GetDistributionMetricDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10258,8 +10180,7 @@ const deserializeAws_json1_1GetDistributionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10353,8 +10274,7 @@ const deserializeAws_json1_1GetDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10456,8 +10376,7 @@ const deserializeAws_json1_1GetDomainsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10559,8 +10478,7 @@ const deserializeAws_json1_1GetExportSnapshotRecordsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10662,8 +10580,7 @@ const deserializeAws_json1_1GetInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10765,8 +10682,7 @@ const deserializeAws_json1_1GetInstanceAccessDetailsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10868,8 +10784,7 @@ const deserializeAws_json1_1GetInstanceMetricDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -10971,8 +10886,7 @@ const deserializeAws_json1_1GetInstancePortStatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -11074,8 +10988,7 @@ const deserializeAws_json1_1GetInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -11177,8 +11090,7 @@ const deserializeAws_json1_1GetInstanceSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -11280,8 +11192,7 @@ const deserializeAws_json1_1GetInstanceSnapshotsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -11383,8 +11294,7 @@ const deserializeAws_json1_1GetInstanceStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -11486,8 +11396,7 @@ const deserializeAws_json1_1GetKeyPairCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -11589,8 +11498,7 @@ const deserializeAws_json1_1GetKeyPairsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -11692,8 +11600,7 @@ const deserializeAws_json1_1GetLoadBalancerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -11795,8 +11702,7 @@ const deserializeAws_json1_1GetLoadBalancerMetricDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -11898,8 +11804,7 @@ const deserializeAws_json1_1GetLoadBalancersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12001,8 +11906,7 @@ const deserializeAws_json1_1GetLoadBalancerTlsCertificatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12104,8 +12008,7 @@ const deserializeAws_json1_1GetOperationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12207,8 +12110,7 @@ const deserializeAws_json1_1GetOperationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12310,8 +12212,7 @@ const deserializeAws_json1_1GetOperationsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12413,8 +12314,7 @@ const deserializeAws_json1_1GetRegionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12516,8 +12416,7 @@ const deserializeAws_json1_1GetRelationalDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12619,8 +12518,7 @@ const deserializeAws_json1_1GetRelationalDatabaseBlueprintsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12722,8 +12620,7 @@ const deserializeAws_json1_1GetRelationalDatabaseBundlesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12825,8 +12722,7 @@ const deserializeAws_json1_1GetRelationalDatabaseEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -12928,8 +12824,7 @@ const deserializeAws_json1_1GetRelationalDatabaseLogEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13031,8 +12926,7 @@ const deserializeAws_json1_1GetRelationalDatabaseLogStreamsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13134,8 +13028,7 @@ const deserializeAws_json1_1GetRelationalDatabaseMasterUserPasswordCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13237,8 +13130,7 @@ const deserializeAws_json1_1GetRelationalDatabaseMetricDataCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13340,8 +13232,7 @@ const deserializeAws_json1_1GetRelationalDatabaseParametersCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13443,8 +13334,7 @@ const deserializeAws_json1_1GetRelationalDatabasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13546,8 +13436,7 @@ const deserializeAws_json1_1GetRelationalDatabaseSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13649,8 +13538,7 @@ const deserializeAws_json1_1GetRelationalDatabaseSnapshotsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13752,8 +13640,7 @@ const deserializeAws_json1_1GetStaticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13855,8 +13742,7 @@ const deserializeAws_json1_1GetStaticIpsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -13958,8 +13844,7 @@ const deserializeAws_json1_1ImportKeyPairCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14061,8 +13946,7 @@ const deserializeAws_json1_1IsVpcPeeredCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14164,8 +14048,7 @@ const deserializeAws_json1_1OpenInstancePublicPortsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14267,8 +14150,7 @@ const deserializeAws_json1_1PeerVpcCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14370,8 +14252,7 @@ const deserializeAws_json1_1PutAlarmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14465,8 +14346,7 @@ const deserializeAws_json1_1PutInstancePublicPortsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14568,8 +14448,7 @@ const deserializeAws_json1_1RebootInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14671,8 +14550,7 @@ const deserializeAws_json1_1RebootRelationalDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14774,8 +14652,7 @@ const deserializeAws_json1_1RegisterContainerImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14861,8 +14738,7 @@ const deserializeAws_json1_1ReleaseStaticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -14964,8 +14840,7 @@ const deserializeAws_json1_1ResetDistributionCacheCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15059,8 +14934,7 @@ const deserializeAws_json1_1SendContactMethodVerificationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15154,8 +15028,7 @@ const deserializeAws_json1_1StartInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15257,8 +15130,7 @@ const deserializeAws_json1_1StartRelationalDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15360,8 +15232,7 @@ const deserializeAws_json1_1StopInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15463,8 +15334,7 @@ const deserializeAws_json1_1StopRelationalDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15566,8 +15436,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15669,8 +15538,7 @@ const deserializeAws_json1_1TestAlarmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15764,8 +15632,7 @@ const deserializeAws_json1_1UnpeerVpcCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15867,8 +15734,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -15970,8 +15836,7 @@ const deserializeAws_json1_1UpdateContainerServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -16057,8 +15922,7 @@ const deserializeAws_json1_1UpdateDistributionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -16152,8 +16016,7 @@ const deserializeAws_json1_1UpdateDistributionBundleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -16247,8 +16110,7 @@ const deserializeAws_json1_1UpdateDomainEntryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -16350,8 +16212,7 @@ const deserializeAws_json1_1UpdateLoadBalancerAttributeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -16453,8 +16314,7 @@ const deserializeAws_json1_1UpdateRelationalDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -16556,8 +16416,7 @@ const deserializeAws_json1_1UpdateRelationalDatabaseParametersCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.lightsail#AccessDeniedException": @@ -16739,20 +16598,28 @@ const deserializeAws_json1_1UnauthenticatedExceptionResponse = async ( const serializeAws_json1_1AddOnRequest = (input: AddOnRequest, context: __SerdeContext): any => { return { - ...(input.addOnType !== undefined && { addOnType: input.addOnType }), - ...(input.autoSnapshotAddOnRequest !== undefined && { - autoSnapshotAddOnRequest: serializeAws_json1_1AutoSnapshotAddOnRequest(input.autoSnapshotAddOnRequest, context), - }), + ...(input.addOnType !== undefined && input.addOnType !== null && { addOnType: input.addOnType }), + ...(input.autoSnapshotAddOnRequest !== undefined && + input.autoSnapshotAddOnRequest !== null && { + autoSnapshotAddOnRequest: serializeAws_json1_1AutoSnapshotAddOnRequest(input.autoSnapshotAddOnRequest, context), + }), }; }; const serializeAws_json1_1AddOnRequestList = (input: AddOnRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AddOnRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AddOnRequest(entry, context); + }); }; const serializeAws_json1_1AllocateStaticIpRequest = (input: AllocateStaticIpRequest, context: __SerdeContext): any => { return { - ...(input.staticIpName !== undefined && { staticIpName: input.staticIpName }), + ...(input.staticIpName !== undefined && input.staticIpName !== null && { staticIpName: input.staticIpName }), }; }; @@ -16761,27 +16628,31 @@ const serializeAws_json1_1AttachCertificateToDistributionRequest = ( context: __SerdeContext ): any => { return { - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), }; }; const serializeAws_json1_1AttachDiskRequest = (input: AttachDiskRequest, context: __SerdeContext): any => { return { - ...(input.diskName !== undefined && { diskName: input.diskName }), - ...(input.diskPath !== undefined && { diskPath: input.diskPath }), - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.diskName !== undefined && input.diskName !== null && { diskName: input.diskName }), + ...(input.diskPath !== undefined && input.diskPath !== null && { diskPath: input.diskPath }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; const serializeAws_json1_1AttachedDiskMap = (input: { [key: string]: DiskMap[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: DiskMap[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: DiskMap[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1DiskMapList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1AttachInstancesToLoadBalancerRequest = ( @@ -16789,10 +16660,12 @@ const serializeAws_json1_1AttachInstancesToLoadBalancerRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceNames !== undefined && { - instanceNames: serializeAws_json1_1ResourceNameList(input.instanceNames, context), - }), - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), + ...(input.instanceNames !== undefined && + input.instanceNames !== null && { + instanceNames: serializeAws_json1_1ResourceNameList(input.instanceNames, context), + }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), }; }; @@ -16801,15 +16674,17 @@ const serializeAws_json1_1AttachLoadBalancerTlsCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), }; }; const serializeAws_json1_1AttachStaticIpRequest = (input: AttachStaticIpRequest, context: __SerdeContext): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), - ...(input.staticIpName !== undefined && { staticIpName: input.staticIpName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), + ...(input.staticIpName !== undefined && input.staticIpName !== null && { staticIpName: input.staticIpName }), }; }; @@ -16818,43 +16693,56 @@ const serializeAws_json1_1AutoSnapshotAddOnRequest = ( context: __SerdeContext ): any => { return { - ...(input.snapshotTimeOfDay !== undefined && { snapshotTimeOfDay: input.snapshotTimeOfDay }), + ...(input.snapshotTimeOfDay !== undefined && + input.snapshotTimeOfDay !== null && { snapshotTimeOfDay: input.snapshotTimeOfDay }), }; }; const serializeAws_json1_1CacheBehavior = (input: CacheBehavior, context: __SerdeContext): any => { return { - ...(input.behavior !== undefined && { behavior: input.behavior }), + ...(input.behavior !== undefined && input.behavior !== null && { behavior: input.behavior }), }; }; const serializeAws_json1_1CacheBehaviorList = (input: CacheBehaviorPerPath[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CacheBehaviorPerPath(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CacheBehaviorPerPath(entry, context); + }); }; const serializeAws_json1_1CacheBehaviorPerPath = (input: CacheBehaviorPerPath, context: __SerdeContext): any => { return { - ...(input.behavior !== undefined && { behavior: input.behavior }), - ...(input.path !== undefined && { path: input.path }), + ...(input.behavior !== undefined && input.behavior !== null && { behavior: input.behavior }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), }; }; const serializeAws_json1_1CacheSettings = (input: CacheSettings, context: __SerdeContext): any => { return { - ...(input.allowedHTTPMethods !== undefined && { allowedHTTPMethods: input.allowedHTTPMethods }), - ...(input.cachedHTTPMethods !== undefined && { cachedHTTPMethods: input.cachedHTTPMethods }), - ...(input.defaultTTL !== undefined && { defaultTTL: input.defaultTTL }), - ...(input.forwardedCookies !== undefined && { - forwardedCookies: serializeAws_json1_1CookieObject(input.forwardedCookies, context), - }), - ...(input.forwardedHeaders !== undefined && { - forwardedHeaders: serializeAws_json1_1HeaderObject(input.forwardedHeaders, context), - }), - ...(input.forwardedQueryStrings !== undefined && { - forwardedQueryStrings: serializeAws_json1_1QueryStringObject(input.forwardedQueryStrings, context), - }), - ...(input.maximumTTL !== undefined && { maximumTTL: input.maximumTTL }), - ...(input.minimumTTL !== undefined && { minimumTTL: input.minimumTTL }), + ...(input.allowedHTTPMethods !== undefined && + input.allowedHTTPMethods !== null && { allowedHTTPMethods: input.allowedHTTPMethods }), + ...(input.cachedHTTPMethods !== undefined && + input.cachedHTTPMethods !== null && { cachedHTTPMethods: input.cachedHTTPMethods }), + ...(input.defaultTTL !== undefined && input.defaultTTL !== null && { defaultTTL: input.defaultTTL }), + ...(input.forwardedCookies !== undefined && + input.forwardedCookies !== null && { + forwardedCookies: serializeAws_json1_1CookieObject(input.forwardedCookies, context), + }), + ...(input.forwardedHeaders !== undefined && + input.forwardedHeaders !== null && { + forwardedHeaders: serializeAws_json1_1HeaderObject(input.forwardedHeaders, context), + }), + ...(input.forwardedQueryStrings !== undefined && + input.forwardedQueryStrings !== null && { + forwardedQueryStrings: serializeAws_json1_1QueryStringObject(input.forwardedQueryStrings, context), + }), + ...(input.maximumTTL !== undefined && input.maximumTTL !== null && { maximumTTL: input.maximumTTL }), + ...(input.minimumTTL !== undefined && input.minimumTTL !== null && { minimumTTL: input.minimumTTL }), }; }; @@ -16862,7 +16750,14 @@ const serializeAws_json1_1CertificateStatusList = ( input: (CertificateStatus | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CloseInstancePublicPortsRequest = ( @@ -16870,8 +16765,9 @@ const serializeAws_json1_1CloseInstancePublicPortsRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), - ...(input.portInfo !== undefined && { portInfo: serializeAws_json1_1PortInfo(input.portInfo, context) }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), + ...(input.portInfo !== undefined && + input.portInfo !== null && { portInfo: serializeAws_json1_1PortInfo(input.portInfo, context) }), }; }; @@ -16879,28 +16775,38 @@ const serializeAws_json1_1ContactProtocolsList = ( input: (ContactProtocol | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Container = (input: Container, context: __SerdeContext): any => { return { - ...(input.command !== undefined && { command: serializeAws_json1_1StringList(input.command, context) }), - ...(input.environment !== undefined && { - environment: serializeAws_json1_1Environment(input.environment, context), - }), - ...(input.image !== undefined && { image: input.image }), - ...(input.ports !== undefined && { ports: serializeAws_json1_1PortMap(input.ports, context) }), + ...(input.command !== undefined && + input.command !== null && { command: serializeAws_json1_1StringList(input.command, context) }), + ...(input.environment !== undefined && + input.environment !== null && { environment: serializeAws_json1_1Environment(input.environment, context) }), + ...(input.image !== undefined && input.image !== null && { image: input.image }), + ...(input.ports !== undefined && + input.ports !== null && { ports: serializeAws_json1_1PortMap(input.ports, context) }), }; }; const serializeAws_json1_1ContainerMap = (input: { [key: string]: Container }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Container }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Container }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1Container(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ContainerServiceDeploymentRequest = ( @@ -16908,10 +16814,12 @@ const serializeAws_json1_1ContainerServiceDeploymentRequest = ( context: __SerdeContext ): any => { return { - ...(input.containers !== undefined && { containers: serializeAws_json1_1ContainerMap(input.containers, context) }), - ...(input.publicEndpoint !== undefined && { - publicEndpoint: serializeAws_json1_1EndpointRequest(input.publicEndpoint, context), - }), + ...(input.containers !== undefined && + input.containers !== null && { containers: serializeAws_json1_1ContainerMap(input.containers, context) }), + ...(input.publicEndpoint !== undefined && + input.publicEndpoint !== null && { + publicEndpoint: serializeAws_json1_1EndpointRequest(input.publicEndpoint, context), + }), }; }; @@ -16920,12 +16828,16 @@ const serializeAws_json1_1ContainerServiceHealthCheckConfig = ( context: __SerdeContext ): any => { return { - ...(input.healthyThreshold !== undefined && { healthyThreshold: input.healthyThreshold }), - ...(input.intervalSeconds !== undefined && { intervalSeconds: input.intervalSeconds }), - ...(input.path !== undefined && { path: input.path }), - ...(input.successCodes !== undefined && { successCodes: input.successCodes }), - ...(input.timeoutSeconds !== undefined && { timeoutSeconds: input.timeoutSeconds }), - ...(input.unhealthyThreshold !== undefined && { unhealthyThreshold: input.unhealthyThreshold }), + ...(input.healthyThreshold !== undefined && + input.healthyThreshold !== null && { healthyThreshold: input.healthyThreshold }), + ...(input.intervalSeconds !== undefined && + input.intervalSeconds !== null && { intervalSeconds: input.intervalSeconds }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), + ...(input.successCodes !== undefined && input.successCodes !== null && { successCodes: input.successCodes }), + ...(input.timeoutSeconds !== undefined && + input.timeoutSeconds !== null && { timeoutSeconds: input.timeoutSeconds }), + ...(input.unhealthyThreshold !== undefined && + input.unhealthyThreshold !== null && { unhealthyThreshold: input.unhealthyThreshold }), }; }; @@ -16933,38 +16845,52 @@ const serializeAws_json1_1ContainerServicePublicDomains = ( input: { [key: string]: string[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1ContainerServicePublicDomainsList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ContainerServicePublicDomainsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CookieObject = (input: CookieObject, context: __SerdeContext): any => { return { - ...(input.cookiesAllowList !== undefined && { - cookiesAllowList: serializeAws_json1_1StringList(input.cookiesAllowList, context), - }), - ...(input.option !== undefined && { option: input.option }), + ...(input.cookiesAllowList !== undefined && + input.cookiesAllowList !== null && { + cookiesAllowList: serializeAws_json1_1StringList(input.cookiesAllowList, context), + }), + ...(input.option !== undefined && input.option !== null && { option: input.option }), }; }; const serializeAws_json1_1CopySnapshotRequest = (input: CopySnapshotRequest, context: __SerdeContext): any => { return { - ...(input.restoreDate !== undefined && { restoreDate: input.restoreDate }), - ...(input.sourceRegion !== undefined && { sourceRegion: input.sourceRegion }), - ...(input.sourceResourceName !== undefined && { sourceResourceName: input.sourceResourceName }), - ...(input.sourceSnapshotName !== undefined && { sourceSnapshotName: input.sourceSnapshotName }), - ...(input.targetSnapshotName !== undefined && { targetSnapshotName: input.targetSnapshotName }), - ...(input.useLatestRestorableAutoSnapshot !== undefined && { - useLatestRestorableAutoSnapshot: input.useLatestRestorableAutoSnapshot, - }), + ...(input.restoreDate !== undefined && input.restoreDate !== null && { restoreDate: input.restoreDate }), + ...(input.sourceRegion !== undefined && input.sourceRegion !== null && { sourceRegion: input.sourceRegion }), + ...(input.sourceResourceName !== undefined && + input.sourceResourceName !== null && { sourceResourceName: input.sourceResourceName }), + ...(input.sourceSnapshotName !== undefined && + input.sourceSnapshotName !== null && { sourceSnapshotName: input.sourceSnapshotName }), + ...(input.targetSnapshotName !== undefined && + input.targetSnapshotName !== null && { targetSnapshotName: input.targetSnapshotName }), + ...(input.useLatestRestorableAutoSnapshot !== undefined && + input.useLatestRestorableAutoSnapshot !== null && { + useLatestRestorableAutoSnapshot: input.useLatestRestorableAutoSnapshot, + }), }; }; @@ -16973,12 +16899,14 @@ const serializeAws_json1_1CreateCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), - ...(input.domainName !== undefined && { domainName: input.domainName }), - ...(input.subjectAlternativeNames !== undefined && { - subjectAlternativeNames: serializeAws_json1_1SubjectAlternativeNameList(input.subjectAlternativeNames, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), + ...(input.subjectAlternativeNames !== undefined && + input.subjectAlternativeNames !== null && { + subjectAlternativeNames: serializeAws_json1_1SubjectAlternativeNameList(input.subjectAlternativeNames, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -16987,9 +16915,8 @@ const serializeAws_json1_1CreateCloudFormationStackRequest = ( context: __SerdeContext ): any => { return { - ...(input.instances !== undefined && { - instances: serializeAws_json1_1InstanceEntryList(input.instances, context), - }), + ...(input.instances !== undefined && + input.instances !== null && { instances: serializeAws_json1_1InstanceEntryList(input.instances, context) }), }; }; @@ -16998,8 +16925,9 @@ const serializeAws_json1_1CreateContactMethodRequest = ( context: __SerdeContext ): any => { return { - ...(input.contactEndpoint !== undefined && { contactEndpoint: input.contactEndpoint }), - ...(input.protocol !== undefined && { protocol: input.protocol }), + ...(input.contactEndpoint !== undefined && + input.contactEndpoint !== null && { contactEndpoint: input.contactEndpoint }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), }; }; @@ -17008,11 +16936,13 @@ const serializeAws_json1_1CreateContainerServiceDeploymentRequest = ( context: __SerdeContext ): any => { return { - ...(input.containers !== undefined && { containers: serializeAws_json1_1ContainerMap(input.containers, context) }), - ...(input.publicEndpoint !== undefined && { - publicEndpoint: serializeAws_json1_1EndpointRequest(input.publicEndpoint, context), - }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.containers !== undefined && + input.containers !== null && { containers: serializeAws_json1_1ContainerMap(input.containers, context) }), + ...(input.publicEndpoint !== undefined && + input.publicEndpoint !== null && { + publicEndpoint: serializeAws_json1_1EndpointRequest(input.publicEndpoint, context), + }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; @@ -17028,16 +16958,18 @@ const serializeAws_json1_1CreateContainerServiceRequest = ( context: __SerdeContext ): any => { return { - ...(input.deployment !== undefined && { - deployment: serializeAws_json1_1ContainerServiceDeploymentRequest(input.deployment, context), - }), - ...(input.power !== undefined && { power: input.power }), - ...(input.publicDomainNames !== undefined && { - publicDomainNames: serializeAws_json1_1ContainerServicePublicDomains(input.publicDomainNames, context), - }), - ...(input.scale !== undefined && { scale: input.scale }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.deployment !== undefined && + input.deployment !== null && { + deployment: serializeAws_json1_1ContainerServiceDeploymentRequest(input.deployment, context), + }), + ...(input.power !== undefined && input.power !== null && { power: input.power }), + ...(input.publicDomainNames !== undefined && + input.publicDomainNames !== null && { + publicDomainNames: serializeAws_json1_1ContainerServicePublicDomains(input.publicDomainNames, context), + }), + ...(input.scale !== undefined && input.scale !== null && { scale: input.scale }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -17046,27 +16978,34 @@ const serializeAws_json1_1CreateDiskFromSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.addOns !== undefined && { addOns: serializeAws_json1_1AddOnRequestList(input.addOns, context) }), - ...(input.availabilityZone !== undefined && { availabilityZone: input.availabilityZone }), - ...(input.diskName !== undefined && { diskName: input.diskName }), - ...(input.diskSnapshotName !== undefined && { diskSnapshotName: input.diskSnapshotName }), - ...(input.restoreDate !== undefined && { restoreDate: input.restoreDate }), - ...(input.sizeInGb !== undefined && { sizeInGb: input.sizeInGb }), - ...(input.sourceDiskName !== undefined && { sourceDiskName: input.sourceDiskName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.useLatestRestorableAutoSnapshot !== undefined && { - useLatestRestorableAutoSnapshot: input.useLatestRestorableAutoSnapshot, - }), + ...(input.addOns !== undefined && + input.addOns !== null && { addOns: serializeAws_json1_1AddOnRequestList(input.addOns, context) }), + ...(input.availabilityZone !== undefined && + input.availabilityZone !== null && { availabilityZone: input.availabilityZone }), + ...(input.diskName !== undefined && input.diskName !== null && { diskName: input.diskName }), + ...(input.diskSnapshotName !== undefined && + input.diskSnapshotName !== null && { diskSnapshotName: input.diskSnapshotName }), + ...(input.restoreDate !== undefined && input.restoreDate !== null && { restoreDate: input.restoreDate }), + ...(input.sizeInGb !== undefined && input.sizeInGb !== null && { sizeInGb: input.sizeInGb }), + ...(input.sourceDiskName !== undefined && + input.sourceDiskName !== null && { sourceDiskName: input.sourceDiskName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.useLatestRestorableAutoSnapshot !== undefined && + input.useLatestRestorableAutoSnapshot !== null && { + useLatestRestorableAutoSnapshot: input.useLatestRestorableAutoSnapshot, + }), }; }; const serializeAws_json1_1CreateDiskRequest = (input: CreateDiskRequest, context: __SerdeContext): any => { return { - ...(input.addOns !== undefined && { addOns: serializeAws_json1_1AddOnRequestList(input.addOns, context) }), - ...(input.availabilityZone !== undefined && { availabilityZone: input.availabilityZone }), - ...(input.diskName !== undefined && { diskName: input.diskName }), - ...(input.sizeInGb !== undefined && { sizeInGb: input.sizeInGb }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.addOns !== undefined && + input.addOns !== null && { addOns: serializeAws_json1_1AddOnRequestList(input.addOns, context) }), + ...(input.availabilityZone !== undefined && + input.availabilityZone !== null && { availabilityZone: input.availabilityZone }), + ...(input.diskName !== undefined && input.diskName !== null && { diskName: input.diskName }), + ...(input.sizeInGb !== undefined && input.sizeInGb !== null && { sizeInGb: input.sizeInGb }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -17075,10 +17014,11 @@ const serializeAws_json1_1CreateDiskSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.diskName !== undefined && { diskName: input.diskName }), - ...(input.diskSnapshotName !== undefined && { diskSnapshotName: input.diskSnapshotName }), - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.diskName !== undefined && input.diskName !== null && { diskName: input.diskName }), + ...(input.diskSnapshotName !== undefined && + input.diskSnapshotName !== null && { diskSnapshotName: input.diskSnapshotName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -17087,19 +17027,24 @@ const serializeAws_json1_1CreateDistributionRequest = ( context: __SerdeContext ): any => { return { - ...(input.bundleId !== undefined && { bundleId: input.bundleId }), - ...(input.cacheBehaviorSettings !== undefined && { - cacheBehaviorSettings: serializeAws_json1_1CacheSettings(input.cacheBehaviorSettings, context), - }), - ...(input.cacheBehaviors !== undefined && { - cacheBehaviors: serializeAws_json1_1CacheBehaviorList(input.cacheBehaviors, context), - }), - ...(input.defaultCacheBehavior !== undefined && { - defaultCacheBehavior: serializeAws_json1_1CacheBehavior(input.defaultCacheBehavior, context), - }), - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), - ...(input.origin !== undefined && { origin: serializeAws_json1_1InputOrigin(input.origin, context) }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.bundleId !== undefined && input.bundleId !== null && { bundleId: input.bundleId }), + ...(input.cacheBehaviorSettings !== undefined && + input.cacheBehaviorSettings !== null && { + cacheBehaviorSettings: serializeAws_json1_1CacheSettings(input.cacheBehaviorSettings, context), + }), + ...(input.cacheBehaviors !== undefined && + input.cacheBehaviors !== null && { + cacheBehaviors: serializeAws_json1_1CacheBehaviorList(input.cacheBehaviors, context), + }), + ...(input.defaultCacheBehavior !== undefined && + input.defaultCacheBehavior !== null && { + defaultCacheBehavior: serializeAws_json1_1CacheBehavior(input.defaultCacheBehavior, context), + }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), + ...(input.origin !== undefined && + input.origin !== null && { origin: serializeAws_json1_1InputOrigin(input.origin, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -17108,17 +17053,16 @@ const serializeAws_json1_1CreateDomainEntryRequest = ( context: __SerdeContext ): any => { return { - ...(input.domainEntry !== undefined && { - domainEntry: serializeAws_json1_1DomainEntry(input.domainEntry, context), - }), - ...(input.domainName !== undefined && { domainName: input.domainName }), + ...(input.domainEntry !== undefined && + input.domainEntry !== null && { domainEntry: serializeAws_json1_1DomainEntry(input.domainEntry, context) }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), }; }; const serializeAws_json1_1CreateDomainRequest = (input: CreateDomainRequest, context: __SerdeContext): any => { return { - ...(input.domainName !== undefined && { domainName: input.domainName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -17127,24 +17071,29 @@ const serializeAws_json1_1CreateInstancesFromSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.addOns !== undefined && { addOns: serializeAws_json1_1AddOnRequestList(input.addOns, context) }), - ...(input.attachedDiskMapping !== undefined && { - attachedDiskMapping: serializeAws_json1_1AttachedDiskMap(input.attachedDiskMapping, context), - }), - ...(input.availabilityZone !== undefined && { availabilityZone: input.availabilityZone }), - ...(input.bundleId !== undefined && { bundleId: input.bundleId }), - ...(input.instanceNames !== undefined && { - instanceNames: serializeAws_json1_1StringList(input.instanceNames, context), - }), - ...(input.instanceSnapshotName !== undefined && { instanceSnapshotName: input.instanceSnapshotName }), - ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }), - ...(input.restoreDate !== undefined && { restoreDate: input.restoreDate }), - ...(input.sourceInstanceName !== undefined && { sourceInstanceName: input.sourceInstanceName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.useLatestRestorableAutoSnapshot !== undefined && { - useLatestRestorableAutoSnapshot: input.useLatestRestorableAutoSnapshot, - }), - ...(input.userData !== undefined && { userData: input.userData }), + ...(input.addOns !== undefined && + input.addOns !== null && { addOns: serializeAws_json1_1AddOnRequestList(input.addOns, context) }), + ...(input.attachedDiskMapping !== undefined && + input.attachedDiskMapping !== null && { + attachedDiskMapping: serializeAws_json1_1AttachedDiskMap(input.attachedDiskMapping, context), + }), + ...(input.availabilityZone !== undefined && + input.availabilityZone !== null && { availabilityZone: input.availabilityZone }), + ...(input.bundleId !== undefined && input.bundleId !== null && { bundleId: input.bundleId }), + ...(input.instanceNames !== undefined && + input.instanceNames !== null && { instanceNames: serializeAws_json1_1StringList(input.instanceNames, context) }), + ...(input.instanceSnapshotName !== undefined && + input.instanceSnapshotName !== null && { instanceSnapshotName: input.instanceSnapshotName }), + ...(input.keyPairName !== undefined && input.keyPairName !== null && { keyPairName: input.keyPairName }), + ...(input.restoreDate !== undefined && input.restoreDate !== null && { restoreDate: input.restoreDate }), + ...(input.sourceInstanceName !== undefined && + input.sourceInstanceName !== null && { sourceInstanceName: input.sourceInstanceName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.useLatestRestorableAutoSnapshot !== undefined && + input.useLatestRestorableAutoSnapshot !== null && { + useLatestRestorableAutoSnapshot: input.useLatestRestorableAutoSnapshot, + }), + ...(input.userData !== undefined && input.userData !== null && { userData: input.userData }), }; }; @@ -17153,32 +17102,35 @@ const serializeAws_json1_1CreateInstanceSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), - ...(input.instanceSnapshotName !== undefined && { instanceSnapshotName: input.instanceSnapshotName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), + ...(input.instanceSnapshotName !== undefined && + input.instanceSnapshotName !== null && { instanceSnapshotName: input.instanceSnapshotName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1CreateInstancesRequest = (input: CreateInstancesRequest, context: __SerdeContext): any => { return { - ...(input.addOns !== undefined && { addOns: serializeAws_json1_1AddOnRequestList(input.addOns, context) }), - ...(input.availabilityZone !== undefined && { availabilityZone: input.availabilityZone }), - ...(input.blueprintId !== undefined && { blueprintId: input.blueprintId }), - ...(input.bundleId !== undefined && { bundleId: input.bundleId }), - ...(input.customImageName !== undefined && { customImageName: input.customImageName }), - ...(input.instanceNames !== undefined && { - instanceNames: serializeAws_json1_1StringList(input.instanceNames, context), - }), - ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.userData !== undefined && { userData: input.userData }), + ...(input.addOns !== undefined && + input.addOns !== null && { addOns: serializeAws_json1_1AddOnRequestList(input.addOns, context) }), + ...(input.availabilityZone !== undefined && + input.availabilityZone !== null && { availabilityZone: input.availabilityZone }), + ...(input.blueprintId !== undefined && input.blueprintId !== null && { blueprintId: input.blueprintId }), + ...(input.bundleId !== undefined && input.bundleId !== null && { bundleId: input.bundleId }), + ...(input.customImageName !== undefined && + input.customImageName !== null && { customImageName: input.customImageName }), + ...(input.instanceNames !== undefined && + input.instanceNames !== null && { instanceNames: serializeAws_json1_1StringList(input.instanceNames, context) }), + ...(input.keyPairName !== undefined && input.keyPairName !== null && { keyPairName: input.keyPairName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.userData !== undefined && input.userData !== null && { userData: input.userData }), }; }; const serializeAws_json1_1CreateKeyPairRequest = (input: CreateKeyPairRequest, context: __SerdeContext): any => { return { - ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.keyPairName !== undefined && input.keyPairName !== null && { keyPairName: input.keyPairName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -17187,15 +17139,20 @@ const serializeAws_json1_1CreateLoadBalancerRequest = ( context: __SerdeContext ): any => { return { - ...(input.certificateAlternativeNames !== undefined && { - certificateAlternativeNames: serializeAws_json1_1DomainNameList(input.certificateAlternativeNames, context), - }), - ...(input.certificateDomainName !== undefined && { certificateDomainName: input.certificateDomainName }), - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), - ...(input.healthCheckPath !== undefined && { healthCheckPath: input.healthCheckPath }), - ...(input.instancePort !== undefined && { instancePort: input.instancePort }), - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.certificateAlternativeNames !== undefined && + input.certificateAlternativeNames !== null && { + certificateAlternativeNames: serializeAws_json1_1DomainNameList(input.certificateAlternativeNames, context), + }), + ...(input.certificateDomainName !== undefined && + input.certificateDomainName !== null && { certificateDomainName: input.certificateDomainName }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), + ...(input.healthCheckPath !== undefined && + input.healthCheckPath !== null && { healthCheckPath: input.healthCheckPath }), + ...(input.instancePort !== undefined && input.instancePort !== null && { instancePort: input.instancePort }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -17204,13 +17161,17 @@ const serializeAws_json1_1CreateLoadBalancerTlsCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.certificateAlternativeNames !== undefined && { - certificateAlternativeNames: serializeAws_json1_1DomainNameList(input.certificateAlternativeNames, context), - }), - ...(input.certificateDomainName !== undefined && { certificateDomainName: input.certificateDomainName }), - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.certificateAlternativeNames !== undefined && + input.certificateAlternativeNames !== null && { + certificateAlternativeNames: serializeAws_json1_1DomainNameList(input.certificateAlternativeNames, context), + }), + ...(input.certificateDomainName !== undefined && + input.certificateDomainName !== null && { certificateDomainName: input.certificateDomainName }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -17219,21 +17180,27 @@ const serializeAws_json1_1CreateRelationalDatabaseFromSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.availabilityZone !== undefined && { availabilityZone: input.availabilityZone }), - ...(input.publiclyAccessible !== undefined && { publiclyAccessible: input.publiclyAccessible }), - ...(input.relationalDatabaseBundleId !== undefined && { - relationalDatabaseBundleId: input.relationalDatabaseBundleId, - }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), - ...(input.relationalDatabaseSnapshotName !== undefined && { - relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, - }), - ...(input.restoreTime !== undefined && { restoreTime: Math.round(input.restoreTime.getTime() / 1000) }), - ...(input.sourceRelationalDatabaseName !== undefined && { - sourceRelationalDatabaseName: input.sourceRelationalDatabaseName, - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), - ...(input.useLatestRestorableTime !== undefined && { useLatestRestorableTime: input.useLatestRestorableTime }), + ...(input.availabilityZone !== undefined && + input.availabilityZone !== null && { availabilityZone: input.availabilityZone }), + ...(input.publiclyAccessible !== undefined && + input.publiclyAccessible !== null && { publiclyAccessible: input.publiclyAccessible }), + ...(input.relationalDatabaseBundleId !== undefined && + input.relationalDatabaseBundleId !== null && { relationalDatabaseBundleId: input.relationalDatabaseBundleId }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.relationalDatabaseSnapshotName !== undefined && + input.relationalDatabaseSnapshotName !== null && { + relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, + }), + ...(input.restoreTime !== undefined && + input.restoreTime !== null && { restoreTime: Math.round(input.restoreTime.getTime() / 1000) }), + ...(input.sourceRelationalDatabaseName !== undefined && + input.sourceRelationalDatabaseName !== null && { + sourceRelationalDatabaseName: input.sourceRelationalDatabaseName, + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.useLatestRestorableTime !== undefined && + input.useLatestRestorableTime !== null && { useLatestRestorableTime: input.useLatestRestorableTime }), }; }; @@ -17242,23 +17209,29 @@ const serializeAws_json1_1CreateRelationalDatabaseRequest = ( context: __SerdeContext ): any => { return { - ...(input.availabilityZone !== undefined && { availabilityZone: input.availabilityZone }), - ...(input.masterDatabaseName !== undefined && { masterDatabaseName: input.masterDatabaseName }), - ...(input.masterUserPassword !== undefined && { masterUserPassword: input.masterUserPassword }), - ...(input.masterUsername !== undefined && { masterUsername: input.masterUsername }), - ...(input.preferredBackupWindow !== undefined && { preferredBackupWindow: input.preferredBackupWindow }), - ...(input.preferredMaintenanceWindow !== undefined && { - preferredMaintenanceWindow: input.preferredMaintenanceWindow, - }), - ...(input.publiclyAccessible !== undefined && { publiclyAccessible: input.publiclyAccessible }), - ...(input.relationalDatabaseBlueprintId !== undefined && { - relationalDatabaseBlueprintId: input.relationalDatabaseBlueprintId, - }), - ...(input.relationalDatabaseBundleId !== undefined && { - relationalDatabaseBundleId: input.relationalDatabaseBundleId, - }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.availabilityZone !== undefined && + input.availabilityZone !== null && { availabilityZone: input.availabilityZone }), + ...(input.masterDatabaseName !== undefined && + input.masterDatabaseName !== null && { masterDatabaseName: input.masterDatabaseName }), + ...(input.masterUserPassword !== undefined && + input.masterUserPassword !== null && { masterUserPassword: input.masterUserPassword }), + ...(input.masterUsername !== undefined && + input.masterUsername !== null && { masterUsername: input.masterUsername }), + ...(input.preferredBackupWindow !== undefined && + input.preferredBackupWindow !== null && { preferredBackupWindow: input.preferredBackupWindow }), + ...(input.preferredMaintenanceWindow !== undefined && + input.preferredMaintenanceWindow !== null && { preferredMaintenanceWindow: input.preferredMaintenanceWindow }), + ...(input.publiclyAccessible !== undefined && + input.publiclyAccessible !== null && { publiclyAccessible: input.publiclyAccessible }), + ...(input.relationalDatabaseBlueprintId !== undefined && + input.relationalDatabaseBlueprintId !== null && { + relationalDatabaseBlueprintId: input.relationalDatabaseBlueprintId, + }), + ...(input.relationalDatabaseBundleId !== undefined && + input.relationalDatabaseBundleId !== null && { relationalDatabaseBundleId: input.relationalDatabaseBundleId }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; @@ -17267,17 +17240,19 @@ const serializeAws_json1_1CreateRelationalDatabaseSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), - ...(input.relationalDatabaseSnapshotName !== undefined && { - relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.relationalDatabaseSnapshotName !== undefined && + input.relationalDatabaseSnapshotName !== null && { + relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1DeleteAlarmRequest = (input: DeleteAlarmRequest, context: __SerdeContext): any => { return { - ...(input.alarmName !== undefined && { alarmName: input.alarmName }), + ...(input.alarmName !== undefined && input.alarmName !== null && { alarmName: input.alarmName }), }; }; @@ -17286,8 +17261,8 @@ const serializeAws_json1_1DeleteAutoSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.date !== undefined && { date: input.date }), - ...(input.resourceName !== undefined && { resourceName: input.resourceName }), + ...(input.date !== undefined && input.date !== null && { date: input.date }), + ...(input.resourceName !== undefined && input.resourceName !== null && { resourceName: input.resourceName }), }; }; @@ -17296,7 +17271,8 @@ const serializeAws_json1_1DeleteCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), }; }; @@ -17305,7 +17281,7 @@ const serializeAws_json1_1DeleteContactMethodRequest = ( context: __SerdeContext ): any => { return { - ...(input.protocol !== undefined && { protocol: input.protocol }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), }; }; @@ -17314,8 +17290,8 @@ const serializeAws_json1_1DeleteContainerImageRequest = ( context: __SerdeContext ): any => { return { - ...(input.image !== undefined && { image: input.image }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.image !== undefined && input.image !== null && { image: input.image }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; @@ -17324,14 +17300,15 @@ const serializeAws_json1_1DeleteContainerServiceRequest = ( context: __SerdeContext ): any => { return { - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; const serializeAws_json1_1DeleteDiskRequest = (input: DeleteDiskRequest, context: __SerdeContext): any => { return { - ...(input.diskName !== undefined && { diskName: input.diskName }), - ...(input.forceDeleteAddOns !== undefined && { forceDeleteAddOns: input.forceDeleteAddOns }), + ...(input.diskName !== undefined && input.diskName !== null && { diskName: input.diskName }), + ...(input.forceDeleteAddOns !== undefined && + input.forceDeleteAddOns !== null && { forceDeleteAddOns: input.forceDeleteAddOns }), }; }; @@ -17340,7 +17317,8 @@ const serializeAws_json1_1DeleteDiskSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.diskSnapshotName !== undefined && { diskSnapshotName: input.diskSnapshotName }), + ...(input.diskSnapshotName !== undefined && + input.diskSnapshotName !== null && { diskSnapshotName: input.diskSnapshotName }), }; }; @@ -17349,7 +17327,8 @@ const serializeAws_json1_1DeleteDistributionRequest = ( context: __SerdeContext ): any => { return { - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), }; }; @@ -17358,23 +17337,23 @@ const serializeAws_json1_1DeleteDomainEntryRequest = ( context: __SerdeContext ): any => { return { - ...(input.domainEntry !== undefined && { - domainEntry: serializeAws_json1_1DomainEntry(input.domainEntry, context), - }), - ...(input.domainName !== undefined && { domainName: input.domainName }), + ...(input.domainEntry !== undefined && + input.domainEntry !== null && { domainEntry: serializeAws_json1_1DomainEntry(input.domainEntry, context) }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), }; }; const serializeAws_json1_1DeleteDomainRequest = (input: DeleteDomainRequest, context: __SerdeContext): any => { return { - ...(input.domainName !== undefined && { domainName: input.domainName }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), }; }; const serializeAws_json1_1DeleteInstanceRequest = (input: DeleteInstanceRequest, context: __SerdeContext): any => { return { - ...(input.forceDeleteAddOns !== undefined && { forceDeleteAddOns: input.forceDeleteAddOns }), - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.forceDeleteAddOns !== undefined && + input.forceDeleteAddOns !== null && { forceDeleteAddOns: input.forceDeleteAddOns }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; @@ -17383,13 +17362,14 @@ const serializeAws_json1_1DeleteInstanceSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceSnapshotName !== undefined && { instanceSnapshotName: input.instanceSnapshotName }), + ...(input.instanceSnapshotName !== undefined && + input.instanceSnapshotName !== null && { instanceSnapshotName: input.instanceSnapshotName }), }; }; const serializeAws_json1_1DeleteKeyPairRequest = (input: DeleteKeyPairRequest, context: __SerdeContext): any => { return { - ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }), + ...(input.keyPairName !== undefined && input.keyPairName !== null && { keyPairName: input.keyPairName }), }; }; @@ -17398,7 +17378,7 @@ const serializeAws_json1_1DeleteKnownHostKeysRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; @@ -17407,7 +17387,8 @@ const serializeAws_json1_1DeleteLoadBalancerRequest = ( context: __SerdeContext ): any => { return { - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), }; }; @@ -17416,9 +17397,11 @@ const serializeAws_json1_1DeleteLoadBalancerTlsCertificateRequest = ( context: __SerdeContext ): any => { return { - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), - ...(input.force !== undefined && { force: input.force }), - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), }; }; @@ -17427,11 +17410,14 @@ const serializeAws_json1_1DeleteRelationalDatabaseRequest = ( context: __SerdeContext ): any => { return { - ...(input.finalRelationalDatabaseSnapshotName !== undefined && { - finalRelationalDatabaseSnapshotName: input.finalRelationalDatabaseSnapshotName, - }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), - ...(input.skipFinalSnapshot !== undefined && { skipFinalSnapshot: input.skipFinalSnapshot }), + ...(input.finalRelationalDatabaseSnapshotName !== undefined && + input.finalRelationalDatabaseSnapshotName !== null && { + finalRelationalDatabaseSnapshotName: input.finalRelationalDatabaseSnapshotName, + }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.skipFinalSnapshot !== undefined && + input.skipFinalSnapshot !== null && { skipFinalSnapshot: input.skipFinalSnapshot }), }; }; @@ -17440,9 +17426,10 @@ const serializeAws_json1_1DeleteRelationalDatabaseSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.relationalDatabaseSnapshotName !== undefined && { - relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, - }), + ...(input.relationalDatabaseSnapshotName !== undefined && + input.relationalDatabaseSnapshotName !== null && { + relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, + }), }; }; @@ -17451,13 +17438,14 @@ const serializeAws_json1_1DetachCertificateFromDistributionRequest = ( context: __SerdeContext ): any => { return { - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), }; }; const serializeAws_json1_1DetachDiskRequest = (input: DetachDiskRequest, context: __SerdeContext): any => { return { - ...(input.diskName !== undefined && { diskName: input.diskName }), + ...(input.diskName !== undefined && input.diskName !== null && { diskName: input.diskName }), }; }; @@ -17466,60 +17454,80 @@ const serializeAws_json1_1DetachInstancesFromLoadBalancerRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceNames !== undefined && { - instanceNames: serializeAws_json1_1ResourceNameList(input.instanceNames, context), - }), - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), + ...(input.instanceNames !== undefined && + input.instanceNames !== null && { + instanceNames: serializeAws_json1_1ResourceNameList(input.instanceNames, context), + }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), }; }; const serializeAws_json1_1DetachStaticIpRequest = (input: DetachStaticIpRequest, context: __SerdeContext): any => { return { - ...(input.staticIpName !== undefined && { staticIpName: input.staticIpName }), + ...(input.staticIpName !== undefined && input.staticIpName !== null && { staticIpName: input.staticIpName }), }; }; const serializeAws_json1_1DisableAddOnRequest = (input: DisableAddOnRequest, context: __SerdeContext): any => { return { - ...(input.addOnType !== undefined && { addOnType: input.addOnType }), - ...(input.resourceName !== undefined && { resourceName: input.resourceName }), + ...(input.addOnType !== undefined && input.addOnType !== null && { addOnType: input.addOnType }), + ...(input.resourceName !== undefined && input.resourceName !== null && { resourceName: input.resourceName }), }; }; const serializeAws_json1_1DiskMap = (input: DiskMap, context: __SerdeContext): any => { return { - ...(input.newDiskName !== undefined && { newDiskName: input.newDiskName }), - ...(input.originalDiskPath !== undefined && { originalDiskPath: input.originalDiskPath }), + ...(input.newDiskName !== undefined && input.newDiskName !== null && { newDiskName: input.newDiskName }), + ...(input.originalDiskPath !== undefined && + input.originalDiskPath !== null && { originalDiskPath: input.originalDiskPath }), }; }; const serializeAws_json1_1DiskMapList = (input: DiskMap[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DiskMap(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DiskMap(entry, context); + }); }; const serializeAws_json1_1DomainEntry = (input: DomainEntry, context: __SerdeContext): any => { return { - ...(input.id !== undefined && { id: input.id }), - ...(input.isAlias !== undefined && { isAlias: input.isAlias }), - ...(input.name !== undefined && { name: input.name }), - ...(input.options !== undefined && { options: serializeAws_json1_1DomainEntryOptions(input.options, context) }), - ...(input.target !== undefined && { target: input.target }), - ...(input.type !== undefined && { type: input.type }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.isAlias !== undefined && input.isAlias !== null && { isAlias: input.isAlias }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.options !== undefined && + input.options !== null && { options: serializeAws_json1_1DomainEntryOptions(input.options, context) }), + ...(input.target !== undefined && input.target !== null && { target: input.target }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1DomainEntryOptions = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1DomainNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DownloadDefaultKeyPairRequest = ( @@ -17531,82 +17539,89 @@ const serializeAws_json1_1DownloadDefaultKeyPairRequest = ( const serializeAws_json1_1EnableAddOnRequest = (input: EnableAddOnRequest, context: __SerdeContext): any => { return { - ...(input.addOnRequest !== undefined && { - addOnRequest: serializeAws_json1_1AddOnRequest(input.addOnRequest, context), - }), - ...(input.resourceName !== undefined && { resourceName: input.resourceName }), + ...(input.addOnRequest !== undefined && + input.addOnRequest !== null && { addOnRequest: serializeAws_json1_1AddOnRequest(input.addOnRequest, context) }), + ...(input.resourceName !== undefined && input.resourceName !== null && { resourceName: input.resourceName }), }; }; const serializeAws_json1_1EndpointRequest = (input: EndpointRequest, context: __SerdeContext): any => { return { - ...(input.containerName !== undefined && { containerName: input.containerName }), - ...(input.containerPort !== undefined && { containerPort: input.containerPort }), - ...(input.healthCheck !== undefined && { - healthCheck: serializeAws_json1_1ContainerServiceHealthCheckConfig(input.healthCheck, context), - }), + ...(input.containerName !== undefined && input.containerName !== null && { containerName: input.containerName }), + ...(input.containerPort !== undefined && input.containerPort !== null && { containerPort: input.containerPort }), + ...(input.healthCheck !== undefined && + input.healthCheck !== null && { + healthCheck: serializeAws_json1_1ContainerServiceHealthCheckConfig(input.healthCheck, context), + }), }; }; const serializeAws_json1_1Environment = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ExportSnapshotRequest = (input: ExportSnapshotRequest, context: __SerdeContext): any => { return { - ...(input.sourceSnapshotName !== undefined && { sourceSnapshotName: input.sourceSnapshotName }), + ...(input.sourceSnapshotName !== undefined && + input.sourceSnapshotName !== null && { sourceSnapshotName: input.sourceSnapshotName }), }; }; const serializeAws_json1_1GetActiveNamesRequest = (input: GetActiveNamesRequest, context: __SerdeContext): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetAlarmsRequest = (input: GetAlarmsRequest, context: __SerdeContext): any => { return { - ...(input.alarmName !== undefined && { alarmName: input.alarmName }), - ...(input.monitoredResourceName !== undefined && { monitoredResourceName: input.monitoredResourceName }), - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.alarmName !== undefined && input.alarmName !== null && { alarmName: input.alarmName }), + ...(input.monitoredResourceName !== undefined && + input.monitoredResourceName !== null && { monitoredResourceName: input.monitoredResourceName }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetAutoSnapshotsRequest = (input: GetAutoSnapshotsRequest, context: __SerdeContext): any => { return { - ...(input.resourceName !== undefined && { resourceName: input.resourceName }), + ...(input.resourceName !== undefined && input.resourceName !== null && { resourceName: input.resourceName }), }; }; const serializeAws_json1_1GetBlueprintsRequest = (input: GetBlueprintsRequest, context: __SerdeContext): any => { return { - ...(input.includeInactive !== undefined && { includeInactive: input.includeInactive }), - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.includeInactive !== undefined && + input.includeInactive !== null && { includeInactive: input.includeInactive }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetBundlesRequest = (input: GetBundlesRequest, context: __SerdeContext): any => { return { - ...(input.includeInactive !== undefined && { includeInactive: input.includeInactive }), - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.includeInactive !== undefined && + input.includeInactive !== null && { includeInactive: input.includeInactive }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetCertificatesRequest = (input: GetCertificatesRequest, context: __SerdeContext): any => { return { - ...(input.certificateName !== undefined && { certificateName: input.certificateName }), - ...(input.certificateStatuses !== undefined && { - certificateStatuses: serializeAws_json1_1CertificateStatusList(input.certificateStatuses, context), - }), - ...(input.includeCertificateDetails !== undefined && { - includeCertificateDetails: input.includeCertificateDetails, - }), + ...(input.certificateName !== undefined && + input.certificateName !== null && { certificateName: input.certificateName }), + ...(input.certificateStatuses !== undefined && + input.certificateStatuses !== null && { + certificateStatuses: serializeAws_json1_1CertificateStatusList(input.certificateStatuses, context), + }), + ...(input.includeCertificateDetails !== undefined && + input.includeCertificateDetails !== null && { includeCertificateDetails: input.includeCertificateDetails }), }; }; @@ -17615,7 +17630,7 @@ const serializeAws_json1_1GetCloudFormationStackRecordsRequest = ( context: __SerdeContext ): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; @@ -17624,9 +17639,8 @@ const serializeAws_json1_1GetContactMethodsRequest = ( context: __SerdeContext ): any => { return { - ...(input.protocols !== undefined && { - protocols: serializeAws_json1_1ContactProtocolsList(input.protocols, context), - }), + ...(input.protocols !== undefined && + input.protocols !== null && { protocols: serializeAws_json1_1ContactProtocolsList(input.protocols, context) }), }; }; @@ -17642,18 +17656,20 @@ const serializeAws_json1_1GetContainerImagesRequest = ( context: __SerdeContext ): any => { return { - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; const serializeAws_json1_1GetContainerLogRequest = (input: GetContainerLogRequest, context: __SerdeContext): any => { return { - ...(input.containerName !== undefined && { containerName: input.containerName }), - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.filterPattern !== undefined && { filterPattern: input.filterPattern }), - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.containerName !== undefined && input.containerName !== null && { containerName: input.containerName }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.filterPattern !== undefined && input.filterPattern !== null && { filterPattern: input.filterPattern }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), }; }; @@ -17662,7 +17678,7 @@ const serializeAws_json1_1GetContainerServiceDeploymentsRequest = ( context: __SerdeContext ): any => { return { - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; @@ -17671,14 +17687,15 @@ const serializeAws_json1_1GetContainerServiceMetricDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.period !== undefined && { period: input.period }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.statistics !== undefined && { - statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context), - }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.period !== undefined && input.period !== null && { period: input.period }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.statistics !== undefined && + input.statistics !== null && { statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context) }), }; }; @@ -17694,31 +17711,32 @@ const serializeAws_json1_1GetContainerServicesRequest = ( context: __SerdeContext ): any => { return { - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; const serializeAws_json1_1GetDiskRequest = (input: GetDiskRequest, context: __SerdeContext): any => { return { - ...(input.diskName !== undefined && { diskName: input.diskName }), + ...(input.diskName !== undefined && input.diskName !== null && { diskName: input.diskName }), }; }; const serializeAws_json1_1GetDiskSnapshotRequest = (input: GetDiskSnapshotRequest, context: __SerdeContext): any => { return { - ...(input.diskSnapshotName !== undefined && { diskSnapshotName: input.diskSnapshotName }), + ...(input.diskSnapshotName !== undefined && + input.diskSnapshotName !== null && { diskSnapshotName: input.diskSnapshotName }), }; }; const serializeAws_json1_1GetDiskSnapshotsRequest = (input: GetDiskSnapshotsRequest, context: __SerdeContext): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetDisksRequest = (input: GetDisksRequest, context: __SerdeContext): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; @@ -17734,7 +17752,8 @@ const serializeAws_json1_1GetDistributionLatestCacheResetRequest = ( context: __SerdeContext ): any => { return { - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), }; }; @@ -17743,34 +17762,37 @@ const serializeAws_json1_1GetDistributionMetricDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.period !== undefined && { period: input.period }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.statistics !== undefined && { - statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context), - }), - ...(input.unit !== undefined && { unit: input.unit }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.period !== undefined && input.period !== null && { period: input.period }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.statistics !== undefined && + input.statistics !== null && { statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context) }), + ...(input.unit !== undefined && input.unit !== null && { unit: input.unit }), }; }; const serializeAws_json1_1GetDistributionsRequest = (input: GetDistributionsRequest, context: __SerdeContext): any => { return { - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetDomainRequest = (input: GetDomainRequest, context: __SerdeContext): any => { return { - ...(input.domainName !== undefined && { domainName: input.domainName }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), }; }; const serializeAws_json1_1GetDomainsRequest = (input: GetDomainsRequest, context: __SerdeContext): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; @@ -17779,7 +17801,7 @@ const serializeAws_json1_1GetExportSnapshotRecordsRequest = ( context: __SerdeContext ): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; @@ -17788,8 +17810,8 @@ const serializeAws_json1_1GetInstanceAccessDetailsRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), - ...(input.protocol !== undefined && { protocol: input.protocol }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), }; }; @@ -17798,15 +17820,16 @@ const serializeAws_json1_1GetInstanceMetricDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.period !== undefined && { period: input.period }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.statistics !== undefined && { - statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context), - }), - ...(input.unit !== undefined && { unit: input.unit }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.period !== undefined && input.period !== null && { period: input.period }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.statistics !== undefined && + input.statistics !== null && { statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context) }), + ...(input.unit !== undefined && input.unit !== null && { unit: input.unit }), }; }; @@ -17815,13 +17838,13 @@ const serializeAws_json1_1GetInstancePortStatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; const serializeAws_json1_1GetInstanceRequest = (input: GetInstanceRequest, context: __SerdeContext): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; @@ -17830,7 +17853,8 @@ const serializeAws_json1_1GetInstanceSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceSnapshotName !== undefined && { instanceSnapshotName: input.instanceSnapshotName }), + ...(input.instanceSnapshotName !== undefined && + input.instanceSnapshotName !== null && { instanceSnapshotName: input.instanceSnapshotName }), }; }; @@ -17839,31 +17863,31 @@ const serializeAws_json1_1GetInstanceSnapshotsRequest = ( context: __SerdeContext ): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetInstancesRequest = (input: GetInstancesRequest, context: __SerdeContext): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetInstanceStateRequest = (input: GetInstanceStateRequest, context: __SerdeContext): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; const serializeAws_json1_1GetKeyPairRequest = (input: GetKeyPairRequest, context: __SerdeContext): any => { return { - ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }), + ...(input.keyPairName !== undefined && input.keyPairName !== null && { keyPairName: input.keyPairName }), }; }; const serializeAws_json1_1GetKeyPairsRequest = (input: GetKeyPairsRequest, context: __SerdeContext): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; @@ -17872,27 +17896,30 @@ const serializeAws_json1_1GetLoadBalancerMetricDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.period !== undefined && { period: input.period }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.statistics !== undefined && { - statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context), - }), - ...(input.unit !== undefined && { unit: input.unit }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.period !== undefined && input.period !== null && { period: input.period }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.statistics !== undefined && + input.statistics !== null && { statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context) }), + ...(input.unit !== undefined && input.unit !== null && { unit: input.unit }), }; }; const serializeAws_json1_1GetLoadBalancerRequest = (input: GetLoadBalancerRequest, context: __SerdeContext): any => { return { - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), }; }; const serializeAws_json1_1GetLoadBalancersRequest = (input: GetLoadBalancersRequest, context: __SerdeContext): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; @@ -17901,13 +17928,14 @@ const serializeAws_json1_1GetLoadBalancerTlsCertificatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), }; }; const serializeAws_json1_1GetOperationRequest = (input: GetOperationRequest, context: __SerdeContext): any => { return { - ...(input.operationId !== undefined && { operationId: input.operationId }), + ...(input.operationId !== undefined && input.operationId !== null && { operationId: input.operationId }), }; }; @@ -17916,23 +17944,25 @@ const serializeAws_json1_1GetOperationsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), - ...(input.resourceName !== undefined && { resourceName: input.resourceName }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), + ...(input.resourceName !== undefined && input.resourceName !== null && { resourceName: input.resourceName }), }; }; const serializeAws_json1_1GetOperationsRequest = (input: GetOperationsRequest, context: __SerdeContext): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetRegionsRequest = (input: GetRegionsRequest, context: __SerdeContext): any => { return { - ...(input.includeAvailabilityZones !== undefined && { includeAvailabilityZones: input.includeAvailabilityZones }), - ...(input.includeRelationalDatabaseAvailabilityZones !== undefined && { - includeRelationalDatabaseAvailabilityZones: input.includeRelationalDatabaseAvailabilityZones, - }), + ...(input.includeAvailabilityZones !== undefined && + input.includeAvailabilityZones !== null && { includeAvailabilityZones: input.includeAvailabilityZones }), + ...(input.includeRelationalDatabaseAvailabilityZones !== undefined && + input.includeRelationalDatabaseAvailabilityZones !== null && { + includeRelationalDatabaseAvailabilityZones: input.includeRelationalDatabaseAvailabilityZones, + }), }; }; @@ -17941,7 +17971,7 @@ const serializeAws_json1_1GetRelationalDatabaseBlueprintsRequest = ( context: __SerdeContext ): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; @@ -17950,7 +17980,7 @@ const serializeAws_json1_1GetRelationalDatabaseBundlesRequest = ( context: __SerdeContext ): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; @@ -17959,9 +17989,11 @@ const serializeAws_json1_1GetRelationalDatabaseEventsRequest = ( context: __SerdeContext ): any => { return { - ...(input.durationInMinutes !== undefined && { durationInMinutes: input.durationInMinutes }), - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.durationInMinutes !== undefined && + input.durationInMinutes !== null && { durationInMinutes: input.durationInMinutes }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), }; }; @@ -17970,12 +18002,15 @@ const serializeAws_json1_1GetRelationalDatabaseLogEventsRequest = ( context: __SerdeContext ): any => { return { - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.logStreamName !== undefined && { logStreamName: input.logStreamName }), - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), - ...(input.startFromHead !== undefined && { startFromHead: input.startFromHead }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.logStreamName !== undefined && input.logStreamName !== null && { logStreamName: input.logStreamName }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.startFromHead !== undefined && input.startFromHead !== null && { startFromHead: input.startFromHead }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), }; }; @@ -17984,7 +18019,8 @@ const serializeAws_json1_1GetRelationalDatabaseLogStreamsRequest = ( context: __SerdeContext ): any => { return { - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), }; }; @@ -17993,8 +18029,10 @@ const serializeAws_json1_1GetRelationalDatabaseMasterUserPasswordRequest = ( context: __SerdeContext ): any => { return { - ...(input.passwordVersion !== undefined && { passwordVersion: input.passwordVersion }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.passwordVersion !== undefined && + input.passwordVersion !== null && { passwordVersion: input.passwordVersion }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), }; }; @@ -18003,15 +18041,17 @@ const serializeAws_json1_1GetRelationalDatabaseMetricDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.endTime !== undefined && { endTime: Math.round(input.endTime.getTime() / 1000) }), - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.period !== undefined && { period: input.period }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), - ...(input.startTime !== undefined && { startTime: Math.round(input.startTime.getTime() / 1000) }), - ...(input.statistics !== undefined && { - statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context), - }), - ...(input.unit !== undefined && { unit: input.unit }), + ...(input.endTime !== undefined && + input.endTime !== null && { endTime: Math.round(input.endTime.getTime() / 1000) }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.period !== undefined && input.period !== null && { period: input.period }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.startTime !== undefined && + input.startTime !== null && { startTime: Math.round(input.startTime.getTime() / 1000) }), + ...(input.statistics !== undefined && + input.statistics !== null && { statistics: serializeAws_json1_1MetricStatisticList(input.statistics, context) }), + ...(input.unit !== undefined && input.unit !== null && { unit: input.unit }), }; }; @@ -18020,8 +18060,9 @@ const serializeAws_json1_1GetRelationalDatabaseParametersRequest = ( context: __SerdeContext ): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), }; }; @@ -18030,7 +18071,8 @@ const serializeAws_json1_1GetRelationalDatabaseRequest = ( context: __SerdeContext ): any => { return { - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), }; }; @@ -18039,9 +18081,10 @@ const serializeAws_json1_1GetRelationalDatabaseSnapshotRequest = ( context: __SerdeContext ): any => { return { - ...(input.relationalDatabaseSnapshotName !== undefined && { - relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, - }), + ...(input.relationalDatabaseSnapshotName !== undefined && + input.relationalDatabaseSnapshotName !== null && { + relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, + }), }; }; @@ -18050,7 +18093,7 @@ const serializeAws_json1_1GetRelationalDatabaseSnapshotsRequest = ( context: __SerdeContext ): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; @@ -18059,62 +18102,81 @@ const serializeAws_json1_1GetRelationalDatabasesRequest = ( context: __SerdeContext ): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1GetStaticIpRequest = (input: GetStaticIpRequest, context: __SerdeContext): any => { return { - ...(input.staticIpName !== undefined && { staticIpName: input.staticIpName }), + ...(input.staticIpName !== undefined && input.staticIpName !== null && { staticIpName: input.staticIpName }), }; }; const serializeAws_json1_1GetStaticIpsRequest = (input: GetStaticIpsRequest, context: __SerdeContext): any => { return { - ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.pageToken !== undefined && input.pageToken !== null && { pageToken: input.pageToken }), }; }; const serializeAws_json1_1HeaderForwardList = (input: (HeaderEnum | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1HeaderObject = (input: HeaderObject, context: __SerdeContext): any => { return { - ...(input.headersAllowList !== undefined && { - headersAllowList: serializeAws_json1_1HeaderForwardList(input.headersAllowList, context), - }), - ...(input.option !== undefined && { option: input.option }), + ...(input.headersAllowList !== undefined && + input.headersAllowList !== null && { + headersAllowList: serializeAws_json1_1HeaderForwardList(input.headersAllowList, context), + }), + ...(input.option !== undefined && input.option !== null && { option: input.option }), }; }; const serializeAws_json1_1ImportKeyPairRequest = (input: ImportKeyPairRequest, context: __SerdeContext): any => { return { - ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }), - ...(input.publicKeyBase64 !== undefined && { publicKeyBase64: input.publicKeyBase64 }), + ...(input.keyPairName !== undefined && input.keyPairName !== null && { keyPairName: input.keyPairName }), + ...(input.publicKeyBase64 !== undefined && + input.publicKeyBase64 !== null && { publicKeyBase64: input.publicKeyBase64 }), }; }; const serializeAws_json1_1InputOrigin = (input: InputOrigin, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.protocolPolicy !== undefined && { protocolPolicy: input.protocolPolicy }), - ...(input.regionName !== undefined && { regionName: input.regionName }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.protocolPolicy !== undefined && + input.protocolPolicy !== null && { protocolPolicy: input.protocolPolicy }), + ...(input.regionName !== undefined && input.regionName !== null && { regionName: input.regionName }), }; }; const serializeAws_json1_1InstanceEntry = (input: InstanceEntry, context: __SerdeContext): any => { return { - ...(input.availabilityZone !== undefined && { availabilityZone: input.availabilityZone }), - ...(input.instanceType !== undefined && { instanceType: input.instanceType }), - ...(input.portInfoSource !== undefined && { portInfoSource: input.portInfoSource }), - ...(input.sourceName !== undefined && { sourceName: input.sourceName }), - ...(input.userData !== undefined && { userData: input.userData }), + ...(input.availabilityZone !== undefined && + input.availabilityZone !== null && { availabilityZone: input.availabilityZone }), + ...(input.instanceType !== undefined && input.instanceType !== null && { instanceType: input.instanceType }), + ...(input.portInfoSource !== undefined && + input.portInfoSource !== null && { portInfoSource: input.portInfoSource }), + ...(input.sourceName !== undefined && input.sourceName !== null && { sourceName: input.sourceName }), + ...(input.userData !== undefined && input.userData !== null && { userData: input.userData }), }; }; const serializeAws_json1_1InstanceEntryList = (input: InstanceEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InstanceEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InstanceEntry(entry, context); + }); }; const serializeAws_json1_1IsVpcPeeredRequest = (input: IsVpcPeeredRequest, context: __SerdeContext): any => { @@ -18122,11 +18184,25 @@ const serializeAws_json1_1IsVpcPeeredRequest = (input: IsVpcPeeredRequest, conte }; const serializeAws_json1_1MetricStatisticList = (input: (MetricStatistic | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1NotificationTriggerList = (input: (AlarmState | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OpenInstancePublicPortsRequest = ( @@ -18134,8 +18210,9 @@ const serializeAws_json1_1OpenInstancePublicPortsRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), - ...(input.portInfo !== undefined && { portInfo: serializeAws_json1_1PortInfo(input.portInfo, context) }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), + ...(input.portInfo !== undefined && + input.portInfo !== null && { portInfo: serializeAws_json1_1PortInfo(input.portInfo, context) }), }; }; @@ -18145,18 +18222,27 @@ const serializeAws_json1_1PeerVpcRequest = (input: PeerVpcRequest, context: __Se const serializeAws_json1_1PortInfo = (input: PortInfo, context: __SerdeContext): any => { return { - ...(input.cidrListAliases !== undefined && { - cidrListAliases: serializeAws_json1_1StringList(input.cidrListAliases, context), - }), - ...(input.cidrs !== undefined && { cidrs: serializeAws_json1_1StringList(input.cidrs, context) }), - ...(input.fromPort !== undefined && { fromPort: input.fromPort }), - ...(input.protocol !== undefined && { protocol: input.protocol }), - ...(input.toPort !== undefined && { toPort: input.toPort }), + ...(input.cidrListAliases !== undefined && + input.cidrListAliases !== null && { + cidrListAliases: serializeAws_json1_1StringList(input.cidrListAliases, context), + }), + ...(input.cidrs !== undefined && + input.cidrs !== null && { cidrs: serializeAws_json1_1StringList(input.cidrs, context) }), + ...(input.fromPort !== undefined && input.fromPort !== null && { fromPort: input.fromPort }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), + ...(input.toPort !== undefined && input.toPort !== null && { toPort: input.toPort }), }; }; const serializeAws_json1_1PortInfoList = (input: PortInfo[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PortInfo(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PortInfo(entry, context); + }); }; const serializeAws_json1_1PortMap = ( @@ -18164,31 +18250,44 @@ const serializeAws_json1_1PortMap = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: ContainerServiceProtocol | string }, [key, value]: [string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: ContainerServiceProtocol | string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; const serializeAws_json1_1PutAlarmRequest = (input: PutAlarmRequest, context: __SerdeContext): any => { return { - ...(input.alarmName !== undefined && { alarmName: input.alarmName }), - ...(input.comparisonOperator !== undefined && { comparisonOperator: input.comparisonOperator }), - ...(input.contactProtocols !== undefined && { - contactProtocols: serializeAws_json1_1ContactProtocolsList(input.contactProtocols, context), - }), - ...(input.datapointsToAlarm !== undefined && { datapointsToAlarm: input.datapointsToAlarm }), - ...(input.evaluationPeriods !== undefined && { evaluationPeriods: input.evaluationPeriods }), - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.monitoredResourceName !== undefined && { monitoredResourceName: input.monitoredResourceName }), - ...(input.notificationEnabled !== undefined && { notificationEnabled: input.notificationEnabled }), - ...(input.notificationTriggers !== undefined && { - notificationTriggers: serializeAws_json1_1NotificationTriggerList(input.notificationTriggers, context), - }), - ...(input.threshold !== undefined && { threshold: input.threshold }), - ...(input.treatMissingData !== undefined && { treatMissingData: input.treatMissingData }), + ...(input.alarmName !== undefined && input.alarmName !== null && { alarmName: input.alarmName }), + ...(input.comparisonOperator !== undefined && + input.comparisonOperator !== null && { comparisonOperator: input.comparisonOperator }), + ...(input.contactProtocols !== undefined && + input.contactProtocols !== null && { + contactProtocols: serializeAws_json1_1ContactProtocolsList(input.contactProtocols, context), + }), + ...(input.datapointsToAlarm !== undefined && + input.datapointsToAlarm !== null && { datapointsToAlarm: input.datapointsToAlarm }), + ...(input.evaluationPeriods !== undefined && + input.evaluationPeriods !== null && { evaluationPeriods: input.evaluationPeriods }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.monitoredResourceName !== undefined && + input.monitoredResourceName !== null && { monitoredResourceName: input.monitoredResourceName }), + ...(input.notificationEnabled !== undefined && + input.notificationEnabled !== null && { notificationEnabled: input.notificationEnabled }), + ...(input.notificationTriggers !== undefined && + input.notificationTriggers !== null && { + notificationTriggers: serializeAws_json1_1NotificationTriggerList(input.notificationTriggers, context), + }), + ...(input.threshold !== undefined && input.threshold !== null && { threshold: input.threshold }), + ...(input.treatMissingData !== undefined && + input.treatMissingData !== null && { treatMissingData: input.treatMissingData }), }; }; @@ -18197,23 +18296,25 @@ const serializeAws_json1_1PutInstancePublicPortsRequest = ( context: __SerdeContext ): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), - ...(input.portInfos !== undefined && { portInfos: serializeAws_json1_1PortInfoList(input.portInfos, context) }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), + ...(input.portInfos !== undefined && + input.portInfos !== null && { portInfos: serializeAws_json1_1PortInfoList(input.portInfos, context) }), }; }; const serializeAws_json1_1QueryStringObject = (input: QueryStringObject, context: __SerdeContext): any => { return { - ...(input.option !== undefined && { option: input.option }), - ...(input.queryStringsAllowList !== undefined && { - queryStringsAllowList: serializeAws_json1_1StringList(input.queryStringsAllowList, context), - }), + ...(input.option !== undefined && input.option !== null && { option: input.option }), + ...(input.queryStringsAllowList !== undefined && + input.queryStringsAllowList !== null && { + queryStringsAllowList: serializeAws_json1_1StringList(input.queryStringsAllowList, context), + }), }; }; const serializeAws_json1_1RebootInstanceRequest = (input: RebootInstanceRequest, context: __SerdeContext): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; @@ -18222,7 +18323,8 @@ const serializeAws_json1_1RebootRelationalDatabaseRequest = ( context: __SerdeContext ): any => { return { - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), }; }; @@ -18231,9 +18333,9 @@ const serializeAws_json1_1RegisterContainerImageRequest = ( context: __SerdeContext ): any => { return { - ...(input.digest !== undefined && { digest: input.digest }), - ...(input.label !== undefined && { label: input.label }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.digest !== undefined && input.digest !== null && { digest: input.digest }), + ...(input.label !== undefined && input.label !== null && { label: input.label }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; @@ -18242,14 +18344,15 @@ const serializeAws_json1_1RelationalDatabaseParameter = ( context: __SerdeContext ): any => { return { - ...(input.allowedValues !== undefined && { allowedValues: input.allowedValues }), - ...(input.applyMethod !== undefined && { applyMethod: input.applyMethod }), - ...(input.applyType !== undefined && { applyType: input.applyType }), - ...(input.dataType !== undefined && { dataType: input.dataType }), - ...(input.description !== undefined && { description: input.description }), - ...(input.isModifiable !== undefined && { isModifiable: input.isModifiable }), - ...(input.parameterName !== undefined && { parameterName: input.parameterName }), - ...(input.parameterValue !== undefined && { parameterValue: input.parameterValue }), + ...(input.allowedValues !== undefined && input.allowedValues !== null && { allowedValues: input.allowedValues }), + ...(input.applyMethod !== undefined && input.applyMethod !== null && { applyMethod: input.applyMethod }), + ...(input.applyType !== undefined && input.applyType !== null && { applyType: input.applyType }), + ...(input.dataType !== undefined && input.dataType !== null && { dataType: input.dataType }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.isModifiable !== undefined && input.isModifiable !== null && { isModifiable: input.isModifiable }), + ...(input.parameterName !== undefined && input.parameterName !== null && { parameterName: input.parameterName }), + ...(input.parameterValue !== undefined && + input.parameterValue !== null && { parameterValue: input.parameterValue }), }; }; @@ -18257,12 +18360,19 @@ const serializeAws_json1_1RelationalDatabaseParameterList = ( input: RelationalDatabaseParameter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1RelationalDatabaseParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RelationalDatabaseParameter(entry, context); + }); }; const serializeAws_json1_1ReleaseStaticIpRequest = (input: ReleaseStaticIpRequest, context: __SerdeContext): any => { return { - ...(input.staticIpName !== undefined && { staticIpName: input.staticIpName }), + ...(input.staticIpName !== undefined && input.staticIpName !== null && { staticIpName: input.staticIpName }), }; }; @@ -18271,12 +18381,20 @@ const serializeAws_json1_1ResetDistributionCacheRequest = ( context: __SerdeContext ): any => { return { - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), }; }; const serializeAws_json1_1ResourceNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SendContactMethodVerificationRequest = ( @@ -18284,13 +18402,13 @@ const serializeAws_json1_1SendContactMethodVerificationRequest = ( context: __SerdeContext ): any => { return { - ...(input.protocol !== undefined && { protocol: input.protocol }), + ...(input.protocol !== undefined && input.protocol !== null && { protocol: input.protocol }), }; }; const serializeAws_json1_1StartInstanceRequest = (input: StartInstanceRequest, context: __SerdeContext): any => { return { - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; @@ -18299,14 +18417,15 @@ const serializeAws_json1_1StartRelationalDatabaseRequest = ( context: __SerdeContext ): any => { return { - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), }; }; const serializeAws_json1_1StopInstanceRequest = (input: StopInstanceRequest, context: __SerdeContext): any => { return { - ...(input.force !== undefined && { force: input.force }), - ...(input.instanceName !== undefined && { instanceName: input.instanceName }), + ...(input.force !== undefined && input.force !== null && { force: input.force }), + ...(input.instanceName !== undefined && input.instanceName !== null && { instanceName: input.instanceName }), }; }; @@ -18315,48 +18434,78 @@ const serializeAws_json1_1StopRelationalDatabaseRequest = ( context: __SerdeContext ): any => { return { - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), - ...(input.relationalDatabaseSnapshotName !== undefined && { - relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, - }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.relationalDatabaseSnapshotName !== undefined && + input.relationalDatabaseSnapshotName !== null && { + relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName, + }), }; }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SubjectAlternativeNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.resourceName !== undefined && { resourceName: input.resourceName }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1TagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.resourceName !== undefined && input.resourceName !== null && { resourceName: input.resourceName }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1TagList(input.tags, context) }), }; }; const serializeAws_json1_1TestAlarmRequest = (input: TestAlarmRequest, context: __SerdeContext): any => { return { - ...(input.alarmName !== undefined && { alarmName: input.alarmName }), - ...(input.state !== undefined && { state: input.state }), + ...(input.alarmName !== undefined && input.alarmName !== null && { alarmName: input.alarmName }), + ...(input.state !== undefined && input.state !== null && { state: input.state }), }; }; @@ -18366,9 +18515,10 @@ const serializeAws_json1_1UnpeerVpcRequest = (input: UnpeerVpcRequest, context: const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.resourceName !== undefined && { resourceName: input.resourceName }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.resourceName !== undefined && input.resourceName !== null && { resourceName: input.resourceName }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) }), }; }; @@ -18377,13 +18527,14 @@ const serializeAws_json1_1UpdateContainerServiceRequest = ( context: __SerdeContext ): any => { return { - ...(input.isDisabled !== undefined && { isDisabled: input.isDisabled }), - ...(input.power !== undefined && { power: input.power }), - ...(input.publicDomainNames !== undefined && { - publicDomainNames: serializeAws_json1_1ContainerServicePublicDomains(input.publicDomainNames, context), - }), - ...(input.scale !== undefined && { scale: input.scale }), - ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.isDisabled !== undefined && input.isDisabled !== null && { isDisabled: input.isDisabled }), + ...(input.power !== undefined && input.power !== null && { power: input.power }), + ...(input.publicDomainNames !== undefined && + input.publicDomainNames !== null && { + publicDomainNames: serializeAws_json1_1ContainerServicePublicDomains(input.publicDomainNames, context), + }), + ...(input.scale !== undefined && input.scale !== null && { scale: input.scale }), + ...(input.serviceName !== undefined && input.serviceName !== null && { serviceName: input.serviceName }), }; }; @@ -18392,8 +18543,9 @@ const serializeAws_json1_1UpdateDistributionBundleRequest = ( context: __SerdeContext ): any => { return { - ...(input.bundleId !== undefined && { bundleId: input.bundleId }), - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), + ...(input.bundleId !== undefined && input.bundleId !== null && { bundleId: input.bundleId }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), }; }; @@ -18402,18 +18554,23 @@ const serializeAws_json1_1UpdateDistributionRequest = ( context: __SerdeContext ): any => { return { - ...(input.cacheBehaviorSettings !== undefined && { - cacheBehaviorSettings: serializeAws_json1_1CacheSettings(input.cacheBehaviorSettings, context), - }), - ...(input.cacheBehaviors !== undefined && { - cacheBehaviors: serializeAws_json1_1CacheBehaviorList(input.cacheBehaviors, context), - }), - ...(input.defaultCacheBehavior !== undefined && { - defaultCacheBehavior: serializeAws_json1_1CacheBehavior(input.defaultCacheBehavior, context), - }), - ...(input.distributionName !== undefined && { distributionName: input.distributionName }), - ...(input.isEnabled !== undefined && { isEnabled: input.isEnabled }), - ...(input.origin !== undefined && { origin: serializeAws_json1_1InputOrigin(input.origin, context) }), + ...(input.cacheBehaviorSettings !== undefined && + input.cacheBehaviorSettings !== null && { + cacheBehaviorSettings: serializeAws_json1_1CacheSettings(input.cacheBehaviorSettings, context), + }), + ...(input.cacheBehaviors !== undefined && + input.cacheBehaviors !== null && { + cacheBehaviors: serializeAws_json1_1CacheBehaviorList(input.cacheBehaviors, context), + }), + ...(input.defaultCacheBehavior !== undefined && + input.defaultCacheBehavior !== null && { + defaultCacheBehavior: serializeAws_json1_1CacheBehavior(input.defaultCacheBehavior, context), + }), + ...(input.distributionName !== undefined && + input.distributionName !== null && { distributionName: input.distributionName }), + ...(input.isEnabled !== undefined && input.isEnabled !== null && { isEnabled: input.isEnabled }), + ...(input.origin !== undefined && + input.origin !== null && { origin: serializeAws_json1_1InputOrigin(input.origin, context) }), }; }; @@ -18422,10 +18579,9 @@ const serializeAws_json1_1UpdateDomainEntryRequest = ( context: __SerdeContext ): any => { return { - ...(input.domainEntry !== undefined && { - domainEntry: serializeAws_json1_1DomainEntry(input.domainEntry, context), - }), - ...(input.domainName !== undefined && { domainName: input.domainName }), + ...(input.domainEntry !== undefined && + input.domainEntry !== null && { domainEntry: serializeAws_json1_1DomainEntry(input.domainEntry, context) }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), }; }; @@ -18434,9 +18590,11 @@ const serializeAws_json1_1UpdateLoadBalancerAttributeRequest = ( context: __SerdeContext ): any => { return { - ...(input.attributeName !== undefined && { attributeName: input.attributeName }), - ...(input.attributeValue !== undefined && { attributeValue: input.attributeValue }), - ...(input.loadBalancerName !== undefined && { loadBalancerName: input.loadBalancerName }), + ...(input.attributeName !== undefined && input.attributeName !== null && { attributeName: input.attributeName }), + ...(input.attributeValue !== undefined && + input.attributeValue !== null && { attributeValue: input.attributeValue }), + ...(input.loadBalancerName !== undefined && + input.loadBalancerName !== null && { loadBalancerName: input.loadBalancerName }), }; }; @@ -18445,10 +18603,12 @@ const serializeAws_json1_1UpdateRelationalDatabaseParametersRequest = ( context: __SerdeContext ): any => { return { - ...(input.parameters !== undefined && { - parameters: serializeAws_json1_1RelationalDatabaseParameterList(input.parameters, context), - }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.parameters !== undefined && + input.parameters !== null && { + parameters: serializeAws_json1_1RelationalDatabaseParameterList(input.parameters, context), + }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), }; }; @@ -18457,18 +18617,26 @@ const serializeAws_json1_1UpdateRelationalDatabaseRequest = ( context: __SerdeContext ): any => { return { - ...(input.applyImmediately !== undefined && { applyImmediately: input.applyImmediately }), - ...(input.caCertificateIdentifier !== undefined && { caCertificateIdentifier: input.caCertificateIdentifier }), - ...(input.disableBackupRetention !== undefined && { disableBackupRetention: input.disableBackupRetention }), - ...(input.enableBackupRetention !== undefined && { enableBackupRetention: input.enableBackupRetention }), - ...(input.masterUserPassword !== undefined && { masterUserPassword: input.masterUserPassword }), - ...(input.preferredBackupWindow !== undefined && { preferredBackupWindow: input.preferredBackupWindow }), - ...(input.preferredMaintenanceWindow !== undefined && { - preferredMaintenanceWindow: input.preferredMaintenanceWindow, - }), - ...(input.publiclyAccessible !== undefined && { publiclyAccessible: input.publiclyAccessible }), - ...(input.relationalDatabaseName !== undefined && { relationalDatabaseName: input.relationalDatabaseName }), - ...(input.rotateMasterUserPassword !== undefined && { rotateMasterUserPassword: input.rotateMasterUserPassword }), + ...(input.applyImmediately !== undefined && + input.applyImmediately !== null && { applyImmediately: input.applyImmediately }), + ...(input.caCertificateIdentifier !== undefined && + input.caCertificateIdentifier !== null && { caCertificateIdentifier: input.caCertificateIdentifier }), + ...(input.disableBackupRetention !== undefined && + input.disableBackupRetention !== null && { disableBackupRetention: input.disableBackupRetention }), + ...(input.enableBackupRetention !== undefined && + input.enableBackupRetention !== null && { enableBackupRetention: input.enableBackupRetention }), + ...(input.masterUserPassword !== undefined && + input.masterUserPassword !== null && { masterUserPassword: input.masterUserPassword }), + ...(input.preferredBackupWindow !== undefined && + input.preferredBackupWindow !== null && { preferredBackupWindow: input.preferredBackupWindow }), + ...(input.preferredMaintenanceWindow !== undefined && + input.preferredMaintenanceWindow !== null && { preferredMaintenanceWindow: input.preferredMaintenanceWindow }), + ...(input.publiclyAccessible !== undefined && + input.publiclyAccessible !== null && { publiclyAccessible: input.publiclyAccessible }), + ...(input.relationalDatabaseName !== undefined && + input.relationalDatabaseName !== null && { relationalDatabaseName: input.relationalDatabaseName }), + ...(input.rotateMasterUserPassword !== undefined && + input.rotateMasterUserPassword !== null && { rotateMasterUserPassword: input.rotateMasterUserPassword }), }; }; @@ -18509,7 +18677,14 @@ const deserializeAws_json1_1AddOn = (output: any, context: __SerdeContext): AddO }; const deserializeAws_json1_1AddOnList = (output: any, context: __SerdeContext): AddOn[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AddOn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AddOn(entry, context); + }); }; const deserializeAws_json1_1Alarm = (output: any, context: __SerdeContext): Alarm => { @@ -18566,7 +18741,14 @@ const deserializeAws_json1_1Alarm = (output: any, context: __SerdeContext): Alar }; const deserializeAws_json1_1AlarmsList = (output: any, context: __SerdeContext): Alarm[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Alarm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Alarm(entry, context); + }); }; const deserializeAws_json1_1AllocateStaticIpResult = (output: any, context: __SerdeContext): AllocateStaticIpResult => { @@ -18607,7 +18789,14 @@ const deserializeAws_json1_1AttachedDisk = (output: any, context: __SerdeContext }; const deserializeAws_json1_1AttachedDiskList = (output: any, context: __SerdeContext): AttachedDisk[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttachedDisk(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttachedDisk(entry, context); + }); }; const deserializeAws_json1_1AttachInstancesToLoadBalancerResult = ( @@ -18659,7 +18848,14 @@ const deserializeAws_json1_1AutoSnapshotDetails = (output: any, context: __Serde }; const deserializeAws_json1_1AutoSnapshotDetailsList = (output: any, context: __SerdeContext): AutoSnapshotDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutoSnapshotDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutoSnapshotDetails(entry, context); + }); }; const deserializeAws_json1_1AvailabilityZone = (output: any, context: __SerdeContext): AvailabilityZone => { @@ -18670,7 +18866,14 @@ const deserializeAws_json1_1AvailabilityZone = (output: any, context: __SerdeCon }; const deserializeAws_json1_1AvailabilityZoneList = (output: any, context: __SerdeContext): AvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AvailabilityZone(entry, context); + }); }; const deserializeAws_json1_1Blueprint = (output: any, context: __SerdeContext): Blueprint => { @@ -18691,7 +18894,14 @@ const deserializeAws_json1_1Blueprint = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1BlueprintList = (output: any, context: __SerdeContext): Blueprint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Blueprint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Blueprint(entry, context); + }); }; const deserializeAws_json1_1Bundle = (output: any, context: __SerdeContext): Bundle => { @@ -18717,7 +18927,14 @@ const deserializeAws_json1_1Bundle = (output: any, context: __SerdeContext): Bun }; const deserializeAws_json1_1BundleList = (output: any, context: __SerdeContext): Bundle[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Bundle(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Bundle(entry, context); + }); }; const deserializeAws_json1_1CacheBehavior = (output: any, context: __SerdeContext): CacheBehavior => { @@ -18727,7 +18944,14 @@ const deserializeAws_json1_1CacheBehavior = (output: any, context: __SerdeContex }; const deserializeAws_json1_1CacheBehaviorList = (output: any, context: __SerdeContext): CacheBehaviorPerPath[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CacheBehaviorPerPath(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CacheBehaviorPerPath(entry, context); + }); }; const deserializeAws_json1_1CacheBehaviorPerPath = (output: any, context: __SerdeContext): CacheBehaviorPerPath => { @@ -18845,7 +19069,14 @@ const deserializeAws_json1_1CertificateSummary = (output: any, context: __SerdeC }; const deserializeAws_json1_1CertificateSummaryList = (output: any, context: __SerdeContext): CertificateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CertificateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CertificateSummary(entry, context); + }); }; const deserializeAws_json1_1CloseInstancePublicPortsResult = ( @@ -18892,7 +19123,14 @@ const deserializeAws_json1_1CloudFormationStackRecordList = ( output: any, context: __SerdeContext ): CloudFormationStackRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CloudFormationStackRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CloudFormationStackRecord(entry, context); + }); }; const deserializeAws_json1_1CloudFormationStackRecordSourceInfo = ( @@ -18910,7 +19148,14 @@ const deserializeAws_json1_1CloudFormationStackRecordSourceInfoList = ( output: any, context: __SerdeContext ): CloudFormationStackRecordSourceInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CloudFormationStackRecordSourceInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CloudFormationStackRecordSourceInfo(entry, context); + }); }; const deserializeAws_json1_1ContactMethod = (output: any, context: __SerdeContext): ContactMethod => { @@ -18935,14 +19180,28 @@ const deserializeAws_json1_1ContactMethod = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ContactMethodsList = (output: any, context: __SerdeContext): ContactMethod[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContactMethod(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContactMethod(entry, context); + }); }; const deserializeAws_json1_1ContactProtocolsList = ( output: any, context: __SerdeContext ): (ContactProtocol | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Container = (output: any, context: __SerdeContext): Container => { @@ -18975,17 +19234,26 @@ const deserializeAws_json1_1ContainerImage = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ContainerImageList = (output: any, context: __SerdeContext): ContainerImage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerImage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerImage(entry, context); + }); }; const deserializeAws_json1_1ContainerMap = (output: any, context: __SerdeContext): { [key: string]: Container } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Container }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Container }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1Container(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ContainerService = (output: any, context: __SerdeContext): ContainerService => { @@ -19060,7 +19328,14 @@ const deserializeAws_json1_1ContainerServiceDeploymentList = ( output: any, context: __SerdeContext ): ContainerServiceDeployment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerServiceDeployment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerServiceDeployment(entry, context); + }); }; const deserializeAws_json1_1ContainerServiceEndpoint = ( @@ -19100,7 +19375,14 @@ const deserializeAws_json1_1ContainerServiceHealthCheckConfig = ( }; const deserializeAws_json1_1ContainerServiceList = (output: any, context: __SerdeContext): ContainerService[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerService(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerService(entry, context); + }); }; const deserializeAws_json1_1ContainerServiceLogEvent = ( @@ -19120,27 +19402,43 @@ const deserializeAws_json1_1ContainerServiceLogEventList = ( output: any, context: __SerdeContext ): ContainerServiceLogEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerServiceLogEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerServiceLogEvent(entry, context); + }); }; const deserializeAws_json1_1ContainerServiceMetadataEntry = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ContainerServiceMetadataEntryList = ( output: any, context: __SerdeContext ): { [key: string]: string }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerServiceMetadataEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerServiceMetadataEntry(entry, context); + }); }; const deserializeAws_json1_1ContainerServicePower = (output: any, context: __SerdeContext): ContainerServicePower => { @@ -19158,24 +19456,40 @@ const deserializeAws_json1_1ContainerServicePowerList = ( output: any, context: __SerdeContext ): ContainerServicePower[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerServicePower(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerServicePower(entry, context); + }); }; const deserializeAws_json1_1ContainerServicePublicDomains = ( output: any, context: __SerdeContext ): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1ContainerServicePublicDomainsList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ContainerServicePublicDomainsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ContainerServiceRegistryLogin = ( @@ -19786,11 +20100,25 @@ const deserializeAws_json1_1DiskInfo = (output: any, context: __SerdeContext): D }; const deserializeAws_json1_1DiskInfoList = (output: any, context: __SerdeContext): DiskInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DiskInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DiskInfo(entry, context); + }); }; const deserializeAws_json1_1DiskList = (output: any, context: __SerdeContext): Disk[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Disk(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Disk(entry, context); + }); }; const deserializeAws_json1_1DiskSnapshot = (output: any, context: __SerdeContext): DiskSnapshot => { @@ -19834,7 +20162,14 @@ const deserializeAws_json1_1DiskSnapshotInfo = (output: any, context: __SerdeCon }; const deserializeAws_json1_1DiskSnapshotList = (output: any, context: __SerdeContext): DiskSnapshot[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DiskSnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DiskSnapshot(entry, context); + }); }; const deserializeAws_json1_1DistributionBundle = (output: any, context: __SerdeContext): DistributionBundle => { @@ -19851,11 +20186,25 @@ const deserializeAws_json1_1DistributionBundle = (output: any, context: __SerdeC }; const deserializeAws_json1_1DistributionBundleList = (output: any, context: __SerdeContext): DistributionBundle[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DistributionBundle(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DistributionBundle(entry, context); + }); }; const deserializeAws_json1_1DistributionList = (output: any, context: __SerdeContext): LightsailDistribution[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LightsailDistribution(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LightsailDistribution(entry, context); + }); }; const deserializeAws_json1_1Domain = (output: any, context: __SerdeContext): Domain => { @@ -19898,21 +20247,37 @@ const deserializeAws_json1_1DomainEntry = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1DomainEntryList = (output: any, context: __SerdeContext): DomainEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DomainEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DomainEntry(entry, context); + }); }; const deserializeAws_json1_1DomainEntryOptions = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1DomainList = (output: any, context: __SerdeContext): Domain[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Domain(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Domain(entry, context); + }); }; const deserializeAws_json1_1DomainValidationRecord = (output: any, context: __SerdeContext): DomainValidationRecord => { @@ -19929,7 +20294,14 @@ const deserializeAws_json1_1DomainValidationRecordList = ( output: any, context: __SerdeContext ): DomainValidationRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DomainValidationRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DomainValidationRecord(entry, context); + }); }; const deserializeAws_json1_1DownloadDefaultKeyPairResult = ( @@ -19954,13 +20326,15 @@ const deserializeAws_json1_1EnableAddOnResult = (output: any, context: __SerdeCo }; const deserializeAws_json1_1Environment = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ExportSnapshotRecord = (output: any, context: __SerdeContext): ExportSnapshotRecord => { @@ -19992,7 +20366,14 @@ const deserializeAws_json1_1ExportSnapshotRecordList = ( output: any, context: __SerdeContext ): ExportSnapshotRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExportSnapshotRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExportSnapshotRecord(entry, context); + }); }; const deserializeAws_json1_1ExportSnapshotRecordSourceInfo = ( @@ -20704,7 +21085,14 @@ const deserializeAws_json1_1GetStaticIpsResult = (output: any, context: __SerdeC }; const deserializeAws_json1_1HeaderForwardList = (output: any, context: __SerdeContext): (HeaderEnum | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1HeaderObject = (output: any, context: __SerdeContext): HeaderObject => { @@ -20743,7 +21131,14 @@ const deserializeAws_json1_1HostKeyAttributes = (output: any, context: __SerdeCo }; const deserializeAws_json1_1HostKeysList = (output: any, context: __SerdeContext): HostKeyAttributes[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HostKeyAttributes(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HostKeyAttributes(entry, context); + }); }; const deserializeAws_json1_1ImportKeyPairResult = (output: any, context: __SerdeContext): ImportKeyPairResult => { @@ -20855,11 +21250,25 @@ const deserializeAws_json1_1InstanceHealthSummaryList = ( output: any, context: __SerdeContext ): InstanceHealthSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceHealthSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceHealthSummary(entry, context); + }); }; const deserializeAws_json1_1InstanceList = (output: any, context: __SerdeContext): Instance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Instance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Instance(entry, context); + }); }; const deserializeAws_json1_1InstanceNetworking = (output: any, context: __SerdeContext): InstanceNetworking => { @@ -20879,7 +21288,14 @@ const deserializeAws_json1_1InstancePlatformList = ( output: any, context: __SerdeContext ): (InstancePlatform | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InstancePortInfo = (output: any, context: __SerdeContext): InstancePortInfo => { @@ -20904,7 +21320,14 @@ const deserializeAws_json1_1InstancePortInfo = (output: any, context: __SerdeCon }; const deserializeAws_json1_1InstancePortInfoList = (output: any, context: __SerdeContext): InstancePortInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstancePortInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstancePortInfo(entry, context); + }); }; const deserializeAws_json1_1InstancePortState = (output: any, context: __SerdeContext): InstancePortState => { @@ -20925,7 +21348,14 @@ const deserializeAws_json1_1InstancePortState = (output: any, context: __SerdeCo }; const deserializeAws_json1_1InstancePortStateList = (output: any, context: __SerdeContext): InstancePortState[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstancePortState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstancePortState(entry, context); + }); }; const deserializeAws_json1_1InstanceSnapshot = (output: any, context: __SerdeContext): InstanceSnapshot => { @@ -20980,7 +21410,14 @@ const deserializeAws_json1_1InstanceSnapshotInfo = (output: any, context: __Serd }; const deserializeAws_json1_1InstanceSnapshotList = (output: any, context: __SerdeContext): InstanceSnapshot[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceSnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceSnapshot(entry, context); + }); }; const deserializeAws_json1_1InstanceState = (output: any, context: __SerdeContext): InstanceState => { @@ -21028,7 +21465,14 @@ const deserializeAws_json1_1KeyPair = (output: any, context: __SerdeContext): Ke }; const deserializeAws_json1_1KeyPairList = (output: any, context: __SerdeContext): KeyPair[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KeyPair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KeyPair(entry, context); + }); }; const deserializeAws_json1_1LightsailDistribution = (output: any, context: __SerdeContext): LightsailDistribution => { @@ -21132,16 +21576,28 @@ const deserializeAws_json1_1LoadBalancerConfigurationOptions = ( context: __SerdeContext ): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [LoadBalancerAttributeName | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [LoadBalancerAttributeName | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; const deserializeAws_json1_1LoadBalancerList = (output: any, context: __SerdeContext): LoadBalancer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LoadBalancer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoadBalancer(entry, context); + }); }; const deserializeAws_json1_1LoadBalancerTlsCertificate = ( @@ -21231,9 +21687,14 @@ const deserializeAws_json1_1LoadBalancerTlsCertificateDomainValidationOptionList output: any, context: __SerdeContext ): LoadBalancerTlsCertificateDomainValidationOption[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1LoadBalancerTlsCertificateDomainValidationOption(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoadBalancerTlsCertificateDomainValidationOption(entry, context); + }); }; const deserializeAws_json1_1LoadBalancerTlsCertificateDomainValidationRecord = ( @@ -21254,16 +21715,28 @@ const deserializeAws_json1_1LoadBalancerTlsCertificateDomainValidationRecordList output: any, context: __SerdeContext ): LoadBalancerTlsCertificateDomainValidationRecord[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1LoadBalancerTlsCertificateDomainValidationRecord(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoadBalancerTlsCertificateDomainValidationRecord(entry, context); + }); }; const deserializeAws_json1_1LoadBalancerTlsCertificateList = ( output: any, context: __SerdeContext ): LoadBalancerTlsCertificate[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LoadBalancerTlsCertificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoadBalancerTlsCertificate(entry, context); + }); }; const deserializeAws_json1_1LoadBalancerTlsCertificateRenewalSummary = ( @@ -21297,7 +21770,14 @@ const deserializeAws_json1_1LoadBalancerTlsCertificateSummaryList = ( output: any, context: __SerdeContext ): LoadBalancerTlsCertificateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LoadBalancerTlsCertificateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoadBalancerTlsCertificateSummary(entry, context); + }); }; const deserializeAws_json1_1LogEvent = (output: any, context: __SerdeContext): LogEvent => { @@ -21311,7 +21791,14 @@ const deserializeAws_json1_1LogEvent = (output: any, context: __SerdeContext): L }; const deserializeAws_json1_1LogEventList = (output: any, context: __SerdeContext): LogEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LogEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LogEvent(entry, context); + }); }; const deserializeAws_json1_1MetricDatapoint = (output: any, context: __SerdeContext): MetricDatapoint => { @@ -21330,7 +21817,14 @@ const deserializeAws_json1_1MetricDatapoint = (output: any, context: __SerdeCont }; const deserializeAws_json1_1MetricDatapointList = (output: any, context: __SerdeContext): MetricDatapoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricDatapoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricDatapoint(entry, context); + }); }; const deserializeAws_json1_1MonitoredResourceInfo = (output: any, context: __SerdeContext): MonitoredResourceInfo => { @@ -21363,7 +21857,14 @@ const deserializeAws_json1_1NotificationTriggerList = ( output: any, context: __SerdeContext ): (AlarmState | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1OpenInstancePublicPortsResult = ( @@ -21419,7 +21920,14 @@ const deserializeAws_json1_1OperationFailureException = ( }; const deserializeAws_json1_1OperationList = (output: any, context: __SerdeContext): Operation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Operation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Operation(entry, context); + }); }; const deserializeAws_json1_1Origin = (output: any, context: __SerdeContext): Origin => { @@ -21466,7 +21974,14 @@ const deserializeAws_json1_1PendingMaintenanceActionList = ( output: any, context: __SerdeContext ): PendingMaintenanceAction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PendingMaintenanceAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PendingMaintenanceAction(entry, context); + }); }; const deserializeAws_json1_1PendingModifiedRelationalDatabaseValues = ( @@ -21488,7 +22003,14 @@ const deserializeAws_json1_1PendingModifiedRelationalDatabaseValues = ( }; const deserializeAws_json1_1PortList = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PortMap = ( @@ -21496,10 +22018,15 @@ const deserializeAws_json1_1PortMap = ( context: __SerdeContext ): { [key: string]: ContainerServiceProtocol | string } => { return Object.entries(output).reduce( - (acc: { [key: string]: ContainerServiceProtocol | string }, [key, value]: [string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: ContainerServiceProtocol | string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -21575,7 +22102,14 @@ const deserializeAws_json1_1Region = (output: any, context: __SerdeContext): Reg }; const deserializeAws_json1_1RegionList = (output: any, context: __SerdeContext): Region[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Region(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Region(entry, context); + }); }; const deserializeAws_json1_1RegisterContainerImageResult = ( @@ -21703,7 +22237,14 @@ const deserializeAws_json1_1RelationalDatabaseBlueprintList = ( output: any, context: __SerdeContext ): RelationalDatabaseBlueprint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RelationalDatabaseBlueprint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RelationalDatabaseBlueprint(entry, context); + }); }; const deserializeAws_json1_1RelationalDatabaseBundle = ( @@ -21730,7 +22271,14 @@ const deserializeAws_json1_1RelationalDatabaseBundleList = ( output: any, context: __SerdeContext ): RelationalDatabaseBundle[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RelationalDatabaseBundle(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RelationalDatabaseBundle(entry, context); + }); }; const deserializeAws_json1_1RelationalDatabaseEndpoint = ( @@ -21765,7 +22313,14 @@ const deserializeAws_json1_1RelationalDatabaseEventList = ( output: any, context: __SerdeContext ): RelationalDatabaseEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RelationalDatabaseEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RelationalDatabaseEvent(entry, context); + }); }; const deserializeAws_json1_1RelationalDatabaseHardware = ( @@ -21780,7 +22335,14 @@ const deserializeAws_json1_1RelationalDatabaseHardware = ( }; const deserializeAws_json1_1RelationalDatabaseList = (output: any, context: __SerdeContext): RelationalDatabase[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RelationalDatabase(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RelationalDatabase(entry, context); + }); }; const deserializeAws_json1_1RelationalDatabaseParameter = ( @@ -21806,7 +22368,14 @@ const deserializeAws_json1_1RelationalDatabaseParameterList = ( output: any, context: __SerdeContext ): RelationalDatabaseParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RelationalDatabaseParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RelationalDatabaseParameter(entry, context); + }); }; const deserializeAws_json1_1RelationalDatabaseSnapshot = ( @@ -21858,7 +22427,14 @@ const deserializeAws_json1_1RelationalDatabaseSnapshotList = ( output: any, context: __SerdeContext ): RelationalDatabaseSnapshot[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RelationalDatabaseSnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RelationalDatabaseSnapshot(entry, context); + }); }; const deserializeAws_json1_1ReleaseStaticIpResult = (output: any, context: __SerdeContext): ReleaseStaticIpResult => { @@ -21985,7 +22561,14 @@ const deserializeAws_json1_1StaticIp = (output: any, context: __SerdeContext): S }; const deserializeAws_json1_1StaticIpList = (output: any, context: __SerdeContext): StaticIp[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StaticIp(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StaticIp(entry, context); + }); }; const deserializeAws_json1_1StopInstanceResult = (output: any, context: __SerdeContext): StopInstanceResult => { @@ -22010,11 +22593,25 @@ const deserializeAws_json1_1StopRelationalDatabaseResult = ( }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SubjectAlternativeNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -22025,7 +22622,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResult = (output: any, context: __SerdeContext): TagResourceResult => { @@ -22210,3 +22814,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-lookoutvision/protocols/Aws_restJson1.ts b/clients/client-lookoutvision/protocols/Aws_restJson1.ts index af3955e2855b..c1d77cc5fc1c 100644 --- a/clients/client-lookoutvision/protocols/Aws_restJson1.ts +++ b/clients/client-lookoutvision/protocols/Aws_restJson1.ts @@ -60,7 +60,7 @@ export const serializeAws_restJson1CreateDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ClientToken) && { "X-Amzn-Client-Token": input.ClientToken! }), }; let resolvedPath = "/2020-11-20/projects/{ProjectName}/datasets"; @@ -75,10 +75,11 @@ export const serializeAws_restJson1CreateDatasetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DatasetSource !== undefined && { - DatasetSource: serializeAws_restJson1DatasetSource(input.DatasetSource, context), - }), - ...(input.DatasetType !== undefined && { DatasetType: input.DatasetType }), + ...(input.DatasetSource !== undefined && + input.DatasetSource !== null && { + DatasetSource: serializeAws_restJson1DatasetSource(input.DatasetSource, context), + }), + ...(input.DatasetType !== undefined && input.DatasetType !== null && { DatasetType: input.DatasetType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -97,7 +98,7 @@ export const serializeAws_restJson1CreateModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ClientToken) && { "X-Amzn-Client-Token": input.ClientToken! }), }; let resolvedPath = "/2020-11-20/projects/{ProjectName}/models"; @@ -112,13 +113,13 @@ export const serializeAws_restJson1CreateModelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { - Description: serializeAws_restJson1ModelDescription(input.Description, context), - }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_restJson1OutputConfig(input.OutputConfig, context), - }), + ...(input.Description !== undefined && + input.Description !== null && { + Description: serializeAws_restJson1ModelDescription(input.Description, context), + }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { OutputConfig: serializeAws_restJson1OutputConfig(input.OutputConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -137,13 +138,13 @@ export const serializeAws_restJson1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ClientToken) && { "X-Amzn-Client-Token": input.ClientToken! }), }; let resolvedPath = "/2020-11-20/projects"; let body: any; body = JSON.stringify({ - ...(input.ProjectName !== undefined && { ProjectName: input.ProjectName }), + ...(input.ProjectName !== undefined && input.ProjectName !== null && { ProjectName: input.ProjectName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -162,7 +163,6 @@ export const serializeAws_restJson1DeleteDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ClientToken) && { "X-Amzn-Client-Token": input.ClientToken! }), }; let resolvedPath = "/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}"; @@ -202,7 +202,6 @@ export const serializeAws_restJson1DeleteModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ClientToken) && { "X-Amzn-Client-Token": input.ClientToken! }), }; let resolvedPath = "/2020-11-20/projects/{ProjectName}/models/{ModelVersion}"; @@ -242,7 +241,6 @@ export const serializeAws_restJson1DeleteProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ClientToken) && { "X-Amzn-Client-Token": input.ClientToken! }), }; let resolvedPath = "/2020-11-20/projects/{ProjectName}"; @@ -272,9 +270,7 @@ export const serializeAws_restJson1DescribeDatasetCommand = async ( input: DescribeDatasetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}"; if (input.ProjectName !== undefined) { const labelValue: string = input.ProjectName; @@ -311,9 +307,7 @@ export const serializeAws_restJson1DescribeModelCommand = async ( input: DescribeModelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-11-20/projects/{ProjectName}/models/{ModelVersion}"; if (input.ProjectName !== undefined) { const labelValue: string = input.ProjectName; @@ -350,9 +344,7 @@ export const serializeAws_restJson1DescribeProjectCommand = async ( input: DescribeProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-11-20/projects/{ProjectName}"; if (input.ProjectName !== undefined) { const labelValue: string = input.ProjectName; @@ -381,7 +373,7 @@ export const serializeAws_restJson1DetectAnomaliesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.ContentType) && { "content-type": input.ContentType! }), }; let resolvedPath = "/2020-11-20/projects/{ProjectName}/models/{ModelVersion}/detect"; @@ -423,9 +415,7 @@ export const serializeAws_restJson1ListDatasetEntriesCommand = async ( input: ListDatasetEntriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}/entries"; if (input.ProjectName !== undefined) { const labelValue: string = input.ProjectName; @@ -476,9 +466,7 @@ export const serializeAws_restJson1ListModelsCommand = async ( input: ListModelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-11-20/projects/{ProjectName}/models"; if (input.ProjectName !== undefined) { const labelValue: string = input.ProjectName; @@ -511,9 +499,7 @@ export const serializeAws_restJson1ListProjectsCommand = async ( input: ListProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2020-11-20/projects"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -538,7 +524,7 @@ export const serializeAws_restJson1StartModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ClientToken) && { "X-Amzn-Client-Token": input.ClientToken! }), }; let resolvedPath = "/2020-11-20/projects/{ProjectName}/models/{ModelVersion}/start"; @@ -562,7 +548,8 @@ export const serializeAws_restJson1StartModelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MinInferenceUnits !== undefined && { MinInferenceUnits: input.MinInferenceUnits }), + ...(input.MinInferenceUnits !== undefined && + input.MinInferenceUnits !== null && { MinInferenceUnits: input.MinInferenceUnits }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -581,7 +568,6 @@ export const serializeAws_restJson1StopModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ClientToken) && { "X-Amzn-Client-Token": input.ClientToken! }), }; let resolvedPath = "/2020-11-20/projects/{ProjectName}/models/{ModelVersion}/stop"; @@ -621,7 +607,7 @@ export const serializeAws_restJson1UpdateDatasetEntriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.ClientToken) && { "X-Amzn-Client-Token": input.ClientToken! }), }; let resolvedPath = "/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}/entries"; @@ -645,7 +631,7 @@ export const serializeAws_restJson1UpdateDatasetEntriesCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Changes !== undefined && { Changes: context.base64Encoder(input.Changes) }), + ...(input.Changes !== undefined && input.Changes !== null && { Changes: context.base64Encoder(input.Changes) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2391,80 +2377,85 @@ const serializeAws_restJson1DatasetGroundTruthManifest = ( context: __SerdeContext ): any => { return { - ...(input.S3Object !== undefined && { S3Object: serializeAws_restJson1InputS3Object(input.S3Object, context) }), + ...(input.S3Object !== undefined && + input.S3Object !== null && { S3Object: serializeAws_restJson1InputS3Object(input.S3Object, context) }), }; }; const serializeAws_restJson1DatasetSource = (input: DatasetSource, context: __SerdeContext): any => { return { - ...(input.GroundTruthManifest !== undefined && { - GroundTruthManifest: serializeAws_restJson1DatasetGroundTruthManifest(input.GroundTruthManifest, context), - }), + ...(input.GroundTruthManifest !== undefined && + input.GroundTruthManifest !== null && { + GroundTruthManifest: serializeAws_restJson1DatasetGroundTruthManifest(input.GroundTruthManifest, context), + }), }; }; const serializeAws_restJson1InputS3Object = (input: InputS3Object, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.VersionId !== undefined && { VersionId: input.VersionId }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.VersionId !== undefined && input.VersionId !== null && { VersionId: input.VersionId }), }; }; const serializeAws_restJson1ModelDescription = (input: ModelDescription, context: __SerdeContext): any => { return { - ...(input.CreationTimestamp !== undefined && { - CreationTimestamp: Math.round(input.CreationTimestamp.getTime() / 1000), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EvaluationEndTimestamp !== undefined && { - EvaluationEndTimestamp: Math.round(input.EvaluationEndTimestamp.getTime() / 1000), - }), - ...(input.EvaluationManifest !== undefined && { - EvaluationManifest: serializeAws_restJson1OutputS3Object(input.EvaluationManifest, context), - }), - ...(input.EvaluationResult !== undefined && { - EvaluationResult: serializeAws_restJson1OutputS3Object(input.EvaluationResult, context), - }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.ModelArn !== undefined && { ModelArn: input.ModelArn }), - ...(input.ModelVersion !== undefined && { ModelVersion: input.ModelVersion }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_restJson1OutputConfig(input.OutputConfig, context), - }), - ...(input.Performance !== undefined && { - Performance: serializeAws_restJson1ModelPerformance(input.Performance, context), - }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.StatusMessage !== undefined && { StatusMessage: input.StatusMessage }), + ...(input.CreationTimestamp !== undefined && + input.CreationTimestamp !== null && { CreationTimestamp: Math.round(input.CreationTimestamp.getTime() / 1000) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EvaluationEndTimestamp !== undefined && + input.EvaluationEndTimestamp !== null && { + EvaluationEndTimestamp: Math.round(input.EvaluationEndTimestamp.getTime() / 1000), + }), + ...(input.EvaluationManifest !== undefined && + input.EvaluationManifest !== null && { + EvaluationManifest: serializeAws_restJson1OutputS3Object(input.EvaluationManifest, context), + }), + ...(input.EvaluationResult !== undefined && + input.EvaluationResult !== null && { + EvaluationResult: serializeAws_restJson1OutputS3Object(input.EvaluationResult, context), + }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.ModelArn !== undefined && input.ModelArn !== null && { ModelArn: input.ModelArn }), + ...(input.ModelVersion !== undefined && input.ModelVersion !== null && { ModelVersion: input.ModelVersion }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { OutputConfig: serializeAws_restJson1OutputConfig(input.OutputConfig, context) }), + ...(input.Performance !== undefined && + input.Performance !== null && { + Performance: serializeAws_restJson1ModelPerformance(input.Performance, context), + }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.StatusMessage !== undefined && input.StatusMessage !== null && { StatusMessage: input.StatusMessage }), }; }; const serializeAws_restJson1ModelPerformance = (input: ModelPerformance, context: __SerdeContext): any => { return { - ...(input.F1Score !== undefined && { F1Score: input.F1Score }), - ...(input.Precision !== undefined && { Precision: input.Precision }), - ...(input.Recall !== undefined && { Recall: input.Recall }), + ...(input.F1Score !== undefined && input.F1Score !== null && { F1Score: input.F1Score }), + ...(input.Precision !== undefined && input.Precision !== null && { Precision: input.Precision }), + ...(input.Recall !== undefined && input.Recall !== null && { Recall: input.Recall }), }; }; const serializeAws_restJson1OutputConfig = (input: OutputConfig, context: __SerdeContext): any => { return { - ...(input.S3Location !== undefined && { S3Location: serializeAws_restJson1S3Location(input.S3Location, context) }), + ...(input.S3Location !== undefined && + input.S3Location !== null && { S3Location: serializeAws_restJson1S3Location(input.S3Location, context) }), }; }; const serializeAws_restJson1OutputS3Object = (input: OutputS3Object, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), }; }; const serializeAws_restJson1S3Location = (input: S3Location, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), }; }; @@ -2491,7 +2482,14 @@ const deserializeAws_restJson1DatasetDescription = (output: any, context: __Serd }; const deserializeAws_restJson1DatasetEntryList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DatasetImageStats = (output: any, context: __SerdeContext): DatasetImageStats => { @@ -2517,7 +2515,14 @@ const deserializeAws_restJson1DatasetMetadata = (output: any, context: __SerdeCo }; const deserializeAws_restJson1DatasetMetadataList = (output: any, context: __SerdeContext): DatasetMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DatasetMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DatasetMetadata(entry, context); + }); }; const deserializeAws_restJson1DetectAnomalyResult = (output: any, context: __SerdeContext): DetectAnomalyResult => { @@ -2593,7 +2598,14 @@ const deserializeAws_restJson1ModelMetadata = (output: any, context: __SerdeCont }; const deserializeAws_restJson1ModelMetadataList = (output: any, context: __SerdeContext): ModelMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ModelMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ModelMetadata(entry, context); + }); }; const deserializeAws_restJson1ModelPerformance = (output: any, context: __SerdeContext): ModelPerformance => { @@ -2647,7 +2659,14 @@ const deserializeAws_restJson1ProjectMetadata = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ProjectMetadataList = (output: any, context: __SerdeContext): ProjectMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProjectMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProjectMetadata(entry, context); + }); }; const deserializeAws_restJson1S3Location = (output: any, context: __SerdeContext): S3Location => { @@ -2677,6 +2696,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-machine-learning/protocols/Aws_json1_1.ts b/clients/client-machine-learning/protocols/Aws_json1_1.ts index 3e6bb566c723..59c86dd120ee 100644 --- a/clients/client-machine-learning/protocols/Aws_json1_1.ts +++ b/clients/client-machine-learning/protocols/Aws_json1_1.ts @@ -158,7 +158,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.AddTags", }; let body: any; @@ -171,7 +171,7 @@ export const serializeAws_json1_1CreateBatchPredictionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.CreateBatchPrediction", }; let body: any; @@ -184,7 +184,7 @@ export const serializeAws_json1_1CreateDataSourceFromRDSCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.CreateDataSourceFromRDS", }; let body: any; @@ -197,7 +197,7 @@ export const serializeAws_json1_1CreateDataSourceFromRedshiftCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.CreateDataSourceFromRedshift", }; let body: any; @@ -210,7 +210,7 @@ export const serializeAws_json1_1CreateDataSourceFromS3Command = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.CreateDataSourceFromS3", }; let body: any; @@ -223,7 +223,7 @@ export const serializeAws_json1_1CreateEvaluationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.CreateEvaluation", }; let body: any; @@ -236,7 +236,7 @@ export const serializeAws_json1_1CreateMLModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.CreateMLModel", }; let body: any; @@ -249,7 +249,7 @@ export const serializeAws_json1_1CreateRealtimeEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.CreateRealtimeEndpoint", }; let body: any; @@ -262,7 +262,7 @@ export const serializeAws_json1_1DeleteBatchPredictionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DeleteBatchPrediction", }; let body: any; @@ -275,7 +275,7 @@ export const serializeAws_json1_1DeleteDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DeleteDataSource", }; let body: any; @@ -288,7 +288,7 @@ export const serializeAws_json1_1DeleteEvaluationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DeleteEvaluation", }; let body: any; @@ -301,7 +301,7 @@ export const serializeAws_json1_1DeleteMLModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DeleteMLModel", }; let body: any; @@ -314,7 +314,7 @@ export const serializeAws_json1_1DeleteRealtimeEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DeleteRealtimeEndpoint", }; let body: any; @@ -327,7 +327,7 @@ export const serializeAws_json1_1DeleteTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DeleteTags", }; let body: any; @@ -340,7 +340,7 @@ export const serializeAws_json1_1DescribeBatchPredictionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DescribeBatchPredictions", }; let body: any; @@ -353,7 +353,7 @@ export const serializeAws_json1_1DescribeDataSourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DescribeDataSources", }; let body: any; @@ -366,7 +366,7 @@ export const serializeAws_json1_1DescribeEvaluationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DescribeEvaluations", }; let body: any; @@ -379,7 +379,7 @@ export const serializeAws_json1_1DescribeMLModelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DescribeMLModels", }; let body: any; @@ -392,7 +392,7 @@ export const serializeAws_json1_1DescribeTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.DescribeTags", }; let body: any; @@ -405,7 +405,7 @@ export const serializeAws_json1_1GetBatchPredictionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.GetBatchPrediction", }; let body: any; @@ -418,7 +418,7 @@ export const serializeAws_json1_1GetDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.GetDataSource", }; let body: any; @@ -431,7 +431,7 @@ export const serializeAws_json1_1GetEvaluationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.GetEvaluation", }; let body: any; @@ -444,7 +444,7 @@ export const serializeAws_json1_1GetMLModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.GetMLModel", }; let body: any; @@ -457,7 +457,7 @@ export const serializeAws_json1_1PredictCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.Predict", }; let body: any; @@ -470,7 +470,7 @@ export const serializeAws_json1_1UpdateBatchPredictionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.UpdateBatchPrediction", }; let body: any; @@ -483,7 +483,7 @@ export const serializeAws_json1_1UpdateDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.UpdateDataSource", }; let body: any; @@ -496,7 +496,7 @@ export const serializeAws_json1_1UpdateEvaluationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.UpdateEvaluation", }; let body: any; @@ -509,7 +509,7 @@ export const serializeAws_json1_1UpdateMLModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonML_20141212.UpdateMLModel", }; let body: any; @@ -544,8 +544,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -631,8 +630,7 @@ const deserializeAws_json1_1CreateBatchPredictionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatchException": case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": @@ -702,8 +700,7 @@ const deserializeAws_json1_1CreateDataSourceFromRDSCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatchException": case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": @@ -773,8 +770,7 @@ const deserializeAws_json1_1CreateDataSourceFromRedshiftCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatchException": case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": @@ -844,8 +840,7 @@ const deserializeAws_json1_1CreateDataSourceFromS3CommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatchException": case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": @@ -915,8 +910,7 @@ const deserializeAws_json1_1CreateEvaluationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatchException": case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": @@ -986,8 +980,7 @@ const deserializeAws_json1_1CreateMLModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatchException": case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": @@ -1057,8 +1050,7 @@ const deserializeAws_json1_1CreateRealtimeEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1128,8 +1120,7 @@ const deserializeAws_json1_1DeleteBatchPredictionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1199,8 +1190,7 @@ const deserializeAws_json1_1DeleteDataSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1270,8 +1260,7 @@ const deserializeAws_json1_1DeleteEvaluationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1341,8 +1330,7 @@ const deserializeAws_json1_1DeleteMLModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1412,8 +1400,7 @@ const deserializeAws_json1_1DeleteRealtimeEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1483,8 +1470,7 @@ const deserializeAws_json1_1DeleteTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1562,8 +1548,7 @@ const deserializeAws_json1_1DescribeBatchPredictionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1625,8 +1610,7 @@ const deserializeAws_json1_1DescribeDataSourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1688,8 +1672,7 @@ const deserializeAws_json1_1DescribeEvaluationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1751,8 +1734,7 @@ const deserializeAws_json1_1DescribeMLModelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1814,8 +1796,7 @@ const deserializeAws_json1_1DescribeTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1885,8 +1866,7 @@ const deserializeAws_json1_1GetBatchPredictionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -1956,8 +1936,7 @@ const deserializeAws_json1_1GetDataSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -2027,8 +2006,7 @@ const deserializeAws_json1_1GetEvaluationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -2098,8 +2076,7 @@ const deserializeAws_json1_1GetMLModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -2169,8 +2146,7 @@ const deserializeAws_json1_1PredictCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -2256,8 +2232,7 @@ const deserializeAws_json1_1UpdateBatchPredictionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -2327,8 +2302,7 @@ const deserializeAws_json1_1UpdateDataSourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -2398,8 +2372,7 @@ const deserializeAws_json1_1UpdateEvaluationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -2469,8 +2442,7 @@ const deserializeAws_json1_1UpdateMLModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.machinelearning#InternalServerException": @@ -2635,9 +2607,9 @@ const deserializeAws_json1_1TagLimitExceededExceptionResponse = async ( const serializeAws_json1_1AddTagsInput = (input: AddTagsInput, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -2646,13 +2618,14 @@ const serializeAws_json1_1CreateBatchPredictionInput = ( context: __SerdeContext ): any => { return { - ...(input.BatchPredictionDataSourceId !== undefined && { - BatchPredictionDataSourceId: input.BatchPredictionDataSourceId, - }), - ...(input.BatchPredictionId !== undefined && { BatchPredictionId: input.BatchPredictionId }), - ...(input.BatchPredictionName !== undefined && { BatchPredictionName: input.BatchPredictionName }), - ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), - ...(input.OutputUri !== undefined && { OutputUri: input.OutputUri }), + ...(input.BatchPredictionDataSourceId !== undefined && + input.BatchPredictionDataSourceId !== null && { BatchPredictionDataSourceId: input.BatchPredictionDataSourceId }), + ...(input.BatchPredictionId !== undefined && + input.BatchPredictionId !== null && { BatchPredictionId: input.BatchPredictionId }), + ...(input.BatchPredictionName !== undefined && + input.BatchPredictionName !== null && { BatchPredictionName: input.BatchPredictionName }), + ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }), + ...(input.OutputUri !== undefined && input.OutputUri !== null && { OutputUri: input.OutputUri }), }; }; @@ -2661,11 +2634,14 @@ const serializeAws_json1_1CreateDataSourceFromRDSInput = ( context: __SerdeContext ): any => { return { - ...(input.ComputeStatistics !== undefined && { ComputeStatistics: input.ComputeStatistics }), - ...(input.DataSourceId !== undefined && { DataSourceId: input.DataSourceId }), - ...(input.DataSourceName !== undefined && { DataSourceName: input.DataSourceName }), - ...(input.RDSData !== undefined && { RDSData: serializeAws_json1_1RDSDataSpec(input.RDSData, context) }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.ComputeStatistics !== undefined && + input.ComputeStatistics !== null && { ComputeStatistics: input.ComputeStatistics }), + ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }), + ...(input.DataSourceName !== undefined && + input.DataSourceName !== null && { DataSourceName: input.DataSourceName }), + ...(input.RDSData !== undefined && + input.RDSData !== null && { RDSData: serializeAws_json1_1RDSDataSpec(input.RDSData, context) }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; @@ -2674,11 +2650,14 @@ const serializeAws_json1_1CreateDataSourceFromRedshiftInput = ( context: __SerdeContext ): any => { return { - ...(input.ComputeStatistics !== undefined && { ComputeStatistics: input.ComputeStatistics }), - ...(input.DataSourceId !== undefined && { DataSourceId: input.DataSourceId }), - ...(input.DataSourceName !== undefined && { DataSourceName: input.DataSourceName }), - ...(input.DataSpec !== undefined && { DataSpec: serializeAws_json1_1RedshiftDataSpec(input.DataSpec, context) }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), + ...(input.ComputeStatistics !== undefined && + input.ComputeStatistics !== null && { ComputeStatistics: input.ComputeStatistics }), + ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }), + ...(input.DataSourceName !== undefined && + input.DataSourceName !== null && { DataSourceName: input.DataSourceName }), + ...(input.DataSpec !== undefined && + input.DataSpec !== null && { DataSpec: serializeAws_json1_1RedshiftDataSpec(input.DataSpec, context) }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), }; }; @@ -2687,33 +2666,38 @@ const serializeAws_json1_1CreateDataSourceFromS3Input = ( context: __SerdeContext ): any => { return { - ...(input.ComputeStatistics !== undefined && { ComputeStatistics: input.ComputeStatistics }), - ...(input.DataSourceId !== undefined && { DataSourceId: input.DataSourceId }), - ...(input.DataSourceName !== undefined && { DataSourceName: input.DataSourceName }), - ...(input.DataSpec !== undefined && { DataSpec: serializeAws_json1_1S3DataSpec(input.DataSpec, context) }), + ...(input.ComputeStatistics !== undefined && + input.ComputeStatistics !== null && { ComputeStatistics: input.ComputeStatistics }), + ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }), + ...(input.DataSourceName !== undefined && + input.DataSourceName !== null && { DataSourceName: input.DataSourceName }), + ...(input.DataSpec !== undefined && + input.DataSpec !== null && { DataSpec: serializeAws_json1_1S3DataSpec(input.DataSpec, context) }), }; }; const serializeAws_json1_1CreateEvaluationInput = (input: CreateEvaluationInput, context: __SerdeContext): any => { return { - ...(input.EvaluationDataSourceId !== undefined && { EvaluationDataSourceId: input.EvaluationDataSourceId }), - ...(input.EvaluationId !== undefined && { EvaluationId: input.EvaluationId }), - ...(input.EvaluationName !== undefined && { EvaluationName: input.EvaluationName }), - ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), + ...(input.EvaluationDataSourceId !== undefined && + input.EvaluationDataSourceId !== null && { EvaluationDataSourceId: input.EvaluationDataSourceId }), + ...(input.EvaluationId !== undefined && input.EvaluationId !== null && { EvaluationId: input.EvaluationId }), + ...(input.EvaluationName !== undefined && + input.EvaluationName !== null && { EvaluationName: input.EvaluationName }), + ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }), }; }; const serializeAws_json1_1CreateMLModelInput = (input: CreateMLModelInput, context: __SerdeContext): any => { return { - ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), - ...(input.MLModelName !== undefined && { MLModelName: input.MLModelName }), - ...(input.MLModelType !== undefined && { MLModelType: input.MLModelType }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1TrainingParameters(input.Parameters, context), - }), - ...(input.Recipe !== undefined && { Recipe: input.Recipe }), - ...(input.RecipeUri !== undefined && { RecipeUri: input.RecipeUri }), - ...(input.TrainingDataSourceId !== undefined && { TrainingDataSourceId: input.TrainingDataSourceId }), + ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }), + ...(input.MLModelName !== undefined && input.MLModelName !== null && { MLModelName: input.MLModelName }), + ...(input.MLModelType !== undefined && input.MLModelType !== null && { MLModelType: input.MLModelType }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1TrainingParameters(input.Parameters, context) }), + ...(input.Recipe !== undefined && input.Recipe !== null && { Recipe: input.Recipe }), + ...(input.RecipeUri !== undefined && input.RecipeUri !== null && { RecipeUri: input.RecipeUri }), + ...(input.TrainingDataSourceId !== undefined && + input.TrainingDataSourceId !== null && { TrainingDataSourceId: input.TrainingDataSourceId }), }; }; @@ -2722,7 +2706,7 @@ const serializeAws_json1_1CreateRealtimeEndpointInput = ( context: __SerdeContext ): any => { return { - ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), + ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }), }; }; @@ -2731,25 +2715,26 @@ const serializeAws_json1_1DeleteBatchPredictionInput = ( context: __SerdeContext ): any => { return { - ...(input.BatchPredictionId !== undefined && { BatchPredictionId: input.BatchPredictionId }), + ...(input.BatchPredictionId !== undefined && + input.BatchPredictionId !== null && { BatchPredictionId: input.BatchPredictionId }), }; }; const serializeAws_json1_1DeleteDataSourceInput = (input: DeleteDataSourceInput, context: __SerdeContext): any => { return { - ...(input.DataSourceId !== undefined && { DataSourceId: input.DataSourceId }), + ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }), }; }; const serializeAws_json1_1DeleteEvaluationInput = (input: DeleteEvaluationInput, context: __SerdeContext): any => { return { - ...(input.EvaluationId !== undefined && { EvaluationId: input.EvaluationId }), + ...(input.EvaluationId !== undefined && input.EvaluationId !== null && { EvaluationId: input.EvaluationId }), }; }; const serializeAws_json1_1DeleteMLModelInput = (input: DeleteMLModelInput, context: __SerdeContext): any => { return { - ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), + ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }), }; }; @@ -2758,15 +2743,16 @@ const serializeAws_json1_1DeleteRealtimeEndpointInput = ( context: __SerdeContext ): any => { return { - ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), + ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }), }; }; const serializeAws_json1_1DeleteTagsInput = (input: DeleteTagsInput, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -2775,17 +2761,18 @@ const serializeAws_json1_1DescribeBatchPredictionsInput = ( context: __SerdeContext ): any => { return { - ...(input.EQ !== undefined && { EQ: input.EQ }), - ...(input.FilterVariable !== undefined && { FilterVariable: input.FilterVariable }), - ...(input.GE !== undefined && { GE: input.GE }), - ...(input.GT !== undefined && { GT: input.GT }), - ...(input.LE !== undefined && { LE: input.LE }), - ...(input.LT !== undefined && { LT: input.LT }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NE !== undefined && { NE: input.NE }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.EQ !== undefined && input.EQ !== null && { EQ: input.EQ }), + ...(input.FilterVariable !== undefined && + input.FilterVariable !== null && { FilterVariable: input.FilterVariable }), + ...(input.GE !== undefined && input.GE !== null && { GE: input.GE }), + ...(input.GT !== undefined && input.GT !== null && { GT: input.GT }), + ...(input.LE !== undefined && input.LE !== null && { LE: input.LE }), + ...(input.LT !== undefined && input.LT !== null && { LT: input.LT }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NE !== undefined && input.NE !== null && { NE: input.NE }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -2794,17 +2781,18 @@ const serializeAws_json1_1DescribeDataSourcesInput = ( context: __SerdeContext ): any => { return { - ...(input.EQ !== undefined && { EQ: input.EQ }), - ...(input.FilterVariable !== undefined && { FilterVariable: input.FilterVariable }), - ...(input.GE !== undefined && { GE: input.GE }), - ...(input.GT !== undefined && { GT: input.GT }), - ...(input.LE !== undefined && { LE: input.LE }), - ...(input.LT !== undefined && { LT: input.LT }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NE !== undefined && { NE: input.NE }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.EQ !== undefined && input.EQ !== null && { EQ: input.EQ }), + ...(input.FilterVariable !== undefined && + input.FilterVariable !== null && { FilterVariable: input.FilterVariable }), + ...(input.GE !== undefined && input.GE !== null && { GE: input.GE }), + ...(input.GT !== undefined && input.GT !== null && { GT: input.GT }), + ...(input.LE !== undefined && input.LE !== null && { LE: input.LE }), + ...(input.LT !== undefined && input.LT !== null && { LT: input.LT }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NE !== undefined && input.NE !== null && { NE: input.NE }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -2813,131 +2801,153 @@ const serializeAws_json1_1DescribeEvaluationsInput = ( context: __SerdeContext ): any => { return { - ...(input.EQ !== undefined && { EQ: input.EQ }), - ...(input.FilterVariable !== undefined && { FilterVariable: input.FilterVariable }), - ...(input.GE !== undefined && { GE: input.GE }), - ...(input.GT !== undefined && { GT: input.GT }), - ...(input.LE !== undefined && { LE: input.LE }), - ...(input.LT !== undefined && { LT: input.LT }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NE !== undefined && { NE: input.NE }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.EQ !== undefined && input.EQ !== null && { EQ: input.EQ }), + ...(input.FilterVariable !== undefined && + input.FilterVariable !== null && { FilterVariable: input.FilterVariable }), + ...(input.GE !== undefined && input.GE !== null && { GE: input.GE }), + ...(input.GT !== undefined && input.GT !== null && { GT: input.GT }), + ...(input.LE !== undefined && input.LE !== null && { LE: input.LE }), + ...(input.LT !== undefined && input.LT !== null && { LT: input.LT }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NE !== undefined && input.NE !== null && { NE: input.NE }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1DescribeMLModelsInput = (input: DescribeMLModelsInput, context: __SerdeContext): any => { return { - ...(input.EQ !== undefined && { EQ: input.EQ }), - ...(input.FilterVariable !== undefined && { FilterVariable: input.FilterVariable }), - ...(input.GE !== undefined && { GE: input.GE }), - ...(input.GT !== undefined && { GT: input.GT }), - ...(input.LE !== undefined && { LE: input.LE }), - ...(input.LT !== undefined && { LT: input.LT }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NE !== undefined && { NE: input.NE }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.EQ !== undefined && input.EQ !== null && { EQ: input.EQ }), + ...(input.FilterVariable !== undefined && + input.FilterVariable !== null && { FilterVariable: input.FilterVariable }), + ...(input.GE !== undefined && input.GE !== null && { GE: input.GE }), + ...(input.GT !== undefined && input.GT !== null && { GT: input.GT }), + ...(input.LE !== undefined && input.LE !== null && { LE: input.LE }), + ...(input.LT !== undefined && input.LT !== null && { LT: input.LT }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NE !== undefined && input.NE !== null && { NE: input.NE }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1DescribeTagsInput = (input: DescribeTagsInput, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; const serializeAws_json1_1EDPSecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetBatchPredictionInput = (input: GetBatchPredictionInput, context: __SerdeContext): any => { return { - ...(input.BatchPredictionId !== undefined && { BatchPredictionId: input.BatchPredictionId }), + ...(input.BatchPredictionId !== undefined && + input.BatchPredictionId !== null && { BatchPredictionId: input.BatchPredictionId }), }; }; const serializeAws_json1_1GetDataSourceInput = (input: GetDataSourceInput, context: __SerdeContext): any => { return { - ...(input.DataSourceId !== undefined && { DataSourceId: input.DataSourceId }), - ...(input.Verbose !== undefined && { Verbose: input.Verbose }), + ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }), + ...(input.Verbose !== undefined && input.Verbose !== null && { Verbose: input.Verbose }), }; }; const serializeAws_json1_1GetEvaluationInput = (input: GetEvaluationInput, context: __SerdeContext): any => { return { - ...(input.EvaluationId !== undefined && { EvaluationId: input.EvaluationId }), + ...(input.EvaluationId !== undefined && input.EvaluationId !== null && { EvaluationId: input.EvaluationId }), }; }; const serializeAws_json1_1GetMLModelInput = (input: GetMLModelInput, context: __SerdeContext): any => { return { - ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), - ...(input.Verbose !== undefined && { Verbose: input.Verbose }), + ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }), + ...(input.Verbose !== undefined && input.Verbose !== null && { Verbose: input.Verbose }), }; }; const serializeAws_json1_1PredictInput = (input: PredictInput, context: __SerdeContext): any => { return { - ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), - ...(input.PredictEndpoint !== undefined && { PredictEndpoint: input.PredictEndpoint }), - ...(input.Record !== undefined && { Record: serializeAws_json1_1Record(input.Record, context) }), + ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }), + ...(input.PredictEndpoint !== undefined && + input.PredictEndpoint !== null && { PredictEndpoint: input.PredictEndpoint }), + ...(input.Record !== undefined && + input.Record !== null && { Record: serializeAws_json1_1Record(input.Record, context) }), }; }; const serializeAws_json1_1RDSDatabase = (input: RDSDatabase, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.InstanceIdentifier !== undefined && { InstanceIdentifier: input.InstanceIdentifier }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.InstanceIdentifier !== undefined && + input.InstanceIdentifier !== null && { InstanceIdentifier: input.InstanceIdentifier }), }; }; const serializeAws_json1_1RDSDatabaseCredentials = (input: RDSDatabaseCredentials, context: __SerdeContext): any => { return { - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1RDSDataSpec = (input: RDSDataSpec, context: __SerdeContext): any => { return { - ...(input.DataRearrangement !== undefined && { DataRearrangement: input.DataRearrangement }), - ...(input.DataSchema !== undefined && { DataSchema: input.DataSchema }), - ...(input.DataSchemaUri !== undefined && { DataSchemaUri: input.DataSchemaUri }), - ...(input.DatabaseCredentials !== undefined && { - DatabaseCredentials: serializeAws_json1_1RDSDatabaseCredentials(input.DatabaseCredentials, context), - }), - ...(input.DatabaseInformation !== undefined && { - DatabaseInformation: serializeAws_json1_1RDSDatabase(input.DatabaseInformation, context), - }), - ...(input.ResourceRole !== undefined && { ResourceRole: input.ResourceRole }), - ...(input.S3StagingLocation !== undefined && { S3StagingLocation: input.S3StagingLocation }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1EDPSecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.SelectSqlQuery !== undefined && { SelectSqlQuery: input.SelectSqlQuery }), - ...(input.ServiceRole !== undefined && { ServiceRole: input.ServiceRole }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), + ...(input.DataRearrangement !== undefined && + input.DataRearrangement !== null && { DataRearrangement: input.DataRearrangement }), + ...(input.DataSchema !== undefined && input.DataSchema !== null && { DataSchema: input.DataSchema }), + ...(input.DataSchemaUri !== undefined && input.DataSchemaUri !== null && { DataSchemaUri: input.DataSchemaUri }), + ...(input.DatabaseCredentials !== undefined && + input.DatabaseCredentials !== null && { + DatabaseCredentials: serializeAws_json1_1RDSDatabaseCredentials(input.DatabaseCredentials, context), + }), + ...(input.DatabaseInformation !== undefined && + input.DatabaseInformation !== null && { + DatabaseInformation: serializeAws_json1_1RDSDatabase(input.DatabaseInformation, context), + }), + ...(input.ResourceRole !== undefined && input.ResourceRole !== null && { ResourceRole: input.ResourceRole }), + ...(input.S3StagingLocation !== undefined && + input.S3StagingLocation !== null && { S3StagingLocation: input.S3StagingLocation }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1EDPSecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.SelectSqlQuery !== undefined && + input.SelectSqlQuery !== null && { SelectSqlQuery: input.SelectSqlQuery }), + ...(input.ServiceRole !== undefined && input.ServiceRole !== null && { ServiceRole: input.ServiceRole }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), }; }; const serializeAws_json1_1Record = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1RedshiftDatabase = (input: RedshiftDatabase, context: __SerdeContext): any => { return { - ...(input.ClusterIdentifier !== undefined && { ClusterIdentifier: input.ClusterIdentifier }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), + ...(input.ClusterIdentifier !== undefined && + input.ClusterIdentifier !== null && { ClusterIdentifier: input.ClusterIdentifier }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), }; }; @@ -2946,59 +2956,83 @@ const serializeAws_json1_1RedshiftDatabaseCredentials = ( context: __SerdeContext ): any => { return { - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1RedshiftDataSpec = (input: RedshiftDataSpec, context: __SerdeContext): any => { return { - ...(input.DataRearrangement !== undefined && { DataRearrangement: input.DataRearrangement }), - ...(input.DataSchema !== undefined && { DataSchema: input.DataSchema }), - ...(input.DataSchemaUri !== undefined && { DataSchemaUri: input.DataSchemaUri }), - ...(input.DatabaseCredentials !== undefined && { - DatabaseCredentials: serializeAws_json1_1RedshiftDatabaseCredentials(input.DatabaseCredentials, context), - }), - ...(input.DatabaseInformation !== undefined && { - DatabaseInformation: serializeAws_json1_1RedshiftDatabase(input.DatabaseInformation, context), - }), - ...(input.S3StagingLocation !== undefined && { S3StagingLocation: input.S3StagingLocation }), - ...(input.SelectSqlQuery !== undefined && { SelectSqlQuery: input.SelectSqlQuery }), + ...(input.DataRearrangement !== undefined && + input.DataRearrangement !== null && { DataRearrangement: input.DataRearrangement }), + ...(input.DataSchema !== undefined && input.DataSchema !== null && { DataSchema: input.DataSchema }), + ...(input.DataSchemaUri !== undefined && input.DataSchemaUri !== null && { DataSchemaUri: input.DataSchemaUri }), + ...(input.DatabaseCredentials !== undefined && + input.DatabaseCredentials !== null && { + DatabaseCredentials: serializeAws_json1_1RedshiftDatabaseCredentials(input.DatabaseCredentials, context), + }), + ...(input.DatabaseInformation !== undefined && + input.DatabaseInformation !== null && { + DatabaseInformation: serializeAws_json1_1RedshiftDatabase(input.DatabaseInformation, context), + }), + ...(input.S3StagingLocation !== undefined && + input.S3StagingLocation !== null && { S3StagingLocation: input.S3StagingLocation }), + ...(input.SelectSqlQuery !== undefined && + input.SelectSqlQuery !== null && { SelectSqlQuery: input.SelectSqlQuery }), }; }; const serializeAws_json1_1S3DataSpec = (input: S3DataSpec, context: __SerdeContext): any => { return { - ...(input.DataLocationS3 !== undefined && { DataLocationS3: input.DataLocationS3 }), - ...(input.DataRearrangement !== undefined && { DataRearrangement: input.DataRearrangement }), - ...(input.DataSchema !== undefined && { DataSchema: input.DataSchema }), - ...(input.DataSchemaLocationS3 !== undefined && { DataSchemaLocationS3: input.DataSchemaLocationS3 }), + ...(input.DataLocationS3 !== undefined && + input.DataLocationS3 !== null && { DataLocationS3: input.DataLocationS3 }), + ...(input.DataRearrangement !== undefined && + input.DataRearrangement !== null && { DataRearrangement: input.DataRearrangement }), + ...(input.DataSchema !== undefined && input.DataSchema !== null && { DataSchema: input.DataSchema }), + ...(input.DataSchemaLocationS3 !== undefined && + input.DataSchemaLocationS3 !== null && { DataSchemaLocationS3: input.DataSchemaLocationS3 }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TrainingParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1UpdateBatchPredictionInput = ( @@ -3006,30 +3040,35 @@ const serializeAws_json1_1UpdateBatchPredictionInput = ( context: __SerdeContext ): any => { return { - ...(input.BatchPredictionId !== undefined && { BatchPredictionId: input.BatchPredictionId }), - ...(input.BatchPredictionName !== undefined && { BatchPredictionName: input.BatchPredictionName }), + ...(input.BatchPredictionId !== undefined && + input.BatchPredictionId !== null && { BatchPredictionId: input.BatchPredictionId }), + ...(input.BatchPredictionName !== undefined && + input.BatchPredictionName !== null && { BatchPredictionName: input.BatchPredictionName }), }; }; const serializeAws_json1_1UpdateDataSourceInput = (input: UpdateDataSourceInput, context: __SerdeContext): any => { return { - ...(input.DataSourceId !== undefined && { DataSourceId: input.DataSourceId }), - ...(input.DataSourceName !== undefined && { DataSourceName: input.DataSourceName }), + ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }), + ...(input.DataSourceName !== undefined && + input.DataSourceName !== null && { DataSourceName: input.DataSourceName }), }; }; const serializeAws_json1_1UpdateEvaluationInput = (input: UpdateEvaluationInput, context: __SerdeContext): any => { return { - ...(input.EvaluationId !== undefined && { EvaluationId: input.EvaluationId }), - ...(input.EvaluationName !== undefined && { EvaluationName: input.EvaluationName }), + ...(input.EvaluationId !== undefined && input.EvaluationId !== null && { EvaluationId: input.EvaluationId }), + ...(input.EvaluationName !== undefined && + input.EvaluationName !== null && { EvaluationName: input.EvaluationName }), }; }; const serializeAws_json1_1UpdateMLModelInput = (input: UpdateMLModelInput, context: __SerdeContext): any => { return { - ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), - ...(input.MLModelName !== undefined && { MLModelName: input.MLModelName }), - ...(input.ScoreThreshold !== undefined && { ScoreThreshold: input.ScoreThreshold }), + ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }), + ...(input.MLModelName !== undefined && input.MLModelName !== null && { MLModelName: input.MLModelName }), + ...(input.ScoreThreshold !== undefined && + input.ScoreThreshold !== null && { ScoreThreshold: input.ScoreThreshold }), }; }; @@ -3088,7 +3127,14 @@ const deserializeAws_json1_1BatchPrediction = (output: any, context: __SerdeCont }; const deserializeAws_json1_1BatchPredictions = (output: any, context: __SerdeContext): BatchPrediction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchPrediction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchPrediction(entry, context); + }); }; const deserializeAws_json1_1CreateBatchPredictionOutput = ( @@ -3207,7 +3253,14 @@ const deserializeAws_json1_1DataSource = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1DataSources = (output: any, context: __SerdeContext): DataSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataSource(entry, context); + }); }; const deserializeAws_json1_1DeleteBatchPredictionOutput = ( @@ -3322,10 +3375,15 @@ const deserializeAws_json1_1DescribeTagsOutput = (output: any, context: __SerdeC const deserializeAws_json1_1DetailsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [DetailsAttributes | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [DetailsAttributes | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -3372,7 +3430,14 @@ const deserializeAws_json1_1Evaluation = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Evaluations = (output: any, context: __SerdeContext): Evaluation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Evaluation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Evaluation(entry, context); + }); }; const deserializeAws_json1_1GetBatchPredictionOutput = ( @@ -3671,7 +3736,14 @@ const deserializeAws_json1_1MLModel = (output: any, context: __SerdeContext): ML }; const deserializeAws_json1_1MLModels = (output: any, context: __SerdeContext): MLModel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MLModel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MLModel(entry, context); + }); }; const deserializeAws_json1_1PerformanceMetrics = (output: any, context: __SerdeContext): PerformanceMetrics => { @@ -3687,13 +3759,15 @@ const deserializeAws_json1_1PerformanceMetricsProperties = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Prediction = (output: any, context: __SerdeContext): Prediction => { @@ -3811,13 +3885,15 @@ const deserializeAws_json1_1ScoreValuePerLabelMap = ( output: any, context: __SerdeContext ): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -3837,17 +3913,26 @@ const deserializeAws_json1_1TagLimitExceededException = ( }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TrainingParameters = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1UpdateBatchPredictionOutput = ( @@ -3930,3 +4015,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-macie/protocols/Aws_json1_1.ts b/clients/client-macie/protocols/Aws_json1_1.ts index 6d12e5e89b84..557c8d34fa3d 100644 --- a/clients/client-macie/protocols/Aws_json1_1.ts +++ b/clients/client-macie/protocols/Aws_json1_1.ts @@ -57,7 +57,7 @@ export const serializeAws_json1_1AssociateMemberAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MacieService.AssociateMemberAccount", }; let body: any; @@ -70,7 +70,7 @@ export const serializeAws_json1_1AssociateS3ResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MacieService.AssociateS3Resources", }; let body: any; @@ -83,7 +83,7 @@ export const serializeAws_json1_1DisassociateMemberAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MacieService.DisassociateMemberAccount", }; let body: any; @@ -96,7 +96,7 @@ export const serializeAws_json1_1DisassociateS3ResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MacieService.DisassociateS3Resources", }; let body: any; @@ -109,7 +109,7 @@ export const serializeAws_json1_1ListMemberAccountsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MacieService.ListMemberAccounts", }; let body: any; @@ -122,7 +122,7 @@ export const serializeAws_json1_1ListS3ResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MacieService.ListS3Resources", }; let body: any; @@ -135,7 +135,7 @@ export const serializeAws_json1_1UpdateS3ResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MacieService.UpdateS3Resources", }; let body: any; @@ -167,8 +167,7 @@ const deserializeAws_json1_1AssociateMemberAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.macie#InternalException": @@ -238,8 +237,7 @@ const deserializeAws_json1_1AssociateS3ResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.macie#AccessDeniedException": @@ -314,8 +312,7 @@ const deserializeAws_json1_1DisassociateMemberAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.macie#InternalException": @@ -377,8 +374,7 @@ const deserializeAws_json1_1DisassociateS3ResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.macie#AccessDeniedException": @@ -448,8 +444,7 @@ const deserializeAws_json1_1ListMemberAccountsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalException": case "com.amazonaws.macie#InternalException": @@ -511,8 +506,7 @@ const deserializeAws_json1_1ListS3ResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.macie#AccessDeniedException": @@ -582,8 +576,7 @@ const deserializeAws_json1_1UpdateS3ResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.macie#AccessDeniedException": @@ -691,7 +684,8 @@ const serializeAws_json1_1AssociateMemberAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.memberAccountId !== undefined && { memberAccountId: input.memberAccountId }), + ...(input.memberAccountId !== undefined && + input.memberAccountId !== null && { memberAccountId: input.memberAccountId }), }; }; @@ -700,17 +694,19 @@ const serializeAws_json1_1AssociateS3ResourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.memberAccountId !== undefined && { memberAccountId: input.memberAccountId }), - ...(input.s3Resources !== undefined && { - s3Resources: serializeAws_json1_1S3ResourcesClassification(input.s3Resources, context), - }), + ...(input.memberAccountId !== undefined && + input.memberAccountId !== null && { memberAccountId: input.memberAccountId }), + ...(input.s3Resources !== undefined && + input.s3Resources !== null && { + s3Resources: serializeAws_json1_1S3ResourcesClassification(input.s3Resources, context), + }), }; }; const serializeAws_json1_1ClassificationType = (input: ClassificationType, context: __SerdeContext): any => { return { - ...(input.continuous !== undefined && { continuous: input.continuous }), - ...(input.oneTime !== undefined && { oneTime: input.oneTime }), + ...(input.continuous !== undefined && input.continuous !== null && { continuous: input.continuous }), + ...(input.oneTime !== undefined && input.oneTime !== null && { oneTime: input.oneTime }), }; }; @@ -719,8 +715,8 @@ const serializeAws_json1_1ClassificationTypeUpdate = ( context: __SerdeContext ): any => { return { - ...(input.continuous !== undefined && { continuous: input.continuous }), - ...(input.oneTime !== undefined && { oneTime: input.oneTime }), + ...(input.continuous !== undefined && input.continuous !== null && { continuous: input.continuous }), + ...(input.oneTime !== undefined && input.oneTime !== null && { oneTime: input.oneTime }), }; }; @@ -729,7 +725,8 @@ const serializeAws_json1_1DisassociateMemberAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.memberAccountId !== undefined && { memberAccountId: input.memberAccountId }), + ...(input.memberAccountId !== undefined && + input.memberAccountId !== null && { memberAccountId: input.memberAccountId }), }; }; @@ -738,10 +735,12 @@ const serializeAws_json1_1DisassociateS3ResourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.associatedS3Resources !== undefined && { - associatedS3Resources: serializeAws_json1_1S3Resources(input.associatedS3Resources, context), - }), - ...(input.memberAccountId !== undefined && { memberAccountId: input.memberAccountId }), + ...(input.associatedS3Resources !== undefined && + input.associatedS3Resources !== null && { + associatedS3Resources: serializeAws_json1_1S3Resources(input.associatedS3Resources, context), + }), + ...(input.memberAccountId !== undefined && + input.memberAccountId !== null && { memberAccountId: input.memberAccountId }), }; }; @@ -750,23 +749,24 @@ const serializeAws_json1_1ListMemberAccountsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListS3ResourcesRequest = (input: ListS3ResourcesRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.memberAccountId !== undefined && { memberAccountId: input.memberAccountId }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.memberAccountId !== undefined && + input.memberAccountId !== null && { memberAccountId: input.memberAccountId }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1S3Resource = (input: S3Resource, context: __SerdeContext): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.prefix !== undefined && { prefix: input.prefix }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }), }; }; @@ -775,11 +775,12 @@ const serializeAws_json1_1S3ResourceClassification = ( context: __SerdeContext ): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.classificationType !== undefined && { - classificationType: serializeAws_json1_1ClassificationType(input.classificationType, context), - }), - ...(input.prefix !== undefined && { prefix: input.prefix }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.classificationType !== undefined && + input.classificationType !== null && { + classificationType: serializeAws_json1_1ClassificationType(input.classificationType, context), + }), + ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }), }; }; @@ -788,30 +789,52 @@ const serializeAws_json1_1S3ResourceClassificationUpdate = ( context: __SerdeContext ): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.classificationTypeUpdate !== undefined && { - classificationTypeUpdate: serializeAws_json1_1ClassificationTypeUpdate(input.classificationTypeUpdate, context), - }), - ...(input.prefix !== undefined && { prefix: input.prefix }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.classificationTypeUpdate !== undefined && + input.classificationTypeUpdate !== null && { + classificationTypeUpdate: serializeAws_json1_1ClassificationTypeUpdate(input.classificationTypeUpdate, context), + }), + ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }), }; }; const serializeAws_json1_1S3Resources = (input: S3Resource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1S3Resource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1S3Resource(entry, context); + }); }; const serializeAws_json1_1S3ResourcesClassification = ( input: S3ResourceClassification[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1S3ResourceClassification(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1S3ResourceClassification(entry, context); + }); }; const serializeAws_json1_1S3ResourcesClassificationUpdate = ( input: S3ResourceClassificationUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1S3ResourceClassificationUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1S3ResourceClassificationUpdate(entry, context); + }); }; const serializeAws_json1_1UpdateS3ResourcesRequest = ( @@ -819,10 +842,12 @@ const serializeAws_json1_1UpdateS3ResourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.memberAccountId !== undefined && { memberAccountId: input.memberAccountId }), - ...(input.s3ResourcesUpdate !== undefined && { - s3ResourcesUpdate: serializeAws_json1_1S3ResourcesClassificationUpdate(input.s3ResourcesUpdate, context), - }), + ...(input.memberAccountId !== undefined && + input.memberAccountId !== null && { memberAccountId: input.memberAccountId }), + ...(input.s3ResourcesUpdate !== undefined && + input.s3ResourcesUpdate !== null && { + s3ResourcesUpdate: serializeAws_json1_1S3ResourcesClassificationUpdate(input.s3ResourcesUpdate, context), + }), }; }; @@ -876,7 +901,14 @@ const deserializeAws_json1_1FailedS3Resource = (output: any, context: __SerdeCon }; const deserializeAws_json1_1FailedS3Resources = (output: any, context: __SerdeContext): FailedS3Resource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedS3Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedS3Resource(entry, context); + }); }; const deserializeAws_json1_1InternalException = (output: any, context: __SerdeContext): InternalException => { @@ -932,7 +964,14 @@ const deserializeAws_json1_1MemberAccount = (output: any, context: __SerdeContex }; const deserializeAws_json1_1MemberAccounts = (output: any, context: __SerdeContext): MemberAccount[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MemberAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MemberAccount(entry, context); + }); }; const deserializeAws_json1_1S3Resource = (output: any, context: __SerdeContext): S3Resource => { @@ -960,7 +999,14 @@ const deserializeAws_json1_1S3ResourcesClassification = ( output: any, context: __SerdeContext ): S3ResourceClassification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1S3ResourceClassification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1S3ResourceClassification(entry, context); + }); }; const deserializeAws_json1_1UpdateS3ResourcesResult = ( @@ -1025,3 +1071,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-macie2/protocols/Aws_restJson1.ts b/clients/client-macie2/protocols/Aws_restJson1.ts index 07bfe7f5d8b4..dd922d0413e6 100644 --- a/clients/client-macie2/protocols/Aws_restJson1.ts +++ b/clients/client-macie2/protocols/Aws_restJson1.ts @@ -258,13 +258,13 @@ export const serializeAws_restJson1AcceptInvitationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitations/accept"; let body: any; body = JSON.stringify({ - ...(input.invitationId !== undefined && { invitationId: input.invitationId }), - ...(input.masterAccount !== undefined && { masterAccount: input.masterAccount }), + ...(input.invitationId !== undefined && input.invitationId !== null && { invitationId: input.invitationId }), + ...(input.masterAccount !== undefined && input.masterAccount !== null && { masterAccount: input.masterAccount }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -283,12 +283,13 @@ export const serializeAws_restJson1BatchGetCustomDataIdentifiersCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/custom-data-identifiers/get"; let body: any; body = JSON.stringify({ - ...(input.ids !== undefined && { ids: serializeAws_restJson1__listOf__string(input.ids, context) }), + ...(input.ids !== undefined && + input.ids !== null && { ids: serializeAws_restJson1__listOf__string(input.ids, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -307,27 +308,31 @@ export const serializeAws_restJson1CreateClassificationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/jobs"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.customDataIdentifierIds !== undefined && { - customDataIdentifierIds: serializeAws_restJson1__listOf__string(input.customDataIdentifierIds, context), - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.initialRun !== undefined && { initialRun: input.initialRun }), - ...(input.jobType !== undefined && { jobType: input.jobType }), - ...(input.name !== undefined && { name: input.name }), - ...(input.s3JobDefinition !== undefined && { - s3JobDefinition: serializeAws_restJson1S3JobDefinition(input.s3JobDefinition, context), - }), - ...(input.samplingPercentage !== undefined && { samplingPercentage: input.samplingPercentage }), - ...(input.scheduleFrequency !== undefined && { - scheduleFrequency: serializeAws_restJson1JobScheduleFrequency(input.scheduleFrequency, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.customDataIdentifierIds !== undefined && + input.customDataIdentifierIds !== null && { + customDataIdentifierIds: serializeAws_restJson1__listOf__string(input.customDataIdentifierIds, context), + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.initialRun !== undefined && input.initialRun !== null && { initialRun: input.initialRun }), + ...(input.jobType !== undefined && input.jobType !== null && { jobType: input.jobType }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.s3JobDefinition !== undefined && + input.s3JobDefinition !== null && { + s3JobDefinition: serializeAws_restJson1S3JobDefinition(input.s3JobDefinition, context), + }), + ...(input.samplingPercentage !== undefined && + input.samplingPercentage !== null && { samplingPercentage: input.samplingPercentage }), + ...(input.scheduleFrequency !== undefined && + input.scheduleFrequency !== null && { + scheduleFrequency: serializeAws_restJson1JobScheduleFrequency(input.scheduleFrequency, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -346,21 +351,24 @@ export const serializeAws_restJson1CreateCustomDataIdentifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/custom-data-identifiers"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.ignoreWords !== undefined && { - ignoreWords: serializeAws_restJson1__listOf__string(input.ignoreWords, context), - }), - ...(input.keywords !== undefined && { keywords: serializeAws_restJson1__listOf__string(input.keywords, context) }), - ...(input.maximumMatchDistance !== undefined && { maximumMatchDistance: input.maximumMatchDistance }), - ...(input.name !== undefined && { name: input.name }), - ...(input.regex !== undefined && { regex: input.regex }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.ignoreWords !== undefined && + input.ignoreWords !== null && { + ignoreWords: serializeAws_restJson1__listOf__string(input.ignoreWords, context), + }), + ...(input.keywords !== undefined && + input.keywords !== null && { keywords: serializeAws_restJson1__listOf__string(input.keywords, context) }), + ...(input.maximumMatchDistance !== undefined && + input.maximumMatchDistance !== null && { maximumMatchDistance: input.maximumMatchDistance }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.regex !== undefined && input.regex !== null && { regex: input.regex }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -379,20 +387,21 @@ export const serializeAws_restJson1CreateFindingsFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findingsfilters"; let body: any; body = JSON.stringify({ - ...(input.action !== undefined && { action: input.action }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.findingCriteria !== undefined && { - findingCriteria: serializeAws_restJson1FindingCriteria(input.findingCriteria, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.position !== undefined && { position: input.position }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.findingCriteria !== undefined && + input.findingCriteria !== null && { + findingCriteria: serializeAws_restJson1FindingCriteria(input.findingCriteria, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.position !== undefined && input.position !== null && { position: input.position }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -411,16 +420,16 @@ export const serializeAws_restJson1CreateInvitationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitations"; let body: any; body = JSON.stringify({ - ...(input.accountIds !== undefined && { - accountIds: serializeAws_restJson1__listOf__string(input.accountIds, context), - }), - ...(input.disableEmailNotification !== undefined && { disableEmailNotification: input.disableEmailNotification }), - ...(input.message !== undefined && { message: input.message }), + ...(input.accountIds !== undefined && + input.accountIds !== null && { accountIds: serializeAws_restJson1__listOf__string(input.accountIds, context) }), + ...(input.disableEmailNotification !== undefined && + input.disableEmailNotification !== null && { disableEmailNotification: input.disableEmailNotification }), + ...(input.message !== undefined && input.message !== null && { message: input.message }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -439,13 +448,14 @@ export const serializeAws_restJson1CreateMemberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/members"; let body: any; body = JSON.stringify({ - ...(input.account !== undefined && { account: serializeAws_restJson1AccountDetail(input.account, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.account !== undefined && + input.account !== null && { account: serializeAws_restJson1AccountDetail(input.account, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -464,14 +474,15 @@ export const serializeAws_restJson1CreateSampleFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findings/sample"; let body: any; body = JSON.stringify({ - ...(input.findingTypes !== undefined && { - findingTypes: serializeAws_restJson1__listOfFindingType(input.findingTypes, context), - }), + ...(input.findingTypes !== undefined && + input.findingTypes !== null && { + findingTypes: serializeAws_restJson1__listOfFindingType(input.findingTypes, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -490,14 +501,13 @@ export const serializeAws_restJson1DeclineInvitationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitations/decline"; let body: any; body = JSON.stringify({ - ...(input.accountIds !== undefined && { - accountIds: serializeAws_restJson1__listOf__string(input.accountIds, context), - }), + ...(input.accountIds !== undefined && + input.accountIds !== null && { accountIds: serializeAws_restJson1__listOf__string(input.accountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -515,9 +525,7 @@ export const serializeAws_restJson1DeleteCustomDataIdentifierCommand = async ( input: DeleteCustomDataIdentifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/custom-data-identifiers/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -545,9 +553,7 @@ export const serializeAws_restJson1DeleteFindingsFilterCommand = async ( input: DeleteFindingsFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/findingsfilters/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -576,14 +582,13 @@ export const serializeAws_restJson1DeleteInvitationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitations/delete"; let body: any; body = JSON.stringify({ - ...(input.accountIds !== undefined && { - accountIds: serializeAws_restJson1__listOf__string(input.accountIds, context), - }), + ...(input.accountIds !== undefined && + input.accountIds !== null && { accountIds: serializeAws_restJson1__listOf__string(input.accountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -601,9 +606,7 @@ export const serializeAws_restJson1DeleteMemberCommand = async ( input: DeleteMemberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/members/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -632,17 +635,19 @@ export const serializeAws_restJson1DescribeBucketsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/datasources/s3"; let body: any; body = JSON.stringify({ - ...(input.criteria !== undefined && { criteria: serializeAws_restJson1BucketCriteria(input.criteria, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortCriteria !== undefined && { - sortCriteria: serializeAws_restJson1BucketSortCriteria(input.sortCriteria, context), - }), + ...(input.criteria !== undefined && + input.criteria !== null && { criteria: serializeAws_restJson1BucketCriteria(input.criteria, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortCriteria !== undefined && + input.sortCriteria !== null && { + sortCriteria: serializeAws_restJson1BucketSortCriteria(input.sortCriteria, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -660,9 +665,7 @@ export const serializeAws_restJson1DescribeClassificationJobCommand = async ( input: DescribeClassificationJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/jobs/{jobId}"; if (input.jobId !== undefined) { const labelValue: string = input.jobId; @@ -690,12 +693,10 @@ export const serializeAws_restJson1DescribeOrganizationConfigurationCommand = as input: DescribeOrganizationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/admin/configuration"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -712,12 +713,10 @@ export const serializeAws_restJson1DisableMacieCommand = async ( input: DisableMacieCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/macie"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -734,9 +733,7 @@ export const serializeAws_restJson1DisableOrganizationAdminAccountCommand = asyn input: DisableOrganizationAdminAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/admin"; const query: any = { ...(input.adminAccountId !== undefined && { adminAccountId: input.adminAccountId }), @@ -759,12 +756,10 @@ export const serializeAws_restJson1DisassociateFromMasterAccountCommand = async input: DisassociateFromMasterAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/master/disassociate"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -781,9 +776,7 @@ export const serializeAws_restJson1DisassociateMemberCommand = async ( input: DisassociateMemberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/members/disassociate/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -812,16 +805,15 @@ export const serializeAws_restJson1EnableMacieCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/macie"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.findingPublishingFrequency !== undefined && { - findingPublishingFrequency: input.findingPublishingFrequency, - }), - ...(input.status !== undefined && { status: input.status }), + ...(input.findingPublishingFrequency !== undefined && + input.findingPublishingFrequency !== null && { findingPublishingFrequency: input.findingPublishingFrequency }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -840,12 +832,13 @@ export const serializeAws_restJson1EnableOrganizationAdminAccountCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/admin"; let body: any; body = JSON.stringify({ - ...(input.adminAccountId !== undefined && { adminAccountId: input.adminAccountId }), + ...(input.adminAccountId !== undefined && + input.adminAccountId !== null && { adminAccountId: input.adminAccountId }), clientToken: input.clientToken ?? generateIdempotencyToken(), }); const { hostname, protocol = "https", port } = await context.endpoint(); @@ -865,12 +858,12 @@ export const serializeAws_restJson1GetBucketStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/datasources/s3/statistics"; let body: any; body = JSON.stringify({ - ...(input.accountId !== undefined && { accountId: input.accountId }), + ...(input.accountId !== undefined && input.accountId !== null && { accountId: input.accountId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -888,12 +881,10 @@ export const serializeAws_restJson1GetClassificationExportConfigurationCommand = input: GetClassificationExportConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/classification-export-configuration"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -910,9 +901,7 @@ export const serializeAws_restJson1GetCustomDataIdentifierCommand = async ( input: GetCustomDataIdentifierCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/custom-data-identifiers/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -941,17 +930,15 @@ export const serializeAws_restJson1GetFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findings/describe"; let body: any; body = JSON.stringify({ - ...(input.findingIds !== undefined && { - findingIds: serializeAws_restJson1__listOf__string(input.findingIds, context), - }), - ...(input.sortCriteria !== undefined && { - sortCriteria: serializeAws_restJson1SortCriteria(input.sortCriteria, context), - }), + ...(input.findingIds !== undefined && + input.findingIds !== null && { findingIds: serializeAws_restJson1__listOf__string(input.findingIds, context) }), + ...(input.sortCriteria !== undefined && + input.sortCriteria !== null && { sortCriteria: serializeAws_restJson1SortCriteria(input.sortCriteria, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -969,9 +956,7 @@ export const serializeAws_restJson1GetFindingsFilterCommand = async ( input: GetFindingsFilterCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/findingsfilters/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -1000,19 +985,21 @@ export const serializeAws_restJson1GetFindingStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findings/statistics"; let body: any; body = JSON.stringify({ - ...(input.findingCriteria !== undefined && { - findingCriteria: serializeAws_restJson1FindingCriteria(input.findingCriteria, context), - }), - ...(input.groupBy !== undefined && { groupBy: input.groupBy }), - ...(input.size !== undefined && { size: input.size }), - ...(input.sortCriteria !== undefined && { - sortCriteria: serializeAws_restJson1FindingStatisticsSortCriteria(input.sortCriteria, context), - }), + ...(input.findingCriteria !== undefined && + input.findingCriteria !== null && { + findingCriteria: serializeAws_restJson1FindingCriteria(input.findingCriteria, context), + }), + ...(input.groupBy !== undefined && input.groupBy !== null && { groupBy: input.groupBy }), + ...(input.size !== undefined && input.size !== null && { size: input.size }), + ...(input.sortCriteria !== undefined && + input.sortCriteria !== null && { + sortCriteria: serializeAws_restJson1FindingStatisticsSortCriteria(input.sortCriteria, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1030,12 +1017,10 @@ export const serializeAws_restJson1GetInvitationsCountCommand = async ( input: GetInvitationsCountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/invitations/count"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1052,12 +1037,10 @@ export const serializeAws_restJson1GetMacieSessionCommand = async ( input: GetMacieSessionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/macie"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1074,12 +1057,10 @@ export const serializeAws_restJson1GetMasterAccountCommand = async ( input: GetMasterAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/master"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1096,9 +1077,7 @@ export const serializeAws_restJson1GetMemberCommand = async ( input: GetMemberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/members/{id}"; if (input.id !== undefined) { const labelValue: string = input.id; @@ -1127,17 +1106,19 @@ export const serializeAws_restJson1GetUsageStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/usage/statistics"; let body: any; body = JSON.stringify({ - ...(input.filterBy !== undefined && { - filterBy: serializeAws_restJson1__listOfUsageStatisticsFilter(input.filterBy, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortBy !== undefined && { sortBy: serializeAws_restJson1UsageStatisticsSortBy(input.sortBy, context) }), + ...(input.filterBy !== undefined && + input.filterBy !== null && { + filterBy: serializeAws_restJson1__listOfUsageStatisticsFilter(input.filterBy, context), + }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortBy !== undefined && + input.sortBy !== null && { sortBy: serializeAws_restJson1UsageStatisticsSortBy(input.sortBy, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1155,12 +1136,10 @@ export const serializeAws_restJson1GetUsageTotalsCommand = async ( input: GetUsageTotalsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/usage"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1178,19 +1157,21 @@ export const serializeAws_restJson1ListClassificationJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/jobs/list"; let body: any; body = JSON.stringify({ - ...(input.filterCriteria !== undefined && { - filterCriteria: serializeAws_restJson1ListJobsFilterCriteria(input.filterCriteria, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortCriteria !== undefined && { - sortCriteria: serializeAws_restJson1ListJobsSortCriteria(input.sortCriteria, context), - }), + ...(input.filterCriteria !== undefined && + input.filterCriteria !== null && { + filterCriteria: serializeAws_restJson1ListJobsFilterCriteria(input.filterCriteria, context), + }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortCriteria !== undefined && + input.sortCriteria !== null && { + sortCriteria: serializeAws_restJson1ListJobsSortCriteria(input.sortCriteria, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1209,13 +1190,13 @@ export const serializeAws_restJson1ListCustomDataIdentifiersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/custom-data-identifiers/list"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1234,19 +1215,19 @@ export const serializeAws_restJson1ListFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findings"; let body: any; body = JSON.stringify({ - ...(input.findingCriteria !== undefined && { - findingCriteria: serializeAws_restJson1FindingCriteria(input.findingCriteria, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.sortCriteria !== undefined && { - sortCriteria: serializeAws_restJson1SortCriteria(input.sortCriteria, context), - }), + ...(input.findingCriteria !== undefined && + input.findingCriteria !== null && { + findingCriteria: serializeAws_restJson1FindingCriteria(input.findingCriteria, context), + }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.sortCriteria !== undefined && + input.sortCriteria !== null && { sortCriteria: serializeAws_restJson1SortCriteria(input.sortCriteria, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1264,9 +1245,7 @@ export const serializeAws_restJson1ListFindingsFiltersCommand = async ( input: ListFindingsFiltersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/findingsfilters"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -1290,9 +1269,7 @@ export const serializeAws_restJson1ListInvitationsCommand = async ( input: ListInvitationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/invitations"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -1316,9 +1293,7 @@ export const serializeAws_restJson1ListMembersCommand = async ( input: ListMembersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/members"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -1343,9 +1318,7 @@ export const serializeAws_restJson1ListOrganizationAdminAccountsCommand = async input: ListOrganizationAdminAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/admin"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -1369,9 +1342,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1400,14 +1371,15 @@ export const serializeAws_restJson1PutClassificationExportConfigurationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/classification-export-configuration"; let body: any; body = JSON.stringify({ - ...(input.configuration !== undefined && { - configuration: serializeAws_restJson1ClassificationExportConfiguration(input.configuration, context), - }), + ...(input.configuration !== undefined && + input.configuration !== null && { + configuration: serializeAws_restJson1ClassificationExportConfiguration(input.configuration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1426,7 +1398,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -1440,7 +1412,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1459,18 +1431,21 @@ export const serializeAws_restJson1TestCustomDataIdentifierCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/custom-data-identifiers/test"; let body: any; body = JSON.stringify({ - ...(input.ignoreWords !== undefined && { - ignoreWords: serializeAws_restJson1__listOf__string(input.ignoreWords, context), - }), - ...(input.keywords !== undefined && { keywords: serializeAws_restJson1__listOf__string(input.keywords, context) }), - ...(input.maximumMatchDistance !== undefined && { maximumMatchDistance: input.maximumMatchDistance }), - ...(input.regex !== undefined && { regex: input.regex }), - ...(input.sampleText !== undefined && { sampleText: input.sampleText }), + ...(input.ignoreWords !== undefined && + input.ignoreWords !== null && { + ignoreWords: serializeAws_restJson1__listOf__string(input.ignoreWords, context), + }), + ...(input.keywords !== undefined && + input.keywords !== null && { keywords: serializeAws_restJson1__listOf__string(input.keywords, context) }), + ...(input.maximumMatchDistance !== undefined && + input.maximumMatchDistance !== null && { maximumMatchDistance: input.maximumMatchDistance }), + ...(input.regex !== undefined && input.regex !== null && { regex: input.regex }), + ...(input.sampleText !== undefined && input.sampleText !== null && { sampleText: input.sampleText }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1488,9 +1463,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1523,7 +1496,7 @@ export const serializeAws_restJson1UpdateClassificationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/jobs/{jobId}"; if (input.jobId !== undefined) { @@ -1537,7 +1510,7 @@ export const serializeAws_restJson1UpdateClassificationJobCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.jobStatus !== undefined && { jobStatus: input.jobStatus }), + ...(input.jobStatus !== undefined && input.jobStatus !== null && { jobStatus: input.jobStatus }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1556,7 +1529,7 @@ export const serializeAws_restJson1UpdateFindingsFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findingsfilters/{id}"; if (input.id !== undefined) { @@ -1570,13 +1543,14 @@ export const serializeAws_restJson1UpdateFindingsFilterCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.action !== undefined && { action: input.action }), - ...(input.description !== undefined && { description: input.description }), - ...(input.findingCriteria !== undefined && { - findingCriteria: serializeAws_restJson1FindingCriteria(input.findingCriteria, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.position !== undefined && { position: input.position }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.findingCriteria !== undefined && + input.findingCriteria !== null && { + findingCriteria: serializeAws_restJson1FindingCriteria(input.findingCriteria, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.position !== undefined && input.position !== null && { position: input.position }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1595,15 +1569,14 @@ export const serializeAws_restJson1UpdateMacieSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/macie"; let body: any; body = JSON.stringify({ - ...(input.findingPublishingFrequency !== undefined && { - findingPublishingFrequency: input.findingPublishingFrequency, - }), - ...(input.status !== undefined && { status: input.status }), + ...(input.findingPublishingFrequency !== undefined && + input.findingPublishingFrequency !== null && { findingPublishingFrequency: input.findingPublishingFrequency }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1622,7 +1595,7 @@ export const serializeAws_restJson1UpdateMemberSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/macie/members/{id}"; if (input.id !== undefined) { @@ -1636,7 +1609,7 @@ export const serializeAws_restJson1UpdateMemberSessionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.status !== undefined && { status: input.status }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1655,12 +1628,12 @@ export const serializeAws_restJson1UpdateOrganizationConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/admin/configuration"; let body: any; body = JSON.stringify({ - ...(input.autoEnable !== undefined && { autoEnable: input.autoEnable }), + ...(input.autoEnable !== undefined && input.autoEnable !== null && { autoEnable: input.autoEnable }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7121,46 +7094,95 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfFindingType = (input: (FindingType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfJobScopeTerm = (input: JobScopeTerm[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1JobScopeTerm(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1JobScopeTerm(entry, context); + }); }; const serializeAws_restJson1__listOfListJobsFilterTerm = ( input: ListJobsFilterTerm[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ListJobsFilterTerm(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ListJobsFilterTerm(entry, context); + }); }; const serializeAws_restJson1__listOfS3BucketDefinitionForJob = ( input: S3BucketDefinitionForJob[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1S3BucketDefinitionForJob(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1S3BucketDefinitionForJob(entry, context); + }); }; const serializeAws_restJson1__listOfTagValuePair = (input: TagValuePair[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1TagValuePair(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TagValuePair(entry, context); + }); }; const serializeAws_restJson1__listOfUsageStatisticsFilter = ( input: UsageStatisticsFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1UsageStatisticsFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1UsageStatisticsFilter(entry, context); + }); }; const serializeAws_restJson1AccountDetail = (input: AccountDetail, context: __SerdeContext): any => { return { - ...(input.accountId !== undefined && { accountId: input.accountId }), - ...(input.email !== undefined && { email: input.email }), + ...(input.accountId !== undefined && input.accountId !== null && { accountId: input.accountId }), + ...(input.email !== undefined && input.email !== null && { email: input.email }), }; }; @@ -7169,10 +7191,15 @@ const serializeAws_restJson1BucketCriteria = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: BucketCriteriaAdditionalProperties }, [key, value]: [string, any]) => ({ - ...acc, - [key]: serializeAws_restJson1BucketCriteriaAdditionalProperties(value, context), - }), + (acc: { [key: string]: BucketCriteriaAdditionalProperties }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_restJson1BucketCriteriaAdditionalProperties(value, context), + }; + }, {} ); }; @@ -7182,20 +7209,22 @@ const serializeAws_restJson1BucketCriteriaAdditionalProperties = ( context: __SerdeContext ): any => { return { - ...(input.eq !== undefined && { eq: serializeAws_restJson1__listOf__string(input.eq, context) }), - ...(input.gt !== undefined && { gt: input.gt }), - ...(input.gte !== undefined && { gte: input.gte }), - ...(input.lt !== undefined && { lt: input.lt }), - ...(input.lte !== undefined && { lte: input.lte }), - ...(input.neq !== undefined && { neq: serializeAws_restJson1__listOf__string(input.neq, context) }), - ...(input.prefix !== undefined && { prefix: input.prefix }), + ...(input.eq !== undefined && + input.eq !== null && { eq: serializeAws_restJson1__listOf__string(input.eq, context) }), + ...(input.gt !== undefined && input.gt !== null && { gt: input.gt }), + ...(input.gte !== undefined && input.gte !== null && { gte: input.gte }), + ...(input.lt !== undefined && input.lt !== null && { lt: input.lt }), + ...(input.lte !== undefined && input.lte !== null && { lte: input.lte }), + ...(input.neq !== undefined && + input.neq !== null && { neq: serializeAws_restJson1__listOf__string(input.neq, context) }), + ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }), }; }; const serializeAws_restJson1BucketSortCriteria = (input: BucketSortCriteria, context: __SerdeContext): any => { return { - ...(input.attributeName !== undefined && { attributeName: input.attributeName }), - ...(input.orderBy !== undefined && { orderBy: input.orderBy }), + ...(input.attributeName !== undefined && input.attributeName !== null && { attributeName: input.attributeName }), + ...(input.orderBy !== undefined && input.orderBy !== null && { orderBy: input.orderBy }), }; }; @@ -7204,9 +7233,10 @@ const serializeAws_restJson1ClassificationExportConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.s3Destination !== undefined && { - s3Destination: serializeAws_restJson1S3Destination(input.s3Destination, context), - }), + ...(input.s3Destination !== undefined && + input.s3Destination !== null && { + s3Destination: serializeAws_restJson1S3Destination(input.s3Destination, context), + }), }; }; @@ -7215,10 +7245,15 @@ const serializeAws_restJson1Criterion = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: CriterionAdditionalProperties }, [key, value]: [string, any]) => ({ - ...acc, - [key]: serializeAws_restJson1CriterionAdditionalProperties(value, context), - }), + (acc: { [key: string]: CriterionAdditionalProperties }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_restJson1CriterionAdditionalProperties(value, context), + }; + }, {} ); }; @@ -7228,15 +7263,18 @@ const serializeAws_restJson1CriterionAdditionalProperties = ( context: __SerdeContext ): any => { return { - ...(input.eq !== undefined && { eq: serializeAws_restJson1__listOf__string(input.eq, context) }), - ...(input.eqExactMatch !== undefined && { - eqExactMatch: serializeAws_restJson1__listOf__string(input.eqExactMatch, context), - }), - ...(input.gt !== undefined && { gt: input.gt }), - ...(input.gte !== undefined && { gte: input.gte }), - ...(input.lt !== undefined && { lt: input.lt }), - ...(input.lte !== undefined && { lte: input.lte }), - ...(input.neq !== undefined && { neq: serializeAws_restJson1__listOf__string(input.neq, context) }), + ...(input.eq !== undefined && + input.eq !== null && { eq: serializeAws_restJson1__listOf__string(input.eq, context) }), + ...(input.eqExactMatch !== undefined && + input.eqExactMatch !== null && { + eqExactMatch: serializeAws_restJson1__listOf__string(input.eqExactMatch, context), + }), + ...(input.gt !== undefined && input.gt !== null && { gt: input.gt }), + ...(input.gte !== undefined && input.gte !== null && { gte: input.gte }), + ...(input.lt !== undefined && input.lt !== null && { lt: input.lt }), + ...(input.lte !== undefined && input.lte !== null && { lte: input.lte }), + ...(input.neq !== undefined && + input.neq !== null && { neq: serializeAws_restJson1__listOf__string(input.neq, context) }), }; }; @@ -7246,7 +7284,8 @@ const serializeAws_restJson1DailySchedule = (input: DailySchedule, context: __Se const serializeAws_restJson1FindingCriteria = (input: FindingCriteria, context: __SerdeContext): any => { return { - ...(input.criterion !== undefined && { criterion: serializeAws_restJson1Criterion(input.criterion, context) }), + ...(input.criterion !== undefined && + input.criterion !== null && { criterion: serializeAws_restJson1Criterion(input.criterion, context) }), }; }; @@ -7255,71 +7294,78 @@ const serializeAws_restJson1FindingStatisticsSortCriteria = ( context: __SerdeContext ): any => { return { - ...(input.attributeName !== undefined && { attributeName: input.attributeName }), - ...(input.orderBy !== undefined && { orderBy: input.orderBy }), + ...(input.attributeName !== undefined && input.attributeName !== null && { attributeName: input.attributeName }), + ...(input.orderBy !== undefined && input.orderBy !== null && { orderBy: input.orderBy }), }; }; const serializeAws_restJson1JobScheduleFrequency = (input: JobScheduleFrequency, context: __SerdeContext): any => { return { - ...(input.dailySchedule !== undefined && { - dailySchedule: serializeAws_restJson1DailySchedule(input.dailySchedule, context), - }), - ...(input.monthlySchedule !== undefined && { - monthlySchedule: serializeAws_restJson1MonthlySchedule(input.monthlySchedule, context), - }), - ...(input.weeklySchedule !== undefined && { - weeklySchedule: serializeAws_restJson1WeeklySchedule(input.weeklySchedule, context), - }), + ...(input.dailySchedule !== undefined && + input.dailySchedule !== null && { + dailySchedule: serializeAws_restJson1DailySchedule(input.dailySchedule, context), + }), + ...(input.monthlySchedule !== undefined && + input.monthlySchedule !== null && { + monthlySchedule: serializeAws_restJson1MonthlySchedule(input.monthlySchedule, context), + }), + ...(input.weeklySchedule !== undefined && + input.weeklySchedule !== null && { + weeklySchedule: serializeAws_restJson1WeeklySchedule(input.weeklySchedule, context), + }), }; }; const serializeAws_restJson1JobScopeTerm = (input: JobScopeTerm, context: __SerdeContext): any => { return { - ...(input.simpleScopeTerm !== undefined && { - simpleScopeTerm: serializeAws_restJson1SimpleScopeTerm(input.simpleScopeTerm, context), - }), - ...(input.tagScopeTerm !== undefined && { - tagScopeTerm: serializeAws_restJson1TagScopeTerm(input.tagScopeTerm, context), - }), + ...(input.simpleScopeTerm !== undefined && + input.simpleScopeTerm !== null && { + simpleScopeTerm: serializeAws_restJson1SimpleScopeTerm(input.simpleScopeTerm, context), + }), + ...(input.tagScopeTerm !== undefined && + input.tagScopeTerm !== null && { tagScopeTerm: serializeAws_restJson1TagScopeTerm(input.tagScopeTerm, context) }), }; }; const serializeAws_restJson1JobScopingBlock = (input: JobScopingBlock, context: __SerdeContext): any => { return { - ...(input.and !== undefined && { and: serializeAws_restJson1__listOfJobScopeTerm(input.and, context) }), + ...(input.and !== undefined && + input.and !== null && { and: serializeAws_restJson1__listOfJobScopeTerm(input.and, context) }), }; }; const serializeAws_restJson1ListJobsFilterCriteria = (input: ListJobsFilterCriteria, context: __SerdeContext): any => { return { - ...(input.excludes !== undefined && { - excludes: serializeAws_restJson1__listOfListJobsFilterTerm(input.excludes, context), - }), - ...(input.includes !== undefined && { - includes: serializeAws_restJson1__listOfListJobsFilterTerm(input.includes, context), - }), + ...(input.excludes !== undefined && + input.excludes !== null && { + excludes: serializeAws_restJson1__listOfListJobsFilterTerm(input.excludes, context), + }), + ...(input.includes !== undefined && + input.includes !== null && { + includes: serializeAws_restJson1__listOfListJobsFilterTerm(input.includes, context), + }), }; }; const serializeAws_restJson1ListJobsFilterTerm = (input: ListJobsFilterTerm, context: __SerdeContext): any => { return { - ...(input.comparator !== undefined && { comparator: input.comparator }), - ...(input.key !== undefined && { key: input.key }), - ...(input.values !== undefined && { values: serializeAws_restJson1__listOf__string(input.values, context) }), + ...(input.comparator !== undefined && input.comparator !== null && { comparator: input.comparator }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1__listOf__string(input.values, context) }), }; }; const serializeAws_restJson1ListJobsSortCriteria = (input: ListJobsSortCriteria, context: __SerdeContext): any => { return { - ...(input.attributeName !== undefined && { attributeName: input.attributeName }), - ...(input.orderBy !== undefined && { orderBy: input.orderBy }), + ...(input.attributeName !== undefined && input.attributeName !== null && { attributeName: input.attributeName }), + ...(input.orderBy !== undefined && input.orderBy !== null && { orderBy: input.orderBy }), }; }; const serializeAws_restJson1MonthlySchedule = (input: MonthlySchedule, context: __SerdeContext): any => { return { - ...(input.dayOfMonth !== undefined && { dayOfMonth: input.dayOfMonth }), + ...(input.dayOfMonth !== undefined && input.dayOfMonth !== null && { dayOfMonth: input.dayOfMonth }), }; }; @@ -7328,190 +7374,329 @@ const serializeAws_restJson1S3BucketDefinitionForJob = ( context: __SerdeContext ): any => { return { - ...(input.accountId !== undefined && { accountId: input.accountId }), - ...(input.buckets !== undefined && { buckets: serializeAws_restJson1__listOf__string(input.buckets, context) }), + ...(input.accountId !== undefined && input.accountId !== null && { accountId: input.accountId }), + ...(input.buckets !== undefined && + input.buckets !== null && { buckets: serializeAws_restJson1__listOf__string(input.buckets, context) }), }; }; const serializeAws_restJson1S3Destination = (input: S3Destination, context: __SerdeContext): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.keyPrefix !== undefined && { keyPrefix: input.keyPrefix }), - ...(input.kmsKeyArn !== undefined && { kmsKeyArn: input.kmsKeyArn }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.keyPrefix !== undefined && input.keyPrefix !== null && { keyPrefix: input.keyPrefix }), + ...(input.kmsKeyArn !== undefined && input.kmsKeyArn !== null && { kmsKeyArn: input.kmsKeyArn }), }; }; const serializeAws_restJson1S3JobDefinition = (input: S3JobDefinition, context: __SerdeContext): any => { return { - ...(input.bucketDefinitions !== undefined && { - bucketDefinitions: serializeAws_restJson1__listOfS3BucketDefinitionForJob(input.bucketDefinitions, context), - }), - ...(input.scoping !== undefined && { scoping: serializeAws_restJson1Scoping(input.scoping, context) }), + ...(input.bucketDefinitions !== undefined && + input.bucketDefinitions !== null && { + bucketDefinitions: serializeAws_restJson1__listOfS3BucketDefinitionForJob(input.bucketDefinitions, context), + }), + ...(input.scoping !== undefined && + input.scoping !== null && { scoping: serializeAws_restJson1Scoping(input.scoping, context) }), }; }; const serializeAws_restJson1Scoping = (input: Scoping, context: __SerdeContext): any => { return { - ...(input.excludes !== undefined && { excludes: serializeAws_restJson1JobScopingBlock(input.excludes, context) }), - ...(input.includes !== undefined && { includes: serializeAws_restJson1JobScopingBlock(input.includes, context) }), + ...(input.excludes !== undefined && + input.excludes !== null && { excludes: serializeAws_restJson1JobScopingBlock(input.excludes, context) }), + ...(input.includes !== undefined && + input.includes !== null && { includes: serializeAws_restJson1JobScopingBlock(input.includes, context) }), }; }; const serializeAws_restJson1SimpleScopeTerm = (input: SimpleScopeTerm, context: __SerdeContext): any => { return { - ...(input.comparator !== undefined && { comparator: input.comparator }), - ...(input.key !== undefined && { key: input.key }), - ...(input.values !== undefined && { values: serializeAws_restJson1__listOf__string(input.values, context) }), + ...(input.comparator !== undefined && input.comparator !== null && { comparator: input.comparator }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1__listOf__string(input.values, context) }), }; }; const serializeAws_restJson1SortCriteria = (input: SortCriteria, context: __SerdeContext): any => { return { - ...(input.attributeName !== undefined && { attributeName: input.attributeName }), - ...(input.orderBy !== undefined && { orderBy: input.orderBy }), + ...(input.attributeName !== undefined && input.attributeName !== null && { attributeName: input.attributeName }), + ...(input.orderBy !== undefined && input.orderBy !== null && { orderBy: input.orderBy }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TagScopeTerm = (input: TagScopeTerm, context: __SerdeContext): any => { return { - ...(input.comparator !== undefined && { comparator: input.comparator }), - ...(input.key !== undefined && { key: input.key }), - ...(input.tagValues !== undefined && { - tagValues: serializeAws_restJson1__listOfTagValuePair(input.tagValues, context), - }), - ...(input.target !== undefined && { target: input.target }), + ...(input.comparator !== undefined && input.comparator !== null && { comparator: input.comparator }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.tagValues !== undefined && + input.tagValues !== null && { tagValues: serializeAws_restJson1__listOfTagValuePair(input.tagValues, context) }), + ...(input.target !== undefined && input.target !== null && { target: input.target }), }; }; const serializeAws_restJson1TagValuePair = (input: TagValuePair, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1UsageStatisticsFilter = (input: UsageStatisticsFilter, context: __SerdeContext): any => { return { - ...(input.comparator !== undefined && { comparator: input.comparator }), - ...(input.key !== undefined && { key: input.key }), - ...(input.values !== undefined && { values: serializeAws_restJson1__listOf__string(input.values, context) }), + ...(input.comparator !== undefined && input.comparator !== null && { comparator: input.comparator }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1__listOf__string(input.values, context) }), }; }; const serializeAws_restJson1UsageStatisticsSortBy = (input: UsageStatisticsSortBy, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.orderBy !== undefined && { orderBy: input.orderBy }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.orderBy !== undefined && input.orderBy !== null && { orderBy: input.orderBy }), }; }; const serializeAws_restJson1WeeklySchedule = (input: WeeklySchedule, context: __SerdeContext): any => { return { - ...(input.dayOfWeek !== undefined && { dayOfWeek: input.dayOfWeek }), + ...(input.dayOfWeek !== undefined && input.dayOfWeek !== null && { dayOfWeek: input.dayOfWeek }), }; }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfAdminAccount = (output: any, context: __SerdeContext): AdminAccount[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AdminAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AdminAccount(entry, context); + }); }; const deserializeAws_restJson1__listOfBatchGetCustomDataIdentifierSummary = ( output: any, context: __SerdeContext ): BatchGetCustomDataIdentifierSummary[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1BatchGetCustomDataIdentifierSummary(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchGetCustomDataIdentifierSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfBucketMetadata = (output: any, context: __SerdeContext): BucketMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BucketMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BucketMetadata(entry, context); + }); }; const deserializeAws_restJson1__listOfCustomDataIdentifierSummary = ( output: any, context: __SerdeContext ): CustomDataIdentifierSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CustomDataIdentifierSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CustomDataIdentifierSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfFinding = (output: any, context: __SerdeContext): Finding[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Finding(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Finding(entry, context); + }); }; const deserializeAws_restJson1__listOfFindingsFilterListItem = ( output: any, context: __SerdeContext ): FindingsFilterListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FindingsFilterListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FindingsFilterListItem(entry, context); + }); }; const deserializeAws_restJson1__listOfGroupCount = (output: any, context: __SerdeContext): GroupCount[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupCount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupCount(entry, context); + }); }; const deserializeAws_restJson1__listOfInvitation = (output: any, context: __SerdeContext): Invitation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Invitation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Invitation(entry, context); + }); }; const deserializeAws_restJson1__listOfJobScopeTerm = (output: any, context: __SerdeContext): JobScopeTerm[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobScopeTerm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobScopeTerm(entry, context); + }); }; const deserializeAws_restJson1__listOfJobSummary = (output: any, context: __SerdeContext): JobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfKeyValuePair = (output: any, context: __SerdeContext): KeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1KeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1KeyValuePair(entry, context); + }); }; const deserializeAws_restJson1__listOfMember = (output: any, context: __SerdeContext): Member[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Member(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Member(entry, context); + }); }; const deserializeAws_restJson1__listOfS3BucketDefinitionForJob = ( output: any, context: __SerdeContext ): S3BucketDefinitionForJob[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1S3BucketDefinitionForJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1S3BucketDefinitionForJob(entry, context); + }); }; const deserializeAws_restJson1__listOfTagValuePair = (output: any, context: __SerdeContext): TagValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TagValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TagValuePair(entry, context); + }); }; const deserializeAws_restJson1__listOfUnprocessedAccount = ( output: any, context: __SerdeContext ): UnprocessedAccount[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UnprocessedAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UnprocessedAccount(entry, context); + }); }; const deserializeAws_restJson1__listOfUsageByAccount = (output: any, context: __SerdeContext): UsageByAccount[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UsageByAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UsageByAccount(entry, context); + }); }; const deserializeAws_restJson1__listOfUsageRecord = (output: any, context: __SerdeContext): UsageRecord[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UsageRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UsageRecord(entry, context); + }); }; const deserializeAws_restJson1__listOfUsageTotal = (output: any, context: __SerdeContext): UsageTotal[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UsageTotal(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UsageTotal(entry, context); + }); }; const deserializeAws_restJson1AccessControlList = (output: any, context: __SerdeContext): AccessControlList => { @@ -7785,7 +7970,14 @@ const deserializeAws_restJson1Cell = (output: any, context: __SerdeContext): Cel }; const deserializeAws_restJson1Cells = (output: any, context: __SerdeContext): Cell[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Cell(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Cell(entry, context); + }); }; const deserializeAws_restJson1ClassificationDetails = (output: any, context: __SerdeContext): ClassificationDetails => { @@ -7854,10 +8046,15 @@ const deserializeAws_restJson1Criterion = ( context: __SerdeContext ): { [key: string]: CriterionAdditionalProperties } => { return Object.entries(output).reduce( - (acc: { [key: string]: CriterionAdditionalProperties }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1CriterionAdditionalProperties(value, context), - }), + (acc: { [key: string]: CriterionAdditionalProperties }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1CriterionAdditionalProperties(value, context), + }; + }, {} ); }; @@ -7922,7 +8119,14 @@ const deserializeAws_restJson1CustomDetection = (output: any, context: __SerdeCo }; const deserializeAws_restJson1CustomDetections = (output: any, context: __SerdeContext): CustomDetection[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CustomDetection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CustomDetection(entry, context); + }); }; const deserializeAws_restJson1DailySchedule = (output: any, context: __SerdeContext): DailySchedule => { @@ -7941,7 +8145,14 @@ const deserializeAws_restJson1DefaultDetection = (output: any, context: __SerdeC }; const deserializeAws_restJson1DefaultDetections = (output: any, context: __SerdeContext): DefaultDetection[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DefaultDetection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DefaultDetection(entry, context); + }); }; const deserializeAws_restJson1DomainDetails = (output: any, context: __SerdeContext): DomainDetails => { @@ -8213,7 +8424,14 @@ const deserializeAws_restJson1KeyValuePair = (output: any, context: __SerdeConte }; const deserializeAws_restJson1KeyValuePairList = (output: any, context: __SerdeContext): KeyValuePair[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1KeyValuePair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1KeyValuePair(entry, context); + }); }; const deserializeAws_restJson1LastRunErrorStatus = (output: any, context: __SerdeContext): LastRunErrorStatus => { @@ -8309,7 +8527,14 @@ const deserializeAws_restJson1Page = (output: any, context: __SerdeContext): Pag }; const deserializeAws_restJson1Pages = (output: any, context: __SerdeContext): Page[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Page(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Page(entry, context); + }); }; const deserializeAws_restJson1PolicyDetails = (output: any, context: __SerdeContext): PolicyDetails => { @@ -8334,7 +8559,14 @@ const deserializeAws_restJson1Range = (output: any, context: __SerdeContext): Ra }; const deserializeAws_restJson1Ranges = (output: any, context: __SerdeContext): Range[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Range(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Range(entry, context); + }); }; const deserializeAws_restJson1_Record = (output: any, context: __SerdeContext): _Record => { @@ -8345,7 +8577,14 @@ const deserializeAws_restJson1_Record = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Records = (output: any, context: __SerdeContext): _Record[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1_Record(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1_Record(entry, context); + }); }; const deserializeAws_restJson1ReplicationDetails = (output: any, context: __SerdeContext): ReplicationDetails => { @@ -8478,7 +8717,14 @@ const deserializeAws_restJson1Scoping = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1SensitiveData = (output: any, context: __SerdeContext): SensitiveDataItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SensitiveDataItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SensitiveDataItem(entry, context); + }); }; const deserializeAws_restJson1SensitiveDataItem = (output: any, context: __SerdeContext): SensitiveDataItem => { @@ -8574,13 +8820,15 @@ const deserializeAws_restJson1Statistics = (output: any, context: __SerdeContext }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TagScopeTerm = (output: any, context: __SerdeContext): TagScopeTerm => { @@ -8723,6 +8971,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-managedblockchain/protocols/Aws_restJson1.ts b/clients/client-managedblockchain/protocols/Aws_restJson1.ts index 0e369a86da5c..62710877055f 100644 --- a/clients/client-managedblockchain/protocols/Aws_restJson1.ts +++ b/clients/client-managedblockchain/protocols/Aws_restJson1.ts @@ -80,7 +80,7 @@ export const serializeAws_restJson1CreateMemberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/networks/{NetworkId}/members"; if (input.NetworkId !== undefined) { @@ -95,10 +95,11 @@ export const serializeAws_restJson1CreateMemberCommand = async ( let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.InvitationId !== undefined && { InvitationId: input.InvitationId }), - ...(input.MemberConfiguration !== undefined && { - MemberConfiguration: serializeAws_restJson1MemberConfiguration(input.MemberConfiguration, context), - }), + ...(input.InvitationId !== undefined && input.InvitationId !== null && { InvitationId: input.InvitationId }), + ...(input.MemberConfiguration !== undefined && + input.MemberConfiguration !== null && { + MemberConfiguration: serializeAws_restJson1MemberConfiguration(input.MemberConfiguration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -117,28 +118,30 @@ export const serializeAws_restJson1CreateNetworkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/networks"; let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Framework !== undefined && { Framework: input.Framework }), - ...(input.FrameworkConfiguration !== undefined && { - FrameworkConfiguration: serializeAws_restJson1NetworkFrameworkConfiguration( - input.FrameworkConfiguration, - context - ), - }), - ...(input.FrameworkVersion !== undefined && { FrameworkVersion: input.FrameworkVersion }), - ...(input.MemberConfiguration !== undefined && { - MemberConfiguration: serializeAws_restJson1MemberConfiguration(input.MemberConfiguration, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.VotingPolicy !== undefined && { - VotingPolicy: serializeAws_restJson1VotingPolicy(input.VotingPolicy, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Framework !== undefined && input.Framework !== null && { Framework: input.Framework }), + ...(input.FrameworkConfiguration !== undefined && + input.FrameworkConfiguration !== null && { + FrameworkConfiguration: serializeAws_restJson1NetworkFrameworkConfiguration( + input.FrameworkConfiguration, + context + ), + }), + ...(input.FrameworkVersion !== undefined && + input.FrameworkVersion !== null && { FrameworkVersion: input.FrameworkVersion }), + ...(input.MemberConfiguration !== undefined && + input.MemberConfiguration !== null && { + MemberConfiguration: serializeAws_restJson1MemberConfiguration(input.MemberConfiguration, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.VotingPolicy !== undefined && + input.VotingPolicy !== null && { VotingPolicy: serializeAws_restJson1VotingPolicy(input.VotingPolicy, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -157,7 +160,7 @@ export const serializeAws_restJson1CreateNodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/networks/{NetworkId}/members/{MemberId}/nodes"; if (input.MemberId !== undefined) { @@ -181,9 +184,10 @@ export const serializeAws_restJson1CreateNodeCommand = async ( let body: any; body = JSON.stringify({ ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.NodeConfiguration !== undefined && { - NodeConfiguration: serializeAws_restJson1NodeConfiguration(input.NodeConfiguration, context), - }), + ...(input.NodeConfiguration !== undefined && + input.NodeConfiguration !== null && { + NodeConfiguration: serializeAws_restJson1NodeConfiguration(input.NodeConfiguration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -202,7 +206,7 @@ export const serializeAws_restJson1CreateProposalCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/networks/{NetworkId}/proposals"; if (input.NetworkId !== undefined) { @@ -216,10 +220,11 @@ export const serializeAws_restJson1CreateProposalCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Actions !== undefined && { Actions: serializeAws_restJson1ProposalActions(input.Actions, context) }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_restJson1ProposalActions(input.Actions, context) }), ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.MemberId !== undefined && { MemberId: input.MemberId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.MemberId !== undefined && input.MemberId !== null && { MemberId: input.MemberId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -237,9 +242,7 @@ export const serializeAws_restJson1DeleteMemberCommand = async ( input: DeleteMemberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}/members/{MemberId}"; if (input.NetworkId !== undefined) { const labelValue: string = input.NetworkId; @@ -276,9 +279,7 @@ export const serializeAws_restJson1DeleteNodeCommand = async ( input: DeleteNodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}/members/{MemberId}/nodes/{NodeId}"; if (input.MemberId !== undefined) { const labelValue: string = input.MemberId; @@ -324,9 +325,7 @@ export const serializeAws_restJson1GetMemberCommand = async ( input: GetMemberCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}/members/{MemberId}"; if (input.NetworkId !== undefined) { const labelValue: string = input.NetworkId; @@ -363,9 +362,7 @@ export const serializeAws_restJson1GetNetworkCommand = async ( input: GetNetworkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}"; if (input.NetworkId !== undefined) { const labelValue: string = input.NetworkId; @@ -393,9 +390,7 @@ export const serializeAws_restJson1GetNodeCommand = async ( input: GetNodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}/members/{MemberId}/nodes/{NodeId}"; if (input.NetworkId !== undefined) { const labelValue: string = input.NetworkId; @@ -441,9 +436,7 @@ export const serializeAws_restJson1GetProposalCommand = async ( input: GetProposalCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}/proposals/{ProposalId}"; if (input.NetworkId !== undefined) { const labelValue: string = input.NetworkId; @@ -480,9 +473,7 @@ export const serializeAws_restJson1ListInvitationsCommand = async ( input: ListInvitationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/invitations"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -506,9 +497,7 @@ export const serializeAws_restJson1ListMembersCommand = async ( input: ListMembersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}/members"; if (input.NetworkId !== undefined) { const labelValue: string = input.NetworkId; @@ -544,9 +533,7 @@ export const serializeAws_restJson1ListNetworksCommand = async ( input: ListNetworksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks"; const query: any = { ...(input.Status !== undefined && { status: input.Status }), @@ -573,9 +560,7 @@ export const serializeAws_restJson1ListNodesCommand = async ( input: ListNodesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}/members/{MemberId}/nodes"; if (input.MemberId !== undefined) { const labelValue: string = input.MemberId; @@ -618,9 +603,7 @@ export const serializeAws_restJson1ListProposalsCommand = async ( input: ListProposalsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}/proposals"; if (input.NetworkId !== undefined) { const labelValue: string = input.NetworkId; @@ -653,9 +636,7 @@ export const serializeAws_restJson1ListProposalVotesCommand = async ( input: ListProposalVotesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/networks/{NetworkId}/proposals/{ProposalId}/votes"; if (input.NetworkId !== undefined) { const labelValue: string = input.NetworkId; @@ -697,9 +678,7 @@ export const serializeAws_restJson1RejectInvitationCommand = async ( input: RejectInvitationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/invitations/{InvitationId}"; if (input.InvitationId !== undefined) { const labelValue: string = input.InvitationId; @@ -728,7 +707,7 @@ export const serializeAws_restJson1UpdateMemberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/networks/{NetworkId}/members/{MemberId}"; if (input.MemberId !== undefined) { @@ -751,12 +730,13 @@ export const serializeAws_restJson1UpdateMemberCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.LogPublishingConfiguration !== undefined && { - LogPublishingConfiguration: serializeAws_restJson1MemberLogPublishingConfiguration( - input.LogPublishingConfiguration, - context - ), - }), + ...(input.LogPublishingConfiguration !== undefined && + input.LogPublishingConfiguration !== null && { + LogPublishingConfiguration: serializeAws_restJson1MemberLogPublishingConfiguration( + input.LogPublishingConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -775,7 +755,7 @@ export const serializeAws_restJson1UpdateNodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/networks/{NetworkId}/members/{MemberId}/nodes/{NodeId}"; if (input.NodeId !== undefined) { @@ -807,12 +787,13 @@ export const serializeAws_restJson1UpdateNodeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.LogPublishingConfiguration !== undefined && { - LogPublishingConfiguration: serializeAws_restJson1NodeLogPublishingConfiguration( - input.LogPublishingConfiguration, - context - ), - }), + ...(input.LogPublishingConfiguration !== undefined && + input.LogPublishingConfiguration !== null && { + LogPublishingConfiguration: serializeAws_restJson1NodeLogPublishingConfiguration( + input.LogPublishingConfiguration, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -831,7 +812,7 @@ export const serializeAws_restJson1VoteOnProposalCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/networks/{NetworkId}/proposals/{ProposalId}/votes"; if (input.NetworkId !== undefined) { @@ -854,8 +835,8 @@ export const serializeAws_restJson1VoteOnProposalCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Vote !== undefined && { Vote: input.Vote }), - ...(input.VoterMemberId !== undefined && { VoterMemberId: input.VoterMemberId }), + ...(input.Vote !== undefined && input.Vote !== null && { Vote: input.Vote }), + ...(input.VoterMemberId !== undefined && input.VoterMemberId !== null && { VoterMemberId: input.VoterMemberId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2831,49 +2812,63 @@ const serializeAws_restJson1ApprovalThresholdPolicy = ( context: __SerdeContext ): any => { return { - ...(input.ProposalDurationInHours !== undefined && { ProposalDurationInHours: input.ProposalDurationInHours }), - ...(input.ThresholdComparator !== undefined && { ThresholdComparator: input.ThresholdComparator }), - ...(input.ThresholdPercentage !== undefined && { ThresholdPercentage: input.ThresholdPercentage }), + ...(input.ProposalDurationInHours !== undefined && + input.ProposalDurationInHours !== null && { ProposalDurationInHours: input.ProposalDurationInHours }), + ...(input.ThresholdComparator !== undefined && + input.ThresholdComparator !== null && { ThresholdComparator: input.ThresholdComparator }), + ...(input.ThresholdPercentage !== undefined && + input.ThresholdPercentage !== null && { ThresholdPercentage: input.ThresholdPercentage }), }; }; const serializeAws_restJson1InviteAction = (input: InviteAction, context: __SerdeContext): any => { return { - ...(input.Principal !== undefined && { Principal: input.Principal }), + ...(input.Principal !== undefined && input.Principal !== null && { Principal: input.Principal }), }; }; const serializeAws_restJson1InviteActionList = (input: InviteAction[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1InviteAction(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InviteAction(entry, context); + }); }; const serializeAws_restJson1LogConfiguration = (input: LogConfiguration, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; const serializeAws_restJson1LogConfigurations = (input: LogConfigurations, context: __SerdeContext): any => { return { - ...(input.Cloudwatch !== undefined && { - Cloudwatch: serializeAws_restJson1LogConfiguration(input.Cloudwatch, context), - }), + ...(input.Cloudwatch !== undefined && + input.Cloudwatch !== null && { Cloudwatch: serializeAws_restJson1LogConfiguration(input.Cloudwatch, context) }), }; }; const serializeAws_restJson1MemberConfiguration = (input: MemberConfiguration, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FrameworkConfiguration !== undefined && { - FrameworkConfiguration: serializeAws_restJson1MemberFrameworkConfiguration(input.FrameworkConfiguration, context), - }), - ...(input.LogPublishingConfiguration !== undefined && { - LogPublishingConfiguration: serializeAws_restJson1MemberLogPublishingConfiguration( - input.LogPublishingConfiguration, - context - ), - }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FrameworkConfiguration !== undefined && + input.FrameworkConfiguration !== null && { + FrameworkConfiguration: serializeAws_restJson1MemberFrameworkConfiguration( + input.FrameworkConfiguration, + context + ), + }), + ...(input.LogPublishingConfiguration !== undefined && + input.LogPublishingConfiguration !== null && { + LogPublishingConfiguration: serializeAws_restJson1MemberLogPublishingConfiguration( + input.LogPublishingConfiguration, + context + ), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -2882,8 +2877,8 @@ const serializeAws_restJson1MemberFabricConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AdminPassword !== undefined && { AdminPassword: input.AdminPassword }), - ...(input.AdminUsername !== undefined && { AdminUsername: input.AdminUsername }), + ...(input.AdminPassword !== undefined && input.AdminPassword !== null && { AdminPassword: input.AdminPassword }), + ...(input.AdminUsername !== undefined && input.AdminUsername !== null && { AdminUsername: input.AdminUsername }), }; }; @@ -2892,7 +2887,8 @@ const serializeAws_restJson1MemberFabricLogPublishingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.CaLogs !== undefined && { CaLogs: serializeAws_restJson1LogConfigurations(input.CaLogs, context) }), + ...(input.CaLogs !== undefined && + input.CaLogs !== null && { CaLogs: serializeAws_restJson1LogConfigurations(input.CaLogs, context) }), }; }; @@ -2901,9 +2897,8 @@ const serializeAws_restJson1MemberFrameworkConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Fabric !== undefined && { - Fabric: serializeAws_restJson1MemberFabricConfiguration(input.Fabric, context), - }), + ...(input.Fabric !== undefined && + input.Fabric !== null && { Fabric: serializeAws_restJson1MemberFabricConfiguration(input.Fabric, context) }), }; }; @@ -2912,9 +2907,10 @@ const serializeAws_restJson1MemberLogPublishingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Fabric !== undefined && { - Fabric: serializeAws_restJson1MemberFabricLogPublishingConfiguration(input.Fabric, context), - }), + ...(input.Fabric !== undefined && + input.Fabric !== null && { + Fabric: serializeAws_restJson1MemberFabricLogPublishingConfiguration(input.Fabric, context), + }), }; }; @@ -2923,7 +2919,7 @@ const serializeAws_restJson1NetworkFabricConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Edition !== undefined && { Edition: input.Edition }), + ...(input.Edition !== undefined && input.Edition !== null && { Edition: input.Edition }), }; }; @@ -2932,23 +2928,24 @@ const serializeAws_restJson1NetworkFrameworkConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Fabric !== undefined && { - Fabric: serializeAws_restJson1NetworkFabricConfiguration(input.Fabric, context), - }), + ...(input.Fabric !== undefined && + input.Fabric !== null && { Fabric: serializeAws_restJson1NetworkFabricConfiguration(input.Fabric, context) }), }; }; const serializeAws_restJson1NodeConfiguration = (input: NodeConfiguration, context: __SerdeContext): any => { return { - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.LogPublishingConfiguration !== undefined && { - LogPublishingConfiguration: serializeAws_restJson1NodeLogPublishingConfiguration( - input.LogPublishingConfiguration, - context - ), - }), - ...(input.StateDB !== undefined && { StateDB: input.StateDB }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.LogPublishingConfiguration !== undefined && + input.LogPublishingConfiguration !== null && { + LogPublishingConfiguration: serializeAws_restJson1NodeLogPublishingConfiguration( + input.LogPublishingConfiguration, + context + ), + }), + ...(input.StateDB !== undefined && input.StateDB !== null && { StateDB: input.StateDB }), }; }; @@ -2957,10 +2954,12 @@ const serializeAws_restJson1NodeFabricLogPublishingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.ChaincodeLogs !== undefined && { - ChaincodeLogs: serializeAws_restJson1LogConfigurations(input.ChaincodeLogs, context), - }), - ...(input.PeerLogs !== undefined && { PeerLogs: serializeAws_restJson1LogConfigurations(input.PeerLogs, context) }), + ...(input.ChaincodeLogs !== undefined && + input.ChaincodeLogs !== null && { + ChaincodeLogs: serializeAws_restJson1LogConfigurations(input.ChaincodeLogs, context), + }), + ...(input.PeerLogs !== undefined && + input.PeerLogs !== null && { PeerLogs: serializeAws_restJson1LogConfigurations(input.PeerLogs, context) }), }; }; @@ -2969,36 +2968,47 @@ const serializeAws_restJson1NodeLogPublishingConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Fabric !== undefined && { - Fabric: serializeAws_restJson1NodeFabricLogPublishingConfiguration(input.Fabric, context), - }), + ...(input.Fabric !== undefined && + input.Fabric !== null && { + Fabric: serializeAws_restJson1NodeFabricLogPublishingConfiguration(input.Fabric, context), + }), }; }; const serializeAws_restJson1ProposalActions = (input: ProposalActions, context: __SerdeContext): any => { return { - ...(input.Invitations !== undefined && { - Invitations: serializeAws_restJson1InviteActionList(input.Invitations, context), - }), - ...(input.Removals !== undefined && { Removals: serializeAws_restJson1RemoveActionList(input.Removals, context) }), + ...(input.Invitations !== undefined && + input.Invitations !== null && { + Invitations: serializeAws_restJson1InviteActionList(input.Invitations, context), + }), + ...(input.Removals !== undefined && + input.Removals !== null && { Removals: serializeAws_restJson1RemoveActionList(input.Removals, context) }), }; }; const serializeAws_restJson1RemoveAction = (input: RemoveAction, context: __SerdeContext): any => { return { - ...(input.MemberId !== undefined && { MemberId: input.MemberId }), + ...(input.MemberId !== undefined && input.MemberId !== null && { MemberId: input.MemberId }), }; }; const serializeAws_restJson1RemoveActionList = (input: RemoveAction[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1RemoveAction(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1RemoveAction(entry, context); + }); }; const serializeAws_restJson1VotingPolicy = (input: VotingPolicy, context: __SerdeContext): any => { return { - ...(input.ApprovalThresholdPolicy !== undefined && { - ApprovalThresholdPolicy: serializeAws_restJson1ApprovalThresholdPolicy(input.ApprovalThresholdPolicy, context), - }), + ...(input.ApprovalThresholdPolicy !== undefined && + input.ApprovalThresholdPolicy !== null && { + ApprovalThresholdPolicy: serializeAws_restJson1ApprovalThresholdPolicy(input.ApprovalThresholdPolicy, context), + }), }; }; @@ -3040,7 +3050,14 @@ const deserializeAws_restJson1Invitation = (output: any, context: __SerdeContext }; const deserializeAws_restJson1InvitationList = (output: any, context: __SerdeContext): Invitation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Invitation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Invitation(entry, context); + }); }; const deserializeAws_restJson1InviteAction = (output: any, context: __SerdeContext): InviteAction => { @@ -3050,7 +3067,14 @@ const deserializeAws_restJson1InviteAction = (output: any, context: __SerdeConte }; const deserializeAws_restJson1InviteActionList = (output: any, context: __SerdeContext): InviteAction[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InviteAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InviteAction(entry, context); + }); }; const deserializeAws_restJson1LogConfiguration = (output: any, context: __SerdeContext): LogConfiguration => { @@ -3148,7 +3172,14 @@ const deserializeAws_restJson1MemberSummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1MemberSummaryList = (output: any, context: __SerdeContext): MemberSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MemberSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MemberSummary(entry, context); + }); }; const deserializeAws_restJson1Network = (output: any, context: __SerdeContext): Network => { @@ -3217,7 +3248,14 @@ const deserializeAws_restJson1NetworkSummary = (output: any, context: __SerdeCon }; const deserializeAws_restJson1NetworkSummaryList = (output: any, context: __SerdeContext): NetworkSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NetworkSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NetworkSummary(entry, context); + }); }; const deserializeAws_restJson1Node = (output: any, context: __SerdeContext): Node => { @@ -3306,7 +3344,14 @@ const deserializeAws_restJson1NodeSummary = (output: any, context: __SerdeContex }; const deserializeAws_restJson1NodeSummaryList = (output: any, context: __SerdeContext): NodeSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NodeSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NodeSummary(entry, context); + }); }; const deserializeAws_restJson1Proposal = (output: any, context: __SerdeContext): Proposal => { @@ -3378,11 +3423,25 @@ const deserializeAws_restJson1ProposalSummary = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ProposalSummaryList = (output: any, context: __SerdeContext): ProposalSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProposalSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProposalSummary(entry, context); + }); }; const deserializeAws_restJson1ProposalVoteList = (output: any, context: __SerdeContext): VoteSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VoteSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VoteSummary(entry, context); + }); }; const deserializeAws_restJson1RemoveAction = (output: any, context: __SerdeContext): RemoveAction => { @@ -3392,7 +3451,14 @@ const deserializeAws_restJson1RemoveAction = (output: any, context: __SerdeConte }; const deserializeAws_restJson1RemoveActionList = (output: any, context: __SerdeContext): RemoveAction[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RemoveAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RemoveAction(entry, context); + }); }; const deserializeAws_restJson1VoteSummary = (output: any, context: __SerdeContext): VoteSummary => { @@ -3432,6 +3498,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-marketplace-catalog/protocols/Aws_restJson1.ts b/clients/client-marketplace-catalog/protocols/Aws_restJson1.ts index 6b8ed4e60cd6..c0b1a4d1ff60 100644 --- a/clients/client-marketplace-catalog/protocols/Aws_restJson1.ts +++ b/clients/client-marketplace-catalog/protocols/Aws_restJson1.ts @@ -38,9 +38,7 @@ export const serializeAws_restJson1CancelChangeSetCommand = async ( input: CancelChangeSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/CancelChangeSet"; const query: any = { ...(input.ChangeSetId !== undefined && { changeSetId: input.ChangeSetId }), @@ -64,9 +62,7 @@ export const serializeAws_restJson1DescribeChangeSetCommand = async ( input: DescribeChangeSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/DescribeChangeSet"; const query: any = { ...(input.ChangeSetId !== undefined && { changeSetId: input.ChangeSetId }), @@ -90,9 +86,7 @@ export const serializeAws_restJson1DescribeEntityCommand = async ( input: DescribeEntityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/DescribeEntity"; const query: any = { ...(input.Catalog !== undefined && { catalog: input.Catalog }), @@ -117,16 +111,17 @@ export const serializeAws_restJson1ListChangeSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListChangeSets"; let body: any; body = JSON.stringify({ - ...(input.Catalog !== undefined && { Catalog: input.Catalog }), - ...(input.FilterList !== undefined && { FilterList: serializeAws_restJson1FilterList(input.FilterList, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Sort !== undefined && { Sort: serializeAws_restJson1Sort(input.Sort, context) }), + ...(input.Catalog !== undefined && input.Catalog !== null && { Catalog: input.Catalog }), + ...(input.FilterList !== undefined && + input.FilterList !== null && { FilterList: serializeAws_restJson1FilterList(input.FilterList, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Sort !== undefined && input.Sort !== null && { Sort: serializeAws_restJson1Sort(input.Sort, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -145,17 +140,18 @@ export const serializeAws_restJson1ListEntitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListEntities"; let body: any; body = JSON.stringify({ - ...(input.Catalog !== undefined && { Catalog: input.Catalog }), - ...(input.EntityType !== undefined && { EntityType: input.EntityType }), - ...(input.FilterList !== undefined && { FilterList: serializeAws_restJson1FilterList(input.FilterList, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Sort !== undefined && { Sort: serializeAws_restJson1Sort(input.Sort, context) }), + ...(input.Catalog !== undefined && input.Catalog !== null && { Catalog: input.Catalog }), + ...(input.EntityType !== undefined && input.EntityType !== null && { EntityType: input.EntityType }), + ...(input.FilterList !== undefined && + input.FilterList !== null && { FilterList: serializeAws_restJson1FilterList(input.FilterList, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Sort !== undefined && input.Sort !== null && { Sort: serializeAws_restJson1Sort(input.Sort, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -174,17 +170,17 @@ export const serializeAws_restJson1StartChangeSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/StartChangeSet"; let body: any; body = JSON.stringify({ - ...(input.Catalog !== undefined && { Catalog: input.Catalog }), - ...(input.ChangeSet !== undefined && { - ChangeSet: serializeAws_restJson1RequestedChangeList(input.ChangeSet, context), - }), - ...(input.ChangeSetName !== undefined && { ChangeSetName: input.ChangeSetName }), - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), + ...(input.Catalog !== undefined && input.Catalog !== null && { Catalog: input.Catalog }), + ...(input.ChangeSet !== undefined && + input.ChangeSet !== null && { ChangeSet: serializeAws_restJson1RequestedChangeList(input.ChangeSet, context) }), + ...(input.ChangeSetName !== undefined && input.ChangeSetName !== null && { ChangeSetName: input.ChangeSetName }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -946,54 +942,91 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1Change = (input: Change, context: __SerdeContext): any => { return { - ...(input.ChangeType !== undefined && { ChangeType: input.ChangeType }), - ...(input.Details !== undefined && { Details: input.Details }), - ...(input.Entity !== undefined && { Entity: serializeAws_restJson1Entity(input.Entity, context) }), + ...(input.ChangeType !== undefined && input.ChangeType !== null && { ChangeType: input.ChangeType }), + ...(input.Details !== undefined && input.Details !== null && { Details: input.Details }), + ...(input.Entity !== undefined && + input.Entity !== null && { Entity: serializeAws_restJson1Entity(input.Entity, context) }), }; }; const serializeAws_restJson1Entity = (input: Entity, context: __SerdeContext): any => { return { - ...(input.Identifier !== undefined && { Identifier: input.Identifier }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Identifier !== undefined && input.Identifier !== null && { Identifier: input.Identifier }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ValueList !== undefined && { ValueList: serializeAws_restJson1ValueList(input.ValueList, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ValueList !== undefined && + input.ValueList !== null && { ValueList: serializeAws_restJson1ValueList(input.ValueList, context) }), }; }; const serializeAws_restJson1FilterList = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Filter(entry, context); + }); }; const serializeAws_restJson1RequestedChangeList = (input: Change[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Change(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Change(entry, context); + }); }; const serializeAws_restJson1Sort = (input: Sort, context: __SerdeContext): any => { return { - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_restJson1ValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ChangeSetDescription = (output: any, context: __SerdeContext): ChangeSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChangeSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChangeSummary(entry, context); + }); }; const deserializeAws_restJson1ChangeSetSummaryList = ( output: any, context: __SerdeContext ): ChangeSetSummaryListItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChangeSetSummaryListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChangeSetSummaryListItem(entry, context); + }); }; const deserializeAws_restJson1ChangeSetSummaryListItem = ( @@ -1051,7 +1084,14 @@ const deserializeAws_restJson1EntitySummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1EntitySummaryList = (output: any, context: __SerdeContext): EntitySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EntitySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EntitySummary(entry, context); + }); }; const deserializeAws_restJson1ErrorDetail = (output: any, context: __SerdeContext): ErrorDetail => { @@ -1062,11 +1102,25 @@ const deserializeAws_restJson1ErrorDetail = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ErrorDetailList = (output: any, context: __SerdeContext): ErrorDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ErrorDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ErrorDetail(entry, context); + }); }; const deserializeAws_restJson1ResourceIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1089,6 +1143,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-marketplace-commerce-analytics/protocols/Aws_json1_1.ts b/clients/client-marketplace-commerce-analytics/protocols/Aws_json1_1.ts index 7f036afe30f7..017b713efe88 100644 --- a/clients/client-marketplace-commerce-analytics/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-commerce-analytics/protocols/Aws_json1_1.ts @@ -25,7 +25,7 @@ export const serializeAws_json1_1GenerateDataSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MarketplaceCommerceAnalytics20150701.GenerateDataSet", }; let body: any; @@ -38,7 +38,7 @@ export const serializeAws_json1_1StartSupportDataExportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MarketplaceCommerceAnalytics20150701.StartSupportDataExport", }; let body: any; @@ -73,8 +73,7 @@ const deserializeAws_json1_1GenerateDataSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "MarketplaceCommerceAnalyticsException": case "com.amazonaws.marketplacecommerceanalytics#MarketplaceCommerceAnalyticsException": @@ -128,8 +127,7 @@ const deserializeAws_json1_1StartSupportDataExportCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "MarketplaceCommerceAnalyticsException": case "com.amazonaws.marketplacecommerceanalytics#MarketplaceCommerceAnalyticsException": @@ -172,28 +170,34 @@ const deserializeAws_json1_1MarketplaceCommerceAnalyticsExceptionResponse = asyn }; const serializeAws_json1_1CustomerDefinedValues = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1GenerateDataSetRequest = (input: GenerateDataSetRequest, context: __SerdeContext): any => { return { - ...(input.customerDefinedValues !== undefined && { - customerDefinedValues: serializeAws_json1_1CustomerDefinedValues(input.customerDefinedValues, context), - }), - ...(input.dataSetPublicationDate !== undefined && { - dataSetPublicationDate: Math.round(input.dataSetPublicationDate.getTime() / 1000), - }), - ...(input.dataSetType !== undefined && { dataSetType: input.dataSetType }), - ...(input.destinationS3BucketName !== undefined && { destinationS3BucketName: input.destinationS3BucketName }), - ...(input.destinationS3Prefix !== undefined && { destinationS3Prefix: input.destinationS3Prefix }), - ...(input.roleNameArn !== undefined && { roleNameArn: input.roleNameArn }), - ...(input.snsTopicArn !== undefined && { snsTopicArn: input.snsTopicArn }), + ...(input.customerDefinedValues !== undefined && + input.customerDefinedValues !== null && { + customerDefinedValues: serializeAws_json1_1CustomerDefinedValues(input.customerDefinedValues, context), + }), + ...(input.dataSetPublicationDate !== undefined && + input.dataSetPublicationDate !== null && { + dataSetPublicationDate: Math.round(input.dataSetPublicationDate.getTime() / 1000), + }), + ...(input.dataSetType !== undefined && input.dataSetType !== null && { dataSetType: input.dataSetType }), + ...(input.destinationS3BucketName !== undefined && + input.destinationS3BucketName !== null && { destinationS3BucketName: input.destinationS3BucketName }), + ...(input.destinationS3Prefix !== undefined && + input.destinationS3Prefix !== null && { destinationS3Prefix: input.destinationS3Prefix }), + ...(input.roleNameArn !== undefined && input.roleNameArn !== null && { roleNameArn: input.roleNameArn }), + ...(input.snsTopicArn !== undefined && input.snsTopicArn !== null && { snsTopicArn: input.snsTopicArn }), }; }; @@ -202,15 +206,19 @@ const serializeAws_json1_1StartSupportDataExportRequest = ( context: __SerdeContext ): any => { return { - ...(input.customerDefinedValues !== undefined && { - customerDefinedValues: serializeAws_json1_1CustomerDefinedValues(input.customerDefinedValues, context), - }), - ...(input.dataSetType !== undefined && { dataSetType: input.dataSetType }), - ...(input.destinationS3BucketName !== undefined && { destinationS3BucketName: input.destinationS3BucketName }), - ...(input.destinationS3Prefix !== undefined && { destinationS3Prefix: input.destinationS3Prefix }), - ...(input.fromDate !== undefined && { fromDate: Math.round(input.fromDate.getTime() / 1000) }), - ...(input.roleNameArn !== undefined && { roleNameArn: input.roleNameArn }), - ...(input.snsTopicArn !== undefined && { snsTopicArn: input.snsTopicArn }), + ...(input.customerDefinedValues !== undefined && + input.customerDefinedValues !== null && { + customerDefinedValues: serializeAws_json1_1CustomerDefinedValues(input.customerDefinedValues, context), + }), + ...(input.dataSetType !== undefined && input.dataSetType !== null && { dataSetType: input.dataSetType }), + ...(input.destinationS3BucketName !== undefined && + input.destinationS3BucketName !== null && { destinationS3BucketName: input.destinationS3BucketName }), + ...(input.destinationS3Prefix !== undefined && + input.destinationS3Prefix !== null && { destinationS3Prefix: input.destinationS3Prefix }), + ...(input.fromDate !== undefined && + input.fromDate !== null && { fromDate: Math.round(input.fromDate.getTime() / 1000) }), + ...(input.roleNameArn !== undefined && input.roleNameArn !== null && { roleNameArn: input.roleNameArn }), + ...(input.snsTopicArn !== undefined && input.snsTopicArn !== null && { snsTopicArn: input.snsTopicArn }), }; }; @@ -290,3 +298,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-marketplace-entitlement-service/protocols/Aws_json1_1.ts b/clients/client-marketplace-entitlement-service/protocols/Aws_json1_1.ts index 27208ed88cf0..c84c908977ab 100644 --- a/clients/client-marketplace-entitlement-service/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-entitlement-service/protocols/Aws_json1_1.ts @@ -24,7 +24,7 @@ export const serializeAws_json1_1GetEntitlementsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMPEntitlementService.GetEntitlements", }; let body: any; @@ -59,8 +59,7 @@ const deserializeAws_json1_1GetEntitlementsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.marketplaceentitlementservice#InternalServiceErrorException": @@ -149,7 +148,14 @@ const deserializeAws_json1_1ThrottlingExceptionResponse = async ( }; const serializeAws_json1_1FilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetEntitlementFilters = ( @@ -157,20 +163,26 @@ const serializeAws_json1_1GetEntitlementFilters = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [GetEntitlementFilterName | string, any]) => ({ - ...acc, - [key]: serializeAws_json1_1FilterValueList(value, context), - }), + (acc: { [key: string]: string[] }, [key, value]: [GetEntitlementFilterName | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_json1_1FilterValueList(value, context), + }; + }, {} ); }; const serializeAws_json1_1GetEntitlementsRequest = (input: GetEntitlementsRequest, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1GetEntitlementFilters(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ProductCode !== undefined && { ProductCode: input.ProductCode }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1GetEntitlementFilters(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ProductCode !== undefined && input.ProductCode !== null && { ProductCode: input.ProductCode }), }; }; @@ -194,7 +206,14 @@ const deserializeAws_json1_1Entitlement = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1EntitlementList = (output: any, context: __SerdeContext): Entitlement[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Entitlement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Entitlement(entry, context); + }); }; const deserializeAws_json1_1EntitlementValue = (output: any, context: __SerdeContext): EntitlementValue => { @@ -290,3 +309,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-marketplace-metering/protocols/Aws_json1_1.ts b/clients/client-marketplace-metering/protocols/Aws_json1_1.ts index 031437a3b106..24fa5f3ca47b 100644 --- a/clients/client-marketplace-metering/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-metering/protocols/Aws_json1_1.ts @@ -48,7 +48,7 @@ export const serializeAws_json1_1BatchMeterUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMPMeteringService.BatchMeterUsage", }; let body: any; @@ -61,7 +61,7 @@ export const serializeAws_json1_1MeterUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMPMeteringService.MeterUsage", }; let body: any; @@ -74,7 +74,7 @@ export const serializeAws_json1_1RegisterUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMPMeteringService.RegisterUsage", }; let body: any; @@ -87,7 +87,7 @@ export const serializeAws_json1_1ResolveCustomerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMPMeteringService.ResolveCustomer", }; let body: any; @@ -122,8 +122,7 @@ const deserializeAws_json1_1BatchMeterUsageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DisabledApiException": case "com.amazonaws.marketplacemetering#DisabledApiException": @@ -241,8 +240,7 @@ const deserializeAws_json1_1MeterUsageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CustomerNotEntitledException": case "com.amazonaws.marketplacemetering#CustomerNotEntitledException": @@ -368,8 +366,7 @@ const deserializeAws_json1_1RegisterUsageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CustomerNotEntitledException": case "com.amazonaws.marketplacemetering#CustomerNotEntitledException": @@ -479,8 +476,7 @@ const deserializeAws_json1_1ResolveCustomerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DisabledApiException": case "com.amazonaws.marketplacemetering#DisabledApiException": @@ -796,76 +792,107 @@ const deserializeAws_json1_1TimestampOutOfBoundsExceptionResponse = async ( const serializeAws_json1_1BatchMeterUsageRequest = (input: BatchMeterUsageRequest, context: __SerdeContext): any => { return { - ...(input.ProductCode !== undefined && { ProductCode: input.ProductCode }), - ...(input.UsageRecords !== undefined && { - UsageRecords: serializeAws_json1_1UsageRecordList(input.UsageRecords, context), - }), + ...(input.ProductCode !== undefined && input.ProductCode !== null && { ProductCode: input.ProductCode }), + ...(input.UsageRecords !== undefined && + input.UsageRecords !== null && { + UsageRecords: serializeAws_json1_1UsageRecordList(input.UsageRecords, context), + }), }; }; const serializeAws_json1_1MeterUsageRequest = (input: MeterUsageRequest, context: __SerdeContext): any => { return { - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.ProductCode !== undefined && { ProductCode: input.ProductCode }), - ...(input.Timestamp !== undefined && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), - ...(input.UsageAllocations !== undefined && { - UsageAllocations: serializeAws_json1_1UsageAllocations(input.UsageAllocations, context), - }), - ...(input.UsageDimension !== undefined && { UsageDimension: input.UsageDimension }), - ...(input.UsageQuantity !== undefined && { UsageQuantity: input.UsageQuantity }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.ProductCode !== undefined && input.ProductCode !== null && { ProductCode: input.ProductCode }), + ...(input.Timestamp !== undefined && + input.Timestamp !== null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), + ...(input.UsageAllocations !== undefined && + input.UsageAllocations !== null && { + UsageAllocations: serializeAws_json1_1UsageAllocations(input.UsageAllocations, context), + }), + ...(input.UsageDimension !== undefined && + input.UsageDimension !== null && { UsageDimension: input.UsageDimension }), + ...(input.UsageQuantity !== undefined && input.UsageQuantity !== null && { UsageQuantity: input.UsageQuantity }), }; }; const serializeAws_json1_1RegisterUsageRequest = (input: RegisterUsageRequest, context: __SerdeContext): any => { return { - ...(input.Nonce !== undefined && { Nonce: input.Nonce }), - ...(input.ProductCode !== undefined && { ProductCode: input.ProductCode }), - ...(input.PublicKeyVersion !== undefined && { PublicKeyVersion: input.PublicKeyVersion }), + ...(input.Nonce !== undefined && input.Nonce !== null && { Nonce: input.Nonce }), + ...(input.ProductCode !== undefined && input.ProductCode !== null && { ProductCode: input.ProductCode }), + ...(input.PublicKeyVersion !== undefined && + input.PublicKeyVersion !== null && { PublicKeyVersion: input.PublicKeyVersion }), }; }; const serializeAws_json1_1ResolveCustomerRequest = (input: ResolveCustomerRequest, context: __SerdeContext): any => { return { - ...(input.RegistrationToken !== undefined && { RegistrationToken: input.RegistrationToken }), + ...(input.RegistrationToken !== undefined && + input.RegistrationToken !== null && { RegistrationToken: input.RegistrationToken }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1UsageAllocation = (input: UsageAllocation, context: __SerdeContext): any => { return { - ...(input.AllocatedUsageQuantity !== undefined && { AllocatedUsageQuantity: input.AllocatedUsageQuantity }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.AllocatedUsageQuantity !== undefined && + input.AllocatedUsageQuantity !== null && { AllocatedUsageQuantity: input.AllocatedUsageQuantity }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UsageAllocations = (input: UsageAllocation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1UsageAllocation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1UsageAllocation(entry, context); + }); }; const serializeAws_json1_1UsageRecord = (input: UsageRecord, context: __SerdeContext): any => { return { - ...(input.CustomerIdentifier !== undefined && { CustomerIdentifier: input.CustomerIdentifier }), - ...(input.Dimension !== undefined && { Dimension: input.Dimension }), - ...(input.Quantity !== undefined && { Quantity: input.Quantity }), - ...(input.Timestamp !== undefined && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), - ...(input.UsageAllocations !== undefined && { - UsageAllocations: serializeAws_json1_1UsageAllocations(input.UsageAllocations, context), - }), + ...(input.CustomerIdentifier !== undefined && + input.CustomerIdentifier !== null && { CustomerIdentifier: input.CustomerIdentifier }), + ...(input.Dimension !== undefined && input.Dimension !== null && { Dimension: input.Dimension }), + ...(input.Quantity !== undefined && input.Quantity !== null && { Quantity: input.Quantity }), + ...(input.Timestamp !== undefined && + input.Timestamp !== null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), + ...(input.UsageAllocations !== undefined && + input.UsageAllocations !== null && { + UsageAllocations: serializeAws_json1_1UsageAllocations(input.UsageAllocations, context), + }), }; }; const serializeAws_json1_1UsageRecordList = (input: UsageRecord[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1UsageRecord(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1UsageRecord(entry, context); + }); }; const deserializeAws_json1_1BatchMeterUsageResult = (output: any, context: __SerdeContext): BatchMeterUsageResult => { @@ -1036,7 +1063,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1ThrottlingException = (output: any, context: __SerdeContext): ThrottlingException => { @@ -1068,7 +1102,14 @@ const deserializeAws_json1_1UsageAllocation = (output: any, context: __SerdeCont }; const deserializeAws_json1_1UsageAllocations = (output: any, context: __SerdeContext): UsageAllocation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UsageAllocation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UsageAllocation(entry, context); + }); }; const deserializeAws_json1_1UsageRecord = (output: any, context: __SerdeContext): UsageRecord => { @@ -1091,7 +1132,14 @@ const deserializeAws_json1_1UsageRecord = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1UsageRecordList = (output: any, context: __SerdeContext): UsageRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UsageRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UsageRecord(entry, context); + }); }; const deserializeAws_json1_1UsageRecordResult = (output: any, context: __SerdeContext): UsageRecordResult => { @@ -1107,7 +1155,14 @@ const deserializeAws_json1_1UsageRecordResult = (output: any, context: __SerdeCo }; const deserializeAws_json1_1UsageRecordResultList = (output: any, context: __SerdeContext): UsageRecordResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UsageRecordResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UsageRecordResult(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1160,3 +1215,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-mediaconnect/protocols/Aws_restJson1.ts b/clients/client-mediaconnect/protocols/Aws_restJson1.ts index 78c15bc45a8e..82991eea0f68 100644 --- a/clients/client-mediaconnect/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconnect/protocols/Aws_restJson1.ts @@ -95,7 +95,7 @@ export const serializeAws_restJson1AddFlowOutputsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/flows/{FlowArn}/outputs"; if (input.FlowArn !== undefined) { @@ -109,9 +109,8 @@ export const serializeAws_restJson1AddFlowOutputsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Outputs !== undefined && { - outputs: serializeAws_restJson1__listOfAddOutputRequest(input.Outputs, context), - }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { outputs: serializeAws_restJson1__listOfAddOutputRequest(input.Outputs, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -130,7 +129,7 @@ export const serializeAws_restJson1AddFlowSourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/flows/{FlowArn}/source"; if (input.FlowArn !== undefined) { @@ -144,9 +143,8 @@ export const serializeAws_restJson1AddFlowSourcesCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Sources !== undefined && { - sources: serializeAws_restJson1__listOfSetSourceRequest(input.Sources, context), - }), + ...(input.Sources !== undefined && + input.Sources !== null && { sources: serializeAws_restJson1__listOfSetSourceRequest(input.Sources, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -165,7 +163,7 @@ export const serializeAws_restJson1AddFlowVpcInterfacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/flows/{FlowArn}/vpcInterfaces"; if (input.FlowArn !== undefined) { @@ -179,9 +177,10 @@ export const serializeAws_restJson1AddFlowVpcInterfacesCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.VpcInterfaces !== undefined && { - vpcInterfaces: serializeAws_restJson1__listOfVpcInterfaceRequest(input.VpcInterfaces, context), - }), + ...(input.VpcInterfaces !== undefined && + input.VpcInterfaces !== null && { + vpcInterfaces: serializeAws_restJson1__listOfVpcInterfaceRequest(input.VpcInterfaces, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -200,29 +199,32 @@ export const serializeAws_restJson1CreateFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/flows"; let body: any; body = JSON.stringify({ - ...(input.AvailabilityZone !== undefined && { availabilityZone: input.AvailabilityZone }), - ...(input.Entitlements !== undefined && { - entitlements: serializeAws_restJson1__listOfGrantEntitlementRequest(input.Entitlements, context), - }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Outputs !== undefined && { - outputs: serializeAws_restJson1__listOfAddOutputRequest(input.Outputs, context), - }), - ...(input.Source !== undefined && { source: serializeAws_restJson1SetSourceRequest(input.Source, context) }), - ...(input.SourceFailoverConfig !== undefined && { - sourceFailoverConfig: serializeAws_restJson1FailoverConfig(input.SourceFailoverConfig, context), - }), - ...(input.Sources !== undefined && { - sources: serializeAws_restJson1__listOfSetSourceRequest(input.Sources, context), - }), - ...(input.VpcInterfaces !== undefined && { - vpcInterfaces: serializeAws_restJson1__listOfVpcInterfaceRequest(input.VpcInterfaces, context), - }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { availabilityZone: input.AvailabilityZone }), + ...(input.Entitlements !== undefined && + input.Entitlements !== null && { + entitlements: serializeAws_restJson1__listOfGrantEntitlementRequest(input.Entitlements, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { outputs: serializeAws_restJson1__listOfAddOutputRequest(input.Outputs, context) }), + ...(input.Source !== undefined && + input.Source !== null && { source: serializeAws_restJson1SetSourceRequest(input.Source, context) }), + ...(input.SourceFailoverConfig !== undefined && + input.SourceFailoverConfig !== null && { + sourceFailoverConfig: serializeAws_restJson1FailoverConfig(input.SourceFailoverConfig, context), + }), + ...(input.Sources !== undefined && + input.Sources !== null && { sources: serializeAws_restJson1__listOfSetSourceRequest(input.Sources, context) }), + ...(input.VpcInterfaces !== undefined && + input.VpcInterfaces !== null && { + vpcInterfaces: serializeAws_restJson1__listOfVpcInterfaceRequest(input.VpcInterfaces, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -240,9 +242,7 @@ export const serializeAws_restJson1DeleteFlowCommand = async ( input: DeleteFlowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/flows/{FlowArn}"; if (input.FlowArn !== undefined) { const labelValue: string = input.FlowArn; @@ -270,9 +270,7 @@ export const serializeAws_restJson1DescribeFlowCommand = async ( input: DescribeFlowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/flows/{FlowArn}"; if (input.FlowArn !== undefined) { const labelValue: string = input.FlowArn; @@ -300,9 +298,7 @@ export const serializeAws_restJson1DescribeOfferingCommand = async ( input: DescribeOfferingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/offerings/{OfferingArn}"; if (input.OfferingArn !== undefined) { const labelValue: string = input.OfferingArn; @@ -330,9 +326,7 @@ export const serializeAws_restJson1DescribeReservationCommand = async ( input: DescribeReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/reservations/{ReservationArn}"; if (input.ReservationArn !== undefined) { const labelValue: string = input.ReservationArn; @@ -361,7 +355,7 @@ export const serializeAws_restJson1GrantFlowEntitlementsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/flows/{FlowArn}/entitlements"; if (input.FlowArn !== undefined) { @@ -375,9 +369,10 @@ export const serializeAws_restJson1GrantFlowEntitlementsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Entitlements !== undefined && { - entitlements: serializeAws_restJson1__listOfGrantEntitlementRequest(input.Entitlements, context), - }), + ...(input.Entitlements !== undefined && + input.Entitlements !== null && { + entitlements: serializeAws_restJson1__listOfGrantEntitlementRequest(input.Entitlements, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -395,9 +390,7 @@ export const serializeAws_restJson1ListEntitlementsCommand = async ( input: ListEntitlementsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/entitlements"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -421,9 +414,7 @@ export const serializeAws_restJson1ListFlowsCommand = async ( input: ListFlowsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/flows"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -447,9 +438,7 @@ export const serializeAws_restJson1ListOfferingsCommand = async ( input: ListOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/offerings"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -473,9 +462,7 @@ export const serializeAws_restJson1ListReservationsCommand = async ( input: ListReservationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/reservations"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -499,9 +486,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -530,7 +515,7 @@ export const serializeAws_restJson1PurchaseOfferingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/offerings/{OfferingArn}"; if (input.OfferingArn !== undefined) { @@ -544,8 +529,9 @@ export const serializeAws_restJson1PurchaseOfferingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ReservationName !== undefined && { reservationName: input.ReservationName }), - ...(input.Start !== undefined && { start: input.Start }), + ...(input.ReservationName !== undefined && + input.ReservationName !== null && { reservationName: input.ReservationName }), + ...(input.Start !== undefined && input.Start !== null && { start: input.Start }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -563,9 +549,7 @@ export const serializeAws_restJson1RemoveFlowOutputCommand = async ( input: RemoveFlowOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/flows/{FlowArn}/outputs/{OutputArn}"; if (input.FlowArn !== undefined) { const labelValue: string = input.FlowArn; @@ -602,9 +586,7 @@ export const serializeAws_restJson1RemoveFlowSourceCommand = async ( input: RemoveFlowSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/flows/{FlowArn}/source/{SourceArn}"; if (input.FlowArn !== undefined) { const labelValue: string = input.FlowArn; @@ -641,9 +623,7 @@ export const serializeAws_restJson1RemoveFlowVpcInterfaceCommand = async ( input: RemoveFlowVpcInterfaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/flows/{FlowArn}/vpcInterfaces/{VpcInterfaceName}"; if (input.FlowArn !== undefined) { const labelValue: string = input.FlowArn; @@ -680,9 +660,7 @@ export const serializeAws_restJson1RevokeFlowEntitlementCommand = async ( input: RevokeFlowEntitlementCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/flows/{FlowArn}/entitlements/{EntitlementArn}"; if (input.FlowArn !== undefined) { const labelValue: string = input.FlowArn; @@ -719,9 +697,7 @@ export const serializeAws_restJson1StartFlowCommand = async ( input: StartFlowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/flows/start/{FlowArn}"; if (input.FlowArn !== undefined) { const labelValue: string = input.FlowArn; @@ -749,9 +725,7 @@ export const serializeAws_restJson1StopFlowCommand = async ( input: StopFlowCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/flows/stop/{FlowArn}"; if (input.FlowArn !== undefined) { const labelValue: string = input.FlowArn; @@ -780,7 +754,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -794,7 +768,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -812,9 +787,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -847,7 +820,7 @@ export const serializeAws_restJson1UpdateFlowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/flows/{FlowArn}"; if (input.FlowArn !== undefined) { @@ -861,9 +834,10 @@ export const serializeAws_restJson1UpdateFlowCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.SourceFailoverConfig !== undefined && { - sourceFailoverConfig: serializeAws_restJson1UpdateFailoverConfig(input.SourceFailoverConfig, context), - }), + ...(input.SourceFailoverConfig !== undefined && + input.SourceFailoverConfig !== null && { + sourceFailoverConfig: serializeAws_restJson1UpdateFailoverConfig(input.SourceFailoverConfig, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -882,7 +856,7 @@ export const serializeAws_restJson1UpdateFlowEntitlementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/flows/{FlowArn}/entitlements/{EntitlementArn}"; if (input.EntitlementArn !== undefined) { @@ -905,14 +879,15 @@ export const serializeAws_restJson1UpdateFlowEntitlementCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1UpdateEncryption(input.Encryption, context), - }), - ...(input.EntitlementStatus !== undefined && { entitlementStatus: input.EntitlementStatus }), - ...(input.Subscribers !== undefined && { - subscribers: serializeAws_restJson1__listOf__string(input.Subscribers, context), - }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1UpdateEncryption(input.Encryption, context) }), + ...(input.EntitlementStatus !== undefined && + input.EntitlementStatus !== null && { entitlementStatus: input.EntitlementStatus }), + ...(input.Subscribers !== undefined && + input.Subscribers !== null && { + subscribers: serializeAws_restJson1__listOf__string(input.Subscribers, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -931,7 +906,7 @@ export const serializeAws_restJson1UpdateFlowOutputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/flows/{FlowArn}/outputs/{OutputArn}"; if (input.OutputArn !== undefined) { @@ -954,23 +929,25 @@ export const serializeAws_restJson1UpdateFlowOutputCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CidrAllowList !== undefined && { - cidrAllowList: serializeAws_restJson1__listOf__string(input.CidrAllowList, context), - }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Destination !== undefined && { destination: input.Destination }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1UpdateEncryption(input.Encryption, context), - }), - ...(input.MaxLatency !== undefined && { maxLatency: input.MaxLatency }), - ...(input.Port !== undefined && { port: input.Port }), - ...(input.Protocol !== undefined && { protocol: input.Protocol }), - ...(input.RemoteId !== undefined && { remoteId: input.RemoteId }), - ...(input.SmoothingLatency !== undefined && { smoothingLatency: input.SmoothingLatency }), - ...(input.StreamId !== undefined && { streamId: input.StreamId }), - ...(input.VpcInterfaceAttachment !== undefined && { - vpcInterfaceAttachment: serializeAws_restJson1VpcInterfaceAttachment(input.VpcInterfaceAttachment, context), - }), + ...(input.CidrAllowList !== undefined && + input.CidrAllowList !== null && { + cidrAllowList: serializeAws_restJson1__listOf__string(input.CidrAllowList, context), + }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Destination !== undefined && input.Destination !== null && { destination: input.Destination }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1UpdateEncryption(input.Encryption, context) }), + ...(input.MaxLatency !== undefined && input.MaxLatency !== null && { maxLatency: input.MaxLatency }), + ...(input.Port !== undefined && input.Port !== null && { port: input.Port }), + ...(input.Protocol !== undefined && input.Protocol !== null && { protocol: input.Protocol }), + ...(input.RemoteId !== undefined && input.RemoteId !== null && { remoteId: input.RemoteId }), + ...(input.SmoothingLatency !== undefined && + input.SmoothingLatency !== null && { smoothingLatency: input.SmoothingLatency }), + ...(input.StreamId !== undefined && input.StreamId !== null && { streamId: input.StreamId }), + ...(input.VpcInterfaceAttachment !== undefined && + input.VpcInterfaceAttachment !== null && { + vpcInterfaceAttachment: serializeAws_restJson1VpcInterfaceAttachment(input.VpcInterfaceAttachment, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -989,7 +966,7 @@ export const serializeAws_restJson1UpdateFlowSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/flows/{FlowArn}/source/{SourceArn}"; if (input.SourceArn !== undefined) { @@ -1012,18 +989,19 @@ export const serializeAws_restJson1UpdateFlowSourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Decryption !== undefined && { - decryption: serializeAws_restJson1UpdateEncryption(input.Decryption, context), - }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.EntitlementArn !== undefined && { entitlementArn: input.EntitlementArn }), - ...(input.IngestPort !== undefined && { ingestPort: input.IngestPort }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.MaxLatency !== undefined && { maxLatency: input.MaxLatency }), - ...(input.Protocol !== undefined && { protocol: input.Protocol }), - ...(input.StreamId !== undefined && { streamId: input.StreamId }), - ...(input.VpcInterfaceName !== undefined && { vpcInterfaceName: input.VpcInterfaceName }), - ...(input.WhitelistCidr !== undefined && { whitelistCidr: input.WhitelistCidr }), + ...(input.Decryption !== undefined && + input.Decryption !== null && { decryption: serializeAws_restJson1UpdateEncryption(input.Decryption, context) }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.EntitlementArn !== undefined && + input.EntitlementArn !== null && { entitlementArn: input.EntitlementArn }), + ...(input.IngestPort !== undefined && input.IngestPort !== null && { ingestPort: input.IngestPort }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.MaxLatency !== undefined && input.MaxLatency !== null && { maxLatency: input.MaxLatency }), + ...(input.Protocol !== undefined && input.Protocol !== null && { protocol: input.Protocol }), + ...(input.StreamId !== undefined && input.StreamId !== null && { streamId: input.StreamId }), + ...(input.VpcInterfaceName !== undefined && + input.VpcInterfaceName !== null && { vpcInterfaceName: input.VpcInterfaceName }), + ...(input.WhitelistCidr !== undefined && input.WhitelistCidr !== null && { whitelistCidr: input.WhitelistCidr }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3695,82 +3673,125 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async ( }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfAddOutputRequest = (input: AddOutputRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AddOutputRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AddOutputRequest(entry, context); + }); }; const serializeAws_restJson1__listOfGrantEntitlementRequest = ( input: GrantEntitlementRequest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1GrantEntitlementRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1GrantEntitlementRequest(entry, context); + }); }; const serializeAws_restJson1__listOfSetSourceRequest = (input: SetSourceRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SetSourceRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SetSourceRequest(entry, context); + }); }; const serializeAws_restJson1__listOfVpcInterfaceRequest = ( input: VpcInterfaceRequest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1VpcInterfaceRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1VpcInterfaceRequest(entry, context); + }); }; const serializeAws_restJson1__mapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AddOutputRequest = (input: AddOutputRequest, context: __SerdeContext): any => { return { - ...(input.CidrAllowList !== undefined && { - cidrAllowList: serializeAws_restJson1__listOf__string(input.CidrAllowList, context), - }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Destination !== undefined && { destination: input.Destination }), - ...(input.Encryption !== undefined && { encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), - ...(input.MaxLatency !== undefined && { maxLatency: input.MaxLatency }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Port !== undefined && { port: input.Port }), - ...(input.Protocol !== undefined && { protocol: input.Protocol }), - ...(input.RemoteId !== undefined && { remoteId: input.RemoteId }), - ...(input.SmoothingLatency !== undefined && { smoothingLatency: input.SmoothingLatency }), - ...(input.StreamId !== undefined && { streamId: input.StreamId }), - ...(input.VpcInterfaceAttachment !== undefined && { - vpcInterfaceAttachment: serializeAws_restJson1VpcInterfaceAttachment(input.VpcInterfaceAttachment, context), - }), + ...(input.CidrAllowList !== undefined && + input.CidrAllowList !== null && { + cidrAllowList: serializeAws_restJson1__listOf__string(input.CidrAllowList, context), + }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Destination !== undefined && input.Destination !== null && { destination: input.Destination }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), + ...(input.MaxLatency !== undefined && input.MaxLatency !== null && { maxLatency: input.MaxLatency }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Port !== undefined && input.Port !== null && { port: input.Port }), + ...(input.Protocol !== undefined && input.Protocol !== null && { protocol: input.Protocol }), + ...(input.RemoteId !== undefined && input.RemoteId !== null && { remoteId: input.RemoteId }), + ...(input.SmoothingLatency !== undefined && + input.SmoothingLatency !== null && { smoothingLatency: input.SmoothingLatency }), + ...(input.StreamId !== undefined && input.StreamId !== null && { streamId: input.StreamId }), + ...(input.VpcInterfaceAttachment !== undefined && + input.VpcInterfaceAttachment !== null && { + vpcInterfaceAttachment: serializeAws_restJson1VpcInterfaceAttachment(input.VpcInterfaceAttachment, context), + }), }; }; const serializeAws_restJson1Encryption = (input: Encryption, context: __SerdeContext): any => { return { - ...(input.Algorithm !== undefined && { algorithm: input.Algorithm }), - ...(input.ConstantInitializationVector !== undefined && { - constantInitializationVector: input.ConstantInitializationVector, - }), - ...(input.DeviceId !== undefined && { deviceId: input.DeviceId }), - ...(input.KeyType !== undefined && { keyType: input.KeyType }), - ...(input.Region !== undefined && { region: input.Region }), - ...(input.ResourceId !== undefined && { resourceId: input.ResourceId }), - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), - ...(input.SecretArn !== undefined && { secretArn: input.SecretArn }), - ...(input.Url !== undefined && { url: input.Url }), + ...(input.Algorithm !== undefined && input.Algorithm !== null && { algorithm: input.Algorithm }), + ...(input.ConstantInitializationVector !== undefined && + input.ConstantInitializationVector !== null && { + constantInitializationVector: input.ConstantInitializationVector, + }), + ...(input.DeviceId !== undefined && input.DeviceId !== null && { deviceId: input.DeviceId }), + ...(input.KeyType !== undefined && input.KeyType !== null && { keyType: input.KeyType }), + ...(input.Region !== undefined && input.Region !== null && { region: input.Region }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { resourceId: input.ResourceId }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { secretArn: input.SecretArn }), + ...(input.Url !== undefined && input.Url !== null && { url: input.Url }), }; }; const serializeAws_restJson1FailoverConfig = (input: FailoverConfig, context: __SerdeContext): any => { return { - ...(input.RecoveryWindow !== undefined && { recoveryWindow: input.RecoveryWindow }), - ...(input.State !== undefined && { state: input.State }), + ...(input.RecoveryWindow !== undefined && + input.RecoveryWindow !== null && { recoveryWindow: input.RecoveryWindow }), + ...(input.State !== undefined && input.State !== null && { state: input.State }), }; }; @@ -3779,122 +3800,198 @@ const serializeAws_restJson1GrantEntitlementRequest = ( context: __SerdeContext ): any => { return { - ...(input.DataTransferSubscriberFeePercent !== undefined && { - dataTransferSubscriberFeePercent: input.DataTransferSubscriberFeePercent, - }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Encryption !== undefined && { encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), - ...(input.EntitlementStatus !== undefined && { entitlementStatus: input.EntitlementStatus }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Subscribers !== undefined && { - subscribers: serializeAws_restJson1__listOf__string(input.Subscribers, context), - }), + ...(input.DataTransferSubscriberFeePercent !== undefined && + input.DataTransferSubscriberFeePercent !== null && { + dataTransferSubscriberFeePercent: input.DataTransferSubscriberFeePercent, + }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1Encryption(input.Encryption, context) }), + ...(input.EntitlementStatus !== undefined && + input.EntitlementStatus !== null && { entitlementStatus: input.EntitlementStatus }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Subscribers !== undefined && + input.Subscribers !== null && { + subscribers: serializeAws_restJson1__listOf__string(input.Subscribers, context), + }), }; }; const serializeAws_restJson1SetSourceRequest = (input: SetSourceRequest, context: __SerdeContext): any => { return { - ...(input.Decryption !== undefined && { decryption: serializeAws_restJson1Encryption(input.Decryption, context) }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.EntitlementArn !== undefined && { entitlementArn: input.EntitlementArn }), - ...(input.IngestPort !== undefined && { ingestPort: input.IngestPort }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.MaxLatency !== undefined && { maxLatency: input.MaxLatency }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Protocol !== undefined && { protocol: input.Protocol }), - ...(input.StreamId !== undefined && { streamId: input.StreamId }), - ...(input.VpcInterfaceName !== undefined && { vpcInterfaceName: input.VpcInterfaceName }), - ...(input.WhitelistCidr !== undefined && { whitelistCidr: input.WhitelistCidr }), + ...(input.Decryption !== undefined && + input.Decryption !== null && { decryption: serializeAws_restJson1Encryption(input.Decryption, context) }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.EntitlementArn !== undefined && + input.EntitlementArn !== null && { entitlementArn: input.EntitlementArn }), + ...(input.IngestPort !== undefined && input.IngestPort !== null && { ingestPort: input.IngestPort }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.MaxLatency !== undefined && input.MaxLatency !== null && { maxLatency: input.MaxLatency }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Protocol !== undefined && input.Protocol !== null && { protocol: input.Protocol }), + ...(input.StreamId !== undefined && input.StreamId !== null && { streamId: input.StreamId }), + ...(input.VpcInterfaceName !== undefined && + input.VpcInterfaceName !== null && { vpcInterfaceName: input.VpcInterfaceName }), + ...(input.WhitelistCidr !== undefined && input.WhitelistCidr !== null && { whitelistCidr: input.WhitelistCidr }), }; }; const serializeAws_restJson1UpdateEncryption = (input: UpdateEncryption, context: __SerdeContext): any => { return { - ...(input.Algorithm !== undefined && { algorithm: input.Algorithm }), - ...(input.ConstantInitializationVector !== undefined && { - constantInitializationVector: input.ConstantInitializationVector, - }), - ...(input.DeviceId !== undefined && { deviceId: input.DeviceId }), - ...(input.KeyType !== undefined && { keyType: input.KeyType }), - ...(input.Region !== undefined && { region: input.Region }), - ...(input.ResourceId !== undefined && { resourceId: input.ResourceId }), - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), - ...(input.SecretArn !== undefined && { secretArn: input.SecretArn }), - ...(input.Url !== undefined && { url: input.Url }), + ...(input.Algorithm !== undefined && input.Algorithm !== null && { algorithm: input.Algorithm }), + ...(input.ConstantInitializationVector !== undefined && + input.ConstantInitializationVector !== null && { + constantInitializationVector: input.ConstantInitializationVector, + }), + ...(input.DeviceId !== undefined && input.DeviceId !== null && { deviceId: input.DeviceId }), + ...(input.KeyType !== undefined && input.KeyType !== null && { keyType: input.KeyType }), + ...(input.Region !== undefined && input.Region !== null && { region: input.Region }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { resourceId: input.ResourceId }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { secretArn: input.SecretArn }), + ...(input.Url !== undefined && input.Url !== null && { url: input.Url }), }; }; const serializeAws_restJson1UpdateFailoverConfig = (input: UpdateFailoverConfig, context: __SerdeContext): any => { return { - ...(input.RecoveryWindow !== undefined && { recoveryWindow: input.RecoveryWindow }), - ...(input.State !== undefined && { state: input.State }), + ...(input.RecoveryWindow !== undefined && + input.RecoveryWindow !== null && { recoveryWindow: input.RecoveryWindow }), + ...(input.State !== undefined && input.State !== null && { state: input.State }), }; }; const serializeAws_restJson1VpcInterfaceAttachment = (input: VpcInterfaceAttachment, context: __SerdeContext): any => { return { - ...(input.VpcInterfaceName !== undefined && { vpcInterfaceName: input.VpcInterfaceName }), + ...(input.VpcInterfaceName !== undefined && + input.VpcInterfaceName !== null && { vpcInterfaceName: input.VpcInterfaceName }), }; }; const serializeAws_restJson1VpcInterfaceRequest = (input: VpcInterfaceRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { name: input.Name }), - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), - ...(input.SecurityGroupIds !== undefined && { - securityGroupIds: serializeAws_restJson1__listOf__string(input.SecurityGroupIds, context), - }), - ...(input.SubnetId !== undefined && { subnetId: input.SubnetId }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + securityGroupIds: serializeAws_restJson1__listOf__string(input.SecurityGroupIds, context), + }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { subnetId: input.SubnetId }), }; }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfEntitlement = (output: any, context: __SerdeContext): Entitlement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Entitlement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Entitlement(entry, context); + }); }; const deserializeAws_restJson1__listOfListedEntitlement = ( output: any, context: __SerdeContext ): ListedEntitlement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ListedEntitlement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ListedEntitlement(entry, context); + }); }; const deserializeAws_restJson1__listOfListedFlow = (output: any, context: __SerdeContext): ListedFlow[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ListedFlow(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ListedFlow(entry, context); + }); }; const deserializeAws_restJson1__listOfOffering = (output: any, context: __SerdeContext): Offering[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Offering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Offering(entry, context); + }); }; const deserializeAws_restJson1__listOfOutput = (output: any, context: __SerdeContext): Output[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Output(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Output(entry, context); + }); }; const deserializeAws_restJson1__listOfReservation = (output: any, context: __SerdeContext): Reservation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Reservation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Reservation(entry, context); + }); }; const deserializeAws_restJson1__listOfSource = (output: any, context: __SerdeContext): Source[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Source(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Source(entry, context); + }); }; const deserializeAws_restJson1__listOfVpcInterface = (output: any, context: __SerdeContext): VpcInterface[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VpcInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VpcInterface(entry, context); + }); }; const deserializeAws_restJson1__mapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Encryption = (output: any, context: __SerdeContext): Encryption => { @@ -4195,6 +4292,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-mediaconvert/protocols/Aws_restJson1.ts b/clients/client-mediaconvert/protocols/Aws_restJson1.ts index 5c4292650e75..79d8ed1c1040 100644 --- a/clients/client-mediaconvert/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconvert/protocols/Aws_restJson1.ts @@ -208,12 +208,12 @@ export const serializeAws_restJson1AssociateCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/certificates"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { arn: input.Arn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -231,9 +231,7 @@ export const serializeAws_restJson1CancelJobCommand = async ( input: CancelJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/jobs/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -262,30 +260,38 @@ export const serializeAws_restJson1CreateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/jobs"; let body: any; body = JSON.stringify({ - ...(input.AccelerationSettings !== undefined && { - accelerationSettings: serializeAws_restJson1AccelerationSettings(input.AccelerationSettings, context), - }), - ...(input.BillingTagsSource !== undefined && { billingTagsSource: input.BillingTagsSource }), + ...(input.AccelerationSettings !== undefined && + input.AccelerationSettings !== null && { + accelerationSettings: serializeAws_restJson1AccelerationSettings(input.AccelerationSettings, context), + }), + ...(input.BillingTagsSource !== undefined && + input.BillingTagsSource !== null && { billingTagsSource: input.BillingTagsSource }), clientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.HopDestinations !== undefined && { - hopDestinations: serializeAws_restJson1__listOfHopDestination(input.HopDestinations, context), - }), - ...(input.JobTemplate !== undefined && { jobTemplate: input.JobTemplate }), - ...(input.Priority !== undefined && { priority: input.Priority }), - ...(input.Queue !== undefined && { queue: input.Queue }), - ...(input.Role !== undefined && { role: input.Role }), - ...(input.Settings !== undefined && { settings: serializeAws_restJson1JobSettings(input.Settings, context) }), - ...(input.SimulateReservedQueue !== undefined && { simulateReservedQueue: input.SimulateReservedQueue }), - ...(input.StatusUpdateInterval !== undefined && { statusUpdateInterval: input.StatusUpdateInterval }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), - ...(input.UserMetadata !== undefined && { - userMetadata: serializeAws_restJson1__mapOf__string(input.UserMetadata, context), - }), + ...(input.HopDestinations !== undefined && + input.HopDestinations !== null && { + hopDestinations: serializeAws_restJson1__listOfHopDestination(input.HopDestinations, context), + }), + ...(input.JobTemplate !== undefined && input.JobTemplate !== null && { jobTemplate: input.JobTemplate }), + ...(input.Priority !== undefined && input.Priority !== null && { priority: input.Priority }), + ...(input.Queue !== undefined && input.Queue !== null && { queue: input.Queue }), + ...(input.Role !== undefined && input.Role !== null && { role: input.Role }), + ...(input.Settings !== undefined && + input.Settings !== null && { settings: serializeAws_restJson1JobSettings(input.Settings, context) }), + ...(input.SimulateReservedQueue !== undefined && + input.SimulateReservedQueue !== null && { simulateReservedQueue: input.SimulateReservedQueue }), + ...(input.StatusUpdateInterval !== undefined && + input.StatusUpdateInterval !== null && { statusUpdateInterval: input.StatusUpdateInterval }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.UserMetadata !== undefined && + input.UserMetadata !== null && { + userMetadata: serializeAws_restJson1__mapOf__string(input.UserMetadata, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -304,27 +310,30 @@ export const serializeAws_restJson1CreateJobTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/jobTemplates"; let body: any; body = JSON.stringify({ - ...(input.AccelerationSettings !== undefined && { - accelerationSettings: serializeAws_restJson1AccelerationSettings(input.AccelerationSettings, context), - }), - ...(input.Category !== undefined && { category: input.Category }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.HopDestinations !== undefined && { - hopDestinations: serializeAws_restJson1__listOfHopDestination(input.HopDestinations, context), - }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Priority !== undefined && { priority: input.Priority }), - ...(input.Queue !== undefined && { queue: input.Queue }), - ...(input.Settings !== undefined && { - settings: serializeAws_restJson1JobTemplateSettings(input.Settings, context), - }), - ...(input.StatusUpdateInterval !== undefined && { statusUpdateInterval: input.StatusUpdateInterval }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.AccelerationSettings !== undefined && + input.AccelerationSettings !== null && { + accelerationSettings: serializeAws_restJson1AccelerationSettings(input.AccelerationSettings, context), + }), + ...(input.Category !== undefined && input.Category !== null && { category: input.Category }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.HopDestinations !== undefined && + input.HopDestinations !== null && { + hopDestinations: serializeAws_restJson1__listOfHopDestination(input.HopDestinations, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Priority !== undefined && input.Priority !== null && { priority: input.Priority }), + ...(input.Queue !== undefined && input.Queue !== null && { queue: input.Queue }), + ...(input.Settings !== undefined && + input.Settings !== null && { settings: serializeAws_restJson1JobTemplateSettings(input.Settings, context) }), + ...(input.StatusUpdateInterval !== undefined && + input.StatusUpdateInterval !== null && { statusUpdateInterval: input.StatusUpdateInterval }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -343,16 +352,18 @@ export const serializeAws_restJson1CreatePresetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/presets"; let body: any; body = JSON.stringify({ - ...(input.Category !== undefined && { category: input.Category }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Settings !== undefined && { settings: serializeAws_restJson1PresetSettings(input.Settings, context) }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Category !== undefined && input.Category !== null && { category: input.Category }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Settings !== undefined && + input.Settings !== null && { settings: serializeAws_restJson1PresetSettings(input.Settings, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -371,19 +382,21 @@ export const serializeAws_restJson1CreateQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/queues"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.PricingPlan !== undefined && { pricingPlan: input.PricingPlan }), - ...(input.ReservationPlanSettings !== undefined && { - reservationPlanSettings: serializeAws_restJson1ReservationPlanSettings(input.ReservationPlanSettings, context), - }), - ...(input.Status !== undefined && { status: input.Status }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.PricingPlan !== undefined && input.PricingPlan !== null && { pricingPlan: input.PricingPlan }), + ...(input.ReservationPlanSettings !== undefined && + input.ReservationPlanSettings !== null && { + reservationPlanSettings: serializeAws_restJson1ReservationPlanSettings(input.ReservationPlanSettings, context), + }), + ...(input.Status !== undefined && input.Status !== null && { status: input.Status }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -401,9 +414,7 @@ export const serializeAws_restJson1DeleteJobTemplateCommand = async ( input: DeleteJobTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/jobTemplates/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -431,9 +442,7 @@ export const serializeAws_restJson1DeletePresetCommand = async ( input: DeletePresetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/presets/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -461,9 +470,7 @@ export const serializeAws_restJson1DeleteQueueCommand = async ( input: DeleteQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/queues/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -492,14 +499,14 @@ export const serializeAws_restJson1DescribeEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/endpoints"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { maxResults: input.MaxResults }), - ...(input.Mode !== undefined && { mode: input.Mode }), - ...(input.NextToken !== undefined && { nextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { maxResults: input.MaxResults }), + ...(input.Mode !== undefined && input.Mode !== null && { mode: input.Mode }), + ...(input.NextToken !== undefined && input.NextToken !== null && { nextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -517,9 +524,7 @@ export const serializeAws_restJson1DisassociateCertificateCommand = async ( input: DisassociateCertificateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/certificates/{Arn}"; if (input.Arn !== undefined) { const labelValue: string = input.Arn; @@ -547,9 +552,7 @@ export const serializeAws_restJson1GetJobCommand = async ( input: GetJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/jobs/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -577,9 +580,7 @@ export const serializeAws_restJson1GetJobTemplateCommand = async ( input: GetJobTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/jobTemplates/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -607,9 +608,7 @@ export const serializeAws_restJson1GetPresetCommand = async ( input: GetPresetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/presets/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -637,9 +636,7 @@ export const serializeAws_restJson1GetQueueCommand = async ( input: GetQueueCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/queues/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -667,9 +664,7 @@ export const serializeAws_restJson1ListJobsCommand = async ( input: ListJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/jobs"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -696,9 +691,7 @@ export const serializeAws_restJson1ListJobTemplatesCommand = async ( input: ListJobTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/jobTemplates"; const query: any = { ...(input.Category !== undefined && { category: input.Category }), @@ -725,9 +718,7 @@ export const serializeAws_restJson1ListPresetsCommand = async ( input: ListPresetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/presets"; const query: any = { ...(input.Category !== undefined && { category: input.Category }), @@ -754,9 +745,7 @@ export const serializeAws_restJson1ListQueuesCommand = async ( input: ListQueuesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/queues"; const query: any = { ...(input.ListBy !== undefined && { listBy: input.ListBy }), @@ -782,9 +771,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2017-08-29/tags/{Arn}"; if (input.Arn !== undefined) { const labelValue: string = input.Arn; @@ -813,13 +800,14 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/tags"; let body: any; body = JSON.stringify({ - ...(input.Arn !== undefined && { arn: input.Arn }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { arn: input.Arn }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -838,7 +826,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/tags/{Arn}"; if (input.Arn !== undefined) { @@ -852,7 +840,8 @@ export const serializeAws_restJson1UntagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TagKeys !== undefined && { tagKeys: serializeAws_restJson1__listOf__string(input.TagKeys, context) }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { tagKeys: serializeAws_restJson1__listOf__string(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -871,7 +860,7 @@ export const serializeAws_restJson1UpdateJobTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/jobTemplates/{Name}"; if (input.Name !== undefined) { @@ -885,20 +874,22 @@ export const serializeAws_restJson1UpdateJobTemplateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AccelerationSettings !== undefined && { - accelerationSettings: serializeAws_restJson1AccelerationSettings(input.AccelerationSettings, context), - }), - ...(input.Category !== undefined && { category: input.Category }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.HopDestinations !== undefined && { - hopDestinations: serializeAws_restJson1__listOfHopDestination(input.HopDestinations, context), - }), - ...(input.Priority !== undefined && { priority: input.Priority }), - ...(input.Queue !== undefined && { queue: input.Queue }), - ...(input.Settings !== undefined && { - settings: serializeAws_restJson1JobTemplateSettings(input.Settings, context), - }), - ...(input.StatusUpdateInterval !== undefined && { statusUpdateInterval: input.StatusUpdateInterval }), + ...(input.AccelerationSettings !== undefined && + input.AccelerationSettings !== null && { + accelerationSettings: serializeAws_restJson1AccelerationSettings(input.AccelerationSettings, context), + }), + ...(input.Category !== undefined && input.Category !== null && { category: input.Category }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.HopDestinations !== undefined && + input.HopDestinations !== null && { + hopDestinations: serializeAws_restJson1__listOfHopDestination(input.HopDestinations, context), + }), + ...(input.Priority !== undefined && input.Priority !== null && { priority: input.Priority }), + ...(input.Queue !== undefined && input.Queue !== null && { queue: input.Queue }), + ...(input.Settings !== undefined && + input.Settings !== null && { settings: serializeAws_restJson1JobTemplateSettings(input.Settings, context) }), + ...(input.StatusUpdateInterval !== undefined && + input.StatusUpdateInterval !== null && { statusUpdateInterval: input.StatusUpdateInterval }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -917,7 +908,7 @@ export const serializeAws_restJson1UpdatePresetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/presets/{Name}"; if (input.Name !== undefined) { @@ -931,9 +922,10 @@ export const serializeAws_restJson1UpdatePresetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Category !== undefined && { category: input.Category }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Settings !== undefined && { settings: serializeAws_restJson1PresetSettings(input.Settings, context) }), + ...(input.Category !== undefined && input.Category !== null && { category: input.Category }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Settings !== undefined && + input.Settings !== null && { settings: serializeAws_restJson1PresetSettings(input.Settings, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -952,7 +944,7 @@ export const serializeAws_restJson1UpdateQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/2017-08-29/queues/{Name}"; if (input.Name !== undefined) { @@ -966,11 +958,12 @@ export const serializeAws_restJson1UpdateQueueCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { description: input.Description }), - ...(input.ReservationPlanSettings !== undefined && { - reservationPlanSettings: serializeAws_restJson1ReservationPlanSettings(input.ReservationPlanSettings, context), - }), - ...(input.Status !== undefined && { status: input.Status }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.ReservationPlanSettings !== undefined && + input.ReservationPlanSettings !== null && { + reservationPlanSettings: serializeAws_restJson1ReservationPlanSettings(input.ReservationPlanSettings, context), + }), + ...(input.Status !== undefined && input.Status !== null && { status: input.Status }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3450,237 +3443,438 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async ( }; const serializeAws_restJson1__listOf__integerMin1Max2147483647 = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOf__integerMin32Max8182 = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOf__integerMinNegative60Max6 = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOf__stringMin1 = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12 = ( input: string[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOf__stringPattern09aFAF809aFAF409aFAF409aFAF409aFAF12 = ( input: string[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOf__stringPatternS3ASSETMAPXml = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfAudioDescription = (input: AudioDescription[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AudioDescription(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AudioDescription(entry, context); + }); }; const serializeAws_restJson1__listOfCaptionDescription = ( input: CaptionDescription[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CaptionDescription(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CaptionDescription(entry, context); + }); }; const serializeAws_restJson1__listOfCaptionDescriptionPreset = ( input: CaptionDescriptionPreset[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CaptionDescriptionPreset(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CaptionDescriptionPreset(entry, context); + }); }; const serializeAws_restJson1__listOfCmafAdditionalManifest = ( input: CmafAdditionalManifest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CmafAdditionalManifest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CmafAdditionalManifest(entry, context); + }); }; const serializeAws_restJson1__listOfDashAdditionalManifest = ( input: DashAdditionalManifest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DashAdditionalManifest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DashAdditionalManifest(entry, context); + }); }; const serializeAws_restJson1__listOfHlsAdditionalManifest = ( input: HlsAdditionalManifest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1HlsAdditionalManifest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1HlsAdditionalManifest(entry, context); + }); }; const serializeAws_restJson1__listOfHlsAdMarkers = (input: (HlsAdMarkers | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfHlsCaptionLanguageMapping = ( input: HlsCaptionLanguageMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1HlsCaptionLanguageMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1HlsCaptionLanguageMapping(entry, context); + }); }; const serializeAws_restJson1__listOfHopDestination = (input: HopDestination[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1HopDestination(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1HopDestination(entry, context); + }); }; const serializeAws_restJson1__listOfId3Insertion = (input: Id3Insertion[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Id3Insertion(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Id3Insertion(entry, context); + }); }; const serializeAws_restJson1__listOfInput = (input: Input[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Input(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Input(entry, context); + }); }; const serializeAws_restJson1__listOfInputClipping = (input: InputClipping[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1InputClipping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputClipping(entry, context); + }); }; const serializeAws_restJson1__listOfInputTemplate = (input: InputTemplate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1InputTemplate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputTemplate(entry, context); + }); }; const serializeAws_restJson1__listOfInsertableImage = (input: InsertableImage[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1InsertableImage(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InsertableImage(entry, context); + }); }; const serializeAws_restJson1__listOfMsSmoothAdditionalManifest = ( input: MsSmoothAdditionalManifest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1MsSmoothAdditionalManifest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MsSmoothAdditionalManifest(entry, context); + }); }; const serializeAws_restJson1__listOfOutput = (input: Output[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Output(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Output(entry, context); + }); }; const serializeAws_restJson1__listOfOutputChannelMapping = ( input: OutputChannelMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1OutputChannelMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1OutputChannelMapping(entry, context); + }); }; const serializeAws_restJson1__listOfOutputGroup = (input: OutputGroup[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1OutputGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1OutputGroup(entry, context); + }); }; const serializeAws_restJson1__listOfTeletextPageType = ( input: (TeletextPageType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__mapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1__mapOfAudioSelector = ( input: { [key: string]: AudioSelector }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AudioSelector }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AudioSelector }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1AudioSelector(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1__mapOfAudioSelectorGroup = ( input: { [key: string]: AudioSelectorGroup }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AudioSelectorGroup }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AudioSelectorGroup }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1AudioSelectorGroup(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1__mapOfCaptionSelector = ( input: { [key: string]: CaptionSelector }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: CaptionSelector }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: CaptionSelector }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1CaptionSelector(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AacSettings = (input: AacSettings, context: __SerdeContext): any => { return { - ...(input.AudioDescriptionBroadcasterMix !== undefined && { - audioDescriptionBroadcasterMix: input.AudioDescriptionBroadcasterMix, - }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.CodecProfile !== undefined && { codecProfile: input.CodecProfile }), - ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), - ...(input.RawFormat !== undefined && { rawFormat: input.RawFormat }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), - ...(input.Specification !== undefined && { specification: input.Specification }), - ...(input.VbrQuality !== undefined && { vbrQuality: input.VbrQuality }), + ...(input.AudioDescriptionBroadcasterMix !== undefined && + input.AudioDescriptionBroadcasterMix !== null && { + audioDescriptionBroadcasterMix: input.AudioDescriptionBroadcasterMix, + }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.CodecProfile !== undefined && input.CodecProfile !== null && { codecProfile: input.CodecProfile }), + ...(input.CodingMode !== undefined && input.CodingMode !== null && { codingMode: input.CodingMode }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), + ...(input.RawFormat !== undefined && input.RawFormat !== null && { rawFormat: input.RawFormat }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), + ...(input.Specification !== undefined && input.Specification !== null && { specification: input.Specification }), + ...(input.VbrQuality !== undefined && input.VbrQuality !== null && { vbrQuality: input.VbrQuality }), }; }; const serializeAws_restJson1Ac3Settings = (input: Ac3Settings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.BitstreamMode !== undefined && { bitstreamMode: input.BitstreamMode }), - ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), - ...(input.Dialnorm !== undefined && { dialnorm: input.Dialnorm }), - ...(input.DynamicRangeCompressionProfile !== undefined && { - dynamicRangeCompressionProfile: input.DynamicRangeCompressionProfile, - }), - ...(input.LfeFilter !== undefined && { lfeFilter: input.LfeFilter }), - ...(input.MetadataControl !== undefined && { metadataControl: input.MetadataControl }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.BitstreamMode !== undefined && input.BitstreamMode !== null && { bitstreamMode: input.BitstreamMode }), + ...(input.CodingMode !== undefined && input.CodingMode !== null && { codingMode: input.CodingMode }), + ...(input.Dialnorm !== undefined && input.Dialnorm !== null && { dialnorm: input.Dialnorm }), + ...(input.DynamicRangeCompressionProfile !== undefined && + input.DynamicRangeCompressionProfile !== null && { + dynamicRangeCompressionProfile: input.DynamicRangeCompressionProfile, + }), + ...(input.LfeFilter !== undefined && input.LfeFilter !== null && { lfeFilter: input.LfeFilter }), + ...(input.MetadataControl !== undefined && + input.MetadataControl !== null && { metadataControl: input.MetadataControl }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), }; }; const serializeAws_restJson1AccelerationSettings = (input: AccelerationSettings, context: __SerdeContext): any => { return { - ...(input.Mode !== undefined && { mode: input.Mode }), + ...(input.Mode !== undefined && input.Mode !== null && { mode: input.Mode }), }; }; const serializeAws_restJson1AiffSettings = (input: AiffSettings, context: __SerdeContext): any => { return { - ...(input.BitDepth !== undefined && { bitDepth: input.BitDepth }), - ...(input.Channels !== undefined && { channels: input.Channels }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), + ...(input.BitDepth !== undefined && input.BitDepth !== null && { bitDepth: input.BitDepth }), + ...(input.Channels !== undefined && input.Channels !== null && { channels: input.Channels }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), }; }; @@ -3689,11 +3883,14 @@ const serializeAws_restJson1AncillarySourceSettings = ( context: __SerdeContext ): any => { return { - ...(input.Convert608To708 !== undefined && { convert608To708: input.Convert608To708 }), - ...(input.SourceAncillaryChannelNumber !== undefined && { - sourceAncillaryChannelNumber: input.SourceAncillaryChannelNumber, - }), - ...(input.TerminateCaptions !== undefined && { terminateCaptions: input.TerminateCaptions }), + ...(input.Convert608To708 !== undefined && + input.Convert608To708 !== null && { convert608To708: input.Convert608To708 }), + ...(input.SourceAncillaryChannelNumber !== undefined && + input.SourceAncillaryChannelNumber !== null && { + sourceAncillaryChannelNumber: input.SourceAncillaryChannelNumber, + }), + ...(input.TerminateCaptions !== undefined && + input.TerminateCaptions !== null && { terminateCaptions: input.TerminateCaptions }), }; }; @@ -3702,73 +3899,75 @@ const serializeAws_restJson1AudioChannelTaggingSettings = ( context: __SerdeContext ): any => { return { - ...(input.ChannelTag !== undefined && { channelTag: input.ChannelTag }), + ...(input.ChannelTag !== undefined && input.ChannelTag !== null && { channelTag: input.ChannelTag }), }; }; const serializeAws_restJson1AudioCodecSettings = (input: AudioCodecSettings, context: __SerdeContext): any => { return { - ...(input.AacSettings !== undefined && { - aacSettings: serializeAws_restJson1AacSettings(input.AacSettings, context), - }), - ...(input.Ac3Settings !== undefined && { - ac3Settings: serializeAws_restJson1Ac3Settings(input.Ac3Settings, context), - }), - ...(input.AiffSettings !== undefined && { - aiffSettings: serializeAws_restJson1AiffSettings(input.AiffSettings, context), - }), - ...(input.Codec !== undefined && { codec: input.Codec }), - ...(input.Eac3AtmosSettings !== undefined && { - eac3AtmosSettings: serializeAws_restJson1Eac3AtmosSettings(input.Eac3AtmosSettings, context), - }), - ...(input.Eac3Settings !== undefined && { - eac3Settings: serializeAws_restJson1Eac3Settings(input.Eac3Settings, context), - }), - ...(input.Mp2Settings !== undefined && { - mp2Settings: serializeAws_restJson1Mp2Settings(input.Mp2Settings, context), - }), - ...(input.Mp3Settings !== undefined && { - mp3Settings: serializeAws_restJson1Mp3Settings(input.Mp3Settings, context), - }), - ...(input.OpusSettings !== undefined && { - opusSettings: serializeAws_restJson1OpusSettings(input.OpusSettings, context), - }), - ...(input.VorbisSettings !== undefined && { - vorbisSettings: serializeAws_restJson1VorbisSettings(input.VorbisSettings, context), - }), - ...(input.WavSettings !== undefined && { - wavSettings: serializeAws_restJson1WavSettings(input.WavSettings, context), - }), + ...(input.AacSettings !== undefined && + input.AacSettings !== null && { aacSettings: serializeAws_restJson1AacSettings(input.AacSettings, context) }), + ...(input.Ac3Settings !== undefined && + input.Ac3Settings !== null && { ac3Settings: serializeAws_restJson1Ac3Settings(input.Ac3Settings, context) }), + ...(input.AiffSettings !== undefined && + input.AiffSettings !== null && { aiffSettings: serializeAws_restJson1AiffSettings(input.AiffSettings, context) }), + ...(input.Codec !== undefined && input.Codec !== null && { codec: input.Codec }), + ...(input.Eac3AtmosSettings !== undefined && + input.Eac3AtmosSettings !== null && { + eac3AtmosSettings: serializeAws_restJson1Eac3AtmosSettings(input.Eac3AtmosSettings, context), + }), + ...(input.Eac3Settings !== undefined && + input.Eac3Settings !== null && { eac3Settings: serializeAws_restJson1Eac3Settings(input.Eac3Settings, context) }), + ...(input.Mp2Settings !== undefined && + input.Mp2Settings !== null && { mp2Settings: serializeAws_restJson1Mp2Settings(input.Mp2Settings, context) }), + ...(input.Mp3Settings !== undefined && + input.Mp3Settings !== null && { mp3Settings: serializeAws_restJson1Mp3Settings(input.Mp3Settings, context) }), + ...(input.OpusSettings !== undefined && + input.OpusSettings !== null && { opusSettings: serializeAws_restJson1OpusSettings(input.OpusSettings, context) }), + ...(input.VorbisSettings !== undefined && + input.VorbisSettings !== null && { + vorbisSettings: serializeAws_restJson1VorbisSettings(input.VorbisSettings, context), + }), + ...(input.WavSettings !== undefined && + input.WavSettings !== null && { wavSettings: serializeAws_restJson1WavSettings(input.WavSettings, context) }), }; }; const serializeAws_restJson1AudioDescription = (input: AudioDescription, context: __SerdeContext): any => { return { - ...(input.AudioChannelTaggingSettings !== undefined && { - audioChannelTaggingSettings: serializeAws_restJson1AudioChannelTaggingSettings( - input.AudioChannelTaggingSettings, - context - ), - }), - ...(input.AudioNormalizationSettings !== undefined && { - audioNormalizationSettings: serializeAws_restJson1AudioNormalizationSettings( - input.AudioNormalizationSettings, - context - ), - }), - ...(input.AudioSourceName !== undefined && { audioSourceName: input.AudioSourceName }), - ...(input.AudioType !== undefined && { audioType: input.AudioType }), - ...(input.AudioTypeControl !== undefined && { audioTypeControl: input.AudioTypeControl }), - ...(input.CodecSettings !== undefined && { - codecSettings: serializeAws_restJson1AudioCodecSettings(input.CodecSettings, context), - }), - ...(input.CustomLanguageCode !== undefined && { customLanguageCode: input.CustomLanguageCode }), - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.LanguageCodeControl !== undefined && { languageCodeControl: input.LanguageCodeControl }), - ...(input.RemixSettings !== undefined && { - remixSettings: serializeAws_restJson1RemixSettings(input.RemixSettings, context), - }), - ...(input.StreamName !== undefined && { streamName: input.StreamName }), + ...(input.AudioChannelTaggingSettings !== undefined && + input.AudioChannelTaggingSettings !== null && { + audioChannelTaggingSettings: serializeAws_restJson1AudioChannelTaggingSettings( + input.AudioChannelTaggingSettings, + context + ), + }), + ...(input.AudioNormalizationSettings !== undefined && + input.AudioNormalizationSettings !== null && { + audioNormalizationSettings: serializeAws_restJson1AudioNormalizationSettings( + input.AudioNormalizationSettings, + context + ), + }), + ...(input.AudioSourceName !== undefined && + input.AudioSourceName !== null && { audioSourceName: input.AudioSourceName }), + ...(input.AudioType !== undefined && input.AudioType !== null && { audioType: input.AudioType }), + ...(input.AudioTypeControl !== undefined && + input.AudioTypeControl !== null && { audioTypeControl: input.AudioTypeControl }), + ...(input.CodecSettings !== undefined && + input.CodecSettings !== null && { + codecSettings: serializeAws_restJson1AudioCodecSettings(input.CodecSettings, context), + }), + ...(input.CustomLanguageCode !== undefined && + input.CustomLanguageCode !== null && { customLanguageCode: input.CustomLanguageCode }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.LanguageCodeControl !== undefined && + input.LanguageCodeControl !== null && { languageCodeControl: input.LanguageCodeControl }), + ...(input.RemixSettings !== undefined && + input.RemixSettings !== null && { + remixSettings: serializeAws_restJson1RemixSettings(input.RemixSettings, context), + }), + ...(input.StreamName !== undefined && input.StreamName !== null && { streamName: input.StreamName }), }; }; @@ -3777,49 +3976,59 @@ const serializeAws_restJson1AudioNormalizationSettings = ( context: __SerdeContext ): any => { return { - ...(input.Algorithm !== undefined && { algorithm: input.Algorithm }), - ...(input.AlgorithmControl !== undefined && { algorithmControl: input.AlgorithmControl }), - ...(input.CorrectionGateLevel !== undefined && { correctionGateLevel: input.CorrectionGateLevel }), - ...(input.LoudnessLogging !== undefined && { loudnessLogging: input.LoudnessLogging }), - ...(input.PeakCalculation !== undefined && { peakCalculation: input.PeakCalculation }), - ...(input.TargetLkfs !== undefined && { targetLkfs: input.TargetLkfs }), + ...(input.Algorithm !== undefined && input.Algorithm !== null && { algorithm: input.Algorithm }), + ...(input.AlgorithmControl !== undefined && + input.AlgorithmControl !== null && { algorithmControl: input.AlgorithmControl }), + ...(input.CorrectionGateLevel !== undefined && + input.CorrectionGateLevel !== null && { correctionGateLevel: input.CorrectionGateLevel }), + ...(input.LoudnessLogging !== undefined && + input.LoudnessLogging !== null && { loudnessLogging: input.LoudnessLogging }), + ...(input.PeakCalculation !== undefined && + input.PeakCalculation !== null && { peakCalculation: input.PeakCalculation }), + ...(input.TargetLkfs !== undefined && input.TargetLkfs !== null && { targetLkfs: input.TargetLkfs }), }; }; const serializeAws_restJson1AudioSelector = (input: AudioSelector, context: __SerdeContext): any => { return { - ...(input.CustomLanguageCode !== undefined && { customLanguageCode: input.CustomLanguageCode }), - ...(input.DefaultSelection !== undefined && { defaultSelection: input.DefaultSelection }), - ...(input.ExternalAudioFileInput !== undefined && { externalAudioFileInput: input.ExternalAudioFileInput }), - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.Offset !== undefined && { offset: input.Offset }), - ...(input.Pids !== undefined && { - pids: serializeAws_restJson1__listOf__integerMin1Max2147483647(input.Pids, context), - }), - ...(input.ProgramSelection !== undefined && { programSelection: input.ProgramSelection }), - ...(input.RemixSettings !== undefined && { - remixSettings: serializeAws_restJson1RemixSettings(input.RemixSettings, context), - }), - ...(input.SelectorType !== undefined && { selectorType: input.SelectorType }), - ...(input.Tracks !== undefined && { - tracks: serializeAws_restJson1__listOf__integerMin1Max2147483647(input.Tracks, context), - }), + ...(input.CustomLanguageCode !== undefined && + input.CustomLanguageCode !== null && { customLanguageCode: input.CustomLanguageCode }), + ...(input.DefaultSelection !== undefined && + input.DefaultSelection !== null && { defaultSelection: input.DefaultSelection }), + ...(input.ExternalAudioFileInput !== undefined && + input.ExternalAudioFileInput !== null && { externalAudioFileInput: input.ExternalAudioFileInput }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.Offset !== undefined && input.Offset !== null && { offset: input.Offset }), + ...(input.Pids !== undefined && + input.Pids !== null && { pids: serializeAws_restJson1__listOf__integerMin1Max2147483647(input.Pids, context) }), + ...(input.ProgramSelection !== undefined && + input.ProgramSelection !== null && { programSelection: input.ProgramSelection }), + ...(input.RemixSettings !== undefined && + input.RemixSettings !== null && { + remixSettings: serializeAws_restJson1RemixSettings(input.RemixSettings, context), + }), + ...(input.SelectorType !== undefined && input.SelectorType !== null && { selectorType: input.SelectorType }), + ...(input.Tracks !== undefined && + input.Tracks !== null && { + tracks: serializeAws_restJson1__listOf__integerMin1Max2147483647(input.Tracks, context), + }), }; }; const serializeAws_restJson1AudioSelectorGroup = (input: AudioSelectorGroup, context: __SerdeContext): any => { return { - ...(input.AudioSelectorNames !== undefined && { - audioSelectorNames: serializeAws_restJson1__listOf__stringMin1(input.AudioSelectorNames, context), - }), + ...(input.AudioSelectorNames !== undefined && + input.AudioSelectorNames !== null && { + audioSelectorNames: serializeAws_restJson1__listOf__stringMin1(input.AudioSelectorNames, context), + }), }; }; const serializeAws_restJson1AutomatedAbrSettings = (input: AutomatedAbrSettings, context: __SerdeContext): any => { return { - ...(input.MaxAbrBitrate !== undefined && { maxAbrBitrate: input.MaxAbrBitrate }), - ...(input.MaxRenditions !== undefined && { maxRenditions: input.MaxRenditions }), - ...(input.MinAbrBitrate !== undefined && { minAbrBitrate: input.MinAbrBitrate }), + ...(input.MaxAbrBitrate !== undefined && input.MaxAbrBitrate !== null && { maxAbrBitrate: input.MaxAbrBitrate }), + ...(input.MaxRenditions !== undefined && input.MaxRenditions !== null && { maxRenditions: input.MaxRenditions }), + ...(input.MinAbrBitrate !== undefined && input.MinAbrBitrate !== null && { minAbrBitrate: input.MinAbrBitrate }), }; }; @@ -3828,62 +4037,77 @@ const serializeAws_restJson1AutomatedEncodingSettings = ( context: __SerdeContext ): any => { return { - ...(input.AbrSettings !== undefined && { - abrSettings: serializeAws_restJson1AutomatedAbrSettings(input.AbrSettings, context), - }), + ...(input.AbrSettings !== undefined && + input.AbrSettings !== null && { + abrSettings: serializeAws_restJson1AutomatedAbrSettings(input.AbrSettings, context), + }), }; }; const serializeAws_restJson1Av1QvbrSettings = (input: Av1QvbrSettings, context: __SerdeContext): any => { return { - ...(input.QvbrQualityLevel !== undefined && { qvbrQualityLevel: input.QvbrQualityLevel }), - ...(input.QvbrQualityLevelFineTune !== undefined && { qvbrQualityLevelFineTune: input.QvbrQualityLevelFineTune }), + ...(input.QvbrQualityLevel !== undefined && + input.QvbrQualityLevel !== null && { qvbrQualityLevel: input.QvbrQualityLevel }), + ...(input.QvbrQualityLevelFineTune !== undefined && + input.QvbrQualityLevelFineTune !== null && { qvbrQualityLevelFineTune: input.QvbrQualityLevelFineTune }), }; }; const serializeAws_restJson1Av1Settings = (input: Av1Settings, context: __SerdeContext): any => { return { - ...(input.AdaptiveQuantization !== undefined && { adaptiveQuantization: input.AdaptiveQuantization }), - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateConversionAlgorithm !== undefined && { - framerateConversionAlgorithm: input.FramerateConversionAlgorithm, - }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.GopSize !== undefined && { gopSize: input.GopSize }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.NumberBFramesBetweenReferenceFrames !== undefined && { - numberBFramesBetweenReferenceFrames: input.NumberBFramesBetweenReferenceFrames, - }), - ...(input.QvbrSettings !== undefined && { - qvbrSettings: serializeAws_restJson1Av1QvbrSettings(input.QvbrSettings, context), - }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), - ...(input.Slices !== undefined && { slices: input.Slices }), - ...(input.SpatialAdaptiveQuantization !== undefined && { - spatialAdaptiveQuantization: input.SpatialAdaptiveQuantization, - }), + ...(input.AdaptiveQuantization !== undefined && + input.AdaptiveQuantization !== null && { adaptiveQuantization: input.AdaptiveQuantization }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateConversionAlgorithm !== undefined && + input.FramerateConversionAlgorithm !== null && { + framerateConversionAlgorithm: input.FramerateConversionAlgorithm, + }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.GopSize !== undefined && input.GopSize !== null && { gopSize: input.GopSize }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.NumberBFramesBetweenReferenceFrames !== undefined && + input.NumberBFramesBetweenReferenceFrames !== null && { + numberBFramesBetweenReferenceFrames: input.NumberBFramesBetweenReferenceFrames, + }), + ...(input.QvbrSettings !== undefined && + input.QvbrSettings !== null && { + qvbrSettings: serializeAws_restJson1Av1QvbrSettings(input.QvbrSettings, context), + }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), + ...(input.Slices !== undefined && input.Slices !== null && { slices: input.Slices }), + ...(input.SpatialAdaptiveQuantization !== undefined && + input.SpatialAdaptiveQuantization !== null && { spatialAdaptiveQuantization: input.SpatialAdaptiveQuantization }), }; }; const serializeAws_restJson1AvailBlanking = (input: AvailBlanking, context: __SerdeContext): any => { return { - ...(input.AvailBlankingImage !== undefined && { availBlankingImage: input.AvailBlankingImage }), + ...(input.AvailBlankingImage !== undefined && + input.AvailBlankingImage !== null && { availBlankingImage: input.AvailBlankingImage }), }; }; const serializeAws_restJson1AvcIntraSettings = (input: AvcIntraSettings, context: __SerdeContext): any => { return { - ...(input.AvcIntraClass !== undefined && { avcIntraClass: input.AvcIntraClass }), - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateConversionAlgorithm !== undefined && { - framerateConversionAlgorithm: input.FramerateConversionAlgorithm, - }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.InterlaceMode !== undefined && { interlaceMode: input.InterlaceMode }), - ...(input.SlowPal !== undefined && { slowPal: input.SlowPal }), - ...(input.Telecine !== undefined && { telecine: input.Telecine }), + ...(input.AvcIntraClass !== undefined && input.AvcIntraClass !== null && { avcIntraClass: input.AvcIntraClass }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateConversionAlgorithm !== undefined && + input.FramerateConversionAlgorithm !== null && { + framerateConversionAlgorithm: input.FramerateConversionAlgorithm, + }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.InterlaceMode !== undefined && input.InterlaceMode !== null && { interlaceMode: input.InterlaceMode }), + ...(input.SlowPal !== undefined && input.SlowPal !== null && { slowPal: input.SlowPal }), + ...(input.Telecine !== undefined && input.Telecine !== null && { telecine: input.Telecine }), }; }; @@ -3892,35 +4116,43 @@ const serializeAws_restJson1BurninDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.Alignment !== undefined && { alignment: input.Alignment }), - ...(input.BackgroundColor !== undefined && { backgroundColor: input.BackgroundColor }), - ...(input.BackgroundOpacity !== undefined && { backgroundOpacity: input.BackgroundOpacity }), - ...(input.FontColor !== undefined && { fontColor: input.FontColor }), - ...(input.FontOpacity !== undefined && { fontOpacity: input.FontOpacity }), - ...(input.FontResolution !== undefined && { fontResolution: input.FontResolution }), - ...(input.FontScript !== undefined && { fontScript: input.FontScript }), - ...(input.FontSize !== undefined && { fontSize: input.FontSize }), - ...(input.OutlineColor !== undefined && { outlineColor: input.OutlineColor }), - ...(input.OutlineSize !== undefined && { outlineSize: input.OutlineSize }), - ...(input.ShadowColor !== undefined && { shadowColor: input.ShadowColor }), - ...(input.ShadowOpacity !== undefined && { shadowOpacity: input.ShadowOpacity }), - ...(input.ShadowXOffset !== undefined && { shadowXOffset: input.ShadowXOffset }), - ...(input.ShadowYOffset !== undefined && { shadowYOffset: input.ShadowYOffset }), - ...(input.TeletextSpacing !== undefined && { teletextSpacing: input.TeletextSpacing }), - ...(input.XPosition !== undefined && { xPosition: input.XPosition }), - ...(input.YPosition !== undefined && { yPosition: input.YPosition }), + ...(input.Alignment !== undefined && input.Alignment !== null && { alignment: input.Alignment }), + ...(input.BackgroundColor !== undefined && + input.BackgroundColor !== null && { backgroundColor: input.BackgroundColor }), + ...(input.BackgroundOpacity !== undefined && + input.BackgroundOpacity !== null && { backgroundOpacity: input.BackgroundOpacity }), + ...(input.FontColor !== undefined && input.FontColor !== null && { fontColor: input.FontColor }), + ...(input.FontOpacity !== undefined && input.FontOpacity !== null && { fontOpacity: input.FontOpacity }), + ...(input.FontResolution !== undefined && + input.FontResolution !== null && { fontResolution: input.FontResolution }), + ...(input.FontScript !== undefined && input.FontScript !== null && { fontScript: input.FontScript }), + ...(input.FontSize !== undefined && input.FontSize !== null && { fontSize: input.FontSize }), + ...(input.OutlineColor !== undefined && input.OutlineColor !== null && { outlineColor: input.OutlineColor }), + ...(input.OutlineSize !== undefined && input.OutlineSize !== null && { outlineSize: input.OutlineSize }), + ...(input.ShadowColor !== undefined && input.ShadowColor !== null && { shadowColor: input.ShadowColor }), + ...(input.ShadowOpacity !== undefined && input.ShadowOpacity !== null && { shadowOpacity: input.ShadowOpacity }), + ...(input.ShadowXOffset !== undefined && input.ShadowXOffset !== null && { shadowXOffset: input.ShadowXOffset }), + ...(input.ShadowYOffset !== undefined && input.ShadowYOffset !== null && { shadowYOffset: input.ShadowYOffset }), + ...(input.TeletextSpacing !== undefined && + input.TeletextSpacing !== null && { teletextSpacing: input.TeletextSpacing }), + ...(input.XPosition !== undefined && input.XPosition !== null && { xPosition: input.XPosition }), + ...(input.YPosition !== undefined && input.YPosition !== null && { yPosition: input.YPosition }), }; }; const serializeAws_restJson1CaptionDescription = (input: CaptionDescription, context: __SerdeContext): any => { return { - ...(input.CaptionSelectorName !== undefined && { captionSelectorName: input.CaptionSelectorName }), - ...(input.CustomLanguageCode !== undefined && { customLanguageCode: input.CustomLanguageCode }), - ...(input.DestinationSettings !== undefined && { - destinationSettings: serializeAws_restJson1CaptionDestinationSettings(input.DestinationSettings, context), - }), - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.LanguageDescription !== undefined && { languageDescription: input.LanguageDescription }), + ...(input.CaptionSelectorName !== undefined && + input.CaptionSelectorName !== null && { captionSelectorName: input.CaptionSelectorName }), + ...(input.CustomLanguageCode !== undefined && + input.CustomLanguageCode !== null && { customLanguageCode: input.CustomLanguageCode }), + ...(input.DestinationSettings !== undefined && + input.DestinationSettings !== null && { + destinationSettings: serializeAws_restJson1CaptionDestinationSettings(input.DestinationSettings, context), + }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.LanguageDescription !== undefined && + input.LanguageDescription !== null && { languageDescription: input.LanguageDescription }), }; }; @@ -3929,12 +4161,15 @@ const serializeAws_restJson1CaptionDescriptionPreset = ( context: __SerdeContext ): any => { return { - ...(input.CustomLanguageCode !== undefined && { customLanguageCode: input.CustomLanguageCode }), - ...(input.DestinationSettings !== undefined && { - destinationSettings: serializeAws_restJson1CaptionDestinationSettings(input.DestinationSettings, context), - }), - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.LanguageDescription !== undefined && { languageDescription: input.LanguageDescription }), + ...(input.CustomLanguageCode !== undefined && + input.CustomLanguageCode !== null && { customLanguageCode: input.CustomLanguageCode }), + ...(input.DestinationSettings !== undefined && + input.DestinationSettings !== null && { + destinationSettings: serializeAws_restJson1CaptionDestinationSettings(input.DestinationSettings, context), + }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.LanguageDescription !== undefined && + input.LanguageDescription !== null && { languageDescription: input.LanguageDescription }), }; }; @@ -3943,209 +4178,244 @@ const serializeAws_restJson1CaptionDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.BurninDestinationSettings !== undefined && { - burninDestinationSettings: serializeAws_restJson1BurninDestinationSettings( - input.BurninDestinationSettings, - context - ), - }), - ...(input.DestinationType !== undefined && { destinationType: input.DestinationType }), - ...(input.DvbSubDestinationSettings !== undefined && { - dvbSubDestinationSettings: serializeAws_restJson1DvbSubDestinationSettings( - input.DvbSubDestinationSettings, - context - ), - }), - ...(input.EmbeddedDestinationSettings !== undefined && { - embeddedDestinationSettings: serializeAws_restJson1EmbeddedDestinationSettings( - input.EmbeddedDestinationSettings, - context - ), - }), - ...(input.ImscDestinationSettings !== undefined && { - imscDestinationSettings: serializeAws_restJson1ImscDestinationSettings(input.ImscDestinationSettings, context), - }), - ...(input.SccDestinationSettings !== undefined && { - sccDestinationSettings: serializeAws_restJson1SccDestinationSettings(input.SccDestinationSettings, context), - }), - ...(input.TeletextDestinationSettings !== undefined && { - teletextDestinationSettings: serializeAws_restJson1TeletextDestinationSettings( - input.TeletextDestinationSettings, - context - ), - }), - ...(input.TtmlDestinationSettings !== undefined && { - ttmlDestinationSettings: serializeAws_restJson1TtmlDestinationSettings(input.TtmlDestinationSettings, context), - }), + ...(input.BurninDestinationSettings !== undefined && + input.BurninDestinationSettings !== null && { + burninDestinationSettings: serializeAws_restJson1BurninDestinationSettings( + input.BurninDestinationSettings, + context + ), + }), + ...(input.DestinationType !== undefined && + input.DestinationType !== null && { destinationType: input.DestinationType }), + ...(input.DvbSubDestinationSettings !== undefined && + input.DvbSubDestinationSettings !== null && { + dvbSubDestinationSettings: serializeAws_restJson1DvbSubDestinationSettings( + input.DvbSubDestinationSettings, + context + ), + }), + ...(input.EmbeddedDestinationSettings !== undefined && + input.EmbeddedDestinationSettings !== null && { + embeddedDestinationSettings: serializeAws_restJson1EmbeddedDestinationSettings( + input.EmbeddedDestinationSettings, + context + ), + }), + ...(input.ImscDestinationSettings !== undefined && + input.ImscDestinationSettings !== null && { + imscDestinationSettings: serializeAws_restJson1ImscDestinationSettings(input.ImscDestinationSettings, context), + }), + ...(input.SccDestinationSettings !== undefined && + input.SccDestinationSettings !== null && { + sccDestinationSettings: serializeAws_restJson1SccDestinationSettings(input.SccDestinationSettings, context), + }), + ...(input.TeletextDestinationSettings !== undefined && + input.TeletextDestinationSettings !== null && { + teletextDestinationSettings: serializeAws_restJson1TeletextDestinationSettings( + input.TeletextDestinationSettings, + context + ), + }), + ...(input.TtmlDestinationSettings !== undefined && + input.TtmlDestinationSettings !== null && { + ttmlDestinationSettings: serializeAws_restJson1TtmlDestinationSettings(input.TtmlDestinationSettings, context), + }), }; }; const serializeAws_restJson1CaptionSelector = (input: CaptionSelector, context: __SerdeContext): any => { return { - ...(input.CustomLanguageCode !== undefined && { customLanguageCode: input.CustomLanguageCode }), - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.SourceSettings !== undefined && { - sourceSettings: serializeAws_restJson1CaptionSourceSettings(input.SourceSettings, context), - }), + ...(input.CustomLanguageCode !== undefined && + input.CustomLanguageCode !== null && { customLanguageCode: input.CustomLanguageCode }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.SourceSettings !== undefined && + input.SourceSettings !== null && { + sourceSettings: serializeAws_restJson1CaptionSourceSettings(input.SourceSettings, context), + }), }; }; const serializeAws_restJson1CaptionSourceFramerate = (input: CaptionSourceFramerate, context: __SerdeContext): any => { return { - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), }; }; const serializeAws_restJson1CaptionSourceSettings = (input: CaptionSourceSettings, context: __SerdeContext): any => { return { - ...(input.AncillarySourceSettings !== undefined && { - ancillarySourceSettings: serializeAws_restJson1AncillarySourceSettings(input.AncillarySourceSettings, context), - }), - ...(input.DvbSubSourceSettings !== undefined && { - dvbSubSourceSettings: serializeAws_restJson1DvbSubSourceSettings(input.DvbSubSourceSettings, context), - }), - ...(input.EmbeddedSourceSettings !== undefined && { - embeddedSourceSettings: serializeAws_restJson1EmbeddedSourceSettings(input.EmbeddedSourceSettings, context), - }), - ...(input.FileSourceSettings !== undefined && { - fileSourceSettings: serializeAws_restJson1FileSourceSettings(input.FileSourceSettings, context), - }), - ...(input.SourceType !== undefined && { sourceType: input.SourceType }), - ...(input.TeletextSourceSettings !== undefined && { - teletextSourceSettings: serializeAws_restJson1TeletextSourceSettings(input.TeletextSourceSettings, context), - }), - ...(input.TrackSourceSettings !== undefined && { - trackSourceSettings: serializeAws_restJson1TrackSourceSettings(input.TrackSourceSettings, context), - }), + ...(input.AncillarySourceSettings !== undefined && + input.AncillarySourceSettings !== null && { + ancillarySourceSettings: serializeAws_restJson1AncillarySourceSettings(input.AncillarySourceSettings, context), + }), + ...(input.DvbSubSourceSettings !== undefined && + input.DvbSubSourceSettings !== null && { + dvbSubSourceSettings: serializeAws_restJson1DvbSubSourceSettings(input.DvbSubSourceSettings, context), + }), + ...(input.EmbeddedSourceSettings !== undefined && + input.EmbeddedSourceSettings !== null && { + embeddedSourceSettings: serializeAws_restJson1EmbeddedSourceSettings(input.EmbeddedSourceSettings, context), + }), + ...(input.FileSourceSettings !== undefined && + input.FileSourceSettings !== null && { + fileSourceSettings: serializeAws_restJson1FileSourceSettings(input.FileSourceSettings, context), + }), + ...(input.SourceType !== undefined && input.SourceType !== null && { sourceType: input.SourceType }), + ...(input.TeletextSourceSettings !== undefined && + input.TeletextSourceSettings !== null && { + teletextSourceSettings: serializeAws_restJson1TeletextSourceSettings(input.TeletextSourceSettings, context), + }), + ...(input.TrackSourceSettings !== undefined && + input.TrackSourceSettings !== null && { + trackSourceSettings: serializeAws_restJson1TrackSourceSettings(input.TrackSourceSettings, context), + }), }; }; const serializeAws_restJson1ChannelMapping = (input: ChannelMapping, context: __SerdeContext): any => { return { - ...(input.OutputChannels !== undefined && { - outputChannels: serializeAws_restJson1__listOfOutputChannelMapping(input.OutputChannels, context), - }), + ...(input.OutputChannels !== undefined && + input.OutputChannels !== null && { + outputChannels: serializeAws_restJson1__listOfOutputChannelMapping(input.OutputChannels, context), + }), }; }; const serializeAws_restJson1CmafAdditionalManifest = (input: CmafAdditionalManifest, context: __SerdeContext): any => { return { - ...(input.ManifestNameModifier !== undefined && { manifestNameModifier: input.ManifestNameModifier }), - ...(input.SelectedOutputs !== undefined && { - selectedOutputs: serializeAws_restJson1__listOf__stringMin1(input.SelectedOutputs, context), - }), + ...(input.ManifestNameModifier !== undefined && + input.ManifestNameModifier !== null && { manifestNameModifier: input.ManifestNameModifier }), + ...(input.SelectedOutputs !== undefined && + input.SelectedOutputs !== null && { + selectedOutputs: serializeAws_restJson1__listOf__stringMin1(input.SelectedOutputs, context), + }), }; }; const serializeAws_restJson1CmafEncryptionSettings = (input: CmafEncryptionSettings, context: __SerdeContext): any => { return { - ...(input.ConstantInitializationVector !== undefined && { - constantInitializationVector: input.ConstantInitializationVector, - }), - ...(input.EncryptionMethod !== undefined && { encryptionMethod: input.EncryptionMethod }), - ...(input.InitializationVectorInManifest !== undefined && { - initializationVectorInManifest: input.InitializationVectorInManifest, - }), - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProviderCmaf(input.SpekeKeyProvider, context), - }), - ...(input.StaticKeyProvider !== undefined && { - staticKeyProvider: serializeAws_restJson1StaticKeyProvider(input.StaticKeyProvider, context), - }), - ...(input.Type !== undefined && { type: input.Type }), + ...(input.ConstantInitializationVector !== undefined && + input.ConstantInitializationVector !== null && { + constantInitializationVector: input.ConstantInitializationVector, + }), + ...(input.EncryptionMethod !== undefined && + input.EncryptionMethod !== null && { encryptionMethod: input.EncryptionMethod }), + ...(input.InitializationVectorInManifest !== undefined && + input.InitializationVectorInManifest !== null && { + initializationVectorInManifest: input.InitializationVectorInManifest, + }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProviderCmaf(input.SpekeKeyProvider, context), + }), + ...(input.StaticKeyProvider !== undefined && + input.StaticKeyProvider !== null && { + staticKeyProvider: serializeAws_restJson1StaticKeyProvider(input.StaticKeyProvider, context), + }), + ...(input.Type !== undefined && input.Type !== null && { type: input.Type }), }; }; const serializeAws_restJson1CmafGroupSettings = (input: CmafGroupSettings, context: __SerdeContext): any => { return { - ...(input.AdditionalManifests !== undefined && { - additionalManifests: serializeAws_restJson1__listOfCmafAdditionalManifest(input.AdditionalManifests, context), - }), - ...(input.BaseUrl !== undefined && { baseUrl: input.BaseUrl }), - ...(input.ClientCache !== undefined && { clientCache: input.ClientCache }), - ...(input.CodecSpecification !== undefined && { codecSpecification: input.CodecSpecification }), - ...(input.Destination !== undefined && { destination: input.Destination }), - ...(input.DestinationSettings !== undefined && { - destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), - }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1CmafEncryptionSettings(input.Encryption, context), - }), - ...(input.FragmentLength !== undefined && { fragmentLength: input.FragmentLength }), - ...(input.ManifestCompression !== undefined && { manifestCompression: input.ManifestCompression }), - ...(input.ManifestDurationFormat !== undefined && { manifestDurationFormat: input.ManifestDurationFormat }), - ...(input.MinBufferTime !== undefined && { minBufferTime: input.MinBufferTime }), - ...(input.MinFinalSegmentLength !== undefined && { minFinalSegmentLength: input.MinFinalSegmentLength }), - ...(input.MpdProfile !== undefined && { mpdProfile: input.MpdProfile }), - ...(input.SegmentControl !== undefined && { segmentControl: input.SegmentControl }), - ...(input.SegmentLength !== undefined && { segmentLength: input.SegmentLength }), - ...(input.StreamInfResolution !== undefined && { streamInfResolution: input.StreamInfResolution }), - ...(input.WriteDashManifest !== undefined && { writeDashManifest: input.WriteDashManifest }), - ...(input.WriteHlsManifest !== undefined && { writeHlsManifest: input.WriteHlsManifest }), - ...(input.WriteSegmentTimelineInRepresentation !== undefined && { - writeSegmentTimelineInRepresentation: input.WriteSegmentTimelineInRepresentation, - }), + ...(input.AdditionalManifests !== undefined && + input.AdditionalManifests !== null && { + additionalManifests: serializeAws_restJson1__listOfCmafAdditionalManifest(input.AdditionalManifests, context), + }), + ...(input.BaseUrl !== undefined && input.BaseUrl !== null && { baseUrl: input.BaseUrl }), + ...(input.ClientCache !== undefined && input.ClientCache !== null && { clientCache: input.ClientCache }), + ...(input.CodecSpecification !== undefined && + input.CodecSpecification !== null && { codecSpecification: input.CodecSpecification }), + ...(input.Destination !== undefined && input.Destination !== null && { destination: input.Destination }), + ...(input.DestinationSettings !== undefined && + input.DestinationSettings !== null && { + destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), + }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { + encryption: serializeAws_restJson1CmafEncryptionSettings(input.Encryption, context), + }), + ...(input.FragmentLength !== undefined && + input.FragmentLength !== null && { fragmentLength: input.FragmentLength }), + ...(input.ManifestCompression !== undefined && + input.ManifestCompression !== null && { manifestCompression: input.ManifestCompression }), + ...(input.ManifestDurationFormat !== undefined && + input.ManifestDurationFormat !== null && { manifestDurationFormat: input.ManifestDurationFormat }), + ...(input.MinBufferTime !== undefined && input.MinBufferTime !== null && { minBufferTime: input.MinBufferTime }), + ...(input.MinFinalSegmentLength !== undefined && + input.MinFinalSegmentLength !== null && { minFinalSegmentLength: input.MinFinalSegmentLength }), + ...(input.MpdProfile !== undefined && input.MpdProfile !== null && { mpdProfile: input.MpdProfile }), + ...(input.SegmentControl !== undefined && + input.SegmentControl !== null && { segmentControl: input.SegmentControl }), + ...(input.SegmentLength !== undefined && input.SegmentLength !== null && { segmentLength: input.SegmentLength }), + ...(input.StreamInfResolution !== undefined && + input.StreamInfResolution !== null && { streamInfResolution: input.StreamInfResolution }), + ...(input.WriteDashManifest !== undefined && + input.WriteDashManifest !== null && { writeDashManifest: input.WriteDashManifest }), + ...(input.WriteHlsManifest !== undefined && + input.WriteHlsManifest !== null && { writeHlsManifest: input.WriteHlsManifest }), + ...(input.WriteSegmentTimelineInRepresentation !== undefined && + input.WriteSegmentTimelineInRepresentation !== null && { + writeSegmentTimelineInRepresentation: input.WriteSegmentTimelineInRepresentation, + }), }; }; const serializeAws_restJson1CmfcSettings = (input: CmfcSettings, context: __SerdeContext): any => { return { - ...(input.AudioDuration !== undefined && { audioDuration: input.AudioDuration }), - ...(input.Scte35Esam !== undefined && { scte35Esam: input.Scte35Esam }), - ...(input.Scte35Source !== undefined && { scte35Source: input.Scte35Source }), + ...(input.AudioDuration !== undefined && input.AudioDuration !== null && { audioDuration: input.AudioDuration }), + ...(input.Scte35Esam !== undefined && input.Scte35Esam !== null && { scte35Esam: input.Scte35Esam }), + ...(input.Scte35Source !== undefined && input.Scte35Source !== null && { scte35Source: input.Scte35Source }), }; }; const serializeAws_restJson1ColorCorrector = (input: ColorCorrector, context: __SerdeContext): any => { return { - ...(input.Brightness !== undefined && { brightness: input.Brightness }), - ...(input.ColorSpaceConversion !== undefined && { colorSpaceConversion: input.ColorSpaceConversion }), - ...(input.Contrast !== undefined && { contrast: input.Contrast }), - ...(input.Hdr10Metadata !== undefined && { - hdr10Metadata: serializeAws_restJson1Hdr10Metadata(input.Hdr10Metadata, context), - }), - ...(input.Hue !== undefined && { hue: input.Hue }), - ...(input.Saturation !== undefined && { saturation: input.Saturation }), + ...(input.Brightness !== undefined && input.Brightness !== null && { brightness: input.Brightness }), + ...(input.ColorSpaceConversion !== undefined && + input.ColorSpaceConversion !== null && { colorSpaceConversion: input.ColorSpaceConversion }), + ...(input.Contrast !== undefined && input.Contrast !== null && { contrast: input.Contrast }), + ...(input.Hdr10Metadata !== undefined && + input.Hdr10Metadata !== null && { + hdr10Metadata: serializeAws_restJson1Hdr10Metadata(input.Hdr10Metadata, context), + }), + ...(input.Hue !== undefined && input.Hue !== null && { hue: input.Hue }), + ...(input.Saturation !== undefined && input.Saturation !== null && { saturation: input.Saturation }), }; }; const serializeAws_restJson1ContainerSettings = (input: ContainerSettings, context: __SerdeContext): any => { return { - ...(input.CmfcSettings !== undefined && { - cmfcSettings: serializeAws_restJson1CmfcSettings(input.CmfcSettings, context), - }), - ...(input.Container !== undefined && { container: input.Container }), - ...(input.F4vSettings !== undefined && { - f4vSettings: serializeAws_restJson1F4vSettings(input.F4vSettings, context), - }), - ...(input.M2tsSettings !== undefined && { - m2tsSettings: serializeAws_restJson1M2tsSettings(input.M2tsSettings, context), - }), - ...(input.M3u8Settings !== undefined && { - m3u8Settings: serializeAws_restJson1M3u8Settings(input.M3u8Settings, context), - }), - ...(input.MovSettings !== undefined && { - movSettings: serializeAws_restJson1MovSettings(input.MovSettings, context), - }), - ...(input.Mp4Settings !== undefined && { - mp4Settings: serializeAws_restJson1Mp4Settings(input.Mp4Settings, context), - }), - ...(input.MpdSettings !== undefined && { - mpdSettings: serializeAws_restJson1MpdSettings(input.MpdSettings, context), - }), - ...(input.MxfSettings !== undefined && { - mxfSettings: serializeAws_restJson1MxfSettings(input.MxfSettings, context), - }), + ...(input.CmfcSettings !== undefined && + input.CmfcSettings !== null && { cmfcSettings: serializeAws_restJson1CmfcSettings(input.CmfcSettings, context) }), + ...(input.Container !== undefined && input.Container !== null && { container: input.Container }), + ...(input.F4vSettings !== undefined && + input.F4vSettings !== null && { f4vSettings: serializeAws_restJson1F4vSettings(input.F4vSettings, context) }), + ...(input.M2tsSettings !== undefined && + input.M2tsSettings !== null && { m2tsSettings: serializeAws_restJson1M2tsSettings(input.M2tsSettings, context) }), + ...(input.M3u8Settings !== undefined && + input.M3u8Settings !== null && { m3u8Settings: serializeAws_restJson1M3u8Settings(input.M3u8Settings, context) }), + ...(input.MovSettings !== undefined && + input.MovSettings !== null && { movSettings: serializeAws_restJson1MovSettings(input.MovSettings, context) }), + ...(input.Mp4Settings !== undefined && + input.Mp4Settings !== null && { mp4Settings: serializeAws_restJson1Mp4Settings(input.Mp4Settings, context) }), + ...(input.MpdSettings !== undefined && + input.MpdSettings !== null && { mpdSettings: serializeAws_restJson1MpdSettings(input.MpdSettings, context) }), + ...(input.MxfSettings !== undefined && + input.MxfSettings !== null && { mxfSettings: serializeAws_restJson1MxfSettings(input.MxfSettings, context) }), }; }; const serializeAws_restJson1DashAdditionalManifest = (input: DashAdditionalManifest, context: __SerdeContext): any => { return { - ...(input.ManifestNameModifier !== undefined && { manifestNameModifier: input.ManifestNameModifier }), - ...(input.SelectedOutputs !== undefined && { - selectedOutputs: serializeAws_restJson1__listOf__stringMin1(input.SelectedOutputs, context), - }), + ...(input.ManifestNameModifier !== undefined && + input.ManifestNameModifier !== null && { manifestNameModifier: input.ManifestNameModifier }), + ...(input.SelectedOutputs !== undefined && + input.SelectedOutputs !== null && { + selectedOutputs: serializeAws_restJson1__listOf__stringMin1(input.SelectedOutputs, context), + }), }; }; @@ -4154,64 +4424,74 @@ const serializeAws_restJson1DashIsoEncryptionSettings = ( context: __SerdeContext ): any => { return { - ...(input.PlaybackDeviceCompatibility !== undefined && { - playbackDeviceCompatibility: input.PlaybackDeviceCompatibility, - }), - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.PlaybackDeviceCompatibility !== undefined && + input.PlaybackDeviceCompatibility !== null && { playbackDeviceCompatibility: input.PlaybackDeviceCompatibility }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; const serializeAws_restJson1DashIsoGroupSettings = (input: DashIsoGroupSettings, context: __SerdeContext): any => { return { - ...(input.AdditionalManifests !== undefined && { - additionalManifests: serializeAws_restJson1__listOfDashAdditionalManifest(input.AdditionalManifests, context), - }), - ...(input.BaseUrl !== undefined && { baseUrl: input.BaseUrl }), - ...(input.Destination !== undefined && { destination: input.Destination }), - ...(input.DestinationSettings !== undefined && { - destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), - }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1DashIsoEncryptionSettings(input.Encryption, context), - }), - ...(input.FragmentLength !== undefined && { fragmentLength: input.FragmentLength }), - ...(input.HbbtvCompliance !== undefined && { hbbtvCompliance: input.HbbtvCompliance }), - ...(input.MinBufferTime !== undefined && { minBufferTime: input.MinBufferTime }), - ...(input.MinFinalSegmentLength !== undefined && { minFinalSegmentLength: input.MinFinalSegmentLength }), - ...(input.MpdProfile !== undefined && { mpdProfile: input.MpdProfile }), - ...(input.SegmentControl !== undefined && { segmentControl: input.SegmentControl }), - ...(input.SegmentLength !== undefined && { segmentLength: input.SegmentLength }), - ...(input.WriteSegmentTimelineInRepresentation !== undefined && { - writeSegmentTimelineInRepresentation: input.WriteSegmentTimelineInRepresentation, - }), + ...(input.AdditionalManifests !== undefined && + input.AdditionalManifests !== null && { + additionalManifests: serializeAws_restJson1__listOfDashAdditionalManifest(input.AdditionalManifests, context), + }), + ...(input.BaseUrl !== undefined && input.BaseUrl !== null && { baseUrl: input.BaseUrl }), + ...(input.Destination !== undefined && input.Destination !== null && { destination: input.Destination }), + ...(input.DestinationSettings !== undefined && + input.DestinationSettings !== null && { + destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), + }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { + encryption: serializeAws_restJson1DashIsoEncryptionSettings(input.Encryption, context), + }), + ...(input.FragmentLength !== undefined && + input.FragmentLength !== null && { fragmentLength: input.FragmentLength }), + ...(input.HbbtvCompliance !== undefined && + input.HbbtvCompliance !== null && { hbbtvCompliance: input.HbbtvCompliance }), + ...(input.MinBufferTime !== undefined && input.MinBufferTime !== null && { minBufferTime: input.MinBufferTime }), + ...(input.MinFinalSegmentLength !== undefined && + input.MinFinalSegmentLength !== null && { minFinalSegmentLength: input.MinFinalSegmentLength }), + ...(input.MpdProfile !== undefined && input.MpdProfile !== null && { mpdProfile: input.MpdProfile }), + ...(input.SegmentControl !== undefined && + input.SegmentControl !== null && { segmentControl: input.SegmentControl }), + ...(input.SegmentLength !== undefined && input.SegmentLength !== null && { segmentLength: input.SegmentLength }), + ...(input.WriteSegmentTimelineInRepresentation !== undefined && + input.WriteSegmentTimelineInRepresentation !== null && { + writeSegmentTimelineInRepresentation: input.WriteSegmentTimelineInRepresentation, + }), }; }; const serializeAws_restJson1Deinterlacer = (input: Deinterlacer, context: __SerdeContext): any => { return { - ...(input.Algorithm !== undefined && { algorithm: input.Algorithm }), - ...(input.Control !== undefined && { control: input.Control }), - ...(input.Mode !== undefined && { mode: input.Mode }), + ...(input.Algorithm !== undefined && input.Algorithm !== null && { algorithm: input.Algorithm }), + ...(input.Control !== undefined && input.Control !== null && { control: input.Control }), + ...(input.Mode !== undefined && input.Mode !== null && { mode: input.Mode }), }; }; const serializeAws_restJson1DestinationSettings = (input: DestinationSettings, context: __SerdeContext): any => { return { - ...(input.S3Settings !== undefined && { - s3Settings: serializeAws_restJson1S3DestinationSettings(input.S3Settings, context), - }), + ...(input.S3Settings !== undefined && + input.S3Settings !== null && { + s3Settings: serializeAws_restJson1S3DestinationSettings(input.S3Settings, context), + }), }; }; const serializeAws_restJson1DolbyVision = (input: DolbyVision, context: __SerdeContext): any => { return { - ...(input.L6Metadata !== undefined && { - l6Metadata: serializeAws_restJson1DolbyVisionLevel6Metadata(input.L6Metadata, context), - }), - ...(input.L6Mode !== undefined && { l6Mode: input.L6Mode }), - ...(input.Profile !== undefined && { profile: input.Profile }), + ...(input.L6Metadata !== undefined && + input.L6Metadata !== null && { + l6Metadata: serializeAws_restJson1DolbyVisionLevel6Metadata(input.L6Metadata, context), + }), + ...(input.L6Mode !== undefined && input.L6Mode !== null && { l6Mode: input.L6Mode }), + ...(input.Profile !== undefined && input.Profile !== null && { profile: input.Profile }), }; }; @@ -4220,25 +4500,26 @@ const serializeAws_restJson1DolbyVisionLevel6Metadata = ( context: __SerdeContext ): any => { return { - ...(input.MaxCll !== undefined && { maxCll: input.MaxCll }), - ...(input.MaxFall !== undefined && { maxFall: input.MaxFall }), + ...(input.MaxCll !== undefined && input.MaxCll !== null && { maxCll: input.MaxCll }), + ...(input.MaxFall !== undefined && input.MaxFall !== null && { maxFall: input.MaxFall }), }; }; const serializeAws_restJson1DvbNitSettings = (input: DvbNitSettings, context: __SerdeContext): any => { return { - ...(input.NetworkId !== undefined && { networkId: input.NetworkId }), - ...(input.NetworkName !== undefined && { networkName: input.NetworkName }), - ...(input.NitInterval !== undefined && { nitInterval: input.NitInterval }), + ...(input.NetworkId !== undefined && input.NetworkId !== null && { networkId: input.NetworkId }), + ...(input.NetworkName !== undefined && input.NetworkName !== null && { networkName: input.NetworkName }), + ...(input.NitInterval !== undefined && input.NitInterval !== null && { nitInterval: input.NitInterval }), }; }; const serializeAws_restJson1DvbSdtSettings = (input: DvbSdtSettings, context: __SerdeContext): any => { return { - ...(input.OutputSdt !== undefined && { outputSdt: input.OutputSdt }), - ...(input.SdtInterval !== undefined && { sdtInterval: input.SdtInterval }), - ...(input.ServiceName !== undefined && { serviceName: input.ServiceName }), - ...(input.ServiceProviderName !== undefined && { serviceProviderName: input.ServiceProviderName }), + ...(input.OutputSdt !== undefined && input.OutputSdt !== null && { outputSdt: input.OutputSdt }), + ...(input.SdtInterval !== undefined && input.SdtInterval !== null && { sdtInterval: input.SdtInterval }), + ...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }), + ...(input.ServiceProviderName !== undefined && + input.ServiceProviderName !== null && { serviceProviderName: input.ServiceProviderName }), }; }; @@ -4247,90 +4528,106 @@ const serializeAws_restJson1DvbSubDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.Alignment !== undefined && { alignment: input.Alignment }), - ...(input.BackgroundColor !== undefined && { backgroundColor: input.BackgroundColor }), - ...(input.BackgroundOpacity !== undefined && { backgroundOpacity: input.BackgroundOpacity }), - ...(input.FontColor !== undefined && { fontColor: input.FontColor }), - ...(input.FontOpacity !== undefined && { fontOpacity: input.FontOpacity }), - ...(input.FontResolution !== undefined && { fontResolution: input.FontResolution }), - ...(input.FontScript !== undefined && { fontScript: input.FontScript }), - ...(input.FontSize !== undefined && { fontSize: input.FontSize }), - ...(input.OutlineColor !== undefined && { outlineColor: input.OutlineColor }), - ...(input.OutlineSize !== undefined && { outlineSize: input.OutlineSize }), - ...(input.ShadowColor !== undefined && { shadowColor: input.ShadowColor }), - ...(input.ShadowOpacity !== undefined && { shadowOpacity: input.ShadowOpacity }), - ...(input.ShadowXOffset !== undefined && { shadowXOffset: input.ShadowXOffset }), - ...(input.ShadowYOffset !== undefined && { shadowYOffset: input.ShadowYOffset }), - ...(input.SubtitlingType !== undefined && { subtitlingType: input.SubtitlingType }), - ...(input.TeletextSpacing !== undefined && { teletextSpacing: input.TeletextSpacing }), - ...(input.XPosition !== undefined && { xPosition: input.XPosition }), - ...(input.YPosition !== undefined && { yPosition: input.YPosition }), + ...(input.Alignment !== undefined && input.Alignment !== null && { alignment: input.Alignment }), + ...(input.BackgroundColor !== undefined && + input.BackgroundColor !== null && { backgroundColor: input.BackgroundColor }), + ...(input.BackgroundOpacity !== undefined && + input.BackgroundOpacity !== null && { backgroundOpacity: input.BackgroundOpacity }), + ...(input.FontColor !== undefined && input.FontColor !== null && { fontColor: input.FontColor }), + ...(input.FontOpacity !== undefined && input.FontOpacity !== null && { fontOpacity: input.FontOpacity }), + ...(input.FontResolution !== undefined && + input.FontResolution !== null && { fontResolution: input.FontResolution }), + ...(input.FontScript !== undefined && input.FontScript !== null && { fontScript: input.FontScript }), + ...(input.FontSize !== undefined && input.FontSize !== null && { fontSize: input.FontSize }), + ...(input.OutlineColor !== undefined && input.OutlineColor !== null && { outlineColor: input.OutlineColor }), + ...(input.OutlineSize !== undefined && input.OutlineSize !== null && { outlineSize: input.OutlineSize }), + ...(input.ShadowColor !== undefined && input.ShadowColor !== null && { shadowColor: input.ShadowColor }), + ...(input.ShadowOpacity !== undefined && input.ShadowOpacity !== null && { shadowOpacity: input.ShadowOpacity }), + ...(input.ShadowXOffset !== undefined && input.ShadowXOffset !== null && { shadowXOffset: input.ShadowXOffset }), + ...(input.ShadowYOffset !== undefined && input.ShadowYOffset !== null && { shadowYOffset: input.ShadowYOffset }), + ...(input.SubtitlingType !== undefined && + input.SubtitlingType !== null && { subtitlingType: input.SubtitlingType }), + ...(input.TeletextSpacing !== undefined && + input.TeletextSpacing !== null && { teletextSpacing: input.TeletextSpacing }), + ...(input.XPosition !== undefined && input.XPosition !== null && { xPosition: input.XPosition }), + ...(input.YPosition !== undefined && input.YPosition !== null && { yPosition: input.YPosition }), }; }; const serializeAws_restJson1DvbSubSourceSettings = (input: DvbSubSourceSettings, context: __SerdeContext): any => { return { - ...(input.Pid !== undefined && { pid: input.Pid }), + ...(input.Pid !== undefined && input.Pid !== null && { pid: input.Pid }), }; }; const serializeAws_restJson1DvbTdtSettings = (input: DvbTdtSettings, context: __SerdeContext): any => { return { - ...(input.TdtInterval !== undefined && { tdtInterval: input.TdtInterval }), + ...(input.TdtInterval !== undefined && input.TdtInterval !== null && { tdtInterval: input.TdtInterval }), }; }; const serializeAws_restJson1Eac3AtmosSettings = (input: Eac3AtmosSettings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.BitstreamMode !== undefined && { bitstreamMode: input.BitstreamMode }), - ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), - ...(input.DialogueIntelligence !== undefined && { dialogueIntelligence: input.DialogueIntelligence }), - ...(input.DynamicRangeCompressionLine !== undefined && { - dynamicRangeCompressionLine: input.DynamicRangeCompressionLine, - }), - ...(input.DynamicRangeCompressionRf !== undefined && { - dynamicRangeCompressionRf: input.DynamicRangeCompressionRf, - }), - ...(input.LoRoCenterMixLevel !== undefined && { loRoCenterMixLevel: input.LoRoCenterMixLevel }), - ...(input.LoRoSurroundMixLevel !== undefined && { loRoSurroundMixLevel: input.LoRoSurroundMixLevel }), - ...(input.LtRtCenterMixLevel !== undefined && { ltRtCenterMixLevel: input.LtRtCenterMixLevel }), - ...(input.LtRtSurroundMixLevel !== undefined && { ltRtSurroundMixLevel: input.LtRtSurroundMixLevel }), - ...(input.MeteringMode !== undefined && { meteringMode: input.MeteringMode }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), - ...(input.SpeechThreshold !== undefined && { speechThreshold: input.SpeechThreshold }), - ...(input.StereoDownmix !== undefined && { stereoDownmix: input.StereoDownmix }), - ...(input.SurroundExMode !== undefined && { surroundExMode: input.SurroundExMode }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.BitstreamMode !== undefined && input.BitstreamMode !== null && { bitstreamMode: input.BitstreamMode }), + ...(input.CodingMode !== undefined && input.CodingMode !== null && { codingMode: input.CodingMode }), + ...(input.DialogueIntelligence !== undefined && + input.DialogueIntelligence !== null && { dialogueIntelligence: input.DialogueIntelligence }), + ...(input.DynamicRangeCompressionLine !== undefined && + input.DynamicRangeCompressionLine !== null && { dynamicRangeCompressionLine: input.DynamicRangeCompressionLine }), + ...(input.DynamicRangeCompressionRf !== undefined && + input.DynamicRangeCompressionRf !== null && { dynamicRangeCompressionRf: input.DynamicRangeCompressionRf }), + ...(input.LoRoCenterMixLevel !== undefined && + input.LoRoCenterMixLevel !== null && { loRoCenterMixLevel: input.LoRoCenterMixLevel }), + ...(input.LoRoSurroundMixLevel !== undefined && + input.LoRoSurroundMixLevel !== null && { loRoSurroundMixLevel: input.LoRoSurroundMixLevel }), + ...(input.LtRtCenterMixLevel !== undefined && + input.LtRtCenterMixLevel !== null && { ltRtCenterMixLevel: input.LtRtCenterMixLevel }), + ...(input.LtRtSurroundMixLevel !== undefined && + input.LtRtSurroundMixLevel !== null && { ltRtSurroundMixLevel: input.LtRtSurroundMixLevel }), + ...(input.MeteringMode !== undefined && input.MeteringMode !== null && { meteringMode: input.MeteringMode }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), + ...(input.SpeechThreshold !== undefined && + input.SpeechThreshold !== null && { speechThreshold: input.SpeechThreshold }), + ...(input.StereoDownmix !== undefined && input.StereoDownmix !== null && { stereoDownmix: input.StereoDownmix }), + ...(input.SurroundExMode !== undefined && + input.SurroundExMode !== null && { surroundExMode: input.SurroundExMode }), }; }; const serializeAws_restJson1Eac3Settings = (input: Eac3Settings, context: __SerdeContext): any => { return { - ...(input.AttenuationControl !== undefined && { attenuationControl: input.AttenuationControl }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.BitstreamMode !== undefined && { bitstreamMode: input.BitstreamMode }), - ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), - ...(input.DcFilter !== undefined && { dcFilter: input.DcFilter }), - ...(input.Dialnorm !== undefined && { dialnorm: input.Dialnorm }), - ...(input.DynamicRangeCompressionLine !== undefined && { - dynamicRangeCompressionLine: input.DynamicRangeCompressionLine, - }), - ...(input.DynamicRangeCompressionRf !== undefined && { - dynamicRangeCompressionRf: input.DynamicRangeCompressionRf, - }), - ...(input.LfeControl !== undefined && { lfeControl: input.LfeControl }), - ...(input.LfeFilter !== undefined && { lfeFilter: input.LfeFilter }), - ...(input.LoRoCenterMixLevel !== undefined && { loRoCenterMixLevel: input.LoRoCenterMixLevel }), - ...(input.LoRoSurroundMixLevel !== undefined && { loRoSurroundMixLevel: input.LoRoSurroundMixLevel }), - ...(input.LtRtCenterMixLevel !== undefined && { ltRtCenterMixLevel: input.LtRtCenterMixLevel }), - ...(input.LtRtSurroundMixLevel !== undefined && { ltRtSurroundMixLevel: input.LtRtSurroundMixLevel }), - ...(input.MetadataControl !== undefined && { metadataControl: input.MetadataControl }), - ...(input.PassthroughControl !== undefined && { passthroughControl: input.PassthroughControl }), - ...(input.PhaseControl !== undefined && { phaseControl: input.PhaseControl }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), - ...(input.StereoDownmix !== undefined && { stereoDownmix: input.StereoDownmix }), - ...(input.SurroundExMode !== undefined && { surroundExMode: input.SurroundExMode }), - ...(input.SurroundMode !== undefined && { surroundMode: input.SurroundMode }), + ...(input.AttenuationControl !== undefined && + input.AttenuationControl !== null && { attenuationControl: input.AttenuationControl }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.BitstreamMode !== undefined && input.BitstreamMode !== null && { bitstreamMode: input.BitstreamMode }), + ...(input.CodingMode !== undefined && input.CodingMode !== null && { codingMode: input.CodingMode }), + ...(input.DcFilter !== undefined && input.DcFilter !== null && { dcFilter: input.DcFilter }), + ...(input.Dialnorm !== undefined && input.Dialnorm !== null && { dialnorm: input.Dialnorm }), + ...(input.DynamicRangeCompressionLine !== undefined && + input.DynamicRangeCompressionLine !== null && { dynamicRangeCompressionLine: input.DynamicRangeCompressionLine }), + ...(input.DynamicRangeCompressionRf !== undefined && + input.DynamicRangeCompressionRf !== null && { dynamicRangeCompressionRf: input.DynamicRangeCompressionRf }), + ...(input.LfeControl !== undefined && input.LfeControl !== null && { lfeControl: input.LfeControl }), + ...(input.LfeFilter !== undefined && input.LfeFilter !== null && { lfeFilter: input.LfeFilter }), + ...(input.LoRoCenterMixLevel !== undefined && + input.LoRoCenterMixLevel !== null && { loRoCenterMixLevel: input.LoRoCenterMixLevel }), + ...(input.LoRoSurroundMixLevel !== undefined && + input.LoRoSurroundMixLevel !== null && { loRoSurroundMixLevel: input.LoRoSurroundMixLevel }), + ...(input.LtRtCenterMixLevel !== undefined && + input.LtRtCenterMixLevel !== null && { ltRtCenterMixLevel: input.LtRtCenterMixLevel }), + ...(input.LtRtSurroundMixLevel !== undefined && + input.LtRtSurroundMixLevel !== null && { ltRtSurroundMixLevel: input.LtRtSurroundMixLevel }), + ...(input.MetadataControl !== undefined && + input.MetadataControl !== null && { metadataControl: input.MetadataControl }), + ...(input.PassthroughControl !== undefined && + input.PassthroughControl !== null && { passthroughControl: input.PassthroughControl }), + ...(input.PhaseControl !== undefined && input.PhaseControl !== null && { phaseControl: input.PhaseControl }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), + ...(input.StereoDownmix !== undefined && input.StereoDownmix !== null && { stereoDownmix: input.StereoDownmix }), + ...(input.SurroundExMode !== undefined && + input.SurroundExMode !== null && { surroundExMode: input.SurroundExMode }), + ...(input.SurroundMode !== undefined && input.SurroundMode !== null && { surroundMode: input.SurroundMode }), }; }; @@ -4339,21 +4636,23 @@ const serializeAws_restJson1EmbeddedDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.Destination608ChannelNumber !== undefined && { - destination608ChannelNumber: input.Destination608ChannelNumber, - }), - ...(input.Destination708ServiceNumber !== undefined && { - destination708ServiceNumber: input.Destination708ServiceNumber, - }), + ...(input.Destination608ChannelNumber !== undefined && + input.Destination608ChannelNumber !== null && { destination608ChannelNumber: input.Destination608ChannelNumber }), + ...(input.Destination708ServiceNumber !== undefined && + input.Destination708ServiceNumber !== null && { destination708ServiceNumber: input.Destination708ServiceNumber }), }; }; const serializeAws_restJson1EmbeddedSourceSettings = (input: EmbeddedSourceSettings, context: __SerdeContext): any => { return { - ...(input.Convert608To708 !== undefined && { convert608To708: input.Convert608To708 }), - ...(input.Source608ChannelNumber !== undefined && { source608ChannelNumber: input.Source608ChannelNumber }), - ...(input.Source608TrackNumber !== undefined && { source608TrackNumber: input.Source608TrackNumber }), - ...(input.TerminateCaptions !== undefined && { terminateCaptions: input.TerminateCaptions }), + ...(input.Convert608To708 !== undefined && + input.Convert608To708 !== null && { convert608To708: input.Convert608To708 }), + ...(input.Source608ChannelNumber !== undefined && + input.Source608ChannelNumber !== null && { source608ChannelNumber: input.Source608ChannelNumber }), + ...(input.Source608TrackNumber !== undefined && + input.Source608TrackNumber !== null && { source608TrackNumber: input.Source608TrackNumber }), + ...(input.TerminateCaptions !== undefined && + input.TerminateCaptions !== null && { terminateCaptions: input.TerminateCaptions }), }; }; @@ -4362,25 +4661,28 @@ const serializeAws_restJson1EsamManifestConfirmConditionNotification = ( context: __SerdeContext ): any => { return { - ...(input.MccXml !== undefined && { mccXml: input.MccXml }), + ...(input.MccXml !== undefined && input.MccXml !== null && { mccXml: input.MccXml }), }; }; const serializeAws_restJson1EsamSettings = (input: EsamSettings, context: __SerdeContext): any => { return { - ...(input.ManifestConfirmConditionNotification !== undefined && { - manifestConfirmConditionNotification: serializeAws_restJson1EsamManifestConfirmConditionNotification( - input.ManifestConfirmConditionNotification, - context - ), - }), - ...(input.ResponseSignalPreroll !== undefined && { responseSignalPreroll: input.ResponseSignalPreroll }), - ...(input.SignalProcessingNotification !== undefined && { - signalProcessingNotification: serializeAws_restJson1EsamSignalProcessingNotification( - input.SignalProcessingNotification, - context - ), - }), + ...(input.ManifestConfirmConditionNotification !== undefined && + input.ManifestConfirmConditionNotification !== null && { + manifestConfirmConditionNotification: serializeAws_restJson1EsamManifestConfirmConditionNotification( + input.ManifestConfirmConditionNotification, + context + ), + }), + ...(input.ResponseSignalPreroll !== undefined && + input.ResponseSignalPreroll !== null && { responseSignalPreroll: input.ResponseSignalPreroll }), + ...(input.SignalProcessingNotification !== undefined && + input.SignalProcessingNotification !== null && { + signalProcessingNotification: serializeAws_restJson1EsamSignalProcessingNotification( + input.SignalProcessingNotification, + context + ), + }), }; }; @@ -4389,206 +4691,251 @@ const serializeAws_restJson1EsamSignalProcessingNotification = ( context: __SerdeContext ): any => { return { - ...(input.SccXml !== undefined && { sccXml: input.SccXml }), + ...(input.SccXml !== undefined && input.SccXml !== null && { sccXml: input.SccXml }), }; }; const serializeAws_restJson1F4vSettings = (input: F4vSettings, context: __SerdeContext): any => { return { - ...(input.MoovPlacement !== undefined && { moovPlacement: input.MoovPlacement }), + ...(input.MoovPlacement !== undefined && input.MoovPlacement !== null && { moovPlacement: input.MoovPlacement }), }; }; const serializeAws_restJson1FileGroupSettings = (input: FileGroupSettings, context: __SerdeContext): any => { return { - ...(input.Destination !== undefined && { destination: input.Destination }), - ...(input.DestinationSettings !== undefined && { - destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), - }), + ...(input.Destination !== undefined && input.Destination !== null && { destination: input.Destination }), + ...(input.DestinationSettings !== undefined && + input.DestinationSettings !== null && { + destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), + }), }; }; const serializeAws_restJson1FileSourceSettings = (input: FileSourceSettings, context: __SerdeContext): any => { return { - ...(input.Convert608To708 !== undefined && { convert608To708: input.Convert608To708 }), - ...(input.Framerate !== undefined && { - framerate: serializeAws_restJson1CaptionSourceFramerate(input.Framerate, context), - }), - ...(input.SourceFile !== undefined && { sourceFile: input.SourceFile }), - ...(input.TimeDelta !== undefined && { timeDelta: input.TimeDelta }), + ...(input.Convert608To708 !== undefined && + input.Convert608To708 !== null && { convert608To708: input.Convert608To708 }), + ...(input.Framerate !== undefined && + input.Framerate !== null && { + framerate: serializeAws_restJson1CaptionSourceFramerate(input.Framerate, context), + }), + ...(input.SourceFile !== undefined && input.SourceFile !== null && { sourceFile: input.SourceFile }), + ...(input.TimeDelta !== undefined && input.TimeDelta !== null && { timeDelta: input.TimeDelta }), }; }; const serializeAws_restJson1FrameCaptureSettings = (input: FrameCaptureSettings, context: __SerdeContext): any => { return { - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.MaxCaptures !== undefined && { maxCaptures: input.MaxCaptures }), - ...(input.Quality !== undefined && { quality: input.Quality }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.MaxCaptures !== undefined && input.MaxCaptures !== null && { maxCaptures: input.MaxCaptures }), + ...(input.Quality !== undefined && input.Quality !== null && { quality: input.Quality }), }; }; const serializeAws_restJson1H264QvbrSettings = (input: H264QvbrSettings, context: __SerdeContext): any => { return { - ...(input.MaxAverageBitrate !== undefined && { maxAverageBitrate: input.MaxAverageBitrate }), - ...(input.QvbrQualityLevel !== undefined && { qvbrQualityLevel: input.QvbrQualityLevel }), - ...(input.QvbrQualityLevelFineTune !== undefined && { qvbrQualityLevelFineTune: input.QvbrQualityLevelFineTune }), + ...(input.MaxAverageBitrate !== undefined && + input.MaxAverageBitrate !== null && { maxAverageBitrate: input.MaxAverageBitrate }), + ...(input.QvbrQualityLevel !== undefined && + input.QvbrQualityLevel !== null && { qvbrQualityLevel: input.QvbrQualityLevel }), + ...(input.QvbrQualityLevelFineTune !== undefined && + input.QvbrQualityLevelFineTune !== null && { qvbrQualityLevelFineTune: input.QvbrQualityLevelFineTune }), }; }; const serializeAws_restJson1H264Settings = (input: H264Settings, context: __SerdeContext): any => { return { - ...(input.AdaptiveQuantization !== undefined && { adaptiveQuantization: input.AdaptiveQuantization }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.CodecLevel !== undefined && { codecLevel: input.CodecLevel }), - ...(input.CodecProfile !== undefined && { codecProfile: input.CodecProfile }), - ...(input.DynamicSubGop !== undefined && { dynamicSubGop: input.DynamicSubGop }), - ...(input.EntropyEncoding !== undefined && { entropyEncoding: input.EntropyEncoding }), - ...(input.FieldEncoding !== undefined && { fieldEncoding: input.FieldEncoding }), - ...(input.FlickerAdaptiveQuantization !== undefined && { - flickerAdaptiveQuantization: input.FlickerAdaptiveQuantization, - }), - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateConversionAlgorithm !== undefined && { - framerateConversionAlgorithm: input.FramerateConversionAlgorithm, - }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.GopBReference !== undefined && { gopBReference: input.GopBReference }), - ...(input.GopClosedCadence !== undefined && { gopClosedCadence: input.GopClosedCadence }), - ...(input.GopSize !== undefined && { gopSize: input.GopSize }), - ...(input.GopSizeUnits !== undefined && { gopSizeUnits: input.GopSizeUnits }), - ...(input.HrdBufferInitialFillPercentage !== undefined && { - hrdBufferInitialFillPercentage: input.HrdBufferInitialFillPercentage, - }), - ...(input.HrdBufferSize !== undefined && { hrdBufferSize: input.HrdBufferSize }), - ...(input.InterlaceMode !== undefined && { interlaceMode: input.InterlaceMode }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.MinIInterval !== undefined && { minIInterval: input.MinIInterval }), - ...(input.NumberBFramesBetweenReferenceFrames !== undefined && { - numberBFramesBetweenReferenceFrames: input.NumberBFramesBetweenReferenceFrames, - }), - ...(input.NumberReferenceFrames !== undefined && { numberReferenceFrames: input.NumberReferenceFrames }), - ...(input.ParControl !== undefined && { parControl: input.ParControl }), - ...(input.ParDenominator !== undefined && { parDenominator: input.ParDenominator }), - ...(input.ParNumerator !== undefined && { parNumerator: input.ParNumerator }), - ...(input.QualityTuningLevel !== undefined && { qualityTuningLevel: input.QualityTuningLevel }), - ...(input.QvbrSettings !== undefined && { - qvbrSettings: serializeAws_restJson1H264QvbrSettings(input.QvbrSettings, context), - }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), - ...(input.RepeatPps !== undefined && { repeatPps: input.RepeatPps }), - ...(input.SceneChangeDetect !== undefined && { sceneChangeDetect: input.SceneChangeDetect }), - ...(input.Slices !== undefined && { slices: input.Slices }), - ...(input.SlowPal !== undefined && { slowPal: input.SlowPal }), - ...(input.Softness !== undefined && { softness: input.Softness }), - ...(input.SpatialAdaptiveQuantization !== undefined && { - spatialAdaptiveQuantization: input.SpatialAdaptiveQuantization, - }), - ...(input.Syntax !== undefined && { syntax: input.Syntax }), - ...(input.Telecine !== undefined && { telecine: input.Telecine }), - ...(input.TemporalAdaptiveQuantization !== undefined && { - temporalAdaptiveQuantization: input.TemporalAdaptiveQuantization, - }), - ...(input.UnregisteredSeiTimecode !== undefined && { unregisteredSeiTimecode: input.UnregisteredSeiTimecode }), + ...(input.AdaptiveQuantization !== undefined && + input.AdaptiveQuantization !== null && { adaptiveQuantization: input.AdaptiveQuantization }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.CodecLevel !== undefined && input.CodecLevel !== null && { codecLevel: input.CodecLevel }), + ...(input.CodecProfile !== undefined && input.CodecProfile !== null && { codecProfile: input.CodecProfile }), + ...(input.DynamicSubGop !== undefined && input.DynamicSubGop !== null && { dynamicSubGop: input.DynamicSubGop }), + ...(input.EntropyEncoding !== undefined && + input.EntropyEncoding !== null && { entropyEncoding: input.EntropyEncoding }), + ...(input.FieldEncoding !== undefined && input.FieldEncoding !== null && { fieldEncoding: input.FieldEncoding }), + ...(input.FlickerAdaptiveQuantization !== undefined && + input.FlickerAdaptiveQuantization !== null && { flickerAdaptiveQuantization: input.FlickerAdaptiveQuantization }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateConversionAlgorithm !== undefined && + input.FramerateConversionAlgorithm !== null && { + framerateConversionAlgorithm: input.FramerateConversionAlgorithm, + }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.GopBReference !== undefined && input.GopBReference !== null && { gopBReference: input.GopBReference }), + ...(input.GopClosedCadence !== undefined && + input.GopClosedCadence !== null && { gopClosedCadence: input.GopClosedCadence }), + ...(input.GopSize !== undefined && input.GopSize !== null && { gopSize: input.GopSize }), + ...(input.GopSizeUnits !== undefined && input.GopSizeUnits !== null && { gopSizeUnits: input.GopSizeUnits }), + ...(input.HrdBufferInitialFillPercentage !== undefined && + input.HrdBufferInitialFillPercentage !== null && { + hrdBufferInitialFillPercentage: input.HrdBufferInitialFillPercentage, + }), + ...(input.HrdBufferSize !== undefined && input.HrdBufferSize !== null && { hrdBufferSize: input.HrdBufferSize }), + ...(input.InterlaceMode !== undefined && input.InterlaceMode !== null && { interlaceMode: input.InterlaceMode }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.MinIInterval !== undefined && input.MinIInterval !== null && { minIInterval: input.MinIInterval }), + ...(input.NumberBFramesBetweenReferenceFrames !== undefined && + input.NumberBFramesBetweenReferenceFrames !== null && { + numberBFramesBetweenReferenceFrames: input.NumberBFramesBetweenReferenceFrames, + }), + ...(input.NumberReferenceFrames !== undefined && + input.NumberReferenceFrames !== null && { numberReferenceFrames: input.NumberReferenceFrames }), + ...(input.ParControl !== undefined && input.ParControl !== null && { parControl: input.ParControl }), + ...(input.ParDenominator !== undefined && + input.ParDenominator !== null && { parDenominator: input.ParDenominator }), + ...(input.ParNumerator !== undefined && input.ParNumerator !== null && { parNumerator: input.ParNumerator }), + ...(input.QualityTuningLevel !== undefined && + input.QualityTuningLevel !== null && { qualityTuningLevel: input.QualityTuningLevel }), + ...(input.QvbrSettings !== undefined && + input.QvbrSettings !== null && { + qvbrSettings: serializeAws_restJson1H264QvbrSettings(input.QvbrSettings, context), + }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), + ...(input.RepeatPps !== undefined && input.RepeatPps !== null && { repeatPps: input.RepeatPps }), + ...(input.SceneChangeDetect !== undefined && + input.SceneChangeDetect !== null && { sceneChangeDetect: input.SceneChangeDetect }), + ...(input.Slices !== undefined && input.Slices !== null && { slices: input.Slices }), + ...(input.SlowPal !== undefined && input.SlowPal !== null && { slowPal: input.SlowPal }), + ...(input.Softness !== undefined && input.Softness !== null && { softness: input.Softness }), + ...(input.SpatialAdaptiveQuantization !== undefined && + input.SpatialAdaptiveQuantization !== null && { spatialAdaptiveQuantization: input.SpatialAdaptiveQuantization }), + ...(input.Syntax !== undefined && input.Syntax !== null && { syntax: input.Syntax }), + ...(input.Telecine !== undefined && input.Telecine !== null && { telecine: input.Telecine }), + ...(input.TemporalAdaptiveQuantization !== undefined && + input.TemporalAdaptiveQuantization !== null && { + temporalAdaptiveQuantization: input.TemporalAdaptiveQuantization, + }), + ...(input.UnregisteredSeiTimecode !== undefined && + input.UnregisteredSeiTimecode !== null && { unregisteredSeiTimecode: input.UnregisteredSeiTimecode }), }; }; const serializeAws_restJson1H265QvbrSettings = (input: H265QvbrSettings, context: __SerdeContext): any => { return { - ...(input.MaxAverageBitrate !== undefined && { maxAverageBitrate: input.MaxAverageBitrate }), - ...(input.QvbrQualityLevel !== undefined && { qvbrQualityLevel: input.QvbrQualityLevel }), - ...(input.QvbrQualityLevelFineTune !== undefined && { qvbrQualityLevelFineTune: input.QvbrQualityLevelFineTune }), + ...(input.MaxAverageBitrate !== undefined && + input.MaxAverageBitrate !== null && { maxAverageBitrate: input.MaxAverageBitrate }), + ...(input.QvbrQualityLevel !== undefined && + input.QvbrQualityLevel !== null && { qvbrQualityLevel: input.QvbrQualityLevel }), + ...(input.QvbrQualityLevelFineTune !== undefined && + input.QvbrQualityLevelFineTune !== null && { qvbrQualityLevelFineTune: input.QvbrQualityLevelFineTune }), }; }; const serializeAws_restJson1H265Settings = (input: H265Settings, context: __SerdeContext): any => { return { - ...(input.AdaptiveQuantization !== undefined && { adaptiveQuantization: input.AdaptiveQuantization }), - ...(input.AlternateTransferFunctionSei !== undefined && { - alternateTransferFunctionSei: input.AlternateTransferFunctionSei, - }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.CodecLevel !== undefined && { codecLevel: input.CodecLevel }), - ...(input.CodecProfile !== undefined && { codecProfile: input.CodecProfile }), - ...(input.DynamicSubGop !== undefined && { dynamicSubGop: input.DynamicSubGop }), - ...(input.FlickerAdaptiveQuantization !== undefined && { - flickerAdaptiveQuantization: input.FlickerAdaptiveQuantization, - }), - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateConversionAlgorithm !== undefined && { - framerateConversionAlgorithm: input.FramerateConversionAlgorithm, - }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.GopBReference !== undefined && { gopBReference: input.GopBReference }), - ...(input.GopClosedCadence !== undefined && { gopClosedCadence: input.GopClosedCadence }), - ...(input.GopSize !== undefined && { gopSize: input.GopSize }), - ...(input.GopSizeUnits !== undefined && { gopSizeUnits: input.GopSizeUnits }), - ...(input.HrdBufferInitialFillPercentage !== undefined && { - hrdBufferInitialFillPercentage: input.HrdBufferInitialFillPercentage, - }), - ...(input.HrdBufferSize !== undefined && { hrdBufferSize: input.HrdBufferSize }), - ...(input.InterlaceMode !== undefined && { interlaceMode: input.InterlaceMode }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.MinIInterval !== undefined && { minIInterval: input.MinIInterval }), - ...(input.NumberBFramesBetweenReferenceFrames !== undefined && { - numberBFramesBetweenReferenceFrames: input.NumberBFramesBetweenReferenceFrames, - }), - ...(input.NumberReferenceFrames !== undefined && { numberReferenceFrames: input.NumberReferenceFrames }), - ...(input.ParControl !== undefined && { parControl: input.ParControl }), - ...(input.ParDenominator !== undefined && { parDenominator: input.ParDenominator }), - ...(input.ParNumerator !== undefined && { parNumerator: input.ParNumerator }), - ...(input.QualityTuningLevel !== undefined && { qualityTuningLevel: input.QualityTuningLevel }), - ...(input.QvbrSettings !== undefined && { - qvbrSettings: serializeAws_restJson1H265QvbrSettings(input.QvbrSettings, context), - }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), - ...(input.SampleAdaptiveOffsetFilterMode !== undefined && { - sampleAdaptiveOffsetFilterMode: input.SampleAdaptiveOffsetFilterMode, - }), - ...(input.SceneChangeDetect !== undefined && { sceneChangeDetect: input.SceneChangeDetect }), - ...(input.Slices !== undefined && { slices: input.Slices }), - ...(input.SlowPal !== undefined && { slowPal: input.SlowPal }), - ...(input.SpatialAdaptiveQuantization !== undefined && { - spatialAdaptiveQuantization: input.SpatialAdaptiveQuantization, - }), - ...(input.Telecine !== undefined && { telecine: input.Telecine }), - ...(input.TemporalAdaptiveQuantization !== undefined && { - temporalAdaptiveQuantization: input.TemporalAdaptiveQuantization, - }), - ...(input.TemporalIds !== undefined && { temporalIds: input.TemporalIds }), - ...(input.Tiles !== undefined && { tiles: input.Tiles }), - ...(input.UnregisteredSeiTimecode !== undefined && { unregisteredSeiTimecode: input.UnregisteredSeiTimecode }), - ...(input.WriteMp4PackagingType !== undefined && { writeMp4PackagingType: input.WriteMp4PackagingType }), + ...(input.AdaptiveQuantization !== undefined && + input.AdaptiveQuantization !== null && { adaptiveQuantization: input.AdaptiveQuantization }), + ...(input.AlternateTransferFunctionSei !== undefined && + input.AlternateTransferFunctionSei !== null && { + alternateTransferFunctionSei: input.AlternateTransferFunctionSei, + }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.CodecLevel !== undefined && input.CodecLevel !== null && { codecLevel: input.CodecLevel }), + ...(input.CodecProfile !== undefined && input.CodecProfile !== null && { codecProfile: input.CodecProfile }), + ...(input.DynamicSubGop !== undefined && input.DynamicSubGop !== null && { dynamicSubGop: input.DynamicSubGop }), + ...(input.FlickerAdaptiveQuantization !== undefined && + input.FlickerAdaptiveQuantization !== null && { flickerAdaptiveQuantization: input.FlickerAdaptiveQuantization }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateConversionAlgorithm !== undefined && + input.FramerateConversionAlgorithm !== null && { + framerateConversionAlgorithm: input.FramerateConversionAlgorithm, + }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.GopBReference !== undefined && input.GopBReference !== null && { gopBReference: input.GopBReference }), + ...(input.GopClosedCadence !== undefined && + input.GopClosedCadence !== null && { gopClosedCadence: input.GopClosedCadence }), + ...(input.GopSize !== undefined && input.GopSize !== null && { gopSize: input.GopSize }), + ...(input.GopSizeUnits !== undefined && input.GopSizeUnits !== null && { gopSizeUnits: input.GopSizeUnits }), + ...(input.HrdBufferInitialFillPercentage !== undefined && + input.HrdBufferInitialFillPercentage !== null && { + hrdBufferInitialFillPercentage: input.HrdBufferInitialFillPercentage, + }), + ...(input.HrdBufferSize !== undefined && input.HrdBufferSize !== null && { hrdBufferSize: input.HrdBufferSize }), + ...(input.InterlaceMode !== undefined && input.InterlaceMode !== null && { interlaceMode: input.InterlaceMode }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.MinIInterval !== undefined && input.MinIInterval !== null && { minIInterval: input.MinIInterval }), + ...(input.NumberBFramesBetweenReferenceFrames !== undefined && + input.NumberBFramesBetweenReferenceFrames !== null && { + numberBFramesBetweenReferenceFrames: input.NumberBFramesBetweenReferenceFrames, + }), + ...(input.NumberReferenceFrames !== undefined && + input.NumberReferenceFrames !== null && { numberReferenceFrames: input.NumberReferenceFrames }), + ...(input.ParControl !== undefined && input.ParControl !== null && { parControl: input.ParControl }), + ...(input.ParDenominator !== undefined && + input.ParDenominator !== null && { parDenominator: input.ParDenominator }), + ...(input.ParNumerator !== undefined && input.ParNumerator !== null && { parNumerator: input.ParNumerator }), + ...(input.QualityTuningLevel !== undefined && + input.QualityTuningLevel !== null && { qualityTuningLevel: input.QualityTuningLevel }), + ...(input.QvbrSettings !== undefined && + input.QvbrSettings !== null && { + qvbrSettings: serializeAws_restJson1H265QvbrSettings(input.QvbrSettings, context), + }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), + ...(input.SampleAdaptiveOffsetFilterMode !== undefined && + input.SampleAdaptiveOffsetFilterMode !== null && { + sampleAdaptiveOffsetFilterMode: input.SampleAdaptiveOffsetFilterMode, + }), + ...(input.SceneChangeDetect !== undefined && + input.SceneChangeDetect !== null && { sceneChangeDetect: input.SceneChangeDetect }), + ...(input.Slices !== undefined && input.Slices !== null && { slices: input.Slices }), + ...(input.SlowPal !== undefined && input.SlowPal !== null && { slowPal: input.SlowPal }), + ...(input.SpatialAdaptiveQuantization !== undefined && + input.SpatialAdaptiveQuantization !== null && { spatialAdaptiveQuantization: input.SpatialAdaptiveQuantization }), + ...(input.Telecine !== undefined && input.Telecine !== null && { telecine: input.Telecine }), + ...(input.TemporalAdaptiveQuantization !== undefined && + input.TemporalAdaptiveQuantization !== null && { + temporalAdaptiveQuantization: input.TemporalAdaptiveQuantization, + }), + ...(input.TemporalIds !== undefined && input.TemporalIds !== null && { temporalIds: input.TemporalIds }), + ...(input.Tiles !== undefined && input.Tiles !== null && { tiles: input.Tiles }), + ...(input.UnregisteredSeiTimecode !== undefined && + input.UnregisteredSeiTimecode !== null && { unregisteredSeiTimecode: input.UnregisteredSeiTimecode }), + ...(input.WriteMp4PackagingType !== undefined && + input.WriteMp4PackagingType !== null && { writeMp4PackagingType: input.WriteMp4PackagingType }), }; }; const serializeAws_restJson1Hdr10Metadata = (input: Hdr10Metadata, context: __SerdeContext): any => { return { - ...(input.BluePrimaryX !== undefined && { bluePrimaryX: input.BluePrimaryX }), - ...(input.BluePrimaryY !== undefined && { bluePrimaryY: input.BluePrimaryY }), - ...(input.GreenPrimaryX !== undefined && { greenPrimaryX: input.GreenPrimaryX }), - ...(input.GreenPrimaryY !== undefined && { greenPrimaryY: input.GreenPrimaryY }), - ...(input.MaxContentLightLevel !== undefined && { maxContentLightLevel: input.MaxContentLightLevel }), - ...(input.MaxFrameAverageLightLevel !== undefined && { - maxFrameAverageLightLevel: input.MaxFrameAverageLightLevel, - }), - ...(input.MaxLuminance !== undefined && { maxLuminance: input.MaxLuminance }), - ...(input.MinLuminance !== undefined && { minLuminance: input.MinLuminance }), - ...(input.RedPrimaryX !== undefined && { redPrimaryX: input.RedPrimaryX }), - ...(input.RedPrimaryY !== undefined && { redPrimaryY: input.RedPrimaryY }), - ...(input.WhitePointX !== undefined && { whitePointX: input.WhitePointX }), - ...(input.WhitePointY !== undefined && { whitePointY: input.WhitePointY }), + ...(input.BluePrimaryX !== undefined && input.BluePrimaryX !== null && { bluePrimaryX: input.BluePrimaryX }), + ...(input.BluePrimaryY !== undefined && input.BluePrimaryY !== null && { bluePrimaryY: input.BluePrimaryY }), + ...(input.GreenPrimaryX !== undefined && input.GreenPrimaryX !== null && { greenPrimaryX: input.GreenPrimaryX }), + ...(input.GreenPrimaryY !== undefined && input.GreenPrimaryY !== null && { greenPrimaryY: input.GreenPrimaryY }), + ...(input.MaxContentLightLevel !== undefined && + input.MaxContentLightLevel !== null && { maxContentLightLevel: input.MaxContentLightLevel }), + ...(input.MaxFrameAverageLightLevel !== undefined && + input.MaxFrameAverageLightLevel !== null && { maxFrameAverageLightLevel: input.MaxFrameAverageLightLevel }), + ...(input.MaxLuminance !== undefined && input.MaxLuminance !== null && { maxLuminance: input.MaxLuminance }), + ...(input.MinLuminance !== undefined && input.MinLuminance !== null && { minLuminance: input.MinLuminance }), + ...(input.RedPrimaryX !== undefined && input.RedPrimaryX !== null && { redPrimaryX: input.RedPrimaryX }), + ...(input.RedPrimaryY !== undefined && input.RedPrimaryY !== null && { redPrimaryY: input.RedPrimaryY }), + ...(input.WhitePointX !== undefined && input.WhitePointX !== null && { whitePointX: input.WhitePointX }), + ...(input.WhitePointY !== undefined && input.WhitePointY !== null && { whitePointY: input.WhitePointY }), }; }; const serializeAws_restJson1HlsAdditionalManifest = (input: HlsAdditionalManifest, context: __SerdeContext): any => { return { - ...(input.ManifestNameModifier !== undefined && { manifestNameModifier: input.ManifestNameModifier }), - ...(input.SelectedOutputs !== undefined && { - selectedOutputs: serializeAws_restJson1__listOf__stringMin1(input.SelectedOutputs, context), - }), + ...(input.ManifestNameModifier !== undefined && + input.ManifestNameModifier !== null && { manifestNameModifier: input.ManifestNameModifier }), + ...(input.SelectedOutputs !== undefined && + input.SelectedOutputs !== null && { + selectedOutputs: serializeAws_restJson1__listOf__stringMin1(input.SelectedOutputs, context), + }), }; }; @@ -4597,110 +4944,143 @@ const serializeAws_restJson1HlsCaptionLanguageMapping = ( context: __SerdeContext ): any => { return { - ...(input.CaptionChannel !== undefined && { captionChannel: input.CaptionChannel }), - ...(input.CustomLanguageCode !== undefined && { customLanguageCode: input.CustomLanguageCode }), - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.LanguageDescription !== undefined && { languageDescription: input.LanguageDescription }), + ...(input.CaptionChannel !== undefined && + input.CaptionChannel !== null && { captionChannel: input.CaptionChannel }), + ...(input.CustomLanguageCode !== undefined && + input.CustomLanguageCode !== null && { customLanguageCode: input.CustomLanguageCode }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.LanguageDescription !== undefined && + input.LanguageDescription !== null && { languageDescription: input.LanguageDescription }), }; }; const serializeAws_restJson1HlsEncryptionSettings = (input: HlsEncryptionSettings, context: __SerdeContext): any => { return { - ...(input.ConstantInitializationVector !== undefined && { - constantInitializationVector: input.ConstantInitializationVector, - }), - ...(input.EncryptionMethod !== undefined && { encryptionMethod: input.EncryptionMethod }), - ...(input.InitializationVectorInManifest !== undefined && { - initializationVectorInManifest: input.InitializationVectorInManifest, - }), - ...(input.OfflineEncrypted !== undefined && { offlineEncrypted: input.OfflineEncrypted }), - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), - ...(input.StaticKeyProvider !== undefined && { - staticKeyProvider: serializeAws_restJson1StaticKeyProvider(input.StaticKeyProvider, context), - }), - ...(input.Type !== undefined && { type: input.Type }), + ...(input.ConstantInitializationVector !== undefined && + input.ConstantInitializationVector !== null && { + constantInitializationVector: input.ConstantInitializationVector, + }), + ...(input.EncryptionMethod !== undefined && + input.EncryptionMethod !== null && { encryptionMethod: input.EncryptionMethod }), + ...(input.InitializationVectorInManifest !== undefined && + input.InitializationVectorInManifest !== null && { + initializationVectorInManifest: input.InitializationVectorInManifest, + }), + ...(input.OfflineEncrypted !== undefined && + input.OfflineEncrypted !== null && { offlineEncrypted: input.OfflineEncrypted }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), + ...(input.StaticKeyProvider !== undefined && + input.StaticKeyProvider !== null && { + staticKeyProvider: serializeAws_restJson1StaticKeyProvider(input.StaticKeyProvider, context), + }), + ...(input.Type !== undefined && input.Type !== null && { type: input.Type }), }; }; const serializeAws_restJson1HlsGroupSettings = (input: HlsGroupSettings, context: __SerdeContext): any => { return { - ...(input.AdMarkers !== undefined && { - adMarkers: serializeAws_restJson1__listOfHlsAdMarkers(input.AdMarkers, context), - }), - ...(input.AdditionalManifests !== undefined && { - additionalManifests: serializeAws_restJson1__listOfHlsAdditionalManifest(input.AdditionalManifests, context), - }), - ...(input.AudioOnlyHeader !== undefined && { audioOnlyHeader: input.AudioOnlyHeader }), - ...(input.BaseUrl !== undefined && { baseUrl: input.BaseUrl }), - ...(input.CaptionLanguageMappings !== undefined && { - captionLanguageMappings: serializeAws_restJson1__listOfHlsCaptionLanguageMapping( - input.CaptionLanguageMappings, - context - ), - }), - ...(input.CaptionLanguageSetting !== undefined && { captionLanguageSetting: input.CaptionLanguageSetting }), - ...(input.ClientCache !== undefined && { clientCache: input.ClientCache }), - ...(input.CodecSpecification !== undefined && { codecSpecification: input.CodecSpecification }), - ...(input.Destination !== undefined && { destination: input.Destination }), - ...(input.DestinationSettings !== undefined && { - destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), - }), - ...(input.DirectoryStructure !== undefined && { directoryStructure: input.DirectoryStructure }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1HlsEncryptionSettings(input.Encryption, context), - }), - ...(input.ManifestCompression !== undefined && { manifestCompression: input.ManifestCompression }), - ...(input.ManifestDurationFormat !== undefined && { manifestDurationFormat: input.ManifestDurationFormat }), - ...(input.MinFinalSegmentLength !== undefined && { minFinalSegmentLength: input.MinFinalSegmentLength }), - ...(input.MinSegmentLength !== undefined && { minSegmentLength: input.MinSegmentLength }), - ...(input.OutputSelection !== undefined && { outputSelection: input.OutputSelection }), - ...(input.ProgramDateTime !== undefined && { programDateTime: input.ProgramDateTime }), - ...(input.ProgramDateTimePeriod !== undefined && { programDateTimePeriod: input.ProgramDateTimePeriod }), - ...(input.SegmentControl !== undefined && { segmentControl: input.SegmentControl }), - ...(input.SegmentLength !== undefined && { segmentLength: input.SegmentLength }), - ...(input.SegmentsPerSubdirectory !== undefined && { segmentsPerSubdirectory: input.SegmentsPerSubdirectory }), - ...(input.StreamInfResolution !== undefined && { streamInfResolution: input.StreamInfResolution }), - ...(input.TimedMetadataId3Frame !== undefined && { timedMetadataId3Frame: input.TimedMetadataId3Frame }), - ...(input.TimedMetadataId3Period !== undefined && { timedMetadataId3Period: input.TimedMetadataId3Period }), - ...(input.TimestampDeltaMilliseconds !== undefined && { - timestampDeltaMilliseconds: input.TimestampDeltaMilliseconds, - }), + ...(input.AdMarkers !== undefined && + input.AdMarkers !== null && { adMarkers: serializeAws_restJson1__listOfHlsAdMarkers(input.AdMarkers, context) }), + ...(input.AdditionalManifests !== undefined && + input.AdditionalManifests !== null && { + additionalManifests: serializeAws_restJson1__listOfHlsAdditionalManifest(input.AdditionalManifests, context), + }), + ...(input.AudioOnlyHeader !== undefined && + input.AudioOnlyHeader !== null && { audioOnlyHeader: input.AudioOnlyHeader }), + ...(input.BaseUrl !== undefined && input.BaseUrl !== null && { baseUrl: input.BaseUrl }), + ...(input.CaptionLanguageMappings !== undefined && + input.CaptionLanguageMappings !== null && { + captionLanguageMappings: serializeAws_restJson1__listOfHlsCaptionLanguageMapping( + input.CaptionLanguageMappings, + context + ), + }), + ...(input.CaptionLanguageSetting !== undefined && + input.CaptionLanguageSetting !== null && { captionLanguageSetting: input.CaptionLanguageSetting }), + ...(input.ClientCache !== undefined && input.ClientCache !== null && { clientCache: input.ClientCache }), + ...(input.CodecSpecification !== undefined && + input.CodecSpecification !== null && { codecSpecification: input.CodecSpecification }), + ...(input.Destination !== undefined && input.Destination !== null && { destination: input.Destination }), + ...(input.DestinationSettings !== undefined && + input.DestinationSettings !== null && { + destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), + }), + ...(input.DirectoryStructure !== undefined && + input.DirectoryStructure !== null && { directoryStructure: input.DirectoryStructure }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { + encryption: serializeAws_restJson1HlsEncryptionSettings(input.Encryption, context), + }), + ...(input.ManifestCompression !== undefined && + input.ManifestCompression !== null && { manifestCompression: input.ManifestCompression }), + ...(input.ManifestDurationFormat !== undefined && + input.ManifestDurationFormat !== null && { manifestDurationFormat: input.ManifestDurationFormat }), + ...(input.MinFinalSegmentLength !== undefined && + input.MinFinalSegmentLength !== null && { minFinalSegmentLength: input.MinFinalSegmentLength }), + ...(input.MinSegmentLength !== undefined && + input.MinSegmentLength !== null && { minSegmentLength: input.MinSegmentLength }), + ...(input.OutputSelection !== undefined && + input.OutputSelection !== null && { outputSelection: input.OutputSelection }), + ...(input.ProgramDateTime !== undefined && + input.ProgramDateTime !== null && { programDateTime: input.ProgramDateTime }), + ...(input.ProgramDateTimePeriod !== undefined && + input.ProgramDateTimePeriod !== null && { programDateTimePeriod: input.ProgramDateTimePeriod }), + ...(input.SegmentControl !== undefined && + input.SegmentControl !== null && { segmentControl: input.SegmentControl }), + ...(input.SegmentLength !== undefined && input.SegmentLength !== null && { segmentLength: input.SegmentLength }), + ...(input.SegmentsPerSubdirectory !== undefined && + input.SegmentsPerSubdirectory !== null && { segmentsPerSubdirectory: input.SegmentsPerSubdirectory }), + ...(input.StreamInfResolution !== undefined && + input.StreamInfResolution !== null && { streamInfResolution: input.StreamInfResolution }), + ...(input.TimedMetadataId3Frame !== undefined && + input.TimedMetadataId3Frame !== null && { timedMetadataId3Frame: input.TimedMetadataId3Frame }), + ...(input.TimedMetadataId3Period !== undefined && + input.TimedMetadataId3Period !== null && { timedMetadataId3Period: input.TimedMetadataId3Period }), + ...(input.TimestampDeltaMilliseconds !== undefined && + input.TimestampDeltaMilliseconds !== null && { timestampDeltaMilliseconds: input.TimestampDeltaMilliseconds }), }; }; const serializeAws_restJson1HlsSettings = (input: HlsSettings, context: __SerdeContext): any => { return { - ...(input.AudioGroupId !== undefined && { audioGroupId: input.AudioGroupId }), - ...(input.AudioOnlyContainer !== undefined && { audioOnlyContainer: input.AudioOnlyContainer }), - ...(input.AudioRenditionSets !== undefined && { audioRenditionSets: input.AudioRenditionSets }), - ...(input.AudioTrackType !== undefined && { audioTrackType: input.AudioTrackType }), - ...(input.IFrameOnlyManifest !== undefined && { iFrameOnlyManifest: input.IFrameOnlyManifest }), - ...(input.SegmentModifier !== undefined && { segmentModifier: input.SegmentModifier }), + ...(input.AudioGroupId !== undefined && input.AudioGroupId !== null && { audioGroupId: input.AudioGroupId }), + ...(input.AudioOnlyContainer !== undefined && + input.AudioOnlyContainer !== null && { audioOnlyContainer: input.AudioOnlyContainer }), + ...(input.AudioRenditionSets !== undefined && + input.AudioRenditionSets !== null && { audioRenditionSets: input.AudioRenditionSets }), + ...(input.AudioTrackType !== undefined && + input.AudioTrackType !== null && { audioTrackType: input.AudioTrackType }), + ...(input.IFrameOnlyManifest !== undefined && + input.IFrameOnlyManifest !== null && { iFrameOnlyManifest: input.IFrameOnlyManifest }), + ...(input.SegmentModifier !== undefined && + input.SegmentModifier !== null && { segmentModifier: input.SegmentModifier }), }; }; const serializeAws_restJson1HopDestination = (input: HopDestination, context: __SerdeContext): any => { return { - ...(input.Priority !== undefined && { priority: input.Priority }), - ...(input.Queue !== undefined && { queue: input.Queue }), - ...(input.WaitMinutes !== undefined && { waitMinutes: input.WaitMinutes }), + ...(input.Priority !== undefined && input.Priority !== null && { priority: input.Priority }), + ...(input.Queue !== undefined && input.Queue !== null && { queue: input.Queue }), + ...(input.WaitMinutes !== undefined && input.WaitMinutes !== null && { waitMinutes: input.WaitMinutes }), }; }; const serializeAws_restJson1Id3Insertion = (input: Id3Insertion, context: __SerdeContext): any => { return { - ...(input.Id3 !== undefined && { id3: input.Id3 }), - ...(input.Timecode !== undefined && { timecode: input.Timecode }), + ...(input.Id3 !== undefined && input.Id3 !== null && { id3: input.Id3 }), + ...(input.Timecode !== undefined && input.Timecode !== null && { timecode: input.Timecode }), }; }; const serializeAws_restJson1ImageInserter = (input: ImageInserter, context: __SerdeContext): any => { return { - ...(input.InsertableImages !== undefined && { - insertableImages: serializeAws_restJson1__listOfInsertableImage(input.InsertableImages, context), - }), + ...(input.InsertableImages !== undefined && + input.InsertableImages !== null && { + insertableImages: serializeAws_restJson1__listOfInsertableImage(input.InsertableImages, context), + }), }; }; @@ -4709,55 +5089,68 @@ const serializeAws_restJson1ImscDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.StylePassthrough !== undefined && { stylePassthrough: input.StylePassthrough }), + ...(input.StylePassthrough !== undefined && + input.StylePassthrough !== null && { stylePassthrough: input.StylePassthrough }), }; }; const serializeAws_restJson1Input = (input: Input, context: __SerdeContext): any => { return { - ...(input.AudioSelectorGroups !== undefined && { - audioSelectorGroups: serializeAws_restJson1__mapOfAudioSelectorGroup(input.AudioSelectorGroups, context), - }), - ...(input.AudioSelectors !== undefined && { - audioSelectors: serializeAws_restJson1__mapOfAudioSelector(input.AudioSelectors, context), - }), - ...(input.CaptionSelectors !== undefined && { - captionSelectors: serializeAws_restJson1__mapOfCaptionSelector(input.CaptionSelectors, context), - }), - ...(input.Crop !== undefined && { crop: serializeAws_restJson1Rectangle(input.Crop, context) }), - ...(input.DeblockFilter !== undefined && { deblockFilter: input.DeblockFilter }), - ...(input.DecryptionSettings !== undefined && { - decryptionSettings: serializeAws_restJson1InputDecryptionSettings(input.DecryptionSettings, context), - }), - ...(input.DenoiseFilter !== undefined && { denoiseFilter: input.DenoiseFilter }), - ...(input.FileInput !== undefined && { fileInput: input.FileInput }), - ...(input.FilterEnable !== undefined && { filterEnable: input.FilterEnable }), - ...(input.FilterStrength !== undefined && { filterStrength: input.FilterStrength }), - ...(input.ImageInserter !== undefined && { - imageInserter: serializeAws_restJson1ImageInserter(input.ImageInserter, context), - }), - ...(input.InputClippings !== undefined && { - inputClippings: serializeAws_restJson1__listOfInputClipping(input.InputClippings, context), - }), - ...(input.InputScanType !== undefined && { inputScanType: input.InputScanType }), - ...(input.Position !== undefined && { position: serializeAws_restJson1Rectangle(input.Position, context) }), - ...(input.ProgramNumber !== undefined && { programNumber: input.ProgramNumber }), - ...(input.PsiControl !== undefined && { psiControl: input.PsiControl }), - ...(input.SupplementalImps !== undefined && { - supplementalImps: serializeAws_restJson1__listOf__stringPatternS3ASSETMAPXml(input.SupplementalImps, context), - }), - ...(input.TimecodeSource !== undefined && { timecodeSource: input.TimecodeSource }), - ...(input.TimecodeStart !== undefined && { timecodeStart: input.TimecodeStart }), - ...(input.VideoSelector !== undefined && { - videoSelector: serializeAws_restJson1VideoSelector(input.VideoSelector, context), - }), + ...(input.AudioSelectorGroups !== undefined && + input.AudioSelectorGroups !== null && { + audioSelectorGroups: serializeAws_restJson1__mapOfAudioSelectorGroup(input.AudioSelectorGroups, context), + }), + ...(input.AudioSelectors !== undefined && + input.AudioSelectors !== null && { + audioSelectors: serializeAws_restJson1__mapOfAudioSelector(input.AudioSelectors, context), + }), + ...(input.CaptionSelectors !== undefined && + input.CaptionSelectors !== null && { + captionSelectors: serializeAws_restJson1__mapOfCaptionSelector(input.CaptionSelectors, context), + }), + ...(input.Crop !== undefined && + input.Crop !== null && { crop: serializeAws_restJson1Rectangle(input.Crop, context) }), + ...(input.DeblockFilter !== undefined && input.DeblockFilter !== null && { deblockFilter: input.DeblockFilter }), + ...(input.DecryptionSettings !== undefined && + input.DecryptionSettings !== null && { + decryptionSettings: serializeAws_restJson1InputDecryptionSettings(input.DecryptionSettings, context), + }), + ...(input.DenoiseFilter !== undefined && input.DenoiseFilter !== null && { denoiseFilter: input.DenoiseFilter }), + ...(input.FileInput !== undefined && input.FileInput !== null && { fileInput: input.FileInput }), + ...(input.FilterEnable !== undefined && input.FilterEnable !== null && { filterEnable: input.FilterEnable }), + ...(input.FilterStrength !== undefined && + input.FilterStrength !== null && { filterStrength: input.FilterStrength }), + ...(input.ImageInserter !== undefined && + input.ImageInserter !== null && { + imageInserter: serializeAws_restJson1ImageInserter(input.ImageInserter, context), + }), + ...(input.InputClippings !== undefined && + input.InputClippings !== null && { + inputClippings: serializeAws_restJson1__listOfInputClipping(input.InputClippings, context), + }), + ...(input.InputScanType !== undefined && input.InputScanType !== null && { inputScanType: input.InputScanType }), + ...(input.Position !== undefined && + input.Position !== null && { position: serializeAws_restJson1Rectangle(input.Position, context) }), + ...(input.ProgramNumber !== undefined && input.ProgramNumber !== null && { programNumber: input.ProgramNumber }), + ...(input.PsiControl !== undefined && input.PsiControl !== null && { psiControl: input.PsiControl }), + ...(input.SupplementalImps !== undefined && + input.SupplementalImps !== null && { + supplementalImps: serializeAws_restJson1__listOf__stringPatternS3ASSETMAPXml(input.SupplementalImps, context), + }), + ...(input.TimecodeSource !== undefined && + input.TimecodeSource !== null && { timecodeSource: input.TimecodeSource }), + ...(input.TimecodeStart !== undefined && input.TimecodeStart !== null && { timecodeStart: input.TimecodeStart }), + ...(input.VideoSelector !== undefined && + input.VideoSelector !== null && { + videoSelector: serializeAws_restJson1VideoSelector(input.VideoSelector, context), + }), }; }; const serializeAws_restJson1InputClipping = (input: InputClipping, context: __SerdeContext): any => { return { - ...(input.EndTimecode !== undefined && { endTimecode: input.EndTimecode }), - ...(input.StartTimecode !== undefined && { startTimecode: input.StartTimecode }), + ...(input.EndTimecode !== undefined && input.EndTimecode !== null && { endTimecode: input.EndTimecode }), + ...(input.StartTimecode !== undefined && input.StartTimecode !== null && { startTimecode: input.StartTimecode }), }; }; @@ -4766,223 +5159,278 @@ const serializeAws_restJson1InputDecryptionSettings = ( context: __SerdeContext ): any => { return { - ...(input.DecryptionMode !== undefined && { decryptionMode: input.DecryptionMode }), - ...(input.EncryptedDecryptionKey !== undefined && { encryptedDecryptionKey: input.EncryptedDecryptionKey }), - ...(input.InitializationVector !== undefined && { initializationVector: input.InitializationVector }), - ...(input.KmsKeyRegion !== undefined && { kmsKeyRegion: input.KmsKeyRegion }), + ...(input.DecryptionMode !== undefined && + input.DecryptionMode !== null && { decryptionMode: input.DecryptionMode }), + ...(input.EncryptedDecryptionKey !== undefined && + input.EncryptedDecryptionKey !== null && { encryptedDecryptionKey: input.EncryptedDecryptionKey }), + ...(input.InitializationVector !== undefined && + input.InitializationVector !== null && { initializationVector: input.InitializationVector }), + ...(input.KmsKeyRegion !== undefined && input.KmsKeyRegion !== null && { kmsKeyRegion: input.KmsKeyRegion }), }; }; const serializeAws_restJson1InputTemplate = (input: InputTemplate, context: __SerdeContext): any => { return { - ...(input.AudioSelectorGroups !== undefined && { - audioSelectorGroups: serializeAws_restJson1__mapOfAudioSelectorGroup(input.AudioSelectorGroups, context), - }), - ...(input.AudioSelectors !== undefined && { - audioSelectors: serializeAws_restJson1__mapOfAudioSelector(input.AudioSelectors, context), - }), - ...(input.CaptionSelectors !== undefined && { - captionSelectors: serializeAws_restJson1__mapOfCaptionSelector(input.CaptionSelectors, context), - }), - ...(input.Crop !== undefined && { crop: serializeAws_restJson1Rectangle(input.Crop, context) }), - ...(input.DeblockFilter !== undefined && { deblockFilter: input.DeblockFilter }), - ...(input.DenoiseFilter !== undefined && { denoiseFilter: input.DenoiseFilter }), - ...(input.FilterEnable !== undefined && { filterEnable: input.FilterEnable }), - ...(input.FilterStrength !== undefined && { filterStrength: input.FilterStrength }), - ...(input.ImageInserter !== undefined && { - imageInserter: serializeAws_restJson1ImageInserter(input.ImageInserter, context), - }), - ...(input.InputClippings !== undefined && { - inputClippings: serializeAws_restJson1__listOfInputClipping(input.InputClippings, context), - }), - ...(input.InputScanType !== undefined && { inputScanType: input.InputScanType }), - ...(input.Position !== undefined && { position: serializeAws_restJson1Rectangle(input.Position, context) }), - ...(input.ProgramNumber !== undefined && { programNumber: input.ProgramNumber }), - ...(input.PsiControl !== undefined && { psiControl: input.PsiControl }), - ...(input.TimecodeSource !== undefined && { timecodeSource: input.TimecodeSource }), - ...(input.TimecodeStart !== undefined && { timecodeStart: input.TimecodeStart }), - ...(input.VideoSelector !== undefined && { - videoSelector: serializeAws_restJson1VideoSelector(input.VideoSelector, context), - }), + ...(input.AudioSelectorGroups !== undefined && + input.AudioSelectorGroups !== null && { + audioSelectorGroups: serializeAws_restJson1__mapOfAudioSelectorGroup(input.AudioSelectorGroups, context), + }), + ...(input.AudioSelectors !== undefined && + input.AudioSelectors !== null && { + audioSelectors: serializeAws_restJson1__mapOfAudioSelector(input.AudioSelectors, context), + }), + ...(input.CaptionSelectors !== undefined && + input.CaptionSelectors !== null && { + captionSelectors: serializeAws_restJson1__mapOfCaptionSelector(input.CaptionSelectors, context), + }), + ...(input.Crop !== undefined && + input.Crop !== null && { crop: serializeAws_restJson1Rectangle(input.Crop, context) }), + ...(input.DeblockFilter !== undefined && input.DeblockFilter !== null && { deblockFilter: input.DeblockFilter }), + ...(input.DenoiseFilter !== undefined && input.DenoiseFilter !== null && { denoiseFilter: input.DenoiseFilter }), + ...(input.FilterEnable !== undefined && input.FilterEnable !== null && { filterEnable: input.FilterEnable }), + ...(input.FilterStrength !== undefined && + input.FilterStrength !== null && { filterStrength: input.FilterStrength }), + ...(input.ImageInserter !== undefined && + input.ImageInserter !== null && { + imageInserter: serializeAws_restJson1ImageInserter(input.ImageInserter, context), + }), + ...(input.InputClippings !== undefined && + input.InputClippings !== null && { + inputClippings: serializeAws_restJson1__listOfInputClipping(input.InputClippings, context), + }), + ...(input.InputScanType !== undefined && input.InputScanType !== null && { inputScanType: input.InputScanType }), + ...(input.Position !== undefined && + input.Position !== null && { position: serializeAws_restJson1Rectangle(input.Position, context) }), + ...(input.ProgramNumber !== undefined && input.ProgramNumber !== null && { programNumber: input.ProgramNumber }), + ...(input.PsiControl !== undefined && input.PsiControl !== null && { psiControl: input.PsiControl }), + ...(input.TimecodeSource !== undefined && + input.TimecodeSource !== null && { timecodeSource: input.TimecodeSource }), + ...(input.TimecodeStart !== undefined && input.TimecodeStart !== null && { timecodeStart: input.TimecodeStart }), + ...(input.VideoSelector !== undefined && + input.VideoSelector !== null && { + videoSelector: serializeAws_restJson1VideoSelector(input.VideoSelector, context), + }), }; }; const serializeAws_restJson1InsertableImage = (input: InsertableImage, context: __SerdeContext): any => { return { - ...(input.Duration !== undefined && { duration: input.Duration }), - ...(input.FadeIn !== undefined && { fadeIn: input.FadeIn }), - ...(input.FadeOut !== undefined && { fadeOut: input.FadeOut }), - ...(input.Height !== undefined && { height: input.Height }), - ...(input.ImageInserterInput !== undefined && { imageInserterInput: input.ImageInserterInput }), - ...(input.ImageX !== undefined && { imageX: input.ImageX }), - ...(input.ImageY !== undefined && { imageY: input.ImageY }), - ...(input.Layer !== undefined && { layer: input.Layer }), - ...(input.Opacity !== undefined && { opacity: input.Opacity }), - ...(input.StartTime !== undefined && { startTime: input.StartTime }), - ...(input.Width !== undefined && { width: input.Width }), + ...(input.Duration !== undefined && input.Duration !== null && { duration: input.Duration }), + ...(input.FadeIn !== undefined && input.FadeIn !== null && { fadeIn: input.FadeIn }), + ...(input.FadeOut !== undefined && input.FadeOut !== null && { fadeOut: input.FadeOut }), + ...(input.Height !== undefined && input.Height !== null && { height: input.Height }), + ...(input.ImageInserterInput !== undefined && + input.ImageInserterInput !== null && { imageInserterInput: input.ImageInserterInput }), + ...(input.ImageX !== undefined && input.ImageX !== null && { imageX: input.ImageX }), + ...(input.ImageY !== undefined && input.ImageY !== null && { imageY: input.ImageY }), + ...(input.Layer !== undefined && input.Layer !== null && { layer: input.Layer }), + ...(input.Opacity !== undefined && input.Opacity !== null && { opacity: input.Opacity }), + ...(input.StartTime !== undefined && input.StartTime !== null && { startTime: input.StartTime }), + ...(input.Width !== undefined && input.Width !== null && { width: input.Width }), }; }; const serializeAws_restJson1JobSettings = (input: JobSettings, context: __SerdeContext): any => { return { - ...(input.AdAvailOffset !== undefined && { adAvailOffset: input.AdAvailOffset }), - ...(input.AvailBlanking !== undefined && { - availBlanking: serializeAws_restJson1AvailBlanking(input.AvailBlanking, context), - }), - ...(input.Esam !== undefined && { esam: serializeAws_restJson1EsamSettings(input.Esam, context) }), - ...(input.Inputs !== undefined && { inputs: serializeAws_restJson1__listOfInput(input.Inputs, context) }), - ...(input.MotionImageInserter !== undefined && { - motionImageInserter: serializeAws_restJson1MotionImageInserter(input.MotionImageInserter, context), - }), - ...(input.NielsenConfiguration !== undefined && { - nielsenConfiguration: serializeAws_restJson1NielsenConfiguration(input.NielsenConfiguration, context), - }), - ...(input.NielsenNonLinearWatermark !== undefined && { - nielsenNonLinearWatermark: serializeAws_restJson1NielsenNonLinearWatermarkSettings( - input.NielsenNonLinearWatermark, - context - ), - }), - ...(input.OutputGroups !== undefined && { - outputGroups: serializeAws_restJson1__listOfOutputGroup(input.OutputGroups, context), - }), - ...(input.TimecodeConfig !== undefined && { - timecodeConfig: serializeAws_restJson1TimecodeConfig(input.TimecodeConfig, context), - }), - ...(input.TimedMetadataInsertion !== undefined && { - timedMetadataInsertion: serializeAws_restJson1TimedMetadataInsertion(input.TimedMetadataInsertion, context), - }), + ...(input.AdAvailOffset !== undefined && input.AdAvailOffset !== null && { adAvailOffset: input.AdAvailOffset }), + ...(input.AvailBlanking !== undefined && + input.AvailBlanking !== null && { + availBlanking: serializeAws_restJson1AvailBlanking(input.AvailBlanking, context), + }), + ...(input.Esam !== undefined && + input.Esam !== null && { esam: serializeAws_restJson1EsamSettings(input.Esam, context) }), + ...(input.Inputs !== undefined && + input.Inputs !== null && { inputs: serializeAws_restJson1__listOfInput(input.Inputs, context) }), + ...(input.MotionImageInserter !== undefined && + input.MotionImageInserter !== null && { + motionImageInserter: serializeAws_restJson1MotionImageInserter(input.MotionImageInserter, context), + }), + ...(input.NielsenConfiguration !== undefined && + input.NielsenConfiguration !== null && { + nielsenConfiguration: serializeAws_restJson1NielsenConfiguration(input.NielsenConfiguration, context), + }), + ...(input.NielsenNonLinearWatermark !== undefined && + input.NielsenNonLinearWatermark !== null && { + nielsenNonLinearWatermark: serializeAws_restJson1NielsenNonLinearWatermarkSettings( + input.NielsenNonLinearWatermark, + context + ), + }), + ...(input.OutputGroups !== undefined && + input.OutputGroups !== null && { + outputGroups: serializeAws_restJson1__listOfOutputGroup(input.OutputGroups, context), + }), + ...(input.TimecodeConfig !== undefined && + input.TimecodeConfig !== null && { + timecodeConfig: serializeAws_restJson1TimecodeConfig(input.TimecodeConfig, context), + }), + ...(input.TimedMetadataInsertion !== undefined && + input.TimedMetadataInsertion !== null && { + timedMetadataInsertion: serializeAws_restJson1TimedMetadataInsertion(input.TimedMetadataInsertion, context), + }), }; }; const serializeAws_restJson1JobTemplateSettings = (input: JobTemplateSettings, context: __SerdeContext): any => { return { - ...(input.AdAvailOffset !== undefined && { adAvailOffset: input.AdAvailOffset }), - ...(input.AvailBlanking !== undefined && { - availBlanking: serializeAws_restJson1AvailBlanking(input.AvailBlanking, context), - }), - ...(input.Esam !== undefined && { esam: serializeAws_restJson1EsamSettings(input.Esam, context) }), - ...(input.Inputs !== undefined && { inputs: serializeAws_restJson1__listOfInputTemplate(input.Inputs, context) }), - ...(input.MotionImageInserter !== undefined && { - motionImageInserter: serializeAws_restJson1MotionImageInserter(input.MotionImageInserter, context), - }), - ...(input.NielsenConfiguration !== undefined && { - nielsenConfiguration: serializeAws_restJson1NielsenConfiguration(input.NielsenConfiguration, context), - }), - ...(input.NielsenNonLinearWatermark !== undefined && { - nielsenNonLinearWatermark: serializeAws_restJson1NielsenNonLinearWatermarkSettings( - input.NielsenNonLinearWatermark, - context - ), - }), - ...(input.OutputGroups !== undefined && { - outputGroups: serializeAws_restJson1__listOfOutputGroup(input.OutputGroups, context), - }), - ...(input.TimecodeConfig !== undefined && { - timecodeConfig: serializeAws_restJson1TimecodeConfig(input.TimecodeConfig, context), - }), - ...(input.TimedMetadataInsertion !== undefined && { - timedMetadataInsertion: serializeAws_restJson1TimedMetadataInsertion(input.TimedMetadataInsertion, context), - }), + ...(input.AdAvailOffset !== undefined && input.AdAvailOffset !== null && { adAvailOffset: input.AdAvailOffset }), + ...(input.AvailBlanking !== undefined && + input.AvailBlanking !== null && { + availBlanking: serializeAws_restJson1AvailBlanking(input.AvailBlanking, context), + }), + ...(input.Esam !== undefined && + input.Esam !== null && { esam: serializeAws_restJson1EsamSettings(input.Esam, context) }), + ...(input.Inputs !== undefined && + input.Inputs !== null && { inputs: serializeAws_restJson1__listOfInputTemplate(input.Inputs, context) }), + ...(input.MotionImageInserter !== undefined && + input.MotionImageInserter !== null && { + motionImageInserter: serializeAws_restJson1MotionImageInserter(input.MotionImageInserter, context), + }), + ...(input.NielsenConfiguration !== undefined && + input.NielsenConfiguration !== null && { + nielsenConfiguration: serializeAws_restJson1NielsenConfiguration(input.NielsenConfiguration, context), + }), + ...(input.NielsenNonLinearWatermark !== undefined && + input.NielsenNonLinearWatermark !== null && { + nielsenNonLinearWatermark: serializeAws_restJson1NielsenNonLinearWatermarkSettings( + input.NielsenNonLinearWatermark, + context + ), + }), + ...(input.OutputGroups !== undefined && + input.OutputGroups !== null && { + outputGroups: serializeAws_restJson1__listOfOutputGroup(input.OutputGroups, context), + }), + ...(input.TimecodeConfig !== undefined && + input.TimecodeConfig !== null && { + timecodeConfig: serializeAws_restJson1TimecodeConfig(input.TimecodeConfig, context), + }), + ...(input.TimedMetadataInsertion !== undefined && + input.TimedMetadataInsertion !== null && { + timedMetadataInsertion: serializeAws_restJson1TimedMetadataInsertion(input.TimedMetadataInsertion, context), + }), }; }; const serializeAws_restJson1M2tsScte35Esam = (input: M2tsScte35Esam, context: __SerdeContext): any => { return { - ...(input.Scte35EsamPid !== undefined && { scte35EsamPid: input.Scte35EsamPid }), + ...(input.Scte35EsamPid !== undefined && input.Scte35EsamPid !== null && { scte35EsamPid: input.Scte35EsamPid }), }; }; const serializeAws_restJson1M2tsSettings = (input: M2tsSettings, context: __SerdeContext): any => { return { - ...(input.AudioBufferModel !== undefined && { audioBufferModel: input.AudioBufferModel }), - ...(input.AudioDuration !== undefined && { audioDuration: input.AudioDuration }), - ...(input.AudioFramesPerPes !== undefined && { audioFramesPerPes: input.AudioFramesPerPes }), - ...(input.AudioPids !== undefined && { - audioPids: serializeAws_restJson1__listOf__integerMin32Max8182(input.AudioPids, context), - }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.BufferModel !== undefined && { bufferModel: input.BufferModel }), - ...(input.DvbNitSettings !== undefined && { - dvbNitSettings: serializeAws_restJson1DvbNitSettings(input.DvbNitSettings, context), - }), - ...(input.DvbSdtSettings !== undefined && { - dvbSdtSettings: serializeAws_restJson1DvbSdtSettings(input.DvbSdtSettings, context), - }), - ...(input.DvbSubPids !== undefined && { - dvbSubPids: serializeAws_restJson1__listOf__integerMin32Max8182(input.DvbSubPids, context), - }), - ...(input.DvbTdtSettings !== undefined && { - dvbTdtSettings: serializeAws_restJson1DvbTdtSettings(input.DvbTdtSettings, context), - }), - ...(input.DvbTeletextPid !== undefined && { dvbTeletextPid: input.DvbTeletextPid }), - ...(input.EbpAudioInterval !== undefined && { ebpAudioInterval: input.EbpAudioInterval }), - ...(input.EbpPlacement !== undefined && { ebpPlacement: input.EbpPlacement }), - ...(input.EsRateInPes !== undefined && { esRateInPes: input.EsRateInPes }), - ...(input.ForceTsVideoEbpOrder !== undefined && { forceTsVideoEbpOrder: input.ForceTsVideoEbpOrder }), - ...(input.FragmentTime !== undefined && { fragmentTime: input.FragmentTime }), - ...(input.MaxPcrInterval !== undefined && { maxPcrInterval: input.MaxPcrInterval }), - ...(input.MinEbpInterval !== undefined && { minEbpInterval: input.MinEbpInterval }), - ...(input.NielsenId3 !== undefined && { nielsenId3: input.NielsenId3 }), - ...(input.NullPacketBitrate !== undefined && { nullPacketBitrate: input.NullPacketBitrate }), - ...(input.PatInterval !== undefined && { patInterval: input.PatInterval }), - ...(input.PcrControl !== undefined && { pcrControl: input.PcrControl }), - ...(input.PcrPid !== undefined && { pcrPid: input.PcrPid }), - ...(input.PmtInterval !== undefined && { pmtInterval: input.PmtInterval }), - ...(input.PmtPid !== undefined && { pmtPid: input.PmtPid }), - ...(input.PrivateMetadataPid !== undefined && { privateMetadataPid: input.PrivateMetadataPid }), - ...(input.ProgramNumber !== undefined && { programNumber: input.ProgramNumber }), - ...(input.RateMode !== undefined && { rateMode: input.RateMode }), - ...(input.Scte35Esam !== undefined && { - scte35Esam: serializeAws_restJson1M2tsScte35Esam(input.Scte35Esam, context), - }), - ...(input.Scte35Pid !== undefined && { scte35Pid: input.Scte35Pid }), - ...(input.Scte35Source !== undefined && { scte35Source: input.Scte35Source }), - ...(input.SegmentationMarkers !== undefined && { segmentationMarkers: input.SegmentationMarkers }), - ...(input.SegmentationStyle !== undefined && { segmentationStyle: input.SegmentationStyle }), - ...(input.SegmentationTime !== undefined && { segmentationTime: input.SegmentationTime }), - ...(input.TimedMetadataPid !== undefined && { timedMetadataPid: input.TimedMetadataPid }), - ...(input.TransportStreamId !== undefined && { transportStreamId: input.TransportStreamId }), - ...(input.VideoPid !== undefined && { videoPid: input.VideoPid }), + ...(input.AudioBufferModel !== undefined && + input.AudioBufferModel !== null && { audioBufferModel: input.AudioBufferModel }), + ...(input.AudioDuration !== undefined && input.AudioDuration !== null && { audioDuration: input.AudioDuration }), + ...(input.AudioFramesPerPes !== undefined && + input.AudioFramesPerPes !== null && { audioFramesPerPes: input.AudioFramesPerPes }), + ...(input.AudioPids !== undefined && + input.AudioPids !== null && { + audioPids: serializeAws_restJson1__listOf__integerMin32Max8182(input.AudioPids, context), + }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.BufferModel !== undefined && input.BufferModel !== null && { bufferModel: input.BufferModel }), + ...(input.DvbNitSettings !== undefined && + input.DvbNitSettings !== null && { + dvbNitSettings: serializeAws_restJson1DvbNitSettings(input.DvbNitSettings, context), + }), + ...(input.DvbSdtSettings !== undefined && + input.DvbSdtSettings !== null && { + dvbSdtSettings: serializeAws_restJson1DvbSdtSettings(input.DvbSdtSettings, context), + }), + ...(input.DvbSubPids !== undefined && + input.DvbSubPids !== null && { + dvbSubPids: serializeAws_restJson1__listOf__integerMin32Max8182(input.DvbSubPids, context), + }), + ...(input.DvbTdtSettings !== undefined && + input.DvbTdtSettings !== null && { + dvbTdtSettings: serializeAws_restJson1DvbTdtSettings(input.DvbTdtSettings, context), + }), + ...(input.DvbTeletextPid !== undefined && + input.DvbTeletextPid !== null && { dvbTeletextPid: input.DvbTeletextPid }), + ...(input.EbpAudioInterval !== undefined && + input.EbpAudioInterval !== null && { ebpAudioInterval: input.EbpAudioInterval }), + ...(input.EbpPlacement !== undefined && input.EbpPlacement !== null && { ebpPlacement: input.EbpPlacement }), + ...(input.EsRateInPes !== undefined && input.EsRateInPes !== null && { esRateInPes: input.EsRateInPes }), + ...(input.ForceTsVideoEbpOrder !== undefined && + input.ForceTsVideoEbpOrder !== null && { forceTsVideoEbpOrder: input.ForceTsVideoEbpOrder }), + ...(input.FragmentTime !== undefined && input.FragmentTime !== null && { fragmentTime: input.FragmentTime }), + ...(input.MaxPcrInterval !== undefined && + input.MaxPcrInterval !== null && { maxPcrInterval: input.MaxPcrInterval }), + ...(input.MinEbpInterval !== undefined && + input.MinEbpInterval !== null && { minEbpInterval: input.MinEbpInterval }), + ...(input.NielsenId3 !== undefined && input.NielsenId3 !== null && { nielsenId3: input.NielsenId3 }), + ...(input.NullPacketBitrate !== undefined && + input.NullPacketBitrate !== null && { nullPacketBitrate: input.NullPacketBitrate }), + ...(input.PatInterval !== undefined && input.PatInterval !== null && { patInterval: input.PatInterval }), + ...(input.PcrControl !== undefined && input.PcrControl !== null && { pcrControl: input.PcrControl }), + ...(input.PcrPid !== undefined && input.PcrPid !== null && { pcrPid: input.PcrPid }), + ...(input.PmtInterval !== undefined && input.PmtInterval !== null && { pmtInterval: input.PmtInterval }), + ...(input.PmtPid !== undefined && input.PmtPid !== null && { pmtPid: input.PmtPid }), + ...(input.PrivateMetadataPid !== undefined && + input.PrivateMetadataPid !== null && { privateMetadataPid: input.PrivateMetadataPid }), + ...(input.ProgramNumber !== undefined && input.ProgramNumber !== null && { programNumber: input.ProgramNumber }), + ...(input.RateMode !== undefined && input.RateMode !== null && { rateMode: input.RateMode }), + ...(input.Scte35Esam !== undefined && + input.Scte35Esam !== null && { scte35Esam: serializeAws_restJson1M2tsScte35Esam(input.Scte35Esam, context) }), + ...(input.Scte35Pid !== undefined && input.Scte35Pid !== null && { scte35Pid: input.Scte35Pid }), + ...(input.Scte35Source !== undefined && input.Scte35Source !== null && { scte35Source: input.Scte35Source }), + ...(input.SegmentationMarkers !== undefined && + input.SegmentationMarkers !== null && { segmentationMarkers: input.SegmentationMarkers }), + ...(input.SegmentationStyle !== undefined && + input.SegmentationStyle !== null && { segmentationStyle: input.SegmentationStyle }), + ...(input.SegmentationTime !== undefined && + input.SegmentationTime !== null && { segmentationTime: input.SegmentationTime }), + ...(input.TimedMetadataPid !== undefined && + input.TimedMetadataPid !== null && { timedMetadataPid: input.TimedMetadataPid }), + ...(input.TransportStreamId !== undefined && + input.TransportStreamId !== null && { transportStreamId: input.TransportStreamId }), + ...(input.VideoPid !== undefined && input.VideoPid !== null && { videoPid: input.VideoPid }), }; }; const serializeAws_restJson1M3u8Settings = (input: M3u8Settings, context: __SerdeContext): any => { return { - ...(input.AudioDuration !== undefined && { audioDuration: input.AudioDuration }), - ...(input.AudioFramesPerPes !== undefined && { audioFramesPerPes: input.AudioFramesPerPes }), - ...(input.AudioPids !== undefined && { - audioPids: serializeAws_restJson1__listOf__integerMin32Max8182(input.AudioPids, context), - }), - ...(input.NielsenId3 !== undefined && { nielsenId3: input.NielsenId3 }), - ...(input.PatInterval !== undefined && { patInterval: input.PatInterval }), - ...(input.PcrControl !== undefined && { pcrControl: input.PcrControl }), - ...(input.PcrPid !== undefined && { pcrPid: input.PcrPid }), - ...(input.PmtInterval !== undefined && { pmtInterval: input.PmtInterval }), - ...(input.PmtPid !== undefined && { pmtPid: input.PmtPid }), - ...(input.PrivateMetadataPid !== undefined && { privateMetadataPid: input.PrivateMetadataPid }), - ...(input.ProgramNumber !== undefined && { programNumber: input.ProgramNumber }), - ...(input.Scte35Pid !== undefined && { scte35Pid: input.Scte35Pid }), - ...(input.Scte35Source !== undefined && { scte35Source: input.Scte35Source }), - ...(input.TimedMetadata !== undefined && { timedMetadata: input.TimedMetadata }), - ...(input.TimedMetadataPid !== undefined && { timedMetadataPid: input.TimedMetadataPid }), - ...(input.TransportStreamId !== undefined && { transportStreamId: input.TransportStreamId }), - ...(input.VideoPid !== undefined && { videoPid: input.VideoPid }), + ...(input.AudioDuration !== undefined && input.AudioDuration !== null && { audioDuration: input.AudioDuration }), + ...(input.AudioFramesPerPes !== undefined && + input.AudioFramesPerPes !== null && { audioFramesPerPes: input.AudioFramesPerPes }), + ...(input.AudioPids !== undefined && + input.AudioPids !== null && { + audioPids: serializeAws_restJson1__listOf__integerMin32Max8182(input.AudioPids, context), + }), + ...(input.NielsenId3 !== undefined && input.NielsenId3 !== null && { nielsenId3: input.NielsenId3 }), + ...(input.PatInterval !== undefined && input.PatInterval !== null && { patInterval: input.PatInterval }), + ...(input.PcrControl !== undefined && input.PcrControl !== null && { pcrControl: input.PcrControl }), + ...(input.PcrPid !== undefined && input.PcrPid !== null && { pcrPid: input.PcrPid }), + ...(input.PmtInterval !== undefined && input.PmtInterval !== null && { pmtInterval: input.PmtInterval }), + ...(input.PmtPid !== undefined && input.PmtPid !== null && { pmtPid: input.PmtPid }), + ...(input.PrivateMetadataPid !== undefined && + input.PrivateMetadataPid !== null && { privateMetadataPid: input.PrivateMetadataPid }), + ...(input.ProgramNumber !== undefined && input.ProgramNumber !== null && { programNumber: input.ProgramNumber }), + ...(input.Scte35Pid !== undefined && input.Scte35Pid !== null && { scte35Pid: input.Scte35Pid }), + ...(input.Scte35Source !== undefined && input.Scte35Source !== null && { scte35Source: input.Scte35Source }), + ...(input.TimedMetadata !== undefined && input.TimedMetadata !== null && { timedMetadata: input.TimedMetadata }), + ...(input.TimedMetadataPid !== undefined && + input.TimedMetadataPid !== null && { timedMetadataPid: input.TimedMetadataPid }), + ...(input.TransportStreamId !== undefined && + input.TransportStreamId !== null && { transportStreamId: input.TransportStreamId }), + ...(input.VideoPid !== undefined && input.VideoPid !== null && { videoPid: input.VideoPid }), }; }; const serializeAws_restJson1MotionImageInserter = (input: MotionImageInserter, context: __SerdeContext): any => { return { - ...(input.Framerate !== undefined && { - framerate: serializeAws_restJson1MotionImageInsertionFramerate(input.Framerate, context), - }), - ...(input.Input !== undefined && { input: input.Input }), - ...(input.InsertionMode !== undefined && { insertionMode: input.InsertionMode }), - ...(input.Offset !== undefined && { - offset: serializeAws_restJson1MotionImageInsertionOffset(input.Offset, context), - }), - ...(input.Playback !== undefined && { playback: input.Playback }), - ...(input.StartTime !== undefined && { startTime: input.StartTime }), + ...(input.Framerate !== undefined && + input.Framerate !== null && { + framerate: serializeAws_restJson1MotionImageInsertionFramerate(input.Framerate, context), + }), + ...(input.Input !== undefined && input.Input !== null && { input: input.Input }), + ...(input.InsertionMode !== undefined && input.InsertionMode !== null && { insertionMode: input.InsertionMode }), + ...(input.Offset !== undefined && + input.Offset !== null && { offset: serializeAws_restJson1MotionImageInsertionOffset(input.Offset, context) }), + ...(input.Playback !== undefined && input.Playback !== null && { playback: input.Playback }), + ...(input.StartTime !== undefined && input.StartTime !== null && { startTime: input.StartTime }), }; }; @@ -4991,8 +5439,10 @@ const serializeAws_restJson1MotionImageInsertionFramerate = ( context: __SerdeContext ): any => { return { - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), }; }; @@ -5001,105 +5451,121 @@ const serializeAws_restJson1MotionImageInsertionOffset = ( context: __SerdeContext ): any => { return { - ...(input.ImageX !== undefined && { imageX: input.ImageX }), - ...(input.ImageY !== undefined && { imageY: input.ImageY }), + ...(input.ImageX !== undefined && input.ImageX !== null && { imageX: input.ImageX }), + ...(input.ImageY !== undefined && input.ImageY !== null && { imageY: input.ImageY }), }; }; const serializeAws_restJson1MovSettings = (input: MovSettings, context: __SerdeContext): any => { return { - ...(input.ClapAtom !== undefined && { clapAtom: input.ClapAtom }), - ...(input.CslgAtom !== undefined && { cslgAtom: input.CslgAtom }), - ...(input.Mpeg2FourCCControl !== undefined && { mpeg2FourCCControl: input.Mpeg2FourCCControl }), - ...(input.PaddingControl !== undefined && { paddingControl: input.PaddingControl }), - ...(input.Reference !== undefined && { reference: input.Reference }), + ...(input.ClapAtom !== undefined && input.ClapAtom !== null && { clapAtom: input.ClapAtom }), + ...(input.CslgAtom !== undefined && input.CslgAtom !== null && { cslgAtom: input.CslgAtom }), + ...(input.Mpeg2FourCCControl !== undefined && + input.Mpeg2FourCCControl !== null && { mpeg2FourCCControl: input.Mpeg2FourCCControl }), + ...(input.PaddingControl !== undefined && + input.PaddingControl !== null && { paddingControl: input.PaddingControl }), + ...(input.Reference !== undefined && input.Reference !== null && { reference: input.Reference }), }; }; const serializeAws_restJson1Mp2Settings = (input: Mp2Settings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.Channels !== undefined && { channels: input.Channels }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.Channels !== undefined && input.Channels !== null && { channels: input.Channels }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), }; }; const serializeAws_restJson1Mp3Settings = (input: Mp3Settings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.Channels !== undefined && { channels: input.Channels }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), - ...(input.VbrQuality !== undefined && { vbrQuality: input.VbrQuality }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.Channels !== undefined && input.Channels !== null && { channels: input.Channels }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), + ...(input.VbrQuality !== undefined && input.VbrQuality !== null && { vbrQuality: input.VbrQuality }), }; }; const serializeAws_restJson1Mp4Settings = (input: Mp4Settings, context: __SerdeContext): any => { return { - ...(input.AudioDuration !== undefined && { audioDuration: input.AudioDuration }), - ...(input.CslgAtom !== undefined && { cslgAtom: input.CslgAtom }), - ...(input.CttsVersion !== undefined && { cttsVersion: input.CttsVersion }), - ...(input.FreeSpaceBox !== undefined && { freeSpaceBox: input.FreeSpaceBox }), - ...(input.MoovPlacement !== undefined && { moovPlacement: input.MoovPlacement }), - ...(input.Mp4MajorBrand !== undefined && { mp4MajorBrand: input.Mp4MajorBrand }), + ...(input.AudioDuration !== undefined && input.AudioDuration !== null && { audioDuration: input.AudioDuration }), + ...(input.CslgAtom !== undefined && input.CslgAtom !== null && { cslgAtom: input.CslgAtom }), + ...(input.CttsVersion !== undefined && input.CttsVersion !== null && { cttsVersion: input.CttsVersion }), + ...(input.FreeSpaceBox !== undefined && input.FreeSpaceBox !== null && { freeSpaceBox: input.FreeSpaceBox }), + ...(input.MoovPlacement !== undefined && input.MoovPlacement !== null && { moovPlacement: input.MoovPlacement }), + ...(input.Mp4MajorBrand !== undefined && input.Mp4MajorBrand !== null && { mp4MajorBrand: input.Mp4MajorBrand }), }; }; const serializeAws_restJson1MpdSettings = (input: MpdSettings, context: __SerdeContext): any => { return { - ...(input.AccessibilityCaptionHints !== undefined && { - accessibilityCaptionHints: input.AccessibilityCaptionHints, - }), - ...(input.AudioDuration !== undefined && { audioDuration: input.AudioDuration }), - ...(input.CaptionContainerType !== undefined && { captionContainerType: input.CaptionContainerType }), - ...(input.Scte35Esam !== undefined && { scte35Esam: input.Scte35Esam }), - ...(input.Scte35Source !== undefined && { scte35Source: input.Scte35Source }), + ...(input.AccessibilityCaptionHints !== undefined && + input.AccessibilityCaptionHints !== null && { accessibilityCaptionHints: input.AccessibilityCaptionHints }), + ...(input.AudioDuration !== undefined && input.AudioDuration !== null && { audioDuration: input.AudioDuration }), + ...(input.CaptionContainerType !== undefined && + input.CaptionContainerType !== null && { captionContainerType: input.CaptionContainerType }), + ...(input.Scte35Esam !== undefined && input.Scte35Esam !== null && { scte35Esam: input.Scte35Esam }), + ...(input.Scte35Source !== undefined && input.Scte35Source !== null && { scte35Source: input.Scte35Source }), }; }; const serializeAws_restJson1Mpeg2Settings = (input: Mpeg2Settings, context: __SerdeContext): any => { return { - ...(input.AdaptiveQuantization !== undefined && { adaptiveQuantization: input.AdaptiveQuantization }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.CodecLevel !== undefined && { codecLevel: input.CodecLevel }), - ...(input.CodecProfile !== undefined && { codecProfile: input.CodecProfile }), - ...(input.DynamicSubGop !== undefined && { dynamicSubGop: input.DynamicSubGop }), - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateConversionAlgorithm !== undefined && { - framerateConversionAlgorithm: input.FramerateConversionAlgorithm, - }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.GopClosedCadence !== undefined && { gopClosedCadence: input.GopClosedCadence }), - ...(input.GopSize !== undefined && { gopSize: input.GopSize }), - ...(input.GopSizeUnits !== undefined && { gopSizeUnits: input.GopSizeUnits }), - ...(input.HrdBufferInitialFillPercentage !== undefined && { - hrdBufferInitialFillPercentage: input.HrdBufferInitialFillPercentage, - }), - ...(input.HrdBufferSize !== undefined && { hrdBufferSize: input.HrdBufferSize }), - ...(input.InterlaceMode !== undefined && { interlaceMode: input.InterlaceMode }), - ...(input.IntraDcPrecision !== undefined && { intraDcPrecision: input.IntraDcPrecision }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.MinIInterval !== undefined && { minIInterval: input.MinIInterval }), - ...(input.NumberBFramesBetweenReferenceFrames !== undefined && { - numberBFramesBetweenReferenceFrames: input.NumberBFramesBetweenReferenceFrames, - }), - ...(input.ParControl !== undefined && { parControl: input.ParControl }), - ...(input.ParDenominator !== undefined && { parDenominator: input.ParDenominator }), - ...(input.ParNumerator !== undefined && { parNumerator: input.ParNumerator }), - ...(input.QualityTuningLevel !== undefined && { qualityTuningLevel: input.QualityTuningLevel }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), - ...(input.SceneChangeDetect !== undefined && { sceneChangeDetect: input.SceneChangeDetect }), - ...(input.SlowPal !== undefined && { slowPal: input.SlowPal }), - ...(input.Softness !== undefined && { softness: input.Softness }), - ...(input.SpatialAdaptiveQuantization !== undefined && { - spatialAdaptiveQuantization: input.SpatialAdaptiveQuantization, - }), - ...(input.Syntax !== undefined && { syntax: input.Syntax }), - ...(input.Telecine !== undefined && { telecine: input.Telecine }), - ...(input.TemporalAdaptiveQuantization !== undefined && { - temporalAdaptiveQuantization: input.TemporalAdaptiveQuantization, - }), + ...(input.AdaptiveQuantization !== undefined && + input.AdaptiveQuantization !== null && { adaptiveQuantization: input.AdaptiveQuantization }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.CodecLevel !== undefined && input.CodecLevel !== null && { codecLevel: input.CodecLevel }), + ...(input.CodecProfile !== undefined && input.CodecProfile !== null && { codecProfile: input.CodecProfile }), + ...(input.DynamicSubGop !== undefined && input.DynamicSubGop !== null && { dynamicSubGop: input.DynamicSubGop }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateConversionAlgorithm !== undefined && + input.FramerateConversionAlgorithm !== null && { + framerateConversionAlgorithm: input.FramerateConversionAlgorithm, + }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.GopClosedCadence !== undefined && + input.GopClosedCadence !== null && { gopClosedCadence: input.GopClosedCadence }), + ...(input.GopSize !== undefined && input.GopSize !== null && { gopSize: input.GopSize }), + ...(input.GopSizeUnits !== undefined && input.GopSizeUnits !== null && { gopSizeUnits: input.GopSizeUnits }), + ...(input.HrdBufferInitialFillPercentage !== undefined && + input.HrdBufferInitialFillPercentage !== null && { + hrdBufferInitialFillPercentage: input.HrdBufferInitialFillPercentage, + }), + ...(input.HrdBufferSize !== undefined && input.HrdBufferSize !== null && { hrdBufferSize: input.HrdBufferSize }), + ...(input.InterlaceMode !== undefined && input.InterlaceMode !== null && { interlaceMode: input.InterlaceMode }), + ...(input.IntraDcPrecision !== undefined && + input.IntraDcPrecision !== null && { intraDcPrecision: input.IntraDcPrecision }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.MinIInterval !== undefined && input.MinIInterval !== null && { minIInterval: input.MinIInterval }), + ...(input.NumberBFramesBetweenReferenceFrames !== undefined && + input.NumberBFramesBetweenReferenceFrames !== null && { + numberBFramesBetweenReferenceFrames: input.NumberBFramesBetweenReferenceFrames, + }), + ...(input.ParControl !== undefined && input.ParControl !== null && { parControl: input.ParControl }), + ...(input.ParDenominator !== undefined && + input.ParDenominator !== null && { parDenominator: input.ParDenominator }), + ...(input.ParNumerator !== undefined && input.ParNumerator !== null && { parNumerator: input.ParNumerator }), + ...(input.QualityTuningLevel !== undefined && + input.QualityTuningLevel !== null && { qualityTuningLevel: input.QualityTuningLevel }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), + ...(input.SceneChangeDetect !== undefined && + input.SceneChangeDetect !== null && { sceneChangeDetect: input.SceneChangeDetect }), + ...(input.SlowPal !== undefined && input.SlowPal !== null && { slowPal: input.SlowPal }), + ...(input.Softness !== undefined && input.Softness !== null && { softness: input.Softness }), + ...(input.SpatialAdaptiveQuantization !== undefined && + input.SpatialAdaptiveQuantization !== null && { spatialAdaptiveQuantization: input.SpatialAdaptiveQuantization }), + ...(input.Syntax !== undefined && input.Syntax !== null && { syntax: input.Syntax }), + ...(input.Telecine !== undefined && input.Telecine !== null && { telecine: input.Telecine }), + ...(input.TemporalAdaptiveQuantization !== undefined && + input.TemporalAdaptiveQuantization !== null && { + temporalAdaptiveQuantization: input.TemporalAdaptiveQuantization, + }), }; }; @@ -5108,10 +5574,12 @@ const serializeAws_restJson1MsSmoothAdditionalManifest = ( context: __SerdeContext ): any => { return { - ...(input.ManifestNameModifier !== undefined && { manifestNameModifier: input.ManifestNameModifier }), - ...(input.SelectedOutputs !== undefined && { - selectedOutputs: serializeAws_restJson1__listOf__stringMin1(input.SelectedOutputs, context), - }), + ...(input.ManifestNameModifier !== undefined && + input.ManifestNameModifier !== null && { manifestNameModifier: input.ManifestNameModifier }), + ...(input.SelectedOutputs !== undefined && + input.SelectedOutputs !== null && { + selectedOutputs: serializeAws_restJson1__listOf__stringMin1(input.SelectedOutputs, context), + }), }; }; @@ -5120,34 +5588,44 @@ const serializeAws_restJson1MsSmoothEncryptionSettings = ( context: __SerdeContext ): any => { return { - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; const serializeAws_restJson1MsSmoothGroupSettings = (input: MsSmoothGroupSettings, context: __SerdeContext): any => { return { - ...(input.AdditionalManifests !== undefined && { - additionalManifests: serializeAws_restJson1__listOfMsSmoothAdditionalManifest(input.AdditionalManifests, context), - }), - ...(input.AudioDeduplication !== undefined && { audioDeduplication: input.AudioDeduplication }), - ...(input.Destination !== undefined && { destination: input.Destination }), - ...(input.DestinationSettings !== undefined && { - destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), - }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1MsSmoothEncryptionSettings(input.Encryption, context), - }), - ...(input.FragmentLength !== undefined && { fragmentLength: input.FragmentLength }), - ...(input.ManifestEncoding !== undefined && { manifestEncoding: input.ManifestEncoding }), + ...(input.AdditionalManifests !== undefined && + input.AdditionalManifests !== null && { + additionalManifests: serializeAws_restJson1__listOfMsSmoothAdditionalManifest( + input.AdditionalManifests, + context + ), + }), + ...(input.AudioDeduplication !== undefined && + input.AudioDeduplication !== null && { audioDeduplication: input.AudioDeduplication }), + ...(input.Destination !== undefined && input.Destination !== null && { destination: input.Destination }), + ...(input.DestinationSettings !== undefined && + input.DestinationSettings !== null && { + destinationSettings: serializeAws_restJson1DestinationSettings(input.DestinationSettings, context), + }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { + encryption: serializeAws_restJson1MsSmoothEncryptionSettings(input.Encryption, context), + }), + ...(input.FragmentLength !== undefined && + input.FragmentLength !== null && { fragmentLength: input.FragmentLength }), + ...(input.ManifestEncoding !== undefined && + input.ManifestEncoding !== null && { manifestEncoding: input.ManifestEncoding }), }; }; const serializeAws_restJson1MxfSettings = (input: MxfSettings, context: __SerdeContext): any => { return { - ...(input.AfdSignaling !== undefined && { afdSignaling: input.AfdSignaling }), - ...(input.Profile !== undefined && { profile: input.Profile }), + ...(input.AfdSignaling !== undefined && input.AfdSignaling !== null && { afdSignaling: input.AfdSignaling }), + ...(input.Profile !== undefined && input.Profile !== null && { profile: input.Profile }), }; }; @@ -5156,17 +5634,17 @@ const serializeAws_restJson1NexGuardFileMarkerSettings = ( context: __SerdeContext ): any => { return { - ...(input.License !== undefined && { license: input.License }), - ...(input.Payload !== undefined && { payload: input.Payload }), - ...(input.Preset !== undefined && { preset: input.Preset }), - ...(input.Strength !== undefined && { strength: input.Strength }), + ...(input.License !== undefined && input.License !== null && { license: input.License }), + ...(input.Payload !== undefined && input.Payload !== null && { payload: input.Payload }), + ...(input.Preset !== undefined && input.Preset !== null && { preset: input.Preset }), + ...(input.Strength !== undefined && input.Strength !== null && { strength: input.Strength }), }; }; const serializeAws_restJson1NielsenConfiguration = (input: NielsenConfiguration, context: __SerdeContext): any => { return { - ...(input.BreakoutCode !== undefined && { breakoutCode: input.BreakoutCode }), - ...(input.DistributorId !== undefined && { distributorId: input.DistributorId }), + ...(input.BreakoutCode !== undefined && input.BreakoutCode !== null && { breakoutCode: input.BreakoutCode }), + ...(input.DistributorId !== undefined && input.DistributorId !== null && { distributorId: input.DistributorId }), }; }; @@ -5175,38 +5653,45 @@ const serializeAws_restJson1NielsenNonLinearWatermarkSettings = ( context: __SerdeContext ): any => { return { - ...(input.ActiveWatermarkProcess !== undefined && { activeWatermarkProcess: input.ActiveWatermarkProcess }), - ...(input.AdiFilename !== undefined && { adiFilename: input.AdiFilename }), - ...(input.AssetId !== undefined && { assetId: input.AssetId }), - ...(input.AssetName !== undefined && { assetName: input.AssetName }), - ...(input.CbetSourceId !== undefined && { cbetSourceId: input.CbetSourceId }), - ...(input.EpisodeId !== undefined && { episodeId: input.EpisodeId }), - ...(input.MetadataDestination !== undefined && { metadataDestination: input.MetadataDestination }), - ...(input.SourceId !== undefined && { sourceId: input.SourceId }), - ...(input.SourceWatermarkStatus !== undefined && { sourceWatermarkStatus: input.SourceWatermarkStatus }), - ...(input.TicServerUrl !== undefined && { ticServerUrl: input.TicServerUrl }), - ...(input.UniqueTicPerAudioTrack !== undefined && { uniqueTicPerAudioTrack: input.UniqueTicPerAudioTrack }), + ...(input.ActiveWatermarkProcess !== undefined && + input.ActiveWatermarkProcess !== null && { activeWatermarkProcess: input.ActiveWatermarkProcess }), + ...(input.AdiFilename !== undefined && input.AdiFilename !== null && { adiFilename: input.AdiFilename }), + ...(input.AssetId !== undefined && input.AssetId !== null && { assetId: input.AssetId }), + ...(input.AssetName !== undefined && input.AssetName !== null && { assetName: input.AssetName }), + ...(input.CbetSourceId !== undefined && input.CbetSourceId !== null && { cbetSourceId: input.CbetSourceId }), + ...(input.EpisodeId !== undefined && input.EpisodeId !== null && { episodeId: input.EpisodeId }), + ...(input.MetadataDestination !== undefined && + input.MetadataDestination !== null && { metadataDestination: input.MetadataDestination }), + ...(input.SourceId !== undefined && input.SourceId !== null && { sourceId: input.SourceId }), + ...(input.SourceWatermarkStatus !== undefined && + input.SourceWatermarkStatus !== null && { sourceWatermarkStatus: input.SourceWatermarkStatus }), + ...(input.TicServerUrl !== undefined && input.TicServerUrl !== null && { ticServerUrl: input.TicServerUrl }), + ...(input.UniqueTicPerAudioTrack !== undefined && + input.UniqueTicPerAudioTrack !== null && { uniqueTicPerAudioTrack: input.UniqueTicPerAudioTrack }), }; }; const serializeAws_restJson1NoiseReducer = (input: NoiseReducer, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { filter: input.Filter }), - ...(input.FilterSettings !== undefined && { - filterSettings: serializeAws_restJson1NoiseReducerFilterSettings(input.FilterSettings, context), - }), - ...(input.SpatialFilterSettings !== undefined && { - spatialFilterSettings: serializeAws_restJson1NoiseReducerSpatialFilterSettings( - input.SpatialFilterSettings, - context - ), - }), - ...(input.TemporalFilterSettings !== undefined && { - temporalFilterSettings: serializeAws_restJson1NoiseReducerTemporalFilterSettings( - input.TemporalFilterSettings, - context - ), - }), + ...(input.Filter !== undefined && input.Filter !== null && { filter: input.Filter }), + ...(input.FilterSettings !== undefined && + input.FilterSettings !== null && { + filterSettings: serializeAws_restJson1NoiseReducerFilterSettings(input.FilterSettings, context), + }), + ...(input.SpatialFilterSettings !== undefined && + input.SpatialFilterSettings !== null && { + spatialFilterSettings: serializeAws_restJson1NoiseReducerSpatialFilterSettings( + input.SpatialFilterSettings, + context + ), + }), + ...(input.TemporalFilterSettings !== undefined && + input.TemporalFilterSettings !== null && { + temporalFilterSettings: serializeAws_restJson1NoiseReducerTemporalFilterSettings( + input.TemporalFilterSettings, + context + ), + }), }; }; @@ -5215,7 +5700,7 @@ const serializeAws_restJson1NoiseReducerFilterSettings = ( context: __SerdeContext ): any => { return { - ...(input.Strength !== undefined && { strength: input.Strength }), + ...(input.Strength !== undefined && input.Strength !== null && { strength: input.Strength }), }; }; @@ -5224,11 +5709,10 @@ const serializeAws_restJson1NoiseReducerSpatialFilterSettings = ( context: __SerdeContext ): any => { return { - ...(input.PostFilterSharpenStrength !== undefined && { - postFilterSharpenStrength: input.PostFilterSharpenStrength, - }), - ...(input.Speed !== undefined && { speed: input.Speed }), - ...(input.Strength !== undefined && { strength: input.Strength }), + ...(input.PostFilterSharpenStrength !== undefined && + input.PostFilterSharpenStrength !== null && { postFilterSharpenStrength: input.PostFilterSharpenStrength }), + ...(input.Speed !== undefined && input.Speed !== null && { speed: input.Speed }), + ...(input.Strength !== undefined && input.Strength !== null && { strength: input.Strength }), }; }; @@ -5237,160 +5721,186 @@ const serializeAws_restJson1NoiseReducerTemporalFilterSettings = ( context: __SerdeContext ): any => { return { - ...(input.AggressiveMode !== undefined && { aggressiveMode: input.AggressiveMode }), - ...(input.PostTemporalSharpening !== undefined && { postTemporalSharpening: input.PostTemporalSharpening }), - ...(input.Speed !== undefined && { speed: input.Speed }), - ...(input.Strength !== undefined && { strength: input.Strength }), + ...(input.AggressiveMode !== undefined && + input.AggressiveMode !== null && { aggressiveMode: input.AggressiveMode }), + ...(input.PostTemporalSharpening !== undefined && + input.PostTemporalSharpening !== null && { postTemporalSharpening: input.PostTemporalSharpening }), + ...(input.Speed !== undefined && input.Speed !== null && { speed: input.Speed }), + ...(input.Strength !== undefined && input.Strength !== null && { strength: input.Strength }), }; }; const serializeAws_restJson1OpusSettings = (input: OpusSettings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.Channels !== undefined && { channels: input.Channels }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.Channels !== undefined && input.Channels !== null && { channels: input.Channels }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), }; }; const serializeAws_restJson1Output = (input: Output, context: __SerdeContext): any => { return { - ...(input.AudioDescriptions !== undefined && { - audioDescriptions: serializeAws_restJson1__listOfAudioDescription(input.AudioDescriptions, context), - }), - ...(input.CaptionDescriptions !== undefined && { - captionDescriptions: serializeAws_restJson1__listOfCaptionDescription(input.CaptionDescriptions, context), - }), - ...(input.ContainerSettings !== undefined && { - containerSettings: serializeAws_restJson1ContainerSettings(input.ContainerSettings, context), - }), - ...(input.Extension !== undefined && { extension: input.Extension }), - ...(input.NameModifier !== undefined && { nameModifier: input.NameModifier }), - ...(input.OutputSettings !== undefined && { - outputSettings: serializeAws_restJson1OutputSettings(input.OutputSettings, context), - }), - ...(input.Preset !== undefined && { preset: input.Preset }), - ...(input.VideoDescription !== undefined && { - videoDescription: serializeAws_restJson1VideoDescription(input.VideoDescription, context), - }), + ...(input.AudioDescriptions !== undefined && + input.AudioDescriptions !== null && { + audioDescriptions: serializeAws_restJson1__listOfAudioDescription(input.AudioDescriptions, context), + }), + ...(input.CaptionDescriptions !== undefined && + input.CaptionDescriptions !== null && { + captionDescriptions: serializeAws_restJson1__listOfCaptionDescription(input.CaptionDescriptions, context), + }), + ...(input.ContainerSettings !== undefined && + input.ContainerSettings !== null && { + containerSettings: serializeAws_restJson1ContainerSettings(input.ContainerSettings, context), + }), + ...(input.Extension !== undefined && input.Extension !== null && { extension: input.Extension }), + ...(input.NameModifier !== undefined && input.NameModifier !== null && { nameModifier: input.NameModifier }), + ...(input.OutputSettings !== undefined && + input.OutputSettings !== null && { + outputSettings: serializeAws_restJson1OutputSettings(input.OutputSettings, context), + }), + ...(input.Preset !== undefined && input.Preset !== null && { preset: input.Preset }), + ...(input.VideoDescription !== undefined && + input.VideoDescription !== null && { + videoDescription: serializeAws_restJson1VideoDescription(input.VideoDescription, context), + }), }; }; const serializeAws_restJson1OutputChannelMapping = (input: OutputChannelMapping, context: __SerdeContext): any => { return { - ...(input.InputChannels !== undefined && { - inputChannels: serializeAws_restJson1__listOf__integerMinNegative60Max6(input.InputChannels, context), - }), + ...(input.InputChannels !== undefined && + input.InputChannels !== null && { + inputChannels: serializeAws_restJson1__listOf__integerMinNegative60Max6(input.InputChannels, context), + }), }; }; const serializeAws_restJson1OutputGroup = (input: OutputGroup, context: __SerdeContext): any => { return { - ...(input.AutomatedEncodingSettings !== undefined && { - automatedEncodingSettings: serializeAws_restJson1AutomatedEncodingSettings( - input.AutomatedEncodingSettings, - context - ), - }), - ...(input.CustomName !== undefined && { customName: input.CustomName }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.OutputGroupSettings !== undefined && { - outputGroupSettings: serializeAws_restJson1OutputGroupSettings(input.OutputGroupSettings, context), - }), - ...(input.Outputs !== undefined && { outputs: serializeAws_restJson1__listOfOutput(input.Outputs, context) }), + ...(input.AutomatedEncodingSettings !== undefined && + input.AutomatedEncodingSettings !== null && { + automatedEncodingSettings: serializeAws_restJson1AutomatedEncodingSettings( + input.AutomatedEncodingSettings, + context + ), + }), + ...(input.CustomName !== undefined && input.CustomName !== null && { customName: input.CustomName }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.OutputGroupSettings !== undefined && + input.OutputGroupSettings !== null && { + outputGroupSettings: serializeAws_restJson1OutputGroupSettings(input.OutputGroupSettings, context), + }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { outputs: serializeAws_restJson1__listOfOutput(input.Outputs, context) }), }; }; const serializeAws_restJson1OutputGroupSettings = (input: OutputGroupSettings, context: __SerdeContext): any => { return { - ...(input.CmafGroupSettings !== undefined && { - cmafGroupSettings: serializeAws_restJson1CmafGroupSettings(input.CmafGroupSettings, context), - }), - ...(input.DashIsoGroupSettings !== undefined && { - dashIsoGroupSettings: serializeAws_restJson1DashIsoGroupSettings(input.DashIsoGroupSettings, context), - }), - ...(input.FileGroupSettings !== undefined && { - fileGroupSettings: serializeAws_restJson1FileGroupSettings(input.FileGroupSettings, context), - }), - ...(input.HlsGroupSettings !== undefined && { - hlsGroupSettings: serializeAws_restJson1HlsGroupSettings(input.HlsGroupSettings, context), - }), - ...(input.MsSmoothGroupSettings !== undefined && { - msSmoothGroupSettings: serializeAws_restJson1MsSmoothGroupSettings(input.MsSmoothGroupSettings, context), - }), - ...(input.Type !== undefined && { type: input.Type }), + ...(input.CmafGroupSettings !== undefined && + input.CmafGroupSettings !== null && { + cmafGroupSettings: serializeAws_restJson1CmafGroupSettings(input.CmafGroupSettings, context), + }), + ...(input.DashIsoGroupSettings !== undefined && + input.DashIsoGroupSettings !== null && { + dashIsoGroupSettings: serializeAws_restJson1DashIsoGroupSettings(input.DashIsoGroupSettings, context), + }), + ...(input.FileGroupSettings !== undefined && + input.FileGroupSettings !== null && { + fileGroupSettings: serializeAws_restJson1FileGroupSettings(input.FileGroupSettings, context), + }), + ...(input.HlsGroupSettings !== undefined && + input.HlsGroupSettings !== null && { + hlsGroupSettings: serializeAws_restJson1HlsGroupSettings(input.HlsGroupSettings, context), + }), + ...(input.MsSmoothGroupSettings !== undefined && + input.MsSmoothGroupSettings !== null && { + msSmoothGroupSettings: serializeAws_restJson1MsSmoothGroupSettings(input.MsSmoothGroupSettings, context), + }), + ...(input.Type !== undefined && input.Type !== null && { type: input.Type }), }; }; const serializeAws_restJson1OutputSettings = (input: OutputSettings, context: __SerdeContext): any => { return { - ...(input.HlsSettings !== undefined && { - hlsSettings: serializeAws_restJson1HlsSettings(input.HlsSettings, context), - }), + ...(input.HlsSettings !== undefined && + input.HlsSettings !== null && { hlsSettings: serializeAws_restJson1HlsSettings(input.HlsSettings, context) }), }; }; const serializeAws_restJson1PartnerWatermarking = (input: PartnerWatermarking, context: __SerdeContext): any => { return { - ...(input.NexguardFileMarkerSettings !== undefined && { - nexguardFileMarkerSettings: serializeAws_restJson1NexGuardFileMarkerSettings( - input.NexguardFileMarkerSettings, - context - ), - }), + ...(input.NexguardFileMarkerSettings !== undefined && + input.NexguardFileMarkerSettings !== null && { + nexguardFileMarkerSettings: serializeAws_restJson1NexGuardFileMarkerSettings( + input.NexguardFileMarkerSettings, + context + ), + }), }; }; const serializeAws_restJson1PresetSettings = (input: PresetSettings, context: __SerdeContext): any => { return { - ...(input.AudioDescriptions !== undefined && { - audioDescriptions: serializeAws_restJson1__listOfAudioDescription(input.AudioDescriptions, context), - }), - ...(input.CaptionDescriptions !== undefined && { - captionDescriptions: serializeAws_restJson1__listOfCaptionDescriptionPreset(input.CaptionDescriptions, context), - }), - ...(input.ContainerSettings !== undefined && { - containerSettings: serializeAws_restJson1ContainerSettings(input.ContainerSettings, context), - }), - ...(input.VideoDescription !== undefined && { - videoDescription: serializeAws_restJson1VideoDescription(input.VideoDescription, context), - }), + ...(input.AudioDescriptions !== undefined && + input.AudioDescriptions !== null && { + audioDescriptions: serializeAws_restJson1__listOfAudioDescription(input.AudioDescriptions, context), + }), + ...(input.CaptionDescriptions !== undefined && + input.CaptionDescriptions !== null && { + captionDescriptions: serializeAws_restJson1__listOfCaptionDescriptionPreset(input.CaptionDescriptions, context), + }), + ...(input.ContainerSettings !== undefined && + input.ContainerSettings !== null && { + containerSettings: serializeAws_restJson1ContainerSettings(input.ContainerSettings, context), + }), + ...(input.VideoDescription !== undefined && + input.VideoDescription !== null && { + videoDescription: serializeAws_restJson1VideoDescription(input.VideoDescription, context), + }), }; }; const serializeAws_restJson1ProresSettings = (input: ProresSettings, context: __SerdeContext): any => { return { - ...(input.CodecProfile !== undefined && { codecProfile: input.CodecProfile }), - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateConversionAlgorithm !== undefined && { - framerateConversionAlgorithm: input.FramerateConversionAlgorithm, - }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.InterlaceMode !== undefined && { interlaceMode: input.InterlaceMode }), - ...(input.ParControl !== undefined && { parControl: input.ParControl }), - ...(input.ParDenominator !== undefined && { parDenominator: input.ParDenominator }), - ...(input.ParNumerator !== undefined && { parNumerator: input.ParNumerator }), - ...(input.SlowPal !== undefined && { slowPal: input.SlowPal }), - ...(input.Telecine !== undefined && { telecine: input.Telecine }), + ...(input.CodecProfile !== undefined && input.CodecProfile !== null && { codecProfile: input.CodecProfile }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateConversionAlgorithm !== undefined && + input.FramerateConversionAlgorithm !== null && { + framerateConversionAlgorithm: input.FramerateConversionAlgorithm, + }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.InterlaceMode !== undefined && input.InterlaceMode !== null && { interlaceMode: input.InterlaceMode }), + ...(input.ParControl !== undefined && input.ParControl !== null && { parControl: input.ParControl }), + ...(input.ParDenominator !== undefined && + input.ParDenominator !== null && { parDenominator: input.ParDenominator }), + ...(input.ParNumerator !== undefined && input.ParNumerator !== null && { parNumerator: input.ParNumerator }), + ...(input.SlowPal !== undefined && input.SlowPal !== null && { slowPal: input.SlowPal }), + ...(input.Telecine !== undefined && input.Telecine !== null && { telecine: input.Telecine }), }; }; const serializeAws_restJson1Rectangle = (input: Rectangle, context: __SerdeContext): any => { return { - ...(input.Height !== undefined && { height: input.Height }), - ...(input.Width !== undefined && { width: input.Width }), - ...(input.X !== undefined && { x: input.X }), - ...(input.Y !== undefined && { y: input.Y }), + ...(input.Height !== undefined && input.Height !== null && { height: input.Height }), + ...(input.Width !== undefined && input.Width !== null && { width: input.Width }), + ...(input.X !== undefined && input.X !== null && { x: input.X }), + ...(input.Y !== undefined && input.Y !== null && { y: input.Y }), }; }; const serializeAws_restJson1RemixSettings = (input: RemixSettings, context: __SerdeContext): any => { return { - ...(input.ChannelMapping !== undefined && { - channelMapping: serializeAws_restJson1ChannelMapping(input.ChannelMapping, context), - }), - ...(input.ChannelsIn !== undefined && { channelsIn: input.ChannelsIn }), - ...(input.ChannelsOut !== undefined && { channelsOut: input.ChannelsOut }), + ...(input.ChannelMapping !== undefined && + input.ChannelMapping !== null && { + channelMapping: serializeAws_restJson1ChannelMapping(input.ChannelMapping, context), + }), + ...(input.ChannelsIn !== undefined && input.ChannelsIn !== null && { channelsIn: input.ChannelsIn }), + ...(input.ChannelsOut !== undefined && input.ChannelsOut !== null && { channelsOut: input.ChannelsOut }), }; }; @@ -5399,9 +5909,9 @@ const serializeAws_restJson1ReservationPlanSettings = ( context: __SerdeContext ): any => { return { - ...(input.Commitment !== undefined && { commitment: input.Commitment }), - ...(input.RenewalType !== undefined && { renewalType: input.RenewalType }), - ...(input.ReservedSlots !== undefined && { reservedSlots: input.ReservedSlots }), + ...(input.Commitment !== undefined && input.Commitment !== null && { commitment: input.Commitment }), + ...(input.RenewalType !== undefined && input.RenewalType !== null && { renewalType: input.RenewalType }), + ...(input.ReservedSlots !== undefined && input.ReservedSlots !== null && { reservedSlots: input.ReservedSlots }), }; }; @@ -5410,74 +5920,84 @@ const serializeAws_restJson1S3DestinationAccessControl = ( context: __SerdeContext ): any => { return { - ...(input.CannedAcl !== undefined && { cannedAcl: input.CannedAcl }), + ...(input.CannedAcl !== undefined && input.CannedAcl !== null && { cannedAcl: input.CannedAcl }), }; }; const serializeAws_restJson1S3DestinationSettings = (input: S3DestinationSettings, context: __SerdeContext): any => { return { - ...(input.AccessControl !== undefined && { - accessControl: serializeAws_restJson1S3DestinationAccessControl(input.AccessControl, context), - }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1S3EncryptionSettings(input.Encryption, context), - }), + ...(input.AccessControl !== undefined && + input.AccessControl !== null && { + accessControl: serializeAws_restJson1S3DestinationAccessControl(input.AccessControl, context), + }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { + encryption: serializeAws_restJson1S3EncryptionSettings(input.Encryption, context), + }), }; }; const serializeAws_restJson1S3EncryptionSettings = (input: S3EncryptionSettings, context: __SerdeContext): any => { return { - ...(input.EncryptionType !== undefined && { encryptionType: input.EncryptionType }), - ...(input.KmsKeyArn !== undefined && { kmsKeyArn: input.KmsKeyArn }), + ...(input.EncryptionType !== undefined && + input.EncryptionType !== null && { encryptionType: input.EncryptionType }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { kmsKeyArn: input.KmsKeyArn }), }; }; const serializeAws_restJson1SccDestinationSettings = (input: SccDestinationSettings, context: __SerdeContext): any => { return { - ...(input.Framerate !== undefined && { framerate: input.Framerate }), + ...(input.Framerate !== undefined && input.Framerate !== null && { framerate: input.Framerate }), }; }; const serializeAws_restJson1SpekeKeyProvider = (input: SpekeKeyProvider, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { certificateArn: input.CertificateArn }), - ...(input.ResourceId !== undefined && { resourceId: input.ResourceId }), - ...(input.SystemIds !== undefined && { - systemIds: serializeAws_restJson1__listOf__stringPattern09aFAF809aFAF409aFAF409aFAF409aFAF12( - input.SystemIds, - context - ), - }), - ...(input.Url !== undefined && { url: input.Url }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { certificateArn: input.CertificateArn }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { resourceId: input.ResourceId }), + ...(input.SystemIds !== undefined && + input.SystemIds !== null && { + systemIds: serializeAws_restJson1__listOf__stringPattern09aFAF809aFAF409aFAF409aFAF409aFAF12( + input.SystemIds, + context + ), + }), + ...(input.Url !== undefined && input.Url !== null && { url: input.Url }), }; }; const serializeAws_restJson1SpekeKeyProviderCmaf = (input: SpekeKeyProviderCmaf, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { certificateArn: input.CertificateArn }), - ...(input.DashSignaledSystemIds !== undefined && { - dashSignaledSystemIds: serializeAws_restJson1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12( - input.DashSignaledSystemIds, - context - ), - }), - ...(input.HlsSignaledSystemIds !== undefined && { - hlsSignaledSystemIds: serializeAws_restJson1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12( - input.HlsSignaledSystemIds, - context - ), - }), - ...(input.ResourceId !== undefined && { resourceId: input.ResourceId }), - ...(input.Url !== undefined && { url: input.Url }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { certificateArn: input.CertificateArn }), + ...(input.DashSignaledSystemIds !== undefined && + input.DashSignaledSystemIds !== null && { + dashSignaledSystemIds: serializeAws_restJson1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12( + input.DashSignaledSystemIds, + context + ), + }), + ...(input.HlsSignaledSystemIds !== undefined && + input.HlsSignaledSystemIds !== null && { + hlsSignaledSystemIds: serializeAws_restJson1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12( + input.HlsSignaledSystemIds, + context + ), + }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { resourceId: input.ResourceId }), + ...(input.Url !== undefined && input.Url !== null && { url: input.Url }), }; }; const serializeAws_restJson1StaticKeyProvider = (input: StaticKeyProvider, context: __SerdeContext): any => { return { - ...(input.KeyFormat !== undefined && { keyFormat: input.KeyFormat }), - ...(input.KeyFormatVersions !== undefined && { keyFormatVersions: input.KeyFormatVersions }), - ...(input.StaticKeyValue !== undefined && { staticKeyValue: input.StaticKeyValue }), - ...(input.Url !== undefined && { url: input.Url }), + ...(input.KeyFormat !== undefined && input.KeyFormat !== null && { keyFormat: input.KeyFormat }), + ...(input.KeyFormatVersions !== undefined && + input.KeyFormatVersions !== null && { keyFormatVersions: input.KeyFormatVersions }), + ...(input.StaticKeyValue !== undefined && + input.StaticKeyValue !== null && { staticKeyValue: input.StaticKeyValue }), + ...(input.Url !== undefined && input.Url !== null && { url: input.Url }), }; }; @@ -5486,47 +6006,50 @@ const serializeAws_restJson1TeletextDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.PageNumber !== undefined && { pageNumber: input.PageNumber }), - ...(input.PageTypes !== undefined && { - pageTypes: serializeAws_restJson1__listOfTeletextPageType(input.PageTypes, context), - }), + ...(input.PageNumber !== undefined && input.PageNumber !== null && { pageNumber: input.PageNumber }), + ...(input.PageTypes !== undefined && + input.PageTypes !== null && { + pageTypes: serializeAws_restJson1__listOfTeletextPageType(input.PageTypes, context), + }), }; }; const serializeAws_restJson1TeletextSourceSettings = (input: TeletextSourceSettings, context: __SerdeContext): any => { return { - ...(input.PageNumber !== undefined && { pageNumber: input.PageNumber }), + ...(input.PageNumber !== undefined && input.PageNumber !== null && { pageNumber: input.PageNumber }), }; }; const serializeAws_restJson1TimecodeBurnin = (input: TimecodeBurnin, context: __SerdeContext): any => { return { - ...(input.FontSize !== undefined && { fontSize: input.FontSize }), - ...(input.Position !== undefined && { position: input.Position }), - ...(input.Prefix !== undefined && { prefix: input.Prefix }), + ...(input.FontSize !== undefined && input.FontSize !== null && { fontSize: input.FontSize }), + ...(input.Position !== undefined && input.Position !== null && { position: input.Position }), + ...(input.Prefix !== undefined && input.Prefix !== null && { prefix: input.Prefix }), }; }; const serializeAws_restJson1TimecodeConfig = (input: TimecodeConfig, context: __SerdeContext): any => { return { - ...(input.Anchor !== undefined && { anchor: input.Anchor }), - ...(input.Source !== undefined && { source: input.Source }), - ...(input.Start !== undefined && { start: input.Start }), - ...(input.TimestampOffset !== undefined && { timestampOffset: input.TimestampOffset }), + ...(input.Anchor !== undefined && input.Anchor !== null && { anchor: input.Anchor }), + ...(input.Source !== undefined && input.Source !== null && { source: input.Source }), + ...(input.Start !== undefined && input.Start !== null && { start: input.Start }), + ...(input.TimestampOffset !== undefined && + input.TimestampOffset !== null && { timestampOffset: input.TimestampOffset }), }; }; const serializeAws_restJson1TimedMetadataInsertion = (input: TimedMetadataInsertion, context: __SerdeContext): any => { return { - ...(input.Id3Insertions !== undefined && { - id3Insertions: serializeAws_restJson1__listOfId3Insertion(input.Id3Insertions, context), - }), + ...(input.Id3Insertions !== undefined && + input.Id3Insertions !== null && { + id3Insertions: serializeAws_restJson1__listOfId3Insertion(input.Id3Insertions, context), + }), }; }; const serializeAws_restJson1TrackSourceSettings = (input: TrackSourceSettings, context: __SerdeContext): any => { return { - ...(input.TrackNumber !== undefined && { trackNumber: input.TrackNumber }), + ...(input.TrackNumber !== undefined && input.TrackNumber !== null && { trackNumber: input.TrackNumber }), }; }; @@ -5535,411 +6058,691 @@ const serializeAws_restJson1TtmlDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.StylePassthrough !== undefined && { stylePassthrough: input.StylePassthrough }), + ...(input.StylePassthrough !== undefined && + input.StylePassthrough !== null && { stylePassthrough: input.StylePassthrough }), }; }; const serializeAws_restJson1Vc3Settings = (input: Vc3Settings, context: __SerdeContext): any => { return { - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateConversionAlgorithm !== undefined && { - framerateConversionAlgorithm: input.FramerateConversionAlgorithm, - }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.InterlaceMode !== undefined && { interlaceMode: input.InterlaceMode }), - ...(input.SlowPal !== undefined && { slowPal: input.SlowPal }), - ...(input.Telecine !== undefined && { telecine: input.Telecine }), - ...(input.Vc3Class !== undefined && { vc3Class: input.Vc3Class }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateConversionAlgorithm !== undefined && + input.FramerateConversionAlgorithm !== null && { + framerateConversionAlgorithm: input.FramerateConversionAlgorithm, + }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.InterlaceMode !== undefined && input.InterlaceMode !== null && { interlaceMode: input.InterlaceMode }), + ...(input.SlowPal !== undefined && input.SlowPal !== null && { slowPal: input.SlowPal }), + ...(input.Telecine !== undefined && input.Telecine !== null && { telecine: input.Telecine }), + ...(input.Vc3Class !== undefined && input.Vc3Class !== null && { vc3Class: input.Vc3Class }), }; }; const serializeAws_restJson1VideoCodecSettings = (input: VideoCodecSettings, context: __SerdeContext): any => { return { - ...(input.Av1Settings !== undefined && { - av1Settings: serializeAws_restJson1Av1Settings(input.Av1Settings, context), - }), - ...(input.AvcIntraSettings !== undefined && { - avcIntraSettings: serializeAws_restJson1AvcIntraSettings(input.AvcIntraSettings, context), - }), - ...(input.Codec !== undefined && { codec: input.Codec }), - ...(input.FrameCaptureSettings !== undefined && { - frameCaptureSettings: serializeAws_restJson1FrameCaptureSettings(input.FrameCaptureSettings, context), - }), - ...(input.H264Settings !== undefined && { - h264Settings: serializeAws_restJson1H264Settings(input.H264Settings, context), - }), - ...(input.H265Settings !== undefined && { - h265Settings: serializeAws_restJson1H265Settings(input.H265Settings, context), - }), - ...(input.Mpeg2Settings !== undefined && { - mpeg2Settings: serializeAws_restJson1Mpeg2Settings(input.Mpeg2Settings, context), - }), - ...(input.ProresSettings !== undefined && { - proresSettings: serializeAws_restJson1ProresSettings(input.ProresSettings, context), - }), - ...(input.Vc3Settings !== undefined && { - vc3Settings: serializeAws_restJson1Vc3Settings(input.Vc3Settings, context), - }), - ...(input.Vp8Settings !== undefined && { - vp8Settings: serializeAws_restJson1Vp8Settings(input.Vp8Settings, context), - }), - ...(input.Vp9Settings !== undefined && { - vp9Settings: serializeAws_restJson1Vp9Settings(input.Vp9Settings, context), - }), + ...(input.Av1Settings !== undefined && + input.Av1Settings !== null && { av1Settings: serializeAws_restJson1Av1Settings(input.Av1Settings, context) }), + ...(input.AvcIntraSettings !== undefined && + input.AvcIntraSettings !== null && { + avcIntraSettings: serializeAws_restJson1AvcIntraSettings(input.AvcIntraSettings, context), + }), + ...(input.Codec !== undefined && input.Codec !== null && { codec: input.Codec }), + ...(input.FrameCaptureSettings !== undefined && + input.FrameCaptureSettings !== null && { + frameCaptureSettings: serializeAws_restJson1FrameCaptureSettings(input.FrameCaptureSettings, context), + }), + ...(input.H264Settings !== undefined && + input.H264Settings !== null && { h264Settings: serializeAws_restJson1H264Settings(input.H264Settings, context) }), + ...(input.H265Settings !== undefined && + input.H265Settings !== null && { h265Settings: serializeAws_restJson1H265Settings(input.H265Settings, context) }), + ...(input.Mpeg2Settings !== undefined && + input.Mpeg2Settings !== null && { + mpeg2Settings: serializeAws_restJson1Mpeg2Settings(input.Mpeg2Settings, context), + }), + ...(input.ProresSettings !== undefined && + input.ProresSettings !== null && { + proresSettings: serializeAws_restJson1ProresSettings(input.ProresSettings, context), + }), + ...(input.Vc3Settings !== undefined && + input.Vc3Settings !== null && { vc3Settings: serializeAws_restJson1Vc3Settings(input.Vc3Settings, context) }), + ...(input.Vp8Settings !== undefined && + input.Vp8Settings !== null && { vp8Settings: serializeAws_restJson1Vp8Settings(input.Vp8Settings, context) }), + ...(input.Vp9Settings !== undefined && + input.Vp9Settings !== null && { vp9Settings: serializeAws_restJson1Vp9Settings(input.Vp9Settings, context) }), }; }; const serializeAws_restJson1VideoDescription = (input: VideoDescription, context: __SerdeContext): any => { return { - ...(input.AfdSignaling !== undefined && { afdSignaling: input.AfdSignaling }), - ...(input.AntiAlias !== undefined && { antiAlias: input.AntiAlias }), - ...(input.CodecSettings !== undefined && { - codecSettings: serializeAws_restJson1VideoCodecSettings(input.CodecSettings, context), - }), - ...(input.ColorMetadata !== undefined && { colorMetadata: input.ColorMetadata }), - ...(input.Crop !== undefined && { crop: serializeAws_restJson1Rectangle(input.Crop, context) }), - ...(input.DropFrameTimecode !== undefined && { dropFrameTimecode: input.DropFrameTimecode }), - ...(input.FixedAfd !== undefined && { fixedAfd: input.FixedAfd }), - ...(input.Height !== undefined && { height: input.Height }), - ...(input.Position !== undefined && { position: serializeAws_restJson1Rectangle(input.Position, context) }), - ...(input.RespondToAfd !== undefined && { respondToAfd: input.RespondToAfd }), - ...(input.ScalingBehavior !== undefined && { scalingBehavior: input.ScalingBehavior }), - ...(input.Sharpness !== undefined && { sharpness: input.Sharpness }), - ...(input.TimecodeInsertion !== undefined && { timecodeInsertion: input.TimecodeInsertion }), - ...(input.VideoPreprocessors !== undefined && { - videoPreprocessors: serializeAws_restJson1VideoPreprocessor(input.VideoPreprocessors, context), - }), - ...(input.Width !== undefined && { width: input.Width }), + ...(input.AfdSignaling !== undefined && input.AfdSignaling !== null && { afdSignaling: input.AfdSignaling }), + ...(input.AntiAlias !== undefined && input.AntiAlias !== null && { antiAlias: input.AntiAlias }), + ...(input.CodecSettings !== undefined && + input.CodecSettings !== null && { + codecSettings: serializeAws_restJson1VideoCodecSettings(input.CodecSettings, context), + }), + ...(input.ColorMetadata !== undefined && input.ColorMetadata !== null && { colorMetadata: input.ColorMetadata }), + ...(input.Crop !== undefined && + input.Crop !== null && { crop: serializeAws_restJson1Rectangle(input.Crop, context) }), + ...(input.DropFrameTimecode !== undefined && + input.DropFrameTimecode !== null && { dropFrameTimecode: input.DropFrameTimecode }), + ...(input.FixedAfd !== undefined && input.FixedAfd !== null && { fixedAfd: input.FixedAfd }), + ...(input.Height !== undefined && input.Height !== null && { height: input.Height }), + ...(input.Position !== undefined && + input.Position !== null && { position: serializeAws_restJson1Rectangle(input.Position, context) }), + ...(input.RespondToAfd !== undefined && input.RespondToAfd !== null && { respondToAfd: input.RespondToAfd }), + ...(input.ScalingBehavior !== undefined && + input.ScalingBehavior !== null && { scalingBehavior: input.ScalingBehavior }), + ...(input.Sharpness !== undefined && input.Sharpness !== null && { sharpness: input.Sharpness }), + ...(input.TimecodeInsertion !== undefined && + input.TimecodeInsertion !== null && { timecodeInsertion: input.TimecodeInsertion }), + ...(input.VideoPreprocessors !== undefined && + input.VideoPreprocessors !== null && { + videoPreprocessors: serializeAws_restJson1VideoPreprocessor(input.VideoPreprocessors, context), + }), + ...(input.Width !== undefined && input.Width !== null && { width: input.Width }), }; }; const serializeAws_restJson1VideoPreprocessor = (input: VideoPreprocessor, context: __SerdeContext): any => { return { - ...(input.ColorCorrector !== undefined && { - colorCorrector: serializeAws_restJson1ColorCorrector(input.ColorCorrector, context), - }), - ...(input.Deinterlacer !== undefined && { - deinterlacer: serializeAws_restJson1Deinterlacer(input.Deinterlacer, context), - }), - ...(input.DolbyVision !== undefined && { - dolbyVision: serializeAws_restJson1DolbyVision(input.DolbyVision, context), - }), - ...(input.ImageInserter !== undefined && { - imageInserter: serializeAws_restJson1ImageInserter(input.ImageInserter, context), - }), - ...(input.NoiseReducer !== undefined && { - noiseReducer: serializeAws_restJson1NoiseReducer(input.NoiseReducer, context), - }), - ...(input.PartnerWatermarking !== undefined && { - partnerWatermarking: serializeAws_restJson1PartnerWatermarking(input.PartnerWatermarking, context), - }), - ...(input.TimecodeBurnin !== undefined && { - timecodeBurnin: serializeAws_restJson1TimecodeBurnin(input.TimecodeBurnin, context), - }), + ...(input.ColorCorrector !== undefined && + input.ColorCorrector !== null && { + colorCorrector: serializeAws_restJson1ColorCorrector(input.ColorCorrector, context), + }), + ...(input.Deinterlacer !== undefined && + input.Deinterlacer !== null && { deinterlacer: serializeAws_restJson1Deinterlacer(input.Deinterlacer, context) }), + ...(input.DolbyVision !== undefined && + input.DolbyVision !== null && { dolbyVision: serializeAws_restJson1DolbyVision(input.DolbyVision, context) }), + ...(input.ImageInserter !== undefined && + input.ImageInserter !== null && { + imageInserter: serializeAws_restJson1ImageInserter(input.ImageInserter, context), + }), + ...(input.NoiseReducer !== undefined && + input.NoiseReducer !== null && { noiseReducer: serializeAws_restJson1NoiseReducer(input.NoiseReducer, context) }), + ...(input.PartnerWatermarking !== undefined && + input.PartnerWatermarking !== null && { + partnerWatermarking: serializeAws_restJson1PartnerWatermarking(input.PartnerWatermarking, context), + }), + ...(input.TimecodeBurnin !== undefined && + input.TimecodeBurnin !== null && { + timecodeBurnin: serializeAws_restJson1TimecodeBurnin(input.TimecodeBurnin, context), + }), }; }; const serializeAws_restJson1VideoSelector = (input: VideoSelector, context: __SerdeContext): any => { return { - ...(input.AlphaBehavior !== undefined && { alphaBehavior: input.AlphaBehavior }), - ...(input.ColorSpace !== undefined && { colorSpace: input.ColorSpace }), - ...(input.ColorSpaceUsage !== undefined && { colorSpaceUsage: input.ColorSpaceUsage }), - ...(input.Hdr10Metadata !== undefined && { - hdr10Metadata: serializeAws_restJson1Hdr10Metadata(input.Hdr10Metadata, context), - }), - ...(input.Pid !== undefined && { pid: input.Pid }), - ...(input.ProgramNumber !== undefined && { programNumber: input.ProgramNumber }), - ...(input.Rotate !== undefined && { rotate: input.Rotate }), + ...(input.AlphaBehavior !== undefined && input.AlphaBehavior !== null && { alphaBehavior: input.AlphaBehavior }), + ...(input.ColorSpace !== undefined && input.ColorSpace !== null && { colorSpace: input.ColorSpace }), + ...(input.ColorSpaceUsage !== undefined && + input.ColorSpaceUsage !== null && { colorSpaceUsage: input.ColorSpaceUsage }), + ...(input.Hdr10Metadata !== undefined && + input.Hdr10Metadata !== null && { + hdr10Metadata: serializeAws_restJson1Hdr10Metadata(input.Hdr10Metadata, context), + }), + ...(input.Pid !== undefined && input.Pid !== null && { pid: input.Pid }), + ...(input.ProgramNumber !== undefined && input.ProgramNumber !== null && { programNumber: input.ProgramNumber }), + ...(input.Rotate !== undefined && input.Rotate !== null && { rotate: input.Rotate }), }; }; const serializeAws_restJson1VorbisSettings = (input: VorbisSettings, context: __SerdeContext): any => { return { - ...(input.Channels !== undefined && { channels: input.Channels }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), - ...(input.VbrQuality !== undefined && { vbrQuality: input.VbrQuality }), + ...(input.Channels !== undefined && input.Channels !== null && { channels: input.Channels }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), + ...(input.VbrQuality !== undefined && input.VbrQuality !== null && { vbrQuality: input.VbrQuality }), }; }; const serializeAws_restJson1Vp8Settings = (input: Vp8Settings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateConversionAlgorithm !== undefined && { - framerateConversionAlgorithm: input.FramerateConversionAlgorithm, - }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.GopSize !== undefined && { gopSize: input.GopSize }), - ...(input.HrdBufferSize !== undefined && { hrdBufferSize: input.HrdBufferSize }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.ParControl !== undefined && { parControl: input.ParControl }), - ...(input.ParDenominator !== undefined && { parDenominator: input.ParDenominator }), - ...(input.ParNumerator !== undefined && { parNumerator: input.ParNumerator }), - ...(input.QualityTuningLevel !== undefined && { qualityTuningLevel: input.QualityTuningLevel }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateConversionAlgorithm !== undefined && + input.FramerateConversionAlgorithm !== null && { + framerateConversionAlgorithm: input.FramerateConversionAlgorithm, + }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.GopSize !== undefined && input.GopSize !== null && { gopSize: input.GopSize }), + ...(input.HrdBufferSize !== undefined && input.HrdBufferSize !== null && { hrdBufferSize: input.HrdBufferSize }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.ParControl !== undefined && input.ParControl !== null && { parControl: input.ParControl }), + ...(input.ParDenominator !== undefined && + input.ParDenominator !== null && { parDenominator: input.ParDenominator }), + ...(input.ParNumerator !== undefined && input.ParNumerator !== null && { parNumerator: input.ParNumerator }), + ...(input.QualityTuningLevel !== undefined && + input.QualityTuningLevel !== null && { qualityTuningLevel: input.QualityTuningLevel }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), }; }; const serializeAws_restJson1Vp9Settings = (input: Vp9Settings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateConversionAlgorithm !== undefined && { - framerateConversionAlgorithm: input.FramerateConversionAlgorithm, - }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.GopSize !== undefined && { gopSize: input.GopSize }), - ...(input.HrdBufferSize !== undefined && { hrdBufferSize: input.HrdBufferSize }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.ParControl !== undefined && { parControl: input.ParControl }), - ...(input.ParDenominator !== undefined && { parDenominator: input.ParDenominator }), - ...(input.ParNumerator !== undefined && { parNumerator: input.ParNumerator }), - ...(input.QualityTuningLevel !== undefined && { qualityTuningLevel: input.QualityTuningLevel }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateConversionAlgorithm !== undefined && + input.FramerateConversionAlgorithm !== null && { + framerateConversionAlgorithm: input.FramerateConversionAlgorithm, + }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.GopSize !== undefined && input.GopSize !== null && { gopSize: input.GopSize }), + ...(input.HrdBufferSize !== undefined && input.HrdBufferSize !== null && { hrdBufferSize: input.HrdBufferSize }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.ParControl !== undefined && input.ParControl !== null && { parControl: input.ParControl }), + ...(input.ParDenominator !== undefined && + input.ParDenominator !== null && { parDenominator: input.ParDenominator }), + ...(input.ParNumerator !== undefined && input.ParNumerator !== null && { parNumerator: input.ParNumerator }), + ...(input.QualityTuningLevel !== undefined && + input.QualityTuningLevel !== null && { qualityTuningLevel: input.QualityTuningLevel }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), }; }; const serializeAws_restJson1WavSettings = (input: WavSettings, context: __SerdeContext): any => { return { - ...(input.BitDepth !== undefined && { bitDepth: input.BitDepth }), - ...(input.Channels !== undefined && { channels: input.Channels }), - ...(input.Format !== undefined && { format: input.Format }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), + ...(input.BitDepth !== undefined && input.BitDepth !== null && { bitDepth: input.BitDepth }), + ...(input.Channels !== undefined && input.Channels !== null && { channels: input.Channels }), + ...(input.Format !== undefined && input.Format !== null && { format: input.Format }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), }; }; const deserializeAws_restJson1__listOf__integerMin1Max2147483647 = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__integerMin32Max8182 = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__integerMinNegative60Max6 = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__stringMin1 = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12 = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__stringPattern09aFAF809aFAF409aFAF409aFAF409aFAF12 = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__stringPatternS3ASSETMAPXml = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfAudioDescription = (output: any, context: __SerdeContext): AudioDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AudioDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AudioDescription(entry, context); + }); }; const deserializeAws_restJson1__listOfCaptionDescription = ( output: any, context: __SerdeContext ): CaptionDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CaptionDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CaptionDescription(entry, context); + }); }; const deserializeAws_restJson1__listOfCaptionDescriptionPreset = ( output: any, context: __SerdeContext ): CaptionDescriptionPreset[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CaptionDescriptionPreset(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CaptionDescriptionPreset(entry, context); + }); }; const deserializeAws_restJson1__listOfCmafAdditionalManifest = ( output: any, context: __SerdeContext ): CmafAdditionalManifest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CmafAdditionalManifest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CmafAdditionalManifest(entry, context); + }); }; const deserializeAws_restJson1__listOfDashAdditionalManifest = ( output: any, context: __SerdeContext ): DashAdditionalManifest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DashAdditionalManifest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DashAdditionalManifest(entry, context); + }); }; const deserializeAws_restJson1__listOfEndpoint = (output: any, context: __SerdeContext): Endpoint[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Endpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Endpoint(entry, context); + }); }; const deserializeAws_restJson1__listOfHlsAdditionalManifest = ( output: any, context: __SerdeContext ): HlsAdditionalManifest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HlsAdditionalManifest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HlsAdditionalManifest(entry, context); + }); }; const deserializeAws_restJson1__listOfHlsAdMarkers = ( output: any, context: __SerdeContext ): (HlsAdMarkers | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfHlsCaptionLanguageMapping = ( output: any, context: __SerdeContext ): HlsCaptionLanguageMapping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HlsCaptionLanguageMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HlsCaptionLanguageMapping(entry, context); + }); }; const deserializeAws_restJson1__listOfHopDestination = (output: any, context: __SerdeContext): HopDestination[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HopDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HopDestination(entry, context); + }); }; const deserializeAws_restJson1__listOfId3Insertion = (output: any, context: __SerdeContext): Id3Insertion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Id3Insertion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Id3Insertion(entry, context); + }); }; const deserializeAws_restJson1__listOfInput = (output: any, context: __SerdeContext): Input[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Input(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Input(entry, context); + }); }; const deserializeAws_restJson1__listOfInputClipping = (output: any, context: __SerdeContext): InputClipping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputClipping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputClipping(entry, context); + }); }; const deserializeAws_restJson1__listOfInputTemplate = (output: any, context: __SerdeContext): InputTemplate[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputTemplate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputTemplate(entry, context); + }); }; const deserializeAws_restJson1__listOfInsertableImage = (output: any, context: __SerdeContext): InsertableImage[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InsertableImage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InsertableImage(entry, context); + }); }; const deserializeAws_restJson1__listOfJob = (output: any, context: __SerdeContext): Job[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Job(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Job(entry, context); + }); }; const deserializeAws_restJson1__listOfJobTemplate = (output: any, context: __SerdeContext): JobTemplate[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JobTemplate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JobTemplate(entry, context); + }); }; const deserializeAws_restJson1__listOfMsSmoothAdditionalManifest = ( output: any, context: __SerdeContext ): MsSmoothAdditionalManifest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MsSmoothAdditionalManifest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MsSmoothAdditionalManifest(entry, context); + }); }; const deserializeAws_restJson1__listOfOutput = (output: any, context: __SerdeContext): Output[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Output(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Output(entry, context); + }); }; const deserializeAws_restJson1__listOfOutputChannelMapping = ( output: any, context: __SerdeContext ): OutputChannelMapping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutputChannelMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutputChannelMapping(entry, context); + }); }; const deserializeAws_restJson1__listOfOutputDetail = (output: any, context: __SerdeContext): OutputDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutputDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutputDetail(entry, context); + }); }; const deserializeAws_restJson1__listOfOutputGroup = (output: any, context: __SerdeContext): OutputGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutputGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutputGroup(entry, context); + }); }; const deserializeAws_restJson1__listOfOutputGroupDetail = ( output: any, context: __SerdeContext ): OutputGroupDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutputGroupDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutputGroupDetail(entry, context); + }); }; const deserializeAws_restJson1__listOfPreset = (output: any, context: __SerdeContext): Preset[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Preset(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Preset(entry, context); + }); }; const deserializeAws_restJson1__listOfQueue = (output: any, context: __SerdeContext): Queue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Queue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Queue(entry, context); + }); }; const deserializeAws_restJson1__listOfQueueTransition = (output: any, context: __SerdeContext): QueueTransition[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1QueueTransition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1QueueTransition(entry, context); + }); }; const deserializeAws_restJson1__listOfTeletextPageType = ( output: any, context: __SerdeContext ): (TeletextPageType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__mapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1__mapOfAudioSelector = ( output: any, context: __SerdeContext ): { [key: string]: AudioSelector } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AudioSelector }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AudioSelector }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1AudioSelector(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1__mapOfAudioSelectorGroup = ( output: any, context: __SerdeContext ): { [key: string]: AudioSelectorGroup } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AudioSelectorGroup }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AudioSelectorGroup }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1AudioSelectorGroup(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1__mapOfCaptionSelector = ( output: any, context: __SerdeContext ): { [key: string]: CaptionSelector } => { - return Object.entries(output).reduce( - (acc: { [key: string]: CaptionSelector }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: CaptionSelector }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1CaptionSelector(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AacSettings = (output: any, context: __SerdeContext): AacSettings => { @@ -9068,6 +9871,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-medialive/protocols/Aws_restJson1.ts b/clients/client-medialive/protocols/Aws_restJson1.ts index ff6b24ca8283..542bec42e891 100644 --- a/clients/client-medialive/protocols/Aws_restJson1.ts +++ b/clients/client-medialive/protocols/Aws_restJson1.ts @@ -350,9 +350,7 @@ export const serializeAws_restJson1AcceptInputDeviceTransferCommand = async ( input: AcceptInputDeviceTransferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputDevices/{InputDeviceId}/accept"; if (input.InputDeviceId !== undefined) { const labelValue: string = input.InputDeviceId; @@ -381,21 +379,23 @@ export const serializeAws_restJson1BatchDeleteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/batch/delete"; let body: any; body = JSON.stringify({ - ...(input.ChannelIds !== undefined && { - channelIds: serializeAws_restJson1__listOf__string(input.ChannelIds, context), - }), - ...(input.InputIds !== undefined && { inputIds: serializeAws_restJson1__listOf__string(input.InputIds, context) }), - ...(input.InputSecurityGroupIds !== undefined && { - inputSecurityGroupIds: serializeAws_restJson1__listOf__string(input.InputSecurityGroupIds, context), - }), - ...(input.MultiplexIds !== undefined && { - multiplexIds: serializeAws_restJson1__listOf__string(input.MultiplexIds, context), - }), + ...(input.ChannelIds !== undefined && + input.ChannelIds !== null && { channelIds: serializeAws_restJson1__listOf__string(input.ChannelIds, context) }), + ...(input.InputIds !== undefined && + input.InputIds !== null && { inputIds: serializeAws_restJson1__listOf__string(input.InputIds, context) }), + ...(input.InputSecurityGroupIds !== undefined && + input.InputSecurityGroupIds !== null && { + inputSecurityGroupIds: serializeAws_restJson1__listOf__string(input.InputSecurityGroupIds, context), + }), + ...(input.MultiplexIds !== undefined && + input.MultiplexIds !== null && { + multiplexIds: serializeAws_restJson1__listOf__string(input.MultiplexIds, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -414,17 +414,17 @@ export const serializeAws_restJson1BatchStartCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/batch/start"; let body: any; body = JSON.stringify({ - ...(input.ChannelIds !== undefined && { - channelIds: serializeAws_restJson1__listOf__string(input.ChannelIds, context), - }), - ...(input.MultiplexIds !== undefined && { - multiplexIds: serializeAws_restJson1__listOf__string(input.MultiplexIds, context), - }), + ...(input.ChannelIds !== undefined && + input.ChannelIds !== null && { channelIds: serializeAws_restJson1__listOf__string(input.ChannelIds, context) }), + ...(input.MultiplexIds !== undefined && + input.MultiplexIds !== null && { + multiplexIds: serializeAws_restJson1__listOf__string(input.MultiplexIds, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -443,17 +443,17 @@ export const serializeAws_restJson1BatchStopCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/batch/stop"; let body: any; body = JSON.stringify({ - ...(input.ChannelIds !== undefined && { - channelIds: serializeAws_restJson1__listOf__string(input.ChannelIds, context), - }), - ...(input.MultiplexIds !== undefined && { - multiplexIds: serializeAws_restJson1__listOf__string(input.MultiplexIds, context), - }), + ...(input.ChannelIds !== undefined && + input.ChannelIds !== null && { channelIds: serializeAws_restJson1__listOf__string(input.ChannelIds, context) }), + ...(input.MultiplexIds !== undefined && + input.MultiplexIds !== null && { + multiplexIds: serializeAws_restJson1__listOf__string(input.MultiplexIds, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -472,7 +472,7 @@ export const serializeAws_restJson1BatchUpdateScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/channels/{ChannelId}/schedule"; if (input.ChannelId !== undefined) { @@ -486,12 +486,14 @@ export const serializeAws_restJson1BatchUpdateScheduleCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Creates !== undefined && { - creates: serializeAws_restJson1BatchScheduleActionCreateRequest(input.Creates, context), - }), - ...(input.Deletes !== undefined && { - deletes: serializeAws_restJson1BatchScheduleActionDeleteRequest(input.Deletes, context), - }), + ...(input.Creates !== undefined && + input.Creates !== null && { + creates: serializeAws_restJson1BatchScheduleActionCreateRequest(input.Creates, context), + }), + ...(input.Deletes !== undefined && + input.Deletes !== null && { + deletes: serializeAws_restJson1BatchScheduleActionDeleteRequest(input.Deletes, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -509,9 +511,7 @@ export const serializeAws_restJson1CancelInputDeviceTransferCommand = async ( input: CancelInputDeviceTransferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputDevices/{InputDeviceId}/cancel"; if (input.InputDeviceId !== undefined) { const labelValue: string = input.InputDeviceId; @@ -540,33 +540,38 @@ export const serializeAws_restJson1CreateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/channels"; let body: any; body = JSON.stringify({ - ...(input.CdiInputSpecification !== undefined && { - cdiInputSpecification: serializeAws_restJson1CdiInputSpecification(input.CdiInputSpecification, context), - }), - ...(input.ChannelClass !== undefined && { channelClass: input.ChannelClass }), - ...(input.Destinations !== undefined && { - destinations: serializeAws_restJson1__listOfOutputDestination(input.Destinations, context), - }), - ...(input.EncoderSettings !== undefined && { - encoderSettings: serializeAws_restJson1EncoderSettings(input.EncoderSettings, context), - }), - ...(input.InputAttachments !== undefined && { - inputAttachments: serializeAws_restJson1__listOfInputAttachment(input.InputAttachments, context), - }), - ...(input.InputSpecification !== undefined && { - inputSpecification: serializeAws_restJson1InputSpecification(input.InputSpecification, context), - }), - ...(input.LogLevel !== undefined && { logLevel: input.LogLevel }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.CdiInputSpecification !== undefined && + input.CdiInputSpecification !== null && { + cdiInputSpecification: serializeAws_restJson1CdiInputSpecification(input.CdiInputSpecification, context), + }), + ...(input.ChannelClass !== undefined && input.ChannelClass !== null && { channelClass: input.ChannelClass }), + ...(input.Destinations !== undefined && + input.Destinations !== null && { + destinations: serializeAws_restJson1__listOfOutputDestination(input.Destinations, context), + }), + ...(input.EncoderSettings !== undefined && + input.EncoderSettings !== null && { + encoderSettings: serializeAws_restJson1EncoderSettings(input.EncoderSettings, context), + }), + ...(input.InputAttachments !== undefined && + input.InputAttachments !== null && { + inputAttachments: serializeAws_restJson1__listOfInputAttachment(input.InputAttachments, context), + }), + ...(input.InputSpecification !== undefined && + input.InputSpecification !== null && { + inputSpecification: serializeAws_restJson1InputSpecification(input.InputSpecification, context), + }), + ...(input.LogLevel !== undefined && input.LogLevel !== null && { logLevel: input.LogLevel }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), requestId: input.RequestId ?? generateIdempotencyToken(), - ...(input.Reserved !== undefined && { reserved: input.Reserved }), - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Reserved !== undefined && input.Reserved !== null && { reserved: input.Reserved }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -585,32 +590,36 @@ export const serializeAws_restJson1CreateInputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/inputs"; let body: any; body = JSON.stringify({ - ...(input.Destinations !== undefined && { - destinations: serializeAws_restJson1__listOfInputDestinationRequest(input.Destinations, context), - }), - ...(input.InputDevices !== undefined && { - inputDevices: serializeAws_restJson1__listOfInputDeviceSettings(input.InputDevices, context), - }), - ...(input.InputSecurityGroups !== undefined && { - inputSecurityGroups: serializeAws_restJson1__listOf__string(input.InputSecurityGroups, context), - }), - ...(input.MediaConnectFlows !== undefined && { - mediaConnectFlows: serializeAws_restJson1__listOfMediaConnectFlowRequest(input.MediaConnectFlows, context), - }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.Destinations !== undefined && + input.Destinations !== null && { + destinations: serializeAws_restJson1__listOfInputDestinationRequest(input.Destinations, context), + }), + ...(input.InputDevices !== undefined && + input.InputDevices !== null && { + inputDevices: serializeAws_restJson1__listOfInputDeviceSettings(input.InputDevices, context), + }), + ...(input.InputSecurityGroups !== undefined && + input.InputSecurityGroups !== null && { + inputSecurityGroups: serializeAws_restJson1__listOf__string(input.InputSecurityGroups, context), + }), + ...(input.MediaConnectFlows !== undefined && + input.MediaConnectFlows !== null && { + mediaConnectFlows: serializeAws_restJson1__listOfMediaConnectFlowRequest(input.MediaConnectFlows, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), requestId: input.RequestId ?? generateIdempotencyToken(), - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), - ...(input.Sources !== undefined && { - sources: serializeAws_restJson1__listOfInputSourceRequest(input.Sources, context), - }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.Type !== undefined && { type: input.Type }), - ...(input.Vpc !== undefined && { vpc: serializeAws_restJson1InputVpcRequest(input.Vpc, context) }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), + ...(input.Sources !== undefined && + input.Sources !== null && { sources: serializeAws_restJson1__listOfInputSourceRequest(input.Sources, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { type: input.Type }), + ...(input.Vpc !== undefined && + input.Vpc !== null && { vpc: serializeAws_restJson1InputVpcRequest(input.Vpc, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -629,15 +638,16 @@ export const serializeAws_restJson1CreateInputSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/inputSecurityGroups"; let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.WhitelistRules !== undefined && { - whitelistRules: serializeAws_restJson1__listOfInputWhitelistRuleCidr(input.WhitelistRules, context), - }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.WhitelistRules !== undefined && + input.WhitelistRules !== null && { + whitelistRules: serializeAws_restJson1__listOfInputWhitelistRuleCidr(input.WhitelistRules, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -656,20 +666,22 @@ export const serializeAws_restJson1CreateMultiplexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/multiplexes"; let body: any; body = JSON.stringify({ - ...(input.AvailabilityZones !== undefined && { - availabilityZones: serializeAws_restJson1__listOf__string(input.AvailabilityZones, context), - }), - ...(input.MultiplexSettings !== undefined && { - multiplexSettings: serializeAws_restJson1MultiplexSettings(input.MultiplexSettings, context), - }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + availabilityZones: serializeAws_restJson1__listOf__string(input.AvailabilityZones, context), + }), + ...(input.MultiplexSettings !== undefined && + input.MultiplexSettings !== null && { + multiplexSettings: serializeAws_restJson1MultiplexSettings(input.MultiplexSettings, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), requestId: input.RequestId ?? generateIdempotencyToken(), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -688,7 +700,7 @@ export const serializeAws_restJson1CreateMultiplexProgramCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/multiplexes/{MultiplexId}/programs"; if (input.MultiplexId !== undefined) { @@ -702,10 +714,14 @@ export const serializeAws_restJson1CreateMultiplexProgramCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MultiplexProgramSettings !== undefined && { - multiplexProgramSettings: serializeAws_restJson1MultiplexProgramSettings(input.MultiplexProgramSettings, context), - }), - ...(input.ProgramName !== undefined && { programName: input.ProgramName }), + ...(input.MultiplexProgramSettings !== undefined && + input.MultiplexProgramSettings !== null && { + multiplexProgramSettings: serializeAws_restJson1MultiplexProgramSettings( + input.MultiplexProgramSettings, + context + ), + }), + ...(input.ProgramName !== undefined && input.ProgramName !== null && { programName: input.ProgramName }), requestId: input.RequestId ?? generateIdempotencyToken(), }); const { hostname, protocol = "https", port } = await context.endpoint(); @@ -725,7 +741,7 @@ export const serializeAws_restJson1CreateTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -739,7 +755,7 @@ export const serializeAws_restJson1CreateTagsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -757,9 +773,7 @@ export const serializeAws_restJson1DeleteChannelCommand = async ( input: DeleteChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/channels/{ChannelId}"; if (input.ChannelId !== undefined) { const labelValue: string = input.ChannelId; @@ -787,9 +801,7 @@ export const serializeAws_restJson1DeleteInputCommand = async ( input: DeleteInputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputs/{InputId}"; if (input.InputId !== undefined) { const labelValue: string = input.InputId; @@ -817,9 +829,7 @@ export const serializeAws_restJson1DeleteInputSecurityGroupCommand = async ( input: DeleteInputSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputSecurityGroups/{InputSecurityGroupId}"; if (input.InputSecurityGroupId !== undefined) { const labelValue: string = input.InputSecurityGroupId; @@ -847,9 +857,7 @@ export const serializeAws_restJson1DeleteMultiplexCommand = async ( input: DeleteMultiplexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/multiplexes/{MultiplexId}"; if (input.MultiplexId !== undefined) { const labelValue: string = input.MultiplexId; @@ -877,9 +885,7 @@ export const serializeAws_restJson1DeleteMultiplexProgramCommand = async ( input: DeleteMultiplexProgramCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/multiplexes/{MultiplexId}/programs/{ProgramName}"; if (input.MultiplexId !== undefined) { const labelValue: string = input.MultiplexId; @@ -916,9 +922,7 @@ export const serializeAws_restJson1DeleteReservationCommand = async ( input: DeleteReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/reservations/{ReservationId}"; if (input.ReservationId !== undefined) { const labelValue: string = input.ReservationId; @@ -946,9 +950,7 @@ export const serializeAws_restJson1DeleteScheduleCommand = async ( input: DeleteScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/channels/{ChannelId}/schedule"; if (input.ChannelId !== undefined) { const labelValue: string = input.ChannelId; @@ -976,9 +978,7 @@ export const serializeAws_restJson1DeleteTagsCommand = async ( input: DeleteTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1010,9 +1010,7 @@ export const serializeAws_restJson1DescribeChannelCommand = async ( input: DescribeChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/channels/{ChannelId}"; if (input.ChannelId !== undefined) { const labelValue: string = input.ChannelId; @@ -1040,9 +1038,7 @@ export const serializeAws_restJson1DescribeInputCommand = async ( input: DescribeInputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputs/{InputId}"; if (input.InputId !== undefined) { const labelValue: string = input.InputId; @@ -1070,9 +1066,7 @@ export const serializeAws_restJson1DescribeInputDeviceCommand = async ( input: DescribeInputDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputDevices/{InputDeviceId}"; if (input.InputDeviceId !== undefined) { const labelValue: string = input.InputDeviceId; @@ -1101,7 +1095,6 @@ export const serializeAws_restJson1DescribeInputDeviceThumbnailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.Accept) && { accept: input.Accept! }), }; let resolvedPath = "/prod/inputDevices/{InputDeviceId}/thumbnailData"; @@ -1131,9 +1124,7 @@ export const serializeAws_restJson1DescribeInputSecurityGroupCommand = async ( input: DescribeInputSecurityGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputSecurityGroups/{InputSecurityGroupId}"; if (input.InputSecurityGroupId !== undefined) { const labelValue: string = input.InputSecurityGroupId; @@ -1161,9 +1152,7 @@ export const serializeAws_restJson1DescribeMultiplexCommand = async ( input: DescribeMultiplexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/multiplexes/{MultiplexId}"; if (input.MultiplexId !== undefined) { const labelValue: string = input.MultiplexId; @@ -1191,9 +1180,7 @@ export const serializeAws_restJson1DescribeMultiplexProgramCommand = async ( input: DescribeMultiplexProgramCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/multiplexes/{MultiplexId}/programs/{ProgramName}"; if (input.MultiplexId !== undefined) { const labelValue: string = input.MultiplexId; @@ -1230,9 +1217,7 @@ export const serializeAws_restJson1DescribeOfferingCommand = async ( input: DescribeOfferingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/offerings/{OfferingId}"; if (input.OfferingId !== undefined) { const labelValue: string = input.OfferingId; @@ -1260,9 +1245,7 @@ export const serializeAws_restJson1DescribeReservationCommand = async ( input: DescribeReservationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/reservations/{ReservationId}"; if (input.ReservationId !== undefined) { const labelValue: string = input.ReservationId; @@ -1290,9 +1273,7 @@ export const serializeAws_restJson1DescribeScheduleCommand = async ( input: DescribeScheduleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/channels/{ChannelId}/schedule"; if (input.ChannelId !== undefined) { const labelValue: string = input.ChannelId; @@ -1325,9 +1306,7 @@ export const serializeAws_restJson1ListChannelsCommand = async ( input: ListChannelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/channels"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1351,9 +1330,7 @@ export const serializeAws_restJson1ListInputDevicesCommand = async ( input: ListInputDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputDevices"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1377,9 +1354,7 @@ export const serializeAws_restJson1ListInputDeviceTransfersCommand = async ( input: ListInputDeviceTransfersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputDeviceTransfers"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1404,9 +1379,7 @@ export const serializeAws_restJson1ListInputsCommand = async ( input: ListInputsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputs"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1430,9 +1403,7 @@ export const serializeAws_restJson1ListInputSecurityGroupsCommand = async ( input: ListInputSecurityGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputSecurityGroups"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1456,9 +1427,7 @@ export const serializeAws_restJson1ListMultiplexesCommand = async ( input: ListMultiplexesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/multiplexes"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -1482,9 +1451,7 @@ export const serializeAws_restJson1ListMultiplexProgramsCommand = async ( input: ListMultiplexProgramsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/multiplexes/{MultiplexId}/programs"; if (input.MultiplexId !== undefined) { const labelValue: string = input.MultiplexId; @@ -1517,9 +1484,7 @@ export const serializeAws_restJson1ListOfferingsCommand = async ( input: ListOfferingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/offerings"; const query: any = { ...(input.ChannelClass !== undefined && { channelClass: input.ChannelClass }), @@ -1553,9 +1518,7 @@ export const serializeAws_restJson1ListReservationsCommand = async ( input: ListReservationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/reservations"; const query: any = { ...(input.ChannelClass !== undefined && { channelClass: input.ChannelClass }), @@ -1587,9 +1550,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1618,7 +1579,7 @@ export const serializeAws_restJson1PurchaseOfferingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/offerings/{OfferingId}/purchase"; if (input.OfferingId !== undefined) { @@ -1632,11 +1593,11 @@ export const serializeAws_restJson1PurchaseOfferingCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Count !== undefined && { count: input.Count }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.Count !== undefined && input.Count !== null && { count: input.Count }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), requestId: input.RequestId ?? generateIdempotencyToken(), - ...(input.Start !== undefined && { start: input.Start }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Start !== undefined && input.Start !== null && { start: input.Start }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1654,9 +1615,7 @@ export const serializeAws_restJson1RejectInputDeviceTransferCommand = async ( input: RejectInputDeviceTransferCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/inputDevices/{InputDeviceId}/reject"; if (input.InputDeviceId !== undefined) { const labelValue: string = input.InputDeviceId; @@ -1684,9 +1643,7 @@ export const serializeAws_restJson1StartChannelCommand = async ( input: StartChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/channels/{ChannelId}/start"; if (input.ChannelId !== undefined) { const labelValue: string = input.ChannelId; @@ -1714,9 +1671,7 @@ export const serializeAws_restJson1StartMultiplexCommand = async ( input: StartMultiplexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/multiplexes/{MultiplexId}/start"; if (input.MultiplexId !== undefined) { const labelValue: string = input.MultiplexId; @@ -1744,9 +1699,7 @@ export const serializeAws_restJson1StopChannelCommand = async ( input: StopChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/channels/{ChannelId}/stop"; if (input.ChannelId !== undefined) { const labelValue: string = input.ChannelId; @@ -1774,9 +1727,7 @@ export const serializeAws_restJson1StopMultiplexCommand = async ( input: StopMultiplexCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/prod/multiplexes/{MultiplexId}/stop"; if (input.MultiplexId !== undefined) { const labelValue: string = input.MultiplexId; @@ -1805,7 +1756,7 @@ export const serializeAws_restJson1TransferInputDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/inputDevices/{InputDeviceId}/transfer"; if (input.InputDeviceId !== undefined) { @@ -1819,8 +1770,10 @@ export const serializeAws_restJson1TransferInputDeviceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TargetCustomerId !== undefined && { targetCustomerId: input.TargetCustomerId }), - ...(input.TransferMessage !== undefined && { transferMessage: input.TransferMessage }), + ...(input.TargetCustomerId !== undefined && + input.TargetCustomerId !== null && { targetCustomerId: input.TargetCustomerId }), + ...(input.TransferMessage !== undefined && + input.TransferMessage !== null && { transferMessage: input.TransferMessage }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1839,7 +1792,7 @@ export const serializeAws_restJson1UpdateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/channels/{ChannelId}"; if (input.ChannelId !== undefined) { @@ -1853,24 +1806,29 @@ export const serializeAws_restJson1UpdateChannelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CdiInputSpecification !== undefined && { - cdiInputSpecification: serializeAws_restJson1CdiInputSpecification(input.CdiInputSpecification, context), - }), - ...(input.Destinations !== undefined && { - destinations: serializeAws_restJson1__listOfOutputDestination(input.Destinations, context), - }), - ...(input.EncoderSettings !== undefined && { - encoderSettings: serializeAws_restJson1EncoderSettings(input.EncoderSettings, context), - }), - ...(input.InputAttachments !== undefined && { - inputAttachments: serializeAws_restJson1__listOfInputAttachment(input.InputAttachments, context), - }), - ...(input.InputSpecification !== undefined && { - inputSpecification: serializeAws_restJson1InputSpecification(input.InputSpecification, context), - }), - ...(input.LogLevel !== undefined && { logLevel: input.LogLevel }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), + ...(input.CdiInputSpecification !== undefined && + input.CdiInputSpecification !== null && { + cdiInputSpecification: serializeAws_restJson1CdiInputSpecification(input.CdiInputSpecification, context), + }), + ...(input.Destinations !== undefined && + input.Destinations !== null && { + destinations: serializeAws_restJson1__listOfOutputDestination(input.Destinations, context), + }), + ...(input.EncoderSettings !== undefined && + input.EncoderSettings !== null && { + encoderSettings: serializeAws_restJson1EncoderSettings(input.EncoderSettings, context), + }), + ...(input.InputAttachments !== undefined && + input.InputAttachments !== null && { + inputAttachments: serializeAws_restJson1__listOfInputAttachment(input.InputAttachments, context), + }), + ...(input.InputSpecification !== undefined && + input.InputSpecification !== null && { + inputSpecification: serializeAws_restJson1InputSpecification(input.InputSpecification, context), + }), + ...(input.LogLevel !== undefined && input.LogLevel !== null && { logLevel: input.LogLevel }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1889,7 +1847,7 @@ export const serializeAws_restJson1UpdateChannelClassCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/channels/{ChannelId}/channelClass"; if (input.ChannelId !== undefined) { @@ -1903,10 +1861,11 @@ export const serializeAws_restJson1UpdateChannelClassCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ChannelClass !== undefined && { channelClass: input.ChannelClass }), - ...(input.Destinations !== undefined && { - destinations: serializeAws_restJson1__listOfOutputDestination(input.Destinations, context), - }), + ...(input.ChannelClass !== undefined && input.ChannelClass !== null && { channelClass: input.ChannelClass }), + ...(input.Destinations !== undefined && + input.Destinations !== null && { + destinations: serializeAws_restJson1__listOfOutputDestination(input.Destinations, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1925,7 +1884,7 @@ export const serializeAws_restJson1UpdateInputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/inputs/{InputId}"; if (input.InputId !== undefined) { @@ -1939,23 +1898,26 @@ export const serializeAws_restJson1UpdateInputCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Destinations !== undefined && { - destinations: serializeAws_restJson1__listOfInputDestinationRequest(input.Destinations, context), - }), - ...(input.InputDevices !== undefined && { - inputDevices: serializeAws_restJson1__listOfInputDeviceRequest(input.InputDevices, context), - }), - ...(input.InputSecurityGroups !== undefined && { - inputSecurityGroups: serializeAws_restJson1__listOf__string(input.InputSecurityGroups, context), - }), - ...(input.MediaConnectFlows !== undefined && { - mediaConnectFlows: serializeAws_restJson1__listOfMediaConnectFlowRequest(input.MediaConnectFlows, context), - }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), - ...(input.Sources !== undefined && { - sources: serializeAws_restJson1__listOfInputSourceRequest(input.Sources, context), - }), + ...(input.Destinations !== undefined && + input.Destinations !== null && { + destinations: serializeAws_restJson1__listOfInputDestinationRequest(input.Destinations, context), + }), + ...(input.InputDevices !== undefined && + input.InputDevices !== null && { + inputDevices: serializeAws_restJson1__listOfInputDeviceRequest(input.InputDevices, context), + }), + ...(input.InputSecurityGroups !== undefined && + input.InputSecurityGroups !== null && { + inputSecurityGroups: serializeAws_restJson1__listOf__string(input.InputSecurityGroups, context), + }), + ...(input.MediaConnectFlows !== undefined && + input.MediaConnectFlows !== null && { + mediaConnectFlows: serializeAws_restJson1__listOfMediaConnectFlowRequest(input.MediaConnectFlows, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), + ...(input.Sources !== undefined && + input.Sources !== null && { sources: serializeAws_restJson1__listOfInputSourceRequest(input.Sources, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1974,7 +1936,7 @@ export const serializeAws_restJson1UpdateInputDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/inputDevices/{InputDeviceId}"; if (input.InputDeviceId !== undefined) { @@ -1988,13 +1950,15 @@ export const serializeAws_restJson1UpdateInputDeviceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.HdDeviceSettings !== undefined && { - hdDeviceSettings: serializeAws_restJson1InputDeviceConfigurableSettings(input.HdDeviceSettings, context), - }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.UhdDeviceSettings !== undefined && { - uhdDeviceSettings: serializeAws_restJson1InputDeviceConfigurableSettings(input.UhdDeviceSettings, context), - }), + ...(input.HdDeviceSettings !== undefined && + input.HdDeviceSettings !== null && { + hdDeviceSettings: serializeAws_restJson1InputDeviceConfigurableSettings(input.HdDeviceSettings, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.UhdDeviceSettings !== undefined && + input.UhdDeviceSettings !== null && { + uhdDeviceSettings: serializeAws_restJson1InputDeviceConfigurableSettings(input.UhdDeviceSettings, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2013,7 +1977,7 @@ export const serializeAws_restJson1UpdateInputSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/inputSecurityGroups/{InputSecurityGroupId}"; if (input.InputSecurityGroupId !== undefined) { @@ -2027,10 +1991,11 @@ export const serializeAws_restJson1UpdateInputSecurityGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.WhitelistRules !== undefined && { - whitelistRules: serializeAws_restJson1__listOfInputWhitelistRuleCidr(input.WhitelistRules, context), - }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.WhitelistRules !== undefined && + input.WhitelistRules !== null && { + whitelistRules: serializeAws_restJson1__listOfInputWhitelistRuleCidr(input.WhitelistRules, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2049,7 +2014,7 @@ export const serializeAws_restJson1UpdateMultiplexCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/multiplexes/{MultiplexId}"; if (input.MultiplexId !== undefined) { @@ -2063,10 +2028,11 @@ export const serializeAws_restJson1UpdateMultiplexCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MultiplexSettings !== undefined && { - multiplexSettings: serializeAws_restJson1MultiplexSettings(input.MultiplexSettings, context), - }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.MultiplexSettings !== undefined && + input.MultiplexSettings !== null && { + multiplexSettings: serializeAws_restJson1MultiplexSettings(input.MultiplexSettings, context), + }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2085,7 +2051,7 @@ export const serializeAws_restJson1UpdateMultiplexProgramCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/multiplexes/{MultiplexId}/programs/{ProgramName}"; if (input.MultiplexId !== undefined) { @@ -2108,9 +2074,13 @@ export const serializeAws_restJson1UpdateMultiplexProgramCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MultiplexProgramSettings !== undefined && { - multiplexProgramSettings: serializeAws_restJson1MultiplexProgramSettings(input.MultiplexProgramSettings, context), - }), + ...(input.MultiplexProgramSettings !== undefined && + input.MultiplexProgramSettings !== null && { + multiplexProgramSettings: serializeAws_restJson1MultiplexProgramSettings( + input.MultiplexProgramSettings, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2129,7 +2099,7 @@ export const serializeAws_restJson1UpdateReservationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/prod/reservations/{ReservationId}"; if (input.ReservationId !== undefined) { @@ -2143,7 +2113,7 @@ export const serializeAws_restJson1UpdateReservationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -8910,179 +8880,377 @@ const deserializeAws_restJson1UnprocessableEntityExceptionResponse = async ( }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfAudioChannelMapping = ( input: AudioChannelMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AudioChannelMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AudioChannelMapping(entry, context); + }); }; const serializeAws_restJson1__listOfAudioDescription = (input: AudioDescription[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AudioDescription(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AudioDescription(entry, context); + }); }; const serializeAws_restJson1__listOfAudioSelector = (input: AudioSelector[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AudioSelector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AudioSelector(entry, context); + }); }; const serializeAws_restJson1__listOfAudioTrack = (input: AudioTrack[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AudioTrack(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AudioTrack(entry, context); + }); }; const serializeAws_restJson1__listOfCaptionDescription = ( input: CaptionDescription[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CaptionDescription(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CaptionDescription(entry, context); + }); }; const serializeAws_restJson1__listOfCaptionLanguageMapping = ( input: CaptionLanguageMapping[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CaptionLanguageMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CaptionLanguageMapping(entry, context); + }); }; const serializeAws_restJson1__listOfCaptionSelector = (input: CaptionSelector[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CaptionSelector(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CaptionSelector(entry, context); + }); }; const serializeAws_restJson1__listOfFailoverCondition = (input: FailoverCondition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1FailoverCondition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1FailoverCondition(entry, context); + }); }; const serializeAws_restJson1__listOfHlsAdMarkers = (input: (HlsAdMarkers | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfInputAttachment = (input: InputAttachment[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1InputAttachment(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputAttachment(entry, context); + }); }; const serializeAws_restJson1__listOfInputChannelLevel = (input: InputChannelLevel[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1InputChannelLevel(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputChannelLevel(entry, context); + }); }; const serializeAws_restJson1__listOfInputDestinationRequest = ( input: InputDestinationRequest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1InputDestinationRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputDestinationRequest(entry, context); + }); }; const serializeAws_restJson1__listOfInputDeviceRequest = ( input: InputDeviceRequest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1InputDeviceRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputDeviceRequest(entry, context); + }); }; const serializeAws_restJson1__listOfInputDeviceSettings = ( input: InputDeviceSettings[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1InputDeviceSettings(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputDeviceSettings(entry, context); + }); }; const serializeAws_restJson1__listOfInputSourceRequest = ( input: InputSourceRequest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1InputSourceRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputSourceRequest(entry, context); + }); }; const serializeAws_restJson1__listOfInputWhitelistRuleCidr = ( input: InputWhitelistRuleCidr[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1InputWhitelistRuleCidr(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputWhitelistRuleCidr(entry, context); + }); }; const serializeAws_restJson1__listOfMediaConnectFlowRequest = ( input: MediaConnectFlowRequest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1MediaConnectFlowRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MediaConnectFlowRequest(entry, context); + }); }; const serializeAws_restJson1__listOfMediaPackageOutputDestinationSettings = ( input: MediaPackageOutputDestinationSettings[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1MediaPackageOutputDestinationSettings(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MediaPackageOutputDestinationSettings(entry, context); + }); }; const serializeAws_restJson1__listOfOutput = (input: Output[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Output(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Output(entry, context); + }); }; const serializeAws_restJson1__listOfOutputDestination = (input: OutputDestination[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1OutputDestination(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1OutputDestination(entry, context); + }); }; const serializeAws_restJson1__listOfOutputDestinationSettings = ( input: OutputDestinationSettings[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1OutputDestinationSettings(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1OutputDestinationSettings(entry, context); + }); }; const serializeAws_restJson1__listOfOutputGroup = (input: OutputGroup[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1OutputGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1OutputGroup(entry, context); + }); }; const serializeAws_restJson1__listOfPipelinePauseStateSettings = ( input: PipelinePauseStateSettings[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1PipelinePauseStateSettings(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1PipelinePauseStateSettings(entry, context); + }); }; const serializeAws_restJson1__listOfRtmpAdMarkers = ( input: (RtmpAdMarkers | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfScheduleAction = (input: ScheduleAction[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ScheduleAction(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ScheduleAction(entry, context); + }); }; const serializeAws_restJson1__listOfScte35Descriptor = (input: Scte35Descriptor[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Scte35Descriptor(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Scte35Descriptor(entry, context); + }); }; const serializeAws_restJson1__listOfVideoDescription = (input: VideoDescription[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1VideoDescription(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1VideoDescription(entry, context); + }); }; const serializeAws_restJson1AacSettings = (input: AacSettings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), - ...(input.InputType !== undefined && { inputType: input.InputType }), - ...(input.Profile !== undefined && { profile: input.Profile }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), - ...(input.RawFormat !== undefined && { rawFormat: input.RawFormat }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), - ...(input.Spec !== undefined && { spec: input.Spec }), - ...(input.VbrQuality !== undefined && { vbrQuality: input.VbrQuality }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.CodingMode !== undefined && input.CodingMode !== null && { codingMode: input.CodingMode }), + ...(input.InputType !== undefined && input.InputType !== null && { inputType: input.InputType }), + ...(input.Profile !== undefined && input.Profile !== null && { profile: input.Profile }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), + ...(input.RawFormat !== undefined && input.RawFormat !== null && { rawFormat: input.RawFormat }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), + ...(input.Spec !== undefined && input.Spec !== null && { spec: input.Spec }), + ...(input.VbrQuality !== undefined && input.VbrQuality !== null && { vbrQuality: input.VbrQuality }), }; }; const serializeAws_restJson1Ac3Settings = (input: Ac3Settings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.BitstreamMode !== undefined && { bitstreamMode: input.BitstreamMode }), - ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), - ...(input.Dialnorm !== undefined && { dialnorm: input.Dialnorm }), - ...(input.DrcProfile !== undefined && { drcProfile: input.DrcProfile }), - ...(input.LfeFilter !== undefined && { lfeFilter: input.LfeFilter }), - ...(input.MetadataControl !== undefined && { metadataControl: input.MetadataControl }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.BitstreamMode !== undefined && input.BitstreamMode !== null && { bitstreamMode: input.BitstreamMode }), + ...(input.CodingMode !== undefined && input.CodingMode !== null && { codingMode: input.CodingMode }), + ...(input.Dialnorm !== undefined && input.Dialnorm !== null && { dialnorm: input.Dialnorm }), + ...(input.DrcProfile !== undefined && input.DrcProfile !== null && { drcProfile: input.DrcProfile }), + ...(input.LfeFilter !== undefined && input.LfeFilter !== null && { lfeFilter: input.LfeFilter }), + ...(input.MetadataControl !== undefined && + input.MetadataControl !== null && { metadataControl: input.MetadataControl }), }; }; @@ -9091,9 +9259,10 @@ const serializeAws_restJson1AncillarySourceSettings = ( context: __SerdeContext ): any => { return { - ...(input.SourceAncillaryChannelNumber !== undefined && { - sourceAncillaryChannelNumber: input.SourceAncillaryChannelNumber, - }), + ...(input.SourceAncillaryChannelNumber !== undefined && + input.SourceAncillaryChannelNumber !== null && { + sourceAncillaryChannelNumber: input.SourceAncillaryChannelNumber, + }), }; }; @@ -9102,31 +9271,32 @@ const serializeAws_restJson1ArchiveContainerSettings = ( context: __SerdeContext ): any => { return { - ...(input.M2tsSettings !== undefined && { - m2tsSettings: serializeAws_restJson1M2tsSettings(input.M2tsSettings, context), - }), - ...(input.RawSettings !== undefined && { - rawSettings: serializeAws_restJson1RawSettings(input.RawSettings, context), - }), + ...(input.M2tsSettings !== undefined && + input.M2tsSettings !== null && { m2tsSettings: serializeAws_restJson1M2tsSettings(input.M2tsSettings, context) }), + ...(input.RawSettings !== undefined && + input.RawSettings !== null && { rawSettings: serializeAws_restJson1RawSettings(input.RawSettings, context) }), }; }; const serializeAws_restJson1ArchiveGroupSettings = (input: ArchiveGroupSettings, context: __SerdeContext): any => { return { - ...(input.Destination !== undefined && { - destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), - }), - ...(input.RolloverInterval !== undefined && { rolloverInterval: input.RolloverInterval }), + ...(input.Destination !== undefined && + input.Destination !== null && { + destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), + }), + ...(input.RolloverInterval !== undefined && + input.RolloverInterval !== null && { rolloverInterval: input.RolloverInterval }), }; }; const serializeAws_restJson1ArchiveOutputSettings = (input: ArchiveOutputSettings, context: __SerdeContext): any => { return { - ...(input.ContainerSettings !== undefined && { - containerSettings: serializeAws_restJson1ArchiveContainerSettings(input.ContainerSettings, context), - }), - ...(input.Extension !== undefined && { extension: input.Extension }), - ...(input.NameModifier !== undefined && { nameModifier: input.NameModifier }), + ...(input.ContainerSettings !== undefined && + input.ContainerSettings !== null && { + containerSettings: serializeAws_restJson1ArchiveContainerSettings(input.ContainerSettings, context), + }), + ...(input.Extension !== undefined && input.Extension !== null && { extension: input.Extension }), + ...(input.NameModifier !== undefined && input.NameModifier !== null && { nameModifier: input.NameModifier }), }; }; @@ -9143,64 +9313,68 @@ const serializeAws_restJson1AribSourceSettings = (input: AribSourceSettings, con const serializeAws_restJson1AudioChannelMapping = (input: AudioChannelMapping, context: __SerdeContext): any => { return { - ...(input.InputChannelLevels !== undefined && { - inputChannelLevels: serializeAws_restJson1__listOfInputChannelLevel(input.InputChannelLevels, context), - }), - ...(input.OutputChannel !== undefined && { outputChannel: input.OutputChannel }), + ...(input.InputChannelLevels !== undefined && + input.InputChannelLevels !== null && { + inputChannelLevels: serializeAws_restJson1__listOfInputChannelLevel(input.InputChannelLevels, context), + }), + ...(input.OutputChannel !== undefined && input.OutputChannel !== null && { outputChannel: input.OutputChannel }), }; }; const serializeAws_restJson1AudioCodecSettings = (input: AudioCodecSettings, context: __SerdeContext): any => { return { - ...(input.AacSettings !== undefined && { - aacSettings: serializeAws_restJson1AacSettings(input.AacSettings, context), - }), - ...(input.Ac3Settings !== undefined && { - ac3Settings: serializeAws_restJson1Ac3Settings(input.Ac3Settings, context), - }), - ...(input.Eac3Settings !== undefined && { - eac3Settings: serializeAws_restJson1Eac3Settings(input.Eac3Settings, context), - }), - ...(input.Mp2Settings !== undefined && { - mp2Settings: serializeAws_restJson1Mp2Settings(input.Mp2Settings, context), - }), - ...(input.PassThroughSettings !== undefined && { - passThroughSettings: serializeAws_restJson1PassThroughSettings(input.PassThroughSettings, context), - }), - ...(input.WavSettings !== undefined && { - wavSettings: serializeAws_restJson1WavSettings(input.WavSettings, context), - }), + ...(input.AacSettings !== undefined && + input.AacSettings !== null && { aacSettings: serializeAws_restJson1AacSettings(input.AacSettings, context) }), + ...(input.Ac3Settings !== undefined && + input.Ac3Settings !== null && { ac3Settings: serializeAws_restJson1Ac3Settings(input.Ac3Settings, context) }), + ...(input.Eac3Settings !== undefined && + input.Eac3Settings !== null && { eac3Settings: serializeAws_restJson1Eac3Settings(input.Eac3Settings, context) }), + ...(input.Mp2Settings !== undefined && + input.Mp2Settings !== null && { mp2Settings: serializeAws_restJson1Mp2Settings(input.Mp2Settings, context) }), + ...(input.PassThroughSettings !== undefined && + input.PassThroughSettings !== null && { + passThroughSettings: serializeAws_restJson1PassThroughSettings(input.PassThroughSettings, context), + }), + ...(input.WavSettings !== undefined && + input.WavSettings !== null && { wavSettings: serializeAws_restJson1WavSettings(input.WavSettings, context) }), }; }; const serializeAws_restJson1AudioDescription = (input: AudioDescription, context: __SerdeContext): any => { return { - ...(input.AudioNormalizationSettings !== undefined && { - audioNormalizationSettings: serializeAws_restJson1AudioNormalizationSettings( - input.AudioNormalizationSettings, - context - ), - }), - ...(input.AudioSelectorName !== undefined && { audioSelectorName: input.AudioSelectorName }), - ...(input.AudioType !== undefined && { audioType: input.AudioType }), - ...(input.AudioTypeControl !== undefined && { audioTypeControl: input.AudioTypeControl }), - ...(input.CodecSettings !== undefined && { - codecSettings: serializeAws_restJson1AudioCodecSettings(input.CodecSettings, context), - }), - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.LanguageCodeControl !== undefined && { languageCodeControl: input.LanguageCodeControl }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.RemixSettings !== undefined && { - remixSettings: serializeAws_restJson1RemixSettings(input.RemixSettings, context), - }), - ...(input.StreamName !== undefined && { streamName: input.StreamName }), + ...(input.AudioNormalizationSettings !== undefined && + input.AudioNormalizationSettings !== null && { + audioNormalizationSettings: serializeAws_restJson1AudioNormalizationSettings( + input.AudioNormalizationSettings, + context + ), + }), + ...(input.AudioSelectorName !== undefined && + input.AudioSelectorName !== null && { audioSelectorName: input.AudioSelectorName }), + ...(input.AudioType !== undefined && input.AudioType !== null && { audioType: input.AudioType }), + ...(input.AudioTypeControl !== undefined && + input.AudioTypeControl !== null && { audioTypeControl: input.AudioTypeControl }), + ...(input.CodecSettings !== undefined && + input.CodecSettings !== null && { + codecSettings: serializeAws_restJson1AudioCodecSettings(input.CodecSettings, context), + }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.LanguageCodeControl !== undefined && + input.LanguageCodeControl !== null && { languageCodeControl: input.LanguageCodeControl }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.RemixSettings !== undefined && + input.RemixSettings !== null && { + remixSettings: serializeAws_restJson1RemixSettings(input.RemixSettings, context), + }), + ...(input.StreamName !== undefined && input.StreamName !== null && { streamName: input.StreamName }), }; }; const serializeAws_restJson1AudioLanguageSelection = (input: AudioLanguageSelection, context: __SerdeContext): any => { return { - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.LanguageSelectionPolicy !== undefined && { languageSelectionPolicy: input.LanguageSelectionPolicy }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.LanguageSelectionPolicy !== undefined && + input.LanguageSelectionPolicy !== null && { languageSelectionPolicy: input.LanguageSelectionPolicy }), }; }; @@ -9209,49 +9383,56 @@ const serializeAws_restJson1AudioNormalizationSettings = ( context: __SerdeContext ): any => { return { - ...(input.Algorithm !== undefined && { algorithm: input.Algorithm }), - ...(input.AlgorithmControl !== undefined && { algorithmControl: input.AlgorithmControl }), - ...(input.TargetLkfs !== undefined && { targetLkfs: input.TargetLkfs }), + ...(input.Algorithm !== undefined && input.Algorithm !== null && { algorithm: input.Algorithm }), + ...(input.AlgorithmControl !== undefined && + input.AlgorithmControl !== null && { algorithmControl: input.AlgorithmControl }), + ...(input.TargetLkfs !== undefined && input.TargetLkfs !== null && { targetLkfs: input.TargetLkfs }), }; }; const serializeAws_restJson1AudioOnlyHlsSettings = (input: AudioOnlyHlsSettings, context: __SerdeContext): any => { return { - ...(input.AudioGroupId !== undefined && { audioGroupId: input.AudioGroupId }), - ...(input.AudioOnlyImage !== undefined && { - audioOnlyImage: serializeAws_restJson1InputLocation(input.AudioOnlyImage, context), - }), - ...(input.AudioTrackType !== undefined && { audioTrackType: input.AudioTrackType }), - ...(input.SegmentType !== undefined && { segmentType: input.SegmentType }), + ...(input.AudioGroupId !== undefined && input.AudioGroupId !== null && { audioGroupId: input.AudioGroupId }), + ...(input.AudioOnlyImage !== undefined && + input.AudioOnlyImage !== null && { + audioOnlyImage: serializeAws_restJson1InputLocation(input.AudioOnlyImage, context), + }), + ...(input.AudioTrackType !== undefined && + input.AudioTrackType !== null && { audioTrackType: input.AudioTrackType }), + ...(input.SegmentType !== undefined && input.SegmentType !== null && { segmentType: input.SegmentType }), }; }; const serializeAws_restJson1AudioPidSelection = (input: AudioPidSelection, context: __SerdeContext): any => { return { - ...(input.Pid !== undefined && { pid: input.Pid }), + ...(input.Pid !== undefined && input.Pid !== null && { pid: input.Pid }), }; }; const serializeAws_restJson1AudioSelector = (input: AudioSelector, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { name: input.Name }), - ...(input.SelectorSettings !== undefined && { - selectorSettings: serializeAws_restJson1AudioSelectorSettings(input.SelectorSettings, context), - }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.SelectorSettings !== undefined && + input.SelectorSettings !== null && { + selectorSettings: serializeAws_restJson1AudioSelectorSettings(input.SelectorSettings, context), + }), }; }; const serializeAws_restJson1AudioSelectorSettings = (input: AudioSelectorSettings, context: __SerdeContext): any => { return { - ...(input.AudioLanguageSelection !== undefined && { - audioLanguageSelection: serializeAws_restJson1AudioLanguageSelection(input.AudioLanguageSelection, context), - }), - ...(input.AudioPidSelection !== undefined && { - audioPidSelection: serializeAws_restJson1AudioPidSelection(input.AudioPidSelection, context), - }), - ...(input.AudioTrackSelection !== undefined && { - audioTrackSelection: serializeAws_restJson1AudioTrackSelection(input.AudioTrackSelection, context), - }), + ...(input.AudioLanguageSelection !== undefined && + input.AudioLanguageSelection !== null && { + audioLanguageSelection: serializeAws_restJson1AudioLanguageSelection(input.AudioLanguageSelection, context), + }), + ...(input.AudioPidSelection !== undefined && + input.AudioPidSelection !== null && { + audioPidSelection: serializeAws_restJson1AudioPidSelection(input.AudioPidSelection, context), + }), + ...(input.AudioTrackSelection !== undefined && + input.AudioTrackSelection !== null && { + audioTrackSelection: serializeAws_restJson1AudioTrackSelection(input.AudioTrackSelection, context), + }), }; }; @@ -9260,22 +9441,23 @@ const serializeAws_restJson1AudioSilenceFailoverSettings = ( context: __SerdeContext ): any => { return { - ...(input.AudioSelectorName !== undefined && { audioSelectorName: input.AudioSelectorName }), - ...(input.AudioSilenceThresholdMsec !== undefined && { - audioSilenceThresholdMsec: input.AudioSilenceThresholdMsec, - }), + ...(input.AudioSelectorName !== undefined && + input.AudioSelectorName !== null && { audioSelectorName: input.AudioSelectorName }), + ...(input.AudioSilenceThresholdMsec !== undefined && + input.AudioSilenceThresholdMsec !== null && { audioSilenceThresholdMsec: input.AudioSilenceThresholdMsec }), }; }; const serializeAws_restJson1AudioTrack = (input: AudioTrack, context: __SerdeContext): any => { return { - ...(input.Track !== undefined && { track: input.Track }), + ...(input.Track !== undefined && input.Track !== null && { track: input.Track }), }; }; const serializeAws_restJson1AudioTrackSelection = (input: AudioTrackSelection, context: __SerdeContext): any => { return { - ...(input.Tracks !== undefined && { tracks: serializeAws_restJson1__listOfAudioTrack(input.Tracks, context) }), + ...(input.Tracks !== undefined && + input.Tracks !== null && { tracks: serializeAws_restJson1__listOfAudioTrack(input.Tracks, context) }), }; }; @@ -9284,40 +9466,48 @@ const serializeAws_restJson1AutomaticInputFailoverSettings = ( context: __SerdeContext ): any => { return { - ...(input.ErrorClearTimeMsec !== undefined && { errorClearTimeMsec: input.ErrorClearTimeMsec }), - ...(input.FailoverConditions !== undefined && { - failoverConditions: serializeAws_restJson1__listOfFailoverCondition(input.FailoverConditions, context), - }), - ...(input.InputPreference !== undefined && { inputPreference: input.InputPreference }), - ...(input.SecondaryInputId !== undefined && { secondaryInputId: input.SecondaryInputId }), + ...(input.ErrorClearTimeMsec !== undefined && + input.ErrorClearTimeMsec !== null && { errorClearTimeMsec: input.ErrorClearTimeMsec }), + ...(input.FailoverConditions !== undefined && + input.FailoverConditions !== null && { + failoverConditions: serializeAws_restJson1__listOfFailoverCondition(input.FailoverConditions, context), + }), + ...(input.InputPreference !== undefined && + input.InputPreference !== null && { inputPreference: input.InputPreference }), + ...(input.SecondaryInputId !== undefined && + input.SecondaryInputId !== null && { secondaryInputId: input.SecondaryInputId }), }; }; const serializeAws_restJson1AvailBlanking = (input: AvailBlanking, context: __SerdeContext): any => { return { - ...(input.AvailBlankingImage !== undefined && { - availBlankingImage: serializeAws_restJson1InputLocation(input.AvailBlankingImage, context), - }), - ...(input.State !== undefined && { state: input.State }), + ...(input.AvailBlankingImage !== undefined && + input.AvailBlankingImage !== null && { + availBlankingImage: serializeAws_restJson1InputLocation(input.AvailBlankingImage, context), + }), + ...(input.State !== undefined && input.State !== null && { state: input.State }), }; }; const serializeAws_restJson1AvailConfiguration = (input: AvailConfiguration, context: __SerdeContext): any => { return { - ...(input.AvailSettings !== undefined && { - availSettings: serializeAws_restJson1AvailSettings(input.AvailSettings, context), - }), + ...(input.AvailSettings !== undefined && + input.AvailSettings !== null && { + availSettings: serializeAws_restJson1AvailSettings(input.AvailSettings, context), + }), }; }; const serializeAws_restJson1AvailSettings = (input: AvailSettings, context: __SerdeContext): any => { return { - ...(input.Scte35SpliceInsert !== undefined && { - scte35SpliceInsert: serializeAws_restJson1Scte35SpliceInsert(input.Scte35SpliceInsert, context), - }), - ...(input.Scte35TimeSignalApos !== undefined && { - scte35TimeSignalApos: serializeAws_restJson1Scte35TimeSignalApos(input.Scte35TimeSignalApos, context), - }), + ...(input.Scte35SpliceInsert !== undefined && + input.Scte35SpliceInsert !== null && { + scte35SpliceInsert: serializeAws_restJson1Scte35SpliceInsert(input.Scte35SpliceInsert, context), + }), + ...(input.Scte35TimeSignalApos !== undefined && + input.Scte35TimeSignalApos !== null && { + scte35TimeSignalApos: serializeAws_restJson1Scte35TimeSignalApos(input.Scte35TimeSignalApos, context), + }), }; }; @@ -9326,9 +9516,10 @@ const serializeAws_restJson1BatchScheduleActionCreateRequest = ( context: __SerdeContext ): any => { return { - ...(input.ScheduleActions !== undefined && { - scheduleActions: serializeAws_restJson1__listOfScheduleAction(input.ScheduleActions, context), - }), + ...(input.ScheduleActions !== undefined && + input.ScheduleActions !== null && { + scheduleActions: serializeAws_restJson1__listOfScheduleAction(input.ScheduleActions, context), + }), }; }; @@ -9337,23 +9528,27 @@ const serializeAws_restJson1BatchScheduleActionDeleteRequest = ( context: __SerdeContext ): any => { return { - ...(input.ActionNames !== undefined && { - actionNames: serializeAws_restJson1__listOf__string(input.ActionNames, context), - }), + ...(input.ActionNames !== undefined && + input.ActionNames !== null && { + actionNames: serializeAws_restJson1__listOf__string(input.ActionNames, context), + }), }; }; const serializeAws_restJson1BlackoutSlate = (input: BlackoutSlate, context: __SerdeContext): any => { return { - ...(input.BlackoutSlateImage !== undefined && { - blackoutSlateImage: serializeAws_restJson1InputLocation(input.BlackoutSlateImage, context), - }), - ...(input.NetworkEndBlackout !== undefined && { networkEndBlackout: input.NetworkEndBlackout }), - ...(input.NetworkEndBlackoutImage !== undefined && { - networkEndBlackoutImage: serializeAws_restJson1InputLocation(input.NetworkEndBlackoutImage, context), - }), - ...(input.NetworkId !== undefined && { networkId: input.NetworkId }), - ...(input.State !== undefined && { state: input.State }), + ...(input.BlackoutSlateImage !== undefined && + input.BlackoutSlateImage !== null && { + blackoutSlateImage: serializeAws_restJson1InputLocation(input.BlackoutSlateImage, context), + }), + ...(input.NetworkEndBlackout !== undefined && + input.NetworkEndBlackout !== null && { networkEndBlackout: input.NetworkEndBlackout }), + ...(input.NetworkEndBlackoutImage !== undefined && + input.NetworkEndBlackoutImage !== null && { + networkEndBlackoutImage: serializeAws_restJson1InputLocation(input.NetworkEndBlackoutImage, context), + }), + ...(input.NetworkId !== undefined && input.NetworkId !== null && { networkId: input.NetworkId }), + ...(input.State !== undefined && input.State !== null && { state: input.State }), }; }; @@ -9362,35 +9557,43 @@ const serializeAws_restJson1BurnInDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.Alignment !== undefined && { alignment: input.Alignment }), - ...(input.BackgroundColor !== undefined && { backgroundColor: input.BackgroundColor }), - ...(input.BackgroundOpacity !== undefined && { backgroundOpacity: input.BackgroundOpacity }), - ...(input.Font !== undefined && { font: serializeAws_restJson1InputLocation(input.Font, context) }), - ...(input.FontColor !== undefined && { fontColor: input.FontColor }), - ...(input.FontOpacity !== undefined && { fontOpacity: input.FontOpacity }), - ...(input.FontResolution !== undefined && { fontResolution: input.FontResolution }), - ...(input.FontSize !== undefined && { fontSize: input.FontSize }), - ...(input.OutlineColor !== undefined && { outlineColor: input.OutlineColor }), - ...(input.OutlineSize !== undefined && { outlineSize: input.OutlineSize }), - ...(input.ShadowColor !== undefined && { shadowColor: input.ShadowColor }), - ...(input.ShadowOpacity !== undefined && { shadowOpacity: input.ShadowOpacity }), - ...(input.ShadowXOffset !== undefined && { shadowXOffset: input.ShadowXOffset }), - ...(input.ShadowYOffset !== undefined && { shadowYOffset: input.ShadowYOffset }), - ...(input.TeletextGridControl !== undefined && { teletextGridControl: input.TeletextGridControl }), - ...(input.XPosition !== undefined && { xPosition: input.XPosition }), - ...(input.YPosition !== undefined && { yPosition: input.YPosition }), + ...(input.Alignment !== undefined && input.Alignment !== null && { alignment: input.Alignment }), + ...(input.BackgroundColor !== undefined && + input.BackgroundColor !== null && { backgroundColor: input.BackgroundColor }), + ...(input.BackgroundOpacity !== undefined && + input.BackgroundOpacity !== null && { backgroundOpacity: input.BackgroundOpacity }), + ...(input.Font !== undefined && + input.Font !== null && { font: serializeAws_restJson1InputLocation(input.Font, context) }), + ...(input.FontColor !== undefined && input.FontColor !== null && { fontColor: input.FontColor }), + ...(input.FontOpacity !== undefined && input.FontOpacity !== null && { fontOpacity: input.FontOpacity }), + ...(input.FontResolution !== undefined && + input.FontResolution !== null && { fontResolution: input.FontResolution }), + ...(input.FontSize !== undefined && input.FontSize !== null && { fontSize: input.FontSize }), + ...(input.OutlineColor !== undefined && input.OutlineColor !== null && { outlineColor: input.OutlineColor }), + ...(input.OutlineSize !== undefined && input.OutlineSize !== null && { outlineSize: input.OutlineSize }), + ...(input.ShadowColor !== undefined && input.ShadowColor !== null && { shadowColor: input.ShadowColor }), + ...(input.ShadowOpacity !== undefined && input.ShadowOpacity !== null && { shadowOpacity: input.ShadowOpacity }), + ...(input.ShadowXOffset !== undefined && input.ShadowXOffset !== null && { shadowXOffset: input.ShadowXOffset }), + ...(input.ShadowYOffset !== undefined && input.ShadowYOffset !== null && { shadowYOffset: input.ShadowYOffset }), + ...(input.TeletextGridControl !== undefined && + input.TeletextGridControl !== null && { teletextGridControl: input.TeletextGridControl }), + ...(input.XPosition !== undefined && input.XPosition !== null && { xPosition: input.XPosition }), + ...(input.YPosition !== undefined && input.YPosition !== null && { yPosition: input.YPosition }), }; }; const serializeAws_restJson1CaptionDescription = (input: CaptionDescription, context: __SerdeContext): any => { return { - ...(input.CaptionSelectorName !== undefined && { captionSelectorName: input.CaptionSelectorName }), - ...(input.DestinationSettings !== undefined && { - destinationSettings: serializeAws_restJson1CaptionDestinationSettings(input.DestinationSettings, context), - }), - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.LanguageDescription !== undefined && { languageDescription: input.LanguageDescription }), - ...(input.Name !== undefined && { name: input.Name }), + ...(input.CaptionSelectorName !== undefined && + input.CaptionSelectorName !== null && { captionSelectorName: input.CaptionSelectorName }), + ...(input.DestinationSettings !== undefined && + input.DestinationSettings !== null && { + destinationSettings: serializeAws_restJson1CaptionDestinationSettings(input.DestinationSettings, context), + }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.LanguageDescription !== undefined && + input.LanguageDescription !== null && { languageDescription: input.LanguageDescription }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), }; }; @@ -9399,96 +9602,112 @@ const serializeAws_restJson1CaptionDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.AribDestinationSettings !== undefined && { - aribDestinationSettings: serializeAws_restJson1AribDestinationSettings(input.AribDestinationSettings, context), - }), - ...(input.BurnInDestinationSettings !== undefined && { - burnInDestinationSettings: serializeAws_restJson1BurnInDestinationSettings( - input.BurnInDestinationSettings, - context - ), - }), - ...(input.DvbSubDestinationSettings !== undefined && { - dvbSubDestinationSettings: serializeAws_restJson1DvbSubDestinationSettings( - input.DvbSubDestinationSettings, - context - ), - }), - ...(input.EbuTtDDestinationSettings !== undefined && { - ebuTtDDestinationSettings: serializeAws_restJson1EbuTtDDestinationSettings( - input.EbuTtDDestinationSettings, - context - ), - }), - ...(input.EmbeddedDestinationSettings !== undefined && { - embeddedDestinationSettings: serializeAws_restJson1EmbeddedDestinationSettings( - input.EmbeddedDestinationSettings, - context - ), - }), - ...(input.EmbeddedPlusScte20DestinationSettings !== undefined && { - embeddedPlusScte20DestinationSettings: serializeAws_restJson1EmbeddedPlusScte20DestinationSettings( - input.EmbeddedPlusScte20DestinationSettings, - context - ), - }), - ...(input.RtmpCaptionInfoDestinationSettings !== undefined && { - rtmpCaptionInfoDestinationSettings: serializeAws_restJson1RtmpCaptionInfoDestinationSettings( - input.RtmpCaptionInfoDestinationSettings, - context - ), - }), - ...(input.Scte20PlusEmbeddedDestinationSettings !== undefined && { - scte20PlusEmbeddedDestinationSettings: serializeAws_restJson1Scte20PlusEmbeddedDestinationSettings( - input.Scte20PlusEmbeddedDestinationSettings, - context - ), - }), - ...(input.Scte27DestinationSettings !== undefined && { - scte27DestinationSettings: serializeAws_restJson1Scte27DestinationSettings( - input.Scte27DestinationSettings, - context - ), - }), - ...(input.SmpteTtDestinationSettings !== undefined && { - smpteTtDestinationSettings: serializeAws_restJson1SmpteTtDestinationSettings( - input.SmpteTtDestinationSettings, - context - ), - }), - ...(input.TeletextDestinationSettings !== undefined && { - teletextDestinationSettings: serializeAws_restJson1TeletextDestinationSettings( - input.TeletextDestinationSettings, - context - ), - }), - ...(input.TtmlDestinationSettings !== undefined && { - ttmlDestinationSettings: serializeAws_restJson1TtmlDestinationSettings(input.TtmlDestinationSettings, context), - }), - ...(input.WebvttDestinationSettings !== undefined && { - webvttDestinationSettings: serializeAws_restJson1WebvttDestinationSettings( - input.WebvttDestinationSettings, - context - ), - }), + ...(input.AribDestinationSettings !== undefined && + input.AribDestinationSettings !== null && { + aribDestinationSettings: serializeAws_restJson1AribDestinationSettings(input.AribDestinationSettings, context), + }), + ...(input.BurnInDestinationSettings !== undefined && + input.BurnInDestinationSettings !== null && { + burnInDestinationSettings: serializeAws_restJson1BurnInDestinationSettings( + input.BurnInDestinationSettings, + context + ), + }), + ...(input.DvbSubDestinationSettings !== undefined && + input.DvbSubDestinationSettings !== null && { + dvbSubDestinationSettings: serializeAws_restJson1DvbSubDestinationSettings( + input.DvbSubDestinationSettings, + context + ), + }), + ...(input.EbuTtDDestinationSettings !== undefined && + input.EbuTtDDestinationSettings !== null && { + ebuTtDDestinationSettings: serializeAws_restJson1EbuTtDDestinationSettings( + input.EbuTtDDestinationSettings, + context + ), + }), + ...(input.EmbeddedDestinationSettings !== undefined && + input.EmbeddedDestinationSettings !== null && { + embeddedDestinationSettings: serializeAws_restJson1EmbeddedDestinationSettings( + input.EmbeddedDestinationSettings, + context + ), + }), + ...(input.EmbeddedPlusScte20DestinationSettings !== undefined && + input.EmbeddedPlusScte20DestinationSettings !== null && { + embeddedPlusScte20DestinationSettings: serializeAws_restJson1EmbeddedPlusScte20DestinationSettings( + input.EmbeddedPlusScte20DestinationSettings, + context + ), + }), + ...(input.RtmpCaptionInfoDestinationSettings !== undefined && + input.RtmpCaptionInfoDestinationSettings !== null && { + rtmpCaptionInfoDestinationSettings: serializeAws_restJson1RtmpCaptionInfoDestinationSettings( + input.RtmpCaptionInfoDestinationSettings, + context + ), + }), + ...(input.Scte20PlusEmbeddedDestinationSettings !== undefined && + input.Scte20PlusEmbeddedDestinationSettings !== null && { + scte20PlusEmbeddedDestinationSettings: serializeAws_restJson1Scte20PlusEmbeddedDestinationSettings( + input.Scte20PlusEmbeddedDestinationSettings, + context + ), + }), + ...(input.Scte27DestinationSettings !== undefined && + input.Scte27DestinationSettings !== null && { + scte27DestinationSettings: serializeAws_restJson1Scte27DestinationSettings( + input.Scte27DestinationSettings, + context + ), + }), + ...(input.SmpteTtDestinationSettings !== undefined && + input.SmpteTtDestinationSettings !== null && { + smpteTtDestinationSettings: serializeAws_restJson1SmpteTtDestinationSettings( + input.SmpteTtDestinationSettings, + context + ), + }), + ...(input.TeletextDestinationSettings !== undefined && + input.TeletextDestinationSettings !== null && { + teletextDestinationSettings: serializeAws_restJson1TeletextDestinationSettings( + input.TeletextDestinationSettings, + context + ), + }), + ...(input.TtmlDestinationSettings !== undefined && + input.TtmlDestinationSettings !== null && { + ttmlDestinationSettings: serializeAws_restJson1TtmlDestinationSettings(input.TtmlDestinationSettings, context), + }), + ...(input.WebvttDestinationSettings !== undefined && + input.WebvttDestinationSettings !== null && { + webvttDestinationSettings: serializeAws_restJson1WebvttDestinationSettings( + input.WebvttDestinationSettings, + context + ), + }), }; }; const serializeAws_restJson1CaptionLanguageMapping = (input: CaptionLanguageMapping, context: __SerdeContext): any => { return { - ...(input.CaptionChannel !== undefined && { captionChannel: input.CaptionChannel }), - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.LanguageDescription !== undefined && { languageDescription: input.LanguageDescription }), + ...(input.CaptionChannel !== undefined && + input.CaptionChannel !== null && { captionChannel: input.CaptionChannel }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.LanguageDescription !== undefined && + input.LanguageDescription !== null && { languageDescription: input.LanguageDescription }), }; }; const serializeAws_restJson1CaptionSelector = (input: CaptionSelector, context: __SerdeContext): any => { return { - ...(input.LanguageCode !== undefined && { languageCode: input.LanguageCode }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.SelectorSettings !== undefined && { - selectorSettings: serializeAws_restJson1CaptionSelectorSettings(input.SelectorSettings, context), - }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { languageCode: input.LanguageCode }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.SelectorSettings !== undefined && + input.SelectorSettings !== null && { + selectorSettings: serializeAws_restJson1CaptionSelectorSettings(input.SelectorSettings, context), + }), }; }; @@ -9497,33 +9716,40 @@ const serializeAws_restJson1CaptionSelectorSettings = ( context: __SerdeContext ): any => { return { - ...(input.AncillarySourceSettings !== undefined && { - ancillarySourceSettings: serializeAws_restJson1AncillarySourceSettings(input.AncillarySourceSettings, context), - }), - ...(input.AribSourceSettings !== undefined && { - aribSourceSettings: serializeAws_restJson1AribSourceSettings(input.AribSourceSettings, context), - }), - ...(input.DvbSubSourceSettings !== undefined && { - dvbSubSourceSettings: serializeAws_restJson1DvbSubSourceSettings(input.DvbSubSourceSettings, context), - }), - ...(input.EmbeddedSourceSettings !== undefined && { - embeddedSourceSettings: serializeAws_restJson1EmbeddedSourceSettings(input.EmbeddedSourceSettings, context), - }), - ...(input.Scte20SourceSettings !== undefined && { - scte20SourceSettings: serializeAws_restJson1Scte20SourceSettings(input.Scte20SourceSettings, context), - }), - ...(input.Scte27SourceSettings !== undefined && { - scte27SourceSettings: serializeAws_restJson1Scte27SourceSettings(input.Scte27SourceSettings, context), - }), - ...(input.TeletextSourceSettings !== undefined && { - teletextSourceSettings: serializeAws_restJson1TeletextSourceSettings(input.TeletextSourceSettings, context), - }), + ...(input.AncillarySourceSettings !== undefined && + input.AncillarySourceSettings !== null && { + ancillarySourceSettings: serializeAws_restJson1AncillarySourceSettings(input.AncillarySourceSettings, context), + }), + ...(input.AribSourceSettings !== undefined && + input.AribSourceSettings !== null && { + aribSourceSettings: serializeAws_restJson1AribSourceSettings(input.AribSourceSettings, context), + }), + ...(input.DvbSubSourceSettings !== undefined && + input.DvbSubSourceSettings !== null && { + dvbSubSourceSettings: serializeAws_restJson1DvbSubSourceSettings(input.DvbSubSourceSettings, context), + }), + ...(input.EmbeddedSourceSettings !== undefined && + input.EmbeddedSourceSettings !== null && { + embeddedSourceSettings: serializeAws_restJson1EmbeddedSourceSettings(input.EmbeddedSourceSettings, context), + }), + ...(input.Scte20SourceSettings !== undefined && + input.Scte20SourceSettings !== null && { + scte20SourceSettings: serializeAws_restJson1Scte20SourceSettings(input.Scte20SourceSettings, context), + }), + ...(input.Scte27SourceSettings !== undefined && + input.Scte27SourceSettings !== null && { + scte27SourceSettings: serializeAws_restJson1Scte27SourceSettings(input.Scte27SourceSettings, context), + }), + ...(input.TeletextSourceSettings !== undefined && + input.TeletextSourceSettings !== null && { + teletextSourceSettings: serializeAws_restJson1TeletextSourceSettings(input.TeletextSourceSettings, context), + }), }; }; const serializeAws_restJson1CdiInputSpecification = (input: CdiInputSpecification, context: __SerdeContext): any => { return { - ...(input.Resolution !== undefined && { resolution: input.Resolution }), + ...(input.Resolution !== undefined && input.Resolution !== null && { resolution: input.Resolution }), }; }; @@ -9536,18 +9762,19 @@ const serializeAws_restJson1ColorSpacePassthroughSettings = ( const serializeAws_restJson1DvbNitSettings = (input: DvbNitSettings, context: __SerdeContext): any => { return { - ...(input.NetworkId !== undefined && { networkId: input.NetworkId }), - ...(input.NetworkName !== undefined && { networkName: input.NetworkName }), - ...(input.RepInterval !== undefined && { repInterval: input.RepInterval }), + ...(input.NetworkId !== undefined && input.NetworkId !== null && { networkId: input.NetworkId }), + ...(input.NetworkName !== undefined && input.NetworkName !== null && { networkName: input.NetworkName }), + ...(input.RepInterval !== undefined && input.RepInterval !== null && { repInterval: input.RepInterval }), }; }; const serializeAws_restJson1DvbSdtSettings = (input: DvbSdtSettings, context: __SerdeContext): any => { return { - ...(input.OutputSdt !== undefined && { outputSdt: input.OutputSdt }), - ...(input.RepInterval !== undefined && { repInterval: input.RepInterval }), - ...(input.ServiceName !== undefined && { serviceName: input.ServiceName }), - ...(input.ServiceProviderName !== undefined && { serviceProviderName: input.ServiceProviderName }), + ...(input.OutputSdt !== undefined && input.OutputSdt !== null && { outputSdt: input.OutputSdt }), + ...(input.RepInterval !== undefined && input.RepInterval !== null && { repInterval: input.RepInterval }), + ...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }), + ...(input.ServiceProviderName !== undefined && + input.ServiceProviderName !== null && { serviceProviderName: input.ServiceProviderName }), }; }; @@ -9556,60 +9783,73 @@ const serializeAws_restJson1DvbSubDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.Alignment !== undefined && { alignment: input.Alignment }), - ...(input.BackgroundColor !== undefined && { backgroundColor: input.BackgroundColor }), - ...(input.BackgroundOpacity !== undefined && { backgroundOpacity: input.BackgroundOpacity }), - ...(input.Font !== undefined && { font: serializeAws_restJson1InputLocation(input.Font, context) }), - ...(input.FontColor !== undefined && { fontColor: input.FontColor }), - ...(input.FontOpacity !== undefined && { fontOpacity: input.FontOpacity }), - ...(input.FontResolution !== undefined && { fontResolution: input.FontResolution }), - ...(input.FontSize !== undefined && { fontSize: input.FontSize }), - ...(input.OutlineColor !== undefined && { outlineColor: input.OutlineColor }), - ...(input.OutlineSize !== undefined && { outlineSize: input.OutlineSize }), - ...(input.ShadowColor !== undefined && { shadowColor: input.ShadowColor }), - ...(input.ShadowOpacity !== undefined && { shadowOpacity: input.ShadowOpacity }), - ...(input.ShadowXOffset !== undefined && { shadowXOffset: input.ShadowXOffset }), - ...(input.ShadowYOffset !== undefined && { shadowYOffset: input.ShadowYOffset }), - ...(input.TeletextGridControl !== undefined && { teletextGridControl: input.TeletextGridControl }), - ...(input.XPosition !== undefined && { xPosition: input.XPosition }), - ...(input.YPosition !== undefined && { yPosition: input.YPosition }), + ...(input.Alignment !== undefined && input.Alignment !== null && { alignment: input.Alignment }), + ...(input.BackgroundColor !== undefined && + input.BackgroundColor !== null && { backgroundColor: input.BackgroundColor }), + ...(input.BackgroundOpacity !== undefined && + input.BackgroundOpacity !== null && { backgroundOpacity: input.BackgroundOpacity }), + ...(input.Font !== undefined && + input.Font !== null && { font: serializeAws_restJson1InputLocation(input.Font, context) }), + ...(input.FontColor !== undefined && input.FontColor !== null && { fontColor: input.FontColor }), + ...(input.FontOpacity !== undefined && input.FontOpacity !== null && { fontOpacity: input.FontOpacity }), + ...(input.FontResolution !== undefined && + input.FontResolution !== null && { fontResolution: input.FontResolution }), + ...(input.FontSize !== undefined && input.FontSize !== null && { fontSize: input.FontSize }), + ...(input.OutlineColor !== undefined && input.OutlineColor !== null && { outlineColor: input.OutlineColor }), + ...(input.OutlineSize !== undefined && input.OutlineSize !== null && { outlineSize: input.OutlineSize }), + ...(input.ShadowColor !== undefined && input.ShadowColor !== null && { shadowColor: input.ShadowColor }), + ...(input.ShadowOpacity !== undefined && input.ShadowOpacity !== null && { shadowOpacity: input.ShadowOpacity }), + ...(input.ShadowXOffset !== undefined && input.ShadowXOffset !== null && { shadowXOffset: input.ShadowXOffset }), + ...(input.ShadowYOffset !== undefined && input.ShadowYOffset !== null && { shadowYOffset: input.ShadowYOffset }), + ...(input.TeletextGridControl !== undefined && + input.TeletextGridControl !== null && { teletextGridControl: input.TeletextGridControl }), + ...(input.XPosition !== undefined && input.XPosition !== null && { xPosition: input.XPosition }), + ...(input.YPosition !== undefined && input.YPosition !== null && { yPosition: input.YPosition }), }; }; const serializeAws_restJson1DvbSubSourceSettings = (input: DvbSubSourceSettings, context: __SerdeContext): any => { return { - ...(input.Pid !== undefined && { pid: input.Pid }), + ...(input.Pid !== undefined && input.Pid !== null && { pid: input.Pid }), }; }; const serializeAws_restJson1DvbTdtSettings = (input: DvbTdtSettings, context: __SerdeContext): any => { return { - ...(input.RepInterval !== undefined && { repInterval: input.RepInterval }), + ...(input.RepInterval !== undefined && input.RepInterval !== null && { repInterval: input.RepInterval }), }; }; const serializeAws_restJson1Eac3Settings = (input: Eac3Settings, context: __SerdeContext): any => { return { - ...(input.AttenuationControl !== undefined && { attenuationControl: input.AttenuationControl }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.BitstreamMode !== undefined && { bitstreamMode: input.BitstreamMode }), - ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), - ...(input.DcFilter !== undefined && { dcFilter: input.DcFilter }), - ...(input.Dialnorm !== undefined && { dialnorm: input.Dialnorm }), - ...(input.DrcLine !== undefined && { drcLine: input.DrcLine }), - ...(input.DrcRf !== undefined && { drcRf: input.DrcRf }), - ...(input.LfeControl !== undefined && { lfeControl: input.LfeControl }), - ...(input.LfeFilter !== undefined && { lfeFilter: input.LfeFilter }), - ...(input.LoRoCenterMixLevel !== undefined && { loRoCenterMixLevel: input.LoRoCenterMixLevel }), - ...(input.LoRoSurroundMixLevel !== undefined && { loRoSurroundMixLevel: input.LoRoSurroundMixLevel }), - ...(input.LtRtCenterMixLevel !== undefined && { ltRtCenterMixLevel: input.LtRtCenterMixLevel }), - ...(input.LtRtSurroundMixLevel !== undefined && { ltRtSurroundMixLevel: input.LtRtSurroundMixLevel }), - ...(input.MetadataControl !== undefined && { metadataControl: input.MetadataControl }), - ...(input.PassthroughControl !== undefined && { passthroughControl: input.PassthroughControl }), - ...(input.PhaseControl !== undefined && { phaseControl: input.PhaseControl }), - ...(input.StereoDownmix !== undefined && { stereoDownmix: input.StereoDownmix }), - ...(input.SurroundExMode !== undefined && { surroundExMode: input.SurroundExMode }), - ...(input.SurroundMode !== undefined && { surroundMode: input.SurroundMode }), + ...(input.AttenuationControl !== undefined && + input.AttenuationControl !== null && { attenuationControl: input.AttenuationControl }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.BitstreamMode !== undefined && input.BitstreamMode !== null && { bitstreamMode: input.BitstreamMode }), + ...(input.CodingMode !== undefined && input.CodingMode !== null && { codingMode: input.CodingMode }), + ...(input.DcFilter !== undefined && input.DcFilter !== null && { dcFilter: input.DcFilter }), + ...(input.Dialnorm !== undefined && input.Dialnorm !== null && { dialnorm: input.Dialnorm }), + ...(input.DrcLine !== undefined && input.DrcLine !== null && { drcLine: input.DrcLine }), + ...(input.DrcRf !== undefined && input.DrcRf !== null && { drcRf: input.DrcRf }), + ...(input.LfeControl !== undefined && input.LfeControl !== null && { lfeControl: input.LfeControl }), + ...(input.LfeFilter !== undefined && input.LfeFilter !== null && { lfeFilter: input.LfeFilter }), + ...(input.LoRoCenterMixLevel !== undefined && + input.LoRoCenterMixLevel !== null && { loRoCenterMixLevel: input.LoRoCenterMixLevel }), + ...(input.LoRoSurroundMixLevel !== undefined && + input.LoRoSurroundMixLevel !== null && { loRoSurroundMixLevel: input.LoRoSurroundMixLevel }), + ...(input.LtRtCenterMixLevel !== undefined && + input.LtRtCenterMixLevel !== null && { ltRtCenterMixLevel: input.LtRtCenterMixLevel }), + ...(input.LtRtSurroundMixLevel !== undefined && + input.LtRtSurroundMixLevel !== null && { ltRtSurroundMixLevel: input.LtRtSurroundMixLevel }), + ...(input.MetadataControl !== undefined && + input.MetadataControl !== null && { metadataControl: input.MetadataControl }), + ...(input.PassthroughControl !== undefined && + input.PassthroughControl !== null && { passthroughControl: input.PassthroughControl }), + ...(input.PhaseControl !== undefined && input.PhaseControl !== null && { phaseControl: input.PhaseControl }), + ...(input.StereoDownmix !== undefined && input.StereoDownmix !== null && { stereoDownmix: input.StereoDownmix }), + ...(input.SurroundExMode !== undefined && + input.SurroundExMode !== null && { surroundExMode: input.SurroundExMode }), + ...(input.SurroundMode !== undefined && input.SurroundMode !== null && { surroundMode: input.SurroundMode }), }; }; @@ -9618,9 +9858,9 @@ const serializeAws_restJson1EbuTtDDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.FillLineGap !== undefined && { fillLineGap: input.FillLineGap }), - ...(input.FontFamily !== undefined && { fontFamily: input.FontFamily }), - ...(input.StyleControl !== undefined && { styleControl: input.StyleControl }), + ...(input.FillLineGap !== undefined && input.FillLineGap !== null && { fillLineGap: input.FillLineGap }), + ...(input.FontFamily !== undefined && input.FontFamily !== null && { fontFamily: input.FontFamily }), + ...(input.StyleControl !== undefined && input.StyleControl !== null && { styleControl: input.StyleControl }), }; }; @@ -9640,59 +9880,75 @@ const serializeAws_restJson1EmbeddedPlusScte20DestinationSettings = ( const serializeAws_restJson1EmbeddedSourceSettings = (input: EmbeddedSourceSettings, context: __SerdeContext): any => { return { - ...(input.Convert608To708 !== undefined && { convert608To708: input.Convert608To708 }), - ...(input.Scte20Detection !== undefined && { scte20Detection: input.Scte20Detection }), - ...(input.Source608ChannelNumber !== undefined && { source608ChannelNumber: input.Source608ChannelNumber }), - ...(input.Source608TrackNumber !== undefined && { source608TrackNumber: input.Source608TrackNumber }), + ...(input.Convert608To708 !== undefined && + input.Convert608To708 !== null && { convert608To708: input.Convert608To708 }), + ...(input.Scte20Detection !== undefined && + input.Scte20Detection !== null && { scte20Detection: input.Scte20Detection }), + ...(input.Source608ChannelNumber !== undefined && + input.Source608ChannelNumber !== null && { source608ChannelNumber: input.Source608ChannelNumber }), + ...(input.Source608TrackNumber !== undefined && + input.Source608TrackNumber !== null && { source608TrackNumber: input.Source608TrackNumber }), }; }; const serializeAws_restJson1EncoderSettings = (input: EncoderSettings, context: __SerdeContext): any => { return { - ...(input.AudioDescriptions !== undefined && { - audioDescriptions: serializeAws_restJson1__listOfAudioDescription(input.AudioDescriptions, context), - }), - ...(input.AvailBlanking !== undefined && { - availBlanking: serializeAws_restJson1AvailBlanking(input.AvailBlanking, context), - }), - ...(input.AvailConfiguration !== undefined && { - availConfiguration: serializeAws_restJson1AvailConfiguration(input.AvailConfiguration, context), - }), - ...(input.BlackoutSlate !== undefined && { - blackoutSlate: serializeAws_restJson1BlackoutSlate(input.BlackoutSlate, context), - }), - ...(input.CaptionDescriptions !== undefined && { - captionDescriptions: serializeAws_restJson1__listOfCaptionDescription(input.CaptionDescriptions, context), - }), - ...(input.FeatureActivations !== undefined && { - featureActivations: serializeAws_restJson1FeatureActivations(input.FeatureActivations, context), - }), - ...(input.GlobalConfiguration !== undefined && { - globalConfiguration: serializeAws_restJson1GlobalConfiguration(input.GlobalConfiguration, context), - }), - ...(input.NielsenConfiguration !== undefined && { - nielsenConfiguration: serializeAws_restJson1NielsenConfiguration(input.NielsenConfiguration, context), - }), - ...(input.OutputGroups !== undefined && { - outputGroups: serializeAws_restJson1__listOfOutputGroup(input.OutputGroups, context), - }), - ...(input.TimecodeConfig !== undefined && { - timecodeConfig: serializeAws_restJson1TimecodeConfig(input.TimecodeConfig, context), - }), - ...(input.VideoDescriptions !== undefined && { - videoDescriptions: serializeAws_restJson1__listOfVideoDescription(input.VideoDescriptions, context), - }), + ...(input.AudioDescriptions !== undefined && + input.AudioDescriptions !== null && { + audioDescriptions: serializeAws_restJson1__listOfAudioDescription(input.AudioDescriptions, context), + }), + ...(input.AvailBlanking !== undefined && + input.AvailBlanking !== null && { + availBlanking: serializeAws_restJson1AvailBlanking(input.AvailBlanking, context), + }), + ...(input.AvailConfiguration !== undefined && + input.AvailConfiguration !== null && { + availConfiguration: serializeAws_restJson1AvailConfiguration(input.AvailConfiguration, context), + }), + ...(input.BlackoutSlate !== undefined && + input.BlackoutSlate !== null && { + blackoutSlate: serializeAws_restJson1BlackoutSlate(input.BlackoutSlate, context), + }), + ...(input.CaptionDescriptions !== undefined && + input.CaptionDescriptions !== null && { + captionDescriptions: serializeAws_restJson1__listOfCaptionDescription(input.CaptionDescriptions, context), + }), + ...(input.FeatureActivations !== undefined && + input.FeatureActivations !== null && { + featureActivations: serializeAws_restJson1FeatureActivations(input.FeatureActivations, context), + }), + ...(input.GlobalConfiguration !== undefined && + input.GlobalConfiguration !== null && { + globalConfiguration: serializeAws_restJson1GlobalConfiguration(input.GlobalConfiguration, context), + }), + ...(input.NielsenConfiguration !== undefined && + input.NielsenConfiguration !== null && { + nielsenConfiguration: serializeAws_restJson1NielsenConfiguration(input.NielsenConfiguration, context), + }), + ...(input.OutputGroups !== undefined && + input.OutputGroups !== null && { + outputGroups: serializeAws_restJson1__listOfOutputGroup(input.OutputGroups, context), + }), + ...(input.TimecodeConfig !== undefined && + input.TimecodeConfig !== null && { + timecodeConfig: serializeAws_restJson1TimecodeConfig(input.TimecodeConfig, context), + }), + ...(input.VideoDescriptions !== undefined && + input.VideoDescriptions !== null && { + videoDescriptions: serializeAws_restJson1__listOfVideoDescription(input.VideoDescriptions, context), + }), }; }; const serializeAws_restJson1FailoverCondition = (input: FailoverCondition, context: __SerdeContext): any => { return { - ...(input.FailoverConditionSettings !== undefined && { - failoverConditionSettings: serializeAws_restJson1FailoverConditionSettings( - input.FailoverConditionSettings, - context - ), - }), + ...(input.FailoverConditionSettings !== undefined && + input.FailoverConditionSettings !== null && { + failoverConditionSettings: serializeAws_restJson1FailoverConditionSettings( + input.FailoverConditionSettings, + context + ), + }), }; }; @@ -9701,31 +9957,33 @@ const serializeAws_restJson1FailoverConditionSettings = ( context: __SerdeContext ): any => { return { - ...(input.AudioSilenceSettings !== undefined && { - audioSilenceSettings: serializeAws_restJson1AudioSilenceFailoverSettings(input.AudioSilenceSettings, context), - }), - ...(input.InputLossSettings !== undefined && { - inputLossSettings: serializeAws_restJson1InputLossFailoverSettings(input.InputLossSettings, context), - }), - ...(input.VideoBlackSettings !== undefined && { - videoBlackSettings: serializeAws_restJson1VideoBlackFailoverSettings(input.VideoBlackSettings, context), - }), + ...(input.AudioSilenceSettings !== undefined && + input.AudioSilenceSettings !== null && { + audioSilenceSettings: serializeAws_restJson1AudioSilenceFailoverSettings(input.AudioSilenceSettings, context), + }), + ...(input.InputLossSettings !== undefined && + input.InputLossSettings !== null && { + inputLossSettings: serializeAws_restJson1InputLossFailoverSettings(input.InputLossSettings, context), + }), + ...(input.VideoBlackSettings !== undefined && + input.VideoBlackSettings !== null && { + videoBlackSettings: serializeAws_restJson1VideoBlackFailoverSettings(input.VideoBlackSettings, context), + }), }; }; const serializeAws_restJson1FeatureActivations = (input: FeatureActivations, context: __SerdeContext): any => { return { - ...(input.InputPrepareScheduleActions !== undefined && { - inputPrepareScheduleActions: input.InputPrepareScheduleActions, - }), + ...(input.InputPrepareScheduleActions !== undefined && + input.InputPrepareScheduleActions !== null && { inputPrepareScheduleActions: input.InputPrepareScheduleActions }), }; }; const serializeAws_restJson1FecOutputSettings = (input: FecOutputSettings, context: __SerdeContext): any => { return { - ...(input.ColumnDepth !== undefined && { columnDepth: input.ColumnDepth }), - ...(input.IncludeFec !== undefined && { includeFec: input.IncludeFec }), - ...(input.RowLength !== undefined && { rowLength: input.RowLength }), + ...(input.ColumnDepth !== undefined && input.ColumnDepth !== null && { columnDepth: input.ColumnDepth }), + ...(input.IncludeFec !== undefined && input.IncludeFec !== null && { includeFec: input.IncludeFec }), + ...(input.RowLength !== undefined && input.RowLength !== null && { rowLength: input.RowLength }), }; }; @@ -9734,15 +9992,18 @@ const serializeAws_restJson1FixedModeScheduleActionStartSettings = ( context: __SerdeContext ): any => { return { - ...(input.Time !== undefined && { time: input.Time }), + ...(input.Time !== undefined && input.Time !== null && { time: input.Time }), }; }; const serializeAws_restJson1Fmp4HlsSettings = (input: Fmp4HlsSettings, context: __SerdeContext): any => { return { - ...(input.AudioRenditionSets !== undefined && { audioRenditionSets: input.AudioRenditionSets }), - ...(input.NielsenId3Behavior !== undefined && { nielsenId3Behavior: input.NielsenId3Behavior }), - ...(input.TimedMetadataBehavior !== undefined && { timedMetadataBehavior: input.TimedMetadataBehavior }), + ...(input.AudioRenditionSets !== undefined && + input.AudioRenditionSets !== null && { audioRenditionSets: input.AudioRenditionSets }), + ...(input.NielsenId3Behavior !== undefined && + input.NielsenId3Behavior !== null && { nielsenId3Behavior: input.NielsenId3Behavior }), + ...(input.TimedMetadataBehavior !== undefined && + input.TimedMetadataBehavior !== null && { timedMetadataBehavior: input.TimedMetadataBehavior }), }; }; @@ -9751,8 +10012,9 @@ const serializeAws_restJson1FollowModeScheduleActionStartSettings = ( context: __SerdeContext ): any => { return { - ...(input.FollowPoint !== undefined && { followPoint: input.FollowPoint }), - ...(input.ReferenceActionName !== undefined && { referenceActionName: input.ReferenceActionName }), + ...(input.FollowPoint !== undefined && input.FollowPoint !== null && { followPoint: input.FollowPoint }), + ...(input.ReferenceActionName !== undefined && + input.ReferenceActionName !== null && { referenceActionName: input.ReferenceActionName }), }; }; @@ -9761,9 +10023,10 @@ const serializeAws_restJson1FrameCaptureGroupSettings = ( context: __SerdeContext ): any => { return { - ...(input.Destination !== undefined && { - destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), - }), + ...(input.Destination !== undefined && + input.Destination !== null && { + destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), + }), }; }; @@ -9772,281 +10035,358 @@ const serializeAws_restJson1FrameCaptureOutputSettings = ( context: __SerdeContext ): any => { return { - ...(input.NameModifier !== undefined && { nameModifier: input.NameModifier }), + ...(input.NameModifier !== undefined && input.NameModifier !== null && { nameModifier: input.NameModifier }), }; }; const serializeAws_restJson1FrameCaptureSettings = (input: FrameCaptureSettings, context: __SerdeContext): any => { return { - ...(input.CaptureInterval !== undefined && { captureInterval: input.CaptureInterval }), - ...(input.CaptureIntervalUnits !== undefined && { captureIntervalUnits: input.CaptureIntervalUnits }), + ...(input.CaptureInterval !== undefined && + input.CaptureInterval !== null && { captureInterval: input.CaptureInterval }), + ...(input.CaptureIntervalUnits !== undefined && + input.CaptureIntervalUnits !== null && { captureIntervalUnits: input.CaptureIntervalUnits }), }; }; const serializeAws_restJson1GlobalConfiguration = (input: GlobalConfiguration, context: __SerdeContext): any => { return { - ...(input.InitialAudioGain !== undefined && { initialAudioGain: input.InitialAudioGain }), - ...(input.InputEndAction !== undefined && { inputEndAction: input.InputEndAction }), - ...(input.InputLossBehavior !== undefined && { - inputLossBehavior: serializeAws_restJson1InputLossBehavior(input.InputLossBehavior, context), - }), - ...(input.OutputLockingMode !== undefined && { outputLockingMode: input.OutputLockingMode }), - ...(input.OutputTimingSource !== undefined && { outputTimingSource: input.OutputTimingSource }), - ...(input.SupportLowFramerateInputs !== undefined && { - supportLowFramerateInputs: input.SupportLowFramerateInputs, - }), + ...(input.InitialAudioGain !== undefined && + input.InitialAudioGain !== null && { initialAudioGain: input.InitialAudioGain }), + ...(input.InputEndAction !== undefined && + input.InputEndAction !== null && { inputEndAction: input.InputEndAction }), + ...(input.InputLossBehavior !== undefined && + input.InputLossBehavior !== null && { + inputLossBehavior: serializeAws_restJson1InputLossBehavior(input.InputLossBehavior, context), + }), + ...(input.OutputLockingMode !== undefined && + input.OutputLockingMode !== null && { outputLockingMode: input.OutputLockingMode }), + ...(input.OutputTimingSource !== undefined && + input.OutputTimingSource !== null && { outputTimingSource: input.OutputTimingSource }), + ...(input.SupportLowFramerateInputs !== undefined && + input.SupportLowFramerateInputs !== null && { supportLowFramerateInputs: input.SupportLowFramerateInputs }), }; }; const serializeAws_restJson1H264ColorSpaceSettings = (input: H264ColorSpaceSettings, context: __SerdeContext): any => { return { - ...(input.ColorSpacePassthroughSettings !== undefined && { - colorSpacePassthroughSettings: serializeAws_restJson1ColorSpacePassthroughSettings( - input.ColorSpacePassthroughSettings, - context - ), - }), - ...(input.Rec601Settings !== undefined && { - rec601Settings: serializeAws_restJson1Rec601Settings(input.Rec601Settings, context), - }), - ...(input.Rec709Settings !== undefined && { - rec709Settings: serializeAws_restJson1Rec709Settings(input.Rec709Settings, context), - }), + ...(input.ColorSpacePassthroughSettings !== undefined && + input.ColorSpacePassthroughSettings !== null && { + colorSpacePassthroughSettings: serializeAws_restJson1ColorSpacePassthroughSettings( + input.ColorSpacePassthroughSettings, + context + ), + }), + ...(input.Rec601Settings !== undefined && + input.Rec601Settings !== null && { + rec601Settings: serializeAws_restJson1Rec601Settings(input.Rec601Settings, context), + }), + ...(input.Rec709Settings !== undefined && + input.Rec709Settings !== null && { + rec709Settings: serializeAws_restJson1Rec709Settings(input.Rec709Settings, context), + }), }; }; const serializeAws_restJson1H264FilterSettings = (input: H264FilterSettings, context: __SerdeContext): any => { return { - ...(input.TemporalFilterSettings !== undefined && { - temporalFilterSettings: serializeAws_restJson1TemporalFilterSettings(input.TemporalFilterSettings, context), - }), + ...(input.TemporalFilterSettings !== undefined && + input.TemporalFilterSettings !== null && { + temporalFilterSettings: serializeAws_restJson1TemporalFilterSettings(input.TemporalFilterSettings, context), + }), }; }; const serializeAws_restJson1H264Settings = (input: H264Settings, context: __SerdeContext): any => { return { - ...(input.AdaptiveQuantization !== undefined && { adaptiveQuantization: input.AdaptiveQuantization }), - ...(input.AfdSignaling !== undefined && { afdSignaling: input.AfdSignaling }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.BufFillPct !== undefined && { bufFillPct: input.BufFillPct }), - ...(input.BufSize !== undefined && { bufSize: input.BufSize }), - ...(input.ColorMetadata !== undefined && { colorMetadata: input.ColorMetadata }), - ...(input.ColorSpaceSettings !== undefined && { - colorSpaceSettings: serializeAws_restJson1H264ColorSpaceSettings(input.ColorSpaceSettings, context), - }), - ...(input.EntropyEncoding !== undefined && { entropyEncoding: input.EntropyEncoding }), - ...(input.FilterSettings !== undefined && { - filterSettings: serializeAws_restJson1H264FilterSettings(input.FilterSettings, context), - }), - ...(input.FixedAfd !== undefined && { fixedAfd: input.FixedAfd }), - ...(input.FlickerAq !== undefined && { flickerAq: input.FlickerAq }), - ...(input.ForceFieldPictures !== undefined && { forceFieldPictures: input.ForceFieldPictures }), - ...(input.FramerateControl !== undefined && { framerateControl: input.FramerateControl }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.GopBReference !== undefined && { gopBReference: input.GopBReference }), - ...(input.GopClosedCadence !== undefined && { gopClosedCadence: input.GopClosedCadence }), - ...(input.GopNumBFrames !== undefined && { gopNumBFrames: input.GopNumBFrames }), - ...(input.GopSize !== undefined && { gopSize: input.GopSize }), - ...(input.GopSizeUnits !== undefined && { gopSizeUnits: input.GopSizeUnits }), - ...(input.Level !== undefined && { level: input.Level }), - ...(input.LookAheadRateControl !== undefined && { lookAheadRateControl: input.LookAheadRateControl }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.MinIInterval !== undefined && { minIInterval: input.MinIInterval }), - ...(input.NumRefFrames !== undefined && { numRefFrames: input.NumRefFrames }), - ...(input.ParControl !== undefined && { parControl: input.ParControl }), - ...(input.ParDenominator !== undefined && { parDenominator: input.ParDenominator }), - ...(input.ParNumerator !== undefined && { parNumerator: input.ParNumerator }), - ...(input.Profile !== undefined && { profile: input.Profile }), - ...(input.QualityLevel !== undefined && { qualityLevel: input.QualityLevel }), - ...(input.QvbrQualityLevel !== undefined && { qvbrQualityLevel: input.QvbrQualityLevel }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), - ...(input.ScanType !== undefined && { scanType: input.ScanType }), - ...(input.SceneChangeDetect !== undefined && { sceneChangeDetect: input.SceneChangeDetect }), - ...(input.Slices !== undefined && { slices: input.Slices }), - ...(input.Softness !== undefined && { softness: input.Softness }), - ...(input.SpatialAq !== undefined && { spatialAq: input.SpatialAq }), - ...(input.SubgopLength !== undefined && { subgopLength: input.SubgopLength }), - ...(input.Syntax !== undefined && { syntax: input.Syntax }), - ...(input.TemporalAq !== undefined && { temporalAq: input.TemporalAq }), - ...(input.TimecodeInsertion !== undefined && { timecodeInsertion: input.TimecodeInsertion }), + ...(input.AdaptiveQuantization !== undefined && + input.AdaptiveQuantization !== null && { adaptiveQuantization: input.AdaptiveQuantization }), + ...(input.AfdSignaling !== undefined && input.AfdSignaling !== null && { afdSignaling: input.AfdSignaling }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.BufFillPct !== undefined && input.BufFillPct !== null && { bufFillPct: input.BufFillPct }), + ...(input.BufSize !== undefined && input.BufSize !== null && { bufSize: input.BufSize }), + ...(input.ColorMetadata !== undefined && input.ColorMetadata !== null && { colorMetadata: input.ColorMetadata }), + ...(input.ColorSpaceSettings !== undefined && + input.ColorSpaceSettings !== null && { + colorSpaceSettings: serializeAws_restJson1H264ColorSpaceSettings(input.ColorSpaceSettings, context), + }), + ...(input.EntropyEncoding !== undefined && + input.EntropyEncoding !== null && { entropyEncoding: input.EntropyEncoding }), + ...(input.FilterSettings !== undefined && + input.FilterSettings !== null && { + filterSettings: serializeAws_restJson1H264FilterSettings(input.FilterSettings, context), + }), + ...(input.FixedAfd !== undefined && input.FixedAfd !== null && { fixedAfd: input.FixedAfd }), + ...(input.FlickerAq !== undefined && input.FlickerAq !== null && { flickerAq: input.FlickerAq }), + ...(input.ForceFieldPictures !== undefined && + input.ForceFieldPictures !== null && { forceFieldPictures: input.ForceFieldPictures }), + ...(input.FramerateControl !== undefined && + input.FramerateControl !== null && { framerateControl: input.FramerateControl }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.GopBReference !== undefined && input.GopBReference !== null && { gopBReference: input.GopBReference }), + ...(input.GopClosedCadence !== undefined && + input.GopClosedCadence !== null && { gopClosedCadence: input.GopClosedCadence }), + ...(input.GopNumBFrames !== undefined && input.GopNumBFrames !== null && { gopNumBFrames: input.GopNumBFrames }), + ...(input.GopSize !== undefined && input.GopSize !== null && { gopSize: input.GopSize }), + ...(input.GopSizeUnits !== undefined && input.GopSizeUnits !== null && { gopSizeUnits: input.GopSizeUnits }), + ...(input.Level !== undefined && input.Level !== null && { level: input.Level }), + ...(input.LookAheadRateControl !== undefined && + input.LookAheadRateControl !== null && { lookAheadRateControl: input.LookAheadRateControl }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.MinIInterval !== undefined && input.MinIInterval !== null && { minIInterval: input.MinIInterval }), + ...(input.NumRefFrames !== undefined && input.NumRefFrames !== null && { numRefFrames: input.NumRefFrames }), + ...(input.ParControl !== undefined && input.ParControl !== null && { parControl: input.ParControl }), + ...(input.ParDenominator !== undefined && + input.ParDenominator !== null && { parDenominator: input.ParDenominator }), + ...(input.ParNumerator !== undefined && input.ParNumerator !== null && { parNumerator: input.ParNumerator }), + ...(input.Profile !== undefined && input.Profile !== null && { profile: input.Profile }), + ...(input.QualityLevel !== undefined && input.QualityLevel !== null && { qualityLevel: input.QualityLevel }), + ...(input.QvbrQualityLevel !== undefined && + input.QvbrQualityLevel !== null && { qvbrQualityLevel: input.QvbrQualityLevel }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), + ...(input.ScanType !== undefined && input.ScanType !== null && { scanType: input.ScanType }), + ...(input.SceneChangeDetect !== undefined && + input.SceneChangeDetect !== null && { sceneChangeDetect: input.SceneChangeDetect }), + ...(input.Slices !== undefined && input.Slices !== null && { slices: input.Slices }), + ...(input.Softness !== undefined && input.Softness !== null && { softness: input.Softness }), + ...(input.SpatialAq !== undefined && input.SpatialAq !== null && { spatialAq: input.SpatialAq }), + ...(input.SubgopLength !== undefined && input.SubgopLength !== null && { subgopLength: input.SubgopLength }), + ...(input.Syntax !== undefined && input.Syntax !== null && { syntax: input.Syntax }), + ...(input.TemporalAq !== undefined && input.TemporalAq !== null && { temporalAq: input.TemporalAq }), + ...(input.TimecodeInsertion !== undefined && + input.TimecodeInsertion !== null && { timecodeInsertion: input.TimecodeInsertion }), }; }; const serializeAws_restJson1H265ColorSpaceSettings = (input: H265ColorSpaceSettings, context: __SerdeContext): any => { return { - ...(input.ColorSpacePassthroughSettings !== undefined && { - colorSpacePassthroughSettings: serializeAws_restJson1ColorSpacePassthroughSettings( - input.ColorSpacePassthroughSettings, - context - ), - }), - ...(input.Hdr10Settings !== undefined && { - hdr10Settings: serializeAws_restJson1Hdr10Settings(input.Hdr10Settings, context), - }), - ...(input.Rec601Settings !== undefined && { - rec601Settings: serializeAws_restJson1Rec601Settings(input.Rec601Settings, context), - }), - ...(input.Rec709Settings !== undefined && { - rec709Settings: serializeAws_restJson1Rec709Settings(input.Rec709Settings, context), - }), + ...(input.ColorSpacePassthroughSettings !== undefined && + input.ColorSpacePassthroughSettings !== null && { + colorSpacePassthroughSettings: serializeAws_restJson1ColorSpacePassthroughSettings( + input.ColorSpacePassthroughSettings, + context + ), + }), + ...(input.Hdr10Settings !== undefined && + input.Hdr10Settings !== null && { + hdr10Settings: serializeAws_restJson1Hdr10Settings(input.Hdr10Settings, context), + }), + ...(input.Rec601Settings !== undefined && + input.Rec601Settings !== null && { + rec601Settings: serializeAws_restJson1Rec601Settings(input.Rec601Settings, context), + }), + ...(input.Rec709Settings !== undefined && + input.Rec709Settings !== null && { + rec709Settings: serializeAws_restJson1Rec709Settings(input.Rec709Settings, context), + }), }; }; const serializeAws_restJson1H265FilterSettings = (input: H265FilterSettings, context: __SerdeContext): any => { return { - ...(input.TemporalFilterSettings !== undefined && { - temporalFilterSettings: serializeAws_restJson1TemporalFilterSettings(input.TemporalFilterSettings, context), - }), + ...(input.TemporalFilterSettings !== undefined && + input.TemporalFilterSettings !== null && { + temporalFilterSettings: serializeAws_restJson1TemporalFilterSettings(input.TemporalFilterSettings, context), + }), }; }; const serializeAws_restJson1H265Settings = (input: H265Settings, context: __SerdeContext): any => { return { - ...(input.AdaptiveQuantization !== undefined && { adaptiveQuantization: input.AdaptiveQuantization }), - ...(input.AfdSignaling !== undefined && { afdSignaling: input.AfdSignaling }), - ...(input.AlternativeTransferFunction !== undefined && { - alternativeTransferFunction: input.AlternativeTransferFunction, - }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.BufSize !== undefined && { bufSize: input.BufSize }), - ...(input.ColorMetadata !== undefined && { colorMetadata: input.ColorMetadata }), - ...(input.ColorSpaceSettings !== undefined && { - colorSpaceSettings: serializeAws_restJson1H265ColorSpaceSettings(input.ColorSpaceSettings, context), - }), - ...(input.FilterSettings !== undefined && { - filterSettings: serializeAws_restJson1H265FilterSettings(input.FilterSettings, context), - }), - ...(input.FixedAfd !== undefined && { fixedAfd: input.FixedAfd }), - ...(input.FlickerAq !== undefined && { flickerAq: input.FlickerAq }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.GopClosedCadence !== undefined && { gopClosedCadence: input.GopClosedCadence }), - ...(input.GopSize !== undefined && { gopSize: input.GopSize }), - ...(input.GopSizeUnits !== undefined && { gopSizeUnits: input.GopSizeUnits }), - ...(input.Level !== undefined && { level: input.Level }), - ...(input.LookAheadRateControl !== undefined && { lookAheadRateControl: input.LookAheadRateControl }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), - ...(input.MinIInterval !== undefined && { minIInterval: input.MinIInterval }), - ...(input.ParDenominator !== undefined && { parDenominator: input.ParDenominator }), - ...(input.ParNumerator !== undefined && { parNumerator: input.ParNumerator }), - ...(input.Profile !== undefined && { profile: input.Profile }), - ...(input.QvbrQualityLevel !== undefined && { qvbrQualityLevel: input.QvbrQualityLevel }), - ...(input.RateControlMode !== undefined && { rateControlMode: input.RateControlMode }), - ...(input.ScanType !== undefined && { scanType: input.ScanType }), - ...(input.SceneChangeDetect !== undefined && { sceneChangeDetect: input.SceneChangeDetect }), - ...(input.Slices !== undefined && { slices: input.Slices }), - ...(input.Tier !== undefined && { tier: input.Tier }), - ...(input.TimecodeInsertion !== undefined && { timecodeInsertion: input.TimecodeInsertion }), + ...(input.AdaptiveQuantization !== undefined && + input.AdaptiveQuantization !== null && { adaptiveQuantization: input.AdaptiveQuantization }), + ...(input.AfdSignaling !== undefined && input.AfdSignaling !== null && { afdSignaling: input.AfdSignaling }), + ...(input.AlternativeTransferFunction !== undefined && + input.AlternativeTransferFunction !== null && { alternativeTransferFunction: input.AlternativeTransferFunction }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.BufSize !== undefined && input.BufSize !== null && { bufSize: input.BufSize }), + ...(input.ColorMetadata !== undefined && input.ColorMetadata !== null && { colorMetadata: input.ColorMetadata }), + ...(input.ColorSpaceSettings !== undefined && + input.ColorSpaceSettings !== null && { + colorSpaceSettings: serializeAws_restJson1H265ColorSpaceSettings(input.ColorSpaceSettings, context), + }), + ...(input.FilterSettings !== undefined && + input.FilterSettings !== null && { + filterSettings: serializeAws_restJson1H265FilterSettings(input.FilterSettings, context), + }), + ...(input.FixedAfd !== undefined && input.FixedAfd !== null && { fixedAfd: input.FixedAfd }), + ...(input.FlickerAq !== undefined && input.FlickerAq !== null && { flickerAq: input.FlickerAq }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.GopClosedCadence !== undefined && + input.GopClosedCadence !== null && { gopClosedCadence: input.GopClosedCadence }), + ...(input.GopSize !== undefined && input.GopSize !== null && { gopSize: input.GopSize }), + ...(input.GopSizeUnits !== undefined && input.GopSizeUnits !== null && { gopSizeUnits: input.GopSizeUnits }), + ...(input.Level !== undefined && input.Level !== null && { level: input.Level }), + ...(input.LookAheadRateControl !== undefined && + input.LookAheadRateControl !== null && { lookAheadRateControl: input.LookAheadRateControl }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), + ...(input.MinIInterval !== undefined && input.MinIInterval !== null && { minIInterval: input.MinIInterval }), + ...(input.ParDenominator !== undefined && + input.ParDenominator !== null && { parDenominator: input.ParDenominator }), + ...(input.ParNumerator !== undefined && input.ParNumerator !== null && { parNumerator: input.ParNumerator }), + ...(input.Profile !== undefined && input.Profile !== null && { profile: input.Profile }), + ...(input.QvbrQualityLevel !== undefined && + input.QvbrQualityLevel !== null && { qvbrQualityLevel: input.QvbrQualityLevel }), + ...(input.RateControlMode !== undefined && + input.RateControlMode !== null && { rateControlMode: input.RateControlMode }), + ...(input.ScanType !== undefined && input.ScanType !== null && { scanType: input.ScanType }), + ...(input.SceneChangeDetect !== undefined && + input.SceneChangeDetect !== null && { sceneChangeDetect: input.SceneChangeDetect }), + ...(input.Slices !== undefined && input.Slices !== null && { slices: input.Slices }), + ...(input.Tier !== undefined && input.Tier !== null && { tier: input.Tier }), + ...(input.TimecodeInsertion !== undefined && + input.TimecodeInsertion !== null && { timecodeInsertion: input.TimecodeInsertion }), }; }; const serializeAws_restJson1Hdr10Settings = (input: Hdr10Settings, context: __SerdeContext): any => { return { - ...(input.MaxCll !== undefined && { maxCll: input.MaxCll }), - ...(input.MaxFall !== undefined && { maxFall: input.MaxFall }), + ...(input.MaxCll !== undefined && input.MaxCll !== null && { maxCll: input.MaxCll }), + ...(input.MaxFall !== undefined && input.MaxFall !== null && { maxFall: input.MaxFall }), }; }; const serializeAws_restJson1HlsAkamaiSettings = (input: HlsAkamaiSettings, context: __SerdeContext): any => { return { - ...(input.ConnectionRetryInterval !== undefined && { connectionRetryInterval: input.ConnectionRetryInterval }), - ...(input.FilecacheDuration !== undefined && { filecacheDuration: input.FilecacheDuration }), - ...(input.HttpTransferMode !== undefined && { httpTransferMode: input.HttpTransferMode }), - ...(input.NumRetries !== undefined && { numRetries: input.NumRetries }), - ...(input.RestartDelay !== undefined && { restartDelay: input.RestartDelay }), - ...(input.Salt !== undefined && { salt: input.Salt }), - ...(input.Token !== undefined && { token: input.Token }), + ...(input.ConnectionRetryInterval !== undefined && + input.ConnectionRetryInterval !== null && { connectionRetryInterval: input.ConnectionRetryInterval }), + ...(input.FilecacheDuration !== undefined && + input.FilecacheDuration !== null && { filecacheDuration: input.FilecacheDuration }), + ...(input.HttpTransferMode !== undefined && + input.HttpTransferMode !== null && { httpTransferMode: input.HttpTransferMode }), + ...(input.NumRetries !== undefined && input.NumRetries !== null && { numRetries: input.NumRetries }), + ...(input.RestartDelay !== undefined && input.RestartDelay !== null && { restartDelay: input.RestartDelay }), + ...(input.Salt !== undefined && input.Salt !== null && { salt: input.Salt }), + ...(input.Token !== undefined && input.Token !== null && { token: input.Token }), }; }; const serializeAws_restJson1HlsBasicPutSettings = (input: HlsBasicPutSettings, context: __SerdeContext): any => { return { - ...(input.ConnectionRetryInterval !== undefined && { connectionRetryInterval: input.ConnectionRetryInterval }), - ...(input.FilecacheDuration !== undefined && { filecacheDuration: input.FilecacheDuration }), - ...(input.NumRetries !== undefined && { numRetries: input.NumRetries }), - ...(input.RestartDelay !== undefined && { restartDelay: input.RestartDelay }), + ...(input.ConnectionRetryInterval !== undefined && + input.ConnectionRetryInterval !== null && { connectionRetryInterval: input.ConnectionRetryInterval }), + ...(input.FilecacheDuration !== undefined && + input.FilecacheDuration !== null && { filecacheDuration: input.FilecacheDuration }), + ...(input.NumRetries !== undefined && input.NumRetries !== null && { numRetries: input.NumRetries }), + ...(input.RestartDelay !== undefined && input.RestartDelay !== null && { restartDelay: input.RestartDelay }), }; }; const serializeAws_restJson1HlsCdnSettings = (input: HlsCdnSettings, context: __SerdeContext): any => { return { - ...(input.HlsAkamaiSettings !== undefined && { - hlsAkamaiSettings: serializeAws_restJson1HlsAkamaiSettings(input.HlsAkamaiSettings, context), - }), - ...(input.HlsBasicPutSettings !== undefined && { - hlsBasicPutSettings: serializeAws_restJson1HlsBasicPutSettings(input.HlsBasicPutSettings, context), - }), - ...(input.HlsMediaStoreSettings !== undefined && { - hlsMediaStoreSettings: serializeAws_restJson1HlsMediaStoreSettings(input.HlsMediaStoreSettings, context), - }), - ...(input.HlsWebdavSettings !== undefined && { - hlsWebdavSettings: serializeAws_restJson1HlsWebdavSettings(input.HlsWebdavSettings, context), - }), + ...(input.HlsAkamaiSettings !== undefined && + input.HlsAkamaiSettings !== null && { + hlsAkamaiSettings: serializeAws_restJson1HlsAkamaiSettings(input.HlsAkamaiSettings, context), + }), + ...(input.HlsBasicPutSettings !== undefined && + input.HlsBasicPutSettings !== null && { + hlsBasicPutSettings: serializeAws_restJson1HlsBasicPutSettings(input.HlsBasicPutSettings, context), + }), + ...(input.HlsMediaStoreSettings !== undefined && + input.HlsMediaStoreSettings !== null && { + hlsMediaStoreSettings: serializeAws_restJson1HlsMediaStoreSettings(input.HlsMediaStoreSettings, context), + }), + ...(input.HlsWebdavSettings !== undefined && + input.HlsWebdavSettings !== null && { + hlsWebdavSettings: serializeAws_restJson1HlsWebdavSettings(input.HlsWebdavSettings, context), + }), }; }; const serializeAws_restJson1HlsGroupSettings = (input: HlsGroupSettings, context: __SerdeContext): any => { return { - ...(input.AdMarkers !== undefined && { - adMarkers: serializeAws_restJson1__listOfHlsAdMarkers(input.AdMarkers, context), - }), - ...(input.BaseUrlContent !== undefined && { baseUrlContent: input.BaseUrlContent }), - ...(input.BaseUrlContent1 !== undefined && { baseUrlContent1: input.BaseUrlContent1 }), - ...(input.BaseUrlManifest !== undefined && { baseUrlManifest: input.BaseUrlManifest }), - ...(input.BaseUrlManifest1 !== undefined && { baseUrlManifest1: input.BaseUrlManifest1 }), - ...(input.CaptionLanguageMappings !== undefined && { - captionLanguageMappings: serializeAws_restJson1__listOfCaptionLanguageMapping( - input.CaptionLanguageMappings, - context - ), - }), - ...(input.CaptionLanguageSetting !== undefined && { captionLanguageSetting: input.CaptionLanguageSetting }), - ...(input.ClientCache !== undefined && { clientCache: input.ClientCache }), - ...(input.CodecSpecification !== undefined && { codecSpecification: input.CodecSpecification }), - ...(input.ConstantIv !== undefined && { constantIv: input.ConstantIv }), - ...(input.Destination !== undefined && { - destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), - }), - ...(input.DirectoryStructure !== undefined && { directoryStructure: input.DirectoryStructure }), - ...(input.DiscontinuityTags !== undefined && { discontinuityTags: input.DiscontinuityTags }), - ...(input.EncryptionType !== undefined && { encryptionType: input.EncryptionType }), - ...(input.HlsCdnSettings !== undefined && { - hlsCdnSettings: serializeAws_restJson1HlsCdnSettings(input.HlsCdnSettings, context), - }), - ...(input.HlsId3SegmentTagging !== undefined && { hlsId3SegmentTagging: input.HlsId3SegmentTagging }), - ...(input.IFrameOnlyPlaylists !== undefined && { iFrameOnlyPlaylists: input.IFrameOnlyPlaylists }), - ...(input.IncompleteSegmentBehavior !== undefined && { - incompleteSegmentBehavior: input.IncompleteSegmentBehavior, - }), - ...(input.IndexNSegments !== undefined && { indexNSegments: input.IndexNSegments }), - ...(input.InputLossAction !== undefined && { inputLossAction: input.InputLossAction }), - ...(input.IvInManifest !== undefined && { ivInManifest: input.IvInManifest }), - ...(input.IvSource !== undefined && { ivSource: input.IvSource }), - ...(input.KeepSegments !== undefined && { keepSegments: input.KeepSegments }), - ...(input.KeyFormat !== undefined && { keyFormat: input.KeyFormat }), - ...(input.KeyFormatVersions !== undefined && { keyFormatVersions: input.KeyFormatVersions }), - ...(input.KeyProviderSettings !== undefined && { - keyProviderSettings: serializeAws_restJson1KeyProviderSettings(input.KeyProviderSettings, context), - }), - ...(input.ManifestCompression !== undefined && { manifestCompression: input.ManifestCompression }), - ...(input.ManifestDurationFormat !== undefined && { manifestDurationFormat: input.ManifestDurationFormat }), - ...(input.MinSegmentLength !== undefined && { minSegmentLength: input.MinSegmentLength }), - ...(input.Mode !== undefined && { mode: input.Mode }), - ...(input.OutputSelection !== undefined && { outputSelection: input.OutputSelection }), - ...(input.ProgramDateTime !== undefined && { programDateTime: input.ProgramDateTime }), - ...(input.ProgramDateTimePeriod !== undefined && { programDateTimePeriod: input.ProgramDateTimePeriod }), - ...(input.RedundantManifest !== undefined && { redundantManifest: input.RedundantManifest }), - ...(input.SegmentLength !== undefined && { segmentLength: input.SegmentLength }), - ...(input.SegmentationMode !== undefined && { segmentationMode: input.SegmentationMode }), - ...(input.SegmentsPerSubdirectory !== undefined && { segmentsPerSubdirectory: input.SegmentsPerSubdirectory }), - ...(input.StreamInfResolution !== undefined && { streamInfResolution: input.StreamInfResolution }), - ...(input.TimedMetadataId3Frame !== undefined && { timedMetadataId3Frame: input.TimedMetadataId3Frame }), - ...(input.TimedMetadataId3Period !== undefined && { timedMetadataId3Period: input.TimedMetadataId3Period }), - ...(input.TimestampDeltaMilliseconds !== undefined && { - timestampDeltaMilliseconds: input.TimestampDeltaMilliseconds, - }), - ...(input.TsFileMode !== undefined && { tsFileMode: input.TsFileMode }), + ...(input.AdMarkers !== undefined && + input.AdMarkers !== null && { adMarkers: serializeAws_restJson1__listOfHlsAdMarkers(input.AdMarkers, context) }), + ...(input.BaseUrlContent !== undefined && + input.BaseUrlContent !== null && { baseUrlContent: input.BaseUrlContent }), + ...(input.BaseUrlContent1 !== undefined && + input.BaseUrlContent1 !== null && { baseUrlContent1: input.BaseUrlContent1 }), + ...(input.BaseUrlManifest !== undefined && + input.BaseUrlManifest !== null && { baseUrlManifest: input.BaseUrlManifest }), + ...(input.BaseUrlManifest1 !== undefined && + input.BaseUrlManifest1 !== null && { baseUrlManifest1: input.BaseUrlManifest1 }), + ...(input.CaptionLanguageMappings !== undefined && + input.CaptionLanguageMappings !== null && { + captionLanguageMappings: serializeAws_restJson1__listOfCaptionLanguageMapping( + input.CaptionLanguageMappings, + context + ), + }), + ...(input.CaptionLanguageSetting !== undefined && + input.CaptionLanguageSetting !== null && { captionLanguageSetting: input.CaptionLanguageSetting }), + ...(input.ClientCache !== undefined && input.ClientCache !== null && { clientCache: input.ClientCache }), + ...(input.CodecSpecification !== undefined && + input.CodecSpecification !== null && { codecSpecification: input.CodecSpecification }), + ...(input.ConstantIv !== undefined && input.ConstantIv !== null && { constantIv: input.ConstantIv }), + ...(input.Destination !== undefined && + input.Destination !== null && { + destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), + }), + ...(input.DirectoryStructure !== undefined && + input.DirectoryStructure !== null && { directoryStructure: input.DirectoryStructure }), + ...(input.DiscontinuityTags !== undefined && + input.DiscontinuityTags !== null && { discontinuityTags: input.DiscontinuityTags }), + ...(input.EncryptionType !== undefined && + input.EncryptionType !== null && { encryptionType: input.EncryptionType }), + ...(input.HlsCdnSettings !== undefined && + input.HlsCdnSettings !== null && { + hlsCdnSettings: serializeAws_restJson1HlsCdnSettings(input.HlsCdnSettings, context), + }), + ...(input.HlsId3SegmentTagging !== undefined && + input.HlsId3SegmentTagging !== null && { hlsId3SegmentTagging: input.HlsId3SegmentTagging }), + ...(input.IFrameOnlyPlaylists !== undefined && + input.IFrameOnlyPlaylists !== null && { iFrameOnlyPlaylists: input.IFrameOnlyPlaylists }), + ...(input.IncompleteSegmentBehavior !== undefined && + input.IncompleteSegmentBehavior !== null && { incompleteSegmentBehavior: input.IncompleteSegmentBehavior }), + ...(input.IndexNSegments !== undefined && + input.IndexNSegments !== null && { indexNSegments: input.IndexNSegments }), + ...(input.InputLossAction !== undefined && + input.InputLossAction !== null && { inputLossAction: input.InputLossAction }), + ...(input.IvInManifest !== undefined && input.IvInManifest !== null && { ivInManifest: input.IvInManifest }), + ...(input.IvSource !== undefined && input.IvSource !== null && { ivSource: input.IvSource }), + ...(input.KeepSegments !== undefined && input.KeepSegments !== null && { keepSegments: input.KeepSegments }), + ...(input.KeyFormat !== undefined && input.KeyFormat !== null && { keyFormat: input.KeyFormat }), + ...(input.KeyFormatVersions !== undefined && + input.KeyFormatVersions !== null && { keyFormatVersions: input.KeyFormatVersions }), + ...(input.KeyProviderSettings !== undefined && + input.KeyProviderSettings !== null && { + keyProviderSettings: serializeAws_restJson1KeyProviderSettings(input.KeyProviderSettings, context), + }), + ...(input.ManifestCompression !== undefined && + input.ManifestCompression !== null && { manifestCompression: input.ManifestCompression }), + ...(input.ManifestDurationFormat !== undefined && + input.ManifestDurationFormat !== null && { manifestDurationFormat: input.ManifestDurationFormat }), + ...(input.MinSegmentLength !== undefined && + input.MinSegmentLength !== null && { minSegmentLength: input.MinSegmentLength }), + ...(input.Mode !== undefined && input.Mode !== null && { mode: input.Mode }), + ...(input.OutputSelection !== undefined && + input.OutputSelection !== null && { outputSelection: input.OutputSelection }), + ...(input.ProgramDateTime !== undefined && + input.ProgramDateTime !== null && { programDateTime: input.ProgramDateTime }), + ...(input.ProgramDateTimePeriod !== undefined && + input.ProgramDateTimePeriod !== null && { programDateTimePeriod: input.ProgramDateTimePeriod }), + ...(input.RedundantManifest !== undefined && + input.RedundantManifest !== null && { redundantManifest: input.RedundantManifest }), + ...(input.SegmentLength !== undefined && input.SegmentLength !== null && { segmentLength: input.SegmentLength }), + ...(input.SegmentationMode !== undefined && + input.SegmentationMode !== null && { segmentationMode: input.SegmentationMode }), + ...(input.SegmentsPerSubdirectory !== undefined && + input.SegmentsPerSubdirectory !== null && { segmentsPerSubdirectory: input.SegmentsPerSubdirectory }), + ...(input.StreamInfResolution !== undefined && + input.StreamInfResolution !== null && { streamInfResolution: input.StreamInfResolution }), + ...(input.TimedMetadataId3Frame !== undefined && + input.TimedMetadataId3Frame !== null && { timedMetadataId3Frame: input.TimedMetadataId3Frame }), + ...(input.TimedMetadataId3Period !== undefined && + input.TimedMetadataId3Period !== null && { timedMetadataId3Period: input.TimedMetadataId3Period }), + ...(input.TimestampDeltaMilliseconds !== undefined && + input.TimestampDeltaMilliseconds !== null && { timestampDeltaMilliseconds: input.TimestampDeltaMilliseconds }), + ...(input.TsFileMode !== undefined && input.TsFileMode !== null && { tsFileMode: input.TsFileMode }), }; }; @@ -10055,51 +10395,59 @@ const serializeAws_restJson1HlsId3SegmentTaggingScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.Tag !== undefined && { tag: input.Tag }), + ...(input.Tag !== undefined && input.Tag !== null && { tag: input.Tag }), }; }; const serializeAws_restJson1HlsInputSettings = (input: HlsInputSettings, context: __SerdeContext): any => { return { - ...(input.Bandwidth !== undefined && { bandwidth: input.Bandwidth }), - ...(input.BufferSegments !== undefined && { bufferSegments: input.BufferSegments }), - ...(input.Retries !== undefined && { retries: input.Retries }), - ...(input.RetryInterval !== undefined && { retryInterval: input.RetryInterval }), + ...(input.Bandwidth !== undefined && input.Bandwidth !== null && { bandwidth: input.Bandwidth }), + ...(input.BufferSegments !== undefined && + input.BufferSegments !== null && { bufferSegments: input.BufferSegments }), + ...(input.Retries !== undefined && input.Retries !== null && { retries: input.Retries }), + ...(input.RetryInterval !== undefined && input.RetryInterval !== null && { retryInterval: input.RetryInterval }), }; }; const serializeAws_restJson1HlsMediaStoreSettings = (input: HlsMediaStoreSettings, context: __SerdeContext): any => { return { - ...(input.ConnectionRetryInterval !== undefined && { connectionRetryInterval: input.ConnectionRetryInterval }), - ...(input.FilecacheDuration !== undefined && { filecacheDuration: input.FilecacheDuration }), - ...(input.MediaStoreStorageClass !== undefined && { mediaStoreStorageClass: input.MediaStoreStorageClass }), - ...(input.NumRetries !== undefined && { numRetries: input.NumRetries }), - ...(input.RestartDelay !== undefined && { restartDelay: input.RestartDelay }), + ...(input.ConnectionRetryInterval !== undefined && + input.ConnectionRetryInterval !== null && { connectionRetryInterval: input.ConnectionRetryInterval }), + ...(input.FilecacheDuration !== undefined && + input.FilecacheDuration !== null && { filecacheDuration: input.FilecacheDuration }), + ...(input.MediaStoreStorageClass !== undefined && + input.MediaStoreStorageClass !== null && { mediaStoreStorageClass: input.MediaStoreStorageClass }), + ...(input.NumRetries !== undefined && input.NumRetries !== null && { numRetries: input.NumRetries }), + ...(input.RestartDelay !== undefined && input.RestartDelay !== null && { restartDelay: input.RestartDelay }), }; }; const serializeAws_restJson1HlsOutputSettings = (input: HlsOutputSettings, context: __SerdeContext): any => { return { - ...(input.H265PackagingType !== undefined && { h265PackagingType: input.H265PackagingType }), - ...(input.HlsSettings !== undefined && { - hlsSettings: serializeAws_restJson1HlsSettings(input.HlsSettings, context), - }), - ...(input.NameModifier !== undefined && { nameModifier: input.NameModifier }), - ...(input.SegmentModifier !== undefined && { segmentModifier: input.SegmentModifier }), + ...(input.H265PackagingType !== undefined && + input.H265PackagingType !== null && { h265PackagingType: input.H265PackagingType }), + ...(input.HlsSettings !== undefined && + input.HlsSettings !== null && { hlsSettings: serializeAws_restJson1HlsSettings(input.HlsSettings, context) }), + ...(input.NameModifier !== undefined && input.NameModifier !== null && { nameModifier: input.NameModifier }), + ...(input.SegmentModifier !== undefined && + input.SegmentModifier !== null && { segmentModifier: input.SegmentModifier }), }; }; const serializeAws_restJson1HlsSettings = (input: HlsSettings, context: __SerdeContext): any => { return { - ...(input.AudioOnlyHlsSettings !== undefined && { - audioOnlyHlsSettings: serializeAws_restJson1AudioOnlyHlsSettings(input.AudioOnlyHlsSettings, context), - }), - ...(input.Fmp4HlsSettings !== undefined && { - fmp4HlsSettings: serializeAws_restJson1Fmp4HlsSettings(input.Fmp4HlsSettings, context), - }), - ...(input.StandardHlsSettings !== undefined && { - standardHlsSettings: serializeAws_restJson1StandardHlsSettings(input.StandardHlsSettings, context), - }), + ...(input.AudioOnlyHlsSettings !== undefined && + input.AudioOnlyHlsSettings !== null && { + audioOnlyHlsSettings: serializeAws_restJson1AudioOnlyHlsSettings(input.AudioOnlyHlsSettings, context), + }), + ...(input.Fmp4HlsSettings !== undefined && + input.Fmp4HlsSettings !== null && { + fmp4HlsSettings: serializeAws_restJson1Fmp4HlsSettings(input.Fmp4HlsSettings, context), + }), + ...(input.StandardHlsSettings !== undefined && + input.StandardHlsSettings !== null && { + standardHlsSettings: serializeAws_restJson1StandardHlsSettings(input.StandardHlsSettings, context), + }), }; }; @@ -10108,17 +10456,20 @@ const serializeAws_restJson1HlsTimedMetadataScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.Id3 !== undefined && { id3: input.Id3 }), + ...(input.Id3 !== undefined && input.Id3 !== null && { id3: input.Id3 }), }; }; const serializeAws_restJson1HlsWebdavSettings = (input: HlsWebdavSettings, context: __SerdeContext): any => { return { - ...(input.ConnectionRetryInterval !== undefined && { connectionRetryInterval: input.ConnectionRetryInterval }), - ...(input.FilecacheDuration !== undefined && { filecacheDuration: input.FilecacheDuration }), - ...(input.HttpTransferMode !== undefined && { httpTransferMode: input.HttpTransferMode }), - ...(input.NumRetries !== undefined && { numRetries: input.NumRetries }), - ...(input.RestartDelay !== undefined && { restartDelay: input.RestartDelay }), + ...(input.ConnectionRetryInterval !== undefined && + input.ConnectionRetryInterval !== null && { connectionRetryInterval: input.ConnectionRetryInterval }), + ...(input.FilecacheDuration !== undefined && + input.FilecacheDuration !== null && { filecacheDuration: input.FilecacheDuration }), + ...(input.HttpTransferMode !== undefined && + input.HttpTransferMode !== null && { httpTransferMode: input.HttpTransferMode }), + ...(input.NumRetries !== undefined && input.NumRetries !== null && { numRetries: input.NumRetries }), + ...(input.RestartDelay !== undefined && input.RestartDelay !== null && { restartDelay: input.RestartDelay }), }; }; @@ -10131,36 +10482,40 @@ const serializeAws_restJson1ImmediateModeScheduleActionStartSettings = ( const serializeAws_restJson1InputAttachment = (input: InputAttachment, context: __SerdeContext): any => { return { - ...(input.AutomaticInputFailoverSettings !== undefined && { - automaticInputFailoverSettings: serializeAws_restJson1AutomaticInputFailoverSettings( - input.AutomaticInputFailoverSettings, - context - ), - }), - ...(input.InputAttachmentName !== undefined && { inputAttachmentName: input.InputAttachmentName }), - ...(input.InputId !== undefined && { inputId: input.InputId }), - ...(input.InputSettings !== undefined && { - inputSettings: serializeAws_restJson1InputSettings(input.InputSettings, context), - }), + ...(input.AutomaticInputFailoverSettings !== undefined && + input.AutomaticInputFailoverSettings !== null && { + automaticInputFailoverSettings: serializeAws_restJson1AutomaticInputFailoverSettings( + input.AutomaticInputFailoverSettings, + context + ), + }), + ...(input.InputAttachmentName !== undefined && + input.InputAttachmentName !== null && { inputAttachmentName: input.InputAttachmentName }), + ...(input.InputId !== undefined && input.InputId !== null && { inputId: input.InputId }), + ...(input.InputSettings !== undefined && + input.InputSettings !== null && { + inputSettings: serializeAws_restJson1InputSettings(input.InputSettings, context), + }), }; }; const serializeAws_restJson1InputChannelLevel = (input: InputChannelLevel, context: __SerdeContext): any => { return { - ...(input.Gain !== undefined && { gain: input.Gain }), - ...(input.InputChannel !== undefined && { inputChannel: input.InputChannel }), + ...(input.Gain !== undefined && input.Gain !== null && { gain: input.Gain }), + ...(input.InputChannel !== undefined && input.InputChannel !== null && { inputChannel: input.InputChannel }), }; }; const serializeAws_restJson1InputClippingSettings = (input: InputClippingSettings, context: __SerdeContext): any => { return { - ...(input.InputTimecodeSource !== undefined && { inputTimecodeSource: input.InputTimecodeSource }), - ...(input.StartTimecode !== undefined && { - startTimecode: serializeAws_restJson1StartTimecode(input.StartTimecode, context), - }), - ...(input.StopTimecode !== undefined && { - stopTimecode: serializeAws_restJson1StopTimecode(input.StopTimecode, context), - }), + ...(input.InputTimecodeSource !== undefined && + input.InputTimecodeSource !== null && { inputTimecodeSource: input.InputTimecodeSource }), + ...(input.StartTimecode !== undefined && + input.StartTimecode !== null && { + startTimecode: serializeAws_restJson1StartTimecode(input.StartTimecode, context), + }), + ...(input.StopTimecode !== undefined && + input.StopTimecode !== null && { stopTimecode: serializeAws_restJson1StopTimecode(input.StopTimecode, context) }), }; }; @@ -10169,7 +10524,7 @@ const serializeAws_restJson1InputDestinationRequest = ( context: __SerdeContext ): any => { return { - ...(input.StreamName !== undefined && { streamName: input.StreamName }), + ...(input.StreamName !== undefined && input.StreamName !== null && { streamName: input.StreamName }), }; }; @@ -10178,40 +10533,46 @@ const serializeAws_restJson1InputDeviceConfigurableSettings = ( context: __SerdeContext ): any => { return { - ...(input.ConfiguredInput !== undefined && { configuredInput: input.ConfiguredInput }), - ...(input.MaxBitrate !== undefined && { maxBitrate: input.MaxBitrate }), + ...(input.ConfiguredInput !== undefined && + input.ConfiguredInput !== null && { configuredInput: input.ConfiguredInput }), + ...(input.MaxBitrate !== undefined && input.MaxBitrate !== null && { maxBitrate: input.MaxBitrate }), }; }; const serializeAws_restJson1InputDeviceRequest = (input: InputDeviceRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), }; }; const serializeAws_restJson1InputDeviceSettings = (input: InputDeviceSettings, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), }; }; const serializeAws_restJson1InputLocation = (input: InputLocation, context: __SerdeContext): any => { return { - ...(input.PasswordParam !== undefined && { passwordParam: input.PasswordParam }), - ...(input.Uri !== undefined && { uri: input.Uri }), - ...(input.Username !== undefined && { username: input.Username }), + ...(input.PasswordParam !== undefined && input.PasswordParam !== null && { passwordParam: input.PasswordParam }), + ...(input.Uri !== undefined && input.Uri !== null && { uri: input.Uri }), + ...(input.Username !== undefined && input.Username !== null && { username: input.Username }), }; }; const serializeAws_restJson1InputLossBehavior = (input: InputLossBehavior, context: __SerdeContext): any => { return { - ...(input.BlackFrameMsec !== undefined && { blackFrameMsec: input.BlackFrameMsec }), - ...(input.InputLossImageColor !== undefined && { inputLossImageColor: input.InputLossImageColor }), - ...(input.InputLossImageSlate !== undefined && { - inputLossImageSlate: serializeAws_restJson1InputLocation(input.InputLossImageSlate, context), - }), - ...(input.InputLossImageType !== undefined && { inputLossImageType: input.InputLossImageType }), - ...(input.RepeatFrameMsec !== undefined && { repeatFrameMsec: input.RepeatFrameMsec }), + ...(input.BlackFrameMsec !== undefined && + input.BlackFrameMsec !== null && { blackFrameMsec: input.BlackFrameMsec }), + ...(input.InputLossImageColor !== undefined && + input.InputLossImageColor !== null && { inputLossImageColor: input.InputLossImageColor }), + ...(input.InputLossImageSlate !== undefined && + input.InputLossImageSlate !== null && { + inputLossImageSlate: serializeAws_restJson1InputLocation(input.InputLossImageSlate, context), + }), + ...(input.InputLossImageType !== undefined && + input.InputLossImageType !== null && { inputLossImageType: input.InputLossImageType }), + ...(input.RepeatFrameMsec !== undefined && + input.RepeatFrameMsec !== null && { repeatFrameMsec: input.RepeatFrameMsec }), }; }; @@ -10220,7 +10581,8 @@ const serializeAws_restJson1InputLossFailoverSettings = ( context: __SerdeContext ): any => { return { - ...(input.InputLossThresholdMsec !== undefined && { inputLossThresholdMsec: input.InputLossThresholdMsec }), + ...(input.InputLossThresholdMsec !== undefined && + input.InputLossThresholdMsec !== null && { inputLossThresholdMsec: input.InputLossThresholdMsec }), }; }; @@ -10229,52 +10591,63 @@ const serializeAws_restJson1InputPrepareScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.InputAttachmentNameReference !== undefined && { - inputAttachmentNameReference: input.InputAttachmentNameReference, - }), - ...(input.InputClippingSettings !== undefined && { - inputClippingSettings: serializeAws_restJson1InputClippingSettings(input.InputClippingSettings, context), - }), - ...(input.UrlPath !== undefined && { urlPath: serializeAws_restJson1__listOf__string(input.UrlPath, context) }), + ...(input.InputAttachmentNameReference !== undefined && + input.InputAttachmentNameReference !== null && { + inputAttachmentNameReference: input.InputAttachmentNameReference, + }), + ...(input.InputClippingSettings !== undefined && + input.InputClippingSettings !== null && { + inputClippingSettings: serializeAws_restJson1InputClippingSettings(input.InputClippingSettings, context), + }), + ...(input.UrlPath !== undefined && + input.UrlPath !== null && { urlPath: serializeAws_restJson1__listOf__string(input.UrlPath, context) }), }; }; const serializeAws_restJson1InputSettings = (input: InputSettings, context: __SerdeContext): any => { return { - ...(input.AudioSelectors !== undefined && { - audioSelectors: serializeAws_restJson1__listOfAudioSelector(input.AudioSelectors, context), - }), - ...(input.CaptionSelectors !== undefined && { - captionSelectors: serializeAws_restJson1__listOfCaptionSelector(input.CaptionSelectors, context), - }), - ...(input.DeblockFilter !== undefined && { deblockFilter: input.DeblockFilter }), - ...(input.DenoiseFilter !== undefined && { denoiseFilter: input.DenoiseFilter }), - ...(input.FilterStrength !== undefined && { filterStrength: input.FilterStrength }), - ...(input.InputFilter !== undefined && { inputFilter: input.InputFilter }), - ...(input.NetworkInputSettings !== undefined && { - networkInputSettings: serializeAws_restJson1NetworkInputSettings(input.NetworkInputSettings, context), - }), - ...(input.Smpte2038DataPreference !== undefined && { smpte2038DataPreference: input.Smpte2038DataPreference }), - ...(input.SourceEndBehavior !== undefined && { sourceEndBehavior: input.SourceEndBehavior }), - ...(input.VideoSelector !== undefined && { - videoSelector: serializeAws_restJson1VideoSelector(input.VideoSelector, context), - }), + ...(input.AudioSelectors !== undefined && + input.AudioSelectors !== null && { + audioSelectors: serializeAws_restJson1__listOfAudioSelector(input.AudioSelectors, context), + }), + ...(input.CaptionSelectors !== undefined && + input.CaptionSelectors !== null && { + captionSelectors: serializeAws_restJson1__listOfCaptionSelector(input.CaptionSelectors, context), + }), + ...(input.DeblockFilter !== undefined && input.DeblockFilter !== null && { deblockFilter: input.DeblockFilter }), + ...(input.DenoiseFilter !== undefined && input.DenoiseFilter !== null && { denoiseFilter: input.DenoiseFilter }), + ...(input.FilterStrength !== undefined && + input.FilterStrength !== null && { filterStrength: input.FilterStrength }), + ...(input.InputFilter !== undefined && input.InputFilter !== null && { inputFilter: input.InputFilter }), + ...(input.NetworkInputSettings !== undefined && + input.NetworkInputSettings !== null && { + networkInputSettings: serializeAws_restJson1NetworkInputSettings(input.NetworkInputSettings, context), + }), + ...(input.Smpte2038DataPreference !== undefined && + input.Smpte2038DataPreference !== null && { smpte2038DataPreference: input.Smpte2038DataPreference }), + ...(input.SourceEndBehavior !== undefined && + input.SourceEndBehavior !== null && { sourceEndBehavior: input.SourceEndBehavior }), + ...(input.VideoSelector !== undefined && + input.VideoSelector !== null && { + videoSelector: serializeAws_restJson1VideoSelector(input.VideoSelector, context), + }), }; }; const serializeAws_restJson1InputSourceRequest = (input: InputSourceRequest, context: __SerdeContext): any => { return { - ...(input.PasswordParam !== undefined && { passwordParam: input.PasswordParam }), - ...(input.Url !== undefined && { url: input.Url }), - ...(input.Username !== undefined && { username: input.Username }), + ...(input.PasswordParam !== undefined && input.PasswordParam !== null && { passwordParam: input.PasswordParam }), + ...(input.Url !== undefined && input.Url !== null && { url: input.Url }), + ...(input.Username !== undefined && input.Username !== null && { username: input.Username }), }; }; const serializeAws_restJson1InputSpecification = (input: InputSpecification, context: __SerdeContext): any => { return { - ...(input.Codec !== undefined && { codec: input.Codec }), - ...(input.MaximumBitrate !== undefined && { maximumBitrate: input.MaximumBitrate }), - ...(input.Resolution !== undefined && { resolution: input.Resolution }), + ...(input.Codec !== undefined && input.Codec !== null && { codec: input.Codec }), + ...(input.MaximumBitrate !== undefined && + input.MaximumBitrate !== null && { maximumBitrate: input.MaximumBitrate }), + ...(input.Resolution !== undefined && input.Resolution !== null && { resolution: input.Resolution }), }; }; @@ -10283,118 +10656,149 @@ const serializeAws_restJson1InputSwitchScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.InputAttachmentNameReference !== undefined && { - inputAttachmentNameReference: input.InputAttachmentNameReference, - }), - ...(input.InputClippingSettings !== undefined && { - inputClippingSettings: serializeAws_restJson1InputClippingSettings(input.InputClippingSettings, context), - }), - ...(input.UrlPath !== undefined && { urlPath: serializeAws_restJson1__listOf__string(input.UrlPath, context) }), + ...(input.InputAttachmentNameReference !== undefined && + input.InputAttachmentNameReference !== null && { + inputAttachmentNameReference: input.InputAttachmentNameReference, + }), + ...(input.InputClippingSettings !== undefined && + input.InputClippingSettings !== null && { + inputClippingSettings: serializeAws_restJson1InputClippingSettings(input.InputClippingSettings, context), + }), + ...(input.UrlPath !== undefined && + input.UrlPath !== null && { urlPath: serializeAws_restJson1__listOf__string(input.UrlPath, context) }), }; }; const serializeAws_restJson1InputVpcRequest = (input: InputVpcRequest, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIds !== undefined && { - securityGroupIds: serializeAws_restJson1__listOf__string(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { - subnetIds: serializeAws_restJson1__listOf__string(input.SubnetIds, context), - }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + securityGroupIds: serializeAws_restJson1__listOf__string(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { subnetIds: serializeAws_restJson1__listOf__string(input.SubnetIds, context) }), }; }; const serializeAws_restJson1InputWhitelistRuleCidr = (input: InputWhitelistRuleCidr, context: __SerdeContext): any => { return { - ...(input.Cidr !== undefined && { cidr: input.Cidr }), + ...(input.Cidr !== undefined && input.Cidr !== null && { cidr: input.Cidr }), }; }; const serializeAws_restJson1KeyProviderSettings = (input: KeyProviderSettings, context: __SerdeContext): any => { return { - ...(input.StaticKeySettings !== undefined && { - staticKeySettings: serializeAws_restJson1StaticKeySettings(input.StaticKeySettings, context), - }), + ...(input.StaticKeySettings !== undefined && + input.StaticKeySettings !== null && { + staticKeySettings: serializeAws_restJson1StaticKeySettings(input.StaticKeySettings, context), + }), }; }; const serializeAws_restJson1M2tsSettings = (input: M2tsSettings, context: __SerdeContext): any => { return { - ...(input.AbsentInputAudioBehavior !== undefined && { absentInputAudioBehavior: input.AbsentInputAudioBehavior }), - ...(input.Arib !== undefined && { arib: input.Arib }), - ...(input.AribCaptionsPid !== undefined && { aribCaptionsPid: input.AribCaptionsPid }), - ...(input.AribCaptionsPidControl !== undefined && { aribCaptionsPidControl: input.AribCaptionsPidControl }), - ...(input.AudioBufferModel !== undefined && { audioBufferModel: input.AudioBufferModel }), - ...(input.AudioFramesPerPes !== undefined && { audioFramesPerPes: input.AudioFramesPerPes }), - ...(input.AudioPids !== undefined && { audioPids: input.AudioPids }), - ...(input.AudioStreamType !== undefined && { audioStreamType: input.AudioStreamType }), - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.BufferModel !== undefined && { bufferModel: input.BufferModel }), - ...(input.CcDescriptor !== undefined && { ccDescriptor: input.CcDescriptor }), - ...(input.DvbNitSettings !== undefined && { - dvbNitSettings: serializeAws_restJson1DvbNitSettings(input.DvbNitSettings, context), - }), - ...(input.DvbSdtSettings !== undefined && { - dvbSdtSettings: serializeAws_restJson1DvbSdtSettings(input.DvbSdtSettings, context), - }), - ...(input.DvbSubPids !== undefined && { dvbSubPids: input.DvbSubPids }), - ...(input.DvbTdtSettings !== undefined && { - dvbTdtSettings: serializeAws_restJson1DvbTdtSettings(input.DvbTdtSettings, context), - }), - ...(input.DvbTeletextPid !== undefined && { dvbTeletextPid: input.DvbTeletextPid }), - ...(input.Ebif !== undefined && { ebif: input.Ebif }), - ...(input.EbpAudioInterval !== undefined && { ebpAudioInterval: input.EbpAudioInterval }), - ...(input.EbpLookaheadMs !== undefined && { ebpLookaheadMs: input.EbpLookaheadMs }), - ...(input.EbpPlacement !== undefined && { ebpPlacement: input.EbpPlacement }), - ...(input.EcmPid !== undefined && { ecmPid: input.EcmPid }), - ...(input.EsRateInPes !== undefined && { esRateInPes: input.EsRateInPes }), - ...(input.EtvPlatformPid !== undefined && { etvPlatformPid: input.EtvPlatformPid }), - ...(input.EtvSignalPid !== undefined && { etvSignalPid: input.EtvSignalPid }), - ...(input.FragmentTime !== undefined && { fragmentTime: input.FragmentTime }), - ...(input.Klv !== undefined && { klv: input.Klv }), - ...(input.KlvDataPids !== undefined && { klvDataPids: input.KlvDataPids }), - ...(input.NielsenId3Behavior !== undefined && { nielsenId3Behavior: input.NielsenId3Behavior }), - ...(input.NullPacketBitrate !== undefined && { nullPacketBitrate: input.NullPacketBitrate }), - ...(input.PatInterval !== undefined && { patInterval: input.PatInterval }), - ...(input.PcrControl !== undefined && { pcrControl: input.PcrControl }), - ...(input.PcrPeriod !== undefined && { pcrPeriod: input.PcrPeriod }), - ...(input.PcrPid !== undefined && { pcrPid: input.PcrPid }), - ...(input.PmtInterval !== undefined && { pmtInterval: input.PmtInterval }), - ...(input.PmtPid !== undefined && { pmtPid: input.PmtPid }), - ...(input.ProgramNum !== undefined && { programNum: input.ProgramNum }), - ...(input.RateMode !== undefined && { rateMode: input.RateMode }), - ...(input.Scte27Pids !== undefined && { scte27Pids: input.Scte27Pids }), - ...(input.Scte35Control !== undefined && { scte35Control: input.Scte35Control }), - ...(input.Scte35Pid !== undefined && { scte35Pid: input.Scte35Pid }), - ...(input.SegmentationMarkers !== undefined && { segmentationMarkers: input.SegmentationMarkers }), - ...(input.SegmentationStyle !== undefined && { segmentationStyle: input.SegmentationStyle }), - ...(input.SegmentationTime !== undefined && { segmentationTime: input.SegmentationTime }), - ...(input.TimedMetadataBehavior !== undefined && { timedMetadataBehavior: input.TimedMetadataBehavior }), - ...(input.TimedMetadataPid !== undefined && { timedMetadataPid: input.TimedMetadataPid }), - ...(input.TransportStreamId !== undefined && { transportStreamId: input.TransportStreamId }), - ...(input.VideoPid !== undefined && { videoPid: input.VideoPid }), + ...(input.AbsentInputAudioBehavior !== undefined && + input.AbsentInputAudioBehavior !== null && { absentInputAudioBehavior: input.AbsentInputAudioBehavior }), + ...(input.Arib !== undefined && input.Arib !== null && { arib: input.Arib }), + ...(input.AribCaptionsPid !== undefined && + input.AribCaptionsPid !== null && { aribCaptionsPid: input.AribCaptionsPid }), + ...(input.AribCaptionsPidControl !== undefined && + input.AribCaptionsPidControl !== null && { aribCaptionsPidControl: input.AribCaptionsPidControl }), + ...(input.AudioBufferModel !== undefined && + input.AudioBufferModel !== null && { audioBufferModel: input.AudioBufferModel }), + ...(input.AudioFramesPerPes !== undefined && + input.AudioFramesPerPes !== null && { audioFramesPerPes: input.AudioFramesPerPes }), + ...(input.AudioPids !== undefined && input.AudioPids !== null && { audioPids: input.AudioPids }), + ...(input.AudioStreamType !== undefined && + input.AudioStreamType !== null && { audioStreamType: input.AudioStreamType }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.BufferModel !== undefined && input.BufferModel !== null && { bufferModel: input.BufferModel }), + ...(input.CcDescriptor !== undefined && input.CcDescriptor !== null && { ccDescriptor: input.CcDescriptor }), + ...(input.DvbNitSettings !== undefined && + input.DvbNitSettings !== null && { + dvbNitSettings: serializeAws_restJson1DvbNitSettings(input.DvbNitSettings, context), + }), + ...(input.DvbSdtSettings !== undefined && + input.DvbSdtSettings !== null && { + dvbSdtSettings: serializeAws_restJson1DvbSdtSettings(input.DvbSdtSettings, context), + }), + ...(input.DvbSubPids !== undefined && input.DvbSubPids !== null && { dvbSubPids: input.DvbSubPids }), + ...(input.DvbTdtSettings !== undefined && + input.DvbTdtSettings !== null && { + dvbTdtSettings: serializeAws_restJson1DvbTdtSettings(input.DvbTdtSettings, context), + }), + ...(input.DvbTeletextPid !== undefined && + input.DvbTeletextPid !== null && { dvbTeletextPid: input.DvbTeletextPid }), + ...(input.Ebif !== undefined && input.Ebif !== null && { ebif: input.Ebif }), + ...(input.EbpAudioInterval !== undefined && + input.EbpAudioInterval !== null && { ebpAudioInterval: input.EbpAudioInterval }), + ...(input.EbpLookaheadMs !== undefined && + input.EbpLookaheadMs !== null && { ebpLookaheadMs: input.EbpLookaheadMs }), + ...(input.EbpPlacement !== undefined && input.EbpPlacement !== null && { ebpPlacement: input.EbpPlacement }), + ...(input.EcmPid !== undefined && input.EcmPid !== null && { ecmPid: input.EcmPid }), + ...(input.EsRateInPes !== undefined && input.EsRateInPes !== null && { esRateInPes: input.EsRateInPes }), + ...(input.EtvPlatformPid !== undefined && + input.EtvPlatformPid !== null && { etvPlatformPid: input.EtvPlatformPid }), + ...(input.EtvSignalPid !== undefined && input.EtvSignalPid !== null && { etvSignalPid: input.EtvSignalPid }), + ...(input.FragmentTime !== undefined && input.FragmentTime !== null && { fragmentTime: input.FragmentTime }), + ...(input.Klv !== undefined && input.Klv !== null && { klv: input.Klv }), + ...(input.KlvDataPids !== undefined && input.KlvDataPids !== null && { klvDataPids: input.KlvDataPids }), + ...(input.NielsenId3Behavior !== undefined && + input.NielsenId3Behavior !== null && { nielsenId3Behavior: input.NielsenId3Behavior }), + ...(input.NullPacketBitrate !== undefined && + input.NullPacketBitrate !== null && { nullPacketBitrate: input.NullPacketBitrate }), + ...(input.PatInterval !== undefined && input.PatInterval !== null && { patInterval: input.PatInterval }), + ...(input.PcrControl !== undefined && input.PcrControl !== null && { pcrControl: input.PcrControl }), + ...(input.PcrPeriod !== undefined && input.PcrPeriod !== null && { pcrPeriod: input.PcrPeriod }), + ...(input.PcrPid !== undefined && input.PcrPid !== null && { pcrPid: input.PcrPid }), + ...(input.PmtInterval !== undefined && input.PmtInterval !== null && { pmtInterval: input.PmtInterval }), + ...(input.PmtPid !== undefined && input.PmtPid !== null && { pmtPid: input.PmtPid }), + ...(input.ProgramNum !== undefined && input.ProgramNum !== null && { programNum: input.ProgramNum }), + ...(input.RateMode !== undefined && input.RateMode !== null && { rateMode: input.RateMode }), + ...(input.Scte27Pids !== undefined && input.Scte27Pids !== null && { scte27Pids: input.Scte27Pids }), + ...(input.Scte35Control !== undefined && input.Scte35Control !== null && { scte35Control: input.Scte35Control }), + ...(input.Scte35Pid !== undefined && input.Scte35Pid !== null && { scte35Pid: input.Scte35Pid }), + ...(input.SegmentationMarkers !== undefined && + input.SegmentationMarkers !== null && { segmentationMarkers: input.SegmentationMarkers }), + ...(input.SegmentationStyle !== undefined && + input.SegmentationStyle !== null && { segmentationStyle: input.SegmentationStyle }), + ...(input.SegmentationTime !== undefined && + input.SegmentationTime !== null && { segmentationTime: input.SegmentationTime }), + ...(input.TimedMetadataBehavior !== undefined && + input.TimedMetadataBehavior !== null && { timedMetadataBehavior: input.TimedMetadataBehavior }), + ...(input.TimedMetadataPid !== undefined && + input.TimedMetadataPid !== null && { timedMetadataPid: input.TimedMetadataPid }), + ...(input.TransportStreamId !== undefined && + input.TransportStreamId !== null && { transportStreamId: input.TransportStreamId }), + ...(input.VideoPid !== undefined && input.VideoPid !== null && { videoPid: input.VideoPid }), }; }; const serializeAws_restJson1M3u8Settings = (input: M3u8Settings, context: __SerdeContext): any => { return { - ...(input.AudioFramesPerPes !== undefined && { audioFramesPerPes: input.AudioFramesPerPes }), - ...(input.AudioPids !== undefined && { audioPids: input.AudioPids }), - ...(input.EcmPid !== undefined && { ecmPid: input.EcmPid }), - ...(input.NielsenId3Behavior !== undefined && { nielsenId3Behavior: input.NielsenId3Behavior }), - ...(input.PatInterval !== undefined && { patInterval: input.PatInterval }), - ...(input.PcrControl !== undefined && { pcrControl: input.PcrControl }), - ...(input.PcrPeriod !== undefined && { pcrPeriod: input.PcrPeriod }), - ...(input.PcrPid !== undefined && { pcrPid: input.PcrPid }), - ...(input.PmtInterval !== undefined && { pmtInterval: input.PmtInterval }), - ...(input.PmtPid !== undefined && { pmtPid: input.PmtPid }), - ...(input.ProgramNum !== undefined && { programNum: input.ProgramNum }), - ...(input.Scte35Behavior !== undefined && { scte35Behavior: input.Scte35Behavior }), - ...(input.Scte35Pid !== undefined && { scte35Pid: input.Scte35Pid }), - ...(input.TimedMetadataBehavior !== undefined && { timedMetadataBehavior: input.TimedMetadataBehavior }), - ...(input.TimedMetadataPid !== undefined && { timedMetadataPid: input.TimedMetadataPid }), - ...(input.TransportStreamId !== undefined && { transportStreamId: input.TransportStreamId }), - ...(input.VideoPid !== undefined && { videoPid: input.VideoPid }), + ...(input.AudioFramesPerPes !== undefined && + input.AudioFramesPerPes !== null && { audioFramesPerPes: input.AudioFramesPerPes }), + ...(input.AudioPids !== undefined && input.AudioPids !== null && { audioPids: input.AudioPids }), + ...(input.EcmPid !== undefined && input.EcmPid !== null && { ecmPid: input.EcmPid }), + ...(input.NielsenId3Behavior !== undefined && + input.NielsenId3Behavior !== null && { nielsenId3Behavior: input.NielsenId3Behavior }), + ...(input.PatInterval !== undefined && input.PatInterval !== null && { patInterval: input.PatInterval }), + ...(input.PcrControl !== undefined && input.PcrControl !== null && { pcrControl: input.PcrControl }), + ...(input.PcrPeriod !== undefined && input.PcrPeriod !== null && { pcrPeriod: input.PcrPeriod }), + ...(input.PcrPid !== undefined && input.PcrPid !== null && { pcrPid: input.PcrPid }), + ...(input.PmtInterval !== undefined && input.PmtInterval !== null && { pmtInterval: input.PmtInterval }), + ...(input.PmtPid !== undefined && input.PmtPid !== null && { pmtPid: input.PmtPid }), + ...(input.ProgramNum !== undefined && input.ProgramNum !== null && { programNum: input.ProgramNum }), + ...(input.Scte35Behavior !== undefined && + input.Scte35Behavior !== null && { scte35Behavior: input.Scte35Behavior }), + ...(input.Scte35Pid !== undefined && input.Scte35Pid !== null && { scte35Pid: input.Scte35Pid }), + ...(input.TimedMetadataBehavior !== undefined && + input.TimedMetadataBehavior !== null && { timedMetadataBehavior: input.TimedMetadataBehavior }), + ...(input.TimedMetadataPid !== undefined && + input.TimedMetadataPid !== null && { timedMetadataPid: input.TimedMetadataPid }), + ...(input.TransportStreamId !== undefined && + input.TransportStreamId !== null && { transportStreamId: input.TransportStreamId }), + ...(input.VideoPid !== undefined && input.VideoPid !== null && { videoPid: input.VideoPid }), }; }; @@ -10403,7 +10807,7 @@ const serializeAws_restJson1MediaConnectFlowRequest = ( context: __SerdeContext ): any => { return { - ...(input.FlowArn !== undefined && { flowArn: input.FlowArn }), + ...(input.FlowArn !== undefined && input.FlowArn !== null && { flowArn: input.FlowArn }), }; }; @@ -10412,9 +10816,10 @@ const serializeAws_restJson1MediaPackageGroupSettings = ( context: __SerdeContext ): any => { return { - ...(input.Destination !== undefined && { - destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), - }), + ...(input.Destination !== undefined && + input.Destination !== null && { + destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), + }), }; }; @@ -10423,7 +10828,7 @@ const serializeAws_restJson1MediaPackageOutputDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.ChannelId !== undefined && { channelId: input.ChannelId }), + ...(input.ChannelId !== undefined && input.ChannelId !== null && { channelId: input.ChannelId }), }; }; @@ -10436,73 +10841,96 @@ const serializeAws_restJson1MediaPackageOutputSettings = ( const serializeAws_restJson1Mp2Settings = (input: Mp2Settings, context: __SerdeContext): any => { return { - ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), - ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), + ...(input.Bitrate !== undefined && input.Bitrate !== null && { bitrate: input.Bitrate }), + ...(input.CodingMode !== undefined && input.CodingMode !== null && { codingMode: input.CodingMode }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), }; }; const serializeAws_restJson1Mpeg2FilterSettings = (input: Mpeg2FilterSettings, context: __SerdeContext): any => { return { - ...(input.TemporalFilterSettings !== undefined && { - temporalFilterSettings: serializeAws_restJson1TemporalFilterSettings(input.TemporalFilterSettings, context), - }), + ...(input.TemporalFilterSettings !== undefined && + input.TemporalFilterSettings !== null && { + temporalFilterSettings: serializeAws_restJson1TemporalFilterSettings(input.TemporalFilterSettings, context), + }), }; }; const serializeAws_restJson1Mpeg2Settings = (input: Mpeg2Settings, context: __SerdeContext): any => { return { - ...(input.AdaptiveQuantization !== undefined && { adaptiveQuantization: input.AdaptiveQuantization }), - ...(input.AfdSignaling !== undefined && { afdSignaling: input.AfdSignaling }), - ...(input.ColorMetadata !== undefined && { colorMetadata: input.ColorMetadata }), - ...(input.ColorSpace !== undefined && { colorSpace: input.ColorSpace }), - ...(input.DisplayAspectRatio !== undefined && { displayAspectRatio: input.DisplayAspectRatio }), - ...(input.FilterSettings !== undefined && { - filterSettings: serializeAws_restJson1Mpeg2FilterSettings(input.FilterSettings, context), - }), - ...(input.FixedAfd !== undefined && { fixedAfd: input.FixedAfd }), - ...(input.FramerateDenominator !== undefined && { framerateDenominator: input.FramerateDenominator }), - ...(input.FramerateNumerator !== undefined && { framerateNumerator: input.FramerateNumerator }), - ...(input.GopClosedCadence !== undefined && { gopClosedCadence: input.GopClosedCadence }), - ...(input.GopNumBFrames !== undefined && { gopNumBFrames: input.GopNumBFrames }), - ...(input.GopSize !== undefined && { gopSize: input.GopSize }), - ...(input.GopSizeUnits !== undefined && { gopSizeUnits: input.GopSizeUnits }), - ...(input.ScanType !== undefined && { scanType: input.ScanType }), - ...(input.SubgopLength !== undefined && { subgopLength: input.SubgopLength }), - ...(input.TimecodeInsertion !== undefined && { timecodeInsertion: input.TimecodeInsertion }), + ...(input.AdaptiveQuantization !== undefined && + input.AdaptiveQuantization !== null && { adaptiveQuantization: input.AdaptiveQuantization }), + ...(input.AfdSignaling !== undefined && input.AfdSignaling !== null && { afdSignaling: input.AfdSignaling }), + ...(input.ColorMetadata !== undefined && input.ColorMetadata !== null && { colorMetadata: input.ColorMetadata }), + ...(input.ColorSpace !== undefined && input.ColorSpace !== null && { colorSpace: input.ColorSpace }), + ...(input.DisplayAspectRatio !== undefined && + input.DisplayAspectRatio !== null && { displayAspectRatio: input.DisplayAspectRatio }), + ...(input.FilterSettings !== undefined && + input.FilterSettings !== null && { + filterSettings: serializeAws_restJson1Mpeg2FilterSettings(input.FilterSettings, context), + }), + ...(input.FixedAfd !== undefined && input.FixedAfd !== null && { fixedAfd: input.FixedAfd }), + ...(input.FramerateDenominator !== undefined && + input.FramerateDenominator !== null && { framerateDenominator: input.FramerateDenominator }), + ...(input.FramerateNumerator !== undefined && + input.FramerateNumerator !== null && { framerateNumerator: input.FramerateNumerator }), + ...(input.GopClosedCadence !== undefined && + input.GopClosedCadence !== null && { gopClosedCadence: input.GopClosedCadence }), + ...(input.GopNumBFrames !== undefined && input.GopNumBFrames !== null && { gopNumBFrames: input.GopNumBFrames }), + ...(input.GopSize !== undefined && input.GopSize !== null && { gopSize: input.GopSize }), + ...(input.GopSizeUnits !== undefined && input.GopSizeUnits !== null && { gopSizeUnits: input.GopSizeUnits }), + ...(input.ScanType !== undefined && input.ScanType !== null && { scanType: input.ScanType }), + ...(input.SubgopLength !== undefined && input.SubgopLength !== null && { subgopLength: input.SubgopLength }), + ...(input.TimecodeInsertion !== undefined && + input.TimecodeInsertion !== null && { timecodeInsertion: input.TimecodeInsertion }), }; }; const serializeAws_restJson1MsSmoothGroupSettings = (input: MsSmoothGroupSettings, context: __SerdeContext): any => { return { - ...(input.AcquisitionPointId !== undefined && { acquisitionPointId: input.AcquisitionPointId }), - ...(input.AudioOnlyTimecodeControl !== undefined && { audioOnlyTimecodeControl: input.AudioOnlyTimecodeControl }), - ...(input.CertificateMode !== undefined && { certificateMode: input.CertificateMode }), - ...(input.ConnectionRetryInterval !== undefined && { connectionRetryInterval: input.ConnectionRetryInterval }), - ...(input.Destination !== undefined && { - destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), - }), - ...(input.EventId !== undefined && { eventId: input.EventId }), - ...(input.EventIdMode !== undefined && { eventIdMode: input.EventIdMode }), - ...(input.EventStopBehavior !== undefined && { eventStopBehavior: input.EventStopBehavior }), - ...(input.FilecacheDuration !== undefined && { filecacheDuration: input.FilecacheDuration }), - ...(input.FragmentLength !== undefined && { fragmentLength: input.FragmentLength }), - ...(input.InputLossAction !== undefined && { inputLossAction: input.InputLossAction }), - ...(input.NumRetries !== undefined && { numRetries: input.NumRetries }), - ...(input.RestartDelay !== undefined && { restartDelay: input.RestartDelay }), - ...(input.SegmentationMode !== undefined && { segmentationMode: input.SegmentationMode }), - ...(input.SendDelayMs !== undefined && { sendDelayMs: input.SendDelayMs }), - ...(input.SparseTrackType !== undefined && { sparseTrackType: input.SparseTrackType }), - ...(input.StreamManifestBehavior !== undefined && { streamManifestBehavior: input.StreamManifestBehavior }), - ...(input.TimestampOffset !== undefined && { timestampOffset: input.TimestampOffset }), - ...(input.TimestampOffsetMode !== undefined && { timestampOffsetMode: input.TimestampOffsetMode }), + ...(input.AcquisitionPointId !== undefined && + input.AcquisitionPointId !== null && { acquisitionPointId: input.AcquisitionPointId }), + ...(input.AudioOnlyTimecodeControl !== undefined && + input.AudioOnlyTimecodeControl !== null && { audioOnlyTimecodeControl: input.AudioOnlyTimecodeControl }), + ...(input.CertificateMode !== undefined && + input.CertificateMode !== null && { certificateMode: input.CertificateMode }), + ...(input.ConnectionRetryInterval !== undefined && + input.ConnectionRetryInterval !== null && { connectionRetryInterval: input.ConnectionRetryInterval }), + ...(input.Destination !== undefined && + input.Destination !== null && { + destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), + }), + ...(input.EventId !== undefined && input.EventId !== null && { eventId: input.EventId }), + ...(input.EventIdMode !== undefined && input.EventIdMode !== null && { eventIdMode: input.EventIdMode }), + ...(input.EventStopBehavior !== undefined && + input.EventStopBehavior !== null && { eventStopBehavior: input.EventStopBehavior }), + ...(input.FilecacheDuration !== undefined && + input.FilecacheDuration !== null && { filecacheDuration: input.FilecacheDuration }), + ...(input.FragmentLength !== undefined && + input.FragmentLength !== null && { fragmentLength: input.FragmentLength }), + ...(input.InputLossAction !== undefined && + input.InputLossAction !== null && { inputLossAction: input.InputLossAction }), + ...(input.NumRetries !== undefined && input.NumRetries !== null && { numRetries: input.NumRetries }), + ...(input.RestartDelay !== undefined && input.RestartDelay !== null && { restartDelay: input.RestartDelay }), + ...(input.SegmentationMode !== undefined && + input.SegmentationMode !== null && { segmentationMode: input.SegmentationMode }), + ...(input.SendDelayMs !== undefined && input.SendDelayMs !== null && { sendDelayMs: input.SendDelayMs }), + ...(input.SparseTrackType !== undefined && + input.SparseTrackType !== null && { sparseTrackType: input.SparseTrackType }), + ...(input.StreamManifestBehavior !== undefined && + input.StreamManifestBehavior !== null && { streamManifestBehavior: input.StreamManifestBehavior }), + ...(input.TimestampOffset !== undefined && + input.TimestampOffset !== null && { timestampOffset: input.TimestampOffset }), + ...(input.TimestampOffsetMode !== undefined && + input.TimestampOffsetMode !== null && { timestampOffsetMode: input.TimestampOffsetMode }), }; }; const serializeAws_restJson1MsSmoothOutputSettings = (input: MsSmoothOutputSettings, context: __SerdeContext): any => { return { - ...(input.H265PackagingType !== undefined && { h265PackagingType: input.H265PackagingType }), - ...(input.NameModifier !== undefined && { nameModifier: input.NameModifier }), + ...(input.H265PackagingType !== undefined && + input.H265PackagingType !== null && { h265PackagingType: input.H265PackagingType }), + ...(input.NameModifier !== undefined && input.NameModifier !== null && { nameModifier: input.NameModifier }), }; }; @@ -10515,9 +10943,10 @@ const serializeAws_restJson1MultiplexOutputSettings = ( context: __SerdeContext ): any => { return { - ...(input.Destination !== undefined && { - destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), - }), + ...(input.Destination !== undefined && + input.Destination !== null && { + destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), + }), }; }; @@ -10526,8 +10955,8 @@ const serializeAws_restJson1MultiplexProgramChannelDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.MultiplexId !== undefined && { multiplexId: input.MultiplexId }), - ...(input.ProgramName !== undefined && { programName: input.ProgramName }), + ...(input.MultiplexId !== undefined && input.MultiplexId !== null && { multiplexId: input.MultiplexId }), + ...(input.ProgramName !== undefined && input.ProgramName !== null && { programName: input.ProgramName }), }; }; @@ -10536,8 +10965,8 @@ const serializeAws_restJson1MultiplexProgramServiceDescriptor = ( context: __SerdeContext ): any => { return { - ...(input.ProviderName !== undefined && { providerName: input.ProviderName }), - ...(input.ServiceName !== undefined && { serviceName: input.ServiceName }), + ...(input.ProviderName !== undefined && input.ProviderName !== null && { providerName: input.ProviderName }), + ...(input.ServiceName !== undefined && input.ServiceName !== null && { serviceName: input.ServiceName }), }; }; @@ -10546,27 +10975,34 @@ const serializeAws_restJson1MultiplexProgramSettings = ( context: __SerdeContext ): any => { return { - ...(input.PreferredChannelPipeline !== undefined && { preferredChannelPipeline: input.PreferredChannelPipeline }), - ...(input.ProgramNumber !== undefined && { programNumber: input.ProgramNumber }), - ...(input.ServiceDescriptor !== undefined && { - serviceDescriptor: serializeAws_restJson1MultiplexProgramServiceDescriptor(input.ServiceDescriptor, context), - }), - ...(input.VideoSettings !== undefined && { - videoSettings: serializeAws_restJson1MultiplexVideoSettings(input.VideoSettings, context), - }), + ...(input.PreferredChannelPipeline !== undefined && + input.PreferredChannelPipeline !== null && { preferredChannelPipeline: input.PreferredChannelPipeline }), + ...(input.ProgramNumber !== undefined && input.ProgramNumber !== null && { programNumber: input.ProgramNumber }), + ...(input.ServiceDescriptor !== undefined && + input.ServiceDescriptor !== null && { + serviceDescriptor: serializeAws_restJson1MultiplexProgramServiceDescriptor(input.ServiceDescriptor, context), + }), + ...(input.VideoSettings !== undefined && + input.VideoSettings !== null && { + videoSettings: serializeAws_restJson1MultiplexVideoSettings(input.VideoSettings, context), + }), }; }; const serializeAws_restJson1MultiplexSettings = (input: MultiplexSettings, context: __SerdeContext): any => { return { - ...(input.MaximumVideoBufferDelayMilliseconds !== undefined && { - maximumVideoBufferDelayMilliseconds: input.MaximumVideoBufferDelayMilliseconds, - }), - ...(input.TransportStreamBitrate !== undefined && { transportStreamBitrate: input.TransportStreamBitrate }), - ...(input.TransportStreamId !== undefined && { transportStreamId: input.TransportStreamId }), - ...(input.TransportStreamReservedBitrate !== undefined && { - transportStreamReservedBitrate: input.TransportStreamReservedBitrate, - }), + ...(input.MaximumVideoBufferDelayMilliseconds !== undefined && + input.MaximumVideoBufferDelayMilliseconds !== null && { + maximumVideoBufferDelayMilliseconds: input.MaximumVideoBufferDelayMilliseconds, + }), + ...(input.TransportStreamBitrate !== undefined && + input.TransportStreamBitrate !== null && { transportStreamBitrate: input.TransportStreamBitrate }), + ...(input.TransportStreamId !== undefined && + input.TransportStreamId !== null && { transportStreamId: input.TransportStreamId }), + ...(input.TransportStreamReservedBitrate !== undefined && + input.TransportStreamReservedBitrate !== null && { + transportStreamReservedBitrate: input.TransportStreamReservedBitrate, + }), }; }; @@ -10575,71 +11011,85 @@ const serializeAws_restJson1MultiplexStatmuxVideoSettings = ( context: __SerdeContext ): any => { return { - ...(input.MaximumBitrate !== undefined && { maximumBitrate: input.MaximumBitrate }), - ...(input.MinimumBitrate !== undefined && { minimumBitrate: input.MinimumBitrate }), - ...(input.Priority !== undefined && { priority: input.Priority }), + ...(input.MaximumBitrate !== undefined && + input.MaximumBitrate !== null && { maximumBitrate: input.MaximumBitrate }), + ...(input.MinimumBitrate !== undefined && + input.MinimumBitrate !== null && { minimumBitrate: input.MinimumBitrate }), + ...(input.Priority !== undefined && input.Priority !== null && { priority: input.Priority }), }; }; const serializeAws_restJson1MultiplexVideoSettings = (input: MultiplexVideoSettings, context: __SerdeContext): any => { return { - ...(input.ConstantBitrate !== undefined && { constantBitrate: input.ConstantBitrate }), - ...(input.StatmuxSettings !== undefined && { - statmuxSettings: serializeAws_restJson1MultiplexStatmuxVideoSettings(input.StatmuxSettings, context), - }), + ...(input.ConstantBitrate !== undefined && + input.ConstantBitrate !== null && { constantBitrate: input.ConstantBitrate }), + ...(input.StatmuxSettings !== undefined && + input.StatmuxSettings !== null && { + statmuxSettings: serializeAws_restJson1MultiplexStatmuxVideoSettings(input.StatmuxSettings, context), + }), }; }; const serializeAws_restJson1NetworkInputSettings = (input: NetworkInputSettings, context: __SerdeContext): any => { return { - ...(input.HlsInputSettings !== undefined && { - hlsInputSettings: serializeAws_restJson1HlsInputSettings(input.HlsInputSettings, context), - }), - ...(input.ServerValidation !== undefined && { serverValidation: input.ServerValidation }), + ...(input.HlsInputSettings !== undefined && + input.HlsInputSettings !== null && { + hlsInputSettings: serializeAws_restJson1HlsInputSettings(input.HlsInputSettings, context), + }), + ...(input.ServerValidation !== undefined && + input.ServerValidation !== null && { serverValidation: input.ServerValidation }), }; }; const serializeAws_restJson1NielsenConfiguration = (input: NielsenConfiguration, context: __SerdeContext): any => { return { - ...(input.DistributorId !== undefined && { distributorId: input.DistributorId }), - ...(input.NielsenPcmToId3Tagging !== undefined && { nielsenPcmToId3Tagging: input.NielsenPcmToId3Tagging }), + ...(input.DistributorId !== undefined && input.DistributorId !== null && { distributorId: input.DistributorId }), + ...(input.NielsenPcmToId3Tagging !== undefined && + input.NielsenPcmToId3Tagging !== null && { nielsenPcmToId3Tagging: input.NielsenPcmToId3Tagging }), }; }; const serializeAws_restJson1Output = (input: Output, context: __SerdeContext): any => { return { - ...(input.AudioDescriptionNames !== undefined && { - audioDescriptionNames: serializeAws_restJson1__listOf__string(input.AudioDescriptionNames, context), - }), - ...(input.CaptionDescriptionNames !== undefined && { - captionDescriptionNames: serializeAws_restJson1__listOf__string(input.CaptionDescriptionNames, context), - }), - ...(input.OutputName !== undefined && { outputName: input.OutputName }), - ...(input.OutputSettings !== undefined && { - outputSettings: serializeAws_restJson1OutputSettings(input.OutputSettings, context), - }), - ...(input.VideoDescriptionName !== undefined && { videoDescriptionName: input.VideoDescriptionName }), + ...(input.AudioDescriptionNames !== undefined && + input.AudioDescriptionNames !== null && { + audioDescriptionNames: serializeAws_restJson1__listOf__string(input.AudioDescriptionNames, context), + }), + ...(input.CaptionDescriptionNames !== undefined && + input.CaptionDescriptionNames !== null && { + captionDescriptionNames: serializeAws_restJson1__listOf__string(input.CaptionDescriptionNames, context), + }), + ...(input.OutputName !== undefined && input.OutputName !== null && { outputName: input.OutputName }), + ...(input.OutputSettings !== undefined && + input.OutputSettings !== null && { + outputSettings: serializeAws_restJson1OutputSettings(input.OutputSettings, context), + }), + ...(input.VideoDescriptionName !== undefined && + input.VideoDescriptionName !== null && { videoDescriptionName: input.VideoDescriptionName }), }; }; const serializeAws_restJson1OutputDestination = (input: OutputDestination, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { id: input.Id }), - ...(input.MediaPackageSettings !== undefined && { - mediaPackageSettings: serializeAws_restJson1__listOfMediaPackageOutputDestinationSettings( - input.MediaPackageSettings, - context - ), - }), - ...(input.MultiplexSettings !== undefined && { - multiplexSettings: serializeAws_restJson1MultiplexProgramChannelDestinationSettings( - input.MultiplexSettings, - context - ), - }), - ...(input.Settings !== undefined && { - settings: serializeAws_restJson1__listOfOutputDestinationSettings(input.Settings, context), - }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), + ...(input.MediaPackageSettings !== undefined && + input.MediaPackageSettings !== null && { + mediaPackageSettings: serializeAws_restJson1__listOfMediaPackageOutputDestinationSettings( + input.MediaPackageSettings, + context + ), + }), + ...(input.MultiplexSettings !== undefined && + input.MultiplexSettings !== null && { + multiplexSettings: serializeAws_restJson1MultiplexProgramChannelDestinationSettings( + input.MultiplexSettings, + context + ), + }), + ...(input.Settings !== undefined && + input.Settings !== null && { + settings: serializeAws_restJson1__listOfOutputDestinationSettings(input.Settings, context), + }), }; }; @@ -10648,96 +11098,115 @@ const serializeAws_restJson1OutputDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.PasswordParam !== undefined && { passwordParam: input.PasswordParam }), - ...(input.StreamName !== undefined && { streamName: input.StreamName }), - ...(input.Url !== undefined && { url: input.Url }), - ...(input.Username !== undefined && { username: input.Username }), + ...(input.PasswordParam !== undefined && input.PasswordParam !== null && { passwordParam: input.PasswordParam }), + ...(input.StreamName !== undefined && input.StreamName !== null && { streamName: input.StreamName }), + ...(input.Url !== undefined && input.Url !== null && { url: input.Url }), + ...(input.Username !== undefined && input.Username !== null && { username: input.Username }), }; }; const serializeAws_restJson1OutputGroup = (input: OutputGroup, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { name: input.Name }), - ...(input.OutputGroupSettings !== undefined && { - outputGroupSettings: serializeAws_restJson1OutputGroupSettings(input.OutputGroupSettings, context), - }), - ...(input.Outputs !== undefined && { outputs: serializeAws_restJson1__listOfOutput(input.Outputs, context) }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.OutputGroupSettings !== undefined && + input.OutputGroupSettings !== null && { + outputGroupSettings: serializeAws_restJson1OutputGroupSettings(input.OutputGroupSettings, context), + }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { outputs: serializeAws_restJson1__listOfOutput(input.Outputs, context) }), }; }; const serializeAws_restJson1OutputGroupSettings = (input: OutputGroupSettings, context: __SerdeContext): any => { return { - ...(input.ArchiveGroupSettings !== undefined && { - archiveGroupSettings: serializeAws_restJson1ArchiveGroupSettings(input.ArchiveGroupSettings, context), - }), - ...(input.FrameCaptureGroupSettings !== undefined && { - frameCaptureGroupSettings: serializeAws_restJson1FrameCaptureGroupSettings( - input.FrameCaptureGroupSettings, - context - ), - }), - ...(input.HlsGroupSettings !== undefined && { - hlsGroupSettings: serializeAws_restJson1HlsGroupSettings(input.HlsGroupSettings, context), - }), - ...(input.MediaPackageGroupSettings !== undefined && { - mediaPackageGroupSettings: serializeAws_restJson1MediaPackageGroupSettings( - input.MediaPackageGroupSettings, - context - ), - }), - ...(input.MsSmoothGroupSettings !== undefined && { - msSmoothGroupSettings: serializeAws_restJson1MsSmoothGroupSettings(input.MsSmoothGroupSettings, context), - }), - ...(input.MultiplexGroupSettings !== undefined && { - multiplexGroupSettings: serializeAws_restJson1MultiplexGroupSettings(input.MultiplexGroupSettings, context), - }), - ...(input.RtmpGroupSettings !== undefined && { - rtmpGroupSettings: serializeAws_restJson1RtmpGroupSettings(input.RtmpGroupSettings, context), - }), - ...(input.UdpGroupSettings !== undefined && { - udpGroupSettings: serializeAws_restJson1UdpGroupSettings(input.UdpGroupSettings, context), - }), + ...(input.ArchiveGroupSettings !== undefined && + input.ArchiveGroupSettings !== null && { + archiveGroupSettings: serializeAws_restJson1ArchiveGroupSettings(input.ArchiveGroupSettings, context), + }), + ...(input.FrameCaptureGroupSettings !== undefined && + input.FrameCaptureGroupSettings !== null && { + frameCaptureGroupSettings: serializeAws_restJson1FrameCaptureGroupSettings( + input.FrameCaptureGroupSettings, + context + ), + }), + ...(input.HlsGroupSettings !== undefined && + input.HlsGroupSettings !== null && { + hlsGroupSettings: serializeAws_restJson1HlsGroupSettings(input.HlsGroupSettings, context), + }), + ...(input.MediaPackageGroupSettings !== undefined && + input.MediaPackageGroupSettings !== null && { + mediaPackageGroupSettings: serializeAws_restJson1MediaPackageGroupSettings( + input.MediaPackageGroupSettings, + context + ), + }), + ...(input.MsSmoothGroupSettings !== undefined && + input.MsSmoothGroupSettings !== null && { + msSmoothGroupSettings: serializeAws_restJson1MsSmoothGroupSettings(input.MsSmoothGroupSettings, context), + }), + ...(input.MultiplexGroupSettings !== undefined && + input.MultiplexGroupSettings !== null && { + multiplexGroupSettings: serializeAws_restJson1MultiplexGroupSettings(input.MultiplexGroupSettings, context), + }), + ...(input.RtmpGroupSettings !== undefined && + input.RtmpGroupSettings !== null && { + rtmpGroupSettings: serializeAws_restJson1RtmpGroupSettings(input.RtmpGroupSettings, context), + }), + ...(input.UdpGroupSettings !== undefined && + input.UdpGroupSettings !== null && { + udpGroupSettings: serializeAws_restJson1UdpGroupSettings(input.UdpGroupSettings, context), + }), }; }; const serializeAws_restJson1OutputLocationRef = (input: OutputLocationRef, context: __SerdeContext): any => { return { - ...(input.DestinationRefId !== undefined && { destinationRefId: input.DestinationRefId }), + ...(input.DestinationRefId !== undefined && + input.DestinationRefId !== null && { destinationRefId: input.DestinationRefId }), }; }; const serializeAws_restJson1OutputSettings = (input: OutputSettings, context: __SerdeContext): any => { return { - ...(input.ArchiveOutputSettings !== undefined && { - archiveOutputSettings: serializeAws_restJson1ArchiveOutputSettings(input.ArchiveOutputSettings, context), - }), - ...(input.FrameCaptureOutputSettings !== undefined && { - frameCaptureOutputSettings: serializeAws_restJson1FrameCaptureOutputSettings( - input.FrameCaptureOutputSettings, - context - ), - }), - ...(input.HlsOutputSettings !== undefined && { - hlsOutputSettings: serializeAws_restJson1HlsOutputSettings(input.HlsOutputSettings, context), - }), - ...(input.MediaPackageOutputSettings !== undefined && { - mediaPackageOutputSettings: serializeAws_restJson1MediaPackageOutputSettings( - input.MediaPackageOutputSettings, - context - ), - }), - ...(input.MsSmoothOutputSettings !== undefined && { - msSmoothOutputSettings: serializeAws_restJson1MsSmoothOutputSettings(input.MsSmoothOutputSettings, context), - }), - ...(input.MultiplexOutputSettings !== undefined && { - multiplexOutputSettings: serializeAws_restJson1MultiplexOutputSettings(input.MultiplexOutputSettings, context), - }), - ...(input.RtmpOutputSettings !== undefined && { - rtmpOutputSettings: serializeAws_restJson1RtmpOutputSettings(input.RtmpOutputSettings, context), - }), - ...(input.UdpOutputSettings !== undefined && { - udpOutputSettings: serializeAws_restJson1UdpOutputSettings(input.UdpOutputSettings, context), - }), + ...(input.ArchiveOutputSettings !== undefined && + input.ArchiveOutputSettings !== null && { + archiveOutputSettings: serializeAws_restJson1ArchiveOutputSettings(input.ArchiveOutputSettings, context), + }), + ...(input.FrameCaptureOutputSettings !== undefined && + input.FrameCaptureOutputSettings !== null && { + frameCaptureOutputSettings: serializeAws_restJson1FrameCaptureOutputSettings( + input.FrameCaptureOutputSettings, + context + ), + }), + ...(input.HlsOutputSettings !== undefined && + input.HlsOutputSettings !== null && { + hlsOutputSettings: serializeAws_restJson1HlsOutputSettings(input.HlsOutputSettings, context), + }), + ...(input.MediaPackageOutputSettings !== undefined && + input.MediaPackageOutputSettings !== null && { + mediaPackageOutputSettings: serializeAws_restJson1MediaPackageOutputSettings( + input.MediaPackageOutputSettings, + context + ), + }), + ...(input.MsSmoothOutputSettings !== undefined && + input.MsSmoothOutputSettings !== null && { + msSmoothOutputSettings: serializeAws_restJson1MsSmoothOutputSettings(input.MsSmoothOutputSettings, context), + }), + ...(input.MultiplexOutputSettings !== undefined && + input.MultiplexOutputSettings !== null && { + multiplexOutputSettings: serializeAws_restJson1MultiplexOutputSettings(input.MultiplexOutputSettings, context), + }), + ...(input.RtmpOutputSettings !== undefined && + input.RtmpOutputSettings !== null && { + rtmpOutputSettings: serializeAws_restJson1RtmpOutputSettings(input.RtmpOutputSettings, context), + }), + ...(input.UdpOutputSettings !== undefined && + input.UdpOutputSettings !== null && { + udpOutputSettings: serializeAws_restJson1UdpOutputSettings(input.UdpOutputSettings, context), + }), }; }; @@ -10750,9 +11219,10 @@ const serializeAws_restJson1PauseStateScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.Pipelines !== undefined && { - pipelines: serializeAws_restJson1__listOfPipelinePauseStateSettings(input.Pipelines, context), - }), + ...(input.Pipelines !== undefined && + input.Pipelines !== null && { + pipelines: serializeAws_restJson1__listOfPipelinePauseStateSettings(input.Pipelines, context), + }), }; }; @@ -10761,7 +11231,7 @@ const serializeAws_restJson1PipelinePauseStateSettings = ( context: __SerdeContext ): any => { return { - ...(input.PipelineId !== undefined && { pipelineId: input.PipelineId }), + ...(input.PipelineId !== undefined && input.PipelineId !== null && { pipelineId: input.PipelineId }), }; }; @@ -10779,11 +11249,12 @@ const serializeAws_restJson1Rec709Settings = (input: Rec709Settings, context: __ const serializeAws_restJson1RemixSettings = (input: RemixSettings, context: __SerdeContext): any => { return { - ...(input.ChannelMappings !== undefined && { - channelMappings: serializeAws_restJson1__listOfAudioChannelMapping(input.ChannelMappings, context), - }), - ...(input.ChannelsIn !== undefined && { channelsIn: input.ChannelsIn }), - ...(input.ChannelsOut !== undefined && { channelsOut: input.ChannelsOut }), + ...(input.ChannelMappings !== undefined && + input.ChannelMappings !== null && { + channelMappings: serializeAws_restJson1__listOfAudioChannelMapping(input.ChannelMappings, context), + }), + ...(input.ChannelsIn !== undefined && input.ChannelsIn !== null && { channelsIn: input.ChannelsIn }), + ...(input.ChannelsOut !== undefined && input.ChannelsOut !== null && { channelsOut: input.ChannelsOut }), }; }; @@ -10796,100 +11267,120 @@ const serializeAws_restJson1RtmpCaptionInfoDestinationSettings = ( const serializeAws_restJson1RtmpGroupSettings = (input: RtmpGroupSettings, context: __SerdeContext): any => { return { - ...(input.AdMarkers !== undefined && { - adMarkers: serializeAws_restJson1__listOfRtmpAdMarkers(input.AdMarkers, context), - }), - ...(input.AuthenticationScheme !== undefined && { authenticationScheme: input.AuthenticationScheme }), - ...(input.CacheFullBehavior !== undefined && { cacheFullBehavior: input.CacheFullBehavior }), - ...(input.CacheLength !== undefined && { cacheLength: input.CacheLength }), - ...(input.CaptionData !== undefined && { captionData: input.CaptionData }), - ...(input.InputLossAction !== undefined && { inputLossAction: input.InputLossAction }), - ...(input.RestartDelay !== undefined && { restartDelay: input.RestartDelay }), + ...(input.AdMarkers !== undefined && + input.AdMarkers !== null && { adMarkers: serializeAws_restJson1__listOfRtmpAdMarkers(input.AdMarkers, context) }), + ...(input.AuthenticationScheme !== undefined && + input.AuthenticationScheme !== null && { authenticationScheme: input.AuthenticationScheme }), + ...(input.CacheFullBehavior !== undefined && + input.CacheFullBehavior !== null && { cacheFullBehavior: input.CacheFullBehavior }), + ...(input.CacheLength !== undefined && input.CacheLength !== null && { cacheLength: input.CacheLength }), + ...(input.CaptionData !== undefined && input.CaptionData !== null && { captionData: input.CaptionData }), + ...(input.InputLossAction !== undefined && + input.InputLossAction !== null && { inputLossAction: input.InputLossAction }), + ...(input.RestartDelay !== undefined && input.RestartDelay !== null && { restartDelay: input.RestartDelay }), }; }; const serializeAws_restJson1RtmpOutputSettings = (input: RtmpOutputSettings, context: __SerdeContext): any => { return { - ...(input.CertificateMode !== undefined && { certificateMode: input.CertificateMode }), - ...(input.ConnectionRetryInterval !== undefined && { connectionRetryInterval: input.ConnectionRetryInterval }), - ...(input.Destination !== undefined && { - destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), - }), - ...(input.NumRetries !== undefined && { numRetries: input.NumRetries }), + ...(input.CertificateMode !== undefined && + input.CertificateMode !== null && { certificateMode: input.CertificateMode }), + ...(input.ConnectionRetryInterval !== undefined && + input.ConnectionRetryInterval !== null && { connectionRetryInterval: input.ConnectionRetryInterval }), + ...(input.Destination !== undefined && + input.Destination !== null && { + destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), + }), + ...(input.NumRetries !== undefined && input.NumRetries !== null && { numRetries: input.NumRetries }), }; }; const serializeAws_restJson1ScheduleAction = (input: ScheduleAction, context: __SerdeContext): any => { return { - ...(input.ActionName !== undefined && { actionName: input.ActionName }), - ...(input.ScheduleActionSettings !== undefined && { - scheduleActionSettings: serializeAws_restJson1ScheduleActionSettings(input.ScheduleActionSettings, context), - }), - ...(input.ScheduleActionStartSettings !== undefined && { - scheduleActionStartSettings: serializeAws_restJson1ScheduleActionStartSettings( - input.ScheduleActionStartSettings, - context - ), - }), + ...(input.ActionName !== undefined && input.ActionName !== null && { actionName: input.ActionName }), + ...(input.ScheduleActionSettings !== undefined && + input.ScheduleActionSettings !== null && { + scheduleActionSettings: serializeAws_restJson1ScheduleActionSettings(input.ScheduleActionSettings, context), + }), + ...(input.ScheduleActionStartSettings !== undefined && + input.ScheduleActionStartSettings !== null && { + scheduleActionStartSettings: serializeAws_restJson1ScheduleActionStartSettings( + input.ScheduleActionStartSettings, + context + ), + }), }; }; const serializeAws_restJson1ScheduleActionSettings = (input: ScheduleActionSettings, context: __SerdeContext): any => { return { - ...(input.HlsId3SegmentTaggingSettings !== undefined && { - hlsId3SegmentTaggingSettings: serializeAws_restJson1HlsId3SegmentTaggingScheduleActionSettings( - input.HlsId3SegmentTaggingSettings, - context - ), - }), - ...(input.HlsTimedMetadataSettings !== undefined && { - hlsTimedMetadataSettings: serializeAws_restJson1HlsTimedMetadataScheduleActionSettings( - input.HlsTimedMetadataSettings, - context - ), - }), - ...(input.InputPrepareSettings !== undefined && { - inputPrepareSettings: serializeAws_restJson1InputPrepareScheduleActionSettings( - input.InputPrepareSettings, - context - ), - }), - ...(input.InputSwitchSettings !== undefined && { - inputSwitchSettings: serializeAws_restJson1InputSwitchScheduleActionSettings(input.InputSwitchSettings, context), - }), - ...(input.PauseStateSettings !== undefined && { - pauseStateSettings: serializeAws_restJson1PauseStateScheduleActionSettings(input.PauseStateSettings, context), - }), - ...(input.Scte35ReturnToNetworkSettings !== undefined && { - scte35ReturnToNetworkSettings: serializeAws_restJson1Scte35ReturnToNetworkScheduleActionSettings( - input.Scte35ReturnToNetworkSettings, - context - ), - }), - ...(input.Scte35SpliceInsertSettings !== undefined && { - scte35SpliceInsertSettings: serializeAws_restJson1Scte35SpliceInsertScheduleActionSettings( - input.Scte35SpliceInsertSettings, - context - ), - }), - ...(input.Scte35TimeSignalSettings !== undefined && { - scte35TimeSignalSettings: serializeAws_restJson1Scte35TimeSignalScheduleActionSettings( - input.Scte35TimeSignalSettings, - context - ), - }), - ...(input.StaticImageActivateSettings !== undefined && { - staticImageActivateSettings: serializeAws_restJson1StaticImageActivateScheduleActionSettings( - input.StaticImageActivateSettings, - context - ), - }), - ...(input.StaticImageDeactivateSettings !== undefined && { - staticImageDeactivateSettings: serializeAws_restJson1StaticImageDeactivateScheduleActionSettings( - input.StaticImageDeactivateSettings, - context - ), - }), + ...(input.HlsId3SegmentTaggingSettings !== undefined && + input.HlsId3SegmentTaggingSettings !== null && { + hlsId3SegmentTaggingSettings: serializeAws_restJson1HlsId3SegmentTaggingScheduleActionSettings( + input.HlsId3SegmentTaggingSettings, + context + ), + }), + ...(input.HlsTimedMetadataSettings !== undefined && + input.HlsTimedMetadataSettings !== null && { + hlsTimedMetadataSettings: serializeAws_restJson1HlsTimedMetadataScheduleActionSettings( + input.HlsTimedMetadataSettings, + context + ), + }), + ...(input.InputPrepareSettings !== undefined && + input.InputPrepareSettings !== null && { + inputPrepareSettings: serializeAws_restJson1InputPrepareScheduleActionSettings( + input.InputPrepareSettings, + context + ), + }), + ...(input.InputSwitchSettings !== undefined && + input.InputSwitchSettings !== null && { + inputSwitchSettings: serializeAws_restJson1InputSwitchScheduleActionSettings( + input.InputSwitchSettings, + context + ), + }), + ...(input.PauseStateSettings !== undefined && + input.PauseStateSettings !== null && { + pauseStateSettings: serializeAws_restJson1PauseStateScheduleActionSettings(input.PauseStateSettings, context), + }), + ...(input.Scte35ReturnToNetworkSettings !== undefined && + input.Scte35ReturnToNetworkSettings !== null && { + scte35ReturnToNetworkSettings: serializeAws_restJson1Scte35ReturnToNetworkScheduleActionSettings( + input.Scte35ReturnToNetworkSettings, + context + ), + }), + ...(input.Scte35SpliceInsertSettings !== undefined && + input.Scte35SpliceInsertSettings !== null && { + scte35SpliceInsertSettings: serializeAws_restJson1Scte35SpliceInsertScheduleActionSettings( + input.Scte35SpliceInsertSettings, + context + ), + }), + ...(input.Scte35TimeSignalSettings !== undefined && + input.Scte35TimeSignalSettings !== null && { + scte35TimeSignalSettings: serializeAws_restJson1Scte35TimeSignalScheduleActionSettings( + input.Scte35TimeSignalSettings, + context + ), + }), + ...(input.StaticImageActivateSettings !== undefined && + input.StaticImageActivateSettings !== null && { + staticImageActivateSettings: serializeAws_restJson1StaticImageActivateScheduleActionSettings( + input.StaticImageActivateSettings, + context + ), + }), + ...(input.StaticImageDeactivateSettings !== undefined && + input.StaticImageDeactivateSettings !== null && { + staticImageDeactivateSettings: serializeAws_restJson1StaticImageDeactivateScheduleActionSettings( + input.StaticImageDeactivateSettings, + context + ), + }), }; }; @@ -10898,24 +11389,27 @@ const serializeAws_restJson1ScheduleActionStartSettings = ( context: __SerdeContext ): any => { return { - ...(input.FixedModeScheduleActionStartSettings !== undefined && { - fixedModeScheduleActionStartSettings: serializeAws_restJson1FixedModeScheduleActionStartSettings( - input.FixedModeScheduleActionStartSettings, - context - ), - }), - ...(input.FollowModeScheduleActionStartSettings !== undefined && { - followModeScheduleActionStartSettings: serializeAws_restJson1FollowModeScheduleActionStartSettings( - input.FollowModeScheduleActionStartSettings, - context - ), - }), - ...(input.ImmediateModeScheduleActionStartSettings !== undefined && { - immediateModeScheduleActionStartSettings: serializeAws_restJson1ImmediateModeScheduleActionStartSettings( - input.ImmediateModeScheduleActionStartSettings, - context - ), - }), + ...(input.FixedModeScheduleActionStartSettings !== undefined && + input.FixedModeScheduleActionStartSettings !== null && { + fixedModeScheduleActionStartSettings: serializeAws_restJson1FixedModeScheduleActionStartSettings( + input.FixedModeScheduleActionStartSettings, + context + ), + }), + ...(input.FollowModeScheduleActionStartSettings !== undefined && + input.FollowModeScheduleActionStartSettings !== null && { + followModeScheduleActionStartSettings: serializeAws_restJson1FollowModeScheduleActionStartSettings( + input.FollowModeScheduleActionStartSettings, + context + ), + }), + ...(input.ImmediateModeScheduleActionStartSettings !== undefined && + input.ImmediateModeScheduleActionStartSettings !== null && { + immediateModeScheduleActionStartSettings: serializeAws_restJson1ImmediateModeScheduleActionStartSettings( + input.ImmediateModeScheduleActionStartSettings, + context + ), + }), }; }; @@ -10928,8 +11422,10 @@ const serializeAws_restJson1Scte20PlusEmbeddedDestinationSettings = ( const serializeAws_restJson1Scte20SourceSettings = (input: Scte20SourceSettings, context: __SerdeContext): any => { return { - ...(input.Convert608To708 !== undefined && { convert608To708: input.Convert608To708 }), - ...(input.Source608ChannelNumber !== undefined && { source608ChannelNumber: input.Source608ChannelNumber }), + ...(input.Convert608To708 !== undefined && + input.Convert608To708 !== null && { convert608To708: input.Convert608To708 }), + ...(input.Source608ChannelNumber !== undefined && + input.Source608ChannelNumber !== null && { source608ChannelNumber: input.Source608ChannelNumber }), }; }; @@ -10942,7 +11438,7 @@ const serializeAws_restJson1Scte27DestinationSettings = ( const serializeAws_restJson1Scte27SourceSettings = (input: Scte27SourceSettings, context: __SerdeContext): any => { return { - ...(input.Pid !== undefined && { pid: input.Pid }), + ...(input.Pid !== undefined && input.Pid !== null && { pid: input.Pid }), }; }; @@ -10951,18 +11447,26 @@ const serializeAws_restJson1Scte35DeliveryRestrictions = ( context: __SerdeContext ): any => { return { - ...(input.ArchiveAllowedFlag !== undefined && { archiveAllowedFlag: input.ArchiveAllowedFlag }), - ...(input.DeviceRestrictions !== undefined && { deviceRestrictions: input.DeviceRestrictions }), - ...(input.NoRegionalBlackoutFlag !== undefined && { noRegionalBlackoutFlag: input.NoRegionalBlackoutFlag }), - ...(input.WebDeliveryAllowedFlag !== undefined && { webDeliveryAllowedFlag: input.WebDeliveryAllowedFlag }), + ...(input.ArchiveAllowedFlag !== undefined && + input.ArchiveAllowedFlag !== null && { archiveAllowedFlag: input.ArchiveAllowedFlag }), + ...(input.DeviceRestrictions !== undefined && + input.DeviceRestrictions !== null && { deviceRestrictions: input.DeviceRestrictions }), + ...(input.NoRegionalBlackoutFlag !== undefined && + input.NoRegionalBlackoutFlag !== null && { noRegionalBlackoutFlag: input.NoRegionalBlackoutFlag }), + ...(input.WebDeliveryAllowedFlag !== undefined && + input.WebDeliveryAllowedFlag !== null && { webDeliveryAllowedFlag: input.WebDeliveryAllowedFlag }), }; }; const serializeAws_restJson1Scte35Descriptor = (input: Scte35Descriptor, context: __SerdeContext): any => { return { - ...(input.Scte35DescriptorSettings !== undefined && { - scte35DescriptorSettings: serializeAws_restJson1Scte35DescriptorSettings(input.Scte35DescriptorSettings, context), - }), + ...(input.Scte35DescriptorSettings !== undefined && + input.Scte35DescriptorSettings !== null && { + scte35DescriptorSettings: serializeAws_restJson1Scte35DescriptorSettings( + input.Scte35DescriptorSettings, + context + ), + }), }; }; @@ -10971,12 +11475,13 @@ const serializeAws_restJson1Scte35DescriptorSettings = ( context: __SerdeContext ): any => { return { - ...(input.SegmentationDescriptorScte35DescriptorSettings !== undefined && { - segmentationDescriptorScte35DescriptorSettings: serializeAws_restJson1Scte35SegmentationDescriptor( - input.SegmentationDescriptorScte35DescriptorSettings, - context - ), - }), + ...(input.SegmentationDescriptorScte35DescriptorSettings !== undefined && + input.SegmentationDescriptorScte35DescriptorSettings !== null && { + segmentationDescriptorScte35DescriptorSettings: serializeAws_restJson1Scte35SegmentationDescriptor( + input.SegmentationDescriptorScte35DescriptorSettings, + context + ), + }), }; }; @@ -10985,7 +11490,7 @@ const serializeAws_restJson1Scte35ReturnToNetworkScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.SpliceEventId !== undefined && { spliceEventId: input.SpliceEventId }), + ...(input.SpliceEventId !== undefined && input.SpliceEventId !== null && { spliceEventId: input.SpliceEventId }), }; }; @@ -10994,29 +11499,38 @@ const serializeAws_restJson1Scte35SegmentationDescriptor = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryRestrictions !== undefined && { - deliveryRestrictions: serializeAws_restJson1Scte35DeliveryRestrictions(input.DeliveryRestrictions, context), - }), - ...(input.SegmentNum !== undefined && { segmentNum: input.SegmentNum }), - ...(input.SegmentationCancelIndicator !== undefined && { - segmentationCancelIndicator: input.SegmentationCancelIndicator, - }), - ...(input.SegmentationDuration !== undefined && { segmentationDuration: input.SegmentationDuration }), - ...(input.SegmentationEventId !== undefined && { segmentationEventId: input.SegmentationEventId }), - ...(input.SegmentationTypeId !== undefined && { segmentationTypeId: input.SegmentationTypeId }), - ...(input.SegmentationUpid !== undefined && { segmentationUpid: input.SegmentationUpid }), - ...(input.SegmentationUpidType !== undefined && { segmentationUpidType: input.SegmentationUpidType }), - ...(input.SegmentsExpected !== undefined && { segmentsExpected: input.SegmentsExpected }), - ...(input.SubSegmentNum !== undefined && { subSegmentNum: input.SubSegmentNum }), - ...(input.SubSegmentsExpected !== undefined && { subSegmentsExpected: input.SubSegmentsExpected }), + ...(input.DeliveryRestrictions !== undefined && + input.DeliveryRestrictions !== null && { + deliveryRestrictions: serializeAws_restJson1Scte35DeliveryRestrictions(input.DeliveryRestrictions, context), + }), + ...(input.SegmentNum !== undefined && input.SegmentNum !== null && { segmentNum: input.SegmentNum }), + ...(input.SegmentationCancelIndicator !== undefined && + input.SegmentationCancelIndicator !== null && { segmentationCancelIndicator: input.SegmentationCancelIndicator }), + ...(input.SegmentationDuration !== undefined && + input.SegmentationDuration !== null && { segmentationDuration: input.SegmentationDuration }), + ...(input.SegmentationEventId !== undefined && + input.SegmentationEventId !== null && { segmentationEventId: input.SegmentationEventId }), + ...(input.SegmentationTypeId !== undefined && + input.SegmentationTypeId !== null && { segmentationTypeId: input.SegmentationTypeId }), + ...(input.SegmentationUpid !== undefined && + input.SegmentationUpid !== null && { segmentationUpid: input.SegmentationUpid }), + ...(input.SegmentationUpidType !== undefined && + input.SegmentationUpidType !== null && { segmentationUpidType: input.SegmentationUpidType }), + ...(input.SegmentsExpected !== undefined && + input.SegmentsExpected !== null && { segmentsExpected: input.SegmentsExpected }), + ...(input.SubSegmentNum !== undefined && input.SubSegmentNum !== null && { subSegmentNum: input.SubSegmentNum }), + ...(input.SubSegmentsExpected !== undefined && + input.SubSegmentsExpected !== null && { subSegmentsExpected: input.SubSegmentsExpected }), }; }; const serializeAws_restJson1Scte35SpliceInsert = (input: Scte35SpliceInsert, context: __SerdeContext): any => { return { - ...(input.AdAvailOffset !== undefined && { adAvailOffset: input.AdAvailOffset }), - ...(input.NoRegionalBlackoutFlag !== undefined && { noRegionalBlackoutFlag: input.NoRegionalBlackoutFlag }), - ...(input.WebDeliveryAllowedFlag !== undefined && { webDeliveryAllowedFlag: input.WebDeliveryAllowedFlag }), + ...(input.AdAvailOffset !== undefined && input.AdAvailOffset !== null && { adAvailOffset: input.AdAvailOffset }), + ...(input.NoRegionalBlackoutFlag !== undefined && + input.NoRegionalBlackoutFlag !== null && { noRegionalBlackoutFlag: input.NoRegionalBlackoutFlag }), + ...(input.WebDeliveryAllowedFlag !== undefined && + input.WebDeliveryAllowedFlag !== null && { webDeliveryAllowedFlag: input.WebDeliveryAllowedFlag }), }; }; @@ -11025,16 +11539,18 @@ const serializeAws_restJson1Scte35SpliceInsertScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.Duration !== undefined && { duration: input.Duration }), - ...(input.SpliceEventId !== undefined && { spliceEventId: input.SpliceEventId }), + ...(input.Duration !== undefined && input.Duration !== null && { duration: input.Duration }), + ...(input.SpliceEventId !== undefined && input.SpliceEventId !== null && { spliceEventId: input.SpliceEventId }), }; }; const serializeAws_restJson1Scte35TimeSignalApos = (input: Scte35TimeSignalApos, context: __SerdeContext): any => { return { - ...(input.AdAvailOffset !== undefined && { adAvailOffset: input.AdAvailOffset }), - ...(input.NoRegionalBlackoutFlag !== undefined && { noRegionalBlackoutFlag: input.NoRegionalBlackoutFlag }), - ...(input.WebDeliveryAllowedFlag !== undefined && { webDeliveryAllowedFlag: input.WebDeliveryAllowedFlag }), + ...(input.AdAvailOffset !== undefined && input.AdAvailOffset !== null && { adAvailOffset: input.AdAvailOffset }), + ...(input.NoRegionalBlackoutFlag !== undefined && + input.NoRegionalBlackoutFlag !== null && { noRegionalBlackoutFlag: input.NoRegionalBlackoutFlag }), + ...(input.WebDeliveryAllowedFlag !== undefined && + input.WebDeliveryAllowedFlag !== null && { webDeliveryAllowedFlag: input.WebDeliveryAllowedFlag }), }; }; @@ -11043,9 +11559,10 @@ const serializeAws_restJson1Scte35TimeSignalScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.Scte35Descriptors !== undefined && { - scte35Descriptors: serializeAws_restJson1__listOfScte35Descriptor(input.Scte35Descriptors, context), - }), + ...(input.Scte35Descriptors !== undefined && + input.Scte35Descriptors !== null && { + scte35Descriptors: serializeAws_restJson1__listOfScte35Descriptor(input.Scte35Descriptors, context), + }), }; }; @@ -11058,16 +11575,16 @@ const serializeAws_restJson1SmpteTtDestinationSettings = ( const serializeAws_restJson1StandardHlsSettings = (input: StandardHlsSettings, context: __SerdeContext): any => { return { - ...(input.AudioRenditionSets !== undefined && { audioRenditionSets: input.AudioRenditionSets }), - ...(input.M3u8Settings !== undefined && { - m3u8Settings: serializeAws_restJson1M3u8Settings(input.M3u8Settings, context), - }), + ...(input.AudioRenditionSets !== undefined && + input.AudioRenditionSets !== null && { audioRenditionSets: input.AudioRenditionSets }), + ...(input.M3u8Settings !== undefined && + input.M3u8Settings !== null && { m3u8Settings: serializeAws_restJson1M3u8Settings(input.M3u8Settings, context) }), }; }; const serializeAws_restJson1StartTimecode = (input: StartTimecode, context: __SerdeContext): any => { return { - ...(input.Timecode !== undefined && { timecode: input.Timecode }), + ...(input.Timecode !== undefined && input.Timecode !== null && { timecode: input.Timecode }), }; }; @@ -11076,16 +11593,17 @@ const serializeAws_restJson1StaticImageActivateScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.Duration !== undefined && { duration: input.Duration }), - ...(input.FadeIn !== undefined && { fadeIn: input.FadeIn }), - ...(input.FadeOut !== undefined && { fadeOut: input.FadeOut }), - ...(input.Height !== undefined && { height: input.Height }), - ...(input.Image !== undefined && { image: serializeAws_restJson1InputLocation(input.Image, context) }), - ...(input.ImageX !== undefined && { imageX: input.ImageX }), - ...(input.ImageY !== undefined && { imageY: input.ImageY }), - ...(input.Layer !== undefined && { layer: input.Layer }), - ...(input.Opacity !== undefined && { opacity: input.Opacity }), - ...(input.Width !== undefined && { width: input.Width }), + ...(input.Duration !== undefined && input.Duration !== null && { duration: input.Duration }), + ...(input.FadeIn !== undefined && input.FadeIn !== null && { fadeIn: input.FadeIn }), + ...(input.FadeOut !== undefined && input.FadeOut !== null && { fadeOut: input.FadeOut }), + ...(input.Height !== undefined && input.Height !== null && { height: input.Height }), + ...(input.Image !== undefined && + input.Image !== null && { image: serializeAws_restJson1InputLocation(input.Image, context) }), + ...(input.ImageX !== undefined && input.ImageX !== null && { imageX: input.ImageX }), + ...(input.ImageY !== undefined && input.ImageY !== null && { imageY: input.ImageY }), + ...(input.Layer !== undefined && input.Layer !== null && { layer: input.Layer }), + ...(input.Opacity !== undefined && input.Opacity !== null && { opacity: input.Opacity }), + ...(input.Width !== undefined && input.Width !== null && { width: input.Width }), }; }; @@ -11094,37 +11612,40 @@ const serializeAws_restJson1StaticImageDeactivateScheduleActionSettings = ( context: __SerdeContext ): any => { return { - ...(input.FadeOut !== undefined && { fadeOut: input.FadeOut }), - ...(input.Layer !== undefined && { layer: input.Layer }), + ...(input.FadeOut !== undefined && input.FadeOut !== null && { fadeOut: input.FadeOut }), + ...(input.Layer !== undefined && input.Layer !== null && { layer: input.Layer }), }; }; const serializeAws_restJson1StaticKeySettings = (input: StaticKeySettings, context: __SerdeContext): any => { return { - ...(input.KeyProviderServer !== undefined && { - keyProviderServer: serializeAws_restJson1InputLocation(input.KeyProviderServer, context), - }), - ...(input.StaticKeyValue !== undefined && { staticKeyValue: input.StaticKeyValue }), + ...(input.KeyProviderServer !== undefined && + input.KeyProviderServer !== null && { + keyProviderServer: serializeAws_restJson1InputLocation(input.KeyProviderServer, context), + }), + ...(input.StaticKeyValue !== undefined && + input.StaticKeyValue !== null && { staticKeyValue: input.StaticKeyValue }), }; }; const serializeAws_restJson1StopTimecode = (input: StopTimecode, context: __SerdeContext): any => { return { - ...(input.LastFrameClippingBehavior !== undefined && { - lastFrameClippingBehavior: input.LastFrameClippingBehavior, - }), - ...(input.Timecode !== undefined && { timecode: input.Timecode }), + ...(input.LastFrameClippingBehavior !== undefined && + input.LastFrameClippingBehavior !== null && { lastFrameClippingBehavior: input.LastFrameClippingBehavior }), + ...(input.Timecode !== undefined && input.Timecode !== null && { timecode: input.Timecode }), }; }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TeletextDestinationSettings = ( @@ -11136,21 +11657,22 @@ const serializeAws_restJson1TeletextDestinationSettings = ( const serializeAws_restJson1TeletextSourceSettings = (input: TeletextSourceSettings, context: __SerdeContext): any => { return { - ...(input.PageNumber !== undefined && { pageNumber: input.PageNumber }), + ...(input.PageNumber !== undefined && input.PageNumber !== null && { pageNumber: input.PageNumber }), }; }; const serializeAws_restJson1TemporalFilterSettings = (input: TemporalFilterSettings, context: __SerdeContext): any => { return { - ...(input.PostFilterSharpening !== undefined && { postFilterSharpening: input.PostFilterSharpening }), - ...(input.Strength !== undefined && { strength: input.Strength }), + ...(input.PostFilterSharpening !== undefined && + input.PostFilterSharpening !== null && { postFilterSharpening: input.PostFilterSharpening }), + ...(input.Strength !== undefined && input.Strength !== null && { strength: input.Strength }), }; }; const serializeAws_restJson1TimecodeConfig = (input: TimecodeConfig, context: __SerdeContext): any => { return { - ...(input.Source !== undefined && { source: input.Source }), - ...(input.SyncThreshold !== undefined && { syncThreshold: input.SyncThreshold }), + ...(input.Source !== undefined && input.Source !== null && { source: input.Source }), + ...(input.SyncThreshold !== undefined && input.SyncThreshold !== null && { syncThreshold: input.SyncThreshold }), }; }; @@ -11159,38 +11681,43 @@ const serializeAws_restJson1TtmlDestinationSettings = ( context: __SerdeContext ): any => { return { - ...(input.StyleControl !== undefined && { styleControl: input.StyleControl }), + ...(input.StyleControl !== undefined && input.StyleControl !== null && { styleControl: input.StyleControl }), }; }; const serializeAws_restJson1UdpContainerSettings = (input: UdpContainerSettings, context: __SerdeContext): any => { return { - ...(input.M2tsSettings !== undefined && { - m2tsSettings: serializeAws_restJson1M2tsSettings(input.M2tsSettings, context), - }), + ...(input.M2tsSettings !== undefined && + input.M2tsSettings !== null && { m2tsSettings: serializeAws_restJson1M2tsSettings(input.M2tsSettings, context) }), }; }; const serializeAws_restJson1UdpGroupSettings = (input: UdpGroupSettings, context: __SerdeContext): any => { return { - ...(input.InputLossAction !== undefined && { inputLossAction: input.InputLossAction }), - ...(input.TimedMetadataId3Frame !== undefined && { timedMetadataId3Frame: input.TimedMetadataId3Frame }), - ...(input.TimedMetadataId3Period !== undefined && { timedMetadataId3Period: input.TimedMetadataId3Period }), + ...(input.InputLossAction !== undefined && + input.InputLossAction !== null && { inputLossAction: input.InputLossAction }), + ...(input.TimedMetadataId3Frame !== undefined && + input.TimedMetadataId3Frame !== null && { timedMetadataId3Frame: input.TimedMetadataId3Frame }), + ...(input.TimedMetadataId3Period !== undefined && + input.TimedMetadataId3Period !== null && { timedMetadataId3Period: input.TimedMetadataId3Period }), }; }; const serializeAws_restJson1UdpOutputSettings = (input: UdpOutputSettings, context: __SerdeContext): any => { return { - ...(input.BufferMsec !== undefined && { bufferMsec: input.BufferMsec }), - ...(input.ContainerSettings !== undefined && { - containerSettings: serializeAws_restJson1UdpContainerSettings(input.ContainerSettings, context), - }), - ...(input.Destination !== undefined && { - destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), - }), - ...(input.FecOutputSettings !== undefined && { - fecOutputSettings: serializeAws_restJson1FecOutputSettings(input.FecOutputSettings, context), - }), + ...(input.BufferMsec !== undefined && input.BufferMsec !== null && { bufferMsec: input.BufferMsec }), + ...(input.ContainerSettings !== undefined && + input.ContainerSettings !== null && { + containerSettings: serializeAws_restJson1UdpContainerSettings(input.ContainerSettings, context), + }), + ...(input.Destination !== undefined && + input.Destination !== null && { + destination: serializeAws_restJson1OutputLocationRef(input.Destination, context), + }), + ...(input.FecOutputSettings !== undefined && + input.FecOutputSettings !== null && { + fecOutputSettings: serializeAws_restJson1FecOutputSettings(input.FecOutputSettings, context), + }), }; }; @@ -11199,80 +11726,88 @@ const serializeAws_restJson1VideoBlackFailoverSettings = ( context: __SerdeContext ): any => { return { - ...(input.BlackDetectThreshold !== undefined && { blackDetectThreshold: input.BlackDetectThreshold }), - ...(input.VideoBlackThresholdMsec !== undefined && { videoBlackThresholdMsec: input.VideoBlackThresholdMsec }), + ...(input.BlackDetectThreshold !== undefined && + input.BlackDetectThreshold !== null && { blackDetectThreshold: input.BlackDetectThreshold }), + ...(input.VideoBlackThresholdMsec !== undefined && + input.VideoBlackThresholdMsec !== null && { videoBlackThresholdMsec: input.VideoBlackThresholdMsec }), }; }; const serializeAws_restJson1VideoCodecSettings = (input: VideoCodecSettings, context: __SerdeContext): any => { return { - ...(input.FrameCaptureSettings !== undefined && { - frameCaptureSettings: serializeAws_restJson1FrameCaptureSettings(input.FrameCaptureSettings, context), - }), - ...(input.H264Settings !== undefined && { - h264Settings: serializeAws_restJson1H264Settings(input.H264Settings, context), - }), - ...(input.H265Settings !== undefined && { - h265Settings: serializeAws_restJson1H265Settings(input.H265Settings, context), - }), - ...(input.Mpeg2Settings !== undefined && { - mpeg2Settings: serializeAws_restJson1Mpeg2Settings(input.Mpeg2Settings, context), - }), + ...(input.FrameCaptureSettings !== undefined && + input.FrameCaptureSettings !== null && { + frameCaptureSettings: serializeAws_restJson1FrameCaptureSettings(input.FrameCaptureSettings, context), + }), + ...(input.H264Settings !== undefined && + input.H264Settings !== null && { h264Settings: serializeAws_restJson1H264Settings(input.H264Settings, context) }), + ...(input.H265Settings !== undefined && + input.H265Settings !== null && { h265Settings: serializeAws_restJson1H265Settings(input.H265Settings, context) }), + ...(input.Mpeg2Settings !== undefined && + input.Mpeg2Settings !== null && { + mpeg2Settings: serializeAws_restJson1Mpeg2Settings(input.Mpeg2Settings, context), + }), }; }; const serializeAws_restJson1VideoDescription = (input: VideoDescription, context: __SerdeContext): any => { return { - ...(input.CodecSettings !== undefined && { - codecSettings: serializeAws_restJson1VideoCodecSettings(input.CodecSettings, context), - }), - ...(input.Height !== undefined && { height: input.Height }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.RespondToAfd !== undefined && { respondToAfd: input.RespondToAfd }), - ...(input.ScalingBehavior !== undefined && { scalingBehavior: input.ScalingBehavior }), - ...(input.Sharpness !== undefined && { sharpness: input.Sharpness }), - ...(input.Width !== undefined && { width: input.Width }), + ...(input.CodecSettings !== undefined && + input.CodecSettings !== null && { + codecSettings: serializeAws_restJson1VideoCodecSettings(input.CodecSettings, context), + }), + ...(input.Height !== undefined && input.Height !== null && { height: input.Height }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.RespondToAfd !== undefined && input.RespondToAfd !== null && { respondToAfd: input.RespondToAfd }), + ...(input.ScalingBehavior !== undefined && + input.ScalingBehavior !== null && { scalingBehavior: input.ScalingBehavior }), + ...(input.Sharpness !== undefined && input.Sharpness !== null && { sharpness: input.Sharpness }), + ...(input.Width !== undefined && input.Width !== null && { width: input.Width }), }; }; const serializeAws_restJson1VideoSelector = (input: VideoSelector, context: __SerdeContext): any => { return { - ...(input.ColorSpace !== undefined && { colorSpace: input.ColorSpace }), - ...(input.ColorSpaceUsage !== undefined && { colorSpaceUsage: input.ColorSpaceUsage }), - ...(input.SelectorSettings !== undefined && { - selectorSettings: serializeAws_restJson1VideoSelectorSettings(input.SelectorSettings, context), - }), + ...(input.ColorSpace !== undefined && input.ColorSpace !== null && { colorSpace: input.ColorSpace }), + ...(input.ColorSpaceUsage !== undefined && + input.ColorSpaceUsage !== null && { colorSpaceUsage: input.ColorSpaceUsage }), + ...(input.SelectorSettings !== undefined && + input.SelectorSettings !== null && { + selectorSettings: serializeAws_restJson1VideoSelectorSettings(input.SelectorSettings, context), + }), }; }; const serializeAws_restJson1VideoSelectorPid = (input: VideoSelectorPid, context: __SerdeContext): any => { return { - ...(input.Pid !== undefined && { pid: input.Pid }), + ...(input.Pid !== undefined && input.Pid !== null && { pid: input.Pid }), }; }; const serializeAws_restJson1VideoSelectorProgramId = (input: VideoSelectorProgramId, context: __SerdeContext): any => { return { - ...(input.ProgramId !== undefined && { programId: input.ProgramId }), + ...(input.ProgramId !== undefined && input.ProgramId !== null && { programId: input.ProgramId }), }; }; const serializeAws_restJson1VideoSelectorSettings = (input: VideoSelectorSettings, context: __SerdeContext): any => { return { - ...(input.VideoSelectorPid !== undefined && { - videoSelectorPid: serializeAws_restJson1VideoSelectorPid(input.VideoSelectorPid, context), - }), - ...(input.VideoSelectorProgramId !== undefined && { - videoSelectorProgramId: serializeAws_restJson1VideoSelectorProgramId(input.VideoSelectorProgramId, context), - }), + ...(input.VideoSelectorPid !== undefined && + input.VideoSelectorPid !== null && { + videoSelectorPid: serializeAws_restJson1VideoSelectorPid(input.VideoSelectorPid, context), + }), + ...(input.VideoSelectorProgramId !== undefined && + input.VideoSelectorProgramId !== null && { + videoSelectorProgramId: serializeAws_restJson1VideoSelectorProgramId(input.VideoSelectorProgramId, context), + }), }; }; const serializeAws_restJson1WavSettings = (input: WavSettings, context: __SerdeContext): any => { return { - ...(input.BitDepth !== undefined && { bitDepth: input.BitDepth }), - ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), - ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }), + ...(input.BitDepth !== undefined && input.BitDepth !== null && { bitDepth: input.BitDepth }), + ...(input.CodingMode !== undefined && input.CodingMode !== null && { codingMode: input.CodingMode }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { sampleRate: input.SampleRate }), }; }; @@ -11284,247 +11819,553 @@ const serializeAws_restJson1WebvttDestinationSettings = ( }; const deserializeAws_restJson1__listOf__integer = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfAudioChannelMapping = ( output: any, context: __SerdeContext ): AudioChannelMapping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AudioChannelMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AudioChannelMapping(entry, context); + }); }; const deserializeAws_restJson1__listOfAudioDescription = (output: any, context: __SerdeContext): AudioDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AudioDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AudioDescription(entry, context); + }); }; const deserializeAws_restJson1__listOfAudioSelector = (output: any, context: __SerdeContext): AudioSelector[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AudioSelector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AudioSelector(entry, context); + }); }; const deserializeAws_restJson1__listOfAudioTrack = (output: any, context: __SerdeContext): AudioTrack[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AudioTrack(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AudioTrack(entry, context); + }); }; const deserializeAws_restJson1__listOfBatchFailedResultModel = ( output: any, context: __SerdeContext ): BatchFailedResultModel[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchFailedResultModel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchFailedResultModel(entry, context); + }); }; const deserializeAws_restJson1__listOfBatchSuccessfulResultModel = ( output: any, context: __SerdeContext ): BatchSuccessfulResultModel[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BatchSuccessfulResultModel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchSuccessfulResultModel(entry, context); + }); }; const deserializeAws_restJson1__listOfCaptionDescription = ( output: any, context: __SerdeContext ): CaptionDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CaptionDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CaptionDescription(entry, context); + }); }; const deserializeAws_restJson1__listOfCaptionLanguageMapping = ( output: any, context: __SerdeContext ): CaptionLanguageMapping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CaptionLanguageMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CaptionLanguageMapping(entry, context); + }); }; const deserializeAws_restJson1__listOfCaptionSelector = (output: any, context: __SerdeContext): CaptionSelector[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CaptionSelector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CaptionSelector(entry, context); + }); }; const deserializeAws_restJson1__listOfChannelEgressEndpoint = ( output: any, context: __SerdeContext ): ChannelEgressEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelEgressEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelEgressEndpoint(entry, context); + }); }; const deserializeAws_restJson1__listOfChannelSummary = (output: any, context: __SerdeContext): ChannelSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ChannelSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ChannelSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfFailoverCondition = ( output: any, context: __SerdeContext ): FailoverCondition[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FailoverCondition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FailoverCondition(entry, context); + }); }; const deserializeAws_restJson1__listOfHlsAdMarkers = ( output: any, context: __SerdeContext ): (HlsAdMarkers | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfInput = (output: any, context: __SerdeContext): Input[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Input(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Input(entry, context); + }); }; const deserializeAws_restJson1__listOfInputAttachment = (output: any, context: __SerdeContext): InputAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputAttachment(entry, context); + }); }; const deserializeAws_restJson1__listOfInputChannelLevel = ( output: any, context: __SerdeContext ): InputChannelLevel[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputChannelLevel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputChannelLevel(entry, context); + }); }; const deserializeAws_restJson1__listOfInputDestination = (output: any, context: __SerdeContext): InputDestination[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputDestination(entry, context); + }); }; const deserializeAws_restJson1__listOfInputDeviceSettings = ( output: any, context: __SerdeContext ): InputDeviceSettings[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputDeviceSettings(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputDeviceSettings(entry, context); + }); }; const deserializeAws_restJson1__listOfInputDeviceSummary = ( output: any, context: __SerdeContext ): InputDeviceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputDeviceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputDeviceSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfInputSecurityGroup = ( output: any, context: __SerdeContext ): InputSecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputSecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputSecurityGroup(entry, context); + }); }; const deserializeAws_restJson1__listOfInputSource = (output: any, context: __SerdeContext): InputSource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputSource(entry, context); + }); }; const deserializeAws_restJson1__listOfInputWhitelistRule = ( output: any, context: __SerdeContext ): InputWhitelistRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputWhitelistRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputWhitelistRule(entry, context); + }); }; const deserializeAws_restJson1__listOfMediaConnectFlow = (output: any, context: __SerdeContext): MediaConnectFlow[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MediaConnectFlow(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MediaConnectFlow(entry, context); + }); }; const deserializeAws_restJson1__listOfMediaPackageOutputDestinationSettings = ( output: any, context: __SerdeContext ): MediaPackageOutputDestinationSettings[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1MediaPackageOutputDestinationSettings(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MediaPackageOutputDestinationSettings(entry, context); + }); }; const deserializeAws_restJson1__listOfMultiplexOutputDestination = ( output: any, context: __SerdeContext ): MultiplexOutputDestination[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MultiplexOutputDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MultiplexOutputDestination(entry, context); + }); }; const deserializeAws_restJson1__listOfMultiplexProgramPipelineDetail = ( output: any, context: __SerdeContext ): MultiplexProgramPipelineDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MultiplexProgramPipelineDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MultiplexProgramPipelineDetail(entry, context); + }); }; const deserializeAws_restJson1__listOfMultiplexProgramSummary = ( output: any, context: __SerdeContext ): MultiplexProgramSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MultiplexProgramSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MultiplexProgramSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfMultiplexSummary = (output: any, context: __SerdeContext): MultiplexSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MultiplexSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MultiplexSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfOffering = (output: any, context: __SerdeContext): Offering[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Offering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Offering(entry, context); + }); }; const deserializeAws_restJson1__listOfOutput = (output: any, context: __SerdeContext): Output[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Output(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Output(entry, context); + }); }; const deserializeAws_restJson1__listOfOutputDestination = ( output: any, context: __SerdeContext ): OutputDestination[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutputDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutputDestination(entry, context); + }); }; const deserializeAws_restJson1__listOfOutputDestinationSettings = ( output: any, context: __SerdeContext ): OutputDestinationSettings[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutputDestinationSettings(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutputDestinationSettings(entry, context); + }); }; const deserializeAws_restJson1__listOfOutputGroup = (output: any, context: __SerdeContext): OutputGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutputGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutputGroup(entry, context); + }); }; const deserializeAws_restJson1__listOfPipelineDetail = (output: any, context: __SerdeContext): PipelineDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PipelineDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PipelineDetail(entry, context); + }); }; const deserializeAws_restJson1__listOfPipelinePauseStateSettings = ( output: any, context: __SerdeContext ): PipelinePauseStateSettings[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PipelinePauseStateSettings(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PipelinePauseStateSettings(entry, context); + }); }; const deserializeAws_restJson1__listOfReservation = (output: any, context: __SerdeContext): Reservation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Reservation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Reservation(entry, context); + }); }; const deserializeAws_restJson1__listOfRtmpAdMarkers = ( output: any, context: __SerdeContext ): (RtmpAdMarkers | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfScheduleAction = (output: any, context: __SerdeContext): ScheduleAction[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ScheduleAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ScheduleAction(entry, context); + }); }; const deserializeAws_restJson1__listOfScte35Descriptor = (output: any, context: __SerdeContext): Scte35Descriptor[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Scte35Descriptor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Scte35Descriptor(entry, context); + }); }; const deserializeAws_restJson1__listOfTransferringInputDeviceSummary = ( output: any, context: __SerdeContext ): TransferringInputDeviceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TransferringInputDeviceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TransferringInputDeviceSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfValidationError = (output: any, context: __SerdeContext): ValidationError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ValidationError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ValidationError(entry, context); + }); }; const deserializeAws_restJson1__listOfVideoDescription = (output: any, context: __SerdeContext): VideoDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VideoDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VideoDescription(entry, context); + }); }; const deserializeAws_restJson1AacSettings = (output: any, context: __SerdeContext): AacSettings => { @@ -14717,13 +15558,15 @@ const deserializeAws_restJson1StopTimecode = (output: any, context: __SerdeConte }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TeletextDestinationSettings = ( @@ -14962,6 +15805,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-mediapackage-vod/protocols/Aws_restJson1.ts b/clients/client-mediapackage-vod/protocols/Aws_restJson1.ts index 6483eda31aa2..c6d5eae4228d 100644 --- a/clients/client-mediapackage-vod/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage-vod/protocols/Aws_restJson1.ts @@ -88,17 +88,18 @@ export const serializeAws_restJson1CreateAssetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/assets"; let body: any; body = JSON.stringify({ - ...(input.Id !== undefined && { id: input.Id }), - ...(input.PackagingGroupId !== undefined && { packagingGroupId: input.PackagingGroupId }), - ...(input.ResourceId !== undefined && { resourceId: input.ResourceId }), - ...(input.SourceArn !== undefined && { sourceArn: input.SourceArn }), - ...(input.SourceRoleArn !== undefined && { sourceRoleArn: input.SourceRoleArn }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), + ...(input.PackagingGroupId !== undefined && + input.PackagingGroupId !== null && { packagingGroupId: input.PackagingGroupId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { resourceId: input.ResourceId }), + ...(input.SourceArn !== undefined && input.SourceArn !== null && { sourceArn: input.SourceArn }), + ...(input.SourceRoleArn !== undefined && input.SourceRoleArn !== null && { sourceRoleArn: input.SourceRoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -117,22 +118,23 @@ export const serializeAws_restJson1CreatePackagingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/packaging_configurations"; let body: any; body = JSON.stringify({ - ...(input.CmafPackage !== undefined && { - cmafPackage: serializeAws_restJson1CmafPackage(input.CmafPackage, context), - }), - ...(input.DashPackage !== undefined && { - dashPackage: serializeAws_restJson1DashPackage(input.DashPackage, context), - }), - ...(input.HlsPackage !== undefined && { hlsPackage: serializeAws_restJson1HlsPackage(input.HlsPackage, context) }), - ...(input.Id !== undefined && { id: input.Id }), - ...(input.MssPackage !== undefined && { mssPackage: serializeAws_restJson1MssPackage(input.MssPackage, context) }), - ...(input.PackagingGroupId !== undefined && { packagingGroupId: input.PackagingGroupId }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.CmafPackage !== undefined && + input.CmafPackage !== null && { cmafPackage: serializeAws_restJson1CmafPackage(input.CmafPackage, context) }), + ...(input.DashPackage !== undefined && + input.DashPackage !== null && { dashPackage: serializeAws_restJson1DashPackage(input.DashPackage, context) }), + ...(input.HlsPackage !== undefined && + input.HlsPackage !== null && { hlsPackage: serializeAws_restJson1HlsPackage(input.HlsPackage, context) }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), + ...(input.MssPackage !== undefined && + input.MssPackage !== null && { mssPackage: serializeAws_restJson1MssPackage(input.MssPackage, context) }), + ...(input.PackagingGroupId !== undefined && + input.PackagingGroupId !== null && { packagingGroupId: input.PackagingGroupId }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -151,16 +153,17 @@ export const serializeAws_restJson1CreatePackagingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/packaging_groups"; let body: any; body = JSON.stringify({ - ...(input.Authorization !== undefined && { - authorization: serializeAws_restJson1Authorization(input.Authorization, context), - }), - ...(input.Id !== undefined && { id: input.Id }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Authorization !== undefined && + input.Authorization !== null && { + authorization: serializeAws_restJson1Authorization(input.Authorization, context), + }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -178,9 +181,7 @@ export const serializeAws_restJson1DeleteAssetCommand = async ( input: DeleteAssetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assets/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -208,9 +209,7 @@ export const serializeAws_restJson1DeletePackagingConfigurationCommand = async ( input: DeletePackagingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/packaging_configurations/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -238,9 +237,7 @@ export const serializeAws_restJson1DeletePackagingGroupCommand = async ( input: DeletePackagingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/packaging_groups/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -268,9 +265,7 @@ export const serializeAws_restJson1DescribeAssetCommand = async ( input: DescribeAssetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assets/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -298,9 +293,7 @@ export const serializeAws_restJson1DescribePackagingConfigurationCommand = async input: DescribePackagingConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/packaging_configurations/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -328,9 +321,7 @@ export const serializeAws_restJson1DescribePackagingGroupCommand = async ( input: DescribePackagingGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/packaging_groups/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -358,9 +349,7 @@ export const serializeAws_restJson1ListAssetsCommand = async ( input: ListAssetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/assets"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -385,9 +374,7 @@ export const serializeAws_restJson1ListPackagingConfigurationsCommand = async ( input: ListPackagingConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/packaging_configurations"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -412,9 +399,7 @@ export const serializeAws_restJson1ListPackagingGroupsCommand = async ( input: ListPackagingGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/packaging_groups"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -438,9 +423,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -469,7 +452,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -483,7 +466,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -501,9 +485,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -536,7 +518,7 @@ export const serializeAws_restJson1UpdatePackagingGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/packaging_groups/{Id}"; if (input.Id !== undefined) { @@ -550,9 +532,10 @@ export const serializeAws_restJson1UpdatePackagingGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Authorization !== undefined && { - authorization: serializeAws_restJson1Authorization(input.Authorization, context), - }), + ...(input.Authorization !== undefined && + input.Authorization !== null && { + authorization: serializeAws_restJson1Authorization(input.Authorization, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2211,245 +2194,372 @@ const serializeAws_restJson1__listOf__PeriodTriggersElement = ( input: (__PeriodTriggersElement | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfDashManifest = (input: DashManifest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DashManifest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DashManifest(entry, context); + }); }; const serializeAws_restJson1__listOfHlsManifest = (input: HlsManifest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1HlsManifest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1HlsManifest(entry, context); + }); }; const serializeAws_restJson1__listOfMssManifest = (input: MssManifest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1MssManifest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MssManifest(entry, context); + }); }; const serializeAws_restJson1__mapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Authorization = (input: Authorization, context: __SerdeContext): any => { return { - ...(input.CdnIdentifierSecret !== undefined && { cdnIdentifierSecret: input.CdnIdentifierSecret }), - ...(input.SecretsRoleArn !== undefined && { secretsRoleArn: input.SecretsRoleArn }), + ...(input.CdnIdentifierSecret !== undefined && + input.CdnIdentifierSecret !== null && { cdnIdentifierSecret: input.CdnIdentifierSecret }), + ...(input.SecretsRoleArn !== undefined && + input.SecretsRoleArn !== null && { secretsRoleArn: input.SecretsRoleArn }), }; }; const serializeAws_restJson1CmafEncryption = (input: CmafEncryption, context: __SerdeContext): any => { return { - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; const serializeAws_restJson1CmafPackage = (input: CmafPackage, context: __SerdeContext): any => { return { - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1CmafEncryption(input.Encryption, context), - }), - ...(input.HlsManifests !== undefined && { - hlsManifests: serializeAws_restJson1__listOfHlsManifest(input.HlsManifests, context), - }), - ...(input.SegmentDurationSeconds !== undefined && { segmentDurationSeconds: input.SegmentDurationSeconds }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1CmafEncryption(input.Encryption, context) }), + ...(input.HlsManifests !== undefined && + input.HlsManifests !== null && { + hlsManifests: serializeAws_restJson1__listOfHlsManifest(input.HlsManifests, context), + }), + ...(input.SegmentDurationSeconds !== undefined && + input.SegmentDurationSeconds !== null && { segmentDurationSeconds: input.SegmentDurationSeconds }), }; }; const serializeAws_restJson1DashEncryption = (input: DashEncryption, context: __SerdeContext): any => { return { - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; const serializeAws_restJson1DashManifest = (input: DashManifest, context: __SerdeContext): any => { return { - ...(input.ManifestLayout !== undefined && { manifestLayout: input.ManifestLayout }), - ...(input.ManifestName !== undefined && { manifestName: input.ManifestName }), - ...(input.MinBufferTimeSeconds !== undefined && { minBufferTimeSeconds: input.MinBufferTimeSeconds }), - ...(input.Profile !== undefined && { profile: input.Profile }), - ...(input.StreamSelection !== undefined && { - streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), - }), + ...(input.ManifestLayout !== undefined && + input.ManifestLayout !== null && { manifestLayout: input.ManifestLayout }), + ...(input.ManifestName !== undefined && input.ManifestName !== null && { manifestName: input.ManifestName }), + ...(input.MinBufferTimeSeconds !== undefined && + input.MinBufferTimeSeconds !== null && { minBufferTimeSeconds: input.MinBufferTimeSeconds }), + ...(input.Profile !== undefined && input.Profile !== null && { profile: input.Profile }), + ...(input.StreamSelection !== undefined && + input.StreamSelection !== null && { + streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), + }), }; }; const serializeAws_restJson1DashPackage = (input: DashPackage, context: __SerdeContext): any => { return { - ...(input.DashManifests !== undefined && { - dashManifests: serializeAws_restJson1__listOfDashManifest(input.DashManifests, context), - }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1DashEncryption(input.Encryption, context), - }), - ...(input.PeriodTriggers !== undefined && { - periodTriggers: serializeAws_restJson1__listOf__PeriodTriggersElement(input.PeriodTriggers, context), - }), - ...(input.SegmentDurationSeconds !== undefined && { segmentDurationSeconds: input.SegmentDurationSeconds }), - ...(input.SegmentTemplateFormat !== undefined && { segmentTemplateFormat: input.SegmentTemplateFormat }), + ...(input.DashManifests !== undefined && + input.DashManifests !== null && { + dashManifests: serializeAws_restJson1__listOfDashManifest(input.DashManifests, context), + }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1DashEncryption(input.Encryption, context) }), + ...(input.PeriodTriggers !== undefined && + input.PeriodTriggers !== null && { + periodTriggers: serializeAws_restJson1__listOf__PeriodTriggersElement(input.PeriodTriggers, context), + }), + ...(input.SegmentDurationSeconds !== undefined && + input.SegmentDurationSeconds !== null && { segmentDurationSeconds: input.SegmentDurationSeconds }), + ...(input.SegmentTemplateFormat !== undefined && + input.SegmentTemplateFormat !== null && { segmentTemplateFormat: input.SegmentTemplateFormat }), }; }; const serializeAws_restJson1HlsEncryption = (input: HlsEncryption, context: __SerdeContext): any => { return { - ...(input.ConstantInitializationVector !== undefined && { - constantInitializationVector: input.ConstantInitializationVector, - }), - ...(input.EncryptionMethod !== undefined && { encryptionMethod: input.EncryptionMethod }), - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.ConstantInitializationVector !== undefined && + input.ConstantInitializationVector !== null && { + constantInitializationVector: input.ConstantInitializationVector, + }), + ...(input.EncryptionMethod !== undefined && + input.EncryptionMethod !== null && { encryptionMethod: input.EncryptionMethod }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; const serializeAws_restJson1HlsManifest = (input: HlsManifest, context: __SerdeContext): any => { return { - ...(input.AdMarkers !== undefined && { adMarkers: input.AdMarkers }), - ...(input.IncludeIframeOnlyStream !== undefined && { includeIframeOnlyStream: input.IncludeIframeOnlyStream }), - ...(input.ManifestName !== undefined && { manifestName: input.ManifestName }), - ...(input.ProgramDateTimeIntervalSeconds !== undefined && { - programDateTimeIntervalSeconds: input.ProgramDateTimeIntervalSeconds, - }), - ...(input.RepeatExtXKey !== undefined && { repeatExtXKey: input.RepeatExtXKey }), - ...(input.StreamSelection !== undefined && { - streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), - }), + ...(input.AdMarkers !== undefined && input.AdMarkers !== null && { adMarkers: input.AdMarkers }), + ...(input.IncludeIframeOnlyStream !== undefined && + input.IncludeIframeOnlyStream !== null && { includeIframeOnlyStream: input.IncludeIframeOnlyStream }), + ...(input.ManifestName !== undefined && input.ManifestName !== null && { manifestName: input.ManifestName }), + ...(input.ProgramDateTimeIntervalSeconds !== undefined && + input.ProgramDateTimeIntervalSeconds !== null && { + programDateTimeIntervalSeconds: input.ProgramDateTimeIntervalSeconds, + }), + ...(input.RepeatExtXKey !== undefined && input.RepeatExtXKey !== null && { repeatExtXKey: input.RepeatExtXKey }), + ...(input.StreamSelection !== undefined && + input.StreamSelection !== null && { + streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), + }), }; }; const serializeAws_restJson1HlsPackage = (input: HlsPackage, context: __SerdeContext): any => { return { - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1HlsEncryption(input.Encryption, context), - }), - ...(input.HlsManifests !== undefined && { - hlsManifests: serializeAws_restJson1__listOfHlsManifest(input.HlsManifests, context), - }), - ...(input.SegmentDurationSeconds !== undefined && { segmentDurationSeconds: input.SegmentDurationSeconds }), - ...(input.UseAudioRenditionGroup !== undefined && { useAudioRenditionGroup: input.UseAudioRenditionGroup }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1HlsEncryption(input.Encryption, context) }), + ...(input.HlsManifests !== undefined && + input.HlsManifests !== null && { + hlsManifests: serializeAws_restJson1__listOfHlsManifest(input.HlsManifests, context), + }), + ...(input.SegmentDurationSeconds !== undefined && + input.SegmentDurationSeconds !== null && { segmentDurationSeconds: input.SegmentDurationSeconds }), + ...(input.UseAudioRenditionGroup !== undefined && + input.UseAudioRenditionGroup !== null && { useAudioRenditionGroup: input.UseAudioRenditionGroup }), }; }; const serializeAws_restJson1MssEncryption = (input: MssEncryption, context: __SerdeContext): any => { return { - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; const serializeAws_restJson1MssManifest = (input: MssManifest, context: __SerdeContext): any => { return { - ...(input.ManifestName !== undefined && { manifestName: input.ManifestName }), - ...(input.StreamSelection !== undefined && { - streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), - }), + ...(input.ManifestName !== undefined && input.ManifestName !== null && { manifestName: input.ManifestName }), + ...(input.StreamSelection !== undefined && + input.StreamSelection !== null && { + streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), + }), }; }; const serializeAws_restJson1MssPackage = (input: MssPackage, context: __SerdeContext): any => { return { - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1MssEncryption(input.Encryption, context), - }), - ...(input.MssManifests !== undefined && { - mssManifests: serializeAws_restJson1__listOfMssManifest(input.MssManifests, context), - }), - ...(input.SegmentDurationSeconds !== undefined && { segmentDurationSeconds: input.SegmentDurationSeconds }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1MssEncryption(input.Encryption, context) }), + ...(input.MssManifests !== undefined && + input.MssManifests !== null && { + mssManifests: serializeAws_restJson1__listOfMssManifest(input.MssManifests, context), + }), + ...(input.SegmentDurationSeconds !== undefined && + input.SegmentDurationSeconds !== null && { segmentDurationSeconds: input.SegmentDurationSeconds }), }; }; const serializeAws_restJson1SpekeKeyProvider = (input: SpekeKeyProvider, context: __SerdeContext): any => { return { - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), - ...(input.SystemIds !== undefined && { - systemIds: serializeAws_restJson1__listOf__string(input.SystemIds, context), - }), - ...(input.Url !== undefined && { url: input.Url }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), + ...(input.SystemIds !== undefined && + input.SystemIds !== null && { systemIds: serializeAws_restJson1__listOf__string(input.SystemIds, context) }), + ...(input.Url !== undefined && input.Url !== null && { url: input.Url }), }; }; const serializeAws_restJson1StreamSelection = (input: StreamSelection, context: __SerdeContext): any => { return { - ...(input.MaxVideoBitsPerSecond !== undefined && { maxVideoBitsPerSecond: input.MaxVideoBitsPerSecond }), - ...(input.MinVideoBitsPerSecond !== undefined && { minVideoBitsPerSecond: input.MinVideoBitsPerSecond }), - ...(input.StreamOrder !== undefined && { streamOrder: input.StreamOrder }), + ...(input.MaxVideoBitsPerSecond !== undefined && + input.MaxVideoBitsPerSecond !== null && { maxVideoBitsPerSecond: input.MaxVideoBitsPerSecond }), + ...(input.MinVideoBitsPerSecond !== undefined && + input.MinVideoBitsPerSecond !== null && { minVideoBitsPerSecond: input.MinVideoBitsPerSecond }), + ...(input.StreamOrder !== undefined && input.StreamOrder !== null && { streamOrder: input.StreamOrder }), }; }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1__listOf__PeriodTriggersElement = ( output: any, context: __SerdeContext ): (__PeriodTriggersElement | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfAssetShallow = (output: any, context: __SerdeContext): AssetShallow[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AssetShallow(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AssetShallow(entry, context); + }); }; const deserializeAws_restJson1__listOfDashManifest = (output: any, context: __SerdeContext): DashManifest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DashManifest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DashManifest(entry, context); + }); }; const deserializeAws_restJson1__listOfEgressEndpoint = (output: any, context: __SerdeContext): EgressEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EgressEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EgressEndpoint(entry, context); + }); }; const deserializeAws_restJson1__listOfHlsManifest = (output: any, context: __SerdeContext): HlsManifest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HlsManifest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HlsManifest(entry, context); + }); }; const deserializeAws_restJson1__listOfMssManifest = (output: any, context: __SerdeContext): MssManifest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MssManifest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MssManifest(entry, context); + }); }; const deserializeAws_restJson1__listOfPackagingConfiguration = ( output: any, context: __SerdeContext ): PackagingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PackagingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PackagingConfiguration(entry, context); + }); }; const deserializeAws_restJson1__listOfPackagingGroup = (output: any, context: __SerdeContext): PackagingGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PackagingGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PackagingGroup(entry, context); + }); }; const deserializeAws_restJson1__mapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AssetShallow = (output: any, context: __SerdeContext): AssetShallow => { @@ -2735,13 +2845,15 @@ const deserializeAws_restJson1StreamSelection = (output: any, context: __SerdeCo }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2764,6 +2876,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-mediapackage/protocols/Aws_restJson1.ts b/clients/client-mediapackage/protocols/Aws_restJson1.ts index cc93e74f1211..b75a15a69133 100644 --- a/clients/client-mediapackage/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage/protocols/Aws_restJson1.ts @@ -90,7 +90,7 @@ export const serializeAws_restJson1ConfigureLogsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels/{Id}/configure_logs"; if (input.Id !== undefined) { @@ -104,12 +104,14 @@ export const serializeAws_restJson1ConfigureLogsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.EgressAccessLogs !== undefined && { - egressAccessLogs: serializeAws_restJson1EgressAccessLogs(input.EgressAccessLogs, context), - }), - ...(input.IngressAccessLogs !== undefined && { - ingressAccessLogs: serializeAws_restJson1IngressAccessLogs(input.IngressAccessLogs, context), - }), + ...(input.EgressAccessLogs !== undefined && + input.EgressAccessLogs !== null && { + egressAccessLogs: serializeAws_restJson1EgressAccessLogs(input.EgressAccessLogs, context), + }), + ...(input.IngressAccessLogs !== undefined && + input.IngressAccessLogs !== null && { + ingressAccessLogs: serializeAws_restJson1IngressAccessLogs(input.IngressAccessLogs, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -128,14 +130,14 @@ export const serializeAws_restJson1CreateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { description: input.Description }), - ...(input.Id !== undefined && { id: input.Id }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -154,18 +156,20 @@ export const serializeAws_restJson1CreateHarvestJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/harvest_jobs"; let body: any; body = JSON.stringify({ - ...(input.EndTime !== undefined && { endTime: input.EndTime }), - ...(input.Id !== undefined && { id: input.Id }), - ...(input.OriginEndpointId !== undefined && { originEndpointId: input.OriginEndpointId }), - ...(input.S3Destination !== undefined && { - s3Destination: serializeAws_restJson1S3Destination(input.S3Destination, context), - }), - ...(input.StartTime !== undefined && { startTime: input.StartTime }), + ...(input.EndTime !== undefined && input.EndTime !== null && { endTime: input.EndTime }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), + ...(input.OriginEndpointId !== undefined && + input.OriginEndpointId !== null && { originEndpointId: input.OriginEndpointId }), + ...(input.S3Destination !== undefined && + input.S3Destination !== null && { + s3Destination: serializeAws_restJson1S3Destination(input.S3Destination, context), + }), + ...(input.StartTime !== undefined && input.StartTime !== null && { startTime: input.StartTime }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -184,33 +188,37 @@ export const serializeAws_restJson1CreateOriginEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/origin_endpoints"; let body: any; body = JSON.stringify({ - ...(input.Authorization !== undefined && { - authorization: serializeAws_restJson1Authorization(input.Authorization, context), - }), - ...(input.ChannelId !== undefined && { channelId: input.ChannelId }), - ...(input.CmafPackage !== undefined && { - cmafPackage: serializeAws_restJson1CmafPackageCreateOrUpdateParameters(input.CmafPackage, context), - }), - ...(input.DashPackage !== undefined && { - dashPackage: serializeAws_restJson1DashPackage(input.DashPackage, context), - }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.HlsPackage !== undefined && { hlsPackage: serializeAws_restJson1HlsPackage(input.HlsPackage, context) }), - ...(input.Id !== undefined && { id: input.Id }), - ...(input.ManifestName !== undefined && { manifestName: input.ManifestName }), - ...(input.MssPackage !== undefined && { mssPackage: serializeAws_restJson1MssPackage(input.MssPackage, context) }), - ...(input.Origination !== undefined && { origination: input.Origination }), - ...(input.StartoverWindowSeconds !== undefined && { startoverWindowSeconds: input.StartoverWindowSeconds }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.TimeDelaySeconds !== undefined && { timeDelaySeconds: input.TimeDelaySeconds }), - ...(input.Whitelist !== undefined && { - whitelist: serializeAws_restJson1__listOf__string(input.Whitelist, context), - }), + ...(input.Authorization !== undefined && + input.Authorization !== null && { + authorization: serializeAws_restJson1Authorization(input.Authorization, context), + }), + ...(input.ChannelId !== undefined && input.ChannelId !== null && { channelId: input.ChannelId }), + ...(input.CmafPackage !== undefined && + input.CmafPackage !== null && { + cmafPackage: serializeAws_restJson1CmafPackageCreateOrUpdateParameters(input.CmafPackage, context), + }), + ...(input.DashPackage !== undefined && + input.DashPackage !== null && { dashPackage: serializeAws_restJson1DashPackage(input.DashPackage, context) }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.HlsPackage !== undefined && + input.HlsPackage !== null && { hlsPackage: serializeAws_restJson1HlsPackage(input.HlsPackage, context) }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), + ...(input.ManifestName !== undefined && input.ManifestName !== null && { manifestName: input.ManifestName }), + ...(input.MssPackage !== undefined && + input.MssPackage !== null && { mssPackage: serializeAws_restJson1MssPackage(input.MssPackage, context) }), + ...(input.Origination !== undefined && input.Origination !== null && { origination: input.Origination }), + ...(input.StartoverWindowSeconds !== undefined && + input.StartoverWindowSeconds !== null && { startoverWindowSeconds: input.StartoverWindowSeconds }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.TimeDelaySeconds !== undefined && + input.TimeDelaySeconds !== null && { timeDelaySeconds: input.TimeDelaySeconds }), + ...(input.Whitelist !== undefined && + input.Whitelist !== null && { whitelist: serializeAws_restJson1__listOf__string(input.Whitelist, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -228,9 +236,7 @@ export const serializeAws_restJson1DeleteChannelCommand = async ( input: DeleteChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -258,9 +264,7 @@ export const serializeAws_restJson1DeleteOriginEndpointCommand = async ( input: DeleteOriginEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/origin_endpoints/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -288,9 +292,7 @@ export const serializeAws_restJson1DescribeChannelCommand = async ( input: DescribeChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -318,9 +320,7 @@ export const serializeAws_restJson1DescribeHarvestJobCommand = async ( input: DescribeHarvestJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/harvest_jobs/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -348,9 +348,7 @@ export const serializeAws_restJson1DescribeOriginEndpointCommand = async ( input: DescribeOriginEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/origin_endpoints/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -378,9 +376,7 @@ export const serializeAws_restJson1ListChannelsCommand = async ( input: ListChannelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -404,9 +400,7 @@ export const serializeAws_restJson1ListHarvestJobsCommand = async ( input: ListHarvestJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/harvest_jobs"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -432,9 +426,7 @@ export const serializeAws_restJson1ListOriginEndpointsCommand = async ( input: ListOriginEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/origin_endpoints"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -459,9 +451,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -489,9 +479,7 @@ export const serializeAws_restJson1RotateChannelCredentialsCommand = async ( input: RotateChannelCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{Id}/credentials"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -519,9 +507,7 @@ export const serializeAws_restJson1RotateIngestEndpointCredentialsCommand = asyn input: RotateIngestEndpointCredentialsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/channels/{Id}/ingest_endpoints/{IngestEndpointId}/credentials"; if (input.IngestEndpointId !== undefined) { const labelValue: string = input.IngestEndpointId; @@ -559,7 +545,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -573,7 +559,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -591,9 +578,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -626,7 +611,7 @@ export const serializeAws_restJson1UpdateChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/channels/{Id}"; if (input.Id !== undefined) { @@ -640,7 +625,7 @@ export const serializeAws_restJson1UpdateChannelCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { description: input.Description }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -659,7 +644,7 @@ export const serializeAws_restJson1UpdateOriginEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/origin_endpoints/{Id}"; if (input.Id !== undefined) { @@ -673,25 +658,29 @@ export const serializeAws_restJson1UpdateOriginEndpointCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Authorization !== undefined && { - authorization: serializeAws_restJson1Authorization(input.Authorization, context), - }), - ...(input.CmafPackage !== undefined && { - cmafPackage: serializeAws_restJson1CmafPackageCreateOrUpdateParameters(input.CmafPackage, context), - }), - ...(input.DashPackage !== undefined && { - dashPackage: serializeAws_restJson1DashPackage(input.DashPackage, context), - }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.HlsPackage !== undefined && { hlsPackage: serializeAws_restJson1HlsPackage(input.HlsPackage, context) }), - ...(input.ManifestName !== undefined && { manifestName: input.ManifestName }), - ...(input.MssPackage !== undefined && { mssPackage: serializeAws_restJson1MssPackage(input.MssPackage, context) }), - ...(input.Origination !== undefined && { origination: input.Origination }), - ...(input.StartoverWindowSeconds !== undefined && { startoverWindowSeconds: input.StartoverWindowSeconds }), - ...(input.TimeDelaySeconds !== undefined && { timeDelaySeconds: input.TimeDelaySeconds }), - ...(input.Whitelist !== undefined && { - whitelist: serializeAws_restJson1__listOf__string(input.Whitelist, context), - }), + ...(input.Authorization !== undefined && + input.Authorization !== null && { + authorization: serializeAws_restJson1Authorization(input.Authorization, context), + }), + ...(input.CmafPackage !== undefined && + input.CmafPackage !== null && { + cmafPackage: serializeAws_restJson1CmafPackageCreateOrUpdateParameters(input.CmafPackage, context), + }), + ...(input.DashPackage !== undefined && + input.DashPackage !== null && { dashPackage: serializeAws_restJson1DashPackage(input.DashPackage, context) }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.HlsPackage !== undefined && + input.HlsPackage !== null && { hlsPackage: serializeAws_restJson1HlsPackage(input.HlsPackage, context) }), + ...(input.ManifestName !== undefined && input.ManifestName !== null && { manifestName: input.ManifestName }), + ...(input.MssPackage !== undefined && + input.MssPackage !== null && { mssPackage: serializeAws_restJson1MssPackage(input.MssPackage, context) }), + ...(input.Origination !== undefined && input.Origination !== null && { origination: input.Origination }), + ...(input.StartoverWindowSeconds !== undefined && + input.StartoverWindowSeconds !== null && { startoverWindowSeconds: input.StartoverWindowSeconds }), + ...(input.TimeDelaySeconds !== undefined && + input.TimeDelaySeconds !== null && { timeDelaySeconds: input.TimeDelaySeconds }), + ...(input.Whitelist !== undefined && + input.Whitelist !== null && { whitelist: serializeAws_restJson1__listOf__string(input.Whitelist, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2856,49 +2845,81 @@ const serializeAws_restJson1__listOf__PeriodTriggersElement = ( input: (__PeriodTriggersElement | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfHlsManifestCreateOrUpdateParameters = ( input: HlsManifestCreateOrUpdateParameters[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1HlsManifestCreateOrUpdateParameters(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1HlsManifestCreateOrUpdateParameters(entry, context); + }); }; const serializeAws_restJson1__mapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AdTriggers = (input: (__AdTriggersElement | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Authorization = (input: Authorization, context: __SerdeContext): any => { return { - ...(input.CdnIdentifierSecret !== undefined && { cdnIdentifierSecret: input.CdnIdentifierSecret }), - ...(input.SecretsRoleArn !== undefined && { secretsRoleArn: input.SecretsRoleArn }), + ...(input.CdnIdentifierSecret !== undefined && + input.CdnIdentifierSecret !== null && { cdnIdentifierSecret: input.CdnIdentifierSecret }), + ...(input.SecretsRoleArn !== undefined && + input.SecretsRoleArn !== null && { secretsRoleArn: input.SecretsRoleArn }), }; }; const serializeAws_restJson1CmafEncryption = (input: CmafEncryption, context: __SerdeContext): any => { return { - ...(input.KeyRotationIntervalSeconds !== undefined && { - keyRotationIntervalSeconds: input.KeyRotationIntervalSeconds, - }), - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.KeyRotationIntervalSeconds !== undefined && + input.KeyRotationIntervalSeconds !== null && { keyRotationIntervalSeconds: input.KeyRotationIntervalSeconds }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; @@ -2907,80 +2928,92 @@ const serializeAws_restJson1CmafPackageCreateOrUpdateParameters = ( context: __SerdeContext ): any => { return { - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1CmafEncryption(input.Encryption, context), - }), - ...(input.HlsManifests !== undefined && { - hlsManifests: serializeAws_restJson1__listOfHlsManifestCreateOrUpdateParameters(input.HlsManifests, context), - }), - ...(input.SegmentDurationSeconds !== undefined && { segmentDurationSeconds: input.SegmentDurationSeconds }), - ...(input.SegmentPrefix !== undefined && { segmentPrefix: input.SegmentPrefix }), - ...(input.StreamSelection !== undefined && { - streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), - }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1CmafEncryption(input.Encryption, context) }), + ...(input.HlsManifests !== undefined && + input.HlsManifests !== null && { + hlsManifests: serializeAws_restJson1__listOfHlsManifestCreateOrUpdateParameters(input.HlsManifests, context), + }), + ...(input.SegmentDurationSeconds !== undefined && + input.SegmentDurationSeconds !== null && { segmentDurationSeconds: input.SegmentDurationSeconds }), + ...(input.SegmentPrefix !== undefined && input.SegmentPrefix !== null && { segmentPrefix: input.SegmentPrefix }), + ...(input.StreamSelection !== undefined && + input.StreamSelection !== null && { + streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), + }), }; }; const serializeAws_restJson1DashEncryption = (input: DashEncryption, context: __SerdeContext): any => { return { - ...(input.KeyRotationIntervalSeconds !== undefined && { - keyRotationIntervalSeconds: input.KeyRotationIntervalSeconds, - }), - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.KeyRotationIntervalSeconds !== undefined && + input.KeyRotationIntervalSeconds !== null && { keyRotationIntervalSeconds: input.KeyRotationIntervalSeconds }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; const serializeAws_restJson1DashPackage = (input: DashPackage, context: __SerdeContext): any => { return { - ...(input.AdTriggers !== undefined && { adTriggers: serializeAws_restJson1AdTriggers(input.AdTriggers, context) }), - ...(input.AdsOnDeliveryRestrictions !== undefined && { - adsOnDeliveryRestrictions: input.AdsOnDeliveryRestrictions, - }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1DashEncryption(input.Encryption, context), - }), - ...(input.ManifestLayout !== undefined && { manifestLayout: input.ManifestLayout }), - ...(input.ManifestWindowSeconds !== undefined && { manifestWindowSeconds: input.ManifestWindowSeconds }), - ...(input.MinBufferTimeSeconds !== undefined && { minBufferTimeSeconds: input.MinBufferTimeSeconds }), - ...(input.MinUpdatePeriodSeconds !== undefined && { minUpdatePeriodSeconds: input.MinUpdatePeriodSeconds }), - ...(input.PeriodTriggers !== undefined && { - periodTriggers: serializeAws_restJson1__listOf__PeriodTriggersElement(input.PeriodTriggers, context), - }), - ...(input.Profile !== undefined && { profile: input.Profile }), - ...(input.SegmentDurationSeconds !== undefined && { segmentDurationSeconds: input.SegmentDurationSeconds }), - ...(input.SegmentTemplateFormat !== undefined && { segmentTemplateFormat: input.SegmentTemplateFormat }), - ...(input.StreamSelection !== undefined && { - streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), - }), - ...(input.SuggestedPresentationDelaySeconds !== undefined && { - suggestedPresentationDelaySeconds: input.SuggestedPresentationDelaySeconds, - }), - ...(input.UtcTiming !== undefined && { utcTiming: input.UtcTiming }), - ...(input.UtcTimingUri !== undefined && { utcTimingUri: input.UtcTimingUri }), + ...(input.AdTriggers !== undefined && + input.AdTriggers !== null && { adTriggers: serializeAws_restJson1AdTriggers(input.AdTriggers, context) }), + ...(input.AdsOnDeliveryRestrictions !== undefined && + input.AdsOnDeliveryRestrictions !== null && { adsOnDeliveryRestrictions: input.AdsOnDeliveryRestrictions }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1DashEncryption(input.Encryption, context) }), + ...(input.ManifestLayout !== undefined && + input.ManifestLayout !== null && { manifestLayout: input.ManifestLayout }), + ...(input.ManifestWindowSeconds !== undefined && + input.ManifestWindowSeconds !== null && { manifestWindowSeconds: input.ManifestWindowSeconds }), + ...(input.MinBufferTimeSeconds !== undefined && + input.MinBufferTimeSeconds !== null && { minBufferTimeSeconds: input.MinBufferTimeSeconds }), + ...(input.MinUpdatePeriodSeconds !== undefined && + input.MinUpdatePeriodSeconds !== null && { minUpdatePeriodSeconds: input.MinUpdatePeriodSeconds }), + ...(input.PeriodTriggers !== undefined && + input.PeriodTriggers !== null && { + periodTriggers: serializeAws_restJson1__listOf__PeriodTriggersElement(input.PeriodTriggers, context), + }), + ...(input.Profile !== undefined && input.Profile !== null && { profile: input.Profile }), + ...(input.SegmentDurationSeconds !== undefined && + input.SegmentDurationSeconds !== null && { segmentDurationSeconds: input.SegmentDurationSeconds }), + ...(input.SegmentTemplateFormat !== undefined && + input.SegmentTemplateFormat !== null && { segmentTemplateFormat: input.SegmentTemplateFormat }), + ...(input.StreamSelection !== undefined && + input.StreamSelection !== null && { + streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), + }), + ...(input.SuggestedPresentationDelaySeconds !== undefined && + input.SuggestedPresentationDelaySeconds !== null && { + suggestedPresentationDelaySeconds: input.SuggestedPresentationDelaySeconds, + }), + ...(input.UtcTiming !== undefined && input.UtcTiming !== null && { utcTiming: input.UtcTiming }), + ...(input.UtcTimingUri !== undefined && input.UtcTimingUri !== null && { utcTimingUri: input.UtcTimingUri }), }; }; const serializeAws_restJson1EgressAccessLogs = (input: EgressAccessLogs, context: __SerdeContext): any => { return { - ...(input.LogGroupName !== undefined && { logGroupName: input.LogGroupName }), + ...(input.LogGroupName !== undefined && input.LogGroupName !== null && { logGroupName: input.LogGroupName }), }; }; const serializeAws_restJson1HlsEncryption = (input: HlsEncryption, context: __SerdeContext): any => { return { - ...(input.ConstantInitializationVector !== undefined && { - constantInitializationVector: input.ConstantInitializationVector, - }), - ...(input.EncryptionMethod !== undefined && { encryptionMethod: input.EncryptionMethod }), - ...(input.KeyRotationIntervalSeconds !== undefined && { - keyRotationIntervalSeconds: input.KeyRotationIntervalSeconds, - }), - ...(input.RepeatExtXKey !== undefined && { repeatExtXKey: input.RepeatExtXKey }), - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.ConstantInitializationVector !== undefined && + input.ConstantInitializationVector !== null && { + constantInitializationVector: input.ConstantInitializationVector, + }), + ...(input.EncryptionMethod !== undefined && + input.EncryptionMethod !== null && { encryptionMethod: input.EncryptionMethod }), + ...(input.KeyRotationIntervalSeconds !== undefined && + input.KeyRotationIntervalSeconds !== null && { keyRotationIntervalSeconds: input.KeyRotationIntervalSeconds }), + ...(input.RepeatExtXKey !== undefined && input.RepeatExtXKey !== null && { repeatExtXKey: input.RepeatExtXKey }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; @@ -2989,154 +3022,227 @@ const serializeAws_restJson1HlsManifestCreateOrUpdateParameters = ( context: __SerdeContext ): any => { return { - ...(input.AdMarkers !== undefined && { adMarkers: input.AdMarkers }), - ...(input.AdTriggers !== undefined && { adTriggers: serializeAws_restJson1AdTriggers(input.AdTriggers, context) }), - ...(input.AdsOnDeliveryRestrictions !== undefined && { - adsOnDeliveryRestrictions: input.AdsOnDeliveryRestrictions, - }), - ...(input.Id !== undefined && { id: input.Id }), - ...(input.IncludeIframeOnlyStream !== undefined && { includeIframeOnlyStream: input.IncludeIframeOnlyStream }), - ...(input.ManifestName !== undefined && { manifestName: input.ManifestName }), - ...(input.PlaylistType !== undefined && { playlistType: input.PlaylistType }), - ...(input.PlaylistWindowSeconds !== undefined && { playlistWindowSeconds: input.PlaylistWindowSeconds }), - ...(input.ProgramDateTimeIntervalSeconds !== undefined && { - programDateTimeIntervalSeconds: input.ProgramDateTimeIntervalSeconds, - }), + ...(input.AdMarkers !== undefined && input.AdMarkers !== null && { adMarkers: input.AdMarkers }), + ...(input.AdTriggers !== undefined && + input.AdTriggers !== null && { adTriggers: serializeAws_restJson1AdTriggers(input.AdTriggers, context) }), + ...(input.AdsOnDeliveryRestrictions !== undefined && + input.AdsOnDeliveryRestrictions !== null && { adsOnDeliveryRestrictions: input.AdsOnDeliveryRestrictions }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), + ...(input.IncludeIframeOnlyStream !== undefined && + input.IncludeIframeOnlyStream !== null && { includeIframeOnlyStream: input.IncludeIframeOnlyStream }), + ...(input.ManifestName !== undefined && input.ManifestName !== null && { manifestName: input.ManifestName }), + ...(input.PlaylistType !== undefined && input.PlaylistType !== null && { playlistType: input.PlaylistType }), + ...(input.PlaylistWindowSeconds !== undefined && + input.PlaylistWindowSeconds !== null && { playlistWindowSeconds: input.PlaylistWindowSeconds }), + ...(input.ProgramDateTimeIntervalSeconds !== undefined && + input.ProgramDateTimeIntervalSeconds !== null && { + programDateTimeIntervalSeconds: input.ProgramDateTimeIntervalSeconds, + }), }; }; const serializeAws_restJson1HlsPackage = (input: HlsPackage, context: __SerdeContext): any => { return { - ...(input.AdMarkers !== undefined && { adMarkers: input.AdMarkers }), - ...(input.AdTriggers !== undefined && { adTriggers: serializeAws_restJson1AdTriggers(input.AdTriggers, context) }), - ...(input.AdsOnDeliveryRestrictions !== undefined && { - adsOnDeliveryRestrictions: input.AdsOnDeliveryRestrictions, - }), - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1HlsEncryption(input.Encryption, context), - }), - ...(input.IncludeIframeOnlyStream !== undefined && { includeIframeOnlyStream: input.IncludeIframeOnlyStream }), - ...(input.PlaylistType !== undefined && { playlistType: input.PlaylistType }), - ...(input.PlaylistWindowSeconds !== undefined && { playlistWindowSeconds: input.PlaylistWindowSeconds }), - ...(input.ProgramDateTimeIntervalSeconds !== undefined && { - programDateTimeIntervalSeconds: input.ProgramDateTimeIntervalSeconds, - }), - ...(input.SegmentDurationSeconds !== undefined && { segmentDurationSeconds: input.SegmentDurationSeconds }), - ...(input.StreamSelection !== undefined && { - streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), - }), - ...(input.UseAudioRenditionGroup !== undefined && { useAudioRenditionGroup: input.UseAudioRenditionGroup }), + ...(input.AdMarkers !== undefined && input.AdMarkers !== null && { adMarkers: input.AdMarkers }), + ...(input.AdTriggers !== undefined && + input.AdTriggers !== null && { adTriggers: serializeAws_restJson1AdTriggers(input.AdTriggers, context) }), + ...(input.AdsOnDeliveryRestrictions !== undefined && + input.AdsOnDeliveryRestrictions !== null && { adsOnDeliveryRestrictions: input.AdsOnDeliveryRestrictions }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1HlsEncryption(input.Encryption, context) }), + ...(input.IncludeIframeOnlyStream !== undefined && + input.IncludeIframeOnlyStream !== null && { includeIframeOnlyStream: input.IncludeIframeOnlyStream }), + ...(input.PlaylistType !== undefined && input.PlaylistType !== null && { playlistType: input.PlaylistType }), + ...(input.PlaylistWindowSeconds !== undefined && + input.PlaylistWindowSeconds !== null && { playlistWindowSeconds: input.PlaylistWindowSeconds }), + ...(input.ProgramDateTimeIntervalSeconds !== undefined && + input.ProgramDateTimeIntervalSeconds !== null && { + programDateTimeIntervalSeconds: input.ProgramDateTimeIntervalSeconds, + }), + ...(input.SegmentDurationSeconds !== undefined && + input.SegmentDurationSeconds !== null && { segmentDurationSeconds: input.SegmentDurationSeconds }), + ...(input.StreamSelection !== undefined && + input.StreamSelection !== null && { + streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), + }), + ...(input.UseAudioRenditionGroup !== undefined && + input.UseAudioRenditionGroup !== null && { useAudioRenditionGroup: input.UseAudioRenditionGroup }), }; }; const serializeAws_restJson1IngressAccessLogs = (input: IngressAccessLogs, context: __SerdeContext): any => { return { - ...(input.LogGroupName !== undefined && { logGroupName: input.LogGroupName }), + ...(input.LogGroupName !== undefined && input.LogGroupName !== null && { logGroupName: input.LogGroupName }), }; }; const serializeAws_restJson1MssEncryption = (input: MssEncryption, context: __SerdeContext): any => { return { - ...(input.SpekeKeyProvider !== undefined && { - spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), - }), + ...(input.SpekeKeyProvider !== undefined && + input.SpekeKeyProvider !== null && { + spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context), + }), }; }; const serializeAws_restJson1MssPackage = (input: MssPackage, context: __SerdeContext): any => { return { - ...(input.Encryption !== undefined && { - encryption: serializeAws_restJson1MssEncryption(input.Encryption, context), - }), - ...(input.ManifestWindowSeconds !== undefined && { manifestWindowSeconds: input.ManifestWindowSeconds }), - ...(input.SegmentDurationSeconds !== undefined && { segmentDurationSeconds: input.SegmentDurationSeconds }), - ...(input.StreamSelection !== undefined && { - streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), - }), + ...(input.Encryption !== undefined && + input.Encryption !== null && { encryption: serializeAws_restJson1MssEncryption(input.Encryption, context) }), + ...(input.ManifestWindowSeconds !== undefined && + input.ManifestWindowSeconds !== null && { manifestWindowSeconds: input.ManifestWindowSeconds }), + ...(input.SegmentDurationSeconds !== undefined && + input.SegmentDurationSeconds !== null && { segmentDurationSeconds: input.SegmentDurationSeconds }), + ...(input.StreamSelection !== undefined && + input.StreamSelection !== null && { + streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context), + }), }; }; const serializeAws_restJson1S3Destination = (input: S3Destination, context: __SerdeContext): any => { return { - ...(input.BucketName !== undefined && { bucketName: input.BucketName }), - ...(input.ManifestKey !== undefined && { manifestKey: input.ManifestKey }), - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), + ...(input.BucketName !== undefined && input.BucketName !== null && { bucketName: input.BucketName }), + ...(input.ManifestKey !== undefined && input.ManifestKey !== null && { manifestKey: input.ManifestKey }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), }; }; const serializeAws_restJson1SpekeKeyProvider = (input: SpekeKeyProvider, context: __SerdeContext): any => { return { - ...(input.CertificateArn !== undefined && { certificateArn: input.CertificateArn }), - ...(input.ResourceId !== undefined && { resourceId: input.ResourceId }), - ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), - ...(input.SystemIds !== undefined && { - systemIds: serializeAws_restJson1__listOf__string(input.SystemIds, context), - }), - ...(input.Url !== undefined && { url: input.Url }), + ...(input.CertificateArn !== undefined && + input.CertificateArn !== null && { certificateArn: input.CertificateArn }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { resourceId: input.ResourceId }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { roleArn: input.RoleArn }), + ...(input.SystemIds !== undefined && + input.SystemIds !== null && { systemIds: serializeAws_restJson1__listOf__string(input.SystemIds, context) }), + ...(input.Url !== undefined && input.Url !== null && { url: input.Url }), }; }; const serializeAws_restJson1StreamSelection = (input: StreamSelection, context: __SerdeContext): any => { return { - ...(input.MaxVideoBitsPerSecond !== undefined && { maxVideoBitsPerSecond: input.MaxVideoBitsPerSecond }), - ...(input.MinVideoBitsPerSecond !== undefined && { minVideoBitsPerSecond: input.MinVideoBitsPerSecond }), - ...(input.StreamOrder !== undefined && { streamOrder: input.StreamOrder }), + ...(input.MaxVideoBitsPerSecond !== undefined && + input.MaxVideoBitsPerSecond !== null && { maxVideoBitsPerSecond: input.MaxVideoBitsPerSecond }), + ...(input.MinVideoBitsPerSecond !== undefined && + input.MinVideoBitsPerSecond !== null && { minVideoBitsPerSecond: input.MinVideoBitsPerSecond }), + ...(input.StreamOrder !== undefined && input.StreamOrder !== null && { streamOrder: input.StreamOrder }), }; }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1__listOf__PeriodTriggersElement = ( output: any, context: __SerdeContext ): (__PeriodTriggersElement | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfChannel = (output: any, context: __SerdeContext): Channel[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Channel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Channel(entry, context); + }); }; const deserializeAws_restJson1__listOfHarvestJob = (output: any, context: __SerdeContext): HarvestJob[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HarvestJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HarvestJob(entry, context); + }); }; const deserializeAws_restJson1__listOfHlsManifest = (output: any, context: __SerdeContext): HlsManifest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HlsManifest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HlsManifest(entry, context); + }); }; const deserializeAws_restJson1__listOfIngestEndpoint = (output: any, context: __SerdeContext): IngestEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IngestEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IngestEndpoint(entry, context); + }); }; const deserializeAws_restJson1__listOfOriginEndpoint = (output: any, context: __SerdeContext): OriginEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OriginEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OriginEndpoint(entry, context); + }); }; const deserializeAws_restJson1__mapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AdTriggers = (output: any, context: __SerdeContext): (__AdTriggersElement | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Authorization = (output: any, context: __SerdeContext): Authorization => { @@ -3524,13 +3630,15 @@ const deserializeAws_restJson1StreamSelection = (output: any, context: __SerdeCo }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -3553,6 +3661,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-mediastore-data/protocols/Aws_restJson1.ts b/clients/client-mediastore-data/protocols/Aws_restJson1.ts index a0056120bc0c..9260ecb41c0c 100644 --- a/clients/client-mediastore-data/protocols/Aws_restJson1.ts +++ b/clients/client-mediastore-data/protocols/Aws_restJson1.ts @@ -26,9 +26,7 @@ export const serializeAws_restJson1DeleteObjectCommand = async ( input: DeleteObjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{Path+}"; if (input.Path !== undefined) { const labelValue: string = input.Path; @@ -62,9 +60,7 @@ export const serializeAws_restJson1DescribeObjectCommand = async ( input: DescribeObjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{Path+}"; if (input.Path !== undefined) { const labelValue: string = input.Path; @@ -99,7 +95,6 @@ export const serializeAws_restJson1GetObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.Range) && { Range: input.Range! }), }; let resolvedPath = "/{Path+}"; @@ -135,9 +130,7 @@ export const serializeAws_restJson1ListItemsCommand = async ( input: ListItemsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/"; const query: any = { ...(input.Path !== undefined && { Path: input.Path }), @@ -163,7 +156,7 @@ export const serializeAws_restJson1PutObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", "x-amz-content-sha256": "UNSIGNED-PAYLOAD", ...(isSerializableHeaderValue(input.StorageClass) && { "x-amz-storage-class": input.StorageClass! }), ...(isSerializableHeaderValue(input.ContentType) && { "Content-Type": input.ContentType! }), @@ -679,7 +672,14 @@ const deserializeAws_restJson1Item = (output: any, context: __SerdeContext): Ite }; const deserializeAws_restJson1ItemList = (output: any, context: __SerdeContext): Item[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Item(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Item(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -702,6 +702,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-mediastore/protocols/Aws_json1_1.ts b/clients/client-mediastore/protocols/Aws_json1_1.ts index 5e70b7154b7e..912db99504cd 100644 --- a/clients/client-mediastore/protocols/Aws_json1_1.ts +++ b/clients/client-mediastore/protocols/Aws_json1_1.ts @@ -99,7 +99,7 @@ export const serializeAws_json1_1CreateContainerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.CreateContainer", }; let body: any; @@ -112,7 +112,7 @@ export const serializeAws_json1_1DeleteContainerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.DeleteContainer", }; let body: any; @@ -125,7 +125,7 @@ export const serializeAws_json1_1DeleteContainerPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.DeleteContainerPolicy", }; let body: any; @@ -138,7 +138,7 @@ export const serializeAws_json1_1DeleteCorsPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.DeleteCorsPolicy", }; let body: any; @@ -151,7 +151,7 @@ export const serializeAws_json1_1DeleteLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.DeleteLifecyclePolicy", }; let body: any; @@ -164,7 +164,7 @@ export const serializeAws_json1_1DeleteMetricPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.DeleteMetricPolicy", }; let body: any; @@ -177,7 +177,7 @@ export const serializeAws_json1_1DescribeContainerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.DescribeContainer", }; let body: any; @@ -190,7 +190,7 @@ export const serializeAws_json1_1GetContainerPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.GetContainerPolicy", }; let body: any; @@ -203,7 +203,7 @@ export const serializeAws_json1_1GetCorsPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.GetCorsPolicy", }; let body: any; @@ -216,7 +216,7 @@ export const serializeAws_json1_1GetLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.GetLifecyclePolicy", }; let body: any; @@ -229,7 +229,7 @@ export const serializeAws_json1_1GetMetricPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.GetMetricPolicy", }; let body: any; @@ -242,7 +242,7 @@ export const serializeAws_json1_1ListContainersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.ListContainers", }; let body: any; @@ -255,7 +255,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.ListTagsForResource", }; let body: any; @@ -268,7 +268,7 @@ export const serializeAws_json1_1PutContainerPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.PutContainerPolicy", }; let body: any; @@ -281,7 +281,7 @@ export const serializeAws_json1_1PutCorsPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.PutCorsPolicy", }; let body: any; @@ -294,7 +294,7 @@ export const serializeAws_json1_1PutLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.PutLifecyclePolicy", }; let body: any; @@ -307,7 +307,7 @@ export const serializeAws_json1_1PutMetricPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.PutMetricPolicy", }; let body: any; @@ -320,7 +320,7 @@ export const serializeAws_json1_1StartAccessLoggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.StartAccessLogging", }; let body: any; @@ -333,7 +333,7 @@ export const serializeAws_json1_1StopAccessLoggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.StopAccessLogging", }; let body: any; @@ -346,7 +346,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.TagResource", }; let body: any; @@ -359,7 +359,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MediaStore_20170901.UntagResource", }; let body: any; @@ -394,8 +394,7 @@ const deserializeAws_json1_1CreateContainerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -465,8 +464,7 @@ const deserializeAws_json1_1DeleteContainerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -536,8 +534,7 @@ const deserializeAws_json1_1DeleteContainerPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -615,8 +612,7 @@ const deserializeAws_json1_1DeleteCorsPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -694,8 +690,7 @@ const deserializeAws_json1_1DeleteLifecyclePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -773,8 +768,7 @@ const deserializeAws_json1_1DeleteMetricPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -852,8 +846,7 @@ const deserializeAws_json1_1DescribeContainerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerNotFoundException": case "com.amazonaws.mediastore#ContainerNotFoundException": @@ -915,8 +908,7 @@ const deserializeAws_json1_1GetContainerPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -994,8 +986,7 @@ const deserializeAws_json1_1GetCorsPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1073,8 +1064,7 @@ const deserializeAws_json1_1GetLifecyclePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1152,8 +1142,7 @@ const deserializeAws_json1_1GetMetricPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1231,8 +1220,7 @@ const deserializeAws_json1_1ListContainersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.mediastore#InternalServerError": @@ -1286,8 +1274,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1357,8 +1344,7 @@ const deserializeAws_json1_1PutContainerPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1428,8 +1414,7 @@ const deserializeAws_json1_1PutCorsPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1499,8 +1484,7 @@ const deserializeAws_json1_1PutLifecyclePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1570,8 +1554,7 @@ const deserializeAws_json1_1PutMetricPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1641,8 +1624,7 @@ const deserializeAws_json1_1StartAccessLoggingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1712,8 +1694,7 @@ const deserializeAws_json1_1StopAccessLoggingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1783,8 +1764,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1854,8 +1834,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": @@ -1989,49 +1968,81 @@ const deserializeAws_json1_1PolicyNotFoundExceptionResponse = async ( }; const serializeAws_json1_1AllowedHeaders = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AllowedMethods = (input: (MethodName | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AllowedOrigins = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CorsPolicy = (input: CorsRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CorsRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CorsRule(entry, context); + }); }; const serializeAws_json1_1CorsRule = (input: CorsRule, context: __SerdeContext): any => { return { - ...(input.AllowedHeaders !== undefined && { - AllowedHeaders: serializeAws_json1_1AllowedHeaders(input.AllowedHeaders, context), - }), - ...(input.AllowedMethods !== undefined && { - AllowedMethods: serializeAws_json1_1AllowedMethods(input.AllowedMethods, context), - }), - ...(input.AllowedOrigins !== undefined && { - AllowedOrigins: serializeAws_json1_1AllowedOrigins(input.AllowedOrigins, context), - }), - ...(input.ExposeHeaders !== undefined && { - ExposeHeaders: serializeAws_json1_1ExposeHeaders(input.ExposeHeaders, context), - }), - ...(input.MaxAgeSeconds !== undefined && { MaxAgeSeconds: input.MaxAgeSeconds }), + ...(input.AllowedHeaders !== undefined && + input.AllowedHeaders !== null && { + AllowedHeaders: serializeAws_json1_1AllowedHeaders(input.AllowedHeaders, context), + }), + ...(input.AllowedMethods !== undefined && + input.AllowedMethods !== null && { + AllowedMethods: serializeAws_json1_1AllowedMethods(input.AllowedMethods, context), + }), + ...(input.AllowedOrigins !== undefined && + input.AllowedOrigins !== null && { + AllowedOrigins: serializeAws_json1_1AllowedOrigins(input.AllowedOrigins, context), + }), + ...(input.ExposeHeaders !== undefined && + input.ExposeHeaders !== null && { + ExposeHeaders: serializeAws_json1_1ExposeHeaders(input.ExposeHeaders, context), + }), + ...(input.MaxAgeSeconds !== undefined && input.MaxAgeSeconds !== null && { MaxAgeSeconds: input.MaxAgeSeconds }), }; }; const serializeAws_json1_1CreateContainerInput = (input: CreateContainerInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1DeleteContainerInput = (input: DeleteContainerInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; @@ -2040,13 +2051,13 @@ const serializeAws_json1_1DeleteContainerPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1DeleteCorsPolicyInput = (input: DeleteCorsPolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; @@ -2055,54 +2066,61 @@ const serializeAws_json1_1DeleteLifecyclePolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1DeleteMetricPolicyInput = (input: DeleteMetricPolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1DescribeContainerInput = (input: DescribeContainerInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1ExposeHeaders = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetContainerPolicyInput = (input: GetContainerPolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1GetCorsPolicyInput = (input: GetCorsPolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1GetLifecyclePolicyInput = (input: GetLifecyclePolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1GetMetricPolicyInput = (input: GetMetricPolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1ListContainersInput = (input: ListContainersInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2111,111 +2129,158 @@ const serializeAws_json1_1ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.Resource !== undefined && { Resource: input.Resource }), + ...(input.Resource !== undefined && input.Resource !== null && { Resource: input.Resource }), }; }; const serializeAws_json1_1MetricPolicy = (input: MetricPolicy, context: __SerdeContext): any => { return { - ...(input.ContainerLevelMetrics !== undefined && { ContainerLevelMetrics: input.ContainerLevelMetrics }), - ...(input.MetricPolicyRules !== undefined && { - MetricPolicyRules: serializeAws_json1_1MetricPolicyRules(input.MetricPolicyRules, context), - }), + ...(input.ContainerLevelMetrics !== undefined && + input.ContainerLevelMetrics !== null && { ContainerLevelMetrics: input.ContainerLevelMetrics }), + ...(input.MetricPolicyRules !== undefined && + input.MetricPolicyRules !== null && { + MetricPolicyRules: serializeAws_json1_1MetricPolicyRules(input.MetricPolicyRules, context), + }), }; }; const serializeAws_json1_1MetricPolicyRule = (input: MetricPolicyRule, context: __SerdeContext): any => { return { - ...(input.ObjectGroup !== undefined && { ObjectGroup: input.ObjectGroup }), - ...(input.ObjectGroupName !== undefined && { ObjectGroupName: input.ObjectGroupName }), + ...(input.ObjectGroup !== undefined && input.ObjectGroup !== null && { ObjectGroup: input.ObjectGroup }), + ...(input.ObjectGroupName !== undefined && + input.ObjectGroupName !== null && { ObjectGroupName: input.ObjectGroupName }), }; }; const serializeAws_json1_1MetricPolicyRules = (input: MetricPolicyRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MetricPolicyRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MetricPolicyRule(entry, context); + }); }; const serializeAws_json1_1PutContainerPolicyInput = (input: PutContainerPolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), - ...(input.Policy !== undefined && { Policy: input.Policy }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), }; }; const serializeAws_json1_1PutCorsPolicyInput = (input: PutCorsPolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), - ...(input.CorsPolicy !== undefined && { CorsPolicy: serializeAws_json1_1CorsPolicy(input.CorsPolicy, context) }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), + ...(input.CorsPolicy !== undefined && + input.CorsPolicy !== null && { CorsPolicy: serializeAws_json1_1CorsPolicy(input.CorsPolicy, context) }), }; }; const serializeAws_json1_1PutLifecyclePolicyInput = (input: PutLifecyclePolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), - ...(input.LifecyclePolicy !== undefined && { LifecyclePolicy: input.LifecyclePolicy }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), + ...(input.LifecyclePolicy !== undefined && + input.LifecyclePolicy !== null && { LifecyclePolicy: input.LifecyclePolicy }), }; }; const serializeAws_json1_1PutMetricPolicyInput = (input: PutMetricPolicyInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), - ...(input.MetricPolicy !== undefined && { - MetricPolicy: serializeAws_json1_1MetricPolicy(input.MetricPolicy, context), - }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), + ...(input.MetricPolicy !== undefined && + input.MetricPolicy !== null && { MetricPolicy: serializeAws_json1_1MetricPolicy(input.MetricPolicy, context) }), }; }; const serializeAws_json1_1StartAccessLoggingInput = (input: StartAccessLoggingInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1StopAccessLoggingInput = (input: StopAccessLoggingInput, context: __SerdeContext): any => { return { - ...(input.ContainerName !== undefined && { ContainerName: input.ContainerName }), + ...(input.ContainerName !== undefined && input.ContainerName !== null && { ContainerName: input.ContainerName }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.Resource !== undefined && { Resource: input.Resource }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Resource !== undefined && input.Resource !== null && { Resource: input.Resource }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.Resource !== undefined && { Resource: input.Resource }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.Resource !== undefined && input.Resource !== null && { Resource: input.Resource }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const deserializeAws_json1_1AllowedHeaders = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AllowedMethods = (output: any, context: __SerdeContext): (MethodName | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AllowedOrigins = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Container = (output: any, context: __SerdeContext): Container => { @@ -2245,7 +2310,14 @@ const deserializeAws_json1_1ContainerInUseException = ( }; const deserializeAws_json1_1ContainerList = (output: any, context: __SerdeContext): Container[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Container(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Container(entry, context); + }); }; const deserializeAws_json1_1ContainerNotFoundException = ( @@ -2258,7 +2330,14 @@ const deserializeAws_json1_1ContainerNotFoundException = ( }; const deserializeAws_json1_1CorsPolicy = (output: any, context: __SerdeContext): CorsRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CorsRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CorsRule(entry, context); + }); }; const deserializeAws_json1_1CorsPolicyNotFoundException = ( @@ -2344,7 +2423,14 @@ const deserializeAws_json1_1DescribeContainerOutput = ( }; const deserializeAws_json1_1ExposeHeaders = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1GetContainerPolicyOutput = ( @@ -2440,7 +2526,14 @@ const deserializeAws_json1_1MetricPolicyRule = (output: any, context: __SerdeCon }; const deserializeAws_json1_1MetricPolicyRules = (output: any, context: __SerdeContext): MetricPolicyRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricPolicyRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricPolicyRule(entry, context); + }); }; const deserializeAws_json1_1PolicyNotFoundException = ( @@ -2496,7 +2589,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceOutput = (output: any, context: __SerdeContext): TagResourceOutput => { @@ -2557,3 +2657,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-mediatailor/protocols/Aws_restJson1.ts b/clients/client-mediatailor/protocols/Aws_restJson1.ts index a99baafcd273..e81c713f2a9b 100644 --- a/clients/client-mediatailor/protocols/Aws_restJson1.ts +++ b/clients/client-mediatailor/protocols/Aws_restJson1.ts @@ -49,9 +49,7 @@ export const serializeAws_restJson1DeletePlaybackConfigurationCommand = async ( input: DeletePlaybackConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/playbackConfiguration/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -79,9 +77,7 @@ export const serializeAws_restJson1GetPlaybackConfigurationCommand = async ( input: GetPlaybackConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/playbackConfiguration/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -109,9 +105,7 @@ export const serializeAws_restJson1ListPlaybackConfigurationsCommand = async ( input: ListPlaybackConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/playbackConfigurations"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -135,9 +129,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -166,36 +158,50 @@ export const serializeAws_restJson1PutPlaybackConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/playbackConfiguration"; let body: any; body = JSON.stringify({ - ...(input.AdDecisionServerUrl !== undefined && { AdDecisionServerUrl: input.AdDecisionServerUrl }), - ...(input.AvailSuppression !== undefined && { - AvailSuppression: serializeAws_restJson1AvailSuppression(input.AvailSuppression, context), - }), - ...(input.Bumper !== undefined && { Bumper: serializeAws_restJson1Bumper(input.Bumper, context) }), - ...(input.CdnConfiguration !== undefined && { - CdnConfiguration: serializeAws_restJson1CdnConfiguration(input.CdnConfiguration, context), - }), - ...(input.DashConfiguration !== undefined && { - DashConfiguration: serializeAws_restJson1DashConfigurationForPut(input.DashConfiguration, context), - }), - ...(input.LivePreRollConfiguration !== undefined && { - LivePreRollConfiguration: serializeAws_restJson1LivePreRollConfiguration(input.LivePreRollConfiguration, context), - }), - ...(input.ManifestProcessingRules !== undefined && { - ManifestProcessingRules: serializeAws_restJson1ManifestProcessingRules(input.ManifestProcessingRules, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PersonalizationThresholdSeconds !== undefined && { - PersonalizationThresholdSeconds: input.PersonalizationThresholdSeconds, - }), - ...(input.SlateAdUrl !== undefined && { SlateAdUrl: input.SlateAdUrl }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), - ...(input.TranscodeProfileName !== undefined && { TranscodeProfileName: input.TranscodeProfileName }), - ...(input.VideoContentSourceUrl !== undefined && { VideoContentSourceUrl: input.VideoContentSourceUrl }), + ...(input.AdDecisionServerUrl !== undefined && + input.AdDecisionServerUrl !== null && { AdDecisionServerUrl: input.AdDecisionServerUrl }), + ...(input.AvailSuppression !== undefined && + input.AvailSuppression !== null && { + AvailSuppression: serializeAws_restJson1AvailSuppression(input.AvailSuppression, context), + }), + ...(input.Bumper !== undefined && + input.Bumper !== null && { Bumper: serializeAws_restJson1Bumper(input.Bumper, context) }), + ...(input.CdnConfiguration !== undefined && + input.CdnConfiguration !== null && { + CdnConfiguration: serializeAws_restJson1CdnConfiguration(input.CdnConfiguration, context), + }), + ...(input.DashConfiguration !== undefined && + input.DashConfiguration !== null && { + DashConfiguration: serializeAws_restJson1DashConfigurationForPut(input.DashConfiguration, context), + }), + ...(input.LivePreRollConfiguration !== undefined && + input.LivePreRollConfiguration !== null && { + LivePreRollConfiguration: serializeAws_restJson1LivePreRollConfiguration( + input.LivePreRollConfiguration, + context + ), + }), + ...(input.ManifestProcessingRules !== undefined && + input.ManifestProcessingRules !== null && { + ManifestProcessingRules: serializeAws_restJson1ManifestProcessingRules(input.ManifestProcessingRules, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PersonalizationThresholdSeconds !== undefined && + input.PersonalizationThresholdSeconds !== null && { + PersonalizationThresholdSeconds: input.PersonalizationThresholdSeconds, + }), + ...(input.SlateAdUrl !== undefined && input.SlateAdUrl !== null && { SlateAdUrl: input.SlateAdUrl }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.TranscodeProfileName !== undefined && + input.TranscodeProfileName !== null && { TranscodeProfileName: input.TranscodeProfileName }), + ...(input.VideoContentSourceUrl !== undefined && + input.VideoContentSourceUrl !== null && { VideoContentSourceUrl: input.VideoContentSourceUrl }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -214,7 +220,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -228,7 +234,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -246,9 +253,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -779,39 +784,43 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async ( }; const serializeAws_restJson1__mapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1AdMarkerPassthrough = (input: AdMarkerPassthrough, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; const serializeAws_restJson1AvailSuppression = (input: AvailSuppression, context: __SerdeContext): any => { return { - ...(input.Mode !== undefined && { Mode: input.Mode }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1Bumper = (input: Bumper, context: __SerdeContext): any => { return { - ...(input.EndUrl !== undefined && { EndUrl: input.EndUrl }), - ...(input.StartUrl !== undefined && { StartUrl: input.StartUrl }), + ...(input.EndUrl !== undefined && input.EndUrl !== null && { EndUrl: input.EndUrl }), + ...(input.StartUrl !== undefined && input.StartUrl !== null && { StartUrl: input.StartUrl }), }; }; const serializeAws_restJson1CdnConfiguration = (input: CdnConfiguration, context: __SerdeContext): any => { return { - ...(input.AdSegmentUrlPrefix !== undefined && { AdSegmentUrlPrefix: input.AdSegmentUrlPrefix }), - ...(input.ContentSegmentUrlPrefix !== undefined && { ContentSegmentUrlPrefix: input.ContentSegmentUrlPrefix }), + ...(input.AdSegmentUrlPrefix !== undefined && + input.AdSegmentUrlPrefix !== null && { AdSegmentUrlPrefix: input.AdSegmentUrlPrefix }), + ...(input.ContentSegmentUrlPrefix !== undefined && + input.ContentSegmentUrlPrefix !== null && { ContentSegmentUrlPrefix: input.ContentSegmentUrlPrefix }), }; }; @@ -820,8 +829,9 @@ const serializeAws_restJson1DashConfigurationForPut = ( context: __SerdeContext ): any => { return { - ...(input.MpdLocation !== undefined && { MpdLocation: input.MpdLocation }), - ...(input.OriginManifestType !== undefined && { OriginManifestType: input.OriginManifestType }), + ...(input.MpdLocation !== undefined && input.MpdLocation !== null && { MpdLocation: input.MpdLocation }), + ...(input.OriginManifestType !== undefined && + input.OriginManifestType !== null && { OriginManifestType: input.OriginManifestType }), }; }; @@ -830,8 +840,10 @@ const serializeAws_restJson1LivePreRollConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AdDecisionServerUrl !== undefined && { AdDecisionServerUrl: input.AdDecisionServerUrl }), - ...(input.MaxDurationSeconds !== undefined && { MaxDurationSeconds: input.MaxDurationSeconds }), + ...(input.AdDecisionServerUrl !== undefined && + input.AdDecisionServerUrl !== null && { AdDecisionServerUrl: input.AdDecisionServerUrl }), + ...(input.MaxDurationSeconds !== undefined && + input.MaxDurationSeconds !== null && { MaxDurationSeconds: input.MaxDurationSeconds }), }; }; @@ -840,9 +852,10 @@ const serializeAws_restJson1ManifestProcessingRules = ( context: __SerdeContext ): any => { return { - ...(input.AdMarkerPassthrough !== undefined && { - AdMarkerPassthrough: serializeAws_restJson1AdMarkerPassthrough(input.AdMarkerPassthrough, context), - }), + ...(input.AdMarkerPassthrough !== undefined && + input.AdMarkerPassthrough !== null && { + AdMarkerPassthrough: serializeAws_restJson1AdMarkerPassthrough(input.AdMarkerPassthrough, context), + }), }; }; @@ -850,17 +863,26 @@ const deserializeAws_restJson1__listOfPlaybackConfigurations = ( output: any, context: __SerdeContext ): PlaybackConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PlaybackConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PlaybackConfiguration(entry, context); + }); }; const deserializeAws_restJson1__mapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AdMarkerPassthrough = (output: any, context: __SerdeContext): AdMarkerPassthrough => { @@ -1030,6 +1052,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-migration-hub/protocols/Aws_json1_1.ts b/clients/client-migration-hub/protocols/Aws_json1_1.ts index d413fcb137d7..f39d71dc8df3 100644 --- a/clients/client-migration-hub/protocols/Aws_json1_1.ts +++ b/clients/client-migration-hub/protocols/Aws_json1_1.ts @@ -132,7 +132,7 @@ export const serializeAws_json1_1AssociateCreatedArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.AssociateCreatedArtifact", }; let body: any; @@ -145,7 +145,7 @@ export const serializeAws_json1_1AssociateDiscoveredResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.AssociateDiscoveredResource", }; let body: any; @@ -158,7 +158,7 @@ export const serializeAws_json1_1CreateProgressUpdateStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.CreateProgressUpdateStream", }; let body: any; @@ -171,7 +171,7 @@ export const serializeAws_json1_1DeleteProgressUpdateStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.DeleteProgressUpdateStream", }; let body: any; @@ -184,7 +184,7 @@ export const serializeAws_json1_1DescribeApplicationStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.DescribeApplicationState", }; let body: any; @@ -197,7 +197,7 @@ export const serializeAws_json1_1DescribeMigrationTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.DescribeMigrationTask", }; let body: any; @@ -210,7 +210,7 @@ export const serializeAws_json1_1DisassociateCreatedArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.DisassociateCreatedArtifact", }; let body: any; @@ -223,7 +223,7 @@ export const serializeAws_json1_1DisassociateDiscoveredResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.DisassociateDiscoveredResource", }; let body: any; @@ -236,7 +236,7 @@ export const serializeAws_json1_1ImportMigrationTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.ImportMigrationTask", }; let body: any; @@ -249,7 +249,7 @@ export const serializeAws_json1_1ListApplicationStatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.ListApplicationStates", }; let body: any; @@ -262,7 +262,7 @@ export const serializeAws_json1_1ListCreatedArtifactsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.ListCreatedArtifacts", }; let body: any; @@ -275,7 +275,7 @@ export const serializeAws_json1_1ListDiscoveredResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.ListDiscoveredResources", }; let body: any; @@ -288,7 +288,7 @@ export const serializeAws_json1_1ListMigrationTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.ListMigrationTasks", }; let body: any; @@ -301,7 +301,7 @@ export const serializeAws_json1_1ListProgressUpdateStreamsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.ListProgressUpdateStreams", }; let body: any; @@ -314,7 +314,7 @@ export const serializeAws_json1_1NotifyApplicationStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.NotifyApplicationState", }; let body: any; @@ -327,7 +327,7 @@ export const serializeAws_json1_1NotifyMigrationTaskStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.NotifyMigrationTaskState", }; let body: any; @@ -340,7 +340,7 @@ export const serializeAws_json1_1PutResourceAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHub.PutResourceAttributes", }; let body: any; @@ -375,8 +375,7 @@ const deserializeAws_json1_1AssociateCreatedArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -494,8 +493,7 @@ const deserializeAws_json1_1AssociateDiscoveredResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -621,8 +619,7 @@ const deserializeAws_json1_1CreateProgressUpdateStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -732,8 +729,7 @@ const deserializeAws_json1_1DeleteProgressUpdateStreamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -851,8 +847,7 @@ const deserializeAws_json1_1DescribeApplicationStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -962,8 +957,7 @@ const deserializeAws_json1_1DescribeMigrationTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -1065,8 +1059,7 @@ const deserializeAws_json1_1DisassociateCreatedArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -1184,8 +1177,7 @@ const deserializeAws_json1_1DisassociateDiscoveredResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -1303,8 +1295,7 @@ const deserializeAws_json1_1ImportMigrationTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -1422,8 +1413,7 @@ const deserializeAws_json1_1ListApplicationStatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -1517,8 +1507,7 @@ const deserializeAws_json1_1ListCreatedArtifactsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -1620,8 +1609,7 @@ const deserializeAws_json1_1ListDiscoveredResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -1723,8 +1711,7 @@ const deserializeAws_json1_1ListMigrationTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -1834,8 +1821,7 @@ const deserializeAws_json1_1ListProgressUpdateStreamsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -1929,8 +1915,7 @@ const deserializeAws_json1_1NotifyApplicationStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -2056,8 +2041,7 @@ const deserializeAws_json1_1NotifyMigrationTaskStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -2175,8 +2159,7 @@ const deserializeAws_json1_1PutResourceAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhub#AccessDeniedException": @@ -2418,7 +2401,14 @@ const deserializeAws_json1_1UnauthorizedOperationResponse = async ( }; const serializeAws_json1_1ApplicationIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssociateCreatedArtifactRequest = ( @@ -2426,12 +2416,15 @@ const serializeAws_json1_1AssociateCreatedArtifactRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreatedArtifact !== undefined && { - CreatedArtifact: serializeAws_json1_1CreatedArtifact(input.CreatedArtifact, context), - }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.CreatedArtifact !== undefined && + input.CreatedArtifact !== null && { + CreatedArtifact: serializeAws_json1_1CreatedArtifact(input.CreatedArtifact, context), + }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), }; }; @@ -2440,19 +2433,22 @@ const serializeAws_json1_1AssociateDiscoveredResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.DiscoveredResource !== undefined && { - DiscoveredResource: serializeAws_json1_1DiscoveredResource(input.DiscoveredResource, context), - }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.DiscoveredResource !== undefined && + input.DiscoveredResource !== null && { + DiscoveredResource: serializeAws_json1_1DiscoveredResource(input.DiscoveredResource, context), + }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), }; }; const serializeAws_json1_1CreatedArtifact = (input: CreatedArtifact, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -2461,8 +2457,9 @@ const serializeAws_json1_1CreateProgressUpdateStreamRequest = ( context: __SerdeContext ): any => { return { - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.ProgressUpdateStreamName !== undefined && { ProgressUpdateStreamName: input.ProgressUpdateStreamName }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.ProgressUpdateStreamName !== undefined && + input.ProgressUpdateStreamName !== null && { ProgressUpdateStreamName: input.ProgressUpdateStreamName }), }; }; @@ -2471,8 +2468,9 @@ const serializeAws_json1_1DeleteProgressUpdateStreamRequest = ( context: __SerdeContext ): any => { return { - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.ProgressUpdateStreamName !== undefined && { ProgressUpdateStreamName: input.ProgressUpdateStreamName }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.ProgressUpdateStreamName !== undefined && + input.ProgressUpdateStreamName !== null && { ProgressUpdateStreamName: input.ProgressUpdateStreamName }), }; }; @@ -2481,7 +2479,7 @@ const serializeAws_json1_1DescribeApplicationStateRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationId !== undefined && { ApplicationId: input.ApplicationId }), + ...(input.ApplicationId !== undefined && input.ApplicationId !== null && { ApplicationId: input.ApplicationId }), }; }; @@ -2490,8 +2488,10 @@ const serializeAws_json1_1DescribeMigrationTaskRequest = ( context: __SerdeContext ): any => { return { - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), }; }; @@ -2500,10 +2500,13 @@ const serializeAws_json1_1DisassociateCreatedArtifactRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreatedArtifactName !== undefined && { CreatedArtifactName: input.CreatedArtifactName }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.CreatedArtifactName !== undefined && + input.CreatedArtifactName !== null && { CreatedArtifactName: input.CreatedArtifactName }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), }; }; @@ -2512,17 +2515,21 @@ const serializeAws_json1_1DisassociateDiscoveredResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationId !== undefined && { ConfigurationId: input.ConfigurationId }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.ConfigurationId !== undefined && + input.ConfigurationId !== null && { ConfigurationId: input.ConfigurationId }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), }; }; const serializeAws_json1_1DiscoveredResource = (input: DiscoveredResource, context: __SerdeContext): any => { return { - ...(input.ConfigurationId !== undefined && { ConfigurationId: input.ConfigurationId }), - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.ConfigurationId !== undefined && + input.ConfigurationId !== null && { ConfigurationId: input.ConfigurationId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }; }; @@ -2531,9 +2538,11 @@ const serializeAws_json1_1ImportMigrationTaskRequest = ( context: __SerdeContext ): any => { return { - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), }; }; @@ -2542,11 +2551,12 @@ const serializeAws_json1_1ListApplicationStatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationIds !== undefined && { - ApplicationIds: serializeAws_json1_1ApplicationIds(input.ApplicationIds, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ApplicationIds !== undefined && + input.ApplicationIds !== null && { + ApplicationIds: serializeAws_json1_1ApplicationIds(input.ApplicationIds, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2555,10 +2565,12 @@ const serializeAws_json1_1ListCreatedArtifactsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), }; }; @@ -2567,10 +2579,12 @@ const serializeAws_json1_1ListDiscoveredResourcesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), }; }; @@ -2579,9 +2593,9 @@ const serializeAws_json1_1ListMigrationTasksRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceName !== undefined && { ResourceName: input.ResourceName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceName !== undefined && input.ResourceName !== null && { ResourceName: input.ResourceName }), }; }; @@ -2590,8 +2604,8 @@ const serializeAws_json1_1ListProgressUpdateStreamsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2600,10 +2614,11 @@ const serializeAws_json1_1NotifyApplicationStateRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplicationId !== undefined && { ApplicationId: input.ApplicationId }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.UpdateDateTime !== undefined && { UpdateDateTime: Math.round(input.UpdateDateTime.getTime() / 1000) }), + ...(input.ApplicationId !== undefined && input.ApplicationId !== null && { ApplicationId: input.ApplicationId }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.UpdateDateTime !== undefined && + input.UpdateDateTime !== null && { UpdateDateTime: Math.round(input.UpdateDateTime.getTime() / 1000) }), }; }; @@ -2612,12 +2627,16 @@ const serializeAws_json1_1NotifyMigrationTaskStateRequest = ( context: __SerdeContext ): any => { return { - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.NextUpdateSeconds !== undefined && { NextUpdateSeconds: input.NextUpdateSeconds }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), - ...(input.Task !== undefined && { Task: serializeAws_json1_1Task(input.Task, context) }), - ...(input.UpdateDateTime !== undefined && { UpdateDateTime: Math.round(input.UpdateDateTime.getTime() / 1000) }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.NextUpdateSeconds !== undefined && + input.NextUpdateSeconds !== null && { NextUpdateSeconds: input.NextUpdateSeconds }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.Task !== undefined && input.Task !== null && { Task: serializeAws_json1_1Task(input.Task, context) }), + ...(input.UpdateDateTime !== undefined && + input.UpdateDateTime !== null && { UpdateDateTime: Math.round(input.UpdateDateTime.getTime() / 1000) }), }; }; @@ -2626,31 +2645,42 @@ const serializeAws_json1_1PutResourceAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.MigrationTaskName !== undefined && { MigrationTaskName: input.MigrationTaskName }), - ...(input.ProgressUpdateStream !== undefined && { ProgressUpdateStream: input.ProgressUpdateStream }), - ...(input.ResourceAttributeList !== undefined && { - ResourceAttributeList: serializeAws_json1_1ResourceAttributeList(input.ResourceAttributeList, context), - }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.MigrationTaskName !== undefined && + input.MigrationTaskName !== null && { MigrationTaskName: input.MigrationTaskName }), + ...(input.ProgressUpdateStream !== undefined && + input.ProgressUpdateStream !== null && { ProgressUpdateStream: input.ProgressUpdateStream }), + ...(input.ResourceAttributeList !== undefined && + input.ResourceAttributeList !== null && { + ResourceAttributeList: serializeAws_json1_1ResourceAttributeList(input.ResourceAttributeList, context), + }), }; }; const serializeAws_json1_1ResourceAttribute = (input: ResourceAttribute, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1ResourceAttributeList = (input: ResourceAttribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ResourceAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ResourceAttribute(entry, context); + }); }; const serializeAws_json1_1Task = (input: Task, context: __SerdeContext): any => { return { - ...(input.ProgressPercent !== undefined && { ProgressPercent: input.ProgressPercent }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.StatusDetail !== undefined && { StatusDetail: input.StatusDetail }), + ...(input.ProgressPercent !== undefined && + input.ProgressPercent !== null && { ProgressPercent: input.ProgressPercent }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.StatusDetail !== undefined && input.StatusDetail !== null && { StatusDetail: input.StatusDetail }), }; }; @@ -2676,7 +2706,14 @@ const deserializeAws_json1_1ApplicationState = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ApplicationStateList = (output: any, context: __SerdeContext): ApplicationState[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ApplicationState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ApplicationState(entry, context); + }); }; const deserializeAws_json1_1AssociateCreatedArtifactResult = ( @@ -2701,7 +2738,14 @@ const deserializeAws_json1_1CreatedArtifact = (output: any, context: __SerdeCont }; const deserializeAws_json1_1CreatedArtifactList = (output: any, context: __SerdeContext): CreatedArtifact[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CreatedArtifact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CreatedArtifact(entry, context); + }); }; const deserializeAws_json1_1CreateProgressUpdateStreamResult = ( @@ -2769,7 +2813,14 @@ const deserializeAws_json1_1DiscoveredResource = (output: any, context: __SerdeC }; const deserializeAws_json1_1DiscoveredResourceList = (output: any, context: __SerdeContext): DiscoveredResource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DiscoveredResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DiscoveredResource(entry, context); + }); }; const deserializeAws_json1_1DryRunOperation = (output: any, context: __SerdeContext): DryRunOperation => { @@ -2810,7 +2861,14 @@ const deserializeAws_json1_1LatestResourceAttributeList = ( output: any, context: __SerdeContext ): ResourceAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceAttribute(entry, context); + }); }; const deserializeAws_json1_1ListApplicationStatesResult = ( @@ -2926,7 +2984,14 @@ const deserializeAws_json1_1MigrationTaskSummaryList = ( output: any, context: __SerdeContext ): MigrationTaskSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MigrationTaskSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MigrationTaskSummary(entry, context); + }); }; const deserializeAws_json1_1NotifyApplicationStateResult = ( @@ -2965,7 +3030,14 @@ const deserializeAws_json1_1ProgressUpdateStreamSummaryList = ( output: any, context: __SerdeContext ): ProgressUpdateStreamSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProgressUpdateStreamSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProgressUpdateStreamSummary(entry, context); + }); }; const deserializeAws_json1_1PutResourceAttributesResult = ( @@ -3075,3 +3147,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-migrationhub-config/protocols/Aws_json1_1.ts b/clients/client-migrationhub-config/protocols/Aws_json1_1.ts index 57e03f9f9246..a512c0d66aa7 100644 --- a/clients/client-migrationhub-config/protocols/Aws_json1_1.ts +++ b/clients/client-migrationhub-config/protocols/Aws_json1_1.ts @@ -38,7 +38,7 @@ export const serializeAws_json1_1CreateHomeRegionControlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHubMultiAccountService.CreateHomeRegionControl", }; let body: any; @@ -51,7 +51,7 @@ export const serializeAws_json1_1DescribeHomeRegionControlsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHubMultiAccountService.DescribeHomeRegionControls", }; let body: any; @@ -64,7 +64,7 @@ export const serializeAws_json1_1GetHomeRegionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSMigrationHubMultiAccountService.GetHomeRegion", }; let body: any; @@ -99,8 +99,7 @@ const deserializeAws_json1_1CreateHomeRegionControlCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhubconfig#AccessDeniedException": @@ -194,8 +193,7 @@ const deserializeAws_json1_1DescribeHomeRegionControlsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhubconfig#AccessDeniedException": @@ -281,8 +279,7 @@ const deserializeAws_json1_1GetHomeRegionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.migrationhubconfig#AccessDeniedException": @@ -436,9 +433,10 @@ const serializeAws_json1_1CreateHomeRegionControlRequest = ( context: __SerdeContext ): any => { return { - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.HomeRegion !== undefined && { HomeRegion: input.HomeRegion }), - ...(input.Target !== undefined && { Target: serializeAws_json1_1Target(input.Target, context) }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.HomeRegion !== undefined && input.HomeRegion !== null && { HomeRegion: input.HomeRegion }), + ...(input.Target !== undefined && + input.Target !== null && { Target: serializeAws_json1_1Target(input.Target, context) }), }; }; @@ -447,11 +445,12 @@ const serializeAws_json1_1DescribeHomeRegionControlsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ControlId !== undefined && { ControlId: input.ControlId }), - ...(input.HomeRegion !== undefined && { HomeRegion: input.HomeRegion }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Target !== undefined && { Target: serializeAws_json1_1Target(input.Target, context) }), + ...(input.ControlId !== undefined && input.ControlId !== null && { ControlId: input.ControlId }), + ...(input.HomeRegion !== undefined && input.HomeRegion !== null && { HomeRegion: input.HomeRegion }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Target !== undefined && + input.Target !== null && { Target: serializeAws_json1_1Target(input.Target, context) }), }; }; @@ -461,8 +460,8 @@ const serializeAws_json1_1GetHomeRegionRequest = (input: GetHomeRegionRequest, c const serializeAws_json1_1Target = (input: Target, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -525,7 +524,14 @@ const deserializeAws_json1_1HomeRegionControl = (output: any, context: __SerdeCo }; const deserializeAws_json1_1HomeRegionControls = (output: any, context: __SerdeContext): HomeRegionControl[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HomeRegionControl(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HomeRegionControl(entry, context); + }); }; const deserializeAws_json1_1InternalServerError = (output: any, context: __SerdeContext): InternalServerError => { @@ -616,3 +622,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-mobile/protocols/Aws_restJson1.ts b/clients/client-mobile/protocols/Aws_restJson1.ts index 56a20add81e3..cad940a41ccc 100644 --- a/clients/client-mobile/protocols/Aws_restJson1.ts +++ b/clients/client-mobile/protocols/Aws_restJson1.ts @@ -39,7 +39,7 @@ export const serializeAws_restJson1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", }; let resolvedPath = "/projects"; const query: any = { @@ -68,9 +68,7 @@ export const serializeAws_restJson1DeleteProjectCommand = async ( input: DeleteProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects/{projectId}"; if (input.projectId !== undefined) { const labelValue: string = input.projectId; @@ -98,9 +96,7 @@ export const serializeAws_restJson1DescribeBundleCommand = async ( input: DescribeBundleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bundles/{bundleId}"; if (input.bundleId !== undefined) { const labelValue: string = input.bundleId; @@ -128,9 +124,7 @@ export const serializeAws_restJson1DescribeProjectCommand = async ( input: DescribeProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/project"; const query: any = { ...(input.projectId !== undefined && { projectId: input.projectId }), @@ -154,9 +148,7 @@ export const serializeAws_restJson1ExportBundleCommand = async ( input: ExportBundleCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bundles/{bundleId}"; if (input.bundleId !== undefined) { const labelValue: string = input.bundleId; @@ -189,9 +181,7 @@ export const serializeAws_restJson1ExportProjectCommand = async ( input: ExportProjectCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/exports/{projectId}"; if (input.projectId !== undefined) { const labelValue: string = input.projectId; @@ -219,9 +209,7 @@ export const serializeAws_restJson1ListBundlesCommand = async ( input: ListBundlesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/bundles"; const query: any = { ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }), @@ -245,9 +233,7 @@ export const serializeAws_restJson1ListProjectsCommand = async ( input: ListProjectsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/projects"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -272,7 +258,7 @@ export const serializeAws_restJson1UpdateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", }; let resolvedPath = "/update"; const query: any = { @@ -1319,13 +1305,15 @@ const deserializeAws_restJson1UnauthorizedExceptionResponse = async ( }; const deserializeAws_restJson1Attributes = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1BundleDetails = (output: any, context: __SerdeContext): BundleDetails => { @@ -1343,11 +1331,25 @@ const deserializeAws_restJson1BundleDetails = (output: any, context: __SerdeCont }; const deserializeAws_restJson1BundleList = (output: any, context: __SerdeContext): BundleDetails[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BundleDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BundleDetails(entry, context); + }); }; const deserializeAws_restJson1Platforms = (output: any, context: __SerdeContext): (Platform | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ProjectDetails = (output: any, context: __SerdeContext): ProjectDetails => { @@ -1373,7 +1375,14 @@ const deserializeAws_restJson1ProjectDetails = (output: any, context: __SerdeCon }; const deserializeAws_restJson1ProjectSummaries = (output: any, context: __SerdeContext): ProjectSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ProjectSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ProjectSummary(entry, context); + }); }; const deserializeAws_restJson1ProjectSummary = (output: any, context: __SerdeContext): ProjectSummary => { @@ -1397,7 +1406,14 @@ const deserializeAws_restJson1Resource = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Resources = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Resource(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1420,6 +1436,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-mq/protocols/Aws_restJson1.ts b/clients/client-mq/protocols/Aws_restJson1.ts index eb355e98e78a..a244ba4dc232 100644 --- a/clients/client-mq/protocols/Aws_restJson1.ts +++ b/clients/client-mq/protocols/Aws_restJson1.ts @@ -89,42 +89,53 @@ export const serializeAws_restJson1CreateBrokerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/brokers"; let body: any; body = JSON.stringify({ - ...(input.AuthenticationStrategy !== undefined && { authenticationStrategy: input.AuthenticationStrategy }), - ...(input.AutoMinorVersionUpgrade !== undefined && { autoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), - ...(input.BrokerName !== undefined && { brokerName: input.BrokerName }), - ...(input.Configuration !== undefined && { - configuration: serializeAws_restJson1ConfigurationId(input.Configuration, context), - }), + ...(input.AuthenticationStrategy !== undefined && + input.AuthenticationStrategy !== null && { authenticationStrategy: input.AuthenticationStrategy }), + ...(input.AutoMinorVersionUpgrade !== undefined && + input.AutoMinorVersionUpgrade !== null && { autoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), + ...(input.BrokerName !== undefined && input.BrokerName !== null && { brokerName: input.BrokerName }), + ...(input.Configuration !== undefined && + input.Configuration !== null && { + configuration: serializeAws_restJson1ConfigurationId(input.Configuration, context), + }), creatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), - ...(input.DeploymentMode !== undefined && { deploymentMode: input.DeploymentMode }), - ...(input.EncryptionOptions !== undefined && { - encryptionOptions: serializeAws_restJson1EncryptionOptions(input.EncryptionOptions, context), - }), - ...(input.EngineType !== undefined && { engineType: input.EngineType }), - ...(input.EngineVersion !== undefined && { engineVersion: input.EngineVersion }), - ...(input.HostInstanceType !== undefined && { hostInstanceType: input.HostInstanceType }), - ...(input.LdapServerMetadata !== undefined && { - ldapServerMetadata: serializeAws_restJson1LdapServerMetadataInput(input.LdapServerMetadata, context), - }), - ...(input.Logs !== undefined && { logs: serializeAws_restJson1Logs(input.Logs, context) }), - ...(input.MaintenanceWindowStartTime !== undefined && { - maintenanceWindowStartTime: serializeAws_restJson1WeeklyStartTime(input.MaintenanceWindowStartTime, context), - }), - ...(input.PubliclyAccessible !== undefined && { publiclyAccessible: input.PubliclyAccessible }), - ...(input.SecurityGroups !== undefined && { - securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context), - }), - ...(input.StorageType !== undefined && { storageType: input.StorageType }), - ...(input.SubnetIds !== undefined && { - subnetIds: serializeAws_restJson1__listOf__string(input.SubnetIds, context), - }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), - ...(input.Users !== undefined && { users: serializeAws_restJson1__listOfUser(input.Users, context) }), + ...(input.DeploymentMode !== undefined && + input.DeploymentMode !== null && { deploymentMode: input.DeploymentMode }), + ...(input.EncryptionOptions !== undefined && + input.EncryptionOptions !== null && { + encryptionOptions: serializeAws_restJson1EncryptionOptions(input.EncryptionOptions, context), + }), + ...(input.EngineType !== undefined && input.EngineType !== null && { engineType: input.EngineType }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { engineVersion: input.EngineVersion }), + ...(input.HostInstanceType !== undefined && + input.HostInstanceType !== null && { hostInstanceType: input.HostInstanceType }), + ...(input.LdapServerMetadata !== undefined && + input.LdapServerMetadata !== null && { + ldapServerMetadata: serializeAws_restJson1LdapServerMetadataInput(input.LdapServerMetadata, context), + }), + ...(input.Logs !== undefined && input.Logs !== null && { logs: serializeAws_restJson1Logs(input.Logs, context) }), + ...(input.MaintenanceWindowStartTime !== undefined && + input.MaintenanceWindowStartTime !== null && { + maintenanceWindowStartTime: serializeAws_restJson1WeeklyStartTime(input.MaintenanceWindowStartTime, context), + }), + ...(input.PubliclyAccessible !== undefined && + input.PubliclyAccessible !== null && { publiclyAccessible: input.PubliclyAccessible }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context), + }), + ...(input.StorageType !== undefined && input.StorageType !== null && { storageType: input.StorageType }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { subnetIds: serializeAws_restJson1__listOf__string(input.SubnetIds, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Users !== undefined && + input.Users !== null && { users: serializeAws_restJson1__listOfUser(input.Users, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -143,16 +154,18 @@ export const serializeAws_restJson1CreateConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/configurations"; let body: any; body = JSON.stringify({ - ...(input.AuthenticationStrategy !== undefined && { authenticationStrategy: input.AuthenticationStrategy }), - ...(input.EngineType !== undefined && { engineType: input.EngineType }), - ...(input.EngineVersion !== undefined && { engineVersion: input.EngineVersion }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.AuthenticationStrategy !== undefined && + input.AuthenticationStrategy !== null && { authenticationStrategy: input.AuthenticationStrategy }), + ...(input.EngineType !== undefined && input.EngineType !== null && { engineType: input.EngineType }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { engineVersion: input.EngineVersion }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -171,7 +184,7 @@ export const serializeAws_restJson1CreateTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -185,7 +198,8 @@ export const serializeAws_restJson1CreateTagsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -204,7 +218,7 @@ export const serializeAws_restJson1CreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/brokers/{BrokerId}/users/{Username}"; if (input.Username !== undefined) { @@ -227,9 +241,10 @@ export const serializeAws_restJson1CreateUserCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConsoleAccess !== undefined && { consoleAccess: input.ConsoleAccess }), - ...(input.Groups !== undefined && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) }), - ...(input.Password !== undefined && { password: input.Password }), + ...(input.ConsoleAccess !== undefined && input.ConsoleAccess !== null && { consoleAccess: input.ConsoleAccess }), + ...(input.Groups !== undefined && + input.Groups !== null && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) }), + ...(input.Password !== undefined && input.Password !== null && { password: input.Password }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -247,9 +262,7 @@ export const serializeAws_restJson1DeleteBrokerCommand = async ( input: DeleteBrokerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/brokers/{BrokerId}"; if (input.BrokerId !== undefined) { const labelValue: string = input.BrokerId; @@ -277,9 +290,7 @@ export const serializeAws_restJson1DeleteTagsCommand = async ( input: DeleteTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -311,9 +322,7 @@ export const serializeAws_restJson1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/brokers/{BrokerId}/users/{Username}"; if (input.BrokerId !== undefined) { const labelValue: string = input.BrokerId; @@ -350,9 +359,7 @@ export const serializeAws_restJson1DescribeBrokerCommand = async ( input: DescribeBrokerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/brokers/{BrokerId}"; if (input.BrokerId !== undefined) { const labelValue: string = input.BrokerId; @@ -380,9 +387,7 @@ export const serializeAws_restJson1DescribeBrokerEngineTypesCommand = async ( input: DescribeBrokerEngineTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/broker-engine-types"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -407,9 +412,7 @@ export const serializeAws_restJson1DescribeBrokerInstanceOptionsCommand = async input: DescribeBrokerInstanceOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/broker-instance-options"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -436,9 +439,7 @@ export const serializeAws_restJson1DescribeConfigurationCommand = async ( input: DescribeConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/configurations/{ConfigurationId}"; if (input.ConfigurationId !== undefined) { const labelValue: string = input.ConfigurationId; @@ -466,9 +467,7 @@ export const serializeAws_restJson1DescribeConfigurationRevisionCommand = async input: DescribeConfigurationRevisionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/configurations/{ConfigurationId}/revisions/{ConfigurationRevision}"; if (input.ConfigurationId !== undefined) { const labelValue: string = input.ConfigurationId; @@ -505,9 +504,7 @@ export const serializeAws_restJson1DescribeUserCommand = async ( input: DescribeUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/brokers/{BrokerId}/users/{Username}"; if (input.Username !== undefined) { const labelValue: string = input.Username; @@ -544,9 +541,7 @@ export const serializeAws_restJson1ListBrokersCommand = async ( input: ListBrokersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/brokers"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -570,9 +565,7 @@ export const serializeAws_restJson1ListConfigurationRevisionsCommand = async ( input: ListConfigurationRevisionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/configurations/{ConfigurationId}/revisions"; if (input.ConfigurationId !== undefined) { const labelValue: string = input.ConfigurationId; @@ -605,9 +598,7 @@ export const serializeAws_restJson1ListConfigurationsCommand = async ( input: ListConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/configurations"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -631,9 +622,7 @@ export const serializeAws_restJson1ListTagsCommand = async ( input: ListTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -661,9 +650,7 @@ export const serializeAws_restJson1ListUsersCommand = async ( input: ListUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/brokers/{BrokerId}/users"; if (input.BrokerId !== undefined) { const labelValue: string = input.BrokerId; @@ -696,9 +683,7 @@ export const serializeAws_restJson1RebootBrokerCommand = async ( input: RebootBrokerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/brokers/{BrokerId}/reboot"; if (input.BrokerId !== undefined) { const labelValue: string = input.BrokerId; @@ -727,7 +712,7 @@ export const serializeAws_restJson1UpdateBrokerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/brokers/{BrokerId}"; if (input.BrokerId !== undefined) { @@ -741,20 +726,26 @@ export const serializeAws_restJson1UpdateBrokerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AuthenticationStrategy !== undefined && { authenticationStrategy: input.AuthenticationStrategy }), - ...(input.AutoMinorVersionUpgrade !== undefined && { autoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), - ...(input.Configuration !== undefined && { - configuration: serializeAws_restJson1ConfigurationId(input.Configuration, context), - }), - ...(input.EngineVersion !== undefined && { engineVersion: input.EngineVersion }), - ...(input.HostInstanceType !== undefined && { hostInstanceType: input.HostInstanceType }), - ...(input.LdapServerMetadata !== undefined && { - ldapServerMetadata: serializeAws_restJson1LdapServerMetadataInput(input.LdapServerMetadata, context), - }), - ...(input.Logs !== undefined && { logs: serializeAws_restJson1Logs(input.Logs, context) }), - ...(input.SecurityGroups !== undefined && { - securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context), - }), + ...(input.AuthenticationStrategy !== undefined && + input.AuthenticationStrategy !== null && { authenticationStrategy: input.AuthenticationStrategy }), + ...(input.AutoMinorVersionUpgrade !== undefined && + input.AutoMinorVersionUpgrade !== null && { autoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), + ...(input.Configuration !== undefined && + input.Configuration !== null && { + configuration: serializeAws_restJson1ConfigurationId(input.Configuration, context), + }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { engineVersion: input.EngineVersion }), + ...(input.HostInstanceType !== undefined && + input.HostInstanceType !== null && { hostInstanceType: input.HostInstanceType }), + ...(input.LdapServerMetadata !== undefined && + input.LdapServerMetadata !== null && { + ldapServerMetadata: serializeAws_restJson1LdapServerMetadataInput(input.LdapServerMetadata, context), + }), + ...(input.Logs !== undefined && input.Logs !== null && { logs: serializeAws_restJson1Logs(input.Logs, context) }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + securityGroups: serializeAws_restJson1__listOf__string(input.SecurityGroups, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -773,7 +764,7 @@ export const serializeAws_restJson1UpdateConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/configurations/{ConfigurationId}"; if (input.ConfigurationId !== undefined) { @@ -787,8 +778,8 @@ export const serializeAws_restJson1UpdateConfigurationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Data !== undefined && { data: input.Data }), - ...(input.Description !== undefined && { description: input.Description }), + ...(input.Data !== undefined && input.Data !== null && { data: input.Data }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -807,7 +798,7 @@ export const serializeAws_restJson1UpdateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/brokers/{BrokerId}/users/{Username}"; if (input.Username !== undefined) { @@ -830,9 +821,10 @@ export const serializeAws_restJson1UpdateUserCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConsoleAccess !== undefined && { consoleAccess: input.ConsoleAccess }), - ...(input.Groups !== undefined && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) }), - ...(input.Password !== undefined && { password: input.Password }), + ...(input.ConsoleAccess !== undefined && input.ConsoleAccess !== null && { consoleAccess: input.ConsoleAccess }), + ...(input.Groups !== undefined && + input.Groups !== null && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) }), + ...(input.Password !== undefined && input.Password !== null && { password: input.Password }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3004,34 +2996,51 @@ const deserializeAws_restJson1UnauthorizedExceptionResponse = async ( }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfUser = (input: User[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1User(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1User(entry, context); + }); }; const serializeAws_restJson1__mapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ConfigurationId = (input: ConfigurationId, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { id: input.Id }), - ...(input.Revision !== undefined && { revision: input.Revision }), + ...(input.Id !== undefined && input.Id !== null && { id: input.Id }), + ...(input.Revision !== undefined && input.Revision !== null && { revision: input.Revision }), }; }; const serializeAws_restJson1EncryptionOptions = (input: EncryptionOptions, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { kmsKeyId: input.KmsKeyId }), - ...(input.UseAwsOwnedKey !== undefined && { useAwsOwnedKey: input.UseAwsOwnedKey }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { kmsKeyId: input.KmsKeyId }), + ...(input.UseAwsOwnedKey !== undefined && + input.UseAwsOwnedKey !== null && { useAwsOwnedKey: input.UseAwsOwnedKey }), }; }; @@ -3040,116 +3049,217 @@ const serializeAws_restJson1LdapServerMetadataInput = ( context: __SerdeContext ): any => { return { - ...(input.Hosts !== undefined && { hosts: serializeAws_restJson1__listOf__string(input.Hosts, context) }), - ...(input.RoleBase !== undefined && { roleBase: input.RoleBase }), - ...(input.RoleName !== undefined && { roleName: input.RoleName }), - ...(input.RoleSearchMatching !== undefined && { roleSearchMatching: input.RoleSearchMatching }), - ...(input.RoleSearchSubtree !== undefined && { roleSearchSubtree: input.RoleSearchSubtree }), - ...(input.ServiceAccountPassword !== undefined && { serviceAccountPassword: input.ServiceAccountPassword }), - ...(input.ServiceAccountUsername !== undefined && { serviceAccountUsername: input.ServiceAccountUsername }), - ...(input.UserBase !== undefined && { userBase: input.UserBase }), - ...(input.UserRoleName !== undefined && { userRoleName: input.UserRoleName }), - ...(input.UserSearchMatching !== undefined && { userSearchMatching: input.UserSearchMatching }), - ...(input.UserSearchSubtree !== undefined && { userSearchSubtree: input.UserSearchSubtree }), + ...(input.Hosts !== undefined && + input.Hosts !== null && { hosts: serializeAws_restJson1__listOf__string(input.Hosts, context) }), + ...(input.RoleBase !== undefined && input.RoleBase !== null && { roleBase: input.RoleBase }), + ...(input.RoleName !== undefined && input.RoleName !== null && { roleName: input.RoleName }), + ...(input.RoleSearchMatching !== undefined && + input.RoleSearchMatching !== null && { roleSearchMatching: input.RoleSearchMatching }), + ...(input.RoleSearchSubtree !== undefined && + input.RoleSearchSubtree !== null && { roleSearchSubtree: input.RoleSearchSubtree }), + ...(input.ServiceAccountPassword !== undefined && + input.ServiceAccountPassword !== null && { serviceAccountPassword: input.ServiceAccountPassword }), + ...(input.ServiceAccountUsername !== undefined && + input.ServiceAccountUsername !== null && { serviceAccountUsername: input.ServiceAccountUsername }), + ...(input.UserBase !== undefined && input.UserBase !== null && { userBase: input.UserBase }), + ...(input.UserRoleName !== undefined && input.UserRoleName !== null && { userRoleName: input.UserRoleName }), + ...(input.UserSearchMatching !== undefined && + input.UserSearchMatching !== null && { userSearchMatching: input.UserSearchMatching }), + ...(input.UserSearchSubtree !== undefined && + input.UserSearchSubtree !== null && { userSearchSubtree: input.UserSearchSubtree }), }; }; const serializeAws_restJson1Logs = (input: Logs, context: __SerdeContext): any => { return { - ...(input.Audit !== undefined && { audit: input.Audit }), - ...(input.General !== undefined && { general: input.General }), + ...(input.Audit !== undefined && input.Audit !== null && { audit: input.Audit }), + ...(input.General !== undefined && input.General !== null && { general: input.General }), }; }; const serializeAws_restJson1User = (input: User, context: __SerdeContext): any => { return { - ...(input.ConsoleAccess !== undefined && { consoleAccess: input.ConsoleAccess }), - ...(input.Groups !== undefined && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) }), - ...(input.Password !== undefined && { password: input.Password }), - ...(input.Username !== undefined && { username: input.Username }), + ...(input.ConsoleAccess !== undefined && input.ConsoleAccess !== null && { consoleAccess: input.ConsoleAccess }), + ...(input.Groups !== undefined && + input.Groups !== null && { groups: serializeAws_restJson1__listOf__string(input.Groups, context) }), + ...(input.Password !== undefined && input.Password !== null && { password: input.Password }), + ...(input.Username !== undefined && input.Username !== null && { username: input.Username }), }; }; const serializeAws_restJson1WeeklyStartTime = (input: WeeklyStartTime, context: __SerdeContext): any => { return { - ...(input.DayOfWeek !== undefined && { dayOfWeek: input.DayOfWeek }), - ...(input.TimeOfDay !== undefined && { timeOfDay: input.TimeOfDay }), - ...(input.TimeZone !== undefined && { timeZone: input.TimeZone }), + ...(input.DayOfWeek !== undefined && input.DayOfWeek !== null && { dayOfWeek: input.DayOfWeek }), + ...(input.TimeOfDay !== undefined && input.TimeOfDay !== null && { timeOfDay: input.TimeOfDay }), + ...(input.TimeZone !== undefined && input.TimeZone !== null && { timeZone: input.TimeZone }), }; }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfAvailabilityZone = (output: any, context: __SerdeContext): AvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AvailabilityZone(entry, context); + }); }; const deserializeAws_restJson1__listOfBrokerEngineType = (output: any, context: __SerdeContext): BrokerEngineType[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BrokerEngineType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BrokerEngineType(entry, context); + }); }; const deserializeAws_restJson1__listOfBrokerInstance = (output: any, context: __SerdeContext): BrokerInstance[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BrokerInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BrokerInstance(entry, context); + }); }; const deserializeAws_restJson1__listOfBrokerInstanceOption = ( output: any, context: __SerdeContext ): BrokerInstanceOption[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BrokerInstanceOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BrokerInstanceOption(entry, context); + }); }; const deserializeAws_restJson1__listOfBrokerSummary = (output: any, context: __SerdeContext): BrokerSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BrokerSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BrokerSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfConfiguration = (output: any, context: __SerdeContext): Configuration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Configuration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Configuration(entry, context); + }); }; const deserializeAws_restJson1__listOfConfigurationId = (output: any, context: __SerdeContext): ConfigurationId[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConfigurationId(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConfigurationId(entry, context); + }); }; const deserializeAws_restJson1__listOfConfigurationRevision = ( output: any, context: __SerdeContext ): ConfigurationRevision[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ConfigurationRevision(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ConfigurationRevision(entry, context); + }); }; const deserializeAws_restJson1__listOfDeploymentMode = ( output: any, context: __SerdeContext ): (DeploymentMode | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfEngineVersion = (output: any, context: __SerdeContext): EngineVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EngineVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EngineVersion(entry, context); + }); }; const deserializeAws_restJson1__listOfSanitizationWarning = ( output: any, context: __SerdeContext ): SanitizationWarning[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SanitizationWarning(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SanitizationWarning(entry, context); + }); }; const deserializeAws_restJson1__listOfUserSummary = (output: any, context: __SerdeContext): UserSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UserSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UserSummary(entry, context); + }); }; const deserializeAws_restJson1__mapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AvailabilityZone = (output: any, context: __SerdeContext): AvailabilityZone => { @@ -3409,6 +3519,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-mturk/protocols/Aws_json1_1.ts b/clients/client-mturk/protocols/Aws_json1_1.ts index f838d6a1aed6..34a89aec4f34 100644 --- a/clients/client-mturk/protocols/Aws_json1_1.ts +++ b/clients/client-mturk/protocols/Aws_json1_1.ts @@ -218,7 +218,7 @@ export const serializeAws_json1_1AcceptQualificationRequestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.AcceptQualificationRequest", }; let body: any; @@ -231,7 +231,7 @@ export const serializeAws_json1_1ApproveAssignmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ApproveAssignment", }; let body: any; @@ -244,7 +244,7 @@ export const serializeAws_json1_1AssociateQualificationWithWorkerCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.AssociateQualificationWithWorker", }; let body: any; @@ -257,7 +257,7 @@ export const serializeAws_json1_1CreateAdditionalAssignmentsForHITCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.CreateAdditionalAssignmentsForHIT", }; let body: any; @@ -270,7 +270,7 @@ export const serializeAws_json1_1CreateHITCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.CreateHIT", }; let body: any; @@ -283,7 +283,7 @@ export const serializeAws_json1_1CreateHITTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.CreateHITType", }; let body: any; @@ -296,7 +296,7 @@ export const serializeAws_json1_1CreateHITWithHITTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.CreateHITWithHITType", }; let body: any; @@ -309,7 +309,7 @@ export const serializeAws_json1_1CreateQualificationTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.CreateQualificationType", }; let body: any; @@ -322,7 +322,7 @@ export const serializeAws_json1_1CreateWorkerBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.CreateWorkerBlock", }; let body: any; @@ -335,7 +335,7 @@ export const serializeAws_json1_1DeleteHITCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.DeleteHIT", }; let body: any; @@ -348,7 +348,7 @@ export const serializeAws_json1_1DeleteQualificationTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.DeleteQualificationType", }; let body: any; @@ -361,7 +361,7 @@ export const serializeAws_json1_1DeleteWorkerBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.DeleteWorkerBlock", }; let body: any; @@ -374,7 +374,7 @@ export const serializeAws_json1_1DisassociateQualificationFromWorkerCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.DisassociateQualificationFromWorker", }; let body: any; @@ -387,7 +387,7 @@ export const serializeAws_json1_1GetAccountBalanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.GetAccountBalance", }; let body: any; @@ -400,7 +400,7 @@ export const serializeAws_json1_1GetAssignmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.GetAssignment", }; let body: any; @@ -413,7 +413,7 @@ export const serializeAws_json1_1GetFileUploadURLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.GetFileUploadURL", }; let body: any; @@ -426,7 +426,7 @@ export const serializeAws_json1_1GetHITCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.GetHIT", }; let body: any; @@ -439,7 +439,7 @@ export const serializeAws_json1_1GetQualificationScoreCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.GetQualificationScore", }; let body: any; @@ -452,7 +452,7 @@ export const serializeAws_json1_1GetQualificationTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.GetQualificationType", }; let body: any; @@ -465,7 +465,7 @@ export const serializeAws_json1_1ListAssignmentsForHITCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListAssignmentsForHIT", }; let body: any; @@ -478,7 +478,7 @@ export const serializeAws_json1_1ListBonusPaymentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListBonusPayments", }; let body: any; @@ -491,7 +491,7 @@ export const serializeAws_json1_1ListHITsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListHITs", }; let body: any; @@ -504,7 +504,7 @@ export const serializeAws_json1_1ListHITsForQualificationTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListHITsForQualificationType", }; let body: any; @@ -517,7 +517,7 @@ export const serializeAws_json1_1ListQualificationRequestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListQualificationRequests", }; let body: any; @@ -530,7 +530,7 @@ export const serializeAws_json1_1ListQualificationTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListQualificationTypes", }; let body: any; @@ -543,7 +543,7 @@ export const serializeAws_json1_1ListReviewableHITsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListReviewableHITs", }; let body: any; @@ -556,7 +556,7 @@ export const serializeAws_json1_1ListReviewPolicyResultsForHITCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListReviewPolicyResultsForHIT", }; let body: any; @@ -569,7 +569,7 @@ export const serializeAws_json1_1ListWorkerBlocksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListWorkerBlocks", }; let body: any; @@ -582,7 +582,7 @@ export const serializeAws_json1_1ListWorkersWithQualificationTypeCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.ListWorkersWithQualificationType", }; let body: any; @@ -595,7 +595,7 @@ export const serializeAws_json1_1NotifyWorkersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.NotifyWorkers", }; let body: any; @@ -608,7 +608,7 @@ export const serializeAws_json1_1RejectAssignmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.RejectAssignment", }; let body: any; @@ -621,7 +621,7 @@ export const serializeAws_json1_1RejectQualificationRequestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.RejectQualificationRequest", }; let body: any; @@ -634,7 +634,7 @@ export const serializeAws_json1_1SendBonusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.SendBonus", }; let body: any; @@ -647,7 +647,7 @@ export const serializeAws_json1_1SendTestEventNotificationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.SendTestEventNotification", }; let body: any; @@ -660,7 +660,7 @@ export const serializeAws_json1_1UpdateExpirationForHITCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.UpdateExpirationForHIT", }; let body: any; @@ -673,7 +673,7 @@ export const serializeAws_json1_1UpdateHITReviewStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.UpdateHITReviewStatus", }; let body: any; @@ -686,7 +686,7 @@ export const serializeAws_json1_1UpdateHITTypeOfHITCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.UpdateHITTypeOfHIT", }; let body: any; @@ -699,7 +699,7 @@ export const serializeAws_json1_1UpdateNotificationSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.UpdateNotificationSettings", }; let body: any; @@ -712,7 +712,7 @@ export const serializeAws_json1_1UpdateQualificationTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "MTurkRequesterServiceV20170117.UpdateQualificationType", }; let body: any; @@ -747,8 +747,7 @@ const deserializeAws_json1_1AcceptQualificationRequestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -810,8 +809,7 @@ const deserializeAws_json1_1ApproveAssignmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -873,8 +871,7 @@ const deserializeAws_json1_1AssociateQualificationWithWorkerCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -936,8 +933,7 @@ const deserializeAws_json1_1CreateAdditionalAssignmentsForHITCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -999,8 +995,7 @@ const deserializeAws_json1_1CreateHITCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1062,8 +1057,7 @@ const deserializeAws_json1_1CreateHITTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1125,8 +1119,7 @@ const deserializeAws_json1_1CreateHITWithHITTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1188,8 +1181,7 @@ const deserializeAws_json1_1CreateQualificationTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1251,8 +1243,7 @@ const deserializeAws_json1_1CreateWorkerBlockCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1314,8 +1305,7 @@ const deserializeAws_json1_1DeleteHITCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1377,8 +1367,7 @@ const deserializeAws_json1_1DeleteQualificationTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1440,8 +1429,7 @@ const deserializeAws_json1_1DeleteWorkerBlockCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1503,8 +1491,7 @@ const deserializeAws_json1_1DisassociateQualificationFromWorkerCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1566,8 +1553,7 @@ const deserializeAws_json1_1GetAccountBalanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1629,8 +1615,7 @@ const deserializeAws_json1_1GetAssignmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1692,8 +1677,7 @@ const deserializeAws_json1_1GetFileUploadURLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1755,8 +1739,7 @@ const deserializeAws_json1_1GetHITCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1818,8 +1801,7 @@ const deserializeAws_json1_1GetQualificationScoreCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1881,8 +1863,7 @@ const deserializeAws_json1_1GetQualificationTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -1944,8 +1925,7 @@ const deserializeAws_json1_1ListAssignmentsForHITCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2007,8 +1987,7 @@ const deserializeAws_json1_1ListBonusPaymentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2070,8 +2049,7 @@ const deserializeAws_json1_1ListHITsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2133,8 +2111,7 @@ const deserializeAws_json1_1ListHITsForQualificationTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2196,8 +2173,7 @@ const deserializeAws_json1_1ListQualificationRequestsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2259,8 +2235,7 @@ const deserializeAws_json1_1ListQualificationTypesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2322,8 +2297,7 @@ const deserializeAws_json1_1ListReviewableHITsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2385,8 +2359,7 @@ const deserializeAws_json1_1ListReviewPolicyResultsForHITCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2448,8 +2421,7 @@ const deserializeAws_json1_1ListWorkerBlocksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2511,8 +2483,7 @@ const deserializeAws_json1_1ListWorkersWithQualificationTypeCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2574,8 +2545,7 @@ const deserializeAws_json1_1NotifyWorkersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2637,8 +2607,7 @@ const deserializeAws_json1_1RejectAssignmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2700,8 +2669,7 @@ const deserializeAws_json1_1RejectQualificationRequestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2763,8 +2731,7 @@ const deserializeAws_json1_1SendBonusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2826,8 +2793,7 @@ const deserializeAws_json1_1SendTestEventNotificationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2889,8 +2855,7 @@ const deserializeAws_json1_1UpdateExpirationForHITCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -2952,8 +2917,7 @@ const deserializeAws_json1_1UpdateHITReviewStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -3015,8 +2979,7 @@ const deserializeAws_json1_1UpdateHITTypeOfHITCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -3078,8 +3041,7 @@ const deserializeAws_json1_1UpdateNotificationSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -3141,8 +3103,7 @@ const deserializeAws_json1_1UpdateQualificationTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "RequestError": case "com.amazonaws.mturk#RequestError": @@ -3212,8 +3173,9 @@ const serializeAws_json1_1AcceptQualificationRequestRequest = ( context: __SerdeContext ): any => { return { - ...(input.IntegerValue !== undefined && { IntegerValue: input.IntegerValue }), - ...(input.QualificationRequestId !== undefined && { QualificationRequestId: input.QualificationRequestId }), + ...(input.IntegerValue !== undefined && input.IntegerValue !== null && { IntegerValue: input.IntegerValue }), + ...(input.QualificationRequestId !== undefined && + input.QualificationRequestId !== null && { QualificationRequestId: input.QualificationRequestId }), }; }; @@ -3222,9 +3184,11 @@ const serializeAws_json1_1ApproveAssignmentRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssignmentId !== undefined && { AssignmentId: input.AssignmentId }), - ...(input.OverrideRejection !== undefined && { OverrideRejection: input.OverrideRejection }), - ...(input.RequesterFeedback !== undefined && { RequesterFeedback: input.RequesterFeedback }), + ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }), + ...(input.OverrideRejection !== undefined && + input.OverrideRejection !== null && { OverrideRejection: input.OverrideRejection }), + ...(input.RequesterFeedback !== undefined && + input.RequesterFeedback !== null && { RequesterFeedback: input.RequesterFeedback }), }; }; @@ -3232,7 +3196,14 @@ const serializeAws_json1_1AssignmentStatusList = ( input: (AssignmentStatus | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssociateQualificationWithWorkerRequest = ( @@ -3240,10 +3211,12 @@ const serializeAws_json1_1AssociateQualificationWithWorkerRequest = ( context: __SerdeContext ): any => { return { - ...(input.IntegerValue !== undefined && { IntegerValue: input.IntegerValue }), - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), - ...(input.SendNotification !== undefined && { SendNotification: input.SendNotification }), - ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }), + ...(input.IntegerValue !== undefined && input.IntegerValue !== null && { IntegerValue: input.IntegerValue }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), + ...(input.SendNotification !== undefined && + input.SendNotification !== null && { SendNotification: input.SendNotification }), + ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }), }; }; @@ -3252,68 +3225,75 @@ const serializeAws_json1_1CreateAdditionalAssignmentsForHITRequest = ( context: __SerdeContext ): any => { return { - ...(input.HITId !== undefined && { HITId: input.HITId }), - ...(input.NumberOfAdditionalAssignments !== undefined && { - NumberOfAdditionalAssignments: input.NumberOfAdditionalAssignments, - }), - ...(input.UniqueRequestToken !== undefined && { UniqueRequestToken: input.UniqueRequestToken }), + ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }), + ...(input.NumberOfAdditionalAssignments !== undefined && + input.NumberOfAdditionalAssignments !== null && { + NumberOfAdditionalAssignments: input.NumberOfAdditionalAssignments, + }), + ...(input.UniqueRequestToken !== undefined && + input.UniqueRequestToken !== null && { UniqueRequestToken: input.UniqueRequestToken }), }; }; const serializeAws_json1_1CreateHITRequest = (input: CreateHITRequest, context: __SerdeContext): any => { return { - ...(input.AssignmentDurationInSeconds !== undefined && { - AssignmentDurationInSeconds: input.AssignmentDurationInSeconds, - }), - ...(input.AssignmentReviewPolicy !== undefined && { - AssignmentReviewPolicy: serializeAws_json1_1ReviewPolicy(input.AssignmentReviewPolicy, context), - }), - ...(input.AutoApprovalDelayInSeconds !== undefined && { - AutoApprovalDelayInSeconds: input.AutoApprovalDelayInSeconds, - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.HITLayoutId !== undefined && { HITLayoutId: input.HITLayoutId }), - ...(input.HITLayoutParameters !== undefined && { - HITLayoutParameters: serializeAws_json1_1HITLayoutParameterList(input.HITLayoutParameters, context), - }), - ...(input.HITReviewPolicy !== undefined && { - HITReviewPolicy: serializeAws_json1_1ReviewPolicy(input.HITReviewPolicy, context), - }), - ...(input.Keywords !== undefined && { Keywords: input.Keywords }), - ...(input.LifetimeInSeconds !== undefined && { LifetimeInSeconds: input.LifetimeInSeconds }), - ...(input.MaxAssignments !== undefined && { MaxAssignments: input.MaxAssignments }), - ...(input.QualificationRequirements !== undefined && { - QualificationRequirements: serializeAws_json1_1QualificationRequirementList( - input.QualificationRequirements, - context - ), - }), - ...(input.Question !== undefined && { Question: input.Question }), - ...(input.RequesterAnnotation !== undefined && { RequesterAnnotation: input.RequesterAnnotation }), - ...(input.Reward !== undefined && { Reward: input.Reward }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.UniqueRequestToken !== undefined && { UniqueRequestToken: input.UniqueRequestToken }), + ...(input.AssignmentDurationInSeconds !== undefined && + input.AssignmentDurationInSeconds !== null && { AssignmentDurationInSeconds: input.AssignmentDurationInSeconds }), + ...(input.AssignmentReviewPolicy !== undefined && + input.AssignmentReviewPolicy !== null && { + AssignmentReviewPolicy: serializeAws_json1_1ReviewPolicy(input.AssignmentReviewPolicy, context), + }), + ...(input.AutoApprovalDelayInSeconds !== undefined && + input.AutoApprovalDelayInSeconds !== null && { AutoApprovalDelayInSeconds: input.AutoApprovalDelayInSeconds }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.HITLayoutId !== undefined && input.HITLayoutId !== null && { HITLayoutId: input.HITLayoutId }), + ...(input.HITLayoutParameters !== undefined && + input.HITLayoutParameters !== null && { + HITLayoutParameters: serializeAws_json1_1HITLayoutParameterList(input.HITLayoutParameters, context), + }), + ...(input.HITReviewPolicy !== undefined && + input.HITReviewPolicy !== null && { + HITReviewPolicy: serializeAws_json1_1ReviewPolicy(input.HITReviewPolicy, context), + }), + ...(input.Keywords !== undefined && input.Keywords !== null && { Keywords: input.Keywords }), + ...(input.LifetimeInSeconds !== undefined && + input.LifetimeInSeconds !== null && { LifetimeInSeconds: input.LifetimeInSeconds }), + ...(input.MaxAssignments !== undefined && + input.MaxAssignments !== null && { MaxAssignments: input.MaxAssignments }), + ...(input.QualificationRequirements !== undefined && + input.QualificationRequirements !== null && { + QualificationRequirements: serializeAws_json1_1QualificationRequirementList( + input.QualificationRequirements, + context + ), + }), + ...(input.Question !== undefined && input.Question !== null && { Question: input.Question }), + ...(input.RequesterAnnotation !== undefined && + input.RequesterAnnotation !== null && { RequesterAnnotation: input.RequesterAnnotation }), + ...(input.Reward !== undefined && input.Reward !== null && { Reward: input.Reward }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.UniqueRequestToken !== undefined && + input.UniqueRequestToken !== null && { UniqueRequestToken: input.UniqueRequestToken }), }; }; const serializeAws_json1_1CreateHITTypeRequest = (input: CreateHITTypeRequest, context: __SerdeContext): any => { return { - ...(input.AssignmentDurationInSeconds !== undefined && { - AssignmentDurationInSeconds: input.AssignmentDurationInSeconds, - }), - ...(input.AutoApprovalDelayInSeconds !== undefined && { - AutoApprovalDelayInSeconds: input.AutoApprovalDelayInSeconds, - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Keywords !== undefined && { Keywords: input.Keywords }), - ...(input.QualificationRequirements !== undefined && { - QualificationRequirements: serializeAws_json1_1QualificationRequirementList( - input.QualificationRequirements, - context - ), - }), - ...(input.Reward !== undefined && { Reward: input.Reward }), - ...(input.Title !== undefined && { Title: input.Title }), + ...(input.AssignmentDurationInSeconds !== undefined && + input.AssignmentDurationInSeconds !== null && { AssignmentDurationInSeconds: input.AssignmentDurationInSeconds }), + ...(input.AutoApprovalDelayInSeconds !== undefined && + input.AutoApprovalDelayInSeconds !== null && { AutoApprovalDelayInSeconds: input.AutoApprovalDelayInSeconds }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Keywords !== undefined && input.Keywords !== null && { Keywords: input.Keywords }), + ...(input.QualificationRequirements !== undefined && + input.QualificationRequirements !== null && { + QualificationRequirements: serializeAws_json1_1QualificationRequirementList( + input.QualificationRequirements, + context + ), + }), + ...(input.Reward !== undefined && input.Reward !== null && { Reward: input.Reward }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), }; }; @@ -3322,22 +3302,29 @@ const serializeAws_json1_1CreateHITWithHITTypeRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssignmentReviewPolicy !== undefined && { - AssignmentReviewPolicy: serializeAws_json1_1ReviewPolicy(input.AssignmentReviewPolicy, context), - }), - ...(input.HITLayoutId !== undefined && { HITLayoutId: input.HITLayoutId }), - ...(input.HITLayoutParameters !== undefined && { - HITLayoutParameters: serializeAws_json1_1HITLayoutParameterList(input.HITLayoutParameters, context), - }), - ...(input.HITReviewPolicy !== undefined && { - HITReviewPolicy: serializeAws_json1_1ReviewPolicy(input.HITReviewPolicy, context), - }), - ...(input.HITTypeId !== undefined && { HITTypeId: input.HITTypeId }), - ...(input.LifetimeInSeconds !== undefined && { LifetimeInSeconds: input.LifetimeInSeconds }), - ...(input.MaxAssignments !== undefined && { MaxAssignments: input.MaxAssignments }), - ...(input.Question !== undefined && { Question: input.Question }), - ...(input.RequesterAnnotation !== undefined && { RequesterAnnotation: input.RequesterAnnotation }), - ...(input.UniqueRequestToken !== undefined && { UniqueRequestToken: input.UniqueRequestToken }), + ...(input.AssignmentReviewPolicy !== undefined && + input.AssignmentReviewPolicy !== null && { + AssignmentReviewPolicy: serializeAws_json1_1ReviewPolicy(input.AssignmentReviewPolicy, context), + }), + ...(input.HITLayoutId !== undefined && input.HITLayoutId !== null && { HITLayoutId: input.HITLayoutId }), + ...(input.HITLayoutParameters !== undefined && + input.HITLayoutParameters !== null && { + HITLayoutParameters: serializeAws_json1_1HITLayoutParameterList(input.HITLayoutParameters, context), + }), + ...(input.HITReviewPolicy !== undefined && + input.HITReviewPolicy !== null && { + HITReviewPolicy: serializeAws_json1_1ReviewPolicy(input.HITReviewPolicy, context), + }), + ...(input.HITTypeId !== undefined && input.HITTypeId !== null && { HITTypeId: input.HITTypeId }), + ...(input.LifetimeInSeconds !== undefined && + input.LifetimeInSeconds !== null && { LifetimeInSeconds: input.LifetimeInSeconds }), + ...(input.MaxAssignments !== undefined && + input.MaxAssignments !== null && { MaxAssignments: input.MaxAssignments }), + ...(input.Question !== undefined && input.Question !== null && { Question: input.Question }), + ...(input.RequesterAnnotation !== undefined && + input.RequesterAnnotation !== null && { RequesterAnnotation: input.RequesterAnnotation }), + ...(input.UniqueRequestToken !== undefined && + input.UniqueRequestToken !== null && { UniqueRequestToken: input.UniqueRequestToken }), }; }; @@ -3346,16 +3333,20 @@ const serializeAws_json1_1CreateQualificationTypeRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnswerKey !== undefined && { AnswerKey: input.AnswerKey }), - ...(input.AutoGranted !== undefined && { AutoGranted: input.AutoGranted }), - ...(input.AutoGrantedValue !== undefined && { AutoGrantedValue: input.AutoGrantedValue }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Keywords !== undefined && { Keywords: input.Keywords }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.QualificationTypeStatus !== undefined && { QualificationTypeStatus: input.QualificationTypeStatus }), - ...(input.RetryDelayInSeconds !== undefined && { RetryDelayInSeconds: input.RetryDelayInSeconds }), - ...(input.Test !== undefined && { Test: input.Test }), - ...(input.TestDurationInSeconds !== undefined && { TestDurationInSeconds: input.TestDurationInSeconds }), + ...(input.AnswerKey !== undefined && input.AnswerKey !== null && { AnswerKey: input.AnswerKey }), + ...(input.AutoGranted !== undefined && input.AutoGranted !== null && { AutoGranted: input.AutoGranted }), + ...(input.AutoGrantedValue !== undefined && + input.AutoGrantedValue !== null && { AutoGrantedValue: input.AutoGrantedValue }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Keywords !== undefined && input.Keywords !== null && { Keywords: input.Keywords }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.QualificationTypeStatus !== undefined && + input.QualificationTypeStatus !== null && { QualificationTypeStatus: input.QualificationTypeStatus }), + ...(input.RetryDelayInSeconds !== undefined && + input.RetryDelayInSeconds !== null && { RetryDelayInSeconds: input.RetryDelayInSeconds }), + ...(input.Test !== undefined && input.Test !== null && { Test: input.Test }), + ...(input.TestDurationInSeconds !== undefined && + input.TestDurationInSeconds !== null && { TestDurationInSeconds: input.TestDurationInSeconds }), }; }; @@ -3364,18 +3355,25 @@ const serializeAws_json1_1CreateWorkerBlockRequest = ( context: __SerdeContext ): any => { return { - ...(input.Reason !== undefined && { Reason: input.Reason }), - ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }), + ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }), + ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }), }; }; const serializeAws_json1_1CustomerIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteHITRequest = (input: DeleteHITRequest, context: __SerdeContext): any => { return { - ...(input.HITId !== undefined && { HITId: input.HITId }), + ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }), }; }; @@ -3384,7 +3382,8 @@ const serializeAws_json1_1DeleteQualificationTypeRequest = ( context: __SerdeContext ): any => { return { - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), }; }; @@ -3393,8 +3392,8 @@ const serializeAws_json1_1DeleteWorkerBlockRequest = ( context: __SerdeContext ): any => { return { - ...(input.Reason !== undefined && { Reason: input.Reason }), - ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }), + ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }), + ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }), }; }; @@ -3403,14 +3402,22 @@ const serializeAws_json1_1DisassociateQualificationFromWorkerRequest = ( context: __SerdeContext ): any => { return { - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), - ...(input.Reason !== undefined && { Reason: input.Reason }), - ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), + ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }), + ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }), }; }; const serializeAws_json1_1EventTypeList = (input: (EventType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetAccountBalanceRequest = ( @@ -3422,20 +3429,21 @@ const serializeAws_json1_1GetAccountBalanceRequest = ( const serializeAws_json1_1GetAssignmentRequest = (input: GetAssignmentRequest, context: __SerdeContext): any => { return { - ...(input.AssignmentId !== undefined && { AssignmentId: input.AssignmentId }), + ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }), }; }; const serializeAws_json1_1GetFileUploadURLRequest = (input: GetFileUploadURLRequest, context: __SerdeContext): any => { return { - ...(input.AssignmentId !== undefined && { AssignmentId: input.AssignmentId }), - ...(input.QuestionIdentifier !== undefined && { QuestionIdentifier: input.QuestionIdentifier }), + ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }), + ...(input.QuestionIdentifier !== undefined && + input.QuestionIdentifier !== null && { QuestionIdentifier: input.QuestionIdentifier }), }; }; const serializeAws_json1_1GetHITRequest = (input: GetHITRequest, context: __SerdeContext): any => { return { - ...(input.HITId !== undefined && { HITId: input.HITId }), + ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }), }; }; @@ -3444,8 +3452,9 @@ const serializeAws_json1_1GetQualificationScoreRequest = ( context: __SerdeContext ): any => { return { - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), - ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), + ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }), }; }; @@ -3454,23 +3463,38 @@ const serializeAws_json1_1GetQualificationTypeRequest = ( context: __SerdeContext ): any => { return { - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), }; }; const serializeAws_json1_1HITLayoutParameter = (input: HITLayoutParameter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1HITLayoutParameterList = (input: HITLayoutParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1HITLayoutParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1HITLayoutParameter(entry, context); + }); }; const serializeAws_json1_1IntegerList = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListAssignmentsForHITRequest = ( @@ -3478,12 +3502,13 @@ const serializeAws_json1_1ListAssignmentsForHITRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssignmentStatuses !== undefined && { - AssignmentStatuses: serializeAws_json1_1AssignmentStatusList(input.AssignmentStatuses, context), - }), - ...(input.HITId !== undefined && { HITId: input.HITId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AssignmentStatuses !== undefined && + input.AssignmentStatuses !== null && { + AssignmentStatuses: serializeAws_json1_1AssignmentStatusList(input.AssignmentStatuses, context), + }), + ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3492,10 +3517,10 @@ const serializeAws_json1_1ListBonusPaymentsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssignmentId !== undefined && { AssignmentId: input.AssignmentId }), - ...(input.HITId !== undefined && { HITId: input.HITId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }), + ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3504,16 +3529,17 @@ const serializeAws_json1_1ListHITsForQualificationTypeRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), }; }; const serializeAws_json1_1ListHITsRequest = (input: ListHITsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3522,9 +3548,10 @@ const serializeAws_json1_1ListQualificationRequestsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), }; }; @@ -3533,11 +3560,13 @@ const serializeAws_json1_1ListQualificationTypesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MustBeOwnedByCaller !== undefined && { MustBeOwnedByCaller: input.MustBeOwnedByCaller }), - ...(input.MustBeRequestable !== undefined && { MustBeRequestable: input.MustBeRequestable }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Query !== undefined && { Query: input.Query }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MustBeOwnedByCaller !== undefined && + input.MustBeOwnedByCaller !== null && { MustBeOwnedByCaller: input.MustBeOwnedByCaller }), + ...(input.MustBeRequestable !== undefined && + input.MustBeRequestable !== null && { MustBeRequestable: input.MustBeRequestable }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Query !== undefined && input.Query !== null && { Query: input.Query }), }; }; @@ -3546,10 +3575,10 @@ const serializeAws_json1_1ListReviewableHITsRequest = ( context: __SerdeContext ): any => { return { - ...(input.HITTypeId !== undefined && { HITTypeId: input.HITTypeId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.HITTypeId !== undefined && input.HITTypeId !== null && { HITTypeId: input.HITTypeId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -3558,21 +3587,24 @@ const serializeAws_json1_1ListReviewPolicyResultsForHITRequest = ( context: __SerdeContext ): any => { return { - ...(input.HITId !== undefined && { HITId: input.HITId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PolicyLevels !== undefined && { - PolicyLevels: serializeAws_json1_1ReviewPolicyLevelList(input.PolicyLevels, context), - }), - ...(input.RetrieveActions !== undefined && { RetrieveActions: input.RetrieveActions }), - ...(input.RetrieveResults !== undefined && { RetrieveResults: input.RetrieveResults }), + ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PolicyLevels !== undefined && + input.PolicyLevels !== null && { + PolicyLevels: serializeAws_json1_1ReviewPolicyLevelList(input.PolicyLevels, context), + }), + ...(input.RetrieveActions !== undefined && + input.RetrieveActions !== null && { RetrieveActions: input.RetrieveActions }), + ...(input.RetrieveResults !== undefined && + input.RetrieveResults !== null && { RetrieveResults: input.RetrieveResults }), }; }; const serializeAws_json1_1ListWorkerBlocksRequest = (input: ListWorkerBlocksRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3581,22 +3613,30 @@ const serializeAws_json1_1ListWorkersWithQualificationTypeRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; const serializeAws_json1_1Locale = (input: Locale, context: __SerdeContext): any => { return { - ...(input.Country !== undefined && { Country: input.Country }), - ...(input.Subdivision !== undefined && { Subdivision: input.Subdivision }), + ...(input.Country !== undefined && input.Country !== null && { Country: input.Country }), + ...(input.Subdivision !== undefined && input.Subdivision !== null && { Subdivision: input.Subdivision }), }; }; const serializeAws_json1_1LocaleList = (input: Locale[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Locale(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Locale(entry, context); + }); }; const serializeAws_json1_1NotificationSpecification = ( @@ -3604,44 +3644,63 @@ const serializeAws_json1_1NotificationSpecification = ( context: __SerdeContext ): any => { return { - ...(input.Destination !== undefined && { Destination: input.Destination }), - ...(input.EventTypes !== undefined && { EventTypes: serializeAws_json1_1EventTypeList(input.EventTypes, context) }), - ...(input.Transport !== undefined && { Transport: input.Transport }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Destination !== undefined && input.Destination !== null && { Destination: input.Destination }), + ...(input.EventTypes !== undefined && + input.EventTypes !== null && { EventTypes: serializeAws_json1_1EventTypeList(input.EventTypes, context) }), + ...(input.Transport !== undefined && input.Transport !== null && { Transport: input.Transport }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_json1_1NotifyWorkersRequest = (input: NotifyWorkersRequest, context: __SerdeContext): any => { return { - ...(input.MessageText !== undefined && { MessageText: input.MessageText }), - ...(input.Subject !== undefined && { Subject: input.Subject }), - ...(input.WorkerIds !== undefined && { WorkerIds: serializeAws_json1_1CustomerIdList(input.WorkerIds, context) }), + ...(input.MessageText !== undefined && input.MessageText !== null && { MessageText: input.MessageText }), + ...(input.Subject !== undefined && input.Subject !== null && { Subject: input.Subject }), + ...(input.WorkerIds !== undefined && + input.WorkerIds !== null && { WorkerIds: serializeAws_json1_1CustomerIdList(input.WorkerIds, context) }), }; }; const serializeAws_json1_1ParameterMapEntry = (input: ParameterMapEntry, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1StringList(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1StringList(input.Values, context) }), }; }; const serializeAws_json1_1ParameterMapEntryList = (input: ParameterMapEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ParameterMapEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ParameterMapEntry(entry, context); + }); }; const serializeAws_json1_1PolicyParameter = (input: PolicyParameter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.MapEntries !== undefined && { - MapEntries: serializeAws_json1_1ParameterMapEntryList(input.MapEntries, context), - }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1StringList(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.MapEntries !== undefined && + input.MapEntries !== null && { + MapEntries: serializeAws_json1_1ParameterMapEntryList(input.MapEntries, context), + }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1StringList(input.Values, context) }), }; }; const serializeAws_json1_1PolicyParameterList = (input: PolicyParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PolicyParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PolicyParameter(entry, context); + }); }; const serializeAws_json1_1QualificationRequirement = ( @@ -3649,16 +3708,17 @@ const serializeAws_json1_1QualificationRequirement = ( context: __SerdeContext ): any => { return { - ...(input.ActionsGuarded !== undefined && { ActionsGuarded: input.ActionsGuarded }), - ...(input.Comparator !== undefined && { Comparator: input.Comparator }), - ...(input.IntegerValues !== undefined && { - IntegerValues: serializeAws_json1_1IntegerList(input.IntegerValues, context), - }), - ...(input.LocaleValues !== undefined && { - LocaleValues: serializeAws_json1_1LocaleList(input.LocaleValues, context), - }), - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), - ...(input.RequiredToPreview !== undefined && { RequiredToPreview: input.RequiredToPreview }), + ...(input.ActionsGuarded !== undefined && + input.ActionsGuarded !== null && { ActionsGuarded: input.ActionsGuarded }), + ...(input.Comparator !== undefined && input.Comparator !== null && { Comparator: input.Comparator }), + ...(input.IntegerValues !== undefined && + input.IntegerValues !== null && { IntegerValues: serializeAws_json1_1IntegerList(input.IntegerValues, context) }), + ...(input.LocaleValues !== undefined && + input.LocaleValues !== null && { LocaleValues: serializeAws_json1_1LocaleList(input.LocaleValues, context) }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), + ...(input.RequiredToPreview !== undefined && + input.RequiredToPreview !== null && { RequiredToPreview: input.RequiredToPreview }), }; }; @@ -3666,13 +3726,21 @@ const serializeAws_json1_1QualificationRequirementList = ( input: QualificationRequirement[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1QualificationRequirement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1QualificationRequirement(entry, context); + }); }; const serializeAws_json1_1RejectAssignmentRequest = (input: RejectAssignmentRequest, context: __SerdeContext): any => { return { - ...(input.AssignmentId !== undefined && { AssignmentId: input.AssignmentId }), - ...(input.RequesterFeedback !== undefined && { RequesterFeedback: input.RequesterFeedback }), + ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }), + ...(input.RequesterFeedback !== undefined && + input.RequesterFeedback !== null && { RequesterFeedback: input.RequesterFeedback }), }; }; @@ -3681,17 +3749,17 @@ const serializeAws_json1_1RejectQualificationRequestRequest = ( context: __SerdeContext ): any => { return { - ...(input.QualificationRequestId !== undefined && { QualificationRequestId: input.QualificationRequestId }), - ...(input.Reason !== undefined && { Reason: input.Reason }), + ...(input.QualificationRequestId !== undefined && + input.QualificationRequestId !== null && { QualificationRequestId: input.QualificationRequestId }), + ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }), }; }; const serializeAws_json1_1ReviewPolicy = (input: ReviewPolicy, context: __SerdeContext): any => { return { - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1PolicyParameterList(input.Parameters, context), - }), - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1PolicyParameterList(input.Parameters, context) }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), }; }; @@ -3699,16 +3767,24 @@ const serializeAws_json1_1ReviewPolicyLevelList = ( input: (ReviewPolicyLevel | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SendBonusRequest = (input: SendBonusRequest, context: __SerdeContext): any => { return { - ...(input.AssignmentId !== undefined && { AssignmentId: input.AssignmentId }), - ...(input.BonusAmount !== undefined && { BonusAmount: input.BonusAmount }), - ...(input.Reason !== undefined && { Reason: input.Reason }), - ...(input.UniqueRequestToken !== undefined && { UniqueRequestToken: input.UniqueRequestToken }), - ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }), + ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }), + ...(input.BonusAmount !== undefined && input.BonusAmount !== null && { BonusAmount: input.BonusAmount }), + ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }), + ...(input.UniqueRequestToken !== undefined && + input.UniqueRequestToken !== null && { UniqueRequestToken: input.UniqueRequestToken }), + ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }), }; }; @@ -3717,15 +3793,23 @@ const serializeAws_json1_1SendTestEventNotificationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1NotificationSpecification(input.Notification, context), - }), - ...(input.TestEventType !== undefined && { TestEventType: input.TestEventType }), + ...(input.Notification !== undefined && + input.Notification !== null && { + Notification: serializeAws_json1_1NotificationSpecification(input.Notification, context), + }), + ...(input.TestEventType !== undefined && input.TestEventType !== null && { TestEventType: input.TestEventType }), }; }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UpdateExpirationForHITRequest = ( @@ -3733,8 +3817,9 @@ const serializeAws_json1_1UpdateExpirationForHITRequest = ( context: __SerdeContext ): any => { return { - ...(input.ExpireAt !== undefined && { ExpireAt: Math.round(input.ExpireAt.getTime() / 1000) }), - ...(input.HITId !== undefined && { HITId: input.HITId }), + ...(input.ExpireAt !== undefined && + input.ExpireAt !== null && { ExpireAt: Math.round(input.ExpireAt.getTime() / 1000) }), + ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }), }; }; @@ -3743,8 +3828,8 @@ const serializeAws_json1_1UpdateHITReviewStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.HITId !== undefined && { HITId: input.HITId }), - ...(input.Revert !== undefined && { Revert: input.Revert }), + ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }), + ...(input.Revert !== undefined && input.Revert !== null && { Revert: input.Revert }), }; }; @@ -3753,8 +3838,8 @@ const serializeAws_json1_1UpdateHITTypeOfHITRequest = ( context: __SerdeContext ): any => { return { - ...(input.HITId !== undefined && { HITId: input.HITId }), - ...(input.HITTypeId !== undefined && { HITTypeId: input.HITTypeId }), + ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }), + ...(input.HITTypeId !== undefined && input.HITTypeId !== null && { HITTypeId: input.HITTypeId }), }; }; @@ -3763,11 +3848,12 @@ const serializeAws_json1_1UpdateNotificationSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Active !== undefined && { Active: input.Active }), - ...(input.HITTypeId !== undefined && { HITTypeId: input.HITTypeId }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1NotificationSpecification(input.Notification, context), - }), + ...(input.Active !== undefined && input.Active !== null && { Active: input.Active }), + ...(input.HITTypeId !== undefined && input.HITTypeId !== null && { HITTypeId: input.HITTypeId }), + ...(input.Notification !== undefined && + input.Notification !== null && { + Notification: serializeAws_json1_1NotificationSpecification(input.Notification, context), + }), }; }; @@ -3776,15 +3862,20 @@ const serializeAws_json1_1UpdateQualificationTypeRequest = ( context: __SerdeContext ): any => { return { - ...(input.AnswerKey !== undefined && { AnswerKey: input.AnswerKey }), - ...(input.AutoGranted !== undefined && { AutoGranted: input.AutoGranted }), - ...(input.AutoGrantedValue !== undefined && { AutoGrantedValue: input.AutoGrantedValue }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.QualificationTypeId !== undefined && { QualificationTypeId: input.QualificationTypeId }), - ...(input.QualificationTypeStatus !== undefined && { QualificationTypeStatus: input.QualificationTypeStatus }), - ...(input.RetryDelayInSeconds !== undefined && { RetryDelayInSeconds: input.RetryDelayInSeconds }), - ...(input.Test !== undefined && { Test: input.Test }), - ...(input.TestDurationInSeconds !== undefined && { TestDurationInSeconds: input.TestDurationInSeconds }), + ...(input.AnswerKey !== undefined && input.AnswerKey !== null && { AnswerKey: input.AnswerKey }), + ...(input.AutoGranted !== undefined && input.AutoGranted !== null && { AutoGranted: input.AutoGranted }), + ...(input.AutoGrantedValue !== undefined && + input.AutoGrantedValue !== null && { AutoGrantedValue: input.AutoGrantedValue }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.QualificationTypeId !== undefined && + input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }), + ...(input.QualificationTypeStatus !== undefined && + input.QualificationTypeStatus !== null && { QualificationTypeStatus: input.QualificationTypeStatus }), + ...(input.RetryDelayInSeconds !== undefined && + input.RetryDelayInSeconds !== null && { RetryDelayInSeconds: input.RetryDelayInSeconds }), + ...(input.Test !== undefined && input.Test !== null && { Test: input.Test }), + ...(input.TestDurationInSeconds !== undefined && + input.TestDurationInSeconds !== null && { TestDurationInSeconds: input.TestDurationInSeconds }), }; }; @@ -3842,7 +3933,14 @@ const deserializeAws_json1_1Assignment = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1AssignmentList = (output: any, context: __SerdeContext): Assignment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Assignment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Assignment(entry, context); + }); }; const deserializeAws_json1_1AssociateQualificationWithWorkerResponse = ( @@ -3866,7 +3964,14 @@ const deserializeAws_json1_1BonusPayment = (output: any, context: __SerdeContext }; const deserializeAws_json1_1BonusPaymentList = (output: any, context: __SerdeContext): BonusPayment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BonusPayment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BonusPayment(entry, context); + }); }; const deserializeAws_json1_1CreateAdditionalAssignmentsForHITResponse = ( @@ -4059,11 +4164,25 @@ const deserializeAws_json1_1HIT = (output: any, context: __SerdeContext): HIT => }; const deserializeAws_json1_1HITList = (output: any, context: __SerdeContext): HIT[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HIT(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HIT(entry, context); + }); }; const deserializeAws_json1_1IntegerList = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ListAssignmentsForHITResponse = ( @@ -4223,7 +4342,14 @@ const deserializeAws_json1_1Locale = (output: any, context: __SerdeContext): Loc }; const deserializeAws_json1_1LocaleList = (output: any, context: __SerdeContext): Locale[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Locale(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Locale(entry, context); + }); }; const deserializeAws_json1_1NotifyWorkersFailureStatus = ( @@ -4247,7 +4373,14 @@ const deserializeAws_json1_1NotifyWorkersFailureStatusList = ( output: any, context: __SerdeContext ): NotifyWorkersFailureStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NotifyWorkersFailureStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NotifyWorkersFailureStatus(entry, context); + }); }; const deserializeAws_json1_1NotifyWorkersResponse = (output: any, context: __SerdeContext): NotifyWorkersResponse => { @@ -4270,7 +4403,14 @@ const deserializeAws_json1_1ParameterMapEntry = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ParameterMapEntryList = (output: any, context: __SerdeContext): ParameterMapEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParameterMapEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParameterMapEntry(entry, context); + }); }; const deserializeAws_json1_1PolicyParameter = (output: any, context: __SerdeContext): PolicyParameter => { @@ -4288,7 +4428,14 @@ const deserializeAws_json1_1PolicyParameter = (output: any, context: __SerdeCont }; const deserializeAws_json1_1PolicyParameterList = (output: any, context: __SerdeContext): PolicyParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PolicyParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PolicyParameter(entry, context); + }); }; const deserializeAws_json1_1Qualification = (output: any, context: __SerdeContext): Qualification => { @@ -4312,7 +4459,14 @@ const deserializeAws_json1_1Qualification = (output: any, context: __SerdeContex }; const deserializeAws_json1_1QualificationList = (output: any, context: __SerdeContext): Qualification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Qualification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Qualification(entry, context); + }); }; const deserializeAws_json1_1QualificationRequest = (output: any, context: __SerdeContext): QualificationRequest => { @@ -4339,7 +4493,14 @@ const deserializeAws_json1_1QualificationRequestList = ( output: any, context: __SerdeContext ): QualificationRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1QualificationRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1QualificationRequest(entry, context); + }); }; const deserializeAws_json1_1QualificationRequirement = ( @@ -4373,7 +4534,14 @@ const deserializeAws_json1_1QualificationRequirementList = ( output: any, context: __SerdeContext ): QualificationRequirement[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1QualificationRequirement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1QualificationRequirement(entry, context); + }); }; const deserializeAws_json1_1QualificationType = (output: any, context: __SerdeContext): QualificationType => { @@ -4412,7 +4580,14 @@ const deserializeAws_json1_1QualificationType = (output: any, context: __SerdeCo }; const deserializeAws_json1_1QualificationTypeList = (output: any, context: __SerdeContext): QualificationType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1QualificationType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1QualificationType(entry, context); + }); }; const deserializeAws_json1_1RejectAssignmentResponse = ( @@ -4454,7 +4629,14 @@ const deserializeAws_json1_1ReviewActionDetail = (output: any, context: __SerdeC }; const deserializeAws_json1_1ReviewActionDetailList = (output: any, context: __SerdeContext): ReviewActionDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReviewActionDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReviewActionDetail(entry, context); + }); }; const deserializeAws_json1_1ReviewPolicy = (output: any, context: __SerdeContext): ReviewPolicy => { @@ -4492,7 +4674,14 @@ const deserializeAws_json1_1ReviewResultDetail = (output: any, context: __SerdeC }; const deserializeAws_json1_1ReviewResultDetailList = (output: any, context: __SerdeContext): ReviewResultDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReviewResultDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReviewResultDetail(entry, context); + }); }; const deserializeAws_json1_1SendBonusResponse = (output: any, context: __SerdeContext): SendBonusResponse => { @@ -4515,7 +4704,14 @@ const deserializeAws_json1_1ServiceFault = (output: any, context: __SerdeContext }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1UpdateExpirationForHITResponse = ( @@ -4566,7 +4762,14 @@ const deserializeAws_json1_1WorkerBlock = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1WorkerBlockList = (output: any, context: __SerdeContext): WorkerBlock[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WorkerBlock(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WorkerBlock(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4619,3 +4822,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-neptune/protocols/Aws_query.ts b/clients/client-neptune/protocols/Aws_query.ts index 06e4b99d6b83..dcff5ffc9c94 100644 --- a/clients/client-neptune/protocols/Aws_query.ts +++ b/clients/client-neptune/protocols/Aws_query.ts @@ -453,7 +453,7 @@ export const serializeAws_queryAddRoleToDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -469,7 +469,7 @@ export const serializeAws_queryAddSourceIdentifierToSubscriptionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -485,7 +485,7 @@ export const serializeAws_queryAddTagsToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -501,7 +501,7 @@ export const serializeAws_queryApplyPendingMaintenanceActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -517,7 +517,7 @@ export const serializeAws_queryCopyDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -533,7 +533,7 @@ export const serializeAws_queryCopyDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -549,7 +549,7 @@ export const serializeAws_queryCopyDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -565,7 +565,7 @@ export const serializeAws_queryCreateDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -581,7 +581,7 @@ export const serializeAws_queryCreateDBClusterEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -597,7 +597,7 @@ export const serializeAws_queryCreateDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -613,7 +613,7 @@ export const serializeAws_queryCreateDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -629,7 +629,7 @@ export const serializeAws_queryCreateDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -645,7 +645,7 @@ export const serializeAws_queryCreateDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -661,7 +661,7 @@ export const serializeAws_queryCreateDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -677,7 +677,7 @@ export const serializeAws_queryCreateEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -693,7 +693,7 @@ export const serializeAws_queryDeleteDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -709,7 +709,7 @@ export const serializeAws_queryDeleteDBClusterEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -725,7 +725,7 @@ export const serializeAws_queryDeleteDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -741,7 +741,7 @@ export const serializeAws_queryDeleteDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -757,7 +757,7 @@ export const serializeAws_queryDeleteDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -773,7 +773,7 @@ export const serializeAws_queryDeleteDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -789,7 +789,7 @@ export const serializeAws_queryDeleteDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -805,7 +805,7 @@ export const serializeAws_queryDeleteEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -821,7 +821,7 @@ export const serializeAws_queryDescribeDBClusterEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -837,7 +837,7 @@ export const serializeAws_queryDescribeDBClusterParameterGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -853,7 +853,7 @@ export const serializeAws_queryDescribeDBClusterParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -869,7 +869,7 @@ export const serializeAws_queryDescribeDBClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -885,7 +885,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotAttributesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -901,7 +901,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -917,7 +917,7 @@ export const serializeAws_queryDescribeDBEngineVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -933,7 +933,7 @@ export const serializeAws_queryDescribeDBInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -949,7 +949,7 @@ export const serializeAws_queryDescribeDBParameterGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -965,7 +965,7 @@ export const serializeAws_queryDescribeDBParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -981,7 +981,7 @@ export const serializeAws_queryDescribeDBSubnetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -997,7 +997,7 @@ export const serializeAws_queryDescribeEngineDefaultClusterParametersCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1013,7 +1013,7 @@ export const serializeAws_queryDescribeEngineDefaultParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1029,7 +1029,7 @@ export const serializeAws_queryDescribeEventCategoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1045,7 +1045,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1061,7 +1061,7 @@ export const serializeAws_queryDescribeEventSubscriptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1077,7 +1077,7 @@ export const serializeAws_queryDescribeOrderableDBInstanceOptionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1093,7 +1093,7 @@ export const serializeAws_queryDescribePendingMaintenanceActionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1109,7 +1109,7 @@ export const serializeAws_queryDescribeValidDBInstanceModificationsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1125,7 +1125,7 @@ export const serializeAws_queryFailoverDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1141,7 +1141,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1157,7 +1157,7 @@ export const serializeAws_queryModifyDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1173,7 +1173,7 @@ export const serializeAws_queryModifyDBClusterEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1189,7 +1189,7 @@ export const serializeAws_queryModifyDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1205,7 +1205,7 @@ export const serializeAws_queryModifyDBClusterSnapshotAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1221,7 +1221,7 @@ export const serializeAws_queryModifyDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1237,7 +1237,7 @@ export const serializeAws_queryModifyDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1253,7 +1253,7 @@ export const serializeAws_queryModifyDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1269,7 +1269,7 @@ export const serializeAws_queryModifyEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1285,7 +1285,7 @@ export const serializeAws_queryPromoteReadReplicaDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1301,7 +1301,7 @@ export const serializeAws_queryRebootDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1317,7 +1317,7 @@ export const serializeAws_queryRemoveRoleFromDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1333,7 +1333,7 @@ export const serializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1349,7 +1349,7 @@ export const serializeAws_queryRemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1365,7 +1365,7 @@ export const serializeAws_queryResetDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1381,7 +1381,7 @@ export const serializeAws_queryResetDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1397,7 +1397,7 @@ export const serializeAws_queryRestoreDBClusterFromSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1413,7 +1413,7 @@ export const serializeAws_queryRestoreDBClusterToPointInTimeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1429,7 +1429,7 @@ export const serializeAws_queryStartDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1445,7 +1445,7 @@ export const serializeAws_queryStopDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -7158,13 +7158,13 @@ const serializeAws_queryAddRoleToDBClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.FeatureName !== undefined) { + if (input.FeatureName !== undefined && input.FeatureName !== null) { entries["FeatureName"] = input.FeatureName; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -7175,10 +7175,10 @@ const serializeAws_queryAddSourceIdentifierToSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.SourceIdentifier !== undefined) { + if (input.SourceIdentifier !== undefined && input.SourceIdentifier !== null) { entries["SourceIdentifier"] = input.SourceIdentifier; } return entries; @@ -7186,14 +7186,14 @@ const serializeAws_queryAddSourceIdentifierToSubscriptionMessage = ( const serializeAws_queryAddTagsToResourceMessage = (input: AddTagsToResourceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } return entries; @@ -7204,13 +7204,13 @@ const serializeAws_queryApplyPendingMaintenanceActionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ApplyAction !== undefined) { + if (input.ApplyAction !== undefined && input.ApplyAction !== null) { entries["ApplyAction"] = input.ApplyAction; } - if (input.OptInType !== undefined) { + if (input.OptInType !== undefined && input.OptInType !== null) { entries["OptInType"] = input.OptInType; } - if (input.ResourceIdentifier !== undefined) { + if (input.ResourceIdentifier !== undefined && input.ResourceIdentifier !== null) { entries["ResourceIdentifier"] = input.ResourceIdentifier; } return entries; @@ -7220,6 +7220,9 @@ const serializeAws_queryAttributeValueList = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AttributeValue.${counter}`] = entry; counter++; } @@ -7230,6 +7233,9 @@ const serializeAws_queryAvailabilityZones = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AvailabilityZone.${counter}`] = entry; counter++; } @@ -7241,14 +7247,14 @@ const serializeAws_queryCloudwatchLogsExportConfiguration = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DisableLogTypes !== undefined) { + if (input.DisableLogTypes !== undefined && input.DisableLogTypes !== null) { const memberEntries = serializeAws_queryLogTypeList(input.DisableLogTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DisableLogTypes.${key}`; entries[loc] = value; }); } - if (input.EnableLogTypes !== undefined) { + if (input.EnableLogTypes !== undefined && input.EnableLogTypes !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableLogTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableLogTypes.${key}`; @@ -7263,20 +7269,29 @@ const serializeAws_queryCopyDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.TargetDBClusterParameterGroupIdentifier !== undefined) { + if ( + input.TargetDBClusterParameterGroupIdentifier !== undefined && + input.TargetDBClusterParameterGroupIdentifier !== null + ) { entries["TargetDBClusterParameterGroupIdentifier"] = input.TargetDBClusterParameterGroupIdentifier; } - if (input.SourceDBClusterParameterGroupIdentifier !== undefined) { + if ( + input.SourceDBClusterParameterGroupIdentifier !== undefined && + input.SourceDBClusterParameterGroupIdentifier !== null + ) { entries["SourceDBClusterParameterGroupIdentifier"] = input.SourceDBClusterParameterGroupIdentifier; } - if (input.TargetDBClusterParameterGroupDescription !== undefined) { + if ( + input.TargetDBClusterParameterGroupDescription !== undefined && + input.TargetDBClusterParameterGroupDescription !== null + ) { entries["TargetDBClusterParameterGroupDescription"] = input.TargetDBClusterParameterGroupDescription; } return entries; @@ -7287,26 +7302,26 @@ const serializeAws_queryCopyDBClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.TargetDBClusterSnapshotIdentifier !== undefined) { + if (input.TargetDBClusterSnapshotIdentifier !== undefined && input.TargetDBClusterSnapshotIdentifier !== null) { entries["TargetDBClusterSnapshotIdentifier"] = input.TargetDBClusterSnapshotIdentifier; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.PreSignedUrl !== undefined) { + if (input.PreSignedUrl !== undefined && input.PreSignedUrl !== null) { entries["PreSignedUrl"] = input.PreSignedUrl; } - if (input.CopyTags !== undefined) { + if (input.CopyTags !== undefined && input.CopyTags !== null) { entries["CopyTags"] = input.CopyTags; } - if (input.SourceDBClusterSnapshotIdentifier !== undefined) { + if (input.SourceDBClusterSnapshotIdentifier !== undefined && input.SourceDBClusterSnapshotIdentifier !== null) { entries["SourceDBClusterSnapshotIdentifier"] = input.SourceDBClusterSnapshotIdentifier; } return entries; @@ -7317,20 +7332,20 @@ const serializeAws_queryCopyDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TargetDBParameterGroupDescription !== undefined) { + if (input.TargetDBParameterGroupDescription !== undefined && input.TargetDBParameterGroupDescription !== null) { entries["TargetDBParameterGroupDescription"] = input.TargetDBParameterGroupDescription; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.TargetDBParameterGroupIdentifier !== undefined) { + if (input.TargetDBParameterGroupIdentifier !== undefined && input.TargetDBParameterGroupIdentifier !== null) { entries["TargetDBParameterGroupIdentifier"] = input.TargetDBParameterGroupIdentifier; } - if (input.SourceDBParameterGroupIdentifier !== undefined) { + if (input.SourceDBParameterGroupIdentifier !== undefined && input.SourceDBParameterGroupIdentifier !== null) { entries["SourceDBParameterGroupIdentifier"] = input.SourceDBParameterGroupIdentifier; } return entries; @@ -7341,34 +7356,34 @@ const serializeAws_queryCreateDBClusterEndpointMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.EndpointType !== undefined) { + if (input.EndpointType !== undefined && input.EndpointType !== null) { entries["EndpointType"] = input.EndpointType; } - if (input.StaticMembers !== undefined) { + if (input.StaticMembers !== undefined && input.StaticMembers !== null) { const memberEntries = serializeAws_queryStringList(input.StaticMembers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StaticMembers.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ExcludedMembers !== undefined) { + if (input.ExcludedMembers !== undefined && input.ExcludedMembers !== null) { const memberEntries = serializeAws_queryStringList(input.ExcludedMembers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExcludedMembers.${key}`; entries[loc] = value; }); } - if (input.DBClusterEndpointIdentifier !== undefined) { + if (input.DBClusterEndpointIdentifier !== undefined && input.DBClusterEndpointIdentifier !== null) { entries["DBClusterEndpointIdentifier"] = input.DBClusterEndpointIdentifier; } return entries; @@ -7376,92 +7391,92 @@ const serializeAws_queryCreateDBClusterEndpointMessage = ( const serializeAws_queryCreateDBClusterMessage = (input: CreateDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.DatabaseName !== undefined) { + if (input.DatabaseName !== undefined && input.DatabaseName !== null) { entries["DatabaseName"] = input.DatabaseName; } - if (input.MasterUsername !== undefined) { + if (input.MasterUsername !== undefined && input.MasterUsername !== null) { entries["MasterUsername"] = input.MasterUsername; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.PreSignedUrl !== undefined) { + if (input.PreSignedUrl !== undefined && input.PreSignedUrl !== null) { entries["PreSignedUrl"] = input.PreSignedUrl; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.CharacterSetName !== undefined) { + if (input.CharacterSetName !== undefined && input.CharacterSetName !== null) { entries["CharacterSetName"] = input.CharacterSetName; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.ReplicationSourceIdentifier !== undefined) { + if (input.ReplicationSourceIdentifier !== undefined && input.ReplicationSourceIdentifier !== null) { entries["ReplicationSourceIdentifier"] = input.ReplicationSourceIdentifier; } - if (input.StorageEncrypted !== undefined) { + if (input.StorageEncrypted !== undefined && input.StorageEncrypted !== null) { entries["StorageEncrypted"] = input.StorageEncrypted; } return entries; @@ -7472,20 +7487,20 @@ const serializeAws_queryCreateDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -7496,13 +7511,13 @@ const serializeAws_queryCreateDBClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -7514,149 +7529,149 @@ const serializeAws_queryCreateDBClusterSnapshotMessage = ( const serializeAws_queryCreateDBInstanceMessage = (input: CreateDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.EnablePerformanceInsights !== undefined) { + if (input.EnablePerformanceInsights !== undefined && input.EnablePerformanceInsights !== null) { entries["EnablePerformanceInsights"] = input.EnablePerformanceInsights; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.TdeCredentialPassword !== undefined) { + if (input.TdeCredentialPassword !== undefined && input.TdeCredentialPassword !== null) { entries["TdeCredentialPassword"] = input.TdeCredentialPassword; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.StorageType !== undefined) { + if (input.StorageType !== undefined && input.StorageType !== null) { entries["StorageType"] = input.StorageType; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.MasterUsername !== undefined) { + if (input.MasterUsername !== undefined && input.MasterUsername !== null) { entries["MasterUsername"] = input.MasterUsername; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.DBName !== undefined) { + if (input.DBName !== undefined && input.DBName !== null) { entries["DBName"] = input.DBName; } - if (input.MonitoringInterval !== undefined) { + if (input.MonitoringInterval !== undefined && input.MonitoringInterval !== null) { entries["MonitoringInterval"] = input.MonitoringInterval; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.DBSecurityGroups !== undefined) { + if (input.DBSecurityGroups !== undefined && input.DBSecurityGroups !== null) { const memberEntries = serializeAws_queryDBSecurityGroupNameList(input.DBSecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBSecurityGroups.${key}`; entries[loc] = value; }); } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Timezone !== undefined) { + if (input.Timezone !== undefined && input.Timezone !== null) { entries["Timezone"] = input.Timezone; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.TdeCredentialArn !== undefined) { + if (input.TdeCredentialArn !== undefined && input.TdeCredentialArn !== null) { entries["TdeCredentialArn"] = input.TdeCredentialArn; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.PerformanceInsightsKMSKeyId !== undefined) { + if (input.PerformanceInsightsKMSKeyId !== undefined && input.PerformanceInsightsKMSKeyId !== null) { entries["PerformanceInsightsKMSKeyId"] = input.PerformanceInsightsKMSKeyId; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.MonitoringRoleArn !== undefined) { + if (input.MonitoringRoleArn !== undefined && input.MonitoringRoleArn !== null) { entries["MonitoringRoleArn"] = input.MonitoringRoleArn; } - if (input.CharacterSetName !== undefined) { + if (input.CharacterSetName !== undefined && input.CharacterSetName !== null) { entries["CharacterSetName"] = input.CharacterSetName; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.PromotionTier !== undefined) { + if (input.PromotionTier !== undefined && input.PromotionTier !== null) { entries["PromotionTier"] = input.PromotionTier; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.AllocatedStorage !== undefined) { + if (input.AllocatedStorage !== undefined && input.AllocatedStorage !== null) { entries["AllocatedStorage"] = input.AllocatedStorage; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.StorageEncrypted !== undefined) { + if (input.StorageEncrypted !== undefined && input.StorageEncrypted !== null) { entries["StorageEncrypted"] = input.StorageEncrypted; } return entries; @@ -7667,20 +7682,20 @@ const serializeAws_queryCreateDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } return entries; @@ -7691,24 +7706,24 @@ const serializeAws_queryCreateDBSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.DBSubnetGroupDescription !== undefined) { + if (input.DBSubnetGroupDescription !== undefined && input.DBSubnetGroupDescription !== null) { entries["DBSubnetGroupDescription"] = input.DBSubnetGroupDescription; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } return entries; @@ -7719,37 +7734,37 @@ const serializeAws_queryCreateEventSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.EventCategories !== undefined) { + if (input.EventCategories !== undefined && input.EventCategories !== null) { const memberEntries = serializeAws_queryEventCategoriesList(input.EventCategories, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventCategories.${key}`; entries[loc] = value; }); } - if (input.SourceIds !== undefined) { + if (input.SourceIds !== undefined && input.SourceIds !== null) { const memberEntries = serializeAws_querySourceIdsList(input.SourceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceIds.${key}`; entries[loc] = value; }); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.SnsTopicArn !== undefined) { + if (input.SnsTopicArn !== undefined && input.SnsTopicArn !== null) { entries["SnsTopicArn"] = input.SnsTopicArn; } return entries; @@ -7759,6 +7774,9 @@ const serializeAws_queryDBSecurityGroupNameList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`DBSecurityGroupName.${counter}`] = entry; counter++; } @@ -7770,7 +7788,7 @@ const serializeAws_queryDeleteDBClusterEndpointMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterEndpointIdentifier !== undefined) { + if (input.DBClusterEndpointIdentifier !== undefined && input.DBClusterEndpointIdentifier !== null) { entries["DBClusterEndpointIdentifier"] = input.DBClusterEndpointIdentifier; } return entries; @@ -7778,13 +7796,13 @@ const serializeAws_queryDeleteDBClusterEndpointMessage = ( const serializeAws_queryDeleteDBClusterMessage = (input: DeleteDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SkipFinalSnapshot !== undefined) { + if (input.SkipFinalSnapshot !== undefined && input.SkipFinalSnapshot !== null) { entries["SkipFinalSnapshot"] = input.SkipFinalSnapshot; } - if (input.FinalDBSnapshotIdentifier !== undefined) { + if (input.FinalDBSnapshotIdentifier !== undefined && input.FinalDBSnapshotIdentifier !== null) { entries["FinalDBSnapshotIdentifier"] = input.FinalDBSnapshotIdentifier; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -7795,7 +7813,7 @@ const serializeAws_queryDeleteDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } return entries; @@ -7806,7 +7824,7 @@ const serializeAws_queryDeleteDBClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } return entries; @@ -7814,13 +7832,13 @@ const serializeAws_queryDeleteDBClusterSnapshotMessage = ( const serializeAws_queryDeleteDBInstanceMessage = (input: DeleteDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SkipFinalSnapshot !== undefined) { + if (input.SkipFinalSnapshot !== undefined && input.SkipFinalSnapshot !== null) { entries["SkipFinalSnapshot"] = input.SkipFinalSnapshot; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.FinalDBSnapshotIdentifier !== undefined) { + if (input.FinalDBSnapshotIdentifier !== undefined && input.FinalDBSnapshotIdentifier !== null) { entries["FinalDBSnapshotIdentifier"] = input.FinalDBSnapshotIdentifier; } return entries; @@ -7831,7 +7849,7 @@ const serializeAws_queryDeleteDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } return entries; @@ -7842,7 +7860,7 @@ const serializeAws_queryDeleteDBSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } return entries; @@ -7853,7 +7871,7 @@ const serializeAws_queryDeleteEventSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } return entries; @@ -7864,23 +7882,23 @@ const serializeAws_queryDescribeDBClusterEndpointsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.DBClusterEndpointIdentifier !== undefined) { + if (input.DBClusterEndpointIdentifier !== undefined && input.DBClusterEndpointIdentifier !== null) { entries["DBClusterEndpointIdentifier"] = input.DBClusterEndpointIdentifier; } return entries; @@ -7891,20 +7909,20 @@ const serializeAws_queryDescribeDBClusterParameterGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -7915,23 +7933,23 @@ const serializeAws_queryDescribeDBClusterParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -7942,16 +7960,16 @@ const serializeAws_queryDescribeDBClustersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -7966,7 +7984,7 @@ const serializeAws_queryDescribeDBClusterSnapshotAttributesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } return entries; @@ -7977,32 +7995,32 @@ const serializeAws_queryDescribeDBClusterSnapshotsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.IncludeShared !== undefined) { + if (input.IncludeShared !== undefined && input.IncludeShared !== null) { entries["IncludeShared"] = input.IncludeShared; } - if (input.IncludePublic !== undefined) { + if (input.IncludePublic !== undefined && input.IncludePublic !== null) { entries["IncludePublic"] = input.IncludePublic; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.SnapshotType !== undefined) { + if (input.SnapshotType !== undefined && input.SnapshotType !== null) { entries["SnapshotType"] = input.SnapshotType; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -8013,35 +8031,35 @@ const serializeAws_queryDescribeDBEngineVersionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.ListSupportedCharacterSets !== undefined) { + if (input.ListSupportedCharacterSets !== undefined && input.ListSupportedCharacterSets !== null) { entries["ListSupportedCharacterSets"] = input.ListSupportedCharacterSets; } - if (input.ListSupportedTimezones !== undefined) { + if (input.ListSupportedTimezones !== undefined && input.ListSupportedTimezones !== null) { entries["ListSupportedTimezones"] = input.ListSupportedTimezones; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.DefaultOnly !== undefined) { + if (input.DefaultOnly !== undefined && input.DefaultOnly !== null) { entries["DefaultOnly"] = input.DefaultOnly; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8052,20 +8070,20 @@ const serializeAws_queryDescribeDBInstancesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } return entries; @@ -8076,20 +8094,20 @@ const serializeAws_queryDescribeDBParameterGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } return entries; @@ -8100,19 +8118,19 @@ const serializeAws_queryDescribeDBParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -8127,20 +8145,20 @@ const serializeAws_queryDescribeDBSubnetGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -8151,16 +8169,16 @@ const serializeAws_queryDescribeEngineDefaultClusterParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -8175,20 +8193,20 @@ const serializeAws_queryDescribeEngineDefaultParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8199,10 +8217,10 @@ const serializeAws_queryDescribeEventCategoriesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -8214,39 +8232,39 @@ const serializeAws_queryDescribeEventCategoriesMessage = ( const serializeAws_queryDescribeEventsMessage = (input: DescribeEventsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Duration !== undefined) { + if (input.Duration !== undefined && input.Duration !== null) { entries["Duration"] = input.Duration; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.SourceIdentifier !== undefined) { + if (input.SourceIdentifier !== undefined && input.SourceIdentifier !== null) { entries["SourceIdentifier"] = input.SourceIdentifier; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.EventCategories !== undefined) { + if (input.EventCategories !== undefined && input.EventCategories !== null) { const memberEntries = serializeAws_queryEventCategoriesList(input.EventCategories, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventCategories.${key}`; entries[loc] = value; }); } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } return entries; @@ -8257,20 +8275,20 @@ const serializeAws_queryDescribeEventSubscriptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8281,32 +8299,32 @@ const serializeAws_queryDescribeOrderableDBInstanceOptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Vpc !== undefined) { + if (input.Vpc !== undefined && input.Vpc !== null) { entries["Vpc"] = input.Vpc; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -8317,20 +8335,20 @@ const serializeAws_queryDescribePendingMaintenanceActionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.ResourceIdentifier !== undefined) { + if (input.ResourceIdentifier !== undefined && input.ResourceIdentifier !== null) { entries["ResourceIdentifier"] = input.ResourceIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -8341,7 +8359,7 @@ const serializeAws_queryDescribeValidDBInstanceModificationsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } return entries; @@ -8351,6 +8369,9 @@ const serializeAws_queryEventCategoriesList = (input: string[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`EventCategory.${counter}`] = entry; counter++; } @@ -8359,10 +8380,10 @@ const serializeAws_queryEventCategoriesList = (input: string[], context: __Serde const serializeAws_queryFailoverDBClusterMessage = (input: FailoverDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.TargetDBInstanceIdentifier !== undefined) { + if (input.TargetDBInstanceIdentifier !== undefined && input.TargetDBInstanceIdentifier !== null) { entries["TargetDBInstanceIdentifier"] = input.TargetDBInstanceIdentifier; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -8370,14 +8391,14 @@ const serializeAws_queryFailoverDBClusterMessage = (input: FailoverDBClusterMess const serializeAws_queryFilter = (input: Filter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryFilterValueList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; entries[loc] = value; }); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -8387,6 +8408,9 @@ const serializeAws_queryFilterList = (input: Filter[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Filter.${counter}.${key}`] = value; @@ -8400,6 +8424,9 @@ const serializeAws_queryFilterValueList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Value.${counter}`] = entry; counter++; } @@ -8410,6 +8437,9 @@ const serializeAws_queryKeyList = (input: string[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -8421,14 +8451,14 @@ const serializeAws_queryListTagsForResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } return entries; @@ -8438,6 +8468,9 @@ const serializeAws_queryLogTypeList = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -8449,24 +8482,24 @@ const serializeAws_queryModifyDBClusterEndpointMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.StaticMembers !== undefined) { + if (input.StaticMembers !== undefined && input.StaticMembers !== null) { const memberEntries = serializeAws_queryStringList(input.StaticMembers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StaticMembers.${key}`; entries[loc] = value; }); } - if (input.ExcludedMembers !== undefined) { + if (input.ExcludedMembers !== undefined && input.ExcludedMembers !== null) { const memberEntries = serializeAws_queryStringList(input.ExcludedMembers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExcludedMembers.${key}`; entries[loc] = value; }); } - if (input.DBClusterEndpointIdentifier !== undefined) { + if (input.DBClusterEndpointIdentifier !== undefined && input.DBClusterEndpointIdentifier !== null) { entries["DBClusterEndpointIdentifier"] = input.DBClusterEndpointIdentifier; } - if (input.EndpointType !== undefined) { + if (input.EndpointType !== undefined && input.EndpointType !== null) { entries["EndpointType"] = input.EndpointType; } return entries; @@ -8474,41 +8507,41 @@ const serializeAws_queryModifyDBClusterEndpointMessage = ( const serializeAws_queryModifyDBClusterMessage = (input: ModifyDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.CloudwatchLogsExportConfiguration !== undefined) { + if (input.CloudwatchLogsExportConfiguration !== undefined && input.CloudwatchLogsExportConfiguration !== null) { const memberEntries = serializeAws_queryCloudwatchLogsExportConfiguration( input.CloudwatchLogsExportConfiguration, context @@ -8518,16 +8551,16 @@ const serializeAws_queryModifyDBClusterMessage = (input: ModifyDBClusterMessage, entries[loc] = value; }); } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.NewDBClusterIdentifier !== undefined) { + if (input.NewDBClusterIdentifier !== undefined && input.NewDBClusterIdentifier !== null) { entries["NewDBClusterIdentifier"] = input.NewDBClusterIdentifier; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } return entries; @@ -8538,14 +8571,14 @@ const serializeAws_queryModifyDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; entries[loc] = value; }); } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } return entries; @@ -8556,20 +8589,20 @@ const serializeAws_queryModifyDBClusterSnapshotAttributeMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AttributeName !== undefined) { + if (input.AttributeName !== undefined && input.AttributeName !== null) { entries["AttributeName"] = input.AttributeName; } - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } - if (input.ValuesToAdd !== undefined) { + if (input.ValuesToAdd !== undefined && input.ValuesToAdd !== null) { const memberEntries = serializeAws_queryAttributeValueList(input.ValuesToAdd, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ValuesToAdd.${key}`; entries[loc] = value; }); } - if (input.ValuesToRemove !== undefined) { + if (input.ValuesToRemove !== undefined && input.ValuesToRemove !== null) { const memberEntries = serializeAws_queryAttributeValueList(input.ValuesToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ValuesToRemove.${key}`; @@ -8581,47 +8614,47 @@ const serializeAws_queryModifyDBClusterSnapshotAttributeMessage = ( const serializeAws_queryModifyDBInstanceMessage = (input: ModifyDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.NewDBInstanceIdentifier !== undefined) { + if (input.NewDBInstanceIdentifier !== undefined && input.NewDBInstanceIdentifier !== null) { entries["NewDBInstanceIdentifier"] = input.NewDBInstanceIdentifier; } - if (input.MonitoringInterval !== undefined) { + if (input.MonitoringInterval !== undefined && input.MonitoringInterval !== null) { entries["MonitoringInterval"] = input.MonitoringInterval; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.PerformanceInsightsKMSKeyId !== undefined) { + if (input.PerformanceInsightsKMSKeyId !== undefined && input.PerformanceInsightsKMSKeyId !== null) { entries["PerformanceInsightsKMSKeyId"] = input.PerformanceInsightsKMSKeyId; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.DBPortNumber !== undefined) { + if (input.DBPortNumber !== undefined && input.DBPortNumber !== null) { entries["DBPortNumber"] = input.DBPortNumber; } - if (input.TdeCredentialArn !== undefined) { + if (input.TdeCredentialArn !== undefined && input.TdeCredentialArn !== null) { entries["TdeCredentialArn"] = input.TdeCredentialArn; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.CloudwatchLogsExportConfiguration !== undefined) { + if (input.CloudwatchLogsExportConfiguration !== undefined && input.CloudwatchLogsExportConfiguration !== null) { const memberEntries = serializeAws_queryCloudwatchLogsExportConfiguration( input.CloudwatchLogsExportConfiguration, context @@ -8631,80 +8664,80 @@ const serializeAws_queryModifyDBInstanceMessage = (input: ModifyDBInstanceMessag entries[loc] = value; }); } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } - if (input.AllocatedStorage !== undefined) { + if (input.AllocatedStorage !== undefined && input.AllocatedStorage !== null) { entries["AllocatedStorage"] = input.AllocatedStorage; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.TdeCredentialPassword !== undefined) { + if (input.TdeCredentialPassword !== undefined && input.TdeCredentialPassword !== null) { entries["TdeCredentialPassword"] = input.TdeCredentialPassword; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } - if (input.EnablePerformanceInsights !== undefined) { + if (input.EnablePerformanceInsights !== undefined && input.EnablePerformanceInsights !== null) { entries["EnablePerformanceInsights"] = input.EnablePerformanceInsights; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.StorageType !== undefined) { + if (input.StorageType !== undefined && input.StorageType !== null) { entries["StorageType"] = input.StorageType; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.DBSecurityGroups !== undefined) { + if (input.DBSecurityGroups !== undefined && input.DBSecurityGroups !== null) { const memberEntries = serializeAws_queryDBSecurityGroupNameList(input.DBSecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBSecurityGroups.${key}`; entries[loc] = value; }); } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.CACertificateIdentifier !== undefined) { + if (input.CACertificateIdentifier !== undefined && input.CACertificateIdentifier !== null) { entries["CACertificateIdentifier"] = input.CACertificateIdentifier; } - if (input.PromotionTier !== undefined) { + if (input.PromotionTier !== undefined && input.PromotionTier !== null) { entries["PromotionTier"] = input.PromotionTier; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.MonitoringRoleArn !== undefined) { + if (input.MonitoringRoleArn !== undefined && input.MonitoringRoleArn !== null) { entries["MonitoringRoleArn"] = input.MonitoringRoleArn; } - if (input.AllowMajorVersionUpgrade !== undefined) { + if (input.AllowMajorVersionUpgrade !== undefined && input.AllowMajorVersionUpgrade !== null) { entries["AllowMajorVersionUpgrade"] = input.AllowMajorVersionUpgrade; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } return entries; @@ -8715,10 +8748,10 @@ const serializeAws_queryModifyDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -8733,13 +8766,13 @@ const serializeAws_queryModifyDBSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.DBSubnetGroupDescription !== undefined) { + if (input.DBSubnetGroupDescription !== undefined && input.DBSubnetGroupDescription !== null) { entries["DBSubnetGroupDescription"] = input.DBSubnetGroupDescription; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; @@ -8754,23 +8787,23 @@ const serializeAws_queryModifyEventSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.EventCategories !== undefined) { + if (input.EventCategories !== undefined && input.EventCategories !== null) { const memberEntries = serializeAws_queryEventCategoriesList(input.EventCategories, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventCategories.${key}`; entries[loc] = value; }); } - if (input.SnsTopicArn !== undefined) { + if (input.SnsTopicArn !== undefined && input.SnsTopicArn !== null) { entries["SnsTopicArn"] = input.SnsTopicArn; } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } return entries; @@ -8778,34 +8811,34 @@ const serializeAws_queryModifyEventSubscriptionMessage = ( const serializeAws_queryParameter = (input: Parameter, context: __SerdeContext): any => { const entries: any = {}; - if (input.ParameterValue !== undefined) { + if (input.ParameterValue !== undefined && input.ParameterValue !== null) { entries["ParameterValue"] = input.ParameterValue; } - if (input.AllowedValues !== undefined) { + if (input.AllowedValues !== undefined && input.AllowedValues !== null) { entries["AllowedValues"] = input.AllowedValues; } - if (input.DataType !== undefined) { + if (input.DataType !== undefined && input.DataType !== null) { entries["DataType"] = input.DataType; } - if (input.ApplyType !== undefined) { + if (input.ApplyType !== undefined && input.ApplyType !== null) { entries["ApplyType"] = input.ApplyType; } - if (input.ParameterName !== undefined) { + if (input.ParameterName !== undefined && input.ParameterName !== null) { entries["ParameterName"] = input.ParameterName; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.ApplyMethod !== undefined) { + if (input.ApplyMethod !== undefined && input.ApplyMethod !== null) { entries["ApplyMethod"] = input.ApplyMethod; } - if (input.IsModifiable !== undefined) { + if (input.IsModifiable !== undefined && input.IsModifiable !== null) { entries["IsModifiable"] = input.IsModifiable; } - if (input.MinimumEngineVersion !== undefined) { + if (input.MinimumEngineVersion !== undefined && input.MinimumEngineVersion !== null) { entries["MinimumEngineVersion"] = input.MinimumEngineVersion; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } return entries; @@ -8815,6 +8848,9 @@ const serializeAws_queryParametersList = (input: Parameter[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryParameter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Parameter.${counter}.${key}`] = value; @@ -8829,7 +8865,7 @@ const serializeAws_queryPromoteReadReplicaDBClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -8837,10 +8873,10 @@ const serializeAws_queryPromoteReadReplicaDBClusterMessage = ( const serializeAws_queryRebootDBInstanceMessage = (input: RebootDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ForceFailover !== undefined) { + if (input.ForceFailover !== undefined && input.ForceFailover !== null) { entries["ForceFailover"] = input.ForceFailover; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } return entries; @@ -8851,13 +8887,13 @@ const serializeAws_queryRemoveRoleFromDBClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.FeatureName !== undefined) { + if (input.FeatureName !== undefined && input.FeatureName !== null) { entries["FeatureName"] = input.FeatureName; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -8868,10 +8904,10 @@ const serializeAws_queryRemoveSourceIdentifierFromSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.SourceIdentifier !== undefined) { + if (input.SourceIdentifier !== undefined && input.SourceIdentifier !== null) { entries["SourceIdentifier"] = input.SourceIdentifier; } return entries; @@ -8882,10 +8918,10 @@ const serializeAws_queryRemoveTagsFromResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; @@ -8900,13 +8936,13 @@ const serializeAws_queryResetDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResetAllParameters !== undefined) { + if (input.ResetAllParameters !== undefined && input.ResetAllParameters !== null) { entries["ResetAllParameters"] = input.ResetAllParameters; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -8921,17 +8957,17 @@ const serializeAws_queryResetDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; entries[loc] = value; }); } - if (input.ResetAllParameters !== undefined) { + if (input.ResetAllParameters !== undefined && input.ResetAllParameters !== null) { entries["ResetAllParameters"] = input.ResetAllParameters; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } return entries; @@ -8942,68 +8978,68 @@ const serializeAws_queryRestoreDBClusterFromSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.DatabaseName !== undefined) { + if (input.DatabaseName !== undefined && input.DatabaseName !== null) { entries["DatabaseName"] = input.DatabaseName; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } return entries; @@ -9014,61 +9050,61 @@ const serializeAws_queryRestoreDBClusterToPointInTimeMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.SourceDBClusterIdentifier !== undefined) { + if (input.SourceDBClusterIdentifier !== undefined && input.SourceDBClusterIdentifier !== null) { entries["SourceDBClusterIdentifier"] = input.SourceDBClusterIdentifier; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.UseLatestRestorableTime !== undefined) { + if (input.UseLatestRestorableTime !== undefined && input.UseLatestRestorableTime !== null) { entries["UseLatestRestorableTime"] = input.UseLatestRestorableTime; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.RestoreToTime !== undefined) { + if (input.RestoreToTime !== undefined && input.RestoreToTime !== null) { entries["RestoreToTime"] = input.RestoreToTime.toISOString().split(".")[0] + "Z"; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.RestoreType !== undefined) { + if (input.RestoreType !== undefined && input.RestoreType !== null) { entries["RestoreType"] = input.RestoreType; } return entries; @@ -9078,6 +9114,9 @@ const serializeAws_querySourceIdsList = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SourceId.${counter}`] = entry; counter++; } @@ -9086,7 +9125,7 @@ const serializeAws_querySourceIdsList = (input: string[], context: __SerdeContex const serializeAws_queryStartDBClusterMessage = (input: StartDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -9094,7 +9133,7 @@ const serializeAws_queryStartDBClusterMessage = (input: StartDBClusterMessage, c const serializeAws_queryStopDBClusterMessage = (input: StopDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -9104,6 +9143,9 @@ const serializeAws_queryStringList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -9114,6 +9156,9 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SubnetIdentifier.${counter}`] = entry; counter++; } @@ -9122,10 +9167,10 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } return entries; @@ -9135,6 +9180,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Tag.${counter}.${key}`] = value; @@ -9148,6 +9196,9 @@ const serializeAws_queryVpcSecurityGroupIdList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`VpcSecurityGroupId.${counter}`] = entry; counter++; } @@ -9184,7 +9235,14 @@ const deserializeAws_queryApplyPendingMaintenanceActionResult = ( }; const deserializeAws_queryAttributeValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryAuthorizationNotFoundFault = ( @@ -9211,11 +9269,25 @@ const deserializeAws_queryAvailabilityZone = (output: any, context: __SerdeConte }; const deserializeAws_queryAvailabilityZoneList = (output: any, context: __SerdeContext): AvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_queryAvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAvailabilityZone(entry, context); + }); }; const deserializeAws_queryAvailabilityZones = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryCertificateNotFoundFault = ( @@ -9729,7 +9801,14 @@ const deserializeAws_queryDBClusterEndpointAlreadyExistsFault = ( }; const deserializeAws_queryDBClusterEndpointList = (output: any, context: __SerdeContext): DBClusterEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterEndpoint(entry, context); + }); }; const deserializeAws_queryDBClusterEndpointMessage = ( @@ -9785,7 +9864,14 @@ const deserializeAws_queryDBClusterEndpointQuotaExceededFault = ( }; const deserializeAws_queryDBClusterList = (output: any, context: __SerdeContext): DBCluster[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBCluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBCluster(entry, context); + }); }; const deserializeAws_queryDBClusterMember = (output: any, context: __SerdeContext): DBClusterMember => { @@ -9811,7 +9897,14 @@ const deserializeAws_queryDBClusterMember = (output: any, context: __SerdeContex }; const deserializeAws_queryDBClusterMemberList = (output: any, context: __SerdeContext): DBClusterMember[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterMember(entry, context); + }); }; const deserializeAws_queryDBClusterMessage = (output: any, context: __SerdeContext): DBClusterMessage => { @@ -9848,7 +9941,14 @@ const deserializeAws_queryDBClusterOptionGroupMemberships = ( output: any, context: __SerdeContext ): DBClusterOptionGroupStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterOptionGroupStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterOptionGroupStatus(entry, context); + }); }; const deserializeAws_queryDBClusterOptionGroupStatus = ( @@ -9917,7 +10017,14 @@ const deserializeAws_queryDBClusterParameterGroupList = ( output: any, context: __SerdeContext ): DBClusterParameterGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterParameterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterParameterGroup(entry, context); + }); }; const deserializeAws_queryDBClusterParameterGroupNameMessage = ( @@ -10043,7 +10150,14 @@ const deserializeAws_queryDBClusterRoleQuotaExceededFault = ( }; const deserializeAws_queryDBClusterRoles = (output: any, context: __SerdeContext): DBClusterRole[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterRole(entry, context); + }); }; const deserializeAws_queryDBClusterSnapshot = (output: any, context: __SerdeContext): DBClusterSnapshot => { @@ -10178,7 +10292,14 @@ const deserializeAws_queryDBClusterSnapshotAttributeList = ( output: any, context: __SerdeContext ): DBClusterSnapshotAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterSnapshotAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterSnapshotAttribute(entry, context); + }); }; const deserializeAws_queryDBClusterSnapshotAttributesResult = ( @@ -10208,7 +10329,14 @@ const deserializeAws_queryDBClusterSnapshotAttributesResult = ( }; const deserializeAws_queryDBClusterSnapshotList = (output: any, context: __SerdeContext): DBClusterSnapshot[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterSnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterSnapshot(entry, context); + }); }; const deserializeAws_queryDBClusterSnapshotMessage = ( @@ -10329,7 +10457,14 @@ const deserializeAws_queryDBEngineVersion = (output: any, context: __SerdeContex }; const deserializeAws_queryDBEngineVersionList = (output: any, context: __SerdeContext): DBEngineVersion[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBEngineVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBEngineVersion(entry, context); + }); }; const deserializeAws_queryDBEngineVersionMessage = (output: any, context: __SerdeContext): DBEngineVersionMessage => { @@ -10656,7 +10791,14 @@ const deserializeAws_queryDBInstanceAlreadyExistsFault = ( }; const deserializeAws_queryDBInstanceList = (output: any, context: __SerdeContext): DBInstance[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBInstance(entry, context); + }); }; const deserializeAws_queryDBInstanceMessage = (output: any, context: __SerdeContext): DBInstanceMessage => { @@ -10712,7 +10854,14 @@ const deserializeAws_queryDBInstanceStatusInfo = (output: any, context: __SerdeC }; const deserializeAws_queryDBInstanceStatusInfoList = (output: any, context: __SerdeContext): DBInstanceStatusInfo[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBInstanceStatusInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBInstanceStatusInfo(entry, context); + }); }; const deserializeAws_queryDBParameterGroup = (output: any, context: __SerdeContext): DBParameterGroup => { @@ -10771,7 +10920,14 @@ const deserializeAws_queryDBParameterGroupDetails = (output: any, context: __Ser }; const deserializeAws_queryDBParameterGroupList = (output: any, context: __SerdeContext): DBParameterGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBParameterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBParameterGroup(entry, context); + }); }; const deserializeAws_queryDBParameterGroupNameMessage = ( @@ -10854,7 +11010,14 @@ const deserializeAws_queryDBParameterGroupStatusList = ( output: any, context: __SerdeContext ): DBParameterGroupStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBParameterGroupStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBParameterGroupStatus(entry, context); + }); }; const deserializeAws_queryDBSecurityGroupMembership = ( @@ -10878,7 +11041,14 @@ const deserializeAws_queryDBSecurityGroupMembershipList = ( output: any, context: __SerdeContext ): DBSecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBSecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBSecurityGroupMembership(entry, context); + }); }; const deserializeAws_queryDBSecurityGroupNotFoundFault = ( @@ -11023,7 +11193,14 @@ const deserializeAws_queryDBSubnetGroupQuotaExceededFault = ( }; const deserializeAws_queryDBSubnetGroups = (output: any, context: __SerdeContext): DBSubnetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBSubnetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBSubnetGroup(entry, context); + }); }; const deserializeAws_queryDBSubnetQuotaExceededFault = ( @@ -11240,7 +11417,14 @@ const deserializeAws_queryDomainMembership = (output: any, context: __SerdeConte }; const deserializeAws_queryDomainMembershipList = (output: any, context: __SerdeContext): DomainMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryDomainMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDomainMembership(entry, context); + }); }; const deserializeAws_queryDomainNotFoundFault = (output: any, context: __SerdeContext): DomainNotFoundFault => { @@ -11268,7 +11452,14 @@ const deserializeAws_queryDoubleRange = (output: any, context: __SerdeContext): }; const deserializeAws_queryDoubleRangeList = (output: any, context: __SerdeContext): DoubleRange[] => { - return (output || []).map((entry: any) => deserializeAws_queryDoubleRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDoubleRange(entry, context); + }); }; const deserializeAws_queryEndpoint = (output: any, context: __SerdeContext): Endpoint => { @@ -11350,7 +11541,14 @@ const deserializeAws_queryEvent = (output: any, context: __SerdeContext): Event }; const deserializeAws_queryEventCategoriesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryEventCategoriesMap = (output: any, context: __SerdeContext): EventCategoriesMap => { @@ -11374,7 +11572,14 @@ const deserializeAws_queryEventCategoriesMap = (output: any, context: __SerdeCon }; const deserializeAws_queryEventCategoriesMapList = (output: any, context: __SerdeContext): EventCategoriesMap[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventCategoriesMap(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventCategoriesMap(entry, context); + }); }; const deserializeAws_queryEventCategoriesMessage = (output: any, context: __SerdeContext): EventCategoriesMessage => { @@ -11397,7 +11602,14 @@ const deserializeAws_queryEventCategoriesMessage = (output: any, context: __Serd }; const deserializeAws_queryEventList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_queryEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEvent(entry, context); + }); }; const deserializeAws_queryEventsMessage = (output: any, context: __SerdeContext): EventsMessage => { @@ -11489,7 +11701,14 @@ const deserializeAws_queryEventSubscriptionQuotaExceededFault = ( }; const deserializeAws_queryEventSubscriptionsList = (output: any, context: __SerdeContext): EventSubscription[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventSubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventSubscription(entry, context); + }); }; const deserializeAws_queryEventSubscriptionsMessage = ( @@ -11757,7 +11976,14 @@ const deserializeAws_queryKMSKeyNotAccessibleFault = ( }; const deserializeAws_queryLogTypeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryModifyDBClusterEndpointOutput = ( @@ -11901,7 +12127,14 @@ const deserializeAws_queryOptionGroupMembershipList = ( output: any, context: __SerdeContext ): OptionGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryOptionGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOptionGroupMembership(entry, context); + }); }; const deserializeAws_queryOptionGroupNotFoundFault = ( @@ -12016,7 +12249,14 @@ const deserializeAws_queryOrderableDBInstanceOptionsList = ( output: any, context: __SerdeContext ): OrderableDBInstanceOption[] => { - return (output || []).map((entry: any) => deserializeAws_queryOrderableDBInstanceOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOrderableDBInstanceOption(entry, context); + }); }; const deserializeAws_queryOrderableDBInstanceOptionsMessage = ( @@ -12092,7 +12332,14 @@ const deserializeAws_queryParameter = (output: any, context: __SerdeContext): Pa }; const deserializeAws_queryParametersList = (output: any, context: __SerdeContext): Parameter[] => { - return (output || []).map((entry: any) => deserializeAws_queryParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryParameter(entry, context); + }); }; const deserializeAws_queryPendingCloudwatchLogsExports = ( @@ -12161,14 +12408,28 @@ const deserializeAws_queryPendingMaintenanceActionDetails = ( output: any, context: __SerdeContext ): PendingMaintenanceAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryPendingMaintenanceAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPendingMaintenanceAction(entry, context); + }); }; const deserializeAws_queryPendingMaintenanceActions = ( output: any, context: __SerdeContext ): ResourcePendingMaintenanceActions[] => { - return (output || []).map((entry: any) => deserializeAws_queryResourcePendingMaintenanceActions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryResourcePendingMaintenanceActions(entry, context); + }); }; const deserializeAws_queryPendingMaintenanceActionsMessage = ( @@ -12307,19 +12568,47 @@ const deserializeAws_queryRange = (output: any, context: __SerdeContext): Range }; const deserializeAws_queryRangeList = (output: any, context: __SerdeContext): Range[] => { - return (output || []).map((entry: any) => deserializeAws_queryRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRange(entry, context); + }); }; const deserializeAws_queryReadReplicaDBClusterIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryReadReplicaDBInstanceIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryReadReplicaIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryRebootDBInstanceResult = (output: any, context: __SerdeContext): RebootDBInstanceResult => { @@ -12467,7 +12756,14 @@ const deserializeAws_querySNSTopicArnNotFoundFault = ( }; const deserializeAws_querySourceIdsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySourceNotFoundFault = (output: any, context: __SerdeContext): SourceNotFoundFault => { @@ -12527,7 +12823,14 @@ const deserializeAws_queryStorageTypeNotSupportedFault = ( }; const deserializeAws_queryStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySubnet = (output: any, context: __SerdeContext): Subnet => { @@ -12559,7 +12862,14 @@ const deserializeAws_querySubnetAlreadyInUse = (output: any, context: __SerdeCon }; const deserializeAws_querySubnetList = (output: any, context: __SerdeContext): Subnet[] => { - return (output || []).map((entry: any) => deserializeAws_querySubnet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySubnet(entry, context); + }); }; const deserializeAws_querySubscriptionAlreadyExistFault = ( @@ -12602,11 +12912,25 @@ const deserializeAws_querySubscriptionNotFoundFault = ( }; const deserializeAws_querySupportedCharacterSetsList = (output: any, context: __SerdeContext): CharacterSet[] => { - return (output || []).map((entry: any) => deserializeAws_queryCharacterSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCharacterSet(entry, context); + }); }; const deserializeAws_querySupportedTimezonesList = (output: any, context: __SerdeContext): Timezone[] => { - return (output || []).map((entry: any) => deserializeAws_queryTimezone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTimezone(entry, context); + }); }; const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { @@ -12624,7 +12948,14 @@ const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTagListMessage = (output: any, context: __SerdeContext): TagListMessage => { @@ -12736,11 +13067,25 @@ const deserializeAws_queryValidStorageOptions = (output: any, context: __SerdeCo }; const deserializeAws_queryValidStorageOptionsList = (output: any, context: __SerdeContext): ValidStorageOptions[] => { - return (output || []).map((entry: any) => deserializeAws_queryValidStorageOptions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryValidStorageOptions(entry, context); + }); }; const deserializeAws_queryValidUpgradeTargetList = (output: any, context: __SerdeContext): UpgradeTarget[] => { - return (output || []).map((entry: any) => deserializeAws_queryUpgradeTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUpgradeTarget(entry, context); + }); }; const deserializeAws_queryVpcSecurityGroupMembership = ( @@ -12764,7 +13109,14 @@ const deserializeAws_queryVpcSecurityGroupMembershipList = ( output: any, context: __SerdeContext ): VpcSecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryVpcSecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryVpcSecurityGroupMembership(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ diff --git a/clients/client-network-firewall/protocols/Aws_json1_0.ts b/clients/client-network-firewall/protocols/Aws_json1_0.ts index ea31d2f5a557..410a9a89a65c 100644 --- a/clients/client-network-firewall/protocols/Aws_json1_0.ts +++ b/clients/client-network-firewall/protocols/Aws_json1_0.ts @@ -201,7 +201,7 @@ export const serializeAws_json1_0AssociateFirewallPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.AssociateFirewallPolicy", }; let body: any; @@ -214,7 +214,7 @@ export const serializeAws_json1_0AssociateSubnetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.AssociateSubnets", }; let body: any; @@ -227,7 +227,7 @@ export const serializeAws_json1_0CreateFirewallCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.CreateFirewall", }; let body: any; @@ -240,7 +240,7 @@ export const serializeAws_json1_0CreateFirewallPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.CreateFirewallPolicy", }; let body: any; @@ -253,7 +253,7 @@ export const serializeAws_json1_0CreateRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.CreateRuleGroup", }; let body: any; @@ -266,7 +266,7 @@ export const serializeAws_json1_0DeleteFirewallCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DeleteFirewall", }; let body: any; @@ -279,7 +279,7 @@ export const serializeAws_json1_0DeleteFirewallPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DeleteFirewallPolicy", }; let body: any; @@ -292,7 +292,7 @@ export const serializeAws_json1_0DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DeleteResourcePolicy", }; let body: any; @@ -305,7 +305,7 @@ export const serializeAws_json1_0DeleteRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DeleteRuleGroup", }; let body: any; @@ -318,7 +318,7 @@ export const serializeAws_json1_0DescribeFirewallCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DescribeFirewall", }; let body: any; @@ -331,7 +331,7 @@ export const serializeAws_json1_0DescribeFirewallPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DescribeFirewallPolicy", }; let body: any; @@ -344,7 +344,7 @@ export const serializeAws_json1_0DescribeLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DescribeLoggingConfiguration", }; let body: any; @@ -357,7 +357,7 @@ export const serializeAws_json1_0DescribeResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DescribeResourcePolicy", }; let body: any; @@ -370,7 +370,7 @@ export const serializeAws_json1_0DescribeRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DescribeRuleGroup", }; let body: any; @@ -383,7 +383,7 @@ export const serializeAws_json1_0DisassociateSubnetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.DisassociateSubnets", }; let body: any; @@ -396,7 +396,7 @@ export const serializeAws_json1_0ListFirewallPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.ListFirewallPolicies", }; let body: any; @@ -409,7 +409,7 @@ export const serializeAws_json1_0ListFirewallsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.ListFirewalls", }; let body: any; @@ -422,7 +422,7 @@ export const serializeAws_json1_0ListRuleGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.ListRuleGroups", }; let body: any; @@ -435,7 +435,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.ListTagsForResource", }; let body: any; @@ -448,7 +448,7 @@ export const serializeAws_json1_0PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.PutResourcePolicy", }; let body: any; @@ -461,7 +461,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.TagResource", }; let body: any; @@ -474,7 +474,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.UntagResource", }; let body: any; @@ -487,7 +487,7 @@ export const serializeAws_json1_0UpdateFirewallDeleteProtectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.UpdateFirewallDeleteProtection", }; let body: any; @@ -500,7 +500,7 @@ export const serializeAws_json1_0UpdateFirewallDescriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.UpdateFirewallDescription", }; let body: any; @@ -513,7 +513,7 @@ export const serializeAws_json1_0UpdateFirewallPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.UpdateFirewallPolicy", }; let body: any; @@ -526,7 +526,7 @@ export const serializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.UpdateFirewallPolicyChangeProtection", }; let body: any; @@ -539,7 +539,7 @@ export const serializeAws_json1_0UpdateLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.UpdateLoggingConfiguration", }; let body: any; @@ -552,7 +552,7 @@ export const serializeAws_json1_0UpdateRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.UpdateRuleGroup", }; let body: any; @@ -565,7 +565,7 @@ export const serializeAws_json1_0UpdateSubnetChangeProtectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "NetworkFirewall_20201112.UpdateSubnetChangeProtection", }; let body: any; @@ -600,8 +600,7 @@ const deserializeAws_json1_0AssociateFirewallPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -695,8 +694,7 @@ const deserializeAws_json1_0AssociateSubnetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -790,8 +788,7 @@ const deserializeAws_json1_0CreateFirewallCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientCapacityException": case "com.amazonaws.networkfirewall#InsufficientCapacityException": @@ -885,8 +882,7 @@ const deserializeAws_json1_0CreateFirewallPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientCapacityException": case "com.amazonaws.networkfirewall#InsufficientCapacityException": @@ -972,8 +968,7 @@ const deserializeAws_json1_0CreateRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InsufficientCapacityException": case "com.amazonaws.networkfirewall#InsufficientCapacityException": @@ -1059,8 +1054,7 @@ const deserializeAws_json1_0DeleteFirewallCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1154,8 +1148,7 @@ const deserializeAws_json1_0DeleteFirewallPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1249,8 +1242,7 @@ const deserializeAws_json1_0DeleteResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1320,8 +1312,7 @@ const deserializeAws_json1_0DeleteRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1415,8 +1406,7 @@ const deserializeAws_json1_0DescribeFirewallCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1494,8 +1484,7 @@ const deserializeAws_json1_0DescribeFirewallPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1573,8 +1562,7 @@ const deserializeAws_json1_0DescribeLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1652,8 +1640,7 @@ const deserializeAws_json1_0DescribeResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1723,8 +1710,7 @@ const deserializeAws_json1_0DescribeRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1802,8 +1788,7 @@ const deserializeAws_json1_0DisassociateSubnetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1897,8 +1882,7 @@ const deserializeAws_json1_0ListFirewallPoliciesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -1968,8 +1952,7 @@ const deserializeAws_json1_0ListFirewallsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -2039,8 +2022,7 @@ const deserializeAws_json1_0ListRuleGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -2110,8 +2092,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.networkfirewall#ResourceNotFoundException": @@ -2165,8 +2146,7 @@ const deserializeAws_json1_0PutResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -2252,8 +2232,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidRequestException": case "com.amazonaws.networkfirewall#InvalidRequestException": @@ -2315,8 +2294,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidRequestException": case "com.amazonaws.networkfirewall#InvalidRequestException": @@ -2378,8 +2356,7 @@ const deserializeAws_json1_0UpdateFirewallDeleteProtectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -2473,8 +2450,7 @@ const deserializeAws_json1_0UpdateFirewallDescriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -2560,8 +2536,7 @@ const deserializeAws_json1_0UpdateFirewallPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -2647,8 +2622,7 @@ const deserializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -2742,8 +2716,7 @@ const deserializeAws_json1_0UpdateLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -2837,8 +2810,7 @@ const deserializeAws_json1_0UpdateRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -2924,8 +2896,7 @@ const deserializeAws_json1_0UpdateSubnetChangeProtectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": @@ -3174,20 +3145,29 @@ const deserializeAws_json1_0UnsupportedOperationExceptionResponse = async ( const serializeAws_json1_0ActionDefinition = (input: ActionDefinition, context: __SerdeContext): any => { return { - ...(input.PublishMetricAction !== undefined && { - PublishMetricAction: serializeAws_json1_0PublishMetricAction(input.PublishMetricAction, context), - }), + ...(input.PublishMetricAction !== undefined && + input.PublishMetricAction !== null && { + PublishMetricAction: serializeAws_json1_0PublishMetricAction(input.PublishMetricAction, context), + }), }; }; const serializeAws_json1_0Address = (input: Address, context: __SerdeContext): any => { return { - ...(input.AddressDefinition !== undefined && { AddressDefinition: input.AddressDefinition }), + ...(input.AddressDefinition !== undefined && + input.AddressDefinition !== null && { AddressDefinition: input.AddressDefinition }), }; }; const serializeAws_json1_0Addresses = (input: Address[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Address(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Address(entry, context); + }); }; const serializeAws_json1_0AssociateFirewallPolicyRequest = ( @@ -3195,26 +3175,35 @@ const serializeAws_json1_0AssociateFirewallPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), - ...(input.FirewallPolicyArn !== undefined && { FirewallPolicyArn: input.FirewallPolicyArn }), - ...(input.UpdateToken !== undefined && { UpdateToken: input.UpdateToken }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), + ...(input.FirewallPolicyArn !== undefined && + input.FirewallPolicyArn !== null && { FirewallPolicyArn: input.FirewallPolicyArn }), + ...(input.UpdateToken !== undefined && input.UpdateToken !== null && { UpdateToken: input.UpdateToken }), }; }; const serializeAws_json1_0AssociateSubnetsRequest = (input: AssociateSubnetsRequest, context: __SerdeContext): any => { return { - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), - ...(input.SubnetMappings !== undefined && { - SubnetMappings: serializeAws_json1_0SubnetMappings(input.SubnetMappings, context), - }), - ...(input.UpdateToken !== undefined && { UpdateToken: input.UpdateToken }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), + ...(input.SubnetMappings !== undefined && + input.SubnetMappings !== null && { + SubnetMappings: serializeAws_json1_0SubnetMappings(input.SubnetMappings, context), + }), + ...(input.UpdateToken !== undefined && input.UpdateToken !== null && { UpdateToken: input.UpdateToken }), }; }; const serializeAws_json1_0AzSubnets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0CreateFirewallPolicyRequest = ( @@ -3222,58 +3211,74 @@ const serializeAws_json1_0CreateFirewallPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.FirewallPolicy !== undefined && { - FirewallPolicy: serializeAws_json1_0FirewallPolicy(input.FirewallPolicy, context), - }), - ...(input.FirewallPolicyName !== undefined && { FirewallPolicyName: input.FirewallPolicyName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.FirewallPolicy !== undefined && + input.FirewallPolicy !== null && { + FirewallPolicy: serializeAws_json1_0FirewallPolicy(input.FirewallPolicy, context), + }), + ...(input.FirewallPolicyName !== undefined && + input.FirewallPolicyName !== null && { FirewallPolicyName: input.FirewallPolicyName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), }; }; const serializeAws_json1_0CreateFirewallRequest = (input: CreateFirewallRequest, context: __SerdeContext): any => { return { - ...(input.DeleteProtection !== undefined && { DeleteProtection: input.DeleteProtection }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), - ...(input.FirewallPolicyArn !== undefined && { FirewallPolicyArn: input.FirewallPolicyArn }), - ...(input.FirewallPolicyChangeProtection !== undefined && { - FirewallPolicyChangeProtection: input.FirewallPolicyChangeProtection, - }), - ...(input.SubnetChangeProtection !== undefined && { SubnetChangeProtection: input.SubnetChangeProtection }), - ...(input.SubnetMappings !== undefined && { - SubnetMappings: serializeAws_json1_0SubnetMappings(input.SubnetMappings, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.DeleteProtection !== undefined && + input.DeleteProtection !== null && { DeleteProtection: input.DeleteProtection }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), + ...(input.FirewallPolicyArn !== undefined && + input.FirewallPolicyArn !== null && { FirewallPolicyArn: input.FirewallPolicyArn }), + ...(input.FirewallPolicyChangeProtection !== undefined && + input.FirewallPolicyChangeProtection !== null && { + FirewallPolicyChangeProtection: input.FirewallPolicyChangeProtection, + }), + ...(input.SubnetChangeProtection !== undefined && + input.SubnetChangeProtection !== null && { SubnetChangeProtection: input.SubnetChangeProtection }), + ...(input.SubnetMappings !== undefined && + input.SubnetMappings !== null && { + SubnetMappings: serializeAws_json1_0SubnetMappings(input.SubnetMappings, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; const serializeAws_json1_0CreateRuleGroupRequest = (input: CreateRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.Capacity !== undefined && { Capacity: input.Capacity }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.RuleGroup !== undefined && { RuleGroup: serializeAws_json1_0RuleGroup(input.RuleGroup, context) }), - ...(input.RuleGroupName !== undefined && { RuleGroupName: input.RuleGroupName }), - ...(input.Rules !== undefined && { Rules: input.Rules }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Capacity !== undefined && input.Capacity !== null && { Capacity: input.Capacity }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.RuleGroup !== undefined && + input.RuleGroup !== null && { RuleGroup: serializeAws_json1_0RuleGroup(input.RuleGroup, context) }), + ...(input.RuleGroupName !== undefined && input.RuleGroupName !== null && { RuleGroupName: input.RuleGroupName }), + ...(input.Rules !== undefined && input.Rules !== null && { Rules: input.Rules }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_0CustomAction = (input: CustomAction, context: __SerdeContext): any => { return { - ...(input.ActionDefinition !== undefined && { - ActionDefinition: serializeAws_json1_0ActionDefinition(input.ActionDefinition, context), - }), - ...(input.ActionName !== undefined && { ActionName: input.ActionName }), + ...(input.ActionDefinition !== undefined && + input.ActionDefinition !== null && { + ActionDefinition: serializeAws_json1_0ActionDefinition(input.ActionDefinition, context), + }), + ...(input.ActionName !== undefined && input.ActionName !== null && { ActionName: input.ActionName }), }; }; const serializeAws_json1_0CustomActions = (input: CustomAction[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0CustomAction(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0CustomAction(entry, context); + }); }; const serializeAws_json1_0DeleteFirewallPolicyRequest = ( @@ -3281,15 +3286,17 @@ const serializeAws_json1_0DeleteFirewallPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.FirewallPolicyArn !== undefined && { FirewallPolicyArn: input.FirewallPolicyArn }), - ...(input.FirewallPolicyName !== undefined && { FirewallPolicyName: input.FirewallPolicyName }), + ...(input.FirewallPolicyArn !== undefined && + input.FirewallPolicyArn !== null && { FirewallPolicyArn: input.FirewallPolicyArn }), + ...(input.FirewallPolicyName !== undefined && + input.FirewallPolicyName !== null && { FirewallPolicyName: input.FirewallPolicyName }), }; }; const serializeAws_json1_0DeleteFirewallRequest = (input: DeleteFirewallRequest, context: __SerdeContext): any => { return { - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), }; }; @@ -3298,15 +3305,15 @@ const serializeAws_json1_0DeleteResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_0DeleteRuleGroupRequest = (input: DeleteRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.RuleGroupArn !== undefined && { RuleGroupArn: input.RuleGroupArn }), - ...(input.RuleGroupName !== undefined && { RuleGroupName: input.RuleGroupName }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.RuleGroupArn !== undefined && input.RuleGroupArn !== null && { RuleGroupArn: input.RuleGroupArn }), + ...(input.RuleGroupName !== undefined && input.RuleGroupName !== null && { RuleGroupName: input.RuleGroupName }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -3315,15 +3322,17 @@ const serializeAws_json1_0DescribeFirewallPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.FirewallPolicyArn !== undefined && { FirewallPolicyArn: input.FirewallPolicyArn }), - ...(input.FirewallPolicyName !== undefined && { FirewallPolicyName: input.FirewallPolicyName }), + ...(input.FirewallPolicyArn !== undefined && + input.FirewallPolicyArn !== null && { FirewallPolicyArn: input.FirewallPolicyArn }), + ...(input.FirewallPolicyName !== undefined && + input.FirewallPolicyName !== null && { FirewallPolicyName: input.FirewallPolicyName }), }; }; const serializeAws_json1_0DescribeFirewallRequest = (input: DescribeFirewallRequest, context: __SerdeContext): any => { return { - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), }; }; @@ -3332,8 +3341,8 @@ const serializeAws_json1_0DescribeLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), }; }; @@ -3342,7 +3351,7 @@ const serializeAws_json1_0DescribeResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -3351,20 +3360,27 @@ const serializeAws_json1_0DescribeRuleGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.RuleGroupArn !== undefined && { RuleGroupArn: input.RuleGroupArn }), - ...(input.RuleGroupName !== undefined && { RuleGroupName: input.RuleGroupName }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.RuleGroupArn !== undefined && input.RuleGroupArn !== null && { RuleGroupArn: input.RuleGroupArn }), + ...(input.RuleGroupName !== undefined && input.RuleGroupName !== null && { RuleGroupName: input.RuleGroupName }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_0Dimension = (input: Dimension, context: __SerdeContext): any => { return { - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_0Dimensions = (input: Dimension[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Dimension(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Dimension(entry, context); + }); }; const serializeAws_json1_0DisassociateSubnetsRequest = ( @@ -3372,73 +3388,90 @@ const serializeAws_json1_0DisassociateSubnetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_0AzSubnets(input.SubnetIds, context) }), - ...(input.UpdateToken !== undefined && { UpdateToken: input.UpdateToken }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_0AzSubnets(input.SubnetIds, context) }), + ...(input.UpdateToken !== undefined && input.UpdateToken !== null && { UpdateToken: input.UpdateToken }), }; }; const serializeAws_json1_0FirewallPolicy = (input: FirewallPolicy, context: __SerdeContext): any => { return { - ...(input.StatefulRuleGroupReferences !== undefined && { - StatefulRuleGroupReferences: serializeAws_json1_0StatefulRuleGroupReferences( - input.StatefulRuleGroupReferences, - context - ), - }), - ...(input.StatelessCustomActions !== undefined && { - StatelessCustomActions: serializeAws_json1_0CustomActions(input.StatelessCustomActions, context), - }), - ...(input.StatelessDefaultActions !== undefined && { - StatelessDefaultActions: serializeAws_json1_0StatelessActions(input.StatelessDefaultActions, context), - }), - ...(input.StatelessFragmentDefaultActions !== undefined && { - StatelessFragmentDefaultActions: serializeAws_json1_0StatelessActions( - input.StatelessFragmentDefaultActions, - context - ), - }), - ...(input.StatelessRuleGroupReferences !== undefined && { - StatelessRuleGroupReferences: serializeAws_json1_0StatelessRuleGroupReferences( - input.StatelessRuleGroupReferences, - context - ), - }), + ...(input.StatefulRuleGroupReferences !== undefined && + input.StatefulRuleGroupReferences !== null && { + StatefulRuleGroupReferences: serializeAws_json1_0StatefulRuleGroupReferences( + input.StatefulRuleGroupReferences, + context + ), + }), + ...(input.StatelessCustomActions !== undefined && + input.StatelessCustomActions !== null && { + StatelessCustomActions: serializeAws_json1_0CustomActions(input.StatelessCustomActions, context), + }), + ...(input.StatelessDefaultActions !== undefined && + input.StatelessDefaultActions !== null && { + StatelessDefaultActions: serializeAws_json1_0StatelessActions(input.StatelessDefaultActions, context), + }), + ...(input.StatelessFragmentDefaultActions !== undefined && + input.StatelessFragmentDefaultActions !== null && { + StatelessFragmentDefaultActions: serializeAws_json1_0StatelessActions( + input.StatelessFragmentDefaultActions, + context + ), + }), + ...(input.StatelessRuleGroupReferences !== undefined && + input.StatelessRuleGroupReferences !== null && { + StatelessRuleGroupReferences: serializeAws_json1_0StatelessRuleGroupReferences( + input.StatelessRuleGroupReferences, + context + ), + }), }; }; const serializeAws_json1_0Flags = (input: (TCPFlag | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0Header = (input: Header, context: __SerdeContext): any => { return { - ...(input.Destination !== undefined && { Destination: input.Destination }), - ...(input.DestinationPort !== undefined && { DestinationPort: input.DestinationPort }), - ...(input.Direction !== undefined && { Direction: input.Direction }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.SourcePort !== undefined && { SourcePort: input.SourcePort }), + ...(input.Destination !== undefined && input.Destination !== null && { Destination: input.Destination }), + ...(input.DestinationPort !== undefined && + input.DestinationPort !== null && { DestinationPort: input.DestinationPort }), + ...(input.Direction !== undefined && input.Direction !== null && { Direction: input.Direction }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.SourcePort !== undefined && input.SourcePort !== null && { SourcePort: input.SourcePort }), }; }; const serializeAws_json1_0IPSet = (input: IPSet, context: __SerdeContext): any => { return { - ...(input.Definition !== undefined && { - Definition: serializeAws_json1_0VariableDefinitionList(input.Definition, context), - }), + ...(input.Definition !== undefined && + input.Definition !== null && { + Definition: serializeAws_json1_0VariableDefinitionList(input.Definition, context), + }), }; }; const serializeAws_json1_0IPSets = (input: { [key: string]: IPSet }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: IPSet }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: IPSet }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0IPSet(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0ListFirewallPoliciesRequest = ( @@ -3446,23 +3479,24 @@ const serializeAws_json1_0ListFirewallPoliciesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_0ListFirewallsRequest = (input: ListFirewallsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.VpcIds !== undefined && { VpcIds: serializeAws_json1_0VpcIds(input.VpcIds, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.VpcIds !== undefined && + input.VpcIds !== null && { VpcIds: serializeAws_json1_0VpcIds(input.VpcIds, context) }), }; }; const serializeAws_json1_0ListRuleGroupsRequest = (input: ListRuleGroupsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3471,95 +3505,129 @@ const serializeAws_json1_0ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_0LogDestinationConfig = (input: LogDestinationConfig, context: __SerdeContext): any => { return { - ...(input.LogDestination !== undefined && { - LogDestination: serializeAws_json1_0LogDestinationMap(input.LogDestination, context), - }), - ...(input.LogDestinationType !== undefined && { LogDestinationType: input.LogDestinationType }), - ...(input.LogType !== undefined && { LogType: input.LogType }), + ...(input.LogDestination !== undefined && + input.LogDestination !== null && { + LogDestination: serializeAws_json1_0LogDestinationMap(input.LogDestination, context), + }), + ...(input.LogDestinationType !== undefined && + input.LogDestinationType !== null && { LogDestinationType: input.LogDestinationType }), + ...(input.LogType !== undefined && input.LogType !== null && { LogType: input.LogType }), }; }; const serializeAws_json1_0LogDestinationConfigs = (input: LogDestinationConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0LogDestinationConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0LogDestinationConfig(entry, context); + }); }; const serializeAws_json1_0LogDestinationMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0LoggingConfiguration = (input: LoggingConfiguration, context: __SerdeContext): any => { return { - ...(input.LogDestinationConfigs !== undefined && { - LogDestinationConfigs: serializeAws_json1_0LogDestinationConfigs(input.LogDestinationConfigs, context), - }), + ...(input.LogDestinationConfigs !== undefined && + input.LogDestinationConfigs !== null && { + LogDestinationConfigs: serializeAws_json1_0LogDestinationConfigs(input.LogDestinationConfigs, context), + }), }; }; const serializeAws_json1_0MatchAttributes = (input: MatchAttributes, context: __SerdeContext): any => { return { - ...(input.DestinationPorts !== undefined && { - DestinationPorts: serializeAws_json1_0PortRanges(input.DestinationPorts, context), - }), - ...(input.Destinations !== undefined && { - Destinations: serializeAws_json1_0Addresses(input.Destinations, context), - }), - ...(input.Protocols !== undefined && { Protocols: serializeAws_json1_0ProtocolNumbers(input.Protocols, context) }), - ...(input.SourcePorts !== undefined && { SourcePorts: serializeAws_json1_0PortRanges(input.SourcePorts, context) }), - ...(input.Sources !== undefined && { Sources: serializeAws_json1_0Addresses(input.Sources, context) }), - ...(input.TCPFlags !== undefined && { TCPFlags: serializeAws_json1_0TCPFlags(input.TCPFlags, context) }), + ...(input.DestinationPorts !== undefined && + input.DestinationPorts !== null && { + DestinationPorts: serializeAws_json1_0PortRanges(input.DestinationPorts, context), + }), + ...(input.Destinations !== undefined && + input.Destinations !== null && { Destinations: serializeAws_json1_0Addresses(input.Destinations, context) }), + ...(input.Protocols !== undefined && + input.Protocols !== null && { Protocols: serializeAws_json1_0ProtocolNumbers(input.Protocols, context) }), + ...(input.SourcePorts !== undefined && + input.SourcePorts !== null && { SourcePorts: serializeAws_json1_0PortRanges(input.SourcePorts, context) }), + ...(input.Sources !== undefined && + input.Sources !== null && { Sources: serializeAws_json1_0Addresses(input.Sources, context) }), + ...(input.TCPFlags !== undefined && + input.TCPFlags !== null && { TCPFlags: serializeAws_json1_0TCPFlags(input.TCPFlags, context) }), }; }; const serializeAws_json1_0PortRange = (input: PortRange, context: __SerdeContext): any => { return { - ...(input.FromPort !== undefined && { FromPort: input.FromPort }), - ...(input.ToPort !== undefined && { ToPort: input.ToPort }), + ...(input.FromPort !== undefined && input.FromPort !== null && { FromPort: input.FromPort }), + ...(input.ToPort !== undefined && input.ToPort !== null && { ToPort: input.ToPort }), }; }; const serializeAws_json1_0PortRanges = (input: PortRange[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0PortRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0PortRange(entry, context); + }); }; const serializeAws_json1_0PortSet = (input: PortSet, context: __SerdeContext): any => { return { - ...(input.Definition !== undefined && { - Definition: serializeAws_json1_0VariableDefinitionList(input.Definition, context), - }), + ...(input.Definition !== undefined && + input.Definition !== null && { + Definition: serializeAws_json1_0VariableDefinitionList(input.Definition, context), + }), }; }; const serializeAws_json1_0PortSets = (input: { [key: string]: PortSet }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: PortSet }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: PortSet }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_0PortSet(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_0ProtocolNumbers = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0PublishMetricAction = (input: PublishMetricAction, context: __SerdeContext): any => { return { - ...(input.Dimensions !== undefined && { Dimensions: serializeAws_json1_0Dimensions(input.Dimensions, context) }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_json1_0Dimensions(input.Dimensions, context) }), }; }; @@ -3568,92 +3636,122 @@ const serializeAws_json1_0PutResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_0RuleDefinition = (input: RuleDefinition, context: __SerdeContext): any => { return { - ...(input.Actions !== undefined && { Actions: serializeAws_json1_0StatelessActions(input.Actions, context) }), - ...(input.MatchAttributes !== undefined && { - MatchAttributes: serializeAws_json1_0MatchAttributes(input.MatchAttributes, context), - }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_json1_0StatelessActions(input.Actions, context) }), + ...(input.MatchAttributes !== undefined && + input.MatchAttributes !== null && { + MatchAttributes: serializeAws_json1_0MatchAttributes(input.MatchAttributes, context), + }), }; }; const serializeAws_json1_0RuleGroup = (input: RuleGroup, context: __SerdeContext): any => { return { - ...(input.RuleVariables !== undefined && { - RuleVariables: serializeAws_json1_0RuleVariables(input.RuleVariables, context), - }), - ...(input.RulesSource !== undefined && { - RulesSource: serializeAws_json1_0RulesSource(input.RulesSource, context), - }), + ...(input.RuleVariables !== undefined && + input.RuleVariables !== null && { + RuleVariables: serializeAws_json1_0RuleVariables(input.RuleVariables, context), + }), + ...(input.RulesSource !== undefined && + input.RulesSource !== null && { RulesSource: serializeAws_json1_0RulesSource(input.RulesSource, context) }), }; }; const serializeAws_json1_0RuleOption = (input: RuleOption, context: __SerdeContext): any => { return { - ...(input.Keyword !== undefined && { Keyword: input.Keyword }), - ...(input.Settings !== undefined && { Settings: serializeAws_json1_0Settings(input.Settings, context) }), + ...(input.Keyword !== undefined && input.Keyword !== null && { Keyword: input.Keyword }), + ...(input.Settings !== undefined && + input.Settings !== null && { Settings: serializeAws_json1_0Settings(input.Settings, context) }), }; }; const serializeAws_json1_0RuleOptions = (input: RuleOption[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0RuleOption(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0RuleOption(entry, context); + }); }; const serializeAws_json1_0RulesSource = (input: RulesSource, context: __SerdeContext): any => { return { - ...(input.RulesSourceList !== undefined && { - RulesSourceList: serializeAws_json1_0RulesSourceList(input.RulesSourceList, context), - }), - ...(input.RulesString !== undefined && { RulesString: input.RulesString }), - ...(input.StatefulRules !== undefined && { - StatefulRules: serializeAws_json1_0StatefulRules(input.StatefulRules, context), - }), - ...(input.StatelessRulesAndCustomActions !== undefined && { - StatelessRulesAndCustomActions: serializeAws_json1_0StatelessRulesAndCustomActions( - input.StatelessRulesAndCustomActions, - context - ), - }), + ...(input.RulesSourceList !== undefined && + input.RulesSourceList !== null && { + RulesSourceList: serializeAws_json1_0RulesSourceList(input.RulesSourceList, context), + }), + ...(input.RulesString !== undefined && input.RulesString !== null && { RulesString: input.RulesString }), + ...(input.StatefulRules !== undefined && + input.StatefulRules !== null && { + StatefulRules: serializeAws_json1_0StatefulRules(input.StatefulRules, context), + }), + ...(input.StatelessRulesAndCustomActions !== undefined && + input.StatelessRulesAndCustomActions !== null && { + StatelessRulesAndCustomActions: serializeAws_json1_0StatelessRulesAndCustomActions( + input.StatelessRulesAndCustomActions, + context + ), + }), }; }; const serializeAws_json1_0RulesSourceList = (input: RulesSourceList, context: __SerdeContext): any => { return { - ...(input.GeneratedRulesType !== undefined && { GeneratedRulesType: input.GeneratedRulesType }), - ...(input.TargetTypes !== undefined && { - TargetTypes: serializeAws_json1_0TargetTypes(input.TargetTypes, context), - }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_0RuleTargets(input.Targets, context) }), + ...(input.GeneratedRulesType !== undefined && + input.GeneratedRulesType !== null && { GeneratedRulesType: input.GeneratedRulesType }), + ...(input.TargetTypes !== undefined && + input.TargetTypes !== null && { TargetTypes: serializeAws_json1_0TargetTypes(input.TargetTypes, context) }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_0RuleTargets(input.Targets, context) }), }; }; const serializeAws_json1_0RuleTargets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0RuleVariables = (input: RuleVariables, context: __SerdeContext): any => { return { - ...(input.IPSets !== undefined && { IPSets: serializeAws_json1_0IPSets(input.IPSets, context) }), - ...(input.PortSets !== undefined && { PortSets: serializeAws_json1_0PortSets(input.PortSets, context) }), + ...(input.IPSets !== undefined && + input.IPSets !== null && { IPSets: serializeAws_json1_0IPSets(input.IPSets, context) }), + ...(input.PortSets !== undefined && + input.PortSets !== null && { PortSets: serializeAws_json1_0PortSets(input.PortSets, context) }), }; }; const serializeAws_json1_0Settings = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0StatefulRule = (input: StatefulRule, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Header !== undefined && { Header: serializeAws_json1_0Header(input.Header, context) }), - ...(input.RuleOptions !== undefined && { - RuleOptions: serializeAws_json1_0RuleOptions(input.RuleOptions, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Header !== undefined && + input.Header !== null && { Header: serializeAws_json1_0Header(input.Header, context) }), + ...(input.RuleOptions !== undefined && + input.RuleOptions !== null && { RuleOptions: serializeAws_json1_0RuleOptions(input.RuleOptions, context) }), }; }; @@ -3662,7 +3760,7 @@ const serializeAws_json1_0StatefulRuleGroupReference = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -3670,23 +3768,45 @@ const serializeAws_json1_0StatefulRuleGroupReferences = ( input: StatefulRuleGroupReference[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0StatefulRuleGroupReference(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0StatefulRuleGroupReference(entry, context); + }); }; const serializeAws_json1_0StatefulRules = (input: StatefulRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0StatefulRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0StatefulRule(entry, context); + }); }; const serializeAws_json1_0StatelessActions = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0StatelessRule = (input: StatelessRule, context: __SerdeContext): any => { return { - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.RuleDefinition !== undefined && { - RuleDefinition: serializeAws_json1_0RuleDefinition(input.RuleDefinition, context), - }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.RuleDefinition !== undefined && + input.RuleDefinition !== null && { + RuleDefinition: serializeAws_json1_0RuleDefinition(input.RuleDefinition, context), + }), }; }; @@ -3695,8 +3815,8 @@ const serializeAws_json1_0StatelessRuleGroupReference = ( context: __SerdeContext ): any => { return { - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -3704,11 +3824,25 @@ const serializeAws_json1_0StatelessRuleGroupReferences = ( input: StatelessRuleGroupReference[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_0StatelessRuleGroupReference(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0StatelessRuleGroupReference(entry, context); + }); }; const serializeAws_json1_0StatelessRules = (input: StatelessRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0StatelessRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0StatelessRule(entry, context); + }); }; const serializeAws_json1_0StatelessRulesAndCustomActions = ( @@ -3716,66 +3850,106 @@ const serializeAws_json1_0StatelessRulesAndCustomActions = ( context: __SerdeContext ): any => { return { - ...(input.CustomActions !== undefined && { - CustomActions: serializeAws_json1_0CustomActions(input.CustomActions, context), - }), - ...(input.StatelessRules !== undefined && { - StatelessRules: serializeAws_json1_0StatelessRules(input.StatelessRules, context), - }), + ...(input.CustomActions !== undefined && + input.CustomActions !== null && { + CustomActions: serializeAws_json1_0CustomActions(input.CustomActions, context), + }), + ...(input.StatelessRules !== undefined && + input.StatelessRules !== null && { + StatelessRules: serializeAws_json1_0StatelessRules(input.StatelessRules, context), + }), }; }; const serializeAws_json1_0SubnetMapping = (input: SubnetMapping, context: __SerdeContext): any => { return { - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), }; }; const serializeAws_json1_0SubnetMappings = (input: SubnetMapping[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0SubnetMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0SubnetMapping(entry, context); + }); }; const serializeAws_json1_0Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_0TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Tag(entry, context); + }); }; const serializeAws_json1_0TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), }; }; const serializeAws_json1_0TargetTypes = (input: (TargetType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0TCPFlagField = (input: TCPFlagField, context: __SerdeContext): any => { return { - ...(input.Flags !== undefined && { Flags: serializeAws_json1_0Flags(input.Flags, context) }), - ...(input.Masks !== undefined && { Masks: serializeAws_json1_0Flags(input.Masks, context) }), + ...(input.Flags !== undefined && + input.Flags !== null && { Flags: serializeAws_json1_0Flags(input.Flags, context) }), + ...(input.Masks !== undefined && + input.Masks !== null && { Masks: serializeAws_json1_0Flags(input.Masks, context) }), }; }; const serializeAws_json1_0TCPFlags = (input: TCPFlagField[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0TCPFlagField(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0TCPFlagField(entry, context); + }); }; const serializeAws_json1_0UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }), }; }; @@ -3784,10 +3958,11 @@ const serializeAws_json1_0UpdateFirewallDeleteProtectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeleteProtection !== undefined && { DeleteProtection: input.DeleteProtection }), - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), - ...(input.UpdateToken !== undefined && { UpdateToken: input.UpdateToken }), + ...(input.DeleteProtection !== undefined && + input.DeleteProtection !== null && { DeleteProtection: input.DeleteProtection }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), + ...(input.UpdateToken !== undefined && input.UpdateToken !== null && { UpdateToken: input.UpdateToken }), }; }; @@ -3796,10 +3971,10 @@ const serializeAws_json1_0UpdateFirewallDescriptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), - ...(input.UpdateToken !== undefined && { UpdateToken: input.UpdateToken }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), + ...(input.UpdateToken !== undefined && input.UpdateToken !== null && { UpdateToken: input.UpdateToken }), }; }; @@ -3808,12 +3983,13 @@ const serializeAws_json1_0UpdateFirewallPolicyChangeProtectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), - ...(input.FirewallPolicyChangeProtection !== undefined && { - FirewallPolicyChangeProtection: input.FirewallPolicyChangeProtection, - }), - ...(input.UpdateToken !== undefined && { UpdateToken: input.UpdateToken }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), + ...(input.FirewallPolicyChangeProtection !== undefined && + input.FirewallPolicyChangeProtection !== null && { + FirewallPolicyChangeProtection: input.FirewallPolicyChangeProtection, + }), + ...(input.UpdateToken !== undefined && input.UpdateToken !== null && { UpdateToken: input.UpdateToken }), }; }; @@ -3822,14 +3998,17 @@ const serializeAws_json1_0UpdateFirewallPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.FirewallPolicy !== undefined && { - FirewallPolicy: serializeAws_json1_0FirewallPolicy(input.FirewallPolicy, context), - }), - ...(input.FirewallPolicyArn !== undefined && { FirewallPolicyArn: input.FirewallPolicyArn }), - ...(input.FirewallPolicyName !== undefined && { FirewallPolicyName: input.FirewallPolicyName }), - ...(input.UpdateToken !== undefined && { UpdateToken: input.UpdateToken }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.FirewallPolicy !== undefined && + input.FirewallPolicy !== null && { + FirewallPolicy: serializeAws_json1_0FirewallPolicy(input.FirewallPolicy, context), + }), + ...(input.FirewallPolicyArn !== undefined && + input.FirewallPolicyArn !== null && { FirewallPolicyArn: input.FirewallPolicyArn }), + ...(input.FirewallPolicyName !== undefined && + input.FirewallPolicyName !== null && { FirewallPolicyName: input.FirewallPolicyName }), + ...(input.UpdateToken !== undefined && input.UpdateToken !== null && { UpdateToken: input.UpdateToken }), }; }; @@ -3838,24 +4017,26 @@ const serializeAws_json1_0UpdateLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), - ...(input.LoggingConfiguration !== undefined && { - LoggingConfiguration: serializeAws_json1_0LoggingConfiguration(input.LoggingConfiguration, context), - }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), + ...(input.LoggingConfiguration !== undefined && + input.LoggingConfiguration !== null && { + LoggingConfiguration: serializeAws_json1_0LoggingConfiguration(input.LoggingConfiguration, context), + }), }; }; const serializeAws_json1_0UpdateRuleGroupRequest = (input: UpdateRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.RuleGroup !== undefined && { RuleGroup: serializeAws_json1_0RuleGroup(input.RuleGroup, context) }), - ...(input.RuleGroupArn !== undefined && { RuleGroupArn: input.RuleGroupArn }), - ...(input.RuleGroupName !== undefined && { RuleGroupName: input.RuleGroupName }), - ...(input.Rules !== undefined && { Rules: input.Rules }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.UpdateToken !== undefined && { UpdateToken: input.UpdateToken }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.RuleGroup !== undefined && + input.RuleGroup !== null && { RuleGroup: serializeAws_json1_0RuleGroup(input.RuleGroup, context) }), + ...(input.RuleGroupArn !== undefined && input.RuleGroupArn !== null && { RuleGroupArn: input.RuleGroupArn }), + ...(input.RuleGroupName !== undefined && input.RuleGroupName !== null && { RuleGroupName: input.RuleGroupName }), + ...(input.Rules !== undefined && input.Rules !== null && { Rules: input.Rules }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.UpdateToken !== undefined && input.UpdateToken !== null && { UpdateToken: input.UpdateToken }), }; }; @@ -3864,19 +4045,34 @@ const serializeAws_json1_0UpdateSubnetChangeProtectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.FirewallArn !== undefined && { FirewallArn: input.FirewallArn }), - ...(input.FirewallName !== undefined && { FirewallName: input.FirewallName }), - ...(input.SubnetChangeProtection !== undefined && { SubnetChangeProtection: input.SubnetChangeProtection }), - ...(input.UpdateToken !== undefined && { UpdateToken: input.UpdateToken }), + ...(input.FirewallArn !== undefined && input.FirewallArn !== null && { FirewallArn: input.FirewallArn }), + ...(input.FirewallName !== undefined && input.FirewallName !== null && { FirewallName: input.FirewallName }), + ...(input.SubnetChangeProtection !== undefined && + input.SubnetChangeProtection !== null && { SubnetChangeProtection: input.SubnetChangeProtection }), + ...(input.UpdateToken !== undefined && input.UpdateToken !== null && { UpdateToken: input.UpdateToken }), }; }; const serializeAws_json1_0VariableDefinitionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0VpcIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0ActionDefinition = (output: any, context: __SerdeContext): ActionDefinition => { @@ -3898,7 +4094,14 @@ const deserializeAws_json1_0Address = (output: any, context: __SerdeContext): Ad }; const deserializeAws_json1_0Addresses = (output: any, context: __SerdeContext): Address[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Address(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Address(entry, context); + }); }; const deserializeAws_json1_0AssociateFirewallPolicyResponse = ( @@ -3989,7 +4192,14 @@ const deserializeAws_json1_0CustomAction = (output: any, context: __SerdeContext }; const deserializeAws_json1_0CustomActions = (output: any, context: __SerdeContext): CustomAction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0CustomAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0CustomAction(entry, context); + }); }; const deserializeAws_json1_0DeleteFirewallPolicyResponse = ( @@ -4116,7 +4326,14 @@ const deserializeAws_json1_0Dimension = (output: any, context: __SerdeContext): }; const deserializeAws_json1_0Dimensions = (output: any, context: __SerdeContext): Dimension[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Dimension(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Dimension(entry, context); + }); }; const deserializeAws_json1_0DisassociateSubnetsResponse = ( @@ -4174,7 +4391,14 @@ const deserializeAws_json1_0FirewallMetadata = (output: any, context: __SerdeCon }; const deserializeAws_json1_0FirewallPolicies = (output: any, context: __SerdeContext): FirewallPolicyMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0FirewallPolicyMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0FirewallPolicyMetadata(entry, context); + }); }; const deserializeAws_json1_0FirewallPolicy = (output: any, context: __SerdeContext): FirewallPolicy => { @@ -4234,7 +4458,14 @@ const deserializeAws_json1_0FirewallPolicyResponse = (output: any, context: __Se }; const deserializeAws_json1_0Firewalls = (output: any, context: __SerdeContext): FirewallMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0FirewallMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0FirewallMetadata(entry, context); + }); }; const deserializeAws_json1_0FirewallStatus = (output: any, context: __SerdeContext): FirewallStatus => { @@ -4252,7 +4483,14 @@ const deserializeAws_json1_0FirewallStatus = (output: any, context: __SerdeConte }; const deserializeAws_json1_0Flags = (output: any, context: __SerdeContext): (TCPFlag | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0Header = (output: any, context: __SerdeContext): Header => { @@ -4325,13 +4563,15 @@ const deserializeAws_json1_0IPSet = (output: any, context: __SerdeContext): IPSe }; const deserializeAws_json1_0IPSets = (output: any, context: __SerdeContext): { [key: string]: IPSet } => { - return Object.entries(output).reduce( - (acc: { [key: string]: IPSet }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: IPSet }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0IPSet(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -4401,17 +4641,26 @@ const deserializeAws_json1_0LogDestinationConfig = (output: any, context: __Serd }; const deserializeAws_json1_0LogDestinationConfigs = (output: any, context: __SerdeContext): LogDestinationConfig[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0LogDestinationConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0LogDestinationConfig(entry, context); + }); }; const deserializeAws_json1_0LogDestinationMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0LogDestinationPermissionException = ( @@ -4475,7 +4724,14 @@ const deserializeAws_json1_0PortRange = (output: any, context: __SerdeContext): }; const deserializeAws_json1_0PortRanges = (output: any, context: __SerdeContext): PortRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0PortRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0PortRange(entry, context); + }); }; const deserializeAws_json1_0PortSet = (output: any, context: __SerdeContext): PortSet => { @@ -4488,17 +4744,26 @@ const deserializeAws_json1_0PortSet = (output: any, context: __SerdeContext): Po }; const deserializeAws_json1_0PortSets = (output: any, context: __SerdeContext): { [key: string]: PortSet } => { - return Object.entries(output).reduce( - (acc: { [key: string]: PortSet }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: PortSet }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0PortSet(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0ProtocolNumbers = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0PublishMetricAction = (output: any, context: __SerdeContext): PublishMetricAction => { @@ -4587,7 +4852,14 @@ const deserializeAws_json1_0RuleGroupResponse = (output: any, context: __SerdeCo }; const deserializeAws_json1_0RuleGroups = (output: any, context: __SerdeContext): RuleGroupMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0RuleGroupMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0RuleGroupMetadata(entry, context); + }); }; const deserializeAws_json1_0RuleOption = (output: any, context: __SerdeContext): RuleOption => { @@ -4601,7 +4873,14 @@ const deserializeAws_json1_0RuleOption = (output: any, context: __SerdeContext): }; const deserializeAws_json1_0RuleOptions = (output: any, context: __SerdeContext): RuleOption[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0RuleOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0RuleOption(entry, context); + }); }; const deserializeAws_json1_0RulesSource = (output: any, context: __SerdeContext): RulesSource => { @@ -4640,7 +4919,14 @@ const deserializeAws_json1_0RulesSourceList = (output: any, context: __SerdeCont }; const deserializeAws_json1_0RuleTargets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0RuleVariables = (output: any, context: __SerdeContext): RuleVariables => { @@ -4657,7 +4943,14 @@ const deserializeAws_json1_0RuleVariables = (output: any, context: __SerdeContex }; const deserializeAws_json1_0Settings = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0StatefulRule = (output: any, context: __SerdeContext): StatefulRule => { @@ -4687,15 +4980,36 @@ const deserializeAws_json1_0StatefulRuleGroupReferences = ( output: any, context: __SerdeContext ): StatefulRuleGroupReference[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0StatefulRuleGroupReference(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0StatefulRuleGroupReference(entry, context); + }); }; const deserializeAws_json1_0StatefulRules = (output: any, context: __SerdeContext): StatefulRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0StatefulRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0StatefulRule(entry, context); + }); }; const deserializeAws_json1_0StatelessActions = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0StatelessRule = (output: any, context: __SerdeContext): StatelessRule => { @@ -4722,11 +5036,25 @@ const deserializeAws_json1_0StatelessRuleGroupReferences = ( output: any, context: __SerdeContext ): StatelessRuleGroupReference[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0StatelessRuleGroupReference(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0StatelessRuleGroupReference(entry, context); + }); }; const deserializeAws_json1_0StatelessRules = (output: any, context: __SerdeContext): StatelessRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0StatelessRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0StatelessRule(entry, context); + }); }; const deserializeAws_json1_0StatelessRulesAndCustomActions = ( @@ -4752,7 +5080,14 @@ const deserializeAws_json1_0SubnetMapping = (output: any, context: __SerdeContex }; const deserializeAws_json1_0SubnetMappings = (output: any, context: __SerdeContext): SubnetMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0SubnetMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0SubnetMapping(entry, context); + }); }; const deserializeAws_json1_0SyncState = (output: any, context: __SerdeContext): SyncState => { @@ -4772,23 +5107,27 @@ const deserializeAws_json1_0SyncStateConfig = ( output: any, context: __SerdeContext ): { [key: string]: PerObjectStatus } => { - return Object.entries(output).reduce( - (acc: { [key: string]: PerObjectStatus }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: PerObjectStatus }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0PerObjectStatus(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0SyncStates = (output: any, context: __SerdeContext): { [key: string]: SyncState } => { - return Object.entries(output).reduce( - (acc: { [key: string]: SyncState }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: SyncState }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_0SyncState(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_0Tag = (output: any, context: __SerdeContext): Tag => { @@ -4799,7 +5138,14 @@ const deserializeAws_json1_0Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_0TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Tag(entry, context); + }); }; const deserializeAws_json1_0TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -4807,7 +5153,14 @@ const deserializeAws_json1_0TagResourceResponse = (output: any, context: __Serde }; const deserializeAws_json1_0TargetTypes = (output: any, context: __SerdeContext): (TargetType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0TCPFlagField = (output: any, context: __SerdeContext): TCPFlagField => { @@ -4824,7 +5177,14 @@ const deserializeAws_json1_0TCPFlagField = (output: any, context: __SerdeContext }; const deserializeAws_json1_0TCPFlags = (output: any, context: __SerdeContext): TCPFlagField[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0TCPFlagField(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0TCPFlagField(entry, context); + }); }; const deserializeAws_json1_0ThrottlingException = (output: any, context: __SerdeContext): ThrottlingException => { @@ -4942,7 +5302,14 @@ const deserializeAws_json1_0UpdateSubnetChangeProtectionResponse = ( }; const deserializeAws_json1_0VariableDefinitionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4995,3 +5362,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-networkmanager/protocols/Aws_restJson1.ts b/clients/client-networkmanager/protocols/Aws_restJson1.ts index 4f837af69935..027a69f7030a 100644 --- a/clients/client-networkmanager/protocols/Aws_restJson1.ts +++ b/clients/client-networkmanager/protocols/Aws_restJson1.ts @@ -119,7 +119,7 @@ export const serializeAws_restJson1AssociateCustomerGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/customer-gateway-associations"; if (input.GlobalNetworkId !== undefined) { @@ -133,9 +133,10 @@ export const serializeAws_restJson1AssociateCustomerGatewayCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CustomerGatewayArn !== undefined && { CustomerGatewayArn: input.CustomerGatewayArn }), - ...(input.DeviceId !== undefined && { DeviceId: input.DeviceId }), - ...(input.LinkId !== undefined && { LinkId: input.LinkId }), + ...(input.CustomerGatewayArn !== undefined && + input.CustomerGatewayArn !== null && { CustomerGatewayArn: input.CustomerGatewayArn }), + ...(input.DeviceId !== undefined && input.DeviceId !== null && { DeviceId: input.DeviceId }), + ...(input.LinkId !== undefined && input.LinkId !== null && { LinkId: input.LinkId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -154,7 +155,7 @@ export const serializeAws_restJson1AssociateLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/link-associations"; if (input.GlobalNetworkId !== undefined) { @@ -168,8 +169,8 @@ export const serializeAws_restJson1AssociateLinkCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DeviceId !== undefined && { DeviceId: input.DeviceId }), - ...(input.LinkId !== undefined && { LinkId: input.LinkId }), + ...(input.DeviceId !== undefined && input.DeviceId !== null && { DeviceId: input.DeviceId }), + ...(input.LinkId !== undefined && input.LinkId !== null && { LinkId: input.LinkId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -188,7 +189,7 @@ export const serializeAws_restJson1AssociateTransitGatewayConnectPeerCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/transit-gateway-connect-peer-associations"; if (input.GlobalNetworkId !== undefined) { @@ -202,11 +203,12 @@ export const serializeAws_restJson1AssociateTransitGatewayConnectPeerCommand = a } let body: any; body = JSON.stringify({ - ...(input.DeviceId !== undefined && { DeviceId: input.DeviceId }), - ...(input.LinkId !== undefined && { LinkId: input.LinkId }), - ...(input.TransitGatewayConnectPeerArn !== undefined && { - TransitGatewayConnectPeerArn: input.TransitGatewayConnectPeerArn, - }), + ...(input.DeviceId !== undefined && input.DeviceId !== null && { DeviceId: input.DeviceId }), + ...(input.LinkId !== undefined && input.LinkId !== null && { LinkId: input.LinkId }), + ...(input.TransitGatewayConnectPeerArn !== undefined && + input.TransitGatewayConnectPeerArn !== null && { + TransitGatewayConnectPeerArn: input.TransitGatewayConnectPeerArn, + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -225,7 +227,7 @@ export const serializeAws_restJson1CreateConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/connections"; if (input.GlobalNetworkId !== undefined) { @@ -239,12 +241,15 @@ export const serializeAws_restJson1CreateConnectionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConnectedDeviceId !== undefined && { ConnectedDeviceId: input.ConnectedDeviceId }), - ...(input.ConnectedLinkId !== undefined && { ConnectedLinkId: input.ConnectedLinkId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DeviceId !== undefined && { DeviceId: input.DeviceId }), - ...(input.LinkId !== undefined && { LinkId: input.LinkId }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ConnectedDeviceId !== undefined && + input.ConnectedDeviceId !== null && { ConnectedDeviceId: input.ConnectedDeviceId }), + ...(input.ConnectedLinkId !== undefined && + input.ConnectedLinkId !== null && { ConnectedLinkId: input.ConnectedLinkId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DeviceId !== undefined && input.DeviceId !== null && { DeviceId: input.DeviceId }), + ...(input.LinkId !== undefined && input.LinkId !== null && { LinkId: input.LinkId }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -263,7 +268,7 @@ export const serializeAws_restJson1CreateDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/devices"; if (input.GlobalNetworkId !== undefined) { @@ -277,17 +282,18 @@ export const serializeAws_restJson1CreateDeviceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AWSLocation !== undefined && { - AWSLocation: serializeAws_restJson1AWSLocation(input.AWSLocation, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Location !== undefined && { Location: serializeAws_restJson1Location(input.Location, context) }), - ...(input.Model !== undefined && { Model: input.Model }), - ...(input.SerialNumber !== undefined && { SerialNumber: input.SerialNumber }), - ...(input.SiteId !== undefined && { SiteId: input.SiteId }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Vendor !== undefined && { Vendor: input.Vendor }), + ...(input.AWSLocation !== undefined && + input.AWSLocation !== null && { AWSLocation: serializeAws_restJson1AWSLocation(input.AWSLocation, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_restJson1Location(input.Location, context) }), + ...(input.Model !== undefined && input.Model !== null && { Model: input.Model }), + ...(input.SerialNumber !== undefined && input.SerialNumber !== null && { SerialNumber: input.SerialNumber }), + ...(input.SiteId !== undefined && input.SiteId !== null && { SiteId: input.SiteId }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Vendor !== undefined && input.Vendor !== null && { Vendor: input.Vendor }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -306,13 +312,14 @@ export const serializeAws_restJson1CreateGlobalNetworkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -331,7 +338,7 @@ export const serializeAws_restJson1CreateLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/links"; if (input.GlobalNetworkId !== undefined) { @@ -345,12 +352,14 @@ export const serializeAws_restJson1CreateLinkCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Bandwidth !== undefined && { Bandwidth: serializeAws_restJson1Bandwidth(input.Bandwidth, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Provider !== undefined && { Provider: input.Provider }), - ...(input.SiteId !== undefined && { SiteId: input.SiteId }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Bandwidth !== undefined && + input.Bandwidth !== null && { Bandwidth: serializeAws_restJson1Bandwidth(input.Bandwidth, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Provider !== undefined && input.Provider !== null && { Provider: input.Provider }), + ...(input.SiteId !== undefined && input.SiteId !== null && { SiteId: input.SiteId }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -369,7 +378,7 @@ export const serializeAws_restJson1CreateSiteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/sites"; if (input.GlobalNetworkId !== undefined) { @@ -383,9 +392,11 @@ export const serializeAws_restJson1CreateSiteCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Location !== undefined && { Location: serializeAws_restJson1Location(input.Location, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_restJson1Location(input.Location, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -403,9 +414,7 @@ export const serializeAws_restJson1DeleteConnectionCommand = async ( input: DeleteConnectionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/connections/{ConnectionId}"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -442,9 +451,7 @@ export const serializeAws_restJson1DeleteDeviceCommand = async ( input: DeleteDeviceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/devices/{DeviceId}"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -481,9 +488,7 @@ export const serializeAws_restJson1DeleteGlobalNetworkCommand = async ( input: DeleteGlobalNetworkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -511,9 +516,7 @@ export const serializeAws_restJson1DeleteLinkCommand = async ( input: DeleteLinkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/links/{LinkId}"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -550,9 +553,7 @@ export const serializeAws_restJson1DeleteSiteCommand = async ( input: DeleteSiteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/sites/{SiteId}"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -589,9 +590,7 @@ export const serializeAws_restJson1DeregisterTransitGatewayCommand = async ( input: DeregisterTransitGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/transit-gateway-registrations/{TransitGatewayArn}"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -628,9 +627,7 @@ export const serializeAws_restJson1DescribeGlobalNetworksCommand = async ( input: DescribeGlobalNetworksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks"; const query: any = { ...(input.GlobalNetworkIds !== undefined && { @@ -657,9 +654,7 @@ export const serializeAws_restJson1DisassociateCustomerGatewayCommand = async ( input: DisassociateCustomerGatewayCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/customer-gateway-associations/{CustomerGatewayArn}"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -696,9 +691,7 @@ export const serializeAws_restJson1DisassociateLinkCommand = async ( input: DisassociateLinkCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/link-associations"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -731,9 +724,7 @@ export const serializeAws_restJson1DisassociateTransitGatewayConnectPeerCommand input: DisassociateTransitGatewayConnectPeerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/transit-gateway-connect-peer-associations/{TransitGatewayConnectPeerArn}"; if (input.GlobalNetworkId !== undefined) { @@ -771,9 +762,7 @@ export const serializeAws_restJson1GetConnectionsCommand = async ( input: GetConnectionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/connections"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -808,9 +797,7 @@ export const serializeAws_restJson1GetCustomerGatewayAssociationsCommand = async input: GetCustomerGatewayAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/customer-gateway-associations"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -846,9 +833,7 @@ export const serializeAws_restJson1GetDevicesCommand = async ( input: GetDevicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/devices"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -883,9 +868,7 @@ export const serializeAws_restJson1GetLinkAssociationsCommand = async ( input: GetLinkAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/link-associations"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -920,9 +903,7 @@ export const serializeAws_restJson1GetLinksCommand = async ( input: GetLinksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/links"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -959,9 +940,7 @@ export const serializeAws_restJson1GetSitesCommand = async ( input: GetSitesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/sites"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -995,9 +974,7 @@ export const serializeAws_restJson1GetTransitGatewayConnectPeerAssociationsComma input: GetTransitGatewayConnectPeerAssociationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/transit-gateway-connect-peer-associations"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -1033,9 +1010,7 @@ export const serializeAws_restJson1GetTransitGatewayRegistrationsCommand = async input: GetTransitGatewayRegistrationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/global-networks/{GlobalNetworkId}/transit-gateway-registrations"; if (input.GlobalNetworkId !== undefined) { const labelValue: string = input.GlobalNetworkId; @@ -1071,9 +1046,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1102,7 +1075,7 @@ export const serializeAws_restJson1RegisterTransitGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/transit-gateway-registrations"; if (input.GlobalNetworkId !== undefined) { @@ -1116,7 +1089,8 @@ export const serializeAws_restJson1RegisterTransitGatewayCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TransitGatewayArn !== undefined && { TransitGatewayArn: input.TransitGatewayArn }), + ...(input.TransitGatewayArn !== undefined && + input.TransitGatewayArn !== null && { TransitGatewayArn: input.TransitGatewayArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1135,7 +1109,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -1149,7 +1123,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1167,9 +1142,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1202,7 +1175,7 @@ export const serializeAws_restJson1UpdateConnectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/connections/{ConnectionId}"; if (input.GlobalNetworkId !== undefined) { @@ -1225,9 +1198,10 @@ export const serializeAws_restJson1UpdateConnectionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ConnectedLinkId !== undefined && { ConnectedLinkId: input.ConnectedLinkId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LinkId !== undefined && { LinkId: input.LinkId }), + ...(input.ConnectedLinkId !== undefined && + input.ConnectedLinkId !== null && { ConnectedLinkId: input.ConnectedLinkId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LinkId !== undefined && input.LinkId !== null && { LinkId: input.LinkId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1246,7 +1220,7 @@ export const serializeAws_restJson1UpdateDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/devices/{DeviceId}"; if (input.GlobalNetworkId !== undefined) { @@ -1269,16 +1243,16 @@ export const serializeAws_restJson1UpdateDeviceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AWSLocation !== undefined && { - AWSLocation: serializeAws_restJson1AWSLocation(input.AWSLocation, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Location !== undefined && { Location: serializeAws_restJson1Location(input.Location, context) }), - ...(input.Model !== undefined && { Model: input.Model }), - ...(input.SerialNumber !== undefined && { SerialNumber: input.SerialNumber }), - ...(input.SiteId !== undefined && { SiteId: input.SiteId }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Vendor !== undefined && { Vendor: input.Vendor }), + ...(input.AWSLocation !== undefined && + input.AWSLocation !== null && { AWSLocation: serializeAws_restJson1AWSLocation(input.AWSLocation, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_restJson1Location(input.Location, context) }), + ...(input.Model !== undefined && input.Model !== null && { Model: input.Model }), + ...(input.SerialNumber !== undefined && input.SerialNumber !== null && { SerialNumber: input.SerialNumber }), + ...(input.SiteId !== undefined && input.SiteId !== null && { SiteId: input.SiteId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Vendor !== undefined && input.Vendor !== null && { Vendor: input.Vendor }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1297,7 +1271,7 @@ export const serializeAws_restJson1UpdateGlobalNetworkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}"; if (input.GlobalNetworkId !== undefined) { @@ -1311,7 +1285,7 @@ export const serializeAws_restJson1UpdateGlobalNetworkCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1330,7 +1304,7 @@ export const serializeAws_restJson1UpdateLinkCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/links/{LinkId}"; if (input.GlobalNetworkId !== undefined) { @@ -1353,10 +1327,11 @@ export const serializeAws_restJson1UpdateLinkCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Bandwidth !== undefined && { Bandwidth: serializeAws_restJson1Bandwidth(input.Bandwidth, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Provider !== undefined && { Provider: input.Provider }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Bandwidth !== undefined && + input.Bandwidth !== null && { Bandwidth: serializeAws_restJson1Bandwidth(input.Bandwidth, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Provider !== undefined && input.Provider !== null && { Provider: input.Provider }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1375,7 +1350,7 @@ export const serializeAws_restJson1UpdateSiteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/global-networks/{GlobalNetworkId}/sites/{SiteId}"; if (input.GlobalNetworkId !== undefined) { @@ -1398,8 +1373,9 @@ export const serializeAws_restJson1UpdateSiteCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Location !== undefined && { Location: serializeAws_restJson1Location(input.Location, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_restJson1Location(input.Location, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4962,35 +4938,42 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1AWSLocation = (input: AWSLocation, context: __SerdeContext): any => { return { - ...(input.SubnetArn !== undefined && { SubnetArn: input.SubnetArn }), - ...(input.Zone !== undefined && { Zone: input.Zone }), + ...(input.SubnetArn !== undefined && input.SubnetArn !== null && { SubnetArn: input.SubnetArn }), + ...(input.Zone !== undefined && input.Zone !== null && { Zone: input.Zone }), }; }; const serializeAws_restJson1Bandwidth = (input: Bandwidth, context: __SerdeContext): any => { return { - ...(input.DownloadSpeed !== undefined && { DownloadSpeed: input.DownloadSpeed }), - ...(input.UploadSpeed !== undefined && { UploadSpeed: input.UploadSpeed }), + ...(input.DownloadSpeed !== undefined && input.DownloadSpeed !== null && { DownloadSpeed: input.DownloadSpeed }), + ...(input.UploadSpeed !== undefined && input.UploadSpeed !== null && { UploadSpeed: input.UploadSpeed }), }; }; const serializeAws_restJson1Location = (input: Location, context: __SerdeContext): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), - ...(input.Latitude !== undefined && { Latitude: input.Latitude }), - ...(input.Longitude !== undefined && { Longitude: input.Longitude }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), + ...(input.Latitude !== undefined && input.Latitude !== null && { Latitude: input.Latitude }), + ...(input.Longitude !== undefined && input.Longitude !== null && { Longitude: input.Longitude }), }; }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1AWSLocation = (output: any, context: __SerdeContext): AWSLocation => { @@ -5037,7 +5020,14 @@ const deserializeAws_restJson1Connection = (output: any, context: __SerdeContext }; const deserializeAws_restJson1ConnectionList = (output: any, context: __SerdeContext): Connection[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Connection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Connection(entry, context); + }); }; const deserializeAws_restJson1CustomerGatewayAssociation = ( @@ -5061,7 +5051,14 @@ const deserializeAws_restJson1CustomerGatewayAssociationList = ( output: any, context: __SerdeContext ): CustomerGatewayAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CustomerGatewayAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CustomerGatewayAssociation(entry, context); + }); }; const deserializeAws_restJson1Device = (output: any, context: __SerdeContext): Device => { @@ -5097,7 +5094,14 @@ const deserializeAws_restJson1Device = (output: any, context: __SerdeContext): D }; const deserializeAws_restJson1DeviceList = (output: any, context: __SerdeContext): Device[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Device(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Device(entry, context); + }); }; const deserializeAws_restJson1GlobalNetwork = (output: any, context: __SerdeContext): GlobalNetwork => { @@ -5120,7 +5124,14 @@ const deserializeAws_restJson1GlobalNetwork = (output: any, context: __SerdeCont }; const deserializeAws_restJson1GlobalNetworkList = (output: any, context: __SerdeContext): GlobalNetwork[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GlobalNetwork(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GlobalNetwork(entry, context); + }); }; const deserializeAws_restJson1Link = (output: any, context: __SerdeContext): Link => { @@ -5163,11 +5174,25 @@ const deserializeAws_restJson1LinkAssociation = (output: any, context: __SerdeCo }; const deserializeAws_restJson1LinkAssociationList = (output: any, context: __SerdeContext): LinkAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LinkAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LinkAssociation(entry, context); + }); }; const deserializeAws_restJson1LinkList = (output: any, context: __SerdeContext): Link[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Link(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Link(entry, context); + }); }; const deserializeAws_restJson1Location = (output: any, context: __SerdeContext): Location => { @@ -5202,7 +5227,14 @@ const deserializeAws_restJson1Site = (output: any, context: __SerdeContext): Sit }; const deserializeAws_restJson1SiteList = (output: any, context: __SerdeContext): Site[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Site(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Site(entry, context); + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -5213,7 +5245,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TransitGatewayConnectPeerAssociation = ( @@ -5237,9 +5276,14 @@ const deserializeAws_restJson1TransitGatewayConnectPeerAssociationList = ( output: any, context: __SerdeContext ): TransitGatewayConnectPeerAssociation[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1TransitGatewayConnectPeerAssociation(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TransitGatewayConnectPeerAssociation(entry, context); + }); }; const deserializeAws_restJson1TransitGatewayRegistration = ( @@ -5264,7 +5308,14 @@ const deserializeAws_restJson1TransitGatewayRegistrationList = ( output: any, context: __SerdeContext ): TransitGatewayRegistration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TransitGatewayRegistration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TransitGatewayRegistration(entry, context); + }); }; const deserializeAws_restJson1TransitGatewayRegistrationStateReason = ( @@ -5291,7 +5342,14 @@ const deserializeAws_restJson1ValidationExceptionFieldList = ( output: any, context: __SerdeContext ): ValidationExceptionField[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ValidationExceptionField(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ValidationExceptionField(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -5314,6 +5372,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-opsworks/protocols/Aws_json1_1.ts b/clients/client-opsworks/protocols/Aws_json1_1.ts index 86f6f7b409b3..61a352ba6dae 100644 --- a/clients/client-opsworks/protocols/Aws_json1_1.ts +++ b/clients/client-opsworks/protocols/Aws_json1_1.ts @@ -323,7 +323,7 @@ export const serializeAws_json1_1AssignInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.AssignInstance", }; let body: any; @@ -336,7 +336,7 @@ export const serializeAws_json1_1AssignVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.AssignVolume", }; let body: any; @@ -349,7 +349,7 @@ export const serializeAws_json1_1AssociateElasticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.AssociateElasticIp", }; let body: any; @@ -362,7 +362,7 @@ export const serializeAws_json1_1AttachElasticLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.AttachElasticLoadBalancer", }; let body: any; @@ -375,7 +375,7 @@ export const serializeAws_json1_1CloneStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.CloneStack", }; let body: any; @@ -388,7 +388,7 @@ export const serializeAws_json1_1CreateAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.CreateApp", }; let body: any; @@ -401,7 +401,7 @@ export const serializeAws_json1_1CreateDeploymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.CreateDeployment", }; let body: any; @@ -414,7 +414,7 @@ export const serializeAws_json1_1CreateInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.CreateInstance", }; let body: any; @@ -427,7 +427,7 @@ export const serializeAws_json1_1CreateLayerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.CreateLayer", }; let body: any; @@ -440,7 +440,7 @@ export const serializeAws_json1_1CreateStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.CreateStack", }; let body: any; @@ -453,7 +453,7 @@ export const serializeAws_json1_1CreateUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.CreateUserProfile", }; let body: any; @@ -466,7 +466,7 @@ export const serializeAws_json1_1DeleteAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeleteApp", }; let body: any; @@ -479,7 +479,7 @@ export const serializeAws_json1_1DeleteInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeleteInstance", }; let body: any; @@ -492,7 +492,7 @@ export const serializeAws_json1_1DeleteLayerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeleteLayer", }; let body: any; @@ -505,7 +505,7 @@ export const serializeAws_json1_1DeleteStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeleteStack", }; let body: any; @@ -518,7 +518,7 @@ export const serializeAws_json1_1DeleteUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeleteUserProfile", }; let body: any; @@ -531,7 +531,7 @@ export const serializeAws_json1_1DeregisterEcsClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeregisterEcsCluster", }; let body: any; @@ -544,7 +544,7 @@ export const serializeAws_json1_1DeregisterElasticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeregisterElasticIp", }; let body: any; @@ -557,7 +557,7 @@ export const serializeAws_json1_1DeregisterInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeregisterInstance", }; let body: any; @@ -570,7 +570,7 @@ export const serializeAws_json1_1DeregisterRdsDbInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeregisterRdsDbInstance", }; let body: any; @@ -583,7 +583,7 @@ export const serializeAws_json1_1DeregisterVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DeregisterVolume", }; let body: any; @@ -596,7 +596,7 @@ export const serializeAws_json1_1DescribeAgentVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeAgentVersions", }; let body: any; @@ -609,7 +609,7 @@ export const serializeAws_json1_1DescribeAppsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeApps", }; let body: any; @@ -622,7 +622,7 @@ export const serializeAws_json1_1DescribeCommandsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeCommands", }; let body: any; @@ -635,7 +635,7 @@ export const serializeAws_json1_1DescribeDeploymentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeDeployments", }; let body: any; @@ -648,7 +648,7 @@ export const serializeAws_json1_1DescribeEcsClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeEcsClusters", }; let body: any; @@ -661,7 +661,7 @@ export const serializeAws_json1_1DescribeElasticIpsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeElasticIps", }; let body: any; @@ -674,7 +674,7 @@ export const serializeAws_json1_1DescribeElasticLoadBalancersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeElasticLoadBalancers", }; let body: any; @@ -687,7 +687,7 @@ export const serializeAws_json1_1DescribeInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeInstances", }; let body: any; @@ -700,7 +700,7 @@ export const serializeAws_json1_1DescribeLayersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeLayers", }; let body: any; @@ -713,7 +713,7 @@ export const serializeAws_json1_1DescribeLoadBasedAutoScalingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeLoadBasedAutoScaling", }; let body: any; @@ -726,7 +726,7 @@ export const serializeAws_json1_1DescribeMyUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeMyUserProfile", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -737,7 +737,7 @@ export const serializeAws_json1_1DescribeOperatingSystemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeOperatingSystems", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -748,7 +748,7 @@ export const serializeAws_json1_1DescribePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribePermissions", }; let body: any; @@ -761,7 +761,7 @@ export const serializeAws_json1_1DescribeRaidArraysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeRaidArrays", }; let body: any; @@ -774,7 +774,7 @@ export const serializeAws_json1_1DescribeRdsDbInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeRdsDbInstances", }; let body: any; @@ -787,7 +787,7 @@ export const serializeAws_json1_1DescribeServiceErrorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeServiceErrors", }; let body: any; @@ -800,7 +800,7 @@ export const serializeAws_json1_1DescribeStackProvisioningParametersCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeStackProvisioningParameters", }; let body: any; @@ -813,7 +813,7 @@ export const serializeAws_json1_1DescribeStacksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeStacks", }; let body: any; @@ -826,7 +826,7 @@ export const serializeAws_json1_1DescribeStackSummaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeStackSummary", }; let body: any; @@ -839,7 +839,7 @@ export const serializeAws_json1_1DescribeTimeBasedAutoScalingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeTimeBasedAutoScaling", }; let body: any; @@ -852,7 +852,7 @@ export const serializeAws_json1_1DescribeUserProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeUserProfiles", }; let body: any; @@ -865,7 +865,7 @@ export const serializeAws_json1_1DescribeVolumesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DescribeVolumes", }; let body: any; @@ -878,7 +878,7 @@ export const serializeAws_json1_1DetachElasticLoadBalancerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DetachElasticLoadBalancer", }; let body: any; @@ -891,7 +891,7 @@ export const serializeAws_json1_1DisassociateElasticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.DisassociateElasticIp", }; let body: any; @@ -904,7 +904,7 @@ export const serializeAws_json1_1GetHostnameSuggestionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.GetHostnameSuggestion", }; let body: any; @@ -917,7 +917,7 @@ export const serializeAws_json1_1GrantAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.GrantAccess", }; let body: any; @@ -930,7 +930,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.ListTags", }; let body: any; @@ -943,7 +943,7 @@ export const serializeAws_json1_1RebootInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.RebootInstance", }; let body: any; @@ -956,7 +956,7 @@ export const serializeAws_json1_1RegisterEcsClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.RegisterEcsCluster", }; let body: any; @@ -969,7 +969,7 @@ export const serializeAws_json1_1RegisterElasticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.RegisterElasticIp", }; let body: any; @@ -982,7 +982,7 @@ export const serializeAws_json1_1RegisterInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.RegisterInstance", }; let body: any; @@ -995,7 +995,7 @@ export const serializeAws_json1_1RegisterRdsDbInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.RegisterRdsDbInstance", }; let body: any; @@ -1008,7 +1008,7 @@ export const serializeAws_json1_1RegisterVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.RegisterVolume", }; let body: any; @@ -1021,7 +1021,7 @@ export const serializeAws_json1_1SetLoadBasedAutoScalingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.SetLoadBasedAutoScaling", }; let body: any; @@ -1034,7 +1034,7 @@ export const serializeAws_json1_1SetPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.SetPermission", }; let body: any; @@ -1047,7 +1047,7 @@ export const serializeAws_json1_1SetTimeBasedAutoScalingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.SetTimeBasedAutoScaling", }; let body: any; @@ -1060,7 +1060,7 @@ export const serializeAws_json1_1StartInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.StartInstance", }; let body: any; @@ -1073,7 +1073,7 @@ export const serializeAws_json1_1StartStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.StartStack", }; let body: any; @@ -1086,7 +1086,7 @@ export const serializeAws_json1_1StopInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.StopInstance", }; let body: any; @@ -1099,7 +1099,7 @@ export const serializeAws_json1_1StopStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.StopStack", }; let body: any; @@ -1112,7 +1112,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.TagResource", }; let body: any; @@ -1125,7 +1125,7 @@ export const serializeAws_json1_1UnassignInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UnassignInstance", }; let body: any; @@ -1138,7 +1138,7 @@ export const serializeAws_json1_1UnassignVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UnassignVolume", }; let body: any; @@ -1151,7 +1151,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UntagResource", }; let body: any; @@ -1164,7 +1164,7 @@ export const serializeAws_json1_1UpdateAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UpdateApp", }; let body: any; @@ -1177,7 +1177,7 @@ export const serializeAws_json1_1UpdateElasticIpCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UpdateElasticIp", }; let body: any; @@ -1190,7 +1190,7 @@ export const serializeAws_json1_1UpdateInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UpdateInstance", }; let body: any; @@ -1203,7 +1203,7 @@ export const serializeAws_json1_1UpdateLayerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UpdateLayer", }; let body: any; @@ -1216,7 +1216,7 @@ export const serializeAws_json1_1UpdateMyUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UpdateMyUserProfile", }; let body: any; @@ -1229,7 +1229,7 @@ export const serializeAws_json1_1UpdateRdsDbInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UpdateRdsDbInstance", }; let body: any; @@ -1242,7 +1242,7 @@ export const serializeAws_json1_1UpdateStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UpdateStack", }; let body: any; @@ -1255,7 +1255,7 @@ export const serializeAws_json1_1UpdateUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UpdateUserProfile", }; let body: any; @@ -1268,7 +1268,7 @@ export const serializeAws_json1_1UpdateVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorks_20130218.UpdateVolume", }; let body: any; @@ -1300,8 +1300,7 @@ const deserializeAws_json1_1AssignInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -1360,8 +1359,7 @@ const deserializeAws_json1_1AssignVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -1420,8 +1418,7 @@ const deserializeAws_json1_1AssociateElasticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -1480,8 +1477,7 @@ const deserializeAws_json1_1AttachElasticLoadBalancerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -1543,8 +1539,7 @@ const deserializeAws_json1_1CloneStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -1606,8 +1601,7 @@ const deserializeAws_json1_1CreateAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -1669,8 +1663,7 @@ const deserializeAws_json1_1CreateDeploymentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -1732,8 +1725,7 @@ const deserializeAws_json1_1CreateInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -1795,8 +1787,7 @@ const deserializeAws_json1_1CreateLayerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -1858,8 +1849,7 @@ const deserializeAws_json1_1CreateStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ValidationException": case "com.amazonaws.opsworks#ValidationException": @@ -1913,8 +1903,7 @@ const deserializeAws_json1_1CreateUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ValidationException": case "com.amazonaws.opsworks#ValidationException": @@ -1965,8 +1954,7 @@ const deserializeAws_json1_1DeleteAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2025,8 +2013,7 @@ const deserializeAws_json1_1DeleteInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2085,8 +2072,7 @@ const deserializeAws_json1_1DeleteLayerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2145,8 +2131,7 @@ const deserializeAws_json1_1DeleteStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2205,8 +2190,7 @@ const deserializeAws_json1_1DeleteUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2265,8 +2249,7 @@ const deserializeAws_json1_1DeregisterEcsClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2325,8 +2308,7 @@ const deserializeAws_json1_1DeregisterElasticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2385,8 +2367,7 @@ const deserializeAws_json1_1DeregisterInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2445,8 +2426,7 @@ const deserializeAws_json1_1DeregisterRdsDbInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2505,8 +2485,7 @@ const deserializeAws_json1_1DeregisterVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2568,8 +2547,7 @@ const deserializeAws_json1_1DescribeAgentVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2631,8 +2609,7 @@ const deserializeAws_json1_1DescribeAppsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2694,8 +2671,7 @@ const deserializeAws_json1_1DescribeCommandsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2757,8 +2733,7 @@ const deserializeAws_json1_1DescribeDeploymentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2820,8 +2795,7 @@ const deserializeAws_json1_1DescribeEcsClustersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2883,8 +2857,7 @@ const deserializeAws_json1_1DescribeElasticIpsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -2946,8 +2919,7 @@ const deserializeAws_json1_1DescribeElasticLoadBalancersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3009,8 +2981,7 @@ const deserializeAws_json1_1DescribeInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3072,8 +3043,7 @@ const deserializeAws_json1_1DescribeLayersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3135,8 +3105,7 @@ const deserializeAws_json1_1DescribeLoadBasedAutoScalingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3198,8 +3167,7 @@ const deserializeAws_json1_1DescribeMyUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3245,8 +3213,7 @@ const deserializeAws_json1_1DescribeOperatingSystemsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3292,8 +3259,7 @@ const deserializeAws_json1_1DescribePermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3355,8 +3321,7 @@ const deserializeAws_json1_1DescribeRaidArraysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3418,8 +3383,7 @@ const deserializeAws_json1_1DescribeRdsDbInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3481,8 +3445,7 @@ const deserializeAws_json1_1DescribeServiceErrorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3544,8 +3507,7 @@ const deserializeAws_json1_1DescribeStackProvisioningParametersCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3607,8 +3569,7 @@ const deserializeAws_json1_1DescribeStacksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3670,8 +3631,7 @@ const deserializeAws_json1_1DescribeStackSummaryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3733,8 +3693,7 @@ const deserializeAws_json1_1DescribeTimeBasedAutoScalingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3796,8 +3755,7 @@ const deserializeAws_json1_1DescribeUserProfilesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3859,8 +3817,7 @@ const deserializeAws_json1_1DescribeVolumesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3919,8 +3876,7 @@ const deserializeAws_json1_1DetachElasticLoadBalancerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -3971,8 +3927,7 @@ const deserializeAws_json1_1DisassociateElasticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4034,8 +3989,7 @@ const deserializeAws_json1_1GetHostnameSuggestionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4097,8 +4051,7 @@ const deserializeAws_json1_1GrantAccessCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4160,8 +4113,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4220,8 +4172,7 @@ const deserializeAws_json1_1RebootInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4283,8 +4234,7 @@ const deserializeAws_json1_1RegisterEcsClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4346,8 +4296,7 @@ const deserializeAws_json1_1RegisterElasticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4409,8 +4358,7 @@ const deserializeAws_json1_1RegisterInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4469,8 +4417,7 @@ const deserializeAws_json1_1RegisterRdsDbInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4532,8 +4479,7 @@ const deserializeAws_json1_1RegisterVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4592,8 +4538,7 @@ const deserializeAws_json1_1SetLoadBasedAutoScalingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4652,8 +4597,7 @@ const deserializeAws_json1_1SetPermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4712,8 +4656,7 @@ const deserializeAws_json1_1SetTimeBasedAutoScalingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4772,8 +4715,7 @@ const deserializeAws_json1_1StartInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4832,8 +4774,7 @@ const deserializeAws_json1_1StartStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4892,8 +4833,7 @@ const deserializeAws_json1_1StopInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -4952,8 +4892,7 @@ const deserializeAws_json1_1StopStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5012,8 +4951,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5072,8 +5010,7 @@ const deserializeAws_json1_1UnassignInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5132,8 +5069,7 @@ const deserializeAws_json1_1UnassignVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5192,8 +5128,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5252,8 +5187,7 @@ const deserializeAws_json1_1UpdateAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5312,8 +5246,7 @@ const deserializeAws_json1_1UpdateElasticIpCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5372,8 +5305,7 @@ const deserializeAws_json1_1UpdateInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5432,8 +5364,7 @@ const deserializeAws_json1_1UpdateLayerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5492,8 +5423,7 @@ const deserializeAws_json1_1UpdateMyUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ValidationException": case "com.amazonaws.opsworks#ValidationException": @@ -5544,8 +5474,7 @@ const deserializeAws_json1_1UpdateRdsDbInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5604,8 +5533,7 @@ const deserializeAws_json1_1UpdateStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5664,8 +5592,7 @@ const deserializeAws_json1_1UpdateUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5724,8 +5651,7 @@ const deserializeAws_json1_1UpdateVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworks#ResourceNotFoundException": @@ -5792,25 +5718,31 @@ const deserializeAws_json1_1ValidationExceptionResponse = async ( const serializeAws_json1_1AppAttributes = (input: { [key: string]: string }, context: __SerdeContext): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [AppAttributesKeys | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [AppAttributesKeys | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; const serializeAws_json1_1AssignInstanceRequest = (input: AssignInstanceRequest, context: __SerdeContext): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.LayerIds !== undefined && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.LayerIds !== undefined && + input.LayerIds !== null && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), }; }; const serializeAws_json1_1AssignVolumeRequest = (input: AssignVolumeRequest, context: __SerdeContext): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.VolumeId !== undefined && { VolumeId: input.VolumeId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.VolumeId !== undefined && input.VolumeId !== null && { VolumeId: input.VolumeId }), }; }; @@ -5819,8 +5751,8 @@ const serializeAws_json1_1AssociateElasticIpRequest = ( context: __SerdeContext ): any => { return { - ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ElasticIp !== undefined && input.ElasticIp !== null && { ElasticIp: input.ElasticIp }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; @@ -5829,79 +5761,102 @@ const serializeAws_json1_1AttachElasticLoadBalancerRequest = ( context: __SerdeContext ): any => { return { - ...(input.ElasticLoadBalancerName !== undefined && { ElasticLoadBalancerName: input.ElasticLoadBalancerName }), - ...(input.LayerId !== undefined && { LayerId: input.LayerId }), + ...(input.ElasticLoadBalancerName !== undefined && + input.ElasticLoadBalancerName !== null && { ElasticLoadBalancerName: input.ElasticLoadBalancerName }), + ...(input.LayerId !== undefined && input.LayerId !== null && { LayerId: input.LayerId }), }; }; const serializeAws_json1_1AutoScalingThresholds = (input: AutoScalingThresholds, context: __SerdeContext): any => { return { - ...(input.Alarms !== undefined && { Alarms: serializeAws_json1_1Strings(input.Alarms, context) }), - ...(input.CpuThreshold !== undefined && { CpuThreshold: input.CpuThreshold }), - ...(input.IgnoreMetricsTime !== undefined && { IgnoreMetricsTime: input.IgnoreMetricsTime }), - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.LoadThreshold !== undefined && { LoadThreshold: input.LoadThreshold }), - ...(input.MemoryThreshold !== undefined && { MemoryThreshold: input.MemoryThreshold }), - ...(input.ThresholdsWaitTime !== undefined && { ThresholdsWaitTime: input.ThresholdsWaitTime }), + ...(input.Alarms !== undefined && + input.Alarms !== null && { Alarms: serializeAws_json1_1Strings(input.Alarms, context) }), + ...(input.CpuThreshold !== undefined && input.CpuThreshold !== null && { CpuThreshold: input.CpuThreshold }), + ...(input.IgnoreMetricsTime !== undefined && + input.IgnoreMetricsTime !== null && { IgnoreMetricsTime: input.IgnoreMetricsTime }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.LoadThreshold !== undefined && input.LoadThreshold !== null && { LoadThreshold: input.LoadThreshold }), + ...(input.MemoryThreshold !== undefined && + input.MemoryThreshold !== null && { MemoryThreshold: input.MemoryThreshold }), + ...(input.ThresholdsWaitTime !== undefined && + input.ThresholdsWaitTime !== null && { ThresholdsWaitTime: input.ThresholdsWaitTime }), }; }; const serializeAws_json1_1BlockDeviceMapping = (input: BlockDeviceMapping, context: __SerdeContext): any => { return { - ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }), - ...(input.Ebs !== undefined && { Ebs: serializeAws_json1_1EbsBlockDevice(input.Ebs, context) }), - ...(input.NoDevice !== undefined && { NoDevice: input.NoDevice }), - ...(input.VirtualName !== undefined && { VirtualName: input.VirtualName }), + ...(input.DeviceName !== undefined && input.DeviceName !== null && { DeviceName: input.DeviceName }), + ...(input.Ebs !== undefined && + input.Ebs !== null && { Ebs: serializeAws_json1_1EbsBlockDevice(input.Ebs, context) }), + ...(input.NoDevice !== undefined && input.NoDevice !== null && { NoDevice: input.NoDevice }), + ...(input.VirtualName !== undefined && input.VirtualName !== null && { VirtualName: input.VirtualName }), }; }; const serializeAws_json1_1BlockDeviceMappings = (input: BlockDeviceMapping[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1BlockDeviceMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1BlockDeviceMapping(entry, context); + }); }; const serializeAws_json1_1ChefConfiguration = (input: ChefConfiguration, context: __SerdeContext): any => { return { - ...(input.BerkshelfVersion !== undefined && { BerkshelfVersion: input.BerkshelfVersion }), - ...(input.ManageBerkshelf !== undefined && { ManageBerkshelf: input.ManageBerkshelf }), + ...(input.BerkshelfVersion !== undefined && + input.BerkshelfVersion !== null && { BerkshelfVersion: input.BerkshelfVersion }), + ...(input.ManageBerkshelf !== undefined && + input.ManageBerkshelf !== null && { ManageBerkshelf: input.ManageBerkshelf }), }; }; const serializeAws_json1_1CloneStackRequest = (input: CloneStackRequest, context: __SerdeContext): any => { return { - ...(input.AgentVersion !== undefined && { AgentVersion: input.AgentVersion }), - ...(input.Attributes !== undefined && { - Attributes: serializeAws_json1_1StackAttributes(input.Attributes, context), - }), - ...(input.ChefConfiguration !== undefined && { - ChefConfiguration: serializeAws_json1_1ChefConfiguration(input.ChefConfiguration, context), - }), - ...(input.CloneAppIds !== undefined && { CloneAppIds: serializeAws_json1_1Strings(input.CloneAppIds, context) }), - ...(input.ClonePermissions !== undefined && { ClonePermissions: input.ClonePermissions }), - ...(input.ConfigurationManager !== undefined && { - ConfigurationManager: serializeAws_json1_1StackConfigurationManager(input.ConfigurationManager, context), - }), - ...(input.CustomCookbooksSource !== undefined && { - CustomCookbooksSource: serializeAws_json1_1Source(input.CustomCookbooksSource, context), - }), - ...(input.CustomJson !== undefined && { CustomJson: input.CustomJson }), - ...(input.DefaultAvailabilityZone !== undefined && { DefaultAvailabilityZone: input.DefaultAvailabilityZone }), - ...(input.DefaultInstanceProfileArn !== undefined && { - DefaultInstanceProfileArn: input.DefaultInstanceProfileArn, - }), - ...(input.DefaultOs !== undefined && { DefaultOs: input.DefaultOs }), - ...(input.DefaultRootDeviceType !== undefined && { DefaultRootDeviceType: input.DefaultRootDeviceType }), - ...(input.DefaultSshKeyName !== undefined && { DefaultSshKeyName: input.DefaultSshKeyName }), - ...(input.DefaultSubnetId !== undefined && { DefaultSubnetId: input.DefaultSubnetId }), - ...(input.HostnameTheme !== undefined && { HostnameTheme: input.HostnameTheme }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Region !== undefined && { Region: input.Region }), - ...(input.ServiceRoleArn !== undefined && { ServiceRoleArn: input.ServiceRoleArn }), - ...(input.SourceStackId !== undefined && { SourceStackId: input.SourceStackId }), - ...(input.UseCustomCookbooks !== undefined && { UseCustomCookbooks: input.UseCustomCookbooks }), - ...(input.UseOpsworksSecurityGroups !== undefined && { - UseOpsworksSecurityGroups: input.UseOpsworksSecurityGroups, - }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.AgentVersion !== undefined && input.AgentVersion !== null && { AgentVersion: input.AgentVersion }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1StackAttributes(input.Attributes, context) }), + ...(input.ChefConfiguration !== undefined && + input.ChefConfiguration !== null && { + ChefConfiguration: serializeAws_json1_1ChefConfiguration(input.ChefConfiguration, context), + }), + ...(input.CloneAppIds !== undefined && + input.CloneAppIds !== null && { CloneAppIds: serializeAws_json1_1Strings(input.CloneAppIds, context) }), + ...(input.ClonePermissions !== undefined && + input.ClonePermissions !== null && { ClonePermissions: input.ClonePermissions }), + ...(input.ConfigurationManager !== undefined && + input.ConfigurationManager !== null && { + ConfigurationManager: serializeAws_json1_1StackConfigurationManager(input.ConfigurationManager, context), + }), + ...(input.CustomCookbooksSource !== undefined && + input.CustomCookbooksSource !== null && { + CustomCookbooksSource: serializeAws_json1_1Source(input.CustomCookbooksSource, context), + }), + ...(input.CustomJson !== undefined && input.CustomJson !== null && { CustomJson: input.CustomJson }), + ...(input.DefaultAvailabilityZone !== undefined && + input.DefaultAvailabilityZone !== null && { DefaultAvailabilityZone: input.DefaultAvailabilityZone }), + ...(input.DefaultInstanceProfileArn !== undefined && + input.DefaultInstanceProfileArn !== null && { DefaultInstanceProfileArn: input.DefaultInstanceProfileArn }), + ...(input.DefaultOs !== undefined && input.DefaultOs !== null && { DefaultOs: input.DefaultOs }), + ...(input.DefaultRootDeviceType !== undefined && + input.DefaultRootDeviceType !== null && { DefaultRootDeviceType: input.DefaultRootDeviceType }), + ...(input.DefaultSshKeyName !== undefined && + input.DefaultSshKeyName !== null && { DefaultSshKeyName: input.DefaultSshKeyName }), + ...(input.DefaultSubnetId !== undefined && + input.DefaultSubnetId !== null && { DefaultSubnetId: input.DefaultSubnetId }), + ...(input.HostnameTheme !== undefined && input.HostnameTheme !== null && { HostnameTheme: input.HostnameTheme }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), + ...(input.ServiceRoleArn !== undefined && + input.ServiceRoleArn !== null && { ServiceRoleArn: input.ServiceRoleArn }), + ...(input.SourceStackId !== undefined && input.SourceStackId !== null && { SourceStackId: input.SourceStackId }), + ...(input.UseCustomCookbooks !== undefined && + input.UseCustomCookbooks !== null && { UseCustomCookbooks: input.UseCustomCookbooks }), + ...(input.UseOpsworksSecurityGroups !== undefined && + input.UseOpsworksSecurityGroups !== null && { UseOpsworksSecurityGroups: input.UseOpsworksSecurityGroups }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -5910,26 +5865,32 @@ const serializeAws_json1_1CloudWatchLogsConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.LogStreams !== undefined && { - LogStreams: serializeAws_json1_1CloudWatchLogsLogStreams(input.LogStreams, context), - }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.LogStreams !== undefined && + input.LogStreams !== null && { + LogStreams: serializeAws_json1_1CloudWatchLogsLogStreams(input.LogStreams, context), + }), }; }; const serializeAws_json1_1CloudWatchLogsLogStream = (input: CloudWatchLogsLogStream, context: __SerdeContext): any => { return { - ...(input.BatchCount !== undefined && { BatchCount: input.BatchCount }), - ...(input.BatchSize !== undefined && { BatchSize: input.BatchSize }), - ...(input.BufferDuration !== undefined && { BufferDuration: input.BufferDuration }), - ...(input.DatetimeFormat !== undefined && { DatetimeFormat: input.DatetimeFormat }), - ...(input.Encoding !== undefined && { Encoding: input.Encoding }), - ...(input.File !== undefined && { File: input.File }), - ...(input.FileFingerprintLines !== undefined && { FileFingerprintLines: input.FileFingerprintLines }), - ...(input.InitialPosition !== undefined && { InitialPosition: input.InitialPosition }), - ...(input.LogGroupName !== undefined && { LogGroupName: input.LogGroupName }), - ...(input.MultiLineStartPattern !== undefined && { MultiLineStartPattern: input.MultiLineStartPattern }), - ...(input.TimeZone !== undefined && { TimeZone: input.TimeZone }), + ...(input.BatchCount !== undefined && input.BatchCount !== null && { BatchCount: input.BatchCount }), + ...(input.BatchSize !== undefined && input.BatchSize !== null && { BatchSize: input.BatchSize }), + ...(input.BufferDuration !== undefined && + input.BufferDuration !== null && { BufferDuration: input.BufferDuration }), + ...(input.DatetimeFormat !== undefined && + input.DatetimeFormat !== null && { DatetimeFormat: input.DatetimeFormat }), + ...(input.Encoding !== undefined && input.Encoding !== null && { Encoding: input.Encoding }), + ...(input.File !== undefined && input.File !== null && { File: input.File }), + ...(input.FileFingerprintLines !== undefined && + input.FileFingerprintLines !== null && { FileFingerprintLines: input.FileFingerprintLines }), + ...(input.InitialPosition !== undefined && + input.InitialPosition !== null && { InitialPosition: input.InitialPosition }), + ...(input.LogGroupName !== undefined && input.LogGroupName !== null && { LogGroupName: input.LogGroupName }), + ...(input.MultiLineStartPattern !== undefined && + input.MultiLineStartPattern !== null && { MultiLineStartPattern: input.MultiLineStartPattern }), + ...(input.TimeZone !== undefined && input.TimeZone !== null && { TimeZone: input.TimeZone }), }; }; @@ -5937,143 +5898,179 @@ const serializeAws_json1_1CloudWatchLogsLogStreams = ( input: CloudWatchLogsLogStream[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CloudWatchLogsLogStream(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CloudWatchLogsLogStream(entry, context); + }); }; const serializeAws_json1_1CreateAppRequest = (input: CreateAppRequest, context: __SerdeContext): any => { return { - ...(input.AppSource !== undefined && { AppSource: serializeAws_json1_1Source(input.AppSource, context) }), - ...(input.Attributes !== undefined && { Attributes: serializeAws_json1_1AppAttributes(input.Attributes, context) }), - ...(input.DataSources !== undefined && { - DataSources: serializeAws_json1_1DataSources(input.DataSources, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Domains !== undefined && { Domains: serializeAws_json1_1Strings(input.Domains, context) }), - ...(input.EnableSsl !== undefined && { EnableSsl: input.EnableSsl }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1EnvironmentVariables(input.Environment, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Shortname !== undefined && { Shortname: input.Shortname }), - ...(input.SslConfiguration !== undefined && { - SslConfiguration: serializeAws_json1_1SslConfiguration(input.SslConfiguration, context), - }), - ...(input.StackId !== undefined && { StackId: input.StackId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.AppSource !== undefined && + input.AppSource !== null && { AppSource: serializeAws_json1_1Source(input.AppSource, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1AppAttributes(input.Attributes, context) }), + ...(input.DataSources !== undefined && + input.DataSources !== null && { DataSources: serializeAws_json1_1DataSources(input.DataSources, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Domains !== undefined && + input.Domains !== null && { Domains: serializeAws_json1_1Strings(input.Domains, context) }), + ...(input.EnableSsl !== undefined && input.EnableSsl !== null && { EnableSsl: input.EnableSsl }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1EnvironmentVariables(input.Environment, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Shortname !== undefined && input.Shortname !== null && { Shortname: input.Shortname }), + ...(input.SslConfiguration !== undefined && + input.SslConfiguration !== null && { + SslConfiguration: serializeAws_json1_1SslConfiguration(input.SslConfiguration, context), + }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1CreateDeploymentRequest = (input: CreateDeploymentRequest, context: __SerdeContext): any => { return { - ...(input.AppId !== undefined && { AppId: input.AppId }), - ...(input.Command !== undefined && { Command: serializeAws_json1_1DeploymentCommand(input.Command, context) }), - ...(input.Comment !== undefined && { Comment: input.Comment }), - ...(input.CustomJson !== undefined && { CustomJson: input.CustomJson }), - ...(input.InstanceIds !== undefined && { InstanceIds: serializeAws_json1_1Strings(input.InstanceIds, context) }), - ...(input.LayerIds !== undefined && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.AppId !== undefined && input.AppId !== null && { AppId: input.AppId }), + ...(input.Command !== undefined && + input.Command !== null && { Command: serializeAws_json1_1DeploymentCommand(input.Command, context) }), + ...(input.Comment !== undefined && input.Comment !== null && { Comment: input.Comment }), + ...(input.CustomJson !== undefined && input.CustomJson !== null && { CustomJson: input.CustomJson }), + ...(input.InstanceIds !== undefined && + input.InstanceIds !== null && { InstanceIds: serializeAws_json1_1Strings(input.InstanceIds, context) }), + ...(input.LayerIds !== undefined && + input.LayerIds !== null && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; const serializeAws_json1_1CreateInstanceRequest = (input: CreateInstanceRequest, context: __SerdeContext): any => { return { - ...(input.AgentVersion !== undefined && { AgentVersion: input.AgentVersion }), - ...(input.AmiId !== undefined && { AmiId: input.AmiId }), - ...(input.Architecture !== undefined && { Architecture: input.Architecture }), - ...(input.AutoScalingType !== undefined && { AutoScalingType: input.AutoScalingType }), - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.BlockDeviceMappings !== undefined && { - BlockDeviceMappings: serializeAws_json1_1BlockDeviceMappings(input.BlockDeviceMappings, context), - }), - ...(input.EbsOptimized !== undefined && { EbsOptimized: input.EbsOptimized }), - ...(input.Hostname !== undefined && { Hostname: input.Hostname }), - ...(input.InstallUpdatesOnBoot !== undefined && { InstallUpdatesOnBoot: input.InstallUpdatesOnBoot }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.LayerIds !== undefined && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), - ...(input.Os !== undefined && { Os: input.Os }), - ...(input.RootDeviceType !== undefined && { RootDeviceType: input.RootDeviceType }), - ...(input.SshKeyName !== undefined && { SshKeyName: input.SshKeyName }), - ...(input.StackId !== undefined && { StackId: input.StackId }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), - ...(input.Tenancy !== undefined && { Tenancy: input.Tenancy }), - ...(input.VirtualizationType !== undefined && { VirtualizationType: input.VirtualizationType }), + ...(input.AgentVersion !== undefined && input.AgentVersion !== null && { AgentVersion: input.AgentVersion }), + ...(input.AmiId !== undefined && input.AmiId !== null && { AmiId: input.AmiId }), + ...(input.Architecture !== undefined && input.Architecture !== null && { Architecture: input.Architecture }), + ...(input.AutoScalingType !== undefined && + input.AutoScalingType !== null && { AutoScalingType: input.AutoScalingType }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.BlockDeviceMappings !== undefined && + input.BlockDeviceMappings !== null && { + BlockDeviceMappings: serializeAws_json1_1BlockDeviceMappings(input.BlockDeviceMappings, context), + }), + ...(input.EbsOptimized !== undefined && input.EbsOptimized !== null && { EbsOptimized: input.EbsOptimized }), + ...(input.Hostname !== undefined && input.Hostname !== null && { Hostname: input.Hostname }), + ...(input.InstallUpdatesOnBoot !== undefined && + input.InstallUpdatesOnBoot !== null && { InstallUpdatesOnBoot: input.InstallUpdatesOnBoot }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.LayerIds !== undefined && + input.LayerIds !== null && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), + ...(input.Os !== undefined && input.Os !== null && { Os: input.Os }), + ...(input.RootDeviceType !== undefined && + input.RootDeviceType !== null && { RootDeviceType: input.RootDeviceType }), + ...(input.SshKeyName !== undefined && input.SshKeyName !== null && { SshKeyName: input.SshKeyName }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), + ...(input.Tenancy !== undefined && input.Tenancy !== null && { Tenancy: input.Tenancy }), + ...(input.VirtualizationType !== undefined && + input.VirtualizationType !== null && { VirtualizationType: input.VirtualizationType }), }; }; const serializeAws_json1_1CreateLayerRequest = (input: CreateLayerRequest, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_json1_1LayerAttributes(input.Attributes, context), - }), - ...(input.AutoAssignElasticIps !== undefined && { AutoAssignElasticIps: input.AutoAssignElasticIps }), - ...(input.AutoAssignPublicIps !== undefined && { AutoAssignPublicIps: input.AutoAssignPublicIps }), - ...(input.CloudWatchLogsConfiguration !== undefined && { - CloudWatchLogsConfiguration: serializeAws_json1_1CloudWatchLogsConfiguration( - input.CloudWatchLogsConfiguration, - context - ), - }), - ...(input.CustomInstanceProfileArn !== undefined && { CustomInstanceProfileArn: input.CustomInstanceProfileArn }), - ...(input.CustomJson !== undefined && { CustomJson: input.CustomJson }), - ...(input.CustomRecipes !== undefined && { - CustomRecipes: serializeAws_json1_1Recipes(input.CustomRecipes, context), - }), - ...(input.CustomSecurityGroupIds !== undefined && { - CustomSecurityGroupIds: serializeAws_json1_1Strings(input.CustomSecurityGroupIds, context), - }), - ...(input.EnableAutoHealing !== undefined && { EnableAutoHealing: input.EnableAutoHealing }), - ...(input.InstallUpdatesOnBoot !== undefined && { InstallUpdatesOnBoot: input.InstallUpdatesOnBoot }), - ...(input.LifecycleEventConfiguration !== undefined && { - LifecycleEventConfiguration: serializeAws_json1_1LifecycleEventConfiguration( - input.LifecycleEventConfiguration, - context - ), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Packages !== undefined && { Packages: serializeAws_json1_1Strings(input.Packages, context) }), - ...(input.Shortname !== undefined && { Shortname: input.Shortname }), - ...(input.StackId !== undefined && { StackId: input.StackId }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.UseEbsOptimizedInstances !== undefined && { UseEbsOptimizedInstances: input.UseEbsOptimizedInstances }), - ...(input.VolumeConfigurations !== undefined && { - VolumeConfigurations: serializeAws_json1_1VolumeConfigurations(input.VolumeConfigurations, context), - }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1LayerAttributes(input.Attributes, context) }), + ...(input.AutoAssignElasticIps !== undefined && + input.AutoAssignElasticIps !== null && { AutoAssignElasticIps: input.AutoAssignElasticIps }), + ...(input.AutoAssignPublicIps !== undefined && + input.AutoAssignPublicIps !== null && { AutoAssignPublicIps: input.AutoAssignPublicIps }), + ...(input.CloudWatchLogsConfiguration !== undefined && + input.CloudWatchLogsConfiguration !== null && { + CloudWatchLogsConfiguration: serializeAws_json1_1CloudWatchLogsConfiguration( + input.CloudWatchLogsConfiguration, + context + ), + }), + ...(input.CustomInstanceProfileArn !== undefined && + input.CustomInstanceProfileArn !== null && { CustomInstanceProfileArn: input.CustomInstanceProfileArn }), + ...(input.CustomJson !== undefined && input.CustomJson !== null && { CustomJson: input.CustomJson }), + ...(input.CustomRecipes !== undefined && + input.CustomRecipes !== null && { CustomRecipes: serializeAws_json1_1Recipes(input.CustomRecipes, context) }), + ...(input.CustomSecurityGroupIds !== undefined && + input.CustomSecurityGroupIds !== null && { + CustomSecurityGroupIds: serializeAws_json1_1Strings(input.CustomSecurityGroupIds, context), + }), + ...(input.EnableAutoHealing !== undefined && + input.EnableAutoHealing !== null && { EnableAutoHealing: input.EnableAutoHealing }), + ...(input.InstallUpdatesOnBoot !== undefined && + input.InstallUpdatesOnBoot !== null && { InstallUpdatesOnBoot: input.InstallUpdatesOnBoot }), + ...(input.LifecycleEventConfiguration !== undefined && + input.LifecycleEventConfiguration !== null && { + LifecycleEventConfiguration: serializeAws_json1_1LifecycleEventConfiguration( + input.LifecycleEventConfiguration, + context + ), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Packages !== undefined && + input.Packages !== null && { Packages: serializeAws_json1_1Strings(input.Packages, context) }), + ...(input.Shortname !== undefined && input.Shortname !== null && { Shortname: input.Shortname }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.UseEbsOptimizedInstances !== undefined && + input.UseEbsOptimizedInstances !== null && { UseEbsOptimizedInstances: input.UseEbsOptimizedInstances }), + ...(input.VolumeConfigurations !== undefined && + input.VolumeConfigurations !== null && { + VolumeConfigurations: serializeAws_json1_1VolumeConfigurations(input.VolumeConfigurations, context), + }), }; }; const serializeAws_json1_1CreateStackRequest = (input: CreateStackRequest, context: __SerdeContext): any => { return { - ...(input.AgentVersion !== undefined && { AgentVersion: input.AgentVersion }), - ...(input.Attributes !== undefined && { - Attributes: serializeAws_json1_1StackAttributes(input.Attributes, context), - }), - ...(input.ChefConfiguration !== undefined && { - ChefConfiguration: serializeAws_json1_1ChefConfiguration(input.ChefConfiguration, context), - }), - ...(input.ConfigurationManager !== undefined && { - ConfigurationManager: serializeAws_json1_1StackConfigurationManager(input.ConfigurationManager, context), - }), - ...(input.CustomCookbooksSource !== undefined && { - CustomCookbooksSource: serializeAws_json1_1Source(input.CustomCookbooksSource, context), - }), - ...(input.CustomJson !== undefined && { CustomJson: input.CustomJson }), - ...(input.DefaultAvailabilityZone !== undefined && { DefaultAvailabilityZone: input.DefaultAvailabilityZone }), - ...(input.DefaultInstanceProfileArn !== undefined && { - DefaultInstanceProfileArn: input.DefaultInstanceProfileArn, - }), - ...(input.DefaultOs !== undefined && { DefaultOs: input.DefaultOs }), - ...(input.DefaultRootDeviceType !== undefined && { DefaultRootDeviceType: input.DefaultRootDeviceType }), - ...(input.DefaultSshKeyName !== undefined && { DefaultSshKeyName: input.DefaultSshKeyName }), - ...(input.DefaultSubnetId !== undefined && { DefaultSubnetId: input.DefaultSubnetId }), - ...(input.HostnameTheme !== undefined && { HostnameTheme: input.HostnameTheme }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Region !== undefined && { Region: input.Region }), - ...(input.ServiceRoleArn !== undefined && { ServiceRoleArn: input.ServiceRoleArn }), - ...(input.UseCustomCookbooks !== undefined && { UseCustomCookbooks: input.UseCustomCookbooks }), - ...(input.UseOpsworksSecurityGroups !== undefined && { - UseOpsworksSecurityGroups: input.UseOpsworksSecurityGroups, - }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.AgentVersion !== undefined && input.AgentVersion !== null && { AgentVersion: input.AgentVersion }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1StackAttributes(input.Attributes, context) }), + ...(input.ChefConfiguration !== undefined && + input.ChefConfiguration !== null && { + ChefConfiguration: serializeAws_json1_1ChefConfiguration(input.ChefConfiguration, context), + }), + ...(input.ConfigurationManager !== undefined && + input.ConfigurationManager !== null && { + ConfigurationManager: serializeAws_json1_1StackConfigurationManager(input.ConfigurationManager, context), + }), + ...(input.CustomCookbooksSource !== undefined && + input.CustomCookbooksSource !== null && { + CustomCookbooksSource: serializeAws_json1_1Source(input.CustomCookbooksSource, context), + }), + ...(input.CustomJson !== undefined && input.CustomJson !== null && { CustomJson: input.CustomJson }), + ...(input.DefaultAvailabilityZone !== undefined && + input.DefaultAvailabilityZone !== null && { DefaultAvailabilityZone: input.DefaultAvailabilityZone }), + ...(input.DefaultInstanceProfileArn !== undefined && + input.DefaultInstanceProfileArn !== null && { DefaultInstanceProfileArn: input.DefaultInstanceProfileArn }), + ...(input.DefaultOs !== undefined && input.DefaultOs !== null && { DefaultOs: input.DefaultOs }), + ...(input.DefaultRootDeviceType !== undefined && + input.DefaultRootDeviceType !== null && { DefaultRootDeviceType: input.DefaultRootDeviceType }), + ...(input.DefaultSshKeyName !== undefined && + input.DefaultSshKeyName !== null && { DefaultSshKeyName: input.DefaultSshKeyName }), + ...(input.DefaultSubnetId !== undefined && + input.DefaultSubnetId !== null && { DefaultSubnetId: input.DefaultSubnetId }), + ...(input.HostnameTheme !== undefined && input.HostnameTheme !== null && { HostnameTheme: input.HostnameTheme }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), + ...(input.ServiceRoleArn !== undefined && + input.ServiceRoleArn !== null && { ServiceRoleArn: input.ServiceRoleArn }), + ...(input.UseCustomCookbooks !== undefined && + input.UseCustomCookbooks !== null && { UseCustomCookbooks: input.UseCustomCookbooks }), + ...(input.UseOpsworksSecurityGroups !== undefined && + input.UseOpsworksSecurityGroups !== null && { UseOpsworksSecurityGroups: input.UseOpsworksSecurityGroups }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -6082,10 +6079,11 @@ const serializeAws_json1_1CreateUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.AllowSelfManagement !== undefined && { AllowSelfManagement: input.AllowSelfManagement }), - ...(input.IamUserArn !== undefined && { IamUserArn: input.IamUserArn }), - ...(input.SshPublicKey !== undefined && { SshPublicKey: input.SshPublicKey }), - ...(input.SshUsername !== undefined && { SshUsername: input.SshUsername }), + ...(input.AllowSelfManagement !== undefined && + input.AllowSelfManagement !== null && { AllowSelfManagement: input.AllowSelfManagement }), + ...(input.IamUserArn !== undefined && input.IamUserArn !== null && { IamUserArn: input.IamUserArn }), + ...(input.SshPublicKey !== undefined && input.SshPublicKey !== null && { SshPublicKey: input.SshPublicKey }), + ...(input.SshUsername !== undefined && input.SshUsername !== null && { SshUsername: input.SshUsername }), }; }; @@ -6093,50 +6091,60 @@ const serializeAws_json1_1DailyAutoScalingSchedule = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1DataSource = (input: DataSource, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1DataSources = (input: DataSource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DataSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DataSource(entry, context); + }); }; const serializeAws_json1_1DeleteAppRequest = (input: DeleteAppRequest, context: __SerdeContext): any => { return { - ...(input.AppId !== undefined && { AppId: input.AppId }), + ...(input.AppId !== undefined && input.AppId !== null && { AppId: input.AppId }), }; }; const serializeAws_json1_1DeleteInstanceRequest = (input: DeleteInstanceRequest, context: __SerdeContext): any => { return { - ...(input.DeleteElasticIp !== undefined && { DeleteElasticIp: input.DeleteElasticIp }), - ...(input.DeleteVolumes !== undefined && { DeleteVolumes: input.DeleteVolumes }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.DeleteElasticIp !== undefined && + input.DeleteElasticIp !== null && { DeleteElasticIp: input.DeleteElasticIp }), + ...(input.DeleteVolumes !== undefined && input.DeleteVolumes !== null && { DeleteVolumes: input.DeleteVolumes }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; const serializeAws_json1_1DeleteLayerRequest = (input: DeleteLayerRequest, context: __SerdeContext): any => { return { - ...(input.LayerId !== undefined && { LayerId: input.LayerId }), + ...(input.LayerId !== undefined && input.LayerId !== null && { LayerId: input.LayerId }), }; }; const serializeAws_json1_1DeleteStackRequest = (input: DeleteStackRequest, context: __SerdeContext): any => { return { - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6145,14 +6153,15 @@ const serializeAws_json1_1DeleteUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.IamUserArn !== undefined && { IamUserArn: input.IamUserArn }), + ...(input.IamUserArn !== undefined && input.IamUserArn !== null && { IamUserArn: input.IamUserArn }), }; }; const serializeAws_json1_1DeploymentCommand = (input: DeploymentCommand, context: __SerdeContext): any => { return { - ...(input.Args !== undefined && { Args: serializeAws_json1_1DeploymentCommandArgs(input.Args, context) }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Args !== undefined && + input.Args !== null && { Args: serializeAws_json1_1DeploymentCommandArgs(input.Args, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -6160,13 +6169,15 @@ const serializeAws_json1_1DeploymentCommandArgs = ( input: { [key: string]: string[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1Strings(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1DeregisterEcsClusterRequest = ( @@ -6174,7 +6185,7 @@ const serializeAws_json1_1DeregisterEcsClusterRequest = ( context: __SerdeContext ): any => { return { - ...(input.EcsClusterArn !== undefined && { EcsClusterArn: input.EcsClusterArn }), + ...(input.EcsClusterArn !== undefined && input.EcsClusterArn !== null && { EcsClusterArn: input.EcsClusterArn }), }; }; @@ -6183,7 +6194,7 @@ const serializeAws_json1_1DeregisterElasticIpRequest = ( context: __SerdeContext ): any => { return { - ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }), + ...(input.ElasticIp !== undefined && input.ElasticIp !== null && { ElasticIp: input.ElasticIp }), }; }; @@ -6192,7 +6203,7 @@ const serializeAws_json1_1DeregisterInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; @@ -6201,13 +6212,14 @@ const serializeAws_json1_1DeregisterRdsDbInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.RdsDbInstanceArn !== undefined && { RdsDbInstanceArn: input.RdsDbInstanceArn }), + ...(input.RdsDbInstanceArn !== undefined && + input.RdsDbInstanceArn !== null && { RdsDbInstanceArn: input.RdsDbInstanceArn }), }; }; const serializeAws_json1_1DeregisterVolumeRequest = (input: DeregisterVolumeRequest, context: __SerdeContext): any => { return { - ...(input.VolumeId !== undefined && { VolumeId: input.VolumeId }), + ...(input.VolumeId !== undefined && input.VolumeId !== null && { VolumeId: input.VolumeId }), }; }; @@ -6216,25 +6228,28 @@ const serializeAws_json1_1DescribeAgentVersionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConfigurationManager !== undefined && { - ConfigurationManager: serializeAws_json1_1StackConfigurationManager(input.ConfigurationManager, context), - }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.ConfigurationManager !== undefined && + input.ConfigurationManager !== null && { + ConfigurationManager: serializeAws_json1_1StackConfigurationManager(input.ConfigurationManager, context), + }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; const serializeAws_json1_1DescribeAppsRequest = (input: DescribeAppsRequest, context: __SerdeContext): any => { return { - ...(input.AppIds !== undefined && { AppIds: serializeAws_json1_1Strings(input.AppIds, context) }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.AppIds !== undefined && + input.AppIds !== null && { AppIds: serializeAws_json1_1Strings(input.AppIds, context) }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; const serializeAws_json1_1DescribeCommandsRequest = (input: DescribeCommandsRequest, context: __SerdeContext): any => { return { - ...(input.CommandIds !== undefined && { CommandIds: serializeAws_json1_1Strings(input.CommandIds, context) }), - ...(input.DeploymentId !== undefined && { DeploymentId: input.DeploymentId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.CommandIds !== undefined && + input.CommandIds !== null && { CommandIds: serializeAws_json1_1Strings(input.CommandIds, context) }), + ...(input.DeploymentId !== undefined && input.DeploymentId !== null && { DeploymentId: input.DeploymentId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; @@ -6243,11 +6258,10 @@ const serializeAws_json1_1DescribeDeploymentsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AppId !== undefined && { AppId: input.AppId }), - ...(input.DeploymentIds !== undefined && { - DeploymentIds: serializeAws_json1_1Strings(input.DeploymentIds, context), - }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.AppId !== undefined && input.AppId !== null && { AppId: input.AppId }), + ...(input.DeploymentIds !== undefined && + input.DeploymentIds !== null && { DeploymentIds: serializeAws_json1_1Strings(input.DeploymentIds, context) }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6256,12 +6270,11 @@ const serializeAws_json1_1DescribeEcsClustersRequest = ( context: __SerdeContext ): any => { return { - ...(input.EcsClusterArns !== undefined && { - EcsClusterArns: serializeAws_json1_1Strings(input.EcsClusterArns, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.EcsClusterArns !== undefined && + input.EcsClusterArns !== null && { EcsClusterArns: serializeAws_json1_1Strings(input.EcsClusterArns, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6270,9 +6283,9 @@ const serializeAws_json1_1DescribeElasticIpsRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.Ips !== undefined && { Ips: serializeAws_json1_1Strings(input.Ips, context) }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.Ips !== undefined && input.Ips !== null && { Ips: serializeAws_json1_1Strings(input.Ips, context) }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6281,8 +6294,9 @@ const serializeAws_json1_1DescribeElasticLoadBalancersRequest = ( context: __SerdeContext ): any => { return { - ...(input.LayerIds !== undefined && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.LayerIds !== undefined && + input.LayerIds !== null && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6291,16 +6305,18 @@ const serializeAws_json1_1DescribeInstancesRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceIds !== undefined && { InstanceIds: serializeAws_json1_1Strings(input.InstanceIds, context) }), - ...(input.LayerId !== undefined && { LayerId: input.LayerId }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.InstanceIds !== undefined && + input.InstanceIds !== null && { InstanceIds: serializeAws_json1_1Strings(input.InstanceIds, context) }), + ...(input.LayerId !== undefined && input.LayerId !== null && { LayerId: input.LayerId }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; const serializeAws_json1_1DescribeLayersRequest = (input: DescribeLayersRequest, context: __SerdeContext): any => { return { - ...(input.LayerIds !== undefined && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.LayerIds !== undefined && + input.LayerIds !== null && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6309,7 +6325,8 @@ const serializeAws_json1_1DescribeLoadBasedAutoScalingRequest = ( context: __SerdeContext ): any => { return { - ...(input.LayerIds !== undefined && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), + ...(input.LayerIds !== undefined && + input.LayerIds !== null && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), }; }; @@ -6318,8 +6335,8 @@ const serializeAws_json1_1DescribePermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.IamUserArn !== undefined && { IamUserArn: input.IamUserArn }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.IamUserArn !== undefined && input.IamUserArn !== null && { IamUserArn: input.IamUserArn }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6328,9 +6345,10 @@ const serializeAws_json1_1DescribeRaidArraysRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.RaidArrayIds !== undefined && { RaidArrayIds: serializeAws_json1_1Strings(input.RaidArrayIds, context) }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.RaidArrayIds !== undefined && + input.RaidArrayIds !== null && { RaidArrayIds: serializeAws_json1_1Strings(input.RaidArrayIds, context) }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6339,10 +6357,11 @@ const serializeAws_json1_1DescribeRdsDbInstancesRequest = ( context: __SerdeContext ): any => { return { - ...(input.RdsDbInstanceArns !== undefined && { - RdsDbInstanceArns: serializeAws_json1_1Strings(input.RdsDbInstanceArns, context), - }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.RdsDbInstanceArns !== undefined && + input.RdsDbInstanceArns !== null && { + RdsDbInstanceArns: serializeAws_json1_1Strings(input.RdsDbInstanceArns, context), + }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6351,11 +6370,12 @@ const serializeAws_json1_1DescribeServiceErrorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.ServiceErrorIds !== undefined && { - ServiceErrorIds: serializeAws_json1_1Strings(input.ServiceErrorIds, context), - }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.ServiceErrorIds !== undefined && + input.ServiceErrorIds !== null && { + ServiceErrorIds: serializeAws_json1_1Strings(input.ServiceErrorIds, context), + }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6364,13 +6384,14 @@ const serializeAws_json1_1DescribeStackProvisioningParametersRequest = ( context: __SerdeContext ): any => { return { - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; const serializeAws_json1_1DescribeStacksRequest = (input: DescribeStacksRequest, context: __SerdeContext): any => { return { - ...(input.StackIds !== undefined && { StackIds: serializeAws_json1_1Strings(input.StackIds, context) }), + ...(input.StackIds !== undefined && + input.StackIds !== null && { StackIds: serializeAws_json1_1Strings(input.StackIds, context) }), }; }; @@ -6379,7 +6400,7 @@ const serializeAws_json1_1DescribeStackSummaryRequest = ( context: __SerdeContext ): any => { return { - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6388,7 +6409,8 @@ const serializeAws_json1_1DescribeTimeBasedAutoScalingRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceIds !== undefined && { InstanceIds: serializeAws_json1_1Strings(input.InstanceIds, context) }), + ...(input.InstanceIds !== undefined && + input.InstanceIds !== null && { InstanceIds: serializeAws_json1_1Strings(input.InstanceIds, context) }), }; }; @@ -6397,16 +6419,18 @@ const serializeAws_json1_1DescribeUserProfilesRequest = ( context: __SerdeContext ): any => { return { - ...(input.IamUserArns !== undefined && { IamUserArns: serializeAws_json1_1Strings(input.IamUserArns, context) }), + ...(input.IamUserArns !== undefined && + input.IamUserArns !== null && { IamUserArns: serializeAws_json1_1Strings(input.IamUserArns, context) }), }; }; const serializeAws_json1_1DescribeVolumesRequest = (input: DescribeVolumesRequest, context: __SerdeContext): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.RaidArrayId !== undefined && { RaidArrayId: input.RaidArrayId }), - ...(input.StackId !== undefined && { StackId: input.StackId }), - ...(input.VolumeIds !== undefined && { VolumeIds: serializeAws_json1_1Strings(input.VolumeIds, context) }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.RaidArrayId !== undefined && input.RaidArrayId !== null && { RaidArrayId: input.RaidArrayId }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), + ...(input.VolumeIds !== undefined && + input.VolumeIds !== null && { VolumeIds: serializeAws_json1_1Strings(input.VolumeIds, context) }), }; }; @@ -6415,8 +6439,9 @@ const serializeAws_json1_1DetachElasticLoadBalancerRequest = ( context: __SerdeContext ): any => { return { - ...(input.ElasticLoadBalancerName !== undefined && { ElasticLoadBalancerName: input.ElasticLoadBalancerName }), - ...(input.LayerId !== undefined && { LayerId: input.LayerId }), + ...(input.ElasticLoadBalancerName !== undefined && + input.ElasticLoadBalancerName !== null && { ElasticLoadBalancerName: input.ElasticLoadBalancerName }), + ...(input.LayerId !== undefined && input.LayerId !== null && { LayerId: input.LayerId }), }; }; @@ -6425,30 +6450,38 @@ const serializeAws_json1_1DisassociateElasticIpRequest = ( context: __SerdeContext ): any => { return { - ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }), + ...(input.ElasticIp !== undefined && input.ElasticIp !== null && { ElasticIp: input.ElasticIp }), }; }; const serializeAws_json1_1EbsBlockDevice = (input: EbsBlockDevice, context: __SerdeContext): any => { return { - ...(input.DeleteOnTermination !== undefined && { DeleteOnTermination: input.DeleteOnTermination }), - ...(input.Iops !== undefined && { Iops: input.Iops }), - ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }), - ...(input.VolumeSize !== undefined && { VolumeSize: input.VolumeSize }), - ...(input.VolumeType !== undefined && { VolumeType: input.VolumeType }), + ...(input.DeleteOnTermination !== undefined && + input.DeleteOnTermination !== null && { DeleteOnTermination: input.DeleteOnTermination }), + ...(input.Iops !== undefined && input.Iops !== null && { Iops: input.Iops }), + ...(input.SnapshotId !== undefined && input.SnapshotId !== null && { SnapshotId: input.SnapshotId }), + ...(input.VolumeSize !== undefined && input.VolumeSize !== null && { VolumeSize: input.VolumeSize }), + ...(input.VolumeType !== undefined && input.VolumeType !== null && { VolumeType: input.VolumeType }), }; }; const serializeAws_json1_1EnvironmentVariable = (input: EnvironmentVariable, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Secure !== undefined && { Secure: input.Secure }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Secure !== undefined && input.Secure !== null && { Secure: input.Secure }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1EnvironmentVariables = (input: EnvironmentVariable[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EnvironmentVariable(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EnvironmentVariable(entry, context); + }); }; const serializeAws_json1_1GetHostnameSuggestionRequest = ( @@ -6456,30 +6489,36 @@ const serializeAws_json1_1GetHostnameSuggestionRequest = ( context: __SerdeContext ): any => { return { - ...(input.LayerId !== undefined && { LayerId: input.LayerId }), + ...(input.LayerId !== undefined && input.LayerId !== null && { LayerId: input.LayerId }), }; }; const serializeAws_json1_1GrantAccessRequest = (input: GrantAccessRequest, context: __SerdeContext): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.ValidForInMinutes !== undefined && { ValidForInMinutes: input.ValidForInMinutes }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.ValidForInMinutes !== undefined && + input.ValidForInMinutes !== null && { ValidForInMinutes: input.ValidForInMinutes }), }; }; const serializeAws_json1_1InstanceIdentity = (input: InstanceIdentity, context: __SerdeContext): any => { return { - ...(input.Document !== undefined && { Document: input.Document }), - ...(input.Signature !== undefined && { Signature: input.Signature }), + ...(input.Document !== undefined && input.Document !== null && { Document: input.Document }), + ...(input.Signature !== undefined && input.Signature !== null && { Signature: input.Signature }), }; }; const serializeAws_json1_1LayerAttributes = (input: { [key: string]: string }, context: __SerdeContext): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [LayerAttributesKeys | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [LayerAttributesKeys | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -6489,33 +6528,37 @@ const serializeAws_json1_1LifecycleEventConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Shutdown !== undefined && { - Shutdown: serializeAws_json1_1ShutdownEventConfiguration(input.Shutdown, context), - }), + ...(input.Shutdown !== undefined && + input.Shutdown !== null && { Shutdown: serializeAws_json1_1ShutdownEventConfiguration(input.Shutdown, context) }), }; }; const serializeAws_json1_1ListTagsRequest = (input: ListTagsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1RebootInstanceRequest = (input: RebootInstanceRequest, context: __SerdeContext): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; const serializeAws_json1_1Recipes = (input: Recipes, context: __SerdeContext): any => { return { - ...(input.Configure !== undefined && { Configure: serializeAws_json1_1Strings(input.Configure, context) }), - ...(input.Deploy !== undefined && { Deploy: serializeAws_json1_1Strings(input.Deploy, context) }), - ...(input.Setup !== undefined && { Setup: serializeAws_json1_1Strings(input.Setup, context) }), - ...(input.Shutdown !== undefined && { Shutdown: serializeAws_json1_1Strings(input.Shutdown, context) }), - ...(input.Undeploy !== undefined && { Undeploy: serializeAws_json1_1Strings(input.Undeploy, context) }), + ...(input.Configure !== undefined && + input.Configure !== null && { Configure: serializeAws_json1_1Strings(input.Configure, context) }), + ...(input.Deploy !== undefined && + input.Deploy !== null && { Deploy: serializeAws_json1_1Strings(input.Deploy, context) }), + ...(input.Setup !== undefined && + input.Setup !== null && { Setup: serializeAws_json1_1Strings(input.Setup, context) }), + ...(input.Shutdown !== undefined && + input.Shutdown !== null && { Shutdown: serializeAws_json1_1Strings(input.Shutdown, context) }), + ...(input.Undeploy !== undefined && + input.Undeploy !== null && { Undeploy: serializeAws_json1_1Strings(input.Undeploy, context) }), }; }; @@ -6524,8 +6567,8 @@ const serializeAws_json1_1RegisterEcsClusterRequest = ( context: __SerdeContext ): any => { return { - ...(input.EcsClusterArn !== undefined && { EcsClusterArn: input.EcsClusterArn }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.EcsClusterArn !== undefined && input.EcsClusterArn !== null && { EcsClusterArn: input.EcsClusterArn }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6534,22 +6577,24 @@ const serializeAws_json1_1RegisterElasticIpRequest = ( context: __SerdeContext ): any => { return { - ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.ElasticIp !== undefined && input.ElasticIp !== null && { ElasticIp: input.ElasticIp }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; const serializeAws_json1_1RegisterInstanceRequest = (input: RegisterInstanceRequest, context: __SerdeContext): any => { return { - ...(input.Hostname !== undefined && { Hostname: input.Hostname }), - ...(input.InstanceIdentity !== undefined && { - InstanceIdentity: serializeAws_json1_1InstanceIdentity(input.InstanceIdentity, context), - }), - ...(input.PrivateIp !== undefined && { PrivateIp: input.PrivateIp }), - ...(input.PublicIp !== undefined && { PublicIp: input.PublicIp }), - ...(input.RsaPublicKey !== undefined && { RsaPublicKey: input.RsaPublicKey }), - ...(input.RsaPublicKeyFingerprint !== undefined && { RsaPublicKeyFingerprint: input.RsaPublicKeyFingerprint }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.Hostname !== undefined && input.Hostname !== null && { Hostname: input.Hostname }), + ...(input.InstanceIdentity !== undefined && + input.InstanceIdentity !== null && { + InstanceIdentity: serializeAws_json1_1InstanceIdentity(input.InstanceIdentity, context), + }), + ...(input.PrivateIp !== undefined && input.PrivateIp !== null && { PrivateIp: input.PrivateIp }), + ...(input.PublicIp !== undefined && input.PublicIp !== null && { PublicIp: input.PublicIp }), + ...(input.RsaPublicKey !== undefined && input.RsaPublicKey !== null && { RsaPublicKey: input.RsaPublicKey }), + ...(input.RsaPublicKeyFingerprint !== undefined && + input.RsaPublicKeyFingerprint !== null && { RsaPublicKeyFingerprint: input.RsaPublicKeyFingerprint }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6558,17 +6603,18 @@ const serializeAws_json1_1RegisterRdsDbInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.DbPassword !== undefined && { DbPassword: input.DbPassword }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.RdsDbInstanceArn !== undefined && { RdsDbInstanceArn: input.RdsDbInstanceArn }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.DbPassword !== undefined && input.DbPassword !== null && { DbPassword: input.DbPassword }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.RdsDbInstanceArn !== undefined && + input.RdsDbInstanceArn !== null && { RdsDbInstanceArn: input.RdsDbInstanceArn }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; const serializeAws_json1_1RegisterVolumeRequest = (input: RegisterVolumeRequest, context: __SerdeContext): any => { return { - ...(input.Ec2VolumeId !== undefined && { Ec2VolumeId: input.Ec2VolumeId }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.Ec2VolumeId !== undefined && input.Ec2VolumeId !== null && { Ec2VolumeId: input.Ec2VolumeId }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6577,24 +6623,24 @@ const serializeAws_json1_1SetLoadBasedAutoScalingRequest = ( context: __SerdeContext ): any => { return { - ...(input.DownScaling !== undefined && { - DownScaling: serializeAws_json1_1AutoScalingThresholds(input.DownScaling, context), - }), - ...(input.Enable !== undefined && { Enable: input.Enable }), - ...(input.LayerId !== undefined && { LayerId: input.LayerId }), - ...(input.UpScaling !== undefined && { - UpScaling: serializeAws_json1_1AutoScalingThresholds(input.UpScaling, context), - }), + ...(input.DownScaling !== undefined && + input.DownScaling !== null && { + DownScaling: serializeAws_json1_1AutoScalingThresholds(input.DownScaling, context), + }), + ...(input.Enable !== undefined && input.Enable !== null && { Enable: input.Enable }), + ...(input.LayerId !== undefined && input.LayerId !== null && { LayerId: input.LayerId }), + ...(input.UpScaling !== undefined && + input.UpScaling !== null && { UpScaling: serializeAws_json1_1AutoScalingThresholds(input.UpScaling, context) }), }; }; const serializeAws_json1_1SetPermissionRequest = (input: SetPermissionRequest, context: __SerdeContext): any => { return { - ...(input.AllowSsh !== undefined && { AllowSsh: input.AllowSsh }), - ...(input.AllowSudo !== undefined && { AllowSudo: input.AllowSudo }), - ...(input.IamUserArn !== undefined && { IamUserArn: input.IamUserArn }), - ...(input.Level !== undefined && { Level: input.Level }), - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.AllowSsh !== undefined && input.AllowSsh !== null && { AllowSsh: input.AllowSsh }), + ...(input.AllowSudo !== undefined && input.AllowSudo !== null && { AllowSudo: input.AllowSudo }), + ...(input.IamUserArn !== undefined && input.IamUserArn !== null && { IamUserArn: input.IamUserArn }), + ...(input.Level !== undefined && input.Level !== null && { Level: input.Level }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; @@ -6603,10 +6649,11 @@ const serializeAws_json1_1SetTimeBasedAutoScalingRequest = ( context: __SerdeContext ): any => { return { - ...(input.AutoScalingSchedule !== undefined && { - AutoScalingSchedule: serializeAws_json1_1WeeklyAutoScalingSchedule(input.AutoScalingSchedule, context), - }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.AutoScalingSchedule !== undefined && + input.AutoScalingSchedule !== null && { + AutoScalingSchedule: serializeAws_json1_1WeeklyAutoScalingSchedule(input.AutoScalingSchedule, context), + }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; @@ -6615,38 +6662,45 @@ const serializeAws_json1_1ShutdownEventConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DelayUntilElbConnectionsDrained !== undefined && { - DelayUntilElbConnectionsDrained: input.DelayUntilElbConnectionsDrained, - }), - ...(input.ExecutionTimeout !== undefined && { ExecutionTimeout: input.ExecutionTimeout }), + ...(input.DelayUntilElbConnectionsDrained !== undefined && + input.DelayUntilElbConnectionsDrained !== null && { + DelayUntilElbConnectionsDrained: input.DelayUntilElbConnectionsDrained, + }), + ...(input.ExecutionTimeout !== undefined && + input.ExecutionTimeout !== null && { ExecutionTimeout: input.ExecutionTimeout }), }; }; const serializeAws_json1_1Source = (input: Source, context: __SerdeContext): any => { return { - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Revision !== undefined && { Revision: input.Revision }), - ...(input.SshKey !== undefined && { SshKey: input.SshKey }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Url !== undefined && { Url: input.Url }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Revision !== undefined && input.Revision !== null && { Revision: input.Revision }), + ...(input.SshKey !== undefined && input.SshKey !== null && { SshKey: input.SshKey }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_json1_1SslConfiguration = (input: SslConfiguration, context: __SerdeContext): any => { return { - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.Chain !== undefined && { Chain: input.Chain }), - ...(input.PrivateKey !== undefined && { PrivateKey: input.PrivateKey }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.Chain !== undefined && input.Chain !== null && { Chain: input.Chain }), + ...(input.PrivateKey !== undefined && input.PrivateKey !== null && { PrivateKey: input.PrivateKey }), }; }; const serializeAws_json1_1StackAttributes = (input: { [key: string]: string }, context: __SerdeContext): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [StackAttributesKeys | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [StackAttributesKeys | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -6656,163 +6710,196 @@ const serializeAws_json1_1StackConfigurationManager = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_json1_1StartInstanceRequest = (input: StartInstanceRequest, context: __SerdeContext): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; const serializeAws_json1_1StartStackRequest = (input: StartStackRequest, context: __SerdeContext): any => { return { - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; const serializeAws_json1_1StopInstanceRequest = (input: StopInstanceRequest, context: __SerdeContext): any => { return { - ...(input.Force !== undefined && { Force: input.Force }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.Force !== undefined && input.Force !== null && { Force: input.Force }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; const serializeAws_json1_1StopStackRequest = (input: StopStackRequest, context: __SerdeContext): any => { return { - ...(input.StackId !== undefined && { StackId: input.StackId }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), }; }; const serializeAws_json1_1Strings = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1UnassignInstanceRequest = (input: UnassignInstanceRequest, context: __SerdeContext): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; const serializeAws_json1_1UnassignVolumeRequest = (input: UnassignVolumeRequest, context: __SerdeContext): any => { return { - ...(input.VolumeId !== undefined && { VolumeId: input.VolumeId }), + ...(input.VolumeId !== undefined && input.VolumeId !== null && { VolumeId: input.VolumeId }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateAppRequest = (input: UpdateAppRequest, context: __SerdeContext): any => { return { - ...(input.AppId !== undefined && { AppId: input.AppId }), - ...(input.AppSource !== undefined && { AppSource: serializeAws_json1_1Source(input.AppSource, context) }), - ...(input.Attributes !== undefined && { Attributes: serializeAws_json1_1AppAttributes(input.Attributes, context) }), - ...(input.DataSources !== undefined && { - DataSources: serializeAws_json1_1DataSources(input.DataSources, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Domains !== undefined && { Domains: serializeAws_json1_1Strings(input.Domains, context) }), - ...(input.EnableSsl !== undefined && { EnableSsl: input.EnableSsl }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1EnvironmentVariables(input.Environment, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SslConfiguration !== undefined && { - SslConfiguration: serializeAws_json1_1SslConfiguration(input.SslConfiguration, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.AppId !== undefined && input.AppId !== null && { AppId: input.AppId }), + ...(input.AppSource !== undefined && + input.AppSource !== null && { AppSource: serializeAws_json1_1Source(input.AppSource, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1AppAttributes(input.Attributes, context) }), + ...(input.DataSources !== undefined && + input.DataSources !== null && { DataSources: serializeAws_json1_1DataSources(input.DataSources, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Domains !== undefined && + input.Domains !== null && { Domains: serializeAws_json1_1Strings(input.Domains, context) }), + ...(input.EnableSsl !== undefined && input.EnableSsl !== null && { EnableSsl: input.EnableSsl }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1EnvironmentVariables(input.Environment, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SslConfiguration !== undefined && + input.SslConfiguration !== null && { + SslConfiguration: serializeAws_json1_1SslConfiguration(input.SslConfiguration, context), + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1UpdateElasticIpRequest = (input: UpdateElasticIpRequest, context: __SerdeContext): any => { return { - ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ElasticIp !== undefined && input.ElasticIp !== null && { ElasticIp: input.ElasticIp }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1UpdateInstanceRequest = (input: UpdateInstanceRequest, context: __SerdeContext): any => { return { - ...(input.AgentVersion !== undefined && { AgentVersion: input.AgentVersion }), - ...(input.AmiId !== undefined && { AmiId: input.AmiId }), - ...(input.Architecture !== undefined && { Architecture: input.Architecture }), - ...(input.AutoScalingType !== undefined && { AutoScalingType: input.AutoScalingType }), - ...(input.EbsOptimized !== undefined && { EbsOptimized: input.EbsOptimized }), - ...(input.Hostname !== undefined && { Hostname: input.Hostname }), - ...(input.InstallUpdatesOnBoot !== undefined && { InstallUpdatesOnBoot: input.InstallUpdatesOnBoot }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.LayerIds !== undefined && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), - ...(input.Os !== undefined && { Os: input.Os }), - ...(input.SshKeyName !== undefined && { SshKeyName: input.SshKeyName }), + ...(input.AgentVersion !== undefined && input.AgentVersion !== null && { AgentVersion: input.AgentVersion }), + ...(input.AmiId !== undefined && input.AmiId !== null && { AmiId: input.AmiId }), + ...(input.Architecture !== undefined && input.Architecture !== null && { Architecture: input.Architecture }), + ...(input.AutoScalingType !== undefined && + input.AutoScalingType !== null && { AutoScalingType: input.AutoScalingType }), + ...(input.EbsOptimized !== undefined && input.EbsOptimized !== null && { EbsOptimized: input.EbsOptimized }), + ...(input.Hostname !== undefined && input.Hostname !== null && { Hostname: input.Hostname }), + ...(input.InstallUpdatesOnBoot !== undefined && + input.InstallUpdatesOnBoot !== null && { InstallUpdatesOnBoot: input.InstallUpdatesOnBoot }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.LayerIds !== undefined && + input.LayerIds !== null && { LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) }), + ...(input.Os !== undefined && input.Os !== null && { Os: input.Os }), + ...(input.SshKeyName !== undefined && input.SshKeyName !== null && { SshKeyName: input.SshKeyName }), }; }; const serializeAws_json1_1UpdateLayerRequest = (input: UpdateLayerRequest, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_json1_1LayerAttributes(input.Attributes, context), - }), - ...(input.AutoAssignElasticIps !== undefined && { AutoAssignElasticIps: input.AutoAssignElasticIps }), - ...(input.AutoAssignPublicIps !== undefined && { AutoAssignPublicIps: input.AutoAssignPublicIps }), - ...(input.CloudWatchLogsConfiguration !== undefined && { - CloudWatchLogsConfiguration: serializeAws_json1_1CloudWatchLogsConfiguration( - input.CloudWatchLogsConfiguration, - context - ), - }), - ...(input.CustomInstanceProfileArn !== undefined && { CustomInstanceProfileArn: input.CustomInstanceProfileArn }), - ...(input.CustomJson !== undefined && { CustomJson: input.CustomJson }), - ...(input.CustomRecipes !== undefined && { - CustomRecipes: serializeAws_json1_1Recipes(input.CustomRecipes, context), - }), - ...(input.CustomSecurityGroupIds !== undefined && { - CustomSecurityGroupIds: serializeAws_json1_1Strings(input.CustomSecurityGroupIds, context), - }), - ...(input.EnableAutoHealing !== undefined && { EnableAutoHealing: input.EnableAutoHealing }), - ...(input.InstallUpdatesOnBoot !== undefined && { InstallUpdatesOnBoot: input.InstallUpdatesOnBoot }), - ...(input.LayerId !== undefined && { LayerId: input.LayerId }), - ...(input.LifecycleEventConfiguration !== undefined && { - LifecycleEventConfiguration: serializeAws_json1_1LifecycleEventConfiguration( - input.LifecycleEventConfiguration, - context - ), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Packages !== undefined && { Packages: serializeAws_json1_1Strings(input.Packages, context) }), - ...(input.Shortname !== undefined && { Shortname: input.Shortname }), - ...(input.UseEbsOptimizedInstances !== undefined && { UseEbsOptimizedInstances: input.UseEbsOptimizedInstances }), - ...(input.VolumeConfigurations !== undefined && { - VolumeConfigurations: serializeAws_json1_1VolumeConfigurations(input.VolumeConfigurations, context), - }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1LayerAttributes(input.Attributes, context) }), + ...(input.AutoAssignElasticIps !== undefined && + input.AutoAssignElasticIps !== null && { AutoAssignElasticIps: input.AutoAssignElasticIps }), + ...(input.AutoAssignPublicIps !== undefined && + input.AutoAssignPublicIps !== null && { AutoAssignPublicIps: input.AutoAssignPublicIps }), + ...(input.CloudWatchLogsConfiguration !== undefined && + input.CloudWatchLogsConfiguration !== null && { + CloudWatchLogsConfiguration: serializeAws_json1_1CloudWatchLogsConfiguration( + input.CloudWatchLogsConfiguration, + context + ), + }), + ...(input.CustomInstanceProfileArn !== undefined && + input.CustomInstanceProfileArn !== null && { CustomInstanceProfileArn: input.CustomInstanceProfileArn }), + ...(input.CustomJson !== undefined && input.CustomJson !== null && { CustomJson: input.CustomJson }), + ...(input.CustomRecipes !== undefined && + input.CustomRecipes !== null && { CustomRecipes: serializeAws_json1_1Recipes(input.CustomRecipes, context) }), + ...(input.CustomSecurityGroupIds !== undefined && + input.CustomSecurityGroupIds !== null && { + CustomSecurityGroupIds: serializeAws_json1_1Strings(input.CustomSecurityGroupIds, context), + }), + ...(input.EnableAutoHealing !== undefined && + input.EnableAutoHealing !== null && { EnableAutoHealing: input.EnableAutoHealing }), + ...(input.InstallUpdatesOnBoot !== undefined && + input.InstallUpdatesOnBoot !== null && { InstallUpdatesOnBoot: input.InstallUpdatesOnBoot }), + ...(input.LayerId !== undefined && input.LayerId !== null && { LayerId: input.LayerId }), + ...(input.LifecycleEventConfiguration !== undefined && + input.LifecycleEventConfiguration !== null && { + LifecycleEventConfiguration: serializeAws_json1_1LifecycleEventConfiguration( + input.LifecycleEventConfiguration, + context + ), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Packages !== undefined && + input.Packages !== null && { Packages: serializeAws_json1_1Strings(input.Packages, context) }), + ...(input.Shortname !== undefined && input.Shortname !== null && { Shortname: input.Shortname }), + ...(input.UseEbsOptimizedInstances !== undefined && + input.UseEbsOptimizedInstances !== null && { UseEbsOptimizedInstances: input.UseEbsOptimizedInstances }), + ...(input.VolumeConfigurations !== undefined && + input.VolumeConfigurations !== null && { + VolumeConfigurations: serializeAws_json1_1VolumeConfigurations(input.VolumeConfigurations, context), + }), }; }; @@ -6821,7 +6908,7 @@ const serializeAws_json1_1UpdateMyUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.SshPublicKey !== undefined && { SshPublicKey: input.SshPublicKey }), + ...(input.SshPublicKey !== undefined && input.SshPublicKey !== null && { SshPublicKey: input.SshPublicKey }), }; }; @@ -6830,44 +6917,51 @@ const serializeAws_json1_1UpdateRdsDbInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.DbPassword !== undefined && { DbPassword: input.DbPassword }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.RdsDbInstanceArn !== undefined && { RdsDbInstanceArn: input.RdsDbInstanceArn }), + ...(input.DbPassword !== undefined && input.DbPassword !== null && { DbPassword: input.DbPassword }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.RdsDbInstanceArn !== undefined && + input.RdsDbInstanceArn !== null && { RdsDbInstanceArn: input.RdsDbInstanceArn }), }; }; const serializeAws_json1_1UpdateStackRequest = (input: UpdateStackRequest, context: __SerdeContext): any => { return { - ...(input.AgentVersion !== undefined && { AgentVersion: input.AgentVersion }), - ...(input.Attributes !== undefined && { - Attributes: serializeAws_json1_1StackAttributes(input.Attributes, context), - }), - ...(input.ChefConfiguration !== undefined && { - ChefConfiguration: serializeAws_json1_1ChefConfiguration(input.ChefConfiguration, context), - }), - ...(input.ConfigurationManager !== undefined && { - ConfigurationManager: serializeAws_json1_1StackConfigurationManager(input.ConfigurationManager, context), - }), - ...(input.CustomCookbooksSource !== undefined && { - CustomCookbooksSource: serializeAws_json1_1Source(input.CustomCookbooksSource, context), - }), - ...(input.CustomJson !== undefined && { CustomJson: input.CustomJson }), - ...(input.DefaultAvailabilityZone !== undefined && { DefaultAvailabilityZone: input.DefaultAvailabilityZone }), - ...(input.DefaultInstanceProfileArn !== undefined && { - DefaultInstanceProfileArn: input.DefaultInstanceProfileArn, - }), - ...(input.DefaultOs !== undefined && { DefaultOs: input.DefaultOs }), - ...(input.DefaultRootDeviceType !== undefined && { DefaultRootDeviceType: input.DefaultRootDeviceType }), - ...(input.DefaultSshKeyName !== undefined && { DefaultSshKeyName: input.DefaultSshKeyName }), - ...(input.DefaultSubnetId !== undefined && { DefaultSubnetId: input.DefaultSubnetId }), - ...(input.HostnameTheme !== undefined && { HostnameTheme: input.HostnameTheme }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ServiceRoleArn !== undefined && { ServiceRoleArn: input.ServiceRoleArn }), - ...(input.StackId !== undefined && { StackId: input.StackId }), - ...(input.UseCustomCookbooks !== undefined && { UseCustomCookbooks: input.UseCustomCookbooks }), - ...(input.UseOpsworksSecurityGroups !== undefined && { - UseOpsworksSecurityGroups: input.UseOpsworksSecurityGroups, - }), + ...(input.AgentVersion !== undefined && input.AgentVersion !== null && { AgentVersion: input.AgentVersion }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1StackAttributes(input.Attributes, context) }), + ...(input.ChefConfiguration !== undefined && + input.ChefConfiguration !== null && { + ChefConfiguration: serializeAws_json1_1ChefConfiguration(input.ChefConfiguration, context), + }), + ...(input.ConfigurationManager !== undefined && + input.ConfigurationManager !== null && { + ConfigurationManager: serializeAws_json1_1StackConfigurationManager(input.ConfigurationManager, context), + }), + ...(input.CustomCookbooksSource !== undefined && + input.CustomCookbooksSource !== null && { + CustomCookbooksSource: serializeAws_json1_1Source(input.CustomCookbooksSource, context), + }), + ...(input.CustomJson !== undefined && input.CustomJson !== null && { CustomJson: input.CustomJson }), + ...(input.DefaultAvailabilityZone !== undefined && + input.DefaultAvailabilityZone !== null && { DefaultAvailabilityZone: input.DefaultAvailabilityZone }), + ...(input.DefaultInstanceProfileArn !== undefined && + input.DefaultInstanceProfileArn !== null && { DefaultInstanceProfileArn: input.DefaultInstanceProfileArn }), + ...(input.DefaultOs !== undefined && input.DefaultOs !== null && { DefaultOs: input.DefaultOs }), + ...(input.DefaultRootDeviceType !== undefined && + input.DefaultRootDeviceType !== null && { DefaultRootDeviceType: input.DefaultRootDeviceType }), + ...(input.DefaultSshKeyName !== undefined && + input.DefaultSshKeyName !== null && { DefaultSshKeyName: input.DefaultSshKeyName }), + ...(input.DefaultSubnetId !== undefined && + input.DefaultSubnetId !== null && { DefaultSubnetId: input.DefaultSubnetId }), + ...(input.HostnameTheme !== undefined && input.HostnameTheme !== null && { HostnameTheme: input.HostnameTheme }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ServiceRoleArn !== undefined && + input.ServiceRoleArn !== null && { ServiceRoleArn: input.ServiceRoleArn }), + ...(input.StackId !== undefined && input.StackId !== null && { StackId: input.StackId }), + ...(input.UseCustomCookbooks !== undefined && + input.UseCustomCookbooks !== null && { UseCustomCookbooks: input.UseCustomCookbooks }), + ...(input.UseOpsworksSecurityGroups !== undefined && + input.UseOpsworksSecurityGroups !== null && { UseOpsworksSecurityGroups: input.UseOpsworksSecurityGroups }), }; }; @@ -6876,35 +6970,43 @@ const serializeAws_json1_1UpdateUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.AllowSelfManagement !== undefined && { AllowSelfManagement: input.AllowSelfManagement }), - ...(input.IamUserArn !== undefined && { IamUserArn: input.IamUserArn }), - ...(input.SshPublicKey !== undefined && { SshPublicKey: input.SshPublicKey }), - ...(input.SshUsername !== undefined && { SshUsername: input.SshUsername }), + ...(input.AllowSelfManagement !== undefined && + input.AllowSelfManagement !== null && { AllowSelfManagement: input.AllowSelfManagement }), + ...(input.IamUserArn !== undefined && input.IamUserArn !== null && { IamUserArn: input.IamUserArn }), + ...(input.SshPublicKey !== undefined && input.SshPublicKey !== null && { SshPublicKey: input.SshPublicKey }), + ...(input.SshUsername !== undefined && input.SshUsername !== null && { SshUsername: input.SshUsername }), }; }; const serializeAws_json1_1UpdateVolumeRequest = (input: UpdateVolumeRequest, context: __SerdeContext): any => { return { - ...(input.MountPoint !== undefined && { MountPoint: input.MountPoint }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.VolumeId !== undefined && { VolumeId: input.VolumeId }), + ...(input.MountPoint !== undefined && input.MountPoint !== null && { MountPoint: input.MountPoint }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.VolumeId !== undefined && input.VolumeId !== null && { VolumeId: input.VolumeId }), }; }; const serializeAws_json1_1VolumeConfiguration = (input: VolumeConfiguration, context: __SerdeContext): any => { return { - ...(input.Encrypted !== undefined && { Encrypted: input.Encrypted }), - ...(input.Iops !== undefined && { Iops: input.Iops }), - ...(input.MountPoint !== undefined && { MountPoint: input.MountPoint }), - ...(input.NumberOfDisks !== undefined && { NumberOfDisks: input.NumberOfDisks }), - ...(input.RaidLevel !== undefined && { RaidLevel: input.RaidLevel }), - ...(input.Size !== undefined && { Size: input.Size }), - ...(input.VolumeType !== undefined && { VolumeType: input.VolumeType }), + ...(input.Encrypted !== undefined && input.Encrypted !== null && { Encrypted: input.Encrypted }), + ...(input.Iops !== undefined && input.Iops !== null && { Iops: input.Iops }), + ...(input.MountPoint !== undefined && input.MountPoint !== null && { MountPoint: input.MountPoint }), + ...(input.NumberOfDisks !== undefined && input.NumberOfDisks !== null && { NumberOfDisks: input.NumberOfDisks }), + ...(input.RaidLevel !== undefined && input.RaidLevel !== null && { RaidLevel: input.RaidLevel }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), + ...(input.VolumeType !== undefined && input.VolumeType !== null && { VolumeType: input.VolumeType }), }; }; const serializeAws_json1_1VolumeConfigurations = (input: VolumeConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1VolumeConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1VolumeConfiguration(entry, context); + }); }; const serializeAws_json1_1WeeklyAutoScalingSchedule = ( @@ -6912,21 +7014,22 @@ const serializeAws_json1_1WeeklyAutoScalingSchedule = ( context: __SerdeContext ): any => { return { - ...(input.Friday !== undefined && { Friday: serializeAws_json1_1DailyAutoScalingSchedule(input.Friday, context) }), - ...(input.Monday !== undefined && { Monday: serializeAws_json1_1DailyAutoScalingSchedule(input.Monday, context) }), - ...(input.Saturday !== undefined && { - Saturday: serializeAws_json1_1DailyAutoScalingSchedule(input.Saturday, context), - }), - ...(input.Sunday !== undefined && { Sunday: serializeAws_json1_1DailyAutoScalingSchedule(input.Sunday, context) }), - ...(input.Thursday !== undefined && { - Thursday: serializeAws_json1_1DailyAutoScalingSchedule(input.Thursday, context), - }), - ...(input.Tuesday !== undefined && { - Tuesday: serializeAws_json1_1DailyAutoScalingSchedule(input.Tuesday, context), - }), - ...(input.Wednesday !== undefined && { - Wednesday: serializeAws_json1_1DailyAutoScalingSchedule(input.Wednesday, context), - }), + ...(input.Friday !== undefined && + input.Friday !== null && { Friday: serializeAws_json1_1DailyAutoScalingSchedule(input.Friday, context) }), + ...(input.Monday !== undefined && + input.Monday !== null && { Monday: serializeAws_json1_1DailyAutoScalingSchedule(input.Monday, context) }), + ...(input.Saturday !== undefined && + input.Saturday !== null && { Saturday: serializeAws_json1_1DailyAutoScalingSchedule(input.Saturday, context) }), + ...(input.Sunday !== undefined && + input.Sunday !== null && { Sunday: serializeAws_json1_1DailyAutoScalingSchedule(input.Sunday, context) }), + ...(input.Thursday !== undefined && + input.Thursday !== null && { Thursday: serializeAws_json1_1DailyAutoScalingSchedule(input.Thursday, context) }), + ...(input.Tuesday !== undefined && + input.Tuesday !== null && { Tuesday: serializeAws_json1_1DailyAutoScalingSchedule(input.Tuesday, context) }), + ...(input.Wednesday !== undefined && + input.Wednesday !== null && { + Wednesday: serializeAws_json1_1DailyAutoScalingSchedule(input.Wednesday, context), + }), }; }; @@ -6941,7 +7044,14 @@ const deserializeAws_json1_1AgentVersion = (output: any, context: __SerdeContext }; const deserializeAws_json1_1AgentVersions = (output: any, context: __SerdeContext): AgentVersion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AgentVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AgentVersion(entry, context); + }); }; const deserializeAws_json1_1App = (output: any, context: __SerdeContext): App => { @@ -6983,16 +7093,28 @@ const deserializeAws_json1_1App = (output: any, context: __SerdeContext): App => const deserializeAws_json1_1AppAttributes = (output: any, context: __SerdeContext): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [AppAttributesKeys | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [AppAttributesKeys | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; const deserializeAws_json1_1Apps = (output: any, context: __SerdeContext): App[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1App(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1App(entry, context); + }); }; const deserializeAws_json1_1AutoScalingThresholds = (output: any, context: __SerdeContext): AutoScalingThresholds => { @@ -7032,7 +7154,14 @@ const deserializeAws_json1_1BlockDeviceMapping = (output: any, context: __SerdeC }; const deserializeAws_json1_1BlockDeviceMappings = (output: any, context: __SerdeContext): BlockDeviceMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BlockDeviceMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BlockDeviceMapping(entry, context); + }); }; const deserializeAws_json1_1ChefConfiguration = (output: any, context: __SerdeContext): ChefConfiguration => { @@ -7095,7 +7224,14 @@ const deserializeAws_json1_1CloudWatchLogsLogStreams = ( output: any, context: __SerdeContext ): CloudWatchLogsLogStream[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CloudWatchLogsLogStream(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CloudWatchLogsLogStream(entry, context); + }); }; const deserializeAws_json1_1Command = (output: any, context: __SerdeContext): Command => { @@ -7115,7 +7251,14 @@ const deserializeAws_json1_1Command = (output: any, context: __SerdeContext): Co }; const deserializeAws_json1_1Commands = (output: any, context: __SerdeContext): Command[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Command(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Command(entry, context); + }); }; const deserializeAws_json1_1CreateAppResult = (output: any, context: __SerdeContext): CreateAppResult => { @@ -7161,13 +7304,15 @@ const deserializeAws_json1_1DailyAutoScalingSchedule = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1DataSource = (output: any, context: __SerdeContext): DataSource => { @@ -7179,7 +7324,14 @@ const deserializeAws_json1_1DataSource = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1DataSources = (output: any, context: __SerdeContext): DataSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataSource(entry, context); + }); }; const deserializeAws_json1_1Deployment = (output: any, context: __SerdeContext): Deployment => { @@ -7219,17 +7371,26 @@ const deserializeAws_json1_1DeploymentCommandArgs = ( output: any, context: __SerdeContext ): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1Strings(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Deployments = (output: any, context: __SerdeContext): Deployment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Deployment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Deployment(entry, context); + }); }; const deserializeAws_json1_1DescribeAgentVersionsResult = ( @@ -7509,7 +7670,14 @@ const deserializeAws_json1_1EcsCluster = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1EcsClusters = (output: any, context: __SerdeContext): EcsCluster[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EcsCluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EcsCluster(entry, context); + }); }; const deserializeAws_json1_1ElasticIp = (output: any, context: __SerdeContext): ElasticIp => { @@ -7523,7 +7691,14 @@ const deserializeAws_json1_1ElasticIp = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ElasticIps = (output: any, context: __SerdeContext): ElasticIp[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ElasticIp(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ElasticIp(entry, context); + }); }; const deserializeAws_json1_1ElasticLoadBalancer = (output: any, context: __SerdeContext): ElasticLoadBalancer => { @@ -7553,7 +7728,14 @@ const deserializeAws_json1_1ElasticLoadBalancer = (output: any, context: __Serde }; const deserializeAws_json1_1ElasticLoadBalancers = (output: any, context: __SerdeContext): ElasticLoadBalancer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ElasticLoadBalancer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ElasticLoadBalancer(entry, context); + }); }; const deserializeAws_json1_1EnvironmentVariable = (output: any, context: __SerdeContext): EnvironmentVariable => { @@ -7565,7 +7747,14 @@ const deserializeAws_json1_1EnvironmentVariable = (output: any, context: __Serde }; const deserializeAws_json1_1EnvironmentVariables = (output: any, context: __SerdeContext): EnvironmentVariable[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EnvironmentVariable(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EnvironmentVariable(entry, context); + }); }; const deserializeAws_json1_1GetHostnameSuggestionResult = ( @@ -7681,7 +7870,14 @@ const deserializeAws_json1_1Instance = (output: any, context: __SerdeContext): I }; const deserializeAws_json1_1Instances = (output: any, context: __SerdeContext): Instance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Instance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Instance(entry, context); + }); }; const deserializeAws_json1_1InstancesCount = (output: any, context: __SerdeContext): InstancesCount => { @@ -7786,16 +7982,28 @@ const deserializeAws_json1_1Layer = (output: any, context: __SerdeContext): Laye const deserializeAws_json1_1LayerAttributes = (output: any, context: __SerdeContext): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [LayerAttributesKeys | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [LayerAttributesKeys | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; const deserializeAws_json1_1Layers = (output: any, context: __SerdeContext): Layer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Layer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Layer(entry, context); + }); }; const deserializeAws_json1_1LifecycleEventConfiguration = ( @@ -7840,7 +8048,14 @@ const deserializeAws_json1_1LoadBasedAutoScalingConfigurations = ( output: any, context: __SerdeContext ): LoadBasedAutoScalingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LoadBasedAutoScalingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoadBasedAutoScalingConfiguration(entry, context); + }); }; const deserializeAws_json1_1OperatingSystem = (output: any, context: __SerdeContext): OperatingSystem => { @@ -7873,21 +8088,37 @@ const deserializeAws_json1_1OperatingSystemConfigurationManagers = ( output: any, context: __SerdeContext ): OperatingSystemConfigurationManager[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OperatingSystemConfigurationManager(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OperatingSystemConfigurationManager(entry, context); + }); }; const deserializeAws_json1_1OperatingSystems = (output: any, context: __SerdeContext): OperatingSystem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OperatingSystem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OperatingSystem(entry, context); + }); }; const deserializeAws_json1_1Parameters = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Permission = (output: any, context: __SerdeContext): Permission => { @@ -7901,7 +8132,14 @@ const deserializeAws_json1_1Permission = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Permissions = (output: any, context: __SerdeContext): Permission[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Permission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Permission(entry, context); + }); }; const deserializeAws_json1_1RaidArray = (output: any, context: __SerdeContext): RaidArray => { @@ -7925,7 +8163,14 @@ const deserializeAws_json1_1RaidArray = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1RaidArrays = (output: any, context: __SerdeContext): RaidArray[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RaidArray(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RaidArray(entry, context); + }); }; const deserializeAws_json1_1RdsDbInstance = (output: any, context: __SerdeContext): RdsDbInstance => { @@ -7947,7 +8192,14 @@ const deserializeAws_json1_1RdsDbInstance = (output: any, context: __SerdeContex }; const deserializeAws_json1_1RdsDbInstances = (output: any, context: __SerdeContext): RdsDbInstance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RdsDbInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RdsDbInstance(entry, context); + }); }; const deserializeAws_json1_1Recipes = (output: any, context: __SerdeContext): Recipes => { @@ -8045,7 +8297,14 @@ const deserializeAws_json1_1ServiceError = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ServiceErrors = (output: any, context: __SerdeContext): ServiceError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServiceError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServiceError(entry, context); + }); }; const deserializeAws_json1_1ShutdownEventConfiguration = ( @@ -8143,10 +8402,15 @@ const deserializeAws_json1_1Stack = (output: any, context: __SerdeContext): Stac const deserializeAws_json1_1StackAttributes = (output: any, context: __SerdeContext): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [StackAttributesKeys | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [StackAttributesKeys | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -8162,7 +8426,14 @@ const deserializeAws_json1_1StackConfigurationManager = ( }; const deserializeAws_json1_1Stacks = (output: any, context: __SerdeContext): Stack[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Stack(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Stack(entry, context); + }); }; const deserializeAws_json1_1StackSummary = (output: any, context: __SerdeContext): StackSummary => { @@ -8180,17 +8451,26 @@ const deserializeAws_json1_1StackSummary = (output: any, context: __SerdeContext }; const deserializeAws_json1_1Strings = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1TemporaryCredential = (output: any, context: __SerdeContext): TemporaryCredential => { @@ -8222,7 +8502,14 @@ const deserializeAws_json1_1TimeBasedAutoScalingConfigurations = ( output: any, context: __SerdeContext ): TimeBasedAutoScalingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TimeBasedAutoScalingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TimeBasedAutoScalingConfiguration(entry, context); + }); }; const deserializeAws_json1_1UserProfile = (output: any, context: __SerdeContext): UserProfile => { @@ -8239,7 +8526,14 @@ const deserializeAws_json1_1UserProfile = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1UserProfiles = (output: any, context: __SerdeContext): UserProfile[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserProfile(entry, context); + }); }; const deserializeAws_json1_1ValidationException = (output: any, context: __SerdeContext): ValidationException => { @@ -8282,11 +8576,25 @@ const deserializeAws_json1_1VolumeConfiguration = (output: any, context: __Serde }; const deserializeAws_json1_1VolumeConfigurations = (output: any, context: __SerdeContext): VolumeConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VolumeConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VolumeConfiguration(entry, context); + }); }; const deserializeAws_json1_1Volumes = (output: any, context: __SerdeContext): Volume[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Volume(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Volume(entry, context); + }); }; const deserializeAws_json1_1WeeklyAutoScalingSchedule = ( @@ -8375,3 +8683,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-opsworkscm/protocols/Aws_json1_1.ts b/clients/client-opsworkscm/protocols/Aws_json1_1.ts index f2b8f9681ac3..1315dc1f57c5 100644 --- a/clients/client-opsworkscm/protocols/Aws_json1_1.ts +++ b/clients/client-opsworkscm/protocols/Aws_json1_1.ts @@ -99,7 +99,7 @@ export const serializeAws_json1_1AssociateNodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.AssociateNode", }; let body: any; @@ -112,7 +112,7 @@ export const serializeAws_json1_1CreateBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.CreateBackup", }; let body: any; @@ -125,7 +125,7 @@ export const serializeAws_json1_1CreateServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.CreateServer", }; let body: any; @@ -138,7 +138,7 @@ export const serializeAws_json1_1DeleteBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.DeleteBackup", }; let body: any; @@ -151,7 +151,7 @@ export const serializeAws_json1_1DeleteServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.DeleteServer", }; let body: any; @@ -164,7 +164,7 @@ export const serializeAws_json1_1DescribeAccountAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.DescribeAccountAttributes", }; let body: any; @@ -177,7 +177,7 @@ export const serializeAws_json1_1DescribeBackupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.DescribeBackups", }; let body: any; @@ -190,7 +190,7 @@ export const serializeAws_json1_1DescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.DescribeEvents", }; let body: any; @@ -203,7 +203,7 @@ export const serializeAws_json1_1DescribeNodeAssociationStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.DescribeNodeAssociationStatus", }; let body: any; @@ -216,7 +216,7 @@ export const serializeAws_json1_1DescribeServersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.DescribeServers", }; let body: any; @@ -229,7 +229,7 @@ export const serializeAws_json1_1DisassociateNodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.DisassociateNode", }; let body: any; @@ -242,7 +242,7 @@ export const serializeAws_json1_1ExportServerEngineAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.ExportServerEngineAttribute", }; let body: any; @@ -255,7 +255,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.ListTagsForResource", }; let body: any; @@ -268,7 +268,7 @@ export const serializeAws_json1_1RestoreServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.RestoreServer", }; let body: any; @@ -281,7 +281,7 @@ export const serializeAws_json1_1StartMaintenanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.StartMaintenance", }; let body: any; @@ -294,7 +294,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.TagResource", }; let body: any; @@ -307,7 +307,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.UntagResource", }; let body: any; @@ -320,7 +320,7 @@ export const serializeAws_json1_1UpdateServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.UpdateServer", }; let body: any; @@ -333,7 +333,7 @@ export const serializeAws_json1_1UpdateServerEngineAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "OpsWorksCM_V2016_11_01.UpdateServerEngineAttributes", }; let body: any; @@ -368,8 +368,7 @@ const deserializeAws_json1_1AssociateNodeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -439,8 +438,7 @@ const deserializeAws_json1_1CreateBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -518,8 +516,7 @@ const deserializeAws_json1_1CreateServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededException": case "com.amazonaws.opsworkscm#LimitExceededException": @@ -597,8 +594,7 @@ const deserializeAws_json1_1DeleteBackupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -668,8 +664,7 @@ const deserializeAws_json1_1DeleteServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -739,8 +734,7 @@ const deserializeAws_json1_1DescribeAccountAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -786,8 +780,7 @@ const deserializeAws_json1_1DescribeBackupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.opsworkscm#InvalidNextTokenException": @@ -857,8 +850,7 @@ const deserializeAws_json1_1DescribeEventsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.opsworkscm#InvalidNextTokenException": @@ -928,8 +920,7 @@ const deserializeAws_json1_1DescribeNodeAssociationStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworkscm#ResourceNotFoundException": @@ -991,8 +982,7 @@ const deserializeAws_json1_1DescribeServersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.opsworkscm#InvalidNextTokenException": @@ -1062,8 +1052,7 @@ const deserializeAws_json1_1DisassociateNodeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -1133,8 +1122,7 @@ const deserializeAws_json1_1ExportServerEngineAttributeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -1204,8 +1192,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.opsworkscm#ResourceNotFoundException": @@ -1267,8 +1254,7 @@ const deserializeAws_json1_1RestoreServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -1338,8 +1324,7 @@ const deserializeAws_json1_1StartMaintenanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -1409,8 +1394,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -1480,8 +1464,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -1551,8 +1534,7 @@ const deserializeAws_json1_1UpdateServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -1622,8 +1604,7 @@ const deserializeAws_json1_1UpdateServerEngineAttributesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.opsworkscm#InvalidStateException": @@ -1758,63 +1739,74 @@ const deserializeAws_json1_1ValidationExceptionResponse = async ( const serializeAws_json1_1AssociateNodeRequest = (input: AssociateNodeRequest, context: __SerdeContext): any => { return { - ...(input.EngineAttributes !== undefined && { - EngineAttributes: serializeAws_json1_1EngineAttributes(input.EngineAttributes, context), - }), - ...(input.NodeName !== undefined && { NodeName: input.NodeName }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.EngineAttributes !== undefined && + input.EngineAttributes !== null && { + EngineAttributes: serializeAws_json1_1EngineAttributes(input.EngineAttributes, context), + }), + ...(input.NodeName !== undefined && input.NodeName !== null && { NodeName: input.NodeName }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; const serializeAws_json1_1CreateBackupRequest = (input: CreateBackupRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateServerRequest = (input: CreateServerRequest, context: __SerdeContext): any => { return { - ...(input.AssociatePublicIpAddress !== undefined && { AssociatePublicIpAddress: input.AssociatePublicIpAddress }), - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), - ...(input.BackupRetentionCount !== undefined && { BackupRetentionCount: input.BackupRetentionCount }), - ...(input.CustomCertificate !== undefined && { CustomCertificate: input.CustomCertificate }), - ...(input.CustomDomain !== undefined && { CustomDomain: input.CustomDomain }), - ...(input.CustomPrivateKey !== undefined && { CustomPrivateKey: input.CustomPrivateKey }), - ...(input.DisableAutomatedBackup !== undefined && { DisableAutomatedBackup: input.DisableAutomatedBackup }), - ...(input.Engine !== undefined && { Engine: input.Engine }), - ...(input.EngineAttributes !== undefined && { - EngineAttributes: serializeAws_json1_1EngineAttributes(input.EngineAttributes, context), - }), - ...(input.EngineModel !== undefined && { EngineModel: input.EngineModel }), - ...(input.EngineVersion !== undefined && { EngineVersion: input.EngineVersion }), - ...(input.InstanceProfileArn !== undefined && { InstanceProfileArn: input.InstanceProfileArn }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.KeyPair !== undefined && { KeyPair: input.KeyPair }), - ...(input.PreferredBackupWindow !== undefined && { PreferredBackupWindow: input.PreferredBackupWindow }), - ...(input.PreferredMaintenanceWindow !== undefined && { - PreferredMaintenanceWindow: input.PreferredMaintenanceWindow, - }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1Strings(input.SecurityGroupIds, context), - }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), - ...(input.ServiceRoleArn !== undefined && { ServiceRoleArn: input.ServiceRoleArn }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1Strings(input.SubnetIds, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.AssociatePublicIpAddress !== undefined && + input.AssociatePublicIpAddress !== null && { AssociatePublicIpAddress: input.AssociatePublicIpAddress }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), + ...(input.BackupRetentionCount !== undefined && + input.BackupRetentionCount !== null && { BackupRetentionCount: input.BackupRetentionCount }), + ...(input.CustomCertificate !== undefined && + input.CustomCertificate !== null && { CustomCertificate: input.CustomCertificate }), + ...(input.CustomDomain !== undefined && input.CustomDomain !== null && { CustomDomain: input.CustomDomain }), + ...(input.CustomPrivateKey !== undefined && + input.CustomPrivateKey !== null && { CustomPrivateKey: input.CustomPrivateKey }), + ...(input.DisableAutomatedBackup !== undefined && + input.DisableAutomatedBackup !== null && { DisableAutomatedBackup: input.DisableAutomatedBackup }), + ...(input.Engine !== undefined && input.Engine !== null && { Engine: input.Engine }), + ...(input.EngineAttributes !== undefined && + input.EngineAttributes !== null && { + EngineAttributes: serializeAws_json1_1EngineAttributes(input.EngineAttributes, context), + }), + ...(input.EngineModel !== undefined && input.EngineModel !== null && { EngineModel: input.EngineModel }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { EngineVersion: input.EngineVersion }), + ...(input.InstanceProfileArn !== undefined && + input.InstanceProfileArn !== null && { InstanceProfileArn: input.InstanceProfileArn }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.KeyPair !== undefined && input.KeyPair !== null && { KeyPair: input.KeyPair }), + ...(input.PreferredBackupWindow !== undefined && + input.PreferredBackupWindow !== null && { PreferredBackupWindow: input.PreferredBackupWindow }), + ...(input.PreferredMaintenanceWindow !== undefined && + input.PreferredMaintenanceWindow !== null && { PreferredMaintenanceWindow: input.PreferredMaintenanceWindow }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1Strings(input.SecurityGroupIds, context), + }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), + ...(input.ServiceRoleArn !== undefined && + input.ServiceRoleArn !== null && { ServiceRoleArn: input.ServiceRoleArn }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1Strings(input.SubnetIds, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1DeleteBackupRequest = (input: DeleteBackupRequest, context: __SerdeContext): any => { return { - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), }; }; const serializeAws_json1_1DeleteServerRequest = (input: DeleteServerRequest, context: __SerdeContext): any => { return { - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; @@ -1827,18 +1819,18 @@ const serializeAws_json1_1DescribeAccountAttributesRequest = ( const serializeAws_json1_1DescribeBackupsRequest = (input: DescribeBackupsRequest, context: __SerdeContext): any => { return { - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; const serializeAws_json1_1DescribeEventsRequest = (input: DescribeEventsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; @@ -1847,40 +1839,47 @@ const serializeAws_json1_1DescribeNodeAssociationStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.NodeAssociationStatusToken !== undefined && { - NodeAssociationStatusToken: input.NodeAssociationStatusToken, - }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.NodeAssociationStatusToken !== undefined && + input.NodeAssociationStatusToken !== null && { NodeAssociationStatusToken: input.NodeAssociationStatusToken }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; const serializeAws_json1_1DescribeServersRequest = (input: DescribeServersRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; const serializeAws_json1_1DisassociateNodeRequest = (input: DisassociateNodeRequest, context: __SerdeContext): any => { return { - ...(input.EngineAttributes !== undefined && { - EngineAttributes: serializeAws_json1_1EngineAttributes(input.EngineAttributes, context), - }), - ...(input.NodeName !== undefined && { NodeName: input.NodeName }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.EngineAttributes !== undefined && + input.EngineAttributes !== null && { + EngineAttributes: serializeAws_json1_1EngineAttributes(input.EngineAttributes, context), + }), + ...(input.NodeName !== undefined && input.NodeName !== null && { NodeName: input.NodeName }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; const serializeAws_json1_1EngineAttribute = (input: EngineAttribute, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1EngineAttributes = (input: EngineAttribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EngineAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EngineAttribute(entry, context); + }); }; const serializeAws_json1_1ExportServerEngineAttributeRequest = ( @@ -1888,11 +1887,13 @@ const serializeAws_json1_1ExportServerEngineAttributeRequest = ( context: __SerdeContext ): any => { return { - ...(input.ExportAttributeName !== undefined && { ExportAttributeName: input.ExportAttributeName }), - ...(input.InputAttributes !== undefined && { - InputAttributes: serializeAws_json1_1EngineAttributes(input.InputAttributes, context), - }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.ExportAttributeName !== undefined && + input.ExportAttributeName !== null && { ExportAttributeName: input.ExportAttributeName }), + ...(input.InputAttributes !== undefined && + input.InputAttributes !== null && { + InputAttributes: serializeAws_json1_1EngineAttributes(input.InputAttributes, context), + }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; @@ -1901,60 +1902,83 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1RestoreServerRequest = (input: RestoreServerRequest, context: __SerdeContext): any => { return { - ...(input.BackupId !== undefined && { BackupId: input.BackupId }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.KeyPair !== undefined && { KeyPair: input.KeyPair }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.BackupId !== undefined && input.BackupId !== null && { BackupId: input.BackupId }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.KeyPair !== undefined && input.KeyPair !== null && { KeyPair: input.KeyPair }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; const serializeAws_json1_1StartMaintenanceRequest = (input: StartMaintenanceRequest, context: __SerdeContext): any => { return { - ...(input.EngineAttributes !== undefined && { - EngineAttributes: serializeAws_json1_1EngineAttributes(input.EngineAttributes, context), - }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.EngineAttributes !== undefined && + input.EngineAttributes !== null && { + EngineAttributes: serializeAws_json1_1EngineAttributes(input.EngineAttributes, context), + }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; const serializeAws_json1_1Strings = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -1963,21 +1987,24 @@ const serializeAws_json1_1UpdateServerEngineAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.AttributeValue !== undefined && { AttributeValue: input.AttributeValue }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.AttributeValue !== undefined && + input.AttributeValue !== null && { AttributeValue: input.AttributeValue }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; const serializeAws_json1_1UpdateServerRequest = (input: UpdateServerRequest, context: __SerdeContext): any => { return { - ...(input.BackupRetentionCount !== undefined && { BackupRetentionCount: input.BackupRetentionCount }), - ...(input.DisableAutomatedBackup !== undefined && { DisableAutomatedBackup: input.DisableAutomatedBackup }), - ...(input.PreferredBackupWindow !== undefined && { PreferredBackupWindow: input.PreferredBackupWindow }), - ...(input.PreferredMaintenanceWindow !== undefined && { - PreferredMaintenanceWindow: input.PreferredMaintenanceWindow, - }), - ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.BackupRetentionCount !== undefined && + input.BackupRetentionCount !== null && { BackupRetentionCount: input.BackupRetentionCount }), + ...(input.DisableAutomatedBackup !== undefined && + input.DisableAutomatedBackup !== null && { DisableAutomatedBackup: input.DisableAutomatedBackup }), + ...(input.PreferredBackupWindow !== undefined && + input.PreferredBackupWindow !== null && { PreferredBackupWindow: input.PreferredBackupWindow }), + ...(input.PreferredMaintenanceWindow !== undefined && + input.PreferredMaintenanceWindow !== null && { PreferredMaintenanceWindow: input.PreferredMaintenanceWindow }), + ...(input.ServerName !== undefined && input.ServerName !== null && { ServerName: input.ServerName }), }; }; @@ -1990,7 +2017,14 @@ const deserializeAws_json1_1AccountAttribute = (output: any, context: __SerdeCon }; const deserializeAws_json1_1AccountAttributes = (output: any, context: __SerdeContext): AccountAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AccountAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccountAttribute(entry, context); + }); }; const deserializeAws_json1_1AssociateNodeResponse = (output: any, context: __SerdeContext): AssociateNodeResponse => { @@ -2055,7 +2089,14 @@ const deserializeAws_json1_1Backup = (output: any, context: __SerdeContext): Bac }; const deserializeAws_json1_1Backups = (output: any, context: __SerdeContext): Backup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Backup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Backup(entry, context); + }); }; const deserializeAws_json1_1CreateBackupResponse = (output: any, context: __SerdeContext): CreateBackupResponse => { @@ -2168,7 +2209,14 @@ const deserializeAws_json1_1EngineAttribute = (output: any, context: __SerdeCont }; const deserializeAws_json1_1EngineAttributes = (output: any, context: __SerdeContext): EngineAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EngineAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EngineAttribute(entry, context); + }); }; const deserializeAws_json1_1ExportServerEngineAttributeResponse = ( @@ -2320,11 +2368,25 @@ const deserializeAws_json1_1ServerEvent = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ServerEvents = (output: any, context: __SerdeContext): ServerEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServerEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServerEvent(entry, context); + }); }; const deserializeAws_json1_1Servers = (output: any, context: __SerdeContext): Server[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Server(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Server(entry, context); + }); }; const deserializeAws_json1_1StartMaintenanceResponse = ( @@ -2340,7 +2402,14 @@ const deserializeAws_json1_1StartMaintenanceResponse = ( }; const deserializeAws_json1_1Strings = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -2351,7 +2420,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -2439,3 +2515,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-organizations/protocols/Aws_json1_1.ts b/clients/client-organizations/protocols/Aws_json1_1.ts index bd3f29af6fca..0836929aaf85 100644 --- a/clients/client-organizations/protocols/Aws_json1_1.ts +++ b/clients/client-organizations/protocols/Aws_json1_1.ts @@ -291,7 +291,7 @@ export const serializeAws_json1_1AcceptHandshakeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.AcceptHandshake", }; let body: any; @@ -304,7 +304,7 @@ export const serializeAws_json1_1AttachPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.AttachPolicy", }; let body: any; @@ -317,7 +317,7 @@ export const serializeAws_json1_1CancelHandshakeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.CancelHandshake", }; let body: any; @@ -330,7 +330,7 @@ export const serializeAws_json1_1CreateAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.CreateAccount", }; let body: any; @@ -343,7 +343,7 @@ export const serializeAws_json1_1CreateGovCloudAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.CreateGovCloudAccount", }; let body: any; @@ -356,7 +356,7 @@ export const serializeAws_json1_1CreateOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.CreateOrganization", }; let body: any; @@ -369,7 +369,7 @@ export const serializeAws_json1_1CreateOrganizationalUnitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.CreateOrganizationalUnit", }; let body: any; @@ -382,7 +382,7 @@ export const serializeAws_json1_1CreatePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.CreatePolicy", }; let body: any; @@ -395,7 +395,7 @@ export const serializeAws_json1_1DeclineHandshakeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DeclineHandshake", }; let body: any; @@ -408,7 +408,7 @@ export const serializeAws_json1_1DeleteOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DeleteOrganization", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -419,7 +419,7 @@ export const serializeAws_json1_1DeleteOrganizationalUnitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DeleteOrganizationalUnit", }; let body: any; @@ -432,7 +432,7 @@ export const serializeAws_json1_1DeletePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DeletePolicy", }; let body: any; @@ -445,7 +445,7 @@ export const serializeAws_json1_1DeregisterDelegatedAdministratorCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DeregisterDelegatedAdministrator", }; let body: any; @@ -458,7 +458,7 @@ export const serializeAws_json1_1DescribeAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DescribeAccount", }; let body: any; @@ -471,7 +471,7 @@ export const serializeAws_json1_1DescribeCreateAccountStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DescribeCreateAccountStatus", }; let body: any; @@ -484,7 +484,7 @@ export const serializeAws_json1_1DescribeEffectivePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DescribeEffectivePolicy", }; let body: any; @@ -497,7 +497,7 @@ export const serializeAws_json1_1DescribeHandshakeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DescribeHandshake", }; let body: any; @@ -510,7 +510,7 @@ export const serializeAws_json1_1DescribeOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DescribeOrganization", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -521,7 +521,7 @@ export const serializeAws_json1_1DescribeOrganizationalUnitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DescribeOrganizationalUnit", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1DescribePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DescribePolicy", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1DetachPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DetachPolicy", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1DisableAWSServiceAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DisableAWSServiceAccess", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1DisablePolicyTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.DisablePolicyType", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1EnableAllFeaturesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.EnableAllFeatures", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1EnableAWSServiceAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.EnableAWSServiceAccess", }; let body: any; @@ -612,7 +612,7 @@ export const serializeAws_json1_1EnablePolicyTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.EnablePolicyType", }; let body: any; @@ -625,7 +625,7 @@ export const serializeAws_json1_1InviteAccountToOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.InviteAccountToOrganization", }; let body: any; @@ -638,7 +638,7 @@ export const serializeAws_json1_1LeaveOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.LeaveOrganization", }; return buildHttpRpcRequest(context, headers, "/", undefined, undefined); @@ -649,7 +649,7 @@ export const serializeAws_json1_1ListAccountsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListAccounts", }; let body: any; @@ -662,7 +662,7 @@ export const serializeAws_json1_1ListAccountsForParentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListAccountsForParent", }; let body: any; @@ -675,7 +675,7 @@ export const serializeAws_json1_1ListAWSServiceAccessForOrganizationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListAWSServiceAccessForOrganization", }; let body: any; @@ -688,7 +688,7 @@ export const serializeAws_json1_1ListChildrenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListChildren", }; let body: any; @@ -701,7 +701,7 @@ export const serializeAws_json1_1ListCreateAccountStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListCreateAccountStatus", }; let body: any; @@ -714,7 +714,7 @@ export const serializeAws_json1_1ListDelegatedAdministratorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListDelegatedAdministrators", }; let body: any; @@ -727,7 +727,7 @@ export const serializeAws_json1_1ListDelegatedServicesForAccountCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListDelegatedServicesForAccount", }; let body: any; @@ -740,7 +740,7 @@ export const serializeAws_json1_1ListHandshakesForAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListHandshakesForAccount", }; let body: any; @@ -753,7 +753,7 @@ export const serializeAws_json1_1ListHandshakesForOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListHandshakesForOrganization", }; let body: any; @@ -766,7 +766,7 @@ export const serializeAws_json1_1ListOrganizationalUnitsForParentCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListOrganizationalUnitsForParent", }; let body: any; @@ -779,7 +779,7 @@ export const serializeAws_json1_1ListParentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListParents", }; let body: any; @@ -792,7 +792,7 @@ export const serializeAws_json1_1ListPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListPolicies", }; let body: any; @@ -805,7 +805,7 @@ export const serializeAws_json1_1ListPoliciesForTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListPoliciesForTarget", }; let body: any; @@ -818,7 +818,7 @@ export const serializeAws_json1_1ListRootsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListRoots", }; let body: any; @@ -831,7 +831,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListTagsForResource", }; let body: any; @@ -844,7 +844,7 @@ export const serializeAws_json1_1ListTargetsForPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.ListTargetsForPolicy", }; let body: any; @@ -857,7 +857,7 @@ export const serializeAws_json1_1MoveAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.MoveAccount", }; let body: any; @@ -870,7 +870,7 @@ export const serializeAws_json1_1RegisterDelegatedAdministratorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.RegisterDelegatedAdministrator", }; let body: any; @@ -883,7 +883,7 @@ export const serializeAws_json1_1RemoveAccountFromOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.RemoveAccountFromOrganization", }; let body: any; @@ -896,7 +896,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.TagResource", }; let body: any; @@ -909,7 +909,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.UntagResource", }; let body: any; @@ -922,7 +922,7 @@ export const serializeAws_json1_1UpdateOrganizationalUnitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.UpdateOrganizationalUnit", }; let body: any; @@ -935,7 +935,7 @@ export const serializeAws_json1_1UpdatePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSOrganizationsV20161128.UpdatePolicy", }; let body: any; @@ -970,8 +970,7 @@ const deserializeAws_json1_1AcceptHandshakeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -1102,8 +1101,7 @@ const deserializeAws_json1_1AttachPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -1253,8 +1251,7 @@ const deserializeAws_json1_1CancelHandshakeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -1364,8 +1361,7 @@ const deserializeAws_json1_1CreateAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -1483,8 +1479,7 @@ const deserializeAws_json1_1CreateGovCloudAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -1602,8 +1597,7 @@ const deserializeAws_json1_1CreateOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -1713,8 +1707,7 @@ const deserializeAws_json1_1CreateOrganizationalUnitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -1832,8 +1825,7 @@ const deserializeAws_json1_1CreatePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -1967,8 +1959,7 @@ const deserializeAws_json1_1DeclineHandshakeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -2075,8 +2066,7 @@ const deserializeAws_json1_1DeleteOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -2175,8 +2165,7 @@ const deserializeAws_json1_1DeleteOrganizationalUnitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -2283,8 +2272,7 @@ const deserializeAws_json1_1DeletePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -2399,8 +2387,7 @@ const deserializeAws_json1_1DeregisterDelegatedAdministratorCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -2526,8 +2513,7 @@ const deserializeAws_json1_1DescribeAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -2621,8 +2607,7 @@ const deserializeAws_json1_1DescribeCreateAccountStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -2724,8 +2709,7 @@ const deserializeAws_json1_1DescribeEffectivePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -2843,8 +2827,7 @@ const deserializeAws_json1_1DescribeHandshakeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -2938,8 +2921,7 @@ const deserializeAws_json1_1DescribeOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -3025,8 +3007,7 @@ const deserializeAws_json1_1DescribeOrganizationalUnitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -3120,8 +3101,7 @@ const deserializeAws_json1_1DescribePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -3220,8 +3200,7 @@ const deserializeAws_json1_1DetachPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -3360,8 +3339,7 @@ const deserializeAws_json1_1DisableAWSServiceAccessCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -3471,8 +3449,7 @@ const deserializeAws_json1_1DisablePolicyTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -3606,8 +3583,7 @@ const deserializeAws_json1_1EnableAllFeaturesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -3706,8 +3682,7 @@ const deserializeAws_json1_1EnableAWSServiceAccessCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -3817,8 +3792,7 @@ const deserializeAws_json1_1EnablePolicyTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -3960,8 +3934,7 @@ const deserializeAws_json1_1InviteAccountToOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4092,8 +4065,7 @@ const deserializeAws_json1_1LeaveOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4211,8 +4183,7 @@ const deserializeAws_json1_1ListAccountsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4298,8 +4269,7 @@ const deserializeAws_json1_1ListAccountsForParentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4393,8 +4363,7 @@ const deserializeAws_json1_1ListAWSServiceAccessForOrganizationCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4496,8 +4465,7 @@ const deserializeAws_json1_1ListChildrenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4591,8 +4559,7 @@ const deserializeAws_json1_1ListCreateAccountStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4686,8 +4653,7 @@ const deserializeAws_json1_1ListDelegatedAdministratorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4789,8 +4755,7 @@ const deserializeAws_json1_1ListDelegatedServicesForAccountCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4908,8 +4873,7 @@ const deserializeAws_json1_1ListHandshakesForAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -4995,8 +4959,7 @@ const deserializeAws_json1_1ListHandshakesForOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -5090,8 +5053,7 @@ const deserializeAws_json1_1ListOrganizationalUnitsForParentCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -5185,8 +5147,7 @@ const deserializeAws_json1_1ListParentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -5280,8 +5241,7 @@ const deserializeAws_json1_1ListPoliciesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -5375,8 +5335,7 @@ const deserializeAws_json1_1ListPoliciesForTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -5478,8 +5437,7 @@ const deserializeAws_json1_1ListRootsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -5565,8 +5523,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -5660,8 +5617,7 @@ const deserializeAws_json1_1ListTargetsForPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -5760,8 +5716,7 @@ const deserializeAws_json1_1MoveAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -5884,8 +5839,7 @@ const deserializeAws_json1_1RegisterDelegatedAdministratorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -6008,8 +5962,7 @@ const deserializeAws_json1_1RemoveAccountFromOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -6124,8 +6077,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -6232,8 +6184,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -6343,8 +6294,7 @@ const deserializeAws_json1_1UpdateOrganizationalUnitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -6454,8 +6404,7 @@ const deserializeAws_json1_1UpdatePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": @@ -7232,30 +7181,31 @@ const deserializeAws_json1_1UnsupportedAPIEndpointExceptionResponse = async ( const serializeAws_json1_1AcceptHandshakeRequest = (input: AcceptHandshakeRequest, context: __SerdeContext): any => { return { - ...(input.HandshakeId !== undefined && { HandshakeId: input.HandshakeId }), + ...(input.HandshakeId !== undefined && input.HandshakeId !== null && { HandshakeId: input.HandshakeId }), }; }; const serializeAws_json1_1AttachPolicyRequest = (input: AttachPolicyRequest, context: __SerdeContext): any => { return { - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), - ...(input.TargetId !== undefined && { TargetId: input.TargetId }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), + ...(input.TargetId !== undefined && input.TargetId !== null && { TargetId: input.TargetId }), }; }; const serializeAws_json1_1CancelHandshakeRequest = (input: CancelHandshakeRequest, context: __SerdeContext): any => { return { - ...(input.HandshakeId !== undefined && { HandshakeId: input.HandshakeId }), + ...(input.HandshakeId !== undefined && input.HandshakeId !== null && { HandshakeId: input.HandshakeId }), }; }; const serializeAws_json1_1CreateAccountRequest = (input: CreateAccountRequest, context: __SerdeContext): any => { return { - ...(input.AccountName !== undefined && { AccountName: input.AccountName }), - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.IamUserAccessToBilling !== undefined && { IamUserAccessToBilling: input.IamUserAccessToBilling }), - ...(input.RoleName !== undefined && { RoleName: input.RoleName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.AccountName !== undefined && input.AccountName !== null && { AccountName: input.AccountName }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.IamUserAccessToBilling !== undefined && + input.IamUserAccessToBilling !== null && { IamUserAccessToBilling: input.IamUserAccessToBilling }), + ...(input.RoleName !== undefined && input.RoleName !== null && { RoleName: input.RoleName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -7263,7 +7213,14 @@ const serializeAws_json1_1CreateAccountStates = ( input: (CreateAccountState | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateGovCloudAccountRequest = ( @@ -7271,11 +7228,12 @@ const serializeAws_json1_1CreateGovCloudAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountName !== undefined && { AccountName: input.AccountName }), - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.IamUserAccessToBilling !== undefined && { IamUserAccessToBilling: input.IamUserAccessToBilling }), - ...(input.RoleName !== undefined && { RoleName: input.RoleName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.AccountName !== undefined && input.AccountName !== null && { AccountName: input.AccountName }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.IamUserAccessToBilling !== undefined && + input.IamUserAccessToBilling !== null && { IamUserAccessToBilling: input.IamUserAccessToBilling }), + ...(input.RoleName !== undefined && input.RoleName !== null && { RoleName: input.RoleName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -7284,9 +7242,9 @@ const serializeAws_json1_1CreateOrganizationalUnitRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParentId !== undefined && { ParentId: input.ParentId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParentId !== undefined && input.ParentId !== null && { ParentId: input.ParentId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -7295,23 +7253,23 @@ const serializeAws_json1_1CreateOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.FeatureSet !== undefined && { FeatureSet: input.FeatureSet }), + ...(input.FeatureSet !== undefined && input.FeatureSet !== null && { FeatureSet: input.FeatureSet }), }; }; const serializeAws_json1_1CreatePolicyRequest = (input: CreatePolicyRequest, context: __SerdeContext): any => { return { - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1DeclineHandshakeRequest = (input: DeclineHandshakeRequest, context: __SerdeContext): any => { return { - ...(input.HandshakeId !== undefined && { HandshakeId: input.HandshakeId }), + ...(input.HandshakeId !== undefined && input.HandshakeId !== null && { HandshakeId: input.HandshakeId }), }; }; @@ -7320,13 +7278,14 @@ const serializeAws_json1_1DeleteOrganizationalUnitRequest = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationalUnitId !== undefined && { OrganizationalUnitId: input.OrganizationalUnitId }), + ...(input.OrganizationalUnitId !== undefined && + input.OrganizationalUnitId !== null && { OrganizationalUnitId: input.OrganizationalUnitId }), }; }; const serializeAws_json1_1DeletePolicyRequest = (input: DeletePolicyRequest, context: __SerdeContext): any => { return { - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), }; }; @@ -7335,14 +7294,15 @@ const serializeAws_json1_1DeregisterDelegatedAdministratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.ServicePrincipal !== undefined && { ServicePrincipal: input.ServicePrincipal }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.ServicePrincipal !== undefined && + input.ServicePrincipal !== null && { ServicePrincipal: input.ServicePrincipal }), }; }; const serializeAws_json1_1DescribeAccountRequest = (input: DescribeAccountRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), }; }; @@ -7351,7 +7311,8 @@ const serializeAws_json1_1DescribeCreateAccountStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreateAccountRequestId !== undefined && { CreateAccountRequestId: input.CreateAccountRequestId }), + ...(input.CreateAccountRequestId !== undefined && + input.CreateAccountRequestId !== null && { CreateAccountRequestId: input.CreateAccountRequestId }), }; }; @@ -7360,8 +7321,8 @@ const serializeAws_json1_1DescribeEffectivePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), - ...(input.TargetId !== undefined && { TargetId: input.TargetId }), + ...(input.PolicyType !== undefined && input.PolicyType !== null && { PolicyType: input.PolicyType }), + ...(input.TargetId !== undefined && input.TargetId !== null && { TargetId: input.TargetId }), }; }; @@ -7370,7 +7331,7 @@ const serializeAws_json1_1DescribeHandshakeRequest = ( context: __SerdeContext ): any => { return { - ...(input.HandshakeId !== undefined && { HandshakeId: input.HandshakeId }), + ...(input.HandshakeId !== undefined && input.HandshakeId !== null && { HandshakeId: input.HandshakeId }), }; }; @@ -7379,20 +7340,21 @@ const serializeAws_json1_1DescribeOrganizationalUnitRequest = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationalUnitId !== undefined && { OrganizationalUnitId: input.OrganizationalUnitId }), + ...(input.OrganizationalUnitId !== undefined && + input.OrganizationalUnitId !== null && { OrganizationalUnitId: input.OrganizationalUnitId }), }; }; const serializeAws_json1_1DescribePolicyRequest = (input: DescribePolicyRequest, context: __SerdeContext): any => { return { - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), }; }; const serializeAws_json1_1DetachPolicyRequest = (input: DetachPolicyRequest, context: __SerdeContext): any => { return { - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), - ...(input.TargetId !== undefined && { TargetId: input.TargetId }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), + ...(input.TargetId !== undefined && input.TargetId !== null && { TargetId: input.TargetId }), }; }; @@ -7401,7 +7363,8 @@ const serializeAws_json1_1DisableAWSServiceAccessRequest = ( context: __SerdeContext ): any => { return { - ...(input.ServicePrincipal !== undefined && { ServicePrincipal: input.ServicePrincipal }), + ...(input.ServicePrincipal !== undefined && + input.ServicePrincipal !== null && { ServicePrincipal: input.ServicePrincipal }), }; }; @@ -7410,8 +7373,8 @@ const serializeAws_json1_1DisablePolicyTypeRequest = ( context: __SerdeContext ): any => { return { - ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), - ...(input.RootId !== undefined && { RootId: input.RootId }), + ...(input.PolicyType !== undefined && input.PolicyType !== null && { PolicyType: input.PolicyType }), + ...(input.RootId !== undefined && input.RootId !== null && { RootId: input.RootId }), }; }; @@ -7427,28 +7390,30 @@ const serializeAws_json1_1EnableAWSServiceAccessRequest = ( context: __SerdeContext ): any => { return { - ...(input.ServicePrincipal !== undefined && { ServicePrincipal: input.ServicePrincipal }), + ...(input.ServicePrincipal !== undefined && + input.ServicePrincipal !== null && { ServicePrincipal: input.ServicePrincipal }), }; }; const serializeAws_json1_1EnablePolicyTypeRequest = (input: EnablePolicyTypeRequest, context: __SerdeContext): any => { return { - ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), - ...(input.RootId !== undefined && { RootId: input.RootId }), + ...(input.PolicyType !== undefined && input.PolicyType !== null && { PolicyType: input.PolicyType }), + ...(input.RootId !== undefined && input.RootId !== null && { RootId: input.RootId }), }; }; const serializeAws_json1_1HandshakeFilter = (input: HandshakeFilter, context: __SerdeContext): any => { return { - ...(input.ActionType !== undefined && { ActionType: input.ActionType }), - ...(input.ParentHandshakeId !== undefined && { ParentHandshakeId: input.ParentHandshakeId }), + ...(input.ActionType !== undefined && input.ActionType !== null && { ActionType: input.ActionType }), + ...(input.ParentHandshakeId !== undefined && + input.ParentHandshakeId !== null && { ParentHandshakeId: input.ParentHandshakeId }), }; }; const serializeAws_json1_1HandshakeParty = (input: HandshakeParty, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -7457,9 +7422,10 @@ const serializeAws_json1_1InviteAccountToOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Notes !== undefined && { Notes: input.Notes }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.Target !== undefined && { Target: serializeAws_json1_1HandshakeParty(input.Target, context) }), + ...(input.Notes !== undefined && input.Notes !== null && { Notes: input.Notes }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.Target !== undefined && + input.Target !== null && { Target: serializeAws_json1_1HandshakeParty(input.Target, context) }), }; }; @@ -7468,16 +7434,16 @@ const serializeAws_json1_1ListAccountsForParentRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ParentId !== undefined && { ParentId: input.ParentId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ParentId !== undefined && input.ParentId !== null && { ParentId: input.ParentId }), }; }; const serializeAws_json1_1ListAccountsRequest = (input: ListAccountsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7486,17 +7452,17 @@ const serializeAws_json1_1ListAWSServiceAccessForOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListChildrenRequest = (input: ListChildrenRequest, context: __SerdeContext): any => { return { - ...(input.ChildType !== undefined && { ChildType: input.ChildType }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ParentId !== undefined && { ParentId: input.ParentId }), + ...(input.ChildType !== undefined && input.ChildType !== null && { ChildType: input.ChildType }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ParentId !== undefined && input.ParentId !== null && { ParentId: input.ParentId }), }; }; @@ -7505,9 +7471,10 @@ const serializeAws_json1_1ListCreateAccountStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.States !== undefined && { States: serializeAws_json1_1CreateAccountStates(input.States, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.States !== undefined && + input.States !== null && { States: serializeAws_json1_1CreateAccountStates(input.States, context) }), }; }; @@ -7516,9 +7483,10 @@ const serializeAws_json1_1ListDelegatedAdministratorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServicePrincipal !== undefined && { ServicePrincipal: input.ServicePrincipal }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServicePrincipal !== undefined && + input.ServicePrincipal !== null && { ServicePrincipal: input.ServicePrincipal }), }; }; @@ -7527,9 +7495,9 @@ const serializeAws_json1_1ListDelegatedServicesForAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7538,9 +7506,10 @@ const serializeAws_json1_1ListHandshakesForAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1HandshakeFilter(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1HandshakeFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7549,9 +7518,10 @@ const serializeAws_json1_1ListHandshakesForOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1HandshakeFilter(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1HandshakeFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7560,17 +7530,17 @@ const serializeAws_json1_1ListOrganizationalUnitsForParentRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ParentId !== undefined && { ParentId: input.ParentId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ParentId !== undefined && input.ParentId !== null && { ParentId: input.ParentId }), }; }; const serializeAws_json1_1ListParentsRequest = (input: ListParentsRequest, context: __SerdeContext): any => { return { - ...(input.ChildId !== undefined && { ChildId: input.ChildId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ChildId !== undefined && input.ChildId !== null && { ChildId: input.ChildId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7579,25 +7549,25 @@ const serializeAws_json1_1ListPoliciesForTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: input.Filter }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TargetId !== undefined && { TargetId: input.TargetId }), + ...(input.Filter !== undefined && input.Filter !== null && { Filter: input.Filter }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TargetId !== undefined && input.TargetId !== null && { TargetId: input.TargetId }), }; }; const serializeAws_json1_1ListPoliciesRequest = (input: ListPoliciesRequest, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: input.Filter }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && input.Filter !== null && { Filter: input.Filter }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListRootsRequest = (input: ListRootsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -7606,8 +7576,8 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -7616,17 +7586,19 @@ const serializeAws_json1_1ListTargetsForPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), }; }; const serializeAws_json1_1MoveAccountRequest = (input: MoveAccountRequest, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.DestinationParentId !== undefined && { DestinationParentId: input.DestinationParentId }), - ...(input.SourceParentId !== undefined && { SourceParentId: input.SourceParentId }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.DestinationParentId !== undefined && + input.DestinationParentId !== null && { DestinationParentId: input.DestinationParentId }), + ...(input.SourceParentId !== undefined && + input.SourceParentId !== null && { SourceParentId: input.SourceParentId }), }; }; @@ -7635,8 +7607,9 @@ const serializeAws_json1_1RegisterDelegatedAdministratorRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.ServicePrincipal !== undefined && { ServicePrincipal: input.ServicePrincipal }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.ServicePrincipal !== undefined && + input.ServicePrincipal !== null && { ServicePrincipal: input.ServicePrincipal }), }; }; @@ -7645,36 +7618,51 @@ const serializeAws_json1_1RemoveAccountFromOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; @@ -7683,17 +7671,18 @@ const serializeAws_json1_1UpdateOrganizationalUnitRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OrganizationalUnitId !== undefined && { OrganizationalUnitId: input.OrganizationalUnitId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OrganizationalUnitId !== undefined && + input.OrganizationalUnitId !== null && { OrganizationalUnitId: input.OrganizationalUnitId }), }; }; const serializeAws_json1_1UpdatePolicyRequest = (input: UpdatePolicyRequest, context: __SerdeContext): any => { return { - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), }; }; @@ -7777,7 +7766,14 @@ const deserializeAws_json1_1AccountOwnerNotVerifiedException = ( }; const deserializeAws_json1_1Accounts = (output: any, context: __SerdeContext): Account[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Account(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Account(entry, context); + }); }; const deserializeAws_json1_1AlreadyInOrganizationException = ( @@ -7824,7 +7820,14 @@ const deserializeAws_json1_1ChildNotFoundException = (output: any, context: __Se }; const deserializeAws_json1_1Children = (output: any, context: __SerdeContext): Child[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Child(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Child(entry, context); + }); }; const deserializeAws_json1_1ConcurrentModificationException = ( @@ -7879,7 +7882,14 @@ const deserializeAws_json1_1CreateAccountStatus = (output: any, context: __Serde }; const deserializeAws_json1_1CreateAccountStatuses = (output: any, context: __SerdeContext): CreateAccountStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CreateAccountStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CreateAccountStatus(entry, context); + }); }; const deserializeAws_json1_1CreateAccountStatusNotFoundException = ( @@ -7971,7 +7981,14 @@ const deserializeAws_json1_1DelegatedAdministrators = ( output: any, context: __SerdeContext ): DelegatedAdministrator[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DelegatedAdministrator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DelegatedAdministrator(entry, context); + }); }; const deserializeAws_json1_1DelegatedService = (output: any, context: __SerdeContext): DelegatedService => { @@ -7986,7 +8003,14 @@ const deserializeAws_json1_1DelegatedService = (output: any, context: __SerdeCon }; const deserializeAws_json1_1DelegatedServices = (output: any, context: __SerdeContext): DelegatedService[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DelegatedService(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DelegatedService(entry, context); + }); }; const deserializeAws_json1_1DescribeAccountResponse = ( @@ -8186,7 +8210,14 @@ const deserializeAws_json1_1EnabledServicePrincipals = ( output: any, context: __SerdeContext ): EnabledServicePrincipal[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EnabledServicePrincipal(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EnabledServicePrincipal(entry, context); + }); }; const deserializeAws_json1_1EnablePolicyTypeResponse = ( @@ -8262,7 +8293,14 @@ const deserializeAws_json1_1HandshakeNotFoundException = ( }; const deserializeAws_json1_1HandshakeParties = (output: any, context: __SerdeContext): HandshakeParty[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HandshakeParty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HandshakeParty(entry, context); + }); }; const deserializeAws_json1_1HandshakeParty = (output: any, context: __SerdeContext): HandshakeParty => { @@ -8284,11 +8322,25 @@ const deserializeAws_json1_1HandshakeResource = (output: any, context: __SerdeCo }; const deserializeAws_json1_1HandshakeResources = (output: any, context: __SerdeContext): HandshakeResource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HandshakeResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HandshakeResource(entry, context); + }); }; const deserializeAws_json1_1Handshakes = (output: any, context: __SerdeContext): Handshake[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Handshake(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Handshake(entry, context); + }); }; const deserializeAws_json1_1InvalidHandshakeTransitionException = ( @@ -8575,7 +8627,14 @@ const deserializeAws_json1_1OrganizationalUnitNotFoundException = ( }; const deserializeAws_json1_1OrganizationalUnits = (output: any, context: __SerdeContext): OrganizationalUnit[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationalUnit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationalUnit(entry, context); + }); }; const deserializeAws_json1_1OrganizationNotEmptyException = ( @@ -8604,11 +8663,25 @@ const deserializeAws_json1_1ParentNotFoundException = ( }; const deserializeAws_json1_1Parents = (output: any, context: __SerdeContext): Parent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Parent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Parent(entry, context); + }); }; const deserializeAws_json1_1Policies = (output: any, context: __SerdeContext): PolicySummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PolicySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PolicySummary(entry, context); + }); }; const deserializeAws_json1_1Policy = (output: any, context: __SerdeContext): Policy => { @@ -8666,7 +8739,14 @@ const deserializeAws_json1_1PolicySummary = (output: any, context: __SerdeContex }; const deserializeAws_json1_1PolicyTargets = (output: any, context: __SerdeContext): PolicyTargetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PolicyTargetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PolicyTargetSummary(entry, context); + }); }; const deserializeAws_json1_1PolicyTargetSummary = (output: any, context: __SerdeContext): PolicyTargetSummary => { @@ -8706,7 +8786,14 @@ const deserializeAws_json1_1PolicyTypeNotEnabledException = ( }; const deserializeAws_json1_1PolicyTypes = (output: any, context: __SerdeContext): PolicyTypeSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PolicyTypeSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PolicyTypeSummary(entry, context); + }); }; const deserializeAws_json1_1PolicyTypeSummary = (output: any, context: __SerdeContext): PolicyTypeSummary => { @@ -8735,7 +8822,14 @@ const deserializeAws_json1_1RootNotFoundException = (output: any, context: __Ser }; const deserializeAws_json1_1Roots = (output: any, context: __SerdeContext): Root[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Root(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Root(entry, context); + }); }; const deserializeAws_json1_1ServiceException = (output: any, context: __SerdeContext): ServiceException => { @@ -8761,7 +8855,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TargetNotFoundException = ( @@ -8863,3 +8964,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-outposts/protocols/Aws_restJson1.ts b/clients/client-outposts/protocols/Aws_restJson1.ts index 80cf96031adc..55e73b1a4754 100644 --- a/clients/client-outposts/protocols/Aws_restJson1.ts +++ b/clients/client-outposts/protocols/Aws_restJson1.ts @@ -35,17 +35,19 @@ export const serializeAws_restJson1CreateOutpostCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/outposts"; let body: any; body = JSON.stringify({ - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.AvailabilityZoneId !== undefined && { AvailabilityZoneId: input.AvailabilityZoneId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SiteId !== undefined && { SiteId: input.SiteId }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.AvailabilityZoneId !== undefined && + input.AvailabilityZoneId !== null && { AvailabilityZoneId: input.AvailabilityZoneId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SiteId !== undefined && input.SiteId !== null && { SiteId: input.SiteId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -63,9 +65,7 @@ export const serializeAws_restJson1DeleteOutpostCommand = async ( input: DeleteOutpostCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/outposts/{OutpostId}"; if (input.OutpostId !== undefined) { const labelValue: string = input.OutpostId; @@ -93,9 +93,7 @@ export const serializeAws_restJson1DeleteSiteCommand = async ( input: DeleteSiteCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sites/{SiteId}"; if (input.SiteId !== undefined) { const labelValue: string = input.SiteId; @@ -123,9 +121,7 @@ export const serializeAws_restJson1GetOutpostCommand = async ( input: GetOutpostCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/outposts/{OutpostId}"; if (input.OutpostId !== undefined) { const labelValue: string = input.OutpostId; @@ -153,9 +149,7 @@ export const serializeAws_restJson1GetOutpostInstanceTypesCommand = async ( input: GetOutpostInstanceTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/outposts/{OutpostId}/instanceTypes"; if (input.OutpostId !== undefined) { const labelValue: string = input.OutpostId; @@ -188,9 +182,7 @@ export const serializeAws_restJson1ListOutpostsCommand = async ( input: ListOutpostsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/outposts"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -214,9 +206,7 @@ export const serializeAws_restJson1ListSitesCommand = async ( input: ListSitesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/sites"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -879,13 +869,15 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1InstanceTypeItem = (output: any, context: __SerdeContext): InstanceTypeItem => { @@ -898,7 +890,14 @@ const deserializeAws_restJson1InstanceTypeListDefinition = ( output: any, context: __SerdeContext ): InstanceTypeItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InstanceTypeItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InstanceTypeItem(entry, context); + }); }; const deserializeAws_restJson1Outpost = (output: any, context: __SerdeContext): Outpost => { @@ -925,7 +924,14 @@ const deserializeAws_restJson1Outpost = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1outpostListDefinition = (output: any, context: __SerdeContext): Outpost[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Outpost(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Outpost(entry, context); + }); }; const deserializeAws_restJson1Site = (output: any, context: __SerdeContext): Site => { @@ -942,17 +948,26 @@ const deserializeAws_restJson1Site = (output: any, context: __SerdeContext): Sit }; const deserializeAws_restJson1siteListDefinition = (output: any, context: __SerdeContext): Site[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Site(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Site(entry, context); + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -975,6 +990,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-personalize-events/protocols/Aws_restJson1.ts b/clients/client-personalize-events/protocols/Aws_restJson1.ts index e428a3b666c8..9558f05653cf 100644 --- a/clients/client-personalize-events/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-events/protocols/Aws_restJson1.ts @@ -16,15 +16,16 @@ export const serializeAws_restJson1PutEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/events"; let body: any; body = JSON.stringify({ - ...(input.eventList !== undefined && { eventList: serializeAws_restJson1EventList(input.eventList, context) }), - ...(input.sessionId !== undefined && { sessionId: input.sessionId }), - ...(input.trackingId !== undefined && { trackingId: input.trackingId }), - ...(input.userId !== undefined && { userId: input.userId }), + ...(input.eventList !== undefined && + input.eventList !== null && { eventList: serializeAws_restJson1EventList(input.eventList, context) }), + ...(input.sessionId !== undefined && input.sessionId !== null && { sessionId: input.sessionId }), + ...(input.trackingId !== undefined && input.trackingId !== null && { trackingId: input.trackingId }), + ...(input.userId !== undefined && input.userId !== null && { userId: input.userId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -43,13 +44,14 @@ export const serializeAws_restJson1PutItemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/items"; let body: any; body = JSON.stringify({ - ...(input.datasetArn !== undefined && { datasetArn: input.datasetArn }), - ...(input.items !== undefined && { items: serializeAws_restJson1ItemList(input.items, context) }), + ...(input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn }), + ...(input.items !== undefined && + input.items !== null && { items: serializeAws_restJson1ItemList(input.items, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -68,13 +70,14 @@ export const serializeAws_restJson1PutUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/users"; let body: any; body = JSON.stringify({ - ...(input.datasetArn !== undefined && { datasetArn: input.datasetArn }), - ...(input.users !== undefined && { users: serializeAws_restJson1UserList(input.users, context) }), + ...(input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn }), + ...(input.users !== undefined && + input.users !== null && { users: serializeAws_restJson1UserList(input.users, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -293,45 +296,78 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( const serializeAws_restJson1Event = (input: Event, context: __SerdeContext): any => { return { - ...(input.eventId !== undefined && { eventId: input.eventId }), - ...(input.eventType !== undefined && { eventType: input.eventType }), - ...(input.eventValue !== undefined && { eventValue: input.eventValue }), - ...(input.impression !== undefined && { impression: serializeAws_restJson1Impression(input.impression, context) }), - ...(input.itemId !== undefined && { itemId: input.itemId }), - ...(input.properties !== undefined && { properties: __LazyJsonString.fromObject(input.properties) }), - ...(input.recommendationId !== undefined && { recommendationId: input.recommendationId }), - ...(input.sentAt !== undefined && { sentAt: Math.round(input.sentAt.getTime() / 1000) }), + ...(input.eventId !== undefined && input.eventId !== null && { eventId: input.eventId }), + ...(input.eventType !== undefined && input.eventType !== null && { eventType: input.eventType }), + ...(input.eventValue !== undefined && input.eventValue !== null && { eventValue: input.eventValue }), + ...(input.impression !== undefined && + input.impression !== null && { impression: serializeAws_restJson1Impression(input.impression, context) }), + ...(input.itemId !== undefined && input.itemId !== null && { itemId: input.itemId }), + ...(input.properties !== undefined && + input.properties !== null && { properties: __LazyJsonString.fromObject(input.properties) }), + ...(input.recommendationId !== undefined && + input.recommendationId !== null && { recommendationId: input.recommendationId }), + ...(input.sentAt !== undefined && input.sentAt !== null && { sentAt: Math.round(input.sentAt.getTime() / 1000) }), }; }; const serializeAws_restJson1EventList = (input: Event[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Event(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Event(entry, context); + }); }; const serializeAws_restJson1Impression = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Item = (input: Item, context: __SerdeContext): any => { return { - ...(input.itemId !== undefined && { itemId: input.itemId }), - ...(input.properties !== undefined && { properties: __LazyJsonString.fromObject(input.properties) }), + ...(input.itemId !== undefined && input.itemId !== null && { itemId: input.itemId }), + ...(input.properties !== undefined && + input.properties !== null && { properties: __LazyJsonString.fromObject(input.properties) }), }; }; const serializeAws_restJson1ItemList = (input: Item[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Item(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Item(entry, context); + }); }; const serializeAws_restJson1User = (input: User, context: __SerdeContext): any => { return { - ...(input.properties !== undefined && { properties: __LazyJsonString.fromObject(input.properties) }), - ...(input.userId !== undefined && { userId: input.userId }), + ...(input.properties !== undefined && + input.properties !== null && { properties: __LazyJsonString.fromObject(input.properties) }), + ...(input.userId !== undefined && input.userId !== null && { userId: input.userId }), }; }; const serializeAws_restJson1UserList = (input: User[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1User(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1User(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -354,6 +390,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-personalize-runtime/protocols/Aws_restJson1.ts b/clients/client-personalize-runtime/protocols/Aws_restJson1.ts index 005bb9ca0174..7496c6e28f72 100644 --- a/clients/client-personalize-runtime/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-runtime/protocols/Aws_restJson1.ts @@ -18,19 +18,20 @@ export const serializeAws_restJson1GetPersonalizedRankingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/personalize-ranking"; let body: any; body = JSON.stringify({ - ...(input.campaignArn !== undefined && { campaignArn: input.campaignArn }), - ...(input.context !== undefined && { context: serializeAws_restJson1Context(input.context, context) }), - ...(input.filterArn !== undefined && { filterArn: input.filterArn }), - ...(input.filterValues !== undefined && { - filterValues: serializeAws_restJson1FilterValues(input.filterValues, context), - }), - ...(input.inputList !== undefined && { inputList: serializeAws_restJson1InputList(input.inputList, context) }), - ...(input.userId !== undefined && { userId: input.userId }), + ...(input.campaignArn !== undefined && input.campaignArn !== null && { campaignArn: input.campaignArn }), + ...(input.context !== undefined && + input.context !== null && { context: serializeAws_restJson1Context(input.context, context) }), + ...(input.filterArn !== undefined && input.filterArn !== null && { filterArn: input.filterArn }), + ...(input.filterValues !== undefined && + input.filterValues !== null && { filterValues: serializeAws_restJson1FilterValues(input.filterValues, context) }), + ...(input.inputList !== undefined && + input.inputList !== null && { inputList: serializeAws_restJson1InputList(input.inputList, context) }), + ...(input.userId !== undefined && input.userId !== null && { userId: input.userId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -49,20 +50,20 @@ export const serializeAws_restJson1GetRecommendationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/recommendations"; let body: any; body = JSON.stringify({ - ...(input.campaignArn !== undefined && { campaignArn: input.campaignArn }), - ...(input.context !== undefined && { context: serializeAws_restJson1Context(input.context, context) }), - ...(input.filterArn !== undefined && { filterArn: input.filterArn }), - ...(input.filterValues !== undefined && { - filterValues: serializeAws_restJson1FilterValues(input.filterValues, context), - }), - ...(input.itemId !== undefined && { itemId: input.itemId }), - ...(input.numResults !== undefined && { numResults: input.numResults }), - ...(input.userId !== undefined && { userId: input.userId }), + ...(input.campaignArn !== undefined && input.campaignArn !== null && { campaignArn: input.campaignArn }), + ...(input.context !== undefined && + input.context !== null && { context: serializeAws_restJson1Context(input.context, context) }), + ...(input.filterArn !== undefined && input.filterArn !== null && { filterArn: input.filterArn }), + ...(input.filterValues !== undefined && + input.filterValues !== null && { filterValues: serializeAws_restJson1FilterValues(input.filterValues, context) }), + ...(input.itemId !== undefined && input.itemId !== null && { itemId: input.itemId }), + ...(input.numResults !== undefined && input.numResults !== null && { numResults: input.numResults }), + ...(input.userId !== undefined && input.userId !== null && { userId: input.userId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -245,31 +246,49 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( }; const serializeAws_restJson1Context = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1FilterValues = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1InputList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ItemList = (output: any, context: __SerdeContext): PredictedItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PredictedItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PredictedItem(entry, context); + }); }; const deserializeAws_restJson1PredictedItem = (output: any, context: __SerdeContext): PredictedItem => { @@ -299,6 +318,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-personalize/protocols/Aws_json1_1.ts b/clients/client-personalize/protocols/Aws_json1_1.ts index 9934bd53da90..297d3236de0a 100644 --- a/clients/client-personalize/protocols/Aws_json1_1.ts +++ b/clients/client-personalize/protocols/Aws_json1_1.ts @@ -226,7 +226,7 @@ export const serializeAws_json1_1CreateBatchInferenceJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateBatchInferenceJob", }; let body: any; @@ -239,7 +239,7 @@ export const serializeAws_json1_1CreateCampaignCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateCampaign", }; let body: any; @@ -252,7 +252,7 @@ export const serializeAws_json1_1CreateDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateDataset", }; let body: any; @@ -265,7 +265,7 @@ export const serializeAws_json1_1CreateDatasetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateDatasetGroup", }; let body: any; @@ -278,7 +278,7 @@ export const serializeAws_json1_1CreateDatasetImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateDatasetImportJob", }; let body: any; @@ -291,7 +291,7 @@ export const serializeAws_json1_1CreateEventTrackerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateEventTracker", }; let body: any; @@ -304,7 +304,7 @@ export const serializeAws_json1_1CreateFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateFilter", }; let body: any; @@ -317,7 +317,7 @@ export const serializeAws_json1_1CreateSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateSchema", }; let body: any; @@ -330,7 +330,7 @@ export const serializeAws_json1_1CreateSolutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateSolution", }; let body: any; @@ -343,7 +343,7 @@ export const serializeAws_json1_1CreateSolutionVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.CreateSolutionVersion", }; let body: any; @@ -356,7 +356,7 @@ export const serializeAws_json1_1DeleteCampaignCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DeleteCampaign", }; let body: any; @@ -369,7 +369,7 @@ export const serializeAws_json1_1DeleteDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DeleteDataset", }; let body: any; @@ -382,7 +382,7 @@ export const serializeAws_json1_1DeleteDatasetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DeleteDatasetGroup", }; let body: any; @@ -395,7 +395,7 @@ export const serializeAws_json1_1DeleteEventTrackerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DeleteEventTracker", }; let body: any; @@ -408,7 +408,7 @@ export const serializeAws_json1_1DeleteFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DeleteFilter", }; let body: any; @@ -421,7 +421,7 @@ export const serializeAws_json1_1DeleteSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DeleteSchema", }; let body: any; @@ -434,7 +434,7 @@ export const serializeAws_json1_1DeleteSolutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DeleteSolution", }; let body: any; @@ -447,7 +447,7 @@ export const serializeAws_json1_1DescribeAlgorithmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeAlgorithm", }; let body: any; @@ -460,7 +460,7 @@ export const serializeAws_json1_1DescribeBatchInferenceJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeBatchInferenceJob", }; let body: any; @@ -473,7 +473,7 @@ export const serializeAws_json1_1DescribeCampaignCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeCampaign", }; let body: any; @@ -486,7 +486,7 @@ export const serializeAws_json1_1DescribeDatasetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeDataset", }; let body: any; @@ -499,7 +499,7 @@ export const serializeAws_json1_1DescribeDatasetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeDatasetGroup", }; let body: any; @@ -512,7 +512,7 @@ export const serializeAws_json1_1DescribeDatasetImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeDatasetImportJob", }; let body: any; @@ -525,7 +525,7 @@ export const serializeAws_json1_1DescribeEventTrackerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeEventTracker", }; let body: any; @@ -538,7 +538,7 @@ export const serializeAws_json1_1DescribeFeatureTransformationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeFeatureTransformation", }; let body: any; @@ -551,7 +551,7 @@ export const serializeAws_json1_1DescribeFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeFilter", }; let body: any; @@ -564,7 +564,7 @@ export const serializeAws_json1_1DescribeRecipeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeRecipe", }; let body: any; @@ -577,7 +577,7 @@ export const serializeAws_json1_1DescribeSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeSchema", }; let body: any; @@ -590,7 +590,7 @@ export const serializeAws_json1_1DescribeSolutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeSolution", }; let body: any; @@ -603,7 +603,7 @@ export const serializeAws_json1_1DescribeSolutionVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.DescribeSolutionVersion", }; let body: any; @@ -616,7 +616,7 @@ export const serializeAws_json1_1GetSolutionMetricsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.GetSolutionMetrics", }; let body: any; @@ -629,7 +629,7 @@ export const serializeAws_json1_1ListBatchInferenceJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListBatchInferenceJobs", }; let body: any; @@ -642,7 +642,7 @@ export const serializeAws_json1_1ListCampaignsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListCampaigns", }; let body: any; @@ -655,7 +655,7 @@ export const serializeAws_json1_1ListDatasetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListDatasetGroups", }; let body: any; @@ -668,7 +668,7 @@ export const serializeAws_json1_1ListDatasetImportJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListDatasetImportJobs", }; let body: any; @@ -681,7 +681,7 @@ export const serializeAws_json1_1ListDatasetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListDatasets", }; let body: any; @@ -694,7 +694,7 @@ export const serializeAws_json1_1ListEventTrackersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListEventTrackers", }; let body: any; @@ -707,7 +707,7 @@ export const serializeAws_json1_1ListFiltersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListFilters", }; let body: any; @@ -720,7 +720,7 @@ export const serializeAws_json1_1ListRecipesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListRecipes", }; let body: any; @@ -733,7 +733,7 @@ export const serializeAws_json1_1ListSchemasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListSchemas", }; let body: any; @@ -746,7 +746,7 @@ export const serializeAws_json1_1ListSolutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListSolutions", }; let body: any; @@ -759,7 +759,7 @@ export const serializeAws_json1_1ListSolutionVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.ListSolutionVersions", }; let body: any; @@ -772,7 +772,7 @@ export const serializeAws_json1_1UpdateCampaignCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonPersonalize.UpdateCampaign", }; let body: any; @@ -807,8 +807,7 @@ const deserializeAws_json1_1CreateBatchInferenceJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -894,8 +893,7 @@ const deserializeAws_json1_1CreateCampaignCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -981,8 +979,7 @@ const deserializeAws_json1_1CreateDatasetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1068,8 +1065,7 @@ const deserializeAws_json1_1CreateDatasetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1139,8 +1135,7 @@ const deserializeAws_json1_1CreateDatasetImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1226,8 +1221,7 @@ const deserializeAws_json1_1CreateEventTrackerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1313,8 +1307,7 @@ const deserializeAws_json1_1CreateFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1392,8 +1385,7 @@ const deserializeAws_json1_1CreateSchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1463,8 +1455,7 @@ const deserializeAws_json1_1CreateSolutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1550,8 +1541,7 @@ const deserializeAws_json1_1CreateSolutionVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1626,8 +1616,7 @@ const deserializeAws_json1_1DeleteCampaignCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1694,8 +1683,7 @@ const deserializeAws_json1_1DeleteDatasetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1762,8 +1750,7 @@ const deserializeAws_json1_1DeleteDatasetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1830,8 +1817,7 @@ const deserializeAws_json1_1DeleteEventTrackerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1898,8 +1884,7 @@ const deserializeAws_json1_1DeleteFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -1966,8 +1951,7 @@ const deserializeAws_json1_1DeleteSchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2034,8 +2018,7 @@ const deserializeAws_json1_1DeleteSolutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2105,8 +2088,7 @@ const deserializeAws_json1_1DescribeAlgorithmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2168,8 +2150,7 @@ const deserializeAws_json1_1DescribeBatchInferenceJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2231,8 +2212,7 @@ const deserializeAws_json1_1DescribeCampaignCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2294,8 +2274,7 @@ const deserializeAws_json1_1DescribeDatasetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2357,8 +2336,7 @@ const deserializeAws_json1_1DescribeDatasetGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2420,8 +2398,7 @@ const deserializeAws_json1_1DescribeDatasetImportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2483,8 +2460,7 @@ const deserializeAws_json1_1DescribeEventTrackerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2546,8 +2522,7 @@ const deserializeAws_json1_1DescribeFeatureTransformationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2609,8 +2584,7 @@ const deserializeAws_json1_1DescribeFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2672,8 +2646,7 @@ const deserializeAws_json1_1DescribeRecipeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2735,8 +2708,7 @@ const deserializeAws_json1_1DescribeSchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2798,8 +2770,7 @@ const deserializeAws_json1_1DescribeSolutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2861,8 +2832,7 @@ const deserializeAws_json1_1DescribeSolutionVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2924,8 +2894,7 @@ const deserializeAws_json1_1GetSolutionMetricsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -2995,8 +2964,7 @@ const deserializeAws_json1_1ListBatchInferenceJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -3058,8 +3026,7 @@ const deserializeAws_json1_1ListCampaignsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -3121,8 +3088,7 @@ const deserializeAws_json1_1ListDatasetGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.personalize#InvalidNextTokenException": @@ -3176,8 +3142,7 @@ const deserializeAws_json1_1ListDatasetImportJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -3239,8 +3204,7 @@ const deserializeAws_json1_1ListDatasetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -3302,8 +3266,7 @@ const deserializeAws_json1_1ListEventTrackersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -3365,8 +3328,7 @@ const deserializeAws_json1_1ListFiltersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -3428,8 +3390,7 @@ const deserializeAws_json1_1ListRecipesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.personalize#InvalidNextTokenException": @@ -3483,8 +3444,7 @@ const deserializeAws_json1_1ListSchemasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.personalize#InvalidNextTokenException": @@ -3538,8 +3498,7 @@ const deserializeAws_json1_1ListSolutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -3601,8 +3560,7 @@ const deserializeAws_json1_1ListSolutionVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -3672,8 +3630,7 @@ const deserializeAws_json1_1UpdateCampaignCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": @@ -3807,45 +3764,55 @@ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( }; const serializeAws_json1_1ArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AutoMLConfig = (input: AutoMLConfig, context: __SerdeContext): any => { return { - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.recipeList !== undefined && { recipeList: serializeAws_json1_1ArnList(input.recipeList, context) }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.recipeList !== undefined && + input.recipeList !== null && { recipeList: serializeAws_json1_1ArnList(input.recipeList, context) }), }; }; const serializeAws_json1_1BatchInferenceJobConfig = (input: BatchInferenceJobConfig, context: __SerdeContext): any => { return { - ...(input.itemExplorationConfig !== undefined && { - itemExplorationConfig: serializeAws_json1_1HyperParameters(input.itemExplorationConfig, context), - }), + ...(input.itemExplorationConfig !== undefined && + input.itemExplorationConfig !== null && { + itemExplorationConfig: serializeAws_json1_1HyperParameters(input.itemExplorationConfig, context), + }), }; }; const serializeAws_json1_1BatchInferenceJobInput = (input: BatchInferenceJobInput, context: __SerdeContext): any => { return { - ...(input.s3DataSource !== undefined && { - s3DataSource: serializeAws_json1_1S3DataConfig(input.s3DataSource, context), - }), + ...(input.s3DataSource !== undefined && + input.s3DataSource !== null && { s3DataSource: serializeAws_json1_1S3DataConfig(input.s3DataSource, context) }), }; }; const serializeAws_json1_1BatchInferenceJobOutput = (input: BatchInferenceJobOutput, context: __SerdeContext): any => { return { - ...(input.s3DataDestination !== undefined && { - s3DataDestination: serializeAws_json1_1S3DataConfig(input.s3DataDestination, context), - }), + ...(input.s3DataDestination !== undefined && + input.s3DataDestination !== null && { + s3DataDestination: serializeAws_json1_1S3DataConfig(input.s3DataDestination, context), + }), }; }; const serializeAws_json1_1CampaignConfig = (input: CampaignConfig, context: __SerdeContext): any => { return { - ...(input.itemExplorationConfig !== undefined && { - itemExplorationConfig: serializeAws_json1_1HyperParameters(input.itemExplorationConfig, context), - }), + ...(input.itemExplorationConfig !== undefined && + input.itemExplorationConfig !== null && { + itemExplorationConfig: serializeAws_json1_1HyperParameters(input.itemExplorationConfig, context), + }), }; }; @@ -3854,8 +3821,9 @@ const serializeAws_json1_1CategoricalHyperParameterRange = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_json1_1CategoricalValues(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_json1_1CategoricalValues(input.values, context) }), }; }; @@ -3863,11 +3831,25 @@ const serializeAws_json1_1CategoricalHyperParameterRanges = ( input: CategoricalHyperParameterRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CategoricalHyperParameterRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CategoricalHyperParameterRange(entry, context); + }); }; const serializeAws_json1_1CategoricalValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ContinuousHyperParameterRange = ( @@ -3875,9 +3857,9 @@ const serializeAws_json1_1ContinuousHyperParameterRange = ( context: __SerdeContext ): any => { return { - ...(input.maxValue !== undefined && { maxValue: input.maxValue }), - ...(input.minValue !== undefined && { minValue: input.minValue }), - ...(input.name !== undefined && { name: input.name }), + ...(input.maxValue !== undefined && input.maxValue !== null && { maxValue: input.maxValue }), + ...(input.minValue !== undefined && input.minValue !== null && { minValue: input.minValue }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -3885,7 +3867,14 @@ const serializeAws_json1_1ContinuousHyperParameterRanges = ( input: ContinuousHyperParameterRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ContinuousHyperParameterRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ContinuousHyperParameterRange(entry, context); + }); }; const serializeAws_json1_1CreateBatchInferenceJobRequest = ( @@ -3893,31 +3882,34 @@ const serializeAws_json1_1CreateBatchInferenceJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.batchInferenceJobConfig !== undefined && { - batchInferenceJobConfig: serializeAws_json1_1BatchInferenceJobConfig(input.batchInferenceJobConfig, context), - }), - ...(input.filterArn !== undefined && { filterArn: input.filterArn }), - ...(input.jobInput !== undefined && { - jobInput: serializeAws_json1_1BatchInferenceJobInput(input.jobInput, context), - }), - ...(input.jobName !== undefined && { jobName: input.jobName }), - ...(input.jobOutput !== undefined && { - jobOutput: serializeAws_json1_1BatchInferenceJobOutput(input.jobOutput, context), - }), - ...(input.numResults !== undefined && { numResults: input.numResults }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.solutionVersionArn !== undefined && { solutionVersionArn: input.solutionVersionArn }), + ...(input.batchInferenceJobConfig !== undefined && + input.batchInferenceJobConfig !== null && { + batchInferenceJobConfig: serializeAws_json1_1BatchInferenceJobConfig(input.batchInferenceJobConfig, context), + }), + ...(input.filterArn !== undefined && input.filterArn !== null && { filterArn: input.filterArn }), + ...(input.jobInput !== undefined && + input.jobInput !== null && { jobInput: serializeAws_json1_1BatchInferenceJobInput(input.jobInput, context) }), + ...(input.jobName !== undefined && input.jobName !== null && { jobName: input.jobName }), + ...(input.jobOutput !== undefined && + input.jobOutput !== null && { jobOutput: serializeAws_json1_1BatchInferenceJobOutput(input.jobOutput, context) }), + ...(input.numResults !== undefined && input.numResults !== null && { numResults: input.numResults }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.solutionVersionArn !== undefined && + input.solutionVersionArn !== null && { solutionVersionArn: input.solutionVersionArn }), }; }; const serializeAws_json1_1CreateCampaignRequest = (input: CreateCampaignRequest, context: __SerdeContext): any => { return { - ...(input.campaignConfig !== undefined && { - campaignConfig: serializeAws_json1_1CampaignConfig(input.campaignConfig, context), - }), - ...(input.minProvisionedTPS !== undefined && { minProvisionedTPS: input.minProvisionedTPS }), - ...(input.name !== undefined && { name: input.name }), - ...(input.solutionVersionArn !== undefined && { solutionVersionArn: input.solutionVersionArn }), + ...(input.campaignConfig !== undefined && + input.campaignConfig !== null && { + campaignConfig: serializeAws_json1_1CampaignConfig(input.campaignConfig, context), + }), + ...(input.minProvisionedTPS !== undefined && + input.minProvisionedTPS !== null && { minProvisionedTPS: input.minProvisionedTPS }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.solutionVersionArn !== undefined && + input.solutionVersionArn !== null && { solutionVersionArn: input.solutionVersionArn }), }; }; @@ -3926,9 +3918,9 @@ const serializeAws_json1_1CreateDatasetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.kmsKeyArn !== undefined && { kmsKeyArn: input.kmsKeyArn }), - ...(input.name !== undefined && { name: input.name }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.kmsKeyArn !== undefined && input.kmsKeyArn !== null && { kmsKeyArn: input.kmsKeyArn }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; @@ -3937,19 +3929,21 @@ const serializeAws_json1_1CreateDatasetImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.dataSource !== undefined && { dataSource: serializeAws_json1_1DataSource(input.dataSource, context) }), - ...(input.datasetArn !== undefined && { datasetArn: input.datasetArn }), - ...(input.jobName !== undefined && { jobName: input.jobName }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.dataSource !== undefined && + input.dataSource !== null && { dataSource: serializeAws_json1_1DataSource(input.dataSource, context) }), + ...(input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn }), + ...(input.jobName !== undefined && input.jobName !== null && { jobName: input.jobName }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), }; }; const serializeAws_json1_1CreateDatasetRequest = (input: CreateDatasetRequest, context: __SerdeContext): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), - ...(input.datasetType !== undefined && { datasetType: input.datasetType }), - ...(input.name !== undefined && { name: input.name }), - ...(input.schemaArn !== undefined && { schemaArn: input.schemaArn }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), + ...(input.datasetType !== undefined && input.datasetType !== null && { datasetType: input.datasetType }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.schemaArn !== undefined && input.schemaArn !== null && { schemaArn: input.schemaArn }), }; }; @@ -3958,37 +3952,42 @@ const serializeAws_json1_1CreateEventTrackerRequest = ( context: __SerdeContext ): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), - ...(input.name !== undefined && { name: input.name }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1CreateFilterRequest = (input: CreateFilterRequest, context: __SerdeContext): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), - ...(input.filterExpression !== undefined && { filterExpression: input.filterExpression }), - ...(input.name !== undefined && { name: input.name }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), + ...(input.filterExpression !== undefined && + input.filterExpression !== null && { filterExpression: input.filterExpression }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; const serializeAws_json1_1CreateSchemaRequest = (input: CreateSchemaRequest, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.schema !== undefined && { schema: input.schema }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.schema !== undefined && input.schema !== null && { schema: input.schema }), }; }; const serializeAws_json1_1CreateSolutionRequest = (input: CreateSolutionRequest, context: __SerdeContext): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), - ...(input.eventType !== undefined && { eventType: input.eventType }), - ...(input.name !== undefined && { name: input.name }), - ...(input.performAutoML !== undefined && { performAutoML: input.performAutoML }), - ...(input.performHPO !== undefined && { performHPO: input.performHPO }), - ...(input.recipeArn !== undefined && { recipeArn: input.recipeArn }), - ...(input.solutionConfig !== undefined && { - solutionConfig: serializeAws_json1_1SolutionConfig(input.solutionConfig, context), - }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), + ...(input.eventType !== undefined && input.eventType !== null && { eventType: input.eventType }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.performAutoML !== undefined && input.performAutoML !== null && { performAutoML: input.performAutoML }), + ...(input.performHPO !== undefined && input.performHPO !== null && { performHPO: input.performHPO }), + ...(input.recipeArn !== undefined && input.recipeArn !== null && { recipeArn: input.recipeArn }), + ...(input.solutionConfig !== undefined && + input.solutionConfig !== null && { + solutionConfig: serializeAws_json1_1SolutionConfig(input.solutionConfig, context), + }), }; }; @@ -3997,20 +3996,20 @@ const serializeAws_json1_1CreateSolutionVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }), - ...(input.trainingMode !== undefined && { trainingMode: input.trainingMode }), + ...(input.solutionArn !== undefined && input.solutionArn !== null && { solutionArn: input.solutionArn }), + ...(input.trainingMode !== undefined && input.trainingMode !== null && { trainingMode: input.trainingMode }), }; }; const serializeAws_json1_1DataSource = (input: DataSource, context: __SerdeContext): any => { return { - ...(input.dataLocation !== undefined && { dataLocation: input.dataLocation }), + ...(input.dataLocation !== undefined && input.dataLocation !== null && { dataLocation: input.dataLocation }), }; }; const serializeAws_json1_1DeleteCampaignRequest = (input: DeleteCampaignRequest, context: __SerdeContext): any => { return { - ...(input.campaignArn !== undefined && { campaignArn: input.campaignArn }), + ...(input.campaignArn !== undefined && input.campaignArn !== null && { campaignArn: input.campaignArn }), }; }; @@ -4019,13 +4018,14 @@ const serializeAws_json1_1DeleteDatasetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), }; }; const serializeAws_json1_1DeleteDatasetRequest = (input: DeleteDatasetRequest, context: __SerdeContext): any => { return { - ...(input.datasetArn !== undefined && { datasetArn: input.datasetArn }), + ...(input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn }), }; }; @@ -4034,25 +4034,26 @@ const serializeAws_json1_1DeleteEventTrackerRequest = ( context: __SerdeContext ): any => { return { - ...(input.eventTrackerArn !== undefined && { eventTrackerArn: input.eventTrackerArn }), + ...(input.eventTrackerArn !== undefined && + input.eventTrackerArn !== null && { eventTrackerArn: input.eventTrackerArn }), }; }; const serializeAws_json1_1DeleteFilterRequest = (input: DeleteFilterRequest, context: __SerdeContext): any => { return { - ...(input.filterArn !== undefined && { filterArn: input.filterArn }), + ...(input.filterArn !== undefined && input.filterArn !== null && { filterArn: input.filterArn }), }; }; const serializeAws_json1_1DeleteSchemaRequest = (input: DeleteSchemaRequest, context: __SerdeContext): any => { return { - ...(input.schemaArn !== undefined && { schemaArn: input.schemaArn }), + ...(input.schemaArn !== undefined && input.schemaArn !== null && { schemaArn: input.schemaArn }), }; }; const serializeAws_json1_1DeleteSolutionRequest = (input: DeleteSolutionRequest, context: __SerdeContext): any => { return { - ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }), + ...(input.solutionArn !== undefined && input.solutionArn !== null && { solutionArn: input.solutionArn }), }; }; @@ -4061,7 +4062,7 @@ const serializeAws_json1_1DescribeAlgorithmRequest = ( context: __SerdeContext ): any => { return { - ...(input.algorithmArn !== undefined && { algorithmArn: input.algorithmArn }), + ...(input.algorithmArn !== undefined && input.algorithmArn !== null && { algorithmArn: input.algorithmArn }), }; }; @@ -4070,13 +4071,14 @@ const serializeAws_json1_1DescribeBatchInferenceJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.batchInferenceJobArn !== undefined && { batchInferenceJobArn: input.batchInferenceJobArn }), + ...(input.batchInferenceJobArn !== undefined && + input.batchInferenceJobArn !== null && { batchInferenceJobArn: input.batchInferenceJobArn }), }; }; const serializeAws_json1_1DescribeCampaignRequest = (input: DescribeCampaignRequest, context: __SerdeContext): any => { return { - ...(input.campaignArn !== undefined && { campaignArn: input.campaignArn }), + ...(input.campaignArn !== undefined && input.campaignArn !== null && { campaignArn: input.campaignArn }), }; }; @@ -4085,7 +4087,8 @@ const serializeAws_json1_1DescribeDatasetGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), }; }; @@ -4094,13 +4097,14 @@ const serializeAws_json1_1DescribeDatasetImportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.datasetImportJobArn !== undefined && { datasetImportJobArn: input.datasetImportJobArn }), + ...(input.datasetImportJobArn !== undefined && + input.datasetImportJobArn !== null && { datasetImportJobArn: input.datasetImportJobArn }), }; }; const serializeAws_json1_1DescribeDatasetRequest = (input: DescribeDatasetRequest, context: __SerdeContext): any => { return { - ...(input.datasetArn !== undefined && { datasetArn: input.datasetArn }), + ...(input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn }), }; }; @@ -4109,7 +4113,8 @@ const serializeAws_json1_1DescribeEventTrackerRequest = ( context: __SerdeContext ): any => { return { - ...(input.eventTrackerArn !== undefined && { eventTrackerArn: input.eventTrackerArn }), + ...(input.eventTrackerArn !== undefined && + input.eventTrackerArn !== null && { eventTrackerArn: input.eventTrackerArn }), }; }; @@ -4118,31 +4123,32 @@ const serializeAws_json1_1DescribeFeatureTransformationRequest = ( context: __SerdeContext ): any => { return { - ...(input.featureTransformationArn !== undefined && { featureTransformationArn: input.featureTransformationArn }), + ...(input.featureTransformationArn !== undefined && + input.featureTransformationArn !== null && { featureTransformationArn: input.featureTransformationArn }), }; }; const serializeAws_json1_1DescribeFilterRequest = (input: DescribeFilterRequest, context: __SerdeContext): any => { return { - ...(input.filterArn !== undefined && { filterArn: input.filterArn }), + ...(input.filterArn !== undefined && input.filterArn !== null && { filterArn: input.filterArn }), }; }; const serializeAws_json1_1DescribeRecipeRequest = (input: DescribeRecipeRequest, context: __SerdeContext): any => { return { - ...(input.recipeArn !== undefined && { recipeArn: input.recipeArn }), + ...(input.recipeArn !== undefined && input.recipeArn !== null && { recipeArn: input.recipeArn }), }; }; const serializeAws_json1_1DescribeSchemaRequest = (input: DescribeSchemaRequest, context: __SerdeContext): any => { return { - ...(input.schemaArn !== undefined && { schemaArn: input.schemaArn }), + ...(input.schemaArn !== undefined && input.schemaArn !== null && { schemaArn: input.schemaArn }), }; }; const serializeAws_json1_1DescribeSolutionRequest = (input: DescribeSolutionRequest, context: __SerdeContext): any => { return { - ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }), + ...(input.solutionArn !== undefined && input.solutionArn !== null && { solutionArn: input.solutionArn }), }; }; @@ -4151,7 +4157,8 @@ const serializeAws_json1_1DescribeSolutionVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.solutionVersionArn !== undefined && { solutionVersionArn: input.solutionVersionArn }), + ...(input.solutionVersionArn !== undefined && + input.solutionVersionArn !== null && { solutionVersionArn: input.solutionVersionArn }), }; }; @@ -4159,13 +4166,15 @@ const serializeAws_json1_1FeatureTransformationParameters = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1GetSolutionMetricsRequest = ( @@ -4173,73 +4182,82 @@ const serializeAws_json1_1GetSolutionMetricsRequest = ( context: __SerdeContext ): any => { return { - ...(input.solutionVersionArn !== undefined && { solutionVersionArn: input.solutionVersionArn }), + ...(input.solutionVersionArn !== undefined && + input.solutionVersionArn !== null && { solutionVersionArn: input.solutionVersionArn }), }; }; const serializeAws_json1_1HPOConfig = (input: HPOConfig, context: __SerdeContext): any => { return { - ...(input.algorithmHyperParameterRanges !== undefined && { - algorithmHyperParameterRanges: serializeAws_json1_1HyperParameterRanges( - input.algorithmHyperParameterRanges, - context - ), - }), - ...(input.hpoObjective !== undefined && { - hpoObjective: serializeAws_json1_1HPOObjective(input.hpoObjective, context), - }), - ...(input.hpoResourceConfig !== undefined && { - hpoResourceConfig: serializeAws_json1_1HPOResourceConfig(input.hpoResourceConfig, context), - }), + ...(input.algorithmHyperParameterRanges !== undefined && + input.algorithmHyperParameterRanges !== null && { + algorithmHyperParameterRanges: serializeAws_json1_1HyperParameterRanges( + input.algorithmHyperParameterRanges, + context + ), + }), + ...(input.hpoObjective !== undefined && + input.hpoObjective !== null && { hpoObjective: serializeAws_json1_1HPOObjective(input.hpoObjective, context) }), + ...(input.hpoResourceConfig !== undefined && + input.hpoResourceConfig !== null && { + hpoResourceConfig: serializeAws_json1_1HPOResourceConfig(input.hpoResourceConfig, context), + }), }; }; const serializeAws_json1_1HPOObjective = (input: HPOObjective, context: __SerdeContext): any => { return { - ...(input.metricName !== undefined && { metricName: input.metricName }), - ...(input.metricRegex !== undefined && { metricRegex: input.metricRegex }), - ...(input.type !== undefined && { type: input.type }), + ...(input.metricName !== undefined && input.metricName !== null && { metricName: input.metricName }), + ...(input.metricRegex !== undefined && input.metricRegex !== null && { metricRegex: input.metricRegex }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_1HPOResourceConfig = (input: HPOResourceConfig, context: __SerdeContext): any => { return { - ...(input.maxNumberOfTrainingJobs !== undefined && { maxNumberOfTrainingJobs: input.maxNumberOfTrainingJobs }), - ...(input.maxParallelTrainingJobs !== undefined && { maxParallelTrainingJobs: input.maxParallelTrainingJobs }), + ...(input.maxNumberOfTrainingJobs !== undefined && + input.maxNumberOfTrainingJobs !== null && { maxNumberOfTrainingJobs: input.maxNumberOfTrainingJobs }), + ...(input.maxParallelTrainingJobs !== undefined && + input.maxParallelTrainingJobs !== null && { maxParallelTrainingJobs: input.maxParallelTrainingJobs }), }; }; const serializeAws_json1_1HyperParameterRanges = (input: HyperParameterRanges, context: __SerdeContext): any => { return { - ...(input.categoricalHyperParameterRanges !== undefined && { - categoricalHyperParameterRanges: serializeAws_json1_1CategoricalHyperParameterRanges( - input.categoricalHyperParameterRanges, - context - ), - }), - ...(input.continuousHyperParameterRanges !== undefined && { - continuousHyperParameterRanges: serializeAws_json1_1ContinuousHyperParameterRanges( - input.continuousHyperParameterRanges, - context - ), - }), - ...(input.integerHyperParameterRanges !== undefined && { - integerHyperParameterRanges: serializeAws_json1_1IntegerHyperParameterRanges( - input.integerHyperParameterRanges, - context - ), - }), + ...(input.categoricalHyperParameterRanges !== undefined && + input.categoricalHyperParameterRanges !== null && { + categoricalHyperParameterRanges: serializeAws_json1_1CategoricalHyperParameterRanges( + input.categoricalHyperParameterRanges, + context + ), + }), + ...(input.continuousHyperParameterRanges !== undefined && + input.continuousHyperParameterRanges !== null && { + continuousHyperParameterRanges: serializeAws_json1_1ContinuousHyperParameterRanges( + input.continuousHyperParameterRanges, + context + ), + }), + ...(input.integerHyperParameterRanges !== undefined && + input.integerHyperParameterRanges !== null && { + integerHyperParameterRanges: serializeAws_json1_1IntegerHyperParameterRanges( + input.integerHyperParameterRanges, + context + ), + }), }; }; const serializeAws_json1_1HyperParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1IntegerHyperParameterRange = ( @@ -4247,9 +4265,9 @@ const serializeAws_json1_1IntegerHyperParameterRange = ( context: __SerdeContext ): any => { return { - ...(input.maxValue !== undefined && { maxValue: input.maxValue }), - ...(input.minValue !== undefined && { minValue: input.minValue }), - ...(input.name !== undefined && { name: input.name }), + ...(input.maxValue !== undefined && input.maxValue !== null && { maxValue: input.maxValue }), + ...(input.minValue !== undefined && input.minValue !== null && { minValue: input.minValue }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -4257,7 +4275,14 @@ const serializeAws_json1_1IntegerHyperParameterRanges = ( input: IntegerHyperParameterRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1IntegerHyperParameterRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1IntegerHyperParameterRange(entry, context); + }); }; const serializeAws_json1_1ListBatchInferenceJobsRequest = ( @@ -4265,17 +4290,18 @@ const serializeAws_json1_1ListBatchInferenceJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.solutionVersionArn !== undefined && { solutionVersionArn: input.solutionVersionArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.solutionVersionArn !== undefined && + input.solutionVersionArn !== null && { solutionVersionArn: input.solutionVersionArn }), }; }; const serializeAws_json1_1ListCampaignsRequest = (input: ListCampaignsRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.solutionArn !== undefined && input.solutionArn !== null && { solutionArn: input.solutionArn }), }; }; @@ -4284,8 +4310,8 @@ const serializeAws_json1_1ListDatasetGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4294,17 +4320,18 @@ const serializeAws_json1_1ListDatasetImportJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.datasetArn !== undefined && { datasetArn: input.datasetArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListDatasetsRequest = (input: ListDatasetsRequest, context: __SerdeContext): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4313,40 +4340,44 @@ const serializeAws_json1_1ListEventTrackersRequest = ( context: __SerdeContext ): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListFiltersRequest = (input: ListFiltersRequest, context: __SerdeContext): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListRecipesRequest = (input: ListRecipesRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.recipeProvider !== undefined && { recipeProvider: input.recipeProvider }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.recipeProvider !== undefined && + input.recipeProvider !== null && { recipeProvider: input.recipeProvider }), }; }; const serializeAws_json1_1ListSchemasRequest = (input: ListSchemasRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1ListSolutionsRequest = (input: ListSolutionsRequest, context: __SerdeContext): any => { return { - ...(input.datasetGroupArn !== undefined && { datasetGroupArn: input.datasetGroupArn }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.datasetGroupArn !== undefined && + input.datasetGroupArn !== null && { datasetGroupArn: input.datasetGroupArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4355,46 +4386,52 @@ const serializeAws_json1_1ListSolutionVersionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.solutionArn !== undefined && input.solutionArn !== null && { solutionArn: input.solutionArn }), }; }; const serializeAws_json1_1S3DataConfig = (input: S3DataConfig, context: __SerdeContext): any => { return { - ...(input.kmsKeyArn !== undefined && { kmsKeyArn: input.kmsKeyArn }), - ...(input.path !== undefined && { path: input.path }), + ...(input.kmsKeyArn !== undefined && input.kmsKeyArn !== null && { kmsKeyArn: input.kmsKeyArn }), + ...(input.path !== undefined && input.path !== null && { path: input.path }), }; }; const serializeAws_json1_1SolutionConfig = (input: SolutionConfig, context: __SerdeContext): any => { return { - ...(input.algorithmHyperParameters !== undefined && { - algorithmHyperParameters: serializeAws_json1_1HyperParameters(input.algorithmHyperParameters, context), - }), - ...(input.autoMLConfig !== undefined && { - autoMLConfig: serializeAws_json1_1AutoMLConfig(input.autoMLConfig, context), - }), - ...(input.eventValueThreshold !== undefined && { eventValueThreshold: input.eventValueThreshold }), - ...(input.featureTransformationParameters !== undefined && { - featureTransformationParameters: serializeAws_json1_1FeatureTransformationParameters( - input.featureTransformationParameters, - context - ), - }), - ...(input.hpoConfig !== undefined && { hpoConfig: serializeAws_json1_1HPOConfig(input.hpoConfig, context) }), + ...(input.algorithmHyperParameters !== undefined && + input.algorithmHyperParameters !== null && { + algorithmHyperParameters: serializeAws_json1_1HyperParameters(input.algorithmHyperParameters, context), + }), + ...(input.autoMLConfig !== undefined && + input.autoMLConfig !== null && { autoMLConfig: serializeAws_json1_1AutoMLConfig(input.autoMLConfig, context) }), + ...(input.eventValueThreshold !== undefined && + input.eventValueThreshold !== null && { eventValueThreshold: input.eventValueThreshold }), + ...(input.featureTransformationParameters !== undefined && + input.featureTransformationParameters !== null && { + featureTransformationParameters: serializeAws_json1_1FeatureTransformationParameters( + input.featureTransformationParameters, + context + ), + }), + ...(input.hpoConfig !== undefined && + input.hpoConfig !== null && { hpoConfig: serializeAws_json1_1HPOConfig(input.hpoConfig, context) }), }; }; const serializeAws_json1_1UpdateCampaignRequest = (input: UpdateCampaignRequest, context: __SerdeContext): any => { return { - ...(input.campaignArn !== undefined && { campaignArn: input.campaignArn }), - ...(input.campaignConfig !== undefined && { - campaignConfig: serializeAws_json1_1CampaignConfig(input.campaignConfig, context), - }), - ...(input.minProvisionedTPS !== undefined && { minProvisionedTPS: input.minProvisionedTPS }), - ...(input.solutionVersionArn !== undefined && { solutionVersionArn: input.solutionVersionArn }), + ...(input.campaignArn !== undefined && input.campaignArn !== null && { campaignArn: input.campaignArn }), + ...(input.campaignConfig !== undefined && + input.campaignConfig !== null && { + campaignConfig: serializeAws_json1_1CampaignConfig(input.campaignConfig, context), + }), + ...(input.minProvisionedTPS !== undefined && + input.minProvisionedTPS !== null && { minProvisionedTPS: input.minProvisionedTPS }), + ...(input.solutionVersionArn !== undefined && + input.solutionVersionArn !== null && { solutionVersionArn: input.solutionVersionArn }), }; }; @@ -4442,7 +4479,14 @@ const deserializeAws_json1_1AlgorithmImage = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AutoMLConfig = (output: any, context: __SerdeContext): AutoMLConfig => { @@ -4536,7 +4580,14 @@ const deserializeAws_json1_1BatchInferenceJobOutput = ( }; const deserializeAws_json1_1BatchInferenceJobs = (output: any, context: __SerdeContext): BatchInferenceJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BatchInferenceJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BatchInferenceJobSummary(entry, context); + }); }; const deserializeAws_json1_1BatchInferenceJobSummary = ( @@ -4611,7 +4662,14 @@ const deserializeAws_json1_1CampaignConfig = (output: any, context: __SerdeConte }; const deserializeAws_json1_1Campaigns = (output: any, context: __SerdeContext): CampaignSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CampaignSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CampaignSummary(entry, context); + }); }; const deserializeAws_json1_1CampaignSummary = (output: any, context: __SerdeContext): CampaignSummary => { @@ -4677,11 +4735,25 @@ const deserializeAws_json1_1CategoricalHyperParameterRanges = ( output: any, context: __SerdeContext ): CategoricalHyperParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CategoricalHyperParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CategoricalHyperParameterRange(entry, context); + }); }; const deserializeAws_json1_1CategoricalValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ContinuousHyperParameterRange = ( @@ -4699,7 +4771,14 @@ const deserializeAws_json1_1ContinuousHyperParameterRanges = ( output: any, context: __SerdeContext ): ContinuousHyperParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContinuousHyperParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContinuousHyperParameterRange(entry, context); + }); }; const deserializeAws_json1_1CreateBatchInferenceJobResponse = ( @@ -4831,7 +4910,14 @@ const deserializeAws_json1_1DatasetGroup = (output: any, context: __SerdeContext }; const deserializeAws_json1_1DatasetGroups = (output: any, context: __SerdeContext): DatasetGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DatasetGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DatasetGroupSummary(entry, context); + }); }; const deserializeAws_json1_1DatasetGroupSummary = (output: any, context: __SerdeContext): DatasetGroupSummary => { @@ -4881,7 +4967,14 @@ const deserializeAws_json1_1DatasetImportJob = (output: any, context: __SerdeCon }; const deserializeAws_json1_1DatasetImportJobs = (output: any, context: __SerdeContext): DatasetImportJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DatasetImportJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DatasetImportJobSummary(entry, context); + }); }; const deserializeAws_json1_1DatasetImportJobSummary = ( @@ -4909,7 +5002,14 @@ const deserializeAws_json1_1DatasetImportJobSummary = ( }; const deserializeAws_json1_1Datasets = (output: any, context: __SerdeContext): DatasetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DatasetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DatasetSummary(entry, context); + }); }; const deserializeAws_json1_1DatasetSchema = (output: any, context: __SerdeContext): DatasetSchema => { @@ -4984,9 +5084,14 @@ const deserializeAws_json1_1DefaultCategoricalHyperParameterRanges = ( output: any, context: __SerdeContext ): DefaultCategoricalHyperParameterRange[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1DefaultCategoricalHyperParameterRange(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DefaultCategoricalHyperParameterRange(entry, context); + }); }; const deserializeAws_json1_1DefaultContinuousHyperParameterRange = ( @@ -5005,7 +5110,14 @@ const deserializeAws_json1_1DefaultContinuousHyperParameterRanges = ( output: any, context: __SerdeContext ): DefaultContinuousHyperParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DefaultContinuousHyperParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DefaultContinuousHyperParameterRange(entry, context); + }); }; const deserializeAws_json1_1DefaultHyperParameterRanges = ( @@ -5044,7 +5156,14 @@ const deserializeAws_json1_1DefaultIntegerHyperParameterRanges = ( output: any, context: __SerdeContext ): DefaultIntegerHyperParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DefaultIntegerHyperParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DefaultIntegerHyperParameterRange(entry, context); + }); }; const deserializeAws_json1_1DescribeAlgorithmResponse = ( @@ -5216,7 +5335,14 @@ const deserializeAws_json1_1EventTracker = (output: any, context: __SerdeContext }; const deserializeAws_json1_1EventTrackers = (output: any, context: __SerdeContext): EventTrackerSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventTrackerSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventTrackerSummary(entry, context); + }); }; const deserializeAws_json1_1EventTrackerSummary = (output: any, context: __SerdeContext): EventTrackerSummary => { @@ -5263,26 +5389,30 @@ const deserializeAws_json1_1FeatureTransformationParameters = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1FeaturizationParameters = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Filter = (output: any, context: __SerdeContext): Filter => { @@ -5308,7 +5438,14 @@ const deserializeAws_json1_1Filter = (output: any, context: __SerdeContext): Fil }; const deserializeAws_json1_1Filters = (output: any, context: __SerdeContext): FilterSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FilterSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FilterSummary(entry, context); + }); }; const deserializeAws_json1_1FilterSummary = (output: any, context: __SerdeContext): FilterSummary => { @@ -5403,13 +5540,15 @@ const deserializeAws_json1_1HyperParameterRanges = (output: any, context: __Serd }; const deserializeAws_json1_1HyperParameters = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1IntegerHyperParameterRange = ( @@ -5427,7 +5566,14 @@ const deserializeAws_json1_1IntegerHyperParameterRanges = ( output: any, context: __SerdeContext ): IntegerHyperParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IntegerHyperParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IntegerHyperParameterRange(entry, context); + }); }; const deserializeAws_json1_1InvalidInputException = (output: any, context: __SerdeContext): InvalidInputException => { @@ -5577,13 +5723,15 @@ const deserializeAws_json1_1ListSolutionVersionsResponse = ( }; const deserializeAws_json1_1Metrics = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Recipe = (output: any, context: __SerdeContext): Recipe => { @@ -5610,7 +5758,14 @@ const deserializeAws_json1_1Recipe = (output: any, context: __SerdeContext): Rec }; const deserializeAws_json1_1Recipes = (output: any, context: __SerdeContext): RecipeSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RecipeSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RecipeSummary(entry, context); + }); }; const deserializeAws_json1_1RecipeSummary = (output: any, context: __SerdeContext): RecipeSummary => { @@ -5639,13 +5794,15 @@ const deserializeAws_json1_1ResourceAlreadyExistsException = ( }; const deserializeAws_json1_1ResourceConfig = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ResourceInUseException = (output: any, context: __SerdeContext): ResourceInUseException => { @@ -5671,7 +5828,14 @@ const deserializeAws_json1_1S3DataConfig = (output: any, context: __SerdeContext }; const deserializeAws_json1_1Schemas = (output: any, context: __SerdeContext): DatasetSchemaSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DatasetSchemaSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DatasetSchemaSummary(entry, context); + }); }; const deserializeAws_json1_1Solution = (output: any, context: __SerdeContext): Solution => { @@ -5735,7 +5899,14 @@ const deserializeAws_json1_1SolutionConfig = (output: any, context: __SerdeConte }; const deserializeAws_json1_1Solutions = (output: any, context: __SerdeContext): SolutionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SolutionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SolutionSummary(entry, context); + }); }; const deserializeAws_json1_1SolutionSummary = (output: any, context: __SerdeContext): SolutionSummary => { @@ -5794,7 +5965,14 @@ const deserializeAws_json1_1SolutionVersion = (output: any, context: __SerdeCont }; const deserializeAws_json1_1SolutionVersions = (output: any, context: __SerdeContext): SolutionVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SolutionVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SolutionVersionSummary(entry, context); + }); }; const deserializeAws_json1_1SolutionVersionSummary = (output: any, context: __SerdeContext): SolutionVersionSummary => { @@ -5882,3 +6060,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-pi/protocols/Aws_json1_1.ts b/clients/client-pi/protocols/Aws_json1_1.ts index 02bcc8c22dfb..7091b502a6ee 100644 --- a/clients/client-pi/protocols/Aws_json1_1.ts +++ b/clients/client-pi/protocols/Aws_json1_1.ts @@ -34,7 +34,7 @@ export const serializeAws_json1_1DescribeDimensionKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PerformanceInsightsv20180227.DescribeDimensionKeys", }; let body: any; @@ -47,7 +47,7 @@ export const serializeAws_json1_1GetResourceMetricsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "PerformanceInsightsv20180227.GetResourceMetrics", }; let body: any; @@ -82,8 +82,7 @@ const deserializeAws_json1_1DescribeDimensionKeysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.pi#InternalServiceError": @@ -153,8 +152,7 @@ const deserializeAws_json1_1GetResourceMetricsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.pi#InternalServiceError": @@ -247,27 +245,32 @@ const serializeAws_json1_1DescribeDimensionKeysRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1MetricQueryFilterMap(input.Filter, context) }), - ...(input.GroupBy !== undefined && { GroupBy: serializeAws_json1_1DimensionGroup(input.GroupBy, context) }), - ...(input.Identifier !== undefined && { Identifier: input.Identifier }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Metric !== undefined && { Metric: input.Metric }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PartitionBy !== undefined && { - PartitionBy: serializeAws_json1_1DimensionGroup(input.PartitionBy, context), - }), - ...(input.PeriodInSeconds !== undefined && { PeriodInSeconds: input.PeriodInSeconds }), - ...(input.ServiceType !== undefined && { ServiceType: input.ServiceType }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1MetricQueryFilterMap(input.Filter, context) }), + ...(input.GroupBy !== undefined && + input.GroupBy !== null && { GroupBy: serializeAws_json1_1DimensionGroup(input.GroupBy, context) }), + ...(input.Identifier !== undefined && input.Identifier !== null && { Identifier: input.Identifier }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Metric !== undefined && input.Metric !== null && { Metric: input.Metric }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PartitionBy !== undefined && + input.PartitionBy !== null && { PartitionBy: serializeAws_json1_1DimensionGroup(input.PartitionBy, context) }), + ...(input.PeriodInSeconds !== undefined && + input.PeriodInSeconds !== null && { PeriodInSeconds: input.PeriodInSeconds }), + ...(input.ServiceType !== undefined && input.ServiceType !== null && { ServiceType: input.ServiceType }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1DimensionGroup = (input: DimensionGroup, context: __SerdeContext): any => { return { - ...(input.Dimensions !== undefined && { Dimensions: serializeAws_json1_1StringList(input.Dimensions, context) }), - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_json1_1StringList(input.Dimensions, context) }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), }; }; @@ -276,43 +279,65 @@ const serializeAws_json1_1GetResourceMetricsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.Identifier !== undefined && { Identifier: input.Identifier }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MetricQueries !== undefined && { - MetricQueries: serializeAws_json1_1MetricQueryList(input.MetricQueries, context), - }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PeriodInSeconds !== undefined && { PeriodInSeconds: input.PeriodInSeconds }), - ...(input.ServiceType !== undefined && { ServiceType: input.ServiceType }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.Identifier !== undefined && input.Identifier !== null && { Identifier: input.Identifier }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MetricQueries !== undefined && + input.MetricQueries !== null && { + MetricQueries: serializeAws_json1_1MetricQueryList(input.MetricQueries, context), + }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PeriodInSeconds !== undefined && + input.PeriodInSeconds !== null && { PeriodInSeconds: input.PeriodInSeconds }), + ...(input.ServiceType !== undefined && input.ServiceType !== null && { ServiceType: input.ServiceType }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1MetricQuery = (input: MetricQuery, context: __SerdeContext): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1MetricQueryFilterMap(input.Filter, context) }), - ...(input.GroupBy !== undefined && { GroupBy: serializeAws_json1_1DimensionGroup(input.GroupBy, context) }), - ...(input.Metric !== undefined && { Metric: input.Metric }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1MetricQueryFilterMap(input.Filter, context) }), + ...(input.GroupBy !== undefined && + input.GroupBy !== null && { GroupBy: serializeAws_json1_1DimensionGroup(input.GroupBy, context) }), + ...(input.Metric !== undefined && input.Metric !== null && { Metric: input.Metric }), }; }; const serializeAws_json1_1MetricQueryFilterMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1MetricQueryList = (input: MetricQuery[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MetricQuery(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MetricQuery(entry, context); + }); }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DataPoint = (output: any, context: __SerdeContext): DataPoint => { @@ -326,7 +351,14 @@ const deserializeAws_json1_1DataPoint = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1DataPointsList = (output: any, context: __SerdeContext): DataPoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DataPoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DataPoint(entry, context); + }); }; const deserializeAws_json1_1DescribeDimensionKeysResponse = ( @@ -375,17 +407,26 @@ const deserializeAws_json1_1DimensionKeyDescriptionList = ( output: any, context: __SerdeContext ): DimensionKeyDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DimensionKeyDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DimensionKeyDescription(entry, context); + }); }; const deserializeAws_json1_1DimensionMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1GetResourceMetricsResponse = ( @@ -439,11 +480,25 @@ const deserializeAws_json1_1MetricKeyDataPoints = (output: any, context: __Serde }; const deserializeAws_json1_1MetricKeyDataPointsList = (output: any, context: __SerdeContext): MetricKeyDataPoints[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricKeyDataPoints(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricKeyDataPoints(entry, context); + }); }; const deserializeAws_json1_1MetricValuesList = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NotAuthorizedException = (output: any, context: __SerdeContext): NotAuthorizedException => { @@ -465,7 +520,14 @@ const deserializeAws_json1_1ResponsePartitionKeyList = ( output: any, context: __SerdeContext ): ResponsePartitionKey[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResponsePartitionKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResponsePartitionKey(entry, context); + }); }; const deserializeAws_json1_1ResponseResourceMetricKey = ( @@ -531,3 +593,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-pinpoint-email/protocols/Aws_restJson1.ts b/clients/client-pinpoint-email/protocols/Aws_restJson1.ts index 346a0f13d0ac..5ea1e97ca993 100644 --- a/clients/client-pinpoint-email/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-email/protocols/Aws_restJson1.ts @@ -211,25 +211,31 @@ export const serializeAws_restJson1CreateConfigurationSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/configuration-sets"; let body: any; body = JSON.stringify({ - ...(input.ConfigurationSetName !== undefined && { ConfigurationSetName: input.ConfigurationSetName }), - ...(input.DeliveryOptions !== undefined && { - DeliveryOptions: serializeAws_restJson1DeliveryOptions(input.DeliveryOptions, context), - }), - ...(input.ReputationOptions !== undefined && { - ReputationOptions: serializeAws_restJson1ReputationOptions(input.ReputationOptions, context), - }), - ...(input.SendingOptions !== undefined && { - SendingOptions: serializeAws_restJson1SendingOptions(input.SendingOptions, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.TrackingOptions !== undefined && { - TrackingOptions: serializeAws_restJson1TrackingOptions(input.TrackingOptions, context), - }), + ...(input.ConfigurationSetName !== undefined && + input.ConfigurationSetName !== null && { ConfigurationSetName: input.ConfigurationSetName }), + ...(input.DeliveryOptions !== undefined && + input.DeliveryOptions !== null && { + DeliveryOptions: serializeAws_restJson1DeliveryOptions(input.DeliveryOptions, context), + }), + ...(input.ReputationOptions !== undefined && + input.ReputationOptions !== null && { + ReputationOptions: serializeAws_restJson1ReputationOptions(input.ReputationOptions, context), + }), + ...(input.SendingOptions !== undefined && + input.SendingOptions !== null && { + SendingOptions: serializeAws_restJson1SendingOptions(input.SendingOptions, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.TrackingOptions !== undefined && + input.TrackingOptions !== null && { + TrackingOptions: serializeAws_restJson1TrackingOptions(input.TrackingOptions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -248,7 +254,7 @@ export const serializeAws_restJson1CreateConfigurationSetEventDestinationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations"; if (input.ConfigurationSetName !== undefined) { @@ -262,10 +268,12 @@ export const serializeAws_restJson1CreateConfigurationSetEventDestinationCommand } let body: any; body = JSON.stringify({ - ...(input.EventDestination !== undefined && { - EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), - }), - ...(input.EventDestinationName !== undefined && { EventDestinationName: input.EventDestinationName }), + ...(input.EventDestination !== undefined && + input.EventDestination !== null && { + EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), + }), + ...(input.EventDestinationName !== undefined && + input.EventDestinationName !== null && { EventDestinationName: input.EventDestinationName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -284,13 +292,14 @@ export const serializeAws_restJson1CreateDedicatedIpPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/dedicated-ip-pools"; let body: any; body = JSON.stringify({ - ...(input.PoolName !== undefined && { PoolName: input.PoolName }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.PoolName !== undefined && input.PoolName !== null && { PoolName: input.PoolName }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -309,15 +318,18 @@ export const serializeAws_restJson1CreateDeliverabilityTestReportCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/deliverability-dashboard/test"; let body: any; body = JSON.stringify({ - ...(input.Content !== undefined && { Content: serializeAws_restJson1EmailContent(input.Content, context) }), - ...(input.FromEmailAddress !== undefined && { FromEmailAddress: input.FromEmailAddress }), - ...(input.ReportName !== undefined && { ReportName: input.ReportName }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Content !== undefined && + input.Content !== null && { Content: serializeAws_restJson1EmailContent(input.Content, context) }), + ...(input.FromEmailAddress !== undefined && + input.FromEmailAddress !== null && { FromEmailAddress: input.FromEmailAddress }), + ...(input.ReportName !== undefined && input.ReportName !== null && { ReportName: input.ReportName }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -336,13 +348,14 @@ export const serializeAws_restJson1CreateEmailIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/identities"; let body: any; body = JSON.stringify({ - ...(input.EmailIdentity !== undefined && { EmailIdentity: input.EmailIdentity }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.EmailIdentity !== undefined && input.EmailIdentity !== null && { EmailIdentity: input.EmailIdentity }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -360,9 +373,7 @@ export const serializeAws_restJson1DeleteConfigurationSetCommand = async ( input: DeleteConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -390,9 +401,7 @@ export const serializeAws_restJson1DeleteConfigurationSetEventDestinationCommand input: DeleteConfigurationSetEventDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -429,9 +438,7 @@ export const serializeAws_restJson1DeleteDedicatedIpPoolCommand = async ( input: DeleteDedicatedIpPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/dedicated-ip-pools/{PoolName}"; if (input.PoolName !== undefined) { const labelValue: string = input.PoolName; @@ -459,9 +466,7 @@ export const serializeAws_restJson1DeleteEmailIdentityCommand = async ( input: DeleteEmailIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/identities/{EmailIdentity}"; if (input.EmailIdentity !== undefined) { const labelValue: string = input.EmailIdentity; @@ -489,12 +494,10 @@ export const serializeAws_restJson1GetAccountCommand = async ( input: GetAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/account"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -511,9 +514,7 @@ export const serializeAws_restJson1GetBlacklistReportsCommand = async ( input: GetBlacklistReportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/deliverability-dashboard/blacklist-report"; const query: any = { ...(input.BlacklistItemNames !== undefined && { @@ -538,9 +539,7 @@ export const serializeAws_restJson1GetConfigurationSetCommand = async ( input: GetConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -568,9 +567,7 @@ export const serializeAws_restJson1GetConfigurationSetEventDestinationsCommand = input: GetConfigurationSetEventDestinationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -598,9 +595,7 @@ export const serializeAws_restJson1GetDedicatedIpCommand = async ( input: GetDedicatedIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/dedicated-ips/{Ip}"; if (input.Ip !== undefined) { const labelValue: string = input.Ip; @@ -628,9 +623,7 @@ export const serializeAws_restJson1GetDedicatedIpsCommand = async ( input: GetDedicatedIpsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/dedicated-ips"; const query: any = { ...(input.PoolName !== undefined && { PoolName: input.PoolName }), @@ -655,12 +648,10 @@ export const serializeAws_restJson1GetDeliverabilityDashboardOptionsCommand = as input: GetDeliverabilityDashboardOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/deliverability-dashboard"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -677,9 +668,7 @@ export const serializeAws_restJson1GetDeliverabilityTestReportCommand = async ( input: GetDeliverabilityTestReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/deliverability-dashboard/test-reports/{ReportId}"; if (input.ReportId !== undefined) { const labelValue: string = input.ReportId; @@ -707,9 +696,7 @@ export const serializeAws_restJson1GetDomainDeliverabilityCampaignCommand = asyn input: GetDomainDeliverabilityCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/deliverability-dashboard/campaigns/{CampaignId}"; if (input.CampaignId !== undefined) { const labelValue: string = input.CampaignId; @@ -737,9 +724,7 @@ export const serializeAws_restJson1GetDomainStatisticsReportCommand = async ( input: GetDomainStatisticsReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/deliverability-dashboard/statistics-report/{Domain}"; if (input.Domain !== undefined) { const labelValue: string = input.Domain; @@ -772,9 +757,7 @@ export const serializeAws_restJson1GetEmailIdentityCommand = async ( input: GetEmailIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/identities/{EmailIdentity}"; if (input.EmailIdentity !== undefined) { const labelValue: string = input.EmailIdentity; @@ -802,9 +785,7 @@ export const serializeAws_restJson1ListConfigurationSetsCommand = async ( input: ListConfigurationSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/configuration-sets"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -828,9 +809,7 @@ export const serializeAws_restJson1ListDedicatedIpPoolsCommand = async ( input: ListDedicatedIpPoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/dedicated-ip-pools"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -854,9 +833,7 @@ export const serializeAws_restJson1ListDeliverabilityTestReportsCommand = async input: ListDeliverabilityTestReportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/deliverability-dashboard/test-reports"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -880,9 +857,7 @@ export const serializeAws_restJson1ListDomainDeliverabilityCampaignsCommand = as input: ListDomainDeliverabilityCampaignsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/deliverability-dashboard/domains/{SubscribedDomain}/campaigns"; if (input.SubscribedDomain !== undefined) { const labelValue: string = input.SubscribedDomain; @@ -917,9 +892,7 @@ export const serializeAws_restJson1ListEmailIdentitiesCommand = async ( input: ListEmailIdentitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/identities"; const query: any = { ...(input.PageSize !== undefined && { PageSize: input.PageSize.toString() }), @@ -943,9 +916,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/tags"; const query: any = { ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), @@ -969,12 +940,13 @@ export const serializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/account/dedicated-ips/warmup"; let body: any; body = JSON.stringify({ - ...(input.AutoWarmupEnabled !== undefined && { AutoWarmupEnabled: input.AutoWarmupEnabled }), + ...(input.AutoWarmupEnabled !== undefined && + input.AutoWarmupEnabled !== null && { AutoWarmupEnabled: input.AutoWarmupEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -993,12 +965,13 @@ export const serializeAws_restJson1PutAccountSendingAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/account/sending"; let body: any; body = JSON.stringify({ - ...(input.SendingEnabled !== undefined && { SendingEnabled: input.SendingEnabled }), + ...(input.SendingEnabled !== undefined && + input.SendingEnabled !== null && { SendingEnabled: input.SendingEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1017,7 +990,7 @@ export const serializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}/delivery-options"; if (input.ConfigurationSetName !== undefined) { @@ -1031,8 +1004,9 @@ export const serializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = a } let body: any; body = JSON.stringify({ - ...(input.SendingPoolName !== undefined && { SendingPoolName: input.SendingPoolName }), - ...(input.TlsPolicy !== undefined && { TlsPolicy: input.TlsPolicy }), + ...(input.SendingPoolName !== undefined && + input.SendingPoolName !== null && { SendingPoolName: input.SendingPoolName }), + ...(input.TlsPolicy !== undefined && input.TlsPolicy !== null && { TlsPolicy: input.TlsPolicy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1051,7 +1025,7 @@ export const serializeAws_restJson1PutConfigurationSetReputationOptionsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}/reputation-options"; if (input.ConfigurationSetName !== undefined) { @@ -1065,7 +1039,8 @@ export const serializeAws_restJson1PutConfigurationSetReputationOptionsCommand = } let body: any; body = JSON.stringify({ - ...(input.ReputationMetricsEnabled !== undefined && { ReputationMetricsEnabled: input.ReputationMetricsEnabled }), + ...(input.ReputationMetricsEnabled !== undefined && + input.ReputationMetricsEnabled !== null && { ReputationMetricsEnabled: input.ReputationMetricsEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1084,7 +1059,7 @@ export const serializeAws_restJson1PutConfigurationSetSendingOptionsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}/sending"; if (input.ConfigurationSetName !== undefined) { @@ -1098,7 +1073,8 @@ export const serializeAws_restJson1PutConfigurationSetSendingOptionsCommand = as } let body: any; body = JSON.stringify({ - ...(input.SendingEnabled !== undefined && { SendingEnabled: input.SendingEnabled }), + ...(input.SendingEnabled !== undefined && + input.SendingEnabled !== null && { SendingEnabled: input.SendingEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1117,7 +1093,7 @@ export const serializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}/tracking-options"; if (input.ConfigurationSetName !== undefined) { @@ -1131,7 +1107,8 @@ export const serializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = a } let body: any; body = JSON.stringify({ - ...(input.CustomRedirectDomain !== undefined && { CustomRedirectDomain: input.CustomRedirectDomain }), + ...(input.CustomRedirectDomain !== undefined && + input.CustomRedirectDomain !== null && { CustomRedirectDomain: input.CustomRedirectDomain }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1150,7 +1127,7 @@ export const serializeAws_restJson1PutDedicatedIpInPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/dedicated-ips/{Ip}/pool"; if (input.Ip !== undefined) { @@ -1164,7 +1141,8 @@ export const serializeAws_restJson1PutDedicatedIpInPoolCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DestinationPoolName !== undefined && { DestinationPoolName: input.DestinationPoolName }), + ...(input.DestinationPoolName !== undefined && + input.DestinationPoolName !== null && { DestinationPoolName: input.DestinationPoolName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1183,7 +1161,7 @@ export const serializeAws_restJson1PutDedicatedIpWarmupAttributesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/dedicated-ips/{Ip}/warmup"; if (input.Ip !== undefined) { @@ -1197,7 +1175,8 @@ export const serializeAws_restJson1PutDedicatedIpWarmupAttributesCommand = async } let body: any; body = JSON.stringify({ - ...(input.WarmupPercentage !== undefined && { WarmupPercentage: input.WarmupPercentage }), + ...(input.WarmupPercentage !== undefined && + input.WarmupPercentage !== null && { WarmupPercentage: input.WarmupPercentage }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1216,15 +1195,17 @@ export const serializeAws_restJson1PutDeliverabilityDashboardOptionCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/deliverability-dashboard"; let body: any; body = JSON.stringify({ - ...(input.DashboardEnabled !== undefined && { DashboardEnabled: input.DashboardEnabled }), - ...(input.SubscribedDomains !== undefined && { - SubscribedDomains: serializeAws_restJson1DomainDeliverabilityTrackingOptions(input.SubscribedDomains, context), - }), + ...(input.DashboardEnabled !== undefined && + input.DashboardEnabled !== null && { DashboardEnabled: input.DashboardEnabled }), + ...(input.SubscribedDomains !== undefined && + input.SubscribedDomains !== null && { + SubscribedDomains: serializeAws_restJson1DomainDeliverabilityTrackingOptions(input.SubscribedDomains, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1243,7 +1224,7 @@ export const serializeAws_restJson1PutEmailIdentityDkimAttributesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/identities/{EmailIdentity}/dkim"; if (input.EmailIdentity !== undefined) { @@ -1257,7 +1238,8 @@ export const serializeAws_restJson1PutEmailIdentityDkimAttributesCommand = async } let body: any; body = JSON.stringify({ - ...(input.SigningEnabled !== undefined && { SigningEnabled: input.SigningEnabled }), + ...(input.SigningEnabled !== undefined && + input.SigningEnabled !== null && { SigningEnabled: input.SigningEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1276,7 +1258,7 @@ export const serializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/identities/{EmailIdentity}/feedback"; if (input.EmailIdentity !== undefined) { @@ -1290,7 +1272,8 @@ export const serializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = a } let body: any; body = JSON.stringify({ - ...(input.EmailForwardingEnabled !== undefined && { EmailForwardingEnabled: input.EmailForwardingEnabled }), + ...(input.EmailForwardingEnabled !== undefined && + input.EmailForwardingEnabled !== null && { EmailForwardingEnabled: input.EmailForwardingEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1309,7 +1292,7 @@ export const serializeAws_restJson1PutEmailIdentityMailFromAttributesCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/identities/{EmailIdentity}/mail-from"; if (input.EmailIdentity !== undefined) { @@ -1323,8 +1306,10 @@ export const serializeAws_restJson1PutEmailIdentityMailFromAttributesCommand = a } let body: any; body = JSON.stringify({ - ...(input.BehaviorOnMxFailure !== undefined && { BehaviorOnMxFailure: input.BehaviorOnMxFailure }), - ...(input.MailFromDomain !== undefined && { MailFromDomain: input.MailFromDomain }), + ...(input.BehaviorOnMxFailure !== undefined && + input.BehaviorOnMxFailure !== null && { BehaviorOnMxFailure: input.BehaviorOnMxFailure }), + ...(input.MailFromDomain !== undefined && + input.MailFromDomain !== null && { MailFromDomain: input.MailFromDomain }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1343,24 +1328,29 @@ export const serializeAws_restJson1SendEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/outbound-emails"; let body: any; body = JSON.stringify({ - ...(input.ConfigurationSetName !== undefined && { ConfigurationSetName: input.ConfigurationSetName }), - ...(input.Content !== undefined && { Content: serializeAws_restJson1EmailContent(input.Content, context) }), - ...(input.Destination !== undefined && { - Destination: serializeAws_restJson1Destination(input.Destination, context), - }), - ...(input.EmailTags !== undefined && { EmailTags: serializeAws_restJson1MessageTagList(input.EmailTags, context) }), - ...(input.FeedbackForwardingEmailAddress !== undefined && { - FeedbackForwardingEmailAddress: input.FeedbackForwardingEmailAddress, - }), - ...(input.FromEmailAddress !== undefined && { FromEmailAddress: input.FromEmailAddress }), - ...(input.ReplyToAddresses !== undefined && { - ReplyToAddresses: serializeAws_restJson1EmailAddressList(input.ReplyToAddresses, context), - }), + ...(input.ConfigurationSetName !== undefined && + input.ConfigurationSetName !== null && { ConfigurationSetName: input.ConfigurationSetName }), + ...(input.Content !== undefined && + input.Content !== null && { Content: serializeAws_restJson1EmailContent(input.Content, context) }), + ...(input.Destination !== undefined && + input.Destination !== null && { Destination: serializeAws_restJson1Destination(input.Destination, context) }), + ...(input.EmailTags !== undefined && + input.EmailTags !== null && { EmailTags: serializeAws_restJson1MessageTagList(input.EmailTags, context) }), + ...(input.FeedbackForwardingEmailAddress !== undefined && + input.FeedbackForwardingEmailAddress !== null && { + FeedbackForwardingEmailAddress: input.FeedbackForwardingEmailAddress, + }), + ...(input.FromEmailAddress !== undefined && + input.FromEmailAddress !== null && { FromEmailAddress: input.FromEmailAddress }), + ...(input.ReplyToAddresses !== undefined && + input.ReplyToAddresses !== null && { + ReplyToAddresses: serializeAws_restJson1EmailAddressList(input.ReplyToAddresses, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1379,13 +1369,14 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/tags"; let body: any; body = JSON.stringify({ - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1403,9 +1394,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/email/tags"; const query: any = { ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), @@ -1430,7 +1419,7 @@ export const serializeAws_restJson1UpdateConfigurationSetEventDestinationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"; if (input.EventDestinationName !== undefined) { @@ -1453,9 +1442,10 @@ export const serializeAws_restJson1UpdateConfigurationSetEventDestinationCommand } let body: any; body = JSON.stringify({ - ...(input.EventDestination !== undefined && { - EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), - }), + ...(input.EventDestination !== undefined && + input.EventDestination !== null && { + EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4841,19 +4831,22 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async ( const serializeAws_restJson1Body = (input: Body, context: __SerdeContext): any => { return { - ...(input.Html !== undefined && { Html: serializeAws_restJson1Content(input.Html, context) }), - ...(input.Text !== undefined && { Text: serializeAws_restJson1Content(input.Text, context) }), + ...(input.Html !== undefined && + input.Html !== null && { Html: serializeAws_restJson1Content(input.Html, context) }), + ...(input.Text !== undefined && + input.Text !== null && { Text: serializeAws_restJson1Content(input.Text, context) }), }; }; const serializeAws_restJson1CloudWatchDestination = (input: CloudWatchDestination, context: __SerdeContext): any => { return { - ...(input.DimensionConfigurations !== undefined && { - DimensionConfigurations: serializeAws_restJson1CloudWatchDimensionConfigurations( - input.DimensionConfigurations, - context - ), - }), + ...(input.DimensionConfigurations !== undefined && + input.DimensionConfigurations !== null && { + DimensionConfigurations: serializeAws_restJson1CloudWatchDimensionConfigurations( + input.DimensionConfigurations, + context + ), + }), }; }; @@ -4862,9 +4855,11 @@ const serializeAws_restJson1CloudWatchDimensionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DefaultDimensionValue !== undefined && { DefaultDimensionValue: input.DefaultDimensionValue }), - ...(input.DimensionName !== undefined && { DimensionName: input.DimensionName }), - ...(input.DimensionValueSource !== undefined && { DimensionValueSource: input.DimensionValueSource }), + ...(input.DefaultDimensionValue !== undefined && + input.DefaultDimensionValue !== null && { DefaultDimensionValue: input.DefaultDimensionValue }), + ...(input.DimensionName !== undefined && input.DimensionName !== null && { DimensionName: input.DimensionName }), + ...(input.DimensionValueSource !== undefined && + input.DimensionValueSource !== null && { DimensionValueSource: input.DimensionValueSource }), }; }; @@ -4872,34 +4867,45 @@ const serializeAws_restJson1CloudWatchDimensionConfigurations = ( input: CloudWatchDimensionConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CloudWatchDimensionConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CloudWatchDimensionConfiguration(entry, context); + }); }; const serializeAws_restJson1Content = (input: Content, context: __SerdeContext): any => { return { - ...(input.Charset !== undefined && { Charset: input.Charset }), - ...(input.Data !== undefined && { Data: input.Data }), + ...(input.Charset !== undefined && input.Charset !== null && { Charset: input.Charset }), + ...(input.Data !== undefined && input.Data !== null && { Data: input.Data }), }; }; const serializeAws_restJson1DeliveryOptions = (input: DeliveryOptions, context: __SerdeContext): any => { return { - ...(input.SendingPoolName !== undefined && { SendingPoolName: input.SendingPoolName }), - ...(input.TlsPolicy !== undefined && { TlsPolicy: input.TlsPolicy }), + ...(input.SendingPoolName !== undefined && + input.SendingPoolName !== null && { SendingPoolName: input.SendingPoolName }), + ...(input.TlsPolicy !== undefined && input.TlsPolicy !== null && { TlsPolicy: input.TlsPolicy }), }; }; const serializeAws_restJson1Destination = (input: Destination, context: __SerdeContext): any => { return { - ...(input.BccAddresses !== undefined && { - BccAddresses: serializeAws_restJson1EmailAddressList(input.BccAddresses, context), - }), - ...(input.CcAddresses !== undefined && { - CcAddresses: serializeAws_restJson1EmailAddressList(input.CcAddresses, context), - }), - ...(input.ToAddresses !== undefined && { - ToAddresses: serializeAws_restJson1EmailAddressList(input.ToAddresses, context), - }), + ...(input.BccAddresses !== undefined && + input.BccAddresses !== null && { + BccAddresses: serializeAws_restJson1EmailAddressList(input.BccAddresses, context), + }), + ...(input.CcAddresses !== undefined && + input.CcAddresses !== null && { + CcAddresses: serializeAws_restJson1EmailAddressList(input.CcAddresses, context), + }), + ...(input.ToAddresses !== undefined && + input.ToAddresses !== null && { + ToAddresses: serializeAws_restJson1EmailAddressList(input.ToAddresses, context), + }), }; }; @@ -4908,16 +4914,18 @@ const serializeAws_restJson1DomainDeliverabilityTrackingOption = ( context: __SerdeContext ): any => { return { - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.InboxPlacementTrackingOption !== undefined && { - InboxPlacementTrackingOption: serializeAws_restJson1InboxPlacementTrackingOption( - input.InboxPlacementTrackingOption, - context - ), - }), - ...(input.SubscriptionStartDate !== undefined && { - SubscriptionStartDate: Math.round(input.SubscriptionStartDate.getTime() / 1000), - }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.InboxPlacementTrackingOption !== undefined && + input.InboxPlacementTrackingOption !== null && { + InboxPlacementTrackingOption: serializeAws_restJson1InboxPlacementTrackingOption( + input.InboxPlacementTrackingOption, + context + ), + }), + ...(input.SubscriptionStartDate !== undefined && + input.SubscriptionStartDate !== null && { + SubscriptionStartDate: Math.round(input.SubscriptionStartDate.getTime() / 1000), + }), }; }; @@ -4925,18 +4933,34 @@ const serializeAws_restJson1DomainDeliverabilityTrackingOptions = ( input: DomainDeliverabilityTrackingOption[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context); + }); }; const serializeAws_restJson1EmailAddressList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1EmailContent = (input: EmailContent, context: __SerdeContext): any => { return { - ...(input.Raw !== undefined && { Raw: serializeAws_restJson1RawMessage(input.Raw, context) }), - ...(input.Simple !== undefined && { Simple: serializeAws_restJson1Message(input.Simple, context) }), - ...(input.Template !== undefined && { Template: serializeAws_restJson1Template(input.Template, context) }), + ...(input.Raw !== undefined && input.Raw !== null && { Raw: serializeAws_restJson1RawMessage(input.Raw, context) }), + ...(input.Simple !== undefined && + input.Simple !== null && { Simple: serializeAws_restJson1Message(input.Simple, context) }), + ...(input.Template !== undefined && + input.Template !== null && { Template: serializeAws_restJson1Template(input.Template, context) }), }; }; @@ -4945,30 +4969,42 @@ const serializeAws_restJson1EventDestinationDefinition = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchDestination !== undefined && { - CloudWatchDestination: serializeAws_restJson1CloudWatchDestination(input.CloudWatchDestination, context), - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.KinesisFirehoseDestination !== undefined && { - KinesisFirehoseDestination: serializeAws_restJson1KinesisFirehoseDestination( - input.KinesisFirehoseDestination, - context - ), - }), - ...(input.MatchingEventTypes !== undefined && { - MatchingEventTypes: serializeAws_restJson1EventTypes(input.MatchingEventTypes, context), - }), - ...(input.PinpointDestination !== undefined && { - PinpointDestination: serializeAws_restJson1PinpointDestination(input.PinpointDestination, context), - }), - ...(input.SnsDestination !== undefined && { - SnsDestination: serializeAws_restJson1SnsDestination(input.SnsDestination, context), - }), + ...(input.CloudWatchDestination !== undefined && + input.CloudWatchDestination !== null && { + CloudWatchDestination: serializeAws_restJson1CloudWatchDestination(input.CloudWatchDestination, context), + }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.KinesisFirehoseDestination !== undefined && + input.KinesisFirehoseDestination !== null && { + KinesisFirehoseDestination: serializeAws_restJson1KinesisFirehoseDestination( + input.KinesisFirehoseDestination, + context + ), + }), + ...(input.MatchingEventTypes !== undefined && + input.MatchingEventTypes !== null && { + MatchingEventTypes: serializeAws_restJson1EventTypes(input.MatchingEventTypes, context), + }), + ...(input.PinpointDestination !== undefined && + input.PinpointDestination !== null && { + PinpointDestination: serializeAws_restJson1PinpointDestination(input.PinpointDestination, context), + }), + ...(input.SnsDestination !== undefined && + input.SnsDestination !== null && { + SnsDestination: serializeAws_restJson1SnsDestination(input.SnsDestination, context), + }), }; }; const serializeAws_restJson1EventTypes = (input: (EventType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1InboxPlacementTrackingOption = ( @@ -4976,15 +5012,21 @@ const serializeAws_restJson1InboxPlacementTrackingOption = ( context: __SerdeContext ): any => { return { - ...(input.Global !== undefined && { Global: input.Global }), - ...(input.TrackedIsps !== undefined && { - TrackedIsps: serializeAws_restJson1IspNameList(input.TrackedIsps, context), - }), + ...(input.Global !== undefined && input.Global !== null && { Global: input.Global }), + ...(input.TrackedIsps !== undefined && + input.TrackedIsps !== null && { TrackedIsps: serializeAws_restJson1IspNameList(input.TrackedIsps, context) }), }; }; const serializeAws_restJson1IspNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1KinesisFirehoseDestination = ( @@ -4992,86 +5034,114 @@ const serializeAws_restJson1KinesisFirehoseDestination = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamArn !== undefined && { DeliveryStreamArn: input.DeliveryStreamArn }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), + ...(input.DeliveryStreamArn !== undefined && + input.DeliveryStreamArn !== null && { DeliveryStreamArn: input.DeliveryStreamArn }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), }; }; const serializeAws_restJson1Message = (input: Message, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: serializeAws_restJson1Body(input.Body, context) }), - ...(input.Subject !== undefined && { Subject: serializeAws_restJson1Content(input.Subject, context) }), + ...(input.Body !== undefined && input.Body !== null && { Body: serializeAws_restJson1Body(input.Body, context) }), + ...(input.Subject !== undefined && + input.Subject !== null && { Subject: serializeAws_restJson1Content(input.Subject, context) }), }; }; const serializeAws_restJson1MessageTag = (input: MessageTag, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1MessageTagList = (input: MessageTag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1MessageTag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MessageTag(entry, context); + }); }; const serializeAws_restJson1PinpointDestination = (input: PinpointDestination, context: __SerdeContext): any => { return { - ...(input.ApplicationArn !== undefined && { ApplicationArn: input.ApplicationArn }), + ...(input.ApplicationArn !== undefined && + input.ApplicationArn !== null && { ApplicationArn: input.ApplicationArn }), }; }; const serializeAws_restJson1RawMessage = (input: RawMessage, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }), + ...(input.Data !== undefined && input.Data !== null && { Data: context.base64Encoder(input.Data) }), }; }; const serializeAws_restJson1ReputationOptions = (input: ReputationOptions, context: __SerdeContext): any => { return { - ...(input.LastFreshStart !== undefined && { LastFreshStart: Math.round(input.LastFreshStart.getTime() / 1000) }), - ...(input.ReputationMetricsEnabled !== undefined && { ReputationMetricsEnabled: input.ReputationMetricsEnabled }), + ...(input.LastFreshStart !== undefined && + input.LastFreshStart !== null && { LastFreshStart: Math.round(input.LastFreshStart.getTime() / 1000) }), + ...(input.ReputationMetricsEnabled !== undefined && + input.ReputationMetricsEnabled !== null && { ReputationMetricsEnabled: input.ReputationMetricsEnabled }), }; }; const serializeAws_restJson1SendingOptions = (input: SendingOptions, context: __SerdeContext): any => { return { - ...(input.SendingEnabled !== undefined && { SendingEnabled: input.SendingEnabled }), + ...(input.SendingEnabled !== undefined && + input.SendingEnabled !== null && { SendingEnabled: input.SendingEnabled }), }; }; const serializeAws_restJson1SnsDestination = (input: SnsDestination, context: __SerdeContext): any => { return { - ...(input.TopicArn !== undefined && { TopicArn: input.TopicArn }), + ...(input.TopicArn !== undefined && input.TopicArn !== null && { TopicArn: input.TopicArn }), }; }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1Template = (input: Template, context: __SerdeContext): any => { return { - ...(input.TemplateArn !== undefined && { TemplateArn: input.TemplateArn }), - ...(input.TemplateData !== undefined && { TemplateData: input.TemplateData }), + ...(input.TemplateArn !== undefined && input.TemplateArn !== null && { TemplateArn: input.TemplateArn }), + ...(input.TemplateData !== undefined && input.TemplateData !== null && { TemplateData: input.TemplateData }), }; }; const serializeAws_restJson1TrackingOptions = (input: TrackingOptions, context: __SerdeContext): any => { return { - ...(input.CustomRedirectDomain !== undefined && { CustomRedirectDomain: input.CustomRedirectDomain }), + ...(input.CustomRedirectDomain !== undefined && + input.CustomRedirectDomain !== null && { CustomRedirectDomain: input.CustomRedirectDomain }), }; }; const deserializeAws_restJson1BlacklistEntries = (output: any, context: __SerdeContext): BlacklistEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BlacklistEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BlacklistEntry(entry, context); + }); }; const deserializeAws_restJson1BlacklistEntry = (output: any, context: __SerdeContext): BlacklistEntry => { @@ -5089,13 +5159,15 @@ const deserializeAws_restJson1BlacklistReport = ( output: any, context: __SerdeContext ): { [key: string]: BlacklistEntry[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: BlacklistEntry[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: BlacklistEntry[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1BlacklistEntries(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1CloudWatchDestination = (output: any, context: __SerdeContext): CloudWatchDestination => { @@ -5129,11 +5201,25 @@ const deserializeAws_restJson1CloudWatchDimensionConfigurations = ( output: any, context: __SerdeContext ): CloudWatchDimensionConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CloudWatchDimensionConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CloudWatchDimensionConfiguration(entry, context); + }); }; const deserializeAws_restJson1ConfigurationSetNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DailyVolume = (output: any, context: __SerdeContext): DailyVolume => { @@ -5154,7 +5240,14 @@ const deserializeAws_restJson1DailyVolume = (output: any, context: __SerdeContex }; const deserializeAws_restJson1DailyVolumes = (output: any, context: __SerdeContext): DailyVolume[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DailyVolume(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DailyVolume(entry, context); + }); }; const deserializeAws_restJson1DedicatedIp = (output: any, context: __SerdeContext): DedicatedIp => { @@ -5168,7 +5261,14 @@ const deserializeAws_restJson1DedicatedIp = (output: any, context: __SerdeContex }; const deserializeAws_restJson1DedicatedIpList = (output: any, context: __SerdeContext): DedicatedIp[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DedicatedIp(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DedicatedIp(entry, context); + }); }; const deserializeAws_restJson1DeliverabilityTestReport = ( @@ -5196,7 +5296,14 @@ const deserializeAws_restJson1DeliverabilityTestReports = ( output: any, context: __SerdeContext ): DeliverabilityTestReport[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeliverabilityTestReport(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeliverabilityTestReport(entry, context); + }); }; const deserializeAws_restJson1DeliveryOptions = (output: any, context: __SerdeContext): DeliveryOptions => { @@ -5220,7 +5327,14 @@ const deserializeAws_restJson1DkimAttributes = (output: any, context: __SerdeCon }; const deserializeAws_restJson1DnsTokenList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DomainDeliverabilityCampaign = ( @@ -5263,7 +5377,14 @@ const deserializeAws_restJson1DomainDeliverabilityCampaignList = ( output: any, context: __SerdeContext ): DomainDeliverabilityCampaign[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainDeliverabilityCampaign(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainDeliverabilityCampaign(entry, context); + }); }; const deserializeAws_restJson1DomainDeliverabilityTrackingOption = ( @@ -5287,7 +5408,14 @@ const deserializeAws_restJson1DomainDeliverabilityTrackingOptions = ( output: any, context: __SerdeContext ): DomainDeliverabilityTrackingOption[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context); + }); }; const deserializeAws_restJson1DomainIspPlacement = (output: any, context: __SerdeContext): DomainIspPlacement => { @@ -5304,11 +5432,25 @@ const deserializeAws_restJson1DomainIspPlacement = (output: any, context: __Serd }; const deserializeAws_restJson1DomainIspPlacements = (output: any, context: __SerdeContext): DomainIspPlacement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainIspPlacement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainIspPlacement(entry, context); + }); }; const deserializeAws_restJson1Esps = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1EventDestination = (output: any, context: __SerdeContext): EventDestination => { @@ -5339,11 +5481,25 @@ const deserializeAws_restJson1EventDestination = (output: any, context: __SerdeC }; const deserializeAws_restJson1EventDestinations = (output: any, context: __SerdeContext): EventDestination[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EventDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EventDestination(entry, context); + }); }; const deserializeAws_restJson1EventTypes = (output: any, context: __SerdeContext): (EventType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1IdentityInfo = (output: any, context: __SerdeContext): IdentityInfo => { @@ -5356,7 +5512,14 @@ const deserializeAws_restJson1IdentityInfo = (output: any, context: __SerdeConte }; const deserializeAws_restJson1IdentityInfoList = (output: any, context: __SerdeContext): IdentityInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IdentityInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IdentityInfo(entry, context); + }); }; const deserializeAws_restJson1InboxPlacementTrackingOption = ( @@ -5373,11 +5536,25 @@ const deserializeAws_restJson1InboxPlacementTrackingOption = ( }; const deserializeAws_restJson1IpList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1IspNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1IspPlacement = (output: any, context: __SerdeContext): IspPlacement => { @@ -5391,7 +5568,14 @@ const deserializeAws_restJson1IspPlacement = (output: any, context: __SerdeConte }; const deserializeAws_restJson1IspPlacements = (output: any, context: __SerdeContext): IspPlacement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IspPlacement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IspPlacement(entry, context); + }); }; const deserializeAws_restJson1KinesisFirehoseDestination = ( @@ -5408,7 +5592,14 @@ const deserializeAws_restJson1KinesisFirehoseDestination = ( }; const deserializeAws_restJson1ListOfDedicatedIpPools = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1MailFromAttributes = (output: any, context: __SerdeContext): MailFromAttributes => { @@ -5509,7 +5700,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TrackingOptions = (output: any, context: __SerdeContext): TrackingOptions => { @@ -5553,6 +5751,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-pinpoint-sms-voice/protocols/Aws_restJson1.ts b/clients/client-pinpoint-sms-voice/protocols/Aws_restJson1.ts index 7b3fc9c87733..c492d21749c8 100644 --- a/clients/client-pinpoint-sms-voice/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-sms-voice/protocols/Aws_restJson1.ts @@ -62,12 +62,13 @@ export const serializeAws_restJson1CreateConfigurationSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/sms-voice/configuration-sets"; let body: any; body = JSON.stringify({ - ...(input.ConfigurationSetName !== undefined && { ConfigurationSetName: input.ConfigurationSetName }), + ...(input.ConfigurationSetName !== undefined && + input.ConfigurationSetName !== null && { ConfigurationSetName: input.ConfigurationSetName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -86,7 +87,7 @@ export const serializeAws_restJson1CreateConfigurationSetEventDestinationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/sms-voice/configuration-sets/{ConfigurationSetName}/event-destinations"; if (input.ConfigurationSetName !== undefined) { @@ -100,10 +101,12 @@ export const serializeAws_restJson1CreateConfigurationSetEventDestinationCommand } let body: any; body = JSON.stringify({ - ...(input.EventDestination !== undefined && { - EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), - }), - ...(input.EventDestinationName !== undefined && { EventDestinationName: input.EventDestinationName }), + ...(input.EventDestination !== undefined && + input.EventDestination !== null && { + EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), + }), + ...(input.EventDestinationName !== undefined && + input.EventDestinationName !== null && { EventDestinationName: input.EventDestinationName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -121,9 +124,7 @@ export const serializeAws_restJson1DeleteConfigurationSetCommand = async ( input: DeleteConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/sms-voice/configuration-sets/{ConfigurationSetName}"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -151,9 +152,7 @@ export const serializeAws_restJson1DeleteConfigurationSetEventDestinationCommand input: DeleteConfigurationSetEventDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/sms-voice/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"; if (input.EventDestinationName !== undefined) { @@ -191,9 +190,7 @@ export const serializeAws_restJson1GetConfigurationSetEventDestinationsCommand = input: GetConfigurationSetEventDestinationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/sms-voice/configuration-sets/{ConfigurationSetName}/event-destinations"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -221,9 +218,7 @@ export const serializeAws_restJson1ListConfigurationSetsCommand = async ( input: ListConfigurationSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/sms-voice/configuration-sets"; const query: any = { ...(input.PageSize !== undefined && { PageSize: input.PageSize }), @@ -248,16 +243,20 @@ export const serializeAws_restJson1SendVoiceMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/sms-voice/voice/message"; let body: any; body = JSON.stringify({ - ...(input.CallerId !== undefined && { CallerId: input.CallerId }), - ...(input.ConfigurationSetName !== undefined && { ConfigurationSetName: input.ConfigurationSetName }), - ...(input.Content !== undefined && { Content: serializeAws_restJson1VoiceMessageContent(input.Content, context) }), - ...(input.DestinationPhoneNumber !== undefined && { DestinationPhoneNumber: input.DestinationPhoneNumber }), - ...(input.OriginationPhoneNumber !== undefined && { OriginationPhoneNumber: input.OriginationPhoneNumber }), + ...(input.CallerId !== undefined && input.CallerId !== null && { CallerId: input.CallerId }), + ...(input.ConfigurationSetName !== undefined && + input.ConfigurationSetName !== null && { ConfigurationSetName: input.ConfigurationSetName }), + ...(input.Content !== undefined && + input.Content !== null && { Content: serializeAws_restJson1VoiceMessageContent(input.Content, context) }), + ...(input.DestinationPhoneNumber !== undefined && + input.DestinationPhoneNumber !== null && { DestinationPhoneNumber: input.DestinationPhoneNumber }), + ...(input.OriginationPhoneNumber !== undefined && + input.OriginationPhoneNumber !== null && { OriginationPhoneNumber: input.OriginationPhoneNumber }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -276,7 +275,7 @@ export const serializeAws_restJson1UpdateConfigurationSetEventDestinationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/sms-voice/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"; @@ -300,9 +299,10 @@ export const serializeAws_restJson1UpdateConfigurationSetEventDestinationCommand } let body: any; body = JSON.stringify({ - ...(input.EventDestination !== undefined && { - EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), - }), + ...(input.EventDestination !== undefined && + input.EventDestination !== null && { + EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1047,7 +1047,7 @@ const serializeAws_restJson1CallInstructionsMessageType = ( context: __SerdeContext ): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; @@ -1056,8 +1056,8 @@ const serializeAws_restJson1CloudWatchLogsDestination = ( context: __SerdeContext ): any => { return { - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), - ...(input.LogGroupArn !== undefined && { LogGroupArn: input.LogGroupArn }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), + ...(input.LogGroupArn !== undefined && input.LogGroupArn !== null && { LogGroupArn: input.LogGroupArn }), }; }; @@ -1066,30 +1066,41 @@ const serializeAws_restJson1EventDestinationDefinition = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchLogsDestination !== undefined && { - CloudWatchLogsDestination: serializeAws_restJson1CloudWatchLogsDestination( - input.CloudWatchLogsDestination, - context - ), - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.KinesisFirehoseDestination !== undefined && { - KinesisFirehoseDestination: serializeAws_restJson1KinesisFirehoseDestination( - input.KinesisFirehoseDestination, - context - ), - }), - ...(input.MatchingEventTypes !== undefined && { - MatchingEventTypes: serializeAws_restJson1EventTypes(input.MatchingEventTypes, context), - }), - ...(input.SnsDestination !== undefined && { - SnsDestination: serializeAws_restJson1SnsDestination(input.SnsDestination, context), - }), + ...(input.CloudWatchLogsDestination !== undefined && + input.CloudWatchLogsDestination !== null && { + CloudWatchLogsDestination: serializeAws_restJson1CloudWatchLogsDestination( + input.CloudWatchLogsDestination, + context + ), + }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.KinesisFirehoseDestination !== undefined && + input.KinesisFirehoseDestination !== null && { + KinesisFirehoseDestination: serializeAws_restJson1KinesisFirehoseDestination( + input.KinesisFirehoseDestination, + context + ), + }), + ...(input.MatchingEventTypes !== undefined && + input.MatchingEventTypes !== null && { + MatchingEventTypes: serializeAws_restJson1EventTypes(input.MatchingEventTypes, context), + }), + ...(input.SnsDestination !== undefined && + input.SnsDestination !== null && { + SnsDestination: serializeAws_restJson1SnsDestination(input.SnsDestination, context), + }), }; }; const serializeAws_restJson1EventTypes = (input: (EventType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1KinesisFirehoseDestination = ( @@ -1097,47 +1108,49 @@ const serializeAws_restJson1KinesisFirehoseDestination = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamArn !== undefined && { DeliveryStreamArn: input.DeliveryStreamArn }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), + ...(input.DeliveryStreamArn !== undefined && + input.DeliveryStreamArn !== null && { DeliveryStreamArn: input.DeliveryStreamArn }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), }; }; const serializeAws_restJson1PlainTextMessageType = (input: PlainTextMessageType, context: __SerdeContext): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Text !== undefined && { Text: input.Text }), - ...(input.VoiceId !== undefined && { VoiceId: input.VoiceId }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), + ...(input.VoiceId !== undefined && input.VoiceId !== null && { VoiceId: input.VoiceId }), }; }; const serializeAws_restJson1SnsDestination = (input: SnsDestination, context: __SerdeContext): any => { return { - ...(input.TopicArn !== undefined && { TopicArn: input.TopicArn }), + ...(input.TopicArn !== undefined && input.TopicArn !== null && { TopicArn: input.TopicArn }), }; }; const serializeAws_restJson1SSMLMessageType = (input: SSMLMessageType, context: __SerdeContext): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Text !== undefined && { Text: input.Text }), - ...(input.VoiceId !== undefined && { VoiceId: input.VoiceId }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), + ...(input.VoiceId !== undefined && input.VoiceId !== null && { VoiceId: input.VoiceId }), }; }; const serializeAws_restJson1VoiceMessageContent = (input: VoiceMessageContent, context: __SerdeContext): any => { return { - ...(input.CallInstructionsMessage !== undefined && { - CallInstructionsMessage: serializeAws_restJson1CallInstructionsMessageType( - input.CallInstructionsMessage, - context - ), - }), - ...(input.PlainTextMessage !== undefined && { - PlainTextMessage: serializeAws_restJson1PlainTextMessageType(input.PlainTextMessage, context), - }), - ...(input.SSMLMessage !== undefined && { - SSMLMessage: serializeAws_restJson1SSMLMessageType(input.SSMLMessage, context), - }), + ...(input.CallInstructionsMessage !== undefined && + input.CallInstructionsMessage !== null && { + CallInstructionsMessage: serializeAws_restJson1CallInstructionsMessageType( + input.CallInstructionsMessage, + context + ), + }), + ...(input.PlainTextMessage !== undefined && + input.PlainTextMessage !== null && { + PlainTextMessage: serializeAws_restJson1PlainTextMessageType(input.PlainTextMessage, context), + }), + ...(input.SSMLMessage !== undefined && + input.SSMLMessage !== null && { SSMLMessage: serializeAws_restJson1SSMLMessageType(input.SSMLMessage, context) }), }; }; @@ -1152,7 +1165,14 @@ const deserializeAws_restJson1CloudWatchLogsDestination = ( }; const deserializeAws_restJson1ConfigurationSets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1EventDestination = (output: any, context: __SerdeContext): EventDestination => { @@ -1179,11 +1199,25 @@ const deserializeAws_restJson1EventDestination = (output: any, context: __SerdeC }; const deserializeAws_restJson1EventDestinations = (output: any, context: __SerdeContext): EventDestination[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EventDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EventDestination(entry, context); + }); }; const deserializeAws_restJson1EventTypes = (output: any, context: __SerdeContext): (EventType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1KinesisFirehoseDestination = ( @@ -1225,6 +1259,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-pinpoint/protocols/Aws_restJson1.ts b/clients/client-pinpoint/protocols/Aws_restJson1.ts index 9617b2802d20..c0807836c432 100644 --- a/clients/client-pinpoint/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint/protocols/Aws_restJson1.ts @@ -427,7 +427,7 @@ export const serializeAws_restJson1CreateAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps"; let body: any; @@ -455,7 +455,7 @@ export const serializeAws_restJson1CreateCampaignCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/campaigns"; if (input.ApplicationId !== undefined) { @@ -492,7 +492,7 @@ export const serializeAws_restJson1CreateEmailTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/templates/{TemplateName}/email"; if (input.TemplateName !== undefined) { @@ -529,7 +529,7 @@ export const serializeAws_restJson1CreateExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/jobs/export"; if (input.ApplicationId !== undefined) { @@ -566,7 +566,7 @@ export const serializeAws_restJson1CreateImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/jobs/import"; if (input.ApplicationId !== undefined) { @@ -603,7 +603,7 @@ export const serializeAws_restJson1CreateJourneyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/journeys"; if (input.ApplicationId !== undefined) { @@ -640,7 +640,7 @@ export const serializeAws_restJson1CreatePushTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/templates/{TemplateName}/push"; if (input.TemplateName !== undefined) { @@ -677,7 +677,7 @@ export const serializeAws_restJson1CreateRecommenderConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/recommenders"; let body: any; @@ -705,7 +705,7 @@ export const serializeAws_restJson1CreateSegmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/segments"; if (input.ApplicationId !== undefined) { @@ -742,7 +742,7 @@ export const serializeAws_restJson1CreateSmsTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/templates/{TemplateName}/sms"; if (input.TemplateName !== undefined) { @@ -779,7 +779,7 @@ export const serializeAws_restJson1CreateVoiceTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/templates/{TemplateName}/voice"; if (input.TemplateName !== undefined) { @@ -815,9 +815,7 @@ export const serializeAws_restJson1DeleteAdmChannelCommand = async ( input: DeleteAdmChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/adm"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -845,9 +843,7 @@ export const serializeAws_restJson1DeleteApnsChannelCommand = async ( input: DeleteApnsChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -875,9 +871,7 @@ export const serializeAws_restJson1DeleteApnsSandboxChannelCommand = async ( input: DeleteApnsSandboxChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns_sandbox"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -905,9 +899,7 @@ export const serializeAws_restJson1DeleteApnsVoipChannelCommand = async ( input: DeleteApnsVoipChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns_voip"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -935,9 +927,7 @@ export const serializeAws_restJson1DeleteApnsVoipSandboxChannelCommand = async ( input: DeleteApnsVoipSandboxChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns_voip_sandbox"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -965,9 +955,7 @@ export const serializeAws_restJson1DeleteAppCommand = async ( input: DeleteAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -995,9 +983,7 @@ export const serializeAws_restJson1DeleteBaiduChannelCommand = async ( input: DeleteBaiduChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/baidu"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1025,9 +1011,7 @@ export const serializeAws_restJson1DeleteCampaignCommand = async ( input: DeleteCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/campaigns/{CampaignId}"; if (input.CampaignId !== undefined) { const labelValue: string = input.CampaignId; @@ -1064,9 +1048,7 @@ export const serializeAws_restJson1DeleteEmailChannelCommand = async ( input: DeleteEmailChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/email"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1094,9 +1076,7 @@ export const serializeAws_restJson1DeleteEmailTemplateCommand = async ( input: DeleteEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates/{TemplateName}/email"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -1128,9 +1108,7 @@ export const serializeAws_restJson1DeleteEndpointCommand = async ( input: DeleteEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/endpoints/{EndpointId}"; if (input.EndpointId !== undefined) { const labelValue: string = input.EndpointId; @@ -1167,9 +1145,7 @@ export const serializeAws_restJson1DeleteEventStreamCommand = async ( input: DeleteEventStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/eventstream"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1197,9 +1173,7 @@ export const serializeAws_restJson1DeleteGcmChannelCommand = async ( input: DeleteGcmChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/gcm"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1227,9 +1201,7 @@ export const serializeAws_restJson1DeleteJourneyCommand = async ( input: DeleteJourneyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/journeys/{JourneyId}"; if (input.JourneyId !== undefined) { const labelValue: string = input.JourneyId; @@ -1266,9 +1238,7 @@ export const serializeAws_restJson1DeletePushTemplateCommand = async ( input: DeletePushTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates/{TemplateName}/push"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -1300,9 +1270,7 @@ export const serializeAws_restJson1DeleteRecommenderConfigurationCommand = async input: DeleteRecommenderConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/recommenders/{RecommenderId}"; if (input.RecommenderId !== undefined) { const labelValue: string = input.RecommenderId; @@ -1330,9 +1298,7 @@ export const serializeAws_restJson1DeleteSegmentCommand = async ( input: DeleteSegmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/segments/{SegmentId}"; if (input.SegmentId !== undefined) { const labelValue: string = input.SegmentId; @@ -1369,9 +1335,7 @@ export const serializeAws_restJson1DeleteSmsChannelCommand = async ( input: DeleteSmsChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/sms"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1399,9 +1363,7 @@ export const serializeAws_restJson1DeleteSmsTemplateCommand = async ( input: DeleteSmsTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates/{TemplateName}/sms"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -1433,9 +1395,7 @@ export const serializeAws_restJson1DeleteUserEndpointsCommand = async ( input: DeleteUserEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/users/{UserId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1472,9 +1432,7 @@ export const serializeAws_restJson1DeleteVoiceChannelCommand = async ( input: DeleteVoiceChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/voice"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1502,9 +1460,7 @@ export const serializeAws_restJson1DeleteVoiceTemplateCommand = async ( input: DeleteVoiceTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates/{TemplateName}/voice"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -1536,9 +1492,7 @@ export const serializeAws_restJson1GetAdmChannelCommand = async ( input: GetAdmChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/adm"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1566,9 +1520,7 @@ export const serializeAws_restJson1GetApnsChannelCommand = async ( input: GetApnsChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1596,9 +1548,7 @@ export const serializeAws_restJson1GetApnsSandboxChannelCommand = async ( input: GetApnsSandboxChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns_sandbox"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1626,9 +1576,7 @@ export const serializeAws_restJson1GetApnsVoipChannelCommand = async ( input: GetApnsVoipChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns_voip"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1656,9 +1604,7 @@ export const serializeAws_restJson1GetApnsVoipSandboxChannelCommand = async ( input: GetApnsVoipSandboxChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns_voip_sandbox"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1686,9 +1632,7 @@ export const serializeAws_restJson1GetAppCommand = async ( input: GetAppCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1716,9 +1660,7 @@ export const serializeAws_restJson1GetApplicationDateRangeKpiCommand = async ( input: GetApplicationDateRangeKpiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/kpis/daterange/{KpiName}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1764,9 +1706,7 @@ export const serializeAws_restJson1GetApplicationSettingsCommand = async ( input: GetApplicationSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/settings"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1794,9 +1734,7 @@ export const serializeAws_restJson1GetAppsCommand = async ( input: GetAppsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps"; const query: any = { ...(input.Token !== undefined && { token: input.Token }), @@ -1820,9 +1758,7 @@ export const serializeAws_restJson1GetBaiduChannelCommand = async ( input: GetBaiduChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/baidu"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1850,9 +1786,7 @@ export const serializeAws_restJson1GetCampaignCommand = async ( input: GetCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/campaigns/{CampaignId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1889,9 +1823,7 @@ export const serializeAws_restJson1GetCampaignActivitiesCommand = async ( input: GetCampaignActivitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/campaigns/{CampaignId}/activities"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1933,9 +1865,7 @@ export const serializeAws_restJson1GetCampaignDateRangeKpiCommand = async ( input: GetCampaignDateRangeKpiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/campaigns/{CampaignId}/kpis/daterange/{KpiName}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -1990,9 +1920,7 @@ export const serializeAws_restJson1GetCampaignsCommand = async ( input: GetCampaignsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/campaigns"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2025,9 +1953,7 @@ export const serializeAws_restJson1GetCampaignVersionCommand = async ( input: GetCampaignVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/campaigns/{CampaignId}/versions/{Version}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2073,9 +1999,7 @@ export const serializeAws_restJson1GetCampaignVersionsCommand = async ( input: GetCampaignVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/campaigns/{CampaignId}/versions"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2117,9 +2041,7 @@ export const serializeAws_restJson1GetChannelsCommand = async ( input: GetChannelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2147,9 +2069,7 @@ export const serializeAws_restJson1GetEmailChannelCommand = async ( input: GetEmailChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/email"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2177,9 +2097,7 @@ export const serializeAws_restJson1GetEmailTemplateCommand = async ( input: GetEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates/{TemplateName}/email"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -2211,9 +2129,7 @@ export const serializeAws_restJson1GetEndpointCommand = async ( input: GetEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/endpoints/{EndpointId}"; if (input.EndpointId !== undefined) { const labelValue: string = input.EndpointId; @@ -2250,9 +2166,7 @@ export const serializeAws_restJson1GetEventStreamCommand = async ( input: GetEventStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/eventstream"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2280,9 +2194,7 @@ export const serializeAws_restJson1GetExportJobCommand = async ( input: GetExportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/jobs/export/{JobId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2319,9 +2231,7 @@ export const serializeAws_restJson1GetExportJobsCommand = async ( input: GetExportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/jobs/export"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2354,9 +2264,7 @@ export const serializeAws_restJson1GetGcmChannelCommand = async ( input: GetGcmChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/gcm"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2384,9 +2292,7 @@ export const serializeAws_restJson1GetImportJobCommand = async ( input: GetImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/jobs/import/{JobId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2423,9 +2329,7 @@ export const serializeAws_restJson1GetImportJobsCommand = async ( input: GetImportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/jobs/import"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2458,9 +2362,7 @@ export const serializeAws_restJson1GetJourneyCommand = async ( input: GetJourneyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/journeys/{JourneyId}"; if (input.JourneyId !== undefined) { const labelValue: string = input.JourneyId; @@ -2497,9 +2399,7 @@ export const serializeAws_restJson1GetJourneyDateRangeKpiCommand = async ( input: GetJourneyDateRangeKpiCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/journeys/{JourneyId}/kpis/daterange/{KpiName}"; if (input.KpiName !== undefined) { const labelValue: string = input.KpiName; @@ -2554,9 +2454,7 @@ export const serializeAws_restJson1GetJourneyExecutionActivityMetricsCommand = a input: GetJourneyExecutionActivityMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/journeys/{JourneyId}/activities/{JourneyActivityId}/execution-metrics"; if (input.JourneyId !== undefined) { const labelValue: string = input.JourneyId; @@ -2607,9 +2505,7 @@ export const serializeAws_restJson1GetJourneyExecutionMetricsCommand = async ( input: GetJourneyExecutionMetricsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/journeys/{JourneyId}/execution-metrics"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2651,9 +2547,7 @@ export const serializeAws_restJson1GetPushTemplateCommand = async ( input: GetPushTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates/{TemplateName}/push"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -2685,9 +2579,7 @@ export const serializeAws_restJson1GetRecommenderConfigurationCommand = async ( input: GetRecommenderConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/recommenders/{RecommenderId}"; if (input.RecommenderId !== undefined) { const labelValue: string = input.RecommenderId; @@ -2715,9 +2607,7 @@ export const serializeAws_restJson1GetRecommenderConfigurationsCommand = async ( input: GetRecommenderConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/recommenders"; const query: any = { ...(input.Token !== undefined && { token: input.Token }), @@ -2741,9 +2631,7 @@ export const serializeAws_restJson1GetSegmentCommand = async ( input: GetSegmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/segments/{SegmentId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2780,9 +2668,7 @@ export const serializeAws_restJson1GetSegmentExportJobsCommand = async ( input: GetSegmentExportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/segments/{SegmentId}/jobs/export"; if (input.SegmentId !== undefined) { const labelValue: string = input.SegmentId; @@ -2824,9 +2710,7 @@ export const serializeAws_restJson1GetSegmentImportJobsCommand = async ( input: GetSegmentImportJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/segments/{SegmentId}/jobs/import"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2868,9 +2752,7 @@ export const serializeAws_restJson1GetSegmentsCommand = async ( input: GetSegmentsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/segments"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -2903,9 +2785,7 @@ export const serializeAws_restJson1GetSegmentVersionCommand = async ( input: GetSegmentVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/segments/{SegmentId}/versions/{Version}"; if (input.Version !== undefined) { const labelValue: string = input.Version; @@ -2951,9 +2831,7 @@ export const serializeAws_restJson1GetSegmentVersionsCommand = async ( input: GetSegmentVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/segments/{SegmentId}/versions"; if (input.SegmentId !== undefined) { const labelValue: string = input.SegmentId; @@ -2995,9 +2873,7 @@ export const serializeAws_restJson1GetSmsChannelCommand = async ( input: GetSmsChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/sms"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -3025,9 +2901,7 @@ export const serializeAws_restJson1GetSmsTemplateCommand = async ( input: GetSmsTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates/{TemplateName}/sms"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -3059,9 +2933,7 @@ export const serializeAws_restJson1GetUserEndpointsCommand = async ( input: GetUserEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/users/{UserId}"; if (input.UserId !== undefined) { const labelValue: string = input.UserId; @@ -3098,9 +2970,7 @@ export const serializeAws_restJson1GetVoiceChannelCommand = async ( input: GetVoiceChannelCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/channels/voice"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -3128,9 +2998,7 @@ export const serializeAws_restJson1GetVoiceTemplateCommand = async ( input: GetVoiceTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates/{TemplateName}/voice"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -3162,9 +3030,7 @@ export const serializeAws_restJson1ListJourneysCommand = async ( input: ListJourneysCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/apps/{ApplicationId}/journeys"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -3197,9 +3063,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -3227,9 +3091,7 @@ export const serializeAws_restJson1ListTemplatesCommand = async ( input: ListTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates"; const query: any = { ...(input.NextToken !== undefined && { "next-token": input.NextToken }), @@ -3255,9 +3117,7 @@ export const serializeAws_restJson1ListTemplateVersionsCommand = async ( input: ListTemplateVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/templates/{TemplateName}/{TemplateType}/versions"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -3300,7 +3160,7 @@ export const serializeAws_restJson1PhoneNumberValidateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/phone/number/validate"; let body: any; @@ -3328,7 +3188,7 @@ export const serializeAws_restJson1PutEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/events"; if (input.ApplicationId !== undefined) { @@ -3365,7 +3225,7 @@ export const serializeAws_restJson1PutEventStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/eventstream"; if (input.ApplicationId !== undefined) { @@ -3402,7 +3262,7 @@ export const serializeAws_restJson1RemoveAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/attributes/{AttributeType}"; if (input.ApplicationId !== undefined) { @@ -3448,7 +3308,7 @@ export const serializeAws_restJson1SendMessagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/messages"; if (input.ApplicationId !== undefined) { @@ -3485,7 +3345,7 @@ export const serializeAws_restJson1SendUsersMessagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/users-messages"; if (input.ApplicationId !== undefined) { @@ -3522,7 +3382,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -3558,9 +3418,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -3593,7 +3451,7 @@ export const serializeAws_restJson1UpdateAdmChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/adm"; if (input.ApplicationId !== undefined) { @@ -3630,7 +3488,7 @@ export const serializeAws_restJson1UpdateApnsChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns"; if (input.ApplicationId !== undefined) { @@ -3667,7 +3525,7 @@ export const serializeAws_restJson1UpdateApnsSandboxChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns_sandbox"; if (input.ApplicationId !== undefined) { @@ -3704,7 +3562,7 @@ export const serializeAws_restJson1UpdateApnsVoipChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns_voip"; if (input.ApplicationId !== undefined) { @@ -3741,7 +3599,7 @@ export const serializeAws_restJson1UpdateApnsVoipSandboxChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/apns_voip_sandbox"; if (input.ApplicationId !== undefined) { @@ -3778,7 +3636,7 @@ export const serializeAws_restJson1UpdateApplicationSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/settings"; if (input.ApplicationId !== undefined) { @@ -3815,7 +3673,7 @@ export const serializeAws_restJson1UpdateBaiduChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/baidu"; if (input.ApplicationId !== undefined) { @@ -3852,7 +3710,7 @@ export const serializeAws_restJson1UpdateCampaignCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/campaigns/{CampaignId}"; if (input.ApplicationId !== undefined) { @@ -3898,7 +3756,7 @@ export const serializeAws_restJson1UpdateEmailChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/email"; if (input.ApplicationId !== undefined) { @@ -3935,7 +3793,7 @@ export const serializeAws_restJson1UpdateEmailTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/templates/{TemplateName}/email"; if (input.TemplateName !== undefined) { @@ -3977,7 +3835,7 @@ export const serializeAws_restJson1UpdateEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/endpoints/{EndpointId}"; if (input.ApplicationId !== undefined) { @@ -4023,7 +3881,7 @@ export const serializeAws_restJson1UpdateEndpointsBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/endpoints"; if (input.ApplicationId !== undefined) { @@ -4060,7 +3918,7 @@ export const serializeAws_restJson1UpdateGcmChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/gcm"; if (input.ApplicationId !== undefined) { @@ -4097,7 +3955,7 @@ export const serializeAws_restJson1UpdateJourneyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/journeys/{JourneyId}"; if (input.JourneyId !== undefined) { @@ -4143,7 +4001,7 @@ export const serializeAws_restJson1UpdateJourneyStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/journeys/{JourneyId}/state"; if (input.ApplicationId !== undefined) { @@ -4189,7 +4047,7 @@ export const serializeAws_restJson1UpdatePushTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/templates/{TemplateName}/push"; if (input.TemplateName !== undefined) { @@ -4231,7 +4089,7 @@ export const serializeAws_restJson1UpdateRecommenderConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/recommenders/{RecommenderId}"; if (input.RecommenderId !== undefined) { @@ -4268,7 +4126,7 @@ export const serializeAws_restJson1UpdateSegmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/segments/{SegmentId}"; if (input.SegmentId !== undefined) { @@ -4314,7 +4172,7 @@ export const serializeAws_restJson1UpdateSmsChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/sms"; if (input.ApplicationId !== undefined) { @@ -4351,7 +4209,7 @@ export const serializeAws_restJson1UpdateSmsTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/templates/{TemplateName}/sms"; if (input.TemplateName !== undefined) { @@ -4393,7 +4251,7 @@ export const serializeAws_restJson1UpdateTemplateActiveVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/templates/{TemplateName}/{TemplateType}/active-version"; if (input.TemplateType !== undefined) { @@ -4439,7 +4297,7 @@ export const serializeAws_restJson1UpdateVoiceChannelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/apps/{ApplicationId}/channels/voice"; if (input.ApplicationId !== undefined) { @@ -4476,7 +4334,7 @@ export const serializeAws_restJson1UpdateVoiceTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/templates/{TemplateName}/voice"; if (input.TemplateName !== undefined) { @@ -15757,66 +15615,81 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async ( const serializeAws_restJson1Activity = (input: Activity, context: __SerdeContext): any => { return { - ...(input.CUSTOM !== undefined && { CUSTOM: serializeAws_restJson1CustomMessageActivity(input.CUSTOM, context) }), - ...(input.ConditionalSplit !== undefined && { - ConditionalSplit: serializeAws_restJson1ConditionalSplitActivity(input.ConditionalSplit, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EMAIL !== undefined && { EMAIL: serializeAws_restJson1EmailMessageActivity(input.EMAIL, context) }), - ...(input.Holdout !== undefined && { Holdout: serializeAws_restJson1HoldoutActivity(input.Holdout, context) }), - ...(input.MultiCondition !== undefined && { - MultiCondition: serializeAws_restJson1MultiConditionalSplitActivity(input.MultiCondition, context), - }), - ...(input.PUSH !== undefined && { PUSH: serializeAws_restJson1PushMessageActivity(input.PUSH, context) }), - ...(input.RandomSplit !== undefined && { - RandomSplit: serializeAws_restJson1RandomSplitActivity(input.RandomSplit, context), - }), - ...(input.SMS !== undefined && { SMS: serializeAws_restJson1SMSMessageActivity(input.SMS, context) }), - ...(input.Wait !== undefined && { Wait: serializeAws_restJson1WaitActivity(input.Wait, context) }), + ...(input.CUSTOM !== undefined && + input.CUSTOM !== null && { CUSTOM: serializeAws_restJson1CustomMessageActivity(input.CUSTOM, context) }), + ...(input.ConditionalSplit !== undefined && + input.ConditionalSplit !== null && { + ConditionalSplit: serializeAws_restJson1ConditionalSplitActivity(input.ConditionalSplit, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EMAIL !== undefined && + input.EMAIL !== null && { EMAIL: serializeAws_restJson1EmailMessageActivity(input.EMAIL, context) }), + ...(input.Holdout !== undefined && + input.Holdout !== null && { Holdout: serializeAws_restJson1HoldoutActivity(input.Holdout, context) }), + ...(input.MultiCondition !== undefined && + input.MultiCondition !== null && { + MultiCondition: serializeAws_restJson1MultiConditionalSplitActivity(input.MultiCondition, context), + }), + ...(input.PUSH !== undefined && + input.PUSH !== null && { PUSH: serializeAws_restJson1PushMessageActivity(input.PUSH, context) }), + ...(input.RandomSplit !== undefined && + input.RandomSplit !== null && { + RandomSplit: serializeAws_restJson1RandomSplitActivity(input.RandomSplit, context), + }), + ...(input.SMS !== undefined && + input.SMS !== null && { SMS: serializeAws_restJson1SMSMessageActivity(input.SMS, context) }), + ...(input.Wait !== undefined && + input.Wait !== null && { Wait: serializeAws_restJson1WaitActivity(input.Wait, context) }), }; }; const serializeAws_restJson1AddressConfiguration = (input: AddressConfiguration, context: __SerdeContext): any => { return { - ...(input.BodyOverride !== undefined && { BodyOverride: input.BodyOverride }), - ...(input.ChannelType !== undefined && { ChannelType: input.ChannelType }), - ...(input.Context !== undefined && { Context: serializeAws_restJson1MapOf__string(input.Context, context) }), - ...(input.RawContent !== undefined && { RawContent: input.RawContent }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), - ...(input.TitleOverride !== undefined && { TitleOverride: input.TitleOverride }), + ...(input.BodyOverride !== undefined && input.BodyOverride !== null && { BodyOverride: input.BodyOverride }), + ...(input.ChannelType !== undefined && input.ChannelType !== null && { ChannelType: input.ChannelType }), + ...(input.Context !== undefined && + input.Context !== null && { Context: serializeAws_restJson1MapOf__string(input.Context, context) }), + ...(input.RawContent !== undefined && input.RawContent !== null && { RawContent: input.RawContent }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), + ...(input.TitleOverride !== undefined && input.TitleOverride !== null && { TitleOverride: input.TitleOverride }), }; }; const serializeAws_restJson1ADMChannelRequest = (input: ADMChannelRequest, context: __SerdeContext): any => { return { - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientSecret !== undefined && { ClientSecret: input.ClientSecret }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientSecret !== undefined && input.ClientSecret !== null && { ClientSecret: input.ClientSecret }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; const serializeAws_restJson1ADMMessage = (input: ADMMessage, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.ConsolidationKey !== undefined && { ConsolidationKey: input.ConsolidationKey }), - ...(input.Data !== undefined && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), - ...(input.ExpiresAfter !== undefined && { ExpiresAfter: input.ExpiresAfter }), - ...(input.IconReference !== undefined && { IconReference: input.IconReference }), - ...(input.ImageIconUrl !== undefined && { ImageIconUrl: input.ImageIconUrl }), - ...(input.ImageUrl !== undefined && { ImageUrl: input.ImageUrl }), - ...(input.MD5 !== undefined && { MD5: input.MD5 }), - ...(input.RawContent !== undefined && { RawContent: input.RawContent }), - ...(input.SilentPush !== undefined && { SilentPush: input.SilentPush }), - ...(input.SmallImageIconUrl !== undefined && { SmallImageIconUrl: input.SmallImageIconUrl }), - ...(input.Sound !== undefined && { Sound: input.Sound }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.ConsolidationKey !== undefined && + input.ConsolidationKey !== null && { ConsolidationKey: input.ConsolidationKey }), + ...(input.Data !== undefined && + input.Data !== null && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), + ...(input.ExpiresAfter !== undefined && input.ExpiresAfter !== null && { ExpiresAfter: input.ExpiresAfter }), + ...(input.IconReference !== undefined && input.IconReference !== null && { IconReference: input.IconReference }), + ...(input.ImageIconUrl !== undefined && input.ImageIconUrl !== null && { ImageIconUrl: input.ImageIconUrl }), + ...(input.ImageUrl !== undefined && input.ImageUrl !== null && { ImageUrl: input.ImageUrl }), + ...(input.MD5 !== undefined && input.MD5 !== null && { MD5: input.MD5 }), + ...(input.RawContent !== undefined && input.RawContent !== null && { RawContent: input.RawContent }), + ...(input.SilentPush !== undefined && input.SilentPush !== null && { SilentPush: input.SilentPush }), + ...(input.SmallImageIconUrl !== undefined && + input.SmallImageIconUrl !== null && { SmallImageIconUrl: input.SmallImageIconUrl }), + ...(input.Sound !== undefined && input.Sound !== null && { Sound: input.Sound }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; @@ -15825,57 +15698,60 @@ const serializeAws_restJson1AndroidPushNotificationTemplate = ( context: __SerdeContext ): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.ImageIconUrl !== undefined && { ImageIconUrl: input.ImageIconUrl }), - ...(input.ImageUrl !== undefined && { ImageUrl: input.ImageUrl }), - ...(input.RawContent !== undefined && { RawContent: input.RawContent }), - ...(input.SmallImageIconUrl !== undefined && { SmallImageIconUrl: input.SmallImageIconUrl }), - ...(input.Sound !== undefined && { Sound: input.Sound }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.ImageIconUrl !== undefined && input.ImageIconUrl !== null && { ImageIconUrl: input.ImageIconUrl }), + ...(input.ImageUrl !== undefined && input.ImageUrl !== null && { ImageUrl: input.ImageUrl }), + ...(input.RawContent !== undefined && input.RawContent !== null && { RawContent: input.RawContent }), + ...(input.SmallImageIconUrl !== undefined && + input.SmallImageIconUrl !== null && { SmallImageIconUrl: input.SmallImageIconUrl }), + ...(input.Sound !== undefined && input.Sound !== null && { Sound: input.Sound }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; const serializeAws_restJson1APNSChannelRequest = (input: APNSChannelRequest, context: __SerdeContext): any => { return { - ...(input.BundleId !== undefined && { BundleId: input.BundleId }), - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.DefaultAuthenticationMethod !== undefined && { - DefaultAuthenticationMethod: input.DefaultAuthenticationMethod, - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.PrivateKey !== undefined && { PrivateKey: input.PrivateKey }), - ...(input.TeamId !== undefined && { TeamId: input.TeamId }), - ...(input.TokenKey !== undefined && { TokenKey: input.TokenKey }), - ...(input.TokenKeyId !== undefined && { TokenKeyId: input.TokenKeyId }), + ...(input.BundleId !== undefined && input.BundleId !== null && { BundleId: input.BundleId }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.DefaultAuthenticationMethod !== undefined && + input.DefaultAuthenticationMethod !== null && { DefaultAuthenticationMethod: input.DefaultAuthenticationMethod }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.PrivateKey !== undefined && input.PrivateKey !== null && { PrivateKey: input.PrivateKey }), + ...(input.TeamId !== undefined && input.TeamId !== null && { TeamId: input.TeamId }), + ...(input.TokenKey !== undefined && input.TokenKey !== null && { TokenKey: input.TokenKey }), + ...(input.TokenKeyId !== undefined && input.TokenKeyId !== null && { TokenKeyId: input.TokenKeyId }), }; }; const serializeAws_restJson1APNSMessage = (input: APNSMessage, context: __SerdeContext): any => { return { - ...(input.APNSPushType !== undefined && { APNSPushType: input.APNSPushType }), - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Badge !== undefined && { Badge: input.Badge }), - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.Category !== undefined && { Category: input.Category }), - ...(input.CollapseId !== undefined && { CollapseId: input.CollapseId }), - ...(input.Data !== undefined && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), - ...(input.MediaUrl !== undefined && { MediaUrl: input.MediaUrl }), - ...(input.PreferredAuthenticationMethod !== undefined && { - PreferredAuthenticationMethod: input.PreferredAuthenticationMethod, - }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.RawContent !== undefined && { RawContent: input.RawContent }), - ...(input.SilentPush !== undefined && { SilentPush: input.SilentPush }), - ...(input.Sound !== undefined && { Sound: input.Sound }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), - ...(input.ThreadId !== undefined && { ThreadId: input.ThreadId }), - ...(input.TimeToLive !== undefined && { TimeToLive: input.TimeToLive }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.APNSPushType !== undefined && input.APNSPushType !== null && { APNSPushType: input.APNSPushType }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Badge !== undefined && input.Badge !== null && { Badge: input.Badge }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.Category !== undefined && input.Category !== null && { Category: input.Category }), + ...(input.CollapseId !== undefined && input.CollapseId !== null && { CollapseId: input.CollapseId }), + ...(input.Data !== undefined && + input.Data !== null && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), + ...(input.MediaUrl !== undefined && input.MediaUrl !== null && { MediaUrl: input.MediaUrl }), + ...(input.PreferredAuthenticationMethod !== undefined && + input.PreferredAuthenticationMethod !== null && { + PreferredAuthenticationMethod: input.PreferredAuthenticationMethod, + }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.RawContent !== undefined && input.RawContent !== null && { RawContent: input.RawContent }), + ...(input.SilentPush !== undefined && input.SilentPush !== null && { SilentPush: input.SilentPush }), + ...(input.Sound !== undefined && input.Sound !== null && { Sound: input.Sound }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), + ...(input.ThreadId !== undefined && input.ThreadId !== null && { ThreadId: input.ThreadId }), + ...(input.TimeToLive !== undefined && input.TimeToLive !== null && { TimeToLive: input.TimeToLive }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; @@ -15884,13 +15760,13 @@ const serializeAws_restJson1APNSPushNotificationTemplate = ( context: __SerdeContext ): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.MediaUrl !== undefined && { MediaUrl: input.MediaUrl }), - ...(input.RawContent !== undefined && { RawContent: input.RawContent }), - ...(input.Sound !== undefined && { Sound: input.Sound }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.MediaUrl !== undefined && input.MediaUrl !== null && { MediaUrl: input.MediaUrl }), + ...(input.RawContent !== undefined && input.RawContent !== null && { RawContent: input.RawContent }), + ...(input.Sound !== undefined && input.Sound !== null && { Sound: input.Sound }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; @@ -15899,31 +15775,29 @@ const serializeAws_restJson1APNSSandboxChannelRequest = ( context: __SerdeContext ): any => { return { - ...(input.BundleId !== undefined && { BundleId: input.BundleId }), - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.DefaultAuthenticationMethod !== undefined && { - DefaultAuthenticationMethod: input.DefaultAuthenticationMethod, - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.PrivateKey !== undefined && { PrivateKey: input.PrivateKey }), - ...(input.TeamId !== undefined && { TeamId: input.TeamId }), - ...(input.TokenKey !== undefined && { TokenKey: input.TokenKey }), - ...(input.TokenKeyId !== undefined && { TokenKeyId: input.TokenKeyId }), + ...(input.BundleId !== undefined && input.BundleId !== null && { BundleId: input.BundleId }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.DefaultAuthenticationMethod !== undefined && + input.DefaultAuthenticationMethod !== null && { DefaultAuthenticationMethod: input.DefaultAuthenticationMethod }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.PrivateKey !== undefined && input.PrivateKey !== null && { PrivateKey: input.PrivateKey }), + ...(input.TeamId !== undefined && input.TeamId !== null && { TeamId: input.TeamId }), + ...(input.TokenKey !== undefined && input.TokenKey !== null && { TokenKey: input.TokenKey }), + ...(input.TokenKeyId !== undefined && input.TokenKeyId !== null && { TokenKeyId: input.TokenKeyId }), }; }; const serializeAws_restJson1APNSVoipChannelRequest = (input: APNSVoipChannelRequest, context: __SerdeContext): any => { return { - ...(input.BundleId !== undefined && { BundleId: input.BundleId }), - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.DefaultAuthenticationMethod !== undefined && { - DefaultAuthenticationMethod: input.DefaultAuthenticationMethod, - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.PrivateKey !== undefined && { PrivateKey: input.PrivateKey }), - ...(input.TeamId !== undefined && { TeamId: input.TeamId }), - ...(input.TokenKey !== undefined && { TokenKey: input.TokenKey }), - ...(input.TokenKeyId !== undefined && { TokenKeyId: input.TokenKeyId }), + ...(input.BundleId !== undefined && input.BundleId !== null && { BundleId: input.BundleId }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.DefaultAuthenticationMethod !== undefined && + input.DefaultAuthenticationMethod !== null && { DefaultAuthenticationMethod: input.DefaultAuthenticationMethod }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.PrivateKey !== undefined && input.PrivateKey !== null && { PrivateKey: input.PrivateKey }), + ...(input.TeamId !== undefined && input.TeamId !== null && { TeamId: input.TeamId }), + ...(input.TokenKey !== undefined && input.TokenKey !== null && { TokenKey: input.TokenKey }), + ...(input.TokenKeyId !== undefined && input.TokenKeyId !== null && { TokenKeyId: input.TokenKeyId }), }; }; @@ -15932,110 +15806,116 @@ const serializeAws_restJson1APNSVoipSandboxChannelRequest = ( context: __SerdeContext ): any => { return { - ...(input.BundleId !== undefined && { BundleId: input.BundleId }), - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.DefaultAuthenticationMethod !== undefined && { - DefaultAuthenticationMethod: input.DefaultAuthenticationMethod, - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.PrivateKey !== undefined && { PrivateKey: input.PrivateKey }), - ...(input.TeamId !== undefined && { TeamId: input.TeamId }), - ...(input.TokenKey !== undefined && { TokenKey: input.TokenKey }), - ...(input.TokenKeyId !== undefined && { TokenKeyId: input.TokenKeyId }), + ...(input.BundleId !== undefined && input.BundleId !== null && { BundleId: input.BundleId }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.DefaultAuthenticationMethod !== undefined && + input.DefaultAuthenticationMethod !== null && { DefaultAuthenticationMethod: input.DefaultAuthenticationMethod }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.PrivateKey !== undefined && input.PrivateKey !== null && { PrivateKey: input.PrivateKey }), + ...(input.TeamId !== undefined && input.TeamId !== null && { TeamId: input.TeamId }), + ...(input.TokenKey !== undefined && input.TokenKey !== null && { TokenKey: input.TokenKey }), + ...(input.TokenKeyId !== undefined && input.TokenKeyId !== null && { TokenKeyId: input.TokenKeyId }), }; }; const serializeAws_restJson1AttributeDimension = (input: AttributeDimension, context: __SerdeContext): any => { return { - ...(input.AttributeType !== undefined && { AttributeType: input.AttributeType }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1ListOf__string(input.Values, context) }), + ...(input.AttributeType !== undefined && input.AttributeType !== null && { AttributeType: input.AttributeType }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1ListOf__string(input.Values, context) }), }; }; const serializeAws_restJson1BaiduChannelRequest = (input: BaiduChannelRequest, context: __SerdeContext): any => { return { - ...(input.ApiKey !== undefined && { ApiKey: input.ApiKey }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.SecretKey !== undefined && { SecretKey: input.SecretKey }), + ...(input.ApiKey !== undefined && input.ApiKey !== null && { ApiKey: input.ApiKey }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.SecretKey !== undefined && input.SecretKey !== null && { SecretKey: input.SecretKey }), }; }; const serializeAws_restJson1BaiduMessage = (input: BaiduMessage, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.Data !== undefined && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), - ...(input.IconReference !== undefined && { IconReference: input.IconReference }), - ...(input.ImageIconUrl !== undefined && { ImageIconUrl: input.ImageIconUrl }), - ...(input.ImageUrl !== undefined && { ImageUrl: input.ImageUrl }), - ...(input.RawContent !== undefined && { RawContent: input.RawContent }), - ...(input.SilentPush !== undefined && { SilentPush: input.SilentPush }), - ...(input.SmallImageIconUrl !== undefined && { SmallImageIconUrl: input.SmallImageIconUrl }), - ...(input.Sound !== undefined && { Sound: input.Sound }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), - ...(input.TimeToLive !== undefined && { TimeToLive: input.TimeToLive }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.Data !== undefined && + input.Data !== null && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), + ...(input.IconReference !== undefined && input.IconReference !== null && { IconReference: input.IconReference }), + ...(input.ImageIconUrl !== undefined && input.ImageIconUrl !== null && { ImageIconUrl: input.ImageIconUrl }), + ...(input.ImageUrl !== undefined && input.ImageUrl !== null && { ImageUrl: input.ImageUrl }), + ...(input.RawContent !== undefined && input.RawContent !== null && { RawContent: input.RawContent }), + ...(input.SilentPush !== undefined && input.SilentPush !== null && { SilentPush: input.SilentPush }), + ...(input.SmallImageIconUrl !== undefined && + input.SmallImageIconUrl !== null && { SmallImageIconUrl: input.SmallImageIconUrl }), + ...(input.Sound !== undefined && input.Sound !== null && { Sound: input.Sound }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), + ...(input.TimeToLive !== undefined && input.TimeToLive !== null && { TimeToLive: input.TimeToLive }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; const serializeAws_restJson1CampaignCustomMessage = (input: CampaignCustomMessage, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: input.Data }), + ...(input.Data !== undefined && input.Data !== null && { Data: input.Data }), }; }; const serializeAws_restJson1CampaignEmailMessage = (input: CampaignEmailMessage, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.FromAddress !== undefined && { FromAddress: input.FromAddress }), - ...(input.HtmlBody !== undefined && { HtmlBody: input.HtmlBody }), - ...(input.Title !== undefined && { Title: input.Title }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.FromAddress !== undefined && input.FromAddress !== null && { FromAddress: input.FromAddress }), + ...(input.HtmlBody !== undefined && input.HtmlBody !== null && { HtmlBody: input.HtmlBody }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), }; }; const serializeAws_restJson1CampaignEventFilter = (input: CampaignEventFilter, context: __SerdeContext): any => { return { - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_restJson1EventDimensions(input.Dimensions, context), - }), - ...(input.FilterType !== undefined && { FilterType: input.FilterType }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_restJson1EventDimensions(input.Dimensions, context) }), + ...(input.FilterType !== undefined && input.FilterType !== null && { FilterType: input.FilterType }), }; }; const serializeAws_restJson1CampaignHook = (input: CampaignHook, context: __SerdeContext): any => { return { - ...(input.LambdaFunctionName !== undefined && { LambdaFunctionName: input.LambdaFunctionName }), - ...(input.Mode !== undefined && { Mode: input.Mode }), - ...(input.WebUrl !== undefined && { WebUrl: input.WebUrl }), + ...(input.LambdaFunctionName !== undefined && + input.LambdaFunctionName !== null && { LambdaFunctionName: input.LambdaFunctionName }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), + ...(input.WebUrl !== undefined && input.WebUrl !== null && { WebUrl: input.WebUrl }), }; }; const serializeAws_restJson1CampaignLimits = (input: CampaignLimits, context: __SerdeContext): any => { return { - ...(input.Daily !== undefined && { Daily: input.Daily }), - ...(input.MaximumDuration !== undefined && { MaximumDuration: input.MaximumDuration }), - ...(input.MessagesPerSecond !== undefined && { MessagesPerSecond: input.MessagesPerSecond }), - ...(input.Total !== undefined && { Total: input.Total }), + ...(input.Daily !== undefined && input.Daily !== null && { Daily: input.Daily }), + ...(input.MaximumDuration !== undefined && + input.MaximumDuration !== null && { MaximumDuration: input.MaximumDuration }), + ...(input.MessagesPerSecond !== undefined && + input.MessagesPerSecond !== null && { MessagesPerSecond: input.MessagesPerSecond }), + ...(input.Total !== undefined && input.Total !== null && { Total: input.Total }), }; }; const serializeAws_restJson1CampaignSmsMessage = (input: CampaignSmsMessage, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.MessageType !== undefined && { MessageType: input.MessageType }), - ...(input.SenderId !== undefined && { SenderId: input.SenderId }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType }), + ...(input.SenderId !== undefined && input.SenderId !== null && { SenderId: input.SenderId }), }; }; const serializeAws_restJson1Condition = (input: Condition, context: __SerdeContext): any => { return { - ...(input.Conditions !== undefined && { - Conditions: serializeAws_restJson1ListOfSimpleCondition(input.Conditions, context), - }), - ...(input.Operator !== undefined && { Operator: input.Operator }), + ...(input.Conditions !== undefined && + input.Conditions !== null && { + Conditions: serializeAws_restJson1ListOfSimpleCondition(input.Conditions, context), + }), + ...(input.Operator !== undefined && input.Operator !== null && { Operator: input.Operator }), }; }; @@ -16044,12 +15924,14 @@ const serializeAws_restJson1ConditionalSplitActivity = ( context: __SerdeContext ): any => { return { - ...(input.Condition !== undefined && { Condition: serializeAws_restJson1Condition(input.Condition, context) }), - ...(input.EvaluationWaitTime !== undefined && { - EvaluationWaitTime: serializeAws_restJson1WaitTime(input.EvaluationWaitTime, context), - }), - ...(input.FalseActivity !== undefined && { FalseActivity: input.FalseActivity }), - ...(input.TrueActivity !== undefined && { TrueActivity: input.TrueActivity }), + ...(input.Condition !== undefined && + input.Condition !== null && { Condition: serializeAws_restJson1Condition(input.Condition, context) }), + ...(input.EvaluationWaitTime !== undefined && + input.EvaluationWaitTime !== null && { + EvaluationWaitTime: serializeAws_restJson1WaitTime(input.EvaluationWaitTime, context), + }), + ...(input.FalseActivity !== undefined && input.FalseActivity !== null && { FalseActivity: input.FalseActivity }), + ...(input.TrueActivity !== undefined && input.TrueActivity !== null && { TrueActivity: input.TrueActivity }), }; }; @@ -16058,8 +15940,9 @@ const serializeAws_restJson1CreateApplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), }; }; @@ -16068,29 +15951,28 @@ const serializeAws_restJson1CreateRecommenderConfigurationShape = ( context: __SerdeContext ): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1MapOf__string(input.Attributes, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RecommendationProviderIdType !== undefined && { - RecommendationProviderIdType: input.RecommendationProviderIdType, - }), - ...(input.RecommendationProviderRoleArn !== undefined && { - RecommendationProviderRoleArn: input.RecommendationProviderRoleArn, - }), - ...(input.RecommendationProviderUri !== undefined && { - RecommendationProviderUri: input.RecommendationProviderUri, - }), - ...(input.RecommendationTransformerUri !== undefined && { - RecommendationTransformerUri: input.RecommendationTransformerUri, - }), - ...(input.RecommendationsDisplayName !== undefined && { - RecommendationsDisplayName: input.RecommendationsDisplayName, - }), - ...(input.RecommendationsPerMessage !== undefined && { - RecommendationsPerMessage: input.RecommendationsPerMessage, - }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1MapOf__string(input.Attributes, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RecommendationProviderIdType !== undefined && + input.RecommendationProviderIdType !== null && { + RecommendationProviderIdType: input.RecommendationProviderIdType, + }), + ...(input.RecommendationProviderRoleArn !== undefined && + input.RecommendationProviderRoleArn !== null && { + RecommendationProviderRoleArn: input.RecommendationProviderRoleArn, + }), + ...(input.RecommendationProviderUri !== undefined && + input.RecommendationProviderUri !== null && { RecommendationProviderUri: input.RecommendationProviderUri }), + ...(input.RecommendationTransformerUri !== undefined && + input.RecommendationTransformerUri !== null && { + RecommendationTransformerUri: input.RecommendationTransformerUri, + }), + ...(input.RecommendationsDisplayName !== undefined && + input.RecommendationsDisplayName !== null && { RecommendationsDisplayName: input.RecommendationsDisplayName }), + ...(input.RecommendationsPerMessage !== undefined && + input.RecommendationsPerMessage !== null && { RecommendationsPerMessage: input.RecommendationsPerMessage }), }; }; @@ -16099,34 +15981,39 @@ const serializeAws_restJson1CustomDeliveryConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryUri !== undefined && { DeliveryUri: input.DeliveryUri }), - ...(input.EndpointTypes !== undefined && { - EndpointTypes: serializeAws_restJson1ListOf__EndpointTypesElement(input.EndpointTypes, context), - }), + ...(input.DeliveryUri !== undefined && input.DeliveryUri !== null && { DeliveryUri: input.DeliveryUri }), + ...(input.EndpointTypes !== undefined && + input.EndpointTypes !== null && { + EndpointTypes: serializeAws_restJson1ListOf__EndpointTypesElement(input.EndpointTypes, context), + }), }; }; const serializeAws_restJson1CustomMessageActivity = (input: CustomMessageActivity, context: __SerdeContext): any => { return { - ...(input.DeliveryUri !== undefined && { DeliveryUri: input.DeliveryUri }), - ...(input.EndpointTypes !== undefined && { - EndpointTypes: serializeAws_restJson1ListOf__EndpointTypesElement(input.EndpointTypes, context), - }), - ...(input.MessageConfig !== undefined && { - MessageConfig: serializeAws_restJson1JourneyCustomMessage(input.MessageConfig, context), - }), - ...(input.NextActivity !== undefined && { NextActivity: input.NextActivity }), - ...(input.TemplateName !== undefined && { TemplateName: input.TemplateName }), - ...(input.TemplateVersion !== undefined && { TemplateVersion: input.TemplateVersion }), + ...(input.DeliveryUri !== undefined && input.DeliveryUri !== null && { DeliveryUri: input.DeliveryUri }), + ...(input.EndpointTypes !== undefined && + input.EndpointTypes !== null && { + EndpointTypes: serializeAws_restJson1ListOf__EndpointTypesElement(input.EndpointTypes, context), + }), + ...(input.MessageConfig !== undefined && + input.MessageConfig !== null && { + MessageConfig: serializeAws_restJson1JourneyCustomMessage(input.MessageConfig, context), + }), + ...(input.NextActivity !== undefined && input.NextActivity !== null && { NextActivity: input.NextActivity }), + ...(input.TemplateName !== undefined && input.TemplateName !== null && { TemplateName: input.TemplateName }), + ...(input.TemplateVersion !== undefined && + input.TemplateVersion !== null && { TemplateVersion: input.TemplateVersion }), }; }; const serializeAws_restJson1DefaultMessage = (input: DefaultMessage, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), }; }; @@ -16135,15 +16022,17 @@ const serializeAws_restJson1DefaultPushNotificationMessage = ( context: __SerdeContext ): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.Data !== undefined && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), - ...(input.SilentPush !== undefined && { SilentPush: input.SilentPush }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.Data !== undefined && + input.Data !== null && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), + ...(input.SilentPush !== undefined && input.SilentPush !== null && { SilentPush: input.SilentPush }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; @@ -16152,11 +16041,11 @@ const serializeAws_restJson1DefaultPushNotificationTemplate = ( context: __SerdeContext ): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.Sound !== undefined && { Sound: input.Sound }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.Sound !== undefined && input.Sound !== null && { Sound: input.Sound }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; @@ -16165,154 +16054,176 @@ const serializeAws_restJson1DirectMessageConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.ADMMessage !== undefined && { ADMMessage: serializeAws_restJson1ADMMessage(input.ADMMessage, context) }), - ...(input.APNSMessage !== undefined && { - APNSMessage: serializeAws_restJson1APNSMessage(input.APNSMessage, context), - }), - ...(input.BaiduMessage !== undefined && { - BaiduMessage: serializeAws_restJson1BaiduMessage(input.BaiduMessage, context), - }), - ...(input.DefaultMessage !== undefined && { - DefaultMessage: serializeAws_restJson1DefaultMessage(input.DefaultMessage, context), - }), - ...(input.DefaultPushNotificationMessage !== undefined && { - DefaultPushNotificationMessage: serializeAws_restJson1DefaultPushNotificationMessage( - input.DefaultPushNotificationMessage, - context - ), - }), - ...(input.EmailMessage !== undefined && { - EmailMessage: serializeAws_restJson1EmailMessage(input.EmailMessage, context), - }), - ...(input.GCMMessage !== undefined && { GCMMessage: serializeAws_restJson1GCMMessage(input.GCMMessage, context) }), - ...(input.SMSMessage !== undefined && { SMSMessage: serializeAws_restJson1SMSMessage(input.SMSMessage, context) }), - ...(input.VoiceMessage !== undefined && { - VoiceMessage: serializeAws_restJson1VoiceMessage(input.VoiceMessage, context), - }), + ...(input.ADMMessage !== undefined && + input.ADMMessage !== null && { ADMMessage: serializeAws_restJson1ADMMessage(input.ADMMessage, context) }), + ...(input.APNSMessage !== undefined && + input.APNSMessage !== null && { APNSMessage: serializeAws_restJson1APNSMessage(input.APNSMessage, context) }), + ...(input.BaiduMessage !== undefined && + input.BaiduMessage !== null && { BaiduMessage: serializeAws_restJson1BaiduMessage(input.BaiduMessage, context) }), + ...(input.DefaultMessage !== undefined && + input.DefaultMessage !== null && { + DefaultMessage: serializeAws_restJson1DefaultMessage(input.DefaultMessage, context), + }), + ...(input.DefaultPushNotificationMessage !== undefined && + input.DefaultPushNotificationMessage !== null && { + DefaultPushNotificationMessage: serializeAws_restJson1DefaultPushNotificationMessage( + input.DefaultPushNotificationMessage, + context + ), + }), + ...(input.EmailMessage !== undefined && + input.EmailMessage !== null && { EmailMessage: serializeAws_restJson1EmailMessage(input.EmailMessage, context) }), + ...(input.GCMMessage !== undefined && + input.GCMMessage !== null && { GCMMessage: serializeAws_restJson1GCMMessage(input.GCMMessage, context) }), + ...(input.SMSMessage !== undefined && + input.SMSMessage !== null && { SMSMessage: serializeAws_restJson1SMSMessage(input.SMSMessage, context) }), + ...(input.VoiceMessage !== undefined && + input.VoiceMessage !== null && { VoiceMessage: serializeAws_restJson1VoiceMessage(input.VoiceMessage, context) }), }; }; const serializeAws_restJson1EmailChannelRequest = (input: EmailChannelRequest, context: __SerdeContext): any => { return { - ...(input.ConfigurationSet !== undefined && { ConfigurationSet: input.ConfigurationSet }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.FromAddress !== undefined && { FromAddress: input.FromAddress }), - ...(input.Identity !== undefined && { Identity: input.Identity }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.ConfigurationSet !== undefined && + input.ConfigurationSet !== null && { ConfigurationSet: input.ConfigurationSet }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.FromAddress !== undefined && input.FromAddress !== null && { FromAddress: input.FromAddress }), + ...(input.Identity !== undefined && input.Identity !== null && { Identity: input.Identity }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_restJson1EmailMessage = (input: EmailMessage, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.FeedbackForwardingAddress !== undefined && { - FeedbackForwardingAddress: input.FeedbackForwardingAddress, - }), - ...(input.FromAddress !== undefined && { FromAddress: input.FromAddress }), - ...(input.RawEmail !== undefined && { RawEmail: serializeAws_restJson1RawEmail(input.RawEmail, context) }), - ...(input.ReplyToAddresses !== undefined && { - ReplyToAddresses: serializeAws_restJson1ListOf__string(input.ReplyToAddresses, context), - }), - ...(input.SimpleEmail !== undefined && { - SimpleEmail: serializeAws_restJson1SimpleEmail(input.SimpleEmail, context), - }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.FeedbackForwardingAddress !== undefined && + input.FeedbackForwardingAddress !== null && { FeedbackForwardingAddress: input.FeedbackForwardingAddress }), + ...(input.FromAddress !== undefined && input.FromAddress !== null && { FromAddress: input.FromAddress }), + ...(input.RawEmail !== undefined && + input.RawEmail !== null && { RawEmail: serializeAws_restJson1RawEmail(input.RawEmail, context) }), + ...(input.ReplyToAddresses !== undefined && + input.ReplyToAddresses !== null && { + ReplyToAddresses: serializeAws_restJson1ListOf__string(input.ReplyToAddresses, context), + }), + ...(input.SimpleEmail !== undefined && + input.SimpleEmail !== null && { SimpleEmail: serializeAws_restJson1SimpleEmail(input.SimpleEmail, context) }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), }; }; const serializeAws_restJson1EmailMessageActivity = (input: EmailMessageActivity, context: __SerdeContext): any => { return { - ...(input.MessageConfig !== undefined && { - MessageConfig: serializeAws_restJson1JourneyEmailMessage(input.MessageConfig, context), - }), - ...(input.NextActivity !== undefined && { NextActivity: input.NextActivity }), - ...(input.TemplateName !== undefined && { TemplateName: input.TemplateName }), - ...(input.TemplateVersion !== undefined && { TemplateVersion: input.TemplateVersion }), + ...(input.MessageConfig !== undefined && + input.MessageConfig !== null && { + MessageConfig: serializeAws_restJson1JourneyEmailMessage(input.MessageConfig, context), + }), + ...(input.NextActivity !== undefined && input.NextActivity !== null && { NextActivity: input.NextActivity }), + ...(input.TemplateName !== undefined && input.TemplateName !== null && { TemplateName: input.TemplateName }), + ...(input.TemplateVersion !== undefined && + input.TemplateVersion !== null && { TemplateVersion: input.TemplateVersion }), }; }; const serializeAws_restJson1EmailTemplateRequest = (input: EmailTemplateRequest, context: __SerdeContext): any => { return { - ...(input.DefaultSubstitutions !== undefined && { DefaultSubstitutions: input.DefaultSubstitutions }), - ...(input.HtmlPart !== undefined && { HtmlPart: input.HtmlPart }), - ...(input.RecommenderId !== undefined && { RecommenderId: input.RecommenderId }), - ...(input.Subject !== undefined && { Subject: input.Subject }), - ...(input.TemplateDescription !== undefined && { TemplateDescription: input.TemplateDescription }), - ...(input.TextPart !== undefined && { TextPart: input.TextPart }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), + ...(input.DefaultSubstitutions !== undefined && + input.DefaultSubstitutions !== null && { DefaultSubstitutions: input.DefaultSubstitutions }), + ...(input.HtmlPart !== undefined && input.HtmlPart !== null && { HtmlPart: input.HtmlPart }), + ...(input.RecommenderId !== undefined && input.RecommenderId !== null && { RecommenderId: input.RecommenderId }), + ...(input.Subject !== undefined && input.Subject !== null && { Subject: input.Subject }), + ...(input.TemplateDescription !== undefined && + input.TemplateDescription !== null && { TemplateDescription: input.TemplateDescription }), + ...(input.TextPart !== undefined && input.TextPart !== null && { TextPart: input.TextPart }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), }; }; const serializeAws_restJson1EndpointBatchItem = (input: EndpointBatchItem, context: __SerdeContext): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1MapOfListOf__string(input.Attributes, context), - }), - ...(input.ChannelType !== undefined && { ChannelType: input.ChannelType }), - ...(input.Demographic !== undefined && { - Demographic: serializeAws_restJson1EndpointDemographic(input.Demographic, context), - }), - ...(input.EffectiveDate !== undefined && { EffectiveDate: input.EffectiveDate }), - ...(input.EndpointStatus !== undefined && { EndpointStatus: input.EndpointStatus }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Location !== undefined && { Location: serializeAws_restJson1EndpointLocation(input.Location, context) }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_restJson1MapOf__double(input.Metrics, context) }), - ...(input.OptOut !== undefined && { OptOut: input.OptOut }), - ...(input.RequestId !== undefined && { RequestId: input.RequestId }), - ...(input.User !== undefined && { User: serializeAws_restJson1EndpointUser(input.User, context) }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_restJson1MapOfListOf__string(input.Attributes, context), + }), + ...(input.ChannelType !== undefined && input.ChannelType !== null && { ChannelType: input.ChannelType }), + ...(input.Demographic !== undefined && + input.Demographic !== null && { + Demographic: serializeAws_restJson1EndpointDemographic(input.Demographic, context), + }), + ...(input.EffectiveDate !== undefined && input.EffectiveDate !== null && { EffectiveDate: input.EffectiveDate }), + ...(input.EndpointStatus !== undefined && + input.EndpointStatus !== null && { EndpointStatus: input.EndpointStatus }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_restJson1EndpointLocation(input.Location, context) }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_restJson1MapOf__double(input.Metrics, context) }), + ...(input.OptOut !== undefined && input.OptOut !== null && { OptOut: input.OptOut }), + ...(input.RequestId !== undefined && input.RequestId !== null && { RequestId: input.RequestId }), + ...(input.User !== undefined && + input.User !== null && { User: serializeAws_restJson1EndpointUser(input.User, context) }), }; }; const serializeAws_restJson1EndpointBatchRequest = (input: EndpointBatchRequest, context: __SerdeContext): any => { return { - ...(input.Item !== undefined && { Item: serializeAws_restJson1ListOfEndpointBatchItem(input.Item, context) }), + ...(input.Item !== undefined && + input.Item !== null && { Item: serializeAws_restJson1ListOfEndpointBatchItem(input.Item, context) }), }; }; const serializeAws_restJson1EndpointDemographic = (input: EndpointDemographic, context: __SerdeContext): any => { return { - ...(input.AppVersion !== undefined && { AppVersion: input.AppVersion }), - ...(input.Locale !== undefined && { Locale: input.Locale }), - ...(input.Make !== undefined && { Make: input.Make }), - ...(input.Model !== undefined && { Model: input.Model }), - ...(input.ModelVersion !== undefined && { ModelVersion: input.ModelVersion }), - ...(input.Platform !== undefined && { Platform: input.Platform }), - ...(input.PlatformVersion !== undefined && { PlatformVersion: input.PlatformVersion }), - ...(input.Timezone !== undefined && { Timezone: input.Timezone }), + ...(input.AppVersion !== undefined && input.AppVersion !== null && { AppVersion: input.AppVersion }), + ...(input.Locale !== undefined && input.Locale !== null && { Locale: input.Locale }), + ...(input.Make !== undefined && input.Make !== null && { Make: input.Make }), + ...(input.Model !== undefined && input.Model !== null && { Model: input.Model }), + ...(input.ModelVersion !== undefined && input.ModelVersion !== null && { ModelVersion: input.ModelVersion }), + ...(input.Platform !== undefined && input.Platform !== null && { Platform: input.Platform }), + ...(input.PlatformVersion !== undefined && + input.PlatformVersion !== null && { PlatformVersion: input.PlatformVersion }), + ...(input.Timezone !== undefined && input.Timezone !== null && { Timezone: input.Timezone }), }; }; const serializeAws_restJson1EndpointLocation = (input: EndpointLocation, context: __SerdeContext): any => { return { - ...(input.City !== undefined && { City: input.City }), - ...(input.Country !== undefined && { Country: input.Country }), - ...(input.Latitude !== undefined && { Latitude: input.Latitude }), - ...(input.Longitude !== undefined && { Longitude: input.Longitude }), - ...(input.PostalCode !== undefined && { PostalCode: input.PostalCode }), - ...(input.Region !== undefined && { Region: input.Region }), + ...(input.City !== undefined && input.City !== null && { City: input.City }), + ...(input.Country !== undefined && input.Country !== null && { Country: input.Country }), + ...(input.Latitude !== undefined && input.Latitude !== null && { Latitude: input.Latitude }), + ...(input.Longitude !== undefined && input.Longitude !== null && { Longitude: input.Longitude }), + ...(input.PostalCode !== undefined && input.PostalCode !== null && { PostalCode: input.PostalCode }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), }; }; const serializeAws_restJson1EndpointRequest = (input: EndpointRequest, context: __SerdeContext): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1MapOfListOf__string(input.Attributes, context), - }), - ...(input.ChannelType !== undefined && { ChannelType: input.ChannelType }), - ...(input.Demographic !== undefined && { - Demographic: serializeAws_restJson1EndpointDemographic(input.Demographic, context), - }), - ...(input.EffectiveDate !== undefined && { EffectiveDate: input.EffectiveDate }), - ...(input.EndpointStatus !== undefined && { EndpointStatus: input.EndpointStatus }), - ...(input.Location !== undefined && { Location: serializeAws_restJson1EndpointLocation(input.Location, context) }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_restJson1MapOf__double(input.Metrics, context) }), - ...(input.OptOut !== undefined && { OptOut: input.OptOut }), - ...(input.RequestId !== undefined && { RequestId: input.RequestId }), - ...(input.User !== undefined && { User: serializeAws_restJson1EndpointUser(input.User, context) }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_restJson1MapOfListOf__string(input.Attributes, context), + }), + ...(input.ChannelType !== undefined && input.ChannelType !== null && { ChannelType: input.ChannelType }), + ...(input.Demographic !== undefined && + input.Demographic !== null && { + Demographic: serializeAws_restJson1EndpointDemographic(input.Demographic, context), + }), + ...(input.EffectiveDate !== undefined && input.EffectiveDate !== null && { EffectiveDate: input.EffectiveDate }), + ...(input.EndpointStatus !== undefined && + input.EndpointStatus !== null && { EndpointStatus: input.EndpointStatus }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_restJson1EndpointLocation(input.Location, context) }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_restJson1MapOf__double(input.Metrics, context) }), + ...(input.OptOut !== undefined && input.OptOut !== null && { OptOut: input.OptOut }), + ...(input.RequestId !== undefined && input.RequestId !== null && { RequestId: input.RequestId }), + ...(input.User !== undefined && + input.User !== null && { User: serializeAws_restJson1EndpointUser(input.User, context) }), }; }; @@ -16321,214 +16232,233 @@ const serializeAws_restJson1EndpointSendConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.BodyOverride !== undefined && { BodyOverride: input.BodyOverride }), - ...(input.Context !== undefined && { Context: serializeAws_restJson1MapOf__string(input.Context, context) }), - ...(input.RawContent !== undefined && { RawContent: input.RawContent }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), - ...(input.TitleOverride !== undefined && { TitleOverride: input.TitleOverride }), + ...(input.BodyOverride !== undefined && input.BodyOverride !== null && { BodyOverride: input.BodyOverride }), + ...(input.Context !== undefined && + input.Context !== null && { Context: serializeAws_restJson1MapOf__string(input.Context, context) }), + ...(input.RawContent !== undefined && input.RawContent !== null && { RawContent: input.RawContent }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), + ...(input.TitleOverride !== undefined && input.TitleOverride !== null && { TitleOverride: input.TitleOverride }), }; }; const serializeAws_restJson1EndpointUser = (input: EndpointUser, context: __SerdeContext): any => { return { - ...(input.UserAttributes !== undefined && { - UserAttributes: serializeAws_restJson1MapOfListOf__string(input.UserAttributes, context), - }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.UserAttributes !== undefined && + input.UserAttributes !== null && { + UserAttributes: serializeAws_restJson1MapOfListOf__string(input.UserAttributes, context), + }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; const serializeAws_restJson1Event = (input: Event, context: __SerdeContext): any => { return { - ...(input.AppPackageName !== undefined && { AppPackageName: input.AppPackageName }), - ...(input.AppTitle !== undefined && { AppTitle: input.AppTitle }), - ...(input.AppVersionCode !== undefined && { AppVersionCode: input.AppVersionCode }), - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1MapOf__string(input.Attributes, context), - }), - ...(input.ClientSdkVersion !== undefined && { ClientSdkVersion: input.ClientSdkVersion }), - ...(input.EventType !== undefined && { EventType: input.EventType }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_restJson1MapOf__double(input.Metrics, context) }), - ...(input.SdkName !== undefined && { SdkName: input.SdkName }), - ...(input.Session !== undefined && { Session: serializeAws_restJson1Session(input.Session, context) }), - ...(input.Timestamp !== undefined && { Timestamp: input.Timestamp }), + ...(input.AppPackageName !== undefined && + input.AppPackageName !== null && { AppPackageName: input.AppPackageName }), + ...(input.AppTitle !== undefined && input.AppTitle !== null && { AppTitle: input.AppTitle }), + ...(input.AppVersionCode !== undefined && + input.AppVersionCode !== null && { AppVersionCode: input.AppVersionCode }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1MapOf__string(input.Attributes, context) }), + ...(input.ClientSdkVersion !== undefined && + input.ClientSdkVersion !== null && { ClientSdkVersion: input.ClientSdkVersion }), + ...(input.EventType !== undefined && input.EventType !== null && { EventType: input.EventType }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_restJson1MapOf__double(input.Metrics, context) }), + ...(input.SdkName !== undefined && input.SdkName !== null && { SdkName: input.SdkName }), + ...(input.Session !== undefined && + input.Session !== null && { Session: serializeAws_restJson1Session(input.Session, context) }), + ...(input.Timestamp !== undefined && input.Timestamp !== null && { Timestamp: input.Timestamp }), }; }; const serializeAws_restJson1EventCondition = (input: EventCondition, context: __SerdeContext): any => { return { - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_restJson1EventDimensions(input.Dimensions, context), - }), - ...(input.MessageActivity !== undefined && { MessageActivity: input.MessageActivity }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_restJson1EventDimensions(input.Dimensions, context) }), + ...(input.MessageActivity !== undefined && + input.MessageActivity !== null && { MessageActivity: input.MessageActivity }), }; }; const serializeAws_restJson1EventDimensions = (input: EventDimensions, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1MapOfAttributeDimension(input.Attributes, context), - }), - ...(input.EventType !== undefined && { EventType: serializeAws_restJson1SetDimension(input.EventType, context) }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_restJson1MapOfMetricDimension(input.Metrics, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_restJson1MapOfAttributeDimension(input.Attributes, context), + }), + ...(input.EventType !== undefined && + input.EventType !== null && { EventType: serializeAws_restJson1SetDimension(input.EventType, context) }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_restJson1MapOfMetricDimension(input.Metrics, context) }), }; }; const serializeAws_restJson1EventFilter = (input: EventFilter, context: __SerdeContext): any => { return { - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_restJson1EventDimensions(input.Dimensions, context), - }), - ...(input.FilterType !== undefined && { FilterType: input.FilterType }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_restJson1EventDimensions(input.Dimensions, context) }), + ...(input.FilterType !== undefined && input.FilterType !== null && { FilterType: input.FilterType }), }; }; const serializeAws_restJson1EventsBatch = (input: EventsBatch, context: __SerdeContext): any => { return { - ...(input.Endpoint !== undefined && { Endpoint: serializeAws_restJson1PublicEndpoint(input.Endpoint, context) }), - ...(input.Events !== undefined && { Events: serializeAws_restJson1MapOfEvent(input.Events, context) }), + ...(input.Endpoint !== undefined && + input.Endpoint !== null && { Endpoint: serializeAws_restJson1PublicEndpoint(input.Endpoint, context) }), + ...(input.Events !== undefined && + input.Events !== null && { Events: serializeAws_restJson1MapOfEvent(input.Events, context) }), }; }; const serializeAws_restJson1EventsRequest = (input: EventsRequest, context: __SerdeContext): any => { return { - ...(input.BatchItem !== undefined && { - BatchItem: serializeAws_restJson1MapOfEventsBatch(input.BatchItem, context), - }), + ...(input.BatchItem !== undefined && + input.BatchItem !== null && { BatchItem: serializeAws_restJson1MapOfEventsBatch(input.BatchItem, context) }), }; }; const serializeAws_restJson1EventStartCondition = (input: EventStartCondition, context: __SerdeContext): any => { return { - ...(input.EventFilter !== undefined && { - EventFilter: serializeAws_restJson1EventFilter(input.EventFilter, context), - }), - ...(input.SegmentId !== undefined && { SegmentId: input.SegmentId }), + ...(input.EventFilter !== undefined && + input.EventFilter !== null && { EventFilter: serializeAws_restJson1EventFilter(input.EventFilter, context) }), + ...(input.SegmentId !== undefined && input.SegmentId !== null && { SegmentId: input.SegmentId }), }; }; const serializeAws_restJson1ExportJobRequest = (input: ExportJobRequest, context: __SerdeContext): any => { return { - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.S3UrlPrefix !== undefined && { S3UrlPrefix: input.S3UrlPrefix }), - ...(input.SegmentId !== undefined && { SegmentId: input.SegmentId }), - ...(input.SegmentVersion !== undefined && { SegmentVersion: input.SegmentVersion }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.S3UrlPrefix !== undefined && input.S3UrlPrefix !== null && { S3UrlPrefix: input.S3UrlPrefix }), + ...(input.SegmentId !== undefined && input.SegmentId !== null && { SegmentId: input.SegmentId }), + ...(input.SegmentVersion !== undefined && + input.SegmentVersion !== null && { SegmentVersion: input.SegmentVersion }), }; }; const serializeAws_restJson1GCMChannelRequest = (input: GCMChannelRequest, context: __SerdeContext): any => { return { - ...(input.ApiKey !== undefined && { ApiKey: input.ApiKey }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.ApiKey !== undefined && input.ApiKey !== null && { ApiKey: input.ApiKey }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; const serializeAws_restJson1GCMMessage = (input: GCMMessage, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.CollapseKey !== undefined && { CollapseKey: input.CollapseKey }), - ...(input.Data !== undefined && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), - ...(input.IconReference !== undefined && { IconReference: input.IconReference }), - ...(input.ImageIconUrl !== undefined && { ImageIconUrl: input.ImageIconUrl }), - ...(input.ImageUrl !== undefined && { ImageUrl: input.ImageUrl }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.RawContent !== undefined && { RawContent: input.RawContent }), - ...(input.RestrictedPackageName !== undefined && { RestrictedPackageName: input.RestrictedPackageName }), - ...(input.SilentPush !== undefined && { SilentPush: input.SilentPush }), - ...(input.SmallImageIconUrl !== undefined && { SmallImageIconUrl: input.SmallImageIconUrl }), - ...(input.Sound !== undefined && { Sound: input.Sound }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), - ...(input.TimeToLive !== undefined && { TimeToLive: input.TimeToLive }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.CollapseKey !== undefined && input.CollapseKey !== null && { CollapseKey: input.CollapseKey }), + ...(input.Data !== undefined && + input.Data !== null && { Data: serializeAws_restJson1MapOf__string(input.Data, context) }), + ...(input.IconReference !== undefined && input.IconReference !== null && { IconReference: input.IconReference }), + ...(input.ImageIconUrl !== undefined && input.ImageIconUrl !== null && { ImageIconUrl: input.ImageIconUrl }), + ...(input.ImageUrl !== undefined && input.ImageUrl !== null && { ImageUrl: input.ImageUrl }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.RawContent !== undefined && input.RawContent !== null && { RawContent: input.RawContent }), + ...(input.RestrictedPackageName !== undefined && + input.RestrictedPackageName !== null && { RestrictedPackageName: input.RestrictedPackageName }), + ...(input.SilentPush !== undefined && input.SilentPush !== null && { SilentPush: input.SilentPush }), + ...(input.SmallImageIconUrl !== undefined && + input.SmallImageIconUrl !== null && { SmallImageIconUrl: input.SmallImageIconUrl }), + ...(input.Sound !== undefined && input.Sound !== null && { Sound: input.Sound }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), + ...(input.TimeToLive !== undefined && input.TimeToLive !== null && { TimeToLive: input.TimeToLive }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; const serializeAws_restJson1GPSCoordinates = (input: GPSCoordinates, context: __SerdeContext): any => { return { - ...(input.Latitude !== undefined && { Latitude: input.Latitude }), - ...(input.Longitude !== undefined && { Longitude: input.Longitude }), + ...(input.Latitude !== undefined && input.Latitude !== null && { Latitude: input.Latitude }), + ...(input.Longitude !== undefined && input.Longitude !== null && { Longitude: input.Longitude }), }; }; const serializeAws_restJson1GPSPointDimension = (input: GPSPointDimension, context: __SerdeContext): any => { return { - ...(input.Coordinates !== undefined && { - Coordinates: serializeAws_restJson1GPSCoordinates(input.Coordinates, context), - }), - ...(input.RangeInKilometers !== undefined && { RangeInKilometers: input.RangeInKilometers }), + ...(input.Coordinates !== undefined && + input.Coordinates !== null && { Coordinates: serializeAws_restJson1GPSCoordinates(input.Coordinates, context) }), + ...(input.RangeInKilometers !== undefined && + input.RangeInKilometers !== null && { RangeInKilometers: input.RangeInKilometers }), }; }; const serializeAws_restJson1HoldoutActivity = (input: HoldoutActivity, context: __SerdeContext): any => { return { - ...(input.NextActivity !== undefined && { NextActivity: input.NextActivity }), - ...(input.Percentage !== undefined && { Percentage: input.Percentage }), + ...(input.NextActivity !== undefined && input.NextActivity !== null && { NextActivity: input.NextActivity }), + ...(input.Percentage !== undefined && input.Percentage !== null && { Percentage: input.Percentage }), }; }; const serializeAws_restJson1ImportJobRequest = (input: ImportJobRequest, context: __SerdeContext): any => { return { - ...(input.DefineSegment !== undefined && { DefineSegment: input.DefineSegment }), - ...(input.ExternalId !== undefined && { ExternalId: input.ExternalId }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.RegisterEndpoints !== undefined && { RegisterEndpoints: input.RegisterEndpoints }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.S3Url !== undefined && { S3Url: input.S3Url }), - ...(input.SegmentId !== undefined && { SegmentId: input.SegmentId }), - ...(input.SegmentName !== undefined && { SegmentName: input.SegmentName }), + ...(input.DefineSegment !== undefined && input.DefineSegment !== null && { DefineSegment: input.DefineSegment }), + ...(input.ExternalId !== undefined && input.ExternalId !== null && { ExternalId: input.ExternalId }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.RegisterEndpoints !== undefined && + input.RegisterEndpoints !== null && { RegisterEndpoints: input.RegisterEndpoints }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.S3Url !== undefined && input.S3Url !== null && { S3Url: input.S3Url }), + ...(input.SegmentId !== undefined && input.SegmentId !== null && { SegmentId: input.SegmentId }), + ...(input.SegmentName !== undefined && input.SegmentName !== null && { SegmentName: input.SegmentName }), }; }; const serializeAws_restJson1JourneyCustomMessage = (input: JourneyCustomMessage, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: input.Data }), + ...(input.Data !== undefined && input.Data !== null && { Data: input.Data }), }; }; const serializeAws_restJson1JourneyEmailMessage = (input: JourneyEmailMessage, context: __SerdeContext): any => { return { - ...(input.FromAddress !== undefined && { FromAddress: input.FromAddress }), + ...(input.FromAddress !== undefined && input.FromAddress !== null && { FromAddress: input.FromAddress }), }; }; const serializeAws_restJson1JourneyLimits = (input: JourneyLimits, context: __SerdeContext): any => { return { - ...(input.DailyCap !== undefined && { DailyCap: input.DailyCap }), - ...(input.EndpointReentryCap !== undefined && { EndpointReentryCap: input.EndpointReentryCap }), - ...(input.MessagesPerSecond !== undefined && { MessagesPerSecond: input.MessagesPerSecond }), + ...(input.DailyCap !== undefined && input.DailyCap !== null && { DailyCap: input.DailyCap }), + ...(input.EndpointReentryCap !== undefined && + input.EndpointReentryCap !== null && { EndpointReentryCap: input.EndpointReentryCap }), + ...(input.MessagesPerSecond !== undefined && + input.MessagesPerSecond !== null && { MessagesPerSecond: input.MessagesPerSecond }), }; }; const serializeAws_restJson1JourneyPushMessage = (input: JourneyPushMessage, context: __SerdeContext): any => { return { - ...(input.TimeToLive !== undefined && { TimeToLive: input.TimeToLive }), + ...(input.TimeToLive !== undefined && input.TimeToLive !== null && { TimeToLive: input.TimeToLive }), }; }; const serializeAws_restJson1JourneySchedule = (input: JourneySchedule, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: input.EndTime.toISOString().split(".")[0] + "Z" }), - ...(input.StartTime !== undefined && { StartTime: input.StartTime.toISOString().split(".")[0] + "Z" }), - ...(input.Timezone !== undefined && { Timezone: input.Timezone }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: input.EndTime.toISOString().split(".")[0] + "Z" }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: input.StartTime.toISOString().split(".")[0] + "Z" }), + ...(input.Timezone !== undefined && input.Timezone !== null && { Timezone: input.Timezone }), }; }; const serializeAws_restJson1JourneySMSMessage = (input: JourneySMSMessage, context: __SerdeContext): any => { return { - ...(input.MessageType !== undefined && { MessageType: input.MessageType }), - ...(input.SenderId !== undefined && { SenderId: input.SenderId }), + ...(input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType }), + ...(input.SenderId !== undefined && input.SenderId !== null && { SenderId: input.SenderId }), }; }; const serializeAws_restJson1JourneyStateRequest = (input: JourneyStateRequest, context: __SerdeContext): any => { return { - ...(input.State !== undefined && { State: input.State }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; @@ -16536,105 +16466,185 @@ const serializeAws_restJson1ListOf__EndpointTypesElement = ( input: (__EndpointTypesElement | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListOfEndpointBatchItem = (input: EndpointBatchItem[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1EndpointBatchItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1EndpointBatchItem(entry, context); + }); }; const serializeAws_restJson1ListOfMultiConditionalBranch = ( input: MultiConditionalBranch[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1MultiConditionalBranch(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MultiConditionalBranch(entry, context); + }); }; const serializeAws_restJson1ListOfRandomSplitEntry = (input: RandomSplitEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1RandomSplitEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1RandomSplitEntry(entry, context); + }); }; const serializeAws_restJson1ListOfSegmentDimensions = (input: SegmentDimensions[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SegmentDimensions(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SegmentDimensions(entry, context); + }); }; const serializeAws_restJson1ListOfSegmentGroup = (input: SegmentGroup[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SegmentGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SegmentGroup(entry, context); + }); }; const serializeAws_restJson1ListOfSegmentReference = (input: SegmentReference[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SegmentReference(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SegmentReference(entry, context); + }); }; const serializeAws_restJson1ListOfSimpleCondition = (input: SimpleCondition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SimpleCondition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SimpleCondition(entry, context); + }); }; const serializeAws_restJson1ListOfWriteTreatmentResource = ( input: WriteTreatmentResource[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1WriteTreatmentResource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1WriteTreatmentResource(entry, context); + }); }; const serializeAws_restJson1MapOf__double = (input: { [key: string]: number }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfActivity = (input: { [key: string]: Activity }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Activity }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Activity }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1Activity(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfAddressConfiguration = ( input: { [key: string]: AddressConfiguration }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AddressConfiguration }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AddressConfiguration }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1AddressConfiguration(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfAttributeDimension = ( input: { [key: string]: AttributeDimension }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: AttributeDimension }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: AttributeDimension }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1AttributeDimension(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfEndpointSendConfiguration = ( @@ -16642,135 +16652,158 @@ const serializeAws_restJson1MapOfEndpointSendConfiguration = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: EndpointSendConfiguration }, [key, value]: [string, any]) => ({ - ...acc, - [key]: serializeAws_restJson1EndpointSendConfiguration(value, context), - }), + (acc: { [key: string]: EndpointSendConfiguration }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_restJson1EndpointSendConfiguration(value, context), + }; + }, {} ); }; const serializeAws_restJson1MapOfEvent = (input: { [key: string]: Event }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: Event }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: Event }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1Event(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfEventsBatch = ( input: { [key: string]: EventsBatch }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: EventsBatch }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: EventsBatch }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1EventsBatch(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfListOf__string = ( input: { [key: string]: string[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1ListOf__string(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1MapOfMetricDimension = ( input: { [key: string]: MetricDimension }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: MetricDimension }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: MetricDimension }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1MetricDimension(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Message = (input: Message, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.ImageIconUrl !== undefined && { ImageIconUrl: input.ImageIconUrl }), - ...(input.ImageSmallIconUrl !== undefined && { ImageSmallIconUrl: input.ImageSmallIconUrl }), - ...(input.ImageUrl !== undefined && { ImageUrl: input.ImageUrl }), - ...(input.JsonBody !== undefined && { JsonBody: input.JsonBody }), - ...(input.MediaUrl !== undefined && { MediaUrl: input.MediaUrl }), - ...(input.RawContent !== undefined && { RawContent: input.RawContent }), - ...(input.SilentPush !== undefined && { SilentPush: input.SilentPush }), - ...(input.TimeToLive !== undefined && { TimeToLive: input.TimeToLive }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.ImageIconUrl !== undefined && input.ImageIconUrl !== null && { ImageIconUrl: input.ImageIconUrl }), + ...(input.ImageSmallIconUrl !== undefined && + input.ImageSmallIconUrl !== null && { ImageSmallIconUrl: input.ImageSmallIconUrl }), + ...(input.ImageUrl !== undefined && input.ImageUrl !== null && { ImageUrl: input.ImageUrl }), + ...(input.JsonBody !== undefined && input.JsonBody !== null && { JsonBody: input.JsonBody }), + ...(input.MediaUrl !== undefined && input.MediaUrl !== null && { MediaUrl: input.MediaUrl }), + ...(input.RawContent !== undefined && input.RawContent !== null && { RawContent: input.RawContent }), + ...(input.SilentPush !== undefined && input.SilentPush !== null && { SilentPush: input.SilentPush }), + ...(input.TimeToLive !== undefined && input.TimeToLive !== null && { TimeToLive: input.TimeToLive }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; const serializeAws_restJson1MessageConfiguration = (input: MessageConfiguration, context: __SerdeContext): any => { return { - ...(input.ADMMessage !== undefined && { ADMMessage: serializeAws_restJson1Message(input.ADMMessage, context) }), - ...(input.APNSMessage !== undefined && { APNSMessage: serializeAws_restJson1Message(input.APNSMessage, context) }), - ...(input.BaiduMessage !== undefined && { - BaiduMessage: serializeAws_restJson1Message(input.BaiduMessage, context), - }), - ...(input.CustomMessage !== undefined && { - CustomMessage: serializeAws_restJson1CampaignCustomMessage(input.CustomMessage, context), - }), - ...(input.DefaultMessage !== undefined && { - DefaultMessage: serializeAws_restJson1Message(input.DefaultMessage, context), - }), - ...(input.EmailMessage !== undefined && { - EmailMessage: serializeAws_restJson1CampaignEmailMessage(input.EmailMessage, context), - }), - ...(input.GCMMessage !== undefined && { GCMMessage: serializeAws_restJson1Message(input.GCMMessage, context) }), - ...(input.SMSMessage !== undefined && { - SMSMessage: serializeAws_restJson1CampaignSmsMessage(input.SMSMessage, context), - }), + ...(input.ADMMessage !== undefined && + input.ADMMessage !== null && { ADMMessage: serializeAws_restJson1Message(input.ADMMessage, context) }), + ...(input.APNSMessage !== undefined && + input.APNSMessage !== null && { APNSMessage: serializeAws_restJson1Message(input.APNSMessage, context) }), + ...(input.BaiduMessage !== undefined && + input.BaiduMessage !== null && { BaiduMessage: serializeAws_restJson1Message(input.BaiduMessage, context) }), + ...(input.CustomMessage !== undefined && + input.CustomMessage !== null && { + CustomMessage: serializeAws_restJson1CampaignCustomMessage(input.CustomMessage, context), + }), + ...(input.DefaultMessage !== undefined && + input.DefaultMessage !== null && { + DefaultMessage: serializeAws_restJson1Message(input.DefaultMessage, context), + }), + ...(input.EmailMessage !== undefined && + input.EmailMessage !== null && { + EmailMessage: serializeAws_restJson1CampaignEmailMessage(input.EmailMessage, context), + }), + ...(input.GCMMessage !== undefined && + input.GCMMessage !== null && { GCMMessage: serializeAws_restJson1Message(input.GCMMessage, context) }), + ...(input.SMSMessage !== undefined && + input.SMSMessage !== null && { SMSMessage: serializeAws_restJson1CampaignSmsMessage(input.SMSMessage, context) }), }; }; const serializeAws_restJson1MessageRequest = (input: MessageRequest, context: __SerdeContext): any => { return { - ...(input.Addresses !== undefined && { - Addresses: serializeAws_restJson1MapOfAddressConfiguration(input.Addresses, context), - }), - ...(input.Context !== undefined && { Context: serializeAws_restJson1MapOf__string(input.Context, context) }), - ...(input.Endpoints !== undefined && { - Endpoints: serializeAws_restJson1MapOfEndpointSendConfiguration(input.Endpoints, context), - }), - ...(input.MessageConfiguration !== undefined && { - MessageConfiguration: serializeAws_restJson1DirectMessageConfiguration(input.MessageConfiguration, context), - }), - ...(input.TemplateConfiguration !== undefined && { - TemplateConfiguration: serializeAws_restJson1TemplateConfiguration(input.TemplateConfiguration, context), - }), - ...(input.TraceId !== undefined && { TraceId: input.TraceId }), + ...(input.Addresses !== undefined && + input.Addresses !== null && { + Addresses: serializeAws_restJson1MapOfAddressConfiguration(input.Addresses, context), + }), + ...(input.Context !== undefined && + input.Context !== null && { Context: serializeAws_restJson1MapOf__string(input.Context, context) }), + ...(input.Endpoints !== undefined && + input.Endpoints !== null && { + Endpoints: serializeAws_restJson1MapOfEndpointSendConfiguration(input.Endpoints, context), + }), + ...(input.MessageConfiguration !== undefined && + input.MessageConfiguration !== null && { + MessageConfiguration: serializeAws_restJson1DirectMessageConfiguration(input.MessageConfiguration, context), + }), + ...(input.TemplateConfiguration !== undefined && + input.TemplateConfiguration !== null && { + TemplateConfiguration: serializeAws_restJson1TemplateConfiguration(input.TemplateConfiguration, context), + }), + ...(input.TraceId !== undefined && input.TraceId !== null && { TraceId: input.TraceId }), }; }; const serializeAws_restJson1MetricDimension = (input: MetricDimension, context: __SerdeContext): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1MultiConditionalBranch = (input: MultiConditionalBranch, context: __SerdeContext): any => { return { - ...(input.Condition !== undefined && { - Condition: serializeAws_restJson1SimpleCondition(input.Condition, context), - }), - ...(input.NextActivity !== undefined && { NextActivity: input.NextActivity }), + ...(input.Condition !== undefined && + input.Condition !== null && { Condition: serializeAws_restJson1SimpleCondition(input.Condition, context) }), + ...(input.NextActivity !== undefined && input.NextActivity !== null && { NextActivity: input.NextActivity }), }; }; @@ -16779,51 +16812,63 @@ const serializeAws_restJson1MultiConditionalSplitActivity = ( context: __SerdeContext ): any => { return { - ...(input.Branches !== undefined && { - Branches: serializeAws_restJson1ListOfMultiConditionalBranch(input.Branches, context), - }), - ...(input.DefaultActivity !== undefined && { DefaultActivity: input.DefaultActivity }), - ...(input.EvaluationWaitTime !== undefined && { - EvaluationWaitTime: serializeAws_restJson1WaitTime(input.EvaluationWaitTime, context), - }), + ...(input.Branches !== undefined && + input.Branches !== null && { + Branches: serializeAws_restJson1ListOfMultiConditionalBranch(input.Branches, context), + }), + ...(input.DefaultActivity !== undefined && + input.DefaultActivity !== null && { DefaultActivity: input.DefaultActivity }), + ...(input.EvaluationWaitTime !== undefined && + input.EvaluationWaitTime !== null && { + EvaluationWaitTime: serializeAws_restJson1WaitTime(input.EvaluationWaitTime, context), + }), }; }; const serializeAws_restJson1NumberValidateRequest = (input: NumberValidateRequest, context: __SerdeContext): any => { return { - ...(input.IsoCountryCode !== undefined && { IsoCountryCode: input.IsoCountryCode }), - ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }), + ...(input.IsoCountryCode !== undefined && + input.IsoCountryCode !== null && { IsoCountryCode: input.IsoCountryCode }), + ...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }), }; }; const serializeAws_restJson1PublicEndpoint = (input: PublicEndpoint, context: __SerdeContext): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1MapOfListOf__string(input.Attributes, context), - }), - ...(input.ChannelType !== undefined && { ChannelType: input.ChannelType }), - ...(input.Demographic !== undefined && { - Demographic: serializeAws_restJson1EndpointDemographic(input.Demographic, context), - }), - ...(input.EffectiveDate !== undefined && { EffectiveDate: input.EffectiveDate }), - ...(input.EndpointStatus !== undefined && { EndpointStatus: input.EndpointStatus }), - ...(input.Location !== undefined && { Location: serializeAws_restJson1EndpointLocation(input.Location, context) }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_restJson1MapOf__double(input.Metrics, context) }), - ...(input.OptOut !== undefined && { OptOut: input.OptOut }), - ...(input.RequestId !== undefined && { RequestId: input.RequestId }), - ...(input.User !== undefined && { User: serializeAws_restJson1EndpointUser(input.User, context) }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_restJson1MapOfListOf__string(input.Attributes, context), + }), + ...(input.ChannelType !== undefined && input.ChannelType !== null && { ChannelType: input.ChannelType }), + ...(input.Demographic !== undefined && + input.Demographic !== null && { + Demographic: serializeAws_restJson1EndpointDemographic(input.Demographic, context), + }), + ...(input.EffectiveDate !== undefined && input.EffectiveDate !== null && { EffectiveDate: input.EffectiveDate }), + ...(input.EndpointStatus !== undefined && + input.EndpointStatus !== null && { EndpointStatus: input.EndpointStatus }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_restJson1EndpointLocation(input.Location, context) }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_restJson1MapOf__double(input.Metrics, context) }), + ...(input.OptOut !== undefined && input.OptOut !== null && { OptOut: input.OptOut }), + ...(input.RequestId !== undefined && input.RequestId !== null && { RequestId: input.RequestId }), + ...(input.User !== undefined && + input.User !== null && { User: serializeAws_restJson1EndpointUser(input.User, context) }), }; }; const serializeAws_restJson1PushMessageActivity = (input: PushMessageActivity, context: __SerdeContext): any => { return { - ...(input.MessageConfig !== undefined && { - MessageConfig: serializeAws_restJson1JourneyPushMessage(input.MessageConfig, context), - }), - ...(input.NextActivity !== undefined && { NextActivity: input.NextActivity }), - ...(input.TemplateName !== undefined && { TemplateName: input.TemplateName }), - ...(input.TemplateVersion !== undefined && { TemplateVersion: input.TemplateVersion }), + ...(input.MessageConfig !== undefined && + input.MessageConfig !== null && { + MessageConfig: serializeAws_restJson1JourneyPushMessage(input.MessageConfig, context), + }), + ...(input.NextActivity !== undefined && input.NextActivity !== null && { NextActivity: input.NextActivity }), + ...(input.TemplateName !== undefined && input.TemplateName !== null && { TemplateName: input.TemplateName }), + ...(input.TemplateVersion !== undefined && + input.TemplateVersion !== null && { TemplateVersion: input.TemplateVersion }), }; }; @@ -16832,146 +16877,167 @@ const serializeAws_restJson1PushNotificationTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.ADM !== undefined && { ADM: serializeAws_restJson1AndroidPushNotificationTemplate(input.ADM, context) }), - ...(input.APNS !== undefined && { APNS: serializeAws_restJson1APNSPushNotificationTemplate(input.APNS, context) }), - ...(input.Baidu !== undefined && { - Baidu: serializeAws_restJson1AndroidPushNotificationTemplate(input.Baidu, context), - }), - ...(input.Default !== undefined && { - Default: serializeAws_restJson1DefaultPushNotificationTemplate(input.Default, context), - }), - ...(input.DefaultSubstitutions !== undefined && { DefaultSubstitutions: input.DefaultSubstitutions }), - ...(input.GCM !== undefined && { GCM: serializeAws_restJson1AndroidPushNotificationTemplate(input.GCM, context) }), - ...(input.RecommenderId !== undefined && { RecommenderId: input.RecommenderId }), - ...(input.TemplateDescription !== undefined && { TemplateDescription: input.TemplateDescription }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), + ...(input.ADM !== undefined && + input.ADM !== null && { ADM: serializeAws_restJson1AndroidPushNotificationTemplate(input.ADM, context) }), + ...(input.APNS !== undefined && + input.APNS !== null && { APNS: serializeAws_restJson1APNSPushNotificationTemplate(input.APNS, context) }), + ...(input.Baidu !== undefined && + input.Baidu !== null && { Baidu: serializeAws_restJson1AndroidPushNotificationTemplate(input.Baidu, context) }), + ...(input.Default !== undefined && + input.Default !== null && { + Default: serializeAws_restJson1DefaultPushNotificationTemplate(input.Default, context), + }), + ...(input.DefaultSubstitutions !== undefined && + input.DefaultSubstitutions !== null && { DefaultSubstitutions: input.DefaultSubstitutions }), + ...(input.GCM !== undefined && + input.GCM !== null && { GCM: serializeAws_restJson1AndroidPushNotificationTemplate(input.GCM, context) }), + ...(input.RecommenderId !== undefined && input.RecommenderId !== null && { RecommenderId: input.RecommenderId }), + ...(input.TemplateDescription !== undefined && + input.TemplateDescription !== null && { TemplateDescription: input.TemplateDescription }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), }; }; const serializeAws_restJson1QuietTime = (input: QuietTime, context: __SerdeContext): any => { return { - ...(input.End !== undefined && { End: input.End }), - ...(input.Start !== undefined && { Start: input.Start }), + ...(input.End !== undefined && input.End !== null && { End: input.End }), + ...(input.Start !== undefined && input.Start !== null && { Start: input.Start }), }; }; const serializeAws_restJson1RandomSplitActivity = (input: RandomSplitActivity, context: __SerdeContext): any => { return { - ...(input.Branches !== undefined && { - Branches: serializeAws_restJson1ListOfRandomSplitEntry(input.Branches, context), - }), + ...(input.Branches !== undefined && + input.Branches !== null && { Branches: serializeAws_restJson1ListOfRandomSplitEntry(input.Branches, context) }), }; }; const serializeAws_restJson1RandomSplitEntry = (input: RandomSplitEntry, context: __SerdeContext): any => { return { - ...(input.NextActivity !== undefined && { NextActivity: input.NextActivity }), - ...(input.Percentage !== undefined && { Percentage: input.Percentage }), + ...(input.NextActivity !== undefined && input.NextActivity !== null && { NextActivity: input.NextActivity }), + ...(input.Percentage !== undefined && input.Percentage !== null && { Percentage: input.Percentage }), }; }; const serializeAws_restJson1RawEmail = (input: RawEmail, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }), + ...(input.Data !== undefined && input.Data !== null && { Data: context.base64Encoder(input.Data) }), }; }; const serializeAws_restJson1RecencyDimension = (input: RecencyDimension, context: __SerdeContext): any => { return { - ...(input.Duration !== undefined && { Duration: input.Duration }), - ...(input.RecencyType !== undefined && { RecencyType: input.RecencyType }), + ...(input.Duration !== undefined && input.Duration !== null && { Duration: input.Duration }), + ...(input.RecencyType !== undefined && input.RecencyType !== null && { RecencyType: input.RecencyType }), }; }; const serializeAws_restJson1Schedule = (input: Schedule, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: input.EndTime }), - ...(input.EventFilter !== undefined && { - EventFilter: serializeAws_restJson1CampaignEventFilter(input.EventFilter, context), - }), - ...(input.Frequency !== undefined && { Frequency: input.Frequency }), - ...(input.IsLocalTime !== undefined && { IsLocalTime: input.IsLocalTime }), - ...(input.QuietTime !== undefined && { QuietTime: serializeAws_restJson1QuietTime(input.QuietTime, context) }), - ...(input.StartTime !== undefined && { StartTime: input.StartTime }), - ...(input.Timezone !== undefined && { Timezone: input.Timezone }), + ...(input.EndTime !== undefined && input.EndTime !== null && { EndTime: input.EndTime }), + ...(input.EventFilter !== undefined && + input.EventFilter !== null && { + EventFilter: serializeAws_restJson1CampaignEventFilter(input.EventFilter, context), + }), + ...(input.Frequency !== undefined && input.Frequency !== null && { Frequency: input.Frequency }), + ...(input.IsLocalTime !== undefined && input.IsLocalTime !== null && { IsLocalTime: input.IsLocalTime }), + ...(input.QuietTime !== undefined && + input.QuietTime !== null && { QuietTime: serializeAws_restJson1QuietTime(input.QuietTime, context) }), + ...(input.StartTime !== undefined && input.StartTime !== null && { StartTime: input.StartTime }), + ...(input.Timezone !== undefined && input.Timezone !== null && { Timezone: input.Timezone }), }; }; const serializeAws_restJson1SegmentBehaviors = (input: SegmentBehaviors, context: __SerdeContext): any => { return { - ...(input.Recency !== undefined && { Recency: serializeAws_restJson1RecencyDimension(input.Recency, context) }), + ...(input.Recency !== undefined && + input.Recency !== null && { Recency: serializeAws_restJson1RecencyDimension(input.Recency, context) }), }; }; const serializeAws_restJson1SegmentCondition = (input: SegmentCondition, context: __SerdeContext): any => { return { - ...(input.SegmentId !== undefined && { SegmentId: input.SegmentId }), + ...(input.SegmentId !== undefined && input.SegmentId !== null && { SegmentId: input.SegmentId }), }; }; const serializeAws_restJson1SegmentDemographics = (input: SegmentDemographics, context: __SerdeContext): any => { return { - ...(input.AppVersion !== undefined && { - AppVersion: serializeAws_restJson1SetDimension(input.AppVersion, context), - }), - ...(input.Channel !== undefined && { Channel: serializeAws_restJson1SetDimension(input.Channel, context) }), - ...(input.DeviceType !== undefined && { - DeviceType: serializeAws_restJson1SetDimension(input.DeviceType, context), - }), - ...(input.Make !== undefined && { Make: serializeAws_restJson1SetDimension(input.Make, context) }), - ...(input.Model !== undefined && { Model: serializeAws_restJson1SetDimension(input.Model, context) }), - ...(input.Platform !== undefined && { Platform: serializeAws_restJson1SetDimension(input.Platform, context) }), + ...(input.AppVersion !== undefined && + input.AppVersion !== null && { AppVersion: serializeAws_restJson1SetDimension(input.AppVersion, context) }), + ...(input.Channel !== undefined && + input.Channel !== null && { Channel: serializeAws_restJson1SetDimension(input.Channel, context) }), + ...(input.DeviceType !== undefined && + input.DeviceType !== null && { DeviceType: serializeAws_restJson1SetDimension(input.DeviceType, context) }), + ...(input.Make !== undefined && + input.Make !== null && { Make: serializeAws_restJson1SetDimension(input.Make, context) }), + ...(input.Model !== undefined && + input.Model !== null && { Model: serializeAws_restJson1SetDimension(input.Model, context) }), + ...(input.Platform !== undefined && + input.Platform !== null && { Platform: serializeAws_restJson1SetDimension(input.Platform, context) }), }; }; const serializeAws_restJson1SegmentDimensions = (input: SegmentDimensions, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1MapOfAttributeDimension(input.Attributes, context), - }), - ...(input.Behavior !== undefined && { Behavior: serializeAws_restJson1SegmentBehaviors(input.Behavior, context) }), - ...(input.Demographic !== undefined && { - Demographic: serializeAws_restJson1SegmentDemographics(input.Demographic, context), - }), - ...(input.Location !== undefined && { Location: serializeAws_restJson1SegmentLocation(input.Location, context) }), - ...(input.Metrics !== undefined && { Metrics: serializeAws_restJson1MapOfMetricDimension(input.Metrics, context) }), - ...(input.UserAttributes !== undefined && { - UserAttributes: serializeAws_restJson1MapOfAttributeDimension(input.UserAttributes, context), - }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_restJson1MapOfAttributeDimension(input.Attributes, context), + }), + ...(input.Behavior !== undefined && + input.Behavior !== null && { Behavior: serializeAws_restJson1SegmentBehaviors(input.Behavior, context) }), + ...(input.Demographic !== undefined && + input.Demographic !== null && { + Demographic: serializeAws_restJson1SegmentDemographics(input.Demographic, context), + }), + ...(input.Location !== undefined && + input.Location !== null && { Location: serializeAws_restJson1SegmentLocation(input.Location, context) }), + ...(input.Metrics !== undefined && + input.Metrics !== null && { Metrics: serializeAws_restJson1MapOfMetricDimension(input.Metrics, context) }), + ...(input.UserAttributes !== undefined && + input.UserAttributes !== null && { + UserAttributes: serializeAws_restJson1MapOfAttributeDimension(input.UserAttributes, context), + }), }; }; const serializeAws_restJson1SegmentGroup = (input: SegmentGroup, context: __SerdeContext): any => { return { - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_restJson1ListOfSegmentDimensions(input.Dimensions, context), - }), - ...(input.SourceSegments !== undefined && { - SourceSegments: serializeAws_restJson1ListOfSegmentReference(input.SourceSegments, context), - }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { + Dimensions: serializeAws_restJson1ListOfSegmentDimensions(input.Dimensions, context), + }), + ...(input.SourceSegments !== undefined && + input.SourceSegments !== null && { + SourceSegments: serializeAws_restJson1ListOfSegmentReference(input.SourceSegments, context), + }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1SegmentGroupList = (input: SegmentGroupList, context: __SerdeContext): any => { return { - ...(input.Groups !== undefined && { Groups: serializeAws_restJson1ListOfSegmentGroup(input.Groups, context) }), - ...(input.Include !== undefined && { Include: input.Include }), + ...(input.Groups !== undefined && + input.Groups !== null && { Groups: serializeAws_restJson1ListOfSegmentGroup(input.Groups, context) }), + ...(input.Include !== undefined && input.Include !== null && { Include: input.Include }), }; }; const serializeAws_restJson1SegmentLocation = (input: SegmentLocation, context: __SerdeContext): any => { return { - ...(input.Country !== undefined && { Country: serializeAws_restJson1SetDimension(input.Country, context) }), - ...(input.GPSPoint !== undefined && { GPSPoint: serializeAws_restJson1GPSPointDimension(input.GPSPoint, context) }), + ...(input.Country !== undefined && + input.Country !== null && { Country: serializeAws_restJson1SetDimension(input.Country, context) }), + ...(input.GPSPoint !== undefined && + input.GPSPoint !== null && { GPSPoint: serializeAws_restJson1GPSPointDimension(input.GPSPoint, context) }), }; }; const serializeAws_restJson1SegmentReference = (input: SegmentReference, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -16980,130 +17046,150 @@ const serializeAws_restJson1SendUsersMessageRequest = ( context: __SerdeContext ): any => { return { - ...(input.Context !== undefined && { Context: serializeAws_restJson1MapOf__string(input.Context, context) }), - ...(input.MessageConfiguration !== undefined && { - MessageConfiguration: serializeAws_restJson1DirectMessageConfiguration(input.MessageConfiguration, context), - }), - ...(input.TemplateConfiguration !== undefined && { - TemplateConfiguration: serializeAws_restJson1TemplateConfiguration(input.TemplateConfiguration, context), - }), - ...(input.TraceId !== undefined && { TraceId: input.TraceId }), - ...(input.Users !== undefined && { - Users: serializeAws_restJson1MapOfEndpointSendConfiguration(input.Users, context), - }), + ...(input.Context !== undefined && + input.Context !== null && { Context: serializeAws_restJson1MapOf__string(input.Context, context) }), + ...(input.MessageConfiguration !== undefined && + input.MessageConfiguration !== null && { + MessageConfiguration: serializeAws_restJson1DirectMessageConfiguration(input.MessageConfiguration, context), + }), + ...(input.TemplateConfiguration !== undefined && + input.TemplateConfiguration !== null && { + TemplateConfiguration: serializeAws_restJson1TemplateConfiguration(input.TemplateConfiguration, context), + }), + ...(input.TraceId !== undefined && input.TraceId !== null && { TraceId: input.TraceId }), + ...(input.Users !== undefined && + input.Users !== null && { Users: serializeAws_restJson1MapOfEndpointSendConfiguration(input.Users, context) }), }; }; const serializeAws_restJson1Session = (input: Session, context: __SerdeContext): any => { return { - ...(input.Duration !== undefined && { Duration: input.Duration }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.StartTimestamp !== undefined && { StartTimestamp: input.StartTimestamp }), - ...(input.StopTimestamp !== undefined && { StopTimestamp: input.StopTimestamp }), + ...(input.Duration !== undefined && input.Duration !== null && { Duration: input.Duration }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.StartTimestamp !== undefined && + input.StartTimestamp !== null && { StartTimestamp: input.StartTimestamp }), + ...(input.StopTimestamp !== undefined && input.StopTimestamp !== null && { StopTimestamp: input.StopTimestamp }), }; }; const serializeAws_restJson1SetDimension = (input: SetDimension, context: __SerdeContext): any => { return { - ...(input.DimensionType !== undefined && { DimensionType: input.DimensionType }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1ListOf__string(input.Values, context) }), + ...(input.DimensionType !== undefined && input.DimensionType !== null && { DimensionType: input.DimensionType }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1ListOf__string(input.Values, context) }), }; }; const serializeAws_restJson1SimpleCondition = (input: SimpleCondition, context: __SerdeContext): any => { return { - ...(input.EventCondition !== undefined && { - EventCondition: serializeAws_restJson1EventCondition(input.EventCondition, context), - }), - ...(input.SegmentCondition !== undefined && { - SegmentCondition: serializeAws_restJson1SegmentCondition(input.SegmentCondition, context), - }), - ...(input.SegmentDimensions !== undefined && { - segmentDimensions: serializeAws_restJson1SegmentDimensions(input.SegmentDimensions, context), - }), + ...(input.EventCondition !== undefined && + input.EventCondition !== null && { + EventCondition: serializeAws_restJson1EventCondition(input.EventCondition, context), + }), + ...(input.SegmentCondition !== undefined && + input.SegmentCondition !== null && { + SegmentCondition: serializeAws_restJson1SegmentCondition(input.SegmentCondition, context), + }), + ...(input.SegmentDimensions !== undefined && + input.SegmentDimensions !== null && { + segmentDimensions: serializeAws_restJson1SegmentDimensions(input.SegmentDimensions, context), + }), }; }; const serializeAws_restJson1SimpleEmail = (input: SimpleEmail, context: __SerdeContext): any => { return { - ...(input.HtmlPart !== undefined && { HtmlPart: serializeAws_restJson1SimpleEmailPart(input.HtmlPart, context) }), - ...(input.Subject !== undefined && { Subject: serializeAws_restJson1SimpleEmailPart(input.Subject, context) }), - ...(input.TextPart !== undefined && { TextPart: serializeAws_restJson1SimpleEmailPart(input.TextPart, context) }), + ...(input.HtmlPart !== undefined && + input.HtmlPart !== null && { HtmlPart: serializeAws_restJson1SimpleEmailPart(input.HtmlPart, context) }), + ...(input.Subject !== undefined && + input.Subject !== null && { Subject: serializeAws_restJson1SimpleEmailPart(input.Subject, context) }), + ...(input.TextPart !== undefined && + input.TextPart !== null && { TextPart: serializeAws_restJson1SimpleEmailPart(input.TextPart, context) }), }; }; const serializeAws_restJson1SimpleEmailPart = (input: SimpleEmailPart, context: __SerdeContext): any => { return { - ...(input.Charset !== undefined && { Charset: input.Charset }), - ...(input.Data !== undefined && { Data: input.Data }), + ...(input.Charset !== undefined && input.Charset !== null && { Charset: input.Charset }), + ...(input.Data !== undefined && input.Data !== null && { Data: input.Data }), }; }; const serializeAws_restJson1SMSChannelRequest = (input: SMSChannelRequest, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.SenderId !== undefined && { SenderId: input.SenderId }), - ...(input.ShortCode !== undefined && { ShortCode: input.ShortCode }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.SenderId !== undefined && input.SenderId !== null && { SenderId: input.SenderId }), + ...(input.ShortCode !== undefined && input.ShortCode !== null && { ShortCode: input.ShortCode }), }; }; const serializeAws_restJson1SMSMessage = (input: SMSMessage, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.Keyword !== undefined && { Keyword: input.Keyword }), - ...(input.MediaUrl !== undefined && { MediaUrl: input.MediaUrl }), - ...(input.MessageType !== undefined && { MessageType: input.MessageType }), - ...(input.OriginationNumber !== undefined && { OriginationNumber: input.OriginationNumber }), - ...(input.SenderId !== undefined && { SenderId: input.SenderId }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.Keyword !== undefined && input.Keyword !== null && { Keyword: input.Keyword }), + ...(input.MediaUrl !== undefined && input.MediaUrl !== null && { MediaUrl: input.MediaUrl }), + ...(input.MessageType !== undefined && input.MessageType !== null && { MessageType: input.MessageType }), + ...(input.OriginationNumber !== undefined && + input.OriginationNumber !== null && { OriginationNumber: input.OriginationNumber }), + ...(input.SenderId !== undefined && input.SenderId !== null && { SenderId: input.SenderId }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), }; }; const serializeAws_restJson1SMSMessageActivity = (input: SMSMessageActivity, context: __SerdeContext): any => { return { - ...(input.MessageConfig !== undefined && { - MessageConfig: serializeAws_restJson1JourneySMSMessage(input.MessageConfig, context), - }), - ...(input.NextActivity !== undefined && { NextActivity: input.NextActivity }), - ...(input.TemplateName !== undefined && { TemplateName: input.TemplateName }), - ...(input.TemplateVersion !== undefined && { TemplateVersion: input.TemplateVersion }), + ...(input.MessageConfig !== undefined && + input.MessageConfig !== null && { + MessageConfig: serializeAws_restJson1JourneySMSMessage(input.MessageConfig, context), + }), + ...(input.NextActivity !== undefined && input.NextActivity !== null && { NextActivity: input.NextActivity }), + ...(input.TemplateName !== undefined && input.TemplateName !== null && { TemplateName: input.TemplateName }), + ...(input.TemplateVersion !== undefined && + input.TemplateVersion !== null && { TemplateVersion: input.TemplateVersion }), }; }; const serializeAws_restJson1SMSTemplateRequest = (input: SMSTemplateRequest, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.DefaultSubstitutions !== undefined && { DefaultSubstitutions: input.DefaultSubstitutions }), - ...(input.RecommenderId !== undefined && { RecommenderId: input.RecommenderId }), - ...(input.TemplateDescription !== undefined && { TemplateDescription: input.TemplateDescription }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.DefaultSubstitutions !== undefined && + input.DefaultSubstitutions !== null && { DefaultSubstitutions: input.DefaultSubstitutions }), + ...(input.RecommenderId !== undefined && input.RecommenderId !== null && { RecommenderId: input.RecommenderId }), + ...(input.TemplateDescription !== undefined && + input.TemplateDescription !== null && { TemplateDescription: input.TemplateDescription }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), }; }; const serializeAws_restJson1StartCondition = (input: StartCondition, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EventStartCondition !== undefined && { - EventStartCondition: serializeAws_restJson1EventStartCondition(input.EventStartCondition, context), - }), - ...(input.SegmentStartCondition !== undefined && { - SegmentStartCondition: serializeAws_restJson1SegmentCondition(input.SegmentStartCondition, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EventStartCondition !== undefined && + input.EventStartCondition !== null && { + EventStartCondition: serializeAws_restJson1EventStartCondition(input.EventStartCondition, context), + }), + ...(input.SegmentStartCondition !== undefined && + input.SegmentStartCondition !== null && { + SegmentStartCondition: serializeAws_restJson1SegmentCondition(input.SegmentStartCondition, context), + }), }; }; const serializeAws_restJson1TagsModel = (input: TagsModel, context: __SerdeContext): any => { return { - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), }; }; const serializeAws_restJson1Template = (input: Template, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -17112,22 +17198,20 @@ const serializeAws_restJson1TemplateActiveVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_restJson1TemplateConfiguration = (input: TemplateConfiguration, context: __SerdeContext): any => { return { - ...(input.EmailTemplate !== undefined && { - EmailTemplate: serializeAws_restJson1Template(input.EmailTemplate, context), - }), - ...(input.PushTemplate !== undefined && { - PushTemplate: serializeAws_restJson1Template(input.PushTemplate, context), - }), - ...(input.SMSTemplate !== undefined && { SMSTemplate: serializeAws_restJson1Template(input.SMSTemplate, context) }), - ...(input.VoiceTemplate !== undefined && { - VoiceTemplate: serializeAws_restJson1Template(input.VoiceTemplate, context), - }), + ...(input.EmailTemplate !== undefined && + input.EmailTemplate !== null && { EmailTemplate: serializeAws_restJson1Template(input.EmailTemplate, context) }), + ...(input.PushTemplate !== undefined && + input.PushTemplate !== null && { PushTemplate: serializeAws_restJson1Template(input.PushTemplate, context) }), + ...(input.SMSTemplate !== undefined && + input.SMSTemplate !== null && { SMSTemplate: serializeAws_restJson1Template(input.SMSTemplate, context) }), + ...(input.VoiceTemplate !== undefined && + input.VoiceTemplate !== null && { VoiceTemplate: serializeAws_restJson1Template(input.VoiceTemplate, context) }), }; }; @@ -17136,7 +17220,8 @@ const serializeAws_restJson1UpdateAttributesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Blacklist !== undefined && { Blacklist: serializeAws_restJson1ListOf__string(input.Blacklist, context) }), + ...(input.Blacklist !== undefined && + input.Blacklist !== null && { Blacklist: serializeAws_restJson1ListOf__string(input.Blacklist, context) }), }; }; @@ -17145,72 +17230,77 @@ const serializeAws_restJson1UpdateRecommenderConfigurationShape = ( context: __SerdeContext ): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1MapOf__string(input.Attributes, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RecommendationProviderIdType !== undefined && { - RecommendationProviderIdType: input.RecommendationProviderIdType, - }), - ...(input.RecommendationProviderRoleArn !== undefined && { - RecommendationProviderRoleArn: input.RecommendationProviderRoleArn, - }), - ...(input.RecommendationProviderUri !== undefined && { - RecommendationProviderUri: input.RecommendationProviderUri, - }), - ...(input.RecommendationTransformerUri !== undefined && { - RecommendationTransformerUri: input.RecommendationTransformerUri, - }), - ...(input.RecommendationsDisplayName !== undefined && { - RecommendationsDisplayName: input.RecommendationsDisplayName, - }), - ...(input.RecommendationsPerMessage !== undefined && { - RecommendationsPerMessage: input.RecommendationsPerMessage, - }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1MapOf__string(input.Attributes, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RecommendationProviderIdType !== undefined && + input.RecommendationProviderIdType !== null && { + RecommendationProviderIdType: input.RecommendationProviderIdType, + }), + ...(input.RecommendationProviderRoleArn !== undefined && + input.RecommendationProviderRoleArn !== null && { + RecommendationProviderRoleArn: input.RecommendationProviderRoleArn, + }), + ...(input.RecommendationProviderUri !== undefined && + input.RecommendationProviderUri !== null && { RecommendationProviderUri: input.RecommendationProviderUri }), + ...(input.RecommendationTransformerUri !== undefined && + input.RecommendationTransformerUri !== null && { + RecommendationTransformerUri: input.RecommendationTransformerUri, + }), + ...(input.RecommendationsDisplayName !== undefined && + input.RecommendationsDisplayName !== null && { RecommendationsDisplayName: input.RecommendationsDisplayName }), + ...(input.RecommendationsPerMessage !== undefined && + input.RecommendationsPerMessage !== null && { RecommendationsPerMessage: input.RecommendationsPerMessage }), }; }; const serializeAws_restJson1VoiceChannelRequest = (input: VoiceChannelRequest, context: __SerdeContext): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; const serializeAws_restJson1VoiceMessage = (input: VoiceMessage, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.OriginationNumber !== undefined && { OriginationNumber: input.OriginationNumber }), - ...(input.Substitutions !== undefined && { - Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), - }), - ...(input.VoiceId !== undefined && { VoiceId: input.VoiceId }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.OriginationNumber !== undefined && + input.OriginationNumber !== null && { OriginationNumber: input.OriginationNumber }), + ...(input.Substitutions !== undefined && + input.Substitutions !== null && { + Substitutions: serializeAws_restJson1MapOfListOf__string(input.Substitutions, context), + }), + ...(input.VoiceId !== undefined && input.VoiceId !== null && { VoiceId: input.VoiceId }), }; }; const serializeAws_restJson1VoiceTemplateRequest = (input: VoiceTemplateRequest, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: input.Body }), - ...(input.DefaultSubstitutions !== undefined && { DefaultSubstitutions: input.DefaultSubstitutions }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.TemplateDescription !== undefined && { TemplateDescription: input.TemplateDescription }), - ...(input.VoiceId !== undefined && { VoiceId: input.VoiceId }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), + ...(input.Body !== undefined && input.Body !== null && { Body: input.Body }), + ...(input.DefaultSubstitutions !== undefined && + input.DefaultSubstitutions !== null && { DefaultSubstitutions: input.DefaultSubstitutions }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.TemplateDescription !== undefined && + input.TemplateDescription !== null && { TemplateDescription: input.TemplateDescription }), + ...(input.VoiceId !== undefined && input.VoiceId !== null && { VoiceId: input.VoiceId }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), }; }; const serializeAws_restJson1WaitActivity = (input: WaitActivity, context: __SerdeContext): any => { return { - ...(input.NextActivity !== undefined && { NextActivity: input.NextActivity }), - ...(input.WaitTime !== undefined && { WaitTime: serializeAws_restJson1WaitTime(input.WaitTime, context) }), + ...(input.NextActivity !== undefined && input.NextActivity !== null && { NextActivity: input.NextActivity }), + ...(input.WaitTime !== undefined && + input.WaitTime !== null && { WaitTime: serializeAws_restJson1WaitTime(input.WaitTime, context) }), }; }; const serializeAws_restJson1WaitTime = (input: WaitTime, context: __SerdeContext): any => { return { - ...(input.WaitFor !== undefined && { WaitFor: input.WaitFor }), - ...(input.WaitUntil !== undefined && { WaitUntil: input.WaitUntil }), + ...(input.WaitFor !== undefined && input.WaitFor !== null && { WaitFor: input.WaitFor }), + ...(input.WaitUntil !== undefined && input.WaitUntil !== null && { WaitUntil: input.WaitUntil }), }; }; @@ -17219,107 +17309,133 @@ const serializeAws_restJson1WriteApplicationSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CampaignHook !== undefined && { - CampaignHook: serializeAws_restJson1CampaignHook(input.CampaignHook, context), - }), - ...(input.CloudWatchMetricsEnabled !== undefined && { CloudWatchMetricsEnabled: input.CloudWatchMetricsEnabled }), - ...(input.EventTaggingEnabled !== undefined && { EventTaggingEnabled: input.EventTaggingEnabled }), - ...(input.Limits !== undefined && { Limits: serializeAws_restJson1CampaignLimits(input.Limits, context) }), - ...(input.QuietTime !== undefined && { QuietTime: serializeAws_restJson1QuietTime(input.QuietTime, context) }), + ...(input.CampaignHook !== undefined && + input.CampaignHook !== null && { CampaignHook: serializeAws_restJson1CampaignHook(input.CampaignHook, context) }), + ...(input.CloudWatchMetricsEnabled !== undefined && + input.CloudWatchMetricsEnabled !== null && { CloudWatchMetricsEnabled: input.CloudWatchMetricsEnabled }), + ...(input.EventTaggingEnabled !== undefined && + input.EventTaggingEnabled !== null && { EventTaggingEnabled: input.EventTaggingEnabled }), + ...(input.Limits !== undefined && + input.Limits !== null && { Limits: serializeAws_restJson1CampaignLimits(input.Limits, context) }), + ...(input.QuietTime !== undefined && + input.QuietTime !== null && { QuietTime: serializeAws_restJson1QuietTime(input.QuietTime, context) }), }; }; const serializeAws_restJson1WriteCampaignRequest = (input: WriteCampaignRequest, context: __SerdeContext): any => { return { - ...(input.AdditionalTreatments !== undefined && { - AdditionalTreatments: serializeAws_restJson1ListOfWriteTreatmentResource(input.AdditionalTreatments, context), - }), - ...(input.CustomDeliveryConfiguration !== undefined && { - CustomDeliveryConfiguration: serializeAws_restJson1CustomDeliveryConfiguration( - input.CustomDeliveryConfiguration, - context - ), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.HoldoutPercent !== undefined && { HoldoutPercent: input.HoldoutPercent }), - ...(input.Hook !== undefined && { Hook: serializeAws_restJson1CampaignHook(input.Hook, context) }), - ...(input.IsPaused !== undefined && { IsPaused: input.IsPaused }), - ...(input.Limits !== undefined && { Limits: serializeAws_restJson1CampaignLimits(input.Limits, context) }), - ...(input.MessageConfiguration !== undefined && { - MessageConfiguration: serializeAws_restJson1MessageConfiguration(input.MessageConfiguration, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Schedule !== undefined && { Schedule: serializeAws_restJson1Schedule(input.Schedule, context) }), - ...(input.SegmentId !== undefined && { SegmentId: input.SegmentId }), - ...(input.SegmentVersion !== undefined && { SegmentVersion: input.SegmentVersion }), - ...(input.TemplateConfiguration !== undefined && { - TemplateConfiguration: serializeAws_restJson1TemplateConfiguration(input.TemplateConfiguration, context), - }), - ...(input.TreatmentDescription !== undefined && { TreatmentDescription: input.TreatmentDescription }), - ...(input.TreatmentName !== undefined && { TreatmentName: input.TreatmentName }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), + ...(input.AdditionalTreatments !== undefined && + input.AdditionalTreatments !== null && { + AdditionalTreatments: serializeAws_restJson1ListOfWriteTreatmentResource(input.AdditionalTreatments, context), + }), + ...(input.CustomDeliveryConfiguration !== undefined && + input.CustomDeliveryConfiguration !== null && { + CustomDeliveryConfiguration: serializeAws_restJson1CustomDeliveryConfiguration( + input.CustomDeliveryConfiguration, + context + ), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.HoldoutPercent !== undefined && + input.HoldoutPercent !== null && { HoldoutPercent: input.HoldoutPercent }), + ...(input.Hook !== undefined && + input.Hook !== null && { Hook: serializeAws_restJson1CampaignHook(input.Hook, context) }), + ...(input.IsPaused !== undefined && input.IsPaused !== null && { IsPaused: input.IsPaused }), + ...(input.Limits !== undefined && + input.Limits !== null && { Limits: serializeAws_restJson1CampaignLimits(input.Limits, context) }), + ...(input.MessageConfiguration !== undefined && + input.MessageConfiguration !== null && { + MessageConfiguration: serializeAws_restJson1MessageConfiguration(input.MessageConfiguration, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Schedule !== undefined && + input.Schedule !== null && { Schedule: serializeAws_restJson1Schedule(input.Schedule, context) }), + ...(input.SegmentId !== undefined && input.SegmentId !== null && { SegmentId: input.SegmentId }), + ...(input.SegmentVersion !== undefined && + input.SegmentVersion !== null && { SegmentVersion: input.SegmentVersion }), + ...(input.TemplateConfiguration !== undefined && + input.TemplateConfiguration !== null && { + TemplateConfiguration: serializeAws_restJson1TemplateConfiguration(input.TemplateConfiguration, context), + }), + ...(input.TreatmentDescription !== undefined && + input.TreatmentDescription !== null && { TreatmentDescription: input.TreatmentDescription }), + ...(input.TreatmentName !== undefined && input.TreatmentName !== null && { TreatmentName: input.TreatmentName }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), }; }; const serializeAws_restJson1WriteEventStream = (input: WriteEventStream, context: __SerdeContext): any => { return { - ...(input.DestinationStreamArn !== undefined && { DestinationStreamArn: input.DestinationStreamArn }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.DestinationStreamArn !== undefined && + input.DestinationStreamArn !== null && { DestinationStreamArn: input.DestinationStreamArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_restJson1WriteJourneyRequest = (input: WriteJourneyRequest, context: __SerdeContext): any => { return { - ...(input.Activities !== undefined && { - Activities: serializeAws_restJson1MapOfActivity(input.Activities, context), - }), - ...(input.CreationDate !== undefined && { CreationDate: input.CreationDate }), - ...(input.LastModifiedDate !== undefined && { LastModifiedDate: input.LastModifiedDate }), - ...(input.Limits !== undefined && { Limits: serializeAws_restJson1JourneyLimits(input.Limits, context) }), - ...(input.LocalTime !== undefined && { LocalTime: input.LocalTime }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.QuietTime !== undefined && { QuietTime: serializeAws_restJson1QuietTime(input.QuietTime, context) }), - ...(input.RefreshFrequency !== undefined && { RefreshFrequency: input.RefreshFrequency }), - ...(input.Schedule !== undefined && { Schedule: serializeAws_restJson1JourneySchedule(input.Schedule, context) }), - ...(input.StartActivity !== undefined && { StartActivity: input.StartActivity }), - ...(input.StartCondition !== undefined && { - StartCondition: serializeAws_restJson1StartCondition(input.StartCondition, context), - }), - ...(input.State !== undefined && { State: input.State }), + ...(input.Activities !== undefined && + input.Activities !== null && { Activities: serializeAws_restJson1MapOfActivity(input.Activities, context) }), + ...(input.CreationDate !== undefined && input.CreationDate !== null && { CreationDate: input.CreationDate }), + ...(input.LastModifiedDate !== undefined && + input.LastModifiedDate !== null && { LastModifiedDate: input.LastModifiedDate }), + ...(input.Limits !== undefined && + input.Limits !== null && { Limits: serializeAws_restJson1JourneyLimits(input.Limits, context) }), + ...(input.LocalTime !== undefined && input.LocalTime !== null && { LocalTime: input.LocalTime }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.QuietTime !== undefined && + input.QuietTime !== null && { QuietTime: serializeAws_restJson1QuietTime(input.QuietTime, context) }), + ...(input.RefreshFrequency !== undefined && + input.RefreshFrequency !== null && { RefreshFrequency: input.RefreshFrequency }), + ...(input.Schedule !== undefined && + input.Schedule !== null && { Schedule: serializeAws_restJson1JourneySchedule(input.Schedule, context) }), + ...(input.StartActivity !== undefined && input.StartActivity !== null && { StartActivity: input.StartActivity }), + ...(input.StartCondition !== undefined && + input.StartCondition !== null && { + StartCondition: serializeAws_restJson1StartCondition(input.StartCondition, context), + }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; const serializeAws_restJson1WriteSegmentRequest = (input: WriteSegmentRequest, context: __SerdeContext): any => { return { - ...(input.Dimensions !== undefined && { - Dimensions: serializeAws_restJson1SegmentDimensions(input.Dimensions, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SegmentGroups !== undefined && { - SegmentGroups: serializeAws_restJson1SegmentGroupList(input.SegmentGroups, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_restJson1SegmentDimensions(input.Dimensions, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SegmentGroups !== undefined && + input.SegmentGroups !== null && { + SegmentGroups: serializeAws_restJson1SegmentGroupList(input.SegmentGroups, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1MapOf__string(input.tags, context) }), }; }; const serializeAws_restJson1WriteTreatmentResource = (input: WriteTreatmentResource, context: __SerdeContext): any => { return { - ...(input.CustomDeliveryConfiguration !== undefined && { - CustomDeliveryConfiguration: serializeAws_restJson1CustomDeliveryConfiguration( - input.CustomDeliveryConfiguration, - context - ), - }), - ...(input.MessageConfiguration !== undefined && { - MessageConfiguration: serializeAws_restJson1MessageConfiguration(input.MessageConfiguration, context), - }), - ...(input.Schedule !== undefined && { Schedule: serializeAws_restJson1Schedule(input.Schedule, context) }), - ...(input.SizePercent !== undefined && { SizePercent: input.SizePercent }), - ...(input.TemplateConfiguration !== undefined && { - TemplateConfiguration: serializeAws_restJson1TemplateConfiguration(input.TemplateConfiguration, context), - }), - ...(input.TreatmentDescription !== undefined && { TreatmentDescription: input.TreatmentDescription }), - ...(input.TreatmentName !== undefined && { TreatmentName: input.TreatmentName }), + ...(input.CustomDeliveryConfiguration !== undefined && + input.CustomDeliveryConfiguration !== null && { + CustomDeliveryConfiguration: serializeAws_restJson1CustomDeliveryConfiguration( + input.CustomDeliveryConfiguration, + context + ), + }), + ...(input.MessageConfiguration !== undefined && + input.MessageConfiguration !== null && { + MessageConfiguration: serializeAws_restJson1MessageConfiguration(input.MessageConfiguration, context), + }), + ...(input.Schedule !== undefined && + input.Schedule !== null && { Schedule: serializeAws_restJson1Schedule(input.Schedule, context) }), + ...(input.SizePercent !== undefined && input.SizePercent !== null && { SizePercent: input.SizePercent }), + ...(input.TemplateConfiguration !== undefined && + input.TemplateConfiguration !== null && { + TemplateConfiguration: serializeAws_restJson1TemplateConfiguration(input.TemplateConfiguration, context), + }), + ...(input.TreatmentDescription !== undefined && + input.TreatmentDescription !== null && { TreatmentDescription: input.TreatmentDescription }), + ...(input.TreatmentName !== undefined && input.TreatmentName !== null && { TreatmentName: input.TreatmentName }), }; }; @@ -18537,103 +18653,257 @@ const deserializeAws_restJson1ListOf__EndpointTypesElement = ( output: any, context: __SerdeContext ): (__EndpointTypesElement | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ListOfActivityResponse = (output: any, context: __SerdeContext): ActivityResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ActivityResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ActivityResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfApplicationResponse = ( output: any, context: __SerdeContext ): ApplicationResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ApplicationResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ApplicationResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfCampaignResponse = (output: any, context: __SerdeContext): CampaignResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CampaignResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CampaignResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfEndpointResponse = (output: any, context: __SerdeContext): EndpointResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EndpointResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EndpointResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfExportJobResponse = (output: any, context: __SerdeContext): ExportJobResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ExportJobResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ExportJobResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfImportJobResponse = (output: any, context: __SerdeContext): ImportJobResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ImportJobResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ImportJobResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfJourneyResponse = (output: any, context: __SerdeContext): JourneyResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JourneyResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JourneyResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfMultiConditionalBranch = ( output: any, context: __SerdeContext ): MultiConditionalBranch[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MultiConditionalBranch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MultiConditionalBranch(entry, context); + }); }; const deserializeAws_restJson1ListOfRandomSplitEntry = (output: any, context: __SerdeContext): RandomSplitEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RandomSplitEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RandomSplitEntry(entry, context); + }); }; const deserializeAws_restJson1ListOfRecommenderConfigurationResponse = ( output: any, context: __SerdeContext ): RecommenderConfigurationResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RecommenderConfigurationResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RecommenderConfigurationResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfResultRow = (output: any, context: __SerdeContext): ResultRow[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResultRow(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResultRow(entry, context); + }); }; const deserializeAws_restJson1ListOfResultRowValue = (output: any, context: __SerdeContext): ResultRowValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResultRowValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResultRowValue(entry, context); + }); }; const deserializeAws_restJson1ListOfSegmentDimensions = (output: any, context: __SerdeContext): SegmentDimensions[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SegmentDimensions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SegmentDimensions(entry, context); + }); }; const deserializeAws_restJson1ListOfSegmentGroup = (output: any, context: __SerdeContext): SegmentGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SegmentGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SegmentGroup(entry, context); + }); }; const deserializeAws_restJson1ListOfSegmentReference = (output: any, context: __SerdeContext): SegmentReference[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SegmentReference(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SegmentReference(entry, context); + }); }; const deserializeAws_restJson1ListOfSegmentResponse = (output: any, context: __SerdeContext): SegmentResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SegmentResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SegmentResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfSimpleCondition = (output: any, context: __SerdeContext): SimpleCondition[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SimpleCondition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SimpleCondition(entry, context); + }); }; const deserializeAws_restJson1ListOfTemplateResponse = (output: any, context: __SerdeContext): TemplateResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TemplateResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TemplateResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfTemplateVersionResponse = ( output: any, context: __SerdeContext ): TemplateVersionResponse[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TemplateVersionResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TemplateVersionResponse(entry, context); + }); }; const deserializeAws_restJson1ListOfTreatmentResource = (output: any, context: __SerdeContext): TreatmentResource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TreatmentResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TreatmentResource(entry, context); + }); }; const deserializeAws_restJson1ListRecommenderConfigurationsResponse = ( @@ -18650,121 +18920,141 @@ const deserializeAws_restJson1ListRecommenderConfigurationsResponse = ( }; const deserializeAws_restJson1MapOf__double = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOf__integer = (output: any, context: __SerdeContext): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfActivity = (output: any, context: __SerdeContext): { [key: string]: Activity } => { - return Object.entries(output).reduce( - (acc: { [key: string]: Activity }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: Activity }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1Activity(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfAttributeDimension = ( output: any, context: __SerdeContext ): { [key: string]: AttributeDimension } => { - return Object.entries(output).reduce( - (acc: { [key: string]: AttributeDimension }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: AttributeDimension }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1AttributeDimension(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfChannelResponse = ( output: any, context: __SerdeContext ): { [key: string]: ChannelResponse } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ChannelResponse }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ChannelResponse }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ChannelResponse(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfEndpointMessageResult = ( output: any, context: __SerdeContext ): { [key: string]: EndpointMessageResult } => { - return Object.entries(output).reduce( - (acc: { [key: string]: EndpointMessageResult }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: EndpointMessageResult }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1EndpointMessageResult(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfEventItemResponse = ( output: any, context: __SerdeContext ): { [key: string]: EventItemResponse } => { - return Object.entries(output).reduce( - (acc: { [key: string]: EventItemResponse }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: EventItemResponse }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1EventItemResponse(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfItemResponse = ( output: any, context: __SerdeContext ): { [key: string]: ItemResponse } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ItemResponse }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ItemResponse }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ItemResponse(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfListOf__string = ( output: any, context: __SerdeContext ): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ListOf__string(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfMapOfEndpointMessageResult = ( @@ -18772,10 +19062,15 @@ const deserializeAws_restJson1MapOfMapOfEndpointMessageResult = ( context: __SerdeContext ): { [key: string]: { [key: string]: EndpointMessageResult } } => { return Object.entries(output).reduce( - (acc: { [key: string]: { [key: string]: EndpointMessageResult } }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_restJson1MapOfEndpointMessageResult(value, context), - }), + (acc: { [key: string]: { [key: string]: EndpointMessageResult } }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_restJson1MapOfEndpointMessageResult(value, context), + }; + }, {} ); }; @@ -18784,26 +19079,30 @@ const deserializeAws_restJson1MapOfMessageResult = ( output: any, context: __SerdeContext ): { [key: string]: MessageResult } => { - return Object.entries(output).reduce( - (acc: { [key: string]: MessageResult }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: MessageResult }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1MessageResult(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1MapOfMetricDimension = ( output: any, context: __SerdeContext ): { [key: string]: MetricDimension } => { - return Object.entries(output).reduce( - (acc: { [key: string]: MetricDimension }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: MetricDimension }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1MetricDimension(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Message = (output: any, context: __SerdeContext): Message => { @@ -19674,6 +19973,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-polly/protocols/Aws_restJson1.ts b/clients/client-polly/protocols/Aws_restJson1.ts index 3a9947e8279e..35e528fa8a46 100644 --- a/clients/client-polly/protocols/Aws_restJson1.ts +++ b/clients/client-polly/protocols/Aws_restJson1.ts @@ -63,9 +63,7 @@ export const serializeAws_restJson1DeleteLexiconCommand = async ( input: DeleteLexiconCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/lexicons/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -93,9 +91,7 @@ export const serializeAws_restJson1DescribeVoicesCommand = async ( input: DescribeVoicesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/voices"; const query: any = { ...(input.Engine !== undefined && { Engine: input.Engine }), @@ -123,9 +119,7 @@ export const serializeAws_restJson1GetLexiconCommand = async ( input: GetLexiconCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/lexicons/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -153,9 +147,7 @@ export const serializeAws_restJson1GetSpeechSynthesisTaskCommand = async ( input: GetSpeechSynthesisTaskCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/synthesisTasks/{TaskId}"; if (input.TaskId !== undefined) { const labelValue: string = input.TaskId; @@ -183,9 +175,7 @@ export const serializeAws_restJson1ListLexiconsCommand = async ( input: ListLexiconsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/lexicons"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -208,9 +198,7 @@ export const serializeAws_restJson1ListSpeechSynthesisTasksCommand = async ( input: ListSpeechSynthesisTasksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/synthesisTasks"; const query: any = { ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }), @@ -236,7 +224,7 @@ export const serializeAws_restJson1PutLexiconCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/lexicons/{Name}"; if (input.Name !== undefined) { @@ -250,7 +238,7 @@ export const serializeAws_restJson1PutLexiconCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Content !== undefined && { Content: input.Content }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -269,27 +257,31 @@ export const serializeAws_restJson1StartSpeechSynthesisTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/synthesisTasks"; let body: any; body = JSON.stringify({ - ...(input.Engine !== undefined && { Engine: input.Engine }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.LexiconNames !== undefined && { - LexiconNames: serializeAws_restJson1LexiconNameList(input.LexiconNames, context), - }), - ...(input.OutputFormat !== undefined && { OutputFormat: input.OutputFormat }), - ...(input.OutputS3BucketName !== undefined && { OutputS3BucketName: input.OutputS3BucketName }), - ...(input.OutputS3KeyPrefix !== undefined && { OutputS3KeyPrefix: input.OutputS3KeyPrefix }), - ...(input.SampleRate !== undefined && { SampleRate: input.SampleRate }), - ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), - ...(input.SpeechMarkTypes !== undefined && { - SpeechMarkTypes: serializeAws_restJson1SpeechMarkTypeList(input.SpeechMarkTypes, context), - }), - ...(input.Text !== undefined && { Text: input.Text }), - ...(input.TextType !== undefined && { TextType: input.TextType }), - ...(input.VoiceId !== undefined && { VoiceId: input.VoiceId }), + ...(input.Engine !== undefined && input.Engine !== null && { Engine: input.Engine }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.LexiconNames !== undefined && + input.LexiconNames !== null && { + LexiconNames: serializeAws_restJson1LexiconNameList(input.LexiconNames, context), + }), + ...(input.OutputFormat !== undefined && input.OutputFormat !== null && { OutputFormat: input.OutputFormat }), + ...(input.OutputS3BucketName !== undefined && + input.OutputS3BucketName !== null && { OutputS3BucketName: input.OutputS3BucketName }), + ...(input.OutputS3KeyPrefix !== undefined && + input.OutputS3KeyPrefix !== null && { OutputS3KeyPrefix: input.OutputS3KeyPrefix }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { SampleRate: input.SampleRate }), + ...(input.SnsTopicArn !== undefined && input.SnsTopicArn !== null && { SnsTopicArn: input.SnsTopicArn }), + ...(input.SpeechMarkTypes !== undefined && + input.SpeechMarkTypes !== null && { + SpeechMarkTypes: serializeAws_restJson1SpeechMarkTypeList(input.SpeechMarkTypes, context), + }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), + ...(input.TextType !== undefined && input.TextType !== null && { TextType: input.TextType }), + ...(input.VoiceId !== undefined && input.VoiceId !== null && { VoiceId: input.VoiceId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -308,24 +300,26 @@ export const serializeAws_restJson1SynthesizeSpeechCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/speech"; let body: any; body = JSON.stringify({ - ...(input.Engine !== undefined && { Engine: input.Engine }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.LexiconNames !== undefined && { - LexiconNames: serializeAws_restJson1LexiconNameList(input.LexiconNames, context), - }), - ...(input.OutputFormat !== undefined && { OutputFormat: input.OutputFormat }), - ...(input.SampleRate !== undefined && { SampleRate: input.SampleRate }), - ...(input.SpeechMarkTypes !== undefined && { - SpeechMarkTypes: serializeAws_restJson1SpeechMarkTypeList(input.SpeechMarkTypes, context), - }), - ...(input.Text !== undefined && { Text: input.Text }), - ...(input.TextType !== undefined && { TextType: input.TextType }), - ...(input.VoiceId !== undefined && { VoiceId: input.VoiceId }), + ...(input.Engine !== undefined && input.Engine !== null && { Engine: input.Engine }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.LexiconNames !== undefined && + input.LexiconNames !== null && { + LexiconNames: serializeAws_restJson1LexiconNameList(input.LexiconNames, context), + }), + ...(input.OutputFormat !== undefined && input.OutputFormat !== null && { OutputFormat: input.OutputFormat }), + ...(input.SampleRate !== undefined && input.SampleRate !== null && { SampleRate: input.SampleRate }), + ...(input.SpeechMarkTypes !== undefined && + input.SpeechMarkTypes !== null && { + SpeechMarkTypes: serializeAws_restJson1SpeechMarkTypeList(input.SpeechMarkTypes, context), + }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), + ...(input.TextType !== undefined && input.TextType !== null && { TextType: input.TextType }), + ...(input.VoiceId !== undefined && input.VoiceId !== null && { VoiceId: input.VoiceId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1462,19 +1456,47 @@ const deserializeAws_restJson1UnsupportedPlsLanguageExceptionResponse = async ( }; const serializeAws_restJson1LexiconNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SpeechMarkTypeList = (input: (SpeechMarkType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1EngineList = (output: any, context: __SerdeContext): (Engine | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1LanguageCodeList = (output: any, context: __SerdeContext): (LanguageCode | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Lexicon = (output: any, context: __SerdeContext): Lexicon => { @@ -1509,18 +1531,39 @@ const deserializeAws_restJson1LexiconDescription = (output: any, context: __Serd }; const deserializeAws_restJson1LexiconDescriptionList = (output: any, context: __SerdeContext): LexiconDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LexiconDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LexiconDescription(entry, context); + }); }; const deserializeAws_restJson1LexiconNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SpeechMarkTypeList = ( output: any, context: __SerdeContext ): (SpeechMarkType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SynthesisTask = (output: any, context: __SerdeContext): SynthesisTask => { @@ -1557,7 +1600,14 @@ const deserializeAws_restJson1SynthesisTask = (output: any, context: __SerdeCont }; const deserializeAws_restJson1SynthesisTasks = (output: any, context: __SerdeContext): SynthesisTask[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SynthesisTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SynthesisTask(entry, context); + }); }; const deserializeAws_restJson1Voice = (output: any, context: __SerdeContext): Voice => { @@ -1579,7 +1629,14 @@ const deserializeAws_restJson1Voice = (output: any, context: __SerdeContext): Vo }; const deserializeAws_restJson1VoiceList = (output: any, context: __SerdeContext): Voice[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Voice(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Voice(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1602,6 +1659,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-pricing/protocols/Aws_json1_1.ts b/clients/client-pricing/protocols/Aws_json1_1.ts index 019c471bba5e..30a2a33ad32a 100644 --- a/clients/client-pricing/protocols/Aws_json1_1.ts +++ b/clients/client-pricing/protocols/Aws_json1_1.ts @@ -32,7 +32,7 @@ export const serializeAws_json1_1DescribeServicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPriceListService.DescribeServices", }; let body: any; @@ -45,7 +45,7 @@ export const serializeAws_json1_1GetAttributeValuesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPriceListService.GetAttributeValues", }; let body: any; @@ -58,7 +58,7 @@ export const serializeAws_json1_1GetProductsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSPriceListService.GetProducts", }; let body: any; @@ -93,8 +93,7 @@ const deserializeAws_json1_1DescribeServicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExpiredNextTokenException": case "com.amazonaws.pricing#ExpiredNextTokenException": @@ -180,8 +179,7 @@ const deserializeAws_json1_1GetAttributeValuesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExpiredNextTokenException": case "com.amazonaws.pricing#ExpiredNextTokenException": @@ -267,8 +265,7 @@ const deserializeAws_json1_1GetProductsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExpiredNextTokenException": case "com.amazonaws.pricing#ExpiredNextTokenException": @@ -404,23 +401,30 @@ const deserializeAws_json1_1NotFoundExceptionResponse = async ( const serializeAws_json1_1DescribeServicesRequest = (input: DescribeServicesRequest, context: __SerdeContext): any => { return { - ...(input.FormatVersion !== undefined && { FormatVersion: input.FormatVersion }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.FormatVersion !== undefined && input.FormatVersion !== null && { FormatVersion: input.FormatVersion }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Field !== undefined && { Field: input.Field }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Field !== undefined && input.Field !== null && { Field: input.Field }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1Filters = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1GetAttributeValuesRequest = ( @@ -428,25 +432,33 @@ const serializeAws_json1_1GetAttributeValuesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; const serializeAws_json1_1GetProductsRequest = (input: GetProductsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.FormatVersion !== undefined && { FormatVersion: input.FormatVersion }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.FormatVersion !== undefined && input.FormatVersion !== null && { FormatVersion: input.FormatVersion }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; const deserializeAws_json1_1AttributeNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AttributeValue = (output: any, context: __SerdeContext): AttributeValue => { @@ -456,7 +468,14 @@ const deserializeAws_json1_1AttributeValue = (output: any, context: __SerdeConte }; const deserializeAws_json1_1AttributeValueList = (output: any, context: __SerdeContext): AttributeValue[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttributeValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttributeValue(entry, context); + }); }; const deserializeAws_json1_1DescribeServicesResponse = ( @@ -539,7 +558,14 @@ const deserializeAws_json1_1NotFoundException = (output: any, context: __SerdeCo }; const deserializeAws_json1_1PriceList = (output: any, context: __SerdeContext): (__LazyJsonString | string)[] => { - return (output || []).map((entry: any) => new __LazyJsonString(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return new __LazyJsonString(entry); + }); }; const deserializeAws_json1_1Service = (output: any, context: __SerdeContext): Service => { @@ -553,7 +579,14 @@ const deserializeAws_json1_1Service = (output: any, context: __SerdeContext): Se }; const deserializeAws_json1_1ServiceList = (output: any, context: __SerdeContext): Service[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Service(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Service(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -606,3 +639,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-qldb-session/protocols/Aws_json1_0.ts b/clients/client-qldb-session/protocols/Aws_json1_0.ts index edec2a9377aa..6a4dcfd1db34 100644 --- a/clients/client-qldb-session/protocols/Aws_json1_0.ts +++ b/clients/client-qldb-session/protocols/Aws_json1_0.ts @@ -39,7 +39,7 @@ export const serializeAws_json1_0SendCommandCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "QLDBSession.SendCommand", }; let body: any; @@ -74,8 +74,7 @@ const deserializeAws_json1_0SendCommandCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.qldbsession#BadRequestException": @@ -218,8 +217,9 @@ const serializeAws_json1_0CommitTransactionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CommitDigest !== undefined && { CommitDigest: context.base64Encoder(input.CommitDigest) }), - ...(input.TransactionId !== undefined && { TransactionId: input.TransactionId }), + ...(input.CommitDigest !== undefined && + input.CommitDigest !== null && { CommitDigest: context.base64Encoder(input.CommitDigest) }), + ...(input.TransactionId !== undefined && input.TransactionId !== null && { TransactionId: input.TransactionId }), }; }; @@ -229,49 +229,53 @@ const serializeAws_json1_0EndSessionRequest = (input: EndSessionRequest, context const serializeAws_json1_0ExecuteStatementRequest = (input: ExecuteStatementRequest, context: __SerdeContext): any => { return { - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_0StatementParameters(input.Parameters, context), - }), - ...(input.Statement !== undefined && { Statement: input.Statement }), - ...(input.TransactionId !== undefined && { TransactionId: input.TransactionId }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_0StatementParameters(input.Parameters, context) }), + ...(input.Statement !== undefined && input.Statement !== null && { Statement: input.Statement }), + ...(input.TransactionId !== undefined && input.TransactionId !== null && { TransactionId: input.TransactionId }), }; }; const serializeAws_json1_0FetchPageRequest = (input: FetchPageRequest, context: __SerdeContext): any => { return { - ...(input.NextPageToken !== undefined && { NextPageToken: input.NextPageToken }), - ...(input.TransactionId !== undefined && { TransactionId: input.TransactionId }), + ...(input.NextPageToken !== undefined && input.NextPageToken !== null && { NextPageToken: input.NextPageToken }), + ...(input.TransactionId !== undefined && input.TransactionId !== null && { TransactionId: input.TransactionId }), }; }; const serializeAws_json1_0SendCommandRequest = (input: SendCommandRequest, context: __SerdeContext): any => { return { - ...(input.AbortTransaction !== undefined && { - AbortTransaction: serializeAws_json1_0AbortTransactionRequest(input.AbortTransaction, context), - }), - ...(input.CommitTransaction !== undefined && { - CommitTransaction: serializeAws_json1_0CommitTransactionRequest(input.CommitTransaction, context), - }), - ...(input.EndSession !== undefined && { - EndSession: serializeAws_json1_0EndSessionRequest(input.EndSession, context), - }), - ...(input.ExecuteStatement !== undefined && { - ExecuteStatement: serializeAws_json1_0ExecuteStatementRequest(input.ExecuteStatement, context), - }), - ...(input.FetchPage !== undefined && { FetchPage: serializeAws_json1_0FetchPageRequest(input.FetchPage, context) }), - ...(input.SessionToken !== undefined && { SessionToken: input.SessionToken }), - ...(input.StartSession !== undefined && { - StartSession: serializeAws_json1_0StartSessionRequest(input.StartSession, context), - }), - ...(input.StartTransaction !== undefined && { - StartTransaction: serializeAws_json1_0StartTransactionRequest(input.StartTransaction, context), - }), + ...(input.AbortTransaction !== undefined && + input.AbortTransaction !== null && { + AbortTransaction: serializeAws_json1_0AbortTransactionRequest(input.AbortTransaction, context), + }), + ...(input.CommitTransaction !== undefined && + input.CommitTransaction !== null && { + CommitTransaction: serializeAws_json1_0CommitTransactionRequest(input.CommitTransaction, context), + }), + ...(input.EndSession !== undefined && + input.EndSession !== null && { EndSession: serializeAws_json1_0EndSessionRequest(input.EndSession, context) }), + ...(input.ExecuteStatement !== undefined && + input.ExecuteStatement !== null && { + ExecuteStatement: serializeAws_json1_0ExecuteStatementRequest(input.ExecuteStatement, context), + }), + ...(input.FetchPage !== undefined && + input.FetchPage !== null && { FetchPage: serializeAws_json1_0FetchPageRequest(input.FetchPage, context) }), + ...(input.SessionToken !== undefined && input.SessionToken !== null && { SessionToken: input.SessionToken }), + ...(input.StartSession !== undefined && + input.StartSession !== null && { + StartSession: serializeAws_json1_0StartSessionRequest(input.StartSession, context), + }), + ...(input.StartTransaction !== undefined && + input.StartTransaction !== null && { + StartTransaction: serializeAws_json1_0StartTransactionRequest(input.StartTransaction, context), + }), }; }; const serializeAws_json1_0StartSessionRequest = (input: StartSessionRequest, context: __SerdeContext): any => { return { - ...(input.LedgerName !== undefined && { LedgerName: input.LedgerName }), + ...(input.LedgerName !== undefined && input.LedgerName !== null && { LedgerName: input.LedgerName }), }; }; @@ -280,13 +284,21 @@ const serializeAws_json1_0StartTransactionRequest = (input: StartTransactionRequ }; const serializeAws_json1_0StatementParameters = (input: ValueHolder[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0ValueHolder(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ValueHolder(entry, context); + }); }; const serializeAws_json1_0ValueHolder = (input: ValueHolder, context: __SerdeContext): any => { return { - ...(input.IonBinary !== undefined && { IonBinary: context.base64Encoder(input.IonBinary) }), - ...(input.IonText !== undefined && { IonText: input.IonText }), + ...(input.IonBinary !== undefined && + input.IonBinary !== null && { IonBinary: context.base64Encoder(input.IonBinary) }), + ...(input.IonText !== undefined && input.IonText !== null && { IonText: input.IonText }), }; }; @@ -429,7 +441,14 @@ const deserializeAws_json1_0ValueHolder = (output: any, context: __SerdeContext) }; const deserializeAws_json1_0ValueHolders = (output: any, context: __SerdeContext): ValueHolder[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ValueHolder(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ValueHolder(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -482,3 +501,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-qldb/protocols/Aws_restJson1.ts b/clients/client-qldb/protocols/Aws_restJson1.ts index babf14eacafb..39a53ab82e51 100644 --- a/clients/client-qldb/protocols/Aws_restJson1.ts +++ b/clients/client-qldb/protocols/Aws_restJson1.ts @@ -72,9 +72,7 @@ export const serializeAws_restJson1CancelJournalKinesisStreamCommand = async ( input: CancelJournalKinesisStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/ledgers/{LedgerName}/journal-kinesis-streams/{StreamId}"; if (input.LedgerName !== undefined) { const labelValue: string = input.LedgerName; @@ -112,15 +110,17 @@ export const serializeAws_restJson1CreateLedgerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ledgers"; let body: any; body = JSON.stringify({ - ...(input.DeletionProtection !== undefined && { DeletionProtection: input.DeletionProtection }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PermissionsMode !== undefined && { PermissionsMode: input.PermissionsMode }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.DeletionProtection !== undefined && + input.DeletionProtection !== null && { DeletionProtection: input.DeletionProtection }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PermissionsMode !== undefined && + input.PermissionsMode !== null && { PermissionsMode: input.PermissionsMode }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -138,9 +138,7 @@ export const serializeAws_restJson1DeleteLedgerCommand = async ( input: DeleteLedgerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/ledgers/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -168,9 +166,7 @@ export const serializeAws_restJson1DescribeJournalKinesisStreamCommand = async ( input: DescribeJournalKinesisStreamCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/ledgers/{LedgerName}/journal-kinesis-streams/{StreamId}"; if (input.LedgerName !== undefined) { const labelValue: string = input.LedgerName; @@ -207,9 +203,7 @@ export const serializeAws_restJson1DescribeJournalS3ExportCommand = async ( input: DescribeJournalS3ExportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/ledgers/{Name}/journal-s3-exports/{ExportId}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -246,9 +240,7 @@ export const serializeAws_restJson1DescribeLedgerCommand = async ( input: DescribeLedgerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/ledgers/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -277,7 +269,7 @@ export const serializeAws_restJson1ExportJournalToS3Command = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ledgers/{Name}/journal-s3-exports"; if (input.Name !== undefined) { @@ -291,16 +283,17 @@ export const serializeAws_restJson1ExportJournalToS3Command = async ( } let body: any; body = JSON.stringify({ - ...(input.ExclusiveEndTime !== undefined && { - ExclusiveEndTime: Math.round(input.ExclusiveEndTime.getTime() / 1000), - }), - ...(input.InclusiveStartTime !== undefined && { - InclusiveStartTime: Math.round(input.InclusiveStartTime.getTime() / 1000), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.S3ExportConfiguration !== undefined && { - S3ExportConfiguration: serializeAws_restJson1S3ExportConfiguration(input.S3ExportConfiguration, context), - }), + ...(input.ExclusiveEndTime !== undefined && + input.ExclusiveEndTime !== null && { ExclusiveEndTime: Math.round(input.ExclusiveEndTime.getTime() / 1000) }), + ...(input.InclusiveStartTime !== undefined && + input.InclusiveStartTime !== null && { + InclusiveStartTime: Math.round(input.InclusiveStartTime.getTime() / 1000), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.S3ExportConfiguration !== undefined && + input.S3ExportConfiguration !== null && { + S3ExportConfiguration: serializeAws_restJson1S3ExportConfiguration(input.S3ExportConfiguration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -319,7 +312,7 @@ export const serializeAws_restJson1GetBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ledgers/{Name}/block"; if (input.Name !== undefined) { @@ -333,12 +326,12 @@ export const serializeAws_restJson1GetBlockCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BlockAddress !== undefined && { - BlockAddress: serializeAws_restJson1ValueHolder(input.BlockAddress, context), - }), - ...(input.DigestTipAddress !== undefined && { - DigestTipAddress: serializeAws_restJson1ValueHolder(input.DigestTipAddress, context), - }), + ...(input.BlockAddress !== undefined && + input.BlockAddress !== null && { BlockAddress: serializeAws_restJson1ValueHolder(input.BlockAddress, context) }), + ...(input.DigestTipAddress !== undefined && + input.DigestTipAddress !== null && { + DigestTipAddress: serializeAws_restJson1ValueHolder(input.DigestTipAddress, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -356,9 +349,7 @@ export const serializeAws_restJson1GetDigestCommand = async ( input: GetDigestCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/ledgers/{Name}/digest"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -387,7 +378,7 @@ export const serializeAws_restJson1GetRevisionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ledgers/{Name}/revision"; if (input.Name !== undefined) { @@ -401,13 +392,13 @@ export const serializeAws_restJson1GetRevisionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BlockAddress !== undefined && { - BlockAddress: serializeAws_restJson1ValueHolder(input.BlockAddress, context), - }), - ...(input.DigestTipAddress !== undefined && { - DigestTipAddress: serializeAws_restJson1ValueHolder(input.DigestTipAddress, context), - }), - ...(input.DocumentId !== undefined && { DocumentId: input.DocumentId }), + ...(input.BlockAddress !== undefined && + input.BlockAddress !== null && { BlockAddress: serializeAws_restJson1ValueHolder(input.BlockAddress, context) }), + ...(input.DigestTipAddress !== undefined && + input.DigestTipAddress !== null && { + DigestTipAddress: serializeAws_restJson1ValueHolder(input.DigestTipAddress, context), + }), + ...(input.DocumentId !== undefined && input.DocumentId !== null && { DocumentId: input.DocumentId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -425,9 +416,7 @@ export const serializeAws_restJson1ListJournalKinesisStreamsForLedgerCommand = a input: ListJournalKinesisStreamsForLedgerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/ledgers/{LedgerName}/journal-kinesis-streams"; if (input.LedgerName !== undefined) { const labelValue: string = input.LedgerName; @@ -460,9 +449,7 @@ export const serializeAws_restJson1ListJournalS3ExportsCommand = async ( input: ListJournalS3ExportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/journal-s3-exports"; const query: any = { ...(input.MaxResults !== undefined && { max_results: input.MaxResults.toString() }), @@ -486,9 +473,7 @@ export const serializeAws_restJson1ListJournalS3ExportsForLedgerCommand = async input: ListJournalS3ExportsForLedgerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/ledgers/{Name}/journal-s3-exports"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -521,9 +506,7 @@ export const serializeAws_restJson1ListLedgersCommand = async ( input: ListLedgersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/ledgers"; const query: any = { ...(input.NextToken !== undefined && { next_token: input.NextToken }), @@ -547,9 +530,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -578,7 +559,7 @@ export const serializeAws_restJson1StreamJournalToKinesisCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ledgers/{LedgerName}/journal-kinesis-streams"; if (input.LedgerName !== undefined) { @@ -592,18 +573,19 @@ export const serializeAws_restJson1StreamJournalToKinesisCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ExclusiveEndTime !== undefined && { - ExclusiveEndTime: Math.round(input.ExclusiveEndTime.getTime() / 1000), - }), - ...(input.InclusiveStartTime !== undefined && { - InclusiveStartTime: Math.round(input.InclusiveStartTime.getTime() / 1000), - }), - ...(input.KinesisConfiguration !== undefined && { - KinesisConfiguration: serializeAws_restJson1KinesisConfiguration(input.KinesisConfiguration, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StreamName !== undefined && { StreamName: input.StreamName }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.ExclusiveEndTime !== undefined && + input.ExclusiveEndTime !== null && { ExclusiveEndTime: Math.round(input.ExclusiveEndTime.getTime() / 1000) }), + ...(input.InclusiveStartTime !== undefined && + input.InclusiveStartTime !== null && { + InclusiveStartTime: Math.round(input.InclusiveStartTime.getTime() / 1000), + }), + ...(input.KinesisConfiguration !== undefined && + input.KinesisConfiguration !== null && { + KinesisConfiguration: serializeAws_restJson1KinesisConfiguration(input.KinesisConfiguration, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -622,7 +604,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -636,7 +618,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -654,9 +636,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -689,7 +669,7 @@ export const serializeAws_restJson1UpdateLedgerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ledgers/{Name}"; if (input.Name !== undefined) { @@ -703,7 +683,8 @@ export const serializeAws_restJson1UpdateLedgerCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DeletionProtection !== undefined && { DeletionProtection: input.DeletionProtection }), + ...(input.DeletionProtection !== undefined && + input.DeletionProtection !== null && { DeletionProtection: input.DeletionProtection }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2154,8 +2135,9 @@ const deserializeAws_restJson1ResourcePreconditionNotMetExceptionResponse = asyn const serializeAws_restJson1KinesisConfiguration = (input: KinesisConfiguration, context: __SerdeContext): any => { return { - ...(input.AggregationEnabled !== undefined && { AggregationEnabled: input.AggregationEnabled }), - ...(input.StreamArn !== undefined && { StreamArn: input.StreamArn }), + ...(input.AggregationEnabled !== undefined && + input.AggregationEnabled !== null && { AggregationEnabled: input.AggregationEnabled }), + ...(input.StreamArn !== undefined && input.StreamArn !== null && { StreamArn: input.StreamArn }), }; }; @@ -2164,34 +2146,41 @@ const serializeAws_restJson1S3EncryptionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), - ...(input.ObjectEncryptionType !== undefined && { ObjectEncryptionType: input.ObjectEncryptionType }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }), + ...(input.ObjectEncryptionType !== undefined && + input.ObjectEncryptionType !== null && { ObjectEncryptionType: input.ObjectEncryptionType }), }; }; const serializeAws_restJson1S3ExportConfiguration = (input: S3ExportConfiguration, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.EncryptionConfiguration !== undefined && { - EncryptionConfiguration: serializeAws_restJson1S3EncryptionConfiguration(input.EncryptionConfiguration, context), - }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.EncryptionConfiguration !== undefined && + input.EncryptionConfiguration !== null && { + EncryptionConfiguration: serializeAws_restJson1S3EncryptionConfiguration( + input.EncryptionConfiguration, + context + ), + }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), }; }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ValueHolder = (input: ValueHolder, context: __SerdeContext): any => { return { - ...(input.IonText !== undefined && { IonText: input.IonText }), + ...(input.IonText !== undefined && input.IonText !== null && { IonText: input.IonText }), }; }; @@ -2230,7 +2219,14 @@ const deserializeAws_restJson1JournalKinesisStreamDescriptionList = ( output: any, context: __SerdeContext ): JournalKinesisStreamDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JournalKinesisStreamDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JournalKinesisStreamDescription(entry, context); + }); }; const deserializeAws_restJson1JournalS3ExportDescription = ( @@ -2265,7 +2261,14 @@ const deserializeAws_restJson1JournalS3ExportList = ( output: any, context: __SerdeContext ): JournalS3ExportDescription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1JournalS3ExportDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1JournalS3ExportDescription(entry, context); + }); }; const deserializeAws_restJson1KinesisConfiguration = (output: any, context: __SerdeContext): KinesisConfiguration => { @@ -2279,7 +2282,14 @@ const deserializeAws_restJson1KinesisConfiguration = (output: any, context: __Se }; const deserializeAws_restJson1LedgerList = (output: any, context: __SerdeContext): LedgerSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1LedgerSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1LedgerSummary(entry, context); + }); }; const deserializeAws_restJson1LedgerSummary = (output: any, context: __SerdeContext): LedgerSummary => { @@ -2318,13 +2328,15 @@ const deserializeAws_restJson1S3ExportConfiguration = (output: any, context: __S }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ValueHolder = (output: any, context: __SerdeContext): ValueHolder => { @@ -2353,6 +2365,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-quicksight/protocols/Aws_restJson1.ts b/clients/client-quicksight/protocols/Aws_restJson1.ts index 7676052ecfc4..91b1f04ecf98 100644 --- a/clients/client-quicksight/protocols/Aws_restJson1.ts +++ b/clients/client-quicksight/protocols/Aws_restJson1.ts @@ -369,9 +369,7 @@ export const serializeAws_restJson1CancelIngestionCommand = async ( input: CancelIngestionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions/{IngestionId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -418,7 +416,7 @@ export const serializeAws_restJson1CreateAccountCustomizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/customizations"; if (input.AwsAccountId !== undefined) { @@ -435,10 +433,12 @@ export const serializeAws_restJson1CreateAccountCustomizationCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.AccountCustomization !== undefined && { - AccountCustomization: serializeAws_restJson1AccountCustomization(input.AccountCustomization, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.AccountCustomization !== undefined && + input.AccountCustomization !== null && { + AccountCustomization: serializeAws_restJson1AccountCustomization(input.AccountCustomization, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -458,7 +458,7 @@ export const serializeAws_restJson1CreateAnalysisCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/analyses/{AnalysisId}"; if (input.AwsAccountId !== undefined) { @@ -481,16 +481,20 @@ export const serializeAws_restJson1CreateAnalysisCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), - }), - ...(input.SourceEntity !== undefined && { - SourceEntity: serializeAws_restJson1AnalysisSourceEntity(input.SourceEntity, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.ThemeArn !== undefined && { ThemeArn: input.ThemeArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { + Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), + }), + ...(input.SourceEntity !== undefined && + input.SourceEntity !== null && { + SourceEntity: serializeAws_restJson1AnalysisSourceEntity(input.SourceEntity, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ThemeArn !== undefined && input.ThemeArn !== null && { ThemeArn: input.ThemeArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -509,7 +513,7 @@ export const serializeAws_restJson1CreateDashboardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/dashboards/{DashboardId}"; if (input.AwsAccountId !== undefined) { @@ -532,20 +536,26 @@ export const serializeAws_restJson1CreateDashboardCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DashboardPublishOptions !== undefined && { - DashboardPublishOptions: serializeAws_restJson1DashboardPublishOptions(input.DashboardPublishOptions, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), - }), - ...(input.SourceEntity !== undefined && { - SourceEntity: serializeAws_restJson1DashboardSourceEntity(input.SourceEntity, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.ThemeArn !== undefined && { ThemeArn: input.ThemeArn }), - ...(input.VersionDescription !== undefined && { VersionDescription: input.VersionDescription }), + ...(input.DashboardPublishOptions !== undefined && + input.DashboardPublishOptions !== null && { + DashboardPublishOptions: serializeAws_restJson1DashboardPublishOptions(input.DashboardPublishOptions, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { + Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), + }), + ...(input.SourceEntity !== undefined && + input.SourceEntity !== null && { + SourceEntity: serializeAws_restJson1DashboardSourceEntity(input.SourceEntity, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ThemeArn !== undefined && input.ThemeArn !== null && { ThemeArn: input.ThemeArn }), + ...(input.VersionDescription !== undefined && + input.VersionDescription !== null && { VersionDescription: input.VersionDescription }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -564,7 +574,7 @@ export const serializeAws_restJson1CreateDataSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/data-sets"; if (input.AwsAccountId !== undefined) { @@ -578,34 +588,41 @@ export const serializeAws_restJson1CreateDataSetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ColumnGroups !== undefined && { - ColumnGroups: serializeAws_restJson1ColumnGroupList(input.ColumnGroups, context), - }), - ...(input.ColumnLevelPermissionRules !== undefined && { - ColumnLevelPermissionRules: serializeAws_restJson1ColumnLevelPermissionRuleList( - input.ColumnLevelPermissionRules, - context - ), - }), - ...(input.DataSetId !== undefined && { DataSetId: input.DataSetId }), - ...(input.ImportMode !== undefined && { ImportMode: input.ImportMode }), - ...(input.LogicalTableMap !== undefined && { - LogicalTableMap: serializeAws_restJson1LogicalTableMap(input.LogicalTableMap, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), - }), - ...(input.PhysicalTableMap !== undefined && { - PhysicalTableMap: serializeAws_restJson1PhysicalTableMap(input.PhysicalTableMap, context), - }), - ...(input.RowLevelPermissionDataSet !== undefined && { - RowLevelPermissionDataSet: serializeAws_restJson1RowLevelPermissionDataSet( - input.RowLevelPermissionDataSet, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ColumnGroups !== undefined && + input.ColumnGroups !== null && { + ColumnGroups: serializeAws_restJson1ColumnGroupList(input.ColumnGroups, context), + }), + ...(input.ColumnLevelPermissionRules !== undefined && + input.ColumnLevelPermissionRules !== null && { + ColumnLevelPermissionRules: serializeAws_restJson1ColumnLevelPermissionRuleList( + input.ColumnLevelPermissionRules, + context + ), + }), + ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }), + ...(input.ImportMode !== undefined && input.ImportMode !== null && { ImportMode: input.ImportMode }), + ...(input.LogicalTableMap !== undefined && + input.LogicalTableMap !== null && { + LogicalTableMap: serializeAws_restJson1LogicalTableMap(input.LogicalTableMap, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { + Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), + }), + ...(input.PhysicalTableMap !== undefined && + input.PhysicalTableMap !== null && { + PhysicalTableMap: serializeAws_restJson1PhysicalTableMap(input.PhysicalTableMap, context), + }), + ...(input.RowLevelPermissionDataSet !== undefined && + input.RowLevelPermissionDataSet !== null && { + RowLevelPermissionDataSet: serializeAws_restJson1RowLevelPermissionDataSet( + input.RowLevelPermissionDataSet, + context + ), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -624,7 +641,7 @@ export const serializeAws_restJson1CreateDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/data-sources"; if (input.AwsAccountId !== undefined) { @@ -638,25 +655,31 @@ export const serializeAws_restJson1CreateDataSourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Credentials !== undefined && { - Credentials: serializeAws_restJson1DataSourceCredentials(input.Credentials, context), - }), - ...(input.DataSourceId !== undefined && { DataSourceId: input.DataSourceId }), - ...(input.DataSourceParameters !== undefined && { - DataSourceParameters: serializeAws_restJson1DataSourceParameters(input.DataSourceParameters, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), - }), - ...(input.SslProperties !== undefined && { - SslProperties: serializeAws_restJson1SslProperties(input.SslProperties, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.VpcConnectionProperties !== undefined && { - VpcConnectionProperties: serializeAws_restJson1VpcConnectionProperties(input.VpcConnectionProperties, context), - }), + ...(input.Credentials !== undefined && + input.Credentials !== null && { + Credentials: serializeAws_restJson1DataSourceCredentials(input.Credentials, context), + }), + ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }), + ...(input.DataSourceParameters !== undefined && + input.DataSourceParameters !== null && { + DataSourceParameters: serializeAws_restJson1DataSourceParameters(input.DataSourceParameters, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { + Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), + }), + ...(input.SslProperties !== undefined && + input.SslProperties !== null && { + SslProperties: serializeAws_restJson1SslProperties(input.SslProperties, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.VpcConnectionProperties !== undefined && + input.VpcConnectionProperties !== null && { + VpcConnectionProperties: serializeAws_restJson1VpcConnectionProperties(input.VpcConnectionProperties, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -675,7 +698,7 @@ export const serializeAws_restJson1CreateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups"; if (input.AwsAccountId !== undefined) { @@ -698,8 +721,8 @@ export const serializeAws_restJson1CreateGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -717,9 +740,7 @@ export const serializeAws_restJson1CreateGroupMembershipCommand = async ( input: CreateGroupMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members/{MemberName}"; if (input.MemberName !== undefined) { const labelValue: string = input.MemberName; @@ -775,7 +796,7 @@ export const serializeAws_restJson1CreateIAMPolicyAssignmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments"; if (input.AwsAccountId !== undefined) { @@ -798,10 +819,13 @@ export const serializeAws_restJson1CreateIAMPolicyAssignmentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AssignmentName !== undefined && { AssignmentName: input.AssignmentName }), - ...(input.AssignmentStatus !== undefined && { AssignmentStatus: input.AssignmentStatus }), - ...(input.Identities !== undefined && { Identities: serializeAws_restJson1IdentityMap(input.Identities, context) }), - ...(input.PolicyArn !== undefined && { PolicyArn: input.PolicyArn }), + ...(input.AssignmentName !== undefined && + input.AssignmentName !== null && { AssignmentName: input.AssignmentName }), + ...(input.AssignmentStatus !== undefined && + input.AssignmentStatus !== null && { AssignmentStatus: input.AssignmentStatus }), + ...(input.Identities !== undefined && + input.Identities !== null && { Identities: serializeAws_restJson1IdentityMap(input.Identities, context) }), + ...(input.PolicyArn !== undefined && input.PolicyArn !== null && { PolicyArn: input.PolicyArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -819,9 +843,7 @@ export const serializeAws_restJson1CreateIngestionCommand = async ( input: CreateIngestionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions/{IngestionId}"; if (input.DataSetId !== undefined) { const labelValue: string = input.DataSetId; @@ -868,7 +890,7 @@ export const serializeAws_restJson1CreateNamespaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}"; if (input.AwsAccountId !== undefined) { @@ -882,9 +904,10 @@ export const serializeAws_restJson1CreateNamespaceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.IdentityStore !== undefined && { IdentityStore: input.IdentityStore }), - ...(input.Namespace !== undefined && { Namespace: input.Namespace }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.IdentityStore !== undefined && input.IdentityStore !== null && { IdentityStore: input.IdentityStore }), + ...(input.Namespace !== undefined && input.Namespace !== null && { Namespace: input.Namespace }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -903,7 +926,7 @@ export const serializeAws_restJson1CreateTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}"; if (input.AwsAccountId !== undefined) { @@ -926,15 +949,19 @@ export const serializeAws_restJson1CreateTemplateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), - }), - ...(input.SourceEntity !== undefined && { - SourceEntity: serializeAws_restJson1TemplateSourceEntity(input.SourceEntity, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.VersionDescription !== undefined && { VersionDescription: input.VersionDescription }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { + Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), + }), + ...(input.SourceEntity !== undefined && + input.SourceEntity !== null && { + SourceEntity: serializeAws_restJson1TemplateSourceEntity(input.SourceEntity, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.VersionDescription !== undefined && + input.VersionDescription !== null && { VersionDescription: input.VersionDescription }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -953,7 +980,7 @@ export const serializeAws_restJson1CreateTemplateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}"; if (input.AwsAccountId !== undefined) { @@ -985,7 +1012,8 @@ export const serializeAws_restJson1CreateTemplateAliasCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TemplateVersionNumber !== undefined && { TemplateVersionNumber: input.TemplateVersionNumber }), + ...(input.TemplateVersionNumber !== undefined && + input.TemplateVersionNumber !== null && { TemplateVersionNumber: input.TemplateVersionNumber }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1004,7 +1032,7 @@ export const serializeAws_restJson1CreateThemeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}"; if (input.AwsAccountId !== undefined) { @@ -1027,16 +1055,20 @@ export const serializeAws_restJson1CreateThemeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BaseThemeId !== undefined && { BaseThemeId: input.BaseThemeId }), - ...(input.Configuration !== undefined && { - Configuration: serializeAws_restJson1ThemeConfiguration(input.Configuration, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Permissions !== undefined && { - Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.VersionDescription !== undefined && { VersionDescription: input.VersionDescription }), + ...(input.BaseThemeId !== undefined && input.BaseThemeId !== null && { BaseThemeId: input.BaseThemeId }), + ...(input.Configuration !== undefined && + input.Configuration !== null && { + Configuration: serializeAws_restJson1ThemeConfiguration(input.Configuration, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Permissions !== undefined && + input.Permissions !== null && { + Permissions: serializeAws_restJson1ResourcePermissionList(input.Permissions, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.VersionDescription !== undefined && + input.VersionDescription !== null && { VersionDescription: input.VersionDescription }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1055,7 +1087,7 @@ export const serializeAws_restJson1CreateThemeAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases/{AliasName}"; if (input.AwsAccountId !== undefined) { @@ -1087,7 +1119,8 @@ export const serializeAws_restJson1CreateThemeAliasCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ThemeVersionNumber !== undefined && { ThemeVersionNumber: input.ThemeVersionNumber }), + ...(input.ThemeVersionNumber !== undefined && + input.ThemeVersionNumber !== null && { ThemeVersionNumber: input.ThemeVersionNumber }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1105,9 +1138,7 @@ export const serializeAws_restJson1DeleteAccountCustomizationCommand = async ( input: DeleteAccountCustomizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/customizations"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1139,9 +1170,7 @@ export const serializeAws_restJson1DeleteAnalysisCommand = async ( input: DeleteAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/analyses/{AnalysisId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1187,9 +1216,7 @@ export const serializeAws_restJson1DeleteDashboardCommand = async ( input: DeleteDashboardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/dashboards/{DashboardId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1230,9 +1257,7 @@ export const serializeAws_restJson1DeleteDataSetCommand = async ( input: DeleteDataSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sets/{DataSetId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1269,9 +1294,7 @@ export const serializeAws_restJson1DeleteDataSourceCommand = async ( input: DeleteDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sources/{DataSourceId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1308,9 +1331,7 @@ export const serializeAws_restJson1DeleteGroupCommand = async ( input: DeleteGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}"; if (input.GroupName !== undefined) { const labelValue: string = input.GroupName; @@ -1356,9 +1377,7 @@ export const serializeAws_restJson1DeleteGroupMembershipCommand = async ( input: DeleteGroupMembershipCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members/{MemberName}"; if (input.MemberName !== undefined) { const labelValue: string = input.MemberName; @@ -1413,9 +1432,7 @@ export const serializeAws_restJson1DeleteIAMPolicyAssignmentCommand = async ( input: DeleteIAMPolicyAssignmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespace/{Namespace}/iam-policy-assignments/{AssignmentName}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1461,9 +1478,7 @@ export const serializeAws_restJson1DeleteNamespaceCommand = async ( input: DeleteNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1500,9 +1515,7 @@ export const serializeAws_restJson1DeleteTemplateCommand = async ( input: DeleteTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1543,9 +1556,7 @@ export const serializeAws_restJson1DeleteTemplateAliasCommand = async ( input: DeleteTemplateAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1591,9 +1602,7 @@ export const serializeAws_restJson1DeleteThemeCommand = async ( input: DeleteThemeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1634,9 +1643,7 @@ export const serializeAws_restJson1DeleteThemeAliasCommand = async ( input: DeleteThemeAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases/{AliasName}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1682,9 +1689,7 @@ export const serializeAws_restJson1DeleteUserCommand = async ( input: DeleteUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}"; if (input.UserName !== undefined) { const labelValue: string = input.UserName; @@ -1730,9 +1735,7 @@ export const serializeAws_restJson1DeleteUserByPrincipalIdCommand = async ( input: DeleteUserByPrincipalIdCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/user-principals/{PrincipalId}"; if (input.PrincipalId !== undefined) { const labelValue: string = input.PrincipalId; @@ -1778,9 +1781,7 @@ export const serializeAws_restJson1DescribeAccountCustomizationCommand = async ( input: DescribeAccountCustomizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/customizations"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1813,9 +1814,7 @@ export const serializeAws_restJson1DescribeAccountSettingsCommand = async ( input: DescribeAccountSettingsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/settings"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1843,9 +1842,7 @@ export const serializeAws_restJson1DescribeAnalysisCommand = async ( input: DescribeAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/analyses/{AnalysisId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1882,9 +1879,7 @@ export const serializeAws_restJson1DescribeAnalysisPermissionsCommand = async ( input: DescribeAnalysisPermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/analyses/{AnalysisId}/permissions"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1921,9 +1916,7 @@ export const serializeAws_restJson1DescribeDashboardCommand = async ( input: DescribeDashboardCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/dashboards/{DashboardId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -1965,9 +1958,7 @@ export const serializeAws_restJson1DescribeDashboardPermissionsCommand = async ( input: DescribeDashboardPermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/dashboards/{DashboardId}/permissions"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2004,9 +1995,7 @@ export const serializeAws_restJson1DescribeDataSetCommand = async ( input: DescribeDataSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sets/{DataSetId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2043,9 +2032,7 @@ export const serializeAws_restJson1DescribeDataSetPermissionsCommand = async ( input: DescribeDataSetPermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sets/{DataSetId}/permissions"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2082,9 +2069,7 @@ export const serializeAws_restJson1DescribeDataSourceCommand = async ( input: DescribeDataSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sources/{DataSourceId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2121,9 +2106,7 @@ export const serializeAws_restJson1DescribeDataSourcePermissionsCommand = async input: DescribeDataSourcePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sources/{DataSourceId}/permissions"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2160,9 +2143,7 @@ export const serializeAws_restJson1DescribeGroupCommand = async ( input: DescribeGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}"; if (input.GroupName !== undefined) { const labelValue: string = input.GroupName; @@ -2208,9 +2189,7 @@ export const serializeAws_restJson1DescribeIAMPolicyAssignmentCommand = async ( input: DescribeIAMPolicyAssignmentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments/{AssignmentName}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2256,9 +2235,7 @@ export const serializeAws_restJson1DescribeIngestionCommand = async ( input: DescribeIngestionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions/{IngestionId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2304,9 +2281,7 @@ export const serializeAws_restJson1DescribeNamespaceCommand = async ( input: DescribeNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2343,9 +2318,7 @@ export const serializeAws_restJson1DescribeTemplateCommand = async ( input: DescribeTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2387,9 +2360,7 @@ export const serializeAws_restJson1DescribeTemplateAliasCommand = async ( input: DescribeTemplateAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2435,9 +2406,7 @@ export const serializeAws_restJson1DescribeTemplatePermissionsCommand = async ( input: DescribeTemplatePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}/permissions"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2474,9 +2443,7 @@ export const serializeAws_restJson1DescribeThemeCommand = async ( input: DescribeThemeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2518,9 +2485,7 @@ export const serializeAws_restJson1DescribeThemeAliasCommand = async ( input: DescribeThemeAliasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases/{AliasName}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2566,9 +2531,7 @@ export const serializeAws_restJson1DescribeThemePermissionsCommand = async ( input: DescribeThemePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}/permissions"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2605,9 +2568,7 @@ export const serializeAws_restJson1DescribeUserCommand = async ( input: DescribeUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}"; if (input.UserName !== undefined) { const labelValue: string = input.UserName; @@ -2653,9 +2614,7 @@ export const serializeAws_restJson1GetDashboardEmbedUrlCommand = async ( input: GetDashboardEmbedUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/dashboards/{DashboardId}/embed-url"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2709,9 +2668,7 @@ export const serializeAws_restJson1GetSessionEmbedUrlCommand = async ( input: GetSessionEmbedUrlCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/session-embed-url"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2747,9 +2704,7 @@ export const serializeAws_restJson1ListAnalysesCommand = async ( input: ListAnalysesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/analyses"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2782,9 +2737,7 @@ export const serializeAws_restJson1ListDashboardsCommand = async ( input: ListDashboardsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/dashboards"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2817,9 +2770,7 @@ export const serializeAws_restJson1ListDashboardVersionsCommand = async ( input: ListDashboardVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/dashboards/{DashboardId}/versions"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2861,9 +2812,7 @@ export const serializeAws_restJson1ListDataSetsCommand = async ( input: ListDataSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sets"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2896,9 +2845,7 @@ export const serializeAws_restJson1ListDataSourcesCommand = async ( input: ListDataSourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sources"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -2931,9 +2878,7 @@ export const serializeAws_restJson1ListGroupMembershipsCommand = async ( input: ListGroupMembershipsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members"; if (input.GroupName !== undefined) { const labelValue: string = input.GroupName; @@ -2984,9 +2929,7 @@ export const serializeAws_restJson1ListGroupsCommand = async ( input: ListGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3029,7 +2972,7 @@ export const serializeAws_restJson1ListIAMPolicyAssignmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments"; if (input.AwsAccountId !== undefined) { @@ -3056,7 +2999,8 @@ export const serializeAws_restJson1ListIAMPolicyAssignmentsCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.AssignmentStatus !== undefined && { AssignmentStatus: input.AssignmentStatus }), + ...(input.AssignmentStatus !== undefined && + input.AssignmentStatus !== null && { AssignmentStatus: input.AssignmentStatus }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3075,9 +3019,7 @@ export const serializeAws_restJson1ListIAMPolicyAssignmentsForUserCommand = asyn input: ListIAMPolicyAssignmentsForUserCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}/iam-policy-assignments"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3128,9 +3070,7 @@ export const serializeAws_restJson1ListIngestionsCommand = async ( input: ListIngestionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions"; if (input.DataSetId !== undefined) { const labelValue: string = input.DataSetId; @@ -3172,9 +3112,7 @@ export const serializeAws_restJson1ListNamespacesCommand = async ( input: ListNamespacesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3207,9 +3145,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/resources/{ResourceArn}/tags"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -3237,9 +3173,7 @@ export const serializeAws_restJson1ListTemplateAliasesCommand = async ( input: ListTemplateAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3281,9 +3215,7 @@ export const serializeAws_restJson1ListTemplatesCommand = async ( input: ListTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/templates"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3316,9 +3248,7 @@ export const serializeAws_restJson1ListTemplateVersionsCommand = async ( input: ListTemplateVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}/versions"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3360,9 +3290,7 @@ export const serializeAws_restJson1ListThemeAliasesCommand = async ( input: ListThemeAliasesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3404,9 +3332,7 @@ export const serializeAws_restJson1ListThemesCommand = async ( input: ListThemesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/themes"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3440,9 +3366,7 @@ export const serializeAws_restJson1ListThemeVersionsCommand = async ( input: ListThemeVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}/versions"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3484,9 +3408,7 @@ export const serializeAws_restJson1ListUserGroupsCommand = async ( input: ListUserGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}/groups"; if (input.UserName !== undefined) { const labelValue: string = input.UserName; @@ -3537,9 +3459,7 @@ export const serializeAws_restJson1ListUsersCommand = async ( input: ListUsersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/users"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3582,7 +3502,7 @@ export const serializeAws_restJson1RegisterUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/users"; if (input.AwsAccountId !== undefined) { @@ -3605,13 +3525,14 @@ export const serializeAws_restJson1RegisterUserCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CustomPermissionsName !== undefined && { CustomPermissionsName: input.CustomPermissionsName }), - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.IamArn !== undefined && { IamArn: input.IamArn }), - ...(input.IdentityType !== undefined && { IdentityType: input.IdentityType }), - ...(input.SessionName !== undefined && { SessionName: input.SessionName }), - ...(input.UserName !== undefined && { UserName: input.UserName }), - ...(input.UserRole !== undefined && { UserRole: input.UserRole }), + ...(input.CustomPermissionsName !== undefined && + input.CustomPermissionsName !== null && { CustomPermissionsName: input.CustomPermissionsName }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.IamArn !== undefined && input.IamArn !== null && { IamArn: input.IamArn }), + ...(input.IdentityType !== undefined && input.IdentityType !== null && { IdentityType: input.IdentityType }), + ...(input.SessionName !== undefined && input.SessionName !== null && { SessionName: input.SessionName }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), + ...(input.UserRole !== undefined && input.UserRole !== null && { UserRole: input.UserRole }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3629,9 +3550,7 @@ export const serializeAws_restJson1RestoreAnalysisCommand = async ( input: RestoreAnalysisCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/restore/analyses/{AnalysisId}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -3669,7 +3588,7 @@ export const serializeAws_restJson1SearchAnalysesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/search/analyses"; if (input.AwsAccountId !== undefined) { @@ -3683,11 +3602,10 @@ export const serializeAws_restJson1SearchAnalysesCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1AnalysisSearchFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1AnalysisSearchFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3706,7 +3624,7 @@ export const serializeAws_restJson1SearchDashboardsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/search/dashboards"; if (input.AwsAccountId !== undefined) { @@ -3720,11 +3638,10 @@ export const serializeAws_restJson1SearchDashboardsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1DashboardSearchFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1DashboardSearchFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3743,7 +3660,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/resources/{ResourceArn}/tags"; if (input.ResourceArn !== undefined) { @@ -3757,7 +3674,8 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3775,9 +3693,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/resources/{ResourceArn}/tags"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -3810,7 +3726,7 @@ export const serializeAws_restJson1UpdateAccountCustomizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/customizations"; if (input.AwsAccountId !== undefined) { @@ -3827,9 +3743,10 @@ export const serializeAws_restJson1UpdateAccountCustomizationCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.AccountCustomization !== undefined && { - AccountCustomization: serializeAws_restJson1AccountCustomization(input.AccountCustomization, context), - }), + ...(input.AccountCustomization !== undefined && + input.AccountCustomization !== null && { + AccountCustomization: serializeAws_restJson1AccountCustomization(input.AccountCustomization, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3849,7 +3766,7 @@ export const serializeAws_restJson1UpdateAccountSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/settings"; if (input.AwsAccountId !== undefined) { @@ -3863,8 +3780,10 @@ export const serializeAws_restJson1UpdateAccountSettingsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DefaultNamespace !== undefined && { DefaultNamespace: input.DefaultNamespace }), - ...(input.NotificationEmail !== undefined && { NotificationEmail: input.NotificationEmail }), + ...(input.DefaultNamespace !== undefined && + input.DefaultNamespace !== null && { DefaultNamespace: input.DefaultNamespace }), + ...(input.NotificationEmail !== undefined && + input.NotificationEmail !== null && { NotificationEmail: input.NotificationEmail }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3883,7 +3802,7 @@ export const serializeAws_restJson1UpdateAnalysisCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/analyses/{AnalysisId}"; if (input.AwsAccountId !== undefined) { @@ -3906,12 +3825,14 @@ export const serializeAws_restJson1UpdateAnalysisCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), - ...(input.SourceEntity !== undefined && { - SourceEntity: serializeAws_restJson1AnalysisSourceEntity(input.SourceEntity, context), - }), - ...(input.ThemeArn !== undefined && { ThemeArn: input.ThemeArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), + ...(input.SourceEntity !== undefined && + input.SourceEntity !== null && { + SourceEntity: serializeAws_restJson1AnalysisSourceEntity(input.SourceEntity, context), + }), + ...(input.ThemeArn !== undefined && input.ThemeArn !== null && { ThemeArn: input.ThemeArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3930,7 +3851,7 @@ export const serializeAws_restJson1UpdateAnalysisPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/analyses/{AnalysisId}/permissions"; if (input.AwsAccountId !== undefined) { @@ -3953,12 +3874,14 @@ export const serializeAws_restJson1UpdateAnalysisPermissionsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.GrantPermissions !== undefined && { - GrantPermissions: serializeAws_restJson1UpdateResourcePermissionList(input.GrantPermissions, context), - }), - ...(input.RevokePermissions !== undefined && { - RevokePermissions: serializeAws_restJson1UpdateResourcePermissionList(input.RevokePermissions, context), - }), + ...(input.GrantPermissions !== undefined && + input.GrantPermissions !== null && { + GrantPermissions: serializeAws_restJson1UpdateResourcePermissionList(input.GrantPermissions, context), + }), + ...(input.RevokePermissions !== undefined && + input.RevokePermissions !== null && { + RevokePermissions: serializeAws_restJson1UpdateResourcePermissionList(input.RevokePermissions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3977,7 +3900,7 @@ export const serializeAws_restJson1UpdateDashboardCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/dashboards/{DashboardId}"; if (input.AwsAccountId !== undefined) { @@ -4000,16 +3923,20 @@ export const serializeAws_restJson1UpdateDashboardCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DashboardPublishOptions !== undefined && { - DashboardPublishOptions: serializeAws_restJson1DashboardPublishOptions(input.DashboardPublishOptions, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), - ...(input.SourceEntity !== undefined && { - SourceEntity: serializeAws_restJson1DashboardSourceEntity(input.SourceEntity, context), - }), - ...(input.ThemeArn !== undefined && { ThemeArn: input.ThemeArn }), - ...(input.VersionDescription !== undefined && { VersionDescription: input.VersionDescription }), + ...(input.DashboardPublishOptions !== undefined && + input.DashboardPublishOptions !== null && { + DashboardPublishOptions: serializeAws_restJson1DashboardPublishOptions(input.DashboardPublishOptions, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_restJson1_Parameters(input.Parameters, context) }), + ...(input.SourceEntity !== undefined && + input.SourceEntity !== null && { + SourceEntity: serializeAws_restJson1DashboardSourceEntity(input.SourceEntity, context), + }), + ...(input.ThemeArn !== undefined && input.ThemeArn !== null && { ThemeArn: input.ThemeArn }), + ...(input.VersionDescription !== undefined && + input.VersionDescription !== null && { VersionDescription: input.VersionDescription }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4028,7 +3955,7 @@ export const serializeAws_restJson1UpdateDashboardPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/dashboards/{DashboardId}/permissions"; if (input.AwsAccountId !== undefined) { @@ -4051,12 +3978,14 @@ export const serializeAws_restJson1UpdateDashboardPermissionsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.GrantPermissions !== undefined && { - GrantPermissions: serializeAws_restJson1UpdateResourcePermissionList(input.GrantPermissions, context), - }), - ...(input.RevokePermissions !== undefined && { - RevokePermissions: serializeAws_restJson1UpdateResourcePermissionList(input.RevokePermissions, context), - }), + ...(input.GrantPermissions !== undefined && + input.GrantPermissions !== null && { + GrantPermissions: serializeAws_restJson1UpdateResourcePermissionList(input.GrantPermissions, context), + }), + ...(input.RevokePermissions !== undefined && + input.RevokePermissions !== null && { + RevokePermissions: serializeAws_restJson1UpdateResourcePermissionList(input.RevokePermissions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4074,9 +4003,7 @@ export const serializeAws_restJson1UpdateDashboardPublishedVersionCommand = asyn input: UpdateDashboardPublishedVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts/{AwsAccountId}/dashboards/{DashboardId}/versions/{VersionNumber}"; if (input.AwsAccountId !== undefined) { const labelValue: string = input.AwsAccountId; @@ -4123,7 +4050,7 @@ export const serializeAws_restJson1UpdateDataSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/data-sets/{DataSetId}"; if (input.AwsAccountId !== undefined) { @@ -4146,29 +4073,34 @@ export const serializeAws_restJson1UpdateDataSetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ColumnGroups !== undefined && { - ColumnGroups: serializeAws_restJson1ColumnGroupList(input.ColumnGroups, context), - }), - ...(input.ColumnLevelPermissionRules !== undefined && { - ColumnLevelPermissionRules: serializeAws_restJson1ColumnLevelPermissionRuleList( - input.ColumnLevelPermissionRules, - context - ), - }), - ...(input.ImportMode !== undefined && { ImportMode: input.ImportMode }), - ...(input.LogicalTableMap !== undefined && { - LogicalTableMap: serializeAws_restJson1LogicalTableMap(input.LogicalTableMap, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PhysicalTableMap !== undefined && { - PhysicalTableMap: serializeAws_restJson1PhysicalTableMap(input.PhysicalTableMap, context), - }), - ...(input.RowLevelPermissionDataSet !== undefined && { - RowLevelPermissionDataSet: serializeAws_restJson1RowLevelPermissionDataSet( - input.RowLevelPermissionDataSet, - context - ), - }), + ...(input.ColumnGroups !== undefined && + input.ColumnGroups !== null && { + ColumnGroups: serializeAws_restJson1ColumnGroupList(input.ColumnGroups, context), + }), + ...(input.ColumnLevelPermissionRules !== undefined && + input.ColumnLevelPermissionRules !== null && { + ColumnLevelPermissionRules: serializeAws_restJson1ColumnLevelPermissionRuleList( + input.ColumnLevelPermissionRules, + context + ), + }), + ...(input.ImportMode !== undefined && input.ImportMode !== null && { ImportMode: input.ImportMode }), + ...(input.LogicalTableMap !== undefined && + input.LogicalTableMap !== null && { + LogicalTableMap: serializeAws_restJson1LogicalTableMap(input.LogicalTableMap, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PhysicalTableMap !== undefined && + input.PhysicalTableMap !== null && { + PhysicalTableMap: serializeAws_restJson1PhysicalTableMap(input.PhysicalTableMap, context), + }), + ...(input.RowLevelPermissionDataSet !== undefined && + input.RowLevelPermissionDataSet !== null && { + RowLevelPermissionDataSet: serializeAws_restJson1RowLevelPermissionDataSet( + input.RowLevelPermissionDataSet, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4187,7 +4119,7 @@ export const serializeAws_restJson1UpdateDataSetPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/data-sets/{DataSetId}/permissions"; if (input.AwsAccountId !== undefined) { @@ -4210,12 +4142,14 @@ export const serializeAws_restJson1UpdateDataSetPermissionsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.GrantPermissions !== undefined && { - GrantPermissions: serializeAws_restJson1ResourcePermissionList(input.GrantPermissions, context), - }), - ...(input.RevokePermissions !== undefined && { - RevokePermissions: serializeAws_restJson1ResourcePermissionList(input.RevokePermissions, context), - }), + ...(input.GrantPermissions !== undefined && + input.GrantPermissions !== null && { + GrantPermissions: serializeAws_restJson1ResourcePermissionList(input.GrantPermissions, context), + }), + ...(input.RevokePermissions !== undefined && + input.RevokePermissions !== null && { + RevokePermissions: serializeAws_restJson1ResourcePermissionList(input.RevokePermissions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4234,7 +4168,7 @@ export const serializeAws_restJson1UpdateDataSourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/data-sources/{DataSourceId}"; if (input.AwsAccountId !== undefined) { @@ -4257,19 +4191,23 @@ export const serializeAws_restJson1UpdateDataSourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Credentials !== undefined && { - Credentials: serializeAws_restJson1DataSourceCredentials(input.Credentials, context), - }), - ...(input.DataSourceParameters !== undefined && { - DataSourceParameters: serializeAws_restJson1DataSourceParameters(input.DataSourceParameters, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SslProperties !== undefined && { - SslProperties: serializeAws_restJson1SslProperties(input.SslProperties, context), - }), - ...(input.VpcConnectionProperties !== undefined && { - VpcConnectionProperties: serializeAws_restJson1VpcConnectionProperties(input.VpcConnectionProperties, context), - }), + ...(input.Credentials !== undefined && + input.Credentials !== null && { + Credentials: serializeAws_restJson1DataSourceCredentials(input.Credentials, context), + }), + ...(input.DataSourceParameters !== undefined && + input.DataSourceParameters !== null && { + DataSourceParameters: serializeAws_restJson1DataSourceParameters(input.DataSourceParameters, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SslProperties !== undefined && + input.SslProperties !== null && { + SslProperties: serializeAws_restJson1SslProperties(input.SslProperties, context), + }), + ...(input.VpcConnectionProperties !== undefined && + input.VpcConnectionProperties !== null && { + VpcConnectionProperties: serializeAws_restJson1VpcConnectionProperties(input.VpcConnectionProperties, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4288,7 +4226,7 @@ export const serializeAws_restJson1UpdateDataSourcePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/data-sources/{DataSourceId}/permissions"; if (input.AwsAccountId !== undefined) { @@ -4311,12 +4249,14 @@ export const serializeAws_restJson1UpdateDataSourcePermissionsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.GrantPermissions !== undefined && { - GrantPermissions: serializeAws_restJson1ResourcePermissionList(input.GrantPermissions, context), - }), - ...(input.RevokePermissions !== undefined && { - RevokePermissions: serializeAws_restJson1ResourcePermissionList(input.RevokePermissions, context), - }), + ...(input.GrantPermissions !== undefined && + input.GrantPermissions !== null && { + GrantPermissions: serializeAws_restJson1ResourcePermissionList(input.GrantPermissions, context), + }), + ...(input.RevokePermissions !== undefined && + input.RevokePermissions !== null && { + RevokePermissions: serializeAws_restJson1ResourcePermissionList(input.RevokePermissions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4335,7 +4275,7 @@ export const serializeAws_restJson1UpdateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}"; if (input.GroupName !== undefined) { @@ -4367,7 +4307,7 @@ export const serializeAws_restJson1UpdateGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4386,7 +4326,7 @@ export const serializeAws_restJson1UpdateIAMPolicyAssignmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments/{AssignmentName}"; if (input.AwsAccountId !== undefined) { @@ -4418,9 +4358,11 @@ export const serializeAws_restJson1UpdateIAMPolicyAssignmentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AssignmentStatus !== undefined && { AssignmentStatus: input.AssignmentStatus }), - ...(input.Identities !== undefined && { Identities: serializeAws_restJson1IdentityMap(input.Identities, context) }), - ...(input.PolicyArn !== undefined && { PolicyArn: input.PolicyArn }), + ...(input.AssignmentStatus !== undefined && + input.AssignmentStatus !== null && { AssignmentStatus: input.AssignmentStatus }), + ...(input.Identities !== undefined && + input.Identities !== null && { Identities: serializeAws_restJson1IdentityMap(input.Identities, context) }), + ...(input.PolicyArn !== undefined && input.PolicyArn !== null && { PolicyArn: input.PolicyArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4439,7 +4381,7 @@ export const serializeAws_restJson1UpdateTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}"; if (input.AwsAccountId !== undefined) { @@ -4462,11 +4404,13 @@ export const serializeAws_restJson1UpdateTemplateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SourceEntity !== undefined && { - SourceEntity: serializeAws_restJson1TemplateSourceEntity(input.SourceEntity, context), - }), - ...(input.VersionDescription !== undefined && { VersionDescription: input.VersionDescription }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SourceEntity !== undefined && + input.SourceEntity !== null && { + SourceEntity: serializeAws_restJson1TemplateSourceEntity(input.SourceEntity, context), + }), + ...(input.VersionDescription !== undefined && + input.VersionDescription !== null && { VersionDescription: input.VersionDescription }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4485,7 +4429,7 @@ export const serializeAws_restJson1UpdateTemplateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}"; if (input.AwsAccountId !== undefined) { @@ -4517,7 +4461,8 @@ export const serializeAws_restJson1UpdateTemplateAliasCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TemplateVersionNumber !== undefined && { TemplateVersionNumber: input.TemplateVersionNumber }), + ...(input.TemplateVersionNumber !== undefined && + input.TemplateVersionNumber !== null && { TemplateVersionNumber: input.TemplateVersionNumber }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4536,7 +4481,7 @@ export const serializeAws_restJson1UpdateTemplatePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/templates/{TemplateId}/permissions"; if (input.AwsAccountId !== undefined) { @@ -4559,12 +4504,14 @@ export const serializeAws_restJson1UpdateTemplatePermissionsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.GrantPermissions !== undefined && { - GrantPermissions: serializeAws_restJson1UpdateResourcePermissionList(input.GrantPermissions, context), - }), - ...(input.RevokePermissions !== undefined && { - RevokePermissions: serializeAws_restJson1UpdateResourcePermissionList(input.RevokePermissions, context), - }), + ...(input.GrantPermissions !== undefined && + input.GrantPermissions !== null && { + GrantPermissions: serializeAws_restJson1UpdateResourcePermissionList(input.GrantPermissions, context), + }), + ...(input.RevokePermissions !== undefined && + input.RevokePermissions !== null && { + RevokePermissions: serializeAws_restJson1UpdateResourcePermissionList(input.RevokePermissions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4583,7 +4530,7 @@ export const serializeAws_restJson1UpdateThemeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}"; if (input.AwsAccountId !== undefined) { @@ -4606,12 +4553,14 @@ export const serializeAws_restJson1UpdateThemeCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.BaseThemeId !== undefined && { BaseThemeId: input.BaseThemeId }), - ...(input.Configuration !== undefined && { - Configuration: serializeAws_restJson1ThemeConfiguration(input.Configuration, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.VersionDescription !== undefined && { VersionDescription: input.VersionDescription }), + ...(input.BaseThemeId !== undefined && input.BaseThemeId !== null && { BaseThemeId: input.BaseThemeId }), + ...(input.Configuration !== undefined && + input.Configuration !== null && { + Configuration: serializeAws_restJson1ThemeConfiguration(input.Configuration, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.VersionDescription !== undefined && + input.VersionDescription !== null && { VersionDescription: input.VersionDescription }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4630,7 +4579,7 @@ export const serializeAws_restJson1UpdateThemeAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases/{AliasName}"; if (input.AwsAccountId !== undefined) { @@ -4662,7 +4611,8 @@ export const serializeAws_restJson1UpdateThemeAliasCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ThemeVersionNumber !== undefined && { ThemeVersionNumber: input.ThemeVersionNumber }), + ...(input.ThemeVersionNumber !== undefined && + input.ThemeVersionNumber !== null && { ThemeVersionNumber: input.ThemeVersionNumber }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4681,7 +4631,7 @@ export const serializeAws_restJson1UpdateThemePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/themes/{ThemeId}/permissions"; if (input.AwsAccountId !== undefined) { @@ -4704,12 +4654,14 @@ export const serializeAws_restJson1UpdateThemePermissionsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.GrantPermissions !== undefined && { - GrantPermissions: serializeAws_restJson1UpdateResourcePermissionList(input.GrantPermissions, context), - }), - ...(input.RevokePermissions !== undefined && { - RevokePermissions: serializeAws_restJson1UpdateResourcePermissionList(input.RevokePermissions, context), - }), + ...(input.GrantPermissions !== undefined && + input.GrantPermissions !== null && { + GrantPermissions: serializeAws_restJson1UpdateResourcePermissionList(input.GrantPermissions, context), + }), + ...(input.RevokePermissions !== undefined && + input.RevokePermissions !== null && { + RevokePermissions: serializeAws_restJson1UpdateResourcePermissionList(input.RevokePermissions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4728,7 +4680,7 @@ export const serializeAws_restJson1UpdateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}"; if (input.UserName !== undefined) { @@ -4760,10 +4712,12 @@ export const serializeAws_restJson1UpdateUserCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.CustomPermissionsName !== undefined && { CustomPermissionsName: input.CustomPermissionsName }), - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.UnapplyCustomPermissions !== undefined && { UnapplyCustomPermissions: input.UnapplyCustomPermissions }), + ...(input.CustomPermissionsName !== undefined && + input.CustomPermissionsName !== null && { CustomPermissionsName: input.CustomPermissionsName }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.UnapplyCustomPermissions !== undefined && + input.UnapplyCustomPermissions !== null && { UnapplyCustomPermissions: input.UnapplyCustomPermissions }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4801,6 +4755,9 @@ export const deserializeAws_restJson1CancelIngestionCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -4913,6 +4870,9 @@ export const deserializeAws_restJson1CreateAccountCustomizationCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -5029,6 +4989,9 @@ export const deserializeAws_restJson1CreateAnalysisCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -5149,6 +5112,9 @@ export const deserializeAws_restJson1CreateDashboardCommand = async ( if (data.VersionArn !== undefined && data.VersionArn !== null) { contents.VersionArn = data.VersionArn; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -5269,6 +5235,9 @@ export const deserializeAws_restJson1CreateDataSetCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -5401,6 +5370,9 @@ export const deserializeAws_restJson1CreateDataSourceCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -5517,6 +5489,9 @@ export const deserializeAws_restJson1CreateGroupCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -5641,6 +5616,9 @@ export const deserializeAws_restJson1CreateGroupMembershipCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -5765,6 +5743,9 @@ export const deserializeAws_restJson1CreateIAMPolicyAssignmentCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -5881,6 +5862,9 @@ export const deserializeAws_restJson1CreateIngestionCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -6005,6 +5989,9 @@ export const deserializeAws_restJson1CreateNamespaceCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -6149,6 +6136,9 @@ export const deserializeAws_restJson1CreateTemplateCommand = async ( if (data.VersionArn !== undefined && data.VersionArn !== null) { contents.VersionArn = data.VersionArn; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -6273,6 +6263,9 @@ export const deserializeAws_restJson1CreateTemplateAliasCommand = async ( if (data.TemplateAlias !== undefined && data.TemplateAlias !== null) { contents.TemplateAlias = deserializeAws_restJson1TemplateAlias(data.TemplateAlias, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -6393,6 +6386,9 @@ export const deserializeAws_restJson1CreateThemeCommand = async ( if (data.VersionArn !== undefined && data.VersionArn !== null) { contents.VersionArn = data.VersionArn; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -6509,6 +6505,9 @@ export const deserializeAws_restJson1CreateThemeAliasCommand = async ( if (data.ThemeAlias !== undefined && data.ThemeAlias !== null) { contents.ThemeAlias = deserializeAws_restJson1ThemeAlias(data.ThemeAlias, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -6621,6 +6620,9 @@ export const deserializeAws_restJson1DeleteAccountCustomizationCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -6729,6 +6731,9 @@ export const deserializeAws_restJson1DeleteAnalysisCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -6833,6 +6838,9 @@ export const deserializeAws_restJson1DeleteDashboardCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -6937,6 +6945,9 @@ export const deserializeAws_restJson1DeleteDataSetCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7033,6 +7044,9 @@ export const deserializeAws_restJson1DeleteDataSourceCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7121,6 +7135,9 @@ export const deserializeAws_restJson1DeleteGroupCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7225,6 +7242,9 @@ export const deserializeAws_restJson1DeleteGroupMembershipCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7333,6 +7353,9 @@ export const deserializeAws_restJson1DeleteIAMPolicyAssignmentCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7437,6 +7460,9 @@ export const deserializeAws_restJson1DeleteNamespaceCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7549,6 +7575,9 @@ export const deserializeAws_restJson1DeleteTemplateCommand = async ( if (data.TemplateId !== undefined && data.TemplateId !== null) { contents.TemplateId = data.TemplateId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7665,6 +7694,9 @@ export const deserializeAws_restJson1DeleteTemplateAliasCommand = async ( if (data.TemplateId !== undefined && data.TemplateId !== null) { contents.TemplateId = data.TemplateId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7761,6 +7793,9 @@ export const deserializeAws_restJson1DeleteThemeCommand = async ( if (data.ThemeId !== undefined && data.ThemeId !== null) { contents.ThemeId = data.ThemeId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7877,6 +7912,9 @@ export const deserializeAws_restJson1DeleteThemeAliasCommand = async ( if (data.ThemeId !== undefined && data.ThemeId !== null) { contents.ThemeId = data.ThemeId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -7973,6 +8011,9 @@ export const deserializeAws_restJson1DeleteUserCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8077,6 +8118,9 @@ export const deserializeAws_restJson1DeleteUserByPrincipalIdCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8197,6 +8241,9 @@ export const deserializeAws_restJson1DescribeAccountCustomizationCommand = async if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8297,6 +8344,9 @@ export const deserializeAws_restJson1DescribeAccountSettingsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8397,6 +8447,9 @@ export const deserializeAws_restJson1DescribeAnalysisCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8505,6 +8558,9 @@ export const deserializeAws_restJson1DescribeAnalysisPermissionsCommand = async if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8597,6 +8653,9 @@ export const deserializeAws_restJson1DescribeDashboardCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8705,6 +8764,9 @@ export const deserializeAws_restJson1DescribeDashboardPermissionsCommand = async if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8797,6 +8859,9 @@ export const deserializeAws_restJson1DescribeDataSetCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8897,6 +8962,9 @@ export const deserializeAws_restJson1DescribeDataSetPermissionsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -8989,6 +9057,9 @@ export const deserializeAws_restJson1DescribeDataSourceCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -9089,6 +9160,9 @@ export const deserializeAws_restJson1DescribeDataSourcePermissionsCommand = asyn if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -9181,6 +9255,9 @@ export const deserializeAws_restJson1DescribeGroupCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -9289,6 +9366,9 @@ export const deserializeAws_restJson1DescribeIAMPolicyAssignmentCommand = async if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -9389,6 +9469,9 @@ export const deserializeAws_restJson1DescribeIngestionCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -9489,6 +9572,9 @@ export const deserializeAws_restJson1DescribeNamespaceCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -9589,6 +9675,9 @@ export const deserializeAws_restJson1DescribeTemplateCommand = async ( if (data.Template !== undefined && data.Template !== null) { contents.Template = deserializeAws_restJson1Template(data.Template, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -9705,6 +9794,9 @@ export const deserializeAws_restJson1DescribeTemplateAliasCommand = async ( if (data.TemplateAlias !== undefined && data.TemplateAlias !== null) { contents.TemplateAlias = deserializeAws_restJson1TemplateAlias(data.TemplateAlias, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -9797,6 +9889,9 @@ export const deserializeAws_restJson1DescribeTemplatePermissionsCommand = async if (data.TemplateId !== undefined && data.TemplateId !== null) { contents.TemplateId = data.TemplateId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -9897,6 +9992,9 @@ export const deserializeAws_restJson1DescribeThemeCommand = async ( if (data.Theme !== undefined && data.Theme !== null) { contents.Theme = deserializeAws_restJson1Theme(data.Theme, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10005,6 +10103,9 @@ export const deserializeAws_restJson1DescribeThemeAliasCommand = async ( if (data.ThemeAlias !== undefined && data.ThemeAlias !== null) { contents.ThemeAlias = deserializeAws_restJson1ThemeAlias(data.ThemeAlias, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10113,6 +10214,9 @@ export const deserializeAws_restJson1DescribeThemePermissionsCommand = async ( if (data.ThemeId !== undefined && data.ThemeId !== null) { contents.ThemeId = data.ThemeId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10213,6 +10317,9 @@ export const deserializeAws_restJson1DescribeUserCommand = async ( if (data.User !== undefined && data.User !== null) { contents.User = deserializeAws_restJson1User(data.User, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10321,6 +10428,9 @@ export const deserializeAws_restJson1GetDashboardEmbedUrlCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10469,6 +10579,9 @@ export const deserializeAws_restJson1GetSessionEmbedUrlCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10597,6 +10710,9 @@ export const deserializeAws_restJson1ListAnalysesCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10685,6 +10801,9 @@ export const deserializeAws_restJson1ListDashboardsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10776,6 +10895,9 @@ export const deserializeAws_restJson1ListDashboardVersionsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10880,6 +11002,9 @@ export const deserializeAws_restJson1ListDataSetsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -10976,6 +11101,9 @@ export const deserializeAws_restJson1ListDataSourcesCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -11072,6 +11200,9 @@ export const deserializeAws_restJson1ListGroupMembershipsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -11192,6 +11323,9 @@ export const deserializeAws_restJson1ListGroupsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -11315,6 +11449,9 @@ export const deserializeAws_restJson1ListIAMPolicyAssignmentsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -11419,6 +11556,9 @@ export const deserializeAws_restJson1ListIAMPolicyAssignmentsForUserCommand = as if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -11531,6 +11671,9 @@ export const deserializeAws_restJson1ListIngestionsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -11643,6 +11786,9 @@ export const deserializeAws_restJson1ListNamespacesCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -11759,6 +11905,9 @@ export const deserializeAws_restJson1ListTagsForResourceCommand = async ( if (data.Tags !== undefined && data.Tags !== null) { contents.Tags = deserializeAws_restJson1TagList(data.Tags, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -11855,6 +12004,9 @@ export const deserializeAws_restJson1ListTemplateAliasesCommand = async ( if (data.TemplateAliasList !== undefined && data.TemplateAliasList !== null) { contents.TemplateAliasList = deserializeAws_restJson1TemplateAliasList(data.TemplateAliasList, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -11951,6 +12103,9 @@ export const deserializeAws_restJson1ListTemplatesCommand = async ( if (data.TemplateSummaryList !== undefined && data.TemplateSummaryList !== null) { contents.TemplateSummaryList = deserializeAws_restJson1TemplateSummaryList(data.TemplateSummaryList, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -12058,6 +12213,9 @@ export const deserializeAws_restJson1ListTemplateVersionsCommand = async ( context ); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -12162,6 +12320,9 @@ export const deserializeAws_restJson1ListThemeAliasesCommand = async ( if (data.ThemeAliasList !== undefined && data.ThemeAliasList !== null) { contents.ThemeAliasList = deserializeAws_restJson1ThemeAliasList(data.ThemeAliasList, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -12274,6 +12435,9 @@ export const deserializeAws_restJson1ListThemesCommand = async ( if (data.ThemeSummaryList !== undefined && data.ThemeSummaryList !== null) { contents.ThemeSummaryList = deserializeAws_restJson1ThemeSummaryList(data.ThemeSummaryList, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -12389,6 +12553,9 @@ export const deserializeAws_restJson1ListThemeVersionsCommand = async ( context ); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -12501,6 +12668,9 @@ export const deserializeAws_restJson1ListUserGroupsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -12613,6 +12783,9 @@ export const deserializeAws_restJson1ListUsersCommand = async ( if (data.UserList !== undefined && data.UserList !== null) { contents.UserList = deserializeAws_restJson1UserList(data.UserList, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -12733,6 +12906,9 @@ export const deserializeAws_restJson1RegisterUserCommand = async ( if (data.UserInvitationUrl !== undefined && data.UserInvitationUrl !== null) { contents.UserInvitationUrl = data.UserInvitationUrl; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -12861,6 +13037,9 @@ export const deserializeAws_restJson1RestoreAnalysisCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -12965,6 +13144,9 @@ export const deserializeAws_restJson1SearchAnalysesCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -13069,6 +13251,9 @@ export const deserializeAws_restJson1SearchDashboardsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -13165,6 +13350,9 @@ export const deserializeAws_restJson1TagResourceCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -13261,6 +13449,9 @@ export const deserializeAws_restJson1UntagResourceCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -13365,6 +13556,9 @@ export const deserializeAws_restJson1UpdateAccountCustomizationCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -13461,6 +13655,9 @@ export const deserializeAws_restJson1UpdateAccountSettingsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -13569,6 +13766,9 @@ export const deserializeAws_restJson1UpdateAnalysisCommand = async ( if (data.UpdateStatus !== undefined && data.UpdateStatus !== null) { contents.UpdateStatus = data.UpdateStatus; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -13685,6 +13885,9 @@ export const deserializeAws_restJson1UpdateAnalysisPermissionsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -13916,6 +14119,9 @@ export const deserializeAws_restJson1UpdateDashboardPermissionsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -14020,6 +14226,9 @@ export const deserializeAws_restJson1UpdateDashboardPublishedVersionCommand = as if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -14132,6 +14341,9 @@ export const deserializeAws_restJson1UpdateDataSetCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -14252,6 +14464,9 @@ export const deserializeAws_restJson1UpdateDataSetPermissionsCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -14360,6 +14575,9 @@ export const deserializeAws_restJson1UpdateDataSourceCommand = async ( if (data.UpdateStatus !== undefined && data.UpdateStatus !== null) { contents.UpdateStatus = data.UpdateStatus; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -14464,6 +14682,9 @@ export const deserializeAws_restJson1UpdateDataSourcePermissionsCommand = async if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -14564,6 +14785,9 @@ export const deserializeAws_restJson1UpdateGroupCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -14688,6 +14912,9 @@ export const deserializeAws_restJson1UpdateIAMPolicyAssignmentCommand = async ( if (data.RequestId !== undefined && data.RequestId !== null) { contents.RequestId = data.RequestId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -14808,6 +15035,9 @@ export const deserializeAws_restJson1UpdateTemplateCommand = async ( if (data.VersionArn !== undefined && data.VersionArn !== null) { contents.VersionArn = data.VersionArn; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -14924,6 +15154,9 @@ export const deserializeAws_restJson1UpdateTemplateAliasCommand = async ( if (data.TemplateAlias !== undefined && data.TemplateAlias !== null) { contents.TemplateAlias = deserializeAws_restJson1TemplateAlias(data.TemplateAlias, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -15024,6 +15257,9 @@ export const deserializeAws_restJson1UpdateTemplatePermissionsCommand = async ( if (data.TemplateId !== undefined && data.TemplateId !== null) { contents.TemplateId = data.TemplateId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -15136,6 +15372,9 @@ export const deserializeAws_restJson1UpdateThemeCommand = async ( if (data.VersionArn !== undefined && data.VersionArn !== null) { contents.VersionArn = data.VersionArn; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -15252,6 +15491,9 @@ export const deserializeAws_restJson1UpdateThemeAliasCommand = async ( if (data.ThemeAlias !== undefined && data.ThemeAlias !== null) { contents.ThemeAlias = deserializeAws_restJson1ThemeAlias(data.ThemeAlias, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -15368,6 +15610,9 @@ export const deserializeAws_restJson1UpdateThemePermissionsCommand = async ( if (data.ThemeId !== undefined && data.ThemeId !== null) { contents.ThemeId = data.ThemeId; } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -15468,6 +15713,9 @@ export const deserializeAws_restJson1UpdateUserCommand = async ( if (data.User !== undefined && data.User !== null) { contents.User = deserializeAws_restJson1User(data.User, context); } + if (contents.Status === undefined) { + contents.Status = output.statusCode; + } return Promise.resolve(contents); }; @@ -15952,17 +16200,25 @@ const deserializeAws_restJson1UnsupportedUserEditionExceptionResponse = async ( const serializeAws_restJson1AccountCustomization = (input: AccountCustomization, context: __SerdeContext): any => { return { - ...(input.DefaultTheme !== undefined && { DefaultTheme: input.DefaultTheme }), + ...(input.DefaultTheme !== undefined && input.DefaultTheme !== null && { DefaultTheme: input.DefaultTheme }), }; }; const serializeAws_restJson1ActionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AdHocFilteringOption = (input: AdHocFilteringOption, context: __SerdeContext): any => { return { - ...(input.AvailabilityStatus !== undefined && { AvailabilityStatus: input.AvailabilityStatus }), + ...(input.AvailabilityStatus !== undefined && + input.AvailabilityStatus !== null && { AvailabilityStatus: input.AvailabilityStatus }), }; }; @@ -15971,15 +16227,15 @@ const serializeAws_restJson1AmazonElasticsearchParameters = ( context: __SerdeContext ): any => { return { - ...(input.Domain !== undefined && { Domain: input.Domain }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), }; }; const serializeAws_restJson1AnalysisSearchFilter = (input: AnalysisSearchFilter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Operator !== undefined && { Operator: input.Operator }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Operator !== undefined && input.Operator !== null && { Operator: input.Operator }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -15987,37 +16243,46 @@ const serializeAws_restJson1AnalysisSearchFilterList = ( input: AnalysisSearchFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AnalysisSearchFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AnalysisSearchFilter(entry, context); + }); }; const serializeAws_restJson1AnalysisSourceEntity = (input: AnalysisSourceEntity, context: __SerdeContext): any => { return { - ...(input.SourceTemplate !== undefined && { - SourceTemplate: serializeAws_restJson1AnalysisSourceTemplate(input.SourceTemplate, context), - }), + ...(input.SourceTemplate !== undefined && + input.SourceTemplate !== null && { + SourceTemplate: serializeAws_restJson1AnalysisSourceTemplate(input.SourceTemplate, context), + }), }; }; const serializeAws_restJson1AnalysisSourceTemplate = (input: AnalysisSourceTemplate, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.DataSetReferences !== undefined && { - DataSetReferences: serializeAws_restJson1DataSetReferenceList(input.DataSetReferences, context), - }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.DataSetReferences !== undefined && + input.DataSetReferences !== null && { + DataSetReferences: serializeAws_restJson1DataSetReferenceList(input.DataSetReferences, context), + }), }; }; const serializeAws_restJson1AthenaParameters = (input: AthenaParameters, context: __SerdeContext): any => { return { - ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }), + ...(input.WorkGroup !== undefined && input.WorkGroup !== null && { WorkGroup: input.WorkGroup }), }; }; const serializeAws_restJson1AuroraParameters = (input: AuroraParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; @@ -16026,9 +16291,9 @@ const serializeAws_restJson1AuroraPostgreSqlParameters = ( context: __SerdeContext ): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; @@ -16037,26 +16302,33 @@ const serializeAws_restJson1AwsIotAnalyticsParameters = ( context: __SerdeContext ): any => { return { - ...(input.DataSetName !== undefined && { DataSetName: input.DataSetName }), + ...(input.DataSetName !== undefined && input.DataSetName !== null && { DataSetName: input.DataSetName }), }; }; const serializeAws_restJson1BorderStyle = (input: BorderStyle, context: __SerdeContext): any => { return { - ...(input.Show !== undefined && { Show: input.Show }), + ...(input.Show !== undefined && input.Show !== null && { Show: input.Show }), }; }; const serializeAws_restJson1CalculatedColumn = (input: CalculatedColumn, context: __SerdeContext): any => { return { - ...(input.ColumnId !== undefined && { ColumnId: input.ColumnId }), - ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), - ...(input.Expression !== undefined && { Expression: input.Expression }), + ...(input.ColumnId !== undefined && input.ColumnId !== null && { ColumnId: input.ColumnId }), + ...(input.ColumnName !== undefined && input.ColumnName !== null && { ColumnName: input.ColumnName }), + ...(input.Expression !== undefined && input.Expression !== null && { Expression: input.Expression }), }; }; const serializeAws_restJson1CalculatedColumnList = (input: CalculatedColumn[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1CalculatedColumn(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CalculatedColumn(entry, context); + }); }; const serializeAws_restJson1CastColumnTypeOperation = ( @@ -16064,32 +16336,47 @@ const serializeAws_restJson1CastColumnTypeOperation = ( context: __SerdeContext ): any => { return { - ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.NewColumnType !== undefined && { NewColumnType: input.NewColumnType }), + ...(input.ColumnName !== undefined && input.ColumnName !== null && { ColumnName: input.ColumnName }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.NewColumnType !== undefined && input.NewColumnType !== null && { NewColumnType: input.NewColumnType }), }; }; const serializeAws_restJson1ColorList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ColumnDescription = (input: ColumnDescription, context: __SerdeContext): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; const serializeAws_restJson1ColumnGroup = (input: ColumnGroup, context: __SerdeContext): any => { return { - ...(input.GeoSpatialColumnGroup !== undefined && { - GeoSpatialColumnGroup: serializeAws_restJson1GeoSpatialColumnGroup(input.GeoSpatialColumnGroup, context), - }), + ...(input.GeoSpatialColumnGroup !== undefined && + input.GeoSpatialColumnGroup !== null && { + GeoSpatialColumnGroup: serializeAws_restJson1GeoSpatialColumnGroup(input.GeoSpatialColumnGroup, context), + }), }; }; const serializeAws_restJson1ColumnGroupList = (input: ColumnGroup[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ColumnGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ColumnGroup(entry, context); + }); }; const serializeAws_restJson1ColumnLevelPermissionRule = ( @@ -16097,12 +16384,10 @@ const serializeAws_restJson1ColumnLevelPermissionRule = ( context: __SerdeContext ): any => { return { - ...(input.ColumnNames !== undefined && { - ColumnNames: serializeAws_restJson1ColumnNameList(input.ColumnNames, context), - }), - ...(input.Principals !== undefined && { - Principals: serializeAws_restJson1PrincipalList(input.Principals, context), - }), + ...(input.ColumnNames !== undefined && + input.ColumnNames !== null && { ColumnNames: serializeAws_restJson1ColumnNameList(input.ColumnNames, context) }), + ...(input.Principals !== undefined && + input.Principals !== null && { Principals: serializeAws_restJson1PrincipalList(input.Principals, context) }), }; }; @@ -16110,55 +16395,88 @@ const serializeAws_restJson1ColumnLevelPermissionRuleList = ( input: ColumnLevelPermissionRule[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ColumnLevelPermissionRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ColumnLevelPermissionRule(entry, context); + }); }; const serializeAws_restJson1ColumnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ColumnNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ColumnTag = (input: ColumnTag, context: __SerdeContext): any => { return { - ...(input.ColumnDescription !== undefined && { - ColumnDescription: serializeAws_restJson1ColumnDescription(input.ColumnDescription, context), - }), - ...(input.ColumnGeographicRole !== undefined && { ColumnGeographicRole: input.ColumnGeographicRole }), + ...(input.ColumnDescription !== undefined && + input.ColumnDescription !== null && { + ColumnDescription: serializeAws_restJson1ColumnDescription(input.ColumnDescription, context), + }), + ...(input.ColumnGeographicRole !== undefined && + input.ColumnGeographicRole !== null && { ColumnGeographicRole: input.ColumnGeographicRole }), }; }; const serializeAws_restJson1ColumnTagList = (input: ColumnTag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ColumnTag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ColumnTag(entry, context); + }); }; const serializeAws_restJson1CreateColumnsOperation = (input: CreateColumnsOperation, context: __SerdeContext): any => { return { - ...(input.Columns !== undefined && { Columns: serializeAws_restJson1CalculatedColumnList(input.Columns, context) }), + ...(input.Columns !== undefined && + input.Columns !== null && { Columns: serializeAws_restJson1CalculatedColumnList(input.Columns, context) }), }; }; const serializeAws_restJson1CredentialPair = (input: CredentialPair, context: __SerdeContext): any => { return { - ...(input.AlternateDataSourceParameters !== undefined && { - AlternateDataSourceParameters: serializeAws_restJson1DataSourceParametersList( - input.AlternateDataSourceParameters, - context - ), - }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.AlternateDataSourceParameters !== undefined && + input.AlternateDataSourceParameters !== null && { + AlternateDataSourceParameters: serializeAws_restJson1DataSourceParametersList( + input.AlternateDataSourceParameters, + context + ), + }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }; }; const serializeAws_restJson1CustomSql = (input: CustomSql, context: __SerdeContext): any => { return { - ...(input.Columns !== undefined && { Columns: serializeAws_restJson1InputColumnList(input.Columns, context) }), - ...(input.DataSourceArn !== undefined && { DataSourceArn: input.DataSourceArn }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SqlQuery !== undefined && { SqlQuery: input.SqlQuery }), + ...(input.Columns !== undefined && + input.Columns !== null && { Columns: serializeAws_restJson1InputColumnList(input.Columns, context) }), + ...(input.DataSourceArn !== undefined && input.DataSourceArn !== null && { DataSourceArn: input.DataSourceArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SqlQuery !== undefined && input.SqlQuery !== null && { SqlQuery: input.SqlQuery }), }; }; @@ -16167,23 +16485,26 @@ const serializeAws_restJson1DashboardPublishOptions = ( context: __SerdeContext ): any => { return { - ...(input.AdHocFilteringOption !== undefined && { - AdHocFilteringOption: serializeAws_restJson1AdHocFilteringOption(input.AdHocFilteringOption, context), - }), - ...(input.ExportToCSVOption !== undefined && { - ExportToCSVOption: serializeAws_restJson1ExportToCSVOption(input.ExportToCSVOption, context), - }), - ...(input.SheetControlsOption !== undefined && { - SheetControlsOption: serializeAws_restJson1SheetControlsOption(input.SheetControlsOption, context), - }), + ...(input.AdHocFilteringOption !== undefined && + input.AdHocFilteringOption !== null && { + AdHocFilteringOption: serializeAws_restJson1AdHocFilteringOption(input.AdHocFilteringOption, context), + }), + ...(input.ExportToCSVOption !== undefined && + input.ExportToCSVOption !== null && { + ExportToCSVOption: serializeAws_restJson1ExportToCSVOption(input.ExportToCSVOption, context), + }), + ...(input.SheetControlsOption !== undefined && + input.SheetControlsOption !== null && { + SheetControlsOption: serializeAws_restJson1SheetControlsOption(input.SheetControlsOption, context), + }), }; }; const serializeAws_restJson1DashboardSearchFilter = (input: DashboardSearchFilter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Operator !== undefined && { Operator: input.Operator }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Operator !== undefined && input.Operator !== null && { Operator: input.Operator }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -16191,14 +16512,22 @@ const serializeAws_restJson1DashboardSearchFilterList = ( input: DashboardSearchFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DashboardSearchFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DashboardSearchFilter(entry, context); + }); }; const serializeAws_restJson1DashboardSourceEntity = (input: DashboardSourceEntity, context: __SerdeContext): any => { return { - ...(input.SourceTemplate !== undefined && { - SourceTemplate: serializeAws_restJson1DashboardSourceTemplate(input.SourceTemplate, context), - }), + ...(input.SourceTemplate !== undefined && + input.SourceTemplate !== null && { + SourceTemplate: serializeAws_restJson1DashboardSourceTemplate(input.SourceTemplate, context), + }), }; }; @@ -16207,40 +16536,53 @@ const serializeAws_restJson1DashboardSourceTemplate = ( context: __SerdeContext ): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.DataSetReferences !== undefined && { - DataSetReferences: serializeAws_restJson1DataSetReferenceList(input.DataSetReferences, context), - }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.DataSetReferences !== undefined && + input.DataSetReferences !== null && { + DataSetReferences: serializeAws_restJson1DataSetReferenceList(input.DataSetReferences, context), + }), }; }; const serializeAws_restJson1DataColorPalette = (input: DataColorPalette, context: __SerdeContext): any => { return { - ...(input.Colors !== undefined && { Colors: serializeAws_restJson1ColorList(input.Colors, context) }), - ...(input.EmptyFillColor !== undefined && { EmptyFillColor: input.EmptyFillColor }), - ...(input.MinMaxGradient !== undefined && { - MinMaxGradient: serializeAws_restJson1ColorList(input.MinMaxGradient, context), - }), + ...(input.Colors !== undefined && + input.Colors !== null && { Colors: serializeAws_restJson1ColorList(input.Colors, context) }), + ...(input.EmptyFillColor !== undefined && + input.EmptyFillColor !== null && { EmptyFillColor: input.EmptyFillColor }), + ...(input.MinMaxGradient !== undefined && + input.MinMaxGradient !== null && { + MinMaxGradient: serializeAws_restJson1ColorList(input.MinMaxGradient, context), + }), }; }; const serializeAws_restJson1DataSetReference = (input: DataSetReference, context: __SerdeContext): any => { return { - ...(input.DataSetArn !== undefined && { DataSetArn: input.DataSetArn }), - ...(input.DataSetPlaceholder !== undefined && { DataSetPlaceholder: input.DataSetPlaceholder }), + ...(input.DataSetArn !== undefined && input.DataSetArn !== null && { DataSetArn: input.DataSetArn }), + ...(input.DataSetPlaceholder !== undefined && + input.DataSetPlaceholder !== null && { DataSetPlaceholder: input.DataSetPlaceholder }), }; }; const serializeAws_restJson1DataSetReferenceList = (input: DataSetReference[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DataSetReference(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DataSetReference(entry, context); + }); }; const serializeAws_restJson1DataSourceCredentials = (input: DataSourceCredentials, context: __SerdeContext): any => { return { - ...(input.CopySourceArn !== undefined && { CopySourceArn: input.CopySourceArn }), - ...(input.CredentialPair !== undefined && { - CredentialPair: serializeAws_restJson1CredentialPair(input.CredentialPair, context), - }), + ...(input.CopySourceArn !== undefined && input.CopySourceArn !== null && { CopySourceArn: input.CopySourceArn }), + ...(input.CredentialPair !== undefined && + input.CredentialPair !== null && { + CredentialPair: serializeAws_restJson1CredentialPair(input.CredentialPair, context), + }), }; }; @@ -16288,131 +16630,192 @@ const serializeAws_restJson1DataSourceParametersList = ( input: DataSourceParameters[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DataSourceParameters(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DataSourceParameters(entry, context); + }); }; const serializeAws_restJson1DateTimeParameter = (input: DateTimeParameter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1TimestampList(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1TimestampList(input.Values, context) }), }; }; const serializeAws_restJson1DateTimeParameterList = (input: DateTimeParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DateTimeParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DateTimeParameter(entry, context); + }); }; const serializeAws_restJson1DecimalParameter = (input: DecimalParameter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1DoubleList(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1DoubleList(input.Values, context) }), }; }; const serializeAws_restJson1DecimalParameterList = (input: DecimalParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DecimalParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DecimalParameter(entry, context); + }); }; const serializeAws_restJson1DoubleList = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ExportToCSVOption = (input: ExportToCSVOption, context: __SerdeContext): any => { return { - ...(input.AvailabilityStatus !== undefined && { AvailabilityStatus: input.AvailabilityStatus }), + ...(input.AvailabilityStatus !== undefined && + input.AvailabilityStatus !== null && { AvailabilityStatus: input.AvailabilityStatus }), }; }; const serializeAws_restJson1FilterOperation = (input: FilterOperation, context: __SerdeContext): any => { return { - ...(input.ConditionExpression !== undefined && { ConditionExpression: input.ConditionExpression }), + ...(input.ConditionExpression !== undefined && + input.ConditionExpression !== null && { ConditionExpression: input.ConditionExpression }), }; }; const serializeAws_restJson1GeoSpatialColumnGroup = (input: GeoSpatialColumnGroup, context: __SerdeContext): any => { return { - ...(input.Columns !== undefined && { Columns: serializeAws_restJson1ColumnList(input.Columns, context) }), - ...(input.CountryCode !== undefined && { CountryCode: input.CountryCode }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Columns !== undefined && + input.Columns !== null && { Columns: serializeAws_restJson1ColumnList(input.Columns, context) }), + ...(input.CountryCode !== undefined && input.CountryCode !== null && { CountryCode: input.CountryCode }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_restJson1GutterStyle = (input: GutterStyle, context: __SerdeContext): any => { return { - ...(input.Show !== undefined && { Show: input.Show }), + ...(input.Show !== undefined && input.Show !== null && { Show: input.Show }), }; }; const serializeAws_restJson1IdentityMap = (input: { [key: string]: string[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1IdentityNameList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1IdentityNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1InputColumn = (input: InputColumn, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1InputColumnList = (input: InputColumn[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1InputColumn(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1InputColumn(entry, context); + }); }; const serializeAws_restJson1IntegerParameter = (input: IntegerParameter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1LongList(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1LongList(input.Values, context) }), }; }; const serializeAws_restJson1IntegerParameterList = (input: IntegerParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1IntegerParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1IntegerParameter(entry, context); + }); }; const serializeAws_restJson1JiraParameters = (input: JiraParameters, context: __SerdeContext): any => { return { - ...(input.SiteBaseUrl !== undefined && { SiteBaseUrl: input.SiteBaseUrl }), + ...(input.SiteBaseUrl !== undefined && input.SiteBaseUrl !== null && { SiteBaseUrl: input.SiteBaseUrl }), }; }; const serializeAws_restJson1JoinInstruction = (input: JoinInstruction, context: __SerdeContext): any => { return { - ...(input.LeftJoinKeyProperties !== undefined && { - LeftJoinKeyProperties: serializeAws_restJson1JoinKeyProperties(input.LeftJoinKeyProperties, context), - }), - ...(input.LeftOperand !== undefined && { LeftOperand: input.LeftOperand }), - ...(input.OnClause !== undefined && { OnClause: input.OnClause }), - ...(input.RightJoinKeyProperties !== undefined && { - RightJoinKeyProperties: serializeAws_restJson1JoinKeyProperties(input.RightJoinKeyProperties, context), - }), - ...(input.RightOperand !== undefined && { RightOperand: input.RightOperand }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.LeftJoinKeyProperties !== undefined && + input.LeftJoinKeyProperties !== null && { + LeftJoinKeyProperties: serializeAws_restJson1JoinKeyProperties(input.LeftJoinKeyProperties, context), + }), + ...(input.LeftOperand !== undefined && input.LeftOperand !== null && { LeftOperand: input.LeftOperand }), + ...(input.OnClause !== undefined && input.OnClause !== null && { OnClause: input.OnClause }), + ...(input.RightJoinKeyProperties !== undefined && + input.RightJoinKeyProperties !== null && { + RightJoinKeyProperties: serializeAws_restJson1JoinKeyProperties(input.RightJoinKeyProperties, context), + }), + ...(input.RightOperand !== undefined && input.RightOperand !== null && { RightOperand: input.RightOperand }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1JoinKeyProperties = (input: JoinKeyProperties, context: __SerdeContext): any => { return { - ...(input.UniqueKey !== undefined && { UniqueKey: input.UniqueKey }), + ...(input.UniqueKey !== undefined && input.UniqueKey !== null && { UniqueKey: input.UniqueKey }), }; }; const serializeAws_restJson1LogicalTable = (input: LogicalTable, context: __SerdeContext): any => { return { - ...(input.Alias !== undefined && { Alias: input.Alias }), - ...(input.DataTransforms !== undefined && { - DataTransforms: serializeAws_restJson1TransformOperationList(input.DataTransforms, context), - }), - ...(input.Source !== undefined && { Source: serializeAws_restJson1LogicalTableSource(input.Source, context) }), + ...(input.Alias !== undefined && input.Alias !== null && { Alias: input.Alias }), + ...(input.DataTransforms !== undefined && + input.DataTransforms !== null && { + DataTransforms: serializeAws_restJson1TransformOperationList(input.DataTransforms, context), + }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_restJson1LogicalTableSource(input.Source, context) }), }; }; @@ -16420,79 +16823,94 @@ const serializeAws_restJson1LogicalTableMap = ( input: { [key: string]: LogicalTable }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: LogicalTable }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: LogicalTable }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1LogicalTable(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1LogicalTableSource = (input: LogicalTableSource, context: __SerdeContext): any => { return { - ...(input.JoinInstruction !== undefined && { - JoinInstruction: serializeAws_restJson1JoinInstruction(input.JoinInstruction, context), - }), - ...(input.PhysicalTableId !== undefined && { PhysicalTableId: input.PhysicalTableId }), + ...(input.JoinInstruction !== undefined && + input.JoinInstruction !== null && { + JoinInstruction: serializeAws_restJson1JoinInstruction(input.JoinInstruction, context), + }), + ...(input.PhysicalTableId !== undefined && + input.PhysicalTableId !== null && { PhysicalTableId: input.PhysicalTableId }), }; }; const serializeAws_restJson1LongList = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ManifestFileLocation = (input: ManifestFileLocation, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), }; }; const serializeAws_restJson1MarginStyle = (input: MarginStyle, context: __SerdeContext): any => { return { - ...(input.Show !== undefined && { Show: input.Show }), + ...(input.Show !== undefined && input.Show !== null && { Show: input.Show }), }; }; const serializeAws_restJson1MariaDbParameters = (input: MariaDbParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_restJson1MySqlParameters = (input: MySqlParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_restJson1OracleParameters = (input: OracleParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_restJson1_Parameters = (input: _Parameters, context: __SerdeContext): any => { return { - ...(input.DateTimeParameters !== undefined && { - DateTimeParameters: serializeAws_restJson1DateTimeParameterList(input.DateTimeParameters, context), - }), - ...(input.DecimalParameters !== undefined && { - DecimalParameters: serializeAws_restJson1DecimalParameterList(input.DecimalParameters, context), - }), - ...(input.IntegerParameters !== undefined && { - IntegerParameters: serializeAws_restJson1IntegerParameterList(input.IntegerParameters, context), - }), - ...(input.StringParameters !== undefined && { - StringParameters: serializeAws_restJson1StringParameterList(input.StringParameters, context), - }), + ...(input.DateTimeParameters !== undefined && + input.DateTimeParameters !== null && { + DateTimeParameters: serializeAws_restJson1DateTimeParameterList(input.DateTimeParameters, context), + }), + ...(input.DecimalParameters !== undefined && + input.DecimalParameters !== null && { + DecimalParameters: serializeAws_restJson1DecimalParameterList(input.DecimalParameters, context), + }), + ...(input.IntegerParameters !== undefined && + input.IntegerParameters !== null && { + IntegerParameters: serializeAws_restJson1IntegerParameterList(input.IntegerParameters, context), + }), + ...(input.StringParameters !== undefined && + input.StringParameters !== null && { + StringParameters: serializeAws_restJson1StringParameterList(input.StringParameters, context), + }), }; }; @@ -16509,90 +16927,116 @@ const serializeAws_restJson1PhysicalTableMap = ( input: { [key: string]: PhysicalTable }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: PhysicalTable }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: PhysicalTable }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_restJson1PhysicalTable(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1PostgreSqlParameters = (input: PostgreSqlParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_restJson1PrestoParameters = (input: PrestoParameters, context: __SerdeContext): any => { return { - ...(input.Catalog !== undefined && { Catalog: input.Catalog }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Catalog !== undefined && input.Catalog !== null && { Catalog: input.Catalog }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_restJson1PrincipalList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ProjectedColumnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ProjectOperation = (input: ProjectOperation, context: __SerdeContext): any => { return { - ...(input.ProjectedColumns !== undefined && { - ProjectedColumns: serializeAws_restJson1ProjectedColumnList(input.ProjectedColumns, context), - }), + ...(input.ProjectedColumns !== undefined && + input.ProjectedColumns !== null && { + ProjectedColumns: serializeAws_restJson1ProjectedColumnList(input.ProjectedColumns, context), + }), }; }; const serializeAws_restJson1RdsParameters = (input: RdsParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; const serializeAws_restJson1RedshiftParameters = (input: RedshiftParameters, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_restJson1RelationalTable = (input: RelationalTable, context: __SerdeContext): any => { return { - ...(input.DataSourceArn !== undefined && { DataSourceArn: input.DataSourceArn }), - ...(input.InputColumns !== undefined && { - InputColumns: serializeAws_restJson1InputColumnList(input.InputColumns, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Schema !== undefined && { Schema: input.Schema }), + ...(input.DataSourceArn !== undefined && input.DataSourceArn !== null && { DataSourceArn: input.DataSourceArn }), + ...(input.InputColumns !== undefined && + input.InputColumns !== null && { + InputColumns: serializeAws_restJson1InputColumnList(input.InputColumns, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Schema !== undefined && input.Schema !== null && { Schema: input.Schema }), }; }; const serializeAws_restJson1RenameColumnOperation = (input: RenameColumnOperation, context: __SerdeContext): any => { return { - ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), - ...(input.NewColumnName !== undefined && { NewColumnName: input.NewColumnName }), + ...(input.ColumnName !== undefined && input.ColumnName !== null && { ColumnName: input.ColumnName }), + ...(input.NewColumnName !== undefined && input.NewColumnName !== null && { NewColumnName: input.NewColumnName }), }; }; const serializeAws_restJson1ResourcePermission = (input: ResourcePermission, context: __SerdeContext): any => { return { - ...(input.Actions !== undefined && { Actions: serializeAws_restJson1ActionList(input.Actions, context) }), - ...(input.Principal !== undefined && { Principal: input.Principal }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_restJson1ActionList(input.Actions, context) }), + ...(input.Principal !== undefined && input.Principal !== null && { Principal: input.Principal }), }; }; const serializeAws_restJson1ResourcePermissionList = (input: ResourcePermission[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ResourcePermission(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ResourcePermission(entry, context); + }); }; const serializeAws_restJson1RowLevelPermissionDataSet = ( @@ -16600,176 +17044,220 @@ const serializeAws_restJson1RowLevelPermissionDataSet = ( context: __SerdeContext ): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.Namespace !== undefined && { Namespace: input.Namespace }), - ...(input.PermissionPolicy !== undefined && { PermissionPolicy: input.PermissionPolicy }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.Namespace !== undefined && input.Namespace !== null && { Namespace: input.Namespace }), + ...(input.PermissionPolicy !== undefined && + input.PermissionPolicy !== null && { PermissionPolicy: input.PermissionPolicy }), }; }; const serializeAws_restJson1S3Parameters = (input: S3Parameters, context: __SerdeContext): any => { return { - ...(input.ManifestFileLocation !== undefined && { - ManifestFileLocation: serializeAws_restJson1ManifestFileLocation(input.ManifestFileLocation, context), - }), + ...(input.ManifestFileLocation !== undefined && + input.ManifestFileLocation !== null && { + ManifestFileLocation: serializeAws_restJson1ManifestFileLocation(input.ManifestFileLocation, context), + }), }; }; const serializeAws_restJson1S3Source = (input: S3Source, context: __SerdeContext): any => { return { - ...(input.DataSourceArn !== undefined && { DataSourceArn: input.DataSourceArn }), - ...(input.InputColumns !== undefined && { - InputColumns: serializeAws_restJson1InputColumnList(input.InputColumns, context), - }), - ...(input.UploadSettings !== undefined && { - UploadSettings: serializeAws_restJson1UploadSettings(input.UploadSettings, context), - }), + ...(input.DataSourceArn !== undefined && input.DataSourceArn !== null && { DataSourceArn: input.DataSourceArn }), + ...(input.InputColumns !== undefined && + input.InputColumns !== null && { + InputColumns: serializeAws_restJson1InputColumnList(input.InputColumns, context), + }), + ...(input.UploadSettings !== undefined && + input.UploadSettings !== null && { + UploadSettings: serializeAws_restJson1UploadSettings(input.UploadSettings, context), + }), }; }; const serializeAws_restJson1ServiceNowParameters = (input: ServiceNowParameters, context: __SerdeContext): any => { return { - ...(input.SiteBaseUrl !== undefined && { SiteBaseUrl: input.SiteBaseUrl }), + ...(input.SiteBaseUrl !== undefined && input.SiteBaseUrl !== null && { SiteBaseUrl: input.SiteBaseUrl }), }; }; const serializeAws_restJson1SheetControlsOption = (input: SheetControlsOption, context: __SerdeContext): any => { return { - ...(input.VisibilityState !== undefined && { VisibilityState: input.VisibilityState }), + ...(input.VisibilityState !== undefined && + input.VisibilityState !== null && { VisibilityState: input.VisibilityState }), }; }; const serializeAws_restJson1SheetStyle = (input: SheetStyle, context: __SerdeContext): any => { return { - ...(input.Tile !== undefined && { Tile: serializeAws_restJson1TileStyle(input.Tile, context) }), - ...(input.TileLayout !== undefined && { - TileLayout: serializeAws_restJson1TileLayoutStyle(input.TileLayout, context), - }), + ...(input.Tile !== undefined && + input.Tile !== null && { Tile: serializeAws_restJson1TileStyle(input.Tile, context) }), + ...(input.TileLayout !== undefined && + input.TileLayout !== null && { TileLayout: serializeAws_restJson1TileLayoutStyle(input.TileLayout, context) }), }; }; const serializeAws_restJson1SnowflakeParameters = (input: SnowflakeParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Warehouse !== undefined && { Warehouse: input.Warehouse }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Warehouse !== undefined && input.Warehouse !== null && { Warehouse: input.Warehouse }), }; }; const serializeAws_restJson1SparkParameters = (input: SparkParameters, context: __SerdeContext): any => { return { - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_restJson1SqlServerParameters = (input: SqlServerParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_restJson1SslProperties = (input: SslProperties, context: __SerdeContext): any => { return { - ...(input.DisableSsl !== undefined && { DisableSsl: input.DisableSsl }), + ...(input.DisableSsl !== undefined && input.DisableSsl !== null && { DisableSsl: input.DisableSsl }), }; }; const serializeAws_restJson1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1StringParameter = (input: StringParameter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1StringList(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1StringList(input.Values, context) }), }; }; const serializeAws_restJson1StringParameterList = (input: StringParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1StringParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1StringParameter(entry, context); + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagColumnOperation = (input: TagColumnOperation, context: __SerdeContext): any => { return { - ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1ColumnTagList(input.Tags, context) }), + ...(input.ColumnName !== undefined && input.ColumnName !== null && { ColumnName: input.ColumnName }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1ColumnTagList(input.Tags, context) }), }; }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TemplateSourceAnalysis = (input: TemplateSourceAnalysis, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.DataSetReferences !== undefined && { - DataSetReferences: serializeAws_restJson1DataSetReferenceList(input.DataSetReferences, context), - }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.DataSetReferences !== undefined && + input.DataSetReferences !== null && { + DataSetReferences: serializeAws_restJson1DataSetReferenceList(input.DataSetReferences, context), + }), }; }; const serializeAws_restJson1TemplateSourceEntity = (input: TemplateSourceEntity, context: __SerdeContext): any => { return { - ...(input.SourceAnalysis !== undefined && { - SourceAnalysis: serializeAws_restJson1TemplateSourceAnalysis(input.SourceAnalysis, context), - }), - ...(input.SourceTemplate !== undefined && { - SourceTemplate: serializeAws_restJson1TemplateSourceTemplate(input.SourceTemplate, context), - }), + ...(input.SourceAnalysis !== undefined && + input.SourceAnalysis !== null && { + SourceAnalysis: serializeAws_restJson1TemplateSourceAnalysis(input.SourceAnalysis, context), + }), + ...(input.SourceTemplate !== undefined && + input.SourceTemplate !== null && { + SourceTemplate: serializeAws_restJson1TemplateSourceTemplate(input.SourceTemplate, context), + }), }; }; const serializeAws_restJson1TemplateSourceTemplate = (input: TemplateSourceTemplate, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }; }; const serializeAws_restJson1TeradataParameters = (input: TeradataParameters, context: __SerdeContext): any => { return { - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_restJson1ThemeConfiguration = (input: ThemeConfiguration, context: __SerdeContext): any => { return { - ...(input.DataColorPalette !== undefined && { - DataColorPalette: serializeAws_restJson1DataColorPalette(input.DataColorPalette, context), - }), - ...(input.Sheet !== undefined && { Sheet: serializeAws_restJson1SheetStyle(input.Sheet, context) }), - ...(input.UIColorPalette !== undefined && { - UIColorPalette: serializeAws_restJson1UIColorPalette(input.UIColorPalette, context), - }), + ...(input.DataColorPalette !== undefined && + input.DataColorPalette !== null && { + DataColorPalette: serializeAws_restJson1DataColorPalette(input.DataColorPalette, context), + }), + ...(input.Sheet !== undefined && + input.Sheet !== null && { Sheet: serializeAws_restJson1SheetStyle(input.Sheet, context) }), + ...(input.UIColorPalette !== undefined && + input.UIColorPalette !== null && { + UIColorPalette: serializeAws_restJson1UIColorPalette(input.UIColorPalette, context), + }), }; }; const serializeAws_restJson1TileLayoutStyle = (input: TileLayoutStyle, context: __SerdeContext): any => { return { - ...(input.Gutter !== undefined && { Gutter: serializeAws_restJson1GutterStyle(input.Gutter, context) }), - ...(input.Margin !== undefined && { Margin: serializeAws_restJson1MarginStyle(input.Margin, context) }), + ...(input.Gutter !== undefined && + input.Gutter !== null && { Gutter: serializeAws_restJson1GutterStyle(input.Gutter, context) }), + ...(input.Margin !== undefined && + input.Margin !== null && { Margin: serializeAws_restJson1MarginStyle(input.Margin, context) }), }; }; const serializeAws_restJson1TileStyle = (input: TileStyle, context: __SerdeContext): any => { return { - ...(input.Border !== undefined && { Border: serializeAws_restJson1BorderStyle(input.Border, context) }), + ...(input.Border !== undefined && + input.Border !== null && { Border: serializeAws_restJson1BorderStyle(input.Border, context) }), }; }; const serializeAws_restJson1TimestampList = (input: Date[], context: __SerdeContext): any => { - return input.map((entry) => Math.round(entry.getTime() / 1000)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return Math.round(entry.getTime() / 1000); + }); }; const serializeAws_restJson1TransformOperation = (input: TransformOperation, context: __SerdeContext): any => { @@ -16791,34 +17279,51 @@ const serializeAws_restJson1TransformOperation = (input: TransformOperation, con }; const serializeAws_restJson1TransformOperationList = (input: TransformOperation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1TransformOperation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TransformOperation(entry, context); + }); }; const serializeAws_restJson1TwitterParameters = (input: TwitterParameters, context: __SerdeContext): any => { return { - ...(input.MaxRows !== undefined && { MaxRows: input.MaxRows }), - ...(input.Query !== undefined && { Query: input.Query }), + ...(input.MaxRows !== undefined && input.MaxRows !== null && { MaxRows: input.MaxRows }), + ...(input.Query !== undefined && input.Query !== null && { Query: input.Query }), }; }; const serializeAws_restJson1UIColorPalette = (input: UIColorPalette, context: __SerdeContext): any => { return { - ...(input.Accent !== undefined && { Accent: input.Accent }), - ...(input.AccentForeground !== undefined && { AccentForeground: input.AccentForeground }), - ...(input.Danger !== undefined && { Danger: input.Danger }), - ...(input.DangerForeground !== undefined && { DangerForeground: input.DangerForeground }), - ...(input.Dimension !== undefined && { Dimension: input.Dimension }), - ...(input.DimensionForeground !== undefined && { DimensionForeground: input.DimensionForeground }), - ...(input.Measure !== undefined && { Measure: input.Measure }), - ...(input.MeasureForeground !== undefined && { MeasureForeground: input.MeasureForeground }), - ...(input.PrimaryBackground !== undefined && { PrimaryBackground: input.PrimaryBackground }), - ...(input.PrimaryForeground !== undefined && { PrimaryForeground: input.PrimaryForeground }), - ...(input.SecondaryBackground !== undefined && { SecondaryBackground: input.SecondaryBackground }), - ...(input.SecondaryForeground !== undefined && { SecondaryForeground: input.SecondaryForeground }), - ...(input.Success !== undefined && { Success: input.Success }), - ...(input.SuccessForeground !== undefined && { SuccessForeground: input.SuccessForeground }), - ...(input.Warning !== undefined && { Warning: input.Warning }), - ...(input.WarningForeground !== undefined && { WarningForeground: input.WarningForeground }), + ...(input.Accent !== undefined && input.Accent !== null && { Accent: input.Accent }), + ...(input.AccentForeground !== undefined && + input.AccentForeground !== null && { AccentForeground: input.AccentForeground }), + ...(input.Danger !== undefined && input.Danger !== null && { Danger: input.Danger }), + ...(input.DangerForeground !== undefined && + input.DangerForeground !== null && { DangerForeground: input.DangerForeground }), + ...(input.Dimension !== undefined && input.Dimension !== null && { Dimension: input.Dimension }), + ...(input.DimensionForeground !== undefined && + input.DimensionForeground !== null && { DimensionForeground: input.DimensionForeground }), + ...(input.Measure !== undefined && input.Measure !== null && { Measure: input.Measure }), + ...(input.MeasureForeground !== undefined && + input.MeasureForeground !== null && { MeasureForeground: input.MeasureForeground }), + ...(input.PrimaryBackground !== undefined && + input.PrimaryBackground !== null && { PrimaryBackground: input.PrimaryBackground }), + ...(input.PrimaryForeground !== undefined && + input.PrimaryForeground !== null && { PrimaryForeground: input.PrimaryForeground }), + ...(input.SecondaryBackground !== undefined && + input.SecondaryBackground !== null && { SecondaryBackground: input.SecondaryBackground }), + ...(input.SecondaryForeground !== undefined && + input.SecondaryForeground !== null && { SecondaryForeground: input.SecondaryForeground }), + ...(input.Success !== undefined && input.Success !== null && { Success: input.Success }), + ...(input.SuccessForeground !== undefined && + input.SuccessForeground !== null && { SuccessForeground: input.SuccessForeground }), + ...(input.Warning !== undefined && input.Warning !== null && { Warning: input.Warning }), + ...(input.WarningForeground !== undefined && + input.WarningForeground !== null && { WarningForeground: input.WarningForeground }), }; }; @@ -16826,16 +17331,24 @@ const serializeAws_restJson1UpdateResourcePermissionList = ( input: ResourcePermission[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ResourcePermission(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ResourcePermission(entry, context); + }); }; const serializeAws_restJson1UploadSettings = (input: UploadSettings, context: __SerdeContext): any => { return { - ...(input.ContainsHeader !== undefined && { ContainsHeader: input.ContainsHeader }), - ...(input.Delimiter !== undefined && { Delimiter: input.Delimiter }), - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.StartFromRow !== undefined && { StartFromRow: input.StartFromRow }), - ...(input.TextQualifier !== undefined && { TextQualifier: input.TextQualifier }), + ...(input.ContainsHeader !== undefined && + input.ContainsHeader !== null && { ContainsHeader: input.ContainsHeader }), + ...(input.Delimiter !== undefined && input.Delimiter !== null && { Delimiter: input.Delimiter }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.StartFromRow !== undefined && input.StartFromRow !== null && { StartFromRow: input.StartFromRow }), + ...(input.TextQualifier !== undefined && input.TextQualifier !== null && { TextQualifier: input.TextQualifier }), }; }; @@ -16844,7 +17357,8 @@ const serializeAws_restJson1VpcConnectionProperties = ( context: __SerdeContext ): any => { return { - ...(input.VpcConnectionArn !== undefined && { VpcConnectionArn: input.VpcConnectionArn }), + ...(input.VpcConnectionArn !== undefined && + input.VpcConnectionArn !== null && { VpcConnectionArn: input.VpcConnectionArn }), }; }; @@ -16868,7 +17382,14 @@ const deserializeAws_restJson1AccountSettings = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ActionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ActiveIAMPolicyAssignment = ( @@ -16886,7 +17407,14 @@ const deserializeAws_restJson1ActiveIAMPolicyAssignmentList = ( output: any, context: __SerdeContext ): ActiveIAMPolicyAssignment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ActiveIAMPolicyAssignment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ActiveIAMPolicyAssignment(entry, context); + }); }; const deserializeAws_restJson1AmazonElasticsearchParameters = ( @@ -16936,7 +17464,14 @@ const deserializeAws_restJson1AnalysisError = (output: any, context: __SerdeCont }; const deserializeAws_restJson1AnalysisErrorList = (output: any, context: __SerdeContext): AnalysisError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AnalysisError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AnalysisError(entry, context); + }); }; const deserializeAws_restJson1AnalysisSummary = (output: any, context: __SerdeContext): AnalysisSummary => { @@ -16957,7 +17492,14 @@ const deserializeAws_restJson1AnalysisSummary = (output: any, context: __SerdeCo }; const deserializeAws_restJson1AnalysisSummaryList = (output: any, context: __SerdeContext): AnalysisSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AnalysisSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AnalysisSummary(entry, context); + }); }; const deserializeAws_restJson1AthenaParameters = (output: any, context: __SerdeContext): AthenaParameters => { @@ -17009,7 +17551,14 @@ const deserializeAws_restJson1CalculatedColumn = (output: any, context: __SerdeC }; const deserializeAws_restJson1CalculatedColumnList = (output: any, context: __SerdeContext): CalculatedColumn[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CalculatedColumn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CalculatedColumn(entry, context); + }); }; const deserializeAws_restJson1CastColumnTypeOperation = ( @@ -17025,7 +17574,14 @@ const deserializeAws_restJson1CastColumnTypeOperation = ( }; const deserializeAws_restJson1ColorList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ColumnDescription = (output: any, context: __SerdeContext): ColumnDescription => { @@ -17056,11 +17612,25 @@ const deserializeAws_restJson1ColumnGroupColumnSchemaList = ( output: any, context: __SerdeContext ): ColumnGroupColumnSchema[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ColumnGroupColumnSchema(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ColumnGroupColumnSchema(entry, context); + }); }; const deserializeAws_restJson1ColumnGroupList = (output: any, context: __SerdeContext): ColumnGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ColumnGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ColumnGroup(entry, context); + }); }; const deserializeAws_restJson1ColumnGroupSchema = (output: any, context: __SerdeContext): ColumnGroupSchema => { @@ -17074,7 +17644,14 @@ const deserializeAws_restJson1ColumnGroupSchema = (output: any, context: __Serde }; const deserializeAws_restJson1ColumnGroupSchemaList = (output: any, context: __SerdeContext): ColumnGroupSchema[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ColumnGroupSchema(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ColumnGroupSchema(entry, context); + }); }; const deserializeAws_restJson1ColumnLevelPermissionRule = ( @@ -17097,15 +17674,36 @@ const deserializeAws_restJson1ColumnLevelPermissionRuleList = ( output: any, context: __SerdeContext ): ColumnLevelPermissionRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ColumnLevelPermissionRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ColumnLevelPermissionRule(entry, context); + }); }; const deserializeAws_restJson1ColumnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ColumnNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ColumnSchema = (output: any, context: __SerdeContext): ColumnSchema => { @@ -17118,7 +17716,14 @@ const deserializeAws_restJson1ColumnSchema = (output: any, context: __SerdeConte }; const deserializeAws_restJson1ColumnSchemaList = (output: any, context: __SerdeContext): ColumnSchema[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ColumnSchema(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ColumnSchema(entry, context); + }); }; const deserializeAws_restJson1ColumnTag = (output: any, context: __SerdeContext): ColumnTag => { @@ -17135,7 +17740,14 @@ const deserializeAws_restJson1ColumnTag = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1ColumnTagList = (output: any, context: __SerdeContext): ColumnTag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ColumnTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ColumnTag(entry, context); + }); }; const deserializeAws_restJson1CreateColumnsOperation = ( @@ -17195,7 +17807,14 @@ const deserializeAws_restJson1DashboardError = (output: any, context: __SerdeCon }; const deserializeAws_restJson1DashboardErrorList = (output: any, context: __SerdeContext): DashboardError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DashboardError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DashboardError(entry, context); + }); }; const deserializeAws_restJson1DashboardSummary = (output: any, context: __SerdeContext): DashboardSummary => { @@ -17223,7 +17842,14 @@ const deserializeAws_restJson1DashboardSummary = (output: any, context: __SerdeC }; const deserializeAws_restJson1DashboardSummaryList = (output: any, context: __SerdeContext): DashboardSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DashboardSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DashboardSummary(entry, context); + }); }; const deserializeAws_restJson1DashboardVersion = (output: any, context: __SerdeContext): DashboardVersion => { @@ -17278,7 +17904,14 @@ const deserializeAws_restJson1DashboardVersionSummaryList = ( output: any, context: __SerdeContext ): DashboardVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DashboardVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DashboardVersionSummary(entry, context); + }); }; const deserializeAws_restJson1DataColorPalette = (output: any, context: __SerdeContext): DataColorPalette => { @@ -17342,7 +17975,14 @@ const deserializeAws_restJson1DataSet = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1DataSetArnsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DataSetConfiguration = (output: any, context: __SerdeContext): DataSetConfiguration => { @@ -17363,7 +18003,14 @@ const deserializeAws_restJson1DataSetConfigurationList = ( output: any, context: __SerdeContext ): DataSetConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataSetConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataSetConfiguration(entry, context); + }); }; const deserializeAws_restJson1DataSetSchema = (output: any, context: __SerdeContext): DataSetSchema => { @@ -17401,7 +18048,14 @@ const deserializeAws_restJson1DataSetSummary = (output: any, context: __SerdeCon }; const deserializeAws_restJson1DataSetSummaryList = (output: any, context: __SerdeContext): DataSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataSetSummary(entry, context); + }); }; const deserializeAws_restJson1DataSource = (output: any, context: __SerdeContext): DataSource => { @@ -17450,7 +18104,14 @@ const deserializeAws_restJson1DataSourceErrorInfo = (output: any, context: __Ser }; const deserializeAws_restJson1DataSourceList = (output: any, context: __SerdeContext): DataSource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataSource(entry, context); + }); }; const deserializeAws_restJson1DataSourceParameters = (output: any, context: __SerdeContext): DataSourceParameters => { @@ -17570,7 +18231,14 @@ const deserializeAws_restJson1DataSourceParametersList = ( output: any, context: __SerdeContext ): DataSourceParameters[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataSourceParameters(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataSourceParameters(entry, context); + }); }; const deserializeAws_restJson1ErrorInfo = (output: any, context: __SerdeContext): ErrorInfo => { @@ -17610,7 +18278,14 @@ const deserializeAws_restJson1Group = (output: any, context: __SerdeContext): Gr }; const deserializeAws_restJson1GroupList = (output: any, context: __SerdeContext): Group[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Group(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Group(entry, context); + }); }; const deserializeAws_restJson1GroupMember = (output: any, context: __SerdeContext): GroupMember => { @@ -17621,7 +18296,14 @@ const deserializeAws_restJson1GroupMember = (output: any, context: __SerdeContex }; const deserializeAws_restJson1GroupMemberList = (output: any, context: __SerdeContext): GroupMember[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupMember(entry, context); + }); }; const deserializeAws_restJson1GutterStyle = (output: any, context: __SerdeContext): GutterStyle => { @@ -17662,21 +18344,37 @@ const deserializeAws_restJson1IAMPolicyAssignmentSummaryList = ( output: any, context: __SerdeContext ): IAMPolicyAssignmentSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IAMPolicyAssignmentSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IAMPolicyAssignmentSummary(entry, context); + }); }; const deserializeAws_restJson1IdentityMap = (output: any, context: __SerdeContext): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1IdentityNameList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1IdentityNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Ingestion = (output: any, context: __SerdeContext): Ingestion => { @@ -17716,7 +18414,14 @@ const deserializeAws_restJson1Ingestion = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1Ingestions = (output: any, context: __SerdeContext): Ingestion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Ingestion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Ingestion(entry, context); + }); }; const deserializeAws_restJson1InputColumn = (output: any, context: __SerdeContext): InputColumn => { @@ -17727,7 +18432,14 @@ const deserializeAws_restJson1InputColumn = (output: any, context: __SerdeContex }; const deserializeAws_restJson1InputColumnList = (output: any, context: __SerdeContext): InputColumn[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InputColumn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InputColumn(entry, context); + }); }; const deserializeAws_restJson1JiraParameters = (output: any, context: __SerdeContext): JiraParameters => { @@ -17777,13 +18489,15 @@ const deserializeAws_restJson1LogicalTableMap = ( output: any, context: __SerdeContext ): { [key: string]: LogicalTable } => { - return Object.entries(output).reduce( - (acc: { [key: string]: LogicalTable }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: LogicalTable }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1LogicalTable(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1LogicalTableSource = (output: any, context: __SerdeContext): LogicalTableSource => { @@ -17851,7 +18565,14 @@ const deserializeAws_restJson1NamespaceInfoV2 = (output: any, context: __SerdeCo }; const deserializeAws_restJson1Namespaces = (output: any, context: __SerdeContext): NamespaceInfoV2[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NamespaceInfoV2(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NamespaceInfoV2(entry, context); + }); }; const deserializeAws_restJson1OracleParameters = (output: any, context: __SerdeContext): OracleParameters => { @@ -17871,7 +18592,14 @@ const deserializeAws_restJson1OutputColumn = (output: any, context: __SerdeConte }; const deserializeAws_restJson1OutputColumnList = (output: any, context: __SerdeContext): OutputColumn[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1OutputColumn(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1OutputColumn(entry, context); + }); }; const deserializeAws_restJson1PhysicalTable = (output: any, context: __SerdeContext): PhysicalTable => { @@ -17897,13 +18625,15 @@ const deserializeAws_restJson1PhysicalTableMap = ( output: any, context: __SerdeContext ): { [key: string]: PhysicalTable } => { - return Object.entries(output).reduce( - (acc: { [key: string]: PhysicalTable }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: PhysicalTable }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1PhysicalTable(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1PostgreSqlParameters = (output: any, context: __SerdeContext): PostgreSqlParameters => { @@ -17923,11 +18653,25 @@ const deserializeAws_restJson1PrestoParameters = (output: any, context: __SerdeC }; const deserializeAws_restJson1PrincipalList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ProjectedColumnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ProjectOperation = (output: any, context: __SerdeContext): ProjectOperation => { @@ -17998,7 +18742,14 @@ const deserializeAws_restJson1ResourcePermission = (output: any, context: __Serd }; const deserializeAws_restJson1ResourcePermissionList = (output: any, context: __SerdeContext): ResourcePermission[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourcePermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourcePermission(entry, context); + }); }; const deserializeAws_restJson1RowInfo = (output: any, context: __SerdeContext): RowInfo => { @@ -18058,7 +18809,14 @@ const deserializeAws_restJson1Sheet = (output: any, context: __SerdeContext): Sh }; const deserializeAws_restJson1SheetList = (output: any, context: __SerdeContext): Sheet[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Sheet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Sheet(entry, context); + }); }; const deserializeAws_restJson1SheetStyle = (output: any, context: __SerdeContext): SheetStyle => { @@ -18121,7 +18879,14 @@ const deserializeAws_restJson1TagColumnOperation = (output: any, context: __Serd }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1Template = (output: any, context: __SerdeContext): Template => { @@ -18156,7 +18921,14 @@ const deserializeAws_restJson1TemplateAlias = (output: any, context: __SerdeCont }; const deserializeAws_restJson1TemplateAliasList = (output: any, context: __SerdeContext): TemplateAlias[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TemplateAlias(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TemplateAlias(entry, context); + }); }; const deserializeAws_restJson1TemplateError = (output: any, context: __SerdeContext): TemplateError => { @@ -18167,7 +18939,14 @@ const deserializeAws_restJson1TemplateError = (output: any, context: __SerdeCont }; const deserializeAws_restJson1TemplateErrorList = (output: any, context: __SerdeContext): TemplateError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TemplateError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TemplateError(entry, context); + }); }; const deserializeAws_restJson1TemplateSummary = (output: any, context: __SerdeContext): TemplateSummary => { @@ -18191,7 +18970,14 @@ const deserializeAws_restJson1TemplateSummary = (output: any, context: __SerdeCo }; const deserializeAws_restJson1TemplateSummaryList = (output: any, context: __SerdeContext): TemplateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TemplateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TemplateSummary(entry, context); + }); }; const deserializeAws_restJson1TemplateVersion = (output: any, context: __SerdeContext): TemplateVersion => { @@ -18243,7 +19029,14 @@ const deserializeAws_restJson1TemplateVersionSummaryList = ( output: any, context: __SerdeContext ): TemplateVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TemplateVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TemplateVersionSummary(entry, context); + }); }; const deserializeAws_restJson1TeradataParameters = (output: any, context: __SerdeContext): TeradataParameters => { @@ -18287,7 +19080,14 @@ const deserializeAws_restJson1ThemeAlias = (output: any, context: __SerdeContext }; const deserializeAws_restJson1ThemeAliasList = (output: any, context: __SerdeContext): ThemeAlias[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThemeAlias(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThemeAlias(entry, context); + }); }; const deserializeAws_restJson1ThemeConfiguration = (output: any, context: __SerdeContext): ThemeConfiguration => { @@ -18315,7 +19115,14 @@ const deserializeAws_restJson1ThemeError = (output: any, context: __SerdeContext }; const deserializeAws_restJson1ThemeErrorList = (output: any, context: __SerdeContext): ThemeError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThemeError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThemeError(entry, context); + }); }; const deserializeAws_restJson1ThemeSummary = (output: any, context: __SerdeContext): ThemeSummary => { @@ -18339,7 +19146,14 @@ const deserializeAws_restJson1ThemeSummary = (output: any, context: __SerdeConte }; const deserializeAws_restJson1ThemeSummaryList = (output: any, context: __SerdeContext): ThemeSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThemeSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThemeSummary(entry, context); + }); }; const deserializeAws_restJson1ThemeVersion = (output: any, context: __SerdeContext): ThemeVersion => { @@ -18383,7 +19197,14 @@ const deserializeAws_restJson1ThemeVersionSummaryList = ( output: any, context: __SerdeContext ): ThemeVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThemeVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThemeVersionSummary(entry, context); + }); }; const deserializeAws_restJson1TileLayoutStyle = (output: any, context: __SerdeContext): TileLayoutStyle => { @@ -18443,7 +19264,14 @@ const deserializeAws_restJson1TransformOperation = (output: any, context: __Serd }; const deserializeAws_restJson1TransformOperationList = (output: any, context: __SerdeContext): TransformOperation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TransformOperation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TransformOperation(entry, context); + }); }; const deserializeAws_restJson1TwitterParameters = (output: any, context: __SerdeContext): TwitterParameters => { @@ -18529,7 +19357,14 @@ const deserializeAws_restJson1User = (output: any, context: __SerdeContext): Use }; const deserializeAws_restJson1UserList = (output: any, context: __SerdeContext): User[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1User(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1User(entry, context); + }); }; const deserializeAws_restJson1VpcConnectionProperties = ( @@ -18562,6 +19397,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-ram/protocols/Aws_restJson1.ts b/clients/client-ram/protocols/Aws_restJson1.ts index 479b5591e287..906545b39f1f 100644 --- a/clients/client-ram/protocols/Aws_restJson1.ts +++ b/clients/client-ram/protocols/Aws_restJson1.ts @@ -120,15 +120,14 @@ export const serializeAws_restJson1AcceptResourceShareInvitationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/acceptresourceshareinvitation"; let body: any; body = JSON.stringify({ - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.resourceShareInvitationArn !== undefined && { - resourceShareInvitationArn: input.resourceShareInvitationArn, - }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.resourceShareInvitationArn !== undefined && + input.resourceShareInvitationArn !== null && { resourceShareInvitationArn: input.resourceShareInvitationArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -147,19 +146,22 @@ export const serializeAws_restJson1AssociateResourceShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/associateresourceshare"; let body: any; body = JSON.stringify({ - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.principals !== undefined && { - principals: serializeAws_restJson1PrincipalArnOrIdList(input.principals, context), - }), - ...(input.resourceArns !== undefined && { - resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), - }), - ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.principals !== undefined && + input.principals !== null && { + principals: serializeAws_restJson1PrincipalArnOrIdList(input.principals, context), + }), + ...(input.resourceArns !== undefined && + input.resourceArns !== null && { + resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), + }), + ...(input.resourceShareArn !== undefined && + input.resourceShareArn !== null && { resourceShareArn: input.resourceShareArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -178,15 +180,16 @@ export const serializeAws_restJson1AssociateResourceSharePermissionCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/associateresourcesharepermission"; let body: any; body = JSON.stringify({ - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.permissionArn !== undefined && { permissionArn: input.permissionArn }), - ...(input.replace !== undefined && { replace: input.replace }), - ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.permissionArn !== undefined && input.permissionArn !== null && { permissionArn: input.permissionArn }), + ...(input.replace !== undefined && input.replace !== null && { replace: input.replace }), + ...(input.resourceShareArn !== undefined && + input.resourceShareArn !== null && { resourceShareArn: input.resourceShareArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -205,24 +208,29 @@ export const serializeAws_restJson1CreateResourceShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createresourceshare"; let body: any; body = JSON.stringify({ - ...(input.allowExternalPrincipals !== undefined && { allowExternalPrincipals: input.allowExternalPrincipals }), - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.name !== undefined && { name: input.name }), - ...(input.permissionArns !== undefined && { - permissionArns: serializeAws_restJson1PermissionArnList(input.permissionArns, context), - }), - ...(input.principals !== undefined && { - principals: serializeAws_restJson1PrincipalArnOrIdList(input.principals, context), - }), - ...(input.resourceArns !== undefined && { - resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.allowExternalPrincipals !== undefined && + input.allowExternalPrincipals !== null && { allowExternalPrincipals: input.allowExternalPrincipals }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.permissionArns !== undefined && + input.permissionArns !== null && { + permissionArns: serializeAws_restJson1PermissionArnList(input.permissionArns, context), + }), + ...(input.principals !== undefined && + input.principals !== null && { + principals: serializeAws_restJson1PrincipalArnOrIdList(input.principals, context), + }), + ...(input.resourceArns !== undefined && + input.resourceArns !== null && { + resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), + }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -240,9 +248,7 @@ export const serializeAws_restJson1DeleteResourceShareCommand = async ( input: DeleteResourceShareCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/deleteresourceshare"; const query: any = { ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), @@ -267,19 +273,22 @@ export const serializeAws_restJson1DisassociateResourceShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/disassociateresourceshare"; let body: any; body = JSON.stringify({ - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.principals !== undefined && { - principals: serializeAws_restJson1PrincipalArnOrIdList(input.principals, context), - }), - ...(input.resourceArns !== undefined && { - resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), - }), - ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.principals !== undefined && + input.principals !== null && { + principals: serializeAws_restJson1PrincipalArnOrIdList(input.principals, context), + }), + ...(input.resourceArns !== undefined && + input.resourceArns !== null && { + resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), + }), + ...(input.resourceShareArn !== undefined && + input.resourceShareArn !== null && { resourceShareArn: input.resourceShareArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -298,14 +307,15 @@ export const serializeAws_restJson1DisassociateResourceSharePermissionCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/disassociateresourcesharepermission"; let body: any; body = JSON.stringify({ - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.permissionArn !== undefined && { permissionArn: input.permissionArn }), - ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.permissionArn !== undefined && input.permissionArn !== null && { permissionArn: input.permissionArn }), + ...(input.resourceShareArn !== undefined && + input.resourceShareArn !== null && { resourceShareArn: input.resourceShareArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -323,12 +333,10 @@ export const serializeAws_restJson1EnableSharingWithAwsOrganizationCommand = asy input: EnableSharingWithAwsOrganizationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/enablesharingwithawsorganization"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -346,13 +354,14 @@ export const serializeAws_restJson1GetPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getpermission"; let body: any; body = JSON.stringify({ - ...(input.permissionArn !== undefined && { permissionArn: input.permissionArn }), - ...(input.permissionVersion !== undefined && { permissionVersion: input.permissionVersion }), + ...(input.permissionArn !== undefined && input.permissionArn !== null && { permissionArn: input.permissionArn }), + ...(input.permissionVersion !== undefined && + input.permissionVersion !== null && { permissionVersion: input.permissionVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -371,17 +380,18 @@ export const serializeAws_restJson1GetResourcePoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getresourcepolicies"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.principal !== undefined && { principal: input.principal }), - ...(input.resourceArns !== undefined && { - resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), - }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.principal !== undefined && input.principal !== null && { principal: input.principal }), + ...(input.resourceArns !== undefined && + input.resourceArns !== null && { + resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -400,20 +410,23 @@ export const serializeAws_restJson1GetResourceShareAssociationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getresourceshareassociations"; let body: any; body = JSON.stringify({ - ...(input.associationStatus !== undefined && { associationStatus: input.associationStatus }), - ...(input.associationType !== undefined && { associationType: input.associationType }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.principal !== undefined && { principal: input.principal }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.resourceShareArns !== undefined && { - resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), - }), + ...(input.associationStatus !== undefined && + input.associationStatus !== null && { associationStatus: input.associationStatus }), + ...(input.associationType !== undefined && + input.associationType !== null && { associationType: input.associationType }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.principal !== undefined && input.principal !== null && { principal: input.principal }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.resourceShareArns !== undefined && + input.resourceShareArns !== null && { + resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -432,22 +445,24 @@ export const serializeAws_restJson1GetResourceShareInvitationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getresourceshareinvitations"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceShareArns !== undefined && { - resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), - }), - ...(input.resourceShareInvitationArns !== undefined && { - resourceShareInvitationArns: serializeAws_restJson1ResourceShareInvitationArnList( - input.resourceShareInvitationArns, - context - ), - }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceShareArns !== undefined && + input.resourceShareArns !== null && { + resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), + }), + ...(input.resourceShareInvitationArns !== undefined && + input.resourceShareInvitationArns !== null && { + resourceShareInvitationArns: serializeAws_restJson1ResourceShareInvitationArnList( + input.resourceShareInvitationArns, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -466,20 +481,23 @@ export const serializeAws_restJson1GetResourceSharesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getresourceshares"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.name !== undefined && { name: input.name }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceOwner !== undefined && { resourceOwner: input.resourceOwner }), - ...(input.resourceShareArns !== undefined && { - resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), - }), - ...(input.resourceShareStatus !== undefined && { resourceShareStatus: input.resourceShareStatus }), - ...(input.tagFilters !== undefined && { tagFilters: serializeAws_restJson1TagFilters(input.tagFilters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceOwner !== undefined && input.resourceOwner !== null && { resourceOwner: input.resourceOwner }), + ...(input.resourceShareArns !== undefined && + input.resourceShareArns !== null && { + resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), + }), + ...(input.resourceShareStatus !== undefined && + input.resourceShareStatus !== null && { resourceShareStatus: input.resourceShareStatus }), + ...(input.tagFilters !== undefined && + input.tagFilters !== null && { tagFilters: serializeAws_restJson1TagFilters(input.tagFilters, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -498,16 +516,15 @@ export const serializeAws_restJson1ListPendingInvitationResourcesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listpendinginvitationresources"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceShareInvitationArn !== undefined && { - resourceShareInvitationArn: input.resourceShareInvitationArn, - }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceShareInvitationArn !== undefined && + input.resourceShareInvitationArn !== null && { resourceShareInvitationArn: input.resourceShareInvitationArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -526,14 +543,14 @@ export const serializeAws_restJson1ListPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listpermissions"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceType !== undefined && { resourceType: input.resourceType }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceType !== undefined && input.resourceType !== null && { resourceType: input.resourceType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -552,22 +569,24 @@ export const serializeAws_restJson1ListPrincipalsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listprincipals"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.principals !== undefined && { - principals: serializeAws_restJson1PrincipalArnOrIdList(input.principals, context), - }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.resourceOwner !== undefined && { resourceOwner: input.resourceOwner }), - ...(input.resourceShareArns !== undefined && { - resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), - }), - ...(input.resourceType !== undefined && { resourceType: input.resourceType }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.principals !== undefined && + input.principals !== null && { + principals: serializeAws_restJson1PrincipalArnOrIdList(input.principals, context), + }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.resourceOwner !== undefined && input.resourceOwner !== null && { resourceOwner: input.resourceOwner }), + ...(input.resourceShareArns !== undefined && + input.resourceShareArns !== null && { + resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), + }), + ...(input.resourceType !== undefined && input.resourceType !== null && { resourceType: input.resourceType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -586,22 +605,24 @@ export const serializeAws_restJson1ListResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listresources"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.principal !== undefined && { principal: input.principal }), - ...(input.resourceArns !== undefined && { - resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), - }), - ...(input.resourceOwner !== undefined && { resourceOwner: input.resourceOwner }), - ...(input.resourceShareArns !== undefined && { - resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), - }), - ...(input.resourceType !== undefined && { resourceType: input.resourceType }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.principal !== undefined && input.principal !== null && { principal: input.principal }), + ...(input.resourceArns !== undefined && + input.resourceArns !== null && { + resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context), + }), + ...(input.resourceOwner !== undefined && input.resourceOwner !== null && { resourceOwner: input.resourceOwner }), + ...(input.resourceShareArns !== undefined && + input.resourceShareArns !== null && { + resourceShareArns: serializeAws_restJson1ResourceShareArnList(input.resourceShareArns, context), + }), + ...(input.resourceType !== undefined && input.resourceType !== null && { resourceType: input.resourceType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -620,14 +641,15 @@ export const serializeAws_restJson1ListResourceSharePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listresourcesharepermissions"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.resourceShareArn !== undefined && + input.resourceShareArn !== null && { resourceShareArn: input.resourceShareArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -646,13 +668,13 @@ export const serializeAws_restJson1ListResourceTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listresourcetypes"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -670,9 +692,7 @@ export const serializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand input: PromoteResourceShareCreatedFromPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/promoteresourcesharecreatedfrompolicy"; const query: any = { ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), @@ -696,15 +716,14 @@ export const serializeAws_restJson1RejectResourceShareInvitationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/rejectresourceshareinvitation"; let body: any; body = JSON.stringify({ - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.resourceShareInvitationArn !== undefined && { - resourceShareInvitationArn: input.resourceShareInvitationArn, - }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.resourceShareInvitationArn !== undefined && + input.resourceShareInvitationArn !== null && { resourceShareInvitationArn: input.resourceShareInvitationArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -723,13 +742,15 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tagresource"; let body: any; body = JSON.stringify({ - ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagList(input.tags, context) }), + ...(input.resourceShareArn !== undefined && + input.resourceShareArn !== null && { resourceShareArn: input.resourceShareArn }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -748,13 +769,15 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/untagresource"; let body: any; body = JSON.stringify({ - ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), + ...(input.resourceShareArn !== undefined && + input.resourceShareArn !== null && { resourceShareArn: input.resourceShareArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -773,15 +796,17 @@ export const serializeAws_restJson1UpdateResourceShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateresourceshare"; let body: any; body = JSON.stringify({ - ...(input.allowExternalPrincipals !== undefined && { allowExternalPrincipals: input.allowExternalPrincipals }), - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.name !== undefined && { name: input.name }), - ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }), + ...(input.allowExternalPrincipals !== undefined && + input.allowExternalPrincipals !== null && { allowExternalPrincipals: input.allowExternalPrincipals }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.resourceShareArn !== undefined && + input.resourceShareArn !== null && { resourceShareArn: input.resourceShareArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3774,57 +3799,128 @@ const deserializeAws_restJson1UnknownResourceExceptionResponse = async ( }; const serializeAws_restJson1PermissionArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1PrincipalArnOrIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResourceArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResourceShareArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResourceShareInvitationArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_restJson1TagFilter = (input: TagFilter, context: __SerdeContext): any => { return { - ...(input.tagKey !== undefined && { tagKey: input.tagKey }), - ...(input.tagValues !== undefined && { tagValues: serializeAws_restJson1TagValueList(input.tagValues, context) }), + ...(input.tagKey !== undefined && input.tagKey !== null && { tagKey: input.tagKey }), + ...(input.tagValues !== undefined && + input.tagValues !== null && { tagValues: serializeAws_restJson1TagValueList(input.tagValues, context) }), }; }; const serializeAws_restJson1TagFilters = (input: TagFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1TagFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TagFilter(entry, context); + }); }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TagValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1PolicyList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Principal = (output: any, context: __SerdeContext): Principal => { @@ -3845,7 +3941,14 @@ const deserializeAws_restJson1Principal = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1PrincipalList = (output: any, context: __SerdeContext): Principal[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Principal(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Principal(entry, context); + }); }; const deserializeAws_restJson1Resource = (output: any, context: __SerdeContext): Resource => { @@ -3871,7 +3974,14 @@ const deserializeAws_restJson1Resource = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1ResourceList = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Resource(entry, context); + }); }; const deserializeAws_restJson1ResourceShare = (output: any, context: __SerdeContext): ResourceShare => { @@ -3938,7 +4048,14 @@ const deserializeAws_restJson1ResourceShareAssociationList = ( output: any, context: __SerdeContext ): ResourceShareAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceShareAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceShareAssociation(entry, context); + }); }; const deserializeAws_restJson1ResourceShareInvitation = ( @@ -3978,11 +4095,25 @@ const deserializeAws_restJson1ResourceShareInvitationList = ( output: any, context: __SerdeContext ): ResourceShareInvitation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceShareInvitation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceShareInvitation(entry, context); + }); }; const deserializeAws_restJson1ResourceShareList = (output: any, context: __SerdeContext): ResourceShare[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceShare(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceShare(entry, context); + }); }; const deserializeAws_restJson1ResourceSharePermissionDetail = ( @@ -4012,7 +4143,14 @@ const deserializeAws_restJson1ResourceSharePermissionList = ( output: any, context: __SerdeContext ): ResourceSharePermissionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceSharePermissionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceSharePermissionSummary(entry, context); + }); }; const deserializeAws_restJson1ResourceSharePermissionSummary = ( @@ -4052,7 +4190,14 @@ const deserializeAws_restJson1ServiceNameAndResourceTypeList = ( output: any, context: __SerdeContext ): ServiceNameAndResourceType[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ServiceNameAndResourceType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ServiceNameAndResourceType(entry, context); + }); }; const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => { @@ -4063,7 +4208,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4086,6 +4238,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-rds-data/protocols/Aws_restJson1.ts b/clients/client-rds-data/protocols/Aws_restJson1.ts index 64cd8911141b..6a4f6917a02b 100644 --- a/clients/client-rds-data/protocols/Aws_restJson1.ts +++ b/clients/client-rds-data/protocols/Aws_restJson1.ts @@ -44,20 +44,21 @@ export const serializeAws_restJson1BatchExecuteStatementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/BatchExecute"; let body: any; body = JSON.stringify({ - ...(input.database !== undefined && { database: input.database }), - ...(input.parameterSets !== undefined && { - parameterSets: serializeAws_restJson1SqlParameterSets(input.parameterSets, context), - }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.schema !== undefined && { schema: input.schema }), - ...(input.secretArn !== undefined && { secretArn: input.secretArn }), - ...(input.sql !== undefined && { sql: input.sql }), - ...(input.transactionId !== undefined && { transactionId: input.transactionId }), + ...(input.database !== undefined && input.database !== null && { database: input.database }), + ...(input.parameterSets !== undefined && + input.parameterSets !== null && { + parameterSets: serializeAws_restJson1SqlParameterSets(input.parameterSets, context), + }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.schema !== undefined && input.schema !== null && { schema: input.schema }), + ...(input.secretArn !== undefined && input.secretArn !== null && { secretArn: input.secretArn }), + ...(input.sql !== undefined && input.sql !== null && { sql: input.sql }), + ...(input.transactionId !== undefined && input.transactionId !== null && { transactionId: input.transactionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -76,15 +77,15 @@ export const serializeAws_restJson1BeginTransactionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/BeginTransaction"; let body: any; body = JSON.stringify({ - ...(input.database !== undefined && { database: input.database }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.schema !== undefined && { schema: input.schema }), - ...(input.secretArn !== undefined && { secretArn: input.secretArn }), + ...(input.database !== undefined && input.database !== null && { database: input.database }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.schema !== undefined && input.schema !== null && { schema: input.schema }), + ...(input.secretArn !== undefined && input.secretArn !== null && { secretArn: input.secretArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -103,14 +104,14 @@ export const serializeAws_restJson1CommitTransactionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CommitTransaction"; let body: any; body = JSON.stringify({ - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.secretArn !== undefined && { secretArn: input.secretArn }), - ...(input.transactionId !== undefined && { transactionId: input.transactionId }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.secretArn !== undefined && input.secretArn !== null && { secretArn: input.secretArn }), + ...(input.transactionId !== undefined && input.transactionId !== null && { transactionId: input.transactionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -129,16 +130,18 @@ export const serializeAws_restJson1ExecuteSqlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ExecuteSql"; let body: any; body = JSON.stringify({ - ...(input.awsSecretStoreArn !== undefined && { awsSecretStoreArn: input.awsSecretStoreArn }), - ...(input.database !== undefined && { database: input.database }), - ...(input.dbClusterOrInstanceArn !== undefined && { dbClusterOrInstanceArn: input.dbClusterOrInstanceArn }), - ...(input.schema !== undefined && { schema: input.schema }), - ...(input.sqlStatements !== undefined && { sqlStatements: input.sqlStatements }), + ...(input.awsSecretStoreArn !== undefined && + input.awsSecretStoreArn !== null && { awsSecretStoreArn: input.awsSecretStoreArn }), + ...(input.database !== undefined && input.database !== null && { database: input.database }), + ...(input.dbClusterOrInstanceArn !== undefined && + input.dbClusterOrInstanceArn !== null && { dbClusterOrInstanceArn: input.dbClusterOrInstanceArn }), + ...(input.schema !== undefined && input.schema !== null && { schema: input.schema }), + ...(input.sqlStatements !== undefined && input.sqlStatements !== null && { sqlStatements: input.sqlStatements }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -157,25 +160,27 @@ export const serializeAws_restJson1ExecuteStatementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/Execute"; let body: any; body = JSON.stringify({ - ...(input.continueAfterTimeout !== undefined && { continueAfterTimeout: input.continueAfterTimeout }), - ...(input.database !== undefined && { database: input.database }), - ...(input.includeResultMetadata !== undefined && { includeResultMetadata: input.includeResultMetadata }), - ...(input.parameters !== undefined && { - parameters: serializeAws_restJson1SqlParametersList(input.parameters, context), - }), - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.resultSetOptions !== undefined && { - resultSetOptions: serializeAws_restJson1ResultSetOptions(input.resultSetOptions, context), - }), - ...(input.schema !== undefined && { schema: input.schema }), - ...(input.secretArn !== undefined && { secretArn: input.secretArn }), - ...(input.sql !== undefined && { sql: input.sql }), - ...(input.transactionId !== undefined && { transactionId: input.transactionId }), + ...(input.continueAfterTimeout !== undefined && + input.continueAfterTimeout !== null && { continueAfterTimeout: input.continueAfterTimeout }), + ...(input.database !== undefined && input.database !== null && { database: input.database }), + ...(input.includeResultMetadata !== undefined && + input.includeResultMetadata !== null && { includeResultMetadata: input.includeResultMetadata }), + ...(input.parameters !== undefined && + input.parameters !== null && { parameters: serializeAws_restJson1SqlParametersList(input.parameters, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.resultSetOptions !== undefined && + input.resultSetOptions !== null && { + resultSetOptions: serializeAws_restJson1ResultSetOptions(input.resultSetOptions, context), + }), + ...(input.schema !== undefined && input.schema !== null && { schema: input.schema }), + ...(input.secretArn !== undefined && input.secretArn !== null && { secretArn: input.secretArn }), + ...(input.sql !== undefined && input.sql !== null && { sql: input.sql }), + ...(input.transactionId !== undefined && input.transactionId !== null && { transactionId: input.transactionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -194,14 +199,14 @@ export const serializeAws_restJson1RollbackTransactionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/RollbackTransaction"; let body: any; body = JSON.stringify({ - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.secretArn !== undefined && { secretArn: input.secretArn }), - ...(input.transactionId !== undefined && { transactionId: input.transactionId }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.secretArn !== undefined && input.secretArn !== null && { secretArn: input.secretArn }), + ...(input.transactionId !== undefined && input.transactionId !== null && { transactionId: input.transactionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -856,7 +861,14 @@ const deserializeAws_restJson1StatementTimeoutExceptionResponse = async ( }; const serializeAws_restJson1ArrayOfArray = (input: ArrayValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ArrayValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ArrayValue(entry, context); + }); }; const serializeAws_restJson1ArrayValue = (input: ArrayValue, context: __SerdeContext): any => { @@ -871,11 +883,25 @@ const serializeAws_restJson1ArrayValue = (input: ArrayValue, context: __SerdeCon }; const serializeAws_restJson1BooleanArray = (input: boolean[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DoubleArray = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Field = (input: Field, context: __SerdeContext): any => { @@ -892,37 +918,74 @@ const serializeAws_restJson1Field = (input: Field, context: __SerdeContext): any }; const serializeAws_restJson1LongArray = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResultSetOptions = (input: ResultSetOptions, context: __SerdeContext): any => { return { - ...(input.decimalReturnType !== undefined && { decimalReturnType: input.decimalReturnType }), + ...(input.decimalReturnType !== undefined && + input.decimalReturnType !== null && { decimalReturnType: input.decimalReturnType }), }; }; const serializeAws_restJson1SqlParameter = (input: SqlParameter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.typeHint !== undefined && { typeHint: input.typeHint }), - ...(input.value !== undefined && { value: serializeAws_restJson1Field(input.value, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.typeHint !== undefined && input.typeHint !== null && { typeHint: input.typeHint }), + ...(input.value !== undefined && + input.value !== null && { value: serializeAws_restJson1Field(input.value, context) }), }; }; const serializeAws_restJson1SqlParameterSets = (input: SqlParameter[][], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SqlParametersList(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SqlParametersList(entry, context); + }); }; const serializeAws_restJson1SqlParametersList = (input: SqlParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SqlParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SqlParameter(entry, context); + }); }; const serializeAws_restJson1StringArray = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ArrayOfArray = (output: any, context: __SerdeContext): ArrayValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ArrayValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ArrayValue(entry, context); + }); }; const deserializeAws_restJson1ArrayValue = (output: any, context: __SerdeContext): ArrayValue => { @@ -955,11 +1018,25 @@ const deserializeAws_restJson1ArrayValue = (output: any, context: __SerdeContext }; const deserializeAws_restJson1ArrayValueList = (output: any, context: __SerdeContext): Value[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Value(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Value(entry, context); + }); }; const deserializeAws_restJson1BooleanArray = (output: any, context: __SerdeContext): boolean[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ColumnMetadata = (output: any, context: __SerdeContext): ColumnMetadata => { @@ -987,7 +1064,14 @@ const deserializeAws_restJson1ColumnMetadata = (output: any, context: __SerdeCon }; const deserializeAws_restJson1DoubleArray = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Field = (output: any, context: __SerdeContext): Field => { @@ -1030,15 +1114,36 @@ const deserializeAws_restJson1Field = (output: any, context: __SerdeContext): Fi }; const deserializeAws_restJson1FieldList = (output: any, context: __SerdeContext): Field[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Field(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Field(entry, context); + }); }; const deserializeAws_restJson1LongArray = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Metadata = (output: any, context: __SerdeContext): ColumnMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ColumnMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ColumnMetadata(entry, context); + }); }; const deserializeAws_restJson1_Record = (output: any, context: __SerdeContext): _Record => { @@ -1051,7 +1156,14 @@ const deserializeAws_restJson1_Record = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Records = (output: any, context: __SerdeContext): _Record[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1_Record(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1_Record(entry, context); + }); }; const deserializeAws_restJson1ResultFrame = (output: any, context: __SerdeContext): ResultFrame => { @@ -1078,11 +1190,25 @@ const deserializeAws_restJson1ResultSetMetadata = (output: any, context: __Serde }; const deserializeAws_restJson1Row = (output: any, context: __SerdeContext): Value[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Value(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Value(entry, context); + }); }; const deserializeAws_restJson1SqlRecords = (output: any, context: __SerdeContext): Field[][] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FieldList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FieldList(entry, context); + }); }; const deserializeAws_restJson1SqlStatementResult = (output: any, context: __SerdeContext): SqlStatementResult => { @@ -1099,11 +1225,25 @@ const deserializeAws_restJson1SqlStatementResult = (output: any, context: __Serd }; const deserializeAws_restJson1SqlStatementResults = (output: any, context: __SerdeContext): SqlStatementResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SqlStatementResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SqlStatementResult(entry, context); + }); }; const deserializeAws_restJson1StringArray = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1StructValue = (output: any, context: __SerdeContext): StructValue => { @@ -1125,7 +1265,14 @@ const deserializeAws_restJson1UpdateResult = (output: any, context: __SerdeConte }; const deserializeAws_restJson1UpdateResults = (output: any, context: __SerdeContext): UpdateResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UpdateResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UpdateResult(entry, context); + }); }; const deserializeAws_restJson1Value = (output: any, context: __SerdeContext): Value => { @@ -1202,6 +1349,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-rds/protocols/Aws_query.ts b/clients/client-rds/protocols/Aws_query.ts index 39b80b4e1f30..48ec222ed2ef 100644 --- a/clients/client-rds/protocols/Aws_query.ts +++ b/clients/client-rds/protocols/Aws_query.ts @@ -890,7 +890,7 @@ export const serializeAws_queryAddRoleToDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -906,7 +906,7 @@ export const serializeAws_queryAddRoleToDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -922,7 +922,7 @@ export const serializeAws_queryAddSourceIdentifierToSubscriptionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -938,7 +938,7 @@ export const serializeAws_queryAddTagsToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -954,7 +954,7 @@ export const serializeAws_queryApplyPendingMaintenanceActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -970,7 +970,7 @@ export const serializeAws_queryAuthorizeDBSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -986,7 +986,7 @@ export const serializeAws_queryBacktrackDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1002,7 +1002,7 @@ export const serializeAws_queryCancelExportTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1018,7 +1018,7 @@ export const serializeAws_queryCopyDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1034,7 +1034,7 @@ export const serializeAws_queryCopyDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1050,7 +1050,7 @@ export const serializeAws_queryCopyDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1066,7 +1066,7 @@ export const serializeAws_queryCopyDBSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1082,7 +1082,7 @@ export const serializeAws_queryCopyOptionGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1098,7 +1098,7 @@ export const serializeAws_queryCreateCustomAvailabilityZoneCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1114,7 +1114,7 @@ export const serializeAws_queryCreateDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1130,7 +1130,7 @@ export const serializeAws_queryCreateDBClusterEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1146,7 +1146,7 @@ export const serializeAws_queryCreateDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1162,7 +1162,7 @@ export const serializeAws_queryCreateDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1178,7 +1178,7 @@ export const serializeAws_queryCreateDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1194,7 +1194,7 @@ export const serializeAws_queryCreateDBInstanceReadReplicaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1210,7 +1210,7 @@ export const serializeAws_queryCreateDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1226,7 +1226,7 @@ export const serializeAws_queryCreateDBProxyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1242,7 +1242,7 @@ export const serializeAws_queryCreateDBSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1258,7 +1258,7 @@ export const serializeAws_queryCreateDBSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1274,7 +1274,7 @@ export const serializeAws_queryCreateDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1290,7 +1290,7 @@ export const serializeAws_queryCreateEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1306,7 +1306,7 @@ export const serializeAws_queryCreateGlobalClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1322,7 +1322,7 @@ export const serializeAws_queryCreateOptionGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1338,7 +1338,7 @@ export const serializeAws_queryDeleteCustomAvailabilityZoneCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1354,7 +1354,7 @@ export const serializeAws_queryDeleteDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1370,7 +1370,7 @@ export const serializeAws_queryDeleteDBClusterEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1386,7 +1386,7 @@ export const serializeAws_queryDeleteDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1402,7 +1402,7 @@ export const serializeAws_queryDeleteDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1418,7 +1418,7 @@ export const serializeAws_queryDeleteDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1434,7 +1434,7 @@ export const serializeAws_queryDeleteDBInstanceAutomatedBackupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1450,7 +1450,7 @@ export const serializeAws_queryDeleteDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1466,7 +1466,7 @@ export const serializeAws_queryDeleteDBProxyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1482,7 +1482,7 @@ export const serializeAws_queryDeleteDBSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1498,7 +1498,7 @@ export const serializeAws_queryDeleteDBSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1514,7 +1514,7 @@ export const serializeAws_queryDeleteDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1530,7 +1530,7 @@ export const serializeAws_queryDeleteEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1546,7 +1546,7 @@ export const serializeAws_queryDeleteGlobalClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1562,7 +1562,7 @@ export const serializeAws_queryDeleteInstallationMediaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1578,7 +1578,7 @@ export const serializeAws_queryDeleteOptionGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1594,7 +1594,7 @@ export const serializeAws_queryDeregisterDBProxyTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1610,7 +1610,7 @@ export const serializeAws_queryDescribeAccountAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1626,7 +1626,7 @@ export const serializeAws_queryDescribeCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1642,7 +1642,7 @@ export const serializeAws_queryDescribeCustomAvailabilityZonesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1658,7 +1658,7 @@ export const serializeAws_queryDescribeDBClusterBacktracksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1674,7 +1674,7 @@ export const serializeAws_queryDescribeDBClusterEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1690,7 +1690,7 @@ export const serializeAws_queryDescribeDBClusterParameterGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1706,7 +1706,7 @@ export const serializeAws_queryDescribeDBClusterParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1722,7 +1722,7 @@ export const serializeAws_queryDescribeDBClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1738,7 +1738,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotAttributesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1754,7 +1754,7 @@ export const serializeAws_queryDescribeDBClusterSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1770,7 +1770,7 @@ export const serializeAws_queryDescribeDBEngineVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1786,7 +1786,7 @@ export const serializeAws_queryDescribeDBInstanceAutomatedBackupsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1802,7 +1802,7 @@ export const serializeAws_queryDescribeDBInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1818,7 +1818,7 @@ export const serializeAws_queryDescribeDBLogFilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1834,7 +1834,7 @@ export const serializeAws_queryDescribeDBParameterGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1850,7 +1850,7 @@ export const serializeAws_queryDescribeDBParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1866,7 +1866,7 @@ export const serializeAws_queryDescribeDBProxiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1882,7 +1882,7 @@ export const serializeAws_queryDescribeDBProxyTargetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1898,7 +1898,7 @@ export const serializeAws_queryDescribeDBProxyTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1914,7 +1914,7 @@ export const serializeAws_queryDescribeDBSecurityGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1930,7 +1930,7 @@ export const serializeAws_queryDescribeDBSnapshotAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1946,7 +1946,7 @@ export const serializeAws_queryDescribeDBSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1962,7 +1962,7 @@ export const serializeAws_queryDescribeDBSubnetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1978,7 +1978,7 @@ export const serializeAws_queryDescribeEngineDefaultClusterParametersCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1994,7 +1994,7 @@ export const serializeAws_queryDescribeEngineDefaultParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2010,7 +2010,7 @@ export const serializeAws_queryDescribeEventCategoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2026,7 +2026,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2042,7 +2042,7 @@ export const serializeAws_queryDescribeEventSubscriptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2058,7 +2058,7 @@ export const serializeAws_queryDescribeExportTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2074,7 +2074,7 @@ export const serializeAws_queryDescribeGlobalClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2090,7 +2090,7 @@ export const serializeAws_queryDescribeInstallationMediaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2106,7 +2106,7 @@ export const serializeAws_queryDescribeOptionGroupOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2122,7 +2122,7 @@ export const serializeAws_queryDescribeOptionGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2138,7 +2138,7 @@ export const serializeAws_queryDescribeOrderableDBInstanceOptionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2154,7 +2154,7 @@ export const serializeAws_queryDescribePendingMaintenanceActionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2170,7 +2170,7 @@ export const serializeAws_queryDescribeReservedDBInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2186,7 +2186,7 @@ export const serializeAws_queryDescribeReservedDBInstancesOfferingsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2202,7 +2202,7 @@ export const serializeAws_queryDescribeSourceRegionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2218,7 +2218,7 @@ export const serializeAws_queryDescribeValidDBInstanceModificationsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2234,7 +2234,7 @@ export const serializeAws_queryDownloadDBLogFilePortionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2250,7 +2250,7 @@ export const serializeAws_queryFailoverDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2266,7 +2266,7 @@ export const serializeAws_queryImportInstallationMediaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2282,7 +2282,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2298,7 +2298,7 @@ export const serializeAws_queryModifyCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2314,7 +2314,7 @@ export const serializeAws_queryModifyCurrentDBClusterCapacityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2330,7 +2330,7 @@ export const serializeAws_queryModifyDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2346,7 +2346,7 @@ export const serializeAws_queryModifyDBClusterEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2362,7 +2362,7 @@ export const serializeAws_queryModifyDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2378,7 +2378,7 @@ export const serializeAws_queryModifyDBClusterSnapshotAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2394,7 +2394,7 @@ export const serializeAws_queryModifyDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2410,7 +2410,7 @@ export const serializeAws_queryModifyDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2426,7 +2426,7 @@ export const serializeAws_queryModifyDBProxyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2442,7 +2442,7 @@ export const serializeAws_queryModifyDBProxyTargetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2458,7 +2458,7 @@ export const serializeAws_queryModifyDBSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2474,7 +2474,7 @@ export const serializeAws_queryModifyDBSnapshotAttributeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2490,7 +2490,7 @@ export const serializeAws_queryModifyDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2506,7 +2506,7 @@ export const serializeAws_queryModifyEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2522,7 +2522,7 @@ export const serializeAws_queryModifyGlobalClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2538,7 +2538,7 @@ export const serializeAws_queryModifyOptionGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2554,7 +2554,7 @@ export const serializeAws_queryPromoteReadReplicaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2570,7 +2570,7 @@ export const serializeAws_queryPromoteReadReplicaDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2586,7 +2586,7 @@ export const serializeAws_queryPurchaseReservedDBInstancesOfferingCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2602,7 +2602,7 @@ export const serializeAws_queryRebootDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2618,7 +2618,7 @@ export const serializeAws_queryRegisterDBProxyTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2634,7 +2634,7 @@ export const serializeAws_queryRemoveFromGlobalClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2650,7 +2650,7 @@ export const serializeAws_queryRemoveRoleFromDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2666,7 +2666,7 @@ export const serializeAws_queryRemoveRoleFromDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2682,7 +2682,7 @@ export const serializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2698,7 +2698,7 @@ export const serializeAws_queryRemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2714,7 +2714,7 @@ export const serializeAws_queryResetDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2730,7 +2730,7 @@ export const serializeAws_queryResetDBParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2746,7 +2746,7 @@ export const serializeAws_queryRestoreDBClusterFromS3Command = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2762,7 +2762,7 @@ export const serializeAws_queryRestoreDBClusterFromSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2778,7 +2778,7 @@ export const serializeAws_queryRestoreDBClusterToPointInTimeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2794,7 +2794,7 @@ export const serializeAws_queryRestoreDBInstanceFromDBSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2810,7 +2810,7 @@ export const serializeAws_queryRestoreDBInstanceFromS3Command = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2826,7 +2826,7 @@ export const serializeAws_queryRestoreDBInstanceToPointInTimeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2842,7 +2842,7 @@ export const serializeAws_queryRevokeDBSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2858,7 +2858,7 @@ export const serializeAws_queryStartActivityStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2874,7 +2874,7 @@ export const serializeAws_queryStartDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2890,7 +2890,7 @@ export const serializeAws_queryStartDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2906,7 +2906,7 @@ export const serializeAws_queryStartDBInstanceAutomatedBackupsReplicationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2922,7 +2922,7 @@ export const serializeAws_queryStartExportTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2938,7 +2938,7 @@ export const serializeAws_queryStopActivityStreamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2954,7 +2954,7 @@ export const serializeAws_queryStopDBClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2970,7 +2970,7 @@ export const serializeAws_queryStopDBInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2986,7 +2986,7 @@ export const serializeAws_queryStopDBInstanceAutomatedBackupsReplicationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -14886,13 +14886,13 @@ const serializeAws_queryAddRoleToDBClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.FeatureName !== undefined) { + if (input.FeatureName !== undefined && input.FeatureName !== null) { entries["FeatureName"] = input.FeatureName; } return entries; @@ -14903,13 +14903,13 @@ const serializeAws_queryAddRoleToDBInstanceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.FeatureName !== undefined) { + if (input.FeatureName !== undefined && input.FeatureName !== null) { entries["FeatureName"] = input.FeatureName; } return entries; @@ -14920,10 +14920,10 @@ const serializeAws_queryAddSourceIdentifierToSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.SourceIdentifier !== undefined) { + if (input.SourceIdentifier !== undefined && input.SourceIdentifier !== null) { entries["SourceIdentifier"] = input.SourceIdentifier; } return entries; @@ -14931,10 +14931,10 @@ const serializeAws_queryAddSourceIdentifierToSubscriptionMessage = ( const serializeAws_queryAddTagsToResourceMessage = (input: AddTagsToResourceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -14949,13 +14949,13 @@ const serializeAws_queryApplyPendingMaintenanceActionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceIdentifier !== undefined) { + if (input.ResourceIdentifier !== undefined && input.ResourceIdentifier !== null) { entries["ResourceIdentifier"] = input.ResourceIdentifier; } - if (input.ApplyAction !== undefined) { + if (input.ApplyAction !== undefined && input.ApplyAction !== null) { entries["ApplyAction"] = input.ApplyAction; } - if (input.OptInType !== undefined) { + if (input.OptInType !== undefined && input.OptInType !== null) { entries["OptInType"] = input.OptInType; } return entries; @@ -14965,6 +14965,9 @@ const serializeAws_queryAttributeValueList = (input: string[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AttributeValue.${counter}`] = entry; counter++; } @@ -14976,19 +14979,19 @@ const serializeAws_queryAuthorizeDBSecurityGroupIngressMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSecurityGroupName !== undefined) { + if (input.DBSecurityGroupName !== undefined && input.DBSecurityGroupName !== null) { entries["DBSecurityGroupName"] = input.DBSecurityGroupName; } - if (input.CIDRIP !== undefined) { + if (input.CIDRIP !== undefined && input.CIDRIP !== null) { entries["CIDRIP"] = input.CIDRIP; } - if (input.EC2SecurityGroupName !== undefined) { + if (input.EC2SecurityGroupName !== undefined && input.EC2SecurityGroupName !== null) { entries["EC2SecurityGroupName"] = input.EC2SecurityGroupName; } - if (input.EC2SecurityGroupId !== undefined) { + if (input.EC2SecurityGroupId !== undefined && input.EC2SecurityGroupId !== null) { entries["EC2SecurityGroupId"] = input.EC2SecurityGroupId; } - if (input.EC2SecurityGroupOwnerId !== undefined) { + if (input.EC2SecurityGroupOwnerId !== undefined && input.EC2SecurityGroupOwnerId !== null) { entries["EC2SecurityGroupOwnerId"] = input.EC2SecurityGroupOwnerId; } return entries; @@ -14998,6 +15001,9 @@ const serializeAws_queryAvailabilityZones = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AvailabilityZone.${counter}`] = entry; counter++; } @@ -15009,16 +15015,19 @@ const serializeAws_queryBacktrackDBClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.BacktrackTo !== undefined) { + if (input.BacktrackTo !== undefined && input.BacktrackTo !== null) { entries["BacktrackTo"] = input.BacktrackTo.toISOString().split(".")[0] + "Z"; } - if (input.Force !== undefined) { + if (input.Force !== undefined && input.Force !== null) { entries["Force"] = input.Force; } - if (input.UseEarliestTimeOnPointInTimeUnavailable !== undefined) { + if ( + input.UseEarliestTimeOnPointInTimeUnavailable !== undefined && + input.UseEarliestTimeOnPointInTimeUnavailable !== null + ) { entries["UseEarliestTimeOnPointInTimeUnavailable"] = input.UseEarliestTimeOnPointInTimeUnavailable; } return entries; @@ -15026,7 +15035,7 @@ const serializeAws_queryBacktrackDBClusterMessage = ( const serializeAws_queryCancelExportTaskMessage = (input: CancelExportTaskMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ExportTaskIdentifier !== undefined) { + if (input.ExportTaskIdentifier !== undefined && input.ExportTaskIdentifier !== null) { entries["ExportTaskIdentifier"] = input.ExportTaskIdentifier; } return entries; @@ -15037,14 +15046,14 @@ const serializeAws_queryCloudwatchLogsExportConfiguration = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EnableLogTypes !== undefined) { + if (input.EnableLogTypes !== undefined && input.EnableLogTypes !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableLogTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableLogTypes.${key}`; entries[loc] = value; }); } - if (input.DisableLogTypes !== undefined) { + if (input.DisableLogTypes !== undefined && input.DisableLogTypes !== null) { const memberEntries = serializeAws_queryLogTypeList(input.DisableLogTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DisableLogTypes.${key}`; @@ -15059,23 +15068,23 @@ const serializeAws_queryConnectionPoolConfiguration = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxConnectionsPercent !== undefined) { + if (input.MaxConnectionsPercent !== undefined && input.MaxConnectionsPercent !== null) { entries["MaxConnectionsPercent"] = input.MaxConnectionsPercent; } - if (input.MaxIdleConnectionsPercent !== undefined) { + if (input.MaxIdleConnectionsPercent !== undefined && input.MaxIdleConnectionsPercent !== null) { entries["MaxIdleConnectionsPercent"] = input.MaxIdleConnectionsPercent; } - if (input.ConnectionBorrowTimeout !== undefined) { + if (input.ConnectionBorrowTimeout !== undefined && input.ConnectionBorrowTimeout !== null) { entries["ConnectionBorrowTimeout"] = input.ConnectionBorrowTimeout; } - if (input.SessionPinningFilters !== undefined) { + if (input.SessionPinningFilters !== undefined && input.SessionPinningFilters !== null) { const memberEntries = serializeAws_queryStringList(input.SessionPinningFilters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SessionPinningFilters.${key}`; entries[loc] = value; }); } - if (input.InitQuery !== undefined) { + if (input.InitQuery !== undefined && input.InitQuery !== null) { entries["InitQuery"] = input.InitQuery; } return entries; @@ -15086,16 +15095,25 @@ const serializeAws_queryCopyDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceDBClusterParameterGroupIdentifier !== undefined) { + if ( + input.SourceDBClusterParameterGroupIdentifier !== undefined && + input.SourceDBClusterParameterGroupIdentifier !== null + ) { entries["SourceDBClusterParameterGroupIdentifier"] = input.SourceDBClusterParameterGroupIdentifier; } - if (input.TargetDBClusterParameterGroupIdentifier !== undefined) { + if ( + input.TargetDBClusterParameterGroupIdentifier !== undefined && + input.TargetDBClusterParameterGroupIdentifier !== null + ) { entries["TargetDBClusterParameterGroupIdentifier"] = input.TargetDBClusterParameterGroupIdentifier; } - if (input.TargetDBClusterParameterGroupDescription !== undefined) { + if ( + input.TargetDBClusterParameterGroupDescription !== undefined && + input.TargetDBClusterParameterGroupDescription !== null + ) { entries["TargetDBClusterParameterGroupDescription"] = input.TargetDBClusterParameterGroupDescription; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15110,22 +15128,22 @@ const serializeAws_queryCopyDBClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceDBClusterSnapshotIdentifier !== undefined) { + if (input.SourceDBClusterSnapshotIdentifier !== undefined && input.SourceDBClusterSnapshotIdentifier !== null) { entries["SourceDBClusterSnapshotIdentifier"] = input.SourceDBClusterSnapshotIdentifier; } - if (input.TargetDBClusterSnapshotIdentifier !== undefined) { + if (input.TargetDBClusterSnapshotIdentifier !== undefined && input.TargetDBClusterSnapshotIdentifier !== null) { entries["TargetDBClusterSnapshotIdentifier"] = input.TargetDBClusterSnapshotIdentifier; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.PreSignedUrl !== undefined) { + if (input.PreSignedUrl !== undefined && input.PreSignedUrl !== null) { entries["PreSignedUrl"] = input.PreSignedUrl; } - if (input.CopyTags !== undefined) { + if (input.CopyTags !== undefined && input.CopyTags !== null) { entries["CopyTags"] = input.CopyTags; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15140,16 +15158,16 @@ const serializeAws_queryCopyDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceDBParameterGroupIdentifier !== undefined) { + if (input.SourceDBParameterGroupIdentifier !== undefined && input.SourceDBParameterGroupIdentifier !== null) { entries["SourceDBParameterGroupIdentifier"] = input.SourceDBParameterGroupIdentifier; } - if (input.TargetDBParameterGroupIdentifier !== undefined) { + if (input.TargetDBParameterGroupIdentifier !== undefined && input.TargetDBParameterGroupIdentifier !== null) { entries["TargetDBParameterGroupIdentifier"] = input.TargetDBParameterGroupIdentifier; } - if (input.TargetDBParameterGroupDescription !== undefined) { + if (input.TargetDBParameterGroupDescription !== undefined && input.TargetDBParameterGroupDescription !== null) { entries["TargetDBParameterGroupDescription"] = input.TargetDBParameterGroupDescription; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15161,32 +15179,32 @@ const serializeAws_queryCopyDBParameterGroupMessage = ( const serializeAws_queryCopyDBSnapshotMessage = (input: CopyDBSnapshotMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SourceDBSnapshotIdentifier !== undefined) { + if (input.SourceDBSnapshotIdentifier !== undefined && input.SourceDBSnapshotIdentifier !== null) { entries["SourceDBSnapshotIdentifier"] = input.SourceDBSnapshotIdentifier; } - if (input.TargetDBSnapshotIdentifier !== undefined) { + if (input.TargetDBSnapshotIdentifier !== undefined && input.TargetDBSnapshotIdentifier !== null) { entries["TargetDBSnapshotIdentifier"] = input.TargetDBSnapshotIdentifier; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.CopyTags !== undefined) { + if (input.CopyTags !== undefined && input.CopyTags !== null) { entries["CopyTags"] = input.CopyTags; } - if (input.PreSignedUrl !== undefined) { + if (input.PreSignedUrl !== undefined && input.PreSignedUrl !== null) { entries["PreSignedUrl"] = input.PreSignedUrl; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.TargetCustomAvailabilityZone !== undefined) { + if (input.TargetCustomAvailabilityZone !== undefined && input.TargetCustomAvailabilityZone !== null) { entries["TargetCustomAvailabilityZone"] = input.TargetCustomAvailabilityZone; } return entries; @@ -15194,16 +15212,16 @@ const serializeAws_queryCopyDBSnapshotMessage = (input: CopyDBSnapshotMessage, c const serializeAws_queryCopyOptionGroupMessage = (input: CopyOptionGroupMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SourceOptionGroupIdentifier !== undefined) { + if (input.SourceOptionGroupIdentifier !== undefined && input.SourceOptionGroupIdentifier !== null) { entries["SourceOptionGroupIdentifier"] = input.SourceOptionGroupIdentifier; } - if (input.TargetOptionGroupIdentifier !== undefined) { + if (input.TargetOptionGroupIdentifier !== undefined && input.TargetOptionGroupIdentifier !== null) { entries["TargetOptionGroupIdentifier"] = input.TargetOptionGroupIdentifier; } - if (input.TargetOptionGroupDescription !== undefined) { + if (input.TargetOptionGroupDescription !== undefined && input.TargetOptionGroupDescription !== null) { entries["TargetOptionGroupDescription"] = input.TargetOptionGroupDescription; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15218,16 +15236,16 @@ const serializeAws_queryCreateCustomAvailabilityZoneMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CustomAvailabilityZoneName !== undefined) { + if (input.CustomAvailabilityZoneName !== undefined && input.CustomAvailabilityZoneName !== null) { entries["CustomAvailabilityZoneName"] = input.CustomAvailabilityZoneName; } - if (input.ExistingVpnId !== undefined) { + if (input.ExistingVpnId !== undefined && input.ExistingVpnId !== null) { entries["ExistingVpnId"] = input.ExistingVpnId; } - if (input.NewVpnTunnelName !== undefined) { + if (input.NewVpnTunnelName !== undefined && input.NewVpnTunnelName !== null) { entries["NewVpnTunnelName"] = input.NewVpnTunnelName; } - if (input.VpnTunnelOriginatorIP !== undefined) { + if (input.VpnTunnelOriginatorIP !== undefined && input.VpnTunnelOriginatorIP !== null) { entries["VpnTunnelOriginatorIP"] = input.VpnTunnelOriginatorIP; } return entries; @@ -15238,30 +15256,30 @@ const serializeAws_queryCreateDBClusterEndpointMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.DBClusterEndpointIdentifier !== undefined) { + if (input.DBClusterEndpointIdentifier !== undefined && input.DBClusterEndpointIdentifier !== null) { entries["DBClusterEndpointIdentifier"] = input.DBClusterEndpointIdentifier; } - if (input.EndpointType !== undefined) { + if (input.EndpointType !== undefined && input.EndpointType !== null) { entries["EndpointType"] = input.EndpointType; } - if (input.StaticMembers !== undefined) { + if (input.StaticMembers !== undefined && input.StaticMembers !== null) { const memberEntries = serializeAws_queryStringList(input.StaticMembers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StaticMembers.${key}`; entries[loc] = value; }); } - if (input.ExcludedMembers !== undefined) { + if (input.ExcludedMembers !== undefined && input.ExcludedMembers !== null) { const memberEntries = serializeAws_queryStringList(input.ExcludedMembers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExcludedMembers.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15273,123 +15291,123 @@ const serializeAws_queryCreateDBClusterEndpointMessage = ( const serializeAws_queryCreateDBClusterMessage = (input: CreateDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.CharacterSetName !== undefined) { + if (input.CharacterSetName !== undefined && input.CharacterSetName !== null) { entries["CharacterSetName"] = input.CharacterSetName; } - if (input.DatabaseName !== undefined) { + if (input.DatabaseName !== undefined && input.DatabaseName !== null) { entries["DatabaseName"] = input.DatabaseName; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.MasterUsername !== undefined) { + if (input.MasterUsername !== undefined && input.MasterUsername !== null) { entries["MasterUsername"] = input.MasterUsername; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.ReplicationSourceIdentifier !== undefined) { + if (input.ReplicationSourceIdentifier !== undefined && input.ReplicationSourceIdentifier !== null) { entries["ReplicationSourceIdentifier"] = input.ReplicationSourceIdentifier; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.StorageEncrypted !== undefined) { + if (input.StorageEncrypted !== undefined && input.StorageEncrypted !== null) { entries["StorageEncrypted"] = input.StorageEncrypted; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.PreSignedUrl !== undefined) { + if (input.PreSignedUrl !== undefined && input.PreSignedUrl !== null) { entries["PreSignedUrl"] = input.PreSignedUrl; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.BacktrackWindow !== undefined) { + if (input.BacktrackWindow !== undefined && input.BacktrackWindow !== null) { entries["BacktrackWindow"] = input.BacktrackWindow; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.EngineMode !== undefined) { + if (input.EngineMode !== undefined && input.EngineMode !== null) { entries["EngineMode"] = input.EngineMode; } - if (input.ScalingConfiguration !== undefined) { + if (input.ScalingConfiguration !== undefined && input.ScalingConfiguration !== null) { const memberEntries = serializeAws_queryScalingConfiguration(input.ScalingConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScalingConfiguration.${key}`; entries[loc] = value; }); } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.GlobalClusterIdentifier !== undefined) { + if (input.GlobalClusterIdentifier !== undefined && input.GlobalClusterIdentifier !== null) { entries["GlobalClusterIdentifier"] = input.GlobalClusterIdentifier; } - if (input.EnableHttpEndpoint !== undefined) { + if (input.EnableHttpEndpoint !== undefined && input.EnableHttpEndpoint !== null) { entries["EnableHttpEndpoint"] = input.EnableHttpEndpoint; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } - if (input.EnableGlobalWriteForwarding !== undefined) { + if (input.EnableGlobalWriteForwarding !== undefined && input.EnableGlobalWriteForwarding !== null) { entries["EnableGlobalWriteForwarding"] = input.EnableGlobalWriteForwarding; } return entries; @@ -15400,16 +15418,16 @@ const serializeAws_queryCreateDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15424,13 +15442,13 @@ const serializeAws_queryCreateDBClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15442,165 +15460,165 @@ const serializeAws_queryCreateDBClusterSnapshotMessage = ( const serializeAws_queryCreateDBInstanceMessage = (input: CreateDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBName !== undefined) { + if (input.DBName !== undefined && input.DBName !== null) { entries["DBName"] = input.DBName; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.AllocatedStorage !== undefined) { + if (input.AllocatedStorage !== undefined && input.AllocatedStorage !== null) { entries["AllocatedStorage"] = input.AllocatedStorage; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.MasterUsername !== undefined) { + if (input.MasterUsername !== undefined && input.MasterUsername !== null) { entries["MasterUsername"] = input.MasterUsername; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.DBSecurityGroups !== undefined) { + if (input.DBSecurityGroups !== undefined && input.DBSecurityGroups !== null) { const memberEntries = serializeAws_queryDBSecurityGroupNameList(input.DBSecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBSecurityGroups.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.CharacterSetName !== undefined) { + if (input.CharacterSetName !== undefined && input.CharacterSetName !== null) { entries["CharacterSetName"] = input.CharacterSetName; } - if (input.NcharCharacterSetName !== undefined) { + if (input.NcharCharacterSetName !== undefined && input.NcharCharacterSetName !== null) { entries["NcharCharacterSetName"] = input.NcharCharacterSetName; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.StorageType !== undefined) { + if (input.StorageType !== undefined && input.StorageType !== null) { entries["StorageType"] = input.StorageType; } - if (input.TdeCredentialArn !== undefined) { + if (input.TdeCredentialArn !== undefined && input.TdeCredentialArn !== null) { entries["TdeCredentialArn"] = input.TdeCredentialArn; } - if (input.TdeCredentialPassword !== undefined) { + if (input.TdeCredentialPassword !== undefined && input.TdeCredentialPassword !== null) { entries["TdeCredentialPassword"] = input.TdeCredentialPassword; } - if (input.StorageEncrypted !== undefined) { + if (input.StorageEncrypted !== undefined && input.StorageEncrypted !== null) { entries["StorageEncrypted"] = input.StorageEncrypted; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.MonitoringInterval !== undefined) { + if (input.MonitoringInterval !== undefined && input.MonitoringInterval !== null) { entries["MonitoringInterval"] = input.MonitoringInterval; } - if (input.MonitoringRoleArn !== undefined) { + if (input.MonitoringRoleArn !== undefined && input.MonitoringRoleArn !== null) { entries["MonitoringRoleArn"] = input.MonitoringRoleArn; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } - if (input.PromotionTier !== undefined) { + if (input.PromotionTier !== undefined && input.PromotionTier !== null) { entries["PromotionTier"] = input.PromotionTier; } - if (input.Timezone !== undefined) { + if (input.Timezone !== undefined && input.Timezone !== null) { entries["Timezone"] = input.Timezone; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.EnablePerformanceInsights !== undefined) { + if (input.EnablePerformanceInsights !== undefined && input.EnablePerformanceInsights !== null) { entries["EnablePerformanceInsights"] = input.EnablePerformanceInsights; } - if (input.PerformanceInsightsKMSKeyId !== undefined) { + if (input.PerformanceInsightsKMSKeyId !== undefined && input.PerformanceInsightsKMSKeyId !== null) { entries["PerformanceInsightsKMSKeyId"] = input.PerformanceInsightsKMSKeyId; } - if (input.PerformanceInsightsRetentionPeriod !== undefined) { + if (input.PerformanceInsightsRetentionPeriod !== undefined && input.PerformanceInsightsRetentionPeriod !== null) { entries["PerformanceInsightsRetentionPeriod"] = input.PerformanceInsightsRetentionPeriod; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.ProcessorFeatures !== undefined) { + if (input.ProcessorFeatures !== undefined && input.ProcessorFeatures !== null) { const memberEntries = serializeAws_queryProcessorFeatureList(input.ProcessorFeatures, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProcessorFeatures.${key}`; entries[loc] = value; }); } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.MaxAllocatedStorage !== undefined) { + if (input.MaxAllocatedStorage !== undefined && input.MaxAllocatedStorage !== null) { entries["MaxAllocatedStorage"] = input.MaxAllocatedStorage; } return entries; @@ -15611,116 +15629,116 @@ const serializeAws_queryCreateDBInstanceReadReplicaMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.SourceDBInstanceIdentifier !== undefined) { + if (input.SourceDBInstanceIdentifier !== undefined && input.SourceDBInstanceIdentifier !== null) { entries["SourceDBInstanceIdentifier"] = input.SourceDBInstanceIdentifier; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.StorageType !== undefined) { + if (input.StorageType !== undefined && input.StorageType !== null) { entries["StorageType"] = input.StorageType; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.MonitoringInterval !== undefined) { + if (input.MonitoringInterval !== undefined && input.MonitoringInterval !== null) { entries["MonitoringInterval"] = input.MonitoringInterval; } - if (input.MonitoringRoleArn !== undefined) { + if (input.MonitoringRoleArn !== undefined && input.MonitoringRoleArn !== null) { entries["MonitoringRoleArn"] = input.MonitoringRoleArn; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.PreSignedUrl !== undefined) { + if (input.PreSignedUrl !== undefined && input.PreSignedUrl !== null) { entries["PreSignedUrl"] = input.PreSignedUrl; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.EnablePerformanceInsights !== undefined) { + if (input.EnablePerformanceInsights !== undefined && input.EnablePerformanceInsights !== null) { entries["EnablePerformanceInsights"] = input.EnablePerformanceInsights; } - if (input.PerformanceInsightsKMSKeyId !== undefined) { + if (input.PerformanceInsightsKMSKeyId !== undefined && input.PerformanceInsightsKMSKeyId !== null) { entries["PerformanceInsightsKMSKeyId"] = input.PerformanceInsightsKMSKeyId; } - if (input.PerformanceInsightsRetentionPeriod !== undefined) { + if (input.PerformanceInsightsRetentionPeriod !== undefined && input.PerformanceInsightsRetentionPeriod !== null) { entries["PerformanceInsightsRetentionPeriod"] = input.PerformanceInsightsRetentionPeriod; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.ProcessorFeatures !== undefined) { + if (input.ProcessorFeatures !== undefined && input.ProcessorFeatures !== null) { const memberEntries = serializeAws_queryProcessorFeatureList(input.ProcessorFeatures, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProcessorFeatures.${key}`; entries[loc] = value; }); } - if (input.UseDefaultProcessorFeatures !== undefined) { + if (input.UseDefaultProcessorFeatures !== undefined && input.UseDefaultProcessorFeatures !== null) { entries["UseDefaultProcessorFeatures"] = input.UseDefaultProcessorFeatures; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } - if (input.ReplicaMode !== undefined) { + if (input.ReplicaMode !== undefined && input.ReplicaMode !== null) { entries["ReplicaMode"] = input.ReplicaMode; } - if (input.MaxAllocatedStorage !== undefined) { + if (input.MaxAllocatedStorage !== undefined && input.MaxAllocatedStorage !== null) { entries["MaxAllocatedStorage"] = input.MaxAllocatedStorage; } return entries; @@ -15731,16 +15749,16 @@ const serializeAws_queryCreateDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15752,46 +15770,46 @@ const serializeAws_queryCreateDBParameterGroupMessage = ( const serializeAws_queryCreateDBProxyRequest = (input: CreateDBProxyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBProxyName !== undefined) { + if (input.DBProxyName !== undefined && input.DBProxyName !== null) { entries["DBProxyName"] = input.DBProxyName; } - if (input.EngineFamily !== undefined) { + if (input.EngineFamily !== undefined && input.EngineFamily !== null) { entries["EngineFamily"] = input.EngineFamily; } - if (input.Auth !== undefined) { + if (input.Auth !== undefined && input.Auth !== null) { const memberEntries = serializeAws_queryUserAuthConfigList(input.Auth, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Auth.${key}`; entries[loc] = value; }); } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.VpcSubnetIds !== undefined) { + if (input.VpcSubnetIds !== undefined && input.VpcSubnetIds !== null) { const memberEntries = serializeAws_queryStringList(input.VpcSubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSubnetIds.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryStringList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.RequireTLS !== undefined) { + if (input.RequireTLS !== undefined && input.RequireTLS !== null) { entries["RequireTLS"] = input.RequireTLS; } - if (input.IdleClientTimeout !== undefined) { + if (input.IdleClientTimeout !== undefined && input.IdleClientTimeout !== null) { entries["IdleClientTimeout"] = input.IdleClientTimeout; } - if (input.DebugLogging !== undefined) { + if (input.DebugLogging !== undefined && input.DebugLogging !== null) { entries["DebugLogging"] = input.DebugLogging; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15806,13 +15824,13 @@ const serializeAws_queryCreateDBSecurityGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSecurityGroupName !== undefined) { + if (input.DBSecurityGroupName !== undefined && input.DBSecurityGroupName !== null) { entries["DBSecurityGroupName"] = input.DBSecurityGroupName; } - if (input.DBSecurityGroupDescription !== undefined) { + if (input.DBSecurityGroupDescription !== undefined && input.DBSecurityGroupDescription !== null) { entries["DBSecurityGroupDescription"] = input.DBSecurityGroupDescription; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15824,13 +15842,13 @@ const serializeAws_queryCreateDBSecurityGroupMessage = ( const serializeAws_queryCreateDBSnapshotMessage = (input: CreateDBSnapshotMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBSnapshotIdentifier !== undefined) { + if (input.DBSnapshotIdentifier !== undefined && input.DBSnapshotIdentifier !== null) { entries["DBSnapshotIdentifier"] = input.DBSnapshotIdentifier; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15845,20 +15863,20 @@ const serializeAws_queryCreateDBSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.DBSubnetGroupDescription !== undefined) { + if (input.DBSubnetGroupDescription !== undefined && input.DBSubnetGroupDescription !== null) { entries["DBSubnetGroupDescription"] = input.DBSubnetGroupDescription; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15873,33 +15891,33 @@ const serializeAws_queryCreateEventSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.SnsTopicArn !== undefined) { + if (input.SnsTopicArn !== undefined && input.SnsTopicArn !== null) { entries["SnsTopicArn"] = input.SnsTopicArn; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.EventCategories !== undefined) { + if (input.EventCategories !== undefined && input.EventCategories !== null) { const memberEntries = serializeAws_queryEventCategoriesList(input.EventCategories, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventCategories.${key}`; entries[loc] = value; }); } - if (input.SourceIds !== undefined) { + if (input.SourceIds !== undefined && input.SourceIds !== null) { const memberEntries = serializeAws_querySourceIdsList(input.SourceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceIds.${key}`; entries[loc] = value; }); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15914,25 +15932,25 @@ const serializeAws_queryCreateGlobalClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalClusterIdentifier !== undefined) { + if (input.GlobalClusterIdentifier !== undefined && input.GlobalClusterIdentifier !== null) { entries["GlobalClusterIdentifier"] = input.GlobalClusterIdentifier; } - if (input.SourceDBClusterIdentifier !== undefined) { + if (input.SourceDBClusterIdentifier !== undefined && input.SourceDBClusterIdentifier !== null) { entries["SourceDBClusterIdentifier"] = input.SourceDBClusterIdentifier; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.DatabaseName !== undefined) { + if (input.DatabaseName !== undefined && input.DatabaseName !== null) { entries["DatabaseName"] = input.DatabaseName; } - if (input.StorageEncrypted !== undefined) { + if (input.StorageEncrypted !== undefined && input.StorageEncrypted !== null) { entries["StorageEncrypted"] = input.StorageEncrypted; } return entries; @@ -15940,19 +15958,19 @@ const serializeAws_queryCreateGlobalClusterMessage = ( const serializeAws_queryCreateOptionGroupMessage = (input: CreateOptionGroupMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.EngineName !== undefined) { + if (input.EngineName !== undefined && input.EngineName !== null) { entries["EngineName"] = input.EngineName; } - if (input.MajorEngineVersion !== undefined) { + if (input.MajorEngineVersion !== undefined && input.MajorEngineVersion !== null) { entries["MajorEngineVersion"] = input.MajorEngineVersion; } - if (input.OptionGroupDescription !== undefined) { + if (input.OptionGroupDescription !== undefined && input.OptionGroupDescription !== null) { entries["OptionGroupDescription"] = input.OptionGroupDescription; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -15966,6 +15984,9 @@ const serializeAws_queryDBSecurityGroupNameList = (input: string[], context: __S const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`DBSecurityGroupName.${counter}`] = entry; counter++; } @@ -15977,7 +15998,7 @@ const serializeAws_queryDeleteCustomAvailabilityZoneMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CustomAvailabilityZoneId !== undefined) { + if (input.CustomAvailabilityZoneId !== undefined && input.CustomAvailabilityZoneId !== null) { entries["CustomAvailabilityZoneId"] = input.CustomAvailabilityZoneId; } return entries; @@ -15988,7 +16009,7 @@ const serializeAws_queryDeleteDBClusterEndpointMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterEndpointIdentifier !== undefined) { + if (input.DBClusterEndpointIdentifier !== undefined && input.DBClusterEndpointIdentifier !== null) { entries["DBClusterEndpointIdentifier"] = input.DBClusterEndpointIdentifier; } return entries; @@ -15996,13 +16017,13 @@ const serializeAws_queryDeleteDBClusterEndpointMessage = ( const serializeAws_queryDeleteDBClusterMessage = (input: DeleteDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.SkipFinalSnapshot !== undefined) { + if (input.SkipFinalSnapshot !== undefined && input.SkipFinalSnapshot !== null) { entries["SkipFinalSnapshot"] = input.SkipFinalSnapshot; } - if (input.FinalDBSnapshotIdentifier !== undefined) { + if (input.FinalDBSnapshotIdentifier !== undefined && input.FinalDBSnapshotIdentifier !== null) { entries["FinalDBSnapshotIdentifier"] = input.FinalDBSnapshotIdentifier; } return entries; @@ -16013,7 +16034,7 @@ const serializeAws_queryDeleteDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } return entries; @@ -16024,7 +16045,7 @@ const serializeAws_queryDeleteDBClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } return entries; @@ -16035,10 +16056,10 @@ const serializeAws_queryDeleteDBInstanceAutomatedBackupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DbiResourceId !== undefined) { + if (input.DbiResourceId !== undefined && input.DbiResourceId !== null) { entries["DbiResourceId"] = input.DbiResourceId; } - if (input.DBInstanceAutomatedBackupsArn !== undefined) { + if (input.DBInstanceAutomatedBackupsArn !== undefined && input.DBInstanceAutomatedBackupsArn !== null) { entries["DBInstanceAutomatedBackupsArn"] = input.DBInstanceAutomatedBackupsArn; } return entries; @@ -16046,16 +16067,16 @@ const serializeAws_queryDeleteDBInstanceAutomatedBackupMessage = ( const serializeAws_queryDeleteDBInstanceMessage = (input: DeleteDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.SkipFinalSnapshot !== undefined) { + if (input.SkipFinalSnapshot !== undefined && input.SkipFinalSnapshot !== null) { entries["SkipFinalSnapshot"] = input.SkipFinalSnapshot; } - if (input.FinalDBSnapshotIdentifier !== undefined) { + if (input.FinalDBSnapshotIdentifier !== undefined && input.FinalDBSnapshotIdentifier !== null) { entries["FinalDBSnapshotIdentifier"] = input.FinalDBSnapshotIdentifier; } - if (input.DeleteAutomatedBackups !== undefined) { + if (input.DeleteAutomatedBackups !== undefined && input.DeleteAutomatedBackups !== null) { entries["DeleteAutomatedBackups"] = input.DeleteAutomatedBackups; } return entries; @@ -16066,7 +16087,7 @@ const serializeAws_queryDeleteDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } return entries; @@ -16074,7 +16095,7 @@ const serializeAws_queryDeleteDBParameterGroupMessage = ( const serializeAws_queryDeleteDBProxyRequest = (input: DeleteDBProxyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBProxyName !== undefined) { + if (input.DBProxyName !== undefined && input.DBProxyName !== null) { entries["DBProxyName"] = input.DBProxyName; } return entries; @@ -16085,7 +16106,7 @@ const serializeAws_queryDeleteDBSecurityGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSecurityGroupName !== undefined) { + if (input.DBSecurityGroupName !== undefined && input.DBSecurityGroupName !== null) { entries["DBSecurityGroupName"] = input.DBSecurityGroupName; } return entries; @@ -16093,7 +16114,7 @@ const serializeAws_queryDeleteDBSecurityGroupMessage = ( const serializeAws_queryDeleteDBSnapshotMessage = (input: DeleteDBSnapshotMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBSnapshotIdentifier !== undefined) { + if (input.DBSnapshotIdentifier !== undefined && input.DBSnapshotIdentifier !== null) { entries["DBSnapshotIdentifier"] = input.DBSnapshotIdentifier; } return entries; @@ -16104,7 +16125,7 @@ const serializeAws_queryDeleteDBSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } return entries; @@ -16115,7 +16136,7 @@ const serializeAws_queryDeleteEventSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } return entries; @@ -16126,7 +16147,7 @@ const serializeAws_queryDeleteGlobalClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalClusterIdentifier !== undefined) { + if (input.GlobalClusterIdentifier !== undefined && input.GlobalClusterIdentifier !== null) { entries["GlobalClusterIdentifier"] = input.GlobalClusterIdentifier; } return entries; @@ -16137,7 +16158,7 @@ const serializeAws_queryDeleteInstallationMediaMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstallationMediaId !== undefined) { + if (input.InstallationMediaId !== undefined && input.InstallationMediaId !== null) { entries["InstallationMediaId"] = input.InstallationMediaId; } return entries; @@ -16145,7 +16166,7 @@ const serializeAws_queryDeleteInstallationMediaMessage = ( const serializeAws_queryDeleteOptionGroupMessage = (input: DeleteOptionGroupMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } return entries; @@ -16156,20 +16177,20 @@ const serializeAws_queryDeregisterDBProxyTargetsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBProxyName !== undefined) { + if (input.DBProxyName !== undefined && input.DBProxyName !== null) { entries["DBProxyName"] = input.DBProxyName; } - if (input.TargetGroupName !== undefined) { + if (input.TargetGroupName !== undefined && input.TargetGroupName !== null) { entries["TargetGroupName"] = input.TargetGroupName; } - if (input.DBInstanceIdentifiers !== undefined) { + if (input.DBInstanceIdentifiers !== undefined && input.DBInstanceIdentifiers !== null) { const memberEntries = serializeAws_queryStringList(input.DBInstanceIdentifiers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBInstanceIdentifiers.${key}`; entries[loc] = value; }); } - if (input.DBClusterIdentifiers !== undefined) { + if (input.DBClusterIdentifiers !== undefined && input.DBClusterIdentifiers !== null) { const memberEntries = serializeAws_queryStringList(input.DBClusterIdentifiers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBClusterIdentifiers.${key}`; @@ -16192,20 +16213,20 @@ const serializeAws_queryDescribeCertificatesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CertificateIdentifier !== undefined) { + if (input.CertificateIdentifier !== undefined && input.CertificateIdentifier !== null) { entries["CertificateIdentifier"] = input.CertificateIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16216,20 +16237,20 @@ const serializeAws_queryDescribeCustomAvailabilityZonesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CustomAvailabilityZoneId !== undefined) { + if (input.CustomAvailabilityZoneId !== undefined && input.CustomAvailabilityZoneId !== null) { entries["CustomAvailabilityZoneId"] = input.CustomAvailabilityZoneId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16240,23 +16261,23 @@ const serializeAws_queryDescribeDBClusterBacktracksMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.BacktrackIdentifier !== undefined) { + if (input.BacktrackIdentifier !== undefined && input.BacktrackIdentifier !== null) { entries["BacktrackIdentifier"] = input.BacktrackIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16267,23 +16288,23 @@ const serializeAws_queryDescribeDBClusterEndpointsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.DBClusterEndpointIdentifier !== undefined) { + if (input.DBClusterEndpointIdentifier !== undefined && input.DBClusterEndpointIdentifier !== null) { entries["DBClusterEndpointIdentifier"] = input.DBClusterEndpointIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16294,20 +16315,20 @@ const serializeAws_queryDescribeDBClusterParameterGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16318,23 +16339,23 @@ const serializeAws_queryDescribeDBClusterParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16345,23 +16366,23 @@ const serializeAws_queryDescribeDBClustersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.IncludeShared !== undefined) { + if (input.IncludeShared !== undefined && input.IncludeShared !== null) { entries["IncludeShared"] = input.IncludeShared; } return entries; @@ -16372,7 +16393,7 @@ const serializeAws_queryDescribeDBClusterSnapshotAttributesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } return entries; @@ -16383,32 +16404,32 @@ const serializeAws_queryDescribeDBClusterSnapshotsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } - if (input.SnapshotType !== undefined) { + if (input.SnapshotType !== undefined && input.SnapshotType !== null) { entries["SnapshotType"] = input.SnapshotType; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.IncludeShared !== undefined) { + if (input.IncludeShared !== undefined && input.IncludeShared !== null) { entries["IncludeShared"] = input.IncludeShared; } - if (input.IncludePublic !== undefined) { + if (input.IncludePublic !== undefined && input.IncludePublic !== null) { entries["IncludePublic"] = input.IncludePublic; } return entries; @@ -16419,38 +16440,38 @@ const serializeAws_queryDescribeDBEngineVersionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.DefaultOnly !== undefined) { + if (input.DefaultOnly !== undefined && input.DefaultOnly !== null) { entries["DefaultOnly"] = input.DefaultOnly; } - if (input.ListSupportedCharacterSets !== undefined) { + if (input.ListSupportedCharacterSets !== undefined && input.ListSupportedCharacterSets !== null) { entries["ListSupportedCharacterSets"] = input.ListSupportedCharacterSets; } - if (input.ListSupportedTimezones !== undefined) { + if (input.ListSupportedTimezones !== undefined && input.ListSupportedTimezones !== null) { entries["ListSupportedTimezones"] = input.ListSupportedTimezones; } - if (input.IncludeAll !== undefined) { + if (input.IncludeAll !== undefined && input.IncludeAll !== null) { entries["IncludeAll"] = input.IncludeAll; } return entries; @@ -16461,26 +16482,26 @@ const serializeAws_queryDescribeDBInstanceAutomatedBackupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DbiResourceId !== undefined) { + if (input.DbiResourceId !== undefined && input.DbiResourceId !== null) { entries["DbiResourceId"] = input.DbiResourceId; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.DBInstanceAutomatedBackupsArn !== undefined) { + if (input.DBInstanceAutomatedBackupsArn !== undefined && input.DBInstanceAutomatedBackupsArn !== null) { entries["DBInstanceAutomatedBackupsArn"] = input.DBInstanceAutomatedBackupsArn; } return entries; @@ -16491,20 +16512,20 @@ const serializeAws_queryDescribeDBInstancesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16515,29 +16536,29 @@ const serializeAws_queryDescribeDBLogFilesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.FilenameContains !== undefined) { + if (input.FilenameContains !== undefined && input.FilenameContains !== null) { entries["FilenameContains"] = input.FilenameContains; } - if (input.FileLastWritten !== undefined) { + if (input.FileLastWritten !== undefined && input.FileLastWritten !== null) { entries["FileLastWritten"] = input.FileLastWritten; } - if (input.FileSize !== undefined) { + if (input.FileSize !== undefined && input.FileSize !== null) { entries["FileSize"] = input.FileSize; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16548,20 +16569,20 @@ const serializeAws_queryDescribeDBParameterGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16572,23 +16593,23 @@ const serializeAws_queryDescribeDBParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16596,20 +16617,20 @@ const serializeAws_queryDescribeDBParametersMessage = ( const serializeAws_queryDescribeDBProxiesRequest = (input: DescribeDBProxiesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBProxyName !== undefined) { + if (input.DBProxyName !== undefined && input.DBProxyName !== null) { entries["DBProxyName"] = input.DBProxyName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -16620,23 +16641,23 @@ const serializeAws_queryDescribeDBProxyTargetGroupsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBProxyName !== undefined) { + if (input.DBProxyName !== undefined && input.DBProxyName !== null) { entries["DBProxyName"] = input.DBProxyName; } - if (input.TargetGroupName !== undefined) { + if (input.TargetGroupName !== undefined && input.TargetGroupName !== null) { entries["TargetGroupName"] = input.TargetGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -16647,23 +16668,23 @@ const serializeAws_queryDescribeDBProxyTargetsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBProxyName !== undefined) { + if (input.DBProxyName !== undefined && input.DBProxyName !== null) { entries["DBProxyName"] = input.DBProxyName; } - if (input.TargetGroupName !== undefined) { + if (input.TargetGroupName !== undefined && input.TargetGroupName !== null) { entries["TargetGroupName"] = input.TargetGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -16674,20 +16695,20 @@ const serializeAws_queryDescribeDBSecurityGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSecurityGroupName !== undefined) { + if (input.DBSecurityGroupName !== undefined && input.DBSecurityGroupName !== null) { entries["DBSecurityGroupName"] = input.DBSecurityGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16698,7 +16719,7 @@ const serializeAws_queryDescribeDBSnapshotAttributesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSnapshotIdentifier !== undefined) { + if (input.DBSnapshotIdentifier !== undefined && input.DBSnapshotIdentifier !== null) { entries["DBSnapshotIdentifier"] = input.DBSnapshotIdentifier; } return entries; @@ -16709,35 +16730,35 @@ const serializeAws_queryDescribeDBSnapshotsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.DBSnapshotIdentifier !== undefined) { + if (input.DBSnapshotIdentifier !== undefined && input.DBSnapshotIdentifier !== null) { entries["DBSnapshotIdentifier"] = input.DBSnapshotIdentifier; } - if (input.SnapshotType !== undefined) { + if (input.SnapshotType !== undefined && input.SnapshotType !== null) { entries["SnapshotType"] = input.SnapshotType; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.IncludeShared !== undefined) { + if (input.IncludeShared !== undefined && input.IncludeShared !== null) { entries["IncludeShared"] = input.IncludeShared; } - if (input.IncludePublic !== undefined) { + if (input.IncludePublic !== undefined && input.IncludePublic !== null) { entries["IncludePublic"] = input.IncludePublic; } - if (input.DbiResourceId !== undefined) { + if (input.DbiResourceId !== undefined && input.DbiResourceId !== null) { entries["DbiResourceId"] = input.DbiResourceId; } return entries; @@ -16748,20 +16769,20 @@ const serializeAws_queryDescribeDBSubnetGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16772,20 +16793,20 @@ const serializeAws_queryDescribeEngineDefaultClusterParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16796,20 +16817,20 @@ const serializeAws_queryDescribeEngineDefaultParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupFamily !== undefined) { + if (input.DBParameterGroupFamily !== undefined && input.DBParameterGroupFamily !== null) { entries["DBParameterGroupFamily"] = input.DBParameterGroupFamily; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16820,10 +16841,10 @@ const serializeAws_queryDescribeEventCategoriesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -16835,39 +16856,39 @@ const serializeAws_queryDescribeEventCategoriesMessage = ( const serializeAws_queryDescribeEventsMessage = (input: DescribeEventsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SourceIdentifier !== undefined) { + if (input.SourceIdentifier !== undefined && input.SourceIdentifier !== null) { entries["SourceIdentifier"] = input.SourceIdentifier; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Duration !== undefined) { + if (input.Duration !== undefined && input.Duration !== null) { entries["Duration"] = input.Duration; } - if (input.EventCategories !== undefined) { + if (input.EventCategories !== undefined && input.EventCategories !== null) { const memberEntries = serializeAws_queryEventCategoriesList(input.EventCategories, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventCategories.${key}`; entries[loc] = value; }); } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16878,20 +16899,20 @@ const serializeAws_queryDescribeEventSubscriptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16902,23 +16923,23 @@ const serializeAws_queryDescribeExportTasksMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ExportTaskIdentifier !== undefined) { + if (input.ExportTaskIdentifier !== undefined && input.ExportTaskIdentifier !== null) { entries["ExportTaskIdentifier"] = input.ExportTaskIdentifier; } - if (input.SourceArn !== undefined) { + if (input.SourceArn !== undefined && input.SourceArn !== null) { entries["SourceArn"] = input.SourceArn; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -16929,20 +16950,20 @@ const serializeAws_queryDescribeGlobalClustersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalClusterIdentifier !== undefined) { + if (input.GlobalClusterIdentifier !== undefined && input.GlobalClusterIdentifier !== null) { entries["GlobalClusterIdentifier"] = input.GlobalClusterIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16953,20 +16974,20 @@ const serializeAws_queryDescribeInstallationMediaMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.InstallationMediaId !== undefined) { + if (input.InstallationMediaId !== undefined && input.InstallationMediaId !== null) { entries["InstallationMediaId"] = input.InstallationMediaId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -16977,23 +16998,23 @@ const serializeAws_queryDescribeOptionGroupOptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EngineName !== undefined) { + if (input.EngineName !== undefined && input.EngineName !== null) { entries["EngineName"] = input.EngineName; } - if (input.MajorEngineVersion !== undefined) { + if (input.MajorEngineVersion !== undefined && input.MajorEngineVersion !== null) { entries["MajorEngineVersion"] = input.MajorEngineVersion; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -17004,26 +17025,26 @@ const serializeAws_queryDescribeOptionGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.EngineName !== undefined) { + if (input.EngineName !== undefined && input.EngineName !== null) { entries["EngineName"] = input.EngineName; } - if (input.MajorEngineVersion !== undefined) { + if (input.MajorEngineVersion !== undefined && input.MajorEngineVersion !== null) { entries["MajorEngineVersion"] = input.MajorEngineVersion; } return entries; @@ -17034,35 +17055,35 @@ const serializeAws_queryDescribeOrderableDBInstanceOptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } - if (input.AvailabilityZoneGroup !== undefined) { + if (input.AvailabilityZoneGroup !== undefined && input.AvailabilityZoneGroup !== null) { entries["AvailabilityZoneGroup"] = input.AvailabilityZoneGroup; } - if (input.Vpc !== undefined) { + if (input.Vpc !== undefined && input.Vpc !== null) { entries["Vpc"] = input.Vpc; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -17073,20 +17094,20 @@ const serializeAws_queryDescribePendingMaintenanceActionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceIdentifier !== undefined) { + if (input.ResourceIdentifier !== undefined && input.ResourceIdentifier !== null) { entries["ResourceIdentifier"] = input.ResourceIdentifier; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -17097,41 +17118,41 @@ const serializeAws_queryDescribeReservedDBInstancesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedDBInstanceId !== undefined) { + if (input.ReservedDBInstanceId !== undefined && input.ReservedDBInstanceId !== null) { entries["ReservedDBInstanceId"] = input.ReservedDBInstanceId; } - if (input.ReservedDBInstancesOfferingId !== undefined) { + if (input.ReservedDBInstancesOfferingId !== undefined && input.ReservedDBInstancesOfferingId !== null) { entries["ReservedDBInstancesOfferingId"] = input.ReservedDBInstancesOfferingId; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.Duration !== undefined) { + if (input.Duration !== undefined && input.Duration !== null) { entries["Duration"] = input.Duration; } - if (input.ProductDescription !== undefined) { + if (input.ProductDescription !== undefined && input.ProductDescription !== null) { entries["ProductDescription"] = input.ProductDescription; } - if (input.OfferingType !== undefined) { + if (input.OfferingType !== undefined && input.OfferingType !== null) { entries["OfferingType"] = input.OfferingType; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.LeaseId !== undefined) { + if (input.LeaseId !== undefined && input.LeaseId !== null) { entries["LeaseId"] = input.LeaseId; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -17142,35 +17163,35 @@ const serializeAws_queryDescribeReservedDBInstancesOfferingsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedDBInstancesOfferingId !== undefined) { + if (input.ReservedDBInstancesOfferingId !== undefined && input.ReservedDBInstancesOfferingId !== null) { entries["ReservedDBInstancesOfferingId"] = input.ReservedDBInstancesOfferingId; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.Duration !== undefined) { + if (input.Duration !== undefined && input.Duration !== null) { entries["Duration"] = input.Duration; } - if (input.ProductDescription !== undefined) { + if (input.ProductDescription !== undefined && input.ProductDescription !== null) { entries["ProductDescription"] = input.ProductDescription; } - if (input.OfferingType !== undefined) { + if (input.OfferingType !== undefined && input.OfferingType !== null) { entries["OfferingType"] = input.OfferingType; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -17181,16 +17202,16 @@ const serializeAws_queryDescribeSourceRegionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RegionName !== undefined) { + if (input.RegionName !== undefined && input.RegionName !== null) { entries["RegionName"] = input.RegionName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -17205,7 +17226,7 @@ const serializeAws_queryDescribeValidDBInstanceModificationsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } return entries; @@ -17216,16 +17237,16 @@ const serializeAws_queryDownloadDBLogFilePortionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.LogFileName !== undefined) { + if (input.LogFileName !== undefined && input.LogFileName !== null) { entries["LogFileName"] = input.LogFileName; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.NumberOfLines !== undefined) { + if (input.NumberOfLines !== undefined && input.NumberOfLines !== null) { entries["NumberOfLines"] = input.NumberOfLines; } return entries; @@ -17235,6 +17256,9 @@ const serializeAws_queryEngineModeList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -17245,6 +17269,9 @@ const serializeAws_queryEventCategoriesList = (input: string[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`EventCategory.${counter}`] = entry; counter++; } @@ -17253,10 +17280,10 @@ const serializeAws_queryEventCategoriesList = (input: string[], context: __Serde const serializeAws_queryFailoverDBClusterMessage = (input: FailoverDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.TargetDBInstanceIdentifier !== undefined) { + if (input.TargetDBInstanceIdentifier !== undefined && input.TargetDBInstanceIdentifier !== null) { entries["TargetDBInstanceIdentifier"] = input.TargetDBInstanceIdentifier; } return entries; @@ -17264,10 +17291,10 @@ const serializeAws_queryFailoverDBClusterMessage = (input: FailoverDBClusterMess const serializeAws_queryFilter = (input: Filter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryFilterValueList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -17281,6 +17308,9 @@ const serializeAws_queryFilterList = (input: Filter[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Filter.${counter}.${key}`] = value; @@ -17294,6 +17324,9 @@ const serializeAws_queryFilterValueList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`Value.${counter}`] = entry; counter++; } @@ -17305,19 +17338,19 @@ const serializeAws_queryImportInstallationMediaMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CustomAvailabilityZoneId !== undefined) { + if (input.CustomAvailabilityZoneId !== undefined && input.CustomAvailabilityZoneId !== null) { entries["CustomAvailabilityZoneId"] = input.CustomAvailabilityZoneId; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.EngineInstallationMediaPath !== undefined) { + if (input.EngineInstallationMediaPath !== undefined && input.EngineInstallationMediaPath !== null) { entries["EngineInstallationMediaPath"] = input.EngineInstallationMediaPath; } - if (input.OSInstallationMediaPath !== undefined) { + if (input.OSInstallationMediaPath !== undefined && input.OSInstallationMediaPath !== null) { entries["OSInstallationMediaPath"] = input.OSInstallationMediaPath; } return entries; @@ -17327,6 +17360,9 @@ const serializeAws_queryKeyList = (input: string[], context: __SerdeContext): an const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -17338,10 +17374,10 @@ const serializeAws_queryListTagsForResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; @@ -17355,6 +17391,9 @@ const serializeAws_queryLogTypeList = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -17366,10 +17405,10 @@ const serializeAws_queryModifyCertificatesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.CertificateIdentifier !== undefined) { + if (input.CertificateIdentifier !== undefined && input.CertificateIdentifier !== null) { entries["CertificateIdentifier"] = input.CertificateIdentifier; } - if (input.RemoveCustomerOverride !== undefined) { + if (input.RemoveCustomerOverride !== undefined && input.RemoveCustomerOverride !== null) { entries["RemoveCustomerOverride"] = input.RemoveCustomerOverride; } return entries; @@ -17380,16 +17419,16 @@ const serializeAws_queryModifyCurrentDBClusterCapacityMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.Capacity !== undefined) { + if (input.Capacity !== undefined && input.Capacity !== null) { entries["Capacity"] = input.Capacity; } - if (input.SecondsBeforeTimeout !== undefined) { + if (input.SecondsBeforeTimeout !== undefined && input.SecondsBeforeTimeout !== null) { entries["SecondsBeforeTimeout"] = input.SecondsBeforeTimeout; } - if (input.TimeoutAction !== undefined) { + if (input.TimeoutAction !== undefined && input.TimeoutAction !== null) { entries["TimeoutAction"] = input.TimeoutAction; } return entries; @@ -17400,20 +17439,20 @@ const serializeAws_queryModifyDBClusterEndpointMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterEndpointIdentifier !== undefined) { + if (input.DBClusterEndpointIdentifier !== undefined && input.DBClusterEndpointIdentifier !== null) { entries["DBClusterEndpointIdentifier"] = input.DBClusterEndpointIdentifier; } - if (input.EndpointType !== undefined) { + if (input.EndpointType !== undefined && input.EndpointType !== null) { entries["EndpointType"] = input.EndpointType; } - if (input.StaticMembers !== undefined) { + if (input.StaticMembers !== undefined && input.StaticMembers !== null) { const memberEntries = serializeAws_queryStringList(input.StaticMembers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StaticMembers.${key}`; entries[loc] = value; }); } - if (input.ExcludedMembers !== undefined) { + if (input.ExcludedMembers !== undefined && input.ExcludedMembers !== null) { const memberEntries = serializeAws_queryStringList(input.ExcludedMembers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExcludedMembers.${key}`; @@ -17425,50 +17464,50 @@ const serializeAws_queryModifyDBClusterEndpointMessage = ( const serializeAws_queryModifyDBClusterMessage = (input: ModifyDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.NewDBClusterIdentifier !== undefined) { + if (input.NewDBClusterIdentifier !== undefined && input.NewDBClusterIdentifier !== null) { entries["NewDBClusterIdentifier"] = input.NewDBClusterIdentifier; } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.BacktrackWindow !== undefined) { + if (input.BacktrackWindow !== undefined && input.BacktrackWindow !== null) { entries["BacktrackWindow"] = input.BacktrackWindow; } - if (input.CloudwatchLogsExportConfiguration !== undefined) { + if (input.CloudwatchLogsExportConfiguration !== undefined && input.CloudwatchLogsExportConfiguration !== null) { const memberEntries = serializeAws_queryCloudwatchLogsExportConfiguration( input.CloudwatchLogsExportConfiguration, context @@ -17478,38 +17517,38 @@ const serializeAws_queryModifyDBClusterMessage = (input: ModifyDBClusterMessage, entries[loc] = value; }); } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.AllowMajorVersionUpgrade !== undefined) { + if (input.AllowMajorVersionUpgrade !== undefined && input.AllowMajorVersionUpgrade !== null) { entries["AllowMajorVersionUpgrade"] = input.AllowMajorVersionUpgrade; } - if (input.DBInstanceParameterGroupName !== undefined) { + if (input.DBInstanceParameterGroupName !== undefined && input.DBInstanceParameterGroupName !== null) { entries["DBInstanceParameterGroupName"] = input.DBInstanceParameterGroupName; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } - if (input.ScalingConfiguration !== undefined) { + if (input.ScalingConfiguration !== undefined && input.ScalingConfiguration !== null) { const memberEntries = serializeAws_queryScalingConfiguration(input.ScalingConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScalingConfiguration.${key}`; entries[loc] = value; }); } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.EnableHttpEndpoint !== undefined) { + if (input.EnableHttpEndpoint !== undefined && input.EnableHttpEndpoint !== null) { entries["EnableHttpEndpoint"] = input.EnableHttpEndpoint; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.EnableGlobalWriteForwarding !== undefined) { + if (input.EnableGlobalWriteForwarding !== undefined && input.EnableGlobalWriteForwarding !== null) { entries["EnableGlobalWriteForwarding"] = input.EnableGlobalWriteForwarding; } return entries; @@ -17520,10 +17559,10 @@ const serializeAws_queryModifyDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -17538,20 +17577,20 @@ const serializeAws_queryModifyDBClusterSnapshotAttributeMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterSnapshotIdentifier !== undefined) { + if (input.DBClusterSnapshotIdentifier !== undefined && input.DBClusterSnapshotIdentifier !== null) { entries["DBClusterSnapshotIdentifier"] = input.DBClusterSnapshotIdentifier; } - if (input.AttributeName !== undefined) { + if (input.AttributeName !== undefined && input.AttributeName !== null) { entries["AttributeName"] = input.AttributeName; } - if (input.ValuesToAdd !== undefined) { + if (input.ValuesToAdd !== undefined && input.ValuesToAdd !== null) { const memberEntries = serializeAws_queryAttributeValueList(input.ValuesToAdd, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ValuesToAdd.${key}`; entries[loc] = value; }); } - if (input.ValuesToRemove !== undefined) { + if (input.ValuesToRemove !== undefined && input.ValuesToRemove !== null) { const memberEntries = serializeAws_queryAttributeValueList(input.ValuesToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ValuesToRemove.${key}`; @@ -17563,123 +17602,123 @@ const serializeAws_queryModifyDBClusterSnapshotAttributeMessage = ( const serializeAws_queryModifyDBInstanceMessage = (input: ModifyDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.AllocatedStorage !== undefined) { + if (input.AllocatedStorage !== undefined && input.AllocatedStorage !== null) { entries["AllocatedStorage"] = input.AllocatedStorage; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.DBSecurityGroups !== undefined) { + if (input.DBSecurityGroups !== undefined && input.DBSecurityGroups !== null) { const memberEntries = serializeAws_queryDBSecurityGroupNameList(input.DBSecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBSecurityGroups.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.AllowMajorVersionUpgrade !== undefined) { + if (input.AllowMajorVersionUpgrade !== undefined && input.AllowMajorVersionUpgrade !== null) { entries["AllowMajorVersionUpgrade"] = input.AllowMajorVersionUpgrade; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.NewDBInstanceIdentifier !== undefined) { + if (input.NewDBInstanceIdentifier !== undefined && input.NewDBInstanceIdentifier !== null) { entries["NewDBInstanceIdentifier"] = input.NewDBInstanceIdentifier; } - if (input.StorageType !== undefined) { + if (input.StorageType !== undefined && input.StorageType !== null) { entries["StorageType"] = input.StorageType; } - if (input.TdeCredentialArn !== undefined) { + if (input.TdeCredentialArn !== undefined && input.TdeCredentialArn !== null) { entries["TdeCredentialArn"] = input.TdeCredentialArn; } - if (input.TdeCredentialPassword !== undefined) { + if (input.TdeCredentialPassword !== undefined && input.TdeCredentialPassword !== null) { entries["TdeCredentialPassword"] = input.TdeCredentialPassword; } - if (input.CACertificateIdentifier !== undefined) { + if (input.CACertificateIdentifier !== undefined && input.CACertificateIdentifier !== null) { entries["CACertificateIdentifier"] = input.CACertificateIdentifier; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.MonitoringInterval !== undefined) { + if (input.MonitoringInterval !== undefined && input.MonitoringInterval !== null) { entries["MonitoringInterval"] = input.MonitoringInterval; } - if (input.DBPortNumber !== undefined) { + if (input.DBPortNumber !== undefined && input.DBPortNumber !== null) { entries["DBPortNumber"] = input.DBPortNumber; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.MonitoringRoleArn !== undefined) { + if (input.MonitoringRoleArn !== undefined && input.MonitoringRoleArn !== null) { entries["MonitoringRoleArn"] = input.MonitoringRoleArn; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } - if (input.PromotionTier !== undefined) { + if (input.PromotionTier !== undefined && input.PromotionTier !== null) { entries["PromotionTier"] = input.PromotionTier; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.EnablePerformanceInsights !== undefined) { + if (input.EnablePerformanceInsights !== undefined && input.EnablePerformanceInsights !== null) { entries["EnablePerformanceInsights"] = input.EnablePerformanceInsights; } - if (input.PerformanceInsightsKMSKeyId !== undefined) { + if (input.PerformanceInsightsKMSKeyId !== undefined && input.PerformanceInsightsKMSKeyId !== null) { entries["PerformanceInsightsKMSKeyId"] = input.PerformanceInsightsKMSKeyId; } - if (input.PerformanceInsightsRetentionPeriod !== undefined) { + if (input.PerformanceInsightsRetentionPeriod !== undefined && input.PerformanceInsightsRetentionPeriod !== null) { entries["PerformanceInsightsRetentionPeriod"] = input.PerformanceInsightsRetentionPeriod; } - if (input.CloudwatchLogsExportConfiguration !== undefined) { + if (input.CloudwatchLogsExportConfiguration !== undefined && input.CloudwatchLogsExportConfiguration !== null) { const memberEntries = serializeAws_queryCloudwatchLogsExportConfiguration( input.CloudwatchLogsExportConfiguration, context @@ -17689,26 +17728,26 @@ const serializeAws_queryModifyDBInstanceMessage = (input: ModifyDBInstanceMessag entries[loc] = value; }); } - if (input.ProcessorFeatures !== undefined) { + if (input.ProcessorFeatures !== undefined && input.ProcessorFeatures !== null) { const memberEntries = serializeAws_queryProcessorFeatureList(input.ProcessorFeatures, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProcessorFeatures.${key}`; entries[loc] = value; }); } - if (input.UseDefaultProcessorFeatures !== undefined) { + if (input.UseDefaultProcessorFeatures !== undefined && input.UseDefaultProcessorFeatures !== null) { entries["UseDefaultProcessorFeatures"] = input.UseDefaultProcessorFeatures; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.MaxAllocatedStorage !== undefined) { + if (input.MaxAllocatedStorage !== undefined && input.MaxAllocatedStorage !== null) { entries["MaxAllocatedStorage"] = input.MaxAllocatedStorage; } - if (input.CertificateRotationRestart !== undefined) { + if (input.CertificateRotationRestart !== undefined && input.CertificateRotationRestart !== null) { entries["CertificateRotationRestart"] = input.CertificateRotationRestart; } - if (input.ReplicaMode !== undefined) { + if (input.ReplicaMode !== undefined && input.ReplicaMode !== null) { entries["ReplicaMode"] = input.ReplicaMode; } return entries; @@ -17719,10 +17758,10 @@ const serializeAws_queryModifyDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -17734,32 +17773,32 @@ const serializeAws_queryModifyDBParameterGroupMessage = ( const serializeAws_queryModifyDBProxyRequest = (input: ModifyDBProxyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBProxyName !== undefined) { + if (input.DBProxyName !== undefined && input.DBProxyName !== null) { entries["DBProxyName"] = input.DBProxyName; } - if (input.NewDBProxyName !== undefined) { + if (input.NewDBProxyName !== undefined && input.NewDBProxyName !== null) { entries["NewDBProxyName"] = input.NewDBProxyName; } - if (input.Auth !== undefined) { + if (input.Auth !== undefined && input.Auth !== null) { const memberEntries = serializeAws_queryUserAuthConfigList(input.Auth, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Auth.${key}`; entries[loc] = value; }); } - if (input.RequireTLS !== undefined) { + if (input.RequireTLS !== undefined && input.RequireTLS !== null) { entries["RequireTLS"] = input.RequireTLS; } - if (input.IdleClientTimeout !== undefined) { + if (input.IdleClientTimeout !== undefined && input.IdleClientTimeout !== null) { entries["IdleClientTimeout"] = input.IdleClientTimeout; } - if (input.DebugLogging !== undefined) { + if (input.DebugLogging !== undefined && input.DebugLogging !== null) { entries["DebugLogging"] = input.DebugLogging; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.SecurityGroups !== undefined) { + if (input.SecurityGroups !== undefined && input.SecurityGroups !== null) { const memberEntries = serializeAws_queryStringList(input.SecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SecurityGroups.${key}`; @@ -17774,20 +17813,20 @@ const serializeAws_queryModifyDBProxyTargetGroupRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TargetGroupName !== undefined) { + if (input.TargetGroupName !== undefined && input.TargetGroupName !== null) { entries["TargetGroupName"] = input.TargetGroupName; } - if (input.DBProxyName !== undefined) { + if (input.DBProxyName !== undefined && input.DBProxyName !== null) { entries["DBProxyName"] = input.DBProxyName; } - if (input.ConnectionPoolConfig !== undefined) { + if (input.ConnectionPoolConfig !== undefined && input.ConnectionPoolConfig !== null) { const memberEntries = serializeAws_queryConnectionPoolConfiguration(input.ConnectionPoolConfig, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConnectionPoolConfig.${key}`; entries[loc] = value; }); } - if (input.NewName !== undefined) { + if (input.NewName !== undefined && input.NewName !== null) { entries["NewName"] = input.NewName; } return entries; @@ -17798,20 +17837,20 @@ const serializeAws_queryModifyDBSnapshotAttributeMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSnapshotIdentifier !== undefined) { + if (input.DBSnapshotIdentifier !== undefined && input.DBSnapshotIdentifier !== null) { entries["DBSnapshotIdentifier"] = input.DBSnapshotIdentifier; } - if (input.AttributeName !== undefined) { + if (input.AttributeName !== undefined && input.AttributeName !== null) { entries["AttributeName"] = input.AttributeName; } - if (input.ValuesToAdd !== undefined) { + if (input.ValuesToAdd !== undefined && input.ValuesToAdd !== null) { const memberEntries = serializeAws_queryAttributeValueList(input.ValuesToAdd, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ValuesToAdd.${key}`; entries[loc] = value; }); } - if (input.ValuesToRemove !== undefined) { + if (input.ValuesToRemove !== undefined && input.ValuesToRemove !== null) { const memberEntries = serializeAws_queryAttributeValueList(input.ValuesToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ValuesToRemove.${key}`; @@ -17823,13 +17862,13 @@ const serializeAws_queryModifyDBSnapshotAttributeMessage = ( const serializeAws_queryModifyDBSnapshotMessage = (input: ModifyDBSnapshotMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBSnapshotIdentifier !== undefined) { + if (input.DBSnapshotIdentifier !== undefined && input.DBSnapshotIdentifier !== null) { entries["DBSnapshotIdentifier"] = input.DBSnapshotIdentifier; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } return entries; @@ -17840,13 +17879,13 @@ const serializeAws_queryModifyDBSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.DBSubnetGroupDescription !== undefined) { + if (input.DBSubnetGroupDescription !== undefined && input.DBSubnetGroupDescription !== null) { entries["DBSubnetGroupDescription"] = input.DBSubnetGroupDescription; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; @@ -17861,23 +17900,23 @@ const serializeAws_queryModifyEventSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.SnsTopicArn !== undefined) { + if (input.SnsTopicArn !== undefined && input.SnsTopicArn !== null) { entries["SnsTopicArn"] = input.SnsTopicArn; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.EventCategories !== undefined) { + if (input.EventCategories !== undefined && input.EventCategories !== null) { const memberEntries = serializeAws_queryEventCategoriesList(input.EventCategories, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventCategories.${key}`; entries[loc] = value; }); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -17888,13 +17927,13 @@ const serializeAws_queryModifyGlobalClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalClusterIdentifier !== undefined) { + if (input.GlobalClusterIdentifier !== undefined && input.GlobalClusterIdentifier !== null) { entries["GlobalClusterIdentifier"] = input.GlobalClusterIdentifier; } - if (input.NewGlobalClusterIdentifier !== undefined) { + if (input.NewGlobalClusterIdentifier !== undefined && input.NewGlobalClusterIdentifier !== null) { entries["NewGlobalClusterIdentifier"] = input.NewGlobalClusterIdentifier; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } return entries; @@ -17902,24 +17941,24 @@ const serializeAws_queryModifyGlobalClusterMessage = ( const serializeAws_queryModifyOptionGroupMessage = (input: ModifyOptionGroupMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.OptionsToInclude !== undefined) { + if (input.OptionsToInclude !== undefined && input.OptionsToInclude !== null) { const memberEntries = serializeAws_queryOptionConfigurationList(input.OptionsToInclude, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionsToInclude.${key}`; entries[loc] = value; }); } - if (input.OptionsToRemove !== undefined) { + if (input.OptionsToRemove !== undefined && input.OptionsToRemove !== null) { const memberEntries = serializeAws_queryOptionNamesList(input.OptionsToRemove, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionsToRemove.${key}`; entries[loc] = value; }); } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } return entries; @@ -17927,30 +17966,30 @@ const serializeAws_queryModifyOptionGroupMessage = (input: ModifyOptionGroupMess const serializeAws_queryOptionConfiguration = (input: OptionConfiguration, context: __SerdeContext): any => { const entries: any = {}; - if (input.OptionName !== undefined) { + if (input.OptionName !== undefined && input.OptionName !== null) { entries["OptionName"] = input.OptionName; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.OptionVersion !== undefined) { + if (input.OptionVersion !== undefined && input.OptionVersion !== null) { entries["OptionVersion"] = input.OptionVersion; } - if (input.DBSecurityGroupMemberships !== undefined) { + if (input.DBSecurityGroupMemberships !== undefined && input.DBSecurityGroupMemberships !== null) { const memberEntries = serializeAws_queryDBSecurityGroupNameList(input.DBSecurityGroupMemberships, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBSecurityGroupMemberships.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupMemberships !== undefined) { + if (input.VpcSecurityGroupMemberships !== undefined && input.VpcSecurityGroupMemberships !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupMemberships, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupMemberships.${key}`; entries[loc] = value; }); } - if (input.OptionSettings !== undefined) { + if (input.OptionSettings !== undefined && input.OptionSettings !== null) { const memberEntries = serializeAws_queryOptionSettingsList(input.OptionSettings, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `OptionSettings.${key}`; @@ -17964,6 +18003,9 @@ const serializeAws_queryOptionConfigurationList = (input: OptionConfiguration[], const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryOptionConfiguration(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`OptionConfiguration.${counter}.${key}`] = value; @@ -17977,6 +18019,9 @@ const serializeAws_queryOptionNamesList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -17985,31 +18030,31 @@ const serializeAws_queryOptionNamesList = (input: string[], context: __SerdeCont const serializeAws_queryOptionSetting = (input: OptionSetting, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } - if (input.DefaultValue !== undefined) { + if (input.DefaultValue !== undefined && input.DefaultValue !== null) { entries["DefaultValue"] = input.DefaultValue; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.ApplyType !== undefined) { + if (input.ApplyType !== undefined && input.ApplyType !== null) { entries["ApplyType"] = input.ApplyType; } - if (input.DataType !== undefined) { + if (input.DataType !== undefined && input.DataType !== null) { entries["DataType"] = input.DataType; } - if (input.AllowedValues !== undefined) { + if (input.AllowedValues !== undefined && input.AllowedValues !== null) { entries["AllowedValues"] = input.AllowedValues; } - if (input.IsModifiable !== undefined) { + if (input.IsModifiable !== undefined && input.IsModifiable !== null) { entries["IsModifiable"] = input.IsModifiable; } - if (input.IsCollection !== undefined) { + if (input.IsCollection !== undefined && input.IsCollection !== null) { entries["IsCollection"] = input.IsCollection; } return entries; @@ -18019,6 +18064,9 @@ const serializeAws_queryOptionSettingsList = (input: OptionSetting[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryOptionSetting(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`OptionSetting.${counter}.${key}`] = value; @@ -18030,37 +18078,37 @@ const serializeAws_queryOptionSettingsList = (input: OptionSetting[], context: _ const serializeAws_queryParameter = (input: Parameter, context: __SerdeContext): any => { const entries: any = {}; - if (input.ParameterName !== undefined) { + if (input.ParameterName !== undefined && input.ParameterName !== null) { entries["ParameterName"] = input.ParameterName; } - if (input.ParameterValue !== undefined) { + if (input.ParameterValue !== undefined && input.ParameterValue !== null) { entries["ParameterValue"] = input.ParameterValue; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.ApplyType !== undefined) { + if (input.ApplyType !== undefined && input.ApplyType !== null) { entries["ApplyType"] = input.ApplyType; } - if (input.DataType !== undefined) { + if (input.DataType !== undefined && input.DataType !== null) { entries["DataType"] = input.DataType; } - if (input.AllowedValues !== undefined) { + if (input.AllowedValues !== undefined && input.AllowedValues !== null) { entries["AllowedValues"] = input.AllowedValues; } - if (input.IsModifiable !== undefined) { + if (input.IsModifiable !== undefined && input.IsModifiable !== null) { entries["IsModifiable"] = input.IsModifiable; } - if (input.MinimumEngineVersion !== undefined) { + if (input.MinimumEngineVersion !== undefined && input.MinimumEngineVersion !== null) { entries["MinimumEngineVersion"] = input.MinimumEngineVersion; } - if (input.ApplyMethod !== undefined) { + if (input.ApplyMethod !== undefined && input.ApplyMethod !== null) { entries["ApplyMethod"] = input.ApplyMethod; } - if (input.SupportedEngineModes !== undefined) { + if (input.SupportedEngineModes !== undefined && input.SupportedEngineModes !== null) { const memberEntries = serializeAws_queryEngineModeList(input.SupportedEngineModes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SupportedEngineModes.${key}`; @@ -18074,6 +18122,9 @@ const serializeAws_queryParametersList = (input: Parameter[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryParameter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Parameter.${counter}.${key}`] = value; @@ -18085,10 +18136,10 @@ const serializeAws_queryParametersList = (input: Parameter[], context: __SerdeCo const serializeAws_queryProcessorFeature = (input: ProcessorFeature, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -18098,6 +18149,9 @@ const serializeAws_queryProcessorFeatureList = (input: ProcessorFeature[], conte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryProcessorFeature(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`ProcessorFeature.${counter}.${key}`] = value; @@ -18112,7 +18166,7 @@ const serializeAws_queryPromoteReadReplicaDBClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -18123,13 +18177,13 @@ const serializeAws_queryPromoteReadReplicaMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } return entries; @@ -18140,16 +18194,16 @@ const serializeAws_queryPurchaseReservedDBInstancesOfferingMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedDBInstancesOfferingId !== undefined) { + if (input.ReservedDBInstancesOfferingId !== undefined && input.ReservedDBInstancesOfferingId !== null) { entries["ReservedDBInstancesOfferingId"] = input.ReservedDBInstancesOfferingId; } - if (input.ReservedDBInstanceId !== undefined) { + if (input.ReservedDBInstanceId !== undefined && input.ReservedDBInstanceId !== null) { entries["ReservedDBInstanceId"] = input.ReservedDBInstanceId; } - if (input.DBInstanceCount !== undefined) { + if (input.DBInstanceCount !== undefined && input.DBInstanceCount !== null) { entries["DBInstanceCount"] = input.DBInstanceCount; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -18161,10 +18215,10 @@ const serializeAws_queryPurchaseReservedDBInstancesOfferingMessage = ( const serializeAws_queryRebootDBInstanceMessage = (input: RebootDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.ForceFailover !== undefined) { + if (input.ForceFailover !== undefined && input.ForceFailover !== null) { entries["ForceFailover"] = input.ForceFailover; } return entries; @@ -18175,20 +18229,20 @@ const serializeAws_queryRegisterDBProxyTargetsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBProxyName !== undefined) { + if (input.DBProxyName !== undefined && input.DBProxyName !== null) { entries["DBProxyName"] = input.DBProxyName; } - if (input.TargetGroupName !== undefined) { + if (input.TargetGroupName !== undefined && input.TargetGroupName !== null) { entries["TargetGroupName"] = input.TargetGroupName; } - if (input.DBInstanceIdentifiers !== undefined) { + if (input.DBInstanceIdentifiers !== undefined && input.DBInstanceIdentifiers !== null) { const memberEntries = serializeAws_queryStringList(input.DBInstanceIdentifiers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBInstanceIdentifiers.${key}`; entries[loc] = value; }); } - if (input.DBClusterIdentifiers !== undefined) { + if (input.DBClusterIdentifiers !== undefined && input.DBClusterIdentifiers !== null) { const memberEntries = serializeAws_queryStringList(input.DBClusterIdentifiers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBClusterIdentifiers.${key}`; @@ -18203,10 +18257,10 @@ const serializeAws_queryRemoveFromGlobalClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.GlobalClusterIdentifier !== undefined) { + if (input.GlobalClusterIdentifier !== undefined && input.GlobalClusterIdentifier !== null) { entries["GlobalClusterIdentifier"] = input.GlobalClusterIdentifier; } - if (input.DbClusterIdentifier !== undefined) { + if (input.DbClusterIdentifier !== undefined && input.DbClusterIdentifier !== null) { entries["DbClusterIdentifier"] = input.DbClusterIdentifier; } return entries; @@ -18217,13 +18271,13 @@ const serializeAws_queryRemoveRoleFromDBClusterMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.FeatureName !== undefined) { + if (input.FeatureName !== undefined && input.FeatureName !== null) { entries["FeatureName"] = input.FeatureName; } return entries; @@ -18234,13 +18288,13 @@ const serializeAws_queryRemoveRoleFromDBInstanceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.FeatureName !== undefined) { + if (input.FeatureName !== undefined && input.FeatureName !== null) { entries["FeatureName"] = input.FeatureName; } return entries; @@ -18251,10 +18305,10 @@ const serializeAws_queryRemoveSourceIdentifierFromSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.SourceIdentifier !== undefined) { + if (input.SourceIdentifier !== undefined && input.SourceIdentifier !== null) { entries["SourceIdentifier"] = input.SourceIdentifier; } return entries; @@ -18265,10 +18319,10 @@ const serializeAws_queryRemoveTagsFromResourceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; @@ -18283,13 +18337,13 @@ const serializeAws_queryResetDBClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.ResetAllParameters !== undefined) { + if (input.ResetAllParameters !== undefined && input.ResetAllParameters !== null) { entries["ResetAllParameters"] = input.ResetAllParameters; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -18304,13 +18358,13 @@ const serializeAws_queryResetDBParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.ResetAllParameters !== undefined) { + if (input.ResetAllParameters !== undefined && input.ResetAllParameters !== null) { entries["ResetAllParameters"] = input.ResetAllParameters; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -18325,113 +18379,113 @@ const serializeAws_queryRestoreDBClusterFromS3Message = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.CharacterSetName !== undefined) { + if (input.CharacterSetName !== undefined && input.CharacterSetName !== null) { entries["CharacterSetName"] = input.CharacterSetName; } - if (input.DatabaseName !== undefined) { + if (input.DatabaseName !== undefined && input.DatabaseName !== null) { entries["DatabaseName"] = input.DatabaseName; } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.MasterUsername !== undefined) { + if (input.MasterUsername !== undefined && input.MasterUsername !== null) { entries["MasterUsername"] = input.MasterUsername; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.StorageEncrypted !== undefined) { + if (input.StorageEncrypted !== undefined && input.StorageEncrypted !== null) { entries["StorageEncrypted"] = input.StorageEncrypted; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.SourceEngine !== undefined) { + if (input.SourceEngine !== undefined && input.SourceEngine !== null) { entries["SourceEngine"] = input.SourceEngine; } - if (input.SourceEngineVersion !== undefined) { + if (input.SourceEngineVersion !== undefined && input.SourceEngineVersion !== null) { entries["SourceEngineVersion"] = input.SourceEngineVersion; } - if (input.S3BucketName !== undefined) { + if (input.S3BucketName !== undefined && input.S3BucketName !== null) { entries["S3BucketName"] = input.S3BucketName; } - if (input.S3Prefix !== undefined) { + if (input.S3Prefix !== undefined && input.S3Prefix !== null) { entries["S3Prefix"] = input.S3Prefix; } - if (input.S3IngestionRoleArn !== undefined) { + if (input.S3IngestionRoleArn !== undefined && input.S3IngestionRoleArn !== null) { entries["S3IngestionRoleArn"] = input.S3IngestionRoleArn; } - if (input.BacktrackWindow !== undefined) { + if (input.BacktrackWindow !== undefined && input.BacktrackWindow !== null) { entries["BacktrackWindow"] = input.BacktrackWindow; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } return entries; @@ -18442,90 +18496,90 @@ const serializeAws_queryRestoreDBClusterFromSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AvailabilityZones !== undefined) { + if (input.AvailabilityZones !== undefined && input.AvailabilityZones !== null) { const memberEntries = serializeAws_queryAvailabilityZones(input.AvailabilityZones, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AvailabilityZones.${key}`; entries[loc] = value; }); } - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.DatabaseName !== undefined) { + if (input.DatabaseName !== undefined && input.DatabaseName !== null) { entries["DatabaseName"] = input.DatabaseName; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.BacktrackWindow !== undefined) { + if (input.BacktrackWindow !== undefined && input.BacktrackWindow !== null) { entries["BacktrackWindow"] = input.BacktrackWindow; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.EngineMode !== undefined) { + if (input.EngineMode !== undefined && input.EngineMode !== null) { entries["EngineMode"] = input.EngineMode; } - if (input.ScalingConfiguration !== undefined) { + if (input.ScalingConfiguration !== undefined && input.ScalingConfiguration !== null) { const memberEntries = serializeAws_queryScalingConfiguration(input.ScalingConfiguration, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScalingConfiguration.${key}`; entries[loc] = value; }); } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } return entries; @@ -18536,73 +18590,73 @@ const serializeAws_queryRestoreDBClusterToPointInTimeMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } - if (input.RestoreType !== undefined) { + if (input.RestoreType !== undefined && input.RestoreType !== null) { entries["RestoreType"] = input.RestoreType; } - if (input.SourceDBClusterIdentifier !== undefined) { + if (input.SourceDBClusterIdentifier !== undefined && input.SourceDBClusterIdentifier !== null) { entries["SourceDBClusterIdentifier"] = input.SourceDBClusterIdentifier; } - if (input.RestoreToTime !== undefined) { + if (input.RestoreToTime !== undefined && input.RestoreToTime !== null) { entries["RestoreToTime"] = input.RestoreToTime.toISOString().split(".")[0] + "Z"; } - if (input.UseLatestRestorableTime !== undefined) { + if (input.UseLatestRestorableTime !== undefined && input.UseLatestRestorableTime !== null) { entries["UseLatestRestorableTime"] = input.UseLatestRestorableTime; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.BacktrackWindow !== undefined) { + if (input.BacktrackWindow !== undefined && input.BacktrackWindow !== null) { entries["BacktrackWindow"] = input.BacktrackWindow; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.DBClusterParameterGroupName !== undefined) { + if (input.DBClusterParameterGroupName !== undefined && input.DBClusterParameterGroupName !== null) { entries["DBClusterParameterGroupName"] = input.DBClusterParameterGroupName; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } return entries; @@ -18613,104 +18667,104 @@ const serializeAws_queryRestoreDBInstanceFromDBSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.DBSnapshotIdentifier !== undefined) { + if (input.DBSnapshotIdentifier !== undefined && input.DBSnapshotIdentifier !== null) { entries["DBSnapshotIdentifier"] = input.DBSnapshotIdentifier; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } - if (input.DBName !== undefined) { + if (input.DBName !== undefined && input.DBName !== null) { entries["DBName"] = input.DBName; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.StorageType !== undefined) { + if (input.StorageType !== undefined && input.StorageType !== null) { entries["StorageType"] = input.StorageType; } - if (input.TdeCredentialArn !== undefined) { + if (input.TdeCredentialArn !== undefined && input.TdeCredentialArn !== null) { entries["TdeCredentialArn"] = input.TdeCredentialArn; } - if (input.TdeCredentialPassword !== undefined) { + if (input.TdeCredentialPassword !== undefined && input.TdeCredentialPassword !== null) { entries["TdeCredentialPassword"] = input.TdeCredentialPassword; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.ProcessorFeatures !== undefined) { + if (input.ProcessorFeatures !== undefined && input.ProcessorFeatures !== null) { const memberEntries = serializeAws_queryProcessorFeatureList(input.ProcessorFeatures, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProcessorFeatures.${key}`; entries[loc] = value; }); } - if (input.UseDefaultProcessorFeatures !== undefined) { + if (input.UseDefaultProcessorFeatures !== undefined && input.UseDefaultProcessorFeatures !== null) { entries["UseDefaultProcessorFeatures"] = input.UseDefaultProcessorFeatures; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } return entries; @@ -18721,156 +18775,156 @@ const serializeAws_queryRestoreDBInstanceFromS3Message = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBName !== undefined) { + if (input.DBName !== undefined && input.DBName !== null) { entries["DBName"] = input.DBName; } - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.AllocatedStorage !== undefined) { + if (input.AllocatedStorage !== undefined && input.AllocatedStorage !== null) { entries["AllocatedStorage"] = input.AllocatedStorage; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.MasterUsername !== undefined) { + if (input.MasterUsername !== undefined && input.MasterUsername !== null) { entries["MasterUsername"] = input.MasterUsername; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.DBSecurityGroups !== undefined) { + if (input.DBSecurityGroups !== undefined && input.DBSecurityGroups !== null) { const memberEntries = serializeAws_queryDBSecurityGroupNameList(input.DBSecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DBSecurityGroups.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.PreferredBackupWindow !== undefined) { + if (input.PreferredBackupWindow !== undefined && input.PreferredBackupWindow !== null) { entries["PreferredBackupWindow"] = input.PreferredBackupWindow; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.EngineVersion !== undefined) { + if (input.EngineVersion !== undefined && input.EngineVersion !== null) { entries["EngineVersion"] = input.EngineVersion; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.StorageType !== undefined) { + if (input.StorageType !== undefined && input.StorageType !== null) { entries["StorageType"] = input.StorageType; } - if (input.StorageEncrypted !== undefined) { + if (input.StorageEncrypted !== undefined && input.StorageEncrypted !== null) { entries["StorageEncrypted"] = input.StorageEncrypted; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.MonitoringInterval !== undefined) { + if (input.MonitoringInterval !== undefined && input.MonitoringInterval !== null) { entries["MonitoringInterval"] = input.MonitoringInterval; } - if (input.MonitoringRoleArn !== undefined) { + if (input.MonitoringRoleArn !== undefined && input.MonitoringRoleArn !== null) { entries["MonitoringRoleArn"] = input.MonitoringRoleArn; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.SourceEngine !== undefined) { + if (input.SourceEngine !== undefined && input.SourceEngine !== null) { entries["SourceEngine"] = input.SourceEngine; } - if (input.SourceEngineVersion !== undefined) { + if (input.SourceEngineVersion !== undefined && input.SourceEngineVersion !== null) { entries["SourceEngineVersion"] = input.SourceEngineVersion; } - if (input.S3BucketName !== undefined) { + if (input.S3BucketName !== undefined && input.S3BucketName !== null) { entries["S3BucketName"] = input.S3BucketName; } - if (input.S3Prefix !== undefined) { + if (input.S3Prefix !== undefined && input.S3Prefix !== null) { entries["S3Prefix"] = input.S3Prefix; } - if (input.S3IngestionRoleArn !== undefined) { + if (input.S3IngestionRoleArn !== undefined && input.S3IngestionRoleArn !== null) { entries["S3IngestionRoleArn"] = input.S3IngestionRoleArn; } - if (input.EnablePerformanceInsights !== undefined) { + if (input.EnablePerformanceInsights !== undefined && input.EnablePerformanceInsights !== null) { entries["EnablePerformanceInsights"] = input.EnablePerformanceInsights; } - if (input.PerformanceInsightsKMSKeyId !== undefined) { + if (input.PerformanceInsightsKMSKeyId !== undefined && input.PerformanceInsightsKMSKeyId !== null) { entries["PerformanceInsightsKMSKeyId"] = input.PerformanceInsightsKMSKeyId; } - if (input.PerformanceInsightsRetentionPeriod !== undefined) { + if (input.PerformanceInsightsRetentionPeriod !== undefined && input.PerformanceInsightsRetentionPeriod !== null) { entries["PerformanceInsightsRetentionPeriod"] = input.PerformanceInsightsRetentionPeriod; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.ProcessorFeatures !== undefined) { + if (input.ProcessorFeatures !== undefined && input.ProcessorFeatures !== null) { const memberEntries = serializeAws_queryProcessorFeatureList(input.ProcessorFeatures, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProcessorFeatures.${key}`; entries[loc] = value; }); } - if (input.UseDefaultProcessorFeatures !== undefined) { + if (input.UseDefaultProcessorFeatures !== undefined && input.UseDefaultProcessorFeatures !== null) { entries["UseDefaultProcessorFeatures"] = input.UseDefaultProcessorFeatures; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.MaxAllocatedStorage !== undefined) { + if (input.MaxAllocatedStorage !== undefined && input.MaxAllocatedStorage !== null) { entries["MaxAllocatedStorage"] = input.MaxAllocatedStorage; } return entries; @@ -18881,119 +18935,119 @@ const serializeAws_queryRestoreDBInstanceToPointInTimeMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceDBInstanceIdentifier !== undefined) { + if (input.SourceDBInstanceIdentifier !== undefined && input.SourceDBInstanceIdentifier !== null) { entries["SourceDBInstanceIdentifier"] = input.SourceDBInstanceIdentifier; } - if (input.TargetDBInstanceIdentifier !== undefined) { + if (input.TargetDBInstanceIdentifier !== undefined && input.TargetDBInstanceIdentifier !== null) { entries["TargetDBInstanceIdentifier"] = input.TargetDBInstanceIdentifier; } - if (input.RestoreTime !== undefined) { + if (input.RestoreTime !== undefined && input.RestoreTime !== null) { entries["RestoreTime"] = input.RestoreTime.toISOString().split(".")[0] + "Z"; } - if (input.UseLatestRestorableTime !== undefined) { + if (input.UseLatestRestorableTime !== undefined && input.UseLatestRestorableTime !== null) { entries["UseLatestRestorableTime"] = input.UseLatestRestorableTime; } - if (input.DBInstanceClass !== undefined) { + if (input.DBInstanceClass !== undefined && input.DBInstanceClass !== null) { entries["DBInstanceClass"] = input.DBInstanceClass; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.DBSubnetGroupName !== undefined) { + if (input.DBSubnetGroupName !== undefined && input.DBSubnetGroupName !== null) { entries["DBSubnetGroupName"] = input.DBSubnetGroupName; } - if (input.MultiAZ !== undefined) { + if (input.MultiAZ !== undefined && input.MultiAZ !== null) { entries["MultiAZ"] = input.MultiAZ; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.AutoMinorVersionUpgrade !== undefined) { + if (input.AutoMinorVersionUpgrade !== undefined && input.AutoMinorVersionUpgrade !== null) { entries["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; } - if (input.LicenseModel !== undefined) { + if (input.LicenseModel !== undefined && input.LicenseModel !== null) { entries["LicenseModel"] = input.LicenseModel; } - if (input.DBName !== undefined) { + if (input.DBName !== undefined && input.DBName !== null) { entries["DBName"] = input.DBName; } - if (input.Engine !== undefined) { + if (input.Engine !== undefined && input.Engine !== null) { entries["Engine"] = input.Engine; } - if (input.Iops !== undefined) { + if (input.Iops !== undefined && input.Iops !== null) { entries["Iops"] = input.Iops; } - if (input.OptionGroupName !== undefined) { + if (input.OptionGroupName !== undefined && input.OptionGroupName !== null) { entries["OptionGroupName"] = input.OptionGroupName; } - if (input.CopyTagsToSnapshot !== undefined) { + if (input.CopyTagsToSnapshot !== undefined && input.CopyTagsToSnapshot !== null) { entries["CopyTagsToSnapshot"] = input.CopyTagsToSnapshot; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.StorageType !== undefined) { + if (input.StorageType !== undefined && input.StorageType !== null) { entries["StorageType"] = input.StorageType; } - if (input.TdeCredentialArn !== undefined) { + if (input.TdeCredentialArn !== undefined && input.TdeCredentialArn !== null) { entries["TdeCredentialArn"] = input.TdeCredentialArn; } - if (input.TdeCredentialPassword !== undefined) { + if (input.TdeCredentialPassword !== undefined && input.TdeCredentialPassword !== null) { entries["TdeCredentialPassword"] = input.TdeCredentialPassword; } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } - if (input.DomainIAMRoleName !== undefined) { + if (input.DomainIAMRoleName !== undefined && input.DomainIAMRoleName !== null) { entries["DomainIAMRoleName"] = input.DomainIAMRoleName; } - if (input.EnableIAMDatabaseAuthentication !== undefined) { + if (input.EnableIAMDatabaseAuthentication !== undefined && input.EnableIAMDatabaseAuthentication !== null) { entries["EnableIAMDatabaseAuthentication"] = input.EnableIAMDatabaseAuthentication; } - if (input.EnableCloudwatchLogsExports !== undefined) { + if (input.EnableCloudwatchLogsExports !== undefined && input.EnableCloudwatchLogsExports !== null) { const memberEntries = serializeAws_queryLogTypeList(input.EnableCloudwatchLogsExports, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EnableCloudwatchLogsExports.${key}`; entries[loc] = value; }); } - if (input.ProcessorFeatures !== undefined) { + if (input.ProcessorFeatures !== undefined && input.ProcessorFeatures !== null) { const memberEntries = serializeAws_queryProcessorFeatureList(input.ProcessorFeatures, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProcessorFeatures.${key}`; entries[loc] = value; }); } - if (input.UseDefaultProcessorFeatures !== undefined) { + if (input.UseDefaultProcessorFeatures !== undefined && input.UseDefaultProcessorFeatures !== null) { entries["UseDefaultProcessorFeatures"] = input.UseDefaultProcessorFeatures; } - if (input.DBParameterGroupName !== undefined) { + if (input.DBParameterGroupName !== undefined && input.DBParameterGroupName !== null) { entries["DBParameterGroupName"] = input.DBParameterGroupName; } - if (input.DeletionProtection !== undefined) { + if (input.DeletionProtection !== undefined && input.DeletionProtection !== null) { entries["DeletionProtection"] = input.DeletionProtection; } - if (input.SourceDbiResourceId !== undefined) { + if (input.SourceDbiResourceId !== undefined && input.SourceDbiResourceId !== null) { entries["SourceDbiResourceId"] = input.SourceDbiResourceId; } - if (input.MaxAllocatedStorage !== undefined) { + if (input.MaxAllocatedStorage !== undefined && input.MaxAllocatedStorage !== null) { entries["MaxAllocatedStorage"] = input.MaxAllocatedStorage; } - if (input.SourceDBInstanceAutomatedBackupsArn !== undefined) { + if (input.SourceDBInstanceAutomatedBackupsArn !== undefined && input.SourceDBInstanceAutomatedBackupsArn !== null) { entries["SourceDBInstanceAutomatedBackupsArn"] = input.SourceDBInstanceAutomatedBackupsArn; } return entries; @@ -19004,19 +19058,19 @@ const serializeAws_queryRevokeDBSecurityGroupIngressMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DBSecurityGroupName !== undefined) { + if (input.DBSecurityGroupName !== undefined && input.DBSecurityGroupName !== null) { entries["DBSecurityGroupName"] = input.DBSecurityGroupName; } - if (input.CIDRIP !== undefined) { + if (input.CIDRIP !== undefined && input.CIDRIP !== null) { entries["CIDRIP"] = input.CIDRIP; } - if (input.EC2SecurityGroupName !== undefined) { + if (input.EC2SecurityGroupName !== undefined && input.EC2SecurityGroupName !== null) { entries["EC2SecurityGroupName"] = input.EC2SecurityGroupName; } - if (input.EC2SecurityGroupId !== undefined) { + if (input.EC2SecurityGroupId !== undefined && input.EC2SecurityGroupId !== null) { entries["EC2SecurityGroupId"] = input.EC2SecurityGroupId; } - if (input.EC2SecurityGroupOwnerId !== undefined) { + if (input.EC2SecurityGroupOwnerId !== undefined && input.EC2SecurityGroupOwnerId !== null) { entries["EC2SecurityGroupOwnerId"] = input.EC2SecurityGroupOwnerId; } return entries; @@ -19024,19 +19078,19 @@ const serializeAws_queryRevokeDBSecurityGroupIngressMessage = ( const serializeAws_queryScalingConfiguration = (input: ScalingConfiguration, context: __SerdeContext): any => { const entries: any = {}; - if (input.MinCapacity !== undefined) { + if (input.MinCapacity !== undefined && input.MinCapacity !== null) { entries["MinCapacity"] = input.MinCapacity; } - if (input.MaxCapacity !== undefined) { + if (input.MaxCapacity !== undefined && input.MaxCapacity !== null) { entries["MaxCapacity"] = input.MaxCapacity; } - if (input.AutoPause !== undefined) { + if (input.AutoPause !== undefined && input.AutoPause !== null) { entries["AutoPause"] = input.AutoPause; } - if (input.SecondsUntilAutoPause !== undefined) { + if (input.SecondsUntilAutoPause !== undefined && input.SecondsUntilAutoPause !== null) { entries["SecondsUntilAutoPause"] = input.SecondsUntilAutoPause; } - if (input.TimeoutAction !== undefined) { + if (input.TimeoutAction !== undefined && input.TimeoutAction !== null) { entries["TimeoutAction"] = input.TimeoutAction; } return entries; @@ -19046,6 +19100,9 @@ const serializeAws_querySourceIdsList = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SourceId.${counter}`] = entry; counter++; } @@ -19057,16 +19114,16 @@ const serializeAws_queryStartActivityStreamRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceArn !== undefined) { + if (input.ResourceArn !== undefined && input.ResourceArn !== null) { entries["ResourceArn"] = input.ResourceArn; } - if (input.Mode !== undefined) { + if (input.Mode !== undefined && input.Mode !== null) { entries["Mode"] = input.Mode; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } return entries; @@ -19074,7 +19131,7 @@ const serializeAws_queryStartActivityStreamRequest = ( const serializeAws_queryStartDBClusterMessage = (input: StartDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -19085,16 +19142,16 @@ const serializeAws_queryStartDBInstanceAutomatedBackupsReplicationMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceDBInstanceArn !== undefined) { + if (input.SourceDBInstanceArn !== undefined && input.SourceDBInstanceArn !== null) { entries["SourceDBInstanceArn"] = input.SourceDBInstanceArn; } - if (input.BackupRetentionPeriod !== undefined) { + if (input.BackupRetentionPeriod !== undefined && input.BackupRetentionPeriod !== null) { entries["BackupRetentionPeriod"] = input.BackupRetentionPeriod; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.PreSignedUrl !== undefined) { + if (input.PreSignedUrl !== undefined && input.PreSignedUrl !== null) { entries["PreSignedUrl"] = input.PreSignedUrl; } return entries; @@ -19102,7 +19159,7 @@ const serializeAws_queryStartDBInstanceAutomatedBackupsReplicationMessage = ( const serializeAws_queryStartDBInstanceMessage = (input: StartDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } return entries; @@ -19110,25 +19167,25 @@ const serializeAws_queryStartDBInstanceMessage = (input: StartDBInstanceMessage, const serializeAws_queryStartExportTaskMessage = (input: StartExportTaskMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ExportTaskIdentifier !== undefined) { + if (input.ExportTaskIdentifier !== undefined && input.ExportTaskIdentifier !== null) { entries["ExportTaskIdentifier"] = input.ExportTaskIdentifier; } - if (input.SourceArn !== undefined) { + if (input.SourceArn !== undefined && input.SourceArn !== null) { entries["SourceArn"] = input.SourceArn; } - if (input.S3BucketName !== undefined) { + if (input.S3BucketName !== undefined && input.S3BucketName !== null) { entries["S3BucketName"] = input.S3BucketName; } - if (input.IamRoleArn !== undefined) { + if (input.IamRoleArn !== undefined && input.IamRoleArn !== null) { entries["IamRoleArn"] = input.IamRoleArn; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.S3Prefix !== undefined) { + if (input.S3Prefix !== undefined && input.S3Prefix !== null) { entries["S3Prefix"] = input.S3Prefix; } - if (input.ExportOnly !== undefined) { + if (input.ExportOnly !== undefined && input.ExportOnly !== null) { const memberEntries = serializeAws_queryStringList(input.ExportOnly, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExportOnly.${key}`; @@ -19143,10 +19200,10 @@ const serializeAws_queryStopActivityStreamRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceArn !== undefined) { + if (input.ResourceArn !== undefined && input.ResourceArn !== null) { entries["ResourceArn"] = input.ResourceArn; } - if (input.ApplyImmediately !== undefined) { + if (input.ApplyImmediately !== undefined && input.ApplyImmediately !== null) { entries["ApplyImmediately"] = input.ApplyImmediately; } return entries; @@ -19154,7 +19211,7 @@ const serializeAws_queryStopActivityStreamRequest = ( const serializeAws_queryStopDBClusterMessage = (input: StopDBClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBClusterIdentifier !== undefined) { + if (input.DBClusterIdentifier !== undefined && input.DBClusterIdentifier !== null) { entries["DBClusterIdentifier"] = input.DBClusterIdentifier; } return entries; @@ -19165,7 +19222,7 @@ const serializeAws_queryStopDBInstanceAutomatedBackupsReplicationMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceDBInstanceArn !== undefined) { + if (input.SourceDBInstanceArn !== undefined && input.SourceDBInstanceArn !== null) { entries["SourceDBInstanceArn"] = input.SourceDBInstanceArn; } return entries; @@ -19173,10 +19230,10 @@ const serializeAws_queryStopDBInstanceAutomatedBackupsReplicationMessage = ( const serializeAws_queryStopDBInstanceMessage = (input: StopDBInstanceMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBInstanceIdentifier !== undefined) { + if (input.DBInstanceIdentifier !== undefined && input.DBInstanceIdentifier !== null) { entries["DBInstanceIdentifier"] = input.DBInstanceIdentifier; } - if (input.DBSnapshotIdentifier !== undefined) { + if (input.DBSnapshotIdentifier !== undefined && input.DBSnapshotIdentifier !== null) { entries["DBSnapshotIdentifier"] = input.DBSnapshotIdentifier; } return entries; @@ -19186,6 +19243,9 @@ const serializeAws_queryStringList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -19196,6 +19256,9 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SubnetIdentifier.${counter}`] = entry; counter++; } @@ -19204,10 +19267,10 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -19217,6 +19280,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Tag.${counter}.${key}`] = value; @@ -19228,19 +19294,19 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const serializeAws_queryUserAuthConfig = (input: UserAuthConfig, context: __SerdeContext): any => { const entries: any = {}; - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.UserName !== undefined) { + if (input.UserName !== undefined && input.UserName !== null) { entries["UserName"] = input.UserName; } - if (input.AuthScheme !== undefined) { + if (input.AuthScheme !== undefined && input.AuthScheme !== null) { entries["AuthScheme"] = input.AuthScheme; } - if (input.SecretArn !== undefined) { + if (input.SecretArn !== undefined && input.SecretArn !== null) { entries["SecretArn"] = input.SecretArn; } - if (input.IAMAuth !== undefined) { + if (input.IAMAuth !== undefined && input.IAMAuth !== null) { entries["IAMAuth"] = input.IAMAuth; } return entries; @@ -19250,6 +19316,9 @@ const serializeAws_queryUserAuthConfigList = (input: UserAuthConfig[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryUserAuthConfig(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -19263,6 +19332,9 @@ const serializeAws_queryVpcSecurityGroupIdList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`VpcSecurityGroupId.${counter}`] = entry; counter++; } @@ -19307,7 +19379,14 @@ const deserializeAws_queryAccountQuota = (output: any, context: __SerdeContext): }; const deserializeAws_queryAccountQuotaList = (output: any, context: __SerdeContext): AccountQuota[] => { - return (output || []).map((entry: any) => deserializeAws_queryAccountQuota(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAccountQuota(entry, context); + }); }; const deserializeAws_queryAddSourceIdentifierToSubscriptionResult = ( @@ -19340,7 +19419,14 @@ const deserializeAws_queryApplyPendingMaintenanceActionResult = ( }; const deserializeAws_queryAttributeValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryAuthorizationAlreadyExistsFault = ( @@ -19406,11 +19492,25 @@ const deserializeAws_queryAvailabilityZone = (output: any, context: __SerdeConte }; const deserializeAws_queryAvailabilityZoneList = (output: any, context: __SerdeContext): AvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_queryAvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAvailabilityZone(entry, context); + }); }; const deserializeAws_queryAvailabilityZones = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryAvailableProcessorFeature = ( @@ -19438,7 +19538,14 @@ const deserializeAws_queryAvailableProcessorFeatureList = ( output: any, context: __SerdeContext ): AvailableProcessorFeature[] => { - return (output || []).map((entry: any) => deserializeAws_queryAvailableProcessorFeature(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAvailableProcessorFeature(entry, context); + }); }; const deserializeAws_queryBackupPolicyNotFoundFault = ( @@ -19493,7 +19600,14 @@ const deserializeAws_queryCertificate = (output: any, context: __SerdeContext): }; const deserializeAws_queryCertificateList = (output: any, context: __SerdeContext): Certificate[] => { - return (output || []).map((entry: any) => deserializeAws_queryCertificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCertificate(entry, context); + }); }; const deserializeAws_queryCertificateMessage = (output: any, context: __SerdeContext): CertificateMessage => { @@ -19852,7 +19966,14 @@ const deserializeAws_queryCustomAvailabilityZoneList = ( output: any, context: __SerdeContext ): CustomAvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_queryCustomAvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCustomAvailabilityZone(entry, context); + }); }; const deserializeAws_queryCustomAvailabilityZoneMessage = ( @@ -20249,7 +20370,14 @@ const deserializeAws_queryDBClusterBacktrack = (output: any, context: __SerdeCon }; const deserializeAws_queryDBClusterBacktrackList = (output: any, context: __SerdeContext): DBClusterBacktrack[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterBacktrack(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterBacktrack(entry, context); + }); }; const deserializeAws_queryDBClusterBacktrackMessage = ( @@ -20389,7 +20517,14 @@ const deserializeAws_queryDBClusterEndpointAlreadyExistsFault = ( }; const deserializeAws_queryDBClusterEndpointList = (output: any, context: __SerdeContext): DBClusterEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterEndpoint(entry, context); + }); }; const deserializeAws_queryDBClusterEndpointMessage = ( @@ -20445,7 +20580,14 @@ const deserializeAws_queryDBClusterEndpointQuotaExceededFault = ( }; const deserializeAws_queryDBClusterList = (output: any, context: __SerdeContext): DBCluster[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBCluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBCluster(entry, context); + }); }; const deserializeAws_queryDBClusterMember = (output: any, context: __SerdeContext): DBClusterMember => { @@ -20471,7 +20613,14 @@ const deserializeAws_queryDBClusterMember = (output: any, context: __SerdeContex }; const deserializeAws_queryDBClusterMemberList = (output: any, context: __SerdeContext): DBClusterMember[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterMember(entry, context); + }); }; const deserializeAws_queryDBClusterMessage = (output: any, context: __SerdeContext): DBClusterMessage => { @@ -20508,7 +20657,14 @@ const deserializeAws_queryDBClusterOptionGroupMemberships = ( output: any, context: __SerdeContext ): DBClusterOptionGroupStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterOptionGroupStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterOptionGroupStatus(entry, context); + }); }; const deserializeAws_queryDBClusterOptionGroupStatus = ( @@ -20577,7 +20733,14 @@ const deserializeAws_queryDBClusterParameterGroupList = ( output: any, context: __SerdeContext ): DBClusterParameterGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterParameterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterParameterGroup(entry, context); + }); }; const deserializeAws_queryDBClusterParameterGroupNameMessage = ( @@ -20703,7 +20866,14 @@ const deserializeAws_queryDBClusterRoleQuotaExceededFault = ( }; const deserializeAws_queryDBClusterRoles = (output: any, context: __SerdeContext): DBClusterRole[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterRole(entry, context); + }); }; const deserializeAws_queryDBClusterSnapshot = (output: any, context: __SerdeContext): DBClusterSnapshot => { @@ -20845,7 +21015,14 @@ const deserializeAws_queryDBClusterSnapshotAttributeList = ( output: any, context: __SerdeContext ): DBClusterSnapshotAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterSnapshotAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterSnapshotAttribute(entry, context); + }); }; const deserializeAws_queryDBClusterSnapshotAttributesResult = ( @@ -20875,7 +21052,14 @@ const deserializeAws_queryDBClusterSnapshotAttributesResult = ( }; const deserializeAws_queryDBClusterSnapshotList = (output: any, context: __SerdeContext): DBClusterSnapshot[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBClusterSnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBClusterSnapshot(entry, context); + }); }; const deserializeAws_queryDBClusterSnapshotMessage = ( @@ -21041,7 +21225,14 @@ const deserializeAws_queryDBEngineVersion = (output: any, context: __SerdeContex }; const deserializeAws_queryDBEngineVersionList = (output: any, context: __SerdeContext): DBEngineVersion[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBEngineVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBEngineVersion(entry, context); + }); }; const deserializeAws_queryDBEngineVersionMessage = (output: any, context: __SerdeContext): DBEngineVersionMessage => { @@ -21553,7 +21744,14 @@ const deserializeAws_queryDBInstanceAutomatedBackupList = ( output: any, context: __SerdeContext ): DBInstanceAutomatedBackup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBInstanceAutomatedBackup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBInstanceAutomatedBackup(entry, context); + }); }; const deserializeAws_queryDBInstanceAutomatedBackupMessage = ( @@ -21625,11 +21823,25 @@ const deserializeAws_queryDBInstanceAutomatedBackupsReplicationList = ( output: any, context: __SerdeContext ): DBInstanceAutomatedBackupsReplication[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBInstanceAutomatedBackupsReplication(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBInstanceAutomatedBackupsReplication(entry, context); + }); }; const deserializeAws_queryDBInstanceList = (output: any, context: __SerdeContext): DBInstance[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBInstance(entry, context); + }); }; const deserializeAws_queryDBInstanceMessage = (output: any, context: __SerdeContext): DBInstanceMessage => { @@ -21720,7 +21932,14 @@ const deserializeAws_queryDBInstanceRoleQuotaExceededFault = ( }; const deserializeAws_queryDBInstanceRoles = (output: any, context: __SerdeContext): DBInstanceRole[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBInstanceRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBInstanceRole(entry, context); + }); }; const deserializeAws_queryDBInstanceStatusInfo = (output: any, context: __SerdeContext): DBInstanceStatusInfo => { @@ -21746,7 +21965,14 @@ const deserializeAws_queryDBInstanceStatusInfo = (output: any, context: __SerdeC }; const deserializeAws_queryDBInstanceStatusInfoList = (output: any, context: __SerdeContext): DBInstanceStatusInfo[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBInstanceStatusInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBInstanceStatusInfo(entry, context); + }); }; const deserializeAws_queryDBLogFileNotFoundFault = (output: any, context: __SerdeContext): DBLogFileNotFoundFault => { @@ -21815,7 +22041,14 @@ const deserializeAws_queryDBParameterGroupDetails = (output: any, context: __Ser }; const deserializeAws_queryDBParameterGroupList = (output: any, context: __SerdeContext): DBParameterGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBParameterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBParameterGroup(entry, context); + }); }; const deserializeAws_queryDBParameterGroupNameMessage = ( @@ -21898,7 +22131,14 @@ const deserializeAws_queryDBParameterGroupStatusList = ( output: any, context: __SerdeContext ): DBParameterGroupStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBParameterGroupStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBParameterGroupStatus(entry, context); + }); }; const deserializeAws_queryDBProxy = (output: any, context: __SerdeContext): DBProxy => { @@ -21995,7 +22235,14 @@ const deserializeAws_queryDBProxyAlreadyExistsFault = ( }; const deserializeAws_queryDBProxyList = (output: any, context: __SerdeContext): DBProxy[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBProxy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBProxy(entry, context); + }); }; const deserializeAws_queryDBProxyNotFoundFault = (output: any, context: __SerdeContext): DBProxyNotFoundFault => { @@ -22212,7 +22459,14 @@ const deserializeAws_queryDBSecurityGroupMembershipList = ( output: any, context: __SerdeContext ): DBSecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBSecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBSecurityGroupMembership(entry, context); + }); }; const deserializeAws_queryDBSecurityGroupMessage = (output: any, context: __SerdeContext): DBSecurityGroupMessage => { @@ -22275,7 +22529,14 @@ const deserializeAws_queryDBSecurityGroupQuotaExceededFault = ( }; const deserializeAws_queryDBSecurityGroups = (output: any, context: __SerdeContext): DBSecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBSecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBSecurityGroup(entry, context); + }); }; const deserializeAws_queryDBSnapshot = (output: any, context: __SerdeContext): DBSnapshot => { @@ -22443,7 +22704,14 @@ const deserializeAws_queryDBSnapshotAttribute = (output: any, context: __SerdeCo }; const deserializeAws_queryDBSnapshotAttributeList = (output: any, context: __SerdeContext): DBSnapshotAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBSnapshotAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBSnapshotAttribute(entry, context); + }); }; const deserializeAws_queryDBSnapshotAttributesResult = ( @@ -22473,7 +22741,14 @@ const deserializeAws_queryDBSnapshotAttributesResult = ( }; const deserializeAws_queryDBSnapshotList = (output: any, context: __SerdeContext): DBSnapshot[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBSnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBSnapshot(entry, context); + }); }; const deserializeAws_queryDBSnapshotMessage = (output: any, context: __SerdeContext): DBSnapshotMessage => { @@ -22625,7 +22900,14 @@ const deserializeAws_queryDBSubnetGroupQuotaExceededFault = ( }; const deserializeAws_queryDBSubnetGroups = (output: any, context: __SerdeContext): DBSubnetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBSubnetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBSubnetGroup(entry, context); + }); }; const deserializeAws_queryDBSubnetQuotaExceededFault = ( @@ -22814,7 +23096,14 @@ const deserializeAws_queryDescribeDBLogFilesList = ( output: any, context: __SerdeContext ): DescribeDBLogFilesDetails[] => { - return (output || []).map((entry: any) => deserializeAws_queryDescribeDBLogFilesDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDescribeDBLogFilesDetails(entry, context); + }); }; const deserializeAws_queryDescribeDBLogFilesResponse = ( @@ -22990,7 +23279,14 @@ const deserializeAws_queryDomainMembership = (output: any, context: __SerdeConte }; const deserializeAws_queryDomainMembershipList = (output: any, context: __SerdeContext): DomainMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryDomainMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDomainMembership(entry, context); + }); }; const deserializeAws_queryDomainNotFoundFault = (output: any, context: __SerdeContext): DomainNotFoundFault => { @@ -23018,7 +23314,14 @@ const deserializeAws_queryDoubleRange = (output: any, context: __SerdeContext): }; const deserializeAws_queryDoubleRangeList = (output: any, context: __SerdeContext): DoubleRange[] => { - return (output || []).map((entry: any) => deserializeAws_queryDoubleRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDoubleRange(entry, context); + }); }; const deserializeAws_queryDownloadDBLogFilePortionDetails = ( @@ -23065,7 +23368,14 @@ const deserializeAws_queryEC2SecurityGroup = (output: any, context: __SerdeConte }; const deserializeAws_queryEC2SecurityGroupList = (output: any, context: __SerdeContext): EC2SecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryEC2SecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEC2SecurityGroup(entry, context); + }); }; const deserializeAws_queryEndpoint = (output: any, context: __SerdeContext): Endpoint => { @@ -23111,7 +23421,14 @@ const deserializeAws_queryEngineDefaults = (output: any, context: __SerdeContext }; const deserializeAws_queryEngineModeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryEvent = (output: any, context: __SerdeContext): Event => { @@ -23151,7 +23468,14 @@ const deserializeAws_queryEvent = (output: any, context: __SerdeContext): Event }; const deserializeAws_queryEventCategoriesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryEventCategoriesMap = (output: any, context: __SerdeContext): EventCategoriesMap => { @@ -23175,7 +23499,14 @@ const deserializeAws_queryEventCategoriesMap = (output: any, context: __SerdeCon }; const deserializeAws_queryEventCategoriesMapList = (output: any, context: __SerdeContext): EventCategoriesMap[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventCategoriesMap(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventCategoriesMap(entry, context); + }); }; const deserializeAws_queryEventCategoriesMessage = (output: any, context: __SerdeContext): EventCategoriesMessage => { @@ -23198,7 +23529,14 @@ const deserializeAws_queryEventCategoriesMessage = (output: any, context: __Serd }; const deserializeAws_queryEventList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_queryEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEvent(entry, context); + }); }; const deserializeAws_queryEventsMessage = (output: any, context: __SerdeContext): EventsMessage => { @@ -23290,7 +23628,14 @@ const deserializeAws_queryEventSubscriptionQuotaExceededFault = ( }; const deserializeAws_queryEventSubscriptionsList = (output: any, context: __SerdeContext): EventSubscription[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventSubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventSubscription(entry, context); + }); }; const deserializeAws_queryEventSubscriptionsMessage = ( @@ -23415,7 +23760,14 @@ const deserializeAws_queryExportTaskNotFoundFault = (output: any, context: __Ser }; const deserializeAws_queryExportTasksList = (output: any, context: __SerdeContext): ExportTask[] => { - return (output || []).map((entry: any) => deserializeAws_queryExportTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryExportTask(entry, context); + }); }; const deserializeAws_queryExportTasksMessage = (output: any, context: __SerdeContext): ExportTasksMessage => { @@ -23449,7 +23801,14 @@ const deserializeAws_queryFailoverDBClusterResult = (output: any, context: __Ser }; const deserializeAws_queryFeatureNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryGlobalCluster = (output: any, context: __SerdeContext): GlobalCluster => { @@ -23521,7 +23880,14 @@ const deserializeAws_queryGlobalClusterAlreadyExistsFault = ( }; const deserializeAws_queryGlobalClusterList = (output: any, context: __SerdeContext): GlobalCluster[] => { - return (output || []).map((entry: any) => deserializeAws_queryGlobalCluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryGlobalCluster(entry, context); + }); }; const deserializeAws_queryGlobalClusterMember = (output: any, context: __SerdeContext): GlobalClusterMember => { @@ -23550,7 +23916,14 @@ const deserializeAws_queryGlobalClusterMember = (output: any, context: __SerdeCo }; const deserializeAws_queryGlobalClusterMemberList = (output: any, context: __SerdeContext): GlobalClusterMember[] => { - return (output || []).map((entry: any) => deserializeAws_queryGlobalClusterMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryGlobalClusterMember(entry, context); + }); }; const deserializeAws_queryGlobalClusterNotFoundFault = ( @@ -23687,7 +24060,14 @@ const deserializeAws_queryInstallationMediaFailureCause = ( }; const deserializeAws_queryInstallationMediaList = (output: any, context: __SerdeContext): InstallationMedia[] => { - return (output || []).map((entry: any) => deserializeAws_queryInstallationMedia(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryInstallationMedia(entry, context); + }); }; const deserializeAws_queryInstallationMediaMessage = ( @@ -24093,7 +24473,14 @@ const deserializeAws_queryIPRange = (output: any, context: __SerdeContext): IPRa }; const deserializeAws_queryIPRangeList = (output: any, context: __SerdeContext): IPRange[] => { - return (output || []).map((entry: any) => deserializeAws_queryIPRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryIPRange(entry, context); + }); }; const deserializeAws_queryKMSKeyNotAccessibleFault = ( @@ -24110,7 +24497,14 @@ const deserializeAws_queryKMSKeyNotAccessibleFault = ( }; const deserializeAws_queryLogTypeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryMinimumEngineVersionPerAllowedValue = ( @@ -24134,7 +24528,14 @@ const deserializeAws_queryMinimumEngineVersionPerAllowedValueList = ( output: any, context: __SerdeContext ): MinimumEngineVersionPerAllowedValue[] => { - return (output || []).map((entry: any) => deserializeAws_queryMinimumEngineVersionPerAllowedValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMinimumEngineVersionPerAllowedValue(entry, context); + }); }; const deserializeAws_queryModifyCertificatesResult = ( @@ -24422,7 +24823,14 @@ const deserializeAws_queryOptionGroupMembershipList = ( output: any, context: __SerdeContext ): OptionGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryOptionGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOptionGroupMembership(entry, context); + }); }; const deserializeAws_queryOptionGroupNotFoundFault = ( @@ -24595,11 +25003,25 @@ const deserializeAws_queryOptionGroupOptionSettingsList = ( output: any, context: __SerdeContext ): OptionGroupOptionSetting[] => { - return (output || []).map((entry: any) => deserializeAws_queryOptionGroupOptionSetting(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOptionGroupOptionSetting(entry, context); + }); }; const deserializeAws_queryOptionGroupOptionsList = (output: any, context: __SerdeContext): OptionGroupOption[] => { - return (output || []).map((entry: any) => deserializeAws_queryOptionGroupOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOptionGroupOption(entry, context); + }); }; const deserializeAws_queryOptionGroupOptionsMessage = ( @@ -24626,7 +25048,14 @@ const deserializeAws_queryOptionGroupOptionsMessage = ( }; const deserializeAws_queryOptionGroupOptionVersionsList = (output: any, context: __SerdeContext): OptionVersion[] => { - return (output || []).map((entry: any) => deserializeAws_queryOptionVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOptionVersion(entry, context); + }); }; const deserializeAws_queryOptionGroupQuotaExceededFault = ( @@ -24663,15 +25092,36 @@ const deserializeAws_queryOptionGroups = (output: any, context: __SerdeContext): }; const deserializeAws_queryOptionGroupsList = (output: any, context: __SerdeContext): OptionGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryOptionGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOptionGroup(entry, context); + }); }; const deserializeAws_queryOptionsConflictsWith = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryOptionsDependedOn = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryOptionSetting = (output: any, context: __SerdeContext): OptionSetting => { @@ -24717,11 +25167,25 @@ const deserializeAws_queryOptionSetting = (output: any, context: __SerdeContext) }; const deserializeAws_queryOptionSettingConfigurationList = (output: any, context: __SerdeContext): OptionSetting[] => { - return (output || []).map((entry: any) => deserializeAws_queryOptionSetting(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOptionSetting(entry, context); + }); }; const deserializeAws_queryOptionsList = (output: any, context: __SerdeContext): Option[] => { - return (output || []).map((entry: any) => deserializeAws_queryOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOption(entry, context); + }); }; const deserializeAws_queryOptionVersion = (output: any, context: __SerdeContext): OptionVersion => { @@ -24880,7 +25344,14 @@ const deserializeAws_queryOrderableDBInstanceOptionsList = ( output: any, context: __SerdeContext ): OrderableDBInstanceOption[] => { - return (output || []).map((entry: any) => deserializeAws_queryOrderableDBInstanceOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOrderableDBInstanceOption(entry, context); + }); }; const deserializeAws_queryOrderableDBInstanceOptionsMessage = ( @@ -24976,7 +25447,14 @@ const deserializeAws_queryParameter = (output: any, context: __SerdeContext): Pa }; const deserializeAws_queryParametersList = (output: any, context: __SerdeContext): Parameter[] => { - return (output || []).map((entry: any) => deserializeAws_queryParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryParameter(entry, context); + }); }; const deserializeAws_queryPendingCloudwatchLogsExports = ( @@ -25045,14 +25523,28 @@ const deserializeAws_queryPendingMaintenanceActionDetails = ( output: any, context: __SerdeContext ): PendingMaintenanceAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryPendingMaintenanceAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPendingMaintenanceAction(entry, context); + }); }; const deserializeAws_queryPendingMaintenanceActions = ( output: any, context: __SerdeContext ): ResourcePendingMaintenanceActions[] => { - return (output || []).map((entry: any) => deserializeAws_queryResourcePendingMaintenanceActions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryResourcePendingMaintenanceActions(entry, context); + }); }; const deserializeAws_queryPendingMaintenanceActionsMessage = ( @@ -25184,7 +25676,14 @@ const deserializeAws_queryProcessorFeature = (output: any, context: __SerdeConte }; const deserializeAws_queryProcessorFeatureList = (output: any, context: __SerdeContext): ProcessorFeature[] => { - return (output || []).map((entry: any) => deserializeAws_queryProcessorFeature(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryProcessorFeature(entry, context); + }); }; const deserializeAws_queryPromoteReadReplicaDBClusterResult = ( @@ -25258,23 +25757,58 @@ const deserializeAws_queryRange = (output: any, context: __SerdeContext): Range }; const deserializeAws_queryRangeList = (output: any, context: __SerdeContext): Range[] => { - return (output || []).map((entry: any) => deserializeAws_queryRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRange(entry, context); + }); }; const deserializeAws_queryReadersArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryReadReplicaDBClusterIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryReadReplicaDBInstanceIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryReadReplicaIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryRebootDBInstanceResult = (output: any, context: __SerdeContext): RebootDBInstanceResult => { @@ -25302,7 +25836,14 @@ const deserializeAws_queryRecurringCharge = (output: any, context: __SerdeContex }; const deserializeAws_queryRecurringChargeList = (output: any, context: __SerdeContext): RecurringCharge[] => { - return (output || []).map((entry: any) => deserializeAws_queryRecurringCharge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRecurringCharge(entry, context); + }); }; const deserializeAws_queryRegisterDBProxyTargetsResponse = ( @@ -25440,7 +25981,14 @@ const deserializeAws_queryReservedDBInstanceAlreadyExistsFault = ( }; const deserializeAws_queryReservedDBInstanceList = (output: any, context: __SerdeContext): ReservedDBInstance[] => { - return (output || []).map((entry: any) => deserializeAws_queryReservedDBInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReservedDBInstance(entry, context); + }); }; const deserializeAws_queryReservedDBInstanceMessage = ( @@ -25554,7 +26102,14 @@ const deserializeAws_queryReservedDBInstancesOfferingList = ( output: any, context: __SerdeContext ): ReservedDBInstancesOffering[] => { - return (output || []).map((entry: any) => deserializeAws_queryReservedDBInstancesOffering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReservedDBInstancesOffering(entry, context); + }); }; const deserializeAws_queryReservedDBInstancesOfferingMessage = ( @@ -25826,7 +26381,14 @@ const deserializeAws_querySNSTopicArnNotFoundFault = ( }; const deserializeAws_querySourceIdsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySourceNotFoundFault = (output: any, context: __SerdeContext): SourceNotFoundFault => { @@ -25863,7 +26425,14 @@ const deserializeAws_querySourceRegion = (output: any, context: __SerdeContext): }; const deserializeAws_querySourceRegionList = (output: any, context: __SerdeContext): SourceRegion[] => { - return (output || []).map((entry: any) => deserializeAws_querySourceRegion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySourceRegion(entry, context); + }); }; const deserializeAws_querySourceRegionMessage = (output: any, context: __SerdeContext): SourceRegionMessage => { @@ -26035,7 +26604,14 @@ const deserializeAws_queryStorageTypeNotSupportedFault = ( }; const deserializeAws_queryStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySubnet = (output: any, context: __SerdeContext): Subnet => { @@ -26071,7 +26647,14 @@ const deserializeAws_querySubnetAlreadyInUse = (output: any, context: __SerdeCon }; const deserializeAws_querySubnetList = (output: any, context: __SerdeContext): Subnet[] => { - return (output || []).map((entry: any) => deserializeAws_querySubnet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySubnet(entry, context); + }); }; const deserializeAws_querySubscriptionAlreadyExistFault = ( @@ -26114,11 +26697,25 @@ const deserializeAws_querySubscriptionNotFoundFault = ( }; const deserializeAws_querySupportedCharacterSetsList = (output: any, context: __SerdeContext): CharacterSet[] => { - return (output || []).map((entry: any) => deserializeAws_queryCharacterSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCharacterSet(entry, context); + }); }; const deserializeAws_querySupportedTimezonesList = (output: any, context: __SerdeContext): Timezone[] => { - return (output || []).map((entry: any) => deserializeAws_queryTimezone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTimezone(entry, context); + }); }; const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { @@ -26136,7 +26733,14 @@ const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTagListMessage = (output: any, context: __SerdeContext): TagListMessage => { @@ -26153,7 +26757,14 @@ const deserializeAws_queryTagListMessage = (output: any, context: __SerdeContext }; const deserializeAws_queryTargetGroupList = (output: any, context: __SerdeContext): DBProxyTargetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBProxyTargetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBProxyTargetGroup(entry, context); + }); }; const deserializeAws_queryTargetHealth = (output: any, context: __SerdeContext): TargetHealth => { @@ -26175,7 +26786,14 @@ const deserializeAws_queryTargetHealth = (output: any, context: __SerdeContext): }; const deserializeAws_queryTargetList = (output: any, context: __SerdeContext): DBProxyTarget[] => { - return (output || []).map((entry: any) => deserializeAws_queryDBProxyTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDBProxyTarget(entry, context); + }); }; const deserializeAws_queryTimezone = (output: any, context: __SerdeContext): Timezone => { @@ -26241,7 +26859,14 @@ const deserializeAws_queryUserAuthConfigInfo = (output: any, context: __SerdeCon }; const deserializeAws_queryUserAuthConfigInfoList = (output: any, context: __SerdeContext): UserAuthConfigInfo[] => { - return (output || []).map((entry: any) => deserializeAws_queryUserAuthConfigInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUserAuthConfigInfo(entry, context); + }); }; const deserializeAws_queryValidDBInstanceModificationsMessage = ( @@ -26321,11 +26946,25 @@ const deserializeAws_queryValidStorageOptions = (output: any, context: __SerdeCo }; const deserializeAws_queryValidStorageOptionsList = (output: any, context: __SerdeContext): ValidStorageOptions[] => { - return (output || []).map((entry: any) => deserializeAws_queryValidStorageOptions(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryValidStorageOptions(entry, context); + }); }; const deserializeAws_queryValidUpgradeTargetList = (output: any, context: __SerdeContext): UpgradeTarget[] => { - return (output || []).map((entry: any) => deserializeAws_queryUpgradeTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUpgradeTarget(entry, context); + }); }; const deserializeAws_queryVpcSecurityGroupMembership = ( @@ -26349,7 +26988,14 @@ const deserializeAws_queryVpcSecurityGroupMembershipList = ( output: any, context: __SerdeContext ): VpcSecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryVpcSecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryVpcSecurityGroupMembership(entry, context); + }); }; const deserializeAws_queryVpnDetails = (output: any, context: __SerdeContext): VpnDetails => { diff --git a/clients/client-redshift-data/protocols/Aws_json1_1.ts b/clients/client-redshift-data/protocols/Aws_json1_1.ts index 1b3bc1ee4dfb..c2223249ed0d 100644 --- a/clients/client-redshift-data/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-data/protocols/Aws_json1_1.ts @@ -50,7 +50,7 @@ export const serializeAws_json1_1CancelStatementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RedshiftData.CancelStatement", }; let body: any; @@ -63,7 +63,7 @@ export const serializeAws_json1_1DescribeStatementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RedshiftData.DescribeStatement", }; let body: any; @@ -76,7 +76,7 @@ export const serializeAws_json1_1DescribeTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RedshiftData.DescribeTable", }; let body: any; @@ -89,7 +89,7 @@ export const serializeAws_json1_1ExecuteStatementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RedshiftData.ExecuteStatement", }; let body: any; @@ -102,7 +102,7 @@ export const serializeAws_json1_1GetStatementResultCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RedshiftData.GetStatementResult", }; let body: any; @@ -115,7 +115,7 @@ export const serializeAws_json1_1ListDatabasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RedshiftData.ListDatabases", }; let body: any; @@ -128,7 +128,7 @@ export const serializeAws_json1_1ListSchemasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RedshiftData.ListSchemas", }; let body: any; @@ -141,7 +141,7 @@ export const serializeAws_json1_1ListStatementsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RedshiftData.ListStatements", }; let body: any; @@ -154,7 +154,7 @@ export const serializeAws_json1_1ListTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RedshiftData.ListTables", }; let body: any; @@ -189,8 +189,7 @@ const deserializeAws_json1_1CancelStatementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.redshiftdata#InternalServerException": @@ -252,8 +251,7 @@ const deserializeAws_json1_1DescribeStatementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.redshiftdata#InternalServerException": @@ -323,8 +321,7 @@ const deserializeAws_json1_1DescribeTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.redshiftdata#InternalServerException": @@ -386,8 +383,7 @@ const deserializeAws_json1_1ExecuteStatementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExecuteStatementException": case "com.amazonaws.redshiftdata#ExecuteStatementException": @@ -449,8 +445,7 @@ const deserializeAws_json1_1GetStatementResultCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.redshiftdata#InternalServerException": @@ -520,8 +515,7 @@ const deserializeAws_json1_1ListDatabasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.redshiftdata#InternalServerException": @@ -583,8 +577,7 @@ const deserializeAws_json1_1ListSchemasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.redshiftdata#InternalServerException": @@ -646,8 +639,7 @@ const deserializeAws_json1_1ListStatementsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.redshiftdata#InternalServerException": @@ -709,8 +701,7 @@ const deserializeAws_json1_1ListTablesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.redshiftdata#InternalServerException": @@ -807,7 +798,7 @@ const deserializeAws_json1_1ValidationExceptionResponse = async ( const serializeAws_json1_1CancelStatementRequest = (input: CancelStatementRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -816,32 +807,34 @@ const serializeAws_json1_1DescribeStatementRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_json1_1DescribeTableRequest = (input: DescribeTableRequest, context: __SerdeContext): any => { return { - ...(input.ClusterIdentifier !== undefined && { ClusterIdentifier: input.ClusterIdentifier }), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Schema !== undefined && { Schema: input.Schema }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), - ...(input.Table !== undefined && { Table: input.Table }), + ...(input.ClusterIdentifier !== undefined && + input.ClusterIdentifier !== null && { ClusterIdentifier: input.ClusterIdentifier }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Schema !== undefined && input.Schema !== null && { Schema: input.Schema }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), + ...(input.Table !== undefined && input.Table !== null && { Table: input.Table }), }; }; const serializeAws_json1_1ExecuteStatementInput = (input: ExecuteStatementInput, context: __SerdeContext): any => { return { - ...(input.ClusterIdentifier !== undefined && { ClusterIdentifier: input.ClusterIdentifier }), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), - ...(input.Sql !== undefined && { Sql: input.Sql }), - ...(input.StatementName !== undefined && { StatementName: input.StatementName }), - ...(input.WithEvent !== undefined && { WithEvent: input.WithEvent }), + ...(input.ClusterIdentifier !== undefined && + input.ClusterIdentifier !== null && { ClusterIdentifier: input.ClusterIdentifier }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), + ...(input.Sql !== undefined && input.Sql !== null && { Sql: input.Sql }), + ...(input.StatementName !== undefined && input.StatementName !== null && { StatementName: input.StatementName }), + ...(input.WithEvent !== undefined && input.WithEvent !== null && { WithEvent: input.WithEvent }), }; }; @@ -850,53 +843,56 @@ const serializeAws_json1_1GetStatementResultRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListDatabasesRequest = (input: ListDatabasesRequest, context: __SerdeContext): any => { return { - ...(input.ClusterIdentifier !== undefined && { ClusterIdentifier: input.ClusterIdentifier }), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), + ...(input.ClusterIdentifier !== undefined && + input.ClusterIdentifier !== null && { ClusterIdentifier: input.ClusterIdentifier }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), }; }; const serializeAws_json1_1ListSchemasRequest = (input: ListSchemasRequest, context: __SerdeContext): any => { return { - ...(input.ClusterIdentifier !== undefined && { ClusterIdentifier: input.ClusterIdentifier }), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SchemaPattern !== undefined && { SchemaPattern: input.SchemaPattern }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), + ...(input.ClusterIdentifier !== undefined && + input.ClusterIdentifier !== null && { ClusterIdentifier: input.ClusterIdentifier }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SchemaPattern !== undefined && input.SchemaPattern !== null && { SchemaPattern: input.SchemaPattern }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), }; }; const serializeAws_json1_1ListStatementsRequest = (input: ListStatementsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StatementName !== undefined && { StatementName: input.StatementName }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StatementName !== undefined && input.StatementName !== null && { StatementName: input.StatementName }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; const serializeAws_json1_1ListTablesRequest = (input: ListTablesRequest, context: __SerdeContext): any => { return { - ...(input.ClusterIdentifier !== undefined && { ClusterIdentifier: input.ClusterIdentifier }), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SchemaPattern !== undefined && { SchemaPattern: input.SchemaPattern }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), - ...(input.TablePattern !== undefined && { TablePattern: input.TablePattern }), + ...(input.ClusterIdentifier !== undefined && + input.ClusterIdentifier !== null && { ClusterIdentifier: input.ClusterIdentifier }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SchemaPattern !== undefined && input.SchemaPattern !== null && { SchemaPattern: input.SchemaPattern }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), + ...(input.TablePattern !== undefined && input.TablePattern !== null && { TablePattern: input.TablePattern }), }; }; @@ -910,7 +906,14 @@ const deserializeAws_json1_1CancelStatementResponse = ( }; const deserializeAws_json1_1ColumnList = (output: any, context: __SerdeContext): ColumnMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ColumnMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ColumnMetadata(entry, context); + }); }; const deserializeAws_json1_1ColumnMetadata = (output: any, context: __SerdeContext): ColumnMetadata => { @@ -934,11 +937,25 @@ const deserializeAws_json1_1ColumnMetadata = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ColumnMetadataList = (output: any, context: __SerdeContext): ColumnMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ColumnMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ColumnMetadata(entry, context); + }); }; const deserializeAws_json1_1DatabaseList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DescribeStatementResponse = ( @@ -1047,7 +1064,14 @@ const deserializeAws_json1_1Field = (output: any, context: __SerdeContext): Fiel }; const deserializeAws_json1_1FieldList = (output: any, context: __SerdeContext): Field[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Field(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Field(entry, context); + }); }; const deserializeAws_json1_1GetStatementResultResponse = ( @@ -1128,11 +1152,25 @@ const deserializeAws_json1_1ResourceNotFoundException = ( }; const deserializeAws_json1_1SchemaList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SqlRecords = (output: any, context: __SerdeContext): Field[][] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FieldList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FieldList(entry, context); + }); }; const deserializeAws_json1_1StatementData = (output: any, context: __SerdeContext): StatementData => { @@ -1155,11 +1193,25 @@ const deserializeAws_json1_1StatementData = (output: any, context: __SerdeContex }; const deserializeAws_json1_1StatementList = (output: any, context: __SerdeContext): StatementData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StatementData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StatementData(entry, context); + }); }; const deserializeAws_json1_1TableList = (output: any, context: __SerdeContext): TableMember[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TableMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TableMember(entry, context); + }); }; const deserializeAws_json1_1TableMember = (output: any, context: __SerdeContext): TableMember => { @@ -1226,3 +1278,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-redshift/protocols/Aws_query.ts b/clients/client-redshift/protocols/Aws_query.ts index a8c38d50f4fb..d2dcc6ee91fd 100644 --- a/clients/client-redshift/protocols/Aws_query.ts +++ b/clients/client-redshift/protocols/Aws_query.ts @@ -656,7 +656,7 @@ export const serializeAws_queryAcceptReservedNodeExchangeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -672,7 +672,7 @@ export const serializeAws_queryAuthorizeClusterSecurityGroupIngressCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -688,7 +688,7 @@ export const serializeAws_queryAuthorizeSnapshotAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -704,7 +704,7 @@ export const serializeAws_queryBatchDeleteClusterSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -720,7 +720,7 @@ export const serializeAws_queryBatchModifyClusterSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -736,7 +736,7 @@ export const serializeAws_queryCancelResizeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -752,7 +752,7 @@ export const serializeAws_queryCopyClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -768,7 +768,7 @@ export const serializeAws_queryCreateClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -784,7 +784,7 @@ export const serializeAws_queryCreateClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -800,7 +800,7 @@ export const serializeAws_queryCreateClusterSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -816,7 +816,7 @@ export const serializeAws_queryCreateClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -832,7 +832,7 @@ export const serializeAws_queryCreateClusterSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -848,7 +848,7 @@ export const serializeAws_queryCreateEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -864,7 +864,7 @@ export const serializeAws_queryCreateHsmClientCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -880,7 +880,7 @@ export const serializeAws_queryCreateHsmConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -896,7 +896,7 @@ export const serializeAws_queryCreateScheduledActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -912,7 +912,7 @@ export const serializeAws_queryCreateSnapshotCopyGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -928,7 +928,7 @@ export const serializeAws_queryCreateSnapshotScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -944,7 +944,7 @@ export const serializeAws_queryCreateTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -960,7 +960,7 @@ export const serializeAws_queryCreateUsageLimitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -976,7 +976,7 @@ export const serializeAws_queryDeleteClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -992,7 +992,7 @@ export const serializeAws_queryDeleteClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1008,7 +1008,7 @@ export const serializeAws_queryDeleteClusterSecurityGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1024,7 +1024,7 @@ export const serializeAws_queryDeleteClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1040,7 +1040,7 @@ export const serializeAws_queryDeleteClusterSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1056,7 +1056,7 @@ export const serializeAws_queryDeleteEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1072,7 +1072,7 @@ export const serializeAws_queryDeleteHsmClientCertificateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1088,7 +1088,7 @@ export const serializeAws_queryDeleteHsmConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1104,7 +1104,7 @@ export const serializeAws_queryDeleteScheduledActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1120,7 +1120,7 @@ export const serializeAws_queryDeleteSnapshotCopyGrantCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1136,7 +1136,7 @@ export const serializeAws_queryDeleteSnapshotScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1152,7 +1152,7 @@ export const serializeAws_queryDeleteTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1168,7 +1168,7 @@ export const serializeAws_queryDeleteUsageLimitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1184,7 +1184,7 @@ export const serializeAws_queryDescribeAccountAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1200,7 +1200,7 @@ export const serializeAws_queryDescribeClusterDbRevisionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1216,7 +1216,7 @@ export const serializeAws_queryDescribeClusterParameterGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1232,7 +1232,7 @@ export const serializeAws_queryDescribeClusterParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1248,7 +1248,7 @@ export const serializeAws_queryDescribeClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1264,7 +1264,7 @@ export const serializeAws_queryDescribeClusterSecurityGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1280,7 +1280,7 @@ export const serializeAws_queryDescribeClusterSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1296,7 +1296,7 @@ export const serializeAws_queryDescribeClusterSubnetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1312,7 +1312,7 @@ export const serializeAws_queryDescribeClusterTracksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1328,7 +1328,7 @@ export const serializeAws_queryDescribeClusterVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1344,7 +1344,7 @@ export const serializeAws_queryDescribeDefaultClusterParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1360,7 +1360,7 @@ export const serializeAws_queryDescribeEventCategoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1376,7 +1376,7 @@ export const serializeAws_queryDescribeEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1392,7 +1392,7 @@ export const serializeAws_queryDescribeEventSubscriptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1408,7 +1408,7 @@ export const serializeAws_queryDescribeHsmClientCertificatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1424,7 +1424,7 @@ export const serializeAws_queryDescribeHsmConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1440,7 +1440,7 @@ export const serializeAws_queryDescribeLoggingStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1456,7 +1456,7 @@ export const serializeAws_queryDescribeNodeConfigurationOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1472,7 +1472,7 @@ export const serializeAws_queryDescribeOrderableClusterOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1488,7 +1488,7 @@ export const serializeAws_queryDescribeReservedNodeOfferingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1504,7 +1504,7 @@ export const serializeAws_queryDescribeReservedNodesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1520,7 +1520,7 @@ export const serializeAws_queryDescribeResizeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1536,7 +1536,7 @@ export const serializeAws_queryDescribeScheduledActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1552,7 +1552,7 @@ export const serializeAws_queryDescribeSnapshotCopyGrantsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1568,7 +1568,7 @@ export const serializeAws_queryDescribeSnapshotSchedulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1584,7 +1584,7 @@ export const serializeAws_queryDescribeStorageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "DescribeStorage", @@ -1598,7 +1598,7 @@ export const serializeAws_queryDescribeTableRestoreStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1614,7 +1614,7 @@ export const serializeAws_queryDescribeTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1630,7 +1630,7 @@ export const serializeAws_queryDescribeUsageLimitsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1646,7 +1646,7 @@ export const serializeAws_queryDisableLoggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1662,7 +1662,7 @@ export const serializeAws_queryDisableSnapshotCopyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1678,7 +1678,7 @@ export const serializeAws_queryEnableLoggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1694,7 +1694,7 @@ export const serializeAws_queryEnableSnapshotCopyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1710,7 +1710,7 @@ export const serializeAws_queryGetClusterCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1726,7 +1726,7 @@ export const serializeAws_queryGetReservedNodeExchangeOfferingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1742,7 +1742,7 @@ export const serializeAws_queryModifyClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1758,7 +1758,7 @@ export const serializeAws_queryModifyClusterDbRevisionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1774,7 +1774,7 @@ export const serializeAws_queryModifyClusterIamRolesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1790,7 +1790,7 @@ export const serializeAws_queryModifyClusterMaintenanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1806,7 +1806,7 @@ export const serializeAws_queryModifyClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1822,7 +1822,7 @@ export const serializeAws_queryModifyClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1838,7 +1838,7 @@ export const serializeAws_queryModifyClusterSnapshotScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1854,7 +1854,7 @@ export const serializeAws_queryModifyClusterSubnetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1870,7 +1870,7 @@ export const serializeAws_queryModifyEventSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1886,7 +1886,7 @@ export const serializeAws_queryModifyScheduledActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1902,7 +1902,7 @@ export const serializeAws_queryModifySnapshotCopyRetentionPeriodCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1918,7 +1918,7 @@ export const serializeAws_queryModifySnapshotScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1934,7 +1934,7 @@ export const serializeAws_queryModifyUsageLimitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1950,7 +1950,7 @@ export const serializeAws_queryPauseClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1966,7 +1966,7 @@ export const serializeAws_queryPurchaseReservedNodeOfferingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1982,7 +1982,7 @@ export const serializeAws_queryRebootClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1998,7 +1998,7 @@ export const serializeAws_queryResetClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2014,7 +2014,7 @@ export const serializeAws_queryResizeClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2030,7 +2030,7 @@ export const serializeAws_queryRestoreFromClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2046,7 +2046,7 @@ export const serializeAws_queryRestoreTableFromClusterSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2062,7 +2062,7 @@ export const serializeAws_queryResumeClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2078,7 +2078,7 @@ export const serializeAws_queryRevokeClusterSecurityGroupIngressCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2094,7 +2094,7 @@ export const serializeAws_queryRevokeSnapshotAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -2110,7 +2110,7 @@ export const serializeAws_queryRotateEncryptionKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -10780,10 +10780,10 @@ const serializeAws_queryAcceptReservedNodeExchangeInputMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedNodeId !== undefined) { + if (input.ReservedNodeId !== undefined && input.ReservedNodeId !== null) { entries["ReservedNodeId"] = input.ReservedNodeId; } - if (input.TargetReservedNodeOfferingId !== undefined) { + if (input.TargetReservedNodeOfferingId !== undefined && input.TargetReservedNodeOfferingId !== null) { entries["TargetReservedNodeOfferingId"] = input.TargetReservedNodeOfferingId; } return entries; @@ -10793,6 +10793,9 @@ const serializeAws_queryAttributeNameList = (input: string[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`AttributeName.${counter}`] = entry; counter++; } @@ -10804,16 +10807,16 @@ const serializeAws_queryAuthorizeClusterSecurityGroupIngressMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterSecurityGroupName !== undefined) { + if (input.ClusterSecurityGroupName !== undefined && input.ClusterSecurityGroupName !== null) { entries["ClusterSecurityGroupName"] = input.ClusterSecurityGroupName; } - if (input.CIDRIP !== undefined) { + if (input.CIDRIP !== undefined && input.CIDRIP !== null) { entries["CIDRIP"] = input.CIDRIP; } - if (input.EC2SecurityGroupName !== undefined) { + if (input.EC2SecurityGroupName !== undefined && input.EC2SecurityGroupName !== null) { entries["EC2SecurityGroupName"] = input.EC2SecurityGroupName; } - if (input.EC2SecurityGroupOwnerId !== undefined) { + if (input.EC2SecurityGroupOwnerId !== undefined && input.EC2SecurityGroupOwnerId !== null) { entries["EC2SecurityGroupOwnerId"] = input.EC2SecurityGroupOwnerId; } return entries; @@ -10824,13 +10827,13 @@ const serializeAws_queryAuthorizeSnapshotAccessMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.SnapshotClusterIdentifier !== undefined) { + if (input.SnapshotClusterIdentifier !== undefined && input.SnapshotClusterIdentifier !== null) { entries["SnapshotClusterIdentifier"] = input.SnapshotClusterIdentifier; } - if (input.AccountWithRestoreAccess !== undefined) { + if (input.AccountWithRestoreAccess !== undefined && input.AccountWithRestoreAccess !== null) { entries["AccountWithRestoreAccess"] = input.AccountWithRestoreAccess; } return entries; @@ -10841,7 +10844,7 @@ const serializeAws_queryBatchDeleteClusterSnapshotsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Identifiers !== undefined) { + if (input.Identifiers !== undefined && input.Identifiers !== null) { const memberEntries = serializeAws_queryDeleteClusterSnapshotMessageList(input.Identifiers, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Identifiers.${key}`; @@ -10856,17 +10859,17 @@ const serializeAws_queryBatchModifyClusterSnapshotsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SnapshotIdentifierList !== undefined) { + if (input.SnapshotIdentifierList !== undefined && input.SnapshotIdentifierList !== null) { const memberEntries = serializeAws_querySnapshotIdentifierList(input.SnapshotIdentifierList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SnapshotIdentifierList.${key}`; entries[loc] = value; }); } - if (input.ManualSnapshotRetentionPeriod !== undefined) { + if (input.ManualSnapshotRetentionPeriod !== undefined && input.ManualSnapshotRetentionPeriod !== null) { entries["ManualSnapshotRetentionPeriod"] = input.ManualSnapshotRetentionPeriod; } - if (input.Force !== undefined) { + if (input.Force !== undefined && input.Force !== null) { entries["Force"] = input.Force; } return entries; @@ -10874,7 +10877,7 @@ const serializeAws_queryBatchModifyClusterSnapshotsMessage = ( const serializeAws_queryCancelResizeMessage = (input: CancelResizeMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } return entries; @@ -10884,6 +10887,9 @@ const serializeAws_queryClusterSecurityGroupNameList = (input: string[], context const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ClusterSecurityGroupName.${counter}`] = entry; counter++; } @@ -10895,16 +10901,16 @@ const serializeAws_queryCopyClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceSnapshotIdentifier !== undefined) { + if (input.SourceSnapshotIdentifier !== undefined && input.SourceSnapshotIdentifier !== null) { entries["SourceSnapshotIdentifier"] = input.SourceSnapshotIdentifier; } - if (input.SourceSnapshotClusterIdentifier !== undefined) { + if (input.SourceSnapshotClusterIdentifier !== undefined && input.SourceSnapshotClusterIdentifier !== null) { entries["SourceSnapshotClusterIdentifier"] = input.SourceSnapshotClusterIdentifier; } - if (input.TargetSnapshotIdentifier !== undefined) { + if (input.TargetSnapshotIdentifier !== undefined && input.TargetSnapshotIdentifier !== null) { entries["TargetSnapshotIdentifier"] = input.TargetSnapshotIdentifier; } - if (input.ManualSnapshotRetentionPeriod !== undefined) { + if (input.ManualSnapshotRetentionPeriod !== undefined && input.ManualSnapshotRetentionPeriod !== null) { entries["ManualSnapshotRetentionPeriod"] = input.ManualSnapshotRetentionPeriod; } return entries; @@ -10912,113 +10918,113 @@ const serializeAws_queryCopyClusterSnapshotMessage = ( const serializeAws_queryCreateClusterMessage = (input: CreateClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.DBName !== undefined) { + if (input.DBName !== undefined && input.DBName !== null) { entries["DBName"] = input.DBName; } - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.ClusterType !== undefined) { + if (input.ClusterType !== undefined && input.ClusterType !== null) { entries["ClusterType"] = input.ClusterType; } - if (input.NodeType !== undefined) { + if (input.NodeType !== undefined && input.NodeType !== null) { entries["NodeType"] = input.NodeType; } - if (input.MasterUsername !== undefined) { + if (input.MasterUsername !== undefined && input.MasterUsername !== null) { entries["MasterUsername"] = input.MasterUsername; } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.ClusterSecurityGroups !== undefined) { + if (input.ClusterSecurityGroups !== undefined && input.ClusterSecurityGroups !== null) { const memberEntries = serializeAws_queryClusterSecurityGroupNameList(input.ClusterSecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClusterSecurityGroups.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.ClusterSubnetGroupName !== undefined) { + if (input.ClusterSubnetGroupName !== undefined && input.ClusterSubnetGroupName !== null) { entries["ClusterSubnetGroupName"] = input.ClusterSubnetGroupName; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.ClusterParameterGroupName !== undefined) { + if (input.ClusterParameterGroupName !== undefined && input.ClusterParameterGroupName !== null) { entries["ClusterParameterGroupName"] = input.ClusterParameterGroupName; } - if (input.AutomatedSnapshotRetentionPeriod !== undefined) { + if (input.AutomatedSnapshotRetentionPeriod !== undefined && input.AutomatedSnapshotRetentionPeriod !== null) { entries["AutomatedSnapshotRetentionPeriod"] = input.AutomatedSnapshotRetentionPeriod; } - if (input.ManualSnapshotRetentionPeriod !== undefined) { + if (input.ManualSnapshotRetentionPeriod !== undefined && input.ManualSnapshotRetentionPeriod !== null) { entries["ManualSnapshotRetentionPeriod"] = input.ManualSnapshotRetentionPeriod; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.ClusterVersion !== undefined) { + if (input.ClusterVersion !== undefined && input.ClusterVersion !== null) { entries["ClusterVersion"] = input.ClusterVersion; } - if (input.AllowVersionUpgrade !== undefined) { + if (input.AllowVersionUpgrade !== undefined && input.AllowVersionUpgrade !== null) { entries["AllowVersionUpgrade"] = input.AllowVersionUpgrade; } - if (input.NumberOfNodes !== undefined) { + if (input.NumberOfNodes !== undefined && input.NumberOfNodes !== null) { entries["NumberOfNodes"] = input.NumberOfNodes; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } - if (input.HsmClientCertificateIdentifier !== undefined) { + if (input.HsmClientCertificateIdentifier !== undefined && input.HsmClientCertificateIdentifier !== null) { entries["HsmClientCertificateIdentifier"] = input.HsmClientCertificateIdentifier; } - if (input.HsmConfigurationIdentifier !== undefined) { + if (input.HsmConfigurationIdentifier !== undefined && input.HsmConfigurationIdentifier !== null) { entries["HsmConfigurationIdentifier"] = input.HsmConfigurationIdentifier; } - if (input.ElasticIp !== undefined) { + if (input.ElasticIp !== undefined && input.ElasticIp !== null) { entries["ElasticIp"] = input.ElasticIp; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.EnhancedVpcRouting !== undefined) { + if (input.EnhancedVpcRouting !== undefined && input.EnhancedVpcRouting !== null) { entries["EnhancedVpcRouting"] = input.EnhancedVpcRouting; } - if (input.AdditionalInfo !== undefined) { + if (input.AdditionalInfo !== undefined && input.AdditionalInfo !== null) { entries["AdditionalInfo"] = input.AdditionalInfo; } - if (input.IamRoles !== undefined) { + if (input.IamRoles !== undefined && input.IamRoles !== null) { const memberEntries = serializeAws_queryIamRoleArnList(input.IamRoles, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IamRoles.${key}`; entries[loc] = value; }); } - if (input.MaintenanceTrackName !== undefined) { + if (input.MaintenanceTrackName !== undefined && input.MaintenanceTrackName !== null) { entries["MaintenanceTrackName"] = input.MaintenanceTrackName; } - if (input.SnapshotScheduleIdentifier !== undefined) { + if (input.SnapshotScheduleIdentifier !== undefined && input.SnapshotScheduleIdentifier !== null) { entries["SnapshotScheduleIdentifier"] = input.SnapshotScheduleIdentifier; } - if (input.AvailabilityZoneRelocation !== undefined) { + if (input.AvailabilityZoneRelocation !== undefined && input.AvailabilityZoneRelocation !== null) { entries["AvailabilityZoneRelocation"] = input.AvailabilityZoneRelocation; } return entries; @@ -11029,16 +11035,16 @@ const serializeAws_queryCreateClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ParameterGroupName !== undefined) { + if (input.ParameterGroupName !== undefined && input.ParameterGroupName !== null) { entries["ParameterGroupName"] = input.ParameterGroupName; } - if (input.ParameterGroupFamily !== undefined) { + if (input.ParameterGroupFamily !== undefined && input.ParameterGroupFamily !== null) { entries["ParameterGroupFamily"] = input.ParameterGroupFamily; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11053,13 +11059,13 @@ const serializeAws_queryCreateClusterSecurityGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterSecurityGroupName !== undefined) { + if (input.ClusterSecurityGroupName !== undefined && input.ClusterSecurityGroupName !== null) { entries["ClusterSecurityGroupName"] = input.ClusterSecurityGroupName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11074,16 +11080,16 @@ const serializeAws_queryCreateClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.ManualSnapshotRetentionPeriod !== undefined) { + if (input.ManualSnapshotRetentionPeriod !== undefined && input.ManualSnapshotRetentionPeriod !== null) { entries["ManualSnapshotRetentionPeriod"] = input.ManualSnapshotRetentionPeriod; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11098,20 +11104,20 @@ const serializeAws_queryCreateClusterSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterSubnetGroupName !== undefined) { + if (input.ClusterSubnetGroupName !== undefined && input.ClusterSubnetGroupName !== null) { entries["ClusterSubnetGroupName"] = input.ClusterSubnetGroupName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11126,36 +11132,36 @@ const serializeAws_queryCreateEventSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.SnsTopicArn !== undefined) { + if (input.SnsTopicArn !== undefined && input.SnsTopicArn !== null) { entries["SnsTopicArn"] = input.SnsTopicArn; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.SourceIds !== undefined) { + if (input.SourceIds !== undefined && input.SourceIds !== null) { const memberEntries = serializeAws_querySourceIdsList(input.SourceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceIds.${key}`; entries[loc] = value; }); } - if (input.EventCategories !== undefined) { + if (input.EventCategories !== undefined && input.EventCategories !== null) { const memberEntries = serializeAws_queryEventCategoriesList(input.EventCategories, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventCategories.${key}`; entries[loc] = value; }); } - if (input.Severity !== undefined) { + if (input.Severity !== undefined && input.Severity !== null) { entries["Severity"] = input.Severity; } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11170,10 +11176,10 @@ const serializeAws_queryCreateHsmClientCertificateMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HsmClientCertificateIdentifier !== undefined) { + if (input.HsmClientCertificateIdentifier !== undefined && input.HsmClientCertificateIdentifier !== null) { entries["HsmClientCertificateIdentifier"] = input.HsmClientCertificateIdentifier; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11188,25 +11194,25 @@ const serializeAws_queryCreateHsmConfigurationMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HsmConfigurationIdentifier !== undefined) { + if (input.HsmConfigurationIdentifier !== undefined && input.HsmConfigurationIdentifier !== null) { entries["HsmConfigurationIdentifier"] = input.HsmConfigurationIdentifier; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.HsmIpAddress !== undefined) { + if (input.HsmIpAddress !== undefined && input.HsmIpAddress !== null) { entries["HsmIpAddress"] = input.HsmIpAddress; } - if (input.HsmPartitionName !== undefined) { + if (input.HsmPartitionName !== undefined && input.HsmPartitionName !== null) { entries["HsmPartitionName"] = input.HsmPartitionName; } - if (input.HsmPartitionPassword !== undefined) { + if (input.HsmPartitionPassword !== undefined && input.HsmPartitionPassword !== null) { entries["HsmPartitionPassword"] = input.HsmPartitionPassword; } - if (input.HsmServerPublicCertificate !== undefined) { + if (input.HsmServerPublicCertificate !== undefined && input.HsmServerPublicCertificate !== null) { entries["HsmServerPublicCertificate"] = input.HsmServerPublicCertificate; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11221,32 +11227,32 @@ const serializeAws_queryCreateScheduledActionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ScheduledActionName !== undefined) { + if (input.ScheduledActionName !== undefined && input.ScheduledActionName !== null) { entries["ScheduledActionName"] = input.ScheduledActionName; } - if (input.TargetAction !== undefined) { + if (input.TargetAction !== undefined && input.TargetAction !== null) { const memberEntries = serializeAws_queryScheduledActionType(input.TargetAction, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetAction.${key}`; entries[loc] = value; }); } - if (input.Schedule !== undefined) { + if (input.Schedule !== undefined && input.Schedule !== null) { entries["Schedule"] = input.Schedule; } - if (input.IamRole !== undefined) { + if (input.IamRole !== undefined && input.IamRole !== null) { entries["IamRole"] = input.IamRole; } - if (input.ScheduledActionDescription !== undefined) { + if (input.ScheduledActionDescription !== undefined && input.ScheduledActionDescription !== null) { entries["ScheduledActionDescription"] = input.ScheduledActionDescription; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Enable !== undefined) { + if (input.Enable !== undefined && input.Enable !== null) { entries["Enable"] = input.Enable; } return entries; @@ -11257,13 +11263,13 @@ const serializeAws_queryCreateSnapshotCopyGrantMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SnapshotCopyGrantName !== undefined) { + if (input.SnapshotCopyGrantName !== undefined && input.SnapshotCopyGrantName !== null) { entries["SnapshotCopyGrantName"] = input.SnapshotCopyGrantName; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11278,30 +11284,30 @@ const serializeAws_queryCreateSnapshotScheduleMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ScheduleDefinitions !== undefined) { + if (input.ScheduleDefinitions !== undefined && input.ScheduleDefinitions !== null) { const memberEntries = serializeAws_queryScheduleDefinitionList(input.ScheduleDefinitions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScheduleDefinitions.${key}`; entries[loc] = value; }); } - if (input.ScheduleIdentifier !== undefined) { + if (input.ScheduleIdentifier !== undefined && input.ScheduleIdentifier !== null) { entries["ScheduleIdentifier"] = input.ScheduleIdentifier; } - if (input.ScheduleDescription !== undefined) { + if (input.ScheduleDescription !== undefined && input.ScheduleDescription !== null) { entries["ScheduleDescription"] = input.ScheduleDescription; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.DryRun !== undefined) { + if (input.DryRun !== undefined && input.DryRun !== null) { entries["DryRun"] = input.DryRun; } - if (input.NextInvocations !== undefined) { + if (input.NextInvocations !== undefined && input.NextInvocations !== null) { entries["NextInvocations"] = input.NextInvocations; } return entries; @@ -11309,10 +11315,10 @@ const serializeAws_queryCreateSnapshotScheduleMessage = ( const serializeAws_queryCreateTagsMessage = (input: CreateTagsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11324,25 +11330,25 @@ const serializeAws_queryCreateTagsMessage = (input: CreateTagsMessage, context: const serializeAws_queryCreateUsageLimitMessage = (input: CreateUsageLimitMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.FeatureType !== undefined) { + if (input.FeatureType !== undefined && input.FeatureType !== null) { entries["FeatureType"] = input.FeatureType; } - if (input.LimitType !== undefined) { + if (input.LimitType !== undefined && input.LimitType !== null) { entries["LimitType"] = input.LimitType; } - if (input.Amount !== undefined) { + if (input.Amount !== undefined && input.Amount !== null) { entries["Amount"] = input.Amount; } - if (input.Period !== undefined) { + if (input.Period !== undefined && input.Period !== null) { entries["Period"] = input.Period; } - if (input.BreachAction !== undefined) { + if (input.BreachAction !== undefined && input.BreachAction !== null) { entries["BreachAction"] = input.BreachAction; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -11356,6 +11362,9 @@ const serializeAws_queryDbGroupList = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`DbGroup.${counter}`] = entry; counter++; } @@ -11364,16 +11373,16 @@ const serializeAws_queryDbGroupList = (input: string[], context: __SerdeContext) const serializeAws_queryDeleteClusterMessage = (input: DeleteClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.SkipFinalClusterSnapshot !== undefined) { + if (input.SkipFinalClusterSnapshot !== undefined && input.SkipFinalClusterSnapshot !== null) { entries["SkipFinalClusterSnapshot"] = input.SkipFinalClusterSnapshot; } - if (input.FinalClusterSnapshotIdentifier !== undefined) { + if (input.FinalClusterSnapshotIdentifier !== undefined && input.FinalClusterSnapshotIdentifier !== null) { entries["FinalClusterSnapshotIdentifier"] = input.FinalClusterSnapshotIdentifier; } - if (input.FinalClusterSnapshotRetentionPeriod !== undefined) { + if (input.FinalClusterSnapshotRetentionPeriod !== undefined && input.FinalClusterSnapshotRetentionPeriod !== null) { entries["FinalClusterSnapshotRetentionPeriod"] = input.FinalClusterSnapshotRetentionPeriod; } return entries; @@ -11384,7 +11393,7 @@ const serializeAws_queryDeleteClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ParameterGroupName !== undefined) { + if (input.ParameterGroupName !== undefined && input.ParameterGroupName !== null) { entries["ParameterGroupName"] = input.ParameterGroupName; } return entries; @@ -11395,7 +11404,7 @@ const serializeAws_queryDeleteClusterSecurityGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterSecurityGroupName !== undefined) { + if (input.ClusterSecurityGroupName !== undefined && input.ClusterSecurityGroupName !== null) { entries["ClusterSecurityGroupName"] = input.ClusterSecurityGroupName; } return entries; @@ -11406,10 +11415,10 @@ const serializeAws_queryDeleteClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.SnapshotClusterIdentifier !== undefined) { + if (input.SnapshotClusterIdentifier !== undefined && input.SnapshotClusterIdentifier !== null) { entries["SnapshotClusterIdentifier"] = input.SnapshotClusterIdentifier; } return entries; @@ -11422,6 +11431,9 @@ const serializeAws_queryDeleteClusterSnapshotMessageList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryDeleteClusterSnapshotMessage(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`DeleteClusterSnapshotMessage.${counter}.${key}`] = value; @@ -11436,7 +11448,7 @@ const serializeAws_queryDeleteClusterSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterSubnetGroupName !== undefined) { + if (input.ClusterSubnetGroupName !== undefined && input.ClusterSubnetGroupName !== null) { entries["ClusterSubnetGroupName"] = input.ClusterSubnetGroupName; } return entries; @@ -11447,7 +11459,7 @@ const serializeAws_queryDeleteEventSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } return entries; @@ -11458,7 +11470,7 @@ const serializeAws_queryDeleteHsmClientCertificateMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HsmClientCertificateIdentifier !== undefined) { + if (input.HsmClientCertificateIdentifier !== undefined && input.HsmClientCertificateIdentifier !== null) { entries["HsmClientCertificateIdentifier"] = input.HsmClientCertificateIdentifier; } return entries; @@ -11469,7 +11481,7 @@ const serializeAws_queryDeleteHsmConfigurationMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HsmConfigurationIdentifier !== undefined) { + if (input.HsmConfigurationIdentifier !== undefined && input.HsmConfigurationIdentifier !== null) { entries["HsmConfigurationIdentifier"] = input.HsmConfigurationIdentifier; } return entries; @@ -11480,7 +11492,7 @@ const serializeAws_queryDeleteScheduledActionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ScheduledActionName !== undefined) { + if (input.ScheduledActionName !== undefined && input.ScheduledActionName !== null) { entries["ScheduledActionName"] = input.ScheduledActionName; } return entries; @@ -11491,7 +11503,7 @@ const serializeAws_queryDeleteSnapshotCopyGrantMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SnapshotCopyGrantName !== undefined) { + if (input.SnapshotCopyGrantName !== undefined && input.SnapshotCopyGrantName !== null) { entries["SnapshotCopyGrantName"] = input.SnapshotCopyGrantName; } return entries; @@ -11502,7 +11514,7 @@ const serializeAws_queryDeleteSnapshotScheduleMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ScheduleIdentifier !== undefined) { + if (input.ScheduleIdentifier !== undefined && input.ScheduleIdentifier !== null) { entries["ScheduleIdentifier"] = input.ScheduleIdentifier; } return entries; @@ -11510,10 +11522,10 @@ const serializeAws_queryDeleteSnapshotScheduleMessage = ( const serializeAws_queryDeleteTagsMessage = (input: DeleteTagsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; @@ -11525,7 +11537,7 @@ const serializeAws_queryDeleteTagsMessage = (input: DeleteTagsMessage, context: const serializeAws_queryDeleteUsageLimitMessage = (input: DeleteUsageLimitMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.UsageLimitId !== undefined) { + if (input.UsageLimitId !== undefined && input.UsageLimitId !== null) { entries["UsageLimitId"] = input.UsageLimitId; } return entries; @@ -11536,7 +11548,7 @@ const serializeAws_queryDescribeAccountAttributesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.AttributeNames !== undefined) { + if (input.AttributeNames !== undefined && input.AttributeNames !== null) { const memberEntries = serializeAws_queryAttributeNameList(input.AttributeNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AttributeNames.${key}`; @@ -11551,13 +11563,13 @@ const serializeAws_queryDescribeClusterDbRevisionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -11568,23 +11580,23 @@ const serializeAws_queryDescribeClusterParameterGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ParameterGroupName !== undefined) { + if (input.ParameterGroupName !== undefined && input.ParameterGroupName !== null) { entries["ParameterGroupName"] = input.ParameterGroupName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -11599,16 +11611,16 @@ const serializeAws_queryDescribeClusterParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ParameterGroupName !== undefined) { + if (input.ParameterGroupName !== undefined && input.ParameterGroupName !== null) { entries["ParameterGroupName"] = input.ParameterGroupName; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -11619,23 +11631,23 @@ const serializeAws_queryDescribeClusterSecurityGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterSecurityGroupName !== undefined) { + if (input.ClusterSecurityGroupName !== undefined && input.ClusterSecurityGroupName !== null) { entries["ClusterSecurityGroupName"] = input.ClusterSecurityGroupName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -11647,23 +11659,23 @@ const serializeAws_queryDescribeClusterSecurityGroupsMessage = ( const serializeAws_queryDescribeClustersMessage = (input: DescribeClustersMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -11678,48 +11690,48 @@ const serializeAws_queryDescribeClusterSnapshotsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.SnapshotType !== undefined) { + if (input.SnapshotType !== undefined && input.SnapshotType !== null) { entries["SnapshotType"] = input.SnapshotType; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.OwnerAccount !== undefined) { + if (input.OwnerAccount !== undefined && input.OwnerAccount !== null) { entries["OwnerAccount"] = input.OwnerAccount; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; entries[loc] = value; }); } - if (input.ClusterExists !== undefined) { + if (input.ClusterExists !== undefined && input.ClusterExists !== null) { entries["ClusterExists"] = input.ClusterExists; } - if (input.SortingEntities !== undefined) { + if (input.SortingEntities !== undefined && input.SortingEntities !== null) { const memberEntries = serializeAws_querySnapshotSortingEntityList(input.SortingEntities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SortingEntities.${key}`; @@ -11734,23 +11746,23 @@ const serializeAws_queryDescribeClusterSubnetGroupsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterSubnetGroupName !== undefined) { + if (input.ClusterSubnetGroupName !== undefined && input.ClusterSubnetGroupName !== null) { entries["ClusterSubnetGroupName"] = input.ClusterSubnetGroupName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -11765,13 +11777,13 @@ const serializeAws_queryDescribeClusterTracksMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaintenanceTrackName !== undefined) { + if (input.MaintenanceTrackName !== undefined && input.MaintenanceTrackName !== null) { entries["MaintenanceTrackName"] = input.MaintenanceTrackName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -11782,16 +11794,16 @@ const serializeAws_queryDescribeClusterVersionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterVersion !== undefined) { + if (input.ClusterVersion !== undefined && input.ClusterVersion !== null) { entries["ClusterVersion"] = input.ClusterVersion; } - if (input.ClusterParameterGroupFamily !== undefined) { + if (input.ClusterParameterGroupFamily !== undefined && input.ClusterParameterGroupFamily !== null) { entries["ClusterParameterGroupFamily"] = input.ClusterParameterGroupFamily; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -11802,13 +11814,13 @@ const serializeAws_queryDescribeDefaultClusterParametersMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ParameterGroupFamily !== undefined) { + if (input.ParameterGroupFamily !== undefined && input.ParameterGroupFamily !== null) { entries["ParameterGroupFamily"] = input.ParameterGroupFamily; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -11819,7 +11831,7 @@ const serializeAws_queryDescribeEventCategoriesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } return entries; @@ -11827,25 +11839,25 @@ const serializeAws_queryDescribeEventCategoriesMessage = ( const serializeAws_queryDescribeEventsMessage = (input: DescribeEventsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.SourceIdentifier !== undefined) { + if (input.SourceIdentifier !== undefined && input.SourceIdentifier !== null) { entries["SourceIdentifier"] = input.SourceIdentifier; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Duration !== undefined) { + if (input.Duration !== undefined && input.Duration !== null) { entries["Duration"] = input.Duration; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -11856,23 +11868,23 @@ const serializeAws_queryDescribeEventSubscriptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -11887,23 +11899,23 @@ const serializeAws_queryDescribeHsmClientCertificatesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HsmClientCertificateIdentifier !== undefined) { + if (input.HsmClientCertificateIdentifier !== undefined && input.HsmClientCertificateIdentifier !== null) { entries["HsmClientCertificateIdentifier"] = input.HsmClientCertificateIdentifier; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -11918,23 +11930,23 @@ const serializeAws_queryDescribeHsmConfigurationsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.HsmConfigurationIdentifier !== undefined) { + if (input.HsmConfigurationIdentifier !== undefined && input.HsmConfigurationIdentifier !== null) { entries["HsmConfigurationIdentifier"] = input.HsmConfigurationIdentifier; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -11949,7 +11961,7 @@ const serializeAws_queryDescribeLoggingStatusMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } return entries; @@ -11960,29 +11972,29 @@ const serializeAws_queryDescribeNodeConfigurationOptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ActionType !== undefined) { + if (input.ActionType !== undefined && input.ActionType !== null) { entries["ActionType"] = input.ActionType; } - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.OwnerAccount !== undefined) { + if (input.OwnerAccount !== undefined && input.OwnerAccount !== null) { entries["OwnerAccount"] = input.OwnerAccount; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryNodeConfigurationOptionsFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -11993,16 +12005,16 @@ const serializeAws_queryDescribeOrderableClusterOptionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterVersion !== undefined) { + if (input.ClusterVersion !== undefined && input.ClusterVersion !== null) { entries["ClusterVersion"] = input.ClusterVersion; } - if (input.NodeType !== undefined) { + if (input.NodeType !== undefined && input.NodeType !== null) { entries["NodeType"] = input.NodeType; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -12013,13 +12025,13 @@ const serializeAws_queryDescribeReservedNodeOfferingsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedNodeOfferingId !== undefined) { + if (input.ReservedNodeOfferingId !== undefined && input.ReservedNodeOfferingId !== null) { entries["ReservedNodeOfferingId"] = input.ReservedNodeOfferingId; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -12030,13 +12042,13 @@ const serializeAws_queryDescribeReservedNodesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedNodeId !== undefined) { + if (input.ReservedNodeId !== undefined && input.ReservedNodeId !== null) { entries["ReservedNodeId"] = input.ReservedNodeId; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -12044,7 +12056,7 @@ const serializeAws_queryDescribeReservedNodesMessage = ( const serializeAws_queryDescribeResizeMessage = (input: DescribeResizeMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } return entries; @@ -12055,32 +12067,32 @@ const serializeAws_queryDescribeScheduledActionsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ScheduledActionName !== undefined) { + if (input.ScheduledActionName !== undefined && input.ScheduledActionName !== null) { entries["ScheduledActionName"] = input.ScheduledActionName; } - if (input.TargetActionType !== undefined) { + if (input.TargetActionType !== undefined && input.TargetActionType !== null) { entries["TargetActionType"] = input.TargetActionType; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Active !== undefined) { + if (input.Active !== undefined && input.Active !== null) { entries["Active"] = input.Active; } - if (input.Filters !== undefined) { + if (input.Filters !== undefined && input.Filters !== null) { const memberEntries = serializeAws_queryScheduledActionFilterList(input.Filters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filters.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -12091,23 +12103,23 @@ const serializeAws_queryDescribeSnapshotCopyGrantsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SnapshotCopyGrantName !== undefined) { + if (input.SnapshotCopyGrantName !== undefined && input.SnapshotCopyGrantName !== null) { entries["SnapshotCopyGrantName"] = input.SnapshotCopyGrantName; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -12122,30 +12134,30 @@ const serializeAws_queryDescribeSnapshotSchedulesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.ScheduleIdentifier !== undefined) { + if (input.ScheduleIdentifier !== undefined && input.ScheduleIdentifier !== null) { entries["ScheduleIdentifier"] = input.ScheduleIdentifier; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; entries[loc] = value; }); } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } return entries; @@ -12156,16 +12168,16 @@ const serializeAws_queryDescribeTableRestoreStatusMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.TableRestoreRequestId !== undefined) { + if (input.TableRestoreRequestId !== undefined && input.TableRestoreRequestId !== null) { entries["TableRestoreRequestId"] = input.TableRestoreRequestId; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -12173,26 +12185,26 @@ const serializeAws_queryDescribeTableRestoreStatusMessage = ( const serializeAws_queryDescribeTagsMessage = (input: DescribeTagsMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceName !== undefined) { + if (input.ResourceName !== undefined && input.ResourceName !== null) { entries["ResourceName"] = input.ResourceName; } - if (input.ResourceType !== undefined) { + if (input.ResourceType !== undefined && input.ResourceType !== null) { entries["ResourceType"] = input.ResourceType; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -12207,29 +12219,29 @@ const serializeAws_queryDescribeUsageLimitsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.UsageLimitId !== undefined) { + if (input.UsageLimitId !== undefined && input.UsageLimitId !== null) { entries["UsageLimitId"] = input.UsageLimitId; } - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.FeatureType !== undefined) { + if (input.FeatureType !== undefined && input.FeatureType !== null) { entries["FeatureType"] = input.FeatureType; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; entries[loc] = value; }); } - if (input.TagValues !== undefined) { + if (input.TagValues !== undefined && input.TagValues !== null) { const memberEntries = serializeAws_queryTagValueList(input.TagValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagValues.${key}`; @@ -12241,7 +12253,7 @@ const serializeAws_queryDescribeUsageLimitsMessage = ( const serializeAws_queryDisableLoggingMessage = (input: DisableLoggingMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } return entries; @@ -12252,7 +12264,7 @@ const serializeAws_queryDisableSnapshotCopyMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } return entries; @@ -12260,13 +12272,13 @@ const serializeAws_queryDisableSnapshotCopyMessage = ( const serializeAws_queryEnableLoggingMessage = (input: EnableLoggingMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.BucketName !== undefined) { + if (input.BucketName !== undefined && input.BucketName !== null) { entries["BucketName"] = input.BucketName; } - if (input.S3KeyPrefix !== undefined) { + if (input.S3KeyPrefix !== undefined && input.S3KeyPrefix !== null) { entries["S3KeyPrefix"] = input.S3KeyPrefix; } return entries; @@ -12277,19 +12289,19 @@ const serializeAws_queryEnableSnapshotCopyMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.DestinationRegion !== undefined) { + if (input.DestinationRegion !== undefined && input.DestinationRegion !== null) { entries["DestinationRegion"] = input.DestinationRegion; } - if (input.RetentionPeriod !== undefined) { + if (input.RetentionPeriod !== undefined && input.RetentionPeriod !== null) { entries["RetentionPeriod"] = input.RetentionPeriod; } - if (input.SnapshotCopyGrantName !== undefined) { + if (input.SnapshotCopyGrantName !== undefined && input.SnapshotCopyGrantName !== null) { entries["SnapshotCopyGrantName"] = input.SnapshotCopyGrantName; } - if (input.ManualSnapshotRetentionPeriod !== undefined) { + if (input.ManualSnapshotRetentionPeriod !== undefined && input.ManualSnapshotRetentionPeriod !== null) { entries["ManualSnapshotRetentionPeriod"] = input.ManualSnapshotRetentionPeriod; } return entries; @@ -12299,6 +12311,9 @@ const serializeAws_queryEventCategoriesList = (input: string[], context: __Serde const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`EventCategory.${counter}`] = entry; counter++; } @@ -12310,22 +12325,22 @@ const serializeAws_queryGetClusterCredentialsMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DbUser !== undefined) { + if (input.DbUser !== undefined && input.DbUser !== null) { entries["DbUser"] = input.DbUser; } - if (input.DbName !== undefined) { + if (input.DbName !== undefined && input.DbName !== null) { entries["DbName"] = input.DbName; } - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.DurationSeconds !== undefined) { + if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) { entries["DurationSeconds"] = input.DurationSeconds; } - if (input.AutoCreate !== undefined) { + if (input.AutoCreate !== undefined && input.AutoCreate !== null) { entries["AutoCreate"] = input.AutoCreate; } - if (input.DbGroups !== undefined) { + if (input.DbGroups !== undefined && input.DbGroups !== null) { const memberEntries = serializeAws_queryDbGroupList(input.DbGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DbGroups.${key}`; @@ -12340,13 +12355,13 @@ const serializeAws_queryGetReservedNodeExchangeOfferingsInputMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedNodeId !== undefined) { + if (input.ReservedNodeId !== undefined && input.ReservedNodeId !== null) { entries["ReservedNodeId"] = input.ReservedNodeId; } - if (input.MaxRecords !== undefined) { + if (input.MaxRecords !== undefined && input.MaxRecords !== null) { entries["MaxRecords"] = input.MaxRecords; } - if (input.Marker !== undefined) { + if (input.Marker !== undefined && input.Marker !== null) { entries["Marker"] = input.Marker; } return entries; @@ -12356,6 +12371,9 @@ const serializeAws_queryIamRoleArnList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`IamRoleArn.${counter}`] = entry; counter++; } @@ -12367,10 +12385,10 @@ const serializeAws_queryModifyClusterDbRevisionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.RevisionTarget !== undefined) { + if (input.RevisionTarget !== undefined && input.RevisionTarget !== null) { entries["RevisionTarget"] = input.RevisionTarget; } return entries; @@ -12381,17 +12399,17 @@ const serializeAws_queryModifyClusterIamRolesMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.AddIamRoles !== undefined) { + if (input.AddIamRoles !== undefined && input.AddIamRoles !== null) { const memberEntries = serializeAws_queryIamRoleArnList(input.AddIamRoles, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddIamRoles.${key}`; entries[loc] = value; }); } - if (input.RemoveIamRoles !== undefined) { + if (input.RemoveIamRoles !== undefined && input.RemoveIamRoles !== null) { const memberEntries = serializeAws_queryIamRoleArnList(input.RemoveIamRoles, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RemoveIamRoles.${key}`; @@ -12406,22 +12424,22 @@ const serializeAws_queryModifyClusterMaintenanceMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.DeferMaintenance !== undefined) { + if (input.DeferMaintenance !== undefined && input.DeferMaintenance !== null) { entries["DeferMaintenance"] = input.DeferMaintenance; } - if (input.DeferMaintenanceIdentifier !== undefined) { + if (input.DeferMaintenanceIdentifier !== undefined && input.DeferMaintenanceIdentifier !== null) { entries["DeferMaintenanceIdentifier"] = input.DeferMaintenanceIdentifier; } - if (input.DeferMaintenanceStartTime !== undefined) { + if (input.DeferMaintenanceStartTime !== undefined && input.DeferMaintenanceStartTime !== null) { entries["DeferMaintenanceStartTime"] = input.DeferMaintenanceStartTime.toISOString().split(".")[0] + "Z"; } - if (input.DeferMaintenanceEndTime !== undefined) { + if (input.DeferMaintenanceEndTime !== undefined && input.DeferMaintenanceEndTime !== null) { entries["DeferMaintenanceEndTime"] = input.DeferMaintenanceEndTime.toISOString().split(".")[0] + "Z"; } - if (input.DeferMaintenanceDuration !== undefined) { + if (input.DeferMaintenanceDuration !== undefined && input.DeferMaintenanceDuration !== null) { entries["DeferMaintenanceDuration"] = input.DeferMaintenanceDuration; } return entries; @@ -12429,87 +12447,87 @@ const serializeAws_queryModifyClusterMaintenanceMessage = ( const serializeAws_queryModifyClusterMessage = (input: ModifyClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.ClusterType !== undefined) { + if (input.ClusterType !== undefined && input.ClusterType !== null) { entries["ClusterType"] = input.ClusterType; } - if (input.NodeType !== undefined) { + if (input.NodeType !== undefined && input.NodeType !== null) { entries["NodeType"] = input.NodeType; } - if (input.NumberOfNodes !== undefined) { + if (input.NumberOfNodes !== undefined && input.NumberOfNodes !== null) { entries["NumberOfNodes"] = input.NumberOfNodes; } - if (input.ClusterSecurityGroups !== undefined) { + if (input.ClusterSecurityGroups !== undefined && input.ClusterSecurityGroups !== null) { const memberEntries = serializeAws_queryClusterSecurityGroupNameList(input.ClusterSecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClusterSecurityGroups.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.MasterUserPassword !== undefined) { + if (input.MasterUserPassword !== undefined && input.MasterUserPassword !== null) { entries["MasterUserPassword"] = input.MasterUserPassword; } - if (input.ClusterParameterGroupName !== undefined) { + if (input.ClusterParameterGroupName !== undefined && input.ClusterParameterGroupName !== null) { entries["ClusterParameterGroupName"] = input.ClusterParameterGroupName; } - if (input.AutomatedSnapshotRetentionPeriod !== undefined) { + if (input.AutomatedSnapshotRetentionPeriod !== undefined && input.AutomatedSnapshotRetentionPeriod !== null) { entries["AutomatedSnapshotRetentionPeriod"] = input.AutomatedSnapshotRetentionPeriod; } - if (input.ManualSnapshotRetentionPeriod !== undefined) { + if (input.ManualSnapshotRetentionPeriod !== undefined && input.ManualSnapshotRetentionPeriod !== null) { entries["ManualSnapshotRetentionPeriod"] = input.ManualSnapshotRetentionPeriod; } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.ClusterVersion !== undefined) { + if (input.ClusterVersion !== undefined && input.ClusterVersion !== null) { entries["ClusterVersion"] = input.ClusterVersion; } - if (input.AllowVersionUpgrade !== undefined) { + if (input.AllowVersionUpgrade !== undefined && input.AllowVersionUpgrade !== null) { entries["AllowVersionUpgrade"] = input.AllowVersionUpgrade; } - if (input.HsmClientCertificateIdentifier !== undefined) { + if (input.HsmClientCertificateIdentifier !== undefined && input.HsmClientCertificateIdentifier !== null) { entries["HsmClientCertificateIdentifier"] = input.HsmClientCertificateIdentifier; } - if (input.HsmConfigurationIdentifier !== undefined) { + if (input.HsmConfigurationIdentifier !== undefined && input.HsmConfigurationIdentifier !== null) { entries["HsmConfigurationIdentifier"] = input.HsmConfigurationIdentifier; } - if (input.NewClusterIdentifier !== undefined) { + if (input.NewClusterIdentifier !== undefined && input.NewClusterIdentifier !== null) { entries["NewClusterIdentifier"] = input.NewClusterIdentifier; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.ElasticIp !== undefined) { + if (input.ElasticIp !== undefined && input.ElasticIp !== null) { entries["ElasticIp"] = input.ElasticIp; } - if (input.EnhancedVpcRouting !== undefined) { + if (input.EnhancedVpcRouting !== undefined && input.EnhancedVpcRouting !== null) { entries["EnhancedVpcRouting"] = input.EnhancedVpcRouting; } - if (input.MaintenanceTrackName !== undefined) { + if (input.MaintenanceTrackName !== undefined && input.MaintenanceTrackName !== null) { entries["MaintenanceTrackName"] = input.MaintenanceTrackName; } - if (input.Encrypted !== undefined) { + if (input.Encrypted !== undefined && input.Encrypted !== null) { entries["Encrypted"] = input.Encrypted; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.AvailabilityZoneRelocation !== undefined) { + if (input.AvailabilityZoneRelocation !== undefined && input.AvailabilityZoneRelocation !== null) { entries["AvailabilityZoneRelocation"] = input.AvailabilityZoneRelocation; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } return entries; @@ -12520,10 +12538,10 @@ const serializeAws_queryModifyClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ParameterGroupName !== undefined) { + if (input.ParameterGroupName !== undefined && input.ParameterGroupName !== null) { entries["ParameterGroupName"] = input.ParameterGroupName; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -12538,13 +12556,13 @@ const serializeAws_queryModifyClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.ManualSnapshotRetentionPeriod !== undefined) { + if (input.ManualSnapshotRetentionPeriod !== undefined && input.ManualSnapshotRetentionPeriod !== null) { entries["ManualSnapshotRetentionPeriod"] = input.ManualSnapshotRetentionPeriod; } - if (input.Force !== undefined) { + if (input.Force !== undefined && input.Force !== null) { entries["Force"] = input.Force; } return entries; @@ -12555,13 +12573,13 @@ const serializeAws_queryModifyClusterSnapshotScheduleMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.ScheduleIdentifier !== undefined) { + if (input.ScheduleIdentifier !== undefined && input.ScheduleIdentifier !== null) { entries["ScheduleIdentifier"] = input.ScheduleIdentifier; } - if (input.DisassociateSchedule !== undefined) { + if (input.DisassociateSchedule !== undefined && input.DisassociateSchedule !== null) { entries["DisassociateSchedule"] = input.DisassociateSchedule; } return entries; @@ -12572,13 +12590,13 @@ const serializeAws_queryModifyClusterSubnetGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterSubnetGroupName !== undefined) { + if (input.ClusterSubnetGroupName !== undefined && input.ClusterSubnetGroupName !== null) { entries["ClusterSubnetGroupName"] = input.ClusterSubnetGroupName; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.SubnetIds !== undefined) { + if (input.SubnetIds !== undefined && input.SubnetIds !== null) { const memberEntries = serializeAws_querySubnetIdentifierList(input.SubnetIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SubnetIds.${key}`; @@ -12593,33 +12611,33 @@ const serializeAws_queryModifyEventSubscriptionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionName !== undefined) { + if (input.SubscriptionName !== undefined && input.SubscriptionName !== null) { entries["SubscriptionName"] = input.SubscriptionName; } - if (input.SnsTopicArn !== undefined) { + if (input.SnsTopicArn !== undefined && input.SnsTopicArn !== null) { entries["SnsTopicArn"] = input.SnsTopicArn; } - if (input.SourceType !== undefined) { + if (input.SourceType !== undefined && input.SourceType !== null) { entries["SourceType"] = input.SourceType; } - if (input.SourceIds !== undefined) { + if (input.SourceIds !== undefined && input.SourceIds !== null) { const memberEntries = serializeAws_querySourceIdsList(input.SourceIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SourceIds.${key}`; entries[loc] = value; }); } - if (input.EventCategories !== undefined) { + if (input.EventCategories !== undefined && input.EventCategories !== null) { const memberEntries = serializeAws_queryEventCategoriesList(input.EventCategories, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventCategories.${key}`; entries[loc] = value; }); } - if (input.Severity !== undefined) { + if (input.Severity !== undefined && input.Severity !== null) { entries["Severity"] = input.Severity; } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -12630,32 +12648,32 @@ const serializeAws_queryModifyScheduledActionMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ScheduledActionName !== undefined) { + if (input.ScheduledActionName !== undefined && input.ScheduledActionName !== null) { entries["ScheduledActionName"] = input.ScheduledActionName; } - if (input.TargetAction !== undefined) { + if (input.TargetAction !== undefined && input.TargetAction !== null) { const memberEntries = serializeAws_queryScheduledActionType(input.TargetAction, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TargetAction.${key}`; entries[loc] = value; }); } - if (input.Schedule !== undefined) { + if (input.Schedule !== undefined && input.Schedule !== null) { entries["Schedule"] = input.Schedule; } - if (input.IamRole !== undefined) { + if (input.IamRole !== undefined && input.IamRole !== null) { entries["IamRole"] = input.IamRole; } - if (input.ScheduledActionDescription !== undefined) { + if (input.ScheduledActionDescription !== undefined && input.ScheduledActionDescription !== null) { entries["ScheduledActionDescription"] = input.ScheduledActionDescription; } - if (input.StartTime !== undefined) { + if (input.StartTime !== undefined && input.StartTime !== null) { entries["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; } - if (input.EndTime !== undefined) { + if (input.EndTime !== undefined && input.EndTime !== null) { entries["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; } - if (input.Enable !== undefined) { + if (input.Enable !== undefined && input.Enable !== null) { entries["Enable"] = input.Enable; } return entries; @@ -12666,13 +12684,13 @@ const serializeAws_queryModifySnapshotCopyRetentionPeriodMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.RetentionPeriod !== undefined) { + if (input.RetentionPeriod !== undefined && input.RetentionPeriod !== null) { entries["RetentionPeriod"] = input.RetentionPeriod; } - if (input.Manual !== undefined) { + if (input.Manual !== undefined && input.Manual !== null) { entries["Manual"] = input.Manual; } return entries; @@ -12683,10 +12701,10 @@ const serializeAws_queryModifySnapshotScheduleMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ScheduleIdentifier !== undefined) { + if (input.ScheduleIdentifier !== undefined && input.ScheduleIdentifier !== null) { entries["ScheduleIdentifier"] = input.ScheduleIdentifier; } - if (input.ScheduleDefinitions !== undefined) { + if (input.ScheduleDefinitions !== undefined && input.ScheduleDefinitions !== null) { const memberEntries = serializeAws_queryScheduleDefinitionList(input.ScheduleDefinitions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ScheduleDefinitions.${key}`; @@ -12698,13 +12716,13 @@ const serializeAws_queryModifySnapshotScheduleMessage = ( const serializeAws_queryModifyUsageLimitMessage = (input: ModifyUsageLimitMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.UsageLimitId !== undefined) { + if (input.UsageLimitId !== undefined && input.UsageLimitId !== null) { entries["UsageLimitId"] = input.UsageLimitId; } - if (input.Amount !== undefined) { + if (input.Amount !== undefined && input.Amount !== null) { entries["Amount"] = input.Amount; } - if (input.BreachAction !== undefined) { + if (input.BreachAction !== undefined && input.BreachAction !== null) { entries["BreachAction"] = input.BreachAction; } return entries; @@ -12715,13 +12733,13 @@ const serializeAws_queryNodeConfigurationOptionsFilter = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Operator !== undefined) { + if (input.Operator !== undefined && input.Operator !== null) { entries["Operator"] = input.Operator; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryValueStringList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Value.${key}`; @@ -12738,6 +12756,9 @@ const serializeAws_queryNodeConfigurationOptionsFilterList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryNodeConfigurationOptionsFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`NodeConfigurationOptionsFilter.${counter}.${key}`] = value; @@ -12749,31 +12770,31 @@ const serializeAws_queryNodeConfigurationOptionsFilterList = ( const serializeAws_queryParameter = (input: Parameter, context: __SerdeContext): any => { const entries: any = {}; - if (input.ParameterName !== undefined) { + if (input.ParameterName !== undefined && input.ParameterName !== null) { entries["ParameterName"] = input.ParameterName; } - if (input.ParameterValue !== undefined) { + if (input.ParameterValue !== undefined && input.ParameterValue !== null) { entries["ParameterValue"] = input.ParameterValue; } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { entries["Description"] = input.Description; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.DataType !== undefined) { + if (input.DataType !== undefined && input.DataType !== null) { entries["DataType"] = input.DataType; } - if (input.AllowedValues !== undefined) { + if (input.AllowedValues !== undefined && input.AllowedValues !== null) { entries["AllowedValues"] = input.AllowedValues; } - if (input.ApplyType !== undefined) { + if (input.ApplyType !== undefined && input.ApplyType !== null) { entries["ApplyType"] = input.ApplyType; } - if (input.IsModifiable !== undefined) { + if (input.IsModifiable !== undefined && input.IsModifiable !== null) { entries["IsModifiable"] = input.IsModifiable; } - if (input.MinimumEngineVersion !== undefined) { + if (input.MinimumEngineVersion !== undefined && input.MinimumEngineVersion !== null) { entries["MinimumEngineVersion"] = input.MinimumEngineVersion; } return entries; @@ -12783,6 +12804,9 @@ const serializeAws_queryParametersList = (input: Parameter[], context: __SerdeCo const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryParameter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Parameter.${counter}.${key}`] = value; @@ -12794,7 +12818,7 @@ const serializeAws_queryParametersList = (input: Parameter[], context: __SerdeCo const serializeAws_queryPauseClusterMessage = (input: PauseClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } return entries; @@ -12805,10 +12829,10 @@ const serializeAws_queryPurchaseReservedNodeOfferingMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReservedNodeOfferingId !== undefined) { + if (input.ReservedNodeOfferingId !== undefined && input.ReservedNodeOfferingId !== null) { entries["ReservedNodeOfferingId"] = input.ReservedNodeOfferingId; } - if (input.NodeCount !== undefined) { + if (input.NodeCount !== undefined && input.NodeCount !== null) { entries["NodeCount"] = input.NodeCount; } return entries; @@ -12816,7 +12840,7 @@ const serializeAws_queryPurchaseReservedNodeOfferingMessage = ( const serializeAws_queryRebootClusterMessage = (input: RebootClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } return entries; @@ -12827,13 +12851,13 @@ const serializeAws_queryResetClusterParameterGroupMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ParameterGroupName !== undefined) { + if (input.ParameterGroupName !== undefined && input.ParameterGroupName !== null) { entries["ParameterGroupName"] = input.ParameterGroupName; } - if (input.ResetAllParameters !== undefined) { + if (input.ResetAllParameters !== undefined && input.ResetAllParameters !== null) { entries["ResetAllParameters"] = input.ResetAllParameters; } - if (input.Parameters !== undefined) { + if (input.Parameters !== undefined && input.Parameters !== null) { const memberEntries = serializeAws_queryParametersList(input.Parameters, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Parameters.${key}`; @@ -12845,19 +12869,19 @@ const serializeAws_queryResetClusterParameterGroupMessage = ( const serializeAws_queryResizeClusterMessage = (input: ResizeClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.ClusterType !== undefined) { + if (input.ClusterType !== undefined && input.ClusterType !== null) { entries["ClusterType"] = input.ClusterType; } - if (input.NodeType !== undefined) { + if (input.NodeType !== undefined && input.NodeType !== null) { entries["NodeType"] = input.NodeType; } - if (input.NumberOfNodes !== undefined) { + if (input.NumberOfNodes !== undefined && input.NumberOfNodes !== null) { entries["NumberOfNodes"] = input.NumberOfNodes; } - if (input.Classic !== undefined) { + if (input.Classic !== undefined && input.Classic !== null) { entries["Classic"] = input.Classic; } return entries; @@ -12868,97 +12892,97 @@ const serializeAws_queryRestoreFromClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.SnapshotClusterIdentifier !== undefined) { + if (input.SnapshotClusterIdentifier !== undefined && input.SnapshotClusterIdentifier !== null) { entries["SnapshotClusterIdentifier"] = input.SnapshotClusterIdentifier; } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { entries["Port"] = input.Port; } - if (input.AvailabilityZone !== undefined) { + if (input.AvailabilityZone !== undefined && input.AvailabilityZone !== null) { entries["AvailabilityZone"] = input.AvailabilityZone; } - if (input.AllowVersionUpgrade !== undefined) { + if (input.AllowVersionUpgrade !== undefined && input.AllowVersionUpgrade !== null) { entries["AllowVersionUpgrade"] = input.AllowVersionUpgrade; } - if (input.ClusterSubnetGroupName !== undefined) { + if (input.ClusterSubnetGroupName !== undefined && input.ClusterSubnetGroupName !== null) { entries["ClusterSubnetGroupName"] = input.ClusterSubnetGroupName; } - if (input.PubliclyAccessible !== undefined) { + if (input.PubliclyAccessible !== undefined && input.PubliclyAccessible !== null) { entries["PubliclyAccessible"] = input.PubliclyAccessible; } - if (input.OwnerAccount !== undefined) { + if (input.OwnerAccount !== undefined && input.OwnerAccount !== null) { entries["OwnerAccount"] = input.OwnerAccount; } - if (input.HsmClientCertificateIdentifier !== undefined) { + if (input.HsmClientCertificateIdentifier !== undefined && input.HsmClientCertificateIdentifier !== null) { entries["HsmClientCertificateIdentifier"] = input.HsmClientCertificateIdentifier; } - if (input.HsmConfigurationIdentifier !== undefined) { + if (input.HsmConfigurationIdentifier !== undefined && input.HsmConfigurationIdentifier !== null) { entries["HsmConfigurationIdentifier"] = input.HsmConfigurationIdentifier; } - if (input.ElasticIp !== undefined) { + if (input.ElasticIp !== undefined && input.ElasticIp !== null) { entries["ElasticIp"] = input.ElasticIp; } - if (input.ClusterParameterGroupName !== undefined) { + if (input.ClusterParameterGroupName !== undefined && input.ClusterParameterGroupName !== null) { entries["ClusterParameterGroupName"] = input.ClusterParameterGroupName; } - if (input.ClusterSecurityGroups !== undefined) { + if (input.ClusterSecurityGroups !== undefined && input.ClusterSecurityGroups !== null) { const memberEntries = serializeAws_queryClusterSecurityGroupNameList(input.ClusterSecurityGroups, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ClusterSecurityGroups.${key}`; entries[loc] = value; }); } - if (input.VpcSecurityGroupIds !== undefined) { + if (input.VpcSecurityGroupIds !== undefined && input.VpcSecurityGroupIds !== null) { const memberEntries = serializeAws_queryVpcSecurityGroupIdList(input.VpcSecurityGroupIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `VpcSecurityGroupIds.${key}`; entries[loc] = value; }); } - if (input.PreferredMaintenanceWindow !== undefined) { + if (input.PreferredMaintenanceWindow !== undefined && input.PreferredMaintenanceWindow !== null) { entries["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; } - if (input.AutomatedSnapshotRetentionPeriod !== undefined) { + if (input.AutomatedSnapshotRetentionPeriod !== undefined && input.AutomatedSnapshotRetentionPeriod !== null) { entries["AutomatedSnapshotRetentionPeriod"] = input.AutomatedSnapshotRetentionPeriod; } - if (input.ManualSnapshotRetentionPeriod !== undefined) { + if (input.ManualSnapshotRetentionPeriod !== undefined && input.ManualSnapshotRetentionPeriod !== null) { entries["ManualSnapshotRetentionPeriod"] = input.ManualSnapshotRetentionPeriod; } - if (input.KmsKeyId !== undefined) { + if (input.KmsKeyId !== undefined && input.KmsKeyId !== null) { entries["KmsKeyId"] = input.KmsKeyId; } - if (input.NodeType !== undefined) { + if (input.NodeType !== undefined && input.NodeType !== null) { entries["NodeType"] = input.NodeType; } - if (input.EnhancedVpcRouting !== undefined) { + if (input.EnhancedVpcRouting !== undefined && input.EnhancedVpcRouting !== null) { entries["EnhancedVpcRouting"] = input.EnhancedVpcRouting; } - if (input.AdditionalInfo !== undefined) { + if (input.AdditionalInfo !== undefined && input.AdditionalInfo !== null) { entries["AdditionalInfo"] = input.AdditionalInfo; } - if (input.IamRoles !== undefined) { + if (input.IamRoles !== undefined && input.IamRoles !== null) { const memberEntries = serializeAws_queryIamRoleArnList(input.IamRoles, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IamRoles.${key}`; entries[loc] = value; }); } - if (input.MaintenanceTrackName !== undefined) { + if (input.MaintenanceTrackName !== undefined && input.MaintenanceTrackName !== null) { entries["MaintenanceTrackName"] = input.MaintenanceTrackName; } - if (input.SnapshotScheduleIdentifier !== undefined) { + if (input.SnapshotScheduleIdentifier !== undefined && input.SnapshotScheduleIdentifier !== null) { entries["SnapshotScheduleIdentifier"] = input.SnapshotScheduleIdentifier; } - if (input.NumberOfNodes !== undefined) { + if (input.NumberOfNodes !== undefined && input.NumberOfNodes !== null) { entries["NumberOfNodes"] = input.NumberOfNodes; } - if (input.AvailabilityZoneRelocation !== undefined) { + if (input.AvailabilityZoneRelocation !== undefined && input.AvailabilityZoneRelocation !== null) { entries["AvailabilityZoneRelocation"] = input.AvailabilityZoneRelocation; } return entries; @@ -12969,28 +12993,28 @@ const serializeAws_queryRestoreTableFromClusterSnapshotMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.SourceDatabaseName !== undefined) { + if (input.SourceDatabaseName !== undefined && input.SourceDatabaseName !== null) { entries["SourceDatabaseName"] = input.SourceDatabaseName; } - if (input.SourceSchemaName !== undefined) { + if (input.SourceSchemaName !== undefined && input.SourceSchemaName !== null) { entries["SourceSchemaName"] = input.SourceSchemaName; } - if (input.SourceTableName !== undefined) { + if (input.SourceTableName !== undefined && input.SourceTableName !== null) { entries["SourceTableName"] = input.SourceTableName; } - if (input.TargetDatabaseName !== undefined) { + if (input.TargetDatabaseName !== undefined && input.TargetDatabaseName !== null) { entries["TargetDatabaseName"] = input.TargetDatabaseName; } - if (input.TargetSchemaName !== undefined) { + if (input.TargetSchemaName !== undefined && input.TargetSchemaName !== null) { entries["TargetSchemaName"] = input.TargetSchemaName; } - if (input.NewTableName !== undefined) { + if (input.NewTableName !== undefined && input.NewTableName !== null) { entries["NewTableName"] = input.NewTableName; } return entries; @@ -12998,7 +13022,7 @@ const serializeAws_queryRestoreTableFromClusterSnapshotMessage = ( const serializeAws_queryResumeClusterMessage = (input: ResumeClusterMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } return entries; @@ -13009,16 +13033,16 @@ const serializeAws_queryRevokeClusterSecurityGroupIngressMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterSecurityGroupName !== undefined) { + if (input.ClusterSecurityGroupName !== undefined && input.ClusterSecurityGroupName !== null) { entries["ClusterSecurityGroupName"] = input.ClusterSecurityGroupName; } - if (input.CIDRIP !== undefined) { + if (input.CIDRIP !== undefined && input.CIDRIP !== null) { entries["CIDRIP"] = input.CIDRIP; } - if (input.EC2SecurityGroupName !== undefined) { + if (input.EC2SecurityGroupName !== undefined && input.EC2SecurityGroupName !== null) { entries["EC2SecurityGroupName"] = input.EC2SecurityGroupName; } - if (input.EC2SecurityGroupOwnerId !== undefined) { + if (input.EC2SecurityGroupOwnerId !== undefined && input.EC2SecurityGroupOwnerId !== null) { entries["EC2SecurityGroupOwnerId"] = input.EC2SecurityGroupOwnerId; } return entries; @@ -13029,13 +13053,13 @@ const serializeAws_queryRevokeSnapshotAccessMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SnapshotIdentifier !== undefined) { + if (input.SnapshotIdentifier !== undefined && input.SnapshotIdentifier !== null) { entries["SnapshotIdentifier"] = input.SnapshotIdentifier; } - if (input.SnapshotClusterIdentifier !== undefined) { + if (input.SnapshotClusterIdentifier !== undefined && input.SnapshotClusterIdentifier !== null) { entries["SnapshotClusterIdentifier"] = input.SnapshotClusterIdentifier; } - if (input.AccountWithRestoreAccess !== undefined) { + if (input.AccountWithRestoreAccess !== undefined && input.AccountWithRestoreAccess !== null) { entries["AccountWithRestoreAccess"] = input.AccountWithRestoreAccess; } return entries; @@ -13046,7 +13070,7 @@ const serializeAws_queryRotateEncryptionKeyMessage = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ClusterIdentifier !== undefined) { + if (input.ClusterIdentifier !== undefined && input.ClusterIdentifier !== null) { entries["ClusterIdentifier"] = input.ClusterIdentifier; } return entries; @@ -13054,10 +13078,10 @@ const serializeAws_queryRotateEncryptionKeyMessage = ( const serializeAws_queryScheduledActionFilter = (input: ScheduledActionFilter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Values !== undefined) { + if (input.Values !== undefined && input.Values !== null) { const memberEntries = serializeAws_queryValueStringList(input.Values, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Values.${key}`; @@ -13071,6 +13095,9 @@ const serializeAws_queryScheduledActionFilterList = (input: ScheduledActionFilte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryScheduledActionFilter(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`ScheduledActionFilter.${counter}.${key}`] = value; @@ -13082,21 +13109,21 @@ const serializeAws_queryScheduledActionFilterList = (input: ScheduledActionFilte const serializeAws_queryScheduledActionType = (input: ScheduledActionType, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResizeCluster !== undefined) { + if (input.ResizeCluster !== undefined && input.ResizeCluster !== null) { const memberEntries = serializeAws_queryResizeClusterMessage(input.ResizeCluster, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResizeCluster.${key}`; entries[loc] = value; }); } - if (input.PauseCluster !== undefined) { + if (input.PauseCluster !== undefined && input.PauseCluster !== null) { const memberEntries = serializeAws_queryPauseClusterMessage(input.PauseCluster, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PauseCluster.${key}`; entries[loc] = value; }); } - if (input.ResumeCluster !== undefined) { + if (input.ResumeCluster !== undefined && input.ResumeCluster !== null) { const memberEntries = serializeAws_queryResumeClusterMessage(input.ResumeCluster, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ResumeCluster.${key}`; @@ -13110,6 +13137,9 @@ const serializeAws_queryScheduleDefinitionList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`ScheduleDefinition.${counter}`] = entry; counter++; } @@ -13120,6 +13150,9 @@ const serializeAws_querySnapshotIdentifierList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`String.${counter}`] = entry; counter++; } @@ -13128,10 +13161,10 @@ const serializeAws_querySnapshotIdentifierList = (input: string[], context: __Se const serializeAws_querySnapshotSortingEntity = (input: SnapshotSortingEntity, context: __SerdeContext): any => { const entries: any = {}; - if (input.Attribute !== undefined) { + if (input.Attribute !== undefined && input.Attribute !== null) { entries["Attribute"] = input.Attribute; } - if (input.SortOrder !== undefined) { + if (input.SortOrder !== undefined && input.SortOrder !== null) { entries["SortOrder"] = input.SortOrder; } return entries; @@ -13141,6 +13174,9 @@ const serializeAws_querySnapshotSortingEntityList = (input: SnapshotSortingEntit const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_querySnapshotSortingEntity(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`SnapshotSortingEntity.${counter}.${key}`] = value; @@ -13154,6 +13190,9 @@ const serializeAws_querySourceIdsList = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SourceId.${counter}`] = entry; counter++; } @@ -13164,6 +13203,9 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`SubnetIdentifier.${counter}`] = entry; counter++; } @@ -13172,10 +13214,10 @@ const serializeAws_querySubnetIdentifierList = (input: string[], context: __Serd const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -13185,6 +13227,9 @@ const serializeAws_queryTagKeyList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`TagKey.${counter}`] = entry; counter++; } @@ -13195,6 +13240,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`Tag.${counter}.${key}`] = value; @@ -13208,6 +13256,9 @@ const serializeAws_queryTagValueList = (input: string[], context: __SerdeContext const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`TagValue.${counter}`] = entry; counter++; } @@ -13218,6 +13269,9 @@ const serializeAws_queryValueStringList = (input: string[], context: __SerdeCont const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`item.${counter}`] = entry; counter++; } @@ -13228,6 +13282,9 @@ const serializeAws_queryVpcSecurityGroupIdList = (input: string[], context: __Se const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`VpcSecurityGroupId.${counter}`] = entry; counter++; } @@ -13300,7 +13357,14 @@ const deserializeAws_queryAccountsWithRestoreAccessList = ( output: any, context: __SerdeContext ): AccountWithRestoreAccess[] => { - return (output || []).map((entry: any) => deserializeAws_queryAccountWithRestoreAccess(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAccountWithRestoreAccess(entry, context); + }); }; const deserializeAws_queryAccountWithRestoreAccess = ( @@ -13324,15 +13388,36 @@ const deserializeAws_queryAssociatedClusterList = ( output: any, context: __SerdeContext ): ClusterAssociatedToSchedule[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterAssociatedToSchedule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterAssociatedToSchedule(entry, context); + }); }; const deserializeAws_queryAttributeList = (output: any, context: __SerdeContext): AccountAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_queryAccountAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAccountAttribute(entry, context); + }); }; const deserializeAws_queryAttributeValueList = (output: any, context: __SerdeContext): AttributeValueTarget[] => { - return (output || []).map((entry: any) => deserializeAws_queryAttributeValueTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAttributeValueTarget(entry, context); + }); }; const deserializeAws_queryAttributeValueTarget = (output: any, context: __SerdeContext): AttributeValueTarget => { @@ -13431,7 +13516,14 @@ const deserializeAws_queryAvailabilityZone = (output: any, context: __SerdeConte }; const deserializeAws_queryAvailabilityZoneList = (output: any, context: __SerdeContext): AvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_queryAvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryAvailabilityZone(entry, context); + }); }; const deserializeAws_queryBatchDeleteClusterSnapshotsResult = ( @@ -13522,14 +13614,28 @@ const deserializeAws_queryBatchSnapshotOperationErrorList = ( output: any, context: __SerdeContext ): SnapshotErrorMessage[] => { - return (output || []).map((entry: any) => deserializeAws_querySnapshotErrorMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySnapshotErrorMessage(entry, context); + }); }; const deserializeAws_queryBatchSnapshotOperationErrors = ( output: any, context: __SerdeContext ): SnapshotErrorMessage[] => { - return (output || []).map((entry: any) => deserializeAws_querySnapshotErrorMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySnapshotErrorMessage(entry, context); + }); }; const deserializeAws_queryBucketNotFoundFault = (output: any, context: __SerdeContext): BucketNotFoundFault => { @@ -13877,7 +13983,14 @@ const deserializeAws_queryClusterDbRevision = (output: any, context: __SerdeCont }; const deserializeAws_queryClusterDbRevisionsList = (output: any, context: __SerdeContext): ClusterDbRevision[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterDbRevision(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterDbRevision(entry, context); + }); }; const deserializeAws_queryClusterDbRevisionsMessage = ( @@ -13918,11 +14031,25 @@ const deserializeAws_queryClusterIamRole = (output: any, context: __SerdeContext }; const deserializeAws_queryClusterIamRoleList = (output: any, context: __SerdeContext): ClusterIamRole[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterIamRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterIamRole(entry, context); + }); }; const deserializeAws_queryClusterList = (output: any, context: __SerdeContext): Cluster[] => { - return (output || []).map((entry: any) => deserializeAws_queryCluster(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCluster(entry, context); + }); }; const deserializeAws_queryClusterNode = (output: any, context: __SerdeContext): ClusterNode => { @@ -13944,7 +14071,14 @@ const deserializeAws_queryClusterNode = (output: any, context: __SerdeContext): }; const deserializeAws_queryClusterNodesList = (output: any, context: __SerdeContext): ClusterNode[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterNode(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterNode(entry, context); + }); }; const deserializeAws_queryClusterNotFoundFault = (output: any, context: __SerdeContext): ClusterNotFoundFault => { @@ -14131,7 +14265,14 @@ const deserializeAws_queryClusterParameterGroupStatusList = ( output: any, context: __SerdeContext ): ClusterParameterGroupStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterParameterGroupStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterParameterGroupStatus(entry, context); + }); }; const deserializeAws_queryClusterParameterStatus = (output: any, context: __SerdeContext): ClusterParameterStatus => { @@ -14156,7 +14297,14 @@ const deserializeAws_queryClusterParameterStatusList = ( output: any, context: __SerdeContext ): ClusterParameterStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterParameterStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterParameterStatus(entry, context); + }); }; const deserializeAws_queryClusterQuotaExceededFault = ( @@ -14244,7 +14392,14 @@ const deserializeAws_queryClusterSecurityGroupMembershipList = ( output: any, context: __SerdeContext ): ClusterSecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterSecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterSecurityGroupMembership(entry, context); + }); }; const deserializeAws_queryClusterSecurityGroupMessage = ( @@ -14300,7 +14455,14 @@ const deserializeAws_queryClusterSecurityGroupQuotaExceededFault = ( }; const deserializeAws_queryClusterSecurityGroups = (output: any, context: __SerdeContext): ClusterSecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterSecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterSecurityGroup(entry, context); + }); }; const deserializeAws_queryClustersMessage = (output: any, context: __SerdeContext): ClustersMessage => { @@ -14486,7 +14648,14 @@ const deserializeAws_queryClusterSubnetGroupQuotaExceededFault = ( }; const deserializeAws_queryClusterSubnetGroups = (output: any, context: __SerdeContext): ClusterSubnetGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterSubnetGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterSubnetGroup(entry, context); + }); }; const deserializeAws_queryClusterSubnetQuotaExceededFault = ( @@ -14521,7 +14690,14 @@ const deserializeAws_queryClusterVersion = (output: any, context: __SerdeContext }; const deserializeAws_queryClusterVersionList = (output: any, context: __SerdeContext): ClusterVersion[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterVersion(entry, context); + }); }; const deserializeAws_queryClusterVersionsMessage = (output: any, context: __SerdeContext): ClusterVersionsMessage => { @@ -14783,7 +14959,14 @@ const deserializeAws_queryDeferredMaintenanceWindowsList = ( output: any, context: __SerdeContext ): DeferredMaintenanceWindow[] => { - return (output || []).map((entry: any) => deserializeAws_queryDeferredMaintenanceWindow(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDeferredMaintenanceWindow(entry, context); + }); }; const deserializeAws_queryDeleteClusterResult = (output: any, context: __SerdeContext): DeleteClusterResult => { @@ -14913,7 +15096,14 @@ const deserializeAws_queryEC2SecurityGroup = (output: any, context: __SerdeConte }; const deserializeAws_queryEC2SecurityGroupList = (output: any, context: __SerdeContext): EC2SecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryEC2SecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEC2SecurityGroup(entry, context); + }); }; const deserializeAws_queryElasticIpStatus = (output: any, context: __SerdeContext): ElasticIpStatus => { @@ -14931,7 +15121,14 @@ const deserializeAws_queryElasticIpStatus = (output: any, context: __SerdeContex }; const deserializeAws_queryEligibleTracksToUpdateList = (output: any, context: __SerdeContext): UpdateTarget[] => { - return (output || []).map((entry: any) => deserializeAws_queryUpdateTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUpdateTarget(entry, context); + }); }; const deserializeAws_queryEnableSnapshotCopyResult = ( @@ -15012,7 +15209,14 @@ const deserializeAws_queryEvent = (output: any, context: __SerdeContext): Event }; const deserializeAws_queryEventCategoriesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryEventCategoriesMap = (output: any, context: __SerdeContext): EventCategoriesMap => { @@ -15036,7 +15240,14 @@ const deserializeAws_queryEventCategoriesMap = (output: any, context: __SerdeCon }; const deserializeAws_queryEventCategoriesMapList = (output: any, context: __SerdeContext): EventCategoriesMap[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventCategoriesMap(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventCategoriesMap(entry, context); + }); }; const deserializeAws_queryEventCategoriesMessage = (output: any, context: __SerdeContext): EventCategoriesMessage => { @@ -15087,11 +15298,25 @@ const deserializeAws_queryEventInfoMap = (output: any, context: __SerdeContext): }; const deserializeAws_queryEventInfoMapList = (output: any, context: __SerdeContext): EventInfoMap[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventInfoMap(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventInfoMap(entry, context); + }); }; const deserializeAws_queryEventList = (output: any, context: __SerdeContext): Event[] => { - return (output || []).map((entry: any) => deserializeAws_queryEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEvent(entry, context); + }); }; const deserializeAws_queryEventsMessage = (output: any, context: __SerdeContext): EventsMessage => { @@ -15190,7 +15415,14 @@ const deserializeAws_queryEventSubscriptionQuotaExceededFault = ( }; const deserializeAws_queryEventSubscriptionsList = (output: any, context: __SerdeContext): EventSubscription[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventSubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventSubscription(entry, context); + }); }; const deserializeAws_queryEventSubscriptionsMessage = ( @@ -15280,7 +15512,14 @@ const deserializeAws_queryHsmClientCertificateAlreadyExistsFault = ( }; const deserializeAws_queryHsmClientCertificateList = (output: any, context: __SerdeContext): HsmClientCertificate[] => { - return (output || []).map((entry: any) => deserializeAws_queryHsmClientCertificate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryHsmClientCertificate(entry, context); + }); }; const deserializeAws_queryHsmClientCertificateMessage = ( @@ -15378,7 +15617,14 @@ const deserializeAws_queryHsmConfigurationAlreadyExistsFault = ( }; const deserializeAws_queryHsmConfigurationList = (output: any, context: __SerdeContext): HsmConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_queryHsmConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryHsmConfiguration(entry, context); + }); }; const deserializeAws_queryHsmConfigurationMessage = (output: any, context: __SerdeContext): HsmConfigurationMessage => { @@ -15446,15 +15692,36 @@ const deserializeAws_queryHsmStatus = (output: any, context: __SerdeContext): Hs }; const deserializeAws_queryImportTablesCompleted = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryImportTablesInProgress = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryImportTablesNotStarted = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryIncompatibleOrderableOptions = ( @@ -15835,7 +16102,14 @@ const deserializeAws_queryIPRange = (output: any, context: __SerdeContext): IPRa }; const deserializeAws_queryIPRangeList = (output: any, context: __SerdeContext): IPRange[] => { - return (output || []).map((entry: any) => deserializeAws_queryIPRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryIPRange(entry, context); + }); }; const deserializeAws_queryLimitExceededFault = (output: any, context: __SerdeContext): LimitExceededFault => { @@ -16029,7 +16303,14 @@ const deserializeAws_queryNodeConfigurationOptionList = ( output: any, context: __SerdeContext ): NodeConfigurationOption[] => { - return (output || []).map((entry: any) => deserializeAws_queryNodeConfigurationOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryNodeConfigurationOption(entry, context); + }); }; const deserializeAws_queryNodeConfigurationOptionsMessage = ( @@ -16116,7 +16397,14 @@ const deserializeAws_queryOrderableClusterOptionsList = ( output: any, context: __SerdeContext ): OrderableClusterOption[] => { - return (output || []).map((entry: any) => deserializeAws_queryOrderableClusterOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryOrderableClusterOption(entry, context); + }); }; const deserializeAws_queryOrderableClusterOptionsMessage = ( @@ -16188,11 +16476,25 @@ const deserializeAws_queryParameter = (output: any, context: __SerdeContext): Pa }; const deserializeAws_queryParameterGroupList = (output: any, context: __SerdeContext): ClusterParameterGroup[] => { - return (output || []).map((entry: any) => deserializeAws_queryClusterParameterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryClusterParameterGroup(entry, context); + }); }; const deserializeAws_queryParametersList = (output: any, context: __SerdeContext): Parameter[] => { - return (output || []).map((entry: any) => deserializeAws_queryParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryParameter(entry, context); + }); }; const deserializeAws_queryPauseClusterMessage = (output: any, context: __SerdeContext): PauseClusterMessage => { @@ -16216,7 +16518,14 @@ const deserializeAws_queryPauseClusterResult = (output: any, context: __SerdeCon }; const deserializeAws_queryPendingActionsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryPendingModifiedValues = (output: any, context: __SerdeContext): PendingModifiedValues => { @@ -16307,7 +16616,14 @@ const deserializeAws_queryRecurringCharge = (output: any, context: __SerdeContex }; const deserializeAws_queryRecurringChargeList = (output: any, context: __SerdeContext): RecurringCharge[] => { - return (output || []).map((entry: any) => deserializeAws_queryRecurringCharge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRecurringCharge(entry, context); + }); }; const deserializeAws_queryReservedNode = (output: any, context: __SerdeContext): ReservedNode => { @@ -16401,7 +16717,14 @@ const deserializeAws_queryReservedNodeAlreadyMigratedFault = ( }; const deserializeAws_queryReservedNodeList = (output: any, context: __SerdeContext): ReservedNode[] => { - return (output || []).map((entry: any) => deserializeAws_queryReservedNode(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReservedNode(entry, context); + }); }; const deserializeAws_queryReservedNodeNotFoundFault = ( @@ -16466,7 +16789,14 @@ const deserializeAws_queryReservedNodeOffering = (output: any, context: __SerdeC }; const deserializeAws_queryReservedNodeOfferingList = (output: any, context: __SerdeContext): ReservedNodeOffering[] => { - return (output || []).map((entry: any) => deserializeAws_queryReservedNodeOffering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReservedNodeOffering(entry, context); + }); }; const deserializeAws_queryReservedNodeOfferingNotFoundFault = ( @@ -16700,7 +17030,14 @@ const deserializeAws_queryResourceNotFoundFault = (output: any, context: __Serde }; const deserializeAws_queryRestorableNodeTypeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryRestoreFromClusterSnapshotResult = ( @@ -16798,7 +17135,14 @@ const deserializeAws_queryRevisionTarget = (output: any, context: __SerdeContext }; const deserializeAws_queryRevisionTargetsList = (output: any, context: __SerdeContext): RevisionTarget[] => { - return (output || []).map((entry: any) => deserializeAws_queryRevisionTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryRevisionTarget(entry, context); + }); }; const deserializeAws_queryRevokeClusterSecurityGroupIngressResult = ( @@ -16902,7 +17246,14 @@ const deserializeAws_queryScheduledActionAlreadyExistsFault = ( }; const deserializeAws_queryScheduledActionList = (output: any, context: __SerdeContext): ScheduledAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryScheduledAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryScheduledAction(entry, context); + }); }; const deserializeAws_queryScheduledActionNotFoundFault = ( @@ -16952,7 +17303,14 @@ const deserializeAws_queryScheduledActionsMessage = (output: any, context: __Ser }; const deserializeAws_queryScheduledActionTimeList = (output: any, context: __SerdeContext): Date[] => { - return (output || []).map((entry: any) => new Date(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return new Date(entry); + }); }; const deserializeAws_queryScheduledActionType = (output: any, context: __SerdeContext): ScheduledActionType => { @@ -16987,7 +17345,14 @@ const deserializeAws_queryScheduledActionTypeUnsupportedFault = ( }; const deserializeAws_queryScheduleDefinitionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryScheduleDefinitionTypeUnsupportedFault = ( @@ -17004,7 +17369,14 @@ const deserializeAws_queryScheduleDefinitionTypeUnsupportedFault = ( }; const deserializeAws_queryScheduledSnapshotTimeList = (output: any, context: __SerdeContext): Date[] => { - return (output || []).map((entry: any) => new Date(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return new Date(entry); + }); }; const deserializeAws_querySnapshot = (output: any, context: __SerdeContext): Snapshot => { @@ -17241,7 +17613,14 @@ const deserializeAws_querySnapshotCopyGrantAlreadyExistsFault = ( }; const deserializeAws_querySnapshotCopyGrantList = (output: any, context: __SerdeContext): SnapshotCopyGrant[] => { - return (output || []).map((entry: any) => deserializeAws_querySnapshotCopyGrant(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySnapshotCopyGrant(entry, context); + }); }; const deserializeAws_querySnapshotCopyGrantMessage = ( @@ -17316,11 +17695,25 @@ const deserializeAws_querySnapshotErrorMessage = (output: any, context: __SerdeC }; const deserializeAws_querySnapshotIdentifierList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySnapshotList = (output: any, context: __SerdeContext): Snapshot[] => { - return (output || []).map((entry: any) => deserializeAws_querySnapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySnapshot(entry, context); + }); }; const deserializeAws_querySnapshotMessage = (output: any, context: __SerdeContext): SnapshotMessage => { @@ -17418,7 +17811,14 @@ const deserializeAws_querySnapshotScheduleAlreadyExistsFault = ( }; const deserializeAws_querySnapshotScheduleList = (output: any, context: __SerdeContext): SnapshotSchedule[] => { - return (output || []).map((entry: any) => deserializeAws_querySnapshotSchedule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySnapshotSchedule(entry, context); + }); }; const deserializeAws_querySnapshotScheduleNotFoundFault = ( @@ -17494,7 +17894,14 @@ const deserializeAws_querySNSTopicArnNotFoundFault = ( }; const deserializeAws_querySourceIdsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_querySourceNotFoundFault = (output: any, context: __SerdeContext): SourceNotFoundFault => { @@ -17521,7 +17928,14 @@ const deserializeAws_querySpartaProxyVpcEndpointList = ( output: any, context: __SerdeContext ): SpartaProxyVpcEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_querySpartaProxyVpcEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySpartaProxyVpcEndpoint(entry, context); + }); }; const deserializeAws_querySubnet = (output: any, context: __SerdeContext): Subnet => { @@ -17553,7 +17967,14 @@ const deserializeAws_querySubnetAlreadyInUse = (output: any, context: __SerdeCon }; const deserializeAws_querySubnetList = (output: any, context: __SerdeContext): Subnet[] => { - return (output || []).map((entry: any) => deserializeAws_querySubnet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySubnet(entry, context); + }); }; const deserializeAws_querySubscriptionAlreadyExistFault = ( @@ -17632,7 +18053,14 @@ const deserializeAws_querySupportedOperation = (output: any, context: __SerdeCon }; const deserializeAws_querySupportedOperationList = (output: any, context: __SerdeContext): SupportedOperation[] => { - return (output || []).map((entry: any) => deserializeAws_querySupportedOperation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySupportedOperation(entry, context); + }); }; const deserializeAws_querySupportedPlatform = (output: any, context: __SerdeContext): SupportedPlatform => { @@ -17646,7 +18074,14 @@ const deserializeAws_querySupportedPlatform = (output: any, context: __SerdeCont }; const deserializeAws_querySupportedPlatformsList = (output: any, context: __SerdeContext): SupportedPlatform[] => { - return (output || []).map((entry: any) => deserializeAws_querySupportedPlatform(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySupportedPlatform(entry, context); + }); }; const deserializeAws_queryTableLimitExceededFault = (output: any, context: __SerdeContext): TableLimitExceededFault => { @@ -17735,7 +18170,14 @@ const deserializeAws_queryTableRestoreStatus = (output: any, context: __SerdeCon }; const deserializeAws_queryTableRestoreStatusList = (output: any, context: __SerdeContext): TableRestoreStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryTableRestoreStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTableRestoreStatus(entry, context); + }); }; const deserializeAws_queryTableRestoreStatusMessage = ( @@ -17797,7 +18239,14 @@ const deserializeAws_queryTaggedResource = (output: any, context: __SerdeContext }; const deserializeAws_queryTaggedResourceList = (output: any, context: __SerdeContext): TaggedResource[] => { - return (output || []).map((entry: any) => deserializeAws_queryTaggedResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTaggedResource(entry, context); + }); }; const deserializeAws_queryTaggedResourceListMessage = ( @@ -17834,11 +18283,25 @@ const deserializeAws_queryTagLimitExceededFault = (output: any, context: __Serde }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTrackList = (output: any, context: __SerdeContext): MaintenanceTrack[] => { - return (output || []).map((entry: any) => deserializeAws_queryMaintenanceTrack(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMaintenanceTrack(entry, context); + }); }; const deserializeAws_queryTrackListMessage = (output: any, context: __SerdeContext): TrackListMessage => { @@ -18019,7 +18482,14 @@ const deserializeAws_queryUsageLimitNotFoundFault = (output: any, context: __Ser }; const deserializeAws_queryUsageLimits = (output: any, context: __SerdeContext): UsageLimit[] => { - return (output || []).map((entry: any) => deserializeAws_queryUsageLimit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryUsageLimit(entry, context); + }); }; const deserializeAws_queryVpcSecurityGroupMembership = ( @@ -18043,7 +18513,14 @@ const deserializeAws_queryVpcSecurityGroupMembershipList = ( output: any, context: __SerdeContext ): VpcSecurityGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_queryVpcSecurityGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryVpcSecurityGroupMembership(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ diff --git a/clients/client-rekognition/protocols/Aws_json1_1.ts b/clients/client-rekognition/protocols/Aws_json1_1.ts index 6d347995af92..e94b4a4a6d44 100644 --- a/clients/client-rekognition/protocols/Aws_json1_1.ts +++ b/clients/client-rekognition/protocols/Aws_json1_1.ts @@ -330,7 +330,7 @@ export const serializeAws_json1_1CompareFacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.CompareFaces", }; let body: any; @@ -343,7 +343,7 @@ export const serializeAws_json1_1CreateCollectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.CreateCollection", }; let body: any; @@ -356,7 +356,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.CreateProject", }; let body: any; @@ -369,7 +369,7 @@ export const serializeAws_json1_1CreateProjectVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.CreateProjectVersion", }; let body: any; @@ -382,7 +382,7 @@ export const serializeAws_json1_1CreateStreamProcessorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.CreateStreamProcessor", }; let body: any; @@ -395,7 +395,7 @@ export const serializeAws_json1_1DeleteCollectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DeleteCollection", }; let body: any; @@ -408,7 +408,7 @@ export const serializeAws_json1_1DeleteFacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DeleteFaces", }; let body: any; @@ -421,7 +421,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DeleteProject", }; let body: any; @@ -434,7 +434,7 @@ export const serializeAws_json1_1DeleteProjectVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DeleteProjectVersion", }; let body: any; @@ -447,7 +447,7 @@ export const serializeAws_json1_1DeleteStreamProcessorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DeleteStreamProcessor", }; let body: any; @@ -460,7 +460,7 @@ export const serializeAws_json1_1DescribeCollectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DescribeCollection", }; let body: any; @@ -473,7 +473,7 @@ export const serializeAws_json1_1DescribeProjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DescribeProjects", }; let body: any; @@ -486,7 +486,7 @@ export const serializeAws_json1_1DescribeProjectVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DescribeProjectVersions", }; let body: any; @@ -499,7 +499,7 @@ export const serializeAws_json1_1DescribeStreamProcessorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DescribeStreamProcessor", }; let body: any; @@ -512,7 +512,7 @@ export const serializeAws_json1_1DetectCustomLabelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DetectCustomLabels", }; let body: any; @@ -525,7 +525,7 @@ export const serializeAws_json1_1DetectFacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DetectFaces", }; let body: any; @@ -538,7 +538,7 @@ export const serializeAws_json1_1DetectLabelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DetectLabels", }; let body: any; @@ -551,7 +551,7 @@ export const serializeAws_json1_1DetectModerationLabelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DetectModerationLabels", }; let body: any; @@ -564,7 +564,7 @@ export const serializeAws_json1_1DetectProtectiveEquipmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DetectProtectiveEquipment", }; let body: any; @@ -577,7 +577,7 @@ export const serializeAws_json1_1DetectTextCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.DetectText", }; let body: any; @@ -590,7 +590,7 @@ export const serializeAws_json1_1GetCelebrityInfoCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.GetCelebrityInfo", }; let body: any; @@ -603,7 +603,7 @@ export const serializeAws_json1_1GetCelebrityRecognitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.GetCelebrityRecognition", }; let body: any; @@ -616,7 +616,7 @@ export const serializeAws_json1_1GetContentModerationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.GetContentModeration", }; let body: any; @@ -629,7 +629,7 @@ export const serializeAws_json1_1GetFaceDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.GetFaceDetection", }; let body: any; @@ -642,7 +642,7 @@ export const serializeAws_json1_1GetFaceSearchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.GetFaceSearch", }; let body: any; @@ -655,7 +655,7 @@ export const serializeAws_json1_1GetLabelDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.GetLabelDetection", }; let body: any; @@ -668,7 +668,7 @@ export const serializeAws_json1_1GetPersonTrackingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.GetPersonTracking", }; let body: any; @@ -681,7 +681,7 @@ export const serializeAws_json1_1GetSegmentDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.GetSegmentDetection", }; let body: any; @@ -694,7 +694,7 @@ export const serializeAws_json1_1GetTextDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.GetTextDetection", }; let body: any; @@ -707,7 +707,7 @@ export const serializeAws_json1_1IndexFacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.IndexFaces", }; let body: any; @@ -720,7 +720,7 @@ export const serializeAws_json1_1ListCollectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.ListCollections", }; let body: any; @@ -733,7 +733,7 @@ export const serializeAws_json1_1ListFacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.ListFaces", }; let body: any; @@ -746,7 +746,7 @@ export const serializeAws_json1_1ListStreamProcessorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.ListStreamProcessors", }; let body: any; @@ -759,7 +759,7 @@ export const serializeAws_json1_1RecognizeCelebritiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.RecognizeCelebrities", }; let body: any; @@ -772,7 +772,7 @@ export const serializeAws_json1_1SearchFacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.SearchFaces", }; let body: any; @@ -785,7 +785,7 @@ export const serializeAws_json1_1SearchFacesByImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.SearchFacesByImage", }; let body: any; @@ -798,7 +798,7 @@ export const serializeAws_json1_1StartCelebrityRecognitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartCelebrityRecognition", }; let body: any; @@ -811,7 +811,7 @@ export const serializeAws_json1_1StartContentModerationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartContentModeration", }; let body: any; @@ -824,7 +824,7 @@ export const serializeAws_json1_1StartFaceDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartFaceDetection", }; let body: any; @@ -837,7 +837,7 @@ export const serializeAws_json1_1StartFaceSearchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartFaceSearch", }; let body: any; @@ -850,7 +850,7 @@ export const serializeAws_json1_1StartLabelDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartLabelDetection", }; let body: any; @@ -863,7 +863,7 @@ export const serializeAws_json1_1StartPersonTrackingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartPersonTracking", }; let body: any; @@ -876,7 +876,7 @@ export const serializeAws_json1_1StartProjectVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartProjectVersion", }; let body: any; @@ -889,7 +889,7 @@ export const serializeAws_json1_1StartSegmentDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartSegmentDetection", }; let body: any; @@ -902,7 +902,7 @@ export const serializeAws_json1_1StartStreamProcessorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartStreamProcessor", }; let body: any; @@ -915,7 +915,7 @@ export const serializeAws_json1_1StartTextDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StartTextDetection", }; let body: any; @@ -928,7 +928,7 @@ export const serializeAws_json1_1StopProjectVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StopProjectVersion", }; let body: any; @@ -941,7 +941,7 @@ export const serializeAws_json1_1StopStreamProcessorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "RekognitionService.StopStreamProcessor", }; let body: any; @@ -976,8 +976,7 @@ const deserializeAws_json1_1CompareFacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1087,8 +1086,7 @@ const deserializeAws_json1_1CreateCollectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1182,8 +1180,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1285,8 +1282,7 @@ const deserializeAws_json1_1CreateProjectVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1396,8 +1392,7 @@ const deserializeAws_json1_1CreateStreamProcessorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1499,8 +1494,7 @@ const deserializeAws_json1_1DeleteCollectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1594,8 +1588,7 @@ const deserializeAws_json1_1DeleteFacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1689,8 +1682,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1792,8 +1784,7 @@ const deserializeAws_json1_1DeleteProjectVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1895,8 +1886,7 @@ const deserializeAws_json1_1DeleteStreamProcessorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -1998,8 +1988,7 @@ const deserializeAws_json1_1DescribeCollectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -2093,8 +2082,7 @@ const deserializeAws_json1_1DescribeProjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -2188,8 +2176,7 @@ const deserializeAws_json1_1DescribeProjectVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -2291,8 +2278,7 @@ const deserializeAws_json1_1DescribeStreamProcessorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -2386,8 +2372,7 @@ const deserializeAws_json1_1DetectCustomLabelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -2521,8 +2506,7 @@ const deserializeAws_json1_1DetectFacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -2632,8 +2616,7 @@ const deserializeAws_json1_1DetectLabelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -2743,8 +2726,7 @@ const deserializeAws_json1_1DetectModerationLabelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -2862,8 +2844,7 @@ const deserializeAws_json1_1DetectProtectiveEquipmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -2973,8 +2954,7 @@ const deserializeAws_json1_1DetectTextCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -3084,8 +3064,7 @@ const deserializeAws_json1_1GetCelebrityInfoCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -3179,8 +3158,7 @@ const deserializeAws_json1_1GetCelebrityRecognitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -3282,8 +3260,7 @@ const deserializeAws_json1_1GetContentModerationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -3385,8 +3362,7 @@ const deserializeAws_json1_1GetFaceDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -3488,8 +3464,7 @@ const deserializeAws_json1_1GetFaceSearchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -3591,8 +3566,7 @@ const deserializeAws_json1_1GetLabelDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -3694,8 +3668,7 @@ const deserializeAws_json1_1GetPersonTrackingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -3797,8 +3770,7 @@ const deserializeAws_json1_1GetSegmentDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -3900,8 +3872,7 @@ const deserializeAws_json1_1GetTextDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4003,8 +3974,7 @@ const deserializeAws_json1_1IndexFacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4130,8 +4100,7 @@ const deserializeAws_json1_1ListCollectionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4233,8 +4202,7 @@ const deserializeAws_json1_1ListFacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4336,8 +4304,7 @@ const deserializeAws_json1_1ListStreamProcessorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4431,8 +4398,7 @@ const deserializeAws_json1_1RecognizeCelebritiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4542,8 +4508,7 @@ const deserializeAws_json1_1SearchFacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4637,8 +4602,7 @@ const deserializeAws_json1_1SearchFacesByImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4756,8 +4720,7 @@ const deserializeAws_json1_1StartCelebrityRecognitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4875,8 +4838,7 @@ const deserializeAws_json1_1StartContentModerationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -4994,8 +4956,7 @@ const deserializeAws_json1_1StartFaceDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -5113,8 +5074,7 @@ const deserializeAws_json1_1StartFaceSearchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -5240,8 +5200,7 @@ const deserializeAws_json1_1StartLabelDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -5359,8 +5318,7 @@ const deserializeAws_json1_1StartPersonTrackingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -5478,8 +5436,7 @@ const deserializeAws_json1_1StartProjectVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -5589,8 +5546,7 @@ const deserializeAws_json1_1StartSegmentDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -5708,8 +5664,7 @@ const deserializeAws_json1_1StartStreamProcessorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -5811,8 +5766,7 @@ const deserializeAws_json1_1StartTextDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -5930,8 +5884,7 @@ const deserializeAws_json1_1StopProjectVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -6033,8 +5986,7 @@ const deserializeAws_json1_1StopStreamProcessorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": @@ -6381,35 +6333,53 @@ const deserializeAws_json1_1VideoTooLargeExceptionResponse = async ( const serializeAws_json1_1Asset = (input: Asset, context: __SerdeContext): any => { return { - ...(input.GroundTruthManifest !== undefined && { - GroundTruthManifest: serializeAws_json1_1GroundTruthManifest(input.GroundTruthManifest, context), - }), + ...(input.GroundTruthManifest !== undefined && + input.GroundTruthManifest !== null && { + GroundTruthManifest: serializeAws_json1_1GroundTruthManifest(input.GroundTruthManifest, context), + }), }; }; const serializeAws_json1_1Assets = (input: Asset[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Asset(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Asset(entry, context); + }); }; const serializeAws_json1_1Attributes = (input: (Attribute | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1BoundingBox = (input: BoundingBox, context: __SerdeContext): any => { return { - ...(input.Height !== undefined && { Height: input.Height }), - ...(input.Left !== undefined && { Left: input.Left }), - ...(input.Top !== undefined && { Top: input.Top }), - ...(input.Width !== undefined && { Width: input.Width }), + ...(input.Height !== undefined && input.Height !== null && { Height: input.Height }), + ...(input.Left !== undefined && input.Left !== null && { Left: input.Left }), + ...(input.Top !== undefined && input.Top !== null && { Top: input.Top }), + ...(input.Width !== undefined && input.Width !== null && { Width: input.Width }), }; }; const serializeAws_json1_1CompareFacesRequest = (input: CompareFacesRequest, context: __SerdeContext): any => { return { - ...(input.QualityFilter !== undefined && { QualityFilter: input.QualityFilter }), - ...(input.SimilarityThreshold !== undefined && { SimilarityThreshold: input.SimilarityThreshold }), - ...(input.SourceImage !== undefined && { SourceImage: serializeAws_json1_1Image(input.SourceImage, context) }), - ...(input.TargetImage !== undefined && { TargetImage: serializeAws_json1_1Image(input.TargetImage, context) }), + ...(input.QualityFilter !== undefined && input.QualityFilter !== null && { QualityFilter: input.QualityFilter }), + ...(input.SimilarityThreshold !== undefined && + input.SimilarityThreshold !== null && { SimilarityThreshold: input.SimilarityThreshold }), + ...(input.SourceImage !== undefined && + input.SourceImage !== null && { SourceImage: serializeAws_json1_1Image(input.SourceImage, context) }), + ...(input.TargetImage !== undefined && + input.TargetImage !== null && { TargetImage: serializeAws_json1_1Image(input.TargetImage, context) }), }; }; @@ -6417,18 +6387,25 @@ const serializeAws_json1_1ContentClassifiers = ( input: (ContentClassifier | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateCollectionRequest = (input: CreateCollectionRequest, context: __SerdeContext): any => { return { - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), }; }; const serializeAws_json1_1CreateProjectRequest = (input: CreateProjectRequest, context: __SerdeContext): any => { return { - ...(input.ProjectName !== undefined && { ProjectName: input.ProjectName }), + ...(input.ProjectName !== undefined && input.ProjectName !== null && { ProjectName: input.ProjectName }), }; }; @@ -6437,17 +6414,14 @@ const serializeAws_json1_1CreateProjectVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context), - }), - ...(input.ProjectArn !== undefined && { ProjectArn: input.ProjectArn }), - ...(input.TestingData !== undefined && { - TestingData: serializeAws_json1_1TestingData(input.TestingData, context), - }), - ...(input.TrainingData !== undefined && { - TrainingData: serializeAws_json1_1TrainingData(input.TrainingData, context), - }), - ...(input.VersionName !== undefined && { VersionName: input.VersionName }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }), + ...(input.ProjectArn !== undefined && input.ProjectArn !== null && { ProjectArn: input.ProjectArn }), + ...(input.TestingData !== undefined && + input.TestingData !== null && { TestingData: serializeAws_json1_1TestingData(input.TestingData, context) }), + ...(input.TrainingData !== undefined && + input.TrainingData !== null && { TrainingData: serializeAws_json1_1TrainingData(input.TrainingData, context) }), + ...(input.VersionName !== undefined && input.VersionName !== null && { VersionName: input.VersionName }), }; }; @@ -6456,32 +6430,34 @@ const serializeAws_json1_1CreateStreamProcessorRequest = ( context: __SerdeContext ): any => { return { - ...(input.Input !== undefined && { Input: serializeAws_json1_1StreamProcessorInput(input.Input, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Output !== undefined && { Output: serializeAws_json1_1StreamProcessorOutput(input.Output, context) }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Settings !== undefined && { - Settings: serializeAws_json1_1StreamProcessorSettings(input.Settings, context), - }), + ...(input.Input !== undefined && + input.Input !== null && { Input: serializeAws_json1_1StreamProcessorInput(input.Input, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Output !== undefined && + input.Output !== null && { Output: serializeAws_json1_1StreamProcessorOutput(input.Output, context) }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Settings !== undefined && + input.Settings !== null && { Settings: serializeAws_json1_1StreamProcessorSettings(input.Settings, context) }), }; }; const serializeAws_json1_1DeleteCollectionRequest = (input: DeleteCollectionRequest, context: __SerdeContext): any => { return { - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), }; }; const serializeAws_json1_1DeleteFacesRequest = (input: DeleteFacesRequest, context: __SerdeContext): any => { return { - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), - ...(input.FaceIds !== undefined && { FaceIds: serializeAws_json1_1FaceIdList(input.FaceIds, context) }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), + ...(input.FaceIds !== undefined && + input.FaceIds !== null && { FaceIds: serializeAws_json1_1FaceIdList(input.FaceIds, context) }), }; }; const serializeAws_json1_1DeleteProjectRequest = (input: DeleteProjectRequest, context: __SerdeContext): any => { return { - ...(input.ProjectArn !== undefined && { ProjectArn: input.ProjectArn }), + ...(input.ProjectArn !== undefined && input.ProjectArn !== null && { ProjectArn: input.ProjectArn }), }; }; @@ -6490,7 +6466,8 @@ const serializeAws_json1_1DeleteProjectVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProjectVersionArn !== undefined && { ProjectVersionArn: input.ProjectVersionArn }), + ...(input.ProjectVersionArn !== undefined && + input.ProjectVersionArn !== null && { ProjectVersionArn: input.ProjectVersionArn }), }; }; @@ -6499,7 +6476,7 @@ const serializeAws_json1_1DeleteStreamProcessorRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -6508,14 +6485,14 @@ const serializeAws_json1_1DescribeCollectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), }; }; const serializeAws_json1_1DescribeProjectsRequest = (input: DescribeProjectsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6524,12 +6501,11 @@ const serializeAws_json1_1DescribeProjectVersionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ProjectArn !== undefined && { ProjectArn: input.ProjectArn }), - ...(input.VersionNames !== undefined && { - VersionNames: serializeAws_json1_1VersionNames(input.VersionNames, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ProjectArn !== undefined && input.ProjectArn !== null && { ProjectArn: input.ProjectArn }), + ...(input.VersionNames !== undefined && + input.VersionNames !== null && { VersionNames: serializeAws_json1_1VersionNames(input.VersionNames, context) }), }; }; @@ -6538,7 +6514,7 @@ const serializeAws_json1_1DescribeStreamProcessorRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -6547,33 +6523,40 @@ const serializeAws_json1_1DetectCustomLabelsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Image !== undefined && { Image: serializeAws_json1_1Image(input.Image, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MinConfidence !== undefined && { MinConfidence: input.MinConfidence }), - ...(input.ProjectVersionArn !== undefined && { ProjectVersionArn: input.ProjectVersionArn }), + ...(input.Image !== undefined && + input.Image !== null && { Image: serializeAws_json1_1Image(input.Image, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MinConfidence !== undefined && input.MinConfidence !== null && { MinConfidence: input.MinConfidence }), + ...(input.ProjectVersionArn !== undefined && + input.ProjectVersionArn !== null && { ProjectVersionArn: input.ProjectVersionArn }), }; }; const serializeAws_json1_1DetectFacesRequest = (input: DetectFacesRequest, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { Attributes: serializeAws_json1_1Attributes(input.Attributes, context) }), - ...(input.Image !== undefined && { Image: serializeAws_json1_1Image(input.Image, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1Attributes(input.Attributes, context) }), + ...(input.Image !== undefined && + input.Image !== null && { Image: serializeAws_json1_1Image(input.Image, context) }), }; }; const serializeAws_json1_1DetectionFilter = (input: DetectionFilter, context: __SerdeContext): any => { return { - ...(input.MinBoundingBoxHeight !== undefined && { MinBoundingBoxHeight: input.MinBoundingBoxHeight }), - ...(input.MinBoundingBoxWidth !== undefined && { MinBoundingBoxWidth: input.MinBoundingBoxWidth }), - ...(input.MinConfidence !== undefined && { MinConfidence: input.MinConfidence }), + ...(input.MinBoundingBoxHeight !== undefined && + input.MinBoundingBoxHeight !== null && { MinBoundingBoxHeight: input.MinBoundingBoxHeight }), + ...(input.MinBoundingBoxWidth !== undefined && + input.MinBoundingBoxWidth !== null && { MinBoundingBoxWidth: input.MinBoundingBoxWidth }), + ...(input.MinConfidence !== undefined && input.MinConfidence !== null && { MinConfidence: input.MinConfidence }), }; }; const serializeAws_json1_1DetectLabelsRequest = (input: DetectLabelsRequest, context: __SerdeContext): any => { return { - ...(input.Image !== undefined && { Image: serializeAws_json1_1Image(input.Image, context) }), - ...(input.MaxLabels !== undefined && { MaxLabels: input.MaxLabels }), - ...(input.MinConfidence !== undefined && { MinConfidence: input.MinConfidence }), + ...(input.Image !== undefined && + input.Image !== null && { Image: serializeAws_json1_1Image(input.Image, context) }), + ...(input.MaxLabels !== undefined && input.MaxLabels !== null && { MaxLabels: input.MaxLabels }), + ...(input.MinConfidence !== undefined && input.MinConfidence !== null && { MinConfidence: input.MinConfidence }), }; }; @@ -6582,11 +6565,13 @@ const serializeAws_json1_1DetectModerationLabelsRequest = ( context: __SerdeContext ): any => { return { - ...(input.HumanLoopConfig !== undefined && { - HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context), - }), - ...(input.Image !== undefined && { Image: serializeAws_json1_1Image(input.Image, context) }), - ...(input.MinConfidence !== undefined && { MinConfidence: input.MinConfidence }), + ...(input.HumanLoopConfig !== undefined && + input.HumanLoopConfig !== null && { + HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context), + }), + ...(input.Image !== undefined && + input.Image !== null && { Image: serializeAws_json1_1Image(input.Image, context) }), + ...(input.MinConfidence !== undefined && input.MinConfidence !== null && { MinConfidence: input.MinConfidence }), }; }; @@ -6595,48 +6580,60 @@ const serializeAws_json1_1DetectProtectiveEquipmentRequest = ( context: __SerdeContext ): any => { return { - ...(input.Image !== undefined && { Image: serializeAws_json1_1Image(input.Image, context) }), - ...(input.SummarizationAttributes !== undefined && { - SummarizationAttributes: serializeAws_json1_1ProtectiveEquipmentSummarizationAttributes( - input.SummarizationAttributes, - context - ), - }), + ...(input.Image !== undefined && + input.Image !== null && { Image: serializeAws_json1_1Image(input.Image, context) }), + ...(input.SummarizationAttributes !== undefined && + input.SummarizationAttributes !== null && { + SummarizationAttributes: serializeAws_json1_1ProtectiveEquipmentSummarizationAttributes( + input.SummarizationAttributes, + context + ), + }), }; }; const serializeAws_json1_1DetectTextFilters = (input: DetectTextFilters, context: __SerdeContext): any => { return { - ...(input.RegionsOfInterest !== undefined && { - RegionsOfInterest: serializeAws_json1_1RegionsOfInterest(input.RegionsOfInterest, context), - }), - ...(input.WordFilter !== undefined && { - WordFilter: serializeAws_json1_1DetectionFilter(input.WordFilter, context), - }), + ...(input.RegionsOfInterest !== undefined && + input.RegionsOfInterest !== null && { + RegionsOfInterest: serializeAws_json1_1RegionsOfInterest(input.RegionsOfInterest, context), + }), + ...(input.WordFilter !== undefined && + input.WordFilter !== null && { WordFilter: serializeAws_json1_1DetectionFilter(input.WordFilter, context) }), }; }; const serializeAws_json1_1DetectTextRequest = (input: DetectTextRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1DetectTextFilters(input.Filters, context) }), - ...(input.Image !== undefined && { Image: serializeAws_json1_1Image(input.Image, context) }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1DetectTextFilters(input.Filters, context) }), + ...(input.Image !== undefined && + input.Image !== null && { Image: serializeAws_json1_1Image(input.Image, context) }), }; }; const serializeAws_json1_1FaceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FaceSearchSettings = (input: FaceSearchSettings, context: __SerdeContext): any => { return { - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), - ...(input.FaceMatchThreshold !== undefined && { FaceMatchThreshold: input.FaceMatchThreshold }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), + ...(input.FaceMatchThreshold !== undefined && + input.FaceMatchThreshold !== null && { FaceMatchThreshold: input.FaceMatchThreshold }), }; }; const serializeAws_json1_1GetCelebrityInfoRequest = (input: GetCelebrityInfoRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -6645,10 +6642,10 @@ const serializeAws_json1_1GetCelebrityRecognitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), }; }; @@ -6657,27 +6654,27 @@ const serializeAws_json1_1GetContentModerationRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), }; }; const serializeAws_json1_1GetFaceDetectionRequest = (input: GetFaceDetectionRequest, context: __SerdeContext): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetFaceSearchRequest = (input: GetFaceSearchRequest, context: __SerdeContext): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), }; }; @@ -6686,10 +6683,10 @@ const serializeAws_json1_1GetLabelDetectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), }; }; @@ -6698,10 +6695,10 @@ const serializeAws_json1_1GetPersonTrackingRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), }; }; @@ -6710,88 +6707,96 @@ const serializeAws_json1_1GetSegmentDetectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GetTextDetectionRequest = (input: GetTextDetectionRequest, context: __SerdeContext): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1GroundTruthManifest = (input: GroundTruthManifest, context: __SerdeContext): any => { return { - ...(input.S3Object !== undefined && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), + ...(input.S3Object !== undefined && + input.S3Object !== null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), }; }; const serializeAws_json1_1HumanLoopConfig = (input: HumanLoopConfig, context: __SerdeContext): any => { return { - ...(input.DataAttributes !== undefined && { - DataAttributes: serializeAws_json1_1HumanLoopDataAttributes(input.DataAttributes, context), - }), - ...(input.FlowDefinitionArn !== undefined && { FlowDefinitionArn: input.FlowDefinitionArn }), - ...(input.HumanLoopName !== undefined && { HumanLoopName: input.HumanLoopName }), + ...(input.DataAttributes !== undefined && + input.DataAttributes !== null && { + DataAttributes: serializeAws_json1_1HumanLoopDataAttributes(input.DataAttributes, context), + }), + ...(input.FlowDefinitionArn !== undefined && + input.FlowDefinitionArn !== null && { FlowDefinitionArn: input.FlowDefinitionArn }), + ...(input.HumanLoopName !== undefined && input.HumanLoopName !== null && { HumanLoopName: input.HumanLoopName }), }; }; const serializeAws_json1_1HumanLoopDataAttributes = (input: HumanLoopDataAttributes, context: __SerdeContext): any => { return { - ...(input.ContentClassifiers !== undefined && { - ContentClassifiers: serializeAws_json1_1ContentClassifiers(input.ContentClassifiers, context), - }), + ...(input.ContentClassifiers !== undefined && + input.ContentClassifiers !== null && { + ContentClassifiers: serializeAws_json1_1ContentClassifiers(input.ContentClassifiers, context), + }), }; }; const serializeAws_json1_1Image = (input: Image, context: __SerdeContext): any => { return { - ...(input.Bytes !== undefined && { Bytes: context.base64Encoder(input.Bytes) }), - ...(input.S3Object !== undefined && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), + ...(input.Bytes !== undefined && input.Bytes !== null && { Bytes: context.base64Encoder(input.Bytes) }), + ...(input.S3Object !== undefined && + input.S3Object !== null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), }; }; const serializeAws_json1_1IndexFacesRequest = (input: IndexFacesRequest, context: __SerdeContext): any => { return { - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), - ...(input.DetectionAttributes !== undefined && { - DetectionAttributes: serializeAws_json1_1Attributes(input.DetectionAttributes, context), - }), - ...(input.ExternalImageId !== undefined && { ExternalImageId: input.ExternalImageId }), - ...(input.Image !== undefined && { Image: serializeAws_json1_1Image(input.Image, context) }), - ...(input.MaxFaces !== undefined && { MaxFaces: input.MaxFaces }), - ...(input.QualityFilter !== undefined && { QualityFilter: input.QualityFilter }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), + ...(input.DetectionAttributes !== undefined && + input.DetectionAttributes !== null && { + DetectionAttributes: serializeAws_json1_1Attributes(input.DetectionAttributes, context), + }), + ...(input.ExternalImageId !== undefined && + input.ExternalImageId !== null && { ExternalImageId: input.ExternalImageId }), + ...(input.Image !== undefined && + input.Image !== null && { Image: serializeAws_json1_1Image(input.Image, context) }), + ...(input.MaxFaces !== undefined && input.MaxFaces !== null && { MaxFaces: input.MaxFaces }), + ...(input.QualityFilter !== undefined && input.QualityFilter !== null && { QualityFilter: input.QualityFilter }), }; }; const serializeAws_json1_1KinesisDataStream = (input: KinesisDataStream, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }; }; const serializeAws_json1_1KinesisVideoStream = (input: KinesisVideoStream, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }; }; const serializeAws_json1_1ListCollectionsRequest = (input: ListCollectionsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListFacesRequest = (input: ListFacesRequest, context: __SerdeContext): any => { return { - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -6800,22 +6805,22 @@ const serializeAws_json1_1ListStreamProcessorsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1NotificationChannel = (input: NotificationChannel, context: __SerdeContext): any => { return { - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.SNSTopicArn !== undefined && { SNSTopicArn: input.SNSTopicArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.SNSTopicArn !== undefined && input.SNSTopicArn !== null && { SNSTopicArn: input.SNSTopicArn }), }; }; const serializeAws_json1_1OutputConfig = (input: OutputConfig, context: __SerdeContext): any => { return { - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3KeyPrefix !== undefined && { S3KeyPrefix: input.S3KeyPrefix }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3KeyPrefix !== undefined && input.S3KeyPrefix !== null && { S3KeyPrefix: input.S3KeyPrefix }), }; }; @@ -6824,10 +6829,11 @@ const serializeAws_json1_1ProtectiveEquipmentSummarizationAttributes = ( context: __SerdeContext ): any => { return { - ...(input.MinConfidence !== undefined && { MinConfidence: input.MinConfidence }), - ...(input.RequiredEquipmentTypes !== undefined && { - RequiredEquipmentTypes: serializeAws_json1_1ProtectiveEquipmentTypes(input.RequiredEquipmentTypes, context), - }), + ...(input.MinConfidence !== undefined && input.MinConfidence !== null && { MinConfidence: input.MinConfidence }), + ...(input.RequiredEquipmentTypes !== undefined && + input.RequiredEquipmentTypes !== null && { + RequiredEquipmentTypes: serializeAws_json1_1ProtectiveEquipmentTypes(input.RequiredEquipmentTypes, context), + }), }; }; @@ -6835,7 +6841,14 @@ const serializeAws_json1_1ProtectiveEquipmentTypes = ( input: (ProtectiveEquipmentType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RecognizeCelebritiesRequest = ( @@ -6843,27 +6856,34 @@ const serializeAws_json1_1RecognizeCelebritiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Image !== undefined && { Image: serializeAws_json1_1Image(input.Image, context) }), + ...(input.Image !== undefined && + input.Image !== null && { Image: serializeAws_json1_1Image(input.Image, context) }), }; }; const serializeAws_json1_1RegionOfInterest = (input: RegionOfInterest, context: __SerdeContext): any => { return { - ...(input.BoundingBox !== undefined && { - BoundingBox: serializeAws_json1_1BoundingBox(input.BoundingBox, context), - }), + ...(input.BoundingBox !== undefined && + input.BoundingBox !== null && { BoundingBox: serializeAws_json1_1BoundingBox(input.BoundingBox, context) }), }; }; const serializeAws_json1_1RegionsOfInterest = (input: RegionOfInterest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RegionOfInterest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RegionOfInterest(entry, context); + }); }; const serializeAws_json1_1S3Object = (input: S3Object, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -6872,25 +6892,35 @@ const serializeAws_json1_1SearchFacesByImageRequest = ( context: __SerdeContext ): any => { return { - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), - ...(input.FaceMatchThreshold !== undefined && { FaceMatchThreshold: input.FaceMatchThreshold }), - ...(input.Image !== undefined && { Image: serializeAws_json1_1Image(input.Image, context) }), - ...(input.MaxFaces !== undefined && { MaxFaces: input.MaxFaces }), - ...(input.QualityFilter !== undefined && { QualityFilter: input.QualityFilter }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), + ...(input.FaceMatchThreshold !== undefined && + input.FaceMatchThreshold !== null && { FaceMatchThreshold: input.FaceMatchThreshold }), + ...(input.Image !== undefined && + input.Image !== null && { Image: serializeAws_json1_1Image(input.Image, context) }), + ...(input.MaxFaces !== undefined && input.MaxFaces !== null && { MaxFaces: input.MaxFaces }), + ...(input.QualityFilter !== undefined && input.QualityFilter !== null && { QualityFilter: input.QualityFilter }), }; }; const serializeAws_json1_1SearchFacesRequest = (input: SearchFacesRequest, context: __SerdeContext): any => { return { - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), - ...(input.FaceId !== undefined && { FaceId: input.FaceId }), - ...(input.FaceMatchThreshold !== undefined && { FaceMatchThreshold: input.FaceMatchThreshold }), - ...(input.MaxFaces !== undefined && { MaxFaces: input.MaxFaces }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), + ...(input.FaceId !== undefined && input.FaceId !== null && { FaceId: input.FaceId }), + ...(input.FaceMatchThreshold !== undefined && + input.FaceMatchThreshold !== null && { FaceMatchThreshold: input.FaceMatchThreshold }), + ...(input.MaxFaces !== undefined && input.MaxFaces !== null && { MaxFaces: input.MaxFaces }), }; }; const serializeAws_json1_1SegmentTypes = (input: (SegmentType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartCelebrityRecognitionRequest = ( @@ -6898,12 +6928,15 @@ const serializeAws_json1_1StartCelebrityRecognitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.Video !== undefined && { Video: serializeAws_json1_1Video(input.Video, context) }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.Video !== undefined && + input.Video !== null && { Video: serializeAws_json1_1Video(input.Video, context) }), }; }; @@ -6912,13 +6945,16 @@ const serializeAws_json1_1StartContentModerationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.MinConfidence !== undefined && { MinConfidence: input.MinConfidence }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.Video !== undefined && { Video: serializeAws_json1_1Video(input.Video, context) }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.MinConfidence !== undefined && input.MinConfidence !== null && { MinConfidence: input.MinConfidence }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.Video !== undefined && + input.Video !== null && { Video: serializeAws_json1_1Video(input.Video, context) }), }; }; @@ -6927,26 +6963,34 @@ const serializeAws_json1_1StartFaceDetectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.FaceAttributes !== undefined && { FaceAttributes: input.FaceAttributes }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.Video !== undefined && { Video: serializeAws_json1_1Video(input.Video, context) }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.FaceAttributes !== undefined && + input.FaceAttributes !== null && { FaceAttributes: input.FaceAttributes }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.Video !== undefined && + input.Video !== null && { Video: serializeAws_json1_1Video(input.Video, context) }), }; }; const serializeAws_json1_1StartFaceSearchRequest = (input: StartFaceSearchRequest, context: __SerdeContext): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.CollectionId !== undefined && { CollectionId: input.CollectionId }), - ...(input.FaceMatchThreshold !== undefined && { FaceMatchThreshold: input.FaceMatchThreshold }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.Video !== undefined && { Video: serializeAws_json1_1Video(input.Video, context) }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.CollectionId !== undefined && input.CollectionId !== null && { CollectionId: input.CollectionId }), + ...(input.FaceMatchThreshold !== undefined && + input.FaceMatchThreshold !== null && { FaceMatchThreshold: input.FaceMatchThreshold }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.Video !== undefined && + input.Video !== null && { Video: serializeAws_json1_1Video(input.Video, context) }), }; }; @@ -6955,13 +6999,16 @@ const serializeAws_json1_1StartLabelDetectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.MinConfidence !== undefined && { MinConfidence: input.MinConfidence }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.Video !== undefined && { Video: serializeAws_json1_1Video(input.Video, context) }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.MinConfidence !== undefined && input.MinConfidence !== null && { MinConfidence: input.MinConfidence }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.Video !== undefined && + input.Video !== null && { Video: serializeAws_json1_1Video(input.Video, context) }), }; }; @@ -6970,12 +7017,15 @@ const serializeAws_json1_1StartPersonTrackingRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.Video !== undefined && { Video: serializeAws_json1_1Video(input.Video, context) }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.Video !== undefined && + input.Video !== null && { Video: serializeAws_json1_1Video(input.Video, context) }), }; }; @@ -6984,8 +7034,10 @@ const serializeAws_json1_1StartProjectVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.MinInferenceUnits !== undefined && { MinInferenceUnits: input.MinInferenceUnits }), - ...(input.ProjectVersionArn !== undefined && { ProjectVersionArn: input.ProjectVersionArn }), + ...(input.MinInferenceUnits !== undefined && + input.MinInferenceUnits !== null && { MinInferenceUnits: input.MinInferenceUnits }), + ...(input.ProjectVersionArn !== undefined && + input.ProjectVersionArn !== null && { ProjectVersionArn: input.ProjectVersionArn }), }; }; @@ -6994,12 +7046,14 @@ const serializeAws_json1_1StartSegmentDetectionFilters = ( context: __SerdeContext ): any => { return { - ...(input.ShotFilter !== undefined && { - ShotFilter: serializeAws_json1_1StartShotDetectionFilter(input.ShotFilter, context), - }), - ...(input.TechnicalCueFilter !== undefined && { - TechnicalCueFilter: serializeAws_json1_1StartTechnicalCueDetectionFilter(input.TechnicalCueFilter, context), - }), + ...(input.ShotFilter !== undefined && + input.ShotFilter !== null && { + ShotFilter: serializeAws_json1_1StartShotDetectionFilter(input.ShotFilter, context), + }), + ...(input.TechnicalCueFilter !== undefined && + input.TechnicalCueFilter !== null && { + TechnicalCueFilter: serializeAws_json1_1StartTechnicalCueDetectionFilter(input.TechnicalCueFilter, context), + }), }; }; @@ -7008,18 +7062,19 @@ const serializeAws_json1_1StartSegmentDetectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1StartSegmentDetectionFilters(input.Filters, context), - }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.SegmentTypes !== undefined && { - SegmentTypes: serializeAws_json1_1SegmentTypes(input.SegmentTypes, context), - }), - ...(input.Video !== undefined && { Video: serializeAws_json1_1Video(input.Video, context) }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1StartSegmentDetectionFilters(input.Filters, context) }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.SegmentTypes !== undefined && + input.SegmentTypes !== null && { SegmentTypes: serializeAws_json1_1SegmentTypes(input.SegmentTypes, context) }), + ...(input.Video !== undefined && + input.Video !== null && { Video: serializeAws_json1_1Video(input.Video, context) }), }; }; @@ -7028,7 +7083,8 @@ const serializeAws_json1_1StartShotDetectionFilter = ( context: __SerdeContext ): any => { return { - ...(input.MinSegmentConfidence !== undefined && { MinSegmentConfidence: input.MinSegmentConfidence }), + ...(input.MinSegmentConfidence !== undefined && + input.MinSegmentConfidence !== null && { MinSegmentConfidence: input.MinSegmentConfidence }), }; }; @@ -7037,7 +7093,7 @@ const serializeAws_json1_1StartStreamProcessorRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -7046,7 +7102,8 @@ const serializeAws_json1_1StartTechnicalCueDetectionFilter = ( context: __SerdeContext ): any => { return { - ...(input.MinSegmentConfidence !== undefined && { MinSegmentConfidence: input.MinSegmentConfidence }), + ...(input.MinSegmentConfidence !== undefined && + input.MinSegmentConfidence !== null && { MinSegmentConfidence: input.MinSegmentConfidence }), }; }; @@ -7055,12 +7112,12 @@ const serializeAws_json1_1StartTextDetectionFilters = ( context: __SerdeContext ): any => { return { - ...(input.RegionsOfInterest !== undefined && { - RegionsOfInterest: serializeAws_json1_1RegionsOfInterest(input.RegionsOfInterest, context), - }), - ...(input.WordFilter !== undefined && { - WordFilter: serializeAws_json1_1DetectionFilter(input.WordFilter, context), - }), + ...(input.RegionsOfInterest !== undefined && + input.RegionsOfInterest !== null && { + RegionsOfInterest: serializeAws_json1_1RegionsOfInterest(input.RegionsOfInterest, context), + }), + ...(input.WordFilter !== undefined && + input.WordFilter !== null && { WordFilter: serializeAws_json1_1DetectionFilter(input.WordFilter, context) }), }; }; @@ -7069,15 +7126,17 @@ const serializeAws_json1_1StartTextDetectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1StartTextDetectionFilters(input.Filters, context), - }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.Video !== undefined && { Video: serializeAws_json1_1Video(input.Video, context) }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1StartTextDetectionFilters(input.Filters, context) }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.Video !== undefined && + input.Video !== null && { Video: serializeAws_json1_1Video(input.Video, context) }), }; }; @@ -7086,7 +7145,8 @@ const serializeAws_json1_1StopProjectVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProjectVersionArn !== undefined && { ProjectVersionArn: input.ProjectVersionArn }), + ...(input.ProjectVersionArn !== undefined && + input.ProjectVersionArn !== null && { ProjectVersionArn: input.ProjectVersionArn }), }; }; @@ -7095,54 +7155,65 @@ const serializeAws_json1_1StopStreamProcessorRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1StreamProcessorInput = (input: StreamProcessorInput, context: __SerdeContext): any => { return { - ...(input.KinesisVideoStream !== undefined && { - KinesisVideoStream: serializeAws_json1_1KinesisVideoStream(input.KinesisVideoStream, context), - }), + ...(input.KinesisVideoStream !== undefined && + input.KinesisVideoStream !== null && { + KinesisVideoStream: serializeAws_json1_1KinesisVideoStream(input.KinesisVideoStream, context), + }), }; }; const serializeAws_json1_1StreamProcessorOutput = (input: StreamProcessorOutput, context: __SerdeContext): any => { return { - ...(input.KinesisDataStream !== undefined && { - KinesisDataStream: serializeAws_json1_1KinesisDataStream(input.KinesisDataStream, context), - }), + ...(input.KinesisDataStream !== undefined && + input.KinesisDataStream !== null && { + KinesisDataStream: serializeAws_json1_1KinesisDataStream(input.KinesisDataStream, context), + }), }; }; const serializeAws_json1_1StreamProcessorSettings = (input: StreamProcessorSettings, context: __SerdeContext): any => { return { - ...(input.FaceSearch !== undefined && { - FaceSearch: serializeAws_json1_1FaceSearchSettings(input.FaceSearch, context), - }), + ...(input.FaceSearch !== undefined && + input.FaceSearch !== null && { FaceSearch: serializeAws_json1_1FaceSearchSettings(input.FaceSearch, context) }), }; }; const serializeAws_json1_1TestingData = (input: TestingData, context: __SerdeContext): any => { return { - ...(input.Assets !== undefined && { Assets: serializeAws_json1_1Assets(input.Assets, context) }), - ...(input.AutoCreate !== undefined && { AutoCreate: input.AutoCreate }), + ...(input.Assets !== undefined && + input.Assets !== null && { Assets: serializeAws_json1_1Assets(input.Assets, context) }), + ...(input.AutoCreate !== undefined && input.AutoCreate !== null && { AutoCreate: input.AutoCreate }), }; }; const serializeAws_json1_1TrainingData = (input: TrainingData, context: __SerdeContext): any => { return { - ...(input.Assets !== undefined && { Assets: serializeAws_json1_1Assets(input.Assets, context) }), + ...(input.Assets !== undefined && + input.Assets !== null && { Assets: serializeAws_json1_1Assets(input.Assets, context) }), }; }; const serializeAws_json1_1VersionNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Video = (input: Video, context: __SerdeContext): any => { return { - ...(input.S3Object !== undefined && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), + ...(input.S3Object !== undefined && + input.S3Object !== null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), }; }; @@ -7171,7 +7242,14 @@ const deserializeAws_json1_1Asset = (output: any, context: __SerdeContext): Asse }; const deserializeAws_json1_1Assets = (output: any, context: __SerdeContext): Asset[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Asset(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Asset(entry, context); + }); }; const deserializeAws_json1_1AudioMetadata = (output: any, context: __SerdeContext): AudioMetadata => { @@ -7186,7 +7264,14 @@ const deserializeAws_json1_1AudioMetadata = (output: any, context: __SerdeContex }; const deserializeAws_json1_1AudioMetadataList = (output: any, context: __SerdeContext): AudioMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AudioMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AudioMetadata(entry, context); + }); }; const deserializeAws_json1_1Beard = (output: any, context: __SerdeContext): Beard => { @@ -7197,7 +7282,14 @@ const deserializeAws_json1_1Beard = (output: any, context: __SerdeContext): Bear }; const deserializeAws_json1_1BodyParts = (output: any, context: __SerdeContext): ProtectiveEquipmentBodyPart[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProtectiveEquipmentBodyPart(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProtectiveEquipmentBodyPart(entry, context); + }); }; const deserializeAws_json1_1BoundingBox = (output: any, context: __SerdeContext): BoundingBox => { @@ -7243,7 +7335,14 @@ const deserializeAws_json1_1CelebrityDetail = (output: any, context: __SerdeCont }; const deserializeAws_json1_1CelebrityList = (output: any, context: __SerdeContext): Celebrity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Celebrity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Celebrity(entry, context); + }); }; const deserializeAws_json1_1CelebrityRecognition = (output: any, context: __SerdeContext): CelebrityRecognition => { @@ -7257,11 +7356,25 @@ const deserializeAws_json1_1CelebrityRecognition = (output: any, context: __Serd }; const deserializeAws_json1_1CelebrityRecognitions = (output: any, context: __SerdeContext): CelebrityRecognition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CelebrityRecognition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CelebrityRecognition(entry, context); + }); }; const deserializeAws_json1_1CollectionIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ComparedFace = (output: any, context: __SerdeContext): ComparedFace => { @@ -7285,7 +7398,14 @@ const deserializeAws_json1_1ComparedFace = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ComparedFaceList = (output: any, context: __SerdeContext): ComparedFace[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ComparedFace(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ComparedFace(entry, context); + }); }; const deserializeAws_json1_1ComparedSourceImageFace = ( @@ -7312,7 +7432,14 @@ const deserializeAws_json1_1CompareFacesMatch = (output: any, context: __SerdeCo }; const deserializeAws_json1_1CompareFacesMatchList = (output: any, context: __SerdeContext): CompareFacesMatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CompareFacesMatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CompareFacesMatch(entry, context); + }); }; const deserializeAws_json1_1CompareFacesResponse = (output: any, context: __SerdeContext): CompareFacesResponse => { @@ -7341,7 +7468,14 @@ const deserializeAws_json1_1CompareFacesResponse = (output: any, context: __Serd }; const deserializeAws_json1_1CompareFacesUnmatchList = (output: any, context: __SerdeContext): ComparedFace[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ComparedFace(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ComparedFace(entry, context); + }); }; const deserializeAws_json1_1ContentModerationDetection = ( @@ -7361,7 +7495,14 @@ const deserializeAws_json1_1ContentModerationDetections = ( output: any, context: __SerdeContext ): ContentModerationDetection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContentModerationDetection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContentModerationDetection(entry, context); + }); }; const deserializeAws_json1_1CoversBodyPart = (output: any, context: __SerdeContext): CoversBodyPart => { @@ -7426,7 +7567,14 @@ const deserializeAws_json1_1CustomLabel = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1CustomLabels = (output: any, context: __SerdeContext): CustomLabel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CustomLabel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CustomLabel(entry, context); + }); }; const deserializeAws_json1_1DeleteCollectionResponse = ( @@ -7650,7 +7798,14 @@ const deserializeAws_json1_1Emotion = (output: any, context: __SerdeContext): Em }; const deserializeAws_json1_1Emotions = (output: any, context: __SerdeContext): Emotion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Emotion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Emotion(entry, context); + }); }; const deserializeAws_json1_1EquipmentDetection = (output: any, context: __SerdeContext): EquipmentDetection => { @@ -7669,7 +7824,14 @@ const deserializeAws_json1_1EquipmentDetection = (output: any, context: __SerdeC }; const deserializeAws_json1_1EquipmentDetections = (output: any, context: __SerdeContext): EquipmentDetection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EquipmentDetection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EquipmentDetection(entry, context); + }); }; const deserializeAws_json1_1EvaluationResult = (output: any, context: __SerdeContext): EvaluationResult => { @@ -7771,7 +7933,14 @@ const deserializeAws_json1_1FaceDetail = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1FaceDetailList = (output: any, context: __SerdeContext): FaceDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FaceDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FaceDetail(entry, context); + }); }; const deserializeAws_json1_1FaceDetection = (output: any, context: __SerdeContext): FaceDetection => { @@ -7785,15 +7954,36 @@ const deserializeAws_json1_1FaceDetection = (output: any, context: __SerdeContex }; const deserializeAws_json1_1FaceDetections = (output: any, context: __SerdeContext): FaceDetection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FaceDetection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FaceDetection(entry, context); + }); }; const deserializeAws_json1_1FaceIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FaceList = (output: any, context: __SerdeContext): Face[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Face(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Face(entry, context); + }); }; const deserializeAws_json1_1FaceMatch = (output: any, context: __SerdeContext): FaceMatch => { @@ -7805,11 +7995,25 @@ const deserializeAws_json1_1FaceMatch = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1FaceMatchList = (output: any, context: __SerdeContext): FaceMatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FaceMatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FaceMatch(entry, context); + }); }; const deserializeAws_json1_1FaceModelVersionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FaceRecord = (output: any, context: __SerdeContext): FaceRecord => { @@ -7824,7 +8028,14 @@ const deserializeAws_json1_1FaceRecord = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1FaceRecordList = (output: any, context: __SerdeContext): FaceRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FaceRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FaceRecord(entry, context); + }); }; const deserializeAws_json1_1FaceSearchSettings = (output: any, context: __SerdeContext): FaceSearchSettings => { @@ -8071,7 +8282,14 @@ const deserializeAws_json1_1HumanLoopActivationOutput = ( }; const deserializeAws_json1_1HumanLoopActivationReasons = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1HumanLoopQuotaExceededException = ( @@ -8144,7 +8362,14 @@ const deserializeAws_json1_1Instance = (output: any, context: __SerdeContext): I }; const deserializeAws_json1_1Instances = (output: any, context: __SerdeContext): Instance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Instance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Instance(entry, context); + }); }; const deserializeAws_json1_1InternalServerError = (output: any, context: __SerdeContext): InternalServerError => { @@ -8237,11 +8462,25 @@ const deserializeAws_json1_1LabelDetection = (output: any, context: __SerdeConte }; const deserializeAws_json1_1LabelDetections = (output: any, context: __SerdeContext): LabelDetection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LabelDetection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LabelDetection(entry, context); + }); }; const deserializeAws_json1_1Labels = (output: any, context: __SerdeContext): Label[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Label(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Label(entry, context); + }); }; const deserializeAws_json1_1Landmark = (output: any, context: __SerdeContext): Landmark => { @@ -8253,7 +8492,14 @@ const deserializeAws_json1_1Landmark = (output: any, context: __SerdeContext): L }; const deserializeAws_json1_1Landmarks = (output: any, context: __SerdeContext): Landmark[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Landmark(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Landmark(entry, context); + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -8315,7 +8561,14 @@ const deserializeAws_json1_1ModerationLabel = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ModerationLabels = (output: any, context: __SerdeContext): ModerationLabel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModerationLabel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModerationLabel(entry, context); + }); }; const deserializeAws_json1_1MouthOpen = (output: any, context: __SerdeContext): MouthOpen => { @@ -8346,7 +8599,14 @@ const deserializeAws_json1_1Parent = (output: any, context: __SerdeContext): Par }; const deserializeAws_json1_1Parents = (output: any, context: __SerdeContext): Parent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Parent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Parent(entry, context); + }); }; const deserializeAws_json1_1PersonDetail = (output: any, context: __SerdeContext): PersonDetail => { @@ -8374,7 +8634,14 @@ const deserializeAws_json1_1PersonDetection = (output: any, context: __SerdeCont }; const deserializeAws_json1_1PersonDetections = (output: any, context: __SerdeContext): PersonDetection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PersonDetection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PersonDetection(entry, context); + }); }; const deserializeAws_json1_1PersonMatch = (output: any, context: __SerdeContext): PersonMatch => { @@ -8392,7 +8659,14 @@ const deserializeAws_json1_1PersonMatch = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1PersonMatches = (output: any, context: __SerdeContext): PersonMatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PersonMatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PersonMatch(entry, context); + }); }; const deserializeAws_json1_1Point = (output: any, context: __SerdeContext): Point => { @@ -8403,7 +8677,14 @@ const deserializeAws_json1_1Point = (output: any, context: __SerdeContext): Poin }; const deserializeAws_json1_1Polygon = (output: any, context: __SerdeContext): Point[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Point(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Point(entry, context); + }); }; const deserializeAws_json1_1Pose = (output: any, context: __SerdeContext): Pose => { @@ -8426,7 +8707,14 @@ const deserializeAws_json1_1ProjectDescription = (output: any, context: __SerdeC }; const deserializeAws_json1_1ProjectDescriptions = (output: any, context: __SerdeContext): ProjectDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProjectDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProjectDescription(entry, context); + }); }; const deserializeAws_json1_1ProjectVersionDescription = ( @@ -8484,7 +8772,14 @@ const deserializeAws_json1_1ProjectVersionDescriptions = ( output: any, context: __SerdeContext ): ProjectVersionDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProjectVersionDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProjectVersionDescription(entry, context); + }); }; const deserializeAws_json1_1ProtectiveEquipmentBodyPart = ( @@ -8520,14 +8815,28 @@ const deserializeAws_json1_1ProtectiveEquipmentPerson = ( }; const deserializeAws_json1_1ProtectiveEquipmentPersonIds = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ProtectiveEquipmentPersons = ( output: any, context: __SerdeContext ): ProtectiveEquipmentPerson[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProtectiveEquipmentPerson(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProtectiveEquipmentPerson(entry, context); + }); }; const deserializeAws_json1_1ProtectiveEquipmentSummary = ( @@ -8562,7 +8871,14 @@ const deserializeAws_json1_1ProvisionedThroughputExceededException = ( }; const deserializeAws_json1_1Reasons = (output: any, context: __SerdeContext): (Reason | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RecognizeCelebritiesResponse = ( @@ -8702,7 +9018,14 @@ const deserializeAws_json1_1SegmentDetection = (output: any, context: __SerdeCon }; const deserializeAws_json1_1SegmentDetections = (output: any, context: __SerdeContext): SegmentDetection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SegmentDetection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SegmentDetection(entry, context); + }); }; const deserializeAws_json1_1SegmentTypeInfo = (output: any, context: __SerdeContext): SegmentTypeInfo => { @@ -8713,7 +9036,14 @@ const deserializeAws_json1_1SegmentTypeInfo = (output: any, context: __SerdeCont }; const deserializeAws_json1_1SegmentTypesInfo = (output: any, context: __SerdeContext): SegmentTypeInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SegmentTypeInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SegmentTypeInfo(entry, context); + }); }; const deserializeAws_json1_1ServiceQuotaExceededException = ( @@ -8862,7 +9192,14 @@ const deserializeAws_json1_1StreamProcessorInput = (output: any, context: __Serd }; const deserializeAws_json1_1StreamProcessorList = (output: any, context: __SerdeContext): StreamProcessor[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StreamProcessor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StreamProcessor(entry, context); + }); }; const deserializeAws_json1_1StreamProcessorOutput = (output: any, context: __SerdeContext): StreamProcessorOutput => { @@ -8951,7 +9288,14 @@ const deserializeAws_json1_1TextDetection = (output: any, context: __SerdeContex }; const deserializeAws_json1_1TextDetectionList = (output: any, context: __SerdeContext): TextDetection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TextDetection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TextDetection(entry, context); + }); }; const deserializeAws_json1_1TextDetectionResult = (output: any, context: __SerdeContext): TextDetectionResult => { @@ -8965,7 +9309,14 @@ const deserializeAws_json1_1TextDetectionResult = (output: any, context: __Serde }; const deserializeAws_json1_1TextDetectionResults = (output: any, context: __SerdeContext): TextDetectionResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TextDetectionResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TextDetectionResult(entry, context); + }); }; const deserializeAws_json1_1ThrottlingException = (output: any, context: __SerdeContext): ThrottlingException => { @@ -9016,11 +9367,25 @@ const deserializeAws_json1_1UnindexedFace = (output: any, context: __SerdeContex }; const deserializeAws_json1_1UnindexedFaces = (output: any, context: __SerdeContext): UnindexedFace[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UnindexedFace(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UnindexedFace(entry, context); + }); }; const deserializeAws_json1_1Urls = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ValidationData = (output: any, context: __SerdeContext): ValidationData => { @@ -9045,7 +9410,14 @@ const deserializeAws_json1_1VideoMetadata = (output: any, context: __SerdeContex }; const deserializeAws_json1_1VideoMetadataList = (output: any, context: __SerdeContext): VideoMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VideoMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VideoMetadata(entry, context); + }); }; const deserializeAws_json1_1VideoTooLargeException = (output: any, context: __SerdeContext): VideoTooLargeException => { @@ -9106,3 +9478,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-resource-groups-tagging-api/protocols/Aws_json1_1.ts b/clients/client-resource-groups-tagging-api/protocols/Aws_json1_1.ts index cbabf9e4ea89..4ba5bcc92a6b 100644 --- a/clients/client-resource-groups-tagging-api/protocols/Aws_json1_1.ts +++ b/clients/client-resource-groups-tagging-api/protocols/Aws_json1_1.ts @@ -61,7 +61,7 @@ export const serializeAws_json1_1DescribeReportCreationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ResourceGroupsTaggingAPI_20170126.DescribeReportCreation", }; let body: any; @@ -74,7 +74,7 @@ export const serializeAws_json1_1GetComplianceSummaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ResourceGroupsTaggingAPI_20170126.GetComplianceSummary", }; let body: any; @@ -87,7 +87,7 @@ export const serializeAws_json1_1GetResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ResourceGroupsTaggingAPI_20170126.GetResources", }; let body: any; @@ -100,7 +100,7 @@ export const serializeAws_json1_1GetTagKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ResourceGroupsTaggingAPI_20170126.GetTagKeys", }; let body: any; @@ -113,7 +113,7 @@ export const serializeAws_json1_1GetTagValuesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ResourceGroupsTaggingAPI_20170126.GetTagValues", }; let body: any; @@ -126,7 +126,7 @@ export const serializeAws_json1_1StartReportCreationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ResourceGroupsTaggingAPI_20170126.StartReportCreation", }; let body: any; @@ -139,7 +139,7 @@ export const serializeAws_json1_1TagResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ResourceGroupsTaggingAPI_20170126.TagResources", }; let body: any; @@ -152,7 +152,7 @@ export const serializeAws_json1_1UntagResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ResourceGroupsTaggingAPI_20170126.UntagResources", }; let body: any; @@ -187,8 +187,7 @@ const deserializeAws_json1_1DescribeReportCreationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConstraintViolationException": case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException": @@ -266,8 +265,7 @@ const deserializeAws_json1_1GetComplianceSummaryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConstraintViolationException": case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException": @@ -345,8 +343,7 @@ const deserializeAws_json1_1GetResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": @@ -424,8 +421,7 @@ const deserializeAws_json1_1GetTagKeysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": @@ -503,8 +499,7 @@ const deserializeAws_json1_1GetTagValuesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": @@ -582,8 +577,7 @@ const deserializeAws_json1_1StartReportCreationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.resourcegroupstaggingapi#ConcurrentModificationException": @@ -669,8 +663,7 @@ const deserializeAws_json1_1TagResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": @@ -740,8 +733,7 @@ const deserializeAws_json1_1UntagResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceException": case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": @@ -886,69 +878,109 @@ const serializeAws_json1_1GetComplianceSummaryInput = ( context: __SerdeContext ): any => { return { - ...(input.GroupBy !== undefined && { GroupBy: serializeAws_json1_1GroupBy(input.GroupBy, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.PaginationToken !== undefined && { PaginationToken: input.PaginationToken }), - ...(input.RegionFilters !== undefined && { - RegionFilters: serializeAws_json1_1RegionFilterList(input.RegionFilters, context), - }), - ...(input.ResourceTypeFilters !== undefined && { - ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context), - }), - ...(input.TagKeyFilters !== undefined && { - TagKeyFilters: serializeAws_json1_1TagKeyFilterList(input.TagKeyFilters, context), - }), - ...(input.TargetIdFilters !== undefined && { - TargetIdFilters: serializeAws_json1_1TargetIdFilterList(input.TargetIdFilters, context), - }), + ...(input.GroupBy !== undefined && + input.GroupBy !== null && { GroupBy: serializeAws_json1_1GroupBy(input.GroupBy, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.PaginationToken !== undefined && + input.PaginationToken !== null && { PaginationToken: input.PaginationToken }), + ...(input.RegionFilters !== undefined && + input.RegionFilters !== null && { + RegionFilters: serializeAws_json1_1RegionFilterList(input.RegionFilters, context), + }), + ...(input.ResourceTypeFilters !== undefined && + input.ResourceTypeFilters !== null && { + ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context), + }), + ...(input.TagKeyFilters !== undefined && + input.TagKeyFilters !== null && { + TagKeyFilters: serializeAws_json1_1TagKeyFilterList(input.TagKeyFilters, context), + }), + ...(input.TargetIdFilters !== undefined && + input.TargetIdFilters !== null && { + TargetIdFilters: serializeAws_json1_1TargetIdFilterList(input.TargetIdFilters, context), + }), }; }; const serializeAws_json1_1GetResourcesInput = (input: GetResourcesInput, context: __SerdeContext): any => { return { - ...(input.ExcludeCompliantResources !== undefined && { - ExcludeCompliantResources: input.ExcludeCompliantResources, - }), - ...(input.IncludeComplianceDetails !== undefined && { IncludeComplianceDetails: input.IncludeComplianceDetails }), - ...(input.PaginationToken !== undefined && { PaginationToken: input.PaginationToken }), - ...(input.ResourceTypeFilters !== undefined && { - ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context), - }), - ...(input.ResourcesPerPage !== undefined && { ResourcesPerPage: input.ResourcesPerPage }), - ...(input.TagFilters !== undefined && { TagFilters: serializeAws_json1_1TagFilterList(input.TagFilters, context) }), - ...(input.TagsPerPage !== undefined && { TagsPerPage: input.TagsPerPage }), + ...(input.ExcludeCompliantResources !== undefined && + input.ExcludeCompliantResources !== null && { ExcludeCompliantResources: input.ExcludeCompliantResources }), + ...(input.IncludeComplianceDetails !== undefined && + input.IncludeComplianceDetails !== null && { IncludeComplianceDetails: input.IncludeComplianceDetails }), + ...(input.PaginationToken !== undefined && + input.PaginationToken !== null && { PaginationToken: input.PaginationToken }), + ...(input.ResourceTypeFilters !== undefined && + input.ResourceTypeFilters !== null && { + ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context), + }), + ...(input.ResourcesPerPage !== undefined && + input.ResourcesPerPage !== null && { ResourcesPerPage: input.ResourcesPerPage }), + ...(input.TagFilters !== undefined && + input.TagFilters !== null && { TagFilters: serializeAws_json1_1TagFilterList(input.TagFilters, context) }), + ...(input.TagsPerPage !== undefined && input.TagsPerPage !== null && { TagsPerPage: input.TagsPerPage }), }; }; const serializeAws_json1_1GetTagKeysInput = (input: GetTagKeysInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.PaginationToken !== undefined && { PaginationToken: input.PaginationToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.PaginationToken !== undefined && + input.PaginationToken !== null && { PaginationToken: input.PaginationToken }), }; }; const serializeAws_json1_1GetTagValuesInput = (input: GetTagValuesInput, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.PaginationToken !== undefined && { PaginationToken: input.PaginationToken }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.PaginationToken !== undefined && + input.PaginationToken !== null && { PaginationToken: input.PaginationToken }), }; }; const serializeAws_json1_1GroupBy = (input: (GroupByAttribute | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RegionFilterList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ResourceARNList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ResourceTypeFilterList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartReportCreationInput = ( @@ -956,62 +988,103 @@ const serializeAws_json1_1StartReportCreationInput = ( context: __SerdeContext ): any => { return { - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), }; }; const serializeAws_json1_1TagFilter = (input: TagFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1TagValueList(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1TagValueList(input.Values, context) }), }; }; const serializeAws_json1_1TagFilterList = (input: TagFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TagFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TagFilter(entry, context); + }); }; const serializeAws_json1_1TagKeyFilterList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagKeyListForUntag = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1TagResourcesInput = (input: TagResourcesInput, context: __SerdeContext): any => { return { - ...(input.ResourceARNList !== undefined && { - ResourceARNList: serializeAws_json1_1ResourceARNList(input.ResourceARNList, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagMap(input.Tags, context) }), + ...(input.ResourceARNList !== undefined && + input.ResourceARNList !== null && { + ResourceARNList: serializeAws_json1_1ResourceARNList(input.ResourceARNList, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagMap(input.Tags, context) }), }; }; const serializeAws_json1_1TagValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TargetIdFilterList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UntagResourcesInput = (input: UntagResourcesInput, context: __SerdeContext): any => { return { - ...(input.ResourceARNList !== undefined && { - ResourceARNList: serializeAws_json1_1ResourceARNList(input.ResourceARNList, context), - }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyListForUntag(input.TagKeys, context) }), + ...(input.ResourceARNList !== undefined && + input.ResourceARNList !== null && { + ResourceARNList: serializeAws_json1_1ResourceARNList(input.ResourceARNList, context), + }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyListForUntag(input.TagKeys, context) }), }; }; @@ -1064,13 +1137,15 @@ const deserializeAws_json1_1FailedResourcesMap = ( output: any, context: __SerdeContext ): { [key: string]: FailureInfo } => { - return Object.entries(output).reduce( - (acc: { [key: string]: FailureInfo }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: FailureInfo }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1FailureInfo(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1FailureInfo = (output: any, context: __SerdeContext): FailureInfo => { @@ -1170,7 +1245,14 @@ const deserializeAws_json1_1ResourceTagMapping = (output: any, context: __SerdeC }; const deserializeAws_json1_1ResourceTagMappingList = (output: any, context: __SerdeContext): ResourceTagMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceTagMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceTagMapping(entry, context); + }); }; const deserializeAws_json1_1StartReportCreationOutput = ( @@ -1195,7 +1277,14 @@ const deserializeAws_json1_1Summary = (output: any, context: __SerdeContext): Su }; const deserializeAws_json1_1SummaryList = (output: any, context: __SerdeContext): Summary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Summary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Summary(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -1206,11 +1295,25 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagKeyList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourcesOutput = (output: any, context: __SerdeContext): TagResourcesOutput => { @@ -1223,7 +1326,14 @@ const deserializeAws_json1_1TagResourcesOutput = (output: any, context: __SerdeC }; const deserializeAws_json1_1TagValuesOutputList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ThrottledException = (output: any, context: __SerdeContext): ThrottledException => { @@ -1291,3 +1401,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-resource-groups/protocols/Aws_restJson1.ts b/clients/client-resource-groups/protocols/Aws_restJson1.ts index 3936b9fd44ff..400c0ad2ef46 100644 --- a/clients/client-resource-groups/protocols/Aws_restJson1.ts +++ b/clients/client-resource-groups/protocols/Aws_restJson1.ts @@ -54,20 +54,22 @@ export const serializeAws_restJson1CreateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/groups"; let body: any; body = JSON.stringify({ - ...(input.Configuration !== undefined && { - Configuration: serializeAws_restJson1GroupConfigurationList(input.Configuration, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ResourceQuery !== undefined && { - ResourceQuery: serializeAws_restJson1ResourceQuery(input.ResourceQuery, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Configuration !== undefined && + input.Configuration !== null && { + Configuration: serializeAws_restJson1GroupConfigurationList(input.Configuration, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ResourceQuery !== undefined && + input.ResourceQuery !== null && { + ResourceQuery: serializeAws_restJson1ResourceQuery(input.ResourceQuery, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -86,13 +88,13 @@ export const serializeAws_restJson1DeleteGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/delete-group"; let body: any; body = JSON.stringify({ - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -111,13 +113,13 @@ export const serializeAws_restJson1GetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/get-group"; let body: any; body = JSON.stringify({ - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -136,12 +138,12 @@ export const serializeAws_restJson1GetGroupConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/get-group-configuration"; let body: any; body = JSON.stringify({ - ...(input.Group !== undefined && { Group: input.Group }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -160,13 +162,13 @@ export const serializeAws_restJson1GetGroupQueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/get-group-query"; let body: any; body = JSON.stringify({ - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -184,9 +186,7 @@ export const serializeAws_restJson1GetTagsCommand = async ( input: GetTagsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/resources/{Arn}/tags"; if (input.Arn !== undefined) { const labelValue: string = input.Arn; @@ -215,15 +215,16 @@ export const serializeAws_restJson1GroupResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/group-resources"; let body: any; body = JSON.stringify({ - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.ResourceArns !== undefined && { - ResourceArns: serializeAws_restJson1ResourceArnList(input.ResourceArns, context), - }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.ResourceArns !== undefined && + input.ResourceArns !== null && { + ResourceArns: serializeAws_restJson1ResourceArnList(input.ResourceArns, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -242,16 +243,17 @@ export const serializeAws_restJson1ListGroupResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/list-group-resources"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { Filters: serializeAws_restJson1ResourceFilterList(input.Filters, context) }), - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1ResourceFilterList(input.Filters, context) }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -270,7 +272,7 @@ export const serializeAws_restJson1ListGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/groups-list"; const query: any = { @@ -279,7 +281,8 @@ export const serializeAws_restJson1ListGroupsCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { Filters: serializeAws_restJson1GroupFilterList(input.Filters, context) }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1GroupFilterList(input.Filters, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -299,16 +302,17 @@ export const serializeAws_restJson1SearchResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/resources/search"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceQuery !== undefined && { - ResourceQuery: serializeAws_restJson1ResourceQuery(input.ResourceQuery, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceQuery !== undefined && + input.ResourceQuery !== null && { + ResourceQuery: serializeAws_restJson1ResourceQuery(input.ResourceQuery, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -327,7 +331,7 @@ export const serializeAws_restJson1TagCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/resources/{Arn}/tags"; if (input.Arn !== undefined) { @@ -341,7 +345,7 @@ export const serializeAws_restJson1TagCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -360,15 +364,16 @@ export const serializeAws_restJson1UngroupResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ungroup-resources"; let body: any; body = JSON.stringify({ - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.ResourceArns !== undefined && { - ResourceArns: serializeAws_restJson1ResourceArnList(input.ResourceArns, context), - }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.ResourceArns !== undefined && + input.ResourceArns !== null && { + ResourceArns: serializeAws_restJson1ResourceArnList(input.ResourceArns, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -387,7 +392,7 @@ export const serializeAws_restJson1UntagCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/resources/{Arn}/tags"; if (input.Arn !== undefined) { @@ -401,7 +406,8 @@ export const serializeAws_restJson1UntagCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Keys !== undefined && { Keys: serializeAws_restJson1TagKeyList(input.Keys, context) }), + ...(input.Keys !== undefined && + input.Keys !== null && { Keys: serializeAws_restJson1TagKeyList(input.Keys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -420,14 +426,14 @@ export const serializeAws_restJson1UpdateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/update-group"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -446,16 +452,17 @@ export const serializeAws_restJson1UpdateGroupQueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/update-group-query"; let body: any; body = JSON.stringify({ - ...(input.Group !== undefined && { Group: input.Group }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.ResourceQuery !== undefined && { - ResourceQuery: serializeAws_restJson1ResourceQuery(input.ResourceQuery, context), - }), + ...(input.Group !== undefined && input.Group !== null && { Group: input.Group }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.ResourceQuery !== undefined && + input.ResourceQuery !== null && { + ResourceQuery: serializeAws_restJson1ResourceQuery(input.ResourceQuery, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2063,10 +2070,9 @@ const deserializeAws_restJson1UnauthorizedExceptionResponse = async ( const serializeAws_restJson1GroupConfigurationItem = (input: GroupConfigurationItem, context: __SerdeContext): any => { return { - ...(input.Parameters !== undefined && { - Parameters: serializeAws_restJson1GroupParameterList(input.Parameters, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_restJson1GroupParameterList(input.Parameters, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -2074,7 +2080,14 @@ const serializeAws_restJson1GroupConfigurationList = ( input: GroupConfigurationItem[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1GroupConfigurationItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1GroupConfigurationItem(entry, context); + }); }; const serializeAws_restJson1GroupConfigurationParameter = ( @@ -2082,77 +2095,138 @@ const serializeAws_restJson1GroupConfigurationParameter = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { - Values: serializeAws_restJson1GroupConfigurationParameterValueList(input.Values, context), - }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { + Values: serializeAws_restJson1GroupConfigurationParameterValueList(input.Values, context), + }), }; }; const serializeAws_restJson1GroupConfigurationParameterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1GroupFilter = (input: GroupFilter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1GroupFilterValues(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1GroupFilterValues(input.Values, context) }), }; }; const serializeAws_restJson1GroupFilterList = (input: GroupFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1GroupFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1GroupFilter(entry, context); + }); }; const serializeAws_restJson1GroupFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1GroupParameterList = ( input: GroupConfigurationParameter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1GroupConfigurationParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1GroupConfigurationParameter(entry, context); + }); }; const serializeAws_restJson1ResourceArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResourceFilter = (input: ResourceFilter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_restJson1ResourceFilterValues(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_restJson1ResourceFilterValues(input.Values, context) }), }; }; const serializeAws_restJson1ResourceFilterList = (input: ResourceFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ResourceFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ResourceFilter(entry, context); + }); }; const serializeAws_restJson1ResourceFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ResourceQuery = (input: ResourceQuery, context: __SerdeContext): any => { return { - ...(input.Query !== undefined && { Query: input.Query }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Query !== undefined && input.Query !== null && { Query: input.Query }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1FailedResource = (output: any, context: __SerdeContext): FailedResource => { @@ -2164,7 +2238,14 @@ const deserializeAws_restJson1FailedResource = (output: any, context: __SerdeCon }; const deserializeAws_restJson1FailedResourceList = (output: any, context: __SerdeContext): FailedResource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FailedResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FailedResource(entry, context); + }); }; const deserializeAws_restJson1Group = (output: any, context: __SerdeContext): Group => { @@ -2208,7 +2289,14 @@ const deserializeAws_restJson1GroupConfigurationList = ( output: any, context: __SerdeContext ): GroupConfigurationItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupConfigurationItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupConfigurationItem(entry, context); + }); }; const deserializeAws_restJson1GroupConfigurationParameter = ( @@ -2228,7 +2316,14 @@ const deserializeAws_restJson1GroupConfigurationParameterValueList = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1GroupIdentifier = (output: any, context: __SerdeContext): GroupIdentifier => { @@ -2239,18 +2334,39 @@ const deserializeAws_restJson1GroupIdentifier = (output: any, context: __SerdeCo }; const deserializeAws_restJson1GroupIdentifierList = (output: any, context: __SerdeContext): GroupIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupIdentifier(entry, context); + }); }; const deserializeAws_restJson1GroupList = (output: any, context: __SerdeContext): Group[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Group(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Group(entry, context); + }); }; const deserializeAws_restJson1GroupParameterList = ( output: any, context: __SerdeContext ): GroupConfigurationParameter[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupConfigurationParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupConfigurationParameter(entry, context); + }); }; const deserializeAws_restJson1GroupQuery = (output: any, context: __SerdeContext): GroupQuery => { @@ -2271,11 +2387,25 @@ const deserializeAws_restJson1QueryError = (output: any, context: __SerdeContext }; const deserializeAws_restJson1QueryErrorList = (output: any, context: __SerdeContext): QueryError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1QueryError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1QueryError(entry, context); + }); }; const deserializeAws_restJson1ResourceArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ResourceIdentifier = (output: any, context: __SerdeContext): ResourceIdentifier => { @@ -2286,7 +2416,14 @@ const deserializeAws_restJson1ResourceIdentifier = (output: any, context: __Serd }; const deserializeAws_restJson1ResourceIdentifierList = (output: any, context: __SerdeContext): ResourceIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceIdentifier(entry, context); + }); }; const deserializeAws_restJson1ResourceQuery = (output: any, context: __SerdeContext): ResourceQuery => { @@ -2297,17 +2434,26 @@ const deserializeAws_restJson1ResourceQuery = (output: any, context: __SerdeCont }; const deserializeAws_restJson1TagKeyList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2330,6 +2476,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-robomaker/protocols/Aws_restJson1.ts b/clients/client-robomaker/protocols/Aws_restJson1.ts index 89648bc4dda4..6ba002dbc956 100644 --- a/clients/client-robomaker/protocols/Aws_restJson1.ts +++ b/clients/client-robomaker/protocols/Aws_restJson1.ts @@ -246,12 +246,13 @@ export const serializeAws_restJson1BatchDeleteWorldsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/batchDeleteWorlds"; let body: any; body = JSON.stringify({ - ...(input.worlds !== undefined && { worlds: serializeAws_restJson1Arns(input.worlds, context) }), + ...(input.worlds !== undefined && + input.worlds !== null && { worlds: serializeAws_restJson1Arns(input.worlds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -270,12 +271,12 @@ export const serializeAws_restJson1BatchDescribeSimulationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/batchDescribeSimulationJob"; let body: any; body = JSON.stringify({ - ...(input.jobs !== undefined && { jobs: serializeAws_restJson1Arns(input.jobs, context) }), + ...(input.jobs !== undefined && input.jobs !== null && { jobs: serializeAws_restJson1Arns(input.jobs, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -294,12 +295,12 @@ export const serializeAws_restJson1CancelDeploymentJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/cancelDeploymentJob"; let body: any; body = JSON.stringify({ - ...(input.job !== undefined && { job: input.job }), + ...(input.job !== undefined && input.job !== null && { job: input.job }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -318,12 +319,12 @@ export const serializeAws_restJson1CancelSimulationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/cancelSimulationJob"; let body: any; body = JSON.stringify({ - ...(input.job !== undefined && { job: input.job }), + ...(input.job !== undefined && input.job !== null && { job: input.job }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -342,12 +343,12 @@ export const serializeAws_restJson1CancelSimulationJobBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/cancelSimulationJobBatch"; let body: any; body = JSON.stringify({ - ...(input.batch !== undefined && { batch: input.batch }), + ...(input.batch !== undefined && input.batch !== null && { batch: input.batch }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -366,12 +367,12 @@ export const serializeAws_restJson1CancelWorldExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/cancelWorldExportJob"; let body: any; body = JSON.stringify({ - ...(input.job !== undefined && { job: input.job }), + ...(input.job !== undefined && input.job !== null && { job: input.job }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -390,12 +391,12 @@ export const serializeAws_restJson1CancelWorldGenerationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/cancelWorldGenerationJob"; let body: any; body = JSON.stringify({ - ...(input.job !== undefined && { job: input.job }), + ...(input.job !== undefined && input.job !== null && { job: input.job }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -414,23 +415,25 @@ export const serializeAws_restJson1CreateDeploymentJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createDeploymentJob"; let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.deploymentApplicationConfigs !== undefined && { - deploymentApplicationConfigs: serializeAws_restJson1DeploymentApplicationConfigs( - input.deploymentApplicationConfigs, - context - ), - }), - ...(input.deploymentConfig !== undefined && { - deploymentConfig: serializeAws_restJson1DeploymentConfig(input.deploymentConfig, context), - }), - ...(input.fleet !== undefined && { fleet: input.fleet }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.deploymentApplicationConfigs !== undefined && + input.deploymentApplicationConfigs !== null && { + deploymentApplicationConfigs: serializeAws_restJson1DeploymentApplicationConfigs( + input.deploymentApplicationConfigs, + context + ), + }), + ...(input.deploymentConfig !== undefined && + input.deploymentConfig !== null && { + deploymentConfig: serializeAws_restJson1DeploymentConfig(input.deploymentConfig, context), + }), + ...(input.fleet !== undefined && input.fleet !== null && { fleet: input.fleet }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -449,13 +452,13 @@ export const serializeAws_restJson1CreateFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createFleet"; let body: any; body = JSON.stringify({ - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -474,15 +477,16 @@ export const serializeAws_restJson1CreateRobotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createRobot"; let body: any; body = JSON.stringify({ - ...(input.architecture !== undefined && { architecture: input.architecture }), - ...(input.greengrassGroupId !== undefined && { greengrassGroupId: input.greengrassGroupId }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.architecture !== undefined && input.architecture !== null && { architecture: input.architecture }), + ...(input.greengrassGroupId !== undefined && + input.greengrassGroupId !== null && { greengrassGroupId: input.greengrassGroupId }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -501,17 +505,19 @@ export const serializeAws_restJson1CreateRobotApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createRobotApplication"; let body: any; body = JSON.stringify({ - ...(input.name !== undefined && { name: input.name }), - ...(input.robotSoftwareSuite !== undefined && { - robotSoftwareSuite: serializeAws_restJson1RobotSoftwareSuite(input.robotSoftwareSuite, context), - }), - ...(input.sources !== undefined && { sources: serializeAws_restJson1SourceConfigs(input.sources, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.robotSoftwareSuite !== undefined && + input.robotSoftwareSuite !== null && { + robotSoftwareSuite: serializeAws_restJson1RobotSoftwareSuite(input.robotSoftwareSuite, context), + }), + ...(input.sources !== undefined && + input.sources !== null && { sources: serializeAws_restJson1SourceConfigs(input.sources, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -530,13 +536,14 @@ export const serializeAws_restJson1CreateRobotApplicationVersionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createRobotApplicationVersion"; let body: any; body = JSON.stringify({ - ...(input.application !== undefined && { application: input.application }), - ...(input.currentRevisionId !== undefined && { currentRevisionId: input.currentRevisionId }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.currentRevisionId !== undefined && + input.currentRevisionId !== null && { currentRevisionId: input.currentRevisionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -555,23 +562,27 @@ export const serializeAws_restJson1CreateSimulationApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createSimulationApplication"; let body: any; body = JSON.stringify({ - ...(input.name !== undefined && { name: input.name }), - ...(input.renderingEngine !== undefined && { - renderingEngine: serializeAws_restJson1RenderingEngine(input.renderingEngine, context), - }), - ...(input.robotSoftwareSuite !== undefined && { - robotSoftwareSuite: serializeAws_restJson1RobotSoftwareSuite(input.robotSoftwareSuite, context), - }), - ...(input.simulationSoftwareSuite !== undefined && { - simulationSoftwareSuite: serializeAws_restJson1SimulationSoftwareSuite(input.simulationSoftwareSuite, context), - }), - ...(input.sources !== undefined && { sources: serializeAws_restJson1SourceConfigs(input.sources, context) }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.renderingEngine !== undefined && + input.renderingEngine !== null && { + renderingEngine: serializeAws_restJson1RenderingEngine(input.renderingEngine, context), + }), + ...(input.robotSoftwareSuite !== undefined && + input.robotSoftwareSuite !== null && { + robotSoftwareSuite: serializeAws_restJson1RobotSoftwareSuite(input.robotSoftwareSuite, context), + }), + ...(input.simulationSoftwareSuite !== undefined && + input.simulationSoftwareSuite !== null && { + simulationSoftwareSuite: serializeAws_restJson1SimulationSoftwareSuite(input.simulationSoftwareSuite, context), + }), + ...(input.sources !== undefined && + input.sources !== null && { sources: serializeAws_restJson1SourceConfigs(input.sources, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -590,13 +601,14 @@ export const serializeAws_restJson1CreateSimulationApplicationVersionCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createSimulationApplicationVersion"; let body: any; body = JSON.stringify({ - ...(input.application !== undefined && { application: input.application }), - ...(input.currentRevisionId !== undefined && { currentRevisionId: input.currentRevisionId }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.currentRevisionId !== undefined && + input.currentRevisionId !== null && { currentRevisionId: input.currentRevisionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -615,33 +627,45 @@ export const serializeAws_restJson1CreateSimulationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createSimulationJob"; let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.compute !== undefined && { compute: serializeAws_restJson1Compute(input.compute, context) }), - ...(input.dataSources !== undefined && { - dataSources: serializeAws_restJson1DataSourceConfigs(input.dataSources, context), - }), - ...(input.failureBehavior !== undefined && { failureBehavior: input.failureBehavior }), - ...(input.iamRole !== undefined && { iamRole: input.iamRole }), - ...(input.loggingConfig !== undefined && { - loggingConfig: serializeAws_restJson1LoggingConfig(input.loggingConfig, context), - }), - ...(input.maxJobDurationInSeconds !== undefined && { maxJobDurationInSeconds: input.maxJobDurationInSeconds }), - ...(input.outputLocation !== undefined && { - outputLocation: serializeAws_restJson1OutputLocation(input.outputLocation, context), - }), - ...(input.robotApplications !== undefined && { - robotApplications: serializeAws_restJson1RobotApplicationConfigs(input.robotApplications, context), - }), - ...(input.simulationApplications !== undefined && { - simulationApplications: serializeAws_restJson1SimulationApplicationConfigs(input.simulationApplications, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.vpcConfig !== undefined && { vpcConfig: serializeAws_restJson1VPCConfig(input.vpcConfig, context) }), + ...(input.compute !== undefined && + input.compute !== null && { compute: serializeAws_restJson1Compute(input.compute, context) }), + ...(input.dataSources !== undefined && + input.dataSources !== null && { + dataSources: serializeAws_restJson1DataSourceConfigs(input.dataSources, context), + }), + ...(input.failureBehavior !== undefined && + input.failureBehavior !== null && { failureBehavior: input.failureBehavior }), + ...(input.iamRole !== undefined && input.iamRole !== null && { iamRole: input.iamRole }), + ...(input.loggingConfig !== undefined && + input.loggingConfig !== null && { + loggingConfig: serializeAws_restJson1LoggingConfig(input.loggingConfig, context), + }), + ...(input.maxJobDurationInSeconds !== undefined && + input.maxJobDurationInSeconds !== null && { maxJobDurationInSeconds: input.maxJobDurationInSeconds }), + ...(input.outputLocation !== undefined && + input.outputLocation !== null && { + outputLocation: serializeAws_restJson1OutputLocation(input.outputLocation, context), + }), + ...(input.robotApplications !== undefined && + input.robotApplications !== null && { + robotApplications: serializeAws_restJson1RobotApplicationConfigs(input.robotApplications, context), + }), + ...(input.simulationApplications !== undefined && + input.simulationApplications !== null && { + simulationApplications: serializeAws_restJson1SimulationApplicationConfigs( + input.simulationApplications, + context + ), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.vpcConfig !== undefined && + input.vpcConfig !== null && { vpcConfig: serializeAws_restJson1VPCConfig(input.vpcConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -660,18 +684,20 @@ export const serializeAws_restJson1CreateWorldExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createWorldExportJob"; let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.iamRole !== undefined && { iamRole: input.iamRole }), - ...(input.outputLocation !== undefined && { - outputLocation: serializeAws_restJson1OutputLocation(input.outputLocation, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.worlds !== undefined && { worlds: serializeAws_restJson1Arns(input.worlds, context) }), + ...(input.iamRole !== undefined && input.iamRole !== null && { iamRole: input.iamRole }), + ...(input.outputLocation !== undefined && + input.outputLocation !== null && { + outputLocation: serializeAws_restJson1OutputLocation(input.outputLocation, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.worlds !== undefined && + input.worlds !== null && { worlds: serializeAws_restJson1Arns(input.worlds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -690,16 +716,18 @@ export const serializeAws_restJson1CreateWorldGenerationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createWorldGenerationJob"; let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.template !== undefined && { template: input.template }), - ...(input.worldCount !== undefined && { worldCount: serializeAws_restJson1WorldCount(input.worldCount, context) }), - ...(input.worldTags !== undefined && { worldTags: serializeAws_restJson1TagMap(input.worldTags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.template !== undefined && input.template !== null && { template: input.template }), + ...(input.worldCount !== undefined && + input.worldCount !== null && { worldCount: serializeAws_restJson1WorldCount(input.worldCount, context) }), + ...(input.worldTags !== undefined && + input.worldTags !== null && { worldTags: serializeAws_restJson1TagMap(input.worldTags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -718,18 +746,20 @@ export const serializeAws_restJson1CreateWorldTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createWorldTemplate"; let body: any; body = JSON.stringify({ - ...(input.clientRequestToken !== undefined && { clientRequestToken: input.clientRequestToken }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.templateBody !== undefined && { templateBody: input.templateBody }), - ...(input.templateLocation !== undefined && { - templateLocation: serializeAws_restJson1TemplateLocation(input.templateLocation, context), - }), + ...(input.clientRequestToken !== undefined && + input.clientRequestToken !== null && { clientRequestToken: input.clientRequestToken }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.templateBody !== undefined && input.templateBody !== null && { templateBody: input.templateBody }), + ...(input.templateLocation !== undefined && + input.templateLocation !== null && { + templateLocation: serializeAws_restJson1TemplateLocation(input.templateLocation, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -748,12 +778,12 @@ export const serializeAws_restJson1DeleteFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteFleet"; let body: any; body = JSON.stringify({ - ...(input.fleet !== undefined && { fleet: input.fleet }), + ...(input.fleet !== undefined && input.fleet !== null && { fleet: input.fleet }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -772,12 +802,12 @@ export const serializeAws_restJson1DeleteRobotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteRobot"; let body: any; body = JSON.stringify({ - ...(input.robot !== undefined && { robot: input.robot }), + ...(input.robot !== undefined && input.robot !== null && { robot: input.robot }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -796,13 +826,14 @@ export const serializeAws_restJson1DeleteRobotApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteRobotApplication"; let body: any; body = JSON.stringify({ - ...(input.application !== undefined && { application: input.application }), - ...(input.applicationVersion !== undefined && { applicationVersion: input.applicationVersion }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.applicationVersion !== undefined && + input.applicationVersion !== null && { applicationVersion: input.applicationVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -821,13 +852,14 @@ export const serializeAws_restJson1DeleteSimulationApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteSimulationApplication"; let body: any; body = JSON.stringify({ - ...(input.application !== undefined && { application: input.application }), - ...(input.applicationVersion !== undefined && { applicationVersion: input.applicationVersion }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.applicationVersion !== undefined && + input.applicationVersion !== null && { applicationVersion: input.applicationVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -846,12 +878,12 @@ export const serializeAws_restJson1DeleteWorldTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteWorldTemplate"; let body: any; body = JSON.stringify({ - ...(input.template !== undefined && { template: input.template }), + ...(input.template !== undefined && input.template !== null && { template: input.template }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -870,13 +902,13 @@ export const serializeAws_restJson1DeregisterRobotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deregisterRobot"; let body: any; body = JSON.stringify({ - ...(input.fleet !== undefined && { fleet: input.fleet }), - ...(input.robot !== undefined && { robot: input.robot }), + ...(input.fleet !== undefined && input.fleet !== null && { fleet: input.fleet }), + ...(input.robot !== undefined && input.robot !== null && { robot: input.robot }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -895,12 +927,12 @@ export const serializeAws_restJson1DescribeDeploymentJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeDeploymentJob"; let body: any; body = JSON.stringify({ - ...(input.job !== undefined && { job: input.job }), + ...(input.job !== undefined && input.job !== null && { job: input.job }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -919,12 +951,12 @@ export const serializeAws_restJson1DescribeFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeFleet"; let body: any; body = JSON.stringify({ - ...(input.fleet !== undefined && { fleet: input.fleet }), + ...(input.fleet !== undefined && input.fleet !== null && { fleet: input.fleet }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -943,12 +975,12 @@ export const serializeAws_restJson1DescribeRobotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeRobot"; let body: any; body = JSON.stringify({ - ...(input.robot !== undefined && { robot: input.robot }), + ...(input.robot !== undefined && input.robot !== null && { robot: input.robot }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -967,13 +999,14 @@ export const serializeAws_restJson1DescribeRobotApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeRobotApplication"; let body: any; body = JSON.stringify({ - ...(input.application !== undefined && { application: input.application }), - ...(input.applicationVersion !== undefined && { applicationVersion: input.applicationVersion }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.applicationVersion !== undefined && + input.applicationVersion !== null && { applicationVersion: input.applicationVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -992,13 +1025,14 @@ export const serializeAws_restJson1DescribeSimulationApplicationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeSimulationApplication"; let body: any; body = JSON.stringify({ - ...(input.application !== undefined && { application: input.application }), - ...(input.applicationVersion !== undefined && { applicationVersion: input.applicationVersion }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.applicationVersion !== undefined && + input.applicationVersion !== null && { applicationVersion: input.applicationVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1017,12 +1051,12 @@ export const serializeAws_restJson1DescribeSimulationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeSimulationJob"; let body: any; body = JSON.stringify({ - ...(input.job !== undefined && { job: input.job }), + ...(input.job !== undefined && input.job !== null && { job: input.job }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1041,12 +1075,12 @@ export const serializeAws_restJson1DescribeSimulationJobBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeSimulationJobBatch"; let body: any; body = JSON.stringify({ - ...(input.batch !== undefined && { batch: input.batch }), + ...(input.batch !== undefined && input.batch !== null && { batch: input.batch }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1065,12 +1099,12 @@ export const serializeAws_restJson1DescribeWorldCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeWorld"; let body: any; body = JSON.stringify({ - ...(input.world !== undefined && { world: input.world }), + ...(input.world !== undefined && input.world !== null && { world: input.world }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1089,12 +1123,12 @@ export const serializeAws_restJson1DescribeWorldExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeWorldExportJob"; let body: any; body = JSON.stringify({ - ...(input.job !== undefined && { job: input.job }), + ...(input.job !== undefined && input.job !== null && { job: input.job }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1113,12 +1147,12 @@ export const serializeAws_restJson1DescribeWorldGenerationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeWorldGenerationJob"; let body: any; body = JSON.stringify({ - ...(input.job !== undefined && { job: input.job }), + ...(input.job !== undefined && input.job !== null && { job: input.job }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1137,12 +1171,12 @@ export const serializeAws_restJson1DescribeWorldTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeWorldTemplate"; let body: any; body = JSON.stringify({ - ...(input.template !== undefined && { template: input.template }), + ...(input.template !== undefined && input.template !== null && { template: input.template }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1161,13 +1195,13 @@ export const serializeAws_restJson1GetWorldTemplateBodyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/getWorldTemplateBody"; let body: any; body = JSON.stringify({ - ...(input.generationJob !== undefined && { generationJob: input.generationJob }), - ...(input.template !== undefined && { template: input.template }), + ...(input.generationJob !== undefined && input.generationJob !== null && { generationJob: input.generationJob }), + ...(input.template !== undefined && input.template !== null && { template: input.template }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1186,14 +1220,15 @@ export const serializeAws_restJson1ListDeploymentJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listDeploymentJobs"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1212,14 +1247,15 @@ export const serializeAws_restJson1ListFleetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listFleets"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1238,15 +1274,17 @@ export const serializeAws_restJson1ListRobotApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listRobotApplications"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.versionQualifier !== undefined && { versionQualifier: input.versionQualifier }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.versionQualifier !== undefined && + input.versionQualifier !== null && { versionQualifier: input.versionQualifier }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1265,14 +1303,15 @@ export const serializeAws_restJson1ListRobotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listRobots"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1291,15 +1330,17 @@ export const serializeAws_restJson1ListSimulationApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listSimulationApplications"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.versionQualifier !== undefined && { versionQualifier: input.versionQualifier }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.versionQualifier !== undefined && + input.versionQualifier !== null && { versionQualifier: input.versionQualifier }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1318,14 +1359,15 @@ export const serializeAws_restJson1ListSimulationJobBatchesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listSimulationJobBatches"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1344,14 +1386,15 @@ export const serializeAws_restJson1ListSimulationJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listSimulationJobs"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1369,9 +1412,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1400,14 +1441,15 @@ export const serializeAws_restJson1ListWorldExportJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listWorldExportJobs"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1426,14 +1468,15 @@ export const serializeAws_restJson1ListWorldGenerationJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listWorldGenerationJobs"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1452,14 +1495,15 @@ export const serializeAws_restJson1ListWorldsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listWorlds"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { filters: serializeAws_restJson1Filters(input.filters, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1Filters(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1478,13 +1522,13 @@ export const serializeAws_restJson1ListWorldTemplatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listWorldTemplates"; let body: any; body = JSON.stringify({ - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1503,13 +1547,13 @@ export const serializeAws_restJson1RegisterRobotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/registerRobot"; let body: any; body = JSON.stringify({ - ...(input.fleet !== undefined && { fleet: input.fleet }), - ...(input.robot !== undefined && { robot: input.robot }), + ...(input.fleet !== undefined && input.fleet !== null && { fleet: input.fleet }), + ...(input.robot !== undefined && input.robot !== null && { robot: input.robot }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1528,12 +1572,12 @@ export const serializeAws_restJson1RestartSimulationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restartSimulationJob"; let body: any; body = JSON.stringify({ - ...(input.job !== undefined && { job: input.job }), + ...(input.job !== undefined && input.job !== null && { job: input.job }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1552,22 +1596,22 @@ export const serializeAws_restJson1StartSimulationJobBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/startSimulationJobBatch"; let body: any; body = JSON.stringify({ - ...(input.batchPolicy !== undefined && { - batchPolicy: serializeAws_restJson1BatchPolicy(input.batchPolicy, context), - }), + ...(input.batchPolicy !== undefined && + input.batchPolicy !== null && { batchPolicy: serializeAws_restJson1BatchPolicy(input.batchPolicy, context) }), clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.createSimulationJobRequests !== undefined && { - createSimulationJobRequests: serializeAws_restJson1CreateSimulationJobRequests( - input.createSimulationJobRequests, - context - ), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.createSimulationJobRequests !== undefined && + input.createSimulationJobRequests !== null && { + createSimulationJobRequests: serializeAws_restJson1CreateSimulationJobRequests( + input.createSimulationJobRequests, + context + ), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1586,13 +1630,13 @@ export const serializeAws_restJson1SyncDeploymentJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/syncDeploymentJob"; let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.fleet !== undefined && { fleet: input.fleet }), + ...(input.fleet !== undefined && input.fleet !== null && { fleet: input.fleet }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1611,7 +1655,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -1625,7 +1669,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1643,9 +1687,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -1678,17 +1720,20 @@ export const serializeAws_restJson1UpdateRobotApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateRobotApplication"; let body: any; body = JSON.stringify({ - ...(input.application !== undefined && { application: input.application }), - ...(input.currentRevisionId !== undefined && { currentRevisionId: input.currentRevisionId }), - ...(input.robotSoftwareSuite !== undefined && { - robotSoftwareSuite: serializeAws_restJson1RobotSoftwareSuite(input.robotSoftwareSuite, context), - }), - ...(input.sources !== undefined && { sources: serializeAws_restJson1SourceConfigs(input.sources, context) }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.currentRevisionId !== undefined && + input.currentRevisionId !== null && { currentRevisionId: input.currentRevisionId }), + ...(input.robotSoftwareSuite !== undefined && + input.robotSoftwareSuite !== null && { + robotSoftwareSuite: serializeAws_restJson1RobotSoftwareSuite(input.robotSoftwareSuite, context), + }), + ...(input.sources !== undefined && + input.sources !== null && { sources: serializeAws_restJson1SourceConfigs(input.sources, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1707,23 +1752,28 @@ export const serializeAws_restJson1UpdateSimulationApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateSimulationApplication"; let body: any; body = JSON.stringify({ - ...(input.application !== undefined && { application: input.application }), - ...(input.currentRevisionId !== undefined && { currentRevisionId: input.currentRevisionId }), - ...(input.renderingEngine !== undefined && { - renderingEngine: serializeAws_restJson1RenderingEngine(input.renderingEngine, context), - }), - ...(input.robotSoftwareSuite !== undefined && { - robotSoftwareSuite: serializeAws_restJson1RobotSoftwareSuite(input.robotSoftwareSuite, context), - }), - ...(input.simulationSoftwareSuite !== undefined && { - simulationSoftwareSuite: serializeAws_restJson1SimulationSoftwareSuite(input.simulationSoftwareSuite, context), - }), - ...(input.sources !== undefined && { sources: serializeAws_restJson1SourceConfigs(input.sources, context) }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.currentRevisionId !== undefined && + input.currentRevisionId !== null && { currentRevisionId: input.currentRevisionId }), + ...(input.renderingEngine !== undefined && + input.renderingEngine !== null && { + renderingEngine: serializeAws_restJson1RenderingEngine(input.renderingEngine, context), + }), + ...(input.robotSoftwareSuite !== undefined && + input.robotSoftwareSuite !== null && { + robotSoftwareSuite: serializeAws_restJson1RobotSoftwareSuite(input.robotSoftwareSuite, context), + }), + ...(input.simulationSoftwareSuite !== undefined && + input.simulationSoftwareSuite !== null && { + simulationSoftwareSuite: serializeAws_restJson1SimulationSoftwareSuite(input.simulationSoftwareSuite, context), + }), + ...(input.sources !== undefined && + input.sources !== null && { sources: serializeAws_restJson1SourceConfigs(input.sources, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1742,17 +1792,18 @@ export const serializeAws_restJson1UpdateWorldTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateWorldTemplate"; let body: any; body = JSON.stringify({ - ...(input.name !== undefined && { name: input.name }), - ...(input.template !== undefined && { template: input.template }), - ...(input.templateBody !== undefined && { templateBody: input.templateBody }), - ...(input.templateLocation !== undefined && { - templateLocation: serializeAws_restJson1TemplateLocation(input.templateLocation, context), - }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.template !== undefined && input.template !== null && { template: input.template }), + ...(input.templateBody !== undefined && input.templateBody !== null && { templateBody: input.templateBody }), + ...(input.templateLocation !== undefined && + input.templateLocation !== null && { + templateLocation: serializeAws_restJson1TemplateLocation(input.templateLocation, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -7443,19 +7494,29 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async ( }; const serializeAws_restJson1Arns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1BatchPolicy = (input: BatchPolicy, context: __SerdeContext): any => { return { - ...(input.maxConcurrency !== undefined && { maxConcurrency: input.maxConcurrency }), - ...(input.timeoutInSeconds !== undefined && { timeoutInSeconds: input.timeoutInSeconds }), + ...(input.maxConcurrency !== undefined && + input.maxConcurrency !== null && { maxConcurrency: input.maxConcurrency }), + ...(input.timeoutInSeconds !== undefined && + input.timeoutInSeconds !== null && { timeoutInSeconds: input.timeoutInSeconds }), }; }; const serializeAws_restJson1Compute = (input: Compute, context: __SerdeContext): any => { return { - ...(input.simulationUnitLimit !== undefined && { simulationUnitLimit: input.simulationUnitLimit }), + ...(input.simulationUnitLimit !== undefined && + input.simulationUnitLimit !== null && { simulationUnitLimit: input.simulationUnitLimit }), }; }; @@ -7463,19 +7524,34 @@ const serializeAws_restJson1CreateSimulationJobRequests = ( input: SimulationJobRequest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SimulationJobRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SimulationJobRequest(entry, context); + }); }; const serializeAws_restJson1DataSourceConfig = (input: DataSourceConfig, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.s3Bucket !== undefined && { s3Bucket: input.s3Bucket }), - ...(input.s3Keys !== undefined && { s3Keys: serializeAws_restJson1S3Keys(input.s3Keys, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.s3Bucket !== undefined && input.s3Bucket !== null && { s3Bucket: input.s3Bucket }), + ...(input.s3Keys !== undefined && + input.s3Keys !== null && { s3Keys: serializeAws_restJson1S3Keys(input.s3Keys, context) }), }; }; const serializeAws_restJson1DataSourceConfigs = (input: DataSourceConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DataSourceConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DataSourceConfig(entry, context); + }); }; const serializeAws_restJson1DeploymentApplicationConfig = ( @@ -7483,11 +7559,13 @@ const serializeAws_restJson1DeploymentApplicationConfig = ( context: __SerdeContext ): any => { return { - ...(input.application !== undefined && { application: input.application }), - ...(input.applicationVersion !== undefined && { applicationVersion: input.applicationVersion }), - ...(input.launchConfig !== undefined && { - launchConfig: serializeAws_restJson1DeploymentLaunchConfig(input.launchConfig, context), - }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.applicationVersion !== undefined && + input.applicationVersion !== null && { applicationVersion: input.applicationVersion }), + ...(input.launchConfig !== undefined && + input.launchConfig !== null && { + launchConfig: serializeAws_restJson1DeploymentLaunchConfig(input.launchConfig, context), + }), }; }; @@ -7495,35 +7573,46 @@ const serializeAws_restJson1DeploymentApplicationConfigs = ( input: DeploymentApplicationConfig[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DeploymentApplicationConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DeploymentApplicationConfig(entry, context); + }); }; const serializeAws_restJson1DeploymentConfig = (input: DeploymentConfig, context: __SerdeContext): any => { return { - ...(input.concurrentDeploymentPercentage !== undefined && { - concurrentDeploymentPercentage: input.concurrentDeploymentPercentage, - }), - ...(input.downloadConditionFile !== undefined && { - downloadConditionFile: serializeAws_restJson1S3Object(input.downloadConditionFile, context), - }), - ...(input.failureThresholdPercentage !== undefined && { - failureThresholdPercentage: input.failureThresholdPercentage, - }), - ...(input.robotDeploymentTimeoutInSeconds !== undefined && { - robotDeploymentTimeoutInSeconds: input.robotDeploymentTimeoutInSeconds, - }), + ...(input.concurrentDeploymentPercentage !== undefined && + input.concurrentDeploymentPercentage !== null && { + concurrentDeploymentPercentage: input.concurrentDeploymentPercentage, + }), + ...(input.downloadConditionFile !== undefined && + input.downloadConditionFile !== null && { + downloadConditionFile: serializeAws_restJson1S3Object(input.downloadConditionFile, context), + }), + ...(input.failureThresholdPercentage !== undefined && + input.failureThresholdPercentage !== null && { failureThresholdPercentage: input.failureThresholdPercentage }), + ...(input.robotDeploymentTimeoutInSeconds !== undefined && + input.robotDeploymentTimeoutInSeconds !== null && { + robotDeploymentTimeoutInSeconds: input.robotDeploymentTimeoutInSeconds, + }), }; }; const serializeAws_restJson1DeploymentLaunchConfig = (input: DeploymentLaunchConfig, context: __SerdeContext): any => { return { - ...(input.environmentVariables !== undefined && { - environmentVariables: serializeAws_restJson1EnvironmentVariableMap(input.environmentVariables, context), - }), - ...(input.launchFile !== undefined && { launchFile: input.launchFile }), - ...(input.packageName !== undefined && { packageName: input.packageName }), - ...(input.postLaunchFile !== undefined && { postLaunchFile: input.postLaunchFile }), - ...(input.preLaunchFile !== undefined && { preLaunchFile: input.preLaunchFile }), + ...(input.environmentVariables !== undefined && + input.environmentVariables !== null && { + environmentVariables: serializeAws_restJson1EnvironmentVariableMap(input.environmentVariables, context), + }), + ...(input.launchFile !== undefined && input.launchFile !== null && { launchFile: input.launchFile }), + ...(input.packageName !== undefined && input.packageName !== null && { packageName: input.packageName }), + ...(input.postLaunchFile !== undefined && + input.postLaunchFile !== null && { postLaunchFile: input.postLaunchFile }), + ...(input.preLaunchFile !== undefined && input.preLaunchFile !== null && { preLaunchFile: input.preLaunchFile }), }; }; @@ -7531,91 +7620,121 @@ const serializeAws_restJson1EnvironmentVariableMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_restJson1FilterValues(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1FilterValues(input.values, context) }), }; }; const serializeAws_restJson1Filters = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Filter(entry, context); + }); }; const serializeAws_restJson1FilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1LaunchConfig = (input: LaunchConfig, context: __SerdeContext): any => { return { - ...(input.environmentVariables !== undefined && { - environmentVariables: serializeAws_restJson1EnvironmentVariableMap(input.environmentVariables, context), - }), - ...(input.launchFile !== undefined && { launchFile: input.launchFile }), - ...(input.packageName !== undefined && { packageName: input.packageName }), - ...(input.portForwardingConfig !== undefined && { - portForwardingConfig: serializeAws_restJson1PortForwardingConfig(input.portForwardingConfig, context), - }), - ...(input.streamUI !== undefined && { streamUI: input.streamUI }), + ...(input.environmentVariables !== undefined && + input.environmentVariables !== null && { + environmentVariables: serializeAws_restJson1EnvironmentVariableMap(input.environmentVariables, context), + }), + ...(input.launchFile !== undefined && input.launchFile !== null && { launchFile: input.launchFile }), + ...(input.packageName !== undefined && input.packageName !== null && { packageName: input.packageName }), + ...(input.portForwardingConfig !== undefined && + input.portForwardingConfig !== null && { + portForwardingConfig: serializeAws_restJson1PortForwardingConfig(input.portForwardingConfig, context), + }), + ...(input.streamUI !== undefined && input.streamUI !== null && { streamUI: input.streamUI }), }; }; const serializeAws_restJson1LoggingConfig = (input: LoggingConfig, context: __SerdeContext): any => { return { - ...(input.recordAllRosTopics !== undefined && { recordAllRosTopics: input.recordAllRosTopics }), + ...(input.recordAllRosTopics !== undefined && + input.recordAllRosTopics !== null && { recordAllRosTopics: input.recordAllRosTopics }), }; }; const serializeAws_restJson1OutputLocation = (input: OutputLocation, context: __SerdeContext): any => { return { - ...(input.s3Bucket !== undefined && { s3Bucket: input.s3Bucket }), - ...(input.s3Prefix !== undefined && { s3Prefix: input.s3Prefix }), + ...(input.s3Bucket !== undefined && input.s3Bucket !== null && { s3Bucket: input.s3Bucket }), + ...(input.s3Prefix !== undefined && input.s3Prefix !== null && { s3Prefix: input.s3Prefix }), }; }; const serializeAws_restJson1PortForwardingConfig = (input: PortForwardingConfig, context: __SerdeContext): any => { return { - ...(input.portMappings !== undefined && { - portMappings: serializeAws_restJson1PortMappingList(input.portMappings, context), - }), + ...(input.portMappings !== undefined && + input.portMappings !== null && { + portMappings: serializeAws_restJson1PortMappingList(input.portMappings, context), + }), }; }; const serializeAws_restJson1PortMapping = (input: PortMapping, context: __SerdeContext): any => { return { - ...(input.applicationPort !== undefined && { applicationPort: input.applicationPort }), - ...(input.enableOnPublicIp !== undefined && { enableOnPublicIp: input.enableOnPublicIp }), - ...(input.jobPort !== undefined && { jobPort: input.jobPort }), + ...(input.applicationPort !== undefined && + input.applicationPort !== null && { applicationPort: input.applicationPort }), + ...(input.enableOnPublicIp !== undefined && + input.enableOnPublicIp !== null && { enableOnPublicIp: input.enableOnPublicIp }), + ...(input.jobPort !== undefined && input.jobPort !== null && { jobPort: input.jobPort }), }; }; const serializeAws_restJson1PortMappingList = (input: PortMapping[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1PortMapping(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1PortMapping(entry, context); + }); }; const serializeAws_restJson1RenderingEngine = (input: RenderingEngine, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_restJson1RobotApplicationConfig = (input: RobotApplicationConfig, context: __SerdeContext): any => { return { - ...(input.application !== undefined && { application: input.application }), - ...(input.applicationVersion !== undefined && { applicationVersion: input.applicationVersion }), - ...(input.launchConfig !== undefined && { - launchConfig: serializeAws_restJson1LaunchConfig(input.launchConfig, context), - }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.applicationVersion !== undefined && + input.applicationVersion !== null && { applicationVersion: input.applicationVersion }), + ...(input.launchConfig !== undefined && + input.launchConfig !== null && { launchConfig: serializeAws_restJson1LaunchConfig(input.launchConfig, context) }), }; }; @@ -7623,30 +7742,51 @@ const serializeAws_restJson1RobotApplicationConfigs = ( input: RobotApplicationConfig[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1RobotApplicationConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1RobotApplicationConfig(entry, context); + }); }; const serializeAws_restJson1RobotSoftwareSuite = (input: RobotSoftwareSuite, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_restJson1S3Keys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1S3Object = (input: S3Object, context: __SerdeContext): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.etag !== undefined && { etag: input.etag }), - ...(input.key !== undefined && { key: input.key }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.etag !== undefined && input.etag !== null && { etag: input.etag }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), }; }; const serializeAws_restJson1SecurityGroups = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SimulationApplicationConfig = ( @@ -7654,14 +7794,13 @@ const serializeAws_restJson1SimulationApplicationConfig = ( context: __SerdeContext ): any => { return { - ...(input.application !== undefined && { application: input.application }), - ...(input.applicationVersion !== undefined && { applicationVersion: input.applicationVersion }), - ...(input.launchConfig !== undefined && { - launchConfig: serializeAws_restJson1LaunchConfig(input.launchConfig, context), - }), - ...(input.worldConfigs !== undefined && { - worldConfigs: serializeAws_restJson1WorldConfigs(input.worldConfigs, context), - }), + ...(input.application !== undefined && input.application !== null && { application: input.application }), + ...(input.applicationVersion !== undefined && + input.applicationVersion !== null && { applicationVersion: input.applicationVersion }), + ...(input.launchConfig !== undefined && + input.launchConfig !== null && { launchConfig: serializeAws_restJson1LaunchConfig(input.launchConfig, context) }), + ...(input.worldConfigs !== undefined && + input.worldConfigs !== null && { worldConfigs: serializeAws_restJson1WorldConfigs(input.worldConfigs, context) }), }; }; @@ -7669,33 +7808,53 @@ const serializeAws_restJson1SimulationApplicationConfigs = ( input: SimulationApplicationConfig[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SimulationApplicationConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SimulationApplicationConfig(entry, context); + }); }; const serializeAws_restJson1SimulationJobRequest = (input: SimulationJobRequest, context: __SerdeContext): any => { return { - ...(input.compute !== undefined && { compute: serializeAws_restJson1Compute(input.compute, context) }), - ...(input.dataSources !== undefined && { - dataSources: serializeAws_restJson1DataSourceConfigs(input.dataSources, context), - }), - ...(input.failureBehavior !== undefined && { failureBehavior: input.failureBehavior }), - ...(input.iamRole !== undefined && { iamRole: input.iamRole }), - ...(input.loggingConfig !== undefined && { - loggingConfig: serializeAws_restJson1LoggingConfig(input.loggingConfig, context), - }), - ...(input.maxJobDurationInSeconds !== undefined && { maxJobDurationInSeconds: input.maxJobDurationInSeconds }), - ...(input.outputLocation !== undefined && { - outputLocation: serializeAws_restJson1OutputLocation(input.outputLocation, context), - }), - ...(input.robotApplications !== undefined && { - robotApplications: serializeAws_restJson1RobotApplicationConfigs(input.robotApplications, context), - }), - ...(input.simulationApplications !== undefined && { - simulationApplications: serializeAws_restJson1SimulationApplicationConfigs(input.simulationApplications, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.useDefaultApplications !== undefined && { useDefaultApplications: input.useDefaultApplications }), - ...(input.vpcConfig !== undefined && { vpcConfig: serializeAws_restJson1VPCConfig(input.vpcConfig, context) }), + ...(input.compute !== undefined && + input.compute !== null && { compute: serializeAws_restJson1Compute(input.compute, context) }), + ...(input.dataSources !== undefined && + input.dataSources !== null && { + dataSources: serializeAws_restJson1DataSourceConfigs(input.dataSources, context), + }), + ...(input.failureBehavior !== undefined && + input.failureBehavior !== null && { failureBehavior: input.failureBehavior }), + ...(input.iamRole !== undefined && input.iamRole !== null && { iamRole: input.iamRole }), + ...(input.loggingConfig !== undefined && + input.loggingConfig !== null && { + loggingConfig: serializeAws_restJson1LoggingConfig(input.loggingConfig, context), + }), + ...(input.maxJobDurationInSeconds !== undefined && + input.maxJobDurationInSeconds !== null && { maxJobDurationInSeconds: input.maxJobDurationInSeconds }), + ...(input.outputLocation !== undefined && + input.outputLocation !== null && { + outputLocation: serializeAws_restJson1OutputLocation(input.outputLocation, context), + }), + ...(input.robotApplications !== undefined && + input.robotApplications !== null && { + robotApplications: serializeAws_restJson1RobotApplicationConfigs(input.robotApplications, context), + }), + ...(input.simulationApplications !== undefined && + input.simulationApplications !== null && { + simulationApplications: serializeAws_restJson1SimulationApplicationConfigs( + input.simulationApplications, + context + ), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.useDefaultApplications !== undefined && + input.useDefaultApplications !== null && { useDefaultApplications: input.useDefaultApplications }), + ...(input.vpcConfig !== undefined && + input.vpcConfig !== null && { vpcConfig: serializeAws_restJson1VPCConfig(input.vpcConfig, context) }), }; }; @@ -7704,75 +7863,108 @@ const serializeAws_restJson1SimulationSoftwareSuite = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_restJson1SourceConfig = (input: SourceConfig, context: __SerdeContext): any => { return { - ...(input.architecture !== undefined && { architecture: input.architecture }), - ...(input.s3Bucket !== undefined && { s3Bucket: input.s3Bucket }), - ...(input.s3Key !== undefined && { s3Key: input.s3Key }), + ...(input.architecture !== undefined && input.architecture !== null && { architecture: input.architecture }), + ...(input.s3Bucket !== undefined && input.s3Bucket !== null && { s3Bucket: input.s3Bucket }), + ...(input.s3Key !== undefined && input.s3Key !== null && { s3Key: input.s3Key }), }; }; const serializeAws_restJson1SourceConfigs = (input: SourceConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SourceConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SourceConfig(entry, context); + }); }; const serializeAws_restJson1Subnets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1TemplateLocation = (input: TemplateLocation, context: __SerdeContext): any => { return { - ...(input.s3Bucket !== undefined && { s3Bucket: input.s3Bucket }), - ...(input.s3Key !== undefined && { s3Key: input.s3Key }), + ...(input.s3Bucket !== undefined && input.s3Bucket !== null && { s3Bucket: input.s3Bucket }), + ...(input.s3Key !== undefined && input.s3Key !== null && { s3Key: input.s3Key }), }; }; const serializeAws_restJson1VPCConfig = (input: VPCConfig, context: __SerdeContext): any => { return { - ...(input.assignPublicIp !== undefined && { assignPublicIp: input.assignPublicIp }), - ...(input.securityGroups !== undefined && { - securityGroups: serializeAws_restJson1SecurityGroups(input.securityGroups, context), - }), - ...(input.subnets !== undefined && { subnets: serializeAws_restJson1Subnets(input.subnets, context) }), + ...(input.assignPublicIp !== undefined && + input.assignPublicIp !== null && { assignPublicIp: input.assignPublicIp }), + ...(input.securityGroups !== undefined && + input.securityGroups !== null && { + securityGroups: serializeAws_restJson1SecurityGroups(input.securityGroups, context), + }), + ...(input.subnets !== undefined && + input.subnets !== null && { subnets: serializeAws_restJson1Subnets(input.subnets, context) }), }; }; const serializeAws_restJson1WorldConfig = (input: WorldConfig, context: __SerdeContext): any => { return { - ...(input.world !== undefined && { world: input.world }), + ...(input.world !== undefined && input.world !== null && { world: input.world }), }; }; const serializeAws_restJson1WorldConfigs = (input: WorldConfig[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1WorldConfig(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1WorldConfig(entry, context); + }); }; const serializeAws_restJson1WorldCount = (input: WorldCount, context: __SerdeContext): any => { return { - ...(input.floorplanCount !== undefined && { floorplanCount: input.floorplanCount }), - ...(input.interiorCountPerFloorplan !== undefined && { - interiorCountPerFloorplan: input.interiorCountPerFloorplan, - }), + ...(input.floorplanCount !== undefined && + input.floorplanCount !== null && { floorplanCount: input.floorplanCount }), + ...(input.interiorCountPerFloorplan !== undefined && + input.interiorCountPerFloorplan !== null && { interiorCountPerFloorplan: input.interiorCountPerFloorplan }), }; }; const deserializeAws_restJson1Arns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1BatchPolicy = (output: any, context: __SerdeContext): BatchPolicy => { @@ -7806,7 +7998,14 @@ const deserializeAws_restJson1CreateSimulationJobRequests = ( output: any, context: __SerdeContext ): SimulationJobRequest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SimulationJobRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SimulationJobRequest(entry, context); + }); }; const deserializeAws_restJson1DataSource = (output: any, context: __SerdeContext): DataSource => { @@ -7832,15 +8031,36 @@ const deserializeAws_restJson1DataSourceConfig = (output: any, context: __SerdeC }; const deserializeAws_restJson1DataSourceConfigs = (output: any, context: __SerdeContext): DataSourceConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataSourceConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataSourceConfig(entry, context); + }); }; const deserializeAws_restJson1DataSourceNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DataSources = (output: any, context: __SerdeContext): DataSource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DataSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DataSource(entry, context); + }); }; const deserializeAws_restJson1DeploymentApplicationConfig = ( @@ -7864,7 +8084,14 @@ const deserializeAws_restJson1DeploymentApplicationConfigs = ( output: any, context: __SerdeContext ): DeploymentApplicationConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeploymentApplicationConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeploymentApplicationConfig(entry, context); + }); }; const deserializeAws_restJson1DeploymentConfig = (output: any, context: __SerdeContext): DeploymentConfig => { @@ -7912,7 +8139,14 @@ const deserializeAws_restJson1DeploymentJob = (output: any, context: __SerdeCont }; const deserializeAws_restJson1DeploymentJobs = (output: any, context: __SerdeContext): DeploymentJob[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeploymentJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeploymentJob(entry, context); + }); }; const deserializeAws_restJson1DeploymentLaunchConfig = ( @@ -7937,13 +8171,15 @@ const deserializeAws_restJson1EnvironmentVariableMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1FailedCreateSimulationJobRequest = ( @@ -7969,7 +8205,14 @@ const deserializeAws_restJson1FailedCreateSimulationJobRequests = ( output: any, context: __SerdeContext ): FailedCreateSimulationJobRequest[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FailedCreateSimulationJobRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FailedCreateSimulationJobRequest(entry, context); + }); }; const deserializeAws_restJson1FailureSummary = (output: any, context: __SerdeContext): FailureSummary => { @@ -8024,7 +8267,14 @@ const deserializeAws_restJson1Fleet = (output: any, context: __SerdeContext): Fl }; const deserializeAws_restJson1Fleets = (output: any, context: __SerdeContext): Fleet[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Fleet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Fleet(entry, context); + }); }; const deserializeAws_restJson1LaunchConfig = (output: any, context: __SerdeContext): LaunchConfig => { @@ -8092,7 +8342,14 @@ const deserializeAws_restJson1PortMapping = (output: any, context: __SerdeContex }; const deserializeAws_restJson1PortMappingList = (output: any, context: __SerdeContext): PortMapping[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PortMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PortMapping(entry, context); + }); }; const deserializeAws_restJson1ProgressDetail = (output: any, context: __SerdeContext): ProgressDetail => { @@ -8163,18 +8420,39 @@ const deserializeAws_restJson1RobotApplicationConfigs = ( output: any, context: __SerdeContext ): RobotApplicationConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RobotApplicationConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RobotApplicationConfig(entry, context); + }); }; const deserializeAws_restJson1RobotApplicationNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1RobotApplicationSummaries = ( output: any, context: __SerdeContext ): RobotApplicationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RobotApplicationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RobotApplicationSummary(entry, context); + }); }; const deserializeAws_restJson1RobotApplicationSummary = ( @@ -8219,11 +8497,25 @@ const deserializeAws_restJson1RobotDeployment = (output: any, context: __SerdeCo }; const deserializeAws_restJson1RobotDeploymentSummary = (output: any, context: __SerdeContext): RobotDeployment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RobotDeployment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RobotDeployment(entry, context); + }); }; const deserializeAws_restJson1Robots = (output: any, context: __SerdeContext): Robot[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Robot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Robot(entry, context); + }); }; const deserializeAws_restJson1RobotSoftwareSuite = (output: any, context: __SerdeContext): RobotSoftwareSuite => { @@ -8241,11 +8533,25 @@ const deserializeAws_restJson1S3KeyOutput = (output: any, context: __SerdeContex }; const deserializeAws_restJson1S3KeyOutputs = (output: any, context: __SerdeContext): S3KeyOutput[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1S3KeyOutput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1S3KeyOutput(entry, context); + }); }; const deserializeAws_restJson1S3Keys = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1S3Object = (output: any, context: __SerdeContext): S3Object => { @@ -8257,7 +8563,14 @@ const deserializeAws_restJson1S3Object = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1SecurityGroups = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SimulationApplicationConfig = ( @@ -8285,18 +8598,39 @@ const deserializeAws_restJson1SimulationApplicationConfigs = ( output: any, context: __SerdeContext ): SimulationApplicationConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SimulationApplicationConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SimulationApplicationConfig(entry, context); + }); }; const deserializeAws_restJson1SimulationApplicationNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SimulationApplicationSummaries = ( output: any, context: __SerdeContext ): SimulationApplicationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SimulationApplicationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SimulationApplicationSummary(entry, context); + }); }; const deserializeAws_restJson1SimulationApplicationSummary = ( @@ -8396,7 +8730,14 @@ const deserializeAws_restJson1SimulationJobBatchSummaries = ( output: any, context: __SerdeContext ): SimulationJobBatchSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SimulationJobBatchSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SimulationJobBatchSummary(entry, context); + }); }; const deserializeAws_restJson1SimulationJobBatchSummary = ( @@ -8478,14 +8819,28 @@ const deserializeAws_restJson1SimulationJobRequest = (output: any, context: __Se }; const deserializeAws_restJson1SimulationJobs = (output: any, context: __SerdeContext): SimulationJob[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SimulationJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SimulationJob(entry, context); + }); }; const deserializeAws_restJson1SimulationJobSummaries = ( output: any, context: __SerdeContext ): SimulationJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SimulationJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SimulationJobSummary(entry, context); + }); }; const deserializeAws_restJson1SimulationJobSummary = (output: any, context: __SerdeContext): SimulationJobSummary => { @@ -8532,25 +8887,48 @@ const deserializeAws_restJson1Source = (output: any, context: __SerdeContext): S }; const deserializeAws_restJson1Sources = (output: any, context: __SerdeContext): Source[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Source(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Source(entry, context); + }); }; const deserializeAws_restJson1Subnets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1TemplateSummaries = (output: any, context: __SerdeContext): TemplateSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TemplateSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TemplateSummary(entry, context); + }); }; const deserializeAws_restJson1TemplateSummary = (output: any, context: __SerdeContext): TemplateSummary => { @@ -8606,7 +8984,14 @@ const deserializeAws_restJson1WorldConfig = (output: any, context: __SerdeContex }; const deserializeAws_restJson1WorldConfigs = (output: any, context: __SerdeContext): WorldConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1WorldConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1WorldConfig(entry, context); + }); }; const deserializeAws_restJson1WorldCount = (output: any, context: __SerdeContext): WorldCount => { @@ -8624,7 +9009,14 @@ const deserializeAws_restJson1WorldExportJobSummaries = ( output: any, context: __SerdeContext ): WorldExportJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1WorldExportJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1WorldExportJobSummary(entry, context); + }); }; const deserializeAws_restJson1WorldExportJobSummary = (output: any, context: __SerdeContext): WorldExportJobSummary => { @@ -8654,14 +9046,28 @@ const deserializeAws_restJson1WorldFailure = (output: any, context: __SerdeConte }; const deserializeAws_restJson1WorldFailures = (output: any, context: __SerdeContext): WorldFailure[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1WorldFailure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1WorldFailure(entry, context); + }); }; const deserializeAws_restJson1WorldGenerationJobSummaries = ( output: any, context: __SerdeContext ): WorldGenerationJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1WorldGenerationJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1WorldGenerationJobSummary(entry, context); + }); }; const deserializeAws_restJson1WorldGenerationJobSummary = ( @@ -8690,7 +9096,14 @@ const deserializeAws_restJson1WorldGenerationJobSummary = ( }; const deserializeAws_restJson1WorldSummaries = (output: any, context: __SerdeContext): WorldSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1WorldSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1WorldSummary(entry, context); + }); }; const deserializeAws_restJson1WorldSummary = (output: any, context: __SerdeContext): WorldSummary => { @@ -8726,6 +9139,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-route-53-domains/protocols/Aws_json1_1.ts b/clients/client-route-53-domains/protocols/Aws_json1_1.ts index feb92e3fcc36..b59edcb51ca0 100644 --- a/clients/client-route-53-domains/protocols/Aws_json1_1.ts +++ b/clients/client-route-53-domains/protocols/Aws_json1_1.ts @@ -171,7 +171,7 @@ export const serializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.AcceptDomainTransferFromAnotherAwsAccount", }; let body: any; @@ -184,7 +184,7 @@ export const serializeAws_json1_1CancelDomainTransferToAnotherAwsAccountCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.CancelDomainTransferToAnotherAwsAccount", }; let body: any; @@ -197,7 +197,7 @@ export const serializeAws_json1_1CheckDomainAvailabilityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.CheckDomainAvailability", }; let body: any; @@ -210,7 +210,7 @@ export const serializeAws_json1_1CheckDomainTransferabilityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.CheckDomainTransferability", }; let body: any; @@ -223,7 +223,7 @@ export const serializeAws_json1_1DeleteTagsForDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.DeleteTagsForDomain", }; let body: any; @@ -236,7 +236,7 @@ export const serializeAws_json1_1DisableDomainAutoRenewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.DisableDomainAutoRenew", }; let body: any; @@ -249,7 +249,7 @@ export const serializeAws_json1_1DisableDomainTransferLockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.DisableDomainTransferLock", }; let body: any; @@ -262,7 +262,7 @@ export const serializeAws_json1_1EnableDomainAutoRenewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.EnableDomainAutoRenew", }; let body: any; @@ -275,7 +275,7 @@ export const serializeAws_json1_1EnableDomainTransferLockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.EnableDomainTransferLock", }; let body: any; @@ -288,7 +288,7 @@ export const serializeAws_json1_1GetContactReachabilityStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.GetContactReachabilityStatus", }; let body: any; @@ -301,7 +301,7 @@ export const serializeAws_json1_1GetDomainDetailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.GetDomainDetail", }; let body: any; @@ -314,7 +314,7 @@ export const serializeAws_json1_1GetDomainSuggestionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.GetDomainSuggestions", }; let body: any; @@ -327,7 +327,7 @@ export const serializeAws_json1_1GetOperationDetailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.GetOperationDetail", }; let body: any; @@ -340,7 +340,7 @@ export const serializeAws_json1_1ListDomainsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.ListDomains", }; let body: any; @@ -353,7 +353,7 @@ export const serializeAws_json1_1ListOperationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.ListOperations", }; let body: any; @@ -366,7 +366,7 @@ export const serializeAws_json1_1ListTagsForDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.ListTagsForDomain", }; let body: any; @@ -379,7 +379,7 @@ export const serializeAws_json1_1RegisterDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.RegisterDomain", }; let body: any; @@ -392,7 +392,7 @@ export const serializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.RejectDomainTransferFromAnotherAwsAccount", }; let body: any; @@ -405,7 +405,7 @@ export const serializeAws_json1_1RenewDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.RenewDomain", }; let body: any; @@ -418,7 +418,7 @@ export const serializeAws_json1_1ResendContactReachabilityEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.ResendContactReachabilityEmail", }; let body: any; @@ -431,7 +431,7 @@ export const serializeAws_json1_1RetrieveDomainAuthCodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.RetrieveDomainAuthCode", }; let body: any; @@ -444,7 +444,7 @@ export const serializeAws_json1_1TransferDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.TransferDomain", }; let body: any; @@ -457,7 +457,7 @@ export const serializeAws_json1_1TransferDomainToAnotherAwsAccountCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.TransferDomainToAnotherAwsAccount", }; let body: any; @@ -470,7 +470,7 @@ export const serializeAws_json1_1UpdateDomainContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.UpdateDomainContact", }; let body: any; @@ -483,7 +483,7 @@ export const serializeAws_json1_1UpdateDomainContactPrivacyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.UpdateDomainContactPrivacy", }; let body: any; @@ -496,7 +496,7 @@ export const serializeAws_json1_1UpdateDomainNameserversCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.UpdateDomainNameservers", }; let body: any; @@ -509,7 +509,7 @@ export const serializeAws_json1_1UpdateTagsForDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.UpdateTagsForDomain", }; let body: any; @@ -522,7 +522,7 @@ export const serializeAws_json1_1ViewBillingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Domains_v20140515.ViewBilling", }; let body: any; @@ -557,8 +557,7 @@ const deserializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountCommandErro }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DomainLimitExceeded": case "com.amazonaws.route53domains#DomainLimitExceeded": @@ -628,8 +627,7 @@ const deserializeAws_json1_1CancelDomainTransferToAnotherAwsAccountCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -691,8 +689,7 @@ const deserializeAws_json1_1CheckDomainAvailabilityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -754,8 +751,7 @@ const deserializeAws_json1_1CheckDomainTransferabilityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -817,8 +813,7 @@ const deserializeAws_json1_1DeleteTagsForDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -888,8 +883,7 @@ const deserializeAws_json1_1DisableDomainAutoRenewCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -951,8 +945,7 @@ const deserializeAws_json1_1DisableDomainTransferLockCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.route53domains#DuplicateRequest": @@ -1038,8 +1031,7 @@ const deserializeAws_json1_1EnableDomainAutoRenewCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1109,8 +1101,7 @@ const deserializeAws_json1_1EnableDomainTransferLockCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.route53domains#DuplicateRequest": @@ -1196,8 +1187,7 @@ const deserializeAws_json1_1GetContactReachabilityStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1267,8 +1257,7 @@ const deserializeAws_json1_1GetDomainDetailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1330,8 +1319,7 @@ const deserializeAws_json1_1GetDomainSuggestionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1393,8 +1381,7 @@ const deserializeAws_json1_1GetOperationDetailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1448,8 +1435,7 @@ const deserializeAws_json1_1ListDomainsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1503,8 +1489,7 @@ const deserializeAws_json1_1ListOperationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1558,8 +1543,7 @@ const deserializeAws_json1_1ListTagsForDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1629,8 +1613,7 @@ const deserializeAws_json1_1RegisterDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DomainLimitExceeded": case "com.amazonaws.route53domains#DomainLimitExceeded": @@ -1724,8 +1707,7 @@ const deserializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountCommandErro }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1787,8 +1769,7 @@ const deserializeAws_json1_1RenewDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.route53domains#DuplicateRequest": @@ -1874,8 +1855,7 @@ const deserializeAws_json1_1ResendContactReachabilityEmailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -1945,8 +1925,7 @@ const deserializeAws_json1_1RetrieveDomainAuthCodeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -2008,8 +1987,7 @@ const deserializeAws_json1_1TransferDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DomainLimitExceeded": case "com.amazonaws.route53domains#DomainLimitExceeded": @@ -2103,8 +2081,7 @@ const deserializeAws_json1_1TransferDomainToAnotherAwsAccountCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.route53domains#DuplicateRequest": @@ -2174,8 +2151,7 @@ const deserializeAws_json1_1UpdateDomainContactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.route53domains#DuplicateRequest": @@ -2261,8 +2237,7 @@ const deserializeAws_json1_1UpdateDomainContactPrivacyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.route53domains#DuplicateRequest": @@ -2348,8 +2323,7 @@ const deserializeAws_json1_1UpdateDomainNameserversCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.route53domains#DuplicateRequest": @@ -2435,8 +2409,7 @@ const deserializeAws_json1_1UpdateTagsForDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -2506,8 +2479,7 @@ const deserializeAws_json1_1ViewBillingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": @@ -2629,8 +2601,8 @@ const serializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.Password !== undefined && { Password: input.Password }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), }; }; @@ -2639,7 +2611,7 @@ const serializeAws_json1_1CancelDomainTransferToAnotherAwsAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; @@ -2648,8 +2620,8 @@ const serializeAws_json1_1CheckDomainAvailabilityRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.IdnLangCode !== undefined && { IdnLangCode: input.IdnLangCode }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.IdnLangCode !== undefined && input.IdnLangCode !== null && { IdnLangCode: input.IdnLangCode }), }; }; @@ -2658,29 +2630,29 @@ const serializeAws_json1_1CheckDomainTransferabilityRequest = ( context: __SerdeContext ): any => { return { - ...(input.AuthCode !== undefined && { AuthCode: input.AuthCode }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.AuthCode !== undefined && input.AuthCode !== null && { AuthCode: input.AuthCode }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; const serializeAws_json1_1ContactDetail = (input: ContactDetail, context: __SerdeContext): any => { return { - ...(input.AddressLine1 !== undefined && { AddressLine1: input.AddressLine1 }), - ...(input.AddressLine2 !== undefined && { AddressLine2: input.AddressLine2 }), - ...(input.City !== undefined && { City: input.City }), - ...(input.ContactType !== undefined && { ContactType: input.ContactType }), - ...(input.CountryCode !== undefined && { CountryCode: input.CountryCode }), - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.ExtraParams !== undefined && { - ExtraParams: serializeAws_json1_1ExtraParamList(input.ExtraParams, context), - }), - ...(input.Fax !== undefined && { Fax: input.Fax }), - ...(input.FirstName !== undefined && { FirstName: input.FirstName }), - ...(input.LastName !== undefined && { LastName: input.LastName }), - ...(input.OrganizationName !== undefined && { OrganizationName: input.OrganizationName }), - ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }), - ...(input.State !== undefined && { State: input.State }), - ...(input.ZipCode !== undefined && { ZipCode: input.ZipCode }), + ...(input.AddressLine1 !== undefined && input.AddressLine1 !== null && { AddressLine1: input.AddressLine1 }), + ...(input.AddressLine2 !== undefined && input.AddressLine2 !== null && { AddressLine2: input.AddressLine2 }), + ...(input.City !== undefined && input.City !== null && { City: input.City }), + ...(input.ContactType !== undefined && input.ContactType !== null && { ContactType: input.ContactType }), + ...(input.CountryCode !== undefined && input.CountryCode !== null && { CountryCode: input.CountryCode }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.ExtraParams !== undefined && + input.ExtraParams !== null && { ExtraParams: serializeAws_json1_1ExtraParamList(input.ExtraParams, context) }), + ...(input.Fax !== undefined && input.Fax !== null && { Fax: input.Fax }), + ...(input.FirstName !== undefined && input.FirstName !== null && { FirstName: input.FirstName }), + ...(input.LastName !== undefined && input.LastName !== null && { LastName: input.LastName }), + ...(input.OrganizationName !== undefined && + input.OrganizationName !== null && { OrganizationName: input.OrganizationName }), + ...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), + ...(input.ZipCode !== undefined && input.ZipCode !== null && { ZipCode: input.ZipCode }), }; }; @@ -2689,10 +2661,9 @@ const serializeAws_json1_1DeleteTagsForDomainRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.TagsToDelete !== undefined && { - TagsToDelete: serializeAws_json1_1TagKeyList(input.TagsToDelete, context), - }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.TagsToDelete !== undefined && + input.TagsToDelete !== null && { TagsToDelete: serializeAws_json1_1TagKeyList(input.TagsToDelete, context) }), }; }; @@ -2701,7 +2672,7 @@ const serializeAws_json1_1DisableDomainAutoRenewRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; @@ -2710,7 +2681,7 @@ const serializeAws_json1_1DisableDomainTransferLockRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; @@ -2719,7 +2690,7 @@ const serializeAws_json1_1EnableDomainAutoRenewRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; @@ -2728,19 +2699,26 @@ const serializeAws_json1_1EnableDomainTransferLockRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; const serializeAws_json1_1ExtraParam = (input: ExtraParam, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1ExtraParamList = (input: ExtraParam[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ExtraParam(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ExtraParam(entry, context); + }); }; const serializeAws_json1_1GetContactReachabilityStatusRequest = ( @@ -2748,13 +2726,13 @@ const serializeAws_json1_1GetContactReachabilityStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.domainName !== undefined && { domainName: input.domainName }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), }; }; const serializeAws_json1_1GetDomainDetailRequest = (input: GetDomainDetailRequest, context: __SerdeContext): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; @@ -2763,9 +2741,10 @@ const serializeAws_json1_1GetDomainSuggestionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.OnlyAvailable !== undefined && { OnlyAvailable: input.OnlyAvailable }), - ...(input.SuggestionCount !== undefined && { SuggestionCount: input.SuggestionCount }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.OnlyAvailable !== undefined && input.OnlyAvailable !== null && { OnlyAvailable: input.OnlyAvailable }), + ...(input.SuggestionCount !== undefined && + input.SuggestionCount !== null && { SuggestionCount: input.SuggestionCount }), }; }; @@ -2774,26 +2753,34 @@ const serializeAws_json1_1GetOperationDetailRequest = ( context: __SerdeContext ): any => { return { - ...(input.OperationId !== undefined && { OperationId: input.OperationId }), + ...(input.OperationId !== undefined && input.OperationId !== null && { OperationId: input.OperationId }), }; }; const serializeAws_json1_1GlueIpList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListDomainsRequest = (input: ListDomainsRequest, context: __SerdeContext): any => { return { - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxItems !== undefined && input.MaxItems !== null && { MaxItems: input.MaxItems }), }; }; const serializeAws_json1_1ListOperationsRequest = (input: ListOperationsRequest, context: __SerdeContext): any => { return { - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), - ...(input.SubmittedSince !== undefined && { SubmittedSince: Math.round(input.SubmittedSince.getTime() / 1000) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxItems !== undefined && input.MaxItems !== null && { MaxItems: input.MaxItems }), + ...(input.SubmittedSince !== undefined && + input.SubmittedSince !== null && { SubmittedSince: Math.round(input.SubmittedSince.getTime() / 1000) }), }; }; @@ -2802,45 +2789,52 @@ const serializeAws_json1_1ListTagsForDomainRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; const serializeAws_json1_1Nameserver = (input: Nameserver, context: __SerdeContext): any => { return { - ...(input.GlueIps !== undefined && { GlueIps: serializeAws_json1_1GlueIpList(input.GlueIps, context) }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.GlueIps !== undefined && + input.GlueIps !== null && { GlueIps: serializeAws_json1_1GlueIpList(input.GlueIps, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1NameserverList = (input: Nameserver[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Nameserver(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Nameserver(entry, context); + }); }; const serializeAws_json1_1RegisterDomainRequest = (input: RegisterDomainRequest, context: __SerdeContext): any => { return { - ...(input.AdminContact !== undefined && { - AdminContact: serializeAws_json1_1ContactDetail(input.AdminContact, context), - }), - ...(input.AutoRenew !== undefined && { AutoRenew: input.AutoRenew }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.DurationInYears !== undefined && { DurationInYears: input.DurationInYears }), - ...(input.IdnLangCode !== undefined && { IdnLangCode: input.IdnLangCode }), - ...(input.PrivacyProtectAdminContact !== undefined && { - PrivacyProtectAdminContact: input.PrivacyProtectAdminContact, - }), - ...(input.PrivacyProtectRegistrantContact !== undefined && { - PrivacyProtectRegistrantContact: input.PrivacyProtectRegistrantContact, - }), - ...(input.PrivacyProtectTechContact !== undefined && { - PrivacyProtectTechContact: input.PrivacyProtectTechContact, - }), - ...(input.RegistrantContact !== undefined && { - RegistrantContact: serializeAws_json1_1ContactDetail(input.RegistrantContact, context), - }), - ...(input.TechContact !== undefined && { - TechContact: serializeAws_json1_1ContactDetail(input.TechContact, context), - }), + ...(input.AdminContact !== undefined && + input.AdminContact !== null && { AdminContact: serializeAws_json1_1ContactDetail(input.AdminContact, context) }), + ...(input.AutoRenew !== undefined && input.AutoRenew !== null && { AutoRenew: input.AutoRenew }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.DurationInYears !== undefined && + input.DurationInYears !== null && { DurationInYears: input.DurationInYears }), + ...(input.IdnLangCode !== undefined && input.IdnLangCode !== null && { IdnLangCode: input.IdnLangCode }), + ...(input.PrivacyProtectAdminContact !== undefined && + input.PrivacyProtectAdminContact !== null && { PrivacyProtectAdminContact: input.PrivacyProtectAdminContact }), + ...(input.PrivacyProtectRegistrantContact !== undefined && + input.PrivacyProtectRegistrantContact !== null && { + PrivacyProtectRegistrantContact: input.PrivacyProtectRegistrantContact, + }), + ...(input.PrivacyProtectTechContact !== undefined && + input.PrivacyProtectTechContact !== null && { PrivacyProtectTechContact: input.PrivacyProtectTechContact }), + ...(input.RegistrantContact !== undefined && + input.RegistrantContact !== null && { + RegistrantContact: serializeAws_json1_1ContactDetail(input.RegistrantContact, context), + }), + ...(input.TechContact !== undefined && + input.TechContact !== null && { TechContact: serializeAws_json1_1ContactDetail(input.TechContact, context) }), }; }; @@ -2849,15 +2843,17 @@ const serializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; const serializeAws_json1_1RenewDomainRequest = (input: RenewDomainRequest, context: __SerdeContext): any => { return { - ...(input.CurrentExpiryYear !== undefined && { CurrentExpiryYear: input.CurrentExpiryYear }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.DurationInYears !== undefined && { DurationInYears: input.DurationInYears }), + ...(input.CurrentExpiryYear !== undefined && + input.CurrentExpiryYear !== null && { CurrentExpiryYear: input.CurrentExpiryYear }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.DurationInYears !== undefined && + input.DurationInYears !== null && { DurationInYears: input.DurationInYears }), }; }; @@ -2866,7 +2862,7 @@ const serializeAws_json1_1ResendContactReachabilityEmailRequest = ( context: __SerdeContext ): any => { return { - ...(input.domainName !== undefined && { domainName: input.domainName }), + ...(input.domainName !== undefined && input.domainName !== null && { domainName: input.domainName }), }; }; @@ -2875,53 +2871,65 @@ const serializeAws_json1_1RetrieveDomainAuthCodeRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TransferDomainRequest = (input: TransferDomainRequest, context: __SerdeContext): any => { return { - ...(input.AdminContact !== undefined && { - AdminContact: serializeAws_json1_1ContactDetail(input.AdminContact, context), - }), - ...(input.AuthCode !== undefined && { AuthCode: input.AuthCode }), - ...(input.AutoRenew !== undefined && { AutoRenew: input.AutoRenew }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.DurationInYears !== undefined && { DurationInYears: input.DurationInYears }), - ...(input.IdnLangCode !== undefined && { IdnLangCode: input.IdnLangCode }), - ...(input.Nameservers !== undefined && { - Nameservers: serializeAws_json1_1NameserverList(input.Nameservers, context), - }), - ...(input.PrivacyProtectAdminContact !== undefined && { - PrivacyProtectAdminContact: input.PrivacyProtectAdminContact, - }), - ...(input.PrivacyProtectRegistrantContact !== undefined && { - PrivacyProtectRegistrantContact: input.PrivacyProtectRegistrantContact, - }), - ...(input.PrivacyProtectTechContact !== undefined && { - PrivacyProtectTechContact: input.PrivacyProtectTechContact, - }), - ...(input.RegistrantContact !== undefined && { - RegistrantContact: serializeAws_json1_1ContactDetail(input.RegistrantContact, context), - }), - ...(input.TechContact !== undefined && { - TechContact: serializeAws_json1_1ContactDetail(input.TechContact, context), - }), + ...(input.AdminContact !== undefined && + input.AdminContact !== null && { AdminContact: serializeAws_json1_1ContactDetail(input.AdminContact, context) }), + ...(input.AuthCode !== undefined && input.AuthCode !== null && { AuthCode: input.AuthCode }), + ...(input.AutoRenew !== undefined && input.AutoRenew !== null && { AutoRenew: input.AutoRenew }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.DurationInYears !== undefined && + input.DurationInYears !== null && { DurationInYears: input.DurationInYears }), + ...(input.IdnLangCode !== undefined && input.IdnLangCode !== null && { IdnLangCode: input.IdnLangCode }), + ...(input.Nameservers !== undefined && + input.Nameservers !== null && { Nameservers: serializeAws_json1_1NameserverList(input.Nameservers, context) }), + ...(input.PrivacyProtectAdminContact !== undefined && + input.PrivacyProtectAdminContact !== null && { PrivacyProtectAdminContact: input.PrivacyProtectAdminContact }), + ...(input.PrivacyProtectRegistrantContact !== undefined && + input.PrivacyProtectRegistrantContact !== null && { + PrivacyProtectRegistrantContact: input.PrivacyProtectRegistrantContact, + }), + ...(input.PrivacyProtectTechContact !== undefined && + input.PrivacyProtectTechContact !== null && { PrivacyProtectTechContact: input.PrivacyProtectTechContact }), + ...(input.RegistrantContact !== undefined && + input.RegistrantContact !== null && { + RegistrantContact: serializeAws_json1_1ContactDetail(input.RegistrantContact, context), + }), + ...(input.TechContact !== undefined && + input.TechContact !== null && { TechContact: serializeAws_json1_1ContactDetail(input.TechContact, context) }), }; }; @@ -2930,8 +2938,8 @@ const serializeAws_json1_1TransferDomainToAnotherAwsAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), }; }; @@ -2940,10 +2948,11 @@ const serializeAws_json1_1UpdateDomainContactPrivacyRequest = ( context: __SerdeContext ): any => { return { - ...(input.AdminPrivacy !== undefined && { AdminPrivacy: input.AdminPrivacy }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.RegistrantPrivacy !== undefined && { RegistrantPrivacy: input.RegistrantPrivacy }), - ...(input.TechPrivacy !== undefined && { TechPrivacy: input.TechPrivacy }), + ...(input.AdminPrivacy !== undefined && input.AdminPrivacy !== null && { AdminPrivacy: input.AdminPrivacy }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.RegistrantPrivacy !== undefined && + input.RegistrantPrivacy !== null && { RegistrantPrivacy: input.RegistrantPrivacy }), + ...(input.TechPrivacy !== undefined && input.TechPrivacy !== null && { TechPrivacy: input.TechPrivacy }), }; }; @@ -2952,16 +2961,15 @@ const serializeAws_json1_1UpdateDomainContactRequest = ( context: __SerdeContext ): any => { return { - ...(input.AdminContact !== undefined && { - AdminContact: serializeAws_json1_1ContactDetail(input.AdminContact, context), - }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.RegistrantContact !== undefined && { - RegistrantContact: serializeAws_json1_1ContactDetail(input.RegistrantContact, context), - }), - ...(input.TechContact !== undefined && { - TechContact: serializeAws_json1_1ContactDetail(input.TechContact, context), - }), + ...(input.AdminContact !== undefined && + input.AdminContact !== null && { AdminContact: serializeAws_json1_1ContactDetail(input.AdminContact, context) }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.RegistrantContact !== undefined && + input.RegistrantContact !== null && { + RegistrantContact: serializeAws_json1_1ContactDetail(input.RegistrantContact, context), + }), + ...(input.TechContact !== undefined && + input.TechContact !== null && { TechContact: serializeAws_json1_1ContactDetail(input.TechContact, context) }), }; }; @@ -2970,11 +2978,10 @@ const serializeAws_json1_1UpdateDomainNameserversRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.FIAuthKey !== undefined && { FIAuthKey: input.FIAuthKey }), - ...(input.Nameservers !== undefined && { - Nameservers: serializeAws_json1_1NameserverList(input.Nameservers, context), - }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.FIAuthKey !== undefined && input.FIAuthKey !== null && { FIAuthKey: input.FIAuthKey }), + ...(input.Nameservers !== undefined && + input.Nameservers !== null && { Nameservers: serializeAws_json1_1NameserverList(input.Nameservers, context) }), }; }; @@ -2983,17 +2990,18 @@ const serializeAws_json1_1UpdateTagsForDomainRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.TagsToUpdate !== undefined && { TagsToUpdate: serializeAws_json1_1TagList(input.TagsToUpdate, context) }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.TagsToUpdate !== undefined && + input.TagsToUpdate !== null && { TagsToUpdate: serializeAws_json1_1TagList(input.TagsToUpdate, context) }), }; }; const serializeAws_json1_1ViewBillingRequest = (input: ViewBillingRequest, context: __SerdeContext): any => { return { - ...(input.End !== undefined && { End: Math.round(input.End.getTime() / 1000) }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), - ...(input.Start !== undefined && { Start: Math.round(input.Start.getTime() / 1000) }), + ...(input.End !== undefined && input.End !== null && { End: Math.round(input.End.getTime() / 1000) }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.MaxItems !== undefined && input.MaxItems !== null && { MaxItems: input.MaxItems }), + ...(input.Start !== undefined && input.Start !== null && { Start: Math.round(input.Start.getTime() / 1000) }), }; }; @@ -3020,7 +3028,14 @@ const deserializeAws_json1_1BillingRecord = (output: any, context: __SerdeContex }; const deserializeAws_json1_1BillingRecords = (output: any, context: __SerdeContext): BillingRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BillingRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BillingRecord(entry, context); + }); }; const deserializeAws_json1_1CancelDomainTransferToAnotherAwsAccountResponse = ( @@ -3106,7 +3121,14 @@ const deserializeAws_json1_1DomainLimitExceeded = (output: any, context: __Serde }; const deserializeAws_json1_1DomainStatusList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DomainSuggestion = (output: any, context: __SerdeContext): DomainSuggestion => { @@ -3117,7 +3139,14 @@ const deserializeAws_json1_1DomainSuggestion = (output: any, context: __SerdeCon }; const deserializeAws_json1_1DomainSuggestionsList = (output: any, context: __SerdeContext): DomainSuggestion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DomainSuggestion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DomainSuggestion(entry, context); + }); }; const deserializeAws_json1_1DomainSummary = (output: any, context: __SerdeContext): DomainSummary => { @@ -3131,7 +3160,14 @@ const deserializeAws_json1_1DomainSummary = (output: any, context: __SerdeContex }; const deserializeAws_json1_1DomainSummaryList = (output: any, context: __SerdeContext): DomainSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DomainSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DomainSummary(entry, context); + }); }; const deserializeAws_json1_1DomainTransferability = (output: any, context: __SerdeContext): DomainTransferability => { @@ -3170,7 +3206,14 @@ const deserializeAws_json1_1ExtraParam = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ExtraParamList = (output: any, context: __SerdeContext): ExtraParam[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExtraParam(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExtraParam(entry, context); + }); }; const deserializeAws_json1_1GetContactReachabilityStatusResponse = ( @@ -3277,7 +3320,14 @@ const deserializeAws_json1_1GetOperationDetailResponse = ( }; const deserializeAws_json1_1GlueIpList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InvalidInput = (output: any, context: __SerdeContext): InvalidInput => { @@ -3331,7 +3381,14 @@ const deserializeAws_json1_1Nameserver = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1NameserverList = (output: any, context: __SerdeContext): Nameserver[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Nameserver(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Nameserver(entry, context); + }); }; const deserializeAws_json1_1OperationLimitExceeded = (output: any, context: __SerdeContext): OperationLimitExceeded => { @@ -3353,7 +3410,14 @@ const deserializeAws_json1_1OperationSummary = (output: any, context: __SerdeCon }; const deserializeAws_json1_1OperationSummaryList = (output: any, context: __SerdeContext): OperationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OperationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OperationSummary(entry, context); + }); }; const deserializeAws_json1_1RegisterDomainResponse = (output: any, context: __SerdeContext): RegisterDomainResponse => { @@ -3408,7 +3472,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TLDRulesViolation = (output: any, context: __SerdeContext): TLDRulesViolation => { @@ -3534,3 +3605,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-route-53/protocols/Aws_restXml.ts b/clients/client-route-53/protocols/Aws_restXml.ts index 51b18fe4af49..999ff86e01a8 100644 --- a/clients/client-route-53/protocols/Aws_restXml.ts +++ b/clients/client-route-53/protocols/Aws_restXml.ts @@ -279,7 +279,7 @@ export const serializeAws_restXmlAssociateVPCWithHostedZoneCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/hostedzone/{HostedZoneId}/associatevpc"; if (input.HostedZoneId !== undefined) { @@ -321,7 +321,7 @@ export const serializeAws_restXmlChangeResourceRecordSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/hostedzone/{HostedZoneId}/rrset"; if (input.HostedZoneId !== undefined) { @@ -359,7 +359,7 @@ export const serializeAws_restXmlChangeTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/tags/{ResourceType}/{ResourceId}"; if (input.ResourceId !== undefined) { @@ -418,7 +418,7 @@ export const serializeAws_restXmlCreateHealthCheckCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/healthcheck"; let body: any; @@ -453,7 +453,7 @@ export const serializeAws_restXmlCreateHostedZoneCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/hostedzone"; let body: any; @@ -500,7 +500,7 @@ export const serializeAws_restXmlCreateQueryLoggingConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/queryloggingconfig"; let body: any; @@ -535,7 +535,7 @@ export const serializeAws_restXmlCreateReusableDelegationSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/delegationset"; let body: any; @@ -568,7 +568,7 @@ export const serializeAws_restXmlCreateTrafficPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/trafficpolicy"; let body: any; @@ -607,7 +607,7 @@ export const serializeAws_restXmlCreateTrafficPolicyInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/trafficpolicyinstance"; let body: any; @@ -656,7 +656,7 @@ export const serializeAws_restXmlCreateTrafficPolicyVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/trafficpolicy/{Id}"; if (input.Id !== undefined) { @@ -700,7 +700,7 @@ export const serializeAws_restXmlCreateVPCAssociationAuthorizationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/hostedzone/{HostedZoneId}/authorizevpcassociation"; if (input.HostedZoneId !== undefined) { @@ -737,9 +737,7 @@ export const serializeAws_restXmlDeleteHealthCheckCommand = async ( input: DeleteHealthCheckCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/healthcheck/{HealthCheckId}"; if (input.HealthCheckId !== undefined) { const labelValue: string = input.HealthCheckId; @@ -767,9 +765,7 @@ export const serializeAws_restXmlDeleteHostedZoneCommand = async ( input: DeleteHostedZoneCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/hostedzone/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -797,9 +793,7 @@ export const serializeAws_restXmlDeleteQueryLoggingConfigCommand = async ( input: DeleteQueryLoggingConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/queryloggingconfig/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -827,9 +821,7 @@ export const serializeAws_restXmlDeleteReusableDelegationSetCommand = async ( input: DeleteReusableDelegationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/delegationset/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -857,9 +849,7 @@ export const serializeAws_restXmlDeleteTrafficPolicyCommand = async ( input: DeleteTrafficPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicy/{Id}/{Version}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -896,9 +886,7 @@ export const serializeAws_restXmlDeleteTrafficPolicyInstanceCommand = async ( input: DeleteTrafficPolicyInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicyinstance/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -927,7 +915,7 @@ export const serializeAws_restXmlDeleteVPCAssociationAuthorizationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/hostedzone/{HostedZoneId}/deauthorizevpcassociation"; if (input.HostedZoneId !== undefined) { @@ -965,7 +953,7 @@ export const serializeAws_restXmlDisassociateVPCFromHostedZoneCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/hostedzone/{HostedZoneId}/disassociatevpc"; if (input.HostedZoneId !== undefined) { @@ -1006,9 +994,7 @@ export const serializeAws_restXmlGetAccountLimitCommand = async ( input: GetAccountLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/accountlimit/{Type}"; if (input.Type !== undefined) { const labelValue: string = input.Type; @@ -1036,9 +1022,7 @@ export const serializeAws_restXmlGetChangeCommand = async ( input: GetChangeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/change/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1066,9 +1050,7 @@ export const serializeAws_restXmlGetCheckerIpRangesCommand = async ( input: GetCheckerIpRangesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/checkeripranges"; let body: any; body = ""; @@ -1088,9 +1070,7 @@ export const serializeAws_restXmlGetGeoLocationCommand = async ( input: GetGeoLocationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/geolocation"; const query: any = { ...(input.ContinentCode !== undefined && { continentcode: input.ContinentCode }), @@ -1115,9 +1095,7 @@ export const serializeAws_restXmlGetHealthCheckCommand = async ( input: GetHealthCheckCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/healthcheck/{HealthCheckId}"; if (input.HealthCheckId !== undefined) { const labelValue: string = input.HealthCheckId; @@ -1145,9 +1123,7 @@ export const serializeAws_restXmlGetHealthCheckCountCommand = async ( input: GetHealthCheckCountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/healthcheckcount"; let body: any; body = ""; @@ -1167,9 +1143,7 @@ export const serializeAws_restXmlGetHealthCheckLastFailureReasonCommand = async input: GetHealthCheckLastFailureReasonCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/healthcheck/{HealthCheckId}/lastfailurereason"; if (input.HealthCheckId !== undefined) { const labelValue: string = input.HealthCheckId; @@ -1197,9 +1171,7 @@ export const serializeAws_restXmlGetHealthCheckStatusCommand = async ( input: GetHealthCheckStatusCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/healthcheck/{HealthCheckId}/status"; if (input.HealthCheckId !== undefined) { const labelValue: string = input.HealthCheckId; @@ -1227,9 +1199,7 @@ export const serializeAws_restXmlGetHostedZoneCommand = async ( input: GetHostedZoneCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/hostedzone/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1257,9 +1227,7 @@ export const serializeAws_restXmlGetHostedZoneCountCommand = async ( input: GetHostedZoneCountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/hostedzonecount"; let body: any; body = ""; @@ -1279,9 +1247,7 @@ export const serializeAws_restXmlGetHostedZoneLimitCommand = async ( input: GetHostedZoneLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/hostedzonelimit/{HostedZoneId}/{Type}"; if (input.HostedZoneId !== undefined) { const labelValue: string = input.HostedZoneId; @@ -1318,9 +1284,7 @@ export const serializeAws_restXmlGetQueryLoggingConfigCommand = async ( input: GetQueryLoggingConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/queryloggingconfig/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1348,9 +1312,7 @@ export const serializeAws_restXmlGetReusableDelegationSetCommand = async ( input: GetReusableDelegationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/delegationset/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1378,9 +1340,7 @@ export const serializeAws_restXmlGetReusableDelegationSetLimitCommand = async ( input: GetReusableDelegationSetLimitCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/reusabledelegationsetlimit/{DelegationSetId}/{Type}"; if (input.DelegationSetId !== undefined) { const labelValue: string = input.DelegationSetId; @@ -1417,9 +1377,7 @@ export const serializeAws_restXmlGetTrafficPolicyCommand = async ( input: GetTrafficPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicy/{Id}/{Version}"; if (input.Version !== undefined) { const labelValue: string = input.Version.toString(); @@ -1456,9 +1414,7 @@ export const serializeAws_restXmlGetTrafficPolicyInstanceCommand = async ( input: GetTrafficPolicyInstanceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicyinstance/{Id}"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1486,9 +1442,7 @@ export const serializeAws_restXmlGetTrafficPolicyInstanceCountCommand = async ( input: GetTrafficPolicyInstanceCountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicyinstancecount"; let body: any; body = ""; @@ -1508,9 +1462,7 @@ export const serializeAws_restXmlListGeoLocationsCommand = async ( input: ListGeoLocationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/geolocations"; const query: any = { ...(input.StartSubdivisionCode !== undefined && { startsubdivisioncode: input.StartSubdivisionCode }), @@ -1536,9 +1488,7 @@ export const serializeAws_restXmlListHealthChecksCommand = async ( input: ListHealthChecksCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/healthcheck"; const query: any = { ...(input.Marker !== undefined && { marker: input.Marker }), @@ -1562,9 +1512,7 @@ export const serializeAws_restXmlListHostedZonesCommand = async ( input: ListHostedZonesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/hostedzone"; const query: any = { ...(input.DelegationSetId !== undefined && { delegationsetid: input.DelegationSetId }), @@ -1589,9 +1537,7 @@ export const serializeAws_restXmlListHostedZonesByNameCommand = async ( input: ListHostedZonesByNameCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/hostedzonesbyname"; const query: any = { ...(input.DNSName !== undefined && { dnsname: input.DNSName }), @@ -1616,9 +1562,7 @@ export const serializeAws_restXmlListHostedZonesByVPCCommand = async ( input: ListHostedZonesByVPCCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/hostedzonesbyvpc"; const query: any = { ...(input.VPCRegion !== undefined && { vpcregion: input.VPCRegion }), @@ -1644,9 +1588,7 @@ export const serializeAws_restXmlListQueryLoggingConfigsCommand = async ( input: ListQueryLoggingConfigsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/queryloggingconfig"; const query: any = { ...(input.HostedZoneId !== undefined && { hostedzoneid: input.HostedZoneId }), @@ -1671,9 +1613,7 @@ export const serializeAws_restXmlListResourceRecordSetsCommand = async ( input: ListResourceRecordSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/hostedzone/{HostedZoneId}/rrset"; if (input.HostedZoneId !== undefined) { const labelValue: string = input.HostedZoneId; @@ -1708,9 +1648,7 @@ export const serializeAws_restXmlListReusableDelegationSetsCommand = async ( input: ListReusableDelegationSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/delegationset"; const query: any = { ...(input.MaxItems !== undefined && { maxitems: input.MaxItems }), @@ -1734,9 +1672,7 @@ export const serializeAws_restXmlListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/tags/{ResourceType}/{ResourceId}"; if (input.ResourceId !== undefined) { const labelValue: string = input.ResourceId; @@ -1774,7 +1710,7 @@ export const serializeAws_restXmlListTagsForResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/tags/{ResourceType}"; if (input.ResourceType !== undefined) { @@ -1815,9 +1751,7 @@ export const serializeAws_restXmlListTrafficPoliciesCommand = async ( input: ListTrafficPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicies"; const query: any = { ...(input.TrafficPolicyIdMarker !== undefined && { trafficpolicyid: input.TrafficPolicyIdMarker }), @@ -1841,9 +1775,7 @@ export const serializeAws_restXmlListTrafficPolicyInstancesCommand = async ( input: ListTrafficPolicyInstancesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicyinstances"; const query: any = { ...(input.TrafficPolicyInstanceTypeMarker !== undefined && { @@ -1873,9 +1805,7 @@ export const serializeAws_restXmlListTrafficPolicyInstancesByHostedZoneCommand = input: ListTrafficPolicyInstancesByHostedZoneCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicyinstances/hostedzone"; const query: any = { ...(input.TrafficPolicyInstanceNameMarker !== undefined && { @@ -1905,9 +1835,7 @@ export const serializeAws_restXmlListTrafficPolicyInstancesByPolicyCommand = asy input: ListTrafficPolicyInstancesByPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicyinstances/trafficpolicy"; const query: any = { ...(input.TrafficPolicyInstanceTypeMarker !== undefined && { @@ -1939,9 +1867,7 @@ export const serializeAws_restXmlListTrafficPolicyVersionsCommand = async ( input: ListTrafficPolicyVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/trafficpolicies/{Id}/versions"; if (input.Id !== undefined) { const labelValue: string = input.Id; @@ -1974,9 +1900,7 @@ export const serializeAws_restXmlListVPCAssociationAuthorizationsCommand = async input: ListVPCAssociationAuthorizationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/hostedzone/{HostedZoneId}/authorizevpcassociation"; if (input.HostedZoneId !== undefined) { const labelValue: string = input.HostedZoneId; @@ -2009,9 +1933,7 @@ export const serializeAws_restXmlTestDNSAnswerCommand = async ( input: TestDNSAnswerCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/2013-04-01/testdnsanswer"; const query: any = { ...(input.EDNS0ClientSubnetMask !== undefined && { edns0clientsubnetmask: input.EDNS0ClientSubnetMask }), @@ -2040,7 +1962,7 @@ export const serializeAws_restXmlUpdateHealthCheckCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/healthcheck/{HealthCheckId}"; if (input.HealthCheckId !== undefined) { @@ -2160,7 +2082,7 @@ export const serializeAws_restXmlUpdateHostedZoneCommentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/hostedzone/{Id}"; if (input.Id !== undefined) { @@ -2198,7 +2120,7 @@ export const serializeAws_restXmlUpdateTrafficPolicyCommentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/trafficpolicy/{Id}/{Version}"; if (input.Id !== undefined) { @@ -2245,7 +2167,7 @@ export const serializeAws_restXmlUpdateTrafficPolicyInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/2013-04-01/trafficpolicyinstance/{Id}"; if (input.Id !== undefined) { @@ -7684,11 +7606,11 @@ const deserializeAws_restXmlVPCAssociationNotFoundResponse = async ( const serializeAws_restXmlAlarmIdentifier = (input: AlarmIdentifier, context: __SerdeContext): any => { const bodyNode = new __XmlNode("AlarmIdentifier"); - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { const node = new __XmlNode("AlarmName").addChildNode(new __XmlText(input.Name)).withName("Name"); bodyNode.addChildNode(node); } - if (input.Region !== undefined) { + if (input.Region !== undefined && input.Region !== null) { const node = new __XmlNode("CloudWatchRegion").addChildNode(new __XmlText(input.Region)).withName("Region"); bodyNode.addChildNode(node); } @@ -7697,17 +7619,17 @@ const serializeAws_restXmlAlarmIdentifier = (input: AlarmIdentifier, context: __ const serializeAws_restXmlAliasTarget = (input: AliasTarget, context: __SerdeContext): any => { const bodyNode = new __XmlNode("AliasTarget"); - if (input.EvaluateTargetHealth !== undefined) { + if (input.EvaluateTargetHealth !== undefined && input.EvaluateTargetHealth !== null) { const node = new __XmlNode("AliasHealthEnabled") .addChildNode(new __XmlText(String(input.EvaluateTargetHealth))) .withName("EvaluateTargetHealth"); bodyNode.addChildNode(node); } - if (input.DNSName !== undefined) { + if (input.DNSName !== undefined && input.DNSName !== null) { const node = new __XmlNode("DNSName").addChildNode(new __XmlText(input.DNSName)).withName("DNSName"); bodyNode.addChildNode(node); } - if (input.HostedZoneId !== undefined) { + if (input.HostedZoneId !== undefined && input.HostedZoneId !== null) { const node = new __XmlNode("ResourceId").addChildNode(new __XmlText(input.HostedZoneId)).withName("HostedZoneId"); bodyNode.addChildNode(node); } @@ -7716,11 +7638,11 @@ const serializeAws_restXmlAliasTarget = (input: AliasTarget, context: __SerdeCon const serializeAws_restXmlChange = (input: Change, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Change"); - if (input.Action !== undefined) { + if (input.Action !== undefined && input.Action !== null) { const node = new __XmlNode("ChangeAction").addChildNode(new __XmlText(input.Action)).withName("Action"); bodyNode.addChildNode(node); } - if (input.ResourceRecordSet !== undefined) { + if (input.ResourceRecordSet !== undefined && input.ResourceRecordSet !== null) { const node = serializeAws_restXmlResourceRecordSet(input.ResourceRecordSet, context).withName("ResourceRecordSet"); bodyNode.addChildNode(node); } @@ -7729,11 +7651,11 @@ const serializeAws_restXmlChange = (input: Change, context: __SerdeContext): any const serializeAws_restXmlChangeBatch = (input: ChangeBatch, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ChangeBatch"); - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("ResourceDescription").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } - if (input.Changes !== undefined) { + if (input.Changes !== undefined && input.Changes !== null) { const nodes = serializeAws_restXmlChanges(input.Changes, context); const containerNode = new __XmlNode("Changes"); nodes.map((node: any) => { @@ -7745,34 +7667,44 @@ const serializeAws_restXmlChangeBatch = (input: ChangeBatch, context: __SerdeCon }; const serializeAws_restXmlChanges = (input: Change[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlChange(entry, context); - return node.withName("Change"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlChange(entry, context); + return node.withName("Change"); + }); }; const serializeAws_restXmlChildHealthCheckList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("HealthCheckId").addChildNode(new __XmlText(entry)); - return node.withName("ChildHealthCheck"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("HealthCheckId").addChildNode(new __XmlText(entry)); + return node.withName("ChildHealthCheck"); + }); }; const serializeAws_restXmlGeoLocation = (input: GeoLocation, context: __SerdeContext): any => { const bodyNode = new __XmlNode("GeoLocation"); - if (input.CountryCode !== undefined) { + if (input.CountryCode !== undefined && input.CountryCode !== null) { const node = new __XmlNode("GeoLocationCountryCode") .addChildNode(new __XmlText(input.CountryCode)) .withName("CountryCode"); bodyNode.addChildNode(node); } - if (input.ContinentCode !== undefined) { + if (input.ContinentCode !== undefined && input.ContinentCode !== null) { const node = new __XmlNode("GeoLocationContinentCode") .addChildNode(new __XmlText(input.ContinentCode)) .withName("ContinentCode"); bodyNode.addChildNode(node); } - if (input.SubdivisionCode !== undefined) { + if (input.SubdivisionCode !== undefined && input.SubdivisionCode !== null) { const node = new __XmlNode("GeoLocationSubdivisionCode") .addChildNode(new __XmlText(input.SubdivisionCode)) .withName("SubdivisionCode"); @@ -7783,43 +7715,43 @@ const serializeAws_restXmlGeoLocation = (input: GeoLocation, context: __SerdeCon const serializeAws_restXmlHealthCheckConfig = (input: HealthCheckConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("HealthCheckConfig"); - if (input.FailureThreshold !== undefined) { + if (input.FailureThreshold !== undefined && input.FailureThreshold !== null) { const node = new __XmlNode("FailureThreshold") .addChildNode(new __XmlText(String(input.FailureThreshold))) .withName("FailureThreshold"); bodyNode.addChildNode(node); } - if (input.InsufficientDataHealthStatus !== undefined) { + if (input.InsufficientDataHealthStatus !== undefined && input.InsufficientDataHealthStatus !== null) { const node = new __XmlNode("InsufficientDataHealthStatus") .addChildNode(new __XmlText(input.InsufficientDataHealthStatus)) .withName("InsufficientDataHealthStatus"); bodyNode.addChildNode(node); } - if (input.SearchString !== undefined) { + if (input.SearchString !== undefined && input.SearchString !== null) { const node = new __XmlNode("SearchString").addChildNode(new __XmlText(input.SearchString)).withName("SearchString"); bodyNode.addChildNode(node); } - if (input.RequestInterval !== undefined) { + if (input.RequestInterval !== undefined && input.RequestInterval !== null) { const node = new __XmlNode("RequestInterval") .addChildNode(new __XmlText(String(input.RequestInterval))) .withName("RequestInterval"); bodyNode.addChildNode(node); } - if (input.Inverted !== undefined) { + if (input.Inverted !== undefined && input.Inverted !== null) { const node = new __XmlNode("Inverted").addChildNode(new __XmlText(String(input.Inverted))).withName("Inverted"); bodyNode.addChildNode(node); } - if (input.FullyQualifiedDomainName !== undefined) { + if (input.FullyQualifiedDomainName !== undefined && input.FullyQualifiedDomainName !== null) { const node = new __XmlNode("FullyQualifiedDomainName") .addChildNode(new __XmlText(input.FullyQualifiedDomainName)) .withName("FullyQualifiedDomainName"); bodyNode.addChildNode(node); } - if (input.ResourcePath !== undefined) { + if (input.ResourcePath !== undefined && input.ResourcePath !== null) { const node = new __XmlNode("ResourcePath").addChildNode(new __XmlText(input.ResourcePath)).withName("ResourcePath"); bodyNode.addChildNode(node); } - if (input.Regions !== undefined) { + if (input.Regions !== undefined && input.Regions !== null) { const nodes = serializeAws_restXmlHealthCheckRegionList(input.Regions, context); const containerNode = new __XmlNode("Regions"); nodes.map((node: any) => { @@ -7827,33 +7759,33 @@ const serializeAws_restXmlHealthCheckConfig = (input: HealthCheckConfig, context }); bodyNode.addChildNode(containerNode); } - if (input.EnableSNI !== undefined) { + if (input.EnableSNI !== undefined && input.EnableSNI !== null) { const node = new __XmlNode("EnableSNI").addChildNode(new __XmlText(String(input.EnableSNI))).withName("EnableSNI"); bodyNode.addChildNode(node); } - if (input.AlarmIdentifier !== undefined) { + if (input.AlarmIdentifier !== undefined && input.AlarmIdentifier !== null) { const node = serializeAws_restXmlAlarmIdentifier(input.AlarmIdentifier, context).withName("AlarmIdentifier"); bodyNode.addChildNode(node); } - if (input.HealthThreshold !== undefined) { + if (input.HealthThreshold !== undefined && input.HealthThreshold !== null) { const node = new __XmlNode("HealthThreshold") .addChildNode(new __XmlText(String(input.HealthThreshold))) .withName("HealthThreshold"); bodyNode.addChildNode(node); } - if (input.IPAddress !== undefined) { + if (input.IPAddress !== undefined && input.IPAddress !== null) { const node = new __XmlNode("IPAddress").addChildNode(new __XmlText(input.IPAddress)).withName("IPAddress"); bodyNode.addChildNode(node); } - if (input.Disabled !== undefined) { + if (input.Disabled !== undefined && input.Disabled !== null) { const node = new __XmlNode("Disabled").addChildNode(new __XmlText(String(input.Disabled))).withName("Disabled"); bodyNode.addChildNode(node); } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { const node = new __XmlNode("HealthCheckType").addChildNode(new __XmlText(input.Type)).withName("Type"); bodyNode.addChildNode(node); } - if (input.ChildHealthChecks !== undefined) { + if (input.ChildHealthChecks !== undefined && input.ChildHealthChecks !== null) { const nodes = serializeAws_restXmlChildHealthCheckList(input.ChildHealthChecks, context); const containerNode = new __XmlNode("ChildHealthChecks"); nodes.map((node: any) => { @@ -7861,11 +7793,11 @@ const serializeAws_restXmlHealthCheckConfig = (input: HealthCheckConfig, context }); bodyNode.addChildNode(containerNode); } - if (input.Port !== undefined) { + if (input.Port !== undefined && input.Port !== null) { const node = new __XmlNode("Port").addChildNode(new __XmlText(String(input.Port))).withName("Port"); bodyNode.addChildNode(node); } - if (input.MeasureLatency !== undefined) { + if (input.MeasureLatency !== undefined && input.MeasureLatency !== null) { const node = new __XmlNode("MeasureLatency") .addChildNode(new __XmlText(String(input.MeasureLatency))) .withName("MeasureLatency"); @@ -7878,21 +7810,26 @@ const serializeAws_restXmlHealthCheckRegionList = ( input: (HealthCheckRegion | string)[], context: __SerdeContext ): any => { - return input.map((entry) => { - const node = new __XmlNode("HealthCheckRegion").addChildNode(new __XmlText(entry)); - return node.withName("Region"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("HealthCheckRegion").addChildNode(new __XmlText(entry)); + return node.withName("Region"); + }); }; const serializeAws_restXmlHostedZoneConfig = (input: HostedZoneConfig, context: __SerdeContext): any => { const bodyNode = new __XmlNode("HostedZoneConfig"); - if (input.PrivateZone !== undefined) { + if (input.PrivateZone !== undefined && input.PrivateZone !== null) { const node = new __XmlNode("IsPrivateZone") .addChildNode(new __XmlText(String(input.PrivateZone))) .withName("PrivateZone"); bodyNode.addChildNode(node); } - if (input.Comment !== undefined) { + if (input.Comment !== undefined && input.Comment !== null) { const node = new __XmlNode("ResourceDescription").addChildNode(new __XmlText(input.Comment)).withName("Comment"); bodyNode.addChildNode(node); } @@ -7903,15 +7840,20 @@ const serializeAws_restXmlResettableElementNameList = ( input: (ResettableElementName | string)[], context: __SerdeContext ): any => { - return input.map((entry) => { - const node = new __XmlNode("ResettableElementName").addChildNode(new __XmlText(entry)); - return node.withName("ResettableElementName"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("ResettableElementName").addChildNode(new __XmlText(entry)); + return node.withName("ResettableElementName"); + }); }; const serializeAws_restXmlResourceRecord = (input: ResourceRecord, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ResourceRecord"); - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { const node = new __XmlNode("RData").addChildNode(new __XmlText(input.Value)).withName("Value"); bodyNode.addChildNode(node); } @@ -7919,47 +7861,52 @@ const serializeAws_restXmlResourceRecord = (input: ResourceRecord, context: __Se }; const serializeAws_restXmlResourceRecords = (input: ResourceRecord[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlResourceRecord(entry, context); - return node.withName("ResourceRecord"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlResourceRecord(entry, context); + return node.withName("ResourceRecord"); + }); }; const serializeAws_restXmlResourceRecordSet = (input: ResourceRecordSet, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ResourceRecordSet"); - if (input.MultiValueAnswer !== undefined) { + if (input.MultiValueAnswer !== undefined && input.MultiValueAnswer !== null) { const node = new __XmlNode("ResourceRecordSetMultiValueAnswer") .addChildNode(new __XmlText(String(input.MultiValueAnswer))) .withName("MultiValueAnswer"); bodyNode.addChildNode(node); } - if (input.TTL !== undefined) { + if (input.TTL !== undefined && input.TTL !== null) { const node = new __XmlNode("TTL").addChildNode(new __XmlText(String(input.TTL))).withName("TTL"); bodyNode.addChildNode(node); } - if (input.Region !== undefined) { + if (input.Region !== undefined && input.Region !== null) { const node = new __XmlNode("ResourceRecordSetRegion").addChildNode(new __XmlText(input.Region)).withName("Region"); bodyNode.addChildNode(node); } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { const node = new __XmlNode("RRType").addChildNode(new __XmlText(input.Type)).withName("Type"); bodyNode.addChildNode(node); } - if (input.GeoLocation !== undefined) { + if (input.GeoLocation !== undefined && input.GeoLocation !== null) { const node = serializeAws_restXmlGeoLocation(input.GeoLocation, context).withName("GeoLocation"); bodyNode.addChildNode(node); } - if (input.AliasTarget !== undefined) { + if (input.AliasTarget !== undefined && input.AliasTarget !== null) { const node = serializeAws_restXmlAliasTarget(input.AliasTarget, context).withName("AliasTarget"); bodyNode.addChildNode(node); } - if (input.HealthCheckId !== undefined) { + if (input.HealthCheckId !== undefined && input.HealthCheckId !== null) { const node = new __XmlNode("HealthCheckId") .addChildNode(new __XmlText(input.HealthCheckId)) .withName("HealthCheckId"); bodyNode.addChildNode(node); } - if (input.ResourceRecords !== undefined) { + if (input.ResourceRecords !== undefined && input.ResourceRecords !== null) { const nodes = serializeAws_restXmlResourceRecords(input.ResourceRecords, context); const containerNode = new __XmlNode("ResourceRecords"); nodes.map((node: any) => { @@ -7967,29 +7914,29 @@ const serializeAws_restXmlResourceRecordSet = (input: ResourceRecordSet, context }); bodyNode.addChildNode(containerNode); } - if (input.SetIdentifier !== undefined) { + if (input.SetIdentifier !== undefined && input.SetIdentifier !== null) { const node = new __XmlNode("ResourceRecordSetIdentifier") .addChildNode(new __XmlText(input.SetIdentifier)) .withName("SetIdentifier"); bodyNode.addChildNode(node); } - if (input.Weight !== undefined) { + if (input.Weight !== undefined && input.Weight !== null) { const node = new __XmlNode("ResourceRecordSetWeight") .addChildNode(new __XmlText(String(input.Weight))) .withName("Weight"); bodyNode.addChildNode(node); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { const node = new __XmlNode("DNSName").addChildNode(new __XmlText(input.Name)).withName("Name"); bodyNode.addChildNode(node); } - if (input.TrafficPolicyInstanceId !== undefined) { + if (input.TrafficPolicyInstanceId !== undefined && input.TrafficPolicyInstanceId !== null) { const node = new __XmlNode("TrafficPolicyInstanceId") .addChildNode(new __XmlText(input.TrafficPolicyInstanceId)) .withName("TrafficPolicyInstanceId"); bodyNode.addChildNode(node); } - if (input.Failover !== undefined) { + if (input.Failover !== undefined && input.Failover !== null) { const node = new __XmlNode("ResourceRecordSetFailover") .addChildNode(new __XmlText(input.Failover)) .withName("Failover"); @@ -8000,11 +7947,11 @@ const serializeAws_restXmlResourceRecordSet = (input: ResourceRecordSet, context const serializeAws_restXmlTag = (input: Tag, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Tag"); - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { const node = new __XmlNode("TagValue").addChildNode(new __XmlText(input.Value)).withName("Value"); bodyNode.addChildNode(node); } - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { const node = new __XmlNode("TagKey").addChildNode(new __XmlText(input.Key)).withName("Key"); bodyNode.addChildNode(node); } @@ -8012,33 +7959,48 @@ const serializeAws_restXmlTag = (input: Tag, context: __SerdeContext): any => { }; const serializeAws_restXmlTagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("TagKey").addChildNode(new __XmlText(entry)); - return node.withName("Key"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("TagKey").addChildNode(new __XmlText(entry)); + return node.withName("Key"); + }); }; const serializeAws_restXmlTagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlTag(entry, context); - return node.withName("Tag"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlTag(entry, context); + return node.withName("Tag"); + }); }; const serializeAws_restXmlTagResourceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("TagResourceId").addChildNode(new __XmlText(entry)); - return node.withName("ResourceId"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("TagResourceId").addChildNode(new __XmlText(entry)); + return node.withName("ResourceId"); + }); }; const serializeAws_restXmlVPC = (input: VPC, context: __SerdeContext): any => { const bodyNode = new __XmlNode("VPC"); - if (input.VPCId !== undefined) { + if (input.VPCId !== undefined && input.VPCId !== null) { const node = new __XmlNode("VPCId").addChildNode(new __XmlText(input.VPCId)).withName("VPCId"); bodyNode.addChildNode(node); } - if (input.VPCRegion !== undefined) { + if (input.VPCRegion !== undefined && input.VPCRegion !== null) { const node = new __XmlNode("VPCRegion").addChildNode(new __XmlText(input.VPCRegion)).withName("VPCRegion"); bodyNode.addChildNode(node); } @@ -8114,11 +8076,25 @@ const deserializeAws_restXmlChangeInfo = (output: any, context: __SerdeContext): }; const deserializeAws_restXmlCheckerIpRanges = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlChildHealthCheckList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlCloudWatchAlarmConfiguration = ( @@ -8193,11 +8169,25 @@ const deserializeAws_restXmlDelegationSet = (output: any, context: __SerdeContex }; const deserializeAws_restXmlDelegationSetNameServers = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlDelegationSets = (output: any, context: __SerdeContext): DelegationSet[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlDelegationSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlDelegationSet(entry, context); + }); }; const deserializeAws_restXmlDimension = (output: any, context: __SerdeContext): Dimension => { @@ -8215,11 +8205,25 @@ const deserializeAws_restXmlDimension = (output: any, context: __SerdeContext): }; const deserializeAws_restXmlDimensionList = (output: any, context: __SerdeContext): Dimension[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlDimension(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlDimension(entry, context); + }); }; const deserializeAws_restXmlErrorMessages = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlGeoLocation = (output: any, context: __SerdeContext): GeoLocation => { @@ -8271,7 +8275,14 @@ const deserializeAws_restXmlGeoLocationDetails = (output: any, context: __SerdeC }; const deserializeAws_restXmlGeoLocationDetailsList = (output: any, context: __SerdeContext): GeoLocationDetails[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlGeoLocationDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlGeoLocationDetails(entry, context); + }); }; const deserializeAws_restXmlHealthCheck = (output: any, context: __SerdeContext): HealthCheck => { @@ -8415,18 +8426,39 @@ const deserializeAws_restXmlHealthCheckObservations = ( output: any, context: __SerdeContext ): HealthCheckObservation[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlHealthCheckObservation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlHealthCheckObservation(entry, context); + }); }; const deserializeAws_restXmlHealthCheckRegionList = ( output: any, context: __SerdeContext ): (HealthCheckRegion | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlHealthChecks = (output: any, context: __SerdeContext): HealthCheck[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlHealthCheck(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlHealthCheck(entry, context); + }); }; const deserializeAws_restXmlHostedZone = (output: any, context: __SerdeContext): HostedZone => { @@ -8502,11 +8534,25 @@ const deserializeAws_restXmlHostedZoneOwner = (output: any, context: __SerdeCont }; const deserializeAws_restXmlHostedZones = (output: any, context: __SerdeContext): HostedZone[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlHostedZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlHostedZone(entry, context); + }); }; const deserializeAws_restXmlHostedZoneSummaries = (output: any, context: __SerdeContext): HostedZoneSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlHostedZoneSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlHostedZoneSummary(entry, context); + }); }; const deserializeAws_restXmlHostedZoneSummary = (output: any, context: __SerdeContext): HostedZoneSummary => { @@ -8560,11 +8606,25 @@ const deserializeAws_restXmlQueryLoggingConfig = (output: any, context: __SerdeC }; const deserializeAws_restXmlQueryLoggingConfigs = (output: any, context: __SerdeContext): QueryLoggingConfig[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlQueryLoggingConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlQueryLoggingConfig(entry, context); + }); }; const deserializeAws_restXmlRecordData = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlResourceRecord = (output: any, context: __SerdeContext): ResourceRecord => { @@ -8578,7 +8638,14 @@ const deserializeAws_restXmlResourceRecord = (output: any, context: __SerdeConte }; const deserializeAws_restXmlResourceRecords = (output: any, context: __SerdeContext): ResourceRecord[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlResourceRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlResourceRecord(entry, context); + }); }; const deserializeAws_restXmlResourceRecordSet = (output: any, context: __SerdeContext): ResourceRecordSet => { @@ -8646,7 +8713,14 @@ const deserializeAws_restXmlResourceRecordSet = (output: any, context: __SerdeCo }; const deserializeAws_restXmlResourceRecordSets = (output: any, context: __SerdeContext): ResourceRecordSet[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlResourceRecordSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlResourceRecordSet(entry, context); + }); }; const deserializeAws_restXmlResourceTagSet = (output: any, context: __SerdeContext): ResourceTagSet => { @@ -8671,7 +8745,14 @@ const deserializeAws_restXmlResourceTagSet = (output: any, context: __SerdeConte }; const deserializeAws_restXmlResourceTagSetList = (output: any, context: __SerdeContext): ResourceTagSet[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlResourceTagSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlResourceTagSet(entry, context); + }); }; const deserializeAws_restXmlReusableDelegationSetLimit = ( @@ -8720,11 +8801,25 @@ const deserializeAws_restXmlTag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_restXmlTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTag(entry, context); + }); }; const deserializeAws_restXmlTrafficPolicies = (output: any, context: __SerdeContext): TrafficPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTrafficPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTrafficPolicy(entry, context); + }); }; const deserializeAws_restXmlTrafficPolicy = (output: any, context: __SerdeContext): TrafficPolicy => { @@ -8803,11 +8898,25 @@ const deserializeAws_restXmlTrafficPolicyInstances = ( output: any, context: __SerdeContext ): TrafficPolicyInstance[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTrafficPolicyInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTrafficPolicyInstance(entry, context); + }); }; const deserializeAws_restXmlTrafficPolicySummaries = (output: any, context: __SerdeContext): TrafficPolicySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTrafficPolicySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTrafficPolicySummary(entry, context); + }); }; const deserializeAws_restXmlTrafficPolicySummary = (output: any, context: __SerdeContext): TrafficPolicySummary => { @@ -8851,7 +8960,14 @@ const deserializeAws_restXmlVPC = (output: any, context: __SerdeContext): VPC => }; const deserializeAws_restXmlVPCs = (output: any, context: __SerdeContext): VPC[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlVPC(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlVPC(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -8874,6 +8990,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-route53resolver/protocols/Aws_json1_1.ts b/clients/client-route53resolver/protocols/Aws_json1_1.ts index 855a69594454..790d9575d14c 100644 --- a/clients/client-route53resolver/protocols/Aws_json1_1.ts +++ b/clients/client-route53resolver/protocols/Aws_json1_1.ts @@ -213,7 +213,7 @@ export const serializeAws_json1_1AssociateResolverEndpointIpAddressCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.AssociateResolverEndpointIpAddress", }; let body: any; @@ -226,7 +226,7 @@ export const serializeAws_json1_1AssociateResolverQueryLogConfigCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.AssociateResolverQueryLogConfig", }; let body: any; @@ -239,7 +239,7 @@ export const serializeAws_json1_1AssociateResolverRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.AssociateResolverRule", }; let body: any; @@ -252,7 +252,7 @@ export const serializeAws_json1_1CreateResolverEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.CreateResolverEndpoint", }; let body: any; @@ -265,7 +265,7 @@ export const serializeAws_json1_1CreateResolverQueryLogConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.CreateResolverQueryLogConfig", }; let body: any; @@ -278,7 +278,7 @@ export const serializeAws_json1_1CreateResolverRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.CreateResolverRule", }; let body: any; @@ -291,7 +291,7 @@ export const serializeAws_json1_1DeleteResolverEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.DeleteResolverEndpoint", }; let body: any; @@ -304,7 +304,7 @@ export const serializeAws_json1_1DeleteResolverQueryLogConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.DeleteResolverQueryLogConfig", }; let body: any; @@ -317,7 +317,7 @@ export const serializeAws_json1_1DeleteResolverRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.DeleteResolverRule", }; let body: any; @@ -330,7 +330,7 @@ export const serializeAws_json1_1DisassociateResolverEndpointIpAddressCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.DisassociateResolverEndpointIpAddress", }; let body: any; @@ -343,7 +343,7 @@ export const serializeAws_json1_1DisassociateResolverQueryLogConfigCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.DisassociateResolverQueryLogConfig", }; let body: any; @@ -356,7 +356,7 @@ export const serializeAws_json1_1DisassociateResolverRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.DisassociateResolverRule", }; let body: any; @@ -369,7 +369,7 @@ export const serializeAws_json1_1GetResolverEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.GetResolverEndpoint", }; let body: any; @@ -382,7 +382,7 @@ export const serializeAws_json1_1GetResolverQueryLogConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.GetResolverQueryLogConfig", }; let body: any; @@ -395,7 +395,7 @@ export const serializeAws_json1_1GetResolverQueryLogConfigAssociationCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.GetResolverQueryLogConfigAssociation", }; let body: any; @@ -408,7 +408,7 @@ export const serializeAws_json1_1GetResolverQueryLogConfigPolicyCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.GetResolverQueryLogConfigPolicy", }; let body: any; @@ -421,7 +421,7 @@ export const serializeAws_json1_1GetResolverRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.GetResolverRule", }; let body: any; @@ -434,7 +434,7 @@ export const serializeAws_json1_1GetResolverRuleAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.GetResolverRuleAssociation", }; let body: any; @@ -447,7 +447,7 @@ export const serializeAws_json1_1GetResolverRulePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.GetResolverRulePolicy", }; let body: any; @@ -460,7 +460,7 @@ export const serializeAws_json1_1ListResolverEndpointIpAddressesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.ListResolverEndpointIpAddresses", }; let body: any; @@ -473,7 +473,7 @@ export const serializeAws_json1_1ListResolverEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.ListResolverEndpoints", }; let body: any; @@ -486,7 +486,7 @@ export const serializeAws_json1_1ListResolverQueryLogConfigAssociationsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.ListResolverQueryLogConfigAssociations", }; let body: any; @@ -499,7 +499,7 @@ export const serializeAws_json1_1ListResolverQueryLogConfigsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.ListResolverQueryLogConfigs", }; let body: any; @@ -512,7 +512,7 @@ export const serializeAws_json1_1ListResolverRuleAssociationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.ListResolverRuleAssociations", }; let body: any; @@ -525,7 +525,7 @@ export const serializeAws_json1_1ListResolverRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.ListResolverRules", }; let body: any; @@ -538,7 +538,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.ListTagsForResource", }; let body: any; @@ -551,7 +551,7 @@ export const serializeAws_json1_1PutResolverQueryLogConfigPolicyCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.PutResolverQueryLogConfigPolicy", }; let body: any; @@ -564,7 +564,7 @@ export const serializeAws_json1_1PutResolverRulePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.PutResolverRulePolicy", }; let body: any; @@ -577,7 +577,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.TagResource", }; let body: any; @@ -590,7 +590,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.UntagResource", }; let body: any; @@ -603,7 +603,7 @@ export const serializeAws_json1_1UpdateResolverEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.UpdateResolverEndpoint", }; let body: any; @@ -616,7 +616,7 @@ export const serializeAws_json1_1UpdateResolverRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53Resolver.UpdateResolverRule", }; let body: any; @@ -651,8 +651,7 @@ const deserializeAws_json1_1AssociateResolverEndpointIpAddressCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -754,8 +753,7 @@ const deserializeAws_json1_1AssociateResolverQueryLogConfigCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -865,8 +863,7 @@ const deserializeAws_json1_1AssociateResolverRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -976,8 +973,7 @@ const deserializeAws_json1_1CreateResolverEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -1079,8 +1075,7 @@ const deserializeAws_json1_1CreateResolverQueryLogConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -1190,8 +1185,7 @@ const deserializeAws_json1_1CreateResolverRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -1301,8 +1295,7 @@ const deserializeAws_json1_1DeleteResolverEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -1388,8 +1381,7 @@ const deserializeAws_json1_1DeleteResolverQueryLogConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -1483,8 +1475,7 @@ const deserializeAws_json1_1DeleteResolverRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -1570,8 +1561,7 @@ const deserializeAws_json1_1DisassociateResolverEndpointIpAddressCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -1665,8 +1655,7 @@ const deserializeAws_json1_1DisassociateResolverQueryLogConfigCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -1760,8 +1749,7 @@ const deserializeAws_json1_1DisassociateResolverRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -1839,8 +1827,7 @@ const deserializeAws_json1_1GetResolverEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -1918,8 +1905,7 @@ const deserializeAws_json1_1GetResolverQueryLogConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -2013,8 +1999,7 @@ const deserializeAws_json1_1GetResolverQueryLogConfigAssociationCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -2108,8 +2093,7 @@ const deserializeAws_json1_1GetResolverQueryLogConfigPolicyCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -2195,8 +2179,7 @@ const deserializeAws_json1_1GetResolverRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -2274,8 +2257,7 @@ const deserializeAws_json1_1GetResolverRuleAssociationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -2353,8 +2335,7 @@ const deserializeAws_json1_1GetResolverRulePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -2424,8 +2405,7 @@ const deserializeAws_json1_1ListResolverEndpointIpAddressesCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -2511,8 +2491,7 @@ const deserializeAws_json1_1ListResolverEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -2598,8 +2577,7 @@ const deserializeAws_json1_1ListResolverQueryLogConfigAssociationsCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -2693,8 +2671,7 @@ const deserializeAws_json1_1ListResolverQueryLogConfigsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -2788,8 +2765,7 @@ const deserializeAws_json1_1ListResolverRuleAssociationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -2875,8 +2851,7 @@ const deserializeAws_json1_1ListResolverRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -2962,8 +2937,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -3057,8 +3031,7 @@ const deserializeAws_json1_1PutResolverQueryLogConfigPolicyCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": @@ -3152,8 +3125,7 @@ const deserializeAws_json1_1PutResolverRulePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -3231,8 +3203,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -3334,8 +3305,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -3421,8 +3391,7 @@ const deserializeAws_json1_1UpdateResolverEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -3508,8 +3477,7 @@ const deserializeAws_json1_1UpdateResolverRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": @@ -3799,8 +3767,10 @@ const serializeAws_json1_1AssociateResolverEndpointIpAddressRequest = ( context: __SerdeContext ): any => { return { - ...(input.IpAddress !== undefined && { IpAddress: serializeAws_json1_1IpAddressUpdate(input.IpAddress, context) }), - ...(input.ResolverEndpointId !== undefined && { ResolverEndpointId: input.ResolverEndpointId }), + ...(input.IpAddress !== undefined && + input.IpAddress !== null && { IpAddress: serializeAws_json1_1IpAddressUpdate(input.IpAddress, context) }), + ...(input.ResolverEndpointId !== undefined && + input.ResolverEndpointId !== null && { ResolverEndpointId: input.ResolverEndpointId }), }; }; @@ -3809,8 +3779,9 @@ const serializeAws_json1_1AssociateResolverQueryLogConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverQueryLogConfigId !== undefined && { ResolverQueryLogConfigId: input.ResolverQueryLogConfigId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResolverQueryLogConfigId !== undefined && + input.ResolverQueryLogConfigId !== null && { ResolverQueryLogConfigId: input.ResolverQueryLogConfigId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -3819,9 +3790,10 @@ const serializeAws_json1_1AssociateResolverRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ResolverRuleId !== undefined && { ResolverRuleId: input.ResolverRuleId }), - ...(input.VPCId !== undefined && { VPCId: input.VPCId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ResolverRuleId !== undefined && + input.ResolverRuleId !== null && { ResolverRuleId: input.ResolverRuleId }), + ...(input.VPCId !== undefined && input.VPCId !== null && { VPCId: input.VPCId }), }; }; @@ -3830,16 +3802,19 @@ const serializeAws_json1_1CreateResolverEndpointRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreatorRequestId !== undefined && { CreatorRequestId: input.CreatorRequestId }), - ...(input.Direction !== undefined && { Direction: input.Direction }), - ...(input.IpAddresses !== undefined && { - IpAddresses: serializeAws_json1_1IpAddressesRequest(input.IpAddresses, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CreatorRequestId !== undefined && + input.CreatorRequestId !== null && { CreatorRequestId: input.CreatorRequestId }), + ...(input.Direction !== undefined && input.Direction !== null && { Direction: input.Direction }), + ...(input.IpAddresses !== undefined && + input.IpAddresses !== null && { + IpAddresses: serializeAws_json1_1IpAddressesRequest(input.IpAddresses, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -3849,9 +3824,10 @@ const serializeAws_json1_1CreateResolverQueryLogConfigRequest = ( ): any => { return { CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), - ...(input.DestinationArn !== undefined && { DestinationArn: input.DestinationArn }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.DestinationArn !== undefined && + input.DestinationArn !== null && { DestinationArn: input.DestinationArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -3860,13 +3836,16 @@ const serializeAws_json1_1CreateResolverRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreatorRequestId !== undefined && { CreatorRequestId: input.CreatorRequestId }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ResolverEndpointId !== undefined && { ResolverEndpointId: input.ResolverEndpointId }), - ...(input.RuleType !== undefined && { RuleType: input.RuleType }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TargetIps !== undefined && { TargetIps: serializeAws_json1_1TargetList(input.TargetIps, context) }), + ...(input.CreatorRequestId !== undefined && + input.CreatorRequestId !== null && { CreatorRequestId: input.CreatorRequestId }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ResolverEndpointId !== undefined && + input.ResolverEndpointId !== null && { ResolverEndpointId: input.ResolverEndpointId }), + ...(input.RuleType !== undefined && input.RuleType !== null && { RuleType: input.RuleType }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TargetIps !== undefined && + input.TargetIps !== null && { TargetIps: serializeAws_json1_1TargetList(input.TargetIps, context) }), }; }; @@ -3875,7 +3854,8 @@ const serializeAws_json1_1DeleteResolverEndpointRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverEndpointId !== undefined && { ResolverEndpointId: input.ResolverEndpointId }), + ...(input.ResolverEndpointId !== undefined && + input.ResolverEndpointId !== null && { ResolverEndpointId: input.ResolverEndpointId }), }; }; @@ -3884,7 +3864,8 @@ const serializeAws_json1_1DeleteResolverQueryLogConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverQueryLogConfigId !== undefined && { ResolverQueryLogConfigId: input.ResolverQueryLogConfigId }), + ...(input.ResolverQueryLogConfigId !== undefined && + input.ResolverQueryLogConfigId !== null && { ResolverQueryLogConfigId: input.ResolverQueryLogConfigId }), }; }; @@ -3893,7 +3874,8 @@ const serializeAws_json1_1DeleteResolverRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverRuleId !== undefined && { ResolverRuleId: input.ResolverRuleId }), + ...(input.ResolverRuleId !== undefined && + input.ResolverRuleId !== null && { ResolverRuleId: input.ResolverRuleId }), }; }; @@ -3902,8 +3884,10 @@ const serializeAws_json1_1DisassociateResolverEndpointIpAddressRequest = ( context: __SerdeContext ): any => { return { - ...(input.IpAddress !== undefined && { IpAddress: serializeAws_json1_1IpAddressUpdate(input.IpAddress, context) }), - ...(input.ResolverEndpointId !== undefined && { ResolverEndpointId: input.ResolverEndpointId }), + ...(input.IpAddress !== undefined && + input.IpAddress !== null && { IpAddress: serializeAws_json1_1IpAddressUpdate(input.IpAddress, context) }), + ...(input.ResolverEndpointId !== undefined && + input.ResolverEndpointId !== null && { ResolverEndpointId: input.ResolverEndpointId }), }; }; @@ -3912,8 +3896,9 @@ const serializeAws_json1_1DisassociateResolverQueryLogConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverQueryLogConfigId !== undefined && { ResolverQueryLogConfigId: input.ResolverQueryLogConfigId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResolverQueryLogConfigId !== undefined && + input.ResolverQueryLogConfigId !== null && { ResolverQueryLogConfigId: input.ResolverQueryLogConfigId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -3922,24 +3907,40 @@ const serializeAws_json1_1DisassociateResolverRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverRuleId !== undefined && { ResolverRuleId: input.ResolverRuleId }), - ...(input.VPCId !== undefined && { VPCId: input.VPCId }), + ...(input.ResolverRuleId !== undefined && + input.ResolverRuleId !== null && { ResolverRuleId: input.ResolverRuleId }), + ...(input.VPCId !== undefined && input.VPCId !== null && { VPCId: input.VPCId }), }; }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), }; }; const serializeAws_json1_1Filters = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1FilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetResolverEndpointRequest = ( @@ -3947,7 +3948,8 @@ const serializeAws_json1_1GetResolverEndpointRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverEndpointId !== undefined && { ResolverEndpointId: input.ResolverEndpointId }), + ...(input.ResolverEndpointId !== undefined && + input.ResolverEndpointId !== null && { ResolverEndpointId: input.ResolverEndpointId }), }; }; @@ -3956,9 +3958,10 @@ const serializeAws_json1_1GetResolverQueryLogConfigAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverQueryLogConfigAssociationId !== undefined && { - ResolverQueryLogConfigAssociationId: input.ResolverQueryLogConfigAssociationId, - }), + ...(input.ResolverQueryLogConfigAssociationId !== undefined && + input.ResolverQueryLogConfigAssociationId !== null && { + ResolverQueryLogConfigAssociationId: input.ResolverQueryLogConfigAssociationId, + }), }; }; @@ -3967,7 +3970,7 @@ const serializeAws_json1_1GetResolverQueryLogConfigPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }; }; @@ -3976,7 +3979,8 @@ const serializeAws_json1_1GetResolverQueryLogConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverQueryLogConfigId !== undefined && { ResolverQueryLogConfigId: input.ResolverQueryLogConfigId }), + ...(input.ResolverQueryLogConfigId !== undefined && + input.ResolverQueryLogConfigId !== null && { ResolverQueryLogConfigId: input.ResolverQueryLogConfigId }), }; }; @@ -3985,9 +3989,8 @@ const serializeAws_json1_1GetResolverRuleAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResolverRuleAssociationId !== undefined && { - ResolverRuleAssociationId: input.ResolverRuleAssociationId, - }), + ...(input.ResolverRuleAssociationId !== undefined && + input.ResolverRuleAssociationId !== null && { ResolverRuleAssociationId: input.ResolverRuleAssociationId }), }; }; @@ -3996,32 +3999,40 @@ const serializeAws_json1_1GetResolverRulePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }; }; const serializeAws_json1_1GetResolverRuleRequest = (input: GetResolverRuleRequest, context: __SerdeContext): any => { return { - ...(input.ResolverRuleId !== undefined && { ResolverRuleId: input.ResolverRuleId }), + ...(input.ResolverRuleId !== undefined && + input.ResolverRuleId !== null && { ResolverRuleId: input.ResolverRuleId }), }; }; const serializeAws_json1_1IpAddressesRequest = (input: IpAddressRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1IpAddressRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1IpAddressRequest(entry, context); + }); }; const serializeAws_json1_1IpAddressRequest = (input: IpAddressRequest, context: __SerdeContext): any => { return { - ...(input.Ip !== undefined && { Ip: input.Ip }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), + ...(input.Ip !== undefined && input.Ip !== null && { Ip: input.Ip }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), }; }; const serializeAws_json1_1IpAddressUpdate = (input: IpAddressUpdate, context: __SerdeContext): any => { return { - ...(input.Ip !== undefined && { Ip: input.Ip }), - ...(input.IpId !== undefined && { IpId: input.IpId }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), + ...(input.Ip !== undefined && input.Ip !== null && { Ip: input.Ip }), + ...(input.IpId !== undefined && input.IpId !== null && { IpId: input.IpId }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), }; }; @@ -4030,9 +4041,10 @@ const serializeAws_json1_1ListResolverEndpointIpAddressesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResolverEndpointId !== undefined && { ResolverEndpointId: input.ResolverEndpointId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResolverEndpointId !== undefined && + input.ResolverEndpointId !== null && { ResolverEndpointId: input.ResolverEndpointId }), }; }; @@ -4041,9 +4053,10 @@ const serializeAws_json1_1ListResolverEndpointsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4052,11 +4065,12 @@ const serializeAws_json1_1ListResolverQueryLogConfigAssociationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -4065,11 +4079,12 @@ const serializeAws_json1_1ListResolverQueryLogConfigsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -4078,9 +4093,10 @@ const serializeAws_json1_1ListResolverRuleAssociationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4089,9 +4105,10 @@ const serializeAws_json1_1ListResolverRulesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1Filters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -4100,9 +4117,9 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -4111,10 +4128,11 @@ const serializeAws_json1_1PutResolverQueryLogConfigPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.ResolverQueryLogConfigPolicy !== undefined && { - ResolverQueryLogConfigPolicy: input.ResolverQueryLogConfigPolicy, - }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.ResolverQueryLogConfigPolicy !== undefined && + input.ResolverQueryLogConfigPolicy !== null && { + ResolverQueryLogConfigPolicy: input.ResolverQueryLogConfigPolicy, + }), }; }; @@ -4123,60 +4141,92 @@ const serializeAws_json1_1PutResolverRulePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.ResolverRulePolicy !== undefined && { ResolverRulePolicy: input.ResolverRulePolicy }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.ResolverRulePolicy !== undefined && + input.ResolverRulePolicy !== null && { ResolverRulePolicy: input.ResolverRulePolicy }), }; }; const serializeAws_json1_1ResolverRuleConfig = (input: ResolverRuleConfig, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ResolverEndpointId !== undefined && { ResolverEndpointId: input.ResolverEndpointId }), - ...(input.TargetIps !== undefined && { TargetIps: serializeAws_json1_1TargetList(input.TargetIps, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ResolverEndpointId !== undefined && + input.ResolverEndpointId !== null && { ResolverEndpointId: input.ResolverEndpointId }), + ...(input.TargetIps !== undefined && + input.TargetIps !== null && { TargetIps: serializeAws_json1_1TargetList(input.TargetIps, context) }), }; }; const serializeAws_json1_1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TargetAddress = (input: TargetAddress, context: __SerdeContext): any => { return { - ...(input.Ip !== undefined && { Ip: input.Ip }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Ip !== undefined && input.Ip !== null && { Ip: input.Ip }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; const serializeAws_json1_1TargetList = (input: TargetAddress[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TargetAddress(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TargetAddress(entry, context); + }); }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -4185,8 +4235,9 @@ const serializeAws_json1_1UpdateResolverEndpointRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ResolverEndpointId !== undefined && { ResolverEndpointId: input.ResolverEndpointId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ResolverEndpointId !== undefined && + input.ResolverEndpointId !== null && { ResolverEndpointId: input.ResolverEndpointId }), }; }; @@ -4195,8 +4246,10 @@ const serializeAws_json1_1UpdateResolverRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.Config !== undefined && { Config: serializeAws_json1_1ResolverRuleConfig(input.Config, context) }), - ...(input.ResolverRuleId !== undefined && { ResolverRuleId: input.ResolverRuleId }), + ...(input.Config !== undefined && + input.Config !== null && { Config: serializeAws_json1_1ResolverRuleConfig(input.Config, context) }), + ...(input.ResolverRuleId !== undefined && + input.ResolverRuleId !== null && { ResolverRuleId: input.ResolverRuleId }), }; }; @@ -4484,7 +4537,14 @@ const deserializeAws_json1_1InvalidTagException = (output: any, context: __Serde }; const deserializeAws_json1_1IpAddressesResponse = (output: any, context: __SerdeContext): IpAddressResponse[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IpAddressResponse(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IpAddressResponse(entry, context); + }); }; const deserializeAws_json1_1IpAddressResponse = (output: any, context: __SerdeContext): IpAddressResponse => { @@ -4659,7 +4719,14 @@ const deserializeAws_json1_1ResolverEndpoint = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ResolverEndpoints = (output: any, context: __SerdeContext): ResolverEndpoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResolverEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResolverEndpoint(entry, context); + }); }; const deserializeAws_json1_1ResolverQueryLogConfig = (output: any, context: __SerdeContext): ResolverQueryLogConfig => { @@ -4702,14 +4769,28 @@ const deserializeAws_json1_1ResolverQueryLogConfigAssociationList = ( output: any, context: __SerdeContext ): ResolverQueryLogConfigAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResolverQueryLogConfigAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResolverQueryLogConfigAssociation(entry, context); + }); }; const deserializeAws_json1_1ResolverQueryLogConfigList = ( output: any, context: __SerdeContext ): ResolverQueryLogConfig[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResolverQueryLogConfig(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResolverQueryLogConfig(entry, context); + }); }; const deserializeAws_json1_1ResolverRule = (output: any, context: __SerdeContext): ResolverRule => { @@ -4760,11 +4841,25 @@ const deserializeAws_json1_1ResolverRuleAssociations = ( output: any, context: __SerdeContext ): ResolverRuleAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResolverRuleAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResolverRuleAssociation(entry, context); + }); }; const deserializeAws_json1_1ResolverRules = (output: any, context: __SerdeContext): ResolverRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResolverRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResolverRule(entry, context); + }); }; const deserializeAws_json1_1ResourceExistsException = ( @@ -4805,7 +4900,14 @@ const deserializeAws_json1_1ResourceUnavailableException = ( }; const deserializeAws_json1_1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -4816,7 +4918,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -4831,7 +4940,14 @@ const deserializeAws_json1_1TargetAddress = (output: any, context: __SerdeContex }; const deserializeAws_json1_1TargetList = (output: any, context: __SerdeContext): TargetAddress[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TargetAddress(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TargetAddress(entry, context); + }); }; const deserializeAws_json1_1ThrottlingException = (output: any, context: __SerdeContext): ThrottlingException => { @@ -4927,3 +5043,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-s3-control/protocols/Aws_restXml.ts b/clients/client-s3-control/protocols/Aws_restXml.ts index 1e8e10bf8ac8..29ea54d321dc 100644 --- a/clients/client-s3-control/protocols/Aws_restXml.ts +++ b/clients/client-s3-control/protocols/Aws_restXml.ts @@ -193,7 +193,7 @@ export const serializeAws_restXmlCreateAccessPointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/accesspoint/{Name}"; @@ -254,7 +254,7 @@ export const serializeAws_restXmlCreateBucketCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ACL) && { "x-amz-acl": input.ACL! }), ...(isSerializableHeaderValue(input.GrantFullControl) && { "x-amz-grant-full-control": input.GrantFullControl! }), ...(isSerializableHeaderValue(input.GrantRead) && { "x-amz-grant-read": input.GrantRead! }), @@ -301,7 +301,7 @@ export const serializeAws_restXmlCreateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/jobs"; @@ -387,7 +387,6 @@ export const serializeAws_restXmlDeleteAccessPointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/accesspoint/{Name}"; @@ -429,7 +428,6 @@ export const serializeAws_restXmlDeleteAccessPointPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/accesspoint/{Name}/policy"; @@ -471,7 +469,6 @@ export const serializeAws_restXmlDeleteBucketCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}"; @@ -513,7 +510,6 @@ export const serializeAws_restXmlDeleteBucketLifecycleConfigurationCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}/lifecycleconfiguration"; @@ -555,7 +551,6 @@ export const serializeAws_restXmlDeleteBucketPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}/policy"; @@ -597,7 +592,6 @@ export const serializeAws_restXmlDeleteBucketTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}/tagging"; @@ -639,7 +633,6 @@ export const serializeAws_restXmlDeleteJobTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/jobs/{JobId}/tagging"; @@ -681,7 +674,6 @@ export const serializeAws_restXmlDeletePublicAccessBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/configuration/publicAccessBlock"; @@ -714,7 +706,6 @@ export const serializeAws_restXmlDeleteStorageLensConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/storagelens/{ConfigId}"; @@ -756,7 +747,6 @@ export const serializeAws_restXmlDeleteStorageLensConfigurationTaggingCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/storagelens/{ConfigId}/tagging"; @@ -798,7 +788,6 @@ export const serializeAws_restXmlDescribeJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/jobs/{JobId}"; @@ -840,7 +829,6 @@ export const serializeAws_restXmlGetAccessPointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/accesspoint/{Name}"; @@ -882,7 +870,6 @@ export const serializeAws_restXmlGetAccessPointPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/accesspoint/{Name}/policy"; @@ -924,7 +911,6 @@ export const serializeAws_restXmlGetAccessPointPolicyStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/accesspoint/{Name}/policyStatus"; @@ -966,7 +952,6 @@ export const serializeAws_restXmlGetBucketCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}"; @@ -1008,7 +993,6 @@ export const serializeAws_restXmlGetBucketLifecycleConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}/lifecycleconfiguration"; @@ -1050,7 +1034,6 @@ export const serializeAws_restXmlGetBucketPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}/policy"; @@ -1092,7 +1075,6 @@ export const serializeAws_restXmlGetBucketTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}/tagging"; @@ -1134,7 +1116,6 @@ export const serializeAws_restXmlGetJobTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/jobs/{JobId}/tagging"; @@ -1176,7 +1157,6 @@ export const serializeAws_restXmlGetPublicAccessBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/configuration/publicAccessBlock"; @@ -1209,7 +1189,6 @@ export const serializeAws_restXmlGetStorageLensConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/storagelens/{ConfigId}"; @@ -1251,7 +1230,6 @@ export const serializeAws_restXmlGetStorageLensConfigurationTaggingCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/storagelens/{ConfigId}/tagging"; @@ -1293,7 +1271,6 @@ export const serializeAws_restXmlListAccessPointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/accesspoint"; @@ -1332,7 +1309,6 @@ export const serializeAws_restXmlListJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/jobs"; @@ -1371,7 +1347,6 @@ export const serializeAws_restXmlListRegionalBucketsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), ...(isSerializableHeaderValue(input.OutpostId) && { "x-amz-outpost-id": input.OutpostId! }), }; @@ -1410,7 +1385,6 @@ export const serializeAws_restXmlListStorageLensConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/storagelens"; @@ -1447,7 +1421,7 @@ export const serializeAws_restXmlPutAccessPointPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/accesspoint/{Name}/policy"; @@ -1497,7 +1471,7 @@ export const serializeAws_restXmlPutBucketLifecycleConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}/lifecycleconfiguration"; @@ -1546,7 +1520,7 @@ export const serializeAws_restXmlPutBucketPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), ...(isSerializableHeaderValue(input.ConfirmRemoveSelfBucketAccess) && { "x-amz-confirm-remove-self-bucket-access": input.ConfirmRemoveSelfBucketAccess!.toString(), @@ -1599,7 +1573,7 @@ export const serializeAws_restXmlPutBucketTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/bucket/{Bucket}/tagging"; @@ -1648,7 +1622,7 @@ export const serializeAws_restXmlPutJobTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/jobs/{JobId}/tagging"; @@ -1702,7 +1676,7 @@ export const serializeAws_restXmlPutPublicAccessBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/configuration/publicAccessBlock"; @@ -1742,7 +1716,7 @@ export const serializeAws_restXmlPutStorageLensConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/storagelens/{ConfigId}"; @@ -1802,7 +1776,7 @@ export const serializeAws_restXmlPutStorageLensConfigurationTaggingCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/storagelens/{ConfigId}/tagging"; @@ -1856,7 +1830,6 @@ export const serializeAws_restXmlUpdateJobPriorityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/jobs/{JobId}/priority"; @@ -1902,7 +1875,6 @@ export const serializeAws_restXmlUpdateJobStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AccountId) && { "x-amz-account-id": input.AccountId! }), }; let resolvedPath = "/v20180820/jobs/{JobId}/status"; @@ -4265,7 +4237,7 @@ const serializeAws_restXmlAbortIncompleteMultipartUpload = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("AbortIncompleteMultipartUpload"); - if (input.DaysAfterInitiation !== undefined) { + if (input.DaysAfterInitiation !== undefined && input.DaysAfterInitiation !== null) { const node = new __XmlNode("DaysAfterInitiation") .addChildNode(new __XmlText(String(input.DaysAfterInitiation))) .withName("DaysAfterInitiation"); @@ -4276,11 +4248,11 @@ const serializeAws_restXmlAbortIncompleteMultipartUpload = ( const serializeAws_restXmlAccountLevel = (input: AccountLevel, context: __SerdeContext): any => { const bodyNode = new __XmlNode("AccountLevel"); - if (input.ActivityMetrics !== undefined) { + if (input.ActivityMetrics !== undefined && input.ActivityMetrics !== null) { const node = serializeAws_restXmlActivityMetrics(input.ActivityMetrics, context).withName("ActivityMetrics"); bodyNode.addChildNode(node); } - if (input.BucketLevel !== undefined) { + if (input.BucketLevel !== undefined && input.BucketLevel !== null) { const node = serializeAws_restXmlBucketLevel(input.BucketLevel, context).withName("BucketLevel"); bodyNode.addChildNode(node); } @@ -4289,7 +4261,7 @@ const serializeAws_restXmlAccountLevel = (input: AccountLevel, context: __SerdeC const serializeAws_restXmlActivityMetrics = (input: ActivityMetrics, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ActivityMetrics"); - if (input.IsEnabled !== undefined) { + if (input.IsEnabled !== undefined && input.IsEnabled !== null) { const node = new __XmlNode("IsEnabled").addChildNode(new __XmlText(String(input.IsEnabled))).withName("IsEnabled"); bodyNode.addChildNode(node); } @@ -4298,11 +4270,11 @@ const serializeAws_restXmlActivityMetrics = (input: ActivityMetrics, context: __ const serializeAws_restXmlBucketLevel = (input: BucketLevel, context: __SerdeContext): any => { const bodyNode = new __XmlNode("BucketLevel"); - if (input.ActivityMetrics !== undefined) { + if (input.ActivityMetrics !== undefined && input.ActivityMetrics !== null) { const node = serializeAws_restXmlActivityMetrics(input.ActivityMetrics, context).withName("ActivityMetrics"); bodyNode.addChildNode(node); } - if (input.PrefixLevel !== undefined) { + if (input.PrefixLevel !== undefined && input.PrefixLevel !== null) { const node = serializeAws_restXmlPrefixLevel(input.PrefixLevel, context).withName("PrefixLevel"); bodyNode.addChildNode(node); } @@ -4310,10 +4282,15 @@ const serializeAws_restXmlBucketLevel = (input: BucketLevel, context: __SerdeCon }; const serializeAws_restXmlBuckets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("S3BucketArnString").addChildNode(new __XmlText(entry)); - return node.withName("Arn"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("S3BucketArnString").addChildNode(new __XmlText(entry)); + return node.withName("Arn"); + }); }; const serializeAws_restXmlCreateBucketConfiguration = ( @@ -4321,7 +4298,7 @@ const serializeAws_restXmlCreateBucketConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("CreateBucketConfiguration"); - if (input.LocationConstraint !== undefined) { + if (input.LocationConstraint !== undefined && input.LocationConstraint !== null) { const node = new __XmlNode("BucketLocationConstraint") .addChildNode(new __XmlText(input.LocationConstraint)) .withName("LocationConstraint"); @@ -4332,7 +4309,7 @@ const serializeAws_restXmlCreateBucketConfiguration = ( const serializeAws_restXml_Exclude = (input: _Exclude, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Exclude"); - if (input.Buckets !== undefined) { + if (input.Buckets !== undefined && input.Buckets !== null) { const nodes = serializeAws_restXmlBuckets(input.Buckets, context); const containerNode = new __XmlNode("Buckets"); nodes.map((node: any) => { @@ -4340,7 +4317,7 @@ const serializeAws_restXml_Exclude = (input: _Exclude, context: __SerdeContext): }); bodyNode.addChildNode(containerNode); } - if (input.Regions !== undefined) { + if (input.Regions !== undefined && input.Regions !== null) { const nodes = serializeAws_restXmlRegions(input.Regions, context); const containerNode = new __XmlNode("Regions"); nodes.map((node: any) => { @@ -4353,7 +4330,7 @@ const serializeAws_restXml_Exclude = (input: _Exclude, context: __SerdeContext): const serializeAws_restXmlInclude = (input: Include, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Include"); - if (input.Buckets !== undefined) { + if (input.Buckets !== undefined && input.Buckets !== null) { const nodes = serializeAws_restXmlBuckets(input.Buckets, context); const containerNode = new __XmlNode("Buckets"); nodes.map((node: any) => { @@ -4361,7 +4338,7 @@ const serializeAws_restXmlInclude = (input: Include, context: __SerdeContext): a }); bodyNode.addChildNode(containerNode); } - if (input.Regions !== undefined) { + if (input.Regions !== undefined && input.Regions !== null) { const nodes = serializeAws_restXmlRegions(input.Regions, context); const containerNode = new __XmlNode("Regions"); nodes.map((node: any) => { @@ -4374,11 +4351,11 @@ const serializeAws_restXmlInclude = (input: Include, context: __SerdeContext): a const serializeAws_restXmlJobManifest = (input: JobManifest, context: __SerdeContext): any => { const bodyNode = new __XmlNode("JobManifest"); - if (input.Spec !== undefined) { + if (input.Spec !== undefined && input.Spec !== null) { const node = serializeAws_restXmlJobManifestSpec(input.Spec, context).withName("Spec"); bodyNode.addChildNode(node); } - if (input.Location !== undefined) { + if (input.Location !== undefined && input.Location !== null) { const node = serializeAws_restXmlJobManifestLocation(input.Location, context).withName("Location"); bodyNode.addChildNode(node); } @@ -4389,25 +4366,30 @@ const serializeAws_restXmlJobManifestFieldList = ( input: (JobManifestFieldName | string)[], context: __SerdeContext ): any => { - return input.map((entry) => { - const node = new __XmlNode("JobManifestFieldName").addChildNode(new __XmlText(entry)); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("JobManifestFieldName").addChildNode(new __XmlText(entry)); + return node.withName("member"); + }); }; const serializeAws_restXmlJobManifestLocation = (input: JobManifestLocation, context: __SerdeContext): any => { const bodyNode = new __XmlNode("JobManifestLocation"); - if (input.ObjectArn !== undefined) { + if (input.ObjectArn !== undefined && input.ObjectArn !== null) { const node = new __XmlNode("S3KeyArnString").addChildNode(new __XmlText(input.ObjectArn)).withName("ObjectArn"); bodyNode.addChildNode(node); } - if (input.ObjectVersionId !== undefined) { + if (input.ObjectVersionId !== undefined && input.ObjectVersionId !== null) { const node = new __XmlNode("S3ObjectVersionId") .addChildNode(new __XmlText(input.ObjectVersionId)) .withName("ObjectVersionId"); bodyNode.addChildNode(node); } - if (input.ETag !== undefined) { + if (input.ETag !== undefined && input.ETag !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String").addChildNode(new __XmlText(input.ETag)).withName("ETag"); bodyNode.addChildNode(node); } @@ -4416,11 +4398,11 @@ const serializeAws_restXmlJobManifestLocation = (input: JobManifestLocation, con const serializeAws_restXmlJobManifestSpec = (input: JobManifestSpec, context: __SerdeContext): any => { const bodyNode = new __XmlNode("JobManifestSpec"); - if (input.Format !== undefined) { + if (input.Format !== undefined && input.Format !== null) { const node = new __XmlNode("JobManifestFormat").addChildNode(new __XmlText(input.Format)).withName("Format"); bodyNode.addChildNode(node); } - if (input.Fields !== undefined) { + if (input.Fields !== undefined && input.Fields !== null) { const nodes = serializeAws_restXmlJobManifestFieldList(input.Fields, context); const containerNode = new __XmlNode("Fields"); nodes.map((node: any) => { @@ -4433,37 +4415,37 @@ const serializeAws_restXmlJobManifestSpec = (input: JobManifestSpec, context: __ const serializeAws_restXmlJobOperation = (input: JobOperation, context: __SerdeContext): any => { const bodyNode = new __XmlNode("JobOperation"); - if (input.LambdaInvoke !== undefined) { + if (input.LambdaInvoke !== undefined && input.LambdaInvoke !== null) { const node = serializeAws_restXmlLambdaInvokeOperation(input.LambdaInvoke, context).withName("LambdaInvoke"); bodyNode.addChildNode(node); } - if (input.S3PutObjectCopy !== undefined) { + if (input.S3PutObjectCopy !== undefined && input.S3PutObjectCopy !== null) { const node = serializeAws_restXmlS3CopyObjectOperation(input.S3PutObjectCopy, context).withName("S3PutObjectCopy"); bodyNode.addChildNode(node); } - if (input.S3PutObjectAcl !== undefined) { + if (input.S3PutObjectAcl !== undefined && input.S3PutObjectAcl !== null) { const node = serializeAws_restXmlS3SetObjectAclOperation(input.S3PutObjectAcl, context).withName("S3PutObjectAcl"); bodyNode.addChildNode(node); } - if (input.S3PutObjectTagging !== undefined) { + if (input.S3PutObjectTagging !== undefined && input.S3PutObjectTagging !== null) { const node = serializeAws_restXmlS3SetObjectTaggingOperation(input.S3PutObjectTagging, context).withName( "S3PutObjectTagging" ); bodyNode.addChildNode(node); } - if (input.S3InitiateRestoreObject !== undefined) { + if (input.S3InitiateRestoreObject !== undefined && input.S3InitiateRestoreObject !== null) { const node = serializeAws_restXmlS3InitiateRestoreObjectOperation(input.S3InitiateRestoreObject, context).withName( "S3InitiateRestoreObject" ); bodyNode.addChildNode(node); } - if (input.S3PutObjectLegalHold !== undefined) { + if (input.S3PutObjectLegalHold !== undefined && input.S3PutObjectLegalHold !== null) { const node = serializeAws_restXmlS3SetObjectLegalHoldOperation(input.S3PutObjectLegalHold, context).withName( "S3PutObjectLegalHold" ); bodyNode.addChildNode(node); } - if (input.S3PutObjectRetention !== undefined) { + if (input.S3PutObjectRetention !== undefined && input.S3PutObjectRetention !== null) { const node = serializeAws_restXmlS3SetObjectRetentionOperation(input.S3PutObjectRetention, context).withName( "S3PutObjectRetention" ); @@ -4474,23 +4456,23 @@ const serializeAws_restXmlJobOperation = (input: JobOperation, context: __SerdeC const serializeAws_restXmlJobReport = (input: JobReport, context: __SerdeContext): any => { const bodyNode = new __XmlNode("JobReport"); - if (input.Bucket !== undefined) { + if (input.Bucket !== undefined && input.Bucket !== null) { const node = new __XmlNode("S3BucketArnString").addChildNode(new __XmlText(input.Bucket)).withName("Bucket"); bodyNode.addChildNode(node); } - if (input.Format !== undefined) { + if (input.Format !== undefined && input.Format !== null) { const node = new __XmlNode("JobReportFormat").addChildNode(new __XmlText(input.Format)).withName("Format"); bodyNode.addChildNode(node); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { const node = new __XmlNode("Boolean").addChildNode(new __XmlText(String(input.Enabled))).withName("Enabled"); bodyNode.addChildNode(node); } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("ReportPrefixString").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.ReportScope !== undefined) { + if (input.ReportScope !== undefined && input.ReportScope !== null) { const node = new __XmlNode("JobReportScope").addChildNode(new __XmlText(input.ReportScope)).withName("ReportScope"); bodyNode.addChildNode(node); } @@ -4499,7 +4481,7 @@ const serializeAws_restXmlJobReport = (input: JobReport, context: __SerdeContext const serializeAws_restXmlLambdaInvokeOperation = (input: LambdaInvokeOperation, context: __SerdeContext): any => { const bodyNode = new __XmlNode("LambdaInvokeOperation"); - if (input.FunctionArn !== undefined) { + if (input.FunctionArn !== undefined && input.FunctionArn !== null) { const node = new __XmlNode("FunctionArnString") .addChildNode(new __XmlText(input.FunctionArn)) .withName("FunctionArn"); @@ -4510,7 +4492,7 @@ const serializeAws_restXmlLambdaInvokeOperation = (input: LambdaInvokeOperation, const serializeAws_restXmlLifecycleConfiguration = (input: LifecycleConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("LifecycleConfiguration"); - if (input.Rules !== undefined) { + if (input.Rules !== undefined && input.Rules !== null) { const nodes = serializeAws_restXmlLifecycleRules(input.Rules, context); const containerNode = new __XmlNode("Rules"); nodes.map((node: any) => { @@ -4523,17 +4505,17 @@ const serializeAws_restXmlLifecycleConfiguration = (input: LifecycleConfiguratio const serializeAws_restXmlLifecycleExpiration = (input: LifecycleExpiration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("LifecycleExpiration"); - if (input.Date !== undefined) { + if (input.Date !== undefined && input.Date !== null) { const node = new __XmlNode("Date") .addChildNode(new __XmlText(input.Date.toISOString().split(".")[0] + "Z")) .withName("Date"); bodyNode.addChildNode(node); } - if (input.Days !== undefined) { + if (input.Days !== undefined && input.Days !== null) { const node = new __XmlNode("Days").addChildNode(new __XmlText(String(input.Days))).withName("Days"); bodyNode.addChildNode(node); } - if (input.ExpiredObjectDeleteMarker !== undefined) { + if (input.ExpiredObjectDeleteMarker !== undefined && input.ExpiredObjectDeleteMarker !== null) { const node = new __XmlNode("ExpiredObjectDeleteMarker") .addChildNode(new __XmlText(String(input.ExpiredObjectDeleteMarker))) .withName("ExpiredObjectDeleteMarker"); @@ -4544,23 +4526,23 @@ const serializeAws_restXmlLifecycleExpiration = (input: LifecycleExpiration, con const serializeAws_restXmlLifecycleRule = (input: LifecycleRule, context: __SerdeContext): any => { const bodyNode = new __XmlNode("LifecycleRule"); - if (input.Expiration !== undefined) { + if (input.Expiration !== undefined && input.Expiration !== null) { const node = serializeAws_restXmlLifecycleExpiration(input.Expiration, context).withName("Expiration"); bodyNode.addChildNode(node); } - if (input.ID !== undefined) { + if (input.ID !== undefined && input.ID !== null) { const node = new __XmlNode("ID").addChildNode(new __XmlText(input.ID)).withName("ID"); bodyNode.addChildNode(node); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlLifecycleRuleFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("ExpirationStatus").addChildNode(new __XmlText(input.Status)).withName("Status"); bodyNode.addChildNode(node); } - if (input.Transitions !== undefined) { + if (input.Transitions !== undefined && input.Transitions !== null) { const nodes = serializeAws_restXmlTransitionList(input.Transitions, context); const containerNode = new __XmlNode("Transitions"); nodes.map((node: any) => { @@ -4568,7 +4550,7 @@ const serializeAws_restXmlLifecycleRule = (input: LifecycleRule, context: __Serd }); bodyNode.addChildNode(containerNode); } - if (input.NoncurrentVersionTransitions !== undefined) { + if (input.NoncurrentVersionTransitions !== undefined && input.NoncurrentVersionTransitions !== null) { const nodes = serializeAws_restXmlNoncurrentVersionTransitionList(input.NoncurrentVersionTransitions, context); const containerNode = new __XmlNode("NoncurrentVersionTransitions"); nodes.map((node: any) => { @@ -4576,13 +4558,13 @@ const serializeAws_restXmlLifecycleRule = (input: LifecycleRule, context: __Serd }); bodyNode.addChildNode(containerNode); } - if (input.NoncurrentVersionExpiration !== undefined) { + if (input.NoncurrentVersionExpiration !== undefined && input.NoncurrentVersionExpiration !== null) { const node = serializeAws_restXmlNoncurrentVersionExpiration(input.NoncurrentVersionExpiration, context).withName( "NoncurrentVersionExpiration" ); bodyNode.addChildNode(node); } - if (input.AbortIncompleteMultipartUpload !== undefined) { + if (input.AbortIncompleteMultipartUpload !== undefined && input.AbortIncompleteMultipartUpload !== null) { const node = serializeAws_restXmlAbortIncompleteMultipartUpload( input.AbortIncompleteMultipartUpload, context @@ -4597,11 +4579,11 @@ const serializeAws_restXmlLifecycleRuleAndOperator = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("LifecycleRuleAndOperator"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const nodes = serializeAws_restXmlS3TagSet(input.Tags, context); const containerNode = new __XmlNode("Tags"); nodes.map((node: any) => { @@ -4614,15 +4596,15 @@ const serializeAws_restXmlLifecycleRuleAndOperator = ( const serializeAws_restXmlLifecycleRuleFilter = (input: LifecycleRuleFilter, context: __SerdeContext): any => { const bodyNode = new __XmlNode("LifecycleRuleFilter"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Tag !== undefined) { + if (input.Tag !== undefined && input.Tag !== null) { const node = serializeAws_restXmlS3Tag(input.Tag, context).withName("Tag"); bodyNode.addChildNode(node); } - if (input.And !== undefined) { + if (input.And !== undefined && input.And !== null) { const node = serializeAws_restXmlLifecycleRuleAndOperator(input.And, context).withName("And"); bodyNode.addChildNode(node); } @@ -4630,10 +4612,15 @@ const serializeAws_restXmlLifecycleRuleFilter = (input: LifecycleRuleFilter, con }; const serializeAws_restXmlLifecycleRules = (input: LifecycleRule[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlLifecycleRule(entry, context); - return node.withName("Rule"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlLifecycleRule(entry, context); + return node.withName("Rule"); + }); }; const serializeAws_restXmlNoncurrentVersionExpiration = ( @@ -4641,7 +4628,7 @@ const serializeAws_restXmlNoncurrentVersionExpiration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("NoncurrentVersionExpiration"); - if (input.NoncurrentDays !== undefined) { + if (input.NoncurrentDays !== undefined && input.NoncurrentDays !== null) { const node = new __XmlNode("Days") .addChildNode(new __XmlText(String(input.NoncurrentDays))) .withName("NoncurrentDays"); @@ -4655,13 +4642,13 @@ const serializeAws_restXmlNoncurrentVersionTransition = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("NoncurrentVersionTransition"); - if (input.NoncurrentDays !== undefined) { + if (input.NoncurrentDays !== undefined && input.NoncurrentDays !== null) { const node = new __XmlNode("Days") .addChildNode(new __XmlText(String(input.NoncurrentDays))) .withName("NoncurrentDays"); bodyNode.addChildNode(node); } - if (input.StorageClass !== undefined) { + if (input.StorageClass !== undefined && input.StorageClass !== null) { const node = new __XmlNode("TransitionStorageClass") .addChildNode(new __XmlText(input.StorageClass)) .withName("StorageClass"); @@ -4674,15 +4661,20 @@ const serializeAws_restXmlNoncurrentVersionTransitionList = ( input: NoncurrentVersionTransition[], context: __SerdeContext ): any => { - return input.map((entry) => { - const node = serializeAws_restXmlNoncurrentVersionTransition(entry, context); - return node.withName("NoncurrentVersionTransition"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlNoncurrentVersionTransition(entry, context); + return node.withName("NoncurrentVersionTransition"); + }); }; const serializeAws_restXmlPrefixLevel = (input: PrefixLevel, context: __SerdeContext): any => { const bodyNode = new __XmlNode("PrefixLevel"); - if (input.StorageMetrics !== undefined) { + if (input.StorageMetrics !== undefined && input.StorageMetrics !== null) { const node = serializeAws_restXmlPrefixLevelStorageMetrics(input.StorageMetrics, context).withName( "StorageMetrics" ); @@ -4696,11 +4688,11 @@ const serializeAws_restXmlPrefixLevelStorageMetrics = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("PrefixLevelStorageMetrics"); - if (input.IsEnabled !== undefined) { + if (input.IsEnabled !== undefined && input.IsEnabled !== null) { const node = new __XmlNode("IsEnabled").addChildNode(new __XmlText(String(input.IsEnabled))).withName("IsEnabled"); bodyNode.addChildNode(node); } - if (input.SelectionCriteria !== undefined) { + if (input.SelectionCriteria !== undefined && input.SelectionCriteria !== null) { const node = serializeAws_restXmlSelectionCriteria(input.SelectionCriteria, context).withName("SelectionCriteria"); bodyNode.addChildNode(node); } @@ -4712,25 +4704,25 @@ const serializeAws_restXmlPublicAccessBlockConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("PublicAccessBlockConfiguration"); - if (input.BlockPublicAcls !== undefined) { + if (input.BlockPublicAcls !== undefined && input.BlockPublicAcls !== null) { const node = new __XmlNode("Setting") .addChildNode(new __XmlText(String(input.BlockPublicAcls))) .withName("BlockPublicAcls"); bodyNode.addChildNode(node); } - if (input.IgnorePublicAcls !== undefined) { + if (input.IgnorePublicAcls !== undefined && input.IgnorePublicAcls !== null) { const node = new __XmlNode("Setting") .addChildNode(new __XmlText(String(input.IgnorePublicAcls))) .withName("IgnorePublicAcls"); bodyNode.addChildNode(node); } - if (input.BlockPublicPolicy !== undefined) { + if (input.BlockPublicPolicy !== undefined && input.BlockPublicPolicy !== null) { const node = new __XmlNode("Setting") .addChildNode(new __XmlText(String(input.BlockPublicPolicy))) .withName("BlockPublicPolicy"); bodyNode.addChildNode(node); } - if (input.RestrictPublicBuckets !== undefined) { + if (input.RestrictPublicBuckets !== undefined && input.RestrictPublicBuckets !== null) { const node = new __XmlNode("Setting") .addChildNode(new __XmlText(String(input.RestrictPublicBuckets))) .withName("RestrictPublicBuckets"); @@ -4740,19 +4732,24 @@ const serializeAws_restXmlPublicAccessBlockConfiguration = ( }; const serializeAws_restXmlRegions = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("S3AWSRegion").addChildNode(new __XmlText(entry)); - return node.withName("Region"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("S3AWSRegion").addChildNode(new __XmlText(entry)); + return node.withName("Region"); + }); }; const serializeAws_restXmlS3AccessControlList = (input: S3AccessControlList, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3AccessControlList"); - if (input.Owner !== undefined) { + if (input.Owner !== undefined && input.Owner !== null) { const node = serializeAws_restXmlS3ObjectOwner(input.Owner, context).withName("Owner"); bodyNode.addChildNode(node); } - if (input.Grants !== undefined) { + if (input.Grants !== undefined && input.Grants !== null) { const nodes = serializeAws_restXmlS3GrantList(input.Grants, context); const containerNode = new __XmlNode("Grants"); nodes.map((node: any) => { @@ -4765,13 +4762,13 @@ const serializeAws_restXmlS3AccessControlList = (input: S3AccessControlList, con const serializeAws_restXmlS3AccessControlPolicy = (input: S3AccessControlPolicy, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3AccessControlPolicy"); - if (input.AccessControlList !== undefined) { + if (input.AccessControlList !== undefined && input.AccessControlList !== null) { const node = serializeAws_restXmlS3AccessControlList(input.AccessControlList, context).withName( "AccessControlList" ); bodyNode.addChildNode(node); } - if (input.CannedAccessControlList !== undefined) { + if (input.CannedAccessControlList !== undefined && input.CannedAccessControlList !== null) { const node = new __XmlNode("S3CannedAccessControlList") .addChildNode(new __XmlText(input.CannedAccessControlList)) .withName("CannedAccessControlList"); @@ -4782,29 +4779,29 @@ const serializeAws_restXmlS3AccessControlPolicy = (input: S3AccessControlPolicy, const serializeAws_restXmlS3BucketDestination = (input: S3BucketDestination, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3BucketDestination"); - if (input.Format !== undefined) { + if (input.Format !== undefined && input.Format !== null) { const node = new __XmlNode("Format").addChildNode(new __XmlText(input.Format)).withName("Format"); bodyNode.addChildNode(node); } - if (input.OutputSchemaVersion !== undefined) { + if (input.OutputSchemaVersion !== undefined && input.OutputSchemaVersion !== null) { const node = new __XmlNode("OutputSchemaVersion") .addChildNode(new __XmlText(input.OutputSchemaVersion)) .withName("OutputSchemaVersion"); bodyNode.addChildNode(node); } - if (input.AccountId !== undefined) { + if (input.AccountId !== undefined && input.AccountId !== null) { const node = new __XmlNode("AccountId").addChildNode(new __XmlText(input.AccountId)).withName("AccountId"); bodyNode.addChildNode(node); } - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { const node = new __XmlNode("S3BucketArnString").addChildNode(new __XmlText(input.Arn)).withName("Arn"); bodyNode.addChildNode(node); } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Encryption !== undefined) { + if (input.Encryption !== undefined && input.Encryption !== null) { const node = serializeAws_restXmlStorageLensDataExportEncryption(input.Encryption, context).withName("Encryption"); bodyNode.addChildNode(node); } @@ -4813,19 +4810,19 @@ const serializeAws_restXmlS3BucketDestination = (input: S3BucketDestination, con const serializeAws_restXmlS3CopyObjectOperation = (input: S3CopyObjectOperation, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3CopyObjectOperation"); - if (input.TargetResource !== undefined) { + if (input.TargetResource !== undefined && input.TargetResource !== null) { const node = new __XmlNode("S3BucketArnString") .addChildNode(new __XmlText(input.TargetResource)) .withName("TargetResource"); bodyNode.addChildNode(node); } - if (input.CannedAccessControlList !== undefined) { + if (input.CannedAccessControlList !== undefined && input.CannedAccessControlList !== null) { const node = new __XmlNode("S3CannedAccessControlList") .addChildNode(new __XmlText(input.CannedAccessControlList)) .withName("CannedAccessControlList"); bodyNode.addChildNode(node); } - if (input.AccessControlGrants !== undefined) { + if (input.AccessControlGrants !== undefined && input.AccessControlGrants !== null) { const nodes = serializeAws_restXmlS3GrantList(input.AccessControlGrants, context); const containerNode = new __XmlNode("AccessControlGrants"); nodes.map((node: any) => { @@ -4833,23 +4830,23 @@ const serializeAws_restXmlS3CopyObjectOperation = (input: S3CopyObjectOperation, }); bodyNode.addChildNode(containerNode); } - if (input.MetadataDirective !== undefined) { + if (input.MetadataDirective !== undefined && input.MetadataDirective !== null) { const node = new __XmlNode("S3MetadataDirective") .addChildNode(new __XmlText(input.MetadataDirective)) .withName("MetadataDirective"); bodyNode.addChildNode(node); } - if (input.ModifiedSinceConstraint !== undefined) { + if (input.ModifiedSinceConstraint !== undefined && input.ModifiedSinceConstraint !== null) { const node = new __XmlNode("TimeStamp") .addChildNode(new __XmlText(input.ModifiedSinceConstraint.toISOString().split(".")[0] + "Z")) .withName("ModifiedSinceConstraint"); bodyNode.addChildNode(node); } - if (input.NewObjectMetadata !== undefined) { + if (input.NewObjectMetadata !== undefined && input.NewObjectMetadata !== null) { const node = serializeAws_restXmlS3ObjectMetadata(input.NewObjectMetadata, context).withName("NewObjectMetadata"); bodyNode.addChildNode(node); } - if (input.NewObjectTagging !== undefined) { + if (input.NewObjectTagging !== undefined && input.NewObjectTagging !== null) { const nodes = serializeAws_restXmlS3TagSet(input.NewObjectTagging, context); const containerNode = new __XmlNode("NewObjectTagging"); nodes.map((node: any) => { @@ -4857,55 +4854,55 @@ const serializeAws_restXmlS3CopyObjectOperation = (input: S3CopyObjectOperation, }); bodyNode.addChildNode(containerNode); } - if (input.RedirectLocation !== undefined) { + if (input.RedirectLocation !== undefined && input.RedirectLocation !== null) { const node = new __XmlNode("NonEmptyMaxLength2048String") .addChildNode(new __XmlText(input.RedirectLocation)) .withName("RedirectLocation"); bodyNode.addChildNode(node); } - if (input.RequesterPays !== undefined) { + if (input.RequesterPays !== undefined && input.RequesterPays !== null) { const node = new __XmlNode("Boolean") .addChildNode(new __XmlText(String(input.RequesterPays))) .withName("RequesterPays"); bodyNode.addChildNode(node); } - if (input.StorageClass !== undefined) { + if (input.StorageClass !== undefined && input.StorageClass !== null) { const node = new __XmlNode("S3StorageClass") .addChildNode(new __XmlText(input.StorageClass)) .withName("StorageClass"); bodyNode.addChildNode(node); } - if (input.UnModifiedSinceConstraint !== undefined) { + if (input.UnModifiedSinceConstraint !== undefined && input.UnModifiedSinceConstraint !== null) { const node = new __XmlNode("TimeStamp") .addChildNode(new __XmlText(input.UnModifiedSinceConstraint.toISOString().split(".")[0] + "Z")) .withName("UnModifiedSinceConstraint"); bodyNode.addChildNode(node); } - if (input.SSEAwsKmsKeyId !== undefined) { + if (input.SSEAwsKmsKeyId !== undefined && input.SSEAwsKmsKeyId !== null) { const node = new __XmlNode("KmsKeyArnString") .addChildNode(new __XmlText(input.SSEAwsKmsKeyId)) .withName("SSEAwsKmsKeyId"); bodyNode.addChildNode(node); } - if (input.TargetKeyPrefix !== undefined) { + if (input.TargetKeyPrefix !== undefined && input.TargetKeyPrefix !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.TargetKeyPrefix)) .withName("TargetKeyPrefix"); bodyNode.addChildNode(node); } - if (input.ObjectLockLegalHoldStatus !== undefined) { + if (input.ObjectLockLegalHoldStatus !== undefined && input.ObjectLockLegalHoldStatus !== null) { const node = new __XmlNode("S3ObjectLockLegalHoldStatus") .addChildNode(new __XmlText(input.ObjectLockLegalHoldStatus)) .withName("ObjectLockLegalHoldStatus"); bodyNode.addChildNode(node); } - if (input.ObjectLockMode !== undefined) { + if (input.ObjectLockMode !== undefined && input.ObjectLockMode !== null) { const node = new __XmlNode("S3ObjectLockMode") .addChildNode(new __XmlText(input.ObjectLockMode)) .withName("ObjectLockMode"); bodyNode.addChildNode(node); } - if (input.ObjectLockRetainUntilDate !== undefined) { + if (input.ObjectLockRetainUntilDate !== undefined && input.ObjectLockRetainUntilDate !== null) { const node = new __XmlNode("TimeStamp") .addChildNode(new __XmlText(input.ObjectLockRetainUntilDate.toISOString().split(".")[0] + "Z")) .withName("ObjectLockRetainUntilDate"); @@ -4916,11 +4913,11 @@ const serializeAws_restXmlS3CopyObjectOperation = (input: S3CopyObjectOperation, const serializeAws_restXmlS3Grant = (input: S3Grant, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3Grant"); - if (input.Grantee !== undefined) { + if (input.Grantee !== undefined && input.Grantee !== null) { const node = serializeAws_restXmlS3Grantee(input.Grantee, context).withName("Grantee"); bodyNode.addChildNode(node); } - if (input.Permission !== undefined) { + if (input.Permission !== undefined && input.Permission !== null) { const node = new __XmlNode("S3Permission").addChildNode(new __XmlText(input.Permission)).withName("Permission"); bodyNode.addChildNode(node); } @@ -4929,19 +4926,19 @@ const serializeAws_restXmlS3Grant = (input: S3Grant, context: __SerdeContext): a const serializeAws_restXmlS3Grantee = (input: S3Grantee, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3Grantee"); - if (input.TypeIdentifier !== undefined) { + if (input.TypeIdentifier !== undefined && input.TypeIdentifier !== null) { const node = new __XmlNode("S3GranteeTypeIdentifier") .addChildNode(new __XmlText(input.TypeIdentifier)) .withName("TypeIdentifier"); bodyNode.addChildNode(node); } - if (input.Identifier !== undefined) { + if (input.Identifier !== undefined && input.Identifier !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.Identifier)) .withName("Identifier"); bodyNode.addChildNode(node); } - if (input.DisplayName !== undefined) { + if (input.DisplayName !== undefined && input.DisplayName !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.DisplayName)) .withName("DisplayName"); @@ -4951,10 +4948,15 @@ const serializeAws_restXmlS3Grantee = (input: S3Grantee, context: __SerdeContext }; const serializeAws_restXmlS3GrantList = (input: S3Grant[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlS3Grant(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlS3Grant(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlS3InitiateRestoreObjectOperation = ( @@ -4962,13 +4964,13 @@ const serializeAws_restXmlS3InitiateRestoreObjectOperation = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("S3InitiateRestoreObjectOperation"); - if (input.ExpirationInDays !== undefined) { + if (input.ExpirationInDays !== undefined && input.ExpirationInDays !== null) { const node = new __XmlNode("S3ExpirationInDays") .addChildNode(new __XmlText(String(input.ExpirationInDays))) .withName("ExpirationInDays"); bodyNode.addChildNode(node); } - if (input.GlacierJobTier !== undefined) { + if (input.GlacierJobTier !== undefined && input.GlacierJobTier !== null) { const node = new __XmlNode("S3GlacierJobTier") .addChildNode(new __XmlText(input.GlacierJobTier)) .withName("GlacierJobTier"); @@ -4979,7 +4981,7 @@ const serializeAws_restXmlS3InitiateRestoreObjectOperation = ( const serializeAws_restXmlS3ObjectLockLegalHold = (input: S3ObjectLockLegalHold, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3ObjectLockLegalHold"); - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("S3ObjectLockLegalHoldStatus") .addChildNode(new __XmlText(input.Status)) .withName("Status"); @@ -4990,31 +4992,31 @@ const serializeAws_restXmlS3ObjectLockLegalHold = (input: S3ObjectLockLegalHold, const serializeAws_restXmlS3ObjectMetadata = (input: S3ObjectMetadata, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3ObjectMetadata"); - if (input.CacheControl !== undefined) { + if (input.CacheControl !== undefined && input.CacheControl !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.CacheControl)) .withName("CacheControl"); bodyNode.addChildNode(node); } - if (input.ContentDisposition !== undefined) { + if (input.ContentDisposition !== undefined && input.ContentDisposition !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.ContentDisposition)) .withName("ContentDisposition"); bodyNode.addChildNode(node); } - if (input.ContentEncoding !== undefined) { + if (input.ContentEncoding !== undefined && input.ContentEncoding !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.ContentEncoding)) .withName("ContentEncoding"); bodyNode.addChildNode(node); } - if (input.ContentLanguage !== undefined) { + if (input.ContentLanguage !== undefined && input.ContentLanguage !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.ContentLanguage)) .withName("ContentLanguage"); bodyNode.addChildNode(node); } - if (input.UserMetadata !== undefined) { + if (input.UserMetadata !== undefined && input.UserMetadata !== null) { const nodes = serializeAws_restXmlS3UserMetadata(input.UserMetadata, context); const containerNode = new __XmlNode("UserMetadata"); nodes.map((node: any) => { @@ -5022,37 +5024,37 @@ const serializeAws_restXmlS3ObjectMetadata = (input: S3ObjectMetadata, context: }); bodyNode.addChildNode(containerNode); } - if (input.ContentLength !== undefined) { + if (input.ContentLength !== undefined && input.ContentLength !== null) { const node = new __XmlNode("S3ContentLength") .addChildNode(new __XmlText(String(input.ContentLength))) .withName("ContentLength"); bodyNode.addChildNode(node); } - if (input.ContentMD5 !== undefined) { + if (input.ContentMD5 !== undefined && input.ContentMD5 !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.ContentMD5)) .withName("ContentMD5"); bodyNode.addChildNode(node); } - if (input.ContentType !== undefined) { + if (input.ContentType !== undefined && input.ContentType !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.ContentType)) .withName("ContentType"); bodyNode.addChildNode(node); } - if (input.HttpExpiresDate !== undefined) { + if (input.HttpExpiresDate !== undefined && input.HttpExpiresDate !== null) { const node = new __XmlNode("TimeStamp") .addChildNode(new __XmlText(input.HttpExpiresDate.toISOString().split(".")[0] + "Z")) .withName("HttpExpiresDate"); bodyNode.addChildNode(node); } - if (input.RequesterCharged !== undefined) { + if (input.RequesterCharged !== undefined && input.RequesterCharged !== null) { const node = new __XmlNode("Boolean") .addChildNode(new __XmlText(String(input.RequesterCharged))) .withName("RequesterCharged"); bodyNode.addChildNode(node); } - if (input.SSEAlgorithm !== undefined) { + if (input.SSEAlgorithm !== undefined && input.SSEAlgorithm !== null) { const node = new __XmlNode("S3SSEAlgorithm") .addChildNode(new __XmlText(input.SSEAlgorithm)) .withName("SSEAlgorithm"); @@ -5063,11 +5065,11 @@ const serializeAws_restXmlS3ObjectMetadata = (input: S3ObjectMetadata, context: const serializeAws_restXmlS3ObjectOwner = (input: S3ObjectOwner, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3ObjectOwner"); - if (input.ID !== undefined) { + if (input.ID !== undefined && input.ID !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String").addChildNode(new __XmlText(input.ID)).withName("ID"); bodyNode.addChildNode(node); } - if (input.DisplayName !== undefined) { + if (input.DisplayName !== undefined && input.DisplayName !== null) { const node = new __XmlNode("NonEmptyMaxLength1024String") .addChildNode(new __XmlText(input.DisplayName)) .withName("DisplayName"); @@ -5078,13 +5080,13 @@ const serializeAws_restXmlS3ObjectOwner = (input: S3ObjectOwner, context: __Serd const serializeAws_restXmlS3Retention = (input: S3Retention, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3Retention"); - if (input.RetainUntilDate !== undefined) { + if (input.RetainUntilDate !== undefined && input.RetainUntilDate !== null) { const node = new __XmlNode("TimeStamp") .addChildNode(new __XmlText(input.RetainUntilDate.toISOString().split(".")[0] + "Z")) .withName("RetainUntilDate"); bodyNode.addChildNode(node); } - if (input.Mode !== undefined) { + if (input.Mode !== undefined && input.Mode !== null) { const node = new __XmlNode("S3ObjectLockRetentionMode").addChildNode(new __XmlText(input.Mode)).withName("Mode"); bodyNode.addChildNode(node); } @@ -5093,7 +5095,7 @@ const serializeAws_restXmlS3Retention = (input: S3Retention, context: __SerdeCon const serializeAws_restXmlS3SetObjectAclOperation = (input: S3SetObjectAclOperation, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3SetObjectAclOperation"); - if (input.AccessControlPolicy !== undefined) { + if (input.AccessControlPolicy !== undefined && input.AccessControlPolicy !== null) { const node = serializeAws_restXmlS3AccessControlPolicy(input.AccessControlPolicy, context).withName( "AccessControlPolicy" ); @@ -5107,7 +5109,7 @@ const serializeAws_restXmlS3SetObjectLegalHoldOperation = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("S3SetObjectLegalHoldOperation"); - if (input.LegalHold !== undefined) { + if (input.LegalHold !== undefined && input.LegalHold !== null) { const node = serializeAws_restXmlS3ObjectLockLegalHold(input.LegalHold, context).withName("LegalHold"); bodyNode.addChildNode(node); } @@ -5119,13 +5121,13 @@ const serializeAws_restXmlS3SetObjectRetentionOperation = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("S3SetObjectRetentionOperation"); - if (input.BypassGovernanceRetention !== undefined) { + if (input.BypassGovernanceRetention !== undefined && input.BypassGovernanceRetention !== null) { const node = new __XmlNode("Boolean") .addChildNode(new __XmlText(String(input.BypassGovernanceRetention))) .withName("BypassGovernanceRetention"); bodyNode.addChildNode(node); } - if (input.Retention !== undefined) { + if (input.Retention !== undefined && input.Retention !== null) { const node = serializeAws_restXmlS3Retention(input.Retention, context).withName("Retention"); bodyNode.addChildNode(node); } @@ -5137,7 +5139,7 @@ const serializeAws_restXmlS3SetObjectTaggingOperation = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("S3SetObjectTaggingOperation"); - if (input.TagSet !== undefined) { + if (input.TagSet !== undefined && input.TagSet !== null) { const nodes = serializeAws_restXmlS3TagSet(input.TagSet, context); const containerNode = new __XmlNode("TagSet"); nodes.map((node: any) => { @@ -5150,11 +5152,11 @@ const serializeAws_restXmlS3SetObjectTaggingOperation = ( const serializeAws_restXmlS3Tag = (input: S3Tag, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3Tag"); - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { const node = new __XmlNode("TagKeyString").addChildNode(new __XmlText(input.Key)).withName("Key"); bodyNode.addChildNode(node); } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { const node = new __XmlNode("TagValueString").addChildNode(new __XmlText(input.Value)).withName("Value"); bodyNode.addChildNode(node); } @@ -5162,38 +5164,46 @@ const serializeAws_restXmlS3Tag = (input: S3Tag, context: __SerdeContext): any = }; const serializeAws_restXmlS3TagSet = (input: S3Tag[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlS3Tag(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlS3Tag(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlS3UserMetadata = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.keys(input).map((key) => { - const entryNode = new __XmlNode("entry"); - const keyNode = new __XmlNode("NonEmptyMaxLength1024String").addChildNode(new __XmlText(key)).withName("key"); - entryNode.addChildNode(keyNode); - const node = new __XmlNode("MaxLength1024String").addChildNode(new __XmlText(input[key])); - entryNode.addChildNode(node.withName("value")); - return entryNode; - }); + return Object.keys(input) + .filter((key) => input[key] != null) + .map((key) => { + const entryNode = new __XmlNode("entry"); + const keyNode = new __XmlNode("NonEmptyMaxLength1024String").addChildNode(new __XmlText(key)).withName("key"); + entryNode.addChildNode(keyNode); + var node; + node = new __XmlNode("MaxLength1024String").addChildNode(new __XmlText(input[key])); + entryNode.addChildNode(node.withName("value")); + return entryNode; + }); }; const serializeAws_restXmlSelectionCriteria = (input: SelectionCriteria, context: __SerdeContext): any => { const bodyNode = new __XmlNode("SelectionCriteria"); - if (input.Delimiter !== undefined) { + if (input.Delimiter !== undefined && input.Delimiter !== null) { const node = new __XmlNode("StorageLensPrefixLevelDelimiter") .addChildNode(new __XmlText(input.Delimiter)) .withName("Delimiter"); bodyNode.addChildNode(node); } - if (input.MaxDepth !== undefined) { + if (input.MaxDepth !== undefined && input.MaxDepth !== null) { const node = new __XmlNode("StorageLensPrefixLevelMaxDepth") .addChildNode(new __XmlText(String(input.MaxDepth))) .withName("MaxDepth"); bodyNode.addChildNode(node); } - if (input.MinStorageBytesPercentage !== undefined) { + if (input.MinStorageBytesPercentage !== undefined && input.MinStorageBytesPercentage !== null) { const node = new __XmlNode("MinStorageBytesPercentage") .addChildNode(new __XmlText(String(input.MinStorageBytesPercentage))) .withName("MinStorageBytesPercentage"); @@ -5204,7 +5214,7 @@ const serializeAws_restXmlSelectionCriteria = (input: SelectionCriteria, context const serializeAws_restXmlSSEKMS = (input: SSEKMS, context: __SerdeContext): any => { const bodyNode = new __XmlNode("SSE-KMS"); - if (input.KeyId !== undefined) { + if (input.KeyId !== undefined && input.KeyId !== null) { const node = new __XmlNode("SSEKMSKeyId").addChildNode(new __XmlText(input.KeyId)).withName("KeyId"); bodyNode.addChildNode(node); } @@ -5218,7 +5228,7 @@ const serializeAws_restXmlSSES3 = (input: SSES3, context: __SerdeContext): any = const serializeAws_restXmlStorageLensAwsOrg = (input: StorageLensAwsOrg, context: __SerdeContext): any => { const bodyNode = new __XmlNode("StorageLensAwsOrg"); - if (input.Arn !== undefined) { + if (input.Arn !== undefined && input.Arn !== null) { const node = new __XmlNode("AwsOrgArn").addChildNode(new __XmlText(input.Arn)).withName("Arn"); bodyNode.addChildNode(node); } @@ -5230,35 +5240,35 @@ const serializeAws_restXmlStorageLensConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("StorageLensConfiguration"); - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("ConfigId").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } - if (input.AccountLevel !== undefined) { + if (input.AccountLevel !== undefined && input.AccountLevel !== null) { const node = serializeAws_restXmlAccountLevel(input.AccountLevel, context).withName("AccountLevel"); bodyNode.addChildNode(node); } - if (input.Include !== undefined) { + if (input.Include !== undefined && input.Include !== null) { const node = serializeAws_restXmlInclude(input.Include, context).withName("Include"); bodyNode.addChildNode(node); } - if (input.Exclude !== undefined) { + if (input.Exclude !== undefined && input.Exclude !== null) { const node = serializeAws_restXml_Exclude(input.Exclude, context).withName("Exclude"); bodyNode.addChildNode(node); } - if (input.DataExport !== undefined) { + if (input.DataExport !== undefined && input.DataExport !== null) { const node = serializeAws_restXmlStorageLensDataExport(input.DataExport, context).withName("DataExport"); bodyNode.addChildNode(node); } - if (input.IsEnabled !== undefined) { + if (input.IsEnabled !== undefined && input.IsEnabled !== null) { const node = new __XmlNode("IsEnabled").addChildNode(new __XmlText(String(input.IsEnabled))).withName("IsEnabled"); bodyNode.addChildNode(node); } - if (input.AwsOrg !== undefined) { + if (input.AwsOrg !== undefined && input.AwsOrg !== null) { const node = serializeAws_restXmlStorageLensAwsOrg(input.AwsOrg, context).withName("AwsOrg"); bodyNode.addChildNode(node); } - if (input.StorageLensArn !== undefined) { + if (input.StorageLensArn !== undefined && input.StorageLensArn !== null) { const node = new __XmlNode("StorageLensArn") .addChildNode(new __XmlText(input.StorageLensArn)) .withName("StorageLensArn"); @@ -5269,7 +5279,7 @@ const serializeAws_restXmlStorageLensConfiguration = ( const serializeAws_restXmlStorageLensDataExport = (input: StorageLensDataExport, context: __SerdeContext): any => { const bodyNode = new __XmlNode("StorageLensDataExport"); - if (input.S3BucketDestination !== undefined) { + if (input.S3BucketDestination !== undefined && input.S3BucketDestination !== null) { const node = serializeAws_restXmlS3BucketDestination(input.S3BucketDestination, context).withName( "S3BucketDestination" ); @@ -5283,11 +5293,11 @@ const serializeAws_restXmlStorageLensDataExportEncryption = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("StorageLensDataExportEncryption"); - if (input.SSES3 !== undefined) { + if (input.SSES3 !== undefined && input.SSES3 !== null) { const node = serializeAws_restXmlSSES3(input.SSES3, context).withName("SSE-S3"); bodyNode.addChildNode(node); } - if (input.SSEKMS !== undefined) { + if (input.SSEKMS !== undefined && input.SSEKMS !== null) { const node = serializeAws_restXmlSSEKMS(input.SSEKMS, context).withName("SSE-KMS"); bodyNode.addChildNode(node); } @@ -5296,11 +5306,11 @@ const serializeAws_restXmlStorageLensDataExportEncryption = ( const serializeAws_restXmlStorageLensTag = (input: StorageLensTag, context: __SerdeContext): any => { const bodyNode = new __XmlNode("StorageLensTag"); - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { const node = new __XmlNode("TagKeyString").addChildNode(new __XmlText(input.Key)).withName("Key"); bodyNode.addChildNode(node); } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { const node = new __XmlNode("TagValueString").addChildNode(new __XmlText(input.Value)).withName("Value"); bodyNode.addChildNode(node); } @@ -5308,15 +5318,20 @@ const serializeAws_restXmlStorageLensTag = (input: StorageLensTag, context: __Se }; const serializeAws_restXmlStorageLensTags = (input: StorageLensTag[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlStorageLensTag(entry, context); - return node.withName("Tag"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlStorageLensTag(entry, context); + return node.withName("Tag"); + }); }; const serializeAws_restXmlTagging = (input: Tagging, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Tagging"); - if (input.TagSet !== undefined) { + if (input.TagSet !== undefined && input.TagSet !== null) { const nodes = serializeAws_restXmlS3TagSet(input.TagSet, context); const containerNode = new __XmlNode("TagSet"); nodes.map((node: any) => { @@ -5329,17 +5344,17 @@ const serializeAws_restXmlTagging = (input: Tagging, context: __SerdeContext): a const serializeAws_restXmlTransition = (input: Transition, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Transition"); - if (input.Date !== undefined) { + if (input.Date !== undefined && input.Date !== null) { const node = new __XmlNode("Date") .addChildNode(new __XmlText(input.Date.toISOString().split(".")[0] + "Z")) .withName("Date"); bodyNode.addChildNode(node); } - if (input.Days !== undefined) { + if (input.Days !== undefined && input.Days !== null) { const node = new __XmlNode("Days").addChildNode(new __XmlText(String(input.Days))).withName("Days"); bodyNode.addChildNode(node); } - if (input.StorageClass !== undefined) { + if (input.StorageClass !== undefined && input.StorageClass !== null) { const node = new __XmlNode("TransitionStorageClass") .addChildNode(new __XmlText(input.StorageClass)) .withName("StorageClass"); @@ -5349,15 +5364,20 @@ const serializeAws_restXmlTransition = (input: Transition, context: __SerdeConte }; const serializeAws_restXmlTransitionList = (input: Transition[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlTransition(entry, context); - return node.withName("Transition"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlTransition(entry, context); + return node.withName("Transition"); + }); }; const serializeAws_restXmlVpcConfiguration = (input: VpcConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("VpcConfiguration"); - if (input.VpcId !== undefined) { + if (input.VpcId !== undefined && input.VpcId !== null) { const node = new __XmlNode("VpcId").addChildNode(new __XmlText(input.VpcId)).withName("VpcId"); bodyNode.addChildNode(node); } @@ -5404,7 +5424,14 @@ const deserializeAws_restXmlAccessPoint = (output: any, context: __SerdeContext) }; const deserializeAws_restXmlAccessPointList = (output: any, context: __SerdeContext): AccessPoint[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlAccessPoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlAccessPoint(entry, context); + }); }; const deserializeAws_restXmlAccountLevel = (output: any, context: __SerdeContext): AccountLevel => { @@ -5446,7 +5473,14 @@ const deserializeAws_restXmlBucketLevel = (output: any, context: __SerdeContext) }; const deserializeAws_restXmlBuckets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXml_Exclude = (output: any, context: __SerdeContext): _Exclude => { @@ -5584,7 +5618,14 @@ const deserializeAws_restXmlJobFailure = (output: any, context: __SerdeContext): }; const deserializeAws_restXmlJobFailureList = (output: any, context: __SerdeContext): JobFailure[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlJobFailure(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlJobFailure(entry, context); + }); }; const deserializeAws_restXmlJobListDescriptor = (output: any, context: __SerdeContext): JobListDescriptor => { @@ -5626,7 +5667,14 @@ const deserializeAws_restXmlJobListDescriptor = (output: any, context: __SerdeCo }; const deserializeAws_restXmlJobListDescriptorList = (output: any, context: __SerdeContext): JobListDescriptor[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlJobListDescriptor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlJobListDescriptor(entry, context); + }); }; const deserializeAws_restXmlJobManifest = (output: any, context: __SerdeContext): JobManifest => { @@ -5647,7 +5695,14 @@ const deserializeAws_restXmlJobManifestFieldList = ( output: any, context: __SerdeContext ): (JobManifestFieldName | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlJobManifestLocation = (output: any, context: __SerdeContext): JobManifestLocation => { @@ -5904,7 +5959,14 @@ const deserializeAws_restXmlLifecycleRuleFilter = (output: any, context: __Serde }; const deserializeAws_restXmlLifecycleRules = (output: any, context: __SerdeContext): LifecycleRule[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlLifecycleRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlLifecycleRule(entry, context); + }); }; const deserializeAws_restXmlListStorageLensConfigurationEntry = ( @@ -5966,7 +6028,14 @@ const deserializeAws_restXmlNoncurrentVersionTransitionList = ( output: any, context: __SerdeContext ): NoncurrentVersionTransition[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlNoncurrentVersionTransition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlNoncurrentVersionTransition(entry, context); + }); }; const deserializeAws_restXmlPolicyStatus = (output: any, context: __SerdeContext): PolicyStatus => { @@ -6058,11 +6127,25 @@ const deserializeAws_restXmlRegionalBucket = (output: any, context: __SerdeConte }; const deserializeAws_restXmlRegionalBucketList = (output: any, context: __SerdeContext): RegionalBucket[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlRegionalBucket(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlRegionalBucket(entry, context); + }); }; const deserializeAws_restXmlRegions = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlS3AccessControlList = (output: any, context: __SerdeContext): S3AccessControlList => { @@ -6241,7 +6324,14 @@ const deserializeAws_restXmlS3Grantee = (output: any, context: __SerdeContext): }; const deserializeAws_restXmlS3GrantList = (output: any, context: __SerdeContext): S3Grant[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlS3Grant(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlS3Grant(entry, context); + }); }; const deserializeAws_restXmlS3InitiateRestoreObjectOperation = ( @@ -6429,17 +6519,26 @@ const deserializeAws_restXmlS3Tag = (output: any, context: __SerdeContext): S3Ta }; const deserializeAws_restXmlS3TagSet = (output: any, context: __SerdeContext): S3Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlS3Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlS3Tag(entry, context); + }); }; const deserializeAws_restXmlS3UserMetadata = (output: any, context: __SerdeContext): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: pair["value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_restXmlSelectionCriteria = (output: any, context: __SerdeContext): SelectionCriteria => { @@ -6530,7 +6629,14 @@ const deserializeAws_restXmlStorageLensConfigurationList = ( output: any, context: __SerdeContext ): ListStorageLensConfigurationEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlListStorageLensConfigurationEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlListStorageLensConfigurationEntry(entry, context); + }); }; const deserializeAws_restXmlStorageLensDataExport = (output: any, context: __SerdeContext): StorageLensDataExport => { @@ -6575,7 +6681,14 @@ const deserializeAws_restXmlStorageLensTag = (output: any, context: __SerdeConte }; const deserializeAws_restXmlStorageLensTags = (output: any, context: __SerdeContext): StorageLensTag[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlStorageLensTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlStorageLensTag(entry, context); + }); }; const deserializeAws_restXmlTransition = (output: any, context: __SerdeContext): Transition => { @@ -6597,7 +6710,14 @@ const deserializeAws_restXmlTransition = (output: any, context: __SerdeContext): }; const deserializeAws_restXmlTransitionList = (output: any, context: __SerdeContext): Transition[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTransition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTransition(entry, context); + }); }; const deserializeAws_restXmlVpcConfiguration = (output: any, context: __SerdeContext): VpcConfiguration => { @@ -6630,6 +6750,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-s3/protocols/Aws_restXml.ts b/clients/client-s3/protocols/Aws_restXml.ts index c8937bdd5915..2c869de9b7f5 100644 --- a/clients/client-s3/protocols/Aws_restXml.ts +++ b/clients/client-s3/protocols/Aws_restXml.ts @@ -401,7 +401,6 @@ export const serializeAws_restXmlAbortMultipartUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -455,7 +454,7 @@ export const serializeAws_restXmlCompleteMultipartUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -515,7 +514,6 @@ export const serializeAws_restXmlCopyObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ACL) && { "x-amz-acl": input.ACL! }), ...(isSerializableHeaderValue(input.CacheControl) && { "Cache-Control": input.CacheControl! }), ...(isSerializableHeaderValue(input.ContentDisposition) && { "Content-Disposition": input.ContentDisposition! }), @@ -646,7 +644,7 @@ export const serializeAws_restXmlCreateBucketCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ACL) && { "x-amz-acl": input.ACL! }), ...(isSerializableHeaderValue(input.GrantFullControl) && { "x-amz-grant-full-control": input.GrantFullControl! }), ...(isSerializableHeaderValue(input.GrantRead) && { "x-amz-grant-read": input.GrantRead! }), @@ -692,7 +690,6 @@ export const serializeAws_restXmlCreateMultipartUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ACL) && { "x-amz-acl": input.ACL! }), ...(isSerializableHeaderValue(input.CacheControl) && { "Cache-Control": input.CacheControl! }), ...(isSerializableHeaderValue(input.ContentDisposition) && { "Content-Disposition": input.ContentDisposition! }), @@ -796,7 +793,6 @@ export const serializeAws_restXmlDeleteBucketCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -829,7 +825,6 @@ export const serializeAws_restXmlDeleteBucketAnalyticsConfigurationCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -867,7 +862,6 @@ export const serializeAws_restXmlDeleteBucketCorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -904,7 +898,6 @@ export const serializeAws_restXmlDeleteBucketEncryptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -940,9 +933,7 @@ export const serializeAws_restXmlDeleteBucketIntelligentTieringConfigurationComm input: DeleteBucketIntelligentTieringConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{Bucket}"; if (input.Bucket !== undefined) { const labelValue: string = input.Bucket; @@ -976,7 +967,6 @@ export const serializeAws_restXmlDeleteBucketInventoryConfigurationCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1014,7 +1004,6 @@ export const serializeAws_restXmlDeleteBucketLifecycleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1051,7 +1040,6 @@ export const serializeAws_restXmlDeleteBucketMetricsConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1089,7 +1077,6 @@ export const serializeAws_restXmlDeleteBucketOwnershipControlsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1126,7 +1113,6 @@ export const serializeAws_restXmlDeleteBucketPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1163,7 +1149,6 @@ export const serializeAws_restXmlDeleteBucketReplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1200,7 +1185,6 @@ export const serializeAws_restXmlDeleteBucketTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1237,7 +1221,6 @@ export const serializeAws_restXmlDeleteBucketWebsiteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1274,7 +1257,6 @@ export const serializeAws_restXmlDeleteObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.MFA) && { "x-amz-mfa": input.MFA! }), ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.BypassGovernanceRetention) && { @@ -1332,7 +1314,7 @@ export const serializeAws_restXmlDeleteObjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.MFA) && { "x-amz-mfa": input.MFA! }), ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.BypassGovernanceRetention) && { @@ -1381,7 +1363,6 @@ export const serializeAws_restXmlDeleteObjectTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1434,7 +1415,6 @@ export const serializeAws_restXmlDeletePublicAccessBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1471,7 +1451,6 @@ export const serializeAws_restXmlGetBucketAccelerateConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1508,7 +1487,6 @@ export const serializeAws_restXmlGetBucketAclCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1545,7 +1523,6 @@ export const serializeAws_restXmlGetBucketAnalyticsConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1584,7 +1561,6 @@ export const serializeAws_restXmlGetBucketCorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1621,7 +1597,6 @@ export const serializeAws_restXmlGetBucketEncryptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1657,9 +1632,7 @@ export const serializeAws_restXmlGetBucketIntelligentTieringConfigurationCommand input: GetBucketIntelligentTieringConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{Bucket}"; if (input.Bucket !== undefined) { const labelValue: string = input.Bucket; @@ -1694,7 +1667,6 @@ export const serializeAws_restXmlGetBucketInventoryConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1733,7 +1705,6 @@ export const serializeAws_restXmlGetBucketLifecycleConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1770,7 +1741,6 @@ export const serializeAws_restXmlGetBucketLocationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1807,7 +1777,6 @@ export const serializeAws_restXmlGetBucketLoggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1844,7 +1813,6 @@ export const serializeAws_restXmlGetBucketMetricsConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1883,7 +1851,6 @@ export const serializeAws_restXmlGetBucketNotificationConfigurationCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1920,7 +1887,6 @@ export const serializeAws_restXmlGetBucketOwnershipControlsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1957,7 +1923,6 @@ export const serializeAws_restXmlGetBucketPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -1994,7 +1959,6 @@ export const serializeAws_restXmlGetBucketPolicyStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2031,7 +1995,6 @@ export const serializeAws_restXmlGetBucketReplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2068,7 +2031,6 @@ export const serializeAws_restXmlGetBucketRequestPaymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2105,7 +2067,6 @@ export const serializeAws_restXmlGetBucketTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2142,7 +2103,6 @@ export const serializeAws_restXmlGetBucketVersioningCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2179,7 +2139,6 @@ export const serializeAws_restXmlGetBucketWebsiteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2216,7 +2175,6 @@ export const serializeAws_restXmlGetObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), ...(isSerializableHeaderValue(input.IfModifiedSince) && { "If-Modified-Since": __dateToUtcString(input.IfModifiedSince!).toString(), @@ -2299,7 +2257,6 @@ export const serializeAws_restXmlGetObjectAclCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -2353,7 +2310,6 @@ export const serializeAws_restXmlGetObjectLegalHoldCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -2407,7 +2363,6 @@ export const serializeAws_restXmlGetObjectLockConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2444,7 +2399,6 @@ export const serializeAws_restXmlGetObjectRetentionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -2498,7 +2452,6 @@ export const serializeAws_restXmlGetObjectTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2551,7 +2504,6 @@ export const serializeAws_restXmlGetObjectTorrentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -2604,7 +2556,6 @@ export const serializeAws_restXmlGetPublicAccessBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2641,7 +2592,6 @@ export const serializeAws_restXmlHeadBucketCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2674,7 +2624,6 @@ export const serializeAws_restXmlHeadObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.IfMatch) && { "If-Match": input.IfMatch! }), ...(isSerializableHeaderValue(input.IfModifiedSince) && { "If-Modified-Since": __dateToUtcString(input.IfModifiedSince!).toString(), @@ -2746,7 +2695,6 @@ export const serializeAws_restXmlListBucketAnalyticsConfigurationsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2784,9 +2732,7 @@ export const serializeAws_restXmlListBucketIntelligentTieringConfigurationsComma input: ListBucketIntelligentTieringConfigurationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/{Bucket}"; if (input.Bucket !== undefined) { const labelValue: string = input.Bucket; @@ -2821,7 +2767,6 @@ export const serializeAws_restXmlListBucketInventoryConfigurationsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2860,7 +2805,6 @@ export const serializeAws_restXmlListBucketMetricsConfigurationsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2898,9 +2842,7 @@ export const serializeAws_restXmlListBucketsCommand = async ( input: ListBucketsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/"; let body: any; body = ""; @@ -2921,7 +2863,6 @@ export const serializeAws_restXmlListMultipartUploadsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -2964,7 +2905,6 @@ export const serializeAws_restXmlListObjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3006,7 +2946,6 @@ export const serializeAws_restXmlListObjectsV2Command = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3051,7 +2990,6 @@ export const serializeAws_restXmlListObjectVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -3094,7 +3032,6 @@ export const serializeAws_restXmlListPartsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3150,7 +3087,7 @@ export const serializeAws_restXmlPutBucketAccelerateConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -3194,7 +3131,7 @@ export const serializeAws_restXmlPutBucketAclCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ACL) && { "x-amz-acl": input.ACL! }), ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.GrantFullControl) && { "x-amz-grant-full-control": input.GrantFullControl! }), @@ -3245,7 +3182,7 @@ export const serializeAws_restXmlPutBucketAnalyticsConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -3290,7 +3227,7 @@ export const serializeAws_restXmlPutBucketCorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3335,7 +3272,7 @@ export const serializeAws_restXmlPutBucketEncryptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3380,7 +3317,7 @@ export const serializeAws_restXmlPutBucketIntelligentTieringConfigurationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", }; let resolvedPath = "/{Bucket}"; if (input.Bucket !== undefined) { @@ -3422,7 +3359,7 @@ export const serializeAws_restXmlPutBucketInventoryConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -3467,7 +3404,7 @@ export const serializeAws_restXmlPutBucketLifecycleConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -3511,7 +3448,7 @@ export const serializeAws_restXmlPutBucketLoggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3556,7 +3493,7 @@ export const serializeAws_restXmlPutBucketMetricsConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -3601,7 +3538,7 @@ export const serializeAws_restXmlPutBucketNotificationConfigurationCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, }), @@ -3645,7 +3582,7 @@ export const serializeAws_restXmlPutBucketOwnershipControlsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3690,7 +3627,7 @@ export const serializeAws_restXmlPutBucketPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "text/plain", + "content-type": "text/plain", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ConfirmRemoveSelfBucketAccess) && { "x-amz-confirm-remove-self-bucket-access": input.ConfirmRemoveSelfBucketAccess!.toString(), @@ -3736,7 +3673,7 @@ export const serializeAws_restXmlPutBucketReplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.Token) && { "x-amz-bucket-object-lock-token": input.Token! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { @@ -3782,7 +3719,7 @@ export const serializeAws_restXmlPutBucketRequestPaymentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3827,7 +3764,7 @@ export const serializeAws_restXmlPutBucketTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3872,7 +3809,7 @@ export const serializeAws_restXmlPutBucketVersioningCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.MFA) && { "x-amz-mfa": input.MFA! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { @@ -3918,7 +3855,7 @@ export const serializeAws_restXmlPutBucketWebsiteCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -3963,7 +3900,7 @@ export const serializeAws_restXmlPutObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.ACL) && { "x-amz-acl": input.ACL! }), ...(isSerializableHeaderValue(input.CacheControl) && { "Cache-Control": input.CacheControl! }), ...(isSerializableHeaderValue(input.ContentDisposition) && { "Content-Disposition": input.ContentDisposition! }), @@ -4074,7 +4011,7 @@ export const serializeAws_restXmlPutObjectAclCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ACL) && { "x-amz-acl": input.ACL! }), ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.GrantFullControl) && { "x-amz-grant-full-control": input.GrantFullControl! }), @@ -4142,7 +4079,7 @@ export const serializeAws_restXmlPutObjectLegalHoldCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { @@ -4204,7 +4141,7 @@ export const serializeAws_restXmlPutObjectLockConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.Token) && { "x-amz-bucket-object-lock-token": input.Token! }), ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), @@ -4251,7 +4188,7 @@ export const serializeAws_restXmlPutObjectRetentionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.BypassGovernanceRetention) && { "x-amz-bypass-governance-retention": input.BypassGovernanceRetention!.toString(), @@ -4316,7 +4253,7 @@ export const serializeAws_restXmlPutObjectTaggingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -4377,7 +4314,7 @@ export const serializeAws_restXmlPutPublicAccessBlockCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -4422,7 +4359,7 @@ export const serializeAws_restXmlRestoreObjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.RequestPayer) && { "x-amz-request-payer": input.RequestPayer! }), ...(isSerializableHeaderValue(input.ExpectedBucketOwner) && { "x-amz-expected-bucket-owner": input.ExpectedBucketOwner!, @@ -4483,7 +4420,7 @@ export const serializeAws_restXmlSelectObjectContentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/xml", + "content-type": "application/xml", ...(isSerializableHeaderValue(input.SSECustomerAlgorithm) && { "x-amz-server-side-encryption-customer-algorithm": input.SSECustomerAlgorithm!, }), @@ -4579,7 +4516,7 @@ export const serializeAws_restXmlUploadPartCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.ContentLength) && { "Content-Length": input.ContentLength!.toString() }), ...(isSerializableHeaderValue(input.ContentMD5) && { "Content-MD5": input.ContentMD5! }), ...(isSerializableHeaderValue(input.SSECustomerAlgorithm) && { @@ -4650,7 +4587,6 @@ export const serializeAws_restXmlUploadPartCopyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.CopySource) && { "x-amz-copy-source": input.CopySource! }), ...(isSerializableHeaderValue(input.CopySourceIfMatch) && { "x-amz-copy-source-if-match": input.CopySourceIfMatch!, @@ -10058,7 +9994,7 @@ const serializeAws_restXmlAbortIncompleteMultipartUpload = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("AbortIncompleteMultipartUpload"); - if (input.DaysAfterInitiation !== undefined) { + if (input.DaysAfterInitiation !== undefined && input.DaysAfterInitiation !== null) { const node = new __XmlNode("DaysAfterInitiation") .addChildNode(new __XmlText(String(input.DaysAfterInitiation))) .withName("DaysAfterInitiation"); @@ -10069,7 +10005,7 @@ const serializeAws_restXmlAbortIncompleteMultipartUpload = ( const serializeAws_restXmlAccelerateConfiguration = (input: AccelerateConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("AccelerateConfiguration"); - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("BucketAccelerateStatus").addChildNode(new __XmlText(input.Status)).withName("Status"); bodyNode.addChildNode(node); } @@ -10078,7 +10014,7 @@ const serializeAws_restXmlAccelerateConfiguration = (input: AccelerateConfigurat const serializeAws_restXmlAccessControlPolicy = (input: AccessControlPolicy, context: __SerdeContext): any => { const bodyNode = new __XmlNode("AccessControlPolicy"); - if (input.Grants !== undefined) { + if (input.Grants !== undefined && input.Grants !== null) { const nodes = serializeAws_restXmlGrants(input.Grants, context); const containerNode = new __XmlNode("AccessControlList"); nodes.map((node: any) => { @@ -10086,7 +10022,7 @@ const serializeAws_restXmlAccessControlPolicy = (input: AccessControlPolicy, con }); bodyNode.addChildNode(containerNode); } - if (input.Owner !== undefined) { + if (input.Owner !== undefined && input.Owner !== null) { const node = serializeAws_restXmlOwner(input.Owner, context).withName("Owner"); bodyNode.addChildNode(node); } @@ -10098,7 +10034,7 @@ const serializeAws_restXmlAccessControlTranslation = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("AccessControlTranslation"); - if (input.Owner !== undefined) { + if (input.Owner !== undefined && input.Owner !== null) { const node = new __XmlNode("OwnerOverride").addChildNode(new __XmlText(input.Owner)).withName("Owner"); bodyNode.addChildNode(node); } @@ -10106,33 +10042,48 @@ const serializeAws_restXmlAccessControlTranslation = ( }; const serializeAws_restXmlAllowedHeaders = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("AllowedHeader").addChildNode(new __XmlText(entry)); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("AllowedHeader").addChildNode(new __XmlText(entry)); + return node.withName("member"); + }); }; const serializeAws_restXmlAllowedMethods = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("AllowedMethod").addChildNode(new __XmlText(entry)); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("AllowedMethod").addChildNode(new __XmlText(entry)); + return node.withName("member"); + }); }; const serializeAws_restXmlAllowedOrigins = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("AllowedOrigin").addChildNode(new __XmlText(entry)); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("AllowedOrigin").addChildNode(new __XmlText(entry)); + return node.withName("member"); + }); }; const serializeAws_restXmlAnalyticsAndOperator = (input: AnalyticsAndOperator, context: __SerdeContext): any => { const bodyNode = new __XmlNode("AnalyticsAndOperator"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const nodes = serializeAws_restXmlTagSet(input.Tags, context); nodes.map((node: any) => { node = node.withName("Tag"); @@ -10144,15 +10095,15 @@ const serializeAws_restXmlAnalyticsAndOperator = (input: AnalyticsAndOperator, c const serializeAws_restXmlAnalyticsConfiguration = (input: AnalyticsConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("AnalyticsConfiguration"); - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("AnalyticsId").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlAnalyticsFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } - if (input.StorageClassAnalysis !== undefined) { + if (input.StorageClassAnalysis !== undefined && input.StorageClassAnalysis !== null) { const node = serializeAws_restXmlStorageClassAnalysis(input.StorageClassAnalysis, context).withName( "StorageClassAnalysis" ); @@ -10166,7 +10117,7 @@ const serializeAws_restXmlAnalyticsExportDestination = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("AnalyticsExportDestination"); - if (input.S3BucketDestination !== undefined) { + if (input.S3BucketDestination !== undefined && input.S3BucketDestination !== null) { const node = serializeAws_restXmlAnalyticsS3BucketDestination(input.S3BucketDestination, context).withName( "S3BucketDestination" ); @@ -10205,23 +10156,23 @@ const serializeAws_restXmlAnalyticsS3BucketDestination = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("AnalyticsS3BucketDestination"); - if (input.Format !== undefined) { + if (input.Format !== undefined && input.Format !== null) { const node = new __XmlNode("AnalyticsS3ExportFileFormat") .addChildNode(new __XmlText(input.Format)) .withName("Format"); bodyNode.addChildNode(node); } - if (input.BucketAccountId !== undefined) { + if (input.BucketAccountId !== undefined && input.BucketAccountId !== null) { const node = new __XmlNode("AccountId") .addChildNode(new __XmlText(input.BucketAccountId)) .withName("BucketAccountId"); bodyNode.addChildNode(node); } - if (input.Bucket !== undefined) { + if (input.Bucket !== undefined && input.Bucket !== null) { const node = new __XmlNode("BucketName").addChildNode(new __XmlText(input.Bucket)).withName("Bucket"); bodyNode.addChildNode(node); } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } @@ -10233,7 +10184,7 @@ const serializeAws_restXmlBucketLifecycleConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("BucketLifecycleConfiguration"); - if (input.Rules !== undefined) { + if (input.Rules !== undefined && input.Rules !== null) { const nodes = serializeAws_restXmlLifecycleRules(input.Rules, context); nodes.map((node: any) => { node = node.withName("Rule"); @@ -10245,7 +10196,7 @@ const serializeAws_restXmlBucketLifecycleConfiguration = ( const serializeAws_restXmlBucketLoggingStatus = (input: BucketLoggingStatus, context: __SerdeContext): any => { const bodyNode = new __XmlNode("BucketLoggingStatus"); - if (input.LoggingEnabled !== undefined) { + if (input.LoggingEnabled !== undefined && input.LoggingEnabled !== null) { const node = serializeAws_restXmlLoggingEnabled(input.LoggingEnabled, context).withName("LoggingEnabled"); bodyNode.addChildNode(node); } @@ -10257,7 +10208,7 @@ const serializeAws_restXmlCompletedMultipartUpload = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("CompletedMultipartUpload"); - if (input.Parts !== undefined) { + if (input.Parts !== undefined && input.Parts !== null) { const nodes = serializeAws_restXmlCompletedPartList(input.Parts, context); nodes.map((node: any) => { node = node.withName("Part"); @@ -10269,11 +10220,11 @@ const serializeAws_restXmlCompletedMultipartUpload = ( const serializeAws_restXmlCompletedPart = (input: CompletedPart, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CompletedPart"); - if (input.ETag !== undefined) { + if (input.ETag !== undefined && input.ETag !== null) { const node = new __XmlNode("ETag").addChildNode(new __XmlText(input.ETag)).withName("ETag"); bodyNode.addChildNode(node); } - if (input.PartNumber !== undefined) { + if (input.PartNumber !== undefined && input.PartNumber !== null) { const node = new __XmlNode("PartNumber") .addChildNode(new __XmlText(String(input.PartNumber))) .withName("PartNumber"); @@ -10283,21 +10234,26 @@ const serializeAws_restXmlCompletedPart = (input: CompletedPart, context: __Serd }; const serializeAws_restXmlCompletedPartList = (input: CompletedPart[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlCompletedPart(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlCompletedPart(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlCondition = (input: Condition, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Condition"); - if (input.HttpErrorCodeReturnedEquals !== undefined) { + if (input.HttpErrorCodeReturnedEquals !== undefined && input.HttpErrorCodeReturnedEquals !== null) { const node = new __XmlNode("HttpErrorCodeReturnedEquals") .addChildNode(new __XmlText(input.HttpErrorCodeReturnedEquals)) .withName("HttpErrorCodeReturnedEquals"); bodyNode.addChildNode(node); } - if (input.KeyPrefixEquals !== undefined) { + if (input.KeyPrefixEquals !== undefined && input.KeyPrefixEquals !== null) { const node = new __XmlNode("KeyPrefixEquals") .addChildNode(new __XmlText(input.KeyPrefixEquals)) .withName("KeyPrefixEquals"); @@ -10308,7 +10264,7 @@ const serializeAws_restXmlCondition = (input: Condition, context: __SerdeContext const serializeAws_restXmlCORSConfiguration = (input: CORSConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CORSConfiguration"); - if (input.CORSRules !== undefined) { + if (input.CORSRules !== undefined && input.CORSRules !== null) { const nodes = serializeAws_restXmlCORSRules(input.CORSRules, context); nodes.map((node: any) => { node = node.withName("CORSRule"); @@ -10320,35 +10276,35 @@ const serializeAws_restXmlCORSConfiguration = (input: CORSConfiguration, context const serializeAws_restXmlCORSRule = (input: CORSRule, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CORSRule"); - if (input.AllowedHeaders !== undefined) { + if (input.AllowedHeaders !== undefined && input.AllowedHeaders !== null) { const nodes = serializeAws_restXmlAllowedHeaders(input.AllowedHeaders, context); nodes.map((node: any) => { node = node.withName("AllowedHeader"); bodyNode.addChildNode(node); }); } - if (input.AllowedMethods !== undefined) { + if (input.AllowedMethods !== undefined && input.AllowedMethods !== null) { const nodes = serializeAws_restXmlAllowedMethods(input.AllowedMethods, context); nodes.map((node: any) => { node = node.withName("AllowedMethod"); bodyNode.addChildNode(node); }); } - if (input.AllowedOrigins !== undefined) { + if (input.AllowedOrigins !== undefined && input.AllowedOrigins !== null) { const nodes = serializeAws_restXmlAllowedOrigins(input.AllowedOrigins, context); nodes.map((node: any) => { node = node.withName("AllowedOrigin"); bodyNode.addChildNode(node); }); } - if (input.ExposeHeaders !== undefined) { + if (input.ExposeHeaders !== undefined && input.ExposeHeaders !== null) { const nodes = serializeAws_restXmlExposeHeaders(input.ExposeHeaders, context); nodes.map((node: any) => { node = node.withName("ExposeHeader"); bodyNode.addChildNode(node); }); } - if (input.MaxAgeSeconds !== undefined) { + if (input.MaxAgeSeconds !== undefined && input.MaxAgeSeconds !== null) { const node = new __XmlNode("MaxAgeSeconds") .addChildNode(new __XmlText(String(input.MaxAgeSeconds))) .withName("MaxAgeSeconds"); @@ -10358,10 +10314,15 @@ const serializeAws_restXmlCORSRule = (input: CORSRule, context: __SerdeContext): }; const serializeAws_restXmlCORSRules = (input: CORSRule[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlCORSRule(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlCORSRule(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlCreateBucketConfiguration = ( @@ -10369,7 +10330,7 @@ const serializeAws_restXmlCreateBucketConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("CreateBucketConfiguration"); - if (input.LocationConstraint !== undefined) { + if (input.LocationConstraint !== undefined && input.LocationConstraint !== null) { const node = new __XmlNode("BucketLocationConstraint") .addChildNode(new __XmlText(input.LocationConstraint)) .withName("LocationConstraint"); @@ -10380,41 +10341,41 @@ const serializeAws_restXmlCreateBucketConfiguration = ( const serializeAws_restXmlCSVInput = (input: CSVInput, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CSVInput"); - if (input.FileHeaderInfo !== undefined) { + if (input.FileHeaderInfo !== undefined && input.FileHeaderInfo !== null) { const node = new __XmlNode("FileHeaderInfo") .addChildNode(new __XmlText(input.FileHeaderInfo)) .withName("FileHeaderInfo"); bodyNode.addChildNode(node); } - if (input.Comments !== undefined) { + if (input.Comments !== undefined && input.Comments !== null) { const node = new __XmlNode("Comments").addChildNode(new __XmlText(input.Comments)).withName("Comments"); bodyNode.addChildNode(node); } - if (input.QuoteEscapeCharacter !== undefined) { + if (input.QuoteEscapeCharacter !== undefined && input.QuoteEscapeCharacter !== null) { const node = new __XmlNode("QuoteEscapeCharacter") .addChildNode(new __XmlText(input.QuoteEscapeCharacter)) .withName("QuoteEscapeCharacter"); bodyNode.addChildNode(node); } - if (input.RecordDelimiter !== undefined) { + if (input.RecordDelimiter !== undefined && input.RecordDelimiter !== null) { const node = new __XmlNode("RecordDelimiter") .addChildNode(new __XmlText(input.RecordDelimiter)) .withName("RecordDelimiter"); bodyNode.addChildNode(node); } - if (input.FieldDelimiter !== undefined) { + if (input.FieldDelimiter !== undefined && input.FieldDelimiter !== null) { const node = new __XmlNode("FieldDelimiter") .addChildNode(new __XmlText(input.FieldDelimiter)) .withName("FieldDelimiter"); bodyNode.addChildNode(node); } - if (input.QuoteCharacter !== undefined) { + if (input.QuoteCharacter !== undefined && input.QuoteCharacter !== null) { const node = new __XmlNode("QuoteCharacter") .addChildNode(new __XmlText(input.QuoteCharacter)) .withName("QuoteCharacter"); bodyNode.addChildNode(node); } - if (input.AllowQuotedRecordDelimiter !== undefined) { + if (input.AllowQuotedRecordDelimiter !== undefined && input.AllowQuotedRecordDelimiter !== null) { const node = new __XmlNode("AllowQuotedRecordDelimiter") .addChildNode(new __XmlText(String(input.AllowQuotedRecordDelimiter))) .withName("AllowQuotedRecordDelimiter"); @@ -10425,29 +10386,29 @@ const serializeAws_restXmlCSVInput = (input: CSVInput, context: __SerdeContext): const serializeAws_restXmlCSVOutput = (input: CSVOutput, context: __SerdeContext): any => { const bodyNode = new __XmlNode("CSVOutput"); - if (input.QuoteFields !== undefined) { + if (input.QuoteFields !== undefined && input.QuoteFields !== null) { const node = new __XmlNode("QuoteFields").addChildNode(new __XmlText(input.QuoteFields)).withName("QuoteFields"); bodyNode.addChildNode(node); } - if (input.QuoteEscapeCharacter !== undefined) { + if (input.QuoteEscapeCharacter !== undefined && input.QuoteEscapeCharacter !== null) { const node = new __XmlNode("QuoteEscapeCharacter") .addChildNode(new __XmlText(input.QuoteEscapeCharacter)) .withName("QuoteEscapeCharacter"); bodyNode.addChildNode(node); } - if (input.RecordDelimiter !== undefined) { + if (input.RecordDelimiter !== undefined && input.RecordDelimiter !== null) { const node = new __XmlNode("RecordDelimiter") .addChildNode(new __XmlText(input.RecordDelimiter)) .withName("RecordDelimiter"); bodyNode.addChildNode(node); } - if (input.FieldDelimiter !== undefined) { + if (input.FieldDelimiter !== undefined && input.FieldDelimiter !== null) { const node = new __XmlNode("FieldDelimiter") .addChildNode(new __XmlText(input.FieldDelimiter)) .withName("FieldDelimiter"); bodyNode.addChildNode(node); } - if (input.QuoteCharacter !== undefined) { + if (input.QuoteCharacter !== undefined && input.QuoteCharacter !== null) { const node = new __XmlNode("QuoteCharacter") .addChildNode(new __XmlText(input.QuoteCharacter)) .withName("QuoteCharacter"); @@ -10458,15 +10419,15 @@ const serializeAws_restXmlCSVOutput = (input: CSVOutput, context: __SerdeContext const serializeAws_restXmlDefaultRetention = (input: DefaultRetention, context: __SerdeContext): any => { const bodyNode = new __XmlNode("DefaultRetention"); - if (input.Mode !== undefined) { + if (input.Mode !== undefined && input.Mode !== null) { const node = new __XmlNode("ObjectLockRetentionMode").addChildNode(new __XmlText(input.Mode)).withName("Mode"); bodyNode.addChildNode(node); } - if (input.Days !== undefined) { + if (input.Days !== undefined && input.Days !== null) { const node = new __XmlNode("Days").addChildNode(new __XmlText(String(input.Days))).withName("Days"); bodyNode.addChildNode(node); } - if (input.Years !== undefined) { + if (input.Years !== undefined && input.Years !== null) { const node = new __XmlNode("Years").addChildNode(new __XmlText(String(input.Years))).withName("Years"); bodyNode.addChildNode(node); } @@ -10475,14 +10436,14 @@ const serializeAws_restXmlDefaultRetention = (input: DefaultRetention, context: const serializeAws_restXmlDelete = (input: Delete, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Delete"); - if (input.Objects !== undefined) { + if (input.Objects !== undefined && input.Objects !== null) { const nodes = serializeAws_restXmlObjectIdentifierList(input.Objects, context); nodes.map((node: any) => { node = node.withName("Object"); bodyNode.addChildNode(node); }); } - if (input.Quiet !== undefined) { + if (input.Quiet !== undefined && input.Quiet !== null) { const node = new __XmlNode("Quiet").addChildNode(new __XmlText(String(input.Quiet))).withName("Quiet"); bodyNode.addChildNode(node); } @@ -10491,7 +10452,7 @@ const serializeAws_restXmlDelete = (input: Delete, context: __SerdeContext): any const serializeAws_restXmlDeleteMarkerReplication = (input: DeleteMarkerReplication, context: __SerdeContext): any => { const bodyNode = new __XmlNode("DeleteMarkerReplication"); - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("DeleteMarkerReplicationStatus") .addChildNode(new __XmlText(input.Status)) .withName("Status"); @@ -10502,35 +10463,35 @@ const serializeAws_restXmlDeleteMarkerReplication = (input: DeleteMarkerReplicat const serializeAws_restXmlDestination = (input: Destination, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Destination"); - if (input.Bucket !== undefined) { + if (input.Bucket !== undefined && input.Bucket !== null) { const node = new __XmlNode("BucketName").addChildNode(new __XmlText(input.Bucket)).withName("Bucket"); bodyNode.addChildNode(node); } - if (input.Account !== undefined) { + if (input.Account !== undefined && input.Account !== null) { const node = new __XmlNode("AccountId").addChildNode(new __XmlText(input.Account)).withName("Account"); bodyNode.addChildNode(node); } - if (input.StorageClass !== undefined) { + if (input.StorageClass !== undefined && input.StorageClass !== null) { const node = new __XmlNode("StorageClass").addChildNode(new __XmlText(input.StorageClass)).withName("StorageClass"); bodyNode.addChildNode(node); } - if (input.AccessControlTranslation !== undefined) { + if (input.AccessControlTranslation !== undefined && input.AccessControlTranslation !== null) { const node = serializeAws_restXmlAccessControlTranslation(input.AccessControlTranslation, context).withName( "AccessControlTranslation" ); bodyNode.addChildNode(node); } - if (input.EncryptionConfiguration !== undefined) { + if (input.EncryptionConfiguration !== undefined && input.EncryptionConfiguration !== null) { const node = serializeAws_restXmlEncryptionConfiguration(input.EncryptionConfiguration, context).withName( "EncryptionConfiguration" ); bodyNode.addChildNode(node); } - if (input.ReplicationTime !== undefined) { + if (input.ReplicationTime !== undefined && input.ReplicationTime !== null) { const node = serializeAws_restXmlReplicationTime(input.ReplicationTime, context).withName("ReplicationTime"); bodyNode.addChildNode(node); } - if (input.Metrics !== undefined) { + if (input.Metrics !== undefined && input.Metrics !== null) { const node = serializeAws_restXmlMetrics(input.Metrics, context).withName("Metrics"); bodyNode.addChildNode(node); } @@ -10539,17 +10500,17 @@ const serializeAws_restXmlDestination = (input: Destination, context: __SerdeCon const serializeAws_restXmlEncryption = (input: Encryption, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Encryption"); - if (input.EncryptionType !== undefined) { + if (input.EncryptionType !== undefined && input.EncryptionType !== null) { const node = new __XmlNode("ServerSideEncryption") .addChildNode(new __XmlText(input.EncryptionType)) .withName("EncryptionType"); bodyNode.addChildNode(node); } - if (input.KMSKeyId !== undefined) { + if (input.KMSKeyId !== undefined && input.KMSKeyId !== null) { const node = new __XmlNode("SSEKMSKeyId").addChildNode(new __XmlText(input.KMSKeyId)).withName("KMSKeyId"); bodyNode.addChildNode(node); } - if (input.KMSContext !== undefined) { + if (input.KMSContext !== undefined && input.KMSContext !== null) { const node = new __XmlNode("KMSContext").addChildNode(new __XmlText(input.KMSContext)).withName("KMSContext"); bodyNode.addChildNode(node); } @@ -10558,7 +10519,7 @@ const serializeAws_restXmlEncryption = (input: Encryption, context: __SerdeConte const serializeAws_restXmlEncryptionConfiguration = (input: EncryptionConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("EncryptionConfiguration"); - if (input.ReplicaKmsKeyID !== undefined) { + if (input.ReplicaKmsKeyID !== undefined && input.ReplicaKmsKeyID !== null) { const node = new __XmlNode("ReplicaKmsKeyID") .addChildNode(new __XmlText(input.ReplicaKmsKeyID)) .withName("ReplicaKmsKeyID"); @@ -10569,7 +10530,7 @@ const serializeAws_restXmlEncryptionConfiguration = (input: EncryptionConfigurat const serializeAws_restXmlErrorDocument = (input: ErrorDocument, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ErrorDocument"); - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { const node = new __XmlNode("ObjectKey").addChildNode(new __XmlText(input.Key)).withName("Key"); bodyNode.addChildNode(node); } @@ -10577,10 +10538,15 @@ const serializeAws_restXmlErrorDocument = (input: ErrorDocument, context: __Serd }; const serializeAws_restXmlEventList = (input: (Event | string)[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("Event").addChildNode(new __XmlText(entry)); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("Event").addChildNode(new __XmlText(entry)); + return node.withName("member"); + }); }; const serializeAws_restXmlExistingObjectReplication = ( @@ -10588,7 +10554,7 @@ const serializeAws_restXmlExistingObjectReplication = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("ExistingObjectReplication"); - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("ExistingObjectReplicationStatus") .addChildNode(new __XmlText(input.Status)) .withName("Status"); @@ -10598,19 +10564,24 @@ const serializeAws_restXmlExistingObjectReplication = ( }; const serializeAws_restXmlExposeHeaders = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = new __XmlNode("ExposeHeader").addChildNode(new __XmlText(entry)); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("ExposeHeader").addChildNode(new __XmlText(entry)); + return node.withName("member"); + }); }; const serializeAws_restXmlFilterRule = (input: FilterRule, context: __SerdeContext): any => { const bodyNode = new __XmlNode("FilterRule"); - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { const node = new __XmlNode("FilterRuleName").addChildNode(new __XmlText(input.Name)).withName("Name"); bodyNode.addChildNode(node); } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { const node = new __XmlNode("FilterRuleValue").addChildNode(new __XmlText(input.Value)).withName("Value"); bodyNode.addChildNode(node); } @@ -10618,15 +10589,20 @@ const serializeAws_restXmlFilterRule = (input: FilterRule, context: __SerdeConte }; const serializeAws_restXmlFilterRuleList = (input: FilterRule[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlFilterRule(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlFilterRule(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlGlacierJobParameters = (input: GlacierJobParameters, context: __SerdeContext): any => { const bodyNode = new __XmlNode("GlacierJobParameters"); - if (input.Tier !== undefined) { + if (input.Tier !== undefined && input.Tier !== null) { const node = new __XmlNode("Tier").addChildNode(new __XmlText(input.Tier)).withName("Tier"); bodyNode.addChildNode(node); } @@ -10635,11 +10611,11 @@ const serializeAws_restXmlGlacierJobParameters = (input: GlacierJobParameters, c const serializeAws_restXmlGrant = (input: Grant, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Grant"); - if (input.Grantee !== undefined) { + if (input.Grantee !== undefined && input.Grantee !== null) { const node = serializeAws_restXmlGrantee(input.Grantee, context).withName("Grantee"); bodyNode.addChildNode(node); } - if (input.Permission !== undefined) { + if (input.Permission !== undefined && input.Permission !== null) { const node = new __XmlNode("Permission").addChildNode(new __XmlText(input.Permission)).withName("Permission"); bodyNode.addChildNode(node); } @@ -10648,38 +10624,43 @@ const serializeAws_restXmlGrant = (input: Grant, context: __SerdeContext): any = const serializeAws_restXmlGrantee = (input: Grantee, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Grantee"); - if (input.DisplayName !== undefined) { + if (input.DisplayName !== undefined && input.DisplayName !== null) { const node = new __XmlNode("DisplayName").addChildNode(new __XmlText(input.DisplayName)).withName("DisplayName"); bodyNode.addChildNode(node); } - if (input.EmailAddress !== undefined) { + if (input.EmailAddress !== undefined && input.EmailAddress !== null) { const node = new __XmlNode("EmailAddress").addChildNode(new __XmlText(input.EmailAddress)).withName("EmailAddress"); bodyNode.addChildNode(node); } - if (input.ID !== undefined) { + if (input.ID !== undefined && input.ID !== null) { const node = new __XmlNode("ID").addChildNode(new __XmlText(input.ID)).withName("ID"); bodyNode.addChildNode(node); } - if (input.URI !== undefined) { + if (input.URI !== undefined && input.URI !== null) { const node = new __XmlNode("URI").addChildNode(new __XmlText(input.URI)).withName("URI"); bodyNode.addChildNode(node); } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { bodyNode.addAttribute("xsi:type", input.Type); } return bodyNode; }; const serializeAws_restXmlGrants = (input: Grant[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlGrant(entry, context); - return node.withName("Grant"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlGrant(entry, context); + return node.withName("Grant"); + }); }; const serializeAws_restXmlIndexDocument = (input: IndexDocument, context: __SerdeContext): any => { const bodyNode = new __XmlNode("IndexDocument"); - if (input.Suffix !== undefined) { + if (input.Suffix !== undefined && input.Suffix !== null) { const node = new __XmlNode("Suffix").addChildNode(new __XmlText(input.Suffix)).withName("Suffix"); bodyNode.addChildNode(node); } @@ -10688,21 +10669,21 @@ const serializeAws_restXmlIndexDocument = (input: IndexDocument, context: __Serd const serializeAws_restXmlInputSerialization = (input: InputSerialization, context: __SerdeContext): any => { const bodyNode = new __XmlNode("InputSerialization"); - if (input.CSV !== undefined) { + if (input.CSV !== undefined && input.CSV !== null) { const node = serializeAws_restXmlCSVInput(input.CSV, context).withName("CSV"); bodyNode.addChildNode(node); } - if (input.CompressionType !== undefined) { + if (input.CompressionType !== undefined && input.CompressionType !== null) { const node = new __XmlNode("CompressionType") .addChildNode(new __XmlText(input.CompressionType)) .withName("CompressionType"); bodyNode.addChildNode(node); } - if (input.JSON !== undefined) { + if (input.JSON !== undefined && input.JSON !== null) { const node = serializeAws_restXmlJSONInput(input.JSON, context).withName("JSON"); bodyNode.addChildNode(node); } - if (input.Parquet !== undefined) { + if (input.Parquet !== undefined && input.Parquet !== null) { const node = serializeAws_restXmlParquetInput(input.Parquet, context).withName("Parquet"); bodyNode.addChildNode(node); } @@ -10714,11 +10695,11 @@ const serializeAws_restXmlIntelligentTieringAndOperator = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("IntelligentTieringAndOperator"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const nodes = serializeAws_restXmlTagSet(input.Tags, context); nodes.map((node: any) => { node = node.withName("Tag"); @@ -10733,19 +10714,19 @@ const serializeAws_restXmlIntelligentTieringConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("IntelligentTieringConfiguration"); - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("IntelligentTieringId").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlIntelligentTieringFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("IntelligentTieringStatus").addChildNode(new __XmlText(input.Status)).withName("Status"); bodyNode.addChildNode(node); } - if (input.Tierings !== undefined) { + if (input.Tierings !== undefined && input.Tierings !== null) { const nodes = serializeAws_restXmlTieringList(input.Tierings, context); nodes.map((node: any) => { node = node.withName("Tiering"); @@ -10760,15 +10741,15 @@ const serializeAws_restXmlIntelligentTieringFilter = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("IntelligentTieringFilter"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Tag !== undefined) { + if (input.Tag !== undefined && input.Tag !== null) { const node = serializeAws_restXmlTag(input.Tag, context).withName("Tag"); bodyNode.addChildNode(node); } - if (input.And !== undefined) { + if (input.And !== undefined && input.And !== null) { const node = serializeAws_restXmlIntelligentTieringAndOperator(input.And, context).withName("And"); bodyNode.addChildNode(node); } @@ -10777,29 +10758,29 @@ const serializeAws_restXmlIntelligentTieringFilter = ( const serializeAws_restXmlInventoryConfiguration = (input: InventoryConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("InventoryConfiguration"); - if (input.Destination !== undefined) { + if (input.Destination !== undefined && input.Destination !== null) { const node = serializeAws_restXmlInventoryDestination(input.Destination, context).withName("Destination"); bodyNode.addChildNode(node); } - if (input.IsEnabled !== undefined) { + if (input.IsEnabled !== undefined && input.IsEnabled !== null) { const node = new __XmlNode("IsEnabled").addChildNode(new __XmlText(String(input.IsEnabled))).withName("IsEnabled"); bodyNode.addChildNode(node); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlInventoryFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("InventoryId").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } - if (input.IncludedObjectVersions !== undefined) { + if (input.IncludedObjectVersions !== undefined && input.IncludedObjectVersions !== null) { const node = new __XmlNode("InventoryIncludedObjectVersions") .addChildNode(new __XmlText(input.IncludedObjectVersions)) .withName("IncludedObjectVersions"); bodyNode.addChildNode(node); } - if (input.OptionalFields !== undefined) { + if (input.OptionalFields !== undefined && input.OptionalFields !== null) { const nodes = serializeAws_restXmlInventoryOptionalFields(input.OptionalFields, context); const containerNode = new __XmlNode("OptionalFields"); nodes.map((node: any) => { @@ -10807,7 +10788,7 @@ const serializeAws_restXmlInventoryConfiguration = (input: InventoryConfiguratio }); bodyNode.addChildNode(containerNode); } - if (input.Schedule !== undefined) { + if (input.Schedule !== undefined && input.Schedule !== null) { const node = serializeAws_restXmlInventorySchedule(input.Schedule, context).withName("Schedule"); bodyNode.addChildNode(node); } @@ -10816,7 +10797,7 @@ const serializeAws_restXmlInventoryConfiguration = (input: InventoryConfiguratio const serializeAws_restXmlInventoryDestination = (input: InventoryDestination, context: __SerdeContext): any => { const bodyNode = new __XmlNode("InventoryDestination"); - if (input.S3BucketDestination !== undefined) { + if (input.S3BucketDestination !== undefined && input.S3BucketDestination !== null) { const node = serializeAws_restXmlInventoryS3BucketDestination(input.S3BucketDestination, context).withName( "S3BucketDestination" ); @@ -10827,11 +10808,11 @@ const serializeAws_restXmlInventoryDestination = (input: InventoryDestination, c const serializeAws_restXmlInventoryEncryption = (input: InventoryEncryption, context: __SerdeContext): any => { const bodyNode = new __XmlNode("InventoryEncryption"); - if (input.SSES3 !== undefined) { + if (input.SSES3 !== undefined && input.SSES3 !== null) { const node = serializeAws_restXmlSSES3(input.SSES3, context).withName("SSE-S3"); bodyNode.addChildNode(node); } - if (input.SSEKMS !== undefined) { + if (input.SSEKMS !== undefined && input.SSEKMS !== null) { const node = serializeAws_restXmlSSEKMS(input.SSEKMS, context).withName("SSE-KMS"); bodyNode.addChildNode(node); } @@ -10840,7 +10821,7 @@ const serializeAws_restXmlInventoryEncryption = (input: InventoryEncryption, con const serializeAws_restXmlInventoryFilter = (input: InventoryFilter, context: __SerdeContext): any => { const bodyNode = new __XmlNode("InventoryFilter"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } @@ -10851,10 +10832,15 @@ const serializeAws_restXmlInventoryOptionalFields = ( input: (InventoryOptionalField | string)[], context: __SerdeContext ): any => { - return input.map((entry) => { - const node = new __XmlNode("InventoryOptionalField").addChildNode(new __XmlText(entry)); - return node.withName("Field"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = new __XmlNode("InventoryOptionalField").addChildNode(new __XmlText(entry)); + return node.withName("Field"); + }); }; const serializeAws_restXmlInventoryS3BucketDestination = ( @@ -10862,23 +10848,23 @@ const serializeAws_restXmlInventoryS3BucketDestination = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("InventoryS3BucketDestination"); - if (input.AccountId !== undefined) { + if (input.AccountId !== undefined && input.AccountId !== null) { const node = new __XmlNode("AccountId").addChildNode(new __XmlText(input.AccountId)).withName("AccountId"); bodyNode.addChildNode(node); } - if (input.Bucket !== undefined) { + if (input.Bucket !== undefined && input.Bucket !== null) { const node = new __XmlNode("BucketName").addChildNode(new __XmlText(input.Bucket)).withName("Bucket"); bodyNode.addChildNode(node); } - if (input.Format !== undefined) { + if (input.Format !== undefined && input.Format !== null) { const node = new __XmlNode("InventoryFormat").addChildNode(new __XmlText(input.Format)).withName("Format"); bodyNode.addChildNode(node); } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Encryption !== undefined) { + if (input.Encryption !== undefined && input.Encryption !== null) { const node = serializeAws_restXmlInventoryEncryption(input.Encryption, context).withName("Encryption"); bodyNode.addChildNode(node); } @@ -10887,7 +10873,7 @@ const serializeAws_restXmlInventoryS3BucketDestination = ( const serializeAws_restXmlInventorySchedule = (input: InventorySchedule, context: __SerdeContext): any => { const bodyNode = new __XmlNode("InventorySchedule"); - if (input.Frequency !== undefined) { + if (input.Frequency !== undefined && input.Frequency !== null) { const node = new __XmlNode("InventoryFrequency").addChildNode(new __XmlText(input.Frequency)).withName("Frequency"); bodyNode.addChildNode(node); } @@ -10896,7 +10882,7 @@ const serializeAws_restXmlInventorySchedule = (input: InventorySchedule, context const serializeAws_restXmlJSONInput = (input: JSONInput, context: __SerdeContext): any => { const bodyNode = new __XmlNode("JSONInput"); - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { const node = new __XmlNode("JSONType").addChildNode(new __XmlText(input.Type)).withName("Type"); bodyNode.addChildNode(node); } @@ -10905,7 +10891,7 @@ const serializeAws_restXmlJSONInput = (input: JSONInput, context: __SerdeContext const serializeAws_restXmlJSONOutput = (input: JSONOutput, context: __SerdeContext): any => { const bodyNode = new __XmlNode("JSONOutput"); - if (input.RecordDelimiter !== undefined) { + if (input.RecordDelimiter !== undefined && input.RecordDelimiter !== null) { const node = new __XmlNode("RecordDelimiter") .addChildNode(new __XmlText(input.RecordDelimiter)) .withName("RecordDelimiter"); @@ -10919,24 +10905,24 @@ const serializeAws_restXmlLambdaFunctionConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("LambdaFunctionConfiguration"); - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("NotificationId").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } - if (input.LambdaFunctionArn !== undefined) { + if (input.LambdaFunctionArn !== undefined && input.LambdaFunctionArn !== null) { const node = new __XmlNode("LambdaFunctionArn") .addChildNode(new __XmlText(input.LambdaFunctionArn)) .withName("CloudFunction"); bodyNode.addChildNode(node); } - if (input.Events !== undefined) { + if (input.Events !== undefined && input.Events !== null) { const nodes = serializeAws_restXmlEventList(input.Events, context); nodes.map((node: any) => { node = node.withName("Event"); bodyNode.addChildNode(node); }); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlNotificationConfigurationFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } @@ -10947,25 +10933,30 @@ const serializeAws_restXmlLambdaFunctionConfigurationList = ( input: LambdaFunctionConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => { - const node = serializeAws_restXmlLambdaFunctionConfiguration(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlLambdaFunctionConfiguration(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlLifecycleExpiration = (input: LifecycleExpiration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("LifecycleExpiration"); - if (input.Date !== undefined) { + if (input.Date !== undefined && input.Date !== null) { const node = new __XmlNode("Date") .addChildNode(new __XmlText(input.Date.toISOString().split(".")[0] + "Z")) .withName("Date"); bodyNode.addChildNode(node); } - if (input.Days !== undefined) { + if (input.Days !== undefined && input.Days !== null) { const node = new __XmlNode("Days").addChildNode(new __XmlText(String(input.Days))).withName("Days"); bodyNode.addChildNode(node); } - if (input.ExpiredObjectDeleteMarker !== undefined) { + if (input.ExpiredObjectDeleteMarker !== undefined && input.ExpiredObjectDeleteMarker !== null) { const node = new __XmlNode("ExpiredObjectDeleteMarker") .addChildNode(new __XmlText(String(input.ExpiredObjectDeleteMarker))) .withName("ExpiredObjectDeleteMarker"); @@ -10976,47 +10967,47 @@ const serializeAws_restXmlLifecycleExpiration = (input: LifecycleExpiration, con const serializeAws_restXmlLifecycleRule = (input: LifecycleRule, context: __SerdeContext): any => { const bodyNode = new __XmlNode("LifecycleRule"); - if (input.Expiration !== undefined) { + if (input.Expiration !== undefined && input.Expiration !== null) { const node = serializeAws_restXmlLifecycleExpiration(input.Expiration, context).withName("Expiration"); bodyNode.addChildNode(node); } - if (input.ID !== undefined) { + if (input.ID !== undefined && input.ID !== null) { const node = new __XmlNode("ID").addChildNode(new __XmlText(input.ID)).withName("ID"); bodyNode.addChildNode(node); } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlLifecycleRuleFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("ExpirationStatus").addChildNode(new __XmlText(input.Status)).withName("Status"); bodyNode.addChildNode(node); } - if (input.Transitions !== undefined) { + if (input.Transitions !== undefined && input.Transitions !== null) { const nodes = serializeAws_restXmlTransitionList(input.Transitions, context); nodes.map((node: any) => { node = node.withName("Transition"); bodyNode.addChildNode(node); }); } - if (input.NoncurrentVersionTransitions !== undefined) { + if (input.NoncurrentVersionTransitions !== undefined && input.NoncurrentVersionTransitions !== null) { const nodes = serializeAws_restXmlNoncurrentVersionTransitionList(input.NoncurrentVersionTransitions, context); nodes.map((node: any) => { node = node.withName("NoncurrentVersionTransition"); bodyNode.addChildNode(node); }); } - if (input.NoncurrentVersionExpiration !== undefined) { + if (input.NoncurrentVersionExpiration !== undefined && input.NoncurrentVersionExpiration !== null) { const node = serializeAws_restXmlNoncurrentVersionExpiration(input.NoncurrentVersionExpiration, context).withName( "NoncurrentVersionExpiration" ); bodyNode.addChildNode(node); } - if (input.AbortIncompleteMultipartUpload !== undefined) { + if (input.AbortIncompleteMultipartUpload !== undefined && input.AbortIncompleteMultipartUpload !== null) { const node = serializeAws_restXmlAbortIncompleteMultipartUpload( input.AbortIncompleteMultipartUpload, context @@ -11031,11 +11022,11 @@ const serializeAws_restXmlLifecycleRuleAndOperator = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("LifecycleRuleAndOperator"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const nodes = serializeAws_restXmlTagSet(input.Tags, context); nodes.map((node: any) => { node = node.withName("Tag"); @@ -11071,19 +11062,24 @@ const serializeAws_restXmlLifecycleRuleFilter = (input: LifecycleRuleFilter, con }; const serializeAws_restXmlLifecycleRules = (input: LifecycleRule[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlLifecycleRule(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlLifecycleRule(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlLoggingEnabled = (input: LoggingEnabled, context: __SerdeContext): any => { const bodyNode = new __XmlNode("LoggingEnabled"); - if (input.TargetBucket !== undefined) { + if (input.TargetBucket !== undefined && input.TargetBucket !== null) { const node = new __XmlNode("TargetBucket").addChildNode(new __XmlText(input.TargetBucket)).withName("TargetBucket"); bodyNode.addChildNode(node); } - if (input.TargetGrants !== undefined) { + if (input.TargetGrants !== undefined && input.TargetGrants !== null) { const nodes = serializeAws_restXmlTargetGrants(input.TargetGrants, context); const containerNode = new __XmlNode("TargetGrants"); nodes.map((node: any) => { @@ -11091,7 +11087,7 @@ const serializeAws_restXmlLoggingEnabled = (input: LoggingEnabled, context: __Se }); bodyNode.addChildNode(containerNode); } - if (input.TargetPrefix !== undefined) { + if (input.TargetPrefix !== undefined && input.TargetPrefix !== null) { const node = new __XmlNode("TargetPrefix").addChildNode(new __XmlText(input.TargetPrefix)).withName("TargetPrefix"); bodyNode.addChildNode(node); } @@ -11100,11 +11096,11 @@ const serializeAws_restXmlLoggingEnabled = (input: LoggingEnabled, context: __Se const serializeAws_restXmlMetadataEntry = (input: MetadataEntry, context: __SerdeContext): any => { const bodyNode = new __XmlNode("MetadataEntry"); - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { const node = new __XmlNode("MetadataKey").addChildNode(new __XmlText(input.Name)).withName("Name"); bodyNode.addChildNode(node); } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { const node = new __XmlNode("MetadataValue").addChildNode(new __XmlText(input.Value)).withName("Value"); bodyNode.addChildNode(node); } @@ -11113,11 +11109,11 @@ const serializeAws_restXmlMetadataEntry = (input: MetadataEntry, context: __Serd const serializeAws_restXmlMetrics = (input: Metrics, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Metrics"); - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("MetricsStatus").addChildNode(new __XmlText(input.Status)).withName("Status"); bodyNode.addChildNode(node); } - if (input.EventThreshold !== undefined) { + if (input.EventThreshold !== undefined && input.EventThreshold !== null) { const node = serializeAws_restXmlReplicationTimeValue(input.EventThreshold, context).withName("EventThreshold"); bodyNode.addChildNode(node); } @@ -11126,11 +11122,11 @@ const serializeAws_restXmlMetrics = (input: Metrics, context: __SerdeContext): a const serializeAws_restXmlMetricsAndOperator = (input: MetricsAndOperator, context: __SerdeContext): any => { const bodyNode = new __XmlNode("MetricsAndOperator"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const nodes = serializeAws_restXmlTagSet(input.Tags, context); nodes.map((node: any) => { node = node.withName("Tag"); @@ -11142,11 +11138,11 @@ const serializeAws_restXmlMetricsAndOperator = (input: MetricsAndOperator, conte const serializeAws_restXmlMetricsConfiguration = (input: MetricsConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("MetricsConfiguration"); - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("MetricsId").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlMetricsFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } @@ -11183,7 +11179,7 @@ const serializeAws_restXmlNoncurrentVersionExpiration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("NoncurrentVersionExpiration"); - if (input.NoncurrentDays !== undefined) { + if (input.NoncurrentDays !== undefined && input.NoncurrentDays !== null) { const node = new __XmlNode("Days") .addChildNode(new __XmlText(String(input.NoncurrentDays))) .withName("NoncurrentDays"); @@ -11197,13 +11193,13 @@ const serializeAws_restXmlNoncurrentVersionTransition = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("NoncurrentVersionTransition"); - if (input.NoncurrentDays !== undefined) { + if (input.NoncurrentDays !== undefined && input.NoncurrentDays !== null) { const node = new __XmlNode("Days") .addChildNode(new __XmlText(String(input.NoncurrentDays))) .withName("NoncurrentDays"); bodyNode.addChildNode(node); } - if (input.StorageClass !== undefined) { + if (input.StorageClass !== undefined && input.StorageClass !== null) { const node = new __XmlNode("TransitionStorageClass") .addChildNode(new __XmlText(input.StorageClass)) .withName("StorageClass"); @@ -11216,10 +11212,15 @@ const serializeAws_restXmlNoncurrentVersionTransitionList = ( input: NoncurrentVersionTransition[], context: __SerdeContext ): any => { - return input.map((entry) => { - const node = serializeAws_restXmlNoncurrentVersionTransition(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlNoncurrentVersionTransition(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlNotificationConfiguration = ( @@ -11227,21 +11228,21 @@ const serializeAws_restXmlNotificationConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("NotificationConfiguration"); - if (input.TopicConfigurations !== undefined) { + if (input.TopicConfigurations !== undefined && input.TopicConfigurations !== null) { const nodes = serializeAws_restXmlTopicConfigurationList(input.TopicConfigurations, context); nodes.map((node: any) => { node = node.withName("TopicConfiguration"); bodyNode.addChildNode(node); }); } - if (input.QueueConfigurations !== undefined) { + if (input.QueueConfigurations !== undefined && input.QueueConfigurations !== null) { const nodes = serializeAws_restXmlQueueConfigurationList(input.QueueConfigurations, context); nodes.map((node: any) => { node = node.withName("QueueConfiguration"); bodyNode.addChildNode(node); }); } - if (input.LambdaFunctionConfigurations !== undefined) { + if (input.LambdaFunctionConfigurations !== undefined && input.LambdaFunctionConfigurations !== null) { const nodes = serializeAws_restXmlLambdaFunctionConfigurationList(input.LambdaFunctionConfigurations, context); nodes.map((node: any) => { node = node.withName("CloudFunctionConfiguration"); @@ -11256,7 +11257,7 @@ const serializeAws_restXmlNotificationConfigurationFilter = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("NotificationConfigurationFilter"); - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { const node = serializeAws_restXmlS3KeyFilter(input.Key, context).withName("S3Key"); bodyNode.addChildNode(node); } @@ -11265,11 +11266,11 @@ const serializeAws_restXmlNotificationConfigurationFilter = ( const serializeAws_restXmlObjectIdentifier = (input: ObjectIdentifier, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ObjectIdentifier"); - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { const node = new __XmlNode("ObjectKey").addChildNode(new __XmlText(input.Key)).withName("Key"); bodyNode.addChildNode(node); } - if (input.VersionId !== undefined) { + if (input.VersionId !== undefined && input.VersionId !== null) { const node = new __XmlNode("ObjectVersionId").addChildNode(new __XmlText(input.VersionId)).withName("VersionId"); bodyNode.addChildNode(node); } @@ -11277,21 +11278,26 @@ const serializeAws_restXmlObjectIdentifier = (input: ObjectIdentifier, context: }; const serializeAws_restXmlObjectIdentifierList = (input: ObjectIdentifier[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlObjectIdentifier(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlObjectIdentifier(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlObjectLockConfiguration = (input: ObjectLockConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ObjectLockConfiguration"); - if (input.ObjectLockEnabled !== undefined) { + if (input.ObjectLockEnabled !== undefined && input.ObjectLockEnabled !== null) { const node = new __XmlNode("ObjectLockEnabled") .addChildNode(new __XmlText(input.ObjectLockEnabled)) .withName("ObjectLockEnabled"); bodyNode.addChildNode(node); } - if (input.Rule !== undefined) { + if (input.Rule !== undefined && input.Rule !== null) { const node = serializeAws_restXmlObjectLockRule(input.Rule, context).withName("Rule"); bodyNode.addChildNode(node); } @@ -11300,7 +11306,7 @@ const serializeAws_restXmlObjectLockConfiguration = (input: ObjectLockConfigurat const serializeAws_restXmlObjectLockLegalHold = (input: ObjectLockLegalHold, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ObjectLockLegalHold"); - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("ObjectLockLegalHoldStatus") .addChildNode(new __XmlText(input.Status)) .withName("Status"); @@ -11311,11 +11317,11 @@ const serializeAws_restXmlObjectLockLegalHold = (input: ObjectLockLegalHold, con const serializeAws_restXmlObjectLockRetention = (input: ObjectLockRetention, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ObjectLockRetention"); - if (input.Mode !== undefined) { + if (input.Mode !== undefined && input.Mode !== null) { const node = new __XmlNode("ObjectLockRetentionMode").addChildNode(new __XmlText(input.Mode)).withName("Mode"); bodyNode.addChildNode(node); } - if (input.RetainUntilDate !== undefined) { + if (input.RetainUntilDate !== undefined && input.RetainUntilDate !== null) { const node = new __XmlNode("Date") .addChildNode(new __XmlText(input.RetainUntilDate.toISOString().split(".")[0] + "Z")) .withName("RetainUntilDate"); @@ -11326,7 +11332,7 @@ const serializeAws_restXmlObjectLockRetention = (input: ObjectLockRetention, con const serializeAws_restXmlObjectLockRule = (input: ObjectLockRule, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ObjectLockRule"); - if (input.DefaultRetention !== undefined) { + if (input.DefaultRetention !== undefined && input.DefaultRetention !== null) { const node = serializeAws_restXmlDefaultRetention(input.DefaultRetention, context).withName("DefaultRetention"); bodyNode.addChildNode(node); } @@ -11335,7 +11341,7 @@ const serializeAws_restXmlObjectLockRule = (input: ObjectLockRule, context: __Se const serializeAws_restXmlOutputLocation = (input: OutputLocation, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OutputLocation"); - if (input.S3 !== undefined) { + if (input.S3 !== undefined && input.S3 !== null) { const node = serializeAws_restXmlS3Location(input.S3, context).withName("S3"); bodyNode.addChildNode(node); } @@ -11344,11 +11350,11 @@ const serializeAws_restXmlOutputLocation = (input: OutputLocation, context: __Se const serializeAws_restXmlOutputSerialization = (input: OutputSerialization, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OutputSerialization"); - if (input.CSV !== undefined) { + if (input.CSV !== undefined && input.CSV !== null) { const node = serializeAws_restXmlCSVOutput(input.CSV, context).withName("CSV"); bodyNode.addChildNode(node); } - if (input.JSON !== undefined) { + if (input.JSON !== undefined && input.JSON !== null) { const node = serializeAws_restXmlJSONOutput(input.JSON, context).withName("JSON"); bodyNode.addChildNode(node); } @@ -11357,11 +11363,11 @@ const serializeAws_restXmlOutputSerialization = (input: OutputSerialization, con const serializeAws_restXmlOwner = (input: Owner, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Owner"); - if (input.DisplayName !== undefined) { + if (input.DisplayName !== undefined && input.DisplayName !== null) { const node = new __XmlNode("DisplayName").addChildNode(new __XmlText(input.DisplayName)).withName("DisplayName"); bodyNode.addChildNode(node); } - if (input.ID !== undefined) { + if (input.ID !== undefined && input.ID !== null) { const node = new __XmlNode("ID").addChildNode(new __XmlText(input.ID)).withName("ID"); bodyNode.addChildNode(node); } @@ -11370,7 +11376,7 @@ const serializeAws_restXmlOwner = (input: Owner, context: __SerdeContext): any = const serializeAws_restXmlOwnershipControls = (input: OwnershipControls, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OwnershipControls"); - if (input.Rules !== undefined) { + if (input.Rules !== undefined && input.Rules !== null) { const nodes = serializeAws_restXmlOwnershipControlsRules(input.Rules, context); nodes.map((node: any) => { node = node.withName("Rule"); @@ -11382,7 +11388,7 @@ const serializeAws_restXmlOwnershipControls = (input: OwnershipControls, context const serializeAws_restXmlOwnershipControlsRule = (input: OwnershipControlsRule, context: __SerdeContext): any => { const bodyNode = new __XmlNode("OwnershipControlsRule"); - if (input.ObjectOwnership !== undefined) { + if (input.ObjectOwnership !== undefined && input.ObjectOwnership !== null) { const node = new __XmlNode("ObjectOwnership") .addChildNode(new __XmlText(input.ObjectOwnership)) .withName("ObjectOwnership"); @@ -11392,10 +11398,15 @@ const serializeAws_restXmlOwnershipControlsRule = (input: OwnershipControlsRule, }; const serializeAws_restXmlOwnershipControlsRules = (input: OwnershipControlsRule[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlOwnershipControlsRule(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlOwnershipControlsRule(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlParquetInput = (input: ParquetInput, context: __SerdeContext): any => { @@ -11408,25 +11419,25 @@ const serializeAws_restXmlPublicAccessBlockConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("PublicAccessBlockConfiguration"); - if (input.BlockPublicAcls !== undefined) { + if (input.BlockPublicAcls !== undefined && input.BlockPublicAcls !== null) { const node = new __XmlNode("Setting") .addChildNode(new __XmlText(String(input.BlockPublicAcls))) .withName("BlockPublicAcls"); bodyNode.addChildNode(node); } - if (input.IgnorePublicAcls !== undefined) { + if (input.IgnorePublicAcls !== undefined && input.IgnorePublicAcls !== null) { const node = new __XmlNode("Setting") .addChildNode(new __XmlText(String(input.IgnorePublicAcls))) .withName("IgnorePublicAcls"); bodyNode.addChildNode(node); } - if (input.BlockPublicPolicy !== undefined) { + if (input.BlockPublicPolicy !== undefined && input.BlockPublicPolicy !== null) { const node = new __XmlNode("Setting") .addChildNode(new __XmlText(String(input.BlockPublicPolicy))) .withName("BlockPublicPolicy"); bodyNode.addChildNode(node); } - if (input.RestrictPublicBuckets !== undefined) { + if (input.RestrictPublicBuckets !== undefined && input.RestrictPublicBuckets !== null) { const node = new __XmlNode("Setting") .addChildNode(new __XmlText(String(input.RestrictPublicBuckets))) .withName("RestrictPublicBuckets"); @@ -11437,22 +11448,22 @@ const serializeAws_restXmlPublicAccessBlockConfiguration = ( const serializeAws_restXmlQueueConfiguration = (input: QueueConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("QueueConfiguration"); - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("NotificationId").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } - if (input.QueueArn !== undefined) { + if (input.QueueArn !== undefined && input.QueueArn !== null) { const node = new __XmlNode("QueueArn").addChildNode(new __XmlText(input.QueueArn)).withName("Queue"); bodyNode.addChildNode(node); } - if (input.Events !== undefined) { + if (input.Events !== undefined && input.Events !== null) { const nodes = serializeAws_restXmlEventList(input.Events, context); nodes.map((node: any) => { node = node.withName("Event"); bodyNode.addChildNode(node); }); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlNotificationConfigurationFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } @@ -11460,35 +11471,40 @@ const serializeAws_restXmlQueueConfiguration = (input: QueueConfiguration, conte }; const serializeAws_restXmlQueueConfigurationList = (input: QueueConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlQueueConfiguration(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlQueueConfiguration(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlRedirect = (input: Redirect, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Redirect"); - if (input.HostName !== undefined) { + if (input.HostName !== undefined && input.HostName !== null) { const node = new __XmlNode("HostName").addChildNode(new __XmlText(input.HostName)).withName("HostName"); bodyNode.addChildNode(node); } - if (input.HttpRedirectCode !== undefined) { + if (input.HttpRedirectCode !== undefined && input.HttpRedirectCode !== null) { const node = new __XmlNode("HttpRedirectCode") .addChildNode(new __XmlText(input.HttpRedirectCode)) .withName("HttpRedirectCode"); bodyNode.addChildNode(node); } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { const node = new __XmlNode("Protocol").addChildNode(new __XmlText(input.Protocol)).withName("Protocol"); bodyNode.addChildNode(node); } - if (input.ReplaceKeyPrefixWith !== undefined) { + if (input.ReplaceKeyPrefixWith !== undefined && input.ReplaceKeyPrefixWith !== null) { const node = new __XmlNode("ReplaceKeyPrefixWith") .addChildNode(new __XmlText(input.ReplaceKeyPrefixWith)) .withName("ReplaceKeyPrefixWith"); bodyNode.addChildNode(node); } - if (input.ReplaceKeyWith !== undefined) { + if (input.ReplaceKeyWith !== undefined && input.ReplaceKeyWith !== null) { const node = new __XmlNode("ReplaceKeyWith") .addChildNode(new __XmlText(input.ReplaceKeyWith)) .withName("ReplaceKeyWith"); @@ -11499,11 +11515,11 @@ const serializeAws_restXmlRedirect = (input: Redirect, context: __SerdeContext): const serializeAws_restXmlRedirectAllRequestsTo = (input: RedirectAllRequestsTo, context: __SerdeContext): any => { const bodyNode = new __XmlNode("RedirectAllRequestsTo"); - if (input.HostName !== undefined) { + if (input.HostName !== undefined && input.HostName !== null) { const node = new __XmlNode("HostName").addChildNode(new __XmlText(input.HostName)).withName("HostName"); bodyNode.addChildNode(node); } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { const node = new __XmlNode("Protocol").addChildNode(new __XmlText(input.Protocol)).withName("Protocol"); bodyNode.addChildNode(node); } @@ -11512,7 +11528,7 @@ const serializeAws_restXmlRedirectAllRequestsTo = (input: RedirectAllRequestsTo, const serializeAws_restXmlReplicaModifications = (input: ReplicaModifications, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ReplicaModifications"); - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("ReplicaModificationsStatus") .addChildNode(new __XmlText(input.Status)) .withName("Status"); @@ -11526,11 +11542,11 @@ const serializeAws_restXmlReplicationConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("ReplicationConfiguration"); - if (input.Role !== undefined) { + if (input.Role !== undefined && input.Role !== null) { const node = new __XmlNode("Role").addChildNode(new __XmlText(input.Role)).withName("Role"); bodyNode.addChildNode(node); } - if (input.Rules !== undefined) { + if (input.Rules !== undefined && input.Rules !== null) { const nodes = serializeAws_restXmlReplicationRules(input.Rules, context); nodes.map((node: any) => { node = node.withName("Rule"); @@ -11542,43 +11558,43 @@ const serializeAws_restXmlReplicationConfiguration = ( const serializeAws_restXmlReplicationRule = (input: ReplicationRule, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ReplicationRule"); - if (input.ID !== undefined) { + if (input.ID !== undefined && input.ID !== null) { const node = new __XmlNode("ID").addChildNode(new __XmlText(input.ID)).withName("ID"); bodyNode.addChildNode(node); } - if (input.Priority !== undefined) { + if (input.Priority !== undefined && input.Priority !== null) { const node = new __XmlNode("Priority").addChildNode(new __XmlText(String(input.Priority))).withName("Priority"); bodyNode.addChildNode(node); } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlReplicationRuleFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("ReplicationRuleStatus").addChildNode(new __XmlText(input.Status)).withName("Status"); bodyNode.addChildNode(node); } - if (input.SourceSelectionCriteria !== undefined) { + if (input.SourceSelectionCriteria !== undefined && input.SourceSelectionCriteria !== null) { const node = serializeAws_restXmlSourceSelectionCriteria(input.SourceSelectionCriteria, context).withName( "SourceSelectionCriteria" ); bodyNode.addChildNode(node); } - if (input.ExistingObjectReplication !== undefined) { + if (input.ExistingObjectReplication !== undefined && input.ExistingObjectReplication !== null) { const node = serializeAws_restXmlExistingObjectReplication(input.ExistingObjectReplication, context).withName( "ExistingObjectReplication" ); bodyNode.addChildNode(node); } - if (input.Destination !== undefined) { + if (input.Destination !== undefined && input.Destination !== null) { const node = serializeAws_restXmlDestination(input.Destination, context).withName("Destination"); bodyNode.addChildNode(node); } - if (input.DeleteMarkerReplication !== undefined) { + if (input.DeleteMarkerReplication !== undefined && input.DeleteMarkerReplication !== null) { const node = serializeAws_restXmlDeleteMarkerReplication(input.DeleteMarkerReplication, context).withName( "DeleteMarkerReplication" ); @@ -11592,11 +11608,11 @@ const serializeAws_restXmlReplicationRuleAndOperator = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("ReplicationRuleAndOperator"); - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("Prefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const nodes = serializeAws_restXmlTagSet(input.Tags, context); nodes.map((node: any) => { node = node.withName("Tag"); @@ -11632,19 +11648,24 @@ const serializeAws_restXmlReplicationRuleFilter = (input: ReplicationRuleFilter, }; const serializeAws_restXmlReplicationRules = (input: ReplicationRule[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlReplicationRule(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlReplicationRule(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlReplicationTime = (input: ReplicationTime, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ReplicationTime"); - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("ReplicationTimeStatus").addChildNode(new __XmlText(input.Status)).withName("Status"); bodyNode.addChildNode(node); } - if (input.Time !== undefined) { + if (input.Time !== undefined && input.Time !== null) { const node = serializeAws_restXmlReplicationTimeValue(input.Time, context).withName("Time"); bodyNode.addChildNode(node); } @@ -11653,7 +11674,7 @@ const serializeAws_restXmlReplicationTime = (input: ReplicationTime, context: __ const serializeAws_restXmlReplicationTimeValue = (input: ReplicationTimeValue, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ReplicationTimeValue"); - if (input.Minutes !== undefined) { + if (input.Minutes !== undefined && input.Minutes !== null) { const node = new __XmlNode("Minutes").addChildNode(new __XmlText(String(input.Minutes))).withName("Minutes"); bodyNode.addChildNode(node); } @@ -11665,7 +11686,7 @@ const serializeAws_restXmlRequestPaymentConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("RequestPaymentConfiguration"); - if (input.Payer !== undefined) { + if (input.Payer !== undefined && input.Payer !== null) { const node = new __XmlNode("Payer").addChildNode(new __XmlText(input.Payer)).withName("Payer"); bodyNode.addChildNode(node); } @@ -11674,7 +11695,7 @@ const serializeAws_restXmlRequestPaymentConfiguration = ( const serializeAws_restXmlRequestProgress = (input: RequestProgress, context: __SerdeContext): any => { const bodyNode = new __XmlNode("RequestProgress"); - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { const node = new __XmlNode("EnableRequestProgress") .addChildNode(new __XmlText(String(input.Enabled))) .withName("Enabled"); @@ -11685,33 +11706,33 @@ const serializeAws_restXmlRequestProgress = (input: RequestProgress, context: __ const serializeAws_restXmlRestoreRequest = (input: RestoreRequest, context: __SerdeContext): any => { const bodyNode = new __XmlNode("RestoreRequest"); - if (input.Days !== undefined) { + if (input.Days !== undefined && input.Days !== null) { const node = new __XmlNode("Days").addChildNode(new __XmlText(String(input.Days))).withName("Days"); bodyNode.addChildNode(node); } - if (input.GlacierJobParameters !== undefined) { + if (input.GlacierJobParameters !== undefined && input.GlacierJobParameters !== null) { const node = serializeAws_restXmlGlacierJobParameters(input.GlacierJobParameters, context).withName( "GlacierJobParameters" ); bodyNode.addChildNode(node); } - if (input.Type !== undefined) { + if (input.Type !== undefined && input.Type !== null) { const node = new __XmlNode("RestoreRequestType").addChildNode(new __XmlText(input.Type)).withName("Type"); bodyNode.addChildNode(node); } - if (input.Tier !== undefined) { + if (input.Tier !== undefined && input.Tier !== null) { const node = new __XmlNode("Tier").addChildNode(new __XmlText(input.Tier)).withName("Tier"); bodyNode.addChildNode(node); } - if (input.Description !== undefined) { + if (input.Description !== undefined && input.Description !== null) { const node = new __XmlNode("Description").addChildNode(new __XmlText(input.Description)).withName("Description"); bodyNode.addChildNode(node); } - if (input.SelectParameters !== undefined) { + if (input.SelectParameters !== undefined && input.SelectParameters !== null) { const node = serializeAws_restXmlSelectParameters(input.SelectParameters, context).withName("SelectParameters"); bodyNode.addChildNode(node); } - if (input.OutputLocation !== undefined) { + if (input.OutputLocation !== undefined && input.OutputLocation !== null) { const node = serializeAws_restXmlOutputLocation(input.OutputLocation, context).withName("OutputLocation"); bodyNode.addChildNode(node); } @@ -11720,11 +11741,11 @@ const serializeAws_restXmlRestoreRequest = (input: RestoreRequest, context: __Se const serializeAws_restXmlRoutingRule = (input: RoutingRule, context: __SerdeContext): any => { const bodyNode = new __XmlNode("RoutingRule"); - if (input.Condition !== undefined) { + if (input.Condition !== undefined && input.Condition !== null) { const node = serializeAws_restXmlCondition(input.Condition, context).withName("Condition"); bodyNode.addChildNode(node); } - if (input.Redirect !== undefined) { + if (input.Redirect !== undefined && input.Redirect !== null) { const node = serializeAws_restXmlRedirect(input.Redirect, context).withName("Redirect"); bodyNode.addChildNode(node); } @@ -11732,15 +11753,20 @@ const serializeAws_restXmlRoutingRule = (input: RoutingRule, context: __SerdeCon }; const serializeAws_restXmlRoutingRules = (input: RoutingRule[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlRoutingRule(entry, context); - return node.withName("RoutingRule"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlRoutingRule(entry, context); + return node.withName("RoutingRule"); + }); }; const serializeAws_restXmlS3KeyFilter = (input: S3KeyFilter, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3KeyFilter"); - if (input.FilterRules !== undefined) { + if (input.FilterRules !== undefined && input.FilterRules !== null) { const nodes = serializeAws_restXmlFilterRuleList(input.FilterRules, context); nodes.map((node: any) => { node = node.withName("FilterRule"); @@ -11752,23 +11778,23 @@ const serializeAws_restXmlS3KeyFilter = (input: S3KeyFilter, context: __SerdeCon const serializeAws_restXmlS3Location = (input: S3Location, context: __SerdeContext): any => { const bodyNode = new __XmlNode("S3Location"); - if (input.BucketName !== undefined) { + if (input.BucketName !== undefined && input.BucketName !== null) { const node = new __XmlNode("BucketName").addChildNode(new __XmlText(input.BucketName)).withName("BucketName"); bodyNode.addChildNode(node); } - if (input.Prefix !== undefined) { + if (input.Prefix !== undefined && input.Prefix !== null) { const node = new __XmlNode("LocationPrefix").addChildNode(new __XmlText(input.Prefix)).withName("Prefix"); bodyNode.addChildNode(node); } - if (input.Encryption !== undefined) { + if (input.Encryption !== undefined && input.Encryption !== null) { const node = serializeAws_restXmlEncryption(input.Encryption, context).withName("Encryption"); bodyNode.addChildNode(node); } - if (input.CannedACL !== undefined) { + if (input.CannedACL !== undefined && input.CannedACL !== null) { const node = new __XmlNode("ObjectCannedACL").addChildNode(new __XmlText(input.CannedACL)).withName("CannedACL"); bodyNode.addChildNode(node); } - if (input.AccessControlList !== undefined) { + if (input.AccessControlList !== undefined && input.AccessControlList !== null) { const nodes = serializeAws_restXmlGrants(input.AccessControlList, context); const containerNode = new __XmlNode("AccessControlList"); nodes.map((node: any) => { @@ -11776,11 +11802,11 @@ const serializeAws_restXmlS3Location = (input: S3Location, context: __SerdeConte }); bodyNode.addChildNode(containerNode); } - if (input.Tagging !== undefined) { + if (input.Tagging !== undefined && input.Tagging !== null) { const node = serializeAws_restXmlTagging(input.Tagging, context).withName("Tagging"); bodyNode.addChildNode(node); } - if (input.UserMetadata !== undefined) { + if (input.UserMetadata !== undefined && input.UserMetadata !== null) { const nodes = serializeAws_restXmlUserMetadata(input.UserMetadata, context); const containerNode = new __XmlNode("UserMetadata"); nodes.map((node: any) => { @@ -11788,7 +11814,7 @@ const serializeAws_restXmlS3Location = (input: S3Location, context: __SerdeConte }); bodyNode.addChildNode(containerNode); } - if (input.StorageClass !== undefined) { + if (input.StorageClass !== undefined && input.StorageClass !== null) { const node = new __XmlNode("StorageClass").addChildNode(new __XmlText(input.StorageClass)).withName("StorageClass"); bodyNode.addChildNode(node); } @@ -11797,11 +11823,11 @@ const serializeAws_restXmlS3Location = (input: S3Location, context: __SerdeConte const serializeAws_restXmlScanRange = (input: ScanRange, context: __SerdeContext): any => { const bodyNode = new __XmlNode("ScanRange"); - if (input.Start !== undefined) { + if (input.Start !== undefined && input.Start !== null) { const node = new __XmlNode("Start").addChildNode(new __XmlText(String(input.Start))).withName("Start"); bodyNode.addChildNode(node); } - if (input.End !== undefined) { + if (input.End !== undefined && input.End !== null) { const node = new __XmlNode("End").addChildNode(new __XmlText(String(input.End))).withName("End"); bodyNode.addChildNode(node); } @@ -11810,23 +11836,23 @@ const serializeAws_restXmlScanRange = (input: ScanRange, context: __SerdeContext const serializeAws_restXmlSelectParameters = (input: SelectParameters, context: __SerdeContext): any => { const bodyNode = new __XmlNode("SelectParameters"); - if (input.InputSerialization !== undefined) { + if (input.InputSerialization !== undefined && input.InputSerialization !== null) { const node = serializeAws_restXmlInputSerialization(input.InputSerialization, context).withName( "InputSerialization" ); bodyNode.addChildNode(node); } - if (input.ExpressionType !== undefined) { + if (input.ExpressionType !== undefined && input.ExpressionType !== null) { const node = new __XmlNode("ExpressionType") .addChildNode(new __XmlText(input.ExpressionType)) .withName("ExpressionType"); bodyNode.addChildNode(node); } - if (input.Expression !== undefined) { + if (input.Expression !== undefined && input.Expression !== null) { const node = new __XmlNode("Expression").addChildNode(new __XmlText(input.Expression)).withName("Expression"); bodyNode.addChildNode(node); } - if (input.OutputSerialization !== undefined) { + if (input.OutputSerialization !== undefined && input.OutputSerialization !== null) { const node = serializeAws_restXmlOutputSerialization(input.OutputSerialization, context).withName( "OutputSerialization" ); @@ -11840,13 +11866,13 @@ const serializeAws_restXmlServerSideEncryptionByDefault = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("ServerSideEncryptionByDefault"); - if (input.SSEAlgorithm !== undefined) { + if (input.SSEAlgorithm !== undefined && input.SSEAlgorithm !== null) { const node = new __XmlNode("ServerSideEncryption") .addChildNode(new __XmlText(input.SSEAlgorithm)) .withName("SSEAlgorithm"); bodyNode.addChildNode(node); } - if (input.KMSMasterKeyID !== undefined) { + if (input.KMSMasterKeyID !== undefined && input.KMSMasterKeyID !== null) { const node = new __XmlNode("SSEKMSKeyId") .addChildNode(new __XmlText(input.KMSMasterKeyID)) .withName("KMSMasterKeyID"); @@ -11860,7 +11886,7 @@ const serializeAws_restXmlServerSideEncryptionConfiguration = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("ServerSideEncryptionConfiguration"); - if (input.Rules !== undefined) { + if (input.Rules !== undefined && input.Rules !== null) { const nodes = serializeAws_restXmlServerSideEncryptionRules(input.Rules, context); nodes.map((node: any) => { node = node.withName("Rule"); @@ -11875,14 +11901,14 @@ const serializeAws_restXmlServerSideEncryptionRule = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("ServerSideEncryptionRule"); - if (input.ApplyServerSideEncryptionByDefault !== undefined) { + if (input.ApplyServerSideEncryptionByDefault !== undefined && input.ApplyServerSideEncryptionByDefault !== null) { const node = serializeAws_restXmlServerSideEncryptionByDefault( input.ApplyServerSideEncryptionByDefault, context ).withName("ApplyServerSideEncryptionByDefault"); bodyNode.addChildNode(node); } - if (input.BucketKeyEnabled !== undefined) { + if (input.BucketKeyEnabled !== undefined && input.BucketKeyEnabled !== null) { const node = new __XmlNode("BucketKeyEnabled") .addChildNode(new __XmlText(String(input.BucketKeyEnabled))) .withName("BucketKeyEnabled"); @@ -11895,21 +11921,26 @@ const serializeAws_restXmlServerSideEncryptionRules = ( input: ServerSideEncryptionRule[], context: __SerdeContext ): any => { - return input.map((entry) => { - const node = serializeAws_restXmlServerSideEncryptionRule(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlServerSideEncryptionRule(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlSourceSelectionCriteria = (input: SourceSelectionCriteria, context: __SerdeContext): any => { const bodyNode = new __XmlNode("SourceSelectionCriteria"); - if (input.SseKmsEncryptedObjects !== undefined) { + if (input.SseKmsEncryptedObjects !== undefined && input.SseKmsEncryptedObjects !== null) { const node = serializeAws_restXmlSseKmsEncryptedObjects(input.SseKmsEncryptedObjects, context).withName( "SseKmsEncryptedObjects" ); bodyNode.addChildNode(node); } - if (input.ReplicaModifications !== undefined) { + if (input.ReplicaModifications !== undefined && input.ReplicaModifications !== null) { const node = serializeAws_restXmlReplicaModifications(input.ReplicaModifications, context).withName( "ReplicaModifications" ); @@ -11920,7 +11951,7 @@ const serializeAws_restXmlSourceSelectionCriteria = (input: SourceSelectionCrite const serializeAws_restXmlSSEKMS = (input: SSEKMS, context: __SerdeContext): any => { const bodyNode = new __XmlNode("SSE-KMS"); - if (input.KeyId !== undefined) { + if (input.KeyId !== undefined && input.KeyId !== null) { const node = new __XmlNode("SSEKMSKeyId").addChildNode(new __XmlText(input.KeyId)).withName("KeyId"); bodyNode.addChildNode(node); } @@ -11929,7 +11960,7 @@ const serializeAws_restXmlSSEKMS = (input: SSEKMS, context: __SerdeContext): any const serializeAws_restXmlSseKmsEncryptedObjects = (input: SseKmsEncryptedObjects, context: __SerdeContext): any => { const bodyNode = new __XmlNode("SseKmsEncryptedObjects"); - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("SseKmsEncryptedObjectsStatus") .addChildNode(new __XmlText(input.Status)) .withName("Status"); @@ -11945,7 +11976,7 @@ const serializeAws_restXmlSSES3 = (input: SSES3, context: __SerdeContext): any = const serializeAws_restXmlStorageClassAnalysis = (input: StorageClassAnalysis, context: __SerdeContext): any => { const bodyNode = new __XmlNode("StorageClassAnalysis"); - if (input.DataExport !== undefined) { + if (input.DataExport !== undefined && input.DataExport !== null) { const node = serializeAws_restXmlStorageClassAnalysisDataExport(input.DataExport, context).withName("DataExport"); bodyNode.addChildNode(node); } @@ -11957,13 +11988,13 @@ const serializeAws_restXmlStorageClassAnalysisDataExport = ( context: __SerdeContext ): any => { const bodyNode = new __XmlNode("StorageClassAnalysisDataExport"); - if (input.OutputSchemaVersion !== undefined) { + if (input.OutputSchemaVersion !== undefined && input.OutputSchemaVersion !== null) { const node = new __XmlNode("StorageClassAnalysisSchemaVersion") .addChildNode(new __XmlText(input.OutputSchemaVersion)) .withName("OutputSchemaVersion"); bodyNode.addChildNode(node); } - if (input.Destination !== undefined) { + if (input.Destination !== undefined && input.Destination !== null) { const node = serializeAws_restXmlAnalyticsExportDestination(input.Destination, context).withName("Destination"); bodyNode.addChildNode(node); } @@ -11972,11 +12003,11 @@ const serializeAws_restXmlStorageClassAnalysisDataExport = ( const serializeAws_restXmlTag = (input: Tag, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Tag"); - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { const node = new __XmlNode("ObjectKey").addChildNode(new __XmlText(input.Key)).withName("Key"); bodyNode.addChildNode(node); } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { const node = new __XmlNode("Value").addChildNode(new __XmlText(input.Value)).withName("Value"); bodyNode.addChildNode(node); } @@ -11985,7 +12016,7 @@ const serializeAws_restXmlTag = (input: Tag, context: __SerdeContext): any => { const serializeAws_restXmlTagging = (input: Tagging, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Tagging"); - if (input.TagSet !== undefined) { + if (input.TagSet !== undefined && input.TagSet !== null) { const nodes = serializeAws_restXmlTagSet(input.TagSet, context); const containerNode = new __XmlNode("TagSet"); nodes.map((node: any) => { @@ -11997,19 +12028,24 @@ const serializeAws_restXmlTagging = (input: Tagging, context: __SerdeContext): a }; const serializeAws_restXmlTagSet = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlTag(entry, context); - return node.withName("Tag"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlTag(entry, context); + return node.withName("Tag"); + }); }; const serializeAws_restXmlTargetGrant = (input: TargetGrant, context: __SerdeContext): any => { const bodyNode = new __XmlNode("TargetGrant"); - if (input.Grantee !== undefined) { + if (input.Grantee !== undefined && input.Grantee !== null) { const node = serializeAws_restXmlGrantee(input.Grantee, context).withName("Grantee"); bodyNode.addChildNode(node); } - if (input.Permission !== undefined) { + if (input.Permission !== undefined && input.Permission !== null) { const node = new __XmlNode("BucketLogsPermission") .addChildNode(new __XmlText(input.Permission)) .withName("Permission"); @@ -12019,21 +12055,26 @@ const serializeAws_restXmlTargetGrant = (input: TargetGrant, context: __SerdeCon }; const serializeAws_restXmlTargetGrants = (input: TargetGrant[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlTargetGrant(entry, context); - return node.withName("Grant"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlTargetGrant(entry, context); + return node.withName("Grant"); + }); }; const serializeAws_restXmlTiering = (input: Tiering, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Tiering"); - if (input.Days !== undefined) { + if (input.Days !== undefined && input.Days !== null) { const node = new __XmlNode("IntelligentTieringDays") .addChildNode(new __XmlText(String(input.Days))) .withName("Days"); bodyNode.addChildNode(node); } - if (input.AccessTier !== undefined) { + if (input.AccessTier !== undefined && input.AccessTier !== null) { const node = new __XmlNode("IntelligentTieringAccessTier") .addChildNode(new __XmlText(input.AccessTier)) .withName("AccessTier"); @@ -12043,30 +12084,35 @@ const serializeAws_restXmlTiering = (input: Tiering, context: __SerdeContext): a }; const serializeAws_restXmlTieringList = (input: Tiering[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlTiering(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlTiering(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlTopicConfiguration = (input: TopicConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("TopicConfiguration"); - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { const node = new __XmlNode("NotificationId").addChildNode(new __XmlText(input.Id)).withName("Id"); bodyNode.addChildNode(node); } - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { const node = new __XmlNode("TopicArn").addChildNode(new __XmlText(input.TopicArn)).withName("Topic"); bodyNode.addChildNode(node); } - if (input.Events !== undefined) { + if (input.Events !== undefined && input.Events !== null) { const nodes = serializeAws_restXmlEventList(input.Events, context); nodes.map((node: any) => { node = node.withName("Event"); bodyNode.addChildNode(node); }); } - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const node = serializeAws_restXmlNotificationConfigurationFilter(input.Filter, context).withName("Filter"); bodyNode.addChildNode(node); } @@ -12074,25 +12120,30 @@ const serializeAws_restXmlTopicConfiguration = (input: TopicConfiguration, conte }; const serializeAws_restXmlTopicConfigurationList = (input: TopicConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlTopicConfiguration(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlTopicConfiguration(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlTransition = (input: Transition, context: __SerdeContext): any => { const bodyNode = new __XmlNode("Transition"); - if (input.Date !== undefined) { + if (input.Date !== undefined && input.Date !== null) { const node = new __XmlNode("Date") .addChildNode(new __XmlText(input.Date.toISOString().split(".")[0] + "Z")) .withName("Date"); bodyNode.addChildNode(node); } - if (input.Days !== undefined) { + if (input.Days !== undefined && input.Days !== null) { const node = new __XmlNode("Days").addChildNode(new __XmlText(String(input.Days))).withName("Days"); bodyNode.addChildNode(node); } - if (input.StorageClass !== undefined) { + if (input.StorageClass !== undefined && input.StorageClass !== null) { const node = new __XmlNode("TransitionStorageClass") .addChildNode(new __XmlText(input.StorageClass)) .withName("StorageClass"); @@ -12102,26 +12153,36 @@ const serializeAws_restXmlTransition = (input: Transition, context: __SerdeConte }; const serializeAws_restXmlTransitionList = (input: Transition[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlTransition(entry, context); - return node.withName("member"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlTransition(entry, context); + return node.withName("member"); + }); }; const serializeAws_restXmlUserMetadata = (input: MetadataEntry[], context: __SerdeContext): any => { - return input.map((entry) => { - const node = serializeAws_restXmlMetadataEntry(entry, context); - return node.withName("MetadataEntry"); - }); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + const node = serializeAws_restXmlMetadataEntry(entry, context); + return node.withName("MetadataEntry"); + }); }; const serializeAws_restXmlVersioningConfiguration = (input: VersioningConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("VersioningConfiguration"); - if (input.MFADelete !== undefined) { + if (input.MFADelete !== undefined && input.MFADelete !== null) { const node = new __XmlNode("MFADelete").addChildNode(new __XmlText(input.MFADelete)).withName("MfaDelete"); bodyNode.addChildNode(node); } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { const node = new __XmlNode("BucketVersioningStatus").addChildNode(new __XmlText(input.Status)).withName("Status"); bodyNode.addChildNode(node); } @@ -12130,21 +12191,21 @@ const serializeAws_restXmlVersioningConfiguration = (input: VersioningConfigurat const serializeAws_restXmlWebsiteConfiguration = (input: WebsiteConfiguration, context: __SerdeContext): any => { const bodyNode = new __XmlNode("WebsiteConfiguration"); - if (input.ErrorDocument !== undefined) { + if (input.ErrorDocument !== undefined && input.ErrorDocument !== null) { const node = serializeAws_restXmlErrorDocument(input.ErrorDocument, context).withName("ErrorDocument"); bodyNode.addChildNode(node); } - if (input.IndexDocument !== undefined) { + if (input.IndexDocument !== undefined && input.IndexDocument !== null) { const node = serializeAws_restXmlIndexDocument(input.IndexDocument, context).withName("IndexDocument"); bodyNode.addChildNode(node); } - if (input.RedirectAllRequestsTo !== undefined) { + if (input.RedirectAllRequestsTo !== undefined && input.RedirectAllRequestsTo !== null) { const node = serializeAws_restXmlRedirectAllRequestsTo(input.RedirectAllRequestsTo, context).withName( "RedirectAllRequestsTo" ); bodyNode.addChildNode(node); } - if (input.RoutingRules !== undefined) { + if (input.RoutingRules !== undefined && input.RoutingRules !== null) { const nodes = serializeAws_restXmlRoutingRules(input.RoutingRules, context); const containerNode = new __XmlNode("RoutingRules"); nodes.map((node: any) => { @@ -12182,15 +12243,36 @@ const deserializeAws_restXmlAccessControlTranslation = ( }; const deserializeAws_restXmlAllowedHeaders = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlAllowedMethods = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlAllowedOrigins = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlAnalyticsAndOperator = (output: any, context: __SerdeContext): AnalyticsAndOperator => { @@ -12232,7 +12314,14 @@ const deserializeAws_restXmlAnalyticsConfigurationList = ( output: any, context: __SerdeContext ): AnalyticsConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlAnalyticsConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlAnalyticsConfiguration(entry, context); + }); }; const deserializeAws_restXmlAnalyticsExportDestination = ( @@ -12310,7 +12399,14 @@ const deserializeAws_restXmlBucket = (output: any, context: __SerdeContext): Buc }; const deserializeAws_restXmlBuckets = (output: any, context: __SerdeContext): Bucket[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlBucket(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlBucket(entry, context); + }); }; const deserializeAws_restXmlCommonPrefix = (output: any, context: __SerdeContext): CommonPrefix => { @@ -12324,7 +12420,14 @@ const deserializeAws_restXmlCommonPrefix = (output: any, context: __SerdeContext }; const deserializeAws_restXmlCommonPrefixList = (output: any, context: __SerdeContext): CommonPrefix[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlCommonPrefix(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlCommonPrefix(entry, context); + }); }; const deserializeAws_restXmlCondition = (output: any, context: __SerdeContext): Condition => { @@ -12420,7 +12523,14 @@ const deserializeAws_restXmlCORSRule = (output: any, context: __SerdeContext): C }; const deserializeAws_restXmlCORSRules = (output: any, context: __SerdeContext): CORSRule[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlCORSRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlCORSRule(entry, context); + }); }; const deserializeAws_restXmlDefaultRetention = (output: any, context: __SerdeContext): DefaultRetention => { @@ -12464,7 +12574,14 @@ const deserializeAws_restXmlDeletedObject = (output: any, context: __SerdeContex }; const deserializeAws_restXmlDeletedObjects = (output: any, context: __SerdeContext): DeletedObject[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlDeletedObject(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlDeletedObject(entry, context); + }); }; const deserializeAws_restXmlDeleteMarkerEntry = (output: any, context: __SerdeContext): DeleteMarkerEntry => { @@ -12507,7 +12624,14 @@ const deserializeAws_restXmlDeleteMarkerReplication = ( }; const deserializeAws_restXmlDeleteMarkers = (output: any, context: __SerdeContext): DeleteMarkerEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlDeleteMarkerEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlDeleteMarkerEntry(entry, context); + }); }; const deserializeAws_restXmlDestination = (output: any, context: __SerdeContext): Destination => { @@ -12596,11 +12720,25 @@ const deserializeAws_restXmlErrorDocument = (output: any, context: __SerdeContex }; const deserializeAws_restXmlErrors = (output: any, context: __SerdeContext): _Error[] => { - return (output || []).map((entry: any) => deserializeAws_restXml_Error(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXml_Error(entry, context); + }); }; const deserializeAws_restXmlEventList = (output: any, context: __SerdeContext): (Event | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlExistingObjectReplication = ( @@ -12617,7 +12755,14 @@ const deserializeAws_restXmlExistingObjectReplication = ( }; const deserializeAws_restXmlExposeHeaders = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlFilterRule = (output: any, context: __SerdeContext): FilterRule => { @@ -12635,7 +12780,14 @@ const deserializeAws_restXmlFilterRule = (output: any, context: __SerdeContext): }; const deserializeAws_restXmlFilterRuleList = (output: any, context: __SerdeContext): FilterRule[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlFilterRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlFilterRule(entry, context); + }); }; const deserializeAws_restXmlGrant = (output: any, context: __SerdeContext): Grant => { @@ -12679,7 +12831,14 @@ const deserializeAws_restXmlGrantee = (output: any, context: __SerdeContext): Gr }; const deserializeAws_restXmlGrants = (output: any, context: __SerdeContext): Grant[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlGrant(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlGrant(entry, context); + }); }; const deserializeAws_restXmlIndexDocument = (output: any, context: __SerdeContext): IndexDocument => { @@ -12758,7 +12917,14 @@ const deserializeAws_restXmlIntelligentTieringConfigurationList = ( output: any, context: __SerdeContext ): IntelligentTieringConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlIntelligentTieringConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlIntelligentTieringConfiguration(entry, context); + }); }; const deserializeAws_restXmlIntelligentTieringFilter = ( @@ -12826,7 +12992,14 @@ const deserializeAws_restXmlInventoryConfigurationList = ( output: any, context: __SerdeContext ): InventoryConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlInventoryConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlInventoryConfiguration(entry, context); + }); }; const deserializeAws_restXmlInventoryDestination = (output: any, context: __SerdeContext): InventoryDestination => { @@ -12870,7 +13043,14 @@ const deserializeAws_restXmlInventoryOptionalFields = ( output: any, context: __SerdeContext ): (InventoryOptionalField | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restXmlInventoryS3BucketDestination = ( @@ -12944,7 +13124,14 @@ const deserializeAws_restXmlLambdaFunctionConfigurationList = ( output: any, context: __SerdeContext ): LambdaFunctionConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlLambdaFunctionConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlLambdaFunctionConfiguration(entry, context); + }); }; const deserializeAws_restXmlLifecycleExpiration = (output: any, context: __SerdeContext): LifecycleExpiration => { @@ -13062,7 +13249,14 @@ const deserializeAws_restXmlLifecycleRuleFilter = (output: any, context: __Serde }; const deserializeAws_restXmlLifecycleRules = (output: any, context: __SerdeContext): LifecycleRule[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlLifecycleRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlLifecycleRule(entry, context); + }); }; const deserializeAws_restXmlLoggingEnabled = (output: any, context: __SerdeContext): LoggingEnabled => { @@ -13138,7 +13332,14 @@ const deserializeAws_restXmlMetricsConfigurationList = ( output: any, context: __SerdeContext ): MetricsConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlMetricsConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlMetricsConfiguration(entry, context); + }); }; const deserializeAws_restXmlMetricsFilter = (output: any, context: __SerdeContext): MetricsFilter => { @@ -13191,7 +13392,14 @@ const deserializeAws_restXmlMultipartUpload = (output: any, context: __SerdeCont }; const deserializeAws_restXmlMultipartUploadList = (output: any, context: __SerdeContext): MultipartUpload[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlMultipartUpload(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlMultipartUpload(entry, context); + }); }; const deserializeAws_restXmlNoncurrentVersionExpiration = ( @@ -13228,7 +13436,14 @@ const deserializeAws_restXmlNoncurrentVersionTransitionList = ( output: any, context: __SerdeContext ): NoncurrentVersionTransition[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlNoncurrentVersionTransition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlNoncurrentVersionTransition(entry, context); + }); }; const deserializeAws_restXmlNotificationConfigurationFilter = ( @@ -13275,7 +13490,14 @@ const deserializeAws_restXml_Object = (output: any, context: __SerdeContext): _O }; const deserializeAws_restXmlObjectList = (output: any, context: __SerdeContext): _Object[] => { - return (output || []).map((entry: any) => deserializeAws_restXml_Object(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXml_Object(entry, context); + }); }; const deserializeAws_restXmlObjectLockConfiguration = ( @@ -13368,7 +13590,14 @@ const deserializeAws_restXmlObjectVersion = (output: any, context: __SerdeContex }; const deserializeAws_restXmlObjectVersionList = (output: any, context: __SerdeContext): ObjectVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlObjectVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlObjectVersion(entry, context); + }); }; const deserializeAws_restXmlOwner = (output: any, context: __SerdeContext): Owner => { @@ -13412,7 +13641,14 @@ const deserializeAws_restXmlOwnershipControlsRules = ( output: any, context: __SerdeContext ): OwnershipControlsRule[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlOwnershipControlsRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlOwnershipControlsRule(entry, context); + }); }; const deserializeAws_restXmlPart = (output: any, context: __SerdeContext): Part => { @@ -13438,7 +13674,14 @@ const deserializeAws_restXmlPart = (output: any, context: __SerdeContext): Part }; const deserializeAws_restXmlParts = (output: any, context: __SerdeContext): Part[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlPart(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlPart(entry, context); + }); }; const deserializeAws_restXmlPolicyStatus = (output: any, context: __SerdeContext): PolicyStatus => { @@ -13502,7 +13745,14 @@ const deserializeAws_restXmlQueueConfiguration = (output: any, context: __SerdeC }; const deserializeAws_restXmlQueueConfigurationList = (output: any, context: __SerdeContext): QueueConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlQueueConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlQueueConfiguration(entry, context); + }); }; const deserializeAws_restXmlRedirect = (output: any, context: __SerdeContext): Redirect => { @@ -13666,7 +13916,14 @@ const deserializeAws_restXmlReplicationRuleFilter = (output: any, context: __Ser }; const deserializeAws_restXmlReplicationRules = (output: any, context: __SerdeContext): ReplicationRule[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlReplicationRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlReplicationRule(entry, context); + }); }; const deserializeAws_restXmlReplicationTime = (output: any, context: __SerdeContext): ReplicationTime => { @@ -13708,7 +13965,14 @@ const deserializeAws_restXmlRoutingRule = (output: any, context: __SerdeContext) }; const deserializeAws_restXmlRoutingRules = (output: any, context: __SerdeContext): RoutingRule[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlRoutingRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlRoutingRule(entry, context); + }); }; const deserializeAws_restXmlS3KeyFilter = (output: any, context: __SerdeContext): S3KeyFilter => { @@ -13781,7 +14045,14 @@ const deserializeAws_restXmlServerSideEncryptionRules = ( output: any, context: __SerdeContext ): ServerSideEncryptionRule[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlServerSideEncryptionRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlServerSideEncryptionRule(entry, context); + }); }; const deserializeAws_restXmlSourceSelectionCriteria = ( @@ -13871,7 +14142,14 @@ const deserializeAws_restXmlTag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_restXmlTagSet = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTag(entry, context); + }); }; const deserializeAws_restXmlTargetGrant = (output: any, context: __SerdeContext): TargetGrant => { @@ -13889,7 +14167,14 @@ const deserializeAws_restXmlTargetGrant = (output: any, context: __SerdeContext) }; const deserializeAws_restXmlTargetGrants = (output: any, context: __SerdeContext): TargetGrant[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTargetGrant(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTargetGrant(entry, context); + }); }; const deserializeAws_restXmlTiering = (output: any, context: __SerdeContext): Tiering => { @@ -13907,7 +14192,14 @@ const deserializeAws_restXmlTiering = (output: any, context: __SerdeContext): Ti }; const deserializeAws_restXmlTieringList = (output: any, context: __SerdeContext): Tiering[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTiering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTiering(entry, context); + }); }; const deserializeAws_restXmlTopicConfiguration = (output: any, context: __SerdeContext): TopicConfiguration => { @@ -13936,7 +14228,14 @@ const deserializeAws_restXmlTopicConfiguration = (output: any, context: __SerdeC }; const deserializeAws_restXmlTopicConfigurationList = (output: any, context: __SerdeContext): TopicConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTopicConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTopicConfiguration(entry, context); + }); }; const deserializeAws_restXmlTransition = (output: any, context: __SerdeContext): Transition => { @@ -13958,7 +14257,14 @@ const deserializeAws_restXmlTransition = (output: any, context: __SerdeContext): }; const deserializeAws_restXmlTransitionList = (output: any, context: __SerdeContext): Transition[] => { - return (output || []).map((entry: any) => deserializeAws_restXmlTransition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restXmlTransition(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -13981,6 +14287,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-s3outposts/protocols/Aws_restJson1.ts b/clients/client-s3outposts/protocols/Aws_restJson1.ts index 26a6c98a49bc..7e0f33d7c5b0 100644 --- a/clients/client-s3outposts/protocols/Aws_restJson1.ts +++ b/clients/client-s3outposts/protocols/Aws_restJson1.ts @@ -27,14 +27,15 @@ export const serializeAws_restJson1CreateEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/S3Outposts/CreateEndpoint"; let body: any; body = JSON.stringify({ - ...(input.OutpostId !== undefined && { OutpostId: input.OutpostId }), - ...(input.SecurityGroupId !== undefined && { SecurityGroupId: input.SecurityGroupId }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), + ...(input.OutpostId !== undefined && input.OutpostId !== null && { OutpostId: input.OutpostId }), + ...(input.SecurityGroupId !== undefined && + input.SecurityGroupId !== null && { SecurityGroupId: input.SecurityGroupId }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -52,9 +53,7 @@ export const serializeAws_restJson1DeleteEndpointCommand = async ( input: DeleteEndpointCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/S3Outposts/DeleteEndpoint"; const query: any = { ...(input.EndpointId !== undefined && { endpointId: input.EndpointId }), @@ -78,9 +77,7 @@ export const serializeAws_restJson1ListEndpointsCommand = async ( input: ListEndpointsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/S3Outposts/ListEndpoints"; const query: any = { ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }), @@ -448,7 +445,14 @@ const deserializeAws_restJson1Endpoint = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Endpoints = (output: any, context: __SerdeContext): Endpoint[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Endpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Endpoint(entry, context); + }); }; const deserializeAws_restJson1NetworkInterface = (output: any, context: __SerdeContext): NetworkInterface => { @@ -461,7 +465,14 @@ const deserializeAws_restJson1NetworkInterface = (output: any, context: __SerdeC }; const deserializeAws_restJson1NetworkInterfaces = (output: any, context: __SerdeContext): NetworkInterface[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NetworkInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NetworkInterface(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -484,6 +495,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1.ts b/clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1.ts index 685540099620..3e70b5a1c6a8 100644 --- a/clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1.ts @@ -32,9 +32,7 @@ export const serializeAws_restJson1DeleteHumanLoopCommand = async ( input: DeleteHumanLoopCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/human-loops/{HumanLoopName}"; if (input.HumanLoopName !== undefined) { const labelValue: string = input.HumanLoopName; @@ -62,9 +60,7 @@ export const serializeAws_restJson1DescribeHumanLoopCommand = async ( input: DescribeHumanLoopCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/human-loops/{HumanLoopName}"; if (input.HumanLoopName !== undefined) { const labelValue: string = input.HumanLoopName; @@ -92,9 +88,7 @@ export const serializeAws_restJson1ListHumanLoopsCommand = async ( input: ListHumanLoopsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/human-loops"; const query: any = { ...(input.CreationTimeAfter !== undefined && { @@ -127,19 +121,22 @@ export const serializeAws_restJson1StartHumanLoopCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/human-loops"; let body: any; body = JSON.stringify({ - ...(input.DataAttributes !== undefined && { - DataAttributes: serializeAws_restJson1HumanLoopDataAttributes(input.DataAttributes, context), - }), - ...(input.FlowDefinitionArn !== undefined && { FlowDefinitionArn: input.FlowDefinitionArn }), - ...(input.HumanLoopInput !== undefined && { - HumanLoopInput: serializeAws_restJson1HumanLoopInput(input.HumanLoopInput, context), - }), - ...(input.HumanLoopName !== undefined && { HumanLoopName: input.HumanLoopName }), + ...(input.DataAttributes !== undefined && + input.DataAttributes !== null && { + DataAttributes: serializeAws_restJson1HumanLoopDataAttributes(input.DataAttributes, context), + }), + ...(input.FlowDefinitionArn !== undefined && + input.FlowDefinitionArn !== null && { FlowDefinitionArn: input.FlowDefinitionArn }), + ...(input.HumanLoopInput !== undefined && + input.HumanLoopInput !== null && { + HumanLoopInput: serializeAws_restJson1HumanLoopInput(input.HumanLoopInput, context), + }), + ...(input.HumanLoopName !== undefined && input.HumanLoopName !== null && { HumanLoopName: input.HumanLoopName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -158,12 +155,12 @@ export const serializeAws_restJson1StopHumanLoopCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/human-loops/stop"; let body: any; body = JSON.stringify({ - ...(input.HumanLoopName !== undefined && { HumanLoopName: input.HumanLoopName }), + ...(input.HumanLoopName !== undefined && input.HumanLoopName !== null && { HumanLoopName: input.HumanLoopName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -710,7 +707,14 @@ const serializeAws_restJson1ContentClassifiers = ( input: (ContentClassifier | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1HumanLoopDataAttributes = ( @@ -718,15 +722,16 @@ const serializeAws_restJson1HumanLoopDataAttributes = ( context: __SerdeContext ): any => { return { - ...(input.ContentClassifiers !== undefined && { - ContentClassifiers: serializeAws_restJson1ContentClassifiers(input.ContentClassifiers, context), - }), + ...(input.ContentClassifiers !== undefined && + input.ContentClassifiers !== null && { + ContentClassifiers: serializeAws_restJson1ContentClassifiers(input.ContentClassifiers, context), + }), }; }; const serializeAws_restJson1HumanLoopInput = (input: HumanLoopInput, context: __SerdeContext): any => { return { - ...(input.InputContent !== undefined && { InputContent: input.InputContent }), + ...(input.InputContent !== undefined && input.InputContent !== null && { InputContent: input.InputContent }), }; }; @@ -737,7 +742,14 @@ const deserializeAws_restJson1HumanLoopOutput = (output: any, context: __SerdeCo }; const deserializeAws_restJson1HumanLoopSummaries = (output: any, context: __SerdeContext): HumanLoopSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HumanLoopSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HumanLoopSummary(entry, context); + }); }; const deserializeAws_restJson1HumanLoopSummary = (output: any, context: __SerdeContext): HumanLoopSummary => { @@ -779,6 +791,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-sagemaker-edge/protocols/Aws_restJson1.ts b/clients/client-sagemaker-edge/protocols/Aws_restJson1.ts index af7e3019188a..3225c9343b20 100644 --- a/clients/client-sagemaker-edge/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-edge/protocols/Aws_restJson1.ts @@ -18,13 +18,14 @@ export const serializeAws_restJson1GetDeviceRegistrationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/GetDeviceRegistration"; let body: any; body = JSON.stringify({ - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), - ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), + ...(input.DeviceName !== undefined && input.DeviceName !== null && { DeviceName: input.DeviceName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -43,18 +44,19 @@ export const serializeAws_restJson1SendHeartbeatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/SendHeartbeat"; let body: any; body = JSON.stringify({ - ...(input.AgentMetrics !== undefined && { - AgentMetrics: serializeAws_restJson1EdgeMetrics(input.AgentMetrics, context), - }), - ...(input.AgentVersion !== undefined && { AgentVersion: input.AgentVersion }), - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), - ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }), - ...(input.Models !== undefined && { Models: serializeAws_restJson1Models(input.Models, context) }), + ...(input.AgentMetrics !== undefined && + input.AgentMetrics !== null && { AgentMetrics: serializeAws_restJson1EdgeMetrics(input.AgentMetrics, context) }), + ...(input.AgentVersion !== undefined && input.AgentVersion !== null && { AgentVersion: input.AgentVersion }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), + ...(input.DeviceName !== undefined && input.DeviceName !== null && { DeviceName: input.DeviceName }), + ...(input.Models !== undefined && + input.Models !== null && { Models: serializeAws_restJson1Models(input.Models, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -197,33 +199,47 @@ const deserializeAws_restJson1InternalServiceExceptionResponse = async ( const serializeAws_restJson1EdgeMetric = (input: EdgeMetric, context: __SerdeContext): any => { return { - ...(input.Dimension !== undefined && { Dimension: input.Dimension }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Timestamp !== undefined && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Dimension !== undefined && input.Dimension !== null && { Dimension: input.Dimension }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Timestamp !== undefined && + input.Timestamp !== null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1EdgeMetrics = (input: EdgeMetric[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1EdgeMetric(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1EdgeMetric(entry, context); + }); }; const serializeAws_restJson1Model = (input: Model, context: __SerdeContext): any => { return { - ...(input.LatestInference !== undefined && { LatestInference: Math.round(input.LatestInference.getTime() / 1000) }), - ...(input.LatestSampleTime !== undefined && { - LatestSampleTime: Math.round(input.LatestSampleTime.getTime() / 1000), - }), - ...(input.ModelMetrics !== undefined && { - ModelMetrics: serializeAws_restJson1EdgeMetrics(input.ModelMetrics, context), - }), - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), - ...(input.ModelVersion !== undefined && { ModelVersion: input.ModelVersion }), + ...(input.LatestInference !== undefined && + input.LatestInference !== null && { LatestInference: Math.round(input.LatestInference.getTime() / 1000) }), + ...(input.LatestSampleTime !== undefined && + input.LatestSampleTime !== null && { LatestSampleTime: Math.round(input.LatestSampleTime.getTime() / 1000) }), + ...(input.ModelMetrics !== undefined && + input.ModelMetrics !== null && { ModelMetrics: serializeAws_restJson1EdgeMetrics(input.ModelMetrics, context) }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), + ...(input.ModelVersion !== undefined && input.ModelVersion !== null && { ModelVersion: input.ModelVersion }), }; }; const serializeAws_restJson1Models = (input: Model[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Model(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Model(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -246,6 +262,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-sagemaker-featurestore-runtime/protocols/Aws_restJson1.ts b/clients/client-sagemaker-featurestore-runtime/protocols/Aws_restJson1.ts index af5c8e928f25..cbfd4748222b 100644 --- a/clients/client-sagemaker-featurestore-runtime/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-featurestore-runtime/protocols/Aws_restJson1.ts @@ -25,9 +25,7 @@ export const serializeAws_restJson1DeleteRecordCommand = async ( input: DeleteRecordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/FeatureGroup/{FeatureGroupName}"; if (input.FeatureGroupName !== undefined) { const labelValue: string = input.FeatureGroupName; @@ -62,9 +60,7 @@ export const serializeAws_restJson1GetRecordCommand = async ( input: GetRecordCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/FeatureGroup/{FeatureGroupName}"; if (input.FeatureGroupName !== undefined) { const labelValue: string = input.FeatureGroupName; @@ -100,7 +96,7 @@ export const serializeAws_restJson1PutRecordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/FeatureGroup/{FeatureGroupName}"; if (input.FeatureGroupName !== undefined) { @@ -114,7 +110,8 @@ export const serializeAws_restJson1PutRecordCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Record !== undefined && { Record: serializeAws_restJson1Record(input.Record, context) }), + ...(input.Record !== undefined && + input.Record !== null && { Record: serializeAws_restJson1Record(input.Record, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -452,13 +449,20 @@ const deserializeAws_restJson1ValidationErrorResponse = async ( const serializeAws_restJson1FeatureValue = (input: FeatureValue, context: __SerdeContext): any => { return { - ...(input.FeatureName !== undefined && { FeatureName: input.FeatureName }), - ...(input.ValueAsString !== undefined && { ValueAsString: input.ValueAsString }), + ...(input.FeatureName !== undefined && input.FeatureName !== null && { FeatureName: input.FeatureName }), + ...(input.ValueAsString !== undefined && input.ValueAsString !== null && { ValueAsString: input.ValueAsString }), }; }; const serializeAws_restJson1Record = (input: FeatureValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1FeatureValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1FeatureValue(entry, context); + }); }; const deserializeAws_restJson1FeatureValue = (output: any, context: __SerdeContext): FeatureValue => { @@ -470,7 +474,14 @@ const deserializeAws_restJson1FeatureValue = (output: any, context: __SerdeConte }; const deserializeAws_restJson1Record = (output: any, context: __SerdeContext): FeatureValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FeatureValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FeatureValue(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -493,6 +504,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-sagemaker-runtime/protocols/Aws_restJson1.ts b/clients/client-sagemaker-runtime/protocols/Aws_restJson1.ts index f2dffb0127c5..54c159295871 100644 --- a/clients/client-sagemaker-runtime/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-runtime/protocols/Aws_restJson1.ts @@ -17,7 +17,7 @@ export const serializeAws_restJson1InvokeEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/octet-stream", + "content-type": "application/octet-stream", ...(isSerializableHeaderValue(input.ContentType) && { "Content-Type": input.ContentType! }), ...(isSerializableHeaderValue(input.Accept) && { Accept: input.Accept! }), ...(isSerializableHeaderValue(input.CustomAttributes) && { @@ -242,6 +242,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-sagemaker/protocols/Aws_json1_1.ts b/clients/client-sagemaker/protocols/Aws_json1_1.ts index d96450711bae..269142a87519 100644 --- a/clients/client-sagemaker/protocols/Aws_json1_1.ts +++ b/clients/client-sagemaker/protocols/Aws_json1_1.ts @@ -1332,7 +1332,7 @@ export const serializeAws_json1_1AddAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.AddAssociation", }; let body: any; @@ -1345,7 +1345,7 @@ export const serializeAws_json1_1AddTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.AddTags", }; let body: any; @@ -1358,7 +1358,7 @@ export const serializeAws_json1_1AssociateTrialComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.AssociateTrialComponent", }; let body: any; @@ -1371,7 +1371,7 @@ export const serializeAws_json1_1CreateActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateAction", }; let body: any; @@ -1384,7 +1384,7 @@ export const serializeAws_json1_1CreateAlgorithmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateAlgorithm", }; let body: any; @@ -1397,7 +1397,7 @@ export const serializeAws_json1_1CreateAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateApp", }; let body: any; @@ -1410,7 +1410,7 @@ export const serializeAws_json1_1CreateAppImageConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateAppImageConfig", }; let body: any; @@ -1423,7 +1423,7 @@ export const serializeAws_json1_1CreateArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateArtifact", }; let body: any; @@ -1436,7 +1436,7 @@ export const serializeAws_json1_1CreateAutoMLJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateAutoMLJob", }; let body: any; @@ -1449,7 +1449,7 @@ export const serializeAws_json1_1CreateCodeRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateCodeRepository", }; let body: any; @@ -1462,7 +1462,7 @@ export const serializeAws_json1_1CreateCompilationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateCompilationJob", }; let body: any; @@ -1475,7 +1475,7 @@ export const serializeAws_json1_1CreateContextCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateContext", }; let body: any; @@ -1488,7 +1488,7 @@ export const serializeAws_json1_1CreateDataQualityJobDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateDataQualityJobDefinition", }; let body: any; @@ -1501,7 +1501,7 @@ export const serializeAws_json1_1CreateDeviceFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateDeviceFleet", }; let body: any; @@ -1514,7 +1514,7 @@ export const serializeAws_json1_1CreateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateDomain", }; let body: any; @@ -1527,7 +1527,7 @@ export const serializeAws_json1_1CreateEdgePackagingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateEdgePackagingJob", }; let body: any; @@ -1540,7 +1540,7 @@ export const serializeAws_json1_1CreateEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateEndpoint", }; let body: any; @@ -1553,7 +1553,7 @@ export const serializeAws_json1_1CreateEndpointConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateEndpointConfig", }; let body: any; @@ -1566,7 +1566,7 @@ export const serializeAws_json1_1CreateExperimentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateExperiment", }; let body: any; @@ -1579,7 +1579,7 @@ export const serializeAws_json1_1CreateFeatureGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateFeatureGroup", }; let body: any; @@ -1592,7 +1592,7 @@ export const serializeAws_json1_1CreateFlowDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateFlowDefinition", }; let body: any; @@ -1605,7 +1605,7 @@ export const serializeAws_json1_1CreateHumanTaskUiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateHumanTaskUi", }; let body: any; @@ -1618,7 +1618,7 @@ export const serializeAws_json1_1CreateHyperParameterTuningJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateHyperParameterTuningJob", }; let body: any; @@ -1631,7 +1631,7 @@ export const serializeAws_json1_1CreateImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateImage", }; let body: any; @@ -1644,7 +1644,7 @@ export const serializeAws_json1_1CreateImageVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateImageVersion", }; let body: any; @@ -1657,7 +1657,7 @@ export const serializeAws_json1_1CreateLabelingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateLabelingJob", }; let body: any; @@ -1670,7 +1670,7 @@ export const serializeAws_json1_1CreateModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateModel", }; let body: any; @@ -1683,7 +1683,7 @@ export const serializeAws_json1_1CreateModelBiasJobDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateModelBiasJobDefinition", }; let body: any; @@ -1696,7 +1696,7 @@ export const serializeAws_json1_1CreateModelExplainabilityJobDefinitionCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateModelExplainabilityJobDefinition", }; let body: any; @@ -1709,7 +1709,7 @@ export const serializeAws_json1_1CreateModelPackageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateModelPackage", }; let body: any; @@ -1722,7 +1722,7 @@ export const serializeAws_json1_1CreateModelPackageGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateModelPackageGroup", }; let body: any; @@ -1735,7 +1735,7 @@ export const serializeAws_json1_1CreateModelQualityJobDefinitionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateModelQualityJobDefinition", }; let body: any; @@ -1748,7 +1748,7 @@ export const serializeAws_json1_1CreateMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateMonitoringSchedule", }; let body: any; @@ -1761,7 +1761,7 @@ export const serializeAws_json1_1CreateNotebookInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateNotebookInstance", }; let body: any; @@ -1774,7 +1774,7 @@ export const serializeAws_json1_1CreateNotebookInstanceLifecycleConfigCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateNotebookInstanceLifecycleConfig", }; let body: any; @@ -1787,7 +1787,7 @@ export const serializeAws_json1_1CreatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreatePipeline", }; let body: any; @@ -1800,7 +1800,7 @@ export const serializeAws_json1_1CreatePresignedDomainUrlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreatePresignedDomainUrl", }; let body: any; @@ -1813,7 +1813,7 @@ export const serializeAws_json1_1CreatePresignedNotebookInstanceUrlCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreatePresignedNotebookInstanceUrl", }; let body: any; @@ -1826,7 +1826,7 @@ export const serializeAws_json1_1CreateProcessingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateProcessingJob", }; let body: any; @@ -1839,7 +1839,7 @@ export const serializeAws_json1_1CreateProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateProject", }; let body: any; @@ -1852,7 +1852,7 @@ export const serializeAws_json1_1CreateTrainingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateTrainingJob", }; let body: any; @@ -1865,7 +1865,7 @@ export const serializeAws_json1_1CreateTransformJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateTransformJob", }; let body: any; @@ -1878,7 +1878,7 @@ export const serializeAws_json1_1CreateTrialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateTrial", }; let body: any; @@ -1891,7 +1891,7 @@ export const serializeAws_json1_1CreateTrialComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateTrialComponent", }; let body: any; @@ -1904,7 +1904,7 @@ export const serializeAws_json1_1CreateUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateUserProfile", }; let body: any; @@ -1917,7 +1917,7 @@ export const serializeAws_json1_1CreateWorkforceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateWorkforce", }; let body: any; @@ -1930,7 +1930,7 @@ export const serializeAws_json1_1CreateWorkteamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.CreateWorkteam", }; let body: any; @@ -1943,7 +1943,7 @@ export const serializeAws_json1_1DeleteActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteAction", }; let body: any; @@ -1956,7 +1956,7 @@ export const serializeAws_json1_1DeleteAlgorithmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteAlgorithm", }; let body: any; @@ -1969,7 +1969,7 @@ export const serializeAws_json1_1DeleteAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteApp", }; let body: any; @@ -1982,7 +1982,7 @@ export const serializeAws_json1_1DeleteAppImageConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteAppImageConfig", }; let body: any; @@ -1995,7 +1995,7 @@ export const serializeAws_json1_1DeleteArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteArtifact", }; let body: any; @@ -2008,7 +2008,7 @@ export const serializeAws_json1_1DeleteAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteAssociation", }; let body: any; @@ -2021,7 +2021,7 @@ export const serializeAws_json1_1DeleteCodeRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteCodeRepository", }; let body: any; @@ -2034,7 +2034,7 @@ export const serializeAws_json1_1DeleteContextCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteContext", }; let body: any; @@ -2047,7 +2047,7 @@ export const serializeAws_json1_1DeleteDataQualityJobDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteDataQualityJobDefinition", }; let body: any; @@ -2060,7 +2060,7 @@ export const serializeAws_json1_1DeleteDeviceFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteDeviceFleet", }; let body: any; @@ -2073,7 +2073,7 @@ export const serializeAws_json1_1DeleteDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteDomain", }; let body: any; @@ -2086,7 +2086,7 @@ export const serializeAws_json1_1DeleteEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteEndpoint", }; let body: any; @@ -2099,7 +2099,7 @@ export const serializeAws_json1_1DeleteEndpointConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteEndpointConfig", }; let body: any; @@ -2112,7 +2112,7 @@ export const serializeAws_json1_1DeleteExperimentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteExperiment", }; let body: any; @@ -2125,7 +2125,7 @@ export const serializeAws_json1_1DeleteFeatureGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteFeatureGroup", }; let body: any; @@ -2138,7 +2138,7 @@ export const serializeAws_json1_1DeleteFlowDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteFlowDefinition", }; let body: any; @@ -2151,7 +2151,7 @@ export const serializeAws_json1_1DeleteHumanTaskUiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteHumanTaskUi", }; let body: any; @@ -2164,7 +2164,7 @@ export const serializeAws_json1_1DeleteImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteImage", }; let body: any; @@ -2177,7 +2177,7 @@ export const serializeAws_json1_1DeleteImageVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteImageVersion", }; let body: any; @@ -2190,7 +2190,7 @@ export const serializeAws_json1_1DeleteModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteModel", }; let body: any; @@ -2203,7 +2203,7 @@ export const serializeAws_json1_1DeleteModelBiasJobDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteModelBiasJobDefinition", }; let body: any; @@ -2216,7 +2216,7 @@ export const serializeAws_json1_1DeleteModelExplainabilityJobDefinitionCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteModelExplainabilityJobDefinition", }; let body: any; @@ -2229,7 +2229,7 @@ export const serializeAws_json1_1DeleteModelPackageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteModelPackage", }; let body: any; @@ -2242,7 +2242,7 @@ export const serializeAws_json1_1DeleteModelPackageGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteModelPackageGroup", }; let body: any; @@ -2255,7 +2255,7 @@ export const serializeAws_json1_1DeleteModelPackageGroupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteModelPackageGroupPolicy", }; let body: any; @@ -2268,7 +2268,7 @@ export const serializeAws_json1_1DeleteModelQualityJobDefinitionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteModelQualityJobDefinition", }; let body: any; @@ -2281,7 +2281,7 @@ export const serializeAws_json1_1DeleteMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteMonitoringSchedule", }; let body: any; @@ -2294,7 +2294,7 @@ export const serializeAws_json1_1DeleteNotebookInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteNotebookInstance", }; let body: any; @@ -2307,7 +2307,7 @@ export const serializeAws_json1_1DeleteNotebookInstanceLifecycleConfigCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteNotebookInstanceLifecycleConfig", }; let body: any; @@ -2320,7 +2320,7 @@ export const serializeAws_json1_1DeletePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeletePipeline", }; let body: any; @@ -2333,7 +2333,7 @@ export const serializeAws_json1_1DeleteProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteProject", }; let body: any; @@ -2346,7 +2346,7 @@ export const serializeAws_json1_1DeleteTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteTags", }; let body: any; @@ -2359,7 +2359,7 @@ export const serializeAws_json1_1DeleteTrialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteTrial", }; let body: any; @@ -2372,7 +2372,7 @@ export const serializeAws_json1_1DeleteTrialComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteTrialComponent", }; let body: any; @@ -2385,7 +2385,7 @@ export const serializeAws_json1_1DeleteUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteUserProfile", }; let body: any; @@ -2398,7 +2398,7 @@ export const serializeAws_json1_1DeleteWorkforceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteWorkforce", }; let body: any; @@ -2411,7 +2411,7 @@ export const serializeAws_json1_1DeleteWorkteamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeleteWorkteam", }; let body: any; @@ -2424,7 +2424,7 @@ export const serializeAws_json1_1DeregisterDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DeregisterDevices", }; let body: any; @@ -2437,7 +2437,7 @@ export const serializeAws_json1_1DescribeActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeAction", }; let body: any; @@ -2450,7 +2450,7 @@ export const serializeAws_json1_1DescribeAlgorithmCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeAlgorithm", }; let body: any; @@ -2463,7 +2463,7 @@ export const serializeAws_json1_1DescribeAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeApp", }; let body: any; @@ -2476,7 +2476,7 @@ export const serializeAws_json1_1DescribeAppImageConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeAppImageConfig", }; let body: any; @@ -2489,7 +2489,7 @@ export const serializeAws_json1_1DescribeArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeArtifact", }; let body: any; @@ -2502,7 +2502,7 @@ export const serializeAws_json1_1DescribeAutoMLJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeAutoMLJob", }; let body: any; @@ -2515,7 +2515,7 @@ export const serializeAws_json1_1DescribeCodeRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeCodeRepository", }; let body: any; @@ -2528,7 +2528,7 @@ export const serializeAws_json1_1DescribeCompilationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeCompilationJob", }; let body: any; @@ -2541,7 +2541,7 @@ export const serializeAws_json1_1DescribeContextCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeContext", }; let body: any; @@ -2554,7 +2554,7 @@ export const serializeAws_json1_1DescribeDataQualityJobDefinitionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeDataQualityJobDefinition", }; let body: any; @@ -2567,7 +2567,7 @@ export const serializeAws_json1_1DescribeDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeDevice", }; let body: any; @@ -2580,7 +2580,7 @@ export const serializeAws_json1_1DescribeDeviceFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeDeviceFleet", }; let body: any; @@ -2593,7 +2593,7 @@ export const serializeAws_json1_1DescribeDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeDomain", }; let body: any; @@ -2606,7 +2606,7 @@ export const serializeAws_json1_1DescribeEdgePackagingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeEdgePackagingJob", }; let body: any; @@ -2619,7 +2619,7 @@ export const serializeAws_json1_1DescribeEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeEndpoint", }; let body: any; @@ -2632,7 +2632,7 @@ export const serializeAws_json1_1DescribeEndpointConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeEndpointConfig", }; let body: any; @@ -2645,7 +2645,7 @@ export const serializeAws_json1_1DescribeExperimentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeExperiment", }; let body: any; @@ -2658,7 +2658,7 @@ export const serializeAws_json1_1DescribeFeatureGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeFeatureGroup", }; let body: any; @@ -2671,7 +2671,7 @@ export const serializeAws_json1_1DescribeFlowDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeFlowDefinition", }; let body: any; @@ -2684,7 +2684,7 @@ export const serializeAws_json1_1DescribeHumanTaskUiCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeHumanTaskUi", }; let body: any; @@ -2697,7 +2697,7 @@ export const serializeAws_json1_1DescribeHyperParameterTuningJobCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeHyperParameterTuningJob", }; let body: any; @@ -2710,7 +2710,7 @@ export const serializeAws_json1_1DescribeImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeImage", }; let body: any; @@ -2723,7 +2723,7 @@ export const serializeAws_json1_1DescribeImageVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeImageVersion", }; let body: any; @@ -2736,7 +2736,7 @@ export const serializeAws_json1_1DescribeLabelingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeLabelingJob", }; let body: any; @@ -2749,7 +2749,7 @@ export const serializeAws_json1_1DescribeModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeModel", }; let body: any; @@ -2762,7 +2762,7 @@ export const serializeAws_json1_1DescribeModelBiasJobDefinitionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeModelBiasJobDefinition", }; let body: any; @@ -2775,7 +2775,7 @@ export const serializeAws_json1_1DescribeModelExplainabilityJobDefinitionCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeModelExplainabilityJobDefinition", }; let body: any; @@ -2788,7 +2788,7 @@ export const serializeAws_json1_1DescribeModelPackageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeModelPackage", }; let body: any; @@ -2801,7 +2801,7 @@ export const serializeAws_json1_1DescribeModelPackageGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeModelPackageGroup", }; let body: any; @@ -2814,7 +2814,7 @@ export const serializeAws_json1_1DescribeModelQualityJobDefinitionCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeModelQualityJobDefinition", }; let body: any; @@ -2827,7 +2827,7 @@ export const serializeAws_json1_1DescribeMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeMonitoringSchedule", }; let body: any; @@ -2840,7 +2840,7 @@ export const serializeAws_json1_1DescribeNotebookInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeNotebookInstance", }; let body: any; @@ -2853,7 +2853,7 @@ export const serializeAws_json1_1DescribeNotebookInstanceLifecycleConfigCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeNotebookInstanceLifecycleConfig", }; let body: any; @@ -2866,7 +2866,7 @@ export const serializeAws_json1_1DescribePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribePipeline", }; let body: any; @@ -2879,7 +2879,7 @@ export const serializeAws_json1_1DescribePipelineDefinitionForExecutionCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribePipelineDefinitionForExecution", }; let body: any; @@ -2892,7 +2892,7 @@ export const serializeAws_json1_1DescribePipelineExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribePipelineExecution", }; let body: any; @@ -2905,7 +2905,7 @@ export const serializeAws_json1_1DescribeProcessingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeProcessingJob", }; let body: any; @@ -2918,7 +2918,7 @@ export const serializeAws_json1_1DescribeProjectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeProject", }; let body: any; @@ -2931,7 +2931,7 @@ export const serializeAws_json1_1DescribeSubscribedWorkteamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeSubscribedWorkteam", }; let body: any; @@ -2944,7 +2944,7 @@ export const serializeAws_json1_1DescribeTrainingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeTrainingJob", }; let body: any; @@ -2957,7 +2957,7 @@ export const serializeAws_json1_1DescribeTransformJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeTransformJob", }; let body: any; @@ -2970,7 +2970,7 @@ export const serializeAws_json1_1DescribeTrialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeTrial", }; let body: any; @@ -2983,7 +2983,7 @@ export const serializeAws_json1_1DescribeTrialComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeTrialComponent", }; let body: any; @@ -2996,7 +2996,7 @@ export const serializeAws_json1_1DescribeUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeUserProfile", }; let body: any; @@ -3009,7 +3009,7 @@ export const serializeAws_json1_1DescribeWorkforceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeWorkforce", }; let body: any; @@ -3022,7 +3022,7 @@ export const serializeAws_json1_1DescribeWorkteamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DescribeWorkteam", }; let body: any; @@ -3035,7 +3035,7 @@ export const serializeAws_json1_1DisableSagemakerServicecatalogPortfolioCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DisableSagemakerServicecatalogPortfolio", }; let body: any; @@ -3048,7 +3048,7 @@ export const serializeAws_json1_1DisassociateTrialComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.DisassociateTrialComponent", }; let body: any; @@ -3061,7 +3061,7 @@ export const serializeAws_json1_1EnableSagemakerServicecatalogPortfolioCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.EnableSagemakerServicecatalogPortfolio", }; let body: any; @@ -3074,7 +3074,7 @@ export const serializeAws_json1_1GetDeviceFleetReportCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.GetDeviceFleetReport", }; let body: any; @@ -3087,7 +3087,7 @@ export const serializeAws_json1_1GetModelPackageGroupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.GetModelPackageGroupPolicy", }; let body: any; @@ -3100,7 +3100,7 @@ export const serializeAws_json1_1GetSagemakerServicecatalogPortfolioStatusComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.GetSagemakerServicecatalogPortfolioStatus", }; let body: any; @@ -3113,7 +3113,7 @@ export const serializeAws_json1_1GetSearchSuggestionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.GetSearchSuggestions", }; let body: any; @@ -3126,7 +3126,7 @@ export const serializeAws_json1_1ListActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListActions", }; let body: any; @@ -3139,7 +3139,7 @@ export const serializeAws_json1_1ListAlgorithmsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListAlgorithms", }; let body: any; @@ -3152,7 +3152,7 @@ export const serializeAws_json1_1ListAppImageConfigsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListAppImageConfigs", }; let body: any; @@ -3165,7 +3165,7 @@ export const serializeAws_json1_1ListAppsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListApps", }; let body: any; @@ -3178,7 +3178,7 @@ export const serializeAws_json1_1ListArtifactsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListArtifacts", }; let body: any; @@ -3191,7 +3191,7 @@ export const serializeAws_json1_1ListAssociationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListAssociations", }; let body: any; @@ -3204,7 +3204,7 @@ export const serializeAws_json1_1ListAutoMLJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListAutoMLJobs", }; let body: any; @@ -3217,7 +3217,7 @@ export const serializeAws_json1_1ListCandidatesForAutoMLJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListCandidatesForAutoMLJob", }; let body: any; @@ -3230,7 +3230,7 @@ export const serializeAws_json1_1ListCodeRepositoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListCodeRepositories", }; let body: any; @@ -3243,7 +3243,7 @@ export const serializeAws_json1_1ListCompilationJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListCompilationJobs", }; let body: any; @@ -3256,7 +3256,7 @@ export const serializeAws_json1_1ListContextsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListContexts", }; let body: any; @@ -3269,7 +3269,7 @@ export const serializeAws_json1_1ListDataQualityJobDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListDataQualityJobDefinitions", }; let body: any; @@ -3282,7 +3282,7 @@ export const serializeAws_json1_1ListDeviceFleetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListDeviceFleets", }; let body: any; @@ -3295,7 +3295,7 @@ export const serializeAws_json1_1ListDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListDevices", }; let body: any; @@ -3308,7 +3308,7 @@ export const serializeAws_json1_1ListDomainsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListDomains", }; let body: any; @@ -3321,7 +3321,7 @@ export const serializeAws_json1_1ListEdgePackagingJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListEdgePackagingJobs", }; let body: any; @@ -3334,7 +3334,7 @@ export const serializeAws_json1_1ListEndpointConfigsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListEndpointConfigs", }; let body: any; @@ -3347,7 +3347,7 @@ export const serializeAws_json1_1ListEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListEndpoints", }; let body: any; @@ -3360,7 +3360,7 @@ export const serializeAws_json1_1ListExperimentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListExperiments", }; let body: any; @@ -3373,7 +3373,7 @@ export const serializeAws_json1_1ListFeatureGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListFeatureGroups", }; let body: any; @@ -3386,7 +3386,7 @@ export const serializeAws_json1_1ListFlowDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListFlowDefinitions", }; let body: any; @@ -3399,7 +3399,7 @@ export const serializeAws_json1_1ListHumanTaskUisCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListHumanTaskUis", }; let body: any; @@ -3412,7 +3412,7 @@ export const serializeAws_json1_1ListHyperParameterTuningJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListHyperParameterTuningJobs", }; let body: any; @@ -3425,7 +3425,7 @@ export const serializeAws_json1_1ListImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListImages", }; let body: any; @@ -3438,7 +3438,7 @@ export const serializeAws_json1_1ListImageVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListImageVersions", }; let body: any; @@ -3451,7 +3451,7 @@ export const serializeAws_json1_1ListLabelingJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListLabelingJobs", }; let body: any; @@ -3464,7 +3464,7 @@ export const serializeAws_json1_1ListLabelingJobsForWorkteamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListLabelingJobsForWorkteam", }; let body: any; @@ -3477,7 +3477,7 @@ export const serializeAws_json1_1ListModelBiasJobDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListModelBiasJobDefinitions", }; let body: any; @@ -3490,7 +3490,7 @@ export const serializeAws_json1_1ListModelExplainabilityJobDefinitionsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListModelExplainabilityJobDefinitions", }; let body: any; @@ -3503,7 +3503,7 @@ export const serializeAws_json1_1ListModelPackageGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListModelPackageGroups", }; let body: any; @@ -3516,7 +3516,7 @@ export const serializeAws_json1_1ListModelPackagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListModelPackages", }; let body: any; @@ -3529,7 +3529,7 @@ export const serializeAws_json1_1ListModelQualityJobDefinitionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListModelQualityJobDefinitions", }; let body: any; @@ -3542,7 +3542,7 @@ export const serializeAws_json1_1ListModelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListModels", }; let body: any; @@ -3555,7 +3555,7 @@ export const serializeAws_json1_1ListMonitoringExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListMonitoringExecutions", }; let body: any; @@ -3568,7 +3568,7 @@ export const serializeAws_json1_1ListMonitoringSchedulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListMonitoringSchedules", }; let body: any; @@ -3581,7 +3581,7 @@ export const serializeAws_json1_1ListNotebookInstanceLifecycleConfigsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListNotebookInstanceLifecycleConfigs", }; let body: any; @@ -3594,7 +3594,7 @@ export const serializeAws_json1_1ListNotebookInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListNotebookInstances", }; let body: any; @@ -3607,7 +3607,7 @@ export const serializeAws_json1_1ListPipelineExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListPipelineExecutions", }; let body: any; @@ -3620,7 +3620,7 @@ export const serializeAws_json1_1ListPipelineExecutionStepsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListPipelineExecutionSteps", }; let body: any; @@ -3633,7 +3633,7 @@ export const serializeAws_json1_1ListPipelineParametersForExecutionCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListPipelineParametersForExecution", }; let body: any; @@ -3646,7 +3646,7 @@ export const serializeAws_json1_1ListPipelinesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListPipelines", }; let body: any; @@ -3659,7 +3659,7 @@ export const serializeAws_json1_1ListProcessingJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListProcessingJobs", }; let body: any; @@ -3672,7 +3672,7 @@ export const serializeAws_json1_1ListProjectsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListProjects", }; let body: any; @@ -3685,7 +3685,7 @@ export const serializeAws_json1_1ListSubscribedWorkteamsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListSubscribedWorkteams", }; let body: any; @@ -3698,7 +3698,7 @@ export const serializeAws_json1_1ListTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListTags", }; let body: any; @@ -3711,7 +3711,7 @@ export const serializeAws_json1_1ListTrainingJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListTrainingJobs", }; let body: any; @@ -3724,7 +3724,7 @@ export const serializeAws_json1_1ListTrainingJobsForHyperParameterTuningJobComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListTrainingJobsForHyperParameterTuningJob", }; let body: any; @@ -3737,7 +3737,7 @@ export const serializeAws_json1_1ListTransformJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListTransformJobs", }; let body: any; @@ -3750,7 +3750,7 @@ export const serializeAws_json1_1ListTrialComponentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListTrialComponents", }; let body: any; @@ -3763,7 +3763,7 @@ export const serializeAws_json1_1ListTrialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListTrials", }; let body: any; @@ -3776,7 +3776,7 @@ export const serializeAws_json1_1ListUserProfilesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListUserProfiles", }; let body: any; @@ -3789,7 +3789,7 @@ export const serializeAws_json1_1ListWorkforcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListWorkforces", }; let body: any; @@ -3802,7 +3802,7 @@ export const serializeAws_json1_1ListWorkteamsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.ListWorkteams", }; let body: any; @@ -3815,7 +3815,7 @@ export const serializeAws_json1_1PutModelPackageGroupPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.PutModelPackageGroupPolicy", }; let body: any; @@ -3828,7 +3828,7 @@ export const serializeAws_json1_1RegisterDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.RegisterDevices", }; let body: any; @@ -3841,7 +3841,7 @@ export const serializeAws_json1_1RenderUiTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.RenderUiTemplate", }; let body: any; @@ -3854,7 +3854,7 @@ export const serializeAws_json1_1SearchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.Search", }; let body: any; @@ -3867,7 +3867,7 @@ export const serializeAws_json1_1StartMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StartMonitoringSchedule", }; let body: any; @@ -3880,7 +3880,7 @@ export const serializeAws_json1_1StartNotebookInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StartNotebookInstance", }; let body: any; @@ -3893,7 +3893,7 @@ export const serializeAws_json1_1StartPipelineExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StartPipelineExecution", }; let body: any; @@ -3906,7 +3906,7 @@ export const serializeAws_json1_1StopAutoMLJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopAutoMLJob", }; let body: any; @@ -3919,7 +3919,7 @@ export const serializeAws_json1_1StopCompilationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopCompilationJob", }; let body: any; @@ -3932,7 +3932,7 @@ export const serializeAws_json1_1StopEdgePackagingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopEdgePackagingJob", }; let body: any; @@ -3945,7 +3945,7 @@ export const serializeAws_json1_1StopHyperParameterTuningJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopHyperParameterTuningJob", }; let body: any; @@ -3958,7 +3958,7 @@ export const serializeAws_json1_1StopLabelingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopLabelingJob", }; let body: any; @@ -3971,7 +3971,7 @@ export const serializeAws_json1_1StopMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopMonitoringSchedule", }; let body: any; @@ -3984,7 +3984,7 @@ export const serializeAws_json1_1StopNotebookInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopNotebookInstance", }; let body: any; @@ -3997,7 +3997,7 @@ export const serializeAws_json1_1StopPipelineExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopPipelineExecution", }; let body: any; @@ -4010,7 +4010,7 @@ export const serializeAws_json1_1StopProcessingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopProcessingJob", }; let body: any; @@ -4023,7 +4023,7 @@ export const serializeAws_json1_1StopTrainingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopTrainingJob", }; let body: any; @@ -4036,7 +4036,7 @@ export const serializeAws_json1_1StopTransformJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.StopTransformJob", }; let body: any; @@ -4049,7 +4049,7 @@ export const serializeAws_json1_1UpdateActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateAction", }; let body: any; @@ -4062,7 +4062,7 @@ export const serializeAws_json1_1UpdateAppImageConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateAppImageConfig", }; let body: any; @@ -4075,7 +4075,7 @@ export const serializeAws_json1_1UpdateArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateArtifact", }; let body: any; @@ -4088,7 +4088,7 @@ export const serializeAws_json1_1UpdateCodeRepositoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateCodeRepository", }; let body: any; @@ -4101,7 +4101,7 @@ export const serializeAws_json1_1UpdateContextCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateContext", }; let body: any; @@ -4114,7 +4114,7 @@ export const serializeAws_json1_1UpdateDeviceFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateDeviceFleet", }; let body: any; @@ -4127,7 +4127,7 @@ export const serializeAws_json1_1UpdateDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateDevices", }; let body: any; @@ -4140,7 +4140,7 @@ export const serializeAws_json1_1UpdateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateDomain", }; let body: any; @@ -4153,7 +4153,7 @@ export const serializeAws_json1_1UpdateEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateEndpoint", }; let body: any; @@ -4166,7 +4166,7 @@ export const serializeAws_json1_1UpdateEndpointWeightsAndCapacitiesCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateEndpointWeightsAndCapacities", }; let body: any; @@ -4179,7 +4179,7 @@ export const serializeAws_json1_1UpdateExperimentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateExperiment", }; let body: any; @@ -4192,7 +4192,7 @@ export const serializeAws_json1_1UpdateImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateImage", }; let body: any; @@ -4205,7 +4205,7 @@ export const serializeAws_json1_1UpdateModelPackageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateModelPackage", }; let body: any; @@ -4218,7 +4218,7 @@ export const serializeAws_json1_1UpdateMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateMonitoringSchedule", }; let body: any; @@ -4231,7 +4231,7 @@ export const serializeAws_json1_1UpdateNotebookInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateNotebookInstance", }; let body: any; @@ -4244,7 +4244,7 @@ export const serializeAws_json1_1UpdateNotebookInstanceLifecycleConfigCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateNotebookInstanceLifecycleConfig", }; let body: any; @@ -4257,7 +4257,7 @@ export const serializeAws_json1_1UpdatePipelineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdatePipeline", }; let body: any; @@ -4270,7 +4270,7 @@ export const serializeAws_json1_1UpdatePipelineExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdatePipelineExecution", }; let body: any; @@ -4283,7 +4283,7 @@ export const serializeAws_json1_1UpdateTrainingJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateTrainingJob", }; let body: any; @@ -4296,7 +4296,7 @@ export const serializeAws_json1_1UpdateTrialCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateTrial", }; let body: any; @@ -4309,7 +4309,7 @@ export const serializeAws_json1_1UpdateTrialComponentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateTrialComponent", }; let body: any; @@ -4322,7 +4322,7 @@ export const serializeAws_json1_1UpdateUserProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateUserProfile", }; let body: any; @@ -4335,7 +4335,7 @@ export const serializeAws_json1_1UpdateWorkforceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateWorkforce", }; let body: any; @@ -4348,7 +4348,7 @@ export const serializeAws_json1_1UpdateWorkteamCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SageMaker.UpdateWorkteam", }; let body: any; @@ -4383,8 +4383,7 @@ const deserializeAws_json1_1AddAssociationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -4446,8 +4445,7 @@ const deserializeAws_json1_1AddTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4493,8 +4491,7 @@ const deserializeAws_json1_1AssociateTrialComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -4556,8 +4553,7 @@ const deserializeAws_json1_1CreateActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -4611,8 +4607,7 @@ const deserializeAws_json1_1CreateAlgorithmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4658,8 +4653,7 @@ const deserializeAws_json1_1CreateAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -4721,8 +4715,7 @@ const deserializeAws_json1_1CreateAppImageConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -4776,8 +4769,7 @@ const deserializeAws_json1_1CreateArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -4831,8 +4823,7 @@ const deserializeAws_json1_1CreateAutoMLJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -4894,8 +4885,7 @@ const deserializeAws_json1_1CreateCodeRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4941,8 +4931,7 @@ const deserializeAws_json1_1CreateCompilationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5004,8 +4993,7 @@ const deserializeAws_json1_1CreateContextCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -5059,8 +5047,7 @@ const deserializeAws_json1_1CreateDataQualityJobDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5119,8 +5106,7 @@ const deserializeAws_json1_1CreateDeviceFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5182,8 +5168,7 @@ const deserializeAws_json1_1CreateDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5242,8 +5227,7 @@ const deserializeAws_json1_1CreateEdgePackagingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -5297,8 +5281,7 @@ const deserializeAws_json1_1CreateEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -5352,8 +5335,7 @@ const deserializeAws_json1_1CreateEndpointConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -5407,8 +5389,7 @@ const deserializeAws_json1_1CreateExperimentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -5462,8 +5443,7 @@ const deserializeAws_json1_1CreateFeatureGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5525,8 +5505,7 @@ const deserializeAws_json1_1CreateFlowDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5588,8 +5567,7 @@ const deserializeAws_json1_1CreateHumanTaskUiCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5651,8 +5629,7 @@ const deserializeAws_json1_1CreateHyperParameterTuningJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5714,8 +5691,7 @@ const deserializeAws_json1_1CreateImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5777,8 +5753,7 @@ const deserializeAws_json1_1CreateImageVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5848,8 +5823,7 @@ const deserializeAws_json1_1CreateLabelingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -5911,8 +5885,7 @@ const deserializeAws_json1_1CreateModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -5966,8 +5939,7 @@ const deserializeAws_json1_1CreateModelBiasJobDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -6029,8 +6001,7 @@ const deserializeAws_json1_1CreateModelExplainabilityJobDefinitionCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -6092,8 +6063,7 @@ const deserializeAws_json1_1CreateModelPackageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.sagemaker#ConflictException": @@ -6155,8 +6125,7 @@ const deserializeAws_json1_1CreateModelPackageGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -6210,8 +6179,7 @@ const deserializeAws_json1_1CreateModelQualityJobDefinitionCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -6273,8 +6241,7 @@ const deserializeAws_json1_1CreateMonitoringScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -6336,8 +6303,7 @@ const deserializeAws_json1_1CreateNotebookInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -6391,8 +6357,7 @@ const deserializeAws_json1_1CreateNotebookInstanceLifecycleConfigCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -6446,8 +6411,7 @@ const deserializeAws_json1_1CreatePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -6509,8 +6473,7 @@ const deserializeAws_json1_1CreatePresignedDomainUrlCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -6564,8 +6527,7 @@ const deserializeAws_json1_1CreatePresignedNotebookInstanceUrlCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -6611,8 +6573,7 @@ const deserializeAws_json1_1CreateProcessingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -6682,8 +6643,7 @@ const deserializeAws_json1_1CreateProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -6737,8 +6697,7 @@ const deserializeAws_json1_1CreateTrainingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -6808,8 +6767,7 @@ const deserializeAws_json1_1CreateTransformJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -6879,8 +6837,7 @@ const deserializeAws_json1_1CreateTrialCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -6942,8 +6899,7 @@ const deserializeAws_json1_1CreateTrialComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -6997,8 +6953,7 @@ const deserializeAws_json1_1CreateUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -7060,8 +7015,7 @@ const deserializeAws_json1_1CreateWorkforceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -7107,8 +7061,7 @@ const deserializeAws_json1_1CreateWorkteamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -7170,8 +7123,7 @@ const deserializeAws_json1_1DeleteActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -7222,8 +7174,7 @@ const deserializeAws_json1_1DeleteAlgorithmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -7266,8 +7217,7 @@ const deserializeAws_json1_1DeleteAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -7326,8 +7276,7 @@ const deserializeAws_json1_1DeleteAppImageConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -7381,8 +7330,7 @@ const deserializeAws_json1_1DeleteArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -7436,8 +7384,7 @@ const deserializeAws_json1_1DeleteAssociationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -7488,8 +7435,7 @@ const deserializeAws_json1_1DeleteCodeRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -7535,8 +7481,7 @@ const deserializeAws_json1_1DeleteContextCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -7587,8 +7532,7 @@ const deserializeAws_json1_1DeleteDataQualityJobDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -7639,8 +7583,7 @@ const deserializeAws_json1_1DeleteDeviceFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -7691,8 +7634,7 @@ const deserializeAws_json1_1DeleteDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -7751,8 +7693,7 @@ const deserializeAws_json1_1DeleteEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -7795,8 +7736,7 @@ const deserializeAws_json1_1DeleteEndpointConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -7842,8 +7782,7 @@ const deserializeAws_json1_1DeleteExperimentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -7894,8 +7833,7 @@ const deserializeAws_json1_1DeleteFeatureGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -7949,8 +7887,7 @@ const deserializeAws_json1_1DeleteFlowDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -8012,8 +7949,7 @@ const deserializeAws_json1_1DeleteHumanTaskUiCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -8067,8 +8003,7 @@ const deserializeAws_json1_1DeleteImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -8130,8 +8065,7 @@ const deserializeAws_json1_1DeleteImageVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -8190,8 +8124,7 @@ const deserializeAws_json1_1DeleteModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -8234,8 +8167,7 @@ const deserializeAws_json1_1DeleteModelBiasJobDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -8286,8 +8218,7 @@ const deserializeAws_json1_1DeleteModelExplainabilityJobDefinitionCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -8338,8 +8269,7 @@ const deserializeAws_json1_1DeleteModelPackageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.sagemaker#ConflictException": @@ -8390,8 +8320,7 @@ const deserializeAws_json1_1DeleteModelPackageGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -8434,8 +8363,7 @@ const deserializeAws_json1_1DeleteModelPackageGroupPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -8478,8 +8406,7 @@ const deserializeAws_json1_1DeleteModelQualityJobDefinitionCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -8530,8 +8457,7 @@ const deserializeAws_json1_1DeleteMonitoringScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -8582,8 +8508,7 @@ const deserializeAws_json1_1DeleteNotebookInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -8626,8 +8551,7 @@ const deserializeAws_json1_1DeleteNotebookInstanceLifecycleConfigCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -8673,8 +8597,7 @@ const deserializeAws_json1_1DeletePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -8725,8 +8648,7 @@ const deserializeAws_json1_1DeleteProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -8772,8 +8694,7 @@ const deserializeAws_json1_1DeleteTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -8819,8 +8740,7 @@ const deserializeAws_json1_1DeleteTrialCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -8874,8 +8794,7 @@ const deserializeAws_json1_1DeleteTrialComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -8926,8 +8845,7 @@ const deserializeAws_json1_1DeleteUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -8989,8 +8907,7 @@ const deserializeAws_json1_1DeleteWorkforceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -9036,8 +8953,7 @@ const deserializeAws_json1_1DeleteWorkteamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -9088,8 +9004,7 @@ const deserializeAws_json1_1DeregisterDevicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -9135,8 +9050,7 @@ const deserializeAws_json1_1DescribeActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9190,8 +9104,7 @@ const deserializeAws_json1_1DescribeAlgorithmCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -9237,8 +9150,7 @@ const deserializeAws_json1_1DescribeAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9292,8 +9204,7 @@ const deserializeAws_json1_1DescribeAppImageConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9347,8 +9258,7 @@ const deserializeAws_json1_1DescribeArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9402,8 +9312,7 @@ const deserializeAws_json1_1DescribeAutoMLJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9457,8 +9366,7 @@ const deserializeAws_json1_1DescribeCodeRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -9504,8 +9412,7 @@ const deserializeAws_json1_1DescribeCompilationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9559,8 +9466,7 @@ const deserializeAws_json1_1DescribeContextCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9614,8 +9520,7 @@ const deserializeAws_json1_1DescribeDataQualityJobDefinitionCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9669,8 +9574,7 @@ const deserializeAws_json1_1DescribeDeviceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9724,8 +9628,7 @@ const deserializeAws_json1_1DescribeDeviceFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9779,8 +9682,7 @@ const deserializeAws_json1_1DescribeDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9834,8 +9736,7 @@ const deserializeAws_json1_1DescribeEdgePackagingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -9889,8 +9790,7 @@ const deserializeAws_json1_1DescribeEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -9936,8 +9836,7 @@ const deserializeAws_json1_1DescribeEndpointConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -9983,8 +9882,7 @@ const deserializeAws_json1_1DescribeExperimentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10038,8 +9936,7 @@ const deserializeAws_json1_1DescribeFeatureGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10093,8 +9990,7 @@ const deserializeAws_json1_1DescribeFlowDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10148,8 +10044,7 @@ const deserializeAws_json1_1DescribeHumanTaskUiCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10203,8 +10098,7 @@ const deserializeAws_json1_1DescribeHyperParameterTuningJobCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10258,8 +10152,7 @@ const deserializeAws_json1_1DescribeImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10313,8 +10206,7 @@ const deserializeAws_json1_1DescribeImageVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10368,8 +10260,7 @@ const deserializeAws_json1_1DescribeLabelingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10423,8 +10314,7 @@ const deserializeAws_json1_1DescribeModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -10470,8 +10360,7 @@ const deserializeAws_json1_1DescribeModelBiasJobDefinitionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10525,8 +10414,7 @@ const deserializeAws_json1_1DescribeModelExplainabilityJobDefinitionCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10580,8 +10468,7 @@ const deserializeAws_json1_1DescribeModelPackageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -10627,8 +10514,7 @@ const deserializeAws_json1_1DescribeModelPackageGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -10674,8 +10560,7 @@ const deserializeAws_json1_1DescribeModelQualityJobDefinitionCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10729,8 +10614,7 @@ const deserializeAws_json1_1DescribeMonitoringScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10784,8 +10668,7 @@ const deserializeAws_json1_1DescribeNotebookInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -10831,8 +10714,7 @@ const deserializeAws_json1_1DescribeNotebookInstanceLifecycleConfigCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -10878,8 +10760,7 @@ const deserializeAws_json1_1DescribePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10933,8 +10814,7 @@ const deserializeAws_json1_1DescribePipelineDefinitionForExecutionCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -10988,8 +10868,7 @@ const deserializeAws_json1_1DescribePipelineExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -11043,8 +10922,7 @@ const deserializeAws_json1_1DescribeProcessingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -11098,8 +10976,7 @@ const deserializeAws_json1_1DescribeProjectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11145,8 +11022,7 @@ const deserializeAws_json1_1DescribeSubscribedWorkteamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11192,8 +11068,7 @@ const deserializeAws_json1_1DescribeTrainingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -11247,8 +11122,7 @@ const deserializeAws_json1_1DescribeTransformJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -11302,8 +11176,7 @@ const deserializeAws_json1_1DescribeTrialCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -11357,8 +11230,7 @@ const deserializeAws_json1_1DescribeTrialComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -11412,8 +11284,7 @@ const deserializeAws_json1_1DescribeUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -11467,8 +11338,7 @@ const deserializeAws_json1_1DescribeWorkforceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11514,8 +11384,7 @@ const deserializeAws_json1_1DescribeWorkteamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11561,8 +11430,7 @@ const deserializeAws_json1_1DisableSagemakerServicecatalogPortfolioCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11608,8 +11476,7 @@ const deserializeAws_json1_1DisassociateTrialComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -11663,8 +11530,7 @@ const deserializeAws_json1_1EnableSagemakerServicecatalogPortfolioCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11710,8 +11576,7 @@ const deserializeAws_json1_1GetDeviceFleetReportCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11757,8 +11622,7 @@ const deserializeAws_json1_1GetModelPackageGroupPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11804,8 +11668,7 @@ const deserializeAws_json1_1GetSagemakerServicecatalogPortfolioStatusCommandErro }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11851,8 +11714,7 @@ const deserializeAws_json1_1GetSearchSuggestionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -11898,8 +11760,7 @@ const deserializeAws_json1_1ListActionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -11953,8 +11814,7 @@ const deserializeAws_json1_1ListAlgorithmsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12000,8 +11860,7 @@ const deserializeAws_json1_1ListAppImageConfigsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12047,8 +11906,7 @@ const deserializeAws_json1_1ListAppsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12094,8 +11952,7 @@ const deserializeAws_json1_1ListArtifactsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -12149,8 +12006,7 @@ const deserializeAws_json1_1ListAssociationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -12204,8 +12060,7 @@ const deserializeAws_json1_1ListAutoMLJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12251,8 +12106,7 @@ const deserializeAws_json1_1ListCandidatesForAutoMLJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -12306,8 +12160,7 @@ const deserializeAws_json1_1ListCodeRepositoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12353,8 +12206,7 @@ const deserializeAws_json1_1ListCompilationJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12400,8 +12252,7 @@ const deserializeAws_json1_1ListContextsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -12455,8 +12306,7 @@ const deserializeAws_json1_1ListDataQualityJobDefinitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12502,8 +12352,7 @@ const deserializeAws_json1_1ListDeviceFleetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12549,8 +12398,7 @@ const deserializeAws_json1_1ListDevicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12596,8 +12444,7 @@ const deserializeAws_json1_1ListDomainsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12643,8 +12490,7 @@ const deserializeAws_json1_1ListEdgePackagingJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12690,8 +12536,7 @@ const deserializeAws_json1_1ListEndpointConfigsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12737,8 +12582,7 @@ const deserializeAws_json1_1ListEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12784,8 +12628,7 @@ const deserializeAws_json1_1ListExperimentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12831,8 +12674,7 @@ const deserializeAws_json1_1ListFeatureGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12878,8 +12720,7 @@ const deserializeAws_json1_1ListFlowDefinitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12925,8 +12766,7 @@ const deserializeAws_json1_1ListHumanTaskUisCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -12972,8 +12812,7 @@ const deserializeAws_json1_1ListHyperParameterTuningJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13019,8 +12858,7 @@ const deserializeAws_json1_1ListImagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13066,8 +12904,7 @@ const deserializeAws_json1_1ListImageVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -13121,8 +12958,7 @@ const deserializeAws_json1_1ListLabelingJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13168,8 +13004,7 @@ const deserializeAws_json1_1ListLabelingJobsForWorkteamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -13223,8 +13058,7 @@ const deserializeAws_json1_1ListModelBiasJobDefinitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13270,8 +13104,7 @@ const deserializeAws_json1_1ListModelExplainabilityJobDefinitionsCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13317,8 +13150,7 @@ const deserializeAws_json1_1ListModelPackageGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13364,8 +13196,7 @@ const deserializeAws_json1_1ListModelPackagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13411,8 +13242,7 @@ const deserializeAws_json1_1ListModelQualityJobDefinitionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13458,8 +13288,7 @@ const deserializeAws_json1_1ListModelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13505,8 +13334,7 @@ const deserializeAws_json1_1ListMonitoringExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13552,8 +13380,7 @@ const deserializeAws_json1_1ListMonitoringSchedulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13599,8 +13426,7 @@ const deserializeAws_json1_1ListNotebookInstanceLifecycleConfigsCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13646,8 +13472,7 @@ const deserializeAws_json1_1ListNotebookInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13693,8 +13518,7 @@ const deserializeAws_json1_1ListPipelineExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -13748,8 +13572,7 @@ const deserializeAws_json1_1ListPipelineExecutionStepsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -13803,8 +13626,7 @@ const deserializeAws_json1_1ListPipelineParametersForExecutionCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -13858,8 +13680,7 @@ const deserializeAws_json1_1ListPipelinesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13905,8 +13726,7 @@ const deserializeAws_json1_1ListProcessingJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13952,8 +13772,7 @@ const deserializeAws_json1_1ListProjectsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -13999,8 +13818,7 @@ const deserializeAws_json1_1ListSubscribedWorkteamsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -14046,8 +13864,7 @@ const deserializeAws_json1_1ListTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -14093,8 +13910,7 @@ const deserializeAws_json1_1ListTrainingJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -14140,8 +13956,7 @@ const deserializeAws_json1_1ListTrainingJobsForHyperParameterTuningJobCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -14195,8 +14010,7 @@ const deserializeAws_json1_1ListTransformJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -14242,8 +14056,7 @@ const deserializeAws_json1_1ListTrialComponentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -14297,8 +14110,7 @@ const deserializeAws_json1_1ListTrialsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -14352,8 +14164,7 @@ const deserializeAws_json1_1ListUserProfilesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -14399,8 +14210,7 @@ const deserializeAws_json1_1ListWorkforcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -14446,8 +14256,7 @@ const deserializeAws_json1_1ListWorkteamsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -14493,8 +14302,7 @@ const deserializeAws_json1_1PutModelPackageGroupPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -14537,8 +14345,7 @@ const deserializeAws_json1_1RegisterDevicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -14592,8 +14399,7 @@ const deserializeAws_json1_1RenderUiTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -14647,8 +14453,7 @@ const deserializeAws_json1_1SearchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -14691,8 +14496,7 @@ const deserializeAws_json1_1StartMonitoringScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -14743,8 +14547,7 @@ const deserializeAws_json1_1StartNotebookInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -14798,8 +14601,7 @@ const deserializeAws_json1_1StartPipelineExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -14858,8 +14660,7 @@ const deserializeAws_json1_1StopAutoMLJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -14910,8 +14711,7 @@ const deserializeAws_json1_1StopCompilationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -14962,8 +14762,7 @@ const deserializeAws_json1_1StopEdgePackagingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -15006,8 +14805,7 @@ const deserializeAws_json1_1StopHyperParameterTuningJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -15058,8 +14856,7 @@ const deserializeAws_json1_1StopLabelingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -15110,8 +14907,7 @@ const deserializeAws_json1_1StopMonitoringScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -15162,8 +14958,7 @@ const deserializeAws_json1_1StopNotebookInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -15209,8 +15004,7 @@ const deserializeAws_json1_1StopPipelineExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -15261,8 +15055,7 @@ const deserializeAws_json1_1StopProcessingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -15313,8 +15106,7 @@ const deserializeAws_json1_1StopTrainingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -15365,8 +15157,7 @@ const deserializeAws_json1_1StopTransformJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -15420,8 +15211,7 @@ const deserializeAws_json1_1UpdateActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.sagemaker#ConflictException": @@ -15483,8 +15273,7 @@ const deserializeAws_json1_1UpdateAppImageConfigCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -15538,8 +15327,7 @@ const deserializeAws_json1_1UpdateArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.sagemaker#ConflictException": @@ -15601,8 +15389,7 @@ const deserializeAws_json1_1UpdateCodeRepositoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -15648,8 +15435,7 @@ const deserializeAws_json1_1UpdateContextCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.sagemaker#ConflictException": @@ -15708,8 +15494,7 @@ const deserializeAws_json1_1UpdateDeviceFleetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -15760,8 +15545,7 @@ const deserializeAws_json1_1UpdateDevicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -15807,8 +15591,7 @@ const deserializeAws_json1_1UpdateDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -15878,8 +15661,7 @@ const deserializeAws_json1_1UpdateEndpointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -15933,8 +15715,7 @@ const deserializeAws_json1_1UpdateEndpointWeightsAndCapacitiesCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -15988,8 +15769,7 @@ const deserializeAws_json1_1UpdateExperimentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.sagemaker#ConflictException": @@ -16051,8 +15831,7 @@ const deserializeAws_json1_1UpdateImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -16114,8 +15893,7 @@ const deserializeAws_json1_1UpdateModelPackageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -16161,8 +15939,7 @@ const deserializeAws_json1_1UpdateMonitoringScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -16224,8 +16001,7 @@ const deserializeAws_json1_1UpdateNotebookInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -16279,8 +16055,7 @@ const deserializeAws_json1_1UpdateNotebookInstanceLifecycleConfigCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -16334,8 +16109,7 @@ const deserializeAws_json1_1UpdatePipelineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -16389,8 +16163,7 @@ const deserializeAws_json1_1UpdatePipelineExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -16444,8 +16217,7 @@ const deserializeAws_json1_1UpdateTrainingJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFound": case "com.amazonaws.sagemaker#ResourceNotFound": @@ -16499,8 +16271,7 @@ const deserializeAws_json1_1UpdateTrialCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.sagemaker#ConflictException": @@ -16562,8 +16333,7 @@ const deserializeAws_json1_1UpdateTrialComponentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.sagemaker#ConflictException": @@ -16625,8 +16395,7 @@ const deserializeAws_json1_1UpdateUserProfileCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUse": case "com.amazonaws.sagemaker#ResourceInUse": @@ -16696,8 +16465,7 @@ const deserializeAws_json1_1UpdateWorkforceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -16743,8 +16511,7 @@ const deserializeAws_json1_1UpdateWorkteamCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": @@ -16833,52 +16600,71 @@ const deserializeAws_json1_1ResourceNotFoundResponse = async ( const serializeAws_json1_1ActionSource = (input: ActionSource, context: __SerdeContext): any => { return { - ...(input.SourceId !== undefined && { SourceId: input.SourceId }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), - ...(input.SourceUri !== undefined && { SourceUri: input.SourceUri }), + ...(input.SourceId !== undefined && input.SourceId !== null && { SourceId: input.SourceId }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), + ...(input.SourceUri !== undefined && input.SourceUri !== null && { SourceUri: input.SourceUri }), }; }; const serializeAws_json1_1AddAssociationRequest = (input: AddAssociationRequest, context: __SerdeContext): any => { return { - ...(input.AssociationType !== undefined && { AssociationType: input.AssociationType }), - ...(input.DestinationArn !== undefined && { DestinationArn: input.DestinationArn }), - ...(input.SourceArn !== undefined && { SourceArn: input.SourceArn }), + ...(input.AssociationType !== undefined && + input.AssociationType !== null && { AssociationType: input.AssociationType }), + ...(input.DestinationArn !== undefined && + input.DestinationArn !== null && { DestinationArn: input.DestinationArn }), + ...(input.SourceArn !== undefined && input.SourceArn !== null && { SourceArn: input.SourceArn }), }; }; const serializeAws_json1_1AdditionalCodeRepositoryNamesOrUrls = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AddTagsInput = (input: AddTagsInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1Alarm = (input: Alarm, context: __SerdeContext): any => { return { - ...(input.AlarmName !== undefined && { AlarmName: input.AlarmName }), + ...(input.AlarmName !== undefined && input.AlarmName !== null && { AlarmName: input.AlarmName }), }; }; const serializeAws_json1_1AlarmList = (input: Alarm[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Alarm(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Alarm(entry, context); + }); }; const serializeAws_json1_1AlgorithmSpecification = (input: AlgorithmSpecification, context: __SerdeContext): any => { return { - ...(input.AlgorithmName !== undefined && { AlgorithmName: input.AlgorithmName }), - ...(input.EnableSageMakerMetricsTimeSeries !== undefined && { - EnableSageMakerMetricsTimeSeries: input.EnableSageMakerMetricsTimeSeries, - }), - ...(input.MetricDefinitions !== undefined && { - MetricDefinitions: serializeAws_json1_1MetricDefinitionList(input.MetricDefinitions, context), - }), - ...(input.TrainingImage !== undefined && { TrainingImage: input.TrainingImage }), - ...(input.TrainingInputMode !== undefined && { TrainingInputMode: input.TrainingInputMode }), + ...(input.AlgorithmName !== undefined && input.AlgorithmName !== null && { AlgorithmName: input.AlgorithmName }), + ...(input.EnableSageMakerMetricsTimeSeries !== undefined && + input.EnableSageMakerMetricsTimeSeries !== null && { + EnableSageMakerMetricsTimeSeries: input.EnableSageMakerMetricsTimeSeries, + }), + ...(input.MetricDefinitions !== undefined && + input.MetricDefinitions !== null && { + MetricDefinitions: serializeAws_json1_1MetricDefinitionList(input.MetricDefinitions, context), + }), + ...(input.TrainingImage !== undefined && input.TrainingImage !== null && { TrainingImage: input.TrainingImage }), + ...(input.TrainingInputMode !== undefined && + input.TrainingInputMode !== null && { TrainingInputMode: input.TrainingInputMode }), }; }; @@ -16887,13 +16673,15 @@ const serializeAws_json1_1AlgorithmValidationProfile = ( context: __SerdeContext ): any => { return { - ...(input.ProfileName !== undefined && { ProfileName: input.ProfileName }), - ...(input.TrainingJobDefinition !== undefined && { - TrainingJobDefinition: serializeAws_json1_1TrainingJobDefinition(input.TrainingJobDefinition, context), - }), - ...(input.TransformJobDefinition !== undefined && { - TransformJobDefinition: serializeAws_json1_1TransformJobDefinition(input.TransformJobDefinition, context), - }), + ...(input.ProfileName !== undefined && input.ProfileName !== null && { ProfileName: input.ProfileName }), + ...(input.TrainingJobDefinition !== undefined && + input.TrainingJobDefinition !== null && { + TrainingJobDefinition: serializeAws_json1_1TrainingJobDefinition(input.TrainingJobDefinition, context), + }), + ...(input.TransformJobDefinition !== undefined && + input.TransformJobDefinition !== null && { + TransformJobDefinition: serializeAws_json1_1TransformJobDefinition(input.TransformJobDefinition, context), + }), }; }; @@ -16901,7 +16689,14 @@ const serializeAws_json1_1AlgorithmValidationProfiles = ( input: AlgorithmValidationProfile[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AlgorithmValidationProfile(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AlgorithmValidationProfile(entry, context); + }); }; const serializeAws_json1_1AlgorithmValidationSpecification = ( @@ -16909,10 +16704,12 @@ const serializeAws_json1_1AlgorithmValidationSpecification = ( context: __SerdeContext ): any => { return { - ...(input.ValidationProfiles !== undefined && { - ValidationProfiles: serializeAws_json1_1AlgorithmValidationProfiles(input.ValidationProfiles, context), - }), - ...(input.ValidationRole !== undefined && { ValidationRole: input.ValidationRole }), + ...(input.ValidationProfiles !== undefined && + input.ValidationProfiles !== null && { + ValidationProfiles: serializeAws_json1_1AlgorithmValidationProfiles(input.ValidationProfiles, context), + }), + ...(input.ValidationRole !== undefined && + input.ValidationRole !== null && { ValidationRole: input.ValidationRole }), }; }; @@ -16921,42 +16718,53 @@ const serializeAws_json1_1AnnotationConsolidationConfig = ( context: __SerdeContext ): any => { return { - ...(input.AnnotationConsolidationLambdaArn !== undefined && { - AnnotationConsolidationLambdaArn: input.AnnotationConsolidationLambdaArn, - }), + ...(input.AnnotationConsolidationLambdaArn !== undefined && + input.AnnotationConsolidationLambdaArn !== null && { + AnnotationConsolidationLambdaArn: input.AnnotationConsolidationLambdaArn, + }), }; }; const serializeAws_json1_1AppSpecification = (input: AppSpecification, context: __SerdeContext): any => { return { - ...(input.ContainerArguments !== undefined && { - ContainerArguments: serializeAws_json1_1ContainerArguments(input.ContainerArguments, context), - }), - ...(input.ContainerEntrypoint !== undefined && { - ContainerEntrypoint: serializeAws_json1_1ContainerEntrypoint(input.ContainerEntrypoint, context), - }), - ...(input.ImageUri !== undefined && { ImageUri: input.ImageUri }), + ...(input.ContainerArguments !== undefined && + input.ContainerArguments !== null && { + ContainerArguments: serializeAws_json1_1ContainerArguments(input.ContainerArguments, context), + }), + ...(input.ContainerEntrypoint !== undefined && + input.ContainerEntrypoint !== null && { + ContainerEntrypoint: serializeAws_json1_1ContainerEntrypoint(input.ContainerEntrypoint, context), + }), + ...(input.ImageUri !== undefined && input.ImageUri !== null && { ImageUri: input.ImageUri }), }; }; const serializeAws_json1_1ArtifactSource = (input: ArtifactSource, context: __SerdeContext): any => { return { - ...(input.SourceTypes !== undefined && { - SourceTypes: serializeAws_json1_1ArtifactSourceTypes(input.SourceTypes, context), - }), - ...(input.SourceUri !== undefined && { SourceUri: input.SourceUri }), + ...(input.SourceTypes !== undefined && + input.SourceTypes !== null && { + SourceTypes: serializeAws_json1_1ArtifactSourceTypes(input.SourceTypes, context), + }), + ...(input.SourceUri !== undefined && input.SourceUri !== null && { SourceUri: input.SourceUri }), }; }; const serializeAws_json1_1ArtifactSourceType = (input: ArtifactSourceType, context: __SerdeContext): any => { return { - ...(input.SourceIdType !== undefined && { SourceIdType: input.SourceIdType }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.SourceIdType !== undefined && input.SourceIdType !== null && { SourceIdType: input.SourceIdType }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1ArtifactSourceTypes = (input: ArtifactSourceType[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ArtifactSourceType(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ArtifactSourceType(entry, context); + }); }; const serializeAws_json1_1AssociateTrialComponentRequest = ( @@ -16964,48 +16772,66 @@ const serializeAws_json1_1AssociateTrialComponentRequest = ( context: __SerdeContext ): any => { return { - ...(input.TrialComponentName !== undefined && { TrialComponentName: input.TrialComponentName }), - ...(input.TrialName !== undefined && { TrialName: input.TrialName }), + ...(input.TrialComponentName !== undefined && + input.TrialComponentName !== null && { TrialComponentName: input.TrialComponentName }), + ...(input.TrialName !== undefined && input.TrialName !== null && { TrialName: input.TrialName }), }; }; const serializeAws_json1_1AthenaDatasetDefinition = (input: AthenaDatasetDefinition, context: __SerdeContext): any => { return { - ...(input.Catalog !== undefined && { Catalog: input.Catalog }), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.OutputCompression !== undefined && { OutputCompression: input.OutputCompression }), - ...(input.OutputFormat !== undefined && { OutputFormat: input.OutputFormat }), - ...(input.OutputS3Uri !== undefined && { OutputS3Uri: input.OutputS3Uri }), - ...(input.QueryString !== undefined && { QueryString: input.QueryString }), - ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }), + ...(input.Catalog !== undefined && input.Catalog !== null && { Catalog: input.Catalog }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.OutputCompression !== undefined && + input.OutputCompression !== null && { OutputCompression: input.OutputCompression }), + ...(input.OutputFormat !== undefined && input.OutputFormat !== null && { OutputFormat: input.OutputFormat }), + ...(input.OutputS3Uri !== undefined && input.OutputS3Uri !== null && { OutputS3Uri: input.OutputS3Uri }), + ...(input.QueryString !== undefined && input.QueryString !== null && { QueryString: input.QueryString }), + ...(input.WorkGroup !== undefined && input.WorkGroup !== null && { WorkGroup: input.WorkGroup }), }; }; const serializeAws_json1_1AttributeNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AutoMLChannel = (input: AutoMLChannel, context: __SerdeContext): any => { return { - ...(input.CompressionType !== undefined && { CompressionType: input.CompressionType }), - ...(input.DataSource !== undefined && { - DataSource: serializeAws_json1_1AutoMLDataSource(input.DataSource, context), - }), - ...(input.TargetAttributeName !== undefined && { TargetAttributeName: input.TargetAttributeName }), + ...(input.CompressionType !== undefined && + input.CompressionType !== null && { CompressionType: input.CompressionType }), + ...(input.DataSource !== undefined && + input.DataSource !== null && { DataSource: serializeAws_json1_1AutoMLDataSource(input.DataSource, context) }), + ...(input.TargetAttributeName !== undefined && + input.TargetAttributeName !== null && { TargetAttributeName: input.TargetAttributeName }), }; }; const serializeAws_json1_1AutoMLDataSource = (input: AutoMLDataSource, context: __SerdeContext): any => { return { - ...(input.S3DataSource !== undefined && { - S3DataSource: serializeAws_json1_1AutoMLS3DataSource(input.S3DataSource, context), - }), + ...(input.S3DataSource !== undefined && + input.S3DataSource !== null && { + S3DataSource: serializeAws_json1_1AutoMLS3DataSource(input.S3DataSource, context), + }), }; }; const serializeAws_json1_1AutoMLInputDataConfig = (input: AutoMLChannel[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AutoMLChannel(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AutoMLChannel(entry, context); + }); }; const serializeAws_json1_1AutoMLJobCompletionCriteria = ( @@ -17013,85 +16839,100 @@ const serializeAws_json1_1AutoMLJobCompletionCriteria = ( context: __SerdeContext ): any => { return { - ...(input.MaxAutoMLJobRuntimeInSeconds !== undefined && { - MaxAutoMLJobRuntimeInSeconds: input.MaxAutoMLJobRuntimeInSeconds, - }), - ...(input.MaxCandidates !== undefined && { MaxCandidates: input.MaxCandidates }), - ...(input.MaxRuntimePerTrainingJobInSeconds !== undefined && { - MaxRuntimePerTrainingJobInSeconds: input.MaxRuntimePerTrainingJobInSeconds, - }), + ...(input.MaxAutoMLJobRuntimeInSeconds !== undefined && + input.MaxAutoMLJobRuntimeInSeconds !== null && { + MaxAutoMLJobRuntimeInSeconds: input.MaxAutoMLJobRuntimeInSeconds, + }), + ...(input.MaxCandidates !== undefined && input.MaxCandidates !== null && { MaxCandidates: input.MaxCandidates }), + ...(input.MaxRuntimePerTrainingJobInSeconds !== undefined && + input.MaxRuntimePerTrainingJobInSeconds !== null && { + MaxRuntimePerTrainingJobInSeconds: input.MaxRuntimePerTrainingJobInSeconds, + }), }; }; const serializeAws_json1_1AutoMLJobConfig = (input: AutoMLJobConfig, context: __SerdeContext): any => { return { - ...(input.CompletionCriteria !== undefined && { - CompletionCriteria: serializeAws_json1_1AutoMLJobCompletionCriteria(input.CompletionCriteria, context), - }), - ...(input.SecurityConfig !== undefined && { - SecurityConfig: serializeAws_json1_1AutoMLSecurityConfig(input.SecurityConfig, context), - }), + ...(input.CompletionCriteria !== undefined && + input.CompletionCriteria !== null && { + CompletionCriteria: serializeAws_json1_1AutoMLJobCompletionCriteria(input.CompletionCriteria, context), + }), + ...(input.SecurityConfig !== undefined && + input.SecurityConfig !== null && { + SecurityConfig: serializeAws_json1_1AutoMLSecurityConfig(input.SecurityConfig, context), + }), }; }; const serializeAws_json1_1AutoMLJobObjective = (input: AutoMLJobObjective, context: __SerdeContext): any => { return { - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), }; }; const serializeAws_json1_1AutoMLOutputDataConfig = (input: AutoMLOutputDataConfig, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), }; }; const serializeAws_json1_1AutoMLS3DataSource = (input: AutoMLS3DataSource, context: __SerdeContext): any => { return { - ...(input.S3DataType !== undefined && { S3DataType: input.S3DataType }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.S3DataType !== undefined && input.S3DataType !== null && { S3DataType: input.S3DataType }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1AutoMLSecurityConfig = (input: AutoMLSecurityConfig, context: __SerdeContext): any => { return { - ...(input.EnableInterContainerTrafficEncryption !== undefined && { - EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, - }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.EnableInterContainerTrafficEncryption !== undefined && + input.EnableInterContainerTrafficEncryption !== null && { + EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, + }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; const serializeAws_json1_1AutoRollbackConfig = (input: AutoRollbackConfig, context: __SerdeContext): any => { return { - ...(input.Alarms !== undefined && { Alarms: serializeAws_json1_1AlarmList(input.Alarms, context) }), + ...(input.Alarms !== undefined && + input.Alarms !== null && { Alarms: serializeAws_json1_1AlarmList(input.Alarms, context) }), }; }; const serializeAws_json1_1Bias = (input: Bias, context: __SerdeContext): any => { return { - ...(input.Report !== undefined && { Report: serializeAws_json1_1MetricsSource(input.Report, context) }), + ...(input.Report !== undefined && + input.Report !== null && { Report: serializeAws_json1_1MetricsSource(input.Report, context) }), }; }; const serializeAws_json1_1BlueGreenUpdatePolicy = (input: BlueGreenUpdatePolicy, context: __SerdeContext): any => { return { - ...(input.MaximumExecutionTimeoutInSeconds !== undefined && { - MaximumExecutionTimeoutInSeconds: input.MaximumExecutionTimeoutInSeconds, - }), - ...(input.TerminationWaitInSeconds !== undefined && { TerminationWaitInSeconds: input.TerminationWaitInSeconds }), - ...(input.TrafficRoutingConfiguration !== undefined && { - TrafficRoutingConfiguration: serializeAws_json1_1TrafficRoutingConfig(input.TrafficRoutingConfiguration, context), - }), + ...(input.MaximumExecutionTimeoutInSeconds !== undefined && + input.MaximumExecutionTimeoutInSeconds !== null && { + MaximumExecutionTimeoutInSeconds: input.MaximumExecutionTimeoutInSeconds, + }), + ...(input.TerminationWaitInSeconds !== undefined && + input.TerminationWaitInSeconds !== null && { TerminationWaitInSeconds: input.TerminationWaitInSeconds }), + ...(input.TrafficRoutingConfiguration !== undefined && + input.TrafficRoutingConfiguration !== null && { + TrafficRoutingConfiguration: serializeAws_json1_1TrafficRoutingConfig( + input.TrafficRoutingConfiguration, + context + ), + }), }; }; const serializeAws_json1_1CapacitySize = (input: CapacitySize, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -17100,23 +16941,32 @@ const serializeAws_json1_1CaptureContentTypeHeader = ( context: __SerdeContext ): any => { return { - ...(input.CsvContentTypes !== undefined && { - CsvContentTypes: serializeAws_json1_1CsvContentTypes(input.CsvContentTypes, context), - }), - ...(input.JsonContentTypes !== undefined && { - JsonContentTypes: serializeAws_json1_1JsonContentTypes(input.JsonContentTypes, context), - }), + ...(input.CsvContentTypes !== undefined && + input.CsvContentTypes !== null && { + CsvContentTypes: serializeAws_json1_1CsvContentTypes(input.CsvContentTypes, context), + }), + ...(input.JsonContentTypes !== undefined && + input.JsonContentTypes !== null && { + JsonContentTypes: serializeAws_json1_1JsonContentTypes(input.JsonContentTypes, context), + }), }; }; const serializeAws_json1_1CaptureOption = (input: CaptureOption, context: __SerdeContext): any => { return { - ...(input.CaptureMode !== undefined && { CaptureMode: input.CaptureMode }), + ...(input.CaptureMode !== undefined && input.CaptureMode !== null && { CaptureMode: input.CaptureMode }), }; }; const serializeAws_json1_1CaptureOptionList = (input: CaptureOption[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CaptureOption(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CaptureOption(entry, context); + }); }; const serializeAws_json1_1CategoricalParameterRange = ( @@ -17124,8 +16974,9 @@ const serializeAws_json1_1CategoricalParameterRange = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1ParameterValues(input.Values, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1ParameterValues(input.Values, context) }), }; }; @@ -17133,7 +16984,14 @@ const serializeAws_json1_1CategoricalParameterRanges = ( input: CategoricalParameterRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CategoricalParameterRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CategoricalParameterRange(entry, context); + }); }; const serializeAws_json1_1CategoricalParameterRangeSpecification = ( @@ -17141,77 +16999,101 @@ const serializeAws_json1_1CategoricalParameterRangeSpecification = ( context: __SerdeContext ): any => { return { - ...(input.Values !== undefined && { Values: serializeAws_json1_1ParameterValues(input.Values, context) }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1ParameterValues(input.Values, context) }), }; }; const serializeAws_json1_1Channel = (input: Channel, context: __SerdeContext): any => { return { - ...(input.ChannelName !== undefined && { ChannelName: input.ChannelName }), - ...(input.CompressionType !== undefined && { CompressionType: input.CompressionType }), - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), - ...(input.DataSource !== undefined && { DataSource: serializeAws_json1_1DataSource(input.DataSource, context) }), - ...(input.InputMode !== undefined && { InputMode: input.InputMode }), - ...(input.RecordWrapperType !== undefined && { RecordWrapperType: input.RecordWrapperType }), - ...(input.ShuffleConfig !== undefined && { - ShuffleConfig: serializeAws_json1_1ShuffleConfig(input.ShuffleConfig, context), - }), + ...(input.ChannelName !== undefined && input.ChannelName !== null && { ChannelName: input.ChannelName }), + ...(input.CompressionType !== undefined && + input.CompressionType !== null && { CompressionType: input.CompressionType }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), + ...(input.DataSource !== undefined && + input.DataSource !== null && { DataSource: serializeAws_json1_1DataSource(input.DataSource, context) }), + ...(input.InputMode !== undefined && input.InputMode !== null && { InputMode: input.InputMode }), + ...(input.RecordWrapperType !== undefined && + input.RecordWrapperType !== null && { RecordWrapperType: input.RecordWrapperType }), + ...(input.ShuffleConfig !== undefined && + input.ShuffleConfig !== null && { + ShuffleConfig: serializeAws_json1_1ShuffleConfig(input.ShuffleConfig, context), + }), }; }; const serializeAws_json1_1ChannelSpecification = (input: ChannelSpecification, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.IsRequired !== undefined && { IsRequired: input.IsRequired }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SupportedCompressionTypes !== undefined && { - SupportedCompressionTypes: serializeAws_json1_1CompressionTypes(input.SupportedCompressionTypes, context), - }), - ...(input.SupportedContentTypes !== undefined && { - SupportedContentTypes: serializeAws_json1_1ContentTypes(input.SupportedContentTypes, context), - }), - ...(input.SupportedInputModes !== undefined && { - SupportedInputModes: serializeAws_json1_1InputModes(input.SupportedInputModes, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.IsRequired !== undefined && input.IsRequired !== null && { IsRequired: input.IsRequired }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SupportedCompressionTypes !== undefined && + input.SupportedCompressionTypes !== null && { + SupportedCompressionTypes: serializeAws_json1_1CompressionTypes(input.SupportedCompressionTypes, context), + }), + ...(input.SupportedContentTypes !== undefined && + input.SupportedContentTypes !== null && { + SupportedContentTypes: serializeAws_json1_1ContentTypes(input.SupportedContentTypes, context), + }), + ...(input.SupportedInputModes !== undefined && + input.SupportedInputModes !== null && { + SupportedInputModes: serializeAws_json1_1InputModes(input.SupportedInputModes, context), + }), }; }; const serializeAws_json1_1ChannelSpecifications = (input: ChannelSpecification[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ChannelSpecification(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ChannelSpecification(entry, context); + }); }; const serializeAws_json1_1CheckpointConfig = (input: CheckpointConfig, context: __SerdeContext): any => { return { - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1Cidrs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CognitoConfig = (input: CognitoConfig, context: __SerdeContext): any => { return { - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.UserPool !== undefined && { UserPool: input.UserPool }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.UserPool !== undefined && input.UserPool !== null && { UserPool: input.UserPool }), }; }; const serializeAws_json1_1CognitoMemberDefinition = (input: CognitoMemberDefinition, context: __SerdeContext): any => { return { - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.UserGroup !== undefined && { UserGroup: input.UserGroup }), - ...(input.UserPool !== undefined && { UserPool: input.UserPool }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.UserGroup !== undefined && input.UserGroup !== null && { UserGroup: input.UserGroup }), + ...(input.UserPool !== undefined && input.UserPool !== null && { UserPool: input.UserPool }), }; }; const serializeAws_json1_1CollectionConfiguration = (input: CollectionConfiguration, context: __SerdeContext): any => { return { - ...(input.CollectionName !== undefined && { CollectionName: input.CollectionName }), - ...(input.CollectionParameters !== undefined && { - CollectionParameters: serializeAws_json1_1CollectionParameters(input.CollectionParameters, context), - }), + ...(input.CollectionName !== undefined && + input.CollectionName !== null && { CollectionName: input.CollectionName }), + ...(input.CollectionParameters !== undefined && + input.CollectionParameters !== null && { + CollectionParameters: serializeAws_json1_1CollectionParameters(input.CollectionParameters, context), + }), }; }; @@ -17219,67 +17101,118 @@ const serializeAws_json1_1CollectionConfigurations = ( input: CollectionConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CollectionConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CollectionConfiguration(entry, context); + }); }; const serializeAws_json1_1CollectionParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1CompressionTypes = (input: (CompressionType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ContainerArguments = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ContainerDefinition = (input: ContainerDefinition, context: __SerdeContext): any => { return { - ...(input.ContainerHostname !== undefined && { ContainerHostname: input.ContainerHostname }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1EnvironmentMap(input.Environment, context), - }), - ...(input.Image !== undefined && { Image: input.Image }), - ...(input.ImageConfig !== undefined && { - ImageConfig: serializeAws_json1_1ImageConfig(input.ImageConfig, context), - }), - ...(input.Mode !== undefined && { Mode: input.Mode }), - ...(input.ModelDataUrl !== undefined && { ModelDataUrl: input.ModelDataUrl }), - ...(input.ModelPackageName !== undefined && { ModelPackageName: input.ModelPackageName }), + ...(input.ContainerHostname !== undefined && + input.ContainerHostname !== null && { ContainerHostname: input.ContainerHostname }), + ...(input.Environment !== undefined && + input.Environment !== null && { Environment: serializeAws_json1_1EnvironmentMap(input.Environment, context) }), + ...(input.Image !== undefined && input.Image !== null && { Image: input.Image }), + ...(input.ImageConfig !== undefined && + input.ImageConfig !== null && { ImageConfig: serializeAws_json1_1ImageConfig(input.ImageConfig, context) }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), + ...(input.ModelDataUrl !== undefined && input.ModelDataUrl !== null && { ModelDataUrl: input.ModelDataUrl }), + ...(input.ModelPackageName !== undefined && + input.ModelPackageName !== null && { ModelPackageName: input.ModelPackageName }), }; }; const serializeAws_json1_1ContainerDefinitionList = (input: ContainerDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ContainerDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ContainerDefinition(entry, context); + }); }; const serializeAws_json1_1ContainerEntrypoint = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ContentClassifiers = ( input: (ContentClassifier | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ContentTypes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ContextSource = (input: ContextSource, context: __SerdeContext): any => { return { - ...(input.SourceId !== undefined && { SourceId: input.SourceId }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), - ...(input.SourceUri !== undefined && { SourceUri: input.SourceUri }), + ...(input.SourceId !== undefined && input.SourceId !== null && { SourceId: input.SourceId }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), + ...(input.SourceUri !== undefined && input.SourceUri !== null && { SourceUri: input.SourceUri }), }; }; @@ -17288,10 +17221,10 @@ const serializeAws_json1_1ContinuousParameterRange = ( context: __SerdeContext ): any => { return { - ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), - ...(input.MinValue !== undefined && { MinValue: input.MinValue }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ScalingType !== undefined && { ScalingType: input.ScalingType }), + ...(input.MaxValue !== undefined && input.MaxValue !== null && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && input.MinValue !== null && { MinValue: input.MinValue }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ScalingType !== undefined && input.ScalingType !== null && { ScalingType: input.ScalingType }), }; }; @@ -17299,7 +17232,14 @@ const serializeAws_json1_1ContinuousParameterRanges = ( input: ContinuousParameterRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ContinuousParameterRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ContinuousParameterRange(entry, context); + }); }; const serializeAws_json1_1ContinuousParameterRangeSpecification = ( @@ -17307,46 +17247,54 @@ const serializeAws_json1_1ContinuousParameterRangeSpecification = ( context: __SerdeContext ): any => { return { - ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), - ...(input.MinValue !== undefined && { MinValue: input.MinValue }), + ...(input.MaxValue !== undefined && input.MaxValue !== null && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && input.MinValue !== null && { MinValue: input.MinValue }), }; }; const serializeAws_json1_1CreateActionRequest = (input: CreateActionRequest, context: __SerdeContext): any => { return { - ...(input.ActionName !== undefined && { ActionName: input.ActionName }), - ...(input.ActionType !== undefined && { ActionType: input.ActionType }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.MetadataProperties !== undefined && { - MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), - }), - ...(input.Properties !== undefined && { - Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), - }), - ...(input.Source !== undefined && { Source: serializeAws_json1_1ActionSource(input.Source, context) }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ActionName !== undefined && input.ActionName !== null && { ActionName: input.ActionName }), + ...(input.ActionType !== undefined && input.ActionType !== null && { ActionType: input.ActionType }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.MetadataProperties !== undefined && + input.MetadataProperties !== null && { + MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), + }), + ...(input.Properties !== undefined && + input.Properties !== null && { + Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), + }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_json1_1ActionSource(input.Source, context) }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateAlgorithmInput = (input: CreateAlgorithmInput, context: __SerdeContext): any => { return { - ...(input.AlgorithmDescription !== undefined && { AlgorithmDescription: input.AlgorithmDescription }), - ...(input.AlgorithmName !== undefined && { AlgorithmName: input.AlgorithmName }), - ...(input.CertifyForMarketplace !== undefined && { CertifyForMarketplace: input.CertifyForMarketplace }), - ...(input.InferenceSpecification !== undefined && { - InferenceSpecification: serializeAws_json1_1InferenceSpecification(input.InferenceSpecification, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TrainingSpecification !== undefined && { - TrainingSpecification: serializeAws_json1_1TrainingSpecification(input.TrainingSpecification, context), - }), - ...(input.ValidationSpecification !== undefined && { - ValidationSpecification: serializeAws_json1_1AlgorithmValidationSpecification( - input.ValidationSpecification, - context - ), - }), + ...(input.AlgorithmDescription !== undefined && + input.AlgorithmDescription !== null && { AlgorithmDescription: input.AlgorithmDescription }), + ...(input.AlgorithmName !== undefined && input.AlgorithmName !== null && { AlgorithmName: input.AlgorithmName }), + ...(input.CertifyForMarketplace !== undefined && + input.CertifyForMarketplace !== null && { CertifyForMarketplace: input.CertifyForMarketplace }), + ...(input.InferenceSpecification !== undefined && + input.InferenceSpecification !== null && { + InferenceSpecification: serializeAws_json1_1InferenceSpecification(input.InferenceSpecification, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TrainingSpecification !== undefined && + input.TrainingSpecification !== null && { + TrainingSpecification: serializeAws_json1_1TrainingSpecification(input.TrainingSpecification, context), + }), + ...(input.ValidationSpecification !== undefined && + input.ValidationSpecification !== null && { + ValidationSpecification: serializeAws_json1_1AlgorithmValidationSpecification( + input.ValidationSpecification, + context + ), + }), }; }; @@ -17355,63 +17303,73 @@ const serializeAws_json1_1CreateAppImageConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.AppImageConfigName !== undefined && { AppImageConfigName: input.AppImageConfigName }), - ...(input.KernelGatewayImageConfig !== undefined && { - KernelGatewayImageConfig: serializeAws_json1_1KernelGatewayImageConfig(input.KernelGatewayImageConfig, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.AppImageConfigName !== undefined && + input.AppImageConfigName !== null && { AppImageConfigName: input.AppImageConfigName }), + ...(input.KernelGatewayImageConfig !== undefined && + input.KernelGatewayImageConfig !== null && { + KernelGatewayImageConfig: serializeAws_json1_1KernelGatewayImageConfig(input.KernelGatewayImageConfig, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateAppRequest = (input: CreateAppRequest, context: __SerdeContext): any => { return { - ...(input.AppName !== undefined && { AppName: input.AppName }), - ...(input.AppType !== undefined && { AppType: input.AppType }), - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.ResourceSpec !== undefined && { - ResourceSpec: serializeAws_json1_1ResourceSpec(input.ResourceSpec, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.UserProfileName !== undefined && { UserProfileName: input.UserProfileName }), + ...(input.AppName !== undefined && input.AppName !== null && { AppName: input.AppName }), + ...(input.AppType !== undefined && input.AppType !== null && { AppType: input.AppType }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.ResourceSpec !== undefined && + input.ResourceSpec !== null && { ResourceSpec: serializeAws_json1_1ResourceSpec(input.ResourceSpec, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.UserProfileName !== undefined && + input.UserProfileName !== null && { UserProfileName: input.UserProfileName }), }; }; const serializeAws_json1_1CreateArtifactRequest = (input: CreateArtifactRequest, context: __SerdeContext): any => { return { - ...(input.ArtifactName !== undefined && { ArtifactName: input.ArtifactName }), - ...(input.ArtifactType !== undefined && { ArtifactType: input.ArtifactType }), - ...(input.MetadataProperties !== undefined && { - MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), - }), - ...(input.Properties !== undefined && { - Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), - }), - ...(input.Source !== undefined && { Source: serializeAws_json1_1ArtifactSource(input.Source, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ArtifactName !== undefined && input.ArtifactName !== null && { ArtifactName: input.ArtifactName }), + ...(input.ArtifactType !== undefined && input.ArtifactType !== null && { ArtifactType: input.ArtifactType }), + ...(input.MetadataProperties !== undefined && + input.MetadataProperties !== null && { + MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), + }), + ...(input.Properties !== undefined && + input.Properties !== null && { + Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), + }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_json1_1ArtifactSource(input.Source, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateAutoMLJobRequest = (input: CreateAutoMLJobRequest, context: __SerdeContext): any => { return { - ...(input.AutoMLJobConfig !== undefined && { - AutoMLJobConfig: serializeAws_json1_1AutoMLJobConfig(input.AutoMLJobConfig, context), - }), - ...(input.AutoMLJobName !== undefined && { AutoMLJobName: input.AutoMLJobName }), - ...(input.AutoMLJobObjective !== undefined && { - AutoMLJobObjective: serializeAws_json1_1AutoMLJobObjective(input.AutoMLJobObjective, context), - }), - ...(input.GenerateCandidateDefinitionsOnly !== undefined && { - GenerateCandidateDefinitionsOnly: input.GenerateCandidateDefinitionsOnly, - }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1AutoMLInputDataConfig(input.InputDataConfig, context), - }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1AutoMLOutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.ProblemType !== undefined && { ProblemType: input.ProblemType }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.AutoMLJobConfig !== undefined && + input.AutoMLJobConfig !== null && { + AutoMLJobConfig: serializeAws_json1_1AutoMLJobConfig(input.AutoMLJobConfig, context), + }), + ...(input.AutoMLJobName !== undefined && input.AutoMLJobName !== null && { AutoMLJobName: input.AutoMLJobName }), + ...(input.AutoMLJobObjective !== undefined && + input.AutoMLJobObjective !== null && { + AutoMLJobObjective: serializeAws_json1_1AutoMLJobObjective(input.AutoMLJobObjective, context), + }), + ...(input.GenerateCandidateDefinitionsOnly !== undefined && + input.GenerateCandidateDefinitionsOnly !== null && { + GenerateCandidateDefinitionsOnly: input.GenerateCandidateDefinitionsOnly, + }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1AutoMLInputDataConfig(input.InputDataConfig, context), + }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1AutoMLOutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.ProblemType !== undefined && input.ProblemType !== null && { ProblemType: input.ProblemType }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17420,9 +17378,11 @@ const serializeAws_json1_1CreateCodeRepositoryInput = ( context: __SerdeContext ): any => { return { - ...(input.CodeRepositoryName !== undefined && { CodeRepositoryName: input.CodeRepositoryName }), - ...(input.GitConfig !== undefined && { GitConfig: serializeAws_json1_1GitConfig(input.GitConfig, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CodeRepositoryName !== undefined && + input.CodeRepositoryName !== null && { CodeRepositoryName: input.CodeRepositoryName }), + ...(input.GitConfig !== undefined && + input.GitConfig !== null && { GitConfig: serializeAws_json1_1GitConfig(input.GitConfig, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17431,31 +17391,33 @@ const serializeAws_json1_1CreateCompilationJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.CompilationJobName !== undefined && { CompilationJobName: input.CompilationJobName }), - ...(input.InputConfig !== undefined && { - InputConfig: serializeAws_json1_1InputConfig(input.InputConfig, context), - }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1StoppingCondition(input.StoppingCondition, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CompilationJobName !== undefined && + input.CompilationJobName !== null && { CompilationJobName: input.CompilationJobName }), + ...(input.InputConfig !== undefined && + input.InputConfig !== null && { InputConfig: serializeAws_json1_1InputConfig(input.InputConfig, context) }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1StoppingCondition(input.StoppingCondition, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateContextRequest = (input: CreateContextRequest, context: __SerdeContext): any => { return { - ...(input.ContextName !== undefined && { ContextName: input.ContextName }), - ...(input.ContextType !== undefined && { ContextType: input.ContextType }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Properties !== undefined && { - Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), - }), - ...(input.Source !== undefined && { Source: serializeAws_json1_1ContextSource(input.Source, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ContextName !== undefined && input.ContextName !== null && { ContextName: input.ContextName }), + ...(input.ContextType !== undefined && input.ContextType !== null && { ContextType: input.ContextType }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Properties !== undefined && + input.Properties !== null && { + Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), + }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_json1_1ContextSource(input.Source, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17464,36 +17426,47 @@ const serializeAws_json1_1CreateDataQualityJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.DataQualityAppSpecification !== undefined && { - DataQualityAppSpecification: serializeAws_json1_1DataQualityAppSpecification( - input.DataQualityAppSpecification, - context - ), - }), - ...(input.DataQualityBaselineConfig !== undefined && { - DataQualityBaselineConfig: serializeAws_json1_1DataQualityBaselineConfig( - input.DataQualityBaselineConfig, - context - ), - }), - ...(input.DataQualityJobInput !== undefined && { - DataQualityJobInput: serializeAws_json1_1DataQualityJobInput(input.DataQualityJobInput, context), - }), - ...(input.DataQualityJobOutputConfig !== undefined && { - DataQualityJobOutputConfig: serializeAws_json1_1MonitoringOutputConfig(input.DataQualityJobOutputConfig, context), - }), - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), - ...(input.JobResources !== undefined && { - JobResources: serializeAws_json1_1MonitoringResources(input.JobResources, context), - }), - ...(input.NetworkConfig !== undefined && { - NetworkConfig: serializeAws_json1_1MonitoringNetworkConfig(input.NetworkConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.DataQualityAppSpecification !== undefined && + input.DataQualityAppSpecification !== null && { + DataQualityAppSpecification: serializeAws_json1_1DataQualityAppSpecification( + input.DataQualityAppSpecification, + context + ), + }), + ...(input.DataQualityBaselineConfig !== undefined && + input.DataQualityBaselineConfig !== null && { + DataQualityBaselineConfig: serializeAws_json1_1DataQualityBaselineConfig( + input.DataQualityBaselineConfig, + context + ), + }), + ...(input.DataQualityJobInput !== undefined && + input.DataQualityJobInput !== null && { + DataQualityJobInput: serializeAws_json1_1DataQualityJobInput(input.DataQualityJobInput, context), + }), + ...(input.DataQualityJobOutputConfig !== undefined && + input.DataQualityJobOutputConfig !== null && { + DataQualityJobOutputConfig: serializeAws_json1_1MonitoringOutputConfig( + input.DataQualityJobOutputConfig, + context + ), + }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobResources !== undefined && + input.JobResources !== null && { + JobResources: serializeAws_json1_1MonitoringResources(input.JobResources, context), + }), + ...(input.NetworkConfig !== undefined && + input.NetworkConfig !== null && { + NetworkConfig: serializeAws_json1_1MonitoringNetworkConfig(input.NetworkConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17502,31 +17475,35 @@ const serializeAws_json1_1CreateDeviceFleetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_json1_1EdgeOutputConfig(input.OutputConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { + OutputConfig: serializeAws_json1_1EdgeOutputConfig(input.OutputConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateDomainRequest = (input: CreateDomainRequest, context: __SerdeContext): any => { return { - ...(input.AppNetworkAccessType !== undefined && { AppNetworkAccessType: input.AppNetworkAccessType }), - ...(input.AuthMode !== undefined && { AuthMode: input.AuthMode }), - ...(input.DefaultUserSettings !== undefined && { - DefaultUserSettings: serializeAws_json1_1UserSettings(input.DefaultUserSettings, context), - }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.HomeEfsFileSystemKmsKeyId !== undefined && { - HomeEfsFileSystemKmsKeyId: input.HomeEfsFileSystemKmsKeyId, - }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1Subnets(input.SubnetIds, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.AppNetworkAccessType !== undefined && + input.AppNetworkAccessType !== null && { AppNetworkAccessType: input.AppNetworkAccessType }), + ...(input.AuthMode !== undefined && input.AuthMode !== null && { AuthMode: input.AuthMode }), + ...(input.DefaultUserSettings !== undefined && + input.DefaultUserSettings !== null && { + DefaultUserSettings: serializeAws_json1_1UserSettings(input.DefaultUserSettings, context), + }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.HomeEfsFileSystemKmsKeyId !== undefined && + input.HomeEfsFileSystemKmsKeyId !== null && { HomeEfsFileSystemKmsKeyId: input.HomeEfsFileSystemKmsKeyId }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1Subnets(input.SubnetIds, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -17535,16 +17512,19 @@ const serializeAws_json1_1CreateEdgePackagingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.CompilationJobName !== undefined && { CompilationJobName: input.CompilationJobName }), - ...(input.EdgePackagingJobName !== undefined && { EdgePackagingJobName: input.EdgePackagingJobName }), - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), - ...(input.ModelVersion !== undefined && { ModelVersion: input.ModelVersion }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_json1_1EdgeOutputConfig(input.OutputConfig, context), - }), - ...(input.ResourceKey !== undefined && { ResourceKey: input.ResourceKey }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.CompilationJobName !== undefined && + input.CompilationJobName !== null && { CompilationJobName: input.CompilationJobName }), + ...(input.EdgePackagingJobName !== undefined && + input.EdgePackagingJobName !== null && { EdgePackagingJobName: input.EdgePackagingJobName }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), + ...(input.ModelVersion !== undefined && input.ModelVersion !== null && { ModelVersion: input.ModelVersion }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { + OutputConfig: serializeAws_json1_1EdgeOutputConfig(input.OutputConfig, context), + }), + ...(input.ResourceKey !== undefined && input.ResourceKey !== null && { ResourceKey: input.ResourceKey }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17553,32 +17533,37 @@ const serializeAws_json1_1CreateEndpointConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.DataCaptureConfig !== undefined && { - DataCaptureConfig: serializeAws_json1_1DataCaptureConfig(input.DataCaptureConfig, context), - }), - ...(input.EndpointConfigName !== undefined && { EndpointConfigName: input.EndpointConfigName }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.ProductionVariants !== undefined && { - ProductionVariants: serializeAws_json1_1ProductionVariantList(input.ProductionVariants, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.DataCaptureConfig !== undefined && + input.DataCaptureConfig !== null && { + DataCaptureConfig: serializeAws_json1_1DataCaptureConfig(input.DataCaptureConfig, context), + }), + ...(input.EndpointConfigName !== undefined && + input.EndpointConfigName !== null && { EndpointConfigName: input.EndpointConfigName }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.ProductionVariants !== undefined && + input.ProductionVariants !== null && { + ProductionVariants: serializeAws_json1_1ProductionVariantList(input.ProductionVariants, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateEndpointInput = (input: CreateEndpointInput, context: __SerdeContext): any => { return { - ...(input.EndpointConfigName !== undefined && { EndpointConfigName: input.EndpointConfigName }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.EndpointConfigName !== undefined && + input.EndpointConfigName !== null && { EndpointConfigName: input.EndpointConfigName }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateExperimentRequest = (input: CreateExperimentRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.ExperimentName !== undefined && { ExperimentName: input.ExperimentName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.ExperimentName !== undefined && + input.ExperimentName !== null && { ExperimentName: input.ExperimentName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17587,23 +17572,27 @@ const serializeAws_json1_1CreateFeatureGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EventTimeFeatureName !== undefined && { EventTimeFeatureName: input.EventTimeFeatureName }), - ...(input.FeatureDefinitions !== undefined && { - FeatureDefinitions: serializeAws_json1_1FeatureDefinitions(input.FeatureDefinitions, context), - }), - ...(input.FeatureGroupName !== undefined && { FeatureGroupName: input.FeatureGroupName }), - ...(input.OfflineStoreConfig !== undefined && { - OfflineStoreConfig: serializeAws_json1_1OfflineStoreConfig(input.OfflineStoreConfig, context), - }), - ...(input.OnlineStoreConfig !== undefined && { - OnlineStoreConfig: serializeAws_json1_1OnlineStoreConfig(input.OnlineStoreConfig, context), - }), - ...(input.RecordIdentifierFeatureName !== undefined && { - RecordIdentifierFeatureName: input.RecordIdentifierFeatureName, - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EventTimeFeatureName !== undefined && + input.EventTimeFeatureName !== null && { EventTimeFeatureName: input.EventTimeFeatureName }), + ...(input.FeatureDefinitions !== undefined && + input.FeatureDefinitions !== null && { + FeatureDefinitions: serializeAws_json1_1FeatureDefinitions(input.FeatureDefinitions, context), + }), + ...(input.FeatureGroupName !== undefined && + input.FeatureGroupName !== null && { FeatureGroupName: input.FeatureGroupName }), + ...(input.OfflineStoreConfig !== undefined && + input.OfflineStoreConfig !== null && { + OfflineStoreConfig: serializeAws_json1_1OfflineStoreConfig(input.OfflineStoreConfig, context), + }), + ...(input.OnlineStoreConfig !== undefined && + input.OnlineStoreConfig !== null && { + OnlineStoreConfig: serializeAws_json1_1OnlineStoreConfig(input.OnlineStoreConfig, context), + }), + ...(input.RecordIdentifierFeatureName !== undefined && + input.RecordIdentifierFeatureName !== null && { RecordIdentifierFeatureName: input.RecordIdentifierFeatureName }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17612,24 +17601,29 @@ const serializeAws_json1_1CreateFlowDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.FlowDefinitionName !== undefined && { FlowDefinitionName: input.FlowDefinitionName }), - ...(input.HumanLoopActivationConfig !== undefined && { - HumanLoopActivationConfig: serializeAws_json1_1HumanLoopActivationConfig( - input.HumanLoopActivationConfig, - context - ), - }), - ...(input.HumanLoopConfig !== undefined && { - HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context), - }), - ...(input.HumanLoopRequestSource !== undefined && { - HumanLoopRequestSource: serializeAws_json1_1HumanLoopRequestSource(input.HumanLoopRequestSource, context), - }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_json1_1FlowDefinitionOutputConfig(input.OutputConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.FlowDefinitionName !== undefined && + input.FlowDefinitionName !== null && { FlowDefinitionName: input.FlowDefinitionName }), + ...(input.HumanLoopActivationConfig !== undefined && + input.HumanLoopActivationConfig !== null && { + HumanLoopActivationConfig: serializeAws_json1_1HumanLoopActivationConfig( + input.HumanLoopActivationConfig, + context + ), + }), + ...(input.HumanLoopConfig !== undefined && + input.HumanLoopConfig !== null && { + HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context), + }), + ...(input.HumanLoopRequestSource !== undefined && + input.HumanLoopRequestSource !== null && { + HumanLoopRequestSource: serializeAws_json1_1HumanLoopRequestSource(input.HumanLoopRequestSource, context), + }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { + OutputConfig: serializeAws_json1_1FlowDefinitionOutputConfig(input.OutputConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17638,9 +17632,11 @@ const serializeAws_json1_1CreateHumanTaskUiRequest = ( context: __SerdeContext ): any => { return { - ...(input.HumanTaskUiName !== undefined && { HumanTaskUiName: input.HumanTaskUiName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.UiTemplate !== undefined && { UiTemplate: serializeAws_json1_1UiTemplate(input.UiTemplate, context) }), + ...(input.HumanTaskUiName !== undefined && + input.HumanTaskUiName !== null && { HumanTaskUiName: input.HumanTaskUiName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.UiTemplate !== undefined && + input.UiTemplate !== null && { UiTemplate: serializeAws_json1_1UiTemplate(input.UiTemplate, context) }), }; }; @@ -17649,41 +17645,44 @@ const serializeAws_json1_1CreateHyperParameterTuningJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.HyperParameterTuningJobConfig !== undefined && { - HyperParameterTuningJobConfig: serializeAws_json1_1HyperParameterTuningJobConfig( - input.HyperParameterTuningJobConfig, - context - ), - }), - ...(input.HyperParameterTuningJobName !== undefined && { - HyperParameterTuningJobName: input.HyperParameterTuningJobName, - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TrainingJobDefinition !== undefined && { - TrainingJobDefinition: serializeAws_json1_1HyperParameterTrainingJobDefinition( - input.TrainingJobDefinition, - context - ), - }), - ...(input.TrainingJobDefinitions !== undefined && { - TrainingJobDefinitions: serializeAws_json1_1HyperParameterTrainingJobDefinitions( - input.TrainingJobDefinitions, - context - ), - }), - ...(input.WarmStartConfig !== undefined && { - WarmStartConfig: serializeAws_json1_1HyperParameterTuningJobWarmStartConfig(input.WarmStartConfig, context), - }), + ...(input.HyperParameterTuningJobConfig !== undefined && + input.HyperParameterTuningJobConfig !== null && { + HyperParameterTuningJobConfig: serializeAws_json1_1HyperParameterTuningJobConfig( + input.HyperParameterTuningJobConfig, + context + ), + }), + ...(input.HyperParameterTuningJobName !== undefined && + input.HyperParameterTuningJobName !== null && { HyperParameterTuningJobName: input.HyperParameterTuningJobName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TrainingJobDefinition !== undefined && + input.TrainingJobDefinition !== null && { + TrainingJobDefinition: serializeAws_json1_1HyperParameterTrainingJobDefinition( + input.TrainingJobDefinition, + context + ), + }), + ...(input.TrainingJobDefinitions !== undefined && + input.TrainingJobDefinitions !== null && { + TrainingJobDefinitions: serializeAws_json1_1HyperParameterTrainingJobDefinitions( + input.TrainingJobDefinitions, + context + ), + }), + ...(input.WarmStartConfig !== undefined && + input.WarmStartConfig !== null && { + WarmStartConfig: serializeAws_json1_1HyperParameterTuningJobWarmStartConfig(input.WarmStartConfig, context), + }), }; }; const serializeAws_json1_1CreateImageRequest = (input: CreateImageRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17692,9 +17691,9 @@ const serializeAws_json1_1CreateImageVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.BaseImage !== undefined && { BaseImage: input.BaseImage }), + ...(input.BaseImage !== undefined && input.BaseImage !== null && { BaseImage: input.BaseImage }), ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), }; }; @@ -17703,29 +17702,37 @@ const serializeAws_json1_1CreateLabelingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.HumanTaskConfig !== undefined && { - HumanTaskConfig: serializeAws_json1_1HumanTaskConfig(input.HumanTaskConfig, context), - }), - ...(input.InputConfig !== undefined && { - InputConfig: serializeAws_json1_1LabelingJobInputConfig(input.InputConfig, context), - }), - ...(input.LabelAttributeName !== undefined && { LabelAttributeName: input.LabelAttributeName }), - ...(input.LabelCategoryConfigS3Uri !== undefined && { LabelCategoryConfigS3Uri: input.LabelCategoryConfigS3Uri }), - ...(input.LabelingJobAlgorithmsConfig !== undefined && { - LabelingJobAlgorithmsConfig: serializeAws_json1_1LabelingJobAlgorithmsConfig( - input.LabelingJobAlgorithmsConfig, - context - ), - }), - ...(input.LabelingJobName !== undefined && { LabelingJobName: input.LabelingJobName }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_json1_1LabelingJobOutputConfig(input.OutputConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StoppingConditions !== undefined && { - StoppingConditions: serializeAws_json1_1LabelingJobStoppingConditions(input.StoppingConditions, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.HumanTaskConfig !== undefined && + input.HumanTaskConfig !== null && { + HumanTaskConfig: serializeAws_json1_1HumanTaskConfig(input.HumanTaskConfig, context), + }), + ...(input.InputConfig !== undefined && + input.InputConfig !== null && { + InputConfig: serializeAws_json1_1LabelingJobInputConfig(input.InputConfig, context), + }), + ...(input.LabelAttributeName !== undefined && + input.LabelAttributeName !== null && { LabelAttributeName: input.LabelAttributeName }), + ...(input.LabelCategoryConfigS3Uri !== undefined && + input.LabelCategoryConfigS3Uri !== null && { LabelCategoryConfigS3Uri: input.LabelCategoryConfigS3Uri }), + ...(input.LabelingJobAlgorithmsConfig !== undefined && + input.LabelingJobAlgorithmsConfig !== null && { + LabelingJobAlgorithmsConfig: serializeAws_json1_1LabelingJobAlgorithmsConfig( + input.LabelingJobAlgorithmsConfig, + context + ), + }), + ...(input.LabelingJobName !== undefined && + input.LabelingJobName !== null && { LabelingJobName: input.LabelingJobName }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { + OutputConfig: serializeAws_json1_1LabelingJobOutputConfig(input.OutputConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StoppingConditions !== undefined && + input.StoppingConditions !== null && { + StoppingConditions: serializeAws_json1_1LabelingJobStoppingConditions(input.StoppingConditions, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17734,33 +17741,41 @@ const serializeAws_json1_1CreateModelBiasJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), - ...(input.JobResources !== undefined && { - JobResources: serializeAws_json1_1MonitoringResources(input.JobResources, context), - }), - ...(input.ModelBiasAppSpecification !== undefined && { - ModelBiasAppSpecification: serializeAws_json1_1ModelBiasAppSpecification( - input.ModelBiasAppSpecification, - context - ), - }), - ...(input.ModelBiasBaselineConfig !== undefined && { - ModelBiasBaselineConfig: serializeAws_json1_1ModelBiasBaselineConfig(input.ModelBiasBaselineConfig, context), - }), - ...(input.ModelBiasJobInput !== undefined && { - ModelBiasJobInput: serializeAws_json1_1ModelBiasJobInput(input.ModelBiasJobInput, context), - }), - ...(input.ModelBiasJobOutputConfig !== undefined && { - ModelBiasJobOutputConfig: serializeAws_json1_1MonitoringOutputConfig(input.ModelBiasJobOutputConfig, context), - }), - ...(input.NetworkConfig !== undefined && { - NetworkConfig: serializeAws_json1_1MonitoringNetworkConfig(input.NetworkConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobResources !== undefined && + input.JobResources !== null && { + JobResources: serializeAws_json1_1MonitoringResources(input.JobResources, context), + }), + ...(input.ModelBiasAppSpecification !== undefined && + input.ModelBiasAppSpecification !== null && { + ModelBiasAppSpecification: serializeAws_json1_1ModelBiasAppSpecification( + input.ModelBiasAppSpecification, + context + ), + }), + ...(input.ModelBiasBaselineConfig !== undefined && + input.ModelBiasBaselineConfig !== null && { + ModelBiasBaselineConfig: serializeAws_json1_1ModelBiasBaselineConfig(input.ModelBiasBaselineConfig, context), + }), + ...(input.ModelBiasJobInput !== undefined && + input.ModelBiasJobInput !== null && { + ModelBiasJobInput: serializeAws_json1_1ModelBiasJobInput(input.ModelBiasJobInput, context), + }), + ...(input.ModelBiasJobOutputConfig !== undefined && + input.ModelBiasJobOutputConfig !== null && { + ModelBiasJobOutputConfig: serializeAws_json1_1MonitoringOutputConfig(input.ModelBiasJobOutputConfig, context), + }), + ...(input.NetworkConfig !== undefined && + input.NetworkConfig !== null && { + NetworkConfig: serializeAws_json1_1MonitoringNetworkConfig(input.NetworkConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17769,58 +17784,71 @@ const serializeAws_json1_1CreateModelExplainabilityJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), - ...(input.JobResources !== undefined && { - JobResources: serializeAws_json1_1MonitoringResources(input.JobResources, context), - }), - ...(input.ModelExplainabilityAppSpecification !== undefined && { - ModelExplainabilityAppSpecification: serializeAws_json1_1ModelExplainabilityAppSpecification( - input.ModelExplainabilityAppSpecification, - context - ), - }), - ...(input.ModelExplainabilityBaselineConfig !== undefined && { - ModelExplainabilityBaselineConfig: serializeAws_json1_1ModelExplainabilityBaselineConfig( - input.ModelExplainabilityBaselineConfig, - context - ), - }), - ...(input.ModelExplainabilityJobInput !== undefined && { - ModelExplainabilityJobInput: serializeAws_json1_1ModelExplainabilityJobInput( - input.ModelExplainabilityJobInput, - context - ), - }), - ...(input.ModelExplainabilityJobOutputConfig !== undefined && { - ModelExplainabilityJobOutputConfig: serializeAws_json1_1MonitoringOutputConfig( - input.ModelExplainabilityJobOutputConfig, - context - ), - }), - ...(input.NetworkConfig !== undefined && { - NetworkConfig: serializeAws_json1_1MonitoringNetworkConfig(input.NetworkConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobResources !== undefined && + input.JobResources !== null && { + JobResources: serializeAws_json1_1MonitoringResources(input.JobResources, context), + }), + ...(input.ModelExplainabilityAppSpecification !== undefined && + input.ModelExplainabilityAppSpecification !== null && { + ModelExplainabilityAppSpecification: serializeAws_json1_1ModelExplainabilityAppSpecification( + input.ModelExplainabilityAppSpecification, + context + ), + }), + ...(input.ModelExplainabilityBaselineConfig !== undefined && + input.ModelExplainabilityBaselineConfig !== null && { + ModelExplainabilityBaselineConfig: serializeAws_json1_1ModelExplainabilityBaselineConfig( + input.ModelExplainabilityBaselineConfig, + context + ), + }), + ...(input.ModelExplainabilityJobInput !== undefined && + input.ModelExplainabilityJobInput !== null && { + ModelExplainabilityJobInput: serializeAws_json1_1ModelExplainabilityJobInput( + input.ModelExplainabilityJobInput, + context + ), + }), + ...(input.ModelExplainabilityJobOutputConfig !== undefined && + input.ModelExplainabilityJobOutputConfig !== null && { + ModelExplainabilityJobOutputConfig: serializeAws_json1_1MonitoringOutputConfig( + input.ModelExplainabilityJobOutputConfig, + context + ), + }), + ...(input.NetworkConfig !== undefined && + input.NetworkConfig !== null && { + NetworkConfig: serializeAws_json1_1MonitoringNetworkConfig(input.NetworkConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateModelInput = (input: CreateModelInput, context: __SerdeContext): any => { return { - ...(input.Containers !== undefined && { - Containers: serializeAws_json1_1ContainerDefinitionList(input.Containers, context), - }), - ...(input.EnableNetworkIsolation !== undefined && { EnableNetworkIsolation: input.EnableNetworkIsolation }), - ...(input.ExecutionRoleArn !== undefined && { ExecutionRoleArn: input.ExecutionRoleArn }), - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), - ...(input.PrimaryContainer !== undefined && { - PrimaryContainer: serializeAws_json1_1ContainerDefinition(input.PrimaryContainer, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.Containers !== undefined && + input.Containers !== null && { + Containers: serializeAws_json1_1ContainerDefinitionList(input.Containers, context), + }), + ...(input.EnableNetworkIsolation !== undefined && + input.EnableNetworkIsolation !== null && { EnableNetworkIsolation: input.EnableNetworkIsolation }), + ...(input.ExecutionRoleArn !== undefined && + input.ExecutionRoleArn !== null && { ExecutionRoleArn: input.ExecutionRoleArn }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), + ...(input.PrimaryContainer !== undefined && + input.PrimaryContainer !== null && { + PrimaryContainer: serializeAws_json1_1ContainerDefinition(input.PrimaryContainer, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -17829,44 +17857,54 @@ const serializeAws_json1_1CreateModelPackageGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.ModelPackageGroupDescription !== undefined && { - ModelPackageGroupDescription: input.ModelPackageGroupDescription, - }), - ...(input.ModelPackageGroupName !== undefined && { ModelPackageGroupName: input.ModelPackageGroupName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ModelPackageGroupDescription !== undefined && + input.ModelPackageGroupDescription !== null && { + ModelPackageGroupDescription: input.ModelPackageGroupDescription, + }), + ...(input.ModelPackageGroupName !== undefined && + input.ModelPackageGroupName !== null && { ModelPackageGroupName: input.ModelPackageGroupName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateModelPackageInput = (input: CreateModelPackageInput, context: __SerdeContext): any => { return { - ...(input.CertifyForMarketplace !== undefined && { CertifyForMarketplace: input.CertifyForMarketplace }), + ...(input.CertifyForMarketplace !== undefined && + input.CertifyForMarketplace !== null && { CertifyForMarketplace: input.CertifyForMarketplace }), ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.InferenceSpecification !== undefined && { - InferenceSpecification: serializeAws_json1_1InferenceSpecification(input.InferenceSpecification, context), - }), - ...(input.MetadataProperties !== undefined && { - MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), - }), - ...(input.ModelApprovalStatus !== undefined && { ModelApprovalStatus: input.ModelApprovalStatus }), - ...(input.ModelMetrics !== undefined && { - ModelMetrics: serializeAws_json1_1ModelMetrics(input.ModelMetrics, context), - }), - ...(input.ModelPackageDescription !== undefined && { ModelPackageDescription: input.ModelPackageDescription }), - ...(input.ModelPackageGroupName !== undefined && { ModelPackageGroupName: input.ModelPackageGroupName }), - ...(input.ModelPackageName !== undefined && { ModelPackageName: input.ModelPackageName }), - ...(input.SourceAlgorithmSpecification !== undefined && { - SourceAlgorithmSpecification: serializeAws_json1_1SourceAlgorithmSpecification( - input.SourceAlgorithmSpecification, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.ValidationSpecification !== undefined && { - ValidationSpecification: serializeAws_json1_1ModelPackageValidationSpecification( - input.ValidationSpecification, - context - ), - }), + ...(input.InferenceSpecification !== undefined && + input.InferenceSpecification !== null && { + InferenceSpecification: serializeAws_json1_1InferenceSpecification(input.InferenceSpecification, context), + }), + ...(input.MetadataProperties !== undefined && + input.MetadataProperties !== null && { + MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), + }), + ...(input.ModelApprovalStatus !== undefined && + input.ModelApprovalStatus !== null && { ModelApprovalStatus: input.ModelApprovalStatus }), + ...(input.ModelMetrics !== undefined && + input.ModelMetrics !== null && { ModelMetrics: serializeAws_json1_1ModelMetrics(input.ModelMetrics, context) }), + ...(input.ModelPackageDescription !== undefined && + input.ModelPackageDescription !== null && { ModelPackageDescription: input.ModelPackageDescription }), + ...(input.ModelPackageGroupName !== undefined && + input.ModelPackageGroupName !== null && { ModelPackageGroupName: input.ModelPackageGroupName }), + ...(input.ModelPackageName !== undefined && + input.ModelPackageName !== null && { ModelPackageName: input.ModelPackageName }), + ...(input.SourceAlgorithmSpecification !== undefined && + input.SourceAlgorithmSpecification !== null && { + SourceAlgorithmSpecification: serializeAws_json1_1SourceAlgorithmSpecification( + input.SourceAlgorithmSpecification, + context + ), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ValidationSpecification !== undefined && + input.ValidationSpecification !== null && { + ValidationSpecification: serializeAws_json1_1ModelPackageValidationSpecification( + input.ValidationSpecification, + context + ), + }), }; }; @@ -17875,39 +17913,47 @@ const serializeAws_json1_1CreateModelQualityJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), - ...(input.JobResources !== undefined && { - JobResources: serializeAws_json1_1MonitoringResources(input.JobResources, context), - }), - ...(input.ModelQualityAppSpecification !== undefined && { - ModelQualityAppSpecification: serializeAws_json1_1ModelQualityAppSpecification( - input.ModelQualityAppSpecification, - context - ), - }), - ...(input.ModelQualityBaselineConfig !== undefined && { - ModelQualityBaselineConfig: serializeAws_json1_1ModelQualityBaselineConfig( - input.ModelQualityBaselineConfig, - context - ), - }), - ...(input.ModelQualityJobInput !== undefined && { - ModelQualityJobInput: serializeAws_json1_1ModelQualityJobInput(input.ModelQualityJobInput, context), - }), - ...(input.ModelQualityJobOutputConfig !== undefined && { - ModelQualityJobOutputConfig: serializeAws_json1_1MonitoringOutputConfig( - input.ModelQualityJobOutputConfig, - context - ), - }), - ...(input.NetworkConfig !== undefined && { - NetworkConfig: serializeAws_json1_1MonitoringNetworkConfig(input.NetworkConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobResources !== undefined && + input.JobResources !== null && { + JobResources: serializeAws_json1_1MonitoringResources(input.JobResources, context), + }), + ...(input.ModelQualityAppSpecification !== undefined && + input.ModelQualityAppSpecification !== null && { + ModelQualityAppSpecification: serializeAws_json1_1ModelQualityAppSpecification( + input.ModelQualityAppSpecification, + context + ), + }), + ...(input.ModelQualityBaselineConfig !== undefined && + input.ModelQualityBaselineConfig !== null && { + ModelQualityBaselineConfig: serializeAws_json1_1ModelQualityBaselineConfig( + input.ModelQualityBaselineConfig, + context + ), + }), + ...(input.ModelQualityJobInput !== undefined && + input.ModelQualityJobInput !== null && { + ModelQualityJobInput: serializeAws_json1_1ModelQualityJobInput(input.ModelQualityJobInput, context), + }), + ...(input.ModelQualityJobOutputConfig !== undefined && + input.ModelQualityJobOutputConfig !== null && { + ModelQualityJobOutputConfig: serializeAws_json1_1MonitoringOutputConfig( + input.ModelQualityJobOutputConfig, + context + ), + }), + ...(input.NetworkConfig !== undefined && + input.NetworkConfig !== null && { + NetworkConfig: serializeAws_json1_1MonitoringNetworkConfig(input.NetworkConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17916,11 +17962,13 @@ const serializeAws_json1_1CreateMonitoringScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.MonitoringScheduleConfig !== undefined && { - MonitoringScheduleConfig: serializeAws_json1_1MonitoringScheduleConfig(input.MonitoringScheduleConfig, context), - }), - ...(input.MonitoringScheduleName !== undefined && { MonitoringScheduleName: input.MonitoringScheduleName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.MonitoringScheduleConfig !== undefined && + input.MonitoringScheduleConfig !== null && { + MonitoringScheduleConfig: serializeAws_json1_1MonitoringScheduleConfig(input.MonitoringScheduleConfig, context), + }), + ...(input.MonitoringScheduleName !== undefined && + input.MonitoringScheduleName !== null && { MonitoringScheduleName: input.MonitoringScheduleName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17929,29 +17977,37 @@ const serializeAws_json1_1CreateNotebookInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorTypes !== undefined && { - AcceleratorTypes: serializeAws_json1_1NotebookInstanceAcceleratorTypes(input.AcceleratorTypes, context), - }), - ...(input.AdditionalCodeRepositories !== undefined && { - AdditionalCodeRepositories: serializeAws_json1_1AdditionalCodeRepositoryNamesOrUrls( - input.AdditionalCodeRepositories, - context - ), - }), - ...(input.DefaultCodeRepository !== undefined && { DefaultCodeRepository: input.DefaultCodeRepository }), - ...(input.DirectInternetAccess !== undefined && { DirectInternetAccess: input.DirectInternetAccess }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.LifecycleConfigName !== undefined && { LifecycleConfigName: input.LifecycleConfigName }), - ...(input.NotebookInstanceName !== undefined && { NotebookInstanceName: input.NotebookInstanceName }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.RootAccess !== undefined && { RootAccess: input.RootAccess }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VolumeSizeInGB !== undefined && { VolumeSizeInGB: input.VolumeSizeInGB }), + ...(input.AcceleratorTypes !== undefined && + input.AcceleratorTypes !== null && { + AcceleratorTypes: serializeAws_json1_1NotebookInstanceAcceleratorTypes(input.AcceleratorTypes, context), + }), + ...(input.AdditionalCodeRepositories !== undefined && + input.AdditionalCodeRepositories !== null && { + AdditionalCodeRepositories: serializeAws_json1_1AdditionalCodeRepositoryNamesOrUrls( + input.AdditionalCodeRepositories, + context + ), + }), + ...(input.DefaultCodeRepository !== undefined && + input.DefaultCodeRepository !== null && { DefaultCodeRepository: input.DefaultCodeRepository }), + ...(input.DirectInternetAccess !== undefined && + input.DirectInternetAccess !== null && { DirectInternetAccess: input.DirectInternetAccess }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.LifecycleConfigName !== undefined && + input.LifecycleConfigName !== null && { LifecycleConfigName: input.LifecycleConfigName }), + ...(input.NotebookInstanceName !== undefined && + input.NotebookInstanceName !== null && { NotebookInstanceName: input.NotebookInstanceName }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.RootAccess !== undefined && input.RootAccess !== null && { RootAccess: input.RootAccess }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VolumeSizeInGB !== undefined && + input.VolumeSizeInGB !== null && { VolumeSizeInGB: input.VolumeSizeInGB }), }; }; @@ -17960,27 +18016,33 @@ const serializeAws_json1_1CreateNotebookInstanceLifecycleConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookInstanceLifecycleConfigName !== undefined && { - NotebookInstanceLifecycleConfigName: input.NotebookInstanceLifecycleConfigName, - }), - ...(input.OnCreate !== undefined && { - OnCreate: serializeAws_json1_1NotebookInstanceLifecycleConfigList(input.OnCreate, context), - }), - ...(input.OnStart !== undefined && { - OnStart: serializeAws_json1_1NotebookInstanceLifecycleConfigList(input.OnStart, context), - }), + ...(input.NotebookInstanceLifecycleConfigName !== undefined && + input.NotebookInstanceLifecycleConfigName !== null && { + NotebookInstanceLifecycleConfigName: input.NotebookInstanceLifecycleConfigName, + }), + ...(input.OnCreate !== undefined && + input.OnCreate !== null && { + OnCreate: serializeAws_json1_1NotebookInstanceLifecycleConfigList(input.OnCreate, context), + }), + ...(input.OnStart !== undefined && + input.OnStart !== null && { + OnStart: serializeAws_json1_1NotebookInstanceLifecycleConfigList(input.OnStart, context), + }), }; }; const serializeAws_json1_1CreatePipelineRequest = (input: CreatePipelineRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.PipelineDefinition !== undefined && { PipelineDefinition: input.PipelineDefinition }), - ...(input.PipelineDescription !== undefined && { PipelineDescription: input.PipelineDescription }), - ...(input.PipelineDisplayName !== undefined && { PipelineDisplayName: input.PipelineDisplayName }), - ...(input.PipelineName !== undefined && { PipelineName: input.PipelineName }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.PipelineDefinition !== undefined && + input.PipelineDefinition !== null && { PipelineDefinition: input.PipelineDefinition }), + ...(input.PipelineDescription !== undefined && + input.PipelineDescription !== null && { PipelineDescription: input.PipelineDescription }), + ...(input.PipelineDisplayName !== undefined && + input.PipelineDisplayName !== null && { PipelineDisplayName: input.PipelineDisplayName }), + ...(input.PipelineName !== undefined && input.PipelineName !== null && { PipelineName: input.PipelineName }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -17989,11 +18051,13 @@ const serializeAws_json1_1CreatePresignedDomainUrlRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.SessionExpirationDurationInSeconds !== undefined && { - SessionExpirationDurationInSeconds: input.SessionExpirationDurationInSeconds, - }), - ...(input.UserProfileName !== undefined && { UserProfileName: input.UserProfileName }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.SessionExpirationDurationInSeconds !== undefined && + input.SessionExpirationDurationInSeconds !== null && { + SessionExpirationDurationInSeconds: input.SessionExpirationDurationInSeconds, + }), + ...(input.UserProfileName !== undefined && + input.UserProfileName !== null && { UserProfileName: input.UserProfileName }), }; }; @@ -18002,10 +18066,12 @@ const serializeAws_json1_1CreatePresignedNotebookInstanceUrlInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookInstanceName !== undefined && { NotebookInstanceName: input.NotebookInstanceName }), - ...(input.SessionExpirationDurationInSeconds !== undefined && { - SessionExpirationDurationInSeconds: input.SessionExpirationDurationInSeconds, - }), + ...(input.NotebookInstanceName !== undefined && + input.NotebookInstanceName !== null && { NotebookInstanceName: input.NotebookInstanceName }), + ...(input.SessionExpirationDurationInSeconds !== undefined && + input.SessionExpirationDurationInSeconds !== null && { + SessionExpirationDurationInSeconds: input.SessionExpirationDurationInSeconds, + }), }; }; @@ -18014,47 +18080,58 @@ const serializeAws_json1_1CreateProcessingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.AppSpecification !== undefined && { - AppSpecification: serializeAws_json1_1AppSpecification(input.AppSpecification, context), - }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1ProcessingEnvironmentMap(input.Environment, context), - }), - ...(input.ExperimentConfig !== undefined && { - ExperimentConfig: serializeAws_json1_1ExperimentConfig(input.ExperimentConfig, context), - }), - ...(input.NetworkConfig !== undefined && { - NetworkConfig: serializeAws_json1_1NetworkConfig(input.NetworkConfig, context), - }), - ...(input.ProcessingInputs !== undefined && { - ProcessingInputs: serializeAws_json1_1ProcessingInputs(input.ProcessingInputs, context), - }), - ...(input.ProcessingJobName !== undefined && { ProcessingJobName: input.ProcessingJobName }), - ...(input.ProcessingOutputConfig !== undefined && { - ProcessingOutputConfig: serializeAws_json1_1ProcessingOutputConfig(input.ProcessingOutputConfig, context), - }), - ...(input.ProcessingResources !== undefined && { - ProcessingResources: serializeAws_json1_1ProcessingResources(input.ProcessingResources, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1ProcessingStoppingCondition(input.StoppingCondition, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.AppSpecification !== undefined && + input.AppSpecification !== null && { + AppSpecification: serializeAws_json1_1AppSpecification(input.AppSpecification, context), + }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1ProcessingEnvironmentMap(input.Environment, context), + }), + ...(input.ExperimentConfig !== undefined && + input.ExperimentConfig !== null && { + ExperimentConfig: serializeAws_json1_1ExperimentConfig(input.ExperimentConfig, context), + }), + ...(input.NetworkConfig !== undefined && + input.NetworkConfig !== null && { + NetworkConfig: serializeAws_json1_1NetworkConfig(input.NetworkConfig, context), + }), + ...(input.ProcessingInputs !== undefined && + input.ProcessingInputs !== null && { + ProcessingInputs: serializeAws_json1_1ProcessingInputs(input.ProcessingInputs, context), + }), + ...(input.ProcessingJobName !== undefined && + input.ProcessingJobName !== null && { ProcessingJobName: input.ProcessingJobName }), + ...(input.ProcessingOutputConfig !== undefined && + input.ProcessingOutputConfig !== null && { + ProcessingOutputConfig: serializeAws_json1_1ProcessingOutputConfig(input.ProcessingOutputConfig, context), + }), + ...(input.ProcessingResources !== undefined && + input.ProcessingResources !== null && { + ProcessingResources: serializeAws_json1_1ProcessingResources(input.ProcessingResources, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1ProcessingStoppingCondition(input.StoppingCondition, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateProjectInput = (input: CreateProjectInput, context: __SerdeContext): any => { return { - ...(input.ProjectDescription !== undefined && { ProjectDescription: input.ProjectDescription }), - ...(input.ProjectName !== undefined && { ProjectName: input.ProjectName }), - ...(input.ServiceCatalogProvisioningDetails !== undefined && { - ServiceCatalogProvisioningDetails: serializeAws_json1_1ServiceCatalogProvisioningDetails( - input.ServiceCatalogProvisioningDetails, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ProjectDescription !== undefined && + input.ProjectDescription !== null && { ProjectDescription: input.ProjectDescription }), + ...(input.ProjectName !== undefined && input.ProjectName !== null && { ProjectName: input.ProjectName }), + ...(input.ServiceCatalogProvisioningDetails !== undefined && + input.ServiceCatalogProvisioningDetails !== null && { + ServiceCatalogProvisioningDetails: serializeAws_json1_1ServiceCatalogProvisioningDetails( + input.ServiceCatalogProvisioningDetails, + context + ), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -18063,59 +18140,75 @@ const serializeAws_json1_1CreateTrainingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.AlgorithmSpecification !== undefined && { - AlgorithmSpecification: serializeAws_json1_1AlgorithmSpecification(input.AlgorithmSpecification, context), - }), - ...(input.CheckpointConfig !== undefined && { - CheckpointConfig: serializeAws_json1_1CheckpointConfig(input.CheckpointConfig, context), - }), - ...(input.DebugHookConfig !== undefined && { - DebugHookConfig: serializeAws_json1_1DebugHookConfig(input.DebugHookConfig, context), - }), - ...(input.DebugRuleConfigurations !== undefined && { - DebugRuleConfigurations: serializeAws_json1_1DebugRuleConfigurations(input.DebugRuleConfigurations, context), - }), - ...(input.EnableInterContainerTrafficEncryption !== undefined && { - EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, - }), - ...(input.EnableManagedSpotTraining !== undefined && { - EnableManagedSpotTraining: input.EnableManagedSpotTraining, - }), - ...(input.EnableNetworkIsolation !== undefined && { EnableNetworkIsolation: input.EnableNetworkIsolation }), - ...(input.ExperimentConfig !== undefined && { - ExperimentConfig: serializeAws_json1_1ExperimentConfig(input.ExperimentConfig, context), - }), - ...(input.HyperParameters !== undefined && { - HyperParameters: serializeAws_json1_1HyperParameters(input.HyperParameters, context), - }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.ProfilerConfig !== undefined && { - ProfilerConfig: serializeAws_json1_1ProfilerConfig(input.ProfilerConfig, context), - }), - ...(input.ProfilerRuleConfigurations !== undefined && { - ProfilerRuleConfigurations: serializeAws_json1_1ProfilerRuleConfigurations( - input.ProfilerRuleConfigurations, - context - ), - }), - ...(input.ResourceConfig !== undefined && { - ResourceConfig: serializeAws_json1_1ResourceConfig(input.ResourceConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1StoppingCondition(input.StoppingCondition, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TensorBoardOutputConfig !== undefined && { - TensorBoardOutputConfig: serializeAws_json1_1TensorBoardOutputConfig(input.TensorBoardOutputConfig, context), - }), - ...(input.TrainingJobName !== undefined && { TrainingJobName: input.TrainingJobName }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.AlgorithmSpecification !== undefined && + input.AlgorithmSpecification !== null && { + AlgorithmSpecification: serializeAws_json1_1AlgorithmSpecification(input.AlgorithmSpecification, context), + }), + ...(input.CheckpointConfig !== undefined && + input.CheckpointConfig !== null && { + CheckpointConfig: serializeAws_json1_1CheckpointConfig(input.CheckpointConfig, context), + }), + ...(input.DebugHookConfig !== undefined && + input.DebugHookConfig !== null && { + DebugHookConfig: serializeAws_json1_1DebugHookConfig(input.DebugHookConfig, context), + }), + ...(input.DebugRuleConfigurations !== undefined && + input.DebugRuleConfigurations !== null && { + DebugRuleConfigurations: serializeAws_json1_1DebugRuleConfigurations(input.DebugRuleConfigurations, context), + }), + ...(input.EnableInterContainerTrafficEncryption !== undefined && + input.EnableInterContainerTrafficEncryption !== null && { + EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, + }), + ...(input.EnableManagedSpotTraining !== undefined && + input.EnableManagedSpotTraining !== null && { EnableManagedSpotTraining: input.EnableManagedSpotTraining }), + ...(input.EnableNetworkIsolation !== undefined && + input.EnableNetworkIsolation !== null && { EnableNetworkIsolation: input.EnableNetworkIsolation }), + ...(input.ExperimentConfig !== undefined && + input.ExperimentConfig !== null && { + ExperimentConfig: serializeAws_json1_1ExperimentConfig(input.ExperimentConfig, context), + }), + ...(input.HyperParameters !== undefined && + input.HyperParameters !== null && { + HyperParameters: serializeAws_json1_1HyperParameters(input.HyperParameters, context), + }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.ProfilerConfig !== undefined && + input.ProfilerConfig !== null && { + ProfilerConfig: serializeAws_json1_1ProfilerConfig(input.ProfilerConfig, context), + }), + ...(input.ProfilerRuleConfigurations !== undefined && + input.ProfilerRuleConfigurations !== null && { + ProfilerRuleConfigurations: serializeAws_json1_1ProfilerRuleConfigurations( + input.ProfilerRuleConfigurations, + context + ), + }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + ResourceConfig: serializeAws_json1_1ResourceConfig(input.ResourceConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1StoppingCondition(input.StoppingCondition, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TensorBoardOutputConfig !== undefined && + input.TensorBoardOutputConfig !== null && { + TensorBoardOutputConfig: serializeAws_json1_1TensorBoardOutputConfig(input.TensorBoardOutputConfig, context), + }), + ...(input.TrainingJobName !== undefined && + input.TrainingJobName !== null && { TrainingJobName: input.TrainingJobName }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -18124,33 +18217,43 @@ const serializeAws_json1_1CreateTransformJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.BatchStrategy !== undefined && { BatchStrategy: input.BatchStrategy }), - ...(input.DataProcessing !== undefined && { - DataProcessing: serializeAws_json1_1DataProcessing(input.DataProcessing, context), - }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1TransformEnvironmentMap(input.Environment, context), - }), - ...(input.ExperimentConfig !== undefined && { - ExperimentConfig: serializeAws_json1_1ExperimentConfig(input.ExperimentConfig, context), - }), - ...(input.MaxConcurrentTransforms !== undefined && { MaxConcurrentTransforms: input.MaxConcurrentTransforms }), - ...(input.MaxPayloadInMB !== undefined && { MaxPayloadInMB: input.MaxPayloadInMB }), - ...(input.ModelClientConfig !== undefined && { - ModelClientConfig: serializeAws_json1_1ModelClientConfig(input.ModelClientConfig, context), - }), - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TransformInput !== undefined && { - TransformInput: serializeAws_json1_1TransformInput(input.TransformInput, context), - }), - ...(input.TransformJobName !== undefined && { TransformJobName: input.TransformJobName }), - ...(input.TransformOutput !== undefined && { - TransformOutput: serializeAws_json1_1TransformOutput(input.TransformOutput, context), - }), - ...(input.TransformResources !== undefined && { - TransformResources: serializeAws_json1_1TransformResources(input.TransformResources, context), - }), + ...(input.BatchStrategy !== undefined && input.BatchStrategy !== null && { BatchStrategy: input.BatchStrategy }), + ...(input.DataProcessing !== undefined && + input.DataProcessing !== null && { + DataProcessing: serializeAws_json1_1DataProcessing(input.DataProcessing, context), + }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1TransformEnvironmentMap(input.Environment, context), + }), + ...(input.ExperimentConfig !== undefined && + input.ExperimentConfig !== null && { + ExperimentConfig: serializeAws_json1_1ExperimentConfig(input.ExperimentConfig, context), + }), + ...(input.MaxConcurrentTransforms !== undefined && + input.MaxConcurrentTransforms !== null && { MaxConcurrentTransforms: input.MaxConcurrentTransforms }), + ...(input.MaxPayloadInMB !== undefined && + input.MaxPayloadInMB !== null && { MaxPayloadInMB: input.MaxPayloadInMB }), + ...(input.ModelClientConfig !== undefined && + input.ModelClientConfig !== null && { + ModelClientConfig: serializeAws_json1_1ModelClientConfig(input.ModelClientConfig, context), + }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TransformInput !== undefined && + input.TransformInput !== null && { + TransformInput: serializeAws_json1_1TransformInput(input.TransformInput, context), + }), + ...(input.TransformJobName !== undefined && + input.TransformJobName !== null && { TransformJobName: input.TransformJobName }), + ...(input.TransformOutput !== undefined && + input.TransformOutput !== null && { + TransformOutput: serializeAws_json1_1TransformOutput(input.TransformOutput, context), + }), + ...(input.TransformResources !== undefined && + input.TransformResources !== null && { + TransformResources: serializeAws_json1_1TransformResources(input.TransformResources, context), + }), }; }; @@ -18159,36 +18262,46 @@ const serializeAws_json1_1CreateTrialComponentRequest = ( context: __SerdeContext ): any => { return { - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.InputArtifacts !== undefined && { - InputArtifacts: serializeAws_json1_1TrialComponentArtifacts(input.InputArtifacts, context), - }), - ...(input.MetadataProperties !== undefined && { - MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), - }), - ...(input.OutputArtifacts !== undefined && { - OutputArtifacts: serializeAws_json1_1TrialComponentArtifacts(input.OutputArtifacts, context), - }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1TrialComponentParameters(input.Parameters, context), - }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), - ...(input.Status !== undefined && { Status: serializeAws_json1_1TrialComponentStatus(input.Status, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TrialComponentName !== undefined && { TrialComponentName: input.TrialComponentName }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.InputArtifacts !== undefined && + input.InputArtifacts !== null && { + InputArtifacts: serializeAws_json1_1TrialComponentArtifacts(input.InputArtifacts, context), + }), + ...(input.MetadataProperties !== undefined && + input.MetadataProperties !== null && { + MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), + }), + ...(input.OutputArtifacts !== undefined && + input.OutputArtifacts !== null && { + OutputArtifacts: serializeAws_json1_1TrialComponentArtifacts(input.OutputArtifacts, context), + }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_1TrialComponentParameters(input.Parameters, context), + }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.Status !== undefined && + input.Status !== null && { Status: serializeAws_json1_1TrialComponentStatus(input.Status, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TrialComponentName !== undefined && + input.TrialComponentName !== null && { TrialComponentName: input.TrialComponentName }), }; }; const serializeAws_json1_1CreateTrialRequest = (input: CreateTrialRequest, context: __SerdeContext): any => { return { - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.ExperimentName !== undefined && { ExperimentName: input.ExperimentName }), - ...(input.MetadataProperties !== undefined && { - MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TrialName !== undefined && { TrialName: input.TrialName }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.ExperimentName !== undefined && + input.ExperimentName !== null && { ExperimentName: input.ExperimentName }), + ...(input.MetadataProperties !== undefined && + input.MetadataProperties !== null && { + MetadataProperties: serializeAws_json1_1MetadataProperties(input.MetadataProperties, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TrialName !== undefined && input.TrialName !== null && { TrialName: input.TrialName }), }; }; @@ -18197,97 +18310,120 @@ const serializeAws_json1_1CreateUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.SingleSignOnUserIdentifier !== undefined && { - SingleSignOnUserIdentifier: input.SingleSignOnUserIdentifier, - }), - ...(input.SingleSignOnUserValue !== undefined && { SingleSignOnUserValue: input.SingleSignOnUserValue }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.UserProfileName !== undefined && { UserProfileName: input.UserProfileName }), - ...(input.UserSettings !== undefined && { - UserSettings: serializeAws_json1_1UserSettings(input.UserSettings, context), - }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.SingleSignOnUserIdentifier !== undefined && + input.SingleSignOnUserIdentifier !== null && { SingleSignOnUserIdentifier: input.SingleSignOnUserIdentifier }), + ...(input.SingleSignOnUserValue !== undefined && + input.SingleSignOnUserValue !== null && { SingleSignOnUserValue: input.SingleSignOnUserValue }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.UserProfileName !== undefined && + input.UserProfileName !== null && { UserProfileName: input.UserProfileName }), + ...(input.UserSettings !== undefined && + input.UserSettings !== null && { UserSettings: serializeAws_json1_1UserSettings(input.UserSettings, context) }), }; }; const serializeAws_json1_1CreateWorkforceRequest = (input: CreateWorkforceRequest, context: __SerdeContext): any => { return { - ...(input.CognitoConfig !== undefined && { - CognitoConfig: serializeAws_json1_1CognitoConfig(input.CognitoConfig, context), - }), - ...(input.OidcConfig !== undefined && { OidcConfig: serializeAws_json1_1OidcConfig(input.OidcConfig, context) }), - ...(input.SourceIpConfig !== undefined && { - SourceIpConfig: serializeAws_json1_1SourceIpConfig(input.SourceIpConfig, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.WorkforceName !== undefined && { WorkforceName: input.WorkforceName }), + ...(input.CognitoConfig !== undefined && + input.CognitoConfig !== null && { + CognitoConfig: serializeAws_json1_1CognitoConfig(input.CognitoConfig, context), + }), + ...(input.OidcConfig !== undefined && + input.OidcConfig !== null && { OidcConfig: serializeAws_json1_1OidcConfig(input.OidcConfig, context) }), + ...(input.SourceIpConfig !== undefined && + input.SourceIpConfig !== null && { + SourceIpConfig: serializeAws_json1_1SourceIpConfig(input.SourceIpConfig, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.WorkforceName !== undefined && input.WorkforceName !== null && { WorkforceName: input.WorkforceName }), }; }; const serializeAws_json1_1CreateWorkteamRequest = (input: CreateWorkteamRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.MemberDefinitions !== undefined && { - MemberDefinitions: serializeAws_json1_1MemberDefinitions(input.MemberDefinitions, context), - }), - ...(input.NotificationConfiguration !== undefined && { - NotificationConfiguration: serializeAws_json1_1NotificationConfiguration( - input.NotificationConfiguration, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.WorkforceName !== undefined && { WorkforceName: input.WorkforceName }), - ...(input.WorkteamName !== undefined && { WorkteamName: input.WorkteamName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.MemberDefinitions !== undefined && + input.MemberDefinitions !== null && { + MemberDefinitions: serializeAws_json1_1MemberDefinitions(input.MemberDefinitions, context), + }), + ...(input.NotificationConfiguration !== undefined && + input.NotificationConfiguration !== null && { + NotificationConfiguration: serializeAws_json1_1NotificationConfiguration( + input.NotificationConfiguration, + context + ), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.WorkforceName !== undefined && input.WorkforceName !== null && { WorkforceName: input.WorkforceName }), + ...(input.WorkteamName !== undefined && input.WorkteamName !== null && { WorkteamName: input.WorkteamName }), }; }; const serializeAws_json1_1CsvContentTypes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CustomImage = (input: CustomImage, context: __SerdeContext): any => { return { - ...(input.AppImageConfigName !== undefined && { AppImageConfigName: input.AppImageConfigName }), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.ImageVersionNumber !== undefined && { ImageVersionNumber: input.ImageVersionNumber }), + ...(input.AppImageConfigName !== undefined && + input.AppImageConfigName !== null && { AppImageConfigName: input.AppImageConfigName }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.ImageVersionNumber !== undefined && + input.ImageVersionNumber !== null && { ImageVersionNumber: input.ImageVersionNumber }), }; }; const serializeAws_json1_1CustomImages = (input: CustomImage[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CustomImage(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CustomImage(entry, context); + }); }; const serializeAws_json1_1DataCaptureConfig = (input: DataCaptureConfig, context: __SerdeContext): any => { return { - ...(input.CaptureContentTypeHeader !== undefined && { - CaptureContentTypeHeader: serializeAws_json1_1CaptureContentTypeHeader(input.CaptureContentTypeHeader, context), - }), - ...(input.CaptureOptions !== undefined && { - CaptureOptions: serializeAws_json1_1CaptureOptionList(input.CaptureOptions, context), - }), - ...(input.DestinationS3Uri !== undefined && { DestinationS3Uri: input.DestinationS3Uri }), - ...(input.EnableCapture !== undefined && { EnableCapture: input.EnableCapture }), - ...(input.InitialSamplingPercentage !== undefined && { - InitialSamplingPercentage: input.InitialSamplingPercentage, - }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.CaptureContentTypeHeader !== undefined && + input.CaptureContentTypeHeader !== null && { + CaptureContentTypeHeader: serializeAws_json1_1CaptureContentTypeHeader(input.CaptureContentTypeHeader, context), + }), + ...(input.CaptureOptions !== undefined && + input.CaptureOptions !== null && { + CaptureOptions: serializeAws_json1_1CaptureOptionList(input.CaptureOptions, context), + }), + ...(input.DestinationS3Uri !== undefined && + input.DestinationS3Uri !== null && { DestinationS3Uri: input.DestinationS3Uri }), + ...(input.EnableCapture !== undefined && input.EnableCapture !== null && { EnableCapture: input.EnableCapture }), + ...(input.InitialSamplingPercentage !== undefined && + input.InitialSamplingPercentage !== null && { InitialSamplingPercentage: input.InitialSamplingPercentage }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), }; }; const serializeAws_json1_1DataCatalogConfig = (input: DataCatalogConfig, context: __SerdeContext): any => { return { - ...(input.Catalog !== undefined && { Catalog: input.Catalog }), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.Catalog !== undefined && input.Catalog !== null && { Catalog: input.Catalog }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_1DataProcessing = (input: DataProcessing, context: __SerdeContext): any => { return { - ...(input.InputFilter !== undefined && { InputFilter: input.InputFilter }), - ...(input.JoinSource !== undefined && { JoinSource: input.JoinSource }), - ...(input.OutputFilter !== undefined && { OutputFilter: input.OutputFilter }), + ...(input.InputFilter !== undefined && input.InputFilter !== null && { InputFilter: input.InputFilter }), + ...(input.JoinSource !== undefined && input.JoinSource !== null && { JoinSource: input.JoinSource }), + ...(input.OutputFilter !== undefined && input.OutputFilter !== null && { OutputFilter: input.OutputFilter }), }; }; @@ -18296,22 +18432,25 @@ const serializeAws_json1_1DataQualityAppSpecification = ( context: __SerdeContext ): any => { return { - ...(input.ContainerArguments !== undefined && { - ContainerArguments: serializeAws_json1_1MonitoringContainerArguments(input.ContainerArguments, context), - }), - ...(input.ContainerEntrypoint !== undefined && { - ContainerEntrypoint: serializeAws_json1_1ContainerEntrypoint(input.ContainerEntrypoint, context), - }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), - }), - ...(input.ImageUri !== undefined && { ImageUri: input.ImageUri }), - ...(input.PostAnalyticsProcessorSourceUri !== undefined && { - PostAnalyticsProcessorSourceUri: input.PostAnalyticsProcessorSourceUri, - }), - ...(input.RecordPreprocessorSourceUri !== undefined && { - RecordPreprocessorSourceUri: input.RecordPreprocessorSourceUri, - }), + ...(input.ContainerArguments !== undefined && + input.ContainerArguments !== null && { + ContainerArguments: serializeAws_json1_1MonitoringContainerArguments(input.ContainerArguments, context), + }), + ...(input.ContainerEntrypoint !== undefined && + input.ContainerEntrypoint !== null && { + ContainerEntrypoint: serializeAws_json1_1ContainerEntrypoint(input.ContainerEntrypoint, context), + }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), + }), + ...(input.ImageUri !== undefined && input.ImageUri !== null && { ImageUri: input.ImageUri }), + ...(input.PostAnalyticsProcessorSourceUri !== undefined && + input.PostAnalyticsProcessorSourceUri !== null && { + PostAnalyticsProcessorSourceUri: input.PostAnalyticsProcessorSourceUri, + }), + ...(input.RecordPreprocessorSourceUri !== undefined && + input.RecordPreprocessorSourceUri !== null && { RecordPreprocessorSourceUri: input.RecordPreprocessorSourceUri }), }; }; @@ -18320,92 +18459,112 @@ const serializeAws_json1_1DataQualityBaselineConfig = ( context: __SerdeContext ): any => { return { - ...(input.BaseliningJobName !== undefined && { BaseliningJobName: input.BaseliningJobName }), - ...(input.ConstraintsResource !== undefined && { - ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), - }), - ...(input.StatisticsResource !== undefined && { - StatisticsResource: serializeAws_json1_1MonitoringStatisticsResource(input.StatisticsResource, context), - }), + ...(input.BaseliningJobName !== undefined && + input.BaseliningJobName !== null && { BaseliningJobName: input.BaseliningJobName }), + ...(input.ConstraintsResource !== undefined && + input.ConstraintsResource !== null && { + ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), + }), + ...(input.StatisticsResource !== undefined && + input.StatisticsResource !== null && { + StatisticsResource: serializeAws_json1_1MonitoringStatisticsResource(input.StatisticsResource, context), + }), }; }; const serializeAws_json1_1DataQualityJobInput = (input: DataQualityJobInput, context: __SerdeContext): any => { return { - ...(input.EndpointInput !== undefined && { - EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), - }), + ...(input.EndpointInput !== undefined && + input.EndpointInput !== null && { + EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), + }), }; }; const serializeAws_json1_1DatasetDefinition = (input: DatasetDefinition, context: __SerdeContext): any => { return { - ...(input.AthenaDatasetDefinition !== undefined && { - AthenaDatasetDefinition: serializeAws_json1_1AthenaDatasetDefinition(input.AthenaDatasetDefinition, context), - }), - ...(input.DataDistributionType !== undefined && { DataDistributionType: input.DataDistributionType }), - ...(input.InputMode !== undefined && { InputMode: input.InputMode }), - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.RedshiftDatasetDefinition !== undefined && { - RedshiftDatasetDefinition: serializeAws_json1_1RedshiftDatasetDefinition( - input.RedshiftDatasetDefinition, - context - ), - }), + ...(input.AthenaDatasetDefinition !== undefined && + input.AthenaDatasetDefinition !== null && { + AthenaDatasetDefinition: serializeAws_json1_1AthenaDatasetDefinition(input.AthenaDatasetDefinition, context), + }), + ...(input.DataDistributionType !== undefined && + input.DataDistributionType !== null && { DataDistributionType: input.DataDistributionType }), + ...(input.InputMode !== undefined && input.InputMode !== null && { InputMode: input.InputMode }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.RedshiftDatasetDefinition !== undefined && + input.RedshiftDatasetDefinition !== null && { + RedshiftDatasetDefinition: serializeAws_json1_1RedshiftDatasetDefinition( + input.RedshiftDatasetDefinition, + context + ), + }), }; }; const serializeAws_json1_1DataSource = (input: DataSource, context: __SerdeContext): any => { return { - ...(input.FileSystemDataSource !== undefined && { - FileSystemDataSource: serializeAws_json1_1FileSystemDataSource(input.FileSystemDataSource, context), - }), - ...(input.S3DataSource !== undefined && { - S3DataSource: serializeAws_json1_1S3DataSource(input.S3DataSource, context), - }), + ...(input.FileSystemDataSource !== undefined && + input.FileSystemDataSource !== null && { + FileSystemDataSource: serializeAws_json1_1FileSystemDataSource(input.FileSystemDataSource, context), + }), + ...(input.S3DataSource !== undefined && + input.S3DataSource !== null && { S3DataSource: serializeAws_json1_1S3DataSource(input.S3DataSource, context) }), }; }; const serializeAws_json1_1DebugHookConfig = (input: DebugHookConfig, context: __SerdeContext): any => { return { - ...(input.CollectionConfigurations !== undefined && { - CollectionConfigurations: serializeAws_json1_1CollectionConfigurations(input.CollectionConfigurations, context), - }), - ...(input.HookParameters !== undefined && { - HookParameters: serializeAws_json1_1HookParameters(input.HookParameters, context), - }), - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), + ...(input.CollectionConfigurations !== undefined && + input.CollectionConfigurations !== null && { + CollectionConfigurations: serializeAws_json1_1CollectionConfigurations(input.CollectionConfigurations, context), + }), + ...(input.HookParameters !== undefined && + input.HookParameters !== null && { + HookParameters: serializeAws_json1_1HookParameters(input.HookParameters, context), + }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), }; }; const serializeAws_json1_1DebugRuleConfiguration = (input: DebugRuleConfiguration, context: __SerdeContext): any => { return { - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.RuleConfigurationName !== undefined && { RuleConfigurationName: input.RuleConfigurationName }), - ...(input.RuleEvaluatorImage !== undefined && { RuleEvaluatorImage: input.RuleEvaluatorImage }), - ...(input.RuleParameters !== undefined && { - RuleParameters: serializeAws_json1_1RuleParameters(input.RuleParameters, context), - }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), - ...(input.VolumeSizeInGB !== undefined && { VolumeSizeInGB: input.VolumeSizeInGB }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.RuleConfigurationName !== undefined && + input.RuleConfigurationName !== null && { RuleConfigurationName: input.RuleConfigurationName }), + ...(input.RuleEvaluatorImage !== undefined && + input.RuleEvaluatorImage !== null && { RuleEvaluatorImage: input.RuleEvaluatorImage }), + ...(input.RuleParameters !== undefined && + input.RuleParameters !== null && { + RuleParameters: serializeAws_json1_1RuleParameters(input.RuleParameters, context), + }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), + ...(input.VolumeSizeInGB !== undefined && + input.VolumeSizeInGB !== null && { VolumeSizeInGB: input.VolumeSizeInGB }), }; }; const serializeAws_json1_1DebugRuleConfigurations = (input: DebugRuleConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DebugRuleConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DebugRuleConfiguration(entry, context); + }); }; const serializeAws_json1_1DeleteActionRequest = (input: DeleteActionRequest, context: __SerdeContext): any => { return { - ...(input.ActionName !== undefined && { ActionName: input.ActionName }), + ...(input.ActionName !== undefined && input.ActionName !== null && { ActionName: input.ActionName }), }; }; const serializeAws_json1_1DeleteAlgorithmInput = (input: DeleteAlgorithmInput, context: __SerdeContext): any => { return { - ...(input.AlgorithmName !== undefined && { AlgorithmName: input.AlgorithmName }), + ...(input.AlgorithmName !== undefined && input.AlgorithmName !== null && { AlgorithmName: input.AlgorithmName }), }; }; @@ -18414,23 +18573,26 @@ const serializeAws_json1_1DeleteAppImageConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.AppImageConfigName !== undefined && { AppImageConfigName: input.AppImageConfigName }), + ...(input.AppImageConfigName !== undefined && + input.AppImageConfigName !== null && { AppImageConfigName: input.AppImageConfigName }), }; }; const serializeAws_json1_1DeleteAppRequest = (input: DeleteAppRequest, context: __SerdeContext): any => { return { - ...(input.AppName !== undefined && { AppName: input.AppName }), - ...(input.AppType !== undefined && { AppType: input.AppType }), - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.UserProfileName !== undefined && { UserProfileName: input.UserProfileName }), + ...(input.AppName !== undefined && input.AppName !== null && { AppName: input.AppName }), + ...(input.AppType !== undefined && input.AppType !== null && { AppType: input.AppType }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.UserProfileName !== undefined && + input.UserProfileName !== null && { UserProfileName: input.UserProfileName }), }; }; const serializeAws_json1_1DeleteArtifactRequest = (input: DeleteArtifactRequest, context: __SerdeContext): any => { return { - ...(input.ArtifactArn !== undefined && { ArtifactArn: input.ArtifactArn }), - ...(input.Source !== undefined && { Source: serializeAws_json1_1ArtifactSource(input.Source, context) }), + ...(input.ArtifactArn !== undefined && input.ArtifactArn !== null && { ArtifactArn: input.ArtifactArn }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_json1_1ArtifactSource(input.Source, context) }), }; }; @@ -18439,8 +18601,9 @@ const serializeAws_json1_1DeleteAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.DestinationArn !== undefined && { DestinationArn: input.DestinationArn }), - ...(input.SourceArn !== undefined && { SourceArn: input.SourceArn }), + ...(input.DestinationArn !== undefined && + input.DestinationArn !== null && { DestinationArn: input.DestinationArn }), + ...(input.SourceArn !== undefined && input.SourceArn !== null && { SourceArn: input.SourceArn }), }; }; @@ -18449,13 +18612,14 @@ const serializeAws_json1_1DeleteCodeRepositoryInput = ( context: __SerdeContext ): any => { return { - ...(input.CodeRepositoryName !== undefined && { CodeRepositoryName: input.CodeRepositoryName }), + ...(input.CodeRepositoryName !== undefined && + input.CodeRepositoryName !== null && { CodeRepositoryName: input.CodeRepositoryName }), }; }; const serializeAws_json1_1DeleteContextRequest = (input: DeleteContextRequest, context: __SerdeContext): any => { return { - ...(input.ContextName !== undefined && { ContextName: input.ContextName }), + ...(input.ContextName !== undefined && input.ContextName !== null && { ContextName: input.ContextName }), }; }; @@ -18464,7 +18628,8 @@ const serializeAws_json1_1DeleteDataQualityJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), }; }; @@ -18473,16 +18638,18 @@ const serializeAws_json1_1DeleteDeviceFleetRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), }; }; const serializeAws_json1_1DeleteDomainRequest = (input: DeleteDomainRequest, context: __SerdeContext): any => { return { - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.RetentionPolicy !== undefined && { - RetentionPolicy: serializeAws_json1_1RetentionPolicy(input.RetentionPolicy, context), - }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.RetentionPolicy !== undefined && + input.RetentionPolicy !== null && { + RetentionPolicy: serializeAws_json1_1RetentionPolicy(input.RetentionPolicy, context), + }), }; }; @@ -18491,19 +18658,21 @@ const serializeAws_json1_1DeleteEndpointConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.EndpointConfigName !== undefined && { EndpointConfigName: input.EndpointConfigName }), + ...(input.EndpointConfigName !== undefined && + input.EndpointConfigName !== null && { EndpointConfigName: input.EndpointConfigName }), }; }; const serializeAws_json1_1DeleteEndpointInput = (input: DeleteEndpointInput, context: __SerdeContext): any => { return { - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), }; }; const serializeAws_json1_1DeleteExperimentRequest = (input: DeleteExperimentRequest, context: __SerdeContext): any => { return { - ...(input.ExperimentName !== undefined && { ExperimentName: input.ExperimentName }), + ...(input.ExperimentName !== undefined && + input.ExperimentName !== null && { ExperimentName: input.ExperimentName }), }; }; @@ -18512,7 +18681,8 @@ const serializeAws_json1_1DeleteFeatureGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.FeatureGroupName !== undefined && { FeatureGroupName: input.FeatureGroupName }), + ...(input.FeatureGroupName !== undefined && + input.FeatureGroupName !== null && { FeatureGroupName: input.FeatureGroupName }), }; }; @@ -18521,7 +18691,8 @@ const serializeAws_json1_1DeleteFlowDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.FlowDefinitionName !== undefined && { FlowDefinitionName: input.FlowDefinitionName }), + ...(input.FlowDefinitionName !== undefined && + input.FlowDefinitionName !== null && { FlowDefinitionName: input.FlowDefinitionName }), }; }; @@ -18530,13 +18701,14 @@ const serializeAws_json1_1DeleteHumanTaskUiRequest = ( context: __SerdeContext ): any => { return { - ...(input.HumanTaskUiName !== undefined && { HumanTaskUiName: input.HumanTaskUiName }), + ...(input.HumanTaskUiName !== undefined && + input.HumanTaskUiName !== null && { HumanTaskUiName: input.HumanTaskUiName }), }; }; const serializeAws_json1_1DeleteImageRequest = (input: DeleteImageRequest, context: __SerdeContext): any => { return { - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), }; }; @@ -18545,8 +18717,8 @@ const serializeAws_json1_1DeleteImageVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -18555,7 +18727,8 @@ const serializeAws_json1_1DeleteModelBiasJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), }; }; @@ -18564,13 +18737,14 @@ const serializeAws_json1_1DeleteModelExplainabilityJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), }; }; const serializeAws_json1_1DeleteModelInput = (input: DeleteModelInput, context: __SerdeContext): any => { return { - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), }; }; @@ -18579,7 +18753,8 @@ const serializeAws_json1_1DeleteModelPackageGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.ModelPackageGroupName !== undefined && { ModelPackageGroupName: input.ModelPackageGroupName }), + ...(input.ModelPackageGroupName !== undefined && + input.ModelPackageGroupName !== null && { ModelPackageGroupName: input.ModelPackageGroupName }), }; }; @@ -18588,13 +18763,15 @@ const serializeAws_json1_1DeleteModelPackageGroupPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.ModelPackageGroupName !== undefined && { ModelPackageGroupName: input.ModelPackageGroupName }), + ...(input.ModelPackageGroupName !== undefined && + input.ModelPackageGroupName !== null && { ModelPackageGroupName: input.ModelPackageGroupName }), }; }; const serializeAws_json1_1DeleteModelPackageInput = (input: DeleteModelPackageInput, context: __SerdeContext): any => { return { - ...(input.ModelPackageName !== undefined && { ModelPackageName: input.ModelPackageName }), + ...(input.ModelPackageName !== undefined && + input.ModelPackageName !== null && { ModelPackageName: input.ModelPackageName }), }; }; @@ -18603,7 +18780,8 @@ const serializeAws_json1_1DeleteModelQualityJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), }; }; @@ -18612,7 +18790,8 @@ const serializeAws_json1_1DeleteMonitoringScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.MonitoringScheduleName !== undefined && { MonitoringScheduleName: input.MonitoringScheduleName }), + ...(input.MonitoringScheduleName !== undefined && + input.MonitoringScheduleName !== null && { MonitoringScheduleName: input.MonitoringScheduleName }), }; }; @@ -18621,7 +18800,8 @@ const serializeAws_json1_1DeleteNotebookInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookInstanceName !== undefined && { NotebookInstanceName: input.NotebookInstanceName }), + ...(input.NotebookInstanceName !== undefined && + input.NotebookInstanceName !== null && { NotebookInstanceName: input.NotebookInstanceName }), }; }; @@ -18630,29 +18810,31 @@ const serializeAws_json1_1DeleteNotebookInstanceLifecycleConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookInstanceLifecycleConfigName !== undefined && { - NotebookInstanceLifecycleConfigName: input.NotebookInstanceLifecycleConfigName, - }), + ...(input.NotebookInstanceLifecycleConfigName !== undefined && + input.NotebookInstanceLifecycleConfigName !== null && { + NotebookInstanceLifecycleConfigName: input.NotebookInstanceLifecycleConfigName, + }), }; }; const serializeAws_json1_1DeletePipelineRequest = (input: DeletePipelineRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.PipelineName !== undefined && { PipelineName: input.PipelineName }), + ...(input.PipelineName !== undefined && input.PipelineName !== null && { PipelineName: input.PipelineName }), }; }; const serializeAws_json1_1DeleteProjectInput = (input: DeleteProjectInput, context: __SerdeContext): any => { return { - ...(input.ProjectName !== undefined && { ProjectName: input.ProjectName }), + ...(input.ProjectName !== undefined && input.ProjectName !== null && { ProjectName: input.ProjectName }), }; }; const serializeAws_json1_1DeleteTagsInput = (input: DeleteTagsInput, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -18661,13 +18843,14 @@ const serializeAws_json1_1DeleteTrialComponentRequest = ( context: __SerdeContext ): any => { return { - ...(input.TrialComponentName !== undefined && { TrialComponentName: input.TrialComponentName }), + ...(input.TrialComponentName !== undefined && + input.TrialComponentName !== null && { TrialComponentName: input.TrialComponentName }), }; }; const serializeAws_json1_1DeleteTrialRequest = (input: DeleteTrialRequest, context: __SerdeContext): any => { return { - ...(input.TrialName !== undefined && { TrialName: input.TrialName }), + ...(input.TrialName !== undefined && input.TrialName !== null && { TrialName: input.TrialName }), }; }; @@ -18676,31 +18859,34 @@ const serializeAws_json1_1DeleteUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.UserProfileName !== undefined && { UserProfileName: input.UserProfileName }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.UserProfileName !== undefined && + input.UserProfileName !== null && { UserProfileName: input.UserProfileName }), }; }; const serializeAws_json1_1DeleteWorkforceRequest = (input: DeleteWorkforceRequest, context: __SerdeContext): any => { return { - ...(input.WorkforceName !== undefined && { WorkforceName: input.WorkforceName }), + ...(input.WorkforceName !== undefined && input.WorkforceName !== null && { WorkforceName: input.WorkforceName }), }; }; const serializeAws_json1_1DeleteWorkteamRequest = (input: DeleteWorkteamRequest, context: __SerdeContext): any => { return { - ...(input.WorkteamName !== undefined && { WorkteamName: input.WorkteamName }), + ...(input.WorkteamName !== undefined && input.WorkteamName !== null && { WorkteamName: input.WorkteamName }), }; }; const serializeAws_json1_1DeploymentConfig = (input: DeploymentConfig, context: __SerdeContext): any => { return { - ...(input.AutoRollbackConfiguration !== undefined && { - AutoRollbackConfiguration: serializeAws_json1_1AutoRollbackConfig(input.AutoRollbackConfiguration, context), - }), - ...(input.BlueGreenUpdatePolicy !== undefined && { - BlueGreenUpdatePolicy: serializeAws_json1_1BlueGreenUpdatePolicy(input.BlueGreenUpdatePolicy, context), - }), + ...(input.AutoRollbackConfiguration !== undefined && + input.AutoRollbackConfiguration !== null && { + AutoRollbackConfiguration: serializeAws_json1_1AutoRollbackConfig(input.AutoRollbackConfiguration, context), + }), + ...(input.BlueGreenUpdatePolicy !== undefined && + input.BlueGreenUpdatePolicy !== null && { + BlueGreenUpdatePolicy: serializeAws_json1_1BlueGreenUpdatePolicy(input.BlueGreenUpdatePolicy, context), + }), }; }; @@ -18709,22 +18895,22 @@ const serializeAws_json1_1DeregisterDevicesRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), - ...(input.DeviceNames !== undefined && { - DeviceNames: serializeAws_json1_1DeviceNames(input.DeviceNames, context), - }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), + ...(input.DeviceNames !== undefined && + input.DeviceNames !== null && { DeviceNames: serializeAws_json1_1DeviceNames(input.DeviceNames, context) }), }; }; const serializeAws_json1_1DescribeActionRequest = (input: DescribeActionRequest, context: __SerdeContext): any => { return { - ...(input.ActionName !== undefined && { ActionName: input.ActionName }), + ...(input.ActionName !== undefined && input.ActionName !== null && { ActionName: input.ActionName }), }; }; const serializeAws_json1_1DescribeAlgorithmInput = (input: DescribeAlgorithmInput, context: __SerdeContext): any => { return { - ...(input.AlgorithmName !== undefined && { AlgorithmName: input.AlgorithmName }), + ...(input.AlgorithmName !== undefined && input.AlgorithmName !== null && { AlgorithmName: input.AlgorithmName }), }; }; @@ -18733,22 +18919,24 @@ const serializeAws_json1_1DescribeAppImageConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.AppImageConfigName !== undefined && { AppImageConfigName: input.AppImageConfigName }), + ...(input.AppImageConfigName !== undefined && + input.AppImageConfigName !== null && { AppImageConfigName: input.AppImageConfigName }), }; }; const serializeAws_json1_1DescribeAppRequest = (input: DescribeAppRequest, context: __SerdeContext): any => { return { - ...(input.AppName !== undefined && { AppName: input.AppName }), - ...(input.AppType !== undefined && { AppType: input.AppType }), - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.UserProfileName !== undefined && { UserProfileName: input.UserProfileName }), + ...(input.AppName !== undefined && input.AppName !== null && { AppName: input.AppName }), + ...(input.AppType !== undefined && input.AppType !== null && { AppType: input.AppType }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.UserProfileName !== undefined && + input.UserProfileName !== null && { UserProfileName: input.UserProfileName }), }; }; const serializeAws_json1_1DescribeArtifactRequest = (input: DescribeArtifactRequest, context: __SerdeContext): any => { return { - ...(input.ArtifactArn !== undefined && { ArtifactArn: input.ArtifactArn }), + ...(input.ArtifactArn !== undefined && input.ArtifactArn !== null && { ArtifactArn: input.ArtifactArn }), }; }; @@ -18757,7 +18945,7 @@ const serializeAws_json1_1DescribeAutoMLJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.AutoMLJobName !== undefined && { AutoMLJobName: input.AutoMLJobName }), + ...(input.AutoMLJobName !== undefined && input.AutoMLJobName !== null && { AutoMLJobName: input.AutoMLJobName }), }; }; @@ -18766,7 +18954,8 @@ const serializeAws_json1_1DescribeCodeRepositoryInput = ( context: __SerdeContext ): any => { return { - ...(input.CodeRepositoryName !== undefined && { CodeRepositoryName: input.CodeRepositoryName }), + ...(input.CodeRepositoryName !== undefined && + input.CodeRepositoryName !== null && { CodeRepositoryName: input.CodeRepositoryName }), }; }; @@ -18775,13 +18964,14 @@ const serializeAws_json1_1DescribeCompilationJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.CompilationJobName !== undefined && { CompilationJobName: input.CompilationJobName }), + ...(input.CompilationJobName !== undefined && + input.CompilationJobName !== null && { CompilationJobName: input.CompilationJobName }), }; }; const serializeAws_json1_1DescribeContextRequest = (input: DescribeContextRequest, context: __SerdeContext): any => { return { - ...(input.ContextName !== undefined && { ContextName: input.ContextName }), + ...(input.ContextName !== undefined && input.ContextName !== null && { ContextName: input.ContextName }), }; }; @@ -18790,7 +18980,8 @@ const serializeAws_json1_1DescribeDataQualityJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), }; }; @@ -18799,21 +18990,23 @@ const serializeAws_json1_1DescribeDeviceFleetRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), }; }; const serializeAws_json1_1DescribeDeviceRequest = (input: DescribeDeviceRequest, context: __SerdeContext): any => { return { - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), - ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), + ...(input.DeviceName !== undefined && input.DeviceName !== null && { DeviceName: input.DeviceName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1DescribeDomainRequest = (input: DescribeDomainRequest, context: __SerdeContext): any => { return { - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), }; }; @@ -18822,7 +19015,8 @@ const serializeAws_json1_1DescribeEdgePackagingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.EdgePackagingJobName !== undefined && { EdgePackagingJobName: input.EdgePackagingJobName }), + ...(input.EdgePackagingJobName !== undefined && + input.EdgePackagingJobName !== null && { EdgePackagingJobName: input.EdgePackagingJobName }), }; }; @@ -18831,13 +19025,14 @@ const serializeAws_json1_1DescribeEndpointConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.EndpointConfigName !== undefined && { EndpointConfigName: input.EndpointConfigName }), + ...(input.EndpointConfigName !== undefined && + input.EndpointConfigName !== null && { EndpointConfigName: input.EndpointConfigName }), }; }; const serializeAws_json1_1DescribeEndpointInput = (input: DescribeEndpointInput, context: __SerdeContext): any => { return { - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), }; }; @@ -18846,7 +19041,8 @@ const serializeAws_json1_1DescribeExperimentRequest = ( context: __SerdeContext ): any => { return { - ...(input.ExperimentName !== undefined && { ExperimentName: input.ExperimentName }), + ...(input.ExperimentName !== undefined && + input.ExperimentName !== null && { ExperimentName: input.ExperimentName }), }; }; @@ -18855,8 +19051,9 @@ const serializeAws_json1_1DescribeFeatureGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.FeatureGroupName !== undefined && { FeatureGroupName: input.FeatureGroupName }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FeatureGroupName !== undefined && + input.FeatureGroupName !== null && { FeatureGroupName: input.FeatureGroupName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -18865,7 +19062,8 @@ const serializeAws_json1_1DescribeFlowDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.FlowDefinitionName !== undefined && { FlowDefinitionName: input.FlowDefinitionName }), + ...(input.FlowDefinitionName !== undefined && + input.FlowDefinitionName !== null && { FlowDefinitionName: input.FlowDefinitionName }), }; }; @@ -18874,7 +19072,8 @@ const serializeAws_json1_1DescribeHumanTaskUiRequest = ( context: __SerdeContext ): any => { return { - ...(input.HumanTaskUiName !== undefined && { HumanTaskUiName: input.HumanTaskUiName }), + ...(input.HumanTaskUiName !== undefined && + input.HumanTaskUiName !== null && { HumanTaskUiName: input.HumanTaskUiName }), }; }; @@ -18883,15 +19082,14 @@ const serializeAws_json1_1DescribeHyperParameterTuningJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.HyperParameterTuningJobName !== undefined && { - HyperParameterTuningJobName: input.HyperParameterTuningJobName, - }), + ...(input.HyperParameterTuningJobName !== undefined && + input.HyperParameterTuningJobName !== null && { HyperParameterTuningJobName: input.HyperParameterTuningJobName }), }; }; const serializeAws_json1_1DescribeImageRequest = (input: DescribeImageRequest, context: __SerdeContext): any => { return { - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), }; }; @@ -18900,8 +19098,8 @@ const serializeAws_json1_1DescribeImageVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -18910,7 +19108,8 @@ const serializeAws_json1_1DescribeLabelingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.LabelingJobName !== undefined && { LabelingJobName: input.LabelingJobName }), + ...(input.LabelingJobName !== undefined && + input.LabelingJobName !== null && { LabelingJobName: input.LabelingJobName }), }; }; @@ -18919,7 +19118,8 @@ const serializeAws_json1_1DescribeModelBiasJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), }; }; @@ -18928,13 +19128,14 @@ const serializeAws_json1_1DescribeModelExplainabilityJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), }; }; const serializeAws_json1_1DescribeModelInput = (input: DescribeModelInput, context: __SerdeContext): any => { return { - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), }; }; @@ -18943,7 +19144,8 @@ const serializeAws_json1_1DescribeModelPackageGroupInput = ( context: __SerdeContext ): any => { return { - ...(input.ModelPackageGroupName !== undefined && { ModelPackageGroupName: input.ModelPackageGroupName }), + ...(input.ModelPackageGroupName !== undefined && + input.ModelPackageGroupName !== null && { ModelPackageGroupName: input.ModelPackageGroupName }), }; }; @@ -18952,7 +19154,8 @@ const serializeAws_json1_1DescribeModelPackageInput = ( context: __SerdeContext ): any => { return { - ...(input.ModelPackageName !== undefined && { ModelPackageName: input.ModelPackageName }), + ...(input.ModelPackageName !== undefined && + input.ModelPackageName !== null && { ModelPackageName: input.ModelPackageName }), }; }; @@ -18961,7 +19164,8 @@ const serializeAws_json1_1DescribeModelQualityJobDefinitionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobDefinitionName !== undefined && { JobDefinitionName: input.JobDefinitionName }), + ...(input.JobDefinitionName !== undefined && + input.JobDefinitionName !== null && { JobDefinitionName: input.JobDefinitionName }), }; }; @@ -18970,7 +19174,8 @@ const serializeAws_json1_1DescribeMonitoringScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.MonitoringScheduleName !== undefined && { MonitoringScheduleName: input.MonitoringScheduleName }), + ...(input.MonitoringScheduleName !== undefined && + input.MonitoringScheduleName !== null && { MonitoringScheduleName: input.MonitoringScheduleName }), }; }; @@ -18979,7 +19184,8 @@ const serializeAws_json1_1DescribeNotebookInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookInstanceName !== undefined && { NotebookInstanceName: input.NotebookInstanceName }), + ...(input.NotebookInstanceName !== undefined && + input.NotebookInstanceName !== null && { NotebookInstanceName: input.NotebookInstanceName }), }; }; @@ -18988,9 +19194,10 @@ const serializeAws_json1_1DescribeNotebookInstanceLifecycleConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookInstanceLifecycleConfigName !== undefined && { - NotebookInstanceLifecycleConfigName: input.NotebookInstanceLifecycleConfigName, - }), + ...(input.NotebookInstanceLifecycleConfigName !== undefined && + input.NotebookInstanceLifecycleConfigName !== null && { + NotebookInstanceLifecycleConfigName: input.NotebookInstanceLifecycleConfigName, + }), }; }; @@ -18999,7 +19206,8 @@ const serializeAws_json1_1DescribePipelineDefinitionForExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.PipelineExecutionArn !== undefined && { PipelineExecutionArn: input.PipelineExecutionArn }), + ...(input.PipelineExecutionArn !== undefined && + input.PipelineExecutionArn !== null && { PipelineExecutionArn: input.PipelineExecutionArn }), }; }; @@ -19008,13 +19216,14 @@ const serializeAws_json1_1DescribePipelineExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.PipelineExecutionArn !== undefined && { PipelineExecutionArn: input.PipelineExecutionArn }), + ...(input.PipelineExecutionArn !== undefined && + input.PipelineExecutionArn !== null && { PipelineExecutionArn: input.PipelineExecutionArn }), }; }; const serializeAws_json1_1DescribePipelineRequest = (input: DescribePipelineRequest, context: __SerdeContext): any => { return { - ...(input.PipelineName !== undefined && { PipelineName: input.PipelineName }), + ...(input.PipelineName !== undefined && input.PipelineName !== null && { PipelineName: input.PipelineName }), }; }; @@ -19023,13 +19232,14 @@ const serializeAws_json1_1DescribeProcessingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProcessingJobName !== undefined && { ProcessingJobName: input.ProcessingJobName }), + ...(input.ProcessingJobName !== undefined && + input.ProcessingJobName !== null && { ProcessingJobName: input.ProcessingJobName }), }; }; const serializeAws_json1_1DescribeProjectInput = (input: DescribeProjectInput, context: __SerdeContext): any => { return { - ...(input.ProjectName !== undefined && { ProjectName: input.ProjectName }), + ...(input.ProjectName !== undefined && input.ProjectName !== null && { ProjectName: input.ProjectName }), }; }; @@ -19038,7 +19248,7 @@ const serializeAws_json1_1DescribeSubscribedWorkteamRequest = ( context: __SerdeContext ): any => { return { - ...(input.WorkteamArn !== undefined && { WorkteamArn: input.WorkteamArn }), + ...(input.WorkteamArn !== undefined && input.WorkteamArn !== null && { WorkteamArn: input.WorkteamArn }), }; }; @@ -19047,7 +19257,8 @@ const serializeAws_json1_1DescribeTrainingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.TrainingJobName !== undefined && { TrainingJobName: input.TrainingJobName }), + ...(input.TrainingJobName !== undefined && + input.TrainingJobName !== null && { TrainingJobName: input.TrainingJobName }), }; }; @@ -19056,7 +19267,8 @@ const serializeAws_json1_1DescribeTransformJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.TransformJobName !== undefined && { TransformJobName: input.TransformJobName }), + ...(input.TransformJobName !== undefined && + input.TransformJobName !== null && { TransformJobName: input.TransformJobName }), }; }; @@ -19065,13 +19277,14 @@ const serializeAws_json1_1DescribeTrialComponentRequest = ( context: __SerdeContext ): any => { return { - ...(input.TrialComponentName !== undefined && { TrialComponentName: input.TrialComponentName }), + ...(input.TrialComponentName !== undefined && + input.TrialComponentName !== null && { TrialComponentName: input.TrialComponentName }), }; }; const serializeAws_json1_1DescribeTrialRequest = (input: DescribeTrialRequest, context: __SerdeContext): any => { return { - ...(input.TrialName !== undefined && { TrialName: input.TrialName }), + ...(input.TrialName !== undefined && input.TrialName !== null && { TrialName: input.TrialName }), }; }; @@ -19080,8 +19293,9 @@ const serializeAws_json1_1DescribeUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.UserProfileName !== undefined && { UserProfileName: input.UserProfileName }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.UserProfileName !== undefined && + input.UserProfileName !== null && { UserProfileName: input.UserProfileName }), }; }; @@ -19090,13 +19304,13 @@ const serializeAws_json1_1DescribeWorkforceRequest = ( context: __SerdeContext ): any => { return { - ...(input.WorkforceName !== undefined && { WorkforceName: input.WorkforceName }), + ...(input.WorkforceName !== undefined && input.WorkforceName !== null && { WorkforceName: input.WorkforceName }), }; }; const serializeAws_json1_1DescribeWorkteamRequest = (input: DescribeWorkteamRequest, context: __SerdeContext): any => { return { - ...(input.WorkteamName !== undefined && { WorkteamName: input.WorkteamName }), + ...(input.WorkteamName !== undefined && input.WorkteamName !== null && { WorkteamName: input.WorkteamName }), }; }; @@ -19105,9 +19319,10 @@ const serializeAws_json1_1DesiredWeightAndCapacity = ( context: __SerdeContext ): any => { return { - ...(input.DesiredInstanceCount !== undefined && { DesiredInstanceCount: input.DesiredInstanceCount }), - ...(input.DesiredWeight !== undefined && { DesiredWeight: input.DesiredWeight }), - ...(input.VariantName !== undefined && { VariantName: input.VariantName }), + ...(input.DesiredInstanceCount !== undefined && + input.DesiredInstanceCount !== null && { DesiredInstanceCount: input.DesiredInstanceCount }), + ...(input.DesiredWeight !== undefined && input.DesiredWeight !== null && { DesiredWeight: input.DesiredWeight }), + ...(input.VariantName !== undefined && input.VariantName !== null && { VariantName: input.VariantName }), }; }; @@ -19115,23 +19330,44 @@ const serializeAws_json1_1DesiredWeightAndCapacityList = ( input: DesiredWeightAndCapacity[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1DesiredWeightAndCapacity(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DesiredWeightAndCapacity(entry, context); + }); }; const serializeAws_json1_1Device = (input: Device, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }), - ...(input.IotThingName !== undefined && { IotThingName: input.IotThingName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DeviceName !== undefined && input.DeviceName !== null && { DeviceName: input.DeviceName }), + ...(input.IotThingName !== undefined && input.IotThingName !== null && { IotThingName: input.IotThingName }), }; }; const serializeAws_json1_1DeviceNames = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Devices = (input: Device[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Device(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Device(entry, context); + }); }; const serializeAws_json1_1DisableSagemakerServicecatalogPortfolioInput = ( @@ -19146,15 +19382,17 @@ const serializeAws_json1_1DisassociateTrialComponentRequest = ( context: __SerdeContext ): any => { return { - ...(input.TrialComponentName !== undefined && { TrialComponentName: input.TrialComponentName }), - ...(input.TrialName !== undefined && { TrialName: input.TrialName }), + ...(input.TrialComponentName !== undefined && + input.TrialComponentName !== null && { TrialComponentName: input.TrialComponentName }), + ...(input.TrialName !== undefined && input.TrialName !== null && { TrialName: input.TrialName }), }; }; const serializeAws_json1_1EdgeOutputConfig = (input: EdgeOutputConfig, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3OutputLocation !== undefined && { S3OutputLocation: input.S3OutputLocation }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputLocation !== undefined && + input.S3OutputLocation !== null && { S3OutputLocation: input.S3OutputLocation }), }; }; @@ -19167,85 +19405,110 @@ const serializeAws_json1_1EnableSagemakerServicecatalogPortfolioInput = ( const serializeAws_json1_1EndpointInput = (input: EndpointInput, context: __SerdeContext): any => { return { - ...(input.EndTimeOffset !== undefined && { EndTimeOffset: input.EndTimeOffset }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.FeaturesAttribute !== undefined && { FeaturesAttribute: input.FeaturesAttribute }), - ...(input.InferenceAttribute !== undefined && { InferenceAttribute: input.InferenceAttribute }), - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.ProbabilityAttribute !== undefined && { ProbabilityAttribute: input.ProbabilityAttribute }), - ...(input.ProbabilityThresholdAttribute !== undefined && { - ProbabilityThresholdAttribute: input.ProbabilityThresholdAttribute, - }), - ...(input.S3DataDistributionType !== undefined && { S3DataDistributionType: input.S3DataDistributionType }), - ...(input.S3InputMode !== undefined && { S3InputMode: input.S3InputMode }), - ...(input.StartTimeOffset !== undefined && { StartTimeOffset: input.StartTimeOffset }), + ...(input.EndTimeOffset !== undefined && input.EndTimeOffset !== null && { EndTimeOffset: input.EndTimeOffset }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.FeaturesAttribute !== undefined && + input.FeaturesAttribute !== null && { FeaturesAttribute: input.FeaturesAttribute }), + ...(input.InferenceAttribute !== undefined && + input.InferenceAttribute !== null && { InferenceAttribute: input.InferenceAttribute }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.ProbabilityAttribute !== undefined && + input.ProbabilityAttribute !== null && { ProbabilityAttribute: input.ProbabilityAttribute }), + ...(input.ProbabilityThresholdAttribute !== undefined && + input.ProbabilityThresholdAttribute !== null && { + ProbabilityThresholdAttribute: input.ProbabilityThresholdAttribute, + }), + ...(input.S3DataDistributionType !== undefined && + input.S3DataDistributionType !== null && { S3DataDistributionType: input.S3DataDistributionType }), + ...(input.S3InputMode !== undefined && input.S3InputMode !== null && { S3InputMode: input.S3InputMode }), + ...(input.StartTimeOffset !== undefined && + input.StartTimeOffset !== null && { StartTimeOffset: input.StartTimeOffset }), }; }; const serializeAws_json1_1EnvironmentMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ExperimentConfig = (input: ExperimentConfig, context: __SerdeContext): any => { return { - ...(input.ExperimentName !== undefined && { ExperimentName: input.ExperimentName }), - ...(input.TrialComponentDisplayName !== undefined && { - TrialComponentDisplayName: input.TrialComponentDisplayName, - }), - ...(input.TrialName !== undefined && { TrialName: input.TrialName }), + ...(input.ExperimentName !== undefined && + input.ExperimentName !== null && { ExperimentName: input.ExperimentName }), + ...(input.TrialComponentDisplayName !== undefined && + input.TrialComponentDisplayName !== null && { TrialComponentDisplayName: input.TrialComponentDisplayName }), + ...(input.TrialName !== undefined && input.TrialName !== null && { TrialName: input.TrialName }), }; }; const serializeAws_json1_1Explainability = (input: Explainability, context: __SerdeContext): any => { return { - ...(input.Report !== undefined && { Report: serializeAws_json1_1MetricsSource(input.Report, context) }), + ...(input.Report !== undefined && + input.Report !== null && { Report: serializeAws_json1_1MetricsSource(input.Report, context) }), }; }; const serializeAws_json1_1FeatureDefinition = (input: FeatureDefinition, context: __SerdeContext): any => { return { - ...(input.FeatureName !== undefined && { FeatureName: input.FeatureName }), - ...(input.FeatureType !== undefined && { FeatureType: input.FeatureType }), + ...(input.FeatureName !== undefined && input.FeatureName !== null && { FeatureName: input.FeatureName }), + ...(input.FeatureType !== undefined && input.FeatureType !== null && { FeatureType: input.FeatureType }), }; }; const serializeAws_json1_1FeatureDefinitions = (input: FeatureDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FeatureDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FeatureDefinition(entry, context); + }); }; const serializeAws_json1_1FileSystemConfig = (input: FileSystemConfig, context: __SerdeContext): any => { return { - ...(input.DefaultGid !== undefined && { DefaultGid: input.DefaultGid }), - ...(input.DefaultUid !== undefined && { DefaultUid: input.DefaultUid }), - ...(input.MountPath !== undefined && { MountPath: input.MountPath }), + ...(input.DefaultGid !== undefined && input.DefaultGid !== null && { DefaultGid: input.DefaultGid }), + ...(input.DefaultUid !== undefined && input.DefaultUid !== null && { DefaultUid: input.DefaultUid }), + ...(input.MountPath !== undefined && input.MountPath !== null && { MountPath: input.MountPath }), }; }; const serializeAws_json1_1FileSystemDataSource = (input: FileSystemDataSource, context: __SerdeContext): any => { return { - ...(input.DirectoryPath !== undefined && { DirectoryPath: input.DirectoryPath }), - ...(input.FileSystemAccessMode !== undefined && { FileSystemAccessMode: input.FileSystemAccessMode }), - ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }), - ...(input.FileSystemType !== undefined && { FileSystemType: input.FileSystemType }), + ...(input.DirectoryPath !== undefined && input.DirectoryPath !== null && { DirectoryPath: input.DirectoryPath }), + ...(input.FileSystemAccessMode !== undefined && + input.FileSystemAccessMode !== null && { FileSystemAccessMode: input.FileSystemAccessMode }), + ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }), + ...(input.FileSystemType !== undefined && + input.FileSystemType !== null && { FileSystemType: input.FileSystemType }), }; }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Operator !== undefined && { Operator: input.Operator }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Operator !== undefined && input.Operator !== null && { Operator: input.Operator }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1FilterList = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1FlowDefinitionOutputConfig = ( @@ -19253,13 +19516,20 @@ const serializeAws_json1_1FlowDefinitionOutputConfig = ( context: __SerdeContext ): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), }; }; const serializeAws_json1_1FlowDefinitionTaskKeywords = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetDeviceFleetReportRequest = ( @@ -19267,7 +19537,8 @@ const serializeAws_json1_1GetDeviceFleetReportRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), }; }; @@ -19276,7 +19547,8 @@ const serializeAws_json1_1GetModelPackageGroupPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.ModelPackageGroupName !== undefined && { ModelPackageGroupName: input.ModelPackageGroupName }), + ...(input.ModelPackageGroupName !== undefined && + input.ModelPackageGroupName !== null && { ModelPackageGroupName: input.ModelPackageGroupName }), }; }; @@ -19292,39 +19564,49 @@ const serializeAws_json1_1GetSearchSuggestionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Resource !== undefined && { Resource: input.Resource }), - ...(input.SuggestionQuery !== undefined && { - SuggestionQuery: serializeAws_json1_1SuggestionQuery(input.SuggestionQuery, context), - }), + ...(input.Resource !== undefined && input.Resource !== null && { Resource: input.Resource }), + ...(input.SuggestionQuery !== undefined && + input.SuggestionQuery !== null && { + SuggestionQuery: serializeAws_json1_1SuggestionQuery(input.SuggestionQuery, context), + }), }; }; const serializeAws_json1_1GitConfig = (input: GitConfig, context: __SerdeContext): any => { return { - ...(input.Branch !== undefined && { Branch: input.Branch }), - ...(input.RepositoryUrl !== undefined && { RepositoryUrl: input.RepositoryUrl }), - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), + ...(input.Branch !== undefined && input.Branch !== null && { Branch: input.Branch }), + ...(input.RepositoryUrl !== undefined && input.RepositoryUrl !== null && { RepositoryUrl: input.RepositoryUrl }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), }; }; const serializeAws_json1_1GitConfigForUpdate = (input: GitConfigForUpdate, context: __SerdeContext): any => { return { - ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), + ...(input.SecretArn !== undefined && input.SecretArn !== null && { SecretArn: input.SecretArn }), }; }; const serializeAws_json1_1Groups = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1HookParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1HumanLoopActivationConditionsConfig = ( @@ -19332,9 +19614,10 @@ const serializeAws_json1_1HumanLoopActivationConditionsConfig = ( context: __SerdeContext ): any => { return { - ...(input.HumanLoopActivationConditions !== undefined && { - HumanLoopActivationConditions: __LazyJsonString.fromObject(input.HumanLoopActivationConditions), - }), + ...(input.HumanLoopActivationConditions !== undefined && + input.HumanLoopActivationConditions !== null && { + HumanLoopActivationConditions: __LazyJsonString.fromObject(input.HumanLoopActivationConditions), + }), }; }; @@ -19343,70 +19626,86 @@ const serializeAws_json1_1HumanLoopActivationConfig = ( context: __SerdeContext ): any => { return { - ...(input.HumanLoopActivationConditionsConfig !== undefined && { - HumanLoopActivationConditionsConfig: serializeAws_json1_1HumanLoopActivationConditionsConfig( - input.HumanLoopActivationConditionsConfig, - context - ), - }), + ...(input.HumanLoopActivationConditionsConfig !== undefined && + input.HumanLoopActivationConditionsConfig !== null && { + HumanLoopActivationConditionsConfig: serializeAws_json1_1HumanLoopActivationConditionsConfig( + input.HumanLoopActivationConditionsConfig, + context + ), + }), }; }; const serializeAws_json1_1HumanLoopConfig = (input: HumanLoopConfig, context: __SerdeContext): any => { return { - ...(input.HumanTaskUiArn !== undefined && { HumanTaskUiArn: input.HumanTaskUiArn }), - ...(input.PublicWorkforceTaskPrice !== undefined && { - PublicWorkforceTaskPrice: serializeAws_json1_1PublicWorkforceTaskPrice(input.PublicWorkforceTaskPrice, context), - }), - ...(input.TaskAvailabilityLifetimeInSeconds !== undefined && { - TaskAvailabilityLifetimeInSeconds: input.TaskAvailabilityLifetimeInSeconds, - }), - ...(input.TaskCount !== undefined && { TaskCount: input.TaskCount }), - ...(input.TaskDescription !== undefined && { TaskDescription: input.TaskDescription }), - ...(input.TaskKeywords !== undefined && { - TaskKeywords: serializeAws_json1_1FlowDefinitionTaskKeywords(input.TaskKeywords, context), - }), - ...(input.TaskTimeLimitInSeconds !== undefined && { TaskTimeLimitInSeconds: input.TaskTimeLimitInSeconds }), - ...(input.TaskTitle !== undefined && { TaskTitle: input.TaskTitle }), - ...(input.WorkteamArn !== undefined && { WorkteamArn: input.WorkteamArn }), + ...(input.HumanTaskUiArn !== undefined && + input.HumanTaskUiArn !== null && { HumanTaskUiArn: input.HumanTaskUiArn }), + ...(input.PublicWorkforceTaskPrice !== undefined && + input.PublicWorkforceTaskPrice !== null && { + PublicWorkforceTaskPrice: serializeAws_json1_1PublicWorkforceTaskPrice(input.PublicWorkforceTaskPrice, context), + }), + ...(input.TaskAvailabilityLifetimeInSeconds !== undefined && + input.TaskAvailabilityLifetimeInSeconds !== null && { + TaskAvailabilityLifetimeInSeconds: input.TaskAvailabilityLifetimeInSeconds, + }), + ...(input.TaskCount !== undefined && input.TaskCount !== null && { TaskCount: input.TaskCount }), + ...(input.TaskDescription !== undefined && + input.TaskDescription !== null && { TaskDescription: input.TaskDescription }), + ...(input.TaskKeywords !== undefined && + input.TaskKeywords !== null && { + TaskKeywords: serializeAws_json1_1FlowDefinitionTaskKeywords(input.TaskKeywords, context), + }), + ...(input.TaskTimeLimitInSeconds !== undefined && + input.TaskTimeLimitInSeconds !== null && { TaskTimeLimitInSeconds: input.TaskTimeLimitInSeconds }), + ...(input.TaskTitle !== undefined && input.TaskTitle !== null && { TaskTitle: input.TaskTitle }), + ...(input.WorkteamArn !== undefined && input.WorkteamArn !== null && { WorkteamArn: input.WorkteamArn }), }; }; const serializeAws_json1_1HumanLoopRequestSource = (input: HumanLoopRequestSource, context: __SerdeContext): any => { return { - ...(input.AwsManagedHumanLoopRequestSource !== undefined && { - AwsManagedHumanLoopRequestSource: input.AwsManagedHumanLoopRequestSource, - }), + ...(input.AwsManagedHumanLoopRequestSource !== undefined && + input.AwsManagedHumanLoopRequestSource !== null && { + AwsManagedHumanLoopRequestSource: input.AwsManagedHumanLoopRequestSource, + }), }; }; const serializeAws_json1_1HumanTaskConfig = (input: HumanTaskConfig, context: __SerdeContext): any => { return { - ...(input.AnnotationConsolidationConfig !== undefined && { - AnnotationConsolidationConfig: serializeAws_json1_1AnnotationConsolidationConfig( - input.AnnotationConsolidationConfig, - context - ), - }), - ...(input.MaxConcurrentTaskCount !== undefined && { MaxConcurrentTaskCount: input.MaxConcurrentTaskCount }), - ...(input.NumberOfHumanWorkersPerDataObject !== undefined && { - NumberOfHumanWorkersPerDataObject: input.NumberOfHumanWorkersPerDataObject, - }), - ...(input.PreHumanTaskLambdaArn !== undefined && { PreHumanTaskLambdaArn: input.PreHumanTaskLambdaArn }), - ...(input.PublicWorkforceTaskPrice !== undefined && { - PublicWorkforceTaskPrice: serializeAws_json1_1PublicWorkforceTaskPrice(input.PublicWorkforceTaskPrice, context), - }), - ...(input.TaskAvailabilityLifetimeInSeconds !== undefined && { - TaskAvailabilityLifetimeInSeconds: input.TaskAvailabilityLifetimeInSeconds, - }), - ...(input.TaskDescription !== undefined && { TaskDescription: input.TaskDescription }), - ...(input.TaskKeywords !== undefined && { - TaskKeywords: serializeAws_json1_1TaskKeywords(input.TaskKeywords, context), - }), - ...(input.TaskTimeLimitInSeconds !== undefined && { TaskTimeLimitInSeconds: input.TaskTimeLimitInSeconds }), - ...(input.TaskTitle !== undefined && { TaskTitle: input.TaskTitle }), - ...(input.UiConfig !== undefined && { UiConfig: serializeAws_json1_1UiConfig(input.UiConfig, context) }), - ...(input.WorkteamArn !== undefined && { WorkteamArn: input.WorkteamArn }), + ...(input.AnnotationConsolidationConfig !== undefined && + input.AnnotationConsolidationConfig !== null && { + AnnotationConsolidationConfig: serializeAws_json1_1AnnotationConsolidationConfig( + input.AnnotationConsolidationConfig, + context + ), + }), + ...(input.MaxConcurrentTaskCount !== undefined && + input.MaxConcurrentTaskCount !== null && { MaxConcurrentTaskCount: input.MaxConcurrentTaskCount }), + ...(input.NumberOfHumanWorkersPerDataObject !== undefined && + input.NumberOfHumanWorkersPerDataObject !== null && { + NumberOfHumanWorkersPerDataObject: input.NumberOfHumanWorkersPerDataObject, + }), + ...(input.PreHumanTaskLambdaArn !== undefined && + input.PreHumanTaskLambdaArn !== null && { PreHumanTaskLambdaArn: input.PreHumanTaskLambdaArn }), + ...(input.PublicWorkforceTaskPrice !== undefined && + input.PublicWorkforceTaskPrice !== null && { + PublicWorkforceTaskPrice: serializeAws_json1_1PublicWorkforceTaskPrice(input.PublicWorkforceTaskPrice, context), + }), + ...(input.TaskAvailabilityLifetimeInSeconds !== undefined && + input.TaskAvailabilityLifetimeInSeconds !== null && { + TaskAvailabilityLifetimeInSeconds: input.TaskAvailabilityLifetimeInSeconds, + }), + ...(input.TaskDescription !== undefined && + input.TaskDescription !== null && { TaskDescription: input.TaskDescription }), + ...(input.TaskKeywords !== undefined && + input.TaskKeywords !== null && { TaskKeywords: serializeAws_json1_1TaskKeywords(input.TaskKeywords, context) }), + ...(input.TaskTimeLimitInSeconds !== undefined && + input.TaskTimeLimitInSeconds !== null && { TaskTimeLimitInSeconds: input.TaskTimeLimitInSeconds }), + ...(input.TaskTitle !== undefined && input.TaskTitle !== null && { TaskTitle: input.TaskTitle }), + ...(input.UiConfig !== undefined && + input.UiConfig !== null && { UiConfig: serializeAws_json1_1UiConfig(input.UiConfig, context) }), + ...(input.WorkteamArn !== undefined && input.WorkteamArn !== null && { WorkteamArn: input.WorkteamArn }), }; }; @@ -19415,23 +19714,27 @@ const serializeAws_json1_1HyperParameterAlgorithmSpecification = ( context: __SerdeContext ): any => { return { - ...(input.AlgorithmName !== undefined && { AlgorithmName: input.AlgorithmName }), - ...(input.MetricDefinitions !== undefined && { - MetricDefinitions: serializeAws_json1_1MetricDefinitionList(input.MetricDefinitions, context), - }), - ...(input.TrainingImage !== undefined && { TrainingImage: input.TrainingImage }), - ...(input.TrainingInputMode !== undefined && { TrainingInputMode: input.TrainingInputMode }), + ...(input.AlgorithmName !== undefined && input.AlgorithmName !== null && { AlgorithmName: input.AlgorithmName }), + ...(input.MetricDefinitions !== undefined && + input.MetricDefinitions !== null && { + MetricDefinitions: serializeAws_json1_1MetricDefinitionList(input.MetricDefinitions, context), + }), + ...(input.TrainingImage !== undefined && input.TrainingImage !== null && { TrainingImage: input.TrainingImage }), + ...(input.TrainingInputMode !== undefined && + input.TrainingInputMode !== null && { TrainingInputMode: input.TrainingInputMode }), }; }; const serializeAws_json1_1HyperParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1HyperParameterSpecification = ( @@ -19439,13 +19742,14 @@ const serializeAws_json1_1HyperParameterSpecification = ( context: __SerdeContext ): any => { return { - ...(input.DefaultValue !== undefined && { DefaultValue: input.DefaultValue }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.IsRequired !== undefined && { IsRequired: input.IsRequired }), - ...(input.IsTunable !== undefined && { IsTunable: input.IsTunable }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Range !== undefined && { Range: serializeAws_json1_1ParameterRange(input.Range, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DefaultValue !== undefined && input.DefaultValue !== null && { DefaultValue: input.DefaultValue }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.IsRequired !== undefined && input.IsRequired !== null && { IsRequired: input.IsRequired }), + ...(input.IsTunable !== undefined && input.IsTunable !== null && { IsTunable: input.IsTunable }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Range !== undefined && + input.Range !== null && { Range: serializeAws_json1_1ParameterRange(input.Range, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -19453,7 +19757,14 @@ const serializeAws_json1_1HyperParameterSpecifications = ( input: HyperParameterSpecification[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1HyperParameterSpecification(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1HyperParameterSpecification(entry, context); + }); }; const serializeAws_json1_1HyperParameterTrainingJobDefinition = ( @@ -19461,46 +19772,58 @@ const serializeAws_json1_1HyperParameterTrainingJobDefinition = ( context: __SerdeContext ): any => { return { - ...(input.AlgorithmSpecification !== undefined && { - AlgorithmSpecification: serializeAws_json1_1HyperParameterAlgorithmSpecification( - input.AlgorithmSpecification, - context - ), - }), - ...(input.CheckpointConfig !== undefined && { - CheckpointConfig: serializeAws_json1_1CheckpointConfig(input.CheckpointConfig, context), - }), - ...(input.DefinitionName !== undefined && { DefinitionName: input.DefinitionName }), - ...(input.EnableInterContainerTrafficEncryption !== undefined && { - EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, - }), - ...(input.EnableManagedSpotTraining !== undefined && { - EnableManagedSpotTraining: input.EnableManagedSpotTraining, - }), - ...(input.EnableNetworkIsolation !== undefined && { EnableNetworkIsolation: input.EnableNetworkIsolation }), - ...(input.HyperParameterRanges !== undefined && { - HyperParameterRanges: serializeAws_json1_1ParameterRanges(input.HyperParameterRanges, context), - }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.ResourceConfig !== undefined && { - ResourceConfig: serializeAws_json1_1ResourceConfig(input.ResourceConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StaticHyperParameters !== undefined && { - StaticHyperParameters: serializeAws_json1_1HyperParameters(input.StaticHyperParameters, context), - }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1StoppingCondition(input.StoppingCondition, context), - }), - ...(input.TuningObjective !== undefined && { - TuningObjective: serializeAws_json1_1HyperParameterTuningJobObjective(input.TuningObjective, context), - }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.AlgorithmSpecification !== undefined && + input.AlgorithmSpecification !== null && { + AlgorithmSpecification: serializeAws_json1_1HyperParameterAlgorithmSpecification( + input.AlgorithmSpecification, + context + ), + }), + ...(input.CheckpointConfig !== undefined && + input.CheckpointConfig !== null && { + CheckpointConfig: serializeAws_json1_1CheckpointConfig(input.CheckpointConfig, context), + }), + ...(input.DefinitionName !== undefined && + input.DefinitionName !== null && { DefinitionName: input.DefinitionName }), + ...(input.EnableInterContainerTrafficEncryption !== undefined && + input.EnableInterContainerTrafficEncryption !== null && { + EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, + }), + ...(input.EnableManagedSpotTraining !== undefined && + input.EnableManagedSpotTraining !== null && { EnableManagedSpotTraining: input.EnableManagedSpotTraining }), + ...(input.EnableNetworkIsolation !== undefined && + input.EnableNetworkIsolation !== null && { EnableNetworkIsolation: input.EnableNetworkIsolation }), + ...(input.HyperParameterRanges !== undefined && + input.HyperParameterRanges !== null && { + HyperParameterRanges: serializeAws_json1_1ParameterRanges(input.HyperParameterRanges, context), + }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + ResourceConfig: serializeAws_json1_1ResourceConfig(input.ResourceConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StaticHyperParameters !== undefined && + input.StaticHyperParameters !== null && { + StaticHyperParameters: serializeAws_json1_1HyperParameters(input.StaticHyperParameters, context), + }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1StoppingCondition(input.StoppingCondition, context), + }), + ...(input.TuningObjective !== undefined && + input.TuningObjective !== null && { + TuningObjective: serializeAws_json1_1HyperParameterTuningJobObjective(input.TuningObjective, context), + }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -19508,7 +19831,14 @@ const serializeAws_json1_1HyperParameterTrainingJobDefinitions = ( input: HyperParameterTrainingJobDefinition[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1HyperParameterTrainingJobDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1HyperParameterTrainingJobDefinition(entry, context); + }); }; const serializeAws_json1_1HyperParameterTuningJobConfig = ( @@ -19516,28 +19846,33 @@ const serializeAws_json1_1HyperParameterTuningJobConfig = ( context: __SerdeContext ): any => { return { - ...(input.HyperParameterTuningJobObjective !== undefined && { - HyperParameterTuningJobObjective: serializeAws_json1_1HyperParameterTuningJobObjective( - input.HyperParameterTuningJobObjective, - context - ), - }), - ...(input.ParameterRanges !== undefined && { - ParameterRanges: serializeAws_json1_1ParameterRanges(input.ParameterRanges, context), - }), - ...(input.ResourceLimits !== undefined && { - ResourceLimits: serializeAws_json1_1ResourceLimits(input.ResourceLimits, context), - }), - ...(input.Strategy !== undefined && { Strategy: input.Strategy }), - ...(input.TrainingJobEarlyStoppingType !== undefined && { - TrainingJobEarlyStoppingType: input.TrainingJobEarlyStoppingType, - }), - ...(input.TuningJobCompletionCriteria !== undefined && { - TuningJobCompletionCriteria: serializeAws_json1_1TuningJobCompletionCriteria( - input.TuningJobCompletionCriteria, - context - ), - }), + ...(input.HyperParameterTuningJobObjective !== undefined && + input.HyperParameterTuningJobObjective !== null && { + HyperParameterTuningJobObjective: serializeAws_json1_1HyperParameterTuningJobObjective( + input.HyperParameterTuningJobObjective, + context + ), + }), + ...(input.ParameterRanges !== undefined && + input.ParameterRanges !== null && { + ParameterRanges: serializeAws_json1_1ParameterRanges(input.ParameterRanges, context), + }), + ...(input.ResourceLimits !== undefined && + input.ResourceLimits !== null && { + ResourceLimits: serializeAws_json1_1ResourceLimits(input.ResourceLimits, context), + }), + ...(input.Strategy !== undefined && input.Strategy !== null && { Strategy: input.Strategy }), + ...(input.TrainingJobEarlyStoppingType !== undefined && + input.TrainingJobEarlyStoppingType !== null && { + TrainingJobEarlyStoppingType: input.TrainingJobEarlyStoppingType, + }), + ...(input.TuningJobCompletionCriteria !== undefined && + input.TuningJobCompletionCriteria !== null && { + TuningJobCompletionCriteria: serializeAws_json1_1TuningJobCompletionCriteria( + input.TuningJobCompletionCriteria, + context + ), + }), }; }; @@ -19546,8 +19881,8 @@ const serializeAws_json1_1HyperParameterTuningJobObjective = ( context: __SerdeContext ): any => { return { - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -19555,7 +19890,14 @@ const serializeAws_json1_1HyperParameterTuningJobObjectives = ( input: HyperParameterTuningJobObjective[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1HyperParameterTuningJobObjective(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1HyperParameterTuningJobObjective(entry, context); + }); }; const serializeAws_json1_1HyperParameterTuningJobWarmStartConfig = ( @@ -19563,79 +19905,115 @@ const serializeAws_json1_1HyperParameterTuningJobWarmStartConfig = ( context: __SerdeContext ): any => { return { - ...(input.ParentHyperParameterTuningJobs !== undefined && { - ParentHyperParameterTuningJobs: serializeAws_json1_1ParentHyperParameterTuningJobs( - input.ParentHyperParameterTuningJobs, - context - ), - }), - ...(input.WarmStartType !== undefined && { WarmStartType: input.WarmStartType }), + ...(input.ParentHyperParameterTuningJobs !== undefined && + input.ParentHyperParameterTuningJobs !== null && { + ParentHyperParameterTuningJobs: serializeAws_json1_1ParentHyperParameterTuningJobs( + input.ParentHyperParameterTuningJobs, + context + ), + }), + ...(input.WarmStartType !== undefined && input.WarmStartType !== null && { WarmStartType: input.WarmStartType }), }; }; const serializeAws_json1_1ImageConfig = (input: ImageConfig, context: __SerdeContext): any => { return { - ...(input.RepositoryAccessMode !== undefined && { RepositoryAccessMode: input.RepositoryAccessMode }), + ...(input.RepositoryAccessMode !== undefined && + input.RepositoryAccessMode !== null && { RepositoryAccessMode: input.RepositoryAccessMode }), }; }; const serializeAws_json1_1ImageDeletePropertyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InferenceSpecification = (input: InferenceSpecification, context: __SerdeContext): any => { return { - ...(input.Containers !== undefined && { - Containers: serializeAws_json1_1ModelPackageContainerDefinitionList(input.Containers, context), - }), - ...(input.SupportedContentTypes !== undefined && { - SupportedContentTypes: serializeAws_json1_1ContentTypes(input.SupportedContentTypes, context), - }), - ...(input.SupportedRealtimeInferenceInstanceTypes !== undefined && { - SupportedRealtimeInferenceInstanceTypes: serializeAws_json1_1RealtimeInferenceInstanceTypes( - input.SupportedRealtimeInferenceInstanceTypes, - context - ), - }), - ...(input.SupportedResponseMIMETypes !== undefined && { - SupportedResponseMIMETypes: serializeAws_json1_1ResponseMIMETypes(input.SupportedResponseMIMETypes, context), - }), - ...(input.SupportedTransformInstanceTypes !== undefined && { - SupportedTransformInstanceTypes: serializeAws_json1_1TransformInstanceTypes( - input.SupportedTransformInstanceTypes, - context - ), - }), + ...(input.Containers !== undefined && + input.Containers !== null && { + Containers: serializeAws_json1_1ModelPackageContainerDefinitionList(input.Containers, context), + }), + ...(input.SupportedContentTypes !== undefined && + input.SupportedContentTypes !== null && { + SupportedContentTypes: serializeAws_json1_1ContentTypes(input.SupportedContentTypes, context), + }), + ...(input.SupportedRealtimeInferenceInstanceTypes !== undefined && + input.SupportedRealtimeInferenceInstanceTypes !== null && { + SupportedRealtimeInferenceInstanceTypes: serializeAws_json1_1RealtimeInferenceInstanceTypes( + input.SupportedRealtimeInferenceInstanceTypes, + context + ), + }), + ...(input.SupportedResponseMIMETypes !== undefined && + input.SupportedResponseMIMETypes !== null && { + SupportedResponseMIMETypes: serializeAws_json1_1ResponseMIMETypes(input.SupportedResponseMIMETypes, context), + }), + ...(input.SupportedTransformInstanceTypes !== undefined && + input.SupportedTransformInstanceTypes !== null && { + SupportedTransformInstanceTypes: serializeAws_json1_1TransformInstanceTypes( + input.SupportedTransformInstanceTypes, + context + ), + }), }; }; const serializeAws_json1_1InputConfig = (input: InputConfig, context: __SerdeContext): any => { return { - ...(input.DataInputConfig !== undefined && { DataInputConfig: input.DataInputConfig }), - ...(input.Framework !== undefined && { Framework: input.Framework }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.DataInputConfig !== undefined && + input.DataInputConfig !== null && { DataInputConfig: input.DataInputConfig }), + ...(input.Framework !== undefined && input.Framework !== null && { Framework: input.Framework }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1InputDataConfig = (input: Channel[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Channel(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Channel(entry, context); + }); }; const serializeAws_json1_1InputModes = (input: (TrainingInputMode | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IntegerParameterRange = (input: IntegerParameterRange, context: __SerdeContext): any => { return { - ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), - ...(input.MinValue !== undefined && { MinValue: input.MinValue }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ScalingType !== undefined && { ScalingType: input.ScalingType }), + ...(input.MaxValue !== undefined && input.MaxValue !== null && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && input.MinValue !== null && { MinValue: input.MinValue }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ScalingType !== undefined && input.ScalingType !== null && { ScalingType: input.ScalingType }), }; }; const serializeAws_json1_1IntegerParameterRanges = (input: IntegerParameterRange[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1IntegerParameterRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1IntegerParameterRange(entry, context); + }); }; const serializeAws_json1_1IntegerParameterRangeSpecification = ( @@ -19643,13 +20021,20 @@ const serializeAws_json1_1IntegerParameterRangeSpecification = ( context: __SerdeContext ): any => { return { - ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), - ...(input.MinValue !== undefined && { MinValue: input.MinValue }), + ...(input.MaxValue !== undefined && input.MaxValue !== null && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && input.MinValue !== null && { MinValue: input.MinValue }), }; }; const serializeAws_json1_1JsonContentTypes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1JupyterServerAppSettings = ( @@ -19657,9 +20042,10 @@ const serializeAws_json1_1JupyterServerAppSettings = ( context: __SerdeContext ): any => { return { - ...(input.DefaultResourceSpec !== undefined && { - DefaultResourceSpec: serializeAws_json1_1ResourceSpec(input.DefaultResourceSpec, context), - }), + ...(input.DefaultResourceSpec !== undefined && + input.DefaultResourceSpec !== null && { + DefaultResourceSpec: serializeAws_json1_1ResourceSpec(input.DefaultResourceSpec, context), + }), }; }; @@ -19668,12 +20054,12 @@ const serializeAws_json1_1KernelGatewayAppSettings = ( context: __SerdeContext ): any => { return { - ...(input.CustomImages !== undefined && { - CustomImages: serializeAws_json1_1CustomImages(input.CustomImages, context), - }), - ...(input.DefaultResourceSpec !== undefined && { - DefaultResourceSpec: serializeAws_json1_1ResourceSpec(input.DefaultResourceSpec, context), - }), + ...(input.CustomImages !== undefined && + input.CustomImages !== null && { CustomImages: serializeAws_json1_1CustomImages(input.CustomImages, context) }), + ...(input.DefaultResourceSpec !== undefined && + input.DefaultResourceSpec !== null && { + DefaultResourceSpec: serializeAws_json1_1ResourceSpec(input.DefaultResourceSpec, context), + }), }; }; @@ -19682,24 +20068,31 @@ const serializeAws_json1_1KernelGatewayImageConfig = ( context: __SerdeContext ): any => { return { - ...(input.FileSystemConfig !== undefined && { - FileSystemConfig: serializeAws_json1_1FileSystemConfig(input.FileSystemConfig, context), - }), - ...(input.KernelSpecs !== undefined && { - KernelSpecs: serializeAws_json1_1KernelSpecs(input.KernelSpecs, context), - }), + ...(input.FileSystemConfig !== undefined && + input.FileSystemConfig !== null && { + FileSystemConfig: serializeAws_json1_1FileSystemConfig(input.FileSystemConfig, context), + }), + ...(input.KernelSpecs !== undefined && + input.KernelSpecs !== null && { KernelSpecs: serializeAws_json1_1KernelSpecs(input.KernelSpecs, context) }), }; }; const serializeAws_json1_1KernelSpec = (input: KernelSpec, context: __SerdeContext): any => { return { - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1KernelSpecs = (input: KernelSpec[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1KernelSpec(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1KernelSpec(entry, context); + }); }; const serializeAws_json1_1LabelingJobAlgorithmsConfig = ( @@ -19707,18 +20100,21 @@ const serializeAws_json1_1LabelingJobAlgorithmsConfig = ( context: __SerdeContext ): any => { return { - ...(input.InitialActiveLearningModelArn !== undefined && { - InitialActiveLearningModelArn: input.InitialActiveLearningModelArn, - }), - ...(input.LabelingJobAlgorithmSpecificationArn !== undefined && { - LabelingJobAlgorithmSpecificationArn: input.LabelingJobAlgorithmSpecificationArn, - }), - ...(input.LabelingJobResourceConfig !== undefined && { - LabelingJobResourceConfig: serializeAws_json1_1LabelingJobResourceConfig( - input.LabelingJobResourceConfig, - context - ), - }), + ...(input.InitialActiveLearningModelArn !== undefined && + input.InitialActiveLearningModelArn !== null && { + InitialActiveLearningModelArn: input.InitialActiveLearningModelArn, + }), + ...(input.LabelingJobAlgorithmSpecificationArn !== undefined && + input.LabelingJobAlgorithmSpecificationArn !== null && { + LabelingJobAlgorithmSpecificationArn: input.LabelingJobAlgorithmSpecificationArn, + }), + ...(input.LabelingJobResourceConfig !== undefined && + input.LabelingJobResourceConfig !== null && { + LabelingJobResourceConfig: serializeAws_json1_1LabelingJobResourceConfig( + input.LabelingJobResourceConfig, + context + ), + }), }; }; @@ -19727,39 +20123,44 @@ const serializeAws_json1_1LabelingJobDataAttributes = ( context: __SerdeContext ): any => { return { - ...(input.ContentClassifiers !== undefined && { - ContentClassifiers: serializeAws_json1_1ContentClassifiers(input.ContentClassifiers, context), - }), + ...(input.ContentClassifiers !== undefined && + input.ContentClassifiers !== null && { + ContentClassifiers: serializeAws_json1_1ContentClassifiers(input.ContentClassifiers, context), + }), }; }; const serializeAws_json1_1LabelingJobDataSource = (input: LabelingJobDataSource, context: __SerdeContext): any => { return { - ...(input.S3DataSource !== undefined && { - S3DataSource: serializeAws_json1_1LabelingJobS3DataSource(input.S3DataSource, context), - }), - ...(input.SnsDataSource !== undefined && { - SnsDataSource: serializeAws_json1_1LabelingJobSnsDataSource(input.SnsDataSource, context), - }), + ...(input.S3DataSource !== undefined && + input.S3DataSource !== null && { + S3DataSource: serializeAws_json1_1LabelingJobS3DataSource(input.S3DataSource, context), + }), + ...(input.SnsDataSource !== undefined && + input.SnsDataSource !== null && { + SnsDataSource: serializeAws_json1_1LabelingJobSnsDataSource(input.SnsDataSource, context), + }), }; }; const serializeAws_json1_1LabelingJobInputConfig = (input: LabelingJobInputConfig, context: __SerdeContext): any => { return { - ...(input.DataAttributes !== undefined && { - DataAttributes: serializeAws_json1_1LabelingJobDataAttributes(input.DataAttributes, context), - }), - ...(input.DataSource !== undefined && { - DataSource: serializeAws_json1_1LabelingJobDataSource(input.DataSource, context), - }), + ...(input.DataAttributes !== undefined && + input.DataAttributes !== null && { + DataAttributes: serializeAws_json1_1LabelingJobDataAttributes(input.DataAttributes, context), + }), + ...(input.DataSource !== undefined && + input.DataSource !== null && { + DataSource: serializeAws_json1_1LabelingJobDataSource(input.DataSource, context), + }), }; }; const serializeAws_json1_1LabelingJobOutputConfig = (input: LabelingJobOutputConfig, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), - ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), + ...(input.SnsTopicArn !== undefined && input.SnsTopicArn !== null && { SnsTopicArn: input.SnsTopicArn }), }; }; @@ -19768,13 +20169,14 @@ const serializeAws_json1_1LabelingJobResourceConfig = ( context: __SerdeContext ): any => { return { - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), }; }; const serializeAws_json1_1LabelingJobS3DataSource = (input: LabelingJobS3DataSource, context: __SerdeContext): any => { return { - ...(input.ManifestS3Uri !== undefined && { ManifestS3Uri: input.ManifestS3Uri }), + ...(input.ManifestS3Uri !== undefined && input.ManifestS3Uri !== null && { ManifestS3Uri: input.ManifestS3Uri }), }; }; @@ -19783,7 +20185,7 @@ const serializeAws_json1_1LabelingJobSnsDataSource = ( context: __SerdeContext ): any => { return { - ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), + ...(input.SnsTopicArn !== undefined && input.SnsTopicArn !== null && { SnsTopicArn: input.SnsTopicArn }), }; }; @@ -19792,12 +20194,12 @@ const serializeAws_json1_1LabelingJobStoppingConditions = ( context: __SerdeContext ): any => { return { - ...(input.MaxHumanLabeledObjectCount !== undefined && { - MaxHumanLabeledObjectCount: input.MaxHumanLabeledObjectCount, - }), - ...(input.MaxPercentageOfInputDatasetLabeled !== undefined && { - MaxPercentageOfInputDatasetLabeled: input.MaxPercentageOfInputDatasetLabeled, - }), + ...(input.MaxHumanLabeledObjectCount !== undefined && + input.MaxHumanLabeledObjectCount !== null && { MaxHumanLabeledObjectCount: input.MaxHumanLabeledObjectCount }), + ...(input.MaxPercentageOfInputDatasetLabeled !== undefined && + input.MaxPercentageOfInputDatasetLabeled !== null && { + MaxPercentageOfInputDatasetLabeled: input.MaxPercentageOfInputDatasetLabeled, + }), }; }; @@ -19805,41 +20207,45 @@ const serializeAws_json1_1LineageEntityParameters = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ListActionsRequest = (input: ListActionsRequest, context: __SerdeContext): any => { return { - ...(input.ActionType !== undefined && { ActionType: input.ActionType }), - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.SourceUri !== undefined && { SourceUri: input.SourceUri }), + ...(input.ActionType !== undefined && input.ActionType !== null && { ActionType: input.ActionType }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.SourceUri !== undefined && input.SourceUri !== null && { SourceUri: input.SourceUri }), }; }; const serializeAws_json1_1ListAlgorithmsInput = (input: ListAlgorithmsInput, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -19848,86 +20254,97 @@ const serializeAws_json1_1ListAppImageConfigsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.ModifiedTimeAfter !== undefined && { - ModifiedTimeAfter: Math.round(input.ModifiedTimeAfter.getTime() / 1000), - }), - ...(input.ModifiedTimeBefore !== undefined && { - ModifiedTimeBefore: Math.round(input.ModifiedTimeBefore.getTime() / 1000), - }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.ModifiedTimeAfter !== undefined && + input.ModifiedTimeAfter !== null && { ModifiedTimeAfter: Math.round(input.ModifiedTimeAfter.getTime() / 1000) }), + ...(input.ModifiedTimeBefore !== undefined && + input.ModifiedTimeBefore !== null && { + ModifiedTimeBefore: Math.round(input.ModifiedTimeBefore.getTime() / 1000), + }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1ListAppsRequest = (input: ListAppsRequest, context: __SerdeContext): any => { return { - ...(input.DomainIdEquals !== undefined && { DomainIdEquals: input.DomainIdEquals }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.UserProfileNameEquals !== undefined && { UserProfileNameEquals: input.UserProfileNameEquals }), + ...(input.DomainIdEquals !== undefined && + input.DomainIdEquals !== null && { DomainIdEquals: input.DomainIdEquals }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.UserProfileNameEquals !== undefined && + input.UserProfileNameEquals !== null && { UserProfileNameEquals: input.UserProfileNameEquals }), }; }; const serializeAws_json1_1ListArtifactsRequest = (input: ListArtifactsRequest, context: __SerdeContext): any => { return { - ...(input.ArtifactType !== undefined && { ArtifactType: input.ArtifactType }), - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.SourceUri !== undefined && { SourceUri: input.SourceUri }), + ...(input.ArtifactType !== undefined && input.ArtifactType !== null && { ArtifactType: input.ArtifactType }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.SourceUri !== undefined && input.SourceUri !== null && { SourceUri: input.SourceUri }), }; }; const serializeAws_json1_1ListAssociationsRequest = (input: ListAssociationsRequest, context: __SerdeContext): any => { return { - ...(input.AssociationType !== undefined && { AssociationType: input.AssociationType }), - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.DestinationArn !== undefined && { DestinationArn: input.DestinationArn }), - ...(input.DestinationType !== undefined && { DestinationType: input.DestinationType }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.SourceArn !== undefined && { SourceArn: input.SourceArn }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), + ...(input.AssociationType !== undefined && + input.AssociationType !== null && { AssociationType: input.AssociationType }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.DestinationArn !== undefined && + input.DestinationArn !== null && { DestinationArn: input.DestinationArn }), + ...(input.DestinationType !== undefined && + input.DestinationType !== null && { DestinationType: input.DestinationType }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.SourceArn !== undefined && input.SourceArn !== null && { SourceArn: input.SourceArn }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), }; }; const serializeAws_json1_1ListAutoMLJobsRequest = (input: ListAutoMLJobsRequest, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; @@ -19936,13 +20353,14 @@ const serializeAws_json1_1ListCandidatesForAutoMLJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.AutoMLJobName !== undefined && { AutoMLJobName: input.AutoMLJobName }), - ...(input.CandidateNameEquals !== undefined && { CandidateNameEquals: input.CandidateNameEquals }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.AutoMLJobName !== undefined && input.AutoMLJobName !== null && { AutoMLJobName: input.AutoMLJobName }), + ...(input.CandidateNameEquals !== undefined && + input.CandidateNameEquals !== null && { CandidateNameEquals: input.CandidateNameEquals }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; @@ -19951,23 +20369,25 @@ const serializeAws_json1_1ListCodeRepositoriesInput = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -19976,37 +20396,41 @@ const serializeAws_json1_1ListCompilationJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; const serializeAws_json1_1ListContextsRequest = (input: ListContextsRequest, context: __SerdeContext): any => { return { - ...(input.ContextType !== undefined && { ContextType: input.ContextType }), - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.SourceUri !== undefined && { SourceUri: input.SourceUri }), + ...(input.ContextType !== undefined && input.ContextType !== null && { ContextType: input.ContextType }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.SourceUri !== undefined && input.SourceUri !== null && { SourceUri: input.SourceUri }), }; }; @@ -20015,59 +20439,63 @@ const serializeAws_json1_1ListDataQualityJobDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1ListDeviceFleetsRequest = (input: ListDeviceFleetsRequest, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1ListDevicesRequest = (input: ListDevicesRequest, context: __SerdeContext): any => { return { - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), - ...(input.LatestHeartbeatAfter !== undefined && { - LatestHeartbeatAfter: Math.round(input.LatestHeartbeatAfter.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), + ...(input.LatestHeartbeatAfter !== undefined && + input.LatestHeartbeatAfter !== null && { + LatestHeartbeatAfter: Math.round(input.LatestHeartbeatAfter.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListDomainsRequest = (input: ListDomainsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -20076,25 +20504,28 @@ const serializeAws_json1_1ListEdgePackagingJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.ModelNameContains !== undefined && { ModelNameContains: input.ModelNameContains }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.ModelNameContains !== undefined && + input.ModelNameContains !== null && { ModelNameContains: input.ModelNameContains }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; @@ -20103,51 +20534,55 @@ const serializeAws_json1_1ListEndpointConfigsInput = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1ListEndpointsInput = (input: ListEndpointsInput, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; const serializeAws_json1_1ListExperimentsRequest = (input: ListExperimentsRequest, context: __SerdeContext): any => { return { - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20156,19 +20591,21 @@ const serializeAws_json1_1ListFeatureGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.FeatureGroupStatusEquals !== undefined && { FeatureGroupStatusEquals: input.FeatureGroupStatusEquals }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OfflineStoreStatusEquals !== undefined && { OfflineStoreStatusEquals: input.OfflineStoreStatusEquals }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.FeatureGroupStatusEquals !== undefined && + input.FeatureGroupStatusEquals !== null && { FeatureGroupStatusEquals: input.FeatureGroupStatusEquals }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OfflineStoreStatusEquals !== undefined && + input.OfflineStoreStatusEquals !== null && { OfflineStoreStatusEquals: input.OfflineStoreStatusEquals }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20177,29 +20614,29 @@ const serializeAws_json1_1ListFlowDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1ListHumanTaskUisRequest = (input: ListHumanTaskUisRequest, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20208,46 +20645,50 @@ const serializeAws_json1_1ListHyperParameterTuningJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; const serializeAws_json1_1ListImagesRequest = (input: ListImagesRequest, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20256,23 +20697,25 @@ const serializeAws_json1_1ListImageVersionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20281,46 +20724,56 @@ const serializeAws_json1_1ListLabelingJobsForWorkteamRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.JobReferenceCodeContains !== undefined && { JobReferenceCodeContains: input.JobReferenceCodeContains }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.WorkteamArn !== undefined && { WorkteamArn: input.WorkteamArn }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.JobReferenceCodeContains !== undefined && + input.JobReferenceCodeContains !== null && { JobReferenceCodeContains: input.JobReferenceCodeContains }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.WorkteamArn !== undefined && input.WorkteamArn !== null && { WorkteamArn: input.WorkteamArn }), }; }; const serializeAws_json1_1ListLabelingJobsRequest = (input: ListLabelingJobsRequest, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; const serializeAws_json1_1ListLineageEntityParameterKey = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListModelBiasJobDefinitionsRequest = ( @@ -20328,18 +20781,18 @@ const serializeAws_json1_1ListModelBiasJobDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20348,18 +20801,18 @@ const serializeAws_json1_1ListModelExplainabilityJobDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20368,36 +20821,39 @@ const serializeAws_json1_1ListModelPackageGroupsInput = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1ListModelPackagesInput = (input: ListModelPackagesInput, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.ModelApprovalStatus !== undefined && { ModelApprovalStatus: input.ModelApprovalStatus }), - ...(input.ModelPackageGroupName !== undefined && { ModelPackageGroupName: input.ModelPackageGroupName }), - ...(input.ModelPackageType !== undefined && { ModelPackageType: input.ModelPackageType }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.ModelApprovalStatus !== undefined && + input.ModelApprovalStatus !== null && { ModelApprovalStatus: input.ModelApprovalStatus }), + ...(input.ModelPackageGroupName !== undefined && + input.ModelPackageGroupName !== null && { ModelPackageGroupName: input.ModelPackageGroupName }), + ...(input.ModelPackageType !== undefined && + input.ModelPackageType !== null && { ModelPackageType: input.ModelPackageType }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20406,34 +20862,34 @@ const serializeAws_json1_1ListModelQualityJobDefinitionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1ListModelsInput = (input: ListModelsInput, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20442,35 +20898,40 @@ const serializeAws_json1_1ListMonitoringExecutionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MonitoringJobDefinitionName !== undefined && { - MonitoringJobDefinitionName: input.MonitoringJobDefinitionName, - }), - ...(input.MonitoringScheduleName !== undefined && { MonitoringScheduleName: input.MonitoringScheduleName }), - ...(input.MonitoringTypeEquals !== undefined && { MonitoringTypeEquals: input.MonitoringTypeEquals }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ScheduledTimeAfter !== undefined && { - ScheduledTimeAfter: Math.round(input.ScheduledTimeAfter.getTime() / 1000), - }), - ...(input.ScheduledTimeBefore !== undefined && { - ScheduledTimeBefore: Math.round(input.ScheduledTimeBefore.getTime() / 1000), - }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MonitoringJobDefinitionName !== undefined && + input.MonitoringJobDefinitionName !== null && { MonitoringJobDefinitionName: input.MonitoringJobDefinitionName }), + ...(input.MonitoringScheduleName !== undefined && + input.MonitoringScheduleName !== null && { MonitoringScheduleName: input.MonitoringScheduleName }), + ...(input.MonitoringTypeEquals !== undefined && + input.MonitoringTypeEquals !== null && { MonitoringTypeEquals: input.MonitoringTypeEquals }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ScheduledTimeAfter !== undefined && + input.ScheduledTimeAfter !== null && { + ScheduledTimeAfter: Math.round(input.ScheduledTimeAfter.getTime() / 1000), + }), + ...(input.ScheduledTimeBefore !== undefined && + input.ScheduledTimeBefore !== null && { + ScheduledTimeBefore: Math.round(input.ScheduledTimeBefore.getTime() / 1000), + }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; @@ -20479,29 +20940,31 @@ const serializeAws_json1_1ListMonitoringSchedulesRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.MonitoringJobDefinitionName !== undefined && { - MonitoringJobDefinitionName: input.MonitoringJobDefinitionName, - }), - ...(input.MonitoringTypeEquals !== undefined && { MonitoringTypeEquals: input.MonitoringTypeEquals }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.MonitoringJobDefinitionName !== undefined && + input.MonitoringJobDefinitionName !== null && { MonitoringJobDefinitionName: input.MonitoringJobDefinitionName }), + ...(input.MonitoringTypeEquals !== undefined && + input.MonitoringTypeEquals !== null && { MonitoringTypeEquals: input.MonitoringTypeEquals }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; @@ -20510,23 +20973,25 @@ const serializeAws_json1_1ListNotebookInstanceLifecycleConfigsInput = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20535,33 +21000,38 @@ const serializeAws_json1_1ListNotebookInstancesInput = ( context: __SerdeContext ): any => { return { - ...(input.AdditionalCodeRepositoryEquals !== undefined && { - AdditionalCodeRepositoryEquals: input.AdditionalCodeRepositoryEquals, - }), - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.DefaultCodeRepositoryContains !== undefined && { - DefaultCodeRepositoryContains: input.DefaultCodeRepositoryContains, - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.NotebookInstanceLifecycleConfigNameContains !== undefined && { - NotebookInstanceLifecycleConfigNameContains: input.NotebookInstanceLifecycleConfigNameContains, - }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.AdditionalCodeRepositoryEquals !== undefined && + input.AdditionalCodeRepositoryEquals !== null && { + AdditionalCodeRepositoryEquals: input.AdditionalCodeRepositoryEquals, + }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.DefaultCodeRepositoryContains !== undefined && + input.DefaultCodeRepositoryContains !== null && { + DefaultCodeRepositoryContains: input.DefaultCodeRepositoryContains, + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.NotebookInstanceLifecycleConfigNameContains !== undefined && + input.NotebookInstanceLifecycleConfigNameContains !== null && { + NotebookInstanceLifecycleConfigNameContains: input.NotebookInstanceLifecycleConfigNameContains, + }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; @@ -20570,13 +21040,15 @@ const serializeAws_json1_1ListPipelineExecutionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PipelineName !== undefined && { PipelineName: input.PipelineName }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PipelineName !== undefined && input.PipelineName !== null && { PipelineName: input.PipelineName }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20585,10 +21057,11 @@ const serializeAws_json1_1ListPipelineExecutionStepsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PipelineExecutionArn !== undefined && { PipelineExecutionArn: input.PipelineExecutionArn }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PipelineExecutionArn !== undefined && + input.PipelineExecutionArn !== null && { PipelineExecutionArn: input.PipelineExecutionArn }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20597,21 +21070,25 @@ const serializeAws_json1_1ListPipelineParametersForExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PipelineExecutionArn !== undefined && { PipelineExecutionArn: input.PipelineExecutionArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PipelineExecutionArn !== undefined && + input.PipelineExecutionArn !== null && { PipelineExecutionArn: input.PipelineExecutionArn }), }; }; const serializeAws_json1_1ListPipelinesRequest = (input: ListPipelinesRequest, context: __SerdeContext): any => { return { - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PipelineNamePrefix !== undefined && { PipelineNamePrefix: input.PipelineNamePrefix }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PipelineNamePrefix !== undefined && + input.PipelineNamePrefix !== null && { PipelineNamePrefix: input.PipelineNamePrefix }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20620,40 +21097,42 @@ const serializeAws_json1_1ListProcessingJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; const serializeAws_json1_1ListProjectsInput = (input: ListProjectsInput, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -20662,17 +21141,17 @@ const serializeAws_json1_1ListSubscribedWorkteamsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListTagsInput = (input: ListTagsInput, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -20681,37 +21160,38 @@ const serializeAws_json1_1ListTrainingJobsForHyperParameterTuningJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.HyperParameterTuningJobName !== undefined && { - HyperParameterTuningJobName: input.HyperParameterTuningJobName, - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.HyperParameterTuningJobName !== undefined && + input.HyperParameterTuningJobName !== null && { HyperParameterTuningJobName: input.HyperParameterTuningJobName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; const serializeAws_json1_1ListTrainingJobsRequest = (input: ListTrainingJobsRequest, context: __SerdeContext): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; @@ -20720,29 +21200,38 @@ const serializeAws_json1_1ListTransformJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreationTimeAfter !== undefined && { - CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000), - }), - ...(input.CreationTimeBefore !== undefined && { - CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), - }), - ...(input.LastModifiedTimeAfter !== undefined && { - LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), - }), - ...(input.LastModifiedTimeBefore !== undefined && { - LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.CreationTimeAfter !== undefined && + input.CreationTimeAfter !== null && { CreationTimeAfter: Math.round(input.CreationTimeAfter.getTime() / 1000) }), + ...(input.CreationTimeBefore !== undefined && + input.CreationTimeBefore !== null && { + CreationTimeBefore: Math.round(input.CreationTimeBefore.getTime() / 1000), + }), + ...(input.LastModifiedTimeAfter !== undefined && + input.LastModifiedTimeAfter !== null && { + LastModifiedTimeAfter: Math.round(input.LastModifiedTimeAfter.getTime() / 1000), + }), + ...(input.LastModifiedTimeBefore !== undefined && + input.LastModifiedTimeBefore !== null && { + LastModifiedTimeBefore: Math.round(input.LastModifiedTimeBefore.getTime() / 1000), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; const serializeAws_json1_1ListTrialComponentKey256 = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListTrialComponentsRequest = ( @@ -20750,102 +21239,127 @@ const serializeAws_json1_1ListTrialComponentsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.ExperimentName !== undefined && { ExperimentName: input.ExperimentName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.SourceArn !== undefined && { SourceArn: input.SourceArn }), - ...(input.TrialName !== undefined && { TrialName: input.TrialName }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.ExperimentName !== undefined && + input.ExperimentName !== null && { ExperimentName: input.ExperimentName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.SourceArn !== undefined && input.SourceArn !== null && { SourceArn: input.SourceArn }), + ...(input.TrialName !== undefined && input.TrialName !== null && { TrialName: input.TrialName }), }; }; const serializeAws_json1_1ListTrialsRequest = (input: ListTrialsRequest, context: __SerdeContext): any => { return { - ...(input.CreatedAfter !== undefined && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), - ...(input.CreatedBefore !== undefined && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), - ...(input.ExperimentName !== undefined && { ExperimentName: input.ExperimentName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.TrialComponentName !== undefined && { TrialComponentName: input.TrialComponentName }), + ...(input.CreatedAfter !== undefined && + input.CreatedAfter !== null && { CreatedAfter: Math.round(input.CreatedAfter.getTime() / 1000) }), + ...(input.CreatedBefore !== undefined && + input.CreatedBefore !== null && { CreatedBefore: Math.round(input.CreatedBefore.getTime() / 1000) }), + ...(input.ExperimentName !== undefined && + input.ExperimentName !== null && { ExperimentName: input.ExperimentName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.TrialComponentName !== undefined && + input.TrialComponentName !== null && { TrialComponentName: input.TrialComponentName }), }; }; const serializeAws_json1_1ListUserProfilesRequest = (input: ListUserProfilesRequest, context: __SerdeContext): any => { return { - ...(input.DomainIdEquals !== undefined && { DomainIdEquals: input.DomainIdEquals }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), - ...(input.UserProfileNameContains !== undefined && { UserProfileNameContains: input.UserProfileNameContains }), + ...(input.DomainIdEquals !== undefined && + input.DomainIdEquals !== null && { DomainIdEquals: input.DomainIdEquals }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), + ...(input.UserProfileNameContains !== undefined && + input.UserProfileNameContains !== null && { UserProfileNameContains: input.UserProfileNameContains }), }; }; const serializeAws_json1_1ListWorkforcesRequest = (input: ListWorkforcesRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1ListWorkteamsRequest = (input: ListWorkteamsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1MemberDefinition = (input: MemberDefinition, context: __SerdeContext): any => { return { - ...(input.CognitoMemberDefinition !== undefined && { - CognitoMemberDefinition: serializeAws_json1_1CognitoMemberDefinition(input.CognitoMemberDefinition, context), - }), - ...(input.OidcMemberDefinition !== undefined && { - OidcMemberDefinition: serializeAws_json1_1OidcMemberDefinition(input.OidcMemberDefinition, context), - }), + ...(input.CognitoMemberDefinition !== undefined && + input.CognitoMemberDefinition !== null && { + CognitoMemberDefinition: serializeAws_json1_1CognitoMemberDefinition(input.CognitoMemberDefinition, context), + }), + ...(input.OidcMemberDefinition !== undefined && + input.OidcMemberDefinition !== null && { + OidcMemberDefinition: serializeAws_json1_1OidcMemberDefinition(input.OidcMemberDefinition, context), + }), }; }; const serializeAws_json1_1MemberDefinitions = (input: MemberDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MemberDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MemberDefinition(entry, context); + }); }; const serializeAws_json1_1MetadataProperties = (input: MetadataProperties, context: __SerdeContext): any => { return { - ...(input.CommitId !== undefined && { CommitId: input.CommitId }), - ...(input.GeneratedBy !== undefined && { GeneratedBy: input.GeneratedBy }), - ...(input.ProjectId !== undefined && { ProjectId: input.ProjectId }), - ...(input.Repository !== undefined && { Repository: input.Repository }), + ...(input.CommitId !== undefined && input.CommitId !== null && { CommitId: input.CommitId }), + ...(input.GeneratedBy !== undefined && input.GeneratedBy !== null && { GeneratedBy: input.GeneratedBy }), + ...(input.ProjectId !== undefined && input.ProjectId !== null && { ProjectId: input.ProjectId }), + ...(input.Repository !== undefined && input.Repository !== null && { Repository: input.Repository }), }; }; const serializeAws_json1_1MetricDefinition = (input: MetricDefinition, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Regex !== undefined && { Regex: input.Regex }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Regex !== undefined && input.Regex !== null && { Regex: input.Regex }), }; }; const serializeAws_json1_1MetricDefinitionList = (input: MetricDefinition[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MetricDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MetricDefinition(entry, context); + }); }; const serializeAws_json1_1MetricsSource = (input: MetricsSource, context: __SerdeContext): any => { return { - ...(input.ContentDigest !== undefined && { ContentDigest: input.ContentDigest }), - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.ContentDigest !== undefined && input.ContentDigest !== null && { ContentDigest: input.ContentDigest }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -20854,49 +21368,54 @@ const serializeAws_json1_1ModelBiasAppSpecification = ( context: __SerdeContext ): any => { return { - ...(input.ConfigUri !== undefined && { ConfigUri: input.ConfigUri }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), - }), - ...(input.ImageUri !== undefined && { ImageUri: input.ImageUri }), + ...(input.ConfigUri !== undefined && input.ConfigUri !== null && { ConfigUri: input.ConfigUri }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), + }), + ...(input.ImageUri !== undefined && input.ImageUri !== null && { ImageUri: input.ImageUri }), }; }; const serializeAws_json1_1ModelBiasBaselineConfig = (input: ModelBiasBaselineConfig, context: __SerdeContext): any => { return { - ...(input.BaseliningJobName !== undefined && { BaseliningJobName: input.BaseliningJobName }), - ...(input.ConstraintsResource !== undefined && { - ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), - }), + ...(input.BaseliningJobName !== undefined && + input.BaseliningJobName !== null && { BaseliningJobName: input.BaseliningJobName }), + ...(input.ConstraintsResource !== undefined && + input.ConstraintsResource !== null && { + ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), + }), }; }; const serializeAws_json1_1ModelBiasJobInput = (input: ModelBiasJobInput, context: __SerdeContext): any => { return { - ...(input.EndpointInput !== undefined && { - EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), - }), - ...(input.GroundTruthS3Input !== undefined && { - GroundTruthS3Input: serializeAws_json1_1MonitoringGroundTruthS3Input(input.GroundTruthS3Input, context), - }), + ...(input.EndpointInput !== undefined && + input.EndpointInput !== null && { + EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), + }), + ...(input.GroundTruthS3Input !== undefined && + input.GroundTruthS3Input !== null && { + GroundTruthS3Input: serializeAws_json1_1MonitoringGroundTruthS3Input(input.GroundTruthS3Input, context), + }), }; }; const serializeAws_json1_1ModelClientConfig = (input: ModelClientConfig, context: __SerdeContext): any => { return { - ...(input.InvocationsMaxRetries !== undefined && { InvocationsMaxRetries: input.InvocationsMaxRetries }), - ...(input.InvocationsTimeoutInSeconds !== undefined && { - InvocationsTimeoutInSeconds: input.InvocationsTimeoutInSeconds, - }), + ...(input.InvocationsMaxRetries !== undefined && + input.InvocationsMaxRetries !== null && { InvocationsMaxRetries: input.InvocationsMaxRetries }), + ...(input.InvocationsTimeoutInSeconds !== undefined && + input.InvocationsTimeoutInSeconds !== null && { InvocationsTimeoutInSeconds: input.InvocationsTimeoutInSeconds }), }; }; const serializeAws_json1_1ModelDataQuality = (input: ModelDataQuality, context: __SerdeContext): any => { return { - ...(input.Constraints !== undefined && { - Constraints: serializeAws_json1_1MetricsSource(input.Constraints, context), - }), - ...(input.Statistics !== undefined && { Statistics: serializeAws_json1_1MetricsSource(input.Statistics, context) }), + ...(input.Constraints !== undefined && + input.Constraints !== null && { Constraints: serializeAws_json1_1MetricsSource(input.Constraints, context) }), + ...(input.Statistics !== undefined && + input.Statistics !== null && { Statistics: serializeAws_json1_1MetricsSource(input.Statistics, context) }), }; }; @@ -20905,11 +21424,12 @@ const serializeAws_json1_1ModelExplainabilityAppSpecification = ( context: __SerdeContext ): any => { return { - ...(input.ConfigUri !== undefined && { ConfigUri: input.ConfigUri }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), - }), - ...(input.ImageUri !== undefined && { ImageUri: input.ImageUri }), + ...(input.ConfigUri !== undefined && input.ConfigUri !== null && { ConfigUri: input.ConfigUri }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), + }), + ...(input.ImageUri !== undefined && input.ImageUri !== null && { ImageUri: input.ImageUri }), }; }; @@ -20918,10 +21438,12 @@ const serializeAws_json1_1ModelExplainabilityBaselineConfig = ( context: __SerdeContext ): any => { return { - ...(input.BaseliningJobName !== undefined && { BaseliningJobName: input.BaseliningJobName }), - ...(input.ConstraintsResource !== undefined && { - ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), - }), + ...(input.BaseliningJobName !== undefined && + input.BaseliningJobName !== null && { BaseliningJobName: input.BaseliningJobName }), + ...(input.ConstraintsResource !== undefined && + input.ConstraintsResource !== null && { + ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), + }), }; }; @@ -20930,24 +21452,26 @@ const serializeAws_json1_1ModelExplainabilityJobInput = ( context: __SerdeContext ): any => { return { - ...(input.EndpointInput !== undefined && { - EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), - }), + ...(input.EndpointInput !== undefined && + input.EndpointInput !== null && { + EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), + }), }; }; const serializeAws_json1_1ModelMetrics = (input: ModelMetrics, context: __SerdeContext): any => { return { - ...(input.Bias !== undefined && { Bias: serializeAws_json1_1Bias(input.Bias, context) }), - ...(input.Explainability !== undefined && { - Explainability: serializeAws_json1_1Explainability(input.Explainability, context), - }), - ...(input.ModelDataQuality !== undefined && { - ModelDataQuality: serializeAws_json1_1ModelDataQuality(input.ModelDataQuality, context), - }), - ...(input.ModelQuality !== undefined && { - ModelQuality: serializeAws_json1_1ModelQuality(input.ModelQuality, context), - }), + ...(input.Bias !== undefined && input.Bias !== null && { Bias: serializeAws_json1_1Bias(input.Bias, context) }), + ...(input.Explainability !== undefined && + input.Explainability !== null && { + Explainability: serializeAws_json1_1Explainability(input.Explainability, context), + }), + ...(input.ModelDataQuality !== undefined && + input.ModelDataQuality !== null && { + ModelDataQuality: serializeAws_json1_1ModelDataQuality(input.ModelDataQuality, context), + }), + ...(input.ModelQuality !== undefined && + input.ModelQuality !== null && { ModelQuality: serializeAws_json1_1ModelQuality(input.ModelQuality, context) }), }; }; @@ -20956,11 +21480,12 @@ const serializeAws_json1_1ModelPackageContainerDefinition = ( context: __SerdeContext ): any => { return { - ...(input.ContainerHostname !== undefined && { ContainerHostname: input.ContainerHostname }), - ...(input.Image !== undefined && { Image: input.Image }), - ...(input.ImageDigest !== undefined && { ImageDigest: input.ImageDigest }), - ...(input.ModelDataUrl !== undefined && { ModelDataUrl: input.ModelDataUrl }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.ContainerHostname !== undefined && + input.ContainerHostname !== null && { ContainerHostname: input.ContainerHostname }), + ...(input.Image !== undefined && input.Image !== null && { Image: input.Image }), + ...(input.ImageDigest !== undefined && input.ImageDigest !== null && { ImageDigest: input.ImageDigest }), + ...(input.ModelDataUrl !== undefined && input.ModelDataUrl !== null && { ModelDataUrl: input.ModelDataUrl }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), }; }; @@ -20968,7 +21493,14 @@ const serializeAws_json1_1ModelPackageContainerDefinitionList = ( input: ModelPackageContainerDefinition[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ModelPackageContainerDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ModelPackageContainerDefinition(entry, context); + }); }; const serializeAws_json1_1ModelPackageValidationProfile = ( @@ -20976,10 +21508,11 @@ const serializeAws_json1_1ModelPackageValidationProfile = ( context: __SerdeContext ): any => { return { - ...(input.ProfileName !== undefined && { ProfileName: input.ProfileName }), - ...(input.TransformJobDefinition !== undefined && { - TransformJobDefinition: serializeAws_json1_1TransformJobDefinition(input.TransformJobDefinition, context), - }), + ...(input.ProfileName !== undefined && input.ProfileName !== null && { ProfileName: input.ProfileName }), + ...(input.TransformJobDefinition !== undefined && + input.TransformJobDefinition !== null && { + TransformJobDefinition: serializeAws_json1_1TransformJobDefinition(input.TransformJobDefinition, context), + }), }; }; @@ -20987,7 +21520,14 @@ const serializeAws_json1_1ModelPackageValidationProfiles = ( input: ModelPackageValidationProfile[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ModelPackageValidationProfile(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ModelPackageValidationProfile(entry, context); + }); }; const serializeAws_json1_1ModelPackageValidationSpecification = ( @@ -20995,19 +21535,21 @@ const serializeAws_json1_1ModelPackageValidationSpecification = ( context: __SerdeContext ): any => { return { - ...(input.ValidationProfiles !== undefined && { - ValidationProfiles: serializeAws_json1_1ModelPackageValidationProfiles(input.ValidationProfiles, context), - }), - ...(input.ValidationRole !== undefined && { ValidationRole: input.ValidationRole }), + ...(input.ValidationProfiles !== undefined && + input.ValidationProfiles !== null && { + ValidationProfiles: serializeAws_json1_1ModelPackageValidationProfiles(input.ValidationProfiles, context), + }), + ...(input.ValidationRole !== undefined && + input.ValidationRole !== null && { ValidationRole: input.ValidationRole }), }; }; const serializeAws_json1_1ModelQuality = (input: ModelQuality, context: __SerdeContext): any => { return { - ...(input.Constraints !== undefined && { - Constraints: serializeAws_json1_1MetricsSource(input.Constraints, context), - }), - ...(input.Statistics !== undefined && { Statistics: serializeAws_json1_1MetricsSource(input.Statistics, context) }), + ...(input.Constraints !== undefined && + input.Constraints !== null && { Constraints: serializeAws_json1_1MetricsSource(input.Constraints, context) }), + ...(input.Statistics !== undefined && + input.Statistics !== null && { Statistics: serializeAws_json1_1MetricsSource(input.Statistics, context) }), }; }; @@ -21016,23 +21558,26 @@ const serializeAws_json1_1ModelQualityAppSpecification = ( context: __SerdeContext ): any => { return { - ...(input.ContainerArguments !== undefined && { - ContainerArguments: serializeAws_json1_1MonitoringContainerArguments(input.ContainerArguments, context), - }), - ...(input.ContainerEntrypoint !== undefined && { - ContainerEntrypoint: serializeAws_json1_1ContainerEntrypoint(input.ContainerEntrypoint, context), - }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), - }), - ...(input.ImageUri !== undefined && { ImageUri: input.ImageUri }), - ...(input.PostAnalyticsProcessorSourceUri !== undefined && { - PostAnalyticsProcessorSourceUri: input.PostAnalyticsProcessorSourceUri, - }), - ...(input.ProblemType !== undefined && { ProblemType: input.ProblemType }), - ...(input.RecordPreprocessorSourceUri !== undefined && { - RecordPreprocessorSourceUri: input.RecordPreprocessorSourceUri, - }), + ...(input.ContainerArguments !== undefined && + input.ContainerArguments !== null && { + ContainerArguments: serializeAws_json1_1MonitoringContainerArguments(input.ContainerArguments, context), + }), + ...(input.ContainerEntrypoint !== undefined && + input.ContainerEntrypoint !== null && { + ContainerEntrypoint: serializeAws_json1_1ContainerEntrypoint(input.ContainerEntrypoint, context), + }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), + }), + ...(input.ImageUri !== undefined && input.ImageUri !== null && { ImageUri: input.ImageUri }), + ...(input.PostAnalyticsProcessorSourceUri !== undefined && + input.PostAnalyticsProcessorSourceUri !== null && { + PostAnalyticsProcessorSourceUri: input.PostAnalyticsProcessorSourceUri, + }), + ...(input.ProblemType !== undefined && input.ProblemType !== null && { ProblemType: input.ProblemType }), + ...(input.RecordPreprocessorSourceUri !== undefined && + input.RecordPreprocessorSourceUri !== null && { RecordPreprocessorSourceUri: input.RecordPreprocessorSourceUri }), }; }; @@ -21041,21 +21586,25 @@ const serializeAws_json1_1ModelQualityBaselineConfig = ( context: __SerdeContext ): any => { return { - ...(input.BaseliningJobName !== undefined && { BaseliningJobName: input.BaseliningJobName }), - ...(input.ConstraintsResource !== undefined && { - ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), - }), + ...(input.BaseliningJobName !== undefined && + input.BaseliningJobName !== null && { BaseliningJobName: input.BaseliningJobName }), + ...(input.ConstraintsResource !== undefined && + input.ConstraintsResource !== null && { + ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), + }), }; }; const serializeAws_json1_1ModelQualityJobInput = (input: ModelQualityJobInput, context: __SerdeContext): any => { return { - ...(input.EndpointInput !== undefined && { - EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), - }), - ...(input.GroundTruthS3Input !== undefined && { - GroundTruthS3Input: serializeAws_json1_1MonitoringGroundTruthS3Input(input.GroundTruthS3Input, context), - }), + ...(input.EndpointInput !== undefined && + input.EndpointInput !== null && { + EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), + }), + ...(input.GroundTruthS3Input !== undefined && + input.GroundTruthS3Input !== null && { + GroundTruthS3Input: serializeAws_json1_1MonitoringGroundTruthS3Input(input.GroundTruthS3Input, context), + }), }; }; @@ -21064,19 +21613,21 @@ const serializeAws_json1_1MonitoringAppSpecification = ( context: __SerdeContext ): any => { return { - ...(input.ContainerArguments !== undefined && { - ContainerArguments: serializeAws_json1_1MonitoringContainerArguments(input.ContainerArguments, context), - }), - ...(input.ContainerEntrypoint !== undefined && { - ContainerEntrypoint: serializeAws_json1_1ContainerEntrypoint(input.ContainerEntrypoint, context), - }), - ...(input.ImageUri !== undefined && { ImageUri: input.ImageUri }), - ...(input.PostAnalyticsProcessorSourceUri !== undefined && { - PostAnalyticsProcessorSourceUri: input.PostAnalyticsProcessorSourceUri, - }), - ...(input.RecordPreprocessorSourceUri !== undefined && { - RecordPreprocessorSourceUri: input.RecordPreprocessorSourceUri, - }), + ...(input.ContainerArguments !== undefined && + input.ContainerArguments !== null && { + ContainerArguments: serializeAws_json1_1MonitoringContainerArguments(input.ContainerArguments, context), + }), + ...(input.ContainerEntrypoint !== undefined && + input.ContainerEntrypoint !== null && { + ContainerEntrypoint: serializeAws_json1_1ContainerEntrypoint(input.ContainerEntrypoint, context), + }), + ...(input.ImageUri !== undefined && input.ImageUri !== null && { ImageUri: input.ImageUri }), + ...(input.PostAnalyticsProcessorSourceUri !== undefined && + input.PostAnalyticsProcessorSourceUri !== null && { + PostAnalyticsProcessorSourceUri: input.PostAnalyticsProcessorSourceUri, + }), + ...(input.RecordPreprocessorSourceUri !== undefined && + input.RecordPreprocessorSourceUri !== null && { RecordPreprocessorSourceUri: input.RecordPreprocessorSourceUri }), }; }; @@ -21085,22 +21636,27 @@ const serializeAws_json1_1MonitoringBaselineConfig = ( context: __SerdeContext ): any => { return { - ...(input.BaseliningJobName !== undefined && { BaseliningJobName: input.BaseliningJobName }), - ...(input.ConstraintsResource !== undefined && { - ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), - }), - ...(input.StatisticsResource !== undefined && { - StatisticsResource: serializeAws_json1_1MonitoringStatisticsResource(input.StatisticsResource, context), - }), + ...(input.BaseliningJobName !== undefined && + input.BaseliningJobName !== null && { BaseliningJobName: input.BaseliningJobName }), + ...(input.ConstraintsResource !== undefined && + input.ConstraintsResource !== null && { + ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource(input.ConstraintsResource, context), + }), + ...(input.StatisticsResource !== undefined && + input.StatisticsResource !== null && { + StatisticsResource: serializeAws_json1_1MonitoringStatisticsResource(input.StatisticsResource, context), + }), }; }; const serializeAws_json1_1MonitoringClusterConfig = (input: MonitoringClusterConfig, context: __SerdeContext): any => { return { - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VolumeSizeInGB !== undefined && { VolumeSizeInGB: input.VolumeSizeInGB }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VolumeSizeInGB !== undefined && + input.VolumeSizeInGB !== null && { VolumeSizeInGB: input.VolumeSizeInGB }), }; }; @@ -21109,25 +21665,34 @@ const serializeAws_json1_1MonitoringConstraintsResource = ( context: __SerdeContext ): any => { return { - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1MonitoringContainerArguments = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MonitoringEnvironmentMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1MonitoringGroundTruthS3Input = ( @@ -21135,97 +21700,126 @@ const serializeAws_json1_1MonitoringGroundTruthS3Input = ( context: __SerdeContext ): any => { return { - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1MonitoringInput = (input: MonitoringInput, context: __SerdeContext): any => { return { - ...(input.EndpointInput !== undefined && { - EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), - }), + ...(input.EndpointInput !== undefined && + input.EndpointInput !== null && { + EndpointInput: serializeAws_json1_1EndpointInput(input.EndpointInput, context), + }), }; }; const serializeAws_json1_1MonitoringInputs = (input: MonitoringInput[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MonitoringInput(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MonitoringInput(entry, context); + }); }; const serializeAws_json1_1MonitoringJobDefinition = (input: MonitoringJobDefinition, context: __SerdeContext): any => { return { - ...(input.BaselineConfig !== undefined && { - BaselineConfig: serializeAws_json1_1MonitoringBaselineConfig(input.BaselineConfig, context), - }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), - }), - ...(input.MonitoringAppSpecification !== undefined && { - MonitoringAppSpecification: serializeAws_json1_1MonitoringAppSpecification( - input.MonitoringAppSpecification, - context - ), - }), - ...(input.MonitoringInputs !== undefined && { - MonitoringInputs: serializeAws_json1_1MonitoringInputs(input.MonitoringInputs, context), - }), - ...(input.MonitoringOutputConfig !== undefined && { - MonitoringOutputConfig: serializeAws_json1_1MonitoringOutputConfig(input.MonitoringOutputConfig, context), - }), - ...(input.MonitoringResources !== undefined && { - MonitoringResources: serializeAws_json1_1MonitoringResources(input.MonitoringResources, context), - }), - ...(input.NetworkConfig !== undefined && { - NetworkConfig: serializeAws_json1_1NetworkConfig(input.NetworkConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), - }), + ...(input.BaselineConfig !== undefined && + input.BaselineConfig !== null && { + BaselineConfig: serializeAws_json1_1MonitoringBaselineConfig(input.BaselineConfig, context), + }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1MonitoringEnvironmentMap(input.Environment, context), + }), + ...(input.MonitoringAppSpecification !== undefined && + input.MonitoringAppSpecification !== null && { + MonitoringAppSpecification: serializeAws_json1_1MonitoringAppSpecification( + input.MonitoringAppSpecification, + context + ), + }), + ...(input.MonitoringInputs !== undefined && + input.MonitoringInputs !== null && { + MonitoringInputs: serializeAws_json1_1MonitoringInputs(input.MonitoringInputs, context), + }), + ...(input.MonitoringOutputConfig !== undefined && + input.MonitoringOutputConfig !== null && { + MonitoringOutputConfig: serializeAws_json1_1MonitoringOutputConfig(input.MonitoringOutputConfig, context), + }), + ...(input.MonitoringResources !== undefined && + input.MonitoringResources !== null && { + MonitoringResources: serializeAws_json1_1MonitoringResources(input.MonitoringResources, context), + }), + ...(input.NetworkConfig !== undefined && + input.NetworkConfig !== null && { + NetworkConfig: serializeAws_json1_1NetworkConfig(input.NetworkConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1MonitoringStoppingCondition(input.StoppingCondition, context), + }), }; }; const serializeAws_json1_1MonitoringNetworkConfig = (input: MonitoringNetworkConfig, context: __SerdeContext): any => { return { - ...(input.EnableInterContainerTrafficEncryption !== undefined && { - EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, - }), - ...(input.EnableNetworkIsolation !== undefined && { EnableNetworkIsolation: input.EnableNetworkIsolation }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.EnableInterContainerTrafficEncryption !== undefined && + input.EnableInterContainerTrafficEncryption !== null && { + EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, + }), + ...(input.EnableNetworkIsolation !== undefined && + input.EnableNetworkIsolation !== null && { EnableNetworkIsolation: input.EnableNetworkIsolation }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; const serializeAws_json1_1MonitoringOutput = (input: MonitoringOutput, context: __SerdeContext): any => { return { - ...(input.S3Output !== undefined && { S3Output: serializeAws_json1_1MonitoringS3Output(input.S3Output, context) }), + ...(input.S3Output !== undefined && + input.S3Output !== null && { S3Output: serializeAws_json1_1MonitoringS3Output(input.S3Output, context) }), }; }; const serializeAws_json1_1MonitoringOutputConfig = (input: MonitoringOutputConfig, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.MonitoringOutputs !== undefined && { - MonitoringOutputs: serializeAws_json1_1MonitoringOutputs(input.MonitoringOutputs, context), - }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.MonitoringOutputs !== undefined && + input.MonitoringOutputs !== null && { + MonitoringOutputs: serializeAws_json1_1MonitoringOutputs(input.MonitoringOutputs, context), + }), }; }; const serializeAws_json1_1MonitoringOutputs = (input: MonitoringOutput[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1MonitoringOutput(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MonitoringOutput(entry, context); + }); }; const serializeAws_json1_1MonitoringResources = (input: MonitoringResources, context: __SerdeContext): any => { return { - ...(input.ClusterConfig !== undefined && { - ClusterConfig: serializeAws_json1_1MonitoringClusterConfig(input.ClusterConfig, context), - }), + ...(input.ClusterConfig !== undefined && + input.ClusterConfig !== null && { + ClusterConfig: serializeAws_json1_1MonitoringClusterConfig(input.ClusterConfig, context), + }), }; }; const serializeAws_json1_1MonitoringS3Output = (input: MonitoringS3Output, context: __SerdeContext): any => { return { - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.S3UploadMode !== undefined && { S3UploadMode: input.S3UploadMode }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.S3UploadMode !== undefined && input.S3UploadMode !== null && { S3UploadMode: input.S3UploadMode }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -21234,16 +21828,18 @@ const serializeAws_json1_1MonitoringScheduleConfig = ( context: __SerdeContext ): any => { return { - ...(input.MonitoringJobDefinition !== undefined && { - MonitoringJobDefinition: serializeAws_json1_1MonitoringJobDefinition(input.MonitoringJobDefinition, context), - }), - ...(input.MonitoringJobDefinitionName !== undefined && { - MonitoringJobDefinitionName: input.MonitoringJobDefinitionName, - }), - ...(input.MonitoringType !== undefined && { MonitoringType: input.MonitoringType }), - ...(input.ScheduleConfig !== undefined && { - ScheduleConfig: serializeAws_json1_1ScheduleConfig(input.ScheduleConfig, context), - }), + ...(input.MonitoringJobDefinition !== undefined && + input.MonitoringJobDefinition !== null && { + MonitoringJobDefinition: serializeAws_json1_1MonitoringJobDefinition(input.MonitoringJobDefinition, context), + }), + ...(input.MonitoringJobDefinitionName !== undefined && + input.MonitoringJobDefinitionName !== null && { MonitoringJobDefinitionName: input.MonitoringJobDefinitionName }), + ...(input.MonitoringType !== undefined && + input.MonitoringType !== null && { MonitoringType: input.MonitoringType }), + ...(input.ScheduleConfig !== undefined && + input.ScheduleConfig !== null && { + ScheduleConfig: serializeAws_json1_1ScheduleConfig(input.ScheduleConfig, context), + }), }; }; @@ -21252,7 +21848,7 @@ const serializeAws_json1_1MonitoringStatisticsResource = ( context: __SerdeContext ): any => { return { - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -21261,28 +21857,41 @@ const serializeAws_json1_1MonitoringStoppingCondition = ( context: __SerdeContext ): any => { return { - ...(input.MaxRuntimeInSeconds !== undefined && { MaxRuntimeInSeconds: input.MaxRuntimeInSeconds }), + ...(input.MaxRuntimeInSeconds !== undefined && + input.MaxRuntimeInSeconds !== null && { MaxRuntimeInSeconds: input.MaxRuntimeInSeconds }), }; }; const serializeAws_json1_1NestedFilters = (input: NestedFilters, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.NestedPropertyName !== undefined && { NestedPropertyName: input.NestedPropertyName }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.NestedPropertyName !== undefined && + input.NestedPropertyName !== null && { NestedPropertyName: input.NestedPropertyName }), }; }; const serializeAws_json1_1NestedFiltersList = (input: NestedFilters[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1NestedFilters(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1NestedFilters(entry, context); + }); }; const serializeAws_json1_1NetworkConfig = (input: NetworkConfig, context: __SerdeContext): any => { return { - ...(input.EnableInterContainerTrafficEncryption !== undefined && { - EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, - }), - ...(input.EnableNetworkIsolation !== undefined && { EnableNetworkIsolation: input.EnableNetworkIsolation }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), + ...(input.EnableInterContainerTrafficEncryption !== undefined && + input.EnableInterContainerTrafficEncryption !== null && { + EnableInterContainerTrafficEncryption: input.EnableInterContainerTrafficEncryption, + }), + ...(input.EnableNetworkIsolation !== undefined && + input.EnableNetworkIsolation !== null && { EnableNetworkIsolation: input.EnableNetworkIsolation }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) }), }; }; @@ -21290,14 +21899,28 @@ const serializeAws_json1_1NotebookInstanceAcceleratorTypes = ( input: (NotebookInstanceAcceleratorType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1NotebookInstanceLifecycleConfigList = ( input: NotebookInstanceLifecycleHook[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1NotebookInstanceLifecycleHook(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1NotebookInstanceLifecycleHook(entry, context); + }); }; const serializeAws_json1_1NotebookInstanceLifecycleHook = ( @@ -21305,7 +21928,7 @@ const serializeAws_json1_1NotebookInstanceLifecycleHook = ( context: __SerdeContext ): any => { return { - ...(input.Content !== undefined && { Content: input.Content }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), }; }; @@ -21314,47 +21937,57 @@ const serializeAws_json1_1NotificationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.NotificationTopicArn !== undefined && { NotificationTopicArn: input.NotificationTopicArn }), + ...(input.NotificationTopicArn !== undefined && + input.NotificationTopicArn !== null && { NotificationTopicArn: input.NotificationTopicArn }), }; }; const serializeAws_json1_1OfflineStoreConfig = (input: OfflineStoreConfig, context: __SerdeContext): any => { return { - ...(input.DataCatalogConfig !== undefined && { - DataCatalogConfig: serializeAws_json1_1DataCatalogConfig(input.DataCatalogConfig, context), - }), - ...(input.DisableGlueTableCreation !== undefined && { DisableGlueTableCreation: input.DisableGlueTableCreation }), - ...(input.S3StorageConfig !== undefined && { - S3StorageConfig: serializeAws_json1_1S3StorageConfig(input.S3StorageConfig, context), - }), + ...(input.DataCatalogConfig !== undefined && + input.DataCatalogConfig !== null && { + DataCatalogConfig: serializeAws_json1_1DataCatalogConfig(input.DataCatalogConfig, context), + }), + ...(input.DisableGlueTableCreation !== undefined && + input.DisableGlueTableCreation !== null && { DisableGlueTableCreation: input.DisableGlueTableCreation }), + ...(input.S3StorageConfig !== undefined && + input.S3StorageConfig !== null && { + S3StorageConfig: serializeAws_json1_1S3StorageConfig(input.S3StorageConfig, context), + }), }; }; const serializeAws_json1_1OidcConfig = (input: OidcConfig, context: __SerdeContext): any => { return { - ...(input.AuthorizationEndpoint !== undefined && { AuthorizationEndpoint: input.AuthorizationEndpoint }), - ...(input.ClientId !== undefined && { ClientId: input.ClientId }), - ...(input.ClientSecret !== undefined && { ClientSecret: input.ClientSecret }), - ...(input.Issuer !== undefined && { Issuer: input.Issuer }), - ...(input.JwksUri !== undefined && { JwksUri: input.JwksUri }), - ...(input.LogoutEndpoint !== undefined && { LogoutEndpoint: input.LogoutEndpoint }), - ...(input.TokenEndpoint !== undefined && { TokenEndpoint: input.TokenEndpoint }), - ...(input.UserInfoEndpoint !== undefined && { UserInfoEndpoint: input.UserInfoEndpoint }), + ...(input.AuthorizationEndpoint !== undefined && + input.AuthorizationEndpoint !== null && { AuthorizationEndpoint: input.AuthorizationEndpoint }), + ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }), + ...(input.ClientSecret !== undefined && input.ClientSecret !== null && { ClientSecret: input.ClientSecret }), + ...(input.Issuer !== undefined && input.Issuer !== null && { Issuer: input.Issuer }), + ...(input.JwksUri !== undefined && input.JwksUri !== null && { JwksUri: input.JwksUri }), + ...(input.LogoutEndpoint !== undefined && + input.LogoutEndpoint !== null && { LogoutEndpoint: input.LogoutEndpoint }), + ...(input.TokenEndpoint !== undefined && input.TokenEndpoint !== null && { TokenEndpoint: input.TokenEndpoint }), + ...(input.UserInfoEndpoint !== undefined && + input.UserInfoEndpoint !== null && { UserInfoEndpoint: input.UserInfoEndpoint }), }; }; const serializeAws_json1_1OidcMemberDefinition = (input: OidcMemberDefinition, context: __SerdeContext): any => { return { - ...(input.Groups !== undefined && { Groups: serializeAws_json1_1Groups(input.Groups, context) }), + ...(input.Groups !== undefined && + input.Groups !== null && { Groups: serializeAws_json1_1Groups(input.Groups, context) }), }; }; const serializeAws_json1_1OnlineStoreConfig = (input: OnlineStoreConfig, context: __SerdeContext): any => { return { - ...(input.EnableOnlineStore !== undefined && { EnableOnlineStore: input.EnableOnlineStore }), - ...(input.SecurityConfig !== undefined && { - SecurityConfig: serializeAws_json1_1OnlineStoreSecurityConfig(input.SecurityConfig, context), - }), + ...(input.EnableOnlineStore !== undefined && + input.EnableOnlineStore !== null && { EnableOnlineStore: input.EnableOnlineStore }), + ...(input.SecurityConfig !== undefined && + input.SecurityConfig !== null && { + SecurityConfig: serializeAws_json1_1OnlineStoreSecurityConfig(input.SecurityConfig, context), + }), }; }; @@ -21363,85 +21996,108 @@ const serializeAws_json1_1OnlineStoreSecurityConfig = ( context: __SerdeContext ): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), }; }; const serializeAws_json1_1OutputConfig = (input: OutputConfig, context: __SerdeContext): any => { return { - ...(input.CompilerOptions !== undefined && { CompilerOptions: input.CompilerOptions }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3OutputLocation !== undefined && { S3OutputLocation: input.S3OutputLocation }), - ...(input.TargetDevice !== undefined && { TargetDevice: input.TargetDevice }), - ...(input.TargetPlatform !== undefined && { - TargetPlatform: serializeAws_json1_1TargetPlatform(input.TargetPlatform, context), - }), + ...(input.CompilerOptions !== undefined && + input.CompilerOptions !== null && { CompilerOptions: input.CompilerOptions }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputLocation !== undefined && + input.S3OutputLocation !== null && { S3OutputLocation: input.S3OutputLocation }), + ...(input.TargetDevice !== undefined && input.TargetDevice !== null && { TargetDevice: input.TargetDevice }), + ...(input.TargetPlatform !== undefined && + input.TargetPlatform !== null && { + TargetPlatform: serializeAws_json1_1TargetPlatform(input.TargetPlatform, context), + }), }; }; const serializeAws_json1_1OutputDataConfig = (input: OutputDataConfig, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), }; }; const serializeAws_json1_1Parameter = (input: Parameter, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1ParameterList = (input: Parameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Parameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Parameter(entry, context); + }); }; const serializeAws_json1_1ParameterRange = (input: ParameterRange, context: __SerdeContext): any => { return { - ...(input.CategoricalParameterRangeSpecification !== undefined && { - CategoricalParameterRangeSpecification: serializeAws_json1_1CategoricalParameterRangeSpecification( - input.CategoricalParameterRangeSpecification, - context - ), - }), - ...(input.ContinuousParameterRangeSpecification !== undefined && { - ContinuousParameterRangeSpecification: serializeAws_json1_1ContinuousParameterRangeSpecification( - input.ContinuousParameterRangeSpecification, - context - ), - }), - ...(input.IntegerParameterRangeSpecification !== undefined && { - IntegerParameterRangeSpecification: serializeAws_json1_1IntegerParameterRangeSpecification( - input.IntegerParameterRangeSpecification, - context - ), - }), + ...(input.CategoricalParameterRangeSpecification !== undefined && + input.CategoricalParameterRangeSpecification !== null && { + CategoricalParameterRangeSpecification: serializeAws_json1_1CategoricalParameterRangeSpecification( + input.CategoricalParameterRangeSpecification, + context + ), + }), + ...(input.ContinuousParameterRangeSpecification !== undefined && + input.ContinuousParameterRangeSpecification !== null && { + ContinuousParameterRangeSpecification: serializeAws_json1_1ContinuousParameterRangeSpecification( + input.ContinuousParameterRangeSpecification, + context + ), + }), + ...(input.IntegerParameterRangeSpecification !== undefined && + input.IntegerParameterRangeSpecification !== null && { + IntegerParameterRangeSpecification: serializeAws_json1_1IntegerParameterRangeSpecification( + input.IntegerParameterRangeSpecification, + context + ), + }), }; }; const serializeAws_json1_1ParameterRanges = (input: ParameterRanges, context: __SerdeContext): any => { return { - ...(input.CategoricalParameterRanges !== undefined && { - CategoricalParameterRanges: serializeAws_json1_1CategoricalParameterRanges( - input.CategoricalParameterRanges, - context - ), - }), - ...(input.ContinuousParameterRanges !== undefined && { - ContinuousParameterRanges: serializeAws_json1_1ContinuousParameterRanges( - input.ContinuousParameterRanges, - context - ), - }), - ...(input.IntegerParameterRanges !== undefined && { - IntegerParameterRanges: serializeAws_json1_1IntegerParameterRanges(input.IntegerParameterRanges, context), - }), + ...(input.CategoricalParameterRanges !== undefined && + input.CategoricalParameterRanges !== null && { + CategoricalParameterRanges: serializeAws_json1_1CategoricalParameterRanges( + input.CategoricalParameterRanges, + context + ), + }), + ...(input.ContinuousParameterRanges !== undefined && + input.ContinuousParameterRanges !== null && { + ContinuousParameterRanges: serializeAws_json1_1ContinuousParameterRanges( + input.ContinuousParameterRanges, + context + ), + }), + ...(input.IntegerParameterRanges !== undefined && + input.IntegerParameterRanges !== null && { + IntegerParameterRanges: serializeAws_json1_1IntegerParameterRanges(input.IntegerParameterRanges, context), + }), }; }; const serializeAws_json1_1ParameterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ParentHyperParameterTuningJob = ( @@ -21449,9 +22105,8 @@ const serializeAws_json1_1ParentHyperParameterTuningJob = ( context: __SerdeContext ): any => { return { - ...(input.HyperParameterTuningJobName !== undefined && { - HyperParameterTuningJobName: input.HyperParameterTuningJobName, - }), + ...(input.HyperParameterTuningJobName !== undefined && + input.HyperParameterTuningJobName !== null && { HyperParameterTuningJobName: input.HyperParameterTuningJobName }), }; }; @@ -21459,15 +22114,24 @@ const serializeAws_json1_1ParentHyperParameterTuningJobs = ( input: ParentHyperParameterTuningJob[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ParentHyperParameterTuningJob(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ParentHyperParameterTuningJob(entry, context); + }); }; const serializeAws_json1_1ProcessingClusterConfig = (input: ProcessingClusterConfig, context: __SerdeContext): any => { return { - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VolumeSizeInGB !== undefined && { VolumeSizeInGB: input.VolumeSizeInGB }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VolumeSizeInGB !== undefined && + input.VolumeSizeInGB !== null && { VolumeSizeInGB: input.VolumeSizeInGB }), }; }; @@ -21475,13 +22139,15 @@ const serializeAws_json1_1ProcessingEnvironmentMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ProcessingFeatureStoreOutput = ( @@ -21489,71 +22155,94 @@ const serializeAws_json1_1ProcessingFeatureStoreOutput = ( context: __SerdeContext ): any => { return { - ...(input.FeatureGroupName !== undefined && { FeatureGroupName: input.FeatureGroupName }), + ...(input.FeatureGroupName !== undefined && + input.FeatureGroupName !== null && { FeatureGroupName: input.FeatureGroupName }), }; }; const serializeAws_json1_1ProcessingInput = (input: ProcessingInput, context: __SerdeContext): any => { return { - ...(input.AppManaged !== undefined && { AppManaged: input.AppManaged }), - ...(input.DatasetDefinition !== undefined && { - DatasetDefinition: serializeAws_json1_1DatasetDefinition(input.DatasetDefinition, context), - }), - ...(input.InputName !== undefined && { InputName: input.InputName }), - ...(input.S3Input !== undefined && { S3Input: serializeAws_json1_1ProcessingS3Input(input.S3Input, context) }), + ...(input.AppManaged !== undefined && input.AppManaged !== null && { AppManaged: input.AppManaged }), + ...(input.DatasetDefinition !== undefined && + input.DatasetDefinition !== null && { + DatasetDefinition: serializeAws_json1_1DatasetDefinition(input.DatasetDefinition, context), + }), + ...(input.InputName !== undefined && input.InputName !== null && { InputName: input.InputName }), + ...(input.S3Input !== undefined && + input.S3Input !== null && { S3Input: serializeAws_json1_1ProcessingS3Input(input.S3Input, context) }), }; }; const serializeAws_json1_1ProcessingInputs = (input: ProcessingInput[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ProcessingInput(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProcessingInput(entry, context); + }); }; const serializeAws_json1_1ProcessingOutput = (input: ProcessingOutput, context: __SerdeContext): any => { return { - ...(input.AppManaged !== undefined && { AppManaged: input.AppManaged }), - ...(input.FeatureStoreOutput !== undefined && { - FeatureStoreOutput: serializeAws_json1_1ProcessingFeatureStoreOutput(input.FeatureStoreOutput, context), - }), - ...(input.OutputName !== undefined && { OutputName: input.OutputName }), - ...(input.S3Output !== undefined && { S3Output: serializeAws_json1_1ProcessingS3Output(input.S3Output, context) }), + ...(input.AppManaged !== undefined && input.AppManaged !== null && { AppManaged: input.AppManaged }), + ...(input.FeatureStoreOutput !== undefined && + input.FeatureStoreOutput !== null && { + FeatureStoreOutput: serializeAws_json1_1ProcessingFeatureStoreOutput(input.FeatureStoreOutput, context), + }), + ...(input.OutputName !== undefined && input.OutputName !== null && { OutputName: input.OutputName }), + ...(input.S3Output !== undefined && + input.S3Output !== null && { S3Output: serializeAws_json1_1ProcessingS3Output(input.S3Output, context) }), }; }; const serializeAws_json1_1ProcessingOutputConfig = (input: ProcessingOutputConfig, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.Outputs !== undefined && { Outputs: serializeAws_json1_1ProcessingOutputs(input.Outputs, context) }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.Outputs !== undefined && + input.Outputs !== null && { Outputs: serializeAws_json1_1ProcessingOutputs(input.Outputs, context) }), }; }; const serializeAws_json1_1ProcessingOutputs = (input: ProcessingOutput[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ProcessingOutput(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProcessingOutput(entry, context); + }); }; const serializeAws_json1_1ProcessingResources = (input: ProcessingResources, context: __SerdeContext): any => { return { - ...(input.ClusterConfig !== undefined && { - ClusterConfig: serializeAws_json1_1ProcessingClusterConfig(input.ClusterConfig, context), - }), + ...(input.ClusterConfig !== undefined && + input.ClusterConfig !== null && { + ClusterConfig: serializeAws_json1_1ProcessingClusterConfig(input.ClusterConfig, context), + }), }; }; const serializeAws_json1_1ProcessingS3Input = (input: ProcessingS3Input, context: __SerdeContext): any => { return { - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.S3CompressionType !== undefined && { S3CompressionType: input.S3CompressionType }), - ...(input.S3DataDistributionType !== undefined && { S3DataDistributionType: input.S3DataDistributionType }), - ...(input.S3DataType !== undefined && { S3DataType: input.S3DataType }), - ...(input.S3InputMode !== undefined && { S3InputMode: input.S3InputMode }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.S3CompressionType !== undefined && + input.S3CompressionType !== null && { S3CompressionType: input.S3CompressionType }), + ...(input.S3DataDistributionType !== undefined && + input.S3DataDistributionType !== null && { S3DataDistributionType: input.S3DataDistributionType }), + ...(input.S3DataType !== undefined && input.S3DataType !== null && { S3DataType: input.S3DataType }), + ...(input.S3InputMode !== undefined && input.S3InputMode !== null && { S3InputMode: input.S3InputMode }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1ProcessingS3Output = (input: ProcessingS3Output, context: __SerdeContext): any => { return { - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.S3UploadMode !== undefined && { S3UploadMode: input.S3UploadMode }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.S3UploadMode !== undefined && input.S3UploadMode !== null && { S3UploadMode: input.S3UploadMode }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; @@ -21562,47 +22251,63 @@ const serializeAws_json1_1ProcessingStoppingCondition = ( context: __SerdeContext ): any => { return { - ...(input.MaxRuntimeInSeconds !== undefined && { MaxRuntimeInSeconds: input.MaxRuntimeInSeconds }), + ...(input.MaxRuntimeInSeconds !== undefined && + input.MaxRuntimeInSeconds !== null && { MaxRuntimeInSeconds: input.MaxRuntimeInSeconds }), }; }; const serializeAws_json1_1ProductionVariant = (input: ProductionVariant, context: __SerdeContext): any => { return { - ...(input.AcceleratorType !== undefined && { AcceleratorType: input.AcceleratorType }), - ...(input.InitialInstanceCount !== undefined && { InitialInstanceCount: input.InitialInstanceCount }), - ...(input.InitialVariantWeight !== undefined && { InitialVariantWeight: input.InitialVariantWeight }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), - ...(input.VariantName !== undefined && { VariantName: input.VariantName }), + ...(input.AcceleratorType !== undefined && + input.AcceleratorType !== null && { AcceleratorType: input.AcceleratorType }), + ...(input.InitialInstanceCount !== undefined && + input.InitialInstanceCount !== null && { InitialInstanceCount: input.InitialInstanceCount }), + ...(input.InitialVariantWeight !== undefined && + input.InitialVariantWeight !== null && { InitialVariantWeight: input.InitialVariantWeight }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), + ...(input.VariantName !== undefined && input.VariantName !== null && { VariantName: input.VariantName }), }; }; const serializeAws_json1_1ProductionVariantList = (input: ProductionVariant[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ProductionVariant(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProductionVariant(entry, context); + }); }; const serializeAws_json1_1ProfilerConfig = (input: ProfilerConfig, context: __SerdeContext): any => { return { - ...(input.ProfilingIntervalInMilliseconds !== undefined && { - ProfilingIntervalInMilliseconds: input.ProfilingIntervalInMilliseconds, - }), - ...(input.ProfilingParameters !== undefined && { - ProfilingParameters: serializeAws_json1_1ProfilingParameters(input.ProfilingParameters, context), - }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), + ...(input.ProfilingIntervalInMilliseconds !== undefined && + input.ProfilingIntervalInMilliseconds !== null && { + ProfilingIntervalInMilliseconds: input.ProfilingIntervalInMilliseconds, + }), + ...(input.ProfilingParameters !== undefined && + input.ProfilingParameters !== null && { + ProfilingParameters: serializeAws_json1_1ProfilingParameters(input.ProfilingParameters, context), + }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), }; }; const serializeAws_json1_1ProfilerConfigForUpdate = (input: ProfilerConfigForUpdate, context: __SerdeContext): any => { return { - ...(input.DisableProfiler !== undefined && { DisableProfiler: input.DisableProfiler }), - ...(input.ProfilingIntervalInMilliseconds !== undefined && { - ProfilingIntervalInMilliseconds: input.ProfilingIntervalInMilliseconds, - }), - ...(input.ProfilingParameters !== undefined && { - ProfilingParameters: serializeAws_json1_1ProfilingParameters(input.ProfilingParameters, context), - }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), + ...(input.DisableProfiler !== undefined && + input.DisableProfiler !== null && { DisableProfiler: input.DisableProfiler }), + ...(input.ProfilingIntervalInMilliseconds !== undefined && + input.ProfilingIntervalInMilliseconds !== null && { + ProfilingIntervalInMilliseconds: input.ProfilingIntervalInMilliseconds, + }), + ...(input.ProfilingParameters !== undefined && + input.ProfilingParameters !== null && { + ProfilingParameters: serializeAws_json1_1ProfilingParameters(input.ProfilingParameters, context), + }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), }; }; @@ -21611,15 +22316,19 @@ const serializeAws_json1_1ProfilerRuleConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.RuleConfigurationName !== undefined && { RuleConfigurationName: input.RuleConfigurationName }), - ...(input.RuleEvaluatorImage !== undefined && { RuleEvaluatorImage: input.RuleEvaluatorImage }), - ...(input.RuleParameters !== undefined && { - RuleParameters: serializeAws_json1_1RuleParameters(input.RuleParameters, context), - }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), - ...(input.VolumeSizeInGB !== undefined && { VolumeSizeInGB: input.VolumeSizeInGB }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.RuleConfigurationName !== undefined && + input.RuleConfigurationName !== null && { RuleConfigurationName: input.RuleConfigurationName }), + ...(input.RuleEvaluatorImage !== undefined && + input.RuleEvaluatorImage !== null && { RuleEvaluatorImage: input.RuleEvaluatorImage }), + ...(input.RuleParameters !== undefined && + input.RuleParameters !== null && { + RuleParameters: serializeAws_json1_1RuleParameters(input.RuleParameters, context), + }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), + ...(input.VolumeSizeInGB !== undefined && + input.VolumeSizeInGB !== null && { VolumeSizeInGB: input.VolumeSizeInGB }), }; }; @@ -21627,34 +22336,51 @@ const serializeAws_json1_1ProfilerRuleConfigurations = ( input: ProfilerRuleConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ProfilerRuleConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProfilerRuleConfiguration(entry, context); + }); }; const serializeAws_json1_1ProfilingParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1PropertyNameQuery = (input: PropertyNameQuery, context: __SerdeContext): any => { return { - ...(input.PropertyNameHint !== undefined && { PropertyNameHint: input.PropertyNameHint }), + ...(input.PropertyNameHint !== undefined && + input.PropertyNameHint !== null && { PropertyNameHint: input.PropertyNameHint }), }; }; const serializeAws_json1_1ProvisioningParameter = (input: ProvisioningParameter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1ProvisioningParameters = (input: ProvisioningParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ProvisioningParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProvisioningParameter(entry, context); + }); }; const serializeAws_json1_1PublicWorkforceTaskPrice = ( @@ -21662,7 +22388,8 @@ const serializeAws_json1_1PublicWorkforceTaskPrice = ( context: __SerdeContext ): any => { return { - ...(input.AmountInUsd !== undefined && { AmountInUsd: serializeAws_json1_1USD(input.AmountInUsd, context) }), + ...(input.AmountInUsd !== undefined && + input.AmountInUsd !== null && { AmountInUsd: serializeAws_json1_1USD(input.AmountInUsd, context) }), }; }; @@ -21671,8 +22398,10 @@ const serializeAws_json1_1PutModelPackageGroupPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.ModelPackageGroupName !== undefined && { ModelPackageGroupName: input.ModelPackageGroupName }), - ...(input.ResourcePolicy !== undefined && { ResourcePolicy: input.ResourcePolicy }), + ...(input.ModelPackageGroupName !== undefined && + input.ModelPackageGroupName !== null && { ModelPackageGroupName: input.ModelPackageGroupName }), + ...(input.ResourcePolicy !== undefined && + input.ResourcePolicy !== null && { ResourcePolicy: input.ResourcePolicy }), }; }; @@ -21680,7 +22409,14 @@ const serializeAws_json1_1RealtimeInferenceInstanceTypes = ( input: (ProductionVariantInstanceType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RedshiftDatasetDefinition = ( @@ -21688,141 +22424,185 @@ const serializeAws_json1_1RedshiftDatasetDefinition = ( context: __SerdeContext ): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.ClusterRoleArn !== undefined && { ClusterRoleArn: input.ClusterRoleArn }), - ...(input.Database !== undefined && { Database: input.Database }), - ...(input.DbUser !== undefined && { DbUser: input.DbUser }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.OutputCompression !== undefined && { OutputCompression: input.OutputCompression }), - ...(input.OutputFormat !== undefined && { OutputFormat: input.OutputFormat }), - ...(input.OutputS3Uri !== undefined && { OutputS3Uri: input.OutputS3Uri }), - ...(input.QueryString !== undefined && { QueryString: input.QueryString }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.ClusterRoleArn !== undefined && + input.ClusterRoleArn !== null && { ClusterRoleArn: input.ClusterRoleArn }), + ...(input.Database !== undefined && input.Database !== null && { Database: input.Database }), + ...(input.DbUser !== undefined && input.DbUser !== null && { DbUser: input.DbUser }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.OutputCompression !== undefined && + input.OutputCompression !== null && { OutputCompression: input.OutputCompression }), + ...(input.OutputFormat !== undefined && input.OutputFormat !== null && { OutputFormat: input.OutputFormat }), + ...(input.OutputS3Uri !== undefined && input.OutputS3Uri !== null && { OutputS3Uri: input.OutputS3Uri }), + ...(input.QueryString !== undefined && input.QueryString !== null && { QueryString: input.QueryString }), }; }; const serializeAws_json1_1RegisterDevicesRequest = (input: RegisterDevicesRequest, context: __SerdeContext): any => { return { - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), - ...(input.Devices !== undefined && { Devices: serializeAws_json1_1Devices(input.Devices, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), + ...(input.Devices !== undefined && + input.Devices !== null && { Devices: serializeAws_json1_1Devices(input.Devices, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1RenderableTask = (input: RenderableTask, context: __SerdeContext): any => { return { - ...(input.Input !== undefined && { Input: input.Input }), + ...(input.Input !== undefined && input.Input !== null && { Input: input.Input }), }; }; const serializeAws_json1_1RenderUiTemplateRequest = (input: RenderUiTemplateRequest, context: __SerdeContext): any => { return { - ...(input.HumanTaskUiArn !== undefined && { HumanTaskUiArn: input.HumanTaskUiArn }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Task !== undefined && { Task: serializeAws_json1_1RenderableTask(input.Task, context) }), - ...(input.UiTemplate !== undefined && { UiTemplate: serializeAws_json1_1UiTemplate(input.UiTemplate, context) }), + ...(input.HumanTaskUiArn !== undefined && + input.HumanTaskUiArn !== null && { HumanTaskUiArn: input.HumanTaskUiArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Task !== undefined && + input.Task !== null && { Task: serializeAws_json1_1RenderableTask(input.Task, context) }), + ...(input.UiTemplate !== undefined && + input.UiTemplate !== null && { UiTemplate: serializeAws_json1_1UiTemplate(input.UiTemplate, context) }), }; }; const serializeAws_json1_1ResourceConfig = (input: ResourceConfig, context: __SerdeContext): any => { return { - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), - ...(input.VolumeSizeInGB !== undefined && { VolumeSizeInGB: input.VolumeSizeInGB }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.VolumeSizeInGB !== undefined && + input.VolumeSizeInGB !== null && { VolumeSizeInGB: input.VolumeSizeInGB }), }; }; const serializeAws_json1_1ResourceLimits = (input: ResourceLimits, context: __SerdeContext): any => { return { - ...(input.MaxNumberOfTrainingJobs !== undefined && { MaxNumberOfTrainingJobs: input.MaxNumberOfTrainingJobs }), - ...(input.MaxParallelTrainingJobs !== undefined && { MaxParallelTrainingJobs: input.MaxParallelTrainingJobs }), + ...(input.MaxNumberOfTrainingJobs !== undefined && + input.MaxNumberOfTrainingJobs !== null && { MaxNumberOfTrainingJobs: input.MaxNumberOfTrainingJobs }), + ...(input.MaxParallelTrainingJobs !== undefined && + input.MaxParallelTrainingJobs !== null && { MaxParallelTrainingJobs: input.MaxParallelTrainingJobs }), }; }; const serializeAws_json1_1ResourceSpec = (input: ResourceSpec, context: __SerdeContext): any => { return { - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.SageMakerImageArn !== undefined && { SageMakerImageArn: input.SageMakerImageArn }), - ...(input.SageMakerImageVersionArn !== undefined && { SageMakerImageVersionArn: input.SageMakerImageVersionArn }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.SageMakerImageArn !== undefined && + input.SageMakerImageArn !== null && { SageMakerImageArn: input.SageMakerImageArn }), + ...(input.SageMakerImageVersionArn !== undefined && + input.SageMakerImageVersionArn !== null && { SageMakerImageVersionArn: input.SageMakerImageVersionArn }), }; }; const serializeAws_json1_1ResponseMIMETypes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RetentionPolicy = (input: RetentionPolicy, context: __SerdeContext): any => { return { - ...(input.HomeEfsFileSystem !== undefined && { HomeEfsFileSystem: input.HomeEfsFileSystem }), + ...(input.HomeEfsFileSystem !== undefined && + input.HomeEfsFileSystem !== null && { HomeEfsFileSystem: input.HomeEfsFileSystem }), }; }; const serializeAws_json1_1RuleParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1S3DataSource = (input: S3DataSource, context: __SerdeContext): any => { return { - ...(input.AttributeNames !== undefined && { - AttributeNames: serializeAws_json1_1AttributeNames(input.AttributeNames, context), - }), - ...(input.S3DataDistributionType !== undefined && { S3DataDistributionType: input.S3DataDistributionType }), - ...(input.S3DataType !== undefined && { S3DataType: input.S3DataType }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.AttributeNames !== undefined && + input.AttributeNames !== null && { + AttributeNames: serializeAws_json1_1AttributeNames(input.AttributeNames, context), + }), + ...(input.S3DataDistributionType !== undefined && + input.S3DataDistributionType !== null && { S3DataDistributionType: input.S3DataDistributionType }), + ...(input.S3DataType !== undefined && input.S3DataType !== null && { S3DataType: input.S3DataType }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1S3StorageConfig = (input: S3StorageConfig, context: __SerdeContext): any => { return { - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1ScheduleConfig = (input: ScheduleConfig, context: __SerdeContext): any => { return { - ...(input.ScheduleExpression !== undefined && { ScheduleExpression: input.ScheduleExpression }), + ...(input.ScheduleExpression !== undefined && + input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }), }; }; const serializeAws_json1_1SearchExpression = (input: SearchExpression, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), - ...(input.NestedFilters !== undefined && { - NestedFilters: serializeAws_json1_1NestedFiltersList(input.NestedFilters, context), - }), - ...(input.Operator !== undefined && { Operator: input.Operator }), - ...(input.SubExpressions !== undefined && { - SubExpressions: serializeAws_json1_1SearchExpressionList(input.SubExpressions, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FilterList(input.Filters, context) }), + ...(input.NestedFilters !== undefined && + input.NestedFilters !== null && { + NestedFilters: serializeAws_json1_1NestedFiltersList(input.NestedFilters, context), + }), + ...(input.Operator !== undefined && input.Operator !== null && { Operator: input.Operator }), + ...(input.SubExpressions !== undefined && + input.SubExpressions !== null && { + SubExpressions: serializeAws_json1_1SearchExpressionList(input.SubExpressions, context), + }), }; }; const serializeAws_json1_1SearchExpressionList = (input: SearchExpression[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SearchExpression(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SearchExpression(entry, context); + }); }; const serializeAws_json1_1SearchRequest = (input: SearchRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Resource !== undefined && { Resource: input.Resource }), - ...(input.SearchExpression !== undefined && { - SearchExpression: serializeAws_json1_1SearchExpression(input.SearchExpression, context), - }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Resource !== undefined && input.Resource !== null && { Resource: input.Resource }), + ...(input.SearchExpression !== undefined && + input.SearchExpression !== null && { + SearchExpression: serializeAws_json1_1SearchExpression(input.SearchExpression, context), + }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ServiceCatalogProvisioningDetails = ( @@ -21830,38 +22610,48 @@ const serializeAws_json1_1ServiceCatalogProvisioningDetails = ( context: __SerdeContext ): any => { return { - ...(input.PathId !== undefined && { PathId: input.PathId }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), - ...(input.ProvisioningParameters !== undefined && { - ProvisioningParameters: serializeAws_json1_1ProvisioningParameters(input.ProvisioningParameters, context), - }), + ...(input.PathId !== undefined && input.PathId !== null && { PathId: input.PathId }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.ProvisioningParameters !== undefined && + input.ProvisioningParameters !== null && { + ProvisioningParameters: serializeAws_json1_1ProvisioningParameters(input.ProvisioningParameters, context), + }), }; }; const serializeAws_json1_1SharingSettings = (input: SharingSettings, context: __SerdeContext): any => { return { - ...(input.NotebookOutputOption !== undefined && { NotebookOutputOption: input.NotebookOutputOption }), - ...(input.S3KmsKeyId !== undefined && { S3KmsKeyId: input.S3KmsKeyId }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), + ...(input.NotebookOutputOption !== undefined && + input.NotebookOutputOption !== null && { NotebookOutputOption: input.NotebookOutputOption }), + ...(input.S3KmsKeyId !== undefined && input.S3KmsKeyId !== null && { S3KmsKeyId: input.S3KmsKeyId }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), }; }; const serializeAws_json1_1ShuffleConfig = (input: ShuffleConfig, context: __SerdeContext): any => { return { - ...(input.Seed !== undefined && { Seed: input.Seed }), + ...(input.Seed !== undefined && input.Seed !== null && { Seed: input.Seed }), }; }; const serializeAws_json1_1SourceAlgorithm = (input: SourceAlgorithm, context: __SerdeContext): any => { return { - ...(input.AlgorithmName !== undefined && { AlgorithmName: input.AlgorithmName }), - ...(input.ModelDataUrl !== undefined && { ModelDataUrl: input.ModelDataUrl }), + ...(input.AlgorithmName !== undefined && input.AlgorithmName !== null && { AlgorithmName: input.AlgorithmName }), + ...(input.ModelDataUrl !== undefined && input.ModelDataUrl !== null && { ModelDataUrl: input.ModelDataUrl }), }; }; const serializeAws_json1_1SourceAlgorithmList = (input: SourceAlgorithm[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SourceAlgorithm(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SourceAlgorithm(entry, context); + }); }; const serializeAws_json1_1SourceAlgorithmSpecification = ( @@ -21869,15 +22659,17 @@ const serializeAws_json1_1SourceAlgorithmSpecification = ( context: __SerdeContext ): any => { return { - ...(input.SourceAlgorithms !== undefined && { - SourceAlgorithms: serializeAws_json1_1SourceAlgorithmList(input.SourceAlgorithms, context), - }), + ...(input.SourceAlgorithms !== undefined && + input.SourceAlgorithms !== null && { + SourceAlgorithms: serializeAws_json1_1SourceAlgorithmList(input.SourceAlgorithms, context), + }), }; }; const serializeAws_json1_1SourceIpConfig = (input: SourceIpConfig, context: __SerdeContext): any => { return { - ...(input.Cidrs !== undefined && { Cidrs: serializeAws_json1_1Cidrs(input.Cidrs, context) }), + ...(input.Cidrs !== undefined && + input.Cidrs !== null && { Cidrs: serializeAws_json1_1Cidrs(input.Cidrs, context) }), }; }; @@ -21886,7 +22678,8 @@ const serializeAws_json1_1StartMonitoringScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.MonitoringScheduleName !== undefined && { MonitoringScheduleName: input.MonitoringScheduleName }), + ...(input.MonitoringScheduleName !== undefined && + input.MonitoringScheduleName !== null && { MonitoringScheduleName: input.MonitoringScheduleName }), }; }; @@ -21895,7 +22688,8 @@ const serializeAws_json1_1StartNotebookInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookInstanceName !== undefined && { NotebookInstanceName: input.NotebookInstanceName }), + ...(input.NotebookInstanceName !== undefined && + input.NotebookInstanceName !== null && { NotebookInstanceName: input.NotebookInstanceName }), }; }; @@ -21905,22 +22699,25 @@ const serializeAws_json1_1StartPipelineExecutionRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.PipelineExecutionDescription !== undefined && { - PipelineExecutionDescription: input.PipelineExecutionDescription, - }), - ...(input.PipelineExecutionDisplayName !== undefined && { - PipelineExecutionDisplayName: input.PipelineExecutionDisplayName, - }), - ...(input.PipelineName !== undefined && { PipelineName: input.PipelineName }), - ...(input.PipelineParameters !== undefined && { - PipelineParameters: serializeAws_json1_1ParameterList(input.PipelineParameters, context), - }), + ...(input.PipelineExecutionDescription !== undefined && + input.PipelineExecutionDescription !== null && { + PipelineExecutionDescription: input.PipelineExecutionDescription, + }), + ...(input.PipelineExecutionDisplayName !== undefined && + input.PipelineExecutionDisplayName !== null && { + PipelineExecutionDisplayName: input.PipelineExecutionDisplayName, + }), + ...(input.PipelineName !== undefined && input.PipelineName !== null && { PipelineName: input.PipelineName }), + ...(input.PipelineParameters !== undefined && + input.PipelineParameters !== null && { + PipelineParameters: serializeAws_json1_1ParameterList(input.PipelineParameters, context), + }), }; }; const serializeAws_json1_1StopAutoMLJobRequest = (input: StopAutoMLJobRequest, context: __SerdeContext): any => { return { - ...(input.AutoMLJobName !== undefined && { AutoMLJobName: input.AutoMLJobName }), + ...(input.AutoMLJobName !== undefined && input.AutoMLJobName !== null && { AutoMLJobName: input.AutoMLJobName }), }; }; @@ -21929,7 +22726,8 @@ const serializeAws_json1_1StopCompilationJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.CompilationJobName !== undefined && { CompilationJobName: input.CompilationJobName }), + ...(input.CompilationJobName !== undefined && + input.CompilationJobName !== null && { CompilationJobName: input.CompilationJobName }), }; }; @@ -21938,7 +22736,8 @@ const serializeAws_json1_1StopEdgePackagingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.EdgePackagingJobName !== undefined && { EdgePackagingJobName: input.EdgePackagingJobName }), + ...(input.EdgePackagingJobName !== undefined && + input.EdgePackagingJobName !== null && { EdgePackagingJobName: input.EdgePackagingJobName }), }; }; @@ -21947,15 +22746,15 @@ const serializeAws_json1_1StopHyperParameterTuningJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.HyperParameterTuningJobName !== undefined && { - HyperParameterTuningJobName: input.HyperParameterTuningJobName, - }), + ...(input.HyperParameterTuningJobName !== undefined && + input.HyperParameterTuningJobName !== null && { HyperParameterTuningJobName: input.HyperParameterTuningJobName }), }; }; const serializeAws_json1_1StopLabelingJobRequest = (input: StopLabelingJobRequest, context: __SerdeContext): any => { return { - ...(input.LabelingJobName !== undefined && { LabelingJobName: input.LabelingJobName }), + ...(input.LabelingJobName !== undefined && + input.LabelingJobName !== null && { LabelingJobName: input.LabelingJobName }), }; }; @@ -21964,7 +22763,8 @@ const serializeAws_json1_1StopMonitoringScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.MonitoringScheduleName !== undefined && { MonitoringScheduleName: input.MonitoringScheduleName }), + ...(input.MonitoringScheduleName !== undefined && + input.MonitoringScheduleName !== null && { MonitoringScheduleName: input.MonitoringScheduleName }), }; }; @@ -21973,14 +22773,17 @@ const serializeAws_json1_1StopNotebookInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookInstanceName !== undefined && { NotebookInstanceName: input.NotebookInstanceName }), + ...(input.NotebookInstanceName !== undefined && + input.NotebookInstanceName !== null && { NotebookInstanceName: input.NotebookInstanceName }), }; }; const serializeAws_json1_1StoppingCondition = (input: StoppingCondition, context: __SerdeContext): any => { return { - ...(input.MaxRuntimeInSeconds !== undefined && { MaxRuntimeInSeconds: input.MaxRuntimeInSeconds }), - ...(input.MaxWaitTimeInSeconds !== undefined && { MaxWaitTimeInSeconds: input.MaxWaitTimeInSeconds }), + ...(input.MaxRuntimeInSeconds !== undefined && + input.MaxRuntimeInSeconds !== null && { MaxRuntimeInSeconds: input.MaxRuntimeInSeconds }), + ...(input.MaxWaitTimeInSeconds !== undefined && + input.MaxWaitTimeInSeconds !== null && { MaxWaitTimeInSeconds: input.MaxWaitTimeInSeconds }), }; }; @@ -21990,7 +22793,8 @@ const serializeAws_json1_1StopPipelineExecutionRequest = ( ): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.PipelineExecutionArn !== undefined && { PipelineExecutionArn: input.PipelineExecutionArn }), + ...(input.PipelineExecutionArn !== undefined && + input.PipelineExecutionArn !== null && { PipelineExecutionArn: input.PipelineExecutionArn }), }; }; @@ -21999,81 +22803,116 @@ const serializeAws_json1_1StopProcessingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProcessingJobName !== undefined && { ProcessingJobName: input.ProcessingJobName }), + ...(input.ProcessingJobName !== undefined && + input.ProcessingJobName !== null && { ProcessingJobName: input.ProcessingJobName }), }; }; const serializeAws_json1_1StopTrainingJobRequest = (input: StopTrainingJobRequest, context: __SerdeContext): any => { return { - ...(input.TrainingJobName !== undefined && { TrainingJobName: input.TrainingJobName }), + ...(input.TrainingJobName !== undefined && + input.TrainingJobName !== null && { TrainingJobName: input.TrainingJobName }), }; }; const serializeAws_json1_1StopTransformJobRequest = (input: StopTransformJobRequest, context: __SerdeContext): any => { return { - ...(input.TransformJobName !== undefined && { TransformJobName: input.TransformJobName }), + ...(input.TransformJobName !== undefined && + input.TransformJobName !== null && { TransformJobName: input.TransformJobName }), }; }; const serializeAws_json1_1Subnets = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SuggestionQuery = (input: SuggestionQuery, context: __SerdeContext): any => { return { - ...(input.PropertyNameQuery !== undefined && { - PropertyNameQuery: serializeAws_json1_1PropertyNameQuery(input.PropertyNameQuery, context), - }), + ...(input.PropertyNameQuery !== undefined && + input.PropertyNameQuery !== null && { + PropertyNameQuery: serializeAws_json1_1PropertyNameQuery(input.PropertyNameQuery, context), + }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TargetPlatform = (input: TargetPlatform, context: __SerdeContext): any => { return { - ...(input.Accelerator !== undefined && { Accelerator: input.Accelerator }), - ...(input.Arch !== undefined && { Arch: input.Arch }), - ...(input.Os !== undefined && { Os: input.Os }), + ...(input.Accelerator !== undefined && input.Accelerator !== null && { Accelerator: input.Accelerator }), + ...(input.Arch !== undefined && input.Arch !== null && { Arch: input.Arch }), + ...(input.Os !== undefined && input.Os !== null && { Os: input.Os }), }; }; const serializeAws_json1_1TaskKeywords = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TensorBoardAppSettings = (input: TensorBoardAppSettings, context: __SerdeContext): any => { return { - ...(input.DefaultResourceSpec !== undefined && { - DefaultResourceSpec: serializeAws_json1_1ResourceSpec(input.DefaultResourceSpec, context), - }), + ...(input.DefaultResourceSpec !== undefined && + input.DefaultResourceSpec !== null && { + DefaultResourceSpec: serializeAws_json1_1ResourceSpec(input.DefaultResourceSpec, context), + }), }; }; const serializeAws_json1_1TensorBoardOutputConfig = (input: TensorBoardOutputConfig, context: __SerdeContext): any => { return { - ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), + ...(input.LocalPath !== undefined && input.LocalPath !== null && { LocalPath: input.LocalPath }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), }; }; const serializeAws_json1_1TrafficRoutingConfig = (input: TrafficRoutingConfig, context: __SerdeContext): any => { return { - ...(input.CanarySize !== undefined && { CanarySize: serializeAws_json1_1CapacitySize(input.CanarySize, context) }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.WaitIntervalInSeconds !== undefined && { WaitIntervalInSeconds: input.WaitIntervalInSeconds }), + ...(input.CanarySize !== undefined && + input.CanarySize !== null && { CanarySize: serializeAws_json1_1CapacitySize(input.CanarySize, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.WaitIntervalInSeconds !== undefined && + input.WaitIntervalInSeconds !== null && { WaitIntervalInSeconds: input.WaitIntervalInSeconds }), }; }; @@ -22081,69 +22920,88 @@ const serializeAws_json1_1TrainingInstanceTypes = ( input: (TrainingInstanceType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TrainingJobDefinition = (input: TrainingJobDefinition, context: __SerdeContext): any => { return { - ...(input.HyperParameters !== undefined && { - HyperParameters: serializeAws_json1_1HyperParameters(input.HyperParameters, context), - }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.ResourceConfig !== undefined && { - ResourceConfig: serializeAws_json1_1ResourceConfig(input.ResourceConfig, context), - }), - ...(input.StoppingCondition !== undefined && { - StoppingCondition: serializeAws_json1_1StoppingCondition(input.StoppingCondition, context), - }), - ...(input.TrainingInputMode !== undefined && { TrainingInputMode: input.TrainingInputMode }), + ...(input.HyperParameters !== undefined && + input.HyperParameters !== null && { + HyperParameters: serializeAws_json1_1HyperParameters(input.HyperParameters, context), + }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.ResourceConfig !== undefined && + input.ResourceConfig !== null && { + ResourceConfig: serializeAws_json1_1ResourceConfig(input.ResourceConfig, context), + }), + ...(input.StoppingCondition !== undefined && + input.StoppingCondition !== null && { + StoppingCondition: serializeAws_json1_1StoppingCondition(input.StoppingCondition, context), + }), + ...(input.TrainingInputMode !== undefined && + input.TrainingInputMode !== null && { TrainingInputMode: input.TrainingInputMode }), }; }; const serializeAws_json1_1TrainingSpecification = (input: TrainingSpecification, context: __SerdeContext): any => { return { - ...(input.MetricDefinitions !== undefined && { - MetricDefinitions: serializeAws_json1_1MetricDefinitionList(input.MetricDefinitions, context), - }), - ...(input.SupportedHyperParameters !== undefined && { - SupportedHyperParameters: serializeAws_json1_1HyperParameterSpecifications( - input.SupportedHyperParameters, - context - ), - }), - ...(input.SupportedTrainingInstanceTypes !== undefined && { - SupportedTrainingInstanceTypes: serializeAws_json1_1TrainingInstanceTypes( - input.SupportedTrainingInstanceTypes, - context - ), - }), - ...(input.SupportedTuningJobObjectiveMetrics !== undefined && { - SupportedTuningJobObjectiveMetrics: serializeAws_json1_1HyperParameterTuningJobObjectives( - input.SupportedTuningJobObjectiveMetrics, - context - ), - }), - ...(input.SupportsDistributedTraining !== undefined && { - SupportsDistributedTraining: input.SupportsDistributedTraining, - }), - ...(input.TrainingChannels !== undefined && { - TrainingChannels: serializeAws_json1_1ChannelSpecifications(input.TrainingChannels, context), - }), - ...(input.TrainingImage !== undefined && { TrainingImage: input.TrainingImage }), - ...(input.TrainingImageDigest !== undefined && { TrainingImageDigest: input.TrainingImageDigest }), + ...(input.MetricDefinitions !== undefined && + input.MetricDefinitions !== null && { + MetricDefinitions: serializeAws_json1_1MetricDefinitionList(input.MetricDefinitions, context), + }), + ...(input.SupportedHyperParameters !== undefined && + input.SupportedHyperParameters !== null && { + SupportedHyperParameters: serializeAws_json1_1HyperParameterSpecifications( + input.SupportedHyperParameters, + context + ), + }), + ...(input.SupportedTrainingInstanceTypes !== undefined && + input.SupportedTrainingInstanceTypes !== null && { + SupportedTrainingInstanceTypes: serializeAws_json1_1TrainingInstanceTypes( + input.SupportedTrainingInstanceTypes, + context + ), + }), + ...(input.SupportedTuningJobObjectiveMetrics !== undefined && + input.SupportedTuningJobObjectiveMetrics !== null && { + SupportedTuningJobObjectiveMetrics: serializeAws_json1_1HyperParameterTuningJobObjectives( + input.SupportedTuningJobObjectiveMetrics, + context + ), + }), + ...(input.SupportsDistributedTraining !== undefined && + input.SupportsDistributedTraining !== null && { SupportsDistributedTraining: input.SupportsDistributedTraining }), + ...(input.TrainingChannels !== undefined && + input.TrainingChannels !== null && { + TrainingChannels: serializeAws_json1_1ChannelSpecifications(input.TrainingChannels, context), + }), + ...(input.TrainingImage !== undefined && input.TrainingImage !== null && { TrainingImage: input.TrainingImage }), + ...(input.TrainingImageDigest !== undefined && + input.TrainingImageDigest !== null && { TrainingImageDigest: input.TrainingImageDigest }), }; }; const serializeAws_json1_1TransformDataSource = (input: TransformDataSource, context: __SerdeContext): any => { return { - ...(input.S3DataSource !== undefined && { - S3DataSource: serializeAws_json1_1TransformS3DataSource(input.S3DataSource, context), - }), + ...(input.S3DataSource !== undefined && + input.S3DataSource !== null && { + S3DataSource: serializeAws_json1_1TransformS3DataSource(input.S3DataSource, context), + }), }; }; @@ -22151,23 +23009,25 @@ const serializeAws_json1_1TransformEnvironmentMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1TransformInput = (input: TransformInput, context: __SerdeContext): any => { return { - ...(input.CompressionType !== undefined && { CompressionType: input.CompressionType }), - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), - ...(input.DataSource !== undefined && { - DataSource: serializeAws_json1_1TransformDataSource(input.DataSource, context), - }), - ...(input.SplitType !== undefined && { SplitType: input.SplitType }), + ...(input.CompressionType !== undefined && + input.CompressionType !== null && { CompressionType: input.CompressionType }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), + ...(input.DataSource !== undefined && + input.DataSource !== null && { DataSource: serializeAws_json1_1TransformDataSource(input.DataSource, context) }), + ...(input.SplitType !== undefined && input.SplitType !== null && { SplitType: input.SplitType }), }; }; @@ -22175,57 +23035,71 @@ const serializeAws_json1_1TransformInstanceTypes = ( input: (TransformInstanceType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TransformJobDefinition = (input: TransformJobDefinition, context: __SerdeContext): any => { return { - ...(input.BatchStrategy !== undefined && { BatchStrategy: input.BatchStrategy }), - ...(input.Environment !== undefined && { - Environment: serializeAws_json1_1TransformEnvironmentMap(input.Environment, context), - }), - ...(input.MaxConcurrentTransforms !== undefined && { MaxConcurrentTransforms: input.MaxConcurrentTransforms }), - ...(input.MaxPayloadInMB !== undefined && { MaxPayloadInMB: input.MaxPayloadInMB }), - ...(input.TransformInput !== undefined && { - TransformInput: serializeAws_json1_1TransformInput(input.TransformInput, context), - }), - ...(input.TransformOutput !== undefined && { - TransformOutput: serializeAws_json1_1TransformOutput(input.TransformOutput, context), - }), - ...(input.TransformResources !== undefined && { - TransformResources: serializeAws_json1_1TransformResources(input.TransformResources, context), - }), + ...(input.BatchStrategy !== undefined && input.BatchStrategy !== null && { BatchStrategy: input.BatchStrategy }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_json1_1TransformEnvironmentMap(input.Environment, context), + }), + ...(input.MaxConcurrentTransforms !== undefined && + input.MaxConcurrentTransforms !== null && { MaxConcurrentTransforms: input.MaxConcurrentTransforms }), + ...(input.MaxPayloadInMB !== undefined && + input.MaxPayloadInMB !== null && { MaxPayloadInMB: input.MaxPayloadInMB }), + ...(input.TransformInput !== undefined && + input.TransformInput !== null && { + TransformInput: serializeAws_json1_1TransformInput(input.TransformInput, context), + }), + ...(input.TransformOutput !== undefined && + input.TransformOutput !== null && { + TransformOutput: serializeAws_json1_1TransformOutput(input.TransformOutput, context), + }), + ...(input.TransformResources !== undefined && + input.TransformResources !== null && { + TransformResources: serializeAws_json1_1TransformResources(input.TransformResources, context), + }), }; }; const serializeAws_json1_1TransformOutput = (input: TransformOutput, context: __SerdeContext): any => { return { - ...(input.Accept !== undefined && { Accept: input.Accept }), - ...(input.AssembleWith !== undefined && { AssembleWith: input.AssembleWith }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.S3OutputPath !== undefined && { S3OutputPath: input.S3OutputPath }), + ...(input.Accept !== undefined && input.Accept !== null && { Accept: input.Accept }), + ...(input.AssembleWith !== undefined && input.AssembleWith !== null && { AssembleWith: input.AssembleWith }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputPath !== undefined && input.S3OutputPath !== null && { S3OutputPath: input.S3OutputPath }), }; }; const serializeAws_json1_1TransformResources = (input: TransformResources, context: __SerdeContext): any => { return { - ...(input.InstanceCount !== undefined && { InstanceCount: input.InstanceCount }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.VolumeKmsKeyId !== undefined && { VolumeKmsKeyId: input.VolumeKmsKeyId }), + ...(input.InstanceCount !== undefined && input.InstanceCount !== null && { InstanceCount: input.InstanceCount }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.VolumeKmsKeyId !== undefined && + input.VolumeKmsKeyId !== null && { VolumeKmsKeyId: input.VolumeKmsKeyId }), }; }; const serializeAws_json1_1TransformS3DataSource = (input: TransformS3DataSource, context: __SerdeContext): any => { return { - ...(input.S3DataType !== undefined && { S3DataType: input.S3DataType }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.S3DataType !== undefined && input.S3DataType !== null && { S3DataType: input.S3DataType }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1TrialComponentArtifact = (input: TrialComponentArtifact, context: __SerdeContext): any => { return { - ...(input.MediaType !== undefined && { MediaType: input.MediaType }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.MediaType !== undefined && input.MediaType !== null && { MediaType: input.MediaType }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -22233,13 +23107,15 @@ const serializeAws_json1_1TrialComponentArtifacts = ( input: { [key: string]: TrialComponentArtifact }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: TrialComponentArtifact }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: TrialComponentArtifact }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1TrialComponentArtifact(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1TrialComponentParameters = ( @@ -22247,10 +23123,15 @@ const serializeAws_json1_1TrialComponentParameters = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: TrialComponentParameterValue }, [key, value]: [string, any]) => ({ - ...acc, - [key]: serializeAws_json1_1TrialComponentParameterValue(value, context), - }), + (acc: { [key: string]: TrialComponentParameterValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_json1_1TrialComponentParameterValue(value, context), + }; + }, {} ); }; @@ -22268,8 +23149,8 @@ const serializeAws_json1_1TrialComponentParameterValue = ( const serializeAws_json1_1TrialComponentStatus = (input: TrialComponentStatus, context: __SerdeContext): any => { return { - ...(input.Message !== undefined && { Message: input.Message }), - ...(input.PrimaryStatus !== undefined && { PrimaryStatus: input.PrimaryStatus }), + ...(input.Message !== undefined && input.Message !== null && { Message: input.Message }), + ...(input.PrimaryStatus !== undefined && input.PrimaryStatus !== null && { PrimaryStatus: input.PrimaryStatus }), }; }; @@ -22278,36 +23159,39 @@ const serializeAws_json1_1TuningJobCompletionCriteria = ( context: __SerdeContext ): any => { return { - ...(input.TargetObjectiveMetricValue !== undefined && { - TargetObjectiveMetricValue: input.TargetObjectiveMetricValue, - }), + ...(input.TargetObjectiveMetricValue !== undefined && + input.TargetObjectiveMetricValue !== null && { TargetObjectiveMetricValue: input.TargetObjectiveMetricValue }), }; }; const serializeAws_json1_1UiConfig = (input: UiConfig, context: __SerdeContext): any => { return { - ...(input.HumanTaskUiArn !== undefined && { HumanTaskUiArn: input.HumanTaskUiArn }), - ...(input.UiTemplateS3Uri !== undefined && { UiTemplateS3Uri: input.UiTemplateS3Uri }), + ...(input.HumanTaskUiArn !== undefined && + input.HumanTaskUiArn !== null && { HumanTaskUiArn: input.HumanTaskUiArn }), + ...(input.UiTemplateS3Uri !== undefined && + input.UiTemplateS3Uri !== null && { UiTemplateS3Uri: input.UiTemplateS3Uri }), }; }; const serializeAws_json1_1UiTemplate = (input: UiTemplate, context: __SerdeContext): any => { return { - ...(input.Content !== undefined && { Content: input.Content }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), }; }; const serializeAws_json1_1UpdateActionRequest = (input: UpdateActionRequest, context: __SerdeContext): any => { return { - ...(input.ActionName !== undefined && { ActionName: input.ActionName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Properties !== undefined && { - Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), - }), - ...(input.PropertiesToRemove !== undefined && { - PropertiesToRemove: serializeAws_json1_1ListLineageEntityParameterKey(input.PropertiesToRemove, context), - }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.ActionName !== undefined && input.ActionName !== null && { ActionName: input.ActionName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Properties !== undefined && + input.Properties !== null && { + Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), + }), + ...(input.PropertiesToRemove !== undefined && + input.PropertiesToRemove !== null && { + PropertiesToRemove: serializeAws_json1_1ListLineageEntityParameterKey(input.PropertiesToRemove, context), + }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -22316,23 +23200,27 @@ const serializeAws_json1_1UpdateAppImageConfigRequest = ( context: __SerdeContext ): any => { return { - ...(input.AppImageConfigName !== undefined && { AppImageConfigName: input.AppImageConfigName }), - ...(input.KernelGatewayImageConfig !== undefined && { - KernelGatewayImageConfig: serializeAws_json1_1KernelGatewayImageConfig(input.KernelGatewayImageConfig, context), - }), + ...(input.AppImageConfigName !== undefined && + input.AppImageConfigName !== null && { AppImageConfigName: input.AppImageConfigName }), + ...(input.KernelGatewayImageConfig !== undefined && + input.KernelGatewayImageConfig !== null && { + KernelGatewayImageConfig: serializeAws_json1_1KernelGatewayImageConfig(input.KernelGatewayImageConfig, context), + }), }; }; const serializeAws_json1_1UpdateArtifactRequest = (input: UpdateArtifactRequest, context: __SerdeContext): any => { return { - ...(input.ArtifactArn !== undefined && { ArtifactArn: input.ArtifactArn }), - ...(input.ArtifactName !== undefined && { ArtifactName: input.ArtifactName }), - ...(input.Properties !== undefined && { - Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), - }), - ...(input.PropertiesToRemove !== undefined && { - PropertiesToRemove: serializeAws_json1_1ListLineageEntityParameterKey(input.PropertiesToRemove, context), - }), + ...(input.ArtifactArn !== undefined && input.ArtifactArn !== null && { ArtifactArn: input.ArtifactArn }), + ...(input.ArtifactName !== undefined && input.ArtifactName !== null && { ArtifactName: input.ArtifactName }), + ...(input.Properties !== undefined && + input.Properties !== null && { + Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), + }), + ...(input.PropertiesToRemove !== undefined && + input.PropertiesToRemove !== null && { + PropertiesToRemove: serializeAws_json1_1ListLineageEntityParameterKey(input.PropertiesToRemove, context), + }), }; }; @@ -22341,23 +23229,25 @@ const serializeAws_json1_1UpdateCodeRepositoryInput = ( context: __SerdeContext ): any => { return { - ...(input.CodeRepositoryName !== undefined && { CodeRepositoryName: input.CodeRepositoryName }), - ...(input.GitConfig !== undefined && { - GitConfig: serializeAws_json1_1GitConfigForUpdate(input.GitConfig, context), - }), + ...(input.CodeRepositoryName !== undefined && + input.CodeRepositoryName !== null && { CodeRepositoryName: input.CodeRepositoryName }), + ...(input.GitConfig !== undefined && + input.GitConfig !== null && { GitConfig: serializeAws_json1_1GitConfigForUpdate(input.GitConfig, context) }), }; }; const serializeAws_json1_1UpdateContextRequest = (input: UpdateContextRequest, context: __SerdeContext): any => { return { - ...(input.ContextName !== undefined && { ContextName: input.ContextName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Properties !== undefined && { - Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), - }), - ...(input.PropertiesToRemove !== undefined && { - PropertiesToRemove: serializeAws_json1_1ListLineageEntityParameterKey(input.PropertiesToRemove, context), - }), + ...(input.ContextName !== undefined && input.ContextName !== null && { ContextName: input.ContextName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Properties !== undefined && + input.Properties !== null && { + Properties: serializeAws_json1_1LineageEntityParameters(input.Properties, context), + }), + ...(input.PropertiesToRemove !== undefined && + input.PropertiesToRemove !== null && { + PropertiesToRemove: serializeAws_json1_1ListLineageEntityParameterKey(input.PropertiesToRemove, context), + }), }; }; @@ -22366,47 +23256,54 @@ const serializeAws_json1_1UpdateDeviceFleetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_json1_1EdgeOutputConfig(input.OutputConfig, context), - }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { + OutputConfig: serializeAws_json1_1EdgeOutputConfig(input.OutputConfig, context), + }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_json1_1UpdateDevicesRequest = (input: UpdateDevicesRequest, context: __SerdeContext): any => { return { - ...(input.DeviceFleetName !== undefined && { DeviceFleetName: input.DeviceFleetName }), - ...(input.Devices !== undefined && { Devices: serializeAws_json1_1Devices(input.Devices, context) }), + ...(input.DeviceFleetName !== undefined && + input.DeviceFleetName !== null && { DeviceFleetName: input.DeviceFleetName }), + ...(input.Devices !== undefined && + input.Devices !== null && { Devices: serializeAws_json1_1Devices(input.Devices, context) }), }; }; const serializeAws_json1_1UpdateDomainRequest = (input: UpdateDomainRequest, context: __SerdeContext): any => { return { - ...(input.DefaultUserSettings !== undefined && { - DefaultUserSettings: serializeAws_json1_1UserSettings(input.DefaultUserSettings, context), - }), - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), + ...(input.DefaultUserSettings !== undefined && + input.DefaultUserSettings !== null && { + DefaultUserSettings: serializeAws_json1_1UserSettings(input.DefaultUserSettings, context), + }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), }; }; const serializeAws_json1_1UpdateEndpointInput = (input: UpdateEndpointInput, context: __SerdeContext): any => { return { - ...(input.DeploymentConfig !== undefined && { - DeploymentConfig: serializeAws_json1_1DeploymentConfig(input.DeploymentConfig, context), - }), - ...(input.EndpointConfigName !== undefined && { EndpointConfigName: input.EndpointConfigName }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), - ...(input.ExcludeRetainedVariantProperties !== undefined && { - ExcludeRetainedVariantProperties: serializeAws_json1_1VariantPropertyList( - input.ExcludeRetainedVariantProperties, - context - ), - }), - ...(input.RetainAllVariantProperties !== undefined && { - RetainAllVariantProperties: input.RetainAllVariantProperties, - }), + ...(input.DeploymentConfig !== undefined && + input.DeploymentConfig !== null && { + DeploymentConfig: serializeAws_json1_1DeploymentConfig(input.DeploymentConfig, context), + }), + ...(input.EndpointConfigName !== undefined && + input.EndpointConfigName !== null && { EndpointConfigName: input.EndpointConfigName }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), + ...(input.ExcludeRetainedVariantProperties !== undefined && + input.ExcludeRetainedVariantProperties !== null && { + ExcludeRetainedVariantProperties: serializeAws_json1_1VariantPropertyList( + input.ExcludeRetainedVariantProperties, + context + ), + }), + ...(input.RetainAllVariantProperties !== undefined && + input.RetainAllVariantProperties !== null && { RetainAllVariantProperties: input.RetainAllVariantProperties }), }; }; @@ -22415,41 +23312,47 @@ const serializeAws_json1_1UpdateEndpointWeightsAndCapacitiesInput = ( context: __SerdeContext ): any => { return { - ...(input.DesiredWeightsAndCapacities !== undefined && { - DesiredWeightsAndCapacities: serializeAws_json1_1DesiredWeightAndCapacityList( - input.DesiredWeightsAndCapacities, - context - ), - }), - ...(input.EndpointName !== undefined && { EndpointName: input.EndpointName }), + ...(input.DesiredWeightsAndCapacities !== undefined && + input.DesiredWeightsAndCapacities !== null && { + DesiredWeightsAndCapacities: serializeAws_json1_1DesiredWeightAndCapacityList( + input.DesiredWeightsAndCapacities, + context + ), + }), + ...(input.EndpointName !== undefined && input.EndpointName !== null && { EndpointName: input.EndpointName }), }; }; const serializeAws_json1_1UpdateExperimentRequest = (input: UpdateExperimentRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.ExperimentName !== undefined && { ExperimentName: input.ExperimentName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.ExperimentName !== undefined && + input.ExperimentName !== null && { ExperimentName: input.ExperimentName }), }; }; const serializeAws_json1_1UpdateImageRequest = (input: UpdateImageRequest, context: __SerdeContext): any => { return { - ...(input.DeleteProperties !== undefined && { - DeleteProperties: serializeAws_json1_1ImageDeletePropertyList(input.DeleteProperties, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.DeleteProperties !== undefined && + input.DeleteProperties !== null && { + DeleteProperties: serializeAws_json1_1ImageDeletePropertyList(input.DeleteProperties, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; const serializeAws_json1_1UpdateModelPackageInput = (input: UpdateModelPackageInput, context: __SerdeContext): any => { return { - ...(input.ApprovalDescription !== undefined && { ApprovalDescription: input.ApprovalDescription }), - ...(input.ModelApprovalStatus !== undefined && { ModelApprovalStatus: input.ModelApprovalStatus }), - ...(input.ModelPackageArn !== undefined && { ModelPackageArn: input.ModelPackageArn }), + ...(input.ApprovalDescription !== undefined && + input.ApprovalDescription !== null && { ApprovalDescription: input.ApprovalDescription }), + ...(input.ModelApprovalStatus !== undefined && + input.ModelApprovalStatus !== null && { ModelApprovalStatus: input.ModelApprovalStatus }), + ...(input.ModelPackageArn !== undefined && + input.ModelPackageArn !== null && { ModelPackageArn: input.ModelPackageArn }), }; }; @@ -22458,10 +23361,12 @@ const serializeAws_json1_1UpdateMonitoringScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.MonitoringScheduleConfig !== undefined && { - MonitoringScheduleConfig: serializeAws_json1_1MonitoringScheduleConfig(input.MonitoringScheduleConfig, context), - }), - ...(input.MonitoringScheduleName !== undefined && { MonitoringScheduleName: input.MonitoringScheduleName }), + ...(input.MonitoringScheduleConfig !== undefined && + input.MonitoringScheduleConfig !== null && { + MonitoringScheduleConfig: serializeAws_json1_1MonitoringScheduleConfig(input.MonitoringScheduleConfig, context), + }), + ...(input.MonitoringScheduleName !== undefined && + input.MonitoringScheduleName !== null && { MonitoringScheduleName: input.MonitoringScheduleName }), }; }; @@ -22470,34 +23375,42 @@ const serializeAws_json1_1UpdateNotebookInstanceInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceleratorTypes !== undefined && { - AcceleratorTypes: serializeAws_json1_1NotebookInstanceAcceleratorTypes(input.AcceleratorTypes, context), - }), - ...(input.AdditionalCodeRepositories !== undefined && { - AdditionalCodeRepositories: serializeAws_json1_1AdditionalCodeRepositoryNamesOrUrls( - input.AdditionalCodeRepositories, - context - ), - }), - ...(input.DefaultCodeRepository !== undefined && { DefaultCodeRepository: input.DefaultCodeRepository }), - ...(input.DisassociateAcceleratorTypes !== undefined && { - DisassociateAcceleratorTypes: input.DisassociateAcceleratorTypes, - }), - ...(input.DisassociateAdditionalCodeRepositories !== undefined && { - DisassociateAdditionalCodeRepositories: input.DisassociateAdditionalCodeRepositories, - }), - ...(input.DisassociateDefaultCodeRepository !== undefined && { - DisassociateDefaultCodeRepository: input.DisassociateDefaultCodeRepository, - }), - ...(input.DisassociateLifecycleConfig !== undefined && { - DisassociateLifecycleConfig: input.DisassociateLifecycleConfig, - }), - ...(input.InstanceType !== undefined && { InstanceType: input.InstanceType }), - ...(input.LifecycleConfigName !== undefined && { LifecycleConfigName: input.LifecycleConfigName }), - ...(input.NotebookInstanceName !== undefined && { NotebookInstanceName: input.NotebookInstanceName }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.RootAccess !== undefined && { RootAccess: input.RootAccess }), - ...(input.VolumeSizeInGB !== undefined && { VolumeSizeInGB: input.VolumeSizeInGB }), + ...(input.AcceleratorTypes !== undefined && + input.AcceleratorTypes !== null && { + AcceleratorTypes: serializeAws_json1_1NotebookInstanceAcceleratorTypes(input.AcceleratorTypes, context), + }), + ...(input.AdditionalCodeRepositories !== undefined && + input.AdditionalCodeRepositories !== null && { + AdditionalCodeRepositories: serializeAws_json1_1AdditionalCodeRepositoryNamesOrUrls( + input.AdditionalCodeRepositories, + context + ), + }), + ...(input.DefaultCodeRepository !== undefined && + input.DefaultCodeRepository !== null && { DefaultCodeRepository: input.DefaultCodeRepository }), + ...(input.DisassociateAcceleratorTypes !== undefined && + input.DisassociateAcceleratorTypes !== null && { + DisassociateAcceleratorTypes: input.DisassociateAcceleratorTypes, + }), + ...(input.DisassociateAdditionalCodeRepositories !== undefined && + input.DisassociateAdditionalCodeRepositories !== null && { + DisassociateAdditionalCodeRepositories: input.DisassociateAdditionalCodeRepositories, + }), + ...(input.DisassociateDefaultCodeRepository !== undefined && + input.DisassociateDefaultCodeRepository !== null && { + DisassociateDefaultCodeRepository: input.DisassociateDefaultCodeRepository, + }), + ...(input.DisassociateLifecycleConfig !== undefined && + input.DisassociateLifecycleConfig !== null && { DisassociateLifecycleConfig: input.DisassociateLifecycleConfig }), + ...(input.InstanceType !== undefined && input.InstanceType !== null && { InstanceType: input.InstanceType }), + ...(input.LifecycleConfigName !== undefined && + input.LifecycleConfigName !== null && { LifecycleConfigName: input.LifecycleConfigName }), + ...(input.NotebookInstanceName !== undefined && + input.NotebookInstanceName !== null && { NotebookInstanceName: input.NotebookInstanceName }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.RootAccess !== undefined && input.RootAccess !== null && { RootAccess: input.RootAccess }), + ...(input.VolumeSizeInGB !== undefined && + input.VolumeSizeInGB !== null && { VolumeSizeInGB: input.VolumeSizeInGB }), }; }; @@ -22506,15 +23419,18 @@ const serializeAws_json1_1UpdateNotebookInstanceLifecycleConfigInput = ( context: __SerdeContext ): any => { return { - ...(input.NotebookInstanceLifecycleConfigName !== undefined && { - NotebookInstanceLifecycleConfigName: input.NotebookInstanceLifecycleConfigName, - }), - ...(input.OnCreate !== undefined && { - OnCreate: serializeAws_json1_1NotebookInstanceLifecycleConfigList(input.OnCreate, context), - }), - ...(input.OnStart !== undefined && { - OnStart: serializeAws_json1_1NotebookInstanceLifecycleConfigList(input.OnStart, context), - }), + ...(input.NotebookInstanceLifecycleConfigName !== undefined && + input.NotebookInstanceLifecycleConfigName !== null && { + NotebookInstanceLifecycleConfigName: input.NotebookInstanceLifecycleConfigName, + }), + ...(input.OnCreate !== undefined && + input.OnCreate !== null && { + OnCreate: serializeAws_json1_1NotebookInstanceLifecycleConfigList(input.OnCreate, context), + }), + ...(input.OnStart !== undefined && + input.OnStart !== null && { + OnStart: serializeAws_json1_1NotebookInstanceLifecycleConfigList(input.OnStart, context), + }), }; }; @@ -22523,23 +23439,29 @@ const serializeAws_json1_1UpdatePipelineExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.PipelineExecutionArn !== undefined && { PipelineExecutionArn: input.PipelineExecutionArn }), - ...(input.PipelineExecutionDescription !== undefined && { - PipelineExecutionDescription: input.PipelineExecutionDescription, - }), - ...(input.PipelineExecutionDisplayName !== undefined && { - PipelineExecutionDisplayName: input.PipelineExecutionDisplayName, - }), + ...(input.PipelineExecutionArn !== undefined && + input.PipelineExecutionArn !== null && { PipelineExecutionArn: input.PipelineExecutionArn }), + ...(input.PipelineExecutionDescription !== undefined && + input.PipelineExecutionDescription !== null && { + PipelineExecutionDescription: input.PipelineExecutionDescription, + }), + ...(input.PipelineExecutionDisplayName !== undefined && + input.PipelineExecutionDisplayName !== null && { + PipelineExecutionDisplayName: input.PipelineExecutionDisplayName, + }), }; }; const serializeAws_json1_1UpdatePipelineRequest = (input: UpdatePipelineRequest, context: __SerdeContext): any => { return { - ...(input.PipelineDefinition !== undefined && { PipelineDefinition: input.PipelineDefinition }), - ...(input.PipelineDescription !== undefined && { PipelineDescription: input.PipelineDescription }), - ...(input.PipelineDisplayName !== undefined && { PipelineDisplayName: input.PipelineDisplayName }), - ...(input.PipelineName !== undefined && { PipelineName: input.PipelineName }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.PipelineDefinition !== undefined && + input.PipelineDefinition !== null && { PipelineDefinition: input.PipelineDefinition }), + ...(input.PipelineDescription !== undefined && + input.PipelineDescription !== null && { PipelineDescription: input.PipelineDescription }), + ...(input.PipelineDisplayName !== undefined && + input.PipelineDisplayName !== null && { PipelineDisplayName: input.PipelineDisplayName }), + ...(input.PipelineName !== undefined && input.PipelineName !== null && { PipelineName: input.PipelineName }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; @@ -22548,16 +23470,19 @@ const serializeAws_json1_1UpdateTrainingJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProfilerConfig !== undefined && { - ProfilerConfig: serializeAws_json1_1ProfilerConfigForUpdate(input.ProfilerConfig, context), - }), - ...(input.ProfilerRuleConfigurations !== undefined && { - ProfilerRuleConfigurations: serializeAws_json1_1ProfilerRuleConfigurations( - input.ProfilerRuleConfigurations, - context - ), - }), - ...(input.TrainingJobName !== undefined && { TrainingJobName: input.TrainingJobName }), + ...(input.ProfilerConfig !== undefined && + input.ProfilerConfig !== null && { + ProfilerConfig: serializeAws_json1_1ProfilerConfigForUpdate(input.ProfilerConfig, context), + }), + ...(input.ProfilerRuleConfigurations !== undefined && + input.ProfilerRuleConfigurations !== null && { + ProfilerRuleConfigurations: serializeAws_json1_1ProfilerRuleConfigurations( + input.ProfilerRuleConfigurations, + context + ), + }), + ...(input.TrainingJobName !== undefined && + input.TrainingJobName !== null && { TrainingJobName: input.TrainingJobName }), }; }; @@ -22566,36 +23491,46 @@ const serializeAws_json1_1UpdateTrialComponentRequest = ( context: __SerdeContext ): any => { return { - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.InputArtifacts !== undefined && { - InputArtifacts: serializeAws_json1_1TrialComponentArtifacts(input.InputArtifacts, context), - }), - ...(input.InputArtifactsToRemove !== undefined && { - InputArtifactsToRemove: serializeAws_json1_1ListTrialComponentKey256(input.InputArtifactsToRemove, context), - }), - ...(input.OutputArtifacts !== undefined && { - OutputArtifacts: serializeAws_json1_1TrialComponentArtifacts(input.OutputArtifacts, context), - }), - ...(input.OutputArtifactsToRemove !== undefined && { - OutputArtifactsToRemove: serializeAws_json1_1ListTrialComponentKey256(input.OutputArtifactsToRemove, context), - }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1TrialComponentParameters(input.Parameters, context), - }), - ...(input.ParametersToRemove !== undefined && { - ParametersToRemove: serializeAws_json1_1ListTrialComponentKey256(input.ParametersToRemove, context), - }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), - ...(input.Status !== undefined && { Status: serializeAws_json1_1TrialComponentStatus(input.Status, context) }), - ...(input.TrialComponentName !== undefined && { TrialComponentName: input.TrialComponentName }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.InputArtifacts !== undefined && + input.InputArtifacts !== null && { + InputArtifacts: serializeAws_json1_1TrialComponentArtifacts(input.InputArtifacts, context), + }), + ...(input.InputArtifactsToRemove !== undefined && + input.InputArtifactsToRemove !== null && { + InputArtifactsToRemove: serializeAws_json1_1ListTrialComponentKey256(input.InputArtifactsToRemove, context), + }), + ...(input.OutputArtifacts !== undefined && + input.OutputArtifacts !== null && { + OutputArtifacts: serializeAws_json1_1TrialComponentArtifacts(input.OutputArtifacts, context), + }), + ...(input.OutputArtifactsToRemove !== undefined && + input.OutputArtifactsToRemove !== null && { + OutputArtifactsToRemove: serializeAws_json1_1ListTrialComponentKey256(input.OutputArtifactsToRemove, context), + }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_1TrialComponentParameters(input.Parameters, context), + }), + ...(input.ParametersToRemove !== undefined && + input.ParametersToRemove !== null && { + ParametersToRemove: serializeAws_json1_1ListTrialComponentKey256(input.ParametersToRemove, context), + }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.Status !== undefined && + input.Status !== null && { Status: serializeAws_json1_1TrialComponentStatus(input.Status, context) }), + ...(input.TrialComponentName !== undefined && + input.TrialComponentName !== null && { TrialComponentName: input.TrialComponentName }), }; }; const serializeAws_json1_1UpdateTrialRequest = (input: UpdateTrialRequest, context: __SerdeContext): any => { return { - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.TrialName !== undefined && { TrialName: input.TrialName }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.TrialName !== undefined && input.TrialName !== null && { TrialName: input.TrialName }), }; }; @@ -22604,90 +23539,117 @@ const serializeAws_json1_1UpdateUserProfileRequest = ( context: __SerdeContext ): any => { return { - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.UserProfileName !== undefined && { UserProfileName: input.UserProfileName }), - ...(input.UserSettings !== undefined && { - UserSettings: serializeAws_json1_1UserSettings(input.UserSettings, context), - }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.UserProfileName !== undefined && + input.UserProfileName !== null && { UserProfileName: input.UserProfileName }), + ...(input.UserSettings !== undefined && + input.UserSettings !== null && { UserSettings: serializeAws_json1_1UserSettings(input.UserSettings, context) }), }; }; const serializeAws_json1_1UpdateWorkforceRequest = (input: UpdateWorkforceRequest, context: __SerdeContext): any => { return { - ...(input.OidcConfig !== undefined && { OidcConfig: serializeAws_json1_1OidcConfig(input.OidcConfig, context) }), - ...(input.SourceIpConfig !== undefined && { - SourceIpConfig: serializeAws_json1_1SourceIpConfig(input.SourceIpConfig, context), - }), - ...(input.WorkforceName !== undefined && { WorkforceName: input.WorkforceName }), + ...(input.OidcConfig !== undefined && + input.OidcConfig !== null && { OidcConfig: serializeAws_json1_1OidcConfig(input.OidcConfig, context) }), + ...(input.SourceIpConfig !== undefined && + input.SourceIpConfig !== null && { + SourceIpConfig: serializeAws_json1_1SourceIpConfig(input.SourceIpConfig, context), + }), + ...(input.WorkforceName !== undefined && input.WorkforceName !== null && { WorkforceName: input.WorkforceName }), }; }; const serializeAws_json1_1UpdateWorkteamRequest = (input: UpdateWorkteamRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.MemberDefinitions !== undefined && { - MemberDefinitions: serializeAws_json1_1MemberDefinitions(input.MemberDefinitions, context), - }), - ...(input.NotificationConfiguration !== undefined && { - NotificationConfiguration: serializeAws_json1_1NotificationConfiguration( - input.NotificationConfiguration, - context - ), - }), - ...(input.WorkteamName !== undefined && { WorkteamName: input.WorkteamName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.MemberDefinitions !== undefined && + input.MemberDefinitions !== null && { + MemberDefinitions: serializeAws_json1_1MemberDefinitions(input.MemberDefinitions, context), + }), + ...(input.NotificationConfiguration !== undefined && + input.NotificationConfiguration !== null && { + NotificationConfiguration: serializeAws_json1_1NotificationConfiguration( + input.NotificationConfiguration, + context + ), + }), + ...(input.WorkteamName !== undefined && input.WorkteamName !== null && { WorkteamName: input.WorkteamName }), }; }; const serializeAws_json1_1USD = (input: USD, context: __SerdeContext): any => { return { - ...(input.Cents !== undefined && { Cents: input.Cents }), - ...(input.Dollars !== undefined && { Dollars: input.Dollars }), - ...(input.TenthFractionsOfACent !== undefined && { TenthFractionsOfACent: input.TenthFractionsOfACent }), + ...(input.Cents !== undefined && input.Cents !== null && { Cents: input.Cents }), + ...(input.Dollars !== undefined && input.Dollars !== null && { Dollars: input.Dollars }), + ...(input.TenthFractionsOfACent !== undefined && + input.TenthFractionsOfACent !== null && { TenthFractionsOfACent: input.TenthFractionsOfACent }), }; }; const serializeAws_json1_1UserSettings = (input: UserSettings, context: __SerdeContext): any => { return { - ...(input.ExecutionRole !== undefined && { ExecutionRole: input.ExecutionRole }), - ...(input.JupyterServerAppSettings !== undefined && { - JupyterServerAppSettings: serializeAws_json1_1JupyterServerAppSettings(input.JupyterServerAppSettings, context), - }), - ...(input.KernelGatewayAppSettings !== undefined && { - KernelGatewayAppSettings: serializeAws_json1_1KernelGatewayAppSettings(input.KernelGatewayAppSettings, context), - }), - ...(input.SecurityGroups !== undefined && { - SecurityGroups: serializeAws_json1_1SecurityGroupIds(input.SecurityGroups, context), - }), - ...(input.SharingSettings !== undefined && { - SharingSettings: serializeAws_json1_1SharingSettings(input.SharingSettings, context), - }), - ...(input.TensorBoardAppSettings !== undefined && { - TensorBoardAppSettings: serializeAws_json1_1TensorBoardAppSettings(input.TensorBoardAppSettings, context), - }), + ...(input.ExecutionRole !== undefined && input.ExecutionRole !== null && { ExecutionRole: input.ExecutionRole }), + ...(input.JupyterServerAppSettings !== undefined && + input.JupyterServerAppSettings !== null && { + JupyterServerAppSettings: serializeAws_json1_1JupyterServerAppSettings(input.JupyterServerAppSettings, context), + }), + ...(input.KernelGatewayAppSettings !== undefined && + input.KernelGatewayAppSettings !== null && { + KernelGatewayAppSettings: serializeAws_json1_1KernelGatewayAppSettings(input.KernelGatewayAppSettings, context), + }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + SecurityGroups: serializeAws_json1_1SecurityGroupIds(input.SecurityGroups, context), + }), + ...(input.SharingSettings !== undefined && + input.SharingSettings !== null && { + SharingSettings: serializeAws_json1_1SharingSettings(input.SharingSettings, context), + }), + ...(input.TensorBoardAppSettings !== undefined && + input.TensorBoardAppSettings !== null && { + TensorBoardAppSettings: serializeAws_json1_1TensorBoardAppSettings(input.TensorBoardAppSettings, context), + }), }; }; const serializeAws_json1_1VariantProperty = (input: VariantProperty, context: __SerdeContext): any => { return { - ...(input.VariantPropertyType !== undefined && { VariantPropertyType: input.VariantPropertyType }), + ...(input.VariantPropertyType !== undefined && + input.VariantPropertyType !== null && { VariantPropertyType: input.VariantPropertyType }), }; }; const serializeAws_json1_1VariantPropertyList = (input: VariantProperty[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1VariantProperty(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1VariantProperty(entry, context); + }); }; const serializeAws_json1_1VpcConfig = (input: VpcConfig, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1VpcSecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.Subnets !== undefined && { Subnets: serializeAws_json1_1Subnets(input.Subnets, context) }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1VpcSecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.Subnets !== undefined && + input.Subnets !== null && { Subnets: serializeAws_json1_1Subnets(input.Subnets, context) }), }; }; const serializeAws_json1_1VpcSecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ActionSource = (output: any, context: __SerdeContext): ActionSource => { @@ -22699,7 +23661,14 @@ const deserializeAws_json1_1ActionSource = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ActionSummaries = (output: any, context: __SerdeContext): ActionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ActionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ActionSummary(entry, context); + }); }; const deserializeAws_json1_1ActionSummary = (output: any, context: __SerdeContext): ActionSummary => { @@ -22732,7 +23701,14 @@ const deserializeAws_json1_1AddAssociationResponse = (output: any, context: __Se }; const deserializeAws_json1_1AdditionalCodeRepositoryNamesOrUrls = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AddTagsOutput = (output: any, context: __SerdeContext): AddTagsOutput => { @@ -22752,7 +23728,14 @@ const deserializeAws_json1_1AgentVersion = (output: any, context: __SerdeContext }; const deserializeAws_json1_1AgentVersions = (output: any, context: __SerdeContext): AgentVersion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AgentVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AgentVersion(entry, context); + }); }; const deserializeAws_json1_1Alarm = (output: any, context: __SerdeContext): Alarm => { @@ -22762,7 +23745,14 @@ const deserializeAws_json1_1Alarm = (output: any, context: __SerdeContext): Alar }; const deserializeAws_json1_1AlarmList = (output: any, context: __SerdeContext): Alarm[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Alarm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Alarm(entry, context); + }); }; const deserializeAws_json1_1AlgorithmSpecification = (output: any, context: __SerdeContext): AlgorithmSpecification => { @@ -22809,7 +23799,14 @@ const deserializeAws_json1_1AlgorithmStatusItem = (output: any, context: __Serde }; const deserializeAws_json1_1AlgorithmStatusItemList = (output: any, context: __SerdeContext): AlgorithmStatusItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AlgorithmStatusItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AlgorithmStatusItem(entry, context); + }); }; const deserializeAws_json1_1AlgorithmSummary = (output: any, context: __SerdeContext): AlgorithmSummary => { @@ -22831,7 +23828,14 @@ const deserializeAws_json1_1AlgorithmSummary = (output: any, context: __SerdeCon }; const deserializeAws_json1_1AlgorithmSummaryList = (output: any, context: __SerdeContext): AlgorithmSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AlgorithmSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AlgorithmSummary(entry, context); + }); }; const deserializeAws_json1_1AlgorithmValidationProfile = ( @@ -22855,7 +23859,14 @@ const deserializeAws_json1_1AlgorithmValidationProfiles = ( output: any, context: __SerdeContext ): AlgorithmValidationProfile[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AlgorithmValidationProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AlgorithmValidationProfile(entry, context); + }); }; const deserializeAws_json1_1AlgorithmValidationSpecification = ( @@ -22925,11 +23936,25 @@ const deserializeAws_json1_1AppImageConfigDetails = (output: any, context: __Ser }; const deserializeAws_json1_1AppImageConfigList = (output: any, context: __SerdeContext): AppImageConfigDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AppImageConfigDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AppImageConfigDetails(entry, context); + }); }; const deserializeAws_json1_1AppList = (output: any, context: __SerdeContext): AppDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AppDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AppDetails(entry, context); + }); }; const deserializeAws_json1_1AppSpecification = (output: any, context: __SerdeContext): AppSpecification => { @@ -22964,11 +23989,25 @@ const deserializeAws_json1_1ArtifactSourceType = (output: any, context: __SerdeC }; const deserializeAws_json1_1ArtifactSourceTypes = (output: any, context: __SerdeContext): ArtifactSourceType[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ArtifactSourceType(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ArtifactSourceType(entry, context); + }); }; const deserializeAws_json1_1ArtifactSummaries = (output: any, context: __SerdeContext): ArtifactSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ArtifactSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ArtifactSummary(entry, context); + }); }; const deserializeAws_json1_1ArtifactSummary = (output: any, context: __SerdeContext): ArtifactSummary => { @@ -23005,7 +24044,14 @@ const deserializeAws_json1_1AssociateTrialComponentResponse = ( }; const deserializeAws_json1_1AssociationSummaries = (output: any, context: __SerdeContext): AssociationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssociationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssociationSummary(entry, context); + }); }; const deserializeAws_json1_1AssociationSummary = (output: any, context: __SerdeContext): AssociationSummary => { @@ -23052,7 +24098,14 @@ const deserializeAws_json1_1AthenaDatasetDefinition = ( }; const deserializeAws_json1_1AttributeNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AutoMLCandidate = (output: any, context: __SerdeContext): AutoMLCandidate => { @@ -23091,7 +24144,14 @@ const deserializeAws_json1_1AutoMLCandidate = (output: any, context: __SerdeCont }; const deserializeAws_json1_1AutoMLCandidates = (output: any, context: __SerdeContext): AutoMLCandidate[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutoMLCandidate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutoMLCandidate(entry, context); + }); }; const deserializeAws_json1_1AutoMLCandidateStep = (output: any, context: __SerdeContext): AutoMLCandidateStep => { @@ -23142,7 +24202,14 @@ const deserializeAws_json1_1AutoMLContainerDefinitions = ( output: any, context: __SerdeContext ): AutoMLContainerDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutoMLContainerDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutoMLContainerDefinition(entry, context); + }); }; const deserializeAws_json1_1AutoMLDataSource = (output: any, context: __SerdeContext): AutoMLDataSource => { @@ -23155,7 +24222,14 @@ const deserializeAws_json1_1AutoMLDataSource = (output: any, context: __SerdeCon }; const deserializeAws_json1_1AutoMLInputDataConfig = (output: any, context: __SerdeContext): AutoMLChannel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutoMLChannel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutoMLChannel(entry, context); + }); }; const deserializeAws_json1_1AutoMLJobArtifacts = (output: any, context: __SerdeContext): AutoMLJobArtifacts => { @@ -23209,7 +24283,14 @@ const deserializeAws_json1_1AutoMLJobObjective = (output: any, context: __SerdeC }; const deserializeAws_json1_1AutoMLJobSummaries = (output: any, context: __SerdeContext): AutoMLJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutoMLJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutoMLJobSummary(entry, context); + }); }; const deserializeAws_json1_1AutoMLJobSummary = (output: any, context: __SerdeContext): AutoMLJobSummary => { @@ -23313,7 +24394,14 @@ const deserializeAws_json1_1CacheHitResult = (output: any, context: __SerdeConte }; const deserializeAws_json1_1CandidateSteps = (output: any, context: __SerdeContext): AutoMLCandidateStep[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutoMLCandidateStep(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutoMLCandidateStep(entry, context); + }); }; const deserializeAws_json1_1CapacitySize = (output: any, context: __SerdeContext): CapacitySize => { @@ -23346,7 +24434,14 @@ const deserializeAws_json1_1CaptureOption = (output: any, context: __SerdeContex }; const deserializeAws_json1_1CaptureOptionList = (output: any, context: __SerdeContext): CaptureOption[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CaptureOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CaptureOption(entry, context); + }); }; const deserializeAws_json1_1CategoricalParameterRange = ( @@ -23366,7 +24461,14 @@ const deserializeAws_json1_1CategoricalParameterRanges = ( output: any, context: __SerdeContext ): CategoricalParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CategoricalParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CategoricalParameterRange(entry, context); + }); }; const deserializeAws_json1_1CategoricalParameterRangeSpecification = ( @@ -23424,7 +24526,14 @@ const deserializeAws_json1_1ChannelSpecification = (output: any, context: __Serd }; const deserializeAws_json1_1ChannelSpecifications = (output: any, context: __SerdeContext): ChannelSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ChannelSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ChannelSpecification(entry, context); + }); }; const deserializeAws_json1_1CheckpointConfig = (output: any, context: __SerdeContext): CheckpointConfig => { @@ -23435,7 +24544,14 @@ const deserializeAws_json1_1CheckpointConfig = (output: any, context: __SerdeCon }; const deserializeAws_json1_1Cidrs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CodeRepositorySummary = (output: any, context: __SerdeContext): CodeRepositorySummary => { @@ -23467,7 +24583,14 @@ const deserializeAws_json1_1CodeRepositorySummaryList = ( output: any, context: __SerdeContext ): CodeRepositorySummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CodeRepositorySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CodeRepositorySummary(entry, context); + }); }; const deserializeAws_json1_1CognitoConfig = (output: any, context: __SerdeContext): CognitoConfig => { @@ -23506,27 +24629,43 @@ const deserializeAws_json1_1CollectionConfigurations = ( output: any, context: __SerdeContext ): CollectionConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CollectionConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CollectionConfiguration(entry, context); + }); }; const deserializeAws_json1_1CollectionParameters = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1CompilationJobSummaries = ( output: any, context: __SerdeContext ): CompilationJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CompilationJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CompilationJobSummary(entry, context); + }); }; const deserializeAws_json1_1CompilationJobSummary = (output: any, context: __SerdeContext): CompilationJobSummary => { @@ -23579,7 +24718,14 @@ const deserializeAws_json1_1CompilationJobSummary = (output: any, context: __Ser }; const deserializeAws_json1_1CompressionTypes = (output: any, context: __SerdeContext): (CompressionType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ConditionStepMetadata = (output: any, context: __SerdeContext): ConditionStepMetadata => { @@ -23595,7 +24741,14 @@ const deserializeAws_json1_1ConflictException = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ContainerArguments = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ContainerDefinition = (output: any, context: __SerdeContext): ContainerDefinition => { @@ -23621,22 +24774,50 @@ const deserializeAws_json1_1ContainerDefinition = (output: any, context: __Serde }; const deserializeAws_json1_1ContainerDefinitionList = (output: any, context: __SerdeContext): ContainerDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContainerDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContainerDefinition(entry, context); + }); }; const deserializeAws_json1_1ContainerEntrypoint = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ContentClassifiers = ( output: any, context: __SerdeContext ): (ContentClassifier | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ContentTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ContextSource = (output: any, context: __SerdeContext): ContextSource => { @@ -23648,7 +24829,14 @@ const deserializeAws_json1_1ContextSource = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ContextSummaries = (output: any, context: __SerdeContext): ContextSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContextSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContextSummary(entry, context); + }); }; const deserializeAws_json1_1ContextSummary = (output: any, context: __SerdeContext): ContextSummary => { @@ -23687,7 +24875,14 @@ const deserializeAws_json1_1ContinuousParameterRanges = ( output: any, context: __SerdeContext ): ContinuousParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ContinuousParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ContinuousParameterRange(entry, context); + }); }; const deserializeAws_json1_1ContinuousParameterRangeSpecification = ( @@ -24091,7 +25286,14 @@ const deserializeAws_json1_1CreateWorkteamResponse = (output: any, context: __Se }; const deserializeAws_json1_1CsvContentTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CustomImage = (output: any, context: __SerdeContext): CustomImage => { @@ -24109,7 +25311,14 @@ const deserializeAws_json1_1CustomImage = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1CustomImages = (output: any, context: __SerdeContext): CustomImage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CustomImage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CustomImage(entry, context); + }); }; const deserializeAws_json1_1DataCaptureConfig = (output: any, context: __SerdeContext): DataCaptureConfig => { @@ -24300,7 +25509,14 @@ const deserializeAws_json1_1DebugRuleConfigurations = ( output: any, context: __SerdeContext ): DebugRuleConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DebugRuleConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DebugRuleConfiguration(entry, context); + }); }; const deserializeAws_json1_1DebugRuleEvaluationStatus = ( @@ -24333,7 +25549,14 @@ const deserializeAws_json1_1DebugRuleEvaluationStatuses = ( output: any, context: __SerdeContext ): DebugRuleEvaluationStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DebugRuleEvaluationStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DebugRuleEvaluationStatus(entry, context); + }); }; const deserializeAws_json1_1DeleteActionResponse = (output: any, context: __SerdeContext): DeleteActionResponse => { @@ -24455,7 +25678,14 @@ const deserializeAws_json1_1DeployedImage = (output: any, context: __SerdeContex }; const deserializeAws_json1_1DeployedImages = (output: any, context: __SerdeContext): DeployedImage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeployedImage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeployedImage(entry, context); + }); }; const deserializeAws_json1_1DeploymentConfig = (output: any, context: __SerdeContext): DeploymentConfig => { @@ -26450,7 +27680,14 @@ const deserializeAws_json1_1DescribeWorkteamResponse = ( }; const deserializeAws_json1_1DeviceFleetSummaries = (output: any, context: __SerdeContext): DeviceFleetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeviceFleetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeviceFleetSummary(entry, context); + }); }; const deserializeAws_json1_1DeviceFleetSummary = (output: any, context: __SerdeContext): DeviceFleetSummary => { @@ -26484,7 +27721,14 @@ const deserializeAws_json1_1DeviceStats = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1DeviceSummaries = (output: any, context: __SerdeContext): DeviceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DeviceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DeviceSummary(entry, context); + }); }; const deserializeAws_json1_1DeviceSummary = (output: any, context: __SerdeContext): DeviceSummary => { @@ -26549,7 +27793,14 @@ const deserializeAws_json1_1DomainDetails = (output: any, context: __SerdeContex }; const deserializeAws_json1_1DomainList = (output: any, context: __SerdeContext): DomainDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DomainDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DomainDetails(entry, context); + }); }; const deserializeAws_json1_1EdgeModel = (output: any, context: __SerdeContext): EdgeModel => { @@ -26568,7 +27819,14 @@ const deserializeAws_json1_1EdgeModel = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1EdgeModels = (output: any, context: __SerdeContext): EdgeModel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EdgeModel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EdgeModel(entry, context); + }); }; const deserializeAws_json1_1EdgeModelStat = (output: any, context: __SerdeContext): EdgeModelStat => { @@ -26595,11 +27853,25 @@ const deserializeAws_json1_1EdgeModelStat = (output: any, context: __SerdeContex }; const deserializeAws_json1_1EdgeModelStats = (output: any, context: __SerdeContext): EdgeModelStat[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EdgeModelStat(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EdgeModelStat(entry, context); + }); }; const deserializeAws_json1_1EdgeModelSummaries = (output: any, context: __SerdeContext): EdgeModelSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EdgeModelSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EdgeModelSummary(entry, context); + }); }; const deserializeAws_json1_1EdgeModelSummary = (output: any, context: __SerdeContext): EdgeModelSummary => { @@ -26621,7 +27893,14 @@ const deserializeAws_json1_1EdgePackagingJobSummaries = ( output: any, context: __SerdeContext ): EdgePackagingJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EdgePackagingJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EdgePackagingJobSummary(entry, context); + }); }; const deserializeAws_json1_1EdgePackagingJobSummary = ( @@ -26725,7 +28004,14 @@ const deserializeAws_json1_1EndpointConfigSummaryList = ( output: any, context: __SerdeContext ): EndpointConfigSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EndpointConfigSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EndpointConfigSummary(entry, context); + }); }; const deserializeAws_json1_1EndpointInput = (output: any, context: __SerdeContext): EndpointInput => { @@ -26778,17 +28064,26 @@ const deserializeAws_json1_1EndpointSummary = (output: any, context: __SerdeCont }; const deserializeAws_json1_1EndpointSummaryList = (output: any, context: __SerdeContext): EndpointSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EndpointSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EndpointSummary(entry, context); + }); }; const deserializeAws_json1_1EnvironmentMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Experiment = (output: any, context: __SerdeContext): Experiment => { @@ -26846,7 +28141,14 @@ const deserializeAws_json1_1ExperimentSource = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ExperimentSummaries = (output: any, context: __SerdeContext): ExperimentSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExperimentSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExperimentSummary(entry, context); + }); }; const deserializeAws_json1_1ExperimentSummary = (output: any, context: __SerdeContext): ExperimentSummary => { @@ -26888,7 +28190,14 @@ const deserializeAws_json1_1FeatureDefinition = (output: any, context: __SerdeCo }; const deserializeAws_json1_1FeatureDefinitions = (output: any, context: __SerdeContext): FeatureDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FeatureDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FeatureDefinition(entry, context); + }); }; const deserializeAws_json1_1FeatureGroup = (output: any, context: __SerdeContext): FeatureGroup => { @@ -26941,7 +28250,14 @@ const deserializeAws_json1_1FeatureGroup = (output: any, context: __SerdeContext }; const deserializeAws_json1_1FeatureGroupSummaries = (output: any, context: __SerdeContext): FeatureGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FeatureGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FeatureGroupSummary(entry, context); + }); }; const deserializeAws_json1_1FeatureGroupSummary = (output: any, context: __SerdeContext): FeatureGroupSummary => { @@ -27010,7 +28326,14 @@ const deserializeAws_json1_1FinalHyperParameterTuningJobObjectiveMetric = ( }; const deserializeAws_json1_1FinalMetricDataList = (output: any, context: __SerdeContext): MetricData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricData(entry, context); + }); }; const deserializeAws_json1_1FlowDefinitionOutputConfig = ( @@ -27027,7 +28350,14 @@ const deserializeAws_json1_1FlowDefinitionSummaries = ( output: any, context: __SerdeContext ): FlowDefinitionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FlowDefinitionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FlowDefinitionSummary(entry, context); + }); }; const deserializeAws_json1_1FlowDefinitionSummary = (output: any, context: __SerdeContext): FlowDefinitionSummary => { @@ -27054,7 +28384,14 @@ const deserializeAws_json1_1FlowDefinitionSummary = (output: any, context: __Ser }; const deserializeAws_json1_1FlowDefinitionTaskKeywords = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1GetDeviceFleetReportResponse = ( @@ -27131,17 +28468,26 @@ const deserializeAws_json1_1GitConfig = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Groups = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1HookParameters = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1HumanLoopActivationConditionsConfig = ( @@ -27251,7 +28597,14 @@ const deserializeAws_json1_1HumanTaskConfig = (output: any, context: __SerdeCont }; const deserializeAws_json1_1HumanTaskUiSummaries = (output: any, context: __SerdeContext): HumanTaskUiSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HumanTaskUiSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HumanTaskUiSummary(entry, context); + }); }; const deserializeAws_json1_1HumanTaskUiSummary = (output: any, context: __SerdeContext): HumanTaskUiSummary => { @@ -27288,13 +28641,15 @@ const deserializeAws_json1_1HyperParameterAlgorithmSpecification = ( }; const deserializeAws_json1_1HyperParameters = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1HyperParameterSpecification = ( @@ -27319,7 +28674,14 @@ const deserializeAws_json1_1HyperParameterSpecifications = ( output: any, context: __SerdeContext ): HyperParameterSpecification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HyperParameterSpecification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HyperParameterSpecification(entry, context); + }); }; const deserializeAws_json1_1HyperParameterTrainingJobDefinition = ( @@ -27390,14 +28752,28 @@ const deserializeAws_json1_1HyperParameterTrainingJobDefinitions = ( output: any, context: __SerdeContext ): HyperParameterTrainingJobDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HyperParameterTrainingJobDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HyperParameterTrainingJobDefinition(entry, context); + }); }; const deserializeAws_json1_1HyperParameterTrainingJobSummaries = ( output: any, context: __SerdeContext ): HyperParameterTrainingJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HyperParameterTrainingJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HyperParameterTrainingJobSummary(entry, context); + }); }; const deserializeAws_json1_1HyperParameterTrainingJobSummary = ( @@ -27493,14 +28869,28 @@ const deserializeAws_json1_1HyperParameterTuningJobObjectives = ( output: any, context: __SerdeContext ): HyperParameterTuningJobObjective[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HyperParameterTuningJobObjective(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HyperParameterTuningJobObjective(entry, context); + }); }; const deserializeAws_json1_1HyperParameterTuningJobSummaries = ( output: any, context: __SerdeContext ): HyperParameterTuningJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HyperParameterTuningJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HyperParameterTuningJobSummary(entry, context); + }); }; const deserializeAws_json1_1HyperParameterTuningJobSummary = ( @@ -27592,7 +28982,14 @@ const deserializeAws_json1_1ImageConfig = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1Images = (output: any, context: __SerdeContext): Image[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Image(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Image(entry, context); + }); }; const deserializeAws_json1_1ImageVersion = (output: any, context: __SerdeContext): ImageVersion => { @@ -27619,7 +29016,14 @@ const deserializeAws_json1_1ImageVersion = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ImageVersions = (output: any, context: __SerdeContext): ImageVersion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImageVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImageVersion(entry, context); + }); }; const deserializeAws_json1_1InferenceSpecification = (output: any, context: __SerdeContext): InferenceSpecification => { @@ -27658,11 +29062,25 @@ const deserializeAws_json1_1InputConfig = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1InputDataConfig = (output: any, context: __SerdeContext): Channel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Channel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Channel(entry, context); + }); }; const deserializeAws_json1_1InputModes = (output: any, context: __SerdeContext): (TrainingInputMode | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1IntegerParameterRange = (output: any, context: __SerdeContext): IntegerParameterRange => { @@ -27678,7 +29096,14 @@ const deserializeAws_json1_1IntegerParameterRanges = ( output: any, context: __SerdeContext ): IntegerParameterRange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IntegerParameterRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IntegerParameterRange(entry, context); + }); }; const deserializeAws_json1_1IntegerParameterRangeSpecification = ( @@ -27692,7 +29117,14 @@ const deserializeAws_json1_1IntegerParameterRangeSpecification = ( }; const deserializeAws_json1_1JsonContentTypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1JupyterServerAppSettings = ( @@ -27747,7 +29179,14 @@ const deserializeAws_json1_1KernelSpec = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1KernelSpecs = (output: any, context: __SerdeContext): KernelSpec[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1KernelSpec(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1KernelSpec(entry, context); + }); }; const deserializeAws_json1_1LabelCounters = (output: any, context: __SerdeContext): LabelCounters => { @@ -27852,7 +29291,14 @@ const deserializeAws_json1_1LabelingJobForWorkteamSummaryList = ( output: any, context: __SerdeContext ): LabelingJobForWorkteamSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LabelingJobForWorkteamSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LabelingJobForWorkteamSummary(entry, context); + }); }; const deserializeAws_json1_1LabelingJobInputConfig = (output: any, context: __SerdeContext): LabelingJobInputConfig => { @@ -27982,20 +29428,29 @@ const deserializeAws_json1_1LabelingJobSummary = (output: any, context: __SerdeC }; const deserializeAws_json1_1LabelingJobSummaryList = (output: any, context: __SerdeContext): LabelingJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LabelingJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LabelingJobSummary(entry, context); + }); }; const deserializeAws_json1_1LineageEntityParameters = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ListActionsResponse = (output: any, context: __SerdeContext): ListActionsResponse => { @@ -28653,7 +30108,14 @@ const deserializeAws_json1_1MemberDefinition = (output: any, context: __SerdeCon }; const deserializeAws_json1_1MemberDefinitions = (output: any, context: __SerdeContext): MemberDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MemberDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MemberDefinition(entry, context); + }); }; const deserializeAws_json1_1MetadataProperties = (output: any, context: __SerdeContext): MetadataProperties => { @@ -28684,7 +30146,14 @@ const deserializeAws_json1_1MetricDefinition = (output: any, context: __SerdeCon }; const deserializeAws_json1_1MetricDefinitionList = (output: any, context: __SerdeContext): MetricDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MetricDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MetricDefinition(entry, context); + }); }; const deserializeAws_json1_1MetricsSource = (output: any, context: __SerdeContext): MetricsSource => { @@ -28941,7 +30410,14 @@ const deserializeAws_json1_1ModelPackageContainerDefinitionList = ( output: any, context: __SerdeContext ): ModelPackageContainerDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModelPackageContainerDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModelPackageContainerDefinition(entry, context); + }); }; const deserializeAws_json1_1ModelPackageGroup = (output: any, context: __SerdeContext): ModelPackageGroup => { @@ -29009,7 +30485,14 @@ const deserializeAws_json1_1ModelPackageGroupSummaryList = ( output: any, context: __SerdeContext ): ModelPackageGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModelPackageGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModelPackageGroupSummary(entry, context); + }); }; const deserializeAws_json1_1ModelPackageStatusDetails = ( @@ -29041,7 +30524,14 @@ const deserializeAws_json1_1ModelPackageStatusItemList = ( output: any, context: __SerdeContext ): ModelPackageStatusItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModelPackageStatusItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModelPackageStatusItem(entry, context); + }); }; const deserializeAws_json1_1ModelPackageSummary = (output: any, context: __SerdeContext): ModelPackageSummary => { @@ -29078,7 +30568,14 @@ const deserializeAws_json1_1ModelPackageSummary = (output: any, context: __Serde }; const deserializeAws_json1_1ModelPackageSummaryList = (output: any, context: __SerdeContext): ModelPackageSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModelPackageSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModelPackageSummary(entry, context); + }); }; const deserializeAws_json1_1ModelPackageValidationProfile = ( @@ -29098,7 +30595,14 @@ const deserializeAws_json1_1ModelPackageValidationProfiles = ( output: any, context: __SerdeContext ): ModelPackageValidationProfile[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModelPackageValidationProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModelPackageValidationProfile(entry, context); + }); }; const deserializeAws_json1_1ModelPackageValidationSpecification = ( @@ -29205,7 +30709,14 @@ const deserializeAws_json1_1ModelSummary = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ModelSummaryList = (output: any, context: __SerdeContext): ModelSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModelSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModelSummary(entry, context); + }); }; const deserializeAws_json1_1MonitoringAppSpecification = ( @@ -29278,20 +30789,29 @@ const deserializeAws_json1_1MonitoringConstraintsResource = ( }; const deserializeAws_json1_1MonitoringContainerArguments = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1MonitoringEnvironmentMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1MonitoringExecutionSummary = ( @@ -29337,7 +30857,14 @@ const deserializeAws_json1_1MonitoringExecutionSummaryList = ( output: any, context: __SerdeContext ): MonitoringExecutionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MonitoringExecutionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MonitoringExecutionSummary(entry, context); + }); }; const deserializeAws_json1_1MonitoringGroundTruthS3Input = ( @@ -29359,7 +30886,14 @@ const deserializeAws_json1_1MonitoringInput = (output: any, context: __SerdeCont }; const deserializeAws_json1_1MonitoringInputs = (output: any, context: __SerdeContext): MonitoringInput[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MonitoringInput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MonitoringInput(entry, context); + }); }; const deserializeAws_json1_1MonitoringJobDefinition = ( @@ -29428,7 +30962,14 @@ const deserializeAws_json1_1MonitoringJobDefinitionSummaryList = ( output: any, context: __SerdeContext ): MonitoringJobDefinitionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MonitoringJobDefinitionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MonitoringJobDefinitionSummary(entry, context); + }); }; const deserializeAws_json1_1MonitoringNetworkConfig = ( @@ -29472,7 +31013,14 @@ const deserializeAws_json1_1MonitoringOutputConfig = (output: any, context: __Se }; const deserializeAws_json1_1MonitoringOutputs = (output: any, context: __SerdeContext): MonitoringOutput[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MonitoringOutput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MonitoringOutput(entry, context); + }); }; const deserializeAws_json1_1MonitoringResources = (output: any, context: __SerdeContext): MonitoringResources => { @@ -29557,7 +31105,14 @@ const deserializeAws_json1_1MonitoringScheduleConfig = ( }; const deserializeAws_json1_1MonitoringScheduleList = (output: any, context: __SerdeContext): MonitoringSchedule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MonitoringSchedule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MonitoringSchedule(entry, context); + }); }; const deserializeAws_json1_1MonitoringScheduleSummary = ( @@ -29599,7 +31154,14 @@ const deserializeAws_json1_1MonitoringScheduleSummaryList = ( output: any, context: __SerdeContext ): MonitoringScheduleSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MonitoringScheduleSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MonitoringScheduleSummary(entry, context); + }); }; const deserializeAws_json1_1MonitoringStatisticsResource = ( @@ -29645,14 +31207,28 @@ const deserializeAws_json1_1NotebookInstanceAcceleratorTypes = ( output: any, context: __SerdeContext ): (NotebookInstanceAcceleratorType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NotebookInstanceLifecycleConfigList = ( output: any, context: __SerdeContext ): NotebookInstanceLifecycleHook[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NotebookInstanceLifecycleHook(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NotebookInstanceLifecycleHook(entry, context); + }); }; const deserializeAws_json1_1NotebookInstanceLifecycleConfigSummary = ( @@ -29683,9 +31259,14 @@ const deserializeAws_json1_1NotebookInstanceLifecycleConfigSummaryList = ( output: any, context: __SerdeContext ): NotebookInstanceLifecycleConfigSummary[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1NotebookInstanceLifecycleConfigSummary(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NotebookInstanceLifecycleConfigSummary(entry, context); + }); }; const deserializeAws_json1_1NotebookInstanceLifecycleHook = ( @@ -29743,7 +31324,14 @@ const deserializeAws_json1_1NotebookInstanceSummaryList = ( output: any, context: __SerdeContext ): NotebookInstanceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NotebookInstanceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NotebookInstanceSummary(entry, context); + }); }; const deserializeAws_json1_1NotificationConfiguration = ( @@ -29873,7 +31461,14 @@ const deserializeAws_json1_1Parameter = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ParameterList = (output: any, context: __SerdeContext): Parameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Parameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Parameter(entry, context); + }); }; const deserializeAws_json1_1ParameterRange = (output: any, context: __SerdeContext): ParameterRange => { @@ -29919,7 +31514,14 @@ const deserializeAws_json1_1ParameterRanges = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ParameterValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Parent = (output: any, context: __SerdeContext): Parent => { @@ -29946,11 +31548,25 @@ const deserializeAws_json1_1ParentHyperParameterTuningJobs = ( output: any, context: __SerdeContext ): ParentHyperParameterTuningJob[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParentHyperParameterTuningJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParentHyperParameterTuningJob(entry, context); + }); }; const deserializeAws_json1_1Parents = (output: any, context: __SerdeContext): Parent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Parent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Parent(entry, context); + }); }; const deserializeAws_json1_1Pipeline = (output: any, context: __SerdeContext): Pipeline => { @@ -30064,7 +31680,14 @@ const deserializeAws_json1_1PipelineExecutionStepList = ( output: any, context: __SerdeContext ): PipelineExecutionStep[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PipelineExecutionStep(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PipelineExecutionStep(entry, context); + }); }; const deserializeAws_json1_1PipelineExecutionStepMetadata = ( @@ -30131,7 +31754,14 @@ const deserializeAws_json1_1PipelineExecutionSummaryList = ( output: any, context: __SerdeContext ): PipelineExecutionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PipelineExecutionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PipelineExecutionSummary(entry, context); + }); }; const deserializeAws_json1_1PipelineSummary = (output: any, context: __SerdeContext): PipelineSummary => { @@ -30163,7 +31793,14 @@ const deserializeAws_json1_1PipelineSummary = (output: any, context: __SerdeCont }; const deserializeAws_json1_1PipelineSummaryList = (output: any, context: __SerdeContext): PipelineSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PipelineSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PipelineSummary(entry, context); + }); }; const deserializeAws_json1_1ProcessingClusterConfig = ( @@ -30185,13 +31822,15 @@ const deserializeAws_json1_1ProcessingEnvironmentMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ProcessingFeatureStoreOutput = ( @@ -30220,7 +31859,14 @@ const deserializeAws_json1_1ProcessingInput = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ProcessingInputs = (output: any, context: __SerdeContext): ProcessingInput[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProcessingInput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProcessingInput(entry, context); + }); }; const deserializeAws_json1_1ProcessingJob = (output: any, context: __SerdeContext): ProcessingJob => { @@ -30311,7 +31957,14 @@ const deserializeAws_json1_1ProcessingJobStepMetadata = ( }; const deserializeAws_json1_1ProcessingJobSummaries = (output: any, context: __SerdeContext): ProcessingJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProcessingJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProcessingJobSummary(entry, context); + }); }; const deserializeAws_json1_1ProcessingJobSummary = (output: any, context: __SerdeContext): ProcessingJobSummary => { @@ -30370,7 +32023,14 @@ const deserializeAws_json1_1ProcessingOutputConfig = (output: any, context: __Se }; const deserializeAws_json1_1ProcessingOutputs = (output: any, context: __SerdeContext): ProcessingOutput[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProcessingOutput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProcessingOutput(entry, context); + }); }; const deserializeAws_json1_1ProcessingResources = (output: any, context: __SerdeContext): ProcessingResources => { @@ -30438,7 +32098,14 @@ const deserializeAws_json1_1ProductionVariant = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ProductionVariantList = (output: any, context: __SerdeContext): ProductionVariant[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProductionVariant(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProductionVariant(entry, context); + }); }; const deserializeAws_json1_1ProductionVariantSummary = ( @@ -30470,11 +32137,25 @@ const deserializeAws_json1_1ProductionVariantSummaryList = ( output: any, context: __SerdeContext ): ProductionVariantSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProductionVariantSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProductionVariantSummary(entry, context); + }); }; const deserializeAws_json1_1ProductListings = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ProfilerConfig = (output: any, context: __SerdeContext): ProfilerConfig => { @@ -30520,7 +32201,14 @@ const deserializeAws_json1_1ProfilerRuleConfigurations = ( output: any, context: __SerdeContext ): ProfilerRuleConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProfilerRuleConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProfilerRuleConfiguration(entry, context); + }); }; const deserializeAws_json1_1ProfilerRuleEvaluationStatus = ( @@ -30553,17 +32241,26 @@ const deserializeAws_json1_1ProfilerRuleEvaluationStatuses = ( output: any, context: __SerdeContext ): ProfilerRuleEvaluationStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProfilerRuleEvaluationStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProfilerRuleEvaluationStatus(entry, context); + }); }; const deserializeAws_json1_1ProfilingParameters = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ProjectSummary = (output: any, context: __SerdeContext): ProjectSummary => { @@ -30585,7 +32282,14 @@ const deserializeAws_json1_1ProjectSummary = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ProjectSummaryList = (output: any, context: __SerdeContext): ProjectSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProjectSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProjectSummary(entry, context); + }); }; const deserializeAws_json1_1PropertyNameSuggestion = (output: any, context: __SerdeContext): PropertyNameSuggestion => { @@ -30598,7 +32302,14 @@ const deserializeAws_json1_1PropertyNameSuggestionList = ( output: any, context: __SerdeContext ): PropertyNameSuggestion[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PropertyNameSuggestion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PropertyNameSuggestion(entry, context); + }); }; const deserializeAws_json1_1ProvisioningParameter = (output: any, context: __SerdeContext): ProvisioningParameter => { @@ -30612,7 +32323,14 @@ const deserializeAws_json1_1ProvisioningParameters = ( output: any, context: __SerdeContext ): ProvisioningParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisioningParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisioningParameter(entry, context); + }); }; const deserializeAws_json1_1PublicWorkforceTaskPrice = ( @@ -30643,7 +32361,14 @@ const deserializeAws_json1_1RealtimeInferenceInstanceTypes = ( output: any, context: __SerdeContext ): (ProductionVariantInstanceType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RedshiftDatasetDefinition = ( @@ -30684,7 +32409,14 @@ const deserializeAws_json1_1RenderingError = (output: any, context: __SerdeConte }; const deserializeAws_json1_1RenderingErrorList = (output: any, context: __SerdeContext): RenderingError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RenderingError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RenderingError(entry, context); + }); }; const deserializeAws_json1_1RenderUiTemplateResponse = ( @@ -30773,17 +32505,26 @@ const deserializeAws_json1_1ResourceSpec = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ResponseMIMETypes = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RuleParameters = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1S3DataSource = (output: any, context: __SerdeContext): S3DataSource => { @@ -30873,7 +32614,14 @@ const deserializeAws_json1_1SearchResponse = (output: any, context: __SerdeConte }; const deserializeAws_json1_1SearchResultsList = (output: any, context: __SerdeContext): SearchRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SearchRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SearchRecord(entry, context); + }); }; const deserializeAws_json1_1SecondaryStatusTransition = ( @@ -30897,11 +32645,25 @@ const deserializeAws_json1_1SecondaryStatusTransitions = ( output: any, context: __SerdeContext ): SecondaryStatusTransition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SecondaryStatusTransition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SecondaryStatusTransition(entry, context); + }); }; const deserializeAws_json1_1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ServiceCatalogProvisionedProductDetails = ( @@ -30964,7 +32726,14 @@ const deserializeAws_json1_1SourceAlgorithm = (output: any, context: __SerdeCont }; const deserializeAws_json1_1SourceAlgorithmList = (output: any, context: __SerdeContext): SourceAlgorithm[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SourceAlgorithm(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SourceAlgorithm(entry, context); + }); }; const deserializeAws_json1_1SourceAlgorithmSpecification = ( @@ -31026,7 +32795,14 @@ const deserializeAws_json1_1StopPipelineExecutionResponse = ( }; const deserializeAws_json1_1Subnets = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SubscribedWorkteam = (output: any, context: __SerdeContext): SubscribedWorkteam => { @@ -31044,7 +32820,14 @@ const deserializeAws_json1_1SubscribedWorkteam = (output: any, context: __SerdeC }; const deserializeAws_json1_1SubscribedWorkteams = (output: any, context: __SerdeContext): SubscribedWorkteam[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SubscribedWorkteam(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SubscribedWorkteam(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -31055,7 +32838,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TargetPlatform = (output: any, context: __SerdeContext): TargetPlatform => { @@ -31067,7 +32857,14 @@ const deserializeAws_json1_1TargetPlatform = (output: any, context: __SerdeConte }; const deserializeAws_json1_1TaskKeywords = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TensorBoardAppSettings = (output: any, context: __SerdeContext): TensorBoardAppSettings => { @@ -31107,7 +32904,14 @@ const deserializeAws_json1_1TrainingInstanceTypes = ( output: any, context: __SerdeContext ): (TrainingInstanceType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TrainingJob = (output: any, context: __SerdeContext): TrainingJob => { @@ -31293,7 +33097,14 @@ const deserializeAws_json1_1TrainingJobStepMetadata = ( }; const deserializeAws_json1_1TrainingJobSummaries = (output: any, context: __SerdeContext): TrainingJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrainingJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrainingJobSummary(entry, context); + }); }; const deserializeAws_json1_1TrainingJobSummary = (output: any, context: __SerdeContext): TrainingJobSummary => { @@ -31369,13 +33180,15 @@ const deserializeAws_json1_1TransformEnvironmentMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1TransformInput = (output: any, context: __SerdeContext): TransformInput => { @@ -31395,7 +33208,14 @@ const deserializeAws_json1_1TransformInstanceTypes = ( output: any, context: __SerdeContext ): (TransformInstanceType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TransformJob = (output: any, context: __SerdeContext): TransformJob => { @@ -31508,7 +33328,14 @@ const deserializeAws_json1_1TransformJobStepMetadata = ( }; const deserializeAws_json1_1TransformJobSummaries = (output: any, context: __SerdeContext): TransformJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TransformJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TransformJobSummary(entry, context); + }); }; const deserializeAws_json1_1TransformJobSummary = (output: any, context: __SerdeContext): TransformJobSummary => { @@ -31694,10 +33521,15 @@ const deserializeAws_json1_1TrialComponentArtifacts = ( context: __SerdeContext ): { [key: string]: TrialComponentArtifact } => { return Object.entries(output).reduce( - (acc: { [key: string]: TrialComponentArtifact }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_1TrialComponentArtifact(value, context), - }), + (acc: { [key: string]: TrialComponentArtifact }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_1TrialComponentArtifact(value, context), + }; + }, {} ); }; @@ -31706,7 +33538,14 @@ const deserializeAws_json1_1TrialComponentMetricSummaries = ( output: any, context: __SerdeContext ): TrialComponentMetricSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrialComponentMetricSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrialComponentMetricSummary(entry, context); + }); }; const deserializeAws_json1_1TrialComponentMetricSummary = ( @@ -31734,10 +33573,15 @@ const deserializeAws_json1_1TrialComponentParameters = ( context: __SerdeContext ): { [key: string]: TrialComponentParameterValue } => { return Object.entries(output).reduce( - (acc: { [key: string]: TrialComponentParameterValue }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_1TrialComponentParameterValue(value, context), - }), + (acc: { [key: string]: TrialComponentParameterValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_1TrialComponentParameterValue(value, context), + }; + }, {} ); }; @@ -31763,7 +33607,14 @@ const deserializeAws_json1_1TrialComponentSimpleSummaries = ( output: any, context: __SerdeContext ): TrialComponentSimpleSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrialComponentSimpleSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrialComponentSimpleSummary(entry, context); + }); }; const deserializeAws_json1_1TrialComponentSimpleSummary = ( @@ -31834,7 +33685,14 @@ const deserializeAws_json1_1TrialComponentSummaries = ( output: any, context: __SerdeContext ): TrialComponentSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrialComponentSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrialComponentSummary(entry, context); + }); }; const deserializeAws_json1_1TrialComponentSummary = (output: any, context: __SerdeContext): TrialComponentSummary => { @@ -31889,7 +33747,14 @@ const deserializeAws_json1_1TrialSource = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1TrialSummaries = (output: any, context: __SerdeContext): TrialSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrialSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrialSummary(entry, context); + }); }; const deserializeAws_json1_1TrialSummary = (output: any, context: __SerdeContext): TrialSummary => { @@ -32172,7 +34037,14 @@ const deserializeAws_json1_1UserProfileDetails = (output: any, context: __SerdeC }; const deserializeAws_json1_1UserProfileList = (output: any, context: __SerdeContext): UserProfileDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UserProfileDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UserProfileDetails(entry, context); + }); }; const deserializeAws_json1_1UserSettings = (output: any, context: __SerdeContext): UserSettings => { @@ -32216,7 +34088,14 @@ const deserializeAws_json1_1VpcConfig = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1VpcSecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Workforce = (output: any, context: __SerdeContext): Workforce => { @@ -32249,7 +34128,14 @@ const deserializeAws_json1_1Workforce = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Workforces = (output: any, context: __SerdeContext): Workforce[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Workforce(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Workforce(entry, context); + }); }; const deserializeAws_json1_1Workteam = (output: any, context: __SerdeContext): Workteam => { @@ -32283,7 +34169,14 @@ const deserializeAws_json1_1Workteam = (output: any, context: __SerdeContext): W }; const deserializeAws_json1_1Workteams = (output: any, context: __SerdeContext): Workteam[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Workteam(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Workteam(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -32336,3 +34229,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-savingsplans/protocols/Aws_restJson1.ts b/clients/client-savingsplans/protocols/Aws_restJson1.ts index c899fc235ba3..d5e5735b7736 100644 --- a/clients/client-savingsplans/protocols/Aws_restJson1.ts +++ b/clients/client-savingsplans/protocols/Aws_restJson1.ts @@ -64,17 +64,20 @@ export const serializeAws_restJson1CreateSavingsPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateSavingsPlan"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.commitment !== undefined && { commitment: input.commitment }), - ...(input.purchaseTime !== undefined && { purchaseTime: Math.round(input.purchaseTime.getTime() / 1000) }), - ...(input.savingsPlanOfferingId !== undefined && { savingsPlanOfferingId: input.savingsPlanOfferingId }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), - ...(input.upfrontPaymentAmount !== undefined && { upfrontPaymentAmount: input.upfrontPaymentAmount }), + ...(input.commitment !== undefined && input.commitment !== null && { commitment: input.commitment }), + ...(input.purchaseTime !== undefined && + input.purchaseTime !== null && { purchaseTime: Math.round(input.purchaseTime.getTime() / 1000) }), + ...(input.savingsPlanOfferingId !== undefined && + input.savingsPlanOfferingId !== null && { savingsPlanOfferingId: input.savingsPlanOfferingId }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.upfrontPaymentAmount !== undefined && + input.upfrontPaymentAmount !== null && { upfrontPaymentAmount: input.upfrontPaymentAmount }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -93,12 +96,12 @@ export const serializeAws_restJson1DeleteQueuedSavingsPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DeleteQueuedSavingsPlan"; let body: any; body = JSON.stringify({ - ...(input.savingsPlanId !== undefined && { savingsPlanId: input.savingsPlanId }), + ...(input.savingsPlanId !== undefined && input.savingsPlanId !== null && { savingsPlanId: input.savingsPlanId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -117,17 +120,16 @@ export const serializeAws_restJson1DescribeSavingsPlanRatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DescribeSavingsPlanRates"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { - filters: serializeAws_restJson1SavingsPlanRateFilterList(input.filters, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.savingsPlanId !== undefined && { savingsPlanId: input.savingsPlanId }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1SavingsPlanRateFilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.savingsPlanId !== undefined && input.savingsPlanId !== null && { savingsPlanId: input.savingsPlanId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -146,23 +148,25 @@ export const serializeAws_restJson1DescribeSavingsPlansCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DescribeSavingsPlans"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { - filters: serializeAws_restJson1SavingsPlanFilterList(input.filters, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.savingsPlanArns !== undefined && { - savingsPlanArns: serializeAws_restJson1SavingsPlanArnList(input.savingsPlanArns, context), - }), - ...(input.savingsPlanIds !== undefined && { - savingsPlanIds: serializeAws_restJson1SavingsPlanIdList(input.savingsPlanIds, context), - }), - ...(input.states !== undefined && { states: serializeAws_restJson1SavingsPlanStateList(input.states, context) }), + ...(input.filters !== undefined && + input.filters !== null && { filters: serializeAws_restJson1SavingsPlanFilterList(input.filters, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.savingsPlanArns !== undefined && + input.savingsPlanArns !== null && { + savingsPlanArns: serializeAws_restJson1SavingsPlanArnList(input.savingsPlanArns, context), + }), + ...(input.savingsPlanIds !== undefined && + input.savingsPlanIds !== null && { + savingsPlanIds: serializeAws_restJson1SavingsPlanIdList(input.savingsPlanIds, context), + }), + ...(input.states !== undefined && + input.states !== null && { states: serializeAws_restJson1SavingsPlanStateList(input.states, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -181,40 +185,48 @@ export const serializeAws_restJson1DescribeSavingsPlansOfferingRatesCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DescribeSavingsPlansOfferingRates"; let body: any; body = JSON.stringify({ - ...(input.filters !== undefined && { - filters: serializeAws_restJson1SavingsPlanOfferingRateFiltersList(input.filters, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.operations !== undefined && { - operations: serializeAws_restJson1SavingsPlanRateOperationList(input.operations, context), - }), - ...(input.products !== undefined && { - products: serializeAws_restJson1SavingsPlanProductTypeList(input.products, context), - }), - ...(input.savingsPlanOfferingIds !== undefined && { - savingsPlanOfferingIds: serializeAws_restJson1UUIDs(input.savingsPlanOfferingIds, context), - }), - ...(input.savingsPlanPaymentOptions !== undefined && { - savingsPlanPaymentOptions: serializeAws_restJson1SavingsPlanPaymentOptionList( - input.savingsPlanPaymentOptions, - context - ), - }), - ...(input.savingsPlanTypes !== undefined && { - savingsPlanTypes: serializeAws_restJson1SavingsPlanTypeList(input.savingsPlanTypes, context), - }), - ...(input.serviceCodes !== undefined && { - serviceCodes: serializeAws_restJson1SavingsPlanRateServiceCodeList(input.serviceCodes, context), - }), - ...(input.usageTypes !== undefined && { - usageTypes: serializeAws_restJson1SavingsPlanRateUsageTypeList(input.usageTypes, context), - }), + ...(input.filters !== undefined && + input.filters !== null && { + filters: serializeAws_restJson1SavingsPlanOfferingRateFiltersList(input.filters, context), + }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.operations !== undefined && + input.operations !== null && { + operations: serializeAws_restJson1SavingsPlanRateOperationList(input.operations, context), + }), + ...(input.products !== undefined && + input.products !== null && { + products: serializeAws_restJson1SavingsPlanProductTypeList(input.products, context), + }), + ...(input.savingsPlanOfferingIds !== undefined && + input.savingsPlanOfferingIds !== null && { + savingsPlanOfferingIds: serializeAws_restJson1UUIDs(input.savingsPlanOfferingIds, context), + }), + ...(input.savingsPlanPaymentOptions !== undefined && + input.savingsPlanPaymentOptions !== null && { + savingsPlanPaymentOptions: serializeAws_restJson1SavingsPlanPaymentOptionList( + input.savingsPlanPaymentOptions, + context + ), + }), + ...(input.savingsPlanTypes !== undefined && + input.savingsPlanTypes !== null && { + savingsPlanTypes: serializeAws_restJson1SavingsPlanTypeList(input.savingsPlanTypes, context), + }), + ...(input.serviceCodes !== undefined && + input.serviceCodes !== null && { + serviceCodes: serializeAws_restJson1SavingsPlanRateServiceCodeList(input.serviceCodes, context), + }), + ...(input.usageTypes !== undefined && + input.usageTypes !== null && { + usageTypes: serializeAws_restJson1SavingsPlanRateUsageTypeList(input.usageTypes, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -233,40 +245,46 @@ export const serializeAws_restJson1DescribeSavingsPlansOfferingsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DescribeSavingsPlansOfferings"; let body: any; body = JSON.stringify({ - ...(input.currencies !== undefined && { - currencies: serializeAws_restJson1CurrencyList(input.currencies, context), - }), - ...(input.descriptions !== undefined && { - descriptions: serializeAws_restJson1SavingsPlanDescriptionsList(input.descriptions, context), - }), - ...(input.durations !== undefined && { durations: serializeAws_restJson1DurationsList(input.durations, context) }), - ...(input.filters !== undefined && { - filters: serializeAws_restJson1SavingsPlanOfferingFiltersList(input.filters, context), - }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.offeringIds !== undefined && { offeringIds: serializeAws_restJson1UUIDs(input.offeringIds, context) }), - ...(input.operations !== undefined && { - operations: serializeAws_restJson1SavingsPlanOperationList(input.operations, context), - }), - ...(input.paymentOptions !== undefined && { - paymentOptions: serializeAws_restJson1SavingsPlanPaymentOptionList(input.paymentOptions, context), - }), - ...(input.planTypes !== undefined && { - planTypes: serializeAws_restJson1SavingsPlanTypeList(input.planTypes, context), - }), - ...(input.productType !== undefined && { productType: input.productType }), - ...(input.serviceCodes !== undefined && { - serviceCodes: serializeAws_restJson1SavingsPlanServiceCodeList(input.serviceCodes, context), - }), - ...(input.usageTypes !== undefined && { - usageTypes: serializeAws_restJson1SavingsPlanUsageTypeList(input.usageTypes, context), - }), + ...(input.currencies !== undefined && + input.currencies !== null && { currencies: serializeAws_restJson1CurrencyList(input.currencies, context) }), + ...(input.descriptions !== undefined && + input.descriptions !== null && { + descriptions: serializeAws_restJson1SavingsPlanDescriptionsList(input.descriptions, context), + }), + ...(input.durations !== undefined && + input.durations !== null && { durations: serializeAws_restJson1DurationsList(input.durations, context) }), + ...(input.filters !== undefined && + input.filters !== null && { + filters: serializeAws_restJson1SavingsPlanOfferingFiltersList(input.filters, context), + }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.offeringIds !== undefined && + input.offeringIds !== null && { offeringIds: serializeAws_restJson1UUIDs(input.offeringIds, context) }), + ...(input.operations !== undefined && + input.operations !== null && { + operations: serializeAws_restJson1SavingsPlanOperationList(input.operations, context), + }), + ...(input.paymentOptions !== undefined && + input.paymentOptions !== null && { + paymentOptions: serializeAws_restJson1SavingsPlanPaymentOptionList(input.paymentOptions, context), + }), + ...(input.planTypes !== undefined && + input.planTypes !== null && { planTypes: serializeAws_restJson1SavingsPlanTypeList(input.planTypes, context) }), + ...(input.productType !== undefined && input.productType !== null && { productType: input.productType }), + ...(input.serviceCodes !== undefined && + input.serviceCodes !== null && { + serviceCodes: serializeAws_restJson1SavingsPlanServiceCodeList(input.serviceCodes, context), + }), + ...(input.usageTypes !== undefined && + input.usageTypes !== null && { + usageTypes: serializeAws_restJson1SavingsPlanUsageTypeList(input.usageTypes, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -285,12 +303,12 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListTagsForResource"; let body: any; body = JSON.stringify({ - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -309,13 +327,13 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/TagResource"; let body: any; body = JSON.stringify({ - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -334,13 +352,14 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UntagResource"; let body: any; body = JSON.stringify({ - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1062,42 +1081,99 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1CurrencyList = (input: (CurrencyCode | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1DurationsList = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1FilterValuesList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ListOfStrings = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanDescriptionsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanFilter = (input: SavingsPlanFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_restJson1ListOfStrings(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1ListOfStrings(input.values, context) }), }; }; const serializeAws_restJson1SavingsPlanFilterList = (input: SavingsPlanFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SavingsPlanFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SavingsPlanFilter(entry, context); + }); }; const serializeAws_restJson1SavingsPlanIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanOfferingFilterElement = ( @@ -1105,8 +1181,9 @@ const serializeAws_restJson1SavingsPlanOfferingFilterElement = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_restJson1FilterValuesList(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1FilterValuesList(input.values, context) }), }; }; @@ -1114,7 +1191,14 @@ const serializeAws_restJson1SavingsPlanOfferingFiltersList = ( input: SavingsPlanOfferingFilterElement[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SavingsPlanOfferingFilterElement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SavingsPlanOfferingFilterElement(entry, context); + }); }; const serializeAws_restJson1SavingsPlanOfferingRateFilterElement = ( @@ -1122,8 +1206,9 @@ const serializeAws_restJson1SavingsPlanOfferingRateFilterElement = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_restJson1FilterValuesList(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1FilterValuesList(input.values, context) }), }; }; @@ -1131,31 +1216,60 @@ const serializeAws_restJson1SavingsPlanOfferingRateFiltersList = ( input: SavingsPlanOfferingRateFilterElement[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SavingsPlanOfferingRateFilterElement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SavingsPlanOfferingRateFilterElement(entry, context); + }); }; const serializeAws_restJson1SavingsPlanOperationList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanPaymentOptionList = ( input: (SavingsPlanPaymentOption | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanProductTypeList = ( input: (SavingsPlanProductType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanRateFilter = (input: SavingsPlanRateFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.values !== undefined && { values: serializeAws_restJson1ListOfStrings(input.values, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.values !== undefined && + input.values !== null && { values: serializeAws_restJson1ListOfStrings(input.values, context) }), }; }; @@ -1163,62 +1277,134 @@ const serializeAws_restJson1SavingsPlanRateFilterList = ( input: SavingsPlanRateFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SavingsPlanRateFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SavingsPlanRateFilter(entry, context); + }); }; const serializeAws_restJson1SavingsPlanRateOperationList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanRateServiceCodeList = ( input: (SavingsPlanRateServiceCode | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanRateUsageTypeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanServiceCodeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanStateList = ( input: (SavingsPlanState | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanTypeList = ( input: (SavingsPlanType | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SavingsPlanUsageTypeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1UUIDs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ParentSavingsPlanOffering = ( @@ -1284,7 +1470,14 @@ const deserializeAws_restJson1SavingsPlan = (output: any, context: __SerdeContex }; const deserializeAws_restJson1SavingsPlanList = (output: any, context: __SerdeContext): SavingsPlan[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SavingsPlan(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SavingsPlan(entry, context); + }); }; const deserializeAws_restJson1SavingsPlanOffering = (output: any, context: __SerdeContext): SavingsPlanOffering => { @@ -1325,7 +1518,14 @@ const deserializeAws_restJson1SavingsPlanOfferingPropertyList = ( output: any, context: __SerdeContext ): SavingsPlanOfferingProperty[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SavingsPlanOfferingProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SavingsPlanOfferingProperty(entry, context); + }); }; const deserializeAws_restJson1SavingsPlanOfferingRate = ( @@ -1364,28 +1564,56 @@ const deserializeAws_restJson1SavingsPlanOfferingRatePropertyList = ( output: any, context: __SerdeContext ): SavingsPlanOfferingRateProperty[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SavingsPlanOfferingRateProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SavingsPlanOfferingRateProperty(entry, context); + }); }; const deserializeAws_restJson1SavingsPlanOfferingRatesList = ( output: any, context: __SerdeContext ): SavingsPlanOfferingRate[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SavingsPlanOfferingRate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SavingsPlanOfferingRate(entry, context); + }); }; const deserializeAws_restJson1SavingsPlanOfferingsList = ( output: any, context: __SerdeContext ): SavingsPlanOffering[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SavingsPlanOffering(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SavingsPlanOffering(entry, context); + }); }; const deserializeAws_restJson1SavingsPlanProductTypeList = ( output: any, context: __SerdeContext ): (SavingsPlanProductType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SavingsPlanRate = (output: any, context: __SerdeContext): SavingsPlanRate => { @@ -1405,7 +1633,14 @@ const deserializeAws_restJson1SavingsPlanRate = (output: any, context: __SerdeCo }; const deserializeAws_restJson1SavingsPlanRateList = (output: any, context: __SerdeContext): SavingsPlanRate[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SavingsPlanRate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SavingsPlanRate(entry, context); + }); }; const deserializeAws_restJson1SavingsPlanRateProperty = ( @@ -1422,17 +1657,26 @@ const deserializeAws_restJson1SavingsPlanRatePropertyList = ( output: any, context: __SerdeContext ): SavingsPlanRateProperty[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SavingsPlanRateProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SavingsPlanRateProperty(entry, context); + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1455,6 +1699,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-schemas/protocols/Aws_restJson1.ts b/clients/client-schemas/protocols/Aws_restJson1.ts index f3a1c8eeaa37..af61ec129969 100644 --- a/clients/client-schemas/protocols/Aws_restJson1.ts +++ b/clients/client-schemas/protocols/Aws_restJson1.ts @@ -84,14 +84,14 @@ export const serializeAws_restJson1CreateDiscovererCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/discoverers"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.SourceArn !== undefined && { SourceArn: input.SourceArn }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.SourceArn !== undefined && input.SourceArn !== null && { SourceArn: input.SourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -110,7 +110,7 @@ export const serializeAws_restJson1CreateRegistryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/registries/name/{RegistryName}"; if (input.RegistryName !== undefined) { @@ -124,8 +124,8 @@ export const serializeAws_restJson1CreateRegistryCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -144,7 +144,7 @@ export const serializeAws_restJson1CreateSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}"; if (input.RegistryName !== undefined) { @@ -167,10 +167,10 @@ export const serializeAws_restJson1CreateSchemaCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -188,9 +188,7 @@ export const serializeAws_restJson1DeleteDiscovererCommand = async ( input: DeleteDiscovererCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/discoverers/id/{DiscovererId}"; if (input.DiscovererId !== undefined) { const labelValue: string = input.DiscovererId; @@ -218,9 +216,7 @@ export const serializeAws_restJson1DeleteRegistryCommand = async ( input: DeleteRegistryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}"; if (input.RegistryName !== undefined) { const labelValue: string = input.RegistryName; @@ -248,9 +244,7 @@ export const serializeAws_restJson1DeleteResourcePolicyCommand = async ( input: DeleteResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/policy"; const query: any = { ...(input.RegistryName !== undefined && { registryName: input.RegistryName }), @@ -273,9 +267,7 @@ export const serializeAws_restJson1DeleteSchemaCommand = async ( input: DeleteSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}"; if (input.SchemaName !== undefined) { const labelValue: string = input.SchemaName; @@ -312,9 +304,7 @@ export const serializeAws_restJson1DeleteSchemaVersionCommand = async ( input: DeleteSchemaVersionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}/version/{SchemaVersion}"; if (input.SchemaName !== undefined) { const labelValue: string = input.SchemaName; @@ -360,9 +350,7 @@ export const serializeAws_restJson1DescribeCodeBindingCommand = async ( input: DescribeCodeBindingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}/language/{Language}"; if (input.SchemaName !== undefined) { const labelValue: string = input.SchemaName; @@ -412,9 +400,7 @@ export const serializeAws_restJson1DescribeDiscovererCommand = async ( input: DescribeDiscovererCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/discoverers/id/{DiscovererId}"; if (input.DiscovererId !== undefined) { const labelValue: string = input.DiscovererId; @@ -442,9 +428,7 @@ export const serializeAws_restJson1DescribeRegistryCommand = async ( input: DescribeRegistryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}"; if (input.RegistryName !== undefined) { const labelValue: string = input.RegistryName; @@ -472,9 +456,7 @@ export const serializeAws_restJson1DescribeSchemaCommand = async ( input: DescribeSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}"; if (input.SchemaName !== undefined) { const labelValue: string = input.SchemaName; @@ -515,9 +497,7 @@ export const serializeAws_restJson1ExportSchemaCommand = async ( input: ExportSchemaCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}/export"; if (input.SchemaName !== undefined) { const labelValue: string = input.SchemaName; @@ -559,9 +539,7 @@ export const serializeAws_restJson1GetCodeBindingSourceCommand = async ( input: GetCodeBindingSourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}/language/{Language}/source"; if (input.SchemaName !== undefined) { const labelValue: string = input.SchemaName; @@ -612,15 +590,16 @@ export const serializeAws_restJson1GetDiscoveredSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/discover"; let body: any; body = JSON.stringify({ - ...(input.Events !== undefined && { - Events: serializeAws_restJson1__listOfGetDiscoveredSchemaVersionItemInput(input.Events, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Events !== undefined && + input.Events !== null && { + Events: serializeAws_restJson1__listOfGetDiscoveredSchemaVersionItemInput(input.Events, context), + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -638,9 +617,7 @@ export const serializeAws_restJson1GetResourcePolicyCommand = async ( input: GetResourcePolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/policy"; const query: any = { ...(input.RegistryName !== undefined && { registryName: input.RegistryName }), @@ -663,9 +640,7 @@ export const serializeAws_restJson1ListDiscoverersCommand = async ( input: ListDiscoverersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/discoverers"; const query: any = { ...(input.DiscovererIdPrefix !== undefined && { discovererIdPrefix: input.DiscovererIdPrefix }), @@ -691,9 +666,7 @@ export const serializeAws_restJson1ListRegistriesCommand = async ( input: ListRegistriesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries"; const query: any = { ...(input.Scope !== undefined && { scope: input.Scope }), @@ -719,9 +692,7 @@ export const serializeAws_restJson1ListSchemasCommand = async ( input: ListSchemasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas"; if (input.RegistryName !== undefined) { const labelValue: string = input.RegistryName; @@ -755,9 +726,7 @@ export const serializeAws_restJson1ListSchemaVersionsCommand = async ( input: ListSchemaVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}/versions"; if (input.RegistryName !== undefined) { const labelValue: string = input.RegistryName; @@ -799,9 +768,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -829,9 +796,7 @@ export const serializeAws_restJson1PutCodeBindingCommand = async ( input: PutCodeBindingCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}/language/{Language}"; if (input.RegistryName !== undefined) { const labelValue: string = input.RegistryName; @@ -882,7 +847,7 @@ export const serializeAws_restJson1PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/policy"; const query: any = { @@ -890,8 +855,8 @@ export const serializeAws_restJson1PutResourcePolicyCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Policy !== undefined && { Policy: __LazyJsonString.fromObject(input.Policy) }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: __LazyJsonString.fromObject(input.Policy) }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -910,9 +875,7 @@ export const serializeAws_restJson1SearchSchemasCommand = async ( input: SearchSchemasCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/search"; if (input.RegistryName !== undefined) { const labelValue: string = input.RegistryName; @@ -946,9 +909,7 @@ export const serializeAws_restJson1StartDiscovererCommand = async ( input: StartDiscovererCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/discoverers/id/{DiscovererId}/start"; if (input.DiscovererId !== undefined) { const labelValue: string = input.DiscovererId; @@ -976,9 +937,7 @@ export const serializeAws_restJson1StopDiscovererCommand = async ( input: StopDiscovererCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v1/discoverers/id/{DiscovererId}/stop"; if (input.DiscovererId !== undefined) { const labelValue: string = input.DiscovererId; @@ -1007,7 +966,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -1021,7 +980,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { tags: serializeAws_restJson1Tags(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { tags: serializeAws_restJson1Tags(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1039,9 +998,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1074,7 +1031,7 @@ export const serializeAws_restJson1UpdateDiscovererCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/discoverers/id/{DiscovererId}"; if (input.DiscovererId !== undefined) { @@ -1088,7 +1045,7 @@ export const serializeAws_restJson1UpdateDiscovererCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1107,7 +1064,7 @@ export const serializeAws_restJson1UpdateRegistryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/registries/name/{RegistryName}"; if (input.RegistryName !== undefined) { @@ -1121,7 +1078,7 @@ export const serializeAws_restJson1UpdateRegistryCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1140,7 +1097,7 @@ export const serializeAws_restJson1UpdateSchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/registries/name/{RegistryName}/schemas/name/{SchemaName}"; if (input.RegistryName !== undefined) { @@ -1164,9 +1121,9 @@ export const serializeAws_restJson1UpdateSchemaCommand = async ( let body: any; body = JSON.stringify({ ClientTokenId: input.ClientTokenId ?? generateIdempotencyToken(), - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -4481,53 +4438,104 @@ const serializeAws_restJson1__listOfGetDiscoveredSchemaVersionItemInput = ( input: string[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1__listOfDiscovererSummary = ( output: any, context: __SerdeContext ): DiscovererSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DiscovererSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DiscovererSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfRegistrySummary = (output: any, context: __SerdeContext): RegistrySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RegistrySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RegistrySummary(entry, context); + }); }; const deserializeAws_restJson1__listOfSchemaSummary = (output: any, context: __SerdeContext): SchemaSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SchemaSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SchemaSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfSchemaVersionSummary = ( output: any, context: __SerdeContext ): SchemaVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SchemaVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SchemaVersionSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfSearchSchemaSummary = ( output: any, context: __SerdeContext ): SearchSchemaSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SearchSchemaSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SearchSchemaSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfSearchSchemaVersionSummary = ( output: any, context: __SerdeContext ): SearchSchemaVersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SearchSchemaVersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SearchSchemaVersionSummary(entry, context); + }); }; const deserializeAws_restJson1DiscovererSummary = (output: any, context: __SerdeContext): DiscovererSummary => { @@ -4605,13 +4613,15 @@ const deserializeAws_restJson1SearchSchemaVersionSummary = ( }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4634,6 +4644,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-secrets-manager/protocols/Aws_json1_1.ts b/clients/client-secrets-manager/protocols/Aws_json1_1.ts index 41105c9542b1..aa9481d9769f 100644 --- a/clients/client-secrets-manager/protocols/Aws_json1_1.ts +++ b/clients/client-secrets-manager/protocols/Aws_json1_1.ts @@ -101,7 +101,7 @@ export const serializeAws_json1_1CancelRotateSecretCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.CancelRotateSecret", }; let body: any; @@ -114,7 +114,7 @@ export const serializeAws_json1_1CreateSecretCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.CreateSecret", }; let body: any; @@ -127,7 +127,7 @@ export const serializeAws_json1_1DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.DeleteResourcePolicy", }; let body: any; @@ -140,7 +140,7 @@ export const serializeAws_json1_1DeleteSecretCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.DeleteSecret", }; let body: any; @@ -153,7 +153,7 @@ export const serializeAws_json1_1DescribeSecretCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.DescribeSecret", }; let body: any; @@ -166,7 +166,7 @@ export const serializeAws_json1_1GetRandomPasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.GetRandomPassword", }; let body: any; @@ -179,7 +179,7 @@ export const serializeAws_json1_1GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.GetResourcePolicy", }; let body: any; @@ -192,7 +192,7 @@ export const serializeAws_json1_1GetSecretValueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.GetSecretValue", }; let body: any; @@ -205,7 +205,7 @@ export const serializeAws_json1_1ListSecretsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.ListSecrets", }; let body: any; @@ -218,7 +218,7 @@ export const serializeAws_json1_1ListSecretVersionIdsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.ListSecretVersionIds", }; let body: any; @@ -231,7 +231,7 @@ export const serializeAws_json1_1PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.PutResourcePolicy", }; let body: any; @@ -244,7 +244,7 @@ export const serializeAws_json1_1PutSecretValueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.PutSecretValue", }; let body: any; @@ -257,7 +257,7 @@ export const serializeAws_json1_1RestoreSecretCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.RestoreSecret", }; let body: any; @@ -270,7 +270,7 @@ export const serializeAws_json1_1RotateSecretCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.RotateSecret", }; let body: any; @@ -283,7 +283,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.TagResource", }; let body: any; @@ -296,7 +296,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.UntagResource", }; let body: any; @@ -309,7 +309,7 @@ export const serializeAws_json1_1UpdateSecretCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.UpdateSecret", }; let body: any; @@ -322,7 +322,7 @@ export const serializeAws_json1_1UpdateSecretVersionStageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.UpdateSecretVersionStage", }; let body: any; @@ -335,7 +335,7 @@ export const serializeAws_json1_1ValidateResourcePolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "secretsmanager.ValidateResourcePolicy", }; let body: any; @@ -370,8 +370,7 @@ const deserializeAws_json1_1CancelRotateSecretCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -449,8 +448,7 @@ const deserializeAws_json1_1CreateSecretCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionFailure": case "com.amazonaws.secretsmanager#EncryptionFailure": @@ -568,8 +566,7 @@ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -639,8 +636,7 @@ const deserializeAws_json1_1DeleteSecretCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -718,8 +714,7 @@ const deserializeAws_json1_1DescribeSecretCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -781,8 +776,7 @@ const deserializeAws_json1_1GetRandomPasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -852,8 +846,7 @@ const deserializeAws_json1_1GetResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -923,8 +916,7 @@ const deserializeAws_json1_1GetSecretValueCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DecryptionFailure": case "com.amazonaws.secretsmanager#DecryptionFailure": @@ -1010,8 +1002,7 @@ const deserializeAws_json1_1ListSecretsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -1081,8 +1072,7 @@ const deserializeAws_json1_1ListSecretVersionIdsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -1152,8 +1142,7 @@ const deserializeAws_json1_1PutResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -1247,8 +1236,7 @@ const deserializeAws_json1_1PutSecretValueCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionFailure": case "com.amazonaws.secretsmanager#EncryptionFailure": @@ -1350,8 +1338,7 @@ const deserializeAws_json1_1RestoreSecretCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -1429,8 +1416,7 @@ const deserializeAws_json1_1RotateSecretCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -1505,8 +1491,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -1581,8 +1566,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -1660,8 +1644,7 @@ const deserializeAws_json1_1UpdateSecretCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EncryptionFailure": case "com.amazonaws.secretsmanager#EncryptionFailure": @@ -1779,8 +1762,7 @@ const deserializeAws_json1_1UpdateSecretVersionStageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -1866,8 +1848,7 @@ const deserializeAws_json1_1ValidateResourcePolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": @@ -2111,19 +2092,21 @@ const serializeAws_json1_1CancelRotateSecretRequest = ( context: __SerdeContext ): any => { return { - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; const serializeAws_json1_1CreateSecretRequest = (input: CreateSecretRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SecretBinary !== undefined && { SecretBinary: context.base64Encoder(input.SecretBinary) }), - ...(input.SecretString !== undefined && { SecretString: input.SecretString }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagListType(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SecretBinary !== undefined && + input.SecretBinary !== null && { SecretBinary: context.base64Encoder(input.SecretBinary) }), + ...(input.SecretString !== undefined && input.SecretString !== null && { SecretString: input.SecretString }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1TagListType(input.Tags, context) }), }; }; @@ -2132,39 +2115,54 @@ const serializeAws_json1_1DeleteResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; const serializeAws_json1_1DeleteSecretRequest = (input: DeleteSecretRequest, context: __SerdeContext): any => { return { - ...(input.ForceDeleteWithoutRecovery !== undefined && { - ForceDeleteWithoutRecovery: input.ForceDeleteWithoutRecovery, - }), - ...(input.RecoveryWindowInDays !== undefined && { RecoveryWindowInDays: input.RecoveryWindowInDays }), - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.ForceDeleteWithoutRecovery !== undefined && + input.ForceDeleteWithoutRecovery !== null && { ForceDeleteWithoutRecovery: input.ForceDeleteWithoutRecovery }), + ...(input.RecoveryWindowInDays !== undefined && + input.RecoveryWindowInDays !== null && { RecoveryWindowInDays: input.RecoveryWindowInDays }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; const serializeAws_json1_1DescribeSecretRequest = (input: DescribeSecretRequest, context: __SerdeContext): any => { return { - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; const serializeAws_json1_1Filter = (input: Filter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValuesStringList(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValuesStringList(input.Values, context) }), }; }; const serializeAws_json1_1FiltersListType = (input: Filter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Filter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Filter(entry, context); + }); }; const serializeAws_json1_1FilterValuesStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetRandomPasswordRequest = ( @@ -2172,14 +2170,21 @@ const serializeAws_json1_1GetRandomPasswordRequest = ( context: __SerdeContext ): any => { return { - ...(input.ExcludeCharacters !== undefined && { ExcludeCharacters: input.ExcludeCharacters }), - ...(input.ExcludeLowercase !== undefined && { ExcludeLowercase: input.ExcludeLowercase }), - ...(input.ExcludeNumbers !== undefined && { ExcludeNumbers: input.ExcludeNumbers }), - ...(input.ExcludePunctuation !== undefined && { ExcludePunctuation: input.ExcludePunctuation }), - ...(input.ExcludeUppercase !== undefined && { ExcludeUppercase: input.ExcludeUppercase }), - ...(input.IncludeSpace !== undefined && { IncludeSpace: input.IncludeSpace }), - ...(input.PasswordLength !== undefined && { PasswordLength: input.PasswordLength }), - ...(input.RequireEachIncludedType !== undefined && { RequireEachIncludedType: input.RequireEachIncludedType }), + ...(input.ExcludeCharacters !== undefined && + input.ExcludeCharacters !== null && { ExcludeCharacters: input.ExcludeCharacters }), + ...(input.ExcludeLowercase !== undefined && + input.ExcludeLowercase !== null && { ExcludeLowercase: input.ExcludeLowercase }), + ...(input.ExcludeNumbers !== undefined && + input.ExcludeNumbers !== null && { ExcludeNumbers: input.ExcludeNumbers }), + ...(input.ExcludePunctuation !== undefined && + input.ExcludePunctuation !== null && { ExcludePunctuation: input.ExcludePunctuation }), + ...(input.ExcludeUppercase !== undefined && + input.ExcludeUppercase !== null && { ExcludeUppercase: input.ExcludeUppercase }), + ...(input.IncludeSpace !== undefined && input.IncludeSpace !== null && { IncludeSpace: input.IncludeSpace }), + ...(input.PasswordLength !== undefined && + input.PasswordLength !== null && { PasswordLength: input.PasswordLength }), + ...(input.RequireEachIncludedType !== undefined && + input.RequireEachIncludedType !== null && { RequireEachIncludedType: input.RequireEachIncludedType }), }; }; @@ -2188,24 +2193,25 @@ const serializeAws_json1_1GetResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; const serializeAws_json1_1GetSecretValueRequest = (input: GetSecretValueRequest, context: __SerdeContext): any => { return { - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), - ...(input.VersionId !== undefined && { VersionId: input.VersionId }), - ...(input.VersionStage !== undefined && { VersionStage: input.VersionStage }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), + ...(input.VersionId !== undefined && input.VersionId !== null && { VersionId: input.VersionId }), + ...(input.VersionStage !== undefined && input.VersionStage !== null && { VersionStage: input.VersionStage }), }; }; const serializeAws_json1_1ListSecretsRequest = (input: ListSecretsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1FiltersListType(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1FiltersListType(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -2214,10 +2220,11 @@ const serializeAws_json1_1ListSecretVersionIdsRequest = ( context: __SerdeContext ): any => { return { - ...(input.IncludeDeprecated !== undefined && { IncludeDeprecated: input.IncludeDeprecated }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.IncludeDeprecated !== undefined && + input.IncludeDeprecated !== null && { IncludeDeprecated: input.IncludeDeprecated }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; @@ -2226,88 +2233,119 @@ const serializeAws_json1_1PutResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.BlockPublicPolicy !== undefined && { BlockPublicPolicy: input.BlockPublicPolicy }), - ...(input.ResourcePolicy !== undefined && { ResourcePolicy: input.ResourcePolicy }), - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.BlockPublicPolicy !== undefined && + input.BlockPublicPolicy !== null && { BlockPublicPolicy: input.BlockPublicPolicy }), + ...(input.ResourcePolicy !== undefined && + input.ResourcePolicy !== null && { ResourcePolicy: input.ResourcePolicy }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; const serializeAws_json1_1PutSecretValueRequest = (input: PutSecretValueRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.SecretBinary !== undefined && { SecretBinary: context.base64Encoder(input.SecretBinary) }), - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), - ...(input.SecretString !== undefined && { SecretString: input.SecretString }), - ...(input.VersionStages !== undefined && { - VersionStages: serializeAws_json1_1SecretVersionStagesType(input.VersionStages, context), - }), + ...(input.SecretBinary !== undefined && + input.SecretBinary !== null && { SecretBinary: context.base64Encoder(input.SecretBinary) }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), + ...(input.SecretString !== undefined && input.SecretString !== null && { SecretString: input.SecretString }), + ...(input.VersionStages !== undefined && + input.VersionStages !== null && { + VersionStages: serializeAws_json1_1SecretVersionStagesType(input.VersionStages, context), + }), }; }; const serializeAws_json1_1RestoreSecretRequest = (input: RestoreSecretRequest, context: __SerdeContext): any => { return { - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; const serializeAws_json1_1RotateSecretRequest = (input: RotateSecretRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.RotationLambdaARN !== undefined && { RotationLambdaARN: input.RotationLambdaARN }), - ...(input.RotationRules !== undefined && { - RotationRules: serializeAws_json1_1RotationRulesType(input.RotationRules, context), - }), - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.RotationLambdaARN !== undefined && + input.RotationLambdaARN !== null && { RotationLambdaARN: input.RotationLambdaARN }), + ...(input.RotationRules !== undefined && + input.RotationRules !== null && { + RotationRules: serializeAws_json1_1RotationRulesType(input.RotationRules, context), + }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; const serializeAws_json1_1RotationRulesType = (input: RotationRulesType, context: __SerdeContext): any => { return { - ...(input.AutomaticallyAfterDays !== undefined && { AutomaticallyAfterDays: input.AutomaticallyAfterDays }), + ...(input.AutomaticallyAfterDays !== undefined && + input.AutomaticallyAfterDays !== null && { AutomaticallyAfterDays: input.AutomaticallyAfterDays }), }; }; const serializeAws_json1_1SecretVersionStagesType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyListType = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagListType = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagListType(input.Tags, context) }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_json1_1TagListType(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyListType(input.TagKeys, context) }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyListType(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateSecretRequest = (input: UpdateSecretRequest, context: __SerdeContext): any => { return { ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.SecretBinary !== undefined && { SecretBinary: context.base64Encoder(input.SecretBinary) }), - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), - ...(input.SecretString !== undefined && { SecretString: input.SecretString }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.SecretBinary !== undefined && + input.SecretBinary !== null && { SecretBinary: context.base64Encoder(input.SecretBinary) }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), + ...(input.SecretString !== undefined && input.SecretString !== null && { SecretString: input.SecretString }), }; }; @@ -2316,10 +2354,12 @@ const serializeAws_json1_1UpdateSecretVersionStageRequest = ( context: __SerdeContext ): any => { return { - ...(input.MoveToVersionId !== undefined && { MoveToVersionId: input.MoveToVersionId }), - ...(input.RemoveFromVersionId !== undefined && { RemoveFromVersionId: input.RemoveFromVersionId }), - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), - ...(input.VersionStage !== undefined && { VersionStage: input.VersionStage }), + ...(input.MoveToVersionId !== undefined && + input.MoveToVersionId !== null && { MoveToVersionId: input.MoveToVersionId }), + ...(input.RemoveFromVersionId !== undefined && + input.RemoveFromVersionId !== null && { RemoveFromVersionId: input.RemoveFromVersionId }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), + ...(input.VersionStage !== undefined && input.VersionStage !== null && { VersionStage: input.VersionStage }), }; }; @@ -2328,8 +2368,9 @@ const serializeAws_json1_1ValidateResourcePolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourcePolicy !== undefined && { ResourcePolicy: input.ResourcePolicy }), - ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.ResourcePolicy !== undefined && + input.ResourcePolicy !== null && { ResourcePolicy: input.ResourcePolicy }), + ...(input.SecretId !== undefined && input.SecretId !== null && { SecretId: input.SecretId }), }; }; @@ -2679,7 +2720,14 @@ const deserializeAws_json1_1SecretListEntry = (output: any, context: __SerdeCont }; const deserializeAws_json1_1SecretListType = (output: any, context: __SerdeContext): SecretListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SecretListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SecretListEntry(entry, context); + }); }; const deserializeAws_json1_1SecretVersionsListEntry = ( @@ -2707,24 +2755,40 @@ const deserializeAws_json1_1SecretVersionsListType = ( output: any, context: __SerdeContext ): SecretVersionsListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SecretVersionsListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SecretVersionsListEntry(entry, context); + }); }; const deserializeAws_json1_1SecretVersionStagesType = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SecretVersionsToStagesMapType = ( output: any, context: __SerdeContext ): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1SecretVersionStagesType(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -2735,7 +2799,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagListType = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1UpdateSecretResponse = (output: any, context: __SerdeContext): UpdateSecretResponse => { @@ -2780,7 +2851,14 @@ const deserializeAws_json1_1ValidationErrorsEntry = (output: any, context: __Ser }; const deserializeAws_json1_1ValidationErrorsType = (output: any, context: __SerdeContext): ValidationErrorsEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ValidationErrorsEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ValidationErrorsEntry(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2833,3 +2911,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-securityhub/protocols/Aws_restJson1.ts b/clients/client-securityhub/protocols/Aws_restJson1.ts index c08b4cafd414..3a2894f95300 100644 --- a/clients/client-securityhub/protocols/Aws_restJson1.ts +++ b/clients/client-securityhub/protocols/Aws_restJson1.ts @@ -351,13 +351,13 @@ export const serializeAws_restJson1AcceptInvitationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/master"; let body: any; body = JSON.stringify({ - ...(input.InvitationId !== undefined && { InvitationId: input.InvitationId }), - ...(input.MasterId !== undefined && { MasterId: input.MasterId }), + ...(input.InvitationId !== undefined && input.InvitationId !== null && { InvitationId: input.InvitationId }), + ...(input.MasterId !== undefined && input.MasterId !== null && { MasterId: input.MasterId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -376,17 +376,18 @@ export const serializeAws_restJson1BatchDisableStandardsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/standards/deregister"; let body: any; body = JSON.stringify({ - ...(input.StandardsSubscriptionArns !== undefined && { - StandardsSubscriptionArns: serializeAws_restJson1StandardsSubscriptionArns( - input.StandardsSubscriptionArns, - context - ), - }), + ...(input.StandardsSubscriptionArns !== undefined && + input.StandardsSubscriptionArns !== null && { + StandardsSubscriptionArns: serializeAws_restJson1StandardsSubscriptionArns( + input.StandardsSubscriptionArns, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -405,17 +406,18 @@ export const serializeAws_restJson1BatchEnableStandardsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/standards/register"; let body: any; body = JSON.stringify({ - ...(input.StandardsSubscriptionRequests !== undefined && { - StandardsSubscriptionRequests: serializeAws_restJson1StandardsSubscriptionRequests( - input.StandardsSubscriptionRequests, - context - ), - }), + ...(input.StandardsSubscriptionRequests !== undefined && + input.StandardsSubscriptionRequests !== null && { + StandardsSubscriptionRequests: serializeAws_restJson1StandardsSubscriptionRequests( + input.StandardsSubscriptionRequests, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -434,14 +436,13 @@ export const serializeAws_restJson1BatchImportFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findings/import"; let body: any; body = JSON.stringify({ - ...(input.Findings !== undefined && { - Findings: serializeAws_restJson1AwsSecurityFindingList(input.Findings, context), - }), + ...(input.Findings !== undefined && + input.Findings !== null && { Findings: serializeAws_restJson1AwsSecurityFindingList(input.Findings, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -460,27 +461,35 @@ export const serializeAws_restJson1BatchUpdateFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findings/batchupdate"; let body: any; body = JSON.stringify({ - ...(input.Confidence !== undefined && { Confidence: input.Confidence }), - ...(input.Criticality !== undefined && { Criticality: input.Criticality }), - ...(input.FindingIdentifiers !== undefined && { - FindingIdentifiers: serializeAws_restJson1AwsSecurityFindingIdentifierList(input.FindingIdentifiers, context), - }), - ...(input.Note !== undefined && { Note: serializeAws_restJson1NoteUpdate(input.Note, context) }), - ...(input.RelatedFindings !== undefined && { - RelatedFindings: serializeAws_restJson1RelatedFindingList(input.RelatedFindings, context), - }), - ...(input.Severity !== undefined && { Severity: serializeAws_restJson1SeverityUpdate(input.Severity, context) }), - ...(input.Types !== undefined && { Types: serializeAws_restJson1TypeList(input.Types, context) }), - ...(input.UserDefinedFields !== undefined && { - UserDefinedFields: serializeAws_restJson1FieldMap(input.UserDefinedFields, context), - }), - ...(input.VerificationState !== undefined && { VerificationState: input.VerificationState }), - ...(input.Workflow !== undefined && { Workflow: serializeAws_restJson1WorkflowUpdate(input.Workflow, context) }), + ...(input.Confidence !== undefined && input.Confidence !== null && { Confidence: input.Confidence }), + ...(input.Criticality !== undefined && input.Criticality !== null && { Criticality: input.Criticality }), + ...(input.FindingIdentifiers !== undefined && + input.FindingIdentifiers !== null && { + FindingIdentifiers: serializeAws_restJson1AwsSecurityFindingIdentifierList(input.FindingIdentifiers, context), + }), + ...(input.Note !== undefined && + input.Note !== null && { Note: serializeAws_restJson1NoteUpdate(input.Note, context) }), + ...(input.RelatedFindings !== undefined && + input.RelatedFindings !== null && { + RelatedFindings: serializeAws_restJson1RelatedFindingList(input.RelatedFindings, context), + }), + ...(input.Severity !== undefined && + input.Severity !== null && { Severity: serializeAws_restJson1SeverityUpdate(input.Severity, context) }), + ...(input.Types !== undefined && + input.Types !== null && { Types: serializeAws_restJson1TypeList(input.Types, context) }), + ...(input.UserDefinedFields !== undefined && + input.UserDefinedFields !== null && { + UserDefinedFields: serializeAws_restJson1FieldMap(input.UserDefinedFields, context), + }), + ...(input.VerificationState !== undefined && + input.VerificationState !== null && { VerificationState: input.VerificationState }), + ...(input.Workflow !== undefined && + input.Workflow !== null && { Workflow: serializeAws_restJson1WorkflowUpdate(input.Workflow, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -499,14 +508,14 @@ export const serializeAws_restJson1CreateActionTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/actionTargets"; let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -525,16 +534,16 @@ export const serializeAws_restJson1CreateInsightCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/insights"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1AwsSecurityFindingFilters(input.Filters, context), - }), - ...(input.GroupByAttribute !== undefined && { GroupByAttribute: input.GroupByAttribute }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1AwsSecurityFindingFilters(input.Filters, context) }), + ...(input.GroupByAttribute !== undefined && + input.GroupByAttribute !== null && { GroupByAttribute: input.GroupByAttribute }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -553,14 +562,15 @@ export const serializeAws_restJson1CreateMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/members"; let body: any; body = JSON.stringify({ - ...(input.AccountDetails !== undefined && { - AccountDetails: serializeAws_restJson1AccountDetailsList(input.AccountDetails, context), - }), + ...(input.AccountDetails !== undefined && + input.AccountDetails !== null && { + AccountDetails: serializeAws_restJson1AccountDetailsList(input.AccountDetails, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -579,14 +589,13 @@ export const serializeAws_restJson1DeclineInvitationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitations/decline"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { - AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context), - }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -604,9 +613,7 @@ export const serializeAws_restJson1DeleteActionTargetCommand = async ( input: DeleteActionTargetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/actionTargets/{ActionTargetArn+}"; if (input.ActionTargetArn !== undefined) { const labelValue: string = input.ActionTargetArn; @@ -640,9 +647,7 @@ export const serializeAws_restJson1DeleteInsightCommand = async ( input: DeleteInsightCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/insights/{InsightArn+}"; if (input.InsightArn !== undefined) { const labelValue: string = input.InsightArn; @@ -677,14 +682,13 @@ export const serializeAws_restJson1DeleteInvitationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/invitations/delete"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { - AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context), - }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -703,14 +707,13 @@ export const serializeAws_restJson1DeleteMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/members/delete"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { - AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context), - }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -729,16 +732,17 @@ export const serializeAws_restJson1DescribeActionTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/actionTargets/get"; let body: any; body = JSON.stringify({ - ...(input.ActionTargetArns !== undefined && { - ActionTargetArns: serializeAws_restJson1ArnList(input.ActionTargetArns, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ActionTargetArns !== undefined && + input.ActionTargetArns !== null && { + ActionTargetArns: serializeAws_restJson1ArnList(input.ActionTargetArns, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -756,9 +760,7 @@ export const serializeAws_restJson1DescribeHubCommand = async ( input: DescribeHubCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts"; const query: any = { ...(input.HubArn !== undefined && { HubArn: input.HubArn }), @@ -781,12 +783,10 @@ export const serializeAws_restJson1DescribeOrganizationConfigurationCommand = as input: DescribeOrganizationConfigurationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/organization/configuration"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -803,9 +803,7 @@ export const serializeAws_restJson1DescribeProductsCommand = async ( input: DescribeProductsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/products"; const query: any = { ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }), @@ -829,9 +827,7 @@ export const serializeAws_restJson1DescribeStandardsCommand = async ( input: DescribeStandardsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/standards"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -855,9 +851,7 @@ export const serializeAws_restJson1DescribeStandardsControlsCommand = async ( input: DescribeStandardsControlsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/standards/controls/{StandardsSubscriptionArn+}"; if (input.StandardsSubscriptionArn !== undefined) { const labelValue: string = input.StandardsSubscriptionArn; @@ -896,9 +890,7 @@ export const serializeAws_restJson1DisableImportFindingsForProductCommand = asyn input: DisableImportFindingsForProductCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/productSubscriptions/{ProductSubscriptionArn+}"; if (input.ProductSubscriptionArn !== undefined) { const labelValue: string = input.ProductSubscriptionArn; @@ -933,12 +925,13 @@ export const serializeAws_restJson1DisableOrganizationAdminAccountCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/organization/admin/disable"; let body: any; body = JSON.stringify({ - ...(input.AdminAccountId !== undefined && { AdminAccountId: input.AdminAccountId }), + ...(input.AdminAccountId !== undefined && + input.AdminAccountId !== null && { AdminAccountId: input.AdminAccountId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -956,12 +949,10 @@ export const serializeAws_restJson1DisableSecurityHubCommand = async ( input: DisableSecurityHubCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/accounts"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -978,12 +969,10 @@ export const serializeAws_restJson1DisassociateFromMasterAccountCommand = async input: DisassociateFromMasterAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/master/disassociate"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1001,14 +990,13 @@ export const serializeAws_restJson1DisassociateMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/members/disassociate"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { - AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context), - }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1027,12 +1015,12 @@ export const serializeAws_restJson1EnableImportFindingsForProductCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/productSubscriptions"; let body: any; body = JSON.stringify({ - ...(input.ProductArn !== undefined && { ProductArn: input.ProductArn }), + ...(input.ProductArn !== undefined && input.ProductArn !== null && { ProductArn: input.ProductArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1051,12 +1039,13 @@ export const serializeAws_restJson1EnableOrganizationAdminAccountCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/organization/admin/enable"; let body: any; body = JSON.stringify({ - ...(input.AdminAccountId !== undefined && { AdminAccountId: input.AdminAccountId }), + ...(input.AdminAccountId !== undefined && + input.AdminAccountId !== null && { AdminAccountId: input.AdminAccountId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1075,13 +1064,14 @@ export const serializeAws_restJson1EnableSecurityHubCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts"; let body: any; body = JSON.stringify({ - ...(input.EnableDefaultStandards !== undefined && { EnableDefaultStandards: input.EnableDefaultStandards }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.EnableDefaultStandards !== undefined && + input.EnableDefaultStandards !== null && { EnableDefaultStandards: input.EnableDefaultStandards }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1100,19 +1090,20 @@ export const serializeAws_restJson1GetEnabledStandardsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/standards/get"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StandardsSubscriptionArns !== undefined && { - StandardsSubscriptionArns: serializeAws_restJson1StandardsSubscriptionArns( - input.StandardsSubscriptionArns, - context - ), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StandardsSubscriptionArns !== undefined && + input.StandardsSubscriptionArns !== null && { + StandardsSubscriptionArns: serializeAws_restJson1StandardsSubscriptionArns( + input.StandardsSubscriptionArns, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1131,19 +1122,17 @@ export const serializeAws_restJson1GetFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findings"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1AwsSecurityFindingFilters(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SortCriteria !== undefined && { - SortCriteria: serializeAws_restJson1SortCriteria(input.SortCriteria, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1AwsSecurityFindingFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SortCriteria !== undefined && + input.SortCriteria !== null && { SortCriteria: serializeAws_restJson1SortCriteria(input.SortCriteria, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1161,9 +1150,7 @@ export const serializeAws_restJson1GetInsightResultsCommand = async ( input: GetInsightResultsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/insights/results/{InsightArn+}"; if (input.InsightArn !== undefined) { const labelValue: string = input.InsightArn; @@ -1198,14 +1185,15 @@ export const serializeAws_restJson1GetInsightsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/insights/get"; let body: any; body = JSON.stringify({ - ...(input.InsightArns !== undefined && { InsightArns: serializeAws_restJson1ArnList(input.InsightArns, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.InsightArns !== undefined && + input.InsightArns !== null && { InsightArns: serializeAws_restJson1ArnList(input.InsightArns, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1223,12 +1211,10 @@ export const serializeAws_restJson1GetInvitationsCountCommand = async ( input: GetInvitationsCountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/invitations/count"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1245,12 +1231,10 @@ export const serializeAws_restJson1GetMasterAccountCommand = async ( input: GetMasterAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/master"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1268,14 +1252,13 @@ export const serializeAws_restJson1GetMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/members/get"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { - AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context), - }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1294,14 +1277,13 @@ export const serializeAws_restJson1InviteMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/members/invite"; let body: any; body = JSON.stringify({ - ...(input.AccountIds !== undefined && { - AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context), - }), + ...(input.AccountIds !== undefined && + input.AccountIds !== null && { AccountIds: serializeAws_restJson1AccountIdList(input.AccountIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1319,9 +1301,7 @@ export const serializeAws_restJson1ListEnabledProductsForImportCommand = async ( input: ListEnabledProductsForImportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/productSubscriptions"; const query: any = { ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }), @@ -1345,9 +1325,7 @@ export const serializeAws_restJson1ListInvitationsCommand = async ( input: ListInvitationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/invitations"; const query: any = { ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }), @@ -1371,9 +1349,7 @@ export const serializeAws_restJson1ListMembersCommand = async ( input: ListMembersCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/members"; const query: any = { ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }), @@ -1398,9 +1374,7 @@ export const serializeAws_restJson1ListOrganizationAdminAccountsCommand = async input: ListOrganizationAdminAccountsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/organization/admin"; const query: any = { ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }), @@ -1424,9 +1398,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1455,7 +1427,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -1469,7 +1441,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1487,9 +1459,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -1522,7 +1492,7 @@ export const serializeAws_restJson1UpdateActionTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/actionTargets/{ActionTargetArn+}"; if (input.ActionTargetArn !== undefined) { @@ -1542,8 +1512,8 @@ export const serializeAws_restJson1UpdateActionTargetCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1562,16 +1532,16 @@ export const serializeAws_restJson1UpdateFindingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/findings"; let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1AwsSecurityFindingFilters(input.Filters, context), - }), - ...(input.Note !== undefined && { Note: serializeAws_restJson1NoteUpdate(input.Note, context) }), - ...(input.RecordState !== undefined && { RecordState: input.RecordState }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1AwsSecurityFindingFilters(input.Filters, context) }), + ...(input.Note !== undefined && + input.Note !== null && { Note: serializeAws_restJson1NoteUpdate(input.Note, context) }), + ...(input.RecordState !== undefined && input.RecordState !== null && { RecordState: input.RecordState }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1590,7 +1560,7 @@ export const serializeAws_restJson1UpdateInsightCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/insights/{InsightArn+}"; if (input.InsightArn !== undefined) { @@ -1610,11 +1580,11 @@ export const serializeAws_restJson1UpdateInsightCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Filters !== undefined && { - Filters: serializeAws_restJson1AwsSecurityFindingFilters(input.Filters, context), - }), - ...(input.GroupByAttribute !== undefined && { GroupByAttribute: input.GroupByAttribute }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_restJson1AwsSecurityFindingFilters(input.Filters, context) }), + ...(input.GroupByAttribute !== undefined && + input.GroupByAttribute !== null && { GroupByAttribute: input.GroupByAttribute }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1633,12 +1603,12 @@ export const serializeAws_restJson1UpdateOrganizationConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/organization/configuration"; let body: any; body = JSON.stringify({ - ...(input.AutoEnable !== undefined && { AutoEnable: input.AutoEnable }), + ...(input.AutoEnable !== undefined && input.AutoEnable !== null && { AutoEnable: input.AutoEnable }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1657,12 +1627,13 @@ export const serializeAws_restJson1UpdateSecurityHubConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/accounts"; let body: any; body = JSON.stringify({ - ...(input.AutoEnableControls !== undefined && { AutoEnableControls: input.AutoEnableControls }), + ...(input.AutoEnableControls !== undefined && + input.AutoEnableControls !== null && { AutoEnableControls: input.AutoEnableControls }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1681,7 +1652,7 @@ export const serializeAws_restJson1UpdateStandardsControlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/standards/control/{StandardsControlArn+}"; if (input.StandardsControlArn !== undefined) { @@ -1701,8 +1672,9 @@ export const serializeAws_restJson1UpdateStandardsControlCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.ControlStatus !== undefined && { ControlStatus: input.ControlStatus }), - ...(input.DisabledReason !== undefined && { DisabledReason: input.DisabledReason }), + ...(input.ControlStatus !== undefined && input.ControlStatus !== null && { ControlStatus: input.ControlStatus }), + ...(input.DisabledReason !== undefined && + input.DisabledReason !== null && { DisabledReason: input.DisabledReason }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5811,32 +5783,60 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( const serializeAws_restJson1AccountDetails = (input: AccountDetails, context: __SerdeContext): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.Email !== undefined && { Email: input.Email }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), }; }; const serializeAws_restJson1AccountDetailsList = (input: AccountDetails[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AccountDetails(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AccountDetails(entry, context); + }); }; const serializeAws_restJson1AccountIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ArnList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AvailabilityZone = (input: AvailabilityZone, context: __SerdeContext): any => { return { - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), - ...(input.ZoneName !== undefined && { ZoneName: input.ZoneName }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), + ...(input.ZoneName !== undefined && input.ZoneName !== null && { ZoneName: input.ZoneName }), }; }; const serializeAws_restJson1AvailabilityZones = (input: AvailabilityZone[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AvailabilityZone(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AvailabilityZone(entry, context); + }); }; const serializeAws_restJson1AwsApiGatewayAccessLogSettings = ( @@ -5844,8 +5844,9 @@ const serializeAws_restJson1AwsApiGatewayAccessLogSettings = ( context: __SerdeContext ): any => { return { - ...(input.DestinationArn !== undefined && { DestinationArn: input.DestinationArn }), - ...(input.Format !== undefined && { Format: input.Format }), + ...(input.DestinationArn !== undefined && + input.DestinationArn !== null && { DestinationArn: input.DestinationArn }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), }; }; @@ -5854,12 +5855,14 @@ const serializeAws_restJson1AwsApiGatewayCanarySettings = ( context: __SerdeContext ): any => { return { - ...(input.DeploymentId !== undefined && { DeploymentId: input.DeploymentId }), - ...(input.PercentTraffic !== undefined && { PercentTraffic: input.PercentTraffic }), - ...(input.StageVariableOverrides !== undefined && { - StageVariableOverrides: serializeAws_restJson1FieldMap(input.StageVariableOverrides, context), - }), - ...(input.UseStageCache !== undefined && { UseStageCache: input.UseStageCache }), + ...(input.DeploymentId !== undefined && input.DeploymentId !== null && { DeploymentId: input.DeploymentId }), + ...(input.PercentTraffic !== undefined && + input.PercentTraffic !== null && { PercentTraffic: input.PercentTraffic }), + ...(input.StageVariableOverrides !== undefined && + input.StageVariableOverrides !== null && { + StageVariableOverrides: serializeAws_restJson1FieldMap(input.StageVariableOverrides, context), + }), + ...(input.UseStageCache !== undefined && input.UseStageCache !== null && { UseStageCache: input.UseStageCache }), }; }; @@ -5868,7 +5871,8 @@ const serializeAws_restJson1AwsApiGatewayEndpointConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Types !== undefined && { Types: serializeAws_restJson1NonEmptyStringList(input.Types, context) }), + ...(input.Types !== undefined && + input.Types !== null && { Types: serializeAws_restJson1NonEmptyStringList(input.Types, context) }), }; }; @@ -5877,22 +5881,31 @@ const serializeAws_restJson1AwsApiGatewayMethodSettings = ( context: __SerdeContext ): any => { return { - ...(input.CacheDataEncrypted !== undefined && { CacheDataEncrypted: input.CacheDataEncrypted }), - ...(input.CacheTtlInSeconds !== undefined && { CacheTtlInSeconds: input.CacheTtlInSeconds }), - ...(input.CachingEnabled !== undefined && { CachingEnabled: input.CachingEnabled }), - ...(input.DataTraceEnabled !== undefined && { DataTraceEnabled: input.DataTraceEnabled }), - ...(input.HttpMethod !== undefined && { HttpMethod: input.HttpMethod }), - ...(input.LoggingLevel !== undefined && { LoggingLevel: input.LoggingLevel }), - ...(input.MetricsEnabled !== undefined && { MetricsEnabled: input.MetricsEnabled }), - ...(input.RequireAuthorizationForCacheControl !== undefined && { - RequireAuthorizationForCacheControl: input.RequireAuthorizationForCacheControl, - }), - ...(input.ResourcePath !== undefined && { ResourcePath: input.ResourcePath }), - ...(input.ThrottlingBurstLimit !== undefined && { ThrottlingBurstLimit: input.ThrottlingBurstLimit }), - ...(input.ThrottlingRateLimit !== undefined && { ThrottlingRateLimit: input.ThrottlingRateLimit }), - ...(input.UnauthorizedCacheControlHeaderStrategy !== undefined && { - UnauthorizedCacheControlHeaderStrategy: input.UnauthorizedCacheControlHeaderStrategy, - }), + ...(input.CacheDataEncrypted !== undefined && + input.CacheDataEncrypted !== null && { CacheDataEncrypted: input.CacheDataEncrypted }), + ...(input.CacheTtlInSeconds !== undefined && + input.CacheTtlInSeconds !== null && { CacheTtlInSeconds: input.CacheTtlInSeconds }), + ...(input.CachingEnabled !== undefined && + input.CachingEnabled !== null && { CachingEnabled: input.CachingEnabled }), + ...(input.DataTraceEnabled !== undefined && + input.DataTraceEnabled !== null && { DataTraceEnabled: input.DataTraceEnabled }), + ...(input.HttpMethod !== undefined && input.HttpMethod !== null && { HttpMethod: input.HttpMethod }), + ...(input.LoggingLevel !== undefined && input.LoggingLevel !== null && { LoggingLevel: input.LoggingLevel }), + ...(input.MetricsEnabled !== undefined && + input.MetricsEnabled !== null && { MetricsEnabled: input.MetricsEnabled }), + ...(input.RequireAuthorizationForCacheControl !== undefined && + input.RequireAuthorizationForCacheControl !== null && { + RequireAuthorizationForCacheControl: input.RequireAuthorizationForCacheControl, + }), + ...(input.ResourcePath !== undefined && input.ResourcePath !== null && { ResourcePath: input.ResourcePath }), + ...(input.ThrottlingBurstLimit !== undefined && + input.ThrottlingBurstLimit !== null && { ThrottlingBurstLimit: input.ThrottlingBurstLimit }), + ...(input.ThrottlingRateLimit !== undefined && + input.ThrottlingRateLimit !== null && { ThrottlingRateLimit: input.ThrottlingRateLimit }), + ...(input.UnauthorizedCacheControlHeaderStrategy !== undefined && + input.UnauthorizedCacheControlHeaderStrategy !== null && { + UnauthorizedCacheControlHeaderStrategy: input.UnauthorizedCacheControlHeaderStrategy, + }), }; }; @@ -5900,7 +5913,14 @@ const serializeAws_restJson1AwsApiGatewayMethodSettingsList = ( input: AwsApiGatewayMethodSettings[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsApiGatewayMethodSettings(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsApiGatewayMethodSettings(entry, context); + }); }; const serializeAws_restJson1AwsApiGatewayRestApiDetails = ( @@ -5908,22 +5928,25 @@ const serializeAws_restJson1AwsApiGatewayRestApiDetails = ( context: __SerdeContext ): any => { return { - ...(input.ApiKeySource !== undefined && { ApiKeySource: input.ApiKeySource }), - ...(input.BinaryMediaTypes !== undefined && { - BinaryMediaTypes: serializeAws_restJson1NonEmptyStringList(input.BinaryMediaTypes, context), - }), - ...(input.CreatedDate !== undefined && { CreatedDate: input.CreatedDate }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EndpointConfiguration !== undefined && { - EndpointConfiguration: serializeAws_restJson1AwsApiGatewayEndpointConfiguration( - input.EndpointConfiguration, - context - ), - }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.MinimumCompressionSize !== undefined && { MinimumCompressionSize: input.MinimumCompressionSize }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.ApiKeySource !== undefined && input.ApiKeySource !== null && { ApiKeySource: input.ApiKeySource }), + ...(input.BinaryMediaTypes !== undefined && + input.BinaryMediaTypes !== null && { + BinaryMediaTypes: serializeAws_restJson1NonEmptyStringList(input.BinaryMediaTypes, context), + }), + ...(input.CreatedDate !== undefined && input.CreatedDate !== null && { CreatedDate: input.CreatedDate }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EndpointConfiguration !== undefined && + input.EndpointConfiguration !== null && { + EndpointConfiguration: serializeAws_restJson1AwsApiGatewayEndpointConfiguration( + input.EndpointConfiguration, + context + ), + }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.MinimumCompressionSize !== undefined && + input.MinimumCompressionSize !== null && { MinimumCompressionSize: input.MinimumCompressionSize }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -5932,28 +5955,39 @@ const serializeAws_restJson1AwsApiGatewayStageDetails = ( context: __SerdeContext ): any => { return { - ...(input.AccessLogSettings !== undefined && { - AccessLogSettings: serializeAws_restJson1AwsApiGatewayAccessLogSettings(input.AccessLogSettings, context), - }), - ...(input.CacheClusterEnabled !== undefined && { CacheClusterEnabled: input.CacheClusterEnabled }), - ...(input.CacheClusterSize !== undefined && { CacheClusterSize: input.CacheClusterSize }), - ...(input.CacheClusterStatus !== undefined && { CacheClusterStatus: input.CacheClusterStatus }), - ...(input.CanarySettings !== undefined && { - CanarySettings: serializeAws_restJson1AwsApiGatewayCanarySettings(input.CanarySettings, context), - }), - ...(input.ClientCertificateId !== undefined && { ClientCertificateId: input.ClientCertificateId }), - ...(input.CreatedDate !== undefined && { CreatedDate: input.CreatedDate }), - ...(input.DeploymentId !== undefined && { DeploymentId: input.DeploymentId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DocumentationVersion !== undefined && { DocumentationVersion: input.DocumentationVersion }), - ...(input.LastUpdatedDate !== undefined && { LastUpdatedDate: input.LastUpdatedDate }), - ...(input.MethodSettings !== undefined && { - MethodSettings: serializeAws_restJson1AwsApiGatewayMethodSettingsList(input.MethodSettings, context), - }), - ...(input.StageName !== undefined && { StageName: input.StageName }), - ...(input.TracingEnabled !== undefined && { TracingEnabled: input.TracingEnabled }), - ...(input.Variables !== undefined && { Variables: serializeAws_restJson1FieldMap(input.Variables, context) }), - ...(input.WebAclArn !== undefined && { WebAclArn: input.WebAclArn }), + ...(input.AccessLogSettings !== undefined && + input.AccessLogSettings !== null && { + AccessLogSettings: serializeAws_restJson1AwsApiGatewayAccessLogSettings(input.AccessLogSettings, context), + }), + ...(input.CacheClusterEnabled !== undefined && + input.CacheClusterEnabled !== null && { CacheClusterEnabled: input.CacheClusterEnabled }), + ...(input.CacheClusterSize !== undefined && + input.CacheClusterSize !== null && { CacheClusterSize: input.CacheClusterSize }), + ...(input.CacheClusterStatus !== undefined && + input.CacheClusterStatus !== null && { CacheClusterStatus: input.CacheClusterStatus }), + ...(input.CanarySettings !== undefined && + input.CanarySettings !== null && { + CanarySettings: serializeAws_restJson1AwsApiGatewayCanarySettings(input.CanarySettings, context), + }), + ...(input.ClientCertificateId !== undefined && + input.ClientCertificateId !== null && { ClientCertificateId: input.ClientCertificateId }), + ...(input.CreatedDate !== undefined && input.CreatedDate !== null && { CreatedDate: input.CreatedDate }), + ...(input.DeploymentId !== undefined && input.DeploymentId !== null && { DeploymentId: input.DeploymentId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DocumentationVersion !== undefined && + input.DocumentationVersion !== null && { DocumentationVersion: input.DocumentationVersion }), + ...(input.LastUpdatedDate !== undefined && + input.LastUpdatedDate !== null && { LastUpdatedDate: input.LastUpdatedDate }), + ...(input.MethodSettings !== undefined && + input.MethodSettings !== null && { + MethodSettings: serializeAws_restJson1AwsApiGatewayMethodSettingsList(input.MethodSettings, context), + }), + ...(input.StageName !== undefined && input.StageName !== null && { StageName: input.StageName }), + ...(input.TracingEnabled !== undefined && + input.TracingEnabled !== null && { TracingEnabled: input.TracingEnabled }), + ...(input.Variables !== undefined && + input.Variables !== null && { Variables: serializeAws_restJson1FieldMap(input.Variables, context) }), + ...(input.WebAclArn !== undefined && input.WebAclArn !== null && { WebAclArn: input.WebAclArn }), }; }; @@ -5962,20 +5996,21 @@ const serializeAws_restJson1AwsApiGatewayV2ApiDetails = ( context: __SerdeContext ): any => { return { - ...(input.ApiEndpoint !== undefined && { ApiEndpoint: input.ApiEndpoint }), - ...(input.ApiId !== undefined && { ApiId: input.ApiId }), - ...(input.ApiKeySelectionExpression !== undefined && { - ApiKeySelectionExpression: input.ApiKeySelectionExpression, - }), - ...(input.CorsConfiguration !== undefined && { - CorsConfiguration: serializeAws_restJson1AwsCorsConfiguration(input.CorsConfiguration, context), - }), - ...(input.CreatedDate !== undefined && { CreatedDate: input.CreatedDate }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ProtocolType !== undefined && { ProtocolType: input.ProtocolType }), - ...(input.RouteSelectionExpression !== undefined && { RouteSelectionExpression: input.RouteSelectionExpression }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.ApiEndpoint !== undefined && input.ApiEndpoint !== null && { ApiEndpoint: input.ApiEndpoint }), + ...(input.ApiId !== undefined && input.ApiId !== null && { ApiId: input.ApiId }), + ...(input.ApiKeySelectionExpression !== undefined && + input.ApiKeySelectionExpression !== null && { ApiKeySelectionExpression: input.ApiKeySelectionExpression }), + ...(input.CorsConfiguration !== undefined && + input.CorsConfiguration !== null && { + CorsConfiguration: serializeAws_restJson1AwsCorsConfiguration(input.CorsConfiguration, context), + }), + ...(input.CreatedDate !== undefined && input.CreatedDate !== null && { CreatedDate: input.CreatedDate }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ProtocolType !== undefined && input.ProtocolType !== null && { ProtocolType: input.ProtocolType }), + ...(input.RouteSelectionExpression !== undefined && + input.RouteSelectionExpression !== null && { RouteSelectionExpression: input.RouteSelectionExpression }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -5984,11 +6019,15 @@ const serializeAws_restJson1AwsApiGatewayV2RouteSettings = ( context: __SerdeContext ): any => { return { - ...(input.DataTraceEnabled !== undefined && { DataTraceEnabled: input.DataTraceEnabled }), - ...(input.DetailedMetricsEnabled !== undefined && { DetailedMetricsEnabled: input.DetailedMetricsEnabled }), - ...(input.LoggingLevel !== undefined && { LoggingLevel: input.LoggingLevel }), - ...(input.ThrottlingBurstLimit !== undefined && { ThrottlingBurstLimit: input.ThrottlingBurstLimit }), - ...(input.ThrottlingRateLimit !== undefined && { ThrottlingRateLimit: input.ThrottlingRateLimit }), + ...(input.DataTraceEnabled !== undefined && + input.DataTraceEnabled !== null && { DataTraceEnabled: input.DataTraceEnabled }), + ...(input.DetailedMetricsEnabled !== undefined && + input.DetailedMetricsEnabled !== null && { DetailedMetricsEnabled: input.DetailedMetricsEnabled }), + ...(input.LoggingLevel !== undefined && input.LoggingLevel !== null && { LoggingLevel: input.LoggingLevel }), + ...(input.ThrottlingBurstLimit !== undefined && + input.ThrottlingBurstLimit !== null && { ThrottlingBurstLimit: input.ThrottlingBurstLimit }), + ...(input.ThrottlingRateLimit !== undefined && + input.ThrottlingRateLimit !== null && { ThrottlingRateLimit: input.ThrottlingRateLimit }), }; }; @@ -5997,28 +6036,33 @@ const serializeAws_restJson1AwsApiGatewayV2StageDetails = ( context: __SerdeContext ): any => { return { - ...(input.AccessLogSettings !== undefined && { - AccessLogSettings: serializeAws_restJson1AwsApiGatewayAccessLogSettings(input.AccessLogSettings, context), - }), - ...(input.ApiGatewayManaged !== undefined && { ApiGatewayManaged: input.ApiGatewayManaged }), - ...(input.AutoDeploy !== undefined && { AutoDeploy: input.AutoDeploy }), - ...(input.CreatedDate !== undefined && { CreatedDate: input.CreatedDate }), - ...(input.DefaultRouteSettings !== undefined && { - DefaultRouteSettings: serializeAws_restJson1AwsApiGatewayV2RouteSettings(input.DefaultRouteSettings, context), - }), - ...(input.DeploymentId !== undefined && { DeploymentId: input.DeploymentId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LastDeploymentStatusMessage !== undefined && { - LastDeploymentStatusMessage: input.LastDeploymentStatusMessage, - }), - ...(input.LastUpdatedDate !== undefined && { LastUpdatedDate: input.LastUpdatedDate }), - ...(input.RouteSettings !== undefined && { - RouteSettings: serializeAws_restJson1AwsApiGatewayV2RouteSettings(input.RouteSettings, context), - }), - ...(input.StageName !== undefined && { StageName: input.StageName }), - ...(input.StageVariables !== undefined && { - StageVariables: serializeAws_restJson1FieldMap(input.StageVariables, context), - }), + ...(input.AccessLogSettings !== undefined && + input.AccessLogSettings !== null && { + AccessLogSettings: serializeAws_restJson1AwsApiGatewayAccessLogSettings(input.AccessLogSettings, context), + }), + ...(input.ApiGatewayManaged !== undefined && + input.ApiGatewayManaged !== null && { ApiGatewayManaged: input.ApiGatewayManaged }), + ...(input.AutoDeploy !== undefined && input.AutoDeploy !== null && { AutoDeploy: input.AutoDeploy }), + ...(input.CreatedDate !== undefined && input.CreatedDate !== null && { CreatedDate: input.CreatedDate }), + ...(input.DefaultRouteSettings !== undefined && + input.DefaultRouteSettings !== null && { + DefaultRouteSettings: serializeAws_restJson1AwsApiGatewayV2RouteSettings(input.DefaultRouteSettings, context), + }), + ...(input.DeploymentId !== undefined && input.DeploymentId !== null && { DeploymentId: input.DeploymentId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LastDeploymentStatusMessage !== undefined && + input.LastDeploymentStatusMessage !== null && { LastDeploymentStatusMessage: input.LastDeploymentStatusMessage }), + ...(input.LastUpdatedDate !== undefined && + input.LastUpdatedDate !== null && { LastUpdatedDate: input.LastUpdatedDate }), + ...(input.RouteSettings !== undefined && + input.RouteSettings !== null && { + RouteSettings: serializeAws_restJson1AwsApiGatewayV2RouteSettings(input.RouteSettings, context), + }), + ...(input.StageName !== undefined && input.StageName !== null && { StageName: input.StageName }), + ...(input.StageVariables !== undefined && + input.StageVariables !== null && { + StageVariables: serializeAws_restJson1FieldMap(input.StageVariables, context), + }), }; }; @@ -6027,13 +6071,17 @@ const serializeAws_restJson1AwsAutoScalingAutoScalingGroupDetails = ( context: __SerdeContext ): any => { return { - ...(input.CreatedTime !== undefined && { CreatedTime: input.CreatedTime }), - ...(input.HealthCheckGracePeriod !== undefined && { HealthCheckGracePeriod: input.HealthCheckGracePeriod }), - ...(input.HealthCheckType !== undefined && { HealthCheckType: input.HealthCheckType }), - ...(input.LaunchConfigurationName !== undefined && { LaunchConfigurationName: input.LaunchConfigurationName }), - ...(input.LoadBalancerNames !== undefined && { - LoadBalancerNames: serializeAws_restJson1StringList(input.LoadBalancerNames, context), - }), + ...(input.CreatedTime !== undefined && input.CreatedTime !== null && { CreatedTime: input.CreatedTime }), + ...(input.HealthCheckGracePeriod !== undefined && + input.HealthCheckGracePeriod !== null && { HealthCheckGracePeriod: input.HealthCheckGracePeriod }), + ...(input.HealthCheckType !== undefined && + input.HealthCheckType !== null && { HealthCheckType: input.HealthCheckType }), + ...(input.LaunchConfigurationName !== undefined && + input.LaunchConfigurationName !== null && { LaunchConfigurationName: input.LaunchConfigurationName }), + ...(input.LoadBalancerNames !== undefined && + input.LoadBalancerNames !== null && { + LoadBalancerNames: serializeAws_restJson1StringList(input.LoadBalancerNames, context), + }), }; }; @@ -6042,50 +6090,60 @@ const serializeAws_restJson1AwsCertificateManagerCertificateDetails = ( context: __SerdeContext ): any => { return { - ...(input.CertificateAuthorityArn !== undefined && { CertificateAuthorityArn: input.CertificateAuthorityArn }), - ...(input.CreatedAt !== undefined && { CreatedAt: input.CreatedAt }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.DomainValidationOptions !== undefined && { - DomainValidationOptions: serializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOptions( - input.DomainValidationOptions, - context - ), - }), - ...(input.ExtendedKeyUsages !== undefined && { - ExtendedKeyUsages: serializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsages( - input.ExtendedKeyUsages, - context - ), - }), - ...(input.FailureReason !== undefined && { FailureReason: input.FailureReason }), - ...(input.ImportedAt !== undefined && { ImportedAt: input.ImportedAt }), - ...(input.InUseBy !== undefined && { InUseBy: serializeAws_restJson1StringList(input.InUseBy, context) }), - ...(input.IssuedAt !== undefined && { IssuedAt: input.IssuedAt }), - ...(input.Issuer !== undefined && { Issuer: input.Issuer }), - ...(input.KeyAlgorithm !== undefined && { KeyAlgorithm: input.KeyAlgorithm }), - ...(input.KeyUsages !== undefined && { - KeyUsages: serializeAws_restJson1AwsCertificateManagerCertificateKeyUsages(input.KeyUsages, context), - }), - ...(input.NotAfter !== undefined && { NotAfter: input.NotAfter }), - ...(input.NotBefore !== undefined && { NotBefore: input.NotBefore }), - ...(input.Options !== undefined && { - Options: serializeAws_restJson1AwsCertificateManagerCertificateOptions(input.Options, context), - }), - ...(input.RenewalEligibility !== undefined && { RenewalEligibility: input.RenewalEligibility }), - ...(input.RenewalSummary !== undefined && { - RenewalSummary: serializeAws_restJson1AwsCertificateManagerCertificateRenewalSummary( - input.RenewalSummary, - context - ), - }), - ...(input.Serial !== undefined && { Serial: input.Serial }), - ...(input.SignatureAlgorithm !== undefined && { SignatureAlgorithm: input.SignatureAlgorithm }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.Subject !== undefined && { Subject: input.Subject }), - ...(input.SubjectAlternativeNames !== undefined && { - SubjectAlternativeNames: serializeAws_restJson1StringList(input.SubjectAlternativeNames, context), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.CertificateAuthorityArn !== undefined && + input.CertificateAuthorityArn !== null && { CertificateAuthorityArn: input.CertificateAuthorityArn }), + ...(input.CreatedAt !== undefined && input.CreatedAt !== null && { CreatedAt: input.CreatedAt }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.DomainValidationOptions !== undefined && + input.DomainValidationOptions !== null && { + DomainValidationOptions: serializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOptions( + input.DomainValidationOptions, + context + ), + }), + ...(input.ExtendedKeyUsages !== undefined && + input.ExtendedKeyUsages !== null && { + ExtendedKeyUsages: serializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsages( + input.ExtendedKeyUsages, + context + ), + }), + ...(input.FailureReason !== undefined && input.FailureReason !== null && { FailureReason: input.FailureReason }), + ...(input.ImportedAt !== undefined && input.ImportedAt !== null && { ImportedAt: input.ImportedAt }), + ...(input.InUseBy !== undefined && + input.InUseBy !== null && { InUseBy: serializeAws_restJson1StringList(input.InUseBy, context) }), + ...(input.IssuedAt !== undefined && input.IssuedAt !== null && { IssuedAt: input.IssuedAt }), + ...(input.Issuer !== undefined && input.Issuer !== null && { Issuer: input.Issuer }), + ...(input.KeyAlgorithm !== undefined && input.KeyAlgorithm !== null && { KeyAlgorithm: input.KeyAlgorithm }), + ...(input.KeyUsages !== undefined && + input.KeyUsages !== null && { + KeyUsages: serializeAws_restJson1AwsCertificateManagerCertificateKeyUsages(input.KeyUsages, context), + }), + ...(input.NotAfter !== undefined && input.NotAfter !== null && { NotAfter: input.NotAfter }), + ...(input.NotBefore !== undefined && input.NotBefore !== null && { NotBefore: input.NotBefore }), + ...(input.Options !== undefined && + input.Options !== null && { + Options: serializeAws_restJson1AwsCertificateManagerCertificateOptions(input.Options, context), + }), + ...(input.RenewalEligibility !== undefined && + input.RenewalEligibility !== null && { RenewalEligibility: input.RenewalEligibility }), + ...(input.RenewalSummary !== undefined && + input.RenewalSummary !== null && { + RenewalSummary: serializeAws_restJson1AwsCertificateManagerCertificateRenewalSummary( + input.RenewalSummary, + context + ), + }), + ...(input.Serial !== undefined && input.Serial !== null && { Serial: input.Serial }), + ...(input.SignatureAlgorithm !== undefined && + input.SignatureAlgorithm !== null && { SignatureAlgorithm: input.SignatureAlgorithm }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.Subject !== undefined && input.Subject !== null && { Subject: input.Subject }), + ...(input.SubjectAlternativeNames !== undefined && + input.SubjectAlternativeNames !== null && { + SubjectAlternativeNames: serializeAws_restJson1StringList(input.SubjectAlternativeNames, context), + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -6094,19 +6152,24 @@ const serializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOpti context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.ResourceRecord !== undefined && { - ResourceRecord: serializeAws_restJson1AwsCertificateManagerCertificateResourceRecord( - input.ResourceRecord, - context - ), - }), - ...(input.ValidationDomain !== undefined && { ValidationDomain: input.ValidationDomain }), - ...(input.ValidationEmails !== undefined && { - ValidationEmails: serializeAws_restJson1StringList(input.ValidationEmails, context), - }), - ...(input.ValidationMethod !== undefined && { ValidationMethod: input.ValidationMethod }), - ...(input.ValidationStatus !== undefined && { ValidationStatus: input.ValidationStatus }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.ResourceRecord !== undefined && + input.ResourceRecord !== null && { + ResourceRecord: serializeAws_restJson1AwsCertificateManagerCertificateResourceRecord( + input.ResourceRecord, + context + ), + }), + ...(input.ValidationDomain !== undefined && + input.ValidationDomain !== null && { ValidationDomain: input.ValidationDomain }), + ...(input.ValidationEmails !== undefined && + input.ValidationEmails !== null && { + ValidationEmails: serializeAws_restJson1StringList(input.ValidationEmails, context), + }), + ...(input.ValidationMethod !== undefined && + input.ValidationMethod !== null && { ValidationMethod: input.ValidationMethod }), + ...(input.ValidationStatus !== undefined && + input.ValidationStatus !== null && { ValidationStatus: input.ValidationStatus }), }; }; @@ -6114,9 +6177,14 @@ const serializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOpti input: AwsCertificateManagerCertificateDomainValidationOption[], context: __SerdeContext ): any => { - return input.map((entry) => - serializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOption(entry, context) - ); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOption(entry, context); + }); }; const serializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsage = ( @@ -6124,8 +6192,8 @@ const serializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsage = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OId !== undefined && { OId: input.OId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OId !== undefined && input.OId !== null && { OId: input.OId }), }; }; @@ -6133,7 +6201,14 @@ const serializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsages = input: AwsCertificateManagerCertificateExtendedKeyUsage[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsage(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsage(entry, context); + }); }; const serializeAws_restJson1AwsCertificateManagerCertificateKeyUsage = ( @@ -6141,7 +6216,7 @@ const serializeAws_restJson1AwsCertificateManagerCertificateKeyUsage = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -6149,7 +6224,14 @@ const serializeAws_restJson1AwsCertificateManagerCertificateKeyUsages = ( input: AwsCertificateManagerCertificateKeyUsage[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsCertificateManagerCertificateKeyUsage(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsCertificateManagerCertificateKeyUsage(entry, context); + }); }; const serializeAws_restJson1AwsCertificateManagerCertificateOptions = ( @@ -6157,9 +6239,10 @@ const serializeAws_restJson1AwsCertificateManagerCertificateOptions = ( context: __SerdeContext ): any => { return { - ...(input.CertificateTransparencyLoggingPreference !== undefined && { - CertificateTransparencyLoggingPreference: input.CertificateTransparencyLoggingPreference, - }), + ...(input.CertificateTransparencyLoggingPreference !== undefined && + input.CertificateTransparencyLoggingPreference !== null && { + CertificateTransparencyLoggingPreference: input.CertificateTransparencyLoggingPreference, + }), }; }; @@ -6168,15 +6251,17 @@ const serializeAws_restJson1AwsCertificateManagerCertificateRenewalSummary = ( context: __SerdeContext ): any => { return { - ...(input.DomainValidationOptions !== undefined && { - DomainValidationOptions: serializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOptions( - input.DomainValidationOptions, - context - ), - }), - ...(input.RenewalStatus !== undefined && { RenewalStatus: input.RenewalStatus }), - ...(input.RenewalStatusReason !== undefined && { RenewalStatusReason: input.RenewalStatusReason }), - ...(input.UpdatedAt !== undefined && { UpdatedAt: input.UpdatedAt }), + ...(input.DomainValidationOptions !== undefined && + input.DomainValidationOptions !== null && { + DomainValidationOptions: serializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOptions( + input.DomainValidationOptions, + context + ), + }), + ...(input.RenewalStatus !== undefined && input.RenewalStatus !== null && { RenewalStatus: input.RenewalStatus }), + ...(input.RenewalStatusReason !== undefined && + input.RenewalStatusReason !== null && { RenewalStatusReason: input.RenewalStatusReason }), + ...(input.UpdatedAt !== undefined && input.UpdatedAt !== null && { UpdatedAt: input.UpdatedAt }), }; }; @@ -6185,9 +6270,9 @@ const serializeAws_restJson1AwsCertificateManagerCertificateResourceRecord = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -6196,7 +6281,8 @@ const serializeAws_restJson1AwsCloudFrontDistributionCacheBehavior = ( context: __SerdeContext ): any => { return { - ...(input.ViewerProtocolPolicy !== undefined && { ViewerProtocolPolicy: input.ViewerProtocolPolicy }), + ...(input.ViewerProtocolPolicy !== undefined && + input.ViewerProtocolPolicy !== null && { ViewerProtocolPolicy: input.ViewerProtocolPolicy }), }; }; @@ -6205,9 +6291,10 @@ const serializeAws_restJson1AwsCloudFrontDistributionCacheBehaviors = ( context: __SerdeContext ): any => { return { - ...(input.Items !== undefined && { - Items: serializeAws_restJson1AwsCloudFrontDistributionCacheBehaviorsItemList(input.Items, context), - }), + ...(input.Items !== undefined && + input.Items !== null && { + Items: serializeAws_restJson1AwsCloudFrontDistributionCacheBehaviorsItemList(input.Items, context), + }), }; }; @@ -6215,7 +6302,14 @@ const serializeAws_restJson1AwsCloudFrontDistributionCacheBehaviorsItemList = ( input: AwsCloudFrontDistributionCacheBehavior[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsCloudFrontDistributionCacheBehavior(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsCloudFrontDistributionCacheBehavior(entry, context); + }); }; const serializeAws_restJson1AwsCloudFrontDistributionDefaultCacheBehavior = ( @@ -6223,7 +6317,8 @@ const serializeAws_restJson1AwsCloudFrontDistributionDefaultCacheBehavior = ( context: __SerdeContext ): any => { return { - ...(input.ViewerProtocolPolicy !== undefined && { ViewerProtocolPolicy: input.ViewerProtocolPolicy }), + ...(input.ViewerProtocolPolicy !== undefined && + input.ViewerProtocolPolicy !== null && { ViewerProtocolPolicy: input.ViewerProtocolPolicy }), }; }; @@ -6232,30 +6327,37 @@ const serializeAws_restJson1AwsCloudFrontDistributionDetails = ( context: __SerdeContext ): any => { return { - ...(input.CacheBehaviors !== undefined && { - CacheBehaviors: serializeAws_restJson1AwsCloudFrontDistributionCacheBehaviors(input.CacheBehaviors, context), - }), - ...(input.DefaultCacheBehavior !== undefined && { - DefaultCacheBehavior: serializeAws_restJson1AwsCloudFrontDistributionDefaultCacheBehavior( - input.DefaultCacheBehavior, - context - ), - }), - ...(input.DefaultRootObject !== undefined && { DefaultRootObject: input.DefaultRootObject }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.ETag !== undefined && { ETag: input.ETag }), - ...(input.LastModifiedTime !== undefined && { LastModifiedTime: input.LastModifiedTime }), - ...(input.Logging !== undefined && { - Logging: serializeAws_restJson1AwsCloudFrontDistributionLogging(input.Logging, context), - }), - ...(input.OriginGroups !== undefined && { - OriginGroups: serializeAws_restJson1AwsCloudFrontDistributionOriginGroups(input.OriginGroups, context), - }), - ...(input.Origins !== undefined && { - Origins: serializeAws_restJson1AwsCloudFrontDistributionOrigins(input.Origins, context), - }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.WebAclId !== undefined && { WebAclId: input.WebAclId }), + ...(input.CacheBehaviors !== undefined && + input.CacheBehaviors !== null && { + CacheBehaviors: serializeAws_restJson1AwsCloudFrontDistributionCacheBehaviors(input.CacheBehaviors, context), + }), + ...(input.DefaultCacheBehavior !== undefined && + input.DefaultCacheBehavior !== null && { + DefaultCacheBehavior: serializeAws_restJson1AwsCloudFrontDistributionDefaultCacheBehavior( + input.DefaultCacheBehavior, + context + ), + }), + ...(input.DefaultRootObject !== undefined && + input.DefaultRootObject !== null && { DefaultRootObject: input.DefaultRootObject }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.ETag !== undefined && input.ETag !== null && { ETag: input.ETag }), + ...(input.LastModifiedTime !== undefined && + input.LastModifiedTime !== null && { LastModifiedTime: input.LastModifiedTime }), + ...(input.Logging !== undefined && + input.Logging !== null && { + Logging: serializeAws_restJson1AwsCloudFrontDistributionLogging(input.Logging, context), + }), + ...(input.OriginGroups !== undefined && + input.OriginGroups !== null && { + OriginGroups: serializeAws_restJson1AwsCloudFrontDistributionOriginGroups(input.OriginGroups, context), + }), + ...(input.Origins !== undefined && + input.Origins !== null && { + Origins: serializeAws_restJson1AwsCloudFrontDistributionOrigins(input.Origins, context), + }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.WebAclId !== undefined && input.WebAclId !== null && { WebAclId: input.WebAclId }), }; }; @@ -6264,10 +6366,11 @@ const serializeAws_restJson1AwsCloudFrontDistributionLogging = ( context: __SerdeContext ): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.IncludeCookies !== undefined && { IncludeCookies: input.IncludeCookies }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.IncludeCookies !== undefined && + input.IncludeCookies !== null && { IncludeCookies: input.IncludeCookies }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), }; }; @@ -6276,12 +6379,13 @@ const serializeAws_restJson1AwsCloudFrontDistributionOriginGroup = ( context: __SerdeContext ): any => { return { - ...(input.FailoverCriteria !== undefined && { - FailoverCriteria: serializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailover( - input.FailoverCriteria, - context - ), - }), + ...(input.FailoverCriteria !== undefined && + input.FailoverCriteria !== null && { + FailoverCriteria: serializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailover( + input.FailoverCriteria, + context + ), + }), }; }; @@ -6290,12 +6394,13 @@ const serializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailover = ( context: __SerdeContext ): any => { return { - ...(input.StatusCodes !== undefined && { - StatusCodes: serializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailoverStatusCodes( - input.StatusCodes, - context - ), - }), + ...(input.StatusCodes !== undefined && + input.StatusCodes !== null && { + StatusCodes: serializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailoverStatusCodes( + input.StatusCodes, + context + ), + }), }; }; @@ -6304,13 +6409,14 @@ const serializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailoverStatusCo context: __SerdeContext ): any => { return { - ...(input.Items !== undefined && { - Items: serializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailoverStatusCodesItemList( - input.Items, - context - ), - }), - ...(input.Quantity !== undefined && { Quantity: input.Quantity }), + ...(input.Items !== undefined && + input.Items !== null && { + Items: serializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailoverStatusCodesItemList( + input.Items, + context + ), + }), + ...(input.Quantity !== undefined && input.Quantity !== null && { Quantity: input.Quantity }), }; }; @@ -6318,7 +6424,14 @@ const serializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailoverStatusCo input: number[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1AwsCloudFrontDistributionOriginGroups = ( @@ -6326,9 +6439,10 @@ const serializeAws_restJson1AwsCloudFrontDistributionOriginGroups = ( context: __SerdeContext ): any => { return { - ...(input.Items !== undefined && { - Items: serializeAws_restJson1AwsCloudFrontDistributionOriginGroupsItemList(input.Items, context), - }), + ...(input.Items !== undefined && + input.Items !== null && { + Items: serializeAws_restJson1AwsCloudFrontDistributionOriginGroupsItemList(input.Items, context), + }), }; }; @@ -6336,7 +6450,14 @@ const serializeAws_restJson1AwsCloudFrontDistributionOriginGroupsItemList = ( input: AwsCloudFrontDistributionOriginGroup[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsCloudFrontDistributionOriginGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsCloudFrontDistributionOriginGroup(entry, context); + }); }; const serializeAws_restJson1AwsCloudFrontDistributionOriginItem = ( @@ -6344,15 +6465,16 @@ const serializeAws_restJson1AwsCloudFrontDistributionOriginItem = ( context: __SerdeContext ): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.OriginPath !== undefined && { OriginPath: input.OriginPath }), - ...(input.S3OriginConfig !== undefined && { - S3OriginConfig: serializeAws_restJson1AwsCloudFrontDistributionOriginS3OriginConfig( - input.S3OriginConfig, - context - ), - }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.OriginPath !== undefined && input.OriginPath !== null && { OriginPath: input.OriginPath }), + ...(input.S3OriginConfig !== undefined && + input.S3OriginConfig !== null && { + S3OriginConfig: serializeAws_restJson1AwsCloudFrontDistributionOriginS3OriginConfig( + input.S3OriginConfig, + context + ), + }), }; }; @@ -6360,7 +6482,14 @@ const serializeAws_restJson1AwsCloudFrontDistributionOriginItemList = ( input: AwsCloudFrontDistributionOriginItem[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsCloudFrontDistributionOriginItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsCloudFrontDistributionOriginItem(entry, context); + }); }; const serializeAws_restJson1AwsCloudFrontDistributionOrigins = ( @@ -6368,9 +6497,10 @@ const serializeAws_restJson1AwsCloudFrontDistributionOrigins = ( context: __SerdeContext ): any => { return { - ...(input.Items !== undefined && { - Items: serializeAws_restJson1AwsCloudFrontDistributionOriginItemList(input.Items, context), - }), + ...(input.Items !== undefined && + input.Items !== null && { + Items: serializeAws_restJson1AwsCloudFrontDistributionOriginItemList(input.Items, context), + }), }; }; @@ -6379,7 +6509,8 @@ const serializeAws_restJson1AwsCloudFrontDistributionOriginS3OriginConfig = ( context: __SerdeContext ): any => { return { - ...(input.OriginAccessIdentity !== undefined && { OriginAccessIdentity: input.OriginAccessIdentity }), + ...(input.OriginAccessIdentity !== undefined && + input.OriginAccessIdentity !== null && { OriginAccessIdentity: input.OriginAccessIdentity }), }; }; @@ -6388,25 +6519,28 @@ const serializeAws_restJson1AwsCloudTrailTrailDetails = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchLogsLogGroupArn !== undefined && { - CloudWatchLogsLogGroupArn: input.CloudWatchLogsLogGroupArn, - }), - ...(input.CloudWatchLogsRoleArn !== undefined && { CloudWatchLogsRoleArn: input.CloudWatchLogsRoleArn }), - ...(input.HasCustomEventSelectors !== undefined && { HasCustomEventSelectors: input.HasCustomEventSelectors }), - ...(input.HomeRegion !== undefined && { HomeRegion: input.HomeRegion }), - ...(input.IncludeGlobalServiceEvents !== undefined && { - IncludeGlobalServiceEvents: input.IncludeGlobalServiceEvents, - }), - ...(input.IsMultiRegionTrail !== undefined && { IsMultiRegionTrail: input.IsMultiRegionTrail }), - ...(input.IsOrganizationTrail !== undefined && { IsOrganizationTrail: input.IsOrganizationTrail }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.LogFileValidationEnabled !== undefined && { LogFileValidationEnabled: input.LogFileValidationEnabled }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.S3KeyPrefix !== undefined && { S3KeyPrefix: input.S3KeyPrefix }), - ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), - ...(input.SnsTopicName !== undefined && { SnsTopicName: input.SnsTopicName }), - ...(input.TrailArn !== undefined && { TrailArn: input.TrailArn }), + ...(input.CloudWatchLogsLogGroupArn !== undefined && + input.CloudWatchLogsLogGroupArn !== null && { CloudWatchLogsLogGroupArn: input.CloudWatchLogsLogGroupArn }), + ...(input.CloudWatchLogsRoleArn !== undefined && + input.CloudWatchLogsRoleArn !== null && { CloudWatchLogsRoleArn: input.CloudWatchLogsRoleArn }), + ...(input.HasCustomEventSelectors !== undefined && + input.HasCustomEventSelectors !== null && { HasCustomEventSelectors: input.HasCustomEventSelectors }), + ...(input.HomeRegion !== undefined && input.HomeRegion !== null && { HomeRegion: input.HomeRegion }), + ...(input.IncludeGlobalServiceEvents !== undefined && + input.IncludeGlobalServiceEvents !== null && { IncludeGlobalServiceEvents: input.IncludeGlobalServiceEvents }), + ...(input.IsMultiRegionTrail !== undefined && + input.IsMultiRegionTrail !== null && { IsMultiRegionTrail: input.IsMultiRegionTrail }), + ...(input.IsOrganizationTrail !== undefined && + input.IsOrganizationTrail !== null && { IsOrganizationTrail: input.IsOrganizationTrail }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.LogFileValidationEnabled !== undefined && + input.LogFileValidationEnabled !== null && { LogFileValidationEnabled: input.LogFileValidationEnabled }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.S3KeyPrefix !== undefined && input.S3KeyPrefix !== null && { S3KeyPrefix: input.S3KeyPrefix }), + ...(input.SnsTopicArn !== undefined && input.SnsTopicArn !== null && { SnsTopicArn: input.SnsTopicArn }), + ...(input.SnsTopicName !== undefined && input.SnsTopicName !== null && { SnsTopicName: input.SnsTopicName }), + ...(input.TrailArn !== undefined && input.TrailArn !== null && { TrailArn: input.TrailArn }), }; }; @@ -6415,18 +6549,19 @@ const serializeAws_restJson1AwsCodeBuildProjectDetails = ( context: __SerdeContext ): any => { return { - ...(input.EncryptionKey !== undefined && { EncryptionKey: input.EncryptionKey }), - ...(input.Environment !== undefined && { - Environment: serializeAws_restJson1AwsCodeBuildProjectEnvironment(input.Environment, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ServiceRole !== undefined && { ServiceRole: input.ServiceRole }), - ...(input.Source !== undefined && { - Source: serializeAws_restJson1AwsCodeBuildProjectSource(input.Source, context), - }), - ...(input.VpcConfig !== undefined && { - VpcConfig: serializeAws_restJson1AwsCodeBuildProjectVpcConfig(input.VpcConfig, context), - }), + ...(input.EncryptionKey !== undefined && input.EncryptionKey !== null && { EncryptionKey: input.EncryptionKey }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_restJson1AwsCodeBuildProjectEnvironment(input.Environment, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ServiceRole !== undefined && input.ServiceRole !== null && { ServiceRole: input.ServiceRole }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_restJson1AwsCodeBuildProjectSource(input.Source, context) }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { + VpcConfig: serializeAws_restJson1AwsCodeBuildProjectVpcConfig(input.VpcConfig, context), + }), }; }; @@ -6435,15 +6570,17 @@ const serializeAws_restJson1AwsCodeBuildProjectEnvironment = ( context: __SerdeContext ): any => { return { - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.ImagePullCredentialsType !== undefined && { ImagePullCredentialsType: input.ImagePullCredentialsType }), - ...(input.RegistryCredential !== undefined && { - RegistryCredential: serializeAws_restJson1AwsCodeBuildProjectEnvironmentRegistryCredential( - input.RegistryCredential, - context - ), - }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.ImagePullCredentialsType !== undefined && + input.ImagePullCredentialsType !== null && { ImagePullCredentialsType: input.ImagePullCredentialsType }), + ...(input.RegistryCredential !== undefined && + input.RegistryCredential !== null && { + RegistryCredential: serializeAws_restJson1AwsCodeBuildProjectEnvironmentRegistryCredential( + input.RegistryCredential, + context + ), + }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -6452,8 +6589,9 @@ const serializeAws_restJson1AwsCodeBuildProjectEnvironmentRegistryCredential = ( context: __SerdeContext ): any => { return { - ...(input.Credential !== undefined && { Credential: input.Credential }), - ...(input.CredentialProvider !== undefined && { CredentialProvider: input.CredentialProvider }), + ...(input.Credential !== undefined && input.Credential !== null && { Credential: input.Credential }), + ...(input.CredentialProvider !== undefined && + input.CredentialProvider !== null && { CredentialProvider: input.CredentialProvider }), }; }; @@ -6462,10 +6600,10 @@ const serializeAws_restJson1AwsCodeBuildProjectSource = ( context: __SerdeContext ): any => { return { - ...(input.GitCloneDepth !== undefined && { GitCloneDepth: input.GitCloneDepth }), - ...(input.InsecureSsl !== undefined && { InsecureSsl: input.InsecureSsl }), - ...(input.Location !== undefined && { Location: input.Location }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.GitCloneDepth !== undefined && input.GitCloneDepth !== null && { GitCloneDepth: input.GitCloneDepth }), + ...(input.InsecureSsl !== undefined && input.InsecureSsl !== null && { InsecureSsl: input.InsecureSsl }), + ...(input.Location !== undefined && input.Location !== null && { Location: input.Location }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -6474,30 +6612,37 @@ const serializeAws_restJson1AwsCodeBuildProjectVpcConfig = ( context: __SerdeContext ): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_restJson1NonEmptyStringList(input.SecurityGroupIds, context), - }), - ...(input.Subnets !== undefined && { Subnets: serializeAws_restJson1NonEmptyStringList(input.Subnets, context) }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_restJson1NonEmptyStringList(input.SecurityGroupIds, context), + }), + ...(input.Subnets !== undefined && + input.Subnets !== null && { Subnets: serializeAws_restJson1NonEmptyStringList(input.Subnets, context) }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; const serializeAws_restJson1AwsCorsConfiguration = (input: AwsCorsConfiguration, context: __SerdeContext): any => { return { - ...(input.AllowCredentials !== undefined && { AllowCredentials: input.AllowCredentials }), - ...(input.AllowHeaders !== undefined && { - AllowHeaders: serializeAws_restJson1NonEmptyStringList(input.AllowHeaders, context), - }), - ...(input.AllowMethods !== undefined && { - AllowMethods: serializeAws_restJson1NonEmptyStringList(input.AllowMethods, context), - }), - ...(input.AllowOrigins !== undefined && { - AllowOrigins: serializeAws_restJson1NonEmptyStringList(input.AllowOrigins, context), - }), - ...(input.ExposeHeaders !== undefined && { - ExposeHeaders: serializeAws_restJson1NonEmptyStringList(input.ExposeHeaders, context), - }), - ...(input.MaxAge !== undefined && { MaxAge: input.MaxAge }), + ...(input.AllowCredentials !== undefined && + input.AllowCredentials !== null && { AllowCredentials: input.AllowCredentials }), + ...(input.AllowHeaders !== undefined && + input.AllowHeaders !== null && { + AllowHeaders: serializeAws_restJson1NonEmptyStringList(input.AllowHeaders, context), + }), + ...(input.AllowMethods !== undefined && + input.AllowMethods !== null && { + AllowMethods: serializeAws_restJson1NonEmptyStringList(input.AllowMethods, context), + }), + ...(input.AllowOrigins !== undefined && + input.AllowOrigins !== null && { + AllowOrigins: serializeAws_restJson1NonEmptyStringList(input.AllowOrigins, context), + }), + ...(input.ExposeHeaders !== undefined && + input.ExposeHeaders !== null && { + ExposeHeaders: serializeAws_restJson1NonEmptyStringList(input.ExposeHeaders, context), + }), + ...(input.MaxAge !== undefined && input.MaxAge !== null && { MaxAge: input.MaxAge }), }; }; @@ -6506,8 +6651,8 @@ const serializeAws_restJson1AwsDynamoDbTableAttributeDefinition = ( context: __SerdeContext ): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.AttributeType !== undefined && { AttributeType: input.AttributeType }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.AttributeType !== undefined && input.AttributeType !== null && { AttributeType: input.AttributeType }), }; }; @@ -6515,7 +6660,14 @@ const serializeAws_restJson1AwsDynamoDbTableAttributeDefinitionList = ( input: AwsDynamoDbTableAttributeDefinition[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsDynamoDbTableAttributeDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsDynamoDbTableAttributeDefinition(entry, context); + }); }; const serializeAws_restJson1AwsDynamoDbTableBillingModeSummary = ( @@ -6523,10 +6675,11 @@ const serializeAws_restJson1AwsDynamoDbTableBillingModeSummary = ( context: __SerdeContext ): any => { return { - ...(input.BillingMode !== undefined && { BillingMode: input.BillingMode }), - ...(input.LastUpdateToPayPerRequestDateTime !== undefined && { - LastUpdateToPayPerRequestDateTime: input.LastUpdateToPayPerRequestDateTime, - }), + ...(input.BillingMode !== undefined && input.BillingMode !== null && { BillingMode: input.BillingMode }), + ...(input.LastUpdateToPayPerRequestDateTime !== undefined && + input.LastUpdateToPayPerRequestDateTime !== null && { + LastUpdateToPayPerRequestDateTime: input.LastUpdateToPayPerRequestDateTime, + }), }; }; @@ -6535,60 +6688,75 @@ const serializeAws_restJson1AwsDynamoDbTableDetails = ( context: __SerdeContext ): any => { return { - ...(input.AttributeDefinitions !== undefined && { - AttributeDefinitions: serializeAws_restJson1AwsDynamoDbTableAttributeDefinitionList( - input.AttributeDefinitions, - context - ), - }), - ...(input.BillingModeSummary !== undefined && { - BillingModeSummary: serializeAws_restJson1AwsDynamoDbTableBillingModeSummary(input.BillingModeSummary, context), - }), - ...(input.CreationDateTime !== undefined && { CreationDateTime: input.CreationDateTime }), - ...(input.GlobalSecondaryIndexes !== undefined && { - GlobalSecondaryIndexes: serializeAws_restJson1AwsDynamoDbTableGlobalSecondaryIndexList( - input.GlobalSecondaryIndexes, - context - ), - }), - ...(input.GlobalTableVersion !== undefined && { GlobalTableVersion: input.GlobalTableVersion }), - ...(input.ItemCount !== undefined && { ItemCount: input.ItemCount }), - ...(input.KeySchema !== undefined && { - KeySchema: serializeAws_restJson1AwsDynamoDbTableKeySchemaList(input.KeySchema, context), - }), - ...(input.LatestStreamArn !== undefined && { LatestStreamArn: input.LatestStreamArn }), - ...(input.LatestStreamLabel !== undefined && { LatestStreamLabel: input.LatestStreamLabel }), - ...(input.LocalSecondaryIndexes !== undefined && { - LocalSecondaryIndexes: serializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndexList( - input.LocalSecondaryIndexes, - context - ), - }), - ...(input.ProvisionedThroughput !== undefined && { - ProvisionedThroughput: serializeAws_restJson1AwsDynamoDbTableProvisionedThroughput( - input.ProvisionedThroughput, - context - ), - }), - ...(input.Replicas !== undefined && { - Replicas: serializeAws_restJson1AwsDynamoDbTableReplicaList(input.Replicas, context), - }), - ...(input.RestoreSummary !== undefined && { - RestoreSummary: serializeAws_restJson1AwsDynamoDbTableRestoreSummary(input.RestoreSummary, context), - }), - ...(input.SseDescription !== undefined && { - SseDescription: serializeAws_restJson1AwsDynamoDbTableSseDescription(input.SseDescription, context), - }), - ...(input.StreamSpecification !== undefined && { - StreamSpecification: serializeAws_restJson1AwsDynamoDbTableStreamSpecification( - input.StreamSpecification, - context - ), - }), - ...(input.TableId !== undefined && { TableId: input.TableId }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.TableSizeBytes !== undefined && { TableSizeBytes: input.TableSizeBytes }), - ...(input.TableStatus !== undefined && { TableStatus: input.TableStatus }), + ...(input.AttributeDefinitions !== undefined && + input.AttributeDefinitions !== null && { + AttributeDefinitions: serializeAws_restJson1AwsDynamoDbTableAttributeDefinitionList( + input.AttributeDefinitions, + context + ), + }), + ...(input.BillingModeSummary !== undefined && + input.BillingModeSummary !== null && { + BillingModeSummary: serializeAws_restJson1AwsDynamoDbTableBillingModeSummary(input.BillingModeSummary, context), + }), + ...(input.CreationDateTime !== undefined && + input.CreationDateTime !== null && { CreationDateTime: input.CreationDateTime }), + ...(input.GlobalSecondaryIndexes !== undefined && + input.GlobalSecondaryIndexes !== null && { + GlobalSecondaryIndexes: serializeAws_restJson1AwsDynamoDbTableGlobalSecondaryIndexList( + input.GlobalSecondaryIndexes, + context + ), + }), + ...(input.GlobalTableVersion !== undefined && + input.GlobalTableVersion !== null && { GlobalTableVersion: input.GlobalTableVersion }), + ...(input.ItemCount !== undefined && input.ItemCount !== null && { ItemCount: input.ItemCount }), + ...(input.KeySchema !== undefined && + input.KeySchema !== null && { + KeySchema: serializeAws_restJson1AwsDynamoDbTableKeySchemaList(input.KeySchema, context), + }), + ...(input.LatestStreamArn !== undefined && + input.LatestStreamArn !== null && { LatestStreamArn: input.LatestStreamArn }), + ...(input.LatestStreamLabel !== undefined && + input.LatestStreamLabel !== null && { LatestStreamLabel: input.LatestStreamLabel }), + ...(input.LocalSecondaryIndexes !== undefined && + input.LocalSecondaryIndexes !== null && { + LocalSecondaryIndexes: serializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndexList( + input.LocalSecondaryIndexes, + context + ), + }), + ...(input.ProvisionedThroughput !== undefined && + input.ProvisionedThroughput !== null && { + ProvisionedThroughput: serializeAws_restJson1AwsDynamoDbTableProvisionedThroughput( + input.ProvisionedThroughput, + context + ), + }), + ...(input.Replicas !== undefined && + input.Replicas !== null && { + Replicas: serializeAws_restJson1AwsDynamoDbTableReplicaList(input.Replicas, context), + }), + ...(input.RestoreSummary !== undefined && + input.RestoreSummary !== null && { + RestoreSummary: serializeAws_restJson1AwsDynamoDbTableRestoreSummary(input.RestoreSummary, context), + }), + ...(input.SseDescription !== undefined && + input.SseDescription !== null && { + SseDescription: serializeAws_restJson1AwsDynamoDbTableSseDescription(input.SseDescription, context), + }), + ...(input.StreamSpecification !== undefined && + input.StreamSpecification !== null && { + StreamSpecification: serializeAws_restJson1AwsDynamoDbTableStreamSpecification( + input.StreamSpecification, + context + ), + }), + ...(input.TableId !== undefined && input.TableId !== null && { TableId: input.TableId }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.TableSizeBytes !== undefined && + input.TableSizeBytes !== null && { TableSizeBytes: input.TableSizeBytes }), + ...(input.TableStatus !== undefined && input.TableStatus !== null && { TableStatus: input.TableStatus }), }; }; @@ -6597,24 +6765,28 @@ const serializeAws_restJson1AwsDynamoDbTableGlobalSecondaryIndex = ( context: __SerdeContext ): any => { return { - ...(input.Backfilling !== undefined && { Backfilling: input.Backfilling }), - ...(input.IndexArn !== undefined && { IndexArn: input.IndexArn }), - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.IndexSizeBytes !== undefined && { IndexSizeBytes: input.IndexSizeBytes }), - ...(input.IndexStatus !== undefined && { IndexStatus: input.IndexStatus }), - ...(input.ItemCount !== undefined && { ItemCount: input.ItemCount }), - ...(input.KeySchema !== undefined && { - KeySchema: serializeAws_restJson1AwsDynamoDbTableKeySchemaList(input.KeySchema, context), - }), - ...(input.Projection !== undefined && { - Projection: serializeAws_restJson1AwsDynamoDbTableProjection(input.Projection, context), - }), - ...(input.ProvisionedThroughput !== undefined && { - ProvisionedThroughput: serializeAws_restJson1AwsDynamoDbTableProvisionedThroughput( - input.ProvisionedThroughput, - context - ), - }), + ...(input.Backfilling !== undefined && input.Backfilling !== null && { Backfilling: input.Backfilling }), + ...(input.IndexArn !== undefined && input.IndexArn !== null && { IndexArn: input.IndexArn }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.IndexSizeBytes !== undefined && + input.IndexSizeBytes !== null && { IndexSizeBytes: input.IndexSizeBytes }), + ...(input.IndexStatus !== undefined && input.IndexStatus !== null && { IndexStatus: input.IndexStatus }), + ...(input.ItemCount !== undefined && input.ItemCount !== null && { ItemCount: input.ItemCount }), + ...(input.KeySchema !== undefined && + input.KeySchema !== null && { + KeySchema: serializeAws_restJson1AwsDynamoDbTableKeySchemaList(input.KeySchema, context), + }), + ...(input.Projection !== undefined && + input.Projection !== null && { + Projection: serializeAws_restJson1AwsDynamoDbTableProjection(input.Projection, context), + }), + ...(input.ProvisionedThroughput !== undefined && + input.ProvisionedThroughput !== null && { + ProvisionedThroughput: serializeAws_restJson1AwsDynamoDbTableProvisionedThroughput( + input.ProvisionedThroughput, + context + ), + }), }; }; @@ -6622,7 +6794,14 @@ const serializeAws_restJson1AwsDynamoDbTableGlobalSecondaryIndexList = ( input: AwsDynamoDbTableGlobalSecondaryIndex[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsDynamoDbTableGlobalSecondaryIndex(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsDynamoDbTableGlobalSecondaryIndex(entry, context); + }); }; const serializeAws_restJson1AwsDynamoDbTableKeySchema = ( @@ -6630,8 +6809,8 @@ const serializeAws_restJson1AwsDynamoDbTableKeySchema = ( context: __SerdeContext ): any => { return { - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.KeyType !== undefined && { KeyType: input.KeyType }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.KeyType !== undefined && input.KeyType !== null && { KeyType: input.KeyType }), }; }; @@ -6639,7 +6818,14 @@ const serializeAws_restJson1AwsDynamoDbTableKeySchemaList = ( input: AwsDynamoDbTableKeySchema[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsDynamoDbTableKeySchema(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsDynamoDbTableKeySchema(entry, context); + }); }; const serializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndex = ( @@ -6647,14 +6833,16 @@ const serializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndex = ( context: __SerdeContext ): any => { return { - ...(input.IndexArn !== undefined && { IndexArn: input.IndexArn }), - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.KeySchema !== undefined && { - KeySchema: serializeAws_restJson1AwsDynamoDbTableKeySchemaList(input.KeySchema, context), - }), - ...(input.Projection !== undefined && { - Projection: serializeAws_restJson1AwsDynamoDbTableProjection(input.Projection, context), - }), + ...(input.IndexArn !== undefined && input.IndexArn !== null && { IndexArn: input.IndexArn }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.KeySchema !== undefined && + input.KeySchema !== null && { + KeySchema: serializeAws_restJson1AwsDynamoDbTableKeySchemaList(input.KeySchema, context), + }), + ...(input.Projection !== undefined && + input.Projection !== null && { + Projection: serializeAws_restJson1AwsDynamoDbTableProjection(input.Projection, context), + }), }; }; @@ -6662,7 +6850,14 @@ const serializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndexList = ( input: AwsDynamoDbTableLocalSecondaryIndex[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndex(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndex(entry, context); + }); }; const serializeAws_restJson1AwsDynamoDbTableProjection = ( @@ -6670,10 +6865,12 @@ const serializeAws_restJson1AwsDynamoDbTableProjection = ( context: __SerdeContext ): any => { return { - ...(input.NonKeyAttributes !== undefined && { - NonKeyAttributes: serializeAws_restJson1StringList(input.NonKeyAttributes, context), - }), - ...(input.ProjectionType !== undefined && { ProjectionType: input.ProjectionType }), + ...(input.NonKeyAttributes !== undefined && + input.NonKeyAttributes !== null && { + NonKeyAttributes: serializeAws_restJson1StringList(input.NonKeyAttributes, context), + }), + ...(input.ProjectionType !== undefined && + input.ProjectionType !== null && { ProjectionType: input.ProjectionType }), }; }; @@ -6682,11 +6879,16 @@ const serializeAws_restJson1AwsDynamoDbTableProvisionedThroughput = ( context: __SerdeContext ): any => { return { - ...(input.LastDecreaseDateTime !== undefined && { LastDecreaseDateTime: input.LastDecreaseDateTime }), - ...(input.LastIncreaseDateTime !== undefined && { LastIncreaseDateTime: input.LastIncreaseDateTime }), - ...(input.NumberOfDecreasesToday !== undefined && { NumberOfDecreasesToday: input.NumberOfDecreasesToday }), - ...(input.ReadCapacityUnits !== undefined && { ReadCapacityUnits: input.ReadCapacityUnits }), - ...(input.WriteCapacityUnits !== undefined && { WriteCapacityUnits: input.WriteCapacityUnits }), + ...(input.LastDecreaseDateTime !== undefined && + input.LastDecreaseDateTime !== null && { LastDecreaseDateTime: input.LastDecreaseDateTime }), + ...(input.LastIncreaseDateTime !== undefined && + input.LastIncreaseDateTime !== null && { LastIncreaseDateTime: input.LastIncreaseDateTime }), + ...(input.NumberOfDecreasesToday !== undefined && + input.NumberOfDecreasesToday !== null && { NumberOfDecreasesToday: input.NumberOfDecreasesToday }), + ...(input.ReadCapacityUnits !== undefined && + input.ReadCapacityUnits !== null && { ReadCapacityUnits: input.ReadCapacityUnits }), + ...(input.WriteCapacityUnits !== undefined && + input.WriteCapacityUnits !== null && { WriteCapacityUnits: input.WriteCapacityUnits }), }; }; @@ -6695,7 +6897,8 @@ const serializeAws_restJson1AwsDynamoDbTableProvisionedThroughputOverride = ( context: __SerdeContext ): any => { return { - ...(input.ReadCapacityUnits !== undefined && { ReadCapacityUnits: input.ReadCapacityUnits }), + ...(input.ReadCapacityUnits !== undefined && + input.ReadCapacityUnits !== null && { ReadCapacityUnits: input.ReadCapacityUnits }), }; }; @@ -6704,22 +6907,26 @@ const serializeAws_restJson1AwsDynamoDbTableReplica = ( context: __SerdeContext ): any => { return { - ...(input.GlobalSecondaryIndexes !== undefined && { - GlobalSecondaryIndexes: serializeAws_restJson1AwsDynamoDbTableReplicaGlobalSecondaryIndexList( - input.GlobalSecondaryIndexes, - context - ), - }), - ...(input.KmsMasterKeyId !== undefined && { KmsMasterKeyId: input.KmsMasterKeyId }), - ...(input.ProvisionedThroughputOverride !== undefined && { - ProvisionedThroughputOverride: serializeAws_restJson1AwsDynamoDbTableProvisionedThroughputOverride( - input.ProvisionedThroughputOverride, - context - ), - }), - ...(input.RegionName !== undefined && { RegionName: input.RegionName }), - ...(input.ReplicaStatus !== undefined && { ReplicaStatus: input.ReplicaStatus }), - ...(input.ReplicaStatusDescription !== undefined && { ReplicaStatusDescription: input.ReplicaStatusDescription }), + ...(input.GlobalSecondaryIndexes !== undefined && + input.GlobalSecondaryIndexes !== null && { + GlobalSecondaryIndexes: serializeAws_restJson1AwsDynamoDbTableReplicaGlobalSecondaryIndexList( + input.GlobalSecondaryIndexes, + context + ), + }), + ...(input.KmsMasterKeyId !== undefined && + input.KmsMasterKeyId !== null && { KmsMasterKeyId: input.KmsMasterKeyId }), + ...(input.ProvisionedThroughputOverride !== undefined && + input.ProvisionedThroughputOverride !== null && { + ProvisionedThroughputOverride: serializeAws_restJson1AwsDynamoDbTableProvisionedThroughputOverride( + input.ProvisionedThroughputOverride, + context + ), + }), + ...(input.RegionName !== undefined && input.RegionName !== null && { RegionName: input.RegionName }), + ...(input.ReplicaStatus !== undefined && input.ReplicaStatus !== null && { ReplicaStatus: input.ReplicaStatus }), + ...(input.ReplicaStatusDescription !== undefined && + input.ReplicaStatusDescription !== null && { ReplicaStatusDescription: input.ReplicaStatusDescription }), }; }; @@ -6728,13 +6935,14 @@ const serializeAws_restJson1AwsDynamoDbTableReplicaGlobalSecondaryIndex = ( context: __SerdeContext ): any => { return { - ...(input.IndexName !== undefined && { IndexName: input.IndexName }), - ...(input.ProvisionedThroughputOverride !== undefined && { - ProvisionedThroughputOverride: serializeAws_restJson1AwsDynamoDbTableProvisionedThroughputOverride( - input.ProvisionedThroughputOverride, - context - ), - }), + ...(input.IndexName !== undefined && input.IndexName !== null && { IndexName: input.IndexName }), + ...(input.ProvisionedThroughputOverride !== undefined && + input.ProvisionedThroughputOverride !== null && { + ProvisionedThroughputOverride: serializeAws_restJson1AwsDynamoDbTableProvisionedThroughputOverride( + input.ProvisionedThroughputOverride, + context + ), + }), }; }; @@ -6742,14 +6950,28 @@ const serializeAws_restJson1AwsDynamoDbTableReplicaGlobalSecondaryIndexList = ( input: AwsDynamoDbTableReplicaGlobalSecondaryIndex[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsDynamoDbTableReplicaGlobalSecondaryIndex(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsDynamoDbTableReplicaGlobalSecondaryIndex(entry, context); + }); }; const serializeAws_restJson1AwsDynamoDbTableReplicaList = ( input: AwsDynamoDbTableReplica[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsDynamoDbTableReplica(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsDynamoDbTableReplica(entry, context); + }); }; const serializeAws_restJson1AwsDynamoDbTableRestoreSummary = ( @@ -6757,10 +6979,14 @@ const serializeAws_restJson1AwsDynamoDbTableRestoreSummary = ( context: __SerdeContext ): any => { return { - ...(input.RestoreDateTime !== undefined && { RestoreDateTime: input.RestoreDateTime }), - ...(input.RestoreInProgress !== undefined && { RestoreInProgress: input.RestoreInProgress }), - ...(input.SourceBackupArn !== undefined && { SourceBackupArn: input.SourceBackupArn }), - ...(input.SourceTableArn !== undefined && { SourceTableArn: input.SourceTableArn }), + ...(input.RestoreDateTime !== undefined && + input.RestoreDateTime !== null && { RestoreDateTime: input.RestoreDateTime }), + ...(input.RestoreInProgress !== undefined && + input.RestoreInProgress !== null && { RestoreInProgress: input.RestoreInProgress }), + ...(input.SourceBackupArn !== undefined && + input.SourceBackupArn !== null && { SourceBackupArn: input.SourceBackupArn }), + ...(input.SourceTableArn !== undefined && + input.SourceTableArn !== null && { SourceTableArn: input.SourceTableArn }), }; }; @@ -6769,12 +6995,14 @@ const serializeAws_restJson1AwsDynamoDbTableSseDescription = ( context: __SerdeContext ): any => { return { - ...(input.InaccessibleEncryptionDateTime !== undefined && { - InaccessibleEncryptionDateTime: input.InaccessibleEncryptionDateTime, - }), - ...(input.KmsMasterKeyArn !== undefined && { KmsMasterKeyArn: input.KmsMasterKeyArn }), - ...(input.SseType !== undefined && { SseType: input.SseType }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.InaccessibleEncryptionDateTime !== undefined && + input.InaccessibleEncryptionDateTime !== null && { + InaccessibleEncryptionDateTime: input.InaccessibleEncryptionDateTime, + }), + ...(input.KmsMasterKeyArn !== undefined && + input.KmsMasterKeyArn !== null && { KmsMasterKeyArn: input.KmsMasterKeyArn }), + ...(input.SseType !== undefined && input.SseType !== null && { SseType: input.SseType }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -6783,41 +7011,50 @@ const serializeAws_restJson1AwsDynamoDbTableStreamSpecification = ( context: __SerdeContext ): any => { return { - ...(input.StreamEnabled !== undefined && { StreamEnabled: input.StreamEnabled }), - ...(input.StreamViewType !== undefined && { StreamViewType: input.StreamViewType }), + ...(input.StreamEnabled !== undefined && input.StreamEnabled !== null && { StreamEnabled: input.StreamEnabled }), + ...(input.StreamViewType !== undefined && + input.StreamViewType !== null && { StreamViewType: input.StreamViewType }), }; }; const serializeAws_restJson1AwsEc2EipDetails = (input: AwsEc2EipDetails, context: __SerdeContext): any => { return { - ...(input.AllocationId !== undefined && { AllocationId: input.AllocationId }), - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.NetworkBorderGroup !== undefined && { NetworkBorderGroup: input.NetworkBorderGroup }), - ...(input.NetworkInterfaceId !== undefined && { NetworkInterfaceId: input.NetworkInterfaceId }), - ...(input.NetworkInterfaceOwnerId !== undefined && { NetworkInterfaceOwnerId: input.NetworkInterfaceOwnerId }), - ...(input.PrivateIpAddress !== undefined && { PrivateIpAddress: input.PrivateIpAddress }), - ...(input.PublicIp !== undefined && { PublicIp: input.PublicIp }), - ...(input.PublicIpv4Pool !== undefined && { PublicIpv4Pool: input.PublicIpv4Pool }), + ...(input.AllocationId !== undefined && input.AllocationId !== null && { AllocationId: input.AllocationId }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.NetworkBorderGroup !== undefined && + input.NetworkBorderGroup !== null && { NetworkBorderGroup: input.NetworkBorderGroup }), + ...(input.NetworkInterfaceId !== undefined && + input.NetworkInterfaceId !== null && { NetworkInterfaceId: input.NetworkInterfaceId }), + ...(input.NetworkInterfaceOwnerId !== undefined && + input.NetworkInterfaceOwnerId !== null && { NetworkInterfaceOwnerId: input.NetworkInterfaceOwnerId }), + ...(input.PrivateIpAddress !== undefined && + input.PrivateIpAddress !== null && { PrivateIpAddress: input.PrivateIpAddress }), + ...(input.PublicIp !== undefined && input.PublicIp !== null && { PublicIp: input.PublicIp }), + ...(input.PublicIpv4Pool !== undefined && + input.PublicIpv4Pool !== null && { PublicIpv4Pool: input.PublicIpv4Pool }), }; }; const serializeAws_restJson1AwsEc2InstanceDetails = (input: AwsEc2InstanceDetails, context: __SerdeContext): any => { return { - ...(input.IamInstanceProfileArn !== undefined && { IamInstanceProfileArn: input.IamInstanceProfileArn }), - ...(input.ImageId !== undefined && { ImageId: input.ImageId }), - ...(input.IpV4Addresses !== undefined && { - IpV4Addresses: serializeAws_restJson1StringList(input.IpV4Addresses, context), - }), - ...(input.IpV6Addresses !== undefined && { - IpV6Addresses: serializeAws_restJson1StringList(input.IpV6Addresses, context), - }), - ...(input.KeyName !== undefined && { KeyName: input.KeyName }), - ...(input.LaunchedAt !== undefined && { LaunchedAt: input.LaunchedAt }), - ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.IamInstanceProfileArn !== undefined && + input.IamInstanceProfileArn !== null && { IamInstanceProfileArn: input.IamInstanceProfileArn }), + ...(input.ImageId !== undefined && input.ImageId !== null && { ImageId: input.ImageId }), + ...(input.IpV4Addresses !== undefined && + input.IpV4Addresses !== null && { + IpV4Addresses: serializeAws_restJson1StringList(input.IpV4Addresses, context), + }), + ...(input.IpV6Addresses !== undefined && + input.IpV6Addresses !== null && { + IpV6Addresses: serializeAws_restJson1StringList(input.IpV6Addresses, context), + }), + ...(input.KeyName !== undefined && input.KeyName !== null && { KeyName: input.KeyName }), + ...(input.LaunchedAt !== undefined && input.LaunchedAt !== null && { LaunchedAt: input.LaunchedAt }), + ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -6826,13 +7063,15 @@ const serializeAws_restJson1AwsEc2NetworkInterfaceAttachment = ( context: __SerdeContext ): any => { return { - ...(input.AttachTime !== undefined && { AttachTime: input.AttachTime }), - ...(input.AttachmentId !== undefined && { AttachmentId: input.AttachmentId }), - ...(input.DeleteOnTermination !== undefined && { DeleteOnTermination: input.DeleteOnTermination }), - ...(input.DeviceIndex !== undefined && { DeviceIndex: input.DeviceIndex }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.InstanceOwnerId !== undefined && { InstanceOwnerId: input.InstanceOwnerId }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.AttachTime !== undefined && input.AttachTime !== null && { AttachTime: input.AttachTime }), + ...(input.AttachmentId !== undefined && input.AttachmentId !== null && { AttachmentId: input.AttachmentId }), + ...(input.DeleteOnTermination !== undefined && + input.DeleteOnTermination !== null && { DeleteOnTermination: input.DeleteOnTermination }), + ...(input.DeviceIndex !== undefined && input.DeviceIndex !== null && { DeviceIndex: input.DeviceIndex }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.InstanceOwnerId !== undefined && + input.InstanceOwnerId !== null && { InstanceOwnerId: input.InstanceOwnerId }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -6841,14 +7080,18 @@ const serializeAws_restJson1AwsEc2NetworkInterfaceDetails = ( context: __SerdeContext ): any => { return { - ...(input.Attachment !== undefined && { - Attachment: serializeAws_restJson1AwsEc2NetworkInterfaceAttachment(input.Attachment, context), - }), - ...(input.NetworkInterfaceId !== undefined && { NetworkInterfaceId: input.NetworkInterfaceId }), - ...(input.SecurityGroups !== undefined && { - SecurityGroups: serializeAws_restJson1AwsEc2NetworkInterfaceSecurityGroupList(input.SecurityGroups, context), - }), - ...(input.SourceDestCheck !== undefined && { SourceDestCheck: input.SourceDestCheck }), + ...(input.Attachment !== undefined && + input.Attachment !== null && { + Attachment: serializeAws_restJson1AwsEc2NetworkInterfaceAttachment(input.Attachment, context), + }), + ...(input.NetworkInterfaceId !== undefined && + input.NetworkInterfaceId !== null && { NetworkInterfaceId: input.NetworkInterfaceId }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + SecurityGroups: serializeAws_restJson1AwsEc2NetworkInterfaceSecurityGroupList(input.SecurityGroups, context), + }), + ...(input.SourceDestCheck !== undefined && + input.SourceDestCheck !== null && { SourceDestCheck: input.SourceDestCheck }), }; }; @@ -6857,8 +7100,8 @@ const serializeAws_restJson1AwsEc2NetworkInterfaceSecurityGroup = ( context: __SerdeContext ): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), }; }; @@ -6866,7 +7109,14 @@ const serializeAws_restJson1AwsEc2NetworkInterfaceSecurityGroupList = ( input: AwsEc2NetworkInterfaceSecurityGroup[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsEc2NetworkInterfaceSecurityGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsEc2NetworkInterfaceSecurityGroup(entry, context); + }); }; const serializeAws_restJson1AwsEc2SecurityGroupDetails = ( @@ -6874,19 +7124,21 @@ const serializeAws_restJson1AwsEc2SecurityGroupDetails = ( context: __SerdeContext ): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.IpPermissions !== undefined && { - IpPermissions: serializeAws_restJson1AwsEc2SecurityGroupIpPermissionList(input.IpPermissions, context), - }), - ...(input.IpPermissionsEgress !== undefined && { - IpPermissionsEgress: serializeAws_restJson1AwsEc2SecurityGroupIpPermissionList( - input.IpPermissionsEgress, - context - ), - }), - ...(input.OwnerId !== undefined && { OwnerId: input.OwnerId }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.IpPermissions !== undefined && + input.IpPermissions !== null && { + IpPermissions: serializeAws_restJson1AwsEc2SecurityGroupIpPermissionList(input.IpPermissions, context), + }), + ...(input.IpPermissionsEgress !== undefined && + input.IpPermissionsEgress !== null && { + IpPermissionsEgress: serializeAws_restJson1AwsEc2SecurityGroupIpPermissionList( + input.IpPermissionsEgress, + context + ), + }), + ...(input.OwnerId !== undefined && input.OwnerId !== null && { OwnerId: input.OwnerId }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -6895,21 +7147,25 @@ const serializeAws_restJson1AwsEc2SecurityGroupIpPermission = ( context: __SerdeContext ): any => { return { - ...(input.FromPort !== undefined && { FromPort: input.FromPort }), - ...(input.IpProtocol !== undefined && { IpProtocol: input.IpProtocol }), - ...(input.IpRanges !== undefined && { - IpRanges: serializeAws_restJson1AwsEc2SecurityGroupIpRangeList(input.IpRanges, context), - }), - ...(input.Ipv6Ranges !== undefined && { - Ipv6Ranges: serializeAws_restJson1AwsEc2SecurityGroupIpv6RangeList(input.Ipv6Ranges, context), - }), - ...(input.PrefixListIds !== undefined && { - PrefixListIds: serializeAws_restJson1AwsEc2SecurityGroupPrefixListIdList(input.PrefixListIds, context), - }), - ...(input.ToPort !== undefined && { ToPort: input.ToPort }), - ...(input.UserIdGroupPairs !== undefined && { - UserIdGroupPairs: serializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPairList(input.UserIdGroupPairs, context), - }), + ...(input.FromPort !== undefined && input.FromPort !== null && { FromPort: input.FromPort }), + ...(input.IpProtocol !== undefined && input.IpProtocol !== null && { IpProtocol: input.IpProtocol }), + ...(input.IpRanges !== undefined && + input.IpRanges !== null && { + IpRanges: serializeAws_restJson1AwsEc2SecurityGroupIpRangeList(input.IpRanges, context), + }), + ...(input.Ipv6Ranges !== undefined && + input.Ipv6Ranges !== null && { + Ipv6Ranges: serializeAws_restJson1AwsEc2SecurityGroupIpv6RangeList(input.Ipv6Ranges, context), + }), + ...(input.PrefixListIds !== undefined && + input.PrefixListIds !== null && { + PrefixListIds: serializeAws_restJson1AwsEc2SecurityGroupPrefixListIdList(input.PrefixListIds, context), + }), + ...(input.ToPort !== undefined && input.ToPort !== null && { ToPort: input.ToPort }), + ...(input.UserIdGroupPairs !== undefined && + input.UserIdGroupPairs !== null && { + UserIdGroupPairs: serializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPairList(input.UserIdGroupPairs, context), + }), }; }; @@ -6917,7 +7173,14 @@ const serializeAws_restJson1AwsEc2SecurityGroupIpPermissionList = ( input: AwsEc2SecurityGroupIpPermission[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsEc2SecurityGroupIpPermission(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsEc2SecurityGroupIpPermission(entry, context); + }); }; const serializeAws_restJson1AwsEc2SecurityGroupIpRange = ( @@ -6925,7 +7188,7 @@ const serializeAws_restJson1AwsEc2SecurityGroupIpRange = ( context: __SerdeContext ): any => { return { - ...(input.CidrIp !== undefined && { CidrIp: input.CidrIp }), + ...(input.CidrIp !== undefined && input.CidrIp !== null && { CidrIp: input.CidrIp }), }; }; @@ -6933,7 +7196,14 @@ const serializeAws_restJson1AwsEc2SecurityGroupIpRangeList = ( input: AwsEc2SecurityGroupIpRange[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsEc2SecurityGroupIpRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsEc2SecurityGroupIpRange(entry, context); + }); }; const serializeAws_restJson1AwsEc2SecurityGroupIpv6Range = ( @@ -6941,7 +7211,7 @@ const serializeAws_restJson1AwsEc2SecurityGroupIpv6Range = ( context: __SerdeContext ): any => { return { - ...(input.CidrIpv6 !== undefined && { CidrIpv6: input.CidrIpv6 }), + ...(input.CidrIpv6 !== undefined && input.CidrIpv6 !== null && { CidrIpv6: input.CidrIpv6 }), }; }; @@ -6949,7 +7219,14 @@ const serializeAws_restJson1AwsEc2SecurityGroupIpv6RangeList = ( input: AwsEc2SecurityGroupIpv6Range[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsEc2SecurityGroupIpv6Range(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsEc2SecurityGroupIpv6Range(entry, context); + }); }; const serializeAws_restJson1AwsEc2SecurityGroupPrefixListId = ( @@ -6957,7 +7234,7 @@ const serializeAws_restJson1AwsEc2SecurityGroupPrefixListId = ( context: __SerdeContext ): any => { return { - ...(input.PrefixListId !== undefined && { PrefixListId: input.PrefixListId }), + ...(input.PrefixListId !== undefined && input.PrefixListId !== null && { PrefixListId: input.PrefixListId }), }; }; @@ -6965,7 +7242,14 @@ const serializeAws_restJson1AwsEc2SecurityGroupPrefixListIdList = ( input: AwsEc2SecurityGroupPrefixListId[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsEc2SecurityGroupPrefixListId(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsEc2SecurityGroupPrefixListId(entry, context); + }); }; const serializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPair = ( @@ -6973,12 +7257,13 @@ const serializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPair = ( context: __SerdeContext ): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.PeeringStatus !== undefined && { PeeringStatus: input.PeeringStatus }), - ...(input.UserId !== undefined && { UserId: input.UserId }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), - ...(input.VpcPeeringConnectionId !== undefined && { VpcPeeringConnectionId: input.VpcPeeringConnectionId }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.PeeringStatus !== undefined && input.PeeringStatus !== null && { PeeringStatus: input.PeeringStatus }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), + ...(input.VpcPeeringConnectionId !== undefined && + input.VpcPeeringConnectionId !== null && { VpcPeeringConnectionId: input.VpcPeeringConnectionId }), }; }; @@ -6986,15 +7271,23 @@ const serializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPairList = ( input: AwsEc2SecurityGroupUserIdGroupPair[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPair(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPair(entry, context); + }); }; const serializeAws_restJson1AwsEc2VolumeAttachment = (input: AwsEc2VolumeAttachment, context: __SerdeContext): any => { return { - ...(input.AttachTime !== undefined && { AttachTime: input.AttachTime }), - ...(input.DeleteOnTermination !== undefined && { DeleteOnTermination: input.DeleteOnTermination }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.AttachTime !== undefined && input.AttachTime !== null && { AttachTime: input.AttachTime }), + ...(input.DeleteOnTermination !== undefined && + input.DeleteOnTermination !== null && { DeleteOnTermination: input.DeleteOnTermination }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -7002,36 +7295,46 @@ const serializeAws_restJson1AwsEc2VolumeAttachmentList = ( input: AwsEc2VolumeAttachment[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsEc2VolumeAttachment(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsEc2VolumeAttachment(entry, context); + }); }; const serializeAws_restJson1AwsEc2VolumeDetails = (input: AwsEc2VolumeDetails, context: __SerdeContext): any => { return { - ...(input.Attachments !== undefined && { - Attachments: serializeAws_restJson1AwsEc2VolumeAttachmentList(input.Attachments, context), - }), - ...(input.CreateTime !== undefined && { CreateTime: input.CreateTime }), - ...(input.Encrypted !== undefined && { Encrypted: input.Encrypted }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.Size !== undefined && { Size: input.Size }), - ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.Attachments !== undefined && + input.Attachments !== null && { + Attachments: serializeAws_restJson1AwsEc2VolumeAttachmentList(input.Attachments, context), + }), + ...(input.CreateTime !== undefined && input.CreateTime !== null && { CreateTime: input.CreateTime }), + ...(input.Encrypted !== undefined && input.Encrypted !== null && { Encrypted: input.Encrypted }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), + ...(input.SnapshotId !== undefined && input.SnapshotId !== null && { SnapshotId: input.SnapshotId }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; const serializeAws_restJson1AwsEc2VpcDetails = (input: AwsEc2VpcDetails, context: __SerdeContext): any => { return { - ...(input.CidrBlockAssociationSet !== undefined && { - CidrBlockAssociationSet: serializeAws_restJson1CidrBlockAssociationList(input.CidrBlockAssociationSet, context), - }), - ...(input.DhcpOptionsId !== undefined && { DhcpOptionsId: input.DhcpOptionsId }), - ...(input.Ipv6CidrBlockAssociationSet !== undefined && { - Ipv6CidrBlockAssociationSet: serializeAws_restJson1Ipv6CidrBlockAssociationList( - input.Ipv6CidrBlockAssociationSet, - context - ), - }), - ...(input.State !== undefined && { State: input.State }), + ...(input.CidrBlockAssociationSet !== undefined && + input.CidrBlockAssociationSet !== null && { + CidrBlockAssociationSet: serializeAws_restJson1CidrBlockAssociationList(input.CidrBlockAssociationSet, context), + }), + ...(input.DhcpOptionsId !== undefined && input.DhcpOptionsId !== null && { DhcpOptionsId: input.DhcpOptionsId }), + ...(input.Ipv6CidrBlockAssociationSet !== undefined && + input.Ipv6CidrBlockAssociationSet !== null && { + Ipv6CidrBlockAssociationSet: serializeAws_restJson1Ipv6CidrBlockAssociationList( + input.Ipv6CidrBlockAssociationSet, + context + ), + }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; @@ -7040,33 +7343,40 @@ const serializeAws_restJson1AwsElasticsearchDomainDetails = ( context: __SerdeContext ): any => { return { - ...(input.AccessPolicies !== undefined && { AccessPolicies: input.AccessPolicies }), - ...(input.DomainEndpointOptions !== undefined && { - DomainEndpointOptions: serializeAws_restJson1AwsElasticsearchDomainDomainEndpointOptions( - input.DomainEndpointOptions, - context - ), - }), - ...(input.DomainId !== undefined && { DomainId: input.DomainId }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.ElasticsearchVersion !== undefined && { ElasticsearchVersion: input.ElasticsearchVersion }), - ...(input.EncryptionAtRestOptions !== undefined && { - EncryptionAtRestOptions: serializeAws_restJson1AwsElasticsearchDomainEncryptionAtRestOptions( - input.EncryptionAtRestOptions, - context - ), - }), - ...(input.Endpoint !== undefined && { Endpoint: input.Endpoint }), - ...(input.Endpoints !== undefined && { Endpoints: serializeAws_restJson1FieldMap(input.Endpoints, context) }), - ...(input.NodeToNodeEncryptionOptions !== undefined && { - NodeToNodeEncryptionOptions: serializeAws_restJson1AwsElasticsearchDomainNodeToNodeEncryptionOptions( - input.NodeToNodeEncryptionOptions, - context - ), - }), - ...(input.VPCOptions !== undefined && { - VPCOptions: serializeAws_restJson1AwsElasticsearchDomainVPCOptions(input.VPCOptions, context), - }), + ...(input.AccessPolicies !== undefined && + input.AccessPolicies !== null && { AccessPolicies: input.AccessPolicies }), + ...(input.DomainEndpointOptions !== undefined && + input.DomainEndpointOptions !== null && { + DomainEndpointOptions: serializeAws_restJson1AwsElasticsearchDomainDomainEndpointOptions( + input.DomainEndpointOptions, + context + ), + }), + ...(input.DomainId !== undefined && input.DomainId !== null && { DomainId: input.DomainId }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.ElasticsearchVersion !== undefined && + input.ElasticsearchVersion !== null && { ElasticsearchVersion: input.ElasticsearchVersion }), + ...(input.EncryptionAtRestOptions !== undefined && + input.EncryptionAtRestOptions !== null && { + EncryptionAtRestOptions: serializeAws_restJson1AwsElasticsearchDomainEncryptionAtRestOptions( + input.EncryptionAtRestOptions, + context + ), + }), + ...(input.Endpoint !== undefined && input.Endpoint !== null && { Endpoint: input.Endpoint }), + ...(input.Endpoints !== undefined && + input.Endpoints !== null && { Endpoints: serializeAws_restJson1FieldMap(input.Endpoints, context) }), + ...(input.NodeToNodeEncryptionOptions !== undefined && + input.NodeToNodeEncryptionOptions !== null && { + NodeToNodeEncryptionOptions: serializeAws_restJson1AwsElasticsearchDomainNodeToNodeEncryptionOptions( + input.NodeToNodeEncryptionOptions, + context + ), + }), + ...(input.VPCOptions !== undefined && + input.VPCOptions !== null && { + VPCOptions: serializeAws_restJson1AwsElasticsearchDomainVPCOptions(input.VPCOptions, context), + }), }; }; @@ -7075,8 +7385,9 @@ const serializeAws_restJson1AwsElasticsearchDomainDomainEndpointOptions = ( context: __SerdeContext ): any => { return { - ...(input.EnforceHTTPS !== undefined && { EnforceHTTPS: input.EnforceHTTPS }), - ...(input.TLSSecurityPolicy !== undefined && { TLSSecurityPolicy: input.TLSSecurityPolicy }), + ...(input.EnforceHTTPS !== undefined && input.EnforceHTTPS !== null && { EnforceHTTPS: input.EnforceHTTPS }), + ...(input.TLSSecurityPolicy !== undefined && + input.TLSSecurityPolicy !== null && { TLSSecurityPolicy: input.TLSSecurityPolicy }), }; }; @@ -7085,8 +7396,8 @@ const serializeAws_restJson1AwsElasticsearchDomainEncryptionAtRestOptions = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), }; }; @@ -7095,7 +7406,7 @@ const serializeAws_restJson1AwsElasticsearchDomainNodeToNodeEncryptionOptions = context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; @@ -7104,16 +7415,17 @@ const serializeAws_restJson1AwsElasticsearchDomainVPCOptions = ( context: __SerdeContext ): any => { return { - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_restJson1NonEmptyStringList(input.AvailabilityZones, context), - }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_restJson1NonEmptyStringList(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { - SubnetIds: serializeAws_restJson1NonEmptyStringList(input.SubnetIds, context), - }), - ...(input.VPCId !== undefined && { VPCId: input.VPCId }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_restJson1NonEmptyStringList(input.AvailabilityZones, context), + }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_restJson1NonEmptyStringList(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_restJson1NonEmptyStringList(input.SubnetIds, context) }), + ...(input.VPCId !== undefined && input.VPCId !== null && { VPCId: input.VPCId }), }; }; @@ -7121,7 +7433,14 @@ const serializeAws_restJson1AwsElbAppCookieStickinessPolicies = ( input: AwsElbAppCookieStickinessPolicy[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsElbAppCookieStickinessPolicy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsElbAppCookieStickinessPolicy(entry, context); + }); }; const serializeAws_restJson1AwsElbAppCookieStickinessPolicy = ( @@ -7129,8 +7448,8 @@ const serializeAws_restJson1AwsElbAppCookieStickinessPolicy = ( context: __SerdeContext ): any => { return { - ...(input.CookieName !== undefined && { CookieName: input.CookieName }), - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.CookieName !== undefined && input.CookieName !== null && { CookieName: input.CookieName }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), }; }; @@ -7138,7 +7457,14 @@ const serializeAws_restJson1AwsElbLbCookieStickinessPolicies = ( input: AwsElbLbCookieStickinessPolicy[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsElbLbCookieStickinessPolicy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsElbLbCookieStickinessPolicy(entry, context); + }); }; const serializeAws_restJson1AwsElbLbCookieStickinessPolicy = ( @@ -7146,8 +7472,9 @@ const serializeAws_restJson1AwsElbLbCookieStickinessPolicy = ( context: __SerdeContext ): any => { return { - ...(input.CookieExpirationPeriod !== undefined && { CookieExpirationPeriod: input.CookieExpirationPeriod }), - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.CookieExpirationPeriod !== undefined && + input.CookieExpirationPeriod !== null && { CookieExpirationPeriod: input.CookieExpirationPeriod }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), }; }; @@ -7156,10 +7483,11 @@ const serializeAws_restJson1AwsElbLoadBalancerAccessLog = ( context: __SerdeContext ): any => { return { - ...(input.EmitInterval !== undefined && { EmitInterval: input.EmitInterval }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.S3BucketPrefix !== undefined && { S3BucketPrefix: input.S3BucketPrefix }), + ...(input.EmitInterval !== undefined && input.EmitInterval !== null && { EmitInterval: input.EmitInterval }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.S3BucketPrefix !== undefined && + input.S3BucketPrefix !== null && { S3BucketPrefix: input.S3BucketPrefix }), }; }; @@ -7168,21 +7496,31 @@ const serializeAws_restJson1AwsElbLoadBalancerAttributes = ( context: __SerdeContext ): any => { return { - ...(input.AccessLog !== undefined && { - AccessLog: serializeAws_restJson1AwsElbLoadBalancerAccessLog(input.AccessLog, context), - }), - ...(input.ConnectionDraining !== undefined && { - ConnectionDraining: serializeAws_restJson1AwsElbLoadBalancerConnectionDraining(input.ConnectionDraining, context), - }), - ...(input.ConnectionSettings !== undefined && { - ConnectionSettings: serializeAws_restJson1AwsElbLoadBalancerConnectionSettings(input.ConnectionSettings, context), - }), - ...(input.CrossZoneLoadBalancing !== undefined && { - CrossZoneLoadBalancing: serializeAws_restJson1AwsElbLoadBalancerCrossZoneLoadBalancing( - input.CrossZoneLoadBalancing, - context - ), - }), + ...(input.AccessLog !== undefined && + input.AccessLog !== null && { + AccessLog: serializeAws_restJson1AwsElbLoadBalancerAccessLog(input.AccessLog, context), + }), + ...(input.ConnectionDraining !== undefined && + input.ConnectionDraining !== null && { + ConnectionDraining: serializeAws_restJson1AwsElbLoadBalancerConnectionDraining( + input.ConnectionDraining, + context + ), + }), + ...(input.ConnectionSettings !== undefined && + input.ConnectionSettings !== null && { + ConnectionSettings: serializeAws_restJson1AwsElbLoadBalancerConnectionSettings( + input.ConnectionSettings, + context + ), + }), + ...(input.CrossZoneLoadBalancing !== undefined && + input.CrossZoneLoadBalancing !== null && { + CrossZoneLoadBalancing: serializeAws_restJson1AwsElbLoadBalancerCrossZoneLoadBalancing( + input.CrossZoneLoadBalancing, + context + ), + }), }; }; @@ -7191,10 +7529,9 @@ const serializeAws_restJson1AwsElbLoadBalancerBackendServerDescription = ( context: __SerdeContext ): any => { return { - ...(input.InstancePort !== undefined && { InstancePort: input.InstancePort }), - ...(input.PolicyNames !== undefined && { - PolicyNames: serializeAws_restJson1StringList(input.PolicyNames, context), - }), + ...(input.InstancePort !== undefined && input.InstancePort !== null && { InstancePort: input.InstancePort }), + ...(input.PolicyNames !== undefined && + input.PolicyNames !== null && { PolicyNames: serializeAws_restJson1StringList(input.PolicyNames, context) }), }; }; @@ -7202,7 +7539,14 @@ const serializeAws_restJson1AwsElbLoadBalancerBackendServerDescriptions = ( input: AwsElbLoadBalancerBackendServerDescription[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsElbLoadBalancerBackendServerDescription(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsElbLoadBalancerBackendServerDescription(entry, context); + }); }; const serializeAws_restJson1AwsElbLoadBalancerConnectionDraining = ( @@ -7210,8 +7554,8 @@ const serializeAws_restJson1AwsElbLoadBalancerConnectionDraining = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), }; }; @@ -7220,7 +7564,7 @@ const serializeAws_restJson1AwsElbLoadBalancerConnectionSettings = ( context: __SerdeContext ): any => { return { - ...(input.IdleTimeout !== undefined && { IdleTimeout: input.IdleTimeout }), + ...(input.IdleTimeout !== undefined && input.IdleTimeout !== null && { IdleTimeout: input.IdleTimeout }), }; }; @@ -7229,7 +7573,7 @@ const serializeAws_restJson1AwsElbLoadBalancerCrossZoneLoadBalancing = ( context: __SerdeContext ): any => { return { - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), }; }; @@ -7238,52 +7582,66 @@ const serializeAws_restJson1AwsElbLoadBalancerDetails = ( context: __SerdeContext ): any => { return { - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_restJson1StringList(input.AvailabilityZones, context), - }), - ...(input.BackendServerDescriptions !== undefined && { - BackendServerDescriptions: serializeAws_restJson1AwsElbLoadBalancerBackendServerDescriptions( - input.BackendServerDescriptions, - context - ), - }), - ...(input.CanonicalHostedZoneName !== undefined && { CanonicalHostedZoneName: input.CanonicalHostedZoneName }), - ...(input.CanonicalHostedZoneNameID !== undefined && { - CanonicalHostedZoneNameID: input.CanonicalHostedZoneNameID, - }), - ...(input.CreatedTime !== undefined && { CreatedTime: input.CreatedTime }), - ...(input.DnsName !== undefined && { DnsName: input.DnsName }), - ...(input.HealthCheck !== undefined && { - HealthCheck: serializeAws_restJson1AwsElbLoadBalancerHealthCheck(input.HealthCheck, context), - }), - ...(input.Instances !== undefined && { - Instances: serializeAws_restJson1AwsElbLoadBalancerInstances(input.Instances, context), - }), - ...(input.ListenerDescriptions !== undefined && { - ListenerDescriptions: serializeAws_restJson1AwsElbLoadBalancerListenerDescriptions( - input.ListenerDescriptions, - context - ), - }), - ...(input.LoadBalancerAttributes !== undefined && { - LoadBalancerAttributes: serializeAws_restJson1AwsElbLoadBalancerAttributes(input.LoadBalancerAttributes, context), - }), - ...(input.LoadBalancerName !== undefined && { LoadBalancerName: input.LoadBalancerName }), - ...(input.Policies !== undefined && { - Policies: serializeAws_restJson1AwsElbLoadBalancerPolicies(input.Policies, context), - }), - ...(input.Scheme !== undefined && { Scheme: input.Scheme }), - ...(input.SecurityGroups !== undefined && { - SecurityGroups: serializeAws_restJson1StringList(input.SecurityGroups, context), - }), - ...(input.SourceSecurityGroup !== undefined && { - SourceSecurityGroup: serializeAws_restJson1AwsElbLoadBalancerSourceSecurityGroup( - input.SourceSecurityGroup, - context - ), - }), - ...(input.Subnets !== undefined && { Subnets: serializeAws_restJson1StringList(input.Subnets, context) }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_restJson1StringList(input.AvailabilityZones, context), + }), + ...(input.BackendServerDescriptions !== undefined && + input.BackendServerDescriptions !== null && { + BackendServerDescriptions: serializeAws_restJson1AwsElbLoadBalancerBackendServerDescriptions( + input.BackendServerDescriptions, + context + ), + }), + ...(input.CanonicalHostedZoneName !== undefined && + input.CanonicalHostedZoneName !== null && { CanonicalHostedZoneName: input.CanonicalHostedZoneName }), + ...(input.CanonicalHostedZoneNameID !== undefined && + input.CanonicalHostedZoneNameID !== null && { CanonicalHostedZoneNameID: input.CanonicalHostedZoneNameID }), + ...(input.CreatedTime !== undefined && input.CreatedTime !== null && { CreatedTime: input.CreatedTime }), + ...(input.DnsName !== undefined && input.DnsName !== null && { DnsName: input.DnsName }), + ...(input.HealthCheck !== undefined && + input.HealthCheck !== null && { + HealthCheck: serializeAws_restJson1AwsElbLoadBalancerHealthCheck(input.HealthCheck, context), + }), + ...(input.Instances !== undefined && + input.Instances !== null && { + Instances: serializeAws_restJson1AwsElbLoadBalancerInstances(input.Instances, context), + }), + ...(input.ListenerDescriptions !== undefined && + input.ListenerDescriptions !== null && { + ListenerDescriptions: serializeAws_restJson1AwsElbLoadBalancerListenerDescriptions( + input.ListenerDescriptions, + context + ), + }), + ...(input.LoadBalancerAttributes !== undefined && + input.LoadBalancerAttributes !== null && { + LoadBalancerAttributes: serializeAws_restJson1AwsElbLoadBalancerAttributes( + input.LoadBalancerAttributes, + context + ), + }), + ...(input.LoadBalancerName !== undefined && + input.LoadBalancerName !== null && { LoadBalancerName: input.LoadBalancerName }), + ...(input.Policies !== undefined && + input.Policies !== null && { + Policies: serializeAws_restJson1AwsElbLoadBalancerPolicies(input.Policies, context), + }), + ...(input.Scheme !== undefined && input.Scheme !== null && { Scheme: input.Scheme }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + SecurityGroups: serializeAws_restJson1StringList(input.SecurityGroups, context), + }), + ...(input.SourceSecurityGroup !== undefined && + input.SourceSecurityGroup !== null && { + SourceSecurityGroup: serializeAws_restJson1AwsElbLoadBalancerSourceSecurityGroup( + input.SourceSecurityGroup, + context + ), + }), + ...(input.Subnets !== undefined && + input.Subnets !== null && { Subnets: serializeAws_restJson1StringList(input.Subnets, context) }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -7292,11 +7650,13 @@ const serializeAws_restJson1AwsElbLoadBalancerHealthCheck = ( context: __SerdeContext ): any => { return { - ...(input.HealthyThreshold !== undefined && { HealthyThreshold: input.HealthyThreshold }), - ...(input.Interval !== undefined && { Interval: input.Interval }), - ...(input.Target !== undefined && { Target: input.Target }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.UnhealthyThreshold !== undefined && { UnhealthyThreshold: input.UnhealthyThreshold }), + ...(input.HealthyThreshold !== undefined && + input.HealthyThreshold !== null && { HealthyThreshold: input.HealthyThreshold }), + ...(input.Interval !== undefined && input.Interval !== null && { Interval: input.Interval }), + ...(input.Target !== undefined && input.Target !== null && { Target: input.Target }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.UnhealthyThreshold !== undefined && + input.UnhealthyThreshold !== null && { UnhealthyThreshold: input.UnhealthyThreshold }), }; }; @@ -7305,7 +7665,7 @@ const serializeAws_restJson1AwsElbLoadBalancerInstance = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; @@ -7313,7 +7673,14 @@ const serializeAws_restJson1AwsElbLoadBalancerInstances = ( input: AwsElbLoadBalancerInstance[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsElbLoadBalancerInstance(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsElbLoadBalancerInstance(entry, context); + }); }; const serializeAws_restJson1AwsElbLoadBalancerListener = ( @@ -7321,11 +7688,14 @@ const serializeAws_restJson1AwsElbLoadBalancerListener = ( context: __SerdeContext ): any => { return { - ...(input.InstancePort !== undefined && { InstancePort: input.InstancePort }), - ...(input.InstanceProtocol !== undefined && { InstanceProtocol: input.InstanceProtocol }), - ...(input.LoadBalancerPort !== undefined && { LoadBalancerPort: input.LoadBalancerPort }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), - ...(input.SslCertificateId !== undefined && { SslCertificateId: input.SslCertificateId }), + ...(input.InstancePort !== undefined && input.InstancePort !== null && { InstancePort: input.InstancePort }), + ...(input.InstanceProtocol !== undefined && + input.InstanceProtocol !== null && { InstanceProtocol: input.InstanceProtocol }), + ...(input.LoadBalancerPort !== undefined && + input.LoadBalancerPort !== null && { LoadBalancerPort: input.LoadBalancerPort }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), + ...(input.SslCertificateId !== undefined && + input.SslCertificateId !== null && { SslCertificateId: input.SslCertificateId }), }; }; @@ -7334,12 +7704,12 @@ const serializeAws_restJson1AwsElbLoadBalancerListenerDescription = ( context: __SerdeContext ): any => { return { - ...(input.Listener !== undefined && { - Listener: serializeAws_restJson1AwsElbLoadBalancerListener(input.Listener, context), - }), - ...(input.PolicyNames !== undefined && { - PolicyNames: serializeAws_restJson1StringList(input.PolicyNames, context), - }), + ...(input.Listener !== undefined && + input.Listener !== null && { + Listener: serializeAws_restJson1AwsElbLoadBalancerListener(input.Listener, context), + }), + ...(input.PolicyNames !== undefined && + input.PolicyNames !== null && { PolicyNames: serializeAws_restJson1StringList(input.PolicyNames, context) }), }; }; @@ -7347,7 +7717,14 @@ const serializeAws_restJson1AwsElbLoadBalancerListenerDescriptions = ( input: AwsElbLoadBalancerListenerDescription[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsElbLoadBalancerListenerDescription(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsElbLoadBalancerListenerDescription(entry, context); + }); }; const serializeAws_restJson1AwsElbLoadBalancerPolicies = ( @@ -7355,21 +7732,24 @@ const serializeAws_restJson1AwsElbLoadBalancerPolicies = ( context: __SerdeContext ): any => { return { - ...(input.AppCookieStickinessPolicies !== undefined && { - AppCookieStickinessPolicies: serializeAws_restJson1AwsElbAppCookieStickinessPolicies( - input.AppCookieStickinessPolicies, - context - ), - }), - ...(input.LbCookieStickinessPolicies !== undefined && { - LbCookieStickinessPolicies: serializeAws_restJson1AwsElbLbCookieStickinessPolicies( - input.LbCookieStickinessPolicies, - context - ), - }), - ...(input.OtherPolicies !== undefined && { - OtherPolicies: serializeAws_restJson1StringList(input.OtherPolicies, context), - }), + ...(input.AppCookieStickinessPolicies !== undefined && + input.AppCookieStickinessPolicies !== null && { + AppCookieStickinessPolicies: serializeAws_restJson1AwsElbAppCookieStickinessPolicies( + input.AppCookieStickinessPolicies, + context + ), + }), + ...(input.LbCookieStickinessPolicies !== undefined && + input.LbCookieStickinessPolicies !== null && { + LbCookieStickinessPolicies: serializeAws_restJson1AwsElbLbCookieStickinessPolicies( + input.LbCookieStickinessPolicies, + context + ), + }), + ...(input.OtherPolicies !== undefined && + input.OtherPolicies !== null && { + OtherPolicies: serializeAws_restJson1StringList(input.OtherPolicies, context), + }), }; }; @@ -7378,8 +7758,8 @@ const serializeAws_restJson1AwsElbLoadBalancerSourceSecurityGroup = ( context: __SerdeContext ): any => { return { - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.OwnerAlias !== undefined && { OwnerAlias: input.OwnerAlias }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.OwnerAlias !== undefined && input.OwnerAlias !== null && { OwnerAlias: input.OwnerAlias }), }; }; @@ -7388,36 +7768,41 @@ const serializeAws_restJson1AwsElbv2LoadBalancerDetails = ( context: __SerdeContext ): any => { return { - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_restJson1AvailabilityZones(input.AvailabilityZones, context), - }), - ...(input.CanonicalHostedZoneId !== undefined && { CanonicalHostedZoneId: input.CanonicalHostedZoneId }), - ...(input.CreatedTime !== undefined && { CreatedTime: input.CreatedTime }), - ...(input.DNSName !== undefined && { DNSName: input.DNSName }), - ...(input.IpAddressType !== undefined && { IpAddressType: input.IpAddressType }), - ...(input.Scheme !== undefined && { Scheme: input.Scheme }), - ...(input.SecurityGroups !== undefined && { - SecurityGroups: serializeAws_restJson1SecurityGroups(input.SecurityGroups, context), - }), - ...(input.State !== undefined && { State: serializeAws_restJson1LoadBalancerState(input.State, context) }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_restJson1AvailabilityZones(input.AvailabilityZones, context), + }), + ...(input.CanonicalHostedZoneId !== undefined && + input.CanonicalHostedZoneId !== null && { CanonicalHostedZoneId: input.CanonicalHostedZoneId }), + ...(input.CreatedTime !== undefined && input.CreatedTime !== null && { CreatedTime: input.CreatedTime }), + ...(input.DNSName !== undefined && input.DNSName !== null && { DNSName: input.DNSName }), + ...(input.IpAddressType !== undefined && input.IpAddressType !== null && { IpAddressType: input.IpAddressType }), + ...(input.Scheme !== undefined && input.Scheme !== null && { Scheme: input.Scheme }), + ...(input.SecurityGroups !== undefined && + input.SecurityGroups !== null && { + SecurityGroups: serializeAws_restJson1SecurityGroups(input.SecurityGroups, context), + }), + ...(input.State !== undefined && + input.State !== null && { State: serializeAws_restJson1LoadBalancerState(input.State, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; const serializeAws_restJson1AwsIamAccessKeyDetails = (input: AwsIamAccessKeyDetails, context: __SerdeContext): any => { return { - ...(input.AccessKeyId !== undefined && { AccessKeyId: input.AccessKeyId }), - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.CreatedAt !== undefined && { CreatedAt: input.CreatedAt }), - ...(input.PrincipalId !== undefined && { PrincipalId: input.PrincipalId }), - ...(input.PrincipalName !== undefined && { PrincipalName: input.PrincipalName }), - ...(input.PrincipalType !== undefined && { PrincipalType: input.PrincipalType }), - ...(input.SessionContext !== undefined && { - SessionContext: serializeAws_restJson1AwsIamAccessKeySessionContext(input.SessionContext, context), - }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.AccessKeyId !== undefined && input.AccessKeyId !== null && { AccessKeyId: input.AccessKeyId }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.CreatedAt !== undefined && input.CreatedAt !== null && { CreatedAt: input.CreatedAt }), + ...(input.PrincipalId !== undefined && input.PrincipalId !== null && { PrincipalId: input.PrincipalId }), + ...(input.PrincipalName !== undefined && input.PrincipalName !== null && { PrincipalName: input.PrincipalName }), + ...(input.PrincipalType !== undefined && input.PrincipalType !== null && { PrincipalType: input.PrincipalType }), + ...(input.SessionContext !== undefined && + input.SessionContext !== null && { + SessionContext: serializeAws_restJson1AwsIamAccessKeySessionContext(input.SessionContext, context), + }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -7426,12 +7811,14 @@ const serializeAws_restJson1AwsIamAccessKeySessionContext = ( context: __SerdeContext ): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1AwsIamAccessKeySessionContextAttributes(input.Attributes, context), - }), - ...(input.SessionIssuer !== undefined && { - SessionIssuer: serializeAws_restJson1AwsIamAccessKeySessionContextSessionIssuer(input.SessionIssuer, context), - }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { + Attributes: serializeAws_restJson1AwsIamAccessKeySessionContextAttributes(input.Attributes, context), + }), + ...(input.SessionIssuer !== undefined && + input.SessionIssuer !== null && { + SessionIssuer: serializeAws_restJson1AwsIamAccessKeySessionContextSessionIssuer(input.SessionIssuer, context), + }), }; }; @@ -7440,8 +7827,9 @@ const serializeAws_restJson1AwsIamAccessKeySessionContextAttributes = ( context: __SerdeContext ): any => { return { - ...(input.CreationDate !== undefined && { CreationDate: input.CreationDate }), - ...(input.MfaAuthenticated !== undefined && { MfaAuthenticated: input.MfaAuthenticated }), + ...(input.CreationDate !== undefined && input.CreationDate !== null && { CreationDate: input.CreationDate }), + ...(input.MfaAuthenticated !== undefined && + input.MfaAuthenticated !== null && { MfaAuthenticated: input.MfaAuthenticated }), }; }; @@ -7450,11 +7838,11 @@ const serializeAws_restJson1AwsIamAccessKeySessionContextSessionIssuer = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.PrincipalId !== undefined && { PrincipalId: input.PrincipalId }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.PrincipalId !== undefined && input.PrincipalId !== null && { PrincipalId: input.PrincipalId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -7463,8 +7851,8 @@ const serializeAws_restJson1AwsIamAttachedManagedPolicy = ( context: __SerdeContext ): any => { return { - ...(input.PolicyArn !== undefined && { PolicyArn: input.PolicyArn }), - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.PolicyArn !== undefined && input.PolicyArn !== null && { PolicyArn: input.PolicyArn }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), }; }; @@ -7472,45 +7860,64 @@ const serializeAws_restJson1AwsIamAttachedManagedPolicyList = ( input: AwsIamAttachedManagedPolicy[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsIamAttachedManagedPolicy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsIamAttachedManagedPolicy(entry, context); + }); }; const serializeAws_restJson1AwsIamGroupDetails = (input: AwsIamGroupDetails, context: __SerdeContext): any => { return { - ...(input.AttachedManagedPolicies !== undefined && { - AttachedManagedPolicies: serializeAws_restJson1AwsIamAttachedManagedPolicyList( - input.AttachedManagedPolicies, - context - ), - }), - ...(input.CreateDate !== undefined && { CreateDate: input.CreateDate }), - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.GroupPolicyList !== undefined && { - GroupPolicyList: serializeAws_restJson1AwsIamGroupPolicyList(input.GroupPolicyList, context), - }), - ...(input.Path !== undefined && { Path: input.Path }), + ...(input.AttachedManagedPolicies !== undefined && + input.AttachedManagedPolicies !== null && { + AttachedManagedPolicies: serializeAws_restJson1AwsIamAttachedManagedPolicyList( + input.AttachedManagedPolicies, + context + ), + }), + ...(input.CreateDate !== undefined && input.CreateDate !== null && { CreateDate: input.CreateDate }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.GroupPolicyList !== undefined && + input.GroupPolicyList !== null && { + GroupPolicyList: serializeAws_restJson1AwsIamGroupPolicyList(input.GroupPolicyList, context), + }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), }; }; const serializeAws_restJson1AwsIamGroupPolicy = (input: AwsIamGroupPolicy, context: __SerdeContext): any => { return { - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), }; }; const serializeAws_restJson1AwsIamGroupPolicyList = (input: AwsIamGroupPolicy[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AwsIamGroupPolicy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsIamGroupPolicy(entry, context); + }); }; const serializeAws_restJson1AwsIamInstanceProfile = (input: AwsIamInstanceProfile, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.CreateDate !== undefined && { CreateDate: input.CreateDate }), - ...(input.InstanceProfileId !== undefined && { InstanceProfileId: input.InstanceProfileId }), - ...(input.InstanceProfileName !== undefined && { InstanceProfileName: input.InstanceProfileName }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.Roles !== undefined && { Roles: serializeAws_restJson1AwsIamInstanceProfileRoles(input.Roles, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.CreateDate !== undefined && input.CreateDate !== null && { CreateDate: input.CreateDate }), + ...(input.InstanceProfileId !== undefined && + input.InstanceProfileId !== null && { InstanceProfileId: input.InstanceProfileId }), + ...(input.InstanceProfileName !== undefined && + input.InstanceProfileName !== null && { InstanceProfileName: input.InstanceProfileName }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.Roles !== undefined && + input.Roles !== null && { Roles: serializeAws_restJson1AwsIamInstanceProfileRoles(input.Roles, context) }), }; }; @@ -7518,7 +7925,14 @@ const serializeAws_restJson1AwsIamInstanceProfileList = ( input: AwsIamInstanceProfile[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsIamInstanceProfile(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsIamInstanceProfile(entry, context); + }); }; const serializeAws_restJson1AwsIamInstanceProfileRole = ( @@ -7526,12 +7940,13 @@ const serializeAws_restJson1AwsIamInstanceProfileRole = ( context: __SerdeContext ): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.AssumeRolePolicyDocument !== undefined && { AssumeRolePolicyDocument: input.AssumeRolePolicyDocument }), - ...(input.CreateDate !== undefined && { CreateDate: input.CreateDate }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.RoleId !== undefined && { RoleId: input.RoleId }), - ...(input.RoleName !== undefined && { RoleName: input.RoleName }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.AssumeRolePolicyDocument !== undefined && + input.AssumeRolePolicyDocument !== null && { AssumeRolePolicyDocument: input.AssumeRolePolicyDocument }), + ...(input.CreateDate !== undefined && input.CreateDate !== null && { CreateDate: input.CreateDate }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.RoleId !== undefined && input.RoleId !== null && { RoleId: input.RoleId }), + ...(input.RoleName !== undefined && input.RoleName !== null && { RoleName: input.RoleName }), }; }; @@ -7539,7 +7954,14 @@ const serializeAws_restJson1AwsIamInstanceProfileRoles = ( input: AwsIamInstanceProfileRole[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsIamInstanceProfileRole(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsIamInstanceProfileRole(entry, context); + }); }; const serializeAws_restJson1AwsIamPermissionsBoundary = ( @@ -7547,129 +7969,168 @@ const serializeAws_restJson1AwsIamPermissionsBoundary = ( context: __SerdeContext ): any => { return { - ...(input.PermissionsBoundaryArn !== undefined && { PermissionsBoundaryArn: input.PermissionsBoundaryArn }), - ...(input.PermissionsBoundaryType !== undefined && { PermissionsBoundaryType: input.PermissionsBoundaryType }), + ...(input.PermissionsBoundaryArn !== undefined && + input.PermissionsBoundaryArn !== null && { PermissionsBoundaryArn: input.PermissionsBoundaryArn }), + ...(input.PermissionsBoundaryType !== undefined && + input.PermissionsBoundaryType !== null && { PermissionsBoundaryType: input.PermissionsBoundaryType }), }; }; const serializeAws_restJson1AwsIamPolicyDetails = (input: AwsIamPolicyDetails, context: __SerdeContext): any => { return { - ...(input.AttachmentCount !== undefined && { AttachmentCount: input.AttachmentCount }), - ...(input.CreateDate !== undefined && { CreateDate: input.CreateDate }), - ...(input.DefaultVersionId !== undefined && { DefaultVersionId: input.DefaultVersionId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.IsAttachable !== undefined && { IsAttachable: input.IsAttachable }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.PermissionsBoundaryUsageCount !== undefined && { - PermissionsBoundaryUsageCount: input.PermissionsBoundaryUsageCount, - }), - ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), - ...(input.PolicyVersionList !== undefined && { - PolicyVersionList: serializeAws_restJson1AwsIamPolicyVersionList(input.PolicyVersionList, context), - }), - ...(input.UpdateDate !== undefined && { UpdateDate: input.UpdateDate }), + ...(input.AttachmentCount !== undefined && + input.AttachmentCount !== null && { AttachmentCount: input.AttachmentCount }), + ...(input.CreateDate !== undefined && input.CreateDate !== null && { CreateDate: input.CreateDate }), + ...(input.DefaultVersionId !== undefined && + input.DefaultVersionId !== null && { DefaultVersionId: input.DefaultVersionId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.IsAttachable !== undefined && input.IsAttachable !== null && { IsAttachable: input.IsAttachable }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.PermissionsBoundaryUsageCount !== undefined && + input.PermissionsBoundaryUsageCount !== null && { + PermissionsBoundaryUsageCount: input.PermissionsBoundaryUsageCount, + }), + ...(input.PolicyId !== undefined && input.PolicyId !== null && { PolicyId: input.PolicyId }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), + ...(input.PolicyVersionList !== undefined && + input.PolicyVersionList !== null && { + PolicyVersionList: serializeAws_restJson1AwsIamPolicyVersionList(input.PolicyVersionList, context), + }), + ...(input.UpdateDate !== undefined && input.UpdateDate !== null && { UpdateDate: input.UpdateDate }), }; }; const serializeAws_restJson1AwsIamPolicyVersion = (input: AwsIamPolicyVersion, context: __SerdeContext): any => { return { - ...(input.CreateDate !== undefined && { CreateDate: input.CreateDate }), - ...(input.IsDefaultVersion !== undefined && { IsDefaultVersion: input.IsDefaultVersion }), - ...(input.VersionId !== undefined && { VersionId: input.VersionId }), + ...(input.CreateDate !== undefined && input.CreateDate !== null && { CreateDate: input.CreateDate }), + ...(input.IsDefaultVersion !== undefined && + input.IsDefaultVersion !== null && { IsDefaultVersion: input.IsDefaultVersion }), + ...(input.VersionId !== undefined && input.VersionId !== null && { VersionId: input.VersionId }), }; }; const serializeAws_restJson1AwsIamPolicyVersionList = (input: AwsIamPolicyVersion[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AwsIamPolicyVersion(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsIamPolicyVersion(entry, context); + }); }; const serializeAws_restJson1AwsIamRoleDetails = (input: AwsIamRoleDetails, context: __SerdeContext): any => { return { - ...(input.AssumeRolePolicyDocument !== undefined && { AssumeRolePolicyDocument: input.AssumeRolePolicyDocument }), - ...(input.AttachedManagedPolicies !== undefined && { - AttachedManagedPolicies: serializeAws_restJson1AwsIamAttachedManagedPolicyList( - input.AttachedManagedPolicies, - context - ), - }), - ...(input.CreateDate !== undefined && { CreateDate: input.CreateDate }), - ...(input.InstanceProfileList !== undefined && { - InstanceProfileList: serializeAws_restJson1AwsIamInstanceProfileList(input.InstanceProfileList, context), - }), - ...(input.MaxSessionDuration !== undefined && { MaxSessionDuration: input.MaxSessionDuration }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.PermissionsBoundary !== undefined && { - PermissionsBoundary: serializeAws_restJson1AwsIamPermissionsBoundary(input.PermissionsBoundary, context), - }), - ...(input.RoleId !== undefined && { RoleId: input.RoleId }), - ...(input.RoleName !== undefined && { RoleName: input.RoleName }), - ...(input.RolePolicyList !== undefined && { - RolePolicyList: serializeAws_restJson1AwsIamRolePolicyList(input.RolePolicyList, context), - }), + ...(input.AssumeRolePolicyDocument !== undefined && + input.AssumeRolePolicyDocument !== null && { AssumeRolePolicyDocument: input.AssumeRolePolicyDocument }), + ...(input.AttachedManagedPolicies !== undefined && + input.AttachedManagedPolicies !== null && { + AttachedManagedPolicies: serializeAws_restJson1AwsIamAttachedManagedPolicyList( + input.AttachedManagedPolicies, + context + ), + }), + ...(input.CreateDate !== undefined && input.CreateDate !== null && { CreateDate: input.CreateDate }), + ...(input.InstanceProfileList !== undefined && + input.InstanceProfileList !== null && { + InstanceProfileList: serializeAws_restJson1AwsIamInstanceProfileList(input.InstanceProfileList, context), + }), + ...(input.MaxSessionDuration !== undefined && + input.MaxSessionDuration !== null && { MaxSessionDuration: input.MaxSessionDuration }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.PermissionsBoundary !== undefined && + input.PermissionsBoundary !== null && { + PermissionsBoundary: serializeAws_restJson1AwsIamPermissionsBoundary(input.PermissionsBoundary, context), + }), + ...(input.RoleId !== undefined && input.RoleId !== null && { RoleId: input.RoleId }), + ...(input.RoleName !== undefined && input.RoleName !== null && { RoleName: input.RoleName }), + ...(input.RolePolicyList !== undefined && + input.RolePolicyList !== null && { + RolePolicyList: serializeAws_restJson1AwsIamRolePolicyList(input.RolePolicyList, context), + }), }; }; const serializeAws_restJson1AwsIamRolePolicy = (input: AwsIamRolePolicy, context: __SerdeContext): any => { return { - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), }; }; const serializeAws_restJson1AwsIamRolePolicyList = (input: AwsIamRolePolicy[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AwsIamRolePolicy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsIamRolePolicy(entry, context); + }); }; const serializeAws_restJson1AwsIamUserDetails = (input: AwsIamUserDetails, context: __SerdeContext): any => { return { - ...(input.AttachedManagedPolicies !== undefined && { - AttachedManagedPolicies: serializeAws_restJson1AwsIamAttachedManagedPolicyList( - input.AttachedManagedPolicies, - context - ), - }), - ...(input.CreateDate !== undefined && { CreateDate: input.CreateDate }), - ...(input.GroupList !== undefined && { GroupList: serializeAws_restJson1StringList(input.GroupList, context) }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.PermissionsBoundary !== undefined && { - PermissionsBoundary: serializeAws_restJson1AwsIamPermissionsBoundary(input.PermissionsBoundary, context), - }), - ...(input.UserId !== undefined && { UserId: input.UserId }), - ...(input.UserName !== undefined && { UserName: input.UserName }), - ...(input.UserPolicyList !== undefined && { - UserPolicyList: serializeAws_restJson1AwsIamUserPolicyList(input.UserPolicyList, context), - }), + ...(input.AttachedManagedPolicies !== undefined && + input.AttachedManagedPolicies !== null && { + AttachedManagedPolicies: serializeAws_restJson1AwsIamAttachedManagedPolicyList( + input.AttachedManagedPolicies, + context + ), + }), + ...(input.CreateDate !== undefined && input.CreateDate !== null && { CreateDate: input.CreateDate }), + ...(input.GroupList !== undefined && + input.GroupList !== null && { GroupList: serializeAws_restJson1StringList(input.GroupList, context) }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.PermissionsBoundary !== undefined && + input.PermissionsBoundary !== null && { + PermissionsBoundary: serializeAws_restJson1AwsIamPermissionsBoundary(input.PermissionsBoundary, context), + }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), + ...(input.UserPolicyList !== undefined && + input.UserPolicyList !== null && { + UserPolicyList: serializeAws_restJson1AwsIamUserPolicyList(input.UserPolicyList, context), + }), }; }; const serializeAws_restJson1AwsIamUserPolicy = (input: AwsIamUserPolicy, context: __SerdeContext): any => { return { - ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }), }; }; const serializeAws_restJson1AwsIamUserPolicyList = (input: AwsIamUserPolicy[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AwsIamUserPolicy(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsIamUserPolicy(entry, context); + }); }; const serializeAws_restJson1AwsKmsKeyDetails = (input: AwsKmsKeyDetails, context: __SerdeContext): any => { return { - ...(input.AWSAccountId !== undefined && { AWSAccountId: input.AWSAccountId }), - ...(input.CreationDate !== undefined && { CreationDate: input.CreationDate }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.KeyManager !== undefined && { KeyManager: input.KeyManager }), - ...(input.KeyState !== undefined && { KeyState: input.KeyState }), - ...(input.Origin !== undefined && { Origin: input.Origin }), + ...(input.AWSAccountId !== undefined && input.AWSAccountId !== null && { AWSAccountId: input.AWSAccountId }), + ...(input.CreationDate !== undefined && input.CreationDate !== null && { CreationDate: input.CreationDate }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.KeyManager !== undefined && input.KeyManager !== null && { KeyManager: input.KeyManager }), + ...(input.KeyState !== undefined && input.KeyState !== null && { KeyState: input.KeyState }), + ...(input.Origin !== undefined && input.Origin !== null && { Origin: input.Origin }), }; }; const serializeAws_restJson1AwsLambdaFunctionCode = (input: AwsLambdaFunctionCode, context: __SerdeContext): any => { return { - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3Key !== undefined && { S3Key: input.S3Key }), - ...(input.S3ObjectVersion !== undefined && { S3ObjectVersion: input.S3ObjectVersion }), - ...(input.ZipFile !== undefined && { ZipFile: input.ZipFile }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3Key !== undefined && input.S3Key !== null && { S3Key: input.S3Key }), + ...(input.S3ObjectVersion !== undefined && + input.S3ObjectVersion !== null && { S3ObjectVersion: input.S3ObjectVersion }), + ...(input.ZipFile !== undefined && input.ZipFile !== null && { ZipFile: input.ZipFile }), }; }; @@ -7678,7 +8139,7 @@ const serializeAws_restJson1AwsLambdaFunctionDeadLetterConfig = ( context: __SerdeContext ): any => { return { - ...(input.TargetArn !== undefined && { TargetArn: input.TargetArn }), + ...(input.TargetArn !== undefined && input.TargetArn !== null && { TargetArn: input.TargetArn }), }; }; @@ -7687,34 +8148,38 @@ const serializeAws_restJson1AwsLambdaFunctionDetails = ( context: __SerdeContext ): any => { return { - ...(input.Code !== undefined && { Code: serializeAws_restJson1AwsLambdaFunctionCode(input.Code, context) }), - ...(input.CodeSha256 !== undefined && { CodeSha256: input.CodeSha256 }), - ...(input.DeadLetterConfig !== undefined && { - DeadLetterConfig: serializeAws_restJson1AwsLambdaFunctionDeadLetterConfig(input.DeadLetterConfig, context), - }), - ...(input.Environment !== undefined && { - Environment: serializeAws_restJson1AwsLambdaFunctionEnvironment(input.Environment, context), - }), - ...(input.FunctionName !== undefined && { FunctionName: input.FunctionName }), - ...(input.Handler !== undefined && { Handler: input.Handler }), - ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), - ...(input.LastModified !== undefined && { LastModified: input.LastModified }), - ...(input.Layers !== undefined && { - Layers: serializeAws_restJson1AwsLambdaFunctionLayerList(input.Layers, context), - }), - ...(input.MasterArn !== undefined && { MasterArn: input.MasterArn }), - ...(input.MemorySize !== undefined && { MemorySize: input.MemorySize }), - ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Runtime !== undefined && { Runtime: input.Runtime }), - ...(input.Timeout !== undefined && { Timeout: input.Timeout }), - ...(input.TracingConfig !== undefined && { - TracingConfig: serializeAws_restJson1AwsLambdaFunctionTracingConfig(input.TracingConfig, context), - }), - ...(input.Version !== undefined && { Version: input.Version }), - ...(input.VpcConfig !== undefined && { - VpcConfig: serializeAws_restJson1AwsLambdaFunctionVpcConfig(input.VpcConfig, context), - }), + ...(input.Code !== undefined && + input.Code !== null && { Code: serializeAws_restJson1AwsLambdaFunctionCode(input.Code, context) }), + ...(input.CodeSha256 !== undefined && input.CodeSha256 !== null && { CodeSha256: input.CodeSha256 }), + ...(input.DeadLetterConfig !== undefined && + input.DeadLetterConfig !== null && { + DeadLetterConfig: serializeAws_restJson1AwsLambdaFunctionDeadLetterConfig(input.DeadLetterConfig, context), + }), + ...(input.Environment !== undefined && + input.Environment !== null && { + Environment: serializeAws_restJson1AwsLambdaFunctionEnvironment(input.Environment, context), + }), + ...(input.FunctionName !== undefined && input.FunctionName !== null && { FunctionName: input.FunctionName }), + ...(input.Handler !== undefined && input.Handler !== null && { Handler: input.Handler }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }), + ...(input.LastModified !== undefined && input.LastModified !== null && { LastModified: input.LastModified }), + ...(input.Layers !== undefined && + input.Layers !== null && { Layers: serializeAws_restJson1AwsLambdaFunctionLayerList(input.Layers, context) }), + ...(input.MasterArn !== undefined && input.MasterArn !== null && { MasterArn: input.MasterArn }), + ...(input.MemorySize !== undefined && input.MemorySize !== null && { MemorySize: input.MemorySize }), + ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Runtime !== undefined && input.Runtime !== null && { Runtime: input.Runtime }), + ...(input.Timeout !== undefined && input.Timeout !== null && { Timeout: input.Timeout }), + ...(input.TracingConfig !== undefined && + input.TracingConfig !== null && { + TracingConfig: serializeAws_restJson1AwsLambdaFunctionTracingConfig(input.TracingConfig, context), + }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { + VpcConfig: serializeAws_restJson1AwsLambdaFunctionVpcConfig(input.VpcConfig, context), + }), }; }; @@ -7723,10 +8188,10 @@ const serializeAws_restJson1AwsLambdaFunctionEnvironment = ( context: __SerdeContext ): any => { return { - ...(input.Error !== undefined && { - Error: serializeAws_restJson1AwsLambdaFunctionEnvironmentError(input.Error, context), - }), - ...(input.Variables !== undefined && { Variables: serializeAws_restJson1FieldMap(input.Variables, context) }), + ...(input.Error !== undefined && + input.Error !== null && { Error: serializeAws_restJson1AwsLambdaFunctionEnvironmentError(input.Error, context) }), + ...(input.Variables !== undefined && + input.Variables !== null && { Variables: serializeAws_restJson1FieldMap(input.Variables, context) }), }; }; @@ -7735,15 +8200,15 @@ const serializeAws_restJson1AwsLambdaFunctionEnvironmentError = ( context: __SerdeContext ): any => { return { - ...(input.ErrorCode !== undefined && { ErrorCode: input.ErrorCode }), - ...(input.Message !== undefined && { Message: input.Message }), + ...(input.ErrorCode !== undefined && input.ErrorCode !== null && { ErrorCode: input.ErrorCode }), + ...(input.Message !== undefined && input.Message !== null && { Message: input.Message }), }; }; const serializeAws_restJson1AwsLambdaFunctionLayer = (input: AwsLambdaFunctionLayer, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.CodeSize !== undefined && { CodeSize: input.CodeSize }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.CodeSize !== undefined && input.CodeSize !== null && { CodeSize: input.CodeSize }), }; }; @@ -7751,7 +8216,14 @@ const serializeAws_restJson1AwsLambdaFunctionLayerList = ( input: AwsLambdaFunctionLayer[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsLambdaFunctionLayer(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsLambdaFunctionLayer(entry, context); + }); }; const serializeAws_restJson1AwsLambdaFunctionTracingConfig = ( @@ -7759,7 +8231,7 @@ const serializeAws_restJson1AwsLambdaFunctionTracingConfig = ( context: __SerdeContext ): any => { return { - ...(input.Mode !== undefined && { Mode: input.Mode }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), }; }; @@ -7768,13 +8240,13 @@ const serializeAws_restJson1AwsLambdaFunctionVpcConfig = ( context: __SerdeContext ): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_restJson1NonEmptyStringList(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { - SubnetIds: serializeAws_restJson1NonEmptyStringList(input.SubnetIds, context), - }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_restJson1NonEmptyStringList(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_restJson1NonEmptyStringList(input.SubnetIds, context) }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -7783,11 +8255,12 @@ const serializeAws_restJson1AwsLambdaLayerVersionDetails = ( context: __SerdeContext ): any => { return { - ...(input.CompatibleRuntimes !== undefined && { - CompatibleRuntimes: serializeAws_restJson1NonEmptyStringList(input.CompatibleRuntimes, context), - }), - ...(input.CreatedDate !== undefined && { CreatedDate: input.CreatedDate }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.CompatibleRuntimes !== undefined && + input.CompatibleRuntimes !== null && { + CompatibleRuntimes: serializeAws_restJson1NonEmptyStringList(input.CompatibleRuntimes, context), + }), + ...(input.CreatedDate !== undefined && input.CreatedDate !== null && { CreatedDate: input.CreatedDate }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -7796,8 +8269,8 @@ const serializeAws_restJson1AwsRdsDbClusterAssociatedRole = ( context: __SerdeContext ): any => { return { - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -7805,89 +8278,130 @@ const serializeAws_restJson1AwsRdsDbClusterAssociatedRoles = ( input: AwsRdsDbClusterAssociatedRole[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbClusterAssociatedRole(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbClusterAssociatedRole(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbClusterDetails = (input: AwsRdsDbClusterDetails, context: __SerdeContext): any => { return { - ...(input.ActivityStreamStatus !== undefined && { ActivityStreamStatus: input.ActivityStreamStatus }), - ...(input.AllocatedStorage !== undefined && { AllocatedStorage: input.AllocatedStorage }), - ...(input.AssociatedRoles !== undefined && { - AssociatedRoles: serializeAws_restJson1AwsRdsDbClusterAssociatedRoles(input.AssociatedRoles, context), - }), - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_restJson1StringList(input.AvailabilityZones, context), - }), - ...(input.BackupRetentionPeriod !== undefined && { BackupRetentionPeriod: input.BackupRetentionPeriod }), - ...(input.ClusterCreateTime !== undefined && { ClusterCreateTime: input.ClusterCreateTime }), - ...(input.CopyTagsToSnapshot !== undefined && { CopyTagsToSnapshot: input.CopyTagsToSnapshot }), - ...(input.CrossAccountClone !== undefined && { CrossAccountClone: input.CrossAccountClone }), - ...(input.CustomEndpoints !== undefined && { - CustomEndpoints: serializeAws_restJson1StringList(input.CustomEndpoints, context), - }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.DbClusterIdentifier !== undefined && { DbClusterIdentifier: input.DbClusterIdentifier }), - ...(input.DbClusterMembers !== undefined && { - DbClusterMembers: serializeAws_restJson1AwsRdsDbClusterMembers(input.DbClusterMembers, context), - }), - ...(input.DbClusterOptionGroupMemberships !== undefined && { - DbClusterOptionGroupMemberships: serializeAws_restJson1AwsRdsDbClusterOptionGroupMemberships( - input.DbClusterOptionGroupMemberships, - context - ), - }), - ...(input.DbClusterParameterGroup !== undefined && { DbClusterParameterGroup: input.DbClusterParameterGroup }), - ...(input.DbClusterResourceId !== undefined && { DbClusterResourceId: input.DbClusterResourceId }), - ...(input.DbSubnetGroup !== undefined && { DbSubnetGroup: input.DbSubnetGroup }), - ...(input.DeletionProtection !== undefined && { DeletionProtection: input.DeletionProtection }), - ...(input.DomainMemberships !== undefined && { - DomainMemberships: serializeAws_restJson1AwsRdsDbDomainMemberships(input.DomainMemberships, context), - }), - ...(input.EnabledCloudWatchLogsExports !== undefined && { - EnabledCloudWatchLogsExports: serializeAws_restJson1StringList(input.EnabledCloudWatchLogsExports, context), - }), - ...(input.Endpoint !== undefined && { Endpoint: input.Endpoint }), - ...(input.Engine !== undefined && { Engine: input.Engine }), - ...(input.EngineMode !== undefined && { EngineMode: input.EngineMode }), - ...(input.EngineVersion !== undefined && { EngineVersion: input.EngineVersion }), - ...(input.HostedZoneId !== undefined && { HostedZoneId: input.HostedZoneId }), - ...(input.HttpEndpointEnabled !== undefined && { HttpEndpointEnabled: input.HttpEndpointEnabled }), - ...(input.IamDatabaseAuthenticationEnabled !== undefined && { - IamDatabaseAuthenticationEnabled: input.IamDatabaseAuthenticationEnabled, - }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.MasterUsername !== undefined && { MasterUsername: input.MasterUsername }), - ...(input.MultiAz !== undefined && { MultiAz: input.MultiAz }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.PreferredBackupWindow !== undefined && { PreferredBackupWindow: input.PreferredBackupWindow }), - ...(input.PreferredMaintenanceWindow !== undefined && { - PreferredMaintenanceWindow: input.PreferredMaintenanceWindow, - }), - ...(input.ReadReplicaIdentifiers !== undefined && { - ReadReplicaIdentifiers: serializeAws_restJson1StringList(input.ReadReplicaIdentifiers, context), - }), - ...(input.ReaderEndpoint !== undefined && { ReaderEndpoint: input.ReaderEndpoint }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.StorageEncrypted !== undefined && { StorageEncrypted: input.StorageEncrypted }), - ...(input.VpcSecurityGroups !== undefined && { - VpcSecurityGroups: serializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroups(input.VpcSecurityGroups, context), - }), + ...(input.ActivityStreamStatus !== undefined && + input.ActivityStreamStatus !== null && { ActivityStreamStatus: input.ActivityStreamStatus }), + ...(input.AllocatedStorage !== undefined && + input.AllocatedStorage !== null && { AllocatedStorage: input.AllocatedStorage }), + ...(input.AssociatedRoles !== undefined && + input.AssociatedRoles !== null && { + AssociatedRoles: serializeAws_restJson1AwsRdsDbClusterAssociatedRoles(input.AssociatedRoles, context), + }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_restJson1StringList(input.AvailabilityZones, context), + }), + ...(input.BackupRetentionPeriod !== undefined && + input.BackupRetentionPeriod !== null && { BackupRetentionPeriod: input.BackupRetentionPeriod }), + ...(input.ClusterCreateTime !== undefined && + input.ClusterCreateTime !== null && { ClusterCreateTime: input.ClusterCreateTime }), + ...(input.CopyTagsToSnapshot !== undefined && + input.CopyTagsToSnapshot !== null && { CopyTagsToSnapshot: input.CopyTagsToSnapshot }), + ...(input.CrossAccountClone !== undefined && + input.CrossAccountClone !== null && { CrossAccountClone: input.CrossAccountClone }), + ...(input.CustomEndpoints !== undefined && + input.CustomEndpoints !== null && { + CustomEndpoints: serializeAws_restJson1StringList(input.CustomEndpoints, context), + }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.DbClusterIdentifier !== undefined && + input.DbClusterIdentifier !== null && { DbClusterIdentifier: input.DbClusterIdentifier }), + ...(input.DbClusterMembers !== undefined && + input.DbClusterMembers !== null && { + DbClusterMembers: serializeAws_restJson1AwsRdsDbClusterMembers(input.DbClusterMembers, context), + }), + ...(input.DbClusterOptionGroupMemberships !== undefined && + input.DbClusterOptionGroupMemberships !== null && { + DbClusterOptionGroupMemberships: serializeAws_restJson1AwsRdsDbClusterOptionGroupMemberships( + input.DbClusterOptionGroupMemberships, + context + ), + }), + ...(input.DbClusterParameterGroup !== undefined && + input.DbClusterParameterGroup !== null && { DbClusterParameterGroup: input.DbClusterParameterGroup }), + ...(input.DbClusterResourceId !== undefined && + input.DbClusterResourceId !== null && { DbClusterResourceId: input.DbClusterResourceId }), + ...(input.DbSubnetGroup !== undefined && input.DbSubnetGroup !== null && { DbSubnetGroup: input.DbSubnetGroup }), + ...(input.DeletionProtection !== undefined && + input.DeletionProtection !== null && { DeletionProtection: input.DeletionProtection }), + ...(input.DomainMemberships !== undefined && + input.DomainMemberships !== null && { + DomainMemberships: serializeAws_restJson1AwsRdsDbDomainMemberships(input.DomainMemberships, context), + }), + ...(input.EnabledCloudWatchLogsExports !== undefined && + input.EnabledCloudWatchLogsExports !== null && { + EnabledCloudWatchLogsExports: serializeAws_restJson1StringList(input.EnabledCloudWatchLogsExports, context), + }), + ...(input.Endpoint !== undefined && input.Endpoint !== null && { Endpoint: input.Endpoint }), + ...(input.Engine !== undefined && input.Engine !== null && { Engine: input.Engine }), + ...(input.EngineMode !== undefined && input.EngineMode !== null && { EngineMode: input.EngineMode }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { EngineVersion: input.EngineVersion }), + ...(input.HostedZoneId !== undefined && input.HostedZoneId !== null && { HostedZoneId: input.HostedZoneId }), + ...(input.HttpEndpointEnabled !== undefined && + input.HttpEndpointEnabled !== null && { HttpEndpointEnabled: input.HttpEndpointEnabled }), + ...(input.IamDatabaseAuthenticationEnabled !== undefined && + input.IamDatabaseAuthenticationEnabled !== null && { + IamDatabaseAuthenticationEnabled: input.IamDatabaseAuthenticationEnabled, + }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.MasterUsername !== undefined && + input.MasterUsername !== null && { MasterUsername: input.MasterUsername }), + ...(input.MultiAz !== undefined && input.MultiAz !== null && { MultiAz: input.MultiAz }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.PreferredBackupWindow !== undefined && + input.PreferredBackupWindow !== null && { PreferredBackupWindow: input.PreferredBackupWindow }), + ...(input.PreferredMaintenanceWindow !== undefined && + input.PreferredMaintenanceWindow !== null && { PreferredMaintenanceWindow: input.PreferredMaintenanceWindow }), + ...(input.ReadReplicaIdentifiers !== undefined && + input.ReadReplicaIdentifiers !== null && { + ReadReplicaIdentifiers: serializeAws_restJson1StringList(input.ReadReplicaIdentifiers, context), + }), + ...(input.ReaderEndpoint !== undefined && + input.ReaderEndpoint !== null && { ReaderEndpoint: input.ReaderEndpoint }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.StorageEncrypted !== undefined && + input.StorageEncrypted !== null && { StorageEncrypted: input.StorageEncrypted }), + ...(input.VpcSecurityGroups !== undefined && + input.VpcSecurityGroups !== null && { + VpcSecurityGroups: serializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroups(input.VpcSecurityGroups, context), + }), }; }; const serializeAws_restJson1AwsRdsDbClusterMember = (input: AwsRdsDbClusterMember, context: __SerdeContext): any => { return { - ...(input.DbClusterParameterGroupStatus !== undefined && { - DbClusterParameterGroupStatus: input.DbClusterParameterGroupStatus, - }), - ...(input.DbInstanceIdentifier !== undefined && { DbInstanceIdentifier: input.DbInstanceIdentifier }), - ...(input.IsClusterWriter !== undefined && { IsClusterWriter: input.IsClusterWriter }), - ...(input.PromotionTier !== undefined && { PromotionTier: input.PromotionTier }), + ...(input.DbClusterParameterGroupStatus !== undefined && + input.DbClusterParameterGroupStatus !== null && { + DbClusterParameterGroupStatus: input.DbClusterParameterGroupStatus, + }), + ...(input.DbInstanceIdentifier !== undefined && + input.DbInstanceIdentifier !== null && { DbInstanceIdentifier: input.DbInstanceIdentifier }), + ...(input.IsClusterWriter !== undefined && + input.IsClusterWriter !== null && { IsClusterWriter: input.IsClusterWriter }), + ...(input.PromotionTier !== undefined && input.PromotionTier !== null && { PromotionTier: input.PromotionTier }), }; }; const serializeAws_restJson1AwsRdsDbClusterMembers = (input: AwsRdsDbClusterMember[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbClusterMember(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbClusterMember(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbClusterOptionGroupMembership = ( @@ -7895,8 +8409,9 @@ const serializeAws_restJson1AwsRdsDbClusterOptionGroupMembership = ( context: __SerdeContext ): any => { return { - ...(input.DbClusterOptionGroupName !== undefined && { DbClusterOptionGroupName: input.DbClusterOptionGroupName }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.DbClusterOptionGroupName !== undefined && + input.DbClusterOptionGroupName !== null && { DbClusterOptionGroupName: input.DbClusterOptionGroupName }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -7904,7 +8419,14 @@ const serializeAws_restJson1AwsRdsDbClusterOptionGroupMemberships = ( input: AwsRdsDbClusterOptionGroupMembership[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbClusterOptionGroupMembership(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbClusterOptionGroupMembership(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbClusterSnapshotDetails = ( @@ -7912,30 +8434,38 @@ const serializeAws_restJson1AwsRdsDbClusterSnapshotDetails = ( context: __SerdeContext ): any => { return { - ...(input.AllocatedStorage !== undefined && { AllocatedStorage: input.AllocatedStorage }), - ...(input.AvailabilityZones !== undefined && { - AvailabilityZones: serializeAws_restJson1StringList(input.AvailabilityZones, context), - }), - ...(input.ClusterCreateTime !== undefined && { ClusterCreateTime: input.ClusterCreateTime }), - ...(input.DbClusterIdentifier !== undefined && { DbClusterIdentifier: input.DbClusterIdentifier }), - ...(input.DbClusterSnapshotIdentifier !== undefined && { - DbClusterSnapshotIdentifier: input.DbClusterSnapshotIdentifier, - }), - ...(input.Engine !== undefined && { Engine: input.Engine }), - ...(input.EngineVersion !== undefined && { EngineVersion: input.EngineVersion }), - ...(input.IamDatabaseAuthenticationEnabled !== undefined && { - IamDatabaseAuthenticationEnabled: input.IamDatabaseAuthenticationEnabled, - }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.LicenseModel !== undefined && { LicenseModel: input.LicenseModel }), - ...(input.MasterUsername !== undefined && { MasterUsername: input.MasterUsername }), - ...(input.PercentProgress !== undefined && { PercentProgress: input.PercentProgress }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.SnapshotCreateTime !== undefined && { SnapshotCreateTime: input.SnapshotCreateTime }), - ...(input.SnapshotType !== undefined && { SnapshotType: input.SnapshotType }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.StorageEncrypted !== undefined && { StorageEncrypted: input.StorageEncrypted }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.AllocatedStorage !== undefined && + input.AllocatedStorage !== null && { AllocatedStorage: input.AllocatedStorage }), + ...(input.AvailabilityZones !== undefined && + input.AvailabilityZones !== null && { + AvailabilityZones: serializeAws_restJson1StringList(input.AvailabilityZones, context), + }), + ...(input.ClusterCreateTime !== undefined && + input.ClusterCreateTime !== null && { ClusterCreateTime: input.ClusterCreateTime }), + ...(input.DbClusterIdentifier !== undefined && + input.DbClusterIdentifier !== null && { DbClusterIdentifier: input.DbClusterIdentifier }), + ...(input.DbClusterSnapshotIdentifier !== undefined && + input.DbClusterSnapshotIdentifier !== null && { DbClusterSnapshotIdentifier: input.DbClusterSnapshotIdentifier }), + ...(input.Engine !== undefined && input.Engine !== null && { Engine: input.Engine }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { EngineVersion: input.EngineVersion }), + ...(input.IamDatabaseAuthenticationEnabled !== undefined && + input.IamDatabaseAuthenticationEnabled !== null && { + IamDatabaseAuthenticationEnabled: input.IamDatabaseAuthenticationEnabled, + }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.LicenseModel !== undefined && input.LicenseModel !== null && { LicenseModel: input.LicenseModel }), + ...(input.MasterUsername !== undefined && + input.MasterUsername !== null && { MasterUsername: input.MasterUsername }), + ...(input.PercentProgress !== undefined && + input.PercentProgress !== null && { PercentProgress: input.PercentProgress }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.SnapshotCreateTime !== undefined && + input.SnapshotCreateTime !== null && { SnapshotCreateTime: input.SnapshotCreateTime }), + ...(input.SnapshotType !== undefined && input.SnapshotType !== null && { SnapshotType: input.SnapshotType }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.StorageEncrypted !== undefined && + input.StorageEncrypted !== null && { StorageEncrypted: input.StorageEncrypted }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -7944,10 +8474,10 @@ const serializeAws_restJson1AwsRdsDbDomainMembership = ( context: __SerdeContext ): any => { return { - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.Fqdn !== undefined && { Fqdn: input.Fqdn }), - ...(input.IamRoleName !== undefined && { IamRoleName: input.IamRoleName }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.Fqdn !== undefined && input.Fqdn !== null && { Fqdn: input.Fqdn }), + ...(input.IamRoleName !== undefined && input.IamRoleName !== null && { IamRoleName: input.IamRoleName }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -7955,7 +8485,14 @@ const serializeAws_restJson1AwsRdsDbDomainMemberships = ( input: AwsRdsDbDomainMembership[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbDomainMembership(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbDomainMembership(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbInstanceAssociatedRole = ( @@ -7963,9 +8500,9 @@ const serializeAws_restJson1AwsRdsDbInstanceAssociatedRole = ( context: __SerdeContext ): any => { return { - ...(input.FeatureName !== undefined && { FeatureName: input.FeatureName }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.FeatureName !== undefined && input.FeatureName !== null && { FeatureName: input.FeatureName }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -7973,7 +8510,14 @@ const serializeAws_restJson1AwsRdsDbInstanceAssociatedRoles = ( input: AwsRdsDbInstanceAssociatedRole[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbInstanceAssociatedRole(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbInstanceAssociatedRole(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbInstanceDetails = ( @@ -7981,115 +8525,157 @@ const serializeAws_restJson1AwsRdsDbInstanceDetails = ( context: __SerdeContext ): any => { return { - ...(input.AllocatedStorage !== undefined && { AllocatedStorage: input.AllocatedStorage }), - ...(input.AssociatedRoles !== undefined && { - AssociatedRoles: serializeAws_restJson1AwsRdsDbInstanceAssociatedRoles(input.AssociatedRoles, context), - }), - ...(input.AutoMinorVersionUpgrade !== undefined && { AutoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.BackupRetentionPeriod !== undefined && { BackupRetentionPeriod: input.BackupRetentionPeriod }), - ...(input.CACertificateIdentifier !== undefined && { CACertificateIdentifier: input.CACertificateIdentifier }), - ...(input.CharacterSetName !== undefined && { CharacterSetName: input.CharacterSetName }), - ...(input.CopyTagsToSnapshot !== undefined && { CopyTagsToSnapshot: input.CopyTagsToSnapshot }), - ...(input.DBClusterIdentifier !== undefined && { DBClusterIdentifier: input.DBClusterIdentifier }), - ...(input.DBInstanceClass !== undefined && { DBInstanceClass: input.DBInstanceClass }), - ...(input.DBInstanceIdentifier !== undefined && { DBInstanceIdentifier: input.DBInstanceIdentifier }), - ...(input.DBName !== undefined && { DBName: input.DBName }), - ...(input.DbInstancePort !== undefined && { DbInstancePort: input.DbInstancePort }), - ...(input.DbInstanceStatus !== undefined && { DbInstanceStatus: input.DbInstanceStatus }), - ...(input.DbParameterGroups !== undefined && { - DbParameterGroups: serializeAws_restJson1AwsRdsDbParameterGroups(input.DbParameterGroups, context), - }), - ...(input.DbSecurityGroups !== undefined && { - DbSecurityGroups: serializeAws_restJson1StringList(input.DbSecurityGroups, context), - }), - ...(input.DbSubnetGroup !== undefined && { - DbSubnetGroup: serializeAws_restJson1AwsRdsDbSubnetGroup(input.DbSubnetGroup, context), - }), - ...(input.DbiResourceId !== undefined && { DbiResourceId: input.DbiResourceId }), - ...(input.DeletionProtection !== undefined && { DeletionProtection: input.DeletionProtection }), - ...(input.DomainMemberships !== undefined && { - DomainMemberships: serializeAws_restJson1AwsRdsDbDomainMemberships(input.DomainMemberships, context), - }), - ...(input.EnabledCloudWatchLogsExports !== undefined && { - EnabledCloudWatchLogsExports: serializeAws_restJson1StringList(input.EnabledCloudWatchLogsExports, context), - }), - ...(input.Endpoint !== undefined && { - Endpoint: serializeAws_restJson1AwsRdsDbInstanceEndpoint(input.Endpoint, context), - }), - ...(input.Engine !== undefined && { Engine: input.Engine }), - ...(input.EngineVersion !== undefined && { EngineVersion: input.EngineVersion }), - ...(input.EnhancedMonitoringResourceArn !== undefined && { - EnhancedMonitoringResourceArn: input.EnhancedMonitoringResourceArn, - }), - ...(input.IAMDatabaseAuthenticationEnabled !== undefined && { - IAMDatabaseAuthenticationEnabled: input.IAMDatabaseAuthenticationEnabled, - }), - ...(input.InstanceCreateTime !== undefined && { InstanceCreateTime: input.InstanceCreateTime }), - ...(input.Iops !== undefined && { Iops: input.Iops }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.LatestRestorableTime !== undefined && { LatestRestorableTime: input.LatestRestorableTime }), - ...(input.LicenseModel !== undefined && { LicenseModel: input.LicenseModel }), - ...(input.ListenerEndpoint !== undefined && { - ListenerEndpoint: serializeAws_restJson1AwsRdsDbInstanceEndpoint(input.ListenerEndpoint, context), - }), - ...(input.MasterUsername !== undefined && { MasterUsername: input.MasterUsername }), - ...(input.MaxAllocatedStorage !== undefined && { MaxAllocatedStorage: input.MaxAllocatedStorage }), - ...(input.MonitoringInterval !== undefined && { MonitoringInterval: input.MonitoringInterval }), - ...(input.MonitoringRoleArn !== undefined && { MonitoringRoleArn: input.MonitoringRoleArn }), - ...(input.MultiAz !== undefined && { MultiAz: input.MultiAz }), - ...(input.OptionGroupMemberships !== undefined && { - OptionGroupMemberships: serializeAws_restJson1AwsRdsDbOptionGroupMemberships( - input.OptionGroupMemberships, - context - ), - }), - ...(input.PendingModifiedValues !== undefined && { - PendingModifiedValues: serializeAws_restJson1AwsRdsDbPendingModifiedValues(input.PendingModifiedValues, context), - }), - ...(input.PerformanceInsightsEnabled !== undefined && { - PerformanceInsightsEnabled: input.PerformanceInsightsEnabled, - }), - ...(input.PerformanceInsightsKmsKeyId !== undefined && { - PerformanceInsightsKmsKeyId: input.PerformanceInsightsKmsKeyId, - }), - ...(input.PerformanceInsightsRetentionPeriod !== undefined && { - PerformanceInsightsRetentionPeriod: input.PerformanceInsightsRetentionPeriod, - }), - ...(input.PreferredBackupWindow !== undefined && { PreferredBackupWindow: input.PreferredBackupWindow }), - ...(input.PreferredMaintenanceWindow !== undefined && { - PreferredMaintenanceWindow: input.PreferredMaintenanceWindow, - }), - ...(input.ProcessorFeatures !== undefined && { - ProcessorFeatures: serializeAws_restJson1AwsRdsDbProcessorFeatures(input.ProcessorFeatures, context), - }), - ...(input.PromotionTier !== undefined && { PromotionTier: input.PromotionTier }), - ...(input.PubliclyAccessible !== undefined && { PubliclyAccessible: input.PubliclyAccessible }), - ...(input.ReadReplicaDBClusterIdentifiers !== undefined && { - ReadReplicaDBClusterIdentifiers: serializeAws_restJson1StringList(input.ReadReplicaDBClusterIdentifiers, context), - }), - ...(input.ReadReplicaDBInstanceIdentifiers !== undefined && { - ReadReplicaDBInstanceIdentifiers: serializeAws_restJson1StringList( - input.ReadReplicaDBInstanceIdentifiers, - context - ), - }), - ...(input.ReadReplicaSourceDBInstanceIdentifier !== undefined && { - ReadReplicaSourceDBInstanceIdentifier: input.ReadReplicaSourceDBInstanceIdentifier, - }), - ...(input.SecondaryAvailabilityZone !== undefined && { - SecondaryAvailabilityZone: input.SecondaryAvailabilityZone, - }), - ...(input.StatusInfos !== undefined && { - StatusInfos: serializeAws_restJson1AwsRdsDbStatusInfos(input.StatusInfos, context), - }), - ...(input.StorageEncrypted !== undefined && { StorageEncrypted: input.StorageEncrypted }), - ...(input.StorageType !== undefined && { StorageType: input.StorageType }), - ...(input.TdeCredentialArn !== undefined && { TdeCredentialArn: input.TdeCredentialArn }), - ...(input.Timezone !== undefined && { Timezone: input.Timezone }), - ...(input.VpcSecurityGroups !== undefined && { - VpcSecurityGroups: serializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroups(input.VpcSecurityGroups, context), - }), + ...(input.AllocatedStorage !== undefined && + input.AllocatedStorage !== null && { AllocatedStorage: input.AllocatedStorage }), + ...(input.AssociatedRoles !== undefined && + input.AssociatedRoles !== null && { + AssociatedRoles: serializeAws_restJson1AwsRdsDbInstanceAssociatedRoles(input.AssociatedRoles, context), + }), + ...(input.AutoMinorVersionUpgrade !== undefined && + input.AutoMinorVersionUpgrade !== null && { AutoMinorVersionUpgrade: input.AutoMinorVersionUpgrade }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.BackupRetentionPeriod !== undefined && + input.BackupRetentionPeriod !== null && { BackupRetentionPeriod: input.BackupRetentionPeriod }), + ...(input.CACertificateIdentifier !== undefined && + input.CACertificateIdentifier !== null && { CACertificateIdentifier: input.CACertificateIdentifier }), + ...(input.CharacterSetName !== undefined && + input.CharacterSetName !== null && { CharacterSetName: input.CharacterSetName }), + ...(input.CopyTagsToSnapshot !== undefined && + input.CopyTagsToSnapshot !== null && { CopyTagsToSnapshot: input.CopyTagsToSnapshot }), + ...(input.DBClusterIdentifier !== undefined && + input.DBClusterIdentifier !== null && { DBClusterIdentifier: input.DBClusterIdentifier }), + ...(input.DBInstanceClass !== undefined && + input.DBInstanceClass !== null && { DBInstanceClass: input.DBInstanceClass }), + ...(input.DBInstanceIdentifier !== undefined && + input.DBInstanceIdentifier !== null && { DBInstanceIdentifier: input.DBInstanceIdentifier }), + ...(input.DBName !== undefined && input.DBName !== null && { DBName: input.DBName }), + ...(input.DbInstancePort !== undefined && + input.DbInstancePort !== null && { DbInstancePort: input.DbInstancePort }), + ...(input.DbInstanceStatus !== undefined && + input.DbInstanceStatus !== null && { DbInstanceStatus: input.DbInstanceStatus }), + ...(input.DbParameterGroups !== undefined && + input.DbParameterGroups !== null && { + DbParameterGroups: serializeAws_restJson1AwsRdsDbParameterGroups(input.DbParameterGroups, context), + }), + ...(input.DbSecurityGroups !== undefined && + input.DbSecurityGroups !== null && { + DbSecurityGroups: serializeAws_restJson1StringList(input.DbSecurityGroups, context), + }), + ...(input.DbSubnetGroup !== undefined && + input.DbSubnetGroup !== null && { + DbSubnetGroup: serializeAws_restJson1AwsRdsDbSubnetGroup(input.DbSubnetGroup, context), + }), + ...(input.DbiResourceId !== undefined && input.DbiResourceId !== null && { DbiResourceId: input.DbiResourceId }), + ...(input.DeletionProtection !== undefined && + input.DeletionProtection !== null && { DeletionProtection: input.DeletionProtection }), + ...(input.DomainMemberships !== undefined && + input.DomainMemberships !== null && { + DomainMemberships: serializeAws_restJson1AwsRdsDbDomainMemberships(input.DomainMemberships, context), + }), + ...(input.EnabledCloudWatchLogsExports !== undefined && + input.EnabledCloudWatchLogsExports !== null && { + EnabledCloudWatchLogsExports: serializeAws_restJson1StringList(input.EnabledCloudWatchLogsExports, context), + }), + ...(input.Endpoint !== undefined && + input.Endpoint !== null && { Endpoint: serializeAws_restJson1AwsRdsDbInstanceEndpoint(input.Endpoint, context) }), + ...(input.Engine !== undefined && input.Engine !== null && { Engine: input.Engine }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { EngineVersion: input.EngineVersion }), + ...(input.EnhancedMonitoringResourceArn !== undefined && + input.EnhancedMonitoringResourceArn !== null && { + EnhancedMonitoringResourceArn: input.EnhancedMonitoringResourceArn, + }), + ...(input.IAMDatabaseAuthenticationEnabled !== undefined && + input.IAMDatabaseAuthenticationEnabled !== null && { + IAMDatabaseAuthenticationEnabled: input.IAMDatabaseAuthenticationEnabled, + }), + ...(input.InstanceCreateTime !== undefined && + input.InstanceCreateTime !== null && { InstanceCreateTime: input.InstanceCreateTime }), + ...(input.Iops !== undefined && input.Iops !== null && { Iops: input.Iops }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.LatestRestorableTime !== undefined && + input.LatestRestorableTime !== null && { LatestRestorableTime: input.LatestRestorableTime }), + ...(input.LicenseModel !== undefined && input.LicenseModel !== null && { LicenseModel: input.LicenseModel }), + ...(input.ListenerEndpoint !== undefined && + input.ListenerEndpoint !== null && { + ListenerEndpoint: serializeAws_restJson1AwsRdsDbInstanceEndpoint(input.ListenerEndpoint, context), + }), + ...(input.MasterUsername !== undefined && + input.MasterUsername !== null && { MasterUsername: input.MasterUsername }), + ...(input.MaxAllocatedStorage !== undefined && + input.MaxAllocatedStorage !== null && { MaxAllocatedStorage: input.MaxAllocatedStorage }), + ...(input.MonitoringInterval !== undefined && + input.MonitoringInterval !== null && { MonitoringInterval: input.MonitoringInterval }), + ...(input.MonitoringRoleArn !== undefined && + input.MonitoringRoleArn !== null && { MonitoringRoleArn: input.MonitoringRoleArn }), + ...(input.MultiAz !== undefined && input.MultiAz !== null && { MultiAz: input.MultiAz }), + ...(input.OptionGroupMemberships !== undefined && + input.OptionGroupMemberships !== null && { + OptionGroupMemberships: serializeAws_restJson1AwsRdsDbOptionGroupMemberships( + input.OptionGroupMemberships, + context + ), + }), + ...(input.PendingModifiedValues !== undefined && + input.PendingModifiedValues !== null && { + PendingModifiedValues: serializeAws_restJson1AwsRdsDbPendingModifiedValues( + input.PendingModifiedValues, + context + ), + }), + ...(input.PerformanceInsightsEnabled !== undefined && + input.PerformanceInsightsEnabled !== null && { PerformanceInsightsEnabled: input.PerformanceInsightsEnabled }), + ...(input.PerformanceInsightsKmsKeyId !== undefined && + input.PerformanceInsightsKmsKeyId !== null && { PerformanceInsightsKmsKeyId: input.PerformanceInsightsKmsKeyId }), + ...(input.PerformanceInsightsRetentionPeriod !== undefined && + input.PerformanceInsightsRetentionPeriod !== null && { + PerformanceInsightsRetentionPeriod: input.PerformanceInsightsRetentionPeriod, + }), + ...(input.PreferredBackupWindow !== undefined && + input.PreferredBackupWindow !== null && { PreferredBackupWindow: input.PreferredBackupWindow }), + ...(input.PreferredMaintenanceWindow !== undefined && + input.PreferredMaintenanceWindow !== null && { PreferredMaintenanceWindow: input.PreferredMaintenanceWindow }), + ...(input.ProcessorFeatures !== undefined && + input.ProcessorFeatures !== null && { + ProcessorFeatures: serializeAws_restJson1AwsRdsDbProcessorFeatures(input.ProcessorFeatures, context), + }), + ...(input.PromotionTier !== undefined && input.PromotionTier !== null && { PromotionTier: input.PromotionTier }), + ...(input.PubliclyAccessible !== undefined && + input.PubliclyAccessible !== null && { PubliclyAccessible: input.PubliclyAccessible }), + ...(input.ReadReplicaDBClusterIdentifiers !== undefined && + input.ReadReplicaDBClusterIdentifiers !== null && { + ReadReplicaDBClusterIdentifiers: serializeAws_restJson1StringList( + input.ReadReplicaDBClusterIdentifiers, + context + ), + }), + ...(input.ReadReplicaDBInstanceIdentifiers !== undefined && + input.ReadReplicaDBInstanceIdentifiers !== null && { + ReadReplicaDBInstanceIdentifiers: serializeAws_restJson1StringList( + input.ReadReplicaDBInstanceIdentifiers, + context + ), + }), + ...(input.ReadReplicaSourceDBInstanceIdentifier !== undefined && + input.ReadReplicaSourceDBInstanceIdentifier !== null && { + ReadReplicaSourceDBInstanceIdentifier: input.ReadReplicaSourceDBInstanceIdentifier, + }), + ...(input.SecondaryAvailabilityZone !== undefined && + input.SecondaryAvailabilityZone !== null && { SecondaryAvailabilityZone: input.SecondaryAvailabilityZone }), + ...(input.StatusInfos !== undefined && + input.StatusInfos !== null && { + StatusInfos: serializeAws_restJson1AwsRdsDbStatusInfos(input.StatusInfos, context), + }), + ...(input.StorageEncrypted !== undefined && + input.StorageEncrypted !== null && { StorageEncrypted: input.StorageEncrypted }), + ...(input.StorageType !== undefined && input.StorageType !== null && { StorageType: input.StorageType }), + ...(input.TdeCredentialArn !== undefined && + input.TdeCredentialArn !== null && { TdeCredentialArn: input.TdeCredentialArn }), + ...(input.Timezone !== undefined && input.Timezone !== null && { Timezone: input.Timezone }), + ...(input.VpcSecurityGroups !== undefined && + input.VpcSecurityGroups !== null && { + VpcSecurityGroups: serializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroups(input.VpcSecurityGroups, context), + }), }; }; @@ -8098,9 +8684,9 @@ const serializeAws_restJson1AwsRdsDbInstanceEndpoint = ( context: __SerdeContext ): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), - ...(input.HostedZoneId !== undefined && { HostedZoneId: input.HostedZoneId }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), + ...(input.HostedZoneId !== undefined && input.HostedZoneId !== null && { HostedZoneId: input.HostedZoneId }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; @@ -8109,8 +8695,9 @@ const serializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroup = ( context: __SerdeContext ): any => { return { - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.VpcSecurityGroupId !== undefined && { VpcSecurityGroupId: input.VpcSecurityGroupId }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.VpcSecurityGroupId !== undefined && + input.VpcSecurityGroupId !== null && { VpcSecurityGroupId: input.VpcSecurityGroupId }), }; }; @@ -8118,7 +8705,14 @@ const serializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroups = ( input: AwsRdsDbInstanceVpcSecurityGroup[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroup(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbOptionGroupMembership = ( @@ -8126,8 +8720,9 @@ const serializeAws_restJson1AwsRdsDbOptionGroupMembership = ( context: __SerdeContext ): any => { return { - ...(input.OptionGroupName !== undefined && { OptionGroupName: input.OptionGroupName }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.OptionGroupName !== undefined && + input.OptionGroupName !== null && { OptionGroupName: input.OptionGroupName }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -8135,13 +8730,22 @@ const serializeAws_restJson1AwsRdsDbOptionGroupMemberships = ( input: AwsRdsDbOptionGroupMembership[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbOptionGroupMembership(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbOptionGroupMembership(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbParameterGroup = (input: AwsRdsDbParameterGroup, context: __SerdeContext): any => { return { - ...(input.DbParameterGroupName !== undefined && { DbParameterGroupName: input.DbParameterGroupName }), - ...(input.ParameterApplyStatus !== undefined && { ParameterApplyStatus: input.ParameterApplyStatus }), + ...(input.DbParameterGroupName !== undefined && + input.DbParameterGroupName !== null && { DbParameterGroupName: input.DbParameterGroupName }), + ...(input.ParameterApplyStatus !== undefined && + input.ParameterApplyStatus !== null && { ParameterApplyStatus: input.ParameterApplyStatus }), }; }; @@ -8149,7 +8753,14 @@ const serializeAws_restJson1AwsRdsDbParameterGroups = ( input: AwsRdsDbParameterGroup[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbParameterGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbParameterGroup(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbPendingModifiedValues = ( @@ -8157,28 +8768,37 @@ const serializeAws_restJson1AwsRdsDbPendingModifiedValues = ( context: __SerdeContext ): any => { return { - ...(input.AllocatedStorage !== undefined && { AllocatedStorage: input.AllocatedStorage }), - ...(input.BackupRetentionPeriod !== undefined && { BackupRetentionPeriod: input.BackupRetentionPeriod }), - ...(input.CaCertificateIdentifier !== undefined && { CaCertificateIdentifier: input.CaCertificateIdentifier }), - ...(input.DbInstanceClass !== undefined && { DbInstanceClass: input.DbInstanceClass }), - ...(input.DbInstanceIdentifier !== undefined && { DbInstanceIdentifier: input.DbInstanceIdentifier }), - ...(input.DbSubnetGroupName !== undefined && { DbSubnetGroupName: input.DbSubnetGroupName }), - ...(input.EngineVersion !== undefined && { EngineVersion: input.EngineVersion }), - ...(input.Iops !== undefined && { Iops: input.Iops }), - ...(input.LicenseModel !== undefined && { LicenseModel: input.LicenseModel }), - ...(input.MasterUserPassword !== undefined && { MasterUserPassword: input.MasterUserPassword }), - ...(input.MultiAZ !== undefined && { MultiAZ: input.MultiAZ }), - ...(input.PendingCloudWatchLogsExports !== undefined && { - PendingCloudWatchLogsExports: serializeAws_restJson1AwsRdsPendingCloudWatchLogsExports( - input.PendingCloudWatchLogsExports, - context - ), - }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ProcessorFeatures !== undefined && { - ProcessorFeatures: serializeAws_restJson1AwsRdsDbProcessorFeatures(input.ProcessorFeatures, context), - }), - ...(input.StorageType !== undefined && { StorageType: input.StorageType }), + ...(input.AllocatedStorage !== undefined && + input.AllocatedStorage !== null && { AllocatedStorage: input.AllocatedStorage }), + ...(input.BackupRetentionPeriod !== undefined && + input.BackupRetentionPeriod !== null && { BackupRetentionPeriod: input.BackupRetentionPeriod }), + ...(input.CaCertificateIdentifier !== undefined && + input.CaCertificateIdentifier !== null && { CaCertificateIdentifier: input.CaCertificateIdentifier }), + ...(input.DbInstanceClass !== undefined && + input.DbInstanceClass !== null && { DbInstanceClass: input.DbInstanceClass }), + ...(input.DbInstanceIdentifier !== undefined && + input.DbInstanceIdentifier !== null && { DbInstanceIdentifier: input.DbInstanceIdentifier }), + ...(input.DbSubnetGroupName !== undefined && + input.DbSubnetGroupName !== null && { DbSubnetGroupName: input.DbSubnetGroupName }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { EngineVersion: input.EngineVersion }), + ...(input.Iops !== undefined && input.Iops !== null && { Iops: input.Iops }), + ...(input.LicenseModel !== undefined && input.LicenseModel !== null && { LicenseModel: input.LicenseModel }), + ...(input.MasterUserPassword !== undefined && + input.MasterUserPassword !== null && { MasterUserPassword: input.MasterUserPassword }), + ...(input.MultiAZ !== undefined && input.MultiAZ !== null && { MultiAZ: input.MultiAZ }), + ...(input.PendingCloudWatchLogsExports !== undefined && + input.PendingCloudWatchLogsExports !== null && { + PendingCloudWatchLogsExports: serializeAws_restJson1AwsRdsPendingCloudWatchLogsExports( + input.PendingCloudWatchLogsExports, + context + ), + }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ProcessorFeatures !== undefined && + input.ProcessorFeatures !== null && { + ProcessorFeatures: serializeAws_restJson1AwsRdsDbProcessorFeatures(input.ProcessorFeatures, context), + }), + ...(input.StorageType !== undefined && input.StorageType !== null && { StorageType: input.StorageType }), }; }; @@ -8187,8 +8807,8 @@ const serializeAws_restJson1AwsRdsDbProcessorFeature = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -8196,7 +8816,14 @@ const serializeAws_restJson1AwsRdsDbProcessorFeatures = ( input: AwsRdsDbProcessorFeature[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbProcessorFeature(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbProcessorFeature(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbSnapshotDetails = ( @@ -8204,65 +8831,86 @@ const serializeAws_restJson1AwsRdsDbSnapshotDetails = ( context: __SerdeContext ): any => { return { - ...(input.AllocatedStorage !== undefined && { AllocatedStorage: input.AllocatedStorage }), - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.DbInstanceIdentifier !== undefined && { DbInstanceIdentifier: input.DbInstanceIdentifier }), - ...(input.DbSnapshotIdentifier !== undefined && { DbSnapshotIdentifier: input.DbSnapshotIdentifier }), - ...(input.DbiResourceId !== undefined && { DbiResourceId: input.DbiResourceId }), - ...(input.Encrypted !== undefined && { Encrypted: input.Encrypted }), - ...(input.Engine !== undefined && { Engine: input.Engine }), - ...(input.EngineVersion !== undefined && { EngineVersion: input.EngineVersion }), - ...(input.IamDatabaseAuthenticationEnabled !== undefined && { - IamDatabaseAuthenticationEnabled: input.IamDatabaseAuthenticationEnabled, - }), - ...(input.InstanceCreateTime !== undefined && { InstanceCreateTime: input.InstanceCreateTime }), - ...(input.Iops !== undefined && { Iops: input.Iops }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.LicenseModel !== undefined && { LicenseModel: input.LicenseModel }), - ...(input.MasterUsername !== undefined && { MasterUsername: input.MasterUsername }), - ...(input.OptionGroupName !== undefined && { OptionGroupName: input.OptionGroupName }), - ...(input.PercentProgress !== undefined && { PercentProgress: input.PercentProgress }), - ...(input.Port !== undefined && { Port: input.Port }), - ...(input.ProcessorFeatures !== undefined && { - ProcessorFeatures: serializeAws_restJson1AwsRdsDbProcessorFeatures(input.ProcessorFeatures, context), - }), - ...(input.SnapshotCreateTime !== undefined && { SnapshotCreateTime: input.SnapshotCreateTime }), - ...(input.SnapshotType !== undefined && { SnapshotType: input.SnapshotType }), - ...(input.SourceDbSnapshotIdentifier !== undefined && { - SourceDbSnapshotIdentifier: input.SourceDbSnapshotIdentifier, - }), - ...(input.SourceRegion !== undefined && { SourceRegion: input.SourceRegion }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.StorageType !== undefined && { StorageType: input.StorageType }), - ...(input.TdeCredentialArn !== undefined && { TdeCredentialArn: input.TdeCredentialArn }), - ...(input.Timezone !== undefined && { Timezone: input.Timezone }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.AllocatedStorage !== undefined && + input.AllocatedStorage !== null && { AllocatedStorage: input.AllocatedStorage }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.DbInstanceIdentifier !== undefined && + input.DbInstanceIdentifier !== null && { DbInstanceIdentifier: input.DbInstanceIdentifier }), + ...(input.DbSnapshotIdentifier !== undefined && + input.DbSnapshotIdentifier !== null && { DbSnapshotIdentifier: input.DbSnapshotIdentifier }), + ...(input.DbiResourceId !== undefined && input.DbiResourceId !== null && { DbiResourceId: input.DbiResourceId }), + ...(input.Encrypted !== undefined && input.Encrypted !== null && { Encrypted: input.Encrypted }), + ...(input.Engine !== undefined && input.Engine !== null && { Engine: input.Engine }), + ...(input.EngineVersion !== undefined && input.EngineVersion !== null && { EngineVersion: input.EngineVersion }), + ...(input.IamDatabaseAuthenticationEnabled !== undefined && + input.IamDatabaseAuthenticationEnabled !== null && { + IamDatabaseAuthenticationEnabled: input.IamDatabaseAuthenticationEnabled, + }), + ...(input.InstanceCreateTime !== undefined && + input.InstanceCreateTime !== null && { InstanceCreateTime: input.InstanceCreateTime }), + ...(input.Iops !== undefined && input.Iops !== null && { Iops: input.Iops }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.LicenseModel !== undefined && input.LicenseModel !== null && { LicenseModel: input.LicenseModel }), + ...(input.MasterUsername !== undefined && + input.MasterUsername !== null && { MasterUsername: input.MasterUsername }), + ...(input.OptionGroupName !== undefined && + input.OptionGroupName !== null && { OptionGroupName: input.OptionGroupName }), + ...(input.PercentProgress !== undefined && + input.PercentProgress !== null && { PercentProgress: input.PercentProgress }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), + ...(input.ProcessorFeatures !== undefined && + input.ProcessorFeatures !== null && { + ProcessorFeatures: serializeAws_restJson1AwsRdsDbProcessorFeatures(input.ProcessorFeatures, context), + }), + ...(input.SnapshotCreateTime !== undefined && + input.SnapshotCreateTime !== null && { SnapshotCreateTime: input.SnapshotCreateTime }), + ...(input.SnapshotType !== undefined && input.SnapshotType !== null && { SnapshotType: input.SnapshotType }), + ...(input.SourceDbSnapshotIdentifier !== undefined && + input.SourceDbSnapshotIdentifier !== null && { SourceDbSnapshotIdentifier: input.SourceDbSnapshotIdentifier }), + ...(input.SourceRegion !== undefined && input.SourceRegion !== null && { SourceRegion: input.SourceRegion }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.StorageType !== undefined && input.StorageType !== null && { StorageType: input.StorageType }), + ...(input.TdeCredentialArn !== undefined && + input.TdeCredentialArn !== null && { TdeCredentialArn: input.TdeCredentialArn }), + ...(input.Timezone !== undefined && input.Timezone !== null && { Timezone: input.Timezone }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; const serializeAws_restJson1AwsRdsDbStatusInfo = (input: AwsRdsDbStatusInfo, context: __SerdeContext): any => { return { - ...(input.Message !== undefined && { Message: input.Message }), - ...(input.Normal !== undefined && { Normal: input.Normal }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.StatusType !== undefined && { StatusType: input.StatusType }), + ...(input.Message !== undefined && input.Message !== null && { Message: input.Message }), + ...(input.Normal !== undefined && input.Normal !== null && { Normal: input.Normal }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.StatusType !== undefined && input.StatusType !== null && { StatusType: input.StatusType }), }; }; const serializeAws_restJson1AwsRdsDbStatusInfos = (input: AwsRdsDbStatusInfo[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbStatusInfo(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbStatusInfo(entry, context); + }); }; const serializeAws_restJson1AwsRdsDbSubnetGroup = (input: AwsRdsDbSubnetGroup, context: __SerdeContext): any => { return { - ...(input.DbSubnetGroupArn !== undefined && { DbSubnetGroupArn: input.DbSubnetGroupArn }), - ...(input.DbSubnetGroupDescription !== undefined && { DbSubnetGroupDescription: input.DbSubnetGroupDescription }), - ...(input.DbSubnetGroupName !== undefined && { DbSubnetGroupName: input.DbSubnetGroupName }), - ...(input.SubnetGroupStatus !== undefined && { SubnetGroupStatus: input.SubnetGroupStatus }), - ...(input.Subnets !== undefined && { - Subnets: serializeAws_restJson1AwsRdsDbSubnetGroupSubnets(input.Subnets, context), - }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.DbSubnetGroupArn !== undefined && + input.DbSubnetGroupArn !== null && { DbSubnetGroupArn: input.DbSubnetGroupArn }), + ...(input.DbSubnetGroupDescription !== undefined && + input.DbSubnetGroupDescription !== null && { DbSubnetGroupDescription: input.DbSubnetGroupDescription }), + ...(input.DbSubnetGroupName !== undefined && + input.DbSubnetGroupName !== null && { DbSubnetGroupName: input.DbSubnetGroupName }), + ...(input.SubnetGroupStatus !== undefined && + input.SubnetGroupStatus !== null && { SubnetGroupStatus: input.SubnetGroupStatus }), + ...(input.Subnets !== undefined && + input.Subnets !== null && { Subnets: serializeAws_restJson1AwsRdsDbSubnetGroupSubnets(input.Subnets, context) }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; @@ -8271,14 +8919,16 @@ const serializeAws_restJson1AwsRdsDbSubnetGroupSubnet = ( context: __SerdeContext ): any => { return { - ...(input.SubnetAvailabilityZone !== undefined && { - SubnetAvailabilityZone: serializeAws_restJson1AwsRdsDbSubnetGroupSubnetAvailabilityZone( - input.SubnetAvailabilityZone, - context - ), - }), - ...(input.SubnetIdentifier !== undefined && { SubnetIdentifier: input.SubnetIdentifier }), - ...(input.SubnetStatus !== undefined && { SubnetStatus: input.SubnetStatus }), + ...(input.SubnetAvailabilityZone !== undefined && + input.SubnetAvailabilityZone !== null && { + SubnetAvailabilityZone: serializeAws_restJson1AwsRdsDbSubnetGroupSubnetAvailabilityZone( + input.SubnetAvailabilityZone, + context + ), + }), + ...(input.SubnetIdentifier !== undefined && + input.SubnetIdentifier !== null && { SubnetIdentifier: input.SubnetIdentifier }), + ...(input.SubnetStatus !== undefined && input.SubnetStatus !== null && { SubnetStatus: input.SubnetStatus }), }; }; @@ -8287,7 +8937,7 @@ const serializeAws_restJson1AwsRdsDbSubnetGroupSubnetAvailabilityZone = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8295,7 +8945,14 @@ const serializeAws_restJson1AwsRdsDbSubnetGroupSubnets = ( input: AwsRdsDbSubnetGroupSubnet[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRdsDbSubnetGroupSubnet(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRdsDbSubnetGroupSubnet(entry, context); + }); }; const serializeAws_restJson1AwsRdsPendingCloudWatchLogsExports = ( @@ -8303,12 +8960,14 @@ const serializeAws_restJson1AwsRdsPendingCloudWatchLogsExports = ( context: __SerdeContext ): any => { return { - ...(input.LogTypesToDisable !== undefined && { - LogTypesToDisable: serializeAws_restJson1StringList(input.LogTypesToDisable, context), - }), - ...(input.LogTypesToEnable !== undefined && { - LogTypesToEnable: serializeAws_restJson1StringList(input.LogTypesToEnable, context), - }), + ...(input.LogTypesToDisable !== undefined && + input.LogTypesToDisable !== null && { + LogTypesToDisable: serializeAws_restJson1StringList(input.LogTypesToDisable, context), + }), + ...(input.LogTypesToEnable !== undefined && + input.LogTypesToEnable !== null && { + LogTypesToEnable: serializeAws_restJson1StringList(input.LogTypesToEnable, context), + }), }; }; @@ -8317,9 +8976,11 @@ const serializeAws_restJson1AwsRedshiftClusterClusterNode = ( context: __SerdeContext ): any => { return { - ...(input.NodeRole !== undefined && { NodeRole: input.NodeRole }), - ...(input.PrivateIpAddress !== undefined && { PrivateIpAddress: input.PrivateIpAddress }), - ...(input.PublicIpAddress !== undefined && { PublicIpAddress: input.PublicIpAddress }), + ...(input.NodeRole !== undefined && input.NodeRole !== null && { NodeRole: input.NodeRole }), + ...(input.PrivateIpAddress !== undefined && + input.PrivateIpAddress !== null && { PrivateIpAddress: input.PrivateIpAddress }), + ...(input.PublicIpAddress !== undefined && + input.PublicIpAddress !== null && { PublicIpAddress: input.PublicIpAddress }), }; }; @@ -8327,7 +8988,14 @@ const serializeAws_restJson1AwsRedshiftClusterClusterNodes = ( input: AwsRedshiftClusterClusterNode[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRedshiftClusterClusterNode(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRedshiftClusterClusterNode(entry, context); + }); }; const serializeAws_restJson1AwsRedshiftClusterClusterParameterGroup = ( @@ -8335,14 +9003,17 @@ const serializeAws_restJson1AwsRedshiftClusterClusterParameterGroup = ( context: __SerdeContext ): any => { return { - ...(input.ClusterParameterStatusList !== undefined && { - ClusterParameterStatusList: serializeAws_restJson1AwsRedshiftClusterClusterParameterStatusList( - input.ClusterParameterStatusList, - context - ), - }), - ...(input.ParameterApplyStatus !== undefined && { ParameterApplyStatus: input.ParameterApplyStatus }), - ...(input.ParameterGroupName !== undefined && { ParameterGroupName: input.ParameterGroupName }), + ...(input.ClusterParameterStatusList !== undefined && + input.ClusterParameterStatusList !== null && { + ClusterParameterStatusList: serializeAws_restJson1AwsRedshiftClusterClusterParameterStatusList( + input.ClusterParameterStatusList, + context + ), + }), + ...(input.ParameterApplyStatus !== undefined && + input.ParameterApplyStatus !== null && { ParameterApplyStatus: input.ParameterApplyStatus }), + ...(input.ParameterGroupName !== undefined && + input.ParameterGroupName !== null && { ParameterGroupName: input.ParameterGroupName }), }; }; @@ -8350,7 +9021,14 @@ const serializeAws_restJson1AwsRedshiftClusterClusterParameterGroups = ( input: AwsRedshiftClusterClusterParameterGroup[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRedshiftClusterClusterParameterGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRedshiftClusterClusterParameterGroup(entry, context); + }); }; const serializeAws_restJson1AwsRedshiftClusterClusterParameterStatus = ( @@ -8358,11 +9036,13 @@ const serializeAws_restJson1AwsRedshiftClusterClusterParameterStatus = ( context: __SerdeContext ): any => { return { - ...(input.ParameterApplyErrorDescription !== undefined && { - ParameterApplyErrorDescription: input.ParameterApplyErrorDescription, - }), - ...(input.ParameterApplyStatus !== undefined && { ParameterApplyStatus: input.ParameterApplyStatus }), - ...(input.ParameterName !== undefined && { ParameterName: input.ParameterName }), + ...(input.ParameterApplyErrorDescription !== undefined && + input.ParameterApplyErrorDescription !== null && { + ParameterApplyErrorDescription: input.ParameterApplyErrorDescription, + }), + ...(input.ParameterApplyStatus !== undefined && + input.ParameterApplyStatus !== null && { ParameterApplyStatus: input.ParameterApplyStatus }), + ...(input.ParameterName !== undefined && input.ParameterName !== null && { ParameterName: input.ParameterName }), }; }; @@ -8370,7 +9050,14 @@ const serializeAws_restJson1AwsRedshiftClusterClusterParameterStatusList = ( input: AwsRedshiftClusterClusterParameterStatus[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRedshiftClusterClusterParameterStatus(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRedshiftClusterClusterParameterStatus(entry, context); + }); }; const serializeAws_restJson1AwsRedshiftClusterClusterSecurityGroup = ( @@ -8378,8 +9065,9 @@ const serializeAws_restJson1AwsRedshiftClusterClusterSecurityGroup = ( context: __SerdeContext ): any => { return { - ...(input.ClusterSecurityGroupName !== undefined && { ClusterSecurityGroupName: input.ClusterSecurityGroupName }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.ClusterSecurityGroupName !== undefined && + input.ClusterSecurityGroupName !== null && { ClusterSecurityGroupName: input.ClusterSecurityGroupName }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -8387,7 +9075,14 @@ const serializeAws_restJson1AwsRedshiftClusterClusterSecurityGroups = ( input: AwsRedshiftClusterClusterSecurityGroup[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRedshiftClusterClusterSecurityGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRedshiftClusterClusterSecurityGroup(entry, context); + }); }; const serializeAws_restJson1AwsRedshiftClusterClusterSnapshotCopyStatus = ( @@ -8395,12 +9090,16 @@ const serializeAws_restJson1AwsRedshiftClusterClusterSnapshotCopyStatus = ( context: __SerdeContext ): any => { return { - ...(input.DestinationRegion !== undefined && { DestinationRegion: input.DestinationRegion }), - ...(input.ManualSnapshotRetentionPeriod !== undefined && { - ManualSnapshotRetentionPeriod: input.ManualSnapshotRetentionPeriod, - }), - ...(input.RetentionPeriod !== undefined && { RetentionPeriod: input.RetentionPeriod }), - ...(input.SnapshotCopyGrantName !== undefined && { SnapshotCopyGrantName: input.SnapshotCopyGrantName }), + ...(input.DestinationRegion !== undefined && + input.DestinationRegion !== null && { DestinationRegion: input.DestinationRegion }), + ...(input.ManualSnapshotRetentionPeriod !== undefined && + input.ManualSnapshotRetentionPeriod !== null && { + ManualSnapshotRetentionPeriod: input.ManualSnapshotRetentionPeriod, + }), + ...(input.RetentionPeriod !== undefined && + input.RetentionPeriod !== null && { RetentionPeriod: input.RetentionPeriod }), + ...(input.SnapshotCopyGrantName !== undefined && + input.SnapshotCopyGrantName !== null && { SnapshotCopyGrantName: input.SnapshotCopyGrantName }), }; }; @@ -8409,13 +9108,12 @@ const serializeAws_restJson1AwsRedshiftClusterDeferredMaintenanceWindow = ( context: __SerdeContext ): any => { return { - ...(input.DeferMaintenanceEndTime !== undefined && { DeferMaintenanceEndTime: input.DeferMaintenanceEndTime }), - ...(input.DeferMaintenanceIdentifier !== undefined && { - DeferMaintenanceIdentifier: input.DeferMaintenanceIdentifier, - }), - ...(input.DeferMaintenanceStartTime !== undefined && { - DeferMaintenanceStartTime: input.DeferMaintenanceStartTime, - }), + ...(input.DeferMaintenanceEndTime !== undefined && + input.DeferMaintenanceEndTime !== null && { DeferMaintenanceEndTime: input.DeferMaintenanceEndTime }), + ...(input.DeferMaintenanceIdentifier !== undefined && + input.DeferMaintenanceIdentifier !== null && { DeferMaintenanceIdentifier: input.DeferMaintenanceIdentifier }), + ...(input.DeferMaintenanceStartTime !== undefined && + input.DeferMaintenanceStartTime !== null && { DeferMaintenanceStartTime: input.DeferMaintenanceStartTime }), }; }; @@ -8423,7 +9121,14 @@ const serializeAws_restJson1AwsRedshiftClusterDeferredMaintenanceWindows = ( input: AwsRedshiftClusterDeferredMaintenanceWindow[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRedshiftClusterDeferredMaintenanceWindow(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRedshiftClusterDeferredMaintenanceWindow(entry, context); + }); }; const serializeAws_restJson1AwsRedshiftClusterDetails = ( @@ -8431,110 +9136,140 @@ const serializeAws_restJson1AwsRedshiftClusterDetails = ( context: __SerdeContext ): any => { return { - ...(input.AllowVersionUpgrade !== undefined && { AllowVersionUpgrade: input.AllowVersionUpgrade }), - ...(input.AutomatedSnapshotRetentionPeriod !== undefined && { - AutomatedSnapshotRetentionPeriod: input.AutomatedSnapshotRetentionPeriod, - }), - ...(input.AvailabilityZone !== undefined && { AvailabilityZone: input.AvailabilityZone }), - ...(input.ClusterAvailabilityStatus !== undefined && { - ClusterAvailabilityStatus: input.ClusterAvailabilityStatus, - }), - ...(input.ClusterCreateTime !== undefined && { ClusterCreateTime: input.ClusterCreateTime }), - ...(input.ClusterIdentifier !== undefined && { ClusterIdentifier: input.ClusterIdentifier }), - ...(input.ClusterNodes !== undefined && { - ClusterNodes: serializeAws_restJson1AwsRedshiftClusterClusterNodes(input.ClusterNodes, context), - }), - ...(input.ClusterParameterGroups !== undefined && { - ClusterParameterGroups: serializeAws_restJson1AwsRedshiftClusterClusterParameterGroups( - input.ClusterParameterGroups, - context - ), - }), - ...(input.ClusterPublicKey !== undefined && { ClusterPublicKey: input.ClusterPublicKey }), - ...(input.ClusterRevisionNumber !== undefined && { ClusterRevisionNumber: input.ClusterRevisionNumber }), - ...(input.ClusterSecurityGroups !== undefined && { - ClusterSecurityGroups: serializeAws_restJson1AwsRedshiftClusterClusterSecurityGroups( - input.ClusterSecurityGroups, - context - ), - }), - ...(input.ClusterSnapshotCopyStatus !== undefined && { - ClusterSnapshotCopyStatus: serializeAws_restJson1AwsRedshiftClusterClusterSnapshotCopyStatus( - input.ClusterSnapshotCopyStatus, - context - ), - }), - ...(input.ClusterStatus !== undefined && { ClusterStatus: input.ClusterStatus }), - ...(input.ClusterSubnetGroupName !== undefined && { ClusterSubnetGroupName: input.ClusterSubnetGroupName }), - ...(input.ClusterVersion !== undefined && { ClusterVersion: input.ClusterVersion }), - ...(input.DBName !== undefined && { DBName: input.DBName }), - ...(input.DeferredMaintenanceWindows !== undefined && { - DeferredMaintenanceWindows: serializeAws_restJson1AwsRedshiftClusterDeferredMaintenanceWindows( - input.DeferredMaintenanceWindows, - context - ), - }), - ...(input.ElasticIpStatus !== undefined && { - ElasticIpStatus: serializeAws_restJson1AwsRedshiftClusterElasticIpStatus(input.ElasticIpStatus, context), - }), - ...(input.ElasticResizeNumberOfNodeOptions !== undefined && { - ElasticResizeNumberOfNodeOptions: input.ElasticResizeNumberOfNodeOptions, - }), - ...(input.Encrypted !== undefined && { Encrypted: input.Encrypted }), - ...(input.Endpoint !== undefined && { - Endpoint: serializeAws_restJson1AwsRedshiftClusterEndpoint(input.Endpoint, context), - }), - ...(input.EnhancedVpcRouting !== undefined && { EnhancedVpcRouting: input.EnhancedVpcRouting }), - ...(input.ExpectedNextSnapshotScheduleTime !== undefined && { - ExpectedNextSnapshotScheduleTime: input.ExpectedNextSnapshotScheduleTime, - }), - ...(input.ExpectedNextSnapshotScheduleTimeStatus !== undefined && { - ExpectedNextSnapshotScheduleTimeStatus: input.ExpectedNextSnapshotScheduleTimeStatus, - }), - ...(input.HsmStatus !== undefined && { - HsmStatus: serializeAws_restJson1AwsRedshiftClusterHsmStatus(input.HsmStatus, context), - }), - ...(input.IamRoles !== undefined && { - IamRoles: serializeAws_restJson1AwsRedshiftClusterIamRoles(input.IamRoles, context), - }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.MaintenanceTrackName !== undefined && { MaintenanceTrackName: input.MaintenanceTrackName }), - ...(input.ManualSnapshotRetentionPeriod !== undefined && { - ManualSnapshotRetentionPeriod: input.ManualSnapshotRetentionPeriod, - }), - ...(input.MasterUsername !== undefined && { MasterUsername: input.MasterUsername }), - ...(input.NextMaintenanceWindowStartTime !== undefined && { - NextMaintenanceWindowStartTime: input.NextMaintenanceWindowStartTime, - }), - ...(input.NodeType !== undefined && { NodeType: input.NodeType }), - ...(input.NumberOfNodes !== undefined && { NumberOfNodes: input.NumberOfNodes }), - ...(input.PendingActions !== undefined && { - PendingActions: serializeAws_restJson1StringList(input.PendingActions, context), - }), - ...(input.PendingModifiedValues !== undefined && { - PendingModifiedValues: serializeAws_restJson1AwsRedshiftClusterPendingModifiedValues( - input.PendingModifiedValues, - context - ), - }), - ...(input.PreferredMaintenanceWindow !== undefined && { - PreferredMaintenanceWindow: input.PreferredMaintenanceWindow, - }), - ...(input.PubliclyAccessible !== undefined && { PubliclyAccessible: input.PubliclyAccessible }), - ...(input.ResizeInfo !== undefined && { - ResizeInfo: serializeAws_restJson1AwsRedshiftClusterResizeInfo(input.ResizeInfo, context), - }), - ...(input.RestoreStatus !== undefined && { - RestoreStatus: serializeAws_restJson1AwsRedshiftClusterRestoreStatus(input.RestoreStatus, context), - }), - ...(input.SnapshotScheduleIdentifier !== undefined && { - SnapshotScheduleIdentifier: input.SnapshotScheduleIdentifier, - }), - ...(input.SnapshotScheduleState !== undefined && { SnapshotScheduleState: input.SnapshotScheduleState }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), - ...(input.VpcSecurityGroups !== undefined && { - VpcSecurityGroups: serializeAws_restJson1AwsRedshiftClusterVpcSecurityGroups(input.VpcSecurityGroups, context), - }), + ...(input.AllowVersionUpgrade !== undefined && + input.AllowVersionUpgrade !== null && { AllowVersionUpgrade: input.AllowVersionUpgrade }), + ...(input.AutomatedSnapshotRetentionPeriod !== undefined && + input.AutomatedSnapshotRetentionPeriod !== null && { + AutomatedSnapshotRetentionPeriod: input.AutomatedSnapshotRetentionPeriod, + }), + ...(input.AvailabilityZone !== undefined && + input.AvailabilityZone !== null && { AvailabilityZone: input.AvailabilityZone }), + ...(input.ClusterAvailabilityStatus !== undefined && + input.ClusterAvailabilityStatus !== null && { ClusterAvailabilityStatus: input.ClusterAvailabilityStatus }), + ...(input.ClusterCreateTime !== undefined && + input.ClusterCreateTime !== null && { ClusterCreateTime: input.ClusterCreateTime }), + ...(input.ClusterIdentifier !== undefined && + input.ClusterIdentifier !== null && { ClusterIdentifier: input.ClusterIdentifier }), + ...(input.ClusterNodes !== undefined && + input.ClusterNodes !== null && { + ClusterNodes: serializeAws_restJson1AwsRedshiftClusterClusterNodes(input.ClusterNodes, context), + }), + ...(input.ClusterParameterGroups !== undefined && + input.ClusterParameterGroups !== null && { + ClusterParameterGroups: serializeAws_restJson1AwsRedshiftClusterClusterParameterGroups( + input.ClusterParameterGroups, + context + ), + }), + ...(input.ClusterPublicKey !== undefined && + input.ClusterPublicKey !== null && { ClusterPublicKey: input.ClusterPublicKey }), + ...(input.ClusterRevisionNumber !== undefined && + input.ClusterRevisionNumber !== null && { ClusterRevisionNumber: input.ClusterRevisionNumber }), + ...(input.ClusterSecurityGroups !== undefined && + input.ClusterSecurityGroups !== null && { + ClusterSecurityGroups: serializeAws_restJson1AwsRedshiftClusterClusterSecurityGroups( + input.ClusterSecurityGroups, + context + ), + }), + ...(input.ClusterSnapshotCopyStatus !== undefined && + input.ClusterSnapshotCopyStatus !== null && { + ClusterSnapshotCopyStatus: serializeAws_restJson1AwsRedshiftClusterClusterSnapshotCopyStatus( + input.ClusterSnapshotCopyStatus, + context + ), + }), + ...(input.ClusterStatus !== undefined && input.ClusterStatus !== null && { ClusterStatus: input.ClusterStatus }), + ...(input.ClusterSubnetGroupName !== undefined && + input.ClusterSubnetGroupName !== null && { ClusterSubnetGroupName: input.ClusterSubnetGroupName }), + ...(input.ClusterVersion !== undefined && + input.ClusterVersion !== null && { ClusterVersion: input.ClusterVersion }), + ...(input.DBName !== undefined && input.DBName !== null && { DBName: input.DBName }), + ...(input.DeferredMaintenanceWindows !== undefined && + input.DeferredMaintenanceWindows !== null && { + DeferredMaintenanceWindows: serializeAws_restJson1AwsRedshiftClusterDeferredMaintenanceWindows( + input.DeferredMaintenanceWindows, + context + ), + }), + ...(input.ElasticIpStatus !== undefined && + input.ElasticIpStatus !== null && { + ElasticIpStatus: serializeAws_restJson1AwsRedshiftClusterElasticIpStatus(input.ElasticIpStatus, context), + }), + ...(input.ElasticResizeNumberOfNodeOptions !== undefined && + input.ElasticResizeNumberOfNodeOptions !== null && { + ElasticResizeNumberOfNodeOptions: input.ElasticResizeNumberOfNodeOptions, + }), + ...(input.Encrypted !== undefined && input.Encrypted !== null && { Encrypted: input.Encrypted }), + ...(input.Endpoint !== undefined && + input.Endpoint !== null && { + Endpoint: serializeAws_restJson1AwsRedshiftClusterEndpoint(input.Endpoint, context), + }), + ...(input.EnhancedVpcRouting !== undefined && + input.EnhancedVpcRouting !== null && { EnhancedVpcRouting: input.EnhancedVpcRouting }), + ...(input.ExpectedNextSnapshotScheduleTime !== undefined && + input.ExpectedNextSnapshotScheduleTime !== null && { + ExpectedNextSnapshotScheduleTime: input.ExpectedNextSnapshotScheduleTime, + }), + ...(input.ExpectedNextSnapshotScheduleTimeStatus !== undefined && + input.ExpectedNextSnapshotScheduleTimeStatus !== null && { + ExpectedNextSnapshotScheduleTimeStatus: input.ExpectedNextSnapshotScheduleTimeStatus, + }), + ...(input.HsmStatus !== undefined && + input.HsmStatus !== null && { + HsmStatus: serializeAws_restJson1AwsRedshiftClusterHsmStatus(input.HsmStatus, context), + }), + ...(input.IamRoles !== undefined && + input.IamRoles !== null && { + IamRoles: serializeAws_restJson1AwsRedshiftClusterIamRoles(input.IamRoles, context), + }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.MaintenanceTrackName !== undefined && + input.MaintenanceTrackName !== null && { MaintenanceTrackName: input.MaintenanceTrackName }), + ...(input.ManualSnapshotRetentionPeriod !== undefined && + input.ManualSnapshotRetentionPeriod !== null && { + ManualSnapshotRetentionPeriod: input.ManualSnapshotRetentionPeriod, + }), + ...(input.MasterUsername !== undefined && + input.MasterUsername !== null && { MasterUsername: input.MasterUsername }), + ...(input.NextMaintenanceWindowStartTime !== undefined && + input.NextMaintenanceWindowStartTime !== null && { + NextMaintenanceWindowStartTime: input.NextMaintenanceWindowStartTime, + }), + ...(input.NodeType !== undefined && input.NodeType !== null && { NodeType: input.NodeType }), + ...(input.NumberOfNodes !== undefined && input.NumberOfNodes !== null && { NumberOfNodes: input.NumberOfNodes }), + ...(input.PendingActions !== undefined && + input.PendingActions !== null && { + PendingActions: serializeAws_restJson1StringList(input.PendingActions, context), + }), + ...(input.PendingModifiedValues !== undefined && + input.PendingModifiedValues !== null && { + PendingModifiedValues: serializeAws_restJson1AwsRedshiftClusterPendingModifiedValues( + input.PendingModifiedValues, + context + ), + }), + ...(input.PreferredMaintenanceWindow !== undefined && + input.PreferredMaintenanceWindow !== null && { PreferredMaintenanceWindow: input.PreferredMaintenanceWindow }), + ...(input.PubliclyAccessible !== undefined && + input.PubliclyAccessible !== null && { PubliclyAccessible: input.PubliclyAccessible }), + ...(input.ResizeInfo !== undefined && + input.ResizeInfo !== null && { + ResizeInfo: serializeAws_restJson1AwsRedshiftClusterResizeInfo(input.ResizeInfo, context), + }), + ...(input.RestoreStatus !== undefined && + input.RestoreStatus !== null && { + RestoreStatus: serializeAws_restJson1AwsRedshiftClusterRestoreStatus(input.RestoreStatus, context), + }), + ...(input.SnapshotScheduleIdentifier !== undefined && + input.SnapshotScheduleIdentifier !== null && { SnapshotScheduleIdentifier: input.SnapshotScheduleIdentifier }), + ...(input.SnapshotScheduleState !== undefined && + input.SnapshotScheduleState !== null && { SnapshotScheduleState: input.SnapshotScheduleState }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), + ...(input.VpcSecurityGroups !== undefined && + input.VpcSecurityGroups !== null && { + VpcSecurityGroups: serializeAws_restJson1AwsRedshiftClusterVpcSecurityGroups(input.VpcSecurityGroups, context), + }), }; }; @@ -8543,8 +9278,8 @@ const serializeAws_restJson1AwsRedshiftClusterElasticIpStatus = ( context: __SerdeContext ): any => { return { - ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.ElasticIp !== undefined && input.ElasticIp !== null && { ElasticIp: input.ElasticIp }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -8553,8 +9288,8 @@ const serializeAws_restJson1AwsRedshiftClusterEndpoint = ( context: __SerdeContext ): any => { return { - ...(input.Address !== undefined && { Address: input.Address }), - ...(input.Port !== undefined && { Port: input.Port }), + ...(input.Address !== undefined && input.Address !== null && { Address: input.Address }), + ...(input.Port !== undefined && input.Port !== null && { Port: input.Port }), }; }; @@ -8563,13 +9298,13 @@ const serializeAws_restJson1AwsRedshiftClusterHsmStatus = ( context: __SerdeContext ): any => { return { - ...(input.HsmClientCertificateIdentifier !== undefined && { - HsmClientCertificateIdentifier: input.HsmClientCertificateIdentifier, - }), - ...(input.HsmConfigurationIdentifier !== undefined && { - HsmConfigurationIdentifier: input.HsmConfigurationIdentifier, - }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.HsmClientCertificateIdentifier !== undefined && + input.HsmClientCertificateIdentifier !== null && { + HsmClientCertificateIdentifier: input.HsmClientCertificateIdentifier, + }), + ...(input.HsmConfigurationIdentifier !== undefined && + input.HsmConfigurationIdentifier !== null && { HsmConfigurationIdentifier: input.HsmConfigurationIdentifier }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -8578,8 +9313,8 @@ const serializeAws_restJson1AwsRedshiftClusterIamRole = ( context: __SerdeContext ): any => { return { - ...(input.ApplyStatus !== undefined && { ApplyStatus: input.ApplyStatus }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), + ...(input.ApplyStatus !== undefined && input.ApplyStatus !== null && { ApplyStatus: input.ApplyStatus }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), }; }; @@ -8587,7 +9322,14 @@ const serializeAws_restJson1AwsRedshiftClusterIamRoles = ( input: AwsRedshiftClusterIamRole[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRedshiftClusterIamRole(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRedshiftClusterIamRole(entry, context); + }); }; const serializeAws_restJson1AwsRedshiftClusterPendingModifiedValues = ( @@ -8595,19 +9337,27 @@ const serializeAws_restJson1AwsRedshiftClusterPendingModifiedValues = ( context: __SerdeContext ): any => { return { - ...(input.AutomatedSnapshotRetentionPeriod !== undefined && { - AutomatedSnapshotRetentionPeriod: input.AutomatedSnapshotRetentionPeriod, - }), - ...(input.ClusterIdentifier !== undefined && { ClusterIdentifier: input.ClusterIdentifier }), - ...(input.ClusterType !== undefined && { ClusterType: input.ClusterType }), - ...(input.ClusterVersion !== undefined && { ClusterVersion: input.ClusterVersion }), - ...(input.EncryptionType !== undefined && { EncryptionType: input.EncryptionType }), - ...(input.EnhancedVpcRouting !== undefined && { EnhancedVpcRouting: input.EnhancedVpcRouting }), - ...(input.MaintenanceTrackName !== undefined && { MaintenanceTrackName: input.MaintenanceTrackName }), - ...(input.MasterUserPassword !== undefined && { MasterUserPassword: input.MasterUserPassword }), - ...(input.NodeType !== undefined && { NodeType: input.NodeType }), - ...(input.NumberOfNodes !== undefined && { NumberOfNodes: input.NumberOfNodes }), - ...(input.PubliclyAccessible !== undefined && { PubliclyAccessible: input.PubliclyAccessible }), + ...(input.AutomatedSnapshotRetentionPeriod !== undefined && + input.AutomatedSnapshotRetentionPeriod !== null && { + AutomatedSnapshotRetentionPeriod: input.AutomatedSnapshotRetentionPeriod, + }), + ...(input.ClusterIdentifier !== undefined && + input.ClusterIdentifier !== null && { ClusterIdentifier: input.ClusterIdentifier }), + ...(input.ClusterType !== undefined && input.ClusterType !== null && { ClusterType: input.ClusterType }), + ...(input.ClusterVersion !== undefined && + input.ClusterVersion !== null && { ClusterVersion: input.ClusterVersion }), + ...(input.EncryptionType !== undefined && + input.EncryptionType !== null && { EncryptionType: input.EncryptionType }), + ...(input.EnhancedVpcRouting !== undefined && + input.EnhancedVpcRouting !== null && { EnhancedVpcRouting: input.EnhancedVpcRouting }), + ...(input.MaintenanceTrackName !== undefined && + input.MaintenanceTrackName !== null && { MaintenanceTrackName: input.MaintenanceTrackName }), + ...(input.MasterUserPassword !== undefined && + input.MasterUserPassword !== null && { MasterUserPassword: input.MasterUserPassword }), + ...(input.NodeType !== undefined && input.NodeType !== null && { NodeType: input.NodeType }), + ...(input.NumberOfNodes !== undefined && input.NumberOfNodes !== null && { NumberOfNodes: input.NumberOfNodes }), + ...(input.PubliclyAccessible !== undefined && + input.PubliclyAccessible !== null && { PubliclyAccessible: input.PubliclyAccessible }), }; }; @@ -8616,8 +9366,9 @@ const serializeAws_restJson1AwsRedshiftClusterResizeInfo = ( context: __SerdeContext ): any => { return { - ...(input.AllowCancelResize !== undefined && { AllowCancelResize: input.AllowCancelResize }), - ...(input.ResizeType !== undefined && { ResizeType: input.ResizeType }), + ...(input.AllowCancelResize !== undefined && + input.AllowCancelResize !== null && { AllowCancelResize: input.AllowCancelResize }), + ...(input.ResizeType !== undefined && input.ResizeType !== null && { ResizeType: input.ResizeType }), }; }; @@ -8626,16 +9377,21 @@ const serializeAws_restJson1AwsRedshiftClusterRestoreStatus = ( context: __SerdeContext ): any => { return { - ...(input.CurrentRestoreRateInMegaBytesPerSecond !== undefined && { - CurrentRestoreRateInMegaBytesPerSecond: input.CurrentRestoreRateInMegaBytesPerSecond, - }), - ...(input.ElapsedTimeInSeconds !== undefined && { ElapsedTimeInSeconds: input.ElapsedTimeInSeconds }), - ...(input.EstimatedTimeToCompletionInSeconds !== undefined && { - EstimatedTimeToCompletionInSeconds: input.EstimatedTimeToCompletionInSeconds, - }), - ...(input.ProgressInMegaBytes !== undefined && { ProgressInMegaBytes: input.ProgressInMegaBytes }), - ...(input.SnapshotSizeInMegaBytes !== undefined && { SnapshotSizeInMegaBytes: input.SnapshotSizeInMegaBytes }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.CurrentRestoreRateInMegaBytesPerSecond !== undefined && + input.CurrentRestoreRateInMegaBytesPerSecond !== null && { + CurrentRestoreRateInMegaBytesPerSecond: input.CurrentRestoreRateInMegaBytesPerSecond, + }), + ...(input.ElapsedTimeInSeconds !== undefined && + input.ElapsedTimeInSeconds !== null && { ElapsedTimeInSeconds: input.ElapsedTimeInSeconds }), + ...(input.EstimatedTimeToCompletionInSeconds !== undefined && + input.EstimatedTimeToCompletionInSeconds !== null && { + EstimatedTimeToCompletionInSeconds: input.EstimatedTimeToCompletionInSeconds, + }), + ...(input.ProgressInMegaBytes !== undefined && + input.ProgressInMegaBytes !== null && { ProgressInMegaBytes: input.ProgressInMegaBytes }), + ...(input.SnapshotSizeInMegaBytes !== undefined && + input.SnapshotSizeInMegaBytes !== null && { SnapshotSizeInMegaBytes: input.SnapshotSizeInMegaBytes }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -8644,8 +9400,9 @@ const serializeAws_restJson1AwsRedshiftClusterVpcSecurityGroup = ( context: __SerdeContext ): any => { return { - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.VpcSecurityGroupId !== undefined && { VpcSecurityGroupId: input.VpcSecurityGroupId }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.VpcSecurityGroupId !== undefined && + input.VpcSecurityGroupId !== null && { VpcSecurityGroupId: input.VpcSecurityGroupId }), }; }; @@ -8653,20 +9410,28 @@ const serializeAws_restJson1AwsRedshiftClusterVpcSecurityGroups = ( input: AwsRedshiftClusterVpcSecurityGroup[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsRedshiftClusterVpcSecurityGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsRedshiftClusterVpcSecurityGroup(entry, context); + }); }; const serializeAws_restJson1AwsS3BucketDetails = (input: AwsS3BucketDetails, context: __SerdeContext): any => { return { - ...(input.CreatedAt !== undefined && { CreatedAt: input.CreatedAt }), - ...(input.OwnerId !== undefined && { OwnerId: input.OwnerId }), - ...(input.OwnerName !== undefined && { OwnerName: input.OwnerName }), - ...(input.ServerSideEncryptionConfiguration !== undefined && { - ServerSideEncryptionConfiguration: serializeAws_restJson1AwsS3BucketServerSideEncryptionConfiguration( - input.ServerSideEncryptionConfiguration, - context - ), - }), + ...(input.CreatedAt !== undefined && input.CreatedAt !== null && { CreatedAt: input.CreatedAt }), + ...(input.OwnerId !== undefined && input.OwnerId !== null && { OwnerId: input.OwnerId }), + ...(input.OwnerName !== undefined && input.OwnerName !== null && { OwnerName: input.OwnerName }), + ...(input.ServerSideEncryptionConfiguration !== undefined && + input.ServerSideEncryptionConfiguration !== null && { + ServerSideEncryptionConfiguration: serializeAws_restJson1AwsS3BucketServerSideEncryptionConfiguration( + input.ServerSideEncryptionConfiguration, + context + ), + }), }; }; @@ -8675,8 +9440,9 @@ const serializeAws_restJson1AwsS3BucketServerSideEncryptionByDefault = ( context: __SerdeContext ): any => { return { - ...(input.KMSMasterKeyID !== undefined && { KMSMasterKeyID: input.KMSMasterKeyID }), - ...(input.SSEAlgorithm !== undefined && { SSEAlgorithm: input.SSEAlgorithm }), + ...(input.KMSMasterKeyID !== undefined && + input.KMSMasterKeyID !== null && { KMSMasterKeyID: input.KMSMasterKeyID }), + ...(input.SSEAlgorithm !== undefined && input.SSEAlgorithm !== null && { SSEAlgorithm: input.SSEAlgorithm }), }; }; @@ -8685,9 +9451,10 @@ const serializeAws_restJson1AwsS3BucketServerSideEncryptionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.Rules !== undefined && { - Rules: serializeAws_restJson1AwsS3BucketServerSideEncryptionRules(input.Rules, context), - }), + ...(input.Rules !== undefined && + input.Rules !== null && { + Rules: serializeAws_restJson1AwsS3BucketServerSideEncryptionRules(input.Rules, context), + }), }; }; @@ -8696,12 +9463,13 @@ const serializeAws_restJson1AwsS3BucketServerSideEncryptionRule = ( context: __SerdeContext ): any => { return { - ...(input.ApplyServerSideEncryptionByDefault !== undefined && { - ApplyServerSideEncryptionByDefault: serializeAws_restJson1AwsS3BucketServerSideEncryptionByDefault( - input.ApplyServerSideEncryptionByDefault, - context - ), - }), + ...(input.ApplyServerSideEncryptionByDefault !== undefined && + input.ApplyServerSideEncryptionByDefault !== null && { + ApplyServerSideEncryptionByDefault: serializeAws_restJson1AwsS3BucketServerSideEncryptionByDefault( + input.ApplyServerSideEncryptionByDefault, + context + ), + }), }; }; @@ -8709,17 +9477,25 @@ const serializeAws_restJson1AwsS3BucketServerSideEncryptionRules = ( input: AwsS3BucketServerSideEncryptionRule[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsS3BucketServerSideEncryptionRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsS3BucketServerSideEncryptionRule(entry, context); + }); }; const serializeAws_restJson1AwsS3ObjectDetails = (input: AwsS3ObjectDetails, context: __SerdeContext): any => { return { - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), - ...(input.ETag !== undefined && { ETag: input.ETag }), - ...(input.LastModified !== undefined && { LastModified: input.LastModified }), - ...(input.SSEKMSKeyId !== undefined && { SSEKMSKeyId: input.SSEKMSKeyId }), - ...(input.ServerSideEncryption !== undefined && { ServerSideEncryption: input.ServerSideEncryption }), - ...(input.VersionId !== undefined && { VersionId: input.VersionId }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), + ...(input.ETag !== undefined && input.ETag !== null && { ETag: input.ETag }), + ...(input.LastModified !== undefined && input.LastModified !== null && { LastModified: input.LastModified }), + ...(input.SSEKMSKeyId !== undefined && input.SSEKMSKeyId !== null && { SSEKMSKeyId: input.SSEKMSKeyId }), + ...(input.ServerSideEncryption !== undefined && + input.ServerSideEncryption !== null && { ServerSideEncryption: input.ServerSideEncryption }), + ...(input.VersionId !== undefined && input.VersionId !== null && { VersionId: input.VersionId }), }; }; @@ -8728,18 +9504,22 @@ const serializeAws_restJson1AwsSecretsManagerSecretDetails = ( context: __SerdeContext ): any => { return { - ...(input.Deleted !== undefined && { Deleted: input.Deleted }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RotationEnabled !== undefined && { RotationEnabled: input.RotationEnabled }), - ...(input.RotationLambdaArn !== undefined && { RotationLambdaArn: input.RotationLambdaArn }), - ...(input.RotationOccurredWithinFrequency !== undefined && { - RotationOccurredWithinFrequency: input.RotationOccurredWithinFrequency, - }), - ...(input.RotationRules !== undefined && { - RotationRules: serializeAws_restJson1AwsSecretsManagerSecretRotationRules(input.RotationRules, context), - }), + ...(input.Deleted !== undefined && input.Deleted !== null && { Deleted: input.Deleted }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RotationEnabled !== undefined && + input.RotationEnabled !== null && { RotationEnabled: input.RotationEnabled }), + ...(input.RotationLambdaArn !== undefined && + input.RotationLambdaArn !== null && { RotationLambdaArn: input.RotationLambdaArn }), + ...(input.RotationOccurredWithinFrequency !== undefined && + input.RotationOccurredWithinFrequency !== null && { + RotationOccurredWithinFrequency: input.RotationOccurredWithinFrequency, + }), + ...(input.RotationRules !== undefined && + input.RotationRules !== null && { + RotationRules: serializeAws_restJson1AwsSecretsManagerSecretRotationRules(input.RotationRules, context), + }), }; }; @@ -8748,62 +9528,74 @@ const serializeAws_restJson1AwsSecretsManagerSecretRotationRules = ( context: __SerdeContext ): any => { return { - ...(input.AutomaticallyAfterDays !== undefined && { AutomaticallyAfterDays: input.AutomaticallyAfterDays }), + ...(input.AutomaticallyAfterDays !== undefined && + input.AutomaticallyAfterDays !== null && { AutomaticallyAfterDays: input.AutomaticallyAfterDays }), }; }; const serializeAws_restJson1AwsSecurityFinding = (input: AwsSecurityFinding, context: __SerdeContext): any => { return { - ...(input.AwsAccountId !== undefined && { AwsAccountId: input.AwsAccountId }), - ...(input.Compliance !== undefined && { Compliance: serializeAws_restJson1Compliance(input.Compliance, context) }), - ...(input.Confidence !== undefined && { Confidence: input.Confidence }), - ...(input.CreatedAt !== undefined && { CreatedAt: input.CreatedAt }), - ...(input.Criticality !== undefined && { Criticality: input.Criticality }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FirstObservedAt !== undefined && { FirstObservedAt: input.FirstObservedAt }), - ...(input.GeneratorId !== undefined && { GeneratorId: input.GeneratorId }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LastObservedAt !== undefined && { LastObservedAt: input.LastObservedAt }), - ...(input.Malware !== undefined && { Malware: serializeAws_restJson1MalwareList(input.Malware, context) }), - ...(input.Network !== undefined && { Network: serializeAws_restJson1Network(input.Network, context) }), - ...(input.NetworkPath !== undefined && { - NetworkPath: serializeAws_restJson1NetworkPathList(input.NetworkPath, context), - }), - ...(input.Note !== undefined && { Note: serializeAws_restJson1Note(input.Note, context) }), - ...(input.PatchSummary !== undefined && { - PatchSummary: serializeAws_restJson1PatchSummary(input.PatchSummary, context), - }), - ...(input.Process !== undefined && { Process: serializeAws_restJson1ProcessDetails(input.Process, context) }), - ...(input.ProductArn !== undefined && { ProductArn: input.ProductArn }), - ...(input.ProductFields !== undefined && { - ProductFields: serializeAws_restJson1FieldMap(input.ProductFields, context), - }), - ...(input.RecordState !== undefined && { RecordState: input.RecordState }), - ...(input.RelatedFindings !== undefined && { - RelatedFindings: serializeAws_restJson1RelatedFindingList(input.RelatedFindings, context), - }), - ...(input.Remediation !== undefined && { - Remediation: serializeAws_restJson1Remediation(input.Remediation, context), - }), - ...(input.Resources !== undefined && { Resources: serializeAws_restJson1ResourceList(input.Resources, context) }), - ...(input.SchemaVersion !== undefined && { SchemaVersion: input.SchemaVersion }), - ...(input.Severity !== undefined && { Severity: serializeAws_restJson1Severity(input.Severity, context) }), - ...(input.SourceUrl !== undefined && { SourceUrl: input.SourceUrl }), - ...(input.ThreatIntelIndicators !== undefined && { - ThreatIntelIndicators: serializeAws_restJson1ThreatIntelIndicatorList(input.ThreatIntelIndicators, context), - }), - ...(input.Title !== undefined && { Title: input.Title }), - ...(input.Types !== undefined && { Types: serializeAws_restJson1TypeList(input.Types, context) }), - ...(input.UpdatedAt !== undefined && { UpdatedAt: input.UpdatedAt }), - ...(input.UserDefinedFields !== undefined && { - UserDefinedFields: serializeAws_restJson1FieldMap(input.UserDefinedFields, context), - }), - ...(input.VerificationState !== undefined && { VerificationState: input.VerificationState }), - ...(input.Vulnerabilities !== undefined && { - Vulnerabilities: serializeAws_restJson1VulnerabilityList(input.Vulnerabilities, context), - }), - ...(input.Workflow !== undefined && { Workflow: serializeAws_restJson1Workflow(input.Workflow, context) }), - ...(input.WorkflowState !== undefined && { WorkflowState: input.WorkflowState }), + ...(input.AwsAccountId !== undefined && input.AwsAccountId !== null && { AwsAccountId: input.AwsAccountId }), + ...(input.Compliance !== undefined && + input.Compliance !== null && { Compliance: serializeAws_restJson1Compliance(input.Compliance, context) }), + ...(input.Confidence !== undefined && input.Confidence !== null && { Confidence: input.Confidence }), + ...(input.CreatedAt !== undefined && input.CreatedAt !== null && { CreatedAt: input.CreatedAt }), + ...(input.Criticality !== undefined && input.Criticality !== null && { Criticality: input.Criticality }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FirstObservedAt !== undefined && + input.FirstObservedAt !== null && { FirstObservedAt: input.FirstObservedAt }), + ...(input.GeneratorId !== undefined && input.GeneratorId !== null && { GeneratorId: input.GeneratorId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LastObservedAt !== undefined && + input.LastObservedAt !== null && { LastObservedAt: input.LastObservedAt }), + ...(input.Malware !== undefined && + input.Malware !== null && { Malware: serializeAws_restJson1MalwareList(input.Malware, context) }), + ...(input.Network !== undefined && + input.Network !== null && { Network: serializeAws_restJson1Network(input.Network, context) }), + ...(input.NetworkPath !== undefined && + input.NetworkPath !== null && { NetworkPath: serializeAws_restJson1NetworkPathList(input.NetworkPath, context) }), + ...(input.Note !== undefined && input.Note !== null && { Note: serializeAws_restJson1Note(input.Note, context) }), + ...(input.PatchSummary !== undefined && + input.PatchSummary !== null && { PatchSummary: serializeAws_restJson1PatchSummary(input.PatchSummary, context) }), + ...(input.Process !== undefined && + input.Process !== null && { Process: serializeAws_restJson1ProcessDetails(input.Process, context) }), + ...(input.ProductArn !== undefined && input.ProductArn !== null && { ProductArn: input.ProductArn }), + ...(input.ProductFields !== undefined && + input.ProductFields !== null && { ProductFields: serializeAws_restJson1FieldMap(input.ProductFields, context) }), + ...(input.RecordState !== undefined && input.RecordState !== null && { RecordState: input.RecordState }), + ...(input.RelatedFindings !== undefined && + input.RelatedFindings !== null && { + RelatedFindings: serializeAws_restJson1RelatedFindingList(input.RelatedFindings, context), + }), + ...(input.Remediation !== undefined && + input.Remediation !== null && { Remediation: serializeAws_restJson1Remediation(input.Remediation, context) }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_restJson1ResourceList(input.Resources, context) }), + ...(input.SchemaVersion !== undefined && input.SchemaVersion !== null && { SchemaVersion: input.SchemaVersion }), + ...(input.Severity !== undefined && + input.Severity !== null && { Severity: serializeAws_restJson1Severity(input.Severity, context) }), + ...(input.SourceUrl !== undefined && input.SourceUrl !== null && { SourceUrl: input.SourceUrl }), + ...(input.ThreatIntelIndicators !== undefined && + input.ThreatIntelIndicators !== null && { + ThreatIntelIndicators: serializeAws_restJson1ThreatIntelIndicatorList(input.ThreatIntelIndicators, context), + }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), + ...(input.Types !== undefined && + input.Types !== null && { Types: serializeAws_restJson1TypeList(input.Types, context) }), + ...(input.UpdatedAt !== undefined && input.UpdatedAt !== null && { UpdatedAt: input.UpdatedAt }), + ...(input.UserDefinedFields !== undefined && + input.UserDefinedFields !== null && { + UserDefinedFields: serializeAws_restJson1FieldMap(input.UserDefinedFields, context), + }), + ...(input.VerificationState !== undefined && + input.VerificationState !== null && { VerificationState: input.VerificationState }), + ...(input.Vulnerabilities !== undefined && + input.Vulnerabilities !== null && { + Vulnerabilities: serializeAws_restJson1VulnerabilityList(input.Vulnerabilities, context), + }), + ...(input.Workflow !== undefined && + input.Workflow !== null && { Workflow: serializeAws_restJson1Workflow(input.Workflow, context) }), + ...(input.WorkflowState !== undefined && input.WorkflowState !== null && { WorkflowState: input.WorkflowState }), }; }; @@ -8812,280 +9604,360 @@ const serializeAws_restJson1AwsSecurityFindingFilters = ( context: __SerdeContext ): any => { return { - ...(input.AwsAccountId !== undefined && { - AwsAccountId: serializeAws_restJson1StringFilterList(input.AwsAccountId, context), - }), - ...(input.CompanyName !== undefined && { - CompanyName: serializeAws_restJson1StringFilterList(input.CompanyName, context), - }), - ...(input.ComplianceStatus !== undefined && { - ComplianceStatus: serializeAws_restJson1StringFilterList(input.ComplianceStatus, context), - }), - ...(input.Confidence !== undefined && { - Confidence: serializeAws_restJson1NumberFilterList(input.Confidence, context), - }), - ...(input.CreatedAt !== undefined && { CreatedAt: serializeAws_restJson1DateFilterList(input.CreatedAt, context) }), - ...(input.Criticality !== undefined && { - Criticality: serializeAws_restJson1NumberFilterList(input.Criticality, context), - }), - ...(input.Description !== undefined && { - Description: serializeAws_restJson1StringFilterList(input.Description, context), - }), - ...(input.FirstObservedAt !== undefined && { - FirstObservedAt: serializeAws_restJson1DateFilterList(input.FirstObservedAt, context), - }), - ...(input.GeneratorId !== undefined && { - GeneratorId: serializeAws_restJson1StringFilterList(input.GeneratorId, context), - }), - ...(input.Id !== undefined && { Id: serializeAws_restJson1StringFilterList(input.Id, context) }), - ...(input.Keyword !== undefined && { Keyword: serializeAws_restJson1KeywordFilterList(input.Keyword, context) }), - ...(input.LastObservedAt !== undefined && { - LastObservedAt: serializeAws_restJson1DateFilterList(input.LastObservedAt, context), - }), - ...(input.MalwareName !== undefined && { - MalwareName: serializeAws_restJson1StringFilterList(input.MalwareName, context), - }), - ...(input.MalwarePath !== undefined && { - MalwarePath: serializeAws_restJson1StringFilterList(input.MalwarePath, context), - }), - ...(input.MalwareState !== undefined && { - MalwareState: serializeAws_restJson1StringFilterList(input.MalwareState, context), - }), - ...(input.MalwareType !== undefined && { - MalwareType: serializeAws_restJson1StringFilterList(input.MalwareType, context), - }), - ...(input.NetworkDestinationDomain !== undefined && { - NetworkDestinationDomain: serializeAws_restJson1StringFilterList(input.NetworkDestinationDomain, context), - }), - ...(input.NetworkDestinationIpV4 !== undefined && { - NetworkDestinationIpV4: serializeAws_restJson1IpFilterList(input.NetworkDestinationIpV4, context), - }), - ...(input.NetworkDestinationIpV6 !== undefined && { - NetworkDestinationIpV6: serializeAws_restJson1IpFilterList(input.NetworkDestinationIpV6, context), - }), - ...(input.NetworkDestinationPort !== undefined && { - NetworkDestinationPort: serializeAws_restJson1NumberFilterList(input.NetworkDestinationPort, context), - }), - ...(input.NetworkDirection !== undefined && { - NetworkDirection: serializeAws_restJson1StringFilterList(input.NetworkDirection, context), - }), - ...(input.NetworkProtocol !== undefined && { - NetworkProtocol: serializeAws_restJson1StringFilterList(input.NetworkProtocol, context), - }), - ...(input.NetworkSourceDomain !== undefined && { - NetworkSourceDomain: serializeAws_restJson1StringFilterList(input.NetworkSourceDomain, context), - }), - ...(input.NetworkSourceIpV4 !== undefined && { - NetworkSourceIpV4: serializeAws_restJson1IpFilterList(input.NetworkSourceIpV4, context), - }), - ...(input.NetworkSourceIpV6 !== undefined && { - NetworkSourceIpV6: serializeAws_restJson1IpFilterList(input.NetworkSourceIpV6, context), - }), - ...(input.NetworkSourceMac !== undefined && { - NetworkSourceMac: serializeAws_restJson1StringFilterList(input.NetworkSourceMac, context), - }), - ...(input.NetworkSourcePort !== undefined && { - NetworkSourcePort: serializeAws_restJson1NumberFilterList(input.NetworkSourcePort, context), - }), - ...(input.NoteText !== undefined && { NoteText: serializeAws_restJson1StringFilterList(input.NoteText, context) }), - ...(input.NoteUpdatedAt !== undefined && { - NoteUpdatedAt: serializeAws_restJson1DateFilterList(input.NoteUpdatedAt, context), - }), - ...(input.NoteUpdatedBy !== undefined && { - NoteUpdatedBy: serializeAws_restJson1StringFilterList(input.NoteUpdatedBy, context), - }), - ...(input.ProcessLaunchedAt !== undefined && { - ProcessLaunchedAt: serializeAws_restJson1DateFilterList(input.ProcessLaunchedAt, context), - }), - ...(input.ProcessName !== undefined && { - ProcessName: serializeAws_restJson1StringFilterList(input.ProcessName, context), - }), - ...(input.ProcessParentPid !== undefined && { - ProcessParentPid: serializeAws_restJson1NumberFilterList(input.ProcessParentPid, context), - }), - ...(input.ProcessPath !== undefined && { - ProcessPath: serializeAws_restJson1StringFilterList(input.ProcessPath, context), - }), - ...(input.ProcessPid !== undefined && { - ProcessPid: serializeAws_restJson1NumberFilterList(input.ProcessPid, context), - }), - ...(input.ProcessTerminatedAt !== undefined && { - ProcessTerminatedAt: serializeAws_restJson1DateFilterList(input.ProcessTerminatedAt, context), - }), - ...(input.ProductArn !== undefined && { - ProductArn: serializeAws_restJson1StringFilterList(input.ProductArn, context), - }), - ...(input.ProductFields !== undefined && { - ProductFields: serializeAws_restJson1MapFilterList(input.ProductFields, context), - }), - ...(input.ProductName !== undefined && { - ProductName: serializeAws_restJson1StringFilterList(input.ProductName, context), - }), - ...(input.RecommendationText !== undefined && { - RecommendationText: serializeAws_restJson1StringFilterList(input.RecommendationText, context), - }), - ...(input.RecordState !== undefined && { - RecordState: serializeAws_restJson1StringFilterList(input.RecordState, context), - }), - ...(input.RelatedFindingsId !== undefined && { - RelatedFindingsId: serializeAws_restJson1StringFilterList(input.RelatedFindingsId, context), - }), - ...(input.RelatedFindingsProductArn !== undefined && { - RelatedFindingsProductArn: serializeAws_restJson1StringFilterList(input.RelatedFindingsProductArn, context), - }), - ...(input.ResourceAwsEc2InstanceIamInstanceProfileArn !== undefined && { - ResourceAwsEc2InstanceIamInstanceProfileArn: serializeAws_restJson1StringFilterList( - input.ResourceAwsEc2InstanceIamInstanceProfileArn, - context - ), - }), - ...(input.ResourceAwsEc2InstanceImageId !== undefined && { - ResourceAwsEc2InstanceImageId: serializeAws_restJson1StringFilterList( - input.ResourceAwsEc2InstanceImageId, - context - ), - }), - ...(input.ResourceAwsEc2InstanceIpV4Addresses !== undefined && { - ResourceAwsEc2InstanceIpV4Addresses: serializeAws_restJson1IpFilterList( - input.ResourceAwsEc2InstanceIpV4Addresses, - context - ), - }), - ...(input.ResourceAwsEc2InstanceIpV6Addresses !== undefined && { - ResourceAwsEc2InstanceIpV6Addresses: serializeAws_restJson1IpFilterList( - input.ResourceAwsEc2InstanceIpV6Addresses, - context - ), - }), - ...(input.ResourceAwsEc2InstanceKeyName !== undefined && { - ResourceAwsEc2InstanceKeyName: serializeAws_restJson1StringFilterList( - input.ResourceAwsEc2InstanceKeyName, - context - ), - }), - ...(input.ResourceAwsEc2InstanceLaunchedAt !== undefined && { - ResourceAwsEc2InstanceLaunchedAt: serializeAws_restJson1DateFilterList( - input.ResourceAwsEc2InstanceLaunchedAt, - context - ), - }), - ...(input.ResourceAwsEc2InstanceSubnetId !== undefined && { - ResourceAwsEc2InstanceSubnetId: serializeAws_restJson1StringFilterList( - input.ResourceAwsEc2InstanceSubnetId, - context - ), - }), - ...(input.ResourceAwsEc2InstanceType !== undefined && { - ResourceAwsEc2InstanceType: serializeAws_restJson1StringFilterList(input.ResourceAwsEc2InstanceType, context), - }), - ...(input.ResourceAwsEc2InstanceVpcId !== undefined && { - ResourceAwsEc2InstanceVpcId: serializeAws_restJson1StringFilterList(input.ResourceAwsEc2InstanceVpcId, context), - }), - ...(input.ResourceAwsIamAccessKeyCreatedAt !== undefined && { - ResourceAwsIamAccessKeyCreatedAt: serializeAws_restJson1DateFilterList( - input.ResourceAwsIamAccessKeyCreatedAt, - context - ), - }), - ...(input.ResourceAwsIamAccessKeyStatus !== undefined && { - ResourceAwsIamAccessKeyStatus: serializeAws_restJson1StringFilterList( - input.ResourceAwsIamAccessKeyStatus, - context - ), - }), - ...(input.ResourceAwsIamAccessKeyUserName !== undefined && { - ResourceAwsIamAccessKeyUserName: serializeAws_restJson1StringFilterList( - input.ResourceAwsIamAccessKeyUserName, - context - ), - }), - ...(input.ResourceAwsS3BucketOwnerId !== undefined && { - ResourceAwsS3BucketOwnerId: serializeAws_restJson1StringFilterList(input.ResourceAwsS3BucketOwnerId, context), - }), - ...(input.ResourceAwsS3BucketOwnerName !== undefined && { - ResourceAwsS3BucketOwnerName: serializeAws_restJson1StringFilterList(input.ResourceAwsS3BucketOwnerName, context), - }), - ...(input.ResourceContainerImageId !== undefined && { - ResourceContainerImageId: serializeAws_restJson1StringFilterList(input.ResourceContainerImageId, context), - }), - ...(input.ResourceContainerImageName !== undefined && { - ResourceContainerImageName: serializeAws_restJson1StringFilterList(input.ResourceContainerImageName, context), - }), - ...(input.ResourceContainerLaunchedAt !== undefined && { - ResourceContainerLaunchedAt: serializeAws_restJson1DateFilterList(input.ResourceContainerLaunchedAt, context), - }), - ...(input.ResourceContainerName !== undefined && { - ResourceContainerName: serializeAws_restJson1StringFilterList(input.ResourceContainerName, context), - }), - ...(input.ResourceDetailsOther !== undefined && { - ResourceDetailsOther: serializeAws_restJson1MapFilterList(input.ResourceDetailsOther, context), - }), - ...(input.ResourceId !== undefined && { - ResourceId: serializeAws_restJson1StringFilterList(input.ResourceId, context), - }), - ...(input.ResourcePartition !== undefined && { - ResourcePartition: serializeAws_restJson1StringFilterList(input.ResourcePartition, context), - }), - ...(input.ResourceRegion !== undefined && { - ResourceRegion: serializeAws_restJson1StringFilterList(input.ResourceRegion, context), - }), - ...(input.ResourceTags !== undefined && { - ResourceTags: serializeAws_restJson1MapFilterList(input.ResourceTags, context), - }), - ...(input.ResourceType !== undefined && { - ResourceType: serializeAws_restJson1StringFilterList(input.ResourceType, context), - }), - ...(input.SeverityLabel !== undefined && { - SeverityLabel: serializeAws_restJson1StringFilterList(input.SeverityLabel, context), - }), - ...(input.SeverityNormalized !== undefined && { - SeverityNormalized: serializeAws_restJson1NumberFilterList(input.SeverityNormalized, context), - }), - ...(input.SeverityProduct !== undefined && { - SeverityProduct: serializeAws_restJson1NumberFilterList(input.SeverityProduct, context), - }), - ...(input.SourceUrl !== undefined && { - SourceUrl: serializeAws_restJson1StringFilterList(input.SourceUrl, context), - }), - ...(input.ThreatIntelIndicatorCategory !== undefined && { - ThreatIntelIndicatorCategory: serializeAws_restJson1StringFilterList(input.ThreatIntelIndicatorCategory, context), - }), - ...(input.ThreatIntelIndicatorLastObservedAt !== undefined && { - ThreatIntelIndicatorLastObservedAt: serializeAws_restJson1DateFilterList( - input.ThreatIntelIndicatorLastObservedAt, - context - ), - }), - ...(input.ThreatIntelIndicatorSource !== undefined && { - ThreatIntelIndicatorSource: serializeAws_restJson1StringFilterList(input.ThreatIntelIndicatorSource, context), - }), - ...(input.ThreatIntelIndicatorSourceUrl !== undefined && { - ThreatIntelIndicatorSourceUrl: serializeAws_restJson1StringFilterList( - input.ThreatIntelIndicatorSourceUrl, - context - ), - }), - ...(input.ThreatIntelIndicatorType !== undefined && { - ThreatIntelIndicatorType: serializeAws_restJson1StringFilterList(input.ThreatIntelIndicatorType, context), - }), - ...(input.ThreatIntelIndicatorValue !== undefined && { - ThreatIntelIndicatorValue: serializeAws_restJson1StringFilterList(input.ThreatIntelIndicatorValue, context), - }), - ...(input.Title !== undefined && { Title: serializeAws_restJson1StringFilterList(input.Title, context) }), - ...(input.Type !== undefined && { Type: serializeAws_restJson1StringFilterList(input.Type, context) }), - ...(input.UpdatedAt !== undefined && { UpdatedAt: serializeAws_restJson1DateFilterList(input.UpdatedAt, context) }), - ...(input.UserDefinedFields !== undefined && { - UserDefinedFields: serializeAws_restJson1MapFilterList(input.UserDefinedFields, context), - }), - ...(input.VerificationState !== undefined && { - VerificationState: serializeAws_restJson1StringFilterList(input.VerificationState, context), - }), - ...(input.WorkflowState !== undefined && { - WorkflowState: serializeAws_restJson1StringFilterList(input.WorkflowState, context), - }), - ...(input.WorkflowStatus !== undefined && { - WorkflowStatus: serializeAws_restJson1StringFilterList(input.WorkflowStatus, context), - }), + ...(input.AwsAccountId !== undefined && + input.AwsAccountId !== null && { + AwsAccountId: serializeAws_restJson1StringFilterList(input.AwsAccountId, context), + }), + ...(input.CompanyName !== undefined && + input.CompanyName !== null && { + CompanyName: serializeAws_restJson1StringFilterList(input.CompanyName, context), + }), + ...(input.ComplianceStatus !== undefined && + input.ComplianceStatus !== null && { + ComplianceStatus: serializeAws_restJson1StringFilterList(input.ComplianceStatus, context), + }), + ...(input.Confidence !== undefined && + input.Confidence !== null && { Confidence: serializeAws_restJson1NumberFilterList(input.Confidence, context) }), + ...(input.CreatedAt !== undefined && + input.CreatedAt !== null && { CreatedAt: serializeAws_restJson1DateFilterList(input.CreatedAt, context) }), + ...(input.Criticality !== undefined && + input.Criticality !== null && { + Criticality: serializeAws_restJson1NumberFilterList(input.Criticality, context), + }), + ...(input.Description !== undefined && + input.Description !== null && { + Description: serializeAws_restJson1StringFilterList(input.Description, context), + }), + ...(input.FirstObservedAt !== undefined && + input.FirstObservedAt !== null && { + FirstObservedAt: serializeAws_restJson1DateFilterList(input.FirstObservedAt, context), + }), + ...(input.GeneratorId !== undefined && + input.GeneratorId !== null && { + GeneratorId: serializeAws_restJson1StringFilterList(input.GeneratorId, context), + }), + ...(input.Id !== undefined && + input.Id !== null && { Id: serializeAws_restJson1StringFilterList(input.Id, context) }), + ...(input.Keyword !== undefined && + input.Keyword !== null && { Keyword: serializeAws_restJson1KeywordFilterList(input.Keyword, context) }), + ...(input.LastObservedAt !== undefined && + input.LastObservedAt !== null && { + LastObservedAt: serializeAws_restJson1DateFilterList(input.LastObservedAt, context), + }), + ...(input.MalwareName !== undefined && + input.MalwareName !== null && { + MalwareName: serializeAws_restJson1StringFilterList(input.MalwareName, context), + }), + ...(input.MalwarePath !== undefined && + input.MalwarePath !== null && { + MalwarePath: serializeAws_restJson1StringFilterList(input.MalwarePath, context), + }), + ...(input.MalwareState !== undefined && + input.MalwareState !== null && { + MalwareState: serializeAws_restJson1StringFilterList(input.MalwareState, context), + }), + ...(input.MalwareType !== undefined && + input.MalwareType !== null && { + MalwareType: serializeAws_restJson1StringFilterList(input.MalwareType, context), + }), + ...(input.NetworkDestinationDomain !== undefined && + input.NetworkDestinationDomain !== null && { + NetworkDestinationDomain: serializeAws_restJson1StringFilterList(input.NetworkDestinationDomain, context), + }), + ...(input.NetworkDestinationIpV4 !== undefined && + input.NetworkDestinationIpV4 !== null && { + NetworkDestinationIpV4: serializeAws_restJson1IpFilterList(input.NetworkDestinationIpV4, context), + }), + ...(input.NetworkDestinationIpV6 !== undefined && + input.NetworkDestinationIpV6 !== null && { + NetworkDestinationIpV6: serializeAws_restJson1IpFilterList(input.NetworkDestinationIpV6, context), + }), + ...(input.NetworkDestinationPort !== undefined && + input.NetworkDestinationPort !== null && { + NetworkDestinationPort: serializeAws_restJson1NumberFilterList(input.NetworkDestinationPort, context), + }), + ...(input.NetworkDirection !== undefined && + input.NetworkDirection !== null && { + NetworkDirection: serializeAws_restJson1StringFilterList(input.NetworkDirection, context), + }), + ...(input.NetworkProtocol !== undefined && + input.NetworkProtocol !== null && { + NetworkProtocol: serializeAws_restJson1StringFilterList(input.NetworkProtocol, context), + }), + ...(input.NetworkSourceDomain !== undefined && + input.NetworkSourceDomain !== null && { + NetworkSourceDomain: serializeAws_restJson1StringFilterList(input.NetworkSourceDomain, context), + }), + ...(input.NetworkSourceIpV4 !== undefined && + input.NetworkSourceIpV4 !== null && { + NetworkSourceIpV4: serializeAws_restJson1IpFilterList(input.NetworkSourceIpV4, context), + }), + ...(input.NetworkSourceIpV6 !== undefined && + input.NetworkSourceIpV6 !== null && { + NetworkSourceIpV6: serializeAws_restJson1IpFilterList(input.NetworkSourceIpV6, context), + }), + ...(input.NetworkSourceMac !== undefined && + input.NetworkSourceMac !== null && { + NetworkSourceMac: serializeAws_restJson1StringFilterList(input.NetworkSourceMac, context), + }), + ...(input.NetworkSourcePort !== undefined && + input.NetworkSourcePort !== null && { + NetworkSourcePort: serializeAws_restJson1NumberFilterList(input.NetworkSourcePort, context), + }), + ...(input.NoteText !== undefined && + input.NoteText !== null && { NoteText: serializeAws_restJson1StringFilterList(input.NoteText, context) }), + ...(input.NoteUpdatedAt !== undefined && + input.NoteUpdatedAt !== null && { + NoteUpdatedAt: serializeAws_restJson1DateFilterList(input.NoteUpdatedAt, context), + }), + ...(input.NoteUpdatedBy !== undefined && + input.NoteUpdatedBy !== null && { + NoteUpdatedBy: serializeAws_restJson1StringFilterList(input.NoteUpdatedBy, context), + }), + ...(input.ProcessLaunchedAt !== undefined && + input.ProcessLaunchedAt !== null && { + ProcessLaunchedAt: serializeAws_restJson1DateFilterList(input.ProcessLaunchedAt, context), + }), + ...(input.ProcessName !== undefined && + input.ProcessName !== null && { + ProcessName: serializeAws_restJson1StringFilterList(input.ProcessName, context), + }), + ...(input.ProcessParentPid !== undefined && + input.ProcessParentPid !== null && { + ProcessParentPid: serializeAws_restJson1NumberFilterList(input.ProcessParentPid, context), + }), + ...(input.ProcessPath !== undefined && + input.ProcessPath !== null && { + ProcessPath: serializeAws_restJson1StringFilterList(input.ProcessPath, context), + }), + ...(input.ProcessPid !== undefined && + input.ProcessPid !== null && { ProcessPid: serializeAws_restJson1NumberFilterList(input.ProcessPid, context) }), + ...(input.ProcessTerminatedAt !== undefined && + input.ProcessTerminatedAt !== null && { + ProcessTerminatedAt: serializeAws_restJson1DateFilterList(input.ProcessTerminatedAt, context), + }), + ...(input.ProductArn !== undefined && + input.ProductArn !== null && { ProductArn: serializeAws_restJson1StringFilterList(input.ProductArn, context) }), + ...(input.ProductFields !== undefined && + input.ProductFields !== null && { + ProductFields: serializeAws_restJson1MapFilterList(input.ProductFields, context), + }), + ...(input.ProductName !== undefined && + input.ProductName !== null && { + ProductName: serializeAws_restJson1StringFilterList(input.ProductName, context), + }), + ...(input.RecommendationText !== undefined && + input.RecommendationText !== null && { + RecommendationText: serializeAws_restJson1StringFilterList(input.RecommendationText, context), + }), + ...(input.RecordState !== undefined && + input.RecordState !== null && { + RecordState: serializeAws_restJson1StringFilterList(input.RecordState, context), + }), + ...(input.RelatedFindingsId !== undefined && + input.RelatedFindingsId !== null && { + RelatedFindingsId: serializeAws_restJson1StringFilterList(input.RelatedFindingsId, context), + }), + ...(input.RelatedFindingsProductArn !== undefined && + input.RelatedFindingsProductArn !== null && { + RelatedFindingsProductArn: serializeAws_restJson1StringFilterList(input.RelatedFindingsProductArn, context), + }), + ...(input.ResourceAwsEc2InstanceIamInstanceProfileArn !== undefined && + input.ResourceAwsEc2InstanceIamInstanceProfileArn !== null && { + ResourceAwsEc2InstanceIamInstanceProfileArn: serializeAws_restJson1StringFilterList( + input.ResourceAwsEc2InstanceIamInstanceProfileArn, + context + ), + }), + ...(input.ResourceAwsEc2InstanceImageId !== undefined && + input.ResourceAwsEc2InstanceImageId !== null && { + ResourceAwsEc2InstanceImageId: serializeAws_restJson1StringFilterList( + input.ResourceAwsEc2InstanceImageId, + context + ), + }), + ...(input.ResourceAwsEc2InstanceIpV4Addresses !== undefined && + input.ResourceAwsEc2InstanceIpV4Addresses !== null && { + ResourceAwsEc2InstanceIpV4Addresses: serializeAws_restJson1IpFilterList( + input.ResourceAwsEc2InstanceIpV4Addresses, + context + ), + }), + ...(input.ResourceAwsEc2InstanceIpV6Addresses !== undefined && + input.ResourceAwsEc2InstanceIpV6Addresses !== null && { + ResourceAwsEc2InstanceIpV6Addresses: serializeAws_restJson1IpFilterList( + input.ResourceAwsEc2InstanceIpV6Addresses, + context + ), + }), + ...(input.ResourceAwsEc2InstanceKeyName !== undefined && + input.ResourceAwsEc2InstanceKeyName !== null && { + ResourceAwsEc2InstanceKeyName: serializeAws_restJson1StringFilterList( + input.ResourceAwsEc2InstanceKeyName, + context + ), + }), + ...(input.ResourceAwsEc2InstanceLaunchedAt !== undefined && + input.ResourceAwsEc2InstanceLaunchedAt !== null && { + ResourceAwsEc2InstanceLaunchedAt: serializeAws_restJson1DateFilterList( + input.ResourceAwsEc2InstanceLaunchedAt, + context + ), + }), + ...(input.ResourceAwsEc2InstanceSubnetId !== undefined && + input.ResourceAwsEc2InstanceSubnetId !== null && { + ResourceAwsEc2InstanceSubnetId: serializeAws_restJson1StringFilterList( + input.ResourceAwsEc2InstanceSubnetId, + context + ), + }), + ...(input.ResourceAwsEc2InstanceType !== undefined && + input.ResourceAwsEc2InstanceType !== null && { + ResourceAwsEc2InstanceType: serializeAws_restJson1StringFilterList(input.ResourceAwsEc2InstanceType, context), + }), + ...(input.ResourceAwsEc2InstanceVpcId !== undefined && + input.ResourceAwsEc2InstanceVpcId !== null && { + ResourceAwsEc2InstanceVpcId: serializeAws_restJson1StringFilterList(input.ResourceAwsEc2InstanceVpcId, context), + }), + ...(input.ResourceAwsIamAccessKeyCreatedAt !== undefined && + input.ResourceAwsIamAccessKeyCreatedAt !== null && { + ResourceAwsIamAccessKeyCreatedAt: serializeAws_restJson1DateFilterList( + input.ResourceAwsIamAccessKeyCreatedAt, + context + ), + }), + ...(input.ResourceAwsIamAccessKeyStatus !== undefined && + input.ResourceAwsIamAccessKeyStatus !== null && { + ResourceAwsIamAccessKeyStatus: serializeAws_restJson1StringFilterList( + input.ResourceAwsIamAccessKeyStatus, + context + ), + }), + ...(input.ResourceAwsIamAccessKeyUserName !== undefined && + input.ResourceAwsIamAccessKeyUserName !== null && { + ResourceAwsIamAccessKeyUserName: serializeAws_restJson1StringFilterList( + input.ResourceAwsIamAccessKeyUserName, + context + ), + }), + ...(input.ResourceAwsS3BucketOwnerId !== undefined && + input.ResourceAwsS3BucketOwnerId !== null && { + ResourceAwsS3BucketOwnerId: serializeAws_restJson1StringFilterList(input.ResourceAwsS3BucketOwnerId, context), + }), + ...(input.ResourceAwsS3BucketOwnerName !== undefined && + input.ResourceAwsS3BucketOwnerName !== null && { + ResourceAwsS3BucketOwnerName: serializeAws_restJson1StringFilterList( + input.ResourceAwsS3BucketOwnerName, + context + ), + }), + ...(input.ResourceContainerImageId !== undefined && + input.ResourceContainerImageId !== null && { + ResourceContainerImageId: serializeAws_restJson1StringFilterList(input.ResourceContainerImageId, context), + }), + ...(input.ResourceContainerImageName !== undefined && + input.ResourceContainerImageName !== null && { + ResourceContainerImageName: serializeAws_restJson1StringFilterList(input.ResourceContainerImageName, context), + }), + ...(input.ResourceContainerLaunchedAt !== undefined && + input.ResourceContainerLaunchedAt !== null && { + ResourceContainerLaunchedAt: serializeAws_restJson1DateFilterList(input.ResourceContainerLaunchedAt, context), + }), + ...(input.ResourceContainerName !== undefined && + input.ResourceContainerName !== null && { + ResourceContainerName: serializeAws_restJson1StringFilterList(input.ResourceContainerName, context), + }), + ...(input.ResourceDetailsOther !== undefined && + input.ResourceDetailsOther !== null && { + ResourceDetailsOther: serializeAws_restJson1MapFilterList(input.ResourceDetailsOther, context), + }), + ...(input.ResourceId !== undefined && + input.ResourceId !== null && { ResourceId: serializeAws_restJson1StringFilterList(input.ResourceId, context) }), + ...(input.ResourcePartition !== undefined && + input.ResourcePartition !== null && { + ResourcePartition: serializeAws_restJson1StringFilterList(input.ResourcePartition, context), + }), + ...(input.ResourceRegion !== undefined && + input.ResourceRegion !== null && { + ResourceRegion: serializeAws_restJson1StringFilterList(input.ResourceRegion, context), + }), + ...(input.ResourceTags !== undefined && + input.ResourceTags !== null && { + ResourceTags: serializeAws_restJson1MapFilterList(input.ResourceTags, context), + }), + ...(input.ResourceType !== undefined && + input.ResourceType !== null && { + ResourceType: serializeAws_restJson1StringFilterList(input.ResourceType, context), + }), + ...(input.SeverityLabel !== undefined && + input.SeverityLabel !== null && { + SeverityLabel: serializeAws_restJson1StringFilterList(input.SeverityLabel, context), + }), + ...(input.SeverityNormalized !== undefined && + input.SeverityNormalized !== null && { + SeverityNormalized: serializeAws_restJson1NumberFilterList(input.SeverityNormalized, context), + }), + ...(input.SeverityProduct !== undefined && + input.SeverityProduct !== null && { + SeverityProduct: serializeAws_restJson1NumberFilterList(input.SeverityProduct, context), + }), + ...(input.SourceUrl !== undefined && + input.SourceUrl !== null && { SourceUrl: serializeAws_restJson1StringFilterList(input.SourceUrl, context) }), + ...(input.ThreatIntelIndicatorCategory !== undefined && + input.ThreatIntelIndicatorCategory !== null && { + ThreatIntelIndicatorCategory: serializeAws_restJson1StringFilterList( + input.ThreatIntelIndicatorCategory, + context + ), + }), + ...(input.ThreatIntelIndicatorLastObservedAt !== undefined && + input.ThreatIntelIndicatorLastObservedAt !== null && { + ThreatIntelIndicatorLastObservedAt: serializeAws_restJson1DateFilterList( + input.ThreatIntelIndicatorLastObservedAt, + context + ), + }), + ...(input.ThreatIntelIndicatorSource !== undefined && + input.ThreatIntelIndicatorSource !== null && { + ThreatIntelIndicatorSource: serializeAws_restJson1StringFilterList(input.ThreatIntelIndicatorSource, context), + }), + ...(input.ThreatIntelIndicatorSourceUrl !== undefined && + input.ThreatIntelIndicatorSourceUrl !== null && { + ThreatIntelIndicatorSourceUrl: serializeAws_restJson1StringFilterList( + input.ThreatIntelIndicatorSourceUrl, + context + ), + }), + ...(input.ThreatIntelIndicatorType !== undefined && + input.ThreatIntelIndicatorType !== null && { + ThreatIntelIndicatorType: serializeAws_restJson1StringFilterList(input.ThreatIntelIndicatorType, context), + }), + ...(input.ThreatIntelIndicatorValue !== undefined && + input.ThreatIntelIndicatorValue !== null && { + ThreatIntelIndicatorValue: serializeAws_restJson1StringFilterList(input.ThreatIntelIndicatorValue, context), + }), + ...(input.Title !== undefined && + input.Title !== null && { Title: serializeAws_restJson1StringFilterList(input.Title, context) }), + ...(input.Type !== undefined && + input.Type !== null && { Type: serializeAws_restJson1StringFilterList(input.Type, context) }), + ...(input.UpdatedAt !== undefined && + input.UpdatedAt !== null && { UpdatedAt: serializeAws_restJson1DateFilterList(input.UpdatedAt, context) }), + ...(input.UserDefinedFields !== undefined && + input.UserDefinedFields !== null && { + UserDefinedFields: serializeAws_restJson1MapFilterList(input.UserDefinedFields, context), + }), + ...(input.VerificationState !== undefined && + input.VerificationState !== null && { + VerificationState: serializeAws_restJson1StringFilterList(input.VerificationState, context), + }), + ...(input.WorkflowState !== undefined && + input.WorkflowState !== null && { + WorkflowState: serializeAws_restJson1StringFilterList(input.WorkflowState, context), + }), + ...(input.WorkflowStatus !== undefined && + input.WorkflowStatus !== null && { + WorkflowStatus: serializeAws_restJson1StringFilterList(input.WorkflowStatus, context), + }), }; }; @@ -9094,8 +9966,8 @@ const serializeAws_restJson1AwsSecurityFindingIdentifier = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.ProductArn !== undefined && { ProductArn: input.ProductArn }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.ProductArn !== undefined && input.ProductArn !== null && { ProductArn: input.ProductArn }), }; }; @@ -9103,21 +9975,37 @@ const serializeAws_restJson1AwsSecurityFindingIdentifierList = ( input: AwsSecurityFindingIdentifier[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsSecurityFindingIdentifier(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsSecurityFindingIdentifier(entry, context); + }); }; const serializeAws_restJson1AwsSecurityFindingList = (input: AwsSecurityFinding[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AwsSecurityFinding(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsSecurityFinding(entry, context); + }); }; const serializeAws_restJson1AwsSnsTopicDetails = (input: AwsSnsTopicDetails, context: __SerdeContext): any => { return { - ...(input.KmsMasterKeyId !== undefined && { KmsMasterKeyId: input.KmsMasterKeyId }), - ...(input.Owner !== undefined && { Owner: input.Owner }), - ...(input.Subscription !== undefined && { - Subscription: serializeAws_restJson1AwsSnsTopicSubscriptionList(input.Subscription, context), - }), - ...(input.TopicName !== undefined && { TopicName: input.TopicName }), + ...(input.KmsMasterKeyId !== undefined && + input.KmsMasterKeyId !== null && { KmsMasterKeyId: input.KmsMasterKeyId }), + ...(input.Owner !== undefined && input.Owner !== null && { Owner: input.Owner }), + ...(input.Subscription !== undefined && + input.Subscription !== null && { + Subscription: serializeAws_restJson1AwsSnsTopicSubscriptionList(input.Subscription, context), + }), + ...(input.TopicName !== undefined && input.TopicName !== null && { TopicName: input.TopicName }), }; }; @@ -9126,8 +10014,8 @@ const serializeAws_restJson1AwsSnsTopicSubscription = ( context: __SerdeContext ): any => { return { - ...(input.Endpoint !== undefined && { Endpoint: input.Endpoint }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), + ...(input.Endpoint !== undefined && input.Endpoint !== null && { Endpoint: input.Endpoint }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), }; }; @@ -9135,53 +10023,75 @@ const serializeAws_restJson1AwsSnsTopicSubscriptionList = ( input: AwsSnsTopicSubscription[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1AwsSnsTopicSubscription(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsSnsTopicSubscription(entry, context); + }); }; const serializeAws_restJson1AwsSqsQueueDetails = (input: AwsSqsQueueDetails, context: __SerdeContext): any => { return { - ...(input.DeadLetterTargetArn !== undefined && { DeadLetterTargetArn: input.DeadLetterTargetArn }), - ...(input.KmsDataKeyReusePeriodSeconds !== undefined && { - KmsDataKeyReusePeriodSeconds: input.KmsDataKeyReusePeriodSeconds, - }), - ...(input.KmsMasterKeyId !== undefined && { KmsMasterKeyId: input.KmsMasterKeyId }), - ...(input.QueueName !== undefined && { QueueName: input.QueueName }), + ...(input.DeadLetterTargetArn !== undefined && + input.DeadLetterTargetArn !== null && { DeadLetterTargetArn: input.DeadLetterTargetArn }), + ...(input.KmsDataKeyReusePeriodSeconds !== undefined && + input.KmsDataKeyReusePeriodSeconds !== null && { + KmsDataKeyReusePeriodSeconds: input.KmsDataKeyReusePeriodSeconds, + }), + ...(input.KmsMasterKeyId !== undefined && + input.KmsMasterKeyId !== null && { KmsMasterKeyId: input.KmsMasterKeyId }), + ...(input.QueueName !== undefined && input.QueueName !== null && { QueueName: input.QueueName }), }; }; const serializeAws_restJson1AwsWafWebAclDetails = (input: AwsWafWebAclDetails, context: __SerdeContext): any => { return { - ...(input.DefaultAction !== undefined && { DefaultAction: input.DefaultAction }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Rules !== undefined && { Rules: serializeAws_restJson1AwsWafWebAclRuleList(input.Rules, context) }), - ...(input.WebAclId !== undefined && { WebAclId: input.WebAclId }), + ...(input.DefaultAction !== undefined && input.DefaultAction !== null && { DefaultAction: input.DefaultAction }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_restJson1AwsWafWebAclRuleList(input.Rules, context) }), + ...(input.WebAclId !== undefined && input.WebAclId !== null && { WebAclId: input.WebAclId }), }; }; const serializeAws_restJson1AwsWafWebAclRule = (input: AwsWafWebAclRule, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: serializeAws_restJson1WafAction(input.Action, context) }), - ...(input.ExcludedRules !== undefined && { - ExcludedRules: serializeAws_restJson1WafExcludedRuleList(input.ExcludedRules, context), - }), - ...(input.OverrideAction !== undefined && { - OverrideAction: serializeAws_restJson1WafOverrideAction(input.OverrideAction, context), - }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Action !== undefined && + input.Action !== null && { Action: serializeAws_restJson1WafAction(input.Action, context) }), + ...(input.ExcludedRules !== undefined && + input.ExcludedRules !== null && { + ExcludedRules: serializeAws_restJson1WafExcludedRuleList(input.ExcludedRules, context), + }), + ...(input.OverrideAction !== undefined && + input.OverrideAction !== null && { + OverrideAction: serializeAws_restJson1WafOverrideAction(input.OverrideAction, context), + }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1AwsWafWebAclRuleList = (input: AwsWafWebAclRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1AwsWafWebAclRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1AwsWafWebAclRule(entry, context); + }); }; const serializeAws_restJson1CidrBlockAssociation = (input: CidrBlockAssociation, context: __SerdeContext): any => { return { - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.CidrBlock !== undefined && { CidrBlock: input.CidrBlock }), - ...(input.CidrBlockState !== undefined && { CidrBlockState: input.CidrBlockState }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.CidrBlock !== undefined && input.CidrBlock !== null && { CidrBlock: input.CidrBlock }), + ...(input.CidrBlockState !== undefined && + input.CidrBlockState !== null && { CidrBlockState: input.CidrBlockState }), }; }; @@ -9189,79 +10099,112 @@ const serializeAws_restJson1CidrBlockAssociationList = ( input: CidrBlockAssociation[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CidrBlockAssociation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CidrBlockAssociation(entry, context); + }); }; const serializeAws_restJson1Compliance = (input: Compliance, context: __SerdeContext): any => { return { - ...(input.RelatedRequirements !== undefined && { - RelatedRequirements: serializeAws_restJson1RelatedRequirementsList(input.RelatedRequirements, context), - }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.StatusReasons !== undefined && { - StatusReasons: serializeAws_restJson1StatusReasonsList(input.StatusReasons, context), - }), + ...(input.RelatedRequirements !== undefined && + input.RelatedRequirements !== null && { + RelatedRequirements: serializeAws_restJson1RelatedRequirementsList(input.RelatedRequirements, context), + }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.StatusReasons !== undefined && + input.StatusReasons !== null && { + StatusReasons: serializeAws_restJson1StatusReasonsList(input.StatusReasons, context), + }), }; }; const serializeAws_restJson1ContainerDetails = (input: ContainerDetails, context: __SerdeContext): any => { return { - ...(input.ImageId !== undefined && { ImageId: input.ImageId }), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.LaunchedAt !== undefined && { LaunchedAt: input.LaunchedAt }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ImageId !== undefined && input.ImageId !== null && { ImageId: input.ImageId }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.LaunchedAt !== undefined && input.LaunchedAt !== null && { LaunchedAt: input.LaunchedAt }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_restJson1Cvss = (input: Cvss, context: __SerdeContext): any => { return { - ...(input.BaseScore !== undefined && { BaseScore: input.BaseScore }), - ...(input.BaseVector !== undefined && { BaseVector: input.BaseVector }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.BaseScore !== undefined && input.BaseScore !== null && { BaseScore: input.BaseScore }), + ...(input.BaseVector !== undefined && input.BaseVector !== null && { BaseVector: input.BaseVector }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_restJson1CvssList = (input: Cvss[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Cvss(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Cvss(entry, context); + }); }; const serializeAws_restJson1DateFilter = (input: DateFilter, context: __SerdeContext): any => { return { - ...(input.DateRange !== undefined && { DateRange: serializeAws_restJson1DateRange(input.DateRange, context) }), - ...(input.End !== undefined && { End: input.End }), - ...(input.Start !== undefined && { Start: input.Start }), + ...(input.DateRange !== undefined && + input.DateRange !== null && { DateRange: serializeAws_restJson1DateRange(input.DateRange, context) }), + ...(input.End !== undefined && input.End !== null && { End: input.End }), + ...(input.Start !== undefined && input.Start !== null && { Start: input.Start }), }; }; const serializeAws_restJson1DateFilterList = (input: DateFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1DateFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DateFilter(entry, context); + }); }; const serializeAws_restJson1DateRange = (input: DateRange, context: __SerdeContext): any => { return { - ...(input.Unit !== undefined && { Unit: input.Unit }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Unit !== undefined && input.Unit !== null && { Unit: input.Unit }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1FieldMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1IpFilter = (input: IpFilter, context: __SerdeContext): any => { return { - ...(input.Cidr !== undefined && { Cidr: input.Cidr }), + ...(input.Cidr !== undefined && input.Cidr !== null && { Cidr: input.Cidr }), }; }; const serializeAws_restJson1IpFilterList = (input: IpFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1IpFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1IpFilter(entry, context); + }); }; const serializeAws_restJson1Ipv6CidrBlockAssociation = ( @@ -9269,9 +10212,10 @@ const serializeAws_restJson1Ipv6CidrBlockAssociation = ( context: __SerdeContext ): any => { return { - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.CidrBlockState !== undefined && { CidrBlockState: input.CidrBlockState }), - ...(input.Ipv6CidrBlock !== undefined && { Ipv6CidrBlock: input.Ipv6CidrBlock }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.CidrBlockState !== undefined && + input.CidrBlockState !== null && { CidrBlockState: input.CidrBlockState }), + ...(input.Ipv6CidrBlock !== undefined && input.Ipv6CidrBlock !== null && { Ipv6CidrBlock: input.Ipv6CidrBlock }), }; }; @@ -9279,88 +10223,121 @@ const serializeAws_restJson1Ipv6CidrBlockAssociationList = ( input: Ipv6CidrBlockAssociation[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1Ipv6CidrBlockAssociation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Ipv6CidrBlockAssociation(entry, context); + }); }; const serializeAws_restJson1KeywordFilter = (input: KeywordFilter, context: __SerdeContext): any => { return { - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1KeywordFilterList = (input: KeywordFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1KeywordFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1KeywordFilter(entry, context); + }); }; const serializeAws_restJson1LoadBalancerState = (input: LoadBalancerState, context: __SerdeContext): any => { return { - ...(input.Code !== undefined && { Code: input.Code }), - ...(input.Reason !== undefined && { Reason: input.Reason }), + ...(input.Code !== undefined && input.Code !== null && { Code: input.Code }), + ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }), }; }; const serializeAws_restJson1Malware = (input: Malware, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.State !== undefined && { State: input.State }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1MalwareList = (input: Malware[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Malware(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Malware(entry, context); + }); }; const serializeAws_restJson1MapFilter = (input: MapFilter, context: __SerdeContext): any => { return { - ...(input.Comparison !== undefined && { Comparison: input.Comparison }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Comparison !== undefined && input.Comparison !== null && { Comparison: input.Comparison }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1MapFilterList = (input: MapFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1MapFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MapFilter(entry, context); + }); }; const serializeAws_restJson1Network = (input: Network, context: __SerdeContext): any => { return { - ...(input.DestinationDomain !== undefined && { DestinationDomain: input.DestinationDomain }), - ...(input.DestinationIpV4 !== undefined && { DestinationIpV4: input.DestinationIpV4 }), - ...(input.DestinationIpV6 !== undefined && { DestinationIpV6: input.DestinationIpV6 }), - ...(input.DestinationPort !== undefined && { DestinationPort: input.DestinationPort }), - ...(input.Direction !== undefined && { Direction: input.Direction }), - ...(input.OpenPortRange !== undefined && { - OpenPortRange: serializeAws_restJson1PortRange(input.OpenPortRange, context), - }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), - ...(input.SourceDomain !== undefined && { SourceDomain: input.SourceDomain }), - ...(input.SourceIpV4 !== undefined && { SourceIpV4: input.SourceIpV4 }), - ...(input.SourceIpV6 !== undefined && { SourceIpV6: input.SourceIpV6 }), - ...(input.SourceMac !== undefined && { SourceMac: input.SourceMac }), - ...(input.SourcePort !== undefined && { SourcePort: input.SourcePort }), + ...(input.DestinationDomain !== undefined && + input.DestinationDomain !== null && { DestinationDomain: input.DestinationDomain }), + ...(input.DestinationIpV4 !== undefined && + input.DestinationIpV4 !== null && { DestinationIpV4: input.DestinationIpV4 }), + ...(input.DestinationIpV6 !== undefined && + input.DestinationIpV6 !== null && { DestinationIpV6: input.DestinationIpV6 }), + ...(input.DestinationPort !== undefined && + input.DestinationPort !== null && { DestinationPort: input.DestinationPort }), + ...(input.Direction !== undefined && input.Direction !== null && { Direction: input.Direction }), + ...(input.OpenPortRange !== undefined && + input.OpenPortRange !== null && { OpenPortRange: serializeAws_restJson1PortRange(input.OpenPortRange, context) }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), + ...(input.SourceDomain !== undefined && input.SourceDomain !== null && { SourceDomain: input.SourceDomain }), + ...(input.SourceIpV4 !== undefined && input.SourceIpV4 !== null && { SourceIpV4: input.SourceIpV4 }), + ...(input.SourceIpV6 !== undefined && input.SourceIpV6 !== null && { SourceIpV6: input.SourceIpV6 }), + ...(input.SourceMac !== undefined && input.SourceMac !== null && { SourceMac: input.SourceMac }), + ...(input.SourcePort !== undefined && input.SourcePort !== null && { SourcePort: input.SourcePort }), }; }; const serializeAws_restJson1NetworkHeader = (input: NetworkHeader, context: __SerdeContext): any => { return { - ...(input.Destination !== undefined && { - Destination: serializeAws_restJson1NetworkPathComponentDetails(input.Destination, context), - }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), - ...(input.Source !== undefined && { - Source: serializeAws_restJson1NetworkPathComponentDetails(input.Source, context), - }), + ...(input.Destination !== undefined && + input.Destination !== null && { + Destination: serializeAws_restJson1NetworkPathComponentDetails(input.Destination, context), + }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), + ...(input.Source !== undefined && + input.Source !== null && { Source: serializeAws_restJson1NetworkPathComponentDetails(input.Source, context) }), }; }; const serializeAws_restJson1NetworkPathComponent = (input: NetworkPathComponent, context: __SerdeContext): any => { return { - ...(input.ComponentId !== undefined && { ComponentId: input.ComponentId }), - ...(input.ComponentType !== undefined && { ComponentType: input.ComponentType }), - ...(input.Egress !== undefined && { Egress: serializeAws_restJson1NetworkHeader(input.Egress, context) }), - ...(input.Ingress !== undefined && { Ingress: serializeAws_restJson1NetworkHeader(input.Ingress, context) }), + ...(input.ComponentId !== undefined && input.ComponentId !== null && { ComponentId: input.ComponentId }), + ...(input.ComponentType !== undefined && input.ComponentType !== null && { ComponentType: input.ComponentType }), + ...(input.Egress !== undefined && + input.Egress !== null && { Egress: serializeAws_restJson1NetworkHeader(input.Egress, context) }), + ...(input.Ingress !== undefined && + input.Ingress !== null && { Ingress: serializeAws_restJson1NetworkHeader(input.Ingress, context) }), }; }; @@ -9369,319 +10346,426 @@ const serializeAws_restJson1NetworkPathComponentDetails = ( context: __SerdeContext ): any => { return { - ...(input.Address !== undefined && { Address: serializeAws_restJson1StringList(input.Address, context) }), - ...(input.PortRanges !== undefined && { - PortRanges: serializeAws_restJson1PortRangeList(input.PortRanges, context), - }), + ...(input.Address !== undefined && + input.Address !== null && { Address: serializeAws_restJson1StringList(input.Address, context) }), + ...(input.PortRanges !== undefined && + input.PortRanges !== null && { PortRanges: serializeAws_restJson1PortRangeList(input.PortRanges, context) }), }; }; const serializeAws_restJson1NetworkPathList = (input: NetworkPathComponent[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1NetworkPathComponent(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1NetworkPathComponent(entry, context); + }); }; const serializeAws_restJson1NonEmptyStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Note = (input: Note, context: __SerdeContext): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), - ...(input.UpdatedAt !== undefined && { UpdatedAt: input.UpdatedAt }), - ...(input.UpdatedBy !== undefined && { UpdatedBy: input.UpdatedBy }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), + ...(input.UpdatedAt !== undefined && input.UpdatedAt !== null && { UpdatedAt: input.UpdatedAt }), + ...(input.UpdatedBy !== undefined && input.UpdatedBy !== null && { UpdatedBy: input.UpdatedBy }), }; }; const serializeAws_restJson1NoteUpdate = (input: NoteUpdate, context: __SerdeContext): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), - ...(input.UpdatedBy !== undefined && { UpdatedBy: input.UpdatedBy }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), + ...(input.UpdatedBy !== undefined && input.UpdatedBy !== null && { UpdatedBy: input.UpdatedBy }), }; }; const serializeAws_restJson1NumberFilter = (input: NumberFilter, context: __SerdeContext): any => { return { - ...(input.Eq !== undefined && { Eq: input.Eq }), - ...(input.Gte !== undefined && { Gte: input.Gte }), - ...(input.Lte !== undefined && { Lte: input.Lte }), + ...(input.Eq !== undefined && input.Eq !== null && { Eq: input.Eq }), + ...(input.Gte !== undefined && input.Gte !== null && { Gte: input.Gte }), + ...(input.Lte !== undefined && input.Lte !== null && { Lte: input.Lte }), }; }; const serializeAws_restJson1NumberFilterList = (input: NumberFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1NumberFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1NumberFilter(entry, context); + }); }; const serializeAws_restJson1PatchSummary = (input: PatchSummary, context: __SerdeContext): any => { return { - ...(input.FailedCount !== undefined && { FailedCount: input.FailedCount }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.InstalledCount !== undefined && { InstalledCount: input.InstalledCount }), - ...(input.InstalledOtherCount !== undefined && { InstalledOtherCount: input.InstalledOtherCount }), - ...(input.InstalledPendingReboot !== undefined && { InstalledPendingReboot: input.InstalledPendingReboot }), - ...(input.InstalledRejectedCount !== undefined && { InstalledRejectedCount: input.InstalledRejectedCount }), - ...(input.MissingCount !== undefined && { MissingCount: input.MissingCount }), - ...(input.Operation !== undefined && { Operation: input.Operation }), - ...(input.OperationEndTime !== undefined && { OperationEndTime: input.OperationEndTime }), - ...(input.OperationStartTime !== undefined && { OperationStartTime: input.OperationStartTime }), - ...(input.RebootOption !== undefined && { RebootOption: input.RebootOption }), + ...(input.FailedCount !== undefined && input.FailedCount !== null && { FailedCount: input.FailedCount }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.InstalledCount !== undefined && + input.InstalledCount !== null && { InstalledCount: input.InstalledCount }), + ...(input.InstalledOtherCount !== undefined && + input.InstalledOtherCount !== null && { InstalledOtherCount: input.InstalledOtherCount }), + ...(input.InstalledPendingReboot !== undefined && + input.InstalledPendingReboot !== null && { InstalledPendingReboot: input.InstalledPendingReboot }), + ...(input.InstalledRejectedCount !== undefined && + input.InstalledRejectedCount !== null && { InstalledRejectedCount: input.InstalledRejectedCount }), + ...(input.MissingCount !== undefined && input.MissingCount !== null && { MissingCount: input.MissingCount }), + ...(input.Operation !== undefined && input.Operation !== null && { Operation: input.Operation }), + ...(input.OperationEndTime !== undefined && + input.OperationEndTime !== null && { OperationEndTime: input.OperationEndTime }), + ...(input.OperationStartTime !== undefined && + input.OperationStartTime !== null && { OperationStartTime: input.OperationStartTime }), + ...(input.RebootOption !== undefined && input.RebootOption !== null && { RebootOption: input.RebootOption }), }; }; const serializeAws_restJson1PortRange = (input: PortRange, context: __SerdeContext): any => { return { - ...(input.Begin !== undefined && { Begin: input.Begin }), - ...(input.End !== undefined && { End: input.End }), + ...(input.Begin !== undefined && input.Begin !== null && { Begin: input.Begin }), + ...(input.End !== undefined && input.End !== null && { End: input.End }), }; }; const serializeAws_restJson1PortRangeList = (input: PortRange[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1PortRange(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1PortRange(entry, context); + }); }; const serializeAws_restJson1ProcessDetails = (input: ProcessDetails, context: __SerdeContext): any => { return { - ...(input.LaunchedAt !== undefined && { LaunchedAt: input.LaunchedAt }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParentPid !== undefined && { ParentPid: input.ParentPid }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.Pid !== undefined && { Pid: input.Pid }), - ...(input.TerminatedAt !== undefined && { TerminatedAt: input.TerminatedAt }), + ...(input.LaunchedAt !== undefined && input.LaunchedAt !== null && { LaunchedAt: input.LaunchedAt }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParentPid !== undefined && input.ParentPid !== null && { ParentPid: input.ParentPid }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.Pid !== undefined && input.Pid !== null && { Pid: input.Pid }), + ...(input.TerminatedAt !== undefined && input.TerminatedAt !== null && { TerminatedAt: input.TerminatedAt }), }; }; const serializeAws_restJson1Recommendation = (input: Recommendation, context: __SerdeContext): any => { return { - ...(input.Text !== undefined && { Text: input.Text }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; const serializeAws_restJson1RelatedFinding = (input: RelatedFinding, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.ProductArn !== undefined && { ProductArn: input.ProductArn }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.ProductArn !== undefined && input.ProductArn !== null && { ProductArn: input.ProductArn }), }; }; const serializeAws_restJson1RelatedFindingList = (input: RelatedFinding[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1RelatedFinding(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1RelatedFinding(entry, context); + }); }; const serializeAws_restJson1RelatedRequirementsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Remediation = (input: Remediation, context: __SerdeContext): any => { return { - ...(input.Recommendation !== undefined && { - Recommendation: serializeAws_restJson1Recommendation(input.Recommendation, context), - }), + ...(input.Recommendation !== undefined && + input.Recommendation !== null && { + Recommendation: serializeAws_restJson1Recommendation(input.Recommendation, context), + }), }; }; const serializeAws_restJson1Resource = (input: Resource, context: __SerdeContext): any => { return { - ...(input.Details !== undefined && { Details: serializeAws_restJson1ResourceDetails(input.Details, context) }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Partition !== undefined && { Partition: input.Partition }), - ...(input.Region !== undefined && { Region: input.Region }), - ...(input.ResourceRole !== undefined && { ResourceRole: input.ResourceRole }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1FieldMap(input.Tags, context) }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Details !== undefined && + input.Details !== null && { Details: serializeAws_restJson1ResourceDetails(input.Details, context) }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Partition !== undefined && input.Partition !== null && { Partition: input.Partition }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), + ...(input.ResourceRole !== undefined && input.ResourceRole !== null && { ResourceRole: input.ResourceRole }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1FieldMap(input.Tags, context) }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1ResourceDetails = (input: ResourceDetails, context: __SerdeContext): any => { return { - ...(input.AwsApiGatewayRestApi !== undefined && { - AwsApiGatewayRestApi: serializeAws_restJson1AwsApiGatewayRestApiDetails(input.AwsApiGatewayRestApi, context), - }), - ...(input.AwsApiGatewayStage !== undefined && { - AwsApiGatewayStage: serializeAws_restJson1AwsApiGatewayStageDetails(input.AwsApiGatewayStage, context), - }), - ...(input.AwsApiGatewayV2Api !== undefined && { - AwsApiGatewayV2Api: serializeAws_restJson1AwsApiGatewayV2ApiDetails(input.AwsApiGatewayV2Api, context), - }), - ...(input.AwsApiGatewayV2Stage !== undefined && { - AwsApiGatewayV2Stage: serializeAws_restJson1AwsApiGatewayV2StageDetails(input.AwsApiGatewayV2Stage, context), - }), - ...(input.AwsAutoScalingAutoScalingGroup !== undefined && { - AwsAutoScalingAutoScalingGroup: serializeAws_restJson1AwsAutoScalingAutoScalingGroupDetails( - input.AwsAutoScalingAutoScalingGroup, - context - ), - }), - ...(input.AwsCertificateManagerCertificate !== undefined && { - AwsCertificateManagerCertificate: serializeAws_restJson1AwsCertificateManagerCertificateDetails( - input.AwsCertificateManagerCertificate, - context - ), - }), - ...(input.AwsCloudFrontDistribution !== undefined && { - AwsCloudFrontDistribution: serializeAws_restJson1AwsCloudFrontDistributionDetails( - input.AwsCloudFrontDistribution, - context - ), - }), - ...(input.AwsCloudTrailTrail !== undefined && { - AwsCloudTrailTrail: serializeAws_restJson1AwsCloudTrailTrailDetails(input.AwsCloudTrailTrail, context), - }), - ...(input.AwsCodeBuildProject !== undefined && { - AwsCodeBuildProject: serializeAws_restJson1AwsCodeBuildProjectDetails(input.AwsCodeBuildProject, context), - }), - ...(input.AwsDynamoDbTable !== undefined && { - AwsDynamoDbTable: serializeAws_restJson1AwsDynamoDbTableDetails(input.AwsDynamoDbTable, context), - }), - ...(input.AwsEc2Eip !== undefined && { - AwsEc2Eip: serializeAws_restJson1AwsEc2EipDetails(input.AwsEc2Eip, context), - }), - ...(input.AwsEc2Instance !== undefined && { - AwsEc2Instance: serializeAws_restJson1AwsEc2InstanceDetails(input.AwsEc2Instance, context), - }), - ...(input.AwsEc2NetworkInterface !== undefined && { - AwsEc2NetworkInterface: serializeAws_restJson1AwsEc2NetworkInterfaceDetails( - input.AwsEc2NetworkInterface, - context - ), - }), - ...(input.AwsEc2SecurityGroup !== undefined && { - AwsEc2SecurityGroup: serializeAws_restJson1AwsEc2SecurityGroupDetails(input.AwsEc2SecurityGroup, context), - }), - ...(input.AwsEc2Volume !== undefined && { - AwsEc2Volume: serializeAws_restJson1AwsEc2VolumeDetails(input.AwsEc2Volume, context), - }), - ...(input.AwsEc2Vpc !== undefined && { - AwsEc2Vpc: serializeAws_restJson1AwsEc2VpcDetails(input.AwsEc2Vpc, context), - }), - ...(input.AwsElasticsearchDomain !== undefined && { - AwsElasticsearchDomain: serializeAws_restJson1AwsElasticsearchDomainDetails( - input.AwsElasticsearchDomain, - context - ), - }), - ...(input.AwsElbLoadBalancer !== undefined && { - AwsElbLoadBalancer: serializeAws_restJson1AwsElbLoadBalancerDetails(input.AwsElbLoadBalancer, context), - }), - ...(input.AwsElbv2LoadBalancer !== undefined && { - AwsElbv2LoadBalancer: serializeAws_restJson1AwsElbv2LoadBalancerDetails(input.AwsElbv2LoadBalancer, context), - }), - ...(input.AwsIamAccessKey !== undefined && { - AwsIamAccessKey: serializeAws_restJson1AwsIamAccessKeyDetails(input.AwsIamAccessKey, context), - }), - ...(input.AwsIamGroup !== undefined && { - AwsIamGroup: serializeAws_restJson1AwsIamGroupDetails(input.AwsIamGroup, context), - }), - ...(input.AwsIamPolicy !== undefined && { - AwsIamPolicy: serializeAws_restJson1AwsIamPolicyDetails(input.AwsIamPolicy, context), - }), - ...(input.AwsIamRole !== undefined && { - AwsIamRole: serializeAws_restJson1AwsIamRoleDetails(input.AwsIamRole, context), - }), - ...(input.AwsIamUser !== undefined && { - AwsIamUser: serializeAws_restJson1AwsIamUserDetails(input.AwsIamUser, context), - }), - ...(input.AwsKmsKey !== undefined && { - AwsKmsKey: serializeAws_restJson1AwsKmsKeyDetails(input.AwsKmsKey, context), - }), - ...(input.AwsLambdaFunction !== undefined && { - AwsLambdaFunction: serializeAws_restJson1AwsLambdaFunctionDetails(input.AwsLambdaFunction, context), - }), - ...(input.AwsLambdaLayerVersion !== undefined && { - AwsLambdaLayerVersion: serializeAws_restJson1AwsLambdaLayerVersionDetails(input.AwsLambdaLayerVersion, context), - }), - ...(input.AwsRdsDbCluster !== undefined && { - AwsRdsDbCluster: serializeAws_restJson1AwsRdsDbClusterDetails(input.AwsRdsDbCluster, context), - }), - ...(input.AwsRdsDbClusterSnapshot !== undefined && { - AwsRdsDbClusterSnapshot: serializeAws_restJson1AwsRdsDbClusterSnapshotDetails( - input.AwsRdsDbClusterSnapshot, - context - ), - }), - ...(input.AwsRdsDbInstance !== undefined && { - AwsRdsDbInstance: serializeAws_restJson1AwsRdsDbInstanceDetails(input.AwsRdsDbInstance, context), - }), - ...(input.AwsRdsDbSnapshot !== undefined && { - AwsRdsDbSnapshot: serializeAws_restJson1AwsRdsDbSnapshotDetails(input.AwsRdsDbSnapshot, context), - }), - ...(input.AwsRedshiftCluster !== undefined && { - AwsRedshiftCluster: serializeAws_restJson1AwsRedshiftClusterDetails(input.AwsRedshiftCluster, context), - }), - ...(input.AwsS3Bucket !== undefined && { - AwsS3Bucket: serializeAws_restJson1AwsS3BucketDetails(input.AwsS3Bucket, context), - }), - ...(input.AwsS3Object !== undefined && { - AwsS3Object: serializeAws_restJson1AwsS3ObjectDetails(input.AwsS3Object, context), - }), - ...(input.AwsSecretsManagerSecret !== undefined && { - AwsSecretsManagerSecret: serializeAws_restJson1AwsSecretsManagerSecretDetails( - input.AwsSecretsManagerSecret, - context - ), - }), - ...(input.AwsSnsTopic !== undefined && { - AwsSnsTopic: serializeAws_restJson1AwsSnsTopicDetails(input.AwsSnsTopic, context), - }), - ...(input.AwsSqsQueue !== undefined && { - AwsSqsQueue: serializeAws_restJson1AwsSqsQueueDetails(input.AwsSqsQueue, context), - }), - ...(input.AwsWafWebAcl !== undefined && { - AwsWafWebAcl: serializeAws_restJson1AwsWafWebAclDetails(input.AwsWafWebAcl, context), - }), - ...(input.Container !== undefined && { - Container: serializeAws_restJson1ContainerDetails(input.Container, context), - }), - ...(input.Other !== undefined && { Other: serializeAws_restJson1FieldMap(input.Other, context) }), + ...(input.AwsApiGatewayRestApi !== undefined && + input.AwsApiGatewayRestApi !== null && { + AwsApiGatewayRestApi: serializeAws_restJson1AwsApiGatewayRestApiDetails(input.AwsApiGatewayRestApi, context), + }), + ...(input.AwsApiGatewayStage !== undefined && + input.AwsApiGatewayStage !== null && { + AwsApiGatewayStage: serializeAws_restJson1AwsApiGatewayStageDetails(input.AwsApiGatewayStage, context), + }), + ...(input.AwsApiGatewayV2Api !== undefined && + input.AwsApiGatewayV2Api !== null && { + AwsApiGatewayV2Api: serializeAws_restJson1AwsApiGatewayV2ApiDetails(input.AwsApiGatewayV2Api, context), + }), + ...(input.AwsApiGatewayV2Stage !== undefined && + input.AwsApiGatewayV2Stage !== null && { + AwsApiGatewayV2Stage: serializeAws_restJson1AwsApiGatewayV2StageDetails(input.AwsApiGatewayV2Stage, context), + }), + ...(input.AwsAutoScalingAutoScalingGroup !== undefined && + input.AwsAutoScalingAutoScalingGroup !== null && { + AwsAutoScalingAutoScalingGroup: serializeAws_restJson1AwsAutoScalingAutoScalingGroupDetails( + input.AwsAutoScalingAutoScalingGroup, + context + ), + }), + ...(input.AwsCertificateManagerCertificate !== undefined && + input.AwsCertificateManagerCertificate !== null && { + AwsCertificateManagerCertificate: serializeAws_restJson1AwsCertificateManagerCertificateDetails( + input.AwsCertificateManagerCertificate, + context + ), + }), + ...(input.AwsCloudFrontDistribution !== undefined && + input.AwsCloudFrontDistribution !== null && { + AwsCloudFrontDistribution: serializeAws_restJson1AwsCloudFrontDistributionDetails( + input.AwsCloudFrontDistribution, + context + ), + }), + ...(input.AwsCloudTrailTrail !== undefined && + input.AwsCloudTrailTrail !== null && { + AwsCloudTrailTrail: serializeAws_restJson1AwsCloudTrailTrailDetails(input.AwsCloudTrailTrail, context), + }), + ...(input.AwsCodeBuildProject !== undefined && + input.AwsCodeBuildProject !== null && { + AwsCodeBuildProject: serializeAws_restJson1AwsCodeBuildProjectDetails(input.AwsCodeBuildProject, context), + }), + ...(input.AwsDynamoDbTable !== undefined && + input.AwsDynamoDbTable !== null && { + AwsDynamoDbTable: serializeAws_restJson1AwsDynamoDbTableDetails(input.AwsDynamoDbTable, context), + }), + ...(input.AwsEc2Eip !== undefined && + input.AwsEc2Eip !== null && { AwsEc2Eip: serializeAws_restJson1AwsEc2EipDetails(input.AwsEc2Eip, context) }), + ...(input.AwsEc2Instance !== undefined && + input.AwsEc2Instance !== null && { + AwsEc2Instance: serializeAws_restJson1AwsEc2InstanceDetails(input.AwsEc2Instance, context), + }), + ...(input.AwsEc2NetworkInterface !== undefined && + input.AwsEc2NetworkInterface !== null && { + AwsEc2NetworkInterface: serializeAws_restJson1AwsEc2NetworkInterfaceDetails( + input.AwsEc2NetworkInterface, + context + ), + }), + ...(input.AwsEc2SecurityGroup !== undefined && + input.AwsEc2SecurityGroup !== null && { + AwsEc2SecurityGroup: serializeAws_restJson1AwsEc2SecurityGroupDetails(input.AwsEc2SecurityGroup, context), + }), + ...(input.AwsEc2Volume !== undefined && + input.AwsEc2Volume !== null && { + AwsEc2Volume: serializeAws_restJson1AwsEc2VolumeDetails(input.AwsEc2Volume, context), + }), + ...(input.AwsEc2Vpc !== undefined && + input.AwsEc2Vpc !== null && { AwsEc2Vpc: serializeAws_restJson1AwsEc2VpcDetails(input.AwsEc2Vpc, context) }), + ...(input.AwsElasticsearchDomain !== undefined && + input.AwsElasticsearchDomain !== null && { + AwsElasticsearchDomain: serializeAws_restJson1AwsElasticsearchDomainDetails( + input.AwsElasticsearchDomain, + context + ), + }), + ...(input.AwsElbLoadBalancer !== undefined && + input.AwsElbLoadBalancer !== null && { + AwsElbLoadBalancer: serializeAws_restJson1AwsElbLoadBalancerDetails(input.AwsElbLoadBalancer, context), + }), + ...(input.AwsElbv2LoadBalancer !== undefined && + input.AwsElbv2LoadBalancer !== null && { + AwsElbv2LoadBalancer: serializeAws_restJson1AwsElbv2LoadBalancerDetails(input.AwsElbv2LoadBalancer, context), + }), + ...(input.AwsIamAccessKey !== undefined && + input.AwsIamAccessKey !== null && { + AwsIamAccessKey: serializeAws_restJson1AwsIamAccessKeyDetails(input.AwsIamAccessKey, context), + }), + ...(input.AwsIamGroup !== undefined && + input.AwsIamGroup !== null && { + AwsIamGroup: serializeAws_restJson1AwsIamGroupDetails(input.AwsIamGroup, context), + }), + ...(input.AwsIamPolicy !== undefined && + input.AwsIamPolicy !== null && { + AwsIamPolicy: serializeAws_restJson1AwsIamPolicyDetails(input.AwsIamPolicy, context), + }), + ...(input.AwsIamRole !== undefined && + input.AwsIamRole !== null && { AwsIamRole: serializeAws_restJson1AwsIamRoleDetails(input.AwsIamRole, context) }), + ...(input.AwsIamUser !== undefined && + input.AwsIamUser !== null && { AwsIamUser: serializeAws_restJson1AwsIamUserDetails(input.AwsIamUser, context) }), + ...(input.AwsKmsKey !== undefined && + input.AwsKmsKey !== null && { AwsKmsKey: serializeAws_restJson1AwsKmsKeyDetails(input.AwsKmsKey, context) }), + ...(input.AwsLambdaFunction !== undefined && + input.AwsLambdaFunction !== null && { + AwsLambdaFunction: serializeAws_restJson1AwsLambdaFunctionDetails(input.AwsLambdaFunction, context), + }), + ...(input.AwsLambdaLayerVersion !== undefined && + input.AwsLambdaLayerVersion !== null && { + AwsLambdaLayerVersion: serializeAws_restJson1AwsLambdaLayerVersionDetails(input.AwsLambdaLayerVersion, context), + }), + ...(input.AwsRdsDbCluster !== undefined && + input.AwsRdsDbCluster !== null && { + AwsRdsDbCluster: serializeAws_restJson1AwsRdsDbClusterDetails(input.AwsRdsDbCluster, context), + }), + ...(input.AwsRdsDbClusterSnapshot !== undefined && + input.AwsRdsDbClusterSnapshot !== null && { + AwsRdsDbClusterSnapshot: serializeAws_restJson1AwsRdsDbClusterSnapshotDetails( + input.AwsRdsDbClusterSnapshot, + context + ), + }), + ...(input.AwsRdsDbInstance !== undefined && + input.AwsRdsDbInstance !== null && { + AwsRdsDbInstance: serializeAws_restJson1AwsRdsDbInstanceDetails(input.AwsRdsDbInstance, context), + }), + ...(input.AwsRdsDbSnapshot !== undefined && + input.AwsRdsDbSnapshot !== null && { + AwsRdsDbSnapshot: serializeAws_restJson1AwsRdsDbSnapshotDetails(input.AwsRdsDbSnapshot, context), + }), + ...(input.AwsRedshiftCluster !== undefined && + input.AwsRedshiftCluster !== null && { + AwsRedshiftCluster: serializeAws_restJson1AwsRedshiftClusterDetails(input.AwsRedshiftCluster, context), + }), + ...(input.AwsS3Bucket !== undefined && + input.AwsS3Bucket !== null && { + AwsS3Bucket: serializeAws_restJson1AwsS3BucketDetails(input.AwsS3Bucket, context), + }), + ...(input.AwsS3Object !== undefined && + input.AwsS3Object !== null && { + AwsS3Object: serializeAws_restJson1AwsS3ObjectDetails(input.AwsS3Object, context), + }), + ...(input.AwsSecretsManagerSecret !== undefined && + input.AwsSecretsManagerSecret !== null && { + AwsSecretsManagerSecret: serializeAws_restJson1AwsSecretsManagerSecretDetails( + input.AwsSecretsManagerSecret, + context + ), + }), + ...(input.AwsSnsTopic !== undefined && + input.AwsSnsTopic !== null && { + AwsSnsTopic: serializeAws_restJson1AwsSnsTopicDetails(input.AwsSnsTopic, context), + }), + ...(input.AwsSqsQueue !== undefined && + input.AwsSqsQueue !== null && { + AwsSqsQueue: serializeAws_restJson1AwsSqsQueueDetails(input.AwsSqsQueue, context), + }), + ...(input.AwsWafWebAcl !== undefined && + input.AwsWafWebAcl !== null && { + AwsWafWebAcl: serializeAws_restJson1AwsWafWebAclDetails(input.AwsWafWebAcl, context), + }), + ...(input.Container !== undefined && + input.Container !== null && { Container: serializeAws_restJson1ContainerDetails(input.Container, context) }), + ...(input.Other !== undefined && + input.Other !== null && { Other: serializeAws_restJson1FieldMap(input.Other, context) }), }; }; const serializeAws_restJson1ResourceList = (input: Resource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Resource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Resource(entry, context); + }); }; const serializeAws_restJson1SecurityGroups = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Severity = (input: Severity, context: __SerdeContext): any => { return { - ...(input.Label !== undefined && { Label: input.Label }), - ...(input.Normalized !== undefined && { Normalized: input.Normalized }), - ...(input.Original !== undefined && { Original: input.Original }), - ...(input.Product !== undefined && { Product: input.Product }), + ...(input.Label !== undefined && input.Label !== null && { Label: input.Label }), + ...(input.Normalized !== undefined && input.Normalized !== null && { Normalized: input.Normalized }), + ...(input.Original !== undefined && input.Original !== null && { Original: input.Original }), + ...(input.Product !== undefined && input.Product !== null && { Product: input.Product }), }; }; const serializeAws_restJson1SeverityUpdate = (input: SeverityUpdate, context: __SerdeContext): any => { return { - ...(input.Label !== undefined && { Label: input.Label }), - ...(input.Normalized !== undefined && { Normalized: input.Normalized }), - ...(input.Product !== undefined && { Product: input.Product }), + ...(input.Label !== undefined && input.Label !== null && { Label: input.Label }), + ...(input.Normalized !== undefined && input.Normalized !== null && { Normalized: input.Normalized }), + ...(input.Product !== undefined && input.Product !== null && { Product: input.Product }), }; }; const serializeAws_restJson1SoftwarePackage = (input: SoftwarePackage, context: __SerdeContext): any => { return { - ...(input.Architecture !== undefined && { Architecture: input.Architecture }), - ...(input.Epoch !== undefined && { Epoch: input.Epoch }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Release !== undefined && { Release: input.Release }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Architecture !== undefined && input.Architecture !== null && { Architecture: input.Architecture }), + ...(input.Epoch !== undefined && input.Epoch !== null && { Epoch: input.Epoch }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Release !== undefined && input.Release !== null && { Release: input.Release }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_restJson1SoftwarePackageList = (input: SoftwarePackage[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SoftwarePackage(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SoftwarePackage(entry, context); + }); }; const serializeAws_restJson1SortCriteria = (input: SortCriterion[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SortCriterion(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SortCriterion(entry, context); + }); }; const serializeAws_restJson1SortCriterion = (input: SortCriterion, context: __SerdeContext): any => { return { - ...(input.Field !== undefined && { Field: input.Field }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.Field !== undefined && input.Field !== null && { Field: input.Field }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -9689,17 +10773,26 @@ const serializeAws_restJson1StandardsInputParameterMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1StandardsSubscriptionArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1StandardsSubscriptionRequest = ( @@ -9707,10 +10800,11 @@ const serializeAws_restJson1StandardsSubscriptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.StandardsArn !== undefined && { StandardsArn: input.StandardsArn }), - ...(input.StandardsInput !== undefined && { - StandardsInput: serializeAws_restJson1StandardsInputParameterMap(input.StandardsInput, context), - }), + ...(input.StandardsArn !== undefined && input.StandardsArn !== null && { StandardsArn: input.StandardsArn }), + ...(input.StandardsInput !== undefined && + input.StandardsInput !== null && { + StandardsInput: serializeAws_restJson1StandardsInputParameterMap(input.StandardsInput, context), + }), }; }; @@ -9718,53 +10812,84 @@ const serializeAws_restJson1StandardsSubscriptionRequests = ( input: StandardsSubscriptionRequest[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1StandardsSubscriptionRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1StandardsSubscriptionRequest(entry, context); + }); }; const serializeAws_restJson1StatusReason = (input: StatusReason, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ReasonCode !== undefined && { ReasonCode: input.ReasonCode }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ReasonCode !== undefined && input.ReasonCode !== null && { ReasonCode: input.ReasonCode }), }; }; const serializeAws_restJson1StatusReasonsList = (input: StatusReason[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1StatusReason(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1StatusReason(entry, context); + }); }; const serializeAws_restJson1StringFilter = (input: StringFilter, context: __SerdeContext): any => { return { - ...(input.Comparison !== undefined && { Comparison: input.Comparison }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Comparison !== undefined && input.Comparison !== null && { Comparison: input.Comparison }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1StringFilterList = (input: StringFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1StringFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1StringFilter(entry, context); + }); }; const serializeAws_restJson1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1ThreatIntelIndicator = (input: ThreatIntelIndicator, context: __SerdeContext): any => { return { - ...(input.Category !== undefined && { Category: input.Category }), - ...(input.LastObservedAt !== undefined && { LastObservedAt: input.LastObservedAt }), - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.SourceUrl !== undefined && { SourceUrl: input.SourceUrl }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Category !== undefined && input.Category !== null && { Category: input.Category }), + ...(input.LastObservedAt !== undefined && + input.LastObservedAt !== null && { LastObservedAt: input.LastObservedAt }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.SourceUrl !== undefined && input.SourceUrl !== null && { SourceUrl: input.SourceUrl }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -9772,75 +10897,111 @@ const serializeAws_restJson1ThreatIntelIndicatorList = ( input: ThreatIntelIndicator[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ThreatIntelIndicator(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ThreatIntelIndicator(entry, context); + }); }; const serializeAws_restJson1TypeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Vulnerability = (input: Vulnerability, context: __SerdeContext): any => { return { - ...(input.Cvss !== undefined && { Cvss: serializeAws_restJson1CvssList(input.Cvss, context) }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.ReferenceUrls !== undefined && { - ReferenceUrls: serializeAws_restJson1StringList(input.ReferenceUrls, context), - }), - ...(input.RelatedVulnerabilities !== undefined && { - RelatedVulnerabilities: serializeAws_restJson1StringList(input.RelatedVulnerabilities, context), - }), - ...(input.Vendor !== undefined && { Vendor: serializeAws_restJson1VulnerabilityVendor(input.Vendor, context) }), - ...(input.VulnerablePackages !== undefined && { - VulnerablePackages: serializeAws_restJson1SoftwarePackageList(input.VulnerablePackages, context), - }), + ...(input.Cvss !== undefined && + input.Cvss !== null && { Cvss: serializeAws_restJson1CvssList(input.Cvss, context) }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.ReferenceUrls !== undefined && + input.ReferenceUrls !== null && { + ReferenceUrls: serializeAws_restJson1StringList(input.ReferenceUrls, context), + }), + ...(input.RelatedVulnerabilities !== undefined && + input.RelatedVulnerabilities !== null && { + RelatedVulnerabilities: serializeAws_restJson1StringList(input.RelatedVulnerabilities, context), + }), + ...(input.Vendor !== undefined && + input.Vendor !== null && { Vendor: serializeAws_restJson1VulnerabilityVendor(input.Vendor, context) }), + ...(input.VulnerablePackages !== undefined && + input.VulnerablePackages !== null && { + VulnerablePackages: serializeAws_restJson1SoftwarePackageList(input.VulnerablePackages, context), + }), }; }; const serializeAws_restJson1VulnerabilityList = (input: Vulnerability[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Vulnerability(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Vulnerability(entry, context); + }); }; const serializeAws_restJson1VulnerabilityVendor = (input: VulnerabilityVendor, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Url !== undefined && { Url: input.Url }), - ...(input.VendorCreatedAt !== undefined && { VendorCreatedAt: input.VendorCreatedAt }), - ...(input.VendorSeverity !== undefined && { VendorSeverity: input.VendorSeverity }), - ...(input.VendorUpdatedAt !== undefined && { VendorUpdatedAt: input.VendorUpdatedAt }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), + ...(input.VendorCreatedAt !== undefined && + input.VendorCreatedAt !== null && { VendorCreatedAt: input.VendorCreatedAt }), + ...(input.VendorSeverity !== undefined && + input.VendorSeverity !== null && { VendorSeverity: input.VendorSeverity }), + ...(input.VendorUpdatedAt !== undefined && + input.VendorUpdatedAt !== null && { VendorUpdatedAt: input.VendorUpdatedAt }), }; }; const serializeAws_restJson1WafAction = (input: WafAction, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1WafExcludedRule = (input: WafExcludedRule, context: __SerdeContext): any => { return { - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; const serializeAws_restJson1WafExcludedRuleList = (input: WafExcludedRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1WafExcludedRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1WafExcludedRule(entry, context); + }); }; const serializeAws_restJson1WafOverrideAction = (input: WafOverrideAction, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1Workflow = (input: Workflow, context: __SerdeContext): any => { return { - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; const serializeAws_restJson1WorkflowUpdate = (input: WorkflowUpdate, context: __SerdeContext): any => { return { - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -9854,7 +11015,14 @@ const deserializeAws_restJson1ActionTarget = (output: any, context: __SerdeConte }; const deserializeAws_restJson1ActionTargetList = (output: any, context: __SerdeContext): ActionTarget[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ActionTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ActionTarget(entry, context); + }); }; const deserializeAws_restJson1AdminAccount = (output: any, context: __SerdeContext): AdminAccount => { @@ -9865,7 +11033,14 @@ const deserializeAws_restJson1AdminAccount = (output: any, context: __SerdeConte }; const deserializeAws_restJson1AdminAccounts = (output: any, context: __SerdeContext): AdminAccount[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AdminAccount(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AdminAccount(entry, context); + }); }; const deserializeAws_restJson1AvailabilityZone = (output: any, context: __SerdeContext): AvailabilityZone => { @@ -9876,7 +11051,14 @@ const deserializeAws_restJson1AvailabilityZone = (output: any, context: __SerdeC }; const deserializeAws_restJson1AvailabilityZones = (output: any, context: __SerdeContext): AvailabilityZone[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AvailabilityZone(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AvailabilityZone(entry, context); + }); }; const deserializeAws_restJson1AwsApiGatewayAccessLogSettings = ( @@ -9965,7 +11147,14 @@ const deserializeAws_restJson1AwsApiGatewayMethodSettingsList = ( output: any, context: __SerdeContext ): AwsApiGatewayMethodSettings[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsApiGatewayMethodSettings(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsApiGatewayMethodSettings(entry, context); + }); }; const deserializeAws_restJson1AwsApiGatewayRestApiDetails = ( @@ -10249,9 +11438,14 @@ const deserializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOp output: any, context: __SerdeContext ): AwsCertificateManagerCertificateDomainValidationOption[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOption(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsCertificateManagerCertificateDomainValidationOption(entry, context); + }); }; const deserializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsage = ( @@ -10268,9 +11462,14 @@ const deserializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsages output: any, context: __SerdeContext ): AwsCertificateManagerCertificateExtendedKeyUsage[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsage(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsCertificateManagerCertificateExtendedKeyUsage(entry, context); + }); }; const deserializeAws_restJson1AwsCertificateManagerCertificateKeyUsage = ( @@ -10286,9 +11485,14 @@ const deserializeAws_restJson1AwsCertificateManagerCertificateKeyUsages = ( output: any, context: __SerdeContext ): AwsCertificateManagerCertificateKeyUsage[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsCertificateManagerCertificateKeyUsage(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsCertificateManagerCertificateKeyUsage(entry, context); + }); }; const deserializeAws_restJson1AwsCertificateManagerCertificateOptions = ( @@ -10365,9 +11569,14 @@ const deserializeAws_restJson1AwsCloudFrontDistributionCacheBehaviorsItemList = output: any, context: __SerdeContext ): AwsCloudFrontDistributionCacheBehavior[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsCloudFrontDistributionCacheBehavior(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsCloudFrontDistributionCacheBehavior(entry, context); + }); }; const deserializeAws_restJson1AwsCloudFrontDistributionDefaultCacheBehavior = ( @@ -10474,7 +11683,14 @@ const deserializeAws_restJson1AwsCloudFrontDistributionOriginGroupFailoverStatus output: any, context: __SerdeContext ): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AwsCloudFrontDistributionOriginGroups = ( @@ -10493,9 +11709,14 @@ const deserializeAws_restJson1AwsCloudFrontDistributionOriginGroupsItemList = ( output: any, context: __SerdeContext ): AwsCloudFrontDistributionOriginGroup[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsCloudFrontDistributionOriginGroup(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsCloudFrontDistributionOriginGroup(entry, context); + }); }; const deserializeAws_restJson1AwsCloudFrontDistributionOriginItem = ( @@ -10517,9 +11738,14 @@ const deserializeAws_restJson1AwsCloudFrontDistributionOriginItemList = ( output: any, context: __SerdeContext ): AwsCloudFrontDistributionOriginItem[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsCloudFrontDistributionOriginItem(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsCloudFrontDistributionOriginItem(entry, context); + }); }; const deserializeAws_restJson1AwsCloudFrontDistributionOrigins = ( @@ -10715,9 +11941,14 @@ const deserializeAws_restJson1AwsDynamoDbTableAttributeDefinitionList = ( output: any, context: __SerdeContext ): AwsDynamoDbTableAttributeDefinition[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsDynamoDbTableAttributeDefinition(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsDynamoDbTableAttributeDefinition(entry, context); + }); }; const deserializeAws_restJson1AwsDynamoDbTableBillingModeSummary = ( @@ -10830,9 +12061,14 @@ const deserializeAws_restJson1AwsDynamoDbTableGlobalSecondaryIndexList = ( output: any, context: __SerdeContext ): AwsDynamoDbTableGlobalSecondaryIndex[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsDynamoDbTableGlobalSecondaryIndex(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsDynamoDbTableGlobalSecondaryIndex(entry, context); + }); }; const deserializeAws_restJson1AwsDynamoDbTableKeySchema = ( @@ -10850,7 +12086,14 @@ const deserializeAws_restJson1AwsDynamoDbTableKeySchemaList = ( output: any, context: __SerdeContext ): AwsDynamoDbTableKeySchema[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsDynamoDbTableKeySchema(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsDynamoDbTableKeySchema(entry, context); + }); }; const deserializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndex = ( @@ -10875,9 +12118,14 @@ const deserializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndexList = ( output: any, context: __SerdeContext ): AwsDynamoDbTableLocalSecondaryIndex[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndex(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsDynamoDbTableLocalSecondaryIndex(entry, context); + }); }; const deserializeAws_restJson1AwsDynamoDbTableProjection = ( @@ -10985,16 +12233,28 @@ const deserializeAws_restJson1AwsDynamoDbTableReplicaGlobalSecondaryIndexList = output: any, context: __SerdeContext ): AwsDynamoDbTableReplicaGlobalSecondaryIndex[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsDynamoDbTableReplicaGlobalSecondaryIndex(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsDynamoDbTableReplicaGlobalSecondaryIndex(entry, context); + }); }; const deserializeAws_restJson1AwsDynamoDbTableReplicaList = ( output: any, context: __SerdeContext ): AwsDynamoDbTableReplica[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsDynamoDbTableReplica(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsDynamoDbTableReplica(entry, context); + }); }; const deserializeAws_restJson1AwsDynamoDbTableRestoreSummary = ( @@ -11148,9 +12408,14 @@ const deserializeAws_restJson1AwsEc2NetworkInterfaceSecurityGroupList = ( output: any, context: __SerdeContext ): AwsEc2NetworkInterfaceSecurityGroup[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsEc2NetworkInterfaceSecurityGroup(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsEc2NetworkInterfaceSecurityGroup(entry, context); + }); }; const deserializeAws_restJson1AwsEc2SecurityGroupDetails = ( @@ -11204,7 +12469,14 @@ const deserializeAws_restJson1AwsEc2SecurityGroupIpPermissionList = ( output: any, context: __SerdeContext ): AwsEc2SecurityGroupIpPermission[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsEc2SecurityGroupIpPermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsEc2SecurityGroupIpPermission(entry, context); + }); }; const deserializeAws_restJson1AwsEc2SecurityGroupIpRange = ( @@ -11220,7 +12492,14 @@ const deserializeAws_restJson1AwsEc2SecurityGroupIpRangeList = ( output: any, context: __SerdeContext ): AwsEc2SecurityGroupIpRange[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsEc2SecurityGroupIpRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsEc2SecurityGroupIpRange(entry, context); + }); }; const deserializeAws_restJson1AwsEc2SecurityGroupIpv6Range = ( @@ -11236,7 +12515,14 @@ const deserializeAws_restJson1AwsEc2SecurityGroupIpv6RangeList = ( output: any, context: __SerdeContext ): AwsEc2SecurityGroupIpv6Range[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsEc2SecurityGroupIpv6Range(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsEc2SecurityGroupIpv6Range(entry, context); + }); }; const deserializeAws_restJson1AwsEc2SecurityGroupPrefixListId = ( @@ -11252,7 +12538,14 @@ const deserializeAws_restJson1AwsEc2SecurityGroupPrefixListIdList = ( output: any, context: __SerdeContext ): AwsEc2SecurityGroupPrefixListId[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsEc2SecurityGroupPrefixListId(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsEc2SecurityGroupPrefixListId(entry, context); + }); }; const deserializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPair = ( @@ -11277,7 +12570,14 @@ const deserializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPairList = ( output: any, context: __SerdeContext ): AwsEc2SecurityGroupUserIdGroupPair[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPair(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsEc2SecurityGroupUserIdGroupPair(entry, context); + }); }; const deserializeAws_restJson1AwsEc2VolumeAttachment = ( @@ -11299,7 +12599,14 @@ const deserializeAws_restJson1AwsEc2VolumeAttachmentList = ( output: any, context: __SerdeContext ): AwsEc2VolumeAttachment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsEc2VolumeAttachment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsEc2VolumeAttachment(entry, context); + }); }; const deserializeAws_restJson1AwsEc2VolumeDetails = (output: any, context: __SerdeContext): AwsEc2VolumeDetails => { @@ -11430,7 +12737,14 @@ const deserializeAws_restJson1AwsElbAppCookieStickinessPolicies = ( output: any, context: __SerdeContext ): AwsElbAppCookieStickinessPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsElbAppCookieStickinessPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsElbAppCookieStickinessPolicy(entry, context); + }); }; const deserializeAws_restJson1AwsElbAppCookieStickinessPolicy = ( @@ -11447,7 +12761,14 @@ const deserializeAws_restJson1AwsElbLbCookieStickinessPolicies = ( output: any, context: __SerdeContext ): AwsElbLbCookieStickinessPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsElbLbCookieStickinessPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsElbLbCookieStickinessPolicy(entry, context); + }); }; const deserializeAws_restJson1AwsElbLbCookieStickinessPolicy = ( @@ -11517,9 +12838,14 @@ const deserializeAws_restJson1AwsElbLoadBalancerBackendServerDescriptions = ( output: any, context: __SerdeContext ): AwsElbLoadBalancerBackendServerDescription[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsElbLoadBalancerBackendServerDescription(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsElbLoadBalancerBackendServerDescription(entry, context); + }); }; const deserializeAws_restJson1AwsElbLoadBalancerConnectionDraining = ( @@ -11642,7 +12968,14 @@ const deserializeAws_restJson1AwsElbLoadBalancerInstances = ( output: any, context: __SerdeContext ): AwsElbLoadBalancerInstance[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsElbLoadBalancerInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsElbLoadBalancerInstance(entry, context); + }); }; const deserializeAws_restJson1AwsElbLoadBalancerListener = ( @@ -11681,9 +13014,14 @@ const deserializeAws_restJson1AwsElbLoadBalancerListenerDescriptions = ( output: any, context: __SerdeContext ): AwsElbLoadBalancerListenerDescription[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsElbLoadBalancerListenerDescription(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsElbLoadBalancerListenerDescription(entry, context); + }); }; const deserializeAws_restJson1AwsElbLoadBalancerPolicies = ( @@ -11823,7 +13161,14 @@ const deserializeAws_restJson1AwsIamAttachedManagedPolicyList = ( output: any, context: __SerdeContext ): AwsIamAttachedManagedPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsIamAttachedManagedPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsIamAttachedManagedPolicy(entry, context); + }); }; const deserializeAws_restJson1AwsIamGroupDetails = (output: any, context: __SerdeContext): AwsIamGroupDetails => { @@ -11850,7 +13195,14 @@ const deserializeAws_restJson1AwsIamGroupPolicy = (output: any, context: __Serde }; const deserializeAws_restJson1AwsIamGroupPolicyList = (output: any, context: __SerdeContext): AwsIamGroupPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsIamGroupPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsIamGroupPolicy(entry, context); + }); }; const deserializeAws_restJson1AwsIamInstanceProfile = (output: any, context: __SerdeContext): AwsIamInstanceProfile => { @@ -11877,7 +13229,14 @@ const deserializeAws_restJson1AwsIamInstanceProfileList = ( output: any, context: __SerdeContext ): AwsIamInstanceProfile[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsIamInstanceProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsIamInstanceProfile(entry, context); + }); }; const deserializeAws_restJson1AwsIamInstanceProfileRole = ( @@ -11901,7 +13260,14 @@ const deserializeAws_restJson1AwsIamInstanceProfileRoles = ( output: any, context: __SerdeContext ): AwsIamInstanceProfileRole[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsIamInstanceProfileRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsIamInstanceProfileRole(entry, context); + }); }; const deserializeAws_restJson1AwsIamPermissionsBoundary = ( @@ -11957,7 +13323,14 @@ const deserializeAws_restJson1AwsIamPolicyVersionList = ( output: any, context: __SerdeContext ): AwsIamPolicyVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsIamPolicyVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsIamPolicyVersion(entry, context); + }); }; const deserializeAws_restJson1AwsIamRoleDetails = (output: any, context: __SerdeContext): AwsIamRoleDetails => { @@ -12000,7 +13373,14 @@ const deserializeAws_restJson1AwsIamRolePolicy = (output: any, context: __SerdeC }; const deserializeAws_restJson1AwsIamRolePolicyList = (output: any, context: __SerdeContext): AwsIamRolePolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsIamRolePolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsIamRolePolicy(entry, context); + }); }; const deserializeAws_restJson1AwsIamUserDetails = (output: any, context: __SerdeContext): AwsIamUserDetails => { @@ -12035,7 +13415,14 @@ const deserializeAws_restJson1AwsIamUserPolicy = (output: any, context: __SerdeC }; const deserializeAws_restJson1AwsIamUserPolicyList = (output: any, context: __SerdeContext): AwsIamUserPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsIamUserPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsIamUserPolicy(entry, context); + }); }; const deserializeAws_restJson1AwsKmsKeyDetails = (output: any, context: __SerdeContext): AwsKmsKeyDetails => { @@ -12153,7 +13540,14 @@ const deserializeAws_restJson1AwsLambdaFunctionLayerList = ( output: any, context: __SerdeContext ): AwsLambdaFunctionLayer[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsLambdaFunctionLayer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsLambdaFunctionLayer(entry, context); + }); }; const deserializeAws_restJson1AwsLambdaFunctionTracingConfig = ( @@ -12210,7 +13604,14 @@ const deserializeAws_restJson1AwsRdsDbClusterAssociatedRoles = ( output: any, context: __SerdeContext ): AwsRdsDbClusterAssociatedRole[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbClusterAssociatedRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbClusterAssociatedRole(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbClusterDetails = ( @@ -12351,7 +13752,14 @@ const deserializeAws_restJson1AwsRdsDbClusterMembers = ( output: any, context: __SerdeContext ): AwsRdsDbClusterMember[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbClusterMember(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbClusterMember(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbClusterOptionGroupMembership = ( @@ -12371,9 +13779,14 @@ const deserializeAws_restJson1AwsRdsDbClusterOptionGroupMemberships = ( output: any, context: __SerdeContext ): AwsRdsDbClusterOptionGroupMembership[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsRdsDbClusterOptionGroupMembership(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbClusterOptionGroupMembership(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbClusterSnapshotDetails = ( @@ -12441,7 +13854,14 @@ const deserializeAws_restJson1AwsRdsDbDomainMemberships = ( output: any, context: __SerdeContext ): AwsRdsDbDomainMembership[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbDomainMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbDomainMembership(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbInstanceAssociatedRole = ( @@ -12459,7 +13879,14 @@ const deserializeAws_restJson1AwsRdsDbInstanceAssociatedRoles = ( output: any, context: __SerdeContext ): AwsRdsDbInstanceAssociatedRole[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbInstanceAssociatedRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbInstanceAssociatedRole(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbInstanceDetails = ( @@ -12679,7 +14106,14 @@ const deserializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroups = ( output: any, context: __SerdeContext ): AwsRdsDbInstanceVpcSecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbInstanceVpcSecurityGroup(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbOptionGroupMembership = ( @@ -12697,7 +14131,14 @@ const deserializeAws_restJson1AwsRdsDbOptionGroupMemberships = ( output: any, context: __SerdeContext ): AwsRdsDbOptionGroupMembership[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbOptionGroupMembership(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbOptionGroupMembership(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbParameterGroup = ( @@ -12720,7 +14161,14 @@ const deserializeAws_restJson1AwsRdsDbParameterGroups = ( output: any, context: __SerdeContext ): AwsRdsDbParameterGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbParameterGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbParameterGroup(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbPendingModifiedValues = ( @@ -12784,7 +14232,14 @@ const deserializeAws_restJson1AwsRdsDbProcessorFeatures = ( output: any, context: __SerdeContext ): AwsRdsDbProcessorFeature[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbProcessorFeature(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbProcessorFeature(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbSnapshotDetails = ( @@ -12861,7 +14316,14 @@ const deserializeAws_restJson1AwsRdsDbStatusInfo = (output: any, context: __Serd }; const deserializeAws_restJson1AwsRdsDbStatusInfos = (output: any, context: __SerdeContext): AwsRdsDbStatusInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbStatusInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbStatusInfo(entry, context); + }); }; const deserializeAws_restJson1AwsRdsDbSubnetGroup = (output: any, context: __SerdeContext): AwsRdsDbSubnetGroup => { @@ -12916,7 +14378,14 @@ const deserializeAws_restJson1AwsRdsDbSubnetGroupSubnets = ( output: any, context: __SerdeContext ): AwsRdsDbSubnetGroupSubnet[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRdsDbSubnetGroupSubnet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRdsDbSubnetGroupSubnet(entry, context); + }); }; const deserializeAws_restJson1AwsRdsPendingCloudWatchLogsExports = ( @@ -12952,7 +14421,14 @@ const deserializeAws_restJson1AwsRedshiftClusterClusterNodes = ( output: any, context: __SerdeContext ): AwsRedshiftClusterClusterNode[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRedshiftClusterClusterNode(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRedshiftClusterClusterNode(entry, context); + }); }; const deserializeAws_restJson1AwsRedshiftClusterClusterParameterGroup = ( @@ -12982,9 +14458,14 @@ const deserializeAws_restJson1AwsRedshiftClusterClusterParameterGroups = ( output: any, context: __SerdeContext ): AwsRedshiftClusterClusterParameterGroup[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsRedshiftClusterClusterParameterGroup(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRedshiftClusterClusterParameterGroup(entry, context); + }); }; const deserializeAws_restJson1AwsRedshiftClusterClusterParameterStatus = ( @@ -13009,9 +14490,14 @@ const deserializeAws_restJson1AwsRedshiftClusterClusterParameterStatusList = ( output: any, context: __SerdeContext ): AwsRedshiftClusterClusterParameterStatus[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsRedshiftClusterClusterParameterStatus(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRedshiftClusterClusterParameterStatus(entry, context); + }); }; const deserializeAws_restJson1AwsRedshiftClusterClusterSecurityGroup = ( @@ -13031,9 +14517,14 @@ const deserializeAws_restJson1AwsRedshiftClusterClusterSecurityGroups = ( output: any, context: __SerdeContext ): AwsRedshiftClusterClusterSecurityGroup[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsRedshiftClusterClusterSecurityGroup(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRedshiftClusterClusterSecurityGroup(entry, context); + }); }; const deserializeAws_restJson1AwsRedshiftClusterClusterSnapshotCopyStatus = ( @@ -13082,9 +14573,14 @@ const deserializeAws_restJson1AwsRedshiftClusterDeferredMaintenanceWindows = ( output: any, context: __SerdeContext ): AwsRedshiftClusterDeferredMaintenanceWindow[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsRedshiftClusterDeferredMaintenanceWindow(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRedshiftClusterDeferredMaintenanceWindow(entry, context); + }); }; const deserializeAws_restJson1AwsRedshiftClusterDetails = ( @@ -13295,7 +14791,14 @@ const deserializeAws_restJson1AwsRedshiftClusterIamRoles = ( output: any, context: __SerdeContext ): AwsRedshiftClusterIamRole[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRedshiftClusterIamRole(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRedshiftClusterIamRole(entry, context); + }); }; const deserializeAws_restJson1AwsRedshiftClusterPendingModifiedValues = ( @@ -13398,7 +14901,14 @@ const deserializeAws_restJson1AwsRedshiftClusterVpcSecurityGroups = ( output: any, context: __SerdeContext ): AwsRedshiftClusterVpcSecurityGroup[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsRedshiftClusterVpcSecurityGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsRedshiftClusterVpcSecurityGroup(entry, context); + }); }; const deserializeAws_restJson1AwsS3BucketDetails = (output: any, context: __SerdeContext): AwsS3BucketDetails => { @@ -13458,9 +14968,14 @@ const deserializeAws_restJson1AwsS3BucketServerSideEncryptionRules = ( output: any, context: __SerdeContext ): AwsS3BucketServerSideEncryptionRule[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1AwsS3BucketServerSideEncryptionRule(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsS3BucketServerSideEncryptionRule(entry, context); + }); }; const deserializeAws_restJson1AwsS3ObjectDetails = (output: any, context: __SerdeContext): AwsS3ObjectDetails => { @@ -13971,11 +15486,25 @@ const deserializeAws_restJson1AwsSecurityFindingIdentifierList = ( output: any, context: __SerdeContext ): AwsSecurityFindingIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsSecurityFindingIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsSecurityFindingIdentifier(entry, context); + }); }; const deserializeAws_restJson1AwsSecurityFindingList = (output: any, context: __SerdeContext): AwsSecurityFinding[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsSecurityFinding(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsSecurityFinding(entry, context); + }); }; const deserializeAws_restJson1AwsSnsTopicDetails = (output: any, context: __SerdeContext): AwsSnsTopicDetails => { @@ -14005,7 +15534,14 @@ const deserializeAws_restJson1AwsSnsTopicSubscriptionList = ( output: any, context: __SerdeContext ): AwsSnsTopicSubscription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsSnsTopicSubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsSnsTopicSubscription(entry, context); + }); }; const deserializeAws_restJson1AwsSqsQueueDetails = (output: any, context: __SerdeContext): AwsSqsQueueDetails => { @@ -14058,7 +15594,14 @@ const deserializeAws_restJson1AwsWafWebAclRule = (output: any, context: __SerdeC }; const deserializeAws_restJson1AwsWafWebAclRuleList = (output: any, context: __SerdeContext): AwsWafWebAclRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AwsWafWebAclRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AwsWafWebAclRule(entry, context); + }); }; const deserializeAws_restJson1BatchUpdateFindingsUnprocessedFinding = ( @@ -14079,13 +15622,25 @@ const deserializeAws_restJson1BatchUpdateFindingsUnprocessedFindingsList = ( output: any, context: __SerdeContext ): BatchUpdateFindingsUnprocessedFinding[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1BatchUpdateFindingsUnprocessedFinding(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BatchUpdateFindingsUnprocessedFinding(entry, context); + }); }; const deserializeAws_restJson1CategoryList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1CidrBlockAssociation = (output: any, context: __SerdeContext): CidrBlockAssociation => { @@ -14102,7 +15657,14 @@ const deserializeAws_restJson1CidrBlockAssociationList = ( output: any, context: __SerdeContext ): CidrBlockAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CidrBlockAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CidrBlockAssociation(entry, context); + }); }; const deserializeAws_restJson1Compliance = (output: any, context: __SerdeContext): Compliance => { @@ -14137,7 +15699,14 @@ const deserializeAws_restJson1Cvss = (output: any, context: __SerdeContext): Cvs }; const deserializeAws_restJson1CvssList = (output: any, context: __SerdeContext): Cvss[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Cvss(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Cvss(entry, context); + }); }; const deserializeAws_restJson1DateFilter = (output: any, context: __SerdeContext): DateFilter => { @@ -14152,7 +15721,14 @@ const deserializeAws_restJson1DateFilter = (output: any, context: __SerdeContext }; const deserializeAws_restJson1DateFilterList = (output: any, context: __SerdeContext): DateFilter[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DateFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DateFilter(entry, context); + }); }; const deserializeAws_restJson1DateRange = (output: any, context: __SerdeContext): DateRange => { @@ -14163,13 +15739,15 @@ const deserializeAws_restJson1DateRange = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1FieldMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ImportFindingsError = (output: any, context: __SerdeContext): ImportFindingsError => { @@ -14184,7 +15762,14 @@ const deserializeAws_restJson1ImportFindingsErrorList = ( output: any, context: __SerdeContext ): ImportFindingsError[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ImportFindingsError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ImportFindingsError(entry, context); + }); }; const deserializeAws_restJson1Insight = (output: any, context: __SerdeContext): Insight => { @@ -14201,7 +15786,14 @@ const deserializeAws_restJson1Insight = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1InsightList = (output: any, context: __SerdeContext): Insight[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Insight(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Insight(entry, context); + }); }; const deserializeAws_restJson1InsightResults = (output: any, context: __SerdeContext): InsightResults => { @@ -14227,14 +15819,28 @@ const deserializeAws_restJson1InsightResultValue = (output: any, context: __Serd }; const deserializeAws_restJson1InsightResultValueList = (output: any, context: __SerdeContext): InsightResultValue[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InsightResultValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InsightResultValue(entry, context); + }); }; const deserializeAws_restJson1IntegrationTypeList = ( output: any, context: __SerdeContext ): (IntegrationType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Invitation = (output: any, context: __SerdeContext): Invitation => { @@ -14247,7 +15853,14 @@ const deserializeAws_restJson1Invitation = (output: any, context: __SerdeContext }; const deserializeAws_restJson1InvitationList = (output: any, context: __SerdeContext): Invitation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Invitation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Invitation(entry, context); + }); }; const deserializeAws_restJson1IpFilter = (output: any, context: __SerdeContext): IpFilter => { @@ -14257,7 +15870,14 @@ const deserializeAws_restJson1IpFilter = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1IpFilterList = (output: any, context: __SerdeContext): IpFilter[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IpFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IpFilter(entry, context); + }); }; const deserializeAws_restJson1Ipv6CidrBlockAssociation = ( @@ -14278,7 +15898,14 @@ const deserializeAws_restJson1Ipv6CidrBlockAssociationList = ( output: any, context: __SerdeContext ): Ipv6CidrBlockAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Ipv6CidrBlockAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Ipv6CidrBlockAssociation(entry, context); + }); }; const deserializeAws_restJson1KeywordFilter = (output: any, context: __SerdeContext): KeywordFilter => { @@ -14288,7 +15915,14 @@ const deserializeAws_restJson1KeywordFilter = (output: any, context: __SerdeCont }; const deserializeAws_restJson1KeywordFilterList = (output: any, context: __SerdeContext): KeywordFilter[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1KeywordFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1KeywordFilter(entry, context); + }); }; const deserializeAws_restJson1LoadBalancerState = (output: any, context: __SerdeContext): LoadBalancerState => { @@ -14308,7 +15942,14 @@ const deserializeAws_restJson1Malware = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1MalwareList = (output: any, context: __SerdeContext): Malware[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Malware(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Malware(entry, context); + }); }; const deserializeAws_restJson1MapFilter = (output: any, context: __SerdeContext): MapFilter => { @@ -14320,7 +15961,14 @@ const deserializeAws_restJson1MapFilter = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1MapFilterList = (output: any, context: __SerdeContext): MapFilter[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MapFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MapFilter(entry, context); + }); }; const deserializeAws_restJson1Member = (output: any, context: __SerdeContext): Member => { @@ -14335,7 +15983,14 @@ const deserializeAws_restJson1Member = (output: any, context: __SerdeContext): M }; const deserializeAws_restJson1MemberList = (output: any, context: __SerdeContext): Member[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Member(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Member(entry, context); + }); }; const deserializeAws_restJson1Network = (output: any, context: __SerdeContext): Network => { @@ -14411,11 +16066,25 @@ const deserializeAws_restJson1NetworkPathComponentDetails = ( }; const deserializeAws_restJson1NetworkPathList = (output: any, context: __SerdeContext): NetworkPathComponent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NetworkPathComponent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NetworkPathComponent(entry, context); + }); }; const deserializeAws_restJson1NonEmptyStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Note = (output: any, context: __SerdeContext): Note => { @@ -14435,7 +16104,14 @@ const deserializeAws_restJson1NumberFilter = (output: any, context: __SerdeConte }; const deserializeAws_restJson1NumberFilterList = (output: any, context: __SerdeContext): NumberFilter[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1NumberFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1NumberFilter(entry, context); + }); }; const deserializeAws_restJson1PatchSummary = (output: any, context: __SerdeContext): PatchSummary => { @@ -14476,7 +16152,14 @@ const deserializeAws_restJson1PortRange = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1PortRangeList = (output: any, context: __SerdeContext): PortRange[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PortRange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PortRange(entry, context); + }); }; const deserializeAws_restJson1ProcessDetails = (output: any, context: __SerdeContext): ProcessDetails => { @@ -14516,11 +16199,25 @@ const deserializeAws_restJson1Product = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1ProductsList = (output: any, context: __SerdeContext): Product[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Product(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Product(entry, context); + }); }; const deserializeAws_restJson1ProductSubscriptionArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Recommendation = (output: any, context: __SerdeContext): Recommendation => { @@ -14538,11 +16235,25 @@ const deserializeAws_restJson1RelatedFinding = (output: any, context: __SerdeCon }; const deserializeAws_restJson1RelatedFindingList = (output: any, context: __SerdeContext): RelatedFinding[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RelatedFinding(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RelatedFinding(entry, context); + }); }; const deserializeAws_restJson1RelatedRequirementsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Remediation = (output: any, context: __SerdeContext): Remediation => { @@ -14741,7 +16452,14 @@ const deserializeAws_restJson1ResourceDetails = (output: any, context: __SerdeCo }; const deserializeAws_restJson1ResourceList = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Resource(entry, context); + }); }; const deserializeAws_restJson1Result = (output: any, context: __SerdeContext): Result => { @@ -14753,11 +16471,25 @@ const deserializeAws_restJson1Result = (output: any, context: __SerdeContext): R }; const deserializeAws_restJson1ResultList = (output: any, context: __SerdeContext): Result[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Result(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Result(entry, context); + }); }; const deserializeAws_restJson1SecurityGroups = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Severity = (output: any, context: __SerdeContext): Severity => { @@ -14780,7 +16512,14 @@ const deserializeAws_restJson1SoftwarePackage = (output: any, context: __SerdeCo }; const deserializeAws_restJson1SoftwarePackageList = (output: any, context: __SerdeContext): SoftwarePackage[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SoftwarePackage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SoftwarePackage(entry, context); + }); }; const deserializeAws_restJson1Standard = (output: any, context: __SerdeContext): Standard => { @@ -14794,7 +16533,14 @@ const deserializeAws_restJson1Standard = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1Standards = (output: any, context: __SerdeContext): Standard[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Standard(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Standard(entry, context); + }); }; const deserializeAws_restJson1StandardsControl = (output: any, context: __SerdeContext): StandardsControl => { @@ -14826,20 +16572,29 @@ const deserializeAws_restJson1StandardsControl = (output: any, context: __SerdeC }; const deserializeAws_restJson1StandardsControls = (output: any, context: __SerdeContext): StandardsControl[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StandardsControl(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StandardsControl(entry, context); + }); }; const deserializeAws_restJson1StandardsInputParameterMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1StandardsSubscription = (output: any, context: __SerdeContext): StandardsSubscription => { @@ -14862,7 +16617,14 @@ const deserializeAws_restJson1StandardsSubscriptions = ( output: any, context: __SerdeContext ): StandardsSubscription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StandardsSubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StandardsSubscription(entry, context); + }); }; const deserializeAws_restJson1StatusReason = (output: any, context: __SerdeContext): StatusReason => { @@ -14873,7 +16635,14 @@ const deserializeAws_restJson1StatusReason = (output: any, context: __SerdeConte }; const deserializeAws_restJson1StatusReasonsList = (output: any, context: __SerdeContext): StatusReason[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StatusReason(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StatusReason(entry, context); + }); }; const deserializeAws_restJson1StringFilter = (output: any, context: __SerdeContext): StringFilter => { @@ -14884,21 +16653,37 @@ const deserializeAws_restJson1StringFilter = (output: any, context: __SerdeConte }; const deserializeAws_restJson1StringFilterList = (output: any, context: __SerdeContext): StringFilter[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1StringFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1StringFilter(entry, context); + }); }; const deserializeAws_restJson1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ThreatIntelIndicator = (output: any, context: __SerdeContext): ThreatIntelIndicator => { @@ -14917,11 +16702,25 @@ const deserializeAws_restJson1ThreatIntelIndicatorList = ( output: any, context: __SerdeContext ): ThreatIntelIndicator[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ThreatIntelIndicator(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ThreatIntelIndicator(entry, context); + }); }; const deserializeAws_restJson1TypeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Vulnerability = (output: any, context: __SerdeContext): Vulnerability => { @@ -14951,7 +16750,14 @@ const deserializeAws_restJson1Vulnerability = (output: any, context: __SerdeCont }; const deserializeAws_restJson1VulnerabilityList = (output: any, context: __SerdeContext): Vulnerability[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Vulnerability(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Vulnerability(entry, context); + }); }; const deserializeAws_restJson1VulnerabilityVendor = (output: any, context: __SerdeContext): VulnerabilityVendor => { @@ -14980,7 +16786,14 @@ const deserializeAws_restJson1WafExcludedRule = (output: any, context: __SerdeCo }; const deserializeAws_restJson1WafExcludedRuleList = (output: any, context: __SerdeContext): WafExcludedRule[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1WafExcludedRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1WafExcludedRule(entry, context); + }); }; const deserializeAws_restJson1WafOverrideAction = (output: any, context: __SerdeContext): WafOverrideAction => { @@ -15015,6 +16828,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-serverlessapplicationrepository/protocols/Aws_restJson1.ts b/clients/client-serverlessapplicationrepository/protocols/Aws_restJson1.ts index 26c3f8108482..e1db79919ed9 100644 --- a/clients/client-serverlessapplicationrepository/protocols/Aws_restJson1.ts +++ b/clients/client-serverlessapplicationrepository/protocols/Aws_restJson1.ts @@ -72,26 +72,29 @@ export const serializeAws_restJson1CreateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications"; let body: any; body = JSON.stringify({ - ...(input.Author !== undefined && { author: input.Author }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.HomePageUrl !== undefined && { homePageUrl: input.HomePageUrl }), - ...(input.Labels !== undefined && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) }), - ...(input.LicenseBody !== undefined && { licenseBody: input.LicenseBody }), - ...(input.LicenseUrl !== undefined && { licenseUrl: input.LicenseUrl }), - ...(input.Name !== undefined && { name: input.Name }), - ...(input.ReadmeBody !== undefined && { readmeBody: input.ReadmeBody }), - ...(input.ReadmeUrl !== undefined && { readmeUrl: input.ReadmeUrl }), - ...(input.SemanticVersion !== undefined && { semanticVersion: input.SemanticVersion }), - ...(input.SourceCodeArchiveUrl !== undefined && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl }), - ...(input.SourceCodeUrl !== undefined && { sourceCodeUrl: input.SourceCodeUrl }), - ...(input.SpdxLicenseId !== undefined && { spdxLicenseId: input.SpdxLicenseId }), - ...(input.TemplateBody !== undefined && { templateBody: input.TemplateBody }), - ...(input.TemplateUrl !== undefined && { templateUrl: input.TemplateUrl }), + ...(input.Author !== undefined && input.Author !== null && { author: input.Author }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.HomePageUrl !== undefined && input.HomePageUrl !== null && { homePageUrl: input.HomePageUrl }), + ...(input.Labels !== undefined && + input.Labels !== null && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) }), + ...(input.LicenseBody !== undefined && input.LicenseBody !== null && { licenseBody: input.LicenseBody }), + ...(input.LicenseUrl !== undefined && input.LicenseUrl !== null && { licenseUrl: input.LicenseUrl }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.ReadmeBody !== undefined && input.ReadmeBody !== null && { readmeBody: input.ReadmeBody }), + ...(input.ReadmeUrl !== undefined && input.ReadmeUrl !== null && { readmeUrl: input.ReadmeUrl }), + ...(input.SemanticVersion !== undefined && + input.SemanticVersion !== null && { semanticVersion: input.SemanticVersion }), + ...(input.SourceCodeArchiveUrl !== undefined && + input.SourceCodeArchiveUrl !== null && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl }), + ...(input.SourceCodeUrl !== undefined && input.SourceCodeUrl !== null && { sourceCodeUrl: input.SourceCodeUrl }), + ...(input.SpdxLicenseId !== undefined && input.SpdxLicenseId !== null && { spdxLicenseId: input.SpdxLicenseId }), + ...(input.TemplateBody !== undefined && input.TemplateBody !== null && { templateBody: input.TemplateBody }), + ...(input.TemplateUrl !== undefined && input.TemplateUrl !== null && { templateUrl: input.TemplateUrl }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -110,7 +113,7 @@ export const serializeAws_restJson1CreateApplicationVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/versions/{SemanticVersion}"; if (input.ApplicationId !== undefined) { @@ -133,10 +136,11 @@ export const serializeAws_restJson1CreateApplicationVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.SourceCodeArchiveUrl !== undefined && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl }), - ...(input.SourceCodeUrl !== undefined && { sourceCodeUrl: input.SourceCodeUrl }), - ...(input.TemplateBody !== undefined && { templateBody: input.TemplateBody }), - ...(input.TemplateUrl !== undefined && { templateUrl: input.TemplateUrl }), + ...(input.SourceCodeArchiveUrl !== undefined && + input.SourceCodeArchiveUrl !== null && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl }), + ...(input.SourceCodeUrl !== undefined && input.SourceCodeUrl !== null && { sourceCodeUrl: input.SourceCodeUrl }), + ...(input.TemplateBody !== undefined && input.TemplateBody !== null && { templateBody: input.TemplateBody }), + ...(input.TemplateUrl !== undefined && input.TemplateUrl !== null && { templateUrl: input.TemplateUrl }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -155,7 +159,7 @@ export const serializeAws_restJson1CreateCloudFormationChangeSetCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/changesets"; if (input.ApplicationId !== undefined) { @@ -169,28 +173,35 @@ export const serializeAws_restJson1CreateCloudFormationChangeSetCommand = async } let body: any; body = JSON.stringify({ - ...(input.Capabilities !== undefined && { - capabilities: serializeAws_restJson1__listOf__string(input.Capabilities, context), - }), - ...(input.ChangeSetName !== undefined && { changeSetName: input.ChangeSetName }), - ...(input.ClientToken !== undefined && { clientToken: input.ClientToken }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.NotificationArns !== undefined && { - notificationArns: serializeAws_restJson1__listOf__string(input.NotificationArns, context), - }), - ...(input.ParameterOverrides !== undefined && { - parameterOverrides: serializeAws_restJson1__listOfParameterValue(input.ParameterOverrides, context), - }), - ...(input.ResourceTypes !== undefined && { - resourceTypes: serializeAws_restJson1__listOf__string(input.ResourceTypes, context), - }), - ...(input.RollbackConfiguration !== undefined && { - rollbackConfiguration: serializeAws_restJson1RollbackConfiguration(input.RollbackConfiguration, context), - }), - ...(input.SemanticVersion !== undefined && { semanticVersion: input.SemanticVersion }), - ...(input.StackName !== undefined && { stackName: input.StackName }), - ...(input.Tags !== undefined && { tags: serializeAws_restJson1__listOfTag(input.Tags, context) }), - ...(input.TemplateId !== undefined && { templateId: input.TemplateId }), + ...(input.Capabilities !== undefined && + input.Capabilities !== null && { + capabilities: serializeAws_restJson1__listOf__string(input.Capabilities, context), + }), + ...(input.ChangeSetName !== undefined && input.ChangeSetName !== null && { changeSetName: input.ChangeSetName }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { clientToken: input.ClientToken }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.NotificationArns !== undefined && + input.NotificationArns !== null && { + notificationArns: serializeAws_restJson1__listOf__string(input.NotificationArns, context), + }), + ...(input.ParameterOverrides !== undefined && + input.ParameterOverrides !== null && { + parameterOverrides: serializeAws_restJson1__listOfParameterValue(input.ParameterOverrides, context), + }), + ...(input.ResourceTypes !== undefined && + input.ResourceTypes !== null && { + resourceTypes: serializeAws_restJson1__listOf__string(input.ResourceTypes, context), + }), + ...(input.RollbackConfiguration !== undefined && + input.RollbackConfiguration !== null && { + rollbackConfiguration: serializeAws_restJson1RollbackConfiguration(input.RollbackConfiguration, context), + }), + ...(input.SemanticVersion !== undefined && + input.SemanticVersion !== null && { semanticVersion: input.SemanticVersion }), + ...(input.StackName !== undefined && input.StackName !== null && { stackName: input.StackName }), + ...(input.Tags !== undefined && + input.Tags !== null && { tags: serializeAws_restJson1__listOfTag(input.Tags, context) }), + ...(input.TemplateId !== undefined && input.TemplateId !== null && { templateId: input.TemplateId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -209,7 +220,7 @@ export const serializeAws_restJson1CreateCloudFormationTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/templates"; if (input.ApplicationId !== undefined) { @@ -223,7 +234,8 @@ export const serializeAws_restJson1CreateCloudFormationTemplateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.SemanticVersion !== undefined && { semanticVersion: input.SemanticVersion }), + ...(input.SemanticVersion !== undefined && + input.SemanticVersion !== null && { semanticVersion: input.SemanticVersion }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -241,9 +253,7 @@ export const serializeAws_restJson1DeleteApplicationCommand = async ( input: DeleteApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -271,9 +281,7 @@ export const serializeAws_restJson1GetApplicationCommand = async ( input: GetApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -305,9 +313,7 @@ export const serializeAws_restJson1GetApplicationPolicyCommand = async ( input: GetApplicationPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/policy"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -335,9 +341,7 @@ export const serializeAws_restJson1GetCloudFormationTemplateCommand = async ( input: GetCloudFormationTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/templates/{TemplateId}"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -374,9 +378,7 @@ export const serializeAws_restJson1ListApplicationDependenciesCommand = async ( input: ListApplicationDependenciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/dependencies"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -410,9 +412,7 @@ export const serializeAws_restJson1ListApplicationsCommand = async ( input: ListApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications"; const query: any = { ...(input.NextToken !== undefined && { nextToken: input.NextToken }), @@ -436,9 +436,7 @@ export const serializeAws_restJson1ListApplicationVersionsCommand = async ( input: ListApplicationVersionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{ApplicationId}/versions"; if (input.ApplicationId !== undefined) { const labelValue: string = input.ApplicationId; @@ -472,7 +470,7 @@ export const serializeAws_restJson1PutApplicationPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/policy"; if (input.ApplicationId !== undefined) { @@ -486,9 +484,10 @@ export const serializeAws_restJson1PutApplicationPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Statements !== undefined && { - statements: serializeAws_restJson1__listOfApplicationPolicyStatement(input.Statements, context), - }), + ...(input.Statements !== undefined && + input.Statements !== null && { + statements: serializeAws_restJson1__listOfApplicationPolicyStatement(input.Statements, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -507,7 +506,7 @@ export const serializeAws_restJson1UnshareApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}/unshare"; if (input.ApplicationId !== undefined) { @@ -521,7 +520,8 @@ export const serializeAws_restJson1UnshareApplicationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.OrganizationId !== undefined && { organizationId: input.OrganizationId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { organizationId: input.OrganizationId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -540,7 +540,7 @@ export const serializeAws_restJson1UpdateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{ApplicationId}"; if (input.ApplicationId !== undefined) { @@ -554,12 +554,13 @@ export const serializeAws_restJson1UpdateApplicationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Author !== undefined && { author: input.Author }), - ...(input.Description !== undefined && { description: input.Description }), - ...(input.HomePageUrl !== undefined && { homePageUrl: input.HomePageUrl }), - ...(input.Labels !== undefined && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) }), - ...(input.ReadmeBody !== undefined && { readmeBody: input.ReadmeBody }), - ...(input.ReadmeUrl !== undefined && { readmeUrl: input.ReadmeUrl }), + ...(input.Author !== undefined && input.Author !== null && { author: input.Author }), + ...(input.Description !== undefined && input.Description !== null && { description: input.Description }), + ...(input.HomePageUrl !== undefined && input.HomePageUrl !== null && { homePageUrl: input.HomePageUrl }), + ...(input.Labels !== undefined && + input.Labels !== null && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) }), + ...(input.ReadmeBody !== undefined && input.ReadmeBody !== null && { readmeBody: input.ReadmeBody }), + ...(input.ReadmeUrl !== undefined && input.ReadmeUrl !== null && { readmeUrl: input.ReadmeUrl }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2161,26 +2162,61 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async ( }; const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1__listOfApplicationPolicyStatement = ( input: ApplicationPolicyStatement[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1ApplicationPolicyStatement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ApplicationPolicyStatement(entry, context); + }); }; const serializeAws_restJson1__listOfParameterValue = (input: ParameterValue[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1ParameterValue(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1ParameterValue(entry, context); + }); }; const serializeAws_restJson1__listOfRollbackTrigger = (input: RollbackTrigger[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1RollbackTrigger(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1RollbackTrigger(entry, context); + }); }; const serializeAws_restJson1__listOfTag = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1ApplicationPolicyStatement = ( @@ -2188,85 +2224,137 @@ const serializeAws_restJson1ApplicationPolicyStatement = ( context: __SerdeContext ): any => { return { - ...(input.Actions !== undefined && { actions: serializeAws_restJson1__listOf__string(input.Actions, context) }), - ...(input.PrincipalOrgIDs !== undefined && { - principalOrgIDs: serializeAws_restJson1__listOf__string(input.PrincipalOrgIDs, context), - }), - ...(input.Principals !== undefined && { - principals: serializeAws_restJson1__listOf__string(input.Principals, context), - }), - ...(input.StatementId !== undefined && { statementId: input.StatementId }), + ...(input.Actions !== undefined && + input.Actions !== null && { actions: serializeAws_restJson1__listOf__string(input.Actions, context) }), + ...(input.PrincipalOrgIDs !== undefined && + input.PrincipalOrgIDs !== null && { + principalOrgIDs: serializeAws_restJson1__listOf__string(input.PrincipalOrgIDs, context), + }), + ...(input.Principals !== undefined && + input.Principals !== null && { principals: serializeAws_restJson1__listOf__string(input.Principals, context) }), + ...(input.StatementId !== undefined && input.StatementId !== null && { statementId: input.StatementId }), }; }; const serializeAws_restJson1ParameterValue = (input: ParameterValue, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { name: input.Name }), - ...(input.Value !== undefined && { value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { value: input.Value }), }; }; const serializeAws_restJson1RollbackConfiguration = (input: RollbackConfiguration, context: __SerdeContext): any => { return { - ...(input.MonitoringTimeInMinutes !== undefined && { monitoringTimeInMinutes: input.MonitoringTimeInMinutes }), - ...(input.RollbackTriggers !== undefined && { - rollbackTriggers: serializeAws_restJson1__listOfRollbackTrigger(input.RollbackTriggers, context), - }), + ...(input.MonitoringTimeInMinutes !== undefined && + input.MonitoringTimeInMinutes !== null && { monitoringTimeInMinutes: input.MonitoringTimeInMinutes }), + ...(input.RollbackTriggers !== undefined && + input.RollbackTriggers !== null && { + rollbackTriggers: serializeAws_restJson1__listOfRollbackTrigger(input.RollbackTriggers, context), + }), }; }; const serializeAws_restJson1RollbackTrigger = (input: RollbackTrigger, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { arn: input.Arn }), - ...(input.Type !== undefined && { type: input.Type }), + ...(input.Arn !== undefined && input.Arn !== null && { arn: input.Arn }), + ...(input.Type !== undefined && input.Type !== null && { type: input.Type }), }; }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { key: input.Key }), - ...(input.Value !== undefined && { value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { value: input.Value }), }; }; const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfApplicationDependencySummary = ( output: any, context: __SerdeContext ): ApplicationDependencySummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ApplicationDependencySummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ApplicationDependencySummary(entry, context); + }); }; const deserializeAws_restJson1__listOfApplicationPolicyStatement = ( output: any, context: __SerdeContext ): ApplicationPolicyStatement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ApplicationPolicyStatement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ApplicationPolicyStatement(entry, context); + }); }; const deserializeAws_restJson1__listOfApplicationSummary = ( output: any, context: __SerdeContext ): ApplicationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ApplicationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ApplicationSummary(entry, context); + }); }; const deserializeAws_restJson1__listOfCapability = (output: any, context: __SerdeContext): (Capability | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1__listOfParameterDefinition = ( output: any, context: __SerdeContext ): ParameterDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ParameterDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ParameterDefinition(entry, context); + }); }; const deserializeAws_restJson1__listOfVersionSummary = (output: any, context: __SerdeContext): VersionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1VersionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1VersionSummary(entry, context); + }); }; const deserializeAws_restJson1ApplicationDependencySummary = ( @@ -2409,6 +2497,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-service-catalog-appregistry/protocols/Aws_restJson1.ts b/clients/client-service-catalog-appregistry/protocols/Aws_restJson1.ts index 1e0a1f94d2c1..f54b37d371e5 100644 --- a/clients/client-service-catalog-appregistry/protocols/Aws_restJson1.ts +++ b/clients/client-service-catalog-appregistry/protocols/Aws_restJson1.ts @@ -76,9 +76,7 @@ export const serializeAws_restJson1AssociateAttributeGroupCommand = async ( input: AssociateAttributeGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{application}/attribute-groups/{attributeGroup}"; if (input.application !== undefined) { const labelValue: string = input.application; @@ -115,9 +113,7 @@ export const serializeAws_restJson1AssociateResourceCommand = async ( input: AssociateResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{application}/resources/{resourceType}/{resource}"; if (input.application !== undefined) { const labelValue: string = input.application; @@ -164,15 +160,15 @@ export const serializeAws_restJson1CreateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications"; let body: any; body = JSON.stringify({ clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -191,16 +187,16 @@ export const serializeAws_restJson1CreateAttributeGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/attribute-groups"; let body: any; body = JSON.stringify({ - ...(input.attributes !== undefined && { attributes: input.attributes }), + ...(input.attributes !== undefined && input.attributes !== null && { attributes: input.attributes }), clientToken: input.clientToken ?? generateIdempotencyToken(), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -218,9 +214,7 @@ export const serializeAws_restJson1DeleteApplicationCommand = async ( input: DeleteApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{application}"; if (input.application !== undefined) { const labelValue: string = input.application; @@ -248,9 +242,7 @@ export const serializeAws_restJson1DeleteAttributeGroupCommand = async ( input: DeleteAttributeGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/attribute-groups/{attributeGroup}"; if (input.attributeGroup !== undefined) { const labelValue: string = input.attributeGroup; @@ -278,9 +270,7 @@ export const serializeAws_restJson1DisassociateAttributeGroupCommand = async ( input: DisassociateAttributeGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{application}/attribute-groups/{attributeGroup}"; if (input.application !== undefined) { const labelValue: string = input.application; @@ -317,9 +307,7 @@ export const serializeAws_restJson1DisassociateResourceCommand = async ( input: DisassociateResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{application}/resources/{resourceType}/{resource}"; if (input.application !== undefined) { const labelValue: string = input.application; @@ -365,9 +353,7 @@ export const serializeAws_restJson1GetApplicationCommand = async ( input: GetApplicationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{application}"; if (input.application !== undefined) { const labelValue: string = input.application; @@ -395,9 +381,7 @@ export const serializeAws_restJson1GetAttributeGroupCommand = async ( input: GetAttributeGroupCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/attribute-groups/{attributeGroup}"; if (input.attributeGroup !== undefined) { const labelValue: string = input.attributeGroup; @@ -425,9 +409,7 @@ export const serializeAws_restJson1ListApplicationsCommand = async ( input: ListApplicationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -451,9 +433,7 @@ export const serializeAws_restJson1ListAssociatedAttributeGroupsCommand = async input: ListAssociatedAttributeGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{application}/attribute-groups"; if (input.application !== undefined) { const labelValue: string = input.application; @@ -486,9 +466,7 @@ export const serializeAws_restJson1ListAssociatedResourcesCommand = async ( input: ListAssociatedResourcesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/applications/{application}/resources"; if (input.application !== undefined) { const labelValue: string = input.application; @@ -521,9 +499,7 @@ export const serializeAws_restJson1ListAttributeGroupsCommand = async ( input: ListAttributeGroupsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/attribute-groups"; const query: any = { ...(input.nextToken !== undefined && { nextToken: input.nextToken }), @@ -547,9 +523,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -578,7 +552,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -592,7 +566,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1Tags(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -610,9 +584,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -645,7 +617,7 @@ export const serializeAws_restJson1UpdateApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/applications/{application}"; if (input.application !== undefined) { @@ -659,8 +631,8 @@ export const serializeAws_restJson1UpdateApplicationCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -679,7 +651,7 @@ export const serializeAws_restJson1UpdateAttributeGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/attribute-groups/{attributeGroup}"; if (input.attributeGroup !== undefined) { @@ -693,9 +665,9 @@ export const serializeAws_restJson1UpdateAttributeGroupCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.attributes !== undefined && { attributes: input.attributes }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), + ...(input.attributes !== undefined && input.attributes !== null && { attributes: input.attributes }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2232,13 +2204,15 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( }; const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1Application = (output: any, context: __SerdeContext): Application => { @@ -2261,7 +2235,14 @@ const deserializeAws_restJson1Application = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ApplicationSummaries = (output: any, context: __SerdeContext): ApplicationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ApplicationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ApplicationSummary(entry, context); + }); }; const deserializeAws_restJson1ApplicationSummary = (output: any, context: __SerdeContext): ApplicationSummary => { @@ -2299,14 +2280,28 @@ const deserializeAws_restJson1AttributeGroup = (output: any, context: __SerdeCon }; const deserializeAws_restJson1AttributeGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1AttributeGroupSummaries = ( output: any, context: __SerdeContext ): AttributeGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AttributeGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AttributeGroupSummary(entry, context); + }); }; const deserializeAws_restJson1AttributeGroupSummary = (output: any, context: __SerdeContext): AttributeGroupSummary => { @@ -2332,17 +2327,26 @@ const deserializeAws_restJson1ResourceInfo = (output: any, context: __SerdeConte }; const deserializeAws_restJson1Resources = (output: any, context: __SerdeContext): ResourceInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceInfo(entry, context); + }); }; const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2365,6 +2369,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-service-catalog/protocols/Aws_json1_1.ts b/clients/client-service-catalog/protocols/Aws_json1_1.ts index e1591e7c539b..9cc8c8448d83 100644 --- a/clients/client-service-catalog/protocols/Aws_json1_1.ts +++ b/clients/client-service-catalog/protocols/Aws_json1_1.ts @@ -518,7 +518,7 @@ export const serializeAws_json1_1AcceptPortfolioShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.AcceptPortfolioShare", }; let body: any; @@ -531,7 +531,7 @@ export const serializeAws_json1_1AssociateBudgetWithResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.AssociateBudgetWithResource", }; let body: any; @@ -544,7 +544,7 @@ export const serializeAws_json1_1AssociatePrincipalWithPortfolioCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.AssociatePrincipalWithPortfolio", }; let body: any; @@ -557,7 +557,7 @@ export const serializeAws_json1_1AssociateProductWithPortfolioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.AssociateProductWithPortfolio", }; let body: any; @@ -570,7 +570,7 @@ export const serializeAws_json1_1AssociateServiceActionWithProvisioningArtifactC context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.AssociateServiceActionWithProvisioningArtifact", }; let body: any; @@ -583,7 +583,7 @@ export const serializeAws_json1_1AssociateTagOptionWithResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.AssociateTagOptionWithResource", }; let body: any; @@ -596,7 +596,7 @@ export const serializeAws_json1_1BatchAssociateServiceActionWithProvisioningArti context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.BatchAssociateServiceActionWithProvisioningArtifact", }; let body: any; @@ -609,7 +609,7 @@ export const serializeAws_json1_1BatchDisassociateServiceActionFromProvisioningA context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.BatchDisassociateServiceActionFromProvisioningArtifact", }; let body: any; @@ -624,7 +624,7 @@ export const serializeAws_json1_1CopyProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.CopyProduct", }; let body: any; @@ -637,7 +637,7 @@ export const serializeAws_json1_1CreateConstraintCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.CreateConstraint", }; let body: any; @@ -650,7 +650,7 @@ export const serializeAws_json1_1CreatePortfolioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.CreatePortfolio", }; let body: any; @@ -663,7 +663,7 @@ export const serializeAws_json1_1CreatePortfolioShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.CreatePortfolioShare", }; let body: any; @@ -676,7 +676,7 @@ export const serializeAws_json1_1CreateProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.CreateProduct", }; let body: any; @@ -689,7 +689,7 @@ export const serializeAws_json1_1CreateProvisionedProductPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.CreateProvisionedProductPlan", }; let body: any; @@ -702,7 +702,7 @@ export const serializeAws_json1_1CreateProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.CreateProvisioningArtifact", }; let body: any; @@ -715,7 +715,7 @@ export const serializeAws_json1_1CreateServiceActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.CreateServiceAction", }; let body: any; @@ -728,7 +728,7 @@ export const serializeAws_json1_1CreateTagOptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.CreateTagOption", }; let body: any; @@ -741,7 +741,7 @@ export const serializeAws_json1_1DeleteConstraintCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DeleteConstraint", }; let body: any; @@ -754,7 +754,7 @@ export const serializeAws_json1_1DeletePortfolioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DeletePortfolio", }; let body: any; @@ -767,7 +767,7 @@ export const serializeAws_json1_1DeletePortfolioShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DeletePortfolioShare", }; let body: any; @@ -780,7 +780,7 @@ export const serializeAws_json1_1DeleteProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DeleteProduct", }; let body: any; @@ -793,7 +793,7 @@ export const serializeAws_json1_1DeleteProvisionedProductPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DeleteProvisionedProductPlan", }; let body: any; @@ -806,7 +806,7 @@ export const serializeAws_json1_1DeleteProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DeleteProvisioningArtifact", }; let body: any; @@ -819,7 +819,7 @@ export const serializeAws_json1_1DeleteServiceActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DeleteServiceAction", }; let body: any; @@ -832,7 +832,7 @@ export const serializeAws_json1_1DeleteTagOptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DeleteTagOption", }; let body: any; @@ -845,7 +845,7 @@ export const serializeAws_json1_1DescribeConstraintCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeConstraint", }; let body: any; @@ -858,7 +858,7 @@ export const serializeAws_json1_1DescribeCopyProductStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeCopyProductStatus", }; let body: any; @@ -871,7 +871,7 @@ export const serializeAws_json1_1DescribePortfolioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribePortfolio", }; let body: any; @@ -884,7 +884,7 @@ export const serializeAws_json1_1DescribePortfolioShareStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribePortfolioShareStatus", }; let body: any; @@ -897,7 +897,7 @@ export const serializeAws_json1_1DescribeProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeProduct", }; let body: any; @@ -910,7 +910,7 @@ export const serializeAws_json1_1DescribeProductAsAdminCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeProductAsAdmin", }; let body: any; @@ -923,7 +923,7 @@ export const serializeAws_json1_1DescribeProductViewCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeProductView", }; let body: any; @@ -936,7 +936,7 @@ export const serializeAws_json1_1DescribeProvisionedProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeProvisionedProduct", }; let body: any; @@ -949,7 +949,7 @@ export const serializeAws_json1_1DescribeProvisionedProductPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeProvisionedProductPlan", }; let body: any; @@ -962,7 +962,7 @@ export const serializeAws_json1_1DescribeProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeProvisioningArtifact", }; let body: any; @@ -975,7 +975,7 @@ export const serializeAws_json1_1DescribeProvisioningParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeProvisioningParameters", }; let body: any; @@ -988,7 +988,7 @@ export const serializeAws_json1_1DescribeRecordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeRecord", }; let body: any; @@ -1001,7 +1001,7 @@ export const serializeAws_json1_1DescribeServiceActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeServiceAction", }; let body: any; @@ -1014,7 +1014,7 @@ export const serializeAws_json1_1DescribeServiceActionExecutionParametersCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeServiceActionExecutionParameters", }; let body: any; @@ -1027,7 +1027,7 @@ export const serializeAws_json1_1DescribeTagOptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DescribeTagOption", }; let body: any; @@ -1040,7 +1040,7 @@ export const serializeAws_json1_1DisableAWSOrganizationsAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DisableAWSOrganizationsAccess", }; let body: any; @@ -1053,7 +1053,7 @@ export const serializeAws_json1_1DisassociateBudgetFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DisassociateBudgetFromResource", }; let body: any; @@ -1066,7 +1066,7 @@ export const serializeAws_json1_1DisassociatePrincipalFromPortfolioCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DisassociatePrincipalFromPortfolio", }; let body: any; @@ -1079,7 +1079,7 @@ export const serializeAws_json1_1DisassociateProductFromPortfolioCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DisassociateProductFromPortfolio", }; let body: any; @@ -1092,7 +1092,7 @@ export const serializeAws_json1_1DisassociateServiceActionFromProvisioningArtifa context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DisassociateServiceActionFromProvisioningArtifact", }; let body: any; @@ -1105,7 +1105,7 @@ export const serializeAws_json1_1DisassociateTagOptionFromResourceCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.DisassociateTagOptionFromResource", }; let body: any; @@ -1118,7 +1118,7 @@ export const serializeAws_json1_1EnableAWSOrganizationsAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.EnableAWSOrganizationsAccess", }; let body: any; @@ -1131,7 +1131,7 @@ export const serializeAws_json1_1ExecuteProvisionedProductPlanCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ExecuteProvisionedProductPlan", }; let body: any; @@ -1144,7 +1144,7 @@ export const serializeAws_json1_1ExecuteProvisionedProductServiceActionCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ExecuteProvisionedProductServiceAction", }; let body: any; @@ -1157,7 +1157,7 @@ export const serializeAws_json1_1GetAWSOrganizationsAccessStatusCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.GetAWSOrganizationsAccessStatus", }; let body: any; @@ -1170,7 +1170,7 @@ export const serializeAws_json1_1GetProvisionedProductOutputsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.GetProvisionedProductOutputs", }; let body: any; @@ -1183,7 +1183,7 @@ export const serializeAws_json1_1ImportAsProvisionedProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ImportAsProvisionedProduct", }; let body: any; @@ -1196,7 +1196,7 @@ export const serializeAws_json1_1ListAcceptedPortfolioSharesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListAcceptedPortfolioShares", }; let body: any; @@ -1209,7 +1209,7 @@ export const serializeAws_json1_1ListBudgetsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListBudgetsForResource", }; let body: any; @@ -1222,7 +1222,7 @@ export const serializeAws_json1_1ListConstraintsForPortfolioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListConstraintsForPortfolio", }; let body: any; @@ -1235,7 +1235,7 @@ export const serializeAws_json1_1ListLaunchPathsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListLaunchPaths", }; let body: any; @@ -1248,7 +1248,7 @@ export const serializeAws_json1_1ListOrganizationPortfolioAccessCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListOrganizationPortfolioAccess", }; let body: any; @@ -1261,7 +1261,7 @@ export const serializeAws_json1_1ListPortfolioAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListPortfolioAccess", }; let body: any; @@ -1274,7 +1274,7 @@ export const serializeAws_json1_1ListPortfoliosCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListPortfolios", }; let body: any; @@ -1287,7 +1287,7 @@ export const serializeAws_json1_1ListPortfoliosForProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListPortfoliosForProduct", }; let body: any; @@ -1300,7 +1300,7 @@ export const serializeAws_json1_1ListPrincipalsForPortfolioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListPrincipalsForPortfolio", }; let body: any; @@ -1313,7 +1313,7 @@ export const serializeAws_json1_1ListProvisionedProductPlansCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListProvisionedProductPlans", }; let body: any; @@ -1326,7 +1326,7 @@ export const serializeAws_json1_1ListProvisioningArtifactsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListProvisioningArtifacts", }; let body: any; @@ -1339,7 +1339,7 @@ export const serializeAws_json1_1ListProvisioningArtifactsForServiceActionComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListProvisioningArtifactsForServiceAction", }; let body: any; @@ -1352,7 +1352,7 @@ export const serializeAws_json1_1ListRecordHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListRecordHistory", }; let body: any; @@ -1365,7 +1365,7 @@ export const serializeAws_json1_1ListResourcesForTagOptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListResourcesForTagOption", }; let body: any; @@ -1378,7 +1378,7 @@ export const serializeAws_json1_1ListServiceActionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListServiceActions", }; let body: any; @@ -1391,7 +1391,7 @@ export const serializeAws_json1_1ListServiceActionsForProvisioningArtifactComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListServiceActionsForProvisioningArtifact", }; let body: any; @@ -1404,7 +1404,7 @@ export const serializeAws_json1_1ListStackInstancesForProvisionedProductCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListStackInstancesForProvisionedProduct", }; let body: any; @@ -1417,7 +1417,7 @@ export const serializeAws_json1_1ListTagOptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ListTagOptions", }; let body: any; @@ -1430,7 +1430,7 @@ export const serializeAws_json1_1ProvisionProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ProvisionProduct", }; let body: any; @@ -1443,7 +1443,7 @@ export const serializeAws_json1_1RejectPortfolioShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.RejectPortfolioShare", }; let body: any; @@ -1456,7 +1456,7 @@ export const serializeAws_json1_1ScanProvisionedProductsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.ScanProvisionedProducts", }; let body: any; @@ -1469,7 +1469,7 @@ export const serializeAws_json1_1SearchProductsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.SearchProducts", }; let body: any; @@ -1482,7 +1482,7 @@ export const serializeAws_json1_1SearchProductsAsAdminCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.SearchProductsAsAdmin", }; let body: any; @@ -1495,7 +1495,7 @@ export const serializeAws_json1_1SearchProvisionedProductsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.SearchProvisionedProducts", }; let body: any; @@ -1508,7 +1508,7 @@ export const serializeAws_json1_1TerminateProvisionedProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.TerminateProvisionedProduct", }; let body: any; @@ -1521,7 +1521,7 @@ export const serializeAws_json1_1UpdateConstraintCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.UpdateConstraint", }; let body: any; @@ -1534,7 +1534,7 @@ export const serializeAws_json1_1UpdatePortfolioCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.UpdatePortfolio", }; let body: any; @@ -1547,7 +1547,7 @@ export const serializeAws_json1_1UpdateProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.UpdateProduct", }; let body: any; @@ -1560,7 +1560,7 @@ export const serializeAws_json1_1UpdateProvisionedProductCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.UpdateProvisionedProduct", }; let body: any; @@ -1573,7 +1573,7 @@ export const serializeAws_json1_1UpdateProvisionedProductPropertiesCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.UpdateProvisionedProductProperties", }; let body: any; @@ -1586,7 +1586,7 @@ export const serializeAws_json1_1UpdateProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.UpdateProvisioningArtifact", }; let body: any; @@ -1599,7 +1599,7 @@ export const serializeAws_json1_1UpdateServiceActionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.UpdateServiceAction", }; let body: any; @@ -1612,7 +1612,7 @@ export const serializeAws_json1_1UpdateTagOptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWS242ServiceCatalogService.UpdateTagOption", }; let body: any; @@ -1647,8 +1647,7 @@ const deserializeAws_json1_1AcceptPortfolioShareCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -1718,8 +1717,7 @@ const deserializeAws_json1_1AssociateBudgetWithResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateResourceException": case "com.amazonaws.servicecatalog#DuplicateResourceException": @@ -1797,8 +1795,7 @@ const deserializeAws_json1_1AssociatePrincipalWithPortfolioCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -1868,8 +1865,7 @@ const deserializeAws_json1_1AssociateProductWithPortfolioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -1939,8 +1935,7 @@ const deserializeAws_json1_1AssociateServiceActionWithProvisioningArtifactComman }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateResourceException": case "com.amazonaws.servicecatalog#DuplicateResourceException": @@ -2010,8 +2005,7 @@ const deserializeAws_json1_1AssociateTagOptionWithResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateResourceException": case "com.amazonaws.servicecatalog#DuplicateResourceException": @@ -2105,8 +2099,7 @@ const deserializeAws_json1_1BatchAssociateServiceActionWithProvisioningArtifactC }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2160,8 +2153,7 @@ const deserializeAws_json1_1BatchDisassociateServiceActionFromProvisioningArtifa }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2215,8 +2207,7 @@ const deserializeAws_json1_1CopyProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2278,8 +2269,7 @@ const deserializeAws_json1_1CreateConstraintCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateResourceException": case "com.amazonaws.servicecatalog#DuplicateResourceException": @@ -2357,8 +2347,7 @@ const deserializeAws_json1_1CreatePortfolioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2428,8 +2417,7 @@ const deserializeAws_json1_1CreatePortfolioShareCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2515,8 +2503,7 @@ const deserializeAws_json1_1CreateProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2586,8 +2573,7 @@ const deserializeAws_json1_1CreateProvisionedProductPlanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2657,8 +2643,7 @@ const deserializeAws_json1_1CreateProvisioningArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2728,8 +2713,7 @@ const deserializeAws_json1_1CreateServiceActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2791,8 +2775,7 @@ const deserializeAws_json1_1CreateTagOptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateResourceException": case "com.amazonaws.servicecatalog#DuplicateResourceException": @@ -2862,8 +2845,7 @@ const deserializeAws_json1_1DeleteConstraintCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -2925,8 +2907,7 @@ const deserializeAws_json1_1DeletePortfolioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3004,8 +2985,7 @@ const deserializeAws_json1_1DeletePortfolioShareCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3083,8 +3063,7 @@ const deserializeAws_json1_1DeleteProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3162,8 +3141,7 @@ const deserializeAws_json1_1DeleteProvisionedProductPlanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3225,8 +3203,7 @@ const deserializeAws_json1_1DeleteProvisioningArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3296,8 +3273,7 @@ const deserializeAws_json1_1DeleteServiceActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUseException": case "com.amazonaws.servicecatalog#ResourceInUseException": @@ -3359,8 +3335,7 @@ const deserializeAws_json1_1DeleteTagOptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceInUseException": case "com.amazonaws.servicecatalog#ResourceInUseException": @@ -3430,8 +3405,7 @@ const deserializeAws_json1_1DescribeConstraintCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -3485,8 +3459,7 @@ const deserializeAws_json1_1DescribeCopyProductStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -3540,8 +3513,7 @@ const deserializeAws_json1_1DescribePortfolioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -3595,8 +3567,7 @@ const deserializeAws_json1_1DescribePortfolioShareStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3666,8 +3637,7 @@ const deserializeAws_json1_1DescribeProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3729,8 +3699,7 @@ const deserializeAws_json1_1DescribeProductAsAdminCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3792,8 +3761,7 @@ const deserializeAws_json1_1DescribeProductViewCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3855,8 +3823,7 @@ const deserializeAws_json1_1DescribeProvisionedProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3918,8 +3885,7 @@ const deserializeAws_json1_1DescribeProvisionedProductPlanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -3981,8 +3947,7 @@ const deserializeAws_json1_1DescribeProvisioningArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -4044,8 +4009,7 @@ const deserializeAws_json1_1DescribeProvisioningParametersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -4107,8 +4071,7 @@ const deserializeAws_json1_1DescribeRecordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -4162,8 +4125,7 @@ const deserializeAws_json1_1DescribeServiceActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -4217,8 +4179,7 @@ const deserializeAws_json1_1DescribeServiceActionExecutionParametersCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -4280,8 +4241,7 @@ const deserializeAws_json1_1DescribeTagOptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -4343,8 +4303,7 @@ const deserializeAws_json1_1DisableAWSOrganizationsAccessCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.servicecatalog#InvalidStateException": @@ -4414,8 +4373,7 @@ const deserializeAws_json1_1DisassociateBudgetFromResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -4469,8 +4427,7 @@ const deserializeAws_json1_1DisassociatePrincipalFromPortfolioCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -4532,8 +4489,7 @@ const deserializeAws_json1_1DisassociateProductFromPortfolioCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -4603,8 +4559,7 @@ const deserializeAws_json1_1DisassociateServiceActionFromProvisioningArtifactCom }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -4658,8 +4613,7 @@ const deserializeAws_json1_1DisassociateTagOptionFromResourceCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -4721,8 +4675,7 @@ const deserializeAws_json1_1EnableAWSOrganizationsAccessCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidStateException": case "com.amazonaws.servicecatalog#InvalidStateException": @@ -4792,8 +4745,7 @@ const deserializeAws_json1_1ExecuteProvisionedProductPlanCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -4863,8 +4815,7 @@ const deserializeAws_json1_1ExecuteProvisionedProductServiceActionCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -4934,8 +4885,7 @@ const deserializeAws_json1_1GetAWSOrganizationsAccessStatusCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotSupportedException": case "com.amazonaws.servicecatalog#OperationNotSupportedException": @@ -4997,8 +4947,7 @@ const deserializeAws_json1_1GetProvisionedProductOutputsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5060,8 +5009,7 @@ const deserializeAws_json1_1ImportAsProvisionedProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateResourceException": case "com.amazonaws.servicecatalog#DuplicateResourceException": @@ -5139,8 +5087,7 @@ const deserializeAws_json1_1ListAcceptedPortfolioSharesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5202,8 +5149,7 @@ const deserializeAws_json1_1ListBudgetsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5265,8 +5211,7 @@ const deserializeAws_json1_1ListConstraintsForPortfolioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5328,8 +5273,7 @@ const deserializeAws_json1_1ListLaunchPathsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5391,8 +5335,7 @@ const deserializeAws_json1_1ListOrganizationPortfolioAccessCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5462,8 +5405,7 @@ const deserializeAws_json1_1ListPortfolioAccessCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5525,8 +5467,7 @@ const deserializeAws_json1_1ListPortfoliosCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5580,8 +5521,7 @@ const deserializeAws_json1_1ListPortfoliosForProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5643,8 +5583,7 @@ const deserializeAws_json1_1ListPrincipalsForPortfolioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5706,8 +5645,7 @@ const deserializeAws_json1_1ListProvisionedProductPlansCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5769,8 +5707,7 @@ const deserializeAws_json1_1ListProvisioningArtifactsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5832,8 +5769,7 @@ const deserializeAws_json1_1ListProvisioningArtifactsForServiceActionCommandErro }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5895,8 +5831,7 @@ const deserializeAws_json1_1ListRecordHistoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -5950,8 +5885,7 @@ const deserializeAws_json1_1ListResourcesForTagOptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6021,8 +5955,7 @@ const deserializeAws_json1_1ListServiceActionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6076,8 +6009,7 @@ const deserializeAws_json1_1ListServiceActionsForProvisioningArtifactCommandErro }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6139,8 +6071,7 @@ const deserializeAws_json1_1ListStackInstancesForProvisionedProductCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6202,8 +6133,7 @@ const deserializeAws_json1_1ListTagOptionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6265,8 +6195,7 @@ const deserializeAws_json1_1ProvisionProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateResourceException": case "com.amazonaws.servicecatalog#DuplicateResourceException": @@ -6336,8 +6265,7 @@ const deserializeAws_json1_1RejectPortfolioShareCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -6391,8 +6319,7 @@ const deserializeAws_json1_1ScanProvisionedProductsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6446,8 +6373,7 @@ const deserializeAws_json1_1SearchProductsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6501,8 +6427,7 @@ const deserializeAws_json1_1SearchProductsAsAdminCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6564,8 +6489,7 @@ const deserializeAws_json1_1SearchProvisionedProductsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6619,8 +6543,7 @@ const deserializeAws_json1_1TerminateProvisionedProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": @@ -6674,8 +6597,7 @@ const deserializeAws_json1_1UpdateConstraintCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6737,8 +6659,7 @@ const deserializeAws_json1_1UpdatePortfolioCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6816,8 +6737,7 @@ const deserializeAws_json1_1UpdateProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6887,8 +6807,7 @@ const deserializeAws_json1_1UpdateProvisionedProductCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -6950,8 +6869,7 @@ const deserializeAws_json1_1UpdateProvisionedProductPropertiesCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -7021,8 +6939,7 @@ const deserializeAws_json1_1UpdateProvisioningArtifactCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -7084,8 +7001,7 @@ const deserializeAws_json1_1UpdateServiceActionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": @@ -7147,8 +7063,7 @@ const deserializeAws_json1_1UpdateTagOptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateResourceException": case "com.amazonaws.servicecatalog#DuplicateResourceException": @@ -7324,21 +7239,30 @@ const serializeAws_json1_1AcceptPortfolioShareInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), - ...(input.PortfolioShareType !== undefined && { PortfolioShareType: input.PortfolioShareType }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), + ...(input.PortfolioShareType !== undefined && + input.PortfolioShareType !== null && { PortfolioShareType: input.PortfolioShareType }), }; }; const serializeAws_json1_1AccessLevelFilter = (input: AccessLevelFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1AddTags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1AssociateBudgetWithResourceInput = ( @@ -7346,8 +7270,8 @@ const serializeAws_json1_1AssociateBudgetWithResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -7356,10 +7280,11 @@ const serializeAws_json1_1AssociatePrincipalWithPortfolioInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), - ...(input.PrincipalARN !== undefined && { PrincipalARN: input.PrincipalARN }), - ...(input.PrincipalType !== undefined && { PrincipalType: input.PrincipalType }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), + ...(input.PrincipalARN !== undefined && input.PrincipalARN !== null && { PrincipalARN: input.PrincipalARN }), + ...(input.PrincipalType !== undefined && input.PrincipalType !== null && { PrincipalType: input.PrincipalType }), }; }; @@ -7368,10 +7293,12 @@ const serializeAws_json1_1AssociateProductWithPortfolioInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.SourcePortfolioId !== undefined && { SourcePortfolioId: input.SourcePortfolioId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.SourcePortfolioId !== undefined && + input.SourcePortfolioId !== null && { SourcePortfolioId: input.SourcePortfolioId }), }; }; @@ -7380,10 +7307,13 @@ const serializeAws_json1_1AssociateServiceActionWithProvisioningArtifactInput = context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), - ...(input.ServiceActionId !== undefined && { ServiceActionId: input.ServiceActionId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.ServiceActionId !== undefined && + input.ServiceActionId !== null && { ServiceActionId: input.ServiceActionId }), }; }; @@ -7392,8 +7322,8 @@ const serializeAws_json1_1AssociateTagOptionWithResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagOptionId !== undefined && { TagOptionId: input.TagOptionId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagOptionId !== undefined && input.TagOptionId !== null && { TagOptionId: input.TagOptionId }), }; }; @@ -7402,13 +7332,15 @@ const serializeAws_json1_1BatchAssociateServiceActionWithProvisioningArtifactInp context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.ServiceActionAssociations !== undefined && { - ServiceActionAssociations: serializeAws_json1_1ServiceActionAssociations( - input.ServiceActionAssociations, - context - ), - }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.ServiceActionAssociations !== undefined && + input.ServiceActionAssociations !== null && { + ServiceActionAssociations: serializeAws_json1_1ServiceActionAssociations( + input.ServiceActionAssociations, + context + ), + }), }; }; @@ -7417,59 +7349,74 @@ const serializeAws_json1_1BatchDisassociateServiceActionFromProvisioningArtifact context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.ServiceActionAssociations !== undefined && { - ServiceActionAssociations: serializeAws_json1_1ServiceActionAssociations( - input.ServiceActionAssociations, - context - ), - }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.ServiceActionAssociations !== undefined && + input.ServiceActionAssociations !== null && { + ServiceActionAssociations: serializeAws_json1_1ServiceActionAssociations( + input.ServiceActionAssociations, + context + ), + }), }; }; const serializeAws_json1_1CopyOptions = (input: (CopyOption | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CopyProductInput = (input: CopyProductInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.CopyOptions !== undefined && { - CopyOptions: serializeAws_json1_1CopyOptions(input.CopyOptions, context), - }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.CopyOptions !== undefined && + input.CopyOptions !== null && { CopyOptions: serializeAws_json1_1CopyOptions(input.CopyOptions, context) }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.SourceProductArn !== undefined && { SourceProductArn: input.SourceProductArn }), - ...(input.SourceProvisioningArtifactIdentifiers !== undefined && { - SourceProvisioningArtifactIdentifiers: serializeAws_json1_1SourceProvisioningArtifactProperties( - input.SourceProvisioningArtifactIdentifiers, - context - ), - }), - ...(input.TargetProductId !== undefined && { TargetProductId: input.TargetProductId }), - ...(input.TargetProductName !== undefined && { TargetProductName: input.TargetProductName }), + ...(input.SourceProductArn !== undefined && + input.SourceProductArn !== null && { SourceProductArn: input.SourceProductArn }), + ...(input.SourceProvisioningArtifactIdentifiers !== undefined && + input.SourceProvisioningArtifactIdentifiers !== null && { + SourceProvisioningArtifactIdentifiers: serializeAws_json1_1SourceProvisioningArtifactProperties( + input.SourceProvisioningArtifactIdentifiers, + context + ), + }), + ...(input.TargetProductId !== undefined && + input.TargetProductId !== null && { TargetProductId: input.TargetProductId }), + ...(input.TargetProductName !== undefined && + input.TargetProductName !== null && { TargetProductName: input.TargetProductName }), }; }; const serializeAws_json1_1CreateConstraintInput = (input: CreateConstraintInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.Parameters !== undefined && { Parameters: input.Parameters }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Parameters !== undefined && input.Parameters !== null && { Parameters: input.Parameters }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1CreatePortfolioInput = (input: CreatePortfolioInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.ProviderName !== undefined && { ProviderName: input.ProviderName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1AddTags(input.Tags, context) }), + ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1AddTags(input.Tags, context) }), }; }; @@ -7478,34 +7425,39 @@ const serializeAws_json1_1CreatePortfolioShareInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.OrganizationNode !== undefined && { - OrganizationNode: serializeAws_json1_1OrganizationNode(input.OrganizationNode, context), - }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.OrganizationNode !== undefined && + input.OrganizationNode !== null && { + OrganizationNode: serializeAws_json1_1OrganizationNode(input.OrganizationNode, context), + }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), }; }; const serializeAws_json1_1CreateProductInput = (input: CreateProductInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Distributor !== undefined && { Distributor: input.Distributor }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Distributor !== undefined && input.Distributor !== null && { Distributor: input.Distributor }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Owner !== undefined && { Owner: input.Owner }), - ...(input.ProductType !== undefined && { ProductType: input.ProductType }), - ...(input.ProvisioningArtifactParameters !== undefined && { - ProvisioningArtifactParameters: serializeAws_json1_1ProvisioningArtifactProperties( - input.ProvisioningArtifactParameters, - context - ), - }), - ...(input.SupportDescription !== undefined && { SupportDescription: input.SupportDescription }), - ...(input.SupportEmail !== undefined && { SupportEmail: input.SupportEmail }), - ...(input.SupportUrl !== undefined && { SupportUrl: input.SupportUrl }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1AddTags(input.Tags, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Owner !== undefined && input.Owner !== null && { Owner: input.Owner }), + ...(input.ProductType !== undefined && input.ProductType !== null && { ProductType: input.ProductType }), + ...(input.ProvisioningArtifactParameters !== undefined && + input.ProvisioningArtifactParameters !== null && { + ProvisioningArtifactParameters: serializeAws_json1_1ProvisioningArtifactProperties( + input.ProvisioningArtifactParameters, + context + ), + }), + ...(input.SupportDescription !== undefined && + input.SupportDescription !== null && { SupportDescription: input.SupportDescription }), + ...(input.SupportEmail !== undefined && input.SupportEmail !== null && { SupportEmail: input.SupportEmail }), + ...(input.SupportUrl !== undefined && input.SupportUrl !== null && { SupportUrl: input.SupportUrl }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1AddTags(input.Tags, context) }), }; }; @@ -7514,21 +7466,26 @@ const serializeAws_json1_1CreateProvisionedProductPlanInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.NotificationArns !== undefined && { - NotificationArns: serializeAws_json1_1NotificationArns(input.NotificationArns, context), - }), - ...(input.PathId !== undefined && { PathId: input.PathId }), - ...(input.PlanName !== undefined && { PlanName: input.PlanName }), - ...(input.PlanType !== undefined && { PlanType: input.PlanType }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProvisionedProductName !== undefined && { ProvisionedProductName: input.ProvisionedProductName }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), - ...(input.ProvisioningParameters !== undefined && { - ProvisioningParameters: serializeAws_json1_1UpdateProvisioningParameters(input.ProvisioningParameters, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.NotificationArns !== undefined && + input.NotificationArns !== null && { + NotificationArns: serializeAws_json1_1NotificationArns(input.NotificationArns, context), + }), + ...(input.PathId !== undefined && input.PathId !== null && { PathId: input.PathId }), + ...(input.PlanName !== undefined && input.PlanName !== null && { PlanName: input.PlanName }), + ...(input.PlanType !== undefined && input.PlanType !== null && { PlanType: input.PlanType }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProvisionedProductName !== undefined && + input.ProvisionedProductName !== null && { ProvisionedProductName: input.ProvisionedProductName }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.ProvisioningParameters !== undefined && + input.ProvisioningParameters !== null && { + ProvisioningParameters: serializeAws_json1_1UpdateProvisioningParameters(input.ProvisioningParameters, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -7537,12 +7494,14 @@ const serializeAws_json1_1CreateProvisioningArtifactInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1ProvisioningArtifactProperties(input.Parameters, context), - }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_1ProvisioningArtifactProperties(input.Parameters, context), + }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), }; }; @@ -7551,35 +7510,40 @@ const serializeAws_json1_1CreateServiceActionInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Definition !== undefined && { - Definition: serializeAws_json1_1ServiceActionDefinitionMap(input.Definition, context), - }), - ...(input.DefinitionType !== undefined && { DefinitionType: input.DefinitionType }), - ...(input.Description !== undefined && { Description: input.Description }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Definition !== undefined && + input.Definition !== null && { + Definition: serializeAws_json1_1ServiceActionDefinitionMap(input.Definition, context), + }), + ...(input.DefinitionType !== undefined && + input.DefinitionType !== null && { DefinitionType: input.DefinitionType }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1CreateTagOptionInput = (input: CreateTagOptionInput, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1DeleteConstraintInput = (input: DeleteConstraintInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_json1_1DeletePortfolioInput = (input: DeletePortfolioInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -7588,19 +7552,22 @@ const serializeAws_json1_1DeletePortfolioShareInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.OrganizationNode !== undefined && { - OrganizationNode: serializeAws_json1_1OrganizationNode(input.OrganizationNode, context), - }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.OrganizationNode !== undefined && + input.OrganizationNode !== null && { + OrganizationNode: serializeAws_json1_1OrganizationNode(input.OrganizationNode, context), + }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), }; }; const serializeAws_json1_1DeleteProductInput = (input: DeleteProductInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -7609,9 +7576,10 @@ const serializeAws_json1_1DeleteProvisionedProductPlanInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.IgnoreErrors !== undefined && { IgnoreErrors: input.IgnoreErrors }), - ...(input.PlanId !== undefined && { PlanId: input.PlanId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.IgnoreErrors !== undefined && input.IgnoreErrors !== null && { IgnoreErrors: input.IgnoreErrors }), + ...(input.PlanId !== undefined && input.PlanId !== null && { PlanId: input.PlanId }), }; }; @@ -7620,9 +7588,11 @@ const serializeAws_json1_1DeleteProvisioningArtifactInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), }; }; @@ -7631,21 +7601,23 @@ const serializeAws_json1_1DeleteServiceActionInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_json1_1DeleteTagOptionInput = (input: DeleteTagOptionInput, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_json1_1DescribeConstraintInput = (input: DescribeConstraintInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -7654,15 +7626,18 @@ const serializeAws_json1_1DescribeCopyProductStatusInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.CopyProductToken !== undefined && { CopyProductToken: input.CopyProductToken }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.CopyProductToken !== undefined && + input.CopyProductToken !== null && { CopyProductToken: input.CopyProductToken }), }; }; const serializeAws_json1_1DescribePortfolioInput = (input: DescribePortfolioInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -7671,7 +7646,8 @@ const serializeAws_json1_1DescribePortfolioShareStatusInput = ( context: __SerdeContext ): any => { return { - ...(input.PortfolioShareToken !== undefined && { PortfolioShareToken: input.PortfolioShareToken }), + ...(input.PortfolioShareToken !== undefined && + input.PortfolioShareToken !== null && { PortfolioShareToken: input.PortfolioShareToken }), }; }; @@ -7680,17 +7656,19 @@ const serializeAws_json1_1DescribeProductAsAdminInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DescribeProductInput = (input: DescribeProductInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -7699,8 +7677,9 @@ const serializeAws_json1_1DescribeProductViewInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -7709,9 +7688,10 @@ const serializeAws_json1_1DescribeProvisionedProductInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -7720,10 +7700,11 @@ const serializeAws_json1_1DescribeProvisionedProductPlanInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.PlanId !== undefined && { PlanId: input.PlanId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.PlanId !== undefined && input.PlanId !== null && { PlanId: input.PlanId }), }; }; @@ -7732,12 +7713,15 @@ const serializeAws_json1_1DescribeProvisioningArtifactInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProductName !== undefined && { ProductName: input.ProductName }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), - ...(input.ProvisioningArtifactName !== undefined && { ProvisioningArtifactName: input.ProvisioningArtifactName }), - ...(input.Verbose !== undefined && { Verbose: input.Verbose }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProductName !== undefined && input.ProductName !== null && { ProductName: input.ProductName }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.ProvisioningArtifactName !== undefined && + input.ProvisioningArtifactName !== null && { ProvisioningArtifactName: input.ProvisioningArtifactName }), + ...(input.Verbose !== undefined && input.Verbose !== null && { Verbose: input.Verbose }), }; }; @@ -7746,22 +7730,26 @@ const serializeAws_json1_1DescribeProvisioningParametersInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PathId !== undefined && { PathId: input.PathId }), - ...(input.PathName !== undefined && { PathName: input.PathName }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProductName !== undefined && { ProductName: input.ProductName }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), - ...(input.ProvisioningArtifactName !== undefined && { ProvisioningArtifactName: input.ProvisioningArtifactName }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PathId !== undefined && input.PathId !== null && { PathId: input.PathId }), + ...(input.PathName !== undefined && input.PathName !== null && { PathName: input.PathName }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProductName !== undefined && input.ProductName !== null && { ProductName: input.ProductName }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.ProvisioningArtifactName !== undefined && + input.ProvisioningArtifactName !== null && { ProvisioningArtifactName: input.ProvisioningArtifactName }), }; }; const serializeAws_json1_1DescribeRecordInput = (input: DescribeRecordInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), }; }; @@ -7770,9 +7758,12 @@ const serializeAws_json1_1DescribeServiceActionExecutionParametersInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.ProvisionedProductId !== undefined && { ProvisionedProductId: input.ProvisionedProductId }), - ...(input.ServiceActionId !== undefined && { ServiceActionId: input.ServiceActionId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.ProvisionedProductId !== undefined && + input.ProvisionedProductId !== null && { ProvisionedProductId: input.ProvisionedProductId }), + ...(input.ServiceActionId !== undefined && + input.ServiceActionId !== null && { ServiceActionId: input.ServiceActionId }), }; }; @@ -7781,14 +7772,15 @@ const serializeAws_json1_1DescribeServiceActionInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_json1_1DescribeTagOptionInput = (input: DescribeTagOptionInput, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -7804,8 +7796,8 @@ const serializeAws_json1_1DisassociateBudgetFromResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.BudgetName !== undefined && input.BudgetName !== null && { BudgetName: input.BudgetName }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -7814,9 +7806,10 @@ const serializeAws_json1_1DisassociatePrincipalFromPortfolioInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), - ...(input.PrincipalARN !== undefined && { PrincipalARN: input.PrincipalARN }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), + ...(input.PrincipalARN !== undefined && input.PrincipalARN !== null && { PrincipalARN: input.PrincipalARN }), }; }; @@ -7825,9 +7818,10 @@ const serializeAws_json1_1DisassociateProductFromPortfolioInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), }; }; @@ -7836,10 +7830,13 @@ const serializeAws_json1_1DisassociateServiceActionFromProvisioningArtifactInput context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), - ...(input.ServiceActionId !== undefined && { ServiceActionId: input.ServiceActionId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.ServiceActionId !== undefined && + input.ServiceActionId !== null && { ServiceActionId: input.ServiceActionId }), }; }; @@ -7848,8 +7845,8 @@ const serializeAws_json1_1DisassociateTagOptionFromResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagOptionId !== undefined && { TagOptionId: input.TagOptionId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagOptionId !== undefined && input.TagOptionId !== null && { TagOptionId: input.TagOptionId }), }; }; @@ -7865,9 +7862,10 @@ const serializeAws_json1_1ExecuteProvisionedProductPlanInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.PlanId !== undefined && { PlanId: input.PlanId }), + ...(input.PlanId !== undefined && input.PlanId !== null && { PlanId: input.PlanId }), }; }; @@ -7876,13 +7874,17 @@ const serializeAws_json1_1ExecuteProvisionedProductServiceActionInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), ExecuteToken: input.ExecuteToken ?? generateIdempotencyToken(), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1ExecutionParameterMap(input.Parameters, context), - }), - ...(input.ProvisionedProductId !== undefined && { ProvisionedProductId: input.ProvisionedProductId }), - ...(input.ServiceActionId !== undefined && { ServiceActionId: input.ServiceActionId }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_1ExecutionParameterMap(input.Parameters, context), + }), + ...(input.ProvisionedProductId !== undefined && + input.ProvisionedProductId !== null && { ProvisionedProductId: input.ProvisionedProductId }), + ...(input.ServiceActionId !== undefined && + input.ServiceActionId !== null && { ServiceActionId: input.ServiceActionId }), }; }; @@ -7890,17 +7892,26 @@ const serializeAws_json1_1ExecutionParameterMap = ( input: { [key: string]: string[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1ExecutionParameterValueList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ExecutionParameterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetAWSOrganizationsAccessStatusInput = ( @@ -7915,12 +7926,16 @@ const serializeAws_json1_1GetProvisionedProductOutputsInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.OutputKeys !== undefined && { OutputKeys: serializeAws_json1_1OutputKeys(input.OutputKeys, context) }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.ProvisionedProductId !== undefined && { ProvisionedProductId: input.ProvisionedProductId }), - ...(input.ProvisionedProductName !== undefined && { ProvisionedProductName: input.ProvisionedProductName }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.OutputKeys !== undefined && + input.OutputKeys !== null && { OutputKeys: serializeAws_json1_1OutputKeys(input.OutputKeys, context) }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.ProvisionedProductId !== undefined && + input.ProvisionedProductId !== null && { ProvisionedProductId: input.ProvisionedProductId }), + ...(input.ProvisionedProductName !== undefined && + input.ProvisionedProductName !== null && { ProvisionedProductName: input.ProvisionedProductName }), }; }; @@ -7929,12 +7944,15 @@ const serializeAws_json1_1ImportAsProvisionedProductInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.PhysicalId !== undefined && { PhysicalId: input.PhysicalId }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProvisionedProductName !== undefined && { ProvisionedProductName: input.ProvisionedProductName }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.PhysicalId !== undefined && input.PhysicalId !== null && { PhysicalId: input.PhysicalId }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProvisionedProductName !== undefined && + input.ProvisionedProductName !== null && { ProvisionedProductName: input.ProvisionedProductName }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), }; }; @@ -7943,10 +7961,12 @@ const serializeAws_json1_1ListAcceptedPortfolioSharesInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.PortfolioShareType !== undefined && { PortfolioShareType: input.PortfolioShareType }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.PortfolioShareType !== undefined && + input.PortfolioShareType !== null && { PortfolioShareType: input.PortfolioShareType }), }; }; @@ -7955,10 +7975,11 @@ const serializeAws_json1_1ListBudgetsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -7967,20 +7988,22 @@ const serializeAws_json1_1ListConstraintsForPortfolioInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), }; }; const serializeAws_json1_1ListLaunchPathsInput = (input: ListLaunchPathsInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), }; }; @@ -7989,11 +8012,13 @@ const serializeAws_json1_1ListOrganizationPortfolioAccessInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.OrganizationNodeType !== undefined && { OrganizationNodeType: input.OrganizationNodeType }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.OrganizationNodeType !== undefined && + input.OrganizationNodeType !== null && { OrganizationNodeType: input.OrganizationNodeType }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), }; }; @@ -8002,11 +8027,13 @@ const serializeAws_json1_1ListPortfolioAccessInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.OrganizationParentId !== undefined && { OrganizationParentId: input.OrganizationParentId }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.OrganizationParentId !== undefined && + input.OrganizationParentId !== null && { OrganizationParentId: input.OrganizationParentId }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), }; }; @@ -8015,18 +8042,20 @@ const serializeAws_json1_1ListPortfoliosForProductInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), }; }; const serializeAws_json1_1ListPortfoliosInput = (input: ListPortfoliosInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), }; }; @@ -8035,10 +8064,11 @@ const serializeAws_json1_1ListPrincipalsForPortfolioInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), }; }; @@ -8047,13 +8077,16 @@ const serializeAws_json1_1ListProvisionedProductPlansInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.AccessLevelFilter !== undefined && { - AccessLevelFilter: serializeAws_json1_1AccessLevelFilter(input.AccessLevelFilter, context), - }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.ProvisionProductId !== undefined && { ProvisionProductId: input.ProvisionProductId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AccessLevelFilter !== undefined && + input.AccessLevelFilter !== null && { + AccessLevelFilter: serializeAws_json1_1AccessLevelFilter(input.AccessLevelFilter, context), + }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.ProvisionProductId !== undefined && + input.ProvisionProductId !== null && { ProvisionProductId: input.ProvisionProductId }), }; }; @@ -8062,10 +8095,12 @@ const serializeAws_json1_1ListProvisioningArtifactsForServiceActionInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.ServiceActionId !== undefined && { ServiceActionId: input.ServiceActionId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.ServiceActionId !== undefined && + input.ServiceActionId !== null && { ServiceActionId: input.ServiceActionId }), }; }; @@ -8074,22 +8109,26 @@ const serializeAws_json1_1ListProvisioningArtifactsInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), }; }; const serializeAws_json1_1ListRecordHistoryInput = (input: ListRecordHistoryInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.AccessLevelFilter !== undefined && { - AccessLevelFilter: serializeAws_json1_1AccessLevelFilter(input.AccessLevelFilter, context), - }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.SearchFilter !== undefined && { - SearchFilter: serializeAws_json1_1ListRecordHistorySearchFilter(input.SearchFilter, context), - }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AccessLevelFilter !== undefined && + input.AccessLevelFilter !== null && { + AccessLevelFilter: serializeAws_json1_1AccessLevelFilter(input.AccessLevelFilter, context), + }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.SearchFilter !== undefined && + input.SearchFilter !== null && { + SearchFilter: serializeAws_json1_1ListRecordHistorySearchFilter(input.SearchFilter, context), + }), }; }; @@ -8098,8 +8137,8 @@ const serializeAws_json1_1ListRecordHistorySearchFilter = ( context: __SerdeContext ): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -8108,10 +8147,10 @@ const serializeAws_json1_1ListResourcesForTagOptionInput = ( context: __SerdeContext ): any => { return { - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.TagOptionId !== undefined && { TagOptionId: input.TagOptionId }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.TagOptionId !== undefined && input.TagOptionId !== null && { TagOptionId: input.TagOptionId }), }; }; @@ -8120,19 +8159,22 @@ const serializeAws_json1_1ListServiceActionsForProvisioningArtifactInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), }; }; const serializeAws_json1_1ListServiceActionsInput = (input: ListServiceActionsInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), }; }; @@ -8141,56 +8183,85 @@ const serializeAws_json1_1ListStackInstancesForProvisionedProductInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.ProvisionedProductId !== undefined && { ProvisionedProductId: input.ProvisionedProductId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.ProvisionedProductId !== undefined && + input.ProvisionedProductId !== null && { ProvisionedProductId: input.ProvisionedProductId }), }; }; const serializeAws_json1_1ListTagOptionsFilters = (input: ListTagOptionsFilters, context: __SerdeContext): any => { return { - ...(input.Active !== undefined && { Active: input.Active }), - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Active !== undefined && input.Active !== null && { Active: input.Active }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1ListTagOptionsInput = (input: ListTagOptionsInput, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1ListTagOptionsFilters(input.Filters, context) }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ListTagOptionsFilters(input.Filters, context) }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), }; }; const serializeAws_json1_1NotificationArns = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OrganizationNode = (input: OrganizationNode, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1OutputKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ProductViewFilters = (input: { [key: string]: string[] }, context: __SerdeContext): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [ProductViewFilterBy | string, any]) => ({ - ...acc, - [key]: serializeAws_json1_1ProductViewFilterValues(value, context), - }), + (acc: { [key: string]: string[] }, [key, value]: [ProductViewFilterBy | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_json1_1ProductViewFilterValues(value, context), + }; + }, {} ); }; const serializeAws_json1_1ProductViewFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ProvisionedProductFilters = ( @@ -8198,10 +8269,15 @@ const serializeAws_json1_1ProvisionedProductFilters = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [ProvisionedProductViewFilterBy | string, any]) => ({ - ...acc, - [key]: serializeAws_json1_1ProvisionedProductViewFilterValues(value, context), - }), + (acc: { [key: string]: string[] }, [key, value]: [ProvisionedProductViewFilterBy | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_json1_1ProvisionedProductViewFilterValues(value, context), + }; + }, {} ); }; @@ -8210,30 +8286,41 @@ const serializeAws_json1_1ProvisionedProductProperties = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [PropertyKey | string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [PropertyKey | string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ProvisionedProductViewFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ProvisioningArtifactInfo = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ProvisioningArtifactProperties = ( @@ -8241,71 +8328,89 @@ const serializeAws_json1_1ProvisioningArtifactProperties = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisableTemplateValidation !== undefined && { - DisableTemplateValidation: input.DisableTemplateValidation, - }), - ...(input.Info !== undefined && { Info: serializeAws_json1_1ProvisioningArtifactInfo(input.Info, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisableTemplateValidation !== undefined && + input.DisableTemplateValidation !== null && { DisableTemplateValidation: input.DisableTemplateValidation }), + ...(input.Info !== undefined && + input.Info !== null && { Info: serializeAws_json1_1ProvisioningArtifactInfo(input.Info, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1ProvisioningParameter = (input: ProvisioningParameter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1ProvisioningParameters = (input: ProvisioningParameter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ProvisioningParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ProvisioningParameter(entry, context); + }); }; const serializeAws_json1_1ProvisioningPreferences = (input: ProvisioningPreferences, context: __SerdeContext): any => { return { - ...(input.StackSetAccounts !== undefined && { - StackSetAccounts: serializeAws_json1_1StackSetAccounts(input.StackSetAccounts, context), - }), - ...(input.StackSetFailureToleranceCount !== undefined && { - StackSetFailureToleranceCount: input.StackSetFailureToleranceCount, - }), - ...(input.StackSetFailureTolerancePercentage !== undefined && { - StackSetFailureTolerancePercentage: input.StackSetFailureTolerancePercentage, - }), - ...(input.StackSetMaxConcurrencyCount !== undefined && { - StackSetMaxConcurrencyCount: input.StackSetMaxConcurrencyCount, - }), - ...(input.StackSetMaxConcurrencyPercentage !== undefined && { - StackSetMaxConcurrencyPercentage: input.StackSetMaxConcurrencyPercentage, - }), - ...(input.StackSetRegions !== undefined && { - StackSetRegions: serializeAws_json1_1StackSetRegions(input.StackSetRegions, context), - }), + ...(input.StackSetAccounts !== undefined && + input.StackSetAccounts !== null && { + StackSetAccounts: serializeAws_json1_1StackSetAccounts(input.StackSetAccounts, context), + }), + ...(input.StackSetFailureToleranceCount !== undefined && + input.StackSetFailureToleranceCount !== null && { + StackSetFailureToleranceCount: input.StackSetFailureToleranceCount, + }), + ...(input.StackSetFailureTolerancePercentage !== undefined && + input.StackSetFailureTolerancePercentage !== null && { + StackSetFailureTolerancePercentage: input.StackSetFailureTolerancePercentage, + }), + ...(input.StackSetMaxConcurrencyCount !== undefined && + input.StackSetMaxConcurrencyCount !== null && { StackSetMaxConcurrencyCount: input.StackSetMaxConcurrencyCount }), + ...(input.StackSetMaxConcurrencyPercentage !== undefined && + input.StackSetMaxConcurrencyPercentage !== null && { + StackSetMaxConcurrencyPercentage: input.StackSetMaxConcurrencyPercentage, + }), + ...(input.StackSetRegions !== undefined && + input.StackSetRegions !== null && { + StackSetRegions: serializeAws_json1_1StackSetRegions(input.StackSetRegions, context), + }), }; }; const serializeAws_json1_1ProvisionProductInput = (input: ProvisionProductInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.NotificationArns !== undefined && { - NotificationArns: serializeAws_json1_1NotificationArns(input.NotificationArns, context), - }), - ...(input.PathId !== undefined && { PathId: input.PathId }), - ...(input.PathName !== undefined && { PathName: input.PathName }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProductName !== undefined && { ProductName: input.ProductName }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.NotificationArns !== undefined && + input.NotificationArns !== null && { + NotificationArns: serializeAws_json1_1NotificationArns(input.NotificationArns, context), + }), + ...(input.PathId !== undefined && input.PathId !== null && { PathId: input.PathId }), + ...(input.PathName !== undefined && input.PathName !== null && { PathName: input.PathName }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProductName !== undefined && input.ProductName !== null && { ProductName: input.ProductName }), ProvisionToken: input.ProvisionToken ?? generateIdempotencyToken(), - ...(input.ProvisionedProductName !== undefined && { ProvisionedProductName: input.ProvisionedProductName }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), - ...(input.ProvisioningArtifactName !== undefined && { ProvisioningArtifactName: input.ProvisioningArtifactName }), - ...(input.ProvisioningParameters !== undefined && { - ProvisioningParameters: serializeAws_json1_1ProvisioningParameters(input.ProvisioningParameters, context), - }), - ...(input.ProvisioningPreferences !== undefined && { - ProvisioningPreferences: serializeAws_json1_1ProvisioningPreferences(input.ProvisioningPreferences, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ProvisionedProductName !== undefined && + input.ProvisionedProductName !== null && { ProvisionedProductName: input.ProvisionedProductName }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.ProvisioningArtifactName !== undefined && + input.ProvisioningArtifactName !== null && { ProvisioningArtifactName: input.ProvisioningArtifactName }), + ...(input.ProvisioningParameters !== undefined && + input.ProvisioningParameters !== null && { + ProvisioningParameters: serializeAws_json1_1ProvisioningParameters(input.ProvisioningParameters, context), + }), + ...(input.ProvisioningPreferences !== undefined && + input.ProvisioningPreferences !== null && { + ProvisioningPreferences: serializeAws_json1_1ProvisioningPreferences(input.ProvisioningPreferences, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; @@ -8314,9 +8419,11 @@ const serializeAws_json1_1RejectPortfolioShareInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), - ...(input.PortfolioShareType !== undefined && { PortfolioShareType: input.PortfolioShareType }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), + ...(input.PortfolioShareType !== undefined && + input.PortfolioShareType !== null && { PortfolioShareType: input.PortfolioShareType }), }; }; @@ -8325,12 +8432,14 @@ const serializeAws_json1_1ScanProvisionedProductsInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.AccessLevelFilter !== undefined && { - AccessLevelFilter: serializeAws_json1_1AccessLevelFilter(input.AccessLevelFilter, context), - }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AccessLevelFilter !== undefined && + input.AccessLevelFilter !== null && { + AccessLevelFilter: serializeAws_json1_1AccessLevelFilter(input.AccessLevelFilter, context), + }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), }; }; @@ -8339,25 +8448,29 @@ const serializeAws_json1_1SearchProductsAsAdminInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1ProductViewFilters(input.Filters, context) }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), - ...(input.ProductSource !== undefined && { ProductSource: input.ProductSource }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ProductViewFilters(input.Filters, context) }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.PortfolioId !== undefined && input.PortfolioId !== null && { PortfolioId: input.PortfolioId }), + ...(input.ProductSource !== undefined && input.ProductSource !== null && { ProductSource: input.ProductSource }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; const serializeAws_json1_1SearchProductsInput = (input: SearchProductsInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1ProductViewFilters(input.Filters, context) }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ProductViewFilters(input.Filters, context) }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -8366,17 +8479,18 @@ const serializeAws_json1_1SearchProvisionedProductsInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.AccessLevelFilter !== undefined && { - AccessLevelFilter: serializeAws_json1_1AccessLevelFilter(input.AccessLevelFilter, context), - }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1ProvisionedProductFilters(input.Filters, context), - }), - ...(input.PageSize !== undefined && { PageSize: input.PageSize }), - ...(input.PageToken !== undefined && { PageToken: input.PageToken }), - ...(input.SortBy !== undefined && { SortBy: input.SortBy }), - ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AccessLevelFilter !== undefined && + input.AccessLevelFilter !== null && { + AccessLevelFilter: serializeAws_json1_1AccessLevelFilter(input.AccessLevelFilter, context), + }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ProvisionedProductFilters(input.Filters, context) }), + ...(input.PageSize !== undefined && input.PageSize !== null && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && input.PageToken !== null && { PageToken: input.PageToken }), + ...(input.SortBy !== undefined && input.SortBy !== null && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }), }; }; @@ -8385,9 +8499,11 @@ const serializeAws_json1_1ServiceActionAssociation = ( context: __SerdeContext ): any => { return { - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), - ...(input.ServiceActionId !== undefined && { ServiceActionId: input.ServiceActionId }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.ServiceActionId !== undefined && + input.ServiceActionId !== null && { ServiceActionId: input.ServiceActionId }), }; }; @@ -8395,7 +8511,14 @@ const serializeAws_json1_1ServiceActionAssociations = ( input: ServiceActionAssociation[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ServiceActionAssociation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServiceActionAssociation(entry, context); + }); }; const serializeAws_json1_1ServiceActionDefinitionMap = ( @@ -8403,10 +8526,15 @@ const serializeAws_json1_1ServiceActionDefinitionMap = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [ServiceActionDefinitionKey | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [ServiceActionDefinitionKey | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -8415,7 +8543,14 @@ const serializeAws_json1_1SourceProvisioningArtifactProperties = ( input: { [key: string]: string }[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1SourceProvisioningArtifactPropertiesMap(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SourceProvisioningArtifactPropertiesMap(entry, context); + }); }; const serializeAws_json1_1SourceProvisioningArtifactPropertiesMap = ( @@ -8423,35 +8558,68 @@ const serializeAws_json1_1SourceProvisioningArtifactPropertiesMap = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [ProvisioningArtifactPropertyName | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [ProvisioningArtifactPropertyName | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; const serializeAws_json1_1StackSetAccounts = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StackSetRegions = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TerminateProvisionedProductInput = ( @@ -8459,49 +8627,61 @@ const serializeAws_json1_1TerminateProvisionedProductInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.IgnoreErrors !== undefined && { IgnoreErrors: input.IgnoreErrors }), - ...(input.ProvisionedProductId !== undefined && { ProvisionedProductId: input.ProvisionedProductId }), - ...(input.ProvisionedProductName !== undefined && { ProvisionedProductName: input.ProvisionedProductName }), - ...(input.RetainPhysicalResources !== undefined && { RetainPhysicalResources: input.RetainPhysicalResources }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.IgnoreErrors !== undefined && input.IgnoreErrors !== null && { IgnoreErrors: input.IgnoreErrors }), + ...(input.ProvisionedProductId !== undefined && + input.ProvisionedProductId !== null && { ProvisionedProductId: input.ProvisionedProductId }), + ...(input.ProvisionedProductName !== undefined && + input.ProvisionedProductName !== null && { ProvisionedProductName: input.ProvisionedProductName }), + ...(input.RetainPhysicalResources !== undefined && + input.RetainPhysicalResources !== null && { RetainPhysicalResources: input.RetainPhysicalResources }), TerminateToken: input.TerminateToken ?? generateIdempotencyToken(), }; }; const serializeAws_json1_1UpdateConstraintInput = (input: UpdateConstraintInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Parameters !== undefined && { Parameters: input.Parameters }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Parameters !== undefined && input.Parameters !== null && { Parameters: input.Parameters }), }; }; const serializeAws_json1_1UpdatePortfolioInput = (input: UpdatePortfolioInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.AddTags !== undefined && { AddTags: serializeAws_json1_1AddTags(input.AddTags, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.ProviderName !== undefined && { ProviderName: input.ProviderName }), - ...(input.RemoveTags !== undefined && { RemoveTags: serializeAws_json1_1TagKeys(input.RemoveTags, context) }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AddTags !== undefined && + input.AddTags !== null && { AddTags: serializeAws_json1_1AddTags(input.AddTags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }), + ...(input.RemoveTags !== undefined && + input.RemoveTags !== null && { RemoveTags: serializeAws_json1_1TagKeys(input.RemoveTags, context) }), }; }; const serializeAws_json1_1UpdateProductInput = (input: UpdateProductInput, context: __SerdeContext): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.AddTags !== undefined && { AddTags: serializeAws_json1_1AddTags(input.AddTags, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Distributor !== undefined && { Distributor: input.Distributor }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Owner !== undefined && { Owner: input.Owner }), - ...(input.RemoveTags !== undefined && { RemoveTags: serializeAws_json1_1TagKeys(input.RemoveTags, context) }), - ...(input.SupportDescription !== undefined && { SupportDescription: input.SupportDescription }), - ...(input.SupportEmail !== undefined && { SupportEmail: input.SupportEmail }), - ...(input.SupportUrl !== undefined && { SupportUrl: input.SupportUrl }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AddTags !== undefined && + input.AddTags !== null && { AddTags: serializeAws_json1_1AddTags(input.AddTags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Distributor !== undefined && input.Distributor !== null && { Distributor: input.Distributor }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Owner !== undefined && input.Owner !== null && { Owner: input.Owner }), + ...(input.RemoveTags !== undefined && + input.RemoveTags !== null && { RemoveTags: serializeAws_json1_1TagKeys(input.RemoveTags, context) }), + ...(input.SupportDescription !== undefined && + input.SupportDescription !== null && { SupportDescription: input.SupportDescription }), + ...(input.SupportEmail !== undefined && input.SupportEmail !== null && { SupportEmail: input.SupportEmail }), + ...(input.SupportUrl !== undefined && input.SupportUrl !== null && { SupportUrl: input.SupportUrl }), }; }; @@ -8510,25 +8690,32 @@ const serializeAws_json1_1UpdateProvisionedProductInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.PathId !== undefined && { PathId: input.PathId }), - ...(input.PathName !== undefined && { PathName: input.PathName }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProductName !== undefined && { ProductName: input.ProductName }), - ...(input.ProvisionedProductId !== undefined && { ProvisionedProductId: input.ProvisionedProductId }), - ...(input.ProvisionedProductName !== undefined && { ProvisionedProductName: input.ProvisionedProductName }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), - ...(input.ProvisioningArtifactName !== undefined && { ProvisioningArtifactName: input.ProvisioningArtifactName }), - ...(input.ProvisioningParameters !== undefined && { - ProvisioningParameters: serializeAws_json1_1UpdateProvisioningParameters(input.ProvisioningParameters, context), - }), - ...(input.ProvisioningPreferences !== undefined && { - ProvisioningPreferences: serializeAws_json1_1UpdateProvisioningPreferences( - input.ProvisioningPreferences, - context - ), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.PathId !== undefined && input.PathId !== null && { PathId: input.PathId }), + ...(input.PathName !== undefined && input.PathName !== null && { PathName: input.PathName }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProductName !== undefined && input.ProductName !== null && { ProductName: input.ProductName }), + ...(input.ProvisionedProductId !== undefined && + input.ProvisionedProductId !== null && { ProvisionedProductId: input.ProvisionedProductId }), + ...(input.ProvisionedProductName !== undefined && + input.ProvisionedProductName !== null && { ProvisionedProductName: input.ProvisionedProductName }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.ProvisioningArtifactName !== undefined && + input.ProvisioningArtifactName !== null && { ProvisioningArtifactName: input.ProvisioningArtifactName }), + ...(input.ProvisioningParameters !== undefined && + input.ProvisioningParameters !== null && { + ProvisioningParameters: serializeAws_json1_1UpdateProvisioningParameters(input.ProvisioningParameters, context), + }), + ...(input.ProvisioningPreferences !== undefined && + input.ProvisioningPreferences !== null && { + ProvisioningPreferences: serializeAws_json1_1UpdateProvisioningPreferences( + input.ProvisioningPreferences, + context + ), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), UpdateToken: input.UpdateToken ?? generateIdempotencyToken(), }; }; @@ -8538,15 +8725,18 @@ const serializeAws_json1_1UpdateProvisionedProductPropertiesInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), - ...(input.ProvisionedProductId !== undefined && { ProvisionedProductId: input.ProvisionedProductId }), - ...(input.ProvisionedProductProperties !== undefined && { - ProvisionedProductProperties: serializeAws_json1_1ProvisionedProductProperties( - input.ProvisionedProductProperties, - context - ), - }), + ...(input.ProvisionedProductId !== undefined && + input.ProvisionedProductId !== null && { ProvisionedProductId: input.ProvisionedProductId }), + ...(input.ProvisionedProductProperties !== undefined && + input.ProvisionedProductProperties !== null && { + ProvisionedProductProperties: serializeAws_json1_1ProvisionedProductProperties( + input.ProvisionedProductProperties, + context + ), + }), }; }; @@ -8555,13 +8745,15 @@ const serializeAws_json1_1UpdateProvisioningArtifactInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Active !== undefined && { Active: input.Active }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Guidance !== undefined && { Guidance: input.Guidance }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ProductId !== undefined && { ProductId: input.ProductId }), - ...(input.ProvisioningArtifactId !== undefined && { ProvisioningArtifactId: input.ProvisioningArtifactId }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Active !== undefined && input.Active !== null && { Active: input.Active }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Guidance !== undefined && input.Guidance !== null && { Guidance: input.Guidance }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ProductId !== undefined && input.ProductId !== null && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && + input.ProvisioningArtifactId !== null && { ProvisioningArtifactId: input.ProvisioningArtifactId }), }; }; @@ -8570,9 +8762,10 @@ const serializeAws_json1_1UpdateProvisioningParameter = ( context: __SerdeContext ): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.UsePreviousValue !== undefined && { UsePreviousValue: input.UsePreviousValue }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.UsePreviousValue !== undefined && + input.UsePreviousValue !== null && { UsePreviousValue: input.UsePreviousValue }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -8580,7 +8773,14 @@ const serializeAws_json1_1UpdateProvisioningParameters = ( input: UpdateProvisioningParameter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1UpdateProvisioningParameter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1UpdateProvisioningParameter(entry, context); + }); }; const serializeAws_json1_1UpdateProvisioningPreferences = ( @@ -8588,25 +8788,30 @@ const serializeAws_json1_1UpdateProvisioningPreferences = ( context: __SerdeContext ): any => { return { - ...(input.StackSetAccounts !== undefined && { - StackSetAccounts: serializeAws_json1_1StackSetAccounts(input.StackSetAccounts, context), - }), - ...(input.StackSetFailureToleranceCount !== undefined && { - StackSetFailureToleranceCount: input.StackSetFailureToleranceCount, - }), - ...(input.StackSetFailureTolerancePercentage !== undefined && { - StackSetFailureTolerancePercentage: input.StackSetFailureTolerancePercentage, - }), - ...(input.StackSetMaxConcurrencyCount !== undefined && { - StackSetMaxConcurrencyCount: input.StackSetMaxConcurrencyCount, - }), - ...(input.StackSetMaxConcurrencyPercentage !== undefined && { - StackSetMaxConcurrencyPercentage: input.StackSetMaxConcurrencyPercentage, - }), - ...(input.StackSetOperationType !== undefined && { StackSetOperationType: input.StackSetOperationType }), - ...(input.StackSetRegions !== undefined && { - StackSetRegions: serializeAws_json1_1StackSetRegions(input.StackSetRegions, context), - }), + ...(input.StackSetAccounts !== undefined && + input.StackSetAccounts !== null && { + StackSetAccounts: serializeAws_json1_1StackSetAccounts(input.StackSetAccounts, context), + }), + ...(input.StackSetFailureToleranceCount !== undefined && + input.StackSetFailureToleranceCount !== null && { + StackSetFailureToleranceCount: input.StackSetFailureToleranceCount, + }), + ...(input.StackSetFailureTolerancePercentage !== undefined && + input.StackSetFailureTolerancePercentage !== null && { + StackSetFailureTolerancePercentage: input.StackSetFailureTolerancePercentage, + }), + ...(input.StackSetMaxConcurrencyCount !== undefined && + input.StackSetMaxConcurrencyCount !== null && { StackSetMaxConcurrencyCount: input.StackSetMaxConcurrencyCount }), + ...(input.StackSetMaxConcurrencyPercentage !== undefined && + input.StackSetMaxConcurrencyPercentage !== null && { + StackSetMaxConcurrencyPercentage: input.StackSetMaxConcurrencyPercentage, + }), + ...(input.StackSetOperationType !== undefined && + input.StackSetOperationType !== null && { StackSetOperationType: input.StackSetOperationType }), + ...(input.StackSetRegions !== undefined && + input.StackSetRegions !== null && { + StackSetRegions: serializeAws_json1_1StackSetRegions(input.StackSetRegions, context), + }), }; }; @@ -8615,21 +8820,23 @@ const serializeAws_json1_1UpdateServiceActionInput = ( context: __SerdeContext ): any => { return { - ...(input.AcceptLanguage !== undefined && { AcceptLanguage: input.AcceptLanguage }), - ...(input.Definition !== undefined && { - Definition: serializeAws_json1_1ServiceActionDefinitionMap(input.Definition, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AcceptLanguage !== undefined && + input.AcceptLanguage !== null && { AcceptLanguage: input.AcceptLanguage }), + ...(input.Definition !== undefined && + input.Definition !== null && { + Definition: serializeAws_json1_1ServiceActionDefinitionMap(input.Definition, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1UpdateTagOptionInput = (input: UpdateTagOptionInput, context: __SerdeContext): any => { return { - ...(input.Active !== undefined && { Active: input.Active }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Active !== undefined && input.Active !== null && { Active: input.Active }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -8641,11 +8848,25 @@ const deserializeAws_json1_1AcceptPortfolioShareOutput = ( }; const deserializeAws_json1_1AccountIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AllowedValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AssociateBudgetWithResourceOutput = ( @@ -8714,7 +8935,14 @@ const deserializeAws_json1_1BudgetDetail = (output: any, context: __SerdeContext }; const deserializeAws_json1_1Budgets = (output: any, context: __SerdeContext): BudgetDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BudgetDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BudgetDetail(entry, context); + }); }; const deserializeAws_json1_1CloudWatchDashboard = (output: any, context: __SerdeContext): CloudWatchDashboard => { @@ -8724,7 +8952,14 @@ const deserializeAws_json1_1CloudWatchDashboard = (output: any, context: __Serde }; const deserializeAws_json1_1CloudWatchDashboards = (output: any, context: __SerdeContext): CloudWatchDashboard[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CloudWatchDashboard(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CloudWatchDashboard(entry, context); + }); }; const deserializeAws_json1_1ConstraintDetail = (output: any, context: __SerdeContext): ConstraintDetail => { @@ -8739,11 +8974,25 @@ const deserializeAws_json1_1ConstraintDetail = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ConstraintDetails = (output: any, context: __SerdeContext): ConstraintDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConstraintDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConstraintDetail(entry, context); + }); }; const deserializeAws_json1_1ConstraintSummaries = (output: any, context: __SerdeContext): ConstraintSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConstraintSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConstraintSummary(entry, context); + }); }; const deserializeAws_json1_1ConstraintSummary = (output: any, context: __SerdeContext): ConstraintSummary => { @@ -9288,11 +9537,25 @@ const deserializeAws_json1_1ExecutionParameter = (output: any, context: __SerdeC }; const deserializeAws_json1_1ExecutionParameters = (output: any, context: __SerdeContext): ExecutionParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExecutionParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExecutionParameter(entry, context); + }); }; const deserializeAws_json1_1ExecutionParameterValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FailedServiceActionAssociation = ( @@ -9316,7 +9579,14 @@ const deserializeAws_json1_1FailedServiceActionAssociations = ( output: any, context: __SerdeContext ): FailedServiceActionAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedServiceActionAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedServiceActionAssociation(entry, context); + }); }; const deserializeAws_json1_1GetAWSOrganizationsAccessStatusOutput = ( @@ -9377,11 +9647,25 @@ const deserializeAws_json1_1LaunchPath = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1LaunchPaths = (output: any, context: __SerdeContext): LaunchPath[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LaunchPath(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LaunchPath(entry, context); + }); }; const deserializeAws_json1_1LaunchPathSummaries = (output: any, context: __SerdeContext): LaunchPathSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LaunchPathSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LaunchPathSummary(entry, context); + }); }; const deserializeAws_json1_1LaunchPathSummary = (output: any, context: __SerdeContext): LaunchPathSummary => { @@ -9645,11 +9929,25 @@ const deserializeAws_json1_1ListTagOptionsOutput = (output: any, context: __Serd }; const deserializeAws_json1_1Namespaces = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1NotificationArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1OperationNotSupportedException = ( @@ -9669,7 +9967,14 @@ const deserializeAws_json1_1OrganizationNode = (output: any, context: __SerdeCon }; const deserializeAws_json1_1OrganizationNodes = (output: any, context: __SerdeContext): OrganizationNode[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationNode(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationNode(entry, context); + }); }; const deserializeAws_json1_1ParameterConstraints = (output: any, context: __SerdeContext): ParameterConstraints => { @@ -9696,7 +10001,14 @@ const deserializeAws_json1_1PortfolioDetail = (output: any, context: __SerdeCont }; const deserializeAws_json1_1PortfolioDetails = (output: any, context: __SerdeContext): PortfolioDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PortfolioDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PortfolioDetail(entry, context); + }); }; const deserializeAws_json1_1Principal = (output: any, context: __SerdeContext): Principal => { @@ -9708,7 +10020,14 @@ const deserializeAws_json1_1Principal = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Principals = (output: any, context: __SerdeContext): Principal[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Principal(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Principal(entry, context); + }); }; const deserializeAws_json1_1ProductViewAggregations = ( @@ -9716,10 +10035,15 @@ const deserializeAws_json1_1ProductViewAggregations = ( context: __SerdeContext ): { [key: string]: ProductViewAggregationValue[] } => { return Object.entries(output).reduce( - (acc: { [key: string]: ProductViewAggregationValue[] }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_1ProductViewAggregationValues(value, context), - }), + (acc: { [key: string]: ProductViewAggregationValue[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_1ProductViewAggregationValues(value, context), + }; + }, {} ); }; @@ -9739,7 +10063,14 @@ const deserializeAws_json1_1ProductViewAggregationValues = ( output: any, context: __SerdeContext ): ProductViewAggregationValue[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProductViewAggregationValue(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProductViewAggregationValue(entry, context); + }); }; const deserializeAws_json1_1ProductViewDetail = (output: any, context: __SerdeContext): ProductViewDetail => { @@ -9758,11 +10089,25 @@ const deserializeAws_json1_1ProductViewDetail = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ProductViewDetails = (output: any, context: __SerdeContext): ProductViewDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProductViewDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProductViewDetail(entry, context); + }); }; const deserializeAws_json1_1ProductViewSummaries = (output: any, context: __SerdeContext): ProductViewSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProductViewSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProductViewSummary(entry, context); + }); }; const deserializeAws_json1_1ProductViewSummary = (output: any, context: __SerdeContext): ProductViewSummary => { @@ -9836,7 +10181,14 @@ const deserializeAws_json1_1ProvisionedProductAttributes = ( output: any, context: __SerdeContext ): ProvisionedProductAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisionedProductAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisionedProductAttribute(entry, context); + }); }; const deserializeAws_json1_1ProvisionedProductDetail = ( @@ -9880,7 +10232,14 @@ const deserializeAws_json1_1ProvisionedProductDetails = ( output: any, context: __SerdeContext ): ProvisionedProductDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisionedProductDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisionedProductDetail(entry, context); + }); }; const deserializeAws_json1_1ProvisionedProductPlanDetails = ( @@ -9933,7 +10292,14 @@ const deserializeAws_json1_1ProvisionedProductPlans = ( output: any, context: __SerdeContext ): ProvisionedProductPlanSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisionedProductPlanSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisionedProductPlanSummary(entry, context); + }); }; const deserializeAws_json1_1ProvisionedProductPlanSummary = ( @@ -9963,13 +10329,15 @@ const deserializeAws_json1_1ProvisionedProductProperties = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [PropertyKey | string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [PropertyKey | string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ProvisioningArtifact = (output: any, context: __SerdeContext): ProvisioningArtifact => { @@ -10007,20 +10375,29 @@ const deserializeAws_json1_1ProvisioningArtifactDetails = ( output: any, context: __SerdeContext ): ProvisioningArtifactDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisioningArtifactDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisioningArtifactDetail(entry, context); + }); }; const deserializeAws_json1_1ProvisioningArtifactInfo = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ProvisioningArtifactOutput = ( @@ -10037,7 +10414,14 @@ const deserializeAws_json1_1ProvisioningArtifactOutputs = ( output: any, context: __SerdeContext ): ProvisioningArtifactOutput[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisioningArtifactOutput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisioningArtifactOutput(entry, context); + }); }; const deserializeAws_json1_1ProvisioningArtifactParameter = ( @@ -10062,7 +10446,14 @@ const deserializeAws_json1_1ProvisioningArtifactParameters = ( output: any, context: __SerdeContext ): ProvisioningArtifactParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisioningArtifactParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisioningArtifactParameter(entry, context); + }); }; const deserializeAws_json1_1ProvisioningArtifactPreferences = ( @@ -10082,14 +10473,28 @@ const deserializeAws_json1_1ProvisioningArtifactPreferences = ( }; const deserializeAws_json1_1ProvisioningArtifacts = (output: any, context: __SerdeContext): ProvisioningArtifact[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisioningArtifact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisioningArtifact(entry, context); + }); }; const deserializeAws_json1_1ProvisioningArtifactSummaries = ( output: any, context: __SerdeContext ): ProvisioningArtifactSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisioningArtifactSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisioningArtifactSummary(entry, context); + }); }; const deserializeAws_json1_1ProvisioningArtifactSummary = ( @@ -10131,7 +10536,14 @@ const deserializeAws_json1_1ProvisioningArtifactViews = ( output: any, context: __SerdeContext ): ProvisioningArtifactView[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProvisioningArtifactView(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProvisioningArtifactView(entry, context); + }); }; const deserializeAws_json1_1ProvisionProductOutput = (output: any, context: __SerdeContext): ProvisionProductOutput => { @@ -10188,7 +10600,14 @@ const deserializeAws_json1_1RecordDetail = (output: any, context: __SerdeContext }; const deserializeAws_json1_1RecordDetails = (output: any, context: __SerdeContext): RecordDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RecordDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RecordDetail(entry, context); + }); }; const deserializeAws_json1_1RecordError = (output: any, context: __SerdeContext): RecordError => { @@ -10199,7 +10618,14 @@ const deserializeAws_json1_1RecordError = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1RecordErrors = (output: any, context: __SerdeContext): RecordError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RecordError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RecordError(entry, context); + }); }; const deserializeAws_json1_1RecordOutput = (output: any, context: __SerdeContext): RecordOutput => { @@ -10211,7 +10637,14 @@ const deserializeAws_json1_1RecordOutput = (output: any, context: __SerdeContext }; const deserializeAws_json1_1RecordOutputs = (output: any, context: __SerdeContext): RecordOutput[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RecordOutput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RecordOutput(entry, context); + }); }; const deserializeAws_json1_1RecordTag = (output: any, context: __SerdeContext): RecordTag => { @@ -10222,7 +10655,14 @@ const deserializeAws_json1_1RecordTag = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1RecordTags = (output: any, context: __SerdeContext): RecordTag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RecordTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RecordTag(entry, context); + }); }; const deserializeAws_json1_1RejectPortfolioShareOutput = ( @@ -10269,11 +10709,25 @@ const deserializeAws_json1_1ResourceChangeDetail = (output: any, context: __Serd }; const deserializeAws_json1_1ResourceChangeDetails = (output: any, context: __SerdeContext): ResourceChangeDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceChangeDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceChangeDetail(entry, context); + }); }; const deserializeAws_json1_1ResourceChanges = (output: any, context: __SerdeContext): ResourceChange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceChange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceChange(entry, context); + }); }; const deserializeAws_json1_1ResourceDetail = (output: any, context: __SerdeContext): ResourceDetail => { @@ -10290,7 +10744,14 @@ const deserializeAws_json1_1ResourceDetail = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ResourceDetails = (output: any, context: __SerdeContext): ResourceDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceDetail(entry, context); + }); }; const deserializeAws_json1_1ResourceInUseException = (output: any, context: __SerdeContext): ResourceInUseException => { @@ -10337,7 +10798,14 @@ const deserializeAws_json1_1ScanProvisionedProductsOutput = ( }; const deserializeAws_json1_1Scope = (output: any, context: __SerdeContext): (ResourceAttribute | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SearchProductsAsAdminOutput = ( @@ -10392,10 +10860,15 @@ const deserializeAws_json1_1ServiceActionDefinitionMap = ( context: __SerdeContext ): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [ServiceActionDefinitionKey | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [ServiceActionDefinitionKey | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -10414,7 +10887,14 @@ const deserializeAws_json1_1ServiceActionDetail = (output: any, context: __Serde }; const deserializeAws_json1_1ServiceActionSummaries = (output: any, context: __SerdeContext): ServiceActionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServiceActionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServiceActionSummary(entry, context); + }); }; const deserializeAws_json1_1ServiceActionSummary = (output: any, context: __SerdeContext): ServiceActionSummary => { @@ -10452,7 +10932,14 @@ const deserializeAws_json1_1ShareError = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ShareErrors = (output: any, context: __SerdeContext): ShareError[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ShareError(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ShareError(entry, context); + }); }; const deserializeAws_json1_1StackInstance = (output: any, context: __SerdeContext): StackInstance => { @@ -10467,19 +10954,47 @@ const deserializeAws_json1_1StackInstance = (output: any, context: __SerdeContex }; const deserializeAws_json1_1StackInstances = (output: any, context: __SerdeContext): StackInstance[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StackInstance(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StackInstance(entry, context); + }); }; const deserializeAws_json1_1StackSetAccounts = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1StackSetRegions = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SuccessfulShares = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -10499,7 +11014,14 @@ const deserializeAws_json1_1TagOptionDetail = (output: any, context: __SerdeCont }; const deserializeAws_json1_1TagOptionDetails = (output: any, context: __SerdeContext): TagOptionDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TagOptionDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TagOptionDetail(entry, context); + }); }; const deserializeAws_json1_1TagOptionNotMigratedException = ( @@ -10512,7 +11034,14 @@ const deserializeAws_json1_1TagOptionNotMigratedException = ( }; const deserializeAws_json1_1TagOptionSummaries = (output: any, context: __SerdeContext): TagOptionSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TagOptionSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TagOptionSummary(entry, context); + }); }; const deserializeAws_json1_1TagOptionSummary = (output: any, context: __SerdeContext): TagOptionSummary => { @@ -10526,11 +11055,25 @@ const deserializeAws_json1_1TagOptionSummary = (output: any, context: __SerdeCon }; const deserializeAws_json1_1TagOptionValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TerminateProvisionedProductOutput = ( @@ -10644,7 +11187,14 @@ const deserializeAws_json1_1UpdateProvisioningParameters = ( output: any, context: __SerdeContext ): UpdateProvisioningParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UpdateProvisioningParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UpdateProvisioningParameter(entry, context); + }); }; const deserializeAws_json1_1UpdateServiceActionOutput = ( @@ -10676,7 +11226,14 @@ const deserializeAws_json1_1UsageInstruction = (output: any, context: __SerdeCon }; const deserializeAws_json1_1UsageInstructions = (output: any, context: __SerdeContext): UsageInstruction[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1UsageInstruction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1UsageInstruction(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -10729,3 +11286,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-service-quotas/protocols/Aws_json1_1.ts b/clients/client-service-quotas/protocols/Aws_json1_1.ts index 5669f4eeb11d..5f1bef9b0d8f 100644 --- a/clients/client-service-quotas/protocols/Aws_json1_1.ts +++ b/clients/client-service-quotas/protocols/Aws_json1_1.ts @@ -124,7 +124,7 @@ export const serializeAws_json1_1AssociateServiceQuotaTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.AssociateServiceQuotaTemplate", }; let body: any; @@ -137,7 +137,7 @@ export const serializeAws_json1_1DeleteServiceQuotaIncreaseRequestFromTemplateCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.DeleteServiceQuotaIncreaseRequestFromTemplate", }; let body: any; @@ -150,7 +150,7 @@ export const serializeAws_json1_1DisassociateServiceQuotaTemplateCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.DisassociateServiceQuotaTemplate", }; let body: any; @@ -163,7 +163,7 @@ export const serializeAws_json1_1GetAssociationForServiceQuotaTemplateCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.GetAssociationForServiceQuotaTemplate", }; let body: any; @@ -176,7 +176,7 @@ export const serializeAws_json1_1GetAWSDefaultServiceQuotaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.GetAWSDefaultServiceQuota", }; let body: any; @@ -189,7 +189,7 @@ export const serializeAws_json1_1GetRequestedServiceQuotaChangeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.GetRequestedServiceQuotaChange", }; let body: any; @@ -202,7 +202,7 @@ export const serializeAws_json1_1GetServiceQuotaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.GetServiceQuota", }; let body: any; @@ -215,7 +215,7 @@ export const serializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.GetServiceQuotaIncreaseRequestFromTemplate", }; let body: any; @@ -228,7 +228,7 @@ export const serializeAws_json1_1ListAWSDefaultServiceQuotasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.ListAWSDefaultServiceQuotas", }; let body: any; @@ -241,7 +241,7 @@ export const serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.ListRequestedServiceQuotaChangeHistory", }; let body: any; @@ -254,7 +254,7 @@ export const serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryByQuotaCo context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.ListRequestedServiceQuotaChangeHistoryByQuota", }; let body: any; @@ -267,7 +267,7 @@ export const serializeAws_json1_1ListServiceQuotaIncreaseRequestsInTemplateComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.ListServiceQuotaIncreaseRequestsInTemplate", }; let body: any; @@ -280,7 +280,7 @@ export const serializeAws_json1_1ListServiceQuotasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.ListServiceQuotas", }; let body: any; @@ -293,7 +293,7 @@ export const serializeAws_json1_1ListServicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.ListServices", }; let body: any; @@ -306,7 +306,7 @@ export const serializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.PutServiceQuotaIncreaseRequestIntoTemplate", }; let body: any; @@ -319,7 +319,7 @@ export const serializeAws_json1_1RequestServiceQuotaIncreaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "ServiceQuotasV20190624.RequestServiceQuotaIncrease", }; let body: any; @@ -354,8 +354,7 @@ const deserializeAws_json1_1AssociateServiceQuotaTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -465,8 +464,7 @@ const deserializeAws_json1_1DeleteServiceQuotaIncreaseRequestFromTemplateCommand }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -584,8 +582,7 @@ const deserializeAws_json1_1DisassociateServiceQuotaTemplateCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -695,8 +692,7 @@ const deserializeAws_json1_1GetAssociationForServiceQuotaTemplateCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -806,8 +802,7 @@ const deserializeAws_json1_1GetAWSDefaultServiceQuotaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -893,8 +888,7 @@ const deserializeAws_json1_1GetRequestedServiceQuotaChangeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -980,8 +974,7 @@ const deserializeAws_json1_1GetServiceQuotaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -1067,8 +1060,7 @@ const deserializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -1186,8 +1178,7 @@ const deserializeAws_json1_1ListAWSDefaultServiceQuotasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -1281,8 +1272,7 @@ const deserializeAws_json1_1ListRequestedServiceQuotaChangeHistoryCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -1376,8 +1366,7 @@ const deserializeAws_json1_1ListRequestedServiceQuotaChangeHistoryByQuotaCommand }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -1471,8 +1460,7 @@ const deserializeAws_json1_1ListServiceQuotaIncreaseRequestsInTemplateCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -1582,8 +1570,7 @@ const deserializeAws_json1_1ListServiceQuotasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -1677,8 +1664,7 @@ const deserializeAws_json1_1ListServicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -1764,8 +1750,7 @@ const deserializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -1891,8 +1876,7 @@ const deserializeAws_json1_1RequestServiceQuotaIncreaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": @@ -2220,9 +2204,9 @@ const serializeAws_json1_1DeleteServiceQuotaIncreaseRequestFromTemplateRequest = context: __SerdeContext ): any => { return { - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), - ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), + ...(input.QuotaCode !== undefined && input.QuotaCode !== null && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; @@ -2245,8 +2229,8 @@ const serializeAws_json1_1GetAWSDefaultServiceQuotaRequest = ( context: __SerdeContext ): any => { return { - ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.QuotaCode !== undefined && input.QuotaCode !== null && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; @@ -2255,7 +2239,7 @@ const serializeAws_json1_1GetRequestedServiceQuotaChangeRequest = ( context: __SerdeContext ): any => { return { - ...(input.RequestId !== undefined && { RequestId: input.RequestId }), + ...(input.RequestId !== undefined && input.RequestId !== null && { RequestId: input.RequestId }), }; }; @@ -2264,16 +2248,16 @@ const serializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), - ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), + ...(input.QuotaCode !== undefined && input.QuotaCode !== null && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; const serializeAws_json1_1GetServiceQuotaRequest = (input: GetServiceQuotaRequest, context: __SerdeContext): any => { return { - ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.QuotaCode !== undefined && input.QuotaCode !== null && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; @@ -2282,9 +2266,9 @@ const serializeAws_json1_1ListAWSDefaultServiceQuotasRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; @@ -2293,11 +2277,11 @@ const serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryByQuotaRequest = context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.QuotaCode !== undefined && input.QuotaCode !== null && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -2306,10 +2290,10 @@ const serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -2318,10 +2302,10 @@ const serializeAws_json1_1ListServiceQuotaIncreaseRequestsInTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; @@ -2330,16 +2314,16 @@ const serializeAws_json1_1ListServiceQuotasRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; const serializeAws_json1_1ListServicesRequest = (input: ListServicesRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2348,10 +2332,10 @@ const serializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateRequest = ( context: __SerdeContext ): any => { return { - ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), - ...(input.DesiredValue !== undefined && { DesiredValue: input.DesiredValue }), - ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.AwsRegion !== undefined && input.AwsRegion !== null && { AwsRegion: input.AwsRegion }), + ...(input.DesiredValue !== undefined && input.DesiredValue !== null && { DesiredValue: input.DesiredValue }), + ...(input.QuotaCode !== undefined && input.QuotaCode !== null && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; @@ -2360,9 +2344,9 @@ const serializeAws_json1_1RequestServiceQuotaIncreaseRequest = ( context: __SerdeContext ): any => { return { - ...(input.DesiredValue !== undefined && { DesiredValue: input.DesiredValue }), - ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), - ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }), + ...(input.DesiredValue !== undefined && input.DesiredValue !== null && { DesiredValue: input.DesiredValue }), + ...(input.QuotaCode !== undefined && input.QuotaCode !== null && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && input.ServiceCode !== null && { ServiceCode: input.ServiceCode }), }; }; @@ -2593,13 +2577,15 @@ const deserializeAws_json1_1MetricDimensionsMapDefinition = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1MetricInfo = (output: any, context: __SerdeContext): MetricInfo => { @@ -2704,7 +2690,14 @@ const deserializeAws_json1_1RequestedServiceQuotaChangeHistoryListDefinition = ( output: any, context: __SerdeContext ): RequestedServiceQuotaChange[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RequestedServiceQuotaChange(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RequestedServiceQuotaChange(entry, context); + }); }; const deserializeAws_json1_1RequestServiceQuotaIncreaseResponse = ( @@ -2742,7 +2735,14 @@ const deserializeAws_json1_1ServiceInfo = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1ServiceInfoListDefinition = (output: any, context: __SerdeContext): ServiceInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServiceInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServiceInfo(entry, context); + }); }; const deserializeAws_json1_1ServiceQuota = (output: any, context: __SerdeContext): ServiceQuota => { @@ -2791,13 +2791,25 @@ const deserializeAws_json1_1ServiceQuotaIncreaseRequestInTemplateList = ( output: any, context: __SerdeContext ): ServiceQuotaIncreaseRequestInTemplate[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1ServiceQuotaIncreaseRequestInTemplate(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServiceQuotaIncreaseRequestInTemplate(entry, context); + }); }; const deserializeAws_json1_1ServiceQuotaListDefinition = (output: any, context: __SerdeContext): ServiceQuota[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServiceQuota(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServiceQuota(entry, context); + }); }; const deserializeAws_json1_1ServiceQuotaTemplateNotInUseException = ( @@ -2877,3 +2889,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-servicediscovery/protocols/Aws_json1_1.ts b/clients/client-servicediscovery/protocols/Aws_json1_1.ts index c15240e432b6..5009ab3e758e 100644 --- a/clients/client-servicediscovery/protocols/Aws_json1_1.ts +++ b/clients/client-servicediscovery/protocols/Aws_json1_1.ts @@ -144,7 +144,7 @@ export const serializeAws_json1_1CreateHttpNamespaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.CreateHttpNamespace", }; let body: any; @@ -157,7 +157,7 @@ export const serializeAws_json1_1CreatePrivateDnsNamespaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.CreatePrivateDnsNamespace", }; let body: any; @@ -170,7 +170,7 @@ export const serializeAws_json1_1CreatePublicDnsNamespaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.CreatePublicDnsNamespace", }; let body: any; @@ -183,7 +183,7 @@ export const serializeAws_json1_1CreateServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.CreateService", }; let body: any; @@ -196,7 +196,7 @@ export const serializeAws_json1_1DeleteNamespaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.DeleteNamespace", }; let body: any; @@ -209,7 +209,7 @@ export const serializeAws_json1_1DeleteServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.DeleteService", }; let body: any; @@ -222,7 +222,7 @@ export const serializeAws_json1_1DeregisterInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.DeregisterInstance", }; let body: any; @@ -235,7 +235,7 @@ export const serializeAws_json1_1DiscoverInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.DiscoverInstances", }; let body: any; @@ -255,7 +255,7 @@ export const serializeAws_json1_1GetInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.GetInstance", }; let body: any; @@ -268,7 +268,7 @@ export const serializeAws_json1_1GetInstancesHealthStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.GetInstancesHealthStatus", }; let body: any; @@ -281,7 +281,7 @@ export const serializeAws_json1_1GetNamespaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.GetNamespace", }; let body: any; @@ -294,7 +294,7 @@ export const serializeAws_json1_1GetOperationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.GetOperation", }; let body: any; @@ -307,7 +307,7 @@ export const serializeAws_json1_1GetServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.GetService", }; let body: any; @@ -320,7 +320,7 @@ export const serializeAws_json1_1ListInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.ListInstances", }; let body: any; @@ -333,7 +333,7 @@ export const serializeAws_json1_1ListNamespacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.ListNamespaces", }; let body: any; @@ -346,7 +346,7 @@ export const serializeAws_json1_1ListOperationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.ListOperations", }; let body: any; @@ -359,7 +359,7 @@ export const serializeAws_json1_1ListServicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.ListServices", }; let body: any; @@ -372,7 +372,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.ListTagsForResource", }; let body: any; @@ -385,7 +385,7 @@ export const serializeAws_json1_1RegisterInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.RegisterInstance", }; let body: any; @@ -398,7 +398,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.TagResource", }; let body: any; @@ -411,7 +411,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.UntagResource", }; let body: any; @@ -424,7 +424,7 @@ export const serializeAws_json1_1UpdateInstanceCustomHealthStatusCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.UpdateInstanceCustomHealthStatus", }; let body: any; @@ -437,7 +437,7 @@ export const serializeAws_json1_1UpdateServiceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Route53AutoNaming_v20170314.UpdateService", }; let body: any; @@ -472,8 +472,7 @@ const deserializeAws_json1_1CreateHttpNamespaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.servicediscovery#DuplicateRequest": @@ -559,8 +558,7 @@ const deserializeAws_json1_1CreatePrivateDnsNamespaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.servicediscovery#DuplicateRequest": @@ -646,8 +644,7 @@ const deserializeAws_json1_1CreatePublicDnsNamespaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.servicediscovery#DuplicateRequest": @@ -733,8 +730,7 @@ const deserializeAws_json1_1CreateServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -820,8 +816,7 @@ const deserializeAws_json1_1DeleteNamespaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.servicediscovery#DuplicateRequest": @@ -899,8 +894,7 @@ const deserializeAws_json1_1DeleteServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -970,8 +964,7 @@ const deserializeAws_json1_1DeregisterInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.servicediscovery#DuplicateRequest": @@ -1057,8 +1050,7 @@ const deserializeAws_json1_1DiscoverInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1136,8 +1128,7 @@ const deserializeAws_json1_1GetInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InstanceNotFound": case "com.amazonaws.servicediscovery#InstanceNotFound": @@ -1207,8 +1198,7 @@ const deserializeAws_json1_1GetInstancesHealthStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InstanceNotFound": case "com.amazonaws.servicediscovery#InstanceNotFound": @@ -1278,8 +1268,7 @@ const deserializeAws_json1_1GetNamespaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1341,8 +1330,7 @@ const deserializeAws_json1_1GetOperationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1404,8 +1392,7 @@ const deserializeAws_json1_1GetServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1467,8 +1454,7 @@ const deserializeAws_json1_1ListInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1530,8 +1516,7 @@ const deserializeAws_json1_1ListNamespacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1585,8 +1570,7 @@ const deserializeAws_json1_1ListOperationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1640,8 +1624,7 @@ const deserializeAws_json1_1ListServicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1695,8 +1678,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1758,8 +1740,7 @@ const deserializeAws_json1_1RegisterInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.servicediscovery#DuplicateRequest": @@ -1845,8 +1826,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1916,8 +1896,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": @@ -1976,8 +1955,7 @@ const deserializeAws_json1_1UpdateInstanceCustomHealthStatusCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CustomHealthNotFound": case "com.amazonaws.servicediscovery#CustomHealthNotFound": @@ -2055,8 +2033,7 @@ const deserializeAws_json1_1UpdateServiceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateRequest": case "com.amazonaws.servicediscovery#DuplicateRequest": @@ -2310,13 +2287,15 @@ const deserializeAws_json1_1TooManyTagsExceptionResponse = async ( }; const serializeAws_json1_1Attributes = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1CreateHttpNamespaceRequest = ( @@ -2325,9 +2304,9 @@ const serializeAws_json1_1CreateHttpNamespaceRequest = ( ): any => { return { CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -2337,10 +2316,10 @@ const serializeAws_json1_1CreatePrivateDnsNamespaceRequest = ( ): any => { return { CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.Vpc !== undefined && { Vpc: input.Vpc }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Vpc !== undefined && input.Vpc !== null && { Vpc: input.Vpc }), }; }; @@ -2350,38 +2329,41 @@ const serializeAws_json1_1CreatePublicDnsNamespaceRequest = ( ): any => { return { CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateServiceRequest = (input: CreateServiceRequest, context: __SerdeContext): any => { return { CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DnsConfig !== undefined && { DnsConfig: serializeAws_json1_1DnsConfig(input.DnsConfig, context) }), - ...(input.HealthCheckConfig !== undefined && { - HealthCheckConfig: serializeAws_json1_1HealthCheckConfig(input.HealthCheckConfig, context), - }), - ...(input.HealthCheckCustomConfig !== undefined && { - HealthCheckCustomConfig: serializeAws_json1_1HealthCheckCustomConfig(input.HealthCheckCustomConfig, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NamespaceId !== undefined && { NamespaceId: input.NamespaceId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DnsConfig !== undefined && + input.DnsConfig !== null && { DnsConfig: serializeAws_json1_1DnsConfig(input.DnsConfig, context) }), + ...(input.HealthCheckConfig !== undefined && + input.HealthCheckConfig !== null && { + HealthCheckConfig: serializeAws_json1_1HealthCheckConfig(input.HealthCheckConfig, context), + }), + ...(input.HealthCheckCustomConfig !== undefined && + input.HealthCheckCustomConfig !== null && { + HealthCheckCustomConfig: serializeAws_json1_1HealthCheckCustomConfig(input.HealthCheckCustomConfig, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NamespaceId !== undefined && input.NamespaceId !== null && { NamespaceId: input.NamespaceId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1DeleteNamespaceRequest = (input: DeleteNamespaceRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_json1_1DeleteServiceRequest = (input: DeleteServiceRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; @@ -2390,8 +2372,8 @@ const serializeAws_json1_1DeregisterInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.ServiceId !== undefined && input.ServiceId !== null && { ServiceId: input.ServiceId }), }; }; @@ -2400,52 +2382,70 @@ const serializeAws_json1_1DiscoverInstancesRequest = ( context: __SerdeContext ): any => { return { - ...(input.HealthStatus !== undefined && { HealthStatus: input.HealthStatus }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NamespaceName !== undefined && { NamespaceName: input.NamespaceName }), - ...(input.OptionalParameters !== undefined && { - OptionalParameters: serializeAws_json1_1Attributes(input.OptionalParameters, context), - }), - ...(input.QueryParameters !== undefined && { - QueryParameters: serializeAws_json1_1Attributes(input.QueryParameters, context), - }), - ...(input.ServiceName !== undefined && { ServiceName: input.ServiceName }), + ...(input.HealthStatus !== undefined && input.HealthStatus !== null && { HealthStatus: input.HealthStatus }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NamespaceName !== undefined && input.NamespaceName !== null && { NamespaceName: input.NamespaceName }), + ...(input.OptionalParameters !== undefined && + input.OptionalParameters !== null && { + OptionalParameters: serializeAws_json1_1Attributes(input.OptionalParameters, context), + }), + ...(input.QueryParameters !== undefined && + input.QueryParameters !== null && { + QueryParameters: serializeAws_json1_1Attributes(input.QueryParameters, context), + }), + ...(input.ServiceName !== undefined && input.ServiceName !== null && { ServiceName: input.ServiceName }), }; }; const serializeAws_json1_1DnsConfig = (input: DnsConfig, context: __SerdeContext): any => { return { - ...(input.DnsRecords !== undefined && { DnsRecords: serializeAws_json1_1DnsRecordList(input.DnsRecords, context) }), - ...(input.NamespaceId !== undefined && { NamespaceId: input.NamespaceId }), - ...(input.RoutingPolicy !== undefined && { RoutingPolicy: input.RoutingPolicy }), + ...(input.DnsRecords !== undefined && + input.DnsRecords !== null && { DnsRecords: serializeAws_json1_1DnsRecordList(input.DnsRecords, context) }), + ...(input.NamespaceId !== undefined && input.NamespaceId !== null && { NamespaceId: input.NamespaceId }), + ...(input.RoutingPolicy !== undefined && input.RoutingPolicy !== null && { RoutingPolicy: input.RoutingPolicy }), }; }; const serializeAws_json1_1DnsConfigChange = (input: DnsConfigChange, context: __SerdeContext): any => { return { - ...(input.DnsRecords !== undefined && { DnsRecords: serializeAws_json1_1DnsRecordList(input.DnsRecords, context) }), + ...(input.DnsRecords !== undefined && + input.DnsRecords !== null && { DnsRecords: serializeAws_json1_1DnsRecordList(input.DnsRecords, context) }), }; }; const serializeAws_json1_1DnsRecord = (input: DnsRecord, context: __SerdeContext): any => { return { - ...(input.TTL !== undefined && { TTL: input.TTL }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.TTL !== undefined && input.TTL !== null && { TTL: input.TTL }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1DnsRecordList = (input: DnsRecord[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DnsRecord(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DnsRecord(entry, context); + }); }; const serializeAws_json1_1FilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetInstanceRequest = (input: GetInstanceRequest, context: __SerdeContext): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.ServiceId !== undefined && input.ServiceId !== null && { ServiceId: input.ServiceId }), }; }; @@ -2454,78 +2454,91 @@ const serializeAws_json1_1GetInstancesHealthStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.Instances !== undefined && { Instances: serializeAws_json1_1InstanceIdList(input.Instances, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }), + ...(input.Instances !== undefined && + input.Instances !== null && { Instances: serializeAws_json1_1InstanceIdList(input.Instances, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServiceId !== undefined && input.ServiceId !== null && { ServiceId: input.ServiceId }), }; }; const serializeAws_json1_1GetNamespaceRequest = (input: GetNamespaceRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_json1_1GetOperationRequest = (input: GetOperationRequest, context: __SerdeContext): any => { return { - ...(input.OperationId !== undefined && { OperationId: input.OperationId }), + ...(input.OperationId !== undefined && input.OperationId !== null && { OperationId: input.OperationId }), }; }; const serializeAws_json1_1GetServiceRequest = (input: GetServiceRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), }; }; const serializeAws_json1_1HealthCheckConfig = (input: HealthCheckConfig, context: __SerdeContext): any => { return { - ...(input.FailureThreshold !== undefined && { FailureThreshold: input.FailureThreshold }), - ...(input.ResourcePath !== undefined && { ResourcePath: input.ResourcePath }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.FailureThreshold !== undefined && + input.FailureThreshold !== null && { FailureThreshold: input.FailureThreshold }), + ...(input.ResourcePath !== undefined && input.ResourcePath !== null && { ResourcePath: input.ResourcePath }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1HealthCheckCustomConfig = (input: HealthCheckCustomConfig, context: __SerdeContext): any => { return { - ...(input.FailureThreshold !== undefined && { FailureThreshold: input.FailureThreshold }), + ...(input.FailureThreshold !== undefined && + input.FailureThreshold !== null && { FailureThreshold: input.FailureThreshold }), }; }; const serializeAws_json1_1InstanceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListInstancesRequest = (input: ListInstancesRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServiceId !== undefined && input.ServiceId !== null && { ServiceId: input.ServiceId }), }; }; const serializeAws_json1_1ListNamespacesRequest = (input: ListNamespacesRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1NamespaceFilters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1NamespaceFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListOperationsRequest = (input: ListOperationsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1OperationFilters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1OperationFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListServicesRequest = (input: ListServicesRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1ServiceFilters(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ServiceFilters(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2534,91 +2547,133 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1NamespaceFilter = (input: NamespaceFilter, context: __SerdeContext): any => { return { - ...(input.Condition !== undefined && { Condition: input.Condition }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), + ...(input.Condition !== undefined && input.Condition !== null && { Condition: input.Condition }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), }; }; const serializeAws_json1_1NamespaceFilters = (input: NamespaceFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1NamespaceFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1NamespaceFilter(entry, context); + }); }; const serializeAws_json1_1OperationFilter = (input: OperationFilter, context: __SerdeContext): any => { return { - ...(input.Condition !== undefined && { Condition: input.Condition }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), + ...(input.Condition !== undefined && input.Condition !== null && { Condition: input.Condition }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), }; }; const serializeAws_json1_1OperationFilters = (input: OperationFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OperationFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OperationFilter(entry, context); + }); }; const serializeAws_json1_1RegisterInstanceRequest = (input: RegisterInstanceRequest, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { Attributes: serializeAws_json1_1Attributes(input.Attributes, context) }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_json1_1Attributes(input.Attributes, context) }), CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.ServiceId !== undefined && input.ServiceId !== null && { ServiceId: input.ServiceId }), }; }; const serializeAws_json1_1ServiceChange = (input: ServiceChange, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DnsConfig !== undefined && { DnsConfig: serializeAws_json1_1DnsConfigChange(input.DnsConfig, context) }), - ...(input.HealthCheckConfig !== undefined && { - HealthCheckConfig: serializeAws_json1_1HealthCheckConfig(input.HealthCheckConfig, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DnsConfig !== undefined && + input.DnsConfig !== null && { DnsConfig: serializeAws_json1_1DnsConfigChange(input.DnsConfig, context) }), + ...(input.HealthCheckConfig !== undefined && + input.HealthCheckConfig !== null && { + HealthCheckConfig: serializeAws_json1_1HealthCheckConfig(input.HealthCheckConfig, context), + }), }; }; const serializeAws_json1_1ServiceFilter = (input: ServiceFilter, context: __SerdeContext): any => { return { - ...(input.Condition !== undefined && { Condition: input.Condition }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), + ...(input.Condition !== undefined && input.Condition !== null && { Condition: input.Condition }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1FilterValues(input.Values, context) }), }; }; const serializeAws_json1_1ServiceFilters = (input: ServiceFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ServiceFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServiceFilter(entry, context); + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -2627,27 +2682,30 @@ const serializeAws_json1_1UpdateInstanceCustomHealthStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.ServiceId !== undefined && input.ServiceId !== null && { ServiceId: input.ServiceId }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; const serializeAws_json1_1UpdateServiceRequest = (input: UpdateServiceRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Service !== undefined && { Service: serializeAws_json1_1ServiceChange(input.Service, context) }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Service !== undefined && + input.Service !== null && { Service: serializeAws_json1_1ServiceChange(input.Service, context) }), }; }; const deserializeAws_json1_1Attributes = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1CreateHttpNamespaceResponse = ( @@ -2752,7 +2810,14 @@ const deserializeAws_json1_1DnsRecord = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1DnsRecordList = (output: any, context: __SerdeContext): DnsRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DnsRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DnsRecord(entry, context); + }); }; const deserializeAws_json1_1DuplicateRequest = (output: any, context: __SerdeContext): DuplicateRequest => { @@ -2848,7 +2913,14 @@ const deserializeAws_json1_1HttpInstanceSummary = (output: any, context: __Serde }; const deserializeAws_json1_1HttpInstanceSummaryList = (output: any, context: __SerdeContext): HttpInstanceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HttpInstanceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HttpInstanceSummary(entry, context); + }); }; const deserializeAws_json1_1HttpProperties = (output: any, context: __SerdeContext): HttpProperties => { @@ -2873,13 +2945,15 @@ const deserializeAws_json1_1InstanceHealthStatusMap = ( output: any, context: __SerdeContext ): { [key: string]: HealthStatus | string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: HealthStatus | string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: HealthStatus | string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1InstanceNotFound = (output: any, context: __SerdeContext): InstanceNotFound => { @@ -2899,7 +2973,14 @@ const deserializeAws_json1_1InstanceSummary = (output: any, context: __SerdeCont }; const deserializeAws_json1_1InstanceSummaryList = (output: any, context: __SerdeContext): InstanceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceSummary(entry, context); + }); }; const deserializeAws_json1_1InvalidInput = (output: any, context: __SerdeContext): InvalidInput => { @@ -3010,7 +3091,14 @@ const deserializeAws_json1_1NamespaceProperties = (output: any, context: __Serde }; const deserializeAws_json1_1NamespaceSummariesList = (output: any, context: __SerdeContext): NamespaceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NamespaceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NamespaceSummary(entry, context); + }); }; const deserializeAws_json1_1NamespaceSummary = (output: any, context: __SerdeContext): NamespaceSummary => { @@ -3068,15 +3156,27 @@ const deserializeAws_json1_1OperationSummary = (output: any, context: __SerdeCon }; const deserializeAws_json1_1OperationSummaryList = (output: any, context: __SerdeContext): OperationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OperationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OperationSummary(entry, context); + }); }; const deserializeAws_json1_1OperationTargetsMap = (output: any, context: __SerdeContext): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [OperationTargetType | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [OperationTargetType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -3163,7 +3263,14 @@ const deserializeAws_json1_1ServiceNotFound = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ServiceSummariesList = (output: any, context: __SerdeContext): ServiceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServiceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServiceSummary(entry, context); + }); }; const deserializeAws_json1_1ServiceSummary = (output: any, context: __SerdeContext): ServiceSummary => { @@ -3201,7 +3308,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -3275,3 +3389,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-ses/protocols/Aws_query.ts b/clients/client-ses/protocols/Aws_query.ts index e832f2f5b45a..bfc114e7f3cb 100644 --- a/clients/client-ses/protocols/Aws_query.ts +++ b/clients/client-ses/protocols/Aws_query.ts @@ -449,7 +449,7 @@ export const serializeAws_queryCloneReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -465,7 +465,7 @@ export const serializeAws_queryCreateConfigurationSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -481,7 +481,7 @@ export const serializeAws_queryCreateConfigurationSetEventDestinationCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -497,7 +497,7 @@ export const serializeAws_queryCreateConfigurationSetTrackingOptionsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -513,7 +513,7 @@ export const serializeAws_queryCreateCustomVerificationEmailTemplateCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -529,7 +529,7 @@ export const serializeAws_queryCreateReceiptFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -545,7 +545,7 @@ export const serializeAws_queryCreateReceiptRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -561,7 +561,7 @@ export const serializeAws_queryCreateReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -577,7 +577,7 @@ export const serializeAws_queryCreateTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -593,7 +593,7 @@ export const serializeAws_queryDeleteConfigurationSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -609,7 +609,7 @@ export const serializeAws_queryDeleteConfigurationSetEventDestinationCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -625,7 +625,7 @@ export const serializeAws_queryDeleteConfigurationSetTrackingOptionsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -641,7 +641,7 @@ export const serializeAws_queryDeleteCustomVerificationEmailTemplateCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -657,7 +657,7 @@ export const serializeAws_queryDeleteIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -673,7 +673,7 @@ export const serializeAws_queryDeleteIdentityPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -689,7 +689,7 @@ export const serializeAws_queryDeleteReceiptFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -705,7 +705,7 @@ export const serializeAws_queryDeleteReceiptRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -721,7 +721,7 @@ export const serializeAws_queryDeleteReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -737,7 +737,7 @@ export const serializeAws_queryDeleteTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -753,7 +753,7 @@ export const serializeAws_queryDeleteVerifiedEmailAddressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -769,7 +769,7 @@ export const serializeAws_queryDescribeActiveReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -785,7 +785,7 @@ export const serializeAws_queryDescribeConfigurationSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -801,7 +801,7 @@ export const serializeAws_queryDescribeReceiptRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -817,7 +817,7 @@ export const serializeAws_queryDescribeReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -833,7 +833,7 @@ export const serializeAws_queryGetAccountSendingEnabledCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "GetAccountSendingEnabled", @@ -847,7 +847,7 @@ export const serializeAws_queryGetCustomVerificationEmailTemplateCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -863,7 +863,7 @@ export const serializeAws_queryGetIdentityDkimAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -879,7 +879,7 @@ export const serializeAws_queryGetIdentityMailFromDomainAttributesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -895,7 +895,7 @@ export const serializeAws_queryGetIdentityNotificationAttributesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -911,7 +911,7 @@ export const serializeAws_queryGetIdentityPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -927,7 +927,7 @@ export const serializeAws_queryGetIdentityVerificationAttributesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -943,7 +943,7 @@ export const serializeAws_queryGetSendQuotaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "GetSendQuota", @@ -957,7 +957,7 @@ export const serializeAws_queryGetSendStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "GetSendStatistics", @@ -971,7 +971,7 @@ export const serializeAws_queryGetTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -987,7 +987,7 @@ export const serializeAws_queryListConfigurationSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1003,7 +1003,7 @@ export const serializeAws_queryListCustomVerificationEmailTemplatesCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1019,7 +1019,7 @@ export const serializeAws_queryListIdentitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1035,7 +1035,7 @@ export const serializeAws_queryListIdentityPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1051,7 +1051,7 @@ export const serializeAws_queryListReceiptFiltersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1067,7 +1067,7 @@ export const serializeAws_queryListReceiptRuleSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1083,7 +1083,7 @@ export const serializeAws_queryListTemplatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1099,7 +1099,7 @@ export const serializeAws_queryListVerifiedEmailAddressesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; const body = buildFormUrlencodedString({ Action: "ListVerifiedEmailAddresses", @@ -1113,7 +1113,7 @@ export const serializeAws_queryPutConfigurationSetDeliveryOptionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1129,7 +1129,7 @@ export const serializeAws_queryPutIdentityPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1145,7 +1145,7 @@ export const serializeAws_queryReorderReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1161,7 +1161,7 @@ export const serializeAws_querySendBounceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1177,7 +1177,7 @@ export const serializeAws_querySendBulkTemplatedEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1193,7 +1193,7 @@ export const serializeAws_querySendCustomVerificationEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1209,7 +1209,7 @@ export const serializeAws_querySendEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1225,7 +1225,7 @@ export const serializeAws_querySendRawEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1241,7 +1241,7 @@ export const serializeAws_querySendTemplatedEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1257,7 +1257,7 @@ export const serializeAws_querySetActiveReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1273,7 +1273,7 @@ export const serializeAws_querySetIdentityDkimEnabledCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1289,7 +1289,7 @@ export const serializeAws_querySetIdentityFeedbackForwardingEnabledCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1305,7 +1305,7 @@ export const serializeAws_querySetIdentityHeadersInNotificationsEnabledCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1321,7 +1321,7 @@ export const serializeAws_querySetIdentityMailFromDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1337,7 +1337,7 @@ export const serializeAws_querySetIdentityNotificationTopicCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1353,7 +1353,7 @@ export const serializeAws_querySetReceiptRulePositionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1369,7 +1369,7 @@ export const serializeAws_queryTestRenderTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1385,7 +1385,7 @@ export const serializeAws_queryUpdateAccountSendingEnabledCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1401,7 +1401,7 @@ export const serializeAws_queryUpdateConfigurationSetEventDestinationCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1417,7 +1417,7 @@ export const serializeAws_queryUpdateConfigurationSetReputationMetricsEnabledCom context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1433,7 +1433,7 @@ export const serializeAws_queryUpdateConfigurationSetSendingEnabledCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1449,7 +1449,7 @@ export const serializeAws_queryUpdateConfigurationSetTrackingOptionsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1465,7 +1465,7 @@ export const serializeAws_queryUpdateCustomVerificationEmailTemplateCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1481,7 +1481,7 @@ export const serializeAws_queryUpdateReceiptRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1497,7 +1497,7 @@ export const serializeAws_queryUpdateTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1513,7 +1513,7 @@ export const serializeAws_queryVerifyDomainDkimCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1529,7 +1529,7 @@ export const serializeAws_queryVerifyDomainIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1545,7 +1545,7 @@ export const serializeAws_queryVerifyEmailAddressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1561,7 +1561,7 @@ export const serializeAws_queryVerifyEmailIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -6234,10 +6234,10 @@ const deserializeAws_queryTrackingOptionsDoesNotExistExceptionResponse = async ( const serializeAws_queryAddHeaderAction = (input: AddHeaderAction, context: __SerdeContext): any => { const entries: any = {}; - if (input.HeaderName !== undefined) { + if (input.HeaderName !== undefined && input.HeaderName !== null) { entries["HeaderName"] = input.HeaderName; } - if (input.HeaderValue !== undefined) { + if (input.HeaderValue !== undefined && input.HeaderValue !== null) { entries["HeaderValue"] = input.HeaderValue; } return entries; @@ -6247,6 +6247,9 @@ const serializeAws_queryAddressList = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6255,14 +6258,14 @@ const serializeAws_queryAddressList = (input: string[], context: __SerdeContext) const serializeAws_queryBody = (input: Body, context: __SerdeContext): any => { const entries: any = {}; - if (input.Html !== undefined) { + if (input.Html !== undefined && input.Html !== null) { const memberEntries = serializeAws_queryContent(input.Html, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Html.${key}`; entries[loc] = value; }); } - if (input.Text !== undefined) { + if (input.Text !== undefined && input.Text !== null) { const memberEntries = serializeAws_queryContent(input.Text, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Text.${key}`; @@ -6274,19 +6277,19 @@ const serializeAws_queryBody = (input: Body, context: __SerdeContext): any => { const serializeAws_queryBounceAction = (input: BounceAction, context: __SerdeContext): any => { const entries: any = {}; - if (input.SmtpReplyCode !== undefined) { + if (input.SmtpReplyCode !== undefined && input.SmtpReplyCode !== null) { entries["SmtpReplyCode"] = input.SmtpReplyCode; } - if (input.Sender !== undefined) { + if (input.Sender !== undefined && input.Sender !== null) { entries["Sender"] = input.Sender; } - if (input.StatusCode !== undefined) { + if (input.StatusCode !== undefined && input.StatusCode !== null) { entries["StatusCode"] = input.StatusCode; } - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.Message !== undefined) { + if (input.Message !== undefined && input.Message !== null) { entries["Message"] = input.Message; } return entries; @@ -6294,20 +6297,20 @@ const serializeAws_queryBounceAction = (input: BounceAction, context: __SerdeCon const serializeAws_queryBouncedRecipientInfo = (input: BouncedRecipientInfo, context: __SerdeContext): any => { const entries: any = {}; - if (input.RecipientArn !== undefined) { + if (input.RecipientArn !== undefined && input.RecipientArn !== null) { entries["RecipientArn"] = input.RecipientArn; } - if (input.BounceType !== undefined) { + if (input.BounceType !== undefined && input.BounceType !== null) { entries["BounceType"] = input.BounceType; } - if (input.RecipientDsnFields !== undefined) { + if (input.RecipientDsnFields !== undefined && input.RecipientDsnFields !== null) { const memberEntries = serializeAws_queryRecipientDsnFields(input.RecipientDsnFields, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RecipientDsnFields.${key}`; entries[loc] = value; }); } - if (input.Recipient !== undefined) { + if (input.Recipient !== undefined && input.Recipient !== null) { entries["Recipient"] = input.Recipient; } return entries; @@ -6317,6 +6320,9 @@ const serializeAws_queryBouncedRecipientInfoList = (input: BouncedRecipientInfo[ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryBouncedRecipientInfo(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -6328,21 +6334,21 @@ const serializeAws_queryBouncedRecipientInfoList = (input: BouncedRecipientInfo[ const serializeAws_queryBulkEmailDestination = (input: BulkEmailDestination, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReplacementTags !== undefined) { + if (input.ReplacementTags !== undefined && input.ReplacementTags !== null) { const memberEntries = serializeAws_queryMessageTagList(input.ReplacementTags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplacementTags.${key}`; entries[loc] = value; }); } - if (input.Destination !== undefined) { + if (input.Destination !== undefined && input.Destination !== null) { const memberEntries = serializeAws_queryDestination(input.Destination, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Destination.${key}`; entries[loc] = value; }); } - if (input.ReplacementTemplateData !== undefined) { + if (input.ReplacementTemplateData !== undefined && input.ReplacementTemplateData !== null) { entries["ReplacementTemplateData"] = input.ReplacementTemplateData; } return entries; @@ -6352,6 +6358,9 @@ const serializeAws_queryBulkEmailDestinationList = (input: BulkEmailDestination[ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryBulkEmailDestination(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -6366,10 +6375,10 @@ const serializeAws_queryCloneReceiptRuleSetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } - if (input.OriginalRuleSetName !== undefined) { + if (input.OriginalRuleSetName !== undefined && input.OriginalRuleSetName !== null) { entries["OriginalRuleSetName"] = input.OriginalRuleSetName; } return entries; @@ -6377,7 +6386,7 @@ const serializeAws_queryCloneReceiptRuleSetRequest = ( const serializeAws_queryCloudWatchDestination = (input: CloudWatchDestination, context: __SerdeContext): any => { const entries: any = {}; - if (input.DimensionConfigurations !== undefined) { + if (input.DimensionConfigurations !== undefined && input.DimensionConfigurations !== null) { const memberEntries = serializeAws_queryCloudWatchDimensionConfigurations(input.DimensionConfigurations, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DimensionConfigurations.${key}`; @@ -6392,13 +6401,13 @@ const serializeAws_queryCloudWatchDimensionConfiguration = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DefaultDimensionValue !== undefined) { + if (input.DefaultDimensionValue !== undefined && input.DefaultDimensionValue !== null) { entries["DefaultDimensionValue"] = input.DefaultDimensionValue; } - if (input.DimensionName !== undefined) { + if (input.DimensionName !== undefined && input.DimensionName !== null) { entries["DimensionName"] = input.DimensionName; } - if (input.DimensionValueSource !== undefined) { + if (input.DimensionValueSource !== undefined && input.DimensionValueSource !== null) { entries["DimensionValueSource"] = input.DimensionValueSource; } return entries; @@ -6411,6 +6420,9 @@ const serializeAws_queryCloudWatchDimensionConfigurations = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryCloudWatchDimensionConfiguration(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -6422,7 +6434,7 @@ const serializeAws_queryCloudWatchDimensionConfigurations = ( const serializeAws_queryConfigurationSet = (input: ConfigurationSet, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -6435,6 +6447,9 @@ const serializeAws_queryConfigurationSetAttributeList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6443,10 +6458,10 @@ const serializeAws_queryConfigurationSetAttributeList = ( const serializeAws_queryContent = (input: Content, context: __SerdeContext): any => { const entries: any = {}; - if (input.Data !== undefined) { + if (input.Data !== undefined && input.Data !== null) { entries["Data"] = input.Data; } - if (input.Charset !== undefined) { + if (input.Charset !== undefined && input.Charset !== null) { entries["Charset"] = input.Charset; } return entries; @@ -6457,10 +6472,10 @@ const serializeAws_queryCreateConfigurationSetEventDestinationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.EventDestination !== undefined) { + if (input.EventDestination !== undefined && input.EventDestination !== null) { const memberEntries = serializeAws_queryEventDestination(input.EventDestination, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventDestination.${key}`; @@ -6475,7 +6490,7 @@ const serializeAws_queryCreateConfigurationSetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConfigurationSet !== undefined) { + if (input.ConfigurationSet !== undefined && input.ConfigurationSet !== null) { const memberEntries = serializeAws_queryConfigurationSet(input.ConfigurationSet, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ConfigurationSet.${key}`; @@ -6490,10 +6505,10 @@ const serializeAws_queryCreateConfigurationSetTrackingOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.TrackingOptions !== undefined) { + if (input.TrackingOptions !== undefined && input.TrackingOptions !== null) { const memberEntries = serializeAws_queryTrackingOptions(input.TrackingOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TrackingOptions.${key}`; @@ -6508,22 +6523,22 @@ const serializeAws_queryCreateCustomVerificationEmailTemplateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateSubject !== undefined) { + if (input.TemplateSubject !== undefined && input.TemplateSubject !== null) { entries["TemplateSubject"] = input.TemplateSubject; } - if (input.TemplateContent !== undefined) { + if (input.TemplateContent !== undefined && input.TemplateContent !== null) { entries["TemplateContent"] = input.TemplateContent; } - if (input.FailureRedirectionURL !== undefined) { + if (input.FailureRedirectionURL !== undefined && input.FailureRedirectionURL !== null) { entries["FailureRedirectionURL"] = input.FailureRedirectionURL; } - if (input.FromEmailAddress !== undefined) { + if (input.FromEmailAddress !== undefined && input.FromEmailAddress !== null) { entries["FromEmailAddress"] = input.FromEmailAddress; } - if (input.SuccessRedirectionURL !== undefined) { + if (input.SuccessRedirectionURL !== undefined && input.SuccessRedirectionURL !== null) { entries["SuccessRedirectionURL"] = input.SuccessRedirectionURL; } - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } return entries; @@ -6534,7 +6549,7 @@ const serializeAws_queryCreateReceiptFilterRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Filter !== undefined) { + if (input.Filter !== undefined && input.Filter !== null) { const memberEntries = serializeAws_queryReceiptFilter(input.Filter, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Filter.${key}`; @@ -6546,13 +6561,13 @@ const serializeAws_queryCreateReceiptFilterRequest = ( const serializeAws_queryCreateReceiptRuleRequest = (input: CreateReceiptRuleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.After !== undefined) { + if (input.After !== undefined && input.After !== null) { entries["After"] = input.After; } - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } - if (input.Rule !== undefined) { + if (input.Rule !== undefined && input.Rule !== null) { const memberEntries = serializeAws_queryReceiptRule(input.Rule, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Rule.${key}`; @@ -6567,7 +6582,7 @@ const serializeAws_queryCreateReceiptRuleSetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } return entries; @@ -6575,7 +6590,7 @@ const serializeAws_queryCreateReceiptRuleSetRequest = ( const serializeAws_queryCreateTemplateRequest = (input: CreateTemplateRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Template !== undefined) { + if (input.Template !== undefined && input.Template !== null) { const memberEntries = serializeAws_queryTemplate(input.Template, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Template.${key}`; @@ -6590,10 +6605,10 @@ const serializeAws_queryDeleteConfigurationSetEventDestinationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.EventDestinationName !== undefined) { + if (input.EventDestinationName !== undefined && input.EventDestinationName !== null) { entries["EventDestinationName"] = input.EventDestinationName; } return entries; @@ -6604,7 +6619,7 @@ const serializeAws_queryDeleteConfigurationSetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } return entries; @@ -6615,7 +6630,7 @@ const serializeAws_queryDeleteConfigurationSetTrackingOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } return entries; @@ -6626,7 +6641,7 @@ const serializeAws_queryDeleteCustomVerificationEmailTemplateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } return entries; @@ -6637,10 +6652,10 @@ const serializeAws_queryDeleteIdentityPolicyRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } return entries; @@ -6648,7 +6663,7 @@ const serializeAws_queryDeleteIdentityPolicyRequest = ( const serializeAws_queryDeleteIdentityRequest = (input: DeleteIdentityRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } return entries; @@ -6659,7 +6674,7 @@ const serializeAws_queryDeleteReceiptFilterRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.FilterName !== undefined) { + if (input.FilterName !== undefined && input.FilterName !== null) { entries["FilterName"] = input.FilterName; } return entries; @@ -6667,10 +6682,10 @@ const serializeAws_queryDeleteReceiptFilterRequest = ( const serializeAws_queryDeleteReceiptRuleRequest = (input: DeleteReceiptRuleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.RuleName !== undefined) { + if (input.RuleName !== undefined && input.RuleName !== null) { entries["RuleName"] = input.RuleName; } - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } return entries; @@ -6681,7 +6696,7 @@ const serializeAws_queryDeleteReceiptRuleSetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } return entries; @@ -6689,7 +6704,7 @@ const serializeAws_queryDeleteReceiptRuleSetRequest = ( const serializeAws_queryDeleteTemplateRequest = (input: DeleteTemplateRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } return entries; @@ -6700,7 +6715,7 @@ const serializeAws_queryDeleteVerifiedEmailAddressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EmailAddress !== undefined) { + if (input.EmailAddress !== undefined && input.EmailAddress !== null) { entries["EmailAddress"] = input.EmailAddress; } return entries; @@ -6708,7 +6723,7 @@ const serializeAws_queryDeleteVerifiedEmailAddressRequest = ( const serializeAws_queryDeliveryOptions = (input: DeliveryOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.TlsPolicy !== undefined) { + if (input.TlsPolicy !== undefined && input.TlsPolicy !== null) { entries["TlsPolicy"] = input.TlsPolicy; } return entries; @@ -6727,10 +6742,10 @@ const serializeAws_queryDescribeConfigurationSetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.ConfigurationSetAttributeNames !== undefined) { + if (input.ConfigurationSetAttributeNames !== undefined && input.ConfigurationSetAttributeNames !== null) { const memberEntries = serializeAws_queryConfigurationSetAttributeList( input.ConfigurationSetAttributeNames, context @@ -6748,10 +6763,10 @@ const serializeAws_queryDescribeReceiptRuleRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } - if (input.RuleName !== undefined) { + if (input.RuleName !== undefined && input.RuleName !== null) { entries["RuleName"] = input.RuleName; } return entries; @@ -6762,7 +6777,7 @@ const serializeAws_queryDescribeReceiptRuleSetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } return entries; @@ -6770,21 +6785,21 @@ const serializeAws_queryDescribeReceiptRuleSetRequest = ( const serializeAws_queryDestination = (input: Destination, context: __SerdeContext): any => { const entries: any = {}; - if (input.ToAddresses !== undefined) { + if (input.ToAddresses !== undefined && input.ToAddresses !== null) { const memberEntries = serializeAws_queryAddressList(input.ToAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ToAddresses.${key}`; entries[loc] = value; }); } - if (input.CcAddresses !== undefined) { + if (input.CcAddresses !== undefined && input.CcAddresses !== null) { const memberEntries = serializeAws_queryAddressList(input.CcAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CcAddresses.${key}`; entries[loc] = value; }); } - if (input.BccAddresses !== undefined) { + if (input.BccAddresses !== undefined && input.BccAddresses !== null) { const memberEntries = serializeAws_queryAddressList(input.BccAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BccAddresses.${key}`; @@ -6796,34 +6811,34 @@ const serializeAws_queryDestination = (input: Destination, context: __SerdeConte const serializeAws_queryEventDestination = (input: EventDestination, context: __SerdeContext): any => { const entries: any = {}; - if (input.CloudWatchDestination !== undefined) { + if (input.CloudWatchDestination !== undefined && input.CloudWatchDestination !== null) { const memberEntries = serializeAws_queryCloudWatchDestination(input.CloudWatchDestination, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `CloudWatchDestination.${key}`; entries[loc] = value; }); } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.SNSDestination !== undefined) { + if (input.SNSDestination !== undefined && input.SNSDestination !== null) { const memberEntries = serializeAws_querySNSDestination(input.SNSDestination, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SNSDestination.${key}`; entries[loc] = value; }); } - if (input.MatchingEventTypes !== undefined) { + if (input.MatchingEventTypes !== undefined && input.MatchingEventTypes !== null) { const memberEntries = serializeAws_queryEventTypes(input.MatchingEventTypes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MatchingEventTypes.${key}`; entries[loc] = value; }); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.KinesisFirehoseDestination !== undefined) { + if (input.KinesisFirehoseDestination !== undefined && input.KinesisFirehoseDestination !== null) { const memberEntries = serializeAws_queryKinesisFirehoseDestination(input.KinesisFirehoseDestination, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `KinesisFirehoseDestination.${key}`; @@ -6837,6 +6852,9 @@ const serializeAws_queryEventTypes = (input: (EventType | string)[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6845,10 +6863,10 @@ const serializeAws_queryEventTypes = (input: (EventType | string)[], context: __ const serializeAws_queryExtensionField = (input: ExtensionField, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -6858,6 +6876,9 @@ const serializeAws_queryExtensionFieldList = (input: ExtensionField[], context: const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryExtensionField(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -6872,7 +6893,7 @@ const serializeAws_queryGetCustomVerificationEmailTemplateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } return entries; @@ -6883,7 +6904,7 @@ const serializeAws_queryGetIdentityDkimAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Identities !== undefined) { + if (input.Identities !== undefined && input.Identities !== null) { const memberEntries = serializeAws_queryIdentityList(input.Identities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Identities.${key}`; @@ -6898,7 +6919,7 @@ const serializeAws_queryGetIdentityMailFromDomainAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Identities !== undefined) { + if (input.Identities !== undefined && input.Identities !== null) { const memberEntries = serializeAws_queryIdentityList(input.Identities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Identities.${key}`; @@ -6913,7 +6934,7 @@ const serializeAws_queryGetIdentityNotificationAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Identities !== undefined) { + if (input.Identities !== undefined && input.Identities !== null) { const memberEntries = serializeAws_queryIdentityList(input.Identities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Identities.${key}`; @@ -6928,14 +6949,14 @@ const serializeAws_queryGetIdentityPoliciesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PolicyNames !== undefined) { + if (input.PolicyNames !== undefined && input.PolicyNames !== null) { const memberEntries = serializeAws_queryPolicyNameList(input.PolicyNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyNames.${key}`; entries[loc] = value; }); } - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } return entries; @@ -6946,7 +6967,7 @@ const serializeAws_queryGetIdentityVerificationAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Identities !== undefined) { + if (input.Identities !== undefined && input.Identities !== null) { const memberEntries = serializeAws_queryIdentityList(input.Identities, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Identities.${key}`; @@ -6958,7 +6979,7 @@ const serializeAws_queryGetIdentityVerificationAttributesRequest = ( const serializeAws_queryGetTemplateRequest = (input: GetTemplateRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } return entries; @@ -6968,6 +6989,9 @@ const serializeAws_queryIdentityList = (input: string[], context: __SerdeContext const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -6979,10 +7003,10 @@ const serializeAws_queryKinesisFirehoseDestination = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DeliveryStreamARN !== undefined) { + if (input.DeliveryStreamARN !== undefined && input.DeliveryStreamARN !== null) { entries["DeliveryStreamARN"] = input.DeliveryStreamARN; } - if (input.IAMRoleARN !== undefined) { + if (input.IAMRoleARN !== undefined && input.IAMRoleARN !== null) { entries["IAMRoleARN"] = input.IAMRoleARN; } return entries; @@ -6990,13 +7014,13 @@ const serializeAws_queryKinesisFirehoseDestination = ( const serializeAws_queryLambdaAction = (input: LambdaAction, context: __SerdeContext): any => { const entries: any = {}; - if (input.InvocationType !== undefined) { + if (input.InvocationType !== undefined && input.InvocationType !== null) { entries["InvocationType"] = input.InvocationType; } - if (input.FunctionArn !== undefined) { + if (input.FunctionArn !== undefined && input.FunctionArn !== null) { entries["FunctionArn"] = input.FunctionArn; } - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } return entries; @@ -7007,10 +7031,10 @@ const serializeAws_queryListConfigurationSetsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -7021,10 +7045,10 @@ const serializeAws_queryListCustomVerificationEmailTemplatesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -7032,13 +7056,13 @@ const serializeAws_queryListCustomVerificationEmailTemplatesRequest = ( const serializeAws_queryListIdentitiesRequest = (input: ListIdentitiesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.IdentityType !== undefined) { + if (input.IdentityType !== undefined && input.IdentityType !== null) { entries["IdentityType"] = input.IdentityType; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } return entries; @@ -7049,7 +7073,7 @@ const serializeAws_queryListIdentityPoliciesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } return entries; @@ -7068,7 +7092,7 @@ const serializeAws_queryListReceiptRuleSetsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -7076,10 +7100,10 @@ const serializeAws_queryListReceiptRuleSetsRequest = ( const serializeAws_queryListTemplatesRequest = (input: ListTemplatesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.MaxItems !== undefined) { + if (input.MaxItems !== undefined && input.MaxItems !== null) { entries["MaxItems"] = input.MaxItems; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -7087,14 +7111,14 @@ const serializeAws_queryListTemplatesRequest = (input: ListTemplatesRequest, con const serializeAws_queryMessage = (input: Message, context: __SerdeContext): any => { const entries: any = {}; - if (input.Body !== undefined) { + if (input.Body !== undefined && input.Body !== null) { const memberEntries = serializeAws_queryBody(input.Body, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Body.${key}`; entries[loc] = value; }); } - if (input.Subject !== undefined) { + if (input.Subject !== undefined && input.Subject !== null) { const memberEntries = serializeAws_queryContent(input.Subject, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Subject.${key}`; @@ -7106,17 +7130,17 @@ const serializeAws_queryMessage = (input: Message, context: __SerdeContext): any const serializeAws_queryMessageDsn = (input: MessageDsn, context: __SerdeContext): any => { const entries: any = {}; - if (input.ExtensionFields !== undefined) { + if (input.ExtensionFields !== undefined && input.ExtensionFields !== null) { const memberEntries = serializeAws_queryExtensionFieldList(input.ExtensionFields, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExtensionFields.${key}`; entries[loc] = value; }); } - if (input.ReportingMta !== undefined) { + if (input.ReportingMta !== undefined && input.ReportingMta !== null) { entries["ReportingMta"] = input.ReportingMta; } - if (input.ArrivalDate !== undefined) { + if (input.ArrivalDate !== undefined && input.ArrivalDate !== null) { entries["ArrivalDate"] = input.ArrivalDate.toISOString().split(".")[0] + "Z"; } return entries; @@ -7124,10 +7148,10 @@ const serializeAws_queryMessageDsn = (input: MessageDsn, context: __SerdeContext const serializeAws_queryMessageTag = (input: MessageTag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -7137,6 +7161,9 @@ const serializeAws_queryMessageTagList = (input: MessageTag[], context: __SerdeC const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryMessageTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -7150,6 +7177,9 @@ const serializeAws_queryPolicyNameList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -7161,14 +7191,14 @@ const serializeAws_queryPutConfigurationSetDeliveryOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DeliveryOptions !== undefined) { + if (input.DeliveryOptions !== undefined && input.DeliveryOptions !== null) { const memberEntries = serializeAws_queryDeliveryOptions(input.DeliveryOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DeliveryOptions.${key}`; entries[loc] = value; }); } - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } return entries; @@ -7176,13 +7206,13 @@ const serializeAws_queryPutConfigurationSetDeliveryOptionsRequest = ( const serializeAws_queryPutIdentityPolicyRequest = (input: PutIdentityPolicyRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Policy !== undefined) { + if (input.Policy !== undefined && input.Policy !== null) { entries["Policy"] = input.Policy; } - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } - if (input.PolicyName !== undefined) { + if (input.PolicyName !== undefined && input.PolicyName !== null) { entries["PolicyName"] = input.PolicyName; } return entries; @@ -7190,7 +7220,7 @@ const serializeAws_queryPutIdentityPolicyRequest = (input: PutIdentityPolicyRequ const serializeAws_queryRawMessage = (input: RawMessage, context: __SerdeContext): any => { const entries: any = {}; - if (input.Data !== undefined) { + if (input.Data !== undefined && input.Data !== null) { entries["Data"] = context.base64Encoder(input.Data); } return entries; @@ -7198,49 +7228,49 @@ const serializeAws_queryRawMessage = (input: RawMessage, context: __SerdeContext const serializeAws_queryReceiptAction = (input: ReceiptAction, context: __SerdeContext): any => { const entries: any = {}; - if (input.StopAction !== undefined) { + if (input.StopAction !== undefined && input.StopAction !== null) { const memberEntries = serializeAws_queryStopAction(input.StopAction, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StopAction.${key}`; entries[loc] = value; }); } - if (input.S3Action !== undefined) { + if (input.S3Action !== undefined && input.S3Action !== null) { const memberEntries = serializeAws_queryS3Action(input.S3Action, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `S3Action.${key}`; entries[loc] = value; }); } - if (input.BounceAction !== undefined) { + if (input.BounceAction !== undefined && input.BounceAction !== null) { const memberEntries = serializeAws_queryBounceAction(input.BounceAction, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BounceAction.${key}`; entries[loc] = value; }); } - if (input.LambdaAction !== undefined) { + if (input.LambdaAction !== undefined && input.LambdaAction !== null) { const memberEntries = serializeAws_queryLambdaAction(input.LambdaAction, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `LambdaAction.${key}`; entries[loc] = value; }); } - if (input.AddHeaderAction !== undefined) { + if (input.AddHeaderAction !== undefined && input.AddHeaderAction !== null) { const memberEntries = serializeAws_queryAddHeaderAction(input.AddHeaderAction, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AddHeaderAction.${key}`; entries[loc] = value; }); } - if (input.SNSAction !== undefined) { + if (input.SNSAction !== undefined && input.SNSAction !== null) { const memberEntries = serializeAws_querySNSAction(input.SNSAction, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SNSAction.${key}`; entries[loc] = value; }); } - if (input.WorkmailAction !== undefined) { + if (input.WorkmailAction !== undefined && input.WorkmailAction !== null) { const memberEntries = serializeAws_queryWorkmailAction(input.WorkmailAction, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `WorkmailAction.${key}`; @@ -7254,6 +7284,9 @@ const serializeAws_queryReceiptActionsList = (input: ReceiptAction[], context: _ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryReceiptAction(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -7265,14 +7298,14 @@ const serializeAws_queryReceiptActionsList = (input: ReceiptAction[], context: _ const serializeAws_queryReceiptFilter = (input: ReceiptFilter, context: __SerdeContext): any => { const entries: any = {}; - if (input.IpFilter !== undefined) { + if (input.IpFilter !== undefined && input.IpFilter !== null) { const memberEntries = serializeAws_queryReceiptIpFilter(input.IpFilter, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `IpFilter.${key}`; entries[loc] = value; }); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } return entries; @@ -7280,10 +7313,10 @@ const serializeAws_queryReceiptFilter = (input: ReceiptFilter, context: __SerdeC const serializeAws_queryReceiptIpFilter = (input: ReceiptIpFilter, context: __SerdeContext): any => { const entries: any = {}; - if (input.Policy !== undefined) { + if (input.Policy !== undefined && input.Policy !== null) { entries["Policy"] = input.Policy; } - if (input.Cidr !== undefined) { + if (input.Cidr !== undefined && input.Cidr !== null) { entries["Cidr"] = input.Cidr; } return entries; @@ -7291,26 +7324,26 @@ const serializeAws_queryReceiptIpFilter = (input: ReceiptIpFilter, context: __Se const serializeAws_queryReceiptRule = (input: ReceiptRule, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Actions !== undefined) { + if (input.Actions !== undefined && input.Actions !== null) { const memberEntries = serializeAws_queryReceiptActionsList(input.Actions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Actions.${key}`; entries[loc] = value; }); } - if (input.TlsPolicy !== undefined) { + if (input.TlsPolicy !== undefined && input.TlsPolicy !== null) { entries["TlsPolicy"] = input.TlsPolicy; } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.ScanEnabled !== undefined) { + if (input.ScanEnabled !== undefined && input.ScanEnabled !== null) { entries["ScanEnabled"] = input.ScanEnabled; } - if (input.Recipients !== undefined) { + if (input.Recipients !== undefined && input.Recipients !== null) { const memberEntries = serializeAws_queryRecipientsList(input.Recipients, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Recipients.${key}`; @@ -7324,6 +7357,9 @@ const serializeAws_queryReceiptRuleNamesList = (input: string[], context: __Serd const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -7332,25 +7368,25 @@ const serializeAws_queryReceiptRuleNamesList = (input: string[], context: __Serd const serializeAws_queryRecipientDsnFields = (input: RecipientDsnFields, context: __SerdeContext): any => { const entries: any = {}; - if (input.LastAttemptDate !== undefined) { + if (input.LastAttemptDate !== undefined && input.LastAttemptDate !== null) { entries["LastAttemptDate"] = input.LastAttemptDate.toISOString().split(".")[0] + "Z"; } - if (input.DiagnosticCode !== undefined) { + if (input.DiagnosticCode !== undefined && input.DiagnosticCode !== null) { entries["DiagnosticCode"] = input.DiagnosticCode; } - if (input.FinalRecipient !== undefined) { + if (input.FinalRecipient !== undefined && input.FinalRecipient !== null) { entries["FinalRecipient"] = input.FinalRecipient; } - if (input.Action !== undefined) { + if (input.Action !== undefined && input.Action !== null) { entries["Action"] = input.Action; } - if (input.RemoteMta !== undefined) { + if (input.RemoteMta !== undefined && input.RemoteMta !== null) { entries["RemoteMta"] = input.RemoteMta; } - if (input.Status !== undefined) { + if (input.Status !== undefined && input.Status !== null) { entries["Status"] = input.Status; } - if (input.ExtensionFields !== undefined) { + if (input.ExtensionFields !== undefined && input.ExtensionFields !== null) { const memberEntries = serializeAws_queryExtensionFieldList(input.ExtensionFields, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ExtensionFields.${key}`; @@ -7364,6 +7400,9 @@ const serializeAws_queryRecipientsList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -7375,10 +7414,10 @@ const serializeAws_queryReorderReceiptRuleSetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } - if (input.RuleNames !== undefined) { + if (input.RuleNames !== undefined && input.RuleNames !== null) { const memberEntries = serializeAws_queryReceiptRuleNamesList(input.RuleNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RuleNames.${key}`; @@ -7390,16 +7429,16 @@ const serializeAws_queryReorderReceiptRuleSetRequest = ( const serializeAws_queryS3Action = (input: S3Action, context: __SerdeContext): any => { const entries: any = {}; - if (input.BucketName !== undefined) { + if (input.BucketName !== undefined && input.BucketName !== null) { entries["BucketName"] = input.BucketName; } - if (input.ObjectKeyPrefix !== undefined) { + if (input.ObjectKeyPrefix !== undefined && input.ObjectKeyPrefix !== null) { entries["ObjectKeyPrefix"] = input.ObjectKeyPrefix; } - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.KmsKeyArn !== undefined) { + if (input.KmsKeyArn !== undefined && input.KmsKeyArn !== null) { entries["KmsKeyArn"] = input.KmsKeyArn; } return entries; @@ -7407,26 +7446,26 @@ const serializeAws_queryS3Action = (input: S3Action, context: __SerdeContext): a const serializeAws_querySendBounceRequest = (input: SendBounceRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.BounceSenderArn !== undefined) { + if (input.BounceSenderArn !== undefined && input.BounceSenderArn !== null) { entries["BounceSenderArn"] = input.BounceSenderArn; } - if (input.OriginalMessageId !== undefined) { + if (input.OriginalMessageId !== undefined && input.OriginalMessageId !== null) { entries["OriginalMessageId"] = input.OriginalMessageId; } - if (input.BounceSender !== undefined) { + if (input.BounceSender !== undefined && input.BounceSender !== null) { entries["BounceSender"] = input.BounceSender; } - if (input.MessageDsn !== undefined) { + if (input.MessageDsn !== undefined && input.MessageDsn !== null) { const memberEntries = serializeAws_queryMessageDsn(input.MessageDsn, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MessageDsn.${key}`; entries[loc] = value; }); } - if (input.Explanation !== undefined) { + if (input.Explanation !== undefined && input.Explanation !== null) { entries["Explanation"] = input.Explanation; } - if (input.BouncedRecipientInfoList !== undefined) { + if (input.BouncedRecipientInfoList !== undefined && input.BouncedRecipientInfoList !== null) { const memberEntries = serializeAws_queryBouncedRecipientInfoList(input.BouncedRecipientInfoList, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BouncedRecipientInfoList.${key}`; @@ -7441,49 +7480,49 @@ const serializeAws_querySendBulkTemplatedEmailRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReturnPathArn !== undefined) { + if (input.ReturnPathArn !== undefined && input.ReturnPathArn !== null) { entries["ReturnPathArn"] = input.ReturnPathArn; } - if (input.ReturnPath !== undefined) { + if (input.ReturnPath !== undefined && input.ReturnPath !== null) { entries["ReturnPath"] = input.ReturnPath; } - if (input.TemplateArn !== undefined) { + if (input.TemplateArn !== undefined && input.TemplateArn !== null) { entries["TemplateArn"] = input.TemplateArn; } - if (input.DefaultTemplateData !== undefined) { + if (input.DefaultTemplateData !== undefined && input.DefaultTemplateData !== null) { entries["DefaultTemplateData"] = input.DefaultTemplateData; } - if (input.SourceArn !== undefined) { + if (input.SourceArn !== undefined && input.SourceArn !== null) { entries["SourceArn"] = input.SourceArn; } - if (input.DefaultTags !== undefined) { + if (input.DefaultTags !== undefined && input.DefaultTags !== null) { const memberEntries = serializeAws_queryMessageTagList(input.DefaultTags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DefaultTags.${key}`; entries[loc] = value; }); } - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.ReplyToAddresses !== undefined) { + if (input.ReplyToAddresses !== undefined && input.ReplyToAddresses !== null) { const memberEntries = serializeAws_queryAddressList(input.ReplyToAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplyToAddresses.${key}`; entries[loc] = value; }); } - if (input.Destinations !== undefined) { + if (input.Destinations !== undefined && input.Destinations !== null) { const memberEntries = serializeAws_queryBulkEmailDestinationList(input.Destinations, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Destinations.${key}`; entries[loc] = value; }); } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.Template !== undefined) { + if (input.Template !== undefined && input.Template !== null) { entries["Template"] = input.Template; } return entries; @@ -7494,13 +7533,13 @@ const serializeAws_querySendCustomVerificationEmailRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EmailAddress !== undefined) { + if (input.EmailAddress !== undefined && input.EmailAddress !== null) { entries["EmailAddress"] = input.EmailAddress; } - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } return entries; @@ -7508,47 +7547,47 @@ const serializeAws_querySendCustomVerificationEmailRequest = ( const serializeAws_querySendEmailRequest = (input: SendEmailRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReplyToAddresses !== undefined) { + if (input.ReplyToAddresses !== undefined && input.ReplyToAddresses !== null) { const memberEntries = serializeAws_queryAddressList(input.ReplyToAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplyToAddresses.${key}`; entries[loc] = value; }); } - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryMessageTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ReturnPathArn !== undefined) { + if (input.ReturnPathArn !== undefined && input.ReturnPathArn !== null) { entries["ReturnPathArn"] = input.ReturnPathArn; } - if (input.Destination !== undefined) { + if (input.Destination !== undefined && input.Destination !== null) { const memberEntries = serializeAws_queryDestination(input.Destination, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Destination.${key}`; entries[loc] = value; }); } - if (input.SourceArn !== undefined) { + if (input.SourceArn !== undefined && input.SourceArn !== null) { entries["SourceArn"] = input.SourceArn; } - if (input.Message !== undefined) { + if (input.Message !== undefined && input.Message !== null) { const memberEntries = serializeAws_queryMessage(input.Message, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Message.${key}`; entries[loc] = value; }); } - if (input.ReturnPath !== undefined) { + if (input.ReturnPath !== undefined && input.ReturnPath !== null) { entries["ReturnPath"] = input.ReturnPath; } return entries; @@ -7556,36 +7595,36 @@ const serializeAws_querySendEmailRequest = (input: SendEmailRequest, context: __ const serializeAws_querySendRawEmailRequest = (input: SendRawEmailRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.RawMessage !== undefined) { + if (input.RawMessage !== undefined && input.RawMessage !== null) { const memberEntries = serializeAws_queryRawMessage(input.RawMessage, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `RawMessage.${key}`; entries[loc] = value; }); } - if (input.SourceArn !== undefined) { + if (input.SourceArn !== undefined && input.SourceArn !== null) { entries["SourceArn"] = input.SourceArn; } - if (input.FromArn !== undefined) { + if (input.FromArn !== undefined && input.FromArn !== null) { entries["FromArn"] = input.FromArn; } - if (input.ReturnPathArn !== undefined) { + if (input.ReturnPathArn !== undefined && input.ReturnPathArn !== null) { entries["ReturnPathArn"] = input.ReturnPathArn; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryMessageTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.Destinations !== undefined) { + if (input.Destinations !== undefined && input.Destinations !== null) { const memberEntries = serializeAws_queryAddressList(input.Destinations, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Destinations.${key}`; @@ -7600,49 +7639,49 @@ const serializeAws_querySendTemplatedEmailRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReplyToAddresses !== undefined) { + if (input.ReplyToAddresses !== undefined && input.ReplyToAddresses !== null) { const memberEntries = serializeAws_queryAddressList(input.ReplyToAddresses, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ReplyToAddresses.${key}`; entries[loc] = value; }); } - if (input.Source !== undefined) { + if (input.Source !== undefined && input.Source !== null) { entries["Source"] = input.Source; } - if (input.TemplateData !== undefined) { + if (input.TemplateData !== undefined && input.TemplateData !== null) { entries["TemplateData"] = input.TemplateData; } - if (input.Template !== undefined) { + if (input.Template !== undefined && input.Template !== null) { entries["Template"] = input.Template; } - if (input.Destination !== undefined) { + if (input.Destination !== undefined && input.Destination !== null) { const memberEntries = serializeAws_queryDestination(input.Destination, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Destination.${key}`; entries[loc] = value; }); } - if (input.ReturnPathArn !== undefined) { + if (input.ReturnPathArn !== undefined && input.ReturnPathArn !== null) { entries["ReturnPathArn"] = input.ReturnPathArn; } - if (input.TemplateArn !== undefined) { + if (input.TemplateArn !== undefined && input.TemplateArn !== null) { entries["TemplateArn"] = input.TemplateArn; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryMessageTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ReturnPath !== undefined) { + if (input.ReturnPath !== undefined && input.ReturnPath !== null) { entries["ReturnPath"] = input.ReturnPath; } - if (input.SourceArn !== undefined) { + if (input.SourceArn !== undefined && input.SourceArn !== null) { entries["SourceArn"] = input.SourceArn; } - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } return entries; @@ -7653,7 +7692,7 @@ const serializeAws_querySetActiveReceiptRuleSetRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } return entries; @@ -7664,10 +7703,10 @@ const serializeAws_querySetIdentityDkimEnabledRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } - if (input.DkimEnabled !== undefined) { + if (input.DkimEnabled !== undefined && input.DkimEnabled !== null) { entries["DkimEnabled"] = input.DkimEnabled; } return entries; @@ -7678,10 +7717,10 @@ const serializeAws_querySetIdentityFeedbackForwardingEnabledRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ForwardingEnabled !== undefined) { + if (input.ForwardingEnabled !== undefined && input.ForwardingEnabled !== null) { entries["ForwardingEnabled"] = input.ForwardingEnabled; } - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } return entries; @@ -7692,13 +7731,13 @@ const serializeAws_querySetIdentityHeadersInNotificationsEnabledRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } - if (input.NotificationType !== undefined) { + if (input.NotificationType !== undefined && input.NotificationType !== null) { entries["NotificationType"] = input.NotificationType; } - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -7709,13 +7748,13 @@ const serializeAws_querySetIdentityMailFromDomainRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.MailFromDomain !== undefined) { + if (input.MailFromDomain !== undefined && input.MailFromDomain !== null) { entries["MailFromDomain"] = input.MailFromDomain; } - if (input.BehaviorOnMXFailure !== undefined) { + if (input.BehaviorOnMXFailure !== undefined && input.BehaviorOnMXFailure !== null) { entries["BehaviorOnMXFailure"] = input.BehaviorOnMXFailure; } - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } return entries; @@ -7726,13 +7765,13 @@ const serializeAws_querySetIdentityNotificationTopicRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NotificationType !== undefined) { + if (input.NotificationType !== undefined && input.NotificationType !== null) { entries["NotificationType"] = input.NotificationType; } - if (input.SnsTopic !== undefined) { + if (input.SnsTopic !== undefined && input.SnsTopic !== null) { entries["SnsTopic"] = input.SnsTopic; } - if (input.Identity !== undefined) { + if (input.Identity !== undefined && input.Identity !== null) { entries["Identity"] = input.Identity; } return entries; @@ -7743,13 +7782,13 @@ const serializeAws_querySetReceiptRulePositionRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.RuleName !== undefined) { + if (input.RuleName !== undefined && input.RuleName !== null) { entries["RuleName"] = input.RuleName; } - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } - if (input.After !== undefined) { + if (input.After !== undefined && input.After !== null) { entries["After"] = input.After; } return entries; @@ -7757,10 +7796,10 @@ const serializeAws_querySetReceiptRulePositionRequest = ( const serializeAws_querySNSAction = (input: SNSAction, context: __SerdeContext): any => { const entries: any = {}; - if (input.Encoding !== undefined) { + if (input.Encoding !== undefined && input.Encoding !== null) { entries["Encoding"] = input.Encoding; } - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } return entries; @@ -7768,7 +7807,7 @@ const serializeAws_querySNSAction = (input: SNSAction, context: __SerdeContext): const serializeAws_querySNSDestination = (input: SNSDestination, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicARN !== undefined) { + if (input.TopicARN !== undefined && input.TopicARN !== null) { entries["TopicARN"] = input.TopicARN; } return entries; @@ -7776,10 +7815,10 @@ const serializeAws_querySNSDestination = (input: SNSDestination, context: __Serd const serializeAws_queryStopAction = (input: StopAction, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.Scope !== undefined) { + if (input.Scope !== undefined && input.Scope !== null) { entries["Scope"] = input.Scope; } return entries; @@ -7787,16 +7826,16 @@ const serializeAws_queryStopAction = (input: StopAction, context: __SerdeContext const serializeAws_queryTemplate = (input: Template, context: __SerdeContext): any => { const entries: any = {}; - if (input.TextPart !== undefined) { + if (input.TextPart !== undefined && input.TextPart !== null) { entries["TextPart"] = input.TextPart; } - if (input.SubjectPart !== undefined) { + if (input.SubjectPart !== undefined && input.SubjectPart !== null) { entries["SubjectPart"] = input.SubjectPart; } - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.HtmlPart !== undefined) { + if (input.HtmlPart !== undefined && input.HtmlPart !== null) { entries["HtmlPart"] = input.HtmlPart; } return entries; @@ -7807,10 +7846,10 @@ const serializeAws_queryTestRenderTemplateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.TemplateData !== undefined) { + if (input.TemplateData !== undefined && input.TemplateData !== null) { entries["TemplateData"] = input.TemplateData; } return entries; @@ -7818,7 +7857,7 @@ const serializeAws_queryTestRenderTemplateRequest = ( const serializeAws_queryTrackingOptions = (input: TrackingOptions, context: __SerdeContext): any => { const entries: any = {}; - if (input.CustomRedirectDomain !== undefined) { + if (input.CustomRedirectDomain !== undefined && input.CustomRedirectDomain !== null) { entries["CustomRedirectDomain"] = input.CustomRedirectDomain; } return entries; @@ -7829,7 +7868,7 @@ const serializeAws_queryUpdateAccountSendingEnabledRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } return entries; @@ -7840,10 +7879,10 @@ const serializeAws_queryUpdateConfigurationSetEventDestinationRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.EventDestination !== undefined) { + if (input.EventDestination !== undefined && input.EventDestination !== null) { const memberEntries = serializeAws_queryEventDestination(input.EventDestination, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `EventDestination.${key}`; @@ -7858,10 +7897,10 @@ const serializeAws_queryUpdateConfigurationSetReputationMetricsEnabledRequest = context: __SerdeContext ): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } return entries; @@ -7872,10 +7911,10 @@ const serializeAws_queryUpdateConfigurationSetSendingEnabledRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Enabled !== undefined) { + if (input.Enabled !== undefined && input.Enabled !== null) { entries["Enabled"] = input.Enabled; } - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } return entries; @@ -7886,10 +7925,10 @@ const serializeAws_queryUpdateConfigurationSetTrackingOptionsRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ConfigurationSetName !== undefined) { + if (input.ConfigurationSetName !== undefined && input.ConfigurationSetName !== null) { entries["ConfigurationSetName"] = input.ConfigurationSetName; } - if (input.TrackingOptions !== undefined) { + if (input.TrackingOptions !== undefined && input.TrackingOptions !== null) { const memberEntries = serializeAws_queryTrackingOptions(input.TrackingOptions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TrackingOptions.${key}`; @@ -7904,22 +7943,22 @@ const serializeAws_queryUpdateCustomVerificationEmailTemplateRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TemplateName !== undefined) { + if (input.TemplateName !== undefined && input.TemplateName !== null) { entries["TemplateName"] = input.TemplateName; } - if (input.TemplateSubject !== undefined) { + if (input.TemplateSubject !== undefined && input.TemplateSubject !== null) { entries["TemplateSubject"] = input.TemplateSubject; } - if (input.FailureRedirectionURL !== undefined) { + if (input.FailureRedirectionURL !== undefined && input.FailureRedirectionURL !== null) { entries["FailureRedirectionURL"] = input.FailureRedirectionURL; } - if (input.FromEmailAddress !== undefined) { + if (input.FromEmailAddress !== undefined && input.FromEmailAddress !== null) { entries["FromEmailAddress"] = input.FromEmailAddress; } - if (input.SuccessRedirectionURL !== undefined) { + if (input.SuccessRedirectionURL !== undefined && input.SuccessRedirectionURL !== null) { entries["SuccessRedirectionURL"] = input.SuccessRedirectionURL; } - if (input.TemplateContent !== undefined) { + if (input.TemplateContent !== undefined && input.TemplateContent !== null) { entries["TemplateContent"] = input.TemplateContent; } return entries; @@ -7927,14 +7966,14 @@ const serializeAws_queryUpdateCustomVerificationEmailTemplateRequest = ( const serializeAws_queryUpdateReceiptRuleRequest = (input: UpdateReceiptRuleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Rule !== undefined) { + if (input.Rule !== undefined && input.Rule !== null) { const memberEntries = serializeAws_queryReceiptRule(input.Rule, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Rule.${key}`; entries[loc] = value; }); } - if (input.RuleSetName !== undefined) { + if (input.RuleSetName !== undefined && input.RuleSetName !== null) { entries["RuleSetName"] = input.RuleSetName; } return entries; @@ -7942,7 +7981,7 @@ const serializeAws_queryUpdateReceiptRuleRequest = (input: UpdateReceiptRuleRequ const serializeAws_queryUpdateTemplateRequest = (input: UpdateTemplateRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Template !== undefined) { + if (input.Template !== undefined && input.Template !== null) { const memberEntries = serializeAws_queryTemplate(input.Template, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Template.${key}`; @@ -7954,7 +7993,7 @@ const serializeAws_queryUpdateTemplateRequest = (input: UpdateTemplateRequest, c const serializeAws_queryVerifyDomainDkimRequest = (input: VerifyDomainDkimRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } return entries; @@ -7965,7 +8004,7 @@ const serializeAws_queryVerifyDomainIdentityRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Domain !== undefined) { + if (input.Domain !== undefined && input.Domain !== null) { entries["Domain"] = input.Domain; } return entries; @@ -7976,7 +8015,7 @@ const serializeAws_queryVerifyEmailAddressRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EmailAddress !== undefined) { + if (input.EmailAddress !== undefined && input.EmailAddress !== null) { entries["EmailAddress"] = input.EmailAddress; } return entries; @@ -7987,7 +8026,7 @@ const serializeAws_queryVerifyEmailIdentityRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EmailAddress !== undefined) { + if (input.EmailAddress !== undefined && input.EmailAddress !== null) { entries["EmailAddress"] = input.EmailAddress; } return entries; @@ -7995,10 +8034,10 @@ const serializeAws_queryVerifyEmailIdentityRequest = ( const serializeAws_queryWorkmailAction = (input: WorkmailAction, context: __SerdeContext): any => { const entries: any = {}; - if (input.OrganizationArn !== undefined) { + if (input.OrganizationArn !== undefined && input.OrganizationArn !== null) { entries["OrganizationArn"] = input.OrganizationArn; } - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } return entries; @@ -8032,7 +8071,14 @@ const deserializeAws_queryAddHeaderAction = (output: any, context: __SerdeContex }; const deserializeAws_queryAddressList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryAlreadyExistsException = (output: any, context: __SerdeContext): AlreadyExistsException => { @@ -8100,7 +8146,14 @@ const deserializeAws_queryBulkEmailDestinationStatusList = ( output: any, context: __SerdeContext ): BulkEmailDestinationStatus[] => { - return (output || []).map((entry: any) => deserializeAws_queryBulkEmailDestinationStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryBulkEmailDestinationStatus(entry, context); + }); }; const deserializeAws_queryCannotDeleteException = (output: any, context: __SerdeContext): CannotDeleteException => { @@ -8166,7 +8219,14 @@ const deserializeAws_queryCloudWatchDimensionConfigurations = ( output: any, context: __SerdeContext ): CloudWatchDimensionConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_queryCloudWatchDimensionConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCloudWatchDimensionConfiguration(entry, context); + }); }; const deserializeAws_queryConfigurationSet = (output: any, context: __SerdeContext): ConfigurationSet => { @@ -8214,7 +8274,14 @@ const deserializeAws_queryConfigurationSetDoesNotExistException = ( }; const deserializeAws_queryConfigurationSets = (output: any, context: __SerdeContext): ConfigurationSet[] => { - return (output || []).map((entry: any) => deserializeAws_queryConfigurationSet(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryConfigurationSet(entry, context); + }); }; const deserializeAws_queryConfigurationSetSendingPausedException = ( @@ -8367,7 +8434,14 @@ const deserializeAws_queryCustomVerificationEmailTemplates = ( output: any, context: __SerdeContext ): CustomVerificationEmailTemplate[] => { - return (output || []).map((entry: any) => deserializeAws_queryCustomVerificationEmailTemplate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryCustomVerificationEmailTemplate(entry, context); + }); }; const deserializeAws_queryDeleteConfigurationSetEventDestinationResponse = ( @@ -8538,13 +8612,15 @@ const deserializeAws_queryDkimAttributes = ( output: any, context: __SerdeContext ): { [key: string]: IdentityDkimAttributes } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: deserializeAws_queryIdentityDkimAttributes(pair["value"], context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryEventDestination = (output: any, context: __SerdeContext): EventDestination => { @@ -8632,11 +8708,25 @@ const deserializeAws_queryEventDestinationDoesNotExistException = ( }; const deserializeAws_queryEventDestinations = (output: any, context: __SerdeContext): EventDestination[] => { - return (output || []).map((entry: any) => deserializeAws_queryEventDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEventDestination(entry, context); + }); }; const deserializeAws_queryEventTypes = (output: any, context: __SerdeContext): (EventType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryFromEmailAddressNotVerifiedException = ( @@ -8866,7 +8956,14 @@ const deserializeAws_queryIdentityDkimAttributes = (output: any, context: __Serd }; const deserializeAws_queryIdentityList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryIdentityMailFromDomainAttributes = ( @@ -9359,13 +9456,15 @@ const deserializeAws_queryMailFromDomainAttributes = ( output: any, context: __SerdeContext ): { [key: string]: IdentityMailFromDomainAttributes } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: deserializeAws_queryIdentityMailFromDomainAttributes(pair["value"], context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryMailFromDomainNotVerifiedException = ( @@ -9412,27 +9511,38 @@ const deserializeAws_queryNotificationAttributes = ( output: any, context: __SerdeContext ): { [key: string]: IdentityNotificationAttributes } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: deserializeAws_queryIdentityNotificationAttributes(pair["value"], context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryPolicyMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: pair["value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryPolicyNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryProductionAccessNotGrantedException = ( @@ -9499,7 +9609,14 @@ const deserializeAws_queryReceiptAction = (output: any, context: __SerdeContext) }; const deserializeAws_queryReceiptActionsList = (output: any, context: __SerdeContext): ReceiptAction[] => { - return (output || []).map((entry: any) => deserializeAws_queryReceiptAction(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReceiptAction(entry, context); + }); }; const deserializeAws_queryReceiptFilter = (output: any, context: __SerdeContext): ReceiptFilter => { @@ -9517,7 +9634,14 @@ const deserializeAws_queryReceiptFilter = (output: any, context: __SerdeContext) }; const deserializeAws_queryReceiptFilterList = (output: any, context: __SerdeContext): ReceiptFilter[] => { - return (output || []).map((entry: any) => deserializeAws_queryReceiptFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReceiptFilter(entry, context); + }); }; const deserializeAws_queryReceiptIpFilter = (output: any, context: __SerdeContext): ReceiptIpFilter => { @@ -9591,15 +9715,36 @@ const deserializeAws_queryReceiptRuleSetMetadata = (output: any, context: __Serd }; const deserializeAws_queryReceiptRuleSetsLists = (output: any, context: __SerdeContext): ReceiptRuleSetMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_queryReceiptRuleSetMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReceiptRuleSetMetadata(entry, context); + }); }; const deserializeAws_queryReceiptRulesList = (output: any, context: __SerdeContext): ReceiptRule[] => { - return (output || []).map((entry: any) => deserializeAws_queryReceiptRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryReceiptRule(entry, context); + }); }; const deserializeAws_queryRecipientsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryReorderReceiptRuleSetResponse = ( @@ -9753,7 +9898,14 @@ const deserializeAws_querySendDataPoint = (output: any, context: __SerdeContext) }; const deserializeAws_querySendDataPointList = (output: any, context: __SerdeContext): SendDataPoint[] => { - return (output || []).map((entry: any) => deserializeAws_querySendDataPoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySendDataPoint(entry, context); + }); }; const deserializeAws_querySendEmailResponse = (output: any, context: __SerdeContext): SendEmailResponse => { @@ -9937,7 +10089,14 @@ const deserializeAws_queryTemplateMetadata = (output: any, context: __SerdeConte }; const deserializeAws_queryTemplateMetadataList = (output: any, context: __SerdeContext): TemplateMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_queryTemplateMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTemplateMetadata(entry, context); + }); }; const deserializeAws_queryTestRenderTemplateResponse = ( @@ -10030,17 +10189,26 @@ const deserializeAws_queryVerificationAttributes = ( output: any, context: __SerdeContext ): { [key: string]: IdentityVerificationAttributes } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: deserializeAws_queryIdentityVerificationAttributes(pair["value"], context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryVerificationTokenList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryVerifyDomainDkimResponse = ( diff --git a/clients/client-sesv2/protocols/Aws_restJson1.ts b/clients/client-sesv2/protocols/Aws_restJson1.ts index 5dd2c23535d0..e298fe4e3a1a 100644 --- a/clients/client-sesv2/protocols/Aws_restJson1.ts +++ b/clients/client-sesv2/protocols/Aws_restJson1.ts @@ -344,28 +344,35 @@ export const serializeAws_restJson1CreateConfigurationSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/configuration-sets"; let body: any; body = JSON.stringify({ - ...(input.ConfigurationSetName !== undefined && { ConfigurationSetName: input.ConfigurationSetName }), - ...(input.DeliveryOptions !== undefined && { - DeliveryOptions: serializeAws_restJson1DeliveryOptions(input.DeliveryOptions, context), - }), - ...(input.ReputationOptions !== undefined && { - ReputationOptions: serializeAws_restJson1ReputationOptions(input.ReputationOptions, context), - }), - ...(input.SendingOptions !== undefined && { - SendingOptions: serializeAws_restJson1SendingOptions(input.SendingOptions, context), - }), - ...(input.SuppressionOptions !== undefined && { - SuppressionOptions: serializeAws_restJson1SuppressionOptions(input.SuppressionOptions, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.TrackingOptions !== undefined && { - TrackingOptions: serializeAws_restJson1TrackingOptions(input.TrackingOptions, context), - }), + ...(input.ConfigurationSetName !== undefined && + input.ConfigurationSetName !== null && { ConfigurationSetName: input.ConfigurationSetName }), + ...(input.DeliveryOptions !== undefined && + input.DeliveryOptions !== null && { + DeliveryOptions: serializeAws_restJson1DeliveryOptions(input.DeliveryOptions, context), + }), + ...(input.ReputationOptions !== undefined && + input.ReputationOptions !== null && { + ReputationOptions: serializeAws_restJson1ReputationOptions(input.ReputationOptions, context), + }), + ...(input.SendingOptions !== undefined && + input.SendingOptions !== null && { + SendingOptions: serializeAws_restJson1SendingOptions(input.SendingOptions, context), + }), + ...(input.SuppressionOptions !== undefined && + input.SuppressionOptions !== null && { + SuppressionOptions: serializeAws_restJson1SuppressionOptions(input.SuppressionOptions, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.TrackingOptions !== undefined && + input.TrackingOptions !== null && { + TrackingOptions: serializeAws_restJson1TrackingOptions(input.TrackingOptions, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -384,7 +391,7 @@ export const serializeAws_restJson1CreateConfigurationSetEventDestinationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations"; if (input.ConfigurationSetName !== undefined) { @@ -398,10 +405,12 @@ export const serializeAws_restJson1CreateConfigurationSetEventDestinationCommand } let body: any; body = JSON.stringify({ - ...(input.EventDestination !== undefined && { - EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), - }), - ...(input.EventDestinationName !== undefined && { EventDestinationName: input.EventDestinationName }), + ...(input.EventDestination !== undefined && + input.EventDestination !== null && { + EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), + }), + ...(input.EventDestinationName !== undefined && + input.EventDestinationName !== null && { EventDestinationName: input.EventDestinationName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -420,7 +429,7 @@ export const serializeAws_restJson1CreateContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/contact-lists/{ContactListName}/contacts"; if (input.ContactListName !== undefined) { @@ -434,12 +443,15 @@ export const serializeAws_restJson1CreateContactCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AttributesData !== undefined && { AttributesData: input.AttributesData }), - ...(input.EmailAddress !== undefined && { EmailAddress: input.EmailAddress }), - ...(input.TopicPreferences !== undefined && { - TopicPreferences: serializeAws_restJson1TopicPreferenceList(input.TopicPreferences, context), - }), - ...(input.UnsubscribeAll !== undefined && { UnsubscribeAll: input.UnsubscribeAll }), + ...(input.AttributesData !== undefined && + input.AttributesData !== null && { AttributesData: input.AttributesData }), + ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }), + ...(input.TopicPreferences !== undefined && + input.TopicPreferences !== null && { + TopicPreferences: serializeAws_restJson1TopicPreferenceList(input.TopicPreferences, context), + }), + ...(input.UnsubscribeAll !== undefined && + input.UnsubscribeAll !== null && { UnsubscribeAll: input.UnsubscribeAll }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -458,15 +470,18 @@ export const serializeAws_restJson1CreateContactListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/contact-lists"; let body: any; body = JSON.stringify({ - ...(input.ContactListName !== undefined && { ContactListName: input.ContactListName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), - ...(input.Topics !== undefined && { Topics: serializeAws_restJson1Topics(input.Topics, context) }), + ...(input.ContactListName !== undefined && + input.ContactListName !== null && { ContactListName: input.ContactListName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Topics !== undefined && + input.Topics !== null && { Topics: serializeAws_restJson1Topics(input.Topics, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -485,17 +500,22 @@ export const serializeAws_restJson1CreateCustomVerificationEmailTemplateCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/custom-verification-email-templates"; let body: any; body = JSON.stringify({ - ...(input.FailureRedirectionURL !== undefined && { FailureRedirectionURL: input.FailureRedirectionURL }), - ...(input.FromEmailAddress !== undefined && { FromEmailAddress: input.FromEmailAddress }), - ...(input.SuccessRedirectionURL !== undefined && { SuccessRedirectionURL: input.SuccessRedirectionURL }), - ...(input.TemplateContent !== undefined && { TemplateContent: input.TemplateContent }), - ...(input.TemplateName !== undefined && { TemplateName: input.TemplateName }), - ...(input.TemplateSubject !== undefined && { TemplateSubject: input.TemplateSubject }), + ...(input.FailureRedirectionURL !== undefined && + input.FailureRedirectionURL !== null && { FailureRedirectionURL: input.FailureRedirectionURL }), + ...(input.FromEmailAddress !== undefined && + input.FromEmailAddress !== null && { FromEmailAddress: input.FromEmailAddress }), + ...(input.SuccessRedirectionURL !== undefined && + input.SuccessRedirectionURL !== null && { SuccessRedirectionURL: input.SuccessRedirectionURL }), + ...(input.TemplateContent !== undefined && + input.TemplateContent !== null && { TemplateContent: input.TemplateContent }), + ...(input.TemplateName !== undefined && input.TemplateName !== null && { TemplateName: input.TemplateName }), + ...(input.TemplateSubject !== undefined && + input.TemplateSubject !== null && { TemplateSubject: input.TemplateSubject }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -514,13 +534,14 @@ export const serializeAws_restJson1CreateDedicatedIpPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/dedicated-ip-pools"; let body: any; body = JSON.stringify({ - ...(input.PoolName !== undefined && { PoolName: input.PoolName }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.PoolName !== undefined && input.PoolName !== null && { PoolName: input.PoolName }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -539,15 +560,18 @@ export const serializeAws_restJson1CreateDeliverabilityTestReportCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/deliverability-dashboard/test"; let body: any; body = JSON.stringify({ - ...(input.Content !== undefined && { Content: serializeAws_restJson1EmailContent(input.Content, context) }), - ...(input.FromEmailAddress !== undefined && { FromEmailAddress: input.FromEmailAddress }), - ...(input.ReportName !== undefined && { ReportName: input.ReportName }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.Content !== undefined && + input.Content !== null && { Content: serializeAws_restJson1EmailContent(input.Content, context) }), + ...(input.FromEmailAddress !== undefined && + input.FromEmailAddress !== null && { FromEmailAddress: input.FromEmailAddress }), + ...(input.ReportName !== undefined && input.ReportName !== null && { ReportName: input.ReportName }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -566,16 +590,18 @@ export const serializeAws_restJson1CreateEmailIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/identities"; let body: any; body = JSON.stringify({ - ...(input.DkimSigningAttributes !== undefined && { - DkimSigningAttributes: serializeAws_restJson1DkimSigningAttributes(input.DkimSigningAttributes, context), - }), - ...(input.EmailIdentity !== undefined && { EmailIdentity: input.EmailIdentity }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.DkimSigningAttributes !== undefined && + input.DkimSigningAttributes !== null && { + DkimSigningAttributes: serializeAws_restJson1DkimSigningAttributes(input.DkimSigningAttributes, context), + }), + ...(input.EmailIdentity !== undefined && input.EmailIdentity !== null && { EmailIdentity: input.EmailIdentity }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -594,7 +620,7 @@ export const serializeAws_restJson1CreateEmailIdentityPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/identities/{EmailIdentity}/policies/{PolicyName}"; if (input.PolicyName !== undefined) { @@ -617,7 +643,7 @@ export const serializeAws_restJson1CreateEmailIdentityPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Policy !== undefined && { Policy: input.Policy }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -636,15 +662,16 @@ export const serializeAws_restJson1CreateEmailTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/templates"; let body: any; body = JSON.stringify({ - ...(input.TemplateContent !== undefined && { - TemplateContent: serializeAws_restJson1EmailTemplateContent(input.TemplateContent, context), - }), - ...(input.TemplateName !== undefined && { TemplateName: input.TemplateName }), + ...(input.TemplateContent !== undefined && + input.TemplateContent !== null && { + TemplateContent: serializeAws_restJson1EmailTemplateContent(input.TemplateContent, context), + }), + ...(input.TemplateName !== undefined && input.TemplateName !== null && { TemplateName: input.TemplateName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -663,17 +690,19 @@ export const serializeAws_restJson1CreateImportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/import-jobs"; let body: any; body = JSON.stringify({ - ...(input.ImportDataSource !== undefined && { - ImportDataSource: serializeAws_restJson1ImportDataSource(input.ImportDataSource, context), - }), - ...(input.ImportDestination !== undefined && { - ImportDestination: serializeAws_restJson1ImportDestination(input.ImportDestination, context), - }), + ...(input.ImportDataSource !== undefined && + input.ImportDataSource !== null && { + ImportDataSource: serializeAws_restJson1ImportDataSource(input.ImportDataSource, context), + }), + ...(input.ImportDestination !== undefined && + input.ImportDestination !== null && { + ImportDestination: serializeAws_restJson1ImportDestination(input.ImportDestination, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -691,9 +720,7 @@ export const serializeAws_restJson1DeleteConfigurationSetCommand = async ( input: DeleteConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -721,9 +748,7 @@ export const serializeAws_restJson1DeleteConfigurationSetEventDestinationCommand input: DeleteConfigurationSetEventDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -760,9 +785,7 @@ export const serializeAws_restJson1DeleteContactCommand = async ( input: DeleteContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/contact-lists/{ContactListName}/contacts/{EmailAddress}"; if (input.ContactListName !== undefined) { const labelValue: string = input.ContactListName; @@ -799,9 +822,7 @@ export const serializeAws_restJson1DeleteContactListCommand = async ( input: DeleteContactListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/contact-lists/{ContactListName}"; if (input.ContactListName !== undefined) { const labelValue: string = input.ContactListName; @@ -829,9 +850,7 @@ export const serializeAws_restJson1DeleteCustomVerificationEmailTemplateCommand input: DeleteCustomVerificationEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/custom-verification-email-templates/{TemplateName}"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -859,9 +878,7 @@ export const serializeAws_restJson1DeleteDedicatedIpPoolCommand = async ( input: DeleteDedicatedIpPoolCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/dedicated-ip-pools/{PoolName}"; if (input.PoolName !== undefined) { const labelValue: string = input.PoolName; @@ -889,9 +906,7 @@ export const serializeAws_restJson1DeleteEmailIdentityCommand = async ( input: DeleteEmailIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/identities/{EmailIdentity}"; if (input.EmailIdentity !== undefined) { const labelValue: string = input.EmailIdentity; @@ -919,9 +934,7 @@ export const serializeAws_restJson1DeleteEmailIdentityPolicyCommand = async ( input: DeleteEmailIdentityPolicyCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/identities/{EmailIdentity}/policies/{PolicyName}"; if (input.EmailIdentity !== undefined) { const labelValue: string = input.EmailIdentity; @@ -958,9 +971,7 @@ export const serializeAws_restJson1DeleteEmailTemplateCommand = async ( input: DeleteEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/templates/{TemplateName}"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -988,9 +999,7 @@ export const serializeAws_restJson1DeleteSuppressedDestinationCommand = async ( input: DeleteSuppressedDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/suppression/addresses/{EmailAddress}"; if (input.EmailAddress !== undefined) { const labelValue: string = input.EmailAddress; @@ -1018,12 +1027,10 @@ export const serializeAws_restJson1GetAccountCommand = async ( input: GetAccountCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/account"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1040,9 +1047,7 @@ export const serializeAws_restJson1GetBlacklistReportsCommand = async ( input: GetBlacklistReportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/deliverability-dashboard/blacklist-report"; const query: any = { ...(input.BlacklistItemNames !== undefined && { @@ -1067,9 +1072,7 @@ export const serializeAws_restJson1GetConfigurationSetCommand = async ( input: GetConfigurationSetCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -1097,9 +1100,7 @@ export const serializeAws_restJson1GetConfigurationSetEventDestinationsCommand = input: GetConfigurationSetEventDestinationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations"; if (input.ConfigurationSetName !== undefined) { const labelValue: string = input.ConfigurationSetName; @@ -1127,9 +1128,7 @@ export const serializeAws_restJson1GetContactCommand = async ( input: GetContactCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/contact-lists/{ContactListName}/contacts/{EmailAddress}"; if (input.EmailAddress !== undefined) { const labelValue: string = input.EmailAddress; @@ -1166,9 +1165,7 @@ export const serializeAws_restJson1GetContactListCommand = async ( input: GetContactListCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/contact-lists/{ContactListName}"; if (input.ContactListName !== undefined) { const labelValue: string = input.ContactListName; @@ -1196,9 +1193,7 @@ export const serializeAws_restJson1GetCustomVerificationEmailTemplateCommand = a input: GetCustomVerificationEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/custom-verification-email-templates/{TemplateName}"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -1226,9 +1221,7 @@ export const serializeAws_restJson1GetDedicatedIpCommand = async ( input: GetDedicatedIpCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/dedicated-ips/{Ip}"; if (input.Ip !== undefined) { const labelValue: string = input.Ip; @@ -1256,9 +1249,7 @@ export const serializeAws_restJson1GetDedicatedIpsCommand = async ( input: GetDedicatedIpsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/dedicated-ips"; const query: any = { ...(input.PageSize !== undefined && { PageSize: input.PageSize.toString() }), @@ -1283,12 +1274,10 @@ export const serializeAws_restJson1GetDeliverabilityDashboardOptionsCommand = as input: GetDeliverabilityDashboardOptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/deliverability-dashboard"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -1305,9 +1294,7 @@ export const serializeAws_restJson1GetDeliverabilityTestReportCommand = async ( input: GetDeliverabilityTestReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/deliverability-dashboard/test-reports/{ReportId}"; if (input.ReportId !== undefined) { const labelValue: string = input.ReportId; @@ -1335,9 +1322,7 @@ export const serializeAws_restJson1GetDomainDeliverabilityCampaignCommand = asyn input: GetDomainDeliverabilityCampaignCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/deliverability-dashboard/campaigns/{CampaignId}"; if (input.CampaignId !== undefined) { const labelValue: string = input.CampaignId; @@ -1365,9 +1350,7 @@ export const serializeAws_restJson1GetDomainStatisticsReportCommand = async ( input: GetDomainStatisticsReportCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/deliverability-dashboard/statistics-report/{Domain}"; if (input.Domain !== undefined) { const labelValue: string = input.Domain; @@ -1400,9 +1383,7 @@ export const serializeAws_restJson1GetEmailIdentityCommand = async ( input: GetEmailIdentityCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/identities/{EmailIdentity}"; if (input.EmailIdentity !== undefined) { const labelValue: string = input.EmailIdentity; @@ -1430,9 +1411,7 @@ export const serializeAws_restJson1GetEmailIdentityPoliciesCommand = async ( input: GetEmailIdentityPoliciesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/identities/{EmailIdentity}/policies"; if (input.EmailIdentity !== undefined) { const labelValue: string = input.EmailIdentity; @@ -1460,9 +1439,7 @@ export const serializeAws_restJson1GetEmailTemplateCommand = async ( input: GetEmailTemplateCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/templates/{TemplateName}"; if (input.TemplateName !== undefined) { const labelValue: string = input.TemplateName; @@ -1490,9 +1467,7 @@ export const serializeAws_restJson1GetImportJobCommand = async ( input: GetImportJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/import-jobs/{JobId}"; if (input.JobId !== undefined) { const labelValue: string = input.JobId; @@ -1520,9 +1495,7 @@ export const serializeAws_restJson1GetSuppressedDestinationCommand = async ( input: GetSuppressedDestinationCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/suppression/addresses/{EmailAddress}"; if (input.EmailAddress !== undefined) { const labelValue: string = input.EmailAddress; @@ -1550,9 +1523,7 @@ export const serializeAws_restJson1ListConfigurationSetsCommand = async ( input: ListConfigurationSetsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/configuration-sets"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -1576,9 +1547,7 @@ export const serializeAws_restJson1ListContactListsCommand = async ( input: ListContactListsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/contact-lists"; const query: any = { ...(input.PageSize !== undefined && { PageSize: input.PageSize.toString() }), @@ -1603,7 +1572,7 @@ export const serializeAws_restJson1ListContactsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/contact-lists/{ContactListName}/contacts"; if (input.ContactListName !== undefined) { @@ -1621,7 +1590,8 @@ export const serializeAws_restJson1ListContactsCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.Filter !== undefined && { Filter: serializeAws_restJson1ListContactsFilter(input.Filter, context) }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_restJson1ListContactsFilter(input.Filter, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1640,9 +1610,7 @@ export const serializeAws_restJson1ListCustomVerificationEmailTemplatesCommand = input: ListCustomVerificationEmailTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/custom-verification-email-templates"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -1666,9 +1634,7 @@ export const serializeAws_restJson1ListDedicatedIpPoolsCommand = async ( input: ListDedicatedIpPoolsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/dedicated-ip-pools"; const query: any = { ...(input.PageSize !== undefined && { PageSize: input.PageSize.toString() }), @@ -1692,9 +1658,7 @@ export const serializeAws_restJson1ListDeliverabilityTestReportsCommand = async input: ListDeliverabilityTestReportsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/deliverability-dashboard/test-reports"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -1718,9 +1682,7 @@ export const serializeAws_restJson1ListDomainDeliverabilityCampaignsCommand = as input: ListDomainDeliverabilityCampaignsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/deliverability-dashboard/domains/{SubscribedDomain}/campaigns"; if (input.SubscribedDomain !== undefined) { const labelValue: string = input.SubscribedDomain; @@ -1755,9 +1717,7 @@ export const serializeAws_restJson1ListEmailIdentitiesCommand = async ( input: ListEmailIdentitiesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/identities"; const query: any = { ...(input.PageSize !== undefined && { PageSize: input.PageSize.toString() }), @@ -1781,9 +1741,7 @@ export const serializeAws_restJson1ListEmailTemplatesCommand = async ( input: ListEmailTemplatesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/templates"; const query: any = { ...(input.NextToken !== undefined && { NextToken: input.NextToken }), @@ -1808,7 +1766,7 @@ export const serializeAws_restJson1ListImportJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/import-jobs"; const query: any = { @@ -1817,7 +1775,8 @@ export const serializeAws_restJson1ListImportJobsCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.ImportDestinationType !== undefined && { ImportDestinationType: input.ImportDestinationType }), + ...(input.ImportDestinationType !== undefined && + input.ImportDestinationType !== null && { ImportDestinationType: input.ImportDestinationType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1836,9 +1795,7 @@ export const serializeAws_restJson1ListSuppressedDestinationsCommand = async ( input: ListSuppressedDestinationsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/suppression/addresses"; const query: any = { ...(input.Reasons !== undefined && { Reason: (input.Reasons || []).map((_entry) => _entry) }), @@ -1865,9 +1822,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/tags"; const query: any = { ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), @@ -1891,12 +1846,13 @@ export const serializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/account/dedicated-ips/warmup"; let body: any; body = JSON.stringify({ - ...(input.AutoWarmupEnabled !== undefined && { AutoWarmupEnabled: input.AutoWarmupEnabled }), + ...(input.AutoWarmupEnabled !== undefined && + input.AutoWarmupEnabled !== null && { AutoWarmupEnabled: input.AutoWarmupEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1915,22 +1871,26 @@ export const serializeAws_restJson1PutAccountDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/account/details"; let body: any; body = JSON.stringify({ - ...(input.AdditionalContactEmailAddresses !== undefined && { - AdditionalContactEmailAddresses: serializeAws_restJson1AdditionalContactEmailAddresses( - input.AdditionalContactEmailAddresses, - context - ), - }), - ...(input.ContactLanguage !== undefined && { ContactLanguage: input.ContactLanguage }), - ...(input.MailType !== undefined && { MailType: input.MailType }), - ...(input.ProductionAccessEnabled !== undefined && { ProductionAccessEnabled: input.ProductionAccessEnabled }), - ...(input.UseCaseDescription !== undefined && { UseCaseDescription: input.UseCaseDescription }), - ...(input.WebsiteURL !== undefined && { WebsiteURL: input.WebsiteURL }), + ...(input.AdditionalContactEmailAddresses !== undefined && + input.AdditionalContactEmailAddresses !== null && { + AdditionalContactEmailAddresses: serializeAws_restJson1AdditionalContactEmailAddresses( + input.AdditionalContactEmailAddresses, + context + ), + }), + ...(input.ContactLanguage !== undefined && + input.ContactLanguage !== null && { ContactLanguage: input.ContactLanguage }), + ...(input.MailType !== undefined && input.MailType !== null && { MailType: input.MailType }), + ...(input.ProductionAccessEnabled !== undefined && + input.ProductionAccessEnabled !== null && { ProductionAccessEnabled: input.ProductionAccessEnabled }), + ...(input.UseCaseDescription !== undefined && + input.UseCaseDescription !== null && { UseCaseDescription: input.UseCaseDescription }), + ...(input.WebsiteURL !== undefined && input.WebsiteURL !== null && { WebsiteURL: input.WebsiteURL }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1949,12 +1909,13 @@ export const serializeAws_restJson1PutAccountSendingAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/account/sending"; let body: any; body = JSON.stringify({ - ...(input.SendingEnabled !== undefined && { SendingEnabled: input.SendingEnabled }), + ...(input.SendingEnabled !== undefined && + input.SendingEnabled !== null && { SendingEnabled: input.SendingEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1973,14 +1934,15 @@ export const serializeAws_restJson1PutAccountSuppressionAttributesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/account/suppression"; let body: any; body = JSON.stringify({ - ...(input.SuppressedReasons !== undefined && { - SuppressedReasons: serializeAws_restJson1SuppressionListReasons(input.SuppressedReasons, context), - }), + ...(input.SuppressedReasons !== undefined && + input.SuppressedReasons !== null && { + SuppressedReasons: serializeAws_restJson1SuppressionListReasons(input.SuppressedReasons, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1999,7 +1961,7 @@ export const serializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}/delivery-options"; if (input.ConfigurationSetName !== undefined) { @@ -2013,8 +1975,9 @@ export const serializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = a } let body: any; body = JSON.stringify({ - ...(input.SendingPoolName !== undefined && { SendingPoolName: input.SendingPoolName }), - ...(input.TlsPolicy !== undefined && { TlsPolicy: input.TlsPolicy }), + ...(input.SendingPoolName !== undefined && + input.SendingPoolName !== null && { SendingPoolName: input.SendingPoolName }), + ...(input.TlsPolicy !== undefined && input.TlsPolicy !== null && { TlsPolicy: input.TlsPolicy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2033,7 +1996,7 @@ export const serializeAws_restJson1PutConfigurationSetReputationOptionsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}/reputation-options"; if (input.ConfigurationSetName !== undefined) { @@ -2047,7 +2010,8 @@ export const serializeAws_restJson1PutConfigurationSetReputationOptionsCommand = } let body: any; body = JSON.stringify({ - ...(input.ReputationMetricsEnabled !== undefined && { ReputationMetricsEnabled: input.ReputationMetricsEnabled }), + ...(input.ReputationMetricsEnabled !== undefined && + input.ReputationMetricsEnabled !== null && { ReputationMetricsEnabled: input.ReputationMetricsEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2066,7 +2030,7 @@ export const serializeAws_restJson1PutConfigurationSetSendingOptionsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}/sending"; if (input.ConfigurationSetName !== undefined) { @@ -2080,7 +2044,8 @@ export const serializeAws_restJson1PutConfigurationSetSendingOptionsCommand = as } let body: any; body = JSON.stringify({ - ...(input.SendingEnabled !== undefined && { SendingEnabled: input.SendingEnabled }), + ...(input.SendingEnabled !== undefined && + input.SendingEnabled !== null && { SendingEnabled: input.SendingEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2099,7 +2064,7 @@ export const serializeAws_restJson1PutConfigurationSetSuppressionOptionsCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}/suppression-options"; if (input.ConfigurationSetName !== undefined) { @@ -2113,9 +2078,10 @@ export const serializeAws_restJson1PutConfigurationSetSuppressionOptionsCommand } let body: any; body = JSON.stringify({ - ...(input.SuppressedReasons !== undefined && { - SuppressedReasons: serializeAws_restJson1SuppressionListReasons(input.SuppressedReasons, context), - }), + ...(input.SuppressedReasons !== undefined && + input.SuppressedReasons !== null && { + SuppressedReasons: serializeAws_restJson1SuppressionListReasons(input.SuppressedReasons, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2134,7 +2100,7 @@ export const serializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}/tracking-options"; if (input.ConfigurationSetName !== undefined) { @@ -2148,7 +2114,8 @@ export const serializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = a } let body: any; body = JSON.stringify({ - ...(input.CustomRedirectDomain !== undefined && { CustomRedirectDomain: input.CustomRedirectDomain }), + ...(input.CustomRedirectDomain !== undefined && + input.CustomRedirectDomain !== null && { CustomRedirectDomain: input.CustomRedirectDomain }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2167,7 +2134,7 @@ export const serializeAws_restJson1PutDedicatedIpInPoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/dedicated-ips/{Ip}/pool"; if (input.Ip !== undefined) { @@ -2181,7 +2148,8 @@ export const serializeAws_restJson1PutDedicatedIpInPoolCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.DestinationPoolName !== undefined && { DestinationPoolName: input.DestinationPoolName }), + ...(input.DestinationPoolName !== undefined && + input.DestinationPoolName !== null && { DestinationPoolName: input.DestinationPoolName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2200,7 +2168,7 @@ export const serializeAws_restJson1PutDedicatedIpWarmupAttributesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/dedicated-ips/{Ip}/warmup"; if (input.Ip !== undefined) { @@ -2214,7 +2182,8 @@ export const serializeAws_restJson1PutDedicatedIpWarmupAttributesCommand = async } let body: any; body = JSON.stringify({ - ...(input.WarmupPercentage !== undefined && { WarmupPercentage: input.WarmupPercentage }), + ...(input.WarmupPercentage !== undefined && + input.WarmupPercentage !== null && { WarmupPercentage: input.WarmupPercentage }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2233,15 +2202,17 @@ export const serializeAws_restJson1PutDeliverabilityDashboardOptionCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/deliverability-dashboard"; let body: any; body = JSON.stringify({ - ...(input.DashboardEnabled !== undefined && { DashboardEnabled: input.DashboardEnabled }), - ...(input.SubscribedDomains !== undefined && { - SubscribedDomains: serializeAws_restJson1DomainDeliverabilityTrackingOptions(input.SubscribedDomains, context), - }), + ...(input.DashboardEnabled !== undefined && + input.DashboardEnabled !== null && { DashboardEnabled: input.DashboardEnabled }), + ...(input.SubscribedDomains !== undefined && + input.SubscribedDomains !== null && { + SubscribedDomains: serializeAws_restJson1DomainDeliverabilityTrackingOptions(input.SubscribedDomains, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2260,7 +2231,7 @@ export const serializeAws_restJson1PutEmailIdentityDkimAttributesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/identities/{EmailIdentity}/dkim"; if (input.EmailIdentity !== undefined) { @@ -2274,7 +2245,8 @@ export const serializeAws_restJson1PutEmailIdentityDkimAttributesCommand = async } let body: any; body = JSON.stringify({ - ...(input.SigningEnabled !== undefined && { SigningEnabled: input.SigningEnabled }), + ...(input.SigningEnabled !== undefined && + input.SigningEnabled !== null && { SigningEnabled: input.SigningEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2293,7 +2265,7 @@ export const serializeAws_restJson1PutEmailIdentityDkimSigningAttributesCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v1/email/identities/{EmailIdentity}/dkim/signing"; if (input.EmailIdentity !== undefined) { @@ -2307,10 +2279,12 @@ export const serializeAws_restJson1PutEmailIdentityDkimSigningAttributesCommand } let body: any; body = JSON.stringify({ - ...(input.SigningAttributes !== undefined && { - SigningAttributes: serializeAws_restJson1DkimSigningAttributes(input.SigningAttributes, context), - }), - ...(input.SigningAttributesOrigin !== undefined && { SigningAttributesOrigin: input.SigningAttributesOrigin }), + ...(input.SigningAttributes !== undefined && + input.SigningAttributes !== null && { + SigningAttributes: serializeAws_restJson1DkimSigningAttributes(input.SigningAttributes, context), + }), + ...(input.SigningAttributesOrigin !== undefined && + input.SigningAttributesOrigin !== null && { SigningAttributesOrigin: input.SigningAttributesOrigin }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2329,7 +2303,7 @@ export const serializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/identities/{EmailIdentity}/feedback"; if (input.EmailIdentity !== undefined) { @@ -2343,7 +2317,8 @@ export const serializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = a } let body: any; body = JSON.stringify({ - ...(input.EmailForwardingEnabled !== undefined && { EmailForwardingEnabled: input.EmailForwardingEnabled }), + ...(input.EmailForwardingEnabled !== undefined && + input.EmailForwardingEnabled !== null && { EmailForwardingEnabled: input.EmailForwardingEnabled }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2362,7 +2337,7 @@ export const serializeAws_restJson1PutEmailIdentityMailFromAttributesCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/identities/{EmailIdentity}/mail-from"; if (input.EmailIdentity !== undefined) { @@ -2376,8 +2351,10 @@ export const serializeAws_restJson1PutEmailIdentityMailFromAttributesCommand = a } let body: any; body = JSON.stringify({ - ...(input.BehaviorOnMxFailure !== undefined && { BehaviorOnMxFailure: input.BehaviorOnMxFailure }), - ...(input.MailFromDomain !== undefined && { MailFromDomain: input.MailFromDomain }), + ...(input.BehaviorOnMxFailure !== undefined && + input.BehaviorOnMxFailure !== null && { BehaviorOnMxFailure: input.BehaviorOnMxFailure }), + ...(input.MailFromDomain !== undefined && + input.MailFromDomain !== null && { MailFromDomain: input.MailFromDomain }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2396,13 +2373,13 @@ export const serializeAws_restJson1PutSuppressedDestinationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/suppression/addresses"; let body: any; body = JSON.stringify({ - ...(input.EmailAddress !== undefined && { EmailAddress: input.EmailAddress }), - ...(input.Reason !== undefined && { Reason: input.Reason }), + ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }), + ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2421,34 +2398,41 @@ export const serializeAws_restJson1SendBulkEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/outbound-bulk-emails"; let body: any; body = JSON.stringify({ - ...(input.BulkEmailEntries !== undefined && { - BulkEmailEntries: serializeAws_restJson1BulkEmailEntryList(input.BulkEmailEntries, context), - }), - ...(input.ConfigurationSetName !== undefined && { ConfigurationSetName: input.ConfigurationSetName }), - ...(input.DefaultContent !== undefined && { - DefaultContent: serializeAws_restJson1BulkEmailContent(input.DefaultContent, context), - }), - ...(input.DefaultEmailTags !== undefined && { - DefaultEmailTags: serializeAws_restJson1MessageTagList(input.DefaultEmailTags, context), - }), - ...(input.FeedbackForwardingEmailAddress !== undefined && { - FeedbackForwardingEmailAddress: input.FeedbackForwardingEmailAddress, - }), - ...(input.FeedbackForwardingEmailAddressIdentityArn !== undefined && { - FeedbackForwardingEmailAddressIdentityArn: input.FeedbackForwardingEmailAddressIdentityArn, - }), - ...(input.FromEmailAddress !== undefined && { FromEmailAddress: input.FromEmailAddress }), - ...(input.FromEmailAddressIdentityArn !== undefined && { - FromEmailAddressIdentityArn: input.FromEmailAddressIdentityArn, - }), - ...(input.ReplyToAddresses !== undefined && { - ReplyToAddresses: serializeAws_restJson1EmailAddressList(input.ReplyToAddresses, context), - }), + ...(input.BulkEmailEntries !== undefined && + input.BulkEmailEntries !== null && { + BulkEmailEntries: serializeAws_restJson1BulkEmailEntryList(input.BulkEmailEntries, context), + }), + ...(input.ConfigurationSetName !== undefined && + input.ConfigurationSetName !== null && { ConfigurationSetName: input.ConfigurationSetName }), + ...(input.DefaultContent !== undefined && + input.DefaultContent !== null && { + DefaultContent: serializeAws_restJson1BulkEmailContent(input.DefaultContent, context), + }), + ...(input.DefaultEmailTags !== undefined && + input.DefaultEmailTags !== null && { + DefaultEmailTags: serializeAws_restJson1MessageTagList(input.DefaultEmailTags, context), + }), + ...(input.FeedbackForwardingEmailAddress !== undefined && + input.FeedbackForwardingEmailAddress !== null && { + FeedbackForwardingEmailAddress: input.FeedbackForwardingEmailAddress, + }), + ...(input.FeedbackForwardingEmailAddressIdentityArn !== undefined && + input.FeedbackForwardingEmailAddressIdentityArn !== null && { + FeedbackForwardingEmailAddressIdentityArn: input.FeedbackForwardingEmailAddressIdentityArn, + }), + ...(input.FromEmailAddress !== undefined && + input.FromEmailAddress !== null && { FromEmailAddress: input.FromEmailAddress }), + ...(input.FromEmailAddressIdentityArn !== undefined && + input.FromEmailAddressIdentityArn !== null && { FromEmailAddressIdentityArn: input.FromEmailAddressIdentityArn }), + ...(input.ReplyToAddresses !== undefined && + input.ReplyToAddresses !== null && { + ReplyToAddresses: serializeAws_restJson1EmailAddressList(input.ReplyToAddresses, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2467,14 +2451,15 @@ export const serializeAws_restJson1SendCustomVerificationEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/outbound-custom-verification-emails"; let body: any; body = JSON.stringify({ - ...(input.ConfigurationSetName !== undefined && { ConfigurationSetName: input.ConfigurationSetName }), - ...(input.EmailAddress !== undefined && { EmailAddress: input.EmailAddress }), - ...(input.TemplateName !== undefined && { TemplateName: input.TemplateName }), + ...(input.ConfigurationSetName !== undefined && + input.ConfigurationSetName !== null && { ConfigurationSetName: input.ConfigurationSetName }), + ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }), + ...(input.TemplateName !== undefined && input.TemplateName !== null && { TemplateName: input.TemplateName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2493,33 +2478,39 @@ export const serializeAws_restJson1SendEmailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/outbound-emails"; let body: any; body = JSON.stringify({ - ...(input.ConfigurationSetName !== undefined && { ConfigurationSetName: input.ConfigurationSetName }), - ...(input.Content !== undefined && { Content: serializeAws_restJson1EmailContent(input.Content, context) }), - ...(input.Destination !== undefined && { - Destination: serializeAws_restJson1Destination(input.Destination, context), - }), - ...(input.EmailTags !== undefined && { EmailTags: serializeAws_restJson1MessageTagList(input.EmailTags, context) }), - ...(input.FeedbackForwardingEmailAddress !== undefined && { - FeedbackForwardingEmailAddress: input.FeedbackForwardingEmailAddress, - }), - ...(input.FeedbackForwardingEmailAddressIdentityArn !== undefined && { - FeedbackForwardingEmailAddressIdentityArn: input.FeedbackForwardingEmailAddressIdentityArn, - }), - ...(input.FromEmailAddress !== undefined && { FromEmailAddress: input.FromEmailAddress }), - ...(input.FromEmailAddressIdentityArn !== undefined && { - FromEmailAddressIdentityArn: input.FromEmailAddressIdentityArn, - }), - ...(input.ListManagementOptions !== undefined && { - ListManagementOptions: serializeAws_restJson1ListManagementOptions(input.ListManagementOptions, context), - }), - ...(input.ReplyToAddresses !== undefined && { - ReplyToAddresses: serializeAws_restJson1EmailAddressList(input.ReplyToAddresses, context), - }), + ...(input.ConfigurationSetName !== undefined && + input.ConfigurationSetName !== null && { ConfigurationSetName: input.ConfigurationSetName }), + ...(input.Content !== undefined && + input.Content !== null && { Content: serializeAws_restJson1EmailContent(input.Content, context) }), + ...(input.Destination !== undefined && + input.Destination !== null && { Destination: serializeAws_restJson1Destination(input.Destination, context) }), + ...(input.EmailTags !== undefined && + input.EmailTags !== null && { EmailTags: serializeAws_restJson1MessageTagList(input.EmailTags, context) }), + ...(input.FeedbackForwardingEmailAddress !== undefined && + input.FeedbackForwardingEmailAddress !== null && { + FeedbackForwardingEmailAddress: input.FeedbackForwardingEmailAddress, + }), + ...(input.FeedbackForwardingEmailAddressIdentityArn !== undefined && + input.FeedbackForwardingEmailAddressIdentityArn !== null && { + FeedbackForwardingEmailAddressIdentityArn: input.FeedbackForwardingEmailAddressIdentityArn, + }), + ...(input.FromEmailAddress !== undefined && + input.FromEmailAddress !== null && { FromEmailAddress: input.FromEmailAddress }), + ...(input.FromEmailAddressIdentityArn !== undefined && + input.FromEmailAddressIdentityArn !== null && { FromEmailAddressIdentityArn: input.FromEmailAddressIdentityArn }), + ...(input.ListManagementOptions !== undefined && + input.ListManagementOptions !== null && { + ListManagementOptions: serializeAws_restJson1ListManagementOptions(input.ListManagementOptions, context), + }), + ...(input.ReplyToAddresses !== undefined && + input.ReplyToAddresses !== null && { + ReplyToAddresses: serializeAws_restJson1EmailAddressList(input.ReplyToAddresses, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2538,13 +2529,14 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/tags"; let body: any; body = JSON.stringify({ - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2563,7 +2555,7 @@ export const serializeAws_restJson1TestRenderEmailTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/templates/{TemplateName}/render"; if (input.TemplateName !== undefined) { @@ -2577,7 +2569,7 @@ export const serializeAws_restJson1TestRenderEmailTemplateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TemplateData !== undefined && { TemplateData: input.TemplateData }), + ...(input.TemplateData !== undefined && input.TemplateData !== null && { TemplateData: input.TemplateData }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2595,9 +2587,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/v2/email/tags"; const query: any = { ...(input.TagKeys !== undefined && { TagKeys: (input.TagKeys || []).map((_entry) => _entry) }), @@ -2622,7 +2612,7 @@ export const serializeAws_restJson1UpdateConfigurationSetEventDestinationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"; if (input.EventDestinationName !== undefined) { @@ -2645,9 +2635,10 @@ export const serializeAws_restJson1UpdateConfigurationSetEventDestinationCommand } let body: any; body = JSON.stringify({ - ...(input.EventDestination !== undefined && { - EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), - }), + ...(input.EventDestination !== undefined && + input.EventDestination !== null && { + EventDestination: serializeAws_restJson1EventDestinationDefinition(input.EventDestination, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2666,7 +2657,7 @@ export const serializeAws_restJson1UpdateContactCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/contact-lists/{ContactListName}/contacts/{EmailAddress}"; if (input.EmailAddress !== undefined) { @@ -2689,11 +2680,14 @@ export const serializeAws_restJson1UpdateContactCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.AttributesData !== undefined && { AttributesData: input.AttributesData }), - ...(input.TopicPreferences !== undefined && { - TopicPreferences: serializeAws_restJson1TopicPreferenceList(input.TopicPreferences, context), - }), - ...(input.UnsubscribeAll !== undefined && { UnsubscribeAll: input.UnsubscribeAll }), + ...(input.AttributesData !== undefined && + input.AttributesData !== null && { AttributesData: input.AttributesData }), + ...(input.TopicPreferences !== undefined && + input.TopicPreferences !== null && { + TopicPreferences: serializeAws_restJson1TopicPreferenceList(input.TopicPreferences, context), + }), + ...(input.UnsubscribeAll !== undefined && + input.UnsubscribeAll !== null && { UnsubscribeAll: input.UnsubscribeAll }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2712,7 +2706,7 @@ export const serializeAws_restJson1UpdateContactListCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/contact-lists/{ContactListName}"; if (input.ContactListName !== undefined) { @@ -2726,8 +2720,9 @@ export const serializeAws_restJson1UpdateContactListCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Topics !== undefined && { Topics: serializeAws_restJson1Topics(input.Topics, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Topics !== undefined && + input.Topics !== null && { Topics: serializeAws_restJson1Topics(input.Topics, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2746,7 +2741,7 @@ export const serializeAws_restJson1UpdateCustomVerificationEmailTemplateCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/custom-verification-email-templates/{TemplateName}"; if (input.TemplateName !== undefined) { @@ -2760,11 +2755,16 @@ export const serializeAws_restJson1UpdateCustomVerificationEmailTemplateCommand } let body: any; body = JSON.stringify({ - ...(input.FailureRedirectionURL !== undefined && { FailureRedirectionURL: input.FailureRedirectionURL }), - ...(input.FromEmailAddress !== undefined && { FromEmailAddress: input.FromEmailAddress }), - ...(input.SuccessRedirectionURL !== undefined && { SuccessRedirectionURL: input.SuccessRedirectionURL }), - ...(input.TemplateContent !== undefined && { TemplateContent: input.TemplateContent }), - ...(input.TemplateSubject !== undefined && { TemplateSubject: input.TemplateSubject }), + ...(input.FailureRedirectionURL !== undefined && + input.FailureRedirectionURL !== null && { FailureRedirectionURL: input.FailureRedirectionURL }), + ...(input.FromEmailAddress !== undefined && + input.FromEmailAddress !== null && { FromEmailAddress: input.FromEmailAddress }), + ...(input.SuccessRedirectionURL !== undefined && + input.SuccessRedirectionURL !== null && { SuccessRedirectionURL: input.SuccessRedirectionURL }), + ...(input.TemplateContent !== undefined && + input.TemplateContent !== null && { TemplateContent: input.TemplateContent }), + ...(input.TemplateSubject !== undefined && + input.TemplateSubject !== null && { TemplateSubject: input.TemplateSubject }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2783,7 +2783,7 @@ export const serializeAws_restJson1UpdateEmailIdentityPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/identities/{EmailIdentity}/policies/{PolicyName}"; if (input.EmailIdentity !== undefined) { @@ -2806,7 +2806,7 @@ export const serializeAws_restJson1UpdateEmailIdentityPolicyCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Policy !== undefined && { Policy: input.Policy }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2825,7 +2825,7 @@ export const serializeAws_restJson1UpdateEmailTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/v2/email/templates/{TemplateName}"; if (input.TemplateName !== undefined) { @@ -2839,9 +2839,10 @@ export const serializeAws_restJson1UpdateEmailTemplateCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.TemplateContent !== undefined && { - TemplateContent: serializeAws_restJson1EmailTemplateContent(input.TemplateContent, context), - }), + ...(input.TemplateContent !== undefined && + input.TemplateContent !== null && { + TemplateContent: serializeAws_restJson1EmailTemplateContent(input.TemplateContent, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -9150,48 +9151,67 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async ( }; const serializeAws_restJson1AdditionalContactEmailAddresses = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1Body = (input: Body, context: __SerdeContext): any => { return { - ...(input.Html !== undefined && { Html: serializeAws_restJson1Content(input.Html, context) }), - ...(input.Text !== undefined && { Text: serializeAws_restJson1Content(input.Text, context) }), + ...(input.Html !== undefined && + input.Html !== null && { Html: serializeAws_restJson1Content(input.Html, context) }), + ...(input.Text !== undefined && + input.Text !== null && { Text: serializeAws_restJson1Content(input.Text, context) }), }; }; const serializeAws_restJson1BulkEmailContent = (input: BulkEmailContent, context: __SerdeContext): any => { return { - ...(input.Template !== undefined && { Template: serializeAws_restJson1Template(input.Template, context) }), + ...(input.Template !== undefined && + input.Template !== null && { Template: serializeAws_restJson1Template(input.Template, context) }), }; }; const serializeAws_restJson1BulkEmailEntry = (input: BulkEmailEntry, context: __SerdeContext): any => { return { - ...(input.Destination !== undefined && { - Destination: serializeAws_restJson1Destination(input.Destination, context), - }), - ...(input.ReplacementEmailContent !== undefined && { - ReplacementEmailContent: serializeAws_restJson1ReplacementEmailContent(input.ReplacementEmailContent, context), - }), - ...(input.ReplacementTags !== undefined && { - ReplacementTags: serializeAws_restJson1MessageTagList(input.ReplacementTags, context), - }), + ...(input.Destination !== undefined && + input.Destination !== null && { Destination: serializeAws_restJson1Destination(input.Destination, context) }), + ...(input.ReplacementEmailContent !== undefined && + input.ReplacementEmailContent !== null && { + ReplacementEmailContent: serializeAws_restJson1ReplacementEmailContent(input.ReplacementEmailContent, context), + }), + ...(input.ReplacementTags !== undefined && + input.ReplacementTags !== null && { + ReplacementTags: serializeAws_restJson1MessageTagList(input.ReplacementTags, context), + }), }; }; const serializeAws_restJson1BulkEmailEntryList = (input: BulkEmailEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1BulkEmailEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1BulkEmailEntry(entry, context); + }); }; const serializeAws_restJson1CloudWatchDestination = (input: CloudWatchDestination, context: __SerdeContext): any => { return { - ...(input.DimensionConfigurations !== undefined && { - DimensionConfigurations: serializeAws_restJson1CloudWatchDimensionConfigurations( - input.DimensionConfigurations, - context - ), - }), + ...(input.DimensionConfigurations !== undefined && + input.DimensionConfigurations !== null && { + DimensionConfigurations: serializeAws_restJson1CloudWatchDimensionConfigurations( + input.DimensionConfigurations, + context + ), + }), }; }; @@ -9200,9 +9220,11 @@ const serializeAws_restJson1CloudWatchDimensionConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.DefaultDimensionValue !== undefined && { DefaultDimensionValue: input.DefaultDimensionValue }), - ...(input.DimensionName !== undefined && { DimensionName: input.DimensionName }), - ...(input.DimensionValueSource !== undefined && { DimensionValueSource: input.DimensionValueSource }), + ...(input.DefaultDimensionValue !== undefined && + input.DefaultDimensionValue !== null && { DefaultDimensionValue: input.DefaultDimensionValue }), + ...(input.DimensionName !== undefined && input.DimensionName !== null && { DimensionName: input.DimensionName }), + ...(input.DimensionValueSource !== undefined && + input.DimensionValueSource !== null && { DimensionValueSource: input.DimensionValueSource }), }; }; @@ -9210,48 +9232,63 @@ const serializeAws_restJson1CloudWatchDimensionConfigurations = ( input: CloudWatchDimensionConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1CloudWatchDimensionConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1CloudWatchDimensionConfiguration(entry, context); + }); }; const serializeAws_restJson1ContactListDestination = (input: ContactListDestination, context: __SerdeContext): any => { return { - ...(input.ContactListImportAction !== undefined && { ContactListImportAction: input.ContactListImportAction }), - ...(input.ContactListName !== undefined && { ContactListName: input.ContactListName }), + ...(input.ContactListImportAction !== undefined && + input.ContactListImportAction !== null && { ContactListImportAction: input.ContactListImportAction }), + ...(input.ContactListName !== undefined && + input.ContactListName !== null && { ContactListName: input.ContactListName }), }; }; const serializeAws_restJson1Content = (input: Content, context: __SerdeContext): any => { return { - ...(input.Charset !== undefined && { Charset: input.Charset }), - ...(input.Data !== undefined && { Data: input.Data }), + ...(input.Charset !== undefined && input.Charset !== null && { Charset: input.Charset }), + ...(input.Data !== undefined && input.Data !== null && { Data: input.Data }), }; }; const serializeAws_restJson1DeliveryOptions = (input: DeliveryOptions, context: __SerdeContext): any => { return { - ...(input.SendingPoolName !== undefined && { SendingPoolName: input.SendingPoolName }), - ...(input.TlsPolicy !== undefined && { TlsPolicy: input.TlsPolicy }), + ...(input.SendingPoolName !== undefined && + input.SendingPoolName !== null && { SendingPoolName: input.SendingPoolName }), + ...(input.TlsPolicy !== undefined && input.TlsPolicy !== null && { TlsPolicy: input.TlsPolicy }), }; }; const serializeAws_restJson1Destination = (input: Destination, context: __SerdeContext): any => { return { - ...(input.BccAddresses !== undefined && { - BccAddresses: serializeAws_restJson1EmailAddressList(input.BccAddresses, context), - }), - ...(input.CcAddresses !== undefined && { - CcAddresses: serializeAws_restJson1EmailAddressList(input.CcAddresses, context), - }), - ...(input.ToAddresses !== undefined && { - ToAddresses: serializeAws_restJson1EmailAddressList(input.ToAddresses, context), - }), + ...(input.BccAddresses !== undefined && + input.BccAddresses !== null && { + BccAddresses: serializeAws_restJson1EmailAddressList(input.BccAddresses, context), + }), + ...(input.CcAddresses !== undefined && + input.CcAddresses !== null && { + CcAddresses: serializeAws_restJson1EmailAddressList(input.CcAddresses, context), + }), + ...(input.ToAddresses !== undefined && + input.ToAddresses !== null && { + ToAddresses: serializeAws_restJson1EmailAddressList(input.ToAddresses, context), + }), }; }; const serializeAws_restJson1DkimSigningAttributes = (input: DkimSigningAttributes, context: __SerdeContext): any => { return { - ...(input.DomainSigningPrivateKey !== undefined && { DomainSigningPrivateKey: input.DomainSigningPrivateKey }), - ...(input.DomainSigningSelector !== undefined && { DomainSigningSelector: input.DomainSigningSelector }), + ...(input.DomainSigningPrivateKey !== undefined && + input.DomainSigningPrivateKey !== null && { DomainSigningPrivateKey: input.DomainSigningPrivateKey }), + ...(input.DomainSigningSelector !== undefined && + input.DomainSigningSelector !== null && { DomainSigningSelector: input.DomainSigningSelector }), }; }; @@ -9260,16 +9297,18 @@ const serializeAws_restJson1DomainDeliverabilityTrackingOption = ( context: __SerdeContext ): any => { return { - ...(input.Domain !== undefined && { Domain: input.Domain }), - ...(input.InboxPlacementTrackingOption !== undefined && { - InboxPlacementTrackingOption: serializeAws_restJson1InboxPlacementTrackingOption( - input.InboxPlacementTrackingOption, - context - ), - }), - ...(input.SubscriptionStartDate !== undefined && { - SubscriptionStartDate: Math.round(input.SubscriptionStartDate.getTime() / 1000), - }), + ...(input.Domain !== undefined && input.Domain !== null && { Domain: input.Domain }), + ...(input.InboxPlacementTrackingOption !== undefined && + input.InboxPlacementTrackingOption !== null && { + InboxPlacementTrackingOption: serializeAws_restJson1InboxPlacementTrackingOption( + input.InboxPlacementTrackingOption, + context + ), + }), + ...(input.SubscriptionStartDate !== undefined && + input.SubscriptionStartDate !== null && { + SubscriptionStartDate: Math.round(input.SubscriptionStartDate.getTime() / 1000), + }), }; }; @@ -9277,26 +9316,42 @@ const serializeAws_restJson1DomainDeliverabilityTrackingOptions = ( input: DomainDeliverabilityTrackingOption[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context); + }); }; const serializeAws_restJson1EmailAddressList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1EmailContent = (input: EmailContent, context: __SerdeContext): any => { return { - ...(input.Raw !== undefined && { Raw: serializeAws_restJson1RawMessage(input.Raw, context) }), - ...(input.Simple !== undefined && { Simple: serializeAws_restJson1Message(input.Simple, context) }), - ...(input.Template !== undefined && { Template: serializeAws_restJson1Template(input.Template, context) }), + ...(input.Raw !== undefined && input.Raw !== null && { Raw: serializeAws_restJson1RawMessage(input.Raw, context) }), + ...(input.Simple !== undefined && + input.Simple !== null && { Simple: serializeAws_restJson1Message(input.Simple, context) }), + ...(input.Template !== undefined && + input.Template !== null && { Template: serializeAws_restJson1Template(input.Template, context) }), }; }; const serializeAws_restJson1EmailTemplateContent = (input: EmailTemplateContent, context: __SerdeContext): any => { return { - ...(input.Html !== undefined && { Html: input.Html }), - ...(input.Subject !== undefined && { Subject: input.Subject }), - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Html !== undefined && input.Html !== null && { Html: input.Html }), + ...(input.Subject !== undefined && input.Subject !== null && { Subject: input.Subject }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; @@ -9305,50 +9360,64 @@ const serializeAws_restJson1EventDestinationDefinition = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchDestination !== undefined && { - CloudWatchDestination: serializeAws_restJson1CloudWatchDestination(input.CloudWatchDestination, context), - }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.KinesisFirehoseDestination !== undefined && { - KinesisFirehoseDestination: serializeAws_restJson1KinesisFirehoseDestination( - input.KinesisFirehoseDestination, - context - ), - }), - ...(input.MatchingEventTypes !== undefined && { - MatchingEventTypes: serializeAws_restJson1EventTypes(input.MatchingEventTypes, context), - }), - ...(input.PinpointDestination !== undefined && { - PinpointDestination: serializeAws_restJson1PinpointDestination(input.PinpointDestination, context), - }), - ...(input.SnsDestination !== undefined && { - SnsDestination: serializeAws_restJson1SnsDestination(input.SnsDestination, context), - }), + ...(input.CloudWatchDestination !== undefined && + input.CloudWatchDestination !== null && { + CloudWatchDestination: serializeAws_restJson1CloudWatchDestination(input.CloudWatchDestination, context), + }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.KinesisFirehoseDestination !== undefined && + input.KinesisFirehoseDestination !== null && { + KinesisFirehoseDestination: serializeAws_restJson1KinesisFirehoseDestination( + input.KinesisFirehoseDestination, + context + ), + }), + ...(input.MatchingEventTypes !== undefined && + input.MatchingEventTypes !== null && { + MatchingEventTypes: serializeAws_restJson1EventTypes(input.MatchingEventTypes, context), + }), + ...(input.PinpointDestination !== undefined && + input.PinpointDestination !== null && { + PinpointDestination: serializeAws_restJson1PinpointDestination(input.PinpointDestination, context), + }), + ...(input.SnsDestination !== undefined && + input.SnsDestination !== null && { + SnsDestination: serializeAws_restJson1SnsDestination(input.SnsDestination, context), + }), }; }; const serializeAws_restJson1EventTypes = (input: (EventType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1ImportDataSource = (input: ImportDataSource, context: __SerdeContext): any => { return { - ...(input.DataFormat !== undefined && { DataFormat: input.DataFormat }), - ...(input.S3Url !== undefined && { S3Url: input.S3Url }), + ...(input.DataFormat !== undefined && input.DataFormat !== null && { DataFormat: input.DataFormat }), + ...(input.S3Url !== undefined && input.S3Url !== null && { S3Url: input.S3Url }), }; }; const serializeAws_restJson1ImportDestination = (input: ImportDestination, context: __SerdeContext): any => { return { - ...(input.ContactListDestination !== undefined && { - ContactListDestination: serializeAws_restJson1ContactListDestination(input.ContactListDestination, context), - }), - ...(input.SuppressionListDestination !== undefined && { - SuppressionListDestination: serializeAws_restJson1SuppressionListDestination( - input.SuppressionListDestination, - context - ), - }), + ...(input.ContactListDestination !== undefined && + input.ContactListDestination !== null && { + ContactListDestination: serializeAws_restJson1ContactListDestination(input.ContactListDestination, context), + }), + ...(input.SuppressionListDestination !== undefined && + input.SuppressionListDestination !== null && { + SuppressionListDestination: serializeAws_restJson1SuppressionListDestination( + input.SuppressionListDestination, + context + ), + }), }; }; @@ -9357,15 +9426,21 @@ const serializeAws_restJson1InboxPlacementTrackingOption = ( context: __SerdeContext ): any => { return { - ...(input.Global !== undefined && { Global: input.Global }), - ...(input.TrackedIsps !== undefined && { - TrackedIsps: serializeAws_restJson1IspNameList(input.TrackedIsps, context), - }), + ...(input.Global !== undefined && input.Global !== null && { Global: input.Global }), + ...(input.TrackedIsps !== undefined && + input.TrackedIsps !== null && { TrackedIsps: serializeAws_restJson1IspNameList(input.TrackedIsps, context) }), }; }; const serializeAws_restJson1IspNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1KinesisFirehoseDestination = ( @@ -9373,54 +9448,65 @@ const serializeAws_restJson1KinesisFirehoseDestination = ( context: __SerdeContext ): any => { return { - ...(input.DeliveryStreamArn !== undefined && { DeliveryStreamArn: input.DeliveryStreamArn }), - ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), + ...(input.DeliveryStreamArn !== undefined && + input.DeliveryStreamArn !== null && { DeliveryStreamArn: input.DeliveryStreamArn }), + ...(input.IamRoleArn !== undefined && input.IamRoleArn !== null && { IamRoleArn: input.IamRoleArn }), }; }; const serializeAws_restJson1ListContactsFilter = (input: ListContactsFilter, context: __SerdeContext): any => { return { - ...(input.FilteredStatus !== undefined && { FilteredStatus: input.FilteredStatus }), - ...(input.TopicFilter !== undefined && { - TopicFilter: serializeAws_restJson1TopicFilter(input.TopicFilter, context), - }), + ...(input.FilteredStatus !== undefined && + input.FilteredStatus !== null && { FilteredStatus: input.FilteredStatus }), + ...(input.TopicFilter !== undefined && + input.TopicFilter !== null && { TopicFilter: serializeAws_restJson1TopicFilter(input.TopicFilter, context) }), }; }; const serializeAws_restJson1ListManagementOptions = (input: ListManagementOptions, context: __SerdeContext): any => { return { - ...(input.ContactListName !== undefined && { ContactListName: input.ContactListName }), - ...(input.TopicName !== undefined && { TopicName: input.TopicName }), + ...(input.ContactListName !== undefined && + input.ContactListName !== null && { ContactListName: input.ContactListName }), + ...(input.TopicName !== undefined && input.TopicName !== null && { TopicName: input.TopicName }), }; }; const serializeAws_restJson1Message = (input: Message, context: __SerdeContext): any => { return { - ...(input.Body !== undefined && { Body: serializeAws_restJson1Body(input.Body, context) }), - ...(input.Subject !== undefined && { Subject: serializeAws_restJson1Content(input.Subject, context) }), + ...(input.Body !== undefined && input.Body !== null && { Body: serializeAws_restJson1Body(input.Body, context) }), + ...(input.Subject !== undefined && + input.Subject !== null && { Subject: serializeAws_restJson1Content(input.Subject, context) }), }; }; const serializeAws_restJson1MessageTag = (input: MessageTag, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1MessageTagList = (input: MessageTag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1MessageTag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1MessageTag(entry, context); + }); }; const serializeAws_restJson1PinpointDestination = (input: PinpointDestination, context: __SerdeContext): any => { return { - ...(input.ApplicationArn !== undefined && { ApplicationArn: input.ApplicationArn }), + ...(input.ApplicationArn !== undefined && + input.ApplicationArn !== null && { ApplicationArn: input.ApplicationArn }), }; }; const serializeAws_restJson1RawMessage = (input: RawMessage, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }), + ...(input.Data !== undefined && input.Data !== null && { Data: context.base64Encoder(input.Data) }), }; }; @@ -9429,34 +9515,39 @@ const serializeAws_restJson1ReplacementEmailContent = ( context: __SerdeContext ): any => { return { - ...(input.ReplacementTemplate !== undefined && { - ReplacementTemplate: serializeAws_restJson1ReplacementTemplate(input.ReplacementTemplate, context), - }), + ...(input.ReplacementTemplate !== undefined && + input.ReplacementTemplate !== null && { + ReplacementTemplate: serializeAws_restJson1ReplacementTemplate(input.ReplacementTemplate, context), + }), }; }; const serializeAws_restJson1ReplacementTemplate = (input: ReplacementTemplate, context: __SerdeContext): any => { return { - ...(input.ReplacementTemplateData !== undefined && { ReplacementTemplateData: input.ReplacementTemplateData }), + ...(input.ReplacementTemplateData !== undefined && + input.ReplacementTemplateData !== null && { ReplacementTemplateData: input.ReplacementTemplateData }), }; }; const serializeAws_restJson1ReputationOptions = (input: ReputationOptions, context: __SerdeContext): any => { return { - ...(input.LastFreshStart !== undefined && { LastFreshStart: Math.round(input.LastFreshStart.getTime() / 1000) }), - ...(input.ReputationMetricsEnabled !== undefined && { ReputationMetricsEnabled: input.ReputationMetricsEnabled }), + ...(input.LastFreshStart !== undefined && + input.LastFreshStart !== null && { LastFreshStart: Math.round(input.LastFreshStart.getTime() / 1000) }), + ...(input.ReputationMetricsEnabled !== undefined && + input.ReputationMetricsEnabled !== null && { ReputationMetricsEnabled: input.ReputationMetricsEnabled }), }; }; const serializeAws_restJson1SendingOptions = (input: SendingOptions, context: __SerdeContext): any => { return { - ...(input.SendingEnabled !== undefined && { SendingEnabled: input.SendingEnabled }), + ...(input.SendingEnabled !== undefined && + input.SendingEnabled !== null && { SendingEnabled: input.SendingEnabled }), }; }; const serializeAws_restJson1SnsDestination = (input: SnsDestination, context: __SerdeContext): any => { return { - ...(input.TopicArn !== undefined && { TopicArn: input.TopicArn }), + ...(input.TopicArn !== undefined && input.TopicArn !== null && { TopicArn: input.TopicArn }), }; }; @@ -9465,9 +9556,8 @@ const serializeAws_restJson1SuppressionListDestination = ( context: __SerdeContext ): any => { return { - ...(input.SuppressionListImportAction !== undefined && { - SuppressionListImportAction: input.SuppressionListImportAction, - }), + ...(input.SuppressionListImportAction !== undefined && + input.SuppressionListImportAction !== null && { SuppressionListImportAction: input.SuppressionListImportAction }), }; }; @@ -9475,74 +9565,105 @@ const serializeAws_restJson1SuppressionListReasons = ( input: (SuppressionListReason | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SuppressionOptions = (input: SuppressionOptions, context: __SerdeContext): any => { return { - ...(input.SuppressedReasons !== undefined && { - SuppressedReasons: serializeAws_restJson1SuppressionListReasons(input.SuppressedReasons, context), - }), + ...(input.SuppressedReasons !== undefined && + input.SuppressedReasons !== null && { + SuppressedReasons: serializeAws_restJson1SuppressionListReasons(input.SuppressedReasons, context), + }), }; }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1Template = (input: Template, context: __SerdeContext): any => { return { - ...(input.TemplateArn !== undefined && { TemplateArn: input.TemplateArn }), - ...(input.TemplateData !== undefined && { TemplateData: input.TemplateData }), - ...(input.TemplateName !== undefined && { TemplateName: input.TemplateName }), + ...(input.TemplateArn !== undefined && input.TemplateArn !== null && { TemplateArn: input.TemplateArn }), + ...(input.TemplateData !== undefined && input.TemplateData !== null && { TemplateData: input.TemplateData }), + ...(input.TemplateName !== undefined && input.TemplateName !== null && { TemplateName: input.TemplateName }), }; }; const serializeAws_restJson1Topic = (input: Topic, context: __SerdeContext): any => { return { - ...(input.DefaultSubscriptionStatus !== undefined && { - DefaultSubscriptionStatus: input.DefaultSubscriptionStatus, - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.TopicName !== undefined && { TopicName: input.TopicName }), + ...(input.DefaultSubscriptionStatus !== undefined && + input.DefaultSubscriptionStatus !== null && { DefaultSubscriptionStatus: input.DefaultSubscriptionStatus }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.TopicName !== undefined && input.TopicName !== null && { TopicName: input.TopicName }), }; }; const serializeAws_restJson1TopicFilter = (input: TopicFilter, context: __SerdeContext): any => { return { - ...(input.TopicName !== undefined && { TopicName: input.TopicName }), - ...(input.UseDefaultIfPreferenceUnavailable !== undefined && { - UseDefaultIfPreferenceUnavailable: input.UseDefaultIfPreferenceUnavailable, - }), + ...(input.TopicName !== undefined && input.TopicName !== null && { TopicName: input.TopicName }), + ...(input.UseDefaultIfPreferenceUnavailable !== undefined && + input.UseDefaultIfPreferenceUnavailable !== null && { + UseDefaultIfPreferenceUnavailable: input.UseDefaultIfPreferenceUnavailable, + }), }; }; const serializeAws_restJson1TopicPreference = (input: TopicPreference, context: __SerdeContext): any => { return { - ...(input.SubscriptionStatus !== undefined && { SubscriptionStatus: input.SubscriptionStatus }), - ...(input.TopicName !== undefined && { TopicName: input.TopicName }), + ...(input.SubscriptionStatus !== undefined && + input.SubscriptionStatus !== null && { SubscriptionStatus: input.SubscriptionStatus }), + ...(input.TopicName !== undefined && input.TopicName !== null && { TopicName: input.TopicName }), }; }; const serializeAws_restJson1TopicPreferenceList = (input: TopicPreference[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1TopicPreference(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TopicPreference(entry, context); + }); }; const serializeAws_restJson1Topics = (input: Topic[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Topic(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Topic(entry, context); + }); }; const serializeAws_restJson1TrackingOptions = (input: TrackingOptions, context: __SerdeContext): any => { return { - ...(input.CustomRedirectDomain !== undefined && { CustomRedirectDomain: input.CustomRedirectDomain }), + ...(input.CustomRedirectDomain !== undefined && + input.CustomRedirectDomain !== null && { CustomRedirectDomain: input.CustomRedirectDomain }), }; }; @@ -9568,11 +9689,25 @@ const deserializeAws_restJson1AccountDetails = (output: any, context: __SerdeCon }; const deserializeAws_restJson1AdditionalContactEmailAddresses = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1BlacklistEntries = (output: any, context: __SerdeContext): BlacklistEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BlacklistEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BlacklistEntry(entry, context); + }); }; const deserializeAws_restJson1BlacklistEntry = (output: any, context: __SerdeContext): BlacklistEntry => { @@ -9590,13 +9725,15 @@ const deserializeAws_restJson1BlacklistReport = ( output: any, context: __SerdeContext ): { [key: string]: BlacklistEntry[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: BlacklistEntry[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: BlacklistEntry[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1BlacklistEntries(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1BulkEmailEntryResult = (output: any, context: __SerdeContext): BulkEmailEntryResult => { @@ -9611,7 +9748,14 @@ const deserializeAws_restJson1BulkEmailEntryResultList = ( output: any, context: __SerdeContext ): BulkEmailEntryResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1BulkEmailEntryResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1BulkEmailEntryResult(entry, context); + }); }; const deserializeAws_restJson1CloudWatchDestination = (output: any, context: __SerdeContext): CloudWatchDestination => { @@ -9645,11 +9789,25 @@ const deserializeAws_restJson1CloudWatchDimensionConfigurations = ( output: any, context: __SerdeContext ): CloudWatchDimensionConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CloudWatchDimensionConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CloudWatchDimensionConfiguration(entry, context); + }); }; const deserializeAws_restJson1ConfigurationSetNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Contact = (output: any, context: __SerdeContext): Contact => { @@ -9722,9 +9880,14 @@ const deserializeAws_restJson1CustomVerificationEmailTemplatesList = ( output: any, context: __SerdeContext ): CustomVerificationEmailTemplateMetadata[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1CustomVerificationEmailTemplateMetadata(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CustomVerificationEmailTemplateMetadata(entry, context); + }); }; const deserializeAws_restJson1DailyVolume = (output: any, context: __SerdeContext): DailyVolume => { @@ -9745,7 +9908,14 @@ const deserializeAws_restJson1DailyVolume = (output: any, context: __SerdeContex }; const deserializeAws_restJson1DailyVolumes = (output: any, context: __SerdeContext): DailyVolume[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DailyVolume(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DailyVolume(entry, context); + }); }; const deserializeAws_restJson1DedicatedIp = (output: any, context: __SerdeContext): DedicatedIp => { @@ -9759,7 +9929,14 @@ const deserializeAws_restJson1DedicatedIp = (output: any, context: __SerdeContex }; const deserializeAws_restJson1DedicatedIpList = (output: any, context: __SerdeContext): DedicatedIp[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DedicatedIp(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DedicatedIp(entry, context); + }); }; const deserializeAws_restJson1DeliverabilityTestReport = ( @@ -9787,7 +9964,14 @@ const deserializeAws_restJson1DeliverabilityTestReports = ( output: any, context: __SerdeContext ): DeliverabilityTestReport[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeliverabilityTestReport(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeliverabilityTestReport(entry, context); + }); }; const deserializeAws_restJson1DeliveryOptions = (output: any, context: __SerdeContext): DeliveryOptions => { @@ -9815,7 +9999,14 @@ const deserializeAws_restJson1DkimAttributes = (output: any, context: __SerdeCon }; const deserializeAws_restJson1DnsTokenList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1DomainDeliverabilityCampaign = ( @@ -9858,7 +10049,14 @@ const deserializeAws_restJson1DomainDeliverabilityCampaignList = ( output: any, context: __SerdeContext ): DomainDeliverabilityCampaign[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainDeliverabilityCampaign(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainDeliverabilityCampaign(entry, context); + }); }; const deserializeAws_restJson1DomainDeliverabilityTrackingOption = ( @@ -9882,7 +10080,14 @@ const deserializeAws_restJson1DomainDeliverabilityTrackingOptions = ( output: any, context: __SerdeContext ): DomainDeliverabilityTrackingOption[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context); + }); }; const deserializeAws_restJson1DomainIspPlacement = (output: any, context: __SerdeContext): DomainIspPlacement => { @@ -9899,7 +10104,14 @@ const deserializeAws_restJson1DomainIspPlacement = (output: any, context: __Serd }; const deserializeAws_restJson1DomainIspPlacements = (output: any, context: __SerdeContext): DomainIspPlacement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainIspPlacement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainIspPlacement(entry, context); + }); }; const deserializeAws_restJson1EmailTemplateContent = (output: any, context: __SerdeContext): EmailTemplateContent => { @@ -9924,11 +10136,25 @@ const deserializeAws_restJson1EmailTemplateMetadataList = ( output: any, context: __SerdeContext ): EmailTemplateMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EmailTemplateMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EmailTemplateMetadata(entry, context); + }); }; const deserializeAws_restJson1Esps = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1EventDestination = (output: any, context: __SerdeContext): EventDestination => { @@ -9959,11 +10185,25 @@ const deserializeAws_restJson1EventDestination = (output: any, context: __SerdeC }; const deserializeAws_restJson1EventDestinations = (output: any, context: __SerdeContext): EventDestination[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1EventDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1EventDestination(entry, context); + }); }; const deserializeAws_restJson1EventTypes = (output: any, context: __SerdeContext): (EventType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1FailureInfo = (output: any, context: __SerdeContext): FailureInfo => { @@ -9986,7 +10226,14 @@ const deserializeAws_restJson1IdentityInfo = (output: any, context: __SerdeConte }; const deserializeAws_restJson1IdentityInfoList = (output: any, context: __SerdeContext): IdentityInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IdentityInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IdentityInfo(entry, context); + }); }; const deserializeAws_restJson1ImportDataSource = (output: any, context: __SerdeContext): ImportDataSource => { @@ -10025,7 +10272,14 @@ const deserializeAws_restJson1ImportJobSummary = (output: any, context: __SerdeC }; const deserializeAws_restJson1ImportJobSummaryList = (output: any, context: __SerdeContext): ImportJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ImportJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ImportJobSummary(entry, context); + }); }; const deserializeAws_restJson1InboxPlacementTrackingOption = ( @@ -10042,11 +10296,25 @@ const deserializeAws_restJson1InboxPlacementTrackingOption = ( }; const deserializeAws_restJson1IpList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1IspNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1IspPlacement = (output: any, context: __SerdeContext): IspPlacement => { @@ -10060,7 +10328,14 @@ const deserializeAws_restJson1IspPlacement = (output: any, context: __SerdeConte }; const deserializeAws_restJson1IspPlacements = (output: any, context: __SerdeContext): IspPlacement[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1IspPlacement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1IspPlacement(entry, context); + }); }; const deserializeAws_restJson1KinesisFirehoseDestination = ( @@ -10077,15 +10352,36 @@ const deserializeAws_restJson1KinesisFirehoseDestination = ( }; const deserializeAws_restJson1ListOfContactLists = (output: any, context: __SerdeContext): ContactList[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ContactList(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ContactList(entry, context); + }); }; const deserializeAws_restJson1ListOfContacts = (output: any, context: __SerdeContext): Contact[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Contact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Contact(entry, context); + }); }; const deserializeAws_restJson1ListOfDedicatedIpPools = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1MailFromAttributes = (output: any, context: __SerdeContext): MailFromAttributes => { @@ -10143,13 +10439,15 @@ const deserializeAws_restJson1PlacementStatistics = (output: any, context: __Ser }; const deserializeAws_restJson1PolicyMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1ReputationOptions = (output: any, context: __SerdeContext): ReputationOptions => { @@ -10224,7 +10522,14 @@ const deserializeAws_restJson1SuppressedDestinationSummaries = ( output: any, context: __SerdeContext ): SuppressedDestinationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SuppressedDestinationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SuppressedDestinationSummary(entry, context); + }); }; const deserializeAws_restJson1SuppressedDestinationSummary = ( @@ -10266,7 +10571,14 @@ const deserializeAws_restJson1SuppressionListReasons = ( output: any, context: __SerdeContext ): (SuppressionListReason | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SuppressionOptions = (output: any, context: __SerdeContext): SuppressionOptions => { @@ -10286,7 +10598,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1Topic = (output: any, context: __SerdeContext): Topic => { @@ -10312,11 +10631,25 @@ const deserializeAws_restJson1TopicPreference = (output: any, context: __SerdeCo }; const deserializeAws_restJson1TopicPreferenceList = (output: any, context: __SerdeContext): TopicPreference[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TopicPreference(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TopicPreference(entry, context); + }); }; const deserializeAws_restJson1Topics = (output: any, context: __SerdeContext): Topic[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Topic(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Topic(entry, context); + }); }; const deserializeAws_restJson1TrackingOptions = (output: any, context: __SerdeContext): TrackingOptions => { @@ -10360,6 +10693,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-sfn/protocols/Aws_json1_0.ts b/clients/client-sfn/protocols/Aws_json1_0.ts index 7e62bbf29437..0296fcd00df8 100644 --- a/clients/client-sfn/protocols/Aws_json1_0.ts +++ b/clients/client-sfn/protocols/Aws_json1_0.ts @@ -165,7 +165,7 @@ export const serializeAws_json1_0CreateActivityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.CreateActivity", }; let body: any; @@ -178,7 +178,7 @@ export const serializeAws_json1_0CreateStateMachineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.CreateStateMachine", }; let body: any; @@ -191,7 +191,7 @@ export const serializeAws_json1_0DeleteActivityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.DeleteActivity", }; let body: any; @@ -204,7 +204,7 @@ export const serializeAws_json1_0DeleteStateMachineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.DeleteStateMachine", }; let body: any; @@ -217,7 +217,7 @@ export const serializeAws_json1_0DescribeActivityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.DescribeActivity", }; let body: any; @@ -230,7 +230,7 @@ export const serializeAws_json1_0DescribeExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.DescribeExecution", }; let body: any; @@ -243,7 +243,7 @@ export const serializeAws_json1_0DescribeStateMachineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.DescribeStateMachine", }; let body: any; @@ -256,7 +256,7 @@ export const serializeAws_json1_0DescribeStateMachineForExecutionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.DescribeStateMachineForExecution", }; let body: any; @@ -269,7 +269,7 @@ export const serializeAws_json1_0GetActivityTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.GetActivityTask", }; let body: any; @@ -282,7 +282,7 @@ export const serializeAws_json1_0GetExecutionHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.GetExecutionHistory", }; let body: any; @@ -295,7 +295,7 @@ export const serializeAws_json1_0ListActivitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.ListActivities", }; let body: any; @@ -308,7 +308,7 @@ export const serializeAws_json1_0ListExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.ListExecutions", }; let body: any; @@ -321,7 +321,7 @@ export const serializeAws_json1_0ListStateMachinesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.ListStateMachines", }; let body: any; @@ -334,7 +334,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.ListTagsForResource", }; let body: any; @@ -347,7 +347,7 @@ export const serializeAws_json1_0SendTaskFailureCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.SendTaskFailure", }; let body: any; @@ -360,7 +360,7 @@ export const serializeAws_json1_0SendTaskHeartbeatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.SendTaskHeartbeat", }; let body: any; @@ -373,7 +373,7 @@ export const serializeAws_json1_0SendTaskSuccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.SendTaskSuccess", }; let body: any; @@ -386,7 +386,7 @@ export const serializeAws_json1_0StartExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.StartExecution", }; let body: any; @@ -399,7 +399,7 @@ export const serializeAws_json1_0StartSyncExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.StartSyncExecution", }; let body: any; @@ -419,7 +419,7 @@ export const serializeAws_json1_0StopExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.StopExecution", }; let body: any; @@ -432,7 +432,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.TagResource", }; let body: any; @@ -445,7 +445,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.UntagResource", }; let body: any; @@ -458,7 +458,7 @@ export const serializeAws_json1_0UpdateStateMachineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "AWSStepFunctions.UpdateStateMachine", }; let body: any; @@ -493,8 +493,7 @@ const deserializeAws_json1_0CreateActivityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActivityLimitExceeded": case "com.amazonaws.sfn#ActivityLimitExceeded": @@ -564,8 +563,7 @@ const deserializeAws_json1_0CreateStateMachineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -691,8 +689,7 @@ const deserializeAws_json1_0DeleteActivityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -746,8 +743,7 @@ const deserializeAws_json1_0DeleteStateMachineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -801,8 +797,7 @@ const deserializeAws_json1_0DescribeActivityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActivityDoesNotExist": case "com.amazonaws.sfn#ActivityDoesNotExist": @@ -864,8 +859,7 @@ const deserializeAws_json1_0DescribeExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExecutionDoesNotExist": case "com.amazonaws.sfn#ExecutionDoesNotExist": @@ -927,8 +921,7 @@ const deserializeAws_json1_0DescribeStateMachineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -990,8 +983,7 @@ const deserializeAws_json1_0DescribeStateMachineForExecutionCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExecutionDoesNotExist": case "com.amazonaws.sfn#ExecutionDoesNotExist": @@ -1053,8 +1045,7 @@ const deserializeAws_json1_0GetActivityTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ActivityDoesNotExist": case "com.amazonaws.sfn#ActivityDoesNotExist": @@ -1124,8 +1115,7 @@ const deserializeAws_json1_0GetExecutionHistoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExecutionDoesNotExist": case "com.amazonaws.sfn#ExecutionDoesNotExist": @@ -1195,8 +1185,7 @@ const deserializeAws_json1_0ListActivitiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidToken": case "com.amazonaws.sfn#InvalidToken": @@ -1250,8 +1239,7 @@ const deserializeAws_json1_0ListExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -1329,8 +1317,7 @@ const deserializeAws_json1_0ListStateMachinesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidToken": case "com.amazonaws.sfn#InvalidToken": @@ -1384,8 +1371,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -1447,8 +1433,7 @@ const deserializeAws_json1_0SendTaskFailureCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidToken": case "com.amazonaws.sfn#InvalidToken": @@ -1518,8 +1503,7 @@ const deserializeAws_json1_0SendTaskHeartbeatCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidToken": case "com.amazonaws.sfn#InvalidToken": @@ -1589,8 +1573,7 @@ const deserializeAws_json1_0SendTaskSuccessCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidOutput": case "com.amazonaws.sfn#InvalidOutput": @@ -1668,8 +1651,7 @@ const deserializeAws_json1_0StartExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExecutionAlreadyExists": case "com.amazonaws.sfn#ExecutionAlreadyExists": @@ -1771,8 +1753,7 @@ const deserializeAws_json1_0StartSyncExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -1866,8 +1847,7 @@ const deserializeAws_json1_0StopExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExecutionDoesNotExist": case "com.amazonaws.sfn#ExecutionDoesNotExist": @@ -1929,8 +1909,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -2000,8 +1979,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -2063,8 +2041,7 @@ const deserializeAws_json1_0UpdateStateMachineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": @@ -2501,54 +2478,57 @@ const deserializeAws_json1_0TooManyTagsResponse = async ( const serializeAws_json1_0CloudWatchLogsLogGroup = (input: CloudWatchLogsLogGroup, context: __SerdeContext): any => { return { - ...(input.logGroupArn !== undefined && { logGroupArn: input.logGroupArn }), + ...(input.logGroupArn !== undefined && input.logGroupArn !== null && { logGroupArn: input.logGroupArn }), }; }; const serializeAws_json1_0CreateActivityInput = (input: CreateActivityInput, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_0TagList(input.tags, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_0TagList(input.tags, context) }), }; }; const serializeAws_json1_0CreateStateMachineInput = (input: CreateStateMachineInput, context: __SerdeContext): any => { return { - ...(input.definition !== undefined && { definition: input.definition }), - ...(input.loggingConfiguration !== undefined && { - loggingConfiguration: serializeAws_json1_0LoggingConfiguration(input.loggingConfiguration, context), - }), - ...(input.name !== undefined && { name: input.name }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_0TagList(input.tags, context) }), - ...(input.tracingConfiguration !== undefined && { - tracingConfiguration: serializeAws_json1_0TracingConfiguration(input.tracingConfiguration, context), - }), - ...(input.type !== undefined && { type: input.type }), + ...(input.definition !== undefined && input.definition !== null && { definition: input.definition }), + ...(input.loggingConfiguration !== undefined && + input.loggingConfiguration !== null && { + loggingConfiguration: serializeAws_json1_0LoggingConfiguration(input.loggingConfiguration, context), + }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_0TagList(input.tags, context) }), + ...(input.tracingConfiguration !== undefined && + input.tracingConfiguration !== null && { + tracingConfiguration: serializeAws_json1_0TracingConfiguration(input.tracingConfiguration, context), + }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), }; }; const serializeAws_json1_0DeleteActivityInput = (input: DeleteActivityInput, context: __SerdeContext): any => { return { - ...(input.activityArn !== undefined && { activityArn: input.activityArn }), + ...(input.activityArn !== undefined && input.activityArn !== null && { activityArn: input.activityArn }), }; }; const serializeAws_json1_0DeleteStateMachineInput = (input: DeleteStateMachineInput, context: __SerdeContext): any => { return { - ...(input.stateMachineArn !== undefined && { stateMachineArn: input.stateMachineArn }), + ...(input.stateMachineArn !== undefined && + input.stateMachineArn !== null && { stateMachineArn: input.stateMachineArn }), }; }; const serializeAws_json1_0DescribeActivityInput = (input: DescribeActivityInput, context: __SerdeContext): any => { return { - ...(input.activityArn !== undefined && { activityArn: input.activityArn }), + ...(input.activityArn !== undefined && input.activityArn !== null && { activityArn: input.activityArn }), }; }; const serializeAws_json1_0DescribeExecutionInput = (input: DescribeExecutionInput, context: __SerdeContext): any => { return { - ...(input.executionArn !== undefined && { executionArn: input.executionArn }), + ...(input.executionArn !== undefined && input.executionArn !== null && { executionArn: input.executionArn }), }; }; @@ -2557,7 +2537,7 @@ const serializeAws_json1_0DescribeStateMachineForExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.executionArn !== undefined && { executionArn: input.executionArn }), + ...(input.executionArn !== undefined && input.executionArn !== null && { executionArn: input.executionArn }), }; }; @@ -2566,14 +2546,15 @@ const serializeAws_json1_0DescribeStateMachineInput = ( context: __SerdeContext ): any => { return { - ...(input.stateMachineArn !== undefined && { stateMachineArn: input.stateMachineArn }), + ...(input.stateMachineArn !== undefined && + input.stateMachineArn !== null && { stateMachineArn: input.stateMachineArn }), }; }; const serializeAws_json1_0GetActivityTaskInput = (input: GetActivityTaskInput, context: __SerdeContext): any => { return { - ...(input.activityArn !== undefined && { activityArn: input.activityArn }), - ...(input.workerName !== undefined && { workerName: input.workerName }), + ...(input.activityArn !== undefined && input.activityArn !== null && { activityArn: input.activityArn }), + ...(input.workerName !== undefined && input.workerName !== null && { workerName: input.workerName }), }; }; @@ -2582,34 +2563,36 @@ const serializeAws_json1_0GetExecutionHistoryInput = ( context: __SerdeContext ): any => { return { - ...(input.executionArn !== undefined && { executionArn: input.executionArn }), - ...(input.includeExecutionData !== undefined && { includeExecutionData: input.includeExecutionData }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.reverseOrder !== undefined && { reverseOrder: input.reverseOrder }), + ...(input.executionArn !== undefined && input.executionArn !== null && { executionArn: input.executionArn }), + ...(input.includeExecutionData !== undefined && + input.includeExecutionData !== null && { includeExecutionData: input.includeExecutionData }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.reverseOrder !== undefined && input.reverseOrder !== null && { reverseOrder: input.reverseOrder }), }; }; const serializeAws_json1_0ListActivitiesInput = (input: ListActivitiesInput, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_0ListExecutionsInput = (input: ListExecutionsInput, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.stateMachineArn !== undefined && { stateMachineArn: input.stateMachineArn }), - ...(input.statusFilter !== undefined && { statusFilter: input.statusFilter }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.stateMachineArn !== undefined && + input.stateMachineArn !== null && { stateMachineArn: input.stateMachineArn }), + ...(input.statusFilter !== undefined && input.statusFilter !== null && { statusFilter: input.statusFilter }), }; }; const serializeAws_json1_0ListStateMachinesInput = (input: ListStateMachinesInput, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -2618,125 +2601,155 @@ const serializeAws_json1_0ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_0LogDestination = (input: LogDestination, context: __SerdeContext): any => { return { - ...(input.cloudWatchLogsLogGroup !== undefined && { - cloudWatchLogsLogGroup: serializeAws_json1_0CloudWatchLogsLogGroup(input.cloudWatchLogsLogGroup, context), - }), + ...(input.cloudWatchLogsLogGroup !== undefined && + input.cloudWatchLogsLogGroup !== null && { + cloudWatchLogsLogGroup: serializeAws_json1_0CloudWatchLogsLogGroup(input.cloudWatchLogsLogGroup, context), + }), }; }; const serializeAws_json1_0LogDestinationList = (input: LogDestination[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0LogDestination(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0LogDestination(entry, context); + }); }; const serializeAws_json1_0LoggingConfiguration = (input: LoggingConfiguration, context: __SerdeContext): any => { return { - ...(input.destinations !== undefined && { - destinations: serializeAws_json1_0LogDestinationList(input.destinations, context), - }), - ...(input.includeExecutionData !== undefined && { includeExecutionData: input.includeExecutionData }), - ...(input.level !== undefined && { level: input.level }), + ...(input.destinations !== undefined && + input.destinations !== null && { + destinations: serializeAws_json1_0LogDestinationList(input.destinations, context), + }), + ...(input.includeExecutionData !== undefined && + input.includeExecutionData !== null && { includeExecutionData: input.includeExecutionData }), + ...(input.level !== undefined && input.level !== null && { level: input.level }), }; }; const serializeAws_json1_0SendTaskFailureInput = (input: SendTaskFailureInput, context: __SerdeContext): any => { return { - ...(input.cause !== undefined && { cause: input.cause }), - ...(input.error !== undefined && { error: input.error }), - ...(input.taskToken !== undefined && { taskToken: input.taskToken }), + ...(input.cause !== undefined && input.cause !== null && { cause: input.cause }), + ...(input.error !== undefined && input.error !== null && { error: input.error }), + ...(input.taskToken !== undefined && input.taskToken !== null && { taskToken: input.taskToken }), }; }; const serializeAws_json1_0SendTaskHeartbeatInput = (input: SendTaskHeartbeatInput, context: __SerdeContext): any => { return { - ...(input.taskToken !== undefined && { taskToken: input.taskToken }), + ...(input.taskToken !== undefined && input.taskToken !== null && { taskToken: input.taskToken }), }; }; const serializeAws_json1_0SendTaskSuccessInput = (input: SendTaskSuccessInput, context: __SerdeContext): any => { return { - ...(input.output !== undefined && { output: input.output }), - ...(input.taskToken !== undefined && { taskToken: input.taskToken }), + ...(input.output !== undefined && input.output !== null && { output: input.output }), + ...(input.taskToken !== undefined && input.taskToken !== null && { taskToken: input.taskToken }), }; }; const serializeAws_json1_0StartExecutionInput = (input: StartExecutionInput, context: __SerdeContext): any => { return { - ...(input.input !== undefined && { input: input.input }), - ...(input.name !== undefined && { name: input.name }), - ...(input.stateMachineArn !== undefined && { stateMachineArn: input.stateMachineArn }), - ...(input.traceHeader !== undefined && { traceHeader: input.traceHeader }), + ...(input.input !== undefined && input.input !== null && { input: input.input }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.stateMachineArn !== undefined && + input.stateMachineArn !== null && { stateMachineArn: input.stateMachineArn }), + ...(input.traceHeader !== undefined && input.traceHeader !== null && { traceHeader: input.traceHeader }), }; }; const serializeAws_json1_0StartSyncExecutionInput = (input: StartSyncExecutionInput, context: __SerdeContext): any => { return { - ...(input.input !== undefined && { input: input.input }), - ...(input.name !== undefined && { name: input.name }), - ...(input.stateMachineArn !== undefined && { stateMachineArn: input.stateMachineArn }), - ...(input.traceHeader !== undefined && { traceHeader: input.traceHeader }), + ...(input.input !== undefined && input.input !== null && { input: input.input }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.stateMachineArn !== undefined && + input.stateMachineArn !== null && { stateMachineArn: input.stateMachineArn }), + ...(input.traceHeader !== undefined && input.traceHeader !== null && { traceHeader: input.traceHeader }), }; }; const serializeAws_json1_0StopExecutionInput = (input: StopExecutionInput, context: __SerdeContext): any => { return { - ...(input.cause !== undefined && { cause: input.cause }), - ...(input.error !== undefined && { error: input.error }), - ...(input.executionArn !== undefined && { executionArn: input.executionArn }), + ...(input.cause !== undefined && input.cause !== null && { cause: input.cause }), + ...(input.error !== undefined && input.error !== null && { error: input.error }), + ...(input.executionArn !== undefined && input.executionArn !== null && { executionArn: input.executionArn }), }; }; const serializeAws_json1_0Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_0TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Tag(entry, context); + }); }; const serializeAws_json1_0TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_0TagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_0TagList(input.tags, context) }), }; }; const serializeAws_json1_0TracingConfiguration = (input: TracingConfiguration, context: __SerdeContext): any => { return { - ...(input.enabled !== undefined && { enabled: input.enabled }), + ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }), }; }; const serializeAws_json1_0UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_0TagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_0TagKeyList(input.tagKeys, context) }), }; }; const serializeAws_json1_0UpdateStateMachineInput = (input: UpdateStateMachineInput, context: __SerdeContext): any => { return { - ...(input.definition !== undefined && { definition: input.definition }), - ...(input.loggingConfiguration !== undefined && { - loggingConfiguration: serializeAws_json1_0LoggingConfiguration(input.loggingConfiguration, context), - }), - ...(input.roleArn !== undefined && { roleArn: input.roleArn }), - ...(input.stateMachineArn !== undefined && { stateMachineArn: input.stateMachineArn }), - ...(input.tracingConfiguration !== undefined && { - tracingConfiguration: serializeAws_json1_0TracingConfiguration(input.tracingConfiguration, context), - }), + ...(input.definition !== undefined && input.definition !== null && { definition: input.definition }), + ...(input.loggingConfiguration !== undefined && + input.loggingConfiguration !== null && { + loggingConfiguration: serializeAws_json1_0LoggingConfiguration(input.loggingConfiguration, context), + }), + ...(input.roleArn !== undefined && input.roleArn !== null && { roleArn: input.roleArn }), + ...(input.stateMachineArn !== undefined && + input.stateMachineArn !== null && { stateMachineArn: input.stateMachineArn }), + ...(input.tracingConfiguration !== undefined && + input.tracingConfiguration !== null && { + tracingConfiguration: serializeAws_json1_0TracingConfiguration(input.tracingConfiguration, context), + }), }; }; @@ -2763,7 +2776,14 @@ const deserializeAws_json1_0ActivityLimitExceeded = (output: any, context: __Ser }; const deserializeAws_json1_0ActivityList = (output: any, context: __SerdeContext): ActivityListItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ActivityListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ActivityListItem(entry, context); + }); }; const deserializeAws_json1_0ActivityListItem = (output: any, context: __SerdeContext): ActivityListItem => { @@ -3045,7 +3065,14 @@ const deserializeAws_json1_0ExecutionLimitExceeded = (output: any, context: __Se }; const deserializeAws_json1_0ExecutionList = (output: any, context: __SerdeContext): ExecutionListItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ExecutionListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ExecutionListItem(entry, context); + }); }; const deserializeAws_json1_0ExecutionListItem = (output: any, context: __SerdeContext): ExecutionListItem => { @@ -3282,7 +3309,14 @@ const deserializeAws_json1_0HistoryEventExecutionDataDetails = ( }; const deserializeAws_json1_0HistoryEventList = (output: any, context: __SerdeContext): HistoryEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0HistoryEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0HistoryEvent(entry, context); + }); }; const deserializeAws_json1_0InvalidArn = (output: any, context: __SerdeContext): InvalidArn => { @@ -3463,7 +3497,14 @@ const deserializeAws_json1_0LogDestination = (output: any, context: __SerdeConte }; const deserializeAws_json1_0LogDestinationList = (output: any, context: __SerdeContext): LogDestination[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0LogDestination(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0LogDestination(entry, context); + }); }; const deserializeAws_json1_0LoggingConfiguration = (output: any, context: __SerdeContext): LoggingConfiguration => { @@ -3640,7 +3681,14 @@ const deserializeAws_json1_0StateMachineLimitExceeded = ( }; const deserializeAws_json1_0StateMachineList = (output: any, context: __SerdeContext): StateMachineListItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0StateMachineListItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0StateMachineListItem(entry, context); + }); }; const deserializeAws_json1_0StateMachineListItem = (output: any, context: __SerdeContext): StateMachineListItem => { @@ -3682,7 +3730,14 @@ const deserializeAws_json1_0Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_0TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Tag(entry, context); + }); }; const deserializeAws_json1_0TagResourceOutput = (output: any, context: __SerdeContext): TagResourceOutput => { @@ -3883,3 +3938,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-shield/protocols/Aws_json1_1.ts b/clients/client-shield/protocols/Aws_json1_1.ts index e46b4d5b7462..83e044084fef 100644 --- a/clients/client-shield/protocols/Aws_json1_1.ts +++ b/clients/client-shield/protocols/Aws_json1_1.ts @@ -199,7 +199,7 @@ export const serializeAws_json1_1AssociateDRTLogBucketCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.AssociateDRTLogBucket", }; let body: any; @@ -212,7 +212,7 @@ export const serializeAws_json1_1AssociateDRTRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.AssociateDRTRole", }; let body: any; @@ -225,7 +225,7 @@ export const serializeAws_json1_1AssociateHealthCheckCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.AssociateHealthCheck", }; let body: any; @@ -238,7 +238,7 @@ export const serializeAws_json1_1AssociateProactiveEngagementDetailsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.AssociateProactiveEngagementDetails", }; let body: any; @@ -251,7 +251,7 @@ export const serializeAws_json1_1CreateProtectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.CreateProtection", }; let body: any; @@ -264,7 +264,7 @@ export const serializeAws_json1_1CreateProtectionGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.CreateProtectionGroup", }; let body: any; @@ -277,7 +277,7 @@ export const serializeAws_json1_1CreateSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.CreateSubscription", }; let body: any; @@ -290,7 +290,7 @@ export const serializeAws_json1_1DeleteProtectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DeleteProtection", }; let body: any; @@ -303,7 +303,7 @@ export const serializeAws_json1_1DeleteProtectionGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DeleteProtectionGroup", }; let body: any; @@ -316,7 +316,7 @@ export const serializeAws_json1_1DeleteSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DeleteSubscription", }; let body: any; @@ -329,7 +329,7 @@ export const serializeAws_json1_1DescribeAttackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DescribeAttack", }; let body: any; @@ -342,7 +342,7 @@ export const serializeAws_json1_1DescribeAttackStatisticsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DescribeAttackStatistics", }; let body: any; @@ -355,7 +355,7 @@ export const serializeAws_json1_1DescribeDRTAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DescribeDRTAccess", }; let body: any; @@ -368,7 +368,7 @@ export const serializeAws_json1_1DescribeEmergencyContactSettingsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DescribeEmergencyContactSettings", }; let body: any; @@ -381,7 +381,7 @@ export const serializeAws_json1_1DescribeProtectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DescribeProtection", }; let body: any; @@ -394,7 +394,7 @@ export const serializeAws_json1_1DescribeProtectionGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DescribeProtectionGroup", }; let body: any; @@ -407,7 +407,7 @@ export const serializeAws_json1_1DescribeSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DescribeSubscription", }; let body: any; @@ -420,7 +420,7 @@ export const serializeAws_json1_1DisableProactiveEngagementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DisableProactiveEngagement", }; let body: any; @@ -433,7 +433,7 @@ export const serializeAws_json1_1DisassociateDRTLogBucketCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DisassociateDRTLogBucket", }; let body: any; @@ -446,7 +446,7 @@ export const serializeAws_json1_1DisassociateDRTRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DisassociateDRTRole", }; let body: any; @@ -459,7 +459,7 @@ export const serializeAws_json1_1DisassociateHealthCheckCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.DisassociateHealthCheck", }; let body: any; @@ -472,7 +472,7 @@ export const serializeAws_json1_1EnableProactiveEngagementCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.EnableProactiveEngagement", }; let body: any; @@ -485,7 +485,7 @@ export const serializeAws_json1_1GetSubscriptionStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.GetSubscriptionState", }; let body: any; @@ -498,7 +498,7 @@ export const serializeAws_json1_1ListAttacksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.ListAttacks", }; let body: any; @@ -511,7 +511,7 @@ export const serializeAws_json1_1ListProtectionGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.ListProtectionGroups", }; let body: any; @@ -524,7 +524,7 @@ export const serializeAws_json1_1ListProtectionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.ListProtections", }; let body: any; @@ -537,7 +537,7 @@ export const serializeAws_json1_1ListResourcesInProtectionGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.ListResourcesInProtectionGroup", }; let body: any; @@ -550,7 +550,7 @@ export const serializeAws_json1_1UpdateEmergencyContactSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.UpdateEmergencyContactSettings", }; let body: any; @@ -563,7 +563,7 @@ export const serializeAws_json1_1UpdateProtectionGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.UpdateProtectionGroup", }; let body: any; @@ -576,7 +576,7 @@ export const serializeAws_json1_1UpdateSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShield_20160616.UpdateSubscription", }; let body: any; @@ -611,8 +611,7 @@ const deserializeAws_json1_1AssociateDRTLogBucketCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedForDependencyException": case "com.amazonaws.shield#AccessDeniedForDependencyException": @@ -722,8 +721,7 @@ const deserializeAws_json1_1AssociateDRTRoleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedForDependencyException": case "com.amazonaws.shield#AccessDeniedForDependencyException": @@ -817,8 +815,7 @@ const deserializeAws_json1_1AssociateHealthCheckCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -904,8 +901,7 @@ const deserializeAws_json1_1AssociateProactiveEngagementDetailsCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -991,8 +987,7 @@ const deserializeAws_json1_1CreateProtectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1094,8 +1089,7 @@ const deserializeAws_json1_1CreateProtectionGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1189,8 +1183,7 @@ const deserializeAws_json1_1CreateSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1252,8 +1245,7 @@ const deserializeAws_json1_1DeleteProtectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1323,8 +1315,7 @@ const deserializeAws_json1_1DeleteProtectionGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1394,8 +1385,7 @@ const deserializeAws_json1_1DeleteSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1465,8 +1455,7 @@ const deserializeAws_json1_1DescribeAttackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.shield#AccessDeniedException": @@ -1528,8 +1517,7 @@ const deserializeAws_json1_1DescribeAttackStatisticsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1583,8 +1571,7 @@ const deserializeAws_json1_1DescribeDRTAccessCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1646,8 +1633,7 @@ const deserializeAws_json1_1DescribeEmergencyContactSettingsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1709,8 +1695,7 @@ const deserializeAws_json1_1DescribeProtectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1780,8 +1765,7 @@ const deserializeAws_json1_1DescribeProtectionGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1843,8 +1827,7 @@ const deserializeAws_json1_1DescribeSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1906,8 +1889,7 @@ const deserializeAws_json1_1DisableProactiveEngagementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -1993,8 +1975,7 @@ const deserializeAws_json1_1DisassociateDRTLogBucketCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedForDependencyException": case "com.amazonaws.shield#AccessDeniedForDependencyException": @@ -2088,8 +2069,7 @@ const deserializeAws_json1_1DisassociateDRTRoleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2167,8 +2147,7 @@ const deserializeAws_json1_1DisassociateHealthCheckCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2246,8 +2225,7 @@ const deserializeAws_json1_1EnableProactiveEngagementCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2333,8 +2311,7 @@ const deserializeAws_json1_1GetSubscriptionStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2388,8 +2365,7 @@ const deserializeAws_json1_1ListAttacksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2459,8 +2435,7 @@ const deserializeAws_json1_1ListProtectionGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2530,8 +2505,7 @@ const deserializeAws_json1_1ListProtectionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2601,8 +2575,7 @@ const deserializeAws_json1_1ListResourcesInProtectionGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2672,8 +2645,7 @@ const deserializeAws_json1_1UpdateEmergencyContactSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2751,8 +2723,7 @@ const deserializeAws_json1_1UpdateProtectionGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -2830,8 +2801,7 @@ const deserializeAws_json1_1UpdateSubscriptionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": @@ -3090,13 +3060,13 @@ const serializeAws_json1_1AssociateDRTLogBucketRequest = ( context: __SerdeContext ): any => { return { - ...(input.LogBucket !== undefined && { LogBucket: input.LogBucket }), + ...(input.LogBucket !== undefined && input.LogBucket !== null && { LogBucket: input.LogBucket }), }; }; const serializeAws_json1_1AssociateDRTRoleRequest = (input: AssociateDRTRoleRequest, context: __SerdeContext): any => { return { - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), }; }; @@ -3105,8 +3075,9 @@ const serializeAws_json1_1AssociateHealthCheckRequest = ( context: __SerdeContext ): any => { return { - ...(input.HealthCheckArn !== undefined && { HealthCheckArn: input.HealthCheckArn }), - ...(input.ProtectionId !== undefined && { ProtectionId: input.ProtectionId }), + ...(input.HealthCheckArn !== undefined && + input.HealthCheckArn !== null && { HealthCheckArn: input.HealthCheckArn }), + ...(input.ProtectionId !== undefined && input.ProtectionId !== null && { ProtectionId: input.ProtectionId }), }; }; @@ -3115,9 +3086,10 @@ const serializeAws_json1_1AssociateProactiveEngagementDetailsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EmergencyContactList !== undefined && { - EmergencyContactList: serializeAws_json1_1EmergencyContactList(input.EmergencyContactList, context), - }), + ...(input.EmergencyContactList !== undefined && + input.EmergencyContactList !== null && { + EmergencyContactList: serializeAws_json1_1EmergencyContactList(input.EmergencyContactList, context), + }), }; }; @@ -3126,18 +3098,20 @@ const serializeAws_json1_1CreateProtectionGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Aggregation !== undefined && { Aggregation: input.Aggregation }), - ...(input.Members !== undefined && { Members: serializeAws_json1_1ProtectionGroupMembers(input.Members, context) }), - ...(input.Pattern !== undefined && { Pattern: input.Pattern }), - ...(input.ProtectionGroupId !== undefined && { ProtectionGroupId: input.ProtectionGroupId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.Aggregation !== undefined && input.Aggregation !== null && { Aggregation: input.Aggregation }), + ...(input.Members !== undefined && + input.Members !== null && { Members: serializeAws_json1_1ProtectionGroupMembers(input.Members, context) }), + ...(input.Pattern !== undefined && input.Pattern !== null && { Pattern: input.Pattern }), + ...(input.ProtectionGroupId !== undefined && + input.ProtectionGroupId !== null && { ProtectionGroupId: input.ProtectionGroupId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; const serializeAws_json1_1CreateProtectionRequest = (input: CreateProtectionRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -3153,13 +3127,14 @@ const serializeAws_json1_1DeleteProtectionGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProtectionGroupId !== undefined && { ProtectionGroupId: input.ProtectionGroupId }), + ...(input.ProtectionGroupId !== undefined && + input.ProtectionGroupId !== null && { ProtectionGroupId: input.ProtectionGroupId }), }; }; const serializeAws_json1_1DeleteProtectionRequest = (input: DeleteProtectionRequest, context: __SerdeContext): any => { return { - ...(input.ProtectionId !== undefined && { ProtectionId: input.ProtectionId }), + ...(input.ProtectionId !== undefined && input.ProtectionId !== null && { ProtectionId: input.ProtectionId }), }; }; @@ -3172,7 +3147,7 @@ const serializeAws_json1_1DeleteSubscriptionRequest = ( const serializeAws_json1_1DescribeAttackRequest = (input: DescribeAttackRequest, context: __SerdeContext): any => { return { - ...(input.AttackId !== undefined && { AttackId: input.AttackId }), + ...(input.AttackId !== undefined && input.AttackId !== null && { AttackId: input.AttackId }), }; }; @@ -3202,7 +3177,8 @@ const serializeAws_json1_1DescribeProtectionGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProtectionGroupId !== undefined && { ProtectionGroupId: input.ProtectionGroupId }), + ...(input.ProtectionGroupId !== undefined && + input.ProtectionGroupId !== null && { ProtectionGroupId: input.ProtectionGroupId }), }; }; @@ -3211,8 +3187,8 @@ const serializeAws_json1_1DescribeProtectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ProtectionId !== undefined && { ProtectionId: input.ProtectionId }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ProtectionId !== undefined && input.ProtectionId !== null && { ProtectionId: input.ProtectionId }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -3235,7 +3211,7 @@ const serializeAws_json1_1DisassociateDRTLogBucketRequest = ( context: __SerdeContext ): any => { return { - ...(input.LogBucket !== undefined && { LogBucket: input.LogBucket }), + ...(input.LogBucket !== undefined && input.LogBucket !== null && { LogBucket: input.LogBucket }), }; }; @@ -3251,21 +3227,29 @@ const serializeAws_json1_1DisassociateHealthCheckRequest = ( context: __SerdeContext ): any => { return { - ...(input.HealthCheckArn !== undefined && { HealthCheckArn: input.HealthCheckArn }), - ...(input.ProtectionId !== undefined && { ProtectionId: input.ProtectionId }), + ...(input.HealthCheckArn !== undefined && + input.HealthCheckArn !== null && { HealthCheckArn: input.HealthCheckArn }), + ...(input.ProtectionId !== undefined && input.ProtectionId !== null && { ProtectionId: input.ProtectionId }), }; }; const serializeAws_json1_1EmergencyContact = (input: EmergencyContact, context: __SerdeContext): any => { return { - ...(input.ContactNotes !== undefined && { ContactNotes: input.ContactNotes }), - ...(input.EmailAddress !== undefined && { EmailAddress: input.EmailAddress }), - ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }), + ...(input.ContactNotes !== undefined && input.ContactNotes !== null && { ContactNotes: input.ContactNotes }), + ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }), + ...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }), }; }; const serializeAws_json1_1EmergencyContactList = (input: EmergencyContact[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1EmergencyContact(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EmergencyContact(entry, context); + }); }; const serializeAws_json1_1EnableProactiveEngagementRequest = ( @@ -3284,13 +3268,16 @@ const serializeAws_json1_1GetSubscriptionStateRequest = ( const serializeAws_json1_1ListAttacksRequest = (input: ListAttacksRequest, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: serializeAws_json1_1TimeRange(input.EndTime, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArns !== undefined && { - ResourceArns: serializeAws_json1_1ResourceArnFilterList(input.ResourceArns, context), - }), - ...(input.StartTime !== undefined && { StartTime: serializeAws_json1_1TimeRange(input.StartTime, context) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: serializeAws_json1_1TimeRange(input.EndTime, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArns !== undefined && + input.ResourceArns !== null && { + ResourceArns: serializeAws_json1_1ResourceArnFilterList(input.ResourceArns, context), + }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: serializeAws_json1_1TimeRange(input.StartTime, context) }), }; }; @@ -3299,15 +3286,15 @@ const serializeAws_json1_1ListProtectionGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListProtectionsRequest = (input: ListProtectionsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3316,24 +3303,41 @@ const serializeAws_json1_1ListResourcesInProtectionGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ProtectionGroupId !== undefined && { ProtectionGroupId: input.ProtectionGroupId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ProtectionGroupId !== undefined && + input.ProtectionGroupId !== null && { ProtectionGroupId: input.ProtectionGroupId }), }; }; const serializeAws_json1_1ProtectionGroupMembers = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ResourceArnFilterList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TimeRange = (input: TimeRange, context: __SerdeContext): any => { return { - ...(input.FromInclusive !== undefined && { FromInclusive: Math.round(input.FromInclusive.getTime() / 1000) }), - ...(input.ToExclusive !== undefined && { ToExclusive: Math.round(input.ToExclusive.getTime() / 1000) }), + ...(input.FromInclusive !== undefined && + input.FromInclusive !== null && { FromInclusive: Math.round(input.FromInclusive.getTime() / 1000) }), + ...(input.ToExclusive !== undefined && + input.ToExclusive !== null && { ToExclusive: Math.round(input.ToExclusive.getTime() / 1000) }), }; }; @@ -3342,9 +3346,10 @@ const serializeAws_json1_1UpdateEmergencyContactSettingsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EmergencyContactList !== undefined && { - EmergencyContactList: serializeAws_json1_1EmergencyContactList(input.EmergencyContactList, context), - }), + ...(input.EmergencyContactList !== undefined && + input.EmergencyContactList !== null && { + EmergencyContactList: serializeAws_json1_1EmergencyContactList(input.EmergencyContactList, context), + }), }; }; @@ -3353,11 +3358,13 @@ const serializeAws_json1_1UpdateProtectionGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Aggregation !== undefined && { Aggregation: input.Aggregation }), - ...(input.Members !== undefined && { Members: serializeAws_json1_1ProtectionGroupMembers(input.Members, context) }), - ...(input.Pattern !== undefined && { Pattern: input.Pattern }), - ...(input.ProtectionGroupId !== undefined && { ProtectionGroupId: input.ProtectionGroupId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.Aggregation !== undefined && input.Aggregation !== null && { Aggregation: input.Aggregation }), + ...(input.Members !== undefined && + input.Members !== null && { Members: serializeAws_json1_1ProtectionGroupMembers(input.Members, context) }), + ...(input.Pattern !== undefined && input.Pattern !== null && { Pattern: input.Pattern }), + ...(input.ProtectionGroupId !== undefined && + input.ProtectionGroupId !== null && { ProtectionGroupId: input.ProtectionGroupId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; @@ -3366,7 +3373,7 @@ const serializeAws_json1_1UpdateSubscriptionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AutoRenew !== undefined && { AutoRenew: input.AutoRenew }), + ...(input.AutoRenew !== undefined && input.AutoRenew !== null && { AutoRenew: input.AutoRenew }), }; }; @@ -3443,7 +3450,14 @@ const deserializeAws_json1_1AttackDetail = (output: any, context: __SerdeContext }; const deserializeAws_json1_1AttackProperties = (output: any, context: __SerdeContext): AttackProperty[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttackProperty(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttackProperty(entry, context); + }); }; const deserializeAws_json1_1AttackProperty = (output: any, context: __SerdeContext): AttackProperty => { @@ -3479,11 +3493,25 @@ const deserializeAws_json1_1AttackStatisticsDataList = ( output: any, context: __SerdeContext ): AttackStatisticsDataItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttackStatisticsDataItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttackStatisticsDataItem(entry, context); + }); }; const deserializeAws_json1_1AttackSummaries = (output: any, context: __SerdeContext): AttackSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttackSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttackSummary(entry, context); + }); }; const deserializeAws_json1_1AttackSummary = (output: any, context: __SerdeContext): AttackSummary => { @@ -3516,7 +3544,14 @@ const deserializeAws_json1_1AttackVectorDescriptionList = ( output: any, context: __SerdeContext ): AttackVectorDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttackVectorDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttackVectorDescription(entry, context); + }); }; const deserializeAws_json1_1AttackVolume = (output: any, context: __SerdeContext): AttackVolume => { @@ -3716,7 +3751,14 @@ const deserializeAws_json1_1EmergencyContact = (output: any, context: __SerdeCon }; const deserializeAws_json1_1EmergencyContactList = (output: any, context: __SerdeContext): EmergencyContact[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EmergencyContact(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EmergencyContact(entry, context); + }); }; const deserializeAws_json1_1EnableProactiveEngagementResponse = ( @@ -3739,7 +3781,14 @@ const deserializeAws_json1_1GetSubscriptionStateResponse = ( }; const deserializeAws_json1_1HealthCheckIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InternalErrorException = (output: any, context: __SerdeContext): InternalErrorException => { @@ -3797,7 +3846,14 @@ const deserializeAws_json1_1Limit = (output: any, context: __SerdeContext): Limi }; const deserializeAws_json1_1Limits = (output: any, context: __SerdeContext): Limit[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Limit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Limit(entry, context); + }); }; const deserializeAws_json1_1LimitsExceededException = ( @@ -3870,7 +3926,14 @@ const deserializeAws_json1_1LockedSubscriptionException = ( }; const deserializeAws_json1_1LogBucketList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Mitigation = (output: any, context: __SerdeContext): Mitigation => { @@ -3881,7 +3944,14 @@ const deserializeAws_json1_1Mitigation = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1MitigationList = (output: any, context: __SerdeContext): Mitigation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Mitigation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Mitigation(entry, context); + }); }; const deserializeAws_json1_1NoAssociatedRoleException = ( @@ -3953,7 +4023,14 @@ const deserializeAws_json1_1ProtectionGroupLimits = (output: any, context: __Ser }; const deserializeAws_json1_1ProtectionGroupMembers = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ProtectionGroupPatternTypeLimits = ( @@ -3969,7 +4046,14 @@ const deserializeAws_json1_1ProtectionGroupPatternTypeLimits = ( }; const deserializeAws_json1_1ProtectionGroups = (output: any, context: __SerdeContext): ProtectionGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ProtectionGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ProtectionGroup(entry, context); + }); }; const deserializeAws_json1_1ProtectionLimits = (output: any, context: __SerdeContext): ProtectionLimits => { @@ -3982,7 +4066,14 @@ const deserializeAws_json1_1ProtectionLimits = (output: any, context: __SerdeCon }; const deserializeAws_json1_1Protections = (output: any, context: __SerdeContext): Protection[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Protection(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Protection(entry, context); + }); }; const deserializeAws_json1_1ResourceAlreadyExistsException = ( @@ -3996,7 +4087,14 @@ const deserializeAws_json1_1ResourceAlreadyExistsException = ( }; const deserializeAws_json1_1ResourceArnList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceNotFoundException = ( @@ -4025,7 +4123,14 @@ const deserializeAws_json1_1SubResourceSummary = (output: any, context: __SerdeC }; const deserializeAws_json1_1SubResourceSummaryList = (output: any, context: __SerdeContext): SubResourceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SubResourceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SubResourceSummary(entry, context); + }); }; const deserializeAws_json1_1Subscription = (output: any, context: __SerdeContext): Subscription => { @@ -4083,7 +4188,14 @@ const deserializeAws_json1_1SummarizedAttackVectorList = ( output: any, context: __SerdeContext ): SummarizedAttackVector[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SummarizedAttackVector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SummarizedAttackVector(entry, context); + }); }; const deserializeAws_json1_1SummarizedCounter = (output: any, context: __SerdeContext): SummarizedCounter => { @@ -4098,7 +4210,14 @@ const deserializeAws_json1_1SummarizedCounter = (output: any, context: __SerdeCo }; const deserializeAws_json1_1SummarizedCounterList = (output: any, context: __SerdeContext): SummarizedCounter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SummarizedCounter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SummarizedCounter(entry, context); + }); }; const deserializeAws_json1_1TimeRange = (output: any, context: __SerdeContext): TimeRange => { @@ -4115,7 +4234,14 @@ const deserializeAws_json1_1TimeRange = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1TopContributors = (output: any, context: __SerdeContext): Contributor[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Contributor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Contributor(entry, context); + }); }; const deserializeAws_json1_1UpdateEmergencyContactSettingsResponse = ( @@ -4153,7 +4279,14 @@ const deserializeAws_json1_1ValidationExceptionFieldList = ( output: any, context: __SerdeContext ): ValidationExceptionField[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ValidationExceptionField(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ValidationExceptionField(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4206,3 +4339,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-signer/protocols/Aws_restJson1.ts b/clients/client-signer/protocols/Aws_restJson1.ts index 393375579d60..b1474c09d200 100644 --- a/clients/client-signer/protocols/Aws_restJson1.ts +++ b/clients/client-signer/protocols/Aws_restJson1.ts @@ -92,7 +92,7 @@ export const serializeAws_restJson1AddProfilePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/signing-profiles/{profileName}/permissions"; if (input.profileName !== undefined) { @@ -106,11 +106,12 @@ export const serializeAws_restJson1AddProfilePermissionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.action !== undefined && { action: input.action }), - ...(input.principal !== undefined && { principal: input.principal }), - ...(input.profileVersion !== undefined && { profileVersion: input.profileVersion }), - ...(input.revisionId !== undefined && { revisionId: input.revisionId }), - ...(input.statementId !== undefined && { statementId: input.statementId }), + ...(input.action !== undefined && input.action !== null && { action: input.action }), + ...(input.principal !== undefined && input.principal !== null && { principal: input.principal }), + ...(input.profileVersion !== undefined && + input.profileVersion !== null && { profileVersion: input.profileVersion }), + ...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }), + ...(input.statementId !== undefined && input.statementId !== null && { statementId: input.statementId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -128,9 +129,7 @@ export const serializeAws_restJson1CancelSigningProfileCommand = async ( input: CancelSigningProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/signing-profiles/{profileName}"; if (input.profileName !== undefined) { const labelValue: string = input.profileName; @@ -158,9 +157,7 @@ export const serializeAws_restJson1DescribeSigningJobCommand = async ( input: DescribeSigningJobCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/signing-jobs/{jobId}"; if (input.jobId !== undefined) { const labelValue: string = input.jobId; @@ -188,9 +185,7 @@ export const serializeAws_restJson1GetSigningPlatformCommand = async ( input: GetSigningPlatformCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/signing-platforms/{platformId}"; if (input.platformId !== undefined) { const labelValue: string = input.platformId; @@ -218,9 +213,7 @@ export const serializeAws_restJson1GetSigningProfileCommand = async ( input: GetSigningProfileCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/signing-profiles/{profileName}"; if (input.profileName !== undefined) { const labelValue: string = input.profileName; @@ -252,9 +245,7 @@ export const serializeAws_restJson1ListProfilePermissionsCommand = async ( input: ListProfilePermissionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/signing-profiles/{profileName}/permissions"; if (input.profileName !== undefined) { const labelValue: string = input.profileName; @@ -286,9 +277,7 @@ export const serializeAws_restJson1ListSigningJobsCommand = async ( input: ListSigningJobsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/signing-jobs"; const query: any = { ...(input.status !== undefined && { status: input.status }), @@ -323,9 +312,7 @@ export const serializeAws_restJson1ListSigningPlatformsCommand = async ( input: ListSigningPlatformsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/signing-platforms"; const query: any = { ...(input.category !== undefined && { category: input.category }), @@ -352,9 +339,7 @@ export const serializeAws_restJson1ListSigningProfilesCommand = async ( input: ListSigningProfilesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/signing-profiles"; const query: any = { ...(input.includeCanceled !== undefined && { includeCanceled: input.includeCanceled.toString() }), @@ -381,9 +366,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -412,7 +395,7 @@ export const serializeAws_restJson1PutSigningProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/signing-profiles/{profileName}"; if (input.profileName !== undefined) { @@ -426,20 +409,24 @@ export const serializeAws_restJson1PutSigningProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.overrides !== undefined && { - overrides: serializeAws_restJson1SigningPlatformOverrides(input.overrides, context), - }), - ...(input.platformId !== undefined && { platformId: input.platformId }), - ...(input.signatureValidityPeriod !== undefined && { - signatureValidityPeriod: serializeAws_restJson1SignatureValidityPeriod(input.signatureValidityPeriod, context), - }), - ...(input.signingMaterial !== undefined && { - signingMaterial: serializeAws_restJson1SigningMaterial(input.signingMaterial, context), - }), - ...(input.signingParameters !== undefined && { - signingParameters: serializeAws_restJson1SigningParameters(input.signingParameters, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.overrides !== undefined && + input.overrides !== null && { + overrides: serializeAws_restJson1SigningPlatformOverrides(input.overrides, context), + }), + ...(input.platformId !== undefined && input.platformId !== null && { platformId: input.platformId }), + ...(input.signatureValidityPeriod !== undefined && + input.signatureValidityPeriod !== null && { + signatureValidityPeriod: serializeAws_restJson1SignatureValidityPeriod(input.signatureValidityPeriod, context), + }), + ...(input.signingMaterial !== undefined && + input.signingMaterial !== null && { + signingMaterial: serializeAws_restJson1SigningMaterial(input.signingMaterial, context), + }), + ...(input.signingParameters !== undefined && + input.signingParameters !== null && { + signingParameters: serializeAws_restJson1SigningParameters(input.signingParameters, context), + }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -457,9 +444,7 @@ export const serializeAws_restJson1RemoveProfilePermissionCommand = async ( input: RemoveProfilePermissionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/signing-profiles/{profileName}/permissions/{statementId}"; if (input.profileName !== undefined) { const labelValue: string = input.profileName; @@ -501,7 +486,7 @@ export const serializeAws_restJson1RevokeSignatureCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/signing-jobs/{jobId}/revoke"; if (input.jobId !== undefined) { @@ -515,8 +500,8 @@ export const serializeAws_restJson1RevokeSignatureCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.jobOwner !== undefined && { jobOwner: input.jobOwner }), - ...(input.reason !== undefined && { reason: input.reason }), + ...(input.jobOwner !== undefined && input.jobOwner !== null && { jobOwner: input.jobOwner }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -535,7 +520,7 @@ export const serializeAws_restJson1RevokeSigningProfileCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/signing-profiles/{profileName}/revoke"; if (input.profileName !== undefined) { @@ -549,9 +534,11 @@ export const serializeAws_restJson1RevokeSigningProfileCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.effectiveTime !== undefined && { effectiveTime: Math.round(input.effectiveTime.getTime() / 1000) }), - ...(input.profileVersion !== undefined && { profileVersion: input.profileVersion }), - ...(input.reason !== undefined && { reason: input.reason }), + ...(input.effectiveTime !== undefined && + input.effectiveTime !== null && { effectiveTime: Math.round(input.effectiveTime.getTime() / 1000) }), + ...(input.profileVersion !== undefined && + input.profileVersion !== null && { profileVersion: input.profileVersion }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -570,18 +557,18 @@ export const serializeAws_restJson1StartSigningJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/signing-jobs"; let body: any; body = JSON.stringify({ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), - ...(input.destination !== undefined && { - destination: serializeAws_restJson1Destination(input.destination, context), - }), - ...(input.profileName !== undefined && { profileName: input.profileName }), - ...(input.profileOwner !== undefined && { profileOwner: input.profileOwner }), - ...(input.source !== undefined && { source: serializeAws_restJson1Source(input.source, context) }), + ...(input.destination !== undefined && + input.destination !== null && { destination: serializeAws_restJson1Destination(input.destination, context) }), + ...(input.profileName !== undefined && input.profileName !== null && { profileName: input.profileName }), + ...(input.profileOwner !== undefined && input.profileOwner !== null && { profileOwner: input.profileOwner }), + ...(input.source !== undefined && + input.source !== null && { source: serializeAws_restJson1Source(input.source, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -600,7 +587,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { @@ -614,7 +601,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.tags !== undefined && { tags: serializeAws_restJson1TagMap(input.tags, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -632,9 +619,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{resourceArn}"; if (input.resourceArn !== undefined) { const labelValue: string = input.resourceArn; @@ -2472,22 +2457,22 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1Destination = (input: Destination, context: __SerdeContext): any => { return { - ...(input.s3 !== undefined && { s3: serializeAws_restJson1S3Destination(input.s3, context) }), + ...(input.s3 !== undefined && input.s3 !== null && { s3: serializeAws_restJson1S3Destination(input.s3, context) }), }; }; const serializeAws_restJson1S3Destination = (input: S3Destination, context: __SerdeContext): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.prefix !== undefined && { prefix: input.prefix }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }), }; }; const serializeAws_restJson1S3Source = (input: S3Source, context: __SerdeContext): any => { return { - ...(input.bucketName !== undefined && { bucketName: input.bucketName }), - ...(input.key !== undefined && { key: input.key }), - ...(input.version !== undefined && { version: input.version }), + ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; @@ -2496,8 +2481,8 @@ const serializeAws_restJson1SignatureValidityPeriod = ( context: __SerdeContext ): any => { return { - ...(input.type !== undefined && { type: input.type }), - ...(input.value !== undefined && { value: input.value }), + ...(input.type !== undefined && input.type !== null && { type: input.type }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; @@ -2506,25 +2491,29 @@ const serializeAws_restJson1SigningConfigurationOverrides = ( context: __SerdeContext ): any => { return { - ...(input.encryptionAlgorithm !== undefined && { encryptionAlgorithm: input.encryptionAlgorithm }), - ...(input.hashAlgorithm !== undefined && { hashAlgorithm: input.hashAlgorithm }), + ...(input.encryptionAlgorithm !== undefined && + input.encryptionAlgorithm !== null && { encryptionAlgorithm: input.encryptionAlgorithm }), + ...(input.hashAlgorithm !== undefined && input.hashAlgorithm !== null && { hashAlgorithm: input.hashAlgorithm }), }; }; const serializeAws_restJson1SigningMaterial = (input: SigningMaterial, context: __SerdeContext): any => { return { - ...(input.certificateArn !== undefined && { certificateArn: input.certificateArn }), + ...(input.certificateArn !== undefined && + input.certificateArn !== null && { certificateArn: input.certificateArn }), }; }; const serializeAws_restJson1SigningParameters = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1SigningPlatformOverrides = ( @@ -2532,27 +2521,31 @@ const serializeAws_restJson1SigningPlatformOverrides = ( context: __SerdeContext ): any => { return { - ...(input.signingConfiguration !== undefined && { - signingConfiguration: serializeAws_restJson1SigningConfigurationOverrides(input.signingConfiguration, context), - }), - ...(input.signingImageFormat !== undefined && { signingImageFormat: input.signingImageFormat }), + ...(input.signingConfiguration !== undefined && + input.signingConfiguration !== null && { + signingConfiguration: serializeAws_restJson1SigningConfigurationOverrides(input.signingConfiguration, context), + }), + ...(input.signingImageFormat !== undefined && + input.signingImageFormat !== null && { signingImageFormat: input.signingImageFormat }), }; }; const serializeAws_restJson1Source = (input: Source, context: __SerdeContext): any => { return { - ...(input.s3 !== undefined && { s3: serializeAws_restJson1S3Source(input.s3, context) }), + ...(input.s3 !== undefined && input.s3 !== null && { s3: serializeAws_restJson1S3Source(input.s3, context) }), }; }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1EncryptionAlgorithmOptions = ( @@ -2572,7 +2565,14 @@ const deserializeAws_restJson1EncryptionAlgorithms = ( output: any, context: __SerdeContext ): (EncryptionAlgorithm | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1HashAlgorithmOptions = (output: any, context: __SerdeContext): HashAlgorithmOptions => { @@ -2586,11 +2586,25 @@ const deserializeAws_restJson1HashAlgorithmOptions = (output: any, context: __Se }; const deserializeAws_restJson1HashAlgorithms = (output: any, context: __SerdeContext): (HashAlgorithm | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ImageFormats = (output: any, context: __SerdeContext): (ImageFormat | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Permission = (output: any, context: __SerdeContext): Permission => { @@ -2604,7 +2618,14 @@ const deserializeAws_restJson1Permission = (output: any, context: __SerdeContext }; const deserializeAws_restJson1Permissions = (output: any, context: __SerdeContext): Permission[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Permission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Permission(entry, context); + }); }; const deserializeAws_restJson1S3SignedObject = (output: any, context: __SerdeContext): S3SignedObject => { @@ -2732,7 +2753,14 @@ const deserializeAws_restJson1SigningJobRevocationRecord = ( }; const deserializeAws_restJson1SigningJobs = (output: any, context: __SerdeContext): SigningJob[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SigningJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SigningJob(entry, context); + }); }; const deserializeAws_restJson1SigningMaterial = (output: any, context: __SerdeContext): SigningMaterial => { @@ -2743,13 +2771,15 @@ const deserializeAws_restJson1SigningMaterial = (output: any, context: __SerdeCo }; const deserializeAws_restJson1SigningParameters = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1SigningPlatform = (output: any, context: __SerdeContext): SigningPlatform => { @@ -2792,7 +2822,14 @@ const deserializeAws_restJson1SigningPlatformOverrides = ( }; const deserializeAws_restJson1SigningPlatforms = (output: any, context: __SerdeContext): SigningPlatform[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SigningPlatform(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SigningPlatform(entry, context); + }); }; const deserializeAws_restJson1SigningProfile = (output: any, context: __SerdeContext): SigningProfile => { @@ -2848,7 +2885,14 @@ const deserializeAws_restJson1SigningProfileRevocationRecord = ( }; const deserializeAws_restJson1SigningProfiles = (output: any, context: __SerdeContext): SigningProfile[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SigningProfile(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SigningProfile(entry, context); + }); }; const deserializeAws_restJson1Source = (output: any, context: __SerdeContext): Source => { @@ -2859,13 +2903,15 @@ const deserializeAws_restJson1Source = (output: any, context: __SerdeContext): S }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -2888,6 +2934,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-sms/protocols/Aws_json1_1.ts b/clients/client-sms/protocols/Aws_json1_1.ts index 62ac084b9b97..7cb4b3502fd2 100644 --- a/clients/client-sms/protocols/Aws_json1_1.ts +++ b/clients/client-sms/protocols/Aws_json1_1.ts @@ -222,7 +222,7 @@ export const serializeAws_json1_1CreateAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.CreateApp", }; let body: any; @@ -235,7 +235,7 @@ export const serializeAws_json1_1CreateReplicationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.CreateReplicationJob", }; let body: any; @@ -248,7 +248,7 @@ export const serializeAws_json1_1DeleteAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.DeleteApp", }; let body: any; @@ -261,7 +261,7 @@ export const serializeAws_json1_1DeleteAppLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.DeleteAppLaunchConfiguration", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1DeleteAppReplicationConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.DeleteAppReplicationConfiguration", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1DeleteAppValidationConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.DeleteAppValidationConfiguration", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1DeleteReplicationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.DeleteReplicationJob", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1DeleteServerCatalogCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.DeleteServerCatalog", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1DisassociateConnectorCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.DisassociateConnector", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1GenerateChangeSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GenerateChangeSet", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1GenerateTemplateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GenerateTemplate", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1GetAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GetApp", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1GetAppLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GetAppLaunchConfiguration", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1GetAppReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GetAppReplicationConfiguration", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1GetAppValidationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GetAppValidationConfiguration", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1GetAppValidationOutputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GetAppValidationOutput", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1GetConnectorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GetConnectors", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1GetReplicationJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GetReplicationJobs", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1GetReplicationRunsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GetReplicationRuns", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1GetServersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.GetServers", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1ImportAppCatalogCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.ImportAppCatalog", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1ImportServerCatalogCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.ImportServerCatalog", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1LaunchAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.LaunchApp", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1ListAppsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.ListApps", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1NotifyAppValidationOutputCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.NotifyAppValidationOutput", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1PutAppLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.PutAppLaunchConfiguration", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1PutAppReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.PutAppReplicationConfiguration", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1PutAppValidationConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.PutAppValidationConfiguration", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1StartAppReplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.StartAppReplication", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1StartOnDemandAppReplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.StartOnDemandAppReplication", }; let body: any; @@ -612,7 +612,7 @@ export const serializeAws_json1_1StartOnDemandReplicationRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.StartOnDemandReplicationRun", }; let body: any; @@ -625,7 +625,7 @@ export const serializeAws_json1_1StopAppReplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.StopAppReplication", }; let body: any; @@ -638,7 +638,7 @@ export const serializeAws_json1_1TerminateAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.TerminateApp", }; let body: any; @@ -651,7 +651,7 @@ export const serializeAws_json1_1UpdateAppCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.UpdateApp", }; let body: any; @@ -664,7 +664,7 @@ export const serializeAws_json1_1UpdateReplicationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSServerMigrationService_V2016_10_24.UpdateReplicationJob", }; let body: any; @@ -699,8 +699,7 @@ const deserializeAws_json1_1CreateAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -786,8 +785,7 @@ const deserializeAws_json1_1CreateReplicationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -905,8 +903,7 @@ const deserializeAws_json1_1DeleteAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -992,8 +989,7 @@ const deserializeAws_json1_1DeleteAppLaunchConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -1079,8 +1075,7 @@ const deserializeAws_json1_1DeleteAppReplicationConfigurationCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -1166,8 +1161,7 @@ const deserializeAws_json1_1DeleteAppValidationConfigurationCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -1253,8 +1247,7 @@ const deserializeAws_json1_1DeleteReplicationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.sms#InvalidParameterException": @@ -1340,8 +1333,7 @@ const deserializeAws_json1_1DeleteServerCatalogCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.sms#InvalidParameterException": @@ -1419,8 +1411,7 @@ const deserializeAws_json1_1DisassociateConnectorCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.sms#InvalidParameterException": @@ -1498,8 +1489,7 @@ const deserializeAws_json1_1GenerateChangeSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -1585,8 +1575,7 @@ const deserializeAws_json1_1GenerateTemplateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -1672,8 +1661,7 @@ const deserializeAws_json1_1GetAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -1759,8 +1747,7 @@ const deserializeAws_json1_1GetAppLaunchConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -1846,8 +1833,7 @@ const deserializeAws_json1_1GetAppReplicationConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -1933,8 +1919,7 @@ const deserializeAws_json1_1GetAppValidationConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -2020,8 +2005,7 @@ const deserializeAws_json1_1GetAppValidationOutputCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -2107,8 +2091,7 @@ const deserializeAws_json1_1GetConnectorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "UnauthorizedOperationException": case "com.amazonaws.sms#UnauthorizedOperationException": @@ -2162,8 +2145,7 @@ const deserializeAws_json1_1GetReplicationJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.sms#InvalidParameterException": @@ -2233,8 +2215,7 @@ const deserializeAws_json1_1GetReplicationRunsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.sms#InvalidParameterException": @@ -2304,8 +2285,7 @@ const deserializeAws_json1_1GetServersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -2383,8 +2363,7 @@ const deserializeAws_json1_1ImportAppCatalogCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -2470,8 +2449,7 @@ const deserializeAws_json1_1ImportServerCatalogCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.sms#InvalidParameterException": @@ -2557,8 +2535,7 @@ const deserializeAws_json1_1LaunchAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -2644,8 +2621,7 @@ const deserializeAws_json1_1ListAppsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -2731,8 +2707,7 @@ const deserializeAws_json1_1NotifyAppValidationOutputCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -2818,8 +2793,7 @@ const deserializeAws_json1_1PutAppLaunchConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -2905,8 +2879,7 @@ const deserializeAws_json1_1PutAppReplicationConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -2992,8 +2965,7 @@ const deserializeAws_json1_1PutAppValidationConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -3079,8 +3051,7 @@ const deserializeAws_json1_1StartAppReplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -3166,8 +3137,7 @@ const deserializeAws_json1_1StartOnDemandAppReplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -3253,8 +3223,7 @@ const deserializeAws_json1_1StartOnDemandReplicationRunCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DryRunOperationException": case "com.amazonaws.sms#DryRunOperationException": @@ -3348,8 +3317,7 @@ const deserializeAws_json1_1StopAppReplicationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -3435,8 +3403,7 @@ const deserializeAws_json1_1TerminateAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -3522,8 +3489,7 @@ const deserializeAws_json1_1UpdateAppCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -3609,8 +3575,7 @@ const deserializeAws_json1_1UpdateReplicationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalError": case "com.amazonaws.sms#InternalError": @@ -3874,7 +3839,14 @@ const deserializeAws_json1_1UnauthorizedOperationExceptionResponse = async ( }; const serializeAws_json1_1AppIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AppValidationConfiguration = ( @@ -3882,12 +3854,14 @@ const serializeAws_json1_1AppValidationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.appValidationStrategy !== undefined && { appValidationStrategy: input.appValidationStrategy }), - ...(input.name !== undefined && { name: input.name }), - ...(input.ssmValidationParameters !== undefined && { - ssmValidationParameters: serializeAws_json1_1SSMValidationParameters(input.ssmValidationParameters, context), - }), - ...(input.validationId !== undefined && { validationId: input.validationId }), + ...(input.appValidationStrategy !== undefined && + input.appValidationStrategy !== null && { appValidationStrategy: input.appValidationStrategy }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.ssmValidationParameters !== undefined && + input.ssmValidationParameters !== null && { + ssmValidationParameters: serializeAws_json1_1SSMValidationParameters(input.ssmValidationParameters, context), + }), + ...(input.validationId !== undefined && input.validationId !== null && { validationId: input.validationId }), }; }; @@ -3895,19 +3869,25 @@ const serializeAws_json1_1AppValidationConfigurations = ( input: AppValidationConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AppValidationConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AppValidationConfiguration(entry, context); + }); }; const serializeAws_json1_1CreateAppRequest = (input: CreateAppRequest, context: __SerdeContext): any => { return { - ...(input.clientToken !== undefined && { clientToken: input.clientToken }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.roleName !== undefined && { roleName: input.roleName }), - ...(input.serverGroups !== undefined && { - serverGroups: serializeAws_json1_1ServerGroups(input.serverGroups, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.clientToken !== undefined && input.clientToken !== null && { clientToken: input.clientToken }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.roleName !== undefined && input.roleName !== null && { roleName: input.roleName }), + ...(input.serverGroups !== undefined && + input.serverGroups !== null && { serverGroups: serializeAws_json1_1ServerGroups(input.serverGroups, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), }; }; @@ -3916,18 +3896,20 @@ const serializeAws_json1_1CreateReplicationJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.encrypted !== undefined && { encrypted: input.encrypted }), - ...(input.frequency !== undefined && { frequency: input.frequency }), - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), - ...(input.licenseType !== undefined && { licenseType: input.licenseType }), - ...(input.numberOfRecentAmisToKeep !== undefined && { numberOfRecentAmisToKeep: input.numberOfRecentAmisToKeep }), - ...(input.roleName !== undefined && { roleName: input.roleName }), - ...(input.runOnce !== undefined && { runOnce: input.runOnce }), - ...(input.seedReplicationTime !== undefined && { - seedReplicationTime: Math.round(input.seedReplicationTime.getTime() / 1000), - }), - ...(input.serverId !== undefined && { serverId: input.serverId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.encrypted !== undefined && input.encrypted !== null && { encrypted: input.encrypted }), + ...(input.frequency !== undefined && input.frequency !== null && { frequency: input.frequency }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), + ...(input.licenseType !== undefined && input.licenseType !== null && { licenseType: input.licenseType }), + ...(input.numberOfRecentAmisToKeep !== undefined && + input.numberOfRecentAmisToKeep !== null && { numberOfRecentAmisToKeep: input.numberOfRecentAmisToKeep }), + ...(input.roleName !== undefined && input.roleName !== null && { roleName: input.roleName }), + ...(input.runOnce !== undefined && input.runOnce !== null && { runOnce: input.runOnce }), + ...(input.seedReplicationTime !== undefined && + input.seedReplicationTime !== null && { + seedReplicationTime: Math.round(input.seedReplicationTime.getTime() / 1000), + }), + ...(input.serverId !== undefined && input.serverId !== null && { serverId: input.serverId }), }; }; @@ -3936,7 +3918,7 @@ const serializeAws_json1_1DeleteAppLaunchConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; @@ -3945,15 +3927,17 @@ const serializeAws_json1_1DeleteAppReplicationConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; const serializeAws_json1_1DeleteAppRequest = (input: DeleteAppRequest, context: __SerdeContext): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.forceStopAppReplication !== undefined && { forceStopAppReplication: input.forceStopAppReplication }), - ...(input.forceTerminateApp !== undefined && { forceTerminateApp: input.forceTerminateApp }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.forceStopAppReplication !== undefined && + input.forceStopAppReplication !== null && { forceStopAppReplication: input.forceStopAppReplication }), + ...(input.forceTerminateApp !== undefined && + input.forceTerminateApp !== null && { forceTerminateApp: input.forceTerminateApp }), }; }; @@ -3962,7 +3946,7 @@ const serializeAws_json1_1DeleteAppValidationConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; @@ -3971,7 +3955,8 @@ const serializeAws_json1_1DeleteReplicationJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.replicationJobId !== undefined && { replicationJobId: input.replicationJobId }), + ...(input.replicationJobId !== undefined && + input.replicationJobId !== null && { replicationJobId: input.replicationJobId }), }; }; @@ -3987,7 +3972,7 @@ const serializeAws_json1_1DisassociateConnectorRequest = ( context: __SerdeContext ): any => { return { - ...(input.connectorId !== undefined && { connectorId: input.connectorId }), + ...(input.connectorId !== undefined && input.connectorId !== null && { connectorId: input.connectorId }), }; }; @@ -3996,15 +3981,17 @@ const serializeAws_json1_1GenerateChangeSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.changesetFormat !== undefined && { changesetFormat: input.changesetFormat }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.changesetFormat !== undefined && + input.changesetFormat !== null && { changesetFormat: input.changesetFormat }), }; }; const serializeAws_json1_1GenerateTemplateRequest = (input: GenerateTemplateRequest, context: __SerdeContext): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.templateFormat !== undefined && { templateFormat: input.templateFormat }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.templateFormat !== undefined && + input.templateFormat !== null && { templateFormat: input.templateFormat }), }; }; @@ -4013,7 +4000,7 @@ const serializeAws_json1_1GetAppLaunchConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; @@ -4022,13 +4009,13 @@ const serializeAws_json1_1GetAppReplicationConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; const serializeAws_json1_1GetAppRequest = (input: GetAppRequest, context: __SerdeContext): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; @@ -4037,7 +4024,7 @@ const serializeAws_json1_1GetAppValidationConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; @@ -4046,14 +4033,14 @@ const serializeAws_json1_1GetAppValidationOutputRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; const serializeAws_json1_1GetConnectorsRequest = (input: GetConnectorsRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -4062,9 +4049,10 @@ const serializeAws_json1_1GetReplicationJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.replicationJobId !== undefined && { replicationJobId: input.replicationJobId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.replicationJobId !== undefined && + input.replicationJobId !== null && { replicationJobId: input.replicationJobId }), }; }; @@ -4073,25 +4061,27 @@ const serializeAws_json1_1GetReplicationRunsRequest = ( context: __SerdeContext ): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.replicationJobId !== undefined && { replicationJobId: input.replicationJobId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.replicationJobId !== undefined && + input.replicationJobId !== null && { replicationJobId: input.replicationJobId }), }; }; const serializeAws_json1_1GetServersRequest = (input: GetServersRequest, context: __SerdeContext): any => { return { - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), - ...(input.vmServerAddressList !== undefined && { - vmServerAddressList: serializeAws_json1_1VmServerAddressList(input.vmServerAddressList, context), - }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), + ...(input.vmServerAddressList !== undefined && + input.vmServerAddressList !== null && { + vmServerAddressList: serializeAws_json1_1VmServerAddressList(input.vmServerAddressList, context), + }), }; }; const serializeAws_json1_1ImportAppCatalogRequest = (input: ImportAppCatalogRequest, context: __SerdeContext): any => { return { - ...(input.roleName !== undefined && { roleName: input.roleName }), + ...(input.roleName !== undefined && input.roleName !== null && { roleName: input.roleName }), }; }; @@ -4104,23 +4094,24 @@ const serializeAws_json1_1ImportServerCatalogRequest = ( const serializeAws_json1_1LaunchAppRequest = (input: LaunchAppRequest, context: __SerdeContext): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; const serializeAws_json1_1ListAppsRequest = (input: ListAppsRequest, context: __SerdeContext): any => { return { - ...(input.appIds !== undefined && { appIds: serializeAws_json1_1AppIds(input.appIds, context) }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.appIds !== undefined && + input.appIds !== null && { appIds: serializeAws_json1_1AppIds(input.appIds, context) }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1NotificationContext = (input: NotificationContext, context: __SerdeContext): any => { return { - ...(input.status !== undefined && { status: input.status }), - ...(input.statusMessage !== undefined && { statusMessage: input.statusMessage }), - ...(input.validationId !== undefined && { validationId: input.validationId }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), + ...(input.statusMessage !== undefined && input.statusMessage !== null && { statusMessage: input.statusMessage }), + ...(input.validationId !== undefined && input.validationId !== null && { validationId: input.validationId }), }; }; @@ -4129,10 +4120,11 @@ const serializeAws_json1_1NotifyAppValidationOutputRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.notificationContext !== undefined && { - notificationContext: serializeAws_json1_1NotificationContext(input.notificationContext, context), - }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.notificationContext !== undefined && + input.notificationContext !== null && { + notificationContext: serializeAws_json1_1NotificationContext(input.notificationContext, context), + }), }; }; @@ -4141,15 +4133,16 @@ const serializeAws_json1_1PutAppLaunchConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.autoLaunch !== undefined && { autoLaunch: input.autoLaunch }), - ...(input.roleName !== undefined && { roleName: input.roleName }), - ...(input.serverGroupLaunchConfigurations !== undefined && { - serverGroupLaunchConfigurations: serializeAws_json1_1ServerGroupLaunchConfigurations( - input.serverGroupLaunchConfigurations, - context - ), - }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.autoLaunch !== undefined && input.autoLaunch !== null && { autoLaunch: input.autoLaunch }), + ...(input.roleName !== undefined && input.roleName !== null && { roleName: input.roleName }), + ...(input.serverGroupLaunchConfigurations !== undefined && + input.serverGroupLaunchConfigurations !== null && { + serverGroupLaunchConfigurations: serializeAws_json1_1ServerGroupLaunchConfigurations( + input.serverGroupLaunchConfigurations, + context + ), + }), }; }; @@ -4158,13 +4151,14 @@ const serializeAws_json1_1PutAppReplicationConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.serverGroupReplicationConfigurations !== undefined && { - serverGroupReplicationConfigurations: serializeAws_json1_1ServerGroupReplicationConfigurations( - input.serverGroupReplicationConfigurations, - context - ), - }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.serverGroupReplicationConfigurations !== undefined && + input.serverGroupReplicationConfigurations !== null && { + serverGroupReplicationConfigurations: serializeAws_json1_1ServerGroupReplicationConfigurations( + input.serverGroupReplicationConfigurations, + context + ), + }), }; }; @@ -4173,44 +4167,50 @@ const serializeAws_json1_1PutAppValidationConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.appValidationConfigurations !== undefined && { - appValidationConfigurations: serializeAws_json1_1AppValidationConfigurations( - input.appValidationConfigurations, - context - ), - }), - ...(input.serverGroupValidationConfigurations !== undefined && { - serverGroupValidationConfigurations: serializeAws_json1_1ServerGroupValidationConfigurations( - input.serverGroupValidationConfigurations, - context - ), - }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.appValidationConfigurations !== undefined && + input.appValidationConfigurations !== null && { + appValidationConfigurations: serializeAws_json1_1AppValidationConfigurations( + input.appValidationConfigurations, + context + ), + }), + ...(input.serverGroupValidationConfigurations !== undefined && + input.serverGroupValidationConfigurations !== null && { + serverGroupValidationConfigurations: serializeAws_json1_1ServerGroupValidationConfigurations( + input.serverGroupValidationConfigurations, + context + ), + }), }; }; const serializeAws_json1_1S3Location = (input: S3Location, context: __SerdeContext): any => { return { - ...(input.bucket !== undefined && { bucket: input.bucket }), - ...(input.key !== undefined && { key: input.key }), + ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), }; }; const serializeAws_json1_1Server = (input: Server, context: __SerdeContext): any => { return { - ...(input.replicationJobId !== undefined && { replicationJobId: input.replicationJobId }), - ...(input.replicationJobTerminated !== undefined && { replicationJobTerminated: input.replicationJobTerminated }), - ...(input.serverId !== undefined && { serverId: input.serverId }), - ...(input.serverType !== undefined && { serverType: input.serverType }), - ...(input.vmServer !== undefined && { vmServer: serializeAws_json1_1VmServer(input.vmServer, context) }), + ...(input.replicationJobId !== undefined && + input.replicationJobId !== null && { replicationJobId: input.replicationJobId }), + ...(input.replicationJobTerminated !== undefined && + input.replicationJobTerminated !== null && { replicationJobTerminated: input.replicationJobTerminated }), + ...(input.serverId !== undefined && input.serverId !== null && { serverId: input.serverId }), + ...(input.serverType !== undefined && input.serverType !== null && { serverType: input.serverType }), + ...(input.vmServer !== undefined && + input.vmServer !== null && { vmServer: serializeAws_json1_1VmServer(input.vmServer, context) }), }; }; const serializeAws_json1_1ServerGroup = (input: ServerGroup, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.serverGroupId !== undefined && { serverGroupId: input.serverGroupId }), - ...(input.serverList !== undefined && { serverList: serializeAws_json1_1ServerList(input.serverList, context) }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.serverGroupId !== undefined && input.serverGroupId !== null && { serverGroupId: input.serverGroupId }), + ...(input.serverList !== undefined && + input.serverList !== null && { serverList: serializeAws_json1_1ServerList(input.serverList, context) }), }; }; @@ -4219,14 +4219,15 @@ const serializeAws_json1_1ServerGroupLaunchConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.launchOrder !== undefined && { launchOrder: input.launchOrder }), - ...(input.serverGroupId !== undefined && { serverGroupId: input.serverGroupId }), - ...(input.serverLaunchConfigurations !== undefined && { - serverLaunchConfigurations: serializeAws_json1_1ServerLaunchConfigurations( - input.serverLaunchConfigurations, - context - ), - }), + ...(input.launchOrder !== undefined && input.launchOrder !== null && { launchOrder: input.launchOrder }), + ...(input.serverGroupId !== undefined && input.serverGroupId !== null && { serverGroupId: input.serverGroupId }), + ...(input.serverLaunchConfigurations !== undefined && + input.serverLaunchConfigurations !== null && { + serverLaunchConfigurations: serializeAws_json1_1ServerLaunchConfigurations( + input.serverLaunchConfigurations, + context + ), + }), }; }; @@ -4234,7 +4235,14 @@ const serializeAws_json1_1ServerGroupLaunchConfigurations = ( input: ServerGroupLaunchConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ServerGroupLaunchConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServerGroupLaunchConfiguration(entry, context); + }); }; const serializeAws_json1_1ServerGroupReplicationConfiguration = ( @@ -4242,13 +4250,14 @@ const serializeAws_json1_1ServerGroupReplicationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.serverGroupId !== undefined && { serverGroupId: input.serverGroupId }), - ...(input.serverReplicationConfigurations !== undefined && { - serverReplicationConfigurations: serializeAws_json1_1ServerReplicationConfigurations( - input.serverReplicationConfigurations, - context - ), - }), + ...(input.serverGroupId !== undefined && input.serverGroupId !== null && { serverGroupId: input.serverGroupId }), + ...(input.serverReplicationConfigurations !== undefined && + input.serverReplicationConfigurations !== null && { + serverReplicationConfigurations: serializeAws_json1_1ServerReplicationConfigurations( + input.serverReplicationConfigurations, + context + ), + }), }; }; @@ -4256,11 +4265,25 @@ const serializeAws_json1_1ServerGroupReplicationConfigurations = ( input: ServerGroupReplicationConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ServerGroupReplicationConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServerGroupReplicationConfiguration(entry, context); + }); }; const serializeAws_json1_1ServerGroups = (input: ServerGroup[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ServerGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServerGroup(entry, context); + }); }; const serializeAws_json1_1ServerGroupValidationConfiguration = ( @@ -4268,13 +4291,14 @@ const serializeAws_json1_1ServerGroupValidationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.serverGroupId !== undefined && { serverGroupId: input.serverGroupId }), - ...(input.serverValidationConfigurations !== undefined && { - serverValidationConfigurations: serializeAws_json1_1ServerValidationConfigurations( - input.serverValidationConfigurations, - context - ), - }), + ...(input.serverGroupId !== undefined && input.serverGroupId !== null && { serverGroupId: input.serverGroupId }), + ...(input.serverValidationConfigurations !== undefined && + input.serverValidationConfigurations !== null && { + serverValidationConfigurations: serializeAws_json1_1ServerValidationConfigurations( + input.serverValidationConfigurations, + context + ), + }), }; }; @@ -4282,7 +4306,14 @@ const serializeAws_json1_1ServerGroupValidationConfigurations = ( input: ServerGroupValidationConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ServerGroupValidationConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServerGroupValidationConfiguration(entry, context); + }); }; const serializeAws_json1_1ServerLaunchConfiguration = ( @@ -4290,20 +4321,26 @@ const serializeAws_json1_1ServerLaunchConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.associatePublicIpAddress !== undefined && { associatePublicIpAddress: input.associatePublicIpAddress }), - ...(input.configureScript !== undefined && { - configureScript: serializeAws_json1_1S3Location(input.configureScript, context), - }), - ...(input.configureScriptType !== undefined && { configureScriptType: input.configureScriptType }), - ...(input.ec2KeyName !== undefined && { ec2KeyName: input.ec2KeyName }), - ...(input.iamInstanceProfileName !== undefined && { iamInstanceProfileName: input.iamInstanceProfileName }), - ...(input.instanceType !== undefined && { instanceType: input.instanceType }), - ...(input.logicalId !== undefined && { logicalId: input.logicalId }), - ...(input.securityGroup !== undefined && { securityGroup: input.securityGroup }), - ...(input.server !== undefined && { server: serializeAws_json1_1Server(input.server, context) }), - ...(input.subnet !== undefined && { subnet: input.subnet }), - ...(input.userData !== undefined && { userData: serializeAws_json1_1UserData(input.userData, context) }), - ...(input.vpc !== undefined && { vpc: input.vpc }), + ...(input.associatePublicIpAddress !== undefined && + input.associatePublicIpAddress !== null && { associatePublicIpAddress: input.associatePublicIpAddress }), + ...(input.configureScript !== undefined && + input.configureScript !== null && { + configureScript: serializeAws_json1_1S3Location(input.configureScript, context), + }), + ...(input.configureScriptType !== undefined && + input.configureScriptType !== null && { configureScriptType: input.configureScriptType }), + ...(input.ec2KeyName !== undefined && input.ec2KeyName !== null && { ec2KeyName: input.ec2KeyName }), + ...(input.iamInstanceProfileName !== undefined && + input.iamInstanceProfileName !== null && { iamInstanceProfileName: input.iamInstanceProfileName }), + ...(input.instanceType !== undefined && input.instanceType !== null && { instanceType: input.instanceType }), + ...(input.logicalId !== undefined && input.logicalId !== null && { logicalId: input.logicalId }), + ...(input.securityGroup !== undefined && input.securityGroup !== null && { securityGroup: input.securityGroup }), + ...(input.server !== undefined && + input.server !== null && { server: serializeAws_json1_1Server(input.server, context) }), + ...(input.subnet !== undefined && input.subnet !== null && { subnet: input.subnet }), + ...(input.userData !== undefined && + input.userData !== null && { userData: serializeAws_json1_1UserData(input.userData, context) }), + ...(input.vpc !== undefined && input.vpc !== null && { vpc: input.vpc }), }; }; @@ -4311,11 +4348,25 @@ const serializeAws_json1_1ServerLaunchConfigurations = ( input: ServerLaunchConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ServerLaunchConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServerLaunchConfiguration(entry, context); + }); }; const serializeAws_json1_1ServerList = (input: Server[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Server(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Server(entry, context); + }); }; const serializeAws_json1_1ServerReplicationConfiguration = ( @@ -4323,13 +4374,15 @@ const serializeAws_json1_1ServerReplicationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.server !== undefined && { server: serializeAws_json1_1Server(input.server, context) }), - ...(input.serverReplicationParameters !== undefined && { - serverReplicationParameters: serializeAws_json1_1ServerReplicationParameters( - input.serverReplicationParameters, - context - ), - }), + ...(input.server !== undefined && + input.server !== null && { server: serializeAws_json1_1Server(input.server, context) }), + ...(input.serverReplicationParameters !== undefined && + input.serverReplicationParameters !== null && { + serverReplicationParameters: serializeAws_json1_1ServerReplicationParameters( + input.serverReplicationParameters, + context + ), + }), }; }; @@ -4337,7 +4390,14 @@ const serializeAws_json1_1ServerReplicationConfigurations = ( input: ServerReplicationConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ServerReplicationConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServerReplicationConfiguration(entry, context); + }); }; const serializeAws_json1_1ServerReplicationParameters = ( @@ -4345,13 +4405,15 @@ const serializeAws_json1_1ServerReplicationParameters = ( context: __SerdeContext ): any => { return { - ...(input.encrypted !== undefined && { encrypted: input.encrypted }), - ...(input.frequency !== undefined && { frequency: input.frequency }), - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), - ...(input.licenseType !== undefined && { licenseType: input.licenseType }), - ...(input.numberOfRecentAmisToKeep !== undefined && { numberOfRecentAmisToKeep: input.numberOfRecentAmisToKeep }), - ...(input.runOnce !== undefined && { runOnce: input.runOnce }), - ...(input.seedTime !== undefined && { seedTime: Math.round(input.seedTime.getTime() / 1000) }), + ...(input.encrypted !== undefined && input.encrypted !== null && { encrypted: input.encrypted }), + ...(input.frequency !== undefined && input.frequency !== null && { frequency: input.frequency }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), + ...(input.licenseType !== undefined && input.licenseType !== null && { licenseType: input.licenseType }), + ...(input.numberOfRecentAmisToKeep !== undefined && + input.numberOfRecentAmisToKeep !== null && { numberOfRecentAmisToKeep: input.numberOfRecentAmisToKeep }), + ...(input.runOnce !== undefined && input.runOnce !== null && { runOnce: input.runOnce }), + ...(input.seedTime !== undefined && + input.seedTime !== null && { seedTime: Math.round(input.seedTime.getTime() / 1000) }), }; }; @@ -4360,16 +4422,19 @@ const serializeAws_json1_1ServerValidationConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.server !== undefined && { server: serializeAws_json1_1Server(input.server, context) }), - ...(input.serverValidationStrategy !== undefined && { serverValidationStrategy: input.serverValidationStrategy }), - ...(input.userDataValidationParameters !== undefined && { - userDataValidationParameters: serializeAws_json1_1UserDataValidationParameters( - input.userDataValidationParameters, - context - ), - }), - ...(input.validationId !== undefined && { validationId: input.validationId }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.server !== undefined && + input.server !== null && { server: serializeAws_json1_1Server(input.server, context) }), + ...(input.serverValidationStrategy !== undefined && + input.serverValidationStrategy !== null && { serverValidationStrategy: input.serverValidationStrategy }), + ...(input.userDataValidationParameters !== undefined && + input.userDataValidationParameters !== null && { + userDataValidationParameters: serializeAws_json1_1UserDataValidationParameters( + input.userDataValidationParameters, + context + ), + }), + ...(input.validationId !== undefined && input.validationId !== null && { validationId: input.validationId }), }; }; @@ -4377,23 +4442,34 @@ const serializeAws_json1_1ServerValidationConfigurations = ( input: ServerValidationConfiguration[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ServerValidationConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ServerValidationConfiguration(entry, context); + }); }; const serializeAws_json1_1Source = (input: Source, context: __SerdeContext): any => { return { - ...(input.s3Location !== undefined && { s3Location: serializeAws_json1_1S3Location(input.s3Location, context) }), + ...(input.s3Location !== undefined && + input.s3Location !== null && { s3Location: serializeAws_json1_1S3Location(input.s3Location, context) }), }; }; const serializeAws_json1_1SSMValidationParameters = (input: SSMValidationParameters, context: __SerdeContext): any => { return { - ...(input.command !== undefined && { command: input.command }), - ...(input.executionTimeoutSeconds !== undefined && { executionTimeoutSeconds: input.executionTimeoutSeconds }), - ...(input.instanceId !== undefined && { instanceId: input.instanceId }), - ...(input.outputS3BucketName !== undefined && { outputS3BucketName: input.outputS3BucketName }), - ...(input.scriptType !== undefined && { scriptType: input.scriptType }), - ...(input.source !== undefined && { source: serializeAws_json1_1Source(input.source, context) }), + ...(input.command !== undefined && input.command !== null && { command: input.command }), + ...(input.executionTimeoutSeconds !== undefined && + input.executionTimeoutSeconds !== null && { executionTimeoutSeconds: input.executionTimeoutSeconds }), + ...(input.instanceId !== undefined && input.instanceId !== null && { instanceId: input.instanceId }), + ...(input.outputS3BucketName !== undefined && + input.outputS3BucketName !== null && { outputS3BucketName: input.outputS3BucketName }), + ...(input.scriptType !== undefined && input.scriptType !== null && { scriptType: input.scriptType }), + ...(input.source !== undefined && + input.source !== null && { source: serializeAws_json1_1Source(input.source, context) }), }; }; @@ -4402,7 +4478,7 @@ const serializeAws_json1_1StartAppReplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; @@ -4411,8 +4487,8 @@ const serializeAws_json1_1StartOnDemandAppReplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.description !== undefined && { description: input.description }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), }; }; @@ -4421,8 +4497,9 @@ const serializeAws_json1_1StartOnDemandReplicationRunRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.replicationJobId !== undefined && { replicationJobId: input.replicationJobId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.replicationJobId !== undefined && + input.replicationJobId !== null && { replicationJobId: input.replicationJobId }), }; }; @@ -4431,37 +4508,43 @@ const serializeAws_json1_1StopAppReplicationRequest = ( context: __SerdeContext ): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TerminateAppRequest = (input: TerminateAppRequest, context: __SerdeContext): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), }; }; const serializeAws_json1_1UpdateAppRequest = (input: UpdateAppRequest, context: __SerdeContext): any => { return { - ...(input.appId !== undefined && { appId: input.appId }), - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.roleName !== undefined && { roleName: input.roleName }), - ...(input.serverGroups !== undefined && { - serverGroups: serializeAws_json1_1ServerGroups(input.serverGroups, context), - }), - ...(input.tags !== undefined && { tags: serializeAws_json1_1Tags(input.tags, context) }), + ...(input.appId !== undefined && input.appId !== null && { appId: input.appId }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.roleName !== undefined && input.roleName !== null && { roleName: input.roleName }), + ...(input.serverGroups !== undefined && + input.serverGroups !== null && { serverGroups: serializeAws_json1_1ServerGroups(input.serverGroups, context) }), + ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_json1_1Tags(input.tags, context) }), }; }; @@ -4470,23 +4553,27 @@ const serializeAws_json1_1UpdateReplicationJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.encrypted !== undefined && { encrypted: input.encrypted }), - ...(input.frequency !== undefined && { frequency: input.frequency }), - ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), - ...(input.licenseType !== undefined && { licenseType: input.licenseType }), - ...(input.nextReplicationRunStartTime !== undefined && { - nextReplicationRunStartTime: Math.round(input.nextReplicationRunStartTime.getTime() / 1000), - }), - ...(input.numberOfRecentAmisToKeep !== undefined && { numberOfRecentAmisToKeep: input.numberOfRecentAmisToKeep }), - ...(input.replicationJobId !== undefined && { replicationJobId: input.replicationJobId }), - ...(input.roleName !== undefined && { roleName: input.roleName }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.encrypted !== undefined && input.encrypted !== null && { encrypted: input.encrypted }), + ...(input.frequency !== undefined && input.frequency !== null && { frequency: input.frequency }), + ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }), + ...(input.licenseType !== undefined && input.licenseType !== null && { licenseType: input.licenseType }), + ...(input.nextReplicationRunStartTime !== undefined && + input.nextReplicationRunStartTime !== null && { + nextReplicationRunStartTime: Math.round(input.nextReplicationRunStartTime.getTime() / 1000), + }), + ...(input.numberOfRecentAmisToKeep !== undefined && + input.numberOfRecentAmisToKeep !== null && { numberOfRecentAmisToKeep: input.numberOfRecentAmisToKeep }), + ...(input.replicationJobId !== undefined && + input.replicationJobId !== null && { replicationJobId: input.replicationJobId }), + ...(input.roleName !== undefined && input.roleName !== null && { roleName: input.roleName }), }; }; const serializeAws_json1_1UserData = (input: UserData, context: __SerdeContext): any => { return { - ...(input.s3Location !== undefined && { s3Location: serializeAws_json1_1S3Location(input.s3Location, context) }), + ...(input.s3Location !== undefined && + input.s3Location !== null && { s3Location: serializeAws_json1_1S3Location(input.s3Location, context) }), }; }; @@ -4495,36 +4582,52 @@ const serializeAws_json1_1UserDataValidationParameters = ( context: __SerdeContext ): any => { return { - ...(input.scriptType !== undefined && { scriptType: input.scriptType }), - ...(input.source !== undefined && { source: serializeAws_json1_1Source(input.source, context) }), + ...(input.scriptType !== undefined && input.scriptType !== null && { scriptType: input.scriptType }), + ...(input.source !== undefined && + input.source !== null && { source: serializeAws_json1_1Source(input.source, context) }), }; }; const serializeAws_json1_1VmServer = (input: VmServer, context: __SerdeContext): any => { return { - ...(input.vmManagerName !== undefined && { vmManagerName: input.vmManagerName }), - ...(input.vmManagerType !== undefined && { vmManagerType: input.vmManagerType }), - ...(input.vmName !== undefined && { vmName: input.vmName }), - ...(input.vmPath !== undefined && { vmPath: input.vmPath }), - ...(input.vmServerAddress !== undefined && { - vmServerAddress: serializeAws_json1_1VmServerAddress(input.vmServerAddress, context), - }), + ...(input.vmManagerName !== undefined && input.vmManagerName !== null && { vmManagerName: input.vmManagerName }), + ...(input.vmManagerType !== undefined && input.vmManagerType !== null && { vmManagerType: input.vmManagerType }), + ...(input.vmName !== undefined && input.vmName !== null && { vmName: input.vmName }), + ...(input.vmPath !== undefined && input.vmPath !== null && { vmPath: input.vmPath }), + ...(input.vmServerAddress !== undefined && + input.vmServerAddress !== null && { + vmServerAddress: serializeAws_json1_1VmServerAddress(input.vmServerAddress, context), + }), }; }; const serializeAws_json1_1VmServerAddress = (input: VmServerAddress, context: __SerdeContext): any => { return { - ...(input.vmId !== undefined && { vmId: input.vmId }), - ...(input.vmManagerId !== undefined && { vmManagerId: input.vmManagerId }), + ...(input.vmId !== undefined && input.vmId !== null && { vmId: input.vmId }), + ...(input.vmManagerId !== undefined && input.vmManagerId !== null && { vmManagerId: input.vmManagerId }), }; }; const serializeAws_json1_1VmServerAddressList = (input: VmServerAddress[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1VmServerAddress(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1VmServerAddress(entry, context); + }); }; const deserializeAws_json1_1Apps = (output: any, context: __SerdeContext): AppSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AppSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AppSummary(entry, context); + }); }; const deserializeAws_json1_1AppSummary = (output: any, context: __SerdeContext): AppSummary => { @@ -4605,7 +4708,14 @@ const deserializeAws_json1_1AppValidationConfigurations = ( output: any, context: __SerdeContext ): AppValidationConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AppValidationConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AppValidationConfiguration(entry, context); + }); }; const deserializeAws_json1_1AppValidationOutput = (output: any, context: __SerdeContext): AppValidationOutput => { @@ -4644,11 +4754,25 @@ const deserializeAws_json1_1ConnectorCapabilityList = ( output: any, context: __SerdeContext ): (ConnectorCapability | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ConnectorList = (output: any, context: __SerdeContext): Connector[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Connector(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Connector(entry, context); + }); }; const deserializeAws_json1_1CreateAppResponse = (output: any, context: __SerdeContext): CreateAppResponse => { @@ -5043,7 +5167,14 @@ const deserializeAws_json1_1ReplicationJobAlreadyExistsException = ( }; const deserializeAws_json1_1ReplicationJobList = (output: any, context: __SerdeContext): ReplicationJob[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationJob(entry, context); + }); }; const deserializeAws_json1_1ReplicationJobNotFoundException = ( @@ -5092,7 +5223,14 @@ const deserializeAws_json1_1ReplicationRunLimitExceededException = ( }; const deserializeAws_json1_1ReplicationRunList = (output: any, context: __SerdeContext): ReplicationRun[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ReplicationRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ReplicationRun(entry, context); + }); }; const deserializeAws_json1_1ReplicationRunStageDetails = ( @@ -5170,7 +5308,14 @@ const deserializeAws_json1_1ServerGroupLaunchConfigurations = ( output: any, context: __SerdeContext ): ServerGroupLaunchConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServerGroupLaunchConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServerGroupLaunchConfiguration(entry, context); + }); }; const deserializeAws_json1_1ServerGroupReplicationConfiguration = ( @@ -5191,11 +5336,25 @@ const deserializeAws_json1_1ServerGroupReplicationConfigurations = ( output: any, context: __SerdeContext ): ServerGroupReplicationConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServerGroupReplicationConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServerGroupReplicationConfiguration(entry, context); + }); }; const deserializeAws_json1_1ServerGroups = (output: any, context: __SerdeContext): ServerGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServerGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServerGroup(entry, context); + }); }; const deserializeAws_json1_1ServerGroupValidationConfiguration = ( @@ -5216,7 +5375,14 @@ const deserializeAws_json1_1ServerGroupValidationConfigurations = ( output: any, context: __SerdeContext ): ServerGroupValidationConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServerGroupValidationConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServerGroupValidationConfiguration(entry, context); + }); }; const deserializeAws_json1_1ServerLaunchConfiguration = ( @@ -5262,11 +5428,25 @@ const deserializeAws_json1_1ServerLaunchConfigurations = ( output: any, context: __SerdeContext ): ServerLaunchConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServerLaunchConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServerLaunchConfiguration(entry, context); + }); }; const deserializeAws_json1_1ServerList = (output: any, context: __SerdeContext): Server[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Server(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Server(entry, context); + }); }; const deserializeAws_json1_1ServerReplicationConfiguration = ( @@ -5289,7 +5469,14 @@ const deserializeAws_json1_1ServerReplicationConfigurations = ( output: any, context: __SerdeContext ): ServerReplicationConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServerReplicationConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServerReplicationConfiguration(entry, context); + }); }; const deserializeAws_json1_1ServerReplicationParameters = ( @@ -5339,7 +5526,14 @@ const deserializeAws_json1_1ServerValidationConfigurations = ( output: any, context: __SerdeContext ): ServerValidationConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ServerValidationConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ServerValidationConfiguration(entry, context); + }); }; const deserializeAws_json1_1ServerValidationOutput = (output: any, context: __SerdeContext): ServerValidationOutput => { @@ -5431,7 +5625,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TemporarilyUnavailableException = ( @@ -5521,7 +5722,14 @@ const deserializeAws_json1_1ValidationOutput = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ValidationOutputList = (output: any, context: __SerdeContext): ValidationOutput[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ValidationOutput(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ValidationOutput(entry, context); + }); }; const deserializeAws_json1_1VmServer = (output: any, context: __SerdeContext): VmServer => { @@ -5596,3 +5804,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-snowball/protocols/Aws_json1_1.ts b/clients/client-snowball/protocols/Aws_json1_1.ts index 9d366d5cc8ed..90b530cfdfc9 100644 --- a/clients/client-snowball/protocols/Aws_json1_1.ts +++ b/clients/client-snowball/protocols/Aws_json1_1.ts @@ -127,7 +127,7 @@ export const serializeAws_json1_1CancelClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.CancelCluster", }; let body: any; @@ -140,7 +140,7 @@ export const serializeAws_json1_1CancelJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.CancelJob", }; let body: any; @@ -153,7 +153,7 @@ export const serializeAws_json1_1CreateAddressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.CreateAddress", }; let body: any; @@ -166,7 +166,7 @@ export const serializeAws_json1_1CreateClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.CreateCluster", }; let body: any; @@ -179,7 +179,7 @@ export const serializeAws_json1_1CreateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.CreateJob", }; let body: any; @@ -192,7 +192,7 @@ export const serializeAws_json1_1CreateReturnShippingLabelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.CreateReturnShippingLabel", }; let body: any; @@ -205,7 +205,7 @@ export const serializeAws_json1_1DescribeAddressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.DescribeAddress", }; let body: any; @@ -218,7 +218,7 @@ export const serializeAws_json1_1DescribeAddressesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.DescribeAddresses", }; let body: any; @@ -231,7 +231,7 @@ export const serializeAws_json1_1DescribeClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.DescribeCluster", }; let body: any; @@ -244,7 +244,7 @@ export const serializeAws_json1_1DescribeJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.DescribeJob", }; let body: any; @@ -257,7 +257,7 @@ export const serializeAws_json1_1DescribeReturnShippingLabelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.DescribeReturnShippingLabel", }; let body: any; @@ -270,7 +270,7 @@ export const serializeAws_json1_1GetJobManifestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.GetJobManifest", }; let body: any; @@ -283,7 +283,7 @@ export const serializeAws_json1_1GetJobUnlockCodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.GetJobUnlockCode", }; let body: any; @@ -296,7 +296,7 @@ export const serializeAws_json1_1GetSnowballUsageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.GetSnowballUsage", }; let body: any; @@ -309,7 +309,7 @@ export const serializeAws_json1_1GetSoftwareUpdatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.GetSoftwareUpdates", }; let body: any; @@ -322,7 +322,7 @@ export const serializeAws_json1_1ListClusterJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.ListClusterJobs", }; let body: any; @@ -335,7 +335,7 @@ export const serializeAws_json1_1ListClustersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.ListClusters", }; let body: any; @@ -348,7 +348,7 @@ export const serializeAws_json1_1ListCompatibleImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.ListCompatibleImages", }; let body: any; @@ -361,7 +361,7 @@ export const serializeAws_json1_1ListJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.ListJobs", }; let body: any; @@ -374,7 +374,7 @@ export const serializeAws_json1_1UpdateClusterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.UpdateCluster", }; let body: any; @@ -387,7 +387,7 @@ export const serializeAws_json1_1UpdateJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.UpdateJob", }; let body: any; @@ -400,7 +400,7 @@ export const serializeAws_json1_1UpdateJobShipmentStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSIESnowballJobManagementService.UpdateJobShipmentState", }; let body: any; @@ -435,8 +435,7 @@ const deserializeAws_json1_1CancelClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidJobStateException": case "com.amazonaws.snowball#InvalidJobStateException": @@ -506,8 +505,7 @@ const deserializeAws_json1_1CancelJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidJobStateException": case "com.amazonaws.snowball#InvalidJobStateException": @@ -577,8 +575,7 @@ const deserializeAws_json1_1CreateAddressCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidAddressException": case "com.amazonaws.snowball#InvalidAddressException": @@ -640,8 +637,7 @@ const deserializeAws_json1_1CreateClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "Ec2RequestFailedException": case "com.amazonaws.snowball#Ec2RequestFailedException": @@ -719,8 +715,7 @@ const deserializeAws_json1_1CreateJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterLimitExceededException": case "com.amazonaws.snowball#ClusterLimitExceededException": @@ -806,8 +801,7 @@ const deserializeAws_json1_1CreateReturnShippingLabelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.snowball#ConflictException": @@ -893,8 +887,7 @@ const deserializeAws_json1_1DescribeAddressCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceException": case "com.amazonaws.snowball#InvalidResourceException": @@ -948,8 +941,7 @@ const deserializeAws_json1_1DescribeAddressesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.snowball#InvalidNextTokenException": @@ -1011,8 +1003,7 @@ const deserializeAws_json1_1DescribeClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceException": case "com.amazonaws.snowball#InvalidResourceException": @@ -1066,8 +1057,7 @@ const deserializeAws_json1_1DescribeJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidResourceException": case "com.amazonaws.snowball#InvalidResourceException": @@ -1121,8 +1111,7 @@ const deserializeAws_json1_1DescribeReturnShippingLabelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.snowball#ConflictException": @@ -1192,8 +1181,7 @@ const deserializeAws_json1_1GetJobManifestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidJobStateException": case "com.amazonaws.snowball#InvalidJobStateException": @@ -1255,8 +1243,7 @@ const deserializeAws_json1_1GetJobUnlockCodeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidJobStateException": case "com.amazonaws.snowball#InvalidJobStateException": @@ -1318,8 +1305,7 @@ const deserializeAws_json1_1GetSnowballUsageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -1365,8 +1351,7 @@ const deserializeAws_json1_1GetSoftwareUpdatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidJobStateException": case "com.amazonaws.snowball#InvalidJobStateException": @@ -1428,8 +1413,7 @@ const deserializeAws_json1_1ListClusterJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.snowball#InvalidNextTokenException": @@ -1491,8 +1475,7 @@ const deserializeAws_json1_1ListClustersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.snowball#InvalidNextTokenException": @@ -1546,8 +1529,7 @@ const deserializeAws_json1_1ListCompatibleImagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "Ec2RequestFailedException": case "com.amazonaws.snowball#Ec2RequestFailedException": @@ -1609,8 +1591,7 @@ const deserializeAws_json1_1ListJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidNextTokenException": case "com.amazonaws.snowball#InvalidNextTokenException": @@ -1664,8 +1645,7 @@ const deserializeAws_json1_1UpdateClusterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "Ec2RequestFailedException": case "com.amazonaws.snowball#Ec2RequestFailedException": @@ -1751,8 +1731,7 @@ const deserializeAws_json1_1UpdateJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ClusterLimitExceededException": case "com.amazonaws.snowball#ClusterLimitExceededException": @@ -1846,8 +1825,7 @@ const deserializeAws_json1_1UpdateJobShipmentStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidJobStateException": case "com.amazonaws.snowball#InvalidJobStateException": @@ -2049,85 +2027,90 @@ const deserializeAws_json1_1UnsupportedAddressExceptionResponse = async ( const serializeAws_json1_1Address = (input: Address, context: __SerdeContext): any => { return { - ...(input.AddressId !== undefined && { AddressId: input.AddressId }), - ...(input.City !== undefined && { City: input.City }), - ...(input.Company !== undefined && { Company: input.Company }), - ...(input.Country !== undefined && { Country: input.Country }), - ...(input.IsRestricted !== undefined && { IsRestricted: input.IsRestricted }), - ...(input.Landmark !== undefined && { Landmark: input.Landmark }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }), - ...(input.PostalCode !== undefined && { PostalCode: input.PostalCode }), - ...(input.PrefectureOrDistrict !== undefined && { PrefectureOrDistrict: input.PrefectureOrDistrict }), - ...(input.StateOrProvince !== undefined && { StateOrProvince: input.StateOrProvince }), - ...(input.Street1 !== undefined && { Street1: input.Street1 }), - ...(input.Street2 !== undefined && { Street2: input.Street2 }), - ...(input.Street3 !== undefined && { Street3: input.Street3 }), + ...(input.AddressId !== undefined && input.AddressId !== null && { AddressId: input.AddressId }), + ...(input.City !== undefined && input.City !== null && { City: input.City }), + ...(input.Company !== undefined && input.Company !== null && { Company: input.Company }), + ...(input.Country !== undefined && input.Country !== null && { Country: input.Country }), + ...(input.IsRestricted !== undefined && input.IsRestricted !== null && { IsRestricted: input.IsRestricted }), + ...(input.Landmark !== undefined && input.Landmark !== null && { Landmark: input.Landmark }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PhoneNumber !== undefined && input.PhoneNumber !== null && { PhoneNumber: input.PhoneNumber }), + ...(input.PostalCode !== undefined && input.PostalCode !== null && { PostalCode: input.PostalCode }), + ...(input.PrefectureOrDistrict !== undefined && + input.PrefectureOrDistrict !== null && { PrefectureOrDistrict: input.PrefectureOrDistrict }), + ...(input.StateOrProvince !== undefined && + input.StateOrProvince !== null && { StateOrProvince: input.StateOrProvince }), + ...(input.Street1 !== undefined && input.Street1 !== null && { Street1: input.Street1 }), + ...(input.Street2 !== undefined && input.Street2 !== null && { Street2: input.Street2 }), + ...(input.Street3 !== undefined && input.Street3 !== null && { Street3: input.Street3 }), }; }; const serializeAws_json1_1CancelClusterRequest = (input: CancelClusterRequest, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), }; }; const serializeAws_json1_1CancelJobRequest = (input: CancelJobRequest, context: __SerdeContext): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; const serializeAws_json1_1CreateAddressRequest = (input: CreateAddressRequest, context: __SerdeContext): any => { return { - ...(input.Address !== undefined && { Address: serializeAws_json1_1Address(input.Address, context) }), + ...(input.Address !== undefined && + input.Address !== null && { Address: serializeAws_json1_1Address(input.Address, context) }), }; }; const serializeAws_json1_1CreateClusterRequest = (input: CreateClusterRequest, context: __SerdeContext): any => { return { - ...(input.AddressId !== undefined && { AddressId: input.AddressId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ForwardingAddressId !== undefined && { ForwardingAddressId: input.ForwardingAddressId }), - ...(input.JobType !== undefined && { JobType: input.JobType }), - ...(input.KmsKeyARN !== undefined && { KmsKeyARN: input.KmsKeyARN }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), - ...(input.Resources !== undefined && { Resources: serializeAws_json1_1JobResource(input.Resources, context) }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.ShippingOption !== undefined && { ShippingOption: input.ShippingOption }), - ...(input.SnowballType !== undefined && { SnowballType: input.SnowballType }), - ...(input.TaxDocuments !== undefined && { - TaxDocuments: serializeAws_json1_1TaxDocuments(input.TaxDocuments, context), - }), + ...(input.AddressId !== undefined && input.AddressId !== null && { AddressId: input.AddressId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ForwardingAddressId !== undefined && + input.ForwardingAddressId !== null && { ForwardingAddressId: input.ForwardingAddressId }), + ...(input.JobType !== undefined && input.JobType !== null && { JobType: input.JobType }), + ...(input.KmsKeyARN !== undefined && input.KmsKeyARN !== null && { KmsKeyARN: input.KmsKeyARN }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_json1_1JobResource(input.Resources, context) }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.ShippingOption !== undefined && + input.ShippingOption !== null && { ShippingOption: input.ShippingOption }), + ...(input.SnowballType !== undefined && input.SnowballType !== null && { SnowballType: input.SnowballType }), + ...(input.TaxDocuments !== undefined && + input.TaxDocuments !== null && { TaxDocuments: serializeAws_json1_1TaxDocuments(input.TaxDocuments, context) }), }; }; const serializeAws_json1_1CreateJobRequest = (input: CreateJobRequest, context: __SerdeContext): any => { return { - ...(input.AddressId !== undefined && { AddressId: input.AddressId }), - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.DeviceConfiguration !== undefined && { - DeviceConfiguration: serializeAws_json1_1DeviceConfiguration(input.DeviceConfiguration, context), - }), - ...(input.ForwardingAddressId !== undefined && { ForwardingAddressId: input.ForwardingAddressId }), - ...(input.JobType !== undefined && { JobType: input.JobType }), - ...(input.KmsKeyARN !== undefined && { KmsKeyARN: input.KmsKeyARN }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), - ...(input.Resources !== undefined && { Resources: serializeAws_json1_1JobResource(input.Resources, context) }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.ShippingOption !== undefined && { ShippingOption: input.ShippingOption }), - ...(input.SnowballCapacityPreference !== undefined && { - SnowballCapacityPreference: input.SnowballCapacityPreference, - }), - ...(input.SnowballType !== undefined && { SnowballType: input.SnowballType }), - ...(input.TaxDocuments !== undefined && { - TaxDocuments: serializeAws_json1_1TaxDocuments(input.TaxDocuments, context), - }), + ...(input.AddressId !== undefined && input.AddressId !== null && { AddressId: input.AddressId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.DeviceConfiguration !== undefined && + input.DeviceConfiguration !== null && { + DeviceConfiguration: serializeAws_json1_1DeviceConfiguration(input.DeviceConfiguration, context), + }), + ...(input.ForwardingAddressId !== undefined && + input.ForwardingAddressId !== null && { ForwardingAddressId: input.ForwardingAddressId }), + ...(input.JobType !== undefined && input.JobType !== null && { JobType: input.JobType }), + ...(input.KmsKeyARN !== undefined && input.KmsKeyARN !== null && { KmsKeyARN: input.KmsKeyARN }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_json1_1JobResource(input.Resources, context) }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.ShippingOption !== undefined && + input.ShippingOption !== null && { ShippingOption: input.ShippingOption }), + ...(input.SnowballCapacityPreference !== undefined && + input.SnowballCapacityPreference !== null && { SnowballCapacityPreference: input.SnowballCapacityPreference }), + ...(input.SnowballType !== undefined && input.SnowballType !== null && { SnowballType: input.SnowballType }), + ...(input.TaxDocuments !== undefined && + input.TaxDocuments !== null && { TaxDocuments: serializeAws_json1_1TaxDocuments(input.TaxDocuments, context) }), }; }; @@ -2136,8 +2119,9 @@ const serializeAws_json1_1CreateReturnShippingLabelRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.ShippingOption !== undefined && { ShippingOption: input.ShippingOption }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.ShippingOption !== undefined && + input.ShippingOption !== null && { ShippingOption: input.ShippingOption }), }; }; @@ -2146,26 +2130,26 @@ const serializeAws_json1_1DescribeAddressesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1DescribeAddressRequest = (input: DescribeAddressRequest, context: __SerdeContext): any => { return { - ...(input.AddressId !== undefined && { AddressId: input.AddressId }), + ...(input.AddressId !== undefined && input.AddressId !== null && { AddressId: input.AddressId }), }; }; const serializeAws_json1_1DescribeClusterRequest = (input: DescribeClusterRequest, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), }; }; const serializeAws_json1_1DescribeJobRequest = (input: DescribeJobRequest, context: __SerdeContext): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -2174,35 +2158,44 @@ const serializeAws_json1_1DescribeReturnShippingLabelRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; const serializeAws_json1_1DeviceConfiguration = (input: DeviceConfiguration, context: __SerdeContext): any => { return { - ...(input.SnowconeDeviceConfiguration !== undefined && { - SnowconeDeviceConfiguration: serializeAws_json1_1SnowconeDeviceConfiguration( - input.SnowconeDeviceConfiguration, - context - ), - }), + ...(input.SnowconeDeviceConfiguration !== undefined && + input.SnowconeDeviceConfiguration !== null && { + SnowconeDeviceConfiguration: serializeAws_json1_1SnowconeDeviceConfiguration( + input.SnowconeDeviceConfiguration, + context + ), + }), }; }; const serializeAws_json1_1Ec2AmiResource = (input: Ec2AmiResource, context: __SerdeContext): any => { return { - ...(input.AmiId !== undefined && { AmiId: input.AmiId }), - ...(input.SnowballAmiId !== undefined && { SnowballAmiId: input.SnowballAmiId }), + ...(input.AmiId !== undefined && input.AmiId !== null && { AmiId: input.AmiId }), + ...(input.SnowballAmiId !== undefined && input.SnowballAmiId !== null && { SnowballAmiId: input.SnowballAmiId }), }; }; const serializeAws_json1_1Ec2AmiResourceList = (input: Ec2AmiResource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Ec2AmiResource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Ec2AmiResource(entry, context); + }); }; const serializeAws_json1_1EventTriggerDefinition = (input: EventTriggerDefinition, context: __SerdeContext): any => { return { - ...(input.EventResourceARN !== undefined && { EventResourceARN: input.EventResourceARN }), + ...(input.EventResourceARN !== undefined && + input.EventResourceARN !== null && { EventResourceARN: input.EventResourceARN }), }; }; @@ -2210,18 +2203,25 @@ const serializeAws_json1_1EventTriggerDefinitionList = ( input: EventTriggerDefinition[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1EventTriggerDefinition(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1EventTriggerDefinition(entry, context); + }); }; const serializeAws_json1_1GetJobManifestRequest = (input: GetJobManifestRequest, context: __SerdeContext): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; const serializeAws_json1_1GetJobUnlockCodeRequest = (input: GetJobUnlockCodeRequest, context: __SerdeContext): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; @@ -2234,66 +2234,82 @@ const serializeAws_json1_1GetSoftwareUpdatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; const serializeAws_json1_1INDTaxDocuments = (input: INDTaxDocuments, context: __SerdeContext): any => { return { - ...(input.GSTIN !== undefined && { GSTIN: input.GSTIN }), + ...(input.GSTIN !== undefined && input.GSTIN !== null && { GSTIN: input.GSTIN }), }; }; const serializeAws_json1_1JobResource = (input: JobResource, context: __SerdeContext): any => { return { - ...(input.Ec2AmiResources !== undefined && { - Ec2AmiResources: serializeAws_json1_1Ec2AmiResourceList(input.Ec2AmiResources, context), - }), - ...(input.LambdaResources !== undefined && { - LambdaResources: serializeAws_json1_1LambdaResourceList(input.LambdaResources, context), - }), - ...(input.S3Resources !== undefined && { - S3Resources: serializeAws_json1_1S3ResourceList(input.S3Resources, context), - }), + ...(input.Ec2AmiResources !== undefined && + input.Ec2AmiResources !== null && { + Ec2AmiResources: serializeAws_json1_1Ec2AmiResourceList(input.Ec2AmiResources, context), + }), + ...(input.LambdaResources !== undefined && + input.LambdaResources !== null && { + LambdaResources: serializeAws_json1_1LambdaResourceList(input.LambdaResources, context), + }), + ...(input.S3Resources !== undefined && + input.S3Resources !== null && { S3Resources: serializeAws_json1_1S3ResourceList(input.S3Resources, context) }), }; }; const serializeAws_json1_1JobStateList = (input: (JobState | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1KeyRange = (input: KeyRange, context: __SerdeContext): any => { return { - ...(input.BeginMarker !== undefined && { BeginMarker: input.BeginMarker }), - ...(input.EndMarker !== undefined && { EndMarker: input.EndMarker }), + ...(input.BeginMarker !== undefined && input.BeginMarker !== null && { BeginMarker: input.BeginMarker }), + ...(input.EndMarker !== undefined && input.EndMarker !== null && { EndMarker: input.EndMarker }), }; }; const serializeAws_json1_1LambdaResource = (input: LambdaResource, context: __SerdeContext): any => { return { - ...(input.EventTriggers !== undefined && { - EventTriggers: serializeAws_json1_1EventTriggerDefinitionList(input.EventTriggers, context), - }), - ...(input.LambdaArn !== undefined && { LambdaArn: input.LambdaArn }), + ...(input.EventTriggers !== undefined && + input.EventTriggers !== null && { + EventTriggers: serializeAws_json1_1EventTriggerDefinitionList(input.EventTriggers, context), + }), + ...(input.LambdaArn !== undefined && input.LambdaArn !== null && { LambdaArn: input.LambdaArn }), }; }; const serializeAws_json1_1LambdaResourceList = (input: LambdaResource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1LambdaResource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1LambdaResource(entry, context); + }); }; const serializeAws_json1_1ListClusterJobsRequest = (input: ListClusterJobsRequest, context: __SerdeContext): any => { return { - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListClustersRequest = (input: ListClustersRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2302,37 +2318,46 @@ const serializeAws_json1_1ListCompatibleImagesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListJobsRequest = (input: ListJobsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1Notification = (input: Notification, context: __SerdeContext): any => { return { - ...(input.JobStatesToNotify !== undefined && { - JobStatesToNotify: serializeAws_json1_1JobStateList(input.JobStatesToNotify, context), - }), - ...(input.NotifyAll !== undefined && { NotifyAll: input.NotifyAll }), - ...(input.SnsTopicARN !== undefined && { SnsTopicARN: input.SnsTopicARN }), + ...(input.JobStatesToNotify !== undefined && + input.JobStatesToNotify !== null && { + JobStatesToNotify: serializeAws_json1_1JobStateList(input.JobStatesToNotify, context), + }), + ...(input.NotifyAll !== undefined && input.NotifyAll !== null && { NotifyAll: input.NotifyAll }), + ...(input.SnsTopicARN !== undefined && input.SnsTopicARN !== null && { SnsTopicARN: input.SnsTopicARN }), }; }; const serializeAws_json1_1S3Resource = (input: S3Resource, context: __SerdeContext): any => { return { - ...(input.BucketArn !== undefined && { BucketArn: input.BucketArn }), - ...(input.KeyRange !== undefined && { KeyRange: serializeAws_json1_1KeyRange(input.KeyRange, context) }), + ...(input.BucketArn !== undefined && input.BucketArn !== null && { BucketArn: input.BucketArn }), + ...(input.KeyRange !== undefined && + input.KeyRange !== null && { KeyRange: serializeAws_json1_1KeyRange(input.KeyRange, context) }), }; }; const serializeAws_json1_1S3ResourceList = (input: S3Resource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1S3Resource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1S3Resource(entry, context); + }); }; const serializeAws_json1_1SnowconeDeviceConfiguration = ( @@ -2340,48 +2365,53 @@ const serializeAws_json1_1SnowconeDeviceConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.WirelessConnection !== undefined && { - WirelessConnection: serializeAws_json1_1WirelessConnection(input.WirelessConnection, context), - }), + ...(input.WirelessConnection !== undefined && + input.WirelessConnection !== null && { + WirelessConnection: serializeAws_json1_1WirelessConnection(input.WirelessConnection, context), + }), }; }; const serializeAws_json1_1TaxDocuments = (input: TaxDocuments, context: __SerdeContext): any => { return { - ...(input.IND !== undefined && { IND: serializeAws_json1_1INDTaxDocuments(input.IND, context) }), + ...(input.IND !== undefined && + input.IND !== null && { IND: serializeAws_json1_1INDTaxDocuments(input.IND, context) }), }; }; const serializeAws_json1_1UpdateClusterRequest = (input: UpdateClusterRequest, context: __SerdeContext): any => { return { - ...(input.AddressId !== undefined && { AddressId: input.AddressId }), - ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ForwardingAddressId !== undefined && { ForwardingAddressId: input.ForwardingAddressId }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), - ...(input.Resources !== undefined && { Resources: serializeAws_json1_1JobResource(input.Resources, context) }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.ShippingOption !== undefined && { ShippingOption: input.ShippingOption }), + ...(input.AddressId !== undefined && input.AddressId !== null && { AddressId: input.AddressId }), + ...(input.ClusterId !== undefined && input.ClusterId !== null && { ClusterId: input.ClusterId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ForwardingAddressId !== undefined && + input.ForwardingAddressId !== null && { ForwardingAddressId: input.ForwardingAddressId }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_json1_1JobResource(input.Resources, context) }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.ShippingOption !== undefined && + input.ShippingOption !== null && { ShippingOption: input.ShippingOption }), }; }; const serializeAws_json1_1UpdateJobRequest = (input: UpdateJobRequest, context: __SerdeContext): any => { return { - ...(input.AddressId !== undefined && { AddressId: input.AddressId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ForwardingAddressId !== undefined && { ForwardingAddressId: input.ForwardingAddressId }), - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.Notification !== undefined && { - Notification: serializeAws_json1_1Notification(input.Notification, context), - }), - ...(input.Resources !== undefined && { Resources: serializeAws_json1_1JobResource(input.Resources, context) }), - ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }), - ...(input.ShippingOption !== undefined && { ShippingOption: input.ShippingOption }), - ...(input.SnowballCapacityPreference !== undefined && { - SnowballCapacityPreference: input.SnowballCapacityPreference, - }), + ...(input.AddressId !== undefined && input.AddressId !== null && { AddressId: input.AddressId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ForwardingAddressId !== undefined && + input.ForwardingAddressId !== null && { ForwardingAddressId: input.ForwardingAddressId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.Notification !== undefined && + input.Notification !== null && { Notification: serializeAws_json1_1Notification(input.Notification, context) }), + ...(input.Resources !== undefined && + input.Resources !== null && { Resources: serializeAws_json1_1JobResource(input.Resources, context) }), + ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }), + ...(input.ShippingOption !== undefined && + input.ShippingOption !== null && { ShippingOption: input.ShippingOption }), + ...(input.SnowballCapacityPreference !== undefined && + input.SnowballCapacityPreference !== null && { SnowballCapacityPreference: input.SnowballCapacityPreference }), }; }; @@ -2390,14 +2420,14 @@ const serializeAws_json1_1UpdateJobShipmentStateRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.ShipmentState !== undefined && { ShipmentState: input.ShipmentState }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.ShipmentState !== undefined && input.ShipmentState !== null && { ShipmentState: input.ShipmentState }), }; }; const serializeAws_json1_1WirelessConnection = (input: WirelessConnection, context: __SerdeContext): any => { return { - ...(input.IsWifiEnabled !== undefined && { IsWifiEnabled: input.IsWifiEnabled }), + ...(input.IsWifiEnabled !== undefined && input.IsWifiEnabled !== null && { IsWifiEnabled: input.IsWifiEnabled }), }; }; @@ -2425,7 +2455,14 @@ const deserializeAws_json1_1Address = (output: any, context: __SerdeContext): Ad }; const deserializeAws_json1_1AddressList = (output: any, context: __SerdeContext): Address[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Address(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Address(entry, context); + }); }; const deserializeAws_json1_1CancelClusterResult = (output: any, context: __SerdeContext): CancelClusterResult => { @@ -2458,7 +2495,14 @@ const deserializeAws_json1_1ClusterListEntry = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ClusterListEntryList = (output: any, context: __SerdeContext): ClusterListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ClusterListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ClusterListEntry(entry, context); + }); }; const deserializeAws_json1_1ClusterMetadata = (output: any, context: __SerdeContext): ClusterMetadata => { @@ -2504,7 +2548,14 @@ const deserializeAws_json1_1CompatibleImage = (output: any, context: __SerdeCont }; const deserializeAws_json1_1CompatibleImageList = (output: any, context: __SerdeContext): CompatibleImage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CompatibleImage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CompatibleImage(entry, context); + }); }; const deserializeAws_json1_1ConflictException = (output: any, context: __SerdeContext): ConflictException => { @@ -2630,7 +2681,14 @@ const deserializeAws_json1_1Ec2AmiResource = (output: any, context: __SerdeConte }; const deserializeAws_json1_1Ec2AmiResourceList = (output: any, context: __SerdeContext): Ec2AmiResource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Ec2AmiResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Ec2AmiResource(entry, context); + }); }; const deserializeAws_json1_1Ec2RequestFailedException = ( @@ -2653,7 +2711,14 @@ const deserializeAws_json1_1EventTriggerDefinitionList = ( output: any, context: __SerdeContext ): EventTriggerDefinition[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EventTriggerDefinition(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EventTriggerDefinition(entry, context); + }); }; const deserializeAws_json1_1GetJobManifestResult = (output: any, context: __SerdeContext): GetJobManifestResult => { @@ -2754,7 +2819,14 @@ const deserializeAws_json1_1JobListEntry = (output: any, context: __SerdeContext }; const deserializeAws_json1_1JobListEntryList = (output: any, context: __SerdeContext): JobListEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1JobListEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1JobListEntry(entry, context); + }); }; const deserializeAws_json1_1JobLogs = (output: any, context: __SerdeContext): JobLogs => { @@ -2825,7 +2897,14 @@ const deserializeAws_json1_1JobMetadata = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1JobMetadataList = (output: any, context: __SerdeContext): JobMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1JobMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1JobMetadata(entry, context); + }); }; const deserializeAws_json1_1JobResource = (output: any, context: __SerdeContext): JobResource => { @@ -2846,7 +2925,14 @@ const deserializeAws_json1_1JobResource = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1JobStateList = (output: any, context: __SerdeContext): (JobState | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1KeyRange = (output: any, context: __SerdeContext): KeyRange => { @@ -2876,7 +2962,14 @@ const deserializeAws_json1_1LambdaResource = (output: any, context: __SerdeConte }; const deserializeAws_json1_1LambdaResourceList = (output: any, context: __SerdeContext): LambdaResource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LambdaResource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LambdaResource(entry, context); + }); }; const deserializeAws_json1_1ListClusterJobsResult = (output: any, context: __SerdeContext): ListClusterJobsResult => { @@ -2953,7 +3046,14 @@ const deserializeAws_json1_1S3Resource = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1S3ResourceList = (output: any, context: __SerdeContext): S3Resource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1S3Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1S3Resource(entry, context); + }); }; const deserializeAws_json1_1Shipment = (output: any, context: __SerdeContext): Shipment => { @@ -3081,3 +3181,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-sns/protocols/Aws_query.ts b/clients/client-sns/protocols/Aws_query.ts index 97764a6565fa..7216265db921 100644 --- a/clients/client-sns/protocols/Aws_query.ts +++ b/clients/client-sns/protocols/Aws_query.ts @@ -187,7 +187,7 @@ export const serializeAws_queryAddPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -203,7 +203,7 @@ export const serializeAws_queryCheckIfPhoneNumberIsOptedOutCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -219,7 +219,7 @@ export const serializeAws_queryConfirmSubscriptionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -235,7 +235,7 @@ export const serializeAws_queryCreatePlatformApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -251,7 +251,7 @@ export const serializeAws_queryCreatePlatformEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -267,7 +267,7 @@ export const serializeAws_queryCreateTopicCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -283,7 +283,7 @@ export const serializeAws_queryDeleteEndpointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -299,7 +299,7 @@ export const serializeAws_queryDeletePlatformApplicationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -315,7 +315,7 @@ export const serializeAws_queryDeleteTopicCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -331,7 +331,7 @@ export const serializeAws_queryGetEndpointAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -347,7 +347,7 @@ export const serializeAws_queryGetPlatformApplicationAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -363,7 +363,7 @@ export const serializeAws_queryGetSMSAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -379,7 +379,7 @@ export const serializeAws_queryGetSubscriptionAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -395,7 +395,7 @@ export const serializeAws_queryGetTopicAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -411,7 +411,7 @@ export const serializeAws_queryListEndpointsByPlatformApplicationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -427,7 +427,7 @@ export const serializeAws_queryListPhoneNumbersOptedOutCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -443,7 +443,7 @@ export const serializeAws_queryListPlatformApplicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -459,7 +459,7 @@ export const serializeAws_queryListSubscriptionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -475,7 +475,7 @@ export const serializeAws_queryListSubscriptionsByTopicCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -491,7 +491,7 @@ export const serializeAws_queryListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -507,7 +507,7 @@ export const serializeAws_queryListTopicsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -523,7 +523,7 @@ export const serializeAws_queryOptInPhoneNumberCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -539,7 +539,7 @@ export const serializeAws_queryPublishCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -555,7 +555,7 @@ export const serializeAws_queryRemovePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -571,7 +571,7 @@ export const serializeAws_querySetEndpointAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -587,7 +587,7 @@ export const serializeAws_querySetPlatformApplicationAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -603,7 +603,7 @@ export const serializeAws_querySetSMSAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -619,7 +619,7 @@ export const serializeAws_querySetSubscriptionAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -635,7 +635,7 @@ export const serializeAws_querySetTopicAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -651,7 +651,7 @@ export const serializeAws_querySubscribeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -667,7 +667,7 @@ export const serializeAws_queryTagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -683,7 +683,7 @@ export const serializeAws_queryUnsubscribeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -699,7 +699,7 @@ export const serializeAws_queryUntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -3833,6 +3833,9 @@ const serializeAws_queryActionsList = (input: string[], context: __SerdeContext) const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3841,20 +3844,20 @@ const serializeAws_queryActionsList = (input: string[], context: __SerdeContext) const serializeAws_queryAddPermissionInput = (input: AddPermissionInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.Label !== undefined) { + if (input.Label !== undefined && input.Label !== null) { entries["Label"] = input.Label; } - if (input.AWSAccountId !== undefined) { + if (input.AWSAccountId !== undefined && input.AWSAccountId !== null) { const memberEntries = serializeAws_queryDelegatesList(input.AWSAccountId, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AWSAccountId.${key}`; entries[loc] = value; }); } - if (input.ActionName !== undefined) { + if (input.ActionName !== undefined && input.ActionName !== null) { const memberEntries = serializeAws_queryActionsList(input.ActionName, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ActionName.${key}`; @@ -3869,7 +3872,7 @@ const serializeAws_queryCheckIfPhoneNumberIsOptedOutInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.phoneNumber !== undefined) { + if (input.phoneNumber !== undefined && input.phoneNumber !== null) { entries["phoneNumber"] = input.phoneNumber; } return entries; @@ -3877,13 +3880,13 @@ const serializeAws_queryCheckIfPhoneNumberIsOptedOutInput = ( const serializeAws_queryConfirmSubscriptionInput = (input: ConfirmSubscriptionInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.Token !== undefined) { + if (input.Token !== undefined && input.Token !== null) { entries["Token"] = input.Token; } - if (input.AuthenticateOnUnsubscribe !== undefined) { + if (input.AuthenticateOnUnsubscribe !== undefined && input.AuthenticateOnUnsubscribe !== null) { entries["AuthenticateOnUnsubscribe"] = input.AuthenticateOnUnsubscribe; } return entries; @@ -3894,13 +3897,13 @@ const serializeAws_queryCreatePlatformApplicationInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Platform !== undefined) { + if (input.Platform !== undefined && input.Platform !== null) { entries["Platform"] = input.Platform; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_queryMapStringToString(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attributes.${key}`; @@ -3915,16 +3918,16 @@ const serializeAws_queryCreatePlatformEndpointInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PlatformApplicationArn !== undefined) { + if (input.PlatformApplicationArn !== undefined && input.PlatformApplicationArn !== null) { entries["PlatformApplicationArn"] = input.PlatformApplicationArn; } - if (input.Token !== undefined) { + if (input.Token !== undefined && input.Token !== null) { entries["Token"] = input.Token; } - if (input.CustomUserData !== undefined) { + if (input.CustomUserData !== undefined && input.CustomUserData !== null) { entries["CustomUserData"] = input.CustomUserData; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_queryMapStringToString(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attributes.${key}`; @@ -3936,17 +3939,17 @@ const serializeAws_queryCreatePlatformEndpointInput = ( const serializeAws_queryCreateTopicInput = (input: CreateTopicInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_queryTopicAttributesMap(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attributes.${key}`; entries[loc] = value; }); } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -3960,6 +3963,9 @@ const serializeAws_queryDelegatesList = (input: string[], context: __SerdeContex const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -3968,7 +3974,7 @@ const serializeAws_queryDelegatesList = (input: string[], context: __SerdeContex const serializeAws_queryDeleteEndpointInput = (input: DeleteEndpointInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.EndpointArn !== undefined) { + if (input.EndpointArn !== undefined && input.EndpointArn !== null) { entries["EndpointArn"] = input.EndpointArn; } return entries; @@ -3979,7 +3985,7 @@ const serializeAws_queryDeletePlatformApplicationInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PlatformApplicationArn !== undefined) { + if (input.PlatformApplicationArn !== undefined && input.PlatformApplicationArn !== null) { entries["PlatformApplicationArn"] = input.PlatformApplicationArn; } return entries; @@ -3987,7 +3993,7 @@ const serializeAws_queryDeletePlatformApplicationInput = ( const serializeAws_queryDeleteTopicInput = (input: DeleteTopicInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } return entries; @@ -3998,7 +4004,7 @@ const serializeAws_queryGetEndpointAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EndpointArn !== undefined) { + if (input.EndpointArn !== undefined && input.EndpointArn !== null) { entries["EndpointArn"] = input.EndpointArn; } return entries; @@ -4009,7 +4015,7 @@ const serializeAws_queryGetPlatformApplicationAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PlatformApplicationArn !== undefined) { + if (input.PlatformApplicationArn !== undefined && input.PlatformApplicationArn !== null) { entries["PlatformApplicationArn"] = input.PlatformApplicationArn; } return entries; @@ -4017,7 +4023,7 @@ const serializeAws_queryGetPlatformApplicationAttributesInput = ( const serializeAws_queryGetSMSAttributesInput = (input: GetSMSAttributesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.attributes !== undefined) { + if (input.attributes !== undefined && input.attributes !== null) { const memberEntries = serializeAws_queryListString(input.attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `attributes.${key}`; @@ -4032,7 +4038,7 @@ const serializeAws_queryGetSubscriptionAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionArn !== undefined) { + if (input.SubscriptionArn !== undefined && input.SubscriptionArn !== null) { entries["SubscriptionArn"] = input.SubscriptionArn; } return entries; @@ -4040,7 +4046,7 @@ const serializeAws_queryGetSubscriptionAttributesInput = ( const serializeAws_queryGetTopicAttributesInput = (input: GetTopicAttributesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } return entries; @@ -4051,10 +4057,10 @@ const serializeAws_queryListEndpointsByPlatformApplicationInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PlatformApplicationArn !== undefined) { + if (input.PlatformApplicationArn !== undefined && input.PlatformApplicationArn !== null) { entries["PlatformApplicationArn"] = input.PlatformApplicationArn; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -4065,7 +4071,7 @@ const serializeAws_queryListPhoneNumbersOptedOutInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.nextToken !== undefined) { + if (input.nextToken !== undefined && input.nextToken !== null) { entries["nextToken"] = input.nextToken; } return entries; @@ -4076,7 +4082,7 @@ const serializeAws_queryListPlatformApplicationsInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -4086,6 +4092,9 @@ const serializeAws_queryListString = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4097,10 +4106,10 @@ const serializeAws_queryListSubscriptionsByTopicInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -4108,7 +4117,7 @@ const serializeAws_queryListSubscriptionsByTopicInput = ( const serializeAws_queryListSubscriptionsInput = (input: ListSubscriptionsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -4119,7 +4128,7 @@ const serializeAws_queryListTagsForResourceRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ResourceArn !== undefined) { + if (input.ResourceArn !== undefined && input.ResourceArn !== null) { entries["ResourceArn"] = input.ResourceArn; } return entries; @@ -4127,7 +4136,7 @@ const serializeAws_queryListTagsForResourceRequest = ( const serializeAws_queryListTopicsInput = (input: ListTopicsInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -4136,11 +4145,13 @@ const serializeAws_queryListTopicsInput = (input: ListTopicsInput, context: __Se const serializeAws_queryMapStringToString = (input: { [key: string]: string }, context: __SerdeContext): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.key`] = key; - entries[`entry.${counter}.value`] = input[key]; - counter++; - }); + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.key`] = key; + entries[`entry.${counter}.value`] = input[key]; + counter++; + }); return entries; }; @@ -4150,26 +4161,28 @@ const serializeAws_queryMessageAttributeMap = ( ): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.Name`] = key; - const memberEntries = serializeAws_queryMessageAttributeValue(input[key], context); - Object.entries(memberEntries).forEach(([key, value]) => { - entries[`entry.${counter}.Value.${key}`] = value; + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.Name`] = key; + const memberEntries = serializeAws_queryMessageAttributeValue(input[key], context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`entry.${counter}.Value.${key}`] = value; + }); + counter++; }); - counter++; - }); return entries; }; const serializeAws_queryMessageAttributeValue = (input: MessageAttributeValue, context: __SerdeContext): any => { const entries: any = {}; - if (input.DataType !== undefined) { + if (input.DataType !== undefined && input.DataType !== null) { entries["DataType"] = input.DataType; } - if (input.StringValue !== undefined) { + if (input.StringValue !== undefined && input.StringValue !== null) { entries["StringValue"] = input.StringValue; } - if (input.BinaryValue !== undefined) { + if (input.BinaryValue !== undefined && input.BinaryValue !== null) { entries["BinaryValue"] = context.base64Encoder(input.BinaryValue); } return entries; @@ -4177,7 +4190,7 @@ const serializeAws_queryMessageAttributeValue = (input: MessageAttributeValue, c const serializeAws_queryOptInPhoneNumberInput = (input: OptInPhoneNumberInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.phoneNumber !== undefined) { + if (input.phoneNumber !== undefined && input.phoneNumber !== null) { entries["phoneNumber"] = input.phoneNumber; } return entries; @@ -4185,35 +4198,35 @@ const serializeAws_queryOptInPhoneNumberInput = (input: OptInPhoneNumberInput, c const serializeAws_queryPublishInput = (input: PublishInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.TargetArn !== undefined) { + if (input.TargetArn !== undefined && input.TargetArn !== null) { entries["TargetArn"] = input.TargetArn; } - if (input.PhoneNumber !== undefined) { + if (input.PhoneNumber !== undefined && input.PhoneNumber !== null) { entries["PhoneNumber"] = input.PhoneNumber; } - if (input.Message !== undefined) { + if (input.Message !== undefined && input.Message !== null) { entries["Message"] = input.Message; } - if (input.Subject !== undefined) { + if (input.Subject !== undefined && input.Subject !== null) { entries["Subject"] = input.Subject; } - if (input.MessageStructure !== undefined) { + if (input.MessageStructure !== undefined && input.MessageStructure !== null) { entries["MessageStructure"] = input.MessageStructure; } - if (input.MessageAttributes !== undefined) { + if (input.MessageAttributes !== undefined && input.MessageAttributes !== null) { const memberEntries = serializeAws_queryMessageAttributeMap(input.MessageAttributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MessageAttributes.${key}`; entries[loc] = value; }); } - if (input.MessageDeduplicationId !== undefined) { + if (input.MessageDeduplicationId !== undefined && input.MessageDeduplicationId !== null) { entries["MessageDeduplicationId"] = input.MessageDeduplicationId; } - if (input.MessageGroupId !== undefined) { + if (input.MessageGroupId !== undefined && input.MessageGroupId !== null) { entries["MessageGroupId"] = input.MessageGroupId; } return entries; @@ -4221,10 +4234,10 @@ const serializeAws_queryPublishInput = (input: PublishInput, context: __SerdeCon const serializeAws_queryRemovePermissionInput = (input: RemovePermissionInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.Label !== undefined) { + if (input.Label !== undefined && input.Label !== null) { entries["Label"] = input.Label; } return entries; @@ -4235,10 +4248,10 @@ const serializeAws_querySetEndpointAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EndpointArn !== undefined) { + if (input.EndpointArn !== undefined && input.EndpointArn !== null) { entries["EndpointArn"] = input.EndpointArn; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_queryMapStringToString(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attributes.${key}`; @@ -4253,10 +4266,10 @@ const serializeAws_querySetPlatformApplicationAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.PlatformApplicationArn !== undefined) { + if (input.PlatformApplicationArn !== undefined && input.PlatformApplicationArn !== null) { entries["PlatformApplicationArn"] = input.PlatformApplicationArn; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_queryMapStringToString(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attributes.${key}`; @@ -4268,7 +4281,7 @@ const serializeAws_querySetPlatformApplicationAttributesInput = ( const serializeAws_querySetSMSAttributesInput = (input: SetSMSAttributesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.attributes !== undefined) { + if (input.attributes !== undefined && input.attributes !== null) { const memberEntries = serializeAws_queryMapStringToString(input.attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `attributes.${key}`; @@ -4283,13 +4296,13 @@ const serializeAws_querySetSubscriptionAttributesInput = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.SubscriptionArn !== undefined) { + if (input.SubscriptionArn !== undefined && input.SubscriptionArn !== null) { entries["SubscriptionArn"] = input.SubscriptionArn; } - if (input.AttributeName !== undefined) { + if (input.AttributeName !== undefined && input.AttributeName !== null) { entries["AttributeName"] = input.AttributeName; } - if (input.AttributeValue !== undefined) { + if (input.AttributeValue !== undefined && input.AttributeValue !== null) { entries["AttributeValue"] = input.AttributeValue; } return entries; @@ -4297,13 +4310,13 @@ const serializeAws_querySetSubscriptionAttributesInput = ( const serializeAws_querySetTopicAttributesInput = (input: SetTopicAttributesInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.AttributeName !== undefined) { + if (input.AttributeName !== undefined && input.AttributeName !== null) { entries["AttributeName"] = input.AttributeName; } - if (input.AttributeValue !== undefined) { + if (input.AttributeValue !== undefined && input.AttributeValue !== null) { entries["AttributeValue"] = input.AttributeValue; } return entries; @@ -4311,23 +4324,23 @@ const serializeAws_querySetTopicAttributesInput = (input: SetTopicAttributesInpu const serializeAws_querySubscribeInput = (input: SubscribeInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.TopicArn !== undefined) { + if (input.TopicArn !== undefined && input.TopicArn !== null) { entries["TopicArn"] = input.TopicArn; } - if (input.Protocol !== undefined) { + if (input.Protocol !== undefined && input.Protocol !== null) { entries["Protocol"] = input.Protocol; } - if (input.Endpoint !== undefined) { + if (input.Endpoint !== undefined && input.Endpoint !== null) { entries["Endpoint"] = input.Endpoint; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_querySubscriptionAttributesMap(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attributes.${key}`; entries[loc] = value; }); } - if (input.ReturnSubscriptionArn !== undefined) { + if (input.ReturnSubscriptionArn !== undefined && input.ReturnSubscriptionArn !== null) { entries["ReturnSubscriptionArn"] = input.ReturnSubscriptionArn; } return entries; @@ -4339,20 +4352,22 @@ const serializeAws_querySubscriptionAttributesMap = ( ): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.key`] = key; - entries[`entry.${counter}.value`] = input[key]; - counter++; - }); + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.key`] = key; + entries[`entry.${counter}.value`] = input[key]; + counter++; + }); return entries; }; const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -4362,6 +4377,9 @@ const serializeAws_queryTagKeyList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -4372,6 +4390,9 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -4383,10 +4404,10 @@ const serializeAws_queryTagList = (input: Tag[], context: __SerdeContext): any = const serializeAws_queryTagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceArn !== undefined) { + if (input.ResourceArn !== undefined && input.ResourceArn !== null) { entries["ResourceArn"] = input.ResourceArn; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagList(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; @@ -4399,17 +4420,19 @@ const serializeAws_queryTagResourceRequest = (input: TagResourceRequest, context const serializeAws_queryTopicAttributesMap = (input: { [key: string]: string }, context: __SerdeContext): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.key`] = key; - entries[`entry.${counter}.value`] = input[key]; - counter++; - }); + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.key`] = key; + entries[`entry.${counter}.value`] = input[key]; + counter++; + }); return entries; }; const serializeAws_queryUnsubscribeInput = (input: UnsubscribeInput, context: __SerdeContext): any => { const entries: any = {}; - if (input.SubscriptionArn !== undefined) { + if (input.SubscriptionArn !== undefined && input.SubscriptionArn !== null) { entries["SubscriptionArn"] = input.SubscriptionArn; } return entries; @@ -4417,10 +4440,10 @@ const serializeAws_queryUnsubscribeInput = (input: UnsubscribeInput, context: __ const serializeAws_queryUntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ResourceArn !== undefined) { + if (input.ResourceArn !== undefined && input.ResourceArn !== null) { entries["ResourceArn"] = input.ResourceArn; } - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKeys.${key}`; @@ -4795,14 +4818,28 @@ const deserializeAws_queryListEndpointsByPlatformApplicationResponse = ( }; const deserializeAws_queryListOfEndpoints = (output: any, context: __SerdeContext): Endpoint[] => { - return (output || []).map((entry: any) => deserializeAws_queryEndpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryEndpoint(entry, context); + }); }; const deserializeAws_queryListOfPlatformApplications = ( output: any, context: __SerdeContext ): PlatformApplication[] => { - return (output || []).map((entry: any) => deserializeAws_queryPlatformApplication(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryPlatformApplication(entry, context); + }); }; const deserializeAws_queryListPhoneNumbersOptedOutResponse = ( @@ -4931,13 +4968,15 @@ const deserializeAws_queryListTopicsResponse = (output: any, context: __SerdeCon }; const deserializeAws_queryMapStringToString = (output: any, context: __SerdeContext): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: pair["value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryNotFoundException = (output: any, context: __SerdeContext): NotFoundException => { @@ -4959,7 +4998,14 @@ const deserializeAws_queryOptInPhoneNumberResponse = ( }; const deserializeAws_queryPhoneNumberList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryPlatformApplication = (output: any, context: __SerdeContext): PlatformApplication => { @@ -5080,13 +5126,15 @@ const deserializeAws_querySubscriptionAttributesMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: pair["value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_querySubscriptionLimitExceededException = ( @@ -5103,7 +5151,14 @@ const deserializeAws_querySubscriptionLimitExceededException = ( }; const deserializeAws_querySubscriptionsList = (output: any, context: __SerdeContext): Subscription[] => { - return (output || []).map((entry: any) => deserializeAws_querySubscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySubscription(entry, context); + }); }; const deserializeAws_queryTag = (output: any, context: __SerdeContext): Tag => { @@ -5134,7 +5189,14 @@ const deserializeAws_queryTagLimitExceededException = ( }; const deserializeAws_queryTagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_queryTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTag(entry, context); + }); }; const deserializeAws_queryTagPolicyException = (output: any, context: __SerdeContext): TagPolicyException => { @@ -5173,13 +5235,15 @@ const deserializeAws_queryTopic = (output: any, context: __SerdeContext): Topic }; const deserializeAws_queryTopicAttributesMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["value"] === null) { + return acc; + } + return { ...acc, [pair["key"]]: pair["value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryTopicLimitExceededException = ( @@ -5196,7 +5260,14 @@ const deserializeAws_queryTopicLimitExceededException = ( }; const deserializeAws_queryTopicsList = (output: any, context: __SerdeContext): Topic[] => { - return (output || []).map((entry: any) => deserializeAws_queryTopic(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryTopic(entry, context); + }); }; const deserializeAws_queryUntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => { diff --git a/clients/client-sqs/protocols/Aws_query.ts b/clients/client-sqs/protocols/Aws_query.ts index ed66114c9051..49fd889139be 100644 --- a/clients/client-sqs/protocols/Aws_query.ts +++ b/clients/client-sqs/protocols/Aws_query.ts @@ -108,7 +108,7 @@ export const serializeAws_queryAddPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -124,7 +124,7 @@ export const serializeAws_queryChangeMessageVisibilityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -140,7 +140,7 @@ export const serializeAws_queryChangeMessageVisibilityBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -156,7 +156,7 @@ export const serializeAws_queryCreateQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -172,7 +172,7 @@ export const serializeAws_queryDeleteMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -188,7 +188,7 @@ export const serializeAws_queryDeleteMessageBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -204,7 +204,7 @@ export const serializeAws_queryDeleteQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -220,7 +220,7 @@ export const serializeAws_queryGetQueueAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -236,7 +236,7 @@ export const serializeAws_queryGetQueueUrlCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -252,7 +252,7 @@ export const serializeAws_queryListDeadLetterSourceQueuesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -268,7 +268,7 @@ export const serializeAws_queryListQueuesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -284,7 +284,7 @@ export const serializeAws_queryListQueueTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -300,7 +300,7 @@ export const serializeAws_queryPurgeQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -316,7 +316,7 @@ export const serializeAws_queryReceiveMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -332,7 +332,7 @@ export const serializeAws_queryRemovePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -348,7 +348,7 @@ export const serializeAws_querySendMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -364,7 +364,7 @@ export const serializeAws_querySendMessageBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -380,7 +380,7 @@ export const serializeAws_querySetQueueAttributesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -396,7 +396,7 @@ export const serializeAws_queryTagQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -412,7 +412,7 @@ export const serializeAws_queryUntagQueueCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -1800,6 +1800,9 @@ const serializeAws_queryActionNameList = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -1808,20 +1811,20 @@ const serializeAws_queryActionNameList = (input: string[], context: __SerdeConte const serializeAws_queryAddPermissionRequest = (input: AddPermissionRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Actions !== undefined) { + if (input.Actions !== undefined && input.Actions !== null) { const memberEntries = serializeAws_queryActionNameList(input.Actions, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ActionName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.Label !== undefined) { + if (input.Label !== undefined && input.Label !== null) { entries["Label"] = input.Label; } - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } - if (input.AWSAccountIds !== undefined) { + if (input.AWSAccountIds !== undefined && input.AWSAccountIds !== null) { const memberEntries = serializeAws_queryAWSAccountIdList(input.AWSAccountIds, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AWSAccountId.${key.substring(key.indexOf(".") + 1)}`; @@ -1835,6 +1838,9 @@ const serializeAws_queryAttributeNameList = (input: (QueueAttributeName | string const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -1845,6 +1851,9 @@ const serializeAws_queryAWSAccountIdList = (input: string[], context: __SerdeCon const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -1855,6 +1864,9 @@ const serializeAws_queryBinaryList = (input: Uint8Array[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`BinaryListValue.${counter}`] = context.base64Encoder(entry); counter++; } @@ -1866,10 +1878,10 @@ const serializeAws_queryChangeMessageVisibilityBatchRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } - if (input.Entries !== undefined) { + if (input.Entries !== undefined && input.Entries !== null) { const memberEntries = serializeAws_queryChangeMessageVisibilityBatchRequestEntryList(input.Entries, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ChangeMessageVisibilityBatchRequestEntry.${key.substring(key.indexOf(".") + 1)}`; @@ -1884,13 +1896,13 @@ const serializeAws_queryChangeMessageVisibilityBatchRequestEntry = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.VisibilityTimeout !== undefined) { + if (input.VisibilityTimeout !== undefined && input.VisibilityTimeout !== null) { entries["VisibilityTimeout"] = input.VisibilityTimeout; } - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { entries["Id"] = input.Id; } - if (input.ReceiptHandle !== undefined) { + if (input.ReceiptHandle !== undefined && input.ReceiptHandle !== null) { entries["ReceiptHandle"] = input.ReceiptHandle; } return entries; @@ -1903,6 +1915,9 @@ const serializeAws_queryChangeMessageVisibilityBatchRequestEntryList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryChangeMessageVisibilityBatchRequestEntry(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -1917,13 +1932,13 @@ const serializeAws_queryChangeMessageVisibilityRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } - if (input.VisibilityTimeout !== undefined) { + if (input.VisibilityTimeout !== undefined && input.VisibilityTimeout !== null) { entries["VisibilityTimeout"] = input.VisibilityTimeout; } - if (input.ReceiptHandle !== undefined) { + if (input.ReceiptHandle !== undefined && input.ReceiptHandle !== null) { entries["ReceiptHandle"] = input.ReceiptHandle; } return entries; @@ -1931,17 +1946,17 @@ const serializeAws_queryChangeMessageVisibilityRequest = ( const serializeAws_queryCreateQueueRequest = (input: CreateQueueRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.tags !== undefined) { + if (input.tags !== undefined && input.tags !== null) { const memberEntries = serializeAws_queryTagMap(input.tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tag.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.QueueName !== undefined) { + if (input.QueueName !== undefined && input.QueueName !== null) { entries["QueueName"] = input.QueueName; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_queryQueueAttributeMap(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attribute.${key.substring(key.indexOf(".") + 1)}`; @@ -1956,10 +1971,10 @@ const serializeAws_queryDeleteMessageBatchRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } - if (input.Entries !== undefined) { + if (input.Entries !== undefined && input.Entries !== null) { const memberEntries = serializeAws_queryDeleteMessageBatchRequestEntryList(input.Entries, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `DeleteMessageBatchRequestEntry.${key.substring(key.indexOf(".") + 1)}`; @@ -1974,10 +1989,10 @@ const serializeAws_queryDeleteMessageBatchRequestEntry = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.ReceiptHandle !== undefined) { + if (input.ReceiptHandle !== undefined && input.ReceiptHandle !== null) { entries["ReceiptHandle"] = input.ReceiptHandle; } - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { entries["Id"] = input.Id; } return entries; @@ -1990,6 +2005,9 @@ const serializeAws_queryDeleteMessageBatchRequestEntryList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryDeleteMessageBatchRequestEntry(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -2001,10 +2019,10 @@ const serializeAws_queryDeleteMessageBatchRequestEntryList = ( const serializeAws_queryDeleteMessageRequest = (input: DeleteMessageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.ReceiptHandle !== undefined) { + if (input.ReceiptHandle !== undefined && input.ReceiptHandle !== null) { entries["ReceiptHandle"] = input.ReceiptHandle; } - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } return entries; @@ -2012,7 +2030,7 @@ const serializeAws_queryDeleteMessageRequest = (input: DeleteMessageRequest, con const serializeAws_queryDeleteQueueRequest = (input: DeleteQueueRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } return entries; @@ -2023,10 +2041,10 @@ const serializeAws_queryGetQueueAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } - if (input.AttributeNames !== undefined) { + if (input.AttributeNames !== undefined && input.AttributeNames !== null) { const memberEntries = serializeAws_queryAttributeNameList(input.AttributeNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AttributeName.${key.substring(key.indexOf(".") + 1)}`; @@ -2038,10 +2056,10 @@ const serializeAws_queryGetQueueAttributesRequest = ( const serializeAws_queryGetQueueUrlRequest = (input: GetQueueUrlRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.QueueOwnerAWSAccountId !== undefined) { + if (input.QueueOwnerAWSAccountId !== undefined && input.QueueOwnerAWSAccountId !== null) { entries["QueueOwnerAWSAccountId"] = input.QueueOwnerAWSAccountId; } - if (input.QueueName !== undefined) { + if (input.QueueName !== undefined && input.QueueName !== null) { entries["QueueName"] = input.QueueName; } return entries; @@ -2052,13 +2070,13 @@ const serializeAws_queryListDeadLetterSourceQueuesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } return entries; @@ -2066,13 +2084,13 @@ const serializeAws_queryListDeadLetterSourceQueuesRequest = ( const serializeAws_queryListQueuesRequest = (input: ListQueuesRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.MaxResults !== undefined) { + if (input.MaxResults !== undefined && input.MaxResults !== null) { entries["MaxResults"] = input.MaxResults; } - if (input.QueueNamePrefix !== undefined) { + if (input.QueueNamePrefix !== undefined && input.QueueNamePrefix !== null) { entries["QueueNamePrefix"] = input.QueueNamePrefix; } - if (input.NextToken !== undefined) { + if (input.NextToken !== undefined && input.NextToken !== null) { entries["NextToken"] = input.NextToken; } return entries; @@ -2080,7 +2098,7 @@ const serializeAws_queryListQueuesRequest = (input: ListQueuesRequest, context: const serializeAws_queryListQueueTagsRequest = (input: ListQueueTagsRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } return entries; @@ -2090,6 +2108,9 @@ const serializeAws_queryMessageAttributeNameList = (input: string[], context: __ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -2098,27 +2119,27 @@ const serializeAws_queryMessageAttributeNameList = (input: string[], context: __ const serializeAws_queryMessageAttributeValue = (input: MessageAttributeValue, context: __SerdeContext): any => { const entries: any = {}; - if (input.BinaryListValues !== undefined) { + if (input.BinaryListValues !== undefined && input.BinaryListValues !== null) { const memberEntries = serializeAws_queryBinaryList(input.BinaryListValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BinaryListValue.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.StringListValues !== undefined) { + if (input.StringListValues !== undefined && input.StringListValues !== null) { const memberEntries = serializeAws_queryStringList(input.StringListValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StringListValue.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.DataType !== undefined) { + if (input.DataType !== undefined && input.DataType !== null) { entries["DataType"] = input.DataType; } - if (input.BinaryValue !== undefined) { + if (input.BinaryValue !== undefined && input.BinaryValue !== null) { entries["BinaryValue"] = context.base64Encoder(input.BinaryValue); } - if (input.StringValue !== undefined) { + if (input.StringValue !== undefined && input.StringValue !== null) { entries["StringValue"] = input.StringValue; } return entries; @@ -2130,14 +2151,16 @@ const serializeAws_queryMessageBodyAttributeMap = ( ): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.Name`] = key; - const memberEntries = serializeAws_queryMessageAttributeValue(input[key], context); - Object.entries(memberEntries).forEach(([key, value]) => { - entries[`entry.${counter}.Value.${key}`] = value; + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.Name`] = key; + const memberEntries = serializeAws_queryMessageAttributeValue(input[key], context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`entry.${counter}.Value.${key}`] = value; + }); + counter++; }); - counter++; - }); return entries; }; @@ -2147,14 +2170,16 @@ const serializeAws_queryMessageBodySystemAttributeMap = ( ): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.Name`] = key; - const memberEntries = serializeAws_queryMessageSystemAttributeValue(input[key], context); - Object.entries(memberEntries).forEach(([key, value]) => { - entries[`entry.${counter}.Value.${key}`] = value; + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.Name`] = key; + const memberEntries = serializeAws_queryMessageSystemAttributeValue(input[key], context); + Object.entries(memberEntries).forEach(([key, value]) => { + entries[`entry.${counter}.Value.${key}`] = value; + }); + counter++; }); - counter++; - }); return entries; }; @@ -2163,27 +2188,27 @@ const serializeAws_queryMessageSystemAttributeValue = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.DataType !== undefined) { + if (input.DataType !== undefined && input.DataType !== null) { entries["DataType"] = input.DataType; } - if (input.StringValue !== undefined) { + if (input.StringValue !== undefined && input.StringValue !== null) { entries["StringValue"] = input.StringValue; } - if (input.BinaryListValues !== undefined) { + if (input.BinaryListValues !== undefined && input.BinaryListValues !== null) { const memberEntries = serializeAws_queryBinaryList(input.BinaryListValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `BinaryListValue.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.StringListValues !== undefined) { + if (input.StringListValues !== undefined && input.StringListValues !== null) { const memberEntries = serializeAws_queryStringList(input.StringListValues, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `StringListValue.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.BinaryValue !== undefined) { + if (input.BinaryValue !== undefined && input.BinaryValue !== null) { entries["BinaryValue"] = context.base64Encoder(input.BinaryValue); } return entries; @@ -2191,7 +2216,7 @@ const serializeAws_queryMessageSystemAttributeValue = ( const serializeAws_queryPurgeQueueRequest = (input: PurgeQueueRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } return entries; @@ -2200,39 +2225,41 @@ const serializeAws_queryPurgeQueueRequest = (input: PurgeQueueRequest, context: const serializeAws_queryQueueAttributeMap = (input: { [key: string]: string }, context: __SerdeContext): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.Name`] = key; - entries[`entry.${counter}.Value`] = input[key]; - counter++; - }); + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.Name`] = key; + entries[`entry.${counter}.Value`] = input[key]; + counter++; + }); return entries; }; const serializeAws_queryReceiveMessageRequest = (input: ReceiveMessageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.VisibilityTimeout !== undefined) { + if (input.VisibilityTimeout !== undefined && input.VisibilityTimeout !== null) { entries["VisibilityTimeout"] = input.VisibilityTimeout; } - if (input.ReceiveRequestAttemptId !== undefined) { + if (input.ReceiveRequestAttemptId !== undefined && input.ReceiveRequestAttemptId !== null) { entries["ReceiveRequestAttemptId"] = input.ReceiveRequestAttemptId; } - if (input.MaxNumberOfMessages !== undefined) { + if (input.MaxNumberOfMessages !== undefined && input.MaxNumberOfMessages !== null) { entries["MaxNumberOfMessages"] = input.MaxNumberOfMessages; } - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } - if (input.WaitTimeSeconds !== undefined) { + if (input.WaitTimeSeconds !== undefined && input.WaitTimeSeconds !== null) { entries["WaitTimeSeconds"] = input.WaitTimeSeconds; } - if (input.AttributeNames !== undefined) { + if (input.AttributeNames !== undefined && input.AttributeNames !== null) { const memberEntries = serializeAws_queryAttributeNameList(input.AttributeNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `AttributeName.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MessageAttributeNames !== undefined) { + if (input.MessageAttributeNames !== undefined && input.MessageAttributeNames !== null) { const memberEntries = serializeAws_queryMessageAttributeNameList(input.MessageAttributeNames, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MessageAttributeName.${key.substring(key.indexOf(".") + 1)}`; @@ -2244,10 +2271,10 @@ const serializeAws_queryReceiveMessageRequest = (input: ReceiveMessageRequest, c const serializeAws_queryRemovePermissionRequest = (input: RemovePermissionRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Label !== undefined) { + if (input.Label !== undefined && input.Label !== null) { entries["Label"] = input.Label; } - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } return entries; @@ -2255,14 +2282,14 @@ const serializeAws_queryRemovePermissionRequest = (input: RemovePermissionReques const serializeAws_querySendMessageBatchRequest = (input: SendMessageBatchRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Entries !== undefined) { + if (input.Entries !== undefined && input.Entries !== null) { const memberEntries = serializeAws_querySendMessageBatchRequestEntryList(input.Entries, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `SendMessageBatchRequestEntry.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } return entries; @@ -2273,29 +2300,29 @@ const serializeAws_querySendMessageBatchRequestEntry = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Id !== undefined) { + if (input.Id !== undefined && input.Id !== null) { entries["Id"] = input.Id; } - if (input.MessageDeduplicationId !== undefined) { + if (input.MessageDeduplicationId !== undefined && input.MessageDeduplicationId !== null) { entries["MessageDeduplicationId"] = input.MessageDeduplicationId; } - if (input.DelaySeconds !== undefined) { + if (input.DelaySeconds !== undefined && input.DelaySeconds !== null) { entries["DelaySeconds"] = input.DelaySeconds; } - if (input.MessageGroupId !== undefined) { + if (input.MessageGroupId !== undefined && input.MessageGroupId !== null) { entries["MessageGroupId"] = input.MessageGroupId; } - if (input.MessageSystemAttributes !== undefined) { + if (input.MessageSystemAttributes !== undefined && input.MessageSystemAttributes !== null) { const memberEntries = serializeAws_queryMessageBodySystemAttributeMap(input.MessageSystemAttributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MessageSystemAttribute.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MessageBody !== undefined) { + if (input.MessageBody !== undefined && input.MessageBody !== null) { entries["MessageBody"] = input.MessageBody; } - if (input.MessageAttributes !== undefined) { + if (input.MessageAttributes !== undefined && input.MessageAttributes !== null) { const memberEntries = serializeAws_queryMessageBodyAttributeMap(input.MessageAttributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MessageAttribute.${key.substring(key.indexOf(".") + 1)}`; @@ -2312,6 +2339,9 @@ const serializeAws_querySendMessageBatchRequestEntryList = ( const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_querySendMessageBatchRequestEntry(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -2323,33 +2353,33 @@ const serializeAws_querySendMessageBatchRequestEntryList = ( const serializeAws_querySendMessageRequest = (input: SendMessageRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.MessageSystemAttributes !== undefined) { + if (input.MessageSystemAttributes !== undefined && input.MessageSystemAttributes !== null) { const memberEntries = serializeAws_queryMessageBodySystemAttributeMap(input.MessageSystemAttributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MessageSystemAttribute.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } - if (input.DelaySeconds !== undefined) { + if (input.DelaySeconds !== undefined && input.DelaySeconds !== null) { entries["DelaySeconds"] = input.DelaySeconds; } - if (input.MessageBody !== undefined) { + if (input.MessageBody !== undefined && input.MessageBody !== null) { entries["MessageBody"] = input.MessageBody; } - if (input.MessageAttributes !== undefined) { + if (input.MessageAttributes !== undefined && input.MessageAttributes !== null) { const memberEntries = serializeAws_queryMessageBodyAttributeMap(input.MessageAttributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `MessageAttribute.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.MessageDeduplicationId !== undefined) { + if (input.MessageDeduplicationId !== undefined && input.MessageDeduplicationId !== null) { entries["MessageDeduplicationId"] = input.MessageDeduplicationId; } - if (input.MessageGroupId !== undefined) { + if (input.MessageGroupId !== undefined && input.MessageGroupId !== null) { entries["MessageGroupId"] = input.MessageGroupId; } return entries; @@ -2360,10 +2390,10 @@ const serializeAws_querySetQueueAttributesRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } - if (input.Attributes !== undefined) { + if (input.Attributes !== undefined && input.Attributes !== null) { const memberEntries = serializeAws_queryQueueAttributeMap(input.Attributes, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Attribute.${key.substring(key.indexOf(".") + 1)}`; @@ -2377,6 +2407,9 @@ const serializeAws_queryStringList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`StringListValue.${counter}`] = entry; counter++; } @@ -2387,6 +2420,9 @@ const serializeAws_queryTagKeyList = (input: string[], context: __SerdeContext): const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -2396,24 +2432,26 @@ const serializeAws_queryTagKeyList = (input: string[], context: __SerdeContext): const serializeAws_queryTagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { const entries: any = {}; let counter = 1; - Object.keys(input).forEach((key) => { - entries[`entry.${counter}.Key`] = key; - entries[`entry.${counter}.Value`] = input[key]; - counter++; - }); + Object.keys(input) + .filter((key) => input[key] != null) + .forEach((key) => { + entries[`entry.${counter}.Key`] = key; + entries[`entry.${counter}.Value`] = input[key]; + counter++; + }); return entries; }; const serializeAws_queryTagQueueRequest = (input: TagQueueRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_queryTagMap(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tag.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } return entries; @@ -2421,14 +2459,14 @@ const serializeAws_queryTagQueueRequest = (input: TagQueueRequest, context: __Se const serializeAws_queryUntagQueueRequest = (input: UntagQueueRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.TagKeys !== undefined) { + if (input.TagKeys !== undefined && input.TagKeys !== null) { const memberEntries = serializeAws_queryTagKeyList(input.TagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TagKey.${key.substring(key.indexOf(".") + 1)}`; entries[loc] = value; }); } - if (input.QueueUrl !== undefined) { + if (input.QueueUrl !== undefined && input.QueueUrl !== null) { entries["QueueUrl"] = input.QueueUrl; } return entries; @@ -2473,11 +2511,25 @@ const deserializeAws_queryBatchResultErrorEntryList = ( output: any, context: __SerdeContext ): BatchResultErrorEntry[] => { - return (output || []).map((entry: any) => deserializeAws_queryBatchResultErrorEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryBatchResultErrorEntry(entry, context); + }); }; const deserializeAws_queryBinaryList = (output: any, context: __SerdeContext): Uint8Array[] => { - return (output || []).map((entry: any) => context.base64Decoder(entry)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return context.base64Decoder(entry); + }); }; const deserializeAws_queryChangeMessageVisibilityBatchResult = ( @@ -2526,9 +2578,14 @@ const deserializeAws_queryChangeMessageVisibilityBatchResultEntryList = ( output: any, context: __SerdeContext ): ChangeMessageVisibilityBatchResultEntry[] => { - return (output || []).map((entry: any) => - deserializeAws_queryChangeMessageVisibilityBatchResultEntry(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryChangeMessageVisibilityBatchResultEntry(entry, context); + }); }; const deserializeAws_queryCreateQueueResult = (output: any, context: __SerdeContext): CreateQueueResult => { @@ -2587,7 +2644,14 @@ const deserializeAws_queryDeleteMessageBatchResultEntryList = ( output: any, context: __SerdeContext ): DeleteMessageBatchResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_queryDeleteMessageBatchResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryDeleteMessageBatchResultEntry(entry, context); + }); }; const deserializeAws_queryEmptyBatchRequest = (output: any, context: __SerdeContext): EmptyBatchRequest => { @@ -2779,17 +2843,26 @@ const deserializeAws_queryMessageBodyAttributeMap = ( output: any, context: __SerdeContext ): { [key: string]: MessageAttributeValue } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["Value"] === null) { + return acc; + } + return { ...acc, [pair["Name"]]: deserializeAws_queryMessageAttributeValue(pair["Value"], context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryMessageList = (output: any, context: __SerdeContext): Message[] => { - return (output || []).map((entry: any) => deserializeAws_queryMessage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_queryMessage(entry, context); + }); }; const deserializeAws_queryMessageNotInflight = (output: any, context: __SerdeContext): MessageNotInflight => { @@ -2801,13 +2874,15 @@ const deserializeAws_queryMessageSystemAttributeMap = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["Value"] === null) { + return acc; + } + return { ...acc, [pair["Name"]]: pair["Value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryOverLimit = (output: any, context: __SerdeContext): OverLimit => { @@ -2821,13 +2896,15 @@ const deserializeAws_queryPurgeQueueInProgress = (output: any, context: __SerdeC }; const deserializeAws_queryQueueAttributeMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["Value"] === null) { + return acc; + } + return { ...acc, [pair["Name"]]: pair["Value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryQueueDeletedRecently = (output: any, context: __SerdeContext): QueueDeletedRecently => { @@ -2846,7 +2923,14 @@ const deserializeAws_queryQueueNameExists = (output: any, context: __SerdeContex }; const deserializeAws_queryQueueUrlList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryReceiptHandleIsInvalid = (output: any, context: __SerdeContext): ReceiptHandleIsInvalid => { @@ -2930,7 +3014,14 @@ const deserializeAws_querySendMessageBatchResultEntryList = ( output: any, context: __SerdeContext ): SendMessageBatchResultEntry[] => { - return (output || []).map((entry: any) => deserializeAws_querySendMessageBatchResultEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_querySendMessageBatchResultEntry(entry, context); + }); }; const deserializeAws_querySendMessageResult = (output: any, context: __SerdeContext): SendMessageResult => { @@ -2960,17 +3051,26 @@ const deserializeAws_querySendMessageResult = (output: any, context: __SerdeCont }; const deserializeAws_queryStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_queryTagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return output.reduce( - (acc: any, pair: any) => ({ + return output.reduce((acc: any, pair: any) => { + if (pair["Value"] === null) { + return acc; + } + return { ...acc, [pair["Key"]]: pair["Value"], - }), - {} - ); + }; + }, {}); }; const deserializeAws_queryTooManyEntriesInBatchRequest = ( diff --git a/clients/client-ssm/protocols/Aws_json1_1.ts b/clients/client-ssm/protocols/Aws_json1_1.ts index 17a3464f6791..c1f112c01eae 100644 --- a/clients/client-ssm/protocols/Aws_json1_1.ts +++ b/clients/client-ssm/protocols/Aws_json1_1.ts @@ -905,7 +905,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.AddTagsToResource", }; let body: any; @@ -918,7 +918,7 @@ export const serializeAws_json1_1CancelCommandCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CancelCommand", }; let body: any; @@ -931,7 +931,7 @@ export const serializeAws_json1_1CancelMaintenanceWindowExecutionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CancelMaintenanceWindowExecution", }; let body: any; @@ -944,7 +944,7 @@ export const serializeAws_json1_1CreateActivationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CreateActivation", }; let body: any; @@ -957,7 +957,7 @@ export const serializeAws_json1_1CreateAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CreateAssociation", }; let body: any; @@ -970,7 +970,7 @@ export const serializeAws_json1_1CreateAssociationBatchCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CreateAssociationBatch", }; let body: any; @@ -983,7 +983,7 @@ export const serializeAws_json1_1CreateDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CreateDocument", }; let body: any; @@ -996,7 +996,7 @@ export const serializeAws_json1_1CreateMaintenanceWindowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CreateMaintenanceWindow", }; let body: any; @@ -1009,7 +1009,7 @@ export const serializeAws_json1_1CreateOpsItemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CreateOpsItem", }; let body: any; @@ -1022,7 +1022,7 @@ export const serializeAws_json1_1CreateOpsMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CreateOpsMetadata", }; let body: any; @@ -1035,7 +1035,7 @@ export const serializeAws_json1_1CreatePatchBaselineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CreatePatchBaseline", }; let body: any; @@ -1048,7 +1048,7 @@ export const serializeAws_json1_1CreateResourceDataSyncCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.CreateResourceDataSync", }; let body: any; @@ -1061,7 +1061,7 @@ export const serializeAws_json1_1DeleteActivationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeleteActivation", }; let body: any; @@ -1074,7 +1074,7 @@ export const serializeAws_json1_1DeleteAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeleteAssociation", }; let body: any; @@ -1087,7 +1087,7 @@ export const serializeAws_json1_1DeleteDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeleteDocument", }; let body: any; @@ -1100,7 +1100,7 @@ export const serializeAws_json1_1DeleteInventoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeleteInventory", }; let body: any; @@ -1113,7 +1113,7 @@ export const serializeAws_json1_1DeleteMaintenanceWindowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeleteMaintenanceWindow", }; let body: any; @@ -1126,7 +1126,7 @@ export const serializeAws_json1_1DeleteOpsMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeleteOpsMetadata", }; let body: any; @@ -1139,7 +1139,7 @@ export const serializeAws_json1_1DeleteParameterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeleteParameter", }; let body: any; @@ -1152,7 +1152,7 @@ export const serializeAws_json1_1DeleteParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeleteParameters", }; let body: any; @@ -1165,7 +1165,7 @@ export const serializeAws_json1_1DeletePatchBaselineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeletePatchBaseline", }; let body: any; @@ -1178,7 +1178,7 @@ export const serializeAws_json1_1DeleteResourceDataSyncCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeleteResourceDataSync", }; let body: any; @@ -1191,7 +1191,7 @@ export const serializeAws_json1_1DeregisterManagedInstanceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeregisterManagedInstance", }; let body: any; @@ -1204,7 +1204,7 @@ export const serializeAws_json1_1DeregisterPatchBaselineForPatchGroupCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeregisterPatchBaselineForPatchGroup", }; let body: any; @@ -1217,7 +1217,7 @@ export const serializeAws_json1_1DeregisterTargetFromMaintenanceWindowCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeregisterTargetFromMaintenanceWindow", }; let body: any; @@ -1230,7 +1230,7 @@ export const serializeAws_json1_1DeregisterTaskFromMaintenanceWindowCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DeregisterTaskFromMaintenanceWindow", }; let body: any; @@ -1243,7 +1243,7 @@ export const serializeAws_json1_1DescribeActivationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeActivations", }; let body: any; @@ -1256,7 +1256,7 @@ export const serializeAws_json1_1DescribeAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeAssociation", }; let body: any; @@ -1269,7 +1269,7 @@ export const serializeAws_json1_1DescribeAssociationExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeAssociationExecutions", }; let body: any; @@ -1282,7 +1282,7 @@ export const serializeAws_json1_1DescribeAssociationExecutionTargetsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeAssociationExecutionTargets", }; let body: any; @@ -1295,7 +1295,7 @@ export const serializeAws_json1_1DescribeAutomationExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeAutomationExecutions", }; let body: any; @@ -1308,7 +1308,7 @@ export const serializeAws_json1_1DescribeAutomationStepExecutionsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeAutomationStepExecutions", }; let body: any; @@ -1321,7 +1321,7 @@ export const serializeAws_json1_1DescribeAvailablePatchesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeAvailablePatches", }; let body: any; @@ -1334,7 +1334,7 @@ export const serializeAws_json1_1DescribeDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeDocument", }; let body: any; @@ -1347,7 +1347,7 @@ export const serializeAws_json1_1DescribeDocumentPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeDocumentPermission", }; let body: any; @@ -1360,7 +1360,7 @@ export const serializeAws_json1_1DescribeEffectiveInstanceAssociationsCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeEffectiveInstanceAssociations", }; let body: any; @@ -1373,7 +1373,7 @@ export const serializeAws_json1_1DescribeEffectivePatchesForPatchBaselineCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeEffectivePatchesForPatchBaseline", }; let body: any; @@ -1386,7 +1386,7 @@ export const serializeAws_json1_1DescribeInstanceAssociationsStatusCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeInstanceAssociationsStatus", }; let body: any; @@ -1399,7 +1399,7 @@ export const serializeAws_json1_1DescribeInstanceInformationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeInstanceInformation", }; let body: any; @@ -1412,7 +1412,7 @@ export const serializeAws_json1_1DescribeInstancePatchesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeInstancePatches", }; let body: any; @@ -1425,7 +1425,7 @@ export const serializeAws_json1_1DescribeInstancePatchStatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeInstancePatchStates", }; let body: any; @@ -1438,7 +1438,7 @@ export const serializeAws_json1_1DescribeInstancePatchStatesForPatchGroupCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeInstancePatchStatesForPatchGroup", }; let body: any; @@ -1451,7 +1451,7 @@ export const serializeAws_json1_1DescribeInventoryDeletionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeInventoryDeletions", }; let body: any; @@ -1464,7 +1464,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowExecutionsCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeMaintenanceWindowExecutions", }; let body: any; @@ -1477,7 +1477,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocatio context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations", }; let body: any; @@ -1490,7 +1490,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowExecutionTasksCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeMaintenanceWindowExecutionTasks", }; let body: any; @@ -1503,7 +1503,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeMaintenanceWindows", }; let body: any; @@ -1516,7 +1516,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowScheduleCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeMaintenanceWindowSchedule", }; let body: any; @@ -1529,7 +1529,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowsForTargetCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeMaintenanceWindowsForTarget", }; let body: any; @@ -1542,7 +1542,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowTargetsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeMaintenanceWindowTargets", }; let body: any; @@ -1555,7 +1555,7 @@ export const serializeAws_json1_1DescribeMaintenanceWindowTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeMaintenanceWindowTasks", }; let body: any; @@ -1568,7 +1568,7 @@ export const serializeAws_json1_1DescribeOpsItemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeOpsItems", }; let body: any; @@ -1581,7 +1581,7 @@ export const serializeAws_json1_1DescribeParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeParameters", }; let body: any; @@ -1594,7 +1594,7 @@ export const serializeAws_json1_1DescribePatchBaselinesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribePatchBaselines", }; let body: any; @@ -1607,7 +1607,7 @@ export const serializeAws_json1_1DescribePatchGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribePatchGroups", }; let body: any; @@ -1620,7 +1620,7 @@ export const serializeAws_json1_1DescribePatchGroupStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribePatchGroupState", }; let body: any; @@ -1633,7 +1633,7 @@ export const serializeAws_json1_1DescribePatchPropertiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribePatchProperties", }; let body: any; @@ -1646,7 +1646,7 @@ export const serializeAws_json1_1DescribeSessionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.DescribeSessions", }; let body: any; @@ -1659,7 +1659,7 @@ export const serializeAws_json1_1GetAutomationExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetAutomationExecution", }; let body: any; @@ -1672,7 +1672,7 @@ export const serializeAws_json1_1GetCalendarStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetCalendarState", }; let body: any; @@ -1685,7 +1685,7 @@ export const serializeAws_json1_1GetCommandInvocationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetCommandInvocation", }; let body: any; @@ -1698,7 +1698,7 @@ export const serializeAws_json1_1GetConnectionStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetConnectionStatus", }; let body: any; @@ -1711,7 +1711,7 @@ export const serializeAws_json1_1GetDefaultPatchBaselineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetDefaultPatchBaseline", }; let body: any; @@ -1724,7 +1724,7 @@ export const serializeAws_json1_1GetDeployablePatchSnapshotForInstanceCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetDeployablePatchSnapshotForInstance", }; let body: any; @@ -1737,7 +1737,7 @@ export const serializeAws_json1_1GetDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetDocument", }; let body: any; @@ -1750,7 +1750,7 @@ export const serializeAws_json1_1GetInventoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetInventory", }; let body: any; @@ -1763,7 +1763,7 @@ export const serializeAws_json1_1GetInventorySchemaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetInventorySchema", }; let body: any; @@ -1776,7 +1776,7 @@ export const serializeAws_json1_1GetMaintenanceWindowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetMaintenanceWindow", }; let body: any; @@ -1789,7 +1789,7 @@ export const serializeAws_json1_1GetMaintenanceWindowExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetMaintenanceWindowExecution", }; let body: any; @@ -1802,7 +1802,7 @@ export const serializeAws_json1_1GetMaintenanceWindowExecutionTaskCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetMaintenanceWindowExecutionTask", }; let body: any; @@ -1815,7 +1815,7 @@ export const serializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationComm context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation", }; let body: any; @@ -1828,7 +1828,7 @@ export const serializeAws_json1_1GetMaintenanceWindowTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetMaintenanceWindowTask", }; let body: any; @@ -1841,7 +1841,7 @@ export const serializeAws_json1_1GetOpsItemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetOpsItem", }; let body: any; @@ -1854,7 +1854,7 @@ export const serializeAws_json1_1GetOpsMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetOpsMetadata", }; let body: any; @@ -1867,7 +1867,7 @@ export const serializeAws_json1_1GetOpsSummaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetOpsSummary", }; let body: any; @@ -1880,7 +1880,7 @@ export const serializeAws_json1_1GetParameterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetParameter", }; let body: any; @@ -1893,7 +1893,7 @@ export const serializeAws_json1_1GetParameterHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetParameterHistory", }; let body: any; @@ -1906,7 +1906,7 @@ export const serializeAws_json1_1GetParametersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetParameters", }; let body: any; @@ -1919,7 +1919,7 @@ export const serializeAws_json1_1GetParametersByPathCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetParametersByPath", }; let body: any; @@ -1932,7 +1932,7 @@ export const serializeAws_json1_1GetPatchBaselineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetPatchBaseline", }; let body: any; @@ -1945,7 +1945,7 @@ export const serializeAws_json1_1GetPatchBaselineForPatchGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetPatchBaselineForPatchGroup", }; let body: any; @@ -1958,7 +1958,7 @@ export const serializeAws_json1_1GetServiceSettingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.GetServiceSetting", }; let body: any; @@ -1971,7 +1971,7 @@ export const serializeAws_json1_1LabelParameterVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.LabelParameterVersion", }; let body: any; @@ -1984,7 +1984,7 @@ export const serializeAws_json1_1ListAssociationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListAssociations", }; let body: any; @@ -1997,7 +1997,7 @@ export const serializeAws_json1_1ListAssociationVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListAssociationVersions", }; let body: any; @@ -2010,7 +2010,7 @@ export const serializeAws_json1_1ListCommandInvocationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListCommandInvocations", }; let body: any; @@ -2023,7 +2023,7 @@ export const serializeAws_json1_1ListCommandsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListCommands", }; let body: any; @@ -2036,7 +2036,7 @@ export const serializeAws_json1_1ListComplianceItemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListComplianceItems", }; let body: any; @@ -2049,7 +2049,7 @@ export const serializeAws_json1_1ListComplianceSummariesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListComplianceSummaries", }; let body: any; @@ -2062,7 +2062,7 @@ export const serializeAws_json1_1ListDocumentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListDocuments", }; let body: any; @@ -2075,7 +2075,7 @@ export const serializeAws_json1_1ListDocumentVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListDocumentVersions", }; let body: any; @@ -2088,7 +2088,7 @@ export const serializeAws_json1_1ListInventoryEntriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListInventoryEntries", }; let body: any; @@ -2101,7 +2101,7 @@ export const serializeAws_json1_1ListOpsMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListOpsMetadata", }; let body: any; @@ -2114,7 +2114,7 @@ export const serializeAws_json1_1ListResourceComplianceSummariesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListResourceComplianceSummaries", }; let body: any; @@ -2127,7 +2127,7 @@ export const serializeAws_json1_1ListResourceDataSyncCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListResourceDataSync", }; let body: any; @@ -2140,7 +2140,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ListTagsForResource", }; let body: any; @@ -2153,7 +2153,7 @@ export const serializeAws_json1_1ModifyDocumentPermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ModifyDocumentPermission", }; let body: any; @@ -2166,7 +2166,7 @@ export const serializeAws_json1_1PutComplianceItemsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.PutComplianceItems", }; let body: any; @@ -2179,7 +2179,7 @@ export const serializeAws_json1_1PutInventoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.PutInventory", }; let body: any; @@ -2192,7 +2192,7 @@ export const serializeAws_json1_1PutParameterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.PutParameter", }; let body: any; @@ -2205,7 +2205,7 @@ export const serializeAws_json1_1RegisterDefaultPatchBaselineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.RegisterDefaultPatchBaseline", }; let body: any; @@ -2218,7 +2218,7 @@ export const serializeAws_json1_1RegisterPatchBaselineForPatchGroupCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.RegisterPatchBaselineForPatchGroup", }; let body: any; @@ -2231,7 +2231,7 @@ export const serializeAws_json1_1RegisterTargetWithMaintenanceWindowCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.RegisterTargetWithMaintenanceWindow", }; let body: any; @@ -2244,7 +2244,7 @@ export const serializeAws_json1_1RegisterTaskWithMaintenanceWindowCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.RegisterTaskWithMaintenanceWindow", }; let body: any; @@ -2257,7 +2257,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.RemoveTagsFromResource", }; let body: any; @@ -2270,7 +2270,7 @@ export const serializeAws_json1_1ResetServiceSettingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ResetServiceSetting", }; let body: any; @@ -2283,7 +2283,7 @@ export const serializeAws_json1_1ResumeSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.ResumeSession", }; let body: any; @@ -2296,7 +2296,7 @@ export const serializeAws_json1_1SendAutomationSignalCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.SendAutomationSignal", }; let body: any; @@ -2309,7 +2309,7 @@ export const serializeAws_json1_1SendCommandCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.SendCommand", }; let body: any; @@ -2322,7 +2322,7 @@ export const serializeAws_json1_1StartAssociationsOnceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.StartAssociationsOnce", }; let body: any; @@ -2335,7 +2335,7 @@ export const serializeAws_json1_1StartAutomationExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.StartAutomationExecution", }; let body: any; @@ -2348,7 +2348,7 @@ export const serializeAws_json1_1StartSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.StartSession", }; let body: any; @@ -2361,7 +2361,7 @@ export const serializeAws_json1_1StopAutomationExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.StopAutomationExecution", }; let body: any; @@ -2374,7 +2374,7 @@ export const serializeAws_json1_1TerminateSessionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.TerminateSession", }; let body: any; @@ -2387,7 +2387,7 @@ export const serializeAws_json1_1UpdateAssociationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateAssociation", }; let body: any; @@ -2400,7 +2400,7 @@ export const serializeAws_json1_1UpdateAssociationStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateAssociationStatus", }; let body: any; @@ -2413,7 +2413,7 @@ export const serializeAws_json1_1UpdateDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateDocument", }; let body: any; @@ -2426,7 +2426,7 @@ export const serializeAws_json1_1UpdateDocumentDefaultVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateDocumentDefaultVersion", }; let body: any; @@ -2439,7 +2439,7 @@ export const serializeAws_json1_1UpdateMaintenanceWindowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateMaintenanceWindow", }; let body: any; @@ -2452,7 +2452,7 @@ export const serializeAws_json1_1UpdateMaintenanceWindowTargetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateMaintenanceWindowTarget", }; let body: any; @@ -2465,7 +2465,7 @@ export const serializeAws_json1_1UpdateMaintenanceWindowTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateMaintenanceWindowTask", }; let body: any; @@ -2478,7 +2478,7 @@ export const serializeAws_json1_1UpdateManagedInstanceRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateManagedInstanceRole", }; let body: any; @@ -2491,7 +2491,7 @@ export const serializeAws_json1_1UpdateOpsItemCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateOpsItem", }; let body: any; @@ -2504,7 +2504,7 @@ export const serializeAws_json1_1UpdateOpsMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateOpsMetadata", }; let body: any; @@ -2517,7 +2517,7 @@ export const serializeAws_json1_1UpdatePatchBaselineCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdatePatchBaseline", }; let body: any; @@ -2530,7 +2530,7 @@ export const serializeAws_json1_1UpdateResourceDataSyncCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateResourceDataSync", }; let body: any; @@ -2543,7 +2543,7 @@ export const serializeAws_json1_1UpdateServiceSettingCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AmazonSSM.UpdateServiceSetting", }; let body: any; @@ -2578,8 +2578,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -2665,8 +2664,7 @@ const deserializeAws_json1_1CancelCommandCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateInstanceId": case "com.amazonaws.ssm#DuplicateInstanceId": @@ -2744,8 +2742,7 @@ const deserializeAws_json1_1CancelMaintenanceWindowExecutionCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -2807,8 +2804,7 @@ const deserializeAws_json1_1CreateActivationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -2862,8 +2858,7 @@ const deserializeAws_json1_1CreateAssociationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationAlreadyExists": case "com.amazonaws.ssm#AssociationAlreadyExists": @@ -2997,8 +2992,7 @@ const deserializeAws_json1_1CreateAssociationBatchCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationLimitExceeded": case "com.amazonaws.ssm#AssociationLimitExceeded": @@ -3132,8 +3126,7 @@ const deserializeAws_json1_1CreateDocumentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DocumentAlreadyExists": case "com.amazonaws.ssm#DocumentAlreadyExists": @@ -3227,8 +3220,7 @@ const deserializeAws_json1_1CreateMaintenanceWindowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatch": case "com.amazonaws.ssm#IdempotentParameterMismatch": @@ -3298,8 +3290,7 @@ const deserializeAws_json1_1CreateOpsItemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -3377,8 +3368,7 @@ const deserializeAws_json1_1CreateOpsMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -3464,8 +3454,7 @@ const deserializeAws_json1_1CreatePatchBaselineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "IdempotentParameterMismatch": case "com.amazonaws.ssm#IdempotentParameterMismatch": @@ -3535,8 +3524,7 @@ const deserializeAws_json1_1CreateResourceDataSyncCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -3614,8 +3602,7 @@ const deserializeAws_json1_1DeleteActivationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -3693,8 +3680,7 @@ const deserializeAws_json1_1DeleteAssociationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationDoesNotExist": case "com.amazonaws.ssm#AssociationDoesNotExist": @@ -3780,8 +3766,7 @@ const deserializeAws_json1_1DeleteDocumentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociatedInstances": case "com.amazonaws.ssm#AssociatedInstances": @@ -3859,8 +3844,7 @@ const deserializeAws_json1_1DeleteInventoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -3946,8 +3930,7 @@ const deserializeAws_json1_1DeleteMaintenanceWindowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4001,8 +3984,7 @@ const deserializeAws_json1_1DeleteOpsMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4072,8 +4054,7 @@ const deserializeAws_json1_1DeleteParameterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4135,8 +4116,7 @@ const deserializeAws_json1_1DeleteParametersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4190,8 +4170,7 @@ const deserializeAws_json1_1DeletePatchBaselineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4253,8 +4232,7 @@ const deserializeAws_json1_1DeleteResourceDataSyncCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4324,8 +4302,7 @@ const deserializeAws_json1_1DeregisterManagedInstanceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4387,8 +4364,7 @@ const deserializeAws_json1_1DeregisterPatchBaselineForPatchGroupCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4450,8 +4426,7 @@ const deserializeAws_json1_1DeregisterTargetFromMaintenanceWindowCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -4521,8 +4496,7 @@ const deserializeAws_json1_1DeregisterTaskFromMaintenanceWindowCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -4584,8 +4558,7 @@ const deserializeAws_json1_1DescribeActivationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4655,8 +4628,7 @@ const deserializeAws_json1_1DescribeAssociationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationDoesNotExist": case "com.amazonaws.ssm#AssociationDoesNotExist": @@ -4742,8 +4714,7 @@ const deserializeAws_json1_1DescribeAssociationExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationDoesNotExist": case "com.amazonaws.ssm#AssociationDoesNotExist": @@ -4813,8 +4784,7 @@ const deserializeAws_json1_1DescribeAssociationExecutionTargetsCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationDoesNotExist": case "com.amazonaws.ssm#AssociationDoesNotExist": @@ -4892,8 +4862,7 @@ const deserializeAws_json1_1DescribeAutomationExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -4971,8 +4940,7 @@ const deserializeAws_json1_1DescribeAutomationStepExecutionsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AutomationExecutionNotFoundException": case "com.amazonaws.ssm#AutomationExecutionNotFoundException": @@ -5058,8 +5026,7 @@ const deserializeAws_json1_1DescribeAvailablePatchesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5113,8 +5080,7 @@ const deserializeAws_json1_1DescribeDocumentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5184,8 +5150,7 @@ const deserializeAws_json1_1DescribeDocumentPermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5255,8 +5220,7 @@ const deserializeAws_json1_1DescribeEffectiveInstanceAssociationsCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5326,8 +5290,7 @@ const deserializeAws_json1_1DescribeEffectivePatchesForPatchBaselineCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -5405,8 +5368,7 @@ const deserializeAws_json1_1DescribeInstanceAssociationsStatusCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5476,8 +5438,7 @@ const deserializeAws_json1_1DescribeInstanceInformationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5563,8 +5524,7 @@ const deserializeAws_json1_1DescribeInstancePatchesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5642,8 +5602,7 @@ const deserializeAws_json1_1DescribeInstancePatchStatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5705,8 +5664,7 @@ const deserializeAws_json1_1DescribeInstancePatchStatesForPatchGroupCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5776,8 +5734,7 @@ const deserializeAws_json1_1DescribeInventoryDeletionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5847,8 +5804,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowExecutionsCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -5902,8 +5858,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocationsCom }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -5965,8 +5920,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowExecutionTasksCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -6028,8 +5982,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6083,8 +6036,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowScheduleCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -6146,8 +6098,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowsForTargetCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6201,8 +6152,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowTargetsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -6264,8 +6214,7 @@ const deserializeAws_json1_1DescribeMaintenanceWindowTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -6327,8 +6276,7 @@ const deserializeAws_json1_1DescribeOpsItemsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6382,8 +6330,7 @@ const deserializeAws_json1_1DescribeParametersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6469,8 +6416,7 @@ const deserializeAws_json1_1DescribePatchBaselinesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6524,8 +6470,7 @@ const deserializeAws_json1_1DescribePatchGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6579,8 +6524,7 @@ const deserializeAws_json1_1DescribePatchGroupStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6642,8 +6586,7 @@ const deserializeAws_json1_1DescribePatchPropertiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6697,8 +6640,7 @@ const deserializeAws_json1_1DescribeSessionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6768,8 +6710,7 @@ const deserializeAws_json1_1GetAutomationExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AutomationExecutionNotFoundException": case "com.amazonaws.ssm#AutomationExecutionNotFoundException": @@ -6831,8 +6772,7 @@ const deserializeAws_json1_1GetCalendarStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6910,8 +6850,7 @@ const deserializeAws_json1_1GetCommandInvocationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -6997,8 +6936,7 @@ const deserializeAws_json1_1GetConnectionStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -7052,8 +6990,7 @@ const deserializeAws_json1_1GetDefaultPatchBaselineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -7107,8 +7044,7 @@ const deserializeAws_json1_1GetDeployablePatchSnapshotForInstanceCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -7178,8 +7114,7 @@ const deserializeAws_json1_1GetDocumentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -7249,8 +7184,7 @@ const deserializeAws_json1_1GetInventoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -7352,8 +7286,7 @@ const deserializeAws_json1_1GetInventorySchemaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -7423,8 +7356,7 @@ const deserializeAws_json1_1GetMaintenanceWindowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -7486,8 +7418,7 @@ const deserializeAws_json1_1GetMaintenanceWindowExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -7549,8 +7480,7 @@ const deserializeAws_json1_1GetMaintenanceWindowExecutionTaskCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -7612,8 +7542,7 @@ const deserializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationCommandEr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -7675,8 +7604,7 @@ const deserializeAws_json1_1GetMaintenanceWindowTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -7738,8 +7666,7 @@ const deserializeAws_json1_1GetOpsItemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -7801,8 +7728,7 @@ const deserializeAws_json1_1GetOpsMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -7872,8 +7798,7 @@ const deserializeAws_json1_1GetOpsSummaryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -7967,8 +7892,7 @@ const deserializeAws_json1_1GetParameterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8046,8 +7970,7 @@ const deserializeAws_json1_1GetParameterHistoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8125,8 +8048,7 @@ const deserializeAws_json1_1GetParametersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8188,8 +8110,7 @@ const deserializeAws_json1_1GetParametersByPathCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8283,8 +8204,7 @@ const deserializeAws_json1_1GetPatchBaselineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -8354,8 +8274,7 @@ const deserializeAws_json1_1GetPatchBaselineForPatchGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8409,8 +8328,7 @@ const deserializeAws_json1_1GetServiceSettingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8472,8 +8390,7 @@ const deserializeAws_json1_1LabelParameterVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8559,8 +8476,7 @@ const deserializeAws_json1_1ListAssociationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8622,8 +8538,7 @@ const deserializeAws_json1_1ListAssociationVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationDoesNotExist": case "com.amazonaws.ssm#AssociationDoesNotExist": @@ -8693,8 +8608,7 @@ const deserializeAws_json1_1ListCommandInvocationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8780,8 +8694,7 @@ const deserializeAws_json1_1ListCommandsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8867,8 +8780,7 @@ const deserializeAws_json1_1ListComplianceItemsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -8954,8 +8866,7 @@ const deserializeAws_json1_1ListComplianceSummariesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -9025,8 +8936,7 @@ const deserializeAws_json1_1ListDocumentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -9096,8 +9006,7 @@ const deserializeAws_json1_1ListDocumentVersionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -9167,8 +9076,7 @@ const deserializeAws_json1_1ListInventoryEntriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -9254,8 +9162,7 @@ const deserializeAws_json1_1ListOpsMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -9317,8 +9224,7 @@ const deserializeAws_json1_1ListResourceComplianceSummariesCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -9388,8 +9294,7 @@ const deserializeAws_json1_1ListResourceDataSyncCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -9459,8 +9364,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -9530,8 +9434,7 @@ const deserializeAws_json1_1ModifyDocumentPermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DocumentLimitExceeded": case "com.amazonaws.ssm#DocumentLimitExceeded": @@ -9617,8 +9520,7 @@ const deserializeAws_json1_1PutComplianceItemsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ComplianceTypeCountLimitExceededException": case "com.amazonaws.ssm#ComplianceTypeCountLimitExceededException": @@ -9720,8 +9622,7 @@ const deserializeAws_json1_1PutInventoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CustomSchemaCountLimitExceededException": case "com.amazonaws.ssm#CustomSchemaCountLimitExceededException": @@ -9863,8 +9764,7 @@ const deserializeAws_json1_1PutParameterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "HierarchyLevelLimitExceededException": case "com.amazonaws.ssm#HierarchyLevelLimitExceededException": @@ -10030,8 +9930,7 @@ const deserializeAws_json1_1RegisterDefaultPatchBaselineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -10101,8 +10000,7 @@ const deserializeAws_json1_1RegisterPatchBaselineForPatchGroupCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AlreadyExistsException": case "com.amazonaws.ssm#AlreadyExistsException": @@ -10188,8 +10086,7 @@ const deserializeAws_json1_1RegisterTargetWithMaintenanceWindowCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -10267,8 +10164,7 @@ const deserializeAws_json1_1RegisterTaskWithMaintenanceWindowCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -10354,8 +10250,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -10433,8 +10328,7 @@ const deserializeAws_json1_1ResetServiceSettingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -10504,8 +10398,7 @@ const deserializeAws_json1_1ResumeSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -10567,8 +10460,7 @@ const deserializeAws_json1_1SendAutomationSignalCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AutomationExecutionNotFoundException": case "com.amazonaws.ssm#AutomationExecutionNotFoundException": @@ -10646,8 +10538,7 @@ const deserializeAws_json1_1SendCommandCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DuplicateInstanceId": case "com.amazonaws.ssm#DuplicateInstanceId": @@ -10781,8 +10672,7 @@ const deserializeAws_json1_1StartAssociationsOnceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationDoesNotExist": case "com.amazonaws.ssm#AssociationDoesNotExist": @@ -10844,8 +10734,7 @@ const deserializeAws_json1_1StartAutomationExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AutomationDefinitionNotFoundException": case "com.amazonaws.ssm#AutomationDefinitionNotFoundException": @@ -10947,8 +10836,7 @@ const deserializeAws_json1_1StartSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -11018,8 +10906,7 @@ const deserializeAws_json1_1StopAutomationExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AutomationExecutionNotFoundException": case "com.amazonaws.ssm#AutomationExecutionNotFoundException": @@ -11089,8 +10976,7 @@ const deserializeAws_json1_1TerminateSessionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -11152,8 +11038,7 @@ const deserializeAws_json1_1UpdateAssociationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationDoesNotExist": case "com.amazonaws.ssm#AssociationDoesNotExist": @@ -11295,8 +11180,7 @@ const deserializeAws_json1_1UpdateAssociationStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AssociationDoesNotExist": case "com.amazonaws.ssm#AssociationDoesNotExist": @@ -11390,8 +11274,7 @@ const deserializeAws_json1_1UpdateDocumentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DocumentVersionLimitExceeded": case "com.amazonaws.ssm#DocumentVersionLimitExceeded": @@ -11517,8 +11400,7 @@ const deserializeAws_json1_1UpdateDocumentDefaultVersionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -11596,8 +11478,7 @@ const deserializeAws_json1_1UpdateMaintenanceWindowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -11659,8 +11540,7 @@ const deserializeAws_json1_1UpdateMaintenanceWindowTargetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -11722,8 +11602,7 @@ const deserializeAws_json1_1UpdateMaintenanceWindowTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -11785,8 +11664,7 @@ const deserializeAws_json1_1UpdateManagedInstanceRoleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -11848,8 +11726,7 @@ const deserializeAws_json1_1UpdateOpsItemCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -11935,8 +11812,7 @@ const deserializeAws_json1_1UpdateOpsMetadataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -12022,8 +11898,7 @@ const deserializeAws_json1_1UpdatePatchBaselineCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DoesNotExistException": case "com.amazonaws.ssm#DoesNotExistException": @@ -12085,8 +11960,7 @@ const deserializeAws_json1_1UpdateResourceDataSyncCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -12164,8 +12038,7 @@ const deserializeAws_json1_1UpdateServiceSettingCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": @@ -13994,11 +13867,25 @@ const deserializeAws_json1_1UnsupportedPlatformTypeResponse = async ( }; const serializeAws_json1_1AccountIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Accounts = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AddTagsToResourceRequest = ( @@ -14006,9 +13893,9 @@ const serializeAws_json1_1AddTagsToResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -14017,9 +13904,9 @@ const serializeAws_json1_1AssociationExecutionFilter = ( context: __SerdeContext ): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -14027,7 +13914,14 @@ const serializeAws_json1_1AssociationExecutionFilterList = ( input: AssociationExecutionFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AssociationExecutionFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AssociationExecutionFilter(entry, context); + }); }; const serializeAws_json1_1AssociationExecutionTargetsFilter = ( @@ -14035,8 +13929,8 @@ const serializeAws_json1_1AssociationExecutionTargetsFilter = ( context: __SerdeContext ): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -14044,47 +13938,84 @@ const serializeAws_json1_1AssociationExecutionTargetsFilterList = ( input: AssociationExecutionTargetsFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AssociationExecutionTargetsFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AssociationExecutionTargetsFilter(entry, context); + }); }; const serializeAws_json1_1AssociationFilter = (input: AssociationFilter, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1AssociationFilterList = (input: AssociationFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AssociationFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AssociationFilter(entry, context); + }); }; const serializeAws_json1_1AssociationIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssociationStatus = (input: AssociationStatus, context: __SerdeContext): any => { return { - ...(input.AdditionalInfo !== undefined && { AdditionalInfo: input.AdditionalInfo }), - ...(input.Date !== undefined && { Date: Math.round(input.Date.getTime() / 1000) }), - ...(input.Message !== undefined && { Message: input.Message }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AdditionalInfo !== undefined && + input.AdditionalInfo !== null && { AdditionalInfo: input.AdditionalInfo }), + ...(input.Date !== undefined && input.Date !== null && { Date: Math.round(input.Date.getTime() / 1000) }), + ...(input.Message !== undefined && input.Message !== null && { Message: input.Message }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1AttachmentsSource = (input: AttachmentsSource, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1AttachmentsSourceValues(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1AttachmentsSourceValues(input.Values, context) }), }; }; const serializeAws_json1_1AttachmentsSourceList = (input: AttachmentsSource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1AttachmentsSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AttachmentsSource(entry, context); + }); }; const serializeAws_json1_1AttachmentsSourceValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AutomationExecutionFilter = ( @@ -14092,10 +14023,11 @@ const serializeAws_json1_1AutomationExecutionFilter = ( context: __SerdeContext ): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1AutomationExecutionFilterValueList(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { + Values: serializeAws_json1_1AutomationExecutionFilterValueList(input.Values, context), + }), }; }; @@ -14103,40 +14035,69 @@ const serializeAws_json1_1AutomationExecutionFilterList = ( input: AutomationExecutionFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AutomationExecutionFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AutomationExecutionFilter(entry, context); + }); }; const serializeAws_json1_1AutomationExecutionFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AutomationParameterMap = ( input: { [key: string]: string[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1AutomationParameterValueList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1AutomationParameterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CalendarNameOrARNList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CancelCommandRequest = (input: CancelCommandRequest, context: __SerdeContext): any => { return { - ...(input.CommandId !== undefined && { CommandId: input.CommandId }), - ...(input.InstanceIds !== undefined && { - InstanceIds: serializeAws_json1_1InstanceIdList(input.InstanceIds, context), - }), + ...(input.CommandId !== undefined && input.CommandId !== null && { CommandId: input.CommandId }), + ...(input.InstanceIds !== undefined && + input.InstanceIds !== null && { InstanceIds: serializeAws_json1_1InstanceIdList(input.InstanceIds, context) }), }; }; @@ -14145,26 +14106,36 @@ const serializeAws_json1_1CancelMaintenanceWindowExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.WindowExecutionId !== undefined && { WindowExecutionId: input.WindowExecutionId }), + ...(input.WindowExecutionId !== undefined && + input.WindowExecutionId !== null && { WindowExecutionId: input.WindowExecutionId }), }; }; const serializeAws_json1_1CloudWatchOutputConfig = (input: CloudWatchOutputConfig, context: __SerdeContext): any => { return { - ...(input.CloudWatchLogGroupName !== undefined && { CloudWatchLogGroupName: input.CloudWatchLogGroupName }), - ...(input.CloudWatchOutputEnabled !== undefined && { CloudWatchOutputEnabled: input.CloudWatchOutputEnabled }), + ...(input.CloudWatchLogGroupName !== undefined && + input.CloudWatchLogGroupName !== null && { CloudWatchLogGroupName: input.CloudWatchLogGroupName }), + ...(input.CloudWatchOutputEnabled !== undefined && + input.CloudWatchOutputEnabled !== null && { CloudWatchOutputEnabled: input.CloudWatchOutputEnabled }), }; }; const serializeAws_json1_1CommandFilter = (input: CommandFilter, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1CommandFilterList = (input: CommandFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1CommandFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CommandFilter(entry, context); + }); }; const serializeAws_json1_1ComplianceExecutionSummary = ( @@ -14172,51 +14143,75 @@ const serializeAws_json1_1ComplianceExecutionSummary = ( context: __SerdeContext ): any => { return { - ...(input.ExecutionId !== undefined && { ExecutionId: input.ExecutionId }), - ...(input.ExecutionTime !== undefined && { ExecutionTime: Math.round(input.ExecutionTime.getTime() / 1000) }), - ...(input.ExecutionType !== undefined && { ExecutionType: input.ExecutionType }), + ...(input.ExecutionId !== undefined && input.ExecutionId !== null && { ExecutionId: input.ExecutionId }), + ...(input.ExecutionTime !== undefined && + input.ExecutionTime !== null && { ExecutionTime: Math.round(input.ExecutionTime.getTime() / 1000) }), + ...(input.ExecutionType !== undefined && input.ExecutionType !== null && { ExecutionType: input.ExecutionType }), }; }; const serializeAws_json1_1ComplianceItemDetails = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ComplianceItemEntry = (input: ComplianceItemEntry, context: __SerdeContext): any => { return { - ...(input.Details !== undefined && { Details: serializeAws_json1_1ComplianceItemDetails(input.Details, context) }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Severity !== undefined && { Severity: input.Severity }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.Title !== undefined && { Title: input.Title }), + ...(input.Details !== undefined && + input.Details !== null && { Details: serializeAws_json1_1ComplianceItemDetails(input.Details, context) }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Severity !== undefined && input.Severity !== null && { Severity: input.Severity }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), }; }; const serializeAws_json1_1ComplianceItemEntryList = (input: ComplianceItemEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ComplianceItemEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ComplianceItemEntry(entry, context); + }); }; const serializeAws_json1_1ComplianceResourceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ComplianceResourceTypeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ComplianceStringFilter = (input: ComplianceStringFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1ComplianceStringFilterValueList(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1ComplianceStringFilterValueList(input.Values, context) }), }; }; @@ -14224,21 +14219,38 @@ const serializeAws_json1_1ComplianceStringFilterList = ( input: ComplianceStringFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ComplianceStringFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ComplianceStringFilter(entry, context); + }); }; const serializeAws_json1_1ComplianceStringFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateActivationRequest = (input: CreateActivationRequest, context: __SerdeContext): any => { return { - ...(input.DefaultInstanceName !== undefined && { DefaultInstanceName: input.DefaultInstanceName }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.ExpirationDate !== undefined && { ExpirationDate: Math.round(input.ExpirationDate.getTime() / 1000) }), - ...(input.IamRole !== undefined && { IamRole: input.IamRole }), - ...(input.RegistrationLimit !== undefined && { RegistrationLimit: input.RegistrationLimit }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.DefaultInstanceName !== undefined && + input.DefaultInstanceName !== null && { DefaultInstanceName: input.DefaultInstanceName }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.ExpirationDate !== undefined && + input.ExpirationDate !== null && { ExpirationDate: Math.round(input.ExpirationDate.getTime() / 1000) }), + ...(input.IamRole !== undefined && input.IamRole !== null && { IamRole: input.IamRole }), + ...(input.RegistrationLimit !== undefined && + input.RegistrationLimit !== null && { RegistrationLimit: input.RegistrationLimit }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -14247,9 +14259,10 @@ const serializeAws_json1_1CreateAssociationBatchRequest = ( context: __SerdeContext ): any => { return { - ...(input.Entries !== undefined && { - Entries: serializeAws_json1_1CreateAssociationBatchRequestEntries(input.Entries, context), - }), + ...(input.Entries !== undefined && + input.Entries !== null && { + Entries: serializeAws_json1_1CreateAssociationBatchRequestEntries(input.Entries, context), + }), }; }; @@ -14257,7 +14270,14 @@ const serializeAws_json1_1CreateAssociationBatchRequestEntries = ( input: CreateAssociationBatchRequestEntry[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1CreateAssociationBatchRequestEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1CreateAssociationBatchRequestEntry(entry, context); + }); }; const serializeAws_json1_1CreateAssociationBatchRequestEntry = ( @@ -14265,24 +14285,35 @@ const serializeAws_json1_1CreateAssociationBatchRequestEntry = ( context: __SerdeContext ): any => { return { - ...(input.ApplyOnlyAtCronInterval !== undefined && { ApplyOnlyAtCronInterval: input.ApplyOnlyAtCronInterval }), - ...(input.AssociationName !== undefined && { AssociationName: input.AssociationName }), - ...(input.AutomationTargetParameterName !== undefined && { - AutomationTargetParameterName: input.AutomationTargetParameterName, - }), - ...(input.ComplianceSeverity !== undefined && { ComplianceSeverity: input.ComplianceSeverity }), - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.MaxConcurrency !== undefined && { MaxConcurrency: input.MaxConcurrency }), - ...(input.MaxErrors !== undefined && { MaxErrors: input.MaxErrors }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OutputLocation !== undefined && { - OutputLocation: serializeAws_json1_1InstanceAssociationOutputLocation(input.OutputLocation, context), - }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), - ...(input.ScheduleExpression !== undefined && { ScheduleExpression: input.ScheduleExpression }), - ...(input.SyncCompliance !== undefined && { SyncCompliance: input.SyncCompliance }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.ApplyOnlyAtCronInterval !== undefined && + input.ApplyOnlyAtCronInterval !== null && { ApplyOnlyAtCronInterval: input.ApplyOnlyAtCronInterval }), + ...(input.AssociationName !== undefined && + input.AssociationName !== null && { AssociationName: input.AssociationName }), + ...(input.AutomationTargetParameterName !== undefined && + input.AutomationTargetParameterName !== null && { + AutomationTargetParameterName: input.AutomationTargetParameterName, + }), + ...(input.ComplianceSeverity !== undefined && + input.ComplianceSeverity !== null && { ComplianceSeverity: input.ComplianceSeverity }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.MaxConcurrency !== undefined && + input.MaxConcurrency !== null && { MaxConcurrency: input.MaxConcurrency }), + ...(input.MaxErrors !== undefined && input.MaxErrors !== null && { MaxErrors: input.MaxErrors }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OutputLocation !== undefined && + input.OutputLocation !== null && { + OutputLocation: serializeAws_json1_1InstanceAssociationOutputLocation(input.OutputLocation, context), + }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), + ...(input.ScheduleExpression !== undefined && + input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }), + ...(input.SyncCompliance !== undefined && + input.SyncCompliance !== null && { SyncCompliance: input.SyncCompliance }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), }; }; @@ -14291,42 +14322,54 @@ const serializeAws_json1_1CreateAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplyOnlyAtCronInterval !== undefined && { ApplyOnlyAtCronInterval: input.ApplyOnlyAtCronInterval }), - ...(input.AssociationName !== undefined && { AssociationName: input.AssociationName }), - ...(input.AutomationTargetParameterName !== undefined && { - AutomationTargetParameterName: input.AutomationTargetParameterName, - }), - ...(input.ComplianceSeverity !== undefined && { ComplianceSeverity: input.ComplianceSeverity }), - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.MaxConcurrency !== undefined && { MaxConcurrency: input.MaxConcurrency }), - ...(input.MaxErrors !== undefined && { MaxErrors: input.MaxErrors }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OutputLocation !== undefined && { - OutputLocation: serializeAws_json1_1InstanceAssociationOutputLocation(input.OutputLocation, context), - }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), - ...(input.ScheduleExpression !== undefined && { ScheduleExpression: input.ScheduleExpression }), - ...(input.SyncCompliance !== undefined && { SyncCompliance: input.SyncCompliance }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.ApplyOnlyAtCronInterval !== undefined && + input.ApplyOnlyAtCronInterval !== null && { ApplyOnlyAtCronInterval: input.ApplyOnlyAtCronInterval }), + ...(input.AssociationName !== undefined && + input.AssociationName !== null && { AssociationName: input.AssociationName }), + ...(input.AutomationTargetParameterName !== undefined && + input.AutomationTargetParameterName !== null && { + AutomationTargetParameterName: input.AutomationTargetParameterName, + }), + ...(input.ComplianceSeverity !== undefined && + input.ComplianceSeverity !== null && { ComplianceSeverity: input.ComplianceSeverity }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.MaxConcurrency !== undefined && + input.MaxConcurrency !== null && { MaxConcurrency: input.MaxConcurrency }), + ...(input.MaxErrors !== undefined && input.MaxErrors !== null && { MaxErrors: input.MaxErrors }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OutputLocation !== undefined && + input.OutputLocation !== null && { + OutputLocation: serializeAws_json1_1InstanceAssociationOutputLocation(input.OutputLocation, context), + }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), + ...(input.ScheduleExpression !== undefined && + input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }), + ...(input.SyncCompliance !== undefined && + input.SyncCompliance !== null && { SyncCompliance: input.SyncCompliance }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), }; }; const serializeAws_json1_1CreateDocumentRequest = (input: CreateDocumentRequest, context: __SerdeContext): any => { return { - ...(input.Attachments !== undefined && { - Attachments: serializeAws_json1_1AttachmentsSourceList(input.Attachments, context), - }), - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.DocumentFormat !== undefined && { DocumentFormat: input.DocumentFormat }), - ...(input.DocumentType !== undefined && { DocumentType: input.DocumentType }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Requires !== undefined && { - Requires: serializeAws_json1_1DocumentRequiresList(input.Requires, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TargetType !== undefined && { TargetType: input.TargetType }), - ...(input.VersionName !== undefined && { VersionName: input.VersionName }), + ...(input.Attachments !== undefined && + input.Attachments !== null && { + Attachments: serializeAws_json1_1AttachmentsSourceList(input.Attachments, context), + }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.DocumentFormat !== undefined && + input.DocumentFormat !== null && { DocumentFormat: input.DocumentFormat }), + ...(input.DocumentType !== undefined && input.DocumentType !== null && { DocumentType: input.DocumentType }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Requires !== undefined && + input.Requires !== null && { Requires: serializeAws_json1_1DocumentRequiresList(input.Requires, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TargetType !== undefined && input.TargetType !== null && { TargetType: input.TargetType }), + ...(input.VersionName !== undefined && input.VersionName !== null && { VersionName: input.VersionName }), }; }; @@ -14335,39 +14378,45 @@ const serializeAws_json1_1CreateMaintenanceWindowRequest = ( context: __SerdeContext ): any => { return { - ...(input.AllowUnassociatedTargets !== undefined && { AllowUnassociatedTargets: input.AllowUnassociatedTargets }), + ...(input.AllowUnassociatedTargets !== undefined && + input.AllowUnassociatedTargets !== null && { AllowUnassociatedTargets: input.AllowUnassociatedTargets }), ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Cutoff !== undefined && { Cutoff: input.Cutoff }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Duration !== undefined && { Duration: input.Duration }), - ...(input.EndDate !== undefined && { EndDate: input.EndDate }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), - ...(input.ScheduleOffset !== undefined && { ScheduleOffset: input.ScheduleOffset }), - ...(input.ScheduleTimezone !== undefined && { ScheduleTimezone: input.ScheduleTimezone }), - ...(input.StartDate !== undefined && { StartDate: input.StartDate }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Cutoff !== undefined && input.Cutoff !== null && { Cutoff: input.Cutoff }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Duration !== undefined && input.Duration !== null && { Duration: input.Duration }), + ...(input.EndDate !== undefined && input.EndDate !== null && { EndDate: input.EndDate }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), + ...(input.ScheduleOffset !== undefined && + input.ScheduleOffset !== null && { ScheduleOffset: input.ScheduleOffset }), + ...(input.ScheduleTimezone !== undefined && + input.ScheduleTimezone !== null && { ScheduleTimezone: input.ScheduleTimezone }), + ...(input.StartDate !== undefined && input.StartDate !== null && { StartDate: input.StartDate }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateOpsItemRequest = (input: CreateOpsItemRequest, context: __SerdeContext): any => { return { - ...(input.Category !== undefined && { Category: input.Category }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Notifications !== undefined && { - Notifications: serializeAws_json1_1OpsItemNotifications(input.Notifications, context), - }), - ...(input.OperationalData !== undefined && { - OperationalData: serializeAws_json1_1OpsItemOperationalData(input.OperationalData, context), - }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.RelatedOpsItems !== undefined && { - RelatedOpsItems: serializeAws_json1_1RelatedOpsItems(input.RelatedOpsItems, context), - }), - ...(input.Severity !== undefined && { Severity: input.Severity }), - ...(input.Source !== undefined && { Source: input.Source }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.Title !== undefined && { Title: input.Title }), + ...(input.Category !== undefined && input.Category !== null && { Category: input.Category }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Notifications !== undefined && + input.Notifications !== null && { + Notifications: serializeAws_json1_1OpsItemNotifications(input.Notifications, context), + }), + ...(input.OperationalData !== undefined && + input.OperationalData !== null && { + OperationalData: serializeAws_json1_1OpsItemOperationalData(input.OperationalData, context), + }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.RelatedOpsItems !== undefined && + input.RelatedOpsItems !== null && { + RelatedOpsItems: serializeAws_json1_1RelatedOpsItems(input.RelatedOpsItems, context), + }), + ...(input.Severity !== undefined && input.Severity !== null && { Severity: input.Severity }), + ...(input.Source !== undefined && input.Source !== null && { Source: input.Source }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), }; }; @@ -14376,8 +14425,9 @@ const serializeAws_json1_1CreateOpsMetadataRequest = ( context: __SerdeContext ): any => { return { - ...(input.Metadata !== undefined && { Metadata: serializeAws_json1_1MetadataMap(input.Metadata, context) }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.Metadata !== undefined && + input.Metadata !== null && { Metadata: serializeAws_json1_1MetadataMap(input.Metadata, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -14386,31 +14436,40 @@ const serializeAws_json1_1CreatePatchBaselineRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApprovalRules !== undefined && { - ApprovalRules: serializeAws_json1_1PatchRuleGroup(input.ApprovalRules, context), - }), - ...(input.ApprovedPatches !== undefined && { - ApprovedPatches: serializeAws_json1_1PatchIdList(input.ApprovedPatches, context), - }), - ...(input.ApprovedPatchesComplianceLevel !== undefined && { - ApprovedPatchesComplianceLevel: input.ApprovedPatchesComplianceLevel, - }), - ...(input.ApprovedPatchesEnableNonSecurity !== undefined && { - ApprovedPatchesEnableNonSecurity: input.ApprovedPatchesEnableNonSecurity, - }), + ...(input.ApprovalRules !== undefined && + input.ApprovalRules !== null && { + ApprovalRules: serializeAws_json1_1PatchRuleGroup(input.ApprovalRules, context), + }), + ...(input.ApprovedPatches !== undefined && + input.ApprovedPatches !== null && { + ApprovedPatches: serializeAws_json1_1PatchIdList(input.ApprovedPatches, context), + }), + ...(input.ApprovedPatchesComplianceLevel !== undefined && + input.ApprovedPatchesComplianceLevel !== null && { + ApprovedPatchesComplianceLevel: input.ApprovedPatchesComplianceLevel, + }), + ...(input.ApprovedPatchesEnableNonSecurity !== undefined && + input.ApprovedPatchesEnableNonSecurity !== null && { + ApprovedPatchesEnableNonSecurity: input.ApprovedPatchesEnableNonSecurity, + }), ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.GlobalFilters !== undefined && { - GlobalFilters: serializeAws_json1_1PatchFilterGroup(input.GlobalFilters, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OperatingSystem !== undefined && { OperatingSystem: input.OperatingSystem }), - ...(input.RejectedPatches !== undefined && { - RejectedPatches: serializeAws_json1_1PatchIdList(input.RejectedPatches, context), - }), - ...(input.RejectedPatchesAction !== undefined && { RejectedPatchesAction: input.RejectedPatchesAction }), - ...(input.Sources !== undefined && { Sources: serializeAws_json1_1PatchSourceList(input.Sources, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.GlobalFilters !== undefined && + input.GlobalFilters !== null && { + GlobalFilters: serializeAws_json1_1PatchFilterGroup(input.GlobalFilters, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OperatingSystem !== undefined && + input.OperatingSystem !== null && { OperatingSystem: input.OperatingSystem }), + ...(input.RejectedPatches !== undefined && + input.RejectedPatches !== null && { + RejectedPatches: serializeAws_json1_1PatchIdList(input.RejectedPatches, context), + }), + ...(input.RejectedPatchesAction !== undefined && + input.RejectedPatchesAction !== null && { RejectedPatchesAction: input.RejectedPatchesAction }), + ...(input.Sources !== undefined && + input.Sources !== null && { Sources: serializeAws_json1_1PatchSourceList(input.Sources, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -14419,20 +14478,22 @@ const serializeAws_json1_1CreateResourceDataSyncRequest = ( context: __SerdeContext ): any => { return { - ...(input.S3Destination !== undefined && { - S3Destination: serializeAws_json1_1ResourceDataSyncS3Destination(input.S3Destination, context), - }), - ...(input.SyncName !== undefined && { SyncName: input.SyncName }), - ...(input.SyncSource !== undefined && { - SyncSource: serializeAws_json1_1ResourceDataSyncSource(input.SyncSource, context), - }), - ...(input.SyncType !== undefined && { SyncType: input.SyncType }), + ...(input.S3Destination !== undefined && + input.S3Destination !== null && { + S3Destination: serializeAws_json1_1ResourceDataSyncS3Destination(input.S3Destination, context), + }), + ...(input.SyncName !== undefined && input.SyncName !== null && { SyncName: input.SyncName }), + ...(input.SyncSource !== undefined && + input.SyncSource !== null && { + SyncSource: serializeAws_json1_1ResourceDataSyncSource(input.SyncSource, context), + }), + ...(input.SyncType !== undefined && input.SyncType !== null && { SyncType: input.SyncType }), }; }; const serializeAws_json1_1DeleteActivationRequest = (input: DeleteActivationRequest, context: __SerdeContext): any => { return { - ...(input.ActivationId !== undefined && { ActivationId: input.ActivationId }), + ...(input.ActivationId !== undefined && input.ActivationId !== null && { ActivationId: input.ActivationId }), }; }; @@ -14441,27 +14502,29 @@ const serializeAws_json1_1DeleteAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeleteDocumentRequest = (input: DeleteDocumentRequest, context: __SerdeContext): any => { return { - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.Force !== undefined && { Force: input.Force }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.VersionName !== undefined && { VersionName: input.VersionName }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.Force !== undefined && input.Force !== null && { Force: input.Force }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.VersionName !== undefined && input.VersionName !== null && { VersionName: input.VersionName }), }; }; const serializeAws_json1_1DeleteInventoryRequest = (input: DeleteInventoryRequest, context: __SerdeContext): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.DryRun !== undefined && { DryRun: input.DryRun }), - ...(input.SchemaDeleteOption !== undefined && { SchemaDeleteOption: input.SchemaDeleteOption }), - ...(input.TypeName !== undefined && { TypeName: input.TypeName }), + ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }), + ...(input.SchemaDeleteOption !== undefined && + input.SchemaDeleteOption !== null && { SchemaDeleteOption: input.SchemaDeleteOption }), + ...(input.TypeName !== undefined && input.TypeName !== null && { TypeName: input.TypeName }), }; }; @@ -14470,7 +14533,7 @@ const serializeAws_json1_1DeleteMaintenanceWindowRequest = ( context: __SerdeContext ): any => { return { - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), }; }; @@ -14479,19 +14542,21 @@ const serializeAws_json1_1DeleteOpsMetadataRequest = ( context: __SerdeContext ): any => { return { - ...(input.OpsMetadataArn !== undefined && { OpsMetadataArn: input.OpsMetadataArn }), + ...(input.OpsMetadataArn !== undefined && + input.OpsMetadataArn !== null && { OpsMetadataArn: input.OpsMetadataArn }), }; }; const serializeAws_json1_1DeleteParameterRequest = (input: DeleteParameterRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1DeleteParametersRequest = (input: DeleteParametersRequest, context: __SerdeContext): any => { return { - ...(input.Names !== undefined && { Names: serializeAws_json1_1ParameterNameList(input.Names, context) }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1ParameterNameList(input.Names, context) }), }; }; @@ -14500,7 +14565,7 @@ const serializeAws_json1_1DeletePatchBaselineRequest = ( context: __SerdeContext ): any => { return { - ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), + ...(input.BaselineId !== undefined && input.BaselineId !== null && { BaselineId: input.BaselineId }), }; }; @@ -14509,8 +14574,8 @@ const serializeAws_json1_1DeleteResourceDataSyncRequest = ( context: __SerdeContext ): any => { return { - ...(input.SyncName !== undefined && { SyncName: input.SyncName }), - ...(input.SyncType !== undefined && { SyncType: input.SyncType }), + ...(input.SyncName !== undefined && input.SyncName !== null && { SyncName: input.SyncName }), + ...(input.SyncType !== undefined && input.SyncType !== null && { SyncType: input.SyncType }), }; }; @@ -14519,7 +14584,7 @@ const serializeAws_json1_1DeregisterManagedInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; @@ -14528,8 +14593,8 @@ const serializeAws_json1_1DeregisterPatchBaselineForPatchGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), - ...(input.PatchGroup !== undefined && { PatchGroup: input.PatchGroup }), + ...(input.BaselineId !== undefined && input.BaselineId !== null && { BaselineId: input.BaselineId }), + ...(input.PatchGroup !== undefined && input.PatchGroup !== null && { PatchGroup: input.PatchGroup }), }; }; @@ -14538,9 +14603,10 @@ const serializeAws_json1_1DeregisterTargetFromMaintenanceWindowRequest = ( context: __SerdeContext ): any => { return { - ...(input.Safe !== undefined && { Safe: input.Safe }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), - ...(input.WindowTargetId !== undefined && { WindowTargetId: input.WindowTargetId }), + ...(input.Safe !== undefined && input.Safe !== null && { Safe: input.Safe }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), + ...(input.WindowTargetId !== undefined && + input.WindowTargetId !== null && { WindowTargetId: input.WindowTargetId }), }; }; @@ -14549,8 +14615,8 @@ const serializeAws_json1_1DeregisterTaskFromMaintenanceWindowRequest = ( context: __SerdeContext ): any => { return { - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), - ...(input.WindowTaskId !== undefined && { WindowTaskId: input.WindowTaskId }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), + ...(input.WindowTaskId !== undefined && input.WindowTaskId !== null && { WindowTaskId: input.WindowTaskId }), }; }; @@ -14559,10 +14625,9 @@ const serializeAws_json1_1DescribeActivationsFilter = ( context: __SerdeContext ): any => { return { - ...(input.FilterKey !== undefined && { FilterKey: input.FilterKey }), - ...(input.FilterValues !== undefined && { - FilterValues: serializeAws_json1_1StringList(input.FilterValues, context), - }), + ...(input.FilterKey !== undefined && input.FilterKey !== null && { FilterKey: input.FilterKey }), + ...(input.FilterValues !== undefined && + input.FilterValues !== null && { FilterValues: serializeAws_json1_1StringList(input.FilterValues, context) }), }; }; @@ -14570,7 +14635,14 @@ const serializeAws_json1_1DescribeActivationsFilterList = ( input: DescribeActivationsFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1DescribeActivationsFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DescribeActivationsFilter(entry, context); + }); }; const serializeAws_json1_1DescribeActivationsRequest = ( @@ -14578,11 +14650,10 @@ const serializeAws_json1_1DescribeActivationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1DescribeActivationsFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1DescribeActivationsFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14591,12 +14662,13 @@ const serializeAws_json1_1DescribeAssociationExecutionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1AssociationExecutionFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.Filters !== undefined && + input.Filters !== null && { + Filters: serializeAws_json1_1AssociationExecutionFilterList(input.Filters, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14605,13 +14677,14 @@ const serializeAws_json1_1DescribeAssociationExecutionTargetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.ExecutionId !== undefined && { ExecutionId: input.ExecutionId }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1AssociationExecutionTargetsFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.ExecutionId !== undefined && input.ExecutionId !== null && { ExecutionId: input.ExecutionId }), + ...(input.Filters !== undefined && + input.Filters !== null && { + Filters: serializeAws_json1_1AssociationExecutionTargetsFilterList(input.Filters, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14620,10 +14693,11 @@ const serializeAws_json1_1DescribeAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.AssociationVersion !== undefined && { AssociationVersion: input.AssociationVersion }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.AssociationVersion !== undefined && + input.AssociationVersion !== null && { AssociationVersion: input.AssociationVersion }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -14632,11 +14706,10 @@ const serializeAws_json1_1DescribeAutomationExecutionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1AutomationExecutionFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1AutomationExecutionFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14645,13 +14718,13 @@ const serializeAws_json1_1DescribeAutomationStepExecutionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AutomationExecutionId !== undefined && { AutomationExecutionId: input.AutomationExecutionId }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1StepExecutionFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ReverseOrder !== undefined && { ReverseOrder: input.ReverseOrder }), + ...(input.AutomationExecutionId !== undefined && + input.AutomationExecutionId !== null && { AutomationExecutionId: input.AutomationExecutionId }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1StepExecutionFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ReverseOrder !== undefined && input.ReverseOrder !== null && { ReverseOrder: input.ReverseOrder }), }; }; @@ -14660,11 +14733,10 @@ const serializeAws_json1_1DescribeAvailablePatchesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14673,16 +14745,18 @@ const serializeAws_json1_1DescribeDocumentPermissionRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PermissionType !== undefined && { PermissionType: input.PermissionType }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PermissionType !== undefined && + input.PermissionType !== null && { PermissionType: input.PermissionType }), }; }; const serializeAws_json1_1DescribeDocumentRequest = (input: DescribeDocumentRequest, context: __SerdeContext): any => { return { - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.VersionName !== undefined && { VersionName: input.VersionName }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.VersionName !== undefined && input.VersionName !== null && { VersionName: input.VersionName }), }; }; @@ -14691,9 +14765,9 @@ const serializeAws_json1_1DescribeEffectiveInstanceAssociationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14702,9 +14776,9 @@ const serializeAws_json1_1DescribeEffectivePatchesForPatchBaselineRequest = ( context: __SerdeContext ): any => { return { - ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.BaselineId !== undefined && input.BaselineId !== null && { BaselineId: input.BaselineId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14713,9 +14787,9 @@ const serializeAws_json1_1DescribeInstanceAssociationsStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14724,17 +14798,19 @@ const serializeAws_json1_1DescribeInstanceInformationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1InstanceInformationStringFilterList(input.Filters, context), - }), - ...(input.InstanceInformationFilterList !== undefined && { - InstanceInformationFilterList: serializeAws_json1_1InstanceInformationFilterList( - input.InstanceInformationFilterList, - context - ), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { + Filters: serializeAws_json1_1InstanceInformationStringFilterList(input.Filters, context), + }), + ...(input.InstanceInformationFilterList !== undefined && + input.InstanceInformationFilterList !== null && { + InstanceInformationFilterList: serializeAws_json1_1InstanceInformationFilterList( + input.InstanceInformationFilterList, + context + ), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14743,12 +14819,11 @@ const serializeAws_json1_1DescribeInstancePatchesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context), - }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context) }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14757,12 +14832,11 @@ const serializeAws_json1_1DescribeInstancePatchStatesForPatchGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1InstancePatchStateFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PatchGroup !== undefined && { PatchGroup: input.PatchGroup }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1InstancePatchStateFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PatchGroup !== undefined && input.PatchGroup !== null && { PatchGroup: input.PatchGroup }), }; }; @@ -14771,11 +14845,10 @@ const serializeAws_json1_1DescribeInstancePatchStatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceIds !== undefined && { - InstanceIds: serializeAws_json1_1InstanceIdList(input.InstanceIds, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.InstanceIds !== undefined && + input.InstanceIds !== null && { InstanceIds: serializeAws_json1_1InstanceIdList(input.InstanceIds, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14784,9 +14857,9 @@ const serializeAws_json1_1DescribeInventoryDeletionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DeletionId !== undefined && { DeletionId: input.DeletionId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DeletionId !== undefined && input.DeletionId !== null && { DeletionId: input.DeletionId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14795,12 +14868,11 @@ const serializeAws_json1_1DescribeMaintenanceWindowExecutionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), }; }; @@ -14809,13 +14881,13 @@ const serializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocationsReque context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TaskId !== undefined && { TaskId: input.TaskId }), - ...(input.WindowExecutionId !== undefined && { WindowExecutionId: input.WindowExecutionId }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TaskId !== undefined && input.TaskId !== null && { TaskId: input.TaskId }), + ...(input.WindowExecutionId !== undefined && + input.WindowExecutionId !== null && { WindowExecutionId: input.WindowExecutionId }), }; }; @@ -14824,12 +14896,12 @@ const serializeAws_json1_1DescribeMaintenanceWindowExecutionTasksRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.WindowExecutionId !== undefined && { WindowExecutionId: input.WindowExecutionId }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.WindowExecutionId !== undefined && + input.WindowExecutionId !== null && { WindowExecutionId: input.WindowExecutionId }), }; }; @@ -14838,14 +14910,14 @@ const serializeAws_json1_1DescribeMaintenanceWindowScheduleRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), }; }; @@ -14854,10 +14926,11 @@ const serializeAws_json1_1DescribeMaintenanceWindowsForTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), }; }; @@ -14866,11 +14939,10 @@ const serializeAws_json1_1DescribeMaintenanceWindowsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14879,12 +14951,11 @@ const serializeAws_json1_1DescribeMaintenanceWindowTargetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), }; }; @@ -14893,22 +14964,22 @@ const serializeAws_json1_1DescribeMaintenanceWindowTasksRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1MaintenanceWindowFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), }; }; const serializeAws_json1_1DescribeOpsItemsRequest = (input: DescribeOpsItemsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OpsItemFilters !== undefined && { - OpsItemFilters: serializeAws_json1_1OpsItemFilters(input.OpsItemFilters, context), - }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OpsItemFilters !== undefined && + input.OpsItemFilters !== null && { + OpsItemFilters: serializeAws_json1_1OpsItemFilters(input.OpsItemFilters, context), + }), }; }; @@ -14917,12 +14988,14 @@ const serializeAws_json1_1DescribeParametersRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1ParametersFilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ParameterFilters !== undefined && { - ParameterFilters: serializeAws_json1_1ParameterStringFilterList(input.ParameterFilters, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ParametersFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ParameterFilters !== undefined && + input.ParameterFilters !== null && { + ParameterFilters: serializeAws_json1_1ParameterStringFilterList(input.ParameterFilters, context), + }), }; }; @@ -14931,11 +15004,10 @@ const serializeAws_json1_1DescribePatchBaselinesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14944,11 +15016,10 @@ const serializeAws_json1_1DescribePatchGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1PatchOrchestratorFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -14957,7 +15028,7 @@ const serializeAws_json1_1DescribePatchGroupStateRequest = ( context: __SerdeContext ): any => { return { - ...(input.PatchGroup !== undefined && { PatchGroup: input.PatchGroup }), + ...(input.PatchGroup !== undefined && input.PatchGroup !== null && { PatchGroup: input.PatchGroup }), }; }; @@ -14966,40 +15037,48 @@ const serializeAws_json1_1DescribePatchPropertiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OperatingSystem !== undefined && { OperatingSystem: input.OperatingSystem }), - ...(input.PatchSet !== undefined && { PatchSet: input.PatchSet }), - ...(input.Property !== undefined && { Property: input.Property }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OperatingSystem !== undefined && + input.OperatingSystem !== null && { OperatingSystem: input.OperatingSystem }), + ...(input.PatchSet !== undefined && input.PatchSet !== null && { PatchSet: input.PatchSet }), + ...(input.Property !== undefined && input.Property !== null && { Property: input.Property }), }; }; const serializeAws_json1_1DescribeSessionsRequest = (input: DescribeSessionsRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1SessionFilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.State !== undefined && { State: input.State }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1SessionFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.State !== undefined && input.State !== null && { State: input.State }), }; }; const serializeAws_json1_1DocumentFilter = (input: DocumentFilter, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1DocumentFilterList = (input: DocumentFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DocumentFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DocumentFilter(entry, context); + }); }; const serializeAws_json1_1DocumentKeyValuesFilter = (input: DocumentKeyValuesFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1DocumentKeyValuesFilterValues(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1DocumentKeyValuesFilterValues(input.Values, context) }), }; }; @@ -15007,22 +15086,43 @@ const serializeAws_json1_1DocumentKeyValuesFilterList = ( input: DocumentKeyValuesFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1DocumentKeyValuesFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DocumentKeyValuesFilter(entry, context); + }); }; const serializeAws_json1_1DocumentKeyValuesFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DocumentRequires = (input: DocumentRequires, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_json1_1DocumentRequiresList = (input: DocumentRequires[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1DocumentRequires(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1DocumentRequires(entry, context); + }); }; const serializeAws_json1_1GetAutomationExecutionRequest = ( @@ -15030,16 +15130,18 @@ const serializeAws_json1_1GetAutomationExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AutomationExecutionId !== undefined && { AutomationExecutionId: input.AutomationExecutionId }), + ...(input.AutomationExecutionId !== undefined && + input.AutomationExecutionId !== null && { AutomationExecutionId: input.AutomationExecutionId }), }; }; const serializeAws_json1_1GetCalendarStateRequest = (input: GetCalendarStateRequest, context: __SerdeContext): any => { return { - ...(input.AtTime !== undefined && { AtTime: input.AtTime }), - ...(input.CalendarNames !== undefined && { - CalendarNames: serializeAws_json1_1CalendarNameOrARNList(input.CalendarNames, context), - }), + ...(input.AtTime !== undefined && input.AtTime !== null && { AtTime: input.AtTime }), + ...(input.CalendarNames !== undefined && + input.CalendarNames !== null && { + CalendarNames: serializeAws_json1_1CalendarNameOrARNList(input.CalendarNames, context), + }), }; }; @@ -15048,9 +15150,9 @@ const serializeAws_json1_1GetCommandInvocationRequest = ( context: __SerdeContext ): any => { return { - ...(input.CommandId !== undefined && { CommandId: input.CommandId }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.PluginName !== undefined && { PluginName: input.PluginName }), + ...(input.CommandId !== undefined && input.CommandId !== null && { CommandId: input.CommandId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.PluginName !== undefined && input.PluginName !== null && { PluginName: input.PluginName }), }; }; @@ -15059,7 +15161,7 @@ const serializeAws_json1_1GetConnectionStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.Target !== undefined && { Target: input.Target }), + ...(input.Target !== undefined && input.Target !== null && { Target: input.Target }), }; }; @@ -15068,7 +15170,8 @@ const serializeAws_json1_1GetDefaultPatchBaselineRequest = ( context: __SerdeContext ): any => { return { - ...(input.OperatingSystem !== undefined && { OperatingSystem: input.OperatingSystem }), + ...(input.OperatingSystem !== undefined && + input.OperatingSystem !== null && { OperatingSystem: input.OperatingSystem }), }; }; @@ -15077,31 +15180,36 @@ const serializeAws_json1_1GetDeployablePatchSnapshotForInstanceRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.SnapshotId !== undefined && input.SnapshotId !== null && { SnapshotId: input.SnapshotId }), }; }; const serializeAws_json1_1GetDocumentRequest = (input: GetDocumentRequest, context: __SerdeContext): any => { return { - ...(input.DocumentFormat !== undefined && { DocumentFormat: input.DocumentFormat }), - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.VersionName !== undefined && { VersionName: input.VersionName }), + ...(input.DocumentFormat !== undefined && + input.DocumentFormat !== null && { DocumentFormat: input.DocumentFormat }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.VersionName !== undefined && input.VersionName !== null && { VersionName: input.VersionName }), }; }; const serializeAws_json1_1GetInventoryRequest = (input: GetInventoryRequest, context: __SerdeContext): any => { return { - ...(input.Aggregators !== undefined && { - Aggregators: serializeAws_json1_1InventoryAggregatorList(input.Aggregators, context), - }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResultAttributes !== undefined && { - ResultAttributes: serializeAws_json1_1ResultAttributeList(input.ResultAttributes, context), - }), + ...(input.Aggregators !== undefined && + input.Aggregators !== null && { + Aggregators: serializeAws_json1_1InventoryAggregatorList(input.Aggregators, context), + }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResultAttributes !== undefined && + input.ResultAttributes !== null && { + ResultAttributes: serializeAws_json1_1ResultAttributeList(input.ResultAttributes, context), + }), }; }; @@ -15110,11 +15218,11 @@ const serializeAws_json1_1GetInventorySchemaRequest = ( context: __SerdeContext ): any => { return { - ...(input.Aggregator !== undefined && { Aggregator: input.Aggregator }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SubType !== undefined && { SubType: input.SubType }), - ...(input.TypeName !== undefined && { TypeName: input.TypeName }), + ...(input.Aggregator !== undefined && input.Aggregator !== null && { Aggregator: input.Aggregator }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SubType !== undefined && input.SubType !== null && { SubType: input.SubType }), + ...(input.TypeName !== undefined && input.TypeName !== null && { TypeName: input.TypeName }), }; }; @@ -15123,7 +15231,8 @@ const serializeAws_json1_1GetMaintenanceWindowExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.WindowExecutionId !== undefined && { WindowExecutionId: input.WindowExecutionId }), + ...(input.WindowExecutionId !== undefined && + input.WindowExecutionId !== null && { WindowExecutionId: input.WindowExecutionId }), }; }; @@ -15132,9 +15241,10 @@ const serializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationRequest = ( context: __SerdeContext ): any => { return { - ...(input.InvocationId !== undefined && { InvocationId: input.InvocationId }), - ...(input.TaskId !== undefined && { TaskId: input.TaskId }), - ...(input.WindowExecutionId !== undefined && { WindowExecutionId: input.WindowExecutionId }), + ...(input.InvocationId !== undefined && input.InvocationId !== null && { InvocationId: input.InvocationId }), + ...(input.TaskId !== undefined && input.TaskId !== null && { TaskId: input.TaskId }), + ...(input.WindowExecutionId !== undefined && + input.WindowExecutionId !== null && { WindowExecutionId: input.WindowExecutionId }), }; }; @@ -15143,8 +15253,9 @@ const serializeAws_json1_1GetMaintenanceWindowExecutionTaskRequest = ( context: __SerdeContext ): any => { return { - ...(input.TaskId !== undefined && { TaskId: input.TaskId }), - ...(input.WindowExecutionId !== undefined && { WindowExecutionId: input.WindowExecutionId }), + ...(input.TaskId !== undefined && input.TaskId !== null && { TaskId: input.TaskId }), + ...(input.WindowExecutionId !== undefined && + input.WindowExecutionId !== null && { WindowExecutionId: input.WindowExecutionId }), }; }; @@ -15153,7 +15264,7 @@ const serializeAws_json1_1GetMaintenanceWindowRequest = ( context: __SerdeContext ): any => { return { - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), }; }; @@ -15162,37 +15273,39 @@ const serializeAws_json1_1GetMaintenanceWindowTaskRequest = ( context: __SerdeContext ): any => { return { - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), - ...(input.WindowTaskId !== undefined && { WindowTaskId: input.WindowTaskId }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), + ...(input.WindowTaskId !== undefined && input.WindowTaskId !== null && { WindowTaskId: input.WindowTaskId }), }; }; const serializeAws_json1_1GetOpsItemRequest = (input: GetOpsItemRequest, context: __SerdeContext): any => { return { - ...(input.OpsItemId !== undefined && { OpsItemId: input.OpsItemId }), + ...(input.OpsItemId !== undefined && input.OpsItemId !== null && { OpsItemId: input.OpsItemId }), }; }; const serializeAws_json1_1GetOpsMetadataRequest = (input: GetOpsMetadataRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OpsMetadataArn !== undefined && { OpsMetadataArn: input.OpsMetadataArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OpsMetadataArn !== undefined && + input.OpsMetadataArn !== null && { OpsMetadataArn: input.OpsMetadataArn }), }; }; const serializeAws_json1_1GetOpsSummaryRequest = (input: GetOpsSummaryRequest, context: __SerdeContext): any => { return { - ...(input.Aggregators !== undefined && { - Aggregators: serializeAws_json1_1OpsAggregatorList(input.Aggregators, context), - }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1OpsFilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResultAttributes !== undefined && { - ResultAttributes: serializeAws_json1_1OpsResultAttributeList(input.ResultAttributes, context), - }), - ...(input.SyncName !== undefined && { SyncName: input.SyncName }), + ...(input.Aggregators !== undefined && + input.Aggregators !== null && { Aggregators: serializeAws_json1_1OpsAggregatorList(input.Aggregators, context) }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1OpsFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResultAttributes !== undefined && + input.ResultAttributes !== null && { + ResultAttributes: serializeAws_json1_1OpsResultAttributeList(input.ResultAttributes, context), + }), + ...(input.SyncName !== undefined && input.SyncName !== null && { SyncName: input.SyncName }), }; }; @@ -15201,17 +15314,19 @@ const serializeAws_json1_1GetParameterHistoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.WithDecryption !== undefined && { WithDecryption: input.WithDecryption }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.WithDecryption !== undefined && + input.WithDecryption !== null && { WithDecryption: input.WithDecryption }), }; }; const serializeAws_json1_1GetParameterRequest = (input: GetParameterRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.WithDecryption !== undefined && { WithDecryption: input.WithDecryption }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.WithDecryption !== undefined && + input.WithDecryption !== null && { WithDecryption: input.WithDecryption }), }; }; @@ -15220,21 +15335,25 @@ const serializeAws_json1_1GetParametersByPathRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ParameterFilters !== undefined && { - ParameterFilters: serializeAws_json1_1ParameterStringFilterList(input.ParameterFilters, context), - }), - ...(input.Path !== undefined && { Path: input.Path }), - ...(input.Recursive !== undefined && { Recursive: input.Recursive }), - ...(input.WithDecryption !== undefined && { WithDecryption: input.WithDecryption }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ParameterFilters !== undefined && + input.ParameterFilters !== null && { + ParameterFilters: serializeAws_json1_1ParameterStringFilterList(input.ParameterFilters, context), + }), + ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }), + ...(input.Recursive !== undefined && input.Recursive !== null && { Recursive: input.Recursive }), + ...(input.WithDecryption !== undefined && + input.WithDecryption !== null && { WithDecryption: input.WithDecryption }), }; }; const serializeAws_json1_1GetParametersRequest = (input: GetParametersRequest, context: __SerdeContext): any => { return { - ...(input.Names !== undefined && { Names: serializeAws_json1_1ParameterNameList(input.Names, context) }), - ...(input.WithDecryption !== undefined && { WithDecryption: input.WithDecryption }), + ...(input.Names !== undefined && + input.Names !== null && { Names: serializeAws_json1_1ParameterNameList(input.Names, context) }), + ...(input.WithDecryption !== undefined && + input.WithDecryption !== null && { WithDecryption: input.WithDecryption }), }; }; @@ -15243,14 +15362,15 @@ const serializeAws_json1_1GetPatchBaselineForPatchGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.OperatingSystem !== undefined && { OperatingSystem: input.OperatingSystem }), - ...(input.PatchGroup !== undefined && { PatchGroup: input.PatchGroup }), + ...(input.OperatingSystem !== undefined && + input.OperatingSystem !== null && { OperatingSystem: input.OperatingSystem }), + ...(input.PatchGroup !== undefined && input.PatchGroup !== null && { PatchGroup: input.PatchGroup }), }; }; const serializeAws_json1_1GetPatchBaselineRequest = (input: GetPatchBaselineRequest, context: __SerdeContext): any => { return { - ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), + ...(input.BaselineId !== undefined && input.BaselineId !== null && { BaselineId: input.BaselineId }), }; }; @@ -15259,7 +15379,7 @@ const serializeAws_json1_1GetServiceSettingRequest = ( context: __SerdeContext ): any => { return { - ...(input.SettingId !== undefined && { SettingId: input.SettingId }), + ...(input.SettingId !== undefined && input.SettingId !== null && { SettingId: input.SettingId }), }; }; @@ -15268,14 +15388,20 @@ const serializeAws_json1_1InstanceAssociationOutputLocation = ( context: __SerdeContext ): any => { return { - ...(input.S3Location !== undefined && { - S3Location: serializeAws_json1_1S3OutputLocation(input.S3Location, context), - }), + ...(input.S3Location !== undefined && + input.S3Location !== null && { S3Location: serializeAws_json1_1S3OutputLocation(input.S3Location, context) }), }; }; const serializeAws_json1_1InstanceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InstanceInformationFilter = ( @@ -15283,10 +15409,11 @@ const serializeAws_json1_1InstanceInformationFilter = ( context: __SerdeContext ): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.valueSet !== undefined && { - valueSet: serializeAws_json1_1InstanceInformationFilterValueSet(input.valueSet, context), - }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.valueSet !== undefined && + input.valueSet !== null && { + valueSet: serializeAws_json1_1InstanceInformationFilterValueSet(input.valueSet, context), + }), }; }; @@ -15294,11 +15421,25 @@ const serializeAws_json1_1InstanceInformationFilterList = ( input: InstanceInformationFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1InstanceInformationFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InstanceInformationFilter(entry, context); + }); }; const serializeAws_json1_1InstanceInformationFilterValueSet = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InstanceInformationStringFilter = ( @@ -15306,10 +15447,11 @@ const serializeAws_json1_1InstanceInformationStringFilter = ( context: __SerdeContext ): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1InstanceInformationFilterValueSet(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { + Values: serializeAws_json1_1InstanceInformationFilterValueSet(input.Values, context), + }), }; }; @@ -15317,7 +15459,14 @@ const serializeAws_json1_1InstanceInformationStringFilterList = ( input: InstanceInformationStringFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1InstanceInformationStringFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InstanceInformationStringFilter(entry, context); + }); }; const serializeAws_json1_1InstancePatchStateFilter = ( @@ -15325,11 +15474,10 @@ const serializeAws_json1_1InstancePatchStateFilter = ( context: __SerdeContext ): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1InstancePatchStateFilterValues(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1InstancePatchStateFilterValues(input.Values, context) }), }; }; @@ -15337,64 +15485,110 @@ const serializeAws_json1_1InstancePatchStateFilterList = ( input: InstancePatchStateFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1InstancePatchStateFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InstancePatchStateFilter(entry, context); + }); }; const serializeAws_json1_1InstancePatchStateFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InventoryAggregator = (input: InventoryAggregator, context: __SerdeContext): any => { return { - ...(input.Aggregators !== undefined && { - Aggregators: serializeAws_json1_1InventoryAggregatorList(input.Aggregators, context), - }), - ...(input.Expression !== undefined && { Expression: input.Expression }), - ...(input.Groups !== undefined && { Groups: serializeAws_json1_1InventoryGroupList(input.Groups, context) }), + ...(input.Aggregators !== undefined && + input.Aggregators !== null && { + Aggregators: serializeAws_json1_1InventoryAggregatorList(input.Aggregators, context), + }), + ...(input.Expression !== undefined && input.Expression !== null && { Expression: input.Expression }), + ...(input.Groups !== undefined && + input.Groups !== null && { Groups: serializeAws_json1_1InventoryGroupList(input.Groups, context) }), }; }; const serializeAws_json1_1InventoryAggregatorList = (input: InventoryAggregator[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InventoryAggregator(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InventoryAggregator(entry, context); + }); }; const serializeAws_json1_1InventoryFilter = (input: InventoryFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1InventoryFilterValueList(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1InventoryFilterValueList(input.Values, context) }), }; }; const serializeAws_json1_1InventoryFilterList = (input: InventoryFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InventoryFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InventoryFilter(entry, context); + }); }; const serializeAws_json1_1InventoryFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1InventoryGroup = (input: InventoryGroup, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1InventoryGroupList = (input: InventoryGroup[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InventoryGroup(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InventoryGroup(entry, context); + }); }; const serializeAws_json1_1InventoryItem = (input: InventoryItem, context: __SerdeContext): any => { return { - ...(input.CaptureTime !== undefined && { CaptureTime: input.CaptureTime }), - ...(input.Content !== undefined && { Content: serializeAws_json1_1InventoryItemEntryList(input.Content, context) }), - ...(input.ContentHash !== undefined && { ContentHash: input.ContentHash }), - ...(input.Context !== undefined && { - Context: serializeAws_json1_1InventoryItemContentContext(input.Context, context), - }), - ...(input.SchemaVersion !== undefined && { SchemaVersion: input.SchemaVersion }), - ...(input.TypeName !== undefined && { TypeName: input.TypeName }), + ...(input.CaptureTime !== undefined && input.CaptureTime !== null && { CaptureTime: input.CaptureTime }), + ...(input.Content !== undefined && + input.Content !== null && { Content: serializeAws_json1_1InventoryItemEntryList(input.Content, context) }), + ...(input.ContentHash !== undefined && input.ContentHash !== null && { ContentHash: input.ContentHash }), + ...(input.Context !== undefined && + input.Context !== null && { Context: serializeAws_json1_1InventoryItemContentContext(input.Context, context) }), + ...(input.SchemaVersion !== undefined && input.SchemaVersion !== null && { SchemaVersion: input.SchemaVersion }), + ...(input.TypeName !== undefined && input.TypeName !== null && { TypeName: input.TypeName }), }; }; @@ -15402,38 +15596,63 @@ const serializeAws_json1_1InventoryItemContentContext = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1InventoryItemEntry = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1InventoryItemEntryList = ( input: { [key: string]: string }[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1InventoryItemEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InventoryItemEntry(entry, context); + }); }; const serializeAws_json1_1InventoryItemList = (input: InventoryItem[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1InventoryItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1InventoryItem(entry, context); + }); }; const serializeAws_json1_1KeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1LabelParameterVersionRequest = ( @@ -15441,19 +15660,22 @@ const serializeAws_json1_1LabelParameterVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.Labels !== undefined && { Labels: serializeAws_json1_1ParameterLabelList(input.Labels, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParameterVersion !== undefined && { ParameterVersion: input.ParameterVersion }), + ...(input.Labels !== undefined && + input.Labels !== null && { Labels: serializeAws_json1_1ParameterLabelList(input.Labels, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParameterVersion !== undefined && + input.ParameterVersion !== null && { ParameterVersion: input.ParameterVersion }), }; }; const serializeAws_json1_1ListAssociationsRequest = (input: ListAssociationsRequest, context: __SerdeContext): any => { return { - ...(input.AssociationFilterList !== undefined && { - AssociationFilterList: serializeAws_json1_1AssociationFilterList(input.AssociationFilterList, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AssociationFilterList !== undefined && + input.AssociationFilterList !== null && { + AssociationFilterList: serializeAws_json1_1AssociationFilterList(input.AssociationFilterList, context), + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -15462,9 +15684,9 @@ const serializeAws_json1_1ListAssociationVersionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -15473,22 +15695,24 @@ const serializeAws_json1_1ListCommandInvocationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.CommandId !== undefined && { CommandId: input.CommandId }), - ...(input.Details !== undefined && { Details: input.Details }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1CommandFilterList(input.Filters, context) }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CommandId !== undefined && input.CommandId !== null && { CommandId: input.CommandId }), + ...(input.Details !== undefined && input.Details !== null && { Details: input.Details }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1CommandFilterList(input.Filters, context) }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListCommandsRequest = (input: ListCommandsRequest, context: __SerdeContext): any => { return { - ...(input.CommandId !== undefined && { CommandId: input.CommandId }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1CommandFilterList(input.Filters, context) }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.CommandId !== undefined && input.CommandId !== null && { CommandId: input.CommandId }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1CommandFilterList(input.Filters, context) }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -15497,17 +15721,18 @@ const serializeAws_json1_1ListComplianceItemsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1ComplianceStringFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceIds !== undefined && { - ResourceIds: serializeAws_json1_1ComplianceResourceIdList(input.ResourceIds, context), - }), - ...(input.ResourceTypes !== undefined && { - ResourceTypes: serializeAws_json1_1ComplianceResourceTypeList(input.ResourceTypes, context), - }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ComplianceStringFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceIds !== undefined && + input.ResourceIds !== null && { + ResourceIds: serializeAws_json1_1ComplianceResourceIdList(input.ResourceIds, context), + }), + ...(input.ResourceTypes !== undefined && + input.ResourceTypes !== null && { + ResourceTypes: serializeAws_json1_1ComplianceResourceTypeList(input.ResourceTypes, context), + }), }; }; @@ -15516,24 +15741,23 @@ const serializeAws_json1_1ListComplianceSummariesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1ComplianceStringFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ComplianceStringFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListDocumentsRequest = (input: ListDocumentsRequest, context: __SerdeContext): any => { return { - ...(input.DocumentFilterList !== undefined && { - DocumentFilterList: serializeAws_json1_1DocumentFilterList(input.DocumentFilterList, context), - }), - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1DocumentKeyValuesFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DocumentFilterList !== undefined && + input.DocumentFilterList !== null && { + DocumentFilterList: serializeAws_json1_1DocumentFilterList(input.DocumentFilterList, context), + }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1DocumentKeyValuesFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -15542,9 +15766,9 @@ const serializeAws_json1_1ListDocumentVersionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -15553,19 +15777,21 @@ const serializeAws_json1_1ListInventoryEntriesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TypeName !== undefined && { TypeName: input.TypeName }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TypeName !== undefined && input.TypeName !== null && { TypeName: input.TypeName }), }; }; const serializeAws_json1_1ListOpsMetadataRequest = (input: ListOpsMetadataRequest, context: __SerdeContext): any => { return { - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1OpsMetadataFilterList(input.Filters, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1OpsMetadataFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -15574,11 +15800,10 @@ const serializeAws_json1_1ListResourceComplianceSummariesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filters !== undefined && { - Filters: serializeAws_json1_1ComplianceStringFilterList(input.Filters, context), - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1ComplianceStringFilterList(input.Filters, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -15587,9 +15812,9 @@ const serializeAws_json1_1ListResourceDataSyncRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.SyncType !== undefined && { SyncType: input.SyncType }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.SyncType !== undefined && input.SyncType !== null && { SyncType: input.SyncType }), }; }; @@ -15598,16 +15823,16 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), }; }; const serializeAws_json1_1LoggingInfo = (input: LoggingInfo, context: __SerdeContext): any => { return { - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.S3KeyPrefix !== undefined && { S3KeyPrefix: input.S3KeyPrefix }), - ...(input.S3Region !== undefined && { S3Region: input.S3Region }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.S3KeyPrefix !== undefined && input.S3KeyPrefix !== null && { S3KeyPrefix: input.S3KeyPrefix }), + ...(input.S3Region !== undefined && input.S3Region !== null && { S3Region: input.S3Region }), }; }; @@ -15616,19 +15841,20 @@ const serializeAws_json1_1MaintenanceWindowAutomationParameters = ( context: __SerdeContext ): any => { return { - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1AutomationParameterMap(input.Parameters, context), - }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_1AutomationParameterMap(input.Parameters, context), + }), }; }; const serializeAws_json1_1MaintenanceWindowFilter = (input: MaintenanceWindowFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1MaintenanceWindowFilterValues(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1MaintenanceWindowFilterValues(input.Values, context) }), }; }; @@ -15636,11 +15862,25 @@ const serializeAws_json1_1MaintenanceWindowFilterList = ( input: MaintenanceWindowFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1MaintenanceWindowFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1MaintenanceWindowFilter(entry, context); + }); }; const serializeAws_json1_1MaintenanceWindowFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MaintenanceWindowLambdaParameters = ( @@ -15648,9 +15888,9 @@ const serializeAws_json1_1MaintenanceWindowLambdaParameters = ( context: __SerdeContext ): any => { return { - ...(input.ClientContext !== undefined && { ClientContext: input.ClientContext }), - ...(input.Payload !== undefined && { Payload: context.base64Encoder(input.Payload) }), - ...(input.Qualifier !== undefined && { Qualifier: input.Qualifier }), + ...(input.ClientContext !== undefined && input.ClientContext !== null && { ClientContext: input.ClientContext }), + ...(input.Payload !== undefined && input.Payload !== null && { Payload: context.base64Encoder(input.Payload) }), + ...(input.Qualifier !== undefined && input.Qualifier !== null && { Qualifier: input.Qualifier }), }; }; @@ -15659,21 +15899,30 @@ const serializeAws_json1_1MaintenanceWindowRunCommandParameters = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchOutputConfig !== undefined && { - CloudWatchOutputConfig: serializeAws_json1_1CloudWatchOutputConfig(input.CloudWatchOutputConfig, context), - }), - ...(input.Comment !== undefined && { Comment: input.Comment }), - ...(input.DocumentHash !== undefined && { DocumentHash: input.DocumentHash }), - ...(input.DocumentHashType !== undefined && { DocumentHashType: input.DocumentHashType }), - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.NotificationConfig !== undefined && { - NotificationConfig: serializeAws_json1_1NotificationConfig(input.NotificationConfig, context), - }), - ...(input.OutputS3BucketName !== undefined && { OutputS3BucketName: input.OutputS3BucketName }), - ...(input.OutputS3KeyPrefix !== undefined && { OutputS3KeyPrefix: input.OutputS3KeyPrefix }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), - ...(input.ServiceRoleArn !== undefined && { ServiceRoleArn: input.ServiceRoleArn }), - ...(input.TimeoutSeconds !== undefined && { TimeoutSeconds: input.TimeoutSeconds }), + ...(input.CloudWatchOutputConfig !== undefined && + input.CloudWatchOutputConfig !== null && { + CloudWatchOutputConfig: serializeAws_json1_1CloudWatchOutputConfig(input.CloudWatchOutputConfig, context), + }), + ...(input.Comment !== undefined && input.Comment !== null && { Comment: input.Comment }), + ...(input.DocumentHash !== undefined && input.DocumentHash !== null && { DocumentHash: input.DocumentHash }), + ...(input.DocumentHashType !== undefined && + input.DocumentHashType !== null && { DocumentHashType: input.DocumentHashType }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.NotificationConfig !== undefined && + input.NotificationConfig !== null && { + NotificationConfig: serializeAws_json1_1NotificationConfig(input.NotificationConfig, context), + }), + ...(input.OutputS3BucketName !== undefined && + input.OutputS3BucketName !== null && { OutputS3BucketName: input.OutputS3BucketName }), + ...(input.OutputS3KeyPrefix !== undefined && + input.OutputS3KeyPrefix !== null && { OutputS3KeyPrefix: input.OutputS3KeyPrefix }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), + ...(input.ServiceRoleArn !== undefined && + input.ServiceRoleArn !== null && { ServiceRoleArn: input.ServiceRoleArn }), + ...(input.TimeoutSeconds !== undefined && + input.TimeoutSeconds !== null && { TimeoutSeconds: input.TimeoutSeconds }), }; }; @@ -15682,8 +15931,8 @@ const serializeAws_json1_1MaintenanceWindowStepFunctionsParameters = ( context: __SerdeContext ): any => { return { - ...(input.Input !== undefined && { Input: input.Input }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Input !== undefined && input.Input !== null && { Input: input.Input }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -15692,18 +15941,22 @@ const serializeAws_json1_1MaintenanceWindowTaskInvocationParameters = ( context: __SerdeContext ): any => { return { - ...(input.Automation !== undefined && { - Automation: serializeAws_json1_1MaintenanceWindowAutomationParameters(input.Automation, context), - }), - ...(input.Lambda !== undefined && { - Lambda: serializeAws_json1_1MaintenanceWindowLambdaParameters(input.Lambda, context), - }), - ...(input.RunCommand !== undefined && { - RunCommand: serializeAws_json1_1MaintenanceWindowRunCommandParameters(input.RunCommand, context), - }), - ...(input.StepFunctions !== undefined && { - StepFunctions: serializeAws_json1_1MaintenanceWindowStepFunctionsParameters(input.StepFunctions, context), - }), + ...(input.Automation !== undefined && + input.Automation !== null && { + Automation: serializeAws_json1_1MaintenanceWindowAutomationParameters(input.Automation, context), + }), + ...(input.Lambda !== undefined && + input.Lambda !== null && { + Lambda: serializeAws_json1_1MaintenanceWindowLambdaParameters(input.Lambda, context), + }), + ...(input.RunCommand !== undefined && + input.RunCommand !== null && { + RunCommand: serializeAws_json1_1MaintenanceWindowRunCommandParameters(input.RunCommand, context), + }), + ...(input.StepFunctions !== undefined && + input.StepFunctions !== null && { + StepFunctions: serializeAws_json1_1MaintenanceWindowStepFunctionsParameters(input.StepFunctions, context), + }), }; }; @@ -15712,10 +15965,15 @@ const serializeAws_json1_1MaintenanceWindowTaskParameters = ( context: __SerdeContext ): any => { return Object.entries(input).reduce( - (acc: { [key: string]: MaintenanceWindowTaskParameterValueExpression }, [key, value]: [string, any]) => ({ - ...acc, - [key]: serializeAws_json1_1MaintenanceWindowTaskParameterValueExpression(value, context), - }), + (acc: { [key: string]: MaintenanceWindowTaskParameterValueExpression }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: serializeAws_json1_1MaintenanceWindowTaskParameterValueExpression(value, context), + }; + }, {} ); }; @@ -15725,33 +15983,50 @@ const serializeAws_json1_1MaintenanceWindowTaskParameterValueExpression = ( context: __SerdeContext ): any => { return { - ...(input.Values !== undefined && { - Values: serializeAws_json1_1MaintenanceWindowTaskParameterValueList(input.Values, context), - }), + ...(input.Values !== undefined && + input.Values !== null && { + Values: serializeAws_json1_1MaintenanceWindowTaskParameterValueList(input.Values, context), + }), }; }; const serializeAws_json1_1MaintenanceWindowTaskParameterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MetadataKeysToDeleteList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1MetadataMap = (input: { [key: string]: MetadataValue }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: MetadataValue }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: MetadataValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1MetadataValue(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1MetadataValue = (input: MetadataValue, context: __SerdeContext): any => { return { - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; @@ -15760,25 +16035,32 @@ const serializeAws_json1_1ModifyDocumentPermissionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountIdsToAdd !== undefined && { - AccountIdsToAdd: serializeAws_json1_1AccountIdList(input.AccountIdsToAdd, context), - }), - ...(input.AccountIdsToRemove !== undefined && { - AccountIdsToRemove: serializeAws_json1_1AccountIdList(input.AccountIdsToRemove, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.PermissionType !== undefined && { PermissionType: input.PermissionType }), - ...(input.SharedDocumentVersion !== undefined && { SharedDocumentVersion: input.SharedDocumentVersion }), + ...(input.AccountIdsToAdd !== undefined && + input.AccountIdsToAdd !== null && { + AccountIdsToAdd: serializeAws_json1_1AccountIdList(input.AccountIdsToAdd, context), + }), + ...(input.AccountIdsToRemove !== undefined && + input.AccountIdsToRemove !== null && { + AccountIdsToRemove: serializeAws_json1_1AccountIdList(input.AccountIdsToRemove, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.PermissionType !== undefined && + input.PermissionType !== null && { PermissionType: input.PermissionType }), + ...(input.SharedDocumentVersion !== undefined && + input.SharedDocumentVersion !== null && { SharedDocumentVersion: input.SharedDocumentVersion }), }; }; const serializeAws_json1_1NotificationConfig = (input: NotificationConfig, context: __SerdeContext): any => { return { - ...(input.NotificationArn !== undefined && { NotificationArn: input.NotificationArn }), - ...(input.NotificationEvents !== undefined && { - NotificationEvents: serializeAws_json1_1NotificationEventList(input.NotificationEvents, context), - }), - ...(input.NotificationType !== undefined && { NotificationType: input.NotificationType }), + ...(input.NotificationArn !== undefined && + input.NotificationArn !== null && { NotificationArn: input.NotificationArn }), + ...(input.NotificationEvents !== undefined && + input.NotificationEvents !== null && { + NotificationEvents: serializeAws_json1_1NotificationEventList(input.NotificationEvents, context), + }), + ...(input.NotificationType !== undefined && + input.NotificationType !== null && { NotificationType: input.NotificationType }), }; }; @@ -15786,169 +16068,283 @@ const serializeAws_json1_1NotificationEventList = ( input: (NotificationEvent | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OpsAggregator = (input: OpsAggregator, context: __SerdeContext): any => { return { - ...(input.AggregatorType !== undefined && { AggregatorType: input.AggregatorType }), - ...(input.Aggregators !== undefined && { - Aggregators: serializeAws_json1_1OpsAggregatorList(input.Aggregators, context), - }), - ...(input.AttributeName !== undefined && { AttributeName: input.AttributeName }), - ...(input.Filters !== undefined && { Filters: serializeAws_json1_1OpsFilterList(input.Filters, context) }), - ...(input.TypeName !== undefined && { TypeName: input.TypeName }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1OpsAggregatorValueMap(input.Values, context) }), + ...(input.AggregatorType !== undefined && + input.AggregatorType !== null && { AggregatorType: input.AggregatorType }), + ...(input.Aggregators !== undefined && + input.Aggregators !== null && { Aggregators: serializeAws_json1_1OpsAggregatorList(input.Aggregators, context) }), + ...(input.AttributeName !== undefined && input.AttributeName !== null && { AttributeName: input.AttributeName }), + ...(input.Filters !== undefined && + input.Filters !== null && { Filters: serializeAws_json1_1OpsFilterList(input.Filters, context) }), + ...(input.TypeName !== undefined && input.TypeName !== null && { TypeName: input.TypeName }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1OpsAggregatorValueMap(input.Values, context) }), }; }; const serializeAws_json1_1OpsAggregatorList = (input: OpsAggregator[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OpsAggregator(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OpsAggregator(entry, context); + }); }; const serializeAws_json1_1OpsAggregatorValueMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1OpsFilter = (input: OpsFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1OpsFilterValueList(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1OpsFilterValueList(input.Values, context) }), }; }; const serializeAws_json1_1OpsFilterList = (input: OpsFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OpsFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OpsFilter(entry, context); + }); }; const serializeAws_json1_1OpsFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OpsItemDataValue = (input: OpsItemDataValue, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1OpsItemFilter = (input: OpsItemFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Operator !== undefined && { Operator: input.Operator }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1OpsItemFilterValues(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Operator !== undefined && input.Operator !== null && { Operator: input.Operator }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1OpsItemFilterValues(input.Values, context) }), }; }; const serializeAws_json1_1OpsItemFilters = (input: OpsItemFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OpsItemFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OpsItemFilter(entry, context); + }); }; const serializeAws_json1_1OpsItemFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OpsItemNotification = (input: OpsItemNotification, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), }; }; const serializeAws_json1_1OpsItemNotifications = (input: OpsItemNotification[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OpsItemNotification(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OpsItemNotification(entry, context); + }); }; const serializeAws_json1_1OpsItemOperationalData = ( input: { [key: string]: OpsItemDataValue }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: OpsItemDataValue }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: OpsItemDataValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1OpsItemDataValue(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1OpsItemOpsDataKeysList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OpsMetadataFilter = (input: OpsMetadataFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1OpsMetadataFilterValueList(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1OpsMetadataFilterValueList(input.Values, context) }), }; }; const serializeAws_json1_1OpsMetadataFilterList = (input: OpsMetadataFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OpsMetadataFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OpsMetadataFilter(entry, context); + }); }; const serializeAws_json1_1OpsMetadataFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1OpsResultAttribute = (input: OpsResultAttribute, context: __SerdeContext): any => { return { - ...(input.TypeName !== undefined && { TypeName: input.TypeName }), + ...(input.TypeName !== undefined && input.TypeName !== null && { TypeName: input.TypeName }), }; }; const serializeAws_json1_1OpsResultAttributeList = (input: OpsResultAttribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1OpsResultAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1OpsResultAttribute(entry, context); + }); }; const serializeAws_json1_1ParameterLabelList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ParameterNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Parameters = (input: { [key: string]: string[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1ParameterValueList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1ParametersFilter = (input: ParametersFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1ParametersFilterValueList(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1ParametersFilterValueList(input.Values, context) }), }; }; const serializeAws_json1_1ParametersFilterList = (input: ParametersFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ParametersFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ParametersFilter(entry, context); + }); }; const serializeAws_json1_1ParametersFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ParameterStringFilter = (input: ParameterStringFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Option !== undefined && { Option: input.Option }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1ParameterStringFilterValueList(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Option !== undefined && input.Option !== null && { Option: input.Option }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1ParameterStringFilterValueList(input.Values, context) }), }; }; @@ -15956,50 +16352,93 @@ const serializeAws_json1_1ParameterStringFilterList = ( input: ParameterStringFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ParameterStringFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ParameterStringFilter(entry, context); + }); }; const serializeAws_json1_1ParameterStringFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ParameterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PatchFilter = (input: PatchFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1PatchFilterValueList(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1PatchFilterValueList(input.Values, context) }), }; }; const serializeAws_json1_1PatchFilterGroup = (input: PatchFilterGroup, context: __SerdeContext): any => { return { - ...(input.PatchFilters !== undefined && { - PatchFilters: serializeAws_json1_1PatchFilterList(input.PatchFilters, context), - }), + ...(input.PatchFilters !== undefined && + input.PatchFilters !== null && { + PatchFilters: serializeAws_json1_1PatchFilterList(input.PatchFilters, context), + }), }; }; const serializeAws_json1_1PatchFilterList = (input: PatchFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PatchFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PatchFilter(entry, context); + }); }; const serializeAws_json1_1PatchFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PatchIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PatchOrchestratorFilter = (input: PatchOrchestratorFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1PatchOrchestratorFilterValues(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1PatchOrchestratorFilterValues(input.Values, context) }), }; }; @@ -16007,51 +16446,91 @@ const serializeAws_json1_1PatchOrchestratorFilterList = ( input: PatchOrchestratorFilter[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1PatchOrchestratorFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PatchOrchestratorFilter(entry, context); + }); }; const serializeAws_json1_1PatchOrchestratorFilterValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PatchRule = (input: PatchRule, context: __SerdeContext): any => { return { - ...(input.ApproveAfterDays !== undefined && { ApproveAfterDays: input.ApproveAfterDays }), - ...(input.ApproveUntilDate !== undefined && { ApproveUntilDate: input.ApproveUntilDate }), - ...(input.ComplianceLevel !== undefined && { ComplianceLevel: input.ComplianceLevel }), - ...(input.EnableNonSecurity !== undefined && { EnableNonSecurity: input.EnableNonSecurity }), - ...(input.PatchFilterGroup !== undefined && { - PatchFilterGroup: serializeAws_json1_1PatchFilterGroup(input.PatchFilterGroup, context), - }), + ...(input.ApproveAfterDays !== undefined && + input.ApproveAfterDays !== null && { ApproveAfterDays: input.ApproveAfterDays }), + ...(input.ApproveUntilDate !== undefined && + input.ApproveUntilDate !== null && { ApproveUntilDate: input.ApproveUntilDate }), + ...(input.ComplianceLevel !== undefined && + input.ComplianceLevel !== null && { ComplianceLevel: input.ComplianceLevel }), + ...(input.EnableNonSecurity !== undefined && + input.EnableNonSecurity !== null && { EnableNonSecurity: input.EnableNonSecurity }), + ...(input.PatchFilterGroup !== undefined && + input.PatchFilterGroup !== null && { + PatchFilterGroup: serializeAws_json1_1PatchFilterGroup(input.PatchFilterGroup, context), + }), }; }; const serializeAws_json1_1PatchRuleGroup = (input: PatchRuleGroup, context: __SerdeContext): any => { return { - ...(input.PatchRules !== undefined && { PatchRules: serializeAws_json1_1PatchRuleList(input.PatchRules, context) }), + ...(input.PatchRules !== undefined && + input.PatchRules !== null && { PatchRules: serializeAws_json1_1PatchRuleList(input.PatchRules, context) }), }; }; const serializeAws_json1_1PatchRuleList = (input: PatchRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PatchRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PatchRule(entry, context); + }); }; const serializeAws_json1_1PatchSource = (input: PatchSource, context: __SerdeContext): any => { return { - ...(input.Configuration !== undefined && { Configuration: input.Configuration }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Products !== undefined && { - Products: serializeAws_json1_1PatchSourceProductList(input.Products, context), - }), + ...(input.Configuration !== undefined && input.Configuration !== null && { Configuration: input.Configuration }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Products !== undefined && + input.Products !== null && { Products: serializeAws_json1_1PatchSourceProductList(input.Products, context) }), }; }; const serializeAws_json1_1PatchSourceList = (input: PatchSource[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1PatchSource(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1PatchSource(entry, context); + }); }; const serializeAws_json1_1PatchSourceProductList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutComplianceItemsRequest = ( @@ -16059,43 +16538,56 @@ const serializeAws_json1_1PutComplianceItemsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ComplianceType !== undefined && { ComplianceType: input.ComplianceType }), - ...(input.ExecutionSummary !== undefined && { - ExecutionSummary: serializeAws_json1_1ComplianceExecutionSummary(input.ExecutionSummary, context), - }), - ...(input.ItemContentHash !== undefined && { ItemContentHash: input.ItemContentHash }), - ...(input.Items !== undefined && { Items: serializeAws_json1_1ComplianceItemEntryList(input.Items, context) }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.UploadType !== undefined && { UploadType: input.UploadType }), + ...(input.ComplianceType !== undefined && + input.ComplianceType !== null && { ComplianceType: input.ComplianceType }), + ...(input.ExecutionSummary !== undefined && + input.ExecutionSummary !== null && { + ExecutionSummary: serializeAws_json1_1ComplianceExecutionSummary(input.ExecutionSummary, context), + }), + ...(input.ItemContentHash !== undefined && + input.ItemContentHash !== null && { ItemContentHash: input.ItemContentHash }), + ...(input.Items !== undefined && + input.Items !== null && { Items: serializeAws_json1_1ComplianceItemEntryList(input.Items, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.UploadType !== undefined && input.UploadType !== null && { UploadType: input.UploadType }), }; }; const serializeAws_json1_1PutInventoryRequest = (input: PutInventoryRequest, context: __SerdeContext): any => { return { - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.Items !== undefined && { Items: serializeAws_json1_1InventoryItemList(input.Items, context) }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.Items !== undefined && + input.Items !== null && { Items: serializeAws_json1_1InventoryItemList(input.Items, context) }), }; }; const serializeAws_json1_1PutParameterRequest = (input: PutParameterRequest, context: __SerdeContext): any => { return { - ...(input.AllowedPattern !== undefined && { AllowedPattern: input.AllowedPattern }), - ...(input.DataType !== undefined && { DataType: input.DataType }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Overwrite !== undefined && { Overwrite: input.Overwrite }), - ...(input.Policies !== undefined && { Policies: input.Policies }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.Tier !== undefined && { Tier: input.Tier }), - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.AllowedPattern !== undefined && + input.AllowedPattern !== null && { AllowedPattern: input.AllowedPattern }), + ...(input.DataType !== undefined && input.DataType !== null && { DataType: input.DataType }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Overwrite !== undefined && input.Overwrite !== null && { Overwrite: input.Overwrite }), + ...(input.Policies !== undefined && input.Policies !== null && { Policies: input.Policies }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Tier !== undefined && input.Tier !== null && { Tier: input.Tier }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1Regions = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RegisterDefaultPatchBaselineRequest = ( @@ -16103,7 +16595,7 @@ const serializeAws_json1_1RegisterDefaultPatchBaselineRequest = ( context: __SerdeContext ): any => { return { - ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), + ...(input.BaselineId !== undefined && input.BaselineId !== null && { BaselineId: input.BaselineId }), }; }; @@ -16112,8 +16604,8 @@ const serializeAws_json1_1RegisterPatchBaselineForPatchGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), - ...(input.PatchGroup !== undefined && { PatchGroup: input.PatchGroup }), + ...(input.BaselineId !== undefined && input.BaselineId !== null && { BaselineId: input.BaselineId }), + ...(input.PatchGroup !== undefined && input.PatchGroup !== null && { PatchGroup: input.PatchGroup }), }; }; @@ -16123,12 +16615,14 @@ const serializeAws_json1_1RegisterTargetWithMaintenanceWindowRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OwnerInformation !== undefined && { OwnerInformation: input.OwnerInformation }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OwnerInformation !== undefined && + input.OwnerInformation !== null && { OwnerInformation: input.OwnerInformation }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), }; }; @@ -16138,39 +16632,50 @@ const serializeAws_json1_1RegisterTaskWithMaintenanceWindowRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LoggingInfo !== undefined && { - LoggingInfo: serializeAws_json1_1LoggingInfo(input.LoggingInfo, context), - }), - ...(input.MaxConcurrency !== undefined && { MaxConcurrency: input.MaxConcurrency }), - ...(input.MaxErrors !== undefined && { MaxErrors: input.MaxErrors }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.ServiceRoleArn !== undefined && { ServiceRoleArn: input.ServiceRoleArn }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), - ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }), - ...(input.TaskInvocationParameters !== undefined && { - TaskInvocationParameters: serializeAws_json1_1MaintenanceWindowTaskInvocationParameters( - input.TaskInvocationParameters, - context - ), - }), - ...(input.TaskParameters !== undefined && { - TaskParameters: serializeAws_json1_1MaintenanceWindowTaskParameters(input.TaskParameters, context), - }), - ...(input.TaskType !== undefined && { TaskType: input.TaskType }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LoggingInfo !== undefined && + input.LoggingInfo !== null && { LoggingInfo: serializeAws_json1_1LoggingInfo(input.LoggingInfo, context) }), + ...(input.MaxConcurrency !== undefined && + input.MaxConcurrency !== null && { MaxConcurrency: input.MaxConcurrency }), + ...(input.MaxErrors !== undefined && input.MaxErrors !== null && { MaxErrors: input.MaxErrors }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.ServiceRoleArn !== undefined && + input.ServiceRoleArn !== null && { ServiceRoleArn: input.ServiceRoleArn }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.TaskArn !== undefined && input.TaskArn !== null && { TaskArn: input.TaskArn }), + ...(input.TaskInvocationParameters !== undefined && + input.TaskInvocationParameters !== null && { + TaskInvocationParameters: serializeAws_json1_1MaintenanceWindowTaskInvocationParameters( + input.TaskInvocationParameters, + context + ), + }), + ...(input.TaskParameters !== undefined && + input.TaskParameters !== null && { + TaskParameters: serializeAws_json1_1MaintenanceWindowTaskParameters(input.TaskParameters, context), + }), + ...(input.TaskType !== undefined && input.TaskType !== null && { TaskType: input.TaskType }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), }; }; const serializeAws_json1_1RelatedOpsItem = (input: RelatedOpsItem, context: __SerdeContext): any => { return { - ...(input.OpsItemId !== undefined && { OpsItemId: input.OpsItemId }), + ...(input.OpsItemId !== undefined && input.OpsItemId !== null && { OpsItemId: input.OpsItemId }), }; }; const serializeAws_json1_1RelatedOpsItems = (input: RelatedOpsItem[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RelatedOpsItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RelatedOpsItem(entry, context); + }); }; const serializeAws_json1_1RemoveTagsFromResourceRequest = ( @@ -16178,9 +16683,10 @@ const serializeAws_json1_1RemoveTagsFromResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1KeyList(input.TagKeys, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1KeyList(input.TagKeys, context) }), }; }; @@ -16189,7 +16695,7 @@ const serializeAws_json1_1ResetServiceSettingRequest = ( context: __SerdeContext ): any => { return { - ...(input.SettingId !== undefined && { SettingId: input.SettingId }), + ...(input.SettingId !== undefined && input.SettingId !== null && { SettingId: input.SettingId }), }; }; @@ -16198,13 +16704,15 @@ const serializeAws_json1_1ResourceDataSyncAwsOrganizationsSource = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationSourceType !== undefined && { OrganizationSourceType: input.OrganizationSourceType }), - ...(input.OrganizationalUnits !== undefined && { - OrganizationalUnits: serializeAws_json1_1ResourceDataSyncOrganizationalUnitList( - input.OrganizationalUnits, - context - ), - }), + ...(input.OrganizationSourceType !== undefined && + input.OrganizationSourceType !== null && { OrganizationSourceType: input.OrganizationSourceType }), + ...(input.OrganizationalUnits !== undefined && + input.OrganizationalUnits !== null && { + OrganizationalUnits: serializeAws_json1_1ResourceDataSyncOrganizationalUnitList( + input.OrganizationalUnits, + context + ), + }), }; }; @@ -16213,9 +16721,8 @@ const serializeAws_json1_1ResourceDataSyncDestinationDataSharing = ( context: __SerdeContext ): any => { return { - ...(input.DestinationDataSharingType !== undefined && { - DestinationDataSharingType: input.DestinationDataSharingType, - }), + ...(input.DestinationDataSharingType !== undefined && + input.DestinationDataSharingType !== null && { DestinationDataSharingType: input.DestinationDataSharingType }), }; }; @@ -16224,7 +16731,8 @@ const serializeAws_json1_1ResourceDataSyncOrganizationalUnit = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationalUnitId !== undefined && { OrganizationalUnitId: input.OrganizationalUnitId }), + ...(input.OrganizationalUnitId !== undefined && + input.OrganizationalUnitId !== null && { OrganizationalUnitId: input.OrganizationalUnitId }), }; }; @@ -16232,7 +16740,14 @@ const serializeAws_json1_1ResourceDataSyncOrganizationalUnitList = ( input: ResourceDataSyncOrganizationalUnit[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1ResourceDataSyncOrganizationalUnit(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ResourceDataSyncOrganizationalUnit(entry, context); + }); }; const serializeAws_json1_1ResourceDataSyncS3Destination = ( @@ -16240,61 +16755,82 @@ const serializeAws_json1_1ResourceDataSyncS3Destination = ( context: __SerdeContext ): any => { return { - ...(input.AWSKMSKeyARN !== undefined && { AWSKMSKeyARN: input.AWSKMSKeyARN }), - ...(input.BucketName !== undefined && { BucketName: input.BucketName }), - ...(input.DestinationDataSharing !== undefined && { - DestinationDataSharing: serializeAws_json1_1ResourceDataSyncDestinationDataSharing( - input.DestinationDataSharing, - context - ), - }), - ...(input.Prefix !== undefined && { Prefix: input.Prefix }), - ...(input.Region !== undefined && { Region: input.Region }), - ...(input.SyncFormat !== undefined && { SyncFormat: input.SyncFormat }), + ...(input.AWSKMSKeyARN !== undefined && input.AWSKMSKeyARN !== null && { AWSKMSKeyARN: input.AWSKMSKeyARN }), + ...(input.BucketName !== undefined && input.BucketName !== null && { BucketName: input.BucketName }), + ...(input.DestinationDataSharing !== undefined && + input.DestinationDataSharing !== null && { + DestinationDataSharing: serializeAws_json1_1ResourceDataSyncDestinationDataSharing( + input.DestinationDataSharing, + context + ), + }), + ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }), + ...(input.Region !== undefined && input.Region !== null && { Region: input.Region }), + ...(input.SyncFormat !== undefined && input.SyncFormat !== null && { SyncFormat: input.SyncFormat }), }; }; const serializeAws_json1_1ResourceDataSyncSource = (input: ResourceDataSyncSource, context: __SerdeContext): any => { return { - ...(input.AwsOrganizationsSource !== undefined && { - AwsOrganizationsSource: serializeAws_json1_1ResourceDataSyncAwsOrganizationsSource( - input.AwsOrganizationsSource, - context - ), - }), - ...(input.IncludeFutureRegions !== undefined && { IncludeFutureRegions: input.IncludeFutureRegions }), - ...(input.SourceRegions !== undefined && { - SourceRegions: serializeAws_json1_1ResourceDataSyncSourceRegionList(input.SourceRegions, context), - }), - ...(input.SourceType !== undefined && { SourceType: input.SourceType }), + ...(input.AwsOrganizationsSource !== undefined && + input.AwsOrganizationsSource !== null && { + AwsOrganizationsSource: serializeAws_json1_1ResourceDataSyncAwsOrganizationsSource( + input.AwsOrganizationsSource, + context + ), + }), + ...(input.IncludeFutureRegions !== undefined && + input.IncludeFutureRegions !== null && { IncludeFutureRegions: input.IncludeFutureRegions }), + ...(input.SourceRegions !== undefined && + input.SourceRegions !== null && { + SourceRegions: serializeAws_json1_1ResourceDataSyncSourceRegionList(input.SourceRegions, context), + }), + ...(input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType }), }; }; const serializeAws_json1_1ResourceDataSyncSourceRegionList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ResultAttribute = (input: ResultAttribute, context: __SerdeContext): any => { return { - ...(input.TypeName !== undefined && { TypeName: input.TypeName }), + ...(input.TypeName !== undefined && input.TypeName !== null && { TypeName: input.TypeName }), }; }; const serializeAws_json1_1ResultAttributeList = (input: ResultAttribute[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ResultAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ResultAttribute(entry, context); + }); }; const serializeAws_json1_1ResumeSessionRequest = (input: ResumeSessionRequest, context: __SerdeContext): any => { return { - ...(input.SessionId !== undefined && { SessionId: input.SessionId }), + ...(input.SessionId !== undefined && input.SessionId !== null && { SessionId: input.SessionId }), }; }; const serializeAws_json1_1S3OutputLocation = (input: S3OutputLocation, context: __SerdeContext): any => { return { - ...(input.OutputS3BucketName !== undefined && { OutputS3BucketName: input.OutputS3BucketName }), - ...(input.OutputS3KeyPrefix !== undefined && { OutputS3KeyPrefix: input.OutputS3KeyPrefix }), - ...(input.OutputS3Region !== undefined && { OutputS3Region: input.OutputS3Region }), + ...(input.OutputS3BucketName !== undefined && + input.OutputS3BucketName !== null && { OutputS3BucketName: input.OutputS3BucketName }), + ...(input.OutputS3KeyPrefix !== undefined && + input.OutputS3KeyPrefix !== null && { OutputS3KeyPrefix: input.OutputS3KeyPrefix }), + ...(input.OutputS3Region !== undefined && + input.OutputS3Region !== null && { OutputS3Region: input.OutputS3Region }), }; }; @@ -16303,66 +16839,95 @@ const serializeAws_json1_1SendAutomationSignalRequest = ( context: __SerdeContext ): any => { return { - ...(input.AutomationExecutionId !== undefined && { AutomationExecutionId: input.AutomationExecutionId }), - ...(input.Payload !== undefined && { Payload: serializeAws_json1_1AutomationParameterMap(input.Payload, context) }), - ...(input.SignalType !== undefined && { SignalType: input.SignalType }), + ...(input.AutomationExecutionId !== undefined && + input.AutomationExecutionId !== null && { AutomationExecutionId: input.AutomationExecutionId }), + ...(input.Payload !== undefined && + input.Payload !== null && { Payload: serializeAws_json1_1AutomationParameterMap(input.Payload, context) }), + ...(input.SignalType !== undefined && input.SignalType !== null && { SignalType: input.SignalType }), }; }; const serializeAws_json1_1SendCommandRequest = (input: SendCommandRequest, context: __SerdeContext): any => { return { - ...(input.CloudWatchOutputConfig !== undefined && { - CloudWatchOutputConfig: serializeAws_json1_1CloudWatchOutputConfig(input.CloudWatchOutputConfig, context), - }), - ...(input.Comment !== undefined && { Comment: input.Comment }), - ...(input.DocumentHash !== undefined && { DocumentHash: input.DocumentHash }), - ...(input.DocumentHashType !== undefined && { DocumentHashType: input.DocumentHashType }), - ...(input.DocumentName !== undefined && { DocumentName: input.DocumentName }), - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.InstanceIds !== undefined && { - InstanceIds: serializeAws_json1_1InstanceIdList(input.InstanceIds, context), - }), - ...(input.MaxConcurrency !== undefined && { MaxConcurrency: input.MaxConcurrency }), - ...(input.MaxErrors !== undefined && { MaxErrors: input.MaxErrors }), - ...(input.NotificationConfig !== undefined && { - NotificationConfig: serializeAws_json1_1NotificationConfig(input.NotificationConfig, context), - }), - ...(input.OutputS3BucketName !== undefined && { OutputS3BucketName: input.OutputS3BucketName }), - ...(input.OutputS3KeyPrefix !== undefined && { OutputS3KeyPrefix: input.OutputS3KeyPrefix }), - ...(input.OutputS3Region !== undefined && { OutputS3Region: input.OutputS3Region }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), - ...(input.ServiceRoleArn !== undefined && { ServiceRoleArn: input.ServiceRoleArn }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), - ...(input.TimeoutSeconds !== undefined && { TimeoutSeconds: input.TimeoutSeconds }), + ...(input.CloudWatchOutputConfig !== undefined && + input.CloudWatchOutputConfig !== null && { + CloudWatchOutputConfig: serializeAws_json1_1CloudWatchOutputConfig(input.CloudWatchOutputConfig, context), + }), + ...(input.Comment !== undefined && input.Comment !== null && { Comment: input.Comment }), + ...(input.DocumentHash !== undefined && input.DocumentHash !== null && { DocumentHash: input.DocumentHash }), + ...(input.DocumentHashType !== undefined && + input.DocumentHashType !== null && { DocumentHashType: input.DocumentHashType }), + ...(input.DocumentName !== undefined && input.DocumentName !== null && { DocumentName: input.DocumentName }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.InstanceIds !== undefined && + input.InstanceIds !== null && { InstanceIds: serializeAws_json1_1InstanceIdList(input.InstanceIds, context) }), + ...(input.MaxConcurrency !== undefined && + input.MaxConcurrency !== null && { MaxConcurrency: input.MaxConcurrency }), + ...(input.MaxErrors !== undefined && input.MaxErrors !== null && { MaxErrors: input.MaxErrors }), + ...(input.NotificationConfig !== undefined && + input.NotificationConfig !== null && { + NotificationConfig: serializeAws_json1_1NotificationConfig(input.NotificationConfig, context), + }), + ...(input.OutputS3BucketName !== undefined && + input.OutputS3BucketName !== null && { OutputS3BucketName: input.OutputS3BucketName }), + ...(input.OutputS3KeyPrefix !== undefined && + input.OutputS3KeyPrefix !== null && { OutputS3KeyPrefix: input.OutputS3KeyPrefix }), + ...(input.OutputS3Region !== undefined && + input.OutputS3Region !== null && { OutputS3Region: input.OutputS3Region }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), + ...(input.ServiceRoleArn !== undefined && + input.ServiceRoleArn !== null && { ServiceRoleArn: input.ServiceRoleArn }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.TimeoutSeconds !== undefined && + input.TimeoutSeconds !== null && { TimeoutSeconds: input.TimeoutSeconds }), }; }; const serializeAws_json1_1SessionFilter = (input: SessionFilter, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_1SessionFilterList = (input: SessionFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1SessionFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SessionFilter(entry, context); + }); }; const serializeAws_json1_1SessionManagerParameters = ( input: { [key: string]: string[] }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1SessionManagerParameterValueList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1SessionManagerParameterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartAssociationsOnceRequest = ( @@ -16370,9 +16935,10 @@ const serializeAws_json1_1StartAssociationsOnceRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssociationIds !== undefined && { - AssociationIds: serializeAws_json1_1AssociationIdList(input.AssociationIds, context), - }), + ...(input.AssociationIds !== undefined && + input.AssociationIds !== null && { + AssociationIds: serializeAws_json1_1AssociationIdList(input.AssociationIds, context), + }), }; }; @@ -16381,50 +16947,71 @@ const serializeAws_json1_1StartAutomationExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.DocumentName !== undefined && { DocumentName: input.DocumentName }), - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.MaxConcurrency !== undefined && { MaxConcurrency: input.MaxConcurrency }), - ...(input.MaxErrors !== undefined && { MaxErrors: input.MaxErrors }), - ...(input.Mode !== undefined && { Mode: input.Mode }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1AutomationParameterMap(input.Parameters, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.TargetLocations !== undefined && { - TargetLocations: serializeAws_json1_1TargetLocations(input.TargetLocations, context), - }), - ...(input.TargetMaps !== undefined && { TargetMaps: serializeAws_json1_1TargetMaps(input.TargetMaps, context) }), - ...(input.TargetParameterName !== undefined && { TargetParameterName: input.TargetParameterName }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.DocumentName !== undefined && input.DocumentName !== null && { DocumentName: input.DocumentName }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.MaxConcurrency !== undefined && + input.MaxConcurrency !== null && { MaxConcurrency: input.MaxConcurrency }), + ...(input.MaxErrors !== undefined && input.MaxErrors !== null && { MaxErrors: input.MaxErrors }), + ...(input.Mode !== undefined && input.Mode !== null && { Mode: input.Mode }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_1AutomationParameterMap(input.Parameters, context), + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.TargetLocations !== undefined && + input.TargetLocations !== null && { + TargetLocations: serializeAws_json1_1TargetLocations(input.TargetLocations, context), + }), + ...(input.TargetMaps !== undefined && + input.TargetMaps !== null && { TargetMaps: serializeAws_json1_1TargetMaps(input.TargetMaps, context) }), + ...(input.TargetParameterName !== undefined && + input.TargetParameterName !== null && { TargetParameterName: input.TargetParameterName }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), }; }; const serializeAws_json1_1StartSessionRequest = (input: StartSessionRequest, context: __SerdeContext): any => { return { - ...(input.DocumentName !== undefined && { DocumentName: input.DocumentName }), - ...(input.Parameters !== undefined && { - Parameters: serializeAws_json1_1SessionManagerParameters(input.Parameters, context), - }), - ...(input.Target !== undefined && { Target: input.Target }), + ...(input.DocumentName !== undefined && input.DocumentName !== null && { DocumentName: input.DocumentName }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { + Parameters: serializeAws_json1_1SessionManagerParameters(input.Parameters, context), + }), + ...(input.Target !== undefined && input.Target !== null && { Target: input.Target }), }; }; const serializeAws_json1_1StepExecutionFilter = (input: StepExecutionFilter, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { - Values: serializeAws_json1_1StepExecutionFilterValueList(input.Values, context), - }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1StepExecutionFilterValueList(input.Values, context) }), }; }; const serializeAws_json1_1StepExecutionFilterList = (input: StepExecutionFilter[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1StepExecutionFilter(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1StepExecutionFilter(entry, context); + }); }; const serializeAws_json1_1StepExecutionFilterValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StopAutomationExecutionRequest = ( @@ -16432,78 +17019,136 @@ const serializeAws_json1_1StopAutomationExecutionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AutomationExecutionId !== undefined && { AutomationExecutionId: input.AutomationExecutionId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.AutomationExecutionId !== undefined && + input.AutomationExecutionId !== null && { AutomationExecutionId: input.AutomationExecutionId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1Target = (input: Target, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Values !== undefined && { Values: serializeAws_json1_1TargetValues(input.Values, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Values !== undefined && + input.Values !== null && { Values: serializeAws_json1_1TargetValues(input.Values, context) }), }; }; const serializeAws_json1_1TargetLocation = (input: TargetLocation, context: __SerdeContext): any => { return { - ...(input.Accounts !== undefined && { Accounts: serializeAws_json1_1Accounts(input.Accounts, context) }), - ...(input.ExecutionRoleName !== undefined && { ExecutionRoleName: input.ExecutionRoleName }), - ...(input.Regions !== undefined && { Regions: serializeAws_json1_1Regions(input.Regions, context) }), - ...(input.TargetLocationMaxConcurrency !== undefined && { - TargetLocationMaxConcurrency: input.TargetLocationMaxConcurrency, - }), - ...(input.TargetLocationMaxErrors !== undefined && { TargetLocationMaxErrors: input.TargetLocationMaxErrors }), + ...(input.Accounts !== undefined && + input.Accounts !== null && { Accounts: serializeAws_json1_1Accounts(input.Accounts, context) }), + ...(input.ExecutionRoleName !== undefined && + input.ExecutionRoleName !== null && { ExecutionRoleName: input.ExecutionRoleName }), + ...(input.Regions !== undefined && + input.Regions !== null && { Regions: serializeAws_json1_1Regions(input.Regions, context) }), + ...(input.TargetLocationMaxConcurrency !== undefined && + input.TargetLocationMaxConcurrency !== null && { + TargetLocationMaxConcurrency: input.TargetLocationMaxConcurrency, + }), + ...(input.TargetLocationMaxErrors !== undefined && + input.TargetLocationMaxErrors !== null && { TargetLocationMaxErrors: input.TargetLocationMaxErrors }), }; }; const serializeAws_json1_1TargetLocations = (input: TargetLocation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TargetLocation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TargetLocation(entry, context); + }); }; const serializeAws_json1_1TargetMap = (input: { [key: string]: string[] }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: serializeAws_json1_1TargetMapValueList(value, context), - }), - {} - ); + }; + }, {}); }; const serializeAws_json1_1TargetMaps = (input: { [key: string]: string[] }[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TargetMap(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TargetMap(entry, context); + }); }; const serializeAws_json1_1TargetMapValueList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Targets = (input: Target[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Target(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Target(entry, context); + }); }; const serializeAws_json1_1TargetValues = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TerminateSessionRequest = (input: TerminateSessionRequest, context: __SerdeContext): any => { return { - ...(input.SessionId !== undefined && { SessionId: input.SessionId }), + ...(input.SessionId !== undefined && input.SessionId !== null && { SessionId: input.SessionId }), }; }; @@ -16512,25 +17157,37 @@ const serializeAws_json1_1UpdateAssociationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApplyOnlyAtCronInterval !== undefined && { ApplyOnlyAtCronInterval: input.ApplyOnlyAtCronInterval }), - ...(input.AssociationId !== undefined && { AssociationId: input.AssociationId }), - ...(input.AssociationName !== undefined && { AssociationName: input.AssociationName }), - ...(input.AssociationVersion !== undefined && { AssociationVersion: input.AssociationVersion }), - ...(input.AutomationTargetParameterName !== undefined && { - AutomationTargetParameterName: input.AutomationTargetParameterName, - }), - ...(input.ComplianceSeverity !== undefined && { ComplianceSeverity: input.ComplianceSeverity }), - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.MaxConcurrency !== undefined && { MaxConcurrency: input.MaxConcurrency }), - ...(input.MaxErrors !== undefined && { MaxErrors: input.MaxErrors }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OutputLocation !== undefined && { - OutputLocation: serializeAws_json1_1InstanceAssociationOutputLocation(input.OutputLocation, context), - }), - ...(input.Parameters !== undefined && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), - ...(input.ScheduleExpression !== undefined && { ScheduleExpression: input.ScheduleExpression }), - ...(input.SyncCompliance !== undefined && { SyncCompliance: input.SyncCompliance }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.ApplyOnlyAtCronInterval !== undefined && + input.ApplyOnlyAtCronInterval !== null && { ApplyOnlyAtCronInterval: input.ApplyOnlyAtCronInterval }), + ...(input.AssociationId !== undefined && input.AssociationId !== null && { AssociationId: input.AssociationId }), + ...(input.AssociationName !== undefined && + input.AssociationName !== null && { AssociationName: input.AssociationName }), + ...(input.AssociationVersion !== undefined && + input.AssociationVersion !== null && { AssociationVersion: input.AssociationVersion }), + ...(input.AutomationTargetParameterName !== undefined && + input.AutomationTargetParameterName !== null && { + AutomationTargetParameterName: input.AutomationTargetParameterName, + }), + ...(input.ComplianceSeverity !== undefined && + input.ComplianceSeverity !== null && { ComplianceSeverity: input.ComplianceSeverity }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.MaxConcurrency !== undefined && + input.MaxConcurrency !== null && { MaxConcurrency: input.MaxConcurrency }), + ...(input.MaxErrors !== undefined && input.MaxErrors !== null && { MaxErrors: input.MaxErrors }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OutputLocation !== undefined && + input.OutputLocation !== null && { + OutputLocation: serializeAws_json1_1InstanceAssociationOutputLocation(input.OutputLocation, context), + }), + ...(input.Parameters !== undefined && + input.Parameters !== null && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }), + ...(input.ScheduleExpression !== undefined && + input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }), + ...(input.SyncCompliance !== undefined && + input.SyncCompliance !== null && { SyncCompliance: input.SyncCompliance }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), }; }; @@ -16539,11 +17196,12 @@ const serializeAws_json1_1UpdateAssociationStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.AssociationStatus !== undefined && { - AssociationStatus: serializeAws_json1_1AssociationStatus(input.AssociationStatus, context), - }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.AssociationStatus !== undefined && + input.AssociationStatus !== null && { + AssociationStatus: serializeAws_json1_1AssociationStatus(input.AssociationStatus, context), + }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -16552,22 +17210,26 @@ const serializeAws_json1_1UpdateDocumentDefaultVersionRequest = ( context: __SerdeContext ): any => { return { - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1UpdateDocumentRequest = (input: UpdateDocumentRequest, context: __SerdeContext): any => { return { - ...(input.Attachments !== undefined && { - Attachments: serializeAws_json1_1AttachmentsSourceList(input.Attachments, context), - }), - ...(input.Content !== undefined && { Content: input.Content }), - ...(input.DocumentFormat !== undefined && { DocumentFormat: input.DocumentFormat }), - ...(input.DocumentVersion !== undefined && { DocumentVersion: input.DocumentVersion }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.TargetType !== undefined && { TargetType: input.TargetType }), - ...(input.VersionName !== undefined && { VersionName: input.VersionName }), + ...(input.Attachments !== undefined && + input.Attachments !== null && { + Attachments: serializeAws_json1_1AttachmentsSourceList(input.Attachments, context), + }), + ...(input.Content !== undefined && input.Content !== null && { Content: input.Content }), + ...(input.DocumentFormat !== undefined && + input.DocumentFormat !== null && { DocumentFormat: input.DocumentFormat }), + ...(input.DocumentVersion !== undefined && + input.DocumentVersion !== null && { DocumentVersion: input.DocumentVersion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.TargetType !== undefined && input.TargetType !== null && { TargetType: input.TargetType }), + ...(input.VersionName !== undefined && input.VersionName !== null && { VersionName: input.VersionName }), }; }; @@ -16576,19 +17238,22 @@ const serializeAws_json1_1UpdateMaintenanceWindowRequest = ( context: __SerdeContext ): any => { return { - ...(input.AllowUnassociatedTargets !== undefined && { AllowUnassociatedTargets: input.AllowUnassociatedTargets }), - ...(input.Cutoff !== undefined && { Cutoff: input.Cutoff }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Duration !== undefined && { Duration: input.Duration }), - ...(input.Enabled !== undefined && { Enabled: input.Enabled }), - ...(input.EndDate !== undefined && { EndDate: input.EndDate }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Replace !== undefined && { Replace: input.Replace }), - ...(input.Schedule !== undefined && { Schedule: input.Schedule }), - ...(input.ScheduleOffset !== undefined && { ScheduleOffset: input.ScheduleOffset }), - ...(input.ScheduleTimezone !== undefined && { ScheduleTimezone: input.ScheduleTimezone }), - ...(input.StartDate !== undefined && { StartDate: input.StartDate }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.AllowUnassociatedTargets !== undefined && + input.AllowUnassociatedTargets !== null && { AllowUnassociatedTargets: input.AllowUnassociatedTargets }), + ...(input.Cutoff !== undefined && input.Cutoff !== null && { Cutoff: input.Cutoff }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Duration !== undefined && input.Duration !== null && { Duration: input.Duration }), + ...(input.Enabled !== undefined && input.Enabled !== null && { Enabled: input.Enabled }), + ...(input.EndDate !== undefined && input.EndDate !== null && { EndDate: input.EndDate }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Replace !== undefined && input.Replace !== null && { Replace: input.Replace }), + ...(input.Schedule !== undefined && input.Schedule !== null && { Schedule: input.Schedule }), + ...(input.ScheduleOffset !== undefined && + input.ScheduleOffset !== null && { ScheduleOffset: input.ScheduleOffset }), + ...(input.ScheduleTimezone !== undefined && + input.ScheduleTimezone !== null && { ScheduleTimezone: input.ScheduleTimezone }), + ...(input.StartDate !== undefined && input.StartDate !== null && { StartDate: input.StartDate }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), }; }; @@ -16597,13 +17262,16 @@ const serializeAws_json1_1UpdateMaintenanceWindowTargetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OwnerInformation !== undefined && { OwnerInformation: input.OwnerInformation }), - ...(input.Replace !== undefined && { Replace: input.Replace }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), - ...(input.WindowTargetId !== undefined && { WindowTargetId: input.WindowTargetId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OwnerInformation !== undefined && + input.OwnerInformation !== null && { OwnerInformation: input.OwnerInformation }), + ...(input.Replace !== undefined && input.Replace !== null && { Replace: input.Replace }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), + ...(input.WindowTargetId !== undefined && + input.WindowTargetId !== null && { WindowTargetId: input.WindowTargetId }), }; }; @@ -16612,29 +17280,33 @@ const serializeAws_json1_1UpdateMaintenanceWindowTaskRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.LoggingInfo !== undefined && { - LoggingInfo: serializeAws_json1_1LoggingInfo(input.LoggingInfo, context), - }), - ...(input.MaxConcurrency !== undefined && { MaxConcurrency: input.MaxConcurrency }), - ...(input.MaxErrors !== undefined && { MaxErrors: input.MaxErrors }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.Replace !== undefined && { Replace: input.Replace }), - ...(input.ServiceRoleArn !== undefined && { ServiceRoleArn: input.ServiceRoleArn }), - ...(input.Targets !== undefined && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), - ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }), - ...(input.TaskInvocationParameters !== undefined && { - TaskInvocationParameters: serializeAws_json1_1MaintenanceWindowTaskInvocationParameters( - input.TaskInvocationParameters, - context - ), - }), - ...(input.TaskParameters !== undefined && { - TaskParameters: serializeAws_json1_1MaintenanceWindowTaskParameters(input.TaskParameters, context), - }), - ...(input.WindowId !== undefined && { WindowId: input.WindowId }), - ...(input.WindowTaskId !== undefined && { WindowTaskId: input.WindowTaskId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.LoggingInfo !== undefined && + input.LoggingInfo !== null && { LoggingInfo: serializeAws_json1_1LoggingInfo(input.LoggingInfo, context) }), + ...(input.MaxConcurrency !== undefined && + input.MaxConcurrency !== null && { MaxConcurrency: input.MaxConcurrency }), + ...(input.MaxErrors !== undefined && input.MaxErrors !== null && { MaxErrors: input.MaxErrors }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.Replace !== undefined && input.Replace !== null && { Replace: input.Replace }), + ...(input.ServiceRoleArn !== undefined && + input.ServiceRoleArn !== null && { ServiceRoleArn: input.ServiceRoleArn }), + ...(input.Targets !== undefined && + input.Targets !== null && { Targets: serializeAws_json1_1Targets(input.Targets, context) }), + ...(input.TaskArn !== undefined && input.TaskArn !== null && { TaskArn: input.TaskArn }), + ...(input.TaskInvocationParameters !== undefined && + input.TaskInvocationParameters !== null && { + TaskInvocationParameters: serializeAws_json1_1MaintenanceWindowTaskInvocationParameters( + input.TaskInvocationParameters, + context + ), + }), + ...(input.TaskParameters !== undefined && + input.TaskParameters !== null && { + TaskParameters: serializeAws_json1_1MaintenanceWindowTaskParameters(input.TaskParameters, context), + }), + ...(input.WindowId !== undefined && input.WindowId !== null && { WindowId: input.WindowId }), + ...(input.WindowTaskId !== undefined && input.WindowTaskId !== null && { WindowTaskId: input.WindowTaskId }), }; }; @@ -16643,32 +17315,36 @@ const serializeAws_json1_1UpdateManagedInstanceRoleRequest = ( context: __SerdeContext ): any => { return { - ...(input.IamRole !== undefined && { IamRole: input.IamRole }), - ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.IamRole !== undefined && input.IamRole !== null && { IamRole: input.IamRole }), + ...(input.InstanceId !== undefined && input.InstanceId !== null && { InstanceId: input.InstanceId }), }; }; const serializeAws_json1_1UpdateOpsItemRequest = (input: UpdateOpsItemRequest, context: __SerdeContext): any => { return { - ...(input.Category !== undefined && { Category: input.Category }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Notifications !== undefined && { - Notifications: serializeAws_json1_1OpsItemNotifications(input.Notifications, context), - }), - ...(input.OperationalData !== undefined && { - OperationalData: serializeAws_json1_1OpsItemOperationalData(input.OperationalData, context), - }), - ...(input.OperationalDataToDelete !== undefined && { - OperationalDataToDelete: serializeAws_json1_1OpsItemOpsDataKeysList(input.OperationalDataToDelete, context), - }), - ...(input.OpsItemId !== undefined && { OpsItemId: input.OpsItemId }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.RelatedOpsItems !== undefined && { - RelatedOpsItems: serializeAws_json1_1RelatedOpsItems(input.RelatedOpsItems, context), - }), - ...(input.Severity !== undefined && { Severity: input.Severity }), - ...(input.Status !== undefined && { Status: input.Status }), - ...(input.Title !== undefined && { Title: input.Title }), + ...(input.Category !== undefined && input.Category !== null && { Category: input.Category }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Notifications !== undefined && + input.Notifications !== null && { + Notifications: serializeAws_json1_1OpsItemNotifications(input.Notifications, context), + }), + ...(input.OperationalData !== undefined && + input.OperationalData !== null && { + OperationalData: serializeAws_json1_1OpsItemOperationalData(input.OperationalData, context), + }), + ...(input.OperationalDataToDelete !== undefined && + input.OperationalDataToDelete !== null && { + OperationalDataToDelete: serializeAws_json1_1OpsItemOpsDataKeysList(input.OperationalDataToDelete, context), + }), + ...(input.OpsItemId !== undefined && input.OpsItemId !== null && { OpsItemId: input.OpsItemId }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.RelatedOpsItems !== undefined && + input.RelatedOpsItems !== null && { + RelatedOpsItems: serializeAws_json1_1RelatedOpsItems(input.RelatedOpsItems, context), + }), + ...(input.Severity !== undefined && input.Severity !== null && { Severity: input.Severity }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), + ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }), }; }; @@ -16677,13 +17353,16 @@ const serializeAws_json1_1UpdateOpsMetadataRequest = ( context: __SerdeContext ): any => { return { - ...(input.KeysToDelete !== undefined && { - KeysToDelete: serializeAws_json1_1MetadataKeysToDeleteList(input.KeysToDelete, context), - }), - ...(input.MetadataToUpdate !== undefined && { - MetadataToUpdate: serializeAws_json1_1MetadataMap(input.MetadataToUpdate, context), - }), - ...(input.OpsMetadataArn !== undefined && { OpsMetadataArn: input.OpsMetadataArn }), + ...(input.KeysToDelete !== undefined && + input.KeysToDelete !== null && { + KeysToDelete: serializeAws_json1_1MetadataKeysToDeleteList(input.KeysToDelete, context), + }), + ...(input.MetadataToUpdate !== undefined && + input.MetadataToUpdate !== null && { + MetadataToUpdate: serializeAws_json1_1MetadataMap(input.MetadataToUpdate, context), + }), + ...(input.OpsMetadataArn !== undefined && + input.OpsMetadataArn !== null && { OpsMetadataArn: input.OpsMetadataArn }), }; }; @@ -16692,30 +17371,38 @@ const serializeAws_json1_1UpdatePatchBaselineRequest = ( context: __SerdeContext ): any => { return { - ...(input.ApprovalRules !== undefined && { - ApprovalRules: serializeAws_json1_1PatchRuleGroup(input.ApprovalRules, context), - }), - ...(input.ApprovedPatches !== undefined && { - ApprovedPatches: serializeAws_json1_1PatchIdList(input.ApprovedPatches, context), - }), - ...(input.ApprovedPatchesComplianceLevel !== undefined && { - ApprovedPatchesComplianceLevel: input.ApprovedPatchesComplianceLevel, - }), - ...(input.ApprovedPatchesEnableNonSecurity !== undefined && { - ApprovedPatchesEnableNonSecurity: input.ApprovedPatchesEnableNonSecurity, - }), - ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.GlobalFilters !== undefined && { - GlobalFilters: serializeAws_json1_1PatchFilterGroup(input.GlobalFilters, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RejectedPatches !== undefined && { - RejectedPatches: serializeAws_json1_1PatchIdList(input.RejectedPatches, context), - }), - ...(input.RejectedPatchesAction !== undefined && { RejectedPatchesAction: input.RejectedPatchesAction }), - ...(input.Replace !== undefined && { Replace: input.Replace }), - ...(input.Sources !== undefined && { Sources: serializeAws_json1_1PatchSourceList(input.Sources, context) }), + ...(input.ApprovalRules !== undefined && + input.ApprovalRules !== null && { + ApprovalRules: serializeAws_json1_1PatchRuleGroup(input.ApprovalRules, context), + }), + ...(input.ApprovedPatches !== undefined && + input.ApprovedPatches !== null && { + ApprovedPatches: serializeAws_json1_1PatchIdList(input.ApprovedPatches, context), + }), + ...(input.ApprovedPatchesComplianceLevel !== undefined && + input.ApprovedPatchesComplianceLevel !== null && { + ApprovedPatchesComplianceLevel: input.ApprovedPatchesComplianceLevel, + }), + ...(input.ApprovedPatchesEnableNonSecurity !== undefined && + input.ApprovedPatchesEnableNonSecurity !== null && { + ApprovedPatchesEnableNonSecurity: input.ApprovedPatchesEnableNonSecurity, + }), + ...(input.BaselineId !== undefined && input.BaselineId !== null && { BaselineId: input.BaselineId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.GlobalFilters !== undefined && + input.GlobalFilters !== null && { + GlobalFilters: serializeAws_json1_1PatchFilterGroup(input.GlobalFilters, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RejectedPatches !== undefined && + input.RejectedPatches !== null && { + RejectedPatches: serializeAws_json1_1PatchIdList(input.RejectedPatches, context), + }), + ...(input.RejectedPatchesAction !== undefined && + input.RejectedPatchesAction !== null && { RejectedPatchesAction: input.RejectedPatchesAction }), + ...(input.Replace !== undefined && input.Replace !== null && { Replace: input.Replace }), + ...(input.Sources !== undefined && + input.Sources !== null && { Sources: serializeAws_json1_1PatchSourceList(input.Sources, context) }), }; }; @@ -16724,11 +17411,12 @@ const serializeAws_json1_1UpdateResourceDataSyncRequest = ( context: __SerdeContext ): any => { return { - ...(input.SyncName !== undefined && { SyncName: input.SyncName }), - ...(input.SyncSource !== undefined && { - SyncSource: serializeAws_json1_1ResourceDataSyncSource(input.SyncSource, context), - }), - ...(input.SyncType !== undefined && { SyncType: input.SyncType }), + ...(input.SyncName !== undefined && input.SyncName !== null && { SyncName: input.SyncName }), + ...(input.SyncSource !== undefined && + input.SyncSource !== null && { + SyncSource: serializeAws_json1_1ResourceDataSyncSource(input.SyncSource, context), + }), + ...(input.SyncType !== undefined && input.SyncType !== null && { SyncType: input.SyncType }), }; }; @@ -16737,17 +17425,31 @@ const serializeAws_json1_1UpdateServiceSettingRequest = ( context: __SerdeContext ): any => { return { - ...(input.SettingId !== undefined && { SettingId: input.SettingId }), - ...(input.SettingValue !== undefined && { SettingValue: input.SettingValue }), + ...(input.SettingId !== undefined && input.SettingId !== null && { SettingId: input.SettingId }), + ...(input.SettingValue !== undefined && input.SettingValue !== null && { SettingValue: input.SettingValue }), }; }; const deserializeAws_json1_1AccountIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Accounts = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AccountSharingInfo = (output: any, context: __SerdeContext): AccountSharingInfo => { @@ -16761,7 +17463,14 @@ const deserializeAws_json1_1AccountSharingInfo = (output: any, context: __SerdeC }; const deserializeAws_json1_1AccountSharingInfoList = (output: any, context: __SerdeContext): AccountSharingInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AccountSharingInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccountSharingInfo(entry, context); + }); }; const deserializeAws_json1_1Activation = (output: any, context: __SerdeContext): Activation => { @@ -16798,7 +17507,14 @@ const deserializeAws_json1_1Activation = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ActivationList = (output: any, context: __SerdeContext): Activation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Activation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Activation(entry, context); + }); }; const deserializeAws_json1_1AddTagsToResourceResult = ( @@ -16933,7 +17649,14 @@ const deserializeAws_json1_1AssociationDescriptionList = ( output: any, context: __SerdeContext ): AssociationDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssociationDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssociationDescription(entry, context); + }); }; const deserializeAws_json1_1AssociationDoesNotExist = ( @@ -16985,7 +17708,14 @@ const deserializeAws_json1_1AssociationExecutionsList = ( output: any, context: __SerdeContext ): AssociationExecution[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssociationExecution(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssociationExecution(entry, context); + }); }; const deserializeAws_json1_1AssociationExecutionTarget = ( @@ -17020,7 +17750,14 @@ const deserializeAws_json1_1AssociationExecutionTargetsList = ( output: any, context: __SerdeContext ): AssociationExecutionTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssociationExecutionTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssociationExecutionTarget(entry, context); + }); }; const deserializeAws_json1_1AssociationLimitExceeded = ( @@ -17031,7 +17768,14 @@ const deserializeAws_json1_1AssociationLimitExceeded = ( }; const deserializeAws_json1_1AssociationList = (output: any, context: __SerdeContext): Association[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Association(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Association(entry, context); + }); }; const deserializeAws_json1_1AssociationOverview = (output: any, context: __SerdeContext): AssociationOverview => { @@ -17060,13 +17804,15 @@ const deserializeAws_json1_1AssociationStatusAggregatedCount = ( output: any, context: __SerdeContext ): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1AssociationVersionInfo = (output: any, context: __SerdeContext): AssociationVersionInfo => { @@ -17131,7 +17877,14 @@ const deserializeAws_json1_1AssociationVersionList = ( output: any, context: __SerdeContext ): AssociationVersionInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AssociationVersionInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AssociationVersionInfo(entry, context); + }); }; const deserializeAws_json1_1AttachmentContent = (output: any, context: __SerdeContext): AttachmentContent => { @@ -17145,7 +17898,14 @@ const deserializeAws_json1_1AttachmentContent = (output: any, context: __SerdeCo }; const deserializeAws_json1_1AttachmentContentList = (output: any, context: __SerdeContext): AttachmentContent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttachmentContent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttachmentContent(entry, context); + }); }; const deserializeAws_json1_1AttachmentInformation = (output: any, context: __SerdeContext): AttachmentInformation => { @@ -17158,7 +17918,14 @@ const deserializeAws_json1_1AttachmentInformationList = ( output: any, context: __SerdeContext ): AttachmentInformation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttachmentInformation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttachmentInformation(entry, context); + }); }; const deserializeAws_json1_1AutomationDefinitionNotFoundException = ( @@ -17338,7 +18105,14 @@ const deserializeAws_json1_1AutomationExecutionMetadataList = ( output: any, context: __SerdeContext ): AutomationExecutionMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutomationExecutionMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutomationExecutionMetadata(entry, context); + }); }; const deserializeAws_json1_1AutomationExecutionNotFoundException = ( @@ -17354,17 +18128,26 @@ const deserializeAws_json1_1AutomationParameterMap = ( output: any, context: __SerdeContext ): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1AutomationParameterValueList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1AutomationParameterValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AutomationStepNotFoundException = ( @@ -17510,11 +18293,25 @@ const deserializeAws_json1_1CommandInvocation = (output: any, context: __SerdeCo }; const deserializeAws_json1_1CommandInvocationList = (output: any, context: __SerdeContext): CommandInvocation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CommandInvocation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CommandInvocation(entry, context); + }); }; const deserializeAws_json1_1CommandList = (output: any, context: __SerdeContext): Command[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Command(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Command(entry, context); + }); }; const deserializeAws_json1_1CommandPlugin = (output: any, context: __SerdeContext): CommandPlugin => { @@ -17553,7 +18350,14 @@ const deserializeAws_json1_1CommandPlugin = (output: any, context: __SerdeContex }; const deserializeAws_json1_1CommandPluginList = (output: any, context: __SerdeContext): CommandPlugin[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CommandPlugin(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CommandPlugin(entry, context); + }); }; const deserializeAws_json1_1ComplianceExecutionSummary = ( @@ -17596,17 +18400,26 @@ const deserializeAws_json1_1ComplianceItemDetails = ( output: any, context: __SerdeContext ): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ComplianceItemList = (output: any, context: __SerdeContext): ComplianceItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ComplianceItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ComplianceItem(entry, context); + }); }; const deserializeAws_json1_1ComplianceSummaryItem = (output: any, context: __SerdeContext): ComplianceSummaryItem => { @@ -17628,7 +18441,14 @@ const deserializeAws_json1_1ComplianceSummaryItemList = ( output: any, context: __SerdeContext ): ComplianceSummaryItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ComplianceSummaryItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ComplianceSummaryItem(entry, context); + }); }; const deserializeAws_json1_1ComplianceTypeCountLimitExceededException = ( @@ -18461,7 +19281,14 @@ const deserializeAws_json1_1DocumentIdentifier = (output: any, context: __SerdeC }; const deserializeAws_json1_1DocumentIdentifierList = (output: any, context: __SerdeContext): DocumentIdentifier[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentIdentifier(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentIdentifier(entry, context); + }); }; const deserializeAws_json1_1DocumentLimitExceeded = (output: any, context: __SerdeContext): DocumentLimitExceeded => { @@ -18480,7 +19307,14 @@ const deserializeAws_json1_1DocumentParameter = (output: any, context: __SerdeCo }; const deserializeAws_json1_1DocumentParameterList = (output: any, context: __SerdeContext): DocumentParameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentParameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentParameter(entry, context); + }); }; const deserializeAws_json1_1DocumentPermissionLimit = ( @@ -18500,7 +19334,14 @@ const deserializeAws_json1_1DocumentRequires = (output: any, context: __SerdeCon }; const deserializeAws_json1_1DocumentRequiresList = (output: any, context: __SerdeContext): DocumentRequires[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentRequires(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentRequires(entry, context); + }); }; const deserializeAws_json1_1DocumentVersionInfo = (output: any, context: __SerdeContext): DocumentVersionInfo => { @@ -18535,7 +19376,14 @@ const deserializeAws_json1_1DocumentVersionLimitExceeded = ( }; const deserializeAws_json1_1DocumentVersionList = (output: any, context: __SerdeContext): DocumentVersionInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1DocumentVersionInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1DocumentVersionInfo(entry, context); + }); }; const deserializeAws_json1_1DoesNotExistException = (output: any, context: __SerdeContext): DoesNotExistException => { @@ -18580,7 +19428,14 @@ const deserializeAws_json1_1EffectivePatch = (output: any, context: __SerdeConte }; const deserializeAws_json1_1EffectivePatchList = (output: any, context: __SerdeContext): EffectivePatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1EffectivePatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1EffectivePatch(entry, context); + }); }; const deserializeAws_json1_1FailedCreateAssociation = ( @@ -18601,7 +19456,14 @@ const deserializeAws_json1_1FailedCreateAssociationList = ( output: any, context: __SerdeContext ): FailedCreateAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedCreateAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedCreateAssociation(entry, context); + }); }; const deserializeAws_json1_1FailureDetails = (output: any, context: __SerdeContext): FailureDetails => { @@ -19171,7 +20033,14 @@ const deserializeAws_json1_1InstanceAssociation = (output: any, context: __Serde }; const deserializeAws_json1_1InstanceAssociationList = (output: any, context: __SerdeContext): InstanceAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceAssociation(entry, context); + }); }; const deserializeAws_json1_1InstanceAssociationOutputLocation = ( @@ -19202,13 +20071,15 @@ const deserializeAws_json1_1InstanceAssociationStatusAggregatedCount = ( output: any, context: __SerdeContext ): { [key: string]: number } => { - return Object.entries(output).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1InstanceAssociationStatusInfo = ( @@ -19249,11 +20120,25 @@ const deserializeAws_json1_1InstanceAssociationStatusInfos = ( output: any, context: __SerdeContext ): InstanceAssociationStatusInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceAssociationStatusInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceAssociationStatusInfo(entry, context); + }); }; const deserializeAws_json1_1InstanceIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InstanceInformation = (output: any, context: __SerdeContext): InstanceInformation => { @@ -19302,7 +20187,14 @@ const deserializeAws_json1_1InstanceInformation = (output: any, context: __Serde }; const deserializeAws_json1_1InstanceInformationList = (output: any, context: __SerdeContext): InstanceInformation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceInformation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceInformation(entry, context); + }); }; const deserializeAws_json1_1InstancePatchState = (output: any, context: __SerdeContext): InstancePatchState => { @@ -19359,11 +20251,25 @@ const deserializeAws_json1_1InstancePatchState = (output: any, context: __SerdeC }; const deserializeAws_json1_1InstancePatchStateList = (output: any, context: __SerdeContext): InstancePatchState[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstancePatchState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstancePatchState(entry, context); + }); }; const deserializeAws_json1_1InstancePatchStatesList = (output: any, context: __SerdeContext): InstancePatchState[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstancePatchState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstancePatchState(entry, context); + }); }; const deserializeAws_json1_1InternalServerError = (output: any, context: __SerdeContext): InternalServerError => { @@ -19705,7 +20611,14 @@ const deserializeAws_json1_1InventoryDeletionsList = ( output: any, context: __SerdeContext ): InventoryDeletionStatusItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InventoryDeletionStatusItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InventoryDeletionStatusItem(entry, context); + }); }; const deserializeAws_json1_1InventoryDeletionStatusItem = ( @@ -19766,7 +20679,14 @@ const deserializeAws_json1_1InventoryDeletionSummaryItems = ( output: any, context: __SerdeContext ): InventoryDeletionSummaryItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InventoryDeletionSummaryItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InventoryDeletionSummaryItem(entry, context); + }); }; const deserializeAws_json1_1InventoryItemAttribute = (output: any, context: __SerdeContext): InventoryItemAttribute => { @@ -19780,24 +20700,40 @@ const deserializeAws_json1_1InventoryItemAttributeList = ( output: any, context: __SerdeContext ): InventoryItemAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InventoryItemAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InventoryItemAttribute(entry, context); + }); }; const deserializeAws_json1_1InventoryItemEntry = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1InventoryItemEntryList = ( output: any, context: __SerdeContext ): { [key: string]: string }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InventoryItemEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InventoryItemEntry(entry, context); + }); }; const deserializeAws_json1_1InventoryItemSchema = (output: any, context: __SerdeContext): InventoryItemSchema => { @@ -19816,7 +20752,14 @@ const deserializeAws_json1_1InventoryItemSchemaResultList = ( output: any, context: __SerdeContext ): InventoryItemSchema[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InventoryItemSchema(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InventoryItemSchema(entry, context); + }); }; const deserializeAws_json1_1InventoryResultEntity = (output: any, context: __SerdeContext): InventoryResultEntity => { @@ -19833,7 +20776,14 @@ const deserializeAws_json1_1InventoryResultEntityList = ( output: any, context: __SerdeContext ): InventoryResultEntity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InventoryResultEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InventoryResultEntity(entry, context); + }); }; const deserializeAws_json1_1InventoryResultItem = (output: any, context: __SerdeContext): InventoryResultItem => { @@ -19854,13 +20804,15 @@ const deserializeAws_json1_1InventoryResultItemMap = ( output: any, context: __SerdeContext ): { [key: string]: InventoryResultItem } => { - return Object.entries(output).reduce( - (acc: { [key: string]: InventoryResultItem }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: InventoryResultItem }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1InventoryResultItem(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1InvocationDoesNotExist = (output: any, context: __SerdeContext): InvocationDoesNotExist => { @@ -20110,7 +21062,14 @@ const deserializeAws_json1_1MaintenanceWindowExecutionList = ( output: any, context: __SerdeContext ): MaintenanceWindowExecution[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MaintenanceWindowExecution(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MaintenanceWindowExecution(entry, context); + }); }; const deserializeAws_json1_1MaintenanceWindowExecutionTaskIdentity = ( @@ -20142,13 +21101,25 @@ const deserializeAws_json1_1MaintenanceWindowExecutionTaskIdentityList = ( output: any, context: __SerdeContext ): MaintenanceWindowExecutionTaskIdentity[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1MaintenanceWindowExecutionTaskIdentity(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MaintenanceWindowExecutionTaskIdentity(entry, context); + }); }; const deserializeAws_json1_1MaintenanceWindowExecutionTaskIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1MaintenanceWindowExecutionTaskInvocationIdentity = ( @@ -20186,9 +21157,14 @@ const deserializeAws_json1_1MaintenanceWindowExecutionTaskInvocationIdentityList output: any, context: __SerdeContext ): MaintenanceWindowExecutionTaskInvocationIdentity[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1MaintenanceWindowExecutionTaskInvocationIdentity(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MaintenanceWindowExecutionTaskInvocationIdentity(entry, context); + }); }; const deserializeAws_json1_1MaintenanceWindowIdentity = ( @@ -20230,7 +21206,14 @@ const deserializeAws_json1_1MaintenanceWindowIdentityList = ( output: any, context: __SerdeContext ): MaintenanceWindowIdentity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MaintenanceWindowIdentity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MaintenanceWindowIdentity(entry, context); + }); }; const deserializeAws_json1_1MaintenanceWindowLambdaParameters = ( @@ -20288,7 +21271,14 @@ const deserializeAws_json1_1MaintenanceWindowsForTargetList = ( output: any, context: __SerdeContext ): MaintenanceWindowIdentityForTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MaintenanceWindowIdentityForTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MaintenanceWindowIdentityForTarget(entry, context); + }); }; const deserializeAws_json1_1MaintenanceWindowStepFunctionsParameters = ( @@ -20325,7 +21315,14 @@ const deserializeAws_json1_1MaintenanceWindowTargetList = ( output: any, context: __SerdeContext ): MaintenanceWindowTarget[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MaintenanceWindowTarget(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MaintenanceWindowTarget(entry, context); + }); }; const deserializeAws_json1_1MaintenanceWindowTask = (output: any, context: __SerdeContext): MaintenanceWindowTask => { @@ -20385,7 +21382,14 @@ const deserializeAws_json1_1MaintenanceWindowTaskList = ( output: any, context: __SerdeContext ): MaintenanceWindowTask[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MaintenanceWindowTask(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MaintenanceWindowTask(entry, context); + }); }; const deserializeAws_json1_1MaintenanceWindowTaskParameters = ( @@ -20393,10 +21397,15 @@ const deserializeAws_json1_1MaintenanceWindowTaskParameters = ( context: __SerdeContext ): { [key: string]: MaintenanceWindowTaskParameterValueExpression } => { return Object.entries(output).reduce( - (acc: { [key: string]: MaintenanceWindowTaskParameterValueExpression }, [key, value]: [string, any]) => ({ - ...acc, - [key]: deserializeAws_json1_1MaintenanceWindowTaskParameterValueExpression(value, context), - }), + (acc: { [key: string]: MaintenanceWindowTaskParameterValueExpression }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: deserializeAws_json1_1MaintenanceWindowTaskParameterValueExpression(value, context), + }; + }, {} ); }; @@ -20405,7 +21414,14 @@ const deserializeAws_json1_1MaintenanceWindowTaskParametersList = ( output: any, context: __SerdeContext ): { [key: string]: MaintenanceWindowTaskParameterValueExpression }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MaintenanceWindowTaskParameters(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MaintenanceWindowTaskParameters(entry, context); + }); }; const deserializeAws_json1_1MaintenanceWindowTaskParameterValueExpression = ( @@ -20424,7 +21440,14 @@ const deserializeAws_json1_1MaintenanceWindowTaskParameterValueList = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1MaxDocumentSizeExceeded = ( @@ -20437,13 +21460,15 @@ const deserializeAws_json1_1MaxDocumentSizeExceeded = ( }; const deserializeAws_json1_1MetadataMap = (output: any, context: __SerdeContext): { [key: string]: MetadataValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: MetadataValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: MetadataValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1MetadataValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1MetadataValue = (output: any, context: __SerdeContext): MetadataValue => { @@ -20473,13 +21498,15 @@ const deserializeAws_json1_1NonCompliantSummary = (output: any, context: __Serde }; const deserializeAws_json1_1NormalStringMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1NotificationConfig = (output: any, context: __SerdeContext): NotificationConfig => { @@ -20499,7 +21526,14 @@ const deserializeAws_json1_1NotificationEventList = ( output: any, context: __SerdeContext ): (NotificationEvent | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1OpsEntity = (output: any, context: __SerdeContext): OpsEntity => { @@ -20523,37 +21557,55 @@ const deserializeAws_json1_1OpsEntityItem = (output: any, context: __SerdeContex }; const deserializeAws_json1_1OpsEntityItemEntry = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1OpsEntityItemEntryList = ( output: any, context: __SerdeContext ): { [key: string]: string }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OpsEntityItemEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OpsEntityItemEntry(entry, context); + }); }; const deserializeAws_json1_1OpsEntityItemMap = ( output: any, context: __SerdeContext ): { [key: string]: OpsEntityItem } => { - return Object.entries(output).reduce( - (acc: { [key: string]: OpsEntityItem }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: OpsEntityItem }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1OpsEntityItem(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1OpsEntityList = (output: any, context: __SerdeContext): OpsEntity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OpsEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OpsEntity(entry, context); + }); }; const deserializeAws_json1_1OpsItem = (output: any, context: __SerdeContext): OpsItem => { @@ -20654,28 +21706,51 @@ const deserializeAws_json1_1OpsItemNotification = (output: any, context: __Serde }; const deserializeAws_json1_1OpsItemNotifications = (output: any, context: __SerdeContext): OpsItemNotification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OpsItemNotification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OpsItemNotification(entry, context); + }); }; const deserializeAws_json1_1OpsItemOperationalData = ( output: any, context: __SerdeContext ): { [key: string]: OpsItemDataValue } => { - return Object.entries(output).reduce( - (acc: { [key: string]: OpsItemDataValue }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: OpsItemDataValue }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1OpsItemDataValue(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1OpsItemParameterNamesList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1OpsItemSummaries = (output: any, context: __SerdeContext): OpsItemSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OpsItemSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OpsItemSummary(entry, context); + }); }; const deserializeAws_json1_1OpsItemSummary = (output: any, context: __SerdeContext): OpsItemSummary => { @@ -20760,7 +21835,14 @@ const deserializeAws_json1_1OpsMetadataLimitExceededException = ( }; const deserializeAws_json1_1OpsMetadataList = (output: any, context: __SerdeContext): OpsMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OpsMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OpsMetadata(entry, context); + }); }; const deserializeAws_json1_1OpsMetadataNotFoundException = ( @@ -20843,7 +21925,14 @@ const deserializeAws_json1_1ParameterHistory = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ParameterHistoryList = (output: any, context: __SerdeContext): ParameterHistory[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParameterHistory(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParameterHistory(entry, context); + }); }; const deserializeAws_json1_1ParameterInlinePolicy = (output: any, context: __SerdeContext): ParameterInlinePolicy => { @@ -20855,7 +21944,14 @@ const deserializeAws_json1_1ParameterInlinePolicy = (output: any, context: __Ser }; const deserializeAws_json1_1ParameterLabelList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ParameterLimitExceeded = (output: any, context: __SerdeContext): ParameterLimitExceeded => { @@ -20865,7 +21961,14 @@ const deserializeAws_json1_1ParameterLimitExceeded = (output: any, context: __Se }; const deserializeAws_json1_1ParameterList = (output: any, context: __SerdeContext): Parameter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Parameter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Parameter(entry, context); + }); }; const deserializeAws_json1_1ParameterMaxVersionLimitExceeded = ( @@ -20902,11 +22005,25 @@ const deserializeAws_json1_1ParameterMetadata = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ParameterMetadataList = (output: any, context: __SerdeContext): ParameterMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParameterMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParameterMetadata(entry, context); + }); }; const deserializeAws_json1_1ParameterNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ParameterNotFound = (output: any, context: __SerdeContext): ParameterNotFound => { @@ -20925,21 +22042,37 @@ const deserializeAws_json1_1ParameterPatternMismatchException = ( }; const deserializeAws_json1_1ParameterPolicyList = (output: any, context: __SerdeContext): ParameterInlinePolicy[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParameterInlinePolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParameterInlinePolicy(entry, context); + }); }; const deserializeAws_json1_1Parameters = (output: any, context: __SerdeContext): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1ParameterValueList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1ParameterValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ParameterVersionLabelLimitExceeded = ( @@ -21003,7 +22136,14 @@ const deserializeAws_json1_1Patch = (output: any, context: __SerdeContext): Patc }; const deserializeAws_json1_1PatchAdvisoryIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PatchBaselineIdentity = (output: any, context: __SerdeContext): PatchBaselineIdentity => { @@ -21025,11 +22165,25 @@ const deserializeAws_json1_1PatchBaselineIdentityList = ( output: any, context: __SerdeContext ): PatchBaselineIdentity[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PatchBaselineIdentity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PatchBaselineIdentity(entry, context); + }); }; const deserializeAws_json1_1PatchBugzillaIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PatchComplianceData = (output: any, context: __SerdeContext): PatchComplianceData => { @@ -21049,11 +22203,25 @@ const deserializeAws_json1_1PatchComplianceData = (output: any, context: __Serde }; const deserializeAws_json1_1PatchComplianceDataList = (output: any, context: __SerdeContext): PatchComplianceData[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PatchComplianceData(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PatchComplianceData(entry, context); + }); }; const deserializeAws_json1_1PatchCVEIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PatchFilter = (output: any, context: __SerdeContext): PatchFilter => { @@ -21076,15 +22244,36 @@ const deserializeAws_json1_1PatchFilterGroup = (output: any, context: __SerdeCon }; const deserializeAws_json1_1PatchFilterList = (output: any, context: __SerdeContext): PatchFilter[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PatchFilter(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PatchFilter(entry, context); + }); }; const deserializeAws_json1_1PatchFilterValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PatchGroupList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PatchGroupPatchBaselineMapping = ( @@ -21104,32 +22293,62 @@ const deserializeAws_json1_1PatchGroupPatchBaselineMappingList = ( output: any, context: __SerdeContext ): PatchGroupPatchBaselineMapping[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PatchGroupPatchBaselineMapping(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PatchGroupPatchBaselineMapping(entry, context); + }); }; const deserializeAws_json1_1PatchIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PatchList = (output: any, context: __SerdeContext): Patch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Patch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Patch(entry, context); + }); }; const deserializeAws_json1_1PatchPropertiesList = ( output: any, context: __SerdeContext ): { [key: string]: string }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PatchPropertyEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PatchPropertyEntry(entry, context); + }); }; const deserializeAws_json1_1PatchPropertyEntry = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1PatchRule = (output: any, context: __SerdeContext): PatchRule => { @@ -21161,7 +22380,14 @@ const deserializeAws_json1_1PatchRuleGroup = (output: any, context: __SerdeConte }; const deserializeAws_json1_1PatchRuleList = (output: any, context: __SerdeContext): PatchRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PatchRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PatchRule(entry, context); + }); }; const deserializeAws_json1_1PatchSource = (output: any, context: __SerdeContext): PatchSource => { @@ -21177,11 +22403,25 @@ const deserializeAws_json1_1PatchSource = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1PatchSourceList = (output: any, context: __SerdeContext): PatchSource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PatchSource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PatchSource(entry, context); + }); }; const deserializeAws_json1_1PatchSourceProductList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PatchStatus = (output: any, context: __SerdeContext): PatchStatus => { @@ -21198,7 +22438,14 @@ const deserializeAws_json1_1PatchStatus = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1PlatformTypeList = (output: any, context: __SerdeContext): (PlatformType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PoliciesLimitExceededException = ( @@ -21243,7 +22490,14 @@ const deserializeAws_json1_1PutParameterResult = (output: any, context: __SerdeC }; const deserializeAws_json1_1Regions = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1RegisterDefaultPatchBaselineResult = ( @@ -21291,7 +22545,14 @@ const deserializeAws_json1_1RelatedOpsItem = (output: any, context: __SerdeConte }; const deserializeAws_json1_1RelatedOpsItems = (output: any, context: __SerdeContext): RelatedOpsItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RelatedOpsItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RelatedOpsItem(entry, context); + }); }; const deserializeAws_json1_1RemoveTagsFromResourceResult = ( @@ -21354,7 +22615,14 @@ const deserializeAws_json1_1ResourceComplianceSummaryItemList = ( output: any, context: __SerdeContext ): ResourceComplianceSummaryItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceComplianceSummaryItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceComplianceSummaryItem(entry, context); + }); }; const deserializeAws_json1_1ResourceDataSyncAlreadyExistsException = ( @@ -21461,7 +22729,14 @@ const deserializeAws_json1_1ResourceDataSyncItemList = ( output: any, context: __SerdeContext ): ResourceDataSyncItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceDataSyncItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceDataSyncItem(entry, context); + }); }; const deserializeAws_json1_1ResourceDataSyncNotFoundException = ( @@ -21491,7 +22766,14 @@ const deserializeAws_json1_1ResourceDataSyncOrganizationalUnitList = ( output: any, context: __SerdeContext ): ResourceDataSyncOrganizationalUnit[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ResourceDataSyncOrganizationalUnit(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ResourceDataSyncOrganizationalUnit(entry, context); + }); }; const deserializeAws_json1_1ResourceDataSyncS3Destination = ( @@ -21512,7 +22794,14 @@ const deserializeAws_json1_1ResourceDataSyncS3Destination = ( }; const deserializeAws_json1_1ResourceDataSyncSourceRegionList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceDataSyncSourceWithState = ( @@ -21597,7 +22886,14 @@ const deserializeAws_json1_1ScheduledWindowExecutionList = ( output: any, context: __SerdeContext ): ScheduledWindowExecution[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ScheduledWindowExecution(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ScheduledWindowExecution(entry, context); + }); }; const deserializeAws_json1_1SendAutomationSignalResult = ( @@ -21659,7 +22955,14 @@ const deserializeAws_json1_1Session = (output: any, context: __SerdeContext): Se }; const deserializeAws_json1_1SessionList = (output: any, context: __SerdeContext): Session[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Session(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Session(entry, context); + }); }; const deserializeAws_json1_1SessionManagerOutputUrl = ( @@ -21780,7 +23083,14 @@ const deserializeAws_json1_1StepExecution = (output: any, context: __SerdeContex }; const deserializeAws_json1_1StepExecutionList = (output: any, context: __SerdeContext): StepExecution[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StepExecution(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StepExecution(entry, context); + }); }; const deserializeAws_json1_1StopAutomationExecutionResult = ( @@ -21807,7 +23117,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1Target = (output: any, context: __SerdeContext): Target => { @@ -21852,25 +23169,48 @@ const deserializeAws_json1_1TargetLocation = (output: any, context: __SerdeConte }; const deserializeAws_json1_1TargetLocations = (output: any, context: __SerdeContext): TargetLocation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TargetLocation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TargetLocation(entry, context); + }); }; const deserializeAws_json1_1TargetMap = (output: any, context: __SerdeContext): { [key: string]: string[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_json1_1TargetMapValueList(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1TargetMaps = (output: any, context: __SerdeContext): { [key: string]: string[] }[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TargetMap(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TargetMap(entry, context); + }); }; const deserializeAws_json1_1TargetMapValueList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TargetNotConnected = (output: any, context: __SerdeContext): TargetNotConnected => { @@ -21880,15 +23220,36 @@ const deserializeAws_json1_1TargetNotConnected = (output: any, context: __SerdeC }; const deserializeAws_json1_1TargetParameterList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Targets = (output: any, context: __SerdeContext): Target[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Target(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Target(entry, context); + }); }; const deserializeAws_json1_1TargetValues = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TerminateSessionResponse = ( @@ -22196,7 +23557,14 @@ const deserializeAws_json1_1UpdateServiceSettingResult = ( }; const deserializeAws_json1_1ValidNextStepList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -22249,3 +23617,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-sso-admin/protocols/Aws_json1_1.ts b/clients/client-sso-admin/protocols/Aws_json1_1.ts index 35604c74c190..29a5d51698bf 100644 --- a/clients/client-sso-admin/protocols/Aws_json1_1.ts +++ b/clients/client-sso-admin/protocols/Aws_json1_1.ts @@ -209,7 +209,7 @@ export const serializeAws_json1_1AttachManagedPolicyToPermissionSetCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.AttachManagedPolicyToPermissionSet", }; let body: any; @@ -222,7 +222,7 @@ export const serializeAws_json1_1CreateAccountAssignmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.CreateAccountAssignment", }; let body: any; @@ -235,7 +235,7 @@ export const serializeAws_json1_1CreateInstanceAccessControlAttributeConfigurati context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.CreateInstanceAccessControlAttributeConfiguration", }; let body: any; @@ -248,7 +248,7 @@ export const serializeAws_json1_1CreatePermissionSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.CreatePermissionSet", }; let body: any; @@ -261,7 +261,7 @@ export const serializeAws_json1_1DeleteAccountAssignmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DeleteAccountAssignment", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DeleteInlinePolicyFromPermissionSet", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurati context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DeleteInstanceAccessControlAttributeConfiguration", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1DeletePermissionSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DeletePermissionSet", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1DescribeAccountAssignmentCreationStatusCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DescribeAccountAssignmentCreationStatus", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DescribeAccountAssignmentDeletionStatus", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1DescribeInstanceAccessControlAttributeConfigura context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DescribeInstanceAccessControlAttributeConfiguration", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1DescribePermissionSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DescribePermissionSet", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1DescribePermissionSetProvisioningStatusCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DescribePermissionSetProvisioningStatus", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1DetachManagedPolicyFromPermissionSetCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.DetachManagedPolicyFromPermissionSet", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1GetInlinePolicyForPermissionSetCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.GetInlinePolicyForPermissionSet", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1ListAccountAssignmentCreationStatusCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListAccountAssignmentCreationStatus", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1ListAccountAssignmentDeletionStatusCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListAccountAssignmentDeletionStatus", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1ListAccountAssignmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListAccountAssignments", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1ListAccountsForProvisionedPermissionSetCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListAccountsForProvisionedPermissionSet", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1ListInstancesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListInstances", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1ListManagedPoliciesInPermissionSetCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListManagedPoliciesInPermissionSet", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1ListPermissionSetProvisioningStatusCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListPermissionSetProvisioningStatus", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1ListPermissionSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListPermissionSets", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1ListPermissionSetsProvisionedToAccountCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListPermissionSetsProvisionedToAccount", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ListTagsForResource", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1ProvisionPermissionSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.ProvisionPermissionSet", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1PutInlinePolicyToPermissionSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.PutInlinePolicyToPermissionSet", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.TagResource", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.UntagResource", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurati context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.UpdateInstanceAccessControlAttributeConfiguration", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1UpdatePermissionSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "SWBExternalService.UpdatePermissionSet", }; let body: any; @@ -634,8 +634,7 @@ const deserializeAws_json1_1AttachManagedPolicyToPermissionSetCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -737,8 +736,7 @@ const deserializeAws_json1_1CreateAccountAssignmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -840,8 +838,7 @@ const deserializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationCom }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -935,8 +932,7 @@ const deserializeAws_json1_1CreatePermissionSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1038,8 +1034,7 @@ const deserializeAws_json1_1DeleteAccountAssignmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1133,8 +1128,7 @@ const deserializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1228,8 +1222,7 @@ const deserializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationCom }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1323,8 +1316,7 @@ const deserializeAws_json1_1DeletePermissionSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1418,8 +1410,7 @@ const deserializeAws_json1_1DescribeAccountAssignmentCreationStatusCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1505,8 +1496,7 @@ const deserializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1592,8 +1582,7 @@ const deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationC }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1679,8 +1668,7 @@ const deserializeAws_json1_1DescribePermissionSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1766,8 +1754,7 @@ const deserializeAws_json1_1DescribePermissionSetProvisioningStatusCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1853,8 +1840,7 @@ const deserializeAws_json1_1DetachManagedPolicyFromPermissionSetCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -1948,8 +1934,7 @@ const deserializeAws_json1_1GetInlinePolicyForPermissionSetCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2035,8 +2020,7 @@ const deserializeAws_json1_1ListAccountAssignmentCreationStatusCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2122,8 +2106,7 @@ const deserializeAws_json1_1ListAccountAssignmentDeletionStatusCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2209,8 +2192,7 @@ const deserializeAws_json1_1ListAccountAssignmentsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2296,8 +2278,7 @@ const deserializeAws_json1_1ListAccountsForProvisionedPermissionSetCommandError }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2383,8 +2364,7 @@ const deserializeAws_json1_1ListInstancesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2462,8 +2442,7 @@ const deserializeAws_json1_1ListManagedPoliciesInPermissionSetCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2549,8 +2528,7 @@ const deserializeAws_json1_1ListPermissionSetProvisioningStatusCommandError = as }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2636,8 +2614,7 @@ const deserializeAws_json1_1ListPermissionSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2723,8 +2700,7 @@ const deserializeAws_json1_1ListPermissionSetsProvisionedToAccountCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2810,8 +2786,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2897,8 +2872,7 @@ const deserializeAws_json1_1ProvisionPermissionSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -2992,8 +2966,7 @@ const deserializeAws_json1_1PutInlinePolicyToPermissionSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -3095,8 +3068,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -3198,8 +3170,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -3293,8 +3264,7 @@ const deserializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationCom }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -3388,8 +3358,7 @@ const deserializeAws_json1_1UpdatePermissionSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssoadmin#AccessDeniedException": @@ -3563,8 +3532,9 @@ const deserializeAws_json1_1ValidationExceptionResponse = async ( const serializeAws_json1_1AccessControlAttribute = (input: AccessControlAttribute, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: serializeAws_json1_1AccessControlAttributeValue(input.Value, context) }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && + input.Value !== null && { Value: serializeAws_json1_1AccessControlAttributeValue(input.Value, context) }), }; }; @@ -3572,7 +3542,14 @@ const serializeAws_json1_1AccessControlAttributeList = ( input: AccessControlAttribute[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AccessControlAttribute(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AccessControlAttribute(entry, context); + }); }; const serializeAws_json1_1AccessControlAttributeValue = ( @@ -3580,14 +3557,22 @@ const serializeAws_json1_1AccessControlAttributeValue = ( context: __SerdeContext ): any => { return { - ...(input.Source !== undefined && { - Source: serializeAws_json1_1AccessControlAttributeValueSourceList(input.Source, context), - }), + ...(input.Source !== undefined && + input.Source !== null && { + Source: serializeAws_json1_1AccessControlAttributeValueSourceList(input.Source, context), + }), }; }; const serializeAws_json1_1AccessControlAttributeValueSourceList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AttachManagedPolicyToPermissionSetRequest = ( @@ -3595,9 +3580,11 @@ const serializeAws_json1_1AttachManagedPolicyToPermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.ManagedPolicyArn !== undefined && { ManagedPolicyArn: input.ManagedPolicyArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.ManagedPolicyArn !== undefined && + input.ManagedPolicyArn !== null && { ManagedPolicyArn: input.ManagedPolicyArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), }; }; @@ -3606,12 +3593,13 @@ const serializeAws_json1_1CreateAccountAssignmentRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), - ...(input.PrincipalId !== undefined && { PrincipalId: input.PrincipalId }), - ...(input.PrincipalType !== undefined && { PrincipalType: input.PrincipalType }), - ...(input.TargetId !== undefined && { TargetId: input.TargetId }), - ...(input.TargetType !== undefined && { TargetType: input.TargetType }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), + ...(input.PrincipalId !== undefined && input.PrincipalId !== null && { PrincipalId: input.PrincipalId }), + ...(input.PrincipalType !== undefined && input.PrincipalType !== null && { PrincipalType: input.PrincipalType }), + ...(input.TargetId !== undefined && input.TargetId !== null && { TargetId: input.TargetId }), + ...(input.TargetType !== undefined && input.TargetType !== null && { TargetType: input.TargetType }), }; }; @@ -3620,13 +3608,14 @@ const serializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationReque context: __SerdeContext ): any => { return { - ...(input.InstanceAccessControlAttributeConfiguration !== undefined && { - InstanceAccessControlAttributeConfiguration: serializeAws_json1_1InstanceAccessControlAttributeConfiguration( - input.InstanceAccessControlAttributeConfiguration, - context - ), - }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), + ...(input.InstanceAccessControlAttributeConfiguration !== undefined && + input.InstanceAccessControlAttributeConfiguration !== null && { + InstanceAccessControlAttributeConfiguration: serializeAws_json1_1InstanceAccessControlAttributeConfiguration( + input.InstanceAccessControlAttributeConfiguration, + context + ), + }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), }; }; @@ -3635,12 +3624,13 @@ const serializeAws_json1_1CreatePermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RelayState !== undefined && { RelayState: input.RelayState }), - ...(input.SessionDuration !== undefined && { SessionDuration: input.SessionDuration }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RelayState !== undefined && input.RelayState !== null && { RelayState: input.RelayState }), + ...(input.SessionDuration !== undefined && + input.SessionDuration !== null && { SessionDuration: input.SessionDuration }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -3649,12 +3639,13 @@ const serializeAws_json1_1DeleteAccountAssignmentRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), - ...(input.PrincipalId !== undefined && { PrincipalId: input.PrincipalId }), - ...(input.PrincipalType !== undefined && { PrincipalType: input.PrincipalType }), - ...(input.TargetId !== undefined && { TargetId: input.TargetId }), - ...(input.TargetType !== undefined && { TargetType: input.TargetType }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), + ...(input.PrincipalId !== undefined && input.PrincipalId !== null && { PrincipalId: input.PrincipalId }), + ...(input.PrincipalType !== undefined && input.PrincipalType !== null && { PrincipalType: input.PrincipalType }), + ...(input.TargetId !== undefined && input.TargetId !== null && { TargetId: input.TargetId }), + ...(input.TargetType !== undefined && input.TargetType !== null && { TargetType: input.TargetType }), }; }; @@ -3663,8 +3654,9 @@ const serializeAws_json1_1DeleteInlinePolicyFromPermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), }; }; @@ -3673,7 +3665,7 @@ const serializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationReque context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), }; }; @@ -3682,8 +3674,9 @@ const serializeAws_json1_1DeletePermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), }; }; @@ -3692,10 +3685,11 @@ const serializeAws_json1_1DescribeAccountAssignmentCreationStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountAssignmentCreationRequestId !== undefined && { - AccountAssignmentCreationRequestId: input.AccountAssignmentCreationRequestId, - }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), + ...(input.AccountAssignmentCreationRequestId !== undefined && + input.AccountAssignmentCreationRequestId !== null && { + AccountAssignmentCreationRequestId: input.AccountAssignmentCreationRequestId, + }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), }; }; @@ -3704,10 +3698,11 @@ const serializeAws_json1_1DescribeAccountAssignmentDeletionStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountAssignmentDeletionRequestId !== undefined && { - AccountAssignmentDeletionRequestId: input.AccountAssignmentDeletionRequestId, - }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), + ...(input.AccountAssignmentDeletionRequestId !== undefined && + input.AccountAssignmentDeletionRequestId !== null && { + AccountAssignmentDeletionRequestId: input.AccountAssignmentDeletionRequestId, + }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), }; }; @@ -3716,7 +3711,7 @@ const serializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationReq context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), }; }; @@ -3725,10 +3720,11 @@ const serializeAws_json1_1DescribePermissionSetProvisioningStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.ProvisionPermissionSetRequestId !== undefined && { - ProvisionPermissionSetRequestId: input.ProvisionPermissionSetRequestId, - }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.ProvisionPermissionSetRequestId !== undefined && + input.ProvisionPermissionSetRequestId !== null && { + ProvisionPermissionSetRequestId: input.ProvisionPermissionSetRequestId, + }), }; }; @@ -3737,8 +3733,9 @@ const serializeAws_json1_1DescribePermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), }; }; @@ -3747,9 +3744,11 @@ const serializeAws_json1_1DetachManagedPolicyFromPermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.ManagedPolicyArn !== undefined && { ManagedPolicyArn: input.ManagedPolicyArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.ManagedPolicyArn !== undefined && + input.ManagedPolicyArn !== null && { ManagedPolicyArn: input.ManagedPolicyArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), }; }; @@ -3758,8 +3757,9 @@ const serializeAws_json1_1GetInlinePolicyForPermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), }; }; @@ -3768,9 +3768,10 @@ const serializeAws_json1_1InstanceAccessControlAttributeConfiguration = ( context: __SerdeContext ): any => { return { - ...(input.AccessControlAttributes !== undefined && { - AccessControlAttributes: serializeAws_json1_1AccessControlAttributeList(input.AccessControlAttributes, context), - }), + ...(input.AccessControlAttributes !== undefined && + input.AccessControlAttributes !== null && { + AccessControlAttributes: serializeAws_json1_1AccessControlAttributeList(input.AccessControlAttributes, context), + }), }; }; @@ -3779,10 +3780,11 @@ const serializeAws_json1_1ListAccountAssignmentCreationStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1OperationStatusFilter(input.Filter, context) }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1OperationStatusFilter(input.Filter, context) }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3791,10 +3793,11 @@ const serializeAws_json1_1ListAccountAssignmentDeletionStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1OperationStatusFilter(input.Filter, context) }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1OperationStatusFilter(input.Filter, context) }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3803,11 +3806,12 @@ const serializeAws_json1_1ListAccountAssignmentsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), }; }; @@ -3816,18 +3820,20 @@ const serializeAws_json1_1ListAccountsForProvisionedPermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), - ...(input.ProvisioningStatus !== undefined && { ProvisioningStatus: input.ProvisioningStatus }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), + ...(input.ProvisioningStatus !== undefined && + input.ProvisioningStatus !== null && { ProvisioningStatus: input.ProvisioningStatus }), }; }; const serializeAws_json1_1ListInstancesRequest = (input: ListInstancesRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3836,10 +3842,11 @@ const serializeAws_json1_1ListManagedPoliciesInPermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), }; }; @@ -3848,10 +3855,11 @@ const serializeAws_json1_1ListPermissionSetProvisioningStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1OperationStatusFilter(input.Filter, context) }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1OperationStatusFilter(input.Filter, context) }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3860,11 +3868,12 @@ const serializeAws_json1_1ListPermissionSetsProvisionedToAccountRequest = ( context: __SerdeContext ): any => { return { - ...(input.AccountId !== undefined && { AccountId: input.AccountId }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ProvisioningStatus !== undefined && { ProvisioningStatus: input.ProvisioningStatus }), + ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ProvisioningStatus !== undefined && + input.ProvisioningStatus !== null && { ProvisioningStatus: input.ProvisioningStatus }), }; }; @@ -3873,9 +3882,9 @@ const serializeAws_json1_1ListPermissionSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -3884,15 +3893,15 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1OperationStatusFilter = (input: OperationStatusFilter, context: __SerdeContext): any => { return { - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -3901,10 +3910,11 @@ const serializeAws_json1_1ProvisionPermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), - ...(input.TargetId !== undefined && { TargetId: input.TargetId }), - ...(input.TargetType !== undefined && { TargetType: input.TargetType }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), + ...(input.TargetId !== undefined && input.TargetId !== null && { TargetId: input.TargetId }), + ...(input.TargetType !== undefined && input.TargetType !== null && { TargetType: input.TargetType }), }; }; @@ -3913,40 +3923,56 @@ const serializeAws_json1_1PutInlinePolicyToPermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.InlinePolicy !== undefined && { InlinePolicy: input.InlinePolicy }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), + ...(input.InlinePolicy !== undefined && input.InlinePolicy !== null && { InlinePolicy: input.InlinePolicy }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -3955,13 +3981,14 @@ const serializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationReque context: __SerdeContext ): any => { return { - ...(input.InstanceAccessControlAttributeConfiguration !== undefined && { - InstanceAccessControlAttributeConfiguration: serializeAws_json1_1InstanceAccessControlAttributeConfiguration( - input.InstanceAccessControlAttributeConfiguration, - context - ), - }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), + ...(input.InstanceAccessControlAttributeConfiguration !== undefined && + input.InstanceAccessControlAttributeConfiguration !== null && { + InstanceAccessControlAttributeConfiguration: serializeAws_json1_1InstanceAccessControlAttributeConfiguration( + input.InstanceAccessControlAttributeConfiguration, + context + ), + }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), }; }; @@ -3970,11 +3997,13 @@ const serializeAws_json1_1UpdatePermissionSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.InstanceArn !== undefined && { InstanceArn: input.InstanceArn }), - ...(input.PermissionSetArn !== undefined && { PermissionSetArn: input.PermissionSetArn }), - ...(input.RelayState !== undefined && { RelayState: input.RelayState }), - ...(input.SessionDuration !== undefined && { SessionDuration: input.SessionDuration }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.InstanceArn !== undefined && input.InstanceArn !== null && { InstanceArn: input.InstanceArn }), + ...(input.PermissionSetArn !== undefined && + input.PermissionSetArn !== null && { PermissionSetArn: input.PermissionSetArn }), + ...(input.RelayState !== undefined && input.RelayState !== null && { RelayState: input.RelayState }), + ...(input.SessionDuration !== undefined && + input.SessionDuration !== null && { SessionDuration: input.SessionDuration }), }; }; @@ -3992,7 +4021,14 @@ const deserializeAws_json1_1AccessControlAttributeList = ( output: any, context: __SerdeContext ): AccessControlAttribute[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AccessControlAttribute(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccessControlAttribute(entry, context); + }); }; const deserializeAws_json1_1AccessControlAttributeValue = ( @@ -4011,7 +4047,14 @@ const deserializeAws_json1_1AccessControlAttributeValueSourceList = ( output: any, context: __SerdeContext ): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => { @@ -4032,7 +4075,14 @@ const deserializeAws_json1_1AccountAssignment = (output: any, context: __SerdeCo }; const deserializeAws_json1_1AccountAssignmentList = (output: any, context: __SerdeContext): AccountAssignment[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AccountAssignment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccountAssignment(entry, context); + }); }; const deserializeAws_json1_1AccountAssignmentOperationStatus = ( @@ -4062,9 +4112,14 @@ const deserializeAws_json1_1AccountAssignmentOperationStatusList = ( output: any, context: __SerdeContext ): AccountAssignmentOperationStatusMetadata[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1AccountAssignmentOperationStatusMetadata(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccountAssignmentOperationStatusMetadata(entry, context); + }); }; const deserializeAws_json1_1AccountAssignmentOperationStatusMetadata = ( @@ -4082,7 +4137,14 @@ const deserializeAws_json1_1AccountAssignmentOperationStatusMetadata = ( }; const deserializeAws_json1_1AccountList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AttachedManagedPolicy = (output: any, context: __SerdeContext): AttachedManagedPolicy => { @@ -4096,7 +4158,14 @@ const deserializeAws_json1_1AttachedManagedPolicyList = ( output: any, context: __SerdeContext ): AttachedManagedPolicy[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttachedManagedPolicy(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttachedManagedPolicy(entry, context); + }); }; const deserializeAws_json1_1AttachManagedPolicyToPermissionSetResponse = ( @@ -4271,7 +4340,14 @@ const deserializeAws_json1_1InstanceAccessControlAttributeConfiguration = ( }; const deserializeAws_json1_1InstanceList = (output: any, context: __SerdeContext): InstanceMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1InstanceMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1InstanceMetadata(entry, context); + }); }; const deserializeAws_json1_1InstanceMetadata = (output: any, context: __SerdeContext): InstanceMetadata => { @@ -4435,7 +4511,14 @@ const deserializeAws_json1_1PermissionSet = (output: any, context: __SerdeContex }; const deserializeAws_json1_1PermissionSetList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PermissionSetProvisioningStatus = ( @@ -4461,9 +4544,14 @@ const deserializeAws_json1_1PermissionSetProvisioningStatusList = ( output: any, context: __SerdeContext ): PermissionSetProvisioningStatusMetadata[] => { - return (output || []).map((entry: any) => - deserializeAws_json1_1PermissionSetProvisioningStatusMetadata(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PermissionSetProvisioningStatusMetadata(entry, context); + }); }; const deserializeAws_json1_1PermissionSetProvisioningStatusMetadata = ( @@ -4525,7 +4613,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -4612,3 +4707,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-sso-oidc/protocols/Aws_restJson1.ts b/clients/client-sso-oidc/protocols/Aws_restJson1.ts index ddf08df8c752..8470ef08dde4 100644 --- a/clients/client-sso-oidc/protocols/Aws_restJson1.ts +++ b/clients/client-sso-oidc/protocols/Aws_restJson1.ts @@ -32,19 +32,20 @@ export const serializeAws_restJson1CreateTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/token"; let body: any; body = JSON.stringify({ - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.clientSecret !== undefined && { clientSecret: input.clientSecret }), - ...(input.code !== undefined && { code: input.code }), - ...(input.deviceCode !== undefined && { deviceCode: input.deviceCode }), - ...(input.grantType !== undefined && { grantType: input.grantType }), - ...(input.redirectUri !== undefined && { redirectUri: input.redirectUri }), - ...(input.refreshToken !== undefined && { refreshToken: input.refreshToken }), - ...(input.scope !== undefined && { scope: serializeAws_restJson1Scopes(input.scope, context) }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.clientSecret !== undefined && input.clientSecret !== null && { clientSecret: input.clientSecret }), + ...(input.code !== undefined && input.code !== null && { code: input.code }), + ...(input.deviceCode !== undefined && input.deviceCode !== null && { deviceCode: input.deviceCode }), + ...(input.grantType !== undefined && input.grantType !== null && { grantType: input.grantType }), + ...(input.redirectUri !== undefined && input.redirectUri !== null && { redirectUri: input.redirectUri }), + ...(input.refreshToken !== undefined && input.refreshToken !== null && { refreshToken: input.refreshToken }), + ...(input.scope !== undefined && + input.scope !== null && { scope: serializeAws_restJson1Scopes(input.scope, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -63,14 +64,15 @@ export const serializeAws_restJson1RegisterClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/client/register"; let body: any; body = JSON.stringify({ - ...(input.clientName !== undefined && { clientName: input.clientName }), - ...(input.clientType !== undefined && { clientType: input.clientType }), - ...(input.scopes !== undefined && { scopes: serializeAws_restJson1Scopes(input.scopes, context) }), + ...(input.clientName !== undefined && input.clientName !== null && { clientName: input.clientName }), + ...(input.clientType !== undefined && input.clientType !== null && { clientType: input.clientType }), + ...(input.scopes !== undefined && + input.scopes !== null && { scopes: serializeAws_restJson1Scopes(input.scopes, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -89,14 +91,14 @@ export const serializeAws_restJson1StartDeviceAuthorizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/device_authorization"; let body: any; body = JSON.stringify({ - ...(input.clientId !== undefined && { clientId: input.clientId }), - ...(input.clientSecret !== undefined && { clientSecret: input.clientSecret }), - ...(input.startUrl !== undefined && { startUrl: input.startUrl }), + ...(input.clientId !== undefined && input.clientId !== null && { clientId: input.clientId }), + ...(input.clientSecret !== undefined && input.clientSecret !== null && { clientSecret: input.clientSecret }), + ...(input.startUrl !== undefined && input.startUrl !== null && { startUrl: input.startUrl }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -720,7 +722,14 @@ const deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse = async ( }; const serializeAws_restJson1Scopes = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -743,6 +752,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-sso/models/models_0.ts b/clients/client-sso/models/models_0.ts index 231a7045815c..38c260729a1d 100644 --- a/clients/client-sso/models/models_0.ts +++ b/clients/client-sso/models/models_0.ts @@ -5,6 +5,11 @@ import { MetadataBearer as $MetadataBearer } from "@aws-sdk/types"; *

Provides information about your AWS account.

*/ export interface AccountInfo { + /** + *

The identifier of the AWS account that is assigned to the user.

+ */ + accountId?: string; + /** *

The display name of the AWS account that is assigned to the user.

*/ @@ -14,11 +19,6 @@ export interface AccountInfo { *

The email address of the AWS account that is assigned to the user.

*/ emailAddress?: string; - - /** - *

The identifier of the AWS account that is assigned to the user.

- */ - accountId?: string; } export namespace AccountInfo { @@ -34,15 +34,15 @@ export interface GetRoleCredentialsRequest { roleName: string | undefined; /** - *

The token issued by the CreateToken API call. For more information, see - * CreateToken in the AWS SSO OIDC API Reference Guide.

+ *

The identifier for the AWS account that is assigned to the user.

*/ - accessToken: string | undefined; + accountId: string | undefined; /** - *

The identifier for the AWS account that is assigned to the user.

+ *

The token issued by the CreateToken API call. For more information, see + * CreateToken in the AWS SSO OIDC API Reference Guide.

*/ - accountId: string | undefined; + accessToken: string | undefined; } export namespace GetRoleCredentialsRequest { @@ -57,35 +57,35 @@ export namespace GetRoleCredentialsRequest { */ export interface RoleCredentials { /** - *

The date on which temporary security credentials expire.

+ *

The identifier used for the temporary security credentials. For more information, see + * Using Temporary Security Credentials to Request Access to AWS Resources in the + * AWS IAM User Guide.

*/ - expiration?: number; + accessKeyId?: string; /** - *

The token used for temporary credentials. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the + *

The key that is used to sign the request. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the * AWS IAM User Guide.

*/ - sessionToken?: string; + secretAccessKey?: string; /** - *

The identifier used for the temporary security credentials. For more information, see - * Using Temporary Security Credentials to Request Access to AWS Resources in the + *

The token used for temporary credentials. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the * AWS IAM User Guide.

*/ - accessKeyId?: string; + sessionToken?: string; /** - *

The key that is used to sign the request. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the - * AWS IAM User Guide.

+ *

The date on which temporary security credentials expire.

*/ - secretAccessKey?: string; + expiration?: number; } export namespace RoleCredentials { export const filterSensitiveLog = (obj: RoleCredentials): any => ({ ...obj, - ...(obj.sessionToken && { sessionToken: SENSITIVE_STRING }), ...(obj.secretAccessKey && { secretAccessKey: SENSITIVE_STRING }), + ...(obj.sessionToken && { sessionToken: SENSITIVE_STRING }), }); } @@ -166,10 +166,9 @@ export namespace UnauthorizedException { export interface ListAccountRolesRequest { /** - *

The token issued by the CreateToken API call. For more information, see - * CreateToken in the AWS SSO OIDC API Reference Guide.

+ *

The page token from the previous response output when you request subsequent pages.

*/ - accessToken: string | undefined; + nextToken?: string; /** *

The number of items that clients can request per page.

@@ -177,14 +176,15 @@ export interface ListAccountRolesRequest { maxResults?: number; /** - *

The identifier for the AWS account that is assigned to the user.

+ *

The token issued by the CreateToken API call. For more information, see + * CreateToken in the AWS SSO OIDC API Reference Guide.

*/ - accountId: string | undefined; + accessToken: string | undefined; /** - *

The page token from the previous response output when you request subsequent pages.

+ *

The identifier for the AWS account that is assigned to the user.

*/ - nextToken?: string; + accountId: string | undefined; } export namespace ListAccountRolesRequest { @@ -199,14 +199,14 @@ export namespace ListAccountRolesRequest { */ export interface RoleInfo { /** - *

The identifier of the AWS account assigned to the user.

+ *

The friendly name of the role that is assigned to the user.

*/ - accountId?: string; + roleName?: string; /** - *

The friendly name of the role that is assigned to the user.

+ *

The identifier of the AWS account assigned to the user.

*/ - roleName?: string; + accountId?: string; } export namespace RoleInfo { @@ -217,14 +217,14 @@ export namespace RoleInfo { export interface ListAccountRolesResponse { /** - *

A paginated response with the list of roles and the next token if more results are available.

+ *

The page token client that is used to retrieve the list of accounts.

*/ - roleList?: RoleInfo[]; + nextToken?: string; /** - *

The page token client that is used to retrieve the list of accounts.

+ *

A paginated response with the list of roles and the next token if more results are available.

*/ - nextToken?: string; + roleList?: RoleInfo[]; } export namespace ListAccountRolesResponse { @@ -235,10 +235,9 @@ export namespace ListAccountRolesResponse { export interface ListAccountsRequest { /** - *

The token issued by the CreateToken API call. For more information, see - * CreateToken in the AWS SSO OIDC API Reference Guide.

+ *

(Optional) When requesting subsequent pages, this is the page token from the previous response output.

*/ - accessToken: string | undefined; + nextToken?: string; /** *

This is the number of items clients can request per page.

@@ -246,9 +245,10 @@ export interface ListAccountsRequest { maxResults?: number; /** - *

(Optional) When requesting subsequent pages, this is the page token from the previous response output.

+ *

The token issued by the CreateToken API call. For more information, see + * CreateToken in the AWS SSO OIDC API Reference Guide.

*/ - nextToken?: string; + accessToken: string | undefined; } export namespace ListAccountsRequest { @@ -260,14 +260,14 @@ export namespace ListAccountsRequest { export interface ListAccountsResponse { /** - *

A paginated response with the list of account information and the next token if more results are available.

+ *

The page token client that is used to retrieve the list of accounts.

*/ - accountList?: AccountInfo[]; + nextToken?: string; /** - *

The page token client that is used to retrieve the list of accounts.

+ *

A paginated response with the list of account information and the next token if more results are available.

*/ - nextToken?: string; + accountList?: AccountInfo[]; } export namespace ListAccountsResponse { diff --git a/clients/client-sso/protocols/Aws_restJson1.ts b/clients/client-sso/protocols/Aws_restJson1.ts index f282f7199b8b..548d76ce0860 100644 --- a/clients/client-sso/protocols/Aws_restJson1.ts +++ b/clients/client-sso/protocols/Aws_restJson1.ts @@ -28,7 +28,6 @@ export const serializeAws_restJson1GetRoleCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken! }), }; let resolvedPath = "/federation/credentials"; @@ -55,14 +54,13 @@ export const serializeAws_restJson1ListAccountRolesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken! }), }; let resolvedPath = "/assignment/roles"; const query: any = { + ...(input.nextToken !== undefined && { next_token: input.nextToken }), ...(input.maxResults !== undefined && { max_result: input.maxResults.toString() }), ...(input.accountId !== undefined && { account_id: input.accountId }), - ...(input.nextToken !== undefined && { next_token: input.nextToken }), }; let body: any; const { hostname, protocol = "https", port } = await context.endpoint(); @@ -83,13 +81,12 @@ export const serializeAws_restJson1ListAccountsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken! }), }; let resolvedPath = "/assignment/accounts"; const query: any = { - ...(input.maxResults !== undefined && { max_result: input.maxResults.toString() }), ...(input.nextToken !== undefined && { next_token: input.nextToken }), + ...(input.maxResults !== undefined && { max_result: input.maxResults.toString() }), }; let body: any; const { hostname, protocol = "https", port } = await context.endpoint(); @@ -110,7 +107,6 @@ export const serializeAws_restJson1LogoutCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken! }), }; let resolvedPath = "/logout"; @@ -516,7 +512,14 @@ const deserializeAws_restJson1AccountInfo = (output: any, context: __SerdeContex }; const deserializeAws_restJson1AccountListType = (output: any, context: __SerdeContext): AccountInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AccountInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AccountInfo(entry, context); + }); }; const deserializeAws_restJson1RoleCredentials = (output: any, context: __SerdeContext): RoleCredentials => { @@ -537,7 +540,14 @@ const deserializeAws_restJson1RoleInfo = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1RoleListType = (output: any, context: __SerdeContext): RoleInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RoleInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RoleInfo(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -560,6 +570,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-storage-gateway/protocols/Aws_json1_1.ts b/clients/client-storage-gateway/protocols/Aws_json1_1.ts index b95fe74f1c66..3a5f0d9dc374 100644 --- a/clients/client-storage-gateway/protocols/Aws_json1_1.ts +++ b/clients/client-storage-gateway/protocols/Aws_json1_1.ts @@ -431,7 +431,7 @@ export const serializeAws_json1_1ActivateGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ActivateGateway", }; let body: any; @@ -444,7 +444,7 @@ export const serializeAws_json1_1AddCacheCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.AddCache", }; let body: any; @@ -457,7 +457,7 @@ export const serializeAws_json1_1AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.AddTagsToResource", }; let body: any; @@ -470,7 +470,7 @@ export const serializeAws_json1_1AddUploadBufferCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.AddUploadBuffer", }; let body: any; @@ -483,7 +483,7 @@ export const serializeAws_json1_1AddWorkingStorageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.AddWorkingStorage", }; let body: any; @@ -496,7 +496,7 @@ export const serializeAws_json1_1AssignTapePoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.AssignTapePool", }; let body: any; @@ -509,7 +509,7 @@ export const serializeAws_json1_1AttachVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.AttachVolume", }; let body: any; @@ -522,7 +522,7 @@ export const serializeAws_json1_1CancelArchivalCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CancelArchival", }; let body: any; @@ -535,7 +535,7 @@ export const serializeAws_json1_1CancelRetrievalCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CancelRetrieval", }; let body: any; @@ -548,7 +548,7 @@ export const serializeAws_json1_1CreateCachediSCSIVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CreateCachediSCSIVolume", }; let body: any; @@ -561,7 +561,7 @@ export const serializeAws_json1_1CreateNFSFileShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CreateNFSFileShare", }; let body: any; @@ -574,7 +574,7 @@ export const serializeAws_json1_1CreateSMBFileShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CreateSMBFileShare", }; let body: any; @@ -587,7 +587,7 @@ export const serializeAws_json1_1CreateSnapshotCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CreateSnapshot", }; let body: any; @@ -600,7 +600,7 @@ export const serializeAws_json1_1CreateSnapshotFromVolumeRecoveryPointCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CreateSnapshotFromVolumeRecoveryPoint", }; let body: any; @@ -613,7 +613,7 @@ export const serializeAws_json1_1CreateStorediSCSIVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CreateStorediSCSIVolume", }; let body: any; @@ -626,7 +626,7 @@ export const serializeAws_json1_1CreateTapePoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CreateTapePool", }; let body: any; @@ -639,7 +639,7 @@ export const serializeAws_json1_1CreateTapesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CreateTapes", }; let body: any; @@ -652,7 +652,7 @@ export const serializeAws_json1_1CreateTapeWithBarcodeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.CreateTapeWithBarcode", }; let body: any; @@ -665,7 +665,7 @@ export const serializeAws_json1_1DeleteAutomaticTapeCreationPolicyCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteAutomaticTapeCreationPolicy", }; let body: any; @@ -678,7 +678,7 @@ export const serializeAws_json1_1DeleteBandwidthRateLimitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteBandwidthRateLimit", }; let body: any; @@ -691,7 +691,7 @@ export const serializeAws_json1_1DeleteChapCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteChapCredentials", }; let body: any; @@ -704,7 +704,7 @@ export const serializeAws_json1_1DeleteFileShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteFileShare", }; let body: any; @@ -717,7 +717,7 @@ export const serializeAws_json1_1DeleteGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteGateway", }; let body: any; @@ -730,7 +730,7 @@ export const serializeAws_json1_1DeleteSnapshotScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteSnapshotSchedule", }; let body: any; @@ -743,7 +743,7 @@ export const serializeAws_json1_1DeleteTapeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteTape", }; let body: any; @@ -756,7 +756,7 @@ export const serializeAws_json1_1DeleteTapeArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteTapeArchive", }; let body: any; @@ -769,7 +769,7 @@ export const serializeAws_json1_1DeleteTapePoolCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteTapePool", }; let body: any; @@ -782,7 +782,7 @@ export const serializeAws_json1_1DeleteVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DeleteVolume", }; let body: any; @@ -795,7 +795,7 @@ export const serializeAws_json1_1DescribeAvailabilityMonitorTestCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeAvailabilityMonitorTest", }; let body: any; @@ -808,7 +808,7 @@ export const serializeAws_json1_1DescribeBandwidthRateLimitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeBandwidthRateLimit", }; let body: any; @@ -821,7 +821,7 @@ export const serializeAws_json1_1DescribeBandwidthRateLimitScheduleCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeBandwidthRateLimitSchedule", }; let body: any; @@ -834,7 +834,7 @@ export const serializeAws_json1_1DescribeCacheCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeCache", }; let body: any; @@ -847,7 +847,7 @@ export const serializeAws_json1_1DescribeCachediSCSIVolumesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeCachediSCSIVolumes", }; let body: any; @@ -860,7 +860,7 @@ export const serializeAws_json1_1DescribeChapCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeChapCredentials", }; let body: any; @@ -873,7 +873,7 @@ export const serializeAws_json1_1DescribeGatewayInformationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeGatewayInformation", }; let body: any; @@ -886,7 +886,7 @@ export const serializeAws_json1_1DescribeMaintenanceStartTimeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeMaintenanceStartTime", }; let body: any; @@ -899,7 +899,7 @@ export const serializeAws_json1_1DescribeNFSFileSharesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeNFSFileShares", }; let body: any; @@ -912,7 +912,7 @@ export const serializeAws_json1_1DescribeSMBFileSharesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeSMBFileShares", }; let body: any; @@ -925,7 +925,7 @@ export const serializeAws_json1_1DescribeSMBSettingsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeSMBSettings", }; let body: any; @@ -938,7 +938,7 @@ export const serializeAws_json1_1DescribeSnapshotScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeSnapshotSchedule", }; let body: any; @@ -951,7 +951,7 @@ export const serializeAws_json1_1DescribeStorediSCSIVolumesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeStorediSCSIVolumes", }; let body: any; @@ -964,7 +964,7 @@ export const serializeAws_json1_1DescribeTapeArchivesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeTapeArchives", }; let body: any; @@ -977,7 +977,7 @@ export const serializeAws_json1_1DescribeTapeRecoveryPointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeTapeRecoveryPoints", }; let body: any; @@ -990,7 +990,7 @@ export const serializeAws_json1_1DescribeTapesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeTapes", }; let body: any; @@ -1003,7 +1003,7 @@ export const serializeAws_json1_1DescribeUploadBufferCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeUploadBuffer", }; let body: any; @@ -1016,7 +1016,7 @@ export const serializeAws_json1_1DescribeVTLDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeVTLDevices", }; let body: any; @@ -1029,7 +1029,7 @@ export const serializeAws_json1_1DescribeWorkingStorageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DescribeWorkingStorage", }; let body: any; @@ -1042,7 +1042,7 @@ export const serializeAws_json1_1DetachVolumeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DetachVolume", }; let body: any; @@ -1055,7 +1055,7 @@ export const serializeAws_json1_1DisableGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.DisableGateway", }; let body: any; @@ -1068,7 +1068,7 @@ export const serializeAws_json1_1JoinDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.JoinDomain", }; let body: any; @@ -1081,7 +1081,7 @@ export const serializeAws_json1_1ListAutomaticTapeCreationPoliciesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListAutomaticTapeCreationPolicies", }; let body: any; @@ -1094,7 +1094,7 @@ export const serializeAws_json1_1ListFileSharesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListFileShares", }; let body: any; @@ -1107,7 +1107,7 @@ export const serializeAws_json1_1ListGatewaysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListGateways", }; let body: any; @@ -1120,7 +1120,7 @@ export const serializeAws_json1_1ListLocalDisksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListLocalDisks", }; let body: any; @@ -1133,7 +1133,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListTagsForResource", }; let body: any; @@ -1146,7 +1146,7 @@ export const serializeAws_json1_1ListTapePoolsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListTapePools", }; let body: any; @@ -1159,7 +1159,7 @@ export const serializeAws_json1_1ListTapesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListTapes", }; let body: any; @@ -1172,7 +1172,7 @@ export const serializeAws_json1_1ListVolumeInitiatorsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListVolumeInitiators", }; let body: any; @@ -1185,7 +1185,7 @@ export const serializeAws_json1_1ListVolumeRecoveryPointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListVolumeRecoveryPoints", }; let body: any; @@ -1198,7 +1198,7 @@ export const serializeAws_json1_1ListVolumesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ListVolumes", }; let body: any; @@ -1211,7 +1211,7 @@ export const serializeAws_json1_1NotifyWhenUploadedCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.NotifyWhenUploaded", }; let body: any; @@ -1224,7 +1224,7 @@ export const serializeAws_json1_1RefreshCacheCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.RefreshCache", }; let body: any; @@ -1237,7 +1237,7 @@ export const serializeAws_json1_1RemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.RemoveTagsFromResource", }; let body: any; @@ -1250,7 +1250,7 @@ export const serializeAws_json1_1ResetCacheCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ResetCache", }; let body: any; @@ -1263,7 +1263,7 @@ export const serializeAws_json1_1RetrieveTapeArchiveCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.RetrieveTapeArchive", }; let body: any; @@ -1276,7 +1276,7 @@ export const serializeAws_json1_1RetrieveTapeRecoveryPointCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.RetrieveTapeRecoveryPoint", }; let body: any; @@ -1289,7 +1289,7 @@ export const serializeAws_json1_1SetLocalConsolePasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.SetLocalConsolePassword", }; let body: any; @@ -1302,7 +1302,7 @@ export const serializeAws_json1_1SetSMBGuestPasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.SetSMBGuestPassword", }; let body: any; @@ -1315,7 +1315,7 @@ export const serializeAws_json1_1ShutdownGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.ShutdownGateway", }; let body: any; @@ -1328,7 +1328,7 @@ export const serializeAws_json1_1StartAvailabilityMonitorTestCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.StartAvailabilityMonitorTest", }; let body: any; @@ -1341,7 +1341,7 @@ export const serializeAws_json1_1StartGatewayCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.StartGateway", }; let body: any; @@ -1354,7 +1354,7 @@ export const serializeAws_json1_1UpdateAutomaticTapeCreationPolicyCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateAutomaticTapeCreationPolicy", }; let body: any; @@ -1367,7 +1367,7 @@ export const serializeAws_json1_1UpdateBandwidthRateLimitCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateBandwidthRateLimit", }; let body: any; @@ -1380,7 +1380,7 @@ export const serializeAws_json1_1UpdateBandwidthRateLimitScheduleCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateBandwidthRateLimitSchedule", }; let body: any; @@ -1393,7 +1393,7 @@ export const serializeAws_json1_1UpdateChapCredentialsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateChapCredentials", }; let body: any; @@ -1406,7 +1406,7 @@ export const serializeAws_json1_1UpdateGatewayInformationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateGatewayInformation", }; let body: any; @@ -1419,7 +1419,7 @@ export const serializeAws_json1_1UpdateGatewaySoftwareNowCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateGatewaySoftwareNow", }; let body: any; @@ -1432,7 +1432,7 @@ export const serializeAws_json1_1UpdateMaintenanceStartTimeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateMaintenanceStartTime", }; let body: any; @@ -1445,7 +1445,7 @@ export const serializeAws_json1_1UpdateNFSFileShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateNFSFileShare", }; let body: any; @@ -1458,7 +1458,7 @@ export const serializeAws_json1_1UpdateSMBFileShareCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateSMBFileShare", }; let body: any; @@ -1471,7 +1471,7 @@ export const serializeAws_json1_1UpdateSMBFileShareVisibilityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateSMBFileShareVisibility", }; let body: any; @@ -1484,7 +1484,7 @@ export const serializeAws_json1_1UpdateSMBSecurityStrategyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateSMBSecurityStrategy", }; let body: any; @@ -1497,7 +1497,7 @@ export const serializeAws_json1_1UpdateSnapshotScheduleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateSnapshotSchedule", }; let body: any; @@ -1510,7 +1510,7 @@ export const serializeAws_json1_1UpdateVTLDeviceTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "StorageGateway_20130630.UpdateVTLDeviceType", }; let body: any; @@ -1545,8 +1545,7 @@ const deserializeAws_json1_1ActivateGatewayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -1608,8 +1607,7 @@ const deserializeAws_json1_1AddCacheCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -1671,8 +1669,7 @@ const deserializeAws_json1_1AddTagsToResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -1734,8 +1731,7 @@ const deserializeAws_json1_1AddUploadBufferCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -1797,8 +1793,7 @@ const deserializeAws_json1_1AddWorkingStorageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -1860,8 +1855,7 @@ const deserializeAws_json1_1AssignTapePoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -1923,8 +1917,7 @@ const deserializeAws_json1_1AttachVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -1986,8 +1979,7 @@ const deserializeAws_json1_1CancelArchivalCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2049,8 +2041,7 @@ const deserializeAws_json1_1CancelRetrievalCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2112,8 +2103,7 @@ const deserializeAws_json1_1CreateCachediSCSIVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2175,8 +2165,7 @@ const deserializeAws_json1_1CreateNFSFileShareCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2238,8 +2227,7 @@ const deserializeAws_json1_1CreateSMBFileShareCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2301,8 +2289,7 @@ const deserializeAws_json1_1CreateSnapshotCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2372,8 +2359,7 @@ const deserializeAws_json1_1CreateSnapshotFromVolumeRecoveryPointCommandError = }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2443,8 +2429,7 @@ const deserializeAws_json1_1CreateStorediSCSIVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2506,8 +2491,7 @@ const deserializeAws_json1_1CreateTapePoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2569,8 +2553,7 @@ const deserializeAws_json1_1CreateTapesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2632,8 +2615,7 @@ const deserializeAws_json1_1CreateTapeWithBarcodeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2695,8 +2677,7 @@ const deserializeAws_json1_1DeleteAutomaticTapeCreationPolicyCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2758,8 +2739,7 @@ const deserializeAws_json1_1DeleteBandwidthRateLimitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2821,8 +2801,7 @@ const deserializeAws_json1_1DeleteChapCredentialsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2884,8 +2863,7 @@ const deserializeAws_json1_1DeleteFileShareCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -2947,8 +2925,7 @@ const deserializeAws_json1_1DeleteGatewayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3010,8 +2987,7 @@ const deserializeAws_json1_1DeleteSnapshotScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3073,8 +3049,7 @@ const deserializeAws_json1_1DeleteTapeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3136,8 +3111,7 @@ const deserializeAws_json1_1DeleteTapeArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3199,8 +3173,7 @@ const deserializeAws_json1_1DeleteTapePoolCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3262,8 +3235,7 @@ const deserializeAws_json1_1DeleteVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3325,8 +3297,7 @@ const deserializeAws_json1_1DescribeAvailabilityMonitorTestCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3388,8 +3359,7 @@ const deserializeAws_json1_1DescribeBandwidthRateLimitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3451,8 +3421,7 @@ const deserializeAws_json1_1DescribeBandwidthRateLimitScheduleCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3514,8 +3483,7 @@ const deserializeAws_json1_1DescribeCacheCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3577,8 +3545,7 @@ const deserializeAws_json1_1DescribeCachediSCSIVolumesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3640,8 +3607,7 @@ const deserializeAws_json1_1DescribeChapCredentialsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3703,8 +3669,7 @@ const deserializeAws_json1_1DescribeGatewayInformationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3766,8 +3731,7 @@ const deserializeAws_json1_1DescribeMaintenanceStartTimeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3829,8 +3793,7 @@ const deserializeAws_json1_1DescribeNFSFileSharesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3892,8 +3855,7 @@ const deserializeAws_json1_1DescribeSMBFileSharesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -3955,8 +3917,7 @@ const deserializeAws_json1_1DescribeSMBSettingsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4018,8 +3979,7 @@ const deserializeAws_json1_1DescribeSnapshotScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4081,8 +4041,7 @@ const deserializeAws_json1_1DescribeStorediSCSIVolumesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4144,8 +4103,7 @@ const deserializeAws_json1_1DescribeTapeArchivesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4207,8 +4165,7 @@ const deserializeAws_json1_1DescribeTapeRecoveryPointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4270,8 +4227,7 @@ const deserializeAws_json1_1DescribeTapesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4333,8 +4289,7 @@ const deserializeAws_json1_1DescribeUploadBufferCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4396,8 +4351,7 @@ const deserializeAws_json1_1DescribeVTLDevicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4459,8 +4413,7 @@ const deserializeAws_json1_1DescribeWorkingStorageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4522,8 +4475,7 @@ const deserializeAws_json1_1DetachVolumeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4585,8 +4537,7 @@ const deserializeAws_json1_1DisableGatewayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4648,8 +4599,7 @@ const deserializeAws_json1_1JoinDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4711,8 +4661,7 @@ const deserializeAws_json1_1ListAutomaticTapeCreationPoliciesCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4774,8 +4723,7 @@ const deserializeAws_json1_1ListFileSharesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4837,8 +4785,7 @@ const deserializeAws_json1_1ListGatewaysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4900,8 +4847,7 @@ const deserializeAws_json1_1ListLocalDisksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -4963,8 +4909,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5026,8 +4971,7 @@ const deserializeAws_json1_1ListTapePoolsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5089,8 +5033,7 @@ const deserializeAws_json1_1ListTapesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5152,8 +5095,7 @@ const deserializeAws_json1_1ListVolumeInitiatorsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5215,8 +5157,7 @@ const deserializeAws_json1_1ListVolumeRecoveryPointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5278,8 +5219,7 @@ const deserializeAws_json1_1ListVolumesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5341,8 +5281,7 @@ const deserializeAws_json1_1NotifyWhenUploadedCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5404,8 +5343,7 @@ const deserializeAws_json1_1RefreshCacheCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5467,8 +5405,7 @@ const deserializeAws_json1_1RemoveTagsFromResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5530,8 +5467,7 @@ const deserializeAws_json1_1ResetCacheCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5593,8 +5529,7 @@ const deserializeAws_json1_1RetrieveTapeArchiveCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5656,8 +5591,7 @@ const deserializeAws_json1_1RetrieveTapeRecoveryPointCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5719,8 +5653,7 @@ const deserializeAws_json1_1SetLocalConsolePasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5782,8 +5715,7 @@ const deserializeAws_json1_1SetSMBGuestPasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5845,8 +5777,7 @@ const deserializeAws_json1_1ShutdownGatewayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5908,8 +5839,7 @@ const deserializeAws_json1_1StartAvailabilityMonitorTestCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -5971,8 +5901,7 @@ const deserializeAws_json1_1StartGatewayCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6034,8 +5963,7 @@ const deserializeAws_json1_1UpdateAutomaticTapeCreationPolicyCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6097,8 +6025,7 @@ const deserializeAws_json1_1UpdateBandwidthRateLimitCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6160,8 +6087,7 @@ const deserializeAws_json1_1UpdateBandwidthRateLimitScheduleCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6223,8 +6149,7 @@ const deserializeAws_json1_1UpdateChapCredentialsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6286,8 +6211,7 @@ const deserializeAws_json1_1UpdateGatewayInformationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6349,8 +6273,7 @@ const deserializeAws_json1_1UpdateGatewaySoftwareNowCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6412,8 +6335,7 @@ const deserializeAws_json1_1UpdateMaintenanceStartTimeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6475,8 +6397,7 @@ const deserializeAws_json1_1UpdateNFSFileShareCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6538,8 +6459,7 @@ const deserializeAws_json1_1UpdateSMBFileShareCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6601,8 +6521,7 @@ const deserializeAws_json1_1UpdateSMBFileShareVisibilityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6664,8 +6583,7 @@ const deserializeAws_json1_1UpdateSMBSecurityStrategyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6727,8 +6645,7 @@ const deserializeAws_json1_1UpdateSnapshotScheduleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6790,8 +6707,7 @@ const deserializeAws_json1_1UpdateVTLDeviceTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.storagegateway#InternalServerError": @@ -6873,62 +6789,67 @@ const deserializeAws_json1_1ServiceUnavailableErrorResponse = async ( const serializeAws_json1_1ActivateGatewayInput = (input: ActivateGatewayInput, context: __SerdeContext): any => { return { - ...(input.ActivationKey !== undefined && { ActivationKey: input.ActivationKey }), - ...(input.GatewayName !== undefined && { GatewayName: input.GatewayName }), - ...(input.GatewayRegion !== undefined && { GatewayRegion: input.GatewayRegion }), - ...(input.GatewayTimezone !== undefined && { GatewayTimezone: input.GatewayTimezone }), - ...(input.GatewayType !== undefined && { GatewayType: input.GatewayType }), - ...(input.MediumChangerType !== undefined && { MediumChangerType: input.MediumChangerType }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.TapeDriveType !== undefined && { TapeDriveType: input.TapeDriveType }), + ...(input.ActivationKey !== undefined && input.ActivationKey !== null && { ActivationKey: input.ActivationKey }), + ...(input.GatewayName !== undefined && input.GatewayName !== null && { GatewayName: input.GatewayName }), + ...(input.GatewayRegion !== undefined && input.GatewayRegion !== null && { GatewayRegion: input.GatewayRegion }), + ...(input.GatewayTimezone !== undefined && + input.GatewayTimezone !== null && { GatewayTimezone: input.GatewayTimezone }), + ...(input.GatewayType !== undefined && input.GatewayType !== null && { GatewayType: input.GatewayType }), + ...(input.MediumChangerType !== undefined && + input.MediumChangerType !== null && { MediumChangerType: input.MediumChangerType }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.TapeDriveType !== undefined && input.TapeDriveType !== null && { TapeDriveType: input.TapeDriveType }), }; }; const serializeAws_json1_1AddCacheInput = (input: AddCacheInput, context: __SerdeContext): any => { return { - ...(input.DiskIds !== undefined && { DiskIds: serializeAws_json1_1DiskIds(input.DiskIds, context) }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.DiskIds !== undefined && + input.DiskIds !== null && { DiskIds: serializeAws_json1_1DiskIds(input.DiskIds, context) }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1AddTagsToResourceInput = (input: AddTagsToResourceInput, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1AddUploadBufferInput = (input: AddUploadBufferInput, context: __SerdeContext): any => { return { - ...(input.DiskIds !== undefined && { DiskIds: serializeAws_json1_1DiskIds(input.DiskIds, context) }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.DiskIds !== undefined && + input.DiskIds !== null && { DiskIds: serializeAws_json1_1DiskIds(input.DiskIds, context) }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1AddWorkingStorageInput = (input: AddWorkingStorageInput, context: __SerdeContext): any => { return { - ...(input.DiskIds !== undefined && { DiskIds: serializeAws_json1_1DiskIds(input.DiskIds, context) }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.DiskIds !== undefined && + input.DiskIds !== null && { DiskIds: serializeAws_json1_1DiskIds(input.DiskIds, context) }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1AssignTapePoolInput = (input: AssignTapePoolInput, context: __SerdeContext): any => { return { - ...(input.BypassGovernanceRetention !== undefined && { - BypassGovernanceRetention: input.BypassGovernanceRetention, - }), - ...(input.PoolId !== undefined && { PoolId: input.PoolId }), - ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }), + ...(input.BypassGovernanceRetention !== undefined && + input.BypassGovernanceRetention !== null && { BypassGovernanceRetention: input.BypassGovernanceRetention }), + ...(input.PoolId !== undefined && input.PoolId !== null && { PoolId: input.PoolId }), + ...(input.TapeARN !== undefined && input.TapeARN !== null && { TapeARN: input.TapeARN }), }; }; const serializeAws_json1_1AttachVolumeInput = (input: AttachVolumeInput, context: __SerdeContext): any => { return { - ...(input.DiskId !== undefined && { DiskId: input.DiskId }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.NetworkInterfaceId !== undefined && { NetworkInterfaceId: input.NetworkInterfaceId }), - ...(input.TargetName !== undefined && { TargetName: input.TargetName }), - ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }), + ...(input.DiskId !== undefined && input.DiskId !== null && { DiskId: input.DiskId }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.NetworkInterfaceId !== undefined && + input.NetworkInterfaceId !== null && { NetworkInterfaceId: input.NetworkInterfaceId }), + ...(input.TargetName !== undefined && input.TargetName !== null && { TargetName: input.TargetName }), + ...(input.VolumeARN !== undefined && input.VolumeARN !== null && { VolumeARN: input.VolumeARN }), }; }; @@ -6937,11 +6858,14 @@ const serializeAws_json1_1AutomaticTapeCreationRule = ( context: __SerdeContext ): any => { return { - ...(input.MinimumNumTapes !== undefined && { MinimumNumTapes: input.MinimumNumTapes }), - ...(input.PoolId !== undefined && { PoolId: input.PoolId }), - ...(input.TapeBarcodePrefix !== undefined && { TapeBarcodePrefix: input.TapeBarcodePrefix }), - ...(input.TapeSizeInBytes !== undefined && { TapeSizeInBytes: input.TapeSizeInBytes }), - ...(input.Worm !== undefined && { Worm: input.Worm }), + ...(input.MinimumNumTapes !== undefined && + input.MinimumNumTapes !== null && { MinimumNumTapes: input.MinimumNumTapes }), + ...(input.PoolId !== undefined && input.PoolId !== null && { PoolId: input.PoolId }), + ...(input.TapeBarcodePrefix !== undefined && + input.TapeBarcodePrefix !== null && { TapeBarcodePrefix: input.TapeBarcodePrefix }), + ...(input.TapeSizeInBytes !== undefined && + input.TapeSizeInBytes !== null && { TapeSizeInBytes: input.TapeSizeInBytes }), + ...(input.Worm !== undefined && input.Worm !== null && { Worm: input.Worm }), }; }; @@ -6949,7 +6873,14 @@ const serializeAws_json1_1AutomaticTapeCreationRules = ( input: AutomaticTapeCreationRule[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1AutomaticTapeCreationRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1AutomaticTapeCreationRule(entry, context); + }); }; const serializeAws_json1_1BandwidthRateLimitInterval = ( @@ -6957,17 +6888,23 @@ const serializeAws_json1_1BandwidthRateLimitInterval = ( context: __SerdeContext ): any => { return { - ...(input.AverageDownloadRateLimitInBitsPerSec !== undefined && { - AverageDownloadRateLimitInBitsPerSec: input.AverageDownloadRateLimitInBitsPerSec, - }), - ...(input.AverageUploadRateLimitInBitsPerSec !== undefined && { - AverageUploadRateLimitInBitsPerSec: input.AverageUploadRateLimitInBitsPerSec, - }), - ...(input.DaysOfWeek !== undefined && { DaysOfWeek: serializeAws_json1_1DaysOfWeek(input.DaysOfWeek, context) }), - ...(input.EndHourOfDay !== undefined && { EndHourOfDay: input.EndHourOfDay }), - ...(input.EndMinuteOfHour !== undefined && { EndMinuteOfHour: input.EndMinuteOfHour }), - ...(input.StartHourOfDay !== undefined && { StartHourOfDay: input.StartHourOfDay }), - ...(input.StartMinuteOfHour !== undefined && { StartMinuteOfHour: input.StartMinuteOfHour }), + ...(input.AverageDownloadRateLimitInBitsPerSec !== undefined && + input.AverageDownloadRateLimitInBitsPerSec !== null && { + AverageDownloadRateLimitInBitsPerSec: input.AverageDownloadRateLimitInBitsPerSec, + }), + ...(input.AverageUploadRateLimitInBitsPerSec !== undefined && + input.AverageUploadRateLimitInBitsPerSec !== null && { + AverageUploadRateLimitInBitsPerSec: input.AverageUploadRateLimitInBitsPerSec, + }), + ...(input.DaysOfWeek !== undefined && + input.DaysOfWeek !== null && { DaysOfWeek: serializeAws_json1_1DaysOfWeek(input.DaysOfWeek, context) }), + ...(input.EndHourOfDay !== undefined && input.EndHourOfDay !== null && { EndHourOfDay: input.EndHourOfDay }), + ...(input.EndMinuteOfHour !== undefined && + input.EndMinuteOfHour !== null && { EndMinuteOfHour: input.EndMinuteOfHour }), + ...(input.StartHourOfDay !== undefined && + input.StartHourOfDay !== null && { StartHourOfDay: input.StartHourOfDay }), + ...(input.StartMinuteOfHour !== undefined && + input.StartMinuteOfHour !== null && { StartMinuteOfHour: input.StartMinuteOfHour }), }; }; @@ -6975,28 +6912,34 @@ const serializeAws_json1_1BandwidthRateLimitIntervals = ( input: BandwidthRateLimitInterval[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1BandwidthRateLimitInterval(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1BandwidthRateLimitInterval(entry, context); + }); }; const serializeAws_json1_1CacheAttributes = (input: CacheAttributes, context: __SerdeContext): any => { return { - ...(input.CacheStaleTimeoutInSeconds !== undefined && { - CacheStaleTimeoutInSeconds: input.CacheStaleTimeoutInSeconds, - }), + ...(input.CacheStaleTimeoutInSeconds !== undefined && + input.CacheStaleTimeoutInSeconds !== null && { CacheStaleTimeoutInSeconds: input.CacheStaleTimeoutInSeconds }), }; }; const serializeAws_json1_1CancelArchivalInput = (input: CancelArchivalInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && input.TapeARN !== null && { TapeARN: input.TapeARN }), }; }; const serializeAws_json1_1CancelRetrievalInput = (input: CancelRetrievalInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && input.TapeARN !== null && { TapeARN: input.TapeARN }), }; }; @@ -7005,81 +6948,99 @@ const serializeAws_json1_1CreateCachediSCSIVolumeInput = ( context: __SerdeContext ): any => { return { - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.KMSEncrypted !== undefined && { KMSEncrypted: input.KMSEncrypted }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.NetworkInterfaceId !== undefined && { NetworkInterfaceId: input.NetworkInterfaceId }), - ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }), - ...(input.SourceVolumeARN !== undefined && { SourceVolumeARN: input.SourceVolumeARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.TargetName !== undefined && { TargetName: input.TargetName }), - ...(input.VolumeSizeInBytes !== undefined && { VolumeSizeInBytes: input.VolumeSizeInBytes }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.KMSEncrypted !== undefined && input.KMSEncrypted !== null && { KMSEncrypted: input.KMSEncrypted }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.NetworkInterfaceId !== undefined && + input.NetworkInterfaceId !== null && { NetworkInterfaceId: input.NetworkInterfaceId }), + ...(input.SnapshotId !== undefined && input.SnapshotId !== null && { SnapshotId: input.SnapshotId }), + ...(input.SourceVolumeARN !== undefined && + input.SourceVolumeARN !== null && { SourceVolumeARN: input.SourceVolumeARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.TargetName !== undefined && input.TargetName !== null && { TargetName: input.TargetName }), + ...(input.VolumeSizeInBytes !== undefined && + input.VolumeSizeInBytes !== null && { VolumeSizeInBytes: input.VolumeSizeInBytes }), }; }; const serializeAws_json1_1CreateNFSFileShareInput = (input: CreateNFSFileShareInput, context: __SerdeContext): any => { return { - ...(input.CacheAttributes !== undefined && { - CacheAttributes: serializeAws_json1_1CacheAttributes(input.CacheAttributes, context), - }), - ...(input.ClientList !== undefined && { - ClientList: serializeAws_json1_1FileShareClientList(input.ClientList, context), - }), - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.DefaultStorageClass !== undefined && { DefaultStorageClass: input.DefaultStorageClass }), - ...(input.FileShareName !== undefined && { FileShareName: input.FileShareName }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.GuessMIMETypeEnabled !== undefined && { GuessMIMETypeEnabled: input.GuessMIMETypeEnabled }), - ...(input.KMSEncrypted !== undefined && { KMSEncrypted: input.KMSEncrypted }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.LocationARN !== undefined && { LocationARN: input.LocationARN }), - ...(input.NFSFileShareDefaults !== undefined && { - NFSFileShareDefaults: serializeAws_json1_1NFSFileShareDefaults(input.NFSFileShareDefaults, context), - }), - ...(input.NotificationPolicy !== undefined && { NotificationPolicy: input.NotificationPolicy }), - ...(input.ObjectACL !== undefined && { ObjectACL: input.ObjectACL }), - ...(input.ReadOnly !== undefined && { ReadOnly: input.ReadOnly }), - ...(input.RequesterPays !== undefined && { RequesterPays: input.RequesterPays }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Squash !== undefined && { Squash: input.Squash }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.CacheAttributes !== undefined && + input.CacheAttributes !== null && { + CacheAttributes: serializeAws_json1_1CacheAttributes(input.CacheAttributes, context), + }), + ...(input.ClientList !== undefined && + input.ClientList !== null && { ClientList: serializeAws_json1_1FileShareClientList(input.ClientList, context) }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.DefaultStorageClass !== undefined && + input.DefaultStorageClass !== null && { DefaultStorageClass: input.DefaultStorageClass }), + ...(input.FileShareName !== undefined && input.FileShareName !== null && { FileShareName: input.FileShareName }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.GuessMIMETypeEnabled !== undefined && + input.GuessMIMETypeEnabled !== null && { GuessMIMETypeEnabled: input.GuessMIMETypeEnabled }), + ...(input.KMSEncrypted !== undefined && input.KMSEncrypted !== null && { KMSEncrypted: input.KMSEncrypted }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.LocationARN !== undefined && input.LocationARN !== null && { LocationARN: input.LocationARN }), + ...(input.NFSFileShareDefaults !== undefined && + input.NFSFileShareDefaults !== null && { + NFSFileShareDefaults: serializeAws_json1_1NFSFileShareDefaults(input.NFSFileShareDefaults, context), + }), + ...(input.NotificationPolicy !== undefined && + input.NotificationPolicy !== null && { NotificationPolicy: input.NotificationPolicy }), + ...(input.ObjectACL !== undefined && input.ObjectACL !== null && { ObjectACL: input.ObjectACL }), + ...(input.ReadOnly !== undefined && input.ReadOnly !== null && { ReadOnly: input.ReadOnly }), + ...(input.RequesterPays !== undefined && input.RequesterPays !== null && { RequesterPays: input.RequesterPays }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Squash !== undefined && input.Squash !== null && { Squash: input.Squash }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1CreateSMBFileShareInput = (input: CreateSMBFileShareInput, context: __SerdeContext): any => { return { - ...(input.AccessBasedEnumeration !== undefined && { AccessBasedEnumeration: input.AccessBasedEnumeration }), - ...(input.AdminUserList !== undefined && { - AdminUserList: serializeAws_json1_1FileShareUserList(input.AdminUserList, context), - }), - ...(input.AuditDestinationARN !== undefined && { AuditDestinationARN: input.AuditDestinationARN }), - ...(input.Authentication !== undefined && { Authentication: input.Authentication }), - ...(input.CacheAttributes !== undefined && { - CacheAttributes: serializeAws_json1_1CacheAttributes(input.CacheAttributes, context), - }), - ...(input.CaseSensitivity !== undefined && { CaseSensitivity: input.CaseSensitivity }), - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.DefaultStorageClass !== undefined && { DefaultStorageClass: input.DefaultStorageClass }), - ...(input.FileShareName !== undefined && { FileShareName: input.FileShareName }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.GuessMIMETypeEnabled !== undefined && { GuessMIMETypeEnabled: input.GuessMIMETypeEnabled }), - ...(input.InvalidUserList !== undefined && { - InvalidUserList: serializeAws_json1_1FileShareUserList(input.InvalidUserList, context), - }), - ...(input.KMSEncrypted !== undefined && { KMSEncrypted: input.KMSEncrypted }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.LocationARN !== undefined && { LocationARN: input.LocationARN }), - ...(input.NotificationPolicy !== undefined && { NotificationPolicy: input.NotificationPolicy }), - ...(input.ObjectACL !== undefined && { ObjectACL: input.ObjectACL }), - ...(input.ReadOnly !== undefined && { ReadOnly: input.ReadOnly }), - ...(input.RequesterPays !== undefined && { RequesterPays: input.RequesterPays }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.SMBACLEnabled !== undefined && { SMBACLEnabled: input.SMBACLEnabled }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.ValidUserList !== undefined && { - ValidUserList: serializeAws_json1_1FileShareUserList(input.ValidUserList, context), - }), + ...(input.AccessBasedEnumeration !== undefined && + input.AccessBasedEnumeration !== null && { AccessBasedEnumeration: input.AccessBasedEnumeration }), + ...(input.AdminUserList !== undefined && + input.AdminUserList !== null && { + AdminUserList: serializeAws_json1_1FileShareUserList(input.AdminUserList, context), + }), + ...(input.AuditDestinationARN !== undefined && + input.AuditDestinationARN !== null && { AuditDestinationARN: input.AuditDestinationARN }), + ...(input.Authentication !== undefined && + input.Authentication !== null && { Authentication: input.Authentication }), + ...(input.CacheAttributes !== undefined && + input.CacheAttributes !== null && { + CacheAttributes: serializeAws_json1_1CacheAttributes(input.CacheAttributes, context), + }), + ...(input.CaseSensitivity !== undefined && + input.CaseSensitivity !== null && { CaseSensitivity: input.CaseSensitivity }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.DefaultStorageClass !== undefined && + input.DefaultStorageClass !== null && { DefaultStorageClass: input.DefaultStorageClass }), + ...(input.FileShareName !== undefined && input.FileShareName !== null && { FileShareName: input.FileShareName }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.GuessMIMETypeEnabled !== undefined && + input.GuessMIMETypeEnabled !== null && { GuessMIMETypeEnabled: input.GuessMIMETypeEnabled }), + ...(input.InvalidUserList !== undefined && + input.InvalidUserList !== null && { + InvalidUserList: serializeAws_json1_1FileShareUserList(input.InvalidUserList, context), + }), + ...(input.KMSEncrypted !== undefined && input.KMSEncrypted !== null && { KMSEncrypted: input.KMSEncrypted }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.LocationARN !== undefined && input.LocationARN !== null && { LocationARN: input.LocationARN }), + ...(input.NotificationPolicy !== undefined && + input.NotificationPolicy !== null && { NotificationPolicy: input.NotificationPolicy }), + ...(input.ObjectACL !== undefined && input.ObjectACL !== null && { ObjectACL: input.ObjectACL }), + ...(input.ReadOnly !== undefined && input.ReadOnly !== null && { ReadOnly: input.ReadOnly }), + ...(input.RequesterPays !== undefined && input.RequesterPays !== null && { RequesterPays: input.RequesterPays }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.SMBACLEnabled !== undefined && input.SMBACLEnabled !== null && { SMBACLEnabled: input.SMBACLEnabled }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.ValidUserList !== undefined && + input.ValidUserList !== null && { + ValidUserList: serializeAws_json1_1FileShareUserList(input.ValidUserList, context), + }), }; }; @@ -7088,17 +7049,19 @@ const serializeAws_json1_1CreateSnapshotFromVolumeRecoveryPointInput = ( context: __SerdeContext ): any => { return { - ...(input.SnapshotDescription !== undefined && { SnapshotDescription: input.SnapshotDescription }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }), + ...(input.SnapshotDescription !== undefined && + input.SnapshotDescription !== null && { SnapshotDescription: input.SnapshotDescription }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.VolumeARN !== undefined && input.VolumeARN !== null && { VolumeARN: input.VolumeARN }), }; }; const serializeAws_json1_1CreateSnapshotInput = (input: CreateSnapshotInput, context: __SerdeContext): any => { return { - ...(input.SnapshotDescription !== undefined && { SnapshotDescription: input.SnapshotDescription }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }), + ...(input.SnapshotDescription !== undefined && + input.SnapshotDescription !== null && { SnapshotDescription: input.SnapshotDescription }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.VolumeARN !== undefined && input.VolumeARN !== null && { VolumeARN: input.VolumeARN }), }; }; @@ -7107,40 +7070,47 @@ const serializeAws_json1_1CreateStorediSCSIVolumeInput = ( context: __SerdeContext ): any => { return { - ...(input.DiskId !== undefined && { DiskId: input.DiskId }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.KMSEncrypted !== undefined && { KMSEncrypted: input.KMSEncrypted }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.NetworkInterfaceId !== undefined && { NetworkInterfaceId: input.NetworkInterfaceId }), - ...(input.PreserveExistingData !== undefined && { PreserveExistingData: input.PreserveExistingData }), - ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.TargetName !== undefined && { TargetName: input.TargetName }), + ...(input.DiskId !== undefined && input.DiskId !== null && { DiskId: input.DiskId }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.KMSEncrypted !== undefined && input.KMSEncrypted !== null && { KMSEncrypted: input.KMSEncrypted }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.NetworkInterfaceId !== undefined && + input.NetworkInterfaceId !== null && { NetworkInterfaceId: input.NetworkInterfaceId }), + ...(input.PreserveExistingData !== undefined && + input.PreserveExistingData !== null && { PreserveExistingData: input.PreserveExistingData }), + ...(input.SnapshotId !== undefined && input.SnapshotId !== null && { SnapshotId: input.SnapshotId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.TargetName !== undefined && input.TargetName !== null && { TargetName: input.TargetName }), }; }; const serializeAws_json1_1CreateTapePoolInput = (input: CreateTapePoolInput, context: __SerdeContext): any => { return { - ...(input.PoolName !== undefined && { PoolName: input.PoolName }), - ...(input.RetentionLockTimeInDays !== undefined && { RetentionLockTimeInDays: input.RetentionLockTimeInDays }), - ...(input.RetentionLockType !== undefined && { RetentionLockType: input.RetentionLockType }), - ...(input.StorageClass !== undefined && { StorageClass: input.StorageClass }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.PoolName !== undefined && input.PoolName !== null && { PoolName: input.PoolName }), + ...(input.RetentionLockTimeInDays !== undefined && + input.RetentionLockTimeInDays !== null && { RetentionLockTimeInDays: input.RetentionLockTimeInDays }), + ...(input.RetentionLockType !== undefined && + input.RetentionLockType !== null && { RetentionLockType: input.RetentionLockType }), + ...(input.StorageClass !== undefined && input.StorageClass !== null && { StorageClass: input.StorageClass }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1CreateTapesInput = (input: CreateTapesInput, context: __SerdeContext): any => { return { - ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.KMSEncrypted !== undefined && { KMSEncrypted: input.KMSEncrypted }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.NumTapesToCreate !== undefined && { NumTapesToCreate: input.NumTapesToCreate }), - ...(input.PoolId !== undefined && { PoolId: input.PoolId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.TapeBarcodePrefix !== undefined && { TapeBarcodePrefix: input.TapeBarcodePrefix }), - ...(input.TapeSizeInBytes !== undefined && { TapeSizeInBytes: input.TapeSizeInBytes }), - ...(input.Worm !== undefined && { Worm: input.Worm }), + ...(input.ClientToken !== undefined && input.ClientToken !== null && { ClientToken: input.ClientToken }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.KMSEncrypted !== undefined && input.KMSEncrypted !== null && { KMSEncrypted: input.KMSEncrypted }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.NumTapesToCreate !== undefined && + input.NumTapesToCreate !== null && { NumTapesToCreate: input.NumTapesToCreate }), + ...(input.PoolId !== undefined && input.PoolId !== null && { PoolId: input.PoolId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.TapeBarcodePrefix !== undefined && + input.TapeBarcodePrefix !== null && { TapeBarcodePrefix: input.TapeBarcodePrefix }), + ...(input.TapeSizeInBytes !== undefined && + input.TapeSizeInBytes !== null && { TapeSizeInBytes: input.TapeSizeInBytes }), + ...(input.Worm !== undefined && input.Worm !== null && { Worm: input.Worm }), }; }; @@ -7149,19 +7119,27 @@ const serializeAws_json1_1CreateTapeWithBarcodeInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.KMSEncrypted !== undefined && { KMSEncrypted: input.KMSEncrypted }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.PoolId !== undefined && { PoolId: input.PoolId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.TapeBarcode !== undefined && { TapeBarcode: input.TapeBarcode }), - ...(input.TapeSizeInBytes !== undefined && { TapeSizeInBytes: input.TapeSizeInBytes }), - ...(input.Worm !== undefined && { Worm: input.Worm }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.KMSEncrypted !== undefined && input.KMSEncrypted !== null && { KMSEncrypted: input.KMSEncrypted }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.PoolId !== undefined && input.PoolId !== null && { PoolId: input.PoolId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.TapeBarcode !== undefined && input.TapeBarcode !== null && { TapeBarcode: input.TapeBarcode }), + ...(input.TapeSizeInBytes !== undefined && + input.TapeSizeInBytes !== null && { TapeSizeInBytes: input.TapeSizeInBytes }), + ...(input.Worm !== undefined && input.Worm !== null && { Worm: input.Worm }), }; }; const serializeAws_json1_1DaysOfWeek = (input: number[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DeleteAutomaticTapeCreationPolicyInput = ( @@ -7169,7 +7147,7 @@ const serializeAws_json1_1DeleteAutomaticTapeCreationPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7178,8 +7156,8 @@ const serializeAws_json1_1DeleteBandwidthRateLimitInput = ( context: __SerdeContext ): any => { return { - ...(input.BandwidthType !== undefined && { BandwidthType: input.BandwidthType }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.BandwidthType !== undefined && input.BandwidthType !== null && { BandwidthType: input.BandwidthType }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7188,21 +7166,21 @@ const serializeAws_json1_1DeleteChapCredentialsInput = ( context: __SerdeContext ): any => { return { - ...(input.InitiatorName !== undefined && { InitiatorName: input.InitiatorName }), - ...(input.TargetARN !== undefined && { TargetARN: input.TargetARN }), + ...(input.InitiatorName !== undefined && input.InitiatorName !== null && { InitiatorName: input.InitiatorName }), + ...(input.TargetARN !== undefined && input.TargetARN !== null && { TargetARN: input.TargetARN }), }; }; const serializeAws_json1_1DeleteFileShareInput = (input: DeleteFileShareInput, context: __SerdeContext): any => { return { - ...(input.FileShareARN !== undefined && { FileShareARN: input.FileShareARN }), - ...(input.ForceDelete !== undefined && { ForceDelete: input.ForceDelete }), + ...(input.FileShareARN !== undefined && input.FileShareARN !== null && { FileShareARN: input.FileShareARN }), + ...(input.ForceDelete !== undefined && input.ForceDelete !== null && { ForceDelete: input.ForceDelete }), }; }; const serializeAws_json1_1DeleteGatewayInput = (input: DeleteGatewayInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7211,38 +7189,36 @@ const serializeAws_json1_1DeleteSnapshotScheduleInput = ( context: __SerdeContext ): any => { return { - ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }), + ...(input.VolumeARN !== undefined && input.VolumeARN !== null && { VolumeARN: input.VolumeARN }), }; }; const serializeAws_json1_1DeleteTapeArchiveInput = (input: DeleteTapeArchiveInput, context: __SerdeContext): any => { return { - ...(input.BypassGovernanceRetention !== undefined && { - BypassGovernanceRetention: input.BypassGovernanceRetention, - }), - ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }), + ...(input.BypassGovernanceRetention !== undefined && + input.BypassGovernanceRetention !== null && { BypassGovernanceRetention: input.BypassGovernanceRetention }), + ...(input.TapeARN !== undefined && input.TapeARN !== null && { TapeARN: input.TapeARN }), }; }; const serializeAws_json1_1DeleteTapeInput = (input: DeleteTapeInput, context: __SerdeContext): any => { return { - ...(input.BypassGovernanceRetention !== undefined && { - BypassGovernanceRetention: input.BypassGovernanceRetention, - }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }), + ...(input.BypassGovernanceRetention !== undefined && + input.BypassGovernanceRetention !== null && { BypassGovernanceRetention: input.BypassGovernanceRetention }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && input.TapeARN !== null && { TapeARN: input.TapeARN }), }; }; const serializeAws_json1_1DeleteTapePoolInput = (input: DeleteTapePoolInput, context: __SerdeContext): any => { return { - ...(input.PoolARN !== undefined && { PoolARN: input.PoolARN }), + ...(input.PoolARN !== undefined && input.PoolARN !== null && { PoolARN: input.PoolARN }), }; }; const serializeAws_json1_1DeleteVolumeInput = (input: DeleteVolumeInput, context: __SerdeContext): any => { return { - ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }), + ...(input.VolumeARN !== undefined && input.VolumeARN !== null && { VolumeARN: input.VolumeARN }), }; }; @@ -7251,7 +7227,7 @@ const serializeAws_json1_1DescribeAvailabilityMonitorTestInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7260,7 +7236,7 @@ const serializeAws_json1_1DescribeBandwidthRateLimitInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7269,7 +7245,7 @@ const serializeAws_json1_1DescribeBandwidthRateLimitScheduleInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7278,13 +7254,14 @@ const serializeAws_json1_1DescribeCachediSCSIVolumesInput = ( context: __SerdeContext ): any => { return { - ...(input.VolumeARNs !== undefined && { VolumeARNs: serializeAws_json1_1VolumeARNs(input.VolumeARNs, context) }), + ...(input.VolumeARNs !== undefined && + input.VolumeARNs !== null && { VolumeARNs: serializeAws_json1_1VolumeARNs(input.VolumeARNs, context) }), }; }; const serializeAws_json1_1DescribeCacheInput = (input: DescribeCacheInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7293,7 +7270,7 @@ const serializeAws_json1_1DescribeChapCredentialsInput = ( context: __SerdeContext ): any => { return { - ...(input.TargetARN !== undefined && { TargetARN: input.TargetARN }), + ...(input.TargetARN !== undefined && input.TargetARN !== null && { TargetARN: input.TargetARN }), }; }; @@ -7302,7 +7279,7 @@ const serializeAws_json1_1DescribeGatewayInformationInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7311,7 +7288,7 @@ const serializeAws_json1_1DescribeMaintenanceStartTimeInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7320,9 +7297,10 @@ const serializeAws_json1_1DescribeNFSFileSharesInput = ( context: __SerdeContext ): any => { return { - ...(input.FileShareARNList !== undefined && { - FileShareARNList: serializeAws_json1_1FileShareARNList(input.FileShareARNList, context), - }), + ...(input.FileShareARNList !== undefined && + input.FileShareARNList !== null && { + FileShareARNList: serializeAws_json1_1FileShareARNList(input.FileShareARNList, context), + }), }; }; @@ -7331,9 +7309,10 @@ const serializeAws_json1_1DescribeSMBFileSharesInput = ( context: __SerdeContext ): any => { return { - ...(input.FileShareARNList !== undefined && { - FileShareARNList: serializeAws_json1_1FileShareARNList(input.FileShareARNList, context), - }), + ...(input.FileShareARNList !== undefined && + input.FileShareARNList !== null && { + FileShareARNList: serializeAws_json1_1FileShareARNList(input.FileShareARNList, context), + }), }; }; @@ -7342,7 +7321,7 @@ const serializeAws_json1_1DescribeSMBSettingsInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7351,7 +7330,7 @@ const serializeAws_json1_1DescribeSnapshotScheduleInput = ( context: __SerdeContext ): any => { return { - ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }), + ...(input.VolumeARN !== undefined && input.VolumeARN !== null && { VolumeARN: input.VolumeARN }), }; }; @@ -7360,7 +7339,8 @@ const serializeAws_json1_1DescribeStorediSCSIVolumesInput = ( context: __SerdeContext ): any => { return { - ...(input.VolumeARNs !== undefined && { VolumeARNs: serializeAws_json1_1VolumeARNs(input.VolumeARNs, context) }), + ...(input.VolumeARNs !== undefined && + input.VolumeARNs !== null && { VolumeARNs: serializeAws_json1_1VolumeARNs(input.VolumeARNs, context) }), }; }; @@ -7369,9 +7349,10 @@ const serializeAws_json1_1DescribeTapeArchivesInput = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.TapeARNs !== undefined && { TapeARNs: serializeAws_json1_1TapeARNs(input.TapeARNs, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.TapeARNs !== undefined && + input.TapeARNs !== null && { TapeARNs: serializeAws_json1_1TapeARNs(input.TapeARNs, context) }), }; }; @@ -7380,18 +7361,19 @@ const serializeAws_json1_1DescribeTapeRecoveryPointsInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1DescribeTapesInput = (input: DescribeTapesInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.TapeARNs !== undefined && { TapeARNs: serializeAws_json1_1TapeARNs(input.TapeARNs, context) }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.TapeARNs !== undefined && + input.TapeARNs !== null && { TapeARNs: serializeAws_json1_1TapeARNs(input.TapeARNs, context) }), }; }; @@ -7400,18 +7382,19 @@ const serializeAws_json1_1DescribeUploadBufferInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1DescribeVTLDevicesInput = (input: DescribeVTLDevicesInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.VTLDeviceARNs !== undefined && { - VTLDeviceARNs: serializeAws_json1_1VTLDeviceARNs(input.VTLDeviceARNs, context), - }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.VTLDeviceARNs !== undefined && + input.VTLDeviceARNs !== null && { + VTLDeviceARNs: serializeAws_json1_1VTLDeviceARNs(input.VTLDeviceARNs, context), + }), }; }; @@ -7420,58 +7403,103 @@ const serializeAws_json1_1DescribeWorkingStorageInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1DetachVolumeInput = (input: DetachVolumeInput, context: __SerdeContext): any => { return { - ...(input.ForceDetach !== undefined && { ForceDetach: input.ForceDetach }), - ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }), + ...(input.ForceDetach !== undefined && input.ForceDetach !== null && { ForceDetach: input.ForceDetach }), + ...(input.VolumeARN !== undefined && input.VolumeARN !== null && { VolumeARN: input.VolumeARN }), }; }; const serializeAws_json1_1DisableGatewayInput = (input: DisableGatewayInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1DiskIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FileShareARNList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FileShareClientList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FileShareUserList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1FolderList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Hosts = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1JoinDomainInput = (input: JoinDomainInput, context: __SerdeContext): any => { return { - ...(input.DomainControllers !== undefined && { - DomainControllers: serializeAws_json1_1Hosts(input.DomainControllers, context), - }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.OrganizationalUnit !== undefined && { OrganizationalUnit: input.OrganizationalUnit }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.TimeoutInSeconds !== undefined && { TimeoutInSeconds: input.TimeoutInSeconds }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.DomainControllers !== undefined && + input.DomainControllers !== null && { + DomainControllers: serializeAws_json1_1Hosts(input.DomainControllers, context), + }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.OrganizationalUnit !== undefined && + input.OrganizationalUnit !== null && { OrganizationalUnit: input.OrganizationalUnit }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.TimeoutInSeconds !== undefined && + input.TimeoutInSeconds !== null && { TimeoutInSeconds: input.TimeoutInSeconds }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -7480,28 +7508,28 @@ const serializeAws_json1_1ListAutomaticTapeCreationPoliciesInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1ListFileSharesInput = (input: ListFileSharesInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListGatewaysInput = (input: ListGatewaysInput, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1ListLocalDisksInput = (input: ListLocalDisksInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7510,25 +7538,27 @@ const serializeAws_json1_1ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1ListTapePoolsInput = (input: ListTapePoolsInput, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.PoolARNs !== undefined && { PoolARNs: serializeAws_json1_1PoolARNs(input.PoolARNs, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.PoolARNs !== undefined && + input.PoolARNs !== null && { PoolARNs: serializeAws_json1_1PoolARNs(input.PoolARNs, context) }), }; }; const serializeAws_json1_1ListTapesInput = (input: ListTapesInput, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), - ...(input.TapeARNs !== undefined && { TapeARNs: serializeAws_json1_1TapeARNs(input.TapeARNs, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), + ...(input.TapeARNs !== undefined && + input.TapeARNs !== null && { TapeARNs: serializeAws_json1_1TapeARNs(input.TapeARNs, context) }), }; }; @@ -7537,7 +7567,7 @@ const serializeAws_json1_1ListVolumeInitiatorsInput = ( context: __SerdeContext ): any => { return { - ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }), + ...(input.VolumeARN !== undefined && input.VolumeARN !== null && { VolumeARN: input.VolumeARN }), }; }; @@ -7546,42 +7576,50 @@ const serializeAws_json1_1ListVolumeRecoveryPointsInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1ListVolumesInput = (input: ListVolumesInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.Marker !== undefined && input.Marker !== null && { Marker: input.Marker }), }; }; const serializeAws_json1_1NFSFileShareDefaults = (input: NFSFileShareDefaults, context: __SerdeContext): any => { return { - ...(input.DirectoryMode !== undefined && { DirectoryMode: input.DirectoryMode }), - ...(input.FileMode !== undefined && { FileMode: input.FileMode }), - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.OwnerId !== undefined && { OwnerId: input.OwnerId }), + ...(input.DirectoryMode !== undefined && input.DirectoryMode !== null && { DirectoryMode: input.DirectoryMode }), + ...(input.FileMode !== undefined && input.FileMode !== null && { FileMode: input.FileMode }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.OwnerId !== undefined && input.OwnerId !== null && { OwnerId: input.OwnerId }), }; }; const serializeAws_json1_1NotifyWhenUploadedInput = (input: NotifyWhenUploadedInput, context: __SerdeContext): any => { return { - ...(input.FileShareARN !== undefined && { FileShareARN: input.FileShareARN }), + ...(input.FileShareARN !== undefined && input.FileShareARN !== null && { FileShareARN: input.FileShareARN }), }; }; const serializeAws_json1_1PoolARNs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RefreshCacheInput = (input: RefreshCacheInput, context: __SerdeContext): any => { return { - ...(input.FileShareARN !== undefined && { FileShareARN: input.FileShareARN }), - ...(input.FolderList !== undefined && { FolderList: serializeAws_json1_1FolderList(input.FolderList, context) }), - ...(input.Recursive !== undefined && { Recursive: input.Recursive }), + ...(input.FileShareARN !== undefined && input.FileShareARN !== null && { FileShareARN: input.FileShareARN }), + ...(input.FolderList !== undefined && + input.FolderList !== null && { FolderList: serializeAws_json1_1FolderList(input.FolderList, context) }), + ...(input.Recursive !== undefined && input.Recursive !== null && { Recursive: input.Recursive }), }; }; @@ -7590,14 +7628,15 @@ const serializeAws_json1_1RemoveTagsFromResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; const serializeAws_json1_1ResetCacheInput = (input: ResetCacheInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7606,8 +7645,8 @@ const serializeAws_json1_1RetrieveTapeArchiveInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && input.TapeARN !== null && { TapeARN: input.TapeARN }), }; }; @@ -7616,8 +7655,8 @@ const serializeAws_json1_1RetrieveTapeRecoveryPointInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && input.TapeARN !== null && { TapeARN: input.TapeARN }), }; }; @@ -7626,8 +7665,9 @@ const serializeAws_json1_1SetLocalConsolePasswordInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.LocalConsolePassword !== undefined && { LocalConsolePassword: input.LocalConsolePassword }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.LocalConsolePassword !== undefined && + input.LocalConsolePassword !== null && { LocalConsolePassword: input.LocalConsolePassword }), }; }; @@ -7636,14 +7676,14 @@ const serializeAws_json1_1SetSMBGuestPasswordInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.Password !== undefined && { Password: input.Password }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), }; }; const serializeAws_json1_1ShutdownGatewayInput = (input: ShutdownGatewayInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7652,33 +7692,54 @@ const serializeAws_json1_1StartAvailabilityMonitorTestInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1StartGatewayInput = (input: StartGatewayInput, context: __SerdeContext): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TapeARNs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1UpdateAutomaticTapeCreationPolicyInput = ( @@ -7686,13 +7747,14 @@ const serializeAws_json1_1UpdateAutomaticTapeCreationPolicyInput = ( context: __SerdeContext ): any => { return { - ...(input.AutomaticTapeCreationRules !== undefined && { - AutomaticTapeCreationRules: serializeAws_json1_1AutomaticTapeCreationRules( - input.AutomaticTapeCreationRules, - context - ), - }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.AutomaticTapeCreationRules !== undefined && + input.AutomaticTapeCreationRules !== null && { + AutomaticTapeCreationRules: serializeAws_json1_1AutomaticTapeCreationRules( + input.AutomaticTapeCreationRules, + context + ), + }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7701,13 +7763,15 @@ const serializeAws_json1_1UpdateBandwidthRateLimitInput = ( context: __SerdeContext ): any => { return { - ...(input.AverageDownloadRateLimitInBitsPerSec !== undefined && { - AverageDownloadRateLimitInBitsPerSec: input.AverageDownloadRateLimitInBitsPerSec, - }), - ...(input.AverageUploadRateLimitInBitsPerSec !== undefined && { - AverageUploadRateLimitInBitsPerSec: input.AverageUploadRateLimitInBitsPerSec, - }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.AverageDownloadRateLimitInBitsPerSec !== undefined && + input.AverageDownloadRateLimitInBitsPerSec !== null && { + AverageDownloadRateLimitInBitsPerSec: input.AverageDownloadRateLimitInBitsPerSec, + }), + ...(input.AverageUploadRateLimitInBitsPerSec !== undefined && + input.AverageUploadRateLimitInBitsPerSec !== null && { + AverageUploadRateLimitInBitsPerSec: input.AverageUploadRateLimitInBitsPerSec, + }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7716,13 +7780,14 @@ const serializeAws_json1_1UpdateBandwidthRateLimitScheduleInput = ( context: __SerdeContext ): any => { return { - ...(input.BandwidthRateLimitIntervals !== undefined && { - BandwidthRateLimitIntervals: serializeAws_json1_1BandwidthRateLimitIntervals( - input.BandwidthRateLimitIntervals, - context - ), - }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.BandwidthRateLimitIntervals !== undefined && + input.BandwidthRateLimitIntervals !== null && { + BandwidthRateLimitIntervals: serializeAws_json1_1BandwidthRateLimitIntervals( + input.BandwidthRateLimitIntervals, + context + ), + }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7731,14 +7796,14 @@ const serializeAws_json1_1UpdateChapCredentialsInput = ( context: __SerdeContext ): any => { return { - ...(input.InitiatorName !== undefined && { InitiatorName: input.InitiatorName }), - ...(input.SecretToAuthenticateInitiator !== undefined && { - SecretToAuthenticateInitiator: input.SecretToAuthenticateInitiator, - }), - ...(input.SecretToAuthenticateTarget !== undefined && { - SecretToAuthenticateTarget: input.SecretToAuthenticateTarget, - }), - ...(input.TargetARN !== undefined && { TargetARN: input.TargetARN }), + ...(input.InitiatorName !== undefined && input.InitiatorName !== null && { InitiatorName: input.InitiatorName }), + ...(input.SecretToAuthenticateInitiator !== undefined && + input.SecretToAuthenticateInitiator !== null && { + SecretToAuthenticateInitiator: input.SecretToAuthenticateInitiator, + }), + ...(input.SecretToAuthenticateTarget !== undefined && + input.SecretToAuthenticateTarget !== null && { SecretToAuthenticateTarget: input.SecretToAuthenticateTarget }), + ...(input.TargetARN !== undefined && input.TargetARN !== null && { TargetARN: input.TargetARN }), }; }; @@ -7747,10 +7812,12 @@ const serializeAws_json1_1UpdateGatewayInformationInput = ( context: __SerdeContext ): any => { return { - ...(input.CloudWatchLogGroupARN !== undefined && { CloudWatchLogGroupARN: input.CloudWatchLogGroupARN }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.GatewayName !== undefined && { GatewayName: input.GatewayName }), - ...(input.GatewayTimezone !== undefined && { GatewayTimezone: input.GatewayTimezone }), + ...(input.CloudWatchLogGroupARN !== undefined && + input.CloudWatchLogGroupARN !== null && { CloudWatchLogGroupARN: input.CloudWatchLogGroupARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.GatewayName !== undefined && input.GatewayName !== null && { GatewayName: input.GatewayName }), + ...(input.GatewayTimezone !== undefined && + input.GatewayTimezone !== null && { GatewayTimezone: input.GatewayTimezone }), }; }; @@ -7759,7 +7826,7 @@ const serializeAws_json1_1UpdateGatewaySoftwareNowInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7768,67 +7835,81 @@ const serializeAws_json1_1UpdateMaintenanceStartTimeInput = ( context: __SerdeContext ): any => { return { - ...(input.DayOfMonth !== undefined && { DayOfMonth: input.DayOfMonth }), - ...(input.DayOfWeek !== undefined && { DayOfWeek: input.DayOfWeek }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.HourOfDay !== undefined && { HourOfDay: input.HourOfDay }), - ...(input.MinuteOfHour !== undefined && { MinuteOfHour: input.MinuteOfHour }), + ...(input.DayOfMonth !== undefined && input.DayOfMonth !== null && { DayOfMonth: input.DayOfMonth }), + ...(input.DayOfWeek !== undefined && input.DayOfWeek !== null && { DayOfWeek: input.DayOfWeek }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.HourOfDay !== undefined && input.HourOfDay !== null && { HourOfDay: input.HourOfDay }), + ...(input.MinuteOfHour !== undefined && input.MinuteOfHour !== null && { MinuteOfHour: input.MinuteOfHour }), }; }; const serializeAws_json1_1UpdateNFSFileShareInput = (input: UpdateNFSFileShareInput, context: __SerdeContext): any => { return { - ...(input.CacheAttributes !== undefined && { - CacheAttributes: serializeAws_json1_1CacheAttributes(input.CacheAttributes, context), - }), - ...(input.ClientList !== undefined && { - ClientList: serializeAws_json1_1FileShareClientList(input.ClientList, context), - }), - ...(input.DefaultStorageClass !== undefined && { DefaultStorageClass: input.DefaultStorageClass }), - ...(input.FileShareARN !== undefined && { FileShareARN: input.FileShareARN }), - ...(input.FileShareName !== undefined && { FileShareName: input.FileShareName }), - ...(input.GuessMIMETypeEnabled !== undefined && { GuessMIMETypeEnabled: input.GuessMIMETypeEnabled }), - ...(input.KMSEncrypted !== undefined && { KMSEncrypted: input.KMSEncrypted }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.NFSFileShareDefaults !== undefined && { - NFSFileShareDefaults: serializeAws_json1_1NFSFileShareDefaults(input.NFSFileShareDefaults, context), - }), - ...(input.NotificationPolicy !== undefined && { NotificationPolicy: input.NotificationPolicy }), - ...(input.ObjectACL !== undefined && { ObjectACL: input.ObjectACL }), - ...(input.ReadOnly !== undefined && { ReadOnly: input.ReadOnly }), - ...(input.RequesterPays !== undefined && { RequesterPays: input.RequesterPays }), - ...(input.Squash !== undefined && { Squash: input.Squash }), + ...(input.CacheAttributes !== undefined && + input.CacheAttributes !== null && { + CacheAttributes: serializeAws_json1_1CacheAttributes(input.CacheAttributes, context), + }), + ...(input.ClientList !== undefined && + input.ClientList !== null && { ClientList: serializeAws_json1_1FileShareClientList(input.ClientList, context) }), + ...(input.DefaultStorageClass !== undefined && + input.DefaultStorageClass !== null && { DefaultStorageClass: input.DefaultStorageClass }), + ...(input.FileShareARN !== undefined && input.FileShareARN !== null && { FileShareARN: input.FileShareARN }), + ...(input.FileShareName !== undefined && input.FileShareName !== null && { FileShareName: input.FileShareName }), + ...(input.GuessMIMETypeEnabled !== undefined && + input.GuessMIMETypeEnabled !== null && { GuessMIMETypeEnabled: input.GuessMIMETypeEnabled }), + ...(input.KMSEncrypted !== undefined && input.KMSEncrypted !== null && { KMSEncrypted: input.KMSEncrypted }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.NFSFileShareDefaults !== undefined && + input.NFSFileShareDefaults !== null && { + NFSFileShareDefaults: serializeAws_json1_1NFSFileShareDefaults(input.NFSFileShareDefaults, context), + }), + ...(input.NotificationPolicy !== undefined && + input.NotificationPolicy !== null && { NotificationPolicy: input.NotificationPolicy }), + ...(input.ObjectACL !== undefined && input.ObjectACL !== null && { ObjectACL: input.ObjectACL }), + ...(input.ReadOnly !== undefined && input.ReadOnly !== null && { ReadOnly: input.ReadOnly }), + ...(input.RequesterPays !== undefined && input.RequesterPays !== null && { RequesterPays: input.RequesterPays }), + ...(input.Squash !== undefined && input.Squash !== null && { Squash: input.Squash }), }; }; const serializeAws_json1_1UpdateSMBFileShareInput = (input: UpdateSMBFileShareInput, context: __SerdeContext): any => { return { - ...(input.AccessBasedEnumeration !== undefined && { AccessBasedEnumeration: input.AccessBasedEnumeration }), - ...(input.AdminUserList !== undefined && { - AdminUserList: serializeAws_json1_1FileShareUserList(input.AdminUserList, context), - }), - ...(input.AuditDestinationARN !== undefined && { AuditDestinationARN: input.AuditDestinationARN }), - ...(input.CacheAttributes !== undefined && { - CacheAttributes: serializeAws_json1_1CacheAttributes(input.CacheAttributes, context), - }), - ...(input.CaseSensitivity !== undefined && { CaseSensitivity: input.CaseSensitivity }), - ...(input.DefaultStorageClass !== undefined && { DefaultStorageClass: input.DefaultStorageClass }), - ...(input.FileShareARN !== undefined && { FileShareARN: input.FileShareARN }), - ...(input.FileShareName !== undefined && { FileShareName: input.FileShareName }), - ...(input.GuessMIMETypeEnabled !== undefined && { GuessMIMETypeEnabled: input.GuessMIMETypeEnabled }), - ...(input.InvalidUserList !== undefined && { - InvalidUserList: serializeAws_json1_1FileShareUserList(input.InvalidUserList, context), - }), - ...(input.KMSEncrypted !== undefined && { KMSEncrypted: input.KMSEncrypted }), - ...(input.KMSKey !== undefined && { KMSKey: input.KMSKey }), - ...(input.NotificationPolicy !== undefined && { NotificationPolicy: input.NotificationPolicy }), - ...(input.ObjectACL !== undefined && { ObjectACL: input.ObjectACL }), - ...(input.ReadOnly !== undefined && { ReadOnly: input.ReadOnly }), - ...(input.RequesterPays !== undefined && { RequesterPays: input.RequesterPays }), - ...(input.SMBACLEnabled !== undefined && { SMBACLEnabled: input.SMBACLEnabled }), - ...(input.ValidUserList !== undefined && { - ValidUserList: serializeAws_json1_1FileShareUserList(input.ValidUserList, context), - }), + ...(input.AccessBasedEnumeration !== undefined && + input.AccessBasedEnumeration !== null && { AccessBasedEnumeration: input.AccessBasedEnumeration }), + ...(input.AdminUserList !== undefined && + input.AdminUserList !== null && { + AdminUserList: serializeAws_json1_1FileShareUserList(input.AdminUserList, context), + }), + ...(input.AuditDestinationARN !== undefined && + input.AuditDestinationARN !== null && { AuditDestinationARN: input.AuditDestinationARN }), + ...(input.CacheAttributes !== undefined && + input.CacheAttributes !== null && { + CacheAttributes: serializeAws_json1_1CacheAttributes(input.CacheAttributes, context), + }), + ...(input.CaseSensitivity !== undefined && + input.CaseSensitivity !== null && { CaseSensitivity: input.CaseSensitivity }), + ...(input.DefaultStorageClass !== undefined && + input.DefaultStorageClass !== null && { DefaultStorageClass: input.DefaultStorageClass }), + ...(input.FileShareARN !== undefined && input.FileShareARN !== null && { FileShareARN: input.FileShareARN }), + ...(input.FileShareName !== undefined && input.FileShareName !== null && { FileShareName: input.FileShareName }), + ...(input.GuessMIMETypeEnabled !== undefined && + input.GuessMIMETypeEnabled !== null && { GuessMIMETypeEnabled: input.GuessMIMETypeEnabled }), + ...(input.InvalidUserList !== undefined && + input.InvalidUserList !== null && { + InvalidUserList: serializeAws_json1_1FileShareUserList(input.InvalidUserList, context), + }), + ...(input.KMSEncrypted !== undefined && input.KMSEncrypted !== null && { KMSEncrypted: input.KMSEncrypted }), + ...(input.KMSKey !== undefined && input.KMSKey !== null && { KMSKey: input.KMSKey }), + ...(input.NotificationPolicy !== undefined && + input.NotificationPolicy !== null && { NotificationPolicy: input.NotificationPolicy }), + ...(input.ObjectACL !== undefined && input.ObjectACL !== null && { ObjectACL: input.ObjectACL }), + ...(input.ReadOnly !== undefined && input.ReadOnly !== null && { ReadOnly: input.ReadOnly }), + ...(input.RequesterPays !== undefined && input.RequesterPays !== null && { RequesterPays: input.RequesterPays }), + ...(input.SMBACLEnabled !== undefined && input.SMBACLEnabled !== null && { SMBACLEnabled: input.SMBACLEnabled }), + ...(input.ValidUserList !== undefined && + input.ValidUserList !== null && { + ValidUserList: serializeAws_json1_1FileShareUserList(input.ValidUserList, context), + }), }; }; @@ -7837,8 +7918,9 @@ const serializeAws_json1_1UpdateSMBFileShareVisibilityInput = ( context: __SerdeContext ): any => { return { - ...(input.FileSharesVisible !== undefined && { FileSharesVisible: input.FileSharesVisible }), - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.FileSharesVisible !== undefined && + input.FileSharesVisible !== null && { FileSharesVisible: input.FileSharesVisible }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), }; }; @@ -7847,8 +7929,9 @@ const serializeAws_json1_1UpdateSMBSecurityStrategyInput = ( context: __SerdeContext ): any => { return { - ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), - ...(input.SMBSecurityStrategy !== undefined && { SMBSecurityStrategy: input.SMBSecurityStrategy }), + ...(input.GatewayARN !== undefined && input.GatewayARN !== null && { GatewayARN: input.GatewayARN }), + ...(input.SMBSecurityStrategy !== undefined && + input.SMBSecurityStrategy !== null && { SMBSecurityStrategy: input.SMBSecurityStrategy }), }; }; @@ -7857,11 +7940,12 @@ const serializeAws_json1_1UpdateSnapshotScheduleInput = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.RecurrenceInHours !== undefined && { RecurrenceInHours: input.RecurrenceInHours }), - ...(input.StartAt !== undefined && { StartAt: input.StartAt }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.RecurrenceInHours !== undefined && + input.RecurrenceInHours !== null && { RecurrenceInHours: input.RecurrenceInHours }), + ...(input.StartAt !== undefined && input.StartAt !== null && { StartAt: input.StartAt }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.VolumeARN !== undefined && input.VolumeARN !== null && { VolumeARN: input.VolumeARN }), }; }; @@ -7870,17 +7954,31 @@ const serializeAws_json1_1UpdateVTLDeviceTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.DeviceType !== undefined && { DeviceType: input.DeviceType }), - ...(input.VTLDeviceARN !== undefined && { VTLDeviceARN: input.VTLDeviceARN }), + ...(input.DeviceType !== undefined && input.DeviceType !== null && { DeviceType: input.DeviceType }), + ...(input.VTLDeviceARN !== undefined && input.VTLDeviceARN !== null && { VTLDeviceARN: input.VTLDeviceARN }), }; }; const serializeAws_json1_1VolumeARNs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1VTLDeviceARNs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ActivateGatewayOutput = (output: any, context: __SerdeContext): ActivateGatewayOutput => { @@ -7949,7 +8047,14 @@ const deserializeAws_json1_1AutomaticTapeCreationPolicyInfos = ( output: any, context: __SerdeContext ): AutomaticTapeCreationPolicyInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutomaticTapeCreationPolicyInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutomaticTapeCreationPolicyInfo(entry, context); + }); }; const deserializeAws_json1_1AutomaticTapeCreationRule = ( @@ -7974,7 +8079,14 @@ const deserializeAws_json1_1AutomaticTapeCreationRules = ( output: any, context: __SerdeContext ): AutomaticTapeCreationRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AutomaticTapeCreationRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AutomaticTapeCreationRule(entry, context); + }); }; const deserializeAws_json1_1BandwidthRateLimitInterval = ( @@ -8010,7 +8122,14 @@ const deserializeAws_json1_1BandwidthRateLimitIntervals = ( output: any, context: __SerdeContext ): BandwidthRateLimitInterval[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1BandwidthRateLimitInterval(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1BandwidthRateLimitInterval(entry, context); + }); }; const deserializeAws_json1_1CacheAttributes = (output: any, context: __SerdeContext): CacheAttributes => { @@ -8058,7 +8177,14 @@ const deserializeAws_json1_1CachediSCSIVolume = (output: any, context: __SerdeCo }; const deserializeAws_json1_1CachediSCSIVolumes = (output: any, context: __SerdeContext): CachediSCSIVolume[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CachediSCSIVolume(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CachediSCSIVolume(entry, context); + }); }; const deserializeAws_json1_1CancelArchivalOutput = (output: any, context: __SerdeContext): CancelArchivalOutput => { @@ -8074,7 +8200,14 @@ const deserializeAws_json1_1CancelRetrievalOutput = (output: any, context: __Ser }; const deserializeAws_json1_1ChapCredentials = (output: any, context: __SerdeContext): ChapInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ChapInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ChapInfo(entry, context); + }); }; const deserializeAws_json1_1ChapInfo = (output: any, context: __SerdeContext): ChapInfo => { @@ -8181,7 +8314,14 @@ const deserializeAws_json1_1CreateTapeWithBarcodeOutput = ( }; const deserializeAws_json1_1DaysOfWeek = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DeleteAutomaticTapeCreationPolicyOutput = ( @@ -8646,29 +8786,59 @@ const deserializeAws_json1_1Disk = (output: any, context: __SerdeContext): Disk }; const deserializeAws_json1_1DiskAttributeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DiskIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Disks = (output: any, context: __SerdeContext): Disk[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Disk(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Disk(entry, context); + }); }; const deserializeAws_json1_1errorDetails = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_json1_1FileShareClientList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FileShareInfo = (output: any, context: __SerdeContext): FileShareInfo => { @@ -8684,11 +8854,25 @@ const deserializeAws_json1_1FileShareInfo = (output: any, context: __SerdeContex }; const deserializeAws_json1_1FileShareInfoList = (output: any, context: __SerdeContext): FileShareInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FileShareInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FileShareInfo(entry, context); + }); }; const deserializeAws_json1_1FileShareUserList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1GatewayInfo = (output: any, context: __SerdeContext): GatewayInfo => { @@ -8711,15 +8895,36 @@ const deserializeAws_json1_1GatewayInfo = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1GatewayNetworkInterfaces = (output: any, context: __SerdeContext): NetworkInterface[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NetworkInterface(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NetworkInterface(entry, context); + }); }; const deserializeAws_json1_1Gateways = (output: any, context: __SerdeContext): GatewayInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GatewayInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GatewayInfo(entry, context); + }); }; const deserializeAws_json1_1Initiators = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InternalServerError = (output: any, context: __SerdeContext): InternalServerError => { @@ -8933,7 +9138,14 @@ const deserializeAws_json1_1NFSFileShareInfo = (output: any, context: __SerdeCon }; const deserializeAws_json1_1NFSFileShareInfoList = (output: any, context: __SerdeContext): NFSFileShareInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1NFSFileShareInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1NFSFileShareInfo(entry, context); + }); }; const deserializeAws_json1_1NotifyWhenUploadedOutput = ( @@ -8965,7 +9177,14 @@ const deserializeAws_json1_1PoolInfo = (output: any, context: __SerdeContext): P }; const deserializeAws_json1_1PoolInfos = (output: any, context: __SerdeContext): PoolInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1PoolInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1PoolInfo(entry, context); + }); }; const deserializeAws_json1_1RefreshCacheOutput = (output: any, context: __SerdeContext): RefreshCacheOutput => { @@ -9112,7 +9331,14 @@ const deserializeAws_json1_1SMBFileShareInfo = (output: any, context: __SerdeCon }; const deserializeAws_json1_1SMBFileShareInfoList = (output: any, context: __SerdeContext): SMBFileShareInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SMBFileShareInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SMBFileShareInfo(entry, context); + }); }; const deserializeAws_json1_1StartAvailabilityMonitorTestOutput = ( @@ -9181,7 +9407,14 @@ const deserializeAws_json1_1StorediSCSIVolume = (output: any, context: __SerdeCo }; const deserializeAws_json1_1StorediSCSIVolumes = (output: any, context: __SerdeContext): StorediSCSIVolume[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1StorediSCSIVolume(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1StorediSCSIVolume(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -9192,7 +9425,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1Tape = (output: any, context: __SerdeContext): Tape => { @@ -9257,11 +9497,25 @@ const deserializeAws_json1_1TapeArchive = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1TapeArchives = (output: any, context: __SerdeContext): TapeArchive[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TapeArchive(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TapeArchive(entry, context); + }); }; const deserializeAws_json1_1TapeARNs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TapeInfo = (output: any, context: __SerdeContext): TapeInfo => { @@ -9285,7 +9539,14 @@ const deserializeAws_json1_1TapeInfo = (output: any, context: __SerdeContext): T }; const deserializeAws_json1_1TapeInfos = (output: any, context: __SerdeContext): TapeInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TapeInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TapeInfo(entry, context); + }); }; const deserializeAws_json1_1TapeRecoveryPointInfo = (output: any, context: __SerdeContext): TapeRecoveryPointInfo => { @@ -9305,11 +9566,25 @@ const deserializeAws_json1_1TapeRecoveryPointInfos = ( output: any, context: __SerdeContext ): TapeRecoveryPointInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TapeRecoveryPointInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TapeRecoveryPointInfo(entry, context); + }); }; const deserializeAws_json1_1Tapes = (output: any, context: __SerdeContext): Tape[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tape(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tape(entry, context); + }); }; const deserializeAws_json1_1UpdateAutomaticTapeCreationPolicyOutput = ( @@ -9451,7 +9726,14 @@ const deserializeAws_json1_1VolumeInfo = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1VolumeInfos = (output: any, context: __SerdeContext): VolumeInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VolumeInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VolumeInfo(entry, context); + }); }; const deserializeAws_json1_1VolumeiSCSIAttributes = (output: any, context: __SerdeContext): VolumeiSCSIAttributes => { @@ -9495,7 +9777,14 @@ const deserializeAws_json1_1VolumeRecoveryPointInfos = ( output: any, context: __SerdeContext ): VolumeRecoveryPointInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VolumeRecoveryPointInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VolumeRecoveryPointInfo(entry, context); + }); }; const deserializeAws_json1_1VTLDevice = (output: any, context: __SerdeContext): VTLDevice => { @@ -9517,7 +9806,14 @@ const deserializeAws_json1_1VTLDevice = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1VTLDevices = (output: any, context: __SerdeContext): VTLDevice[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VTLDevice(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VTLDevice(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -9570,3 +9866,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-sts/protocols/Aws_query.ts b/clients/client-sts/protocols/Aws_query.ts index 60945ba9f183..a354ed28ba6e 100644 --- a/clients/client-sts/protocols/Aws_query.ts +++ b/clients/client-sts/protocols/Aws_query.ts @@ -63,7 +63,7 @@ export const serializeAws_queryAssumeRoleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -79,7 +79,7 @@ export const serializeAws_queryAssumeRoleWithSAMLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -95,7 +95,7 @@ export const serializeAws_queryAssumeRoleWithWebIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -111,7 +111,7 @@ export const serializeAws_queryDecodeAuthorizationMessageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -127,7 +127,7 @@ export const serializeAws_queryGetAccessKeyInfoCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -143,7 +143,7 @@ export const serializeAws_queryGetCallerIdentityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -159,7 +159,7 @@ export const serializeAws_queryGetFederationTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -175,7 +175,7 @@ export const serializeAws_queryGetSessionTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-www-form-urlencoded", + "content-type": "application/x-www-form-urlencoded", }; let body: any; body = buildFormUrlencodedString({ @@ -852,46 +852,46 @@ const deserializeAws_queryRegionDisabledExceptionResponse = async ( const serializeAws_queryAssumeRoleRequest = (input: AssumeRoleRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.DurationSeconds !== undefined) { + if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) { entries["DurationSeconds"] = input.DurationSeconds; } - if (input.RoleSessionName !== undefined) { + if (input.RoleSessionName !== undefined && input.RoleSessionName !== null) { entries["RoleSessionName"] = input.RoleSessionName; } - if (input.TokenCode !== undefined) { + if (input.TokenCode !== undefined && input.TokenCode !== null) { entries["TokenCode"] = input.TokenCode; } - if (input.PolicyArns !== undefined) { + if (input.PolicyArns !== undefined && input.PolicyArns !== null) { const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyArns.${key}`; entries[loc] = value; }); } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.Policy !== undefined) { + if (input.Policy !== undefined && input.Policy !== null) { entries["Policy"] = input.Policy; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_querytagListType(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.ExternalId !== undefined) { + if (input.ExternalId !== undefined && input.ExternalId !== null) { entries["ExternalId"] = input.ExternalId; } - if (input.TransitiveTagKeys !== undefined) { + if (input.TransitiveTagKeys !== undefined && input.TransitiveTagKeys !== null) { const memberEntries = serializeAws_querytagKeyListType(input.TransitiveTagKeys, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TransitiveTagKeys.${key}`; entries[loc] = value; }); } - if (input.SerialNumber !== undefined) { + if (input.SerialNumber !== undefined && input.SerialNumber !== null) { entries["SerialNumber"] = input.SerialNumber; } return entries; @@ -902,26 +902,26 @@ const serializeAws_queryAssumeRoleWithSAMLRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Policy !== undefined) { + if (input.Policy !== undefined && input.Policy !== null) { entries["Policy"] = input.Policy; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.PolicyArns !== undefined) { + if (input.PolicyArns !== undefined && input.PolicyArns !== null) { const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyArns.${key}`; entries[loc] = value; }); } - if (input.PrincipalArn !== undefined) { + if (input.PrincipalArn !== undefined && input.PrincipalArn !== null) { entries["PrincipalArn"] = input.PrincipalArn; } - if (input.SAMLAssertion !== undefined) { + if (input.SAMLAssertion !== undefined && input.SAMLAssertion !== null) { entries["SAMLAssertion"] = input.SAMLAssertion; } - if (input.DurationSeconds !== undefined) { + if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) { entries["DurationSeconds"] = input.DurationSeconds; } return entries; @@ -932,25 +932,25 @@ const serializeAws_queryAssumeRoleWithWebIdentityRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.WebIdentityToken !== undefined) { + if (input.WebIdentityToken !== undefined && input.WebIdentityToken !== null) { entries["WebIdentityToken"] = input.WebIdentityToken; } - if (input.ProviderId !== undefined) { + if (input.ProviderId !== undefined && input.ProviderId !== null) { entries["ProviderId"] = input.ProviderId; } - if (input.Policy !== undefined) { + if (input.Policy !== undefined && input.Policy !== null) { entries["Policy"] = input.Policy; } - if (input.RoleSessionName !== undefined) { + if (input.RoleSessionName !== undefined && input.RoleSessionName !== null) { entries["RoleSessionName"] = input.RoleSessionName; } - if (input.RoleArn !== undefined) { + if (input.RoleArn !== undefined && input.RoleArn !== null) { entries["RoleArn"] = input.RoleArn; } - if (input.DurationSeconds !== undefined) { + if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) { entries["DurationSeconds"] = input.DurationSeconds; } - if (input.PolicyArns !== undefined) { + if (input.PolicyArns !== undefined && input.PolicyArns !== null) { const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyArns.${key}`; @@ -965,7 +965,7 @@ const serializeAws_queryDecodeAuthorizationMessageRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.EncodedMessage !== undefined) { + if (input.EncodedMessage !== undefined && input.EncodedMessage !== null) { entries["EncodedMessage"] = input.EncodedMessage; } return entries; @@ -973,7 +973,7 @@ const serializeAws_queryDecodeAuthorizationMessageRequest = ( const serializeAws_queryGetAccessKeyInfoRequest = (input: GetAccessKeyInfoRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.AccessKeyId !== undefined) { + if (input.AccessKeyId !== undefined && input.AccessKeyId !== null) { entries["AccessKeyId"] = input.AccessKeyId; } return entries; @@ -989,27 +989,27 @@ const serializeAws_queryGetFederationTokenRequest = ( context: __SerdeContext ): any => { const entries: any = {}; - if (input.Policy !== undefined) { + if (input.Policy !== undefined && input.Policy !== null) { entries["Policy"] = input.Policy; } - if (input.Tags !== undefined) { + if (input.Tags !== undefined && input.Tags !== null) { const memberEntries = serializeAws_querytagListType(input.Tags, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } - if (input.Name !== undefined) { + if (input.Name !== undefined && input.Name !== null) { entries["Name"] = input.Name; } - if (input.PolicyArns !== undefined) { + if (input.PolicyArns !== undefined && input.PolicyArns !== null) { const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyArns.${key}`; entries[loc] = value; }); } - if (input.DurationSeconds !== undefined) { + if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) { entries["DurationSeconds"] = input.DurationSeconds; } return entries; @@ -1017,13 +1017,13 @@ const serializeAws_queryGetFederationTokenRequest = ( const serializeAws_queryGetSessionTokenRequest = (input: GetSessionTokenRequest, context: __SerdeContext): any => { const entries: any = {}; - if (input.SerialNumber !== undefined) { + if (input.SerialNumber !== undefined && input.SerialNumber !== null) { entries["SerialNumber"] = input.SerialNumber; } - if (input.DurationSeconds !== undefined) { + if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) { entries["DurationSeconds"] = input.DurationSeconds; } - if (input.TokenCode !== undefined) { + if (input.TokenCode !== undefined && input.TokenCode !== null) { entries["TokenCode"] = input.TokenCode; } return entries; @@ -1033,6 +1033,9 @@ const serializeAws_querypolicyDescriptorListType = (input: PolicyDescriptorType[ const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryPolicyDescriptorType(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; @@ -1044,7 +1047,7 @@ const serializeAws_querypolicyDescriptorListType = (input: PolicyDescriptorType[ const serializeAws_queryPolicyDescriptorType = (input: PolicyDescriptorType, context: __SerdeContext): any => { const entries: any = {}; - if (input.arn !== undefined) { + if (input.arn !== undefined && input.arn !== null) { entries["arn"] = input.arn; } return entries; @@ -1052,10 +1055,10 @@ const serializeAws_queryPolicyDescriptorType = (input: PolicyDescriptorType, con const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => { const entries: any = {}; - if (input.Key !== undefined) { + if (input.Key !== undefined && input.Key !== null) { entries["Key"] = input.Key; } - if (input.Value !== undefined) { + if (input.Value !== undefined && input.Value !== null) { entries["Value"] = input.Value; } return entries; @@ -1065,6 +1068,9 @@ const serializeAws_querytagKeyListType = (input: string[], context: __SerdeConte const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } entries[`member.${counter}`] = entry; counter++; } @@ -1075,6 +1081,9 @@ const serializeAws_querytagListType = (input: Tag[], context: __SerdeContext): a const entries: any = {}; let counter = 1; for (let entry of input) { + if (entry === null) { + continue; + } const memberEntries = serializeAws_queryTag(entry, context); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; diff --git a/clients/client-support/protocols/Aws_json1_1.ts b/clients/client-support/protocols/Aws_json1_1.ts index afb645eac3da..402ba1b96eee 100644 --- a/clients/client-support/protocols/Aws_json1_1.ts +++ b/clients/client-support/protocols/Aws_json1_1.ts @@ -109,7 +109,7 @@ export const serializeAws_json1_1AddAttachmentsToSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.AddAttachmentsToSet", }; let body: any; @@ -122,7 +122,7 @@ export const serializeAws_json1_1AddCommunicationToCaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.AddCommunicationToCase", }; let body: any; @@ -135,7 +135,7 @@ export const serializeAws_json1_1CreateCaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.CreateCase", }; let body: any; @@ -148,7 +148,7 @@ export const serializeAws_json1_1DescribeAttachmentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.DescribeAttachment", }; let body: any; @@ -161,7 +161,7 @@ export const serializeAws_json1_1DescribeCasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.DescribeCases", }; let body: any; @@ -174,7 +174,7 @@ export const serializeAws_json1_1DescribeCommunicationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.DescribeCommunications", }; let body: any; @@ -187,7 +187,7 @@ export const serializeAws_json1_1DescribeServicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.DescribeServices", }; let body: any; @@ -200,7 +200,7 @@ export const serializeAws_json1_1DescribeSeverityLevelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.DescribeSeverityLevels", }; let body: any; @@ -213,7 +213,7 @@ export const serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckRefreshStatuses", }; let body: any; @@ -226,7 +226,7 @@ export const serializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckResult", }; let body: any; @@ -239,7 +239,7 @@ export const serializeAws_json1_1DescribeTrustedAdvisorChecksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.DescribeTrustedAdvisorChecks", }; let body: any; @@ -252,7 +252,7 @@ export const serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand = a context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.DescribeTrustedAdvisorCheckSummaries", }; let body: any; @@ -265,7 +265,7 @@ export const serializeAws_json1_1RefreshTrustedAdvisorCheckCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.RefreshTrustedAdvisorCheck", }; let body: any; @@ -278,7 +278,7 @@ export const serializeAws_json1_1ResolveCaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSSupport_20130415.ResolveCase", }; let body: any; @@ -313,8 +313,7 @@ const deserializeAws_json1_1AddAttachmentsToSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AttachmentLimitExceeded": case "com.amazonaws.support#AttachmentLimitExceeded": @@ -400,8 +399,7 @@ const deserializeAws_json1_1AddCommunicationToCaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AttachmentSetExpired": case "com.amazonaws.support#AttachmentSetExpired": @@ -479,8 +477,7 @@ const deserializeAws_json1_1CreateCaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AttachmentSetExpired": case "com.amazonaws.support#AttachmentSetExpired": @@ -558,8 +555,7 @@ const deserializeAws_json1_1DescribeAttachmentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AttachmentIdNotFound": case "com.amazonaws.support#AttachmentIdNotFound": @@ -629,8 +625,7 @@ const deserializeAws_json1_1DescribeCasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CaseIdNotFound": case "com.amazonaws.support#CaseIdNotFound": @@ -692,8 +687,7 @@ const deserializeAws_json1_1DescribeCommunicationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CaseIdNotFound": case "com.amazonaws.support#CaseIdNotFound": @@ -755,8 +749,7 @@ const deserializeAws_json1_1DescribeServicesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.support#InternalServerError": @@ -810,8 +803,7 @@ const deserializeAws_json1_1DescribeSeverityLevelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.support#InternalServerError": @@ -865,8 +857,7 @@ const deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommandErr }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.support#InternalServerError": @@ -920,8 +911,7 @@ const deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.support#InternalServerError": @@ -975,8 +965,7 @@ const deserializeAws_json1_1DescribeTrustedAdvisorChecksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.support#InternalServerError": @@ -1030,8 +1019,7 @@ const deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommandError = a }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.support#InternalServerError": @@ -1085,8 +1073,7 @@ const deserializeAws_json1_1RefreshTrustedAdvisorCheckCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerError": case "com.amazonaws.support#InternalServerError": @@ -1140,8 +1127,7 @@ const deserializeAws_json1_1ResolveCaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "CaseIdNotFound": case "com.amazonaws.support#CaseIdNotFound": @@ -1316,10 +1302,10 @@ const serializeAws_json1_1AddAttachmentsToSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.attachmentSetId !== undefined && { attachmentSetId: input.attachmentSetId }), - ...(input.attachments !== undefined && { - attachments: serializeAws_json1_1Attachments(input.attachments, context), - }), + ...(input.attachmentSetId !== undefined && + input.attachmentSetId !== null && { attachmentSetId: input.attachmentSetId }), + ...(input.attachments !== undefined && + input.attachments !== null && { attachments: serializeAws_json1_1Attachments(input.attachments, context) }), }; }; @@ -1328,47 +1314,74 @@ const serializeAws_json1_1AddCommunicationToCaseRequest = ( context: __SerdeContext ): any => { return { - ...(input.attachmentSetId !== undefined && { attachmentSetId: input.attachmentSetId }), - ...(input.caseId !== undefined && { caseId: input.caseId }), - ...(input.ccEmailAddresses !== undefined && { - ccEmailAddresses: serializeAws_json1_1CcEmailAddressList(input.ccEmailAddresses, context), - }), - ...(input.communicationBody !== undefined && { communicationBody: input.communicationBody }), + ...(input.attachmentSetId !== undefined && + input.attachmentSetId !== null && { attachmentSetId: input.attachmentSetId }), + ...(input.caseId !== undefined && input.caseId !== null && { caseId: input.caseId }), + ...(input.ccEmailAddresses !== undefined && + input.ccEmailAddresses !== null && { + ccEmailAddresses: serializeAws_json1_1CcEmailAddressList(input.ccEmailAddresses, context), + }), + ...(input.communicationBody !== undefined && + input.communicationBody !== null && { communicationBody: input.communicationBody }), }; }; const serializeAws_json1_1Attachment = (input: Attachment, context: __SerdeContext): any => { return { - ...(input.data !== undefined && { data: context.base64Encoder(input.data) }), - ...(input.fileName !== undefined && { fileName: input.fileName }), + ...(input.data !== undefined && input.data !== null && { data: context.base64Encoder(input.data) }), + ...(input.fileName !== undefined && input.fileName !== null && { fileName: input.fileName }), }; }; const serializeAws_json1_1Attachments = (input: Attachment[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Attachment(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Attachment(entry, context); + }); }; const serializeAws_json1_1CaseIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CcEmailAddressList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateCaseRequest = (input: CreateCaseRequest, context: __SerdeContext): any => { return { - ...(input.attachmentSetId !== undefined && { attachmentSetId: input.attachmentSetId }), - ...(input.categoryCode !== undefined && { categoryCode: input.categoryCode }), - ...(input.ccEmailAddresses !== undefined && { - ccEmailAddresses: serializeAws_json1_1CcEmailAddressList(input.ccEmailAddresses, context), - }), - ...(input.communicationBody !== undefined && { communicationBody: input.communicationBody }), - ...(input.issueType !== undefined && { issueType: input.issueType }), - ...(input.language !== undefined && { language: input.language }), - ...(input.serviceCode !== undefined && { serviceCode: input.serviceCode }), - ...(input.severityCode !== undefined && { severityCode: input.severityCode }), - ...(input.subject !== undefined && { subject: input.subject }), + ...(input.attachmentSetId !== undefined && + input.attachmentSetId !== null && { attachmentSetId: input.attachmentSetId }), + ...(input.categoryCode !== undefined && input.categoryCode !== null && { categoryCode: input.categoryCode }), + ...(input.ccEmailAddresses !== undefined && + input.ccEmailAddresses !== null && { + ccEmailAddresses: serializeAws_json1_1CcEmailAddressList(input.ccEmailAddresses, context), + }), + ...(input.communicationBody !== undefined && + input.communicationBody !== null && { communicationBody: input.communicationBody }), + ...(input.issueType !== undefined && input.issueType !== null && { issueType: input.issueType }), + ...(input.language !== undefined && input.language !== null && { language: input.language }), + ...(input.serviceCode !== undefined && input.serviceCode !== null && { serviceCode: input.serviceCode }), + ...(input.severityCode !== undefined && input.severityCode !== null && { severityCode: input.severityCode }), + ...(input.subject !== undefined && input.subject !== null && { subject: input.subject }), }; }; @@ -1377,21 +1390,24 @@ const serializeAws_json1_1DescribeAttachmentRequest = ( context: __SerdeContext ): any => { return { - ...(input.attachmentId !== undefined && { attachmentId: input.attachmentId }), + ...(input.attachmentId !== undefined && input.attachmentId !== null && { attachmentId: input.attachmentId }), }; }; const serializeAws_json1_1DescribeCasesRequest = (input: DescribeCasesRequest, context: __SerdeContext): any => { return { - ...(input.afterTime !== undefined && { afterTime: input.afterTime }), - ...(input.beforeTime !== undefined && { beforeTime: input.beforeTime }), - ...(input.caseIdList !== undefined && { caseIdList: serializeAws_json1_1CaseIdList(input.caseIdList, context) }), - ...(input.displayId !== undefined && { displayId: input.displayId }), - ...(input.includeCommunications !== undefined && { includeCommunications: input.includeCommunications }), - ...(input.includeResolvedCases !== undefined && { includeResolvedCases: input.includeResolvedCases }), - ...(input.language !== undefined && { language: input.language }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.afterTime !== undefined && input.afterTime !== null && { afterTime: input.afterTime }), + ...(input.beforeTime !== undefined && input.beforeTime !== null && { beforeTime: input.beforeTime }), + ...(input.caseIdList !== undefined && + input.caseIdList !== null && { caseIdList: serializeAws_json1_1CaseIdList(input.caseIdList, context) }), + ...(input.displayId !== undefined && input.displayId !== null && { displayId: input.displayId }), + ...(input.includeCommunications !== undefined && + input.includeCommunications !== null && { includeCommunications: input.includeCommunications }), + ...(input.includeResolvedCases !== undefined && + input.includeResolvedCases !== null && { includeResolvedCases: input.includeResolvedCases }), + ...(input.language !== undefined && input.language !== null && { language: input.language }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; @@ -1400,20 +1416,21 @@ const serializeAws_json1_1DescribeCommunicationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.afterTime !== undefined && { afterTime: input.afterTime }), - ...(input.beforeTime !== undefined && { beforeTime: input.beforeTime }), - ...(input.caseId !== undefined && { caseId: input.caseId }), - ...(input.maxResults !== undefined && { maxResults: input.maxResults }), - ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.afterTime !== undefined && input.afterTime !== null && { afterTime: input.afterTime }), + ...(input.beforeTime !== undefined && input.beforeTime !== null && { beforeTime: input.beforeTime }), + ...(input.caseId !== undefined && input.caseId !== null && { caseId: input.caseId }), + ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }), }; }; const serializeAws_json1_1DescribeServicesRequest = (input: DescribeServicesRequest, context: __SerdeContext): any => { return { - ...(input.language !== undefined && { language: input.language }), - ...(input.serviceCodeList !== undefined && { - serviceCodeList: serializeAws_json1_1ServiceCodeList(input.serviceCodeList, context), - }), + ...(input.language !== undefined && input.language !== null && { language: input.language }), + ...(input.serviceCodeList !== undefined && + input.serviceCodeList !== null && { + serviceCodeList: serializeAws_json1_1ServiceCodeList(input.serviceCodeList, context), + }), }; }; @@ -1422,7 +1439,7 @@ const serializeAws_json1_1DescribeSeverityLevelsRequest = ( context: __SerdeContext ): any => { return { - ...(input.language !== undefined && { language: input.language }), + ...(input.language !== undefined && input.language !== null && { language: input.language }), }; }; @@ -1431,7 +1448,8 @@ const serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesRequest = ( context: __SerdeContext ): any => { return { - ...(input.checkIds !== undefined && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }), + ...(input.checkIds !== undefined && + input.checkIds !== null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }), }; }; @@ -1440,8 +1458,8 @@ const serializeAws_json1_1DescribeTrustedAdvisorCheckResultRequest = ( context: __SerdeContext ): any => { return { - ...(input.checkId !== undefined && { checkId: input.checkId }), - ...(input.language !== undefined && { language: input.language }), + ...(input.checkId !== undefined && input.checkId !== null && { checkId: input.checkId }), + ...(input.language !== undefined && input.language !== null && { language: input.language }), }; }; @@ -1450,7 +1468,7 @@ const serializeAws_json1_1DescribeTrustedAdvisorChecksRequest = ( context: __SerdeContext ): any => { return { - ...(input.language !== undefined && { language: input.language }), + ...(input.language !== undefined && input.language !== null && { language: input.language }), }; }; @@ -1459,7 +1477,8 @@ const serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesRequest = ( context: __SerdeContext ): any => { return { - ...(input.checkIds !== undefined && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }), + ...(input.checkIds !== undefined && + input.checkIds !== null && { checkIds: serializeAws_json1_1StringList(input.checkIds, context) }), }; }; @@ -1468,22 +1487,36 @@ const serializeAws_json1_1RefreshTrustedAdvisorCheckRequest = ( context: __SerdeContext ): any => { return { - ...(input.checkId !== undefined && { checkId: input.checkId }), + ...(input.checkId !== undefined && input.checkId !== null && { checkId: input.checkId }), }; }; const serializeAws_json1_1ResolveCaseRequest = (input: ResolveCaseRequest, context: __SerdeContext): any => { return { - ...(input.caseId !== undefined && { caseId: input.caseId }), + ...(input.caseId !== undefined && input.caseId !== null && { caseId: input.caseId }), }; }; const serializeAws_json1_1ServiceCodeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AddAttachmentsToSetResponse = ( @@ -1536,7 +1569,14 @@ const deserializeAws_json1_1AttachmentLimitExceeded = ( }; const deserializeAws_json1_1AttachmentSet = (output: any, context: __SerdeContext): AttachmentDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AttachmentDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AttachmentDetails(entry, context); + }); }; const deserializeAws_json1_1AttachmentSetExpired = (output: any, context: __SerdeContext): AttachmentSetExpired => { @@ -1602,7 +1642,14 @@ const deserializeAws_json1_1CaseIdNotFound = (output: any, context: __SerdeConte }; const deserializeAws_json1_1CaseList = (output: any, context: __SerdeContext): CaseDetails[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1CaseDetails(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1CaseDetails(entry, context); + }); }; const deserializeAws_json1_1Category = (output: any, context: __SerdeContext): Category => { @@ -1613,11 +1660,25 @@ const deserializeAws_json1_1Category = (output: any, context: __SerdeContext): C }; const deserializeAws_json1_1CategoryList = (output: any, context: __SerdeContext): Category[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Category(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Category(entry, context); + }); }; const deserializeAws_json1_1CcEmailAddressList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Communication = (output: any, context: __SerdeContext): Communication => { @@ -1634,7 +1695,14 @@ const deserializeAws_json1_1Communication = (output: any, context: __SerdeContex }; const deserializeAws_json1_1CommunicationList = (output: any, context: __SerdeContext): Communication[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Communication(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Communication(entry, context); + }); }; const deserializeAws_json1_1CreateCaseResponse = (output: any, context: __SerdeContext): CreateCaseResponse => { @@ -1813,7 +1881,14 @@ const deserializeAws_json1_1Service = (output: any, context: __SerdeContext): Se }; const deserializeAws_json1_1ServiceList = (output: any, context: __SerdeContext): Service[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Service(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Service(entry, context); + }); }; const deserializeAws_json1_1SeverityLevel = (output: any, context: __SerdeContext): SeverityLevel => { @@ -1824,11 +1899,25 @@ const deserializeAws_json1_1SeverityLevel = (output: any, context: __SerdeContex }; const deserializeAws_json1_1SeverityLevelsList = (output: any, context: __SerdeContext): SeverityLevel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SeverityLevel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SeverityLevel(entry, context); + }); }; const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1TrustedAdvisorCategorySpecificSummary = ( @@ -1863,7 +1952,14 @@ const deserializeAws_json1_1TrustedAdvisorCheckList = ( output: any, context: __SerdeContext ): TrustedAdvisorCheckDescription[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrustedAdvisorCheckDescription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrustedAdvisorCheckDescription(entry, context); + }); }; const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus = ( @@ -1884,7 +1980,14 @@ const deserializeAws_json1_1TrustedAdvisorCheckRefreshStatusList = ( output: any, context: __SerdeContext ): TrustedAdvisorCheckRefreshStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrustedAdvisorCheckRefreshStatus(entry, context); + }); }; const deserializeAws_json1_1TrustedAdvisorCheckResult = ( @@ -1937,7 +2040,14 @@ const deserializeAws_json1_1TrustedAdvisorCheckSummaryList = ( output: any, context: __SerdeContext ): TrustedAdvisorCheckSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrustedAdvisorCheckSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrustedAdvisorCheckSummary(entry, context); + }); }; const deserializeAws_json1_1TrustedAdvisorCostOptimizingSummary = ( @@ -1976,7 +2086,14 @@ const deserializeAws_json1_1TrustedAdvisorResourceDetailList = ( output: any, context: __SerdeContext ): TrustedAdvisorResourceDetail[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TrustedAdvisorResourceDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TrustedAdvisorResourceDetail(entry, context); + }); }; const deserializeAws_json1_1TrustedAdvisorResourcesSummary = ( @@ -2049,3 +2166,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-swf/protocols/Aws_json1_0.ts b/clients/client-swf/protocols/Aws_json1_0.ts index af6f04261e95..2c06d6f90301 100644 --- a/clients/client-swf/protocols/Aws_json1_0.ts +++ b/clients/client-swf/protocols/Aws_json1_0.ts @@ -287,7 +287,7 @@ export const serializeAws_json1_0CountClosedWorkflowExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.CountClosedWorkflowExecutions", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_0CountOpenWorkflowExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.CountOpenWorkflowExecutions", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_0CountPendingActivityTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.CountPendingActivityTasks", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_0CountPendingDecisionTasksCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.CountPendingDecisionTasks", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_0DeprecateActivityTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.DeprecateActivityType", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_0DeprecateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.DeprecateDomain", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_0DeprecateWorkflowTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.DeprecateWorkflowType", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_0DescribeActivityTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.DescribeActivityType", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_0DescribeDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.DescribeDomain", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_0DescribeWorkflowExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.DescribeWorkflowExecution", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_0DescribeWorkflowTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.DescribeWorkflowType", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_0GetWorkflowExecutionHistoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.GetWorkflowExecutionHistory", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_0ListActivityTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.ListActivityTypes", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_0ListClosedWorkflowExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.ListClosedWorkflowExecutions", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_0ListDomainsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.ListDomains", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_0ListOpenWorkflowExecutionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.ListOpenWorkflowExecutions", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.ListTagsForResource", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_0ListWorkflowTypesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.ListWorkflowTypes", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_0PollForActivityTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.PollForActivityTask", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_0PollForDecisionTaskCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.PollForDecisionTask", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_0RecordActivityTaskHeartbeatCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.RecordActivityTaskHeartbeat", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_0RegisterActivityTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.RegisterActivityType", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_0RegisterDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.RegisterDomain", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_0RegisterWorkflowTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.RegisterWorkflowType", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_0RequestCancelWorkflowExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.RequestCancelWorkflowExecution", }; let body: any; @@ -612,7 +612,7 @@ export const serializeAws_json1_0RespondActivityTaskCanceledCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.RespondActivityTaskCanceled", }; let body: any; @@ -625,7 +625,7 @@ export const serializeAws_json1_0RespondActivityTaskCompletedCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.RespondActivityTaskCompleted", }; let body: any; @@ -638,7 +638,7 @@ export const serializeAws_json1_0RespondActivityTaskFailedCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.RespondActivityTaskFailed", }; let body: any; @@ -651,7 +651,7 @@ export const serializeAws_json1_0RespondDecisionTaskCompletedCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.RespondDecisionTaskCompleted", }; let body: any; @@ -664,7 +664,7 @@ export const serializeAws_json1_0SignalWorkflowExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.SignalWorkflowExecution", }; let body: any; @@ -677,7 +677,7 @@ export const serializeAws_json1_0StartWorkflowExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.StartWorkflowExecution", }; let body: any; @@ -690,7 +690,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.TagResource", }; let body: any; @@ -703,7 +703,7 @@ export const serializeAws_json1_0TerminateWorkflowExecutionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.TerminateWorkflowExecution", }; let body: any; @@ -716,7 +716,7 @@ export const serializeAws_json1_0UndeprecateActivityTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.UndeprecateActivityType", }; let body: any; @@ -729,7 +729,7 @@ export const serializeAws_json1_0UndeprecateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.UndeprecateDomain", }; let body: any; @@ -742,7 +742,7 @@ export const serializeAws_json1_0UndeprecateWorkflowTypeCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.UndeprecateWorkflowType", }; let body: any; @@ -755,7 +755,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "SimpleWorkflowService.UntagResource", }; let body: any; @@ -790,8 +790,7 @@ const deserializeAws_json1_0CountClosedWorkflowExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -853,8 +852,7 @@ const deserializeAws_json1_0CountOpenWorkflowExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -916,8 +914,7 @@ const deserializeAws_json1_0CountPendingActivityTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -979,8 +976,7 @@ const deserializeAws_json1_0CountPendingDecisionTasksCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1039,8 +1035,7 @@ const deserializeAws_json1_0DeprecateActivityTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1107,8 +1102,7 @@ const deserializeAws_json1_0DeprecateDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DomainDeprecatedFault": case "com.amazonaws.swf#DomainDeprecatedFault": @@ -1175,8 +1169,7 @@ const deserializeAws_json1_0DeprecateWorkflowTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1246,8 +1239,7 @@ const deserializeAws_json1_0DescribeActivityTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1309,8 +1301,7 @@ const deserializeAws_json1_0DescribeDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1372,8 +1363,7 @@ const deserializeAws_json1_0DescribeWorkflowExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1435,8 +1425,7 @@ const deserializeAws_json1_0DescribeWorkflowTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1498,8 +1487,7 @@ const deserializeAws_json1_0GetWorkflowExecutionHistoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1561,8 +1549,7 @@ const deserializeAws_json1_0ListActivityTypesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1624,8 +1611,7 @@ const deserializeAws_json1_0ListClosedWorkflowExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1687,8 +1673,7 @@ const deserializeAws_json1_0ListDomainsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1742,8 +1727,7 @@ const deserializeAws_json1_0ListOpenWorkflowExecutionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1805,8 +1789,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededFault": case "com.amazonaws.swf#LimitExceededFault": @@ -1876,8 +1859,7 @@ const deserializeAws_json1_0ListWorkflowTypesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -1939,8 +1921,7 @@ const deserializeAws_json1_0PollForActivityTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededFault": case "com.amazonaws.swf#LimitExceededFault": @@ -2010,8 +1991,7 @@ const deserializeAws_json1_0PollForDecisionTaskCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededFault": case "com.amazonaws.swf#LimitExceededFault": @@ -2081,8 +2061,7 @@ const deserializeAws_json1_0RecordActivityTaskHeartbeatCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -2141,8 +2120,7 @@ const deserializeAws_json1_0RegisterActivityTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededFault": case "com.amazonaws.swf#LimitExceededFault": @@ -2217,8 +2195,7 @@ const deserializeAws_json1_0RegisterDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DomainAlreadyExistsFault": case "com.amazonaws.swf#DomainAlreadyExistsFault": @@ -2293,8 +2270,7 @@ const deserializeAws_json1_0RegisterWorkflowTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededFault": case "com.amazonaws.swf#LimitExceededFault": @@ -2369,8 +2345,7 @@ const deserializeAws_json1_0RequestCancelWorkflowExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -2429,8 +2404,7 @@ const deserializeAws_json1_0RespondActivityTaskCanceledCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -2489,8 +2463,7 @@ const deserializeAws_json1_0RespondActivityTaskCompletedCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -2549,8 +2522,7 @@ const deserializeAws_json1_0RespondActivityTaskFailedCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -2609,8 +2581,7 @@ const deserializeAws_json1_0RespondDecisionTaskCompletedCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -2669,8 +2640,7 @@ const deserializeAws_json1_0SignalWorkflowExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -2732,8 +2702,7 @@ const deserializeAws_json1_0StartWorkflowExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DefaultUndefinedFault": case "com.amazonaws.swf#DefaultUndefinedFault": @@ -2824,8 +2793,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededFault": case "com.amazonaws.swf#LimitExceededFault": @@ -2900,8 +2868,7 @@ const deserializeAws_json1_0TerminateWorkflowExecutionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -2960,8 +2927,7 @@ const deserializeAws_json1_0UndeprecateActivityTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -3028,8 +2994,7 @@ const deserializeAws_json1_0UndeprecateDomainCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DomainAlreadyExistsFault": case "com.amazonaws.swf#DomainAlreadyExistsFault": @@ -3096,8 +3061,7 @@ const deserializeAws_json1_0UndeprecateWorkflowTypeCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": @@ -3164,8 +3128,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "LimitExceededFault": case "com.amazonaws.swf#LimitExceededFault": @@ -3360,8 +3323,8 @@ const deserializeAws_json1_0WorkflowExecutionAlreadyStartedFaultResponse = async const serializeAws_json1_0ActivityType = (input: ActivityType, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; @@ -3370,7 +3333,7 @@ const serializeAws_json1_0CancelTimerDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.timerId !== undefined && { timerId: input.timerId }), + ...(input.timerId !== undefined && input.timerId !== null && { timerId: input.timerId }), }; }; @@ -3379,13 +3342,13 @@ const serializeAws_json1_0CancelWorkflowExecutionDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.details !== undefined && { details: input.details }), + ...(input.details !== undefined && input.details !== null && { details: input.details }), }; }; const serializeAws_json1_0CloseStatusFilter = (input: CloseStatusFilter, context: __SerdeContext): any => { return { - ...(input.status !== undefined && { status: input.status }), + ...(input.status !== undefined && input.status !== null && { status: input.status }), }; }; @@ -3394,7 +3357,7 @@ const serializeAws_json1_0CompleteWorkflowExecutionDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.result !== undefined && { result: input.result }), + ...(input.result !== undefined && input.result !== null && { result: input.result }), }; }; @@ -3403,17 +3366,22 @@ const serializeAws_json1_0ContinueAsNewWorkflowExecutionDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.childPolicy !== undefined && { childPolicy: input.childPolicy }), - ...(input.executionStartToCloseTimeout !== undefined && { - executionStartToCloseTimeout: input.executionStartToCloseTimeout, - }), - ...(input.input !== undefined && { input: input.input }), - ...(input.lambdaRole !== undefined && { lambdaRole: input.lambdaRole }), - ...(input.tagList !== undefined && { tagList: serializeAws_json1_0TagList(input.tagList, context) }), - ...(input.taskList !== undefined && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), - ...(input.taskPriority !== undefined && { taskPriority: input.taskPriority }), - ...(input.taskStartToCloseTimeout !== undefined && { taskStartToCloseTimeout: input.taskStartToCloseTimeout }), - ...(input.workflowTypeVersion !== undefined && { workflowTypeVersion: input.workflowTypeVersion }), + ...(input.childPolicy !== undefined && input.childPolicy !== null && { childPolicy: input.childPolicy }), + ...(input.executionStartToCloseTimeout !== undefined && + input.executionStartToCloseTimeout !== null && { + executionStartToCloseTimeout: input.executionStartToCloseTimeout, + }), + ...(input.input !== undefined && input.input !== null && { input: input.input }), + ...(input.lambdaRole !== undefined && input.lambdaRole !== null && { lambdaRole: input.lambdaRole }), + ...(input.tagList !== undefined && + input.tagList !== null && { tagList: serializeAws_json1_0TagList(input.tagList, context) }), + ...(input.taskList !== undefined && + input.taskList !== null && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), + ...(input.taskPriority !== undefined && input.taskPriority !== null && { taskPriority: input.taskPriority }), + ...(input.taskStartToCloseTimeout !== undefined && + input.taskStartToCloseTimeout !== null && { taskStartToCloseTimeout: input.taskStartToCloseTimeout }), + ...(input.workflowTypeVersion !== undefined && + input.workflowTypeVersion !== null && { workflowTypeVersion: input.workflowTypeVersion }), }; }; @@ -3422,23 +3390,27 @@ const serializeAws_json1_0CountClosedWorkflowExecutionsInput = ( context: __SerdeContext ): any => { return { - ...(input.closeStatusFilter !== undefined && { - closeStatusFilter: serializeAws_json1_0CloseStatusFilter(input.closeStatusFilter, context), - }), - ...(input.closeTimeFilter !== undefined && { - closeTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.closeTimeFilter, context), - }), - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.executionFilter !== undefined && { - executionFilter: serializeAws_json1_0WorkflowExecutionFilter(input.executionFilter, context), - }), - ...(input.startTimeFilter !== undefined && { - startTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.startTimeFilter, context), - }), - ...(input.tagFilter !== undefined && { tagFilter: serializeAws_json1_0TagFilter(input.tagFilter, context) }), - ...(input.typeFilter !== undefined && { - typeFilter: serializeAws_json1_0WorkflowTypeFilter(input.typeFilter, context), - }), + ...(input.closeStatusFilter !== undefined && + input.closeStatusFilter !== null && { + closeStatusFilter: serializeAws_json1_0CloseStatusFilter(input.closeStatusFilter, context), + }), + ...(input.closeTimeFilter !== undefined && + input.closeTimeFilter !== null && { + closeTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.closeTimeFilter, context), + }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.executionFilter !== undefined && + input.executionFilter !== null && { + executionFilter: serializeAws_json1_0WorkflowExecutionFilter(input.executionFilter, context), + }), + ...(input.startTimeFilter !== undefined && + input.startTimeFilter !== null && { + startTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.startTimeFilter, context), + }), + ...(input.tagFilter !== undefined && + input.tagFilter !== null && { tagFilter: serializeAws_json1_0TagFilter(input.tagFilter, context) }), + ...(input.typeFilter !== undefined && + input.typeFilter !== null && { typeFilter: serializeAws_json1_0WorkflowTypeFilter(input.typeFilter, context) }), }; }; @@ -3447,17 +3419,19 @@ const serializeAws_json1_0CountOpenWorkflowExecutionsInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.executionFilter !== undefined && { - executionFilter: serializeAws_json1_0WorkflowExecutionFilter(input.executionFilter, context), - }), - ...(input.startTimeFilter !== undefined && { - startTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.startTimeFilter, context), - }), - ...(input.tagFilter !== undefined && { tagFilter: serializeAws_json1_0TagFilter(input.tagFilter, context) }), - ...(input.typeFilter !== undefined && { - typeFilter: serializeAws_json1_0WorkflowTypeFilter(input.typeFilter, context), - }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.executionFilter !== undefined && + input.executionFilter !== null && { + executionFilter: serializeAws_json1_0WorkflowExecutionFilter(input.executionFilter, context), + }), + ...(input.startTimeFilter !== undefined && + input.startTimeFilter !== null && { + startTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.startTimeFilter, context), + }), + ...(input.tagFilter !== undefined && + input.tagFilter !== null && { tagFilter: serializeAws_json1_0TagFilter(input.tagFilter, context) }), + ...(input.typeFilter !== undefined && + input.typeFilter !== null && { typeFilter: serializeAws_json1_0WorkflowTypeFilter(input.typeFilter, context) }), }; }; @@ -3466,8 +3440,9 @@ const serializeAws_json1_0CountPendingActivityTasksInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.taskList !== undefined && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.taskList !== undefined && + input.taskList !== null && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), }; }; @@ -3476,97 +3451,118 @@ const serializeAws_json1_0CountPendingDecisionTasksInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.taskList !== undefined && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.taskList !== undefined && + input.taskList !== null && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), }; }; const serializeAws_json1_0Decision = (input: Decision, context: __SerdeContext): any => { return { - ...(input.cancelTimerDecisionAttributes !== undefined && { - cancelTimerDecisionAttributes: serializeAws_json1_0CancelTimerDecisionAttributes( - input.cancelTimerDecisionAttributes, - context - ), - }), - ...(input.cancelWorkflowExecutionDecisionAttributes !== undefined && { - cancelWorkflowExecutionDecisionAttributes: serializeAws_json1_0CancelWorkflowExecutionDecisionAttributes( - input.cancelWorkflowExecutionDecisionAttributes, - context - ), - }), - ...(input.completeWorkflowExecutionDecisionAttributes !== undefined && { - completeWorkflowExecutionDecisionAttributes: serializeAws_json1_0CompleteWorkflowExecutionDecisionAttributes( - input.completeWorkflowExecutionDecisionAttributes, - context - ), - }), - ...(input.continueAsNewWorkflowExecutionDecisionAttributes !== undefined && { - continueAsNewWorkflowExecutionDecisionAttributes: serializeAws_json1_0ContinueAsNewWorkflowExecutionDecisionAttributes( - input.continueAsNewWorkflowExecutionDecisionAttributes, - context - ), - }), - ...(input.decisionType !== undefined && { decisionType: input.decisionType }), - ...(input.failWorkflowExecutionDecisionAttributes !== undefined && { - failWorkflowExecutionDecisionAttributes: serializeAws_json1_0FailWorkflowExecutionDecisionAttributes( - input.failWorkflowExecutionDecisionAttributes, - context - ), - }), - ...(input.recordMarkerDecisionAttributes !== undefined && { - recordMarkerDecisionAttributes: serializeAws_json1_0RecordMarkerDecisionAttributes( - input.recordMarkerDecisionAttributes, - context - ), - }), - ...(input.requestCancelActivityTaskDecisionAttributes !== undefined && { - requestCancelActivityTaskDecisionAttributes: serializeAws_json1_0RequestCancelActivityTaskDecisionAttributes( - input.requestCancelActivityTaskDecisionAttributes, - context - ), - }), - ...(input.requestCancelExternalWorkflowExecutionDecisionAttributes !== undefined && { - requestCancelExternalWorkflowExecutionDecisionAttributes: serializeAws_json1_0RequestCancelExternalWorkflowExecutionDecisionAttributes( - input.requestCancelExternalWorkflowExecutionDecisionAttributes, - context - ), - }), - ...(input.scheduleActivityTaskDecisionAttributes !== undefined && { - scheduleActivityTaskDecisionAttributes: serializeAws_json1_0ScheduleActivityTaskDecisionAttributes( - input.scheduleActivityTaskDecisionAttributes, - context - ), - }), - ...(input.scheduleLambdaFunctionDecisionAttributes !== undefined && { - scheduleLambdaFunctionDecisionAttributes: serializeAws_json1_0ScheduleLambdaFunctionDecisionAttributes( - input.scheduleLambdaFunctionDecisionAttributes, - context - ), - }), - ...(input.signalExternalWorkflowExecutionDecisionAttributes !== undefined && { - signalExternalWorkflowExecutionDecisionAttributes: serializeAws_json1_0SignalExternalWorkflowExecutionDecisionAttributes( - input.signalExternalWorkflowExecutionDecisionAttributes, - context - ), - }), - ...(input.startChildWorkflowExecutionDecisionAttributes !== undefined && { - startChildWorkflowExecutionDecisionAttributes: serializeAws_json1_0StartChildWorkflowExecutionDecisionAttributes( - input.startChildWorkflowExecutionDecisionAttributes, - context - ), - }), - ...(input.startTimerDecisionAttributes !== undefined && { - startTimerDecisionAttributes: serializeAws_json1_0StartTimerDecisionAttributes( - input.startTimerDecisionAttributes, - context - ), - }), + ...(input.cancelTimerDecisionAttributes !== undefined && + input.cancelTimerDecisionAttributes !== null && { + cancelTimerDecisionAttributes: serializeAws_json1_0CancelTimerDecisionAttributes( + input.cancelTimerDecisionAttributes, + context + ), + }), + ...(input.cancelWorkflowExecutionDecisionAttributes !== undefined && + input.cancelWorkflowExecutionDecisionAttributes !== null && { + cancelWorkflowExecutionDecisionAttributes: serializeAws_json1_0CancelWorkflowExecutionDecisionAttributes( + input.cancelWorkflowExecutionDecisionAttributes, + context + ), + }), + ...(input.completeWorkflowExecutionDecisionAttributes !== undefined && + input.completeWorkflowExecutionDecisionAttributes !== null && { + completeWorkflowExecutionDecisionAttributes: serializeAws_json1_0CompleteWorkflowExecutionDecisionAttributes( + input.completeWorkflowExecutionDecisionAttributes, + context + ), + }), + ...(input.continueAsNewWorkflowExecutionDecisionAttributes !== undefined && + input.continueAsNewWorkflowExecutionDecisionAttributes !== null && { + continueAsNewWorkflowExecutionDecisionAttributes: serializeAws_json1_0ContinueAsNewWorkflowExecutionDecisionAttributes( + input.continueAsNewWorkflowExecutionDecisionAttributes, + context + ), + }), + ...(input.decisionType !== undefined && input.decisionType !== null && { decisionType: input.decisionType }), + ...(input.failWorkflowExecutionDecisionAttributes !== undefined && + input.failWorkflowExecutionDecisionAttributes !== null && { + failWorkflowExecutionDecisionAttributes: serializeAws_json1_0FailWorkflowExecutionDecisionAttributes( + input.failWorkflowExecutionDecisionAttributes, + context + ), + }), + ...(input.recordMarkerDecisionAttributes !== undefined && + input.recordMarkerDecisionAttributes !== null && { + recordMarkerDecisionAttributes: serializeAws_json1_0RecordMarkerDecisionAttributes( + input.recordMarkerDecisionAttributes, + context + ), + }), + ...(input.requestCancelActivityTaskDecisionAttributes !== undefined && + input.requestCancelActivityTaskDecisionAttributes !== null && { + requestCancelActivityTaskDecisionAttributes: serializeAws_json1_0RequestCancelActivityTaskDecisionAttributes( + input.requestCancelActivityTaskDecisionAttributes, + context + ), + }), + ...(input.requestCancelExternalWorkflowExecutionDecisionAttributes !== undefined && + input.requestCancelExternalWorkflowExecutionDecisionAttributes !== null && { + requestCancelExternalWorkflowExecutionDecisionAttributes: serializeAws_json1_0RequestCancelExternalWorkflowExecutionDecisionAttributes( + input.requestCancelExternalWorkflowExecutionDecisionAttributes, + context + ), + }), + ...(input.scheduleActivityTaskDecisionAttributes !== undefined && + input.scheduleActivityTaskDecisionAttributes !== null && { + scheduleActivityTaskDecisionAttributes: serializeAws_json1_0ScheduleActivityTaskDecisionAttributes( + input.scheduleActivityTaskDecisionAttributes, + context + ), + }), + ...(input.scheduleLambdaFunctionDecisionAttributes !== undefined && + input.scheduleLambdaFunctionDecisionAttributes !== null && { + scheduleLambdaFunctionDecisionAttributes: serializeAws_json1_0ScheduleLambdaFunctionDecisionAttributes( + input.scheduleLambdaFunctionDecisionAttributes, + context + ), + }), + ...(input.signalExternalWorkflowExecutionDecisionAttributes !== undefined && + input.signalExternalWorkflowExecutionDecisionAttributes !== null && { + signalExternalWorkflowExecutionDecisionAttributes: serializeAws_json1_0SignalExternalWorkflowExecutionDecisionAttributes( + input.signalExternalWorkflowExecutionDecisionAttributes, + context + ), + }), + ...(input.startChildWorkflowExecutionDecisionAttributes !== undefined && + input.startChildWorkflowExecutionDecisionAttributes !== null && { + startChildWorkflowExecutionDecisionAttributes: serializeAws_json1_0StartChildWorkflowExecutionDecisionAttributes( + input.startChildWorkflowExecutionDecisionAttributes, + context + ), + }), + ...(input.startTimerDecisionAttributes !== undefined && + input.startTimerDecisionAttributes !== null && { + startTimerDecisionAttributes: serializeAws_json1_0StartTimerDecisionAttributes( + input.startTimerDecisionAttributes, + context + ), + }), }; }; const serializeAws_json1_0DecisionList = (input: Decision[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Decision(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Decision(entry, context); + }); }; const serializeAws_json1_0DeprecateActivityTypeInput = ( @@ -3574,16 +3570,15 @@ const serializeAws_json1_0DeprecateActivityTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.activityType !== undefined && { - activityType: serializeAws_json1_0ActivityType(input.activityType, context), - }), - ...(input.domain !== undefined && { domain: input.domain }), + ...(input.activityType !== undefined && + input.activityType !== null && { activityType: serializeAws_json1_0ActivityType(input.activityType, context) }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), }; }; const serializeAws_json1_0DeprecateDomainInput = (input: DeprecateDomainInput, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -3592,10 +3587,9 @@ const serializeAws_json1_0DeprecateWorkflowTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.workflowType !== undefined && { - workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context), - }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.workflowType !== undefined && + input.workflowType !== null && { workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context) }), }; }; @@ -3604,16 +3598,15 @@ const serializeAws_json1_0DescribeActivityTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.activityType !== undefined && { - activityType: serializeAws_json1_0ActivityType(input.activityType, context), - }), - ...(input.domain !== undefined && { domain: input.domain }), + ...(input.activityType !== undefined && + input.activityType !== null && { activityType: serializeAws_json1_0ActivityType(input.activityType, context) }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), }; }; const serializeAws_json1_0DescribeDomainInput = (input: DescribeDomainInput, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -3622,10 +3615,9 @@ const serializeAws_json1_0DescribeWorkflowExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.execution !== undefined && { - execution: serializeAws_json1_0WorkflowExecution(input.execution, context), - }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.execution !== undefined && + input.execution !== null && { execution: serializeAws_json1_0WorkflowExecution(input.execution, context) }), }; }; @@ -3634,17 +3626,18 @@ const serializeAws_json1_0DescribeWorkflowTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.workflowType !== undefined && { - workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context), - }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.workflowType !== undefined && + input.workflowType !== null && { workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context) }), }; }; const serializeAws_json1_0ExecutionTimeFilter = (input: ExecutionTimeFilter, context: __SerdeContext): any => { return { - ...(input.latestDate !== undefined && { latestDate: Math.round(input.latestDate.getTime() / 1000) }), - ...(input.oldestDate !== undefined && { oldestDate: Math.round(input.oldestDate.getTime() / 1000) }), + ...(input.latestDate !== undefined && + input.latestDate !== null && { latestDate: Math.round(input.latestDate.getTime() / 1000) }), + ...(input.oldestDate !== undefined && + input.oldestDate !== null && { oldestDate: Math.round(input.oldestDate.getTime() / 1000) }), }; }; @@ -3653,8 +3646,8 @@ const serializeAws_json1_0FailWorkflowExecutionDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.details !== undefined && { details: input.details }), - ...(input.reason !== undefined && { reason: input.reason }), + ...(input.details !== undefined && input.details !== null && { details: input.details }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), }; }; @@ -3663,24 +3656,26 @@ const serializeAws_json1_0GetWorkflowExecutionHistoryInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.execution !== undefined && { - execution: serializeAws_json1_0WorkflowExecution(input.execution, context), - }), - ...(input.maximumPageSize !== undefined && { maximumPageSize: input.maximumPageSize }), - ...(input.nextPageToken !== undefined && { nextPageToken: input.nextPageToken }), - ...(input.reverseOrder !== undefined && { reverseOrder: input.reverseOrder }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.execution !== undefined && + input.execution !== null && { execution: serializeAws_json1_0WorkflowExecution(input.execution, context) }), + ...(input.maximumPageSize !== undefined && + input.maximumPageSize !== null && { maximumPageSize: input.maximumPageSize }), + ...(input.nextPageToken !== undefined && input.nextPageToken !== null && { nextPageToken: input.nextPageToken }), + ...(input.reverseOrder !== undefined && input.reverseOrder !== null && { reverseOrder: input.reverseOrder }), }; }; const serializeAws_json1_0ListActivityTypesInput = (input: ListActivityTypesInput, context: __SerdeContext): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.maximumPageSize !== undefined && { maximumPageSize: input.maximumPageSize }), - ...(input.name !== undefined && { name: input.name }), - ...(input.nextPageToken !== undefined && { nextPageToken: input.nextPageToken }), - ...(input.registrationStatus !== undefined && { registrationStatus: input.registrationStatus }), - ...(input.reverseOrder !== undefined && { reverseOrder: input.reverseOrder }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.maximumPageSize !== undefined && + input.maximumPageSize !== null && { maximumPageSize: input.maximumPageSize }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.nextPageToken !== undefined && input.nextPageToken !== null && { nextPageToken: input.nextPageToken }), + ...(input.registrationStatus !== undefined && + input.registrationStatus !== null && { registrationStatus: input.registrationStatus }), + ...(input.reverseOrder !== undefined && input.reverseOrder !== null && { reverseOrder: input.reverseOrder }), }; }; @@ -3689,35 +3684,42 @@ const serializeAws_json1_0ListClosedWorkflowExecutionsInput = ( context: __SerdeContext ): any => { return { - ...(input.closeStatusFilter !== undefined && { - closeStatusFilter: serializeAws_json1_0CloseStatusFilter(input.closeStatusFilter, context), - }), - ...(input.closeTimeFilter !== undefined && { - closeTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.closeTimeFilter, context), - }), - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.executionFilter !== undefined && { - executionFilter: serializeAws_json1_0WorkflowExecutionFilter(input.executionFilter, context), - }), - ...(input.maximumPageSize !== undefined && { maximumPageSize: input.maximumPageSize }), - ...(input.nextPageToken !== undefined && { nextPageToken: input.nextPageToken }), - ...(input.reverseOrder !== undefined && { reverseOrder: input.reverseOrder }), - ...(input.startTimeFilter !== undefined && { - startTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.startTimeFilter, context), - }), - ...(input.tagFilter !== undefined && { tagFilter: serializeAws_json1_0TagFilter(input.tagFilter, context) }), - ...(input.typeFilter !== undefined && { - typeFilter: serializeAws_json1_0WorkflowTypeFilter(input.typeFilter, context), - }), + ...(input.closeStatusFilter !== undefined && + input.closeStatusFilter !== null && { + closeStatusFilter: serializeAws_json1_0CloseStatusFilter(input.closeStatusFilter, context), + }), + ...(input.closeTimeFilter !== undefined && + input.closeTimeFilter !== null && { + closeTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.closeTimeFilter, context), + }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.executionFilter !== undefined && + input.executionFilter !== null && { + executionFilter: serializeAws_json1_0WorkflowExecutionFilter(input.executionFilter, context), + }), + ...(input.maximumPageSize !== undefined && + input.maximumPageSize !== null && { maximumPageSize: input.maximumPageSize }), + ...(input.nextPageToken !== undefined && input.nextPageToken !== null && { nextPageToken: input.nextPageToken }), + ...(input.reverseOrder !== undefined && input.reverseOrder !== null && { reverseOrder: input.reverseOrder }), + ...(input.startTimeFilter !== undefined && + input.startTimeFilter !== null && { + startTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.startTimeFilter, context), + }), + ...(input.tagFilter !== undefined && + input.tagFilter !== null && { tagFilter: serializeAws_json1_0TagFilter(input.tagFilter, context) }), + ...(input.typeFilter !== undefined && + input.typeFilter !== null && { typeFilter: serializeAws_json1_0WorkflowTypeFilter(input.typeFilter, context) }), }; }; const serializeAws_json1_0ListDomainsInput = (input: ListDomainsInput, context: __SerdeContext): any => { return { - ...(input.maximumPageSize !== undefined && { maximumPageSize: input.maximumPageSize }), - ...(input.nextPageToken !== undefined && { nextPageToken: input.nextPageToken }), - ...(input.registrationStatus !== undefined && { registrationStatus: input.registrationStatus }), - ...(input.reverseOrder !== undefined && { reverseOrder: input.reverseOrder }), + ...(input.maximumPageSize !== undefined && + input.maximumPageSize !== null && { maximumPageSize: input.maximumPageSize }), + ...(input.nextPageToken !== undefined && input.nextPageToken !== null && { nextPageToken: input.nextPageToken }), + ...(input.registrationStatus !== undefined && + input.registrationStatus !== null && { registrationStatus: input.registrationStatus }), + ...(input.reverseOrder !== undefined && input.reverseOrder !== null && { reverseOrder: input.reverseOrder }), }; }; @@ -3726,20 +3728,23 @@ const serializeAws_json1_0ListOpenWorkflowExecutionsInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.executionFilter !== undefined && { - executionFilter: serializeAws_json1_0WorkflowExecutionFilter(input.executionFilter, context), - }), - ...(input.maximumPageSize !== undefined && { maximumPageSize: input.maximumPageSize }), - ...(input.nextPageToken !== undefined && { nextPageToken: input.nextPageToken }), - ...(input.reverseOrder !== undefined && { reverseOrder: input.reverseOrder }), - ...(input.startTimeFilter !== undefined && { - startTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.startTimeFilter, context), - }), - ...(input.tagFilter !== undefined && { tagFilter: serializeAws_json1_0TagFilter(input.tagFilter, context) }), - ...(input.typeFilter !== undefined && { - typeFilter: serializeAws_json1_0WorkflowTypeFilter(input.typeFilter, context), - }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.executionFilter !== undefined && + input.executionFilter !== null && { + executionFilter: serializeAws_json1_0WorkflowExecutionFilter(input.executionFilter, context), + }), + ...(input.maximumPageSize !== undefined && + input.maximumPageSize !== null && { maximumPageSize: input.maximumPageSize }), + ...(input.nextPageToken !== undefined && input.nextPageToken !== null && { nextPageToken: input.nextPageToken }), + ...(input.reverseOrder !== undefined && input.reverseOrder !== null && { reverseOrder: input.reverseOrder }), + ...(input.startTimeFilter !== undefined && + input.startTimeFilter !== null && { + startTimeFilter: serializeAws_json1_0ExecutionTimeFilter(input.startTimeFilter, context), + }), + ...(input.tagFilter !== undefined && + input.tagFilter !== null && { tagFilter: serializeAws_json1_0TagFilter(input.tagFilter, context) }), + ...(input.typeFilter !== undefined && + input.typeFilter !== null && { typeFilter: serializeAws_json1_0WorkflowTypeFilter(input.typeFilter, context) }), }; }; @@ -3748,18 +3753,20 @@ const serializeAws_json1_0ListTagsForResourceInput = ( context: __SerdeContext ): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), }; }; const serializeAws_json1_0ListWorkflowTypesInput = (input: ListWorkflowTypesInput, context: __SerdeContext): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.maximumPageSize !== undefined && { maximumPageSize: input.maximumPageSize }), - ...(input.name !== undefined && { name: input.name }), - ...(input.nextPageToken !== undefined && { nextPageToken: input.nextPageToken }), - ...(input.registrationStatus !== undefined && { registrationStatus: input.registrationStatus }), - ...(input.reverseOrder !== undefined && { reverseOrder: input.reverseOrder }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.maximumPageSize !== undefined && + input.maximumPageSize !== null && { maximumPageSize: input.maximumPageSize }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.nextPageToken !== undefined && input.nextPageToken !== null && { nextPageToken: input.nextPageToken }), + ...(input.registrationStatus !== undefined && + input.registrationStatus !== null && { registrationStatus: input.registrationStatus }), + ...(input.reverseOrder !== undefined && input.reverseOrder !== null && { reverseOrder: input.reverseOrder }), }; }; @@ -3768,9 +3775,10 @@ const serializeAws_json1_0PollForActivityTaskInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.identity !== undefined && { identity: input.identity }), - ...(input.taskList !== undefined && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.identity !== undefined && input.identity !== null && { identity: input.identity }), + ...(input.taskList !== undefined && + input.taskList !== null && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), }; }; @@ -3779,12 +3787,14 @@ const serializeAws_json1_0PollForDecisionTaskInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.identity !== undefined && { identity: input.identity }), - ...(input.maximumPageSize !== undefined && { maximumPageSize: input.maximumPageSize }), - ...(input.nextPageToken !== undefined && { nextPageToken: input.nextPageToken }), - ...(input.reverseOrder !== undefined && { reverseOrder: input.reverseOrder }), - ...(input.taskList !== undefined && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.identity !== undefined && input.identity !== null && { identity: input.identity }), + ...(input.maximumPageSize !== undefined && + input.maximumPageSize !== null && { maximumPageSize: input.maximumPageSize }), + ...(input.nextPageToken !== undefined && input.nextPageToken !== null && { nextPageToken: input.nextPageToken }), + ...(input.reverseOrder !== undefined && input.reverseOrder !== null && { reverseOrder: input.reverseOrder }), + ...(input.taskList !== undefined && + input.taskList !== null && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), }; }; @@ -3793,8 +3803,8 @@ const serializeAws_json1_0RecordActivityTaskHeartbeatInput = ( context: __SerdeContext ): any => { return { - ...(input.details !== undefined && { details: input.details }), - ...(input.taskToken !== undefined && { taskToken: input.taskToken }), + ...(input.details !== undefined && input.details !== null && { details: input.details }), + ...(input.taskToken !== undefined && input.taskToken !== null && { taskToken: input.taskToken }), }; }; @@ -3803,8 +3813,8 @@ const serializeAws_json1_0RecordMarkerDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.details !== undefined && { details: input.details }), - ...(input.markerName !== undefined && { markerName: input.markerName }), + ...(input.details !== undefined && input.details !== null && { details: input.details }), + ...(input.markerName !== undefined && input.markerName !== null && { markerName: input.markerName }), }; }; @@ -3813,37 +3823,43 @@ const serializeAws_json1_0RegisterActivityTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.defaultTaskHeartbeatTimeout !== undefined && { - defaultTaskHeartbeatTimeout: input.defaultTaskHeartbeatTimeout, - }), - ...(input.defaultTaskList !== undefined && { - defaultTaskList: serializeAws_json1_0TaskList(input.defaultTaskList, context), - }), - ...(input.defaultTaskPriority !== undefined && { defaultTaskPriority: input.defaultTaskPriority }), - ...(input.defaultTaskScheduleToCloseTimeout !== undefined && { - defaultTaskScheduleToCloseTimeout: input.defaultTaskScheduleToCloseTimeout, - }), - ...(input.defaultTaskScheduleToStartTimeout !== undefined && { - defaultTaskScheduleToStartTimeout: input.defaultTaskScheduleToStartTimeout, - }), - ...(input.defaultTaskStartToCloseTimeout !== undefined && { - defaultTaskStartToCloseTimeout: input.defaultTaskStartToCloseTimeout, - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.defaultTaskHeartbeatTimeout !== undefined && + input.defaultTaskHeartbeatTimeout !== null && { defaultTaskHeartbeatTimeout: input.defaultTaskHeartbeatTimeout }), + ...(input.defaultTaskList !== undefined && + input.defaultTaskList !== null && { + defaultTaskList: serializeAws_json1_0TaskList(input.defaultTaskList, context), + }), + ...(input.defaultTaskPriority !== undefined && + input.defaultTaskPriority !== null && { defaultTaskPriority: input.defaultTaskPriority }), + ...(input.defaultTaskScheduleToCloseTimeout !== undefined && + input.defaultTaskScheduleToCloseTimeout !== null && { + defaultTaskScheduleToCloseTimeout: input.defaultTaskScheduleToCloseTimeout, + }), + ...(input.defaultTaskScheduleToStartTimeout !== undefined && + input.defaultTaskScheduleToStartTimeout !== null && { + defaultTaskScheduleToStartTimeout: input.defaultTaskScheduleToStartTimeout, + }), + ...(input.defaultTaskStartToCloseTimeout !== undefined && + input.defaultTaskStartToCloseTimeout !== null && { + defaultTaskStartToCloseTimeout: input.defaultTaskStartToCloseTimeout, + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_json1_0RegisterDomainInput = (input: RegisterDomainInput, context: __SerdeContext): any => { return { - ...(input.description !== undefined && { description: input.description }), - ...(input.name !== undefined && { name: input.name }), - ...(input.tags !== undefined && { tags: serializeAws_json1_0ResourceTagList(input.tags, context) }), - ...(input.workflowExecutionRetentionPeriodInDays !== undefined && { - workflowExecutionRetentionPeriodInDays: input.workflowExecutionRetentionPeriodInDays, - }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_json1_0ResourceTagList(input.tags, context) }), + ...(input.workflowExecutionRetentionPeriodInDays !== undefined && + input.workflowExecutionRetentionPeriodInDays !== null && { + workflowExecutionRetentionPeriodInDays: input.workflowExecutionRetentionPeriodInDays, + }), }; }; @@ -3852,22 +3868,28 @@ const serializeAws_json1_0RegisterWorkflowTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.defaultChildPolicy !== undefined && { defaultChildPolicy: input.defaultChildPolicy }), - ...(input.defaultExecutionStartToCloseTimeout !== undefined && { - defaultExecutionStartToCloseTimeout: input.defaultExecutionStartToCloseTimeout, - }), - ...(input.defaultLambdaRole !== undefined && { defaultLambdaRole: input.defaultLambdaRole }), - ...(input.defaultTaskList !== undefined && { - defaultTaskList: serializeAws_json1_0TaskList(input.defaultTaskList, context), - }), - ...(input.defaultTaskPriority !== undefined && { defaultTaskPriority: input.defaultTaskPriority }), - ...(input.defaultTaskStartToCloseTimeout !== undefined && { - defaultTaskStartToCloseTimeout: input.defaultTaskStartToCloseTimeout, - }), - ...(input.description !== undefined && { description: input.description }), - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.defaultChildPolicy !== undefined && + input.defaultChildPolicy !== null && { defaultChildPolicy: input.defaultChildPolicy }), + ...(input.defaultExecutionStartToCloseTimeout !== undefined && + input.defaultExecutionStartToCloseTimeout !== null && { + defaultExecutionStartToCloseTimeout: input.defaultExecutionStartToCloseTimeout, + }), + ...(input.defaultLambdaRole !== undefined && + input.defaultLambdaRole !== null && { defaultLambdaRole: input.defaultLambdaRole }), + ...(input.defaultTaskList !== undefined && + input.defaultTaskList !== null && { + defaultTaskList: serializeAws_json1_0TaskList(input.defaultTaskList, context), + }), + ...(input.defaultTaskPriority !== undefined && + input.defaultTaskPriority !== null && { defaultTaskPriority: input.defaultTaskPriority }), + ...(input.defaultTaskStartToCloseTimeout !== undefined && + input.defaultTaskStartToCloseTimeout !== null && { + defaultTaskStartToCloseTimeout: input.defaultTaskStartToCloseTimeout, + }), + ...(input.description !== undefined && input.description !== null && { description: input.description }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; @@ -3876,7 +3898,7 @@ const serializeAws_json1_0RequestCancelActivityTaskDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.activityId !== undefined && { activityId: input.activityId }), + ...(input.activityId !== undefined && input.activityId !== null && { activityId: input.activityId }), }; }; @@ -3885,9 +3907,9 @@ const serializeAws_json1_0RequestCancelExternalWorkflowExecutionDecisionAttribut context: __SerdeContext ): any => { return { - ...(input.control !== undefined && { control: input.control }), - ...(input.runId !== undefined && { runId: input.runId }), - ...(input.workflowId !== undefined && { workflowId: input.workflowId }), + ...(input.control !== undefined && input.control !== null && { control: input.control }), + ...(input.runId !== undefined && input.runId !== null && { runId: input.runId }), + ...(input.workflowId !== undefined && input.workflowId !== null && { workflowId: input.workflowId }), }; }; @@ -3896,25 +3918,39 @@ const serializeAws_json1_0RequestCancelWorkflowExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.runId !== undefined && { runId: input.runId }), - ...(input.workflowId !== undefined && { workflowId: input.workflowId }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.runId !== undefined && input.runId !== null && { runId: input.runId }), + ...(input.workflowId !== undefined && input.workflowId !== null && { workflowId: input.workflowId }), }; }; const serializeAws_json1_0ResourceTag = (input: ResourceTag, context: __SerdeContext): any => { return { - ...(input.key !== undefined && { key: input.key }), - ...(input.value !== undefined && { value: input.value }), + ...(input.key !== undefined && input.key !== null && { key: input.key }), + ...(input.value !== undefined && input.value !== null && { value: input.value }), }; }; const serializeAws_json1_0ResourceTagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0ResourceTagList = (input: ResourceTag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0ResourceTag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0ResourceTag(entry, context); + }); }; const serializeAws_json1_0RespondActivityTaskCanceledInput = ( @@ -3922,8 +3958,8 @@ const serializeAws_json1_0RespondActivityTaskCanceledInput = ( context: __SerdeContext ): any => { return { - ...(input.details !== undefined && { details: input.details }), - ...(input.taskToken !== undefined && { taskToken: input.taskToken }), + ...(input.details !== undefined && input.details !== null && { details: input.details }), + ...(input.taskToken !== undefined && input.taskToken !== null && { taskToken: input.taskToken }), }; }; @@ -3932,8 +3968,8 @@ const serializeAws_json1_0RespondActivityTaskCompletedInput = ( context: __SerdeContext ): any => { return { - ...(input.result !== undefined && { result: input.result }), - ...(input.taskToken !== undefined && { taskToken: input.taskToken }), + ...(input.result !== undefined && input.result !== null && { result: input.result }), + ...(input.taskToken !== undefined && input.taskToken !== null && { taskToken: input.taskToken }), }; }; @@ -3942,9 +3978,9 @@ const serializeAws_json1_0RespondActivityTaskFailedInput = ( context: __SerdeContext ): any => { return { - ...(input.details !== undefined && { details: input.details }), - ...(input.reason !== undefined && { reason: input.reason }), - ...(input.taskToken !== undefined && { taskToken: input.taskToken }), + ...(input.details !== undefined && input.details !== null && { details: input.details }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), + ...(input.taskToken !== undefined && input.taskToken !== null && { taskToken: input.taskToken }), }; }; @@ -3953,9 +3989,11 @@ const serializeAws_json1_0RespondDecisionTaskCompletedInput = ( context: __SerdeContext ): any => { return { - ...(input.decisions !== undefined && { decisions: serializeAws_json1_0DecisionList(input.decisions, context) }), - ...(input.executionContext !== undefined && { executionContext: input.executionContext }), - ...(input.taskToken !== undefined && { taskToken: input.taskToken }), + ...(input.decisions !== undefined && + input.decisions !== null && { decisions: serializeAws_json1_0DecisionList(input.decisions, context) }), + ...(input.executionContext !== undefined && + input.executionContext !== null && { executionContext: input.executionContext }), + ...(input.taskToken !== undefined && input.taskToken !== null && { taskToken: input.taskToken }), }; }; @@ -3964,18 +4002,22 @@ const serializeAws_json1_0ScheduleActivityTaskDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.activityId !== undefined && { activityId: input.activityId }), - ...(input.activityType !== undefined && { - activityType: serializeAws_json1_0ActivityType(input.activityType, context), - }), - ...(input.control !== undefined && { control: input.control }), - ...(input.heartbeatTimeout !== undefined && { heartbeatTimeout: input.heartbeatTimeout }), - ...(input.input !== undefined && { input: input.input }), - ...(input.scheduleToCloseTimeout !== undefined && { scheduleToCloseTimeout: input.scheduleToCloseTimeout }), - ...(input.scheduleToStartTimeout !== undefined && { scheduleToStartTimeout: input.scheduleToStartTimeout }), - ...(input.startToCloseTimeout !== undefined && { startToCloseTimeout: input.startToCloseTimeout }), - ...(input.taskList !== undefined && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), - ...(input.taskPriority !== undefined && { taskPriority: input.taskPriority }), + ...(input.activityId !== undefined && input.activityId !== null && { activityId: input.activityId }), + ...(input.activityType !== undefined && + input.activityType !== null && { activityType: serializeAws_json1_0ActivityType(input.activityType, context) }), + ...(input.control !== undefined && input.control !== null && { control: input.control }), + ...(input.heartbeatTimeout !== undefined && + input.heartbeatTimeout !== null && { heartbeatTimeout: input.heartbeatTimeout }), + ...(input.input !== undefined && input.input !== null && { input: input.input }), + ...(input.scheduleToCloseTimeout !== undefined && + input.scheduleToCloseTimeout !== null && { scheduleToCloseTimeout: input.scheduleToCloseTimeout }), + ...(input.scheduleToStartTimeout !== undefined && + input.scheduleToStartTimeout !== null && { scheduleToStartTimeout: input.scheduleToStartTimeout }), + ...(input.startToCloseTimeout !== undefined && + input.startToCloseTimeout !== null && { startToCloseTimeout: input.startToCloseTimeout }), + ...(input.taskList !== undefined && + input.taskList !== null && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), + ...(input.taskPriority !== undefined && input.taskPriority !== null && { taskPriority: input.taskPriority }), }; }; @@ -3984,11 +4026,12 @@ const serializeAws_json1_0ScheduleLambdaFunctionDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.control !== undefined && { control: input.control }), - ...(input.id !== undefined && { id: input.id }), - ...(input.input !== undefined && { input: input.input }), - ...(input.name !== undefined && { name: input.name }), - ...(input.startToCloseTimeout !== undefined && { startToCloseTimeout: input.startToCloseTimeout }), + ...(input.control !== undefined && input.control !== null && { control: input.control }), + ...(input.id !== undefined && input.id !== null && { id: input.id }), + ...(input.input !== undefined && input.input !== null && { input: input.input }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.startToCloseTimeout !== undefined && + input.startToCloseTimeout !== null && { startToCloseTimeout: input.startToCloseTimeout }), }; }; @@ -3997,11 +4040,11 @@ const serializeAws_json1_0SignalExternalWorkflowExecutionDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.control !== undefined && { control: input.control }), - ...(input.input !== undefined && { input: input.input }), - ...(input.runId !== undefined && { runId: input.runId }), - ...(input.signalName !== undefined && { signalName: input.signalName }), - ...(input.workflowId !== undefined && { workflowId: input.workflowId }), + ...(input.control !== undefined && input.control !== null && { control: input.control }), + ...(input.input !== undefined && input.input !== null && { input: input.input }), + ...(input.runId !== undefined && input.runId !== null && { runId: input.runId }), + ...(input.signalName !== undefined && input.signalName !== null && { signalName: input.signalName }), + ...(input.workflowId !== undefined && input.workflowId !== null && { workflowId: input.workflowId }), }; }; @@ -4010,11 +4053,11 @@ const serializeAws_json1_0SignalWorkflowExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.input !== undefined && { input: input.input }), - ...(input.runId !== undefined && { runId: input.runId }), - ...(input.signalName !== undefined && { signalName: input.signalName }), - ...(input.workflowId !== undefined && { workflowId: input.workflowId }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.input !== undefined && input.input !== null && { input: input.input }), + ...(input.runId !== undefined && input.runId !== null && { runId: input.runId }), + ...(input.signalName !== undefined && input.signalName !== null && { signalName: input.signalName }), + ...(input.workflowId !== undefined && input.workflowId !== null && { workflowId: input.workflowId }), }; }; @@ -4023,21 +4066,24 @@ const serializeAws_json1_0StartChildWorkflowExecutionDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.childPolicy !== undefined && { childPolicy: input.childPolicy }), - ...(input.control !== undefined && { control: input.control }), - ...(input.executionStartToCloseTimeout !== undefined && { - executionStartToCloseTimeout: input.executionStartToCloseTimeout, - }), - ...(input.input !== undefined && { input: input.input }), - ...(input.lambdaRole !== undefined && { lambdaRole: input.lambdaRole }), - ...(input.tagList !== undefined && { tagList: serializeAws_json1_0TagList(input.tagList, context) }), - ...(input.taskList !== undefined && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), - ...(input.taskPriority !== undefined && { taskPriority: input.taskPriority }), - ...(input.taskStartToCloseTimeout !== undefined && { taskStartToCloseTimeout: input.taskStartToCloseTimeout }), - ...(input.workflowId !== undefined && { workflowId: input.workflowId }), - ...(input.workflowType !== undefined && { - workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context), - }), + ...(input.childPolicy !== undefined && input.childPolicy !== null && { childPolicy: input.childPolicy }), + ...(input.control !== undefined && input.control !== null && { control: input.control }), + ...(input.executionStartToCloseTimeout !== undefined && + input.executionStartToCloseTimeout !== null && { + executionStartToCloseTimeout: input.executionStartToCloseTimeout, + }), + ...(input.input !== undefined && input.input !== null && { input: input.input }), + ...(input.lambdaRole !== undefined && input.lambdaRole !== null && { lambdaRole: input.lambdaRole }), + ...(input.tagList !== undefined && + input.tagList !== null && { tagList: serializeAws_json1_0TagList(input.tagList, context) }), + ...(input.taskList !== undefined && + input.taskList !== null && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), + ...(input.taskPriority !== undefined && input.taskPriority !== null && { taskPriority: input.taskPriority }), + ...(input.taskStartToCloseTimeout !== undefined && + input.taskStartToCloseTimeout !== null && { taskStartToCloseTimeout: input.taskStartToCloseTimeout }), + ...(input.workflowId !== undefined && input.workflowId !== null && { workflowId: input.workflowId }), + ...(input.workflowType !== undefined && + input.workflowType !== null && { workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context) }), }; }; @@ -4046,9 +4092,10 @@ const serializeAws_json1_0StartTimerDecisionAttributes = ( context: __SerdeContext ): any => { return { - ...(input.control !== undefined && { control: input.control }), - ...(input.startToFireTimeout !== undefined && { startToFireTimeout: input.startToFireTimeout }), - ...(input.timerId !== undefined && { timerId: input.timerId }), + ...(input.control !== undefined && input.control !== null && { control: input.control }), + ...(input.startToFireTimeout !== undefined && + input.startToFireTimeout !== null && { startToFireTimeout: input.startToFireTimeout }), + ...(input.timerId !== undefined && input.timerId !== null && { timerId: input.timerId }), }; }; @@ -4057,44 +4104,55 @@ const serializeAws_json1_0StartWorkflowExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.childPolicy !== undefined && { childPolicy: input.childPolicy }), - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.executionStartToCloseTimeout !== undefined && { - executionStartToCloseTimeout: input.executionStartToCloseTimeout, - }), - ...(input.input !== undefined && { input: input.input }), - ...(input.lambdaRole !== undefined && { lambdaRole: input.lambdaRole }), - ...(input.tagList !== undefined && { tagList: serializeAws_json1_0TagList(input.tagList, context) }), - ...(input.taskList !== undefined && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), - ...(input.taskPriority !== undefined && { taskPriority: input.taskPriority }), - ...(input.taskStartToCloseTimeout !== undefined && { taskStartToCloseTimeout: input.taskStartToCloseTimeout }), - ...(input.workflowId !== undefined && { workflowId: input.workflowId }), - ...(input.workflowType !== undefined && { - workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context), - }), + ...(input.childPolicy !== undefined && input.childPolicy !== null && { childPolicy: input.childPolicy }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.executionStartToCloseTimeout !== undefined && + input.executionStartToCloseTimeout !== null && { + executionStartToCloseTimeout: input.executionStartToCloseTimeout, + }), + ...(input.input !== undefined && input.input !== null && { input: input.input }), + ...(input.lambdaRole !== undefined && input.lambdaRole !== null && { lambdaRole: input.lambdaRole }), + ...(input.tagList !== undefined && + input.tagList !== null && { tagList: serializeAws_json1_0TagList(input.tagList, context) }), + ...(input.taskList !== undefined && + input.taskList !== null && { taskList: serializeAws_json1_0TaskList(input.taskList, context) }), + ...(input.taskPriority !== undefined && input.taskPriority !== null && { taskPriority: input.taskPriority }), + ...(input.taskStartToCloseTimeout !== undefined && + input.taskStartToCloseTimeout !== null && { taskStartToCloseTimeout: input.taskStartToCloseTimeout }), + ...(input.workflowId !== undefined && input.workflowId !== null && { workflowId: input.workflowId }), + ...(input.workflowType !== undefined && + input.workflowType !== null && { workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context) }), }; }; const serializeAws_json1_0TagFilter = (input: TagFilter, context: __SerdeContext): any => { return { - ...(input.tag !== undefined && { tag: input.tag }), + ...(input.tag !== undefined && input.tag !== null && { tag: input.tag }), }; }; const serializeAws_json1_0TagList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tags !== undefined && { tags: serializeAws_json1_0ResourceTagList(input.tags, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && + input.tags !== null && { tags: serializeAws_json1_0ResourceTagList(input.tags, context) }), }; }; const serializeAws_json1_0TaskList = (input: TaskList, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -4103,12 +4161,12 @@ const serializeAws_json1_0TerminateWorkflowExecutionInput = ( context: __SerdeContext ): any => { return { - ...(input.childPolicy !== undefined && { childPolicy: input.childPolicy }), - ...(input.details !== undefined && { details: input.details }), - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.reason !== undefined && { reason: input.reason }), - ...(input.runId !== undefined && { runId: input.runId }), - ...(input.workflowId !== undefined && { workflowId: input.workflowId }), + ...(input.childPolicy !== undefined && input.childPolicy !== null && { childPolicy: input.childPolicy }), + ...(input.details !== undefined && input.details !== null && { details: input.details }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }), + ...(input.runId !== undefined && input.runId !== null && { runId: input.runId }), + ...(input.workflowId !== undefined && input.workflowId !== null && { workflowId: input.workflowId }), }; }; @@ -4117,16 +4175,15 @@ const serializeAws_json1_0UndeprecateActivityTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.activityType !== undefined && { - activityType: serializeAws_json1_0ActivityType(input.activityType, context), - }), - ...(input.domain !== undefined && { domain: input.domain }), + ...(input.activityType !== undefined && + input.activityType !== null && { activityType: serializeAws_json1_0ActivityType(input.activityType, context) }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), }; }; const serializeAws_json1_0UndeprecateDomainInput = (input: UndeprecateDomainInput, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), }; }; @@ -4135,44 +4192,44 @@ const serializeAws_json1_0UndeprecateWorkflowTypeInput = ( context: __SerdeContext ): any => { return { - ...(input.domain !== undefined && { domain: input.domain }), - ...(input.workflowType !== undefined && { - workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context), - }), + ...(input.domain !== undefined && input.domain !== null && { domain: input.domain }), + ...(input.workflowType !== undefined && + input.workflowType !== null && { workflowType: serializeAws_json1_0WorkflowType(input.workflowType, context) }), }; }; const serializeAws_json1_0UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => { return { - ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), - ...(input.tagKeys !== undefined && { tagKeys: serializeAws_json1_0ResourceTagKeyList(input.tagKeys, context) }), + ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && + input.tagKeys !== null && { tagKeys: serializeAws_json1_0ResourceTagKeyList(input.tagKeys, context) }), }; }; const serializeAws_json1_0WorkflowExecution = (input: WorkflowExecution, context: __SerdeContext): any => { return { - ...(input.runId !== undefined && { runId: input.runId }), - ...(input.workflowId !== undefined && { workflowId: input.workflowId }), + ...(input.runId !== undefined && input.runId !== null && { runId: input.runId }), + ...(input.workflowId !== undefined && input.workflowId !== null && { workflowId: input.workflowId }), }; }; const serializeAws_json1_0WorkflowExecutionFilter = (input: WorkflowExecutionFilter, context: __SerdeContext): any => { return { - ...(input.workflowId !== undefined && { workflowId: input.workflowId }), + ...(input.workflowId !== undefined && input.workflowId !== null && { workflowId: input.workflowId }), }; }; const serializeAws_json1_0WorkflowType = (input: WorkflowType, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; const serializeAws_json1_0WorkflowTypeFilter = (input: WorkflowTypeFilter, context: __SerdeContext): any => { return { - ...(input.name !== undefined && { name: input.name }), - ...(input.version !== undefined && { version: input.version }), + ...(input.name !== undefined && input.name !== null && { name: input.name }), + ...(input.version !== undefined && input.version !== null && { version: input.version }), }; }; @@ -4393,7 +4450,14 @@ const deserializeAws_json1_0ActivityTypeInfo = (output: any, context: __SerdeCon }; const deserializeAws_json1_0ActivityTypeInfoList = (output: any, context: __SerdeContext): ActivityTypeInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ActivityTypeInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ActivityTypeInfo(entry, context); + }); }; const deserializeAws_json1_0ActivityTypeInfos = (output: any, context: __SerdeContext): ActivityTypeInfos => { @@ -4718,7 +4782,14 @@ const deserializeAws_json1_0DomainInfo = (output: any, context: __SerdeContext): }; const deserializeAws_json1_0DomainInfoList = (output: any, context: __SerdeContext): DomainInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0DomainInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0DomainInfo(entry, context); + }); }; const deserializeAws_json1_0DomainInfos = (output: any, context: __SerdeContext): DomainInfos => { @@ -5167,7 +5238,14 @@ const deserializeAws_json1_0HistoryEvent = (output: any, context: __SerdeContext }; const deserializeAws_json1_0HistoryEventList = (output: any, context: __SerdeContext): HistoryEvent[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0HistoryEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0HistoryEvent(entry, context); + }); }; const deserializeAws_json1_0LambdaFunctionCompletedEventAttributes = ( @@ -5357,7 +5435,14 @@ const deserializeAws_json1_0ResourceTag = (output: any, context: __SerdeContext) }; const deserializeAws_json1_0ResourceTagList = (output: any, context: __SerdeContext): ResourceTag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ResourceTag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ResourceTag(entry, context); + }); }; const deserializeAws_json1_0Run = (output: any, context: __SerdeContext): Run => { @@ -5520,7 +5605,14 @@ const deserializeAws_json1_0StartTimerFailedEventAttributes = ( }; const deserializeAws_json1_0TagList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_0TaskList = (output: any, context: __SerdeContext): TaskList => { @@ -5806,7 +5898,14 @@ const deserializeAws_json1_0WorkflowExecutionInfoList = ( output: any, context: __SerdeContext ): WorkflowExecutionInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0WorkflowExecutionInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0WorkflowExecutionInfo(entry, context); + }); }; const deserializeAws_json1_0WorkflowExecutionInfos = (output: any, context: __SerdeContext): WorkflowExecutionInfos => { @@ -6001,7 +6100,14 @@ const deserializeAws_json1_0WorkflowTypeInfo = (output: any, context: __SerdeCon }; const deserializeAws_json1_0WorkflowTypeInfoList = (output: any, context: __SerdeContext): WorkflowTypeInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0WorkflowTypeInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0WorkflowTypeInfo(entry, context); + }); }; const deserializeAws_json1_0WorkflowTypeInfos = (output: any, context: __SerdeContext): WorkflowTypeInfos => { @@ -6065,3 +6171,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-synthetics/protocols/Aws_restJson1.ts b/clients/client-synthetics/protocols/Aws_restJson1.ts index ec9a4608882e..499f9cdf2d7d 100644 --- a/clients/client-synthetics/protocols/Aws_restJson1.ts +++ b/clients/client-synthetics/protocols/Aws_restJson1.ts @@ -59,30 +59,35 @@ export const serializeAws_restJson1CreateCanaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/canary"; let body: any; body = JSON.stringify({ - ...(input.ArtifactS3Location !== undefined && { ArtifactS3Location: input.ArtifactS3Location }), - ...(input.Code !== undefined && { Code: serializeAws_restJson1CanaryCodeInput(input.Code, context) }), - ...(input.ExecutionRoleArn !== undefined && { ExecutionRoleArn: input.ExecutionRoleArn }), - ...(input.FailureRetentionPeriodInDays !== undefined && { - FailureRetentionPeriodInDays: input.FailureRetentionPeriodInDays, - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RunConfig !== undefined && { - RunConfig: serializeAws_restJson1CanaryRunConfigInput(input.RunConfig, context), - }), - ...(input.RuntimeVersion !== undefined && { RuntimeVersion: input.RuntimeVersion }), - ...(input.Schedule !== undefined && { - Schedule: serializeAws_restJson1CanaryScheduleInput(input.Schedule, context), - }), - ...(input.SuccessRetentionPeriodInDays !== undefined && { - SuccessRetentionPeriodInDays: input.SuccessRetentionPeriodInDays, - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_restJson1VpcConfigInput(input.VpcConfig, context) }), + ...(input.ArtifactS3Location !== undefined && + input.ArtifactS3Location !== null && { ArtifactS3Location: input.ArtifactS3Location }), + ...(input.Code !== undefined && + input.Code !== null && { Code: serializeAws_restJson1CanaryCodeInput(input.Code, context) }), + ...(input.ExecutionRoleArn !== undefined && + input.ExecutionRoleArn !== null && { ExecutionRoleArn: input.ExecutionRoleArn }), + ...(input.FailureRetentionPeriodInDays !== undefined && + input.FailureRetentionPeriodInDays !== null && { + FailureRetentionPeriodInDays: input.FailureRetentionPeriodInDays, + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RunConfig !== undefined && + input.RunConfig !== null && { RunConfig: serializeAws_restJson1CanaryRunConfigInput(input.RunConfig, context) }), + ...(input.RuntimeVersion !== undefined && + input.RuntimeVersion !== null && { RuntimeVersion: input.RuntimeVersion }), + ...(input.Schedule !== undefined && + input.Schedule !== null && { Schedule: serializeAws_restJson1CanaryScheduleInput(input.Schedule, context) }), + ...(input.SuccessRetentionPeriodInDays !== undefined && + input.SuccessRetentionPeriodInDays !== null && { + SuccessRetentionPeriodInDays: input.SuccessRetentionPeriodInDays, + }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_restJson1VpcConfigInput(input.VpcConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -100,9 +105,7 @@ export const serializeAws_restJson1DeleteCanaryCommand = async ( input: DeleteCanaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/canary/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -131,13 +134,13 @@ export const serializeAws_restJson1DescribeCanariesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/canaries"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -156,13 +159,13 @@ export const serializeAws_restJson1DescribeCanariesLastRunCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/canaries/last-run"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -181,13 +184,13 @@ export const serializeAws_restJson1DescribeRuntimeVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/runtime-versions"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -205,9 +208,7 @@ export const serializeAws_restJson1GetCanaryCommand = async ( input: GetCanaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/canary/{Name}"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -236,7 +237,7 @@ export const serializeAws_restJson1GetCanaryRunsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/canary/{Name}/runs"; if (input.Name !== undefined) { @@ -250,8 +251,8 @@ export const serializeAws_restJson1GetCanaryRunsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -269,9 +270,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -299,9 +298,7 @@ export const serializeAws_restJson1StartCanaryCommand = async ( input: StartCanaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/canary/{Name}/start"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -329,9 +326,7 @@ export const serializeAws_restJson1StopCanaryCommand = async ( input: StopCanaryCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/canary/{Name}/stop"; if (input.Name !== undefined) { const labelValue: string = input.Name; @@ -360,7 +355,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -374,7 +369,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -392,9 +387,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -427,7 +420,7 @@ export const serializeAws_restJson1UpdateCanaryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/canary/{Name}"; if (input.Name !== undefined) { @@ -441,22 +434,26 @@ export const serializeAws_restJson1UpdateCanaryCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Code !== undefined && { Code: serializeAws_restJson1CanaryCodeInput(input.Code, context) }), - ...(input.ExecutionRoleArn !== undefined && { ExecutionRoleArn: input.ExecutionRoleArn }), - ...(input.FailureRetentionPeriodInDays !== undefined && { - FailureRetentionPeriodInDays: input.FailureRetentionPeriodInDays, - }), - ...(input.RunConfig !== undefined && { - RunConfig: serializeAws_restJson1CanaryRunConfigInput(input.RunConfig, context), - }), - ...(input.RuntimeVersion !== undefined && { RuntimeVersion: input.RuntimeVersion }), - ...(input.Schedule !== undefined && { - Schedule: serializeAws_restJson1CanaryScheduleInput(input.Schedule, context), - }), - ...(input.SuccessRetentionPeriodInDays !== undefined && { - SuccessRetentionPeriodInDays: input.SuccessRetentionPeriodInDays, - }), - ...(input.VpcConfig !== undefined && { VpcConfig: serializeAws_restJson1VpcConfigInput(input.VpcConfig, context) }), + ...(input.Code !== undefined && + input.Code !== null && { Code: serializeAws_restJson1CanaryCodeInput(input.Code, context) }), + ...(input.ExecutionRoleArn !== undefined && + input.ExecutionRoleArn !== null && { ExecutionRoleArn: input.ExecutionRoleArn }), + ...(input.FailureRetentionPeriodInDays !== undefined && + input.FailureRetentionPeriodInDays !== null && { + FailureRetentionPeriodInDays: input.FailureRetentionPeriodInDays, + }), + ...(input.RunConfig !== undefined && + input.RunConfig !== null && { RunConfig: serializeAws_restJson1CanaryRunConfigInput(input.RunConfig, context) }), + ...(input.RuntimeVersion !== undefined && + input.RuntimeVersion !== null && { RuntimeVersion: input.RuntimeVersion }), + ...(input.Schedule !== undefined && + input.Schedule !== null && { Schedule: serializeAws_restJson1CanaryScheduleInput(input.Schedule, context) }), + ...(input.SuccessRetentionPeriodInDays !== undefined && + input.SuccessRetentionPeriodInDays !== null && { + SuccessRetentionPeriodInDays: input.SuccessRetentionPeriodInDays, + }), + ...(input.VpcConfig !== undefined && + input.VpcConfig !== null && { VpcConfig: serializeAws_restJson1VpcConfigInput(input.VpcConfig, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1447,29 +1444,32 @@ const deserializeAws_restJson1ValidationExceptionResponse = async ( const serializeAws_restJson1CanaryCodeInput = (input: CanaryCodeInput, context: __SerdeContext): any => { return { - ...(input.Handler !== undefined && { Handler: input.Handler }), - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3Key !== undefined && { S3Key: input.S3Key }), - ...(input.S3Version !== undefined && { S3Version: input.S3Version }), - ...(input.ZipFile !== undefined && { ZipFile: context.base64Encoder(input.ZipFile) }), + ...(input.Handler !== undefined && input.Handler !== null && { Handler: input.Handler }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3Key !== undefined && input.S3Key !== null && { S3Key: input.S3Key }), + ...(input.S3Version !== undefined && input.S3Version !== null && { S3Version: input.S3Version }), + ...(input.ZipFile !== undefined && input.ZipFile !== null && { ZipFile: context.base64Encoder(input.ZipFile) }), }; }; const serializeAws_restJson1CanaryRunConfigInput = (input: CanaryRunConfigInput, context: __SerdeContext): any => { return { - ...(input.ActiveTracing !== undefined && { ActiveTracing: input.ActiveTracing }), - ...(input.EnvironmentVariables !== undefined && { - EnvironmentVariables: serializeAws_restJson1EnvironmentVariablesMap(input.EnvironmentVariables, context), - }), - ...(input.MemoryInMB !== undefined && { MemoryInMB: input.MemoryInMB }), - ...(input.TimeoutInSeconds !== undefined && { TimeoutInSeconds: input.TimeoutInSeconds }), + ...(input.ActiveTracing !== undefined && input.ActiveTracing !== null && { ActiveTracing: input.ActiveTracing }), + ...(input.EnvironmentVariables !== undefined && + input.EnvironmentVariables !== null && { + EnvironmentVariables: serializeAws_restJson1EnvironmentVariablesMap(input.EnvironmentVariables, context), + }), + ...(input.MemoryInMB !== undefined && input.MemoryInMB !== null && { MemoryInMB: input.MemoryInMB }), + ...(input.TimeoutInSeconds !== undefined && + input.TimeoutInSeconds !== null && { TimeoutInSeconds: input.TimeoutInSeconds }), }; }; const serializeAws_restJson1CanaryScheduleInput = (input: CanaryScheduleInput, context: __SerdeContext): any => { return { - ...(input.DurationInSeconds !== undefined && { DurationInSeconds: input.DurationInSeconds }), - ...(input.Expression !== undefined && { Expression: input.Expression }), + ...(input.DurationInSeconds !== undefined && + input.DurationInSeconds !== null && { DurationInSeconds: input.DurationInSeconds }), + ...(input.Expression !== undefined && input.Expression !== null && { Expression: input.Expression }), }; }; @@ -1477,48 +1477,82 @@ const serializeAws_restJson1EnvironmentVariablesMap = ( input: { [key: string]: string }, context: __SerdeContext ): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1VpcConfigInput = (input: VpcConfigInput, context: __SerdeContext): any => { return { - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_restJson1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_restJson1SubnetIds(input.SubnetIds, context) }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_restJson1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_restJson1SubnetIds(input.SubnetIds, context) }), }; }; const deserializeAws_restJson1Canaries = (output: any, context: __SerdeContext): Canary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Canary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Canary(entry, context); + }); }; const deserializeAws_restJson1CanariesLastRun = (output: any, context: __SerdeContext): CanaryLastRun[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CanaryLastRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CanaryLastRun(entry, context); + }); }; const deserializeAws_restJson1Canary = (output: any, context: __SerdeContext): Canary => { @@ -1623,7 +1657,14 @@ const deserializeAws_restJson1CanaryRunConfigOutput = (output: any, context: __S }; const deserializeAws_restJson1CanaryRuns = (output: any, context: __SerdeContext): CanaryRun[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1CanaryRun(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1CanaryRun(entry, context); + }); }; const deserializeAws_restJson1CanaryRunStatus = (output: any, context: __SerdeContext): CanaryRunStatus => { @@ -1700,25 +1741,48 @@ const deserializeAws_restJson1RuntimeVersion = (output: any, context: __SerdeCon }; const deserializeAws_restJson1RuntimeVersionList = (output: any, context: __SerdeContext): RuntimeVersion[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RuntimeVersion(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RuntimeVersion(entry, context); + }); }; const deserializeAws_restJson1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1VpcConfigOutput = (output: any, context: __SerdeContext): VpcConfigOutput => { @@ -1755,6 +1819,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-textract/protocols/Aws_json1_1.ts b/clients/client-textract/protocols/Aws_json1_1.ts index e0761e1ce2d8..5eb337c38c08 100644 --- a/clients/client-textract/protocols/Aws_json1_1.ts +++ b/clients/client-textract/protocols/Aws_json1_1.ts @@ -77,7 +77,7 @@ export const serializeAws_json1_1AnalyzeDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Textract.AnalyzeDocument", }; let body: any; @@ -90,7 +90,7 @@ export const serializeAws_json1_1DetectDocumentTextCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Textract.DetectDocumentText", }; let body: any; @@ -103,7 +103,7 @@ export const serializeAws_json1_1GetDocumentAnalysisCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Textract.GetDocumentAnalysis", }; let body: any; @@ -116,7 +116,7 @@ export const serializeAws_json1_1GetDocumentTextDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Textract.GetDocumentTextDetection", }; let body: any; @@ -129,7 +129,7 @@ export const serializeAws_json1_1StartDocumentAnalysisCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Textract.StartDocumentAnalysis", }; let body: any; @@ -142,7 +142,7 @@ export const serializeAws_json1_1StartDocumentTextDetectionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Textract.StartDocumentTextDetection", }; let body: any; @@ -177,8 +177,7 @@ const deserializeAws_json1_1AnalyzeDocumentCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.textract#AccessDeniedException": @@ -304,8 +303,7 @@ const deserializeAws_json1_1DetectDocumentTextCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.textract#AccessDeniedException": @@ -423,8 +421,7 @@ const deserializeAws_json1_1GetDocumentAnalysisCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.textract#AccessDeniedException": @@ -526,8 +523,7 @@ const deserializeAws_json1_1GetDocumentTextDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.textract#AccessDeniedException": @@ -629,8 +625,7 @@ const deserializeAws_json1_1StartDocumentAnalysisCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.textract#AccessDeniedException": @@ -772,8 +767,7 @@ const deserializeAws_json1_1StartDocumentTextDetectionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.textract#AccessDeniedException": @@ -1100,13 +1094,14 @@ const deserializeAws_json1_1UnsupportedDocumentExceptionResponse = async ( const serializeAws_json1_1AnalyzeDocumentRequest = (input: AnalyzeDocumentRequest, context: __SerdeContext): any => { return { - ...(input.Document !== undefined && { Document: serializeAws_json1_1Document(input.Document, context) }), - ...(input.FeatureTypes !== undefined && { - FeatureTypes: serializeAws_json1_1FeatureTypes(input.FeatureTypes, context), - }), - ...(input.HumanLoopConfig !== undefined && { - HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context), - }), + ...(input.Document !== undefined && + input.Document !== null && { Document: serializeAws_json1_1Document(input.Document, context) }), + ...(input.FeatureTypes !== undefined && + input.FeatureTypes !== null && { FeatureTypes: serializeAws_json1_1FeatureTypes(input.FeatureTypes, context) }), + ...(input.HumanLoopConfig !== undefined && + input.HumanLoopConfig !== null && { + HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context), + }), }; }; @@ -1114,7 +1109,14 @@ const serializeAws_json1_1ContentClassifiers = ( input: (ContentClassifier | string)[], context: __SerdeContext ): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DetectDocumentTextRequest = ( @@ -1122,25 +1124,35 @@ const serializeAws_json1_1DetectDocumentTextRequest = ( context: __SerdeContext ): any => { return { - ...(input.Document !== undefined && { Document: serializeAws_json1_1Document(input.Document, context) }), + ...(input.Document !== undefined && + input.Document !== null && { Document: serializeAws_json1_1Document(input.Document, context) }), }; }; const serializeAws_json1_1Document = (input: Document, context: __SerdeContext): any => { return { - ...(input.Bytes !== undefined && { Bytes: context.base64Encoder(input.Bytes) }), - ...(input.S3Object !== undefined && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), + ...(input.Bytes !== undefined && input.Bytes !== null && { Bytes: context.base64Encoder(input.Bytes) }), + ...(input.S3Object !== undefined && + input.S3Object !== null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), }; }; const serializeAws_json1_1DocumentLocation = (input: DocumentLocation, context: __SerdeContext): any => { return { - ...(input.S3Object !== undefined && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), + ...(input.S3Object !== undefined && + input.S3Object !== null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }), }; }; const serializeAws_json1_1FeatureTypes = (input: (FeatureType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1GetDocumentAnalysisRequest = ( @@ -1148,9 +1160,9 @@ const serializeAws_json1_1GetDocumentAnalysisRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -1159,49 +1171,52 @@ const serializeAws_json1_1GetDocumentTextDetectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1HumanLoopConfig = (input: HumanLoopConfig, context: __SerdeContext): any => { return { - ...(input.DataAttributes !== undefined && { - DataAttributes: serializeAws_json1_1HumanLoopDataAttributes(input.DataAttributes, context), - }), - ...(input.FlowDefinitionArn !== undefined && { FlowDefinitionArn: input.FlowDefinitionArn }), - ...(input.HumanLoopName !== undefined && { HumanLoopName: input.HumanLoopName }), + ...(input.DataAttributes !== undefined && + input.DataAttributes !== null && { + DataAttributes: serializeAws_json1_1HumanLoopDataAttributes(input.DataAttributes, context), + }), + ...(input.FlowDefinitionArn !== undefined && + input.FlowDefinitionArn !== null && { FlowDefinitionArn: input.FlowDefinitionArn }), + ...(input.HumanLoopName !== undefined && input.HumanLoopName !== null && { HumanLoopName: input.HumanLoopName }), }; }; const serializeAws_json1_1HumanLoopDataAttributes = (input: HumanLoopDataAttributes, context: __SerdeContext): any => { return { - ...(input.ContentClassifiers !== undefined && { - ContentClassifiers: serializeAws_json1_1ContentClassifiers(input.ContentClassifiers, context), - }), + ...(input.ContentClassifiers !== undefined && + input.ContentClassifiers !== null && { + ContentClassifiers: serializeAws_json1_1ContentClassifiers(input.ContentClassifiers, context), + }), }; }; const serializeAws_json1_1NotificationChannel = (input: NotificationChannel, context: __SerdeContext): any => { return { - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.SNSTopicArn !== undefined && { SNSTopicArn: input.SNSTopicArn }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.SNSTopicArn !== undefined && input.SNSTopicArn !== null && { SNSTopicArn: input.SNSTopicArn }), }; }; const serializeAws_json1_1OutputConfig = (input: OutputConfig, context: __SerdeContext): any => { return { - ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), - ...(input.S3Prefix !== undefined && { S3Prefix: input.S3Prefix }), + ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }), + ...(input.S3Prefix !== undefined && input.S3Prefix !== null && { S3Prefix: input.S3Prefix }), }; }; const serializeAws_json1_1S3Object = (input: S3Object, context: __SerdeContext): any => { return { - ...(input.Bucket !== undefined && { Bucket: input.Bucket }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; @@ -1210,21 +1225,22 @@ const serializeAws_json1_1StartDocumentAnalysisRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.DocumentLocation !== undefined && { - DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context), - }), - ...(input.FeatureTypes !== undefined && { - FeatureTypes: serializeAws_json1_1FeatureTypes(input.FeatureTypes, context), - }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.KMSKeyId !== undefined && { KMSKeyId: input.KMSKeyId }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context), - }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.DocumentLocation !== undefined && + input.DocumentLocation !== null && { + DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context), + }), + ...(input.FeatureTypes !== undefined && + input.FeatureTypes !== null && { FeatureTypes: serializeAws_json1_1FeatureTypes(input.FeatureTypes, context) }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.KMSKeyId !== undefined && input.KMSKeyId !== null && { KMSKeyId: input.KMSKeyId }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }), }; }; @@ -1233,18 +1249,20 @@ const serializeAws_json1_1StartDocumentTextDetectionRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientRequestToken !== undefined && { ClientRequestToken: input.ClientRequestToken }), - ...(input.DocumentLocation !== undefined && { - DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context), - }), - ...(input.JobTag !== undefined && { JobTag: input.JobTag }), - ...(input.KMSKeyId !== undefined && { KMSKeyId: input.KMSKeyId }), - ...(input.NotificationChannel !== undefined && { - NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), - }), - ...(input.OutputConfig !== undefined && { - OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context), - }), + ...(input.ClientRequestToken !== undefined && + input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }), + ...(input.DocumentLocation !== undefined && + input.DocumentLocation !== null && { + DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context), + }), + ...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }), + ...(input.KMSKeyId !== undefined && input.KMSKeyId !== null && { KMSKeyId: input.KMSKeyId }), + ...(input.NotificationChannel !== undefined && + input.NotificationChannel !== null && { + NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context), + }), + ...(input.OutputConfig !== undefined && + input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }), }; }; @@ -1316,7 +1334,14 @@ const deserializeAws_json1_1Block = (output: any, context: __SerdeContext): Bloc }; const deserializeAws_json1_1BlockList = (output: any, context: __SerdeContext): Block[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Block(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Block(entry, context); + }); }; const deserializeAws_json1_1BoundingBox = (output: any, context: __SerdeContext): BoundingBox => { @@ -1365,7 +1390,14 @@ const deserializeAws_json1_1DocumentTooLargeException = ( }; const deserializeAws_json1_1EntityTypes = (output: any, context: __SerdeContext): (EntityType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Geometry = (output: any, context: __SerdeContext): Geometry => { @@ -1456,7 +1488,14 @@ const deserializeAws_json1_1HumanLoopActivationOutput = ( }; const deserializeAws_json1_1HumanLoopActivationReasons = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1HumanLoopQuotaExceededException = ( @@ -1483,7 +1522,14 @@ const deserializeAws_json1_1IdempotentParameterMismatchException = ( }; const deserializeAws_json1_1IdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1InternalServerError = (output: any, context: __SerdeContext): InternalServerError => { @@ -1535,7 +1581,14 @@ const deserializeAws_json1_1LimitExceededException = (output: any, context: __Se }; const deserializeAws_json1_1Pages = (output: any, context: __SerdeContext): number[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Point = (output: any, context: __SerdeContext): Point => { @@ -1546,7 +1599,14 @@ const deserializeAws_json1_1Point = (output: any, context: __SerdeContext): Poin }; const deserializeAws_json1_1Polygon = (output: any, context: __SerdeContext): Point[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Point(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Point(entry, context); + }); }; const deserializeAws_json1_1ProvisionedThroughputExceededException = ( @@ -1568,7 +1628,14 @@ const deserializeAws_json1_1Relationship = (output: any, context: __SerdeContext }; const deserializeAws_json1_1RelationshipList = (output: any, context: __SerdeContext): Relationship[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Relationship(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Relationship(entry, context); + }); }; const deserializeAws_json1_1StartDocumentAnalysisResponse = ( @@ -1617,7 +1684,14 @@ const deserializeAws_json1_1Warning = (output: any, context: __SerdeContext): Wa }; const deserializeAws_json1_1Warnings = (output: any, context: __SerdeContext): Warning[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Warning(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Warning(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -1670,3 +1744,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-timestream-query/protocols/Aws_json1_0.ts b/clients/client-timestream-query/protocols/Aws_json1_0.ts index 1048b1fa0223..41af1d28aaa7 100644 --- a/clients/client-timestream-query/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-query/protocols/Aws_json1_0.ts @@ -39,7 +39,7 @@ export const serializeAws_json1_0CancelQueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.CancelQuery", }; let body: any; @@ -52,7 +52,7 @@ export const serializeAws_json1_0DescribeEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.DescribeEndpoints", }; let body: any; @@ -65,7 +65,7 @@ export const serializeAws_json1_0QueryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.Query", }; let body: any; @@ -100,8 +100,7 @@ const deserializeAws_json1_0CancelQueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamquery#AccessDeniedException": @@ -187,8 +186,7 @@ const deserializeAws_json1_0DescribeEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.timestreamquery#InternalServerException": @@ -258,8 +256,7 @@ const deserializeAws_json1_0QueryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamquery#AccessDeniedException": @@ -441,7 +438,7 @@ const deserializeAws_json1_0ValidationExceptionResponse = async ( const serializeAws_json1_0CancelQueryRequest = (input: CancelQueryRequest, context: __SerdeContext): any => { return { - ...(input.QueryId !== undefined && { QueryId: input.QueryId }), + ...(input.QueryId !== undefined && input.QueryId !== null && { QueryId: input.QueryId }), }; }; @@ -455,9 +452,9 @@ const serializeAws_json1_0DescribeEndpointsRequest = ( const serializeAws_json1_0QueryRequest = (input: QueryRequest, context: __SerdeContext): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.MaxRows !== undefined && { MaxRows: input.MaxRows }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.QueryString !== undefined && { QueryString: input.QueryString }), + ...(input.MaxRows !== undefined && input.MaxRows !== null && { MaxRows: input.MaxRows }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.QueryString !== undefined && input.QueryString !== null && { QueryString: input.QueryString }), }; }; @@ -485,7 +482,14 @@ const deserializeAws_json1_0ColumnInfo = (output: any, context: __SerdeContext): }; const deserializeAws_json1_0ColumnInfoList = (output: any, context: __SerdeContext): ColumnInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0ColumnInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0ColumnInfo(entry, context); + }); }; const deserializeAws_json1_0ConflictException = (output: any, context: __SerdeContext): ConflictException => { @@ -514,7 +518,14 @@ const deserializeAws_json1_0Datum = (output: any, context: __SerdeContext): Datu }; const deserializeAws_json1_0DatumList = (output: any, context: __SerdeContext): Datum[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Datum(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Datum(entry, context); + }); }; const deserializeAws_json1_0DescribeEndpointsResponse = ( @@ -540,7 +551,14 @@ const deserializeAws_json1_0Endpoint = (output: any, context: __SerdeContext): E }; const deserializeAws_json1_0Endpoints = (output: any, context: __SerdeContext): Endpoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Endpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Endpoint(entry, context); + }); }; const deserializeAws_json1_0InternalServerException = ( @@ -616,7 +634,14 @@ const deserializeAws_json1_0Row = (output: any, context: __SerdeContext): Row => }; const deserializeAws_json1_0RowList = (output: any, context: __SerdeContext): Row[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Row(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Row(entry, context); + }); }; const deserializeAws_json1_0ThrottlingException = (output: any, context: __SerdeContext): ThrottlingException => { @@ -636,7 +661,14 @@ const deserializeAws_json1_0TimeSeriesDataPoint = (output: any, context: __Serde }; const deserializeAws_json1_0TimeSeriesDataPointList = (output: any, context: __SerdeContext): TimeSeriesDataPoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0TimeSeriesDataPoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0TimeSeriesDataPoint(entry, context); + }); }; const deserializeAws_json1_0Type = (output: any, context: __SerdeContext): Type => { @@ -713,3 +745,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-timestream-write/protocols/Aws_json1_0.ts b/clients/client-timestream-write/protocols/Aws_json1_0.ts index dedb46a26f4f..6b9935498857 100644 --- a/clients/client-timestream-write/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-write/protocols/Aws_json1_0.ts @@ -77,7 +77,7 @@ export const serializeAws_json1_0CreateDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.CreateDatabase", }; let body: any; @@ -90,7 +90,7 @@ export const serializeAws_json1_0CreateTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.CreateTable", }; let body: any; @@ -103,7 +103,7 @@ export const serializeAws_json1_0DeleteDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.DeleteDatabase", }; let body: any; @@ -116,7 +116,7 @@ export const serializeAws_json1_0DeleteTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.DeleteTable", }; let body: any; @@ -129,7 +129,7 @@ export const serializeAws_json1_0DescribeDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.DescribeDatabase", }; let body: any; @@ -142,7 +142,7 @@ export const serializeAws_json1_0DescribeEndpointsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.DescribeEndpoints", }; let body: any; @@ -155,7 +155,7 @@ export const serializeAws_json1_0DescribeTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.DescribeTable", }; let body: any; @@ -168,7 +168,7 @@ export const serializeAws_json1_0ListDatabasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.ListDatabases", }; let body: any; @@ -181,7 +181,7 @@ export const serializeAws_json1_0ListTablesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.ListTables", }; let body: any; @@ -194,7 +194,7 @@ export const serializeAws_json1_0ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.ListTagsForResource", }; let body: any; @@ -207,7 +207,7 @@ export const serializeAws_json1_0TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.TagResource", }; let body: any; @@ -220,7 +220,7 @@ export const serializeAws_json1_0UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.UntagResource", }; let body: any; @@ -233,7 +233,7 @@ export const serializeAws_json1_0UpdateDatabaseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.UpdateDatabase", }; let body: any; @@ -246,7 +246,7 @@ export const serializeAws_json1_0UpdateTableCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.UpdateTable", }; let body: any; @@ -259,7 +259,7 @@ export const serializeAws_json1_0WriteRecordsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.0", + "content-type": "application/x-amz-json-1.0", "X-Amz-Target": "Timestream_20181101.WriteRecords", }; let body: any; @@ -294,8 +294,7 @@ const deserializeAws_json1_0CreateDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -397,8 +396,7 @@ const deserializeAws_json1_0CreateTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -505,8 +503,7 @@ const deserializeAws_json1_0DeleteDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -597,8 +594,7 @@ const deserializeAws_json1_0DeleteTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -692,8 +688,7 @@ const deserializeAws_json1_0DescribeDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -787,8 +782,7 @@ const deserializeAws_json1_0DescribeEndpointsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.timestreamwrite#InternalServerException": @@ -858,8 +852,7 @@ const deserializeAws_json1_0DescribeTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -953,8 +946,7 @@ const deserializeAws_json1_0ListDatabasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -1040,8 +1032,7 @@ const deserializeAws_json1_0ListTablesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -1135,8 +1126,7 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidEndpointException": case "com.amazonaws.timestreamwrite#InvalidEndpointException": @@ -1214,8 +1204,7 @@ const deserializeAws_json1_0TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidEndpointException": case "com.amazonaws.timestreamwrite#InvalidEndpointException": @@ -1301,8 +1290,7 @@ const deserializeAws_json1_0UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidEndpointException": case "com.amazonaws.timestreamwrite#InvalidEndpointException": @@ -1388,8 +1376,7 @@ const deserializeAws_json1_0UpdateDatabaseCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -1491,8 +1478,7 @@ const deserializeAws_json1_0UpdateTableCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -1583,8 +1569,7 @@ const deserializeAws_json1_0WriteRecordsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": @@ -1796,39 +1781,40 @@ const deserializeAws_json1_0ValidationExceptionResponse = async ( const serializeAws_json1_0CreateDatabaseRequest = (input: CreateDatabaseRequest, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), }; }; const serializeAws_json1_0CreateTableRequest = (input: CreateTableRequest, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.RetentionProperties !== undefined && { - RetentionProperties: serializeAws_json1_0RetentionProperties(input.RetentionProperties, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.RetentionProperties !== undefined && + input.RetentionProperties !== null && { + RetentionProperties: serializeAws_json1_0RetentionProperties(input.RetentionProperties, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), }; }; const serializeAws_json1_0DeleteDatabaseRequest = (input: DeleteDatabaseRequest, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), }; }; const serializeAws_json1_0DeleteTableRequest = (input: DeleteTableRequest, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0DescribeDatabaseRequest = (input: DescribeDatabaseRequest, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), }; }; @@ -1841,35 +1827,43 @@ const serializeAws_json1_0DescribeEndpointsRequest = ( const serializeAws_json1_0DescribeTableRequest = (input: DescribeTableRequest, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0Dimension = (input: Dimension, context: __SerdeContext): any => { return { - ...(input.DimensionValueType !== undefined && { DimensionValueType: input.DimensionValueType }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.DimensionValueType !== undefined && + input.DimensionValueType !== null && { DimensionValueType: input.DimensionValueType }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_0Dimensions = (input: Dimension[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Dimension(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Dimension(entry, context); + }); }; const serializeAws_json1_0ListDatabasesRequest = (input: ListDatabasesRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_0ListTablesRequest = (input: ListTablesRequest, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -1878,91 +1872,120 @@ const serializeAws_json1_0ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_0_Record = (input: _Record, context: __SerdeContext): any => { return { - ...(input.Dimensions !== undefined && { Dimensions: serializeAws_json1_0Dimensions(input.Dimensions, context) }), - ...(input.MeasureName !== undefined && { MeasureName: input.MeasureName }), - ...(input.MeasureValue !== undefined && { MeasureValue: input.MeasureValue }), - ...(input.MeasureValueType !== undefined && { MeasureValueType: input.MeasureValueType }), - ...(input.Time !== undefined && { Time: input.Time }), - ...(input.TimeUnit !== undefined && { TimeUnit: input.TimeUnit }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Dimensions !== undefined && + input.Dimensions !== null && { Dimensions: serializeAws_json1_0Dimensions(input.Dimensions, context) }), + ...(input.MeasureName !== undefined && input.MeasureName !== null && { MeasureName: input.MeasureName }), + ...(input.MeasureValue !== undefined && input.MeasureValue !== null && { MeasureValue: input.MeasureValue }), + ...(input.MeasureValueType !== undefined && + input.MeasureValueType !== null && { MeasureValueType: input.MeasureValueType }), + ...(input.Time !== undefined && input.Time !== null && { Time: input.Time }), + ...(input.TimeUnit !== undefined && input.TimeUnit !== null && { TimeUnit: input.TimeUnit }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_json1_0Records = (input: _Record[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0_Record(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0_Record(entry, context); + }); }; const serializeAws_json1_0RetentionProperties = (input: RetentionProperties, context: __SerdeContext): any => { return { - ...(input.MagneticStoreRetentionPeriodInDays !== undefined && { - MagneticStoreRetentionPeriodInDays: input.MagneticStoreRetentionPeriodInDays, - }), - ...(input.MemoryStoreRetentionPeriodInHours !== undefined && { - MemoryStoreRetentionPeriodInHours: input.MemoryStoreRetentionPeriodInHours, - }), + ...(input.MagneticStoreRetentionPeriodInDays !== undefined && + input.MagneticStoreRetentionPeriodInDays !== null && { + MagneticStoreRetentionPeriodInDays: input.MagneticStoreRetentionPeriodInDays, + }), + ...(input.MemoryStoreRetentionPeriodInHours !== undefined && + input.MemoryStoreRetentionPeriodInHours !== null && { + MemoryStoreRetentionPeriodInHours: input.MemoryStoreRetentionPeriodInHours, + }), }; }; const serializeAws_json1_0Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_0TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_0TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_0Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_0Tag(entry, context); + }); }; const serializeAws_json1_0TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_0TagList(input.Tags, context) }), }; }; const serializeAws_json1_0UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_0UpdateDatabaseRequest = (input: UpdateDatabaseRequest, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }), }; }; const serializeAws_json1_0UpdateTableRequest = (input: UpdateTableRequest, context: __SerdeContext): any => { return { - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.RetentionProperties !== undefined && { - RetentionProperties: serializeAws_json1_0RetentionProperties(input.RetentionProperties, context), - }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.RetentionProperties !== undefined && + input.RetentionProperties !== null && { + RetentionProperties: serializeAws_json1_0RetentionProperties(input.RetentionProperties, context), + }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; const serializeAws_json1_0WriteRecordsRequest = (input: WriteRecordsRequest, context: __SerdeContext): any => { return { - ...(input.CommonAttributes !== undefined && { - CommonAttributes: serializeAws_json1_0_Record(input.CommonAttributes, context), - }), - ...(input.DatabaseName !== undefined && { DatabaseName: input.DatabaseName }), - ...(input.Records !== undefined && { Records: serializeAws_json1_0Records(input.Records, context) }), - ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.CommonAttributes !== undefined && + input.CommonAttributes !== null && { + CommonAttributes: serializeAws_json1_0_Record(input.CommonAttributes, context), + }), + ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }), + ...(input.Records !== undefined && + input.Records !== null && { Records: serializeAws_json1_0Records(input.Records, context) }), + ...(input.TableName !== undefined && input.TableName !== null && { TableName: input.TableName }), }; }; @@ -2014,7 +2037,14 @@ const deserializeAws_json1_0Database = (output: any, context: __SerdeContext): D }; const deserializeAws_json1_0DatabaseList = (output: any, context: __SerdeContext): Database[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Database(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Database(entry, context); + }); }; const deserializeAws_json1_0DescribeDatabaseResponse = ( @@ -2061,7 +2091,14 @@ const deserializeAws_json1_0Endpoint = (output: any, context: __SerdeContext): E }; const deserializeAws_json1_0Endpoints = (output: any, context: __SerdeContext): Endpoint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Endpoint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Endpoint(entry, context); + }); }; const deserializeAws_json1_0InternalServerException = ( @@ -2124,7 +2161,14 @@ const deserializeAws_json1_0RejectedRecord = (output: any, context: __SerdeConte }; const deserializeAws_json1_0RejectedRecords = (output: any, context: __SerdeContext): RejectedRecord[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0RejectedRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0RejectedRecord(entry, context); + }); }; const deserializeAws_json1_0RejectedRecordsException = ( @@ -2193,7 +2237,14 @@ const deserializeAws_json1_0Table = (output: any, context: __SerdeContext): Tabl }; const deserializeAws_json1_0TableList = (output: any, context: __SerdeContext): Table[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Table(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Table(entry, context); + }); }; const deserializeAws_json1_0Tag = (output: any, context: __SerdeContext): Tag => { @@ -2204,7 +2255,14 @@ const deserializeAws_json1_0Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_0TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_0Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_0Tag(entry, context); + }); }; const deserializeAws_json1_0TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -2295,3 +2353,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-transcribe-streaming/protocols/Aws_restJson1.ts b/clients/client-transcribe-streaming/protocols/Aws_restJson1.ts index e9f7a030554d..4a5797f2171f 100644 --- a/clients/client-transcribe-streaming/protocols/Aws_restJson1.ts +++ b/clients/client-transcribe-streaming/protocols/Aws_restJson1.ts @@ -43,7 +43,6 @@ export const serializeAws_restJson1StartMedicalStreamTranscriptionCommand = asyn context: __SerdeContext & __EventStreamSerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.LanguageCode) && { "x-amzn-transcribe-language-code": input.LanguageCode! }), ...(isSerializableHeaderValue(input.MediaSampleRateHertz) && { "x-amzn-transcribe-sample-rate": input.MediaSampleRateHertz!.toString(), @@ -89,7 +88,6 @@ export const serializeAws_restJson1StartStreamTranscriptionCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.LanguageCode) && { "x-amzn-transcribe-language-code": input.LanguageCode! }), ...(isSerializableHeaderValue(input.MediaSampleRateHertz) && { "x-amzn-transcribe-sample-rate": input.MediaSampleRateHertz!.toString(), @@ -694,7 +692,8 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async ( const serializeAws_restJson1AudioEvent = (input: AudioEvent, context: __SerdeContext): any => { return { - ...(input.AudioChunk !== undefined && { AudioChunk: context.base64Encoder(input.AudioChunk) }), + ...(input.AudioChunk !== undefined && + input.AudioChunk !== null && { AudioChunk: context.base64Encoder(input.AudioChunk) }), }; }; @@ -716,7 +715,14 @@ const deserializeAws_restJson1Alternative = (output: any, context: __SerdeContex }; const deserializeAws_restJson1AlternativeList = (output: any, context: __SerdeContext): Alternative[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Alternative(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Alternative(entry, context); + }); }; const deserializeAws_restJson1Item = (output: any, context: __SerdeContext): Item => { @@ -734,7 +740,14 @@ const deserializeAws_restJson1Item = (output: any, context: __SerdeContext): Ite }; const deserializeAws_restJson1ItemList = (output: any, context: __SerdeContext): Item[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Item(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Item(entry, context); + }); }; const deserializeAws_restJson1MedicalAlternative = (output: any, context: __SerdeContext): MedicalAlternative => { @@ -748,7 +761,14 @@ const deserializeAws_restJson1MedicalAlternative = (output: any, context: __Serd }; const deserializeAws_restJson1MedicalAlternativeList = (output: any, context: __SerdeContext): MedicalAlternative[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MedicalAlternative(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MedicalAlternative(entry, context); + }); }; const deserializeAws_restJson1MedicalItem = (output: any, context: __SerdeContext): MedicalItem => { @@ -763,7 +783,14 @@ const deserializeAws_restJson1MedicalItem = (output: any, context: __SerdeContex }; const deserializeAws_restJson1MedicalItemList = (output: any, context: __SerdeContext): MedicalItem[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MedicalItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MedicalItem(entry, context); + }); }; const deserializeAws_restJson1MedicalResult = (output: any, context: __SerdeContext): MedicalResult => { @@ -781,7 +808,14 @@ const deserializeAws_restJson1MedicalResult = (output: any, context: __SerdeCont }; const deserializeAws_restJson1MedicalResultList = (output: any, context: __SerdeContext): MedicalResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1MedicalResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1MedicalResult(entry, context); + }); }; const deserializeAws_restJson1MedicalTranscript = (output: any, context: __SerdeContext): MedicalTranscript => { @@ -820,7 +854,14 @@ const deserializeAws_restJson1Result = (output: any, context: __SerdeContext): R }; const deserializeAws_restJson1ResultList = (output: any, context: __SerdeContext): Result[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Result(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Result(entry, context); + }); }; const deserializeAws_restJson1Transcript = (output: any, context: __SerdeContext): Transcript => { @@ -861,6 +902,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-transcribe/protocols/Aws_json1_1.ts b/clients/client-transcribe/protocols/Aws_json1_1.ts index e2b42c04693e..5788e41693d8 100644 --- a/clients/client-transcribe/protocols/Aws_json1_1.ts +++ b/clients/client-transcribe/protocols/Aws_json1_1.ts @@ -175,7 +175,7 @@ export const serializeAws_json1_1CreateLanguageModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.CreateLanguageModel", }; let body: any; @@ -188,7 +188,7 @@ export const serializeAws_json1_1CreateMedicalVocabularyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.CreateMedicalVocabulary", }; let body: any; @@ -201,7 +201,7 @@ export const serializeAws_json1_1CreateVocabularyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.CreateVocabulary", }; let body: any; @@ -214,7 +214,7 @@ export const serializeAws_json1_1CreateVocabularyFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.CreateVocabularyFilter", }; let body: any; @@ -227,7 +227,7 @@ export const serializeAws_json1_1DeleteLanguageModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.DeleteLanguageModel", }; let body: any; @@ -240,7 +240,7 @@ export const serializeAws_json1_1DeleteMedicalTranscriptionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.DeleteMedicalTranscriptionJob", }; let body: any; @@ -253,7 +253,7 @@ export const serializeAws_json1_1DeleteMedicalVocabularyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.DeleteMedicalVocabulary", }; let body: any; @@ -266,7 +266,7 @@ export const serializeAws_json1_1DeleteTranscriptionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.DeleteTranscriptionJob", }; let body: any; @@ -279,7 +279,7 @@ export const serializeAws_json1_1DeleteVocabularyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.DeleteVocabulary", }; let body: any; @@ -292,7 +292,7 @@ export const serializeAws_json1_1DeleteVocabularyFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.DeleteVocabularyFilter", }; let body: any; @@ -305,7 +305,7 @@ export const serializeAws_json1_1DescribeLanguageModelCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.DescribeLanguageModel", }; let body: any; @@ -318,7 +318,7 @@ export const serializeAws_json1_1GetMedicalTranscriptionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.GetMedicalTranscriptionJob", }; let body: any; @@ -331,7 +331,7 @@ export const serializeAws_json1_1GetMedicalVocabularyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.GetMedicalVocabulary", }; let body: any; @@ -344,7 +344,7 @@ export const serializeAws_json1_1GetTranscriptionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.GetTranscriptionJob", }; let body: any; @@ -357,7 +357,7 @@ export const serializeAws_json1_1GetVocabularyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.GetVocabulary", }; let body: any; @@ -370,7 +370,7 @@ export const serializeAws_json1_1GetVocabularyFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.GetVocabularyFilter", }; let body: any; @@ -383,7 +383,7 @@ export const serializeAws_json1_1ListLanguageModelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.ListLanguageModels", }; let body: any; @@ -396,7 +396,7 @@ export const serializeAws_json1_1ListMedicalTranscriptionJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.ListMedicalTranscriptionJobs", }; let body: any; @@ -409,7 +409,7 @@ export const serializeAws_json1_1ListMedicalVocabulariesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.ListMedicalVocabularies", }; let body: any; @@ -422,7 +422,7 @@ export const serializeAws_json1_1ListTranscriptionJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.ListTranscriptionJobs", }; let body: any; @@ -435,7 +435,7 @@ export const serializeAws_json1_1ListVocabulariesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.ListVocabularies", }; let body: any; @@ -448,7 +448,7 @@ export const serializeAws_json1_1ListVocabularyFiltersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.ListVocabularyFilters", }; let body: any; @@ -461,7 +461,7 @@ export const serializeAws_json1_1StartMedicalTranscriptionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.StartMedicalTranscriptionJob", }; let body: any; @@ -474,7 +474,7 @@ export const serializeAws_json1_1StartTranscriptionJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.StartTranscriptionJob", }; let body: any; @@ -487,7 +487,7 @@ export const serializeAws_json1_1UpdateMedicalVocabularyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.UpdateMedicalVocabulary", }; let body: any; @@ -500,7 +500,7 @@ export const serializeAws_json1_1UpdateVocabularyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.UpdateVocabulary", }; let body: any; @@ -513,7 +513,7 @@ export const serializeAws_json1_1UpdateVocabularyFilterCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "Transcribe.UpdateVocabularyFilter", }; let body: any; @@ -548,8 +548,7 @@ const deserializeAws_json1_1CreateLanguageModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -627,8 +626,7 @@ const deserializeAws_json1_1CreateMedicalVocabularyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -706,8 +704,7 @@ const deserializeAws_json1_1CreateVocabularyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -785,8 +782,7 @@ const deserializeAws_json1_1CreateVocabularyFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -861,8 +857,7 @@ const deserializeAws_json1_1DeleteLanguageModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -929,8 +924,7 @@ const deserializeAws_json1_1DeleteMedicalTranscriptionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -997,8 +991,7 @@ const deserializeAws_json1_1DeleteMedicalVocabularyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1073,8 +1066,7 @@ const deserializeAws_json1_1DeleteTranscriptionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1141,8 +1133,7 @@ const deserializeAws_json1_1DeleteVocabularyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1217,8 +1208,7 @@ const deserializeAws_json1_1DeleteVocabularyFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1296,8 +1286,7 @@ const deserializeAws_json1_1DescribeLanguageModelCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1375,8 +1364,7 @@ const deserializeAws_json1_1GetMedicalTranscriptionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1454,8 +1442,7 @@ const deserializeAws_json1_1GetMedicalVocabularyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1533,8 +1520,7 @@ const deserializeAws_json1_1GetTranscriptionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1612,8 +1598,7 @@ const deserializeAws_json1_1GetVocabularyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1691,8 +1676,7 @@ const deserializeAws_json1_1GetVocabularyFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1770,8 +1754,7 @@ const deserializeAws_json1_1ListLanguageModelsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1841,8 +1824,7 @@ const deserializeAws_json1_1ListMedicalTranscriptionJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1912,8 +1894,7 @@ const deserializeAws_json1_1ListMedicalVocabulariesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -1983,8 +1964,7 @@ const deserializeAws_json1_1ListTranscriptionJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -2054,8 +2034,7 @@ const deserializeAws_json1_1ListVocabulariesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -2125,8 +2104,7 @@ const deserializeAws_json1_1ListVocabularyFiltersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -2196,8 +2174,7 @@ const deserializeAws_json1_1StartMedicalTranscriptionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -2275,8 +2252,7 @@ const deserializeAws_json1_1StartTranscriptionJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -2354,8 +2330,7 @@ const deserializeAws_json1_1UpdateMedicalVocabularyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -2441,8 +2416,7 @@ const deserializeAws_json1_1UpdateVocabularyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -2528,8 +2502,7 @@ const deserializeAws_json1_1UpdateVocabularyFilterCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": @@ -2657,8 +2630,9 @@ const deserializeAws_json1_1NotFoundExceptionResponse = async ( const serializeAws_json1_1ContentRedaction = (input: ContentRedaction, context: __SerdeContext): any => { return { - ...(input.RedactionOutput !== undefined && { RedactionOutput: input.RedactionOutput }), - ...(input.RedactionType !== undefined && { RedactionType: input.RedactionType }), + ...(input.RedactionOutput !== undefined && + input.RedactionOutput !== null && { RedactionOutput: input.RedactionOutput }), + ...(input.RedactionType !== undefined && input.RedactionType !== null && { RedactionType: input.RedactionType }), }; }; @@ -2667,12 +2641,13 @@ const serializeAws_json1_1CreateLanguageModelRequest = ( context: __SerdeContext ): any => { return { - ...(input.BaseModelName !== undefined && { BaseModelName: input.BaseModelName }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), + ...(input.BaseModelName !== undefined && input.BaseModelName !== null && { BaseModelName: input.BaseModelName }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), }; }; @@ -2681,9 +2656,11 @@ const serializeAws_json1_1CreateMedicalVocabularyRequest = ( context: __SerdeContext ): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.VocabularyFileUri !== undefined && { VocabularyFileUri: input.VocabularyFileUri }), - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.VocabularyFileUri !== undefined && + input.VocabularyFileUri !== null && { VocabularyFileUri: input.VocabularyFileUri }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; @@ -2692,19 +2669,25 @@ const serializeAws_json1_1CreateVocabularyFilterRequest = ( context: __SerdeContext ): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.VocabularyFilterFileUri !== undefined && { VocabularyFilterFileUri: input.VocabularyFilterFileUri }), - ...(input.VocabularyFilterName !== undefined && { VocabularyFilterName: input.VocabularyFilterName }), - ...(input.Words !== undefined && { Words: serializeAws_json1_1Words(input.Words, context) }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.VocabularyFilterFileUri !== undefined && + input.VocabularyFilterFileUri !== null && { VocabularyFilterFileUri: input.VocabularyFilterFileUri }), + ...(input.VocabularyFilterName !== undefined && + input.VocabularyFilterName !== null && { VocabularyFilterName: input.VocabularyFilterName }), + ...(input.Words !== undefined && + input.Words !== null && { Words: serializeAws_json1_1Words(input.Words, context) }), }; }; const serializeAws_json1_1CreateVocabularyRequest = (input: CreateVocabularyRequest, context: __SerdeContext): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Phrases !== undefined && { Phrases: serializeAws_json1_1Phrases(input.Phrases, context) }), - ...(input.VocabularyFileUri !== undefined && { VocabularyFileUri: input.VocabularyFileUri }), - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Phrases !== undefined && + input.Phrases !== null && { Phrases: serializeAws_json1_1Phrases(input.Phrases, context) }), + ...(input.VocabularyFileUri !== undefined && + input.VocabularyFileUri !== null && { VocabularyFileUri: input.VocabularyFileUri }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; @@ -2713,7 +2696,7 @@ const serializeAws_json1_1DeleteLanguageModelRequest = ( context: __SerdeContext ): any => { return { - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), }; }; @@ -2722,9 +2705,8 @@ const serializeAws_json1_1DeleteMedicalTranscriptionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.MedicalTranscriptionJobName !== undefined && { - MedicalTranscriptionJobName: input.MedicalTranscriptionJobName, - }), + ...(input.MedicalTranscriptionJobName !== undefined && + input.MedicalTranscriptionJobName !== null && { MedicalTranscriptionJobName: input.MedicalTranscriptionJobName }), }; }; @@ -2733,7 +2715,8 @@ const serializeAws_json1_1DeleteMedicalVocabularyRequest = ( context: __SerdeContext ): any => { return { - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; @@ -2742,7 +2725,8 @@ const serializeAws_json1_1DeleteTranscriptionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.TranscriptionJobName !== undefined && { TranscriptionJobName: input.TranscriptionJobName }), + ...(input.TranscriptionJobName !== undefined && + input.TranscriptionJobName !== null && { TranscriptionJobName: input.TranscriptionJobName }), }; }; @@ -2751,13 +2735,15 @@ const serializeAws_json1_1DeleteVocabularyFilterRequest = ( context: __SerdeContext ): any => { return { - ...(input.VocabularyFilterName !== undefined && { VocabularyFilterName: input.VocabularyFilterName }), + ...(input.VocabularyFilterName !== undefined && + input.VocabularyFilterName !== null && { VocabularyFilterName: input.VocabularyFilterName }), }; }; const serializeAws_json1_1DeleteVocabularyRequest = (input: DeleteVocabularyRequest, context: __SerdeContext): any => { return { - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; @@ -2766,7 +2752,7 @@ const serializeAws_json1_1DescribeLanguageModelRequest = ( context: __SerdeContext ): any => { return { - ...(input.ModelName !== undefined && { ModelName: input.ModelName }), + ...(input.ModelName !== undefined && input.ModelName !== null && { ModelName: input.ModelName }), }; }; @@ -2775,9 +2761,8 @@ const serializeAws_json1_1GetMedicalTranscriptionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.MedicalTranscriptionJobName !== undefined && { - MedicalTranscriptionJobName: input.MedicalTranscriptionJobName, - }), + ...(input.MedicalTranscriptionJobName !== undefined && + input.MedicalTranscriptionJobName !== null && { MedicalTranscriptionJobName: input.MedicalTranscriptionJobName }), }; }; @@ -2786,7 +2771,8 @@ const serializeAws_json1_1GetMedicalVocabularyRequest = ( context: __SerdeContext ): any => { return { - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; @@ -2795,7 +2781,8 @@ const serializeAws_json1_1GetTranscriptionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.TranscriptionJobName !== undefined && { TranscriptionJobName: input.TranscriptionJobName }), + ...(input.TranscriptionJobName !== undefined && + input.TranscriptionJobName !== null && { TranscriptionJobName: input.TranscriptionJobName }), }; }; @@ -2804,33 +2791,46 @@ const serializeAws_json1_1GetVocabularyFilterRequest = ( context: __SerdeContext ): any => { return { - ...(input.VocabularyFilterName !== undefined && { VocabularyFilterName: input.VocabularyFilterName }), + ...(input.VocabularyFilterName !== undefined && + input.VocabularyFilterName !== null && { VocabularyFilterName: input.VocabularyFilterName }), }; }; const serializeAws_json1_1GetVocabularyRequest = (input: GetVocabularyRequest, context: __SerdeContext): any => { return { - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; const serializeAws_json1_1InputDataConfig = (input: InputDataConfig, context: __SerdeContext): any => { return { - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), - ...(input.TuningDataS3Uri !== undefined && { TuningDataS3Uri: input.TuningDataS3Uri }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), + ...(input.TuningDataS3Uri !== undefined && + input.TuningDataS3Uri !== null && { TuningDataS3Uri: input.TuningDataS3Uri }), }; }; const serializeAws_json1_1JobExecutionSettings = (input: JobExecutionSettings, context: __SerdeContext): any => { return { - ...(input.AllowDeferredExecution !== undefined && { AllowDeferredExecution: input.AllowDeferredExecution }), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.AllowDeferredExecution !== undefined && + input.AllowDeferredExecution !== null && { AllowDeferredExecution: input.AllowDeferredExecution }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), }; }; const serializeAws_json1_1LanguageOptions = (input: (LanguageCode | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListLanguageModelsRequest = ( @@ -2838,10 +2838,10 @@ const serializeAws_json1_1ListLanguageModelsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StatusEquals !== undefined && { StatusEquals: input.StatusEquals }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StatusEquals !== undefined && input.StatusEquals !== null && { StatusEquals: input.StatusEquals }), }; }; @@ -2850,10 +2850,11 @@ const serializeAws_json1_1ListMedicalTranscriptionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobNameContains !== undefined && { JobNameContains: input.JobNameContains }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.JobNameContains !== undefined && + input.JobNameContains !== null && { JobNameContains: input.JobNameContains }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; @@ -2862,10 +2863,10 @@ const serializeAws_json1_1ListMedicalVocabulariesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StateEquals !== undefined && { StateEquals: input.StateEquals }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StateEquals !== undefined && input.StateEquals !== null && { StateEquals: input.StateEquals }), }; }; @@ -2874,19 +2875,20 @@ const serializeAws_json1_1ListTranscriptionJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobNameContains !== undefined && { JobNameContains: input.JobNameContains }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Status !== undefined && { Status: input.Status }), + ...(input.JobNameContains !== undefined && + input.JobNameContains !== null && { JobNameContains: input.JobNameContains }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }), }; }; const serializeAws_json1_1ListVocabulariesRequest = (input: ListVocabulariesRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StateEquals !== undefined && { StateEquals: input.StateEquals }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StateEquals !== undefined && input.StateEquals !== null && { StateEquals: input.StateEquals }), }; }; @@ -2895,15 +2897,15 @@ const serializeAws_json1_1ListVocabularyFiltersRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NameContains !== undefined && { NameContains: input.NameContains }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && input.NameContains !== null && { NameContains: input.NameContains }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1Media = (input: Media, context: __SerdeContext): any => { return { - ...(input.MediaFileUri !== undefined && { MediaFileUri: input.MediaFileUri }), + ...(input.MediaFileUri !== undefined && input.MediaFileUri !== null && { MediaFileUri: input.MediaFileUri }), }; }; @@ -2912,35 +2914,57 @@ const serializeAws_json1_1MedicalTranscriptionSetting = ( context: __SerdeContext ): any => { return { - ...(input.ChannelIdentification !== undefined && { ChannelIdentification: input.ChannelIdentification }), - ...(input.MaxAlternatives !== undefined && { MaxAlternatives: input.MaxAlternatives }), - ...(input.MaxSpeakerLabels !== undefined && { MaxSpeakerLabels: input.MaxSpeakerLabels }), - ...(input.ShowAlternatives !== undefined && { ShowAlternatives: input.ShowAlternatives }), - ...(input.ShowSpeakerLabels !== undefined && { ShowSpeakerLabels: input.ShowSpeakerLabels }), - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.ChannelIdentification !== undefined && + input.ChannelIdentification !== null && { ChannelIdentification: input.ChannelIdentification }), + ...(input.MaxAlternatives !== undefined && + input.MaxAlternatives !== null && { MaxAlternatives: input.MaxAlternatives }), + ...(input.MaxSpeakerLabels !== undefined && + input.MaxSpeakerLabels !== null && { MaxSpeakerLabels: input.MaxSpeakerLabels }), + ...(input.ShowAlternatives !== undefined && + input.ShowAlternatives !== null && { ShowAlternatives: input.ShowAlternatives }), + ...(input.ShowSpeakerLabels !== undefined && + input.ShowSpeakerLabels !== null && { ShowSpeakerLabels: input.ShowSpeakerLabels }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; const serializeAws_json1_1ModelSettings = (input: ModelSettings, context: __SerdeContext): any => { return { - ...(input.LanguageModelName !== undefined && { LanguageModelName: input.LanguageModelName }), + ...(input.LanguageModelName !== undefined && + input.LanguageModelName !== null && { LanguageModelName: input.LanguageModelName }), }; }; const serializeAws_json1_1Phrases = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Settings = (input: Settings, context: __SerdeContext): any => { return { - ...(input.ChannelIdentification !== undefined && { ChannelIdentification: input.ChannelIdentification }), - ...(input.MaxAlternatives !== undefined && { MaxAlternatives: input.MaxAlternatives }), - ...(input.MaxSpeakerLabels !== undefined && { MaxSpeakerLabels: input.MaxSpeakerLabels }), - ...(input.ShowAlternatives !== undefined && { ShowAlternatives: input.ShowAlternatives }), - ...(input.ShowSpeakerLabels !== undefined && { ShowSpeakerLabels: input.ShowSpeakerLabels }), - ...(input.VocabularyFilterMethod !== undefined && { VocabularyFilterMethod: input.VocabularyFilterMethod }), - ...(input.VocabularyFilterName !== undefined && { VocabularyFilterName: input.VocabularyFilterName }), - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.ChannelIdentification !== undefined && + input.ChannelIdentification !== null && { ChannelIdentification: input.ChannelIdentification }), + ...(input.MaxAlternatives !== undefined && + input.MaxAlternatives !== null && { MaxAlternatives: input.MaxAlternatives }), + ...(input.MaxSpeakerLabels !== undefined && + input.MaxSpeakerLabels !== null && { MaxSpeakerLabels: input.MaxSpeakerLabels }), + ...(input.ShowAlternatives !== undefined && + input.ShowAlternatives !== null && { ShowAlternatives: input.ShowAlternatives }), + ...(input.ShowSpeakerLabels !== undefined && + input.ShowSpeakerLabels !== null && { ShowSpeakerLabels: input.ShowSpeakerLabels }), + ...(input.VocabularyFilterMethod !== undefined && + input.VocabularyFilterMethod !== null && { VocabularyFilterMethod: input.VocabularyFilterMethod }), + ...(input.VocabularyFilterName !== undefined && + input.VocabularyFilterName !== null && { VocabularyFilterName: input.VocabularyFilterName }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; @@ -2949,21 +2973,25 @@ const serializeAws_json1_1StartMedicalTranscriptionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Media !== undefined && { Media: serializeAws_json1_1Media(input.Media, context) }), - ...(input.MediaFormat !== undefined && { MediaFormat: input.MediaFormat }), - ...(input.MediaSampleRateHertz !== undefined && { MediaSampleRateHertz: input.MediaSampleRateHertz }), - ...(input.MedicalTranscriptionJobName !== undefined && { - MedicalTranscriptionJobName: input.MedicalTranscriptionJobName, - }), - ...(input.OutputBucketName !== undefined && { OutputBucketName: input.OutputBucketName }), - ...(input.OutputEncryptionKMSKeyId !== undefined && { OutputEncryptionKMSKeyId: input.OutputEncryptionKMSKeyId }), - ...(input.OutputKey !== undefined && { OutputKey: input.OutputKey }), - ...(input.Settings !== undefined && { - Settings: serializeAws_json1_1MedicalTranscriptionSetting(input.Settings, context), - }), - ...(input.Specialty !== undefined && { Specialty: input.Specialty }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Media !== undefined && + input.Media !== null && { Media: serializeAws_json1_1Media(input.Media, context) }), + ...(input.MediaFormat !== undefined && input.MediaFormat !== null && { MediaFormat: input.MediaFormat }), + ...(input.MediaSampleRateHertz !== undefined && + input.MediaSampleRateHertz !== null && { MediaSampleRateHertz: input.MediaSampleRateHertz }), + ...(input.MedicalTranscriptionJobName !== undefined && + input.MedicalTranscriptionJobName !== null && { MedicalTranscriptionJobName: input.MedicalTranscriptionJobName }), + ...(input.OutputBucketName !== undefined && + input.OutputBucketName !== null && { OutputBucketName: input.OutputBucketName }), + ...(input.OutputEncryptionKMSKeyId !== undefined && + input.OutputEncryptionKMSKeyId !== null && { OutputEncryptionKMSKeyId: input.OutputEncryptionKMSKeyId }), + ...(input.OutputKey !== undefined && input.OutputKey !== null && { OutputKey: input.OutputKey }), + ...(input.Settings !== undefined && + input.Settings !== null && { + Settings: serializeAws_json1_1MedicalTranscriptionSetting(input.Settings, context), + }), + ...(input.Specialty !== undefined && input.Specialty !== null && { Specialty: input.Specialty }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -2972,28 +3000,39 @@ const serializeAws_json1_1StartTranscriptionJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.ContentRedaction !== undefined && { - ContentRedaction: serializeAws_json1_1ContentRedaction(input.ContentRedaction, context), - }), - ...(input.IdentifyLanguage !== undefined && { IdentifyLanguage: input.IdentifyLanguage }), - ...(input.JobExecutionSettings !== undefined && { - JobExecutionSettings: serializeAws_json1_1JobExecutionSettings(input.JobExecutionSettings, context), - }), - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.LanguageOptions !== undefined && { - LanguageOptions: serializeAws_json1_1LanguageOptions(input.LanguageOptions, context), - }), - ...(input.Media !== undefined && { Media: serializeAws_json1_1Media(input.Media, context) }), - ...(input.MediaFormat !== undefined && { MediaFormat: input.MediaFormat }), - ...(input.MediaSampleRateHertz !== undefined && { MediaSampleRateHertz: input.MediaSampleRateHertz }), - ...(input.ModelSettings !== undefined && { - ModelSettings: serializeAws_json1_1ModelSettings(input.ModelSettings, context), - }), - ...(input.OutputBucketName !== undefined && { OutputBucketName: input.OutputBucketName }), - ...(input.OutputEncryptionKMSKeyId !== undefined && { OutputEncryptionKMSKeyId: input.OutputEncryptionKMSKeyId }), - ...(input.OutputKey !== undefined && { OutputKey: input.OutputKey }), - ...(input.Settings !== undefined && { Settings: serializeAws_json1_1Settings(input.Settings, context) }), - ...(input.TranscriptionJobName !== undefined && { TranscriptionJobName: input.TranscriptionJobName }), + ...(input.ContentRedaction !== undefined && + input.ContentRedaction !== null && { + ContentRedaction: serializeAws_json1_1ContentRedaction(input.ContentRedaction, context), + }), + ...(input.IdentifyLanguage !== undefined && + input.IdentifyLanguage !== null && { IdentifyLanguage: input.IdentifyLanguage }), + ...(input.JobExecutionSettings !== undefined && + input.JobExecutionSettings !== null && { + JobExecutionSettings: serializeAws_json1_1JobExecutionSettings(input.JobExecutionSettings, context), + }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.LanguageOptions !== undefined && + input.LanguageOptions !== null && { + LanguageOptions: serializeAws_json1_1LanguageOptions(input.LanguageOptions, context), + }), + ...(input.Media !== undefined && + input.Media !== null && { Media: serializeAws_json1_1Media(input.Media, context) }), + ...(input.MediaFormat !== undefined && input.MediaFormat !== null && { MediaFormat: input.MediaFormat }), + ...(input.MediaSampleRateHertz !== undefined && + input.MediaSampleRateHertz !== null && { MediaSampleRateHertz: input.MediaSampleRateHertz }), + ...(input.ModelSettings !== undefined && + input.ModelSettings !== null && { + ModelSettings: serializeAws_json1_1ModelSettings(input.ModelSettings, context), + }), + ...(input.OutputBucketName !== undefined && + input.OutputBucketName !== null && { OutputBucketName: input.OutputBucketName }), + ...(input.OutputEncryptionKMSKeyId !== undefined && + input.OutputEncryptionKMSKeyId !== null && { OutputEncryptionKMSKeyId: input.OutputEncryptionKMSKeyId }), + ...(input.OutputKey !== undefined && input.OutputKey !== null && { OutputKey: input.OutputKey }), + ...(input.Settings !== undefined && + input.Settings !== null && { Settings: serializeAws_json1_1Settings(input.Settings, context) }), + ...(input.TranscriptionJobName !== undefined && + input.TranscriptionJobName !== null && { TranscriptionJobName: input.TranscriptionJobName }), }; }; @@ -3002,9 +3041,11 @@ const serializeAws_json1_1UpdateMedicalVocabularyRequest = ( context: __SerdeContext ): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.VocabularyFileUri !== undefined && { VocabularyFileUri: input.VocabularyFileUri }), - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.VocabularyFileUri !== undefined && + input.VocabularyFileUri !== null && { VocabularyFileUri: input.VocabularyFileUri }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; @@ -3013,23 +3054,36 @@ const serializeAws_json1_1UpdateVocabularyFilterRequest = ( context: __SerdeContext ): any => { return { - ...(input.VocabularyFilterFileUri !== undefined && { VocabularyFilterFileUri: input.VocabularyFilterFileUri }), - ...(input.VocabularyFilterName !== undefined && { VocabularyFilterName: input.VocabularyFilterName }), - ...(input.Words !== undefined && { Words: serializeAws_json1_1Words(input.Words, context) }), + ...(input.VocabularyFilterFileUri !== undefined && + input.VocabularyFilterFileUri !== null && { VocabularyFilterFileUri: input.VocabularyFilterFileUri }), + ...(input.VocabularyFilterName !== undefined && + input.VocabularyFilterName !== null && { VocabularyFilterName: input.VocabularyFilterName }), + ...(input.Words !== undefined && + input.Words !== null && { Words: serializeAws_json1_1Words(input.Words, context) }), }; }; const serializeAws_json1_1UpdateVocabularyRequest = (input: UpdateVocabularyRequest, context: __SerdeContext): any => { return { - ...(input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode }), - ...(input.Phrases !== undefined && { Phrases: serializeAws_json1_1Phrases(input.Phrases, context) }), - ...(input.VocabularyFileUri !== undefined && { VocabularyFileUri: input.VocabularyFileUri }), - ...(input.VocabularyName !== undefined && { VocabularyName: input.VocabularyName }), + ...(input.LanguageCode !== undefined && input.LanguageCode !== null && { LanguageCode: input.LanguageCode }), + ...(input.Phrases !== undefined && + input.Phrases !== null && { Phrases: serializeAws_json1_1Phrases(input.Phrases, context) }), + ...(input.VocabularyFileUri !== undefined && + input.VocabularyFileUri !== null && { VocabularyFileUri: input.VocabularyFileUri }), + ...(input.VocabularyName !== undefined && + input.VocabularyName !== null && { VocabularyName: input.VocabularyName }), }; }; const serializeAws_json1_1Words = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1BadRequestException = (output: any, context: __SerdeContext): BadRequestException => { @@ -3279,7 +3333,14 @@ const deserializeAws_json1_1LanguageModel = (output: any, context: __SerdeContex }; const deserializeAws_json1_1LanguageOptions = (output: any, context: __SerdeContext): (LanguageCode | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -3439,7 +3500,14 @@ const deserializeAws_json1_1MedicalTranscriptionJobSummaries = ( output: any, context: __SerdeContext ): MedicalTranscriptionJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MedicalTranscriptionJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MedicalTranscriptionJobSummary(entry, context); + }); }; const deserializeAws_json1_1MedicalTranscriptionJobSummary = ( @@ -3504,7 +3572,14 @@ const deserializeAws_json1_1MedicalTranscriptionSetting = ( }; const deserializeAws_json1_1Models = (output: any, context: __SerdeContext): LanguageModel[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LanguageModel(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LanguageModel(entry, context); + }); }; const deserializeAws_json1_1ModelSettings = (output: any, context: __SerdeContext): ModelSettings => { @@ -3659,7 +3734,14 @@ const deserializeAws_json1_1TranscriptionJobSummaries = ( output: any, context: __SerdeContext ): TranscriptionJobSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TranscriptionJobSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TranscriptionJobSummary(entry, context); + }); }; const deserializeAws_json1_1TranscriptionJobSummary = ( @@ -3763,7 +3845,14 @@ const deserializeAws_json1_1UpdateVocabularyResponse = ( }; const deserializeAws_json1_1Vocabularies = (output: any, context: __SerdeContext): VocabularyInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VocabularyInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VocabularyInfo(entry, context); + }); }; const deserializeAws_json1_1VocabularyFilterInfo = (output: any, context: __SerdeContext): VocabularyFilterInfo => { @@ -3781,7 +3870,14 @@ const deserializeAws_json1_1VocabularyFilterInfo = (output: any, context: __Serd }; const deserializeAws_json1_1VocabularyFilters = (output: any, context: __SerdeContext): VocabularyFilterInfo[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1VocabularyFilterInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1VocabularyFilterInfo(entry, context); + }); }; const deserializeAws_json1_1VocabularyInfo = (output: any, context: __SerdeContext): VocabularyInfo => { @@ -3848,3 +3944,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-transfer/protocols/Aws_json1_1.ts b/clients/client-transfer/protocols/Aws_json1_1.ts index cc0c79142baa..d7eb430d6b7c 100644 --- a/clients/client-transfer/protocols/Aws_json1_1.ts +++ b/clients/client-transfer/protocols/Aws_json1_1.ts @@ -100,7 +100,7 @@ export const serializeAws_json1_1CreateServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.CreateServer", }; let body: any; @@ -113,7 +113,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.CreateUser", }; let body: any; @@ -126,7 +126,7 @@ export const serializeAws_json1_1DeleteServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.DeleteServer", }; let body: any; @@ -139,7 +139,7 @@ export const serializeAws_json1_1DeleteSshPublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.DeleteSshPublicKey", }; let body: any; @@ -152,7 +152,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.DeleteUser", }; let body: any; @@ -165,7 +165,7 @@ export const serializeAws_json1_1DescribeSecurityPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.DescribeSecurityPolicy", }; let body: any; @@ -178,7 +178,7 @@ export const serializeAws_json1_1DescribeServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.DescribeServer", }; let body: any; @@ -191,7 +191,7 @@ export const serializeAws_json1_1DescribeUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.DescribeUser", }; let body: any; @@ -204,7 +204,7 @@ export const serializeAws_json1_1ImportSshPublicKeyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.ImportSshPublicKey", }; let body: any; @@ -217,7 +217,7 @@ export const serializeAws_json1_1ListSecurityPoliciesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.ListSecurityPolicies", }; let body: any; @@ -230,7 +230,7 @@ export const serializeAws_json1_1ListServersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.ListServers", }; let body: any; @@ -243,7 +243,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.ListTagsForResource", }; let body: any; @@ -256,7 +256,7 @@ export const serializeAws_json1_1ListUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.ListUsers", }; let body: any; @@ -269,7 +269,7 @@ export const serializeAws_json1_1StartServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.StartServer", }; let body: any; @@ -282,7 +282,7 @@ export const serializeAws_json1_1StopServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.StopServer", }; let body: any; @@ -295,7 +295,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.TagResource", }; let body: any; @@ -308,7 +308,7 @@ export const serializeAws_json1_1TestIdentityProviderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.TestIdentityProvider", }; let body: any; @@ -321,7 +321,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.UntagResource", }; let body: any; @@ -334,7 +334,7 @@ export const serializeAws_json1_1UpdateServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.UpdateServer", }; let body: any; @@ -347,7 +347,7 @@ export const serializeAws_json1_1UpdateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "TransferService.UpdateUser", }; let body: any; @@ -382,8 +382,7 @@ const deserializeAws_json1_1CreateServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.transfer#AccessDeniedException": @@ -477,8 +476,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -561,8 +559,7 @@ const deserializeAws_json1_1DeleteServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.transfer#AccessDeniedException": @@ -645,8 +642,7 @@ const deserializeAws_json1_1DeleteSshPublicKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -729,8 +725,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -808,8 +803,7 @@ const deserializeAws_json1_1DescribeSecurityPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -887,8 +881,7 @@ const deserializeAws_json1_1DescribeServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -966,8 +959,7 @@ const deserializeAws_json1_1DescribeUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1045,8 +1037,7 @@ const deserializeAws_json1_1ImportSshPublicKeyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1140,8 +1131,7 @@ const deserializeAws_json1_1ListSecurityPoliciesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1219,8 +1209,7 @@ const deserializeAws_json1_1ListServersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1298,8 +1287,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1377,8 +1365,7 @@ const deserializeAws_json1_1ListUsersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1461,8 +1448,7 @@ const deserializeAws_json1_1StartServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1545,8 +1531,7 @@ const deserializeAws_json1_1StopServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1629,8 +1614,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1708,8 +1692,7 @@ const deserializeAws_json1_1TestIdentityProviderCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1784,8 +1767,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -1863,8 +1845,7 @@ const deserializeAws_json1_1UpdateServerCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.transfer#AccessDeniedException": @@ -1974,8 +1955,7 @@ const deserializeAws_json1_1UpdateUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServiceError": case "com.amazonaws.transfer#InternalServiceError": @@ -2170,47 +2150,62 @@ const deserializeAws_json1_1ThrottlingExceptionResponse = async ( }; const serializeAws_json1_1AddressAllocationIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateServerRequest = (input: CreateServerRequest, context: __SerdeContext): any => { return { - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.EndpointDetails !== undefined && { - EndpointDetails: serializeAws_json1_1EndpointDetails(input.EndpointDetails, context), - }), - ...(input.EndpointType !== undefined && { EndpointType: input.EndpointType }), - ...(input.HostKey !== undefined && { HostKey: input.HostKey }), - ...(input.IdentityProviderDetails !== undefined && { - IdentityProviderDetails: serializeAws_json1_1IdentityProviderDetails(input.IdentityProviderDetails, context), - }), - ...(input.IdentityProviderType !== undefined && { IdentityProviderType: input.IdentityProviderType }), - ...(input.LoggingRole !== undefined && { LoggingRole: input.LoggingRole }), - ...(input.Protocols !== undefined && { Protocols: serializeAws_json1_1Protocols(input.Protocols, context) }), - ...(input.SecurityPolicyName !== undefined && { SecurityPolicyName: input.SecurityPolicyName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.EndpointDetails !== undefined && + input.EndpointDetails !== null && { + EndpointDetails: serializeAws_json1_1EndpointDetails(input.EndpointDetails, context), + }), + ...(input.EndpointType !== undefined && input.EndpointType !== null && { EndpointType: input.EndpointType }), + ...(input.HostKey !== undefined && input.HostKey !== null && { HostKey: input.HostKey }), + ...(input.IdentityProviderDetails !== undefined && + input.IdentityProviderDetails !== null && { + IdentityProviderDetails: serializeAws_json1_1IdentityProviderDetails(input.IdentityProviderDetails, context), + }), + ...(input.IdentityProviderType !== undefined && + input.IdentityProviderType !== null && { IdentityProviderType: input.IdentityProviderType }), + ...(input.LoggingRole !== undefined && input.LoggingRole !== null && { LoggingRole: input.LoggingRole }), + ...(input.Protocols !== undefined && + input.Protocols !== null && { Protocols: serializeAws_json1_1Protocols(input.Protocols, context) }), + ...(input.SecurityPolicyName !== undefined && + input.SecurityPolicyName !== null && { SecurityPolicyName: input.SecurityPolicyName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1CreateUserRequest = (input: CreateUserRequest, context: __SerdeContext): any => { return { - ...(input.HomeDirectory !== undefined && { HomeDirectory: input.HomeDirectory }), - ...(input.HomeDirectoryMappings !== undefined && { - HomeDirectoryMappings: serializeAws_json1_1HomeDirectoryMappings(input.HomeDirectoryMappings, context), - }), - ...(input.HomeDirectoryType !== undefined && { HomeDirectoryType: input.HomeDirectoryType }), - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), - ...(input.SshPublicKeyBody !== undefined && { SshPublicKeyBody: input.SshPublicKeyBody }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.HomeDirectory !== undefined && input.HomeDirectory !== null && { HomeDirectory: input.HomeDirectory }), + ...(input.HomeDirectoryMappings !== undefined && + input.HomeDirectoryMappings !== null && { + HomeDirectoryMappings: serializeAws_json1_1HomeDirectoryMappings(input.HomeDirectoryMappings, context), + }), + ...(input.HomeDirectoryType !== undefined && + input.HomeDirectoryType !== null && { HomeDirectoryType: input.HomeDirectoryType }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), + ...(input.SshPublicKeyBody !== undefined && + input.SshPublicKeyBody !== null && { SshPublicKeyBody: input.SshPublicKeyBody }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; const serializeAws_json1_1DeleteServerRequest = (input: DeleteServerRequest, context: __SerdeContext): any => { return { - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), }; }; @@ -2219,16 +2214,17 @@ const serializeAws_json1_1DeleteSshPublicKeyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), - ...(input.SshPublicKeyId !== undefined && { SshPublicKeyId: input.SshPublicKeyId }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), + ...(input.SshPublicKeyId !== undefined && + input.SshPublicKeyId !== null && { SshPublicKeyId: input.SshPublicKeyId }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; const serializeAws_json1_1DeleteUserRequest = (input: DeleteUserRequest, context: __SerdeContext): any => { return { - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -2237,52 +2233,64 @@ const serializeAws_json1_1DescribeSecurityPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.SecurityPolicyName !== undefined && { SecurityPolicyName: input.SecurityPolicyName }), + ...(input.SecurityPolicyName !== undefined && + input.SecurityPolicyName !== null && { SecurityPolicyName: input.SecurityPolicyName }), }; }; const serializeAws_json1_1DescribeServerRequest = (input: DescribeServerRequest, context: __SerdeContext): any => { return { - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), }; }; const serializeAws_json1_1DescribeUserRequest = (input: DescribeUserRequest, context: __SerdeContext): any => { return { - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; const serializeAws_json1_1EndpointDetails = (input: EndpointDetails, context: __SerdeContext): any => { return { - ...(input.AddressAllocationIds !== undefined && { - AddressAllocationIds: serializeAws_json1_1AddressAllocationIds(input.AddressAllocationIds, context), - }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), - ...(input.VpcEndpointId !== undefined && { VpcEndpointId: input.VpcEndpointId }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.AddressAllocationIds !== undefined && + input.AddressAllocationIds !== null && { + AddressAllocationIds: serializeAws_json1_1AddressAllocationIds(input.AddressAllocationIds, context), + }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), + ...(input.VpcEndpointId !== undefined && input.VpcEndpointId !== null && { VpcEndpointId: input.VpcEndpointId }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }; }; const serializeAws_json1_1HomeDirectoryMapEntry = (input: HomeDirectoryMapEntry, context: __SerdeContext): any => { return { - ...(input.Entry !== undefined && { Entry: input.Entry }), - ...(input.Target !== undefined && { Target: input.Target }), + ...(input.Entry !== undefined && input.Entry !== null && { Entry: input.Entry }), + ...(input.Target !== undefined && input.Target !== null && { Target: input.Target }), }; }; const serializeAws_json1_1HomeDirectoryMappings = (input: HomeDirectoryMapEntry[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1HomeDirectoryMapEntry(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1HomeDirectoryMapEntry(entry, context); + }); }; const serializeAws_json1_1IdentityProviderDetails = (input: IdentityProviderDetails, context: __SerdeContext): any => { return { - ...(input.InvocationRole !== undefined && { InvocationRole: input.InvocationRole }), - ...(input.Url !== undefined && { Url: input.Url }), + ...(input.InvocationRole !== undefined && + input.InvocationRole !== null && { InvocationRole: input.InvocationRole }), + ...(input.Url !== undefined && input.Url !== null && { Url: input.Url }), }; }; @@ -2291,9 +2299,10 @@ const serializeAws_json1_1ImportSshPublicKeyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), - ...(input.SshPublicKeyBody !== undefined && { SshPublicKeyBody: input.SshPublicKeyBody }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), + ...(input.SshPublicKeyBody !== undefined && + input.SshPublicKeyBody !== null && { SshPublicKeyBody: input.SshPublicKeyBody }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -2302,15 +2311,15 @@ const serializeAws_json1_1ListSecurityPoliciesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListServersRequest = (input: ListServersRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -2319,64 +2328,99 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1ListUsersRequest = (input: ListUsersRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), }; }; const serializeAws_json1_1Protocols = (input: (Protocol | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartServerRequest = (input: StartServerRequest, context: __SerdeContext): any => { return { - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), }; }; const serializeAws_json1_1StopServerRequest = (input: StopServerRequest, context: __SerdeContext): any => { return { - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), }; }; const serializeAws_json1_1SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeys = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }), }; }; const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TestIdentityProviderRequest = ( @@ -2384,50 +2428,58 @@ const serializeAws_json1_1TestIdentityProviderRequest = ( context: __SerdeContext ): any => { return { - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), - ...(input.ServerProtocol !== undefined && { ServerProtocol: input.ServerProtocol }), - ...(input.SourceIp !== undefined && { SourceIp: input.SourceIp }), - ...(input.UserName !== undefined && { UserName: input.UserName }), - ...(input.UserPassword !== undefined && { UserPassword: input.UserPassword }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), + ...(input.ServerProtocol !== undefined && + input.ServerProtocol !== null && { ServerProtocol: input.ServerProtocol }), + ...(input.SourceIp !== undefined && input.SourceIp !== null && { SourceIp: input.SourceIp }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), + ...(input.UserPassword !== undefined && input.UserPassword !== null && { UserPassword: input.UserPassword }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.Arn !== undefined && { Arn: input.Arn }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), + ...(input.Arn !== undefined && input.Arn !== null && { Arn: input.Arn }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateServerRequest = (input: UpdateServerRequest, context: __SerdeContext): any => { return { - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.EndpointDetails !== undefined && { - EndpointDetails: serializeAws_json1_1EndpointDetails(input.EndpointDetails, context), - }), - ...(input.EndpointType !== undefined && { EndpointType: input.EndpointType }), - ...(input.HostKey !== undefined && { HostKey: input.HostKey }), - ...(input.IdentityProviderDetails !== undefined && { - IdentityProviderDetails: serializeAws_json1_1IdentityProviderDetails(input.IdentityProviderDetails, context), - }), - ...(input.LoggingRole !== undefined && { LoggingRole: input.LoggingRole }), - ...(input.Protocols !== undefined && { Protocols: serializeAws_json1_1Protocols(input.Protocols, context) }), - ...(input.SecurityPolicyName !== undefined && { SecurityPolicyName: input.SecurityPolicyName }), - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.EndpointDetails !== undefined && + input.EndpointDetails !== null && { + EndpointDetails: serializeAws_json1_1EndpointDetails(input.EndpointDetails, context), + }), + ...(input.EndpointType !== undefined && input.EndpointType !== null && { EndpointType: input.EndpointType }), + ...(input.HostKey !== undefined && input.HostKey !== null && { HostKey: input.HostKey }), + ...(input.IdentityProviderDetails !== undefined && + input.IdentityProviderDetails !== null && { + IdentityProviderDetails: serializeAws_json1_1IdentityProviderDetails(input.IdentityProviderDetails, context), + }), + ...(input.LoggingRole !== undefined && input.LoggingRole !== null && { LoggingRole: input.LoggingRole }), + ...(input.Protocols !== undefined && + input.Protocols !== null && { Protocols: serializeAws_json1_1Protocols(input.Protocols, context) }), + ...(input.SecurityPolicyName !== undefined && + input.SecurityPolicyName !== null && { SecurityPolicyName: input.SecurityPolicyName }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), }; }; const serializeAws_json1_1UpdateUserRequest = (input: UpdateUserRequest, context: __SerdeContext): any => { return { - ...(input.HomeDirectory !== undefined && { HomeDirectory: input.HomeDirectory }), - ...(input.HomeDirectoryMappings !== undefined && { - HomeDirectoryMappings: serializeAws_json1_1HomeDirectoryMappings(input.HomeDirectoryMappings, context), - }), - ...(input.HomeDirectoryType !== undefined && { HomeDirectoryType: input.HomeDirectoryType }), - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.ServerId !== undefined && { ServerId: input.ServerId }), - ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.HomeDirectory !== undefined && input.HomeDirectory !== null && { HomeDirectory: input.HomeDirectory }), + ...(input.HomeDirectoryMappings !== undefined && + input.HomeDirectoryMappings !== null && { + HomeDirectoryMappings: serializeAws_json1_1HomeDirectoryMappings(input.HomeDirectoryMappings, context), + }), + ...(input.HomeDirectoryType !== undefined && + input.HomeDirectoryType !== null && { HomeDirectoryType: input.HomeDirectoryType }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.ServerId !== undefined && input.ServerId !== null && { ServerId: input.ServerId }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), }; }; @@ -2438,7 +2490,14 @@ const deserializeAws_json1_1AccessDeniedException = (output: any, context: __Ser }; const deserializeAws_json1_1AddressAllocationIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ConflictException = (output: any, context: __SerdeContext): ConflictException => { @@ -2611,7 +2670,14 @@ const deserializeAws_json1_1HomeDirectoryMapEntry = (output: any, context: __Ser }; const deserializeAws_json1_1HomeDirectoryMappings = (output: any, context: __SerdeContext): HomeDirectoryMapEntry[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HomeDirectoryMapEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HomeDirectoryMapEntry(entry, context); + }); }; const deserializeAws_json1_1IdentityProviderDetails = ( @@ -2677,7 +2743,14 @@ const deserializeAws_json1_1ListedServer = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ListedServers = (output: any, context: __SerdeContext): ListedServer[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ListedServer(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ListedServer(entry, context); + }); }; const deserializeAws_json1_1ListedUser = (output: any, context: __SerdeContext): ListedUser => { @@ -2699,7 +2772,14 @@ const deserializeAws_json1_1ListedUser = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1ListedUsers = (output: any, context: __SerdeContext): ListedUser[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ListedUser(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ListedUser(entry, context); + }); }; const deserializeAws_json1_1ListSecurityPoliciesResponse = ( @@ -2749,7 +2829,14 @@ const deserializeAws_json1_1ListUsersResponse = (output: any, context: __SerdeCo }; const deserializeAws_json1_1Protocols = (output: any, context: __SerdeContext): (Protocol | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceExistsException = ( @@ -2775,15 +2862,36 @@ const deserializeAws_json1_1ResourceNotFoundException = ( }; const deserializeAws_json1_1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SecurityPolicyNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1SecurityPolicyOptions = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ServiceUnavailableException = ( @@ -2809,11 +2917,25 @@ const deserializeAws_json1_1SshPublicKey = (output: any, context: __SerdeContext }; const deserializeAws_json1_1SshPublicKeys = (output: any, context: __SerdeContext): SshPublicKey[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SshPublicKey(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SshPublicKey(entry, context); + }); }; const deserializeAws_json1_1SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -2824,7 +2946,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TestIdentityProviderResponse = ( @@ -2911,3 +3040,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-translate/protocols/Aws_json1_1.ts b/clients/client-translate/protocols/Aws_json1_1.ts index 98b676a1fba8..1f6932b51154 100644 --- a/clients/client-translate/protocols/Aws_json1_1.ts +++ b/clients/client-translate/protocols/Aws_json1_1.ts @@ -96,7 +96,7 @@ export const serializeAws_json1_1CreateParallelDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.CreateParallelData", }; let body: any; @@ -109,7 +109,7 @@ export const serializeAws_json1_1DeleteParallelDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.DeleteParallelData", }; let body: any; @@ -122,7 +122,7 @@ export const serializeAws_json1_1DeleteTerminologyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.DeleteTerminology", }; let body: any; @@ -135,7 +135,7 @@ export const serializeAws_json1_1DescribeTextTranslationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.DescribeTextTranslationJob", }; let body: any; @@ -148,7 +148,7 @@ export const serializeAws_json1_1GetParallelDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.GetParallelData", }; let body: any; @@ -161,7 +161,7 @@ export const serializeAws_json1_1GetTerminologyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.GetTerminology", }; let body: any; @@ -174,7 +174,7 @@ export const serializeAws_json1_1ImportTerminologyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.ImportTerminology", }; let body: any; @@ -187,7 +187,7 @@ export const serializeAws_json1_1ListParallelDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.ListParallelData", }; let body: any; @@ -200,7 +200,7 @@ export const serializeAws_json1_1ListTerminologiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.ListTerminologies", }; let body: any; @@ -213,7 +213,7 @@ export const serializeAws_json1_1ListTextTranslationJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.ListTextTranslationJobs", }; let body: any; @@ -226,7 +226,7 @@ export const serializeAws_json1_1StartTextTranslationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.StartTextTranslationJob", }; let body: any; @@ -239,7 +239,7 @@ export const serializeAws_json1_1StopTextTranslationJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.StopTextTranslationJob", }; let body: any; @@ -252,7 +252,7 @@ export const serializeAws_json1_1TranslateTextCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.TranslateText", }; let body: any; @@ -265,7 +265,7 @@ export const serializeAws_json1_1UpdateParallelDataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSShineFrontendService_20170701.UpdateParallelData", }; let body: any; @@ -300,8 +300,7 @@ const deserializeAws_json1_1CreateParallelDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConflictException": case "com.amazonaws.translate#ConflictException": @@ -395,8 +394,7 @@ const deserializeAws_json1_1DeleteParallelDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.translate#ConcurrentModificationException": @@ -471,8 +469,7 @@ const deserializeAws_json1_1DeleteTerminologyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -550,8 +547,7 @@ const deserializeAws_json1_1DescribeTextTranslationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -621,8 +617,7 @@ const deserializeAws_json1_1GetParallelDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -700,8 +695,7 @@ const deserializeAws_json1_1GetTerminologyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -779,8 +773,7 @@ const deserializeAws_json1_1ImportTerminologyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -858,8 +851,7 @@ const deserializeAws_json1_1ListParallelDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -929,8 +921,7 @@ const deserializeAws_json1_1ListTerminologiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -1000,8 +991,7 @@ const deserializeAws_json1_1ListTextTranslationJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -1079,8 +1069,7 @@ const deserializeAws_json1_1StartTextTranslationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -1166,8 +1155,7 @@ const deserializeAws_json1_1StopTextTranslationJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InternalServerException": case "com.amazonaws.translate#InternalServerException": @@ -1237,8 +1225,7 @@ const deserializeAws_json1_1TranslateTextCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DetectedLanguageLowConfidenceException": case "com.amazonaws.translate#DetectedLanguageLowConfidenceException": @@ -1348,8 +1335,7 @@ const deserializeAws_json1_1UpdateParallelDataCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ConcurrentModificationException": case "com.amazonaws.translate#ConcurrentModificationException": @@ -1633,14 +1619,16 @@ const serializeAws_json1_1CreateParallelDataRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EncryptionKey !== undefined && { - EncryptionKey: serializeAws_json1_1EncryptionKey(input.EncryptionKey, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParallelDataConfig !== undefined && { - ParallelDataConfig: serializeAws_json1_1ParallelDataConfig(input.ParallelDataConfig, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EncryptionKey !== undefined && + input.EncryptionKey !== null && { + EncryptionKey: serializeAws_json1_1EncryptionKey(input.EncryptionKey, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParallelDataConfig !== undefined && + input.ParallelDataConfig !== null && { + ParallelDataConfig: serializeAws_json1_1ParallelDataConfig(input.ParallelDataConfig, context), + }), }; }; @@ -1649,7 +1637,7 @@ const serializeAws_json1_1DeleteParallelDataRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -1658,7 +1646,7 @@ const serializeAws_json1_1DeleteTerminologyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -1667,27 +1655,28 @@ const serializeAws_json1_1DescribeTextTranslationJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; const serializeAws_json1_1EncryptionKey = (input: EncryptionKey, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1GetParallelDataRequest = (input: GetParallelDataRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1GetTerminologyRequest = (input: GetTerminologyRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.TerminologyDataFormat !== undefined && { TerminologyDataFormat: input.TerminologyDataFormat }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.TerminologyDataFormat !== undefined && + input.TerminologyDataFormat !== null && { TerminologyDataFormat: input.TerminologyDataFormat }), }; }; @@ -1696,29 +1685,31 @@ const serializeAws_json1_1ImportTerminologyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EncryptionKey !== undefined && { - EncryptionKey: serializeAws_json1_1EncryptionKey(input.EncryptionKey, context), - }), - ...(input.MergeStrategy !== undefined && { MergeStrategy: input.MergeStrategy }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.TerminologyData !== undefined && { - TerminologyData: serializeAws_json1_1TerminologyData(input.TerminologyData, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EncryptionKey !== undefined && + input.EncryptionKey !== null && { + EncryptionKey: serializeAws_json1_1EncryptionKey(input.EncryptionKey, context), + }), + ...(input.MergeStrategy !== undefined && input.MergeStrategy !== null && { MergeStrategy: input.MergeStrategy }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.TerminologyData !== undefined && + input.TerminologyData !== null && { + TerminologyData: serializeAws_json1_1TerminologyData(input.TerminologyData, context), + }), }; }; const serializeAws_json1_1InputDataConfig = (input: InputDataConfig, context: __SerdeContext): any => { return { - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1ListParallelDataRequest = (input: ListParallelDataRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -1727,8 +1718,8 @@ const serializeAws_json1_1ListTerminologiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -1737,27 +1728,35 @@ const serializeAws_json1_1ListTextTranslationJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Filter !== undefined && { Filter: serializeAws_json1_1TextTranslationJobFilter(input.Filter, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Filter !== undefined && + input.Filter !== null && { Filter: serializeAws_json1_1TextTranslationJobFilter(input.Filter, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1OutputDataConfig = (input: OutputDataConfig, context: __SerdeContext): any => { return { - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1ParallelDataConfig = (input: ParallelDataConfig, context: __SerdeContext): any => { return { - ...(input.Format !== undefined && { Format: input.Format }), - ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), + ...(input.S3Uri !== undefined && input.S3Uri !== null && { S3Uri: input.S3Uri }), }; }; const serializeAws_json1_1ResourceNameList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1StartTextTranslationJobRequest = ( @@ -1766,24 +1765,31 @@ const serializeAws_json1_1StartTextTranslationJobRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.DataAccessRoleArn !== undefined && { DataAccessRoleArn: input.DataAccessRoleArn }), - ...(input.InputDataConfig !== undefined && { - InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), - }), - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.OutputDataConfig !== undefined && { - OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), - }), - ...(input.ParallelDataNames !== undefined && { - ParallelDataNames: serializeAws_json1_1ResourceNameList(input.ParallelDataNames, context), - }), - ...(input.SourceLanguageCode !== undefined && { SourceLanguageCode: input.SourceLanguageCode }), - ...(input.TargetLanguageCodes !== undefined && { - TargetLanguageCodes: serializeAws_json1_1TargetLanguageCodeStringList(input.TargetLanguageCodes, context), - }), - ...(input.TerminologyNames !== undefined && { - TerminologyNames: serializeAws_json1_1ResourceNameList(input.TerminologyNames, context), - }), + ...(input.DataAccessRoleArn !== undefined && + input.DataAccessRoleArn !== null && { DataAccessRoleArn: input.DataAccessRoleArn }), + ...(input.InputDataConfig !== undefined && + input.InputDataConfig !== null && { + InputDataConfig: serializeAws_json1_1InputDataConfig(input.InputDataConfig, context), + }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.OutputDataConfig !== undefined && + input.OutputDataConfig !== null && { + OutputDataConfig: serializeAws_json1_1OutputDataConfig(input.OutputDataConfig, context), + }), + ...(input.ParallelDataNames !== undefined && + input.ParallelDataNames !== null && { + ParallelDataNames: serializeAws_json1_1ResourceNameList(input.ParallelDataNames, context), + }), + ...(input.SourceLanguageCode !== undefined && + input.SourceLanguageCode !== null && { SourceLanguageCode: input.SourceLanguageCode }), + ...(input.TargetLanguageCodes !== undefined && + input.TargetLanguageCodes !== null && { + TargetLanguageCodes: serializeAws_json1_1TargetLanguageCodeStringList(input.TargetLanguageCodes, context), + }), + ...(input.TerminologyNames !== undefined && + input.TerminologyNames !== null && { + TerminologyNames: serializeAws_json1_1ResourceNameList(input.TerminologyNames, context), + }), }; }; @@ -1792,18 +1798,25 @@ const serializeAws_json1_1StopTextTranslationJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), }; }; const serializeAws_json1_1TargetLanguageCodeStringList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TerminologyData = (input: TerminologyData, context: __SerdeContext): any => { return { - ...(input.File !== undefined && { File: context.base64Encoder(input.File) }), - ...(input.Format !== undefined && { Format: input.Format }), + ...(input.File !== undefined && input.File !== null && { File: context.base64Encoder(input.File) }), + ...(input.Format !== undefined && input.Format !== null && { Format: input.Format }), }; }; @@ -1812,25 +1825,30 @@ const serializeAws_json1_1TextTranslationJobFilter = ( context: __SerdeContext ): any => { return { - ...(input.JobName !== undefined && { JobName: input.JobName }), - ...(input.JobStatus !== undefined && { JobStatus: input.JobStatus }), - ...(input.SubmittedAfterTime !== undefined && { - SubmittedAfterTime: Math.round(input.SubmittedAfterTime.getTime() / 1000), - }), - ...(input.SubmittedBeforeTime !== undefined && { - SubmittedBeforeTime: Math.round(input.SubmittedBeforeTime.getTime() / 1000), - }), + ...(input.JobName !== undefined && input.JobName !== null && { JobName: input.JobName }), + ...(input.JobStatus !== undefined && input.JobStatus !== null && { JobStatus: input.JobStatus }), + ...(input.SubmittedAfterTime !== undefined && + input.SubmittedAfterTime !== null && { + SubmittedAfterTime: Math.round(input.SubmittedAfterTime.getTime() / 1000), + }), + ...(input.SubmittedBeforeTime !== undefined && + input.SubmittedBeforeTime !== null && { + SubmittedBeforeTime: Math.round(input.SubmittedBeforeTime.getTime() / 1000), + }), }; }; const serializeAws_json1_1TranslateTextRequest = (input: TranslateTextRequest, context: __SerdeContext): any => { return { - ...(input.SourceLanguageCode !== undefined && { SourceLanguageCode: input.SourceLanguageCode }), - ...(input.TargetLanguageCode !== undefined && { TargetLanguageCode: input.TargetLanguageCode }), - ...(input.TerminologyNames !== undefined && { - TerminologyNames: serializeAws_json1_1ResourceNameList(input.TerminologyNames, context), - }), - ...(input.Text !== undefined && { Text: input.Text }), + ...(input.SourceLanguageCode !== undefined && + input.SourceLanguageCode !== null && { SourceLanguageCode: input.SourceLanguageCode }), + ...(input.TargetLanguageCode !== undefined && + input.TargetLanguageCode !== null && { TargetLanguageCode: input.TargetLanguageCode }), + ...(input.TerminologyNames !== undefined && + input.TerminologyNames !== null && { + TerminologyNames: serializeAws_json1_1ResourceNameList(input.TerminologyNames, context), + }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), }; }; @@ -1840,11 +1858,12 @@ const serializeAws_json1_1UpdateParallelDataRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParallelDataConfig !== undefined && { - ParallelDataConfig: serializeAws_json1_1ParallelDataConfig(input.ParallelDataConfig, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParallelDataConfig !== undefined && + input.ParallelDataConfig !== null && { + ParallelDataConfig: serializeAws_json1_1ParallelDataConfig(input.ParallelDataConfig, context), + }), }; }; @@ -1859,7 +1878,14 @@ const deserializeAws_json1_1AppliedTerminology = (output: any, context: __SerdeC }; const deserializeAws_json1_1AppliedTerminologyList = (output: any, context: __SerdeContext): AppliedTerminology[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AppliedTerminology(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AppliedTerminology(entry, context); + }); }; const deserializeAws_json1_1ConcurrentModificationException = ( @@ -2037,7 +2063,14 @@ const deserializeAws_json1_1JobDetails = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1LanguageCodeStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -2169,11 +2202,25 @@ const deserializeAws_json1_1ParallelDataPropertiesList = ( output: any, context: __SerdeContext ): ParallelDataProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ParallelDataProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ParallelDataProperties(entry, context); + }); }; const deserializeAws_json1_1ResourceNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceNotFoundException = ( @@ -2215,7 +2262,14 @@ const deserializeAws_json1_1StopTextTranslationJobResponse = ( }; const deserializeAws_json1_1TargetLanguageCodeStringList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Term = (output: any, context: __SerdeContext): Term => { @@ -2270,11 +2324,25 @@ const deserializeAws_json1_1TerminologyPropertiesList = ( output: any, context: __SerdeContext ): TerminologyProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TerminologyProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TerminologyProperties(entry, context); + }); }; const deserializeAws_json1_1TermList = (output: any, context: __SerdeContext): Term[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Term(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Term(entry, context); + }); }; const deserializeAws_json1_1TextSizeLimitExceededException = ( @@ -2340,7 +2408,14 @@ const deserializeAws_json1_1TextTranslationJobPropertiesList = ( output: any, context: __SerdeContext ): TextTranslationJobProperties[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TextTranslationJobProperties(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TextTranslationJobProperties(entry, context); + }); }; const deserializeAws_json1_1TooManyRequestsException = ( @@ -2456,3 +2531,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-waf-regional/protocols/Aws_json1_1.ts b/clients/client-waf-regional/protocols/Aws_json1_1.ts index 6ddc47bca846..237968497c81 100644 --- a/clients/client-waf-regional/protocols/Aws_json1_1.ts +++ b/clients/client-waf-regional/protocols/Aws_json1_1.ts @@ -438,7 +438,7 @@ export const serializeAws_json1_1AssociateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.AssociateWebACL", }; let body: any; @@ -451,7 +451,7 @@ export const serializeAws_json1_1CreateByteMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateByteMatchSet", }; let body: any; @@ -464,7 +464,7 @@ export const serializeAws_json1_1CreateGeoMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateGeoMatchSet", }; let body: any; @@ -477,7 +477,7 @@ export const serializeAws_json1_1CreateIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateIPSet", }; let body: any; @@ -490,7 +490,7 @@ export const serializeAws_json1_1CreateRateBasedRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateRateBasedRule", }; let body: any; @@ -503,7 +503,7 @@ export const serializeAws_json1_1CreateRegexMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateRegexMatchSet", }; let body: any; @@ -516,7 +516,7 @@ export const serializeAws_json1_1CreateRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateRegexPatternSet", }; let body: any; @@ -529,7 +529,7 @@ export const serializeAws_json1_1CreateRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateRule", }; let body: any; @@ -542,7 +542,7 @@ export const serializeAws_json1_1CreateRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateRuleGroup", }; let body: any; @@ -555,7 +555,7 @@ export const serializeAws_json1_1CreateSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateSizeConstraintSet", }; let body: any; @@ -568,7 +568,7 @@ export const serializeAws_json1_1CreateSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateSqlInjectionMatchSet", }; let body: any; @@ -581,7 +581,7 @@ export const serializeAws_json1_1CreateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateWebACL", }; let body: any; @@ -594,7 +594,7 @@ export const serializeAws_json1_1CreateWebACLMigrationStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateWebACLMigrationStack", }; let body: any; @@ -607,7 +607,7 @@ export const serializeAws_json1_1CreateXssMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.CreateXssMatchSet", }; let body: any; @@ -620,7 +620,7 @@ export const serializeAws_json1_1DeleteByteMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteByteMatchSet", }; let body: any; @@ -633,7 +633,7 @@ export const serializeAws_json1_1DeleteGeoMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteGeoMatchSet", }; let body: any; @@ -646,7 +646,7 @@ export const serializeAws_json1_1DeleteIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteIPSet", }; let body: any; @@ -659,7 +659,7 @@ export const serializeAws_json1_1DeleteLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteLoggingConfiguration", }; let body: any; @@ -672,7 +672,7 @@ export const serializeAws_json1_1DeletePermissionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeletePermissionPolicy", }; let body: any; @@ -685,7 +685,7 @@ export const serializeAws_json1_1DeleteRateBasedRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteRateBasedRule", }; let body: any; @@ -698,7 +698,7 @@ export const serializeAws_json1_1DeleteRegexMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteRegexMatchSet", }; let body: any; @@ -711,7 +711,7 @@ export const serializeAws_json1_1DeleteRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteRegexPatternSet", }; let body: any; @@ -724,7 +724,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteRule", }; let body: any; @@ -737,7 +737,7 @@ export const serializeAws_json1_1DeleteRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteRuleGroup", }; let body: any; @@ -750,7 +750,7 @@ export const serializeAws_json1_1DeleteSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteSizeConstraintSet", }; let body: any; @@ -763,7 +763,7 @@ export const serializeAws_json1_1DeleteSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteSqlInjectionMatchSet", }; let body: any; @@ -776,7 +776,7 @@ export const serializeAws_json1_1DeleteWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteWebACL", }; let body: any; @@ -789,7 +789,7 @@ export const serializeAws_json1_1DeleteXssMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DeleteXssMatchSet", }; let body: any; @@ -802,7 +802,7 @@ export const serializeAws_json1_1DisassociateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.DisassociateWebACL", }; let body: any; @@ -815,7 +815,7 @@ export const serializeAws_json1_1GetByteMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetByteMatchSet", }; let body: any; @@ -828,7 +828,7 @@ export const serializeAws_json1_1GetChangeTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetChangeToken", }; let body: any; @@ -841,7 +841,7 @@ export const serializeAws_json1_1GetChangeTokenStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetChangeTokenStatus", }; let body: any; @@ -854,7 +854,7 @@ export const serializeAws_json1_1GetGeoMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetGeoMatchSet", }; let body: any; @@ -867,7 +867,7 @@ export const serializeAws_json1_1GetIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetIPSet", }; let body: any; @@ -880,7 +880,7 @@ export const serializeAws_json1_1GetLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetLoggingConfiguration", }; let body: any; @@ -893,7 +893,7 @@ export const serializeAws_json1_1GetPermissionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetPermissionPolicy", }; let body: any; @@ -906,7 +906,7 @@ export const serializeAws_json1_1GetRateBasedRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetRateBasedRule", }; let body: any; @@ -919,7 +919,7 @@ export const serializeAws_json1_1GetRateBasedRuleManagedKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetRateBasedRuleManagedKeys", }; let body: any; @@ -932,7 +932,7 @@ export const serializeAws_json1_1GetRegexMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetRegexMatchSet", }; let body: any; @@ -945,7 +945,7 @@ export const serializeAws_json1_1GetRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetRegexPatternSet", }; let body: any; @@ -958,7 +958,7 @@ export const serializeAws_json1_1GetRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetRule", }; let body: any; @@ -971,7 +971,7 @@ export const serializeAws_json1_1GetRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetRuleGroup", }; let body: any; @@ -984,7 +984,7 @@ export const serializeAws_json1_1GetSampledRequestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetSampledRequests", }; let body: any; @@ -997,7 +997,7 @@ export const serializeAws_json1_1GetSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetSizeConstraintSet", }; let body: any; @@ -1010,7 +1010,7 @@ export const serializeAws_json1_1GetSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetSqlInjectionMatchSet", }; let body: any; @@ -1023,7 +1023,7 @@ export const serializeAws_json1_1GetWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetWebACL", }; let body: any; @@ -1036,7 +1036,7 @@ export const serializeAws_json1_1GetWebACLForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetWebACLForResource", }; let body: any; @@ -1049,7 +1049,7 @@ export const serializeAws_json1_1GetXssMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.GetXssMatchSet", }; let body: any; @@ -1062,7 +1062,7 @@ export const serializeAws_json1_1ListActivatedRulesInRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListActivatedRulesInRuleGroup", }; let body: any; @@ -1075,7 +1075,7 @@ export const serializeAws_json1_1ListByteMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListByteMatchSets", }; let body: any; @@ -1088,7 +1088,7 @@ export const serializeAws_json1_1ListGeoMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListGeoMatchSets", }; let body: any; @@ -1101,7 +1101,7 @@ export const serializeAws_json1_1ListIPSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListIPSets", }; let body: any; @@ -1114,7 +1114,7 @@ export const serializeAws_json1_1ListLoggingConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListLoggingConfigurations", }; let body: any; @@ -1127,7 +1127,7 @@ export const serializeAws_json1_1ListRateBasedRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListRateBasedRules", }; let body: any; @@ -1140,7 +1140,7 @@ export const serializeAws_json1_1ListRegexMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListRegexMatchSets", }; let body: any; @@ -1153,7 +1153,7 @@ export const serializeAws_json1_1ListRegexPatternSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListRegexPatternSets", }; let body: any; @@ -1166,7 +1166,7 @@ export const serializeAws_json1_1ListResourcesForWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListResourcesForWebACL", }; let body: any; @@ -1179,7 +1179,7 @@ export const serializeAws_json1_1ListRuleGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListRuleGroups", }; let body: any; @@ -1192,7 +1192,7 @@ export const serializeAws_json1_1ListRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListRules", }; let body: any; @@ -1205,7 +1205,7 @@ export const serializeAws_json1_1ListSizeConstraintSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListSizeConstraintSets", }; let body: any; @@ -1218,7 +1218,7 @@ export const serializeAws_json1_1ListSqlInjectionMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListSqlInjectionMatchSets", }; let body: any; @@ -1231,7 +1231,7 @@ export const serializeAws_json1_1ListSubscribedRuleGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListSubscribedRuleGroups", }; let body: any; @@ -1244,7 +1244,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListTagsForResource", }; let body: any; @@ -1257,7 +1257,7 @@ export const serializeAws_json1_1ListWebACLsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListWebACLs", }; let body: any; @@ -1270,7 +1270,7 @@ export const serializeAws_json1_1ListXssMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.ListXssMatchSets", }; let body: any; @@ -1283,7 +1283,7 @@ export const serializeAws_json1_1PutLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.PutLoggingConfiguration", }; let body: any; @@ -1296,7 +1296,7 @@ export const serializeAws_json1_1PutPermissionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.PutPermissionPolicy", }; let body: any; @@ -1309,7 +1309,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.TagResource", }; let body: any; @@ -1322,7 +1322,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UntagResource", }; let body: any; @@ -1335,7 +1335,7 @@ export const serializeAws_json1_1UpdateByteMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateByteMatchSet", }; let body: any; @@ -1348,7 +1348,7 @@ export const serializeAws_json1_1UpdateGeoMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateGeoMatchSet", }; let body: any; @@ -1361,7 +1361,7 @@ export const serializeAws_json1_1UpdateIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateIPSet", }; let body: any; @@ -1374,7 +1374,7 @@ export const serializeAws_json1_1UpdateRateBasedRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateRateBasedRule", }; let body: any; @@ -1387,7 +1387,7 @@ export const serializeAws_json1_1UpdateRegexMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateRegexMatchSet", }; let body: any; @@ -1400,7 +1400,7 @@ export const serializeAws_json1_1UpdateRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateRegexPatternSet", }; let body: any; @@ -1413,7 +1413,7 @@ export const serializeAws_json1_1UpdateRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateRule", }; let body: any; @@ -1426,7 +1426,7 @@ export const serializeAws_json1_1UpdateRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateRuleGroup", }; let body: any; @@ -1439,7 +1439,7 @@ export const serializeAws_json1_1UpdateSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateSizeConstraintSet", }; let body: any; @@ -1452,7 +1452,7 @@ export const serializeAws_json1_1UpdateSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateSqlInjectionMatchSet", }; let body: any; @@ -1465,7 +1465,7 @@ export const serializeAws_json1_1UpdateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateWebACL", }; let body: any; @@ -1478,7 +1478,7 @@ export const serializeAws_json1_1UpdateXssMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_Regional_20161128.UpdateXssMatchSet", }; let body: any; @@ -1513,8 +1513,7 @@ const deserializeAws_json1_1AssociateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -1600,8 +1599,7 @@ const deserializeAws_json1_1CreateByteMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.wafregional#WAFDisallowedNameException": @@ -1695,8 +1693,7 @@ const deserializeAws_json1_1CreateGeoMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.wafregional#WAFDisallowedNameException": @@ -1790,8 +1787,7 @@ const deserializeAws_json1_1CreateIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.wafregional#WAFDisallowedNameException": @@ -1885,8 +1881,7 @@ const deserializeAws_json1_1CreateRateBasedRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.wafregional#WAFBadRequestException": @@ -1996,8 +1991,7 @@ const deserializeAws_json1_1CreateRegexMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.wafregional#WAFDisallowedNameException": @@ -2075,8 +2069,7 @@ const deserializeAws_json1_1CreateRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.wafregional#WAFDisallowedNameException": @@ -2154,8 +2147,7 @@ const deserializeAws_json1_1CreateRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.wafregional#WAFBadRequestException": @@ -2265,8 +2257,7 @@ const deserializeAws_json1_1CreateRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.wafregional#WAFBadRequestException": @@ -2368,8 +2359,7 @@ const deserializeAws_json1_1CreateSizeConstraintSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.wafregional#WAFDisallowedNameException": @@ -2463,8 +2453,7 @@ const deserializeAws_json1_1CreateSqlInjectionMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.wafregional#WAFDisallowedNameException": @@ -2558,8 +2547,7 @@ const deserializeAws_json1_1CreateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.wafregional#WAFBadRequestException": @@ -2677,8 +2665,7 @@ const deserializeAws_json1_1CreateWebACLMigrationStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFEntityMigrationException": case "com.amazonaws.wafregional#WAFEntityMigrationException": @@ -2764,8 +2751,7 @@ const deserializeAws_json1_1CreateXssMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.wafregional#WAFDisallowedNameException": @@ -2859,8 +2845,7 @@ const deserializeAws_json1_1DeleteByteMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -2954,8 +2939,7 @@ const deserializeAws_json1_1DeleteGeoMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3049,8 +3033,7 @@ const deserializeAws_json1_1DeleteIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3144,8 +3127,7 @@ const deserializeAws_json1_1DeleteLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3215,8 +3197,7 @@ const deserializeAws_json1_1DeletePermissionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3286,8 +3267,7 @@ const deserializeAws_json1_1DeleteRateBasedRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3397,8 +3377,7 @@ const deserializeAws_json1_1DeleteRegexMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3492,8 +3471,7 @@ const deserializeAws_json1_1DeleteRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3587,8 +3565,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3698,8 +3675,7 @@ const deserializeAws_json1_1DeleteRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3809,8 +3785,7 @@ const deserializeAws_json1_1DeleteSizeConstraintSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3904,8 +3879,7 @@ const deserializeAws_json1_1DeleteSqlInjectionMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -3999,8 +3973,7 @@ const deserializeAws_json1_1DeleteWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4110,8 +4083,7 @@ const deserializeAws_json1_1DeleteXssMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4205,8 +4177,7 @@ const deserializeAws_json1_1DisassociateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4284,8 +4255,7 @@ const deserializeAws_json1_1GetByteMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4355,8 +4325,7 @@ const deserializeAws_json1_1GetChangeTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4410,8 +4379,7 @@ const deserializeAws_json1_1GetChangeTokenStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4473,8 +4441,7 @@ const deserializeAws_json1_1GetGeoMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4544,8 +4511,7 @@ const deserializeAws_json1_1GetIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4615,8 +4581,7 @@ const deserializeAws_json1_1GetLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4678,8 +4643,7 @@ const deserializeAws_json1_1GetPermissionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4741,8 +4705,7 @@ const deserializeAws_json1_1GetRateBasedRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4812,8 +4775,7 @@ const deserializeAws_json1_1GetRateBasedRuleManagedKeysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4891,8 +4853,7 @@ const deserializeAws_json1_1GetRegexMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -4962,8 +4923,7 @@ const deserializeAws_json1_1GetRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5033,8 +4993,7 @@ const deserializeAws_json1_1GetRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5104,8 +5063,7 @@ const deserializeAws_json1_1GetRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5167,8 +5125,7 @@ const deserializeAws_json1_1GetSampledRequestsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5230,8 +5187,7 @@ const deserializeAws_json1_1GetSizeConstraintSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5301,8 +5257,7 @@ const deserializeAws_json1_1GetSqlInjectionMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5372,8 +5327,7 @@ const deserializeAws_json1_1GetWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5443,8 +5397,7 @@ const deserializeAws_json1_1GetWebACLForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5530,8 +5483,7 @@ const deserializeAws_json1_1GetXssMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5601,8 +5553,7 @@ const deserializeAws_json1_1ListActivatedRulesInRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5672,8 +5623,7 @@ const deserializeAws_json1_1ListByteMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5735,8 +5685,7 @@ const deserializeAws_json1_1ListGeoMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5798,8 +5747,7 @@ const deserializeAws_json1_1ListIPSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5861,8 +5809,7 @@ const deserializeAws_json1_1ListLoggingConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5932,8 +5879,7 @@ const deserializeAws_json1_1ListRateBasedRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -5995,8 +5941,7 @@ const deserializeAws_json1_1ListRegexMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6058,8 +6003,7 @@ const deserializeAws_json1_1ListRegexPatternSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6121,8 +6065,7 @@ const deserializeAws_json1_1ListResourcesForWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6200,8 +6143,7 @@ const deserializeAws_json1_1ListRuleGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6255,8 +6197,7 @@ const deserializeAws_json1_1ListRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6318,8 +6259,7 @@ const deserializeAws_json1_1ListSizeConstraintSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6381,8 +6321,7 @@ const deserializeAws_json1_1ListSqlInjectionMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6444,8 +6383,7 @@ const deserializeAws_json1_1ListSubscribedRuleGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6507,8 +6445,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.wafregional#WAFBadRequestException": @@ -6602,8 +6539,7 @@ const deserializeAws_json1_1ListWebACLsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6665,8 +6601,7 @@ const deserializeAws_json1_1ListXssMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6728,8 +6663,7 @@ const deserializeAws_json1_1PutLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6807,8 +6741,7 @@ const deserializeAws_json1_1PutPermissionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -6886,8 +6819,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.wafregional#WAFBadRequestException": @@ -6989,8 +6921,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.wafregional#WAFBadRequestException": @@ -7084,8 +7015,7 @@ const deserializeAws_json1_1UpdateByteMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -7195,8 +7125,7 @@ const deserializeAws_json1_1UpdateGeoMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -7314,8 +7243,7 @@ const deserializeAws_json1_1UpdateIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -7433,8 +7361,7 @@ const deserializeAws_json1_1UpdateRateBasedRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -7552,8 +7479,7 @@ const deserializeAws_json1_1UpdateRegexMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.wafregional#WAFDisallowedNameException": @@ -7663,8 +7589,7 @@ const deserializeAws_json1_1UpdateRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -7774,8 +7699,7 @@ const deserializeAws_json1_1UpdateRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -7893,8 +7817,7 @@ const deserializeAws_json1_1UpdateRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -7996,8 +7919,7 @@ const deserializeAws_json1_1UpdateSizeConstraintSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -8115,8 +8037,7 @@ const deserializeAws_json1_1UpdateSqlInjectionMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -8226,8 +8147,7 @@ const deserializeAws_json1_1UpdateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -8353,8 +8273,7 @@ const deserializeAws_json1_1UpdateXssMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafregional#WAFInternalErrorException": @@ -8739,47 +8658,60 @@ const deserializeAws_json1_1WAFUnavailableEntityExceptionResponse = async ( const serializeAws_json1_1ActivatedRule = (input: ActivatedRule, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: serializeAws_json1_1WafAction(input.Action, context) }), - ...(input.ExcludedRules !== undefined && { - ExcludedRules: serializeAws_json1_1ExcludedRules(input.ExcludedRules, context), - }), - ...(input.OverrideAction !== undefined && { - OverrideAction: serializeAws_json1_1WafOverrideAction(input.OverrideAction, context), - }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Action !== undefined && + input.Action !== null && { Action: serializeAws_json1_1WafAction(input.Action, context) }), + ...(input.ExcludedRules !== undefined && + input.ExcludedRules !== null && { + ExcludedRules: serializeAws_json1_1ExcludedRules(input.ExcludedRules, context), + }), + ...(input.OverrideAction !== undefined && + input.OverrideAction !== null && { + OverrideAction: serializeAws_json1_1WafOverrideAction(input.OverrideAction, context), + }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1AssociateWebACLRequest = (input: AssociateWebACLRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; const serializeAws_json1_1ByteMatchSetUpdate = (input: ByteMatchSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.ByteMatchTuple !== undefined && { - ByteMatchTuple: serializeAws_json1_1ByteMatchTuple(input.ByteMatchTuple, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.ByteMatchTuple !== undefined && + input.ByteMatchTuple !== null && { + ByteMatchTuple: serializeAws_json1_1ByteMatchTuple(input.ByteMatchTuple, context), + }), }; }; const serializeAws_json1_1ByteMatchSetUpdates = (input: ByteMatchSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ByteMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ByteMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1ByteMatchTuple = (input: ByteMatchTuple, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.PositionalConstraint !== undefined && { PositionalConstraint: input.PositionalConstraint }), - ...(input.TargetString !== undefined && { TargetString: context.base64Encoder(input.TargetString) }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.PositionalConstraint !== undefined && + input.PositionalConstraint !== null && { PositionalConstraint: input.PositionalConstraint }), + ...(input.TargetString !== undefined && + input.TargetString !== null && { TargetString: context.base64Encoder(input.TargetString) }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; @@ -8788,8 +8720,8 @@ const serializeAws_json1_1CreateByteMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8798,15 +8730,15 @@ const serializeAws_json1_1CreateGeoMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1CreateIPSetRequest = (input: CreateIPSetRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8815,12 +8747,12 @@ const serializeAws_json1_1CreateRateBasedRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RateKey !== undefined && { RateKey: input.RateKey }), - ...(input.RateLimit !== undefined && { RateLimit: input.RateLimit }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RateKey !== undefined && input.RateKey !== null && { RateKey: input.RateKey }), + ...(input.RateLimit !== undefined && input.RateLimit !== null && { RateLimit: input.RateLimit }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -8829,8 +8761,8 @@ const serializeAws_json1_1CreateRegexMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8839,26 +8771,26 @@ const serializeAws_json1_1CreateRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1CreateRuleGroupRequest = (input: CreateRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateRuleRequest = (input: CreateRuleRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -8867,8 +8799,8 @@ const serializeAws_json1_1CreateSizeConstraintSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8877,8 +8809,8 @@ const serializeAws_json1_1CreateSqlInjectionMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8887,21 +8819,21 @@ const serializeAws_json1_1CreateWebACLMigrationStackRequest = ( context: __SerdeContext ): any => { return { - ...(input.IgnoreUnsupportedType !== undefined && { IgnoreUnsupportedType: input.IgnoreUnsupportedType }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.IgnoreUnsupportedType !== undefined && + input.IgnoreUnsupportedType !== null && { IgnoreUnsupportedType: input.IgnoreUnsupportedType }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; const serializeAws_json1_1CreateWebACLRequest = (input: CreateWebACLRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.DefaultAction !== undefined && { - DefaultAction: serializeAws_json1_1WafAction(input.DefaultAction, context), - }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.DefaultAction !== undefined && + input.DefaultAction !== null && { DefaultAction: serializeAws_json1_1WafAction(input.DefaultAction, context) }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -8910,8 +8842,8 @@ const serializeAws_json1_1CreateXssMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8920,8 +8852,9 @@ const serializeAws_json1_1DeleteByteMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ByteMatchSetId !== undefined && { ByteMatchSetId: input.ByteMatchSetId }), - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.ByteMatchSetId !== undefined && + input.ByteMatchSetId !== null && { ByteMatchSetId: input.ByteMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), }; }; @@ -8930,15 +8863,15 @@ const serializeAws_json1_1DeleteGeoMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.GeoMatchSetId !== undefined && { GeoMatchSetId: input.GeoMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.GeoMatchSetId !== undefined && input.GeoMatchSetId !== null && { GeoMatchSetId: input.GeoMatchSetId }), }; }; const serializeAws_json1_1DeleteIPSetRequest = (input: DeleteIPSetRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.IPSetId !== undefined && input.IPSetId !== null && { IPSetId: input.IPSetId }), }; }; @@ -8947,7 +8880,7 @@ const serializeAws_json1_1DeleteLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -8956,7 +8889,7 @@ const serializeAws_json1_1DeletePermissionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -8965,8 +8898,8 @@ const serializeAws_json1_1DeleteRateBasedRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; @@ -8975,8 +8908,9 @@ const serializeAws_json1_1DeleteRegexMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RegexMatchSetId !== undefined && { RegexMatchSetId: input.RegexMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RegexMatchSetId !== undefined && + input.RegexMatchSetId !== null && { RegexMatchSetId: input.RegexMatchSetId }), }; }; @@ -8985,22 +8919,23 @@ const serializeAws_json1_1DeleteRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RegexPatternSetId !== undefined && { RegexPatternSetId: input.RegexPatternSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RegexPatternSetId !== undefined && + input.RegexPatternSetId !== null && { RegexPatternSetId: input.RegexPatternSetId }), }; }; const serializeAws_json1_1DeleteRuleGroupRequest = (input: DeleteRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleGroupId !== undefined && input.RuleGroupId !== null && { RuleGroupId: input.RuleGroupId }), }; }; const serializeAws_json1_1DeleteRuleRequest = (input: DeleteRuleRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; @@ -9009,8 +8944,9 @@ const serializeAws_json1_1DeleteSizeConstraintSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.SizeConstraintSetId !== undefined && { SizeConstraintSetId: input.SizeConstraintSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.SizeConstraintSetId !== undefined && + input.SizeConstraintSetId !== null && { SizeConstraintSetId: input.SizeConstraintSetId }), }; }; @@ -9019,15 +8955,16 @@ const serializeAws_json1_1DeleteSqlInjectionMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.SqlInjectionMatchSetId !== undefined && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.SqlInjectionMatchSetId !== undefined && + input.SqlInjectionMatchSetId !== null && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), }; }; const serializeAws_json1_1DeleteWebACLRequest = (input: DeleteWebACLRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; @@ -9036,8 +8973,8 @@ const serializeAws_json1_1DeleteXssMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.XssMatchSetId !== undefined && { XssMatchSetId: input.XssMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.XssMatchSetId !== undefined && input.XssMatchSetId !== null && { XssMatchSetId: input.XssMatchSetId }), }; }; @@ -9046,50 +8983,66 @@ const serializeAws_json1_1DisassociateWebACLRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1ExcludedRule = (input: ExcludedRule, context: __SerdeContext): any => { return { - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; const serializeAws_json1_1ExcludedRules = (input: ExcludedRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ExcludedRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ExcludedRule(entry, context); + }); }; const serializeAws_json1_1FieldToMatch = (input: FieldToMatch, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: input.Data }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Data !== undefined && input.Data !== null && { Data: input.Data }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1GeoMatchConstraint = (input: GeoMatchConstraint, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1GeoMatchSetUpdate = (input: GeoMatchSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.GeoMatchConstraint !== undefined && { - GeoMatchConstraint: serializeAws_json1_1GeoMatchConstraint(input.GeoMatchConstraint, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.GeoMatchConstraint !== undefined && + input.GeoMatchConstraint !== null && { + GeoMatchConstraint: serializeAws_json1_1GeoMatchConstraint(input.GeoMatchConstraint, context), + }), }; }; const serializeAws_json1_1GeoMatchSetUpdates = (input: GeoMatchSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1GeoMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1GeoMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1GetByteMatchSetRequest = (input: GetByteMatchSetRequest, context: __SerdeContext): any => { return { - ...(input.ByteMatchSetId !== undefined && { ByteMatchSetId: input.ByteMatchSetId }), + ...(input.ByteMatchSetId !== undefined && + input.ByteMatchSetId !== null && { ByteMatchSetId: input.ByteMatchSetId }), }; }; @@ -9102,19 +9055,19 @@ const serializeAws_json1_1GetChangeTokenStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), }; }; const serializeAws_json1_1GetGeoMatchSetRequest = (input: GetGeoMatchSetRequest, context: __SerdeContext): any => { return { - ...(input.GeoMatchSetId !== undefined && { GeoMatchSetId: input.GeoMatchSetId }), + ...(input.GeoMatchSetId !== undefined && input.GeoMatchSetId !== null && { GeoMatchSetId: input.GeoMatchSetId }), }; }; const serializeAws_json1_1GetIPSetRequest = (input: GetIPSetRequest, context: __SerdeContext): any => { return { - ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }), + ...(input.IPSetId !== undefined && input.IPSetId !== null && { IPSetId: input.IPSetId }), }; }; @@ -9123,7 +9076,7 @@ const serializeAws_json1_1GetLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -9132,7 +9085,7 @@ const serializeAws_json1_1GetPermissionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -9141,20 +9094,21 @@ const serializeAws_json1_1GetRateBasedRuleManagedKeysRequest = ( context: __SerdeContext ): any => { return { - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; const serializeAws_json1_1GetRateBasedRuleRequest = (input: GetRateBasedRuleRequest, context: __SerdeContext): any => { return { - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; const serializeAws_json1_1GetRegexMatchSetRequest = (input: GetRegexMatchSetRequest, context: __SerdeContext): any => { return { - ...(input.RegexMatchSetId !== undefined && { RegexMatchSetId: input.RegexMatchSetId }), + ...(input.RegexMatchSetId !== undefined && + input.RegexMatchSetId !== null && { RegexMatchSetId: input.RegexMatchSetId }), }; }; @@ -9163,19 +9117,20 @@ const serializeAws_json1_1GetRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.RegexPatternSetId !== undefined && { RegexPatternSetId: input.RegexPatternSetId }), + ...(input.RegexPatternSetId !== undefined && + input.RegexPatternSetId !== null && { RegexPatternSetId: input.RegexPatternSetId }), }; }; const serializeAws_json1_1GetRuleGroupRequest = (input: GetRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), + ...(input.RuleGroupId !== undefined && input.RuleGroupId !== null && { RuleGroupId: input.RuleGroupId }), }; }; const serializeAws_json1_1GetRuleRequest = (input: GetRuleRequest, context: __SerdeContext): any => { return { - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; @@ -9184,10 +9139,11 @@ const serializeAws_json1_1GetSampledRequestsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), - ...(input.TimeWindow !== undefined && { TimeWindow: serializeAws_json1_1TimeWindow(input.TimeWindow, context) }), - ...(input.WebAclId !== undefined && { WebAclId: input.WebAclId }), + ...(input.MaxItems !== undefined && input.MaxItems !== null && { MaxItems: input.MaxItems }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), + ...(input.TimeWindow !== undefined && + input.TimeWindow !== null && { TimeWindow: serializeAws_json1_1TimeWindow(input.TimeWindow, context) }), + ...(input.WebAclId !== undefined && input.WebAclId !== null && { WebAclId: input.WebAclId }), }; }; @@ -9196,7 +9152,8 @@ const serializeAws_json1_1GetSizeConstraintSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.SizeConstraintSetId !== undefined && { SizeConstraintSetId: input.SizeConstraintSetId }), + ...(input.SizeConstraintSetId !== undefined && + input.SizeConstraintSetId !== null && { SizeConstraintSetId: input.SizeConstraintSetId }), }; }; @@ -9205,7 +9162,8 @@ const serializeAws_json1_1GetSqlInjectionMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.SqlInjectionMatchSetId !== undefined && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), + ...(input.SqlInjectionMatchSetId !== undefined && + input.SqlInjectionMatchSetId !== null && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), }; }; @@ -9214,40 +9172,48 @@ const serializeAws_json1_1GetWebACLForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1GetWebACLRequest = (input: GetWebACLRequest, context: __SerdeContext): any => { return { - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; const serializeAws_json1_1GetXssMatchSetRequest = (input: GetXssMatchSetRequest, context: __SerdeContext): any => { return { - ...(input.XssMatchSetId !== undefined && { XssMatchSetId: input.XssMatchSetId }), + ...(input.XssMatchSetId !== undefined && input.XssMatchSetId !== null && { XssMatchSetId: input.XssMatchSetId }), }; }; const serializeAws_json1_1IPSetDescriptor = (input: IPSetDescriptor, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1IPSetUpdate = (input: IPSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.IPSetDescriptor !== undefined && { - IPSetDescriptor: serializeAws_json1_1IPSetDescriptor(input.IPSetDescriptor, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.IPSetDescriptor !== undefined && + input.IPSetDescriptor !== null && { + IPSetDescriptor: serializeAws_json1_1IPSetDescriptor(input.IPSetDescriptor, context), + }), }; }; const serializeAws_json1_1IPSetUpdates = (input: IPSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1IPSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1IPSetUpdate(entry, context); + }); }; const serializeAws_json1_1ListActivatedRulesInRuleGroupRequest = ( @@ -9255,9 +9221,9 @@ const serializeAws_json1_1ListActivatedRulesInRuleGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.RuleGroupId !== undefined && input.RuleGroupId !== null && { RuleGroupId: input.RuleGroupId }), }; }; @@ -9266,22 +9232,22 @@ const serializeAws_json1_1ListByteMatchSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1ListGeoMatchSetsRequest = (input: ListGeoMatchSetsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1ListIPSetsRequest = (input: ListIPSetsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -9290,8 +9256,8 @@ const serializeAws_json1_1ListLoggingConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -9300,8 +9266,8 @@ const serializeAws_json1_1ListRateBasedRulesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -9310,8 +9276,8 @@ const serializeAws_json1_1ListRegexMatchSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -9320,8 +9286,8 @@ const serializeAws_json1_1ListRegexPatternSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -9330,22 +9296,22 @@ const serializeAws_json1_1ListResourcesForWebACLRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; const serializeAws_json1_1ListRuleGroupsRequest = (input: ListRuleGroupsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1ListRulesRequest = (input: ListRulesRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -9354,8 +9320,8 @@ const serializeAws_json1_1ListSizeConstraintSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -9364,8 +9330,8 @@ const serializeAws_json1_1ListSqlInjectionMatchSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -9374,8 +9340,8 @@ const serializeAws_json1_1ListSubscribedRuleGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -9384,47 +9350,56 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1ListWebACLsRequest = (input: ListWebACLsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1ListXssMatchSetsRequest = (input: ListXssMatchSetsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1LogDestinationConfigs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1LoggingConfiguration = (input: LoggingConfiguration, context: __SerdeContext): any => { return { - ...(input.LogDestinationConfigs !== undefined && { - LogDestinationConfigs: serializeAws_json1_1LogDestinationConfigs(input.LogDestinationConfigs, context), - }), - ...(input.RedactedFields !== undefined && { - RedactedFields: serializeAws_json1_1RedactedFields(input.RedactedFields, context), - }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.LogDestinationConfigs !== undefined && + input.LogDestinationConfigs !== null && { + LogDestinationConfigs: serializeAws_json1_1LogDestinationConfigs(input.LogDestinationConfigs, context), + }), + ...(input.RedactedFields !== undefined && + input.RedactedFields !== null && { + RedactedFields: serializeAws_json1_1RedactedFields(input.RedactedFields, context), + }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1Predicate = (input: Predicate, context: __SerdeContext): any => { return { - ...(input.DataId !== undefined && { DataId: input.DataId }), - ...(input.Negated !== undefined && { Negated: input.Negated }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DataId !== undefined && input.DataId !== null && { DataId: input.DataId }), + ...(input.Negated !== undefined && input.Negated !== null && { Negated: input.Negated }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -9433,9 +9408,10 @@ const serializeAws_json1_1PutLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.LoggingConfiguration !== undefined && { - LoggingConfiguration: serializeAws_json1_1LoggingConfiguration(input.LoggingConfiguration, context), - }), + ...(input.LoggingConfiguration !== undefined && + input.LoggingConfiguration !== null && { + LoggingConfiguration: serializeAws_json1_1LoggingConfiguration(input.LoggingConfiguration, context), + }), }; }; @@ -9444,90 +9420,132 @@ const serializeAws_json1_1PutPermissionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1RedactedFields = (input: FieldToMatch[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FieldToMatch(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FieldToMatch(entry, context); + }); }; const serializeAws_json1_1RegexMatchSetUpdate = (input: RegexMatchSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.RegexMatchTuple !== undefined && { - RegexMatchTuple: serializeAws_json1_1RegexMatchTuple(input.RegexMatchTuple, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.RegexMatchTuple !== undefined && + input.RegexMatchTuple !== null && { + RegexMatchTuple: serializeAws_json1_1RegexMatchTuple(input.RegexMatchTuple, context), + }), }; }; const serializeAws_json1_1RegexMatchSetUpdates = (input: RegexMatchSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RegexMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RegexMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1RegexMatchTuple = (input: RegexMatchTuple, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.RegexPatternSetId !== undefined && { RegexPatternSetId: input.RegexPatternSetId }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.RegexPatternSetId !== undefined && + input.RegexPatternSetId !== null && { RegexPatternSetId: input.RegexPatternSetId }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; const serializeAws_json1_1RegexPatternSetUpdate = (input: RegexPatternSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.RegexPatternString !== undefined && { RegexPatternString: input.RegexPatternString }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.RegexPatternString !== undefined && + input.RegexPatternString !== null && { RegexPatternString: input.RegexPatternString }), }; }; const serializeAws_json1_1RegexPatternSetUpdates = (input: RegexPatternSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RegexPatternSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RegexPatternSetUpdate(entry, context); + }); }; const serializeAws_json1_1RuleGroupUpdate = (input: RuleGroupUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.ActivatedRule !== undefined && { - ActivatedRule: serializeAws_json1_1ActivatedRule(input.ActivatedRule, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.ActivatedRule !== undefined && + input.ActivatedRule !== null && { + ActivatedRule: serializeAws_json1_1ActivatedRule(input.ActivatedRule, context), + }), }; }; const serializeAws_json1_1RuleGroupUpdates = (input: RuleGroupUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RuleGroupUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RuleGroupUpdate(entry, context); + }); }; const serializeAws_json1_1RuleUpdate = (input: RuleUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Predicate !== undefined && { Predicate: serializeAws_json1_1Predicate(input.Predicate, context) }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Predicate !== undefined && + input.Predicate !== null && { Predicate: serializeAws_json1_1Predicate(input.Predicate, context) }), }; }; const serializeAws_json1_1RuleUpdates = (input: RuleUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RuleUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RuleUpdate(entry, context); + }); }; const serializeAws_json1_1SizeConstraint = (input: SizeConstraint, context: __SerdeContext): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.Size !== undefined && { Size: input.Size }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; const serializeAws_json1_1SizeConstraintSetUpdate = (input: SizeConstraintSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.SizeConstraint !== undefined && { - SizeConstraint: serializeAws_json1_1SizeConstraint(input.SizeConstraint, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.SizeConstraint !== undefined && + input.SizeConstraint !== null && { + SizeConstraint: serializeAws_json1_1SizeConstraint(input.SizeConstraint, context), + }), }; }; @@ -9535,7 +9553,14 @@ const serializeAws_json1_1SizeConstraintSetUpdates = ( input: SizeConstraintSetUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1SizeConstraintSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SizeConstraintSetUpdate(entry, context); + }); }; const serializeAws_json1_1SqlInjectionMatchSetUpdate = ( @@ -9543,10 +9568,11 @@ const serializeAws_json1_1SqlInjectionMatchSetUpdate = ( context: __SerdeContext ): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.SqlInjectionMatchTuple !== undefined && { - SqlInjectionMatchTuple: serializeAws_json1_1SqlInjectionMatchTuple(input.SqlInjectionMatchTuple, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.SqlInjectionMatchTuple !== undefined && + input.SqlInjectionMatchTuple !== null && { + SqlInjectionMatchTuple: serializeAws_json1_1SqlInjectionMatchTuple(input.SqlInjectionMatchTuple, context), + }), }; }; @@ -9554,51 +9580,75 @@ const serializeAws_json1_1SqlInjectionMatchSetUpdates = ( input: SqlInjectionMatchSetUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1SqlInjectionMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SqlInjectionMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1SqlInjectionMatchTuple = (input: SqlInjectionMatchTuple, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TimeWindow = (input: TimeWindow, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -9607,9 +9657,11 @@ const serializeAws_json1_1UpdateByteMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ByteMatchSetId !== undefined && { ByteMatchSetId: input.ByteMatchSetId }), - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1ByteMatchSetUpdates(input.Updates, context) }), + ...(input.ByteMatchSetId !== undefined && + input.ByteMatchSetId !== null && { ByteMatchSetId: input.ByteMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1ByteMatchSetUpdates(input.Updates, context) }), }; }; @@ -9618,17 +9670,19 @@ const serializeAws_json1_1UpdateGeoMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.GeoMatchSetId !== undefined && { GeoMatchSetId: input.GeoMatchSetId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1GeoMatchSetUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.GeoMatchSetId !== undefined && input.GeoMatchSetId !== null && { GeoMatchSetId: input.GeoMatchSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1GeoMatchSetUpdates(input.Updates, context) }), }; }; const serializeAws_json1_1UpdateIPSetRequest = (input: UpdateIPSetRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1IPSetUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.IPSetId !== undefined && input.IPSetId !== null && { IPSetId: input.IPSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1IPSetUpdates(input.Updates, context) }), }; }; @@ -9637,10 +9691,11 @@ const serializeAws_json1_1UpdateRateBasedRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RateLimit !== undefined && { RateLimit: input.RateLimit }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RateLimit !== undefined && input.RateLimit !== null && { RateLimit: input.RateLimit }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) }), }; }; @@ -9649,9 +9704,11 @@ const serializeAws_json1_1UpdateRegexMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RegexMatchSetId !== undefined && { RegexMatchSetId: input.RegexMatchSetId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RegexMatchSetUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RegexMatchSetId !== undefined && + input.RegexMatchSetId !== null && { RegexMatchSetId: input.RegexMatchSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RegexMatchSetUpdates(input.Updates, context) }), }; }; @@ -9660,25 +9717,29 @@ const serializeAws_json1_1UpdateRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RegexPatternSetId !== undefined && { RegexPatternSetId: input.RegexPatternSetId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RegexPatternSetUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RegexPatternSetId !== undefined && + input.RegexPatternSetId !== null && { RegexPatternSetId: input.RegexPatternSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RegexPatternSetUpdates(input.Updates, context) }), }; }; const serializeAws_json1_1UpdateRuleGroupRequest = (input: UpdateRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RuleGroupUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleGroupId !== undefined && input.RuleGroupId !== null && { RuleGroupId: input.RuleGroupId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RuleGroupUpdates(input.Updates, context) }), }; }; const serializeAws_json1_1UpdateRuleRequest = (input: UpdateRuleRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) }), }; }; @@ -9687,11 +9748,11 @@ const serializeAws_json1_1UpdateSizeConstraintSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.SizeConstraintSetId !== undefined && { SizeConstraintSetId: input.SizeConstraintSetId }), - ...(input.Updates !== undefined && { - Updates: serializeAws_json1_1SizeConstraintSetUpdates(input.Updates, context), - }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.SizeConstraintSetId !== undefined && + input.SizeConstraintSetId !== null && { SizeConstraintSetId: input.SizeConstraintSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1SizeConstraintSetUpdates(input.Updates, context) }), }; }; @@ -9700,22 +9761,22 @@ const serializeAws_json1_1UpdateSqlInjectionMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.SqlInjectionMatchSetId !== undefined && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), - ...(input.Updates !== undefined && { - Updates: serializeAws_json1_1SqlInjectionMatchSetUpdates(input.Updates, context), - }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.SqlInjectionMatchSetId !== undefined && + input.SqlInjectionMatchSetId !== null && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1SqlInjectionMatchSetUpdates(input.Updates, context) }), }; }; const serializeAws_json1_1UpdateWebACLRequest = (input: UpdateWebACLRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.DefaultAction !== undefined && { - DefaultAction: serializeAws_json1_1WafAction(input.DefaultAction, context), - }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1WebACLUpdates(input.Updates, context) }), - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.DefaultAction !== undefined && + input.DefaultAction !== null && { DefaultAction: serializeAws_json1_1WafAction(input.DefaultAction, context) }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1WebACLUpdates(input.Updates, context) }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; @@ -9724,56 +9785,73 @@ const serializeAws_json1_1UpdateXssMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1XssMatchSetUpdates(input.Updates, context) }), - ...(input.XssMatchSetId !== undefined && { XssMatchSetId: input.XssMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1XssMatchSetUpdates(input.Updates, context) }), + ...(input.XssMatchSetId !== undefined && input.XssMatchSetId !== null && { XssMatchSetId: input.XssMatchSetId }), }; }; const serializeAws_json1_1WafAction = (input: WafAction, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1WafOverrideAction = (input: WafOverrideAction, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1WebACLUpdate = (input: WebACLUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.ActivatedRule !== undefined && { - ActivatedRule: serializeAws_json1_1ActivatedRule(input.ActivatedRule, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.ActivatedRule !== undefined && + input.ActivatedRule !== null && { + ActivatedRule: serializeAws_json1_1ActivatedRule(input.ActivatedRule, context), + }), }; }; const serializeAws_json1_1WebACLUpdates = (input: WebACLUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1WebACLUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1WebACLUpdate(entry, context); + }); }; const serializeAws_json1_1XssMatchSetUpdate = (input: XssMatchSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.XssMatchTuple !== undefined && { - XssMatchTuple: serializeAws_json1_1XssMatchTuple(input.XssMatchTuple, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.XssMatchTuple !== undefined && + input.XssMatchTuple !== null && { + XssMatchTuple: serializeAws_json1_1XssMatchTuple(input.XssMatchTuple, context), + }), }; }; const serializeAws_json1_1XssMatchSetUpdates = (input: XssMatchSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1XssMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1XssMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1XssMatchTuple = (input: XssMatchTuple, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; @@ -9798,7 +9876,14 @@ const deserializeAws_json1_1ActivatedRule = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ActivatedRules = (output: any, context: __SerdeContext): ActivatedRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ActivatedRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ActivatedRule(entry, context); + }); }; const deserializeAws_json1_1AssociateWebACLResponse = ( @@ -9821,7 +9906,14 @@ const deserializeAws_json1_1ByteMatchSet = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ByteMatchSetSummaries = (output: any, context: __SerdeContext): ByteMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ByteMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ByteMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1ByteMatchSetSummary = (output: any, context: __SerdeContext): ByteMatchSetSummary => { @@ -9854,7 +9946,14 @@ const deserializeAws_json1_1ByteMatchTuple = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ByteMatchTuples = (output: any, context: __SerdeContext): ByteMatchTuple[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ByteMatchTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ByteMatchTuple(entry, context); + }); }; const deserializeAws_json1_1CreateByteMatchSetResponse = ( @@ -10138,7 +10237,14 @@ const deserializeAws_json1_1ExcludedRule = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ExcludedRules = (output: any, context: __SerdeContext): ExcludedRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExcludedRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExcludedRule(entry, context); + }); }; const deserializeAws_json1_1FieldToMatch = (output: any, context: __SerdeContext): FieldToMatch => { @@ -10156,7 +10262,14 @@ const deserializeAws_json1_1GeoMatchConstraint = (output: any, context: __SerdeC }; const deserializeAws_json1_1GeoMatchConstraints = (output: any, context: __SerdeContext): GeoMatchConstraint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GeoMatchConstraint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GeoMatchConstraint(entry, context); + }); }; const deserializeAws_json1_1GeoMatchSet = (output: any, context: __SerdeContext): GeoMatchSet => { @@ -10172,7 +10285,14 @@ const deserializeAws_json1_1GeoMatchSet = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1GeoMatchSetSummaries = (output: any, context: __SerdeContext): GeoMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GeoMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GeoMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1GeoMatchSetSummary = (output: any, context: __SerdeContext): GeoMatchSetSummary => { @@ -10397,7 +10517,14 @@ const deserializeAws_json1_1HTTPHeader = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1HTTPHeaders = (output: any, context: __SerdeContext): HTTPHeader[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HTTPHeader(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HTTPHeader(entry, context); + }); }; const deserializeAws_json1_1HTTPRequest = (output: any, context: __SerdeContext): HTTPRequest => { @@ -10433,11 +10560,25 @@ const deserializeAws_json1_1IPSetDescriptor = (output: any, context: __SerdeCont }; const deserializeAws_json1_1IPSetDescriptors = (output: any, context: __SerdeContext): IPSetDescriptor[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IPSetDescriptor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IPSetDescriptor(entry, context); + }); }; const deserializeAws_json1_1IPSetSummaries = (output: any, context: __SerdeContext): IPSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IPSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IPSetSummary(entry, context); + }); }; const deserializeAws_json1_1IPSetSummary = (output: any, context: __SerdeContext): IPSetSummary => { @@ -10656,7 +10797,14 @@ const deserializeAws_json1_1ListXssMatchSetsResponse = ( }; const deserializeAws_json1_1LogDestinationConfigs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1LoggingConfiguration = (output: any, context: __SerdeContext): LoggingConfiguration => { @@ -10674,11 +10822,25 @@ const deserializeAws_json1_1LoggingConfiguration = (output: any, context: __Serd }; const deserializeAws_json1_1LoggingConfigurations = (output: any, context: __SerdeContext): LoggingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LoggingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoggingConfiguration(entry, context); + }); }; const deserializeAws_json1_1ManagedKeys = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Predicate = (output: any, context: __SerdeContext): Predicate => { @@ -10690,7 +10852,14 @@ const deserializeAws_json1_1Predicate = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Predicates = (output: any, context: __SerdeContext): Predicate[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Predicate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Predicate(entry, context); + }); }; const deserializeAws_json1_1PutLoggingConfigurationResponse = ( @@ -10727,7 +10896,14 @@ const deserializeAws_json1_1RateBasedRule = (output: any, context: __SerdeContex }; const deserializeAws_json1_1RedactedFields = (output: any, context: __SerdeContext): FieldToMatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FieldToMatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FieldToMatch(entry, context); + }); }; const deserializeAws_json1_1RegexMatchSet = (output: any, context: __SerdeContext): RegexMatchSet => { @@ -10743,7 +10919,14 @@ const deserializeAws_json1_1RegexMatchSet = (output: any, context: __SerdeContex }; const deserializeAws_json1_1RegexMatchSetSummaries = (output: any, context: __SerdeContext): RegexMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegexMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegexMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1RegexMatchSetSummary = (output: any, context: __SerdeContext): RegexMatchSetSummary => { @@ -10772,7 +10955,14 @@ const deserializeAws_json1_1RegexMatchTuple = (output: any, context: __SerdeCont }; const deserializeAws_json1_1RegexMatchTuples = (output: any, context: __SerdeContext): RegexMatchTuple[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegexMatchTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegexMatchTuple(entry, context); + }); }; const deserializeAws_json1_1RegexPatternSet = (output: any, context: __SerdeContext): RegexPatternSet => { @@ -10793,7 +10983,14 @@ const deserializeAws_json1_1RegexPatternSetSummaries = ( output: any, context: __SerdeContext ): RegexPatternSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegexPatternSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegexPatternSetSummary(entry, context); + }); }; const deserializeAws_json1_1RegexPatternSetSummary = (output: any, context: __SerdeContext): RegexPatternSetSummary => { @@ -10807,11 +11004,25 @@ const deserializeAws_json1_1RegexPatternSetSummary = (output: any, context: __Se }; const deserializeAws_json1_1RegexPatternStrings = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1ResourceArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Rule = (output: any, context: __SerdeContext): Rule => { @@ -10835,7 +11046,14 @@ const deserializeAws_json1_1RuleGroup = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1RuleGroupSummaries = (output: any, context: __SerdeContext): RuleGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RuleGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RuleGroupSummary(entry, context); + }); }; const deserializeAws_json1_1RuleGroupSummary = (output: any, context: __SerdeContext): RuleGroupSummary => { @@ -10846,7 +11064,14 @@ const deserializeAws_json1_1RuleGroupSummary = (output: any, context: __SerdeCon }; const deserializeAws_json1_1RuleSummaries = (output: any, context: __SerdeContext): RuleSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RuleSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RuleSummary(entry, context); + }); }; const deserializeAws_json1_1RuleSummary = (output: any, context: __SerdeContext): RuleSummary => { @@ -10876,7 +11101,14 @@ const deserializeAws_json1_1SampledHTTPRequest = (output: any, context: __SerdeC }; const deserializeAws_json1_1SampledHTTPRequests = (output: any, context: __SerdeContext): SampledHTTPRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SampledHTTPRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SampledHTTPRequest(entry, context); + }); }; const deserializeAws_json1_1SizeConstraint = (output: any, context: __SerdeContext): SizeConstraint => { @@ -10898,7 +11130,14 @@ const deserializeAws_json1_1SizeConstraint = (output: any, context: __SerdeConte }; const deserializeAws_json1_1SizeConstraints = (output: any, context: __SerdeContext): SizeConstraint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SizeConstraint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SizeConstraint(entry, context); + }); }; const deserializeAws_json1_1SizeConstraintSet = (output: any, context: __SerdeContext): SizeConstraintSet => { @@ -10919,7 +11158,14 @@ const deserializeAws_json1_1SizeConstraintSetSummaries = ( output: any, context: __SerdeContext ): SizeConstraintSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SizeConstraintSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SizeConstraintSetSummary(entry, context); + }); }; const deserializeAws_json1_1SizeConstraintSetSummary = ( @@ -10953,7 +11199,14 @@ const deserializeAws_json1_1SqlInjectionMatchSetSummaries = ( output: any, context: __SerdeContext ): SqlInjectionMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SqlInjectionMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SqlInjectionMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1SqlInjectionMatchSetSummary = ( @@ -10986,14 +11239,28 @@ const deserializeAws_json1_1SqlInjectionMatchTuples = ( output: any, context: __SerdeContext ): SqlInjectionMatchTuple[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SqlInjectionMatchTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SqlInjectionMatchTuple(entry, context); + }); }; const deserializeAws_json1_1SubscribedRuleGroupSummaries = ( output: any, context: __SerdeContext ): SubscribedRuleGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SubscribedRuleGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SubscribedRuleGroupSummary(entry, context); + }); }; const deserializeAws_json1_1SubscribedRuleGroupSummary = ( @@ -11025,7 +11292,14 @@ const deserializeAws_json1_1TagInfoForResource = (output: any, context: __SerdeC }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -11358,7 +11632,14 @@ const deserializeAws_json1_1WebACL = (output: any, context: __SerdeContext): Web }; const deserializeAws_json1_1WebACLSummaries = (output: any, context: __SerdeContext): WebACLSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WebACLSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WebACLSummary(entry, context); + }); }; const deserializeAws_json1_1WebACLSummary = (output: any, context: __SerdeContext): WebACLSummary => { @@ -11381,7 +11662,14 @@ const deserializeAws_json1_1XssMatchSet = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1XssMatchSetSummaries = (output: any, context: __SerdeContext): XssMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1XssMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1XssMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1XssMatchSetSummary = (output: any, context: __SerdeContext): XssMatchSetSummary => { @@ -11406,7 +11694,14 @@ const deserializeAws_json1_1XssMatchTuple = (output: any, context: __SerdeContex }; const deserializeAws_json1_1XssMatchTuples = (output: any, context: __SerdeContext): XssMatchTuple[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1XssMatchTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1XssMatchTuple(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -11459,3 +11754,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-waf/protocols/Aws_json1_1.ts b/clients/client-waf/protocols/Aws_json1_1.ts index 829a78c31a0f..4c816a3ac43f 100644 --- a/clients/client-waf/protocols/Aws_json1_1.ts +++ b/clients/client-waf/protocols/Aws_json1_1.ts @@ -419,7 +419,7 @@ export const serializeAws_json1_1CreateByteMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateByteMatchSet", }; let body: any; @@ -432,7 +432,7 @@ export const serializeAws_json1_1CreateGeoMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateGeoMatchSet", }; let body: any; @@ -445,7 +445,7 @@ export const serializeAws_json1_1CreateIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateIPSet", }; let body: any; @@ -458,7 +458,7 @@ export const serializeAws_json1_1CreateRateBasedRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateRateBasedRule", }; let body: any; @@ -471,7 +471,7 @@ export const serializeAws_json1_1CreateRegexMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateRegexMatchSet", }; let body: any; @@ -484,7 +484,7 @@ export const serializeAws_json1_1CreateRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateRegexPatternSet", }; let body: any; @@ -497,7 +497,7 @@ export const serializeAws_json1_1CreateRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateRule", }; let body: any; @@ -510,7 +510,7 @@ export const serializeAws_json1_1CreateRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateRuleGroup", }; let body: any; @@ -523,7 +523,7 @@ export const serializeAws_json1_1CreateSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateSizeConstraintSet", }; let body: any; @@ -536,7 +536,7 @@ export const serializeAws_json1_1CreateSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateSqlInjectionMatchSet", }; let body: any; @@ -549,7 +549,7 @@ export const serializeAws_json1_1CreateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateWebACL", }; let body: any; @@ -562,7 +562,7 @@ export const serializeAws_json1_1CreateWebACLMigrationStackCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateWebACLMigrationStack", }; let body: any; @@ -575,7 +575,7 @@ export const serializeAws_json1_1CreateXssMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.CreateXssMatchSet", }; let body: any; @@ -588,7 +588,7 @@ export const serializeAws_json1_1DeleteByteMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteByteMatchSet", }; let body: any; @@ -601,7 +601,7 @@ export const serializeAws_json1_1DeleteGeoMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteGeoMatchSet", }; let body: any; @@ -614,7 +614,7 @@ export const serializeAws_json1_1DeleteIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteIPSet", }; let body: any; @@ -627,7 +627,7 @@ export const serializeAws_json1_1DeleteLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteLoggingConfiguration", }; let body: any; @@ -640,7 +640,7 @@ export const serializeAws_json1_1DeletePermissionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeletePermissionPolicy", }; let body: any; @@ -653,7 +653,7 @@ export const serializeAws_json1_1DeleteRateBasedRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteRateBasedRule", }; let body: any; @@ -666,7 +666,7 @@ export const serializeAws_json1_1DeleteRegexMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteRegexMatchSet", }; let body: any; @@ -679,7 +679,7 @@ export const serializeAws_json1_1DeleteRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteRegexPatternSet", }; let body: any; @@ -692,7 +692,7 @@ export const serializeAws_json1_1DeleteRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteRule", }; let body: any; @@ -705,7 +705,7 @@ export const serializeAws_json1_1DeleteRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteRuleGroup", }; let body: any; @@ -718,7 +718,7 @@ export const serializeAws_json1_1DeleteSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteSizeConstraintSet", }; let body: any; @@ -731,7 +731,7 @@ export const serializeAws_json1_1DeleteSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteSqlInjectionMatchSet", }; let body: any; @@ -744,7 +744,7 @@ export const serializeAws_json1_1DeleteWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteWebACL", }; let body: any; @@ -757,7 +757,7 @@ export const serializeAws_json1_1DeleteXssMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.DeleteXssMatchSet", }; let body: any; @@ -770,7 +770,7 @@ export const serializeAws_json1_1GetByteMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetByteMatchSet", }; let body: any; @@ -783,7 +783,7 @@ export const serializeAws_json1_1GetChangeTokenCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetChangeToken", }; let body: any; @@ -796,7 +796,7 @@ export const serializeAws_json1_1GetChangeTokenStatusCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetChangeTokenStatus", }; let body: any; @@ -809,7 +809,7 @@ export const serializeAws_json1_1GetGeoMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetGeoMatchSet", }; let body: any; @@ -822,7 +822,7 @@ export const serializeAws_json1_1GetIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetIPSet", }; let body: any; @@ -835,7 +835,7 @@ export const serializeAws_json1_1GetLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetLoggingConfiguration", }; let body: any; @@ -848,7 +848,7 @@ export const serializeAws_json1_1GetPermissionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetPermissionPolicy", }; let body: any; @@ -861,7 +861,7 @@ export const serializeAws_json1_1GetRateBasedRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetRateBasedRule", }; let body: any; @@ -874,7 +874,7 @@ export const serializeAws_json1_1GetRateBasedRuleManagedKeysCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetRateBasedRuleManagedKeys", }; let body: any; @@ -887,7 +887,7 @@ export const serializeAws_json1_1GetRegexMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetRegexMatchSet", }; let body: any; @@ -900,7 +900,7 @@ export const serializeAws_json1_1GetRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetRegexPatternSet", }; let body: any; @@ -913,7 +913,7 @@ export const serializeAws_json1_1GetRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetRule", }; let body: any; @@ -926,7 +926,7 @@ export const serializeAws_json1_1GetRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetRuleGroup", }; let body: any; @@ -939,7 +939,7 @@ export const serializeAws_json1_1GetSampledRequestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetSampledRequests", }; let body: any; @@ -952,7 +952,7 @@ export const serializeAws_json1_1GetSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetSizeConstraintSet", }; let body: any; @@ -965,7 +965,7 @@ export const serializeAws_json1_1GetSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetSqlInjectionMatchSet", }; let body: any; @@ -978,7 +978,7 @@ export const serializeAws_json1_1GetWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetWebACL", }; let body: any; @@ -991,7 +991,7 @@ export const serializeAws_json1_1GetXssMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.GetXssMatchSet", }; let body: any; @@ -1004,7 +1004,7 @@ export const serializeAws_json1_1ListActivatedRulesInRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListActivatedRulesInRuleGroup", }; let body: any; @@ -1017,7 +1017,7 @@ export const serializeAws_json1_1ListByteMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListByteMatchSets", }; let body: any; @@ -1030,7 +1030,7 @@ export const serializeAws_json1_1ListGeoMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListGeoMatchSets", }; let body: any; @@ -1043,7 +1043,7 @@ export const serializeAws_json1_1ListIPSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListIPSets", }; let body: any; @@ -1056,7 +1056,7 @@ export const serializeAws_json1_1ListLoggingConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListLoggingConfigurations", }; let body: any; @@ -1069,7 +1069,7 @@ export const serializeAws_json1_1ListRateBasedRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListRateBasedRules", }; let body: any; @@ -1082,7 +1082,7 @@ export const serializeAws_json1_1ListRegexMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListRegexMatchSets", }; let body: any; @@ -1095,7 +1095,7 @@ export const serializeAws_json1_1ListRegexPatternSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListRegexPatternSets", }; let body: any; @@ -1108,7 +1108,7 @@ export const serializeAws_json1_1ListRuleGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListRuleGroups", }; let body: any; @@ -1121,7 +1121,7 @@ export const serializeAws_json1_1ListRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListRules", }; let body: any; @@ -1134,7 +1134,7 @@ export const serializeAws_json1_1ListSizeConstraintSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListSizeConstraintSets", }; let body: any; @@ -1147,7 +1147,7 @@ export const serializeAws_json1_1ListSqlInjectionMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListSqlInjectionMatchSets", }; let body: any; @@ -1160,7 +1160,7 @@ export const serializeAws_json1_1ListSubscribedRuleGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListSubscribedRuleGroups", }; let body: any; @@ -1173,7 +1173,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListTagsForResource", }; let body: any; @@ -1186,7 +1186,7 @@ export const serializeAws_json1_1ListWebACLsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListWebACLs", }; let body: any; @@ -1199,7 +1199,7 @@ export const serializeAws_json1_1ListXssMatchSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.ListXssMatchSets", }; let body: any; @@ -1212,7 +1212,7 @@ export const serializeAws_json1_1PutLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.PutLoggingConfiguration", }; let body: any; @@ -1225,7 +1225,7 @@ export const serializeAws_json1_1PutPermissionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.PutPermissionPolicy", }; let body: any; @@ -1238,7 +1238,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.TagResource", }; let body: any; @@ -1251,7 +1251,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UntagResource", }; let body: any; @@ -1264,7 +1264,7 @@ export const serializeAws_json1_1UpdateByteMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateByteMatchSet", }; let body: any; @@ -1277,7 +1277,7 @@ export const serializeAws_json1_1UpdateGeoMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateGeoMatchSet", }; let body: any; @@ -1290,7 +1290,7 @@ export const serializeAws_json1_1UpdateIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateIPSet", }; let body: any; @@ -1303,7 +1303,7 @@ export const serializeAws_json1_1UpdateRateBasedRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateRateBasedRule", }; let body: any; @@ -1316,7 +1316,7 @@ export const serializeAws_json1_1UpdateRegexMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateRegexMatchSet", }; let body: any; @@ -1329,7 +1329,7 @@ export const serializeAws_json1_1UpdateRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateRegexPatternSet", }; let body: any; @@ -1342,7 +1342,7 @@ export const serializeAws_json1_1UpdateRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateRule", }; let body: any; @@ -1355,7 +1355,7 @@ export const serializeAws_json1_1UpdateRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateRuleGroup", }; let body: any; @@ -1368,7 +1368,7 @@ export const serializeAws_json1_1UpdateSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateSizeConstraintSet", }; let body: any; @@ -1381,7 +1381,7 @@ export const serializeAws_json1_1UpdateSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateSqlInjectionMatchSet", }; let body: any; @@ -1394,7 +1394,7 @@ export const serializeAws_json1_1UpdateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateWebACL", }; let body: any; @@ -1407,7 +1407,7 @@ export const serializeAws_json1_1UpdateXssMatchSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20150824.UpdateXssMatchSet", }; let body: any; @@ -1442,8 +1442,7 @@ const deserializeAws_json1_1CreateByteMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.waf#WAFDisallowedNameException": @@ -1537,8 +1536,7 @@ const deserializeAws_json1_1CreateGeoMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.waf#WAFDisallowedNameException": @@ -1632,8 +1630,7 @@ const deserializeAws_json1_1CreateIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.waf#WAFDisallowedNameException": @@ -1727,8 +1724,7 @@ const deserializeAws_json1_1CreateRateBasedRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.waf#WAFBadRequestException": @@ -1838,8 +1834,7 @@ const deserializeAws_json1_1CreateRegexMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.waf#WAFDisallowedNameException": @@ -1917,8 +1912,7 @@ const deserializeAws_json1_1CreateRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.waf#WAFDisallowedNameException": @@ -1996,8 +1990,7 @@ const deserializeAws_json1_1CreateRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.waf#WAFBadRequestException": @@ -2107,8 +2100,7 @@ const deserializeAws_json1_1CreateRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.waf#WAFBadRequestException": @@ -2210,8 +2202,7 @@ const deserializeAws_json1_1CreateSizeConstraintSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.waf#WAFDisallowedNameException": @@ -2305,8 +2296,7 @@ const deserializeAws_json1_1CreateSqlInjectionMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.waf#WAFDisallowedNameException": @@ -2400,8 +2390,7 @@ const deserializeAws_json1_1CreateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.waf#WAFBadRequestException": @@ -2519,8 +2508,7 @@ const deserializeAws_json1_1CreateWebACLMigrationStackCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFEntityMigrationException": case "com.amazonaws.waf#WAFEntityMigrationException": @@ -2606,8 +2594,7 @@ const deserializeAws_json1_1CreateXssMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.waf#WAFDisallowedNameException": @@ -2701,8 +2688,7 @@ const deserializeAws_json1_1DeleteByteMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -2796,8 +2782,7 @@ const deserializeAws_json1_1DeleteGeoMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -2891,8 +2876,7 @@ const deserializeAws_json1_1DeleteIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -2986,8 +2970,7 @@ const deserializeAws_json1_1DeleteLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3057,8 +3040,7 @@ const deserializeAws_json1_1DeletePermissionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3128,8 +3110,7 @@ const deserializeAws_json1_1DeleteRateBasedRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3239,8 +3220,7 @@ const deserializeAws_json1_1DeleteRegexMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3334,8 +3314,7 @@ const deserializeAws_json1_1DeleteRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3429,8 +3408,7 @@ const deserializeAws_json1_1DeleteRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3540,8 +3518,7 @@ const deserializeAws_json1_1DeleteRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3651,8 +3628,7 @@ const deserializeAws_json1_1DeleteSizeConstraintSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3746,8 +3722,7 @@ const deserializeAws_json1_1DeleteSqlInjectionMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3841,8 +3816,7 @@ const deserializeAws_json1_1DeleteWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -3952,8 +3926,7 @@ const deserializeAws_json1_1DeleteXssMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4047,8 +4020,7 @@ const deserializeAws_json1_1GetByteMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4118,8 +4090,7 @@ const deserializeAws_json1_1GetChangeTokenCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4173,8 +4144,7 @@ const deserializeAws_json1_1GetChangeTokenStatusCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4236,8 +4206,7 @@ const deserializeAws_json1_1GetGeoMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4307,8 +4276,7 @@ const deserializeAws_json1_1GetIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4378,8 +4346,7 @@ const deserializeAws_json1_1GetLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4441,8 +4408,7 @@ const deserializeAws_json1_1GetPermissionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4504,8 +4470,7 @@ const deserializeAws_json1_1GetRateBasedRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4575,8 +4540,7 @@ const deserializeAws_json1_1GetRateBasedRuleManagedKeysCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4654,8 +4618,7 @@ const deserializeAws_json1_1GetRegexMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4725,8 +4688,7 @@ const deserializeAws_json1_1GetRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4796,8 +4758,7 @@ const deserializeAws_json1_1GetRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4867,8 +4828,7 @@ const deserializeAws_json1_1GetRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4930,8 +4890,7 @@ const deserializeAws_json1_1GetSampledRequestsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -4993,8 +4952,7 @@ const deserializeAws_json1_1GetSizeConstraintSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5064,8 +5022,7 @@ const deserializeAws_json1_1GetSqlInjectionMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5135,8 +5092,7 @@ const deserializeAws_json1_1GetWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5206,8 +5162,7 @@ const deserializeAws_json1_1GetXssMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5277,8 +5232,7 @@ const deserializeAws_json1_1ListActivatedRulesInRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5348,8 +5302,7 @@ const deserializeAws_json1_1ListByteMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5411,8 +5364,7 @@ const deserializeAws_json1_1ListGeoMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5474,8 +5426,7 @@ const deserializeAws_json1_1ListIPSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5537,8 +5488,7 @@ const deserializeAws_json1_1ListLoggingConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5608,8 +5558,7 @@ const deserializeAws_json1_1ListRateBasedRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5671,8 +5620,7 @@ const deserializeAws_json1_1ListRegexMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5734,8 +5682,7 @@ const deserializeAws_json1_1ListRegexPatternSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5797,8 +5744,7 @@ const deserializeAws_json1_1ListRuleGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5852,8 +5798,7 @@ const deserializeAws_json1_1ListRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5915,8 +5860,7 @@ const deserializeAws_json1_1ListSizeConstraintSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -5978,8 +5922,7 @@ const deserializeAws_json1_1ListSqlInjectionMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -6041,8 +5984,7 @@ const deserializeAws_json1_1ListSubscribedRuleGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -6104,8 +6046,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.waf#WAFBadRequestException": @@ -6199,8 +6140,7 @@ const deserializeAws_json1_1ListWebACLsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -6262,8 +6202,7 @@ const deserializeAws_json1_1ListXssMatchSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -6325,8 +6264,7 @@ const deserializeAws_json1_1PutLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -6404,8 +6342,7 @@ const deserializeAws_json1_1PutPermissionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -6483,8 +6420,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.waf#WAFBadRequestException": @@ -6586,8 +6522,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFBadRequestException": case "com.amazonaws.waf#WAFBadRequestException": @@ -6681,8 +6616,7 @@ const deserializeAws_json1_1UpdateByteMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -6792,8 +6726,7 @@ const deserializeAws_json1_1UpdateGeoMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -6911,8 +6844,7 @@ const deserializeAws_json1_1UpdateIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -7030,8 +6962,7 @@ const deserializeAws_json1_1UpdateRateBasedRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -7149,8 +7080,7 @@ const deserializeAws_json1_1UpdateRegexMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDisallowedNameException": case "com.amazonaws.waf#WAFDisallowedNameException": @@ -7260,8 +7190,7 @@ const deserializeAws_json1_1UpdateRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -7371,8 +7300,7 @@ const deserializeAws_json1_1UpdateRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -7490,8 +7418,7 @@ const deserializeAws_json1_1UpdateRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -7593,8 +7520,7 @@ const deserializeAws_json1_1UpdateSizeConstraintSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -7712,8 +7638,7 @@ const deserializeAws_json1_1UpdateSqlInjectionMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -7823,8 +7748,7 @@ const deserializeAws_json1_1UpdateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -7950,8 +7874,7 @@ const deserializeAws_json1_1UpdateXssMatchSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": @@ -8321,40 +8244,53 @@ const deserializeAws_json1_1WAFTagOperationInternalErrorExceptionResponse = asyn const serializeAws_json1_1ActivatedRule = (input: ActivatedRule, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: serializeAws_json1_1WafAction(input.Action, context) }), - ...(input.ExcludedRules !== undefined && { - ExcludedRules: serializeAws_json1_1ExcludedRules(input.ExcludedRules, context), - }), - ...(input.OverrideAction !== undefined && { - OverrideAction: serializeAws_json1_1WafOverrideAction(input.OverrideAction, context), - }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Action !== undefined && + input.Action !== null && { Action: serializeAws_json1_1WafAction(input.Action, context) }), + ...(input.ExcludedRules !== undefined && + input.ExcludedRules !== null && { + ExcludedRules: serializeAws_json1_1ExcludedRules(input.ExcludedRules, context), + }), + ...(input.OverrideAction !== undefined && + input.OverrideAction !== null && { + OverrideAction: serializeAws_json1_1WafOverrideAction(input.OverrideAction, context), + }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1ByteMatchSetUpdate = (input: ByteMatchSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.ByteMatchTuple !== undefined && { - ByteMatchTuple: serializeAws_json1_1ByteMatchTuple(input.ByteMatchTuple, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.ByteMatchTuple !== undefined && + input.ByteMatchTuple !== null && { + ByteMatchTuple: serializeAws_json1_1ByteMatchTuple(input.ByteMatchTuple, context), + }), }; }; const serializeAws_json1_1ByteMatchSetUpdates = (input: ByteMatchSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ByteMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ByteMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1ByteMatchTuple = (input: ByteMatchTuple, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.PositionalConstraint !== undefined && { PositionalConstraint: input.PositionalConstraint }), - ...(input.TargetString !== undefined && { TargetString: context.base64Encoder(input.TargetString) }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.PositionalConstraint !== undefined && + input.PositionalConstraint !== null && { PositionalConstraint: input.PositionalConstraint }), + ...(input.TargetString !== undefined && + input.TargetString !== null && { TargetString: context.base64Encoder(input.TargetString) }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; @@ -8363,8 +8299,8 @@ const serializeAws_json1_1CreateByteMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8373,15 +8309,15 @@ const serializeAws_json1_1CreateGeoMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1CreateIPSetRequest = (input: CreateIPSetRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8390,12 +8326,12 @@ const serializeAws_json1_1CreateRateBasedRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RateKey !== undefined && { RateKey: input.RateKey }), - ...(input.RateLimit !== undefined && { RateLimit: input.RateLimit }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RateKey !== undefined && input.RateKey !== null && { RateKey: input.RateKey }), + ...(input.RateLimit !== undefined && input.RateLimit !== null && { RateLimit: input.RateLimit }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -8404,8 +8340,8 @@ const serializeAws_json1_1CreateRegexMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8414,26 +8350,26 @@ const serializeAws_json1_1CreateRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1CreateRuleGroupRequest = (input: CreateRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateRuleRequest = (input: CreateRuleRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -8442,8 +8378,8 @@ const serializeAws_json1_1CreateSizeConstraintSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8452,8 +8388,8 @@ const serializeAws_json1_1CreateSqlInjectionMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8462,21 +8398,21 @@ const serializeAws_json1_1CreateWebACLMigrationStackRequest = ( context: __SerdeContext ): any => { return { - ...(input.IgnoreUnsupportedType !== undefined && { IgnoreUnsupportedType: input.IgnoreUnsupportedType }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.IgnoreUnsupportedType !== undefined && + input.IgnoreUnsupportedType !== null && { IgnoreUnsupportedType: input.IgnoreUnsupportedType }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; const serializeAws_json1_1CreateWebACLRequest = (input: CreateWebACLRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.DefaultAction !== undefined && { - DefaultAction: serializeAws_json1_1WafAction(input.DefaultAction, context), - }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.DefaultAction !== undefined && + input.DefaultAction !== null && { DefaultAction: serializeAws_json1_1WafAction(input.DefaultAction, context) }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -8485,8 +8421,8 @@ const serializeAws_json1_1CreateXssMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; @@ -8495,8 +8431,9 @@ const serializeAws_json1_1DeleteByteMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ByteMatchSetId !== undefined && { ByteMatchSetId: input.ByteMatchSetId }), - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.ByteMatchSetId !== undefined && + input.ByteMatchSetId !== null && { ByteMatchSetId: input.ByteMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), }; }; @@ -8505,15 +8442,15 @@ const serializeAws_json1_1DeleteGeoMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.GeoMatchSetId !== undefined && { GeoMatchSetId: input.GeoMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.GeoMatchSetId !== undefined && input.GeoMatchSetId !== null && { GeoMatchSetId: input.GeoMatchSetId }), }; }; const serializeAws_json1_1DeleteIPSetRequest = (input: DeleteIPSetRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.IPSetId !== undefined && input.IPSetId !== null && { IPSetId: input.IPSetId }), }; }; @@ -8522,7 +8459,7 @@ const serializeAws_json1_1DeleteLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -8531,7 +8468,7 @@ const serializeAws_json1_1DeletePermissionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -8540,8 +8477,8 @@ const serializeAws_json1_1DeleteRateBasedRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; @@ -8550,8 +8487,9 @@ const serializeAws_json1_1DeleteRegexMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RegexMatchSetId !== undefined && { RegexMatchSetId: input.RegexMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RegexMatchSetId !== undefined && + input.RegexMatchSetId !== null && { RegexMatchSetId: input.RegexMatchSetId }), }; }; @@ -8560,22 +8498,23 @@ const serializeAws_json1_1DeleteRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RegexPatternSetId !== undefined && { RegexPatternSetId: input.RegexPatternSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RegexPatternSetId !== undefined && + input.RegexPatternSetId !== null && { RegexPatternSetId: input.RegexPatternSetId }), }; }; const serializeAws_json1_1DeleteRuleGroupRequest = (input: DeleteRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleGroupId !== undefined && input.RuleGroupId !== null && { RuleGroupId: input.RuleGroupId }), }; }; const serializeAws_json1_1DeleteRuleRequest = (input: DeleteRuleRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; @@ -8584,8 +8523,9 @@ const serializeAws_json1_1DeleteSizeConstraintSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.SizeConstraintSetId !== undefined && { SizeConstraintSetId: input.SizeConstraintSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.SizeConstraintSetId !== undefined && + input.SizeConstraintSetId !== null && { SizeConstraintSetId: input.SizeConstraintSetId }), }; }; @@ -8594,15 +8534,16 @@ const serializeAws_json1_1DeleteSqlInjectionMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.SqlInjectionMatchSetId !== undefined && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.SqlInjectionMatchSetId !== undefined && + input.SqlInjectionMatchSetId !== null && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), }; }; const serializeAws_json1_1DeleteWebACLRequest = (input: DeleteWebACLRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; @@ -8611,51 +8552,67 @@ const serializeAws_json1_1DeleteXssMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.XssMatchSetId !== undefined && { XssMatchSetId: input.XssMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.XssMatchSetId !== undefined && input.XssMatchSetId !== null && { XssMatchSetId: input.XssMatchSetId }), }; }; const serializeAws_json1_1ExcludedRule = (input: ExcludedRule, context: __SerdeContext): any => { return { - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; const serializeAws_json1_1ExcludedRules = (input: ExcludedRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ExcludedRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ExcludedRule(entry, context); + }); }; const serializeAws_json1_1FieldToMatch = (input: FieldToMatch, context: __SerdeContext): any => { return { - ...(input.Data !== undefined && { Data: input.Data }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Data !== undefined && input.Data !== null && { Data: input.Data }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1GeoMatchConstraint = (input: GeoMatchConstraint, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1GeoMatchSetUpdate = (input: GeoMatchSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.GeoMatchConstraint !== undefined && { - GeoMatchConstraint: serializeAws_json1_1GeoMatchConstraint(input.GeoMatchConstraint, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.GeoMatchConstraint !== undefined && + input.GeoMatchConstraint !== null && { + GeoMatchConstraint: serializeAws_json1_1GeoMatchConstraint(input.GeoMatchConstraint, context), + }), }; }; const serializeAws_json1_1GeoMatchSetUpdates = (input: GeoMatchSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1GeoMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1GeoMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1GetByteMatchSetRequest = (input: GetByteMatchSetRequest, context: __SerdeContext): any => { return { - ...(input.ByteMatchSetId !== undefined && { ByteMatchSetId: input.ByteMatchSetId }), + ...(input.ByteMatchSetId !== undefined && + input.ByteMatchSetId !== null && { ByteMatchSetId: input.ByteMatchSetId }), }; }; @@ -8668,19 +8625,19 @@ const serializeAws_json1_1GetChangeTokenStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), }; }; const serializeAws_json1_1GetGeoMatchSetRequest = (input: GetGeoMatchSetRequest, context: __SerdeContext): any => { return { - ...(input.GeoMatchSetId !== undefined && { GeoMatchSetId: input.GeoMatchSetId }), + ...(input.GeoMatchSetId !== undefined && input.GeoMatchSetId !== null && { GeoMatchSetId: input.GeoMatchSetId }), }; }; const serializeAws_json1_1GetIPSetRequest = (input: GetIPSetRequest, context: __SerdeContext): any => { return { - ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }), + ...(input.IPSetId !== undefined && input.IPSetId !== null && { IPSetId: input.IPSetId }), }; }; @@ -8689,7 +8646,7 @@ const serializeAws_json1_1GetLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -8698,7 +8655,7 @@ const serializeAws_json1_1GetPermissionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -8707,20 +8664,21 @@ const serializeAws_json1_1GetRateBasedRuleManagedKeysRequest = ( context: __SerdeContext ): any => { return { - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; const serializeAws_json1_1GetRateBasedRuleRequest = (input: GetRateBasedRuleRequest, context: __SerdeContext): any => { return { - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; const serializeAws_json1_1GetRegexMatchSetRequest = (input: GetRegexMatchSetRequest, context: __SerdeContext): any => { return { - ...(input.RegexMatchSetId !== undefined && { RegexMatchSetId: input.RegexMatchSetId }), + ...(input.RegexMatchSetId !== undefined && + input.RegexMatchSetId !== null && { RegexMatchSetId: input.RegexMatchSetId }), }; }; @@ -8729,19 +8687,20 @@ const serializeAws_json1_1GetRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.RegexPatternSetId !== undefined && { RegexPatternSetId: input.RegexPatternSetId }), + ...(input.RegexPatternSetId !== undefined && + input.RegexPatternSetId !== null && { RegexPatternSetId: input.RegexPatternSetId }), }; }; const serializeAws_json1_1GetRuleGroupRequest = (input: GetRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), + ...(input.RuleGroupId !== undefined && input.RuleGroupId !== null && { RuleGroupId: input.RuleGroupId }), }; }; const serializeAws_json1_1GetRuleRequest = (input: GetRuleRequest, context: __SerdeContext): any => { return { - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), }; }; @@ -8750,10 +8709,11 @@ const serializeAws_json1_1GetSampledRequestsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), - ...(input.TimeWindow !== undefined && { TimeWindow: serializeAws_json1_1TimeWindow(input.TimeWindow, context) }), - ...(input.WebAclId !== undefined && { WebAclId: input.WebAclId }), + ...(input.MaxItems !== undefined && input.MaxItems !== null && { MaxItems: input.MaxItems }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), + ...(input.TimeWindow !== undefined && + input.TimeWindow !== null && { TimeWindow: serializeAws_json1_1TimeWindow(input.TimeWindow, context) }), + ...(input.WebAclId !== undefined && input.WebAclId !== null && { WebAclId: input.WebAclId }), }; }; @@ -8762,7 +8722,8 @@ const serializeAws_json1_1GetSizeConstraintSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.SizeConstraintSetId !== undefined && { SizeConstraintSetId: input.SizeConstraintSetId }), + ...(input.SizeConstraintSetId !== undefined && + input.SizeConstraintSetId !== null && { SizeConstraintSetId: input.SizeConstraintSetId }), }; }; @@ -8771,40 +8732,49 @@ const serializeAws_json1_1GetSqlInjectionMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.SqlInjectionMatchSetId !== undefined && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), + ...(input.SqlInjectionMatchSetId !== undefined && + input.SqlInjectionMatchSetId !== null && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), }; }; const serializeAws_json1_1GetWebACLRequest = (input: GetWebACLRequest, context: __SerdeContext): any => { return { - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; const serializeAws_json1_1GetXssMatchSetRequest = (input: GetXssMatchSetRequest, context: __SerdeContext): any => { return { - ...(input.XssMatchSetId !== undefined && { XssMatchSetId: input.XssMatchSetId }), + ...(input.XssMatchSetId !== undefined && input.XssMatchSetId !== null && { XssMatchSetId: input.XssMatchSetId }), }; }; const serializeAws_json1_1IPSetDescriptor = (input: IPSetDescriptor, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1IPSetUpdate = (input: IPSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.IPSetDescriptor !== undefined && { - IPSetDescriptor: serializeAws_json1_1IPSetDescriptor(input.IPSetDescriptor, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.IPSetDescriptor !== undefined && + input.IPSetDescriptor !== null && { + IPSetDescriptor: serializeAws_json1_1IPSetDescriptor(input.IPSetDescriptor, context), + }), }; }; const serializeAws_json1_1IPSetUpdates = (input: IPSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1IPSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1IPSetUpdate(entry, context); + }); }; const serializeAws_json1_1ListActivatedRulesInRuleGroupRequest = ( @@ -8812,9 +8782,9 @@ const serializeAws_json1_1ListActivatedRulesInRuleGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.RuleGroupId !== undefined && input.RuleGroupId !== null && { RuleGroupId: input.RuleGroupId }), }; }; @@ -8823,22 +8793,22 @@ const serializeAws_json1_1ListByteMatchSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1ListGeoMatchSetsRequest = (input: ListGeoMatchSetsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1ListIPSetsRequest = (input: ListIPSetsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -8847,8 +8817,8 @@ const serializeAws_json1_1ListLoggingConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -8857,8 +8827,8 @@ const serializeAws_json1_1ListRateBasedRulesRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -8867,8 +8837,8 @@ const serializeAws_json1_1ListRegexMatchSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -8877,22 +8847,22 @@ const serializeAws_json1_1ListRegexPatternSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1ListRuleGroupsRequest = (input: ListRuleGroupsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1ListRulesRequest = (input: ListRulesRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -8901,8 +8871,8 @@ const serializeAws_json1_1ListSizeConstraintSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -8911,8 +8881,8 @@ const serializeAws_json1_1ListSqlInjectionMatchSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -8921,8 +8891,8 @@ const serializeAws_json1_1ListSubscribedRuleGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; @@ -8931,47 +8901,56 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1ListWebACLsRequest = (input: ListWebACLsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1ListXssMatchSetsRequest = (input: ListXssMatchSetsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), }; }; const serializeAws_json1_1LogDestinationConfigs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1LoggingConfiguration = (input: LoggingConfiguration, context: __SerdeContext): any => { return { - ...(input.LogDestinationConfigs !== undefined && { - LogDestinationConfigs: serializeAws_json1_1LogDestinationConfigs(input.LogDestinationConfigs, context), - }), - ...(input.RedactedFields !== undefined && { - RedactedFields: serializeAws_json1_1RedactedFields(input.RedactedFields, context), - }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.LogDestinationConfigs !== undefined && + input.LogDestinationConfigs !== null && { + LogDestinationConfigs: serializeAws_json1_1LogDestinationConfigs(input.LogDestinationConfigs, context), + }), + ...(input.RedactedFields !== undefined && + input.RedactedFields !== null && { + RedactedFields: serializeAws_json1_1RedactedFields(input.RedactedFields, context), + }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1Predicate = (input: Predicate, context: __SerdeContext): any => { return { - ...(input.DataId !== undefined && { DataId: input.DataId }), - ...(input.Negated !== undefined && { Negated: input.Negated }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.DataId !== undefined && input.DataId !== null && { DataId: input.DataId }), + ...(input.Negated !== undefined && input.Negated !== null && { Negated: input.Negated }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; @@ -8980,9 +8959,10 @@ const serializeAws_json1_1PutLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.LoggingConfiguration !== undefined && { - LoggingConfiguration: serializeAws_json1_1LoggingConfiguration(input.LoggingConfiguration, context), - }), + ...(input.LoggingConfiguration !== undefined && + input.LoggingConfiguration !== null && { + LoggingConfiguration: serializeAws_json1_1LoggingConfiguration(input.LoggingConfiguration, context), + }), }; }; @@ -8991,90 +8971,132 @@ const serializeAws_json1_1PutPermissionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1RedactedFields = (input: FieldToMatch[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FieldToMatch(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FieldToMatch(entry, context); + }); }; const serializeAws_json1_1RegexMatchSetUpdate = (input: RegexMatchSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.RegexMatchTuple !== undefined && { - RegexMatchTuple: serializeAws_json1_1RegexMatchTuple(input.RegexMatchTuple, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.RegexMatchTuple !== undefined && + input.RegexMatchTuple !== null && { + RegexMatchTuple: serializeAws_json1_1RegexMatchTuple(input.RegexMatchTuple, context), + }), }; }; const serializeAws_json1_1RegexMatchSetUpdates = (input: RegexMatchSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RegexMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RegexMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1RegexMatchTuple = (input: RegexMatchTuple, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.RegexPatternSetId !== undefined && { RegexPatternSetId: input.RegexPatternSetId }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.RegexPatternSetId !== undefined && + input.RegexPatternSetId !== null && { RegexPatternSetId: input.RegexPatternSetId }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; const serializeAws_json1_1RegexPatternSetUpdate = (input: RegexPatternSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.RegexPatternString !== undefined && { RegexPatternString: input.RegexPatternString }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.RegexPatternString !== undefined && + input.RegexPatternString !== null && { RegexPatternString: input.RegexPatternString }), }; }; const serializeAws_json1_1RegexPatternSetUpdates = (input: RegexPatternSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RegexPatternSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RegexPatternSetUpdate(entry, context); + }); }; const serializeAws_json1_1RuleGroupUpdate = (input: RuleGroupUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.ActivatedRule !== undefined && { - ActivatedRule: serializeAws_json1_1ActivatedRule(input.ActivatedRule, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.ActivatedRule !== undefined && + input.ActivatedRule !== null && { + ActivatedRule: serializeAws_json1_1ActivatedRule(input.ActivatedRule, context), + }), }; }; const serializeAws_json1_1RuleGroupUpdates = (input: RuleGroupUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RuleGroupUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RuleGroupUpdate(entry, context); + }); }; const serializeAws_json1_1RuleUpdate = (input: RuleUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Predicate !== undefined && { Predicate: serializeAws_json1_1Predicate(input.Predicate, context) }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Predicate !== undefined && + input.Predicate !== null && { Predicate: serializeAws_json1_1Predicate(input.Predicate, context) }), }; }; const serializeAws_json1_1RuleUpdates = (input: RuleUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RuleUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RuleUpdate(entry, context); + }); }; const serializeAws_json1_1SizeConstraint = (input: SizeConstraint, context: __SerdeContext): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.Size !== undefined && { Size: input.Size }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; const serializeAws_json1_1SizeConstraintSetUpdate = (input: SizeConstraintSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.SizeConstraint !== undefined && { - SizeConstraint: serializeAws_json1_1SizeConstraint(input.SizeConstraint, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.SizeConstraint !== undefined && + input.SizeConstraint !== null && { + SizeConstraint: serializeAws_json1_1SizeConstraint(input.SizeConstraint, context), + }), }; }; @@ -9082,7 +9104,14 @@ const serializeAws_json1_1SizeConstraintSetUpdates = ( input: SizeConstraintSetUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1SizeConstraintSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SizeConstraintSetUpdate(entry, context); + }); }; const serializeAws_json1_1SqlInjectionMatchSetUpdate = ( @@ -9090,10 +9119,11 @@ const serializeAws_json1_1SqlInjectionMatchSetUpdate = ( context: __SerdeContext ): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.SqlInjectionMatchTuple !== undefined && { - SqlInjectionMatchTuple: serializeAws_json1_1SqlInjectionMatchTuple(input.SqlInjectionMatchTuple, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.SqlInjectionMatchTuple !== undefined && + input.SqlInjectionMatchTuple !== null && { + SqlInjectionMatchTuple: serializeAws_json1_1SqlInjectionMatchTuple(input.SqlInjectionMatchTuple, context), + }), }; }; @@ -9101,51 +9131,75 @@ const serializeAws_json1_1SqlInjectionMatchSetUpdates = ( input: SqlInjectionMatchSetUpdate[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_json1_1SqlInjectionMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1SqlInjectionMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1SqlInjectionMatchTuple = (input: SqlInjectionMatchTuple, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TimeWindow = (input: TimeWindow, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -9154,9 +9208,11 @@ const serializeAws_json1_1UpdateByteMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ByteMatchSetId !== undefined && { ByteMatchSetId: input.ByteMatchSetId }), - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1ByteMatchSetUpdates(input.Updates, context) }), + ...(input.ByteMatchSetId !== undefined && + input.ByteMatchSetId !== null && { ByteMatchSetId: input.ByteMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1ByteMatchSetUpdates(input.Updates, context) }), }; }; @@ -9165,17 +9221,19 @@ const serializeAws_json1_1UpdateGeoMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.GeoMatchSetId !== undefined && { GeoMatchSetId: input.GeoMatchSetId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1GeoMatchSetUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.GeoMatchSetId !== undefined && input.GeoMatchSetId !== null && { GeoMatchSetId: input.GeoMatchSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1GeoMatchSetUpdates(input.Updates, context) }), }; }; const serializeAws_json1_1UpdateIPSetRequest = (input: UpdateIPSetRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1IPSetUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.IPSetId !== undefined && input.IPSetId !== null && { IPSetId: input.IPSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1IPSetUpdates(input.Updates, context) }), }; }; @@ -9184,10 +9242,11 @@ const serializeAws_json1_1UpdateRateBasedRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RateLimit !== undefined && { RateLimit: input.RateLimit }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RateLimit !== undefined && input.RateLimit !== null && { RateLimit: input.RateLimit }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) }), }; }; @@ -9196,9 +9255,11 @@ const serializeAws_json1_1UpdateRegexMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RegexMatchSetId !== undefined && { RegexMatchSetId: input.RegexMatchSetId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RegexMatchSetUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RegexMatchSetId !== undefined && + input.RegexMatchSetId !== null && { RegexMatchSetId: input.RegexMatchSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RegexMatchSetUpdates(input.Updates, context) }), }; }; @@ -9207,25 +9268,29 @@ const serializeAws_json1_1UpdateRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RegexPatternSetId !== undefined && { RegexPatternSetId: input.RegexPatternSetId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RegexPatternSetUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RegexPatternSetId !== undefined && + input.RegexPatternSetId !== null && { RegexPatternSetId: input.RegexPatternSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RegexPatternSetUpdates(input.Updates, context) }), }; }; const serializeAws_json1_1UpdateRuleGroupRequest = (input: UpdateRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RuleGroupUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleGroupId !== undefined && input.RuleGroupId !== null && { RuleGroupId: input.RuleGroupId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RuleGroupUpdates(input.Updates, context) }), }; }; const serializeAws_json1_1UpdateRuleRequest = (input: UpdateRuleRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.RuleId !== undefined && { RuleId: input.RuleId }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && input.RuleId !== null && { RuleId: input.RuleId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) }), }; }; @@ -9234,11 +9299,11 @@ const serializeAws_json1_1UpdateSizeConstraintSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.SizeConstraintSetId !== undefined && { SizeConstraintSetId: input.SizeConstraintSetId }), - ...(input.Updates !== undefined && { - Updates: serializeAws_json1_1SizeConstraintSetUpdates(input.Updates, context), - }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.SizeConstraintSetId !== undefined && + input.SizeConstraintSetId !== null && { SizeConstraintSetId: input.SizeConstraintSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1SizeConstraintSetUpdates(input.Updates, context) }), }; }; @@ -9247,22 +9312,22 @@ const serializeAws_json1_1UpdateSqlInjectionMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.SqlInjectionMatchSetId !== undefined && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), - ...(input.Updates !== undefined && { - Updates: serializeAws_json1_1SqlInjectionMatchSetUpdates(input.Updates, context), - }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.SqlInjectionMatchSetId !== undefined && + input.SqlInjectionMatchSetId !== null && { SqlInjectionMatchSetId: input.SqlInjectionMatchSetId }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1SqlInjectionMatchSetUpdates(input.Updates, context) }), }; }; const serializeAws_json1_1UpdateWebACLRequest = (input: UpdateWebACLRequest, context: __SerdeContext): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.DefaultAction !== undefined && { - DefaultAction: serializeAws_json1_1WafAction(input.DefaultAction, context), - }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1WebACLUpdates(input.Updates, context) }), - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.DefaultAction !== undefined && + input.DefaultAction !== null && { DefaultAction: serializeAws_json1_1WafAction(input.DefaultAction, context) }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1WebACLUpdates(input.Updates, context) }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), }; }; @@ -9271,56 +9336,73 @@ const serializeAws_json1_1UpdateXssMatchSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), - ...(input.Updates !== undefined && { Updates: serializeAws_json1_1XssMatchSetUpdates(input.Updates, context) }), - ...(input.XssMatchSetId !== undefined && { XssMatchSetId: input.XssMatchSetId }), + ...(input.ChangeToken !== undefined && input.ChangeToken !== null && { ChangeToken: input.ChangeToken }), + ...(input.Updates !== undefined && + input.Updates !== null && { Updates: serializeAws_json1_1XssMatchSetUpdates(input.Updates, context) }), + ...(input.XssMatchSetId !== undefined && input.XssMatchSetId !== null && { XssMatchSetId: input.XssMatchSetId }), }; }; const serializeAws_json1_1WafAction = (input: WafAction, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1WafOverrideAction = (input: WafOverrideAction, context: __SerdeContext): any => { return { - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1WebACLUpdate = (input: WebACLUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.ActivatedRule !== undefined && { - ActivatedRule: serializeAws_json1_1ActivatedRule(input.ActivatedRule, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.ActivatedRule !== undefined && + input.ActivatedRule !== null && { + ActivatedRule: serializeAws_json1_1ActivatedRule(input.ActivatedRule, context), + }), }; }; const serializeAws_json1_1WebACLUpdates = (input: WebACLUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1WebACLUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1WebACLUpdate(entry, context); + }); }; const serializeAws_json1_1XssMatchSetUpdate = (input: XssMatchSetUpdate, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.XssMatchTuple !== undefined && { - XssMatchTuple: serializeAws_json1_1XssMatchTuple(input.XssMatchTuple, context), - }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.XssMatchTuple !== undefined && + input.XssMatchTuple !== null && { + XssMatchTuple: serializeAws_json1_1XssMatchTuple(input.XssMatchTuple, context), + }), }; }; const serializeAws_json1_1XssMatchSetUpdates = (input: XssMatchSetUpdate[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1XssMatchSetUpdate(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1XssMatchSetUpdate(entry, context); + }); }; const serializeAws_json1_1XssMatchTuple = (input: XssMatchTuple, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.TextTransformation !== undefined && { TextTransformation: input.TextTransformation }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.TextTransformation !== undefined && + input.TextTransformation !== null && { TextTransformation: input.TextTransformation }), }; }; @@ -9345,7 +9427,14 @@ const deserializeAws_json1_1ActivatedRule = (output: any, context: __SerdeContex }; const deserializeAws_json1_1ActivatedRules = (output: any, context: __SerdeContext): ActivatedRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ActivatedRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ActivatedRule(entry, context); + }); }; const deserializeAws_json1_1ByteMatchSet = (output: any, context: __SerdeContext): ByteMatchSet => { @@ -9361,7 +9450,14 @@ const deserializeAws_json1_1ByteMatchSet = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ByteMatchSetSummaries = (output: any, context: __SerdeContext): ByteMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ByteMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ByteMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1ByteMatchSetSummary = (output: any, context: __SerdeContext): ByteMatchSetSummary => { @@ -9394,7 +9490,14 @@ const deserializeAws_json1_1ByteMatchTuple = (output: any, context: __SerdeConte }; const deserializeAws_json1_1ByteMatchTuples = (output: any, context: __SerdeContext): ByteMatchTuple[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ByteMatchTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ByteMatchTuple(entry, context); + }); }; const deserializeAws_json1_1CreateByteMatchSetResponse = ( @@ -9671,7 +9774,14 @@ const deserializeAws_json1_1ExcludedRule = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ExcludedRules = (output: any, context: __SerdeContext): ExcludedRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExcludedRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExcludedRule(entry, context); + }); }; const deserializeAws_json1_1FieldToMatch = (output: any, context: __SerdeContext): FieldToMatch => { @@ -9689,7 +9799,14 @@ const deserializeAws_json1_1GeoMatchConstraint = (output: any, context: __SerdeC }; const deserializeAws_json1_1GeoMatchConstraints = (output: any, context: __SerdeContext): GeoMatchConstraint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GeoMatchConstraint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GeoMatchConstraint(entry, context); + }); }; const deserializeAws_json1_1GeoMatchSet = (output: any, context: __SerdeContext): GeoMatchSet => { @@ -9705,7 +9822,14 @@ const deserializeAws_json1_1GeoMatchSet = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1GeoMatchSetSummaries = (output: any, context: __SerdeContext): GeoMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1GeoMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1GeoMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1GeoMatchSetSummary = (output: any, context: __SerdeContext): GeoMatchSetSummary => { @@ -9918,7 +10042,14 @@ const deserializeAws_json1_1HTTPHeader = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1HTTPHeaders = (output: any, context: __SerdeContext): HTTPHeader[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HTTPHeader(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HTTPHeader(entry, context); + }); }; const deserializeAws_json1_1HTTPRequest = (output: any, context: __SerdeContext): HTTPRequest => { @@ -9954,11 +10085,25 @@ const deserializeAws_json1_1IPSetDescriptor = (output: any, context: __SerdeCont }; const deserializeAws_json1_1IPSetDescriptors = (output: any, context: __SerdeContext): IPSetDescriptor[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IPSetDescriptor(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IPSetDescriptor(entry, context); + }); }; const deserializeAws_json1_1IPSetSummaries = (output: any, context: __SerdeContext): IPSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IPSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IPSetSummary(entry, context); + }); }; const deserializeAws_json1_1IPSetSummary = (output: any, context: __SerdeContext): IPSetSummary => { @@ -10165,7 +10310,14 @@ const deserializeAws_json1_1ListXssMatchSetsResponse = ( }; const deserializeAws_json1_1LogDestinationConfigs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1LoggingConfiguration = (output: any, context: __SerdeContext): LoggingConfiguration => { @@ -10183,11 +10335,25 @@ const deserializeAws_json1_1LoggingConfiguration = (output: any, context: __Serd }; const deserializeAws_json1_1LoggingConfigurations = (output: any, context: __SerdeContext): LoggingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LoggingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoggingConfiguration(entry, context); + }); }; const deserializeAws_json1_1ManagedKeys = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Predicate = (output: any, context: __SerdeContext): Predicate => { @@ -10199,7 +10365,14 @@ const deserializeAws_json1_1Predicate = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Predicates = (output: any, context: __SerdeContext): Predicate[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Predicate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Predicate(entry, context); + }); }; const deserializeAws_json1_1PutLoggingConfigurationResponse = ( @@ -10236,7 +10409,14 @@ const deserializeAws_json1_1RateBasedRule = (output: any, context: __SerdeContex }; const deserializeAws_json1_1RedactedFields = (output: any, context: __SerdeContext): FieldToMatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FieldToMatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FieldToMatch(entry, context); + }); }; const deserializeAws_json1_1RegexMatchSet = (output: any, context: __SerdeContext): RegexMatchSet => { @@ -10252,7 +10432,14 @@ const deserializeAws_json1_1RegexMatchSet = (output: any, context: __SerdeContex }; const deserializeAws_json1_1RegexMatchSetSummaries = (output: any, context: __SerdeContext): RegexMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegexMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegexMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1RegexMatchSetSummary = (output: any, context: __SerdeContext): RegexMatchSetSummary => { @@ -10281,7 +10468,14 @@ const deserializeAws_json1_1RegexMatchTuple = (output: any, context: __SerdeCont }; const deserializeAws_json1_1RegexMatchTuples = (output: any, context: __SerdeContext): RegexMatchTuple[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegexMatchTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegexMatchTuple(entry, context); + }); }; const deserializeAws_json1_1RegexPatternSet = (output: any, context: __SerdeContext): RegexPatternSet => { @@ -10302,7 +10496,14 @@ const deserializeAws_json1_1RegexPatternSetSummaries = ( output: any, context: __SerdeContext ): RegexPatternSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegexPatternSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegexPatternSetSummary(entry, context); + }); }; const deserializeAws_json1_1RegexPatternSetSummary = (output: any, context: __SerdeContext): RegexPatternSetSummary => { @@ -10316,7 +10517,14 @@ const deserializeAws_json1_1RegexPatternSetSummary = (output: any, context: __Se }; const deserializeAws_json1_1RegexPatternStrings = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Rule = (output: any, context: __SerdeContext): Rule => { @@ -10340,7 +10548,14 @@ const deserializeAws_json1_1RuleGroup = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1RuleGroupSummaries = (output: any, context: __SerdeContext): RuleGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RuleGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RuleGroupSummary(entry, context); + }); }; const deserializeAws_json1_1RuleGroupSummary = (output: any, context: __SerdeContext): RuleGroupSummary => { @@ -10351,7 +10566,14 @@ const deserializeAws_json1_1RuleGroupSummary = (output: any, context: __SerdeCon }; const deserializeAws_json1_1RuleSummaries = (output: any, context: __SerdeContext): RuleSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RuleSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RuleSummary(entry, context); + }); }; const deserializeAws_json1_1RuleSummary = (output: any, context: __SerdeContext): RuleSummary => { @@ -10381,7 +10603,14 @@ const deserializeAws_json1_1SampledHTTPRequest = (output: any, context: __SerdeC }; const deserializeAws_json1_1SampledHTTPRequests = (output: any, context: __SerdeContext): SampledHTTPRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SampledHTTPRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SampledHTTPRequest(entry, context); + }); }; const deserializeAws_json1_1SizeConstraint = (output: any, context: __SerdeContext): SizeConstraint => { @@ -10403,7 +10632,14 @@ const deserializeAws_json1_1SizeConstraint = (output: any, context: __SerdeConte }; const deserializeAws_json1_1SizeConstraints = (output: any, context: __SerdeContext): SizeConstraint[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SizeConstraint(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SizeConstraint(entry, context); + }); }; const deserializeAws_json1_1SizeConstraintSet = (output: any, context: __SerdeContext): SizeConstraintSet => { @@ -10424,7 +10660,14 @@ const deserializeAws_json1_1SizeConstraintSetSummaries = ( output: any, context: __SerdeContext ): SizeConstraintSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SizeConstraintSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SizeConstraintSetSummary(entry, context); + }); }; const deserializeAws_json1_1SizeConstraintSetSummary = ( @@ -10458,7 +10701,14 @@ const deserializeAws_json1_1SqlInjectionMatchSetSummaries = ( output: any, context: __SerdeContext ): SqlInjectionMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SqlInjectionMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SqlInjectionMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1SqlInjectionMatchSetSummary = ( @@ -10491,14 +10741,28 @@ const deserializeAws_json1_1SqlInjectionMatchTuples = ( output: any, context: __SerdeContext ): SqlInjectionMatchTuple[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SqlInjectionMatchTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SqlInjectionMatchTuple(entry, context); + }); }; const deserializeAws_json1_1SubscribedRuleGroupSummaries = ( output: any, context: __SerdeContext ): SubscribedRuleGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SubscribedRuleGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SubscribedRuleGroupSummary(entry, context); + }); }; const deserializeAws_json1_1SubscribedRuleGroupSummary = ( @@ -10530,7 +10794,14 @@ const deserializeAws_json1_1TagInfoForResource = (output: any, context: __SerdeC }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -10854,7 +11125,14 @@ const deserializeAws_json1_1WebACL = (output: any, context: __SerdeContext): Web }; const deserializeAws_json1_1WebACLSummaries = (output: any, context: __SerdeContext): WebACLSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WebACLSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WebACLSummary(entry, context); + }); }; const deserializeAws_json1_1WebACLSummary = (output: any, context: __SerdeContext): WebACLSummary => { @@ -10877,7 +11155,14 @@ const deserializeAws_json1_1XssMatchSet = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1XssMatchSetSummaries = (output: any, context: __SerdeContext): XssMatchSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1XssMatchSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1XssMatchSetSummary(entry, context); + }); }; const deserializeAws_json1_1XssMatchSetSummary = (output: any, context: __SerdeContext): XssMatchSetSummary => { @@ -10902,7 +11187,14 @@ const deserializeAws_json1_1XssMatchTuple = (output: any, context: __SerdeContex }; const deserializeAws_json1_1XssMatchTuples = (output: any, context: __SerdeContext): XssMatchTuple[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1XssMatchTuple(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1XssMatchTuple(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -10955,3 +11247,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-wafv2/protocols/Aws_json1_1.ts b/clients/client-wafv2/protocols/Aws_json1_1.ts index 5ce338cf2d49..0d8b0d286594 100644 --- a/clients/client-wafv2/protocols/Aws_json1_1.ts +++ b/clients/client-wafv2/protocols/Aws_json1_1.ts @@ -261,7 +261,7 @@ export const serializeAws_json1_1AssociateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.AssociateWebACL", }; let body: any; @@ -274,7 +274,7 @@ export const serializeAws_json1_1CheckCapacityCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.CheckCapacity", }; let body: any; @@ -287,7 +287,7 @@ export const serializeAws_json1_1CreateIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.CreateIPSet", }; let body: any; @@ -300,7 +300,7 @@ export const serializeAws_json1_1CreateRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.CreateRegexPatternSet", }; let body: any; @@ -313,7 +313,7 @@ export const serializeAws_json1_1CreateRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.CreateRuleGroup", }; let body: any; @@ -326,7 +326,7 @@ export const serializeAws_json1_1CreateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.CreateWebACL", }; let body: any; @@ -339,7 +339,7 @@ export const serializeAws_json1_1DeleteFirewallManagerRuleGroupsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.DeleteFirewallManagerRuleGroups", }; let body: any; @@ -352,7 +352,7 @@ export const serializeAws_json1_1DeleteIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.DeleteIPSet", }; let body: any; @@ -365,7 +365,7 @@ export const serializeAws_json1_1DeleteLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.DeleteLoggingConfiguration", }; let body: any; @@ -378,7 +378,7 @@ export const serializeAws_json1_1DeletePermissionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.DeletePermissionPolicy", }; let body: any; @@ -391,7 +391,7 @@ export const serializeAws_json1_1DeleteRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.DeleteRegexPatternSet", }; let body: any; @@ -404,7 +404,7 @@ export const serializeAws_json1_1DeleteRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.DeleteRuleGroup", }; let body: any; @@ -417,7 +417,7 @@ export const serializeAws_json1_1DeleteWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.DeleteWebACL", }; let body: any; @@ -430,7 +430,7 @@ export const serializeAws_json1_1DescribeManagedRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.DescribeManagedRuleGroup", }; let body: any; @@ -443,7 +443,7 @@ export const serializeAws_json1_1DisassociateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.DisassociateWebACL", }; let body: any; @@ -456,7 +456,7 @@ export const serializeAws_json1_1GetIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.GetIPSet", }; let body: any; @@ -469,7 +469,7 @@ export const serializeAws_json1_1GetLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.GetLoggingConfiguration", }; let body: any; @@ -482,7 +482,7 @@ export const serializeAws_json1_1GetPermissionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.GetPermissionPolicy", }; let body: any; @@ -495,7 +495,7 @@ export const serializeAws_json1_1GetRateBasedStatementManagedKeysCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.GetRateBasedStatementManagedKeys", }; let body: any; @@ -508,7 +508,7 @@ export const serializeAws_json1_1GetRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.GetRegexPatternSet", }; let body: any; @@ -521,7 +521,7 @@ export const serializeAws_json1_1GetRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.GetRuleGroup", }; let body: any; @@ -534,7 +534,7 @@ export const serializeAws_json1_1GetSampledRequestsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.GetSampledRequests", }; let body: any; @@ -547,7 +547,7 @@ export const serializeAws_json1_1GetWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.GetWebACL", }; let body: any; @@ -560,7 +560,7 @@ export const serializeAws_json1_1GetWebACLForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.GetWebACLForResource", }; let body: any; @@ -573,7 +573,7 @@ export const serializeAws_json1_1ListAvailableManagedRuleGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.ListAvailableManagedRuleGroups", }; let body: any; @@ -586,7 +586,7 @@ export const serializeAws_json1_1ListIPSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.ListIPSets", }; let body: any; @@ -599,7 +599,7 @@ export const serializeAws_json1_1ListLoggingConfigurationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.ListLoggingConfigurations", }; let body: any; @@ -612,7 +612,7 @@ export const serializeAws_json1_1ListRegexPatternSetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.ListRegexPatternSets", }; let body: any; @@ -625,7 +625,7 @@ export const serializeAws_json1_1ListResourcesForWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.ListResourcesForWebACL", }; let body: any; @@ -638,7 +638,7 @@ export const serializeAws_json1_1ListRuleGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.ListRuleGroups", }; let body: any; @@ -651,7 +651,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.ListTagsForResource", }; let body: any; @@ -664,7 +664,7 @@ export const serializeAws_json1_1ListWebACLsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.ListWebACLs", }; let body: any; @@ -677,7 +677,7 @@ export const serializeAws_json1_1PutLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.PutLoggingConfiguration", }; let body: any; @@ -690,7 +690,7 @@ export const serializeAws_json1_1PutPermissionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.PutPermissionPolicy", }; let body: any; @@ -703,7 +703,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.TagResource", }; let body: any; @@ -716,7 +716,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.UntagResource", }; let body: any; @@ -729,7 +729,7 @@ export const serializeAws_json1_1UpdateIPSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.UpdateIPSet", }; let body: any; @@ -742,7 +742,7 @@ export const serializeAws_json1_1UpdateRegexPatternSetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.UpdateRegexPatternSet", }; let body: any; @@ -755,7 +755,7 @@ export const serializeAws_json1_1UpdateRuleGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.UpdateRuleGroup", }; let body: any; @@ -768,7 +768,7 @@ export const serializeAws_json1_1UpdateWebACLCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "AWSWAF_20190729.UpdateWebACL", }; let body: any; @@ -803,8 +803,7 @@ const deserializeAws_json1_1AssociateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -890,8 +889,7 @@ const deserializeAws_json1_1CheckCapacityCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -993,8 +991,7 @@ const deserializeAws_json1_1CreateIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDuplicateItemException": case "com.amazonaws.wafv2#WAFDuplicateItemException": @@ -1104,8 +1101,7 @@ const deserializeAws_json1_1CreateRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDuplicateItemException": case "com.amazonaws.wafv2#WAFDuplicateItemException": @@ -1215,8 +1211,7 @@ const deserializeAws_json1_1CreateRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDuplicateItemException": case "com.amazonaws.wafv2#WAFDuplicateItemException": @@ -1350,8 +1345,7 @@ const deserializeAws_json1_1CreateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDuplicateItemException": case "com.amazonaws.wafv2#WAFDuplicateItemException": @@ -1493,8 +1487,7 @@ const deserializeAws_json1_1DeleteFirewallManagerRuleGroupsCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -1580,8 +1573,7 @@ const deserializeAws_json1_1DeleteIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFAssociatedItemException": case "com.amazonaws.wafv2#WAFAssociatedItemException": @@ -1691,8 +1683,7 @@ const deserializeAws_json1_1DeleteLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -1778,8 +1769,7 @@ const deserializeAws_json1_1DeletePermissionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -1849,8 +1839,7 @@ const deserializeAws_json1_1DeleteRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFAssociatedItemException": case "com.amazonaws.wafv2#WAFAssociatedItemException": @@ -1960,8 +1949,7 @@ const deserializeAws_json1_1DeleteRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFAssociatedItemException": case "com.amazonaws.wafv2#WAFAssociatedItemException": @@ -2071,8 +2059,7 @@ const deserializeAws_json1_1DeleteWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFAssociatedItemException": case "com.amazonaws.wafv2#WAFAssociatedItemException": @@ -2182,8 +2169,7 @@ const deserializeAws_json1_1DescribeManagedRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2269,8 +2255,7 @@ const deserializeAws_json1_1DisassociateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2348,8 +2333,7 @@ const deserializeAws_json1_1GetIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2427,8 +2411,7 @@ const deserializeAws_json1_1GetLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2506,8 +2489,7 @@ const deserializeAws_json1_1GetPermissionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2577,8 +2559,7 @@ const deserializeAws_json1_1GetRateBasedStatementManagedKeysCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2656,8 +2637,7 @@ const deserializeAws_json1_1GetRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2735,8 +2715,7 @@ const deserializeAws_json1_1GetRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2814,8 +2793,7 @@ const deserializeAws_json1_1GetSampledRequestsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2885,8 +2863,7 @@ const deserializeAws_json1_1GetWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -2964,8 +2941,7 @@ const deserializeAws_json1_1GetWebACLForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3051,8 +3027,7 @@ const deserializeAws_json1_1ListAvailableManagedRuleGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3122,8 +3097,7 @@ const deserializeAws_json1_1ListIPSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3193,8 +3167,7 @@ const deserializeAws_json1_1ListLoggingConfigurationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3264,8 +3237,7 @@ const deserializeAws_json1_1ListRegexPatternSetsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3335,8 +3307,7 @@ const deserializeAws_json1_1ListResourcesForWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3414,8 +3385,7 @@ const deserializeAws_json1_1ListRuleGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3485,8 +3455,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3580,8 +3549,7 @@ const deserializeAws_json1_1ListWebACLsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3651,8 +3619,7 @@ const deserializeAws_json1_1PutLoggingConfigurationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3754,8 +3721,7 @@ const deserializeAws_json1_1PutPermissionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3833,8 +3799,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -3936,8 +3901,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": @@ -4031,8 +3995,7 @@ const deserializeAws_json1_1UpdateIPSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDuplicateItemException": case "com.amazonaws.wafv2#WAFDuplicateItemException": @@ -4134,8 +4097,7 @@ const deserializeAws_json1_1UpdateRegexPatternSetCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDuplicateItemException": case "com.amazonaws.wafv2#WAFDuplicateItemException": @@ -4237,8 +4199,7 @@ const deserializeAws_json1_1UpdateRuleGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDuplicateItemException": case "com.amazonaws.wafv2#WAFDuplicateItemException": @@ -4356,8 +4317,7 @@ const deserializeAws_json1_1UpdateWebACLCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "WAFDuplicateItemException": case "com.amazonaws.wafv2#WAFDuplicateItemException": @@ -4691,14 +4651,15 @@ const serializeAws_json1_1AllQueryArguments = (input: AllQueryArguments, context const serializeAws_json1_1AndStatement = (input: AndStatement, context: __SerdeContext): any => { return { - ...(input.Statements !== undefined && { Statements: serializeAws_json1_1Statements(input.Statements, context) }), + ...(input.Statements !== undefined && + input.Statements !== null && { Statements: serializeAws_json1_1Statements(input.Statements, context) }), }; }; const serializeAws_json1_1AssociateWebACLRequest = (input: AssociateWebACLRequest, context: __SerdeContext): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), - ...(input.WebACLArn !== undefined && { WebACLArn: input.WebACLArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), + ...(input.WebACLArn !== undefined && input.WebACLArn !== null && { WebACLArn: input.WebACLArn }), }; }; @@ -4712,21 +4673,24 @@ const serializeAws_json1_1Body = (input: Body, context: __SerdeContext): any => const serializeAws_json1_1ByteMatchStatement = (input: ByteMatchStatement, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.PositionalConstraint !== undefined && { PositionalConstraint: input.PositionalConstraint }), - ...(input.SearchString !== undefined && { SearchString: context.base64Encoder(input.SearchString) }), - ...(input.TextTransformations !== undefined && { - TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), - }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.PositionalConstraint !== undefined && + input.PositionalConstraint !== null && { PositionalConstraint: input.PositionalConstraint }), + ...(input.SearchString !== undefined && + input.SearchString !== null && { SearchString: context.base64Encoder(input.SearchString) }), + ...(input.TextTransformations !== undefined && + input.TextTransformations !== null && { + TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), + }), }; }; const serializeAws_json1_1CheckCapacityRequest = (input: CheckCapacityRequest, context: __SerdeContext): any => { return { - ...(input.Rules !== undefined && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -4735,17 +4699,26 @@ const serializeAws_json1_1CountAction = (input: CountAction, context: __SerdeCon }; const serializeAws_json1_1CountryCodes = (input: (CountryCode | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1CreateIPSetRequest = (input: CreateIPSetRequest, context: __SerdeContext): any => { return { - ...(input.Addresses !== undefined && { Addresses: serializeAws_json1_1IPAddresses(input.Addresses, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.IPAddressVersion !== undefined && { IPAddressVersion: input.IPAddressVersion }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Addresses !== undefined && + input.Addresses !== null && { Addresses: serializeAws_json1_1IPAddresses(input.Addresses, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.IPAddressVersion !== undefined && + input.IPAddressVersion !== null && { IPAddressVersion: input.IPAddressVersion }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -4754,50 +4727,58 @@ const serializeAws_json1_1CreateRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RegularExpressionList !== undefined && { - RegularExpressionList: serializeAws_json1_1RegularExpressionList(input.RegularExpressionList, context), - }), - ...(input.Scope !== undefined && { Scope: input.Scope }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RegularExpressionList !== undefined && + input.RegularExpressionList !== null && { + RegularExpressionList: serializeAws_json1_1RegularExpressionList(input.RegularExpressionList, context), + }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateRuleGroupRequest = (input: CreateRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.Capacity !== undefined && { Capacity: input.Capacity }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Rules !== undefined && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), - ...(input.Scope !== undefined && { Scope: input.Scope }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VisibilityConfig !== undefined && { - VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), - }), + ...(input.Capacity !== undefined && input.Capacity !== null && { Capacity: input.Capacity }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VisibilityConfig !== undefined && + input.VisibilityConfig !== null && { + VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), + }), }; }; const serializeAws_json1_1CreateWebACLRequest = (input: CreateWebACLRequest, context: __SerdeContext): any => { return { - ...(input.DefaultAction !== undefined && { - DefaultAction: serializeAws_json1_1DefaultAction(input.DefaultAction, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Rules !== undefined && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), - ...(input.Scope !== undefined && { Scope: input.Scope }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.VisibilityConfig !== undefined && { - VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), - }), + ...(input.DefaultAction !== undefined && + input.DefaultAction !== null && { + DefaultAction: serializeAws_json1_1DefaultAction(input.DefaultAction, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.VisibilityConfig !== undefined && + input.VisibilityConfig !== null && { + VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), + }), }; }; const serializeAws_json1_1DefaultAction = (input: DefaultAction, context: __SerdeContext): any => { return { - ...(input.Allow !== undefined && { Allow: serializeAws_json1_1AllowAction(input.Allow, context) }), - ...(input.Block !== undefined && { Block: serializeAws_json1_1BlockAction(input.Block, context) }), + ...(input.Allow !== undefined && + input.Allow !== null && { Allow: serializeAws_json1_1AllowAction(input.Allow, context) }), + ...(input.Block !== undefined && + input.Block !== null && { Block: serializeAws_json1_1BlockAction(input.Block, context) }), }; }; @@ -4806,17 +4787,18 @@ const serializeAws_json1_1DeleteFirewallManagerRuleGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.WebACLArn !== undefined && { WebACLArn: input.WebACLArn }), - ...(input.WebACLLockToken !== undefined && { WebACLLockToken: input.WebACLLockToken }), + ...(input.WebACLArn !== undefined && input.WebACLArn !== null && { WebACLArn: input.WebACLArn }), + ...(input.WebACLLockToken !== undefined && + input.WebACLLockToken !== null && { WebACLLockToken: input.WebACLLockToken }), }; }; const serializeAws_json1_1DeleteIPSetRequest = (input: DeleteIPSetRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LockToken !== undefined && { LockToken: input.LockToken }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LockToken !== undefined && input.LockToken !== null && { LockToken: input.LockToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -4825,7 +4807,7 @@ const serializeAws_json1_1DeleteLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -4834,7 +4816,7 @@ const serializeAws_json1_1DeletePermissionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -4843,28 +4825,28 @@ const serializeAws_json1_1DeleteRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LockToken !== undefined && { LockToken: input.LockToken }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LockToken !== undefined && input.LockToken !== null && { LockToken: input.LockToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; const serializeAws_json1_1DeleteRuleGroupRequest = (input: DeleteRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LockToken !== undefined && { LockToken: input.LockToken }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LockToken !== undefined && input.LockToken !== null && { LockToken: input.LockToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; const serializeAws_json1_1DeleteWebACLRequest = (input: DeleteWebACLRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LockToken !== undefined && { LockToken: input.LockToken }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LockToken !== undefined && input.LockToken !== null && { LockToken: input.LockToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -4873,9 +4855,9 @@ const serializeAws_json1_1DescribeManagedRuleGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), - ...(input.VendorName !== undefined && { VendorName: input.VendorName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), + ...(input.VendorName !== undefined && input.VendorName !== null && { VendorName: input.VendorName }), }; }; @@ -4884,63 +4866,73 @@ const serializeAws_json1_1DisassociateWebACLRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1ExcludedRule = (input: ExcludedRule, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1ExcludedRules = (input: ExcludedRule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1ExcludedRule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1ExcludedRule(entry, context); + }); }; const serializeAws_json1_1FieldToMatch = (input: FieldToMatch, context: __SerdeContext): any => { return { - ...(input.AllQueryArguments !== undefined && { - AllQueryArguments: serializeAws_json1_1AllQueryArguments(input.AllQueryArguments, context), - }), - ...(input.Body !== undefined && { Body: serializeAws_json1_1Body(input.Body, context) }), - ...(input.Method !== undefined && { Method: serializeAws_json1_1Method(input.Method, context) }), - ...(input.QueryString !== undefined && { - QueryString: serializeAws_json1_1QueryString(input.QueryString, context), - }), - ...(input.SingleHeader !== undefined && { - SingleHeader: serializeAws_json1_1SingleHeader(input.SingleHeader, context), - }), - ...(input.SingleQueryArgument !== undefined && { - SingleQueryArgument: serializeAws_json1_1SingleQueryArgument(input.SingleQueryArgument, context), - }), - ...(input.UriPath !== undefined && { UriPath: serializeAws_json1_1UriPath(input.UriPath, context) }), + ...(input.AllQueryArguments !== undefined && + input.AllQueryArguments !== null && { + AllQueryArguments: serializeAws_json1_1AllQueryArguments(input.AllQueryArguments, context), + }), + ...(input.Body !== undefined && input.Body !== null && { Body: serializeAws_json1_1Body(input.Body, context) }), + ...(input.Method !== undefined && + input.Method !== null && { Method: serializeAws_json1_1Method(input.Method, context) }), + ...(input.QueryString !== undefined && + input.QueryString !== null && { QueryString: serializeAws_json1_1QueryString(input.QueryString, context) }), + ...(input.SingleHeader !== undefined && + input.SingleHeader !== null && { SingleHeader: serializeAws_json1_1SingleHeader(input.SingleHeader, context) }), + ...(input.SingleQueryArgument !== undefined && + input.SingleQueryArgument !== null && { + SingleQueryArgument: serializeAws_json1_1SingleQueryArgument(input.SingleQueryArgument, context), + }), + ...(input.UriPath !== undefined && + input.UriPath !== null && { UriPath: serializeAws_json1_1UriPath(input.UriPath, context) }), }; }; const serializeAws_json1_1ForwardedIPConfig = (input: ForwardedIPConfig, context: __SerdeContext): any => { return { - ...(input.FallbackBehavior !== undefined && { FallbackBehavior: input.FallbackBehavior }), - ...(input.HeaderName !== undefined && { HeaderName: input.HeaderName }), + ...(input.FallbackBehavior !== undefined && + input.FallbackBehavior !== null && { FallbackBehavior: input.FallbackBehavior }), + ...(input.HeaderName !== undefined && input.HeaderName !== null && { HeaderName: input.HeaderName }), }; }; const serializeAws_json1_1GeoMatchStatement = (input: GeoMatchStatement, context: __SerdeContext): any => { return { - ...(input.CountryCodes !== undefined && { - CountryCodes: serializeAws_json1_1CountryCodes(input.CountryCodes, context), - }), - ...(input.ForwardedIPConfig !== undefined && { - ForwardedIPConfig: serializeAws_json1_1ForwardedIPConfig(input.ForwardedIPConfig, context), - }), + ...(input.CountryCodes !== undefined && + input.CountryCodes !== null && { CountryCodes: serializeAws_json1_1CountryCodes(input.CountryCodes, context) }), + ...(input.ForwardedIPConfig !== undefined && + input.ForwardedIPConfig !== null && { + ForwardedIPConfig: serializeAws_json1_1ForwardedIPConfig(input.ForwardedIPConfig, context), + }), }; }; const serializeAws_json1_1GetIPSetRequest = (input: GetIPSetRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -4949,7 +4941,7 @@ const serializeAws_json1_1GetLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -4958,7 +4950,7 @@ const serializeAws_json1_1GetPermissionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -4967,10 +4959,10 @@ const serializeAws_json1_1GetRateBasedStatementManagedKeysRequest = ( context: __SerdeContext ): any => { return { - ...(input.RuleName !== undefined && { RuleName: input.RuleName }), - ...(input.Scope !== undefined && { Scope: input.Scope }), - ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }), - ...(input.WebACLName !== undefined && { WebACLName: input.WebACLName }), + ...(input.RuleName !== undefined && input.RuleName !== null && { RuleName: input.RuleName }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), + ...(input.WebACLId !== undefined && input.WebACLId !== null && { WebACLId: input.WebACLId }), + ...(input.WebACLName !== undefined && input.WebACLName !== null && { WebACLName: input.WebACLName }), }; }; @@ -4979,17 +4971,17 @@ const serializeAws_json1_1GetRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; const serializeAws_json1_1GetRuleGroupRequest = (input: GetRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -4998,11 +4990,13 @@ const serializeAws_json1_1GetSampledRequestsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), - ...(input.RuleMetricName !== undefined && { RuleMetricName: input.RuleMetricName }), - ...(input.Scope !== undefined && { Scope: input.Scope }), - ...(input.TimeWindow !== undefined && { TimeWindow: serializeAws_json1_1TimeWindow(input.TimeWindow, context) }), - ...(input.WebAclArn !== undefined && { WebAclArn: input.WebAclArn }), + ...(input.MaxItems !== undefined && input.MaxItems !== null && { MaxItems: input.MaxItems }), + ...(input.RuleMetricName !== undefined && + input.RuleMetricName !== null && { RuleMetricName: input.RuleMetricName }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), + ...(input.TimeWindow !== undefined && + input.TimeWindow !== null && { TimeWindow: serializeAws_json1_1TimeWindow(input.TimeWindow, context) }), + ...(input.WebAclArn !== undefined && input.WebAclArn !== null && { WebAclArn: input.WebAclArn }), }; }; @@ -5011,36 +5005,45 @@ const serializeAws_json1_1GetWebACLForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; const serializeAws_json1_1GetWebACLRequest = (input: GetWebACLRequest, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; const serializeAws_json1_1IPAddresses = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IPSetForwardedIPConfig = (input: IPSetForwardedIPConfig, context: __SerdeContext): any => { return { - ...(input.FallbackBehavior !== undefined && { FallbackBehavior: input.FallbackBehavior }), - ...(input.HeaderName !== undefined && { HeaderName: input.HeaderName }), - ...(input.Position !== undefined && { Position: input.Position }), + ...(input.FallbackBehavior !== undefined && + input.FallbackBehavior !== null && { FallbackBehavior: input.FallbackBehavior }), + ...(input.HeaderName !== undefined && input.HeaderName !== null && { HeaderName: input.HeaderName }), + ...(input.Position !== undefined && input.Position !== null && { Position: input.Position }), }; }; const serializeAws_json1_1IPSetReferenceStatement = (input: IPSetReferenceStatement, context: __SerdeContext): any => { return { - ...(input.ARN !== undefined && { ARN: input.ARN }), - ...(input.IPSetForwardedIPConfig !== undefined && { - IPSetForwardedIPConfig: serializeAws_json1_1IPSetForwardedIPConfig(input.IPSetForwardedIPConfig, context), - }), + ...(input.ARN !== undefined && input.ARN !== null && { ARN: input.ARN }), + ...(input.IPSetForwardedIPConfig !== undefined && + input.IPSetForwardedIPConfig !== null && { + IPSetForwardedIPConfig: serializeAws_json1_1IPSetForwardedIPConfig(input.IPSetForwardedIPConfig, context), + }), }; }; @@ -5049,17 +5052,17 @@ const serializeAws_json1_1ListAvailableManagedRuleGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; const serializeAws_json1_1ListIPSetsRequest = (input: ListIPSetsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -5068,9 +5071,9 @@ const serializeAws_json1_1ListLoggingConfigurationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -5079,9 +5082,9 @@ const serializeAws_json1_1ListRegexPatternSetsRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -5090,16 +5093,16 @@ const serializeAws_json1_1ListResourcesForWebACLRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceType !== undefined && { ResourceType: input.ResourceType }), - ...(input.WebACLArn !== undefined && { WebACLArn: input.WebACLArn }), + ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }), + ...(input.WebACLArn !== undefined && input.WebACLArn !== null && { WebACLArn: input.WebACLArn }), }; }; const serializeAws_json1_1ListRuleGroupsRequest = (input: ListRuleGroupsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -5108,34 +5111,44 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1ListWebACLsRequest = (input: ListWebACLsRequest, context: __SerdeContext): any => { return { - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && input.NextMarker !== null && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; const serializeAws_json1_1LogDestinationConfigs = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1LoggingConfiguration = (input: LoggingConfiguration, context: __SerdeContext): any => { return { - ...(input.LogDestinationConfigs !== undefined && { - LogDestinationConfigs: serializeAws_json1_1LogDestinationConfigs(input.LogDestinationConfigs, context), - }), - ...(input.ManagedByFirewallManager !== undefined && { ManagedByFirewallManager: input.ManagedByFirewallManager }), - ...(input.RedactedFields !== undefined && { - RedactedFields: serializeAws_json1_1RedactedFields(input.RedactedFields, context), - }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.LogDestinationConfigs !== undefined && + input.LogDestinationConfigs !== null && { + LogDestinationConfigs: serializeAws_json1_1LogDestinationConfigs(input.LogDestinationConfigs, context), + }), + ...(input.ManagedByFirewallManager !== undefined && + input.ManagedByFirewallManager !== null && { ManagedByFirewallManager: input.ManagedByFirewallManager }), + ...(input.RedactedFields !== undefined && + input.RedactedFields !== null && { + RedactedFields: serializeAws_json1_1RedactedFields(input.RedactedFields, context), + }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -5144,11 +5157,12 @@ const serializeAws_json1_1ManagedRuleGroupStatement = ( context: __SerdeContext ): any => { return { - ...(input.ExcludedRules !== undefined && { - ExcludedRules: serializeAws_json1_1ExcludedRules(input.ExcludedRules, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.VendorName !== undefined && { VendorName: input.VendorName }), + ...(input.ExcludedRules !== undefined && + input.ExcludedRules !== null && { + ExcludedRules: serializeAws_json1_1ExcludedRules(input.ExcludedRules, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.VendorName !== undefined && input.VendorName !== null && { VendorName: input.VendorName }), }; }; @@ -5162,20 +5176,24 @@ const serializeAws_json1_1NoneAction = (input: NoneAction, context: __SerdeConte const serializeAws_json1_1NotStatement = (input: NotStatement, context: __SerdeContext): any => { return { - ...(input.Statement !== undefined && { Statement: serializeAws_json1_1Statement(input.Statement, context) }), + ...(input.Statement !== undefined && + input.Statement !== null && { Statement: serializeAws_json1_1Statement(input.Statement, context) }), }; }; const serializeAws_json1_1OrStatement = (input: OrStatement, context: __SerdeContext): any => { return { - ...(input.Statements !== undefined && { Statements: serializeAws_json1_1Statements(input.Statements, context) }), + ...(input.Statements !== undefined && + input.Statements !== null && { Statements: serializeAws_json1_1Statements(input.Statements, context) }), }; }; const serializeAws_json1_1OverrideAction = (input: OverrideAction, context: __SerdeContext): any => { return { - ...(input.Count !== undefined && { Count: serializeAws_json1_1CountAction(input.Count, context) }), - ...(input.None !== undefined && { None: serializeAws_json1_1NoneAction(input.None, context) }), + ...(input.Count !== undefined && + input.Count !== null && { Count: serializeAws_json1_1CountAction(input.Count, context) }), + ...(input.None !== undefined && + input.None !== null && { None: serializeAws_json1_1NoneAction(input.None, context) }), }; }; @@ -5184,9 +5202,10 @@ const serializeAws_json1_1PutLoggingConfigurationRequest = ( context: __SerdeContext ): any => { return { - ...(input.LoggingConfiguration !== undefined && { - LoggingConfiguration: serializeAws_json1_1LoggingConfiguration(input.LoggingConfiguration, context), - }), + ...(input.LoggingConfiguration !== undefined && + input.LoggingConfiguration !== null && { + LoggingConfiguration: serializeAws_json1_1LoggingConfiguration(input.LoggingConfiguration, context), + }), }; }; @@ -5195,8 +5214,8 @@ const serializeAws_json1_1PutPermissionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Policy !== undefined && { Policy: input.Policy }), - ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }), + ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }), }; }; @@ -5206,24 +5225,34 @@ const serializeAws_json1_1QueryString = (input: QueryString, context: __SerdeCon const serializeAws_json1_1RateBasedStatement = (input: RateBasedStatement, context: __SerdeContext): any => { return { - ...(input.AggregateKeyType !== undefined && { AggregateKeyType: input.AggregateKeyType }), - ...(input.ForwardedIPConfig !== undefined && { - ForwardedIPConfig: serializeAws_json1_1ForwardedIPConfig(input.ForwardedIPConfig, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.ScopeDownStatement !== undefined && { - ScopeDownStatement: serializeAws_json1_1Statement(input.ScopeDownStatement, context), - }), + ...(input.AggregateKeyType !== undefined && + input.AggregateKeyType !== null && { AggregateKeyType: input.AggregateKeyType }), + ...(input.ForwardedIPConfig !== undefined && + input.ForwardedIPConfig !== null && { + ForwardedIPConfig: serializeAws_json1_1ForwardedIPConfig(input.ForwardedIPConfig, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.ScopeDownStatement !== undefined && + input.ScopeDownStatement !== null && { + ScopeDownStatement: serializeAws_json1_1Statement(input.ScopeDownStatement, context), + }), }; }; const serializeAws_json1_1RedactedFields = (input: FieldToMatch[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FieldToMatch(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FieldToMatch(entry, context); + }); }; const serializeAws_json1_1Regex = (input: Regex, context: __SerdeContext): any => { return { - ...(input.RegexString !== undefined && { RegexString: input.RegexString }), + ...(input.RegexString !== undefined && input.RegexString !== null && { RegexString: input.RegexString }), }; }; @@ -5232,40 +5261,54 @@ const serializeAws_json1_1RegexPatternSetReferenceStatement = ( context: __SerdeContext ): any => { return { - ...(input.ARN !== undefined && { ARN: input.ARN }), - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.TextTransformations !== undefined && { - TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), - }), + ...(input.ARN !== undefined && input.ARN !== null && { ARN: input.ARN }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.TextTransformations !== undefined && + input.TextTransformations !== null && { + TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), + }), }; }; const serializeAws_json1_1RegularExpressionList = (input: Regex[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Regex(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Regex(entry, context); + }); }; const serializeAws_json1_1Rule = (input: Rule, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: serializeAws_json1_1RuleAction(input.Action, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OverrideAction !== undefined && { - OverrideAction: serializeAws_json1_1OverrideAction(input.OverrideAction, context), - }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.Statement !== undefined && { Statement: serializeAws_json1_1Statement(input.Statement, context) }), - ...(input.VisibilityConfig !== undefined && { - VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), - }), + ...(input.Action !== undefined && + input.Action !== null && { Action: serializeAws_json1_1RuleAction(input.Action, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OverrideAction !== undefined && + input.OverrideAction !== null && { + OverrideAction: serializeAws_json1_1OverrideAction(input.OverrideAction, context), + }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.Statement !== undefined && + input.Statement !== null && { Statement: serializeAws_json1_1Statement(input.Statement, context) }), + ...(input.VisibilityConfig !== undefined && + input.VisibilityConfig !== null && { + VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), + }), }; }; const serializeAws_json1_1RuleAction = (input: RuleAction, context: __SerdeContext): any => { return { - ...(input.Allow !== undefined && { Allow: serializeAws_json1_1AllowAction(input.Allow, context) }), - ...(input.Block !== undefined && { Block: serializeAws_json1_1BlockAction(input.Block, context) }), - ...(input.Count !== undefined && { Count: serializeAws_json1_1CountAction(input.Count, context) }), + ...(input.Allow !== undefined && + input.Allow !== null && { Allow: serializeAws_json1_1AllowAction(input.Allow, context) }), + ...(input.Block !== undefined && + input.Block !== null && { Block: serializeAws_json1_1BlockAction(input.Block, context) }), + ...(input.Count !== undefined && + input.Count !== null && { Count: serializeAws_json1_1CountAction(input.Count, context) }), }; }; @@ -5274,165 +5317,213 @@ const serializeAws_json1_1RuleGroupReferenceStatement = ( context: __SerdeContext ): any => { return { - ...(input.ARN !== undefined && { ARN: input.ARN }), - ...(input.ExcludedRules !== undefined && { - ExcludedRules: serializeAws_json1_1ExcludedRules(input.ExcludedRules, context), - }), + ...(input.ARN !== undefined && input.ARN !== null && { ARN: input.ARN }), + ...(input.ExcludedRules !== undefined && + input.ExcludedRules !== null && { + ExcludedRules: serializeAws_json1_1ExcludedRules(input.ExcludedRules, context), + }), }; }; const serializeAws_json1_1Rules = (input: Rule[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Rule(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Rule(entry, context); + }); }; const serializeAws_json1_1SingleHeader = (input: SingleHeader, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1SingleQueryArgument = (input: SingleQueryArgument, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), }; }; const serializeAws_json1_1SizeConstraintStatement = (input: SizeConstraintStatement, context: __SerdeContext): any => { return { - ...(input.ComparisonOperator !== undefined && { ComparisonOperator: input.ComparisonOperator }), - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.Size !== undefined && { Size: input.Size }), - ...(input.TextTransformations !== undefined && { - TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), - }), + ...(input.ComparisonOperator !== undefined && + input.ComparisonOperator !== null && { ComparisonOperator: input.ComparisonOperator }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.Size !== undefined && input.Size !== null && { Size: input.Size }), + ...(input.TextTransformations !== undefined && + input.TextTransformations !== null && { + TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), + }), }; }; const serializeAws_json1_1SqliMatchStatement = (input: SqliMatchStatement, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.TextTransformations !== undefined && { - TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), - }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.TextTransformations !== undefined && + input.TextTransformations !== null && { + TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), + }), }; }; const serializeAws_json1_1Statement = (input: Statement, context: __SerdeContext): any => { return { - ...(input.AndStatement !== undefined && { - AndStatement: serializeAws_json1_1AndStatement(input.AndStatement, context), - }), - ...(input.ByteMatchStatement !== undefined && { - ByteMatchStatement: serializeAws_json1_1ByteMatchStatement(input.ByteMatchStatement, context), - }), - ...(input.GeoMatchStatement !== undefined && { - GeoMatchStatement: serializeAws_json1_1GeoMatchStatement(input.GeoMatchStatement, context), - }), - ...(input.IPSetReferenceStatement !== undefined && { - IPSetReferenceStatement: serializeAws_json1_1IPSetReferenceStatement(input.IPSetReferenceStatement, context), - }), - ...(input.ManagedRuleGroupStatement !== undefined && { - ManagedRuleGroupStatement: serializeAws_json1_1ManagedRuleGroupStatement( - input.ManagedRuleGroupStatement, - context - ), - }), - ...(input.NotStatement !== undefined && { - NotStatement: serializeAws_json1_1NotStatement(input.NotStatement, context), - }), - ...(input.OrStatement !== undefined && { - OrStatement: serializeAws_json1_1OrStatement(input.OrStatement, context), - }), - ...(input.RateBasedStatement !== undefined && { - RateBasedStatement: serializeAws_json1_1RateBasedStatement(input.RateBasedStatement, context), - }), - ...(input.RegexPatternSetReferenceStatement !== undefined && { - RegexPatternSetReferenceStatement: serializeAws_json1_1RegexPatternSetReferenceStatement( - input.RegexPatternSetReferenceStatement, - context - ), - }), - ...(input.RuleGroupReferenceStatement !== undefined && { - RuleGroupReferenceStatement: serializeAws_json1_1RuleGroupReferenceStatement( - input.RuleGroupReferenceStatement, - context - ), - }), - ...(input.SizeConstraintStatement !== undefined && { - SizeConstraintStatement: serializeAws_json1_1SizeConstraintStatement(input.SizeConstraintStatement, context), - }), - ...(input.SqliMatchStatement !== undefined && { - SqliMatchStatement: serializeAws_json1_1SqliMatchStatement(input.SqliMatchStatement, context), - }), - ...(input.XssMatchStatement !== undefined && { - XssMatchStatement: serializeAws_json1_1XssMatchStatement(input.XssMatchStatement, context), - }), + ...(input.AndStatement !== undefined && + input.AndStatement !== null && { AndStatement: serializeAws_json1_1AndStatement(input.AndStatement, context) }), + ...(input.ByteMatchStatement !== undefined && + input.ByteMatchStatement !== null && { + ByteMatchStatement: serializeAws_json1_1ByteMatchStatement(input.ByteMatchStatement, context), + }), + ...(input.GeoMatchStatement !== undefined && + input.GeoMatchStatement !== null && { + GeoMatchStatement: serializeAws_json1_1GeoMatchStatement(input.GeoMatchStatement, context), + }), + ...(input.IPSetReferenceStatement !== undefined && + input.IPSetReferenceStatement !== null && { + IPSetReferenceStatement: serializeAws_json1_1IPSetReferenceStatement(input.IPSetReferenceStatement, context), + }), + ...(input.ManagedRuleGroupStatement !== undefined && + input.ManagedRuleGroupStatement !== null && { + ManagedRuleGroupStatement: serializeAws_json1_1ManagedRuleGroupStatement( + input.ManagedRuleGroupStatement, + context + ), + }), + ...(input.NotStatement !== undefined && + input.NotStatement !== null && { NotStatement: serializeAws_json1_1NotStatement(input.NotStatement, context) }), + ...(input.OrStatement !== undefined && + input.OrStatement !== null && { OrStatement: serializeAws_json1_1OrStatement(input.OrStatement, context) }), + ...(input.RateBasedStatement !== undefined && + input.RateBasedStatement !== null && { + RateBasedStatement: serializeAws_json1_1RateBasedStatement(input.RateBasedStatement, context), + }), + ...(input.RegexPatternSetReferenceStatement !== undefined && + input.RegexPatternSetReferenceStatement !== null && { + RegexPatternSetReferenceStatement: serializeAws_json1_1RegexPatternSetReferenceStatement( + input.RegexPatternSetReferenceStatement, + context + ), + }), + ...(input.RuleGroupReferenceStatement !== undefined && + input.RuleGroupReferenceStatement !== null && { + RuleGroupReferenceStatement: serializeAws_json1_1RuleGroupReferenceStatement( + input.RuleGroupReferenceStatement, + context + ), + }), + ...(input.SizeConstraintStatement !== undefined && + input.SizeConstraintStatement !== null && { + SizeConstraintStatement: serializeAws_json1_1SizeConstraintStatement(input.SizeConstraintStatement, context), + }), + ...(input.SqliMatchStatement !== undefined && + input.SqliMatchStatement !== null && { + SqliMatchStatement: serializeAws_json1_1SqliMatchStatement(input.SqliMatchStatement, context), + }), + ...(input.XssMatchStatement !== undefined && + input.XssMatchStatement !== null && { + XssMatchStatement: serializeAws_json1_1XssMatchStatement(input.XssMatchStatement, context), + }), }; }; const serializeAws_json1_1Statements = (input: Statement[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Statement(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Statement(entry, context); + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1TextTransformation = (input: TextTransformation, context: __SerdeContext): any => { return { - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1TextTransformations = (input: TextTransformation[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TextTransformation(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TextTransformation(entry, context); + }); }; const serializeAws_json1_1TimeWindow = (input: TimeWindow, context: __SerdeContext): any => { return { - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; const serializeAws_json1_1UpdateIPSetRequest = (input: UpdateIPSetRequest, context: __SerdeContext): any => { return { - ...(input.Addresses !== undefined && { Addresses: serializeAws_json1_1IPAddresses(input.Addresses, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LockToken !== undefined && { LockToken: input.LockToken }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Addresses !== undefined && + input.Addresses !== null && { Addresses: serializeAws_json1_1IPAddresses(input.Addresses, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LockToken !== undefined && input.LockToken !== null && { LockToken: input.LockToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; @@ -5441,45 +5532,51 @@ const serializeAws_json1_1UpdateRegexPatternSetRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LockToken !== undefined && { LockToken: input.LockToken }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.RegularExpressionList !== undefined && { - RegularExpressionList: serializeAws_json1_1RegularExpressionList(input.RegularExpressionList, context), - }), - ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LockToken !== undefined && input.LockToken !== null && { LockToken: input.LockToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.RegularExpressionList !== undefined && + input.RegularExpressionList !== null && { + RegularExpressionList: serializeAws_json1_1RegularExpressionList(input.RegularExpressionList, context), + }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), }; }; const serializeAws_json1_1UpdateRuleGroupRequest = (input: UpdateRuleGroupRequest, context: __SerdeContext): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LockToken !== undefined && { LockToken: input.LockToken }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Rules !== undefined && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), - ...(input.Scope !== undefined && { Scope: input.Scope }), - ...(input.VisibilityConfig !== undefined && { - VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), - }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LockToken !== undefined && input.LockToken !== null && { LockToken: input.LockToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), + ...(input.VisibilityConfig !== undefined && + input.VisibilityConfig !== null && { + VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), + }), }; }; const serializeAws_json1_1UpdateWebACLRequest = (input: UpdateWebACLRequest, context: __SerdeContext): any => { return { - ...(input.DefaultAction !== undefined && { - DefaultAction: serializeAws_json1_1DefaultAction(input.DefaultAction, context), - }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.LockToken !== undefined && { LockToken: input.LockToken }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Rules !== undefined && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), - ...(input.Scope !== undefined && { Scope: input.Scope }), - ...(input.VisibilityConfig !== undefined && { - VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), - }), + ...(input.DefaultAction !== undefined && + input.DefaultAction !== null && { + DefaultAction: serializeAws_json1_1DefaultAction(input.DefaultAction, context), + }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.LockToken !== undefined && input.LockToken !== null && { LockToken: input.LockToken }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Rules !== undefined && + input.Rules !== null && { Rules: serializeAws_json1_1Rules(input.Rules, context) }), + ...(input.Scope !== undefined && input.Scope !== null && { Scope: input.Scope }), + ...(input.VisibilityConfig !== undefined && + input.VisibilityConfig !== null && { + VisibilityConfig: serializeAws_json1_1VisibilityConfig(input.VisibilityConfig, context), + }), }; }; @@ -5489,20 +5586,22 @@ const serializeAws_json1_1UriPath = (input: UriPath, context: __SerdeContext): a const serializeAws_json1_1VisibilityConfig = (input: VisibilityConfig, context: __SerdeContext): any => { return { - ...(input.CloudWatchMetricsEnabled !== undefined && { CloudWatchMetricsEnabled: input.CloudWatchMetricsEnabled }), - ...(input.MetricName !== undefined && { MetricName: input.MetricName }), - ...(input.SampledRequestsEnabled !== undefined && { SampledRequestsEnabled: input.SampledRequestsEnabled }), + ...(input.CloudWatchMetricsEnabled !== undefined && + input.CloudWatchMetricsEnabled !== null && { CloudWatchMetricsEnabled: input.CloudWatchMetricsEnabled }), + ...(input.MetricName !== undefined && input.MetricName !== null && { MetricName: input.MetricName }), + ...(input.SampledRequestsEnabled !== undefined && + input.SampledRequestsEnabled !== null && { SampledRequestsEnabled: input.SampledRequestsEnabled }), }; }; const serializeAws_json1_1XssMatchStatement = (input: XssMatchStatement, context: __SerdeContext): any => { return { - ...(input.FieldToMatch !== undefined && { - FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context), - }), - ...(input.TextTransformations !== undefined && { - TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), - }), + ...(input.FieldToMatch !== undefined && + input.FieldToMatch !== null && { FieldToMatch: serializeAws_json1_1FieldToMatch(input.FieldToMatch, context) }), + ...(input.TextTransformations !== undefined && + input.TextTransformations !== null && { + TextTransformations: serializeAws_json1_1TextTransformations(input.TextTransformations, context), + }), }; }; @@ -5570,7 +5669,14 @@ const deserializeAws_json1_1CountAction = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1CountryCodes = (output: any, context: __SerdeContext): (CountryCode | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1CreateIPSetResponse = (output: any, context: __SerdeContext): CreateIPSetResponse => { @@ -5703,7 +5809,14 @@ const deserializeAws_json1_1ExcludedRule = (output: any, context: __SerdeContext }; const deserializeAws_json1_1ExcludedRules = (output: any, context: __SerdeContext): ExcludedRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ExcludedRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ExcludedRule(entry, context); + }); }; const deserializeAws_json1_1FieldToMatch = (output: any, context: __SerdeContext): FieldToMatch => { @@ -5763,7 +5876,14 @@ const deserializeAws_json1_1FirewallManagerRuleGroups = ( output: any, context: __SerdeContext ): FirewallManagerRuleGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FirewallManagerRuleGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FirewallManagerRuleGroup(entry, context); + }); }; const deserializeAws_json1_1FirewallManagerStatement = ( @@ -5921,7 +6041,14 @@ const deserializeAws_json1_1HTTPHeader = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1HTTPHeaders = (output: any, context: __SerdeContext): HTTPHeader[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1HTTPHeader(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1HTTPHeader(entry, context); + }); }; const deserializeAws_json1_1HTTPRequest = (output: any, context: __SerdeContext): HTTPRequest => { @@ -5939,7 +6066,14 @@ const deserializeAws_json1_1HTTPRequest = (output: any, context: __SerdeContext) }; const deserializeAws_json1_1IPAddresses = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1IPSet = (output: any, context: __SerdeContext): IPSet => { @@ -5980,7 +6114,14 @@ const deserializeAws_json1_1IPSetReferenceStatement = ( }; const deserializeAws_json1_1IPSetSummaries = (output: any, context: __SerdeContext): IPSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IPSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IPSetSummary(entry, context); + }); }; const deserializeAws_json1_1IPSetSummary = (output: any, context: __SerdeContext): IPSetSummary => { @@ -6088,7 +6229,14 @@ const deserializeAws_json1_1ListWebACLsResponse = (output: any, context: __Serde }; const deserializeAws_json1_1LogDestinationConfigs = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1LoggingConfiguration = (output: any, context: __SerdeContext): LoggingConfiguration => { @@ -6110,7 +6258,14 @@ const deserializeAws_json1_1LoggingConfiguration = (output: any, context: __Serd }; const deserializeAws_json1_1LoggingConfigurations = (output: any, context: __SerdeContext): LoggingConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1LoggingConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1LoggingConfiguration(entry, context); + }); }; const deserializeAws_json1_1ManagedRuleGroupStatement = ( @@ -6131,7 +6286,14 @@ const deserializeAws_json1_1ManagedRuleGroupSummaries = ( output: any, context: __SerdeContext ): ManagedRuleGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ManagedRuleGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ManagedRuleGroupSummary(entry, context); + }); }; const deserializeAws_json1_1ManagedRuleGroupSummary = ( @@ -6238,7 +6400,14 @@ const deserializeAws_json1_1RateBasedStatementManagedKeysIPSet = ( }; const deserializeAws_json1_1RedactedFields = (output: any, context: __SerdeContext): FieldToMatch[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FieldToMatch(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FieldToMatch(entry, context); + }); }; const deserializeAws_json1_1Regex = (output: any, context: __SerdeContext): Regex => { @@ -6281,7 +6450,14 @@ const deserializeAws_json1_1RegexPatternSetSummaries = ( output: any, context: __SerdeContext ): RegexPatternSetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RegexPatternSetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RegexPatternSetSummary(entry, context); + }); }; const deserializeAws_json1_1RegexPatternSetSummary = (output: any, context: __SerdeContext): RegexPatternSetSummary => { @@ -6295,11 +6471,25 @@ const deserializeAws_json1_1RegexPatternSetSummary = (output: any, context: __Se }; const deserializeAws_json1_1RegularExpressionList = (output: any, context: __SerdeContext): Regex[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Regex(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Regex(entry, context); + }); }; const deserializeAws_json1_1ResourceArns = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Rule = (output: any, context: __SerdeContext): Rule => { @@ -6374,7 +6564,14 @@ const deserializeAws_json1_1RuleGroupReferenceStatement = ( }; const deserializeAws_json1_1RuleGroupSummaries = (output: any, context: __SerdeContext): RuleGroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RuleGroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RuleGroupSummary(entry, context); + }); }; const deserializeAws_json1_1RuleGroupSummary = (output: any, context: __SerdeContext): RuleGroupSummary => { @@ -6388,11 +6585,25 @@ const deserializeAws_json1_1RuleGroupSummary = (output: any, context: __SerdeCon }; const deserializeAws_json1_1Rules = (output: any, context: __SerdeContext): Rule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Rule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Rule(entry, context); + }); }; const deserializeAws_json1_1RuleSummaries = (output: any, context: __SerdeContext): RuleSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1RuleSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1RuleSummary(entry, context); + }); }; const deserializeAws_json1_1RuleSummary = (output: any, context: __SerdeContext): RuleSummary => { @@ -6425,7 +6636,14 @@ const deserializeAws_json1_1SampledHTTPRequest = (output: any, context: __SerdeC }; const deserializeAws_json1_1SampledHTTPRequests = (output: any, context: __SerdeContext): SampledHTTPRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1SampledHTTPRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1SampledHTTPRequest(entry, context); + }); }; const deserializeAws_json1_1SingleHeader = (output: any, context: __SerdeContext): SingleHeader => { @@ -6532,7 +6750,14 @@ const deserializeAws_json1_1Statement = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Statements = (output: any, context: __SerdeContext): Statement[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Statement(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Statement(entry, context); + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -6553,7 +6778,14 @@ const deserializeAws_json1_1TagInfoForResource = (output: any, context: __SerdeC }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -6568,7 +6800,14 @@ const deserializeAws_json1_1TextTransformation = (output: any, context: __SerdeC }; const deserializeAws_json1_1TextTransformations = (output: any, context: __SerdeContext): TextTransformation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1TextTransformation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1TextTransformation(entry, context); + }); }; const deserializeAws_json1_1TimeWindow = (output: any, context: __SerdeContext): TimeWindow => { @@ -6811,7 +7050,14 @@ const deserializeAws_json1_1WebACL = (output: any, context: __SerdeContext): Web }; const deserializeAws_json1_1WebACLSummaries = (output: any, context: __SerdeContext): WebACLSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WebACLSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WebACLSummary(entry, context); + }); }; const deserializeAws_json1_1WebACLSummary = (output: any, context: __SerdeContext): WebACLSummary => { @@ -6887,3 +7133,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-workdocs/protocols/Aws_restJson1.ts b/clients/client-workdocs/protocols/Aws_restJson1.ts index ad713ef54a93..67d3088b9ec9 100644 --- a/clients/client-workdocs/protocols/Aws_restJson1.ts +++ b/clients/client-workdocs/protocols/Aws_restJson1.ts @@ -155,7 +155,6 @@ export const serializeAws_restJson1AbortDocumentVersionUploadCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}/versions/{VersionId}"; @@ -195,7 +194,6 @@ export const serializeAws_restJson1ActivateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/users/{UserId}/activation"; @@ -226,7 +224,7 @@ export const serializeAws_restJson1AddResourcePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/resources/{ResourceId}/permissions"; @@ -241,12 +239,12 @@ export const serializeAws_restJson1AddResourcePermissionsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.NotificationOptions !== undefined && { - NotificationOptions: serializeAws_restJson1NotificationOptions(input.NotificationOptions, context), - }), - ...(input.Principals !== undefined && { - Principals: serializeAws_restJson1SharePrincipalList(input.Principals, context), - }), + ...(input.NotificationOptions !== undefined && + input.NotificationOptions !== null && { + NotificationOptions: serializeAws_restJson1NotificationOptions(input.NotificationOptions, context), + }), + ...(input.Principals !== undefined && + input.Principals !== null && { Principals: serializeAws_restJson1SharePrincipalList(input.Principals, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -265,7 +263,7 @@ export const serializeAws_restJson1CreateCommentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}/versions/{VersionId}/comment"; @@ -289,11 +287,12 @@ export const serializeAws_restJson1CreateCommentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.NotifyCollaborators !== undefined && { NotifyCollaborators: input.NotifyCollaborators }), - ...(input.ParentId !== undefined && { ParentId: input.ParentId }), - ...(input.Text !== undefined && { Text: input.Text }), - ...(input.ThreadId !== undefined && { ThreadId: input.ThreadId }), - ...(input.Visibility !== undefined && { Visibility: input.Visibility }), + ...(input.NotifyCollaborators !== undefined && + input.NotifyCollaborators !== null && { NotifyCollaborators: input.NotifyCollaborators }), + ...(input.ParentId !== undefined && input.ParentId !== null && { ParentId: input.ParentId }), + ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }), + ...(input.ThreadId !== undefined && input.ThreadId !== null && { ThreadId: input.ThreadId }), + ...(input.Visibility !== undefined && input.Visibility !== null && { Visibility: input.Visibility }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -312,7 +311,7 @@ export const serializeAws_restJson1CreateCustomMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/resources/{ResourceId}/customMetadata"; @@ -330,9 +329,10 @@ export const serializeAws_restJson1CreateCustomMetadataCommand = async ( }; let body: any; body = JSON.stringify({ - ...(input.CustomMetadata !== undefined && { - CustomMetadata: serializeAws_restJson1CustomMetadataMap(input.CustomMetadata, context), - }), + ...(input.CustomMetadata !== undefined && + input.CustomMetadata !== null && { + CustomMetadata: serializeAws_restJson1CustomMetadataMap(input.CustomMetadata, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -352,14 +352,15 @@ export const serializeAws_restJson1CreateFolderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/folders"; let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParentFolderId !== undefined && { ParentFolderId: input.ParentFolderId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParentFolderId !== undefined && + input.ParentFolderId !== null && { ParentFolderId: input.ParentFolderId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -378,7 +379,7 @@ export const serializeAws_restJson1CreateLabelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/resources/{ResourceId}/labels"; @@ -393,7 +394,8 @@ export const serializeAws_restJson1CreateLabelsCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Labels !== undefined && { Labels: serializeAws_restJson1SharedLabels(input.Labels, context) }), + ...(input.Labels !== undefined && + input.Labels !== null && { Labels: serializeAws_restJson1SharedLabels(input.Labels, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -412,7 +414,7 @@ export const serializeAws_restJson1CreateNotificationSubscriptionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/api/v1/organizations/{OrganizationId}/subscriptions"; if (input.OrganizationId !== undefined) { @@ -426,9 +428,10 @@ export const serializeAws_restJson1CreateNotificationSubscriptionCommand = async } let body: any; body = JSON.stringify({ - ...(input.Endpoint !== undefined && { Endpoint: input.Endpoint }), - ...(input.Protocol !== undefined && { Protocol: input.Protocol }), - ...(input.SubscriptionType !== undefined && { SubscriptionType: input.SubscriptionType }), + ...(input.Endpoint !== undefined && input.Endpoint !== null && { Endpoint: input.Endpoint }), + ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }), + ...(input.SubscriptionType !== undefined && + input.SubscriptionType !== null && { SubscriptionType: input.SubscriptionType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -447,22 +450,22 @@ export const serializeAws_restJson1CreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/users"; let body: any; body = JSON.stringify({ - ...(input.EmailAddress !== undefined && { EmailAddress: input.EmailAddress }), - ...(input.GivenName !== undefined && { GivenName: input.GivenName }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.StorageRule !== undefined && { - StorageRule: serializeAws_restJson1StorageRuleType(input.StorageRule, context), - }), - ...(input.Surname !== undefined && { Surname: input.Surname }), - ...(input.TimeZoneId !== undefined && { TimeZoneId: input.TimeZoneId }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }), + ...(input.GivenName !== undefined && input.GivenName !== null && { GivenName: input.GivenName }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.StorageRule !== undefined && + input.StorageRule !== null && { StorageRule: serializeAws_restJson1StorageRuleType(input.StorageRule, context) }), + ...(input.Surname !== undefined && input.Surname !== null && { Surname: input.Surname }), + ...(input.TimeZoneId !== undefined && input.TimeZoneId !== null && { TimeZoneId: input.TimeZoneId }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -481,7 +484,6 @@ export const serializeAws_restJson1DeactivateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/users/{UserId}/activation"; @@ -512,7 +514,6 @@ export const serializeAws_restJson1DeleteCommentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}/versions/{VersionId}/comment/{CommentId}"; @@ -561,7 +562,6 @@ export const serializeAws_restJson1DeleteCustomMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/resources/{ResourceId}/customMetadata"; @@ -598,7 +598,6 @@ export const serializeAws_restJson1DeleteDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}"; @@ -629,7 +628,6 @@ export const serializeAws_restJson1DeleteFolderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/folders/{FolderId}"; @@ -660,7 +658,6 @@ export const serializeAws_restJson1DeleteFolderContentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/folders/{FolderId}/contents"; @@ -691,7 +688,6 @@ export const serializeAws_restJson1DeleteLabelsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/resources/{ResourceId}/labels"; @@ -726,9 +722,7 @@ export const serializeAws_restJson1DeleteNotificationSubscriptionCommand = async input: DeleteNotificationSubscriptionCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/api/v1/organizations/{OrganizationId}/subscriptions/{SubscriptionId}"; if (input.OrganizationId !== undefined) { const labelValue: string = input.OrganizationId; @@ -766,7 +760,6 @@ export const serializeAws_restJson1DeleteUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/users/{UserId}"; @@ -797,7 +790,6 @@ export const serializeAws_restJson1DescribeActivitiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/activities"; @@ -833,7 +825,6 @@ export const serializeAws_restJson1DescribeCommentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}/versions/{VersionId}/comments"; @@ -878,7 +869,6 @@ export const serializeAws_restJson1DescribeDocumentVersionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}/versions"; @@ -916,7 +906,6 @@ export const serializeAws_restJson1DescribeFolderContentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/folders/{FolderId}/contents"; @@ -956,7 +945,6 @@ export const serializeAws_restJson1DescribeGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/groups"; @@ -984,9 +972,7 @@ export const serializeAws_restJson1DescribeNotificationSubscriptionsCommand = as input: DescribeNotificationSubscriptionsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/api/v1/organizations/{OrganizationId}/subscriptions"; if (input.OrganizationId !== undefined) { const labelValue: string = input.OrganizationId; @@ -1020,7 +1006,6 @@ export const serializeAws_restJson1DescribeResourcePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/resources/{ResourceId}/permissions"; @@ -1057,7 +1042,6 @@ export const serializeAws_restJson1DescribeRootFoldersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/me/root"; @@ -1084,7 +1068,6 @@ export const serializeAws_restJson1DescribeUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/users"; @@ -1118,7 +1101,6 @@ export const serializeAws_restJson1GetCurrentUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/me"; @@ -1140,7 +1122,6 @@ export const serializeAws_restJson1GetDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}"; @@ -1175,7 +1156,6 @@ export const serializeAws_restJson1GetDocumentPathCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}/path"; @@ -1212,7 +1192,6 @@ export const serializeAws_restJson1GetDocumentVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}/versions/{VersionId}"; @@ -1257,7 +1236,6 @@ export const serializeAws_restJson1GetFolderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/folders/{FolderId}"; @@ -1292,7 +1270,6 @@ export const serializeAws_restJson1GetFolderPathCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/folders/{FolderId}/path"; @@ -1329,7 +1306,6 @@ export const serializeAws_restJson1GetResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/resources"; @@ -1358,23 +1334,27 @@ export const serializeAws_restJson1InitiateDocumentVersionUploadCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents"; let body: any; body = JSON.stringify({ - ...(input.ContentCreatedTimestamp !== undefined && { - ContentCreatedTimestamp: Math.round(input.ContentCreatedTimestamp.getTime() / 1000), - }), - ...(input.ContentModifiedTimestamp !== undefined && { - ContentModifiedTimestamp: Math.round(input.ContentModifiedTimestamp.getTime() / 1000), - }), - ...(input.ContentType !== undefined && { ContentType: input.ContentType }), - ...(input.DocumentSizeInBytes !== undefined && { DocumentSizeInBytes: input.DocumentSizeInBytes }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParentFolderId !== undefined && { ParentFolderId: input.ParentFolderId }), + ...(input.ContentCreatedTimestamp !== undefined && + input.ContentCreatedTimestamp !== null && { + ContentCreatedTimestamp: Math.round(input.ContentCreatedTimestamp.getTime() / 1000), + }), + ...(input.ContentModifiedTimestamp !== undefined && + input.ContentModifiedTimestamp !== null && { + ContentModifiedTimestamp: Math.round(input.ContentModifiedTimestamp.getTime() / 1000), + }), + ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }), + ...(input.DocumentSizeInBytes !== undefined && + input.DocumentSizeInBytes !== null && { DocumentSizeInBytes: input.DocumentSizeInBytes }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParentFolderId !== undefined && + input.ParentFolderId !== null && { ParentFolderId: input.ParentFolderId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1393,7 +1373,6 @@ export const serializeAws_restJson1RemoveAllResourcePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/resources/{ResourceId}/permissions"; @@ -1424,7 +1403,6 @@ export const serializeAws_restJson1RemoveResourcePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/resources/{ResourceId}/permissions/{PrincipalId}"; @@ -1468,7 +1446,7 @@ export const serializeAws_restJson1UpdateDocumentCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}"; @@ -1483,9 +1461,10 @@ export const serializeAws_restJson1UpdateDocumentCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParentFolderId !== undefined && { ParentFolderId: input.ParentFolderId }), - ...(input.ResourceState !== undefined && { ResourceState: input.ResourceState }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParentFolderId !== undefined && + input.ParentFolderId !== null && { ParentFolderId: input.ParentFolderId }), + ...(input.ResourceState !== undefined && input.ResourceState !== null && { ResourceState: input.ResourceState }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1504,7 +1483,7 @@ export const serializeAws_restJson1UpdateDocumentVersionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/documents/{DocumentId}/versions/{VersionId}"; @@ -1528,7 +1507,7 @@ export const serializeAws_restJson1UpdateDocumentVersionCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.VersionStatus !== undefined && { VersionStatus: input.VersionStatus }), + ...(input.VersionStatus !== undefined && input.VersionStatus !== null && { VersionStatus: input.VersionStatus }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1547,7 +1526,7 @@ export const serializeAws_restJson1UpdateFolderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/folders/{FolderId}"; @@ -1562,9 +1541,10 @@ export const serializeAws_restJson1UpdateFolderCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.ParentFolderId !== undefined && { ParentFolderId: input.ParentFolderId }), - ...(input.ResourceState !== undefined && { ResourceState: input.ResourceState }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.ParentFolderId !== undefined && + input.ParentFolderId !== null && { ParentFolderId: input.ParentFolderId }), + ...(input.ResourceState !== undefined && input.ResourceState !== null && { ResourceState: input.ResourceState }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -1583,7 +1563,7 @@ export const serializeAws_restJson1UpdateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", ...(isSerializableHeaderValue(input.AuthenticationToken) && { Authentication: input.AuthenticationToken! }), }; let resolvedPath = "/api/v1/users/{UserId}"; @@ -1598,15 +1578,15 @@ export const serializeAws_restJson1UpdateUserCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.GivenName !== undefined && { GivenName: input.GivenName }), - ...(input.GrantPoweruserPrivileges !== undefined && { GrantPoweruserPrivileges: input.GrantPoweruserPrivileges }), - ...(input.Locale !== undefined && { Locale: input.Locale }), - ...(input.StorageRule !== undefined && { - StorageRule: serializeAws_restJson1StorageRuleType(input.StorageRule, context), - }), - ...(input.Surname !== undefined && { Surname: input.Surname }), - ...(input.TimeZoneId !== undefined && { TimeZoneId: input.TimeZoneId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.GivenName !== undefined && input.GivenName !== null && { GivenName: input.GivenName }), + ...(input.GrantPoweruserPrivileges !== undefined && + input.GrantPoweruserPrivileges !== null && { GrantPoweruserPrivileges: input.GrantPoweruserPrivileges }), + ...(input.Locale !== undefined && input.Locale !== null && { Locale: input.Locale }), + ...(input.StorageRule !== undefined && + input.StorageRule !== null && { StorageRule: serializeAws_restJson1StorageRuleType(input.StorageRule, context) }), + ...(input.Surname !== undefined && input.Surname !== null && { Surname: input.Surname }), + ...(input.TimeZoneId !== undefined && input.TimeZoneId !== null && { TimeZoneId: input.TimeZoneId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -5993,42 +5973,59 @@ const deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse = asyn }; const serializeAws_restJson1CustomMetadataMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1NotificationOptions = (input: NotificationOptions, context: __SerdeContext): any => { return { - ...(input.EmailMessage !== undefined && { EmailMessage: input.EmailMessage }), - ...(input.SendEmail !== undefined && { SendEmail: input.SendEmail }), + ...(input.EmailMessage !== undefined && input.EmailMessage !== null && { EmailMessage: input.EmailMessage }), + ...(input.SendEmail !== undefined && input.SendEmail !== null && { SendEmail: input.SendEmail }), }; }; const serializeAws_restJson1SharedLabels = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SharePrincipal = (input: SharePrincipal, context: __SerdeContext): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Role !== undefined && { Role: input.Role }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_restJson1SharePrincipalList = (input: SharePrincipal[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1SharePrincipal(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SharePrincipal(entry, context); + }); }; const serializeAws_restJson1StorageRuleType = (input: StorageRuleType, context: __SerdeContext): any => { return { - ...(input.StorageAllocatedInBytes !== undefined && { StorageAllocatedInBytes: input.StorageAllocatedInBytes }), - ...(input.StorageType !== undefined && { StorageType: input.StorageType }), + ...(input.StorageAllocatedInBytes !== undefined && + input.StorageAllocatedInBytes !== null && { StorageAllocatedInBytes: input.StorageAllocatedInBytes }), + ...(input.StorageType !== undefined && input.StorageType !== null && { StorageType: input.StorageType }), }; }; @@ -6089,7 +6086,14 @@ const deserializeAws_restJson1Comment = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1CommentList = (output: any, context: __SerdeContext): Comment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Comment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Comment(entry, context); + }); }; const deserializeAws_restJson1CommentMetadata = (output: any, context: __SerdeContext): CommentMetadata => { @@ -6110,13 +6114,15 @@ const deserializeAws_restJson1CommentMetadata = (output: any, context: __SerdeCo }; const deserializeAws_restJson1CustomMetadataMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DocumentMetadata = (output: any, context: __SerdeContext): DocumentMetadata => { @@ -6147,7 +6153,14 @@ const deserializeAws_restJson1DocumentMetadata = (output: any, context: __SerdeC }; const deserializeAws_restJson1DocumentMetadataList = (output: any, context: __SerdeContext): DocumentMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DocumentMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DocumentMetadata(entry, context); + }); }; const deserializeAws_restJson1DocumentSourceUrlMap = ( @@ -6155,10 +6168,15 @@ const deserializeAws_restJson1DocumentSourceUrlMap = ( context: __SerdeContext ): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [DocumentSourceType | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [DocumentSourceType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -6168,10 +6186,15 @@ const deserializeAws_restJson1DocumentThumbnailUrlMap = ( context: __SerdeContext ): { [key: string]: string } => { return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [DocumentThumbnailType | string, any]) => ({ - ...acc, - [key]: value, - }), + (acc: { [key: string]: string }, [key, value]: [DocumentThumbnailType | string, any]) => { + if (value === null) { + return acc; + } + return { + ...acc, + [key]: value, + }; + }, {} ); }; @@ -6219,11 +6242,25 @@ const deserializeAws_restJson1DocumentVersionMetadataList = ( output: any, context: __SerdeContext ): DocumentVersionMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DocumentVersionMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DocumentVersionMetadata(entry, context); + }); }; const deserializeAws_restJson1EntityIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1FolderMetadata = (output: any, context: __SerdeContext): FolderMetadata => { @@ -6257,7 +6294,14 @@ const deserializeAws_restJson1FolderMetadata = (output: any, context: __SerdeCon }; const deserializeAws_restJson1FolderMetadataList = (output: any, context: __SerdeContext): FolderMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FolderMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FolderMetadata(entry, context); + }); }; const deserializeAws_restJson1GroupMetadata = (output: any, context: __SerdeContext): GroupMetadata => { @@ -6268,11 +6312,25 @@ const deserializeAws_restJson1GroupMetadata = (output: any, context: __SerdeCont }; const deserializeAws_restJson1GroupMetadataList = (output: any, context: __SerdeContext): GroupMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupMetadata(entry, context); + }); }; const deserializeAws_restJson1OrganizationUserList = (output: any, context: __SerdeContext): User[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1User(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1User(entry, context); + }); }; const deserializeAws_restJson1Participants = (output: any, context: __SerdeContext): Participants => { @@ -6296,7 +6354,14 @@ const deserializeAws_restJson1PermissionInfo = (output: any, context: __SerdeCon }; const deserializeAws_restJson1PermissionInfoList = (output: any, context: __SerdeContext): PermissionInfo[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1PermissionInfo(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1PermissionInfo(entry, context); + }); }; const deserializeAws_restJson1Principal = (output: any, context: __SerdeContext): Principal => { @@ -6311,7 +6376,14 @@ const deserializeAws_restJson1Principal = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1PrincipalList = (output: any, context: __SerdeContext): Principal[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Principal(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Principal(entry, context); + }); }; const deserializeAws_restJson1ResourceMetadata = (output: any, context: __SerdeContext): ResourceMetadata => { @@ -6349,11 +6421,25 @@ const deserializeAws_restJson1ResourcePathComponentList = ( output: any, context: __SerdeContext ): ResourcePathComponent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourcePathComponent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourcePathComponent(entry, context); + }); }; const deserializeAws_restJson1SharedLabels = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ShareResult = (output: any, context: __SerdeContext): ShareResult => { @@ -6372,17 +6458,26 @@ const deserializeAws_restJson1ShareResult = (output: any, context: __SerdeContex }; const deserializeAws_restJson1ShareResultsList = (output: any, context: __SerdeContext): ShareResult[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ShareResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ShareResult(entry, context); + }); }; const deserializeAws_restJson1SignedHeaderMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1StorageRuleType = (output: any, context: __SerdeContext): StorageRuleType => { @@ -6405,7 +6500,14 @@ const deserializeAws_restJson1Subscription = (output: any, context: __SerdeConte }; const deserializeAws_restJson1SubscriptionList = (output: any, context: __SerdeContext): Subscription[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Subscription(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Subscription(entry, context); + }); }; const deserializeAws_restJson1UploadMetadata = (output: any, context: __SerdeContext): UploadMetadata => { @@ -6452,7 +6554,14 @@ const deserializeAws_restJson1User = (output: any, context: __SerdeContext): Use }; const deserializeAws_restJson1UserActivities = (output: any, context: __SerdeContext): Activity[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Activity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Activity(entry, context); + }); }; const deserializeAws_restJson1UserMetadata = (output: any, context: __SerdeContext): UserMetadata => { @@ -6466,7 +6575,14 @@ const deserializeAws_restJson1UserMetadata = (output: any, context: __SerdeConte }; const deserializeAws_restJson1UserMetadataList = (output: any, context: __SerdeContext): UserMetadata[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UserMetadata(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UserMetadata(entry, context); + }); }; const deserializeAws_restJson1UserStorageMetadata = (output: any, context: __SerdeContext): UserStorageMetadata => { @@ -6502,6 +6618,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-worklink/protocols/Aws_restJson1.ts b/clients/client-worklink/protocols/Aws_restJson1.ts index e1b25b595ba9..974bb350c050 100644 --- a/clients/client-worklink/protocols/Aws_restJson1.ts +++ b/clients/client-worklink/protocols/Aws_restJson1.ts @@ -121,15 +121,16 @@ export const serializeAws_restJson1AssociateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/associateDomain"; let body: any; body = JSON.stringify({ - ...(input.AcmCertificateArn !== undefined && { AcmCertificateArn: input.AcmCertificateArn }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.AcmCertificateArn !== undefined && + input.AcmCertificateArn !== null && { AcmCertificateArn: input.AcmCertificateArn }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -148,16 +149,15 @@ export const serializeAws_restJson1AssociateWebsiteAuthorizationProviderCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/associateWebsiteAuthorizationProvider"; let body: any; body = JSON.stringify({ - ...(input.AuthorizationProviderType !== undefined && { - AuthorizationProviderType: input.AuthorizationProviderType, - }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.AuthorizationProviderType !== undefined && + input.AuthorizationProviderType !== null && { AuthorizationProviderType: input.AuthorizationProviderType }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -176,14 +176,14 @@ export const serializeAws_restJson1AssociateWebsiteCertificateAuthorityCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/associateWebsiteCertificateAuthority"; let body: any; body = JSON.stringify({ - ...(input.Certificate !== undefined && { Certificate: input.Certificate }), - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.Certificate !== undefined && input.Certificate !== null && { Certificate: input.Certificate }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -202,17 +202,16 @@ export const serializeAws_restJson1CreateFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/createFleet"; let body: any; body = JSON.stringify({ - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.FleetName !== undefined && { FleetName: input.FleetName }), - ...(input.OptimizeForEndUserLocation !== undefined && { - OptimizeForEndUserLocation: input.OptimizeForEndUserLocation, - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.FleetName !== undefined && input.FleetName !== null && { FleetName: input.FleetName }), + ...(input.OptimizeForEndUserLocation !== undefined && + input.OptimizeForEndUserLocation !== null && { OptimizeForEndUserLocation: input.OptimizeForEndUserLocation }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -231,12 +230,12 @@ export const serializeAws_restJson1DeleteFleetCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/deleteFleet"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -255,12 +254,12 @@ export const serializeAws_restJson1DescribeAuditStreamConfigurationCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeAuditStreamConfiguration"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -279,12 +278,12 @@ export const serializeAws_restJson1DescribeCompanyNetworkConfigurationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeCompanyNetworkConfiguration"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -303,13 +302,13 @@ export const serializeAws_restJson1DescribeDeviceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeDevice"; let body: any; body = JSON.stringify({ - ...(input.DeviceId !== undefined && { DeviceId: input.DeviceId }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.DeviceId !== undefined && input.DeviceId !== null && { DeviceId: input.DeviceId }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -328,12 +327,12 @@ export const serializeAws_restJson1DescribeDevicePolicyConfigurationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeDevicePolicyConfiguration"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -352,13 +351,13 @@ export const serializeAws_restJson1DescribeDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeDomain"; let body: any; body = JSON.stringify({ - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -377,12 +376,12 @@ export const serializeAws_restJson1DescribeFleetMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeFleetMetadata"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -401,12 +400,12 @@ export const serializeAws_restJson1DescribeIdentityProviderConfigurationCommand context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeIdentityProviderConfiguration"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -425,13 +424,13 @@ export const serializeAws_restJson1DescribeWebsiteCertificateAuthorityCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/describeWebsiteCertificateAuthority"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.WebsiteCaId !== undefined && { WebsiteCaId: input.WebsiteCaId }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.WebsiteCaId !== undefined && input.WebsiteCaId !== null && { WebsiteCaId: input.WebsiteCaId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -450,13 +449,13 @@ export const serializeAws_restJson1DisassociateDomainCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/disassociateDomain"; let body: any; body = JSON.stringify({ - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -475,13 +474,14 @@ export const serializeAws_restJson1DisassociateWebsiteAuthorizationProviderComma context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/disassociateWebsiteAuthorizationProvider"; let body: any; body = JSON.stringify({ - ...(input.AuthorizationProviderId !== undefined && { AuthorizationProviderId: input.AuthorizationProviderId }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.AuthorizationProviderId !== undefined && + input.AuthorizationProviderId !== null && { AuthorizationProviderId: input.AuthorizationProviderId }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -500,13 +500,13 @@ export const serializeAws_restJson1DisassociateWebsiteCertificateAuthorityComman context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/disassociateWebsiteCertificateAuthority"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.WebsiteCaId !== undefined && { WebsiteCaId: input.WebsiteCaId }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.WebsiteCaId !== undefined && input.WebsiteCaId !== null && { WebsiteCaId: input.WebsiteCaId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -525,14 +525,14 @@ export const serializeAws_restJson1ListDevicesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listDevices"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -551,14 +551,14 @@ export const serializeAws_restJson1ListDomainsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listDomains"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -577,13 +577,13 @@ export const serializeAws_restJson1ListFleetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listFleets"; let body: any; body = JSON.stringify({ - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -601,9 +601,7 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( input: ListTagsForResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -632,14 +630,14 @@ export const serializeAws_restJson1ListWebsiteAuthorizationProvidersCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listWebsiteAuthorizationProviders"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -658,14 +656,14 @@ export const serializeAws_restJson1ListWebsiteCertificateAuthoritiesCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/listWebsiteCertificateAuthorities"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -684,13 +682,13 @@ export const serializeAws_restJson1RestoreDomainAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/restoreDomainAccess"; let body: any; body = JSON.stringify({ - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -709,13 +707,13 @@ export const serializeAws_restJson1RevokeDomainAccessCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/revokeDomainAccess"; let body: any; body = JSON.stringify({ - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -734,13 +732,13 @@ export const serializeAws_restJson1SignOutUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/signOutUser"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.Username !== undefined && { Username: input.Username }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -759,7 +757,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { @@ -773,7 +771,7 @@ export const serializeAws_restJson1TagResourceCommand = async ( } let body: any; body = JSON.stringify({ - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -791,9 +789,7 @@ export const serializeAws_restJson1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/tags/{ResourceArn}"; if (input.ResourceArn !== undefined) { const labelValue: string = input.ResourceArn; @@ -826,13 +822,14 @@ export const serializeAws_restJson1UpdateAuditStreamConfigurationCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateAuditStreamConfiguration"; let body: any; body = JSON.stringify({ - ...(input.AuditStreamArn !== undefined && { AuditStreamArn: input.AuditStreamArn }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.AuditStreamArn !== undefined && + input.AuditStreamArn !== null && { AuditStreamArn: input.AuditStreamArn }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -851,17 +848,19 @@ export const serializeAws_restJson1UpdateCompanyNetworkConfigurationCommand = as context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateCompanyNetworkConfiguration"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.SecurityGroupIds !== undefined && { - SecurityGroupIds: serializeAws_restJson1SecurityGroupIds(input.SecurityGroupIds, context), - }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_restJson1SubnetIds(input.SubnetIds, context) }), - ...(input.VpcId !== undefined && { VpcId: input.VpcId }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.SecurityGroupIds !== undefined && + input.SecurityGroupIds !== null && { + SecurityGroupIds: serializeAws_restJson1SecurityGroupIds(input.SecurityGroupIds, context), + }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_restJson1SubnetIds(input.SubnetIds, context) }), + ...(input.VpcId !== undefined && input.VpcId !== null && { VpcId: input.VpcId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -880,13 +879,14 @@ export const serializeAws_restJson1UpdateDevicePolicyConfigurationCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateDevicePolicyConfiguration"; let body: any; body = JSON.stringify({ - ...(input.DeviceCaCertificate !== undefined && { DeviceCaCertificate: input.DeviceCaCertificate }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.DeviceCaCertificate !== undefined && + input.DeviceCaCertificate !== null && { DeviceCaCertificate: input.DeviceCaCertificate }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -905,14 +905,14 @@ export const serializeAws_restJson1UpdateDomainMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateDomainMetadata"; let body: any; body = JSON.stringify({ - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -931,16 +931,15 @@ export const serializeAws_restJson1UpdateFleetMetadataCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UpdateFleetMetadata"; let body: any; body = JSON.stringify({ - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.OptimizeForEndUserLocation !== undefined && { - OptimizeForEndUserLocation: input.OptimizeForEndUserLocation, - }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.OptimizeForEndUserLocation !== undefined && + input.OptimizeForEndUserLocation !== null && { OptimizeForEndUserLocation: input.OptimizeForEndUserLocation }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -959,16 +958,18 @@ export const serializeAws_restJson1UpdateIdentityProviderConfigurationCommand = context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/updateIdentityProviderConfiguration"; let body: any; body = JSON.stringify({ - ...(input.FleetArn !== undefined && { FleetArn: input.FleetArn }), - ...(input.IdentityProviderSamlMetadata !== undefined && { - IdentityProviderSamlMetadata: input.IdentityProviderSamlMetadata, - }), - ...(input.IdentityProviderType !== undefined && { IdentityProviderType: input.IdentityProviderType }), + ...(input.FleetArn !== undefined && input.FleetArn !== null && { FleetArn: input.FleetArn }), + ...(input.IdentityProviderSamlMetadata !== undefined && + input.IdentityProviderSamlMetadata !== null && { + IdentityProviderSamlMetadata: input.IdentityProviderSamlMetadata, + }), + ...(input.IdentityProviderType !== undefined && + input.IdentityProviderType !== null && { IdentityProviderType: input.IdentityProviderType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -3946,21 +3947,37 @@ const deserializeAws_restJson1UnauthorizedExceptionResponse = async ( }; const serializeAws_restJson1SecurityGroupIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1DeviceSummary = (output: any, context: __SerdeContext): DeviceSummary => { @@ -3971,7 +3988,14 @@ const deserializeAws_restJson1DeviceSummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1DeviceSummaryList = (output: any, context: __SerdeContext): DeviceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DeviceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DeviceSummary(entry, context); + }); }; const deserializeAws_restJson1DomainSummary = (output: any, context: __SerdeContext): DomainSummary => { @@ -3987,7 +4011,14 @@ const deserializeAws_restJson1DomainSummary = (output: any, context: __SerdeCont }; const deserializeAws_restJson1DomainSummaryList = (output: any, context: __SerdeContext): DomainSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1DomainSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1DomainSummary(entry, context); + }); }; const deserializeAws_restJson1FleetSummary = (output: any, context: __SerdeContext): FleetSummary => { @@ -4013,34 +4044,62 @@ const deserializeAws_restJson1FleetSummary = (output: any, context: __SerdeConte }; const deserializeAws_restJson1FleetSummaryList = (output: any, context: __SerdeContext): FleetSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FleetSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FleetSummary(entry, context); + }); }; const deserializeAws_restJson1SecurityGroupIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1WebsiteAuthorizationProvidersSummaryList = ( output: any, context: __SerdeContext ): WebsiteAuthorizationProviderSummary[] => { - return (output || []).map((entry: any) => - deserializeAws_restJson1WebsiteAuthorizationProviderSummary(entry, context) - ); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1WebsiteAuthorizationProviderSummary(entry, context); + }); }; const deserializeAws_restJson1WebsiteAuthorizationProviderSummary = ( @@ -4076,7 +4135,14 @@ const deserializeAws_restJson1WebsiteCaSummary = (output: any, context: __SerdeC }; const deserializeAws_restJson1WebsiteCaSummaryList = (output: any, context: __SerdeContext): WebsiteCaSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1WebsiteCaSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1WebsiteCaSummary(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -4099,6 +4165,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-workmail/protocols/Aws_json1_1.ts b/clients/client-workmail/protocols/Aws_json1_1.ts index 52ae5aaacbd7..ef5d0663c2b5 100644 --- a/clients/client-workmail/protocols/Aws_json1_1.ts +++ b/clients/client-workmail/protocols/Aws_json1_1.ts @@ -263,7 +263,7 @@ export const serializeAws_json1_1AssociateDelegateToResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.AssociateDelegateToResource", }; let body: any; @@ -276,7 +276,7 @@ export const serializeAws_json1_1AssociateMemberToGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.AssociateMemberToGroup", }; let body: any; @@ -289,7 +289,7 @@ export const serializeAws_json1_1CancelMailboxExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.CancelMailboxExportJob", }; let body: any; @@ -302,7 +302,7 @@ export const serializeAws_json1_1CreateAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.CreateAlias", }; let body: any; @@ -315,7 +315,7 @@ export const serializeAws_json1_1CreateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.CreateGroup", }; let body: any; @@ -328,7 +328,7 @@ export const serializeAws_json1_1CreateOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.CreateOrganization", }; let body: any; @@ -341,7 +341,7 @@ export const serializeAws_json1_1CreateResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.CreateResource", }; let body: any; @@ -354,7 +354,7 @@ export const serializeAws_json1_1CreateUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.CreateUser", }; let body: any; @@ -367,7 +367,7 @@ export const serializeAws_json1_1DeleteAccessControlRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DeleteAccessControlRule", }; let body: any; @@ -380,7 +380,7 @@ export const serializeAws_json1_1DeleteAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DeleteAlias", }; let body: any; @@ -393,7 +393,7 @@ export const serializeAws_json1_1DeleteGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DeleteGroup", }; let body: any; @@ -406,7 +406,7 @@ export const serializeAws_json1_1DeleteMailboxPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DeleteMailboxPermissions", }; let body: any; @@ -419,7 +419,7 @@ export const serializeAws_json1_1DeleteOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DeleteOrganization", }; let body: any; @@ -432,7 +432,7 @@ export const serializeAws_json1_1DeleteResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DeleteResource", }; let body: any; @@ -445,7 +445,7 @@ export const serializeAws_json1_1DeleteRetentionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DeleteRetentionPolicy", }; let body: any; @@ -458,7 +458,7 @@ export const serializeAws_json1_1DeleteUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DeleteUser", }; let body: any; @@ -471,7 +471,7 @@ export const serializeAws_json1_1DeregisterFromWorkMailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DeregisterFromWorkMail", }; let body: any; @@ -484,7 +484,7 @@ export const serializeAws_json1_1DescribeGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DescribeGroup", }; let body: any; @@ -497,7 +497,7 @@ export const serializeAws_json1_1DescribeMailboxExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DescribeMailboxExportJob", }; let body: any; @@ -510,7 +510,7 @@ export const serializeAws_json1_1DescribeOrganizationCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DescribeOrganization", }; let body: any; @@ -523,7 +523,7 @@ export const serializeAws_json1_1DescribeResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DescribeResource", }; let body: any; @@ -536,7 +536,7 @@ export const serializeAws_json1_1DescribeUserCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DescribeUser", }; let body: any; @@ -549,7 +549,7 @@ export const serializeAws_json1_1DisassociateDelegateFromResourceCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DisassociateDelegateFromResource", }; let body: any; @@ -562,7 +562,7 @@ export const serializeAws_json1_1DisassociateMemberFromGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.DisassociateMemberFromGroup", }; let body: any; @@ -575,7 +575,7 @@ export const serializeAws_json1_1GetAccessControlEffectCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.GetAccessControlEffect", }; let body: any; @@ -588,7 +588,7 @@ export const serializeAws_json1_1GetDefaultRetentionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.GetDefaultRetentionPolicy", }; let body: any; @@ -601,7 +601,7 @@ export const serializeAws_json1_1GetMailboxDetailsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.GetMailboxDetails", }; let body: any; @@ -614,7 +614,7 @@ export const serializeAws_json1_1ListAccessControlRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListAccessControlRules", }; let body: any; @@ -627,7 +627,7 @@ export const serializeAws_json1_1ListAliasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListAliases", }; let body: any; @@ -640,7 +640,7 @@ export const serializeAws_json1_1ListGroupMembersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListGroupMembers", }; let body: any; @@ -653,7 +653,7 @@ export const serializeAws_json1_1ListGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListGroups", }; let body: any; @@ -666,7 +666,7 @@ export const serializeAws_json1_1ListMailboxExportJobsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListMailboxExportJobs", }; let body: any; @@ -679,7 +679,7 @@ export const serializeAws_json1_1ListMailboxPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListMailboxPermissions", }; let body: any; @@ -692,7 +692,7 @@ export const serializeAws_json1_1ListOrganizationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListOrganizations", }; let body: any; @@ -705,7 +705,7 @@ export const serializeAws_json1_1ListResourceDelegatesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListResourceDelegates", }; let body: any; @@ -718,7 +718,7 @@ export const serializeAws_json1_1ListResourcesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListResources", }; let body: any; @@ -731,7 +731,7 @@ export const serializeAws_json1_1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListTagsForResource", }; let body: any; @@ -744,7 +744,7 @@ export const serializeAws_json1_1ListUsersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ListUsers", }; let body: any; @@ -757,7 +757,7 @@ export const serializeAws_json1_1PutAccessControlRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.PutAccessControlRule", }; let body: any; @@ -770,7 +770,7 @@ export const serializeAws_json1_1PutMailboxPermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.PutMailboxPermissions", }; let body: any; @@ -783,7 +783,7 @@ export const serializeAws_json1_1PutRetentionPolicyCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.PutRetentionPolicy", }; let body: any; @@ -796,7 +796,7 @@ export const serializeAws_json1_1RegisterToWorkMailCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.RegisterToWorkMail", }; let body: any; @@ -809,7 +809,7 @@ export const serializeAws_json1_1ResetPasswordCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.ResetPassword", }; let body: any; @@ -822,7 +822,7 @@ export const serializeAws_json1_1StartMailboxExportJobCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.StartMailboxExportJob", }; let body: any; @@ -835,7 +835,7 @@ export const serializeAws_json1_1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.TagResource", }; let body: any; @@ -848,7 +848,7 @@ export const serializeAws_json1_1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.UntagResource", }; let body: any; @@ -861,7 +861,7 @@ export const serializeAws_json1_1UpdateMailboxQuotaCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.UpdateMailboxQuota", }; let body: any; @@ -874,7 +874,7 @@ export const serializeAws_json1_1UpdatePrimaryEmailAddressCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.UpdatePrimaryEmailAddress", }; let body: any; @@ -887,7 +887,7 @@ export const serializeAws_json1_1UpdateResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkMailService.UpdateResource", }; let body: any; @@ -922,8 +922,7 @@ const deserializeAws_json1_1AssociateDelegateToResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -1009,8 +1008,7 @@ const deserializeAws_json1_1AssociateMemberToGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -1120,8 +1118,7 @@ const deserializeAws_json1_1CancelMailboxExportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -1199,8 +1196,7 @@ const deserializeAws_json1_1CreateAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EmailAddressInUseException": case "com.amazonaws.workmail#EmailAddressInUseException": @@ -1318,8 +1314,7 @@ const deserializeAws_json1_1CreateGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -1429,8 +1424,7 @@ const deserializeAws_json1_1CreateOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryInUseException": case "com.amazonaws.workmail#DirectoryInUseException": @@ -1516,8 +1510,7 @@ const deserializeAws_json1_1CreateResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -1619,8 +1612,7 @@ const deserializeAws_json1_1CreateUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -1738,8 +1730,7 @@ const deserializeAws_json1_1DeleteAccessControlRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OrganizationNotFoundException": case "com.amazonaws.workmail#OrganizationNotFoundException": @@ -1801,8 +1792,7 @@ const deserializeAws_json1_1DeleteAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -1888,8 +1878,7 @@ const deserializeAws_json1_1DeleteGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -1991,8 +1980,7 @@ const deserializeAws_json1_1DeleteMailboxPermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -2078,8 +2066,7 @@ const deserializeAws_json1_1DeleteOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.workmail#InvalidParameterException": @@ -2149,8 +2136,7 @@ const deserializeAws_json1_1DeleteResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityStateException": case "com.amazonaws.workmail#EntityStateException": @@ -2228,8 +2214,7 @@ const deserializeAws_json1_1DeleteRetentionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.workmail#InvalidParameterException": @@ -2299,8 +2284,7 @@ const deserializeAws_json1_1DeleteUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -2402,8 +2386,7 @@ const deserializeAws_json1_1DeregisterFromWorkMailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -2489,8 +2472,7 @@ const deserializeAws_json1_1DescribeGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -2568,8 +2550,7 @@ const deserializeAws_json1_1DescribeMailboxExportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -2647,8 +2628,7 @@ const deserializeAws_json1_1DescribeOrganizationCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.workmail#InvalidParameterException": @@ -2710,8 +2690,7 @@ const deserializeAws_json1_1DescribeResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -2789,8 +2768,7 @@ const deserializeAws_json1_1DescribeUserCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -2868,8 +2846,7 @@ const deserializeAws_json1_1DisassociateDelegateFromResourceCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -2955,8 +2932,7 @@ const deserializeAws_json1_1DisassociateMemberFromGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -3066,8 +3042,7 @@ const deserializeAws_json1_1GetAccessControlEffectCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -3145,8 +3120,7 @@ const deserializeAws_json1_1GetDefaultRetentionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -3224,8 +3198,7 @@ const deserializeAws_json1_1GetMailboxDetailsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -3295,8 +3268,7 @@ const deserializeAws_json1_1ListAccessControlRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OrganizationNotFoundException": case "com.amazonaws.workmail#OrganizationNotFoundException": @@ -3358,8 +3330,7 @@ const deserializeAws_json1_1ListAliasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -3445,8 +3416,7 @@ const deserializeAws_json1_1ListGroupMembersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -3532,8 +3502,7 @@ const deserializeAws_json1_1ListGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -3611,8 +3580,7 @@ const deserializeAws_json1_1ListMailboxExportJobsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.workmail#InvalidParameterException": @@ -3682,8 +3650,7 @@ const deserializeAws_json1_1ListMailboxPermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -3761,8 +3728,7 @@ const deserializeAws_json1_1ListOrganizationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.workmail#InvalidParameterException": @@ -3816,8 +3782,7 @@ const deserializeAws_json1_1ListResourceDelegatesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -3903,8 +3868,7 @@ const deserializeAws_json1_1ListResourcesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.workmail#InvalidParameterException": @@ -3974,8 +3938,7 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.workmail#ResourceNotFoundException": @@ -4029,8 +3992,7 @@ const deserializeAws_json1_1ListUsersCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.workmail#InvalidParameterException": @@ -4100,8 +4062,7 @@ const deserializeAws_json1_1PutAccessControlRuleCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -4187,8 +4148,7 @@ const deserializeAws_json1_1PutMailboxPermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -4274,8 +4234,7 @@ const deserializeAws_json1_1PutRetentionPolicyCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterException": case "com.amazonaws.workmail#InvalidParameterException": @@ -4353,8 +4312,7 @@ const deserializeAws_json1_1RegisterToWorkMailCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -4488,8 +4446,7 @@ const deserializeAws_json1_1ResetPasswordCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -4607,8 +4564,7 @@ const deserializeAws_json1_1StartMailboxExportJobCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -4694,8 +4650,7 @@ const deserializeAws_json1_1TagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "OrganizationStateException": case "com.amazonaws.workmail#OrganizationStateException": @@ -4765,8 +4720,7 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.workmail#ResourceNotFoundException": @@ -4820,8 +4774,7 @@ const deserializeAws_json1_1UpdateMailboxQuotaCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": @@ -4907,8 +4860,7 @@ const deserializeAws_json1_1UpdatePrimaryEmailAddressCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryServiceAuthenticationFailedException": case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": @@ -5042,8 +4994,7 @@ const deserializeAws_json1_1UpdateResourceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "DirectoryUnavailableException": case "com.amazonaws.workmail#DirectoryUnavailableException": @@ -5443,7 +5394,14 @@ const deserializeAws_json1_1UnsupportedOperationExceptionResponse = async ( }; const serializeAws_json1_1ActionsList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssociateDelegateToResourceRequest = ( @@ -5451,9 +5409,10 @@ const serializeAws_json1_1AssociateDelegateToResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -5462,21 +5421,25 @@ const serializeAws_json1_1AssociateMemberToGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.MemberId !== undefined && { MemberId: input.MemberId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.MemberId !== undefined && input.MemberId !== null && { MemberId: input.MemberId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1BookingOptions = (input: BookingOptions, context: __SerdeContext): any => { return { - ...(input.AutoAcceptRequests !== undefined && { AutoAcceptRequests: input.AutoAcceptRequests }), - ...(input.AutoDeclineConflictingRequests !== undefined && { - AutoDeclineConflictingRequests: input.AutoDeclineConflictingRequests, - }), - ...(input.AutoDeclineRecurringRequests !== undefined && { - AutoDeclineRecurringRequests: input.AutoDeclineRecurringRequests, - }), + ...(input.AutoAcceptRequests !== undefined && + input.AutoAcceptRequests !== null && { AutoAcceptRequests: input.AutoAcceptRequests }), + ...(input.AutoDeclineConflictingRequests !== undefined && + input.AutoDeclineConflictingRequests !== null && { + AutoDeclineConflictingRequests: input.AutoDeclineConflictingRequests, + }), + ...(input.AutoDeclineRecurringRequests !== undefined && + input.AutoDeclineRecurringRequests !== null && { + AutoDeclineRecurringRequests: input.AutoDeclineRecurringRequests, + }), }; }; @@ -5486,23 +5449,26 @@ const serializeAws_json1_1CancelMailboxExportJobRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1CreateAliasRequest = (input: CreateAliasRequest, context: __SerdeContext): any => { return { - ...(input.Alias !== undefined && { Alias: input.Alias }), - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.Alias !== undefined && input.Alias !== null && { Alias: input.Alias }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1CreateGroupRequest = (input: CreateGroupRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5511,29 +5477,33 @@ const serializeAws_json1_1CreateOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.Alias !== undefined && { Alias: input.Alias }), + ...(input.Alias !== undefined && input.Alias !== null && { Alias: input.Alias }), ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Domains !== undefined && { Domains: serializeAws_json1_1Domains(input.Domains, context) }), - ...(input.EnableInteroperability !== undefined && { EnableInteroperability: input.EnableInteroperability }), - ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Domains !== undefined && + input.Domains !== null && { Domains: serializeAws_json1_1Domains(input.Domains, context) }), + ...(input.EnableInteroperability !== undefined && + input.EnableInteroperability !== null && { EnableInteroperability: input.EnableInteroperability }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }), }; }; const serializeAws_json1_1CreateResourceRequest = (input: CreateResourceRequest, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }; }; const serializeAws_json1_1CreateUserRequest = (input: CreateUserRequest, context: __SerdeContext): any => { return { - ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.Password !== undefined && { Password: input.Password }), + ...(input.DisplayName !== undefined && input.DisplayName !== null && { DisplayName: input.DisplayName }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), }; }; @@ -5542,23 +5512,26 @@ const serializeAws_json1_1DeleteAccessControlRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1DeleteAliasRequest = (input: DeleteAliasRequest, context: __SerdeContext): any => { return { - ...(input.Alias !== undefined && { Alias: input.Alias }), - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.Alias !== undefined && input.Alias !== null && { Alias: input.Alias }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1DeleteGroupRequest = (input: DeleteGroupRequest, context: __SerdeContext): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5567,9 +5540,10 @@ const serializeAws_json1_1DeleteMailboxPermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.GranteeId !== undefined && { GranteeId: input.GranteeId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.GranteeId !== undefined && input.GranteeId !== null && { GranteeId: input.GranteeId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5579,15 +5553,18 @@ const serializeAws_json1_1DeleteOrganizationRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.DeleteDirectory !== undefined && { DeleteDirectory: input.DeleteDirectory }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.DeleteDirectory !== undefined && + input.DeleteDirectory !== null && { DeleteDirectory: input.DeleteDirectory }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1DeleteResourceRequest = (input: DeleteResourceRequest, context: __SerdeContext): any => { return { - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -5596,15 +5573,17 @@ const serializeAws_json1_1DeleteRetentionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1DeleteUserRequest = (input: DeleteUserRequest, context: __SerdeContext): any => { return { - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; @@ -5613,15 +5592,17 @@ const serializeAws_json1_1DeregisterFromWorkMailRequest = ( context: __SerdeContext ): any => { return { - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1DescribeGroupRequest = (input: DescribeGroupRequest, context: __SerdeContext): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5630,8 +5611,9 @@ const serializeAws_json1_1DescribeMailboxExportJobRequest = ( context: __SerdeContext ): any => { return { - ...(input.JobId !== undefined && { JobId: input.JobId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5640,21 +5622,24 @@ const serializeAws_json1_1DescribeOrganizationRequest = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1DescribeResourceRequest = (input: DescribeResourceRequest, context: __SerdeContext): any => { return { - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; const serializeAws_json1_1DescribeUserRequest = (input: DescribeUserRequest, context: __SerdeContext): any => { return { - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; @@ -5663,9 +5648,10 @@ const serializeAws_json1_1DisassociateDelegateFromResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -5674,33 +5660,48 @@ const serializeAws_json1_1DisassociateMemberFromGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.MemberId !== undefined && { MemberId: input.MemberId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.MemberId !== undefined && input.MemberId !== null && { MemberId: input.MemberId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1Domain = (input: Domain, context: __SerdeContext): any => { return { - ...(input.DomainName !== undefined && { DomainName: input.DomainName }), - ...(input.HostedZoneId !== undefined && { HostedZoneId: input.HostedZoneId }), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.HostedZoneId !== undefined && input.HostedZoneId !== null && { HostedZoneId: input.HostedZoneId }), }; }; const serializeAws_json1_1Domains = (input: Domain[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Domain(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Domain(entry, context); + }); }; const serializeAws_json1_1FolderConfiguration = (input: FolderConfiguration, context: __SerdeContext): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Period !== undefined && { Period: input.Period }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Period !== undefined && input.Period !== null && { Period: input.Period }), }; }; const serializeAws_json1_1FolderConfigurations = (input: FolderConfiguration[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1FolderConfiguration(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1FolderConfiguration(entry, context); + }); }; const serializeAws_json1_1GetAccessControlEffectRequest = ( @@ -5708,10 +5709,11 @@ const serializeAws_json1_1GetAccessControlEffectRequest = ( context: __SerdeContext ): any => { return { - ...(input.Action !== undefined && { Action: input.Action }), - ...(input.IpAddress !== undefined && { IpAddress: input.IpAddress }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), + ...(input.IpAddress !== undefined && input.IpAddress !== null && { IpAddress: input.IpAddress }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; @@ -5720,7 +5722,8 @@ const serializeAws_json1_1GetDefaultRetentionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5729,13 +5732,21 @@ const serializeAws_json1_1GetMailboxDetailsRequest = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; const serializeAws_json1_1IpRangeList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ListAccessControlRulesRequest = ( @@ -5743,33 +5754,37 @@ const serializeAws_json1_1ListAccessControlRulesRequest = ( context: __SerdeContext ): any => { return { - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1ListAliasesRequest = (input: ListAliasesRequest, context: __SerdeContext): any => { return { - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1ListGroupMembersRequest = (input: ListGroupMembersRequest, context: __SerdeContext): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1ListGroupsRequest = (input: ListGroupsRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5778,9 +5793,10 @@ const serializeAws_json1_1ListMailboxExportJobsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5789,10 +5805,11 @@ const serializeAws_json1_1ListMailboxPermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5801,8 +5818,8 @@ const serializeAws_json1_1ListOrganizationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5811,18 +5828,20 @@ const serializeAws_json1_1ListResourceDelegatesRequest = ( context: __SerdeContext ): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; const serializeAws_json1_1ListResourcesRequest = (input: ListResourcesRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5831,20 +5850,28 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }; }; const serializeAws_json1_1ListUsersRequest = (input: ListUsersRequest, context: __SerdeContext): any => { return { - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1PermissionValues = (input: (PermissionType | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1PutAccessControlRuleRequest = ( @@ -5852,18 +5879,23 @@ const serializeAws_json1_1PutAccessControlRuleRequest = ( context: __SerdeContext ): any => { return { - ...(input.Actions !== undefined && { Actions: serializeAws_json1_1ActionsList(input.Actions, context) }), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Effect !== undefined && { Effect: input.Effect }), - ...(input.IpRanges !== undefined && { IpRanges: serializeAws_json1_1IpRangeList(input.IpRanges, context) }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.NotActions !== undefined && { NotActions: serializeAws_json1_1ActionsList(input.NotActions, context) }), - ...(input.NotIpRanges !== undefined && { - NotIpRanges: serializeAws_json1_1IpRangeList(input.NotIpRanges, context), - }), - ...(input.NotUserIds !== undefined && { NotUserIds: serializeAws_json1_1UserIdList(input.NotUserIds, context) }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.UserIds !== undefined && { UserIds: serializeAws_json1_1UserIdList(input.UserIds, context) }), + ...(input.Actions !== undefined && + input.Actions !== null && { Actions: serializeAws_json1_1ActionsList(input.Actions, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Effect !== undefined && input.Effect !== null && { Effect: input.Effect }), + ...(input.IpRanges !== undefined && + input.IpRanges !== null && { IpRanges: serializeAws_json1_1IpRangeList(input.IpRanges, context) }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.NotActions !== undefined && + input.NotActions !== null && { NotActions: serializeAws_json1_1ActionsList(input.NotActions, context) }), + ...(input.NotIpRanges !== undefined && + input.NotIpRanges !== null && { NotIpRanges: serializeAws_json1_1IpRangeList(input.NotIpRanges, context) }), + ...(input.NotUserIds !== undefined && + input.NotUserIds !== null && { NotUserIds: serializeAws_json1_1UserIdList(input.NotUserIds, context) }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.UserIds !== undefined && + input.UserIds !== null && { UserIds: serializeAws_json1_1UserIdList(input.UserIds, context) }), }; }; @@ -5872,12 +5904,14 @@ const serializeAws_json1_1PutMailboxPermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.GranteeId !== undefined && { GranteeId: input.GranteeId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.PermissionValues !== undefined && { - PermissionValues: serializeAws_json1_1PermissionValues(input.PermissionValues, context), - }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.GranteeId !== undefined && input.GranteeId !== null && { GranteeId: input.GranteeId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.PermissionValues !== undefined && + input.PermissionValues !== null && { + PermissionValues: serializeAws_json1_1PermissionValues(input.PermissionValues, context), + }), }; }; @@ -5886,13 +5920,15 @@ const serializeAws_json1_1PutRetentionPolicyRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.FolderConfigurations !== undefined && { - FolderConfigurations: serializeAws_json1_1FolderConfigurations(input.FolderConfigurations, context), - }), - ...(input.Id !== undefined && { Id: input.Id }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.FolderConfigurations !== undefined && + input.FolderConfigurations !== null && { + FolderConfigurations: serializeAws_json1_1FolderConfigurations(input.FolderConfigurations, context), + }), + ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; @@ -5901,17 +5937,19 @@ const serializeAws_json1_1RegisterToWorkMailRequest = ( context: __SerdeContext ): any => { return { - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1ResetPasswordRequest = (input: ResetPasswordRequest, context: __SerdeContext): any => { return { - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.Password !== undefined && { Password: input.Password }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; @@ -5921,42 +5959,58 @@ const serializeAws_json1_1StartMailboxExportJobRequest = ( ): any => { return { ClientToken: input.ClientToken ?? generateIdempotencyToken(), - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), - ...(input.S3BucketName !== undefined && { S3BucketName: input.S3BucketName }), - ...(input.S3Prefix !== undefined && { S3Prefix: input.S3Prefix }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }), + ...(input.S3BucketName !== undefined && input.S3BucketName !== null && { S3BucketName: input.S3BucketName }), + ...(input.S3Prefix !== undefined && input.S3Prefix !== null && { S3Prefix: input.S3Prefix }), }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -5965,9 +6019,10 @@ const serializeAws_json1_1UpdateMailboxQuotaRequest = ( context: __SerdeContext ): any => { return { - ...(input.MailboxQuota !== undefined && { MailboxQuota: input.MailboxQuota }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.MailboxQuota !== undefined && input.MailboxQuota !== null && { MailboxQuota: input.MailboxQuota }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.UserId !== undefined && input.UserId !== null && { UserId: input.UserId }), }; }; @@ -5976,25 +6031,35 @@ const serializeAws_json1_1UpdatePrimaryEmailAddressRequest = ( context: __SerdeContext ): any => { return { - ...(input.Email !== undefined && { Email: input.Email }), - ...(input.EntityId !== undefined && { EntityId: input.EntityId }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), + ...(input.Email !== undefined && input.Email !== null && { Email: input.Email }), + ...(input.EntityId !== undefined && input.EntityId !== null && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), }; }; const serializeAws_json1_1UpdateResourceRequest = (input: UpdateResourceRequest, context: __SerdeContext): any => { return { - ...(input.BookingOptions !== undefined && { - BookingOptions: serializeAws_json1_1BookingOptions(input.BookingOptions, context), - }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.OrganizationId !== undefined && { OrganizationId: input.OrganizationId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.BookingOptions !== undefined && + input.BookingOptions !== null && { + BookingOptions: serializeAws_json1_1BookingOptions(input.BookingOptions, context), + }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; const serializeAws_json1_1UserIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AccessControlRule = (output: any, context: __SerdeContext): AccessControlRule => { @@ -6038,19 +6103,47 @@ const deserializeAws_json1_1AccessControlRule = (output: any, context: __SerdeCo }; const deserializeAws_json1_1AccessControlRuleNameList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AccessControlRulesList = (output: any, context: __SerdeContext): AccessControlRule[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AccessControlRule(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccessControlRule(entry, context); + }); }; const deserializeAws_json1_1ActionsList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Aliases = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1AssociateDelegateToResourceResponse = ( @@ -6381,7 +6474,14 @@ const deserializeAws_json1_1FolderConfiguration = (output: any, context: __Serde }; const deserializeAws_json1_1FolderConfigurations = (output: any, context: __SerdeContext): FolderConfiguration[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FolderConfiguration(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FolderConfiguration(entry, context); + }); }; const deserializeAws_json1_1GetAccessControlEffectResponse = ( @@ -6440,7 +6540,14 @@ const deserializeAws_json1_1Group = (output: any, context: __SerdeContext): Grou }; const deserializeAws_json1_1Groups = (output: any, context: __SerdeContext): Group[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Group(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Group(entry, context); + }); }; const deserializeAws_json1_1InvalidConfigurationException = ( @@ -6471,11 +6578,25 @@ const deserializeAws_json1_1InvalidPasswordException = ( }; const deserializeAws_json1_1IpRangeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Jobs = (output: any, context: __SerdeContext): MailboxExportJob[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1MailboxExportJob(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1MailboxExportJob(entry, context); + }); }; const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { @@ -6668,7 +6789,14 @@ const deserializeAws_json1_1Member = (output: any, context: __SerdeContext): Mem }; const deserializeAws_json1_1Members = (output: any, context: __SerdeContext): Member[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Member(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Member(entry, context); + }); }; const deserializeAws_json1_1NameAvailabilityException = ( @@ -6699,7 +6827,14 @@ const deserializeAws_json1_1OrganizationStateException = ( }; const deserializeAws_json1_1OrganizationSummaries = (output: any, context: __SerdeContext): OrganizationSummary[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1OrganizationSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1OrganizationSummary(entry, context); + }); }; const deserializeAws_json1_1OrganizationSummary = (output: any, context: __SerdeContext): OrganizationSummary => { @@ -6728,11 +6863,25 @@ const deserializeAws_json1_1Permission = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1Permissions = (output: any, context: __SerdeContext): Permission[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Permission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Permission(entry, context); + }); }; const deserializeAws_json1_1PermissionValues = (output: any, context: __SerdeContext): (PermissionType | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1PutAccessControlRuleResponse = ( @@ -6792,7 +6941,14 @@ const deserializeAws_json1_1Resource = (output: any, context: __SerdeContext): R }; const deserializeAws_json1_1ResourceDelegates = (output: any, context: __SerdeContext): Delegate[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Delegate(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Delegate(entry, context); + }); }; const deserializeAws_json1_1ResourceNotFoundException = ( @@ -6805,7 +6961,14 @@ const deserializeAws_json1_1ResourceNotFoundException = ( }; const deserializeAws_json1_1Resources = (output: any, context: __SerdeContext): Resource[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Resource(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Resource(entry, context); + }); }; const deserializeAws_json1_1StartMailboxExportJobResponse = ( @@ -6825,7 +6988,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => { @@ -6889,11 +7059,25 @@ const deserializeAws_json1_1User = (output: any, context: __SerdeContext): User }; const deserializeAws_json1_1UserIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Users = (output: any, context: __SerdeContext): User[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1User(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1User(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -6946,3 +7130,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-workmailmessageflow/protocols/Aws_restJson1.ts b/clients/client-workmailmessageflow/protocols/Aws_restJson1.ts index 9b5dae8f0671..4b16b4b0de5b 100644 --- a/clients/client-workmailmessageflow/protocols/Aws_restJson1.ts +++ b/clients/client-workmailmessageflow/protocols/Aws_restJson1.ts @@ -19,9 +19,7 @@ export const serializeAws_restJson1GetRawMessageContentCommand = async ( input: GetRawMessageContentCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/messages/{messageId}"; if (input.messageId !== undefined) { const labelValue: string = input.messageId; @@ -135,6 +133,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/clients/client-workspaces/protocols/Aws_json1_1.ts b/clients/client-workspaces/protocols/Aws_json1_1.ts index 388a84082de2..ba748ed963f7 100644 --- a/clients/client-workspaces/protocols/Aws_json1_1.ts +++ b/clients/client-workspaces/protocols/Aws_json1_1.ts @@ -304,7 +304,7 @@ export const serializeAws_json1_1AssociateConnectionAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.AssociateConnectionAlias", }; let body: any; @@ -317,7 +317,7 @@ export const serializeAws_json1_1AssociateIpGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.AssociateIpGroups", }; let body: any; @@ -330,7 +330,7 @@ export const serializeAws_json1_1AuthorizeIpRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.AuthorizeIpRules", }; let body: any; @@ -343,7 +343,7 @@ export const serializeAws_json1_1CopyWorkspaceImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.CopyWorkspaceImage", }; let body: any; @@ -356,7 +356,7 @@ export const serializeAws_json1_1CreateConnectionAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.CreateConnectionAlias", }; let body: any; @@ -369,7 +369,7 @@ export const serializeAws_json1_1CreateIpGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.CreateIpGroup", }; let body: any; @@ -382,7 +382,7 @@ export const serializeAws_json1_1CreateTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.CreateTags", }; let body: any; @@ -395,7 +395,7 @@ export const serializeAws_json1_1CreateWorkspacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.CreateWorkspaces", }; let body: any; @@ -408,7 +408,7 @@ export const serializeAws_json1_1DeleteConnectionAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DeleteConnectionAlias", }; let body: any; @@ -421,7 +421,7 @@ export const serializeAws_json1_1DeleteIpGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DeleteIpGroup", }; let body: any; @@ -434,7 +434,7 @@ export const serializeAws_json1_1DeleteTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DeleteTags", }; let body: any; @@ -447,7 +447,7 @@ export const serializeAws_json1_1DeleteWorkspaceImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DeleteWorkspaceImage", }; let body: any; @@ -460,7 +460,7 @@ export const serializeAws_json1_1DeregisterWorkspaceDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DeregisterWorkspaceDirectory", }; let body: any; @@ -473,7 +473,7 @@ export const serializeAws_json1_1DescribeAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeAccount", }; let body: any; @@ -486,7 +486,7 @@ export const serializeAws_json1_1DescribeAccountModificationsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeAccountModifications", }; let body: any; @@ -499,7 +499,7 @@ export const serializeAws_json1_1DescribeClientPropertiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeClientProperties", }; let body: any; @@ -512,7 +512,7 @@ export const serializeAws_json1_1DescribeConnectionAliasesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeConnectionAliases", }; let body: any; @@ -525,7 +525,7 @@ export const serializeAws_json1_1DescribeConnectionAliasPermissionsCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeConnectionAliasPermissions", }; let body: any; @@ -538,7 +538,7 @@ export const serializeAws_json1_1DescribeIpGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeIpGroups", }; let body: any; @@ -551,7 +551,7 @@ export const serializeAws_json1_1DescribeTagsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeTags", }; let body: any; @@ -564,7 +564,7 @@ export const serializeAws_json1_1DescribeWorkspaceBundlesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeWorkspaceBundles", }; let body: any; @@ -577,7 +577,7 @@ export const serializeAws_json1_1DescribeWorkspaceDirectoriesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeWorkspaceDirectories", }; let body: any; @@ -590,7 +590,7 @@ export const serializeAws_json1_1DescribeWorkspaceImagePermissionsCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeWorkspaceImagePermissions", }; let body: any; @@ -603,7 +603,7 @@ export const serializeAws_json1_1DescribeWorkspaceImagesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeWorkspaceImages", }; let body: any; @@ -616,7 +616,7 @@ export const serializeAws_json1_1DescribeWorkspacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeWorkspaces", }; let body: any; @@ -629,7 +629,7 @@ export const serializeAws_json1_1DescribeWorkspacesConnectionStatusCommand = asy context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeWorkspacesConnectionStatus", }; let body: any; @@ -642,7 +642,7 @@ export const serializeAws_json1_1DescribeWorkspaceSnapshotsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DescribeWorkspaceSnapshots", }; let body: any; @@ -655,7 +655,7 @@ export const serializeAws_json1_1DisassociateConnectionAliasCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DisassociateConnectionAlias", }; let body: any; @@ -668,7 +668,7 @@ export const serializeAws_json1_1DisassociateIpGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.DisassociateIpGroups", }; let body: any; @@ -681,7 +681,7 @@ export const serializeAws_json1_1ImportWorkspaceImageCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.ImportWorkspaceImage", }; let body: any; @@ -694,7 +694,7 @@ export const serializeAws_json1_1ListAvailableManagementCidrRangesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.ListAvailableManagementCidrRanges", }; let body: any; @@ -707,7 +707,7 @@ export const serializeAws_json1_1MigrateWorkspaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.MigrateWorkspace", }; let body: any; @@ -720,7 +720,7 @@ export const serializeAws_json1_1ModifyAccountCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.ModifyAccount", }; let body: any; @@ -733,7 +733,7 @@ export const serializeAws_json1_1ModifyClientPropertiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.ModifyClientProperties", }; let body: any; @@ -746,7 +746,7 @@ export const serializeAws_json1_1ModifySelfservicePermissionsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.ModifySelfservicePermissions", }; let body: any; @@ -759,7 +759,7 @@ export const serializeAws_json1_1ModifyWorkspaceAccessPropertiesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.ModifyWorkspaceAccessProperties", }; let body: any; @@ -772,7 +772,7 @@ export const serializeAws_json1_1ModifyWorkspaceCreationPropertiesCommand = asyn context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.ModifyWorkspaceCreationProperties", }; let body: any; @@ -785,7 +785,7 @@ export const serializeAws_json1_1ModifyWorkspacePropertiesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.ModifyWorkspaceProperties", }; let body: any; @@ -798,7 +798,7 @@ export const serializeAws_json1_1ModifyWorkspaceStateCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.ModifyWorkspaceState", }; let body: any; @@ -811,7 +811,7 @@ export const serializeAws_json1_1RebootWorkspacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.RebootWorkspaces", }; let body: any; @@ -824,7 +824,7 @@ export const serializeAws_json1_1RebuildWorkspacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.RebuildWorkspaces", }; let body: any; @@ -837,7 +837,7 @@ export const serializeAws_json1_1RegisterWorkspaceDirectoryCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.RegisterWorkspaceDirectory", }; let body: any; @@ -850,7 +850,7 @@ export const serializeAws_json1_1RestoreWorkspaceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.RestoreWorkspace", }; let body: any; @@ -863,7 +863,7 @@ export const serializeAws_json1_1RevokeIpRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.RevokeIpRules", }; let body: any; @@ -876,7 +876,7 @@ export const serializeAws_json1_1StartWorkspacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.StartWorkspaces", }; let body: any; @@ -889,7 +889,7 @@ export const serializeAws_json1_1StopWorkspacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.StopWorkspaces", }; let body: any; @@ -902,7 +902,7 @@ export const serializeAws_json1_1TerminateWorkspacesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.TerminateWorkspaces", }; let body: any; @@ -915,7 +915,7 @@ export const serializeAws_json1_1UpdateConnectionAliasPermissionCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.UpdateConnectionAliasPermission", }; let body: any; @@ -928,7 +928,7 @@ export const serializeAws_json1_1UpdateRulesOfIpGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.UpdateRulesOfIpGroup", }; let body: any; @@ -941,7 +941,7 @@ export const serializeAws_json1_1UpdateWorkspaceImagePermissionCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: __HeaderBag = { - "Content-Type": "application/x-amz-json-1.1", + "content-type": "application/x-amz-json-1.1", "X-Amz-Target": "WorkspacesService.UpdateWorkspaceImagePermission", }; let body: any; @@ -976,8 +976,7 @@ const deserializeAws_json1_1AssociateConnectionAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -1071,8 +1070,7 @@ const deserializeAws_json1_1AssociateIpGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -1166,8 +1164,7 @@ const deserializeAws_json1_1AuthorizeIpRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -1253,8 +1250,7 @@ const deserializeAws_json1_1CopyWorkspaceImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -1356,8 +1352,7 @@ const deserializeAws_json1_1CreateConnectionAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -1451,8 +1446,7 @@ const deserializeAws_json1_1CreateIpGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -1538,8 +1532,7 @@ const deserializeAws_json1_1CreateTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValuesException": case "com.amazonaws.workspaces#InvalidParameterValuesException": @@ -1609,8 +1602,7 @@ const deserializeAws_json1_1CreateWorkspacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValuesException": case "com.amazonaws.workspaces#InvalidParameterValuesException": @@ -1672,8 +1664,7 @@ const deserializeAws_json1_1DeleteConnectionAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -1767,8 +1758,7 @@ const deserializeAws_json1_1DeleteIpGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -1846,8 +1836,7 @@ const deserializeAws_json1_1DeleteTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValuesException": case "com.amazonaws.workspaces#InvalidParameterValuesException": @@ -1909,8 +1898,7 @@ const deserializeAws_json1_1DeleteWorkspaceImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -1980,8 +1968,7 @@ const deserializeAws_json1_1DeregisterWorkspaceDirectoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2067,8 +2054,7 @@ const deserializeAws_json1_1DescribeAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2122,8 +2108,7 @@ const deserializeAws_json1_1DescribeAccountModificationsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2177,8 +2162,7 @@ const deserializeAws_json1_1DescribeClientPropertiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2248,8 +2232,7 @@ const deserializeAws_json1_1DescribeConnectionAliasesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2319,8 +2302,7 @@ const deserializeAws_json1_1DescribeConnectionAliasPermissionsCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2398,8 +2380,7 @@ const deserializeAws_json1_1DescribeIpGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2461,8 +2442,7 @@ const deserializeAws_json1_1DescribeTagsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "ResourceNotFoundException": case "com.amazonaws.workspaces#ResourceNotFoundException": @@ -2516,8 +2496,7 @@ const deserializeAws_json1_1DescribeWorkspaceBundlesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValuesException": case "com.amazonaws.workspaces#InvalidParameterValuesException": @@ -2571,8 +2550,7 @@ const deserializeAws_json1_1DescribeWorkspaceDirectoriesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValuesException": case "com.amazonaws.workspaces#InvalidParameterValuesException": @@ -2626,8 +2604,7 @@ const deserializeAws_json1_1DescribeWorkspaceImagePermissionsCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2697,8 +2674,7 @@ const deserializeAws_json1_1DescribeWorkspaceImagesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2752,8 +2728,7 @@ const deserializeAws_json1_1DescribeWorkspacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValuesException": case "com.amazonaws.workspaces#InvalidParameterValuesException": @@ -2815,8 +2790,7 @@ const deserializeAws_json1_1DescribeWorkspacesConnectionStatusCommandError = asy }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValuesException": case "com.amazonaws.workspaces#InvalidParameterValuesException": @@ -2870,8 +2844,7 @@ const deserializeAws_json1_1DescribeWorkspaceSnapshotsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -2941,8 +2914,7 @@ const deserializeAws_json1_1DisassociateConnectionAliasCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3028,8 +3000,7 @@ const deserializeAws_json1_1DisassociateIpGroupsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3107,8 +3078,7 @@ const deserializeAws_json1_1ImportWorkspaceImageCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3202,8 +3172,7 @@ const deserializeAws_json1_1ListAvailableManagementCidrRangesCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3265,8 +3234,7 @@ const deserializeAws_json1_1MigrateWorkspaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3360,8 +3328,7 @@ const deserializeAws_json1_1ModifyAccountCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3447,8 +3414,7 @@ const deserializeAws_json1_1ModifyClientPropertiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3518,8 +3484,7 @@ const deserializeAws_json1_1ModifySelfservicePermissionsCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3589,8 +3554,7 @@ const deserializeAws_json1_1ModifyWorkspaceAccessPropertiesCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3652,8 +3616,7 @@ const deserializeAws_json1_1ModifyWorkspaceCreationPropertiesCommandError = asyn }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3731,8 +3694,7 @@ const deserializeAws_json1_1ModifyWorkspacePropertiesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -3834,8 +3796,7 @@ const deserializeAws_json1_1ModifyWorkspaceStateCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidParameterValuesException": case "com.amazonaws.workspaces#InvalidParameterValuesException": @@ -3905,8 +3866,7 @@ const deserializeAws_json1_1RebootWorkspacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3952,8 +3912,7 @@ const deserializeAws_json1_1RebuildWorkspacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -3999,8 +3958,7 @@ const deserializeAws_json1_1RegisterWorkspaceDirectoryCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -4110,8 +4068,7 @@ const deserializeAws_json1_1RestoreWorkspaceCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -4181,8 +4138,7 @@ const deserializeAws_json1_1RevokeIpRulesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -4260,8 +4216,7 @@ const deserializeAws_json1_1StartWorkspacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4307,8 +4262,7 @@ const deserializeAws_json1_1StopWorkspacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4354,8 +4308,7 @@ const deserializeAws_json1_1TerminateWorkspacesCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { default: const parsedBody = parsedOutput.body; @@ -4401,8 +4354,7 @@ const deserializeAws_json1_1UpdateConnectionAliasPermissionCommandError = async }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -4504,8 +4456,7 @@ const deserializeAws_json1_1UpdateRulesOfIpGroupCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -4591,8 +4542,7 @@ const deserializeAws_json1_1UpdateWorkspaceImagePermissionCommandError = async ( }; let response: __SmithyException & __MetadataBearer & { [key: string]: any }; let errorCode: string = "UnknownError"; - const errorTypeParts: String = parsedOutput.body["__type"].split("#"); - errorCode = errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.workspaces#AccessDeniedException": @@ -4862,7 +4812,14 @@ const deserializeAws_json1_1WorkspacesDefaultRoleNotFoundExceptionResponse = asy }; const serializeAws_json1_1ApplicationList = (input: (Application | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1AssociateConnectionAliasRequest = ( @@ -4870,8 +4827,8 @@ const serializeAws_json1_1AssociateConnectionAliasRequest = ( context: __SerdeContext ): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -4880,30 +4837,47 @@ const serializeAws_json1_1AssociateIpGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.GroupIds !== undefined && { GroupIds: serializeAws_json1_1IpGroupIdList(input.GroupIds, context) }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.GroupIds !== undefined && + input.GroupIds !== null && { GroupIds: serializeAws_json1_1IpGroupIdList(input.GroupIds, context) }), }; }; const serializeAws_json1_1AuthorizeIpRulesRequest = (input: AuthorizeIpRulesRequest, context: __SerdeContext): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.UserRules !== undefined && { UserRules: serializeAws_json1_1IpRuleList(input.UserRules, context) }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.UserRules !== undefined && + input.UserRules !== null && { UserRules: serializeAws_json1_1IpRuleList(input.UserRules, context) }), }; }; const serializeAws_json1_1BundleIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ClientProperties = (input: ClientProperties, context: __SerdeContext): any => { return { - ...(input.ReconnectEnabled !== undefined && { ReconnectEnabled: input.ReconnectEnabled }), + ...(input.ReconnectEnabled !== undefined && + input.ReconnectEnabled !== null && { ReconnectEnabled: input.ReconnectEnabled }), }; }; const serializeAws_json1_1ConnectionAliasIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1ConnectionAliasPermission = ( @@ -4911,8 +4885,10 @@ const serializeAws_json1_1ConnectionAliasPermission = ( context: __SerdeContext ): any => { return { - ...(input.AllowAssociation !== undefined && { AllowAssociation: input.AllowAssociation }), - ...(input.SharedAccountId !== undefined && { SharedAccountId: input.SharedAccountId }), + ...(input.AllowAssociation !== undefined && + input.AllowAssociation !== null && { AllowAssociation: input.AllowAssociation }), + ...(input.SharedAccountId !== undefined && + input.SharedAccountId !== null && { SharedAccountId: input.SharedAccountId }), }; }; @@ -4921,11 +4897,11 @@ const serializeAws_json1_1CopyWorkspaceImageRequest = ( context: __SerdeContext ): any => { return { - ...(input.Description !== undefined && { Description: input.Description }), - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.SourceImageId !== undefined && { SourceImageId: input.SourceImageId }), - ...(input.SourceRegion !== undefined && { SourceRegion: input.SourceRegion }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.SourceImageId !== undefined && input.SourceImageId !== null && { SourceImageId: input.SourceImageId }), + ...(input.SourceRegion !== undefined && input.SourceRegion !== null && { SourceRegion: input.SourceRegion }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; @@ -4934,32 +4910,33 @@ const serializeAws_json1_1CreateConnectionAliasRequest = ( context: __SerdeContext ): any => { return { - ...(input.ConnectionString !== undefined && { ConnectionString: input.ConnectionString }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ConnectionString !== undefined && + input.ConnectionString !== null && { ConnectionString: input.ConnectionString }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateIpGroupRequest = (input: CreateIpGroupRequest, context: __SerdeContext): any => { return { - ...(input.GroupDesc !== undefined && { GroupDesc: input.GroupDesc }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.UserRules !== undefined && { UserRules: serializeAws_json1_1IpRuleList(input.UserRules, context) }), + ...(input.GroupDesc !== undefined && input.GroupDesc !== null && { GroupDesc: input.GroupDesc }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.UserRules !== undefined && + input.UserRules !== null && { UserRules: serializeAws_json1_1IpRuleList(input.UserRules, context) }), }; }; const serializeAws_json1_1CreateTagsRequest = (input: CreateTagsRequest, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1CreateWorkspacesRequest = (input: CreateWorkspacesRequest, context: __SerdeContext): any => { return { - ...(input.Workspaces !== undefined && { - Workspaces: serializeAws_json1_1WorkspaceRequestList(input.Workspaces, context), - }), + ...(input.Workspaces !== undefined && + input.Workspaces !== null && { Workspaces: serializeAws_json1_1WorkspaceRequestList(input.Workspaces, context) }), }; }; @@ -4968,20 +4945,21 @@ const serializeAws_json1_1DeleteConnectionAliasRequest = ( context: __SerdeContext ): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), }; }; const serializeAws_json1_1DeleteIpGroupRequest = (input: DeleteIpGroupRequest, context: __SerdeContext): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), }; }; const serializeAws_json1_1DeleteTagsRequest = (input: DeleteTagsRequest, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }), }; }; @@ -4990,7 +4968,7 @@ const serializeAws_json1_1DeleteWorkspaceImageRequest = ( context: __SerdeContext ): any => { return { - ...(input.ImageId !== undefined && { ImageId: input.ImageId }), + ...(input.ImageId !== undefined && input.ImageId !== null && { ImageId: input.ImageId }), }; }; @@ -4999,7 +4977,7 @@ const serializeAws_json1_1DeregisterWorkspaceDirectoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), }; }; @@ -5008,7 +4986,7 @@ const serializeAws_json1_1DescribeAccountModificationsRequest = ( context: __SerdeContext ): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5021,9 +4999,8 @@ const serializeAws_json1_1DescribeClientPropertiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceIds !== undefined && { - ResourceIds: serializeAws_json1_1ResourceIdList(input.ResourceIds, context), - }), + ...(input.ResourceIds !== undefined && + input.ResourceIds !== null && { ResourceIds: serializeAws_json1_1ResourceIdList(input.ResourceIds, context) }), }; }; @@ -5032,12 +5009,11 @@ const serializeAws_json1_1DescribeConnectionAliasesRequest = ( context: __SerdeContext ): any => { return { - ...(input.AliasIds !== undefined && { - AliasIds: serializeAws_json1_1ConnectionAliasIdList(input.AliasIds, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.AliasIds !== undefined && + input.AliasIds !== null && { AliasIds: serializeAws_json1_1ConnectionAliasIdList(input.AliasIds, context) }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -5046,23 +5022,24 @@ const serializeAws_json1_1DescribeConnectionAliasPermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1DescribeIpGroupsRequest = (input: DescribeIpGroupsRequest, context: __SerdeContext): any => { return { - ...(input.GroupIds !== undefined && { GroupIds: serializeAws_json1_1IpGroupIdList(input.GroupIds, context) }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.GroupIds !== undefined && + input.GroupIds !== null && { GroupIds: serializeAws_json1_1IpGroupIdList(input.GroupIds, context) }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1DescribeTagsRequest = (input: DescribeTagsRequest, context: __SerdeContext): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -5071,9 +5048,10 @@ const serializeAws_json1_1DescribeWorkspaceBundlesRequest = ( context: __SerdeContext ): any => { return { - ...(input.BundleIds !== undefined && { BundleIds: serializeAws_json1_1BundleIdList(input.BundleIds, context) }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Owner !== undefined && { Owner: input.Owner }), + ...(input.BundleIds !== undefined && + input.BundleIds !== null && { BundleIds: serializeAws_json1_1BundleIdList(input.BundleIds, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Owner !== undefined && input.Owner !== null && { Owner: input.Owner }), }; }; @@ -5082,11 +5060,12 @@ const serializeAws_json1_1DescribeWorkspaceDirectoriesRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryIds !== undefined && { - DirectoryIds: serializeAws_json1_1DirectoryIdList(input.DirectoryIds, context), - }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.DirectoryIds !== undefined && + input.DirectoryIds !== null && { + DirectoryIds: serializeAws_json1_1DirectoryIdList(input.DirectoryIds, context), + }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5095,9 +5074,9 @@ const serializeAws_json1_1DescribeWorkspaceImagePermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ImageId !== undefined && { ImageId: input.ImageId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ImageId !== undefined && input.ImageId !== null && { ImageId: input.ImageId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5106,12 +5085,11 @@ const serializeAws_json1_1DescribeWorkspaceImagesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ImageIds !== undefined && { - ImageIds: serializeAws_json1_1WorkspaceImageIdList(input.ImageIds, context), - }), - ...(input.ImageType !== undefined && { ImageType: input.ImageType }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ImageIds !== undefined && + input.ImageIds !== null && { ImageIds: serializeAws_json1_1WorkspaceImageIdList(input.ImageIds, context) }), + ...(input.ImageType !== undefined && input.ImageType !== null && { ImageType: input.ImageType }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; @@ -5120,10 +5098,11 @@ const serializeAws_json1_1DescribeWorkspacesConnectionStatusRequest = ( context: __SerdeContext ): any => { return { - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.WorkspaceIds !== undefined && { - WorkspaceIds: serializeAws_json1_1WorkspaceIdList(input.WorkspaceIds, context), - }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.WorkspaceIds !== undefined && + input.WorkspaceIds !== null && { + WorkspaceIds: serializeAws_json1_1WorkspaceIdList(input.WorkspaceIds, context), + }), }; }; @@ -5132,7 +5111,7 @@ const serializeAws_json1_1DescribeWorkspaceSnapshotsRequest = ( context: __SerdeContext ): any => { return { - ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceId !== undefined && input.WorkspaceId !== null && { WorkspaceId: input.WorkspaceId }), }; }; @@ -5141,19 +5120,27 @@ const serializeAws_json1_1DescribeWorkspacesRequest = ( context: __SerdeContext ): any => { return { - ...(input.BundleId !== undefined && { BundleId: input.BundleId }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.Limit !== undefined && { Limit: input.Limit }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.UserName !== undefined && { UserName: input.UserName }), - ...(input.WorkspaceIds !== undefined && { - WorkspaceIds: serializeAws_json1_1WorkspaceIdList(input.WorkspaceIds, context), - }), + ...(input.BundleId !== undefined && input.BundleId !== null && { BundleId: input.BundleId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), + ...(input.WorkspaceIds !== undefined && + input.WorkspaceIds !== null && { + WorkspaceIds: serializeAws_json1_1WorkspaceIdList(input.WorkspaceIds, context), + }), }; }; const serializeAws_json1_1DirectoryIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1DisassociateConnectionAliasRequest = ( @@ -5161,7 +5148,7 @@ const serializeAws_json1_1DisassociateConnectionAliasRequest = ( context: __SerdeContext ): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), }; }; @@ -5170,8 +5157,9 @@ const serializeAws_json1_1DisassociateIpGroupsRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.GroupIds !== undefined && { GroupIds: serializeAws_json1_1IpGroupIdList(input.GroupIds, context) }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.GroupIds !== undefined && + input.GroupIds !== null && { GroupIds: serializeAws_json1_1IpGroupIdList(input.GroupIds, context) }), }; }; @@ -5180,34 +5168,58 @@ const serializeAws_json1_1ImportWorkspaceImageRequest = ( context: __SerdeContext ): any => { return { - ...(input.Applications !== undefined && { - Applications: serializeAws_json1_1ApplicationList(input.Applications, context), - }), - ...(input.Ec2ImageId !== undefined && { Ec2ImageId: input.Ec2ImageId }), - ...(input.ImageDescription !== undefined && { ImageDescription: input.ImageDescription }), - ...(input.ImageName !== undefined && { ImageName: input.ImageName }), - ...(input.IngestionProcess !== undefined && { IngestionProcess: input.IngestionProcess }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Applications !== undefined && + input.Applications !== null && { + Applications: serializeAws_json1_1ApplicationList(input.Applications, context), + }), + ...(input.Ec2ImageId !== undefined && input.Ec2ImageId !== null && { Ec2ImageId: input.Ec2ImageId }), + ...(input.ImageDescription !== undefined && + input.ImageDescription !== null && { ImageDescription: input.ImageDescription }), + ...(input.ImageName !== undefined && input.ImageName !== null && { ImageName: input.ImageName }), + ...(input.IngestionProcess !== undefined && + input.IngestionProcess !== null && { IngestionProcess: input.IngestionProcess }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), }; }; const serializeAws_json1_1IpGroupIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IpRevokedRuleList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1IpRuleItem = (input: IpRuleItem, context: __SerdeContext): any => { return { - ...(input.ipRule !== undefined && { ipRule: input.ipRule }), - ...(input.ruleDesc !== undefined && { ruleDesc: input.ruleDesc }), + ...(input.ipRule !== undefined && input.ipRule !== null && { ipRule: input.ipRule }), + ...(input.ruleDesc !== undefined && input.ruleDesc !== null && { ruleDesc: input.ruleDesc }), }; }; const serializeAws_json1_1IpRuleList = (input: IpRuleItem[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1IpRuleItem(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1IpRuleItem(entry, context); + }); }; const serializeAws_json1_1ListAvailableManagementCidrRangesRequest = ( @@ -5215,27 +5227,31 @@ const serializeAws_json1_1ListAvailableManagementCidrRangesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ManagementCidrRangeConstraint !== undefined && { - ManagementCidrRangeConstraint: input.ManagementCidrRangeConstraint, - }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ManagementCidrRangeConstraint !== undefined && + input.ManagementCidrRangeConstraint !== null && { + ManagementCidrRangeConstraint: input.ManagementCidrRangeConstraint, + }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }; }; const serializeAws_json1_1MigrateWorkspaceRequest = (input: MigrateWorkspaceRequest, context: __SerdeContext): any => { return { - ...(input.BundleId !== undefined && { BundleId: input.BundleId }), - ...(input.SourceWorkspaceId !== undefined && { SourceWorkspaceId: input.SourceWorkspaceId }), + ...(input.BundleId !== undefined && input.BundleId !== null && { BundleId: input.BundleId }), + ...(input.SourceWorkspaceId !== undefined && + input.SourceWorkspaceId !== null && { SourceWorkspaceId: input.SourceWorkspaceId }), }; }; const serializeAws_json1_1ModifyAccountRequest = (input: ModifyAccountRequest, context: __SerdeContext): any => { return { - ...(input.DedicatedTenancyManagementCidrRange !== undefined && { - DedicatedTenancyManagementCidrRange: input.DedicatedTenancyManagementCidrRange, - }), - ...(input.DedicatedTenancySupport !== undefined && { DedicatedTenancySupport: input.DedicatedTenancySupport }), + ...(input.DedicatedTenancyManagementCidrRange !== undefined && + input.DedicatedTenancyManagementCidrRange !== null && { + DedicatedTenancyManagementCidrRange: input.DedicatedTenancyManagementCidrRange, + }), + ...(input.DedicatedTenancySupport !== undefined && + input.DedicatedTenancySupport !== null && { DedicatedTenancySupport: input.DedicatedTenancySupport }), }; }; @@ -5244,10 +5260,11 @@ const serializeAws_json1_1ModifyClientPropertiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ClientProperties !== undefined && { - ClientProperties: serializeAws_json1_1ClientProperties(input.ClientProperties, context), - }), - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ClientProperties !== undefined && + input.ClientProperties !== null && { + ClientProperties: serializeAws_json1_1ClientProperties(input.ClientProperties, context), + }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), }; }; @@ -5256,10 +5273,11 @@ const serializeAws_json1_1ModifySelfservicePermissionsRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.SelfservicePermissions !== undefined && { - SelfservicePermissions: serializeAws_json1_1SelfservicePermissions(input.SelfservicePermissions, context), - }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.SelfservicePermissions !== undefined && + input.SelfservicePermissions !== null && { + SelfservicePermissions: serializeAws_json1_1SelfservicePermissions(input.SelfservicePermissions, context), + }), }; }; @@ -5268,13 +5286,14 @@ const serializeAws_json1_1ModifyWorkspaceAccessPropertiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.WorkspaceAccessProperties !== undefined && { - WorkspaceAccessProperties: serializeAws_json1_1WorkspaceAccessProperties( - input.WorkspaceAccessProperties, - context - ), - }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.WorkspaceAccessProperties !== undefined && + input.WorkspaceAccessProperties !== null && { + WorkspaceAccessProperties: serializeAws_json1_1WorkspaceAccessProperties( + input.WorkspaceAccessProperties, + context + ), + }), }; }; @@ -5283,13 +5302,14 @@ const serializeAws_json1_1ModifyWorkspaceCreationPropertiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), - ...(input.WorkspaceCreationProperties !== undefined && { - WorkspaceCreationProperties: serializeAws_json1_1WorkspaceCreationProperties( - input.WorkspaceCreationProperties, - context - ), - }), + ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }), + ...(input.WorkspaceCreationProperties !== undefined && + input.WorkspaceCreationProperties !== null && { + WorkspaceCreationProperties: serializeAws_json1_1WorkspaceCreationProperties( + input.WorkspaceCreationProperties, + context + ), + }), }; }; @@ -5298,10 +5318,11 @@ const serializeAws_json1_1ModifyWorkspacePropertiesRequest = ( context: __SerdeContext ): any => { return { - ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), - ...(input.WorkspaceProperties !== undefined && { - WorkspaceProperties: serializeAws_json1_1WorkspaceProperties(input.WorkspaceProperties, context), - }), + ...(input.WorkspaceId !== undefined && input.WorkspaceId !== null && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceProperties !== undefined && + input.WorkspaceProperties !== null && { + WorkspaceProperties: serializeAws_json1_1WorkspaceProperties(input.WorkspaceProperties, context), + }), }; }; @@ -5310,37 +5331,53 @@ const serializeAws_json1_1ModifyWorkspaceStateRequest = ( context: __SerdeContext ): any => { return { - ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), - ...(input.WorkspaceState !== undefined && { WorkspaceState: input.WorkspaceState }), + ...(input.WorkspaceId !== undefined && input.WorkspaceId !== null && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceState !== undefined && + input.WorkspaceState !== null && { WorkspaceState: input.WorkspaceState }), }; }; const serializeAws_json1_1RebootRequest = (input: RebootRequest, context: __SerdeContext): any => { return { - ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceId !== undefined && input.WorkspaceId !== null && { WorkspaceId: input.WorkspaceId }), }; }; const serializeAws_json1_1RebootWorkspaceRequests = (input: RebootRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RebootRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RebootRequest(entry, context); + }); }; const serializeAws_json1_1RebootWorkspacesRequest = (input: RebootWorkspacesRequest, context: __SerdeContext): any => { return { - ...(input.RebootWorkspaceRequests !== undefined && { - RebootWorkspaceRequests: serializeAws_json1_1RebootWorkspaceRequests(input.RebootWorkspaceRequests, context), - }), + ...(input.RebootWorkspaceRequests !== undefined && + input.RebootWorkspaceRequests !== null && { + RebootWorkspaceRequests: serializeAws_json1_1RebootWorkspaceRequests(input.RebootWorkspaceRequests, context), + }), }; }; const serializeAws_json1_1RebuildRequest = (input: RebuildRequest, context: __SerdeContext): any => { return { - ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceId !== undefined && input.WorkspaceId !== null && { WorkspaceId: input.WorkspaceId }), }; }; const serializeAws_json1_1RebuildWorkspaceRequests = (input: RebuildRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1RebuildRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1RebuildRequest(entry, context); + }); }; const serializeAws_json1_1RebuildWorkspacesRequest = ( @@ -5348,9 +5385,10 @@ const serializeAws_json1_1RebuildWorkspacesRequest = ( context: __SerdeContext ): any => { return { - ...(input.RebuildWorkspaceRequests !== undefined && { - RebuildWorkspaceRequests: serializeAws_json1_1RebuildWorkspaceRequests(input.RebuildWorkspaceRequests, context), - }), + ...(input.RebuildWorkspaceRequests !== undefined && + input.RebuildWorkspaceRequests !== null && { + RebuildWorkspaceRequests: serializeAws_json1_1RebuildWorkspaceRequests(input.RebuildWorkspaceRequests, context), + }), }; }; @@ -5359,107 +5397,165 @@ const serializeAws_json1_1RegisterWorkspaceDirectoryRequest = ( context: __SerdeContext ): any => { return { - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.EnableSelfService !== undefined && { EnableSelfService: input.EnableSelfService }), - ...(input.EnableWorkDocs !== undefined && { EnableWorkDocs: input.EnableWorkDocs }), - ...(input.SubnetIds !== undefined && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.Tenancy !== undefined && { Tenancy: input.Tenancy }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.EnableSelfService !== undefined && + input.EnableSelfService !== null && { EnableSelfService: input.EnableSelfService }), + ...(input.EnableWorkDocs !== undefined && + input.EnableWorkDocs !== null && { EnableWorkDocs: input.EnableWorkDocs }), + ...(input.SubnetIds !== undefined && + input.SubnetIds !== null && { SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.Tenancy !== undefined && input.Tenancy !== null && { Tenancy: input.Tenancy }), }; }; const serializeAws_json1_1ResourceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1RestoreWorkspaceRequest = (input: RestoreWorkspaceRequest, context: __SerdeContext): any => { return { - ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceId !== undefined && input.WorkspaceId !== null && { WorkspaceId: input.WorkspaceId }), }; }; const serializeAws_json1_1RevokeIpRulesRequest = (input: RevokeIpRulesRequest, context: __SerdeContext): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.UserRules !== undefined && { - UserRules: serializeAws_json1_1IpRevokedRuleList(input.UserRules, context), - }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.UserRules !== undefined && + input.UserRules !== null && { UserRules: serializeAws_json1_1IpRevokedRuleList(input.UserRules, context) }), }; }; const serializeAws_json1_1SelfservicePermissions = (input: SelfservicePermissions, context: __SerdeContext): any => { return { - ...(input.ChangeComputeType !== undefined && { ChangeComputeType: input.ChangeComputeType }), - ...(input.IncreaseVolumeSize !== undefined && { IncreaseVolumeSize: input.IncreaseVolumeSize }), - ...(input.RebuildWorkspace !== undefined && { RebuildWorkspace: input.RebuildWorkspace }), - ...(input.RestartWorkspace !== undefined && { RestartWorkspace: input.RestartWorkspace }), - ...(input.SwitchRunningMode !== undefined && { SwitchRunningMode: input.SwitchRunningMode }), + ...(input.ChangeComputeType !== undefined && + input.ChangeComputeType !== null && { ChangeComputeType: input.ChangeComputeType }), + ...(input.IncreaseVolumeSize !== undefined && + input.IncreaseVolumeSize !== null && { IncreaseVolumeSize: input.IncreaseVolumeSize }), + ...(input.RebuildWorkspace !== undefined && + input.RebuildWorkspace !== null && { RebuildWorkspace: input.RebuildWorkspace }), + ...(input.RestartWorkspace !== undefined && + input.RestartWorkspace !== null && { RestartWorkspace: input.RestartWorkspace }), + ...(input.SwitchRunningMode !== undefined && + input.SwitchRunningMode !== null && { SwitchRunningMode: input.SwitchRunningMode }), }; }; const serializeAws_json1_1StartRequest = (input: StartRequest, context: __SerdeContext): any => { return { - ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceId !== undefined && input.WorkspaceId !== null && { WorkspaceId: input.WorkspaceId }), }; }; const serializeAws_json1_1StartWorkspaceRequests = (input: StartRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1StartRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1StartRequest(entry, context); + }); }; const serializeAws_json1_1StartWorkspacesRequest = (input: StartWorkspacesRequest, context: __SerdeContext): any => { return { - ...(input.StartWorkspaceRequests !== undefined && { - StartWorkspaceRequests: serializeAws_json1_1StartWorkspaceRequests(input.StartWorkspaceRequests, context), - }), + ...(input.StartWorkspaceRequests !== undefined && + input.StartWorkspaceRequests !== null && { + StartWorkspaceRequests: serializeAws_json1_1StartWorkspaceRequests(input.StartWorkspaceRequests, context), + }), }; }; const serializeAws_json1_1StopRequest = (input: StopRequest, context: __SerdeContext): any => { return { - ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceId !== undefined && input.WorkspaceId !== null && { WorkspaceId: input.WorkspaceId }), }; }; const serializeAws_json1_1StopWorkspaceRequests = (input: StopRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1StopRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1StopRequest(entry, context); + }); }; const serializeAws_json1_1StopWorkspacesRequest = (input: StopWorkspacesRequest, context: __SerdeContext): any => { return { - ...(input.StopWorkspaceRequests !== undefined && { - StopWorkspaceRequests: serializeAws_json1_1StopWorkspaceRequests(input.StopWorkspaceRequests, context), - }), + ...(input.StopWorkspaceRequests !== undefined && + input.StopWorkspaceRequests !== null && { + StopWorkspaceRequests: serializeAws_json1_1StopWorkspaceRequests(input.StopWorkspaceRequests, context), + }), }; }; const serializeAws_json1_1SubnetIds = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1Tag(entry, context); + }); }; const serializeAws_json1_1TerminateRequest = (input: TerminateRequest, context: __SerdeContext): any => { return { - ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceId !== undefined && input.WorkspaceId !== null && { WorkspaceId: input.WorkspaceId }), }; }; const serializeAws_json1_1TerminateWorkspaceRequests = (input: TerminateRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1TerminateRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1TerminateRequest(entry, context); + }); }; const serializeAws_json1_1TerminateWorkspacesRequest = ( @@ -5467,12 +5563,13 @@ const serializeAws_json1_1TerminateWorkspacesRequest = ( context: __SerdeContext ): any => { return { - ...(input.TerminateWorkspaceRequests !== undefined && { - TerminateWorkspaceRequests: serializeAws_json1_1TerminateWorkspaceRequests( - input.TerminateWorkspaceRequests, - context - ), - }), + ...(input.TerminateWorkspaceRequests !== undefined && + input.TerminateWorkspaceRequests !== null && { + TerminateWorkspaceRequests: serializeAws_json1_1TerminateWorkspaceRequests( + input.TerminateWorkspaceRequests, + context + ), + }), }; }; @@ -5481,13 +5578,14 @@ const serializeAws_json1_1UpdateConnectionAliasPermissionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AliasId !== undefined && { AliasId: input.AliasId }), - ...(input.ConnectionAliasPermission !== undefined && { - ConnectionAliasPermission: serializeAws_json1_1ConnectionAliasPermission( - input.ConnectionAliasPermission, - context - ), - }), + ...(input.AliasId !== undefined && input.AliasId !== null && { AliasId: input.AliasId }), + ...(input.ConnectionAliasPermission !== undefined && + input.ConnectionAliasPermission !== null && { + ConnectionAliasPermission: serializeAws_json1_1ConnectionAliasPermission( + input.ConnectionAliasPermission, + context + ), + }), }; }; @@ -5496,8 +5594,9 @@ const serializeAws_json1_1UpdateRulesOfIpGroupRequest = ( context: __SerdeContext ): any => { return { - ...(input.GroupId !== undefined && { GroupId: input.GroupId }), - ...(input.UserRules !== undefined && { UserRules: serializeAws_json1_1IpRuleList(input.UserRules, context) }), + ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), + ...(input.UserRules !== undefined && + input.UserRules !== null && { UserRules: serializeAws_json1_1IpRuleList(input.UserRules, context) }), }; }; @@ -5506,9 +5605,11 @@ const serializeAws_json1_1UpdateWorkspaceImagePermissionRequest = ( context: __SerdeContext ): any => { return { - ...(input.AllowCopyImage !== undefined && { AllowCopyImage: input.AllowCopyImage }), - ...(input.ImageId !== undefined && { ImageId: input.ImageId }), - ...(input.SharedAccountId !== undefined && { SharedAccountId: input.SharedAccountId }), + ...(input.AllowCopyImage !== undefined && + input.AllowCopyImage !== null && { AllowCopyImage: input.AllowCopyImage }), + ...(input.ImageId !== undefined && input.ImageId !== null && { ImageId: input.ImageId }), + ...(input.SharedAccountId !== undefined && + input.SharedAccountId !== null && { SharedAccountId: input.SharedAccountId }), }; }; @@ -5517,13 +5618,17 @@ const serializeAws_json1_1WorkspaceAccessProperties = ( context: __SerdeContext ): any => { return { - ...(input.DeviceTypeAndroid !== undefined && { DeviceTypeAndroid: input.DeviceTypeAndroid }), - ...(input.DeviceTypeChromeOs !== undefined && { DeviceTypeChromeOs: input.DeviceTypeChromeOs }), - ...(input.DeviceTypeIos !== undefined && { DeviceTypeIos: input.DeviceTypeIos }), - ...(input.DeviceTypeOsx !== undefined && { DeviceTypeOsx: input.DeviceTypeOsx }), - ...(input.DeviceTypeWeb !== undefined && { DeviceTypeWeb: input.DeviceTypeWeb }), - ...(input.DeviceTypeWindows !== undefined && { DeviceTypeWindows: input.DeviceTypeWindows }), - ...(input.DeviceTypeZeroClient !== undefined && { DeviceTypeZeroClient: input.DeviceTypeZeroClient }), + ...(input.DeviceTypeAndroid !== undefined && + input.DeviceTypeAndroid !== null && { DeviceTypeAndroid: input.DeviceTypeAndroid }), + ...(input.DeviceTypeChromeOs !== undefined && + input.DeviceTypeChromeOs !== null && { DeviceTypeChromeOs: input.DeviceTypeChromeOs }), + ...(input.DeviceTypeIos !== undefined && input.DeviceTypeIos !== null && { DeviceTypeIos: input.DeviceTypeIos }), + ...(input.DeviceTypeOsx !== undefined && input.DeviceTypeOsx !== null && { DeviceTypeOsx: input.DeviceTypeOsx }), + ...(input.DeviceTypeWeb !== undefined && input.DeviceTypeWeb !== null && { DeviceTypeWeb: input.DeviceTypeWeb }), + ...(input.DeviceTypeWindows !== undefined && + input.DeviceTypeWindows !== null && { DeviceTypeWindows: input.DeviceTypeWindows }), + ...(input.DeviceTypeZeroClient !== undefined && + input.DeviceTypeZeroClient !== null && { DeviceTypeZeroClient: input.DeviceTypeZeroClient }), }; }; @@ -5532,58 +5637,88 @@ const serializeAws_json1_1WorkspaceCreationProperties = ( context: __SerdeContext ): any => { return { - ...(input.CustomSecurityGroupId !== undefined && { CustomSecurityGroupId: input.CustomSecurityGroupId }), - ...(input.DefaultOu !== undefined && { DefaultOu: input.DefaultOu }), - ...(input.EnableInternetAccess !== undefined && { EnableInternetAccess: input.EnableInternetAccess }), - ...(input.EnableMaintenanceMode !== undefined && { EnableMaintenanceMode: input.EnableMaintenanceMode }), - ...(input.EnableWorkDocs !== undefined && { EnableWorkDocs: input.EnableWorkDocs }), - ...(input.UserEnabledAsLocalAdministrator !== undefined && { - UserEnabledAsLocalAdministrator: input.UserEnabledAsLocalAdministrator, - }), + ...(input.CustomSecurityGroupId !== undefined && + input.CustomSecurityGroupId !== null && { CustomSecurityGroupId: input.CustomSecurityGroupId }), + ...(input.DefaultOu !== undefined && input.DefaultOu !== null && { DefaultOu: input.DefaultOu }), + ...(input.EnableInternetAccess !== undefined && + input.EnableInternetAccess !== null && { EnableInternetAccess: input.EnableInternetAccess }), + ...(input.EnableMaintenanceMode !== undefined && + input.EnableMaintenanceMode !== null && { EnableMaintenanceMode: input.EnableMaintenanceMode }), + ...(input.EnableWorkDocs !== undefined && + input.EnableWorkDocs !== null && { EnableWorkDocs: input.EnableWorkDocs }), + ...(input.UserEnabledAsLocalAdministrator !== undefined && + input.UserEnabledAsLocalAdministrator !== null && { + UserEnabledAsLocalAdministrator: input.UserEnabledAsLocalAdministrator, + }), }; }; const serializeAws_json1_1WorkspaceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1WorkspaceImageIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_json1_1WorkspaceProperties = (input: WorkspaceProperties, context: __SerdeContext): any => { return { - ...(input.ComputeTypeName !== undefined && { ComputeTypeName: input.ComputeTypeName }), - ...(input.RootVolumeSizeGib !== undefined && { RootVolumeSizeGib: input.RootVolumeSizeGib }), - ...(input.RunningMode !== undefined && { RunningMode: input.RunningMode }), - ...(input.RunningModeAutoStopTimeoutInMinutes !== undefined && { - RunningModeAutoStopTimeoutInMinutes: input.RunningModeAutoStopTimeoutInMinutes, - }), - ...(input.UserVolumeSizeGib !== undefined && { UserVolumeSizeGib: input.UserVolumeSizeGib }), + ...(input.ComputeTypeName !== undefined && + input.ComputeTypeName !== null && { ComputeTypeName: input.ComputeTypeName }), + ...(input.RootVolumeSizeGib !== undefined && + input.RootVolumeSizeGib !== null && { RootVolumeSizeGib: input.RootVolumeSizeGib }), + ...(input.RunningMode !== undefined && input.RunningMode !== null && { RunningMode: input.RunningMode }), + ...(input.RunningModeAutoStopTimeoutInMinutes !== undefined && + input.RunningModeAutoStopTimeoutInMinutes !== null && { + RunningModeAutoStopTimeoutInMinutes: input.RunningModeAutoStopTimeoutInMinutes, + }), + ...(input.UserVolumeSizeGib !== undefined && + input.UserVolumeSizeGib !== null && { UserVolumeSizeGib: input.UserVolumeSizeGib }), }; }; const serializeAws_json1_1WorkspaceRequest = (input: WorkspaceRequest, context: __SerdeContext): any => { return { - ...(input.BundleId !== undefined && { BundleId: input.BundleId }), - ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), - ...(input.RootVolumeEncryptionEnabled !== undefined && { - RootVolumeEncryptionEnabled: input.RootVolumeEncryptionEnabled, - }), - ...(input.Tags !== undefined && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), - ...(input.UserName !== undefined && { UserName: input.UserName }), - ...(input.UserVolumeEncryptionEnabled !== undefined && { - UserVolumeEncryptionEnabled: input.UserVolumeEncryptionEnabled, - }), - ...(input.VolumeEncryptionKey !== undefined && { VolumeEncryptionKey: input.VolumeEncryptionKey }), - ...(input.WorkspaceProperties !== undefined && { - WorkspaceProperties: serializeAws_json1_1WorkspaceProperties(input.WorkspaceProperties, context), - }), + ...(input.BundleId !== undefined && input.BundleId !== null && { BundleId: input.BundleId }), + ...(input.DirectoryId !== undefined && input.DirectoryId !== null && { DirectoryId: input.DirectoryId }), + ...(input.RootVolumeEncryptionEnabled !== undefined && + input.RootVolumeEncryptionEnabled !== null && { RootVolumeEncryptionEnabled: input.RootVolumeEncryptionEnabled }), + ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }), + ...(input.UserName !== undefined && input.UserName !== null && { UserName: input.UserName }), + ...(input.UserVolumeEncryptionEnabled !== undefined && + input.UserVolumeEncryptionEnabled !== null && { UserVolumeEncryptionEnabled: input.UserVolumeEncryptionEnabled }), + ...(input.VolumeEncryptionKey !== undefined && + input.VolumeEncryptionKey !== null && { VolumeEncryptionKey: input.VolumeEncryptionKey }), + ...(input.WorkspaceProperties !== undefined && + input.WorkspaceProperties !== null && { + WorkspaceProperties: serializeAws_json1_1WorkspaceProperties(input.WorkspaceProperties, context), + }), }; }; const serializeAws_json1_1WorkspaceRequestList = (input: WorkspaceRequest[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_json1_1WorkspaceRequest(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_json1_1WorkspaceRequest(entry, context); + }); }; const deserializeAws_json1_1AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => { @@ -5616,7 +5751,14 @@ const deserializeAws_json1_1AccountModification = (output: any, context: __Serde }; const deserializeAws_json1_1AccountModificationList = (output: any, context: __SerdeContext): AccountModification[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1AccountModification(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AccountModification(entry, context); + }); }; const deserializeAws_json1_1AssociateConnectionAliasResult = ( @@ -5643,7 +5785,14 @@ const deserializeAws_json1_1AuthorizeIpRulesResult = (output: any, context: __Se }; const deserializeAws_json1_1BundleList = (output: any, context: __SerdeContext): WorkspaceBundle[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WorkspaceBundle(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WorkspaceBundle(entry, context); + }); }; const deserializeAws_json1_1ClientProperties = (output: any, context: __SerdeContext): ClientProperties => { @@ -5654,7 +5803,14 @@ const deserializeAws_json1_1ClientProperties = (output: any, context: __SerdeCon }; const deserializeAws_json1_1ClientPropertiesList = (output: any, context: __SerdeContext): ClientPropertiesResult[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ClientPropertiesResult(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ClientPropertiesResult(entry, context); + }); }; const deserializeAws_json1_1ClientPropertiesResult = (output: any, context: __SerdeContext): ClientPropertiesResult => { @@ -5713,11 +5869,25 @@ const deserializeAws_json1_1ConnectionAliasAssociationList = ( output: any, context: __SerdeContext ): ConnectionAliasAssociation[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConnectionAliasAssociation(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConnectionAliasAssociation(entry, context); + }); }; const deserializeAws_json1_1ConnectionAliasList = (output: any, context: __SerdeContext): ConnectionAlias[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConnectionAlias(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConnectionAlias(entry, context); + }); }; const deserializeAws_json1_1ConnectionAliasPermission = ( @@ -5736,7 +5906,14 @@ const deserializeAws_json1_1ConnectionAliasPermissions = ( output: any, context: __SerdeContext ): ConnectionAliasPermission[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ConnectionAliasPermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ConnectionAliasPermission(entry, context); + }); }; const deserializeAws_json1_1CopyWorkspaceImageResult = ( @@ -5781,7 +5958,14 @@ const deserializeAws_json1_1CreateWorkspacesResult = (output: any, context: __Se }; const deserializeAws_json1_1DedicatedTenancyCidrRangeList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1DefaultWorkspaceCreationProperties = ( @@ -6020,7 +6204,14 @@ const deserializeAws_json1_1DescribeWorkspacesResult = ( }; const deserializeAws_json1_1DirectoryList = (output: any, context: __SerdeContext): WorkspaceDirectory[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WorkspaceDirectory(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WorkspaceDirectory(entry, context); + }); }; const deserializeAws_json1_1DisassociateConnectionAliasResult = ( @@ -6038,7 +6229,14 @@ const deserializeAws_json1_1DisassociateIpGroupsResult = ( }; const deserializeAws_json1_1DnsIpAddresses = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1FailedCreateWorkspaceRequest = ( @@ -6059,42 +6257,84 @@ const deserializeAws_json1_1FailedCreateWorkspaceRequests = ( output: any, context: __SerdeContext ): FailedCreateWorkspaceRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedCreateWorkspaceRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedCreateWorkspaceRequest(entry, context); + }); }; const deserializeAws_json1_1FailedRebootWorkspaceRequests = ( output: any, context: __SerdeContext ): FailedWorkspaceChangeRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context); + }); }; const deserializeAws_json1_1FailedRebuildWorkspaceRequests = ( output: any, context: __SerdeContext ): FailedWorkspaceChangeRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context); + }); }; const deserializeAws_json1_1FailedStartWorkspaceRequests = ( output: any, context: __SerdeContext ): FailedWorkspaceChangeRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context); + }); }; const deserializeAws_json1_1FailedStopWorkspaceRequests = ( output: any, context: __SerdeContext ): FailedWorkspaceChangeRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context); + }); }; const deserializeAws_json1_1FailedTerminateWorkspaceRequests = ( output: any, context: __SerdeContext ): FailedWorkspaceChangeRequest[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1FailedWorkspaceChangeRequest(entry, context); + }); }; const deserializeAws_json1_1FailedWorkspaceChangeRequest = ( @@ -6116,7 +6356,14 @@ const deserializeAws_json1_1ImagePermission = (output: any, context: __SerdeCont }; const deserializeAws_json1_1ImagePermissions = (output: any, context: __SerdeContext): ImagePermission[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ImagePermission(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ImagePermission(entry, context); + }); }; const deserializeAws_json1_1ImportWorkspaceImageResult = ( @@ -6147,7 +6394,14 @@ const deserializeAws_json1_1InvalidResourceStateException = ( }; const deserializeAws_json1_1IpGroupIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1IpRuleItem = (output: any, context: __SerdeContext): IpRuleItem => { @@ -6158,7 +6412,14 @@ const deserializeAws_json1_1IpRuleItem = (output: any, context: __SerdeContext): }; const deserializeAws_json1_1IpRuleList = (output: any, context: __SerdeContext): IpRuleItem[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1IpRuleItem(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1IpRuleItem(entry, context); + }); }; const deserializeAws_json1_1ListAvailableManagementCidrRangesResult = ( @@ -6195,7 +6456,14 @@ const deserializeAws_json1_1ModificationState = (output: any, context: __SerdeCo }; const deserializeAws_json1_1ModificationStateList = (output: any, context: __SerdeContext): ModificationState[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1ModificationState(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1ModificationState(entry, context); + }); }; const deserializeAws_json1_1ModifyAccountResult = (output: any, context: __SerdeContext): ModifyAccountResult => { @@ -6397,7 +6665,14 @@ const deserializeAws_json1_1Snapshot = (output: any, context: __SerdeContext): S }; const deserializeAws_json1_1SnapshotList = (output: any, context: __SerdeContext): Snapshot[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Snapshot(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Snapshot(entry, context); + }); }; const deserializeAws_json1_1StartWorkspacesResult = (output: any, context: __SerdeContext): StartWorkspacesResult => { @@ -6419,7 +6694,14 @@ const deserializeAws_json1_1StopWorkspacesResult = (output: any, context: __Serd }; const deserializeAws_json1_1SubnetIds = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => { @@ -6430,7 +6712,14 @@ const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => }; const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Tag(entry, context); + }); }; const deserializeAws_json1_1TerminateWorkspacesResult = ( @@ -6604,7 +6893,14 @@ const deserializeAws_json1_1WorkspaceConnectionStatusList = ( output: any, context: __SerdeContext ): WorkspaceConnectionStatus[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WorkspaceConnectionStatus(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WorkspaceConnectionStatus(entry, context); + }); }; const deserializeAws_json1_1WorkspaceDirectory = (output: any, context: __SerdeContext): WorkspaceDirectory => { @@ -6675,11 +6971,25 @@ const deserializeAws_json1_1WorkspaceImage = (output: any, context: __SerdeConte }; const deserializeAws_json1_1WorkspaceImageList = (output: any, context: __SerdeContext): WorkspaceImage[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WorkspaceImage(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WorkspaceImage(entry, context); + }); }; const deserializeAws_json1_1WorkspaceList = (output: any, context: __SerdeContext): Workspace[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1Workspace(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1Workspace(entry, context); + }); }; const deserializeAws_json1_1WorkspaceProperties = (output: any, context: __SerdeContext): WorkspaceProperties => { @@ -6752,7 +7062,14 @@ const deserializeAws_json1_1WorkspacesIpGroup = (output: any, context: __SerdeCo }; const deserializeAws_json1_1WorkspacesIpGroupsList = (output: any, context: __SerdeContext): WorkspacesIpGroup[] => { - return (output || []).map((entry: any) => deserializeAws_json1_1WorkspacesIpGroup(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1WorkspacesIpGroup(entry, context); + }); }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ @@ -6805,3 +7122,36 @@ const parseBody = (streamBody: any, context: __SerdeContext): any => } return {}; }); + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string): string => { + let cleanValue = rawValue; + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } + + return ""; +}; diff --git a/clients/client-xray/protocols/Aws_restJson1.ts b/clients/client-xray/protocols/Aws_restJson1.ts index 0a6b5ca17c9a..3528637b7059 100644 --- a/clients/client-xray/protocols/Aws_restJson1.ts +++ b/clients/client-xray/protocols/Aws_restJson1.ts @@ -126,13 +126,14 @@ export const serializeAws_restJson1BatchGetTracesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/Traces"; let body: any; body = JSON.stringify({ - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TraceIds !== undefined && { TraceIds: serializeAws_restJson1TraceIdList(input.TraceIds, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TraceIds !== undefined && + input.TraceIds !== null && { TraceIds: serializeAws_restJson1TraceIdList(input.TraceIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -151,17 +152,20 @@ export const serializeAws_restJson1CreateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateGroup"; let body: any; body = JSON.stringify({ - ...(input.FilterExpression !== undefined && { FilterExpression: input.FilterExpression }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.InsightsConfiguration !== undefined && { - InsightsConfiguration: serializeAws_restJson1InsightsConfiguration(input.InsightsConfiguration, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.FilterExpression !== undefined && + input.FilterExpression !== null && { FilterExpression: input.FilterExpression }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.InsightsConfiguration !== undefined && + input.InsightsConfiguration !== null && { + InsightsConfiguration: serializeAws_restJson1InsightsConfiguration(input.InsightsConfiguration, context), + }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -180,15 +184,15 @@ export const serializeAws_restJson1CreateSamplingRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/CreateSamplingRule"; let body: any; body = JSON.stringify({ - ...(input.SamplingRule !== undefined && { - SamplingRule: serializeAws_restJson1SamplingRule(input.SamplingRule, context), - }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.SamplingRule !== undefined && + input.SamplingRule !== null && { SamplingRule: serializeAws_restJson1SamplingRule(input.SamplingRule, context) }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -207,13 +211,13 @@ export const serializeAws_restJson1DeleteGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DeleteGroup"; let body: any; body = JSON.stringify({ - ...(input.GroupARN !== undefined && { GroupARN: input.GroupARN }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.GroupARN !== undefined && input.GroupARN !== null && { GroupARN: input.GroupARN }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -232,13 +236,13 @@ export const serializeAws_restJson1DeleteSamplingRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/DeleteSamplingRule"; let body: any; body = JSON.stringify({ - ...(input.RuleARN !== undefined && { RuleARN: input.RuleARN }), - ...(input.RuleName !== undefined && { RuleName: input.RuleName }), + ...(input.RuleARN !== undefined && input.RuleARN !== null && { RuleARN: input.RuleARN }), + ...(input.RuleName !== undefined && input.RuleName !== null && { RuleName: input.RuleName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -256,12 +260,10 @@ export const serializeAws_restJson1GetEncryptionConfigCommand = async ( input: GetEncryptionConfigCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "Content-Type": "", - }; + const headers: any = {}; let resolvedPath = "/EncryptionConfig"; let body: any; - body = "{}"; + body = ""; const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ protocol, @@ -279,13 +281,13 @@ export const serializeAws_restJson1GetGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/GetGroup"; let body: any; body = JSON.stringify({ - ...(input.GroupARN !== undefined && { GroupARN: input.GroupARN }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.GroupARN !== undefined && input.GroupARN !== null && { GroupARN: input.GroupARN }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -304,12 +306,12 @@ export const serializeAws_restJson1GetGroupsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/Groups"; let body: any; body = JSON.stringify({ - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -328,12 +330,12 @@ export const serializeAws_restJson1GetInsightCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/Insight"; let body: any; body = JSON.stringify({ - ...(input.InsightId !== undefined && { InsightId: input.InsightId }), + ...(input.InsightId !== undefined && input.InsightId !== null && { InsightId: input.InsightId }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -352,14 +354,14 @@ export const serializeAws_restJson1GetInsightEventsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/InsightEvents"; let body: any; body = JSON.stringify({ - ...(input.InsightId !== undefined && { InsightId: input.InsightId }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.InsightId !== undefined && input.InsightId !== null && { InsightId: input.InsightId }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -378,15 +380,17 @@ export const serializeAws_restJson1GetInsightImpactGraphCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/InsightImpactGraph"; let body: any; body = JSON.stringify({ - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.InsightId !== undefined && { InsightId: input.InsightId }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.InsightId !== undefined && input.InsightId !== null && { InsightId: input.InsightId }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -405,18 +409,21 @@ export const serializeAws_restJson1GetInsightSummariesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/InsightSummaries"; let body: any; body = JSON.stringify({ - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.GroupARN !== undefined && { GroupARN: input.GroupARN }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), - ...(input.States !== undefined && { States: serializeAws_restJson1InsightStateList(input.States, context) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.GroupARN !== undefined && input.GroupARN !== null && { GroupARN: input.GroupARN }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.States !== undefined && + input.States !== null && { States: serializeAws_restJson1InsightStateList(input.States, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -435,12 +442,12 @@ export const serializeAws_restJson1GetSamplingRulesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/GetSamplingRules"; let body: any; body = JSON.stringify({ - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -459,12 +466,12 @@ export const serializeAws_restJson1GetSamplingStatisticSummariesCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/SamplingStatisticSummaries"; let body: any; body = JSON.stringify({ - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -483,17 +490,18 @@ export const serializeAws_restJson1GetSamplingTargetsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/SamplingTargets"; let body: any; body = JSON.stringify({ - ...(input.SamplingStatisticsDocuments !== undefined && { - SamplingStatisticsDocuments: serializeAws_restJson1SamplingStatisticsDocumentList( - input.SamplingStatisticsDocuments, - context - ), - }), + ...(input.SamplingStatisticsDocuments !== undefined && + input.SamplingStatisticsDocuments !== null && { + SamplingStatisticsDocuments: serializeAws_restJson1SamplingStatisticsDocumentList( + input.SamplingStatisticsDocuments, + context + ), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -512,16 +520,18 @@ export const serializeAws_restJson1GetServiceGraphCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ServiceGraph"; let body: any; body = JSON.stringify({ - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.GroupARN !== undefined && { GroupARN: input.GroupARN }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.GroupARN !== undefined && input.GroupARN !== null && { GroupARN: input.GroupARN }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -540,19 +550,23 @@ export const serializeAws_restJson1GetTimeSeriesServiceStatisticsCommand = async context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/TimeSeriesServiceStatistics"; let body: any; body = JSON.stringify({ - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.EntitySelectorExpression !== undefined && { EntitySelectorExpression: input.EntitySelectorExpression }), - ...(input.ForecastStatistics !== undefined && { ForecastStatistics: input.ForecastStatistics }), - ...(input.GroupARN !== undefined && { GroupARN: input.GroupARN }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Period !== undefined && { Period: input.Period }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.EntitySelectorExpression !== undefined && + input.EntitySelectorExpression !== null && { EntitySelectorExpression: input.EntitySelectorExpression }), + ...(input.ForecastStatistics !== undefined && + input.ForecastStatistics !== null && { ForecastStatistics: input.ForecastStatistics }), + ...(input.GroupARN !== undefined && input.GroupARN !== null && { GroupARN: input.GroupARN }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Period !== undefined && input.Period !== null && { Period: input.Period }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -571,13 +585,14 @@ export const serializeAws_restJson1GetTraceGraphCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/TraceGraph"; let body: any; body = JSON.stringify({ - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.TraceIds !== undefined && { TraceIds: serializeAws_restJson1TraceIdList(input.TraceIds, context) }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.TraceIds !== undefined && + input.TraceIds !== null && { TraceIds: serializeAws_restJson1TraceIdList(input.TraceIds, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -596,20 +611,24 @@ export const serializeAws_restJson1GetTraceSummariesCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/TraceSummaries"; let body: any; body = JSON.stringify({ - ...(input.EndTime !== undefined && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), - ...(input.FilterExpression !== undefined && { FilterExpression: input.FilterExpression }), - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.Sampling !== undefined && { Sampling: input.Sampling }), - ...(input.SamplingStrategy !== undefined && { - SamplingStrategy: serializeAws_restJson1SamplingStrategy(input.SamplingStrategy, context), - }), - ...(input.StartTime !== undefined && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), - ...(input.TimeRangeType !== undefined && { TimeRangeType: input.TimeRangeType }), + ...(input.EndTime !== undefined && + input.EndTime !== null && { EndTime: Math.round(input.EndTime.getTime() / 1000) }), + ...(input.FilterExpression !== undefined && + input.FilterExpression !== null && { FilterExpression: input.FilterExpression }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.Sampling !== undefined && input.Sampling !== null && { Sampling: input.Sampling }), + ...(input.SamplingStrategy !== undefined && + input.SamplingStrategy !== null && { + SamplingStrategy: serializeAws_restJson1SamplingStrategy(input.SamplingStrategy, context), + }), + ...(input.StartTime !== undefined && + input.StartTime !== null && { StartTime: Math.round(input.StartTime.getTime() / 1000) }), + ...(input.TimeRangeType !== undefined && input.TimeRangeType !== null && { TimeRangeType: input.TimeRangeType }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -628,13 +647,13 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/ListTagsForResource"; let body: any; body = JSON.stringify({ - ...(input.NextToken !== undefined && { NextToken: input.NextToken }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -653,13 +672,13 @@ export const serializeAws_restJson1PutEncryptionConfigCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/PutEncryptionConfig"; let body: any; body = JSON.stringify({ - ...(input.KeyId !== undefined && { KeyId: input.KeyId }), - ...(input.Type !== undefined && { Type: input.Type }), + ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }), + ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -678,17 +697,18 @@ export const serializeAws_restJson1PutTelemetryRecordsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/TelemetryRecords"; let body: any; body = JSON.stringify({ - ...(input.EC2InstanceId !== undefined && { EC2InstanceId: input.EC2InstanceId }), - ...(input.Hostname !== undefined && { Hostname: input.Hostname }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TelemetryRecords !== undefined && { - TelemetryRecords: serializeAws_restJson1TelemetryRecordList(input.TelemetryRecords, context), - }), + ...(input.EC2InstanceId !== undefined && input.EC2InstanceId !== null && { EC2InstanceId: input.EC2InstanceId }), + ...(input.Hostname !== undefined && input.Hostname !== null && { Hostname: input.Hostname }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TelemetryRecords !== undefined && + input.TelemetryRecords !== null && { + TelemetryRecords: serializeAws_restJson1TelemetryRecordList(input.TelemetryRecords, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -707,14 +727,15 @@ export const serializeAws_restJson1PutTraceSegmentsCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/TraceSegments"; let body: any; body = JSON.stringify({ - ...(input.TraceSegmentDocuments !== undefined && { - TraceSegmentDocuments: serializeAws_restJson1TraceSegmentDocumentList(input.TraceSegmentDocuments, context), - }), + ...(input.TraceSegmentDocuments !== undefined && + input.TraceSegmentDocuments !== null && { + TraceSegmentDocuments: serializeAws_restJson1TraceSegmentDocumentList(input.TraceSegmentDocuments, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -733,13 +754,14 @@ export const serializeAws_restJson1TagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/TagResource"; let body: any; body = JSON.stringify({ - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.Tags !== undefined && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && + input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -758,13 +780,14 @@ export const serializeAws_restJson1UntagResourceCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UntagResource"; let body: any; body = JSON.stringify({ - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.TagKeys !== undefined && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && + input.TagKeys !== null && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -783,17 +806,19 @@ export const serializeAws_restJson1UpdateGroupCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UpdateGroup"; let body: any; body = JSON.stringify({ - ...(input.FilterExpression !== undefined && { FilterExpression: input.FilterExpression }), - ...(input.GroupARN !== undefined && { GroupARN: input.GroupARN }), - ...(input.GroupName !== undefined && { GroupName: input.GroupName }), - ...(input.InsightsConfiguration !== undefined && { - InsightsConfiguration: serializeAws_restJson1InsightsConfiguration(input.InsightsConfiguration, context), - }), + ...(input.FilterExpression !== undefined && + input.FilterExpression !== null && { FilterExpression: input.FilterExpression }), + ...(input.GroupARN !== undefined && input.GroupARN !== null && { GroupARN: input.GroupARN }), + ...(input.GroupName !== undefined && input.GroupName !== null && { GroupName: input.GroupName }), + ...(input.InsightsConfiguration !== undefined && + input.InsightsConfiguration !== null && { + InsightsConfiguration: serializeAws_restJson1InsightsConfiguration(input.InsightsConfiguration, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -812,14 +837,15 @@ export const serializeAws_restJson1UpdateSamplingRuleCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "Content-Type": "application/json", + "content-type": "application/json", }; let resolvedPath = "/UpdateSamplingRule"; let body: any; body = JSON.stringify({ - ...(input.SamplingRuleUpdate !== undefined && { - SamplingRuleUpdate: serializeAws_restJson1SamplingRuleUpdate(input.SamplingRuleUpdate, context), - }), + ...(input.SamplingRuleUpdate !== undefined && + input.SamplingRuleUpdate !== null && { + SamplingRuleUpdate: serializeAws_restJson1SamplingRuleUpdate(input.SamplingRuleUpdate, context), + }), }); const { hostname, protocol = "https", port } = await context.endpoint(); return new __HttpRequest({ @@ -2771,13 +2797,15 @@ const deserializeAws_restJson1TooManyTagsExceptionResponse = async ( }; const serializeAws_restJson1AttributeMap = (input: { [key: string]: string }, context: __SerdeContext): any => { - return Object.entries(input).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const serializeAws_restJson1BackendConnectionErrors = ( @@ -2785,62 +2813,73 @@ const serializeAws_restJson1BackendConnectionErrors = ( context: __SerdeContext ): any => { return { - ...(input.ConnectionRefusedCount !== undefined && { ConnectionRefusedCount: input.ConnectionRefusedCount }), - ...(input.HTTPCode4XXCount !== undefined && { HTTPCode4XXCount: input.HTTPCode4XXCount }), - ...(input.HTTPCode5XXCount !== undefined && { HTTPCode5XXCount: input.HTTPCode5XXCount }), - ...(input.OtherCount !== undefined && { OtherCount: input.OtherCount }), - ...(input.TimeoutCount !== undefined && { TimeoutCount: input.TimeoutCount }), - ...(input.UnknownHostCount !== undefined && { UnknownHostCount: input.UnknownHostCount }), + ...(input.ConnectionRefusedCount !== undefined && + input.ConnectionRefusedCount !== null && { ConnectionRefusedCount: input.ConnectionRefusedCount }), + ...(input.HTTPCode4XXCount !== undefined && + input.HTTPCode4XXCount !== null && { HTTPCode4XXCount: input.HTTPCode4XXCount }), + ...(input.HTTPCode5XXCount !== undefined && + input.HTTPCode5XXCount !== null && { HTTPCode5XXCount: input.HTTPCode5XXCount }), + ...(input.OtherCount !== undefined && input.OtherCount !== null && { OtherCount: input.OtherCount }), + ...(input.TimeoutCount !== undefined && input.TimeoutCount !== null && { TimeoutCount: input.TimeoutCount }), + ...(input.UnknownHostCount !== undefined && + input.UnknownHostCount !== null && { UnknownHostCount: input.UnknownHostCount }), }; }; const serializeAws_restJson1InsightsConfiguration = (input: InsightsConfiguration, context: __SerdeContext): any => { return { - ...(input.InsightsEnabled !== undefined && { InsightsEnabled: input.InsightsEnabled }), - ...(input.NotificationsEnabled !== undefined && { NotificationsEnabled: input.NotificationsEnabled }), + ...(input.InsightsEnabled !== undefined && + input.InsightsEnabled !== null && { InsightsEnabled: input.InsightsEnabled }), + ...(input.NotificationsEnabled !== undefined && + input.NotificationsEnabled !== null && { NotificationsEnabled: input.NotificationsEnabled }), }; }; const serializeAws_restJson1InsightStateList = (input: (InsightState | string)[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1SamplingRule = (input: SamplingRule, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1AttributeMap(input.Attributes, context), - }), - ...(input.FixedRate !== undefined && { FixedRate: input.FixedRate }), - ...(input.HTTPMethod !== undefined && { HTTPMethod: input.HTTPMethod }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.ReservoirSize !== undefined && { ReservoirSize: input.ReservoirSize }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.RuleARN !== undefined && { RuleARN: input.RuleARN }), - ...(input.RuleName !== undefined && { RuleName: input.RuleName }), - ...(input.ServiceName !== undefined && { ServiceName: input.ServiceName }), - ...(input.ServiceType !== undefined && { ServiceType: input.ServiceType }), - ...(input.URLPath !== undefined && { URLPath: input.URLPath }), - ...(input.Version !== undefined && { Version: input.Version }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1AttributeMap(input.Attributes, context) }), + ...(input.FixedRate !== undefined && input.FixedRate !== null && { FixedRate: input.FixedRate }), + ...(input.HTTPMethod !== undefined && input.HTTPMethod !== null && { HTTPMethod: input.HTTPMethod }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.ReservoirSize !== undefined && input.ReservoirSize !== null && { ReservoirSize: input.ReservoirSize }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.RuleARN !== undefined && input.RuleARN !== null && { RuleARN: input.RuleARN }), + ...(input.RuleName !== undefined && input.RuleName !== null && { RuleName: input.RuleName }), + ...(input.ServiceName !== undefined && input.ServiceName !== null && { ServiceName: input.ServiceName }), + ...(input.ServiceType !== undefined && input.ServiceType !== null && { ServiceType: input.ServiceType }), + ...(input.URLPath !== undefined && input.URLPath !== null && { URLPath: input.URLPath }), + ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }), }; }; const serializeAws_restJson1SamplingRuleUpdate = (input: SamplingRuleUpdate, context: __SerdeContext): any => { return { - ...(input.Attributes !== undefined && { - Attributes: serializeAws_restJson1AttributeMap(input.Attributes, context), - }), - ...(input.FixedRate !== undefined && { FixedRate: input.FixedRate }), - ...(input.HTTPMethod !== undefined && { HTTPMethod: input.HTTPMethod }), - ...(input.Host !== undefined && { Host: input.Host }), - ...(input.Priority !== undefined && { Priority: input.Priority }), - ...(input.ReservoirSize !== undefined && { ReservoirSize: input.ReservoirSize }), - ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), - ...(input.RuleARN !== undefined && { RuleARN: input.RuleARN }), - ...(input.RuleName !== undefined && { RuleName: input.RuleName }), - ...(input.ServiceName !== undefined && { ServiceName: input.ServiceName }), - ...(input.ServiceType !== undefined && { ServiceType: input.ServiceType }), - ...(input.URLPath !== undefined && { URLPath: input.URLPath }), + ...(input.Attributes !== undefined && + input.Attributes !== null && { Attributes: serializeAws_restJson1AttributeMap(input.Attributes, context) }), + ...(input.FixedRate !== undefined && input.FixedRate !== null && { FixedRate: input.FixedRate }), + ...(input.HTTPMethod !== undefined && input.HTTPMethod !== null && { HTTPMethod: input.HTTPMethod }), + ...(input.Host !== undefined && input.Host !== null && { Host: input.Host }), + ...(input.Priority !== undefined && input.Priority !== null && { Priority: input.Priority }), + ...(input.ReservoirSize !== undefined && input.ReservoirSize !== null && { ReservoirSize: input.ReservoirSize }), + ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), + ...(input.RuleARN !== undefined && input.RuleARN !== null && { RuleARN: input.RuleARN }), + ...(input.RuleName !== undefined && input.RuleName !== null && { RuleName: input.RuleName }), + ...(input.ServiceName !== undefined && input.ServiceName !== null && { ServiceName: input.ServiceName }), + ...(input.ServiceType !== undefined && input.ServiceType !== null && { ServiceType: input.ServiceType }), + ...(input.URLPath !== undefined && input.URLPath !== null && { URLPath: input.URLPath }), }; }; @@ -2849,12 +2888,13 @@ const serializeAws_restJson1SamplingStatisticsDocument = ( context: __SerdeContext ): any => { return { - ...(input.BorrowCount !== undefined && { BorrowCount: input.BorrowCount }), - ...(input.ClientID !== undefined && { ClientID: input.ClientID }), - ...(input.RequestCount !== undefined && { RequestCount: input.RequestCount }), - ...(input.RuleName !== undefined && { RuleName: input.RuleName }), - ...(input.SampledCount !== undefined && { SampledCount: input.SampledCount }), - ...(input.Timestamp !== undefined && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), + ...(input.BorrowCount !== undefined && input.BorrowCount !== null && { BorrowCount: input.BorrowCount }), + ...(input.ClientID !== undefined && input.ClientID !== null && { ClientID: input.ClientID }), + ...(input.RequestCount !== undefined && input.RequestCount !== null && { RequestCount: input.RequestCount }), + ...(input.RuleName !== undefined && input.RuleName !== null && { RuleName: input.RuleName }), + ...(input.SampledCount !== undefined && input.SampledCount !== null && { SampledCount: input.SampledCount }), + ...(input.Timestamp !== undefined && + input.Timestamp !== null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), }; }; @@ -2862,54 +2902,102 @@ const serializeAws_restJson1SamplingStatisticsDocumentList = ( input: SamplingStatisticsDocument[], context: __SerdeContext ): any => { - return input.map((entry) => serializeAws_restJson1SamplingStatisticsDocument(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1SamplingStatisticsDocument(entry, context); + }); }; const serializeAws_restJson1SamplingStrategy = (input: SamplingStrategy, context: __SerdeContext): any => { return { - ...(input.Name !== undefined && { Name: input.Name }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => { return { - ...(input.Key !== undefined && { Key: input.Key }), - ...(input.Value !== undefined && { Value: input.Value }), + ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }), + ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }), }; }; const serializeAws_restJson1TagKeyList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TagList = (input: Tag[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1Tag(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1Tag(entry, context); + }); }; const serializeAws_restJson1TelemetryRecord = (input: TelemetryRecord, context: __SerdeContext): any => { return { - ...(input.BackendConnectionErrors !== undefined && { - BackendConnectionErrors: serializeAws_restJson1BackendConnectionErrors(input.BackendConnectionErrors, context), - }), - ...(input.SegmentsReceivedCount !== undefined && { SegmentsReceivedCount: input.SegmentsReceivedCount }), - ...(input.SegmentsRejectedCount !== undefined && { SegmentsRejectedCount: input.SegmentsRejectedCount }), - ...(input.SegmentsSentCount !== undefined && { SegmentsSentCount: input.SegmentsSentCount }), - ...(input.SegmentsSpilloverCount !== undefined && { SegmentsSpilloverCount: input.SegmentsSpilloverCount }), - ...(input.Timestamp !== undefined && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), + ...(input.BackendConnectionErrors !== undefined && + input.BackendConnectionErrors !== null && { + BackendConnectionErrors: serializeAws_restJson1BackendConnectionErrors(input.BackendConnectionErrors, context), + }), + ...(input.SegmentsReceivedCount !== undefined && + input.SegmentsReceivedCount !== null && { SegmentsReceivedCount: input.SegmentsReceivedCount }), + ...(input.SegmentsRejectedCount !== undefined && + input.SegmentsRejectedCount !== null && { SegmentsRejectedCount: input.SegmentsRejectedCount }), + ...(input.SegmentsSentCount !== undefined && + input.SegmentsSentCount !== null && { SegmentsSentCount: input.SegmentsSentCount }), + ...(input.SegmentsSpilloverCount !== undefined && + input.SegmentsSpilloverCount !== null && { SegmentsSpilloverCount: input.SegmentsSpilloverCount }), + ...(input.Timestamp !== undefined && + input.Timestamp !== null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }), }; }; const serializeAws_restJson1TelemetryRecordList = (input: TelemetryRecord[], context: __SerdeContext): any => { - return input.map((entry) => serializeAws_restJson1TelemetryRecord(entry, context)); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return serializeAws_restJson1TelemetryRecord(entry, context); + }); }; const serializeAws_restJson1TraceIdList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const serializeAws_restJson1TraceSegmentDocumentList = (input: string[], context: __SerdeContext): any => { - return input.map((entry) => entry); + return input + .filter((e: any) => e != null) + .map((entry) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Alias = (output: any, context: __SerdeContext): Alias => { @@ -2924,24 +3012,40 @@ const deserializeAws_restJson1Alias = (output: any, context: __SerdeContext): Al }; const deserializeAws_restJson1AliasList = (output: any, context: __SerdeContext): Alias[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Alias(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Alias(entry, context); + }); }; const deserializeAws_restJson1AliasNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1Annotations = ( output: any, context: __SerdeContext ): { [key: string]: ValueWithServiceIds[] } => { - return Object.entries(output).reduce( - (acc: { [key: string]: ValueWithServiceIds[] }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: ValueWithServiceIds[] }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: deserializeAws_restJson1ValuesWithServiceIds(value, context), - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AnnotationValue = (output: any, context: __SerdeContext): AnnotationValue => { @@ -2962,17 +3066,26 @@ const deserializeAws_restJson1AnomalousService = (output: any, context: __SerdeC }; const deserializeAws_restJson1AnomalousServiceList = (output: any, context: __SerdeContext): AnomalousService[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AnomalousService(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AnomalousService(entry, context); + }); }; const deserializeAws_restJson1AttributeMap = (output: any, context: __SerdeContext): { [key: string]: string } => { - return Object.entries(output).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => ({ + return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + return { ...acc, [key]: value, - }), - {} - ); + }; + }, {}); }; const deserializeAws_restJson1AvailabilityZoneDetail = ( @@ -3009,7 +3122,14 @@ const deserializeAws_restJson1Edge = (output: any, context: __SerdeContext): Edg }; const deserializeAws_restJson1EdgeList = (output: any, context: __SerdeContext): Edge[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Edge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Edge(entry, context); + }); }; const deserializeAws_restJson1EdgeStatistics = (output: any, context: __SerdeContext): EdgeStatistics => { @@ -3065,11 +3185,25 @@ const deserializeAws_restJson1ErrorRootCauseEntityPath = ( output: any, context: __SerdeContext ): ErrorRootCauseEntity[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ErrorRootCauseEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ErrorRootCauseEntity(entry, context); + }); }; const deserializeAws_restJson1ErrorRootCauses = (output: any, context: __SerdeContext): ErrorRootCause[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ErrorRootCause(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ErrorRootCause(entry, context); + }); }; const deserializeAws_restJson1ErrorRootCauseService = (output: any, context: __SerdeContext): ErrorRootCauseService => { @@ -3093,7 +3227,14 @@ const deserializeAws_restJson1ErrorRootCauseServices = ( output: any, context: __SerdeContext ): ErrorRootCauseService[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ErrorRootCauseService(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ErrorRootCauseService(entry, context); + }); }; const deserializeAws_restJson1ErrorStatistics = (output: any, context: __SerdeContext): ErrorStatistics => { @@ -3131,11 +3272,25 @@ const deserializeAws_restJson1FaultRootCauseEntityPath = ( output: any, context: __SerdeContext ): FaultRootCauseEntity[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FaultRootCauseEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FaultRootCauseEntity(entry, context); + }); }; const deserializeAws_restJson1FaultRootCauses = (output: any, context: __SerdeContext): FaultRootCause[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FaultRootCause(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FaultRootCause(entry, context); + }); }; const deserializeAws_restJson1FaultRootCauseService = (output: any, context: __SerdeContext): FaultRootCauseService => { @@ -3159,7 +3314,14 @@ const deserializeAws_restJson1FaultRootCauseServices = ( output: any, context: __SerdeContext ): FaultRootCauseService[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1FaultRootCauseService(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1FaultRootCauseService(entry, context); + }); }; const deserializeAws_restJson1FaultStatistics = (output: any, context: __SerdeContext): FaultStatistics => { @@ -3205,11 +3367,25 @@ const deserializeAws_restJson1GroupSummary = (output: any, context: __SerdeConte }; const deserializeAws_restJson1GroupSummaryList = (output: any, context: __SerdeContext): GroupSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1GroupSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1GroupSummary(entry, context); + }); }; const deserializeAws_restJson1Histogram = (output: any, context: __SerdeContext): HistogramEntry[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1HistogramEntry(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HistogramEntry(entry, context); + }); }; const deserializeAws_restJson1HistogramEntry = (output: any, context: __SerdeContext): HistogramEntry => { @@ -3270,7 +3446,14 @@ const deserializeAws_restJson1InsightCategoryList = ( output: any, context: __SerdeContext ): (InsightCategory | string)[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1InsightEvent = (output: any, context: __SerdeContext): InsightEvent => { @@ -3297,7 +3480,14 @@ const deserializeAws_restJson1InsightEvent = (output: any, context: __SerdeConte }; const deserializeAws_restJson1InsightEventList = (output: any, context: __SerdeContext): InsightEvent[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InsightEvent(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InsightEvent(entry, context); + }); }; const deserializeAws_restJson1InsightImpactGraphEdge = ( @@ -3313,7 +3503,14 @@ const deserializeAws_restJson1InsightImpactGraphEdgeList = ( output: any, context: __SerdeContext ): InsightImpactGraphEdge[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InsightImpactGraphEdge(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InsightImpactGraphEdge(entry, context); + }); }; const deserializeAws_restJson1InsightImpactGraphService = ( @@ -3340,7 +3537,14 @@ const deserializeAws_restJson1InsightImpactGraphServiceList = ( output: any, context: __SerdeContext ): InsightImpactGraphService[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InsightImpactGraphService(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InsightImpactGraphService(entry, context); + }); }; const deserializeAws_restJson1InsightsConfiguration = (output: any, context: __SerdeContext): InsightsConfiguration => { @@ -3396,7 +3600,14 @@ const deserializeAws_restJson1InsightSummary = (output: any, context: __SerdeCon }; const deserializeAws_restJson1InsightSummaryList = (output: any, context: __SerdeContext): InsightSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InsightSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InsightSummary(entry, context); + }); }; const deserializeAws_restJson1InstanceIdDetail = (output: any, context: __SerdeContext): InstanceIdDetail => { @@ -3448,14 +3659,28 @@ const deserializeAws_restJson1ResponseTimeRootCauseEntityPath = ( output: any, context: __SerdeContext ): ResponseTimeRootCauseEntity[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResponseTimeRootCauseEntity(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResponseTimeRootCauseEntity(entry, context); + }); }; const deserializeAws_restJson1ResponseTimeRootCauses = ( output: any, context: __SerdeContext ): ResponseTimeRootCause[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResponseTimeRootCause(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResponseTimeRootCause(entry, context); + }); }; const deserializeAws_restJson1ResponseTimeRootCauseService = ( @@ -3482,7 +3707,14 @@ const deserializeAws_restJson1ResponseTimeRootCauseServices = ( output: any, context: __SerdeContext ): ResponseTimeRootCauseService[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResponseTimeRootCauseService(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResponseTimeRootCauseService(entry, context); + }); }; const deserializeAws_restJson1RootCauseException = (output: any, context: __SerdeContext): RootCauseException => { @@ -3493,7 +3725,14 @@ const deserializeAws_restJson1RootCauseException = (output: any, context: __Serd }; const deserializeAws_restJson1RootCauseExceptions = (output: any, context: __SerdeContext): RootCauseException[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1RootCauseException(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1RootCauseException(entry, context); + }); }; const deserializeAws_restJson1SamplingRule = (output: any, context: __SerdeContext): SamplingRule => { @@ -3536,7 +3775,14 @@ const deserializeAws_restJson1SamplingRuleRecord = (output: any, context: __Serd }; const deserializeAws_restJson1SamplingRuleRecordList = (output: any, context: __SerdeContext): SamplingRuleRecord[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SamplingRuleRecord(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SamplingRuleRecord(entry, context); + }); }; const deserializeAws_restJson1SamplingStatisticSummary = ( @@ -3559,7 +3805,14 @@ const deserializeAws_restJson1SamplingStatisticSummaryList = ( output: any, context: __SerdeContext ): SamplingStatisticSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SamplingStatisticSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SamplingStatisticSummary(entry, context); + }); }; const deserializeAws_restJson1SamplingTargetDocument = ( @@ -3583,7 +3836,14 @@ const deserializeAws_restJson1SamplingTargetDocumentList = ( output: any, context: __SerdeContext ): SamplingTargetDocument[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1SamplingTargetDocument(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1SamplingTargetDocument(entry, context); + }); }; const deserializeAws_restJson1Segment = (output: any, context: __SerdeContext): Segment => { @@ -3594,7 +3854,14 @@ const deserializeAws_restJson1Segment = (output: any, context: __SerdeContext): }; const deserializeAws_restJson1SegmentList = (output: any, context: __SerdeContext): Segment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Segment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Segment(entry, context); + }); }; const deserializeAws_restJson1Service = (output: any, context: __SerdeContext): Service => { @@ -3647,15 +3914,36 @@ const deserializeAws_restJson1ServiceId = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1ServiceIds = (output: any, context: __SerdeContext): ServiceId[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ServiceId(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ServiceId(entry, context); + }); }; const deserializeAws_restJson1ServiceList = (output: any, context: __SerdeContext): Service[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Service(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Service(entry, context); + }); }; const deserializeAws_restJson1ServiceNames = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1ServiceStatistics = (output: any, context: __SerdeContext): ServiceStatistics => { @@ -3685,7 +3973,14 @@ const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag }; const deserializeAws_restJson1TagList = (output: any, context: __SerdeContext): Tag[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Tag(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Tag(entry, context); + }); }; const deserializeAws_restJson1TimeSeriesServiceStatistics = ( @@ -3720,7 +4015,14 @@ const deserializeAws_restJson1TimeSeriesServiceStatisticsList = ( output: any, context: __SerdeContext ): TimeSeriesServiceStatistics[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TimeSeriesServiceStatistics(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TimeSeriesServiceStatistics(entry, context); + }); }; const deserializeAws_restJson1Trace = (output: any, context: __SerdeContext): Trace => { @@ -3740,19 +4042,47 @@ const deserializeAws_restJson1TraceAvailabilityZones = ( output: any, context: __SerdeContext ): AvailabilityZoneDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1AvailabilityZoneDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1AvailabilityZoneDetail(entry, context); + }); }; const deserializeAws_restJson1TraceInstanceIds = (output: any, context: __SerdeContext): InstanceIdDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1InstanceIdDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1InstanceIdDetail(entry, context); + }); }; const deserializeAws_restJson1TraceList = (output: any, context: __SerdeContext): Trace[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1Trace(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Trace(entry, context); + }); }; const deserializeAws_restJson1TraceResourceARNs = (output: any, context: __SerdeContext): ResourceARNDetail[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ResourceARNDetail(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResourceARNDetail(entry, context); + }); }; const deserializeAws_restJson1TraceSummary = (output: any, context: __SerdeContext): TraceSummary => { @@ -3817,7 +4147,14 @@ const deserializeAws_restJson1TraceSummary = (output: any, context: __SerdeConte }; const deserializeAws_restJson1TraceSummaryList = (output: any, context: __SerdeContext): TraceSummary[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TraceSummary(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TraceSummary(entry, context); + }); }; const deserializeAws_restJson1TraceUser = (output: any, context: __SerdeContext): TraceUser => { @@ -3831,7 +4168,14 @@ const deserializeAws_restJson1TraceUser = (output: any, context: __SerdeContext) }; const deserializeAws_restJson1TraceUsers = (output: any, context: __SerdeContext): TraceUser[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1TraceUser(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1TraceUser(entry, context); + }); }; const deserializeAws_restJson1UnprocessedStatistics = (output: any, context: __SerdeContext): UnprocessedStatistics => { @@ -3846,11 +4190,25 @@ const deserializeAws_restJson1UnprocessedStatisticsList = ( output: any, context: __SerdeContext ): UnprocessedStatistics[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UnprocessedStatistics(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UnprocessedStatistics(entry, context); + }); }; const deserializeAws_restJson1UnprocessedTraceIdList = (output: any, context: __SerdeContext): string[] => { - return (output || []).map((entry: any) => entry); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return entry; + }); }; const deserializeAws_restJson1UnprocessedTraceSegment = ( @@ -3868,11 +4226,25 @@ const deserializeAws_restJson1UnprocessedTraceSegmentList = ( output: any, context: __SerdeContext ): UnprocessedTraceSegment[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1UnprocessedTraceSegment(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1UnprocessedTraceSegment(entry, context); + }); }; const deserializeAws_restJson1ValuesWithServiceIds = (output: any, context: __SerdeContext): ValueWithServiceIds[] => { - return (output || []).map((entry: any) => deserializeAws_restJson1ValueWithServiceIds(entry, context)); + return (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ValueWithServiceIds(entry, context); + }); }; const deserializeAws_restJson1ValueWithServiceIds = (output: any, context: __SerdeContext): ValueWithServiceIds => { @@ -3908,6 +4280,7 @@ const collectBodyString = (streamBody: any, context: __SerdeContext): Promise value !== undefined && + value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); diff --git a/protocol_tests/aws-restjson/protocols/Aws_restJson1.ts b/protocol_tests/aws-restjson/protocols/Aws_restJson1.ts index 06ea4fcd4b43..8e62caebbe17 100644 --- a/protocol_tests/aws-restjson/protocols/Aws_restJson1.ts +++ b/protocol_tests/aws-restjson/protocols/Aws_restJson1.ts @@ -132,9 +132,7 @@ export const serializeAws_restJson1AllQueryStringTypesCommand = async ( input: AllQueryStringTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/AllQueryStringTypesInput"; const query: any = { ...(input.queryString !== undefined && { String: input.queryString }), @@ -194,9 +192,7 @@ export const serializeAws_restJson1ConstantAndVariableQueryStringCommand = async input: ConstantAndVariableQueryStringCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/ConstantAndVariableQueryString"; const query: any = { foo: "bar", @@ -221,9 +217,7 @@ export const serializeAws_restJson1ConstantQueryStringCommand = async ( input: ConstantQueryStringCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/ConstantQueryString/{hello}"; if (input.hello !== undefined) { const labelValue: string = input.hello; @@ -256,9 +250,7 @@ export const serializeAws_restJson1EmptyInputAndEmptyOutputCommand = async ( input: EmptyInputAndEmptyOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/EmptyInputAndEmptyOutput"; let body: any; body = ""; @@ -278,9 +270,7 @@ export const serializeAws_restJson1GreetingWithErrorsCommand = async ( input: GreetingWithErrorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/GreetingWithErrors"; let body: any; body = ""; @@ -379,7 +369,6 @@ export const serializeAws_restJson1HttpPrefixHeadersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.foo) && { "X-Foo": input.foo! }), ...(input.fooMap !== undefined && Object.keys(input.fooMap).reduce((acc: any, suffix: string) => { @@ -405,9 +394,7 @@ export const serializeAws_restJson1HttpPrefixHeadersResponseCommand = async ( input: HttpPrefixHeadersResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/HttpPrefixHeadersResponse"; let body: any; body = ""; @@ -427,9 +414,7 @@ export const serializeAws_restJson1HttpRequestWithGreedyLabelInPathCommand = asy input: HttpRequestWithGreedyLabelInPathCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}"; if (input.foo !== undefined) { const labelValue: string = input.foo; @@ -472,9 +457,7 @@ export const serializeAws_restJson1HttpRequestWithLabelsCommand = async ( input: HttpRequestWithLabelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}"; if (input.string !== undefined) { const labelValue: string = input.string; @@ -565,9 +548,7 @@ export const serializeAws_restJson1HttpRequestWithLabelsAndTimestampFormatComman input: HttpRequestWithLabelsAndTimestampFormatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}"; if (input.memberEpochSeconds !== undefined) { @@ -650,9 +631,7 @@ export const serializeAws_restJson1HttpResponseCodeCommand = async ( input: HttpResponseCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/HttpResponseCode"; let body: any; body = ""; @@ -672,9 +651,7 @@ export const serializeAws_restJson1IgnoreQueryParamsInResponseCommand = async ( input: IgnoreQueryParamsInResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/IgnoreQueryParamsInResponse"; let body: any; body = ""; @@ -750,7 +727,6 @@ export const serializeAws_restJson1InputAndOutputWithHeadersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.headerString) && { "X-String": input.headerString! }), ...(isSerializableHeaderValue(input.headerByte) && { "X-Byte": input.headerByte!.toString() }), ...(isSerializableHeaderValue(input.headerShort) && { "X-Short": input.headerShort!.toString() }), @@ -1019,7 +995,6 @@ export const serializeAws_restJson1MediaTypeHeaderCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.json) && { "X-Json": Buffer.from(__LazyJsonString.fromObject(input.json!)).toString("base64"), }), @@ -1042,9 +1017,7 @@ export const serializeAws_restJson1NoInputAndNoOutputCommand = async ( input: NoInputAndNoOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/NoInputAndNoOutput"; let body: any; body = ""; @@ -1064,9 +1037,7 @@ export const serializeAws_restJson1NoInputAndOutputCommand = async ( input: NoInputAndOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/NoInputAndOutputOutput"; let body: any; body = ""; @@ -1087,7 +1058,6 @@ export const serializeAws_restJson1NullAndEmptyHeadersClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.a) && { "X-A": input.a! }), ...(isSerializableHeaderValue(input.b) && { "X-B": input.b! }), ...(isSerializableHeaderValue(input.c) && { "X-C": (input.c! || []).map((_entry) => _entry).join(", ") }), @@ -1111,7 +1081,6 @@ export const serializeAws_restJson1NullAndEmptyHeadersServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.a) && { "X-A": input.a! }), ...(isSerializableHeaderValue(input.b) && { "X-B": input.b! }), ...(isSerializableHeaderValue(input.c) && { "X-C": (input.c! || []).map((_entry) => _entry).join(", ") }), @@ -1134,9 +1103,7 @@ export const serializeAws_restJson1OmitsNullSerializesEmptyStringCommand = async input: OmitsNullSerializesEmptyStringCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/OmitsNullSerializesEmptyString"; const query: any = { ...(input.nullValue !== undefined && { Null: input.nullValue }), @@ -1160,9 +1127,7 @@ export const serializeAws_restJson1QueryIdempotencyTokenAutoFillCommand = async input: QueryIdempotencyTokenAutoFillCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/QueryIdempotencyTokenAutoFill"; const query: any = { ...(input.token !== undefined && { token: input.token }), @@ -1323,7 +1288,6 @@ export const serializeAws_restJson1TimestampFormatHeadersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.memberEpochSeconds) && { "X-memberEpochSeconds": Math.round(input.memberEpochSeconds!.getTime() / 1000).toString(), }), diff --git a/protocol_tests/aws-restxml/protocols/Aws_restXml.ts b/protocol_tests/aws-restxml/protocols/Aws_restXml.ts index 3d0c02fb4ca3..d721193ea2b5 100644 --- a/protocol_tests/aws-restxml/protocols/Aws_restXml.ts +++ b/protocol_tests/aws-restxml/protocols/Aws_restXml.ts @@ -149,9 +149,7 @@ export const serializeAws_restXmlAllQueryStringTypesCommand = async ( input: AllQueryStringTypesCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/AllQueryStringTypesInput"; const query: any = { ...(input.queryString !== undefined && { String: input.queryString }), @@ -211,9 +209,7 @@ export const serializeAws_restXmlConstantAndVariableQueryStringCommand = async ( input: ConstantAndVariableQueryStringCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/ConstantAndVariableQueryString"; const query: any = { foo: "bar", @@ -238,9 +234,7 @@ export const serializeAws_restXmlConstantQueryStringCommand = async ( input: ConstantQueryStringCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/ConstantQueryString/{hello}"; if (input.hello !== undefined) { const labelValue: string = input.hello; @@ -273,9 +267,7 @@ export const serializeAws_restXmlEmptyInputAndEmptyOutputCommand = async ( input: EmptyInputAndEmptyOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/EmptyInputAndEmptyOutput"; let body: any; body = ""; @@ -357,9 +349,7 @@ export const serializeAws_restXmlFlattenedXmlMapWithXmlNamespaceCommand = async input: FlattenedXmlMapWithXmlNamespaceCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/FlattenedXmlMapWithXmlNamespace"; let body: any; body = ""; @@ -379,9 +369,7 @@ export const serializeAws_restXmlGreetingWithErrorsCommand = async ( input: GreetingWithErrorsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/GreetingWithErrors"; let body: any; body = ""; @@ -566,7 +554,6 @@ export const serializeAws_restXmlHttpPrefixHeadersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.foo) && { "X-Foo": input.foo! }), ...(input.fooMap !== undefined && Object.keys(input.fooMap).reduce((acc: any, suffix: string) => { @@ -592,9 +579,7 @@ export const serializeAws_restXmlHttpRequestWithGreedyLabelInPathCommand = async input: HttpRequestWithGreedyLabelInPathCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}"; if (input.foo !== undefined) { const labelValue: string = input.foo; @@ -637,9 +622,7 @@ export const serializeAws_restXmlHttpRequestWithLabelsCommand = async ( input: HttpRequestWithLabelsCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}"; if (input.string !== undefined) { const labelValue: string = input.string; @@ -730,9 +713,7 @@ export const serializeAws_restXmlHttpRequestWithLabelsAndTimestampFormatCommand input: HttpRequestWithLabelsAndTimestampFormatCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}"; if (input.memberEpochSeconds !== undefined) { @@ -815,9 +796,7 @@ export const serializeAws_restXmlHttpResponseCodeCommand = async ( input: HttpResponseCodeCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/HttpResponseCode"; let body: any; body = ""; @@ -837,9 +816,7 @@ export const serializeAws_restXmlIgnoreQueryParamsInResponseCommand = async ( input: IgnoreQueryParamsInResponseCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/IgnoreQueryParamsInResponse"; let body: any; body = ""; @@ -860,7 +837,6 @@ export const serializeAws_restXmlInputAndOutputWithHeadersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.headerString) && { "X-String": input.headerString! }), ...(isSerializableHeaderValue(input.headerByte) && { "X-Byte": input.headerByte!.toString() }), ...(isSerializableHeaderValue(input.headerShort) && { "X-Short": input.headerShort!.toString() }), @@ -914,9 +890,7 @@ export const serializeAws_restXmlNoInputAndNoOutputCommand = async ( input: NoInputAndNoOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/NoInputAndNoOutput"; let body: any; body = ""; @@ -936,9 +910,7 @@ export const serializeAws_restXmlNoInputAndOutputCommand = async ( input: NoInputAndOutputCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/NoInputAndOutputOutput"; let body: any; body = ""; @@ -959,7 +931,6 @@ export const serializeAws_restXmlNullAndEmptyHeadersClientCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.a) && { "X-A": input.a! }), ...(isSerializableHeaderValue(input.b) && { "X-B": input.b! }), ...(isSerializableHeaderValue(input.c) && { "X-C": (input.c! || []).map((_entry) => _entry).join(", ") }), @@ -983,7 +954,6 @@ export const serializeAws_restXmlNullAndEmptyHeadersServerCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.a) && { "X-A": input.a! }), ...(isSerializableHeaderValue(input.b) && { "X-B": input.b! }), ...(isSerializableHeaderValue(input.c) && { "X-C": (input.c! || []).map((_entry) => _entry).join(", ") }), @@ -1006,9 +976,7 @@ export const serializeAws_restXmlOmitsNullSerializesEmptyStringCommand = async ( input: OmitsNullSerializesEmptyStringCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/OmitsNullSerializesEmptyString"; const query: any = { ...(input.nullValue !== undefined && { Null: input.nullValue }), @@ -1032,9 +1000,7 @@ export const serializeAws_restXmlQueryIdempotencyTokenAutoFillCommand = async ( input: QueryIdempotencyTokenAutoFillCommandInput, context: __SerdeContext ): Promise<__HttpRequest> => { - const headers: any = { - "content-type": "", - }; + const headers: any = {}; let resolvedPath = "/QueryIdempotencyTokenAutoFill"; const query: any = { ...(input.token !== undefined && { token: input.token }), @@ -1155,7 +1121,6 @@ export const serializeAws_restXmlTimestampFormatHeadersCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const headers: any = { - "content-type": "", ...(isSerializableHeaderValue(input.memberEpochSeconds) && { "X-memberEpochSeconds": Math.round(input.memberEpochSeconds!.getTime() / 1000).toString(), }),